@tryghost/shade 0.0.0-stage → 0.1.0-alpha.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/LICENSE +22 -0
- package/README.md +142 -2
- package/es/app.js +4 -0
- package/es/assets/images/index.js +2 -0
- package/es/components/layout/error-page.js +40 -0
- package/es/components/layout/error-page.js.map +1 -0
- package/es/components/layout/heading.js +80 -0
- package/es/components/layout/heading.js.map +1 -0
- package/es/components/page-templates/detail-page.js +73 -0
- package/es/components/page-templates/detail-page.js.map +1 -0
- package/es/components/page-templates/large-page-title.js +89 -0
- package/es/components/page-templates/large-page-title.js.map +1 -0
- package/es/components/page-templates/list-page.js +174 -0
- package/es/components/page-templates/list-page.js.map +1 -0
- package/es/components/page-templates/modal-page.js +32 -0
- package/es/components/page-templates/modal-page.js.map +1 -0
- package/es/components/patterns/color-picker.js +328 -0
- package/es/components/patterns/color-picker.js.map +1 -0
- package/es/components/patterns/dirty-confirm-dialog.js +44 -0
- package/es/components/patterns/dirty-confirm-dialog.js.map +1 -0
- package/es/components/patterns/filter-bar-context.js +8 -0
- package/es/components/patterns/filter-bar-context.js.map +1 -0
- package/es/components/patterns/filter-bar.js +67 -0
- package/es/components/patterns/filter-bar.js.map +1 -0
- package/es/components/patterns/filters-helpers.js +415 -0
- package/es/components/patterns/filters-helpers.js.map +1 -0
- package/es/components/patterns/filters.js +1816 -0
- package/es/components/patterns/filters.js.map +1 -0
- package/es/components/patterns/gh-chart.js +152 -0
- package/es/components/patterns/gh-chart.js.map +1 -0
- package/es/components/patterns/image-upload-variants.js +13 -0
- package/es/components/patterns/image-upload-variants.js.map +1 -0
- package/es/components/patterns/image-upload.js +63 -0
- package/es/components/patterns/image-upload.js.map +1 -0
- package/es/components/patterns/kpi-card.js +46 -0
- package/es/components/patterns/kpi-card.js.map +1 -0
- package/es/components/patterns/kpi-tabs.js +61 -0
- package/es/components/patterns/kpi-tabs.js.map +1 -0
- package/es/components/patterns/page-header-large-title.js +13 -0
- package/es/components/patterns/page-header-large-title.js.map +1 -0
- package/es/components/patterns/page-header.js +375 -0
- package/es/components/patterns/page-header.js.map +1 -0
- package/es/components/patterns/setting-group-variants.js +22 -0
- package/es/components/patterns/setting-group-variants.js.map +1 -0
- package/es/components/patterns/setting-group.js +103 -0
- package/es/components/patterns/setting-group.js.map +1 -0
- package/es/components/patterns/settings-modal-variants.js +37 -0
- package/es/components/patterns/settings-modal-variants.js.map +1 -0
- package/es/components/patterns/settings-modal.js +192 -0
- package/es/components/patterns/settings-modal.js.map +1 -0
- package/es/components/patterns/share-modal.js +264 -0
- package/es/components/patterns/share-modal.js.map +1 -0
- package/es/components/patterns/use-dirty-confirmation.js +35 -0
- package/es/components/patterns/use-dirty-confirmation.js.map +1 -0
- package/es/components/patterns/view-bar.js +40 -0
- package/es/components/patterns/view-bar.js.map +1 -0
- package/es/components/primitives/box.js +25 -0
- package/es/components/primitives/box.js.map +1 -0
- package/es/components/primitives/container.js +35 -0
- package/es/components/primitives/container.js.map +1 -0
- package/es/components/primitives/grid.js +26 -0
- package/es/components/primitives/grid.js.map +1 -0
- package/es/components/primitives/index.js +7 -0
- package/es/components/primitives/inline.js +17 -0
- package/es/components/primitives/inline.js.map +1 -0
- package/es/components/primitives/stack.js +17 -0
- package/es/components/primitives/stack.js.map +1 -0
- package/es/components/primitives/text.js +48 -0
- package/es/components/primitives/text.js.map +1 -0
- package/es/components/primitives/types.js +56 -0
- package/es/components/primitives/types.js.map +1 -0
- package/es/components/ui/accordion.js +37 -0
- package/es/components/ui/accordion.js.map +1 -0
- package/es/components/ui/action-list.js +56 -0
- package/es/components/ui/action-list.js.map +1 -0
- package/es/components/ui/alert-dialog.js +80 -0
- package/es/components/ui/alert-dialog.js.map +1 -0
- package/es/components/ui/animated-number.js +14 -0
- package/es/components/ui/animated-number.js.map +1 -0
- package/es/components/ui/avatar.js +52 -0
- package/es/components/ui/avatar.js.map +1 -0
- package/es/components/ui/badge-variants.js +32 -0
- package/es/components/ui/badge-variants.js.map +1 -0
- package/es/components/ui/badge.js +22 -0
- package/es/components/ui/badge.js.map +1 -0
- package/es/components/ui/banner-variants.js +34 -0
- package/es/components/ui/banner-variants.js.map +1 -0
- package/es/components/ui/banner.js +37 -0
- package/es/components/ui/banner.js.map +1 -0
- package/es/components/ui/breadcrumb.js +64 -0
- package/es/components/ui/breadcrumb.js.map +1 -0
- package/es/components/ui/button-variants.js +137 -0
- package/es/components/ui/button-variants.js.map +1 -0
- package/es/components/ui/button.js +35 -0
- package/es/components/ui/button.js.map +1 -0
- package/es/components/ui/calendar.js +119 -0
- package/es/components/ui/calendar.js.map +1 -0
- package/es/components/ui/card-variants.js +13 -0
- package/es/components/ui/card-variants.js.map +1 -0
- package/es/components/ui/card.js +98 -0
- package/es/components/ui/card.js.map +1 -0
- package/es/components/ui/chart.js +188 -0
- package/es/components/ui/chart.js.map +1 -0
- package/es/components/ui/checkbox.js +21 -0
- package/es/components/ui/checkbox.js.map +1 -0
- package/es/components/ui/code-editor-view.js +150 -0
- package/es/components/ui/code-editor-view.js.map +1 -0
- package/es/components/ui/code-editor.js +18 -0
- package/es/components/ui/code-editor.js.map +1 -0
- package/es/components/ui/combobox.js +37 -0
- package/es/components/ui/combobox.js.map +1 -0
- package/es/components/ui/command.js +91 -0
- package/es/components/ui/command.js.map +1 -0
- package/es/components/ui/context-menu.js +82 -0
- package/es/components/ui/context-menu.js.map +1 -0
- package/es/components/ui/copy-field.js +142 -0
- package/es/components/ui/copy-field.js.map +1 -0
- package/es/components/ui/data-list.js +103 -0
- package/es/components/ui/data-list.js.map +1 -0
- package/es/components/ui/dialog.js +49 -0
- package/es/components/ui/dialog.js.map +1 -0
- package/es/components/ui/dropdown-menu.js +86 -0
- package/es/components/ui/dropdown-menu.js.map +1 -0
- package/es/components/ui/dropzone-variants.js +30 -0
- package/es/components/ui/dropzone-variants.js.map +1 -0
- package/es/components/ui/dropzone.js +55 -0
- package/es/components/ui/dropzone.js.map +1 -0
- package/es/components/ui/empty-indicator.js +42 -0
- package/es/components/ui/empty-indicator.js.map +1 -0
- package/es/components/ui/field.js +118 -0
- package/es/components/ui/field.js.map +1 -0
- package/es/components/ui/flag.js +30 -0
- package/es/components/ui/flag.js.map +1 -0
- package/es/components/ui/floating-sidebar-metrics.js +56 -0
- package/es/components/ui/floating-sidebar-metrics.js.map +1 -0
- package/es/components/ui/floating-sidebar.js +522 -0
- package/es/components/ui/floating-sidebar.js.map +1 -0
- package/es/components/ui/form-context.js +25 -0
- package/es/components/ui/form-context.js.map +1 -0
- package/es/components/ui/form.js +75 -0
- package/es/components/ui/form.js.map +1 -0
- package/es/components/ui/hover-card.js +20 -0
- package/es/components/ui/hover-card.js.map +1 -0
- package/es/components/ui/icon.js +2 -0
- package/es/components/ui/image-overlay-button.js +14 -0
- package/es/components/ui/image-overlay-button.js.map +1 -0
- package/es/components/ui/indicator-variants.js +63 -0
- package/es/components/ui/indicator-variants.js.map +1 -0
- package/es/components/ui/indicator.js +26 -0
- package/es/components/ui/indicator.js.map +1 -0
- package/es/components/ui/input-group-variants.js +25 -0
- package/es/components/ui/input-group-variants.js.map +1 -0
- package/es/components/ui/input-group.js +90 -0
- package/es/components/ui/input-group.js.map +1 -0
- package/es/components/ui/input-surface.js +51 -0
- package/es/components/ui/input-surface.js.map +1 -0
- package/es/components/ui/input.js +18 -0
- package/es/components/ui/input.js.map +1 -0
- package/es/components/ui/kbd.js +29 -0
- package/es/components/ui/kbd.js.map +1 -0
- package/es/components/ui/label.js +17 -0
- package/es/components/ui/label.js.map +1 -0
- package/es/components/ui/link.js +30 -0
- package/es/components/ui/link.js.map +1 -0
- package/es/components/ui/loading-indicator.js +50 -0
- package/es/components/ui/loading-indicator.js.map +1 -0
- package/es/components/ui/metric-value.js +39 -0
- package/es/components/ui/metric-value.js.map +1 -0
- package/es/components/ui/multi-select-combobox.js +205 -0
- package/es/components/ui/multi-select-combobox.js.map +1 -0
- package/es/components/ui/navbar.js +41 -0
- package/es/components/ui/navbar.js.map +1 -0
- package/es/components/ui/no-value-label.js +19 -0
- package/es/components/ui/no-value-label.js.map +1 -0
- package/es/components/ui/pagemenu.js +138 -0
- package/es/components/ui/pagemenu.js.map +1 -0
- package/es/components/ui/popover.js +24 -0
- package/es/components/ui/popover.js.map +1 -0
- package/es/components/ui/preview-chrome-variants.js +13 -0
- package/es/components/ui/preview-chrome-variants.js.map +1 -0
- package/es/components/ui/preview-chrome.js +27 -0
- package/es/components/ui/preview-chrome.js.map +1 -0
- package/es/components/ui/radio-group-variants.js +14 -0
- package/es/components/ui/radio-group-variants.js.map +1 -0
- package/es/components/ui/radio-group.js +33 -0
- package/es/components/ui/radio-group.js.map +1 -0
- package/es/components/ui/select-variants.js +45 -0
- package/es/components/ui/select-variants.js.map +1 -0
- package/es/components/ui/select.js +90 -0
- package/es/components/ui/select.js.map +1 -0
- package/es/components/ui/separator.js +17 -0
- package/es/components/ui/separator.js.map +1 -0
- package/es/components/ui/sheet.js +67 -0
- package/es/components/ui/sheet.js.map +1 -0
- package/es/components/ui/sidebar-context.js +12 -0
- package/es/components/ui/sidebar-context.js.map +1 -0
- package/es/components/ui/sidebar.js +384 -0
- package/es/components/ui/sidebar.js.map +1 -0
- package/es/components/ui/simple-pagination.js +68 -0
- package/es/components/ui/simple-pagination.js.map +1 -0
- package/es/components/ui/skeleton.js +77 -0
- package/es/components/ui/skeleton.js.map +1 -0
- package/es/components/ui/sonner.js +29 -0
- package/es/components/ui/sonner.js.map +1 -0
- package/es/components/ui/sortable-list.js +107 -0
- package/es/components/ui/sortable-list.js.map +1 -0
- package/es/components/ui/sticky-footer.js +29 -0
- package/es/components/ui/sticky-footer.js.map +1 -0
- package/es/components/ui/switch.js +34 -0
- package/es/components/ui/switch.js.map +1 -0
- package/es/components/ui/table.js +81 -0
- package/es/components/ui/table.js.map +1 -0
- package/es/components/ui/tabs-variants.js +19 -0
- package/es/components/ui/tabs-variants.js.map +1 -0
- package/es/components/ui/tabs.js +157 -0
- package/es/components/ui/tabs.js.map +1 -0
- package/es/components/ui/textarea.js +17 -0
- package/es/components/ui/textarea.js.map +1 -0
- package/es/components/ui/time-picker.js +33 -0
- package/es/components/ui/time-picker.js.map +1 -0
- package/es/components/ui/toggle-group.js +52 -0
- package/es/components/ui/toggle-group.js.map +1 -0
- package/es/components/ui/toggle-variants.js +34 -0
- package/es/components/ui/toggle-variants.js.map +1 -0
- package/es/components/ui/toggle.js +29 -0
- package/es/components/ui/toggle.js.map +1 -0
- package/es/components/ui/token-field.js +14 -0
- package/es/components/ui/token-field.js.map +1 -0
- package/es/components/ui/tooltip.js +116 -0
- package/es/components/ui/tooltip.js.map +1 -0
- package/es/components/ui/trend-badge.js +77 -0
- package/es/components/ui/trend-badge.js.map +1 -0
- package/es/components.js +79 -0
- package/es/hooks/use-global-dirty-state.js +21 -0
- package/es/hooks/use-global-dirty-state.js.map +1 -0
- package/es/hooks/use-mobile.js +23 -0
- package/es/hooks/use-mobile.js.map +1 -0
- package/es/hooks/use-simple-pagination.js +45 -0
- package/es/hooks/use-simple-pagination.js.map +1 -0
- package/es/icon-BJcGsQ4b.js +185 -0
- package/es/icon-BJcGsQ4b.js.map +1 -0
- package/es/images-CUcakpOD.js +124 -0
- package/es/images-CUcakpOD.js.map +1 -0
- package/es/index.js +113 -0
- package/es/lib/ds-utils.js +214 -0
- package/es/lib/ds-utils.js.map +1 -0
- package/es/lib/overlay-escape.js +13 -0
- package/es/lib/overlay-escape.js.map +1 -0
- package/es/lib/utils.js +2 -0
- package/es/page-templates.js +5 -0
- package/es/patterns.js +19 -0
- package/es/primitives.js +9 -0
- package/es/providers/global-dirty-state-provider.js +25 -0
- package/es/providers/global-dirty-state-provider.js.map +1 -0
- package/es/providers/header-tooltip-provider.js +24 -0
- package/es/providers/header-tooltip-provider.js.map +1 -0
- package/es/providers/shade-context.js +19 -0
- package/es/providers/shade-context.js.map +1 -0
- package/es/providers/shade-provider.js +64 -0
- package/es/providers/shade-provider.js.map +1 -0
- package/es/shade-app.js +28 -0
- package/es/shade-app.js.map +1 -0
- package/es/shade-scope.js +20 -0
- package/es/shade-scope.js.map +1 -0
- package/es/tokens.js +370 -0
- package/es/tokens.js.map +1 -0
- package/es/utils.js +7 -0
- package/package.json +150 -3
- package/preflight.css +422 -0
- package/styles-published.css +2 -0
- package/styles.css +299 -0
- package/tailwind.theme.css +472 -0
- package/theme-variables.css +287 -0
- package/tokens.css +3 -0
- package/types/app.d.ts +6 -0
- package/types/app.d.ts.map +1 -0
- package/types/assets/images/index.d.ts +10 -0
- package/types/assets/images/index.d.ts.map +1 -0
- package/types/components/layout/error-page.d.ts +10 -0
- package/types/components/layout/error-page.d.ts.map +1 -0
- package/types/components/layout/heading.d.ts +29 -0
- package/types/components/layout/heading.d.ts.map +1 -0
- package/types/components/page-templates/detail-page.d.ts +32 -0
- package/types/components/page-templates/detail-page.d.ts.map +1 -0
- package/types/components/page-templates/large-page-title.d.ts +43 -0
- package/types/components/page-templates/large-page-title.d.ts.map +1 -0
- package/types/components/page-templates/list-page.d.ts +44 -0
- package/types/components/page-templates/list-page.d.ts.map +1 -0
- package/types/components/page-templates/modal-page.d.ts +13 -0
- package/types/components/page-templates/modal-page.d.ts.map +1 -0
- package/types/components/patterns/color-picker.d.ts +48 -0
- package/types/components/patterns/color-picker.d.ts.map +1 -0
- package/types/components/patterns/dirty-confirm-dialog.d.ts +16 -0
- package/types/components/patterns/dirty-confirm-dialog.d.ts.map +1 -0
- package/types/components/patterns/filter-bar-context.d.ts +4 -0
- package/types/components/patterns/filter-bar-context.d.ts.map +1 -0
- package/types/components/patterns/filter-bar.d.ts +27 -0
- package/types/components/patterns/filter-bar.d.ts.map +1 -0
- package/types/components/patterns/filters-helpers.d.ts +7 -0
- package/types/components/patterns/filters-helpers.d.ts.map +1 -0
- package/types/components/patterns/filters.d.ts +262 -0
- package/types/components/patterns/filters.d.ts.map +1 -0
- package/types/components/patterns/gh-chart.d.ts +44 -0
- package/types/components/patterns/gh-chart.d.ts.map +1 -0
- package/types/components/patterns/image-upload-variants.d.ts +5 -0
- package/types/components/patterns/image-upload-variants.d.ts.map +1 -0
- package/types/components/patterns/image-upload.d.ts +15 -0
- package/types/components/patterns/image-upload.d.ts.map +1 -0
- package/types/components/patterns/kpi-card.d.ts +12 -0
- package/types/components/patterns/kpi-card.d.ts.map +1 -0
- package/types/components/patterns/kpi-tabs.d.ts +26 -0
- package/types/components/patterns/kpi-tabs.d.ts.map +1 -0
- package/types/components/patterns/page-header-large-title.d.ts +14 -0
- package/types/components/patterns/page-header-large-title.d.ts.map +1 -0
- package/types/components/patterns/page-header.d.ts +99 -0
- package/types/components/patterns/page-header.d.ts.map +1 -0
- package/types/components/patterns/setting-group-variants.d.ts +6 -0
- package/types/components/patterns/setting-group-variants.d.ts.map +1 -0
- package/types/components/patterns/setting-group.d.ts +22 -0
- package/types/components/patterns/setting-group.d.ts.map +1 -0
- package/types/components/patterns/settings-modal-variants.d.ts +8 -0
- package/types/components/patterns/settings-modal-variants.d.ts.map +1 -0
- package/types/components/patterns/settings-modal.d.ts +50 -0
- package/types/components/patterns/settings-modal.d.ts.map +1 -0
- package/types/components/patterns/share-modal.d.ts +56 -0
- package/types/components/patterns/share-modal.d.ts.map +1 -0
- package/types/components/patterns/use-dirty-confirmation.d.ts +3 -0
- package/types/components/patterns/use-dirty-confirmation.d.ts.map +1 -0
- package/types/components/patterns/view-bar.d.ts +13 -0
- package/types/components/patterns/view-bar.d.ts.map +1 -0
- package/types/components/primitives/box.d.ts +12 -0
- package/types/components/primitives/box.d.ts.map +1 -0
- package/types/components/primitives/container.d.ts +11 -0
- package/types/components/primitives/container.d.ts.map +1 -0
- package/types/components/primitives/grid.d.ts +12 -0
- package/types/components/primitives/grid.d.ts.map +1 -0
- package/types/components/primitives/index.d.ts +10 -0
- package/types/components/primitives/index.d.ts.map +1 -0
- package/types/components/primitives/inline.d.ts +13 -0
- package/types/components/primitives/inline.d.ts.map +1 -0
- package/types/components/primitives/stack.d.ts +10 -0
- package/types/components/primitives/stack.d.ts.map +1 -0
- package/types/components/primitives/text.d.ts +18 -0
- package/types/components/primitives/text.d.ts.map +1 -0
- package/types/components/primitives/types.d.ts +10 -0
- package/types/components/primitives/types.d.ts.map +1 -0
- package/types/components/ui/accordion.d.ts +8 -0
- package/types/components/ui/accordion.d.ts.map +1 -0
- package/types/components/ui/action-list.d.ts +21 -0
- package/types/components/ui/action-list.d.ts.map +1 -0
- package/types/components/ui/alert-dialog.d.ts +24 -0
- package/types/components/ui/alert-dialog.d.ts.map +1 -0
- package/types/components/ui/animated-number.d.ts +6 -0
- package/types/components/ui/animated-number.d.ts.map +1 -0
- package/types/components/ui/avatar.d.ts +17 -0
- package/types/components/ui/avatar.d.ts.map +1 -0
- package/types/components/ui/badge-variants.d.ts +7 -0
- package/types/components/ui/badge-variants.d.ts.map +1 -0
- package/types/components/ui/badge.d.ts +9 -0
- package/types/components/ui/badge.d.ts.map +1 -0
- package/types/components/ui/banner-variants.d.ts +6 -0
- package/types/components/ui/banner-variants.d.ts.map +1 -0
- package/types/components/ui/banner.d.ts +24 -0
- package/types/components/ui/banner.d.ts.map +1 -0
- package/types/components/ui/breadcrumb.d.ts +20 -0
- package/types/components/ui/breadcrumb.d.ts.map +1 -0
- package/types/components/ui/button-variants.d.ts +8 -0
- package/types/components/ui/button-variants.d.ts.map +1 -0
- package/types/components/ui/button.d.ts +9 -0
- package/types/components/ui/button.d.ts.map +1 -0
- package/types/components/ui/calendar.d.ts +15 -0
- package/types/components/ui/calendar.d.ts.map +1 -0
- package/types/components/ui/card-variants.d.ts +5 -0
- package/types/components/ui/card-variants.d.ts.map +1 -0
- package/types/components/ui/card.d.ts +16 -0
- package/types/components/ui/card.d.ts.map +1 -0
- package/types/components/ui/chart.d.ts +90 -0
- package/types/components/ui/chart.d.ts.map +1 -0
- package/types/components/ui/checkbox.d.ts +5 -0
- package/types/components/ui/checkbox.d.ts.map +1 -0
- package/types/components/ui/code-editor-view.d.ts +17 -0
- package/types/components/ui/code-editor-view.d.ts.map +1 -0
- package/types/components/ui/code-editor.d.ts +7 -0
- package/types/components/ui/code-editor.d.ts.map +1 -0
- package/types/components/ui/combobox.d.ts +10 -0
- package/types/components/ui/combobox.d.ts.map +1 -0
- package/types/components/ui/command.d.ts +22 -0
- package/types/components/ui/command.d.ts.map +1 -0
- package/types/components/ui/context-menu.d.ts +29 -0
- package/types/components/ui/context-menu.d.ts.map +1 -0
- package/types/components/ui/copy-field.d.ts +19 -0
- package/types/components/ui/copy-field.d.ts.map +1 -0
- package/types/components/ui/data-list.d.ts +53 -0
- package/types/components/ui/data-list.d.ts.map +1 -0
- package/types/components/ui/dialog.d.ts +20 -0
- package/types/components/ui/dialog.d.ts.map +1 -0
- package/types/components/ui/dropdown-menu.d.ts +28 -0
- package/types/components/ui/dropdown-menu.d.ts.map +1 -0
- package/types/components/ui/dropzone-variants.d.ts +7 -0
- package/types/components/ui/dropzone-variants.d.ts.map +1 -0
- package/types/components/ui/dropzone.d.ts +28 -0
- package/types/components/ui/dropzone.d.ts.map +1 -0
- package/types/components/ui/empty-indicator.d.ts +16 -0
- package/types/components/ui/empty-indicator.d.ts.map +1 -0
- package/types/components/ui/field.d.ts +25 -0
- package/types/components/ui/field.d.ts.map +1 -0
- package/types/components/ui/flag.d.ts +11 -0
- package/types/components/ui/flag.d.ts.map +1 -0
- package/types/components/ui/floating-sidebar-metrics.d.ts +54 -0
- package/types/components/ui/floating-sidebar-metrics.d.ts.map +1 -0
- package/types/components/ui/floating-sidebar.d.ts +72 -0
- package/types/components/ui/floating-sidebar.d.ts.map +1 -0
- package/types/components/ui/form-context.d.ts +24 -0
- package/types/components/ui/form-context.d.ts.map +1 -0
- package/types/components/ui/form.d.ts +14 -0
- package/types/components/ui/form.d.ts.map +1 -0
- package/types/components/ui/hover-card.d.ts +7 -0
- package/types/components/ui/hover-card.d.ts.map +1 -0
- package/types/components/ui/icon.d.ts +13 -0
- package/types/components/ui/icon.d.ts.map +1 -0
- package/types/components/ui/image-overlay-button.d.ts +7 -0
- package/types/components/ui/image-overlay-button.d.ts.map +1 -0
- package/types/components/ui/indicator-variants.d.ts +11 -0
- package/types/components/ui/indicator-variants.d.ts.map +1 -0
- package/types/components/ui/indicator.d.ts +9 -0
- package/types/components/ui/indicator.d.ts.map +1 -0
- package/types/components/ui/input-group-variants.d.ts +6 -0
- package/types/components/ui/input-group-variants.d.ts.map +1 -0
- package/types/components/ui/input-group.d.ts +18 -0
- package/types/components/ui/input-group.d.ts.map +1 -0
- package/types/components/ui/input-surface.d.ts +43 -0
- package/types/components/ui/input-surface.d.ts.map +1 -0
- package/types/components/ui/input.d.ts +4 -0
- package/types/components/ui/input.d.ts.map +1 -0
- package/types/components/ui/kbd.d.ts +10 -0
- package/types/components/ui/kbd.d.ts.map +1 -0
- package/types/components/ui/label.d.ts +6 -0
- package/types/components/ui/label.d.ts.map +1 -0
- package/types/components/ui/link.d.ts +15 -0
- package/types/components/ui/link.d.ts.map +1 -0
- package/types/components/ui/loading-indicator.d.ts +12 -0
- package/types/components/ui/loading-indicator.d.ts.map +1 -0
- package/types/components/ui/metric-value.d.ts +16 -0
- package/types/components/ui/metric-value.d.ts.map +1 -0
- package/types/components/ui/multi-select-combobox.d.ts +80 -0
- package/types/components/ui/multi-select-combobox.d.ts.map +1 -0
- package/types/components/ui/navbar.d.ts +18 -0
- package/types/components/ui/navbar.d.ts.map +1 -0
- package/types/components/ui/no-value-label.d.ts +14 -0
- package/types/components/ui/no-value-label.d.ts.map +1 -0
- package/types/components/ui/pagemenu.d.ts +18 -0
- package/types/components/ui/pagemenu.d.ts.map +1 -0
- package/types/components/ui/popover.d.ts +9 -0
- package/types/components/ui/popover.d.ts.map +1 -0
- package/types/components/ui/preview-chrome-variants.d.ts +5 -0
- package/types/components/ui/preview-chrome-variants.d.ts.map +1 -0
- package/types/components/ui/preview-chrome.d.ts +8 -0
- package/types/components/ui/preview-chrome.d.ts.map +1 -0
- package/types/components/ui/radio-group-variants.d.ts +5 -0
- package/types/components/ui/radio-group-variants.d.ts.map +1 -0
- package/types/components/ui/radio-group.d.ts +9 -0
- package/types/components/ui/radio-group.d.ts.map +1 -0
- package/types/components/ui/select-variants.d.ts +7 -0
- package/types/components/ui/select-variants.d.ts.map +1 -0
- package/types/components/ui/select.d.ts +20 -0
- package/types/components/ui/select.d.ts.map +1 -0
- package/types/components/ui/separator.d.ts +5 -0
- package/types/components/ui/separator.d.ts.map +1 -0
- package/types/components/ui/sheet.d.ts +26 -0
- package/types/components/ui/sheet.d.ts.map +1 -0
- package/types/components/ui/sidebar-context.d.ts +15 -0
- package/types/components/ui/sidebar-context.d.ts.map +1 -0
- package/types/components/ui/sidebar.d.ts +56 -0
- package/types/components/ui/sidebar.d.ts.map +1 -0
- package/types/components/ui/simple-pagination.d.ts +16 -0
- package/types/components/ui/simple-pagination.d.ts.map +1 -0
- package/types/components/ui/skeleton.d.ts +15 -0
- package/types/components/ui/skeleton.d.ts.map +1 -0
- package/types/components/ui/sonner.d.ts +5 -0
- package/types/components/ui/sonner.d.ts.map +1 -0
- package/types/components/ui/sortable-list.d.ts +39 -0
- package/types/components/ui/sortable-list.d.ts.map +1 -0
- package/types/components/ui/sticky-footer.d.ts +10 -0
- package/types/components/ui/sticky-footer.d.ts.map +1 -0
- package/types/components/ui/switch.d.ts +11 -0
- package/types/components/ui/switch.d.ts.map +1 -0
- package/types/components/ui/table.d.ts +21 -0
- package/types/components/ui/table.d.ts.map +1 -0
- package/types/components/ui/tabs-variants.d.ts +5 -0
- package/types/components/ui/tabs-variants.d.ts.map +1 -0
- package/types/components/ui/tabs.d.ts +21 -0
- package/types/components/ui/tabs.d.ts.map +1 -0
- package/types/components/ui/textarea.d.ts +4 -0
- package/types/components/ui/textarea.d.ts.map +1 -0
- package/types/components/ui/time-picker.d.ts +8 -0
- package/types/components/ui/time-picker.d.ts.map +1 -0
- package/types/components/ui/toggle-group.d.ts +17 -0
- package/types/components/ui/toggle-group.d.ts.map +1 -0
- package/types/components/ui/toggle-variants.d.ts +8 -0
- package/types/components/ui/toggle-variants.d.ts.map +1 -0
- package/types/components/ui/toggle.d.ts +11 -0
- package/types/components/ui/toggle.d.ts.map +1 -0
- package/types/components/ui/token-field.d.ts +8 -0
- package/types/components/ui/token-field.d.ts.map +1 -0
- package/types/components/ui/tooltip.d.ts +19 -0
- package/types/components/ui/tooltip.d.ts.map +1 -0
- package/types/components/ui/trend-badge.d.ts +13 -0
- package/types/components/ui/trend-badge.d.ts.map +1 -0
- package/types/components.d.ts +81 -0
- package/types/components.d.ts.map +1 -0
- package/types/hooks/use-global-dirty-state.d.ts +12 -0
- package/types/hooks/use-global-dirty-state.d.ts.map +1 -0
- package/types/hooks/use-mobile.d.ts +2 -0
- package/types/hooks/use-mobile.d.ts.map +1 -0
- package/types/hooks/use-simple-pagination.d.ts +45 -0
- package/types/hooks/use-simple-pagination.d.ts.map +1 -0
- package/types/index.d.ts +6 -0
- package/types/index.d.ts.map +1 -0
- package/types/lib/ds-utils.d.ts +36 -0
- package/types/lib/ds-utils.d.ts.map +1 -0
- package/types/lib/overlay-escape.d.ts +8 -0
- package/types/lib/overlay-escape.d.ts.map +1 -0
- package/types/lib/utils.d.ts +2 -0
- package/types/lib/utils.d.ts.map +1 -0
- package/types/page-templates.d.ts +6 -0
- package/types/page-templates.d.ts.map +1 -0
- package/types/patterns.d.ts +23 -0
- package/types/patterns.d.ts.map +1 -0
- package/types/primitives.d.ts +4 -0
- package/types/primitives.d.ts.map +1 -0
- package/types/providers/global-dirty-state-provider.d.ts +5 -0
- package/types/providers/global-dirty-state-provider.d.ts.map +1 -0
- package/types/providers/header-tooltip-provider.d.ts +4 -0
- package/types/providers/header-tooltip-provider.d.ts.map +1 -0
- package/types/providers/shade-context.d.ts +13 -0
- package/types/providers/shade-context.d.ts.map +1 -0
- package/types/providers/shade-provider.d.ts +11 -0
- package/types/providers/shade-provider.d.ts.map +1 -0
- package/types/shade-app.d.ts +17 -0
- package/types/shade-app.d.ts.map +1 -0
- package/types/shade-scope.d.ts +4 -0
- package/types/shade-scope.d.ts.map +1 -0
- package/types/tokens.d.ts +4 -0
- package/types/tokens.d.ts.map +1 -0
- package/types/utils.d.ts +7 -0
- package/types/utils.d.ts.map +1 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
import { MoreHorizontal } from "lucide-react";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/ui/pagemenu.tsx
|
|
8
|
+
var PageMenuContext = React$1.createContext(null);
|
|
9
|
+
var PageMenu = React$1.forwardRef(({ children, responsive = false, value, defaultValue, onValueChange, className, ...props }, ref) => {
|
|
10
|
+
const [visibleCount, setVisibleCount] = React$1.useState(React$1.Children.count(children));
|
|
11
|
+
const [resizeKey, setResizeKey] = React$1.useState(0);
|
|
12
|
+
const containerRef = React$1.useRef(null);
|
|
13
|
+
const measureRef = React$1.useRef(null);
|
|
14
|
+
React$1.useLayoutEffect(() => {
|
|
15
|
+
if (!responsive || !containerRef.current || !measureRef.current) {
|
|
16
|
+
setVisibleCount(React$1.Children.count(children));
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const calculateSizes = () => {
|
|
20
|
+
if (!containerRef.current || !measureRef.current) return;
|
|
21
|
+
const container = containerRef.current;
|
|
22
|
+
const measureContainer = measureRef.current;
|
|
23
|
+
const containerWidth = container.clientWidth;
|
|
24
|
+
const dropdownWidth = 60;
|
|
25
|
+
const gap = 6;
|
|
26
|
+
const items = Array.from(measureContainer.children);
|
|
27
|
+
let totalWidth = 0;
|
|
28
|
+
for (let i = 0; i < items.length; i++) {
|
|
29
|
+
const itemWidth = items[i].getBoundingClientRect().width;
|
|
30
|
+
totalWidth += (i > 0 ? gap : 0) + itemWidth;
|
|
31
|
+
}
|
|
32
|
+
if (totalWidth <= containerWidth - 8) {
|
|
33
|
+
setVisibleCount(items.length);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
let currentWidth = 0;
|
|
37
|
+
let count = 0;
|
|
38
|
+
for (let i = 0; i < items.length; i++) {
|
|
39
|
+
const itemWidth = items[i].getBoundingClientRect().width;
|
|
40
|
+
const newWidth = currentWidth + (i > 0 ? gap : 0) + itemWidth;
|
|
41
|
+
if (newWidth + dropdownWidth <= containerWidth) {
|
|
42
|
+
currentWidth = newWidth;
|
|
43
|
+
count += 1;
|
|
44
|
+
} else break;
|
|
45
|
+
}
|
|
46
|
+
setVisibleCount(count);
|
|
47
|
+
};
|
|
48
|
+
requestAnimationFrame(calculateSizes);
|
|
49
|
+
}, [
|
|
50
|
+
responsive,
|
|
51
|
+
children,
|
|
52
|
+
resizeKey
|
|
53
|
+
]);
|
|
54
|
+
React$1.useLayoutEffect(() => {
|
|
55
|
+
if (!responsive || !containerRef.current) return;
|
|
56
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
57
|
+
setResizeKey((prev) => prev + 1);
|
|
58
|
+
});
|
|
59
|
+
resizeObserver.observe(containerRef.current);
|
|
60
|
+
return () => resizeObserver.disconnect();
|
|
61
|
+
}, [responsive]);
|
|
62
|
+
const childrenArray = React$1.Children.toArray(children);
|
|
63
|
+
const visibleItems = childrenArray.slice(0, visibleCount);
|
|
64
|
+
const hiddenItems = childrenArray.slice(visibleCount);
|
|
65
|
+
const hasOverflow = hiddenItems.length > 0;
|
|
66
|
+
const selectedHiddenItem = hiddenItems.find((child) => React$1.isValidElement(child) && child.props?.value === value);
|
|
67
|
+
if (!responsive) return /* @__PURE__ */ jsx(PageMenuContext.Provider, {
|
|
68
|
+
value: { defaultValue },
|
|
69
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
70
|
+
ref,
|
|
71
|
+
className: cn("flex items-center gap-2", className),
|
|
72
|
+
...props,
|
|
73
|
+
children
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
return /* @__PURE__ */ jsxs(PageMenuContext.Provider, {
|
|
77
|
+
value: { defaultValue },
|
|
78
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
79
|
+
ref: measureRef,
|
|
80
|
+
"aria-hidden": "true",
|
|
81
|
+
className: "pointer-events-none absolute flex items-center gap-2 opacity-0",
|
|
82
|
+
style: {
|
|
83
|
+
top: -9999,
|
|
84
|
+
left: -9999
|
|
85
|
+
},
|
|
86
|
+
children
|
|
87
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
88
|
+
ref: containerRef,
|
|
89
|
+
className: "flex w-full min-w-0 flex-1 items-center gap-2",
|
|
90
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
91
|
+
ref,
|
|
92
|
+
className: cn("flex min-w-0 items-center gap-2", className),
|
|
93
|
+
...props,
|
|
94
|
+
children: visibleItems
|
|
95
|
+
}), hasOverflow && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
96
|
+
asChild: true,
|
|
97
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
98
|
+
className: cn("h-[30px] flex-shrink-0 px-3 py-2", selectedHiddenItem && "bg-accent text-accent-foreground"),
|
|
99
|
+
variant: "ghost",
|
|
100
|
+
children: selectedHiddenItem ? /* @__PURE__ */ jsx("span", {
|
|
101
|
+
className: "max-w-[100px] truncate",
|
|
102
|
+
children: selectedHiddenItem.props.children
|
|
103
|
+
}) : /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-6" })
|
|
104
|
+
})
|
|
105
|
+
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
106
|
+
align: "end",
|
|
107
|
+
children: hiddenItems.map((item, index) => {
|
|
108
|
+
if (!React$1.isValidElement(item) || !item.props?.value) return null;
|
|
109
|
+
return /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
110
|
+
className: cn(item.props.value === value && "bg-accent text-accent-foreground"),
|
|
111
|
+
onClick: () => {
|
|
112
|
+
onValueChange?.(item.props.value);
|
|
113
|
+
item.props.onClick?.();
|
|
114
|
+
},
|
|
115
|
+
children: item.props.children
|
|
116
|
+
}, item.props.value || index);
|
|
117
|
+
})
|
|
118
|
+
})] })]
|
|
119
|
+
})]
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
PageMenu.displayName = "PageMenu";
|
|
123
|
+
var PageMenuItem = React$1.forwardRef(({ children, value, className, ...props }, ref) => {
|
|
124
|
+
const isActive = React$1.useContext(PageMenuContext)?.defaultValue === value;
|
|
125
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
126
|
+
ref,
|
|
127
|
+
className: cn("relative gap-1.5 px-3 text-control font-medium text-text-secondary hover:text-foreground focus-visible:ring-0", "data-[state=active]:bg-muted-foreground/10 data-[state=active]:text-foreground", "dark:hover:bg-tab-hover dark:data-[state=active]:bg-tab-active dark:data-[state=active]:hover:bg-tab-active", className),
|
|
128
|
+
"data-state": isActive ? "active" : void 0,
|
|
129
|
+
variant: "ghost",
|
|
130
|
+
...props,
|
|
131
|
+
children
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
PageMenuItem.displayName = "PageMenuItem";
|
|
135
|
+
//#endregion
|
|
136
|
+
export { PageMenu, PageMenuItem };
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=pagemenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagemenu.js","names":[],"sources":["../../../src/components/ui/pagemenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '@/lib/utils';\nimport { MoreHorizontal } from 'lucide-react';\nimport { Button, type ButtonProps } from './button';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from './dropdown-menu';\n\nconst PageMenuContext = React.createContext<{ defaultValue?: string } | null>(null);\n\nexport interface PageMenuProps {\n children: React.ReactNode;\n responsive?: boolean;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n className?: string;\n}\n\nexport interface PageMenuItemProps extends Omit<ButtonProps, 'children'> {\n value: string;\n children: React.ReactNode;\n}\n\nconst PageMenu = React.forwardRef<HTMLDivElement, PageMenuProps>(\n (\n { children, responsive = false, value, defaultValue, onValueChange, className, ...props },\n ref,\n ) => {\n const [visibleCount, setVisibleCount] = React.useState(React.Children.count(children));\n const [resizeKey, setResizeKey] = React.useState(0);\n const containerRef = React.useRef<HTMLDivElement>(null);\n const measureRef = React.useRef<HTMLDivElement>(null);\n\n React.useLayoutEffect(() => {\n if (!responsive || !containerRef.current || !measureRef.current) {\n setVisibleCount(React.Children.count(children));\n return;\n }\n\n // Use requestAnimationFrame to ensure DOM is fully rendered\n const calculateSizes = () => {\n if (!containerRef.current || !measureRef.current) {\n return;\n }\n\n const container = containerRef.current;\n const measureContainer = measureRef.current;\n const containerWidth = container.clientWidth;\n const dropdownWidth = 60; // Space needed for dropdown button\n const gap = 6; // Gap between items (gap-1.5)\n\n // Get all child elements from the measure container\n const items = Array.from(measureContainer.children) as HTMLElement[];\n\n // First, check if ALL items fit without any dropdown\n let totalWidth = 0;\n for (let i = 0; i < items.length; i++) {\n const itemWidth = items[i].getBoundingClientRect().width;\n const gapWidth = i > 0 ? gap : 0;\n totalWidth += gapWidth + itemWidth;\n }\n\n // If all items fit with some buffer space, show them all\n const safetyBuffer = 8; // Add 8px buffer for safe rendering\n if (totalWidth <= containerWidth - safetyBuffer) {\n setVisibleCount(items.length);\n return;\n }\n\n // Otherwise, calculate how many fit with dropdown space reserved\n let currentWidth = 0;\n let count = 0;\n\n for (let i = 0; i < items.length; i++) {\n const itemWidth = items[i].getBoundingClientRect().width;\n const gapWidth = i > 0 ? gap : 0;\n const newWidth = currentWidth + gapWidth + itemWidth;\n\n // Reserve space for dropdown (since we know not all items fit)\n const totalNeededWidth = newWidth + dropdownWidth;\n\n if (totalNeededWidth <= containerWidth) {\n currentWidth = newWidth;\n count += 1;\n } else {\n break;\n }\n }\n\n setVisibleCount(count);\n };\n\n requestAnimationFrame(calculateSizes);\n }, [responsive, children, resizeKey]);\n\n React.useLayoutEffect(() => {\n if (!responsive || !containerRef.current) {\n return;\n }\n\n const resizeObserver = new ResizeObserver(() => {\n // Trigger re-calculation by updating the resize key\n setResizeKey((prev) => prev + 1);\n });\n\n resizeObserver.observe(containerRef.current);\n return () => resizeObserver.disconnect();\n }, [responsive]);\n\n const childrenArray = React.Children.toArray(children);\n const visibleItems = childrenArray.slice(0, visibleCount);\n const hiddenItems = childrenArray.slice(visibleCount);\n const hasOverflow = hiddenItems.length > 0;\n\n // Find selected hidden item\n const selectedHiddenItem = hiddenItems.find(\n (child) => React.isValidElement(child) && child.props?.value === value,\n ) as React.ReactElement | undefined;\n\n if (!responsive) {\n return (\n <PageMenuContext.Provider value={{ defaultValue }}>\n <div ref={ref} className={cn('flex items-center gap-2', className)} {...props}>\n {children}\n </div>\n </PageMenuContext.Provider>\n );\n }\n\n return (\n <PageMenuContext.Provider value={{ defaultValue }}>\n {/* Hidden container to measure all items */}\n <div\n ref={measureRef}\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute flex items-center gap-2 opacity-0\"\n style={{ top: -9999, left: -9999 }}\n >\n {children}\n </div>\n\n {/* Visible container */}\n <div ref={containerRef} className=\"flex w-full min-w-0 flex-1 items-center gap-2\">\n <div ref={ref} className={cn('flex min-w-0 items-center gap-2', className)} {...props}>\n {visibleItems}\n </div>\n\n {hasOverflow && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n className={cn(\n 'h-[30px] flex-shrink-0 px-3 py-2',\n selectedHiddenItem && 'bg-accent text-accent-foreground',\n )}\n variant=\"ghost\"\n >\n {selectedHiddenItem ? (\n <span className=\"max-w-[100px] truncate\">\n {selectedHiddenItem.props.children}\n </span>\n ) : (\n <MoreHorizontal className=\"size-6\" />\n )}\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n {hiddenItems.map((item, index) => {\n if (!React.isValidElement(item) || !item.props?.value) {\n return null;\n }\n\n return (\n <DropdownMenuItem\n key={item.props.value || index}\n className={cn(\n item.props.value === value && 'bg-accent text-accent-foreground',\n )}\n onClick={() => {\n onValueChange?.(item.props.value);\n item.props.onClick?.();\n }}\n >\n {item.props.children}\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </PageMenuContext.Provider>\n );\n },\n);\n\nPageMenu.displayName = 'PageMenu';\n\nconst PageMenuItem = React.forwardRef<HTMLButtonElement, PageMenuItemProps>(\n ({ children, value, className, ...props }, ref) => {\n const pageMenuProps = React.useContext(PageMenuContext);\n const isActive = pageMenuProps?.defaultValue === value;\n\n return (\n <Button\n ref={ref}\n className={cn(\n 'relative gap-1.5 px-3 text-control font-medium text-text-secondary hover:text-foreground focus-visible:ring-0',\n 'data-[state=active]:bg-muted-foreground/10 data-[state=active]:text-foreground',\n 'dark:hover:bg-tab-hover dark:data-[state=active]:bg-tab-active dark:data-[state=active]:hover:bg-tab-active',\n className,\n )}\n data-state={isActive ? 'active' : undefined}\n variant=\"ghost\"\n {...props}\n >\n {children}\n </Button>\n );\n },\n);\n\nPageMenuItem.displayName = 'PageMenuItem';\n\nexport { PageMenu, PageMenuItem };\n"],"mappings":"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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
import { ShadeScope } from "../../shade-scope.js";
|
|
3
|
+
import { consumeOverlayEscape } from "../../lib/overlay-escape.js";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
7
|
+
//#region src/components/ui/popover.tsx
|
|
8
|
+
var Popover = PopoverPrimitive.Root;
|
|
9
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
10
|
+
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
11
|
+
var PopoverClose = PopoverPrimitive.Close;
|
|
12
|
+
var PopoverContent = React$1.forwardRef(({ className, align = "center", onEscapeKeyDown, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(ShadeScope, { children: /* @__PURE__ */ jsx(PopoverPrimitive.Content, {
|
|
13
|
+
ref,
|
|
14
|
+
align,
|
|
15
|
+
className: cn("z-50 origin-(--radix-popover-content-transform-origin) rounded-menu border border-border/60 bg-surface-elevated-2 p-5 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 dark:border-border/30", className),
|
|
16
|
+
sideOffset,
|
|
17
|
+
onEscapeKeyDown: (event) => consumeOverlayEscape(event, onEscapeKeyDown),
|
|
18
|
+
...props
|
|
19
|
+
}) }) }));
|
|
20
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=popover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.js","names":[],"sources":["../../../src/components/ui/popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { ShadeScope } from '@/shade-scope';\n\nimport { cn } from '@/lib/utils';\nimport { consumeOverlayEscape } from '@/lib/overlay-escape';\nconst Popover = PopoverPrimitive.Root;\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nconst PopoverAnchor = PopoverPrimitive.Anchor;\n\nconst PopoverClose = PopoverPrimitive.Close;\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', onEscapeKeyDown, sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <ShadeScope>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n className={cn(\n 'z-50 origin-(--radix-popover-content-transform-origin) rounded-menu border border-border/60 bg-surface-elevated-2 p-5 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 dark:border-border/30',\n className,\n )}\n sideOffset={sideOffset}\n onEscapeKeyDown={(event) => consumeOverlayEscape(event, onEscapeKeyDown)}\n {...props}\n />\n </ShadeScope>\n </PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, PopoverClose };\n"],"mappings":";;;;;;;AAMA,IAAM,UAAU,iBAAiB;AAEjC,IAAM,iBAAiB,iBAAiB;AAExC,IAAM,gBAAgB,iBAAiB;AAEvC,IAAM,eAAe,iBAAiB;AAEtC,IAAM,iBAAiB,QAAM,YAG1B,EAAE,WAAW,QAAQ,UAAU,iBAAiB,aAAa,GAAG,GAAG,SAAS,QAC7E,oBAAC,iBAAiB,QAAlB,EAAA,UACE,oBAAC,YAAD,EAAA,UACE,oBAAC,iBAAiB,SAAlB;CACO;CACE;CACP,WAAW,GACT,ihBACA,SACF;CACY;CACZ,kBAAkB,UAAU,qBAAqB,OAAO,eAAe;CACvE,GAAI;AACL,CAAA,EACS,CAAA,EACW,CAAA,CAC1B;AACD,eAAe,cAAc,iBAAiB,QAAQ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
//#region src/components/ui/preview-chrome-variants.ts
|
|
3
|
+
var previewChromeVariants = cva("size-full", {
|
|
4
|
+
variants: { device: {
|
|
5
|
+
desktop: "px-8",
|
|
6
|
+
mobile: "h-[775px] w-[380px] rounded-3xl bg-surface-elevated p-2 shadow-xl"
|
|
7
|
+
} },
|
|
8
|
+
defaultVariants: { device: "desktop" }
|
|
9
|
+
});
|
|
10
|
+
//#endregion
|
|
11
|
+
export { previewChromeVariants };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=preview-chrome-variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-chrome-variants.js","names":[],"sources":["../../../src/components/ui/preview-chrome-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nconst previewChromeVariants = cva('size-full', {\n variants: {\n device: {\n desktop: 'px-8',\n mobile: 'h-[775px] w-[380px] rounded-3xl bg-surface-elevated p-2 shadow-xl',\n },\n },\n defaultVariants: {\n device: 'desktop',\n },\n});\n\nexport { previewChromeVariants };\n"],"mappings":";;AAEA,IAAM,wBAAwB,IAAI,aAAa;CAC7C,UAAU,EACR,QAAQ;EACN,SAAS;EACT,QAAQ;CACV,EACF;CACA,iBAAiB,EACf,QAAQ,UACV;AACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
import { previewChromeVariants } from "./preview-chrome-variants.js";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
//#region src/components/ui/preview-chrome.tsx
|
|
7
|
+
var previewViewportVariants = cva("size-full overflow-hidden", {
|
|
8
|
+
variants: { device: {
|
|
9
|
+
desktop: "rounded-t-xs shadow-sm",
|
|
10
|
+
mobile: "overflow-auto rounded-2xl border border-border-default"
|
|
11
|
+
} },
|
|
12
|
+
defaultVariants: { device: "desktop" }
|
|
13
|
+
});
|
|
14
|
+
var PreviewChrome = React$1.forwardRef(({ children, className, device = "desktop", ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
15
|
+
ref,
|
|
16
|
+
className: cn(previewChromeVariants({ device }), className),
|
|
17
|
+
...props,
|
|
18
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
19
|
+
className: previewViewportVariants({ device }),
|
|
20
|
+
children
|
|
21
|
+
})
|
|
22
|
+
}));
|
|
23
|
+
PreviewChrome.displayName = "PreviewChrome";
|
|
24
|
+
//#endregion
|
|
25
|
+
export { PreviewChrome };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=preview-chrome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-chrome.js","names":[],"sources":["../../../src/components/ui/preview-chrome.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '@/lib/utils';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { previewChromeVariants } from '@/components/ui/preview-chrome-variants';\n\nconst previewViewportVariants = cva('size-full overflow-hidden', {\n variants: {\n device: {\n desktop: 'rounded-t-xs shadow-sm',\n mobile: 'overflow-auto rounded-2xl border border-border-default',\n },\n },\n defaultVariants: {\n device: 'desktop',\n },\n});\n\nexport interface PreviewChromeProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof previewChromeVariants> {}\n\nconst PreviewChrome = React.forwardRef<HTMLDivElement, PreviewChromeProps>(\n ({ children, className, device = 'desktop', ...props }, ref) => (\n <div ref={ref} className={cn(previewChromeVariants({ device }), className)} {...props}>\n <div className={previewViewportVariants({ device })}>{children}</div>\n </div>\n ),\n);\n\nPreviewChrome.displayName = 'PreviewChrome';\n\nexport { PreviewChrome };\n"],"mappings":";;;;;;AAKA,IAAM,0BAA0B,IAAI,6BAA6B;CAC/D,UAAU,EACR,QAAQ;EACN,SAAS;EACT,QAAQ;CACV,EACF;CACA,iBAAiB,EACf,QAAQ,UACV;AACF,CAAC;AAKD,IAAM,gBAAgB,QAAM,YACzB,EAAE,UAAU,WAAW,SAAS,WAAW,GAAG,SAAS,QACtD,oBAAC,OAAD;CAAU;CAAK,WAAW,GAAG,sBAAsB,EAAE,OAAO,CAAC,GAAG,SAAS;CAAG,GAAI;WAC9E,oBAAC,OAAD;EAAK,WAAW,wBAAwB,EAAE,OAAO,CAAC;EAAI;CAAc,CAAA;AACjE,CAAA,CAET;AAEA,cAAc,cAAc"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { inputSurface } from "./input-surface.js";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
//#region src/components/ui/radio-group-variants.ts
|
|
4
|
+
var radioGroupItemVariants = cva([inputSurface("self"), "peer grid size-4 shrink-0 place-content-center rounded-full border-border-strong p-0 text-primary enabled:hover:bg-interactive-hover data-[state=checked]:border-primary"], {
|
|
5
|
+
variants: { indicator: {
|
|
6
|
+
dot: "",
|
|
7
|
+
check: "data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground enabled:data-[state=checked]:hover:bg-primary"
|
|
8
|
+
} },
|
|
9
|
+
defaultVariants: { indicator: "dot" }
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
export { radioGroupItemVariants };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=radio-group-variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group-variants.js","names":[],"sources":["../../../src/components/ui/radio-group-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\nimport { inputSurface } from '@/components/ui/input-surface';\n\nconst radioGroupItemVariants = cva(\n [\n inputSurface('self'),\n 'peer grid size-4 shrink-0 place-content-center rounded-full border-border-strong p-0 text-primary enabled:hover:bg-interactive-hover data-[state=checked]:border-primary',\n ],\n {\n variants: {\n indicator: {\n dot: '',\n check:\n 'data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground enabled:data-[state=checked]:hover:bg-primary',\n },\n },\n defaultVariants: {\n indicator: 'dot',\n },\n },\n);\n\nexport { radioGroupItemVariants };\n"],"mappings":";;;AAGA,IAAM,yBAAyB,IAC7B,CACE,aAAa,MAAM,GACnB,0KACF,GACA;CACE,UAAU,EACR,WAAW;EACT,KAAK;EACL,OACE;CACJ,EACF;CACA,iBAAiB,EACf,WAAW,MACb;AACF,CACF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
import { radioGroupItemVariants } from "./radio-group-variants.js";
|
|
3
|
+
import { Check } from "lucide-react";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
7
|
+
//#region src/components/ui/radio-group.tsx
|
|
8
|
+
var RadioGroup = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, {
|
|
9
|
+
ref,
|
|
10
|
+
className: cn("grid gap-3", className),
|
|
11
|
+
"data-slot": "radio-group",
|
|
12
|
+
...props
|
|
13
|
+
}));
|
|
14
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
15
|
+
var RadioGroupItem = React$1.forwardRef(({ className, indicator = "dot", ...props }, ref) => /* @__PURE__ */ jsx(RadioGroupPrimitive.Item, {
|
|
16
|
+
ref,
|
|
17
|
+
className: cn(radioGroupItemVariants({ indicator }), className),
|
|
18
|
+
"data-slot": "radio-group-item",
|
|
19
|
+
...props,
|
|
20
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, {
|
|
21
|
+
className: "grid place-content-center",
|
|
22
|
+
"data-slot": "radio-group-indicator",
|
|
23
|
+
children: indicator === "check" ? /* @__PURE__ */ jsx(Check, { className: "size-2.5 stroke-4" }) : /* @__PURE__ */ jsx("span", {
|
|
24
|
+
className: "size-2 rounded-full bg-current",
|
|
25
|
+
"data-slot": "radio-group-dot"
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
}));
|
|
29
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { RadioGroup, RadioGroupItem };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=radio-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.js","names":[],"sources":["../../../src/components/ui/radio-group.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport { Check } from 'lucide-react';\nimport { type VariantProps } from 'class-variance-authority';\n\nimport { radioGroupItemVariants } from '@/components/ui/radio-group-variants';\nimport { cn } from '@/lib/utils';\n\nconst RadioGroup = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Root\n ref={ref}\n className={cn('grid gap-3', className)}\n data-slot=\"radio-group\"\n {...props}\n />\n));\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\ntype RadioGroupItemProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> &\n VariantProps<typeof radioGroupItemVariants>;\n\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n RadioGroupItemProps\n>(({ className, indicator = 'dot', ...props }, ref) => (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(radioGroupItemVariants({ indicator }), className)}\n data-slot=\"radio-group-item\"\n {...props}\n >\n <RadioGroupPrimitive.Indicator\n className=\"grid place-content-center\"\n data-slot=\"radio-group-indicator\"\n >\n {indicator === 'check' ? (\n <Check className=\"size-2.5 stroke-4\" />\n ) : (\n <span className=\"size-2 rounded-full bg-current\" data-slot=\"radio-group-dot\" />\n )}\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n));\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n"],"mappings":";;;;;;;AAQA,IAAM,aAAa,QAAM,YAGtB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,oBAAoB,MAArB;CACO;CACL,WAAW,GAAG,cAAc,SAAS;CACrC,aAAU;CACV,GAAI;AACL,CAAA,CACF;AACD,WAAW,cAAc,oBAAoB,KAAK;AAKlD,IAAM,iBAAiB,QAAM,YAG1B,EAAE,WAAW,YAAY,OAAO,GAAG,SAAS,QAC7C,oBAAC,oBAAoB,MAArB;CACO;CACL,WAAW,GAAG,uBAAuB,EAAE,UAAU,CAAC,GAAG,SAAS;CAC9D,aAAU;CACV,GAAI;WAEJ,oBAAC,oBAAoB,WAArB;EACE,WAAU;EACV,aAAU;YAET,cAAc,UACb,oBAAC,OAAD,EAAO,WAAU,oBAAqB,CAAA,IAEtC,oBAAC,QAAD;GAAM,WAAU;GAAiC,aAAU;EAAmB,CAAA;CAEnD,CAAA;AACP,CAAA,CAC3B;AACD,eAAe,cAAc,oBAAoB,KAAK"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
//#region src/components/ui/select-variants.ts
|
|
3
|
+
var selectTriggerVariants = cva("flex h-(--control-height) w-full items-center justify-between px-3 py-2 text-control whitespace-nowrap hover:bg-button-hover data-[placeholder]:text-muted-foreground [&>span]:line-clamp-1", {
|
|
4
|
+
variants: {
|
|
5
|
+
variant: {
|
|
6
|
+
default: "",
|
|
7
|
+
ghost: "border-transparent bg-transparent shadow-none",
|
|
8
|
+
secondary: "border-transparent bg-tab-active text-secondary-foreground shadow-none hover:bg-secondary"
|
|
9
|
+
},
|
|
10
|
+
isAdmin7: {
|
|
11
|
+
true: "",
|
|
12
|
+
false: ""
|
|
13
|
+
},
|
|
14
|
+
shape: {
|
|
15
|
+
rounded: "rounded-control",
|
|
16
|
+
pill: "rounded-full"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
compoundVariants: [
|
|
20
|
+
{
|
|
21
|
+
isAdmin7: true,
|
|
22
|
+
variant: ["secondary", "ghost"],
|
|
23
|
+
className: "enabled:active:shadow-control-pressed enabled:aria-expanded:shadow-control-pressed"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
isAdmin7: true,
|
|
27
|
+
variant: "ghost",
|
|
28
|
+
className: "enabled:active:bg-button-hover enabled:aria-expanded:bg-button-hover"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
isAdmin7: true,
|
|
32
|
+
variant: "secondary",
|
|
33
|
+
className: "enabled:active:bg-secondary enabled:aria-expanded:bg-secondary"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
variant: "default",
|
|
38
|
+
shape: "rounded",
|
|
39
|
+
isAdmin7: true
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
//#endregion
|
|
43
|
+
export { selectTriggerVariants };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=select-variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-variants.js","names":[],"sources":["../../../src/components/ui/select-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nconst selectTriggerVariants = cva(\n 'flex h-(--control-height) w-full items-center justify-between px-3 py-2 text-control whitespace-nowrap hover:bg-button-hover data-[placeholder]:text-muted-foreground [&>span]:line-clamp-1',\n {\n variants: {\n variant: {\n default: '',\n ghost: 'border-transparent bg-transparent shadow-none',\n secondary:\n 'border-transparent bg-tab-active text-secondary-foreground shadow-none hover:bg-secondary',\n },\n isAdmin7: { true: '', false: '' },\n shape: {\n rounded: 'rounded-control',\n pill: 'rounded-full',\n },\n },\n compoundVariants: [\n {\n isAdmin7: true,\n variant: ['secondary', 'ghost'],\n className:\n 'enabled:active:shadow-control-pressed enabled:aria-expanded:shadow-control-pressed',\n },\n {\n isAdmin7: true,\n variant: 'ghost',\n className: 'enabled:active:bg-button-hover enabled:aria-expanded:bg-button-hover',\n },\n {\n isAdmin7: true,\n variant: 'secondary',\n className: 'enabled:active:bg-secondary enabled:aria-expanded:bg-secondary',\n },\n ],\n defaultVariants: {\n variant: 'default',\n shape: 'rounded',\n isAdmin7: true,\n },\n },\n);\n\nexport { selectTriggerVariants };\n"],"mappings":";;AAEA,IAAM,wBAAwB,IAC5B,+LACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,OAAO;GACP,WACE;EACJ;EACA,UAAU;GAAE,MAAM;GAAI,OAAO;EAAG;EAChC,OAAO;GACL,SAAS;GACT,MAAM;EACR;CACF;CACA,kBAAkB;EAChB;GACE,UAAU;GACV,SAAS,CAAC,aAAa,OAAO;GAC9B,WACE;EACJ;EACA;GACE,UAAU;GACV,SAAS;GACT,WAAW;EACb;EACA;GACE,UAAU;GACV,SAAS;GACT,WAAW;EACb;CACF;CACA,iBAAiB;EACf,SAAS;EACT,OAAO;EACP,UAAU;CACZ;AACF,CACF"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
import { useShade } from "../../providers/shade-context.js";
|
|
3
|
+
import { ShadeScope } from "../../shade-scope.js";
|
|
4
|
+
import { consumeOverlayEscape } from "../../lib/overlay-escape.js";
|
|
5
|
+
import { selectTriggerVariants } from "./select-variants.js";
|
|
6
|
+
import { inputSurface, inputSurfaceClasses } from "./input-surface.js";
|
|
7
|
+
import { Check, ChevronDown, ChevronUp } from "lucide-react";
|
|
8
|
+
import * as React$1 from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
11
|
+
//#region src/components/ui/select.tsx
|
|
12
|
+
var Select = SelectPrimitive.Root;
|
|
13
|
+
var SelectGroup = SelectPrimitive.Group;
|
|
14
|
+
var SelectValue = SelectPrimitive.Value;
|
|
15
|
+
var SelectTrigger = React$1.forwardRef(({ className, children, shape, variant, showChevron = variant !== "secondary", ...props }, ref) => {
|
|
16
|
+
const { isAdmin7 } = useShade();
|
|
17
|
+
const resolvedShape = shape ?? "rounded";
|
|
18
|
+
return /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
|
|
19
|
+
ref,
|
|
20
|
+
className: cn(inputSurface("self"), inputSurfaceClasses.disabledFieldSelf, selectTriggerVariants({
|
|
21
|
+
shape: resolvedShape,
|
|
22
|
+
variant,
|
|
23
|
+
isAdmin7
|
|
24
|
+
}), showChevron && "pr-2", className),
|
|
25
|
+
"data-control-shape": resolvedShape,
|
|
26
|
+
"data-variant": variant ?? "default",
|
|
27
|
+
...props,
|
|
28
|
+
children: [children, showChevron && /* @__PURE__ */ jsx(SelectPrimitive.Icon, {
|
|
29
|
+
asChild: true,
|
|
30
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "-mr-0.5 size-4 opacity-50" })
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
35
|
+
var SelectScrollUpButton = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.ScrollUpButton, {
|
|
36
|
+
ref,
|
|
37
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
38
|
+
...props,
|
|
39
|
+
children: /* @__PURE__ */ jsx(ChevronUp, { className: "size-4" })
|
|
40
|
+
}));
|
|
41
|
+
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
42
|
+
var SelectScrollDownButton = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.ScrollDownButton, {
|
|
43
|
+
ref,
|
|
44
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
45
|
+
...props,
|
|
46
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "size-4" })
|
|
47
|
+
}));
|
|
48
|
+
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
49
|
+
var SelectContent = React$1.forwardRef(({ className, children, onEscapeKeyDown, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx(ShadeScope, { children: /* @__PURE__ */ jsxs(SelectPrimitive.Content, {
|
|
50
|
+
ref,
|
|
51
|
+
className: cn("relative z-[9999] max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-menu border border-border/60 bg-surface-elevated-2 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 dark:border-border/30", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
52
|
+
position,
|
|
53
|
+
onEscapeKeyDown: (event) => consumeOverlayEscape(event, onEscapeKeyDown),
|
|
54
|
+
...props,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
57
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Viewport, {
|
|
58
|
+
className: cn("p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),
|
|
59
|
+
children
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
62
|
+
]
|
|
63
|
+
}) }) }));
|
|
64
|
+
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
65
|
+
var SelectLabel = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Label, {
|
|
66
|
+
ref,
|
|
67
|
+
className: cn("px-2 py-1.5 text-control font-semibold", className),
|
|
68
|
+
...props
|
|
69
|
+
}));
|
|
70
|
+
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
71
|
+
var SelectItem = React$1.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
|
|
72
|
+
ref,
|
|
73
|
+
className: cn("relative flex w-full cursor-default items-center rounded-menu-item py-1.5 pr-8 pl-2 text-control outline-hidden select-none focus:bg-interactive-hover focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
|
|
74
|
+
...props,
|
|
75
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
76
|
+
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
77
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "size-4" }) })
|
|
78
|
+
}), /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })]
|
|
79
|
+
}));
|
|
80
|
+
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
81
|
+
var SelectSeparator = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Separator, {
|
|
82
|
+
ref,
|
|
83
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
84
|
+
...props
|
|
85
|
+
}));
|
|
86
|
+
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
87
|
+
//#endregion
|
|
88
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
|
|
89
|
+
|
|
90
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","names":[],"sources":["../../../src/components/ui/select.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { type VariantProps } from 'class-variance-authority';\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react';\n\nimport { selectTriggerVariants } from '@/components/ui/select-variants';\nimport { useShade } from '@/providers/shade-context';\nimport { cn } from '@/lib/utils';\nimport { ShadeScope } from '@/shade-scope';\nimport { inputSurface, inputSurfaceClasses } from '@/components/ui/input-surface';\nimport { consumeOverlayEscape } from '@/lib/overlay-escape';\nconst Select = SelectPrimitive.Root;\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectValue = SelectPrimitive.Value;\n\nexport interface SelectTriggerProps\n extends\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>,\n Omit<VariantProps<typeof selectTriggerVariants>, 'isAdmin7'> {\n /** Show the dropdown chevron. Defaults to hidden for the secondary variant. */\n showChevron?: boolean;\n}\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n SelectTriggerProps\n>(\n (\n { className, children, shape, variant, showChevron = variant !== 'secondary', ...props },\n ref,\n ) => {\n const { isAdmin7 } = useShade();\n const resolvedShape = shape ?? 'rounded';\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n inputSurface('self'),\n inputSurfaceClasses.disabledFieldSelf,\n selectTriggerVariants({ shape: resolvedShape, variant, isAdmin7 }),\n showChevron && 'pr-2',\n className,\n )}\n data-control-shape={resolvedShape}\n data-variant={variant ?? 'default'}\n {...props}\n >\n {children}\n {showChevron && (\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"-mr-0.5 size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n )}\n </SelectPrimitive.Trigger>\n );\n },\n);\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn('flex cursor-default items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronUp className=\"size-4\" />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn('flex cursor-default items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronDown className=\"size-4\" />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, onEscapeKeyDown, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <ShadeScope>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n 'relative z-[9999] max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-menu border border-border/60 bg-surface-elevated-2 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 dark:border-border/30',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n position={position}\n onEscapeKeyDown={(event) => consumeOverlayEscape(event, onEscapeKeyDown)}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </ShadeScope>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-control font-semibold', className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex w-full cursor-default items-center rounded-menu-item py-1.5 pr-8 pl-2 text-control outline-hidden select-none focus:bg-interactive-hover focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-muted', className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n"],"mappings":";;;;;;;;;;;AAWA,IAAM,SAAS,gBAAgB;AAE/B,IAAM,cAAc,gBAAgB;AAEpC,IAAM,cAAc,gBAAgB;AAUpC,IAAM,gBAAgB,QAAM,YAKxB,EAAE,WAAW,UAAU,OAAO,SAAS,cAAc,YAAY,aAAa,GAAG,SACjF,QACG;CACH,MAAM,EAAE,aAAa,SAAS;CAC9B,MAAM,gBAAgB,SAAS;CAC/B,OACE,qBAAC,gBAAgB,SAAjB;EACO;EACL,WAAW,GACT,aAAa,MAAM,GACnB,oBAAoB,mBACpB,sBAAsB;GAAE,OAAO;GAAe;GAAS;EAAS,CAAC,GACjE,eAAe,QACf,SACF;EACA,sBAAoB;EACpB,gBAAc,WAAW;EACzB,GAAI;YAXN,CAaG,UACA,eACC,oBAAC,gBAAgB,MAAjB;GAAsB,SAAA;aACpB,oBAAC,aAAD,EAAa,WAAU,4BAA6B,CAAA;EAChC,CAAA,CAED;;AAE7B,CACF;AACA,cAAc,cAAc,gBAAgB,QAAQ;AAEpD,IAAM,uBAAuB,QAAM,YAGhC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,gBAAjB;CACO;CACL,WAAW,GAAG,wDAAwD,SAAS;CAC/E,GAAI;WAEJ,oBAAC,WAAD,EAAW,WAAU,SAAU,CAAA;AACD,CAAA,CACjC;AACD,qBAAqB,cAAc,gBAAgB,eAAe;AAElE,IAAM,yBAAyB,QAAM,YAGlC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,kBAAjB;CACO;CACL,WAAW,GAAG,wDAAwD,SAAS;CAC/E,GAAI;WAEJ,oBAAC,aAAD,EAAa,WAAU,SAAU,CAAA;AACD,CAAA,CACnC;AACD,uBAAuB,cAAc,gBAAgB,iBAAiB;AAEtE,IAAM,gBAAgB,QAAM,YAGzB,EAAE,WAAW,UAAU,iBAAiB,WAAW,UAAU,GAAG,SAAS,QAC1E,oBAAC,gBAAgB,QAAjB,EAAA,UACE,oBAAC,YAAD,EAAA,UACE,qBAAC,gBAAgB,SAAjB;CACO;CACL,WAAW,GACT,ymBACA,aAAa,YACX,mIACF,SACF;CACU;CACV,kBAAkB,UAAU,qBAAqB,OAAO,eAAe;CACvE,GAAI;WAVN;EAYE,oBAAC,sBAAD,CAAuB,CAAA;EACvB,oBAAC,gBAAgB,UAAjB;GACE,WAAW,GACT,OACA,aAAa,YACX,yFACJ;GAEC;EACuB,CAAA;EAC1B,oBAAC,wBAAD,CAAyB,CAAA;CACF;GACf,CAAA,EACU,CAAA,CACzB;AACD,cAAc,cAAc,gBAAgB,QAAQ;AAEpD,IAAM,cAAc,QAAM,YAGvB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,OAAjB;CACO;CACL,WAAW,GAAG,0CAA0C,SAAS;CACjE,GAAI;AACL,CAAA,CACF;AACD,YAAY,cAAc,gBAAgB,MAAM;AAEhD,IAAM,aAAa,QAAM,YAGtB,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,qBAAC,gBAAgB,MAAjB;CACO;CACL,WAAW,GACT,sPACA,SACF;CACA,GAAI;WANN,CAQE,oBAAC,QAAD;EAAM,WAAU;YACd,oBAAC,gBAAgB,eAAjB,EAAA,UACE,oBAAC,OAAD,EAAO,WAAU,SAAU,CAAA,EACE,CAAA;CAC3B,CAAA,GACN,oBAAC,gBAAgB,UAAjB,EAA2B,SAAmC,CAAA,CAC1C;EACvB;AACD,WAAW,cAAc,gBAAgB,KAAK;AAE9C,IAAM,kBAAkB,QAAM,YAG3B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,WAAjB;CACO;CACL,WAAW,GAAG,4BAA4B,SAAS;CACnD,GAAI;AACL,CAAA,CACF;AACD,gBAAgB,cAAc,gBAAgB,UAAU"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
5
|
+
//#region src/components/ui/separator.tsx
|
|
6
|
+
var Separator = React$1.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(SeparatorPrimitive.Root, {
|
|
7
|
+
ref,
|
|
8
|
+
className: cn("shrink-0 bg-border", orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", className),
|
|
9
|
+
decorative,
|
|
10
|
+
orientation,
|
|
11
|
+
...props
|
|
12
|
+
}));
|
|
13
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Separator };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.js","names":[],"sources":["../../../src/components/ui/separator.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\n\nimport { cn } from '@/lib/utils';\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n className={cn(\n 'shrink-0 bg-border',\n orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',\n className,\n )}\n decorative={decorative}\n orientation={orientation}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n"],"mappings":";;;;;AAKA,IAAM,YAAY,QAAM,YAGrB,EAAE,WAAW,cAAc,cAAc,aAAa,MAAM,GAAG,SAAS,QACzE,oBAAC,mBAAmB,MAApB;CACO;CACL,WAAW,GACT,sBACA,gBAAgB,eAAe,mBAAmB,kBAClD,SACF;CACY;CACC;CACb,GAAI;AACL,CAAA,CACF;AACD,UAAU,cAAc,mBAAmB,KAAK"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
3
|
+
import { ShadeScope } from "../../shade-scope.js";
|
|
4
|
+
import { X } from "lucide-react";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { cva } from "class-variance-authority";
|
|
8
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
9
|
+
//#region src/components/ui/sheet.tsx
|
|
10
|
+
var Sheet = SheetPrimitive.Root;
|
|
11
|
+
var SheetTrigger = SheetPrimitive.Trigger;
|
|
12
|
+
var SheetClose = SheetPrimitive.Close;
|
|
13
|
+
var SheetPortal = SheetPrimitive.Portal;
|
|
14
|
+
var SheetOverlay = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SheetPrimitive.Overlay, {
|
|
15
|
+
className: cn("fixed inset-0 z-50 bg-black/10 duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", className),
|
|
16
|
+
...props,
|
|
17
|
+
ref
|
|
18
|
+
}));
|
|
19
|
+
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
20
|
+
var sheetVariants = cva("fixed z-50 gap-4 bg-surface-elevated p-8 shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-200 data-[state=open]:animate-in data-[state=open]:duration-500", {
|
|
21
|
+
variants: { side: {
|
|
22
|
+
top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
23
|
+
bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
24
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
25
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
26
|
+
} },
|
|
27
|
+
defaultVariants: { side: "right" }
|
|
28
|
+
});
|
|
29
|
+
var SheetContent = React$1.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsx(SheetPortal, { children: /* @__PURE__ */ jsxs(ShadeScope, { children: [/* @__PURE__ */ jsx(SheetOverlay, {}), /* @__PURE__ */ jsxs(SheetPrimitive.Content, {
|
|
30
|
+
ref,
|
|
31
|
+
className: cn(sheetVariants({ side }), className),
|
|
32
|
+
...props,
|
|
33
|
+
children: [/* @__PURE__ */ jsxs(SheetPrimitive.Close, {
|
|
34
|
+
className: "fixed top-4 right-4 z-50 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:bg-secondary",
|
|
35
|
+
children: [/* @__PURE__ */ jsx(X, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
36
|
+
className: "sr-only",
|
|
37
|
+
children: "Close"
|
|
38
|
+
})]
|
|
39
|
+
}), children]
|
|
40
|
+
})] }) }));
|
|
41
|
+
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
42
|
+
var SheetHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
43
|
+
className: cn("flex flex-col space-y-1 text-center sm:text-left", className),
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
SheetHeader.displayName = "SheetHeader";
|
|
47
|
+
var SheetFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
48
|
+
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-2", className),
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
51
|
+
SheetFooter.displayName = "SheetFooter";
|
|
52
|
+
var SheetTitle = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SheetPrimitive.Title, {
|
|
53
|
+
ref,
|
|
54
|
+
className: cn("text-xl font-semibold text-foreground", className),
|
|
55
|
+
...props
|
|
56
|
+
}));
|
|
57
|
+
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
58
|
+
var SheetDescription = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SheetPrimitive.Description, {
|
|
59
|
+
ref,
|
|
60
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
61
|
+
...props
|
|
62
|
+
}));
|
|
63
|
+
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
64
|
+
//#endregion
|
|
65
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=sheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.js","names":[],"sources":["../../../src/components/ui/sheet.tsx"],"sourcesContent":["'use client';\n\n// Disable sourcemap for this file due to source map resolution errors\nimport * as React from 'react';\nimport * as SheetPrimitive from '@radix-ui/react-dialog';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { ShadeScope } from '@/shade-scope';\n\nconst Sheet = SheetPrimitive.Root;\n\nconst SheetTrigger = SheetPrimitive.Trigger;\n\nconst SheetClose = SheetPrimitive.Close;\n\nconst SheetPortal = SheetPrimitive.Portal;\n\nconst SheetOverlay = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n 'fixed inset-0 z-50 bg-black/10 duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0',\n className,\n )}\n {...props}\n ref={ref}\n />\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\nconst sheetVariants = cva(\n 'fixed z-50 gap-4 bg-surface-elevated p-8 shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-200 data-[state=open]:animate-in data-[state=open]:duration-500',\n {\n variants: {\n side: {\n top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',\n bottom:\n 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',\n left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',\n right:\n 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',\n },\n },\n defaultVariants: {\n side: 'right',\n },\n },\n);\n\ninterface SheetContentProps\n extends\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,\n VariantProps<typeof sheetVariants> {}\n\nconst SheetContent = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Content>,\n SheetContentProps\n>(({ side = 'right', className, children, ...props }, ref) => (\n <SheetPortal>\n <ShadeScope>\n <SheetOverlay />\n <SheetPrimitive.Content\n ref={ref}\n className={cn(sheetVariants({ side }), className)}\n {...props}\n >\n <SheetPrimitive.Close className=\"fixed top-4 right-4 z-50 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:bg-secondary\">\n <X className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n {children}\n </SheetPrimitive.Content>\n </ShadeScope>\n </SheetPortal>\n));\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nconst SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-1 text-center sm:text-left', className)} {...props} />\n);\nSheetHeader.displayName = 'SheetHeader';\n\nconst SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-2', className)}\n {...props}\n />\n);\nSheetFooter.displayName = 'SheetFooter';\n\nconst SheetTitle = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title\n ref={ref}\n className={cn('text-xl font-semibold text-foreground', className)}\n {...props}\n />\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\nconst SheetDescription = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport {\n Sheet,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n"],"mappings":";;;;;;;;;AAWA,IAAM,QAAQ,eAAe;AAE7B,IAAM,eAAe,eAAe;AAEpC,IAAM,aAAa,eAAe;AAElC,IAAM,cAAc,eAAe;AAEnC,IAAM,eAAe,QAAM,YAGxB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,eAAe,SAAhB;CACE,WAAW,GACT,wKACA,SACF;CACA,GAAI;CACC;AACN,CAAA,CACF;AACD,aAAa,cAAc,eAAe,QAAQ;AAElD,IAAM,gBAAgB,IACpB,0MACA;CACE,UAAU,EACR,MAAM;EACJ,KAAK;EACL,QACE;EACF,MAAM;EACN,OACE;CACJ,EACF;CACA,iBAAiB,EACf,MAAM,QACR;AACF,CACF;AAOA,IAAM,eAAe,QAAM,YAGxB,EAAE,OAAO,SAAS,WAAW,UAAU,GAAG,SAAS,QACpD,oBAAC,aAAD,EAAA,UACE,qBAAC,YAAD,EAAA,UAAA,CACE,oBAAC,cAAD,CAAe,CAAA,GACf,qBAAC,eAAe,SAAhB;CACO;CACL,WAAW,GAAG,cAAc,EAAE,KAAK,CAAC,GAAG,SAAS;CAChD,GAAI;WAHN,CAKE,qBAAC,eAAe,OAAhB;EAAsB,WAAU;YAAhC,CACE,oBAAC,GAAD,EAAG,WAAU,SAAU,CAAA,GACvB,oBAAC,QAAD;GAAM,WAAU;aAAU;EAAW,CAAA,CACjB;KACrB,QACqB;EACd,EAAA,CAAA,EACD,CAAA,CACd;AACD,aAAa,cAAc,eAAe,QAAQ;AAElD,IAAM,eAAe,EAAE,WAAW,GAAG,YACnC,oBAAC,OAAD;CAAK,WAAW,GAAG,oDAAoD,SAAS;CAAG,GAAI;AAAQ,CAAA;AAEjG,YAAY,cAAc;AAE1B,IAAM,eAAe,EAAE,WAAW,GAAG,YACnC,oBAAC,OAAD;CACE,WAAW,GAAG,6DAA6D,SAAS;CACpF,GAAI;AACL,CAAA;AAEH,YAAY,cAAc;AAE1B,IAAM,aAAa,QAAM,YAGtB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,eAAe,OAAhB;CACO;CACL,WAAW,GAAG,yCAAyC,SAAS;CAChE,GAAI;AACL,CAAA,CACF;AACD,WAAW,cAAc,eAAe,MAAM;AAE9C,IAAM,mBAAmB,QAAM,YAG5B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,eAAe,aAAhB;CACO;CACL,WAAW,GAAG,iCAAiC,SAAS;CACxD,GAAI;AACL,CAAA,CACF;AACD,iBAAiB,cAAc,eAAe,YAAY"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/ui/sidebar-context.ts
|
|
3
|
+
var SidebarContext = React$1.createContext(null);
|
|
4
|
+
function useSidebar() {
|
|
5
|
+
const context = React$1.useContext(SidebarContext);
|
|
6
|
+
if (!context) throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
7
|
+
return context;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { SidebarContext, useSidebar };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=sidebar-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-context.js","names":[],"sources":["../../../src/components/ui/sidebar-context.ts"],"sourcesContent":["import * as React from 'react';\n\ntype SidebarContext = {\n state: 'expanded' | 'collapsed';\n open: boolean;\n setOpen: (open: boolean) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n sidebarId: string;\n};\n\nconst SidebarContext = React.createContext<SidebarContext | null>(null);\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext);\n if (!context) {\n throw new Error('useSidebar must be used within a SidebarProvider.');\n }\n\n return context;\n}\n\nexport { SidebarContext, useSidebar };\n"],"mappings":";;AAaA,IAAM,iBAAiB,QAAM,cAAqC,IAAI;AAEtE,SAAS,aAAa;CACpB,MAAM,UAAU,QAAM,WAAW,cAAc;CAC/C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,mDAAmD;CAGrE,OAAO;AACT"}
|