@automa8e/ui 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2 -0
- package/dist/_virtual/index.js +6 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/index2.js +5 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js.map +1 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js.map +1 -0
- package/dist/automa8e-ui.css +226 -0
- package/dist/components/automation/metric-card.d.ts +19 -0
- package/dist/components/automation/metric-card.d.ts.map +1 -0
- package/dist/components/automation/metric-card.js +59 -0
- package/dist/components/automation/metric-card.js.map +1 -0
- package/dist/components/automation/status-badge.d.ts +27 -0
- package/dist/components/automation/status-badge.d.ts.map +1 -0
- package/dist/components/automation/status-badge.js +112 -0
- package/dist/components/automation/status-badge.js.map +1 -0
- package/dist/components/automation/task-card.d.ts +14 -0
- package/dist/components/automation/task-card.d.ts.map +1 -0
- package/dist/components/automation/task-card.js +114 -0
- package/dist/components/automation/task-card.js.map +1 -0
- package/dist/components/automation/workflow-node.d.ts +20 -0
- package/dist/components/automation/workflow-node.d.ts.map +1 -0
- package/dist/components/automation/workflow-node.js +132 -0
- package/dist/components/automation/workflow-node.js.map +1 -0
- package/dist/components/layout/app-shell.d.ts +21 -0
- package/dist/components/layout/app-shell.d.ts.map +1 -0
- package/dist/components/layout/app-shell.js +35 -0
- package/dist/components/layout/app-shell.js.map +1 -0
- package/dist/components/layout/header.d.ts +16 -0
- package/dist/components/layout/header.d.ts.map +1 -0
- package/dist/components/layout/header.js +30 -0
- package/dist/components/layout/header.js.map +1 -0
- package/dist/components/layout/page-header.d.ts +16 -0
- package/dist/components/layout/page-header.d.ts.map +1 -0
- package/dist/components/layout/page-header.js +29 -0
- package/dist/components/layout/page-header.js.map +1 -0
- package/dist/components/layout/sidebar.d.ts +35 -0
- package/dist/components/layout/sidebar.d.ts.map +1 -0
- package/dist/components/layout/sidebar.js +103 -0
- package/dist/components/layout/sidebar.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +51 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/alert.d.ts +18 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +89 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +20 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +72 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +13 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +54 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/button.d.ts +15 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +96 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/card.d.ts +16 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +96 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +9 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +29 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +28 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +105 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +160 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/input.d.ts +14 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +60 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/label.d.ts +13 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +26 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +29 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +17 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +80 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +39 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.d.ts +16 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +131 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +9 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +50 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +10 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +30 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +14 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +44 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +8 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +43 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +95 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +20 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +92 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +12 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +41 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toast.d.ts +16 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +113 -0
- package/dist/components/ui/toast.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +28 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/hooks/use-debounce.d.ts +15 -0
- package/dist/hooks/use-debounce.d.ts.map +1 -0
- package/dist/hooks/use-debounce.js +15 -0
- package/dist/hooks/use-debounce.js.map +1 -0
- package/dist/hooks/use-local-storage.d.ts +9 -0
- package/dist/hooks/use-local-storage.d.ts.map +1 -0
- package/dist/hooks/use-local-storage.js +49 -0
- package/dist/hooks/use-local-storage.js.map +1 -0
- package/dist/hooks/use-media-query.d.ts +9 -0
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +20 -0
- package/dist/hooks/use-media-query.js.map +1 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +153 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/colors.d.ts +73 -0
- package/dist/lib/colors.d.ts.map +1 -0
- package/dist/lib/colors.js +64 -0
- package/dist/lib/colors.js.map +1 -0
- package/dist/lib/utils.d.ts +7 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +9 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +729 -0
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js.map +1 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +630 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js.map +1 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +325 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js.map +1 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +177 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js.map +1 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +152 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js.map +1 -0
- package/dist/node_modules/@radix-ui/number/dist/index.js +7 -0
- package/dist/node_modules/@radix-ui/number/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +12 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +319 -0
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +26 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +124 -0
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.js +66 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.js +40 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +280 -0
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +152 -0
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +71 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.js +90 -0
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +40 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +82 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +342 -0
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js +90 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js +11 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +217 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +299 -0
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +30 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +209 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-label/dist/index.js +27 -0
- package/dist/node_modules/@radix-ui/react-label/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-label/node_modules/@radix-ui/react-primitive/dist/index.js +40 -0
- package/dist/node_modules/@radix-ui/react-label/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +881 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.js +90 -0
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +314 -0
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot/dist/index.js +90 -0
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +294 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +19 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +130 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +44 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.js +90 -0
- package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-progress/dist/index.js +97 -0
- package/dist/node_modules/@radix-ui/react-progress/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-context/dist/index.js +66 -0
- package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-context/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-primitive/dist/index.js +40 -0
- package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +228 -0
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-scroll-area/dist/index.js +728 -0
- package/dist/node_modules/@radix-ui/react-scroll-area/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +1200 -0
- package/dist/node_modules/@radix-ui/react-select/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot/dist/index.js +90 -0
- package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-separator/dist/index.js +31 -0
- package/dist/node_modules/@radix-ui/react-separator/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-primitive/dist/index.js +40 -0
- package/dist/node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-primitive/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +107 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +156 -0
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +195 -0
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-toast/dist/index.js +645 -0
- package/dist/node_modules/@radix-ui/react-toast/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +501 -0
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +72 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +18 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +40 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +37 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js.map +1 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +123 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js.map +1 -0
- package/dist/node_modules/class-variance-authority/dist/index.js +46 -0
- package/dist/node_modules/class-variance-authority/dist/index.js.map +1 -0
- package/dist/node_modules/clsx/dist/clsx.js +17 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js +10 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.js +43 -0
- package/dist/node_modules/lucide-react/dist/esm/Icon.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +25 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +21 -0
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ban.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/ban.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/calendar.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/calendar.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-minus.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-minus.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-x.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-x.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/circle.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/clock.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/clock.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/flag.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/flag.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/git-branch.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/git-branch.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/info.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/info.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/minus.js +12 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/minus.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/pause.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/pause.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/play.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/play.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/send.js +21 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/send.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/tag.js +21 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/tag.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/timer.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/timer.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/trending-down.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/trending-down.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/trending-up.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/trending-up.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/triangle-alert.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/triangle-alert.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/x.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/x.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/zap.js +20 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/zap.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +12 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +181 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +39 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +20 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +103 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +6 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js.map +1 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +8 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js.map +1 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +48 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js.map +1 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +11 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js.map +1 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +38 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js.map +1 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +14 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js.map +1 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +17 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js.map +1 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +49 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js.map +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +2467 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/dist/node_modules/tslib/tslib.es6.js +40 -0
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +12 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js.map +1 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +36 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js.map +1 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +30 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js.map +1 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +22 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js.map +1 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +89 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js.map +1 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +78 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +63 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js.map +1 -0
- package/dist/node_modules/use-sync-external-store/shim/index.js +18 -0
- package/dist/node_modules/use-sync-external-store/shim/index.js.map +1 -0
- package/dist/types/automation.d.ts +59 -0
- package/dist/types/automation.d.ts.map +1 -0
- package/dist/types/common.d.ts +38 -0
- package/dist/types/common.d.ts.map +1 -0
- package/package.json +119 -0
- package/registry/registry.json +218 -0
- package/src/components/automation/metric-card.tsx +113 -0
- package/src/components/automation/status-badge.tsx +136 -0
- package/src/components/automation/task-card.tsx +164 -0
- package/src/components/automation/workflow-node.tsx +186 -0
- package/src/components/layout/app-shell.tsx +58 -0
- package/src/components/layout/header.tsx +39 -0
- package/src/components/layout/page-header.tsx +42 -0
- package/src/components/layout/sidebar.tsx +190 -0
- package/src/components/ui/accordion.tsx +57 -0
- package/src/components/ui/alert.tsx +93 -0
- package/src/components/ui/avatar.tsx +94 -0
- package/src/components/ui/badge.tsx +69 -0
- package/src/components/ui/button.tsx +106 -0
- package/src/components/ui/card.tsx +96 -0
- package/src/components/ui/checkbox.tsx +40 -0
- package/src/components/ui/dialog.tsx +129 -0
- package/src/components/ui/dropdown-menu.tsx +194 -0
- package/src/components/ui/input.tsx +80 -0
- package/src/components/ui/label.tsx +37 -0
- package/src/components/ui/popover.tsx +29 -0
- package/src/components/ui/progress.tsx +92 -0
- package/src/components/ui/scroll-area.tsx +43 -0
- package/src/components/ui/select.tsx +157 -0
- package/src/components/ui/separator.tsx +56 -0
- package/src/components/ui/skeleton.tsx +41 -0
- package/src/components/ui/spinner.tsx +50 -0
- package/src/components/ui/switch.tsx +46 -0
- package/src/components/ui/table.tsx +117 -0
- package/src/components/ui/tabs.tsx +107 -0
- package/src/components/ui/textarea.tsx +50 -0
- package/src/components/ui/toast.tsx +139 -0
- package/src/components/ui/tooltip.tsx +28 -0
- package/src/hooks/use-debounce.ts +28 -0
- package/src/hooks/use-local-storage.ts +63 -0
- package/src/hooks/use-media-query.ts +29 -0
- package/src/index.ts +197 -0
- package/src/lib/colors.ts +102 -0
- package/src/lib/utils.ts +10 -0
- package/src/styles/globals.css +230 -0
- package/src/types/automation.ts +74 -0
- package/src/types/common.ts +48 -0
- package/tailwind/preset.cjs +98 -0
- package/tailwind/preset.css +5 -0
- package/tailwind/preset.ts +159 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { composeEventHandlers } from "../../primitive/dist/index.js";
|
|
3
|
+
import { Primitive, dispatchDiscreteCustomEvent } from "../../react-primitive/dist/index.js";
|
|
4
|
+
import { useComposedRefs } from "../../react-compose-refs/dist/index.js";
|
|
5
|
+
import { useCallbackRef } from "../../react-use-callback-ref/dist/index.js";
|
|
6
|
+
import { useEscapeKeydown } from "../../react-use-escape-keydown/dist/index.js";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
|
9
|
+
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
10
|
+
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
11
|
+
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
12
|
+
var originalBodyPointerEvents;
|
|
13
|
+
var DismissableLayerContext = React.createContext({
|
|
14
|
+
layers: /* @__PURE__ */ new Set(),
|
|
15
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
16
|
+
branches: /* @__PURE__ */ new Set()
|
|
17
|
+
});
|
|
18
|
+
var DismissableLayer = React.forwardRef(
|
|
19
|
+
(props, forwardedRef) => {
|
|
20
|
+
const {
|
|
21
|
+
disableOutsidePointerEvents = false,
|
|
22
|
+
onEscapeKeyDown,
|
|
23
|
+
onPointerDownOutside,
|
|
24
|
+
onFocusOutside,
|
|
25
|
+
onInteractOutside,
|
|
26
|
+
onDismiss,
|
|
27
|
+
...layerProps
|
|
28
|
+
} = props;
|
|
29
|
+
const context = React.useContext(DismissableLayerContext);
|
|
30
|
+
const [node, setNode] = React.useState(null);
|
|
31
|
+
const ownerDocument = (node == null ? void 0 : node.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document);
|
|
32
|
+
const [, force] = React.useState({});
|
|
33
|
+
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
34
|
+
const layers = Array.from(context.layers);
|
|
35
|
+
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
36
|
+
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
|
37
|
+
const index = node ? layers.indexOf(node) : -1;
|
|
38
|
+
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
39
|
+
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
40
|
+
const pointerDownOutside = usePointerDownOutside((event) => {
|
|
41
|
+
const target = event.target;
|
|
42
|
+
const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
43
|
+
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
44
|
+
onPointerDownOutside == null ? void 0 : onPointerDownOutside(event);
|
|
45
|
+
onInteractOutside == null ? void 0 : onInteractOutside(event);
|
|
46
|
+
if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
|
|
47
|
+
}, ownerDocument);
|
|
48
|
+
const focusOutside = useFocusOutside((event) => {
|
|
49
|
+
const target = event.target;
|
|
50
|
+
const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
51
|
+
if (isFocusInBranch) return;
|
|
52
|
+
onFocusOutside == null ? void 0 : onFocusOutside(event);
|
|
53
|
+
onInteractOutside == null ? void 0 : onInteractOutside(event);
|
|
54
|
+
if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
|
|
55
|
+
}, ownerDocument);
|
|
56
|
+
useEscapeKeydown((event) => {
|
|
57
|
+
const isHighestLayer = index === context.layers.size - 1;
|
|
58
|
+
if (!isHighestLayer) return;
|
|
59
|
+
onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(event);
|
|
60
|
+
if (!event.defaultPrevented && onDismiss) {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
onDismiss();
|
|
63
|
+
}
|
|
64
|
+
}, ownerDocument);
|
|
65
|
+
React.useEffect(() => {
|
|
66
|
+
if (!node) return;
|
|
67
|
+
if (disableOutsidePointerEvents) {
|
|
68
|
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
69
|
+
originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
70
|
+
ownerDocument.body.style.pointerEvents = "none";
|
|
71
|
+
}
|
|
72
|
+
context.layersWithOutsidePointerEventsDisabled.add(node);
|
|
73
|
+
}
|
|
74
|
+
context.layers.add(node);
|
|
75
|
+
dispatchUpdate();
|
|
76
|
+
return () => {
|
|
77
|
+
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
|
|
78
|
+
ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
82
|
+
React.useEffect(() => {
|
|
83
|
+
return () => {
|
|
84
|
+
if (!node) return;
|
|
85
|
+
context.layers.delete(node);
|
|
86
|
+
context.layersWithOutsidePointerEventsDisabled.delete(node);
|
|
87
|
+
dispatchUpdate();
|
|
88
|
+
};
|
|
89
|
+
}, [node, context]);
|
|
90
|
+
React.useEffect(() => {
|
|
91
|
+
const handleUpdate = () => force({});
|
|
92
|
+
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
93
|
+
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
94
|
+
}, []);
|
|
95
|
+
return /* @__PURE__ */ jsx(
|
|
96
|
+
Primitive.div,
|
|
97
|
+
{
|
|
98
|
+
...layerProps,
|
|
99
|
+
ref: composedRefs,
|
|
100
|
+
style: {
|
|
101
|
+
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
|
102
|
+
...props.style
|
|
103
|
+
},
|
|
104
|
+
onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
105
|
+
onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
106
|
+
onPointerDownCapture: composeEventHandlers(
|
|
107
|
+
props.onPointerDownCapture,
|
|
108
|
+
pointerDownOutside.onPointerDownCapture
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
115
|
+
var BRANCH_NAME = "DismissableLayerBranch";
|
|
116
|
+
var DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {
|
|
117
|
+
const context = React.useContext(DismissableLayerContext);
|
|
118
|
+
const ref = React.useRef(null);
|
|
119
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
120
|
+
React.useEffect(() => {
|
|
121
|
+
const node = ref.current;
|
|
122
|
+
if (node) {
|
|
123
|
+
context.branches.add(node);
|
|
124
|
+
return () => {
|
|
125
|
+
context.branches.delete(node);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}, [context.branches]);
|
|
129
|
+
return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });
|
|
130
|
+
});
|
|
131
|
+
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
132
|
+
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
133
|
+
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
134
|
+
const isPointerInsideReactTreeRef = React.useRef(false);
|
|
135
|
+
const handleClickRef = React.useRef(() => {
|
|
136
|
+
});
|
|
137
|
+
React.useEffect(() => {
|
|
138
|
+
const handlePointerDown = (event) => {
|
|
139
|
+
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
140
|
+
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
141
|
+
handleAndDispatchCustomEvent(
|
|
142
|
+
POINTER_DOWN_OUTSIDE,
|
|
143
|
+
handlePointerDownOutside,
|
|
144
|
+
eventDetail,
|
|
145
|
+
{ discrete: true }
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
const eventDetail = { originalEvent: event };
|
|
149
|
+
if (event.pointerType === "touch") {
|
|
150
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
151
|
+
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
|
|
152
|
+
ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
|
|
153
|
+
} else {
|
|
154
|
+
handleAndDispatchPointerDownOutsideEvent2();
|
|
155
|
+
}
|
|
156
|
+
} else {
|
|
157
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
158
|
+
}
|
|
159
|
+
isPointerInsideReactTreeRef.current = false;
|
|
160
|
+
};
|
|
161
|
+
const timerId = window.setTimeout(() => {
|
|
162
|
+
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
|
163
|
+
}, 0);
|
|
164
|
+
return () => {
|
|
165
|
+
window.clearTimeout(timerId);
|
|
166
|
+
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
167
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
168
|
+
};
|
|
169
|
+
}, [ownerDocument, handlePointerDownOutside]);
|
|
170
|
+
return {
|
|
171
|
+
// ensures we check React component tree (not just DOM tree)
|
|
172
|
+
onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function useFocusOutside(onFocusOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
176
|
+
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
177
|
+
const isFocusInsideReactTreeRef = React.useRef(false);
|
|
178
|
+
React.useEffect(() => {
|
|
179
|
+
const handleFocus = (event) => {
|
|
180
|
+
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
181
|
+
const eventDetail = { originalEvent: event };
|
|
182
|
+
handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
183
|
+
discrete: false
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
ownerDocument.addEventListener("focusin", handleFocus);
|
|
188
|
+
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
|
189
|
+
}, [ownerDocument, handleFocusOutside]);
|
|
190
|
+
return {
|
|
191
|
+
onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
|
|
192
|
+
onBlurCapture: () => isFocusInsideReactTreeRef.current = false
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function dispatchUpdate() {
|
|
196
|
+
const event = new CustomEvent(CONTEXT_UPDATE);
|
|
197
|
+
document.dispatchEvent(event);
|
|
198
|
+
}
|
|
199
|
+
function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
200
|
+
const target = detail.originalEvent.target;
|
|
201
|
+
const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
|
|
202
|
+
if (handler) target.addEventListener(name, handler, { once: true });
|
|
203
|
+
if (discrete) {
|
|
204
|
+
dispatchDiscreteCustomEvent(target, event);
|
|
205
|
+
} else {
|
|
206
|
+
target.dispatchEvent(event);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
var Root = DismissableLayer;
|
|
210
|
+
var Branch = DismissableLayerBranch;
|
|
211
|
+
export {
|
|
212
|
+
Branch,
|
|
213
|
+
DismissableLayer,
|
|
214
|
+
DismissableLayerBranch,
|
|
215
|
+
Root
|
|
216
|
+
};
|
|
217
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/dismissable-layer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DISMISSABLE_LAYER_NAME = \"DismissableLayer\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const focusOutside = useFocusOutside((event) => {\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }\n);\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\nvar BRANCH_NAME = \"DismissableLayerBranch\";\nvar DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n});\nDismissableLayerBranch.displayName = BRANCH_NAME;\nfunction usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n const handlePointerDown = (event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n const eventDetail = { originalEvent: event };\n if (event.pointerType === \"touch\") {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent2();\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true\n };\n}\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = (event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n };\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: () => isFocusInsideReactTreeRef.current = true,\n onBlurCapture: () => isFocusInsideReactTreeRef.current = false\n };\n}\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;;;;;AAUA,IAAI,yBAAyB;AAC7B,IAAI,iBAAiB;AACrB,IAAI,uBAAuB;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CAAC,eAAe,kBAAkB,CAAC;AACtC,SAAO;AAAA,IACL,gBAAgB,MAAM,0BAA0B,UAAU;AAAA,IAC1D,eAAe,MAAM,0BAA0B,UAAU;AAAA,EAC7D;AACA;AACA,SAAS,iBAAiB;AACxB,QAAM,QAAQ,IAAI,YAAY,cAAc;AAC5C,WAAS,cAAc,KAAK;AAC9B;AACA,SAAS,6BAA6B,MAAM,SAAS,QAAQ,EAAE,SAAQ,GAAI;AACzE,QAAM,SAAS,OAAO,cAAc;AACpC,QAAM,QAAQ,IAAI,YAAY,MAAM,EAAE,SAAS,OAAO,YAAY,MAAM,QAAQ;AAChF,MAAI,QAAS,QAAO,iBAAiB,MAAM,SAAS,EAAE,MAAM,MAAM;AAClE,MAAI,UAAU;AACZ,gCAA4B,QAAQ,KAAK;AAAA,EAC3C,OAAO;AACL,WAAO,cAAc,KAAK;AAAA,EAC5B;AACF;AACG,IAAC,OAAO;AACR,IAAC,SAAS;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { composeEventHandlers } from "../../primitive/dist/index.js";
|
|
3
|
+
import { composeRefs } from "../../react-compose-refs/dist/index.js";
|
|
4
|
+
import { createContextScope } from "../../react-context/dist/index.js";
|
|
5
|
+
import { useControllableState } from "../../react-use-controllable-state/dist/index.js";
|
|
6
|
+
import { Primitive } from "../../react-primitive/dist/index.js";
|
|
7
|
+
import { Root as Root3, Group, Portal, RadioGroup, Sub, Anchor as Anchor2, createMenuScope, CheckboxItem, ItemIndicator, Content as Content2$1, Item as Item2$1, Label, RadioItem, Separator, SubContent, SubTrigger, Arrow as Arrow2 } from "../../react-menu/dist/index.js";
|
|
8
|
+
import { useId } from "../../react-id/dist/index.js";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
11
|
+
var [createDropdownMenuContext] = createContextScope(
|
|
12
|
+
DROPDOWN_MENU_NAME,
|
|
13
|
+
[createMenuScope]
|
|
14
|
+
);
|
|
15
|
+
var useMenuScope = createMenuScope();
|
|
16
|
+
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
17
|
+
var DropdownMenu = (props) => {
|
|
18
|
+
const {
|
|
19
|
+
__scopeDropdownMenu,
|
|
20
|
+
children,
|
|
21
|
+
dir,
|
|
22
|
+
open: openProp,
|
|
23
|
+
defaultOpen,
|
|
24
|
+
onOpenChange,
|
|
25
|
+
modal = true
|
|
26
|
+
} = props;
|
|
27
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
28
|
+
const triggerRef = React.useRef(null);
|
|
29
|
+
const [open, setOpen] = useControllableState({
|
|
30
|
+
prop: openProp,
|
|
31
|
+
defaultProp: defaultOpen ?? false,
|
|
32
|
+
onChange: onOpenChange,
|
|
33
|
+
caller: DROPDOWN_MENU_NAME
|
|
34
|
+
});
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
DropdownMenuProvider,
|
|
37
|
+
{
|
|
38
|
+
scope: __scopeDropdownMenu,
|
|
39
|
+
triggerId: useId(),
|
|
40
|
+
triggerRef,
|
|
41
|
+
contentId: useId(),
|
|
42
|
+
open,
|
|
43
|
+
onOpenChange: setOpen,
|
|
44
|
+
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
45
|
+
modal,
|
|
46
|
+
children: /* @__PURE__ */ jsx(Root3, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
DropdownMenu.displayName = DROPDOWN_MENU_NAME;
|
|
51
|
+
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
52
|
+
var DropdownMenuTrigger = React.forwardRef(
|
|
53
|
+
(props, forwardedRef) => {
|
|
54
|
+
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
55
|
+
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
56
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
57
|
+
return /* @__PURE__ */ jsx(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx(
|
|
58
|
+
Primitive.button,
|
|
59
|
+
{
|
|
60
|
+
type: "button",
|
|
61
|
+
id: context.triggerId,
|
|
62
|
+
"aria-haspopup": "menu",
|
|
63
|
+
"aria-expanded": context.open,
|
|
64
|
+
"aria-controls": context.open ? context.contentId : void 0,
|
|
65
|
+
"data-state": context.open ? "open" : "closed",
|
|
66
|
+
"data-disabled": disabled ? "" : void 0,
|
|
67
|
+
disabled,
|
|
68
|
+
...triggerProps,
|
|
69
|
+
ref: composeRefs(forwardedRef, context.triggerRef),
|
|
70
|
+
onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
|
|
71
|
+
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
72
|
+
context.onOpenToggle();
|
|
73
|
+
if (!context.open) event.preventDefault();
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
76
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
77
|
+
if (disabled) return;
|
|
78
|
+
if (["Enter", " "].includes(event.key)) context.onOpenToggle();
|
|
79
|
+
if (event.key === "ArrowDown") context.onOpenChange(true);
|
|
80
|
+
if (["Enter", " ", "ArrowDown"].includes(event.key)) event.preventDefault();
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
) });
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
DropdownMenuTrigger.displayName = TRIGGER_NAME;
|
|
87
|
+
var PORTAL_NAME = "DropdownMenuPortal";
|
|
88
|
+
var DropdownMenuPortal = (props) => {
|
|
89
|
+
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
90
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
91
|
+
return /* @__PURE__ */ jsx(Portal, { ...menuScope, ...portalProps });
|
|
92
|
+
};
|
|
93
|
+
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
94
|
+
var CONTENT_NAME = "DropdownMenuContent";
|
|
95
|
+
var DropdownMenuContent = React.forwardRef(
|
|
96
|
+
(props, forwardedRef) => {
|
|
97
|
+
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
98
|
+
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
99
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
100
|
+
const hasInteractedOutsideRef = React.useRef(false);
|
|
101
|
+
return /* @__PURE__ */ jsx(
|
|
102
|
+
Content2$1,
|
|
103
|
+
{
|
|
104
|
+
id: context.contentId,
|
|
105
|
+
"aria-labelledby": context.triggerId,
|
|
106
|
+
...menuScope,
|
|
107
|
+
...contentProps,
|
|
108
|
+
ref: forwardedRef,
|
|
109
|
+
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
110
|
+
var _a;
|
|
111
|
+
if (!hasInteractedOutsideRef.current) (_a = context.triggerRef.current) == null ? void 0 : _a.focus();
|
|
112
|
+
hasInteractedOutsideRef.current = false;
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
}),
|
|
115
|
+
onInteractOutside: composeEventHandlers(props.onInteractOutside, (event) => {
|
|
116
|
+
const originalEvent = event.detail.originalEvent;
|
|
117
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
118
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
119
|
+
if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;
|
|
120
|
+
}),
|
|
121
|
+
style: {
|
|
122
|
+
...props.style,
|
|
123
|
+
// re-namespace exposed content custom properties
|
|
124
|
+
...{
|
|
125
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
126
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
127
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
128
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
129
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
DropdownMenuContent.displayName = CONTENT_NAME;
|
|
137
|
+
var GROUP_NAME = "DropdownMenuGroup";
|
|
138
|
+
var DropdownMenuGroup = React.forwardRef(
|
|
139
|
+
(props, forwardedRef) => {
|
|
140
|
+
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
141
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
142
|
+
return /* @__PURE__ */ jsx(Group, { ...menuScope, ...groupProps, ref: forwardedRef });
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
146
|
+
var LABEL_NAME = "DropdownMenuLabel";
|
|
147
|
+
var DropdownMenuLabel = React.forwardRef(
|
|
148
|
+
(props, forwardedRef) => {
|
|
149
|
+
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
150
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
151
|
+
return /* @__PURE__ */ jsx(Label, { ...menuScope, ...labelProps, ref: forwardedRef });
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
DropdownMenuLabel.displayName = LABEL_NAME;
|
|
155
|
+
var ITEM_NAME = "DropdownMenuItem";
|
|
156
|
+
var DropdownMenuItem = React.forwardRef(
|
|
157
|
+
(props, forwardedRef) => {
|
|
158
|
+
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
159
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
160
|
+
return /* @__PURE__ */ jsx(Item2$1, { ...menuScope, ...itemProps, ref: forwardedRef });
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
DropdownMenuItem.displayName = ITEM_NAME;
|
|
164
|
+
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
165
|
+
var DropdownMenuCheckboxItem = React.forwardRef((props, forwardedRef) => {
|
|
166
|
+
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
167
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
168
|
+
return /* @__PURE__ */ jsx(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
169
|
+
});
|
|
170
|
+
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
171
|
+
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
172
|
+
var DropdownMenuRadioGroup = React.forwardRef((props, forwardedRef) => {
|
|
173
|
+
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
174
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
175
|
+
return /* @__PURE__ */ jsx(RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
176
|
+
});
|
|
177
|
+
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
178
|
+
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
179
|
+
var DropdownMenuRadioItem = React.forwardRef((props, forwardedRef) => {
|
|
180
|
+
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
181
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
182
|
+
return /* @__PURE__ */ jsx(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
183
|
+
});
|
|
184
|
+
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
185
|
+
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
186
|
+
var DropdownMenuItemIndicator = React.forwardRef((props, forwardedRef) => {
|
|
187
|
+
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
188
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
189
|
+
return /* @__PURE__ */ jsx(ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
190
|
+
});
|
|
191
|
+
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
192
|
+
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
193
|
+
var DropdownMenuSeparator = React.forwardRef((props, forwardedRef) => {
|
|
194
|
+
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
195
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
196
|
+
return /* @__PURE__ */ jsx(Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
197
|
+
});
|
|
198
|
+
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
199
|
+
var ARROW_NAME = "DropdownMenuArrow";
|
|
200
|
+
var DropdownMenuArrow = React.forwardRef(
|
|
201
|
+
(props, forwardedRef) => {
|
|
202
|
+
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
203
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
204
|
+
return /* @__PURE__ */ jsx(Arrow2, { ...menuScope, ...arrowProps, ref: forwardedRef });
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
DropdownMenuArrow.displayName = ARROW_NAME;
|
|
208
|
+
var DropdownMenuSub = (props) => {
|
|
209
|
+
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
210
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
211
|
+
const [open, setOpen] = useControllableState({
|
|
212
|
+
prop: openProp,
|
|
213
|
+
defaultProp: defaultOpen ?? false,
|
|
214
|
+
onChange: onOpenChange,
|
|
215
|
+
caller: "DropdownMenuSub"
|
|
216
|
+
});
|
|
217
|
+
return /* @__PURE__ */ jsx(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
218
|
+
};
|
|
219
|
+
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
220
|
+
var DropdownMenuSubTrigger = React.forwardRef((props, forwardedRef) => {
|
|
221
|
+
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
222
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
223
|
+
return /* @__PURE__ */ jsx(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
224
|
+
});
|
|
225
|
+
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
226
|
+
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
227
|
+
var DropdownMenuSubContent = React.forwardRef((props, forwardedRef) => {
|
|
228
|
+
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
229
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
230
|
+
return /* @__PURE__ */ jsx(
|
|
231
|
+
SubContent,
|
|
232
|
+
{
|
|
233
|
+
...menuScope,
|
|
234
|
+
...subContentProps,
|
|
235
|
+
ref: forwardedRef,
|
|
236
|
+
style: {
|
|
237
|
+
...props.style,
|
|
238
|
+
// re-namespace exposed content custom properties
|
|
239
|
+
...{
|
|
240
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
241
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
242
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
243
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
244
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
);
|
|
249
|
+
});
|
|
250
|
+
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
251
|
+
var Root2 = DropdownMenu;
|
|
252
|
+
var Trigger = DropdownMenuTrigger;
|
|
253
|
+
var Portal2 = DropdownMenuPortal;
|
|
254
|
+
var Content2 = DropdownMenuContent;
|
|
255
|
+
var Group2 = DropdownMenuGroup;
|
|
256
|
+
var Label2 = DropdownMenuLabel;
|
|
257
|
+
var Item2 = DropdownMenuItem;
|
|
258
|
+
var CheckboxItem2 = DropdownMenuCheckboxItem;
|
|
259
|
+
var RadioGroup2 = DropdownMenuRadioGroup;
|
|
260
|
+
var RadioItem2 = DropdownMenuRadioItem;
|
|
261
|
+
var ItemIndicator2 = DropdownMenuItemIndicator;
|
|
262
|
+
var Separator2 = DropdownMenuSeparator;
|
|
263
|
+
var Sub2 = DropdownMenuSub;
|
|
264
|
+
var SubTrigger2 = DropdownMenuSubTrigger;
|
|
265
|
+
var SubContent2 = DropdownMenuSubContent;
|
|
266
|
+
export {
|
|
267
|
+
CheckboxItem2 as CheckboxItem,
|
|
268
|
+
Content2 as Content,
|
|
269
|
+
DropdownMenu,
|
|
270
|
+
DropdownMenuArrow,
|
|
271
|
+
DropdownMenuCheckboxItem,
|
|
272
|
+
DropdownMenuContent,
|
|
273
|
+
DropdownMenuGroup,
|
|
274
|
+
DropdownMenuItem,
|
|
275
|
+
DropdownMenuItemIndicator,
|
|
276
|
+
DropdownMenuLabel,
|
|
277
|
+
DropdownMenuPortal,
|
|
278
|
+
DropdownMenuRadioGroup,
|
|
279
|
+
DropdownMenuRadioItem,
|
|
280
|
+
DropdownMenuSeparator,
|
|
281
|
+
DropdownMenuSub,
|
|
282
|
+
DropdownMenuSubContent,
|
|
283
|
+
DropdownMenuSubTrigger,
|
|
284
|
+
DropdownMenuTrigger,
|
|
285
|
+
Group2 as Group,
|
|
286
|
+
Item2 as Item,
|
|
287
|
+
ItemIndicator2 as ItemIndicator,
|
|
288
|
+
Label2 as Label,
|
|
289
|
+
Portal2 as Portal,
|
|
290
|
+
RadioGroup2 as RadioGroup,
|
|
291
|
+
RadioItem2 as RadioItem,
|
|
292
|
+
Root2 as Root,
|
|
293
|
+
Separator2 as Separator,
|
|
294
|
+
Sub2 as Sub,
|
|
295
|
+
SubContent2 as SubContent,
|
|
296
|
+
SubTrigger2 as SubTrigger,
|
|
297
|
+
Trigger
|
|
298
|
+
};
|
|
299
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/dropdown-menu.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport * as MenuPrimitive from \"@radix-ui/react-menu\";\nimport { createMenuScope } from \"@radix-ui/react-menu\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DROPDOWN_MENU_NAME = \"DropdownMenu\";\nvar [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(\n DROPDOWN_MENU_NAME,\n [createMenuScope]\n);\nvar useMenuScope = createMenuScope();\nvar [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);\nvar DropdownMenu = (props) => {\n const {\n __scopeDropdownMenu,\n children,\n dir,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const triggerRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DROPDOWN_MENU_NAME\n });\n return /* @__PURE__ */ jsx(\n DropdownMenuProvider,\n {\n scope: __scopeDropdownMenu,\n triggerId: useId(),\n triggerRef,\n contentId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children: /* @__PURE__ */ jsx(MenuPrimitive.Root, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })\n }\n );\n};\nDropdownMenu.displayName = DROPDOWN_MENU_NAME;\nvar TRIGGER_NAME = \"DropdownMenuTrigger\";\nvar DropdownMenuTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;\n const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Anchor, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n id: context.triggerId,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.open ? context.contentId : void 0,\n \"data-state\": context.open ? \"open\" : \"closed\",\n \"data-disabled\": disabled ? \"\" : void 0,\n disabled,\n ...triggerProps,\n ref: composeRefs(forwardedRef, context.triggerRef),\n onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n context.onOpenToggle();\n if (!context.open) event.preventDefault();\n }\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (disabled) return;\n if ([\"Enter\", \" \"].includes(event.key)) context.onOpenToggle();\n if (event.key === \"ArrowDown\") context.onOpenChange(true);\n if ([\"Enter\", \" \", \"ArrowDown\"].includes(event.key)) event.preventDefault();\n })\n }\n ) });\n }\n);\nDropdownMenuTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DropdownMenuPortal\";\nvar DropdownMenuPortal = (props) => {\n const { __scopeDropdownMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Portal, { ...menuScope, ...portalProps });\n};\nDropdownMenuPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"DropdownMenuContent\";\nvar DropdownMenuContent = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n MenuPrimitive.Content,\n {\n id: context.contentId,\n \"aria-labelledby\": context.triggerId,\n ...menuScope,\n ...contentProps,\n ref: forwardedRef,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n hasInteractedOutsideRef.current = false;\n event.preventDefault();\n }),\n onInteractOutside: composeEventHandlers(props.onInteractOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;\n }),\n style: {\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-dropdown-menu-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-dropdown-menu-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-dropdown-menu-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-dropdown-menu-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-dropdown-menu-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n );\n }\n);\nDropdownMenuContent.displayName = CONTENT_NAME;\nvar GROUP_NAME = \"DropdownMenuGroup\";\nvar DropdownMenuGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Group, { ...menuScope, ...groupProps, ref: forwardedRef });\n }\n);\nDropdownMenuGroup.displayName = GROUP_NAME;\nvar LABEL_NAME = \"DropdownMenuLabel\";\nvar DropdownMenuLabel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Label, { ...menuScope, ...labelProps, ref: forwardedRef });\n }\n);\nDropdownMenuLabel.displayName = LABEL_NAME;\nvar ITEM_NAME = \"DropdownMenuItem\";\nvar DropdownMenuItem = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Item, { ...menuScope, ...itemProps, ref: forwardedRef });\n }\n);\nDropdownMenuItem.displayName = ITEM_NAME;\nvar CHECKBOX_ITEM_NAME = \"DropdownMenuCheckboxItem\";\nvar DropdownMenuCheckboxItem = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });\n});\nDropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\nvar RADIO_GROUP_NAME = \"DropdownMenuRadioGroup\";\nvar DropdownMenuRadioGroup = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });\n});\nDropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;\nvar RADIO_ITEM_NAME = \"DropdownMenuRadioItem\";\nvar DropdownMenuRadioItem = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });\n});\nDropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;\nvar INDICATOR_NAME = \"DropdownMenuItemIndicator\";\nvar DropdownMenuItemIndicator = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });\n});\nDropdownMenuItemIndicator.displayName = INDICATOR_NAME;\nvar SEPARATOR_NAME = \"DropdownMenuSeparator\";\nvar DropdownMenuSeparator = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });\n});\nDropdownMenuSeparator.displayName = SEPARATOR_NAME;\nvar ARROW_NAME = \"DropdownMenuArrow\";\nvar DropdownMenuArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Arrow, { ...menuScope, ...arrowProps, ref: forwardedRef });\n }\n);\nDropdownMenuArrow.displayName = ARROW_NAME;\nvar DropdownMenuSub = (props) => {\n const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: \"DropdownMenuSub\"\n });\n return /* @__PURE__ */ jsx(MenuPrimitive.Sub, { ...menuScope, open, onOpenChange: setOpen, children });\n};\nvar SUB_TRIGGER_NAME = \"DropdownMenuSubTrigger\";\nvar DropdownMenuSubTrigger = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...subTriggerProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });\n});\nDropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\nvar SUB_CONTENT_NAME = \"DropdownMenuSubContent\";\nvar DropdownMenuSubContent = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(\n MenuPrimitive.SubContent,\n {\n ...menuScope,\n ...subContentProps,\n ref: forwardedRef,\n style: {\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-dropdown-menu-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-dropdown-menu-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-dropdown-menu-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-dropdown-menu-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-dropdown-menu-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n );\n});\nDropdownMenuSubContent.displayName = SUB_CONTENT_NAME;\nvar Root2 = DropdownMenu;\nvar Trigger = DropdownMenuTrigger;\nvar Portal2 = DropdownMenuPortal;\nvar Content2 = DropdownMenuContent;\nvar Group2 = DropdownMenuGroup;\nvar Label2 = DropdownMenuLabel;\nvar Item2 = DropdownMenuItem;\nvar CheckboxItem2 = DropdownMenuCheckboxItem;\nvar RadioGroup2 = DropdownMenuRadioGroup;\nvar RadioItem2 = DropdownMenuRadioItem;\nvar ItemIndicator2 = DropdownMenuItemIndicator;\nvar Separator2 = DropdownMenuSeparator;\nvar Arrow2 = DropdownMenuArrow;\nvar Sub2 = DropdownMenuSub;\nvar SubTrigger2 = DropdownMenuSubTrigger;\nvar SubContent2 = DropdownMenuSubContent;\nexport {\n Arrow2 as Arrow,\n CheckboxItem2 as CheckboxItem,\n Content2 as Content,\n DropdownMenu,\n DropdownMenuArrow,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuItemIndicator,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n Group2 as Group,\n Item2 as Item,\n ItemIndicator2 as ItemIndicator,\n Label2 as Label,\n Portal2 as Portal,\n RadioGroup2 as RadioGroup,\n RadioItem2 as RadioItem,\n Root2 as Root,\n Separator2 as Separator,\n Sub2 as Sub,\n SubContent2 as SubContent,\n SubTrigger2 as SubTrigger,\n Trigger,\n createDropdownMenuScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["MenuPrimitive.Root","MenuPrimitive.Anchor","MenuPrimitive.Portal","MenuPrimitive.Content","MenuPrimitive.Group","MenuPrimitive.Label","MenuPrimitive.Item","MenuPrimitive.CheckboxItem","MenuPrimitive.RadioGroup","MenuPrimitive.RadioItem","MenuPrimitive.ItemIndicator","MenuPrimitive.Separator","MenuPrimitive.Arrow","MenuPrimitive.Sub","MenuPrimitive.SubTrigger","MenuPrimitive.SubContent"],"mappings":";;;;;;;;;AAaA,IAAI,qBAAqB;AACzB,IAAI,CAAC,yBAAkD,IAAI;AAAA,EACzD;AAAA,EACA,CAAC,eAAe;AAClB;AACA,IAAI,eAAe,gBAAe;AAClC,IAAI,CAAC,sBAAsB,sBAAsB,IAAI,0BAA0B,kBAAkB;AAC9F,IAAC,eAAe,CAAC,UAAU;AAC5B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACZ,IAAM;AACJ,QAAM,YAAY,aAAa,mBAAmB;AAClD,QAAM,aAAa,MAAM,OAAO,IAAI;AACpC,QAAM,CAAC,MAAM,OAAO,IAAI,qBAAqB;AAAA,IAC3C,MAAM;AAAA,IACN,aAAa,eAAe;AAAA,IAC5B,UAAU;AAAA,IACV,QAAQ;AAAA,EACZ,CAAG;AACD,SAAuB;AAAA,IACrB;AAA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BAAuB,cAAc;AAClC,IAAC,QAAQ;AACT,IAAC,UAAU;AACX,IAAC,UAAU;AACX,IAAC,WAAW;AACZ,IAAC,SAAS;AACV,IAAC,SAAS;AACV,IAAC,QAAQ;AACT,IAAC,gBAAgB;AACjB,IAAC,cAAc;AACf,IAAC,aAAa;AACd,IAAC,iBAAiB;AAClB,IAAC,aAAa;AAEd,IAAC,OAAO;AACR,IAAC,cAAc;AACf,IAAC,cAAc;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
var count = 0;
|
|
3
|
+
function useFocusGuards() {
|
|
4
|
+
React.useEffect(() => {
|
|
5
|
+
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
6
|
+
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
7
|
+
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
8
|
+
count++;
|
|
9
|
+
return () => {
|
|
10
|
+
if (count === 1) {
|
|
11
|
+
document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
|
|
12
|
+
}
|
|
13
|
+
count--;
|
|
14
|
+
};
|
|
15
|
+
}, []);
|
|
16
|
+
}
|
|
17
|
+
function createFocusGuard() {
|
|
18
|
+
const element = document.createElement("span");
|
|
19
|
+
element.setAttribute("data-radix-focus-guard", "");
|
|
20
|
+
element.tabIndex = 0;
|
|
21
|
+
element.style.outline = "none";
|
|
22
|
+
element.style.opacity = "0";
|
|
23
|
+
element.style.position = "fixed";
|
|
24
|
+
element.style.pointerEvents = "none";
|
|
25
|
+
return element;
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
useFocusGuards
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/@radix-ui/react-focus-guards/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/focus-guards.tsx\nimport * as React from \"react\";\nvar count = 0;\nfunction FocusGuards(props) {\n useFocusGuards();\n return props.children;\n}\nfunction useFocusGuards() {\n React.useEffect(() => {\n const edgeGuards = document.querySelectorAll(\"[data-radix-focus-guard]\");\n document.body.insertAdjacentElement(\"afterbegin\", edgeGuards[0] ?? createFocusGuard());\n document.body.insertAdjacentElement(\"beforeend\", edgeGuards[1] ?? createFocusGuard());\n count++;\n return () => {\n if (count === 1) {\n document.querySelectorAll(\"[data-radix-focus-guard]\").forEach((node) => node.remove());\n }\n count--;\n };\n }, []);\n}\nfunction createFocusGuard() {\n const element = document.createElement(\"span\");\n element.setAttribute(\"data-radix-focus-guard\", \"\");\n element.tabIndex = 0;\n element.style.outline = \"none\";\n element.style.opacity = \"0\";\n element.style.position = \"fixed\";\n element.style.pointerEvents = \"none\";\n return element;\n}\nexport {\n FocusGuards,\n FocusGuards as Root,\n useFocusGuards\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";AAIA,IAAI,QAAQ;AAKZ,SAAS,iBAAiB;AACxB,QAAM,UAAU,MAAM;AACpB,UAAM,aAAa,SAAS,iBAAiB,0BAA0B;AACvE,aAAS,KAAK,sBAAsB,cAAc,WAAW,CAAC,KAAK,kBAAkB;AACrF,aAAS,KAAK,sBAAsB,aAAa,WAAW,CAAC,KAAK,kBAAkB;AACpF;AACA,WAAO,MAAM;AACX,UAAI,UAAU,GAAG;AACf,iBAAS,iBAAiB,0BAA0B,EAAE,QAAQ,CAAC,SAAS,KAAK,QAAQ;AAAA,MACvF;AACA;AAAA,IACF;AAAA,EACF,GAAG,CAAA,CAAE;AACP;AACA,SAAS,mBAAmB;AAC1B,QAAM,UAAU,SAAS,cAAc,MAAM;AAC7C,UAAQ,aAAa,0BAA0B,EAAE;AACjD,UAAQ,WAAW;AACnB,UAAQ,MAAM,UAAU;AACxB,UAAQ,MAAM,UAAU;AACxB,UAAQ,MAAM,WAAW;AACzB,UAAQ,MAAM,gBAAgB;AAC9B,SAAO;AACT;","x_google_ignoreList":[0]}
|