@slipstream-ui/core 0.11.9 → 0.12.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/dist/index.d.mts +254 -148
- package/dist/index.d.ts +254 -148
- package/dist/index.js +1582 -1156
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1577 -1156
- 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 +12 -1
- package/dist/manifests/app-shell.manifest.json +12 -1
- package/dist/manifests/applied-filters.manifest.json +1 -1
- package/dist/manifests/article-card.manifest.json +12 -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/consent-banner.manifest.json +130 -0
- package/dist/manifests/contact-strip.manifest.json +12 -1
- package/dist/manifests/container.manifest.json +1 -1
- package/dist/manifests/cover-image.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 +12 -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 +12 -1
- package/dist/manifests/feature-grid.manifest.json +12 -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-toolbar.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/media-card.manifest.json +161 -0
- package/dist/manifests/menu.manifest.json +1 -1
- package/dist/manifests/metric-card.manifest.json +1 -1
- package/dist/manifests/month-schedule.manifest.json +217 -0
- 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 +7 -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 +12 -1
- package/dist/manifests/tooltip.manifest.json +1 -1
- package/dist/src/components/announcement-bar/AnnouncementBar.d.ts +3 -6
- package/dist/src/components/announcement-bar/AnnouncementBar.js +3 -1
- package/dist/src/components/announcement-bar/AnnouncementBar.js.map +1 -1
- package/dist/src/components/announcement-bar/AnnouncementBar.mjs +3 -1
- package/dist/src/components/announcement-bar/AnnouncementBar.mjs.map +1 -1
- package/dist/src/components/app-shell/AppShell.d.ts +3 -4
- package/dist/src/components/app-shell/AppShell.js +3 -1
- package/dist/src/components/app-shell/AppShell.js.map +1 -1
- package/dist/src/components/app-shell/AppShell.mjs +3 -1
- package/dist/src/components/app-shell/AppShell.mjs.map +1 -1
- package/dist/src/components/article-card/ArticleCard.d.ts +3 -6
- package/dist/src/components/article-card/ArticleCard.js +3 -1
- package/dist/src/components/article-card/ArticleCard.js.map +1 -1
- package/dist/src/components/article-card/ArticleCard.mjs +3 -1
- package/dist/src/components/article-card/ArticleCard.mjs.map +1 -1
- package/dist/src/components/bottom-nav/BottomNav.d.ts +2 -5
- package/dist/src/components/bottom-nav/BottomNav.js +2 -1
- package/dist/src/components/bottom-nav/BottomNav.js.map +1 -1
- package/dist/src/components/bottom-nav/BottomNav.mjs +2 -1
- package/dist/src/components/bottom-nav/BottomNav.mjs.map +1 -1
- package/dist/src/components/breadcrumb/Breadcrumb.d.ts +3 -16
- package/dist/src/components/breadcrumb/Breadcrumb.js +2 -1
- package/dist/src/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/src/components/breadcrumb/Breadcrumb.mjs +2 -1
- package/dist/src/components/breadcrumb/Breadcrumb.mjs.map +1 -1
- package/dist/src/components/consent-banner/ConsentBanner.d.ts +53 -0
- package/dist/src/components/consent-banner/ConsentBanner.js +83 -0
- package/dist/src/components/consent-banner/ConsentBanner.js.map +1 -0
- package/dist/src/components/consent-banner/ConsentBanner.mjs +49 -0
- package/dist/src/components/consent-banner/ConsentBanner.mjs.map +1 -0
- package/dist/src/components/consent-banner/index.d.ts +1 -0
- package/dist/src/components/consent-banner/index.js +23 -0
- package/dist/src/components/consent-banner/index.js.map +1 -0
- package/dist/src/components/consent-banner/index.mjs +2 -0
- package/dist/src/components/consent-banner/index.mjs.map +1 -0
- package/dist/src/components/contact-strip/ContactStrip.d.ts +3 -6
- package/dist/src/components/contact-strip/ContactStrip.js +3 -2
- package/dist/src/components/contact-strip/ContactStrip.js.map +1 -1
- package/dist/src/components/contact-strip/ContactStrip.mjs +3 -2
- package/dist/src/components/contact-strip/ContactStrip.mjs.map +1 -1
- package/dist/src/components/deal-card/DealCard.d.ts +3 -6
- package/dist/src/components/deal-card/DealCard.js +3 -1
- package/dist/src/components/deal-card/DealCard.js.map +1 -1
- package/dist/src/components/deal-card/DealCard.mjs +3 -1
- package/dist/src/components/deal-card/DealCard.mjs.map +1 -1
- package/dist/src/components/empty-state/EmptyState.d.ts +3 -10
- package/dist/src/components/empty-state/EmptyState.js +2 -1
- package/dist/src/components/empty-state/EmptyState.js.map +1 -1
- package/dist/src/components/empty-state/EmptyState.mjs +2 -1
- package/dist/src/components/empty-state/EmptyState.mjs.map +1 -1
- package/dist/src/components/entity-card/EntityCard.d.ts +4 -9
- package/dist/src/components/entity-card/EntityCard.js +4 -2
- package/dist/src/components/entity-card/EntityCard.js.map +1 -1
- package/dist/src/components/entity-card/EntityCard.mjs +4 -2
- package/dist/src/components/entity-card/EntityCard.mjs.map +1 -1
- package/dist/src/components/feature-grid/FeatureGrid.d.ts +3 -6
- package/dist/src/components/feature-grid/FeatureGrid.js +3 -2
- package/dist/src/components/feature-grid/FeatureGrid.js.map +1 -1
- package/dist/src/components/feature-grid/FeatureGrid.mjs +3 -2
- package/dist/src/components/feature-grid/FeatureGrid.mjs.map +1 -1
- package/dist/src/components/link-tabs/LinkTabs.d.ts +3 -16
- package/dist/src/components/link-tabs/LinkTabs.js +2 -1
- package/dist/src/components/link-tabs/LinkTabs.js.map +1 -1
- package/dist/src/components/link-tabs/LinkTabs.mjs +2 -1
- package/dist/src/components/link-tabs/LinkTabs.mjs.map +1 -1
- package/dist/src/components/logo-cloud/LogoCloud.d.ts +3 -10
- 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/media-card/MediaCard.d.ts +54 -0
- package/dist/src/components/media-card/MediaCard.js +89 -0
- package/dist/src/components/media-card/MediaCard.js.map +1 -0
- package/dist/src/components/media-card/MediaCard.mjs +55 -0
- package/dist/src/components/media-card/MediaCard.mjs.map +1 -0
- package/dist/src/components/media-card/index.d.ts +1 -0
- package/dist/src/components/media-card/index.js +23 -0
- package/dist/src/components/media-card/index.js.map +1 -0
- package/dist/src/components/media-card/index.mjs +2 -0
- package/dist/src/components/media-card/index.mjs.map +1 -0
- package/dist/src/components/month-schedule/MonthSchedule.d.ts +53 -0
- package/dist/src/components/month-schedule/MonthSchedule.js +246 -0
- package/dist/src/components/month-schedule/MonthSchedule.js.map +1 -0
- package/dist/src/components/month-schedule/MonthSchedule.mjs +220 -0
- package/dist/src/components/month-schedule/MonthSchedule.mjs.map +1 -0
- package/dist/src/components/month-schedule/index.d.ts +1 -0
- package/dist/src/components/month-schedule/index.js +23 -0
- package/dist/src/components/month-schedule/index.js.map +1 -0
- package/dist/src/components/month-schedule/index.mjs +2 -0
- package/dist/src/components/month-schedule/index.mjs.map +1 -0
- package/dist/src/components/pagination/Pagination.d.ts +3 -10
- package/dist/src/components/pagination/Pagination.js +2 -1
- package/dist/src/components/pagination/Pagination.js.map +1 -1
- package/dist/src/components/pagination/Pagination.mjs +2 -1
- package/dist/src/components/pagination/Pagination.mjs.map +1 -1
- package/dist/src/components/segmented-control/SegmentedControl.d.ts +3 -10
- package/dist/src/components/segmented-control/SegmentedControl.js +2 -1
- package/dist/src/components/segmented-control/SegmentedControl.js.map +1 -1
- package/dist/src/components/segmented-control/SegmentedControl.mjs +2 -1
- package/dist/src/components/segmented-control/SegmentedControl.mjs.map +1 -1
- package/dist/src/components/site-footer/SiteFooter.d.ts +2 -9
- package/dist/src/components/site-footer/SiteFooter.js +2 -1
- package/dist/src/components/site-footer/SiteFooter.js.map +1 -1
- package/dist/src/components/site-footer/SiteFooter.mjs +2 -1
- package/dist/src/components/site-footer/SiteFooter.mjs.map +1 -1
- package/dist/src/components/site-header/SiteHeader.d.ts +9 -10
- package/dist/src/components/site-header/SiteHeader.js +138 -133
- package/dist/src/components/site-header/SiteHeader.js.map +1 -1
- package/dist/src/components/site-header/SiteHeader.mjs +138 -133
- package/dist/src/components/site-header/SiteHeader.mjs.map +1 -1
- package/dist/src/components/tombstone-card/TombstoneCard.d.ts +3 -6
- package/dist/src/components/tombstone-card/TombstoneCard.js +3 -1
- package/dist/src/components/tombstone-card/TombstoneCard.js.map +1 -1
- package/dist/src/components/tombstone-card/TombstoneCard.mjs +3 -1
- package/dist/src/components/tombstone-card/TombstoneCard.mjs.map +1 -1
- package/dist/src/index.d.ts +5 -0
- package/dist/src/utils/consent.d.ts +42 -0
- package/dist/src/utils/consent.js +142 -0
- package/dist/src/utils/consent.js.map +1 -0
- package/dist/src/utils/consent.mjs +107 -0
- package/dist/src/utils/consent.mjs.map +1 -0
- package/dist/src/utils/link.d.ts +21 -0
- package/dist/src/utils/link.js +31 -0
- package/dist/src/utils/link.js.map +1 -0
- package/dist/src/utils/link.mjs +7 -0
- package/dist/src/utils/link.mjs.map +1 -0
- package/dist/styles-full.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/src/components/announcement-bar/AnnouncementBar.test.tsx +18 -0
- package/src/components/announcement-bar/AnnouncementBar.tsx +4 -4
- package/src/components/app-shell/AppShell.test.tsx +10 -0
- package/src/components/app-shell/AppShell.tsx +4 -4
- package/src/components/article-card/ArticleCard.test.tsx +10 -0
- package/src/components/article-card/ArticleCard.tsx +4 -4
- package/src/components/bottom-nav/BottomNav.tsx +3 -6
- package/src/components/breadcrumb/Breadcrumb.tsx +3 -9
- package/src/components/consent-banner/ConsentBanner.test.tsx +58 -0
- package/src/components/consent-banner/ConsentBanner.tsx +93 -0
- package/src/components/consent-banner/index.ts +1 -0
- package/src/components/contact-strip/ContactStrip.test.tsx +16 -0
- package/src/components/contact-strip/ContactStrip.tsx +4 -5
- package/src/components/deal-card/DealCard.test.tsx +19 -0
- package/src/components/deal-card/DealCard.tsx +4 -4
- package/src/components/empty-state/EmptyState.tsx +3 -6
- package/src/components/entity-card/EntityCard.test.tsx +8 -0
- package/src/components/entity-card/EntityCard.tsx +5 -5
- package/src/components/feature-grid/FeatureGrid.test.tsx +16 -0
- package/src/components/feature-grid/FeatureGrid.tsx +4 -5
- package/src/components/link-tabs/LinkTabs.tsx +3 -9
- package/src/components/logo-cloud/LogoCloud.tsx +3 -6
- package/src/components/media-card/MediaCard.test.tsx +97 -0
- package/src/components/media-card/MediaCard.tsx +113 -0
- package/src/components/media-card/index.ts +1 -0
- package/src/components/month-schedule/MonthSchedule.test.tsx +137 -0
- package/src/components/month-schedule/MonthSchedule.tsx +329 -0
- package/src/components/month-schedule/index.ts +1 -0
- package/src/components/pagination/Pagination.tsx +3 -6
- package/src/components/segmented-control/SegmentedControl.tsx +3 -6
- package/src/components/site-footer/SiteFooter.tsx +3 -11
- package/src/components/site-header/SiteHeader.test.tsx +26 -0
- package/src/components/site-header/SiteHeader.tsx +17 -11
- package/src/components/tombstone-card/TombstoneCard.test.tsx +17 -0
- package/src/components/tombstone-card/TombstoneCard.tsx +4 -4
- package/src/index.ts +5 -0
- package/src/manifests/accordion.manifest.json +1 -1
- package/src/manifests/alert.manifest.json +1 -1
- package/src/manifests/announcement-bar.manifest.json +12 -1
- package/src/manifests/app-shell.manifest.json +12 -1
- package/src/manifests/applied-filters.manifest.json +1 -1
- package/src/manifests/article-card.manifest.json +12 -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/consent-banner.manifest.json +130 -0
- package/src/manifests/contact-strip.manifest.json +12 -1
- package/src/manifests/container.manifest.json +1 -1
- package/src/manifests/cover-image.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 +12 -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 +12 -1
- package/src/manifests/feature-grid.manifest.json +12 -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-toolbar.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/media-card.manifest.json +161 -0
- package/src/manifests/menu.manifest.json +1 -1
- package/src/manifests/metric-card.manifest.json +1 -1
- package/src/manifests/month-schedule.manifest.json +217 -0
- 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 +7 -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 +12 -1
- package/src/manifests/tooltip.manifest.json +1 -1
- package/src/utils/consent.test.ts +112 -0
- package/src/utils/consent.ts +169 -0
- package/src/utils/link.ts +19 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { cn } from '../../utils/cn';
|
|
3
|
+
import { linkDestination, type LinkLikeProps } from '../../utils/link';
|
|
3
4
|
|
|
4
5
|
export type SiteFooterLink = {
|
|
5
6
|
label: string;
|
|
@@ -12,7 +13,7 @@ export type SiteFooterColumn = {
|
|
|
12
13
|
links: SiteFooterLink[];
|
|
13
14
|
};
|
|
14
15
|
|
|
15
|
-
export type SiteFooterProps = React.HTMLAttributes<HTMLElement> & {
|
|
16
|
+
export type SiteFooterProps = React.HTMLAttributes<HTMLElement> & LinkLikeProps & {
|
|
16
17
|
/** Brand slot (logo/lockup). */
|
|
17
18
|
brand?: React.ReactNode;
|
|
18
19
|
/** Short line under the brand. */
|
|
@@ -22,14 +23,6 @@ export type SiteFooterProps = React.HTMLAttributes<HTMLElement> & {
|
|
|
22
23
|
columns: SiteFooterColumn[];
|
|
23
24
|
/** Bottom bar (copyright, legal links). */
|
|
24
25
|
legal?: React.ReactNode;
|
|
25
|
-
/** Router link element. */
|
|
26
|
-
linkComponent?: React.ElementType;
|
|
27
|
-
/**
|
|
28
|
-
* Prop used to pass the destination to `linkComponent`.
|
|
29
|
-
* `href` (default) covers anchors and Next.js Link; `to` covers
|
|
30
|
-
* react-router and other routers that use a `to` prop.
|
|
31
|
-
*/
|
|
32
|
-
linkHrefProp?: 'href' | 'to';
|
|
33
26
|
/** Current route, used to mark the matching link with aria-current="page". */
|
|
34
27
|
activeHref?: string;
|
|
35
28
|
/** Prefix matching highlights /docs when on /docs/installation (default). */
|
|
@@ -62,8 +55,7 @@ export function SiteFooter({
|
|
|
62
55
|
...props
|
|
63
56
|
}: SiteFooterProps) {
|
|
64
57
|
const Link = linkComponent ?? 'a';
|
|
65
|
-
const destination = (href: string) =>
|
|
66
|
-
linkHrefProp === 'to' ? { to: href } : { href };
|
|
58
|
+
const destination = (href: string) => linkDestination(href, linkHrefProp);
|
|
67
59
|
|
|
68
60
|
return (
|
|
69
61
|
<footer className={cn('border-t border-border bg-muted/30', className)} {...props}>
|
|
@@ -22,6 +22,32 @@ describe('SiteHeader', () => {
|
|
|
22
22
|
expect(external).toHaveAttribute('rel', 'noopener noreferrer');
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
+
it('renders the topBar utility strip above the nav', () => {
|
|
26
|
+
render(
|
|
27
|
+
<SiteHeader
|
|
28
|
+
brand={<span>Acme</span>}
|
|
29
|
+
items={items}
|
|
30
|
+
topBar={
|
|
31
|
+
<>
|
|
32
|
+
<span>English</span>
|
|
33
|
+
<a href="/submit">Submit an event</a>
|
|
34
|
+
</>
|
|
35
|
+
}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
const strip = screen.getByText('English').parentElement?.parentElement;
|
|
39
|
+
expect(strip).toHaveClass('border-b');
|
|
40
|
+
expect(strip?.querySelector('a')).toHaveAttribute('href', '/submit');
|
|
41
|
+
// The strip sits before the nav landmark in DOM order.
|
|
42
|
+
const nav = screen.getByRole('navigation', { name: 'Main' });
|
|
43
|
+
expect(strip!.compareDocumentPosition(nav) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('omits the topBar strip when the prop is absent', () => {
|
|
47
|
+
const { container } = render(<SiteHeader brand={<span>Acme</span>} items={items} />);
|
|
48
|
+
expect(container.querySelector('header > div')).toBeNull();
|
|
49
|
+
});
|
|
50
|
+
|
|
25
51
|
it('respects exact matching', () => {
|
|
26
52
|
render(<SiteHeader brand={<span>Acme</span>} items={items} activeHref="/docs/components" match="exact" />);
|
|
27
53
|
expect(screen.getByRole('link', { name: 'Docs' })).not.toHaveAttribute('aria-current');
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { cn } from '../../utils/cn';
|
|
5
|
+
import { linkDestination, type LinkLikeProps } from '../../utils/link';
|
|
5
6
|
import { Drawer } from '../drawer/Drawer';
|
|
6
7
|
|
|
7
8
|
/** A single destination in the header or inside a mega panel. */
|
|
@@ -34,9 +35,15 @@ export type SiteNavItem =
|
|
|
34
35
|
columns: SiteNavColumn[];
|
|
35
36
|
};
|
|
36
37
|
|
|
37
|
-
export type SiteHeaderProps = React.HTMLAttributes<HTMLElement> & {
|
|
38
|
+
export type SiteHeaderProps = React.HTMLAttributes<HTMLElement> & LinkLikeProps & {
|
|
38
39
|
/** Brand slot - logo/lockup or wordmark. Wrapped in a link to "/". */
|
|
39
40
|
brand: React.ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Slim utility strip rendered above the brand row (locale switch, feed
|
|
43
|
+
* link, submit link). Content is placed in a container matching the nav
|
|
44
|
+
* metrics; lay out multiple items with justify-between or a flex row.
|
|
45
|
+
*/
|
|
46
|
+
topBar?: React.ReactNode;
|
|
40
47
|
/** Primary navigation items. */
|
|
41
48
|
items: SiteNavItem[];
|
|
42
49
|
/** Current route for active styling (aria-current="page"). */
|
|
@@ -50,14 +57,6 @@ export type SiteHeaderProps = React.HTMLAttributes<HTMLElement> & {
|
|
|
50
57
|
actions?: React.ReactNode;
|
|
51
58
|
/** Actions rendered inside the mobile drawer; defaults to `actions`. */
|
|
52
59
|
mobileActions?: React.ReactNode;
|
|
53
|
-
/** Custom link element for routers (Next Link, react-router Link). */
|
|
54
|
-
linkComponent?: React.ElementType;
|
|
55
|
-
/**
|
|
56
|
-
* Prop used to pass the destination to `linkComponent`.
|
|
57
|
-
* `href` (default) covers anchors and Next.js Link; `to` covers
|
|
58
|
-
* react-router and other routers that use a `to` prop.
|
|
59
|
-
*/
|
|
60
|
-
linkHrefProp?: 'href' | 'to';
|
|
61
60
|
/** Accessible name for the brand link (default "Home"). */
|
|
62
61
|
brandLabel?: string;
|
|
63
62
|
/** Accessible name for the desktop navigation landmark (default "Main"). */
|
|
@@ -122,6 +121,7 @@ function Caret() {
|
|
|
122
121
|
*/
|
|
123
122
|
export function SiteHeader({
|
|
124
123
|
brand,
|
|
124
|
+
topBar,
|
|
125
125
|
items,
|
|
126
126
|
activeHref,
|
|
127
127
|
match = 'prefix',
|
|
@@ -150,8 +150,7 @@ export function SiteHeader({
|
|
|
150
150
|
const menuId = `${generatedId}-menu`;
|
|
151
151
|
const Link = linkComponent ?? 'a';
|
|
152
152
|
|
|
153
|
-
const destination = (href: string) =>
|
|
154
|
-
linkHrefProp === 'to' ? { to: href } : { href };
|
|
153
|
+
const destination = (href: string) => linkDestination(href, linkHrefProp);
|
|
155
154
|
|
|
156
155
|
// Escape and an outside pointer close the desktop panel. Focus movement
|
|
157
156
|
// inside the item is handled by onBlur so tabbing through stays open.
|
|
@@ -229,6 +228,13 @@ export function SiteHeader({
|
|
|
229
228
|
)}
|
|
230
229
|
{...props}
|
|
231
230
|
>
|
|
231
|
+
{topBar && (
|
|
232
|
+
<div className="border-b border-border/60 text-muted-foreground">
|
|
233
|
+
<div className="mx-auto flex h-9 w-full max-w-7xl items-center justify-between gap-4 px-4 text-xs sm:px-6">
|
|
234
|
+
{topBar}
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
)}
|
|
232
238
|
<nav
|
|
233
239
|
aria-label={navLabel}
|
|
234
240
|
className={cn(
|
|
@@ -19,6 +19,23 @@ describe('TombstoneCard', () => {
|
|
|
19
19
|
expect(screen.getByRole('link', { name: 'View details' })).toHaveAttribute('href', '/deals/archived');
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
+
it('passes the destination via linkHrefProp for routers that use "to"', () => {
|
|
23
|
+
const RouterLink = ({ to, children, ...rest }: { to: string; children: React.ReactNode }) => (
|
|
24
|
+
<a href={to} data-router-to={to} {...rest}>
|
|
25
|
+
{children}
|
|
26
|
+
</a>
|
|
27
|
+
);
|
|
28
|
+
render(
|
|
29
|
+
<TombstoneCard
|
|
30
|
+
title="Unavailable"
|
|
31
|
+
href="/deals/1"
|
|
32
|
+
linkComponent={RouterLink}
|
|
33
|
+
linkHrefProp="to"
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
expect(screen.getByRole('link', { name: 'View details' })).toHaveAttribute('data-router-to', '/deals/1');
|
|
37
|
+
});
|
|
38
|
+
|
|
22
39
|
it('has no accessibility violations', async () => {
|
|
23
40
|
const { container } = render(<TombstoneCard title="Unavailable" reason="No longer available." />);
|
|
24
41
|
expect(await axe(container)).toHaveNoViolations();
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { cn } from '../../utils/cn';
|
|
3
|
+
import { linkDestination, type LinkLikeProps } from '../../utils/link';
|
|
3
4
|
import { Badge } from '../badge/Badge';
|
|
4
5
|
import { Card, CardContent } from '../card/Card';
|
|
5
6
|
|
|
6
7
|
export type TombstoneStatus = 'archived' | 'unavailable' | 'closed';
|
|
7
8
|
|
|
8
|
-
export type TombstoneCardProps = Omit<React.HTMLAttributes<HTMLElement>, 'title'> & {
|
|
9
|
+
export type TombstoneCardProps = Omit<React.HTMLAttributes<HTMLElement>, 'title'> & LinkLikeProps & {
|
|
9
10
|
/** Listing, deal or document name. */
|
|
10
11
|
title: string;
|
|
11
12
|
/** Why the item is unavailable. */
|
|
@@ -18,8 +19,6 @@ export type TombstoneCardProps = Omit<React.HTMLAttributes<HTMLElement>, 'title'
|
|
|
18
19
|
href?: string;
|
|
19
20
|
/** Link label. Default "View details". */
|
|
20
21
|
actionLabel?: string;
|
|
21
|
-
/** Custom link element for routers. */
|
|
22
|
-
linkComponent?: React.ElementType;
|
|
23
22
|
};
|
|
24
23
|
|
|
25
24
|
const statusConfig: Record<TombstoneStatus, { label: string; variant: 'secondary' | 'warning' | 'outline' }> = {
|
|
@@ -42,6 +41,7 @@ export const TombstoneCard = React.forwardRef<HTMLElement, TombstoneCardProps>(f
|
|
|
42
41
|
href,
|
|
43
42
|
actionLabel = 'View details',
|
|
44
43
|
linkComponent,
|
|
44
|
+
linkHrefProp = 'href',
|
|
45
45
|
className,
|
|
46
46
|
...props
|
|
47
47
|
},
|
|
@@ -65,7 +65,7 @@ export const TombstoneCard = React.forwardRef<HTMLElement, TombstoneCardProps>(f
|
|
|
65
65
|
{reason && <p className="text-sm leading-relaxed text-muted-foreground">{reason}</p>}
|
|
66
66
|
{href && (
|
|
67
67
|
<Link
|
|
68
|
-
|
|
68
|
+
{...linkDestination(href, linkHrefProp)}
|
|
69
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}
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,8 @@ export * from './types/manifest';
|
|
|
2
2
|
export * from './utils/cn';
|
|
3
3
|
export * from './utils/gap';
|
|
4
4
|
export * from './utils/presence';
|
|
5
|
+
export * from './utils/consent';
|
|
6
|
+
export type { LinkLikeProps } from './utils/link';
|
|
5
7
|
export * from './components/app-shell';
|
|
6
8
|
export * from './components/button';
|
|
7
9
|
export * from './components/button-group';
|
|
@@ -36,8 +38,10 @@ export * from './components/link-tabs';
|
|
|
36
38
|
export * from './components/theme-toggle';
|
|
37
39
|
export * from './components/tooltip';
|
|
38
40
|
export * from './components/calendar';
|
|
41
|
+
export * from './components/month-schedule';
|
|
39
42
|
export * from './components/card';
|
|
40
43
|
export * from './components/confirm-dialog';
|
|
44
|
+
export * from './components/consent-banner';
|
|
41
45
|
export * from './components/table-of-contents';
|
|
42
46
|
export * from './components/prose';
|
|
43
47
|
export * from './components/site-footer';
|
|
@@ -80,6 +84,7 @@ export * from './components/feature-row';
|
|
|
80
84
|
export * from './components/testimonial';
|
|
81
85
|
export * from './components/process-steps';
|
|
82
86
|
export * from './components/article-card';
|
|
87
|
+
export * from './components/media-card';
|
|
83
88
|
export * from './components/newsletter';
|
|
84
89
|
export * from './components/contact-strip';
|
|
85
90
|
export * from './components/announcement-bar';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.12.0",
|
|
8
8
|
"sourceDir": "announcement-bar",
|
|
9
9
|
"exportName": "AnnouncementBar",
|
|
10
10
|
"description": "Dismissible announcement bar with optional action, tone and sticky positioning.",
|
|
@@ -65,6 +65,17 @@
|
|
|
65
65
|
"type": "React.ElementType",
|
|
66
66
|
"required": false,
|
|
67
67
|
"description": "Custom link element for routers."
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "linkHrefProp",
|
|
71
|
+
"type": "'href' | 'to'",
|
|
72
|
+
"required": false,
|
|
73
|
+
"defaultValue": "href",
|
|
74
|
+
"description": "Prop name used to pass the destination to linkComponent ('href' for anchors and most routers, 'to' for react-router).",
|
|
75
|
+
"enum": [
|
|
76
|
+
"href",
|
|
77
|
+
"to"
|
|
78
|
+
]
|
|
68
79
|
}
|
|
69
80
|
],
|
|
70
81
|
"examples": [
|
|
@@ -62,6 +62,17 @@
|
|
|
62
62
|
"defaultValue": "a",
|
|
63
63
|
"description": "Router link component (react-router Link, Next Link) (Sidebar)."
|
|
64
64
|
},
|
|
65
|
+
{
|
|
66
|
+
"name": "linkHrefProp",
|
|
67
|
+
"type": "'href' | 'to'",
|
|
68
|
+
"required": false,
|
|
69
|
+
"defaultValue": "href",
|
|
70
|
+
"description": "Prop name used to pass the destination to linkComponent ('href' for anchors and most routers, 'to' for react-router).",
|
|
71
|
+
"enum": [
|
|
72
|
+
"href",
|
|
73
|
+
"to"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
65
76
|
{
|
|
66
77
|
"name": "label",
|
|
67
78
|
"type": "string",
|
|
@@ -214,7 +225,7 @@
|
|
|
214
225
|
],
|
|
215
226
|
"package": "@slipstream-ui/core",
|
|
216
227
|
"importPath": "@slipstream-ui/core",
|
|
217
|
-
"version": "0.
|
|
228
|
+
"version": "0.12.0",
|
|
218
229
|
"sourceDir": "app-shell",
|
|
219
230
|
"exportName": "AppShell"
|
|
220
231
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.12.0",
|
|
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.
|
|
7
|
+
"version": "0.12.0",
|
|
8
8
|
"sourceDir": "article-card",
|
|
9
9
|
"exportName": "ArticleCard",
|
|
10
10
|
"description": "Linked article or resource card with media, eyebrow, title, summary and metadata.",
|
|
@@ -52,6 +52,17 @@
|
|
|
52
52
|
"required": false,
|
|
53
53
|
"description": "Custom link element for routers."
|
|
54
54
|
},
|
|
55
|
+
{
|
|
56
|
+
"name": "linkHrefProp",
|
|
57
|
+
"type": "'href' | 'to'",
|
|
58
|
+
"required": false,
|
|
59
|
+
"defaultValue": "href",
|
|
60
|
+
"description": "Prop name used to pass the destination to linkComponent ('href' for anchors and most routers, 'to' for react-router).",
|
|
61
|
+
"enum": [
|
|
62
|
+
"href",
|
|
63
|
+
"to"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
55
66
|
{
|
|
56
67
|
"name": "variant",
|
|
57
68
|
"type": "'default' | 'compact'",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.12.0",
|
|
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.
|
|
7
|
+
"version": "0.12.0",
|
|
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.",
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "consent-banner",
|
|
3
|
+
"name": "ConsentBanner",
|
|
4
|
+
"tier": "molecule",
|
|
5
|
+
"package": "@slipstream-ui/core",
|
|
6
|
+
"importPath": "@slipstream-ui/core",
|
|
7
|
+
"version": "0.12.0",
|
|
8
|
+
"sourceDir": "consent-banner",
|
|
9
|
+
"exportName": "ConsentBanner",
|
|
10
|
+
"description": "Styled cookie/consent banner: fixed bottom bar with accept, decline and an optional manage-preferences action. Pair it with the headless useConsent hook so the decision persists per-purpose in localStorage.",
|
|
11
|
+
"designIntent": "Every consumer app reinvents the same cookie banner and consent store. ConsentBanner owns the presentation (fixed bar, safe-area padding, labelled region, AA buttons); useConsent owns the headless state (per-purpose preferences, expiry, cross-tab sync) so neither side is coupled to the other.",
|
|
12
|
+
"props": [
|
|
13
|
+
{
|
|
14
|
+
"name": "onAccept",
|
|
15
|
+
"type": "() => void",
|
|
16
|
+
"required": true,
|
|
17
|
+
"description": "Called when the visitor accepts; typically consent.setAll(true)."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "onDecline",
|
|
21
|
+
"type": "() => void",
|
|
22
|
+
"required": true,
|
|
23
|
+
"description": "Called when the visitor declines; typically consent.setAll(false)."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "onManage",
|
|
27
|
+
"type": "() => void",
|
|
28
|
+
"required": false,
|
|
29
|
+
"description": "Optional manage-preferences action for granular consent dialogs."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "title",
|
|
33
|
+
"type": "ReactNode",
|
|
34
|
+
"required": false,
|
|
35
|
+
"description": "Banner heading; omit for a single-line notice."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "children",
|
|
39
|
+
"type": "ReactNode",
|
|
40
|
+
"required": false,
|
|
41
|
+
"description": "Body copy; put privacy-policy links here."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "label",
|
|
45
|
+
"type": "string",
|
|
46
|
+
"required": false,
|
|
47
|
+
"defaultValue": "'Cookie consent'",
|
|
48
|
+
"description": "Accessible name for the banner region."
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "acceptLabel",
|
|
52
|
+
"type": "ReactNode",
|
|
53
|
+
"required": false,
|
|
54
|
+
"defaultValue": "'Accept'",
|
|
55
|
+
"description": "Accept button label."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "declineLabel",
|
|
59
|
+
"type": "ReactNode",
|
|
60
|
+
"required": false,
|
|
61
|
+
"defaultValue": "'Decline'",
|
|
62
|
+
"description": "Decline button label."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "manageLabel",
|
|
66
|
+
"type": "ReactNode",
|
|
67
|
+
"required": false,
|
|
68
|
+
"defaultValue": "'Manage'",
|
|
69
|
+
"description": "Manage-preferences button label."
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"examples": [
|
|
73
|
+
{
|
|
74
|
+
"title": "Accept/decline with useConsent",
|
|
75
|
+
"code": "const consent = useConsent({ purposes: ['analytics'] });\n\n{!consent.decided && (\n <ConsentBanner\n title=\"We use cookies\"\n onAccept={() => consent.setAll(true)}\n onDecline={() => consent.setAll(false)}\n onManage={() => openPreferences()}\n >\n We use cookies for analytics.{' '}\n <a href=\"/privacy\">Privacy policy</a>\n </ConsentBanner>\n)}",
|
|
76
|
+
"description": "The canonical wiring: render while undecided, persist through the hook."
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"title": "Gate analytics on a purpose",
|
|
80
|
+
"code": "const consent = useConsent({ purposes: ['analytics'] });\n\nuseEffect(() => {\n if (consent.preferences?.analytics) loadAnalytics();\n}, [consent.preferences]);",
|
|
81
|
+
"description": "Read the same hook elsewhere to gate trackers; instances stay in sync."
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"antiPatterns": [
|
|
85
|
+
{
|
|
86
|
+
"title": "Don't render before the decision is known",
|
|
87
|
+
"explanation": "Render the banner only while consent.decided is false, and read preferences (not decided) to gate trackers — a denied purpose and an undecided visitor are different states.",
|
|
88
|
+
"example": "// Avoid\n{consent.decided && <Tracker />}\n// Prefer\n{consent.preferences?.analytics && <Tracker />}"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"title": "Don't block the page",
|
|
92
|
+
"explanation": "ConsentBanner is non-modal by design; a modal consent wall hurts conversion and accessibility. Use Dialog only if your policy genuinely requires it.",
|
|
93
|
+
"example": "// Avoid\n<Dialog open={!consent.decided}>...</Dialog>"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"accessibility": [
|
|
97
|
+
{
|
|
98
|
+
"feature": "Named region",
|
|
99
|
+
"implementation": "Renders role=region with aria-label (default 'Cookie consent')",
|
|
100
|
+
"userRequirements": "Localize label, acceptLabel, declineLabel and manageLabel for non-English audiences"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"feature": "Keyboard and focus",
|
|
104
|
+
"implementation": "All actions are native Buttons with visible focus rings; tab order is manage → decline → accept",
|
|
105
|
+
"userRequirements": "Keep accept and decline equally prominent — no dark patterns"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"feature": "Safe-area aware",
|
|
109
|
+
"implementation": "Bottom padding includes env(safe-area-inset-bottom) for notched devices",
|
|
110
|
+
"userRequirements": "None"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"compositionRules": [
|
|
114
|
+
{
|
|
115
|
+
"component": "useConsent",
|
|
116
|
+
"relationship": "Headless hook exported from @slipstream-ui/core; wire onAccept/onDecline/onManage to setAll/set/clear",
|
|
117
|
+
"example": "const consent = useConsent({ purposes: ['analytics', 'marketing'] });"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"component": "SiteFooter",
|
|
121
|
+
"relationship": "Re-open the banner or preferences dialog from a footer 'Cookie settings' link via consent.clear()",
|
|
122
|
+
"example": "<SiteFooter contact={<button onClick={consent.clear}>Cookie settings</button>} />"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"relatedComponents": [
|
|
126
|
+
"Alert",
|
|
127
|
+
"Dialog",
|
|
128
|
+
"Button"
|
|
129
|
+
]
|
|
130
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.12.0",
|
|
8
8
|
"sourceDir": "contact-strip",
|
|
9
9
|
"exportName": "ContactStrip",
|
|
10
10
|
"description": "Compact labelled contact rows with optional icons and links.",
|
|
@@ -39,6 +39,17 @@
|
|
|
39
39
|
"type": "React.ElementType",
|
|
40
40
|
"required": false,
|
|
41
41
|
"description": "Custom link element for routers."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "linkHrefProp",
|
|
45
|
+
"type": "'href' | 'to'",
|
|
46
|
+
"required": false,
|
|
47
|
+
"defaultValue": "href",
|
|
48
|
+
"description": "Prop name used to pass the destination to linkComponent ('href' for anchors and most routers, 'to' for react-router).",
|
|
49
|
+
"enum": [
|
|
50
|
+
"href",
|
|
51
|
+
"to"
|
|
52
|
+
]
|
|
42
53
|
}
|
|
43
54
|
],
|
|
44
55
|
"examples": [
|