@slipstream-ui/core 0.10.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 +13 -4
- package/dist/index.d.ts +13 -4
- package/dist/index.js +67 -43
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +67 -43
- 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 +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 +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/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 +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 +6 -6
- 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/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 +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 +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 +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
|
@@ -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">
|
|
@@ -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 && (
|
|
@@ -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
|
>
|
|
@@ -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>
|
|
@@ -93,7 +93,7 @@ export function Toaster({ position = 'bottom-right', label = 'Notifications', di
|
|
|
93
93
|
entry.action?.onClick();
|
|
94
94
|
imperativeToast.dismiss(entry.id);
|
|
95
95
|
}}
|
|
96
|
-
className="mt-2 text-sm font-medium text-primary hover:underline"
|
|
96
|
+
className="mt-2 text-sm font-medium text-primary-ink hover:underline"
|
|
97
97
|
>
|
|
98
98
|
{entry.action.label}
|
|
99
99
|
</button>
|
|
@@ -66,7 +66,7 @@ export const TombstoneCard = React.forwardRef<HTMLElement, TombstoneCardProps>(f
|
|
|
66
66
|
{href && (
|
|
67
67
|
<Link
|
|
68
68
|
href={href}
|
|
69
|
-
className="mt-auto text-sm font-medium text-primary underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
69
|
+
className="mt-auto text-sm font-medium text-primary-ink underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
70
70
|
>
|
|
71
71
|
{actionLabel}
|
|
72
72
|
</Link>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.2",
|
|
8
8
|
"sourceDir": "announcement-bar",
|
|
9
9
|
"exportName": "AnnouncementBar",
|
|
10
10
|
"description": "Dismissible announcement bar with optional action, tone and sticky positioning.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.2",
|
|
8
8
|
"sourceDir": "applied-filters",
|
|
9
9
|
"exportName": "AppliedFilters",
|
|
10
10
|
"description": "Applied-filter summary with a live count, removable chips and an edit action.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.2",
|
|
8
8
|
"sourceDir": "article-card",
|
|
9
9
|
"exportName": "ArticleCard",
|
|
10
10
|
"description": "Linked article or resource card with media, eyebrow, title, summary and metadata.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.2",
|
|
8
8
|
"sourceDir": "comparison-table",
|
|
9
9
|
"exportName": "ComparisonTable",
|
|
10
10
|
"description": "Marketing comparison table with check/dash boolean cells, a highlighted column and responsive overflow.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.2",
|
|
8
8
|
"sourceDir": "confirm-dialog",
|
|
9
9
|
"exportName": "ConfirmDialog",
|
|
10
10
|
"description": "Accessible confirmation dialog with async pending state, destructive variant and cancellable actions, built on Dialog.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.2",
|
|
8
8
|
"sourceDir": "contact-strip",
|
|
9
9
|
"exportName": "ContactStrip",
|
|
10
10
|
"description": "Compact labelled contact rows with optional icons and links.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "atom",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.2",
|
|
8
8
|
"sourceDir": "container",
|
|
9
9
|
"exportName": "Container",
|
|
10
10
|
"description": "Centered, width-constrained page container with shared gutters and four width presets.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.2",
|
|
8
8
|
"sourceDir": "cta-section",
|
|
9
9
|
"exportName": "CTASection",
|
|
10
10
|
"description": "Full-width conversion band with eyebrow, headline, supporting copy and actions.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.2",
|
|
8
8
|
"sourceDir": "date-range-picker",
|
|
9
9
|
"exportName": "DateRangePicker",
|
|
10
10
|
"description": "Start/end date range with ISO strings and quick presets.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.2",
|
|
8
8
|
"sourceDir": "deal-card",
|
|
9
9
|
"exportName": "DealCard",
|
|
10
10
|
"description": "Deal opportunity card with sector, status, metrics, NDA/CIM badges and access actions.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.2",
|
|
8
8
|
"sourceDir": "document-card",
|
|
9
9
|
"exportName": "DocumentCard",
|
|
10
10
|
"description": "Document row with file metadata, access status and an optional download action.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.2",
|
|
8
8
|
"sourceDir": "entity-card",
|
|
9
9
|
"exportName": "EntityCard",
|
|
10
10
|
"description": "Firm or member profile card with logo, type, location, stats, tags and actions.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.2",
|
|
8
8
|
"sourceDir": "feature-grid",
|
|
9
9
|
"exportName": "FeatureGrid",
|
|
10
10
|
"description": "Grid of feature or benefit cards with an icon, title, copy and optional link.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.2",
|
|
8
8
|
"sourceDir": "feature-row",
|
|
9
9
|
"exportName": "FeatureRow",
|
|
10
10
|
"description": "Alternating media and copy row for mid-page feature sections.",
|