@slipstream-ui/core 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -4
- package/dist/index.d.mts +25 -6
- package/dist/index.d.ts +25 -6
- package/dist/index.js +85 -47
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +85 -47
- package/dist/index.mjs.map +1 -1
- package/dist/manifests/accordion.manifest.json +1 -1
- package/dist/manifests/alert.manifest.json +1 -1
- package/dist/manifests/announcement-bar.manifest.json +1 -1
- package/dist/manifests/app-shell.manifest.json +1 -1
- package/dist/manifests/applied-filters.manifest.json +1 -1
- package/dist/manifests/article-card.manifest.json +1 -1
- package/dist/manifests/auth-layout.manifest.json +1 -1
- package/dist/manifests/autocomplete.manifest.json +1 -1
- package/dist/manifests/avatar.manifest.json +1 -1
- package/dist/manifests/badge.manifest.json +1 -1
- package/dist/manifests/block.manifest.json +1 -1
- package/dist/manifests/bottom-nav.manifest.json +1 -1
- package/dist/manifests/breadcrumb.manifest.json +1 -1
- package/dist/manifests/button-group.manifest.json +1 -1
- package/dist/manifests/button.manifest.json +1 -1
- package/dist/manifests/calendar.manifest.json +1 -1
- package/dist/manifests/card.manifest.json +1 -1
- package/dist/manifests/checkbox.manifest.json +1 -1
- package/dist/manifests/comparison-table.manifest.json +1 -1
- package/dist/manifests/confirm-dialog.manifest.json +1 -1
- package/dist/manifests/contact-strip.manifest.json +1 -1
- package/dist/manifests/container.manifest.json +1 -1
- package/dist/manifests/cta-section.manifest.json +1 -1
- package/dist/manifests/data-table.manifest.json +1 -1
- package/dist/manifests/date-picker-popover.manifest.json +1 -1
- package/dist/manifests/date-picker.manifest.json +1 -1
- package/dist/manifests/date-range-picker.manifest.json +1 -1
- package/dist/manifests/deal-card.manifest.json +1 -1
- package/dist/manifests/dialog.manifest.json +1 -1
- package/dist/manifests/document-card.manifest.json +1 -1
- package/dist/manifests/drawer.manifest.json +1 -1
- package/dist/manifests/empty-state.manifest.json +1 -1
- package/dist/manifests/entity-card.manifest.json +1 -1
- package/dist/manifests/feature-grid.manifest.json +1 -1
- package/dist/manifests/feature-row.manifest.json +1 -1
- package/dist/manifests/fieldset.manifest.json +1 -1
- package/dist/manifests/file-upload.manifest.json +1 -1
- package/dist/manifests/filter-bar.manifest.json +1 -1
- package/dist/manifests/filter-chips.manifest.json +1 -1
- package/dist/manifests/filter-panel.manifest.json +1 -1
- package/dist/manifests/flex.manifest.json +1 -1
- package/dist/manifests/form-field.manifest.json +1 -1
- package/dist/manifests/form-layout.manifest.json +1 -1
- package/dist/manifests/form.manifest.json +1 -1
- package/dist/manifests/grid.manifest.json +1 -1
- package/dist/manifests/heading.manifest.json +1 -1
- package/dist/manifests/hero.manifest.json +1 -1
- package/dist/manifests/image.manifest.json +1 -1
- package/dist/manifests/input-group.manifest.json +1 -1
- package/dist/manifests/input.manifest.json +1 -1
- package/dist/manifests/label.manifest.json +1 -1
- package/dist/manifests/link-tabs.manifest.json +1 -1
- package/dist/manifests/link.manifest.json +1 -1
- package/dist/manifests/list.manifest.json +1 -1
- package/dist/manifests/load-more.manifest.json +2 -2
- package/dist/manifests/logo-cloud.manifest.json +8 -1
- package/dist/manifests/menu.manifest.json +1 -1
- package/dist/manifests/metric-card.manifest.json +1 -1
- package/dist/manifests/multi-select.manifest.json +1 -1
- package/dist/manifests/newsletter.manifest.json +1 -1
- package/dist/manifests/page-header.manifest.json +1 -1
- package/dist/manifests/pagination.manifest.json +1 -1
- package/dist/manifests/password-input.manifest.json +1 -1
- package/dist/manifests/popover.manifest.json +1 -1
- package/dist/manifests/process-steps.manifest.json +8 -1
- package/dist/manifests/progress.manifest.json +1 -1
- package/dist/manifests/prose.manifest.json +1 -1
- package/dist/manifests/radio.manifest.json +1 -1
- package/dist/manifests/range-slider.manifest.json +1 -1
- package/dist/manifests/search.manifest.json +1 -1
- package/dist/manifests/section-heading.manifest.json +1 -1
- package/dist/manifests/section.manifest.json +1 -1
- package/dist/manifests/segmented-control.manifest.json +1 -1
- package/dist/manifests/select-menu.manifest.json +1 -1
- package/dist/manifests/select.manifest.json +1 -1
- package/dist/manifests/separator.manifest.json +1 -1
- package/dist/manifests/site-footer.manifest.json +1 -1
- package/dist/manifests/site-header.manifest.json +1 -1
- package/dist/manifests/skeleton.manifest.json +1 -1
- package/dist/manifests/spinner.manifest.json +1 -1
- package/dist/manifests/stat-band.manifest.json +1 -1
- package/dist/manifests/stepper.manifest.json +1 -1
- package/dist/manifests/switch.manifest.json +1 -1
- package/dist/manifests/table-card.manifest.json +1 -1
- package/dist/manifests/table-of-contents.manifest.json +1 -1
- package/dist/manifests/table.manifest.json +1 -1
- package/dist/manifests/tabs.manifest.json +1 -1
- package/dist/manifests/testimonial.manifest.json +1 -1
- package/dist/manifests/text.manifest.json +1 -1
- package/dist/manifests/textarea.manifest.json +1 -1
- package/dist/manifests/theme-toggle.manifest.json +1 -1
- package/dist/manifests/time-picker.manifest.json +1 -1
- package/dist/manifests/timeline.manifest.json +1 -1
- package/dist/manifests/toast.manifest.json +1 -1
- package/dist/manifests/tombstone-card.manifest.json +1 -1
- package/dist/manifests/tooltip.manifest.json +1 -1
- package/dist/src/components/bottom-nav/BottomNav.js +1 -1
- package/dist/src/components/bottom-nav/BottomNav.js.map +1 -1
- package/dist/src/components/bottom-nav/BottomNav.mjs +1 -1
- package/dist/src/components/bottom-nav/BottomNav.mjs.map +1 -1
- package/dist/src/components/button/Button.js +1 -1
- package/dist/src/components/button/Button.js.map +1 -1
- package/dist/src/components/button/Button.mjs +1 -1
- package/dist/src/components/button/Button.mjs.map +1 -1
- package/dist/src/components/contact-strip/ContactStrip.js +2 -2
- package/dist/src/components/contact-strip/ContactStrip.js.map +1 -1
- package/dist/src/components/contact-strip/ContactStrip.mjs +2 -2
- package/dist/src/components/contact-strip/ContactStrip.mjs.map +1 -1
- package/dist/src/components/date-picker-popover/DatePickerPopover.d.ts +3 -0
- package/dist/src/components/date-picker-popover/DatePickerPopover.js +5 -1
- package/dist/src/components/date-picker-popover/DatePickerPopover.js.map +1 -1
- package/dist/src/components/date-picker-popover/DatePickerPopover.mjs +5 -1
- package/dist/src/components/date-picker-popover/DatePickerPopover.mjs.map +1 -1
- package/dist/src/components/deal-card/DealCard.js +2 -2
- package/dist/src/components/deal-card/DealCard.js.map +1 -1
- package/dist/src/components/deal-card/DealCard.mjs +2 -2
- package/dist/src/components/deal-card/DealCard.mjs.map +1 -1
- package/dist/src/components/document-card/DocumentCard.js +1 -1
- package/dist/src/components/document-card/DocumentCard.js.map +1 -1
- package/dist/src/components/document-card/DocumentCard.mjs +1 -1
- package/dist/src/components/document-card/DocumentCard.mjs.map +1 -1
- package/dist/src/components/entity-card/EntityCard.js +2 -2
- package/dist/src/components/entity-card/EntityCard.js.map +1 -1
- package/dist/src/components/entity-card/EntityCard.mjs +2 -2
- package/dist/src/components/entity-card/EntityCard.mjs.map +1 -1
- package/dist/src/components/feature-grid/FeatureGrid.js +2 -2
- package/dist/src/components/feature-grid/FeatureGrid.js.map +1 -1
- package/dist/src/components/feature-grid/FeatureGrid.mjs +2 -2
- package/dist/src/components/feature-grid/FeatureGrid.mjs.map +1 -1
- package/dist/src/components/feature-row/FeatureRow.js +1 -1
- package/dist/src/components/feature-row/FeatureRow.js.map +1 -1
- package/dist/src/components/feature-row/FeatureRow.mjs +1 -1
- package/dist/src/components/feature-row/FeatureRow.mjs.map +1 -1
- package/dist/src/components/file-upload/FileUpload.d.ts +8 -2
- package/dist/src/components/file-upload/FileUpload.js +12 -2
- package/dist/src/components/file-upload/FileUpload.js.map +1 -1
- package/dist/src/components/file-upload/FileUpload.mjs +12 -2
- package/dist/src/components/file-upload/FileUpload.mjs.map +1 -1
- package/dist/src/components/filter-chips/FilterChips.js +1 -1
- package/dist/src/components/filter-chips/FilterChips.js.map +1 -1
- package/dist/src/components/filter-chips/FilterChips.mjs +1 -1
- package/dist/src/components/filter-chips/FilterChips.mjs.map +1 -1
- package/dist/src/components/filter-panel/FilterPanel.js +16 -12
- package/dist/src/components/filter-panel/FilterPanel.js.map +1 -1
- package/dist/src/components/filter-panel/FilterPanel.mjs +16 -12
- package/dist/src/components/filter-panel/FilterPanel.mjs.map +1 -1
- package/dist/src/components/hero/Hero.js +2 -2
- package/dist/src/components/hero/Hero.js.map +1 -1
- package/dist/src/components/hero/Hero.mjs +2 -2
- package/dist/src/components/hero/Hero.mjs.map +1 -1
- package/dist/src/components/image/Image.js +5 -0
- package/dist/src/components/image/Image.js.map +1 -1
- package/dist/src/components/image/Image.mjs +5 -0
- package/dist/src/components/image/Image.mjs.map +1 -1
- package/dist/src/components/list/List.js +5 -4
- package/dist/src/components/list/List.js.map +1 -1
- package/dist/src/components/list/List.mjs +5 -4
- package/dist/src/components/list/List.mjs.map +1 -1
- package/dist/src/components/load-more/LoadMore.d.ts +2 -2
- package/dist/src/components/load-more/LoadMore.js +1 -1
- package/dist/src/components/load-more/LoadMore.js.map +1 -1
- package/dist/src/components/load-more/LoadMore.mjs +1 -1
- package/dist/src/components/load-more/LoadMore.mjs.map +1 -1
- package/dist/src/components/logo-cloud/LogoCloud.d.ts +4 -0
- package/dist/src/components/logo-cloud/LogoCloud.js +2 -1
- package/dist/src/components/logo-cloud/LogoCloud.js.map +1 -1
- package/dist/src/components/logo-cloud/LogoCloud.mjs +2 -1
- package/dist/src/components/logo-cloud/LogoCloud.mjs.map +1 -1
- package/dist/src/components/menu/Menu.d.ts +2 -2
- package/dist/src/components/menu/Menu.js +12 -0
- package/dist/src/components/menu/Menu.js.map +1 -1
- package/dist/src/components/menu/Menu.mjs +12 -0
- package/dist/src/components/menu/Menu.mjs.map +1 -1
- package/dist/src/components/process-steps/ProcessSteps.d.ts +6 -0
- package/dist/src/components/process-steps/ProcessSteps.js +4 -3
- package/dist/src/components/process-steps/ProcessSteps.js.map +1 -1
- package/dist/src/components/process-steps/ProcessSteps.mjs +4 -3
- package/dist/src/components/process-steps/ProcessSteps.mjs.map +1 -1
- package/dist/src/components/prose/Prose.js +1 -1
- package/dist/src/components/prose/Prose.js.map +1 -1
- package/dist/src/components/prose/Prose.mjs +1 -1
- package/dist/src/components/prose/Prose.mjs.map +1 -1
- package/dist/src/components/radio/Radio.js +1 -1
- package/dist/src/components/radio/Radio.js.map +1 -1
- package/dist/src/components/radio/Radio.mjs +1 -1
- package/dist/src/components/radio/Radio.mjs.map +1 -1
- package/dist/src/components/select-menu/SelectMenu.js +1 -1
- package/dist/src/components/select-menu/SelectMenu.js.map +1 -1
- package/dist/src/components/select-menu/SelectMenu.mjs +1 -1
- package/dist/src/components/select-menu/SelectMenu.mjs.map +1 -1
- package/dist/src/components/stepper/Stepper.js +1 -1
- package/dist/src/components/stepper/Stepper.js.map +1 -1
- package/dist/src/components/stepper/Stepper.mjs +1 -1
- package/dist/src/components/stepper/Stepper.mjs.map +1 -1
- package/dist/src/components/table-of-contents/TableOfContents.js +1 -1
- package/dist/src/components/table-of-contents/TableOfContents.js.map +1 -1
- package/dist/src/components/table-of-contents/TableOfContents.mjs +1 -1
- package/dist/src/components/table-of-contents/TableOfContents.mjs.map +1 -1
- package/dist/src/components/toast/Toast.js +1 -1
- package/dist/src/components/toast/Toast.js.map +1 -1
- package/dist/src/components/toast/Toast.mjs +1 -1
- package/dist/src/components/toast/Toast.mjs.map +1 -1
- package/dist/src/components/toast/Toaster.js +1 -1
- package/dist/src/components/toast/Toaster.js.map +1 -1
- package/dist/src/components/toast/Toaster.mjs +1 -1
- package/dist/src/components/toast/Toaster.mjs.map +1 -1
- package/dist/src/components/tombstone-card/TombstoneCard.js +1 -1
- package/dist/src/components/tombstone-card/TombstoneCard.js.map +1 -1
- package/dist/src/components/tombstone-card/TombstoneCard.mjs +1 -1
- package/dist/src/components/tombstone-card/TombstoneCard.mjs.map +1 -1
- package/dist/styles-full.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +5 -3
- package/src/components/bottom-nav/BottomNav.tsx +1 -1
- package/src/components/button/Button.tsx +1 -1
- package/src/components/calendar/Calendar.test.tsx +1 -1
- package/src/components/contact-strip/ContactStrip.tsx +2 -2
- package/src/components/date-picker-popover/DatePickerPopover.test.tsx +15 -0
- package/src/components/date-picker-popover/DatePickerPopover.tsx +7 -0
- package/src/components/deal-card/DealCard.tsx +2 -2
- package/src/components/document-card/DocumentCard.tsx +1 -1
- package/src/components/entity-card/EntityCard.tsx +2 -2
- package/src/components/feature-grid/FeatureGrid.tsx +2 -2
- package/src/components/feature-row/FeatureRow.tsx +1 -1
- package/src/components/file-upload/FileUpload.test.tsx +10 -0
- package/src/components/file-upload/FileUpload.tsx +18 -3
- package/src/components/filter-chips/FilterChips.tsx +1 -1
- package/src/components/filter-panel/FilterPanel.test.tsx +19 -0
- package/src/components/filter-panel/FilterPanel.tsx +18 -14
- package/src/components/grid/Grid.test.tsx +3 -1
- package/src/components/hero/Hero.tsx +2 -2
- package/src/components/image/Image.test.tsx +24 -0
- package/src/components/image/Image.tsx +7 -0
- package/src/components/input/Input.ssr.test.tsx +1 -1
- package/src/components/list/List.test.tsx +18 -0
- package/src/components/list/List.tsx +18 -12
- package/src/components/load-more/LoadMore.tsx +2 -2
- package/src/components/logo-cloud/LogoCloud.tsx +4 -1
- package/src/components/menu/Menu.test.tsx +15 -0
- package/src/components/menu/Menu.tsx +21 -2
- package/src/components/process-steps/ProcessSteps.tsx +7 -3
- package/src/components/prose/Prose.tsx +1 -1
- package/src/components/radio/Radio.test.tsx +10 -0
- package/src/components/radio/Radio.tsx +1 -1
- package/src/components/section/Section.test.tsx +1 -1
- package/src/components/select-menu/SelectMenu.tsx +1 -1
- package/src/components/stepper/Stepper.tsx +1 -1
- package/src/components/table-of-contents/TableOfContents.tsx +1 -1
- package/src/components/toast/Toast.tsx +1 -1
- package/src/components/toast/Toaster.tsx +1 -1
- package/src/components/tombstone-card/TombstoneCard.tsx +1 -1
- package/src/manifests/accordion.manifest.json +1 -1
- package/src/manifests/alert.manifest.json +1 -1
- package/src/manifests/announcement-bar.manifest.json +1 -1
- package/src/manifests/app-shell.manifest.json +1 -1
- package/src/manifests/applied-filters.manifest.json +1 -1
- package/src/manifests/article-card.manifest.json +1 -1
- package/src/manifests/auth-layout.manifest.json +1 -1
- package/src/manifests/autocomplete.manifest.json +1 -1
- package/src/manifests/avatar.manifest.json +1 -1
- package/src/manifests/badge.manifest.json +1 -1
- package/src/manifests/block.manifest.json +1 -1
- package/src/manifests/bottom-nav.manifest.json +1 -1
- package/src/manifests/breadcrumb.manifest.json +1 -1
- package/src/manifests/button-group.manifest.json +1 -1
- package/src/manifests/button.manifest.json +1 -1
- package/src/manifests/calendar.manifest.json +1 -1
- package/src/manifests/card.manifest.json +1 -1
- package/src/manifests/checkbox.manifest.json +1 -1
- package/src/manifests/comparison-table.manifest.json +1 -1
- package/src/manifests/confirm-dialog.manifest.json +1 -1
- package/src/manifests/contact-strip.manifest.json +1 -1
- package/src/manifests/container.manifest.json +1 -1
- package/src/manifests/cta-section.manifest.json +1 -1
- package/src/manifests/data-table.manifest.json +1 -1
- package/src/manifests/date-picker-popover.manifest.json +1 -1
- package/src/manifests/date-picker.manifest.json +1 -1
- package/src/manifests/date-range-picker.manifest.json +1 -1
- package/src/manifests/deal-card.manifest.json +1 -1
- package/src/manifests/dialog.manifest.json +1 -1
- package/src/manifests/document-card.manifest.json +1 -1
- package/src/manifests/drawer.manifest.json +1 -1
- package/src/manifests/empty-state.manifest.json +1 -1
- package/src/manifests/entity-card.manifest.json +1 -1
- package/src/manifests/feature-grid.manifest.json +1 -1
- package/src/manifests/feature-row.manifest.json +1 -1
- package/src/manifests/fieldset.manifest.json +1 -1
- package/src/manifests/file-upload.manifest.json +1 -1
- package/src/manifests/filter-bar.manifest.json +1 -1
- package/src/manifests/filter-chips.manifest.json +1 -1
- package/src/manifests/filter-panel.manifest.json +1 -1
- package/src/manifests/flex.manifest.json +1 -1
- package/src/manifests/form-field.manifest.json +1 -1
- package/src/manifests/form-layout.manifest.json +1 -1
- package/src/manifests/form.manifest.json +1 -1
- package/src/manifests/grid.manifest.json +1 -1
- package/src/manifests/heading.manifest.json +1 -1
- package/src/manifests/hero.manifest.json +1 -1
- package/src/manifests/image.manifest.json +1 -1
- package/src/manifests/input-group.manifest.json +1 -1
- package/src/manifests/input.manifest.json +1 -1
- package/src/manifests/label.manifest.json +1 -1
- package/src/manifests/link-tabs.manifest.json +1 -1
- package/src/manifests/link.manifest.json +1 -1
- package/src/manifests/list.manifest.json +1 -1
- package/src/manifests/load-more.manifest.json +2 -2
- package/src/manifests/logo-cloud.manifest.json +8 -1
- package/src/manifests/menu.manifest.json +1 -1
- package/src/manifests/metric-card.manifest.json +1 -1
- package/src/manifests/multi-select.manifest.json +1 -1
- package/src/manifests/newsletter.manifest.json +1 -1
- package/src/manifests/page-header.manifest.json +1 -1
- package/src/manifests/pagination.manifest.json +1 -1
- package/src/manifests/password-input.manifest.json +1 -1
- package/src/manifests/popover.manifest.json +1 -1
- package/src/manifests/process-steps.manifest.json +8 -1
- package/src/manifests/progress.manifest.json +1 -1
- package/src/manifests/prose.manifest.json +1 -1
- package/src/manifests/radio.manifest.json +1 -1
- package/src/manifests/range-slider.manifest.json +1 -1
- package/src/manifests/search.manifest.json +1 -1
- package/src/manifests/section-heading.manifest.json +1 -1
- package/src/manifests/section.manifest.json +1 -1
- package/src/manifests/segmented-control.manifest.json +1 -1
- package/src/manifests/select-menu.manifest.json +1 -1
- package/src/manifests/select.manifest.json +1 -1
- package/src/manifests/separator.manifest.json +1 -1
- package/src/manifests/site-footer.manifest.json +1 -1
- package/src/manifests/site-header.manifest.json +1 -1
- package/src/manifests/skeleton.manifest.json +1 -1
- package/src/manifests/spinner.manifest.json +1 -1
- package/src/manifests/stat-band.manifest.json +1 -1
- package/src/manifests/stepper.manifest.json +1 -1
- package/src/manifests/switch.manifest.json +1 -1
- package/src/manifests/table-card.manifest.json +1 -1
- package/src/manifests/table-of-contents.manifest.json +1 -1
- package/src/manifests/table.manifest.json +1 -1
- package/src/manifests/tabs.manifest.json +1 -1
- package/src/manifests/testimonial.manifest.json +1 -1
- package/src/manifests/text.manifest.json +1 -1
- package/src/manifests/textarea.manifest.json +1 -1
- package/src/manifests/theme-toggle.manifest.json +1 -1
- package/src/manifests/time-picker.manifest.json +1 -1
- package/src/manifests/timeline.manifest.json +1 -1
- package/src/manifests/toast.manifest.json +1 -1
- package/src/manifests/tombstone-card.manifest.json +1 -1
- package/src/manifests/tooltip.manifest.json +1 -1
|
@@ -32,6 +32,9 @@ export type DatePickerPopoverProps = {
|
|
|
32
32
|
id?: string;
|
|
33
33
|
className?: string;
|
|
34
34
|
'aria-label'?: string;
|
|
35
|
+
/** Wired by FormField so hint/error copy is announced with the trigger. */
|
|
36
|
+
'aria-describedby'?: string;
|
|
37
|
+
'aria-invalid'?: boolean | 'true' | 'false';
|
|
35
38
|
};
|
|
36
39
|
|
|
37
40
|
/**
|
|
@@ -57,6 +60,8 @@ const DatePickerPopover = React.forwardRef<HTMLButtonElement, DatePickerPopoverP
|
|
|
57
60
|
id,
|
|
58
61
|
className,
|
|
59
62
|
'aria-label': ariaLabel,
|
|
63
|
+
'aria-describedby': ariaDescribedBy,
|
|
64
|
+
'aria-invalid': ariaInvalid,
|
|
60
65
|
},
|
|
61
66
|
ref
|
|
62
67
|
) => {
|
|
@@ -81,6 +86,8 @@ const DatePickerPopover = React.forwardRef<HTMLButtonElement, DatePickerPopoverP
|
|
|
81
86
|
id={id}
|
|
82
87
|
disabled={disabled}
|
|
83
88
|
aria-label={ariaLabel}
|
|
89
|
+
aria-describedby={ariaDescribedBy}
|
|
90
|
+
aria-invalid={ariaInvalid}
|
|
84
91
|
className={cn(
|
|
85
92
|
buttonVariants({ variant: 'outline' }),
|
|
86
93
|
'w-full justify-start font-normal',
|
|
@@ -83,12 +83,12 @@ export const DealCard = React.forwardRef<HTMLElement, DealCardProps>(function De
|
|
|
83
83
|
<Card ref={ref as never} className={cn('flex h-full flex-col overflow-hidden', className)} {...props}>
|
|
84
84
|
<CardHeader className="gap-2 p-5 pb-3">
|
|
85
85
|
<div className="flex items-start justify-between gap-2">
|
|
86
|
-
<p className="text-xs font-semibold uppercase tracking-widest text-primary">{sector}</p>
|
|
86
|
+
<p className="text-xs font-semibold uppercase tracking-widest text-primary-ink">{sector}</p>
|
|
87
87
|
<Badge variant={statusInfo.variant}>{statusInfo.label}</Badge>
|
|
88
88
|
</div>
|
|
89
89
|
<h3 className="text-lg font-semibold leading-snug tracking-tight">
|
|
90
90
|
{href ? (
|
|
91
|
-
<Link href={href} className="rounded-sm hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
|
|
91
|
+
<Link href={href} className="rounded-sm hover:text-primary-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
|
|
92
92
|
{title}
|
|
93
93
|
</Link>
|
|
94
94
|
) : (
|
|
@@ -56,7 +56,7 @@ export const DocumentCard = React.forwardRef<HTMLElement, DocumentCardProps>(fun
|
|
|
56
56
|
return (
|
|
57
57
|
<Card ref={ref as never} className={cn('w-full', className)} {...props}>
|
|
58
58
|
<CardContent className="flex items-center gap-3 p-4">
|
|
59
|
-
<span className="flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary [&_svg]:size-5">
|
|
59
|
+
<span className="flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary-ink [&_svg]:size-5">
|
|
60
60
|
{icon ?? <span className="text-[10px] font-bold uppercase tracking-wide">{fileType}</span>}
|
|
61
61
|
</span>
|
|
62
62
|
<div className="min-w-0 flex-1">
|
|
@@ -78,7 +78,7 @@ export const EntityCard = React.forwardRef<HTMLElement, EntityCardProps>(functio
|
|
|
78
78
|
<div className="min-w-0 flex-1">
|
|
79
79
|
<h3 className="truncate text-base font-semibold tracking-tight">
|
|
80
80
|
{href ? (
|
|
81
|
-
<Link href={href} className="rounded-sm hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
|
|
81
|
+
<Link href={href} className="rounded-sm hover:text-primary-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
|
|
82
82
|
{name}
|
|
83
83
|
</Link>
|
|
84
84
|
) : (
|
|
@@ -116,7 +116,7 @@ export const EntityCard = React.forwardRef<HTMLElement, EntityCardProps>(functio
|
|
|
116
116
|
{href && (
|
|
117
117
|
<Link
|
|
118
118
|
href={href}
|
|
119
|
-
className="text-sm font-medium text-primary underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
119
|
+
className="text-sm font-medium text-primary-ink underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
120
120
|
>
|
|
121
121
|
View profile
|
|
122
122
|
</Link>
|
|
@@ -48,14 +48,14 @@ export const FeatureGrid = React.forwardRef<HTMLUListElement, FeatureGridProps>(
|
|
|
48
48
|
const content = (feature: FeatureItem) => (
|
|
49
49
|
<>
|
|
50
50
|
{feature.icon && (
|
|
51
|
-
<span className="flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary [&_svg]:size-5">
|
|
51
|
+
<span className="flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary-ink [&_svg]:size-5">
|
|
52
52
|
{feature.icon}
|
|
53
53
|
</span>
|
|
54
54
|
)}
|
|
55
55
|
<h3 className="text-base font-semibold tracking-tight">{feature.title}</h3>
|
|
56
56
|
{feature.description && <p className="text-sm leading-relaxed text-muted-foreground">{feature.description}</p>}
|
|
57
57
|
{feature.href && feature.actionLabel && (
|
|
58
|
-
<span className="mt-auto pt-2 text-sm font-medium text-primary">
|
|
58
|
+
<span className="mt-auto pt-2 text-sm font-medium text-primary-ink">
|
|
59
59
|
{feature.actionLabel} <span aria-hidden="true">→</span>
|
|
60
60
|
</span>
|
|
61
61
|
)}
|
|
@@ -55,7 +55,7 @@ export const FeatureRow = React.forwardRef<HTMLDivElement, FeatureRowProps>(func
|
|
|
55
55
|
>
|
|
56
56
|
<div className={cn('min-w-0', mediaPosition === 'left' && 'lg:order-2')}>
|
|
57
57
|
{eyebrow && (
|
|
58
|
-
<p className="mb-3 text-xs font-semibold uppercase tracking-widest text-primary">{eyebrow}</p>
|
|
58
|
+
<p className="mb-3 text-xs font-semibold uppercase tracking-widest text-primary-ink">{eyebrow}</p>
|
|
59
59
|
)}
|
|
60
60
|
<Heading className={cn('font-semibold tracking-tight text-balance', titleSizes[size])}>{title}</Heading>
|
|
61
61
|
{description && (
|
|
@@ -36,6 +36,16 @@ describe('FileUpload', () => {
|
|
|
36
36
|
expect(screen.queryByText('report.pdf')).not.toBeInTheDocument();
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
+
it('keeps same-named files distinct and removes only the clicked one', async () => {
|
|
40
|
+
const user = userEvent.setup();
|
|
41
|
+
render(<FileUpload aria-label="Uploads" />);
|
|
42
|
+
await user.upload(screen.getByLabelText(/Drop files here/), [file('a.txt'), file('a.txt')]);
|
|
43
|
+
expect(screen.getAllByText('a.txt')).toHaveLength(2);
|
|
44
|
+
|
|
45
|
+
await user.click(screen.getAllByRole('button', { name: 'Remove a.txt' })[0]);
|
|
46
|
+
expect(screen.getAllByText('a.txt')).toHaveLength(1);
|
|
47
|
+
});
|
|
48
|
+
|
|
39
49
|
it('has no accessibility violations', async () => {
|
|
40
50
|
const { container } = render(<FileUpload aria-label="Files" />);
|
|
41
51
|
expect(await axe(container)).toHaveNoViolations();
|
|
@@ -19,7 +19,10 @@ export type FileUploadProps = Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
|
19
19
|
removeLabel?: (file: File) => string;
|
|
20
20
|
/** Accessible label for a file's upload progress. Default `Uploading <name>`. */
|
|
21
21
|
uploadingLabel?: (file: File) => string;
|
|
22
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Per-file progress (0-100) keyed by file name, rendered as a bar.
|
|
24
|
+
* Same-named files share one progress entry.
|
|
25
|
+
*/
|
|
23
26
|
progress?: Record<string, number>;
|
|
24
27
|
};
|
|
25
28
|
|
|
@@ -60,6 +63,18 @@ export const FileUpload = React.forwardRef<HTMLInputElement, FileUploadProps>(fu
|
|
|
60
63
|
const current = files ?? internal;
|
|
61
64
|
const generatedId = React.useId();
|
|
62
65
|
const inputId = id ?? generatedId;
|
|
66
|
+
// Stable per-File identity: same-named files are distinct objects, so a
|
|
67
|
+
// WeakMap gives each entry a unique key without changing the File API.
|
|
68
|
+
const fileIds = React.useRef(new WeakMap<File, string>());
|
|
69
|
+
const nextFileId = React.useRef(0);
|
|
70
|
+
const idFor = (file: File) => {
|
|
71
|
+
let fileId = fileIds.current.get(file);
|
|
72
|
+
if (!fileId) {
|
|
73
|
+
fileId = `file-${nextFileId.current++}`;
|
|
74
|
+
fileIds.current.set(file, fileId);
|
|
75
|
+
}
|
|
76
|
+
return fileId;
|
|
77
|
+
};
|
|
63
78
|
|
|
64
79
|
const commit = (next: File[]) => {
|
|
65
80
|
if (files === undefined) setInternal(next);
|
|
@@ -118,7 +133,7 @@ export const FileUpload = React.forwardRef<HTMLInputElement, FileUploadProps>(fu
|
|
|
118
133
|
{current.length > 0 && (
|
|
119
134
|
<ul aria-label={selectedFilesLabel} className="space-y-2">
|
|
120
135
|
{current.map((file) => (
|
|
121
|
-
<li key={file
|
|
136
|
+
<li key={idFor(file)} className="flex items-center justify-between gap-3 rounded-md border border-border px-3 py-2">
|
|
122
137
|
<div className="min-w-0">
|
|
123
138
|
<p className="truncate text-sm">{file.name}</p>
|
|
124
139
|
<p className="text-xs text-muted-foreground">{formatSize(file.size)}</p>
|
|
@@ -137,7 +152,7 @@ export const FileUpload = React.forwardRef<HTMLInputElement, FileUploadProps>(fu
|
|
|
137
152
|
</div>
|
|
138
153
|
<button
|
|
139
154
|
type="button"
|
|
140
|
-
onClick={() => commit(current.filter((entry) => entry
|
|
155
|
+
onClick={() => commit(current.filter((entry) => entry !== file))}
|
|
141
156
|
aria-label={removeLabel(file)}
|
|
142
157
|
className="rounded p-1 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
143
158
|
>
|
|
@@ -120,7 +120,7 @@ export const FilterChips = React.forwardRef<HTMLDivElement, FilterChipsProps>(fu
|
|
|
120
120
|
type="button"
|
|
121
121
|
onClick={onClearAll}
|
|
122
122
|
className={cn(
|
|
123
|
-
'rounded-sm px-1 font-medium text-primary underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',
|
|
123
|
+
'rounded-sm px-1 font-medium text-primary-ink underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',
|
|
124
124
|
scale.clear
|
|
125
125
|
)}
|
|
126
126
|
>
|
|
@@ -37,6 +37,25 @@ describe('FilterPanel', () => {
|
|
|
37
37
|
expect(onApply).toHaveBeenCalled();
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
+
it('toggles same-titled sections independently', () => {
|
|
41
|
+
render(
|
|
42
|
+
<FilterPanel
|
|
43
|
+
sections={[
|
|
44
|
+
{ title: 'Tags', content: <p>First tags</p> },
|
|
45
|
+
{ title: 'Tags', content: <p>Second tags</p> },
|
|
46
|
+
]}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
const buttons = screen.getAllByRole('button', { name: /Tags/ });
|
|
50
|
+
expect(buttons).toHaveLength(2);
|
|
51
|
+
expect(buttons[0]).toHaveAttribute('aria-controls', 'filter-section-0');
|
|
52
|
+
expect(buttons[1]).toHaveAttribute('aria-controls', 'filter-section-1');
|
|
53
|
+
|
|
54
|
+
fireEvent.click(buttons[0]);
|
|
55
|
+
expect(screen.getByText('First tags')).toBeInTheDocument();
|
|
56
|
+
expect(screen.queryByText('Second tags')).not.toBeInTheDocument();
|
|
57
|
+
});
|
|
58
|
+
|
|
40
59
|
it('has no accessibility violations', async () => {
|
|
41
60
|
const { container } = render(
|
|
42
61
|
<FilterPanel sections={[{ title: 'Industry', content: <label><input type="checkbox" /> Technology</label> }]} />
|
|
@@ -64,18 +64,21 @@ export const FilterPanel = React.forwardRef<HTMLElement, FilterPanelProps>(funct
|
|
|
64
64
|
ref
|
|
65
65
|
) {
|
|
66
66
|
const Tag = as as 'div';
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
)
|
|
67
|
+
// Sections are identified by index, not title: duplicate or
|
|
68
|
+
// punctuation-colliding titles must not share open state or DOM ids.
|
|
69
|
+
const [open, setOpen] = React.useState<number[]>(() => {
|
|
70
|
+
if (defaultOpen) {
|
|
71
|
+
return sections.flatMap((section, index) => (defaultOpen.includes(section.title) ? [index] : []));
|
|
72
|
+
}
|
|
73
|
+
return sections.flatMap((section, index) => (section.defaultOpen ? [index] : []));
|
|
74
|
+
});
|
|
70
75
|
|
|
71
|
-
const isOpen = (
|
|
76
|
+
const isOpen = (index: number) => !collapsible || open.includes(index);
|
|
72
77
|
|
|
73
|
-
const toggle = (
|
|
78
|
+
const toggle = (index: number) => {
|
|
74
79
|
if (!collapsible) return;
|
|
75
80
|
setOpen((current) =>
|
|
76
|
-
current.includes(
|
|
77
|
-
? current.filter((title) => title !== section.title)
|
|
78
|
-
: [...current, section.title]
|
|
81
|
+
current.includes(index) ? current.filter((entry) => entry !== index) : [...current, index]
|
|
79
82
|
);
|
|
80
83
|
};
|
|
81
84
|
|
|
@@ -88,16 +91,17 @@ export const FilterPanel = React.forwardRef<HTMLElement, FilterPanelProps>(funct
|
|
|
88
91
|
</div>
|
|
89
92
|
)}
|
|
90
93
|
<div className="divide-y divide-border">
|
|
91
|
-
{sections.map((section) => {
|
|
92
|
-
const expanded = isOpen(
|
|
94
|
+
{sections.map((section, index) => {
|
|
95
|
+
const expanded = isOpen(index);
|
|
96
|
+
const sectionId = `filter-section-${index}`;
|
|
93
97
|
return (
|
|
94
|
-
<div key={
|
|
98
|
+
<div key={index} className="px-4 py-3">
|
|
95
99
|
<h3>
|
|
96
100
|
<button
|
|
97
101
|
type="button"
|
|
98
|
-
onClick={() => toggle(
|
|
102
|
+
onClick={() => toggle(index)}
|
|
99
103
|
aria-expanded={expanded}
|
|
100
|
-
aria-controls={
|
|
104
|
+
aria-controls={sectionId}
|
|
101
105
|
disabled={!collapsible}
|
|
102
106
|
className={cn(
|
|
103
107
|
'flex w-full items-center justify-between gap-2 text-left text-sm font-medium',
|
|
@@ -118,7 +122,7 @@ export const FilterPanel = React.forwardRef<HTMLElement, FilterPanelProps>(funct
|
|
|
118
122
|
</button>
|
|
119
123
|
</h3>
|
|
120
124
|
{expanded && (
|
|
121
|
-
<div id={
|
|
125
|
+
<div id={sectionId} className="mt-3">
|
|
122
126
|
{section.content}
|
|
123
127
|
</div>
|
|
124
128
|
)}
|
|
@@ -11,7 +11,9 @@ describe('Grid / GridItem', () => {
|
|
|
11
11
|
|
|
12
12
|
it('uses auto-fit template with minCol (overriding cols)', () => {
|
|
13
13
|
const { container } = render(<Grid minCol="16rem" cols={3} />);
|
|
14
|
-
expect(container.firstChild).
|
|
14
|
+
expect((container.firstChild as HTMLElement).style.gridTemplateColumns).toBe(
|
|
15
|
+
'repeat(auto-fit, minmax(16rem, 1fr))'
|
|
16
|
+
);
|
|
15
17
|
expect(container.firstChild).not.toHaveClass('grid-cols-3');
|
|
16
18
|
});
|
|
17
19
|
|
|
@@ -102,7 +102,7 @@ export const Hero = React.forwardRef<HTMLElement, HeroProps>(function Hero(
|
|
|
102
102
|
'mb-5 inline-flex rounded-full border px-3 py-1 text-xs font-medium',
|
|
103
103
|
overlay
|
|
104
104
|
? 'border-background/30 bg-background/10 text-background'
|
|
105
|
-
: 'border-primary/30 bg-primary/10 text-primary',
|
|
105
|
+
: 'border-primary/30 bg-primary/10 text-primary-ink',
|
|
106
106
|
badgeClassName
|
|
107
107
|
)}
|
|
108
108
|
>
|
|
@@ -113,7 +113,7 @@ export const Hero = React.forwardRef<HTMLElement, HeroProps>(function Hero(
|
|
|
113
113
|
<p
|
|
114
114
|
className={cn(
|
|
115
115
|
'mb-3 text-xs font-semibold uppercase tracking-widest',
|
|
116
|
-
overlay ? 'text-background/90' : 'text-primary',
|
|
116
|
+
overlay ? 'text-background/90' : 'text-primary-ink',
|
|
117
117
|
eyebrowClassName
|
|
118
118
|
)}
|
|
119
119
|
>
|
|
@@ -87,6 +87,30 @@ describe('Image', () => {
|
|
|
87
87
|
expect(img).toHaveClass('object-cover');
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
+
it('restarts the fallback chain when src changes', () => {
|
|
91
|
+
const { rerender } = render(
|
|
92
|
+
<Image
|
|
93
|
+
src="/broken.jpg"
|
|
94
|
+
fallbackSrc="/fallback.svg"
|
|
95
|
+
alt="Event"
|
|
96
|
+
fallback={<span data-testid="fallback">No image</span>}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
fireEvent.error(screen.getByRole('img', { name: 'Event' }));
|
|
100
|
+
fireEvent.error(screen.getByRole('img', { name: 'Event' }));
|
|
101
|
+
expect(screen.getByTestId('fallback')).toBeInTheDocument();
|
|
102
|
+
|
|
103
|
+
rerender(
|
|
104
|
+
<Image
|
|
105
|
+
src="/new.jpg"
|
|
106
|
+
fallbackSrc="/fallback.svg"
|
|
107
|
+
alt="Event"
|
|
108
|
+
fallback={<span data-testid="fallback">No image</span>}
|
|
109
|
+
/>
|
|
110
|
+
);
|
|
111
|
+
expect(screen.getByRole('img', { name: 'Event' })).toHaveAttribute('src', '/new.jpg');
|
|
112
|
+
});
|
|
113
|
+
|
|
90
114
|
it('has no accessibility violations', async () => {
|
|
91
115
|
const { container } = render(<Image src="/event.jpg" alt="Fall Classic" />);
|
|
92
116
|
expect(await axe(container)).toHaveNoViolations();
|
|
@@ -46,6 +46,13 @@ export function Image({
|
|
|
46
46
|
style,
|
|
47
47
|
}: ImageProps) {
|
|
48
48
|
const [stage, setStage] = React.useState<0 | 1 | 2>(0);
|
|
49
|
+
// Restart the src -> fallbackSrc -> fallback chain whenever the URLs
|
|
50
|
+
// change, so a reused component never sticks on a stale fallback.
|
|
51
|
+
const [prevUrls, setPrevUrls] = React.useState({ src, fallbackSrc });
|
|
52
|
+
if (prevUrls.src !== src || prevUrls.fallbackSrc !== fallbackSrc) {
|
|
53
|
+
setPrevUrls({ src, fallbackSrc });
|
|
54
|
+
setStage(0);
|
|
55
|
+
}
|
|
49
56
|
|
|
50
57
|
const onError = () => setStage((current) => (current === 0 && fallbackSrc ? 1 : 2));
|
|
51
58
|
const current = stage === 0 ? src : stage === 1 ? fallbackSrc : null;
|
|
@@ -76,6 +76,24 @@ describe('List / ListItem', () => {
|
|
|
76
76
|
expect(screen.getByRole('button', { name: 'Off' })).toBeDisabled();
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
+
it('uses compact row padding only when size is compact', () => {
|
|
80
|
+
const { rerender } = render(
|
|
81
|
+
<List>
|
|
82
|
+
<ListItem>Row</ListItem>
|
|
83
|
+
</List>
|
|
84
|
+
);
|
|
85
|
+
expect(screen.getByText('Row').closest('li')?.firstElementChild).toHaveClass('py-2.5');
|
|
86
|
+
|
|
87
|
+
rerender(
|
|
88
|
+
<List size="compact">
|
|
89
|
+
<ListItem>Row</ListItem>
|
|
90
|
+
</List>
|
|
91
|
+
);
|
|
92
|
+
const compactRow = screen.getByText('Row').closest('li')?.firstElementChild;
|
|
93
|
+
expect(compactRow).toHaveClass('py-1.5');
|
|
94
|
+
expect(compactRow).not.toHaveClass('py-2.5');
|
|
95
|
+
});
|
|
96
|
+
|
|
79
97
|
it('has no accessibility violations', async () => {
|
|
80
98
|
const { container } = render(
|
|
81
99
|
<List bordered divided>
|
|
@@ -10,6 +10,10 @@ export type ListProps = React.HTMLAttributes<HTMLUListElement> & {
|
|
|
10
10
|
size?: 'default' | 'compact';
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
type ListDensity = 'default' | 'compact';
|
|
14
|
+
|
|
15
|
+
const ListDensityContext = React.createContext<ListDensity>('default');
|
|
16
|
+
|
|
13
17
|
/**
|
|
14
18
|
* Semantic list container for groups of related rows (settings, results,
|
|
15
19
|
* nav items). Renders a real <ul> so screen readers announce item counts;
|
|
@@ -17,17 +21,18 @@ export type ListProps = React.HTMLAttributes<HTMLUListElement> & {
|
|
|
17
21
|
*/
|
|
18
22
|
const List = React.forwardRef<HTMLUListElement, ListProps>(
|
|
19
23
|
({ divided, bordered, size = 'default', className, ...props }, ref) => (
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
<ListDensityContext.Provider value={size}>
|
|
25
|
+
<ul
|
|
26
|
+
ref={ref}
|
|
27
|
+
className={cn(
|
|
28
|
+
'flex flex-col',
|
|
29
|
+
bordered && 'overflow-hidden rounded-lg border border-border bg-card',
|
|
30
|
+
divided && 'divide-y divide-border',
|
|
31
|
+
className
|
|
32
|
+
)}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
</ListDensityContext.Provider>
|
|
31
36
|
)
|
|
32
37
|
);
|
|
33
38
|
List.displayName = 'List';
|
|
@@ -53,7 +58,8 @@ export type ListItemProps = React.LiHTMLAttributes<HTMLLIElement> & {
|
|
|
53
58
|
/** A single row inside a List. */
|
|
54
59
|
const ListItem = React.forwardRef<HTMLLIElement, ListItemProps>(
|
|
55
60
|
({ leading, trailing, selected, onClick, description, disabled, className, children, ...props }, ref) => {
|
|
56
|
-
const
|
|
61
|
+
const density = React.useContext(ListDensityContext);
|
|
62
|
+
const padding = density === 'compact' ? 'px-3 py-1.5' : 'px-3 py-2.5';
|
|
57
63
|
const rowClass = cn(
|
|
58
64
|
'flex w-full items-center gap-3 text-left text-sm',
|
|
59
65
|
selected && 'bg-accent text-accent-foreground',
|
|
@@ -13,7 +13,7 @@ export type LoadMoreProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
13
13
|
loading?: boolean;
|
|
14
14
|
/** Button label. Default "Load more". */
|
|
15
15
|
loadLabel?: string;
|
|
16
|
-
/** Loading label. Default "Loading
|
|
16
|
+
/** Loading label. Default "Loading…". */
|
|
17
17
|
loadingLabel?: string;
|
|
18
18
|
/** End-of-list message. Default "You're all caught up." */
|
|
19
19
|
endLabel?: string;
|
|
@@ -30,7 +30,7 @@ export const LoadMore = React.forwardRef<HTMLDivElement, LoadMoreProps>(function
|
|
|
30
30
|
onLoadMore,
|
|
31
31
|
loading = false,
|
|
32
32
|
loadLabel = 'Load more',
|
|
33
|
-
loadingLabel = 'Loading
|
|
33
|
+
loadingLabel = 'Loading…',
|
|
34
34
|
endLabel = "You're all caught up.",
|
|
35
35
|
className,
|
|
36
36
|
...props
|
|
@@ -25,6 +25,8 @@ export type LogoCloudProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
25
25
|
align?: 'left' | 'center';
|
|
26
26
|
/** Custom link element for routers. */
|
|
27
27
|
linkComponent?: React.ElementType;
|
|
28
|
+
/** Prop used to pass the destination to linkComponent ('to' for react-router). */
|
|
29
|
+
linkHrefProp?: 'href' | 'to';
|
|
28
30
|
};
|
|
29
31
|
|
|
30
32
|
const columnClasses: Record<NonNullable<LogoCloudProps['columns']>, string> = {
|
|
@@ -54,6 +56,7 @@ export const LogoCloud = React.forwardRef<HTMLDivElement, LogoCloudProps>(functi
|
|
|
54
56
|
size = 'md',
|
|
55
57
|
align = 'center',
|
|
56
58
|
linkComponent,
|
|
59
|
+
linkHrefProp = 'href',
|
|
57
60
|
className,
|
|
58
61
|
...props
|
|
59
62
|
},
|
|
@@ -93,7 +96,7 @@ export const LogoCloud = React.forwardRef<HTMLDivElement, LogoCloudProps>(functi
|
|
|
93
96
|
<li key={item.name} className={cn('min-w-0', align === 'center' ? 'justify-self-center' : 'justify-self-start')}>
|
|
94
97
|
{item.href ? (
|
|
95
98
|
<Link
|
|
96
|
-
href
|
|
99
|
+
{...(linkHrefProp === 'to' ? { to: item.href } : { href: item.href })}
|
|
97
100
|
className="rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
|
|
98
101
|
>
|
|
99
102
|
{content}
|
|
@@ -72,6 +72,21 @@ describe('Menu', () => {
|
|
|
72
72
|
expect(screen.getAllByRole('menuitem')[2]).toHaveFocus();
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
+
it('jumps to items by first letter (typeahead)', async () => {
|
|
76
|
+
const user = userEvent.setup();
|
|
77
|
+
render(<BasicMenu />);
|
|
78
|
+
await user.click(screen.getByRole('button', { name: 'Options' }));
|
|
79
|
+
// Focus starts on "Profile"; typing 's' should land on "Settings".
|
|
80
|
+
await user.keyboard('s');
|
|
81
|
+
expect(screen.getAllByRole('menuitem')[1]).toHaveFocus();
|
|
82
|
+
// 's' again cycles to "Sign out".
|
|
83
|
+
await user.keyboard('s');
|
|
84
|
+
expect(screen.getAllByRole('menuitem')[2]).toHaveFocus();
|
|
85
|
+
// 'p' wraps back to "Profile".
|
|
86
|
+
await user.keyboard('p');
|
|
87
|
+
expect(screen.getAllByRole('menuitem')[0]).toHaveFocus();
|
|
88
|
+
});
|
|
89
|
+
|
|
75
90
|
it('calls onOpenChange', async () => {
|
|
76
91
|
const user = userEvent.setup();
|
|
77
92
|
const onOpenChange = vi.fn();
|
|
@@ -32,8 +32,8 @@ export type MenuProps = {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* Dropdown menu with keyboard navigation (arrows, Home/End, Escape)
|
|
36
|
-
*
|
|
35
|
+
* Dropdown menu with keyboard navigation (arrows, Home/End, Escape)
|
|
36
|
+
* and proper ARIA menu semantics. Items are rendered in a
|
|
37
37
|
* floating panel anchored to the trigger.
|
|
38
38
|
*/
|
|
39
39
|
const Menu = React.forwardRef<HTMLDivElement, MenuProps>(
|
|
@@ -183,6 +183,25 @@ const MenuContent = React.forwardRef<HTMLDivElement, MenuContentProps>(
|
|
|
183
183
|
event.preventDefault();
|
|
184
184
|
setActiveIndex(items.length - 1);
|
|
185
185
|
items[items.length - 1]?.focus();
|
|
186
|
+
} else if (
|
|
187
|
+
event.key.length === 1 &&
|
|
188
|
+
!event.ctrlKey &&
|
|
189
|
+
!event.metaKey &&
|
|
190
|
+
!event.altKey
|
|
191
|
+
) {
|
|
192
|
+
// Typeahead: focus the next item whose label starts with this
|
|
193
|
+
// character, cycling from the item after the active one.
|
|
194
|
+
const char = event.key.toLowerCase();
|
|
195
|
+
for (let i = 1; i <= items.length; i++) {
|
|
196
|
+
const next = (activeIndex + i + items.length) % items.length;
|
|
197
|
+
const label = items[next]?.textContent?.trim().toLowerCase() ?? '';
|
|
198
|
+
if (label.startsWith(char)) {
|
|
199
|
+
event.preventDefault();
|
|
200
|
+
setActiveIndex(next);
|
|
201
|
+
items[next]?.focus();
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
186
205
|
}
|
|
187
206
|
};
|
|
188
207
|
|
|
@@ -16,6 +16,9 @@ export type ProcessStepsProps = React.HTMLAttributes<HTMLOListElement> & {
|
|
|
16
16
|
numbered?: boolean;
|
|
17
17
|
/** Content alignment. Default 'left'. */
|
|
18
18
|
align?: 'left' | 'center';
|
|
19
|
+
/** Heading level for step titles (h2-h4). Default 3 — pick the level that
|
|
20
|
+
* continues your page's outline without skipping a rank. */
|
|
21
|
+
headingLevel?: 2 | 3 | 4;
|
|
19
22
|
};
|
|
20
23
|
|
|
21
24
|
const columnClasses: Record<NonNullable<ProcessStepsProps['columns']>, string> = {
|
|
@@ -30,9 +33,10 @@ const columnClasses: Record<NonNullable<ProcessStepsProps['columns']>, string> =
|
|
|
30
33
|
* relying on decorative connectors.
|
|
31
34
|
*/
|
|
32
35
|
export const ProcessSteps = React.forwardRef<HTMLOListElement, ProcessStepsProps>(function ProcessSteps(
|
|
33
|
-
{ steps, columns = 3, numbered = true, align = 'left', className, ...props },
|
|
36
|
+
{ steps, columns = 3, numbered = true, align = 'left', headingLevel = 3, className, ...props },
|
|
34
37
|
ref
|
|
35
38
|
) {
|
|
39
|
+
const HeadingTag = { 2: 'h2', 3: 'h3', 4: 'h4' }[headingLevel] as 'h2' | 'h3' | 'h4';
|
|
36
40
|
return (
|
|
37
41
|
<ol ref={ref} className={cn('grid gap-8', columnClasses[columns], className)} {...props}>
|
|
38
42
|
{steps.map((step, index) => (
|
|
@@ -40,11 +44,11 @@ export const ProcessSteps = React.forwardRef<HTMLOListElement, ProcessStepsProps
|
|
|
40
44
|
key={step.title}
|
|
41
45
|
className={cn('flex min-w-0 flex-col gap-4', align === 'center' && 'items-center text-center')}
|
|
42
46
|
>
|
|
43
|
-
<span className="flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary/10 text-sm font-semibold text-primary [&_svg]:size-5">
|
|
47
|
+
<span className="flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary/10 text-sm font-semibold text-primary-ink [&_svg]:size-5">
|
|
44
48
|
{step.icon ?? (numbered ? String(index + 1).padStart(2, '0') : null)}
|
|
45
49
|
</span>
|
|
46
50
|
<div className="min-w-0">
|
|
47
|
-
<
|
|
51
|
+
<HeadingTag className="text-base font-semibold tracking-tight">{step.title}</HeadingTag>
|
|
48
52
|
{step.description && (
|
|
49
53
|
<p className="mt-1 text-sm leading-relaxed text-muted-foreground">{step.description}</p>
|
|
50
54
|
)}
|
|
@@ -36,7 +36,7 @@ export const Prose = React.forwardRef<HTMLDivElement, ProseProps>(function Prose
|
|
|
36
36
|
'[&_h4]:mb-2 [&_h4]:mt-6 [&_h4]:scroll-mt-24 [&_h4]:font-semibold',
|
|
37
37
|
// Body copy
|
|
38
38
|
'[&_p]:my-4 [&_p]:leading-7',
|
|
39
|
-
'[&_a]:text-primary [&_a]:underline [&_a]:decoration-primary/40 [&_a]:underline-offset-4 hover:[&_a]:decoration-primary',
|
|
39
|
+
'[&_a]:text-primary-ink [&_a]:underline [&_a]:decoration-primary/40 [&_a]:underline-offset-4 hover:[&_a]:decoration-primary',
|
|
40
40
|
'[&_strong]:font-semibold [&_strong]:text-foreground [&_em]:italic',
|
|
41
41
|
'[&_ul]:my-4 [&_ul]:list-disc [&_ul]:space-y-1.5 [&_ul]:pl-6',
|
|
42
42
|
'[&_ol]:my-4 [&_ol]:list-decimal [&_ol]:space-y-1.5 [&_ol]:pl-6',
|
|
@@ -85,6 +85,16 @@ describe('RadioGroup', () => {
|
|
|
85
85
|
expect(screen.getByLabelText('Pro')).toBeChecked();
|
|
86
86
|
});
|
|
87
87
|
|
|
88
|
+
it('dims the label of disabled items via peer-disabled', () => {
|
|
89
|
+
render(
|
|
90
|
+
<RadioGroup name="plan" legend="Plan">
|
|
91
|
+
<RadioGroupItem value="free" label="Free" disabled />
|
|
92
|
+
</RadioGroup>
|
|
93
|
+
);
|
|
94
|
+
expect(screen.getByRole('radio')).toHaveClass('peer');
|
|
95
|
+
expect(screen.getByText('Free')).toHaveClass('peer-disabled:opacity-70');
|
|
96
|
+
});
|
|
97
|
+
|
|
88
98
|
it('has no accessibility violations', async () => {
|
|
89
99
|
const { container } = render(
|
|
90
100
|
<RadioGroup name="plan" legend="Choose a plan">
|
|
@@ -131,7 +131,7 @@ const RadioGroupItem = React.forwardRef<HTMLInputElement, RadioGroupItemProps>(
|
|
|
131
131
|
value={value}
|
|
132
132
|
checked={group.value === value}
|
|
133
133
|
onCheckedChange={(checked) => checked && group.onChange(value)}
|
|
134
|
-
className={className}
|
|
134
|
+
className={cn('peer', className)}
|
|
135
135
|
{...props}
|
|
136
136
|
/>
|
|
137
137
|
{label && (
|
|
@@ -26,7 +26,7 @@ describe('Section', () => {
|
|
|
26
26
|
const section = screen.getByRole('region', { name: 'Inverse section' });
|
|
27
27
|
expect(section).toHaveClass('bg-inverse', 'text-inverse-foreground');
|
|
28
28
|
expect(section).toHaveAttribute('data-tone', 'inverse');
|
|
29
|
-
expect(section
|
|
29
|
+
expect(section.style.getPropertyValue('--background')).toBe('var(--inverse)');
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
it('can render without an inner container', () => {
|
|
@@ -352,7 +352,7 @@ export const SelectMenu = React.forwardRef<HTMLButtonElement, SelectMenuProps>(f
|
|
|
352
352
|
)}
|
|
353
353
|
</span>
|
|
354
354
|
{multiple && selectedValues.includes(row.item!.value) && (
|
|
355
|
-
<span aria-hidden="true" className="ml-auto text-primary">
|
|
355
|
+
<span aria-hidden="true" className="ml-auto text-primary-ink">
|
|
356
356
|
✓
|
|
357
357
|
</span>
|
|
358
358
|
)}
|