@slipstream-ui/core 0.6.1 → 0.8.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 +470 -30
- package/dist/index.d.ts +470 -30
- package/dist/index.js +1455 -750
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1442 -744
- package/dist/index.mjs.map +1 -1
- package/dist/manifests/accordion.manifest.json +7 -1
- package/dist/manifests/alert.manifest.json +1 -1
- package/dist/manifests/announcement-bar.manifest.json +1 -1
- package/dist/manifests/app-shell.manifest.json +1 -1
- package/dist/manifests/applied-filters.manifest.json +1 -1
- package/dist/manifests/article-card.manifest.json +1 -1
- package/dist/manifests/auth-layout.manifest.json +19 -1
- package/dist/manifests/autocomplete.manifest.json +1 -1
- package/dist/manifests/avatar.manifest.json +1 -1
- package/dist/manifests/badge.manifest.json +13 -1
- package/dist/manifests/block.manifest.json +1 -1
- package/dist/manifests/bottom-nav.manifest.json +130 -0
- 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/card.manifest.json +1 -1
- package/dist/manifests/checkbox.manifest.json +1 -1
- package/dist/manifests/comparison-table.manifest.json +1 -1
- package/dist/manifests/confirm-dialog.manifest.json +1 -1
- package/dist/manifests/contact-strip.manifest.json +1 -1
- package/dist/manifests/container.manifest.json +1 -1
- package/dist/manifests/cta-section.manifest.json +1 -1
- package/dist/manifests/data-table.manifest.json +1 -1
- package/dist/manifests/date-picker.manifest.json +1 -1
- package/dist/manifests/date-range-picker.manifest.json +1 -1
- package/dist/manifests/deal-card.manifest.json +158 -0
- package/dist/manifests/dialog.manifest.json +1 -1
- package/dist/manifests/document-card.manifest.json +108 -0
- package/dist/manifests/drawer.manifest.json +48 -2
- package/dist/manifests/empty-state.manifest.json +1 -1
- package/dist/manifests/entity-card.manifest.json +114 -0
- package/dist/manifests/feature-grid.manifest.json +1 -1
- package/dist/manifests/feature-row.manifest.json +1 -1
- package/dist/manifests/fieldset.manifest.json +1 -1
- package/dist/manifests/file-upload.manifest.json +1 -1
- package/dist/manifests/filter-bar.manifest.json +1 -1
- package/dist/manifests/filter-chips.manifest.json +1 -1
- package/dist/manifests/filter-panel.manifest.json +1 -1
- package/dist/manifests/flex.manifest.json +1 -1
- package/dist/manifests/form-field.manifest.json +1 -1
- package/dist/manifests/form-layout.manifest.json +1 -1
- package/dist/manifests/form.manifest.json +1 -1
- package/dist/manifests/grid.manifest.json +1 -1
- package/dist/manifests/heading.manifest.json +1 -1
- package/dist/manifests/hero.manifest.json +40 -8
- 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 +88 -0
- package/dist/manifests/logo-cloud.manifest.json +1 -1
- package/dist/manifests/menu.manifest.json +1 -1
- package/dist/manifests/metric-card.manifest.json +36 -4
- package/dist/manifests/multi-select.manifest.json +1 -1
- package/dist/manifests/newsletter.manifest.json +1 -1
- package/dist/manifests/page-header.manifest.json +7 -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 +2 -2
- package/dist/manifests/select.manifest.json +1 -1
- package/dist/manifests/separator.manifest.json +1 -1
- package/dist/manifests/site-footer.manifest.json +1 -1
- package/dist/manifests/site-header.manifest.json +1 -1
- package/dist/manifests/skeleton.manifest.json +1 -1
- package/dist/manifests/spinner.manifest.json +1 -1
- package/dist/manifests/stat-band.manifest.json +1 -1
- package/dist/manifests/stepper.manifest.json +69 -5
- 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 +26 -5
- 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 +97 -0
- package/dist/manifests/tooltip.manifest.json +1 -1
- package/dist/src/components/accordion/Accordion.d.ts +17 -1
- package/dist/src/components/accordion/Accordion.js +5 -1
- package/dist/src/components/accordion/Accordion.js.map +1 -1
- package/dist/src/components/accordion/Accordion.mjs +5 -1
- package/dist/src/components/accordion/Accordion.mjs.map +1 -1
- package/dist/src/components/auth-layout/AuthLayout.d.ts +14 -2
- package/dist/src/components/auth-layout/AuthLayout.js +10 -2
- package/dist/src/components/auth-layout/AuthLayout.js.map +1 -1
- package/dist/src/components/auth-layout/AuthLayout.mjs +10 -2
- package/dist/src/components/auth-layout/AuthLayout.mjs.map +1 -1
- package/dist/src/components/badge/Badge.d.ts +2 -0
- package/dist/src/components/badge/Badge.js +9 -3
- package/dist/src/components/badge/Badge.js.map +1 -1
- package/dist/src/components/badge/Badge.mjs +9 -3
- package/dist/src/components/badge/Badge.mjs.map +1 -1
- package/dist/src/components/bottom-nav/BottomNav.d.ts +36 -0
- package/dist/src/components/bottom-nav/BottomNav.js +90 -0
- package/dist/src/components/bottom-nav/BottomNav.js.map +1 -0
- package/dist/src/components/bottom-nav/BottomNav.mjs +66 -0
- package/dist/src/components/bottom-nav/BottomNav.mjs.map +1 -0
- package/dist/src/components/bottom-nav/index.d.ts +1 -0
- package/dist/src/components/bottom-nav/index.js +23 -0
- package/dist/src/components/bottom-nav/index.js.map +1 -0
- package/dist/src/components/bottom-nav/index.mjs +2 -0
- package/dist/src/components/bottom-nav/index.mjs.map +1 -0
- package/dist/src/components/date-picker/DatePicker.js +1 -1
- package/dist/src/components/date-picker/DatePicker.js.map +1 -1
- package/dist/src/components/date-picker/DatePicker.mjs +1 -1
- package/dist/src/components/date-picker/DatePicker.mjs.map +1 -1
- package/dist/src/components/deal-card/DealCard.d.ts +72 -0
- package/dist/src/components/deal-card/DealCard.js +108 -0
- package/dist/src/components/deal-card/DealCard.js.map +1 -0
- package/dist/src/components/deal-card/DealCard.mjs +74 -0
- package/dist/src/components/deal-card/DealCard.mjs.map +1 -0
- package/dist/src/components/deal-card/index.d.ts +2 -0
- package/dist/src/components/deal-card/index.js +29 -0
- package/dist/src/components/deal-card/index.js.map +1 -0
- package/dist/src/components/deal-card/index.mjs +5 -0
- package/dist/src/components/deal-card/index.mjs.map +1 -0
- package/dist/src/components/document-card/DocumentCard.d.ts +42 -0
- package/dist/src/components/document-card/DocumentCard.js +84 -0
- package/dist/src/components/document-card/DocumentCard.js.map +1 -0
- package/dist/src/components/document-card/DocumentCard.mjs +50 -0
- package/dist/src/components/document-card/DocumentCard.mjs.map +1 -0
- package/dist/src/components/document-card/index.d.ts +2 -0
- package/dist/src/components/document-card/index.js +29 -0
- package/dist/src/components/document-card/index.js.map +1 -0
- package/dist/src/components/document-card/index.mjs +5 -0
- package/dist/src/components/document-card/index.mjs.map +1 -0
- package/dist/src/components/drawer/Drawer.d.ts +25 -2
- package/dist/src/components/drawer/Drawer.js +97 -6
- package/dist/src/components/drawer/Drawer.js.map +1 -1
- package/dist/src/components/drawer/Drawer.mjs +97 -6
- package/dist/src/components/drawer/Drawer.mjs.map +1 -1
- package/dist/src/components/empty-state/EmptyState.d.ts +13 -4
- package/dist/src/components/empty-state/EmptyState.js +13 -1
- package/dist/src/components/empty-state/EmptyState.js.map +1 -1
- package/dist/src/components/empty-state/EmptyState.mjs +13 -1
- package/dist/src/components/empty-state/EmptyState.mjs.map +1 -1
- package/dist/src/components/entity-card/EntityCard.d.ts +78 -0
- package/dist/src/components/entity-card/EntityCard.js +95 -0
- package/dist/src/components/entity-card/EntityCard.js.map +1 -0
- package/dist/src/components/entity-card/EntityCard.mjs +60 -0
- package/dist/src/components/entity-card/EntityCard.mjs.map +1 -0
- package/dist/src/components/entity-card/index.d.ts +2 -0
- package/dist/src/components/entity-card/index.js +31 -0
- package/dist/src/components/entity-card/index.js.map +1 -0
- package/dist/src/components/entity-card/index.mjs +6 -0
- package/dist/src/components/entity-card/index.mjs.map +1 -0
- package/dist/src/components/hero/Hero.d.ts +25 -13
- package/dist/src/components/hero/Hero.js +116 -12
- package/dist/src/components/hero/Hero.js.map +1 -1
- package/dist/src/components/hero/Hero.mjs +116 -12
- package/dist/src/components/hero/Hero.mjs.map +1 -1
- package/dist/src/components/load-more/LoadMore.d.ts +34 -0
- package/dist/src/components/load-more/LoadMore.js +55 -0
- package/dist/src/components/load-more/LoadMore.js.map +1 -0
- package/dist/src/components/load-more/LoadMore.mjs +21 -0
- package/dist/src/components/load-more/LoadMore.mjs.map +1 -0
- package/dist/src/components/load-more/index.d.ts +2 -0
- package/dist/src/components/load-more/index.js +29 -0
- package/dist/src/components/load-more/index.js.map +1 -0
- package/dist/src/components/load-more/index.mjs +5 -0
- package/dist/src/components/load-more/index.mjs.map +1 -0
- package/dist/src/components/metric-card/MetricCard.d.ts +23 -4
- package/dist/src/components/metric-card/MetricCard.js +32 -5
- package/dist/src/components/metric-card/MetricCard.js.map +1 -1
- package/dist/src/components/metric-card/MetricCard.mjs +32 -5
- package/dist/src/components/metric-card/MetricCard.mjs.map +1 -1
- package/dist/src/components/page-header/PageHeader.d.ts +4 -0
- package/dist/src/components/page-header/PageHeader.js +3 -2
- package/dist/src/components/page-header/PageHeader.js.map +1 -1
- package/dist/src/components/page-header/PageHeader.mjs +3 -2
- package/dist/src/components/page-header/PageHeader.mjs.map +1 -1
- package/dist/src/components/range-slider/RangeSlider.js +6 -6
- package/dist/src/components/range-slider/RangeSlider.js.map +1 -1
- package/dist/src/components/range-slider/RangeSlider.mjs +6 -6
- package/dist/src/components/range-slider/RangeSlider.mjs.map +1 -1
- package/dist/src/components/select-menu/SelectMenu.js +2 -0
- package/dist/src/components/select-menu/SelectMenu.js.map +1 -1
- package/dist/src/components/select-menu/SelectMenu.mjs +2 -0
- package/dist/src/components/select-menu/SelectMenu.mjs.map +1 -1
- package/dist/src/components/separator/Separator.d.ts +3 -3
- package/dist/src/components/separator/Separator.js +1 -1
- package/dist/src/components/separator/Separator.js.map +1 -1
- package/dist/src/components/separator/Separator.mjs +1 -1
- package/dist/src/components/separator/Separator.mjs.map +1 -1
- package/dist/src/components/stepper/Stepper.d.ts +35 -0
- package/dist/src/components/stepper/Stepper.js +118 -25
- package/dist/src/components/stepper/Stepper.js.map +1 -1
- package/dist/src/components/stepper/Stepper.mjs +118 -25
- package/dist/src/components/stepper/Stepper.mjs.map +1 -1
- package/dist/src/components/table-of-contents/TableOfContents.d.ts +10 -2
- package/dist/src/components/table-of-contents/TableOfContents.js +13 -0
- package/dist/src/components/table-of-contents/TableOfContents.js.map +1 -1
- package/dist/src/components/table-of-contents/TableOfContents.mjs +13 -0
- package/dist/src/components/table-of-contents/TableOfContents.mjs.map +1 -1
- package/dist/src/components/tabs/Tabs.js +43 -3
- package/dist/src/components/tabs/Tabs.js.map +1 -1
- package/dist/src/components/tabs/Tabs.mjs +43 -3
- package/dist/src/components/tabs/Tabs.mjs.map +1 -1
- package/dist/src/components/time-picker/TimePicker.js +1 -1
- package/dist/src/components/time-picker/TimePicker.js.map +1 -1
- package/dist/src/components/time-picker/TimePicker.mjs +1 -1
- package/dist/src/components/time-picker/TimePicker.mjs.map +1 -1
- package/dist/src/components/timeline/Timeline.js +2 -2
- package/dist/src/components/timeline/Timeline.js.map +1 -1
- package/dist/src/components/timeline/Timeline.mjs +2 -2
- package/dist/src/components/timeline/Timeline.mjs.map +1 -1
- package/dist/src/components/tombstone-card/TombstoneCard.d.ts +39 -0
- package/dist/src/components/tombstone-card/TombstoneCard.js +86 -0
- package/dist/src/components/tombstone-card/TombstoneCard.js.map +1 -0
- package/dist/src/components/tombstone-card/TombstoneCard.mjs +52 -0
- package/dist/src/components/tombstone-card/TombstoneCard.mjs.map +1 -0
- package/dist/src/components/tombstone-card/index.d.ts +2 -0
- package/dist/src/components/tombstone-card/index.js +29 -0
- package/dist/src/components/tombstone-card/index.js.map +1 -0
- package/dist/src/components/tombstone-card/index.mjs +5 -0
- package/dist/src/components/tombstone-card/index.mjs.map +1 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/styles-full.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/src/components/accordion/Accordion.test.tsx +31 -0
- package/src/components/accordion/Accordion.tsx +27 -2
- package/src/components/auth-layout/AuthLayout.test.tsx +36 -0
- package/src/components/auth-layout/AuthLayout.tsx +20 -3
- package/src/components/badge/Badge.test.tsx +7 -0
- package/src/components/badge/Badge.tsx +8 -2
- package/src/components/bottom-nav/BottomNav.test.tsx +48 -0
- package/src/components/bottom-nav/BottomNav.tsx +117 -0
- package/src/components/bottom-nav/index.ts +1 -0
- package/src/components/date-picker/DatePicker.tsx +1 -1
- package/src/components/deal-card/DealCard.test.tsx +54 -0
- package/src/components/deal-card/DealCard.tsx +138 -0
- package/src/components/deal-card/index.ts +2 -0
- package/src/components/document-card/DocumentCard.test.tsx +41 -0
- package/src/components/document-card/DocumentCard.tsx +82 -0
- package/src/components/document-card/index.ts +2 -0
- package/src/components/drawer/Drawer.test.tsx +86 -1
- package/src/components/drawer/Drawer.tsx +135 -7
- package/src/components/empty-state/EmptyState.test.tsx +26 -1
- package/src/components/empty-state/EmptyState.tsx +40 -3
- package/src/components/entity-card/EntityCard.test.tsx +38 -0
- package/src/components/entity-card/EntityCard.tsx +133 -0
- package/src/components/entity-card/index.ts +2 -0
- package/src/components/hero/Hero.test.tsx +14 -0
- package/src/components/hero/Hero.tsx +111 -19
- package/src/components/load-more/LoadMore.test.tsx +28 -0
- package/src/components/load-more/LoadMore.tsx +53 -0
- package/src/components/load-more/index.ts +2 -0
- package/src/components/metric-card/MetricCard.test.tsx +32 -0
- package/src/components/metric-card/MetricCard.tsx +45 -7
- package/src/components/page-header/PageHeader.test.tsx +13 -0
- package/src/components/page-header/PageHeader.tsx +5 -2
- package/src/components/range-slider/RangeSlider.test.tsx +8 -0
- package/src/components/range-slider/RangeSlider.tsx +10 -6
- package/src/components/select-menu/SelectMenu.test.tsx +20 -10
- package/src/components/select-menu/SelectMenu.tsx +2 -0
- package/src/components/separator/Separator.test.tsx +9 -1
- package/src/components/separator/Separator.tsx +1 -1
- package/src/components/stepper/Stepper.test.tsx +19 -0
- package/src/components/stepper/Stepper.tsx +169 -37
- package/src/components/table-of-contents/TableOfContents.test.tsx +12 -1
- package/src/components/table-of-contents/TableOfContents.tsx +25 -1
- package/src/components/tabs/Tabs.test.tsx +12 -0
- package/src/components/tabs/Tabs.tsx +48 -4
- package/src/components/time-picker/TimePicker.tsx +1 -1
- package/src/components/timeline/Timeline.tsx +2 -2
- package/src/components/tombstone-card/TombstoneCard.test.tsx +26 -0
- package/src/components/tombstone-card/TombstoneCard.tsx +77 -0
- package/src/components/tombstone-card/index.ts +2 -0
- package/src/index.ts +6 -0
- package/src/manifests/accordion.manifest.json +7 -1
- package/src/manifests/alert.manifest.json +1 -1
- package/src/manifests/announcement-bar.manifest.json +1 -1
- package/src/manifests/app-shell.manifest.json +1 -1
- package/src/manifests/applied-filters.manifest.json +1 -1
- package/src/manifests/article-card.manifest.json +1 -1
- package/src/manifests/auth-layout.manifest.json +19 -1
- package/src/manifests/autocomplete.manifest.json +1 -1
- package/src/manifests/avatar.manifest.json +1 -1
- package/src/manifests/badge.manifest.json +13 -1
- package/src/manifests/block.manifest.json +1 -1
- package/src/manifests/bottom-nav.manifest.json +130 -0
- 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/card.manifest.json +1 -1
- package/src/manifests/checkbox.manifest.json +1 -1
- package/src/manifests/comparison-table.manifest.json +1 -1
- package/src/manifests/confirm-dialog.manifest.json +1 -1
- package/src/manifests/contact-strip.manifest.json +1 -1
- package/src/manifests/container.manifest.json +1 -1
- package/src/manifests/cta-section.manifest.json +1 -1
- package/src/manifests/data-table.manifest.json +1 -1
- package/src/manifests/date-picker.manifest.json +1 -1
- package/src/manifests/date-range-picker.manifest.json +1 -1
- package/src/manifests/deal-card.manifest.json +158 -0
- package/src/manifests/dialog.manifest.json +1 -1
- package/src/manifests/document-card.manifest.json +108 -0
- package/src/manifests/drawer.manifest.json +48 -2
- package/src/manifests/empty-state.manifest.json +1 -1
- package/src/manifests/entity-card.manifest.json +114 -0
- package/src/manifests/feature-grid.manifest.json +1 -1
- package/src/manifests/feature-row.manifest.json +1 -1
- package/src/manifests/fieldset.manifest.json +1 -1
- package/src/manifests/file-upload.manifest.json +1 -1
- package/src/manifests/filter-bar.manifest.json +1 -1
- package/src/manifests/filter-chips.manifest.json +1 -1
- package/src/manifests/filter-panel.manifest.json +1 -1
- package/src/manifests/flex.manifest.json +1 -1
- package/src/manifests/form-field.manifest.json +1 -1
- package/src/manifests/form-layout.manifest.json +1 -1
- package/src/manifests/form.manifest.json +1 -1
- package/src/manifests/grid.manifest.json +1 -1
- package/src/manifests/heading.manifest.json +1 -1
- package/src/manifests/hero.manifest.json +40 -8
- 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 +88 -0
- package/src/manifests/logo-cloud.manifest.json +1 -1
- package/src/manifests/menu.manifest.json +1 -1
- package/src/manifests/metric-card.manifest.json +36 -4
- package/src/manifests/multi-select.manifest.json +1 -1
- package/src/manifests/newsletter.manifest.json +1 -1
- package/src/manifests/page-header.manifest.json +7 -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 +2 -2
- package/src/manifests/select.manifest.json +1 -1
- package/src/manifests/separator.manifest.json +1 -1
- package/src/manifests/site-footer.manifest.json +1 -1
- package/src/manifests/site-header.manifest.json +1 -1
- package/src/manifests/skeleton.manifest.json +1 -1
- package/src/manifests/spinner.manifest.json +1 -1
- package/src/manifests/stat-band.manifest.json +1 -1
- package/src/manifests/stepper.manifest.json +69 -5
- 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 +26 -5
- 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 +97 -0
- package/src/manifests/tooltip.manifest.json +1 -1
- package/src/test/jest-axe.d.ts +6 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../utils/cn.mjs";
|
|
4
|
+
import { Badge } from "../badge/Badge.mjs";
|
|
5
|
+
import { Button } from "../button/Button.mjs";
|
|
6
|
+
import { Card, CardContent, CardFooter, CardHeader } from "../card/Card.mjs";
|
|
7
|
+
const statusConfig = {
|
|
8
|
+
available: { label: "Available", variant: "success" },
|
|
9
|
+
"under-nda": { label: "Under NDA", variant: "info" },
|
|
10
|
+
closed: { label: "Closed", variant: "secondary" },
|
|
11
|
+
draft: { label: "Draft", variant: "outline" }
|
|
12
|
+
};
|
|
13
|
+
const DealCard = React.forwardRef(function DealCard2({
|
|
14
|
+
title,
|
|
15
|
+
sector,
|
|
16
|
+
location,
|
|
17
|
+
description,
|
|
18
|
+
metrics,
|
|
19
|
+
status = "available",
|
|
20
|
+
ndaAvailable,
|
|
21
|
+
cimAvailable,
|
|
22
|
+
href,
|
|
23
|
+
linkComponent,
|
|
24
|
+
saved = false,
|
|
25
|
+
onSave,
|
|
26
|
+
saveLabel = "Save",
|
|
27
|
+
onRequestAccess,
|
|
28
|
+
requestLabel = "Request access",
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}, ref) {
|
|
32
|
+
const Link = linkComponent ?? "a";
|
|
33
|
+
const statusInfo = statusConfig[status];
|
|
34
|
+
return /* @__PURE__ */ jsxs(Card, { ref, className: cn("flex h-full flex-col overflow-hidden", className), ...props, children: [
|
|
35
|
+
/* @__PURE__ */ jsxs(CardHeader, { className: "gap-2 p-5 pb-3", children: [
|
|
36
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
|
|
37
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-widest text-primary", children: sector }),
|
|
38
|
+
/* @__PURE__ */ jsx(Badge, { variant: statusInfo.variant, children: statusInfo.label })
|
|
39
|
+
] }),
|
|
40
|
+
/* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold leading-snug tracking-tight", children: href ? /* @__PURE__ */ jsx(Link, { href, className: "rounded-sm hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: title }) : title }),
|
|
41
|
+
location && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: location })
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsxs(CardContent, { className: "flex-1 px-5 pb-3", children: [
|
|
44
|
+
description && /* @__PURE__ */ jsx("p", { className: "line-clamp-2 text-sm leading-relaxed text-muted-foreground", children: description }),
|
|
45
|
+
/* @__PURE__ */ jsx("dl", { className: "mt-4 grid grid-cols-3 gap-3", children: metrics.map((metric) => /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
46
|
+
/* @__PURE__ */ jsx("dt", { className: "text-xs text-muted-foreground", children: metric.label }),
|
|
47
|
+
/* @__PURE__ */ jsx("dd", { className: "mt-0.5 truncate text-sm font-semibold tabular-nums", children: metric.value })
|
|
48
|
+
] }, metric.label)) }),
|
|
49
|
+
(ndaAvailable || cimAvailable) && /* @__PURE__ */ jsxs("div", { className: "mt-4 flex flex-wrap gap-1.5", children: [
|
|
50
|
+
ndaAvailable && /* @__PURE__ */ jsx(Badge, { variant: "info", children: "NDA available" }),
|
|
51
|
+
cimAvailable && /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: "CIM available" })
|
|
52
|
+
] })
|
|
53
|
+
] }),
|
|
54
|
+
/* @__PURE__ */ jsxs(CardFooter, { className: "flex flex-wrap items-center gap-2 border-t border-border px-5 py-3", children: [
|
|
55
|
+
onRequestAccess && /* @__PURE__ */ jsx(Button, { type: "button", size: "sm", onClick: onRequestAccess, children: requestLabel }),
|
|
56
|
+
onSave && /* @__PURE__ */ jsx(
|
|
57
|
+
Button,
|
|
58
|
+
{
|
|
59
|
+
type: "button",
|
|
60
|
+
size: "sm",
|
|
61
|
+
variant: "ghost",
|
|
62
|
+
"aria-pressed": saved,
|
|
63
|
+
onClick: onSave,
|
|
64
|
+
className: "ml-auto",
|
|
65
|
+
children: saved ? "Saved" : saveLabel
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
] })
|
|
69
|
+
] });
|
|
70
|
+
});
|
|
71
|
+
export {
|
|
72
|
+
DealCard
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=DealCard.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/deal-card/DealCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { Badge } from '../badge/Badge';\nimport { Button } from '../button/Button';\nimport { Card, CardContent, CardFooter, CardHeader } from '../card/Card';\n\nexport type DealMetric = {\n label: string;\n value: string;\n};\n\nexport type DealStatus = 'available' | 'under-nda' | 'closed' | 'draft';\n\nexport type DealCardProps = Omit<React.HTMLAttributes<HTMLElement>, 'title'> & {\n /** Deal headline. */\n title: string;\n /** Sector or industry label. */\n sector: string;\n /** Region or location. */\n location?: string;\n /** Optional short summary. */\n description?: string;\n /** Three headline metrics such as revenue, EBITDA and margin. */\n metrics: DealMetric[];\n /** Availability state. Default 'available'. */\n status?: DealStatus;\n /** Show the NDA badge. */\n ndaAvailable?: boolean;\n /** Show the CIM badge. */\n cimAvailable?: boolean;\n /** Optional deal detail link. */\n href?: string;\n /** Custom link element for routers. */\n linkComponent?: React.ElementType;\n /** Save toggle state. */\n saved?: boolean;\n onSave?: () => void;\n /** Save button label. Default \"Save\". */\n saveLabel?: string;\n /** Request access handler. */\n onRequestAccess?: () => void;\n /** Request access label. Default \"Request access\". */\n requestLabel?: string;\n};\n\nconst statusConfig: Record<DealStatus, { label: string; variant: 'success' | 'info' | 'secondary' | 'outline' }> = {\n available: { label: 'Available', variant: 'success' },\n 'under-nda': { label: 'Under NDA', variant: 'info' },\n closed: { label: 'Closed', variant: 'secondary' },\n draft: { label: 'Draft', variant: 'outline' },\n};\n\n/**\n * Deal opportunity card for trend, search and saved-deal surfaces. Metrics use\n * tabular numerals; NDA and CIM access are stated as text badges, not implied.\n */\nexport const DealCard = React.forwardRef<HTMLElement, DealCardProps>(function DealCard(\n {\n title,\n sector,\n location,\n description,\n metrics,\n status = 'available',\n ndaAvailable,\n cimAvailable,\n href,\n linkComponent,\n saved = false,\n onSave,\n saveLabel = 'Save',\n onRequestAccess,\n requestLabel = 'Request access',\n className,\n ...props\n },\n ref\n) {\n const Link = linkComponent ?? 'a';\n const statusInfo = statusConfig[status];\n\n return (\n <Card ref={ref as never} className={cn('flex h-full flex-col overflow-hidden', className)} {...props}>\n <CardHeader className=\"gap-2 p-5 pb-3\">\n <div className=\"flex items-start justify-between gap-2\">\n <p className=\"text-xs font-semibold uppercase tracking-widest text-primary\">{sector}</p>\n <Badge variant={statusInfo.variant}>{statusInfo.label}</Badge>\n </div>\n <h3 className=\"text-lg font-semibold leading-snug tracking-tight\">\n {href ? (\n <Link href={href} className=\"rounded-sm hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\">\n {title}\n </Link>\n ) : (\n title\n )}\n </h3>\n {location && <p className=\"text-xs text-muted-foreground\">{location}</p>}\n </CardHeader>\n <CardContent className=\"flex-1 px-5 pb-3\">\n {description && <p className=\"line-clamp-2 text-sm leading-relaxed text-muted-foreground\">{description}</p>}\n <dl className=\"mt-4 grid grid-cols-3 gap-3\">\n {metrics.map((metric) => (\n <div key={metric.label} className=\"min-w-0\">\n <dt className=\"text-xs text-muted-foreground\">{metric.label}</dt>\n <dd className=\"mt-0.5 truncate text-sm font-semibold tabular-nums\">{metric.value}</dd>\n </div>\n ))}\n </dl>\n {(ndaAvailable || cimAvailable) && (\n <div className=\"mt-4 flex flex-wrap gap-1.5\">\n {ndaAvailable && <Badge variant=\"info\">NDA available</Badge>}\n {cimAvailable && <Badge variant=\"secondary\">CIM available</Badge>}\n </div>\n )}\n </CardContent>\n <CardFooter className=\"flex flex-wrap items-center gap-2 border-t border-border px-5 py-3\">\n {onRequestAccess && (\n <Button type=\"button\" size=\"sm\" onClick={onRequestAccess}>\n {requestLabel}\n </Button>\n )}\n {onSave && (\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"ghost\"\n aria-pressed={saved}\n onClick={onSave}\n className=\"ml-auto\"\n >\n {saved ? 'Saved' : saveLabel}\n </Button>\n )}\n </CardFooter>\n </Card>\n );\n});\n"],"mappings":"AAoFQ,SACE,KADF;AApFR,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,MAAM,aAAa,YAAY,kBAAkB;AAyC1D,MAAM,eAA6G;AAAA,EACjH,WAAW,EAAE,OAAO,aAAa,SAAS,UAAU;AAAA,EACpD,aAAa,EAAE,OAAO,aAAa,SAAS,OAAO;AAAA,EACnD,QAAQ,EAAE,OAAO,UAAU,SAAS,YAAY;AAAA,EAChD,OAAO,EAAE,OAAO,SAAS,SAAS,UAAU;AAC9C;AAMO,MAAM,WAAW,MAAM,WAAuC,SAASA,UAC5E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,OAAO,iBAAiB;AAC9B,QAAM,aAAa,aAAa,MAAM;AAEtC,SACE,qBAAC,QAAK,KAAmB,WAAW,GAAG,wCAAwC,SAAS,GAAI,GAAG,OAC7F;AAAA,yBAAC,cAAW,WAAU,kBACpB;AAAA,2BAAC,SAAI,WAAU,0CACb;AAAA,4BAAC,OAAE,WAAU,gEAAgE,kBAAO;AAAA,QACpF,oBAAC,SAAM,SAAS,WAAW,SAAU,qBAAW,OAAM;AAAA,SACxD;AAAA,MACA,oBAAC,QAAG,WAAU,qDACX,iBACC,oBAAC,QAAK,MAAY,WAAU,yGACzB,iBACH,IAEA,OAEJ;AAAA,MACC,YAAY,oBAAC,OAAE,WAAU,iCAAiC,oBAAS;AAAA,OACtE;AAAA,IACA,qBAAC,eAAY,WAAU,oBACpB;AAAA,qBAAe,oBAAC,OAAE,WAAU,8DAA8D,uBAAY;AAAA,MACvG,oBAAC,QAAG,WAAU,+BACX,kBAAQ,IAAI,CAAC,WACZ,qBAAC,SAAuB,WAAU,WAChC;AAAA,4BAAC,QAAG,WAAU,iCAAiC,iBAAO,OAAM;AAAA,QAC5D,oBAAC,QAAG,WAAU,sDAAsD,iBAAO,OAAM;AAAA,WAFzE,OAAO,KAGjB,CACD,GACH;AAAA,OACE,gBAAgB,iBAChB,qBAAC,SAAI,WAAU,+BACZ;AAAA,wBAAgB,oBAAC,SAAM,SAAQ,QAAO,2BAAa;AAAA,QACnD,gBAAgB,oBAAC,SAAM,SAAQ,aAAY,2BAAa;AAAA,SAC3D;AAAA,OAEJ;AAAA,IACA,qBAAC,cAAW,WAAU,sEACnB;AAAA,yBACC,oBAAC,UAAO,MAAK,UAAS,MAAK,MAAK,SAAS,iBACtC,wBACH;AAAA,MAED,UACC;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,MAAK;AAAA,UACL,SAAQ;AAAA,UACR,gBAAc;AAAA,UACd,SAAS;AAAA,UACT,WAAU;AAAA,UAET,kBAAQ,UAAU;AAAA;AAAA,MACrB;AAAA,OAEJ;AAAA,KACF;AAEJ,CAAC;","names":["DealCard"]}
|
|
@@ -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 deal_card_exports = {};
|
|
20
|
+
__export(deal_card_exports, {
|
|
21
|
+
DealCard: () => import_DealCard.DealCard
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(deal_card_exports);
|
|
24
|
+
var import_DealCard = require("./DealCard.js");
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
DealCard
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/deal-card/index.ts"],"sourcesContent":["export { DealCard } from './DealCard';\nexport type { DealCardProps, DealMetric, DealStatus } from './DealCard';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAyB;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/deal-card/index.ts"],"sourcesContent":["export { DealCard } from './DealCard';\nexport type { DealCardProps, DealMetric, DealStatus } from './DealCard';\n"],"mappings":"AAAA,SAAS,gBAAgB;","names":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type DocumentStatus = 'available' | 'restricted' | 'pending';
|
|
3
|
+
export type DocumentCardProps = React.HTMLAttributes<HTMLElement> & {
|
|
4
|
+
/** File name. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Short file type label, such as PDF or XLSX. */
|
|
7
|
+
fileType: string;
|
|
8
|
+
/** Human-readable file size. */
|
|
9
|
+
size?: string;
|
|
10
|
+
/** Updated date or relative time. */
|
|
11
|
+
updatedAt?: string;
|
|
12
|
+
/** Access state. Default 'available'. */
|
|
13
|
+
status?: DocumentStatus;
|
|
14
|
+
/** Download handler. Omit to render a display-only row. */
|
|
15
|
+
onDownload?: () => void;
|
|
16
|
+
/** Download button label. Default "Download". */
|
|
17
|
+
downloadLabel?: string;
|
|
18
|
+
/** Custom file icon slot. */
|
|
19
|
+
icon?: React.ReactNode;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Document row for a deal room or diligence list. The row states the access
|
|
23
|
+
* status and only exposes the download action when a handler is provided.
|
|
24
|
+
*/
|
|
25
|
+
export declare const DocumentCard: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
|
|
26
|
+
/** File name. */
|
|
27
|
+
name: string;
|
|
28
|
+
/** Short file type label, such as PDF or XLSX. */
|
|
29
|
+
fileType: string;
|
|
30
|
+
/** Human-readable file size. */
|
|
31
|
+
size?: string;
|
|
32
|
+
/** Updated date or relative time. */
|
|
33
|
+
updatedAt?: string;
|
|
34
|
+
/** Access state. Default 'available'. */
|
|
35
|
+
status?: DocumentStatus;
|
|
36
|
+
/** Download handler. Omit to render a display-only row. */
|
|
37
|
+
onDownload?: () => void;
|
|
38
|
+
/** Download button label. Default "Download". */
|
|
39
|
+
downloadLabel?: string;
|
|
40
|
+
/** Custom file icon slot. */
|
|
41
|
+
icon?: React.ReactNode;
|
|
42
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var DocumentCard_exports = {};
|
|
30
|
+
__export(DocumentCard_exports, {
|
|
31
|
+
DocumentCard: () => DocumentCard
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(DocumentCard_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_cn = require("../../utils/cn.js");
|
|
37
|
+
var import_Badge = require("../badge/Badge.js");
|
|
38
|
+
var import_Button = require("../button/Button.js");
|
|
39
|
+
var import_Card = require("../card/Card.js");
|
|
40
|
+
const statusConfig = {
|
|
41
|
+
available: { label: "Available", variant: "success" },
|
|
42
|
+
restricted: { label: "Restricted", variant: "warning" },
|
|
43
|
+
pending: { label: "Pending", variant: "info" }
|
|
44
|
+
};
|
|
45
|
+
const DocumentCard = React.forwardRef(function DocumentCard2({
|
|
46
|
+
name,
|
|
47
|
+
fileType,
|
|
48
|
+
size,
|
|
49
|
+
updatedAt,
|
|
50
|
+
status = "available",
|
|
51
|
+
onDownload,
|
|
52
|
+
downloadLabel = "Download",
|
|
53
|
+
icon,
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
}, ref) {
|
|
57
|
+
const statusInfo = statusConfig[status];
|
|
58
|
+
const meta = [fileType, size, updatedAt].filter(Boolean).join(" \xB7 ");
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Card.Card, { ref, className: (0, import_cn.cn)("w-full", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Card.CardContent, { className: "flex items-center gap-3 p-4", children: [
|
|
60
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary [&_svg]:size-5", children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-[10px] font-bold uppercase tracking-wide", children: fileType }) }),
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "truncate text-sm font-medium", children: name }),
|
|
63
|
+
meta && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: meta })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Badge.Badge, { variant: statusInfo.variant, children: statusInfo.label }),
|
|
66
|
+
onDownload && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
|
+
import_Button.Button,
|
|
68
|
+
{
|
|
69
|
+
type: "button",
|
|
70
|
+
variant: "outline",
|
|
71
|
+
size: "sm",
|
|
72
|
+
onClick: onDownload,
|
|
73
|
+
disabled: status !== "available",
|
|
74
|
+
"aria-label": `${downloadLabel} ${name}`,
|
|
75
|
+
children: downloadLabel
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
] }) });
|
|
79
|
+
});
|
|
80
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
+
0 && (module.exports = {
|
|
82
|
+
DocumentCard
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=DocumentCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/document-card/DocumentCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { Badge } from '../badge/Badge';\nimport { Button } from '../button/Button';\nimport { Card, CardContent } from '../card/Card';\n\nexport type DocumentStatus = 'available' | 'restricted' | 'pending';\n\nexport type DocumentCardProps = React.HTMLAttributes<HTMLElement> & {\n /** File name. */\n name: string;\n /** Short file type label, such as PDF or XLSX. */\n fileType: string;\n /** Human-readable file size. */\n size?: string;\n /** Updated date or relative time. */\n updatedAt?: string;\n /** Access state. Default 'available'. */\n status?: DocumentStatus;\n /** Download handler. Omit to render a display-only row. */\n onDownload?: () => void;\n /** Download button label. Default \"Download\". */\n downloadLabel?: string;\n /** Custom file icon slot. */\n icon?: React.ReactNode;\n};\n\nconst statusConfig: Record<DocumentStatus, { label: string; variant: 'success' | 'warning' | 'info' }> = {\n available: { label: 'Available', variant: 'success' },\n restricted: { label: 'Restricted', variant: 'warning' },\n pending: { label: 'Pending', variant: 'info' },\n};\n\n/**\n * Document row for a deal room or diligence list. The row states the access\n * status and only exposes the download action when a handler is provided.\n */\nexport const DocumentCard = React.forwardRef<HTMLElement, DocumentCardProps>(function DocumentCard(\n {\n name,\n fileType,\n size,\n updatedAt,\n status = 'available',\n onDownload,\n downloadLabel = 'Download',\n icon,\n className,\n ...props\n },\n ref\n) {\n const statusInfo = statusConfig[status];\n const meta = [fileType, size, updatedAt].filter(Boolean).join(' · ');\n\n return (\n <Card ref={ref as never} className={cn('w-full', className)} {...props}>\n <CardContent className=\"flex items-center gap-3 p-4\">\n <span className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary [&_svg]:size-5\">\n {icon ?? <span className=\"text-[10px] font-bold uppercase tracking-wide\">{fileType}</span>}\n </span>\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium\">{name}</p>\n {meta && <p className=\"mt-0.5 truncate text-xs text-muted-foreground\">{meta}</p>}\n </div>\n <Badge variant={statusInfo.variant}>{statusInfo.label}</Badge>\n {onDownload && (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={onDownload}\n disabled={status !== 'available'}\n aria-label={`${downloadLabel} ${name}`}\n >\n {downloadLabel}\n </Button>\n )}\n </CardContent>\n </Card>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2DmB;AA3DnB,YAAuB;AACvB,gBAAmB;AACnB,mBAAsB;AACtB,oBAAuB;AACvB,kBAAkC;AAuBlC,MAAM,eAAmG;AAAA,EACvG,WAAW,EAAE,OAAO,aAAa,SAAS,UAAU;AAAA,EACpD,YAAY,EAAE,OAAO,cAAc,SAAS,UAAU;AAAA,EACtD,SAAS,EAAE,OAAO,WAAW,SAAS,OAAO;AAC/C;AAMO,MAAM,eAAe,MAAM,WAA2C,SAASA,cACpF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,gBAAgB;AAAA,EAChB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,aAAa,aAAa,MAAM;AACtC,QAAM,OAAO,CAAC,UAAU,MAAM,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,QAAK;AAEnE,SACE,4CAAC,oBAAK,KAAmB,eAAW,cAAG,UAAU,SAAS,GAAI,GAAG,OAC/D,uDAAC,2BAAY,WAAU,+BACrB;AAAA,gDAAC,UAAK,WAAU,4GACb,kBAAQ,4CAAC,UAAK,WAAU,iDAAiD,oBAAS,GACrF;AAAA,IACA,6CAAC,SAAI,WAAU,kBACb;AAAA,kDAAC,OAAE,WAAU,gCAAgC,gBAAK;AAAA,MACjD,QAAQ,4CAAC,OAAE,WAAU,iDAAiD,gBAAK;AAAA,OAC9E;AAAA,IACA,4CAAC,sBAAM,SAAS,WAAW,SAAU,qBAAW,OAAM;AAAA,IACrD,cACC;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,SAAS;AAAA,QACT,UAAU,WAAW;AAAA,QACrB,cAAY,GAAG,aAAa,IAAI,IAAI;AAAA,QAEnC;AAAA;AAAA,IACH;AAAA,KAEJ,GACF;AAEJ,CAAC;","names":["DocumentCard"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../utils/cn.mjs";
|
|
4
|
+
import { Badge } from "../badge/Badge.mjs";
|
|
5
|
+
import { Button } from "../button/Button.mjs";
|
|
6
|
+
import { Card, CardContent } from "../card/Card.mjs";
|
|
7
|
+
const statusConfig = {
|
|
8
|
+
available: { label: "Available", variant: "success" },
|
|
9
|
+
restricted: { label: "Restricted", variant: "warning" },
|
|
10
|
+
pending: { label: "Pending", variant: "info" }
|
|
11
|
+
};
|
|
12
|
+
const DocumentCard = React.forwardRef(function DocumentCard2({
|
|
13
|
+
name,
|
|
14
|
+
fileType,
|
|
15
|
+
size,
|
|
16
|
+
updatedAt,
|
|
17
|
+
status = "available",
|
|
18
|
+
onDownload,
|
|
19
|
+
downloadLabel = "Download",
|
|
20
|
+
icon,
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}, ref) {
|
|
24
|
+
const statusInfo = statusConfig[status];
|
|
25
|
+
const meta = [fileType, size, updatedAt].filter(Boolean).join(" \xB7 ");
|
|
26
|
+
return /* @__PURE__ */ jsx(Card, { ref, className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs(CardContent, { className: "flex items-center gap-3 p-4", children: [
|
|
27
|
+
/* @__PURE__ */ jsx("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary [&_svg]:size-5", children: icon ?? /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold uppercase tracking-wide", children: fileType }) }),
|
|
28
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
29
|
+
/* @__PURE__ */ jsx("p", { className: "truncate text-sm font-medium", children: name }),
|
|
30
|
+
meta && /* @__PURE__ */ jsx("p", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: meta })
|
|
31
|
+
] }),
|
|
32
|
+
/* @__PURE__ */ jsx(Badge, { variant: statusInfo.variant, children: statusInfo.label }),
|
|
33
|
+
onDownload && /* @__PURE__ */ jsx(
|
|
34
|
+
Button,
|
|
35
|
+
{
|
|
36
|
+
type: "button",
|
|
37
|
+
variant: "outline",
|
|
38
|
+
size: "sm",
|
|
39
|
+
onClick: onDownload,
|
|
40
|
+
disabled: status !== "available",
|
|
41
|
+
"aria-label": `${downloadLabel} ${name}`,
|
|
42
|
+
children: downloadLabel
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
] }) });
|
|
46
|
+
});
|
|
47
|
+
export {
|
|
48
|
+
DocumentCard
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=DocumentCard.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/document-card/DocumentCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { Badge } from '../badge/Badge';\nimport { Button } from '../button/Button';\nimport { Card, CardContent } from '../card/Card';\n\nexport type DocumentStatus = 'available' | 'restricted' | 'pending';\n\nexport type DocumentCardProps = React.HTMLAttributes<HTMLElement> & {\n /** File name. */\n name: string;\n /** Short file type label, such as PDF or XLSX. */\n fileType: string;\n /** Human-readable file size. */\n size?: string;\n /** Updated date or relative time. */\n updatedAt?: string;\n /** Access state. Default 'available'. */\n status?: DocumentStatus;\n /** Download handler. Omit to render a display-only row. */\n onDownload?: () => void;\n /** Download button label. Default \"Download\". */\n downloadLabel?: string;\n /** Custom file icon slot. */\n icon?: React.ReactNode;\n};\n\nconst statusConfig: Record<DocumentStatus, { label: string; variant: 'success' | 'warning' | 'info' }> = {\n available: { label: 'Available', variant: 'success' },\n restricted: { label: 'Restricted', variant: 'warning' },\n pending: { label: 'Pending', variant: 'info' },\n};\n\n/**\n * Document row for a deal room or diligence list. The row states the access\n * status and only exposes the download action when a handler is provided.\n */\nexport const DocumentCard = React.forwardRef<HTMLElement, DocumentCardProps>(function DocumentCard(\n {\n name,\n fileType,\n size,\n updatedAt,\n status = 'available',\n onDownload,\n downloadLabel = 'Download',\n icon,\n className,\n ...props\n },\n ref\n) {\n const statusInfo = statusConfig[status];\n const meta = [fileType, size, updatedAt].filter(Boolean).join(' · ');\n\n return (\n <Card ref={ref as never} className={cn('w-full', className)} {...props}>\n <CardContent className=\"flex items-center gap-3 p-4\">\n <span className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary [&_svg]:size-5\">\n {icon ?? <span className=\"text-[10px] font-bold uppercase tracking-wide\">{fileType}</span>}\n </span>\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium\">{name}</p>\n {meta && <p className=\"mt-0.5 truncate text-xs text-muted-foreground\">{meta}</p>}\n </div>\n <Badge variant={statusInfo.variant}>{statusInfo.label}</Badge>\n {onDownload && (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={onDownload}\n disabled={status !== 'available'}\n aria-label={`${downloadLabel} ${name}`}\n >\n {downloadLabel}\n </Button>\n )}\n </CardContent>\n </Card>\n );\n});\n"],"mappings":"AA2DmB,cAEX,YAFW;AA3DnB,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,MAAM,mBAAmB;AAuBlC,MAAM,eAAmG;AAAA,EACvG,WAAW,EAAE,OAAO,aAAa,SAAS,UAAU;AAAA,EACpD,YAAY,EAAE,OAAO,cAAc,SAAS,UAAU;AAAA,EACtD,SAAS,EAAE,OAAO,WAAW,SAAS,OAAO;AAC/C;AAMO,MAAM,eAAe,MAAM,WAA2C,SAASA,cACpF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,gBAAgB;AAAA,EAChB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,aAAa,aAAa,MAAM;AACtC,QAAM,OAAO,CAAC,UAAU,MAAM,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,QAAK;AAEnE,SACE,oBAAC,QAAK,KAAmB,WAAW,GAAG,UAAU,SAAS,GAAI,GAAG,OAC/D,+BAAC,eAAY,WAAU,+BACrB;AAAA,wBAAC,UAAK,WAAU,4GACb,kBAAQ,oBAAC,UAAK,WAAU,iDAAiD,oBAAS,GACrF;AAAA,IACA,qBAAC,SAAI,WAAU,kBACb;AAAA,0BAAC,OAAE,WAAU,gCAAgC,gBAAK;AAAA,MACjD,QAAQ,oBAAC,OAAE,WAAU,iDAAiD,gBAAK;AAAA,OAC9E;AAAA,IACA,oBAAC,SAAM,SAAS,WAAW,SAAU,qBAAW,OAAM;AAAA,IACrD,cACC;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,SAAS;AAAA,QACT,UAAU,WAAW;AAAA,QACrB,cAAY,GAAG,aAAa,IAAI,IAAI;AAAA,QAEnC;AAAA;AAAA,IACH;AAAA,KAEJ,GACF;AAEJ,CAAC;","names":["DocumentCard"]}
|
|
@@ -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 document_card_exports = {};
|
|
20
|
+
__export(document_card_exports, {
|
|
21
|
+
DocumentCard: () => import_DocumentCard.DocumentCard
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(document_card_exports);
|
|
24
|
+
var import_DocumentCard = require("./DocumentCard.js");
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
DocumentCard
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/document-card/index.ts"],"sourcesContent":["export { DocumentCard } from './DocumentCard';\nexport type { DocumentCardProps, DocumentStatus } from './DocumentCard';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/document-card/index.ts"],"sourcesContent":["export { DocumentCard } from './DocumentCard';\nexport type { DocumentCardProps, DocumentStatus } from './DocumentCard';\n"],"mappings":"AAAA,SAAS,oBAAoB;","names":[]}
|
|
@@ -3,7 +3,14 @@ export type DrawerSide = 'left' | 'right' | 'top' | 'bottom';
|
|
|
3
3
|
export type DrawerSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
4
4
|
export type DrawerProps = {
|
|
5
5
|
open: boolean;
|
|
6
|
-
|
|
6
|
+
/** Called with the next open state. Alias: onClose (close requests only). */
|
|
7
|
+
onOpenChange?: (open: boolean) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Called when the drawer asks to close: Escape, backdrop click or the close
|
|
10
|
+
* button. Alias for `onOpenChange(false)`, used when only a close handler is
|
|
11
|
+
* passed.
|
|
12
|
+
*/
|
|
13
|
+
onClose?: () => void;
|
|
7
14
|
title: string;
|
|
8
15
|
description?: string;
|
|
9
16
|
children?: React.ReactNode;
|
|
@@ -21,6 +28,22 @@ export type DrawerProps = {
|
|
|
21
28
|
* ("60vh"). Overrides `size`.
|
|
22
29
|
*/
|
|
23
30
|
height?: number | string;
|
|
31
|
+
/**
|
|
32
|
+
* Drag the inner edge to resize a left/right drawer. Keyboard: Arrow keys
|
|
33
|
+
* nudge 16px, Shift+Arrow 64px, Home/End jump to the bounds. Ignored for
|
|
34
|
+
* top/bottom drawers.
|
|
35
|
+
*/
|
|
36
|
+
resizable?: boolean;
|
|
37
|
+
/** Lower bound in pixels while resizable (default 240). */
|
|
38
|
+
minWidth?: number;
|
|
39
|
+
/** Upper bound in pixels while resizable (default 960). */
|
|
40
|
+
maxWidth?: number;
|
|
41
|
+
/** Initial width in pixels while resizable; defaults to the `size` preset. */
|
|
42
|
+
defaultWidth?: number;
|
|
43
|
+
/** Fired with the next width in pixels when a resize commits. */
|
|
44
|
+
onWidthChange?: (width: number) => void;
|
|
45
|
+
/** Accessible label for the resize handle (default "Resize drawer"). */
|
|
46
|
+
resizeLabel?: string;
|
|
24
47
|
/** Clicking the backdrop closes (default true). */
|
|
25
48
|
closeOnBackdrop?: boolean;
|
|
26
49
|
/** Hide the close (✕) button in the header (default true). */
|
|
@@ -45,4 +68,4 @@ export type DrawerProps = {
|
|
|
45
68
|
* restoration on close. Renders fixed to the chosen edge with a border
|
|
46
69
|
* against the backdrop.
|
|
47
70
|
*/
|
|
48
|
-
export declare function Drawer({ open, onOpenChange, title, description, children, side, size, width, height, closeOnBackdrop, showClose, closeLabel, initialFocusRef, ariaLabel, animate, }: DrawerProps): React.ReactPortal | null;
|
|
71
|
+
export declare function Drawer({ open, onOpenChange, onClose, title, description, children, side, size, width, height, resizable, minWidth, maxWidth, defaultWidth, onWidthChange, resizeLabel, closeOnBackdrop, showClose, closeLabel, initialFocusRef, ariaLabel, animate, }: DrawerProps): React.ReactPortal | null;
|
|
@@ -65,6 +65,13 @@ const sizeClasses = {
|
|
|
65
65
|
top: sideHeights,
|
|
66
66
|
bottom: sideHeights
|
|
67
67
|
};
|
|
68
|
+
const sizePx = {
|
|
69
|
+
sm: 288,
|
|
70
|
+
md: 384,
|
|
71
|
+
lg: 512,
|
|
72
|
+
xl: 640,
|
|
73
|
+
"2xl": 768
|
|
74
|
+
};
|
|
68
75
|
function extentStyle(value) {
|
|
69
76
|
if (value === void 0) return void 0;
|
|
70
77
|
return typeof value === "number" ? `${value}px` : value;
|
|
@@ -84,6 +91,7 @@ const slideOut = {
|
|
|
84
91
|
function Drawer({
|
|
85
92
|
open,
|
|
86
93
|
onOpenChange,
|
|
94
|
+
onClose,
|
|
87
95
|
title,
|
|
88
96
|
description,
|
|
89
97
|
children,
|
|
@@ -91,6 +99,12 @@ function Drawer({
|
|
|
91
99
|
size = "md",
|
|
92
100
|
width,
|
|
93
101
|
height,
|
|
102
|
+
resizable = false,
|
|
103
|
+
minWidth = 240,
|
|
104
|
+
maxWidth = 960,
|
|
105
|
+
defaultWidth,
|
|
106
|
+
onWidthChange,
|
|
107
|
+
resizeLabel = "Resize drawer",
|
|
94
108
|
closeOnBackdrop = true,
|
|
95
109
|
showClose = true,
|
|
96
110
|
closeLabel = "Close drawer",
|
|
@@ -104,6 +118,65 @@ function Drawer({
|
|
|
104
118
|
const descriptionId = React.useId();
|
|
105
119
|
const { present, exiting } = (0, import_presence.usePresence)(open, animate);
|
|
106
120
|
const isTopLayer = (0, import_modal_layer.useModalLayer)(open);
|
|
121
|
+
const requestClose = React.useCallback(() => {
|
|
122
|
+
if (onOpenChange) onOpenChange(false);
|
|
123
|
+
else onClose?.();
|
|
124
|
+
}, [onOpenChange, onClose]);
|
|
125
|
+
const isVerticalSide = side === "top" || side === "bottom";
|
|
126
|
+
const canResize = resizable && !isVerticalSide;
|
|
127
|
+
const clampWidth = React.useCallback(
|
|
128
|
+
(next) => Math.min(maxWidth, Math.max(minWidth, Math.round(next))),
|
|
129
|
+
[minWidth, maxWidth]
|
|
130
|
+
);
|
|
131
|
+
const [resizedWidth, setResizedWidth] = React.useState(null);
|
|
132
|
+
const initialWidth = clampWidth(
|
|
133
|
+
defaultWidth ?? (typeof width === "number" ? width : sizePx[size])
|
|
134
|
+
);
|
|
135
|
+
const resizeWidth = resizedWidth ?? initialWidth;
|
|
136
|
+
const widthRef = React.useRef(resizeWidth);
|
|
137
|
+
widthRef.current = resizeWidth;
|
|
138
|
+
const onWidthChangeRef = React.useRef(onWidthChange);
|
|
139
|
+
onWidthChangeRef.current = onWidthChange;
|
|
140
|
+
const commitWidth = (next) => {
|
|
141
|
+
const clamped = clampWidth(next);
|
|
142
|
+
setResizedWidth(clamped);
|
|
143
|
+
onWidthChangeRef.current?.(clamped);
|
|
144
|
+
};
|
|
145
|
+
const onResizePointerDown = (event) => {
|
|
146
|
+
if (event.button !== 0) return;
|
|
147
|
+
event.preventDefault();
|
|
148
|
+
const startX = event.clientX;
|
|
149
|
+
const startWidth = resizeWidth;
|
|
150
|
+
const onMove = (moveEvent) => {
|
|
151
|
+
const delta = side === "right" ? startX - moveEvent.clientX : moveEvent.clientX - startX;
|
|
152
|
+
setResizedWidth(clampWidth(startWidth + delta));
|
|
153
|
+
};
|
|
154
|
+
const onUp = () => {
|
|
155
|
+
window.removeEventListener("pointermove", onMove);
|
|
156
|
+
window.removeEventListener("pointerup", onUp);
|
|
157
|
+
onWidthChangeRef.current?.(widthRef.current);
|
|
158
|
+
};
|
|
159
|
+
window.addEventListener("pointermove", onMove);
|
|
160
|
+
window.addEventListener("pointerup", onUp);
|
|
161
|
+
};
|
|
162
|
+
const onResizeKeyDown = (event) => {
|
|
163
|
+
const step = event.shiftKey ? 64 : 16;
|
|
164
|
+
const grow = side === "right" ? "ArrowLeft" : "ArrowRight";
|
|
165
|
+
const shrink = side === "right" ? "ArrowRight" : "ArrowLeft";
|
|
166
|
+
if (event.key === grow) {
|
|
167
|
+
event.preventDefault();
|
|
168
|
+
commitWidth(resizeWidth + step);
|
|
169
|
+
} else if (event.key === shrink) {
|
|
170
|
+
event.preventDefault();
|
|
171
|
+
commitWidth(resizeWidth - step);
|
|
172
|
+
} else if (event.key === "Home") {
|
|
173
|
+
event.preventDefault();
|
|
174
|
+
commitWidth(minWidth);
|
|
175
|
+
} else if (event.key === "End") {
|
|
176
|
+
event.preventDefault();
|
|
177
|
+
commitWidth(maxWidth);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
107
180
|
React.useEffect(() => {
|
|
108
181
|
if (open) {
|
|
109
182
|
previouslyFocused.current = document.activeElement;
|
|
@@ -124,7 +197,7 @@ function Drawer({
|
|
|
124
197
|
if (event.key === "Escape") {
|
|
125
198
|
if (!isTopLayer()) return;
|
|
126
199
|
event.stopPropagation();
|
|
127
|
-
|
|
200
|
+
requestClose();
|
|
128
201
|
return;
|
|
129
202
|
}
|
|
130
203
|
if (event.key !== "Tab") return;
|
|
@@ -148,10 +221,9 @@ function Drawer({
|
|
|
148
221
|
};
|
|
149
222
|
document.addEventListener("keydown", onKeyDown);
|
|
150
223
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
151
|
-
}, [open,
|
|
224
|
+
}, [open, requestClose, isTopLayer]);
|
|
152
225
|
if (!present || typeof document === "undefined") return null;
|
|
153
|
-
const
|
|
154
|
-
const customExtent = isVerticalSide ? extentStyle(height) : extentStyle(width);
|
|
226
|
+
const customExtent = canResize ? `${resizeWidth}px` : isVerticalSide ? extentStyle(height) : extentStyle(width);
|
|
155
227
|
const motion = animate ? (0, import_cn.cn)(
|
|
156
228
|
"duration-200 motion-reduce:animate-none",
|
|
157
229
|
exiting ? `animate-out ${slideOut[side]}` : `animate-in ${slideIn[side]}`
|
|
@@ -162,7 +234,7 @@ function Drawer({
|
|
|
162
234
|
{
|
|
163
235
|
className: "fixed inset-0 z-50",
|
|
164
236
|
onMouseDown: (event) => {
|
|
165
|
-
if (closeOnBackdrop && event.target === event.currentTarget)
|
|
237
|
+
if (closeOnBackdrop && event.target === event.currentTarget) requestClose();
|
|
166
238
|
},
|
|
167
239
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
168
240
|
"div",
|
|
@@ -182,6 +254,25 @@ function Drawer({
|
|
|
182
254
|
),
|
|
183
255
|
style: customExtent ? { [isVerticalSide ? "height" : "width"]: customExtent } : void 0,
|
|
184
256
|
children: [
|
|
257
|
+
canResize && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
258
|
+
"div",
|
|
259
|
+
{
|
|
260
|
+
role: "separator",
|
|
261
|
+
"aria-orientation": "vertical",
|
|
262
|
+
"aria-label": resizeLabel,
|
|
263
|
+
"aria-valuenow": resizeWidth,
|
|
264
|
+
"aria-valuemin": minWidth,
|
|
265
|
+
"aria-valuemax": maxWidth,
|
|
266
|
+
tabIndex: 0,
|
|
267
|
+
onPointerDown: onResizePointerDown,
|
|
268
|
+
onKeyDown: onResizeKeyDown,
|
|
269
|
+
className: (0, import_cn.cn)(
|
|
270
|
+
"absolute inset-y-0 z-10 w-2 cursor-col-resize touch-none rounded-sm bg-transparent",
|
|
271
|
+
"hover:bg-primary/20 focus-visible:bg-primary/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
272
|
+
side === "right" ? "-left-1" : "-right-1"
|
|
273
|
+
)
|
|
274
|
+
}
|
|
275
|
+
),
|
|
185
276
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-start justify-between gap-4 border-b border-border px-5 py-4", children: [
|
|
186
277
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
187
278
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { id: titleId, className: "text-base font-semibold leading-tight", children: title }),
|
|
@@ -191,7 +282,7 @@ function Drawer({
|
|
|
191
282
|
"button",
|
|
192
283
|
{
|
|
193
284
|
type: "button",
|
|
194
|
-
onClick:
|
|
285
|
+
onClick: requestClose,
|
|
195
286
|
"aria-label": closeLabel,
|
|
196
287
|
className: "-me-1 rounded p-1 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
197
288
|
children: "\u2715"
|