@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,150 @@
|
|
|
1
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
import { useFocusContext } from "../../providers/shade-context.js";
|
|
3
|
+
import { Stack } from "../primitives/stack.js";
|
|
4
|
+
import { inputSurface } from "./input-surface.js";
|
|
5
|
+
import { FieldDescription, FieldLabel } from "./field.js";
|
|
6
|
+
import { forwardRef, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import CodeMirror, { EditorView, tooltips } from "@uiw/react-codemirror";
|
|
9
|
+
//#region src/components/ui/code-editor-view.tsx
|
|
10
|
+
var codeMirrorClasses = [
|
|
11
|
+
"[&_.cm-editor]:bg-transparent",
|
|
12
|
+
"[&_.cm-editor]:border-transparent",
|
|
13
|
+
"[&_.cm-scroller]:font-mono",
|
|
14
|
+
"[&_.cm-scroller]:border-transparent",
|
|
15
|
+
"[&_.cm-activeLine]:bg-transparent",
|
|
16
|
+
"[&_.cm-activeLineGutter]:bg-transparent",
|
|
17
|
+
"[&_.cm-gutters]:bg-muted",
|
|
18
|
+
"[&_.cm-gutters]:text-muted-foreground",
|
|
19
|
+
"[&_.cm-gutters]:border-border",
|
|
20
|
+
"[&_.cm-cursor]:border-foreground"
|
|
21
|
+
].join(" ");
|
|
22
|
+
var CodeEditorView = forwardRef(function CodeEditorView({ title, value, height = "200px", error, hint, clearBg = true, extensions, ariaLabel, editable = true, onChange, onFocus, onBlur, className, ...props }, ref) {
|
|
23
|
+
const id = useId();
|
|
24
|
+
const labelId = `${id}-label`;
|
|
25
|
+
const hintId = `${id}-description`;
|
|
26
|
+
const hasTitle = Boolean(title);
|
|
27
|
+
const sizeRef = useRef(null);
|
|
28
|
+
const { darkMode, setFocusState } = useFocusContext();
|
|
29
|
+
const focusedRef = useRef(false);
|
|
30
|
+
const setFocusStateRef = useRef(setFocusState);
|
|
31
|
+
const [width, setWidth] = useState(100);
|
|
32
|
+
const [resolvedExtensions, setResolvedExtensions] = useState([]);
|
|
33
|
+
setFocusStateRef.current = setFocusState;
|
|
34
|
+
const [tooltipParent] = useState(() => document.createElement("div"));
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
tooltipParent.className = "shade cm-tooltip-parent pointer-events-none fixed inset-0 z-[60]";
|
|
37
|
+
document.body.appendChild(tooltipParent);
|
|
38
|
+
return () => {
|
|
39
|
+
tooltipParent.remove();
|
|
40
|
+
};
|
|
41
|
+
}, [tooltipParent]);
|
|
42
|
+
const basicSetup = useMemo(() => ({
|
|
43
|
+
crosshairCursor: false,
|
|
44
|
+
searchKeymap: false
|
|
45
|
+
}), []);
|
|
46
|
+
const editorExtensions = useMemo(() => {
|
|
47
|
+
const contentAttributes = { id };
|
|
48
|
+
if (hasTitle) contentAttributes["aria-labelledby"] = labelId;
|
|
49
|
+
else if (ariaLabel) contentAttributes["aria-label"] = ariaLabel;
|
|
50
|
+
if (error) contentAttributes["aria-invalid"] = "true";
|
|
51
|
+
if (hint) contentAttributes["aria-describedby"] = hintId;
|
|
52
|
+
if (!editable) contentAttributes["aria-disabled"] = "true";
|
|
53
|
+
return [
|
|
54
|
+
...resolvedExtensions,
|
|
55
|
+
tooltips({
|
|
56
|
+
position: "fixed",
|
|
57
|
+
parent: tooltipParent
|
|
58
|
+
}),
|
|
59
|
+
EditorView.contentAttributes.of(contentAttributes)
|
|
60
|
+
];
|
|
61
|
+
}, [
|
|
62
|
+
ariaLabel,
|
|
63
|
+
editable,
|
|
64
|
+
error,
|
|
65
|
+
hasTitle,
|
|
66
|
+
hint,
|
|
67
|
+
hintId,
|
|
68
|
+
id,
|
|
69
|
+
labelId,
|
|
70
|
+
resolvedExtensions,
|
|
71
|
+
tooltipParent
|
|
72
|
+
]);
|
|
73
|
+
const handleFocus = (event) => {
|
|
74
|
+
onFocus?.(event);
|
|
75
|
+
focusedRef.current = true;
|
|
76
|
+
setFocusState(true);
|
|
77
|
+
};
|
|
78
|
+
const handleBlur = (event) => {
|
|
79
|
+
onBlur?.(event);
|
|
80
|
+
focusedRef.current = false;
|
|
81
|
+
setFocusState(false);
|
|
82
|
+
};
|
|
83
|
+
const handleLabelClick = () => {
|
|
84
|
+
if (editable) document.getElementById(id)?.focus();
|
|
85
|
+
};
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
return () => {
|
|
88
|
+
if (focusedRef.current) setFocusStateRef.current(false);
|
|
89
|
+
};
|
|
90
|
+
}, []);
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
let cancelled = false;
|
|
93
|
+
const pendingExtensions = extensions.map((extension) => typeof extension === "function" ? extension() : extension);
|
|
94
|
+
Promise.all(pendingExtensions).then((nextExtensions) => {
|
|
95
|
+
if (!cancelled) setResolvedExtensions(nextExtensions);
|
|
96
|
+
}, () => {
|
|
97
|
+
if (!cancelled) setResolvedExtensions([]);
|
|
98
|
+
});
|
|
99
|
+
return () => {
|
|
100
|
+
cancelled = true;
|
|
101
|
+
};
|
|
102
|
+
}, [extensions]);
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
const resizeObserver = new ResizeObserver(([entry]) => {
|
|
105
|
+
setWidth(entry.contentRect.width);
|
|
106
|
+
});
|
|
107
|
+
resizeObserver.observe(sizeRef.current);
|
|
108
|
+
return () => resizeObserver.disconnect();
|
|
109
|
+
}, []);
|
|
110
|
+
const styles = cn(inputSurface("within"), "peer order-2 w-full max-w-full overflow-hidden", clearBg && "bg-transparent", height === "full" && "h-full", !editable && "cursor-not-allowed opacity-50", codeMirrorClasses, className);
|
|
111
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
112
|
+
className: cn("w-full", height === "full" && "h-full"),
|
|
113
|
+
children: [/* @__PURE__ */ jsx("div", { ref: sizeRef }), /* @__PURE__ */ jsxs(Stack, {
|
|
114
|
+
className: height === "full" ? "h-full" : "",
|
|
115
|
+
gap: "xs",
|
|
116
|
+
style: { width },
|
|
117
|
+
children: [
|
|
118
|
+
title && /* @__PURE__ */ jsx(FieldLabel, {
|
|
119
|
+
id: labelId,
|
|
120
|
+
onClick: handleLabelClick,
|
|
121
|
+
children: title
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ jsx(CodeMirror, {
|
|
124
|
+
ref,
|
|
125
|
+
basicSetup,
|
|
126
|
+
className: styles,
|
|
127
|
+
editable,
|
|
128
|
+
extensions: editorExtensions,
|
|
129
|
+
height: height === "full" ? "100%" : height,
|
|
130
|
+
theme: darkMode ? "dark" : "light",
|
|
131
|
+
value,
|
|
132
|
+
onBlur: handleBlur,
|
|
133
|
+
onChange,
|
|
134
|
+
onFocus: handleFocus,
|
|
135
|
+
...props
|
|
136
|
+
}),
|
|
137
|
+
hint && /* @__PURE__ */ jsx(FieldDescription, {
|
|
138
|
+
className: cn(error && "text-destructive"),
|
|
139
|
+
id: hintId,
|
|
140
|
+
children: hint
|
|
141
|
+
})
|
|
142
|
+
]
|
|
143
|
+
})]
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
CodeEditorView.displayName = "CodeEditorView";
|
|
147
|
+
//#endregion
|
|
148
|
+
export { CodeEditorView as default };
|
|
149
|
+
|
|
150
|
+
//# sourceMappingURL=code-editor-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-editor-view.js","names":[],"sources":["../../../src/components/ui/code-editor-view.tsx"],"sourcesContent":["import CodeMirror, {\n EditorView,\n tooltips,\n type BasicSetupOptions,\n type ReactCodeMirrorProps,\n type ReactCodeMirrorRef,\n} from '@uiw/react-codemirror';\nimport React, {\n type FocusEventHandler,\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { FieldDescription, FieldLabel } from '@/components/ui/field';\nimport { inputSurface } from '@/components/ui/input-surface';\nimport { Stack } from '@/components/primitives/stack';\nimport { cn } from '@/lib/utils';\nimport { useFocusContext } from '@/providers/shade-context';\nimport type { Extension } from '@codemirror/state';\n\nexport interface CodeEditorProps extends Omit<\n ReactCodeMirrorProps,\n 'value' | 'onChange' | 'extensions' | 'title'\n> {\n title?: React.ReactNode;\n value?: string;\n height?: string;\n error?: boolean;\n hint?: React.ReactNode;\n clearBg?: boolean;\n extensions: Array<Extension | Promise<Extension> | (() => Extension | Promise<Extension>)>;\n ariaLabel?: string;\n onChange?: (value: string) => void;\n}\n\nconst codeMirrorClasses = [\n '[&_.cm-editor]:bg-transparent',\n '[&_.cm-editor]:border-transparent',\n '[&_.cm-scroller]:font-mono',\n '[&_.cm-scroller]:border-transparent',\n '[&_.cm-activeLine]:bg-transparent',\n '[&_.cm-activeLineGutter]:bg-transparent',\n '[&_.cm-gutters]:bg-muted',\n '[&_.cm-gutters]:text-muted-foreground',\n '[&_.cm-gutters]:border-border',\n '[&_.cm-cursor]:border-foreground',\n].join(' ');\n\n// Imported asynchronously by CodeEditor so CodeMirror stays out of the main bundle.\nconst CodeEditorView = forwardRef<ReactCodeMirrorRef, CodeEditorProps>(function CodeEditorView(\n {\n title,\n value,\n height = '200px',\n error,\n hint,\n clearBg = true,\n extensions,\n ariaLabel,\n editable = true,\n onChange,\n onFocus,\n onBlur,\n className,\n ...props\n },\n ref,\n) {\n const id = useId();\n const labelId = `${id}-label`;\n const hintId = `${id}-description`;\n const hasTitle = Boolean(title);\n const sizeRef = useRef<HTMLDivElement>(null);\n const { darkMode, setFocusState } = useFocusContext();\n const focusedRef = useRef(false);\n const setFocusStateRef = useRef(setFocusState);\n const [width, setWidth] = useState(100);\n const [resolvedExtensions, setResolvedExtensions] = useState<Extension[]>([]);\n\n setFocusStateRef.current = setFocusState;\n\n // Keep autocomplete outside the editor and accordion overflow boundaries.\n // CodeMirror can switch fixed tooltips to absolute after its first layout\n // measurement. A viewport-sized body host gives both positioning modes the\n // same coordinate space, preventing the visible first-frame jump.\n const [tooltipParent] = useState(() => document.createElement('div'));\n\n useEffect(() => {\n tooltipParent.className = 'shade cm-tooltip-parent pointer-events-none fixed inset-0 z-[60]';\n document.body.appendChild(tooltipParent);\n\n return () => {\n tooltipParent.remove();\n };\n }, [tooltipParent]);\n\n const basicSetup = useMemo<BasicSetupOptions>(\n () => ({\n crosshairCursor: false,\n searchKeymap: false,\n }),\n [],\n );\n\n const editorExtensions = useMemo(() => {\n const contentAttributes: Record<string, string> = { id };\n\n if (hasTitle) {\n contentAttributes['aria-labelledby'] = labelId;\n } else if (ariaLabel) {\n contentAttributes['aria-label'] = ariaLabel;\n }\n if (error) {\n contentAttributes['aria-invalid'] = 'true';\n }\n if (hint) {\n contentAttributes['aria-describedby'] = hintId;\n }\n if (!editable) {\n contentAttributes['aria-disabled'] = 'true';\n }\n\n return [\n ...resolvedExtensions,\n tooltips({ position: 'fixed', parent: tooltipParent }),\n EditorView.contentAttributes.of(contentAttributes),\n ];\n }, [\n ariaLabel,\n editable,\n error,\n hasTitle,\n hint,\n hintId,\n id,\n labelId,\n resolvedExtensions,\n tooltipParent,\n ]);\n\n const handleFocus: FocusEventHandler<HTMLDivElement> = (event) => {\n onFocus?.(event);\n focusedRef.current = true;\n setFocusState(true);\n };\n\n const handleBlur: FocusEventHandler<HTMLDivElement> = (event) => {\n onBlur?.(event);\n focusedRef.current = false;\n setFocusState(false);\n };\n\n const handleLabelClick = () => {\n if (editable) {\n document.getElementById(id)?.focus();\n }\n };\n\n useEffect(() => {\n return () => {\n if (focusedRef.current) {\n setFocusStateRef.current(false);\n }\n };\n }, []);\n\n useEffect(() => {\n let cancelled = false;\n\n const pendingExtensions = extensions.map((extension) =>\n typeof extension === 'function' ? extension() : extension,\n );\n\n Promise.all(pendingExtensions).then(\n (nextExtensions) => {\n if (!cancelled) {\n setResolvedExtensions(nextExtensions);\n }\n },\n () => {\n if (!cancelled) {\n setResolvedExtensions([]);\n }\n },\n );\n\n return () => {\n cancelled = true;\n };\n }, [extensions]);\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver(([entry]) => {\n setWidth(entry.contentRect.width);\n });\n\n resizeObserver.observe(sizeRef.current!);\n\n return () => resizeObserver.disconnect();\n }, []);\n\n const styles = cn(\n inputSurface('within'),\n 'peer order-2 w-full max-w-full overflow-hidden',\n clearBg && 'bg-transparent',\n height === 'full' && 'h-full',\n !editable && 'cursor-not-allowed opacity-50',\n codeMirrorClasses,\n className,\n );\n\n return (\n <div className={cn('w-full', height === 'full' && 'h-full')}>\n <div ref={sizeRef} />\n <Stack className={height === 'full' ? 'h-full' : ''} gap=\"xs\" style={{ width }}>\n {title && (\n <FieldLabel id={labelId} onClick={handleLabelClick}>\n {title}\n </FieldLabel>\n )}\n <CodeMirror\n ref={ref}\n basicSetup={basicSetup}\n className={styles}\n editable={editable}\n extensions={editorExtensions}\n height={height === 'full' ? '100%' : height}\n theme={darkMode ? 'dark' : 'light'}\n value={value}\n onBlur={handleBlur}\n onChange={onChange}\n onFocus={handleFocus}\n {...props}\n />\n {hint && (\n <FieldDescription className={cn(error && 'text-destructive')} id={hintId}>\n {hint}\n </FieldDescription>\n )}\n </Stack>\n </div>\n );\n});\n\nCodeEditorView.displayName = 'CodeEditorView';\n\nexport default CodeEditorView;\n"],"mappings":";;;;;;;;;AAuCA,IAAM,oBAAoB;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,CAAC,KAAK,GAAG;AAGV,IAAM,iBAAiB,WAAgD,SAAS,eAC9E,EACE,OACA,OACA,SAAS,SACT,OACA,MACA,UAAU,MACV,YACA,WACA,WAAW,MACX,UACA,SACA,QACA,WACA,GAAG,SAEL,KACA;CACA,MAAM,KAAK,MAAM;CACjB,MAAM,UAAU,GAAG,GAAG;CACtB,MAAM,SAAS,GAAG,GAAG;CACrB,MAAM,WAAW,QAAQ,KAAK;CAC9B,MAAM,UAAU,OAAuB,IAAI;CAC3C,MAAM,EAAE,UAAU,kBAAkB,gBAAgB;CACpD,MAAM,aAAa,OAAO,KAAK;CAC/B,MAAM,mBAAmB,OAAO,aAAa;C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UAAU,IAAI,SAClD;EAEA,QAAQ,IAAI,iBAAiB,CAAC,CAAC,MAC5B,mBAAmB;GAClB,IAAI,CAAC,WACH,sBAAsB,cAAc;EAExC,SACM;GACJ,IAAI,CAAC,WACH,sBAAsB,CAAC,CAAC;EAE5B,CACF;EAEA,aAAa;GACX,YAAY;EACd;CACF,GAAG,CAAC,UAAU,CAAC;CAEf,gBAAgB;EACd,MAAM,iBAAiB,IAAI,gBAAgB,CAAC,WAAW;GACrD,SAAS,MAAM,YAAY,KAAK;EAClC,CAAC;EAED,eAAe,QAAQ,QAAQ,OAAQ;EAEvC,aAAa,eAAe,WAAW;CACzC,GAAG,CAAC,CAAC;CAEL,MAAM,SAAS,GACb,aAAa,QAAQ,GACrB,kDACA,WAAW,kBACX,WAAW,UAAU,UACrB,CAAC,YAAY,iCACb,mBACA,SACF;CAEA,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,UAAU,WAAW,UAAU,QAAQ;YAA1D,CACE,oBAAC,OAAD,EAAK,KAAK,QAAU,CAAA,GACpB,qBAAC,OAAD;GAAO,WAAW,WAAW,SAAS,WAAW;GAAI,KAAI;GAAK,OAAO,EAAE,MAAM;aAA7E;IACG,SACC,oBAAC,YAAD;KAAY,IAAI;KAAS,SAAS;eAC/B;IACS,CAAA;IAEd,oBAAC,YAAD;KACO;KACO;KACZ,WAAW;KACD;KACV,YAAY;KACZ,QAAQ,WAAW,SAAS,SAAS;KACrC,OAAO,WAAW,SAAS;KACpB;KACP,QAAQ;KACE;KACV,SAAS;KACT,GAAI;IACL,CAAA;IACA,QACC,oBAAC,kBAAD;KAAkB,WAAW,GAAG,SAAS,kBAAkB;KAAG,IAAI;eAC/D;IACe,CAAA;GAEf;IACJ;;AAET,CAAC;AAED,eAAe,cAAc"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { Suspense, forwardRef } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/ui/code-editor.tsx
|
|
4
|
+
var CodeEditorView = React.lazy(() => import("./code-editor-view.js"));
|
|
5
|
+
var CodeEditor = forwardRef(function CodeEditor(props, ref) {
|
|
6
|
+
return /* @__PURE__ */ jsx(Suspense, {
|
|
7
|
+
fallback: null,
|
|
8
|
+
children: /* @__PURE__ */ jsx(CodeEditorView, {
|
|
9
|
+
ref,
|
|
10
|
+
...props
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
CodeEditor.displayName = "CodeEditor";
|
|
15
|
+
//#endregion
|
|
16
|
+
export { CodeEditor };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=code-editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-editor.js","names":[],"sources":["../../../src/components/ui/code-editor.tsx"],"sourcesContent":["import React, { Suspense, forwardRef } from 'react';\n\nimport type { CodeEditorProps } from '@/components/ui/code-editor-view';\nimport type { ReactCodeMirrorRef } from '@uiw/react-codemirror';\n\nexport type { CodeEditorProps };\n\nconst CodeEditorView = React.lazy(() => import('@/components/ui/code-editor-view'));\n\nconst CodeEditor = forwardRef<ReactCodeMirrorRef, CodeEditorProps>(function CodeEditor(props, ref) {\n return (\n <Suspense fallback={null}>\n <CodeEditorView ref={ref} {...props} />\n </Suspense>\n );\n});\n\nCodeEditor.displayName = 'CodeEditor';\n\nexport { CodeEditor };\n"],"mappings":";;;AAOA,IAAM,iBAAiB,MAAM,WAAW,OAAO,wBAAmC;AAElF,IAAM,aAAa,WAAgD,SAAS,WAAW,OAAO,KAAK;CACjG,OACE,oBAAC,UAAD;EAAU,UAAU;YAClB,oBAAC,gBAAD;GAAqB;GAAK,GAAI;EAAQ,CAAA;CAC9B,CAAA;AAEd,CAAC;AAED,WAAW,cAAc"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
import { inputSurface, inputSurfaceClasses } from "./input-surface.js";
|
|
3
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
|
|
4
|
+
import { ChevronDown } from "lucide-react";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/ui/combobox.tsx
|
|
8
|
+
var Combobox = Popover;
|
|
9
|
+
var ComboboxTrigger = React$1.forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ jsx(PopoverTrigger, {
|
|
10
|
+
asChild: true,
|
|
11
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
12
|
+
ref,
|
|
13
|
+
className: cn(inputSurface("self"), inputSurfaceClasses.disabledFieldSelf, "flex h-(--control-height) w-full min-w-0 items-center justify-between px-3 text-control hover:bg-button-hover", className),
|
|
14
|
+
role: "combobox",
|
|
15
|
+
...props,
|
|
16
|
+
type: "button",
|
|
17
|
+
children: [children, /* @__PURE__ */ jsx(ChevronDown, { className: "ml-2 size-4 shrink-0 opacity-50" })]
|
|
18
|
+
})
|
|
19
|
+
}));
|
|
20
|
+
ComboboxTrigger.displayName = "ComboboxTrigger";
|
|
21
|
+
var ComboboxValue = React$1.forwardRef(({ className, placeholder = false, ...props }, ref) => /* @__PURE__ */ jsx("span", {
|
|
22
|
+
ref,
|
|
23
|
+
className: cn("min-w-0 flex-1 truncate text-left", placeholder && "text-muted-foreground", className),
|
|
24
|
+
...props
|
|
25
|
+
}));
|
|
26
|
+
ComboboxValue.displayName = "ComboboxValue";
|
|
27
|
+
var ComboboxContent = React$1.forwardRef(({ align = "start", className, ...props }, ref) => /* @__PURE__ */ jsx(PopoverContent, {
|
|
28
|
+
ref,
|
|
29
|
+
align,
|
|
30
|
+
className: cn("z-[9999] w-(--radix-popover-trigger-width) p-0", className),
|
|
31
|
+
...props
|
|
32
|
+
}));
|
|
33
|
+
ComboboxContent.displayName = "ComboboxContent";
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Combobox, ComboboxContent, ComboboxTrigger, ComboboxValue };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=combobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combobox.js","names":[],"sources":["../../../src/components/ui/combobox.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ChevronDown } from 'lucide-react';\n\nimport { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';\nimport { inputSurface, inputSurfaceClasses } from '@/components/ui/input-surface';\nimport { cn } from '@/lib/utils';\n\nconst Combobox = Popover;\n\nconst ComboboxTrigger = React.forwardRef<\n HTMLButtonElement,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'>\n>(({ children, className, ...props }, ref) => (\n <PopoverTrigger asChild>\n <button\n ref={ref}\n className={cn(\n inputSurface('self'),\n inputSurfaceClasses.disabledFieldSelf,\n 'flex h-(--control-height) w-full min-w-0 items-center justify-between px-3 text-control hover:bg-button-hover',\n className,\n )}\n role=\"combobox\"\n {...props}\n type=\"button\"\n >\n {children}\n <ChevronDown className=\"ml-2 size-4 shrink-0 opacity-50\" />\n </button>\n </PopoverTrigger>\n));\nComboboxTrigger.displayName = 'ComboboxTrigger';\n\ninterface ComboboxValueProps extends React.HTMLAttributes<HTMLSpanElement> {\n placeholder?: boolean;\n}\n\nconst ComboboxValue = React.forwardRef<HTMLSpanElement, ComboboxValueProps>(\n ({ className, placeholder = false, ...props }, ref) => (\n <span\n ref={ref}\n className={cn(\n 'min-w-0 flex-1 truncate text-left',\n placeholder && 'text-muted-foreground',\n className,\n )}\n {...props}\n />\n ),\n);\nComboboxValue.displayName = 'ComboboxValue';\n\nconst ComboboxContent = React.forwardRef<\n React.ElementRef<typeof PopoverContent>,\n React.ComponentPropsWithoutRef<typeof PopoverContent>\n>(({ align = 'start', className, ...props }, ref) => (\n <PopoverContent\n ref={ref}\n align={align}\n className={cn('z-[9999] w-(--radix-popover-trigger-width) p-0', className)}\n {...props}\n />\n));\nComboboxContent.displayName = 'ComboboxContent';\n\nexport { Combobox, ComboboxContent, ComboboxTrigger, ComboboxValue };\n"],"mappings":";;;;;;;AAOA,IAAM,WAAW;AAEjB,IAAM,kBAAkB,QAAM,YAG3B,EAAE,UAAU,WAAW,GAAG,SAAS,QACpC,oBAAC,gBAAD;CAAgB,SAAA;WACd,qBAAC,UAAD;EACO;EACL,WAAW,GACT,aAAa,MAAM,GACnB,oBAAoB,mBACpB,iHACA,SACF;EACA,MAAK;EACL,GAAI;EACJ,MAAK;YAVP,CAYG,UACD,oBAAC,aAAD,EAAa,WAAU,kCAAmC,CAAA,CACpD;;AACM,CAAA,CACjB;AACD,gBAAgB,cAAc;AAM9B,IAAM,gBAAgB,QAAM,YACzB,EAAE,WAAW,cAAc,OAAO,GAAG,SAAS,QAC7C,oBAAC,QAAD;CACO;CACL,WAAW,GACT,qCACA,eAAe,yBACf,SACF;CACA,GAAI;AACL,CAAA,CAEL;AACA,cAAc,cAAc;AAE5B,IAAM,kBAAkB,QAAM,YAG3B,EAAE,QAAQ,SAAS,WAAW,GAAG,SAAS,QAC3C,oBAAC,gBAAD;CACO;CACE;CACP,WAAW,GAAG,kDAAkD,SAAS;CACzE,GAAI;AACL,CAAA,CACF;AACD,gBAAgB,cAAc"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
3
|
+
import { Dialog, DialogContent, DialogTitle } from "./dialog.js";
|
|
4
|
+
import { Check, Search } from "lucide-react";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Command as Command$1 } from "cmdk";
|
|
8
|
+
//#region src/components/ui/command.tsx
|
|
9
|
+
function Command({ className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(Command$1, {
|
|
11
|
+
className: cn("flex size-full flex-col overflow-hidden rounded-menu bg-transparent text-popover-foreground", className),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
var CommandDialog = ({ children, className, ...props }) => {
|
|
16
|
+
return /* @__PURE__ */ jsx(Dialog, {
|
|
17
|
+
...props,
|
|
18
|
+
children: /* @__PURE__ */ jsxs(DialogContent, {
|
|
19
|
+
className: cn("overflow-hidden p-0 shadow-lg", className),
|
|
20
|
+
children: [/* @__PURE__ */ jsx(DialogTitle, { className: "hidden" }), /* @__PURE__ */ jsx(Command, {
|
|
21
|
+
className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5",
|
|
22
|
+
children
|
|
23
|
+
})]
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
function CommandInput({ className, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
29
|
+
className: "flex items-center border-b border-border px-3",
|
|
30
|
+
"cmdk-input-wrapper": "",
|
|
31
|
+
"data-slot": "command-input",
|
|
32
|
+
children: [/* @__PURE__ */ jsx(Search, { className: "me-2 size-4 shrink-0 opacity-50" }), /* @__PURE__ */ jsx(Command$1.Input, {
|
|
33
|
+
className: cn("flex h-11 w-full rounded-control bg-transparent py-3 text-(length:--text-control) text-foreground outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
34
|
+
...props
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function CommandList({ className, ...props }) {
|
|
39
|
+
return /* @__PURE__ */ jsx(Command$1.List, {
|
|
40
|
+
className: cn("max-h-[300px] overflow-x-hidden overflow-y-auto p-1", className),
|
|
41
|
+
"data-slot": "command-list",
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function CommandEmpty({ ...props }) {
|
|
46
|
+
return /* @__PURE__ */ jsx(Command$1.Empty, {
|
|
47
|
+
className: "py-6 text-center text-sm",
|
|
48
|
+
"data-slot": "command-empty",
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function CommandGroup({ className, ...props }) {
|
|
53
|
+
return /* @__PURE__ */ jsx(Command$1.Group, {
|
|
54
|
+
className: cn("overflow-hidden p-1.5 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", className),
|
|
55
|
+
"data-slot": "command-group",
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function CommandSeparator({ className, ...props }) {
|
|
60
|
+
return /* @__PURE__ */ jsx(Command$1.Separator, {
|
|
61
|
+
className: cn("-mx-1.5 h-px bg-border", className),
|
|
62
|
+
"data-slot": "command-separator",
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function CommandItem({ className, ...props }) {
|
|
67
|
+
return /* @__PURE__ */ jsx(Command$1.Item, {
|
|
68
|
+
className: cn("relative flex cursor-default items-center gap-2 rounded-menu-item px-2 py-1.5 text-(length:--text-control) text-foreground outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-interactive-hover [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.5px]", className),
|
|
69
|
+
"data-slot": "command-item",
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
var CommandShortcut = ({ className, ...props }) => {
|
|
74
|
+
return /* @__PURE__ */ jsx("span", {
|
|
75
|
+
className: cn("ms-auto text-xs tracking-widest text-muted-foreground", className),
|
|
76
|
+
"data-slot": "command-shortcut",
|
|
77
|
+
...props
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
function CommandCheck({ icon: Icon = Check, className, ...props }) {
|
|
81
|
+
return /* @__PURE__ */ jsx(Icon, {
|
|
82
|
+
className: cn("ms-auto size-4 text-primary", className),
|
|
83
|
+
"data-check": "true",
|
|
84
|
+
"data-slot": "command-check",
|
|
85
|
+
...props
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
export { Command, CommandCheck, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
|
|
90
|
+
|
|
91
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","names":[],"sources":["../../../src/components/ui/command.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { cn } from '@/lib/utils';\nimport { Dialog, DialogContent, DialogTitle } from '@/components/ui/dialog';\nimport { type DialogProps } from '@radix-ui/react-dialog';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { Check, LucideIcon, Search } from 'lucide-react';\n\nfunction Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n className={cn(\n 'flex size-full flex-col overflow-hidden rounded-menu bg-transparent text-popover-foreground',\n className,\n )}\n {...props}\n />\n );\n}\n\ntype CommandDialogProps = DialogProps & { className?: string };\n\nconst CommandDialog = ({ children, className, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className={cn('overflow-hidden p-0 shadow-lg', className)}>\n <DialogTitle className=\"hidden\" />\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n};\n\nfunction CommandInput({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div\n className=\"flex items-center border-b border-border px-3\"\n {...{ 'cmdk-input-wrapper': '' }}\n data-slot=\"command-input\"\n >\n <Search className=\"me-2 size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n className={cn(\n 'flex h-11 w-full rounded-control bg-transparent py-3 text-(length:--text-control) text-foreground outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n </div>\n );\n}\n\nfunction CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n className={cn('max-h-[300px] overflow-x-hidden overflow-y-auto p-1', className)}\n data-slot=\"command-list\"\n {...props}\n />\n );\n}\n\nfunction CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n className=\"py-6 text-center text-sm\"\n data-slot=\"command-empty\"\n {...props}\n />\n );\n}\n\nfunction CommandGroup({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n className={cn(\n 'overflow-hidden p-1.5 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground',\n className,\n )}\n data-slot=\"command-group\"\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n className={cn('-mx-1.5 h-px bg-border', className)}\n data-slot=\"command-separator\"\n {...props}\n />\n );\n}\n\nfunction CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n className={cn(\n 'relative flex cursor-default items-center gap-2 rounded-menu-item px-2 py-1.5 text-(length:--text-control) text-foreground outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-interactive-hover [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n '[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.5px]',\n className,\n )}\n data-slot=\"command-item\"\n {...props}\n />\n );\n}\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn('ms-auto text-xs tracking-widest text-muted-foreground', className)}\n data-slot=\"command-shortcut\"\n {...props}\n />\n );\n};\n\ninterface ButtonArrowProps extends React.SVGProps<SVGSVGElement> {\n icon?: LucideIcon; // Allows passing any Lucide icon\n}\n\nfunction CommandCheck({ icon: Icon = Check, className, ...props }: ButtonArrowProps) {\n return (\n <Icon\n className={cn('ms-auto size-4 text-primary', className)}\n data-check=\"true\"\n data-slot=\"command-check\"\n {...props}\n />\n );\n}\n\nexport {\n Command,\n CommandCheck,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n};\n"],"mappings":";;;;;;;;AASA,SAAS,QAAQ,EAAE,WAAW,GAAG,SAAwD;CACvF,OACE,oBAAC,WAAD;EACE,WAAW,GACT,+FACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAIA,IAAM,iBAAiB,EAAE,UAAU,WAAW,GAAG,YAAgC;CAC/E,OACE,oBAAC,QAAD;EAAQ,GAAI;YACV,qBAAC,eAAD;GAAe,WAAW,GAAG,iCAAiC,SAAS;aAAvE,CACE,oBAAC,aAAD,EAAa,WAAU,SAAU,CAAA,GACjC,oBAAC,SAAD;IAAS,WAAU;IAChB;GACM,CAAA,CACI;;CACT,CAAA;AAEZ;AAEA,SAAS,aA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;AAEL"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
import { ShadeScope } from "../../shade-scope.js";
|
|
3
|
+
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
7
|
+
//#region src/components/ui/context-menu.tsx
|
|
8
|
+
var ContextMenu = ContextMenuPrimitive.Root;
|
|
9
|
+
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
10
|
+
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
11
|
+
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
12
|
+
var ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
13
|
+
var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
14
|
+
var ContextMenuSubTrigger = React$1.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(ContextMenuPrimitive.SubTrigger, {
|
|
15
|
+
ref,
|
|
16
|
+
className: cn("flex cursor-default items-center gap-2 rounded-menu-item px-2 py-1.5 text-sm outline-hidden select-none hover:bg-accent focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className),
|
|
17
|
+
...props,
|
|
18
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto" })]
|
|
19
|
+
}));
|
|
20
|
+
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
21
|
+
var ContextMenuSubContent = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ShadeScope, { children: /* @__PURE__ */ jsx(ContextMenuPrimitive.SubContent, {
|
|
22
|
+
ref,
|
|
23
|
+
className: cn("z-50 min-w-[8rem] overflow-hidden rounded-menu border bg-popover p-1 text-popover-foreground shadow-lg 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", className),
|
|
24
|
+
...props
|
|
25
|
+
}) }));
|
|
26
|
+
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
27
|
+
var ContextMenuContent = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(ShadeScope, { children: /* @__PURE__ */ jsx(ContextMenuPrimitive.Content, {
|
|
28
|
+
ref,
|
|
29
|
+
className: cn("z-50 min-w-[8rem] overflow-hidden rounded-menu border bg-popover p-1 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", className),
|
|
30
|
+
...props
|
|
31
|
+
}) }) }));
|
|
32
|
+
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
33
|
+
var ContextMenuItem = React$1.forwardRef(({ className, inset, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Item, {
|
|
34
|
+
ref,
|
|
35
|
+
className: cn("relative flex cursor-pointer items-center gap-2 rounded-menu-item px-2 py-1.5 text-sm outline-hidden transition-colors select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0", variant === "destructive" && "text-destructive focus:bg-destructive/10 focus:text-destructive", inset && "pl-8", className),
|
|
36
|
+
...props
|
|
37
|
+
}));
|
|
38
|
+
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
39
|
+
var ContextMenuCheckboxItem = React$1.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(ContextMenuPrimitive.CheckboxItem, {
|
|
40
|
+
ref,
|
|
41
|
+
checked,
|
|
42
|
+
className: cn("relative flex cursor-default items-center rounded-menu-item py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
|
|
43
|
+
...props,
|
|
44
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
45
|
+
className: "absolute left-2 flex size-3.5 items-center justify-center",
|
|
46
|
+
children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "size-4" }) })
|
|
47
|
+
}), children]
|
|
48
|
+
}));
|
|
49
|
+
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
50
|
+
var ContextMenuRadioItem = React$1.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(ContextMenuPrimitive.RadioItem, {
|
|
51
|
+
ref,
|
|
52
|
+
className: cn("relative flex cursor-default items-center rounded-menu-item py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
|
|
53
|
+
...props,
|
|
54
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
55
|
+
className: "absolute left-2 flex size-3.5 items-center justify-center",
|
|
56
|
+
children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "size-2 fill-current" }) })
|
|
57
|
+
}), children]
|
|
58
|
+
}));
|
|
59
|
+
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
60
|
+
var ContextMenuLabel = React$1.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Label, {
|
|
61
|
+
ref,
|
|
62
|
+
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
|
|
63
|
+
...props
|
|
64
|
+
}));
|
|
65
|
+
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
66
|
+
var ContextMenuSeparator = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Separator, {
|
|
67
|
+
ref,
|
|
68
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
69
|
+
...props
|
|
70
|
+
}));
|
|
71
|
+
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
72
|
+
var ContextMenuShortcut = ({ className, ...props }) => {
|
|
73
|
+
return /* @__PURE__ */ jsx("span", {
|
|
74
|
+
className: cn("ml-auto text-xs tracking-wider opacity-60", className),
|
|
75
|
+
...props
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
79
|
+
//#endregion
|
|
80
|
+
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=context-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-menu.js","names":[],"sources":["../../../src/components/ui/context-menu.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as ContextMenuPrimitive from '@radix-ui/react-context-menu';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { ShadeScope } from '@/shade-scope';\n\nconst ContextMenu = ContextMenuPrimitive.Root;\n\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\n\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\nconst ContextMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default items-center gap-2 rounded-menu-item px-2 py-1.5 text-sm outline-hidden select-none hover:bg-accent focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\nconst ContextMenuSubContent = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <ShadeScope>\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-menu border bg-popover p-1 text-popover-foreground shadow-lg 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',\n className,\n )}\n {...props}\n />\n </ShadeScope>\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\nconst ContextMenuContent = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ShadeScope>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-menu border bg-popover p-1 text-popover-foreground shadow-md',\n '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',\n className,\n )}\n {...props}\n />\n </ShadeScope>\n </ContextMenuPrimitive.Portal>\n));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\nconst ContextMenuItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n }\n>(({ className, inset, variant = 'default', ...props }, ref) => (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-pointer items-center gap-2 rounded-menu-item px-2 py-1.5 text-sm outline-hidden transition-colors select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0',\n variant === 'destructive' &&\n 'text-destructive focus:bg-destructive/10 focus:text-destructive',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.CheckboxItem\n ref={ref}\n checked={checked}\n className={cn(\n 'relative flex cursor-default items-center rounded-menu-item py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Check className=\"size-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n));\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\n\nconst ContextMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default items-center rounded-menu-item py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Circle className=\"size-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\nconst ContextMenuLabel = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\nconst ContextMenuSeparator = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-muted', className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\nconst ContextMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-xs tracking-wider opacity-60', className)} {...props} />;\n};\nContextMenuShortcut.displayName = 'ContextMenuShortcut';\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n"],"mappings":";;;;;;;AAOA,IAAM,cAAc,qBAAqB;AAEzC,IAAM,qBAAqB,qBAAqB;AAEhD,IAAM,mBAAmB,qBAAqB;AAE9C,IAAM,oBAAoB,qBAAqB;AAE/C,IAAM,iBAAiB,qBAAqB;AAE5C,IAAM,wBAAwB,qBAAqB;AAEnD,IAAM,wBAAwB,QAAM,YAKjC,EAAE,WAAW,OAAO,UAAU,GAAG,SAAS,QAC3C,qBAAC,qBAAqB,YAAtB;CACO;CACL,WAAW,GACT,mOACA,SAAS,QACT,SACF;CACA,GAAI;WAPN,CASG,UACD,oBAAC,cAAD,EAAc,WAAU,UAAW,CAAA,CACJ;EAClC;AACD,sBAAsB,cAAc,qBAAqB,WAAW;AAEpE,IAAM,wBAAwB,QAAM,YAGjC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,YAAD,EAAA,UACE,oBAAC,qBAAqB,YAAtB;CACO;CACL,WAAW,GACT,2bACA,SACF;CACA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mBAAmB,QAAM,YAK5B,EAAE,WAAW,OAAO,GAAG,SAAS,QACjC,oBAAC,qBAAqB,OAAtB;CACO;CACL,WAAW,GAAG,qCAAqC,SAAS,QAAQ,SAAS;CAC7E,GAAI;AACL,CAAA,CACF;AACD,iBAAiB,cAAc,qBAAqB,MAAM;AAE1D,IAAM,uBAAuB,QAAM,YAGhC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,qBAAqB,WAAtB;CACO;CACL,WAAW,GAAG,4BAA4B,SAAS;CACnD,GAAI;AACL,CAAA,CACF;AACD,qBAAqB,cAAc,qBAAqB,UAAU;AAElE,IAAM,uBAAuB,EAAE,WAAW,GAAG,YAAmD;CAC9F,OAAO,oBAAC,QAAD;EAAM,WAAW,GAAG,6CAA6C,SAAS;EAAG,GAAI;CAAQ,CAAA;AAClG;AACA,oBAAoB,cAAc"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
import { useShade } from "../../providers/shade-context.js";
|
|
3
|
+
import { Inline } from "../primitives/inline.js";
|
|
4
|
+
import { Stack } from "../primitives/stack.js";
|
|
5
|
+
import { Text } from "../primitives/text.js";
|
|
6
|
+
import { Button } from "./button.js";
|
|
7
|
+
import { inputSurface } from "./input-surface.js";
|
|
8
|
+
import * as React$1 from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/ui/copy-field.tsx
|
|
11
|
+
var CopyFieldContext = React$1.createContext(null);
|
|
12
|
+
function useCopyField() {
|
|
13
|
+
const context = React$1.useContext(CopyFieldContext);
|
|
14
|
+
if (!context) throw new Error("CopyField subcomponents must be used within CopyField");
|
|
15
|
+
return context;
|
|
16
|
+
}
|
|
17
|
+
var CopyField = React$1.forwardRef(({ children, className, disabled = false, value, ...props }, ref) => {
|
|
18
|
+
const [copied, setCopied] = React$1.useState(false);
|
|
19
|
+
const labelId = React$1.useId();
|
|
20
|
+
const resetTimer = React$1.useRef(null);
|
|
21
|
+
React$1.useEffect(() => {
|
|
22
|
+
setCopied(false);
|
|
23
|
+
if (resetTimer.current) {
|
|
24
|
+
clearTimeout(resetTimer.current);
|
|
25
|
+
resetTimer.current = null;
|
|
26
|
+
}
|
|
27
|
+
}, [value]);
|
|
28
|
+
React$1.useEffect(() => {
|
|
29
|
+
return () => {
|
|
30
|
+
if (resetTimer.current) clearTimeout(resetTimer.current);
|
|
31
|
+
};
|
|
32
|
+
}, []);
|
|
33
|
+
const copy = React$1.useCallback(async () => {
|
|
34
|
+
if (disabled) return;
|
|
35
|
+
try {
|
|
36
|
+
await navigator.clipboard.writeText(value);
|
|
37
|
+
setCopied(true);
|
|
38
|
+
if (resetTimer.current) clearTimeout(resetTimer.current);
|
|
39
|
+
resetTimer.current = setTimeout(() => setCopied(false), 2e3);
|
|
40
|
+
} catch {
|
|
41
|
+
setCopied(false);
|
|
42
|
+
}
|
|
43
|
+
}, [disabled, value]);
|
|
44
|
+
const contextValue = React$1.useMemo(() => ({
|
|
45
|
+
copied,
|
|
46
|
+
copy,
|
|
47
|
+
disabled,
|
|
48
|
+
labelId,
|
|
49
|
+
value
|
|
50
|
+
}), [
|
|
51
|
+
copied,
|
|
52
|
+
copy,
|
|
53
|
+
disabled,
|
|
54
|
+
labelId,
|
|
55
|
+
value
|
|
56
|
+
]);
|
|
57
|
+
return /* @__PURE__ */ jsx(CopyFieldContext.Provider, {
|
|
58
|
+
value: contextValue,
|
|
59
|
+
children: /* @__PURE__ */ jsx(Stack, {
|
|
60
|
+
ref,
|
|
61
|
+
className: cn("group/copy-field w-full", className),
|
|
62
|
+
"data-disabled": disabled || void 0,
|
|
63
|
+
"data-slot": "copy-field",
|
|
64
|
+
gap: "xs",
|
|
65
|
+
...props,
|
|
66
|
+
children
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
CopyField.displayName = "CopyField";
|
|
71
|
+
var CopyFieldLabel = React$1.forwardRef(({ className, id, ...props }, ref) => {
|
|
72
|
+
const { labelId } = useCopyField();
|
|
73
|
+
return /* @__PURE__ */ jsx(Text, {
|
|
74
|
+
ref,
|
|
75
|
+
as: "div",
|
|
76
|
+
className: cn("text-control! font-medium group-data-[disabled=true]/copy-field:opacity-50", className),
|
|
77
|
+
"data-slot": "copy-field-label",
|
|
78
|
+
id: id || labelId,
|
|
79
|
+
leading: "snug",
|
|
80
|
+
...props
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
CopyFieldLabel.displayName = "CopyFieldLabel";
|
|
84
|
+
var CopyFieldContent = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
|
|
85
|
+
ref,
|
|
86
|
+
className: cn(inputSurface("within"), "group/copy-field-content relative flex h-(--control-height) w-full items-center overflow-hidden bg-control-readonly-surface px-3 py-1 group-data-[disabled=true]/copy-field:cursor-not-allowed group-data-[disabled=true]/copy-field:opacity-50", className),
|
|
87
|
+
"data-slot": "copy-field-content",
|
|
88
|
+
...props
|
|
89
|
+
}));
|
|
90
|
+
CopyFieldContent.displayName = "CopyFieldContent";
|
|
91
|
+
var CopyFieldValue = React$1.forwardRef(({ children, className, ...props }, ref) => {
|
|
92
|
+
const { disabled, labelId, value } = useCopyField();
|
|
93
|
+
return /* @__PURE__ */ jsx(Text, {
|
|
94
|
+
ref,
|
|
95
|
+
"aria-disabled": disabled || void 0,
|
|
96
|
+
"aria-labelledby": props["aria-label"] || props["aria-labelledby"] ? props["aria-labelledby"] : labelId,
|
|
97
|
+
"aria-readonly": "true",
|
|
98
|
+
as: "div",
|
|
99
|
+
className: cn("min-w-0 truncate pr-2 text-muted-foreground", className),
|
|
100
|
+
"data-slot": "copy-field-value",
|
|
101
|
+
leading: "snug",
|
|
102
|
+
role: "textbox",
|
|
103
|
+
tabIndex: disabled ? void 0 : 0,
|
|
104
|
+
...props,
|
|
105
|
+
children: children ?? value
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
CopyFieldValue.displayName = "CopyFieldValue";
|
|
109
|
+
var CopyFieldActions = React$1.forwardRef(({ className, ...props }, ref) => {
|
|
110
|
+
const { isAdmin7 } = useShade();
|
|
111
|
+
return /* @__PURE__ */ jsx(Inline, {
|
|
112
|
+
ref,
|
|
113
|
+
className: cn("absolute top-1/2 right-[1px] -translate-y-1/2 gap-px bg-control-readonly-surface pl-1 transition-opacity md:pointer-events-none md:opacity-0 md:group-focus-within/copy-field-content:pointer-events-auto md:group-focus-within/copy-field-content:opacity-100 md:group-hover/copy-field-content:pointer-events-auto md:group-hover/copy-field-content:opacity-100 [&_button:not([data-slot=copy-field-copy-button])]:bg-control-readonly-surface [&_button:not([data-slot=copy-field-copy-button])]:hover:bg-secondary [&_button[data-control-shape=rounded]]:rounded-sm", isAdmin7 ? "[&_button]:h-6" : "[&_button]:h-7", className),
|
|
114
|
+
"data-slot": "copy-field-actions",
|
|
115
|
+
gap: "none",
|
|
116
|
+
...props
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
CopyFieldActions.displayName = "CopyFieldActions";
|
|
120
|
+
var CopyFieldCopyButton = React$1.forwardRef(({ children = "Copy", className, copiedLabel = "Copied", disabled, onClick, ...props }, ref) => {
|
|
121
|
+
const { copied, copy, disabled: fieldDisabled } = useCopyField();
|
|
122
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
123
|
+
ref,
|
|
124
|
+
className: cn("bg-surface-elevated hover:border-border-strong/40 hover:bg-surface-elevated", className),
|
|
125
|
+
disabled: fieldDisabled || disabled,
|
|
126
|
+
size: "sm",
|
|
127
|
+
type: "button",
|
|
128
|
+
variant: "outline",
|
|
129
|
+
onClick: async (event) => {
|
|
130
|
+
await copy();
|
|
131
|
+
onClick?.(event);
|
|
132
|
+
},
|
|
133
|
+
...props,
|
|
134
|
+
"data-slot": "copy-field-copy-button",
|
|
135
|
+
children: copied ? copiedLabel : children
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
CopyFieldCopyButton.displayName = "CopyFieldCopyButton";
|
|
139
|
+
//#endregion
|
|
140
|
+
export { CopyField, CopyFieldActions, CopyFieldContent, CopyFieldCopyButton, CopyFieldLabel, CopyFieldValue };
|
|
141
|
+
|
|
142
|
+
//# sourceMappingURL=copy-field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-field.js","names":[],"sources":["../../../src/components/ui/copy-field.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Inline, Stack, Text } from '@/components/primitives';\nimport { Button, type ButtonProps } from '@/components/ui/button';\nimport { inputSurface } from '@/components/ui/input-surface';\nimport { cn } from '@/lib/utils';\nimport { useShade } from '@/providers/shade-context';\n\ntype CopyFieldContextValue = {\n copied: boolean;\n copy: () => Promise<void>;\n disabled: boolean;\n labelId: string;\n value: string;\n};\n\nconst CopyFieldContext = React.createContext<CopyFieldContextValue | null>(null);\n\nfunction useCopyField() {\n const context = React.useContext(CopyFieldContext);\n\n if (!context) {\n throw new Error('CopyField subcomponents must be used within CopyField');\n }\n\n return context;\n}\n\ninterface CopyFieldProps extends React.HTMLAttributes<HTMLDivElement> {\n disabled?: boolean;\n value: string;\n}\n\nconst CopyField = React.forwardRef<HTMLDivElement, CopyFieldProps>(\n ({ children, className, disabled = false, value, ...props }, ref) => {\n const [copied, setCopied] = React.useState(false);\n const labelId = React.useId();\n const resetTimer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n\n React.useEffect(() => {\n setCopied(false);\n\n if (resetTimer.current) {\n clearTimeout(resetTimer.current);\n resetTimer.current = null;\n }\n }, [value]);\n\n React.useEffect(() => {\n return () => {\n if (resetTimer.current) {\n clearTimeout(resetTimer.current);\n }\n };\n }, []);\n\n const copy = React.useCallback(async () => {\n if (disabled) {\n return;\n }\n\n try {\n await navigator.clipboard.writeText(value);\n setCopied(true);\n\n if (resetTimer.current) {\n clearTimeout(resetTimer.current);\n }\n\n resetTimer.current = setTimeout(() => setCopied(false), 2000);\n } catch {\n setCopied(false);\n }\n }, [disabled, value]);\n\n const contextValue = React.useMemo(\n () => ({ copied, copy, disabled, labelId, value }),\n [copied, copy, disabled, labelId, value],\n );\n\n return (\n <CopyFieldContext.Provider value={contextValue}>\n <Stack\n ref={ref}\n className={cn('group/copy-field w-full', className)}\n data-disabled={disabled || undefined}\n data-slot=\"copy-field\"\n gap=\"xs\"\n {...props}\n >\n {children}\n </Stack>\n </CopyFieldContext.Provider>\n );\n },\n);\nCopyField.displayName = 'CopyField';\n\nconst CopyFieldLabel = React.forwardRef<HTMLElement, React.ComponentProps<typeof Text>>(\n ({ className, id, ...props }, ref) => {\n const { labelId } = useCopyField();\n\n return (\n <Text\n ref={ref}\n as=\"div\"\n className={cn(\n 'text-control! font-medium group-data-[disabled=true]/copy-field:opacity-50',\n className,\n )}\n data-slot=\"copy-field-label\"\n id={id || labelId}\n leading=\"snug\"\n {...props}\n />\n );\n },\n);\nCopyFieldLabel.displayName = 'CopyFieldLabel';\n\nconst CopyFieldContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n inputSurface('within'),\n 'group/copy-field-content relative flex h-(--control-height) w-full items-center overflow-hidden bg-control-readonly-surface px-3 py-1 group-data-[disabled=true]/copy-field:cursor-not-allowed group-data-[disabled=true]/copy-field:opacity-50',\n className,\n )}\n data-slot=\"copy-field-content\"\n {...props}\n />\n ),\n);\nCopyFieldContent.displayName = 'CopyFieldContent';\n\nconst CopyFieldValue = React.forwardRef<HTMLElement, React.ComponentProps<typeof Text>>(\n ({ children, className, ...props }, ref) => {\n const { disabled, labelId, value } = useCopyField();\n\n return (\n <Text\n ref={ref}\n aria-disabled={disabled || undefined}\n aria-labelledby={\n props['aria-label'] || props['aria-labelledby'] ? props['aria-labelledby'] : labelId\n }\n aria-readonly=\"true\"\n as=\"div\"\n className={cn('min-w-0 truncate pr-2 text-muted-foreground', className)}\n data-slot=\"copy-field-value\"\n leading=\"snug\"\n role=\"textbox\"\n tabIndex={disabled ? undefined : 0}\n {...props}\n >\n {children ?? value}\n </Text>\n );\n },\n);\nCopyFieldValue.displayName = 'CopyFieldValue';\n\nconst CopyFieldActions = React.forwardRef<HTMLElement, React.ComponentProps<typeof Inline>>(\n ({ className, ...props }, ref) => {\n const { isAdmin7 } = useShade();\n\n return (\n <Inline\n ref={ref}\n className={cn(\n 'absolute top-1/2 right-[1px] -translate-y-1/2 gap-px bg-control-readonly-surface pl-1 transition-opacity md:pointer-events-none md:opacity-0 md:group-focus-within/copy-field-content:pointer-events-auto md:group-focus-within/copy-field-content:opacity-100 md:group-hover/copy-field-content:pointer-events-auto md:group-hover/copy-field-content:opacity-100 [&_button:not([data-slot=copy-field-copy-button])]:bg-control-readonly-surface [&_button:not([data-slot=copy-field-copy-button])]:hover:bg-secondary [&_button[data-control-shape=rounded]]:rounded-sm',\n isAdmin7 ? '[&_button]:h-6' : '[&_button]:h-7',\n className,\n )}\n data-slot=\"copy-field-actions\"\n gap=\"none\"\n {...props}\n />\n );\n },\n);\nCopyFieldActions.displayName = 'CopyFieldActions';\n\ninterface CopyFieldCopyButtonProps extends Omit<ButtonProps, 'children'> {\n children?: React.ReactNode;\n copiedLabel?: React.ReactNode;\n}\n\nconst CopyFieldCopyButton = React.forwardRef<HTMLButtonElement, CopyFieldCopyButtonProps>(\n ({ children = 'Copy', className, copiedLabel = 'Copied', disabled, onClick, ...props }, ref) => {\n const { copied, copy, disabled: fieldDisabled } = useCopyField();\n\n return (\n <Button\n ref={ref}\n className={cn(\n 'bg-surface-elevated hover:border-border-strong/40 hover:bg-surface-elevated',\n className,\n )}\n disabled={fieldDisabled || disabled}\n size=\"sm\"\n type=\"button\"\n variant=\"outline\"\n onClick={async (event) => {\n await copy();\n onClick?.(event);\n }}\n {...props}\n data-slot=\"copy-field-copy-button\"\n >\n {copied ? copiedLabel : children}\n </Button>\n );\n },\n);\nCopyFieldCopyButton.displayName = 'CopyFieldCopyButton';\n\nexport {\n CopyField,\n CopyFieldActions,\n CopyFieldContent,\n Copy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