@slipstream-ui/core 0.11.10 → 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 +154 -163
- package/dist/index.d.ts +154 -163
- package/dist/index.js +1334 -1165
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1331 -1165
- 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 +1 -1
- package/dist/manifests/menu.manifest.json +1 -1
- package/dist/manifests/metric-card.manifest.json +1 -1
- package/dist/manifests/month-schedule.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 +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 +3 -10
- package/dist/src/components/media-card/MediaCard.js +2 -1
- package/dist/src/components/media-card/MediaCard.js.map +1 -1
- package/dist/src/components/media-card/MediaCard.mjs +2 -1
- package/dist/src/components/media-card/MediaCard.mjs.map +1 -1
- package/dist/src/components/month-schedule/MonthSchedule.d.ts +2 -5
- package/dist/src/components/month-schedule/MonthSchedule.js +3 -2
- package/dist/src/components/month-schedule/MonthSchedule.js.map +1 -1
- package/dist/src/components/month-schedule/MonthSchedule.mjs +3 -2
- package/dist/src/components/month-schedule/MonthSchedule.mjs.map +1 -1
- 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 +3 -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.tsx +3 -6
- package/src/components/month-schedule/MonthSchedule.tsx +4 -7
- 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 +3 -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 +1 -1
- package/src/manifests/menu.manifest.json +1 -1
- package/src/manifests/metric-card.manifest.json +1 -1
- package/src/manifests/month-schedule.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 +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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/feature-grid/FeatureGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type FeatureItem = {\n title: string;\n description?: string;\n icon?: React.ReactNode;\n href?: string;\n /** Link text shown when href is present. */\n actionLabel?: string;\n};\n\nexport type FeatureGridProps = React.HTMLAttributes<HTMLUListElement> & {\n /** Features to display. */\n features: FeatureItem[];\n /** Desktop column count (2-4). Default 3. */\n columns?: 2 | 3 | 4;\n /** Card surface or plain stack. Default 'card'. */\n variant?: 'card' | 'plain';\n /** Content alignment. Default 'left'. */\n align?: 'left' | 'center';\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/feature-grid/FeatureGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { linkDestination, type LinkLikeProps } from '../../utils/link';\n\nexport type FeatureItem = {\n title: string;\n description?: string;\n icon?: React.ReactNode;\n href?: string;\n /** Link text shown when href is present. */\n actionLabel?: string;\n};\n\nexport type FeatureGridProps = React.HTMLAttributes<HTMLUListElement> & LinkLikeProps & {\n /** Features to display. */\n features: FeatureItem[];\n /** Desktop column count (2-4). Default 3. */\n columns?: 2 | 3 | 4;\n /** Card surface or plain stack. Default 'card'. */\n variant?: 'card' | 'plain';\n /** Content alignment. Default 'left'. */\n align?: 'left' | 'center';\n};\n\nconst columnClasses: Record<NonNullable<FeatureGridProps['columns']>, string> = {\n 2: 'sm:grid-cols-2',\n 3: 'sm:grid-cols-2 lg:grid-cols-3',\n 4: 'sm:grid-cols-2 lg:grid-cols-4',\n};\n\n/**\n * Grid of feature or benefit cards with an optional icon, copy and link.\n * Use it for the three-risk, six-category and feature-row sections common on\n * marketing pages. Each card is a list item, so the group is announced as a list.\n */\nexport const FeatureGrid = React.forwardRef<HTMLUListElement, FeatureGridProps>(function FeatureGrid(\n { features, columns = 3, variant = 'card', align = 'left', linkComponent, linkHrefProp = 'href', className, ...props },\n ref\n) {\n const Link = linkComponent ?? 'a';\n const cardClass = cn(\n 'group flex h-full flex-col gap-3 rounded-xl p-6',\n variant === 'card' && 'border border-border bg-card shadow-sm transition-colors hover:border-primary/40',\n align === 'center' && 'items-center text-center'\n );\n\n const content = (feature: FeatureItem) => (\n <>\n {feature.icon && (\n <span className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary-ink [&_svg]:size-5\">\n {feature.icon}\n </span>\n )}\n <h3 className=\"text-base font-semibold tracking-tight\">{feature.title}</h3>\n {feature.description && <p className=\"text-sm leading-relaxed text-muted-foreground\">{feature.description}</p>}\n {feature.href && feature.actionLabel && (\n <span className=\"mt-auto pt-2 text-sm font-medium text-primary-ink\">\n {feature.actionLabel} <span aria-hidden=\"true\">→</span>\n </span>\n )}\n </>\n );\n\n return (\n <ul ref={ref} className={cn('grid gap-6', columnClasses[columns], className)} {...props}>\n {features.map((feature) => (\n <li key={feature.title} className=\"min-w-0\">\n {feature.href ? (\n <Link {...linkDestination(feature.href, linkHrefProp)} className={cn(cardClass, 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background')}>\n {content(feature)}\n </Link>\n ) : (\n <div className={cardClass}>{content(feature)}</div>\n )}\n </li>\n ))}\n </ul>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CI;AA/CJ,YAAuB;AACvB,gBAAmB;AACnB,kBAAoD;AAsBpD,MAAM,gBAA0E;AAAA,EAC9E,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAOO,MAAM,cAAc,MAAM,WAA+C,SAASA,aACvF,EAAE,UAAU,UAAU,GAAG,UAAU,QAAQ,QAAQ,QAAQ,eAAe,eAAe,QAAQ,WAAW,GAAG,MAAM,GACrH,KACA;AACA,QAAM,OAAO,iBAAiB;AAC9B,QAAM,gBAAY;AAAA,IAChB;AAAA,IACA,YAAY,UAAU;AAAA,IACtB,UAAU,YAAY;AAAA,EACxB;AAEA,QAAM,UAAU,CAAC,YACf,4EACG;AAAA,YAAQ,QACP,4CAAC,UAAK,WAAU,gHACb,kBAAQ,MACX;AAAA,IAEF,4CAAC,QAAG,WAAU,0CAA0C,kBAAQ,OAAM;AAAA,IACrE,QAAQ,eAAe,4CAAC,OAAE,WAAU,iDAAiD,kBAAQ,aAAY;AAAA,IACzG,QAAQ,QAAQ,QAAQ,eACvB,6CAAC,UAAK,WAAU,qDACb;AAAA,cAAQ;AAAA,MAAY;AAAA,MAAC,4CAAC,UAAK,eAAY,QAAO,oBAAC;AAAA,OAClD;AAAA,KAEJ;AAGF,SACE,4CAAC,QAAG,KAAU,eAAW,cAAG,cAAc,cAAc,OAAO,GAAG,SAAS,GAAI,GAAG,OAC/E,mBAAS,IAAI,CAAC,YACb,4CAAC,QAAuB,WAAU,WAC/B,kBAAQ,OACP,4CAAC,QAAM,OAAG,6BAAgB,QAAQ,MAAM,YAAY,GAAG,eAAW,cAAG,WAAW,0IAA0I,GACvN,kBAAQ,OAAO,GAClB,IAEA,4CAAC,SAAI,WAAW,WAAY,kBAAQ,OAAO,GAAE,KANxC,QAAQ,KAQjB,CACD,GACH;AAEJ,CAAC;","names":["FeatureGrid"]}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { cn } from "../../utils/cn.mjs";
|
|
4
|
+
import { linkDestination } from "../../utils/link.mjs";
|
|
4
5
|
const columnClasses = {
|
|
5
6
|
2: "sm:grid-cols-2",
|
|
6
7
|
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
7
8
|
4: "sm:grid-cols-2 lg:grid-cols-4"
|
|
8
9
|
};
|
|
9
|
-
const FeatureGrid = React.forwardRef(function FeatureGrid2({ features, columns = 3, variant = "card", align = "left", linkComponent, className, ...props }, ref) {
|
|
10
|
+
const FeatureGrid = React.forwardRef(function FeatureGrid2({ features, columns = 3, variant = "card", align = "left", linkComponent, linkHrefProp = "href", className, ...props }, ref) {
|
|
10
11
|
const Link = linkComponent ?? "a";
|
|
11
12
|
const cardClass = cn(
|
|
12
13
|
"group flex h-full flex-col gap-3 rounded-xl p-6",
|
|
@@ -23,7 +24,7 @@ const FeatureGrid = React.forwardRef(function FeatureGrid2({ features, columns =
|
|
|
23
24
|
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u2192" })
|
|
24
25
|
] })
|
|
25
26
|
] });
|
|
26
|
-
return /* @__PURE__ */ jsx("ul", { ref, className: cn("grid gap-6", columnClasses[columns], className), ...props, children: features.map((feature) => /* @__PURE__ */ jsx("li", { className: "min-w-0", children: feature.href ? /* @__PURE__ */ jsx(Link, {
|
|
27
|
+
return /* @__PURE__ */ jsx("ul", { ref, className: cn("grid gap-6", columnClasses[columns], className), ...props, children: features.map((feature) => /* @__PURE__ */ jsx("li", { className: "min-w-0", children: feature.href ? /* @__PURE__ */ jsx(Link, { ...linkDestination(feature.href, linkHrefProp), className: cn(cardClass, "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"), children: content(feature) }) : /* @__PURE__ */ jsx("div", { className: cardClass, children: content(feature) }) }, feature.title)) });
|
|
27
28
|
});
|
|
28
29
|
export {
|
|
29
30
|
FeatureGrid
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/feature-grid/FeatureGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type FeatureItem = {\n title: string;\n description?: string;\n icon?: React.ReactNode;\n href?: string;\n /** Link text shown when href is present. */\n actionLabel?: string;\n};\n\nexport type FeatureGridProps = React.HTMLAttributes<HTMLUListElement> & {\n /** Features to display. */\n features: FeatureItem[];\n /** Desktop column count (2-4). Default 3. */\n columns?: 2 | 3 | 4;\n /** Card surface or plain stack. Default 'card'. */\n variant?: 'card' | 'plain';\n /** Content alignment. Default 'left'. */\n align?: 'left' | 'center';\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/feature-grid/FeatureGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { linkDestination, type LinkLikeProps } from '../../utils/link';\n\nexport type FeatureItem = {\n title: string;\n description?: string;\n icon?: React.ReactNode;\n href?: string;\n /** Link text shown when href is present. */\n actionLabel?: string;\n};\n\nexport type FeatureGridProps = React.HTMLAttributes<HTMLUListElement> & LinkLikeProps & {\n /** Features to display. */\n features: FeatureItem[];\n /** Desktop column count (2-4). Default 3. */\n columns?: 2 | 3 | 4;\n /** Card surface or plain stack. Default 'card'. */\n variant?: 'card' | 'plain';\n /** Content alignment. Default 'left'. */\n align?: 'left' | 'center';\n};\n\nconst columnClasses: Record<NonNullable<FeatureGridProps['columns']>, string> = {\n 2: 'sm:grid-cols-2',\n 3: 'sm:grid-cols-2 lg:grid-cols-3',\n 4: 'sm:grid-cols-2 lg:grid-cols-4',\n};\n\n/**\n * Grid of feature or benefit cards with an optional icon, copy and link.\n * Use it for the three-risk, six-category and feature-row sections common on\n * marketing pages. Each card is a list item, so the group is announced as a list.\n */\nexport const FeatureGrid = React.forwardRef<HTMLUListElement, FeatureGridProps>(function FeatureGrid(\n { features, columns = 3, variant = 'card', align = 'left', linkComponent, linkHrefProp = 'href', className, ...props },\n ref\n) {\n const Link = linkComponent ?? 'a';\n const cardClass = cn(\n 'group flex h-full flex-col gap-3 rounded-xl p-6',\n variant === 'card' && 'border border-border bg-card shadow-sm transition-colors hover:border-primary/40',\n align === 'center' && 'items-center text-center'\n );\n\n const content = (feature: FeatureItem) => (\n <>\n {feature.icon && (\n <span className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary-ink [&_svg]:size-5\">\n {feature.icon}\n </span>\n )}\n <h3 className=\"text-base font-semibold tracking-tight\">{feature.title}</h3>\n {feature.description && <p className=\"text-sm leading-relaxed text-muted-foreground\">{feature.description}</p>}\n {feature.href && feature.actionLabel && (\n <span className=\"mt-auto pt-2 text-sm font-medium text-primary-ink\">\n {feature.actionLabel} <span aria-hidden=\"true\">→</span>\n </span>\n )}\n </>\n );\n\n return (\n <ul ref={ref} className={cn('grid gap-6', columnClasses[columns], className)} {...props}>\n {features.map((feature) => (\n <li key={feature.title} className=\"min-w-0\">\n {feature.href ? (\n <Link {...linkDestination(feature.href, linkHrefProp)} className={cn(cardClass, 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background')}>\n {content(feature)}\n </Link>\n ) : (\n <div className={cardClass}>{content(feature)}</div>\n )}\n </li>\n ))}\n </ul>\n );\n});\n"],"mappings":"AA+CI,mBAEI,KAOA,YATJ;AA/CJ,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,uBAA2C;AAsBpD,MAAM,gBAA0E;AAAA,EAC9E,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAOO,MAAM,cAAc,MAAM,WAA+C,SAASA,aACvF,EAAE,UAAU,UAAU,GAAG,UAAU,QAAQ,QAAQ,QAAQ,eAAe,eAAe,QAAQ,WAAW,GAAG,MAAM,GACrH,KACA;AACA,QAAM,OAAO,iBAAiB;AAC9B,QAAM,YAAY;AAAA,IAChB;AAAA,IACA,YAAY,UAAU;AAAA,IACtB,UAAU,YAAY;AAAA,EACxB;AAEA,QAAM,UAAU,CAAC,YACf,iCACG;AAAA,YAAQ,QACP,oBAAC,UAAK,WAAU,gHACb,kBAAQ,MACX;AAAA,IAEF,oBAAC,QAAG,WAAU,0CAA0C,kBAAQ,OAAM;AAAA,IACrE,QAAQ,eAAe,oBAAC,OAAE,WAAU,iDAAiD,kBAAQ,aAAY;AAAA,IACzG,QAAQ,QAAQ,QAAQ,eACvB,qBAAC,UAAK,WAAU,qDACb;AAAA,cAAQ;AAAA,MAAY;AAAA,MAAC,oBAAC,UAAK,eAAY,QAAO,oBAAC;AAAA,OAClD;AAAA,KAEJ;AAGF,SACE,oBAAC,QAAG,KAAU,WAAW,GAAG,cAAc,cAAc,OAAO,GAAG,SAAS,GAAI,GAAG,OAC/E,mBAAS,IAAI,CAAC,YACb,oBAAC,QAAuB,WAAU,WAC/B,kBAAQ,OACP,oBAAC,QAAM,GAAG,gBAAgB,QAAQ,MAAM,YAAY,GAAG,WAAW,GAAG,WAAW,0IAA0I,GACvN,kBAAQ,OAAO,GAClB,IAEA,oBAAC,SAAI,WAAW,WAAY,kBAAQ,OAAO,GAAE,KANxC,QAAQ,KAQjB,CACD,GACH;AAEJ,CAAC;","names":["FeatureGrid"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { type LinkLikeProps } from '../../utils/link';
|
|
2
3
|
type LinkTabsVariant = 'default' | 'underline' | 'rounded';
|
|
3
4
|
type LinkTabsSize = 'sm' | 'md' | 'lg';
|
|
4
5
|
export type LinkTabsItem = {
|
|
@@ -13,18 +14,11 @@ export type LinkTabsItem = {
|
|
|
13
14
|
/** Render a disabled, non-interactive tab. */
|
|
14
15
|
disabled?: boolean;
|
|
15
16
|
};
|
|
16
|
-
export type LinkTabsProps = Omit<React.HTMLAttributes<HTMLElement>, 'children'> & {
|
|
17
|
+
export type LinkTabsProps = Omit<React.HTMLAttributes<HTMLElement>, 'children'> & LinkLikeProps & {
|
|
17
18
|
/** Tabs in display order. */
|
|
18
19
|
items: LinkTabsItem[];
|
|
19
20
|
/** Current pathname, used to mark the active tab. */
|
|
20
21
|
activeHref?: string;
|
|
21
|
-
/** Router link element (Inertia Link, Next Link, react-router Link). Defaults to `<a>`. */
|
|
22
|
-
linkComponent?: React.ElementType;
|
|
23
|
-
/**
|
|
24
|
-
* Prop used to pass the destination to `linkComponent`. `href` covers
|
|
25
|
-
* anchors and Next.js Link; `to` covers react-router and similar routers.
|
|
26
|
-
*/
|
|
27
|
-
linkHrefProp?: 'href' | 'to';
|
|
28
22
|
/** Visual style. */
|
|
29
23
|
variant?: LinkTabsVariant;
|
|
30
24
|
/** Control density. */
|
|
@@ -38,18 +32,11 @@ export type LinkTabsProps = Omit<React.HTMLAttributes<HTMLElement>, 'children'>
|
|
|
38
32
|
* route with `aria-current="page"` - the correct pattern for URL-driven
|
|
39
33
|
* sub-navigation such as settings, account, or app sections.
|
|
40
34
|
*/
|
|
41
|
-
export declare const LinkTabs: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "children"> & {
|
|
35
|
+
export declare const LinkTabs: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "children"> & LinkLikeProps & {
|
|
42
36
|
/** Tabs in display order. */
|
|
43
37
|
items: LinkTabsItem[];
|
|
44
38
|
/** Current pathname, used to mark the active tab. */
|
|
45
39
|
activeHref?: string;
|
|
46
|
-
/** Router link element (Inertia Link, Next Link, react-router Link). Defaults to `<a>`. */
|
|
47
|
-
linkComponent?: React.ElementType;
|
|
48
|
-
/**
|
|
49
|
-
* Prop used to pass the destination to `linkComponent`. `href` covers
|
|
50
|
-
* anchors and Next.js Link; `to` covers react-router and similar routers.
|
|
51
|
-
*/
|
|
52
|
-
linkHrefProp?: "href" | "to";
|
|
53
40
|
/** Visual style. */
|
|
54
41
|
variant?: LinkTabsVariant;
|
|
55
42
|
/** Control density. */
|
|
@@ -36,6 +36,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
36
36
|
var React = __toESM(require("react"));
|
|
37
37
|
var import_class_variance_authority = require("class-variance-authority");
|
|
38
38
|
var import_cn = require("../../utils/cn.js");
|
|
39
|
+
var import_link = require("../../utils/link.js");
|
|
39
40
|
const listVariants = (0, import_class_variance_authority.cva)("inline-flex items-center", {
|
|
40
41
|
variants: {
|
|
41
42
|
variant: {
|
|
@@ -108,7 +109,7 @@ const LinkTabs = React.forwardRef(function LinkTabs2({
|
|
|
108
109
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
109
110
|
Link,
|
|
110
111
|
{
|
|
111
|
-
...
|
|
112
|
+
...(0, import_link.linkDestination)(item.href, linkHrefProp),
|
|
112
113
|
"aria-current": active ? "page" : void 0,
|
|
113
114
|
"data-active": active ? "true" : "false",
|
|
114
115
|
className: itemVariants({ variant, size }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/link-tabs/LinkTabs.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\ntype LinkTabsVariant = 'default' | 'underline' | 'rounded';\ntype LinkTabsSize = 'sm' | 'md' | 'lg';\n\nexport type LinkTabsItem = {\n /** Visible tab label. */\n label: string;\n /** Destination URL. */\n href: string;\n /** Match only the exact path instead of a prefix. */\n exact?: boolean;\n /** Optional leading icon. */\n icon?: React.ReactNode;\n /** Render a disabled, non-interactive tab. */\n disabled?: boolean;\n};\n\nexport type LinkTabsProps = Omit<React.HTMLAttributes<HTMLElement>, 'children'> & {\n /** Tabs in display order. */\n items: LinkTabsItem[];\n /** Current pathname, used to mark the active tab. */\n activeHref?: string;\n /**
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/link-tabs/LinkTabs.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { linkDestination, type LinkLikeProps } from '../../utils/link';\n\ntype LinkTabsVariant = 'default' | 'underline' | 'rounded';\ntype LinkTabsSize = 'sm' | 'md' | 'lg';\n\nexport type LinkTabsItem = {\n /** Visible tab label. */\n label: string;\n /** Destination URL. */\n href: string;\n /** Match only the exact path instead of a prefix. */\n exact?: boolean;\n /** Optional leading icon. */\n icon?: React.ReactNode;\n /** Render a disabled, non-interactive tab. */\n disabled?: boolean;\n};\n\nexport type LinkTabsProps = Omit<React.HTMLAttributes<HTMLElement>, 'children'> & LinkLikeProps & {\n /** Tabs in display order. */\n items: LinkTabsItem[];\n /** Current pathname, used to mark the active tab. */\n activeHref?: string;\n /** Visual style. */\n variant?: LinkTabsVariant;\n /** Control density. */\n size?: LinkTabsSize;\n /** Accessible name for the navigation landmark. Default \"Section\". */\n label?: string;\n};\n\nconst listVariants = cva('inline-flex items-center', {\n variants: {\n variant: {\n default: 'gap-1 rounded-md bg-muted p-1',\n underline: 'gap-1 rounded-none border-b border-border bg-transparent p-0',\n rounded: 'gap-1 rounded-full border border-border bg-background p-1',\n },\n size: {\n sm: 'text-xs',\n md: 'text-sm',\n lg: 'text-base',\n },\n },\n defaultVariants: { variant: 'default', size: 'md' },\n});\n\nconst itemVariants = cva(\n 'inline-flex items-center justify-center gap-1.5 whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n default:\n 'rounded-sm px-3 py-1.5 text-muted-foreground hover:text-foreground data-[active=true]:bg-background data-[active=true]:text-foreground data-[active=true]:shadow-sm',\n underline:\n 'border-b-2 border-transparent px-3 py-2 text-muted-foreground hover:text-foreground data-[active=true]:border-primary data-[active=true]:text-foreground',\n rounded:\n 'rounded-full px-3 py-1.5 text-muted-foreground hover:text-foreground data-[active=true]:bg-primary data-[active=true]:text-primary-foreground',\n },\n size: {\n sm: 'h-7',\n md: 'h-9',\n lg: 'h-11 px-4',\n },\n },\n defaultVariants: { variant: 'default', size: 'md' },\n }\n);\n\nfunction isActive(item: LinkTabsItem, activeHref: string | undefined): boolean {\n if (!activeHref) return false;\n const path = activeHref.split('?')[0].split('#')[0];\n const href = item.href.split('?')[0].split('#')[0];\n return item.exact ? path === href : path === href || path.startsWith(`${href}/`);\n}\n\n/**\n * Navigation tabs for route-based sections. Unlike `Tabs` (which switches\n * client-side panels), `LinkTabs` renders real links and marks the current\n * route with `aria-current=\"page\"` - the correct pattern for URL-driven\n * sub-navigation such as settings, account, or app sections.\n */\nexport const LinkTabs = React.forwardRef<HTMLElement, LinkTabsProps>(function LinkTabs(\n {\n items,\n activeHref,\n linkComponent,\n linkHrefProp = 'href',\n variant = 'default',\n size = 'md',\n label = 'Section',\n className,\n ...props\n },\n ref\n) {\n const Link = linkComponent ?? 'a';\n\n return (\n <nav ref={ref} aria-label={label} className={cn(listVariants({ variant, size }), className)} {...props}>\n {items.map((item) => {\n const active = isActive(item, activeHref);\n const content = (\n <>\n {item.icon}\n {item.label}\n </>\n );\n\n if (item.disabled) {\n return (\n <span\n key={item.href}\n aria-disabled=\"true\"\n data-active={active ? 'true' : 'false'}\n className={cn(itemVariants({ variant, size }), 'pointer-events-none opacity-50')}\n >\n {content}\n </span>\n );\n }\n\n return (\n <Link\n key={item.href}\n {...linkDestination(item.href, linkHrefProp)}\n aria-current={active ? 'page' : undefined}\n data-active={active ? 'true' : 'false'}\n className={itemVariants({ variant, size })}\n >\n {content}\n </Link>\n );\n })}\n </nav>\n );\n});\n\nLinkTabs.displayName = 'LinkTabs';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4GU;AA1GV,YAAuB;AACvB,sCAAoB;AACpB,gBAAmB;AACnB,kBAAoD;AA+BpD,MAAM,mBAAe,qCAAI,4BAA4B;AAAA,EACnD,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,WAAW;AAAA,MACX,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,WAAW,MAAM,KAAK;AACpD,CAAC;AAED,MAAM,mBAAe;AAAA,EACnB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,WACE;AAAA,QACF,SACE;AAAA,MACJ;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB,EAAE,SAAS,WAAW,MAAM,KAAK;AAAA,EACpD;AACF;AAEA,SAAS,SAAS,MAAoB,YAAyC;AAC7E,MAAI,CAAC,WAAY,QAAO;AACxB,QAAM,OAAO,WAAW,MAAM,GAAG,EAAE,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC;AAClD,QAAM,OAAO,KAAK,KAAK,MAAM,GAAG,EAAE,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC;AACjD,SAAO,KAAK,QAAQ,SAAS,OAAO,SAAS,QAAQ,KAAK,WAAW,GAAG,IAAI,GAAG;AACjF;AAQO,MAAM,WAAW,MAAM,WAAuC,SAASA,UAC5E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,OAAO,iBAAiB;AAE9B,SACE,4CAAC,SAAI,KAAU,cAAY,OAAO,eAAW,cAAG,aAAa,EAAE,SAAS,KAAK,CAAC,GAAG,SAAS,GAAI,GAAG,OAC9F,gBAAM,IAAI,CAAC,SAAS;AACnB,UAAM,SAAS,SAAS,MAAM,UAAU;AACxC,UAAM,UACJ,4EACG;AAAA,WAAK;AAAA,MACL,KAAK;AAAA,OACR;AAGF,QAAI,KAAK,UAAU;AACjB,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,iBAAc;AAAA,UACd,eAAa,SAAS,SAAS;AAAA,UAC/B,eAAW,cAAG,aAAa,EAAE,SAAS,KAAK,CAAC,GAAG,gCAAgC;AAAA,UAE9E;AAAA;AAAA,QALI,KAAK;AAAA,MAMZ;AAAA,IAEJ;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QAEE,OAAG,6BAAgB,KAAK,MAAM,YAAY;AAAA,QAC3C,gBAAc,SAAS,SAAS;AAAA,QAChC,eAAa,SAAS,SAAS;AAAA,QAC/B,WAAW,aAAa,EAAE,SAAS,KAAK,CAAC;AAAA,QAExC;AAAA;AAAA,MANI,KAAK;AAAA,IAOZ;AAAA,EAEJ,CAAC,GACH;AAEJ,CAAC;AAED,SAAS,cAAc;","names":["LinkTabs"]}
|
|
@@ -3,6 +3,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
import { cn } from "../../utils/cn.mjs";
|
|
6
|
+
import { linkDestination } from "../../utils/link.mjs";
|
|
6
7
|
const listVariants = cva("inline-flex items-center", {
|
|
7
8
|
variants: {
|
|
8
9
|
variant: {
|
|
@@ -75,7 +76,7 @@ const LinkTabs = React.forwardRef(function LinkTabs2({
|
|
|
75
76
|
return /* @__PURE__ */ jsx(
|
|
76
77
|
Link,
|
|
77
78
|
{
|
|
78
|
-
...
|
|
79
|
+
...linkDestination(item.href, linkHrefProp),
|
|
79
80
|
"aria-current": active ? "page" : void 0,
|
|
80
81
|
"data-active": active ? "true" : "false",
|
|
81
82
|
className: itemVariants({ variant, size }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/link-tabs/LinkTabs.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\ntype LinkTabsVariant = 'default' | 'underline' | 'rounded';\ntype LinkTabsSize = 'sm' | 'md' | 'lg';\n\nexport type LinkTabsItem = {\n /** Visible tab label. */\n label: string;\n /** Destination URL. */\n href: string;\n /** Match only the exact path instead of a prefix. */\n exact?: boolean;\n /** Optional leading icon. */\n icon?: React.ReactNode;\n /** Render a disabled, non-interactive tab. */\n disabled?: boolean;\n};\n\nexport type LinkTabsProps = Omit<React.HTMLAttributes<HTMLElement>, 'children'> & {\n /** Tabs in display order. */\n items: LinkTabsItem[];\n /** Current pathname, used to mark the active tab. */\n activeHref?: string;\n /**
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/link-tabs/LinkTabs.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { linkDestination, type LinkLikeProps } from '../../utils/link';\n\ntype LinkTabsVariant = 'default' | 'underline' | 'rounded';\ntype LinkTabsSize = 'sm' | 'md' | 'lg';\n\nexport type LinkTabsItem = {\n /** Visible tab label. */\n label: string;\n /** Destination URL. */\n href: string;\n /** Match only the exact path instead of a prefix. */\n exact?: boolean;\n /** Optional leading icon. */\n icon?: React.ReactNode;\n /** Render a disabled, non-interactive tab. */\n disabled?: boolean;\n};\n\nexport type LinkTabsProps = Omit<React.HTMLAttributes<HTMLElement>, 'children'> & LinkLikeProps & {\n /** Tabs in display order. */\n items: LinkTabsItem[];\n /** Current pathname, used to mark the active tab. */\n activeHref?: string;\n /** Visual style. */\n variant?: LinkTabsVariant;\n /** Control density. */\n size?: LinkTabsSize;\n /** Accessible name for the navigation landmark. Default \"Section\". */\n label?: string;\n};\n\nconst listVariants = cva('inline-flex items-center', {\n variants: {\n variant: {\n default: 'gap-1 rounded-md bg-muted p-1',\n underline: 'gap-1 rounded-none border-b border-border bg-transparent p-0',\n rounded: 'gap-1 rounded-full border border-border bg-background p-1',\n },\n size: {\n sm: 'text-xs',\n md: 'text-sm',\n lg: 'text-base',\n },\n },\n defaultVariants: { variant: 'default', size: 'md' },\n});\n\nconst itemVariants = cva(\n 'inline-flex items-center justify-center gap-1.5 whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n default:\n 'rounded-sm px-3 py-1.5 text-muted-foreground hover:text-foreground data-[active=true]:bg-background data-[active=true]:text-foreground data-[active=true]:shadow-sm',\n underline:\n 'border-b-2 border-transparent px-3 py-2 text-muted-foreground hover:text-foreground data-[active=true]:border-primary data-[active=true]:text-foreground',\n rounded:\n 'rounded-full px-3 py-1.5 text-muted-foreground hover:text-foreground data-[active=true]:bg-primary data-[active=true]:text-primary-foreground',\n },\n size: {\n sm: 'h-7',\n md: 'h-9',\n lg: 'h-11 px-4',\n },\n },\n defaultVariants: { variant: 'default', size: 'md' },\n }\n);\n\nfunction isActive(item: LinkTabsItem, activeHref: string | undefined): boolean {\n if (!activeHref) return false;\n const path = activeHref.split('?')[0].split('#')[0];\n const href = item.href.split('?')[0].split('#')[0];\n return item.exact ? path === href : path === href || path.startsWith(`${href}/`);\n}\n\n/**\n * Navigation tabs for route-based sections. Unlike `Tabs` (which switches\n * client-side panels), `LinkTabs` renders real links and marks the current\n * route with `aria-current=\"page\"` - the correct pattern for URL-driven\n * sub-navigation such as settings, account, or app sections.\n */\nexport const LinkTabs = React.forwardRef<HTMLElement, LinkTabsProps>(function LinkTabs(\n {\n items,\n activeHref,\n linkComponent,\n linkHrefProp = 'href',\n variant = 'default',\n size = 'md',\n label = 'Section',\n className,\n ...props\n },\n ref\n) {\n const Link = linkComponent ?? 'a';\n\n return (\n <nav ref={ref} aria-label={label} className={cn(listVariants({ variant, size }), className)} {...props}>\n {items.map((item) => {\n const active = isActive(item, activeHref);\n const content = (\n <>\n {item.icon}\n {item.label}\n </>\n );\n\n if (item.disabled) {\n return (\n <span\n key={item.href}\n aria-disabled=\"true\"\n data-active={active ? 'true' : 'false'}\n className={cn(itemVariants({ variant, size }), 'pointer-events-none opacity-50')}\n >\n {content}\n </span>\n );\n }\n\n return (\n <Link\n key={item.href}\n {...linkDestination(item.href, linkHrefProp)}\n aria-current={active ? 'page' : undefined}\n data-active={active ? 'true' : 'false'}\n className={itemVariants({ variant, size })}\n >\n {content}\n </Link>\n );\n })}\n </nav>\n );\n});\n\nLinkTabs.displayName = 'LinkTabs';\n"],"mappings":";AA4GU,mBAQE,KARF;AA1GV,YAAY,WAAW;AACvB,SAAS,WAAW;AACpB,SAAS,UAAU;AACnB,SAAS,uBAA2C;AA+BpD,MAAM,eAAe,IAAI,4BAA4B;AAAA,EACnD,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,WAAW;AAAA,MACX,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,WAAW,MAAM,KAAK;AACpD,CAAC;AAED,MAAM,eAAe;AAAA,EACnB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,WACE;AAAA,QACF,SACE;AAAA,MACJ;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB,EAAE,SAAS,WAAW,MAAM,KAAK;AAAA,EACpD;AACF;AAEA,SAAS,SAAS,MAAoB,YAAyC;AAC7E,MAAI,CAAC,WAAY,QAAO;AACxB,QAAM,OAAO,WAAW,MAAM,GAAG,EAAE,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC;AAClD,QAAM,OAAO,KAAK,KAAK,MAAM,GAAG,EAAE,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC;AACjD,SAAO,KAAK,QAAQ,SAAS,OAAO,SAAS,QAAQ,KAAK,WAAW,GAAG,IAAI,GAAG;AACjF;AAQO,MAAM,WAAW,MAAM,WAAuC,SAASA,UAC5E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,OAAO,iBAAiB;AAE9B,SACE,oBAAC,SAAI,KAAU,cAAY,OAAO,WAAW,GAAG,aAAa,EAAE,SAAS,KAAK,CAAC,GAAG,SAAS,GAAI,GAAG,OAC9F,gBAAM,IAAI,CAAC,SAAS;AACnB,UAAM,SAAS,SAAS,MAAM,UAAU;AACxC,UAAM,UACJ,iCACG;AAAA,WAAK;AAAA,MACL,KAAK;AAAA,OACR;AAGF,QAAI,KAAK,UAAU;AACjB,aACE;AAAA,QAAC;AAAA;AAAA,UAEC,iBAAc;AAAA,UACd,eAAa,SAAS,SAAS;AAAA,UAC/B,WAAW,GAAG,aAAa,EAAE,SAAS,KAAK,CAAC,GAAG,gCAAgC;AAAA,UAE9E;AAAA;AAAA,QALI,KAAK;AAAA,MAMZ;AAAA,IAEJ;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QAEE,GAAG,gBAAgB,KAAK,MAAM,YAAY;AAAA,QAC3C,gBAAc,SAAS,SAAS;AAAA,QAChC,eAAa,SAAS,SAAS;AAAA,QAC/B,WAAW,aAAa,EAAE,SAAS,KAAK,CAAC;AAAA,QAExC;AAAA;AAAA,MANI,KAAK;AAAA,IAOZ;AAAA,EAEJ,CAAC,GACH;AAEJ,CAAC;AAED,SAAS,cAAc;","names":["LinkTabs"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { type LinkLikeProps } from '../../utils/link';
|
|
2
3
|
export type LogoItem = {
|
|
3
4
|
/** Accessible name announced for the logo. */
|
|
4
5
|
name: string;
|
|
@@ -7,7 +8,7 @@ export type LogoItem = {
|
|
|
7
8
|
/** Optional destination. */
|
|
8
9
|
href?: string;
|
|
9
10
|
};
|
|
10
|
-
export type LogoCloudProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
11
|
+
export type LogoCloudProps = React.HTMLAttributes<HTMLDivElement> & LinkLikeProps & {
|
|
11
12
|
/** Logos to display. */
|
|
12
13
|
items: LogoItem[];
|
|
13
14
|
/** Caption above the strip. */
|
|
@@ -20,17 +21,13 @@ export type LogoCloudProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
20
21
|
size?: 'sm' | 'md' | 'lg';
|
|
21
22
|
/** Caption and grid alignment. Default 'center'. */
|
|
22
23
|
align?: 'left' | 'center';
|
|
23
|
-
/** Custom link element for routers. */
|
|
24
|
-
linkComponent?: React.ElementType;
|
|
25
|
-
/** Prop used to pass the destination to linkComponent ('to' for react-router). */
|
|
26
|
-
linkHrefProp?: 'href' | 'to';
|
|
27
24
|
};
|
|
28
25
|
/**
|
|
29
26
|
* Trust strip for member, customer or partner logos. Logos are decorative
|
|
30
27
|
* slots; the item name supplies the accessible text. Use it inside a Section
|
|
31
28
|
* so the surface tone and spacing come from the band.
|
|
32
29
|
*/
|
|
33
|
-
export declare const LogoCloud: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
30
|
+
export declare const LogoCloud: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & LinkLikeProps & {
|
|
34
31
|
/** Logos to display. */
|
|
35
32
|
items: LogoItem[];
|
|
36
33
|
/** Caption above the strip. */
|
|
@@ -43,8 +40,4 @@ export declare const LogoCloud: React.ForwardRefExoticComponent<React.HTMLAttrib
|
|
|
43
40
|
size?: "sm" | "md" | "lg";
|
|
44
41
|
/** Caption and grid alignment. Default 'center'. */
|
|
45
42
|
align?: "left" | "center";
|
|
46
|
-
/** Custom link element for routers. */
|
|
47
|
-
linkComponent?: React.ElementType;
|
|
48
|
-
/** Prop used to pass the destination to linkComponent ('to' for react-router). */
|
|
49
|
-
linkHrefProp?: "href" | "to";
|
|
50
43
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -34,6 +34,7 @@ module.exports = __toCommonJS(LogoCloud_exports);
|
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
var React = __toESM(require("react"));
|
|
36
36
|
var import_cn = require("../../utils/cn.js");
|
|
37
|
+
var import_link = require("../../utils/link.js");
|
|
37
38
|
const columnClasses = {
|
|
38
39
|
3: "grid-cols-2 sm:grid-cols-3",
|
|
39
40
|
4: "grid-cols-2 sm:grid-cols-4",
|
|
@@ -82,7 +83,7 @@ const LogoCloud = React.forwardRef(function LogoCloud2({
|
|
|
82
83
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { className: (0, import_cn.cn)("min-w-0", align === "center" ? "justify-self-center" : "justify-self-start"), children: item.href ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
84
|
Link,
|
|
84
85
|
{
|
|
85
|
-
...
|
|
86
|
+
...(0, import_link.linkDestination)(item.href, linkHrefProp),
|
|
86
87
|
className: "rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
87
88
|
children: content
|
|
88
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/logo-cloud/LogoCloud.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type LogoItem = {\n /** Accessible name announced for the logo. */\n name: string;\n /** Logo artwork. Mark the image decorative so the name is not duplicated. */\n logo: React.ReactNode;\n /** Optional destination. */\n href?: string;\n};\n\nexport type LogoCloudProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Logos to display. */\n items: LogoItem[];\n /** Caption above the strip. */\n caption?: string;\n /** Desktop column count (3-6). Default 4. */\n columns?: 3 | 4 | 5 | 6;\n /** Desaturate logos until hover. Default true. */\n grayscale?: boolean;\n /** Logo box height. Default 'md'. */\n size?: 'sm' | 'md' | 'lg';\n /** Caption and grid alignment. Default 'center'. */\n align?: 'left' | 'center';\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/logo-cloud/LogoCloud.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { linkDestination, type LinkLikeProps } from '../../utils/link';\n\nexport type LogoItem = {\n /** Accessible name announced for the logo. */\n name: string;\n /** Logo artwork. Mark the image decorative so the name is not duplicated. */\n logo: React.ReactNode;\n /** Optional destination. */\n href?: string;\n};\n\nexport type LogoCloudProps = React.HTMLAttributes<HTMLDivElement> & LinkLikeProps & {\n /** Logos to display. */\n items: LogoItem[];\n /** Caption above the strip. */\n caption?: string;\n /** Desktop column count (3-6). Default 4. */\n columns?: 3 | 4 | 5 | 6;\n /** Desaturate logos until hover. Default true. */\n grayscale?: boolean;\n /** Logo box height. Default 'md'. */\n size?: 'sm' | 'md' | 'lg';\n /** Caption and grid alignment. Default 'center'. */\n align?: 'left' | 'center';\n};\n\nconst columnClasses: Record<NonNullable<LogoCloudProps['columns']>, string> = {\n 3: 'grid-cols-2 sm:grid-cols-3',\n 4: 'grid-cols-2 sm:grid-cols-4',\n 5: 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-5',\n 6: 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-6',\n};\n\nconst sizeClasses: Record<NonNullable<LogoCloudProps['size']>, string> = {\n sm: 'h-6',\n md: 'h-8',\n lg: 'h-12',\n};\n\n/**\n * Trust strip for member, customer or partner logos. Logos are decorative\n * slots; the item name supplies the accessible text. Use it inside a Section\n * so the surface tone and spacing come from the band.\n */\nexport const LogoCloud = React.forwardRef<HTMLDivElement, LogoCloudProps>(function LogoCloud(\n {\n items,\n caption,\n columns = 4,\n grayscale = true,\n size = 'md',\n align = 'center',\n linkComponent,\n linkHrefProp = 'href',\n className,\n ...props\n },\n ref\n) {\n const Link = linkComponent ?? 'a';\n const logoClass = cn(\n 'flex items-center transition duration-200 motion-reduce:transition-none',\n sizeClasses[size],\n grayscale && 'opacity-70 grayscale hover:opacity-100 hover:grayscale-0'\n );\n\n return (\n <div ref={ref} className={cn('w-full', className)} {...props}>\n {caption && (\n <p\n className={cn(\n 'mb-6 text-xs font-semibold uppercase tracking-widest text-muted-foreground',\n align === 'center' && 'text-center'\n )}\n >\n {caption}\n </p>\n )}\n <ul className={cn('grid items-center gap-x-8 gap-y-6', columnClasses[columns], align === 'center' && 'justify-items-center')}>\n {items.map((item) => {\n const content = (\n <>\n <span className={logoClass} aria-hidden=\"true\">\n {item.logo}\n </span>\n <span className=\"sr-only\">{item.name}</span>\n </>\n );\n\n return (\n <li key={item.name} className={cn('min-w-0', align === 'center' ? 'justify-self-center' : 'justify-self-start')}>\n {item.href ? (\n <Link\n {...linkDestination(item.href, linkHrefProp)}\n className=\"rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n >\n {content}\n </Link>\n ) : (\n content\n )}\n </li>\n );\n })}\n </ul>\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuEQ;AAvER,YAAuB;AACvB,gBAAmB;AACnB,kBAAoD;AA0BpD,MAAM,gBAAwE;AAAA,EAC5E,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,cAAmE;AAAA,EACvE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAOO,MAAM,YAAY,MAAM,WAA2C,SAASA,WACjF;AAAA,EACE;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,OAAO,iBAAiB;AAC9B,QAAM,gBAAY;AAAA,IAChB;AAAA,IACA,YAAY,IAAI;AAAA,IAChB,aAAa;AAAA,EACf;AAEA,SACE,6CAAC,SAAI,KAAU,eAAW,cAAG,UAAU,SAAS,GAAI,GAAG,OACpD;AAAA,eACC;AAAA,MAAC;AAAA;AAAA,QACC,eAAW;AAAA,UACT;AAAA,UACA,UAAU,YAAY;AAAA,QACxB;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,IAEF,4CAAC,QAAG,eAAW,cAAG,qCAAqC,cAAc,OAAO,GAAG,UAAU,YAAY,sBAAsB,GACxH,gBAAM,IAAI,CAAC,SAAS;AACnB,YAAM,UACJ,4EACE;AAAA,oDAAC,UAAK,WAAW,WAAW,eAAY,QACrC,eAAK,MACR;AAAA,QACA,4CAAC,UAAK,WAAU,WAAW,eAAK,MAAK;AAAA,SACvC;AAGF,aACE,4CAAC,QAAmB,eAAW,cAAG,WAAW,UAAU,WAAW,wBAAwB,oBAAoB,GAC3G,eAAK,OACJ;AAAA,QAAC;AAAA;AAAA,UACE,OAAG,6BAAgB,KAAK,MAAM,YAAY;AAAA,UAC3C,WAAU;AAAA,UAET;AAAA;AAAA,MACH,IAEA,WATK,KAAK,IAWd;AAAA,IAEJ,CAAC,GACH;AAAA,KACF;AAEJ,CAAC;","names":["LogoCloud"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { cn } from "../../utils/cn.mjs";
|
|
4
|
+
import { linkDestination } from "../../utils/link.mjs";
|
|
4
5
|
const columnClasses = {
|
|
5
6
|
3: "grid-cols-2 sm:grid-cols-3",
|
|
6
7
|
4: "grid-cols-2 sm:grid-cols-4",
|
|
@@ -49,7 +50,7 @@ const LogoCloud = React.forwardRef(function LogoCloud2({
|
|
|
49
50
|
return /* @__PURE__ */ jsx("li", { className: cn("min-w-0", align === "center" ? "justify-self-center" : "justify-self-start"), children: item.href ? /* @__PURE__ */ jsx(
|
|
50
51
|
Link,
|
|
51
52
|
{
|
|
52
|
-
...
|
|
53
|
+
...linkDestination(item.href, linkHrefProp),
|
|
53
54
|
className: "rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
54
55
|
children: content
|
|
55
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/logo-cloud/LogoCloud.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type LogoItem = {\n /** Accessible name announced for the logo. */\n name: string;\n /** Logo artwork. Mark the image decorative so the name is not duplicated. */\n logo: React.ReactNode;\n /** Optional destination. */\n href?: string;\n};\n\nexport type LogoCloudProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Logos to display. */\n items: LogoItem[];\n /** Caption above the strip. */\n caption?: string;\n /** Desktop column count (3-6). Default 4. */\n columns?: 3 | 4 | 5 | 6;\n /** Desaturate logos until hover. Default true. */\n grayscale?: boolean;\n /** Logo box height. Default 'md'. */\n size?: 'sm' | 'md' | 'lg';\n /** Caption and grid alignment. Default 'center'. */\n align?: 'left' | 'center';\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/logo-cloud/LogoCloud.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { linkDestination, type LinkLikeProps } from '../../utils/link';\n\nexport type LogoItem = {\n /** Accessible name announced for the logo. */\n name: string;\n /** Logo artwork. Mark the image decorative so the name is not duplicated. */\n logo: React.ReactNode;\n /** Optional destination. */\n href?: string;\n};\n\nexport type LogoCloudProps = React.HTMLAttributes<HTMLDivElement> & LinkLikeProps & {\n /** Logos to display. */\n items: LogoItem[];\n /** Caption above the strip. */\n caption?: string;\n /** Desktop column count (3-6). Default 4. */\n columns?: 3 | 4 | 5 | 6;\n /** Desaturate logos until hover. Default true. */\n grayscale?: boolean;\n /** Logo box height. Default 'md'. */\n size?: 'sm' | 'md' | 'lg';\n /** Caption and grid alignment. Default 'center'. */\n align?: 'left' | 'center';\n};\n\nconst columnClasses: Record<NonNullable<LogoCloudProps['columns']>, string> = {\n 3: 'grid-cols-2 sm:grid-cols-3',\n 4: 'grid-cols-2 sm:grid-cols-4',\n 5: 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-5',\n 6: 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-6',\n};\n\nconst sizeClasses: Record<NonNullable<LogoCloudProps['size']>, string> = {\n sm: 'h-6',\n md: 'h-8',\n lg: 'h-12',\n};\n\n/**\n * Trust strip for member, customer or partner logos. Logos are decorative\n * slots; the item name supplies the accessible text. Use it inside a Section\n * so the surface tone and spacing come from the band.\n */\nexport const LogoCloud = React.forwardRef<HTMLDivElement, LogoCloudProps>(function LogoCloud(\n {\n items,\n caption,\n columns = 4,\n grayscale = true,\n size = 'md',\n align = 'center',\n linkComponent,\n linkHrefProp = 'href',\n className,\n ...props\n },\n ref\n) {\n const Link = linkComponent ?? 'a';\n const logoClass = cn(\n 'flex items-center transition duration-200 motion-reduce:transition-none',\n sizeClasses[size],\n grayscale && 'opacity-70 grayscale hover:opacity-100 hover:grayscale-0'\n );\n\n return (\n <div ref={ref} className={cn('w-full', className)} {...props}>\n {caption && (\n <p\n className={cn(\n 'mb-6 text-xs font-semibold uppercase tracking-widest text-muted-foreground',\n align === 'center' && 'text-center'\n )}\n >\n {caption}\n </p>\n )}\n <ul className={cn('grid items-center gap-x-8 gap-y-6', columnClasses[columns], align === 'center' && 'justify-items-center')}>\n {items.map((item) => {\n const content = (\n <>\n <span className={logoClass} aria-hidden=\"true\">\n {item.logo}\n </span>\n <span className=\"sr-only\">{item.name}</span>\n </>\n );\n\n return (\n <li key={item.name} className={cn('min-w-0', align === 'center' ? 'justify-self-center' : 'justify-self-start')}>\n {item.href ? (\n <Link\n {...linkDestination(item.href, linkHrefProp)}\n className=\"rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\"\n >\n {content}\n </Link>\n ) : (\n content\n )}\n </li>\n );\n })}\n </ul>\n </div>\n );\n});\n"],"mappings":"AAuEQ,SAYI,UAZJ,KAYI,YAZJ;AAvER,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,uBAA2C;AA0BpD,MAAM,gBAAwE;AAAA,EAC5E,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,cAAmE;AAAA,EACvE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAOO,MAAM,YAAY,MAAM,WAA2C,SAASA,WACjF;AAAA,EACE;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,QAAQ;AAAA,EACR;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,OAAO,iBAAiB;AAC9B,QAAM,YAAY;AAAA,IAChB;AAAA,IACA,YAAY,IAAI;AAAA,IAChB,aAAa;AAAA,EACf;AAEA,SACE,qBAAC,SAAI,KAAU,WAAW,GAAG,UAAU,SAAS,GAAI,GAAG,OACpD;AAAA,eACC;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA,UAAU,YAAY;AAAA,QACxB;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,IAEF,oBAAC,QAAG,WAAW,GAAG,qCAAqC,cAAc,OAAO,GAAG,UAAU,YAAY,sBAAsB,GACxH,gBAAM,IAAI,CAAC,SAAS;AACnB,YAAM,UACJ,iCACE;AAAA,4BAAC,UAAK,WAAW,WAAW,eAAY,QACrC,eAAK,MACR;AAAA,QACA,oBAAC,UAAK,WAAU,WAAW,eAAK,MAAK;AAAA,SACvC;AAGF,aACE,oBAAC,QAAmB,WAAW,GAAG,WAAW,UAAU,WAAW,wBAAwB,oBAAoB,GAC3G,eAAK,OACJ;AAAA,QAAC;AAAA;AAAA,UACE,GAAG,gBAAgB,KAAK,MAAM,YAAY;AAAA,UAC3C,WAAU;AAAA,UAET;AAAA;AAAA,MACH,IAEA,WATK,KAAK,IAWd;AAAA,IAEJ,CAAC,GACH;AAAA,KACF;AAEJ,CAAC;","names":["LogoCloud"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type BadgeProps } from '../badge/Badge';
|
|
3
3
|
import { type CoverImageProps } from '../cover-image/CoverImage';
|
|
4
|
+
import { type LinkLikeProps } from '../../utils/link';
|
|
4
5
|
export type MediaCardChip = {
|
|
5
6
|
label: string;
|
|
6
7
|
/** Badge variant; quiet outline tones fit status metadata best. */
|
|
@@ -8,7 +9,7 @@ export type MediaCardChip = {
|
|
|
8
9
|
/** Leading status dot. */
|
|
9
10
|
dot?: boolean;
|
|
10
11
|
};
|
|
11
|
-
export type MediaCardProps = Omit<React.HTMLAttributes<HTMLElement>, 'title'> & {
|
|
12
|
+
export type MediaCardProps = Omit<React.HTMLAttributes<HTMLElement>, 'title'> & LinkLikeProps & {
|
|
12
13
|
/** Card title. */
|
|
13
14
|
title: string;
|
|
14
15
|
/** Supporting copy under the title. */
|
|
@@ -25,10 +26,6 @@ export type MediaCardProps = Omit<React.HTMLAttributes<HTMLElement>, 'title'> &
|
|
|
25
26
|
footer?: React.ReactNode;
|
|
26
27
|
/** 'vertical' stacks cover over content; 'row' puts a fixed-width cover beside it. */
|
|
27
28
|
layout?: 'vertical' | 'row';
|
|
28
|
-
/** Custom link element for routers (Next Link, react-router). */
|
|
29
|
-
linkComponent?: React.ElementType;
|
|
30
|
-
/** Prop used to pass the destination to linkComponent ('href' or 'to'). */
|
|
31
|
-
linkHrefProp?: 'href' | 'to';
|
|
32
29
|
};
|
|
33
30
|
/**
|
|
34
31
|
* Media card for event, article and listing grids: CoverImage on top (or
|
|
@@ -37,7 +34,7 @@ export type MediaCardProps = Omit<React.HTMLAttributes<HTMLElement>, 'title'> &
|
|
|
37
34
|
* one target, one hover state, one focus ring — so keep `footer` free of
|
|
38
35
|
* nested interactive elements.
|
|
39
36
|
*/
|
|
40
|
-
export declare const MediaCard: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
|
|
37
|
+
export declare const MediaCard: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "title"> & LinkLikeProps & {
|
|
41
38
|
/** Card title. */
|
|
42
39
|
title: string;
|
|
43
40
|
/** Supporting copy under the title. */
|
|
@@ -54,8 +51,4 @@ export declare const MediaCard: React.ForwardRefExoticComponent<Omit<React.HTMLA
|
|
|
54
51
|
footer?: React.ReactNode;
|
|
55
52
|
/** 'vertical' stacks cover over content; 'row' puts a fixed-width cover beside it. */
|
|
56
53
|
layout?: "vertical" | "row";
|
|
57
|
-
/** Custom link element for routers (Next Link, react-router). */
|
|
58
|
-
linkComponent?: React.ElementType;
|
|
59
|
-
/** Prop used to pass the destination to linkComponent ('href' or 'to'). */
|
|
60
|
-
linkHrefProp?: "href" | "to";
|
|
61
54
|
} & React.RefAttributes<HTMLElement>>;
|
|
@@ -36,6 +36,7 @@ var React = __toESM(require("react"));
|
|
|
36
36
|
var import_cn = require("../../utils/cn.js");
|
|
37
37
|
var import_Badge = require("../badge/Badge.js");
|
|
38
38
|
var import_CoverImage = require("../cover-image/CoverImage.js");
|
|
39
|
+
var import_link = require("../../utils/link.js");
|
|
39
40
|
const MediaCard = React.forwardRef(function MediaCard2({
|
|
40
41
|
title,
|
|
41
42
|
description,
|
|
@@ -51,7 +52,7 @@ const MediaCard = React.forwardRef(function MediaCard2({
|
|
|
51
52
|
...props
|
|
52
53
|
}, ref) {
|
|
53
54
|
const Link = linkComponent ?? "a";
|
|
54
|
-
const destination = href ?
|
|
55
|
+
const destination = href ? (0, import_link.linkDestination)(href, linkHrefProp) : void 0;
|
|
55
56
|
const row = layout === "row";
|
|
56
57
|
const body = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
57
58
|
cover && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/media-card/MediaCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { Badge, type BadgeProps } from '../badge/Badge';\nimport { CoverImage, type CoverImageProps } from '../cover-image/CoverImage';\n\nexport type MediaCardChip = {\n label: string;\n /** Badge variant; quiet outline tones fit status metadata best. */\n variant?: BadgeProps['variant'];\n /** Leading status dot. */\n dot?: boolean;\n};\n\nexport type MediaCardProps = Omit<React.HTMLAttributes<HTMLElement>, 'title'> & {\n /** Card title. */\n title: string;\n /** Supporting copy under the title. */\n description?: React.ReactNode;\n /** Destination URL; the whole card becomes one link when set. */\n href?: string;\n /** Cover art rendered through CoverImage (seeded gradient fallback included). */\n cover?: Omit<CoverImageProps, 'className'>;\n /** Metadata line under the description (date, location, deadline). */\n meta?: React.ReactNode;\n /** Status/category chips rendered as Badges. */\n chips?: MediaCardChip[];\n /** Bottom slot for a details affordance or secondary text. Non-interactive when the card is a link. */\n footer?: React.ReactNode;\n /** 'vertical' stacks cover over content; 'row' puts a fixed-width cover beside it. */\n layout?: 'vertical' | 'row';\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/media-card/MediaCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { Badge, type BadgeProps } from '../badge/Badge';\nimport { CoverImage, type CoverImageProps } from '../cover-image/CoverImage';\nimport { linkDestination, type LinkLikeProps } from '../../utils/link';\n\nexport type MediaCardChip = {\n label: string;\n /** Badge variant; quiet outline tones fit status metadata best. */\n variant?: BadgeProps['variant'];\n /** Leading status dot. */\n dot?: boolean;\n};\n\nexport type MediaCardProps = Omit<React.HTMLAttributes<HTMLElement>, 'title'> & LinkLikeProps & {\n /** Card title. */\n title: string;\n /** Supporting copy under the title. */\n description?: React.ReactNode;\n /** Destination URL; the whole card becomes one link when set. */\n href?: string;\n /** Cover art rendered through CoverImage (seeded gradient fallback included). */\n cover?: Omit<CoverImageProps, 'className'>;\n /** Metadata line under the description (date, location, deadline). */\n meta?: React.ReactNode;\n /** Status/category chips rendered as Badges. */\n chips?: MediaCardChip[];\n /** Bottom slot for a details affordance or secondary text. Non-interactive when the card is a link. */\n footer?: React.ReactNode;\n /** 'vertical' stacks cover over content; 'row' puts a fixed-width cover beside it. */\n layout?: 'vertical' | 'row';\n};\n\n/**\n * Media card for event, article and listing grids: CoverImage on top (or\n * beside in `layout=\"row\"`), title, description, metadata line, status chips\n * and an optional footer. With `href` the entire card is a single link —\n * one target, one hover state, one focus ring — so keep `footer` free of\n * nested interactive elements.\n */\nexport const MediaCard = React.forwardRef<HTMLElement, MediaCardProps>(function MediaCard(\n {\n title,\n description,\n href,\n cover,\n meta,\n chips,\n footer,\n layout = 'vertical',\n linkComponent,\n linkHrefProp = 'href',\n className,\n ...props\n },\n ref\n) {\n const Link = linkComponent ?? 'a';\n const destination = href ? linkDestination(href, linkHrefProp) : undefined;\n const row = layout === 'row';\n\n const body = (\n <>\n {cover && (\n <CoverImage\n {...cover}\n className={cn(\n row ? 'w-36 shrink-0 sm:w-44' : 'w-full',\n !row && 'rounded-none border-b border-border'\n )}\n />\n )}\n <div className={cn('flex min-w-0 flex-1 flex-col gap-2', row ? 'p-4' : 'p-5')}>\n {chips && chips.length > 0 && (\n <div className=\"flex flex-wrap gap-1.5\">\n {chips.map((chip) => (\n <Badge key={chip.label} variant={chip.variant ?? 'outline'} size=\"sm\" dot={chip.dot}>\n {chip.label}\n </Badge>\n ))}\n </div>\n )}\n <h3 className=\"font-semibold tracking-tight transition-colors group-hover:text-primary-ink\">{title}</h3>\n {description && (\n <div className=\"line-clamp-3 text-sm leading-relaxed text-muted-foreground\">{description}</div>\n )}\n {meta && <div className=\"text-xs text-muted-foreground\">{meta}</div>}\n {footer && <div className=\"mt-auto pt-2 text-xs text-muted-foreground\">{footer}</div>}\n </div>\n </>\n );\n\n const cardClass = cn(\n 'group flex h-full overflow-hidden rounded-xl border border-border bg-card shadow-sm transition-colors hover:border-primary/40',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n row ? 'flex-row' : 'flex-col',\n className\n );\n\n return (\n <article ref={ref as never} className=\"h-full\" {...props}>\n {href && destination ? (\n <Link {...destination} className={cardClass}>\n {body}\n </Link>\n ) : (\n <div className={cardClass}>{body}</div>\n )}\n </article>\n );\n});\n\nMediaCard.displayName = 'MediaCard';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8DI;AA9DJ,YAAuB;AACvB,gBAAmB;AACnB,mBAAuC;AACvC,wBAAiD;AACjD,kBAAoD;AAoC7C,MAAM,YAAY,MAAM,WAAwC,SAASA,WAC9E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,OAAO,iBAAiB;AAC9B,QAAM,cAAc,WAAO,6BAAgB,MAAM,YAAY,IAAI;AACjE,QAAM,MAAM,WAAW;AAEvB,QAAM,OACJ,4EACG;AAAA,aACC;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,eAAW;AAAA,UACT,MAAM,0BAA0B;AAAA,UAChC,CAAC,OAAO;AAAA,QACV;AAAA;AAAA,IACF;AAAA,IAEF,6CAAC,SAAI,eAAW,cAAG,sCAAsC,MAAM,QAAQ,KAAK,GACzE;AAAA,eAAS,MAAM,SAAS,KACvB,4CAAC,SAAI,WAAU,0BACZ,gBAAM,IAAI,CAAC,SACV,4CAAC,sBAAuB,SAAS,KAAK,WAAW,WAAW,MAAK,MAAK,KAAK,KAAK,KAC7E,eAAK,SADI,KAAK,KAEjB,CACD,GACH;AAAA,MAEF,4CAAC,QAAG,WAAU,+EAA+E,iBAAM;AAAA,MAClG,eACC,4CAAC,SAAI,WAAU,8DAA8D,uBAAY;AAAA,MAE1F,QAAQ,4CAAC,SAAI,WAAU,iCAAiC,gBAAK;AAAA,MAC7D,UAAU,4CAAC,SAAI,WAAU,8CAA8C,kBAAO;AAAA,OACjF;AAAA,KACF;AAGF,QAAM,gBAAY;AAAA,IAChB;AAAA,IACA;AAAA,IACA,MAAM,aAAa;AAAA,IACnB;AAAA,EACF;AAEA,SACE,4CAAC,aAAQ,KAAmB,WAAU,UAAU,GAAG,OAChD,kBAAQ,cACP,4CAAC,QAAM,GAAG,aAAa,WAAW,WAC/B,gBACH,IAEA,4CAAC,SAAI,WAAW,WAAY,gBAAK,GAErC;AAEJ,CAAC;AAED,UAAU,cAAc;","names":["MediaCard"]}
|
|
@@ -3,6 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import { cn } from "../../utils/cn.mjs";
|
|
4
4
|
import { Badge } from "../badge/Badge.mjs";
|
|
5
5
|
import { CoverImage } from "../cover-image/CoverImage.mjs";
|
|
6
|
+
import { linkDestination } from "../../utils/link.mjs";
|
|
6
7
|
const MediaCard = React.forwardRef(function MediaCard2({
|
|
7
8
|
title,
|
|
8
9
|
description,
|
|
@@ -18,7 +19,7 @@ const MediaCard = React.forwardRef(function MediaCard2({
|
|
|
18
19
|
...props
|
|
19
20
|
}, ref) {
|
|
20
21
|
const Link = linkComponent ?? "a";
|
|
21
|
-
const destination = href ?
|
|
22
|
+
const destination = href ? linkDestination(href, linkHrefProp) : void 0;
|
|
22
23
|
const row = layout === "row";
|
|
23
24
|
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
25
|
cover && /* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/media-card/MediaCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { Badge, type BadgeProps } from '../badge/Badge';\nimport { CoverImage, type CoverImageProps } from '../cover-image/CoverImage';\n\nexport type MediaCardChip = {\n label: string;\n /** Badge variant; quiet outline tones fit status metadata best. */\n variant?: BadgeProps['variant'];\n /** Leading status dot. */\n dot?: boolean;\n};\n\nexport type MediaCardProps = Omit<React.HTMLAttributes<HTMLElement>, 'title'> & {\n /** Card title. */\n title: string;\n /** Supporting copy under the title. */\n description?: React.ReactNode;\n /** Destination URL; the whole card becomes one link when set. */\n href?: string;\n /** Cover art rendered through CoverImage (seeded gradient fallback included). */\n cover?: Omit<CoverImageProps, 'className'>;\n /** Metadata line under the description (date, location, deadline). */\n meta?: React.ReactNode;\n /** Status/category chips rendered as Badges. */\n chips?: MediaCardChip[];\n /** Bottom slot for a details affordance or secondary text. Non-interactive when the card is a link. */\n footer?: React.ReactNode;\n /** 'vertical' stacks cover over content; 'row' puts a fixed-width cover beside it. */\n layout?: 'vertical' | 'row';\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/media-card/MediaCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { Badge, type BadgeProps } from '../badge/Badge';\nimport { CoverImage, type CoverImageProps } from '../cover-image/CoverImage';\nimport { linkDestination, type LinkLikeProps } from '../../utils/link';\n\nexport type MediaCardChip = {\n label: string;\n /** Badge variant; quiet outline tones fit status metadata best. */\n variant?: BadgeProps['variant'];\n /** Leading status dot. */\n dot?: boolean;\n};\n\nexport type MediaCardProps = Omit<React.HTMLAttributes<HTMLElement>, 'title'> & LinkLikeProps & {\n /** Card title. */\n title: string;\n /** Supporting copy under the title. */\n description?: React.ReactNode;\n /** Destination URL; the whole card becomes one link when set. */\n href?: string;\n /** Cover art rendered through CoverImage (seeded gradient fallback included). */\n cover?: Omit<CoverImageProps, 'className'>;\n /** Metadata line under the description (date, location, deadline). */\n meta?: React.ReactNode;\n /** Status/category chips rendered as Badges. */\n chips?: MediaCardChip[];\n /** Bottom slot for a details affordance or secondary text. Non-interactive when the card is a link. */\n footer?: React.ReactNode;\n /** 'vertical' stacks cover over content; 'row' puts a fixed-width cover beside it. */\n layout?: 'vertical' | 'row';\n};\n\n/**\n * Media card for event, article and listing grids: CoverImage on top (or\n * beside in `layout=\"row\"`), title, description, metadata line, status chips\n * and an optional footer. With `href` the entire card is a single link —\n * one target, one hover state, one focus ring — so keep `footer` free of\n * nested interactive elements.\n */\nexport const MediaCard = React.forwardRef<HTMLElement, MediaCardProps>(function MediaCard(\n {\n title,\n description,\n href,\n cover,\n meta,\n chips,\n footer,\n layout = 'vertical',\n linkComponent,\n linkHrefProp = 'href',\n className,\n ...props\n },\n ref\n) {\n const Link = linkComponent ?? 'a';\n const destination = href ? linkDestination(href, linkHrefProp) : undefined;\n const row = layout === 'row';\n\n const body = (\n <>\n {cover && (\n <CoverImage\n {...cover}\n className={cn(\n row ? 'w-36 shrink-0 sm:w-44' : 'w-full',\n !row && 'rounded-none border-b border-border'\n )}\n />\n )}\n <div className={cn('flex min-w-0 flex-1 flex-col gap-2', row ? 'p-4' : 'p-5')}>\n {chips && chips.length > 0 && (\n <div className=\"flex flex-wrap gap-1.5\">\n {chips.map((chip) => (\n <Badge key={chip.label} variant={chip.variant ?? 'outline'} size=\"sm\" dot={chip.dot}>\n {chip.label}\n </Badge>\n ))}\n </div>\n )}\n <h3 className=\"font-semibold tracking-tight transition-colors group-hover:text-primary-ink\">{title}</h3>\n {description && (\n <div className=\"line-clamp-3 text-sm leading-relaxed text-muted-foreground\">{description}</div>\n )}\n {meta && <div className=\"text-xs text-muted-foreground\">{meta}</div>}\n {footer && <div className=\"mt-auto pt-2 text-xs text-muted-foreground\">{footer}</div>}\n </div>\n </>\n );\n\n const cardClass = cn(\n 'group flex h-full overflow-hidden rounded-xl border border-border bg-card shadow-sm transition-colors hover:border-primary/40',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n row ? 'flex-row' : 'flex-col',\n className\n );\n\n return (\n <article ref={ref as never} className=\"h-full\" {...props}>\n {href && destination ? (\n <Link {...destination} className={cardClass}>\n {body}\n </Link>\n ) : (\n <div className={cardClass}>{body}</div>\n )}\n </article>\n );\n});\n\nMediaCard.displayName = 'MediaCard';\n"],"mappings":"AA8DI,mBAEI,KAQF,YAVF;AA9DJ,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,aAA8B;AACvC,SAAS,kBAAwC;AACjD,SAAS,uBAA2C;AAoC7C,MAAM,YAAY,MAAM,WAAwC,SAASA,WAC9E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,OAAO,iBAAiB;AAC9B,QAAM,cAAc,OAAO,gBAAgB,MAAM,YAAY,IAAI;AACjE,QAAM,MAAM,WAAW;AAEvB,QAAM,OACJ,iCACG;AAAA,aACC;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,WAAW;AAAA,UACT,MAAM,0BAA0B;AAAA,UAChC,CAAC,OAAO;AAAA,QACV;AAAA;AAAA,IACF;AAAA,IAEF,qBAAC,SAAI,WAAW,GAAG,sCAAsC,MAAM,QAAQ,KAAK,GACzE;AAAA,eAAS,MAAM,SAAS,KACvB,oBAAC,SAAI,WAAU,0BACZ,gBAAM,IAAI,CAAC,SACV,oBAAC,SAAuB,SAAS,KAAK,WAAW,WAAW,MAAK,MAAK,KAAK,KAAK,KAC7E,eAAK,SADI,KAAK,KAEjB,CACD,GACH;AAAA,MAEF,oBAAC,QAAG,WAAU,+EAA+E,iBAAM;AAAA,MAClG,eACC,oBAAC,SAAI,WAAU,8DAA8D,uBAAY;AAAA,MAE1F,QAAQ,oBAAC,SAAI,WAAU,iCAAiC,gBAAK;AAAA,MAC7D,UAAU,oBAAC,SAAI,WAAU,8CAA8C,kBAAO;AAAA,OACjF;AAAA,KACF;AAGF,QAAM,YAAY;AAAA,IAChB;AAAA,IACA;AAAA,IACA,MAAM,aAAa;AAAA,IACnB;AAAA,EACF;AAEA,SACE,oBAAC,aAAQ,KAAmB,WAAU,UAAU,GAAG,OAChD,kBAAQ,cACP,oBAAC,QAAM,GAAG,aAAa,WAAW,WAC/B,gBACH,IAEA,oBAAC,SAAI,WAAW,WAAY,gBAAK,GAErC;AAEJ,CAAC;AAED,UAAU,cAAc;","names":["MediaCard"]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { type LinkLikeProps } from '../../utils/link';
|
|
2
3
|
export type MonthScheduleLegendItem = {
|
|
3
4
|
/** Type key returned by getType. */
|
|
4
5
|
type: string;
|
|
5
6
|
/** Human-readable label shown in the legend. */
|
|
6
7
|
label: string;
|
|
7
8
|
};
|
|
8
|
-
export type MonthScheduleProps<T> = {
|
|
9
|
+
export type MonthScheduleProps<T> = LinkLikeProps & {
|
|
9
10
|
/** Events to place inside days; each is dated via getDate. */
|
|
10
11
|
events: T[];
|
|
11
12
|
/** ISO date key (YYYY-MM-DD) for an event. */
|
|
@@ -37,10 +38,6 @@ export type MonthScheduleProps<T> = {
|
|
|
37
38
|
* 'sm' swaps under 640px, 'md' under 768px.
|
|
38
39
|
*/
|
|
39
40
|
agendaBreakpoint?: 'sm' | 'md';
|
|
40
|
-
/** Custom link element for event hrefs (Next Link, react-router). */
|
|
41
|
-
linkComponent?: React.ElementType;
|
|
42
|
-
/** Prop used to pass the destination to linkComponent ('href' or 'to'). */
|
|
43
|
-
linkHrefProp?: 'href' | 'to';
|
|
44
41
|
'aria-label'?: string;
|
|
45
42
|
className?: string;
|
|
46
43
|
};
|
|
@@ -38,6 +38,7 @@ var import_cn = require("../../utils/cn.js");
|
|
|
38
38
|
var import_date = require("../../utils/date.js");
|
|
39
39
|
var import_Badge = require("../badge/Badge.js");
|
|
40
40
|
var import_button = require("../button/index.js");
|
|
41
|
+
var import_link = require("../../utils/link.js");
|
|
41
42
|
const TYPE_TONES = [
|
|
42
43
|
"outline-info",
|
|
43
44
|
"outline-success",
|
|
@@ -127,7 +128,7 @@ function MonthSchedule({
|
|
|
127
128
|
const href = getHref?.(event);
|
|
128
129
|
const chip = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Badge.Badge, { variant: tone, size: "sm", className: "max-w-full truncate", children: label });
|
|
129
130
|
if (!href) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: chip }, key);
|
|
130
|
-
const destination =
|
|
131
|
+
const destination = (0, import_link.linkDestination)(href, linkHrefProp);
|
|
131
132
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
132
133
|
Link,
|
|
133
134
|
{
|
|
@@ -227,7 +228,7 @@ function MonthSchedule({
|
|
|
227
228
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: href ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
228
229
|
Link,
|
|
229
230
|
{
|
|
230
|
-
...
|
|
231
|
+
...(0, import_link.linkDestination)(href, linkHrefProp),
|
|
231
232
|
className: "block max-w-full rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
232
233
|
children: row
|
|
233
234
|
}
|