@quan-erp/shared-ui 1.0.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/README.md +90 -0
- package/dist/common/common.d.ts +2 -0
- package/dist/components/blocks/editor-00/editor.d.ts +8 -0
- package/dist/components/blocks/editor-00/nodes.d.ts +3 -0
- package/dist/components/blocks/editor-00/plugins.d.ts +2 -0
- package/dist/components/custom/confirm-dialog.d.ts +15 -0
- package/dist/components/custom/dashboard.d.ts +22 -0
- package/dist/components/custom/data-table/cursor-based-pagination.d.ts +9 -0
- package/dist/components/custom/data-table/data-table-bulk-action-menu.d.ts +9 -0
- package/dist/components/custom/data-table/data-table-bulk-export.d.ts +8 -0
- package/dist/components/custom/data-table/data-table-column-header.d.ts +9 -0
- package/dist/components/custom/data-table/data-table-grid.d.ts +21 -0
- package/dist/components/custom/data-table/data-table-group-by.types.d.ts +11 -0
- package/dist/components/custom/data-table/data-table-helper.d.ts +2 -0
- package/dist/components/custom/data-table/data-table-list-view.d.ts +13 -0
- package/dist/components/custom/data-table/data-table-page-size.d.ts +11 -0
- package/dist/components/custom/data-table/data-table-pagination.d.ts +9 -0
- package/dist/components/custom/data-table/data-table-toolbar.d.ts +26 -0
- package/dist/components/custom/data-table/data-table-util.d.ts +7 -0
- package/dist/components/custom/data-table/data-table-view-fallback.d.ts +2 -0
- package/dist/components/custom/data-table/data-table-view-options.d.ts +17 -0
- package/dist/components/custom/data-table/data-table-view-preferences.d.ts +22 -0
- package/dist/components/custom/data-table/data-table-view-preferences.storage.d.ts +15 -0
- package/dist/components/custom/data-table/data-table-wrapper.d.ts +51 -0
- package/dist/components/custom/data-table/data-table.d.ts +47 -0
- package/dist/components/custom/data-table/export.d.ts +22 -0
- package/dist/components/custom/data-table/group-table-rows.d.ts +3 -0
- package/dist/components/custom/data-table/types.d.ts +17 -0
- package/dist/components/custom/data-table/use-data-table-page-size.d.ts +41 -0
- package/dist/components/custom/document-title.d.ts +4 -0
- package/dist/components/custom/empty-screen.d.ts +8 -0
- package/dist/components/custom/error-screen.d.ts +9 -0
- package/dist/components/custom/floating-action-btn.d.ts +39 -0
- package/dist/components/custom/index.d.ts +20 -0
- package/dist/components/custom/loading-screen.d.ts +7 -0
- package/dist/components/custom/menu-tab.d.ts +17 -0
- package/dist/components/custom/page.d.ts +35 -0
- package/dist/components/custom/plugin-theme.d.ts +8 -0
- package/dist/components/custom/portal.d.ts +4 -0
- package/dist/components/custom/protected-page.d.ts +26 -0
- package/dist/components/custom/pull-to-refresh.d.ts +16 -0
- package/dist/components/custom/render-in-view.d.ts +12 -0
- package/dist/components/custom/responsive-dialog.d.ts +47 -0
- package/dist/components/custom/safearea.d.ts +5 -0
- package/dist/components/custom/scrollable.d.ts +17 -0
- package/dist/components/custom/search-and-filter-suite.d.ts +16 -0
- package/dist/components/custom/setting.d.ts +30 -0
- package/dist/components/custom/submenu-hub.d.ts +17 -0
- package/dist/components/editor/editor-ui/content-editable.d.ts +9 -0
- package/dist/components/editor/themes/editor-theme.d.ts +3 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/alert-dialog.d.ts +19 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/breadcrumb.d.ts +20 -0
- package/dist/components/ui/button-group.d.ts +12 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts +12 -0
- package/dist/components/ui/card.d.ts +10 -0
- package/dist/components/ui/carousel.d.ts +29 -0
- package/dist/components/ui/chart.d.ts +63 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/command.d.ts +81 -0
- package/dist/components/ui/context-menu.d.ts +28 -0
- package/dist/components/ui/dialog.d.ts +16 -0
- package/dist/components/ui/drawer.d.ts +23 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/field.d.ts +25 -0
- package/dist/components/ui/form.d.ts +26 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/index.d.ts +54 -0
- package/dist/components/ui/input-group.d.ts +17 -0
- package/dist/components/ui/input-otp.d.ts +35 -0
- package/dist/components/ui/input.d.ts +10 -0
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/kbd.d.ts +4 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/menubar.d.ts +29 -0
- package/dist/components/ui/navigation-menu.d.ts +13 -0
- package/dist/components/ui/pagination.d.ts +28 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/progress.d.ts +5 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/resizable.d.ts +24 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/sheet.d.ts +16 -0
- package/dist/components/ui/sidebar.d.ts +71 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/slider.d.ts +12 -0
- package/dist/components/ui/sonner.d.ts +6 -0
- package/dist/components/ui/spinner.d.ts +9 -0
- package/dist/components/ui/switch.d.ts +11 -0
- package/dist/components/ui/table.d.ts +14 -0
- package/dist/components/ui/tabs.d.ts +16 -0
- package/dist/components/ui/textarea.d.ts +10 -0
- package/dist/components/ui/time-picker.d.ts +13 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle.d.ts +10 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/es/common/common.js +4 -0
- package/dist/es/components/blocks/editor-00/editor.js +49 -0
- package/dist/es/components/blocks/editor-00/nodes.js +6 -0
- package/dist/es/components/blocks/editor-00/plugins.js +23 -0
- package/dist/es/components/custom/confirm-dialog.js +34 -0
- package/dist/es/components/custom/dashboard.js +86 -0
- package/dist/es/components/custom/data-table/cursor-based-pagination.js +123 -0
- package/dist/es/components/custom/data-table/data-table-bulk-action-menu.js +112 -0
- package/dist/es/components/custom/data-table/data-table-bulk-export.js +76 -0
- package/dist/es/components/custom/data-table/data-table-column-header.js +102 -0
- package/dist/es/components/custom/data-table/data-table-grid.js +234 -0
- package/dist/es/components/custom/data-table/data-table-helper.js +8 -0
- package/dist/es/components/custom/data-table/data-table-list-view.js +121 -0
- package/dist/es/components/custom/data-table/data-table-page-size.js +49 -0
- package/dist/es/components/custom/data-table/data-table-pagination.js +156 -0
- package/dist/es/components/custom/data-table/data-table-toolbar.js +149 -0
- package/dist/es/components/custom/data-table/data-table-util.js +31 -0
- package/dist/es/components/custom/data-table/data-table-view-fallback.js +7 -0
- package/dist/es/components/custom/data-table/data-table-view-options.js +311 -0
- package/dist/es/components/custom/data-table/data-table-view-preferences.js +71 -0
- package/dist/es/components/custom/data-table/data-table-view-preferences.storage.js +115 -0
- package/dist/es/components/custom/data-table/data-table.js +425 -0
- package/dist/es/components/custom/data-table/group-table-rows.js +16 -0
- package/dist/es/components/custom/data-table/use-data-table-page-size.js +155 -0
- package/dist/es/components/custom/empty-screen.js +28 -0
- package/dist/es/components/custom/error-screen.js +84 -0
- package/dist/es/components/custom/floating-action-btn.js +200 -0
- package/dist/es/components/custom/loading-screen.js +26 -0
- package/dist/es/components/custom/menu-tab.js +45 -0
- package/dist/es/components/custom/page.js +105 -0
- package/dist/es/components/custom/plugin-theme.js +13 -0
- package/dist/es/components/custom/portal.js +13 -0
- package/dist/es/components/custom/protected-page.js +74 -0
- package/dist/es/components/custom/pull-to-refresh.js +378 -0
- package/dist/es/components/custom/render-in-view.js +35 -0
- package/dist/es/components/custom/responsive-dialog.js +163 -0
- package/dist/es/components/custom/safearea.js +8 -0
- package/dist/es/components/custom/scrollable.js +96 -0
- package/dist/es/components/custom/setting.js +39 -0
- package/dist/es/components/editor/editor-ui/content-editable.js +26 -0
- package/dist/es/components/editor/themes/editor-theme.js +119 -0
- package/dist/es/components/ui/accordion.js +47 -0
- package/dist/es/components/ui/alert-dialog.js +178 -0
- package/dist/es/components/ui/alert.js +51 -0
- package/dist/es/components/ui/avatar.js +42 -0
- package/dist/es/components/ui/badge.js +27 -0
- package/dist/es/components/ui/breadcrumb.js +93 -0
- package/dist/es/components/ui/button-group.js +76 -0
- package/dist/es/components/ui/button.js +57 -0
- package/dist/es/components/ui/calendar.js +402 -0
- package/dist/es/components/ui/card.js +91 -0
- package/dist/es/components/ui/carousel.js +194 -0
- package/dist/es/components/ui/chart.js +239 -0
- package/dist/es/components/ui/checkbox.js +27 -0
- package/dist/es/components/ui/collapsible.js +9 -0
- package/dist/es/components/ui/command.js +115 -0
- package/dist/es/components/ui/context-menu.js +153 -0
- package/dist/es/components/ui/dialog.js +137 -0
- package/dist/es/components/ui/drawer.js +107 -0
- package/dist/es/components/ui/dropdown-menu.js +152 -0
- package/dist/es/components/ui/field.js +226 -0
- package/dist/es/components/ui/form.js +109 -0
- package/dist/es/components/ui/hover-card.js +25 -0
- package/dist/es/components/ui/input-group.js +155 -0
- package/dist/es/components/ui/input-otp.js +49 -0
- package/dist/es/components/ui/input.js +37 -0
- package/dist/es/components/ui/item.js +188 -0
- package/dist/es/components/ui/kbd.js +31 -0
- package/dist/es/components/ui/label.js +23 -0
- package/dist/es/components/ui/menubar.js +202 -0
- package/dist/es/components/ui/navigation-menu.js +107 -0
- package/dist/es/components/ui/pagination.js +101 -0
- package/dist/es/components/ui/popover.js +27 -0
- package/dist/es/components/ui/progress.js +26 -0
- package/dist/es/components/ui/radio-group.js +35 -0
- package/dist/es/components/ui/resizable.js +38 -0
- package/dist/es/components/ui/scroll-area.js +38 -0
- package/dist/es/components/ui/select.js +124 -0
- package/dist/es/components/ui/separator.js +27 -0
- package/dist/es/components/ui/sheet.js +129 -0
- package/dist/es/components/ui/sidebar.js +604 -0
- package/dist/es/components/ui/skeleton.js +17 -0
- package/dist/es/components/ui/slider.js +62 -0
- package/dist/es/components/ui/sonner.js +26 -0
- package/dist/es/components/ui/spinner.js +34 -0
- package/dist/es/components/ui/switch.js +54 -0
- package/dist/es/components/ui/table.js +90 -0
- package/dist/es/components/ui/tabs.js +84 -0
- package/dist/es/components/ui/textarea.js +32 -0
- package/dist/es/components/ui/time-picker.js +199 -0
- package/dist/es/components/ui/toggle-group.js +43 -0
- package/dist/es/components/ui/toggle.js +44 -0
- package/dist/es/components/ui/tooltip.js +56 -0
- package/dist/es/hooks/use-debounce-value.js +16 -0
- package/dist/es/hooks/use-is-inview.js +25 -0
- package/dist/es/hooks/use-mobile-back-dialog.js +34 -0
- package/dist/es/hooks/use-mobile.js +43 -0
- package/dist/es/hooks/use-mounted.js +14 -0
- package/dist/es/hooks/use-scroll-direction.js +26 -0
- package/dist/es/hooks/use-user-hand-behavior.js +20 -0
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.js +487 -0
- package/dist/es/lib/utils.js +8 -0
- package/dist/es/locale/locale.js +87 -0
- package/dist/es/node_modules/@tanstack/react-table/build/lib/index.js +93 -0
- package/dist/es/node_modules/@tanstack/table-core/build/lib/index.js +2737 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +85 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +49 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +86 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +19 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +14 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +5 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/LazyContext.js +5 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +9 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/MotionContext/create.js +13 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/MotionContext/index.js +5 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +15 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/PresenceContext.js +5 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +5 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/events/add-pointer-event.js +8 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/events/event-info.js +14 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +432 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/drag/index.js +38 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +93 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/focus.js +35 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/hover.js +31 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +215 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/pan/index.js +50 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/press.js +38 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +60 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/animation/index.js +40 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/animations.js +13 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/definitions.js +42 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/drag.js +17 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/gestures.js +21 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +111 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/layout.js +11 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/load-features.js +15 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +64 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +33 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/index.js +69 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/symbol.js +4 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +35 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +106 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +66 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +39 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/components/create-proxy.js +35 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +13 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +7 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +13 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/dom/use-render.js +21 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +31 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +29 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +10 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/html/use-props.js +44 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +9 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +30 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/svg/use-props.js +24 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +10 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +8 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/distance.js +10 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/get-context-window.js +6 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/is-browser.js +4 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/is-ref-object.js +6 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +38 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/use-constant.js +11 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +153 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/JSAnimation.js +294 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +160 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +51 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/animate/single-value.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/drivers/frame.js +17 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/inertia.js +67 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +37 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/spring.js +246 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +16 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +69 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +78 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +36 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +22 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +107 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +131 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +8 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +13 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +22 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +43 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +27 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +31 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +31 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +33 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +16 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +20 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +22 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +18 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +26 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +36 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +14 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +19 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/events/add-dom-event.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/batcher.js +67 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/frame.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/microtask.js +5 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/order.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/render-step.js +64 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/sync-time.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +25 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/hover.js +62 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/press/index.js +62 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +18 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +32 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/utils/setup.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +60 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +26 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/copy.js +19 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +86 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +57 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +40 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/models.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/utils.js +34 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +13 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +28 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +1124 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/node/state.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/shared/stack.js +83 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +26 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +25 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/styles/transform.js +38 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +24 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +20 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/utils/measure.js +18 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/Feature.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/VisualElement.js +426 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +37 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +83 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/dom/style-set.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +40 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +42 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +53 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/html/utils/render.js +14 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +18 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/store.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +45 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +59 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +28 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/path.js +17 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/render.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +16 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/animation-state.js +223 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +26 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +13 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/keys-position.js +13 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +24 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/motion-values.js +33 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +20 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +8 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +25 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/setters.js +25 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/variant-props.js +14 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/resize/handle-element.js +61 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/resize/handle-window.js +31 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/resize/index.js +8 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/delay.js +17 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/interpolate.js +53 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/is-html-element.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/is-svg-element.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/color.js +44 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/complex.js +83 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/immediate.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/index.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/number.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/visibility.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/resolve-elements.js +16 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/supports/flags.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/supports/memo.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +5 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/index.js +286 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/auto.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/hex.js +37 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +39 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/hsla.js +14 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/index.js +26 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/rgba.js +18 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/utils.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/complex/filter.js +27 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/complex/index.js +91 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/complex/mask.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/dimensions.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/int.js +8 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +28 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/maps/number.js +70 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/maps/transform.js +37 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/numbers/index.js +19 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/numbers/units.js +23 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/test.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +14 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/find.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/will-change/is.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/array.js +13 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/clamp.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/anticipate.js +5 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/back.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/circ.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +29 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/ease.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/utils/map.js +38 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/errors.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/format-error-message.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/global-config.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/is-numerical-string.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/is-object.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/is-zero-value-string.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/memo.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/noop.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/pipe.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/progress.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/subscription-manager.js +32 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/time-conversion.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/velocity-per-second.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/warn-once.js +11 -0
- package/dist/es/shared-ui.css +95 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/use-debounce-value.d.ts +2 -0
- package/dist/hooks/use-inview.d.ts +7 -0
- package/dist/hooks/use-is-inview.d.ts +7 -0
- package/dist/hooks/use-mobile-back-dialog.d.ts +6 -0
- package/dist/hooks/use-mobile.d.ts +9 -0
- package/dist/hooks/use-mounted.d.ts +2 -0
- package/dist/hooks/use-scroll-direction.d.ts +3 -0
- package/dist/hooks/use-user-hand-behavior.d.ts +7 -0
- package/dist/index.d.ts +13 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/locale/index.d.ts +2 -0
- package/dist/locale/locale.d.ts +26 -0
- package/package.json +118 -0
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React__default, { useRef, useState, useEffect } from "react";
|
|
3
|
+
import { Check, CloseSmall } from "@icon-park/react";
|
|
4
|
+
import "../ui/accordion.js";
|
|
5
|
+
import "../ui/alert.js";
|
|
6
|
+
import "../ui/avatar.js";
|
|
7
|
+
import "../ui/badge.js";
|
|
8
|
+
import "../ui/breadcrumb.js";
|
|
9
|
+
import "../ui/button-group.js";
|
|
10
|
+
import "../ui/button.js";
|
|
11
|
+
import "lucide-react";
|
|
12
|
+
import "react-day-picker";
|
|
13
|
+
import "clsx";
|
|
14
|
+
import "tailwind-merge";
|
|
15
|
+
import "../ui/popover.js";
|
|
16
|
+
import "../ui/drawer.js";
|
|
17
|
+
import "../ui/select.js";
|
|
18
|
+
import "uuid";
|
|
19
|
+
import { Vibration } from "@quan-erp/shared-frontend-core";
|
|
20
|
+
import "../ui/carousel.js";
|
|
21
|
+
import "../ui/chart.js";
|
|
22
|
+
import "../ui/checkbox.js";
|
|
23
|
+
import "@radix-ui/react-collapsible";
|
|
24
|
+
import "../ui/command.js";
|
|
25
|
+
import "../ui/context-menu.js";
|
|
26
|
+
import "@radix-ui/react-dialog";
|
|
27
|
+
import "../ui/dropdown-menu.js";
|
|
28
|
+
import "../ui/field.js";
|
|
29
|
+
import "../ui/form.js";
|
|
30
|
+
import "../ui/hover-card.js";
|
|
31
|
+
import "../ui/input-group.js";
|
|
32
|
+
import "../ui/input-otp.js";
|
|
33
|
+
import "../ui/input.js";
|
|
34
|
+
import "../ui/item.js";
|
|
35
|
+
import "@radix-ui/react-label";
|
|
36
|
+
import "../ui/menubar.js";
|
|
37
|
+
import "../ui/navigation-menu.js";
|
|
38
|
+
import "../ui/pagination.js";
|
|
39
|
+
import "../ui/progress.js";
|
|
40
|
+
import "../ui/radio-group.js";
|
|
41
|
+
import "react-resizable-panels";
|
|
42
|
+
import "../ui/scroll-area.js";
|
|
43
|
+
import "@radix-ui/react-separator";
|
|
44
|
+
import "../ui/sidebar.js";
|
|
45
|
+
import "../ui/slider.js";
|
|
46
|
+
import "next-themes";
|
|
47
|
+
import "sonner";
|
|
48
|
+
import { Spinner } from "../ui/spinner.js";
|
|
49
|
+
import "../ui/switch.js";
|
|
50
|
+
import "../ui/table.js";
|
|
51
|
+
import "../ui/tabs.js";
|
|
52
|
+
import "../ui/textarea.js";
|
|
53
|
+
import "../ui/toggle-group.js";
|
|
54
|
+
import "../ui/toggle.js";
|
|
55
|
+
import "@radix-ui/react-tooltip";
|
|
56
|
+
import "@radix-ui/react-alert-dialog";
|
|
57
|
+
const PullToRefresh = React__default.memo(({
|
|
58
|
+
onRefresh,
|
|
59
|
+
refreshing,
|
|
60
|
+
threshold = 80,
|
|
61
|
+
resistance = 2.5,
|
|
62
|
+
renderIndicator,
|
|
63
|
+
children,
|
|
64
|
+
className = "",
|
|
65
|
+
disabled = false,
|
|
66
|
+
success = true
|
|
67
|
+
}) => {
|
|
68
|
+
const containerRef = useRef(null);
|
|
69
|
+
const indicatorRef = useRef(null);
|
|
70
|
+
const successRef = useRef(null);
|
|
71
|
+
const errorRef = useRef(null);
|
|
72
|
+
const refreshingRef = useRef(null);
|
|
73
|
+
const readyRef = useRef(null);
|
|
74
|
+
const pullingRef = useRef(null);
|
|
75
|
+
const pullingScaleRef = useRef(null);
|
|
76
|
+
const circleProgressRef = useRef(null);
|
|
77
|
+
const percentTextRef = useRef(null);
|
|
78
|
+
const statusRef = useRef("idle");
|
|
79
|
+
const yOffsetRef = useRef(0);
|
|
80
|
+
const isDraggingRef = useRef(false);
|
|
81
|
+
const startXRef = useRef(0);
|
|
82
|
+
const startYRef = useRef(0);
|
|
83
|
+
const isGestureClassified = useRef(false);
|
|
84
|
+
const isVerticalDrag = useRef(false);
|
|
85
|
+
const onRefreshRef = useRef(onRefresh);
|
|
86
|
+
const thresholdRef = useRef(threshold);
|
|
87
|
+
const resistanceRef = useRef(resistance);
|
|
88
|
+
const successRefProp = useRef(success);
|
|
89
|
+
const refreshingRefProp = useRef(refreshing);
|
|
90
|
+
onRefreshRef.current = onRefresh;
|
|
91
|
+
thresholdRef.current = threshold;
|
|
92
|
+
resistanceRef.current = resistance;
|
|
93
|
+
successRefProp.current = success;
|
|
94
|
+
refreshingRefProp.current = refreshing;
|
|
95
|
+
const [customState, setCustomState] = useState(null);
|
|
96
|
+
const updateState = (newStatus, newYOffset) => {
|
|
97
|
+
statusRef.current = newStatus;
|
|
98
|
+
yOffsetRef.current = newYOffset;
|
|
99
|
+
if (renderIndicator) {
|
|
100
|
+
setCustomState({ status: newStatus, yOffset: newYOffset });
|
|
101
|
+
}
|
|
102
|
+
if (containerRef.current) {
|
|
103
|
+
containerRef.current.style.transform = `translateY(${newYOffset}px) translateZ(0)`;
|
|
104
|
+
}
|
|
105
|
+
if (indicatorRef.current) {
|
|
106
|
+
indicatorRef.current.style.height = `${newYOffset}px`;
|
|
107
|
+
indicatorRef.current.style.opacity = `${newYOffset > 0 ? Math.min(newYOffset / 20, 1) : 0}`;
|
|
108
|
+
}
|
|
109
|
+
if (!renderIndicator) {
|
|
110
|
+
const successEl = successRef.current;
|
|
111
|
+
const errorEl = errorRef.current;
|
|
112
|
+
const refreshingEl = refreshingRef.current;
|
|
113
|
+
const readyEl = readyRef.current;
|
|
114
|
+
const pullingEl = pullingRef.current;
|
|
115
|
+
if (successEl) {
|
|
116
|
+
successEl.style.opacity = newStatus === "success" ? "1" : "0";
|
|
117
|
+
successEl.style.transform = newStatus === "success" ? "scale(1)" : "scale(0.95)";
|
|
118
|
+
}
|
|
119
|
+
if (errorEl) {
|
|
120
|
+
errorEl.style.opacity = newStatus === "error" ? "1" : "0";
|
|
121
|
+
errorEl.style.transform = newStatus === "error" ? "scale(1)" : "scale(0.95)";
|
|
122
|
+
}
|
|
123
|
+
if (refreshingEl) {
|
|
124
|
+
refreshingEl.style.opacity = newStatus === "refreshing" ? "1" : "0";
|
|
125
|
+
}
|
|
126
|
+
if (readyEl) {
|
|
127
|
+
readyEl.style.opacity = newStatus === "ready" ? "1" : "0";
|
|
128
|
+
}
|
|
129
|
+
if (pullingEl) {
|
|
130
|
+
pullingEl.style.opacity = newStatus === "pulling" ? "1" : "0";
|
|
131
|
+
}
|
|
132
|
+
if (newStatus === "pulling") {
|
|
133
|
+
const pullPercent = Math.min(Math.round(newYOffset / thresholdRef.current * 100), 100);
|
|
134
|
+
const radius = 10;
|
|
135
|
+
const circumference = 2 * Math.PI * radius;
|
|
136
|
+
const strokeDashoffset = circumference - pullPercent / 100 * circumference;
|
|
137
|
+
if (circleProgressRef.current) {
|
|
138
|
+
circleProgressRef.current.style.strokeDashoffset = `${strokeDashoffset}`;
|
|
139
|
+
}
|
|
140
|
+
if (percentTextRef.current) {
|
|
141
|
+
percentTextRef.current.innerText = `${pullPercent.toFixed(0)}%`;
|
|
142
|
+
}
|
|
143
|
+
if (pullingScaleRef.current) {
|
|
144
|
+
const scale = Math.min(1, Math.max(0, pullPercent / 100));
|
|
145
|
+
pullingScaleRef.current.style.transform = `scale(${scale})`;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const isScrolled = (target, stopElement) => {
|
|
151
|
+
let el = target;
|
|
152
|
+
while (el && el !== stopElement && el !== document.body) {
|
|
153
|
+
if (el.scrollTop > 0) {
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
el = el.parentElement;
|
|
157
|
+
}
|
|
158
|
+
return false;
|
|
159
|
+
};
|
|
160
|
+
const startDrag = (pageX, pageY, target) => {
|
|
161
|
+
if (containerRef.current) {
|
|
162
|
+
if (containerRef.current.scrollTop > 0) return;
|
|
163
|
+
if (target && isScrolled(target, containerRef.current)) return;
|
|
164
|
+
}
|
|
165
|
+
if (statusRef.current === "refreshing" || statusRef.current === "success" || statusRef.current === "error") return;
|
|
166
|
+
isDraggingRef.current = true;
|
|
167
|
+
startXRef.current = pageX;
|
|
168
|
+
startYRef.current = pageY;
|
|
169
|
+
isGestureClassified.current = false;
|
|
170
|
+
isVerticalDrag.current = false;
|
|
171
|
+
if (containerRef.current) {
|
|
172
|
+
containerRef.current.style.transition = "none";
|
|
173
|
+
}
|
|
174
|
+
if (indicatorRef.current) {
|
|
175
|
+
indicatorRef.current.style.transition = "none";
|
|
176
|
+
}
|
|
177
|
+
bindListeners();
|
|
178
|
+
};
|
|
179
|
+
const moveDrag = (pageX, pageY, event) => {
|
|
180
|
+
if (!isDraggingRef.current) return;
|
|
181
|
+
const diffX = Math.abs(pageX - startXRef.current);
|
|
182
|
+
const diffY = pageY - startYRef.current;
|
|
183
|
+
if (!isGestureClassified.current && (Math.abs(diffY) > 2 || diffX > 2)) {
|
|
184
|
+
isGestureClassified.current = true;
|
|
185
|
+
if (diffY > diffX && diffY > 0) {
|
|
186
|
+
isVerticalDrag.current = true;
|
|
187
|
+
} else {
|
|
188
|
+
isVerticalDrag.current = false;
|
|
189
|
+
isDraggingRef.current = false;
|
|
190
|
+
unbindListeners();
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (isGestureClassified.current && !isVerticalDrag.current) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (diffY <= 0) {
|
|
198
|
+
if (yOffsetRef.current > 0) {
|
|
199
|
+
updateState("idle", 0);
|
|
200
|
+
}
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
if (event && event.cancelable) {
|
|
204
|
+
event.preventDefault();
|
|
205
|
+
}
|
|
206
|
+
const dampedOffset = diffY / (1 + diffY / (thresholdRef.current * resistanceRef.current));
|
|
207
|
+
const newStatus = dampedOffset >= thresholdRef.current ? "ready" : "pulling";
|
|
208
|
+
if (newStatus === "ready" && statusRef.current !== "ready") {
|
|
209
|
+
Vibration.instance.vibrate(100);
|
|
210
|
+
}
|
|
211
|
+
updateState(newStatus, dampedOffset);
|
|
212
|
+
};
|
|
213
|
+
const endDrag = async () => {
|
|
214
|
+
if (!isDraggingRef.current) return;
|
|
215
|
+
isDraggingRef.current = false;
|
|
216
|
+
unbindListeners();
|
|
217
|
+
if (containerRef.current) {
|
|
218
|
+
containerRef.current.style.transition = "transform 400ms cubic-bezier(0.16, 1, 0.3, 1)";
|
|
219
|
+
}
|
|
220
|
+
if (indicatorRef.current) {
|
|
221
|
+
indicatorRef.current.style.transition = "height 400ms cubic-bezier(0.16, 1, 0.3, 1), opacity 400ms cubic-bezier(0.16, 1, 0.3, 1)";
|
|
222
|
+
}
|
|
223
|
+
if (statusRef.current === "ready") {
|
|
224
|
+
updateState("refreshing", thresholdRef.current * 0.8);
|
|
225
|
+
try {
|
|
226
|
+
await onRefreshRef.current();
|
|
227
|
+
if (refreshingRefProp.current === void 0) {
|
|
228
|
+
const finalStatus = successRefProp.current ? "success" : "error";
|
|
229
|
+
updateState(finalStatus, thresholdRef.current * 0.8);
|
|
230
|
+
setTimeout(() => {
|
|
231
|
+
updateState(finalStatus, 0);
|
|
232
|
+
setTimeout(() => {
|
|
233
|
+
updateState("idle", 0);
|
|
234
|
+
}, 400);
|
|
235
|
+
}, 1e3);
|
|
236
|
+
}
|
|
237
|
+
} catch (err) {
|
|
238
|
+
if (refreshingRefProp.current === void 0) {
|
|
239
|
+
updateState("error", thresholdRef.current * 0.8);
|
|
240
|
+
setTimeout(() => {
|
|
241
|
+
updateState("error", 0);
|
|
242
|
+
setTimeout(() => {
|
|
243
|
+
updateState("idle", 0);
|
|
244
|
+
}, 400);
|
|
245
|
+
}, 1200);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
} else {
|
|
249
|
+
updateState("idle", 0);
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
useEffect(() => {
|
|
253
|
+
if (refreshing === void 0) return;
|
|
254
|
+
if (refreshing) {
|
|
255
|
+
if (statusRef.current !== "refreshing") {
|
|
256
|
+
if (containerRef.current) {
|
|
257
|
+
containerRef.current.style.transition = "transform 400ms cubic-bezier(0.16, 1, 0.3, 1)";
|
|
258
|
+
}
|
|
259
|
+
if (indicatorRef.current) {
|
|
260
|
+
indicatorRef.current.style.transition = "height 400ms cubic-bezier(0.16, 1, 0.3, 1), opacity 400ms cubic-bezier(0.16, 1, 0.3, 1)";
|
|
261
|
+
}
|
|
262
|
+
updateState("refreshing", thresholdRef.current * 0.8);
|
|
263
|
+
}
|
|
264
|
+
} else {
|
|
265
|
+
if (statusRef.current === "refreshing") {
|
|
266
|
+
if (containerRef.current) {
|
|
267
|
+
containerRef.current.style.transition = "transform 400ms cubic-bezier(0.16, 1, 0.3, 1)";
|
|
268
|
+
}
|
|
269
|
+
if (indicatorRef.current) {
|
|
270
|
+
indicatorRef.current.style.transition = "height 400ms cubic-bezier(0.16, 1, 0.3, 1), opacity 400ms cubic-bezier(0.16, 1, 0.3, 1)";
|
|
271
|
+
}
|
|
272
|
+
const finalStatus = successRefProp.current ? "success" : "error";
|
|
273
|
+
updateState(finalStatus, thresholdRef.current * 0.8);
|
|
274
|
+
setTimeout(() => {
|
|
275
|
+
updateState(finalStatus, 0);
|
|
276
|
+
setTimeout(() => {
|
|
277
|
+
updateState("idle", 0);
|
|
278
|
+
}, 400);
|
|
279
|
+
}, 1e3);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}, [refreshing, success, threshold]);
|
|
283
|
+
const handleTouchMove = (e) => {
|
|
284
|
+
if (e.touches.length > 0) {
|
|
285
|
+
moveDrag(e.touches[0].pageX, e.touches[0].pageY, e);
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
const handleMouseMove = (e) => {
|
|
289
|
+
moveDrag(e.pageX, e.pageY, e);
|
|
290
|
+
};
|
|
291
|
+
const handleTouchEnd = () => {
|
|
292
|
+
endDrag();
|
|
293
|
+
};
|
|
294
|
+
const handleMouseUp = () => {
|
|
295
|
+
endDrag();
|
|
296
|
+
};
|
|
297
|
+
const bindListeners = () => {
|
|
298
|
+
window.addEventListener("touchmove", handleTouchMove, { passive: false });
|
|
299
|
+
window.addEventListener("touchend", handleTouchEnd);
|
|
300
|
+
window.addEventListener("mousemove", handleMouseMove);
|
|
301
|
+
window.addEventListener("mouseup", handleMouseUp);
|
|
302
|
+
};
|
|
303
|
+
const unbindListeners = () => {
|
|
304
|
+
window.removeEventListener("touchmove", handleTouchMove);
|
|
305
|
+
window.removeEventListener("touchend", handleTouchEnd);
|
|
306
|
+
window.removeEventListener("mousemove", handleMouseMove);
|
|
307
|
+
window.removeEventListener("mouseup", handleMouseUp);
|
|
308
|
+
};
|
|
309
|
+
useEffect(() => {
|
|
310
|
+
return () => {
|
|
311
|
+
unbindListeners();
|
|
312
|
+
};
|
|
313
|
+
}, []);
|
|
314
|
+
const handleTouchStart = (e) => {
|
|
315
|
+
startDrag(e.touches[0].pageX, e.touches[0].pageY, e.target);
|
|
316
|
+
};
|
|
317
|
+
const handleMouseDown = (e) => {
|
|
318
|
+
if (e.button !== 0) return;
|
|
319
|
+
startDrag(e.pageX, e.pageY, e.target);
|
|
320
|
+
};
|
|
321
|
+
if (disabled) {
|
|
322
|
+
return /* @__PURE__ */ jsx("div", { className, children });
|
|
323
|
+
}
|
|
324
|
+
return /* @__PURE__ */ jsxs("div", { className: `shared:relative shared:overflow-hidden shared:w-full shared:h-full shared:select-none ${className}`, "data-vaul-no-drag": true, children: [
|
|
325
|
+
/* @__PURE__ */ jsx(
|
|
326
|
+
"div",
|
|
327
|
+
{
|
|
328
|
+
ref: indicatorRef,
|
|
329
|
+
className: "shared:absolute shared:top-0 shared:left-0 shared:right-0 shared:flex shared:items-center shared:justify-center shared:overflow-hidden shared:pointer-events-none",
|
|
330
|
+
style: {
|
|
331
|
+
height: "0px",
|
|
332
|
+
opacity: 0,
|
|
333
|
+
transition: "height 400ms cubic-bezier(0.16, 1, 0.3, 1), opacity 400ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
334
|
+
},
|
|
335
|
+
children: renderIndicator ? renderIndicator(customState?.status || "idle", customState?.yOffset || 0, threshold) : /* @__PURE__ */ jsxs("div", { className: "shared:relative shared:flex shared:items-center shared:justify-center shared:w-full", children: [
|
|
336
|
+
/* @__PURE__ */ jsxs("div", { ref: successRef, style: { opacity: 0, transform: "scale(0.95)" }, className: "shared:absolute shared:flex shared:items-center shared:justify-center shared:gap-2 shared:text-sm shared:text-foreground/70 shared:font-medium shared:py-1 shared:transition-all shared:duration-200", children: [
|
|
337
|
+
/* @__PURE__ */ jsx("div", { className: "shared:w-5 shared:h-5 shared:rounded-full shared:bg-muted shared:flex shared:items-center shared:justify-center shared:text-foreground/70", children: /* @__PURE__ */ jsx(Check, { theme: "outline", size: "12", strokeWidth: 5 }) }),
|
|
338
|
+
/* @__PURE__ */ jsx("span", { children: "Refresh succeed" })
|
|
339
|
+
] }),
|
|
340
|
+
/* @__PURE__ */ jsxs("div", { ref: errorRef, style: { opacity: 0, transform: "scale(0.95)" }, className: "shared:absolute shared:flex shared:items-center shared:justify-center shared:gap-2 shared:text-sm shared:text-red-600 shared:dark:text-red-500 shared:font-medium shared:py-1 shared:transition-all shared:duration-200", children: [
|
|
341
|
+
/* @__PURE__ */ jsx("div", { className: "shared:w-5 shared:h-5 shared:rounded-full shared:bg-red-100 shared:dark:bg-red-950/30 shared:flex shared:items-center shared:justify-center shared:text-red-600 shared:dark:text-red-500", children: /* @__PURE__ */ jsx(CloseSmall, { theme: "outline", size: "12", strokeWidth: 5 }) }),
|
|
342
|
+
/* @__PURE__ */ jsx("span", { children: "Refresh failed" })
|
|
343
|
+
] }),
|
|
344
|
+
/* @__PURE__ */ jsx("div", { ref: refreshingRef, style: { opacity: 0 }, className: "shared:absolute shared:flex shared:items-center shared:justify-center shared:py-1 shared:transition-opacity shared:duration-200", children: /* @__PURE__ */ jsx(Spinner, {}) }),
|
|
345
|
+
/* @__PURE__ */ jsxs("div", { ref: readyRef, style: { opacity: 0 }, className: "shared:absolute shared:flex shared:items-center shared:justify-center shared:gap-2 shared:text-sm shared:text-primary shared:font-medium shared:py-1 shared:transition-opacity shared:duration-200", children: [
|
|
346
|
+
/* @__PURE__ */ jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", className: "shared:-rotate-90", children: /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: 10, className: "shared:text-primary", stroke: "currentColor", strokeWidth: 2.5, fill: "none" }) }),
|
|
347
|
+
/* @__PURE__ */ jsx("span", { children: "Release to refresh" })
|
|
348
|
+
] }),
|
|
349
|
+
/* @__PURE__ */ jsx("div", { ref: pullingRef, style: { opacity: 0 }, className: "shared:absolute shared:flex shared:items-center shared:justify-center shared:py-1 shared:transition-opacity shared:duration-200", children: /* @__PURE__ */ jsxs("div", { ref: pullingScaleRef, className: "shared:flex shared:items-center shared:justify-center shared:gap-2 shared:text-sm shared:text-muted-foreground shared:font-medium shared:transition-transform shared:duration-75", style: { transformOrigin: "center" }, children: [
|
|
350
|
+
/* @__PURE__ */ jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", style: { transform: "rotate(-90deg)", transformOrigin: "center" }, children: [
|
|
351
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: 10, className: "shared:text-muted/30", stroke: "currentColor", strokeWidth: 2.5, fill: "none" }),
|
|
352
|
+
/* @__PURE__ */ jsx("circle", { ref: circleProgressRef, cx: "12", cy: "12", r: 10, className: "shared:text-primary shared:transition-all shared:duration-75", stroke: "currentColor", strokeWidth: 2.5, fill: "none", strokeDasharray: 2 * Math.PI * 10, strokeLinecap: "round" })
|
|
353
|
+
] }),
|
|
354
|
+
/* @__PURE__ */ jsx("span", { children: "Pull down " }),
|
|
355
|
+
/* @__PURE__ */ jsx("span", { ref: percentTextRef, className: "shared:text-primary shared:font-bold", children: "0%" })
|
|
356
|
+
] }) })
|
|
357
|
+
] })
|
|
358
|
+
}
|
|
359
|
+
),
|
|
360
|
+
/* @__PURE__ */ jsx(
|
|
361
|
+
"div",
|
|
362
|
+
{
|
|
363
|
+
ref: containerRef,
|
|
364
|
+
onTouchStart: handleTouchStart,
|
|
365
|
+
onMouseDown: handleMouseDown,
|
|
366
|
+
className: `shared:overflow-y-auto shared:w-full shared:h-full shared:scrollbar-thin shared:will-change-transform`,
|
|
367
|
+
style: {
|
|
368
|
+
transform: "translateY(0px) translateZ(0)",
|
|
369
|
+
transition: "transform 400ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
370
|
+
},
|
|
371
|
+
children
|
|
372
|
+
}
|
|
373
|
+
)
|
|
374
|
+
] });
|
|
375
|
+
});
|
|
376
|
+
export {
|
|
377
|
+
PullToRefresh
|
|
378
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState, useEffect } from "react";
|
|
3
|
+
function RenderInView({
|
|
4
|
+
children,
|
|
5
|
+
rootMargin = "0px",
|
|
6
|
+
threshold = 0,
|
|
7
|
+
once = true,
|
|
8
|
+
className,
|
|
9
|
+
pluginName,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
const ref = useRef(null);
|
|
13
|
+
const [visible, setVisible] = useState(false);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const el = ref.current;
|
|
16
|
+
if (!el) return;
|
|
17
|
+
const observer = new IntersectionObserver(
|
|
18
|
+
([entry]) => {
|
|
19
|
+
if (entry.isIntersecting) {
|
|
20
|
+
setVisible(true);
|
|
21
|
+
if (once) observer.disconnect();
|
|
22
|
+
} else if (!once) {
|
|
23
|
+
setVisible(false);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{ rootMargin, threshold }
|
|
27
|
+
);
|
|
28
|
+
observer.observe(el);
|
|
29
|
+
return () => observer.disconnect();
|
|
30
|
+
}, [rootMargin, threshold, once]);
|
|
31
|
+
return /* @__PURE__ */ jsx("div", { ...props, ref, "data-plugin": pluginName, className, children: visible ? children : null });
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
RenderInView
|
|
35
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMediaQuery, SCREENS } from "../../hooks/use-mobile.js";
|
|
3
|
+
import { useMobileBackDialog } from "../../hooks/use-mobile-back-dialog.js";
|
|
4
|
+
import { createContext, forwardRef, useState, useImperativeHandle, useContext } from "react";
|
|
5
|
+
import "@quan-erp/shared-frontend-core";
|
|
6
|
+
import "../ui/accordion.js";
|
|
7
|
+
import "../ui/alert.js";
|
|
8
|
+
import "../ui/avatar.js";
|
|
9
|
+
import "../ui/badge.js";
|
|
10
|
+
import "../ui/breadcrumb.js";
|
|
11
|
+
import "../ui/button-group.js";
|
|
12
|
+
import "../ui/button.js";
|
|
13
|
+
import "lucide-react";
|
|
14
|
+
import "react-day-picker";
|
|
15
|
+
import { cn } from "../../lib/utils.js";
|
|
16
|
+
import "../ui/popover.js";
|
|
17
|
+
import { Drawer, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger } from "../ui/drawer.js";
|
|
18
|
+
import "../ui/select.js";
|
|
19
|
+
import "@icon-park/react";
|
|
20
|
+
import "../ui/carousel.js";
|
|
21
|
+
import "../ui/chart.js";
|
|
22
|
+
import "../ui/checkbox.js";
|
|
23
|
+
import "@radix-ui/react-collapsible";
|
|
24
|
+
import "../ui/command.js";
|
|
25
|
+
import "../ui/context-menu.js";
|
|
26
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger } from "../ui/dialog.js";
|
|
27
|
+
import "../ui/dropdown-menu.js";
|
|
28
|
+
import "../ui/field.js";
|
|
29
|
+
import "../ui/form.js";
|
|
30
|
+
import "../ui/hover-card.js";
|
|
31
|
+
import "../ui/input-group.js";
|
|
32
|
+
import "../ui/input-otp.js";
|
|
33
|
+
import "../ui/input.js";
|
|
34
|
+
import "../ui/item.js";
|
|
35
|
+
import "@radix-ui/react-label";
|
|
36
|
+
import "../ui/menubar.js";
|
|
37
|
+
import "../ui/navigation-menu.js";
|
|
38
|
+
import "../ui/pagination.js";
|
|
39
|
+
import "../ui/progress.js";
|
|
40
|
+
import "../ui/radio-group.js";
|
|
41
|
+
import "react-resizable-panels";
|
|
42
|
+
import "../ui/scroll-area.js";
|
|
43
|
+
import "@radix-ui/react-separator";
|
|
44
|
+
import { Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetTitle, SheetTrigger } from "../ui/sheet.js";
|
|
45
|
+
import "../ui/sidebar.js";
|
|
46
|
+
import "../ui/slider.js";
|
|
47
|
+
import "next-themes";
|
|
48
|
+
import "sonner";
|
|
49
|
+
import "../ui/spinner.js";
|
|
50
|
+
import "../ui/switch.js";
|
|
51
|
+
import "../ui/table.js";
|
|
52
|
+
import "../ui/tabs.js";
|
|
53
|
+
import "../ui/textarea.js";
|
|
54
|
+
import "../ui/toggle-group.js";
|
|
55
|
+
import "../ui/toggle.js";
|
|
56
|
+
import "@radix-ui/react-tooltip";
|
|
57
|
+
import "@radix-ui/react-alert-dialog";
|
|
58
|
+
import "@radix-ui/react-dialog";
|
|
59
|
+
import "uuid";
|
|
60
|
+
const DesktopDialogType = {
|
|
61
|
+
SHEET: "SHEET",
|
|
62
|
+
DIALOG: "DIALOG"
|
|
63
|
+
};
|
|
64
|
+
const ResponsiveDialogContext = createContext(void 0);
|
|
65
|
+
const useDialogType = () => {
|
|
66
|
+
const context = useContext(ResponsiveDialogContext);
|
|
67
|
+
if (!context) throw new Error("useDialogType must be used inside ResponsiveDialog");
|
|
68
|
+
return context;
|
|
69
|
+
};
|
|
70
|
+
const UncontrolledResponsiveDialog = forwardRef((props, ref) => {
|
|
71
|
+
const [open, setOpenChange] = useState(false);
|
|
72
|
+
useImperativeHandle(ref, () => {
|
|
73
|
+
return {
|
|
74
|
+
open: () => setOpenChange(true),
|
|
75
|
+
close: () => setOpenChange(false),
|
|
76
|
+
getStatus: () => open
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
return /* @__PURE__ */ jsx(ResponsiveDialog, { ...props, open, onOpenChange: setOpenChange });
|
|
80
|
+
});
|
|
81
|
+
function ResponsiveDialog({
|
|
82
|
+
open,
|
|
83
|
+
onOpenChange,
|
|
84
|
+
children,
|
|
85
|
+
trigger,
|
|
86
|
+
desktopDialogType = DesktopDialogType.DIALOG,
|
|
87
|
+
pluginName,
|
|
88
|
+
trackBrowserBack = true,
|
|
89
|
+
...props
|
|
90
|
+
}) {
|
|
91
|
+
const isMobile = useMediaQuery(SCREENS.md);
|
|
92
|
+
const type = isMobile ? "mobile" : "desktop";
|
|
93
|
+
useMobileBackDialog({ open, onOpenChange, enable: trackBrowserBack });
|
|
94
|
+
if (isMobile) {
|
|
95
|
+
return /* @__PURE__ */ jsx(ResponsiveDialogContext.Provider, { value: { type, desktopDialogType }, children: /* @__PURE__ */ jsx(Drawer, { open, "data-plugin": pluginName, onOpenChange, direction: "bottom", shouldScaleBackground: false, repositionInputs: false, ...props, children }) });
|
|
96
|
+
}
|
|
97
|
+
if (desktopDialogType === DesktopDialogType.DIALOG) {
|
|
98
|
+
return /* @__PURE__ */ jsx(ResponsiveDialogContext.Provider, { value: { type, desktopDialogType }, children: /* @__PURE__ */ jsx(Dialog, { open, "data-plugin": pluginName, onOpenChange, ...props, children }) });
|
|
99
|
+
}
|
|
100
|
+
return /* @__PURE__ */ jsx(ResponsiveDialogContext.Provider, { value: { type, desktopDialogType }, children: /* @__PURE__ */ jsx(Sheet, { open, "data-plugin": pluginName, onOpenChange, ...props, children }) });
|
|
101
|
+
}
|
|
102
|
+
function ResponsiveHeader({ children, pluginName, className }) {
|
|
103
|
+
const dialog = useDialogType();
|
|
104
|
+
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerHeader, { "data-plugin": pluginName, className, children });
|
|
105
|
+
if (dialog.desktopDialogType == DesktopDialogType.DIALOG)
|
|
106
|
+
return /* @__PURE__ */ jsx(DialogHeader, { "data-plugin": pluginName, className, children });
|
|
107
|
+
return /* @__PURE__ */ jsx(SheetHeader, { "data-plugin": pluginName, className, children });
|
|
108
|
+
}
|
|
109
|
+
function ResponsiveTitle({ children, className, pluginName }) {
|
|
110
|
+
const dialog = useDialogType();
|
|
111
|
+
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerTitle, { className, "data-plugin": pluginName, children });
|
|
112
|
+
if (dialog.desktopDialogType == DesktopDialogType.DIALOG)
|
|
113
|
+
return /* @__PURE__ */ jsx(DialogTitle, { className, "data-plugin": pluginName, children });
|
|
114
|
+
return /* @__PURE__ */ jsx(SheetTitle, { className, "data-plugin": pluginName, children });
|
|
115
|
+
}
|
|
116
|
+
function ResponsiveContent({ children, className, style, pluginName, showCloseButton }) {
|
|
117
|
+
const dialog = useDialogType();
|
|
118
|
+
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerContent, { style, "data-plugin": pluginName, className: cn("shared:p-3 shared:rounded-t-3xl shared:cupertino-corner shared:fixed shared:bottom-0 shared:left-0 shared:right-0 shared:low-end-device:duration-0! shared:mid-device:duration-75! shared:low-end-device:animation-duration-[0s]! shared:mid-device:animation-duration-[100ms]!", className), children });
|
|
119
|
+
if (dialog.desktopDialogType == DesktopDialogType.DIALOG)
|
|
120
|
+
return /* @__PURE__ */ jsx(DialogContent, { style, className: cn("shared:low-end-device:duration-0! shared:mid-device:duration-75! shared:low-end-device:animation-duration-[0s]! shared:mid-device:animation-duration-[100ms]!", className), "data-plugin": pluginName, showCloseButton, children });
|
|
121
|
+
return /* @__PURE__ */ jsx(SheetContent, { style, className: cn("shared:low-end-device:duration-0! shared:mid-device:duration-75! shared:low-end-device:animation-duration-[0s]! shared:mid-device:animation-duration-[100ms]!", className), "data-plugin": pluginName, showCloseButton, children });
|
|
122
|
+
}
|
|
123
|
+
function ResponsiveTrigger({ children, className, pluginName }) {
|
|
124
|
+
const dialog = useDialogType();
|
|
125
|
+
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerTrigger, { asChild: true, "data-plugin": pluginName, className, children });
|
|
126
|
+
if (dialog.desktopDialogType == DesktopDialogType.DIALOG)
|
|
127
|
+
return /* @__PURE__ */ jsx(DialogTrigger, { asChild: true, "data-plugin": pluginName, className, children });
|
|
128
|
+
return /* @__PURE__ */ jsx(SheetTrigger, { asChild: true, "data-plugin": pluginName, className, children });
|
|
129
|
+
}
|
|
130
|
+
function ResponsiveDescription({ children, className, pluginName }) {
|
|
131
|
+
const dialog = useDialogType();
|
|
132
|
+
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerDescription, { className, children });
|
|
133
|
+
if (dialog.desktopDialogType == DesktopDialogType.DIALOG)
|
|
134
|
+
return /* @__PURE__ */ jsx(DialogDescription, { asChild: true, "data-plugin": pluginName, className, children });
|
|
135
|
+
return /* @__PURE__ */ jsx(SheetDescription, { asChild: true, "data-plugin": pluginName, className, children });
|
|
136
|
+
}
|
|
137
|
+
function ResponsiveFooter({ children, className, pluginName }) {
|
|
138
|
+
const dialog = useDialogType();
|
|
139
|
+
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerFooter, { "data-plugin": pluginName, className, children });
|
|
140
|
+
if (dialog.desktopDialogType == DesktopDialogType.DIALOG)
|
|
141
|
+
return /* @__PURE__ */ jsx(DialogFooter, { "data-plugin": pluginName, className, children });
|
|
142
|
+
return /* @__PURE__ */ jsx(SheetFooter, { "data-plugin": pluginName, className, children });
|
|
143
|
+
}
|
|
144
|
+
function ResponsiveOverlay({ children, className, pluginName }) {
|
|
145
|
+
const dialog = useDialogType();
|
|
146
|
+
if (dialog.type === "mobile") return /* @__PURE__ */ jsx(DrawerOverlay, { "data-plugin": pluginName, className, children });
|
|
147
|
+
if (dialog.desktopDialogType == DesktopDialogType.DIALOG)
|
|
148
|
+
return /* @__PURE__ */ jsx(DialogOverlay, { "data-plugin": pluginName, className, children });
|
|
149
|
+
return /* @__PURE__ */ jsx(SheetOverlay, { "data-plugin": pluginName, className, children });
|
|
150
|
+
}
|
|
151
|
+
export {
|
|
152
|
+
DesktopDialogType,
|
|
153
|
+
ResponsiveContent,
|
|
154
|
+
ResponsiveDescription,
|
|
155
|
+
ResponsiveDialog,
|
|
156
|
+
ResponsiveFooter,
|
|
157
|
+
ResponsiveHeader,
|
|
158
|
+
ResponsiveOverlay,
|
|
159
|
+
ResponsiveTitle,
|
|
160
|
+
ResponsiveTrigger,
|
|
161
|
+
UncontrolledResponsiveDialog,
|
|
162
|
+
useDialogType
|
|
163
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
function SafeArea({ children, className = "" }) {
|
|
4
|
+
return /* @__PURE__ */ jsx("div", { className: cn(`shared:pt-(--safe-area-inset-top) shared:pb-(--safe-area-inset-bottom) shared:pl-(--safe-area-inset-left) shared:pr-(--safe-area-inset-right) shared:bg-white shared:min-h-screen shared:h-full`, className), children });
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
SafeArea
|
|
8
|
+
};
|