@tryghost/shade 0.0.0-stage → 0.1.0-alpha.1
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 +28 -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 +11 -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,119 @@
|
|
|
1
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
import { useShade } from "../../providers/shade-context.js";
|
|
3
|
+
import { buttonVariants } from "./button-variants.js";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
6
|
+
import * as React$1 from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
9
|
+
//#region src/components/ui/calendar.tsx
|
|
10
|
+
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components, ...props }) {
|
|
11
|
+
const { controlShape, isAdmin7 } = useShade();
|
|
12
|
+
const defaultClassNames = getDefaultClassNames();
|
|
13
|
+
return /* @__PURE__ */ jsx(DayPicker, {
|
|
14
|
+
captionLayout,
|
|
15
|
+
className: cn("group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className),
|
|
16
|
+
classNames: {
|
|
17
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
18
|
+
months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
|
|
19
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
20
|
+
nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
|
|
21
|
+
button_previous: cn(buttonVariants({
|
|
22
|
+
variant: buttonVariant,
|
|
23
|
+
isAdmin7,
|
|
24
|
+
shape: controlShape
|
|
25
|
+
}), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
|
|
26
|
+
button_next: cn(buttonVariants({
|
|
27
|
+
variant: buttonVariant,
|
|
28
|
+
isAdmin7,
|
|
29
|
+
shape: controlShape
|
|
30
|
+
}), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
|
|
31
|
+
month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
|
|
32
|
+
dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
|
|
33
|
+
dropdown_root: cn("relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50", defaultClassNames.dropdown_root),
|
|
34
|
+
dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
|
|
35
|
+
caption_label: cn("font-medium select-none", captionLayout === "label" ? "text-sm" : "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
|
|
36
|
+
table: "w-full border-collapse",
|
|
37
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
38
|
+
weekday: cn("w-(--cell-size) rounded-md text-sm font-normal text-muted-foreground select-none", defaultClassNames.weekday),
|
|
39
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
40
|
+
week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
|
|
41
|
+
week_number: cn("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
|
|
42
|
+
day: cn("group/day relative aspect-square size-full p-0 text-center select-none [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md", defaultClassNames.day),
|
|
43
|
+
range_start: cn("rounded-l-md bg-accent", defaultClassNames.range_start),
|
|
44
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
45
|
+
range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
46
|
+
today: cn("rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
|
|
47
|
+
outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
|
|
48
|
+
disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
|
|
49
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
50
|
+
...classNames
|
|
51
|
+
},
|
|
52
|
+
components: {
|
|
53
|
+
Root: ({ className: rootClassName, rootRef, ...rootProps }) => {
|
|
54
|
+
return /* @__PURE__ */ jsx("div", {
|
|
55
|
+
ref: rootRef,
|
|
56
|
+
className: cn(rootClassName),
|
|
57
|
+
"data-slot": "calendar",
|
|
58
|
+
...rootProps
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
Chevron: ({ className: chevronClassName, orientation, ...chevronProps }) => {
|
|
62
|
+
if (orientation === "left") return /* @__PURE__ */ jsx(ChevronLeftIcon, {
|
|
63
|
+
className: cn("size-4", chevronClassName),
|
|
64
|
+
...chevronProps
|
|
65
|
+
});
|
|
66
|
+
if (orientation === "right") return /* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
67
|
+
className: cn("size-4", chevronClassName),
|
|
68
|
+
...chevronProps
|
|
69
|
+
});
|
|
70
|
+
return /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
71
|
+
className: cn("size-4", chevronClassName),
|
|
72
|
+
...chevronProps
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
DayButton: CalendarDayButton,
|
|
76
|
+
WeekNumber: ({ children, ...weekProps }) => {
|
|
77
|
+
return /* @__PURE__ */ jsx("td", {
|
|
78
|
+
...weekProps,
|
|
79
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
80
|
+
className: "flex size-(--cell-size) items-center justify-center text-center",
|
|
81
|
+
children
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
...components
|
|
86
|
+
},
|
|
87
|
+
formatters: {
|
|
88
|
+
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
89
|
+
...formatters
|
|
90
|
+
},
|
|
91
|
+
showOutsideDays,
|
|
92
|
+
...props
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
Calendar.displayName = "Calendar";
|
|
96
|
+
function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
97
|
+
const defaultClassNames = getDefaultClassNames();
|
|
98
|
+
const ref = React$1.useRef(null);
|
|
99
|
+
React$1.useEffect(() => {
|
|
100
|
+
if (modifiers.focused) ref.current?.focus();
|
|
101
|
+
}, [modifiers.focused]);
|
|
102
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
103
|
+
ref,
|
|
104
|
+
className: cn("flex aspect-square size-auto w-full min-w-(--cell-size) flex-auto items-center justify-center gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className),
|
|
105
|
+
"data-day": day.date.toLocaleDateString(),
|
|
106
|
+
"data-range-end": modifiers.range_end,
|
|
107
|
+
"data-range-middle": modifiers.range_middle,
|
|
108
|
+
"data-range-start": modifiers.range_start,
|
|
109
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
110
|
+
size: "icon",
|
|
111
|
+
variant: "ghost",
|
|
112
|
+
...props
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
CalendarDayButton.displayName = "CalendarDayButton";
|
|
116
|
+
//#endregion
|
|
117
|
+
export { Calendar, CalendarDayButton };
|
|
118
|
+
|
|
119
|
+
//# sourceMappingURL=calendar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.js","names":[],"sources":["../../../src/components/ui/calendar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';\nimport { DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker';\n\nimport { useShade } from '@/providers/shade-context';\nimport { cn } from '@/lib/utils';\nimport { Button } from '@/components/ui/button';\nimport { buttonVariants } from '@/components/ui/button-variants';\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'label',\n buttonVariant = 'ghost',\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>['variant'];\n}) {\n const { controlShape, isAdmin7 } = useShade();\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n captionLayout={captionLayout}\n className={cn(\n 'group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent',\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className,\n )}\n classNames={{\n root: cn('w-fit', defaultClassNames.root),\n months: cn('relative flex flex-col gap-4 md:flex-row', defaultClassNames.months),\n month: cn('flex w-full flex-col gap-4', defaultClassNames.month),\n nav: cn(\n 'absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1',\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant, isAdmin7, shape: controlShape }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant, isAdmin7, shape: controlShape }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_next,\n ),\n month_caption: cn(\n 'flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)',\n defaultClassNames.month_caption,\n ),\n dropdowns: cn(\n 'flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium',\n defaultClassNames.dropdowns,\n ),\n dropdown_root: cn(\n 'relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50',\n defaultClassNames.dropdown_root,\n ),\n dropdown: cn('absolute inset-0 bg-popover opacity-0', defaultClassNames.dropdown),\n caption_label: cn(\n 'font-medium select-none',\n captionLayout === 'label'\n ? 'text-sm'\n : 'flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground',\n defaultClassNames.caption_label,\n ),\n table: 'w-full border-collapse',\n weekdays: cn('flex', defaultClassNames.weekdays),\n weekday: cn(\n 'w-(--cell-size) rounded-md text-sm font-normal text-muted-foreground select-none',\n defaultClassNames.weekday,\n ),\n week: cn('mt-2 flex w-full', defaultClassNames.week),\n week_number_header: cn('w-(--cell-size) select-none', defaultClassNames.week_number_header),\n week_number: cn(\n 'text-[0.8rem] text-muted-foreground select-none',\n defaultClassNames.week_number,\n ),\n day: cn(\n 'group/day relative aspect-square size-full p-0 text-center select-none [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md',\n defaultClassNames.day,\n ),\n range_start: cn('rounded-l-md bg-accent', defaultClassNames.range_start),\n range_middle: cn('rounded-none', defaultClassNames.range_middle),\n range_end: cn('rounded-r-md bg-accent', defaultClassNames.range_end),\n today: cn(\n 'rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none',\n defaultClassNames.today,\n ),\n outside: cn(\n 'text-muted-foreground aria-selected:text-muted-foreground',\n defaultClassNames.outside,\n ),\n disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),\n hidden: cn('invisible', defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className: rootClassName, rootRef, ...rootProps }) => {\n return (\n <div ref={rootRef} className={cn(rootClassName)} data-slot=\"calendar\" {...rootProps} />\n );\n },\n Chevron: ({ className: chevronClassName, orientation, ...chevronProps }) => {\n if (orientation === 'left') {\n return <ChevronLeftIcon className={cn('size-4', chevronClassName)} {...chevronProps} />;\n }\n if (orientation === 'right') {\n return (\n <ChevronRightIcon className={cn('size-4', chevronClassName)} {...chevronProps} />\n );\n }\n return <ChevronDownIcon className={cn('size-4', chevronClassName)} {...chevronProps} />;\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...weekProps }) => {\n return (\n <td {...weekProps}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n );\n },\n ...components,\n }}\n formatters={{\n formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),\n ...formatters,\n }}\n showOutsideDays={showOutsideDays}\n {...props}\n />\n );\n}\nCalendar.displayName = 'Calendar';\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) {\n ref.current?.focus();\n }\n }, [modifiers.focused]);\n\n return (\n <Button\n ref={ref}\n className={cn(\n 'flex aspect-square size-auto w-full min-w-(--cell-size) flex-auto items-center justify-center gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70',\n defaultClassNames.day,\n className,\n )}\n data-day={day.date.toLocaleDateString()}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n data-range-start={modifiers.range_start}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n size=\"icon\"\n variant=\"ghost\"\n {...props}\n />\n );\n}\nCalendarDayButton.displayName = 'CalendarDayButton';\n\nexport { Calendar, CalendarDayButton };\n"],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
//#region src/components/ui/card-variants.ts
|
|
3
|
+
var cardVariants = cva("flex flex-col bg-card text-card-foreground", {
|
|
4
|
+
variants: { variant: {
|
|
5
|
+
outline: "rounded-xl border border-border-default transition-all hover:shadow-xs",
|
|
6
|
+
plain: ""
|
|
7
|
+
} },
|
|
8
|
+
defaultVariants: { variant: "outline" }
|
|
9
|
+
});
|
|
10
|
+
//#endregion
|
|
11
|
+
export { cardVariants };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=card-variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-variants.js","names":[],"sources":["../../../src/components/ui/card-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nconst cardVariants = cva('flex flex-col bg-card text-card-foreground', {\n variants: {\n variant: {\n outline: 'rounded-xl border border-border-default transition-all hover:shadow-xs',\n plain: '',\n },\n },\n defaultVariants: {\n variant: 'outline',\n },\n});\n\nexport { cardVariants };\n"],"mappings":";;AAEA,IAAM,eAAe,IAAI,8CAA8C;CACrE,UAAU,EACR,SAAS;EACP,SAAS;EACT,OAAO;CACT,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
import { cardVariants } from "./card-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/card.tsx
|
|
7
|
+
var CardsVariantContext = React$1.createContext("outline");
|
|
8
|
+
var Card = React$1.forwardRef(({ variant = "outline", className, ...props }, ref) => /* @__PURE__ */ jsx(CardsVariantContext.Provider, {
|
|
9
|
+
value: variant,
|
|
10
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
11
|
+
ref,
|
|
12
|
+
className: cn(cardVariants({
|
|
13
|
+
variant,
|
|
14
|
+
className
|
|
15
|
+
})),
|
|
16
|
+
...props
|
|
17
|
+
})
|
|
18
|
+
}));
|
|
19
|
+
Card.displayName = "Card";
|
|
20
|
+
var cardHeaderVariants = cva("flex flex-col gap-y-1.5", {
|
|
21
|
+
variants: { variant: {
|
|
22
|
+
outline: "p-6",
|
|
23
|
+
plain: "border-b border-border-default py-5"
|
|
24
|
+
} },
|
|
25
|
+
defaultVariants: { variant: "outline" }
|
|
26
|
+
});
|
|
27
|
+
var CardHeader = React$1.forwardRef(({ className, ...props }, ref) => {
|
|
28
|
+
return /* @__PURE__ */ jsx("div", {
|
|
29
|
+
ref,
|
|
30
|
+
className: cn(cardHeaderVariants({
|
|
31
|
+
variant: React$1.useContext(CardsVariantContext),
|
|
32
|
+
className
|
|
33
|
+
})),
|
|
34
|
+
...props
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
CardHeader.displayName = "CardHeader";
|
|
38
|
+
var CardTitle = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
39
|
+
ref,
|
|
40
|
+
className: cn("leading-none font-semibold tracking-tight", className),
|
|
41
|
+
...props
|
|
42
|
+
}));
|
|
43
|
+
CardTitle.displayName = "CardTitle";
|
|
44
|
+
var CardDescription = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
45
|
+
ref,
|
|
46
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
47
|
+
...props
|
|
48
|
+
}));
|
|
49
|
+
CardDescription.displayName = "CardDescription";
|
|
50
|
+
var cardContentVariants = cva("", {
|
|
51
|
+
variants: { variant: {
|
|
52
|
+
outline: "p-6 pt-0",
|
|
53
|
+
plain: "border-b border-border-default"
|
|
54
|
+
} },
|
|
55
|
+
defaultVariants: { variant: "outline" }
|
|
56
|
+
});
|
|
57
|
+
var CardContent = React$1.forwardRef(({ className, ...props }, ref) => {
|
|
58
|
+
return /* @__PURE__ */ jsx("div", {
|
|
59
|
+
ref,
|
|
60
|
+
className: cn(cardContentVariants({
|
|
61
|
+
variant: React$1.useContext(CardsVariantContext),
|
|
62
|
+
className
|
|
63
|
+
})),
|
|
64
|
+
...props
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
CardContent.displayName = "CardContent";
|
|
68
|
+
var cardFooterVariants = cva("flex w-full items-center", {
|
|
69
|
+
variants: { variant: {
|
|
70
|
+
outline: "p-6 pt-0",
|
|
71
|
+
plain: "py-5"
|
|
72
|
+
} },
|
|
73
|
+
defaultVariants: { variant: "outline" }
|
|
74
|
+
});
|
|
75
|
+
var CardFooter = React$1.forwardRef(({ className, ...props }, ref) => {
|
|
76
|
+
return /* @__PURE__ */ jsx("div", {
|
|
77
|
+
className: "flex grow items-end",
|
|
78
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
79
|
+
ref,
|
|
80
|
+
className: cn(cardFooterVariants({
|
|
81
|
+
variant: React$1.useContext(CardsVariantContext),
|
|
82
|
+
className
|
|
83
|
+
})),
|
|
84
|
+
...props
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
CardFooter.displayName = "CardFooter";
|
|
89
|
+
var EmptyCard = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
90
|
+
ref,
|
|
91
|
+
className: cn("flex flex-col rounded-xl border border-border-default bg-card p-6 text-card-foreground transition-all hover:shadow-xs", className),
|
|
92
|
+
...props
|
|
93
|
+
}));
|
|
94
|
+
EmptyCard.displayName = "EmptyCard";
|
|
95
|
+
//#endregion
|
|
96
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, EmptyCard };
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","names":[],"sources":["../../../src/components/ui/card.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cardVariants } from '@/components/ui/card-variants';\nimport { cn } from '@/lib/utils';\nimport { cva } from 'class-variance-authority';\n\ntype CardsVariant = 'outline' | 'plain';\nconst CardsVariantContext = React.createContext<CardsVariant>('outline');\n\nexport interface CardProps extends React.ComponentPropsWithoutRef<'div'> {\n variant?: CardsVariant;\n}\n\nconst Card = React.forwardRef<HTMLDivElement, CardProps>(\n ({ variant = 'outline', className, ...props }, ref) => (\n <CardsVariantContext.Provider value={variant}>\n <div ref={ref} className={cn(cardVariants({ variant, className }))} {...props} />\n </CardsVariantContext.Provider>\n ),\n);\nCard.displayName = 'Card';\n\nconst cardHeaderVariants = cva('flex flex-col gap-y-1.5', {\n variants: {\n variant: {\n outline: 'p-6',\n plain: 'border-b border-border-default py-5',\n },\n },\n defaultVariants: {\n variant: 'outline',\n },\n});\n\nconst CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const variant = React.useContext(CardsVariantContext);\n return <div ref={ref} className={cn(cardHeaderVariants({ variant, className }))} {...props} />;\n },\n);\nCardHeader.displayName = 'CardHeader';\n\nconst CardTitle = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('leading-none font-semibold tracking-tight', className)}\n {...props}\n />\n ),\n);\nCardTitle.displayName = 'CardTitle';\n\nconst CardDescription = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn('text-sm text-muted-foreground', className)} {...props} />\n ),\n);\nCardDescription.displayName = 'CardDescription';\n\nconst cardContentVariants = cva('', {\n variants: {\n variant: {\n outline: 'p-6 pt-0',\n plain: 'border-b border-border-default',\n },\n },\n defaultVariants: {\n variant: 'outline',\n },\n});\n\nconst CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const variant = React.useContext(CardsVariantContext);\n return <div ref={ref} className={cn(cardContentVariants({ variant, className }))} {...props} />;\n },\n);\nCardContent.displayName = 'CardContent';\n\nconst cardFooterVariants = cva('flex w-full items-center', {\n variants: {\n variant: {\n outline: 'p-6 pt-0',\n plain: 'py-5',\n },\n },\n defaultVariants: {\n variant: 'outline',\n },\n});\n\nconst CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const variant = React.useContext(CardsVariantContext);\n return (\n <div className=\"flex grow items-end\">\n <div ref={ref} className={cn(cardFooterVariants({ variant, className }))} {...props} />\n </div>\n );\n },\n);\nCardFooter.displayName = 'CardFooter';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface EmptyCardProps extends React.ComponentPropsWithoutRef<'div'> {}\n\nconst EmptyCard = React.forwardRef<HTMLDivElement, EmptyCardProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex flex-col rounded-xl border border-border-default bg-card p-6 text-card-foreground transition-all hover:shadow-xs',\n className,\n )}\n {...props}\n />\n ),\n);\nEmptyCard.displayName = 'EmptyCard';\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent, EmptyCard };\n"],"mappings":";;;;;;AAMA,IAAM,sBAAsB,QAAM,cAA4B,SAAS;AAMvE,IAAM,OAAO,QAAM,YAChB,EAAE,UAAU,WAAW,WAAW,GAAG,SAAS,QAC7C,oBAAC,oBAAoB,UAArB;CAA8B,OAAO;WACnC,oBAAC,OAAD;EAAU;EAAK,WAAW,GAAG,aAAa;GAAE;GAAS;EAAU,CAAC,CAAC;EAAG,GAAI;CAAQ,CAAA;AACpD,CAAA,CAElC;AACA,KAAK,cAAc;AAEnB,IAAM,qBAAqB,IAAI,2BAA2B;CACxD,UAAU,EACR,SAAS;EACP,SAAS;EACT,OAAO;CACT,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CAAC;AAED,IAAM,aAAa,QAAM,YACtB,EAAE,WAAW,GAAG,SAAS,QAAQ;CAEhC,OAAO,oBAAC,OAAD;EAAU;EAAK,WAAW,GAAG,mBAAmB;GAAE,SADzC,QAAM,WAAW,mBACwB;GAAS;EAAU,CAAC,CAAC;EAAG,GAAI;CAAQ,CAAA;AAC/F,CACF;AACA,WAAW,cAAc;AAEzB,IAAM,YAAY,QAAM,YACrB,EAAE,WAAW,GAAG,SAAS,QACxB,oBAAC,OAAD;CACO;CACL,WAAW,GAAG,6CAA6C,SAAS;CACpE,GAAI;AACL,CAAA,CAEL;AACA,UAAU,cAAc;AAExB,IAAM,kBAAkB,QAAM,YAC3B,EAAE,WAAW,GAAG,SAAS,QACxB,oBAAC,OAAD;CAAU;CAAK,WAAW,GAAG,iCAAiC,SAAS;CAAG,GAAI;AAAQ,CAAA,CAE1F;AACA,gBAAgB,cAAc;AAE9B,IAAM,sBAAsB,IAAI,IAAI;CAClC,UAAU,EACR,SAAS;EACP,SAAS;EACT,OAAO;CACT,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CAAC;AAED,IAAM,cAAc,QAAM,YACvB,EAAE,WAAW,GAAG,SAAS,QAAQ;CAEhC,OAAO,oBAAC,OAAD;EAAU;EAAK,WAAW,GAAG,oBAAoB;GAAE,SAD1C,QAAM,WAAW,mBACyB;GAAS;EAAU,CAAC,CAAC;EAAG,GAAI;CAAQ,CAAA;AAChG,CACF;AACA,YAAY,cAAc;AAE1B,IAAM,qBAAqB,IAAI,4BAA4B;CACzD,UAAU,EACR,SAAS;EACP,SAAS;EACT,OAAO;CACT,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CAAC;AAED,IAAM,aAAa,QAAM,YACtB,EAAE,WAAW,GAAG,SAAS,QAAQ;CAEhC,OACE,oBAAC,OAAD;EAAK,WAAU;YACb,oBAAC,OAAD;GAAU;GAAK,WAAW,GAAG,mBAAmB;IAAE,SAHtC,QAAM,WAAW,mBAGqB;IAAS;GAAU,CAAC,CAAC;GAAG,GAAI;EAAQ,CAAA;CACnF,CAAA;AAET,CACF;AACA,WAAW,cAAc;AAKzB,IAAM,YAAY,QAAM,YACrB,EAAE,WAAW,GAAG,SAAS,QACxB,oBAAC,OAAD;CACO;CACL,WAAW,GACT,yHACA,SACF;CACA,GAAI;AACL,CAAA,CAEL;AACA,UAAU,cAAc"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { cn, formatDisplayDate, formatDisplayDateWithRange } from "../../lib/ds-utils.js";
|
|
2
|
+
import * as RechartsPrimitive from "recharts";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/ui/chart.tsx
|
|
6
|
+
var THEMES = {
|
|
7
|
+
light: "",
|
|
8
|
+
dark: ".dark"
|
|
9
|
+
};
|
|
10
|
+
var ChartContext = React$1.createContext(null);
|
|
11
|
+
function useChart() {
|
|
12
|
+
const context = React$1.useContext(ChartContext);
|
|
13
|
+
if (!context) throw new Error("useChart must be used within a <ChartContainer />");
|
|
14
|
+
return context;
|
|
15
|
+
}
|
|
16
|
+
var ChartContainer = React$1.forwardRef(({ id, className, children, config, ...props }, ref) => {
|
|
17
|
+
const uniqueId = React$1.useId();
|
|
18
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
19
|
+
return /* @__PURE__ */ jsx(ChartContext.Provider, {
|
|
20
|
+
value: { config },
|
|
21
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
22
|
+
ref,
|
|
23
|
+
className: cn("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className),
|
|
24
|
+
"data-chart": chartId,
|
|
25
|
+
...props,
|
|
26
|
+
children: [/* @__PURE__ */ jsx(ChartStyle, {
|
|
27
|
+
config,
|
|
28
|
+
id: chartId
|
|
29
|
+
}), /* @__PURE__ */ jsx(RechartsPrimitive.ResponsiveContainer, { children })]
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
ChartContainer.displayName = "Chart";
|
|
34
|
+
var ChartStyle = ({ id, config }) => {
|
|
35
|
+
const colorConfig = Object.entries(config).filter(([, themeConfig]) => themeConfig.theme || themeConfig.color);
|
|
36
|
+
if (!colorConfig.length) return null;
|
|
37
|
+
return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: Object.entries(THEMES).map(([theme, prefix]) => `
|
|
38
|
+
${prefix} [data-chart=${id}] {
|
|
39
|
+
${colorConfig.map(([key, itemConfig]) => {
|
|
40
|
+
const color = itemConfig.theme?.[theme] || itemConfig.color;
|
|
41
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
42
|
+
}).join("\n")}
|
|
43
|
+
}
|
|
44
|
+
`).join("\n") } });
|
|
45
|
+
};
|
|
46
|
+
var ChartTooltip = RechartsPrimitive.Tooltip;
|
|
47
|
+
var ChartTooltipContent = React$1.forwardRef(({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey }, ref) => {
|
|
48
|
+
const { config } = useChart();
|
|
49
|
+
const tooltipLabel = React$1.useMemo(() => {
|
|
50
|
+
if (hideLabel || !payload?.length) return null;
|
|
51
|
+
const [item] = payload;
|
|
52
|
+
const key = `${labelKey || item.dataKey || item.name || "value"}`;
|
|
53
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
54
|
+
const value = !labelKey && typeof label === "string" ? config[label]?.label || label : itemConfig?.label;
|
|
55
|
+
if (labelFormatter) return /* @__PURE__ */ jsx("div", {
|
|
56
|
+
className: cn("font-medium", labelClassName),
|
|
57
|
+
children: labelFormatter(value, payload)
|
|
58
|
+
});
|
|
59
|
+
if (!value) return null;
|
|
60
|
+
return /* @__PURE__ */ jsx("div", {
|
|
61
|
+
className: cn("font-medium", labelClassName),
|
|
62
|
+
children: value
|
|
63
|
+
});
|
|
64
|
+
}, [
|
|
65
|
+
label,
|
|
66
|
+
labelFormatter,
|
|
67
|
+
payload,
|
|
68
|
+
hideLabel,
|
|
69
|
+
labelClassName,
|
|
70
|
+
config,
|
|
71
|
+
labelKey
|
|
72
|
+
]);
|
|
73
|
+
if (!active || !payload?.length) return null;
|
|
74
|
+
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
75
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
76
|
+
ref,
|
|
77
|
+
className: cn("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", className),
|
|
78
|
+
children: [!nestLabel ? tooltipLabel : null, /* @__PURE__ */ jsx("div", {
|
|
79
|
+
className: "grid gap-1",
|
|
80
|
+
children: payload.map((item, index) => {
|
|
81
|
+
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
82
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
83
|
+
const indicatorColor = color || item.payload.fill || item.color;
|
|
84
|
+
return /* @__PURE__ */ jsx("div", {
|
|
85
|
+
className: cn("flex w-full flex-wrap items-stretch gap-2 [&>svg]:size-2.5 [&>svg]:text-muted-foreground", indicator === "dot" && "items-center"),
|
|
86
|
+
children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxs(Fragment$1, { children: [itemConfig?.icon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsx("div", {
|
|
87
|
+
className: cn("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
|
|
88
|
+
"h-2.5 w-2.5": indicator === "dot",
|
|
89
|
+
"w-1": indicator === "line",
|
|
90
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
|
91
|
+
"my-0.5": nestLabel && indicator === "dashed"
|
|
92
|
+
}),
|
|
93
|
+
style: {
|
|
94
|
+
"--color-bg": indicatorColor,
|
|
95
|
+
"--color-border": indicatorColor
|
|
96
|
+
}
|
|
97
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
98
|
+
className: cn("flex flex-1 justify-between gap-1.5 leading-none", nestLabel ? "items-end" : "items-center"),
|
|
99
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
100
|
+
className: "grid gap-1.5",
|
|
101
|
+
children: [nestLabel ? tooltipLabel : null, /* @__PURE__ */ jsx("span", {
|
|
102
|
+
className: "text-muted-foreground",
|
|
103
|
+
children: itemConfig?.label || item.name
|
|
104
|
+
})]
|
|
105
|
+
}), item.value && /* @__PURE__ */ jsx("span", {
|
|
106
|
+
className: "font-mono font-medium text-foreground tabular-nums",
|
|
107
|
+
children: item.value.toLocaleString()
|
|
108
|
+
})]
|
|
109
|
+
})] })
|
|
110
|
+
}, item.dataKey);
|
|
111
|
+
})
|
|
112
|
+
})]
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
ChartTooltipContent.displayName = "ChartTooltip";
|
|
116
|
+
var ChartLegend = RechartsPrimitive.Legend;
|
|
117
|
+
var ChartLegendContent = React$1.forwardRef(({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }, ref) => {
|
|
118
|
+
const { config } = useChart();
|
|
119
|
+
if (!payload?.length) return null;
|
|
120
|
+
return /* @__PURE__ */ jsx("div", {
|
|
121
|
+
ref,
|
|
122
|
+
className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className),
|
|
123
|
+
children: payload.map((item) => {
|
|
124
|
+
const key = `${nameKey || item.dataKey || "value"}`;
|
|
125
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
126
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
127
|
+
className: cn("flex items-center gap-1.5 [&>svg]:size-3 [&>svg]:text-muted-foreground"),
|
|
128
|
+
children: [itemConfig?.icon && !hideIcon ? /* @__PURE__ */ jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsx("div", {
|
|
129
|
+
className: "size-2 shrink-0 rounded-full",
|
|
130
|
+
style: { backgroundColor: item.color }
|
|
131
|
+
}), itemConfig?.label]
|
|
132
|
+
}, item.value);
|
|
133
|
+
})
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
ChartLegendContent.displayName = "ChartLegend";
|
|
137
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
138
|
+
if (typeof payload !== "object" || payload === null) return;
|
|
139
|
+
const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
|
|
140
|
+
let configLabelKey = key;
|
|
141
|
+
if (key in payload && typeof payload[key] === "string") configLabelKey = payload[key];
|
|
142
|
+
else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") configLabelKey = payloadPayload[key];
|
|
143
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
144
|
+
}
|
|
145
|
+
var AlignedAxisTick = ({ x, y, payload, index, textAnchor = index === 0 ? "start" : "end", formatter = (v) => String(v) }) => {
|
|
146
|
+
return /* @__PURE__ */ jsx("g", {
|
|
147
|
+
transform: `translate(${x},${y})`,
|
|
148
|
+
children: /* @__PURE__ */ jsx("text", {
|
|
149
|
+
dy: 16,
|
|
150
|
+
fill: "var(--muted-foreground)",
|
|
151
|
+
textAnchor,
|
|
152
|
+
x: 0,
|
|
153
|
+
y: -12,
|
|
154
|
+
children: formatter(payload.value)
|
|
155
|
+
})
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
var DateTooltipContent = ({ color, active, payload, range }) => {
|
|
159
|
+
if (!active || !payload?.length) return null;
|
|
160
|
+
const { date, formattedValue, label } = payload[0].payload;
|
|
161
|
+
const displayValue = formattedValue || payload[0].value;
|
|
162
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
163
|
+
className: "min-w-[120px] rounded-lg border bg-background px-3 py-2 shadow-lg",
|
|
164
|
+
children: [date && /* @__PURE__ */ jsx("div", {
|
|
165
|
+
className: "text-sm text-foreground",
|
|
166
|
+
children: range ? formatDisplayDateWithRange(date, range) : formatDisplayDate(date)
|
|
167
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
168
|
+
className: "flex items-center gap-2",
|
|
169
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
170
|
+
className: "inline-block size-[9px] rounded-[2px] opacity-50",
|
|
171
|
+
style: { backgroundColor: color || "var(--chart-blue)" }
|
|
172
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
173
|
+
className: "flex grow items-center justify-between gap-3",
|
|
174
|
+
children: [label && /* @__PURE__ */ jsx("div", {
|
|
175
|
+
className: "text-sm text-muted-foreground",
|
|
176
|
+
children: label
|
|
177
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
178
|
+
className: "font-mono font-medium",
|
|
179
|
+
children: displayValue
|
|
180
|
+
})]
|
|
181
|
+
})]
|
|
182
|
+
})]
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
//#endregion
|
|
186
|
+
export { AlignedAxisTick, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, DateTooltipContent, DateTooltipContent as default };
|
|
187
|
+
|
|
188
|
+
//# sourceMappingURL=chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.js","names":[],"sources":["../../../src/components/ui/chart.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { cn, formatDisplayDate, formatDisplayDateWithRange } from '@/lib/utils';\n\n// Format: { THEME_NAME: CSS_SELECTOR }\nconst THEMES = { light: '', dark: '.dark' } as const;\n\nexport type ChartConfig = {\n [k in string]: {\n label?: React.ReactNode;\n icon?: React.ComponentType;\n } & (\n | { color?: string; theme?: never }\n | { color?: never; theme: Record<keyof typeof THEMES, string> }\n );\n};\n\ntype ChartContextProps = {\n config: ChartConfig;\n};\n\nconst ChartContext = React.createContext<ChartContextProps | null>(null);\n\nfunction useChart() {\n const context = React.useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\nconst ChartContainer = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<'div'> & {\n config: ChartConfig;\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n }\n>(({ id, className, children, config, ...props }, ref) => {\n const uniqueId = React.useId();\n const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n ref={ref}\n className={cn(\n \"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden\",\n className,\n )}\n data-chart={chartId}\n {...props}\n >\n <ChartStyle config={config} id={chartId} />\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n});\nChartContainer.displayName = 'Chart';\n\nconst ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {\n const colorConfig = Object.entries(config).filter(\n ([, themeConfig]) => themeConfig.theme || themeConfig.color,\n );\n\n if (!colorConfig.length) {\n return null;\n }\n\n return (\n <style\n dangerouslySetInnerHTML={{\n __html: Object.entries(THEMES)\n .map(\n ([theme, prefix]) => `\n${prefix} [data-chart=${id}] {\n${colorConfig\n .map(([key, itemConfig]) => {\n const color = itemConfig.theme?.[theme as keyof typeof itemConfig.theme] || itemConfig.color;\n return color ? ` --color-${key}: ${color};` : null;\n })\n .join('\\n')}\n}\n`,\n )\n .join('\\n'),\n }}\n />\n );\n};\n\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\nconst ChartTooltipContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof RechartsPrimitive.Tooltip> &\n React.ComponentProps<'div'> & {\n hideLabel?: boolean;\n hideIndicator?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n nameKey?: string;\n labelKey?: string;\n }\n>(\n (\n {\n active,\n payload,\n className,\n indicator = 'dot',\n hideLabel = false,\n hideIndicator = false,\n label,\n labelFormatter,\n labelClassName,\n formatter,\n color,\n nameKey,\n labelKey,\n },\n ref,\n ) => {\n const { config } = useChart();\n\n const tooltipLabel = React.useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n const key = `${labelKey || item.dataKey || item.name || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value =\n !labelKey && typeof label === 'string'\n ? config[label as keyof typeof config]?.label || label\n : itemConfig?.label;\n\n if (labelFormatter) {\n return (\n <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>\n );\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>;\n }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot';\n\n return (\n <div\n ref={ref}\n className={cn(\n 'grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1\">\n {payload.map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || item.payload.fill || item.color;\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n 'flex w-full flex-wrap items-stretch gap-2 [&>svg]:size-2.5 [&>svg]:text-muted-foreground',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item?.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload)\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn(\n 'shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)',\n {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent':\n indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed',\n },\n )}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor,\n } as React.CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between gap-1.5 leading-none',\n nestLabel ? 'items-end' : 'items-center',\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">\n {itemConfig?.label || item.name}\n </span>\n </div>\n {item.value && (\n <span className=\"font-mono font-medium text-foreground tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n )}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n },\n);\nChartTooltipContent.displayName = 'ChartTooltip';\n\nconst ChartLegend = RechartsPrimitive.Legend;\n\nconst ChartLegendContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<'div'> &\n Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> & {\n hideIcon?: boolean;\n nameKey?: string;\n }\n>(({ className, hideIcon = false, payload, verticalAlign = 'bottom', nameKey }, ref) => {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'flex items-center justify-center gap-4',\n verticalAlign === 'top' ? 'pb-3' : 'pt-3',\n className,\n )}\n >\n {payload.map((item) => {\n const key = `${nameKey || item.dataKey || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={item.value}\n className={cn('flex items-center gap-1.5 [&>svg]:size-3 [&>svg]:text-muted-foreground')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"size-2 shrink-0 rounded-full\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n});\nChartLegendContent.displayName = 'ChartLegend';\n\n// Helper to extract item config from a payload.\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {\n if (typeof payload !== 'object' || payload === null) {\n return undefined;\n }\n\n const payloadPayload =\n 'payload' in payload && typeof payload.payload === 'object' && payload.payload !== null\n ? payload.payload\n : undefined;\n\n let configLabelKey: string = key;\n\n if (key in payload && typeof payload[key as keyof typeof payload] === 'string') {\n configLabelKey = payload[key as keyof typeof payload] as string;\n } else if (\n payloadPayload &&\n key in payloadPayload &&\n typeof payloadPayload[key as keyof typeof payloadPayload] === 'string'\n ) {\n configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string;\n }\n\n return configLabelKey in config ? config[configLabelKey] : config[key as keyof typeof config];\n}\n\ninterface AlignedAxisTickProps {\n x: number;\n y: number;\n payload: {\n value: string | number;\n };\n index: number;\n textAnchor?: 'start' | 'middle' | 'end';\n formatter?: (value: string | number) => string;\n}\n\nconst AlignedAxisTick: React.FC<AlignedAxisTickProps> = ({\n x,\n y,\n payload,\n index,\n textAnchor = index === 0 ? 'start' : 'end',\n formatter = (v) => String(v),\n}) => {\n return (\n <g transform={`translate(${x},${y})`}>\n <text dy={16} fill=\"var(--muted-foreground)\" textAnchor={textAnchor} x={0} y={-12}>\n {formatter(payload.value)}\n </text>\n </g>\n );\n};\n\ninterface DateTooltipPayload {\n value: number;\n payload: {\n date?: string;\n formattedValue?: string;\n label?: string;\n };\n}\n\ninterface DateTooltipProps {\n color?: string;\n active?: boolean;\n payload?: DateTooltipPayload[];\n range?: number;\n}\n\nconst DateTooltipContent = ({ color, active, payload, range }: DateTooltipProps) => {\n if (!active || !payload?.length) {\n return null;\n }\n\n const { date, formattedValue, label } = payload[0].payload;\n const displayValue = formattedValue || payload[0].value;\n\n return (\n <div className=\"min-w-[120px] rounded-lg border bg-background px-3 py-2 shadow-lg\">\n {date && (\n <div className=\"text-sm text-foreground\">\n {range ? formatDisplayDateWithRange(date, range) : formatDisplayDate(date)}\n </div>\n )}\n <div className=\"flex items-center gap-2\">\n <span\n className=\"inline-block size-[9px] rounded-[2px] opacity-50\"\n style={{ backgroundColor: color || 'var(--chart-blue)' }}\n ></span>\n <div className=\"flex grow items-center justify-between gap-3\">\n {label && <div className=\"text-sm text-muted-foreground\">{label}</div>}\n <div className=\"font-mono font-medium\">{displayValue}</div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default DateTooltipContent;\n\nexport {\n ChartContainer,\n ChartTooltip,\n ChartTooltipContent,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n AlignedAxisTick,\n DateTooltipContent,\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
import { inputSurface } from "./input-surface.js";
|
|
3
|
+
import { Check } from "lucide-react";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
7
|
+
//#region src/components/ui/checkbox.tsx
|
|
8
|
+
var Checkbox = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(CheckboxPrimitive.Root, {
|
|
9
|
+
ref,
|
|
10
|
+
className: cn(inputSurface("self"), "peer grid size-4 shrink-0 place-content-center rounded-xs border-border-strong p-0 text-primary enabled:hover:bg-interactive-hover data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground enabled:data-[state=checked]:hover:bg-primary", className),
|
|
11
|
+
...props,
|
|
12
|
+
children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, {
|
|
13
|
+
className: cn("grid place-content-center text-current"),
|
|
14
|
+
children: /* @__PURE__ */ jsx(Check, { className: "size-4" })
|
|
15
|
+
})
|
|
16
|
+
}));
|
|
17
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Checkbox };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":[],"sources":["../../../src/components/ui/checkbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { Check } from 'lucide-react';\n\nimport { inputSurface } from '@/components/ui/input-surface';\nimport { cn } from '@/lib/utils';\n\nconst Checkbox = React.forwardRef<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n inputSurface('self'),\n 'peer grid size-4 shrink-0 place-content-center rounded-xs border-border-strong p-0 text-primary enabled:hover:bg-interactive-hover data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground enabled:data-[state=checked]:hover:bg-primary',\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className={cn('grid place-content-center text-current')}>\n <Check className=\"size-4\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n"],"mappings":";;;;;;;AAOA,IAAM,WAAW,QAAM,YAGpB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,kBAAkB,MAAnB;CACO;CACL,WAAW,GACT,aAAa,MAAM,GACnB,qSACA,SACF;CACA,GAAI;WAEJ,oBAAC,kBAAkB,WAAnB;EAA6B,WAAW,GAAG,wCAAwC;YACjF,oBAAC,OAAD,EAAO,WAAU,SAAU,CAAA;CACA,CAAA;AACP,CAAA,CACzB;AACD,SAAS,cAAc,kBAAkB,KAAK"}
|