-
Notifications
You must be signed in to change notification settings - Fork 2k
[PM-40848] Add the shared folder card grid component (libs/vault) #22390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
jengstrom-bw
wants to merge
12
commits into
main
Choose a base branch
from
vault/pm-40848/add-the-shared-folder-card-grid-component-libs-vault
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6dd0e75
initial pass
jengstrom-bw 1040593
initial pass of component
jengstrom-bw 22a64c5
update header text
jengstrom-bw 82e7407
update storybook to default to vfo1 enabled
jengstrom-bw 8c6deef
bold number in # of shared folder
jengstrom-bw b5ab72e
increase size of header text
jengstrom-bw 7b08e58
update spacing
jengstrom-bw e4be3f1
add more vertical padding on card
jengstrom-bw d731993
update copy for X shared folders to be singular when count = 1
jengstrom-bw 459875a
update copy for a11y announcement when exactly 1 overflow card exists
jengstrom-bw e5a1cac
fix this.overflowCards() access
jengstrom-bw aad2325
change padding on cards
jengstrom-bw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
libs/vault/src/components/shared-folder-card-grid/shared-folder-card-grid.component.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| @let overflow = overflowCards(); | ||
|
|
||
| @if (count() > 0) { | ||
| <section [attr.aria-labelledby]="headingId"> | ||
| <div class="tw-mb-3 tw-flex tw-items-baseline tw-justify-between tw-gap-4"> | ||
| <h2 [id]="headingId" bitTypography="h4" class="tw-mb-0"> | ||
| {{ "collectionsInParent" | vfo1I18n: "sharedFoldersInParent" : parentName() }} | ||
| </h2> | ||
| @let countText = countSegments(); | ||
| <span bitTypography="body2" class="tw-shrink-0 tw-text-muted" | ||
| >{{ countText.before | ||
| }}<strong class="tw-text-main tw-font-bold">{{ countText.count }}</strong | ||
| >{{ countText.after }}</span | ||
| > | ||
| </div> | ||
|
|
||
| <ul | ||
| class="tw-m-0 tw-grid tw-list-none tw-gap-3 tw-p-0" | ||
| [style.grid-template-columns]="gridTemplateColumns" | ||
| > | ||
| @for (folder of visibleCards(); track folder.id) { | ||
| <ng-container | ||
| [ngTemplateOutlet]="card" | ||
| [ngTemplateOutletContext]="{ $implicit: folder }" | ||
| ></ng-container> | ||
| } | ||
| </ul> | ||
|
|
||
| @if (overflow.length > 0) { | ||
| <bit-disclosure #overflowRows [(open)]="expanded"> | ||
| <ul | ||
| class="tw-m-0 tw-mt-3 tw-grid tw-list-none tw-gap-3 tw-p-0" | ||
| [style.grid-template-columns]="gridTemplateColumns" | ||
| > | ||
| @for (folder of overflow; track folder.id) { | ||
| <ng-container | ||
| [ngTemplateOutlet]="card" | ||
| [ngTemplateOutletContext]="{ $implicit: folder }" | ||
| ></ng-container> | ||
| } | ||
| </ul> | ||
| </bit-disclosure> | ||
|
|
||
| <button | ||
| id="shared-folder-card-grid_button_toggle-overflow" | ||
| type="button" | ||
| bitLink | ||
| linkType="primary" | ||
| class="tw-mt-3" | ||
| [endIcon]="expanded() ? 'bwi-angle-up' : 'bwi-angle-down'" | ||
| [bitDisclosureTriggerFor]="overflowRows" | ||
| > | ||
| {{ (expanded() ? "showLess" : "showAll") | i18n }} | ||
| </button> | ||
| } | ||
| </section> | ||
| } | ||
|
|
||
| <ng-template #card let-folder> | ||
| <li> | ||
| <!-- | ||
| `bit-item` gives the interactive row composition these cards need (start/end slots, hover, | ||
| focus-visible-within, truncation) but is styled to stack as a list: `tw-border-0 tw-border-b`, | ||
| so only a bottom divider shows. Promote the border to all four sides using the same token | ||
| `BaseCardDirective` applies, so these match every other card in the system. | ||
| Remove once CL-1281 ships a first-class card variant. | ||
| --> | ||
| <bit-item class="!tw-mb-0 !tw-border !tw-border-border-base"> | ||
| <a | ||
| bit-item-content | ||
| [routerLink]="folder.commands" | ||
| [queryParams]="folder.queryParams" | ||
| [queryParamsHandling]="folder.queryParamsHandling" | ||
| [state]="folder.state" | ||
| > | ||
| <bit-icon-tile slot="start" [icon]="'bwi-collection-shared' | vfo1Icon"></bit-icon-tile> | ||
| {{ folder.name }} | ||
| <bit-icon slot="end" name="bwi-angle-right" class="tw-text-main bwi-lg" /> | ||
| </a> | ||
| </bit-item> | ||
| </li> | ||
| </ng-template> | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.