@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,604 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { PanelLeft } from "lucide-react";
|
|
6
|
+
import { useMediaQuery } from "../../hooks/use-mobile.js";
|
|
7
|
+
import { cn } from "../../lib/utils.js";
|
|
8
|
+
import { Button } from "./button.js";
|
|
9
|
+
import { Input } from "./input.js";
|
|
10
|
+
import { Separator } from "./separator.js";
|
|
11
|
+
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetDescription } from "./sheet.js";
|
|
12
|
+
import { Skeleton } from "./skeleton.js";
|
|
13
|
+
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from "./tooltip.js";
|
|
14
|
+
const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
15
|
+
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
16
|
+
const SIDEBAR_WIDTH = "16rem";
|
|
17
|
+
const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
18
|
+
const SIDEBAR_WIDTH_ICON = "3rem";
|
|
19
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
20
|
+
const SidebarContext = React.createContext(null);
|
|
21
|
+
function useSidebar() {
|
|
22
|
+
const context = React.useContext(SidebarContext);
|
|
23
|
+
if (!context) {
|
|
24
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
25
|
+
}
|
|
26
|
+
return context;
|
|
27
|
+
}
|
|
28
|
+
const SidebarProvider = React.forwardRef(
|
|
29
|
+
({
|
|
30
|
+
defaultOpen = true,
|
|
31
|
+
open: openProp,
|
|
32
|
+
onOpenChange: setOpenProp,
|
|
33
|
+
className,
|
|
34
|
+
style,
|
|
35
|
+
children,
|
|
36
|
+
...props
|
|
37
|
+
}, ref) => {
|
|
38
|
+
const isMobile = useMediaQuery();
|
|
39
|
+
const [openMobile, setOpenMobile] = React.useState(false);
|
|
40
|
+
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
41
|
+
const open = openProp ?? _open;
|
|
42
|
+
const setOpen = React.useCallback(
|
|
43
|
+
(value) => {
|
|
44
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
45
|
+
if (setOpenProp) {
|
|
46
|
+
setOpenProp(openState);
|
|
47
|
+
} else {
|
|
48
|
+
_setOpen(openState);
|
|
49
|
+
}
|
|
50
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
51
|
+
},
|
|
52
|
+
[setOpenProp, open]
|
|
53
|
+
);
|
|
54
|
+
const toggleSidebar = React.useCallback(() => {
|
|
55
|
+
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
56
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
57
|
+
React.useEffect(() => {
|
|
58
|
+
const handleKeyDown = (event) => {
|
|
59
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
toggleSidebar();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
65
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
66
|
+
}, [toggleSidebar]);
|
|
67
|
+
const state = open ? "expanded" : "collapsed";
|
|
68
|
+
const contextValue = React.useMemo(
|
|
69
|
+
() => ({
|
|
70
|
+
state,
|
|
71
|
+
open,
|
|
72
|
+
setOpen,
|
|
73
|
+
isMobile,
|
|
74
|
+
openMobile,
|
|
75
|
+
setOpenMobile,
|
|
76
|
+
toggleSidebar
|
|
77
|
+
}),
|
|
78
|
+
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
79
|
+
);
|
|
80
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
style: {
|
|
84
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
85
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
86
|
+
...style
|
|
87
|
+
},
|
|
88
|
+
className: cn(
|
|
89
|
+
"shared:group/sidebar-wrapper shared:flex shared:min-h-svh shared:w-full shared:has-[[data-variant=inset]]:bg-sidebar",
|
|
90
|
+
className
|
|
91
|
+
),
|
|
92
|
+
ref,
|
|
93
|
+
...props,
|
|
94
|
+
children
|
|
95
|
+
}
|
|
96
|
+
) }) });
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
SidebarProvider.displayName = "SidebarProvider";
|
|
100
|
+
const Sidebar = React.forwardRef(
|
|
101
|
+
({
|
|
102
|
+
side = "left",
|
|
103
|
+
variant = "sidebar",
|
|
104
|
+
collapsible = "offcanvas",
|
|
105
|
+
className,
|
|
106
|
+
children,
|
|
107
|
+
...props
|
|
108
|
+
}, ref) => {
|
|
109
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
110
|
+
if (collapsible === "none") {
|
|
111
|
+
return /* @__PURE__ */ jsx(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
className: cn(
|
|
115
|
+
"shared:flex shared:h-full shared:w-[--sidebar-width] shared:flex-col shared:bg-sidebar shared:text-sidebar-foreground",
|
|
116
|
+
className
|
|
117
|
+
),
|
|
118
|
+
ref,
|
|
119
|
+
...props,
|
|
120
|
+
children
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
if (isMobile) {
|
|
125
|
+
return /* @__PURE__ */ jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs(
|
|
126
|
+
SheetContent,
|
|
127
|
+
{
|
|
128
|
+
"data-sidebar": "sidebar",
|
|
129
|
+
"data-mobile": "true",
|
|
130
|
+
className: "shared:w-[--sidebar-width] shared:bg-sidebar shared:p-0 shared:text-sidebar-foreground [&>shared:button]:hidden",
|
|
131
|
+
style: {
|
|
132
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
133
|
+
},
|
|
134
|
+
side,
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ jsxs(SheetHeader, { className: "shared:sr-only", children: [
|
|
137
|
+
/* @__PURE__ */ jsx(SheetTitle, { children: "Sidebar" }),
|
|
138
|
+
/* @__PURE__ */ jsx(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
139
|
+
] }),
|
|
140
|
+
/* @__PURE__ */ jsx("div", { className: "shared:flex shared:h-full shared:w-full shared:flex-col", children })
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
) });
|
|
144
|
+
}
|
|
145
|
+
return /* @__PURE__ */ jsxs(
|
|
146
|
+
"div",
|
|
147
|
+
{
|
|
148
|
+
ref,
|
|
149
|
+
className: "shared:group shared:peer shared:hidden shared:text-sidebar-foreground shared:md:block",
|
|
150
|
+
"data-state": state,
|
|
151
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
152
|
+
"data-variant": variant,
|
|
153
|
+
"data-side": side,
|
|
154
|
+
children: [
|
|
155
|
+
/* @__PURE__ */ jsx(
|
|
156
|
+
"div",
|
|
157
|
+
{
|
|
158
|
+
className: cn(
|
|
159
|
+
"shared:relative shared:w-[--sidebar-width] shared:bg-transparent shared:transition-[width] shared:duration-200 shared:ease-linear",
|
|
160
|
+
"shared:group-data-[collapsible=offcanvas]:w-0",
|
|
161
|
+
"shared:group-data-[side=right]:rotate-180",
|
|
162
|
+
variant === "floating" || variant === "inset" ? "shared:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]" : "shared:group-data-[collapsible=icon]:w-[--sidebar-width-icon]"
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
/* @__PURE__ */ jsx(
|
|
167
|
+
"div",
|
|
168
|
+
{
|
|
169
|
+
className: cn(
|
|
170
|
+
"shared:fixed shared:inset-y-0 shared:z-10 shared:hidden shared:h-svh shared:w-[--sidebar-width] shared:transition-[left,right,width] shared:duration-200 shared:ease-linear shared:md:flex",
|
|
171
|
+
side === "left" ? "shared:left-0 shared:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "shared:right-0 shared:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
172
|
+
// Adjust the padding for floating and inset variants.
|
|
173
|
+
variant === "floating" || variant === "inset" ? "shared:p-2 shared:group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]" : "shared:group-data-[collapsible=icon]:w-[--sidebar-width-icon] shared:group-data-[side=left]:border-r shared:group-data-[side=right]:border-l",
|
|
174
|
+
className
|
|
175
|
+
),
|
|
176
|
+
...props,
|
|
177
|
+
children: /* @__PURE__ */ jsx(
|
|
178
|
+
"div",
|
|
179
|
+
{
|
|
180
|
+
"data-sidebar": "sidebar",
|
|
181
|
+
className: "shared:flex shared:h-full shared:w-full shared:flex-col shared:bg-sidebar shared:group-data-[variant=floating]:rounded-lg shared:group-data-[variant=floating]:border shared:group-data-[variant=floating]:border-sidebar-border shared:group-data-[variant=floating]:shadow",
|
|
182
|
+
children
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
Sidebar.displayName = "Sidebar";
|
|
193
|
+
const SidebarTrigger = React.forwardRef(({ className, onClick, ...props }, ref) => {
|
|
194
|
+
const { toggleSidebar } = useSidebar();
|
|
195
|
+
return /* @__PURE__ */ jsxs(
|
|
196
|
+
Button,
|
|
197
|
+
{
|
|
198
|
+
ref,
|
|
199
|
+
"data-sidebar": "trigger",
|
|
200
|
+
variant: "ghost",
|
|
201
|
+
size: "icon",
|
|
202
|
+
className: cn("shared:h-7 shared:w-7", className),
|
|
203
|
+
onClick: (event) => {
|
|
204
|
+
onClick?.(event);
|
|
205
|
+
toggleSidebar();
|
|
206
|
+
},
|
|
207
|
+
...props,
|
|
208
|
+
children: [
|
|
209
|
+
/* @__PURE__ */ jsx(PanelLeft, {}),
|
|
210
|
+
/* @__PURE__ */ jsx("span", { className: "shared:sr-only", children: "Toggle Sidebar" })
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
});
|
|
215
|
+
SidebarTrigger.displayName = "SidebarTrigger";
|
|
216
|
+
const SidebarRail = React.forwardRef(({ className, ...props }, ref) => {
|
|
217
|
+
const { toggleSidebar } = useSidebar();
|
|
218
|
+
return /* @__PURE__ */ jsx(
|
|
219
|
+
"button",
|
|
220
|
+
{
|
|
221
|
+
ref,
|
|
222
|
+
"data-sidebar": "rail",
|
|
223
|
+
"aria-label": "Toggle Sidebar",
|
|
224
|
+
tabIndex: -1,
|
|
225
|
+
onClick: toggleSidebar,
|
|
226
|
+
title: "Toggle Sidebar",
|
|
227
|
+
className: cn(
|
|
228
|
+
"shared:absolute shared:inset-y-0 shared:z-20 shared:hidden shared:w-4 shared:-translate-x-1/2 shared:transition-all shared:ease-linear shared:after:absolute shared:after:inset-y-0 shared:after:left-1/2 shared:after:w-[2px] shared:hover:after:bg-sidebar-border shared:group-data-[side=left]:-right-4 shared:group-data-[side=right]:left-0 shared:sm:flex",
|
|
229
|
+
"shared:[[data-side=left]_&]:cursor-w-resize shared:[[data-side=right]_&]:cursor-e-resize",
|
|
230
|
+
"shared:[[data-side=left][data-state=collapsed]_&]:cursor-e-resize shared:[[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
231
|
+
"shared:group-data-[collapsible=offcanvas]:translate-x-0 shared:group-data-[collapsible=offcanvas]:after:left-full shared:group-data-[collapsible=offcanvas]:hover:bg-sidebar",
|
|
232
|
+
"shared:[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
233
|
+
"shared:[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
234
|
+
className
|
|
235
|
+
),
|
|
236
|
+
...props
|
|
237
|
+
}
|
|
238
|
+
);
|
|
239
|
+
});
|
|
240
|
+
SidebarRail.displayName = "SidebarRail";
|
|
241
|
+
const SidebarInset = React.forwardRef(({ className, ...props }, ref) => {
|
|
242
|
+
return /* @__PURE__ */ jsx(
|
|
243
|
+
"main",
|
|
244
|
+
{
|
|
245
|
+
ref,
|
|
246
|
+
className: cn(
|
|
247
|
+
"shared:relative shared:flex shared:w-full shared:flex-1 shared:flex-col shared:bg-background",
|
|
248
|
+
"shared:md:peer-data-[variant=inset]:m-2 shared:md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 shared:md:peer-data-[variant=inset]:ml-0 shared:md:peer-data-[variant=inset]:rounded-xl shared:md:peer-data-[variant=inset]:shadow",
|
|
249
|
+
className
|
|
250
|
+
),
|
|
251
|
+
...props
|
|
252
|
+
}
|
|
253
|
+
);
|
|
254
|
+
});
|
|
255
|
+
SidebarInset.displayName = "SidebarInset";
|
|
256
|
+
const SidebarInput = React.forwardRef(({ className, ...props }, ref) => {
|
|
257
|
+
return /* @__PURE__ */ jsx(
|
|
258
|
+
Input,
|
|
259
|
+
{
|
|
260
|
+
ref,
|
|
261
|
+
"data-sidebar": "input",
|
|
262
|
+
className: cn(
|
|
263
|
+
"shared:h-8 shared:w-full shared:bg-background shared:shadow-none shared:focus-visible:ring-2 shared:focus-visible:ring-sidebar-ring",
|
|
264
|
+
className
|
|
265
|
+
),
|
|
266
|
+
...props
|
|
267
|
+
}
|
|
268
|
+
);
|
|
269
|
+
});
|
|
270
|
+
SidebarInput.displayName = "SidebarInput";
|
|
271
|
+
const SidebarHeader = React.forwardRef(({ className, ...props }, ref) => {
|
|
272
|
+
return /* @__PURE__ */ jsx(
|
|
273
|
+
"div",
|
|
274
|
+
{
|
|
275
|
+
ref,
|
|
276
|
+
"data-sidebar": "header",
|
|
277
|
+
className: cn("shared:flex shared:flex-col shared:gap-2 shared:p-2", className),
|
|
278
|
+
...props
|
|
279
|
+
}
|
|
280
|
+
);
|
|
281
|
+
});
|
|
282
|
+
SidebarHeader.displayName = "SidebarHeader";
|
|
283
|
+
const SidebarFooter = React.forwardRef(({ className, ...props }, ref) => {
|
|
284
|
+
return /* @__PURE__ */ jsx(
|
|
285
|
+
"div",
|
|
286
|
+
{
|
|
287
|
+
ref,
|
|
288
|
+
"data-sidebar": "footer",
|
|
289
|
+
className: cn("shared:flex shared:flex-col shared:gap-2 shared:p-2", className),
|
|
290
|
+
...props
|
|
291
|
+
}
|
|
292
|
+
);
|
|
293
|
+
});
|
|
294
|
+
SidebarFooter.displayName = "SidebarFooter";
|
|
295
|
+
const SidebarSeparator = React.forwardRef(({ className, ...props }, ref) => {
|
|
296
|
+
return /* @__PURE__ */ jsx(
|
|
297
|
+
Separator,
|
|
298
|
+
{
|
|
299
|
+
ref,
|
|
300
|
+
"data-sidebar": "separator",
|
|
301
|
+
className: cn("shared:mx-2 shared:w-auto shared:bg-sidebar-border", className),
|
|
302
|
+
...props
|
|
303
|
+
}
|
|
304
|
+
);
|
|
305
|
+
});
|
|
306
|
+
SidebarSeparator.displayName = "SidebarSeparator";
|
|
307
|
+
const SidebarContent = React.forwardRef(({ className, ...props }, ref) => {
|
|
308
|
+
return /* @__PURE__ */ jsx(
|
|
309
|
+
"div",
|
|
310
|
+
{
|
|
311
|
+
ref,
|
|
312
|
+
"data-sidebar": "content",
|
|
313
|
+
className: cn(
|
|
314
|
+
"shared:flex shared:min-h-0 shared:flex-1 shared:flex-col shared:gap-2 shared:overflow-auto shared:group-data-[collapsible=icon]:overflow-hidden",
|
|
315
|
+
className
|
|
316
|
+
),
|
|
317
|
+
...props
|
|
318
|
+
}
|
|
319
|
+
);
|
|
320
|
+
});
|
|
321
|
+
SidebarContent.displayName = "SidebarContent";
|
|
322
|
+
const SidebarGroup = React.forwardRef(({ className, ...props }, ref) => {
|
|
323
|
+
return /* @__PURE__ */ jsx(
|
|
324
|
+
"div",
|
|
325
|
+
{
|
|
326
|
+
ref,
|
|
327
|
+
"data-sidebar": "group",
|
|
328
|
+
className: cn("shared:relative shared:flex shared:w-full shared:min-w-0 shared:flex-col shared:p-2", className),
|
|
329
|
+
...props
|
|
330
|
+
}
|
|
331
|
+
);
|
|
332
|
+
});
|
|
333
|
+
SidebarGroup.displayName = "SidebarGroup";
|
|
334
|
+
const SidebarGroupLabel = React.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
335
|
+
const Comp = asChild ? Slot : "div";
|
|
336
|
+
return /* @__PURE__ */ jsx(
|
|
337
|
+
Comp,
|
|
338
|
+
{
|
|
339
|
+
ref,
|
|
340
|
+
"data-sidebar": "group-label",
|
|
341
|
+
className: cn(
|
|
342
|
+
"shared:flex shared:h-8 shared:shrink-0 shared:items-center shared:rounded-md shared:px-2 shared:text-xs shared:font-medium shared:text-sidebar-foreground/70 shared:outline-none shared:ring-sidebar-ring shared:transition-[margin,opacity] shared:duration-200 shared:ease-linear shared:focus-visible:ring-2 [&>shared:svg]:size-4 [&>shared:svg]:shrink-0",
|
|
343
|
+
"shared:group-data-[collapsible=icon]:-mt-8 shared:group-data-[collapsible=icon]:opacity-0",
|
|
344
|
+
className
|
|
345
|
+
),
|
|
346
|
+
...props
|
|
347
|
+
}
|
|
348
|
+
);
|
|
349
|
+
});
|
|
350
|
+
SidebarGroupLabel.displayName = "SidebarGroupLabel";
|
|
351
|
+
const SidebarGroupAction = React.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
352
|
+
const Comp = asChild ? Slot : "button";
|
|
353
|
+
return /* @__PURE__ */ jsx(
|
|
354
|
+
Comp,
|
|
355
|
+
{
|
|
356
|
+
ref,
|
|
357
|
+
"data-sidebar": "group-action",
|
|
358
|
+
className: cn(
|
|
359
|
+
"shared:absolute shared:right-3 shared:top-3.5 shared:flex shared:aspect-square shared:w-5 shared:items-center shared:justify-center shared:rounded-md shared:p-0 shared:text-sidebar-foreground shared:outline-none shared:ring-sidebar-ring shared:transition-transform shared:hover:bg-sidebar-accent shared:hover:text-sidebar-accent-foreground shared:focus-visible:ring-2 [&>shared:svg]:size-4 [&>shared:svg]:shrink-0",
|
|
360
|
+
// Increases the hit area of the button on mobile.
|
|
361
|
+
"shared:after:absolute shared:after:-inset-2 shared:after:md:hidden",
|
|
362
|
+
"shared:group-data-[collapsible=icon]:hidden",
|
|
363
|
+
className
|
|
364
|
+
),
|
|
365
|
+
...props
|
|
366
|
+
}
|
|
367
|
+
);
|
|
368
|
+
});
|
|
369
|
+
SidebarGroupAction.displayName = "SidebarGroupAction";
|
|
370
|
+
const SidebarGroupContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
371
|
+
"div",
|
|
372
|
+
{
|
|
373
|
+
ref,
|
|
374
|
+
"data-sidebar": "group-content",
|
|
375
|
+
className: cn("shared:w-full shared:text-sm", className),
|
|
376
|
+
...props
|
|
377
|
+
}
|
|
378
|
+
));
|
|
379
|
+
SidebarGroupContent.displayName = "SidebarGroupContent";
|
|
380
|
+
const SidebarMenu = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
381
|
+
"ul",
|
|
382
|
+
{
|
|
383
|
+
ref,
|
|
384
|
+
"data-sidebar": "menu",
|
|
385
|
+
className: cn("shared:flex shared:w-full shared:min-w-0 shared:flex-col shared:gap-1", className),
|
|
386
|
+
...props
|
|
387
|
+
}
|
|
388
|
+
));
|
|
389
|
+
SidebarMenu.displayName = "SidebarMenu";
|
|
390
|
+
const SidebarMenuItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
391
|
+
"li",
|
|
392
|
+
{
|
|
393
|
+
ref,
|
|
394
|
+
"data-sidebar": "menu-item",
|
|
395
|
+
className: cn("shared:group/menu-item shared:relative", className),
|
|
396
|
+
...props
|
|
397
|
+
}
|
|
398
|
+
));
|
|
399
|
+
SidebarMenuItem.displayName = "SidebarMenuItem";
|
|
400
|
+
const sidebarMenuButtonVariants = cva(
|
|
401
|
+
"shared:peer/menu-button shared:flex shared:w-full shared:items-center shared:gap-2 shared:overflow-hidden shared:rounded-md shared:p-2 shared:text-left shared:text-sm shared:outline-none shared:ring-sidebar-ring shared:transition-[width,height,padding] shared:hover:bg-sidebar-accent shared:hover:text-sidebar-accent-foreground shared:focus-visible:ring-2 shared:active:bg-sidebar-accent shared:active:text-sidebar-accent-foreground shared:disabled:pointer-events-none shared:disabled:opacity-50 shared:group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 shared:aria-disabled:pointer-events-none shared:aria-disabled:opacity-50 shared:data-[active=true]:bg-sidebar-accent shared:data-[active=true]:font-medium shared:data-[active=true]:text-sidebar-accent-foreground shared:data-[state=open]:hover:bg-sidebar-accent shared:data-[state=open]:hover:text-sidebar-accent-foreground shared:group-data-[collapsible=icon]:!size-8 shared:group-data-[collapsible=icon]:!p-2 [&>shared:span:last-child]:truncate [&>shared:svg]:size-4 [&>shared:svg]:shrink-0",
|
|
402
|
+
{
|
|
403
|
+
variants: {
|
|
404
|
+
variant: {
|
|
405
|
+
default: "shared:hover:bg-sidebar-accent shared:hover:text-sidebar-accent-foreground",
|
|
406
|
+
outline: "shared:bg-background shared:shadow-[0_0_0_1px_hsl(var(--sidebar-border))] shared:hover:bg-sidebar-accent shared:hover:text-sidebar-accent-foreground shared:hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
407
|
+
},
|
|
408
|
+
size: {
|
|
409
|
+
default: "shared:h-8 shared:text-sm",
|
|
410
|
+
sm: "shared:h-7 shared:text-xs",
|
|
411
|
+
lg: "shared:h-12 shared:text-sm shared:group-data-[collapsible=icon]:!p-0"
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
defaultVariants: {
|
|
415
|
+
variant: "default",
|
|
416
|
+
size: "default"
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
);
|
|
420
|
+
const SidebarMenuButton = React.forwardRef(
|
|
421
|
+
({
|
|
422
|
+
asChild = false,
|
|
423
|
+
isActive = false,
|
|
424
|
+
variant = "default",
|
|
425
|
+
size = "default",
|
|
426
|
+
tooltip,
|
|
427
|
+
className,
|
|
428
|
+
...props
|
|
429
|
+
}, ref) => {
|
|
430
|
+
const Comp = asChild ? Slot : "button";
|
|
431
|
+
const { isMobile, state } = useSidebar();
|
|
432
|
+
const button = /* @__PURE__ */ jsx(
|
|
433
|
+
Comp,
|
|
434
|
+
{
|
|
435
|
+
ref,
|
|
436
|
+
"data-sidebar": "menu-button",
|
|
437
|
+
"data-size": size,
|
|
438
|
+
"data-active": isActive,
|
|
439
|
+
className: cn(sidebarMenuButtonVariants({ variant, size }), className),
|
|
440
|
+
...props
|
|
441
|
+
}
|
|
442
|
+
);
|
|
443
|
+
if (!tooltip) {
|
|
444
|
+
return button;
|
|
445
|
+
}
|
|
446
|
+
if (typeof tooltip === "string") {
|
|
447
|
+
tooltip = {
|
|
448
|
+
children: tooltip
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
452
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: button }),
|
|
453
|
+
/* @__PURE__ */ jsx(
|
|
454
|
+
TooltipContent,
|
|
455
|
+
{
|
|
456
|
+
side: "right",
|
|
457
|
+
align: "center",
|
|
458
|
+
hidden: state !== "collapsed" || isMobile,
|
|
459
|
+
...tooltip
|
|
460
|
+
}
|
|
461
|
+
)
|
|
462
|
+
] });
|
|
463
|
+
}
|
|
464
|
+
);
|
|
465
|
+
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
466
|
+
const SidebarMenuAction = React.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
|
|
467
|
+
const Comp = asChild ? Slot : "button";
|
|
468
|
+
return /* @__PURE__ */ jsx(
|
|
469
|
+
Comp,
|
|
470
|
+
{
|
|
471
|
+
ref,
|
|
472
|
+
"data-sidebar": "menu-action",
|
|
473
|
+
className: cn(
|
|
474
|
+
"shared:absolute shared:right-1 shared:top-1.5 shared:flex shared:aspect-square shared:w-5 shared:items-center shared:justify-center shared:rounded-md shared:p-0 shared:text-sidebar-foreground shared:outline-none shared:ring-sidebar-ring shared:transition-transform shared:hover:bg-sidebar-accent shared:hover:text-sidebar-accent-foreground shared:focus-visible:ring-2 shared:peer-hover/menu-button:text-sidebar-accent-foreground [&>shared:svg]:size-4 [&>shared:svg]:shrink-0",
|
|
475
|
+
// Increases the hit area of the button on mobile.
|
|
476
|
+
"shared:after:absolute shared:after:-inset-2 shared:after:md:hidden",
|
|
477
|
+
"shared:peer-data-[size=sm]/menu-button:top-1",
|
|
478
|
+
"shared:peer-data-[size=default]/menu-button:top-1.5",
|
|
479
|
+
"shared:peer-data-[size=lg]/menu-button:top-2.5",
|
|
480
|
+
"shared:group-data-[collapsible=icon]:hidden",
|
|
481
|
+
showOnHover && "shared:group-focus-within/menu-item:opacity-100 shared:group-hover/menu-item:opacity-100 shared:data-[state=open]:opacity-100 shared:peer-data-[active=true]/menu-button:text-sidebar-accent-foreground shared:md:opacity-0",
|
|
482
|
+
className
|
|
483
|
+
),
|
|
484
|
+
...props
|
|
485
|
+
}
|
|
486
|
+
);
|
|
487
|
+
});
|
|
488
|
+
SidebarMenuAction.displayName = "SidebarMenuAction";
|
|
489
|
+
const SidebarMenuBadge = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
490
|
+
"div",
|
|
491
|
+
{
|
|
492
|
+
ref,
|
|
493
|
+
"data-sidebar": "menu-badge",
|
|
494
|
+
className: cn(
|
|
495
|
+
"shared:pointer-events-none shared:absolute shared:right-1 shared:flex shared:h-5 shared:min-w-5 shared:select-none shared:items-center shared:justify-center shared:rounded-md shared:px-1 shared:text-xs shared:font-medium shared:tabular-nums shared:text-sidebar-foreground",
|
|
496
|
+
"shared:peer-hover/menu-button:text-sidebar-accent-foreground shared:peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
|
497
|
+
"shared:peer-data-[size=sm]/menu-button:top-1",
|
|
498
|
+
"shared:peer-data-[size=default]/menu-button:top-1.5",
|
|
499
|
+
"shared:peer-data-[size=lg]/menu-button:top-2.5",
|
|
500
|
+
"shared:group-data-[collapsible=icon]:hidden",
|
|
501
|
+
className
|
|
502
|
+
),
|
|
503
|
+
...props
|
|
504
|
+
}
|
|
505
|
+
));
|
|
506
|
+
SidebarMenuBadge.displayName = "SidebarMenuBadge";
|
|
507
|
+
const SidebarMenuSkeleton = React.forwardRef(({ className, showIcon = false, ...props }, ref) => {
|
|
508
|
+
const width = React.useMemo(() => {
|
|
509
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
510
|
+
}, []);
|
|
511
|
+
return /* @__PURE__ */ jsxs(
|
|
512
|
+
"div",
|
|
513
|
+
{
|
|
514
|
+
ref,
|
|
515
|
+
"data-sidebar": "menu-skeleton",
|
|
516
|
+
className: cn("shared:flex shared:h-8 shared:items-center shared:gap-2 shared:rounded-md shared:px-2", className),
|
|
517
|
+
...props,
|
|
518
|
+
children: [
|
|
519
|
+
showIcon && /* @__PURE__ */ jsx(
|
|
520
|
+
Skeleton,
|
|
521
|
+
{
|
|
522
|
+
className: "shared:size-4 shared:rounded-md",
|
|
523
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
524
|
+
}
|
|
525
|
+
),
|
|
526
|
+
/* @__PURE__ */ jsx(
|
|
527
|
+
Skeleton,
|
|
528
|
+
{
|
|
529
|
+
className: "shared:h-4 shared:max-w-[--skeleton-width] shared:flex-1",
|
|
530
|
+
"data-sidebar": "menu-skeleton-text",
|
|
531
|
+
style: {
|
|
532
|
+
"--skeleton-width": width
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
)
|
|
536
|
+
]
|
|
537
|
+
}
|
|
538
|
+
);
|
|
539
|
+
});
|
|
540
|
+
SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
|
|
541
|
+
const SidebarMenuSub = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
542
|
+
"ul",
|
|
543
|
+
{
|
|
544
|
+
ref,
|
|
545
|
+
"data-sidebar": "menu-sub",
|
|
546
|
+
className: cn(
|
|
547
|
+
"shared:mx-3.5 shared:flex shared:min-w-0 shared:translate-x-px shared:flex-col shared:gap-1 shared:border-l shared:border-sidebar-border shared:px-2.5 shared:py-0.5",
|
|
548
|
+
"shared:group-data-[collapsible=icon]:hidden",
|
|
549
|
+
className
|
|
550
|
+
),
|
|
551
|
+
...props
|
|
552
|
+
}
|
|
553
|
+
));
|
|
554
|
+
SidebarMenuSub.displayName = "SidebarMenuSub";
|
|
555
|
+
const SidebarMenuSubItem = React.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("li", { ref, ...props }));
|
|
556
|
+
SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
|
|
557
|
+
const SidebarMenuSubButton = React.forwardRef(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
|
|
558
|
+
const Comp = asChild ? Slot : "a";
|
|
559
|
+
return /* @__PURE__ */ jsx(
|
|
560
|
+
Comp,
|
|
561
|
+
{
|
|
562
|
+
ref,
|
|
563
|
+
"data-sidebar": "menu-sub-button",
|
|
564
|
+
"data-size": size,
|
|
565
|
+
"data-active": isActive,
|
|
566
|
+
className: cn(
|
|
567
|
+
"shared:flex shared:h-7 shared:min-w-0 shared:-translate-x-px shared:items-center shared:gap-2 shared:overflow-hidden shared:rounded-md shared:px-2 shared:text-sidebar-foreground shared:outline-none shared:ring-sidebar-ring shared:hover:bg-sidebar-accent shared:hover:text-sidebar-accent-foreground shared:focus-visible:ring-2 shared:active:bg-sidebar-accent shared:active:text-sidebar-accent-foreground shared:disabled:pointer-events-none shared:disabled:opacity-50 shared:aria-disabled:pointer-events-none shared:aria-disabled:opacity-50 [&>shared:span:last-child]:truncate [&>shared:svg]:size-4 [&>shared:svg]:shrink-0 [&>shared:svg]:text-sidebar-accent-foreground",
|
|
568
|
+
"shared:data-[active=true]:bg-sidebar-accent shared:data-[active=true]:text-sidebar-accent-foreground",
|
|
569
|
+
size === "sm" && "shared:text-xs",
|
|
570
|
+
size === "md" && "shared:text-sm",
|
|
571
|
+
"shared:group-data-[collapsible=icon]:hidden",
|
|
572
|
+
className
|
|
573
|
+
),
|
|
574
|
+
...props
|
|
575
|
+
}
|
|
576
|
+
);
|
|
577
|
+
});
|
|
578
|
+
SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
|
|
579
|
+
export {
|
|
580
|
+
Sidebar,
|
|
581
|
+
SidebarContent,
|
|
582
|
+
SidebarFooter,
|
|
583
|
+
SidebarGroup,
|
|
584
|
+
SidebarGroupAction,
|
|
585
|
+
SidebarGroupContent,
|
|
586
|
+
SidebarGroupLabel,
|
|
587
|
+
SidebarHeader,
|
|
588
|
+
SidebarInput,
|
|
589
|
+
SidebarInset,
|
|
590
|
+
SidebarMenu,
|
|
591
|
+
SidebarMenuAction,
|
|
592
|
+
SidebarMenuBadge,
|
|
593
|
+
SidebarMenuButton,
|
|
594
|
+
SidebarMenuItem,
|
|
595
|
+
SidebarMenuSkeleton,
|
|
596
|
+
SidebarMenuSub,
|
|
597
|
+
SidebarMenuSubButton,
|
|
598
|
+
SidebarMenuSubItem,
|
|
599
|
+
SidebarProvider,
|
|
600
|
+
SidebarRail,
|
|
601
|
+
SidebarSeparator,
|
|
602
|
+
SidebarTrigger,
|
|
603
|
+
useSidebar
|
|
604
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
function Skeleton({
|
|
4
|
+
className,
|
|
5
|
+
...props
|
|
6
|
+
}) {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
className: cn("shared:animate-pulse shared:rounded-md shared:bg-primary/10", className),
|
|
11
|
+
...props
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
Skeleton
|
|
17
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils.js";
|
|
3
|
+
import { forwardRef, useState } from "react";
|
|
4
|
+
const Slider = forwardRef(
|
|
5
|
+
({ className, value, defaultValue, onValueChange, min = 0, max = 100, step = 1, disabled, ...props }, ref) => {
|
|
6
|
+
const [internalValue, setInternalValue] = useState(value || defaultValue || [min]);
|
|
7
|
+
const activeValue = value !== void 0 ? value : internalValue;
|
|
8
|
+
const currentVal = activeValue[0] ?? min;
|
|
9
|
+
const handleChange = (e) => {
|
|
10
|
+
const val = parseFloat(e.target.value);
|
|
11
|
+
if (value === void 0) setInternalValue([val]);
|
|
12
|
+
if (onValueChange) onValueChange([val]);
|
|
13
|
+
};
|
|
14
|
+
const percentage = Math.max(0, Math.min(100, (currentVal - min) / (max - min) * 100));
|
|
15
|
+
return /* @__PURE__ */ jsxs(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
ref,
|
|
19
|
+
className: cn("shared:relative shared:flex shared:w-full shared:touch-none shared:select-none shared:items-center shared:h-6.5 shared:md:h-5 shared:[--thumb-size:1.625rem] shared:md:[--thumb-size:1.25rem] shared:overflow-hidden", className, disabled && "shared:opacity-50"),
|
|
20
|
+
...props,
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ jsx("div", { className: "shared:absolute shared:inset-0 shared:w-full shared:h-full shared:rounded-full shared:bg-primary/20 shared:pointer-events-none" }),
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: "shared:absolute shared:top-0 shared:left-0 shared:h-full shared:bg-primary shared:rounded-full shared:pointer-events-none",
|
|
27
|
+
style: {
|
|
28
|
+
width: `calc(${percentage}% - (${percentage / 100} * var(--thumb-size)) + var(--thumb-size))`
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: "shared:absolute shared:block shared:h-6.5 shared:w-6.5 shared:md:h-5 shared:md:w-5 shared:rounded-full shared:border-2 shared:border-primary shared:bg-background shared:shadow shared:pointer-events-none shared:z-10",
|
|
36
|
+
style: {
|
|
37
|
+
left: `calc(${percentage}% - (${percentage / 100} * var(--thumb-size)))`
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
"input",
|
|
43
|
+
{
|
|
44
|
+
type: "range",
|
|
45
|
+
min,
|
|
46
|
+
max,
|
|
47
|
+
step,
|
|
48
|
+
value: currentVal,
|
|
49
|
+
onChange: handleChange,
|
|
50
|
+
disabled,
|
|
51
|
+
className: "shared:absolute shared:w-full shared:h-full shared:opacity-0 shared:cursor-pointer shared:disabled:cursor-not-allowed shared:m-0 shared:p-0 shared:z-20"
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
Slider.displayName = "Slider";
|
|
60
|
+
export {
|
|
61
|
+
Slider
|
|
62
|
+
};
|