@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,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as ReactDOM from "react-dom";
|
|
3
|
+
import { createSlot } from "../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var NODES = [
|
|
6
|
+
"a",
|
|
7
|
+
"button",
|
|
8
|
+
"div",
|
|
9
|
+
"form",
|
|
10
|
+
"h2",
|
|
11
|
+
"h3",
|
|
12
|
+
"img",
|
|
13
|
+
"input",
|
|
14
|
+
"label",
|
|
15
|
+
"li",
|
|
16
|
+
"nav",
|
|
17
|
+
"ol",
|
|
18
|
+
"p",
|
|
19
|
+
"select",
|
|
20
|
+
"span",
|
|
21
|
+
"svg",
|
|
22
|
+
"ul"
|
|
23
|
+
];
|
|
24
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
25
|
+
const Slot = createSlot(`Primitive.${node}`);
|
|
26
|
+
const Node = React.forwardRef((props, forwardedRef) => {
|
|
27
|
+
const { asChild, ...primitiveProps } = props;
|
|
28
|
+
const Comp = asChild ? Slot : node;
|
|
29
|
+
if (typeof window !== "undefined") {
|
|
30
|
+
window[Symbol.for("radix-ui")] = true;
|
|
31
|
+
}
|
|
32
|
+
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
33
|
+
});
|
|
34
|
+
Node.displayName = `Primitive.${node}`;
|
|
35
|
+
return { ...primitive, [node]: Node };
|
|
36
|
+
}, {});
|
|
37
|
+
function dispatchDiscreteCustomEvent(target, event) {
|
|
38
|
+
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
Primitive,
|
|
42
|
+
dispatchDiscreteCustomEvent
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/@radix-ui/react-primitive/dist/index.mjs"],"sourcesContent":["// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;;AAKA,IAAI,QAAQ;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACG,IAAC,YAAY,MAAM,OAAO,CAAC,WAAW,SAAS;AAChD,QAAM,OAAO,WAAW,aAAa,IAAI,EAAE;AAC3C,QAAM,OAAO,MAAM,WAAW,CAAC,OAAO,iBAAiB;AACrD,UAAM,EAAE,SAAS,GAAG,eAAc,IAAK;AACvC,UAAM,OAAO,UAAU,OAAO;AAC9B,QAAI,OAAO,WAAW,aAAa;AACjC,aAAO,OAAO,IAAI,UAAU,CAAC,IAAI;AAAA,IACnC;AACA,WAAuB,oBAAI,MAAM,EAAE,GAAG,gBAAgB,KAAK,cAAc;AAAA,EAC3E,CAAC;AACD,OAAK,cAAc,aAAa,IAAI;AACpC,SAAO,EAAE,GAAG,WAAW,CAAC,IAAI,GAAG,KAAI;AACrC,GAAG,CAAA,CAAE;AACL,SAAS,4BAA4B,QAAQ,OAAO;AAClD,MAAI,OAAQ,UAAS,UAAU,MAAM,OAAO,cAAc,KAAK,CAAC;AAClE;","x_google_ignoreList":[0]}
|
package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { composeRefs } from "../../../../../react-compose-refs/dist/index.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
// @__NO_SIDE_EFFECTS__
|
|
5
|
+
function createSlot(ownerName) {
|
|
6
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
7
|
+
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
|
8
|
+
const { children, ...slotProps } = props;
|
|
9
|
+
const childrenArray = React.Children.toArray(children);
|
|
10
|
+
const slottable = childrenArray.find(isSlottable);
|
|
11
|
+
if (slottable) {
|
|
12
|
+
const newElement = slottable.props.children;
|
|
13
|
+
const newChildren = childrenArray.map((child) => {
|
|
14
|
+
if (child === slottable) {
|
|
15
|
+
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
16
|
+
return React.isValidElement(newElement) ? newElement.props.children : null;
|
|
17
|
+
} else {
|
|
18
|
+
return child;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
|
22
|
+
}
|
|
23
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
24
|
+
});
|
|
25
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
26
|
+
return Slot2;
|
|
27
|
+
}
|
|
28
|
+
// @__NO_SIDE_EFFECTS__
|
|
29
|
+
function createSlotClone(ownerName) {
|
|
30
|
+
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
31
|
+
const { children, ...slotProps } = props;
|
|
32
|
+
if (React.isValidElement(children)) {
|
|
33
|
+
const childrenRef = getElementRef(children);
|
|
34
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
35
|
+
if (children.type !== React.Fragment) {
|
|
36
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
37
|
+
}
|
|
38
|
+
return React.cloneElement(children, props2);
|
|
39
|
+
}
|
|
40
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
41
|
+
});
|
|
42
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
43
|
+
return SlotClone;
|
|
44
|
+
}
|
|
45
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
46
|
+
function isSlottable(child) {
|
|
47
|
+
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
48
|
+
}
|
|
49
|
+
function mergeProps(slotProps, childProps) {
|
|
50
|
+
const overrideProps = { ...childProps };
|
|
51
|
+
for (const propName in childProps) {
|
|
52
|
+
const slotPropValue = slotProps[propName];
|
|
53
|
+
const childPropValue = childProps[propName];
|
|
54
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
55
|
+
if (isHandler) {
|
|
56
|
+
if (slotPropValue && childPropValue) {
|
|
57
|
+
overrideProps[propName] = (...args) => {
|
|
58
|
+
const result = childPropValue(...args);
|
|
59
|
+
slotPropValue(...args);
|
|
60
|
+
return result;
|
|
61
|
+
};
|
|
62
|
+
} else if (slotPropValue) {
|
|
63
|
+
overrideProps[propName] = slotPropValue;
|
|
64
|
+
}
|
|
65
|
+
} else if (propName === "style") {
|
|
66
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
67
|
+
} else if (propName === "className") {
|
|
68
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return { ...slotProps, ...overrideProps };
|
|
72
|
+
}
|
|
73
|
+
function getElementRef(element) {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
76
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
77
|
+
if (mayWarn) {
|
|
78
|
+
return element.ref;
|
|
79
|
+
}
|
|
80
|
+
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
81
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
82
|
+
if (mayWarn) {
|
|
83
|
+
return element.props.ref;
|
|
84
|
+
}
|
|
85
|
+
return element.props.ref || element.ref;
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
createSlot
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.mjs"],"sourcesContent":["// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;;AAKA,SAAS,WAAW,WAAW;AAC7B,QAAM,YAA4B,gCAAgB,SAAS;AAC3D,QAAM,QAAQ,MAAM,WAAW,CAAC,OAAO,iBAAiB;AACtD,UAAM,EAAE,UAAU,GAAG,UAAS,IAAK;AACnC,UAAM,gBAAgB,MAAM,SAAS,QAAQ,QAAQ;AACrD,UAAM,YAAY,cAAc,KAAK,WAAW;AAChD,QAAI,WAAW;AACb,YAAM,aAAa,UAAU,MAAM;AACnC,YAAM,cAAc,cAAc,IAAI,CAAC,UAAU;AAC/C,YAAI,UAAU,WAAW;AACvB,cAAI,MAAM,SAAS,MAAM,UAAU,IAAI,EAAG,QAAO,MAAM,SAAS,KAAK,IAAI;AACzE,iBAAO,MAAM,eAAe,UAAU,IAAI,WAAW,MAAM,WAAW;AAAA,QACxE,OAAO;AACL,iBAAO;AAAA,QACT;AAAA,MACF,CAAC;AACD,aAAuB,oBAAI,WAAW,EAAE,GAAG,WAAW,KAAK,cAAc,UAAU,MAAM,eAAe,UAAU,IAAI,MAAM,aAAa,YAAY,QAAQ,WAAW,IAAI,MAAM;AAAA,IACpL;AACA,WAAuB,oBAAI,WAAW,EAAE,GAAG,WAAW,KAAK,cAAc,UAAU;AAAA,EACrF,CAAC;AACD,QAAM,cAAc,GAAG,SAAS;AAChC,SAAO;AACT;AAAA;AAGA,SAAS,gBAAgB,WAAW;AAClC,QAAM,YAAY,MAAM,WAAW,CAAC,OAAO,iBAAiB;AAC1D,UAAM,EAAE,UAAU,GAAG,UAAS,IAAK;AACnC,QAAI,MAAM,eAAe,QAAQ,GAAG;AAClC,YAAM,cAAc,cAAc,QAAQ;AAC1C,YAAM,SAAS,WAAW,WAAW,SAAS,KAAK;AACnD,UAAI,SAAS,SAAS,MAAM,UAAU;AACpC,eAAO,MAAM,eAAe,YAAY,cAAc,WAAW,IAAI;AAAA,MACvE;AACA,aAAO,MAAM,aAAa,UAAU,MAAM;AAAA,IAC5C;AACA,WAAO,MAAM,SAAS,MAAM,QAAQ,IAAI,IAAI,MAAM,SAAS,KAAK,IAAI,IAAI;AAAA,EAC1E,CAAC;AACD,YAAU,cAAc,GAAG,SAAS;AACpC,SAAO;AACT;AACA,IAAI,uBAAuB,OAAO,iBAAiB;AAWnD,SAAS,YAAY,OAAO;AAC1B,SAAO,MAAM,eAAe,KAAK,KAAK,OAAO,MAAM,SAAS,cAAc,eAAe,MAAM,QAAQ,MAAM,KAAK,cAAc;AAClI;AACA,SAAS,WAAW,WAAW,YAAY;AACzC,QAAM,gBAAgB,EAAE,GAAG,WAAU;AACrC,aAAW,YAAY,YAAY;AACjC,UAAM,gBAAgB,UAAU,QAAQ;AACxC,UAAM,iBAAiB,WAAW,QAAQ;AAC1C,UAAM,YAAY,WAAW,KAAK,QAAQ;AAC1C,QAAI,WAAW;AACb,UAAI,iBAAiB,gBAAgB;AACnC,sBAAc,QAAQ,IAAI,IAAI,SAAS;AACrC,gBAAM,SAAS,eAAe,GAAG,IAAI;AACrC,wBAAc,GAAG,IAAI;AACrB,iBAAO;AAAA,QACT;AAAA,MACF,WAAW,eAAe;AACxB,sBAAc,QAAQ,IAAI;AAAA,MAC5B;AAAA,IACF,WAAW,aAAa,SAAS;AAC/B,oBAAc,QAAQ,IAAI,EAAE,GAAG,eAAe,GAAG,eAAc;AAAA,IACjE,WAAW,aAAa,aAAa;AACnC,oBAAc,QAAQ,IAAI,CAAC,eAAe,cAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IACpF;AAAA,EACF;AACA,SAAO,EAAE,GAAG,WAAW,GAAG,cAAa;AACzC;AACA,SAAS,cAAc,SAAS;;AAC9B,MAAI,UAAS,YAAO,yBAAyB,QAAQ,OAAO,KAAK,MAApD,mBAAuD;AACpE,MAAI,UAAU,UAAU,oBAAoB,UAAU,OAAO;AAC7D,MAAI,SAAS;AACX,WAAO,QAAQ;AAAA,EACjB;AACA,YAAS,YAAO,yBAAyB,SAAS,KAAK,MAA9C,mBAAiD;AAC1D,YAAU,UAAU,oBAAoB,UAAU,OAAO;AACzD,MAAI,SAAS;AACX,WAAO,QAAQ,MAAM;AAAA,EACvB;AACA,SAAO,QAAQ,MAAM,OAAO,QAAQ;AACtC;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { createContextScope } from "../node_modules/@radix-ui/react-context/dist/index.js";
|
|
3
|
+
import { Primitive } from "../node_modules/@radix-ui/react-primitive/dist/index.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var PROGRESS_NAME = "Progress";
|
|
6
|
+
var DEFAULT_MAX = 100;
|
|
7
|
+
var [createProgressContext] = createContextScope(PROGRESS_NAME);
|
|
8
|
+
var [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);
|
|
9
|
+
var Progress = React.forwardRef(
|
|
10
|
+
(props, forwardedRef) => {
|
|
11
|
+
const {
|
|
12
|
+
__scopeProgress,
|
|
13
|
+
value: valueProp = null,
|
|
14
|
+
max: maxProp,
|
|
15
|
+
getValueLabel = defaultGetValueLabel,
|
|
16
|
+
...progressProps
|
|
17
|
+
} = props;
|
|
18
|
+
if ((maxProp || maxProp === 0) && !isValidMaxNumber(maxProp)) {
|
|
19
|
+
console.error(getInvalidMaxError(`${maxProp}`, "Progress"));
|
|
20
|
+
}
|
|
21
|
+
const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;
|
|
22
|
+
if (valueProp !== null && !isValidValueNumber(valueProp, max)) {
|
|
23
|
+
console.error(getInvalidValueError(`${valueProp}`, "Progress"));
|
|
24
|
+
}
|
|
25
|
+
const value = isValidValueNumber(valueProp, max) ? valueProp : null;
|
|
26
|
+
const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;
|
|
27
|
+
return /* @__PURE__ */ jsx(ProgressProvider, { scope: __scopeProgress, value, max, children: /* @__PURE__ */ jsx(
|
|
28
|
+
Primitive.div,
|
|
29
|
+
{
|
|
30
|
+
"aria-valuemax": max,
|
|
31
|
+
"aria-valuemin": 0,
|
|
32
|
+
"aria-valuenow": isNumber(value) ? value : void 0,
|
|
33
|
+
"aria-valuetext": valueLabel,
|
|
34
|
+
role: "progressbar",
|
|
35
|
+
"data-state": getProgressState(value, max),
|
|
36
|
+
"data-value": value ?? void 0,
|
|
37
|
+
"data-max": max,
|
|
38
|
+
...progressProps,
|
|
39
|
+
ref: forwardedRef
|
|
40
|
+
}
|
|
41
|
+
) });
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
Progress.displayName = PROGRESS_NAME;
|
|
45
|
+
var INDICATOR_NAME = "ProgressIndicator";
|
|
46
|
+
var ProgressIndicator = React.forwardRef(
|
|
47
|
+
(props, forwardedRef) => {
|
|
48
|
+
const { __scopeProgress, ...indicatorProps } = props;
|
|
49
|
+
const context = useProgressContext(INDICATOR_NAME, __scopeProgress);
|
|
50
|
+
return /* @__PURE__ */ jsx(
|
|
51
|
+
Primitive.div,
|
|
52
|
+
{
|
|
53
|
+
"data-state": getProgressState(context.value, context.max),
|
|
54
|
+
"data-value": context.value ?? void 0,
|
|
55
|
+
"data-max": context.max,
|
|
56
|
+
...indicatorProps,
|
|
57
|
+
ref: forwardedRef
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
ProgressIndicator.displayName = INDICATOR_NAME;
|
|
63
|
+
function defaultGetValueLabel(value, max) {
|
|
64
|
+
return `${Math.round(value / max * 100)}%`;
|
|
65
|
+
}
|
|
66
|
+
function getProgressState(value, maxValue) {
|
|
67
|
+
return value == null ? "indeterminate" : value === maxValue ? "complete" : "loading";
|
|
68
|
+
}
|
|
69
|
+
function isNumber(value) {
|
|
70
|
+
return typeof value === "number";
|
|
71
|
+
}
|
|
72
|
+
function isValidMaxNumber(max) {
|
|
73
|
+
return isNumber(max) && !isNaN(max) && max > 0;
|
|
74
|
+
}
|
|
75
|
+
function isValidValueNumber(value, max) {
|
|
76
|
+
return isNumber(value) && !isNaN(value) && value <= max && value >= 0;
|
|
77
|
+
}
|
|
78
|
+
function getInvalidMaxError(propValue, componentName) {
|
|
79
|
+
return `Invalid prop \`max\` of value \`${propValue}\` supplied to \`${componentName}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${DEFAULT_MAX}\`.`;
|
|
80
|
+
}
|
|
81
|
+
function getInvalidValueError(propValue, componentName) {
|
|
82
|
+
return `Invalid prop \`value\` of value \`${propValue}\` supplied to \`${componentName}\`. The \`value\` prop must be:
|
|
83
|
+
- a positive number
|
|
84
|
+
- less than the value passed to \`max\` (or ${DEFAULT_MAX} if no \`max\` prop is set)
|
|
85
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
86
|
+
|
|
87
|
+
Defaulting to \`null\`.`;
|
|
88
|
+
}
|
|
89
|
+
var Root = Progress;
|
|
90
|
+
var Indicator = ProgressIndicator;
|
|
91
|
+
export {
|
|
92
|
+
Indicator,
|
|
93
|
+
Progress,
|
|
94
|
+
ProgressIndicator,
|
|
95
|
+
Root
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/@radix-ui/react-progress/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/progress.tsx\nimport * as React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar PROGRESS_NAME = \"Progress\";\nvar DEFAULT_MAX = 100;\nvar [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\nvar [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);\nvar Progress = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp = null,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n ...progressProps\n } = props;\n if ((maxProp || maxProp === 0) && !isValidMaxNumber(maxProp)) {\n console.error(getInvalidMaxError(`${maxProp}`, \"Progress\"));\n }\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n if (valueProp !== null && !isValidValueNumber(valueProp, max)) {\n console.error(getInvalidValueError(`${valueProp}`, \"Progress\"));\n }\n const value = isValidValueNumber(valueProp, max) ? valueProp : null;\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;\n return /* @__PURE__ */ jsx(ProgressProvider, { scope: __scopeProgress, value, max, children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": isNumber(value) ? value : void 0,\n \"aria-valuetext\": valueLabel,\n role: \"progressbar\",\n \"data-state\": getProgressState(value, max),\n \"data-value\": value ?? void 0,\n \"data-max\": max,\n ...progressProps,\n ref: forwardedRef\n }\n ) });\n }\n);\nProgress.displayName = PROGRESS_NAME;\nvar INDICATOR_NAME = \"ProgressIndicator\";\nvar ProgressIndicator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props;\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getProgressState(context.value, context.max),\n \"data-value\": context.value ?? void 0,\n \"data-max\": context.max,\n ...indicatorProps,\n ref: forwardedRef\n }\n );\n }\n);\nProgressIndicator.displayName = INDICATOR_NAME;\nfunction defaultGetValueLabel(value, max) {\n return `${Math.round(value / max * 100)}%`;\n}\nfunction getProgressState(value, maxValue) {\n return value == null ? \"indeterminate\" : value === maxValue ? \"complete\" : \"loading\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isValidMaxNumber(max) {\n return isNumber(max) && !isNaN(max) && max > 0;\n}\nfunction isValidValueNumber(value, max) {\n return isNumber(value) && !isNaN(value) && value <= max && value >= 0;\n}\nfunction getInvalidMaxError(propValue, componentName) {\n return `Invalid prop \\`max\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. Only numbers greater than 0 are valid max values. Defaulting to \\`${DEFAULT_MAX}\\`.`;\n}\nfunction getInvalidValueError(propValue, componentName) {\n return `Invalid prop \\`value\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. The \\`value\\` prop must be:\n - a positive number\n - less than the value passed to \\`max\\` (or ${DEFAULT_MAX} if no \\`max\\` prop is set)\n - \\`null\\` or \\`undefined\\` if the progress is indeterminate.\n\nDefaulting to \\`null\\`.`;\n}\nvar Root = Progress;\nvar Indicator = ProgressIndicator;\nexport {\n Indicator,\n Progress,\n ProgressIndicator,\n Root,\n createProgressScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;;AAOA,IAAI,gBAAgB;AACpB,IAAI,cAAc;AAClB,IAAI,CAAC,qBAA0C,IAAI,mBAAmB,aAAa;AACnF,IAAI,CAAC,kBAAkB,kBAAkB,IAAI,sBAAsB,aAAa;AAC7E,IAAC,WAAW,MAAM;AAAA,EACnB,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ;AAAA,MACA,OAAO,YAAY;AAAA,MACnB,KAAK;AAAA,MACL,gBAAgB;AAAA,MAChB,GAAG;AAAA,IACT,IAAQ;AACJ,SAAK,WAAW,YAAY,MAAM,CAAC,iBAAiB,OAAO,GAAG;AAC5D,cAAQ,MAAM,mBAAmB,GAAG,OAAO,IAAI,UAAU,CAAC;AAAA,IAC5D;AACA,UAAM,MAAM,iBAAiB,OAAO,IAAI,UAAU;AAClD,QAAI,cAAc,QAAQ,CAAC,mBAAmB,WAAW,GAAG,GAAG;AAC7D,cAAQ,MAAM,qBAAqB,GAAG,SAAS,IAAI,UAAU,CAAC;AAAA,IAChE;AACA,UAAM,QAAQ,mBAAmB,WAAW,GAAG,IAAI,YAAY;AAC/D,UAAM,aAAa,SAAS,KAAK,IAAI,cAAc,OAAO,GAAG,IAAI;AACjE,WAAuB,oBAAI,kBAAkB,EAAE,OAAO,iBAAiB,OAAO,KAAK,UAA0B;AAAA,MAC3G,UAAU;AAAA,MACV;AAAA,QACE,iBAAiB;AAAA,QACjB,iBAAiB;AAAA,QACjB,iBAAiB,SAAS,KAAK,IAAI,QAAQ;AAAA,QAC3C,kBAAkB;AAAA,QAClB,MAAM;AAAA,QACN,cAAc,iBAAiB,OAAO,GAAG;AAAA,QACzC,cAAc,SAAS;AAAA,QACvB,YAAY;AAAA,QACZ,GAAG;AAAA,QACH,KAAK;AAAA,MACb;AAAA,IACA,GAAO;AAAA,EACL;AACF;AACA,SAAS,cAAc;AACvB,IAAI,iBAAiB;AAClB,IAAC,oBAAoB,MAAM;AAAA,EAC5B,CAAC,OAAO,iBAAiB;AACvB,UAAM,EAAE,iBAAiB,GAAG,eAAc,IAAK;AAC/C,UAAM,UAAU,mBAAmB,gBAAgB,eAAe;AAClE,WAAuB;AAAA,MACrB,UAAU;AAAA,MACV;AAAA,QACE,cAAc,iBAAiB,QAAQ,OAAO,QAAQ,GAAG;AAAA,QACzD,cAAc,QAAQ,SAAS;AAAA,QAC/B,YAAY,QAAQ;AAAA,QACpB,GAAG;AAAA,QACH,KAAK;AAAA,MACb;AAAA,IACA;AAAA,EACE;AACF;AACA,kBAAkB,cAAc;AAChC,SAAS,qBAAqB,OAAO,KAAK;AACxC,SAAO,GAAG,KAAK,MAAM,QAAQ,MAAM,GAAG,CAAC;AACzC;AACA,SAAS,iBAAiB,OAAO,UAAU;AACzC,SAAO,SAAS,OAAO,kBAAkB,UAAU,WAAW,aAAa;AAC7E;AACA,SAAS,SAAS,OAAO;AACvB,SAAO,OAAO,UAAU;AAC1B;AACA,SAAS,iBAAiB,KAAK;AAC7B,SAAO,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,KAAK,MAAM;AAC/C;AACA,SAAS,mBAAmB,OAAO,KAAK;AACtC,SAAO,SAAS,KAAK,KAAK,CAAC,MAAM,KAAK,KAAK,SAAS,OAAO,SAAS;AACtE;AACA,SAAS,mBAAmB,WAAW,eAAe;AACpD,SAAO,mCAAmC,SAAS,oBAAoB,aAAa,yEAAyE,WAAW;AAC1K;AACA,SAAS,qBAAqB,WAAW,eAAe;AACtD,SAAO,qCAAqC,SAAS,oBAAoB,aAAa;AAAA;AAAA,gDAExC,WAAW;AAAA;AAAA;AAAA;AAI3D;AACG,IAAC,OAAO;AACR,IAAC,YAAY;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
4
|
+
let defaultContexts = [];
|
|
5
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
6
|
+
const BaseContext = React.createContext(defaultContext);
|
|
7
|
+
BaseContext.displayName = rootComponentName + "Context";
|
|
8
|
+
const index = defaultContexts.length;
|
|
9
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
10
|
+
const Provider = (props) => {
|
|
11
|
+
var _a;
|
|
12
|
+
const { scope, children, ...context } = props;
|
|
13
|
+
const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext;
|
|
14
|
+
const value = React.useMemo(() => context, Object.values(context));
|
|
15
|
+
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
16
|
+
};
|
|
17
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
18
|
+
function useContext2(consumerName, scope) {
|
|
19
|
+
var _a;
|
|
20
|
+
const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext;
|
|
21
|
+
const context = React.useContext(Context);
|
|
22
|
+
if (context) return context;
|
|
23
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
24
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
25
|
+
}
|
|
26
|
+
return [Provider, useContext2];
|
|
27
|
+
}
|
|
28
|
+
const createScope = () => {
|
|
29
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
30
|
+
return React.createContext(defaultContext);
|
|
31
|
+
});
|
|
32
|
+
return function useScope(scope) {
|
|
33
|
+
const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
|
|
34
|
+
return React.useMemo(
|
|
35
|
+
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
36
|
+
[scope, contexts]
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
createScope.scopeName = scopeName;
|
|
41
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
42
|
+
}
|
|
43
|
+
function composeContextScopes(...scopes) {
|
|
44
|
+
const baseScope = scopes[0];
|
|
45
|
+
if (scopes.length === 1) return baseScope;
|
|
46
|
+
const createScope = () => {
|
|
47
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
48
|
+
useScope: createScope2(),
|
|
49
|
+
scopeName: createScope2.scopeName
|
|
50
|
+
}));
|
|
51
|
+
return function useComposedScopes(overrideScopes) {
|
|
52
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
53
|
+
const scopeProps = useScope(overrideScopes);
|
|
54
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
55
|
+
return { ...nextScopes2, ...currentScope };
|
|
56
|
+
}, {});
|
|
57
|
+
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
createScope.scopeName = baseScope.scopeName;
|
|
61
|
+
return createScope;
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
createContextScope
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-context/dist/index.mjs"],"sourcesContent":["// src/create-context.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n Context.displayName = rootComponentName + \"Context\";\n const Provider = (props) => {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n}\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n BaseContext.displayName = rootComponentName + \"Context\";\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n const Provider = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, scope) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n }\n const createScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = () => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;AAoBA,SAAS,mBAAmB,WAAW,yBAAyB,IAAI;AAClE,MAAI,kBAAkB,CAAA;AACtB,WAAS,eAAe,mBAAmB,gBAAgB;AACzD,UAAM,cAAc,MAAM,cAAc,cAAc;AACtD,gBAAY,cAAc,oBAAoB;AAC9C,UAAM,QAAQ,gBAAgB;AAC9B,sBAAkB,CAAC,GAAG,iBAAiB,cAAc;AACrD,UAAM,WAAW,CAAC,UAAU;;AAC1B,YAAM,EAAE,OAAO,UAAU,GAAG,QAAO,IAAK;AACxC,YAAM,YAAU,oCAAQ,eAAR,mBAAqB,WAAU;AAC/C,YAAM,QAAQ,MAAM,QAAQ,MAAM,SAAS,OAAO,OAAO,OAAO,CAAC;AACjE,aAAuB,oBAAI,QAAQ,UAAU,EAAE,OAAO,SAAQ,CAAE;AAAA,IAClE;AACA,aAAS,cAAc,oBAAoB;AAC3C,aAAS,YAAY,cAAc,OAAO;;AACxC,YAAM,YAAU,oCAAQ,eAAR,mBAAqB,WAAU;AAC/C,YAAM,UAAU,MAAM,WAAW,OAAO;AACxC,UAAI,QAAS,QAAO;AACpB,UAAI,mBAAmB,OAAQ,QAAO;AACtC,YAAM,IAAI,MAAM,KAAK,YAAY,4BAA4B,iBAAiB,IAAI;AAAA,IACpF;AACA,WAAO,CAAC,UAAU,WAAW;AAAA,EAC/B;AACA,QAAM,cAAc,MAAM;AACxB,UAAM,gBAAgB,gBAAgB,IAAI,CAAC,mBAAmB;AAC5D,aAAO,MAAM,cAAc,cAAc;AAAA,IAC3C,CAAC;AACD,WAAO,SAAS,SAAS,OAAO;AAC9B,YAAM,YAAW,+BAAQ,eAAc;AACvC,aAAO,MAAM;AAAA,QACX,OAAO,EAAE,CAAC,UAAU,SAAS,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,SAAS,GAAG,SAAQ;QACnE,CAAC,OAAO,QAAQ;AAAA,MACxB;AAAA,IACI;AAAA,EACF;AACA,cAAY,YAAY;AACxB,SAAO,CAAC,gBAAgB,qBAAqB,aAAa,GAAG,sBAAsB,CAAC;AACtF;AACA,SAAS,wBAAwB,QAAQ;AACvC,QAAM,YAAY,OAAO,CAAC;AAC1B,MAAI,OAAO,WAAW,EAAG,QAAO;AAChC,QAAM,cAAc,MAAM;AACxB,UAAM,aAAa,OAAO,IAAI,CAAC,kBAAkB;AAAA,MAC/C,UAAU,aAAY;AAAA,MACtB,WAAW,aAAa;AAAA,IAC9B,EAAM;AACF,WAAO,SAAS,kBAAkB,gBAAgB;AAChD,YAAM,aAAa,WAAW,OAAO,CAAC,aAAa,EAAE,UAAU,gBAAgB;AAC7E,cAAM,aAAa,SAAS,cAAc;AAC1C,cAAM,eAAe,WAAW,UAAU,SAAS,EAAE;AACrD,eAAO,EAAE,GAAG,aAAa,GAAG,aAAY;AAAA,MAC1C,GAAG,CAAA,CAAE;AACL,aAAO,MAAM,QAAQ,OAAO,EAAE,CAAC,UAAU,UAAU,SAAS,EAAE,GAAG,WAAU,IAAK,CAAC,UAAU,CAAC;AAAA,IAC9F;AAAA,EACF;AACA,cAAY,YAAY,UAAU;AAClC,SAAO;AACT;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import "react-dom";
|
|
3
|
+
import { createSlot } from "../../../../../react-slot/dist/index.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var NODES = [
|
|
6
|
+
"a",
|
|
7
|
+
"button",
|
|
8
|
+
"div",
|
|
9
|
+
"form",
|
|
10
|
+
"h2",
|
|
11
|
+
"h3",
|
|
12
|
+
"img",
|
|
13
|
+
"input",
|
|
14
|
+
"label",
|
|
15
|
+
"li",
|
|
16
|
+
"nav",
|
|
17
|
+
"ol",
|
|
18
|
+
"p",
|
|
19
|
+
"select",
|
|
20
|
+
"span",
|
|
21
|
+
"svg",
|
|
22
|
+
"ul"
|
|
23
|
+
];
|
|
24
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
25
|
+
const Slot = createSlot(`Primitive.${node}`);
|
|
26
|
+
const Node = React.forwardRef((props, forwardedRef) => {
|
|
27
|
+
const { asChild, ...primitiveProps } = props;
|
|
28
|
+
const Comp = asChild ? Slot : node;
|
|
29
|
+
if (typeof window !== "undefined") {
|
|
30
|
+
window[Symbol.for("radix-ui")] = true;
|
|
31
|
+
}
|
|
32
|
+
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
33
|
+
});
|
|
34
|
+
Node.displayName = `Primitive.${node}`;
|
|
35
|
+
return { ...primitive, [node]: Node };
|
|
36
|
+
}, {});
|
|
37
|
+
export {
|
|
38
|
+
Primitive
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-primitive/dist/index.mjs"],"sourcesContent":["// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;;AAKA,IAAI,QAAQ;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACG,IAAC,YAAY,MAAM,OAAO,CAAC,WAAW,SAAS;AAChD,QAAM,OAAO,WAAW,aAAa,IAAI,EAAE;AAC3C,QAAM,OAAO,MAAM,WAAW,CAAC,OAAO,iBAAiB;AACrD,UAAM,EAAE,SAAS,GAAG,eAAc,IAAK;AACvC,UAAM,OAAO,UAAU,OAAO;AAC9B,QAAI,OAAO,WAAW,aAAa;AACjC,aAAO,OAAO,IAAI,UAAU,CAAC,IAAI;AAAA,IACnC;AACA,WAAuB,oBAAI,MAAM,EAAE,GAAG,gBAAgB,KAAK,cAAc;AAAA,EAC3E,CAAC;AACD,OAAK,cAAc,aAAa,IAAI;AACpC,SAAO,EAAE,GAAG,WAAW,CAAC,IAAI,GAAG,KAAI;AACrC,GAAG,CAAA,CAAE;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { composeEventHandlers } from "../../primitive/dist/index.js";
|
|
3
|
+
import { createCollection } from "../../react-collection/dist/index.js";
|
|
4
|
+
import { useComposedRefs } from "../../react-compose-refs/dist/index.js";
|
|
5
|
+
import { createContextScope } from "../../react-context/dist/index.js";
|
|
6
|
+
import { useId } from "../../react-id/dist/index.js";
|
|
7
|
+
import { Primitive } from "../../react-primitive/dist/index.js";
|
|
8
|
+
import { useCallbackRef } from "../../react-use-callback-ref/dist/index.js";
|
|
9
|
+
import { useControllableState } from "../../react-use-controllable-state/dist/index.js";
|
|
10
|
+
import { useDirection } from "../../react-direction/dist/index.js";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
13
|
+
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
14
|
+
var GROUP_NAME = "RovingFocusGroup";
|
|
15
|
+
var [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);
|
|
16
|
+
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
|
|
17
|
+
GROUP_NAME,
|
|
18
|
+
[createCollectionScope]
|
|
19
|
+
);
|
|
20
|
+
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
21
|
+
var RovingFocusGroup = React.forwardRef(
|
|
22
|
+
(props, forwardedRef) => {
|
|
23
|
+
return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
RovingFocusGroup.displayName = GROUP_NAME;
|
|
27
|
+
var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
|
|
28
|
+
const {
|
|
29
|
+
__scopeRovingFocusGroup,
|
|
30
|
+
orientation,
|
|
31
|
+
loop = false,
|
|
32
|
+
dir,
|
|
33
|
+
currentTabStopId: currentTabStopIdProp,
|
|
34
|
+
defaultCurrentTabStopId,
|
|
35
|
+
onCurrentTabStopIdChange,
|
|
36
|
+
onEntryFocus,
|
|
37
|
+
preventScrollOnEntryFocus = false,
|
|
38
|
+
...groupProps
|
|
39
|
+
} = props;
|
|
40
|
+
const ref = React.useRef(null);
|
|
41
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
42
|
+
const direction = useDirection(dir);
|
|
43
|
+
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
44
|
+
prop: currentTabStopIdProp,
|
|
45
|
+
defaultProp: defaultCurrentTabStopId ?? null,
|
|
46
|
+
onChange: onCurrentTabStopIdChange,
|
|
47
|
+
caller: GROUP_NAME
|
|
48
|
+
});
|
|
49
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
|
|
50
|
+
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
|
51
|
+
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
52
|
+
const isClickFocusRef = React.useRef(false);
|
|
53
|
+
const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);
|
|
54
|
+
React.useEffect(() => {
|
|
55
|
+
const node = ref.current;
|
|
56
|
+
if (node) {
|
|
57
|
+
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
58
|
+
return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
59
|
+
}
|
|
60
|
+
}, [handleEntryFocus]);
|
|
61
|
+
return /* @__PURE__ */ jsx(
|
|
62
|
+
RovingFocusProvider,
|
|
63
|
+
{
|
|
64
|
+
scope: __scopeRovingFocusGroup,
|
|
65
|
+
orientation,
|
|
66
|
+
dir: direction,
|
|
67
|
+
loop,
|
|
68
|
+
currentTabStopId,
|
|
69
|
+
onItemFocus: React.useCallback(
|
|
70
|
+
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
71
|
+
[setCurrentTabStopId]
|
|
72
|
+
),
|
|
73
|
+
onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),
|
|
74
|
+
onFocusableItemAdd: React.useCallback(
|
|
75
|
+
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
76
|
+
[]
|
|
77
|
+
),
|
|
78
|
+
onFocusableItemRemove: React.useCallback(
|
|
79
|
+
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
80
|
+
[]
|
|
81
|
+
),
|
|
82
|
+
children: /* @__PURE__ */ jsx(
|
|
83
|
+
Primitive.div,
|
|
84
|
+
{
|
|
85
|
+
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
86
|
+
"data-orientation": orientation,
|
|
87
|
+
...groupProps,
|
|
88
|
+
ref: composedRefs,
|
|
89
|
+
style: { outline: "none", ...props.style },
|
|
90
|
+
onMouseDown: composeEventHandlers(props.onMouseDown, () => {
|
|
91
|
+
isClickFocusRef.current = true;
|
|
92
|
+
}),
|
|
93
|
+
onFocus: composeEventHandlers(props.onFocus, (event) => {
|
|
94
|
+
const isKeyboardFocus = !isClickFocusRef.current;
|
|
95
|
+
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
96
|
+
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
|
|
97
|
+
event.currentTarget.dispatchEvent(entryFocusEvent);
|
|
98
|
+
if (!entryFocusEvent.defaultPrevented) {
|
|
99
|
+
const items = getItems().filter((item) => item.focusable);
|
|
100
|
+
const activeItem = items.find((item) => item.active);
|
|
101
|
+
const currentItem = items.find((item) => item.id === currentTabStopId);
|
|
102
|
+
const candidateItems = [activeItem, currentItem, ...items].filter(
|
|
103
|
+
Boolean
|
|
104
|
+
);
|
|
105
|
+
const candidateNodes = candidateItems.map((item) => item.ref.current);
|
|
106
|
+
focusFirst(candidateNodes, preventScrollOnEntryFocus);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
isClickFocusRef.current = false;
|
|
110
|
+
}),
|
|
111
|
+
onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
});
|
|
117
|
+
var ITEM_NAME = "RovingFocusGroupItem";
|
|
118
|
+
var RovingFocusGroupItem = React.forwardRef(
|
|
119
|
+
(props, forwardedRef) => {
|
|
120
|
+
const {
|
|
121
|
+
__scopeRovingFocusGroup,
|
|
122
|
+
focusable = true,
|
|
123
|
+
active = false,
|
|
124
|
+
tabStopId,
|
|
125
|
+
children,
|
|
126
|
+
...itemProps
|
|
127
|
+
} = props;
|
|
128
|
+
const autoId = useId();
|
|
129
|
+
const id = tabStopId || autoId;
|
|
130
|
+
const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);
|
|
131
|
+
const isCurrentTabStop = context.currentTabStopId === id;
|
|
132
|
+
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
133
|
+
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
134
|
+
React.useEffect(() => {
|
|
135
|
+
if (focusable) {
|
|
136
|
+
onFocusableItemAdd();
|
|
137
|
+
return () => onFocusableItemRemove();
|
|
138
|
+
}
|
|
139
|
+
}, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
140
|
+
return /* @__PURE__ */ jsx(
|
|
141
|
+
Collection.ItemSlot,
|
|
142
|
+
{
|
|
143
|
+
scope: __scopeRovingFocusGroup,
|
|
144
|
+
id,
|
|
145
|
+
focusable,
|
|
146
|
+
active,
|
|
147
|
+
children: /* @__PURE__ */ jsx(
|
|
148
|
+
Primitive.span,
|
|
149
|
+
{
|
|
150
|
+
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
151
|
+
"data-orientation": context.orientation,
|
|
152
|
+
...itemProps,
|
|
153
|
+
ref: forwardedRef,
|
|
154
|
+
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
|
155
|
+
if (!focusable) event.preventDefault();
|
|
156
|
+
else context.onItemFocus(id);
|
|
157
|
+
}),
|
|
158
|
+
onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),
|
|
159
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
160
|
+
if (event.key === "Tab" && event.shiftKey) {
|
|
161
|
+
context.onItemShiftTab();
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (event.target !== event.currentTarget) return;
|
|
165
|
+
const focusIntent = getFocusIntent(event, context.orientation, context.dir);
|
|
166
|
+
if (focusIntent !== void 0) {
|
|
167
|
+
if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
|
|
168
|
+
event.preventDefault();
|
|
169
|
+
const items = getItems().filter((item) => item.focusable);
|
|
170
|
+
let candidateNodes = items.map((item) => item.ref.current);
|
|
171
|
+
if (focusIntent === "last") candidateNodes.reverse();
|
|
172
|
+
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
173
|
+
if (focusIntent === "prev") candidateNodes.reverse();
|
|
174
|
+
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
175
|
+
candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
176
|
+
}
|
|
177
|
+
setTimeout(() => focusFirst(candidateNodes));
|
|
178
|
+
}
|
|
179
|
+
}),
|
|
180
|
+
children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
RovingFocusGroupItem.displayName = ITEM_NAME;
|
|
188
|
+
var MAP_KEY_TO_FOCUS_INTENT = {
|
|
189
|
+
ArrowLeft: "prev",
|
|
190
|
+
ArrowUp: "prev",
|
|
191
|
+
ArrowRight: "next",
|
|
192
|
+
ArrowDown: "next",
|
|
193
|
+
PageUp: "first",
|
|
194
|
+
Home: "first",
|
|
195
|
+
PageDown: "last",
|
|
196
|
+
End: "last"
|
|
197
|
+
};
|
|
198
|
+
function getDirectionAwareKey(key, dir) {
|
|
199
|
+
if (dir !== "rtl") return key;
|
|
200
|
+
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
201
|
+
}
|
|
202
|
+
function getFocusIntent(event, orientation, dir) {
|
|
203
|
+
const key = getDirectionAwareKey(event.key, dir);
|
|
204
|
+
if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
|
|
205
|
+
if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
|
|
206
|
+
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
207
|
+
}
|
|
208
|
+
function focusFirst(candidates, preventScroll = false) {
|
|
209
|
+
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
210
|
+
for (const candidate of candidates) {
|
|
211
|
+
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
212
|
+
candidate.focus({ preventScroll });
|
|
213
|
+
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function wrapArray(array, startIndex) {
|
|
217
|
+
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
218
|
+
}
|
|
219
|
+
var Root = RovingFocusGroup;
|
|
220
|
+
var Item = RovingFocusGroupItem;
|
|
221
|
+
export {
|
|
222
|
+
Item,
|
|
223
|
+
Root,
|
|
224
|
+
RovingFocusGroup,
|
|
225
|
+
RovingFocusGroupItem,
|
|
226
|
+
createRovingFocusGroupScope
|
|
227
|
+
};
|
|
228
|
+
//# sourceMappingURL=index.js.map
|