@slipstream-ui/core 0.8.0 → 0.10.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 +203 -8
- package/dist/index.d.ts +203 -8
- package/dist/index.js +1737 -965
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1729 -961
- package/dist/index.mjs.map +1 -1
- package/dist/manifests/accordion.manifest.json +2 -2
- package/dist/manifests/alert.manifest.json +1 -1
- package/dist/manifests/announcement-bar.manifest.json +1 -1
- package/dist/manifests/app-shell.manifest.json +1 -1
- package/dist/manifests/applied-filters.manifest.json +1 -1
- package/dist/manifests/article-card.manifest.json +1 -1
- package/dist/manifests/auth-layout.manifest.json +1 -1
- package/dist/manifests/autocomplete.manifest.json +1 -1
- package/dist/manifests/avatar.manifest.json +1 -1
- package/dist/manifests/badge.manifest.json +1 -1
- package/dist/manifests/block.manifest.json +1 -1
- package/dist/manifests/bottom-nav.manifest.json +1 -1
- package/dist/manifests/breadcrumb.manifest.json +1 -1
- package/dist/manifests/button-group.manifest.json +1 -1
- package/dist/manifests/button.manifest.json +1 -1
- package/dist/manifests/calendar.manifest.json +175 -0
- package/dist/manifests/card.manifest.json +1 -1
- package/dist/manifests/checkbox.manifest.json +1 -1
- package/dist/manifests/comparison-table.manifest.json +1 -1
- package/dist/manifests/confirm-dialog.manifest.json +1 -1
- package/dist/manifests/contact-strip.manifest.json +1 -1
- package/dist/manifests/container.manifest.json +1 -1
- package/dist/manifests/cta-section.manifest.json +1 -1
- package/dist/manifests/data-table.manifest.json +8 -1
- package/dist/manifests/date-picker-popover.manifest.json +202 -0
- package/dist/manifests/date-picker.manifest.json +1 -1
- package/dist/manifests/date-range-picker.manifest.json +1 -1
- package/dist/manifests/deal-card.manifest.json +1 -1
- package/dist/manifests/dialog.manifest.json +1 -1
- package/dist/manifests/document-card.manifest.json +1 -1
- package/dist/manifests/drawer.manifest.json +1 -1
- package/dist/manifests/empty-state.manifest.json +1 -1
- package/dist/manifests/entity-card.manifest.json +1 -1
- package/dist/manifests/feature-grid.manifest.json +1 -1
- package/dist/manifests/feature-row.manifest.json +1 -1
- package/dist/manifests/fieldset.manifest.json +1 -1
- package/dist/manifests/file-upload.manifest.json +1 -1
- package/dist/manifests/filter-bar.manifest.json +1 -1
- package/dist/manifests/filter-chips.manifest.json +13 -1
- package/dist/manifests/filter-panel.manifest.json +1 -1
- package/dist/manifests/flex.manifest.json +1 -1
- package/dist/manifests/form-field.manifest.json +1 -1
- package/dist/manifests/form-layout.manifest.json +1 -1
- package/dist/manifests/form.manifest.json +1 -1
- package/dist/manifests/grid.manifest.json +1 -1
- package/dist/manifests/heading.manifest.json +1 -1
- package/dist/manifests/hero.manifest.json +1 -1
- package/dist/manifests/image.manifest.json +142 -0
- package/dist/manifests/input-group.manifest.json +1 -1
- package/dist/manifests/input.manifest.json +1 -1
- package/dist/manifests/label.manifest.json +1 -1
- package/dist/manifests/link-tabs.manifest.json +1 -1
- package/dist/manifests/link.manifest.json +1 -1
- package/dist/manifests/list.manifest.json +1 -1
- package/dist/manifests/load-more.manifest.json +1 -1
- package/dist/manifests/logo-cloud.manifest.json +1 -1
- package/dist/manifests/menu.manifest.json +1 -1
- package/dist/manifests/metric-card.manifest.json +1 -1
- package/dist/manifests/multi-select.manifest.json +1 -1
- package/dist/manifests/newsletter.manifest.json +1 -1
- package/dist/manifests/page-header.manifest.json +1 -1
- package/dist/manifests/pagination.manifest.json +1 -1
- package/dist/manifests/password-input.manifest.json +1 -1
- package/dist/manifests/popover.manifest.json +86 -4
- package/dist/manifests/process-steps.manifest.json +1 -1
- package/dist/manifests/progress.manifest.json +1 -1
- package/dist/manifests/prose.manifest.json +1 -1
- package/dist/manifests/radio.manifest.json +1 -1
- package/dist/manifests/range-slider.manifest.json +1 -1
- package/dist/manifests/search.manifest.json +1 -1
- package/dist/manifests/section-heading.manifest.json +1 -1
- package/dist/manifests/section.manifest.json +1 -1
- package/dist/manifests/segmented-control.manifest.json +1 -1
- package/dist/manifests/select-menu.manifest.json +1 -1
- package/dist/manifests/select.manifest.json +8 -1
- package/dist/manifests/separator.manifest.json +1 -1
- package/dist/manifests/site-footer.manifest.json +1 -1
- package/dist/manifests/site-header.manifest.json +13 -3
- 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 +7 -1
- package/dist/manifests/switch.manifest.json +1 -1
- package/dist/manifests/table-card.manifest.json +1 -1
- package/dist/manifests/table-of-contents.manifest.json +1 -1
- package/dist/manifests/table.manifest.json +1 -1
- package/dist/manifests/tabs.manifest.json +1 -1
- package/dist/manifests/testimonial.manifest.json +1 -1
- package/dist/manifests/text.manifest.json +1 -1
- package/dist/manifests/textarea.manifest.json +1 -1
- package/dist/manifests/theme-toggle.manifest.json +1 -1
- package/dist/manifests/time-picker.manifest.json +1 -1
- package/dist/manifests/timeline.manifest.json +1 -1
- package/dist/manifests/toast.manifest.json +1 -1
- package/dist/manifests/tombstone-card.manifest.json +1 -1
- package/dist/manifests/tooltip.manifest.json +12 -1
- package/dist/src/components/accordion/Accordion.js +26 -19
- package/dist/src/components/accordion/Accordion.js.map +1 -1
- package/dist/src/components/accordion/Accordion.mjs +26 -19
- package/dist/src/components/accordion/Accordion.mjs.map +1 -1
- package/dist/src/components/alert/Alert.js +1 -1
- package/dist/src/components/alert/Alert.js.map +1 -1
- package/dist/src/components/alert/Alert.mjs +1 -1
- package/dist/src/components/alert/Alert.mjs.map +1 -1
- package/dist/src/components/app-shell/AppShell.js +1 -1
- package/dist/src/components/app-shell/AppShell.js.map +1 -1
- package/dist/src/components/app-shell/AppShell.mjs +1 -1
- package/dist/src/components/app-shell/AppShell.mjs.map +1 -1
- package/dist/src/components/article-card/ArticleCard.js +2 -2
- package/dist/src/components/article-card/ArticleCard.js.map +1 -1
- package/dist/src/components/article-card/ArticleCard.mjs +2 -2
- package/dist/src/components/article-card/ArticleCard.mjs.map +1 -1
- package/dist/src/components/calendar/Calendar.d.ts +34 -0
- package/dist/src/components/calendar/Calendar.js +233 -0
- package/dist/src/components/calendar/Calendar.js.map +1 -0
- package/dist/src/components/calendar/Calendar.mjs +208 -0
- package/dist/src/components/calendar/Calendar.mjs.map +1 -0
- package/dist/src/components/calendar/index.d.ts +1 -0
- package/dist/src/components/calendar/index.js +23 -0
- package/dist/src/components/calendar/index.js.map +1 -0
- package/dist/src/components/calendar/index.mjs +2 -0
- package/dist/src/components/calendar/index.mjs.map +1 -0
- package/dist/src/components/checkbox/Checkbox.js +1 -1
- package/dist/src/components/checkbox/Checkbox.js.map +1 -1
- package/dist/src/components/checkbox/Checkbox.mjs +1 -1
- package/dist/src/components/checkbox/Checkbox.mjs.map +1 -1
- package/dist/src/components/comparison-table/ComparisonTable.js +1 -1
- package/dist/src/components/comparison-table/ComparisonTable.js.map +1 -1
- package/dist/src/components/comparison-table/ComparisonTable.mjs +1 -1
- package/dist/src/components/comparison-table/ComparisonTable.mjs.map +1 -1
- package/dist/src/components/cta-section/CTASection.js +1 -1
- package/dist/src/components/cta-section/CTASection.js.map +1 -1
- package/dist/src/components/cta-section/CTASection.mjs +1 -1
- package/dist/src/components/cta-section/CTASection.mjs.map +1 -1
- package/dist/src/components/data-table/DataTable.d.ts +3 -1
- package/dist/src/components/data-table/DataTable.js +2 -4
- package/dist/src/components/data-table/DataTable.js.map +1 -1
- package/dist/src/components/data-table/DataTable.mjs +2 -4
- package/dist/src/components/data-table/DataTable.mjs.map +1 -1
- package/dist/src/components/date-picker-popover/DatePickerPopover.d.ts +33 -0
- package/dist/src/components/date-picker-popover/DatePickerPopover.js +117 -0
- package/dist/src/components/date-picker-popover/DatePickerPopover.js.map +1 -0
- package/dist/src/components/date-picker-popover/DatePickerPopover.mjs +83 -0
- package/dist/src/components/date-picker-popover/DatePickerPopover.mjs.map +1 -0
- package/dist/src/components/date-picker-popover/index.d.ts +1 -0
- package/dist/src/components/date-picker-popover/index.js +23 -0
- package/dist/src/components/date-picker-popover/index.js.map +1 -0
- package/dist/src/components/date-picker-popover/index.mjs +2 -0
- package/dist/src/components/date-picker-popover/index.mjs.map +1 -0
- package/dist/src/components/drawer/Drawer.js +2 -1
- package/dist/src/components/drawer/Drawer.js.map +1 -1
- package/dist/src/components/drawer/Drawer.mjs +2 -1
- package/dist/src/components/drawer/Drawer.mjs.map +1 -1
- package/dist/src/components/filter-chips/FilterChips.d.ts +4 -0
- package/dist/src/components/filter-chips/FilterChips.js +35 -4
- package/dist/src/components/filter-chips/FilterChips.js.map +1 -1
- package/dist/src/components/filter-chips/FilterChips.mjs +35 -4
- package/dist/src/components/filter-chips/FilterChips.mjs.map +1 -1
- package/dist/src/components/image/Image.d.ts +34 -0
- package/dist/src/components/image/Image.js +75 -0
- package/dist/src/components/image/Image.js.map +1 -0
- package/dist/src/components/image/Image.mjs +41 -0
- package/dist/src/components/image/Image.mjs.map +1 -0
- package/dist/src/components/image/index.d.ts +1 -0
- package/dist/src/components/image/index.js +29 -0
- package/dist/src/components/image/index.js.map +1 -0
- package/dist/src/components/image/index.mjs +5 -0
- package/dist/src/components/image/index.mjs.map +1 -0
- package/dist/src/components/link/Link.js +4 -4
- package/dist/src/components/link/Link.js.map +1 -1
- package/dist/src/components/link/Link.mjs +4 -4
- package/dist/src/components/link/Link.mjs.map +1 -1
- package/dist/src/components/page-header/PageHeader.js +1 -1
- package/dist/src/components/page-header/PageHeader.js.map +1 -1
- package/dist/src/components/page-header/PageHeader.mjs +1 -1
- package/dist/src/components/page-header/PageHeader.mjs.map +1 -1
- package/dist/src/components/popover/Popover.d.ts +36 -3
- package/dist/src/components/popover/Popover.js +118 -22
- package/dist/src/components/popover/Popover.js.map +1 -1
- package/dist/src/components/popover/Popover.mjs +117 -22
- package/dist/src/components/popover/Popover.mjs.map +1 -1
- package/dist/src/components/radio/Radio.js +1 -1
- package/dist/src/components/radio/Radio.js.map +1 -1
- package/dist/src/components/radio/Radio.mjs +1 -1
- package/dist/src/components/radio/Radio.mjs.map +1 -1
- package/dist/src/components/range-slider/RangeSlider.js +3 -3
- package/dist/src/components/range-slider/RangeSlider.js.map +1 -1
- package/dist/src/components/range-slider/RangeSlider.mjs +3 -3
- package/dist/src/components/range-slider/RangeSlider.mjs.map +1 -1
- package/dist/src/components/section-heading/SectionHeading.js +1 -1
- package/dist/src/components/section-heading/SectionHeading.js.map +1 -1
- package/dist/src/components/section-heading/SectionHeading.mjs +1 -1
- package/dist/src/components/section-heading/SectionHeading.mjs.map +1 -1
- package/dist/src/components/select/Select.d.ts +10 -0
- package/dist/src/components/select/Select.js +2 -2
- package/dist/src/components/select/Select.js.map +1 -1
- package/dist/src/components/select/Select.mjs +2 -2
- package/dist/src/components/select/Select.mjs.map +1 -1
- package/dist/src/components/site-header/SiteHeader.d.ts +25 -3
- package/dist/src/components/site-header/SiteHeader.js +141 -6
- package/dist/src/components/site-header/SiteHeader.js.map +1 -1
- package/dist/src/components/site-header/SiteHeader.mjs +141 -6
- package/dist/src/components/site-header/SiteHeader.mjs.map +1 -1
- package/dist/src/components/stepper/Stepper.d.ts +18 -0
- package/dist/src/components/stepper/Stepper.js +2 -1
- package/dist/src/components/stepper/Stepper.js.map +1 -1
- package/dist/src/components/stepper/Stepper.mjs +2 -1
- package/dist/src/components/stepper/Stepper.mjs.map +1 -1
- package/dist/src/components/timeline/Timeline.js +17 -13
- package/dist/src/components/timeline/Timeline.js.map +1 -1
- package/dist/src/components/timeline/Timeline.mjs +17 -13
- package/dist/src/components/timeline/Timeline.mjs.map +1 -1
- package/dist/src/components/tooltip/Tooltip.d.ts +5 -0
- package/dist/src/components/tooltip/Tooltip.js +9 -2
- package/dist/src/components/tooltip/Tooltip.js.map +1 -1
- package/dist/src/components/tooltip/Tooltip.mjs +9 -2
- package/dist/src/components/tooltip/Tooltip.mjs.map +1 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/utils/date.d.ts +32 -0
- package/dist/src/utils/date.js +171 -0
- package/dist/src/utils/date.js.map +1 -0
- package/dist/src/utils/date.mjs +134 -0
- package/dist/src/utils/date.mjs.map +1 -0
- package/dist/src/utils/position.d.ts +42 -0
- package/dist/src/utils/position.js +91 -0
- package/dist/src/utils/position.js.map +1 -0
- package/dist/src/utils/position.mjs +67 -0
- package/dist/src/utils/position.mjs.map +1 -0
- package/dist/styles-full.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/accordion/Accordion.test.tsx +14 -3
- package/src/components/accordion/Accordion.tsx +34 -21
- package/src/components/alert/Alert.tsx +1 -1
- package/src/components/app-shell/AppShell.tsx +1 -1
- package/src/components/article-card/ArticleCard.tsx +2 -2
- package/src/components/calendar/Calendar.test.tsx +277 -0
- package/src/components/calendar/Calendar.tsx +273 -0
- package/src/components/calendar/index.ts +1 -0
- package/src/components/checkbox/Checkbox.tsx +1 -1
- package/src/components/comparison-table/ComparisonTable.tsx +1 -1
- package/src/components/cta-section/CTASection.tsx +1 -1
- package/src/components/data-table/DataTable.test.tsx +21 -0
- package/src/components/data-table/DataTable.tsx +4 -1
- package/src/components/date-picker-popover/DatePickerPopover.test.tsx +223 -0
- package/src/components/date-picker-popover/DatePickerPopover.tsx +117 -0
- package/src/components/date-picker-popover/index.ts +1 -0
- package/src/components/drawer/Drawer.test.tsx +12 -0
- package/src/components/drawer/Drawer.tsx +8 -1
- package/src/components/filter-chips/FilterChips.test.tsx +11 -0
- package/src/components/filter-chips/FilterChips.tsx +40 -4
- package/src/components/image/Image.test.tsx +94 -0
- package/src/components/image/Image.tsx +71 -0
- package/src/components/image/index.ts +1 -0
- package/src/components/link/Link.test.tsx +2 -1
- package/src/components/link/Link.tsx +4 -4
- package/src/components/page-header/PageHeader.tsx +1 -1
- package/src/components/popover/Popover.test.tsx +307 -3
- package/src/components/popover/Popover.tsx +228 -91
- package/src/components/radio/Radio.tsx +1 -1
- package/src/components/range-slider/RangeSlider.tsx +3 -3
- package/src/components/section-heading/SectionHeading.tsx +1 -1
- package/src/components/select/Select.test.tsx +14 -0
- package/src/components/select/Select.tsx +7 -2
- package/src/components/site-header/SiteHeader.test.tsx +103 -1
- package/src/components/site-header/SiteHeader.tsx +220 -16
- package/src/components/stepper/Stepper.test.tsx +12 -0
- package/src/components/stepper/Stepper.tsx +15 -1
- package/src/components/timeline/Timeline.test.tsx +11 -0
- package/src/components/timeline/Timeline.tsx +13 -2
- package/src/components/tooltip/Tooltip.test.tsx +15 -0
- package/src/components/tooltip/Tooltip.tsx +19 -2
- package/src/index.ts +3 -0
- package/src/manifests/accordion.manifest.json +2 -2
- package/src/manifests/alert.manifest.json +1 -1
- package/src/manifests/announcement-bar.manifest.json +1 -1
- package/src/manifests/app-shell.manifest.json +1 -1
- package/src/manifests/applied-filters.manifest.json +1 -1
- package/src/manifests/article-card.manifest.json +1 -1
- package/src/manifests/auth-layout.manifest.json +1 -1
- package/src/manifests/autocomplete.manifest.json +1 -1
- package/src/manifests/avatar.manifest.json +1 -1
- package/src/manifests/badge.manifest.json +1 -1
- package/src/manifests/block.manifest.json +1 -1
- package/src/manifests/bottom-nav.manifest.json +1 -1
- package/src/manifests/breadcrumb.manifest.json +1 -1
- package/src/manifests/button-group.manifest.json +1 -1
- package/src/manifests/button.manifest.json +1 -1
- package/src/manifests/calendar.manifest.json +175 -0
- package/src/manifests/card.manifest.json +1 -1
- package/src/manifests/checkbox.manifest.json +1 -1
- package/src/manifests/comparison-table.manifest.json +1 -1
- package/src/manifests/confirm-dialog.manifest.json +1 -1
- package/src/manifests/contact-strip.manifest.json +1 -1
- package/src/manifests/container.manifest.json +1 -1
- package/src/manifests/cta-section.manifest.json +1 -1
- package/src/manifests/data-table.manifest.json +8 -1
- package/src/manifests/date-picker-popover.manifest.json +202 -0
- package/src/manifests/date-picker.manifest.json +1 -1
- package/src/manifests/date-range-picker.manifest.json +1 -1
- package/src/manifests/deal-card.manifest.json +1 -1
- package/src/manifests/dialog.manifest.json +1 -1
- package/src/manifests/document-card.manifest.json +1 -1
- package/src/manifests/drawer.manifest.json +1 -1
- package/src/manifests/empty-state.manifest.json +1 -1
- package/src/manifests/entity-card.manifest.json +1 -1
- package/src/manifests/feature-grid.manifest.json +1 -1
- package/src/manifests/feature-row.manifest.json +1 -1
- package/src/manifests/fieldset.manifest.json +1 -1
- package/src/manifests/file-upload.manifest.json +1 -1
- package/src/manifests/filter-bar.manifest.json +1 -1
- package/src/manifests/filter-chips.manifest.json +13 -1
- package/src/manifests/filter-panel.manifest.json +1 -1
- package/src/manifests/flex.manifest.json +1 -1
- package/src/manifests/form-field.manifest.json +1 -1
- package/src/manifests/form-layout.manifest.json +1 -1
- package/src/manifests/form.manifest.json +1 -1
- package/src/manifests/grid.manifest.json +1 -1
- package/src/manifests/heading.manifest.json +1 -1
- package/src/manifests/hero.manifest.json +1 -1
- package/src/manifests/image.manifest.json +142 -0
- package/src/manifests/input-group.manifest.json +1 -1
- package/src/manifests/input.manifest.json +1 -1
- package/src/manifests/label.manifest.json +1 -1
- package/src/manifests/link-tabs.manifest.json +1 -1
- package/src/manifests/link.manifest.json +1 -1
- package/src/manifests/list.manifest.json +1 -1
- package/src/manifests/load-more.manifest.json +1 -1
- package/src/manifests/logo-cloud.manifest.json +1 -1
- package/src/manifests/menu.manifest.json +1 -1
- package/src/manifests/metric-card.manifest.json +1 -1
- package/src/manifests/multi-select.manifest.json +1 -1
- package/src/manifests/newsletter.manifest.json +1 -1
- package/src/manifests/page-header.manifest.json +1 -1
- package/src/manifests/pagination.manifest.json +1 -1
- package/src/manifests/password-input.manifest.json +1 -1
- package/src/manifests/popover.manifest.json +86 -4
- package/src/manifests/process-steps.manifest.json +1 -1
- package/src/manifests/progress.manifest.json +1 -1
- package/src/manifests/prose.manifest.json +1 -1
- package/src/manifests/radio.manifest.json +1 -1
- package/src/manifests/range-slider.manifest.json +1 -1
- package/src/manifests/search.manifest.json +1 -1
- package/src/manifests/section-heading.manifest.json +1 -1
- package/src/manifests/section.manifest.json +1 -1
- package/src/manifests/segmented-control.manifest.json +1 -1
- package/src/manifests/select-menu.manifest.json +1 -1
- package/src/manifests/select.manifest.json +8 -1
- package/src/manifests/separator.manifest.json +1 -1
- package/src/manifests/site-footer.manifest.json +1 -1
- package/src/manifests/site-header.manifest.json +13 -3
- 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 +7 -1
- package/src/manifests/switch.manifest.json +1 -1
- package/src/manifests/table-card.manifest.json +1 -1
- package/src/manifests/table-of-contents.manifest.json +1 -1
- package/src/manifests/table.manifest.json +1 -1
- package/src/manifests/tabs.manifest.json +1 -1
- package/src/manifests/testimonial.manifest.json +1 -1
- package/src/manifests/text.manifest.json +1 -1
- package/src/manifests/textarea.manifest.json +1 -1
- package/src/manifests/theme-toggle.manifest.json +1 -1
- package/src/manifests/time-picker.manifest.json +1 -1
- package/src/manifests/timeline.manifest.json +1 -1
- package/src/manifests/toast.manifest.json +1 -1
- package/src/manifests/tombstone-card.manifest.json +1 -1
- package/src/manifests/tooltip.manifest.json +12 -1
- package/src/utils/date.test.ts +190 -0
- package/src/utils/date.ts +162 -0
- package/src/utils/position.test.ts +227 -0
- package/src/utils/position.ts +129 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type ImageProps = {
|
|
3
|
+
/** Primary image URL. Hotlinked sources are expected. */
|
|
4
|
+
src: string;
|
|
5
|
+
/** Required: describes the image, not the component. */
|
|
6
|
+
alt: string;
|
|
7
|
+
/** Second chance before the fallback node (e.g. generated placeholder art). */
|
|
8
|
+
fallbackSrc?: string;
|
|
9
|
+
/** Rendered when every URL has failed (icon, initials, empty panel). */
|
|
10
|
+
fallback?: React.ReactNode;
|
|
11
|
+
/** Load eagerly and fetch at high priority for the LCP image. */
|
|
12
|
+
priority?: boolean;
|
|
13
|
+
/** Intrinsic width; always emitted so the browser reserves space. */
|
|
14
|
+
width?: number;
|
|
15
|
+
/** Intrinsic height; always emitted so the browser reserves space. */
|
|
16
|
+
height?: number;
|
|
17
|
+
/** Classes for the image; merged with imgClassName. */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Classes for the image when a consumer wants to keep them separate. */
|
|
20
|
+
imgClassName?: string;
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Resilient image: `src` -> `fallbackSrc` -> `fallback` node.
|
|
25
|
+
*
|
|
26
|
+
* Organizer images are hotlinked and occasionally 403, move, or die. Cards
|
|
27
|
+
* must never show a broken-image box or shift layout when that happens, so
|
|
28
|
+
* intrinsic dimensions are always rendered and only the priority image is
|
|
29
|
+
* eager.
|
|
30
|
+
*/
|
|
31
|
+
export declare function Image({ src, alt, fallbackSrc, fallback, priority, width, height, className, imgClassName, style, }: ImageProps): React.JSX.Element;
|
|
32
|
+
export declare namespace Image {
|
|
33
|
+
var displayName: string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var Image_exports = {};
|
|
31
|
+
__export(Image_exports, {
|
|
32
|
+
Image: () => Image
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Image_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_cn = require("../../utils/cn.js");
|
|
38
|
+
function Image({
|
|
39
|
+
src,
|
|
40
|
+
alt,
|
|
41
|
+
fallbackSrc,
|
|
42
|
+
fallback,
|
|
43
|
+
priority = false,
|
|
44
|
+
width = 1200,
|
|
45
|
+
height = 630,
|
|
46
|
+
className,
|
|
47
|
+
imgClassName,
|
|
48
|
+
style
|
|
49
|
+
}) {
|
|
50
|
+
const [stage, setStage] = React.useState(0);
|
|
51
|
+
const onError = () => setStage((current2) => current2 === 0 && fallbackSrc ? 1 : 2);
|
|
52
|
+
const current = stage === 0 ? src : stage === 1 ? fallbackSrc : null;
|
|
53
|
+
if (!current || stage === 2) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: fallback ?? null });
|
|
54
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55
|
+
"img",
|
|
56
|
+
{
|
|
57
|
+
src: current,
|
|
58
|
+
alt,
|
|
59
|
+
width,
|
|
60
|
+
height,
|
|
61
|
+
loading: priority ? "eager" : "lazy",
|
|
62
|
+
fetchPriority: priority ? "high" : "auto",
|
|
63
|
+
decoding: "async",
|
|
64
|
+
className: (0, import_cn.cn)(className, imgClassName),
|
|
65
|
+
style,
|
|
66
|
+
onError
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
Image.displayName = "Image";
|
|
71
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
+
0 && (module.exports = {
|
|
73
|
+
Image
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=Image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/image/Image.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type ImageProps = {\n /** Primary image URL. Hotlinked sources are expected. */\n src: string;\n /** Required: describes the image, not the component. */\n alt: string;\n /** Second chance before the fallback node (e.g. generated placeholder art). */\n fallbackSrc?: string;\n /** Rendered when every URL has failed (icon, initials, empty panel). */\n fallback?: React.ReactNode;\n /** Load eagerly and fetch at high priority for the LCP image. */\n priority?: boolean;\n /** Intrinsic width; always emitted so the browser reserves space. */\n width?: number;\n /** Intrinsic height; always emitted so the browser reserves space. */\n height?: number;\n /** Classes for the image; merged with imgClassName. */\n className?: string;\n /** Classes for the image when a consumer wants to keep them separate. */\n imgClassName?: string;\n style?: React.CSSProperties;\n};\n\n/**\n * Resilient image: `src` -> `fallbackSrc` -> `fallback` node.\n *\n * Organizer images are hotlinked and occasionally 403, move, or die. Cards\n * must never show a broken-image box or shift layout when that happens, so\n * intrinsic dimensions are always rendered and only the priority image is\n * eager.\n */\nexport function Image({\n src,\n alt,\n fallbackSrc,\n fallback,\n priority = false,\n width = 1200,\n height = 630,\n className,\n imgClassName,\n style,\n}: ImageProps) {\n const [stage, setStage] = React.useState<0 | 1 | 2>(0);\n\n const onError = () => setStage((current) => (current === 0 && fallbackSrc ? 1 : 2));\n const current = stage === 0 ? src : stage === 1 ? fallbackSrc : null;\n\n if (!current || stage === 2) return <>{fallback ?? null}</>;\n\n return (\n <img\n src={current}\n alt={alt}\n width={width}\n height={height}\n loading={priority ? 'eager' : 'lazy'}\n fetchPriority={priority ? 'high' : 'auto'}\n decoding=\"async\"\n className={cn(className, imgClassName)}\n style={style}\n onError={onError}\n />\n );\n}\n\nImage.displayName = 'Image';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoDsC;AAlDtC,YAAuB;AACvB,gBAAmB;AAgCZ,SAAS,MAAM;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AACF,GAAe;AACb,QAAM,CAAC,OAAO,QAAQ,IAAI,MAAM,SAAoB,CAAC;AAErD,QAAM,UAAU,MAAM,SAAS,CAACA,aAAaA,aAAY,KAAK,cAAc,IAAI,CAAE;AAClF,QAAM,UAAU,UAAU,IAAI,MAAM,UAAU,IAAI,cAAc;AAEhE,MAAI,CAAC,WAAW,UAAU,EAAG,QAAO,2EAAG,sBAAY,MAAK;AAExD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,WAAW,UAAU;AAAA,MAC9B,eAAe,WAAW,SAAS;AAAA,MACnC,UAAS;AAAA,MACT,eAAW,cAAG,WAAW,YAAY;AAAA,MACrC;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;AAEA,MAAM,cAAc;","names":["current"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.mjs";
|
|
5
|
+
function Image({
|
|
6
|
+
src,
|
|
7
|
+
alt,
|
|
8
|
+
fallbackSrc,
|
|
9
|
+
fallback,
|
|
10
|
+
priority = false,
|
|
11
|
+
width = 1200,
|
|
12
|
+
height = 630,
|
|
13
|
+
className,
|
|
14
|
+
imgClassName,
|
|
15
|
+
style
|
|
16
|
+
}) {
|
|
17
|
+
const [stage, setStage] = React.useState(0);
|
|
18
|
+
const onError = () => setStage((current2) => current2 === 0 && fallbackSrc ? 1 : 2);
|
|
19
|
+
const current = stage === 0 ? src : stage === 1 ? fallbackSrc : null;
|
|
20
|
+
if (!current || stage === 2) return /* @__PURE__ */ jsx(Fragment, { children: fallback ?? null });
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
"img",
|
|
23
|
+
{
|
|
24
|
+
src: current,
|
|
25
|
+
alt,
|
|
26
|
+
width,
|
|
27
|
+
height,
|
|
28
|
+
loading: priority ? "eager" : "lazy",
|
|
29
|
+
fetchPriority: priority ? "high" : "auto",
|
|
30
|
+
decoding: "async",
|
|
31
|
+
className: cn(className, imgClassName),
|
|
32
|
+
style,
|
|
33
|
+
onError
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
Image.displayName = "Image";
|
|
38
|
+
export {
|
|
39
|
+
Image
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=Image.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/image/Image.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type ImageProps = {\n /** Primary image URL. Hotlinked sources are expected. */\n src: string;\n /** Required: describes the image, not the component. */\n alt: string;\n /** Second chance before the fallback node (e.g. generated placeholder art). */\n fallbackSrc?: string;\n /** Rendered when every URL has failed (icon, initials, empty panel). */\n fallback?: React.ReactNode;\n /** Load eagerly and fetch at high priority for the LCP image. */\n priority?: boolean;\n /** Intrinsic width; always emitted so the browser reserves space. */\n width?: number;\n /** Intrinsic height; always emitted so the browser reserves space. */\n height?: number;\n /** Classes for the image; merged with imgClassName. */\n className?: string;\n /** Classes for the image when a consumer wants to keep them separate. */\n imgClassName?: string;\n style?: React.CSSProperties;\n};\n\n/**\n * Resilient image: `src` -> `fallbackSrc` -> `fallback` node.\n *\n * Organizer images are hotlinked and occasionally 403, move, or die. Cards\n * must never show a broken-image box or shift layout when that happens, so\n * intrinsic dimensions are always rendered and only the priority image is\n * eager.\n */\nexport function Image({\n src,\n alt,\n fallbackSrc,\n fallback,\n priority = false,\n width = 1200,\n height = 630,\n className,\n imgClassName,\n style,\n}: ImageProps) {\n const [stage, setStage] = React.useState<0 | 1 | 2>(0);\n\n const onError = () => setStage((current) => (current === 0 && fallbackSrc ? 1 : 2));\n const current = stage === 0 ? src : stage === 1 ? fallbackSrc : null;\n\n if (!current || stage === 2) return <>{fallback ?? null}</>;\n\n return (\n <img\n src={current}\n alt={alt}\n width={width}\n height={height}\n loading={priority ? 'eager' : 'lazy'}\n fetchPriority={priority ? 'high' : 'auto'}\n decoding=\"async\"\n className={cn(className, imgClassName)}\n style={style}\n onError={onError}\n />\n );\n}\n\nImage.displayName = 'Image';\n"],"mappings":";AAoDsC;AAlDtC,YAAY,WAAW;AACvB,SAAS,UAAU;AAgCZ,SAAS,MAAM;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AACF,GAAe;AACb,QAAM,CAAC,OAAO,QAAQ,IAAI,MAAM,SAAoB,CAAC;AAErD,QAAM,UAAU,MAAM,SAAS,CAACA,aAAaA,aAAY,KAAK,cAAc,IAAI,CAAE;AAClF,QAAM,UAAU,UAAU,IAAI,MAAM,UAAU,IAAI,cAAc;AAEhE,MAAI,CAAC,WAAW,UAAU,EAAG,QAAO,gCAAG,sBAAY,MAAK;AAExD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,WAAW,UAAU;AAAA,MAC9B,eAAe,WAAW,SAAS;AAAA,MACnC,UAAS;AAAA,MACT,WAAW,GAAG,WAAW,YAAY;AAAA,MACrC;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;AAEA,MAAM,cAAc;","names":["current"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Image, type ImageProps } from './Image';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var image_exports = {};
|
|
20
|
+
__export(image_exports, {
|
|
21
|
+
Image: () => import_Image.Image
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(image_exports);
|
|
24
|
+
var import_Image = require("./Image.js");
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
Image
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/image/index.ts"],"sourcesContent":["export { Image, type ImageProps } from './Image';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAuC;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/image/index.ts"],"sourcesContent":["export { Image, type ImageProps } from './Image';\n"],"mappings":"AAAA,SAAS,aAA8B;","names":[]}
|
|
@@ -40,11 +40,11 @@ var import_cn = require("../../utils/cn.js");
|
|
|
40
40
|
const linkVariants = (0, import_class_variance_authority.cva)("inline-flex items-center gap-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm", {
|
|
41
41
|
variants: {
|
|
42
42
|
variant: {
|
|
43
|
-
default: "text-primary hover:underline underline-offset-4",
|
|
43
|
+
default: "text-primary-ink hover:underline underline-offset-4",
|
|
44
44
|
muted: "text-muted-foreground hover:text-foreground",
|
|
45
|
-
underline: "underline underline-offset-4 hover:text-primary",
|
|
46
|
-
arrow: "font-medium text-primary hover:underline underline-offset-4",
|
|
47
|
-
external: "text-primary hover:underline underline-offset-4"
|
|
45
|
+
underline: "underline underline-offset-4 hover:text-primary-ink",
|
|
46
|
+
arrow: "font-medium text-primary-ink hover:underline underline-offset-4",
|
|
47
|
+
external: "text-primary-ink hover:underline underline-offset-4"
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
defaultVariants: { variant: "default" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/link/Link.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst linkVariants = cva('inline-flex items-center gap-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm', {\n variants: {\n variant: {\n default: 'text-primary hover:underline underline-offset-4',\n muted: 'text-muted-foreground hover:text-foreground',\n underline: 'underline underline-offset-4 hover:text-primary',\n arrow: 'font-medium text-primary hover:underline underline-offset-4',\n external: 'text-primary hover:underline underline-offset-4',\n },\n },\n defaultVariants: { variant: 'default' },\n});\n\nexport type LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> &\n VariantProps<typeof linkVariants> & {\n /** Render the child element (router Link) with link styling. */\n asChild?: boolean;\n /**\n * Force external handling (target=_blank + rel). Absolute http(s) hrefs\n * are detected automatically; mailto:/tel: links never open a new tab.\n */\n external?: boolean;\n };\n\nconst ABSOLUTE = /^https?:\\/\\//i;\n\n/**\n * Inline link primitive with the project's link variants. Keeps a real\n * `<a href>` (SEO, modified clicks, middle-click) and adds safe external\n * handling: absolute URLs get target=\"_blank\" + rel=\"noopener noreferrer\"\n * and a screen-reader note, unless `external={false}`.\n *\n * For client-side routing, wrap your router's link: `<Link asChild><RouterLink …/></Link>`.\n */\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n { className, variant, asChild = false, external, target, rel, children, ...props },\n ref\n) {\n const isAbsolute = typeof props.href === 'string' && ABSOLUTE.test(props.href);\n const isExternal = external ?? isAbsolute;\n const Comp = asChild ? Slot : 'a';\n\n if (asChild) {\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n {isExternal && variant !== 'muted' && (\n <>\n <span aria-hidden=\"true\" className=\"text-[0.75em]\">\n ↗\n </span>\n <span className=\"sr-only\">(opens in a new tab)</span>\n </>\n )}\n </Comp>\n );\n});\n\nexport type LinkVariant = NonNullable<VariantProps<typeof linkVariants>['variant']>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDM;AAjDN,YAAuB;AACvB,wBAAqB;AACrB,sCAAuC;AACvC,gBAAmB;AAEnB,MAAM,mBAAe,qCAAI,wMAAwM;AAAA,EAC/N,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,MACP,WAAW;AAAA,MACX,OAAO;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,UAAU;AACxC,CAAC;AAaD,MAAM,WAAW;AAUV,MAAM,OAAO,MAAM,WAAyC,SAASA,MAC1E,EAAE,WAAW,SAAS,UAAU,OAAO,UAAU,QAAQ,KAAK,UAAU,GAAG,MAAM,GACjF,KACA;AACA,QAAM,aAAa,OAAO,MAAM,SAAS,YAAY,SAAS,KAAK,MAAM,IAAI;AAC7E,QAAM,aAAa,YAAY;AAC/B,QAAM,OAAO,UAAU,yBAAO;AAE9B,MAAI,SAAS;AACX,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,cAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,QAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,QAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,QAChD,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAW,cAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,MAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,MAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,MAChD,GAAG;AAAA,MAEH;AAAA;AAAA,QACA,cAAc,YAAY,WACzB,4EACE;AAAA,sDAAC,UAAK,eAAY,QAAO,WAAU,iBAAgB,oBAEnD;AAAA,UACA,4CAAC,UAAK,WAAU,WAAU,kCAAoB;AAAA,WAChD;AAAA;AAAA;AAAA,EAEJ;AAEJ,CAAC;","names":["Link"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/link/Link.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst linkVariants = cva('inline-flex items-center gap-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm', {\n variants: {\n variant: {\n default: 'text-primary-ink hover:underline underline-offset-4',\n muted: 'text-muted-foreground hover:text-foreground',\n underline: 'underline underline-offset-4 hover:text-primary-ink',\n arrow: 'font-medium text-primary-ink hover:underline underline-offset-4',\n external: 'text-primary-ink hover:underline underline-offset-4',\n },\n },\n defaultVariants: { variant: 'default' },\n});\n\nexport type LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> &\n VariantProps<typeof linkVariants> & {\n /** Render the child element (router Link) with link styling. */\n asChild?: boolean;\n /**\n * Force external handling (target=_blank + rel). Absolute http(s) hrefs\n * are detected automatically; mailto:/tel: links never open a new tab.\n */\n external?: boolean;\n };\n\nconst ABSOLUTE = /^https?:\\/\\//i;\n\n/**\n * Inline link primitive with the project's link variants. Keeps a real\n * `<a href>` (SEO, modified clicks, middle-click) and adds safe external\n * handling: absolute URLs get target=\"_blank\" + rel=\"noopener noreferrer\"\n * and a screen-reader note, unless `external={false}`.\n *\n * For client-side routing, wrap your router's link: `<Link asChild><RouterLink …/></Link>`.\n */\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n { className, variant, asChild = false, external, target, rel, children, ...props },\n ref\n) {\n const isAbsolute = typeof props.href === 'string' && ABSOLUTE.test(props.href);\n const isExternal = external ?? isAbsolute;\n const Comp = asChild ? Slot : 'a';\n\n if (asChild) {\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n {isExternal && variant !== 'muted' && (\n <>\n <span aria-hidden=\"true\" className=\"text-[0.75em]\">\n ↗\n </span>\n <span className=\"sr-only\">(opens in a new tab)</span>\n </>\n )}\n </Comp>\n );\n});\n\nexport type LinkVariant = NonNullable<VariantProps<typeof linkVariants>['variant']>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDM;AAjDN,YAAuB;AACvB,wBAAqB;AACrB,sCAAuC;AACvC,gBAAmB;AAEnB,MAAM,mBAAe,qCAAI,wMAAwM;AAAA,EAC/N,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,MACP,WAAW;AAAA,MACX,OAAO;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,UAAU;AACxC,CAAC;AAaD,MAAM,WAAW;AAUV,MAAM,OAAO,MAAM,WAAyC,SAASA,MAC1E,EAAE,WAAW,SAAS,UAAU,OAAO,UAAU,QAAQ,KAAK,UAAU,GAAG,MAAM,GACjF,KACA;AACA,QAAM,aAAa,OAAO,MAAM,SAAS,YAAY,SAAS,KAAK,MAAM,IAAI;AAC7E,QAAM,aAAa,YAAY;AAC/B,QAAM,OAAO,UAAU,yBAAO;AAE9B,MAAI,SAAS;AACX,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,cAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,QAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,QAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,QAChD,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAW,cAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,MAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,MAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,MAChD,GAAG;AAAA,MAEH;AAAA;AAAA,QACA,cAAc,YAAY,WACzB,4EACE;AAAA,sDAAC,UAAK,eAAY,QAAO,WAAU,iBAAgB,oBAEnD;AAAA,UACA,4CAAC,UAAK,WAAU,WAAU,kCAAoB;AAAA,WAChD;AAAA;AAAA;AAAA,EAEJ;AAEJ,CAAC;","names":["Link"]}
|
|
@@ -7,11 +7,11 @@ import { cn } from "../../utils/cn.mjs";
|
|
|
7
7
|
const linkVariants = cva("inline-flex items-center gap-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm", {
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
|
-
default: "text-primary hover:underline underline-offset-4",
|
|
10
|
+
default: "text-primary-ink hover:underline underline-offset-4",
|
|
11
11
|
muted: "text-muted-foreground hover:text-foreground",
|
|
12
|
-
underline: "underline underline-offset-4 hover:text-primary",
|
|
13
|
-
arrow: "font-medium text-primary hover:underline underline-offset-4",
|
|
14
|
-
external: "text-primary hover:underline underline-offset-4"
|
|
12
|
+
underline: "underline underline-offset-4 hover:text-primary-ink",
|
|
13
|
+
arrow: "font-medium text-primary-ink hover:underline underline-offset-4",
|
|
14
|
+
external: "text-primary-ink hover:underline underline-offset-4"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
defaultVariants: { variant: "default" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/link/Link.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst linkVariants = cva('inline-flex items-center gap-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm', {\n variants: {\n variant: {\n default: 'text-primary hover:underline underline-offset-4',\n muted: 'text-muted-foreground hover:text-foreground',\n underline: 'underline underline-offset-4 hover:text-primary',\n arrow: 'font-medium text-primary hover:underline underline-offset-4',\n external: 'text-primary hover:underline underline-offset-4',\n },\n },\n defaultVariants: { variant: 'default' },\n});\n\nexport type LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> &\n VariantProps<typeof linkVariants> & {\n /** Render the child element (router Link) with link styling. */\n asChild?: boolean;\n /**\n * Force external handling (target=_blank + rel). Absolute http(s) hrefs\n * are detected automatically; mailto:/tel: links never open a new tab.\n */\n external?: boolean;\n };\n\nconst ABSOLUTE = /^https?:\\/\\//i;\n\n/**\n * Inline link primitive with the project's link variants. Keeps a real\n * `<a href>` (SEO, modified clicks, middle-click) and adds safe external\n * handling: absolute URLs get target=\"_blank\" + rel=\"noopener noreferrer\"\n * and a screen-reader note, unless `external={false}`.\n *\n * For client-side routing, wrap your router's link: `<Link asChild><RouterLink …/></Link>`.\n */\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n { className, variant, asChild = false, external, target, rel, children, ...props },\n ref\n) {\n const isAbsolute = typeof props.href === 'string' && ABSOLUTE.test(props.href);\n const isExternal = external ?? isAbsolute;\n const Comp = asChild ? Slot : 'a';\n\n if (asChild) {\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n {isExternal && variant !== 'muted' && (\n <>\n <span aria-hidden=\"true\" className=\"text-[0.75em]\">\n ↗\n </span>\n <span className=\"sr-only\">(opens in a new tab)</span>\n </>\n )}\n </Comp>\n );\n});\n\nexport type LinkVariant = NonNullable<VariantProps<typeof linkVariants>['variant']>;\n"],"mappings":";AAmDM,SAsBE,UAtBF,KAsBE,YAtBF;AAjDN,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;AACvC,SAAS,UAAU;AAEnB,MAAM,eAAe,IAAI,wMAAwM;AAAA,EAC/N,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,MACP,WAAW;AAAA,MACX,OAAO;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,UAAU;AACxC,CAAC;AAaD,MAAM,WAAW;AAUV,MAAM,OAAO,MAAM,WAAyC,SAASA,MAC1E,EAAE,WAAW,SAAS,UAAU,OAAO,UAAU,QAAQ,KAAK,UAAU,GAAG,MAAM,GACjF,KACA;AACA,QAAM,aAAa,OAAO,MAAM,SAAS,YAAY,SAAS,KAAK,MAAM,IAAI;AAC7E,QAAM,aAAa,YAAY;AAC/B,QAAM,OAAO,UAAU,OAAO;AAE9B,MAAI,SAAS;AACX,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,QAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,QAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,QAChD,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,MAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,MAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,MAChD,GAAG;AAAA,MAEH;AAAA;AAAA,QACA,cAAc,YAAY,WACzB,iCACE;AAAA,8BAAC,UAAK,eAAY,QAAO,WAAU,iBAAgB,oBAEnD;AAAA,UACA,oBAAC,UAAK,WAAU,WAAU,kCAAoB;AAAA,WAChD;AAAA;AAAA;AAAA,EAEJ;AAEJ,CAAC;","names":["Link"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/link/Link.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst linkVariants = cva('inline-flex items-center gap-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm', {\n variants: {\n variant: {\n default: 'text-primary-ink hover:underline underline-offset-4',\n muted: 'text-muted-foreground hover:text-foreground',\n underline: 'underline underline-offset-4 hover:text-primary-ink',\n arrow: 'font-medium text-primary-ink hover:underline underline-offset-4',\n external: 'text-primary-ink hover:underline underline-offset-4',\n },\n },\n defaultVariants: { variant: 'default' },\n});\n\nexport type LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> &\n VariantProps<typeof linkVariants> & {\n /** Render the child element (router Link) with link styling. */\n asChild?: boolean;\n /**\n * Force external handling (target=_blank + rel). Absolute http(s) hrefs\n * are detected automatically; mailto:/tel: links never open a new tab.\n */\n external?: boolean;\n };\n\nconst ABSOLUTE = /^https?:\\/\\//i;\n\n/**\n * Inline link primitive with the project's link variants. Keeps a real\n * `<a href>` (SEO, modified clicks, middle-click) and adds safe external\n * handling: absolute URLs get target=\"_blank\" + rel=\"noopener noreferrer\"\n * and a screen-reader note, unless `external={false}`.\n *\n * For client-side routing, wrap your router's link: `<Link asChild><RouterLink …/></Link>`.\n */\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n { className, variant, asChild = false, external, target, rel, children, ...props },\n ref\n) {\n const isAbsolute = typeof props.href === 'string' && ABSOLUTE.test(props.href);\n const isExternal = external ?? isAbsolute;\n const Comp = asChild ? Slot : 'a';\n\n if (asChild) {\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n {isExternal && variant !== 'muted' && (\n <>\n <span aria-hidden=\"true\" className=\"text-[0.75em]\">\n ↗\n </span>\n <span className=\"sr-only\">(opens in a new tab)</span>\n </>\n )}\n </Comp>\n );\n});\n\nexport type LinkVariant = NonNullable<VariantProps<typeof linkVariants>['variant']>;\n"],"mappings":";AAmDM,SAsBE,UAtBF,KAsBE,YAtBF;AAjDN,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;AACvC,SAAS,UAAU;AAEnB,MAAM,eAAe,IAAI,wMAAwM;AAAA,EAC/N,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,MACP,WAAW;AAAA,MACX,OAAO;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,UAAU;AACxC,CAAC;AAaD,MAAM,WAAW;AAUV,MAAM,OAAO,MAAM,WAAyC,SAASA,MAC1E,EAAE,WAAW,SAAS,UAAU,OAAO,UAAU,QAAQ,KAAK,UAAU,GAAG,MAAM,GACjF,KACA;AACA,QAAM,aAAa,OAAO,MAAM,SAAS,YAAY,SAAS,KAAK,MAAM,IAAI;AAC7E,QAAM,aAAa,YAAY;AAC/B,QAAM,OAAO,UAAU,OAAO;AAE9B,MAAI,SAAS;AACX,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,QAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,QAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,QAChD,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,MAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,MAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,MAChD,GAAG;AAAA,MAEH;AAAA;AAAA,QACA,cAAc,YAAY,WACzB,iCACE;AAAA,8BAAC,UAAK,eAAY,QAAO,WAAU,iBAAgB,oBAEnD;AAAA,UACA,oBAAC,UAAK,WAAU,WAAU,kCAAoB;AAAA,WAChD;AAAA;AAAA;AAAA,EAEJ;AAEJ,CAAC;","names":["Link"]}
|
|
@@ -44,7 +44,7 @@ const PageHeader = React.forwardRef(function PageHeader2({ title, description, s
|
|
|
44
44
|
const supporting = description ?? subtitle;
|
|
45
45
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref, className: (0, import_cn.cn)("flex flex-col gap-2", align === "center" && "items-center text-center", className), ...props, children: [
|
|
46
46
|
breadcrumbs && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm text-muted-foreground", children: breadcrumbs }),
|
|
47
|
-
eyebrow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_cn.cn)("text-xs font-medium uppercase tracking-wide text-primary", eyebrowClassName), children: eyebrow }),
|
|
47
|
+
eyebrow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_cn.cn)("text-xs font-medium uppercase tracking-wide text-primary-ink", eyebrowClassName), children: eyebrow }),
|
|
48
48
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_cn.cn)("flex w-full flex-wrap items-start justify-between gap-3", align === "center" && "justify-center"), children: [
|
|
49
49
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_cn.cn)("min-w-0", align === "center" && "flex flex-col items-center"), children: [
|
|
50
50
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: (0, import_cn.cn)("font-semibold tracking-tight", sizeClasses[size], titleClassName), children: title }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/page-header/PageHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type PageHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n title: string;\n description?: string;\n /** Alias for `description` (migration-friendly). */\n subtitle?: string;\n /** Breadcrumbs/eyebrow above the title. */\n breadcrumbs?: React.ReactNode;\n /** Right-aligned actions (buttons, menus). */\n actions?: React.ReactNode;\n /** Small slot under the title row (tabs, filters). */\n children?: React.ReactNode;\n /** Eyebrow/kicker above the title (category, date, overline). */\n eyebrow?: React.ReactNode;\n /** Heading scale - 'hero' is for marketing landing pages. */\n size?: 'sm' | 'md' | 'lg' | 'hero';\n /** Text alignment; hero marketing pages often center. */\n align?: 'left' | 'center';\n /** Extra classes for the h1, for host display typography. */\n titleClassName?: string;\n /** Extra classes for the description. */\n descriptionClassName?: string;\n /** Extra classes for the eyebrow. */\n eyebrowClassName?: string;\n};\n\nconst sizeClasses: Record<NonNullable<PageHeaderProps['size']>, string> = {\n sm: 'text-xl',\n md: 'text-2xl',\n lg: 'text-3xl',\n hero: 'text-4xl sm:text-5xl lg:text-[3.4rem] lg:leading-[1.1]',\n};\n\n/**\n * Standard page heading block: optional breadcrumbs, title, description and\n * a right-aligned action cluster. Pages stop inventing their own spacing\n * and heading hierarchy.\n */\nexport const PageHeader = React.forwardRef<HTMLDivElement, PageHeaderProps>(function PageHeader(\n { title, description, subtitle, breadcrumbs, actions, eyebrow, size = 'md', align = 'left', titleClassName, descriptionClassName, eyebrowClassName, className, children, ...props },\n ref\n) {\n const supporting = description ?? subtitle;\n return (\n <div ref={ref} className={cn('flex flex-col gap-2', align === 'center' && 'items-center text-center', className)} {...props}>\n {breadcrumbs && <div className=\"text-sm text-muted-foreground\">{breadcrumbs}</div>}\n {eyebrow && (\n <div className={cn('text-xs font-medium uppercase tracking-wide text-primary', eyebrowClassName)}>{eyebrow}</div>\n )}\n <div className={cn('flex w-full flex-wrap items-start justify-between gap-3', align === 'center' && 'justify-center')}>\n <div className={cn('min-w-0', align === 'center' && 'flex flex-col items-center')}>\n <h1 className={cn('font-semibold tracking-tight', sizeClasses[size], titleClassName)}>{title}</h1>\n {supporting && <p className={cn('mt-2 max-w-2xl text-base text-muted-foreground', descriptionClassName)}>{supporting}</p>}\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n </div>\n {children && <div className=\"mt-2\">{children}</div>}\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CsB;AA/CtB,YAAuB;AACvB,gBAAmB;AA2BnB,MAAM,cAAoE;AAAA,EACxE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAOO,MAAM,aAAa,MAAM,WAA4C,SAASA,YACnF,EAAE,OAAO,aAAa,UAAU,aAAa,SAAS,SAAS,OAAO,MAAM,QAAQ,QAAQ,gBAAgB,sBAAsB,kBAAkB,WAAW,UAAU,GAAG,MAAM,GAClL,KACA;AACA,QAAM,aAAa,eAAe;AAClC,SACE,6CAAC,SAAI,KAAU,eAAW,cAAG,uBAAuB,UAAU,YAAY,4BAA4B,SAAS,GAAI,GAAG,OACnH;AAAA,mBAAe,4CAAC,SAAI,WAAU,iCAAiC,uBAAY;AAAA,IAC3E,WACC,4CAAC,SAAI,eAAW,cAAG,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/page-header/PageHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type PageHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n title: string;\n description?: string;\n /** Alias for `description` (migration-friendly). */\n subtitle?: string;\n /** Breadcrumbs/eyebrow above the title. */\n breadcrumbs?: React.ReactNode;\n /** Right-aligned actions (buttons, menus). */\n actions?: React.ReactNode;\n /** Small slot under the title row (tabs, filters). */\n children?: React.ReactNode;\n /** Eyebrow/kicker above the title (category, date, overline). */\n eyebrow?: React.ReactNode;\n /** Heading scale - 'hero' is for marketing landing pages. */\n size?: 'sm' | 'md' | 'lg' | 'hero';\n /** Text alignment; hero marketing pages often center. */\n align?: 'left' | 'center';\n /** Extra classes for the h1, for host display typography. */\n titleClassName?: string;\n /** Extra classes for the description. */\n descriptionClassName?: string;\n /** Extra classes for the eyebrow. */\n eyebrowClassName?: string;\n};\n\nconst sizeClasses: Record<NonNullable<PageHeaderProps['size']>, string> = {\n sm: 'text-xl',\n md: 'text-2xl',\n lg: 'text-3xl',\n hero: 'text-4xl sm:text-5xl lg:text-[3.4rem] lg:leading-[1.1]',\n};\n\n/**\n * Standard page heading block: optional breadcrumbs, title, description and\n * a right-aligned action cluster. Pages stop inventing their own spacing\n * and heading hierarchy.\n */\nexport const PageHeader = React.forwardRef<HTMLDivElement, PageHeaderProps>(function PageHeader(\n { title, description, subtitle, breadcrumbs, actions, eyebrow, size = 'md', align = 'left', titleClassName, descriptionClassName, eyebrowClassName, className, children, ...props },\n ref\n) {\n const supporting = description ?? subtitle;\n return (\n <div ref={ref} className={cn('flex flex-col gap-2', align === 'center' && 'items-center text-center', className)} {...props}>\n {breadcrumbs && <div className=\"text-sm text-muted-foreground\">{breadcrumbs}</div>}\n {eyebrow && (\n <div className={cn('text-xs font-medium uppercase tracking-wide text-primary-ink', eyebrowClassName)}>{eyebrow}</div>\n )}\n <div className={cn('flex w-full flex-wrap items-start justify-between gap-3', align === 'center' && 'justify-center')}>\n <div className={cn('min-w-0', align === 'center' && 'flex flex-col items-center')}>\n <h1 className={cn('font-semibold tracking-tight', sizeClasses[size], titleClassName)}>{title}</h1>\n {supporting && <p className={cn('mt-2 max-w-2xl text-base text-muted-foreground', descriptionClassName)}>{supporting}</p>}\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n </div>\n {children && <div className=\"mt-2\">{children}</div>}\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CsB;AA/CtB,YAAuB;AACvB,gBAAmB;AA2BnB,MAAM,cAAoE;AAAA,EACxE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAOO,MAAM,aAAa,MAAM,WAA4C,SAASA,YACnF,EAAE,OAAO,aAAa,UAAU,aAAa,SAAS,SAAS,OAAO,MAAM,QAAQ,QAAQ,gBAAgB,sBAAsB,kBAAkB,WAAW,UAAU,GAAG,MAAM,GAClL,KACA;AACA,QAAM,aAAa,eAAe;AAClC,SACE,6CAAC,SAAI,KAAU,eAAW,cAAG,uBAAuB,UAAU,YAAY,4BAA4B,SAAS,GAAI,GAAG,OACnH;AAAA,mBAAe,4CAAC,SAAI,WAAU,iCAAiC,uBAAY;AAAA,IAC3E,WACC,4CAAC,SAAI,eAAW,cAAG,gEAAgE,gBAAgB,GAAI,mBAAQ;AAAA,IAEjH,6CAAC,SAAI,eAAW,cAAG,2DAA2D,UAAU,YAAY,gBAAgB,GAClH;AAAA,mDAAC,SAAI,eAAW,cAAG,WAAW,UAAU,YAAY,4BAA4B,GAC9E;AAAA,oDAAC,QAAG,eAAW,cAAG,gCAAgC,YAAY,IAAI,GAAG,cAAc,GAAI,iBAAM;AAAA,QAC5F,cAAc,4CAAC,OAAE,eAAW,cAAG,kDAAkD,oBAAoB,GAAI,sBAAW;AAAA,SACvH;AAAA,MACC,WAAW,4CAAC,SAAI,WAAU,oCAAoC,mBAAQ;AAAA,OACzE;AAAA,IACC,YAAY,4CAAC,SAAI,WAAU,QAAQ,UAAS;AAAA,KAC/C;AAEJ,CAAC;","names":["PageHeader"]}
|
|
@@ -11,7 +11,7 @@ const PageHeader = React.forwardRef(function PageHeader2({ title, description, s
|
|
|
11
11
|
const supporting = description ?? subtitle;
|
|
12
12
|
return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-2", align === "center" && "items-center text-center", className), ...props, children: [
|
|
13
13
|
breadcrumbs && /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: breadcrumbs }),
|
|
14
|
-
eyebrow && /* @__PURE__ */ jsx("div", { className: cn("text-xs font-medium uppercase tracking-wide text-primary", eyebrowClassName), children: eyebrow }),
|
|
14
|
+
eyebrow && /* @__PURE__ */ jsx("div", { className: cn("text-xs font-medium uppercase tracking-wide text-primary-ink", eyebrowClassName), children: eyebrow }),
|
|
15
15
|
/* @__PURE__ */ jsxs("div", { className: cn("flex w-full flex-wrap items-start justify-between gap-3", align === "center" && "justify-center"), children: [
|
|
16
16
|
/* @__PURE__ */ jsxs("div", { className: cn("min-w-0", align === "center" && "flex flex-col items-center"), children: [
|
|
17
17
|
/* @__PURE__ */ jsx("h1", { className: cn("font-semibold tracking-tight", sizeClasses[size], titleClassName), children: title }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/page-header/PageHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type PageHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n title: string;\n description?: string;\n /** Alias for `description` (migration-friendly). */\n subtitle?: string;\n /** Breadcrumbs/eyebrow above the title. */\n breadcrumbs?: React.ReactNode;\n /** Right-aligned actions (buttons, menus). */\n actions?: React.ReactNode;\n /** Small slot under the title row (tabs, filters). */\n children?: React.ReactNode;\n /** Eyebrow/kicker above the title (category, date, overline). */\n eyebrow?: React.ReactNode;\n /** Heading scale - 'hero' is for marketing landing pages. */\n size?: 'sm' | 'md' | 'lg' | 'hero';\n /** Text alignment; hero marketing pages often center. */\n align?: 'left' | 'center';\n /** Extra classes for the h1, for host display typography. */\n titleClassName?: string;\n /** Extra classes for the description. */\n descriptionClassName?: string;\n /** Extra classes for the eyebrow. */\n eyebrowClassName?: string;\n};\n\nconst sizeClasses: Record<NonNullable<PageHeaderProps['size']>, string> = {\n sm: 'text-xl',\n md: 'text-2xl',\n lg: 'text-3xl',\n hero: 'text-4xl sm:text-5xl lg:text-[3.4rem] lg:leading-[1.1]',\n};\n\n/**\n * Standard page heading block: optional breadcrumbs, title, description and\n * a right-aligned action cluster. Pages stop inventing their own spacing\n * and heading hierarchy.\n */\nexport const PageHeader = React.forwardRef<HTMLDivElement, PageHeaderProps>(function PageHeader(\n { title, description, subtitle, breadcrumbs, actions, eyebrow, size = 'md', align = 'left', titleClassName, descriptionClassName, eyebrowClassName, className, children, ...props },\n ref\n) {\n const supporting = description ?? subtitle;\n return (\n <div ref={ref} className={cn('flex flex-col gap-2', align === 'center' && 'items-center text-center', className)} {...props}>\n {breadcrumbs && <div className=\"text-sm text-muted-foreground\">{breadcrumbs}</div>}\n {eyebrow && (\n <div className={cn('text-xs font-medium uppercase tracking-wide text-primary', eyebrowClassName)}>{eyebrow}</div>\n )}\n <div className={cn('flex w-full flex-wrap items-start justify-between gap-3', align === 'center' && 'justify-center')}>\n <div className={cn('min-w-0', align === 'center' && 'flex flex-col items-center')}>\n <h1 className={cn('font-semibold tracking-tight', sizeClasses[size], titleClassName)}>{title}</h1>\n {supporting && <p className={cn('mt-2 max-w-2xl text-base text-muted-foreground', descriptionClassName)}>{supporting}</p>}\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n </div>\n {children && <div className=\"mt-2\">{children}</div>}\n </div>\n );\n});\n"],"mappings":"AA+CsB,cAKd,YALc;AA/CtB,YAAY,WAAW;AACvB,SAAS,UAAU;AA2BnB,MAAM,cAAoE;AAAA,EACxE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAOO,MAAM,aAAa,MAAM,WAA4C,SAASA,YACnF,EAAE,OAAO,aAAa,UAAU,aAAa,SAAS,SAAS,OAAO,MAAM,QAAQ,QAAQ,gBAAgB,sBAAsB,kBAAkB,WAAW,UAAU,GAAG,MAAM,GAClL,KACA;AACA,QAAM,aAAa,eAAe;AAClC,SACE,qBAAC,SAAI,KAAU,WAAW,GAAG,uBAAuB,UAAU,YAAY,4BAA4B,SAAS,GAAI,GAAG,OACnH;AAAA,mBAAe,oBAAC,SAAI,WAAU,iCAAiC,uBAAY;AAAA,IAC3E,WACC,oBAAC,SAAI,WAAW,GAAG,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/page-header/PageHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type PageHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n title: string;\n description?: string;\n /** Alias for `description` (migration-friendly). */\n subtitle?: string;\n /** Breadcrumbs/eyebrow above the title. */\n breadcrumbs?: React.ReactNode;\n /** Right-aligned actions (buttons, menus). */\n actions?: React.ReactNode;\n /** Small slot under the title row (tabs, filters). */\n children?: React.ReactNode;\n /** Eyebrow/kicker above the title (category, date, overline). */\n eyebrow?: React.ReactNode;\n /** Heading scale - 'hero' is for marketing landing pages. */\n size?: 'sm' | 'md' | 'lg' | 'hero';\n /** Text alignment; hero marketing pages often center. */\n align?: 'left' | 'center';\n /** Extra classes for the h1, for host display typography. */\n titleClassName?: string;\n /** Extra classes for the description. */\n descriptionClassName?: string;\n /** Extra classes for the eyebrow. */\n eyebrowClassName?: string;\n};\n\nconst sizeClasses: Record<NonNullable<PageHeaderProps['size']>, string> = {\n sm: 'text-xl',\n md: 'text-2xl',\n lg: 'text-3xl',\n hero: 'text-4xl sm:text-5xl lg:text-[3.4rem] lg:leading-[1.1]',\n};\n\n/**\n * Standard page heading block: optional breadcrumbs, title, description and\n * a right-aligned action cluster. Pages stop inventing their own spacing\n * and heading hierarchy.\n */\nexport const PageHeader = React.forwardRef<HTMLDivElement, PageHeaderProps>(function PageHeader(\n { title, description, subtitle, breadcrumbs, actions, eyebrow, size = 'md', align = 'left', titleClassName, descriptionClassName, eyebrowClassName, className, children, ...props },\n ref\n) {\n const supporting = description ?? subtitle;\n return (\n <div ref={ref} className={cn('flex flex-col gap-2', align === 'center' && 'items-center text-center', className)} {...props}>\n {breadcrumbs && <div className=\"text-sm text-muted-foreground\">{breadcrumbs}</div>}\n {eyebrow && (\n <div className={cn('text-xs font-medium uppercase tracking-wide text-primary-ink', eyebrowClassName)}>{eyebrow}</div>\n )}\n <div className={cn('flex w-full flex-wrap items-start justify-between gap-3', align === 'center' && 'justify-center')}>\n <div className={cn('min-w-0', align === 'center' && 'flex flex-col items-center')}>\n <h1 className={cn('font-semibold tracking-tight', sizeClasses[size], titleClassName)}>{title}</h1>\n {supporting && <p className={cn('mt-2 max-w-2xl text-base text-muted-foreground', descriptionClassName)}>{supporting}</p>}\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n </div>\n {children && <div className=\"mt-2\">{children}</div>}\n </div>\n );\n});\n"],"mappings":"AA+CsB,cAKd,YALc;AA/CtB,YAAY,WAAW;AACvB,SAAS,UAAU;AA2BnB,MAAM,cAAoE;AAAA,EACxE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAOO,MAAM,aAAa,MAAM,WAA4C,SAASA,YACnF,EAAE,OAAO,aAAa,UAAU,aAAa,SAAS,SAAS,OAAO,MAAM,QAAQ,QAAQ,gBAAgB,sBAAsB,kBAAkB,WAAW,UAAU,GAAG,MAAM,GAClL,KACA;AACA,QAAM,aAAa,eAAe;AAClC,SACE,qBAAC,SAAI,KAAU,WAAW,GAAG,uBAAuB,UAAU,YAAY,4BAA4B,SAAS,GAAI,GAAG,OACnH;AAAA,mBAAe,oBAAC,SAAI,WAAU,iCAAiC,uBAAY;AAAA,IAC3E,WACC,oBAAC,SAAI,WAAW,GAAG,gEAAgE,gBAAgB,GAAI,mBAAQ;AAAA,IAEjH,qBAAC,SAAI,WAAW,GAAG,2DAA2D,UAAU,YAAY,gBAAgB,GAClH;AAAA,2BAAC,SAAI,WAAW,GAAG,WAAW,UAAU,YAAY,4BAA4B,GAC9E;AAAA,4BAAC,QAAG,WAAW,GAAG,gCAAgC,YAAY,IAAI,GAAG,cAAc,GAAI,iBAAM;AAAA,QAC5F,cAAc,oBAAC,OAAE,WAAW,GAAG,kDAAkD,oBAAoB,GAAI,sBAAW;AAAA,SACvH;AAAA,MACC,WAAW,oBAAC,SAAI,WAAU,oCAAoC,mBAAQ;AAAA,OACzE;AAAA,IACC,YAAY,oBAAC,SAAI,WAAU,QAAQ,UAAS;AAAA,KAC/C;AAEJ,CAAC;","names":["PageHeader"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { type Align, type Side } from '../../utils/position';
|
|
2
3
|
export type PopoverProps = {
|
|
3
4
|
/** Controlled open state. */
|
|
4
5
|
open?: boolean;
|
|
@@ -16,7 +17,39 @@ declare const Popover: React.ForwardRefExoticComponent<PopoverProps & React.RefA
|
|
|
16
17
|
export type PopoverTriggerProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
17
18
|
/** The button that toggles the popover. */
|
|
18
19
|
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
-
export type
|
|
20
|
+
export type PopoverAnchorProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
21
|
+
/**
|
|
22
|
+
* Anchors the panel to this element instead of the trigger. Useful when the
|
|
23
|
+
* panel belongs to a field that is not itself the button opening it.
|
|
24
|
+
*/
|
|
25
|
+
declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverAnchorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
26
|
+
export type PopoverContentProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
27
|
+
/** Preferred side of the anchor. Flips when it cannot fit. */
|
|
28
|
+
side?: Side;
|
|
29
|
+
/** Cross-axis alignment against the anchor. */
|
|
30
|
+
align?: Align;
|
|
31
|
+
/** Gap between anchor and panel. */
|
|
32
|
+
sideOffset?: number;
|
|
33
|
+
/** Nudge along the cross axis. */
|
|
34
|
+
alignOffset?: number;
|
|
35
|
+
/** Minimum distance kept from the viewport edges. */
|
|
36
|
+
collisionPadding?: number;
|
|
37
|
+
/** Match the panel width to the anchor width (select-like panels). */
|
|
38
|
+
matchTriggerWidth?: boolean;
|
|
39
|
+
};
|
|
20
40
|
/** The floating panel with interactive content. */
|
|
21
|
-
declare const PopoverContent: React.ForwardRefExoticComponent<
|
|
22
|
-
|
|
41
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
42
|
+
/** Preferred side of the anchor. Flips when it cannot fit. */
|
|
43
|
+
side?: Side;
|
|
44
|
+
/** Cross-axis alignment against the anchor. */
|
|
45
|
+
align?: Align;
|
|
46
|
+
/** Gap between anchor and panel. */
|
|
47
|
+
sideOffset?: number;
|
|
48
|
+
/** Nudge along the cross axis. */
|
|
49
|
+
alignOffset?: number;
|
|
50
|
+
/** Minimum distance kept from the viewport edges. */
|
|
51
|
+
collisionPadding?: number;
|
|
52
|
+
/** Match the panel width to the anchor width (select-like panels). */
|
|
53
|
+
matchTriggerWidth?: boolean;
|
|
54
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };
|