@tryghost/shade 0.1.0-alpha.6 → 0.1.0-alpha.60
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/README.md +16 -11
- package/es/app.js +2 -1
- package/es/assets/images/index.js +2 -2
- package/es/components/page-templates/list-page.js +1 -1
- package/es/components/page-templates/list-page.js.map +1 -1
- package/es/components/patterns/color-picker.js +79 -56
- package/es/components/patterns/color-picker.js.map +1 -1
- package/es/components/patterns/filter-bar.js +4 -6
- package/es/components/patterns/filter-bar.js.map +1 -1
- package/es/components/patterns/filters-sheet.js +180 -0
- package/es/components/patterns/filters-sheet.js.map +1 -0
- package/es/components/patterns/filters.js +200 -84
- package/es/components/patterns/filters.js.map +1 -1
- package/es/components/patterns/gh-chart.js +4 -3
- package/es/components/patterns/gh-chart.js.map +1 -1
- package/es/components/patterns/image-upload.js +21 -16
- package/es/components/patterns/image-upload.js.map +1 -1
- package/es/components/patterns/kpi-tabs.js +4 -1
- package/es/components/patterns/kpi-tabs.js.map +1 -1
- package/es/components/patterns/page-header.js +62 -60
- package/es/components/patterns/page-header.js.map +1 -1
- package/es/components/patterns/setting-group-variants.js +1 -1
- package/es/components/patterns/setting-group-variants.js.map +1 -1
- package/es/components/patterns/setting-group.js +5 -5
- package/es/components/patterns/setting-group.js.map +1 -1
- package/es/components/patterns/settings-modal-variants.js +3 -0
- package/es/components/patterns/settings-modal-variants.js.map +1 -1
- package/es/components/patterns/settings-modal.js +12 -5
- package/es/components/patterns/settings-modal.js.map +1 -1
- package/es/components/patterns/share-modal.js +5 -17
- package/es/components/patterns/share-modal.js.map +1 -1
- package/es/components/patterns/use-mobile-filters.js +20 -0
- package/es/components/patterns/use-mobile-filters.js.map +1 -0
- package/es/components/ui/alert-dialog.js +25 -15
- package/es/components/ui/alert-dialog.js.map +1 -1
- package/es/components/ui/avatar.js +3 -4
- package/es/components/ui/avatar.js.map +1 -1
- package/es/components/ui/badge-variants.js +2 -1
- package/es/components/ui/badge-variants.js.map +1 -1
- package/es/components/ui/banner-variants.js +13 -5
- package/es/components/ui/banner-variants.js.map +1 -1
- package/es/components/ui/banner.js +9 -3
- package/es/components/ui/banner.js.map +1 -1
- package/es/components/ui/breadcrumb.js +2 -0
- package/es/components/ui/breadcrumb.js.map +1 -1
- package/es/components/ui/button-variants.js +2 -33
- package/es/components/ui/button-variants.js.map +1 -1
- package/es/components/ui/button.js +18 -5
- package/es/components/ui/button.js.map +1 -1
- package/es/components/ui/calendar.js +5 -6
- package/es/components/ui/calendar.js.map +1 -1
- package/es/components/ui/card-variants.js +3 -2
- package/es/components/ui/card-variants.js.map +1 -1
- package/es/components/ui/card.js +7 -4
- package/es/components/ui/card.js.map +1 -1
- package/es/components/ui/chart.js +2 -29
- package/es/components/ui/chart.js.map +1 -1
- package/es/components/ui/checkbox.js +1 -1
- package/es/components/ui/checkbox.js.map +1 -1
- package/es/components/ui/code-editor-view.js +1 -1
- package/es/components/ui/code-editor-view.js.map +1 -1
- package/es/components/ui/combobox.js +1 -1
- package/es/components/ui/combobox.js.map +1 -1
- package/es/components/ui/command.js +1 -14
- package/es/components/ui/command.js.map +1 -1
- package/es/components/ui/context-menu.js +18 -8
- package/es/components/ui/context-menu.js.map +1 -1
- package/es/components/ui/copy-field.js +2 -4
- package/es/components/ui/copy-field.js.map +1 -1
- package/es/components/ui/data-list.js +2 -4
- package/es/components/ui/data-list.js.map +1 -1
- package/es/components/ui/dialog.js +53 -11
- package/es/components/ui/dialog.js.map +1 -1
- package/es/components/ui/dropdown-menu.js +20 -10
- package/es/components/ui/dropdown-menu.js.map +1 -1
- package/es/components/ui/dropzone-variants.js +26 -10
- package/es/components/ui/dropzone-variants.js.map +1 -1
- package/es/components/ui/dropzone.js +2 -2
- package/es/components/ui/dropzone.js.map +1 -1
- package/es/components/ui/field.js +4 -4
- package/es/components/ui/field.js.map +1 -1
- package/es/components/ui/floating-sidebar.js +83 -21
- package/es/components/ui/floating-sidebar.js.map +1 -1
- package/es/components/ui/hover-card.js +13 -7
- package/es/components/ui/hover-card.js.map +1 -1
- package/es/components/ui/icon.js +1 -1
- package/es/components/ui/image-overlay-button.js +2 -2
- package/es/components/ui/image-overlay-button.js.map +1 -1
- package/es/components/ui/indicator-variants.js +2 -2
- package/es/components/ui/indicator-variants.js.map +1 -1
- package/es/components/ui/input-group-variants.js +5 -5
- package/es/components/ui/input-group-variants.js.map +1 -1
- package/es/components/ui/input-group.js +4 -7
- package/es/components/ui/input-group.js.map +1 -1
- package/es/components/ui/input-surface.js +5 -4
- package/es/components/ui/input-surface.js.map +1 -1
- package/es/components/ui/input.js +1 -1
- package/es/components/ui/input.js.map +1 -1
- package/es/components/ui/list.js +94 -0
- package/es/components/ui/list.js.map +1 -0
- package/es/components/ui/navbar.js +1 -3
- package/es/components/ui/navbar.js.map +1 -1
- package/es/components/ui/pagemenu.js +51 -15
- package/es/components/ui/pagemenu.js.map +1 -1
- package/es/components/ui/popover.js +14 -8
- package/es/components/ui/popover.js.map +1 -1
- package/es/components/ui/radio-group-variants.js +1 -1
- package/es/components/ui/radio-group-variants.js.map +1 -1
- package/es/components/ui/row-primary-action.js +48 -0
- package/es/components/ui/row-primary-action.js.map +1 -0
- package/es/components/ui/row-surface.js +18 -0
- package/es/components/ui/row-surface.js.map +1 -0
- package/es/components/ui/select-variants.js +6 -14
- package/es/components/ui/select-variants.js.map +1 -1
- package/es/components/ui/select.js +26 -19
- package/es/components/ui/select.js.map +1 -1
- package/es/components/ui/sheet.js +32 -19
- package/es/components/ui/sheet.js.map +1 -1
- package/es/components/ui/sidebar.js +2 -2
- package/es/components/ui/simple-pagination.js +4 -7
- package/es/components/ui/simple-pagination.js.map +1 -1
- package/es/components/ui/sortable-list.js +110 -11
- package/es/components/ui/sortable-list.js.map +1 -1
- package/es/components/ui/sticky-footer.js +62 -22
- package/es/components/ui/sticky-footer.js.map +1 -1
- package/es/components/ui/table.js +20 -9
- package/es/components/ui/table.js.map +1 -1
- package/es/components/ui/tabs-variants.js +23 -1
- package/es/components/ui/tabs-variants.js.map +1 -1
- package/es/components/ui/tabs.js +145 -27
- package/es/components/ui/tabs.js.map +1 -1
- package/es/components/ui/textarea.js +1 -1
- package/es/components/ui/textarea.js.map +1 -1
- package/es/components/ui/toast.js +2 -0
- package/es/components/ui/toggle-group.js +1 -3
- package/es/components/ui/toggle-group.js.map +1 -1
- package/es/components/ui/toggle-variants.js +1 -7
- package/es/components/ui/toggle-variants.js.map +1 -1
- package/es/components/ui/toggle.js +1 -2
- package/es/components/ui/toggle.js.map +1 -1
- package/es/components/ui/token-field.js +3 -3
- package/es/components/ui/token-field.js.map +1 -1
- package/es/components/ui/tooltip.js +81 -40
- package/es/components/ui/tooltip.js.map +1 -1
- package/es/components/ui/trend-badge.js +46 -12
- package/es/components/ui/trend-badge.js.map +1 -1
- package/es/components.js +24 -21
- package/es/hooks/use-row-behavior.js +94 -0
- package/es/hooks/use-row-behavior.js.map +1 -0
- package/es/hooks/use-row-press.js +63 -0
- package/es/hooks/use-row-press.js.map +1 -0
- package/es/{icon-BJcGsQ4b.js → icon--CakqPdG.js} +15 -19
- package/es/icon--CakqPdG.js.map +1 -0
- package/es/{images-CUcakpOD.js → images-F6slcZrB.js} +16 -42
- package/es/images-F6slcZrB.js.map +1 -0
- package/es/index.js +43 -39
- package/es/lib/app-overlay.js +184 -0
- package/es/lib/app-overlay.js.map +1 -0
- package/es/lib/date-utils.js +151 -0
- package/es/lib/date-utils.js.map +1 -0
- package/es/lib/ds-utils.js +16 -72
- package/es/lib/ds-utils.js.map +1 -1
- package/es/lib/safe-area.js +168 -0
- package/es/lib/safe-area.js.map +1 -0
- package/es/lib/svg-graphic.js +32 -0
- package/es/lib/svg-graphic.js.map +1 -0
- package/es/lib/toast-press.js +11 -0
- package/es/lib/toast-press.js.map +1 -0
- package/es/lib/utils.js +3 -2
- package/es/patterns.js +2 -1
- package/es/providers/header-tooltip-provider.js +1 -4
- package/es/providers/header-tooltip-provider.js.map +1 -1
- package/es/providers/shade-context.js +2 -1
- package/es/providers/shade-context.js.map +1 -1
- package/es/providers/shade-provider.js +28 -13
- package/es/providers/shade-provider.js.map +1 -1
- package/es/shade-app.js +22 -6
- package/es/shade-app.js.map +1 -1
- package/es/shade-scope.js +3 -2
- package/es/shade-scope.js.map +1 -1
- package/es/tokens.js +66 -8
- package/es/tokens.js.map +1 -1
- package/es/utils.js +3 -2
- package/package.json +7 -7
- package/preflight.css +0 -10
- package/styles.css +485 -12
- package/tailwind.theme.css +241 -187
- package/theme-variables.css +215 -69
- package/types/app.d.ts +7 -5
- package/types/app.d.ts.map +1 -1
- package/types/assets/images/index.d.ts +3 -3
- package/types/assets/images/index.d.ts.map +1 -1
- package/types/components/page-templates/modal-page.d.ts +1 -1
- package/types/components/patterns/color-picker.d.ts +7 -2
- package/types/components/patterns/color-picker.d.ts.map +1 -1
- package/types/components/patterns/filter-bar.d.ts +2 -2
- package/types/components/patterns/filter-bar.d.ts.map +1 -1
- package/types/components/patterns/filters-helpers.d.ts +1 -1
- package/types/components/patterns/filters-sheet.d.ts +21 -0
- package/types/components/patterns/filters-sheet.d.ts.map +1 -0
- package/types/components/patterns/filters.d.ts +21 -7
- package/types/components/patterns/filters.d.ts.map +1 -1
- package/types/components/patterns/gh-chart.d.ts.map +1 -1
- package/types/components/patterns/image-upload.d.ts +3 -3
- package/types/components/patterns/image-upload.d.ts.map +1 -1
- package/types/components/patterns/kpi-tabs.d.ts +5 -2
- package/types/components/patterns/kpi-tabs.d.ts.map +1 -1
- package/types/components/patterns/page-header.d.ts +26 -17
- package/types/components/patterns/page-header.d.ts.map +1 -1
- package/types/components/patterns/setting-group.d.ts +8 -8
- package/types/components/patterns/setting-group.d.ts.map +1 -1
- package/types/components/patterns/settings-modal-variants.d.ts +3 -0
- package/types/components/patterns/settings-modal-variants.d.ts.map +1 -1
- package/types/components/patterns/settings-modal.d.ts +12 -3
- package/types/components/patterns/settings-modal.d.ts.map +1 -1
- package/types/components/patterns/share-modal.d.ts +3 -3
- package/types/components/patterns/share-modal.d.ts.map +1 -1
- package/types/components/patterns/use-dirty-confirmation.d.ts +1 -1
- package/types/components/patterns/use-mobile-filters.d.ts +2 -0
- package/types/components/patterns/use-mobile-filters.d.ts.map +1 -0
- package/types/components/ui/alert-dialog.d.ts +2 -2
- package/types/components/ui/alert-dialog.d.ts.map +1 -1
- package/types/components/ui/badge-variants.d.ts +1 -1
- package/types/components/ui/badge-variants.d.ts.map +1 -1
- package/types/components/ui/badge.d.ts +1 -1
- package/types/components/ui/banner-variants.d.ts +1 -1
- package/types/components/ui/banner-variants.d.ts.map +1 -1
- package/types/components/ui/banner.d.ts +3 -1
- package/types/components/ui/banner.d.ts.map +1 -1
- package/types/components/ui/breadcrumb.d.ts.map +1 -1
- package/types/components/ui/button-variants.d.ts +0 -1
- package/types/components/ui/button-variants.d.ts.map +1 -1
- package/types/components/ui/button.d.ts +7 -2
- package/types/components/ui/button.d.ts.map +1 -1
- package/types/components/ui/calendar.d.ts +1 -1
- package/types/components/ui/calendar.d.ts.map +1 -1
- package/types/components/ui/card-variants.d.ts +1 -1
- package/types/components/ui/card-variants.d.ts.map +1 -1
- package/types/components/ui/card.d.ts +1 -1
- package/types/components/ui/card.d.ts.map +1 -1
- package/types/components/ui/chart.d.ts +1 -17
- package/types/components/ui/chart.d.ts.map +1 -1
- package/types/components/ui/code-editor.d.ts +1 -1
- package/types/components/ui/command.d.ts +1 -6
- package/types/components/ui/command.d.ts.map +1 -1
- package/types/components/ui/context-menu.d.ts +1 -1
- package/types/components/ui/context-menu.d.ts.map +1 -1
- package/types/components/ui/copy-field.d.ts +1 -1
- package/types/components/ui/copy-field.d.ts.map +1 -1
- package/types/components/ui/data-list.d.ts.map +1 -1
- package/types/components/ui/dialog.d.ts +11 -2
- package/types/components/ui/dialog.d.ts.map +1 -1
- package/types/components/ui/dropdown-menu.d.ts +1 -1
- package/types/components/ui/dropdown-menu.d.ts.map +1 -1
- package/types/components/ui/dropzone-variants.d.ts +3 -2
- package/types/components/ui/dropzone-variants.d.ts.map +1 -1
- package/types/components/ui/dropzone.d.ts +1 -1
- package/types/components/ui/field.d.ts +1 -1
- package/types/components/ui/field.d.ts.map +1 -1
- package/types/components/ui/floating-sidebar.d.ts +12 -3
- package/types/components/ui/floating-sidebar.d.ts.map +1 -1
- package/types/components/ui/hover-card.d.ts.map +1 -1
- package/types/components/ui/icon.d.ts +2 -1
- package/types/components/ui/icon.d.ts.map +1 -1
- package/types/components/ui/image-overlay-button.d.ts +1 -1
- package/types/components/ui/image-overlay-button.d.ts.map +1 -1
- package/types/components/ui/indicator.d.ts +1 -1
- package/types/components/ui/input-group-variants.d.ts.map +1 -1
- package/types/components/ui/input-group.d.ts +2 -2
- package/types/components/ui/input-group.d.ts.map +1 -1
- package/types/components/ui/input-surface.d.ts +4 -3
- package/types/components/ui/input-surface.d.ts.map +1 -1
- package/types/components/ui/list.d.ts +28 -0
- package/types/components/ui/list.d.ts.map +1 -0
- package/types/components/ui/multi-select-combobox.d.ts +1 -1
- package/types/components/ui/navbar.d.ts.map +1 -1
- package/types/components/ui/pagemenu.d.ts +3 -0
- package/types/components/ui/pagemenu.d.ts.map +1 -1
- package/types/components/ui/popover.d.ts.map +1 -1
- package/types/components/ui/preview-chrome.d.ts +1 -1
- package/types/components/ui/row-primary-action.d.ts +8 -0
- package/types/components/ui/row-primary-action.d.ts.map +1 -0
- package/types/components/ui/row-surface.d.ts +11 -0
- package/types/components/ui/row-surface.d.ts.map +1 -0
- package/types/components/ui/select-variants.d.ts +0 -1
- package/types/components/ui/select-variants.d.ts.map +1 -1
- package/types/components/ui/select.d.ts +2 -2
- package/types/components/ui/select.d.ts.map +1 -1
- package/types/components/ui/sheet.d.ts +1 -1
- package/types/components/ui/sheet.d.ts.map +1 -1
- package/types/components/ui/sidebar.d.ts +2 -2
- package/types/components/ui/simple-pagination.d.ts.map +1 -1
- package/types/components/ui/sortable-list.d.ts +4 -1
- package/types/components/ui/sortable-list.d.ts.map +1 -1
- package/types/components/ui/sticky-footer.d.ts +9 -2
- package/types/components/ui/sticky-footer.d.ts.map +1 -1
- package/types/components/ui/table.d.ts +4 -1
- package/types/components/ui/table.d.ts.map +1 -1
- package/types/components/ui/tabs-variants.d.ts +5 -1
- package/types/components/ui/tabs-variants.d.ts.map +1 -1
- package/types/components/ui/tabs.d.ts.map +1 -1
- package/types/components/ui/toast.d.ts +2 -0
- package/types/components/ui/toast.d.ts.map +1 -0
- package/types/components/ui/toggle-group.d.ts +4 -6
- package/types/components/ui/toggle-group.d.ts.map +1 -1
- package/types/components/ui/toggle-variants.d.ts +0 -1
- package/types/components/ui/toggle-variants.d.ts.map +1 -1
- package/types/components/ui/toggle.d.ts +2 -3
- package/types/components/ui/toggle.d.ts.map +1 -1
- package/types/components/ui/token-field.d.ts +2 -2
- package/types/components/ui/token-field.d.ts.map +1 -1
- package/types/components/ui/tooltip.d.ts.map +1 -1
- package/types/components/ui/trend-badge.d.ts +1 -0
- package/types/components/ui/trend-badge.d.ts.map +1 -1
- package/types/components.d.ts +5 -2
- package/types/components.d.ts.map +1 -1
- package/types/hooks/use-row-behavior.d.ts +24 -0
- package/types/hooks/use-row-behavior.d.ts.map +1 -0
- package/types/hooks/use-row-press.d.ts +11 -0
- package/types/hooks/use-row-press.d.ts.map +1 -0
- package/types/lib/app-overlay.d.ts +63 -0
- package/types/lib/app-overlay.d.ts.map +1 -0
- package/types/lib/date-utils.d.ts +17 -0
- package/types/lib/date-utils.d.ts.map +1 -0
- package/types/lib/ds-utils.d.ts +2 -16
- package/types/lib/ds-utils.d.ts.map +1 -1
- package/types/lib/safe-area.d.ts +27 -0
- package/types/lib/safe-area.d.ts.map +1 -0
- package/types/lib/svg-graphic.d.ts +22 -0
- package/types/lib/svg-graphic.d.ts.map +1 -0
- package/types/lib/toast-press.d.ts +4 -0
- package/types/lib/toast-press.d.ts.map +1 -0
- package/types/lib/utils.d.ts +1 -0
- package/types/lib/utils.d.ts.map +1 -1
- package/types/patterns.d.ts +1 -0
- package/types/patterns.d.ts.map +1 -1
- package/types/providers/header-tooltip-provider.d.ts.map +1 -1
- package/types/providers/shade-context.d.ts +4 -1
- package/types/providers/shade-context.d.ts.map +1 -1
- package/types/providers/shade-provider.d.ts +5 -2
- package/types/providers/shade-provider.d.ts.map +1 -1
- package/types/shade-app.d.ts +11 -3
- package/types/shade-app.d.ts.map +1 -1
- package/types/shade-scope.d.ts.map +1 -1
- package/types/tokens.d.ts +1 -1
- package/types/tokens.d.ts.map +1 -1
- package/types/utils.d.ts +2 -1
- package/types/utils.d.ts.map +1 -1
- package/es/components/ui/action-list.js +0 -56
- package/es/components/ui/action-list.js.map +0 -1
- package/es/icon-BJcGsQ4b.js.map +0 -1
- package/es/images-CUcakpOD.js.map +0 -1
- package/types/components/ui/action-list.d.ts +0 -21
- package/types/components/ui/action-list.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","names":[],"sources":["../../../src/components/ui/popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { ShadeScope } from '@/shade-scope';\n\nimport { cn } from '@/lib/utils';\nimport { consumeOverlayEscape } from '@/lib/overlay-escape';\nconst Popover = PopoverPrimitive.Root;\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nconst PopoverAnchor = PopoverPrimitive.Anchor;\n\nconst PopoverClose = PopoverPrimitive.Close;\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', onEscapeKeyDown, sideOffset = 4, ...props }
|
|
1
|
+
{"version":3,"file":"popover.js","names":[],"sources":["../../../src/components/ui/popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { ShadeScope } from '@/shade-scope';\n\nimport { usePortalContainer } from '@/lib/app-overlay';\nimport { cn } from '@/lib/utils';\nimport { consumeOverlayEscape } from '@/lib/overlay-escape';\nimport { safeAreaCollision } from '@/lib/safe-area';\nconst Popover = PopoverPrimitive.Root;\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nconst PopoverAnchor = PopoverPrimitive.Anchor;\n\nconst PopoverClose = PopoverPrimitive.Close;\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(\n (\n { className, align = 'center', onEscapeKeyDown, sideOffset = 4, collisionBoundary, ...props },\n ref,\n ) => (\n <PopoverPrimitive.Portal container={usePortalContainer()}>\n <ShadeScope>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n className={cn(\n 'data-[safe-area]:max-h-(--radix-popover-content-available-height) data-[safe-area]:max-w-(--radix-popover-content-available-width) data-[safe-area]:overflow-y-auto',\n 'z-50 origin-(--radix-popover-content-transform-origin) rounded-menu border border-border/60 bg-surface-elevated-2 p-5 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 dark:border-border/30',\n className,\n )}\n {...safeAreaCollision(collisionBoundary, usePortalContainer())}\n sideOffset={sideOffset}\n onEscapeKeyDown={(event) => consumeOverlayEscape(event, onEscapeKeyDown)}\n {...props}\n />\n </ShadeScope>\n </PopoverPrimitive.Portal>\n ),\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, PopoverClose };\n"],"mappings":";;;;;;;;;AAQA,IAAM,UAAU,iBAAiB;AAEjC,IAAM,iBAAiB,iBAAiB;AAExC,IAAM,gBAAgB,iBAAiB;AAEvC,IAAM,eAAe,iBAAiB;AAEtC,IAAM,iBAAiB,QAAM,YAKzB,EAAE,WAAW,QAAQ,UAAU,iBAAiB,aAAa,GAAG,mBAAmB,GAAG,SACtF,QAEA,oBAAC,iBAAiB,QAAlB;CAAyB,WAAW,mBAAmB;WACrD,oBAAC,YAAD,EAAA,UACE,oBAAC,iBAAiB,SAAlB;EACO;EACE;EACP,WAAW,GACT,uKACA,ihBACA,SACF;EACA,GAAI,kBAAkB,mBAAmB,mBAAmB,CAAC;EACjD;EACZ,kBAAkB,UAAU,qBAAqB,OAAO,eAAe;EACvE,GAAI;CACL,CAAA,EACS,CAAA;AACW,CAAA,CAE7B;AACA,eAAe,cAAc,iBAAiB,QAAQ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { inputSurface } from "./input-surface.js";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
3
|
//#region src/components/ui/radio-group-variants.ts
|
|
4
|
-
var radioGroupItemVariants = cva([inputSurface("self"), "peer grid size-4 shrink-0 place-content-center rounded-full border-border-strong p-0 text-primary enabled:hover:bg-interactive-hover data-[state=checked]:border-primary"], {
|
|
4
|
+
var radioGroupItemVariants = cva([inputSurface("self"), "peer grid size-4 shrink-0 place-content-center rounded-full border-border-strong bg-control-surface p-0 text-primary enabled:hover:bg-interactive-hover data-[state=checked]:border-primary"], {
|
|
5
5
|
variants: { indicator: {
|
|
6
6
|
dot: "",
|
|
7
7
|
check: "data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground enabled:data-[state=checked]:hover:bg-primary"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-variants.js","names":[],"sources":["../../../src/components/ui/radio-group-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\nimport { inputSurface } from '@/components/ui/input-surface';\n\nconst radioGroupItemVariants = cva(\n [\n inputSurface('self'),\n 'peer grid size-4 shrink-0 place-content-center rounded-full border-border-strong p-0 text-primary enabled:hover:bg-interactive-hover data-[state=checked]:border-primary',\n ],\n {\n variants: {\n indicator: {\n dot: '',\n check:\n 'data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground enabled:data-[state=checked]:hover:bg-primary',\n },\n },\n defaultVariants: {\n indicator: 'dot',\n },\n },\n);\n\nexport { radioGroupItemVariants };\n"],"mappings":";;;AAGA,IAAM,yBAAyB,IAC7B,CACE,aAAa,MAAM,GACnB,
|
|
1
|
+
{"version":3,"file":"radio-group-variants.js","names":[],"sources":["../../../src/components/ui/radio-group-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\nimport { inputSurface } from '@/components/ui/input-surface';\n\nconst radioGroupItemVariants = cva(\n [\n inputSurface('self'),\n 'peer grid size-4 shrink-0 place-content-center rounded-full border-border-strong bg-control-surface p-0 text-primary enabled:hover:bg-interactive-hover data-[state=checked]:border-primary',\n ],\n {\n variants: {\n indicator: {\n dot: '',\n check:\n 'data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground enabled:data-[state=checked]:hover:bg-primary',\n },\n },\n defaultVariants: {\n indicator: 'dot',\n },\n },\n);\n\nexport { radioGroupItemVariants };\n"],"mappings":";;;AAGA,IAAM,yBAAyB,IAC7B,CACE,aAAa,MAAM,GACnB,6LACF,GACA;CACE,UAAU,EACR,WAAW;EACT,KAAK;EACL,OACE;CACJ,EACF;CACA,iBAAiB,EACf,WAAW,MACb;AACF,CACF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
import { rowSurfaceClasses } from "./row-surface.js";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
6
|
+
//#region src/components/ui/row-primary-action.tsx
|
|
7
|
+
/** Makes the whole row activate its main link or button. */
|
|
8
|
+
var RowPrimaryAction = React$1.forwardRef(({ asChild = false, className, children, onKeyDown, onKeyUp, ...props }, ref) => {
|
|
9
|
+
const Component = asChild ? Slot : "button";
|
|
10
|
+
const child = asChild && React$1.isValidElement(children) ? children : void 0;
|
|
11
|
+
const legacyAction = child && typeof child.type === "string" && ![
|
|
12
|
+
"a",
|
|
13
|
+
"button",
|
|
14
|
+
"input",
|
|
15
|
+
"select",
|
|
16
|
+
"textarea"
|
|
17
|
+
].includes(child.type) && Boolean(child.props.onClick || props.onClick) && !props.disabled && (child.props["aria-disabled"] ?? props["aria-disabled"]) !== true && (child.props["aria-disabled"] ?? props["aria-disabled"]) !== "true";
|
|
18
|
+
const childContent = child ? React$1.cloneElement(child, { className: void 0 }) : children;
|
|
19
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
20
|
+
ref,
|
|
21
|
+
className: cn(rowSurfaceClasses.primaryAction, "focus-visible:ring-1 focus-visible:ring-focus-ring focus-visible:outline-hidden", child?.props.className, className),
|
|
22
|
+
...!asChild ? { type: "button" } : {},
|
|
23
|
+
...props,
|
|
24
|
+
role: legacyAction ? child.props.role ?? "button" : props.role,
|
|
25
|
+
tabIndex: legacyAction ? child.props.tabIndex ?? 0 : props.tabIndex,
|
|
26
|
+
onKeyDown: (event) => {
|
|
27
|
+
onKeyDown?.(event);
|
|
28
|
+
if (!legacyAction || event.defaultPrevented || event.target !== event.currentTarget) return;
|
|
29
|
+
if (event.key === "Enter") {
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
event.currentTarget.click();
|
|
32
|
+
} else if (event.key === " ") event.preventDefault();
|
|
33
|
+
},
|
|
34
|
+
onKeyUp: (event) => {
|
|
35
|
+
onKeyUp?.(event);
|
|
36
|
+
if (legacyAction && !event.defaultPrevented && event.target === event.currentTarget && event.key === " ") {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
event.currentTarget.click();
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
children: childContent
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
RowPrimaryAction.displayName = "RowPrimaryAction";
|
|
45
|
+
//#endregion
|
|
46
|
+
export { RowPrimaryAction, RowPrimaryAction as TableRowAction };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=row-primary-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row-primary-action.js","names":[],"sources":["../../../src/components/ui/row-primary-action.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport * as React from 'react';\nimport { cn } from '@/lib/utils';\nimport { rowSurfaceClasses } from '@/components/ui/row-surface';\n\ninterface RowPrimaryActionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n asChild?: boolean;\n}\n\n/** Makes the whole row activate its main link or button. */\nconst RowPrimaryAction = React.forwardRef<HTMLButtonElement, RowPrimaryActionProps>(\n ({ asChild = false, className, children, onKeyDown, onKeyUp, ...props }, ref) => {\n const Component = asChild ? Slot : 'button';\n const child =\n asChild && React.isValidElement<React.HTMLAttributes<HTMLElement>>(children)\n ? children\n : undefined;\n const legacyAction =\n child &&\n typeof child.type === 'string' &&\n !['a', 'button', 'input', 'select', 'textarea'].includes(child.type) &&\n Boolean(child.props.onClick || props.onClick) &&\n !props.disabled &&\n (child.props['aria-disabled'] ?? props['aria-disabled']) !== true &&\n (child.props['aria-disabled'] ?? props['aria-disabled']) !== 'true';\n const childContent = child ? React.cloneElement(child, { className: undefined }) : children;\n return (\n <Component\n ref={ref}\n className={cn(\n rowSurfaceClasses.primaryAction,\n 'focus-visible:ring-1 focus-visible:ring-focus-ring focus-visible:outline-hidden',\n child?.props.className,\n className,\n )}\n {...(!asChild ? { type: 'button' as const } : {})}\n {...props}\n role={legacyAction ? (child.props.role ?? 'button') : props.role}\n tabIndex={legacyAction ? (child.props.tabIndex ?? 0) : props.tabIndex}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!legacyAction || event.defaultPrevented || event.target !== event.currentTarget) {\n return;\n }\n if (event.key === 'Enter') {\n event.preventDefault();\n event.currentTarget.click();\n } else if (event.key === ' ') {\n event.preventDefault();\n }\n }}\n onKeyUp={(event) => {\n onKeyUp?.(event);\n if (\n legacyAction &&\n !event.defaultPrevented &&\n event.target === event.currentTarget &&\n event.key === ' '\n ) {\n event.preventDefault();\n event.currentTarget.click();\n }\n }}\n >\n {childContent}\n </Component>\n );\n },\n);\nRowPrimaryAction.displayName = 'RowPrimaryAction';\n\nexport { RowPrimaryAction, RowPrimaryAction as TableRowAction };\n"],"mappings":";;;;;;;AAUA,IAAM,mBAAmB,QAAM,YAC5B,EAAE,UAAU,OAAO,WAAW,UAAU,WAAW,SAAS,GAAG,SAAS,QAAQ;CAC/E,MAAM,YAAY,UAAU,OAAO;CACnC,MAAM,QACJ,WAAW,QAAM,eAAkD,QAAQ,IACvE,WACA,KAAA;CACN,MAAM,eACJ,SACA,OAAO,MAAM,SAAS,YACtB,CAAC;EAAC;EAAK;EAAU;EAAS;EAAU;CAAU,CAAC,CAAC,SAAS,MAAM,IAAI,KACnE,QAAQ,MAAM,MAAM,WAAW,MAAM,OAAO,KAC5C,CAAC,MAAM,aACN,MAAM,MAAM,oBAAoB,MAAM,sBAAsB,SAC5D,MAAM,MAAM,oBAAoB,MAAM,sBAAsB;CAC/D,MAAM,eAAe,QAAQ,QAAM,aAAa,OAAO,EAAE,WAAW,KAAA,EAAU,CAAC,IAAI;CACnF,OACE,oBAAC,WAAD;EACO;EACL,WAAW,GACT,kBAAkB,eAClB,mFACA,OAAO,MAAM,WACb,SACF;EACA,GAAK,CAAC,UAAU,EAAE,MAAM,SAAkB,IAAI,CAAC;EAC/C,GAAI;EACJ,MAAM,eAAgB,MAAM,MAAM,QAAQ,WAAY,MAAM;EAC5D,UAAU,eAAgB,MAAM,MAAM,YAAY,IAAK,MAAM;EAC7D,YAAY,UAAU;GACpB,YAAY,KAAK;GACjB,IAAI,CAAC,gBAAgB,MAAM,oBAAoB,MAAM,WAAW,MAAM,eACpE;GAEF,IAAI,MAAM,QAAQ,SAAS;IACzB,MAAM,eAAe;IACrB,MAAM,cAAc,MAAM;GAC5B,OAAO,IAAI,MAAM,QAAQ,KACvB,MAAM,eAAe;EAEzB;EACA,UAAU,UAAU;GAClB,UAAU,KAAK;GACf,IACE,gBACA,CAAC,MAAM,oBACP,MAAM,WAAW,MAAM,iBACvB,MAAM,QAAQ,KACd;IACA,MAAM,eAAe;IACrB,MAAM,cAAc,MAAM;GAC5B;EACF;YAEC;CACQ,CAAA;AAEf,CACF;AACA,iBAAiB,cAAc"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
//#region src/components/ui/row-surface.ts
|
|
3
|
+
/** Background and spacing classes for custom list and table rows. */
|
|
4
|
+
var rowSurfaceClasses = {
|
|
5
|
+
base: "shade-row",
|
|
6
|
+
interactive: "shade-row-interactive",
|
|
7
|
+
auto: "shade-row-auto",
|
|
8
|
+
inset: "shade-row-inset",
|
|
9
|
+
end: "shade-row-end",
|
|
10
|
+
primaryAction: "shade-row-primary"
|
|
11
|
+
};
|
|
12
|
+
function rowSurface(mode = "interactive") {
|
|
13
|
+
return cn(rowSurfaceClasses.base, mode === "interactive" && rowSurfaceClasses.interactive, mode === "auto" && rowSurfaceClasses.auto);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { rowSurface, rowSurfaceClasses };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=row-surface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row-surface.js","names":[],"sources":["../../../src/components/ui/row-surface.ts"],"sourcesContent":["import { cn } from '@/lib/utils';\n\n/** Background and spacing classes for custom list and table rows. */\nexport const rowSurfaceClasses = {\n base: 'shade-row',\n interactive: 'shade-row-interactive',\n auto: 'shade-row-auto',\n inset: 'shade-row-inset',\n end: 'shade-row-end',\n primaryAction: 'shade-row-primary',\n} as const;\n\nexport function rowSurface(mode: 'interactive' | 'static' | 'auto' = 'interactive') {\n return cn(\n rowSurfaceClasses.base,\n mode === 'interactive' && rowSurfaceClasses.interactive,\n mode === 'auto' && rowSurfaceClasses.auto,\n );\n}\n"],"mappings":";;;AAGA,IAAa,oBAAoB;CAC/B,MAAM;CACN,aAAa;CACb,MAAM;CACN,OAAO;CACP,KAAK;CACL,eAAe;AACjB;AAEA,SAAgB,WAAW,OAA0C,eAAe;CAClF,OAAO,GACL,kBAAkB,MAClB,SAAS,iBAAiB,kBAAkB,aAC5C,SAAS,UAAU,kBAAkB,IACvC;AACF"}
|
|
@@ -1,42 +1,34 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
2
|
//#region src/components/ui/select-variants.ts
|
|
3
|
-
var selectTriggerVariants = cva("flex h-(--control-height) w-full items-center justify-between px-3 py-2 text-
|
|
3
|
+
var selectTriggerVariants = cva("flex h-(--control-height) w-full items-center justify-between px-3 py-2 text-(length:--text-field) whitespace-nowrap hover:bg-button-hover data-[placeholder]:text-muted-foreground [&>span]:line-clamp-1", {
|
|
4
4
|
variants: {
|
|
5
5
|
variant: {
|
|
6
6
|
default: "",
|
|
7
|
-
ghost: "border-transparent bg-transparent shadow-none",
|
|
8
|
-
secondary: "border-transparent bg-tab-active text-secondary-foreground shadow-none hover:bg-secondary"
|
|
9
|
-
},
|
|
10
|
-
isAdmin7: {
|
|
11
|
-
true: "",
|
|
12
|
-
false: ""
|
|
7
|
+
ghost: "border-transparent bg-transparent shadow-none [--radius-field:var(--radius-control)] [--text-field:var(--text-control)]",
|
|
8
|
+
secondary: "border-transparent bg-tab-active text-secondary-foreground shadow-none [--radius-field:var(--radius-control)] [--text-field:var(--text-control)] hover:bg-secondary"
|
|
13
9
|
},
|
|
14
10
|
shape: {
|
|
15
|
-
rounded: "rounded-
|
|
11
|
+
rounded: "rounded-field",
|
|
16
12
|
pill: "rounded-full"
|
|
17
13
|
}
|
|
18
14
|
},
|
|
19
15
|
compoundVariants: [
|
|
20
16
|
{
|
|
21
|
-
isAdmin7: true,
|
|
22
17
|
variant: ["secondary", "ghost"],
|
|
23
18
|
className: "enabled:active:shadow-control-pressed enabled:aria-expanded:shadow-control-pressed"
|
|
24
19
|
},
|
|
25
20
|
{
|
|
26
|
-
isAdmin7: true,
|
|
27
21
|
variant: "ghost",
|
|
28
|
-
className: "enabled:active:bg-button-
|
|
22
|
+
className: "enabled:active:bg-button-pressed enabled:aria-expanded:bg-button-pressed"
|
|
29
23
|
},
|
|
30
24
|
{
|
|
31
|
-
isAdmin7: true,
|
|
32
25
|
variant: "secondary",
|
|
33
26
|
className: "enabled:active:bg-secondary enabled:aria-expanded:bg-secondary"
|
|
34
27
|
}
|
|
35
28
|
],
|
|
36
29
|
defaultVariants: {
|
|
37
30
|
variant: "default",
|
|
38
|
-
shape: "rounded"
|
|
39
|
-
isAdmin7: true
|
|
31
|
+
shape: "rounded"
|
|
40
32
|
}
|
|
41
33
|
});
|
|
42
34
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-variants.js","names":[],"sources":["../../../src/components/ui/select-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nconst selectTriggerVariants = cva(\n 'flex h-(--control-height) w-full items-center justify-between px-3 py-2 text-
|
|
1
|
+
{"version":3,"file":"select-variants.js","names":[],"sources":["../../../src/components/ui/select-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nconst selectTriggerVariants = cva(\n 'flex h-(--control-height) w-full items-center justify-between px-3 py-2 text-(length:--text-field) whitespace-nowrap hover:bg-button-hover data-[placeholder]:text-muted-foreground [&>span]:line-clamp-1',\n {\n variants: {\n variant: {\n default: '',\n // Ghost and secondary triggers read as buttons, so they keep a button's corners.\n ghost:\n 'border-transparent bg-transparent shadow-none [--radius-field:var(--radius-control)] [--text-field:var(--text-control)]',\n secondary:\n 'border-transparent bg-tab-active text-secondary-foreground shadow-none [--radius-field:var(--radius-control)] [--text-field:var(--text-control)] hover:bg-secondary',\n },\n shape: {\n rounded: 'rounded-field',\n pill: 'rounded-full',\n },\n },\n compoundVariants: [\n {\n variant: ['secondary', 'ghost'],\n className:\n 'enabled:active:shadow-control-pressed enabled:aria-expanded:shadow-control-pressed',\n },\n {\n variant: 'ghost',\n className: 'enabled:active:bg-button-pressed enabled:aria-expanded:bg-button-pressed',\n },\n {\n variant: 'secondary',\n className: 'enabled:active:bg-secondary enabled:aria-expanded:bg-secondary',\n },\n ],\n defaultVariants: {\n variant: 'default',\n shape: 'rounded',\n },\n },\n);\n\nexport { selectTriggerVariants };\n"],"mappings":";;AAEA,IAAM,wBAAwB,IAC5B,6MACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GAET,OACE;GACF,WACE;EACJ;EACA,OAAO;GACL,SAAS;GACT,MAAM;EACR;CACF;CACA,kBAAkB;EAChB;GACE,SAAS,CAAC,aAAa,OAAO;GAC9B,WACE;EACJ;EACA;GACE,SAAS;GACT,WAAW;EACb;EACA;GACE,SAAS;GACT,WAAW;EACb;CACF;CACA,iBAAiB;EACf,SAAS;EACT,OAAO;CACT;AACF,CACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
-
import { useShade } from "../../providers/shade-context.js";
|
|
3
2
|
import { ShadeScope } from "../../shade-scope.js";
|
|
3
|
+
import { hasSafeArea, safeAreaCollision } from "../../lib/safe-area.js";
|
|
4
|
+
import { usePortalContainer } from "../../lib/app-overlay.js";
|
|
4
5
|
import { consumeOverlayEscape } from "../../lib/overlay-escape.js";
|
|
5
6
|
import { selectTriggerVariants } from "./select-variants.js";
|
|
6
7
|
import { inputSurface, inputSurfaceClasses } from "./input-surface.js";
|
|
@@ -13,14 +14,12 @@ var Select = SelectPrimitive.Root;
|
|
|
13
14
|
var SelectGroup = SelectPrimitive.Group;
|
|
14
15
|
var SelectValue = SelectPrimitive.Value;
|
|
15
16
|
var SelectTrigger = React$1.forwardRef(({ className, children, shape, variant, showChevron = variant !== "secondary", ...props }, ref) => {
|
|
16
|
-
const { isAdmin7 } = useShade();
|
|
17
17
|
const resolvedShape = shape ?? "rounded";
|
|
18
18
|
return /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
|
|
19
19
|
ref,
|
|
20
20
|
className: cn(inputSurface("self"), inputSurfaceClasses.disabledFieldSelf, selectTriggerVariants({
|
|
21
21
|
shape: resolvedShape,
|
|
22
|
-
variant
|
|
23
|
-
isAdmin7
|
|
22
|
+
variant
|
|
24
23
|
}), showChevron && "pr-2", className),
|
|
25
24
|
"data-control-shape": resolvedShape,
|
|
26
25
|
"data-variant": variant ?? "default",
|
|
@@ -46,21 +45,29 @@ var SelectScrollDownButton = React$1.forwardRef(({ className, ...props }, ref) =
|
|
|
46
45
|
children: /* @__PURE__ */ jsx(ChevronDown, { className: "size-4" })
|
|
47
46
|
}));
|
|
48
47
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
49
|
-
var SelectContent = React$1.forwardRef(({ className, children, onEscapeKeyDown, position = "popper", ...props }, ref) =>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
48
|
+
var SelectContent = React$1.forwardRef(({ className, children, onEscapeKeyDown, position: requested = "popper", collisionBoundary, ...props }, ref) => {
|
|
49
|
+
const container = usePortalContainer();
|
|
50
|
+
const position = hasSafeArea(container) ? "popper" : requested;
|
|
51
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, {
|
|
52
|
+
container,
|
|
53
|
+
children: /* @__PURE__ */ jsx(ShadeScope, { children: /* @__PURE__ */ jsxs(SelectPrimitive.Content, {
|
|
54
|
+
ref,
|
|
55
|
+
className: cn("relative z-[9999] max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-menu border border-border/60 bg-surface-elevated-2 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 dark:border-border/30", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
56
|
+
...safeAreaCollision(collisionBoundary, container),
|
|
57
|
+
position,
|
|
58
|
+
onEscapeKeyDown: (event) => consumeOverlayEscape(event, onEscapeKeyDown),
|
|
59
|
+
...props,
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
62
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Viewport, {
|
|
63
|
+
className: cn("p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),
|
|
64
|
+
children
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
67
|
+
]
|
|
68
|
+
}) })
|
|
69
|
+
});
|
|
70
|
+
});
|
|
64
71
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
65
72
|
var SelectLabel = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Label, {
|
|
66
73
|
ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","names":[],"sources":["../../../src/components/ui/select.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { type VariantProps } from 'class-variance-authority';\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react';\n\nimport { selectTriggerVariants } from '@/components/ui/select-variants';\nimport {
|
|
1
|
+
{"version":3,"file":"select.js","names":[],"sources":["../../../src/components/ui/select.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { type VariantProps } from 'class-variance-authority';\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react';\n\nimport { selectTriggerVariants } from '@/components/ui/select-variants';\nimport { usePortalContainer } from '@/lib/app-overlay';\nimport { cn } from '@/lib/utils';\nimport { ShadeScope } from '@/shade-scope';\nimport { inputSurface, inputSurfaceClasses } from '@/components/ui/input-surface';\nimport { consumeOverlayEscape } from '@/lib/overlay-escape';\nimport { hasSafeArea, safeAreaCollision } from '@/lib/safe-area';\nconst Select = SelectPrimitive.Root;\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectValue = SelectPrimitive.Value;\n\nexport interface SelectTriggerProps\n extends\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>,\n VariantProps<typeof selectTriggerVariants> {\n /** Show the dropdown chevron. Defaults to hidden for the secondary variant. */\n showChevron?: boolean;\n}\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n SelectTriggerProps\n>(\n (\n { className, children, shape, variant, showChevron = variant !== 'secondary', ...props },\n ref,\n ) => {\n const resolvedShape = shape ?? 'rounded';\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n inputSurface('self'),\n inputSurfaceClasses.disabledFieldSelf,\n selectTriggerVariants({ shape: resolvedShape, variant }),\n showChevron && 'pr-2',\n className,\n )}\n data-control-shape={resolvedShape}\n data-variant={variant ?? 'default'}\n {...props}\n >\n {children}\n {showChevron && (\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"-mr-0.5 size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n )}\n </SelectPrimitive.Trigger>\n );\n },\n);\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn('flex cursor-default items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronUp className=\"size-4\" />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn('flex cursor-default items-center justify-center py-1', className)}\n {...props}\n >\n <ChevronDown className=\"size-4\" />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(\n (\n {\n className,\n children,\n onEscapeKeyDown,\n position: requested = 'popper',\n collisionBoundary,\n ...props\n },\n ref,\n ) => {\n const container = usePortalContainer();\n // Radix fits an item-aligned select to the window, ignoring the safe area's boundary.\n const position = hasSafeArea(container) ? 'popper' : requested;\n return (\n <SelectPrimitive.Portal container={container}>\n <ShadeScope>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n 'relative z-[9999] max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-menu border border-border/60 bg-surface-elevated-2 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 dark:border-border/30',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n {...safeAreaCollision(collisionBoundary, container)}\n position={position}\n onEscapeKeyDown={(event) => consumeOverlayEscape(event, onEscapeKeyDown)}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </ShadeScope>\n </SelectPrimitive.Portal>\n );\n },\n);\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-control font-semibold', className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex w-full cursor-default items-center rounded-menu-item py-1.5 pr-8 pl-2 text-control outline-hidden select-none focus:bg-interactive-hover focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 my-1 h-px bg-muted', className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n"],"mappings":";;;;;;;;;;;;AAYA,IAAM,SAAS,gBAAgB;AAE/B,IAAM,cAAc,gBAAgB;AAEpC,IAAM,cAAc,gBAAgB;AAUpC,IAAM,gBAAgB,QAAM,YAKxB,EAAE,WAAW,UAAU,OAAO,SAAS,cAAc,YAAY,aAAa,GAAG,SACjF,QACG;CACH,MAAM,gBAAgB,SAAS;CAC/B,OACE,qBAAC,gBAAgB,SAAjB;EACO;EACL,WAAW,GACT,aAAa,MAAM,GACnB,oBAAoB,mBACpB,sBAAsB;GAAE,OAAO;GAAe;EAAQ,CAAC,GACvD,eAAe,QACf,SACF;EACA,sBAAoB;EACpB,gBAAc,WAAW;EACzB,GAAI;YAXN,CAaG,UACA,eACC,oBAAC,gBAAgB,MAAjB;GAAsB,SAAA;aACpB,oBAAC,aAAD,EAAa,WAAU,4BAA6B,CAAA;EAChC,CAAA,CAED;;AAE7B,CACF;AACA,cAAc,cAAc,gBAAgB,QAAQ;AAEpD,IAAM,uBAAuB,QAAM,YAGhC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,gBAAjB;CACO;CACL,WAAW,GAAG,wDAAwD,SAAS;CAC/E,GAAI;WAEJ,oBAAC,WAAD,EAAW,WAAU,SAAU,CAAA;AACD,CAAA,CACjC;AACD,qBAAqB,cAAc,gBAAgB,eAAe;AAElE,IAAM,yBAAyB,QAAM,YAGlC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,kBAAjB;CACO;CACL,WAAW,GAAG,wDAAwD,SAAS;CAC/E,GAAI;WAEJ,oBAAC,aAAD,EAAa,WAAU,SAAU,CAAA;AACD,CAAA,CACnC;AACD,uBAAuB,cAAc,gBAAgB,iBAAiB;AAEtE,IAAM,gBAAgB,QAAM,YAKxB,EACE,WACA,UACA,iBACA,UAAU,YAAY,UACtB,mBACA,GAAG,SAEL,QACG;CACH,MAAM,YAAY,mBAAmB;CAErC,MAAM,WAAW,YAAY,SAAS,IAAI,WAAW;CACrD,OACE,oBAAC,gBAAgB,QAAjB;EAAmC;YACjC,oBAAC,YAAD,EAAA,UACE,qBAAC,gBAAgB,SAAjB;GACO;GACL,WAAW,GACT,ymBACA,aAAa,YACX,mIACF,SACF;GACA,GAAI,kBAAkB,mBAAmB,SAAS;GACxC;GACV,kBAAkB,UAAU,qBAAqB,OAAO,eAAe;GACvE,GAAI;aAXN;IAaE,oBAAC,sBAAD,CAAuB,CAAA;IACvB,oBAAC,gBAAgB,UAAjB;KACE,WAAW,GACT,OACA,aAAa,YACX,yFACJ;KAEC;IACuB,CAAA;IAC1B,oBAAC,wBAAD,CAAyB,CAAA;GACF;KACf,CAAA;CACU,CAAA;AAE5B,CACF;AACA,cAAc,cAAc,gBAAgB,QAAQ;AAEpD,IAAM,cAAc,QAAM,YAGvB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,OAAjB;CACO;CACL,WAAW,GAAG,0CAA0C,SAAS;CACjE,GAAI;AACL,CAAA,CACF;AACD,YAAY,cAAc,gBAAgB,MAAM;AAEhD,IAAM,aAAa,QAAM,YAGtB,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,qBAAC,gBAAgB,MAAjB;CACO;CACL,WAAW,GACT,sPACA,SACF;CACA,GAAI;WANN,CAQE,oBAAC,QAAD;EAAM,WAAU;YACd,oBAAC,gBAAgB,eAAjB,EAAA,UACE,oBAAC,OAAD,EAAO,WAAU,SAAU,CAAA,EACE,CAAA;CAC3B,CAAA,GACN,oBAAC,gBAAgB,UAAjB,EAA2B,SAAmC,CAAA,CAC1C;EACvB;AACD,WAAW,cAAc,gBAAgB,KAAK;AAE9C,IAAM,kBAAkB,QAAM,YAG3B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,WAAjB;CACO;CACL,WAAW,GAAG,4BAA4B,SAAS;CACnD,GAAI;AACL,CAAA,CACF;AACD,gBAAgB,cAAc,gBAAgB,UAAU"}
|
|
@@ -1,43 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../lib/ds-utils.js";
|
|
3
3
|
import { ShadeScope } from "../../shade-scope.js";
|
|
4
|
+
import { overlayTint, useHostedModal, useModalOpen } from "../../lib/app-overlay.js";
|
|
5
|
+
import { keepOpenOnToast } from "../../lib/toast-press.js";
|
|
4
6
|
import { X } from "lucide-react";
|
|
5
7
|
import * as React$1 from "react";
|
|
6
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
9
|
import { cva } from "class-variance-authority";
|
|
8
10
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
9
11
|
//#region src/components/ui/sheet.tsx
|
|
10
|
-
var Sheet =
|
|
12
|
+
var Sheet = (props) => {
|
|
13
|
+
const [rootProps, provideOpen] = useModalOpen(props);
|
|
14
|
+
return provideOpen(/* @__PURE__ */ jsx(SheetPrimitive.Root, { ...rootProps }));
|
|
15
|
+
};
|
|
11
16
|
var SheetTrigger = SheetPrimitive.Trigger;
|
|
12
17
|
var SheetClose = SheetPrimitive.Close;
|
|
13
18
|
var SheetPortal = SheetPrimitive.Portal;
|
|
14
19
|
var SheetOverlay = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SheetPrimitive.Overlay, {
|
|
15
|
-
className: cn("fixed inset-0 z-50
|
|
20
|
+
className: cn("fixed inset-0 z-50 duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", overlayTint("sheet"), className),
|
|
16
21
|
...props,
|
|
17
22
|
ref
|
|
18
23
|
}));
|
|
19
24
|
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
20
25
|
var sheetVariants = cva("fixed z-50 gap-4 bg-surface-elevated p-8 shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-200 data-[state=open]:animate-in data-[state=open]:duration-500", {
|
|
21
26
|
variants: { side: {
|
|
22
|
-
top: "inset-
|
|
23
|
-
bottom: "inset-
|
|
24
|
-
left: "inset-
|
|
25
|
-
right: "inset-
|
|
27
|
+
top: "top-[var(--ghost-safe-area-inset-top,0px)] right-[var(--ghost-safe-area-inset-right,0px)] left-[var(--ghost-safe-area-inset-left,0px)] border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
28
|
+
bottom: "right-[var(--ghost-safe-area-inset-right,0px)] bottom-[var(--ghost-safe-area-inset-bottom,0px)] left-[var(--ghost-safe-area-inset-left,0px)] border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
29
|
+
left: "top-[var(--ghost-safe-area-inset-top,0px)] bottom-[var(--ghost-safe-area-inset-bottom,0px)] left-[var(--ghost-safe-area-inset-left,0px)] h-[calc(100%_-_var(--ghost-safe-area-inset-top,0px)_-_var(--ghost-safe-area-inset-bottom,0px))] w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
30
|
+
right: "top-[var(--ghost-safe-area-inset-top,0px)] right-[var(--ghost-safe-area-inset-right,0px)] bottom-[var(--ghost-safe-area-inset-bottom,0px)] h-[calc(100%_-_var(--ghost-safe-area-inset-top,0px)_-_var(--ghost-safe-area-inset-bottom,0px))] w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
|
|
26
31
|
} },
|
|
27
32
|
defaultVariants: { side: "right" }
|
|
28
33
|
});
|
|
29
|
-
var SheetContent = React$1.forwardRef(({ side = "right", className, children, ...props }, ref) =>
|
|
30
|
-
ref,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
var SheetContent = React$1.forwardRef(({ side = "right", className, children, ...props }, ref) => {
|
|
35
|
+
const { container, inApp, overlayStyle, ref: contentRef, wrap } = useHostedModal("sheet", ref);
|
|
36
|
+
return /* @__PURE__ */ jsx(SheetPortal, {
|
|
37
|
+
container,
|
|
38
|
+
children: /* @__PURE__ */ jsxs(ShadeScope, { children: [/* @__PURE__ */ jsx(SheetOverlay, { style: overlayStyle }), wrap(/* @__PURE__ */ jsxs(SheetPrimitive.Content, {
|
|
39
|
+
ref: contentRef,
|
|
40
|
+
className: cn(sheetVariants({ side }), inApp && "overflow-y-auto", inApp && (side === "top" || side === "bottom") && "max-h-[calc(100dvh_-_var(--ghost-safe-area-inset-top,0px)_-_var(--ghost-safe-area-inset-bottom,0px))]", inApp && (side === "left" || side === "right") && "w-[min(75%,calc(100vw_-_var(--ghost-safe-area-inset-left,0px)_-_var(--ghost-safe-area-inset-right,0px)))]", className),
|
|
41
|
+
...props,
|
|
42
|
+
onInteractOutside: (event) => keepOpenOnToast(event, props.onInteractOutside),
|
|
43
|
+
children: [/* @__PURE__ */ jsxs(SheetPrimitive.Close, {
|
|
44
|
+
className: cn("top-4 right-4 z-50 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:bg-secondary", inApp || side === "bottom" ? "absolute" : "fixed"),
|
|
45
|
+
onFocus: inApp ? (event) => event.currentTarget.scrollIntoView({ block: "nearest" }) : void 0,
|
|
46
|
+
children: [/* @__PURE__ */ jsx(X, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
47
|
+
className: "sr-only",
|
|
48
|
+
children: "Close"
|
|
49
|
+
})]
|
|
50
|
+
}), children]
|
|
51
|
+
}))] })
|
|
52
|
+
});
|
|
53
|
+
});
|
|
41
54
|
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
42
55
|
var SheetHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
43
56
|
className: cn("flex flex-col space-y-1 text-center sm:text-left", className),
|
|
@@ -51,7 +64,7 @@ var SheetFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
|
51
64
|
SheetFooter.displayName = "SheetFooter";
|
|
52
65
|
var SheetTitle = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SheetPrimitive.Title, {
|
|
53
66
|
ref,
|
|
54
|
-
className: cn("text-xl font-semibold text-foreground", className),
|
|
67
|
+
className: cn("text-xl font-semibold text-foreground in-data-[admin7-design=true]:font-title", className),
|
|
55
68
|
...props
|
|
56
69
|
}));
|
|
57
70
|
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.js","names":[],"sources":["../../../src/components/ui/sheet.tsx"],"sourcesContent":["'use client';\n\n// Disable sourcemap for this file due to source map resolution errors\nimport * as React from 'react';\nimport * as SheetPrimitive from '@radix-ui/react-dialog';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { ShadeScope } from '@/shade-scope';\n\nconst Sheet = SheetPrimitive.Root;\n\nconst SheetTrigger = SheetPrimitive.Trigger;\n\nconst SheetClose = SheetPrimitive.Close;\n\nconst SheetPortal = SheetPrimitive.Portal;\n\nconst SheetOverlay = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n 'fixed inset-0 z-50
|
|
1
|
+
{"version":3,"file":"sheet.js","names":[],"sources":["../../../src/components/ui/sheet.tsx"],"sourcesContent":["'use client';\n\n// Disable sourcemap for this file due to source map resolution errors\nimport * as React from 'react';\nimport * as SheetPrimitive from '@radix-ui/react-dialog';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\n\nimport { overlayTint, useHostedModal, useModalOpen } from '@/lib/app-overlay';\nimport { cn } from '@/lib/utils';\nimport { keepOpenOnToast } from '@/lib/toast-press';\nimport { ShadeScope } from '@/shade-scope';\n\nconst Sheet = (props: React.ComponentProps<typeof SheetPrimitive.Root>) => {\n const [rootProps, provideOpen] = useModalOpen(props);\n return provideOpen(<SheetPrimitive.Root {...rootProps} />);\n};\n\nconst SheetTrigger = SheetPrimitive.Trigger;\n\nconst SheetClose = SheetPrimitive.Close;\n\nconst SheetPortal = SheetPrimitive.Portal;\n\nconst SheetOverlay = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n 'fixed inset-0 z-50 duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0',\n overlayTint('sheet'),\n className,\n )}\n {...props}\n ref={ref}\n />\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\n// A side sheet sets a height as well as its top and bottom, so a caller's `top-*`, `bottom-*`\n// or `h-*` still works.\nconst sheetVariants = cva(\n 'fixed z-50 gap-4 bg-surface-elevated p-8 shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-200 data-[state=open]:animate-in data-[state=open]:duration-500',\n {\n variants: {\n side: {\n top: 'top-[var(--ghost-safe-area-inset-top,0px)] right-[var(--ghost-safe-area-inset-right,0px)] left-[var(--ghost-safe-area-inset-left,0px)] border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',\n bottom:\n 'right-[var(--ghost-safe-area-inset-right,0px)] bottom-[var(--ghost-safe-area-inset-bottom,0px)] left-[var(--ghost-safe-area-inset-left,0px)] border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',\n left: 'top-[var(--ghost-safe-area-inset-top,0px)] bottom-[var(--ghost-safe-area-inset-bottom,0px)] left-[var(--ghost-safe-area-inset-left,0px)] h-[calc(100%_-_var(--ghost-safe-area-inset-top,0px)_-_var(--ghost-safe-area-inset-bottom,0px))] w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',\n right:\n 'top-[var(--ghost-safe-area-inset-top,0px)] right-[var(--ghost-safe-area-inset-right,0px)] bottom-[var(--ghost-safe-area-inset-bottom,0px)] h-[calc(100%_-_var(--ghost-safe-area-inset-top,0px)_-_var(--ghost-safe-area-inset-bottom,0px))] w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',\n },\n },\n defaultVariants: {\n side: 'right',\n },\n },\n);\n\ninterface SheetContentProps\n extends\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,\n VariantProps<typeof sheetVariants> {}\n\nconst SheetContent = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Content>,\n SheetContentProps\n>(({ side = 'right', className, children, ...props }, ref) => {\n const { container, inApp, overlayStyle, ref: contentRef, wrap } = useHostedModal('sheet', ref);\n return (\n <SheetPortal container={container}>\n <ShadeScope>\n <SheetOverlay style={overlayStyle} />\n {wrap(\n <SheetPrimitive.Content\n ref={contentRef}\n className={cn(\n sheetVariants({ side }),\n inApp && 'overflow-y-auto',\n inApp &&\n (side === 'top' || side === 'bottom') &&\n 'max-h-[calc(100dvh_-_var(--ghost-safe-area-inset-top,0px)_-_var(--ghost-safe-area-inset-bottom,0px))]',\n // On the width, not max-width, so a caller's `max-w-*` only narrows it.\n inApp &&\n (side === 'left' || side === 'right') &&\n 'w-[min(75%,calc(100vw_-_var(--ghost-safe-area-inset-left,0px)_-_var(--ghost-safe-area-inset-right,0px)))]',\n className,\n )}\n {...props}\n onInteractOutside={(event) => keepOpenOnToast(event, props.onInteractOutside)}\n >\n <SheetPrimitive.Close\n className={cn(\n 'top-4 right-4 z-50 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:bg-secondary',\n // In an app, the window's corner is under Admin's chrome, so use the sheet's.\n inApp || side === 'bottom' ? 'absolute' : 'fixed',\n )}\n // Radix's focus loop focuses this without scrolling, which can leave it out of sight\n // in a scrolled sheet.\n onFocus={\n inApp\n ? (event) => event.currentTarget.scrollIntoView({ block: 'nearest' })\n : undefined\n }\n >\n <X className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n {children}\n </SheetPrimitive.Content>,\n )}\n </ShadeScope>\n </SheetPortal>\n );\n});\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nconst SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-1 text-center sm:text-left', className)} {...props} />\n);\nSheetHeader.displayName = 'SheetHeader';\n\nconst SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-2', className)}\n {...props}\n />\n);\nSheetFooter.displayName = 'SheetFooter';\n\nconst SheetTitle = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title\n ref={ref}\n className={cn(\n 'text-xl font-semibold text-foreground in-data-[admin7-design=true]:font-title',\n className,\n )}\n {...props}\n />\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\nconst SheetDescription = React.forwardRef<\n React.ElementRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport {\n Sheet,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n"],"mappings":";;;;;;;;;;;AAaA,IAAM,SAAS,UAA4D;CACzE,MAAM,CAAC,WAAW,eAAe,aAAa,KAAK;CACnD,OAAO,YAAY,oBAAC,eAAe,MAAhB,EAAqB,GAAI,UAAY,CAAA,CAAC;AAC3D;AAEA,IAAM,eAAe,eAAe;AAEpC,IAAM,aAAa,eAAe;AAElC,IAAM,cAAc,eAAe;AAEnC,IAAM,eAAe,QAAM,YAGxB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,eAAe,SAAhB;CACE,WAAW,GACT,2JACA,YAAY,OAAO,GACnB,SACF;CACA,GAAI;CACC;AACN,CAAA,CACF;AACD,aAAa,cAAc,eAAe,QAAQ;AAIlD,IAAM,gBAAgB,IACpB,0MACA;CACE,UAAU,EACR,MAAM;EACJ,KAAK;EACL,QACE;EACF,MAAM;EACN,OACE;CACJ,EACF;CACA,iBAAiB,EACf,MAAM,QACR;AACF,CACF;AAOA,IAAM,eAAe,QAAM,YAGxB,EAAE,OAAO,SAAS,WAAW,UAAU,GAAG,SAAS,QAAQ;CAC5D,MAAM,EAAE,WAAW,OAAO,cAAc,KAAK,YAAY,SAAS,eAAe,SAAS,GAAG;CAC7F,OACE,oBAAC,aAAD;EAAwB;YACtB,qBAAC,YAAD,EAAA,UAAA,CACE,oBAAC,cAAD,EAAc,OAAO,aAAe,CAAA,GACnC,KACC,qBAAC,eAAe,SAAhB;GACE,KAAK;GACL,WAAW,GACT,cAAc,EAAE,KAAK,CAAC,GACtB,SAAS,mBACT,UACG,SAAS,SAAS,SAAS,aAC5B,yGAEF,UACG,SAAS,UAAU,SAAS,YAC7B,6GACF,SACF;GACA,GAAI;GACJ,oBAAoB,UAAU,gBAAgB,OAAO,MAAM,iBAAiB;aAf9E,CAiBE,qBAAC,eAAe,OAAhB;IACE,WAAW,GACT,oKAEA,SAAS,SAAS,WAAW,aAAa,OAC5C;IAGA,SACE,SACK,UAAU,MAAM,cAAc,eAAe,EAAE,OAAO,UAAU,CAAC,IAClE,KAAA;cAXR,CAcE,oBAAC,GAAD,EAAG,WAAU,SAAU,CAAA,GACvB,oBAAC,QAAD;KAAM,WAAU;eAAU;IAAW,CAAA,CACjB;OACrB,QACqB;IAC1B,CACU,EAAA,CAAA;CACD,CAAA;AAEjB,CAAC;AACD,aAAa,cAAc,eAAe,QAAQ;AAElD,IAAM,eAAe,EAAE,WAAW,GAAG,YACnC,oBAAC,OAAD;CAAK,WAAW,GAAG,oDAAoD,SAAS;CAAG,GAAI;AAAQ,CAAA;AAEjG,YAAY,cAAc;AAE1B,IAAM,eAAe,EAAE,WAAW,GAAG,YACnC,oBAAC,OAAD;CACE,WAAW,GAAG,6DAA6D,SAAS;CACpF,GAAI;AACL,CAAA;AAEH,YAAY,cAAc;AAE1B,IAAM,aAAa,QAAM,YAGtB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,eAAe,OAAhB;CACO;CACL,WAAW,GACT,iFACA,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,WAAW,cAAc,eAAe,MAAM;AAE9C,IAAM,mBAAmB,QAAM,YAG5B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,eAAe,aAAhB;CACO;CACL,WAAW,GAAG,iCAAiC,SAAS;CACxD,GAAI;AACL,CAAA,CACF;AACD,iBAAiB,cAAc,eAAe,YAAY"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useIsMobile } from "../../hooks/use-mobile.js";
|
|
2
2
|
import { cn } from "../../lib/ds-utils.js";
|
|
3
3
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
|
|
4
|
-
import { Button } from "./button.js";
|
|
5
|
-
import { Input } from "./input.js";
|
|
6
4
|
import { Skeleton } from "./skeleton.js";
|
|
5
|
+
import { Button } from "./button.js";
|
|
7
6
|
import { Separator } from "./separator.js";
|
|
7
|
+
import { Input } from "./input.js";
|
|
8
8
|
import { Sheet, SheetContent } from "./sheet.js";
|
|
9
9
|
import { SidebarContext, useSidebar } from "./sidebar-context.js";
|
|
10
10
|
import { PanelLeft } from "lucide-react";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
-
import { useShade } from "../../providers/shade-context.js";
|
|
3
2
|
import { Button } from "./button.js";
|
|
4
3
|
import { ArrowLeft, ArrowRight } from "lucide-react";
|
|
5
4
|
import React from "react";
|
|
@@ -40,22 +39,20 @@ var SimplePaginationNavigation = React.forwardRef(({ className, children, ...pro
|
|
|
40
39
|
});
|
|
41
40
|
});
|
|
42
41
|
SimplePaginationNavigation.displayName = "SimplePaginationNavigation";
|
|
43
|
-
var SimplePaginationPreviousButton = React.forwardRef(({ variant = "subtle", size, ...props }, ref) => {
|
|
44
|
-
const { isAdmin7 } = useShade();
|
|
42
|
+
var SimplePaginationPreviousButton = React.forwardRef(({ variant = "subtle", size = "icon", ...props }, ref) => {
|
|
45
43
|
return /* @__PURE__ */ jsx(Button, {
|
|
46
44
|
ref,
|
|
47
|
-
size
|
|
45
|
+
size,
|
|
48
46
|
variant,
|
|
49
47
|
...props,
|
|
50
48
|
children: /* @__PURE__ */ jsx(ArrowLeft, {})
|
|
51
49
|
});
|
|
52
50
|
});
|
|
53
51
|
SimplePaginationPreviousButton.displayName = "SimplePaginationPreviousButton";
|
|
54
|
-
var SimplePaginationNextButton = React.forwardRef(({ variant = "subtle", size, ...props }, ref) => {
|
|
55
|
-
const { isAdmin7 } = useShade();
|
|
52
|
+
var SimplePaginationNextButton = React.forwardRef(({ variant = "subtle", size = "icon", ...props }, ref) => {
|
|
56
53
|
return /* @__PURE__ */ jsx(Button, {
|
|
57
54
|
ref,
|
|
58
|
-
size
|
|
55
|
+
size,
|
|
59
56
|
variant,
|
|
60
57
|
...props,
|
|
61
58
|
children: /* @__PURE__ */ jsx(ArrowRight, {})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-pagination.js","names":[],"sources":["../../../src/components/ui/simple-pagination.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"simple-pagination.js","names":[],"sources":["../../../src/components/ui/simple-pagination.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\nimport React from 'react';\nimport { Button, ButtonProps } from './button';\nimport { ArrowLeft, ArrowRight } from 'lucide-react';\n\n/**\n * Use along with use-simple-pagination hook — see that file for more about how\n */\n\nconst SimplePagination = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn('flex items-center justify-between gap-4 pb-6 text-sm', className)}\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nSimplePagination.displayName = 'SimplePagination';\n\ninterface SimplePaginationPagesProps extends React.HTMLAttributes<HTMLSpanElement> {\n currentPage?: string;\n totalPages?: string;\n}\n\nconst SimplePaginationPages = React.forwardRef<HTMLSpanElement, SimplePaginationPagesProps>(\n ({ className, currentPage, totalPages, ...props }, ref) => {\n return (\n <span ref={ref} className={cn('text-muted-foreground', className)} {...props}>\n Pages {currentPage} of {totalPages}\n </span>\n );\n },\n);\n\nSimplePaginationPages.displayName = 'SimplePaginationPages';\n\nconst SimplePaginationNavigation = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, children, ...props }, ref) => {\n return (\n <div ref={ref} className={cn('flex items-center gap-1.5', className)} {...props}>\n {children}\n </div>\n );\n});\n\nSimplePaginationNavigation.displayName = 'SimplePaginationNavigation';\n\nconst SimplePaginationPreviousButton = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant = 'subtle', size = 'icon', ...props }, ref) => {\n return (\n <Button ref={ref} size={size} variant={variant} {...props}>\n <ArrowLeft />\n </Button>\n );\n },\n);\n\nSimplePaginationPreviousButton.displayName = 'SimplePaginationPreviousButton';\n\nconst SimplePaginationNextButton = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ variant = 'subtle', size = 'icon', ...props }, ref) => {\n return (\n <Button ref={ref} size={size} variant={variant} {...props}>\n <ArrowRight />\n </Button>\n );\n },\n);\n\nSimplePaginationNextButton.displayName = 'SimplePaginationNextButton';\n\nexport {\n SimplePagination,\n SimplePaginationPages,\n SimplePaginationNavigation,\n SimplePaginationPreviousButton,\n SimplePaginationNextButton,\n};\n"],"mappings":";;;;;;;;;AASA,IAAM,mBAAmB,MAAM,YAC5B,EAAE,WAAW,UAAU,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GAAG,wDAAwD,SAAS;EAC/E,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,iBAAiB,cAAc;AAO/B,IAAM,wBAAwB,MAAM,YACjC,EAAE,WAAW,aAAa,YAAY,GAAG,SAAS,QAAQ;CACzD,OACE,qBAAC,QAAD;EAAW;EAAK,WAAW,GAAG,yBAAyB,SAAS;EAAG,GAAI;YAAvE;GAA8E;GACrE;GAAY;GAAK;EACpB;;AAEV,CACF;AAEA,sBAAsB,cAAc;AAEpC,IAAM,6BAA6B,MAAM,YAGtC,EAAE,WAAW,UAAU,GAAG,SAAS,QAAQ;CAC5C,OACE,oBAAC,OAAD;EAAU;EAAK,WAAW,GAAG,6BAA6B,SAAS;EAAG,GAAI;EACvE;CACE,CAAA;AAET,CAAC;AAED,2BAA2B,cAAc;AAEzC,IAAM,iCAAiC,MAAM,YAC1C,EAAE,UAAU,UAAU,OAAO,QAAQ,GAAG,SAAS,QAAQ;CACxD,OACE,oBAAC,QAAD;EAAa;EAAW;EAAe;EAAS,GAAI;YAClD,oBAAC,WAAD,CAAY,CAAA;CACN,CAAA;AAEZ,CACF;AAEA,+BAA+B,cAAc;AAE7C,IAAM,6BAA6B,MAAM,YACtC,EAAE,UAAU,UAAU,OAAO,QAAQ,GAAG,SAAS,QAAQ;CACxD,OACE,oBAAC,QAAD;EAAa;EAAW;EAAe;EAAS,GAAI;YAClD,oBAAC,YAAD,CAAa,CAAA;CACP,CAAA;AAEZ,CACF;AAEA,2BAA2B,cAAc"}
|