@slipstream-ui/core 0.9.0 → 0.10.2
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 +32 -4
- package/dist/index.d.ts +32 -4
- package/dist/index.js +162 -88
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +162 -88
- 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 +13 -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 +1 -1
- package/dist/manifests/logo-cloud.manifest.json +1 -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 +1 -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 +8 -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 +12 -1
- package/dist/src/components/accordion/Accordion.js +26 -19
- package/dist/src/components/accordion/Accordion.js.map +1 -1
- package/dist/src/components/accordion/Accordion.mjs +26 -19
- package/dist/src/components/accordion/Accordion.mjs.map +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/checkbox/Checkbox.js +1 -1
- package/dist/src/components/checkbox/Checkbox.js.map +1 -1
- package/dist/src/components/checkbox/Checkbox.mjs +1 -1
- package/dist/src/components/checkbox/Checkbox.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/drawer/Drawer.js +2 -1
- package/dist/src/components/drawer/Drawer.js.map +1 -1
- package/dist/src/components/drawer/Drawer.mjs +2 -1
- package/dist/src/components/drawer/Drawer.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.d.ts +4 -0
- package/dist/src/components/filter-chips/FilterChips.js +35 -4
- package/dist/src/components/filter-chips/FilterChips.js.map +1 -1
- package/dist/src/components/filter-chips/FilterChips.mjs +35 -4
- 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/menu/Menu.d.ts +2 -2
- package/dist/src/components/menu/Menu.js.map +1 -1
- package/dist/src/components/menu/Menu.mjs.map +1 -1
- package/dist/src/components/process-steps/ProcessSteps.js +1 -1
- package/dist/src/components/process-steps/ProcessSteps.js.map +1 -1
- package/dist/src/components/process-steps/ProcessSteps.mjs +1 -1
- 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 +2 -2
- package/dist/src/components/radio/Radio.js.map +1 -1
- package/dist/src/components/radio/Radio.mjs +2 -2
- package/dist/src/components/radio/Radio.mjs.map +1 -1
- package/dist/src/components/range-slider/RangeSlider.js +3 -3
- package/dist/src/components/range-slider/RangeSlider.js.map +1 -1
- package/dist/src/components/range-slider/RangeSlider.mjs +3 -3
- package/dist/src/components/range-slider/RangeSlider.mjs.map +1 -1
- package/dist/src/components/select/Select.d.ts +10 -0
- package/dist/src/components/select/Select.js +2 -2
- package/dist/src/components/select/Select.js.map +1 -1
- package/dist/src/components/select/Select.mjs +2 -2
- package/dist/src/components/select/Select.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/timeline/Timeline.js +17 -13
- package/dist/src/components/timeline/Timeline.js.map +1 -1
- package/dist/src/components/timeline/Timeline.mjs +17 -13
- package/dist/src/components/timeline/Timeline.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/src/components/tooltip/Tooltip.d.ts +5 -0
- package/dist/src/components/tooltip/Tooltip.js +9 -2
- package/dist/src/components/tooltip/Tooltip.js.map +1 -1
- package/dist/src/components/tooltip/Tooltip.mjs +9 -2
- package/dist/src/components/tooltip/Tooltip.mjs.map +1 -1
- package/dist/styles-full.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +6 -6
- package/src/components/accordion/Accordion.test.tsx +14 -3
- package/src/components/accordion/Accordion.tsx +34 -21
- 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/checkbox/Checkbox.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/drawer/Drawer.test.tsx +12 -0
- package/src/components/drawer/Drawer.tsx +8 -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.test.tsx +11 -0
- package/src/components/filter-chips/FilterChips.tsx +40 -4
- package/src/components/filter-panel/FilterPanel.test.tsx +19 -0
- package/src/components/filter-panel/FilterPanel.tsx +18 -14
- 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/list/List.test.tsx +18 -0
- package/src/components/list/List.tsx +18 -12
- package/src/components/menu/Menu.tsx +2 -2
- package/src/components/process-steps/ProcessSteps.tsx +1 -1
- package/src/components/prose/Prose.tsx +1 -1
- package/src/components/radio/Radio.test.tsx +10 -0
- package/src/components/radio/Radio.tsx +2 -2
- package/src/components/range-slider/RangeSlider.tsx +3 -3
- package/src/components/select/Select.test.tsx +14 -0
- package/src/components/select/Select.tsx +7 -2
- 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/timeline/Timeline.test.tsx +11 -0
- package/src/components/timeline/Timeline.tsx +13 -2
- 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/components/tooltip/Tooltip.test.tsx +15 -0
- package/src/components/tooltip/Tooltip.tsx +19 -2
- 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 +13 -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 +1 -1
- package/src/manifests/logo-cloud.manifest.json +1 -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 +1 -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 +8 -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 +12 -1
|
@@ -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
|
>
|
|
@@ -19,6 +19,17 @@ describe('FilterChips', () => {
|
|
|
19
19
|
expect(onRemove).toHaveBeenCalled();
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
+
it('scales the chip set with size', () => {
|
|
23
|
+
const { rerender, container } = render(
|
|
24
|
+
<FilterChips size="sm" filters={[{ key: 'type', label: 'Type', value: 'PE' }]} />
|
|
25
|
+
);
|
|
26
|
+
expect(container.querySelector('span.text-xs')).not.toBeNull();
|
|
27
|
+
rerender(
|
|
28
|
+
<FilterChips size="lg" filters={[{ key: 'type', label: 'Type', value: 'PE' }]} />
|
|
29
|
+
);
|
|
30
|
+
expect(container.querySelector('span.text-base')).not.toBeNull();
|
|
31
|
+
});
|
|
32
|
+
|
|
22
33
|
it('renders a clear-all action', () => {
|
|
23
34
|
const onClearAll = vi.fn();
|
|
24
35
|
render(
|
|
@@ -17,6 +17,8 @@ export type FilterChip = {
|
|
|
17
17
|
export type FilterChipsProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
18
18
|
/** Active filters to render. */
|
|
19
19
|
filters: FilterChip[];
|
|
20
|
+
/** Chip scale. Default 'md'. */
|
|
21
|
+
size?: 'sm' | 'md' | 'lg';
|
|
20
22
|
/** Shows a clear-all action when provided. */
|
|
21
23
|
onClearAll?: () => void;
|
|
22
24
|
/** Label for the clear-all action. Default "Clear all". */
|
|
@@ -25,6 +27,28 @@ export type FilterChipsProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
25
27
|
emptyLabel?: string;
|
|
26
28
|
};
|
|
27
29
|
|
|
30
|
+
/** Literal size maps so the scanner keeps every chip utility. */
|
|
31
|
+
const CHIP_SIZES = {
|
|
32
|
+
sm: {
|
|
33
|
+
chip: 'gap-1 py-0.5 pl-2.5 pr-0.5 text-xs',
|
|
34
|
+
remove: 'p-0.5',
|
|
35
|
+
icon: 'h-3 w-3',
|
|
36
|
+
clear: 'text-xs',
|
|
37
|
+
},
|
|
38
|
+
md: {
|
|
39
|
+
chip: 'gap-1.5 py-1 pl-3 pr-1 text-sm',
|
|
40
|
+
remove: 'p-1',
|
|
41
|
+
icon: 'h-3.5 w-3.5',
|
|
42
|
+
clear: 'text-sm',
|
|
43
|
+
},
|
|
44
|
+
lg: {
|
|
45
|
+
chip: 'gap-2 py-1.5 pl-3.5 pr-1.5 text-base',
|
|
46
|
+
remove: 'p-1.5',
|
|
47
|
+
icon: 'h-4 w-4',
|
|
48
|
+
clear: 'text-base',
|
|
49
|
+
},
|
|
50
|
+
} as const;
|
|
51
|
+
|
|
28
52
|
/**
|
|
29
53
|
* Active-filter summary for list and dashboard pages. Each chip pairs a
|
|
30
54
|
* filter name with its current value and exposes a remove action; an optional
|
|
@@ -34,6 +58,7 @@ export type FilterChipsProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
34
58
|
export const FilterChips = React.forwardRef<HTMLDivElement, FilterChipsProps>(function FilterChips(
|
|
35
59
|
{
|
|
36
60
|
filters,
|
|
61
|
+
size = 'md',
|
|
37
62
|
onClearAll,
|
|
38
63
|
clearLabel = 'Clear all',
|
|
39
64
|
emptyLabel,
|
|
@@ -51,6 +76,8 @@ export const FilterChips = React.forwardRef<HTMLDivElement, FilterChipsProps>(fu
|
|
|
51
76
|
) : null;
|
|
52
77
|
}
|
|
53
78
|
|
|
79
|
+
const scale = CHIP_SIZES[size];
|
|
80
|
+
|
|
54
81
|
return (
|
|
55
82
|
<div
|
|
56
83
|
ref={ref}
|
|
@@ -62,7 +89,10 @@ export const FilterChips = React.forwardRef<HTMLDivElement, FilterChipsProps>(fu
|
|
|
62
89
|
{filters.map((filter) => (
|
|
63
90
|
<span
|
|
64
91
|
key={filter.key}
|
|
65
|
-
className=
|
|
92
|
+
className={cn(
|
|
93
|
+
'inline-flex max-w-full items-center rounded-full border border-border bg-muted/60',
|
|
94
|
+
scale.chip
|
|
95
|
+
)}
|
|
66
96
|
>
|
|
67
97
|
<span className="truncate">
|
|
68
98
|
<span className="text-muted-foreground">{filter.label}:</span>{' '}
|
|
@@ -73,9 +103,12 @@ export const FilterChips = React.forwardRef<HTMLDivElement, FilterChipsProps>(fu
|
|
|
73
103
|
type="button"
|
|
74
104
|
onClick={filter.onRemove}
|
|
75
105
|
aria-label={`Remove ${filter.label}${filter.value ? `: ${filter.value}` : ''}`}
|
|
76
|
-
className=
|
|
106
|
+
className={cn(
|
|
107
|
+
'rounded-full text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',
|
|
108
|
+
scale.remove
|
|
109
|
+
)}
|
|
77
110
|
>
|
|
78
|
-
<svg aria-hidden="true" viewBox="0 0 20 20" className=
|
|
111
|
+
<svg aria-hidden="true" viewBox="0 0 20 20" className={scale.icon} fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
|
|
79
112
|
<path d="m5 5 10 10M15 5 5 15" />
|
|
80
113
|
</svg>
|
|
81
114
|
</button>
|
|
@@ -86,7 +119,10 @@ export const FilterChips = React.forwardRef<HTMLDivElement, FilterChipsProps>(fu
|
|
|
86
119
|
<button
|
|
87
120
|
type="button"
|
|
88
121
|
onClick={onClearAll}
|
|
89
|
-
className=
|
|
122
|
+
className={cn(
|
|
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
|
+
scale.clear
|
|
125
|
+
)}
|
|
90
126
|
>
|
|
91
127
|
{clearLabel}
|
|
92
128
|
</button>
|
|
@@ -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
|
)}
|
|
@@ -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',
|
|
@@ -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>(
|
|
@@ -40,7 +40,7 @@ export const ProcessSteps = React.forwardRef<HTMLOListElement, ProcessStepsProps
|
|
|
40
40
|
key={step.title}
|
|
41
41
|
className={cn('flex min-w-0 flex-col gap-4', align === 'center' && 'items-center text-center')}
|
|
42
42
|
>
|
|
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">
|
|
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-ink [&_svg]:size-5">
|
|
44
44
|
{step.icon ?? (numbered ? String(index + 1).padStart(2, '0') : null)}
|
|
45
45
|
</span>
|
|
46
46
|
<div className="min-w-0">
|
|
@@ -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">
|
|
@@ -26,7 +26,7 @@ const Radio = React.forwardRef<HTMLInputElement, RadioProps>(
|
|
|
26
26
|
onChange?.(event);
|
|
27
27
|
}}
|
|
28
28
|
className={cn(
|
|
29
|
-
'h-4 w-4 shrink-0 rounded-full border border-primary',
|
|
29
|
+
'h-4 w-4 shrink-0 rounded-full border border-primary accent-primary',
|
|
30
30
|
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',
|
|
31
31
|
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
32
32
|
'checked:bg-primary checked:text-primary-foreground',
|
|
@@ -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 && (
|
|
@@ -34,9 +34,9 @@ export type RangeSliderProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onCha
|
|
|
34
34
|
const rangeInputClass = cn(
|
|
35
35
|
'pointer-events-none absolute inset-x-0 top-1/2 h-6 w-full -translate-y-1/2 appearance-none bg-transparent',
|
|
36
36
|
'[&::-webkit-slider-runnable-track]:h-1 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-transparent',
|
|
37
|
-
'[&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:mt-[-6px] [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-
|
|
37
|
+
'[&::-webkit-slider-thumb]:pointer-events-auto [&::-webkit-slider-thumb]:mt-[-6px] [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-background [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-md',
|
|
38
38
|
'[&::-moz-range-track]:h-1 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-transparent',
|
|
39
|
-
'[&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-
|
|
39
|
+
'[&::-moz-range-thumb]:pointer-events-auto [&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-background [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-md',
|
|
40
40
|
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',
|
|
41
41
|
'disabled:cursor-not-allowed disabled:opacity-50'
|
|
42
42
|
);
|
|
@@ -92,7 +92,7 @@ export const RangeSlider = React.forwardRef<HTMLDivElement, RangeSliderProps>(fu
|
|
|
92
92
|
</div>
|
|
93
93
|
)}
|
|
94
94
|
<div className="relative h-6 w-full">
|
|
95
|
-
<div className="absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-
|
|
95
|
+
<div className="absolute inset-x-0 top-1/2 h-1 -translate-y-1/2 rounded-full bg-border" />
|
|
96
96
|
<div
|
|
97
97
|
className="absolute top-1/2 h-1 -translate-y-1/2 rounded-full bg-primary"
|
|
98
98
|
style={{ left: `${lowPercent}%`, right: `${100 - highPercent}%` }}
|
|
@@ -20,6 +20,20 @@ describe('Select', () => {
|
|
|
20
20
|
expect(select).toBeInTheDocument();
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
+
it('can hide the label visually while keeping it accessible', () => {
|
|
24
|
+
render(
|
|
25
|
+
<Select
|
|
26
|
+
label="Status"
|
|
27
|
+
labelHidden
|
|
28
|
+
options={[{ value: 'all', label: 'All' }]}
|
|
29
|
+
defaultValue="all"
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
const label = screen.getByText('Status');
|
|
33
|
+
expect(label).toHaveClass('sr-only');
|
|
34
|
+
expect(screen.getByRole('combobox', { name: 'Status' })).toBeInTheDocument();
|
|
35
|
+
});
|
|
36
|
+
|
|
23
37
|
it('supports uncontrolled defaultValue', () => {
|
|
24
38
|
render(<Select options={options} defaultValue="sm" aria-label="Size" />);
|
|
25
39
|
expect(screen.getByRole('combobox', { name: 'Size' })).toHaveValue('sm');
|
|
@@ -23,6 +23,11 @@ export type SelectProps = Omit<
|
|
|
23
23
|
/** Optgroups with a heading per section. Takes precedence over `options` and `children`. */
|
|
24
24
|
groups?: SelectOptionGroup[];
|
|
25
25
|
label?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Keep the label for assistive tech but hide it visually, so the control
|
|
28
|
+
* lines up with sibling inputs in a filter bar or toolbar.
|
|
29
|
+
*/
|
|
30
|
+
labelHidden?: boolean;
|
|
26
31
|
/** Renders a disabled empty option — the native "choose one" affordance. */
|
|
27
32
|
placeholder?: string;
|
|
28
33
|
/** Native multi-select: value/onChange switch to string[]. */
|
|
@@ -43,7 +48,7 @@ export type SelectProps = Omit<
|
|
|
43
48
|
* <option>/<optgroup> children for dynamic lists.
|
|
44
49
|
*/
|
|
45
50
|
export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(function Select(
|
|
46
|
-
{ options, groups, label, placeholder, multiple = false, value, defaultValue, onChange, onValueChange, children, id, className, ...props },
|
|
51
|
+
{ options, groups, label, labelHidden = false, placeholder, multiple = false, value, defaultValue, onChange, onValueChange, children, id, className, ...props },
|
|
47
52
|
ref,
|
|
48
53
|
) {
|
|
49
54
|
const generatedId = React.useId();
|
|
@@ -59,7 +64,7 @@ export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(function
|
|
|
59
64
|
return (
|
|
60
65
|
<div className="flex w-full flex-col gap-1.5">
|
|
61
66
|
{label && (
|
|
62
|
-
<label id={labelId} htmlFor={selectId} className=
|
|
67
|
+
<label id={labelId} htmlFor={selectId} className={labelHidden ? 'sr-only' : 'text-sm font-medium'}>
|
|
63
68
|
{label}
|
|
64
69
|
</label>
|
|
65
70
|
)}
|
|
@@ -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
|
)}
|
|
@@ -117,7 +117,7 @@ export const Stepper = React.forwardRef<HTMLOListElement, StepperProps>(function
|
|
|
117
117
|
'rounded-full border font-medium',
|
|
118
118
|
markerSizeClass,
|
|
119
119
|
state === 'complete' && 'border-primary bg-primary text-primary-foreground',
|
|
120
|
-
state === 'current' && 'border-primary text-primary',
|
|
120
|
+
state === 'current' && 'border-primary text-primary-ink',
|
|
121
121
|
state === 'upcoming' && 'border-border text-muted-foreground'
|
|
122
122
|
)
|
|
123
123
|
)}
|
|
@@ -66,7 +66,7 @@ export function TableOfContents({
|
|
|
66
66
|
className={cn(
|
|
67
67
|
'-ml-px block border-l py-1 pl-3 no-underline transition-colors',
|
|
68
68
|
active
|
|
69
|
-
? 'border-primary font-medium text-primary underline'
|
|
69
|
+
? 'border-primary font-medium text-primary-ink underline'
|
|
70
70
|
: 'border-transparent text-muted-foreground hover:border-border hover:text-foreground'
|
|
71
71
|
)}
|
|
72
72
|
>
|
|
@@ -19,6 +19,17 @@ describe('Timeline', () => {
|
|
|
19
19
|
expect(screen.getByText('Platform team')).toBeInTheDocument();
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
+
it('draws one connector rail per item except the last', () => {
|
|
23
|
+
const { container } = render(
|
|
24
|
+
<Timeline items={[{ title: 'One' }, { title: 'Two' }, { title: 'Three' }]} />
|
|
25
|
+
);
|
|
26
|
+
const rails = container.querySelectorAll('li > span[aria-hidden="true"]');
|
|
27
|
+
expect(rails).toHaveLength(2);
|
|
28
|
+
// The rail spans from the dot's lower edge into the next item's dot.
|
|
29
|
+
expect(rails[0]).toHaveClass('top-4');
|
|
30
|
+
expect(rails[0]).toHaveClass('-bottom-7');
|
|
31
|
+
});
|
|
32
|
+
|
|
22
33
|
it('has no accessibility violations', async () => {
|
|
23
34
|
const { container } = render(<Timeline items={[{ title: 'Started' }]} />);
|
|
24
35
|
expect(await axe(container)).toHaveNoViolations();
|
|
@@ -28,7 +28,19 @@ export const Timeline = React.forwardRef<HTMLOListElement, TimelineProps>(functi
|
|
|
28
28
|
<ol ref={ref} className={cn('relative flex flex-col gap-6', className)} {...props}>
|
|
29
29
|
{items.map((item, index) => (
|
|
30
30
|
<li key={`${item.title}-${index}`} className="relative flex gap-4">
|
|
31
|
-
|
|
31
|
+
{/*
|
|
32
|
+
One rail per item, absolutely positioned so it starts at the dot's
|
|
33
|
+
bottom edge and runs through the list gap into the next dot. A
|
|
34
|
+
flex-column connector stops at the item box, which left a visible
|
|
35
|
+
break at every item boundary.
|
|
36
|
+
*/}
|
|
37
|
+
{index < items.length - 1 && (
|
|
38
|
+
<span
|
|
39
|
+
aria-hidden="true"
|
|
40
|
+
className="absolute left-[5.5px] top-4 -bottom-7 w-px bg-border"
|
|
41
|
+
/>
|
|
42
|
+
)}
|
|
43
|
+
<div className="relative z-10 flex flex-col items-center">
|
|
32
44
|
<span
|
|
33
45
|
aria-hidden="true"
|
|
34
46
|
className={cn(
|
|
@@ -36,7 +48,6 @@ export const Timeline = React.forwardRef<HTMLOListElement, TimelineProps>(functi
|
|
|
36
48
|
item.muted ? 'border-border bg-background' : 'border-primary bg-primary'
|
|
37
49
|
)}
|
|
38
50
|
/>
|
|
39
|
-
{index < items.length - 1 && <span aria-hidden="true" className="mt-1 w-px flex-1 bg-border" />}
|
|
40
51
|
</div>
|
|
41
52
|
<div className="min-w-0 pb-1">
|
|
42
53
|
{item.period && (
|
|
@@ -110,7 +110,7 @@ function ToastRegion({
|
|
|
110
110
|
entry.action?.onClick();
|
|
111
111
|
onDismiss(entry.id);
|
|
112
112
|
}}
|
|
113
|
-
className="mt-2 text-sm font-medium text-primary hover:underline"
|
|
113
|
+
className="mt-2 text-sm font-medium text-primary-ink hover:underline"
|
|
114
114
|
>
|
|
115
115
|
{entry.action.label}
|
|
116
116
|
</button>
|