@work-rjkashyap/unified-ui 0.3.4 → 0.3.6
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/CHANGELOG.md +105 -0
- package/LICENSE +21 -0
- package/dist/components/accordion.cjs +225 -0
- package/dist/components/accordion.d.cts +157 -0
- package/dist/components/accordion.d.ts +157 -0
- package/dist/components/accordion.mjs +199 -0
- package/dist/components/alert-dialog.cjs +246 -0
- package/dist/components/alert-dialog.d.cts +61 -0
- package/dist/components/alert-dialog.d.ts +61 -0
- package/dist/components/alert-dialog.mjs +218 -0
- package/dist/components/alert.cjs +401 -0
- package/dist/components/alert.d.cts +217 -0
- package/dist/components/alert.d.ts +217 -0
- package/dist/components/alert.mjs +374 -0
- package/dist/components/aspect-ratio.cjs +45 -0
- package/dist/components/aspect-ratio.d.cts +10 -0
- package/dist/components/aspect-ratio.d.ts +10 -0
- package/dist/components/aspect-ratio.mjs +23 -0
- package/dist/components/avatar.cjs +348 -0
- package/dist/components/avatar.d.cts +198 -0
- package/dist/components/avatar.d.ts +198 -0
- package/dist/components/avatar.mjs +329 -0
- package/dist/components/badge.cjs +325 -0
- package/dist/components/badge.d.cts +259 -0
- package/dist/components/badge.d.ts +259 -0
- package/dist/components/badge.mjs +298 -0
- package/dist/components/banner.cjs +147 -0
- package/dist/components/banner.d.cts +31 -0
- package/dist/components/banner.d.ts +31 -0
- package/dist/components/banner.mjs +122 -0
- package/dist/components/breadcrumb.cjs +266 -0
- package/dist/components/breadcrumb.d.cts +159 -0
- package/dist/components/breadcrumb.d.ts +159 -0
- package/dist/components/breadcrumb.mjs +235 -0
- package/dist/components/button.cjs +254 -0
- package/dist/components/button.d.cts +126 -0
- package/dist/components/button.d.ts +126 -0
- package/dist/components/button.mjs +229 -0
- package/dist/components/calendar.cjs +511 -0
- package/dist/components/calendar.d.cts +94 -0
- package/dist/components/calendar.d.ts +94 -0
- package/dist/components/calendar.mjs +492 -0
- package/dist/components/card.cjs +234 -0
- package/dist/components/card.d.cts +190 -0
- package/dist/components/card.d.ts +190 -0
- package/dist/components/card.mjs +210 -0
- package/dist/components/carousel.cjs +234 -0
- package/dist/components/carousel.d.cts +30 -0
- package/dist/components/carousel.d.ts +30 -0
- package/dist/components/carousel.mjs +217 -0
- package/dist/components/chart.cjs +122 -0
- package/dist/components/chart.d.cts +103 -0
- package/dist/components/chart.d.ts +103 -0
- package/dist/components/chart.mjs +96 -0
- package/dist/components/checkbox.cjs +318 -0
- package/dist/components/checkbox.d.cts +182 -0
- package/dist/components/checkbox.d.ts +182 -0
- package/dist/components/checkbox.mjs +296 -0
- package/dist/components/code-highlight.cjs +335 -0
- package/dist/components/code-highlight.d.cts +18 -0
- package/dist/components/code-highlight.d.ts +18 -0
- package/dist/components/code-highlight.mjs +308 -0
- package/dist/components/code.cjs +265 -0
- package/dist/components/code.d.cts +40 -0
- package/dist/components/code.d.ts +40 -0
- package/dist/components/code.mjs +243 -0
- package/dist/components/collapsible.cjs +143 -0
- package/dist/components/collapsible.d.cts +159 -0
- package/dist/components/collapsible.d.ts +159 -0
- package/dist/components/collapsible.mjs +123 -0
- package/dist/components/color-picker.cjs +348 -0
- package/dist/components/color-picker.d.cts +35 -0
- package/dist/components/color-picker.d.ts +35 -0
- package/dist/components/color-picker.mjs +331 -0
- package/dist/components/combobox.cjs +584 -0
- package/dist/components/combobox.d.cts +183 -0
- package/dist/components/combobox.d.ts +183 -0
- package/dist/components/combobox.mjs +571 -0
- package/dist/components/command.cjs +329 -0
- package/dist/components/command.d.cts +97 -0
- package/dist/components/command.d.ts +97 -0
- package/dist/components/command.mjs +311 -0
- package/dist/components/confirm-dialog.cjs +100 -0
- package/dist/components/confirm-dialog.d.cts +25 -0
- package/dist/components/confirm-dialog.d.ts +25 -0
- package/dist/components/confirm-dialog.mjs +86 -0
- package/dist/components/context-menu.cjs +325 -0
- package/dist/components/context-menu.d.cts +259 -0
- package/dist/components/context-menu.d.ts +259 -0
- package/dist/components/context-menu.mjs +290 -0
- package/dist/components/copy-button.cjs +203 -0
- package/dist/components/copy-button.d.cts +22 -0
- package/dist/components/copy-button.d.ts +22 -0
- package/dist/components/copy-button.mjs +178 -0
- package/dist/components/data-list.cjs +140 -0
- package/dist/components/data-list.d.cts +36 -0
- package/dist/components/data-list.d.ts +36 -0
- package/dist/components/data-list.mjs +113 -0
- package/dist/components/data-table-toolbar.cjs +338 -0
- package/dist/components/data-table-toolbar.d.cts +84 -0
- package/dist/components/data-table-toolbar.d.ts +84 -0
- package/dist/components/data-table-toolbar.mjs +320 -0
- package/dist/components/data-table.cjs +1324 -0
- package/dist/components/data-table.d.cts +349 -0
- package/dist/components/data-table.d.ts +349 -0
- package/dist/components/data-table.mjs +1323 -0
- package/dist/components/date-picker.cjs +282 -0
- package/dist/components/date-picker.d.cts +97 -0
- package/dist/components/date-picker.d.ts +97 -0
- package/dist/components/date-picker.mjs +258 -0
- package/dist/components/dialog.cjs +319 -0
- package/dist/components/dialog.d.cts +74 -0
- package/dist/components/dialog.d.ts +74 -0
- package/dist/components/dialog.mjs +292 -0
- package/dist/components/drawer.cjs +262 -0
- package/dist/components/drawer.d.cts +113 -0
- package/dist/components/drawer.d.ts +113 -0
- package/dist/components/drawer.mjs +230 -0
- package/dist/components/dropdown-menu.cjs +328 -0
- package/dist/components/dropdown-menu.d.cts +95 -0
- package/dist/components/dropdown-menu.d.ts +95 -0
- package/dist/components/dropdown-menu.mjs +293 -0
- package/dist/components/empty-state.cjs +123 -0
- package/dist/components/empty-state.d.cts +15 -0
- package/dist/components/empty-state.d.ts +15 -0
- package/dist/components/empty-state.mjs +99 -0
- package/dist/components/file-upload.cjs +442 -0
- package/dist/components/file-upload.d.cts +35 -0
- package/dist/components/file-upload.d.ts +35 -0
- package/dist/components/file-upload.mjs +423 -0
- package/dist/components/form-field.cjs +191 -0
- package/dist/components/form-field.d.cts +163 -0
- package/dist/components/form-field.d.ts +163 -0
- package/dist/components/form-field.mjs +167 -0
- package/dist/components/hover-card.cjs +99 -0
- package/dist/components/hover-card.d.cts +28 -0
- package/dist/components/hover-card.d.ts +28 -0
- package/dist/components/hover-card.mjs +75 -0
- package/dist/components/image-gallery.cjs +359 -0
- package/dist/components/image-gallery.d.cts +46 -0
- package/dist/components/image-gallery.d.ts +46 -0
- package/dist/components/image-gallery.mjs +340 -0
- package/dist/components/index.cjs +719 -0
- package/dist/components/index.d.cts +84 -0
- package/dist/components/index.d.ts +84 -0
- package/dist/components/index.mjs +771 -0
- package/dist/components/infinite-scroll.cjs +95 -0
- package/dist/components/infinite-scroll.d.cts +54 -0
- package/dist/components/infinite-scroll.d.ts +54 -0
- package/dist/components/infinite-scroll.mjs +71 -0
- package/dist/components/input-group.cjs +202 -0
- package/dist/components/input-group.d.cts +22 -0
- package/dist/components/input-group.d.ts +22 -0
- package/dist/components/input-group.mjs +178 -0
- package/dist/components/input.cjs +318 -0
- package/dist/components/input.d.cts +99 -0
- package/dist/components/input.d.ts +99 -0
- package/dist/components/input.mjs +296 -0
- package/dist/components/kbd.cjs +69 -0
- package/dist/components/kbd.d.cts +25 -0
- package/dist/components/kbd.d.ts +25 -0
- package/dist/components/kbd.mjs +44 -0
- package/dist/components/label.cjs +138 -0
- package/dist/components/label.d.cts +91 -0
- package/dist/components/label.d.ts +91 -0
- package/dist/components/label.mjs +113 -0
- package/dist/components/markdown.cjs +179 -0
- package/dist/components/markdown.d.cts +41 -0
- package/dist/components/markdown.d.ts +41 -0
- package/dist/components/markdown.mjs +155 -0
- package/dist/components/menubar.cjs +365 -0
- package/dist/components/menubar.d.cts +88 -0
- package/dist/components/menubar.d.ts +88 -0
- package/dist/components/menubar.mjs +329 -0
- package/dist/components/navigation-menu.cjs +280 -0
- package/dist/components/navigation-menu.d.cts +123 -0
- package/dist/components/navigation-menu.d.ts +123 -0
- package/dist/components/navigation-menu.mjs +250 -0
- package/dist/components/number-input.cjs +419 -0
- package/dist/components/number-input.d.cts +111 -0
- package/dist/components/number-input.d.ts +111 -0
- package/dist/components/number-input.mjs +400 -0
- package/dist/components/pagination.cjs +322 -0
- package/dist/components/pagination.d.cts +119 -0
- package/dist/components/pagination.d.ts +119 -0
- package/dist/components/pagination.mjs +297 -0
- package/dist/components/pin-input.cjs +321 -0
- package/dist/components/pin-input.d.cts +112 -0
- package/dist/components/pin-input.d.ts +112 -0
- package/dist/components/pin-input.mjs +303 -0
- package/dist/components/popover.cjs +194 -0
- package/dist/components/popover.d.cts +108 -0
- package/dist/components/popover.d.ts +108 -0
- package/dist/components/popover.mjs +168 -0
- package/dist/components/progress.cjs +237 -0
- package/dist/components/progress.d.cts +137 -0
- package/dist/components/progress.d.ts +137 -0
- package/dist/components/progress.mjs +211 -0
- package/dist/components/radio.cjs +344 -0
- package/dist/components/radio.d.cts +145 -0
- package/dist/components/radio.d.ts +145 -0
- package/dist/components/radio.mjs +320 -0
- package/dist/components/resizable.cjs +121 -0
- package/dist/components/resizable.d.cts +23 -0
- package/dist/components/resizable.d.ts +23 -0
- package/dist/components/resizable.mjs +99 -0
- package/dist/components/scroll-area.cjs +168 -0
- package/dist/components/scroll-area.d.cts +131 -0
- package/dist/components/scroll-area.d.ts +131 -0
- package/dist/components/scroll-area.mjs +143 -0
- package/dist/components/search-input.cjs +261 -0
- package/dist/components/search-input.d.cts +26 -0
- package/dist/components/search-input.d.ts +26 -0
- package/dist/components/search-input.mjs +243 -0
- package/dist/components/select.cjs +320 -0
- package/dist/components/select.d.cts +55 -0
- package/dist/components/select.d.ts +55 -0
- package/dist/components/select.mjs +288 -0
- package/dist/components/separator.cjs +193 -0
- package/dist/components/separator.d.cts +92 -0
- package/dist/components/separator.d.ts +92 -0
- package/dist/components/separator.mjs +170 -0
- package/dist/components/sheet.cjs +399 -0
- package/dist/components/sheet.d.cts +219 -0
- package/dist/components/sheet.d.ts +219 -0
- package/dist/components/sheet.mjs +379 -0
- package/dist/components/sidebar.cjs +1077 -0
- package/dist/components/sidebar.d.cts +733 -0
- package/dist/components/sidebar.d.ts +733 -0
- package/dist/components/sidebar.mjs +1033 -0
- package/dist/components/skeleton.cjs +210 -0
- package/dist/components/skeleton.d.cts +202 -0
- package/dist/components/skeleton.d.ts +202 -0
- package/dist/components/skeleton.mjs +182 -0
- package/dist/components/slider.cjs +319 -0
- package/dist/components/slider.d.cts +82 -0
- package/dist/components/slider.d.ts +82 -0
- package/dist/components/slider.mjs +296 -0
- package/dist/components/sonner.cjs +119 -0
- package/dist/components/sonner.d.cts +60 -0
- package/dist/components/sonner.d.ts +60 -0
- package/dist/components/sonner.mjs +94 -0
- package/dist/components/spinner.cjs +238 -0
- package/dist/components/spinner.d.cts +101 -0
- package/dist/components/spinner.d.ts +101 -0
- package/dist/components/spinner.mjs +213 -0
- package/dist/components/stat.cjs +180 -0
- package/dist/components/stat.d.cts +21 -0
- package/dist/components/stat.d.ts +21 -0
- package/dist/components/stat.mjs +161 -0
- package/dist/components/steps.cjs +228 -0
- package/dist/components/steps.d.cts +76 -0
- package/dist/components/steps.d.ts +76 -0
- package/dist/components/steps.mjs +207 -0
- package/dist/components/switch.cjs +243 -0
- package/dist/components/switch.d.cts +90 -0
- package/dist/components/switch.d.ts +90 -0
- package/dist/components/switch.mjs +228 -0
- package/dist/components/table.cjs +381 -0
- package/dist/components/table.d.cts +181 -0
- package/dist/components/table.d.ts +181 -0
- package/dist/components/table.mjs +349 -0
- package/dist/components/tabs.cjs +326 -0
- package/dist/components/tabs.d.cts +154 -0
- package/dist/components/tabs.d.ts +154 -0
- package/dist/components/tabs.mjs +304 -0
- package/dist/components/textarea.cjs +258 -0
- package/dist/components/textarea.d.cts +112 -0
- package/dist/components/textarea.d.ts +112 -0
- package/dist/components/textarea.mjs +233 -0
- package/dist/components/theme-toggle.cjs +282 -0
- package/dist/components/theme-toggle.d.cts +58 -0
- package/dist/components/theme-toggle.d.ts +58 -0
- package/dist/components/theme-toggle.mjs +258 -0
- package/dist/components/timeline.cjs +178 -0
- package/dist/components/timeline.d.cts +41 -0
- package/dist/components/timeline.d.ts +41 -0
- package/dist/components/timeline.mjs +157 -0
- package/dist/components/toast.cjs +546 -0
- package/dist/components/toast.d.cts +169 -0
- package/dist/components/toast.d.ts +169 -0
- package/dist/components/toast.mjs +528 -0
- package/dist/components/toggle-group.cjs +204 -0
- package/dist/components/toggle-group.d.cts +215 -0
- package/dist/components/toggle-group.d.ts +215 -0
- package/dist/components/toggle-group.mjs +180 -0
- package/dist/components/toggle.cjs +155 -0
- package/dist/components/toggle.d.cts +100 -0
- package/dist/components/toggle.d.ts +100 -0
- package/dist/components/toggle.mjs +130 -0
- package/dist/components/tooltip.cjs +155 -0
- package/dist/components/tooltip.d.cts +129 -0
- package/dist/components/tooltip.d.ts +129 -0
- package/dist/components/tooltip.mjs +132 -0
- package/dist/components/tree-view.cjs +450 -0
- package/dist/components/tree-view.d.cts +67 -0
- package/dist/components/tree-view.d.ts +67 -0
- package/dist/components/tree-view.mjs +433 -0
- package/dist/components/video-player.cjs +344 -0
- package/dist/components/video-player.d.cts +34 -0
- package/dist/components/video-player.d.ts +34 -0
- package/dist/components/video-player.mjs +320 -0
- package/dist/components/virtual-list.cjs +153 -0
- package/dist/components/virtual-list.d.cts +53 -0
- package/dist/components/virtual-list.d.ts +53 -0
- package/dist/components/virtual-list.mjs +136 -0
- package/dist/components/visually-hidden.cjs +43 -0
- package/dist/components/visually-hidden.d.cts +9 -0
- package/dist/components/visually-hidden.d.ts +9 -0
- package/dist/components/visually-hidden.mjs +21 -0
- package/dist/index.cjs +1081 -1957
- package/dist/index.d.cts +99 -11
- package/dist/index.d.ts +99 -11
- package/dist/index.mjs +1138 -16
- package/dist/motion/hooks.cjs +98 -0
- package/dist/motion/hooks.d.cts +32 -0
- package/dist/motion/hooks.d.ts +32 -0
- package/dist/motion/hooks.mjs +70 -0
- package/dist/motion/index.cjs +157 -0
- package/dist/motion/index.d.cts +5 -0
- package/dist/motion/index.d.ts +5 -0
- package/dist/motion/index.mjs +137 -0
- package/dist/motion/presets.cjs +609 -0
- package/dist/{motion.d.ts → motion/presets.d.cts} +1 -30
- package/dist/{motion.d.cts → motion/presets.d.ts} +1 -30
- package/dist/{chunk-PLRSH37T.mjs → motion/presets.mjs} +119 -126
- package/dist/primitives/container.cjs +88 -0
- package/dist/primitives/container.d.cts +82 -0
- package/dist/primitives/container.d.ts +82 -0
- package/dist/primitives/container.mjs +64 -0
- package/dist/primitives/divider.cjs +74 -0
- package/dist/primitives/divider.d.cts +30 -0
- package/dist/primitives/divider.d.ts +30 -0
- package/dist/primitives/divider.mjs +50 -0
- package/dist/primitives/index.cjs +54 -0
- package/dist/primitives/index.d.cts +6 -0
- package/dist/primitives/index.d.ts +6 -0
- package/dist/primitives/index.mjs +33 -0
- package/dist/primitives/stack.cjs +167 -0
- package/dist/primitives/stack.d.cts +132 -0
- package/dist/primitives/stack.d.ts +132 -0
- package/dist/primitives/stack.mjs +142 -0
- package/dist/primitives/typography.cjs +260 -0
- package/dist/primitives/typography.d.cts +157 -0
- package/dist/primitives/typography.d.ts +157 -0
- package/dist/primitives/typography.mjs +229 -0
- package/dist/theme/contract.cjs +246 -0
- package/dist/theme/contract.d.cts +76 -0
- package/dist/theme/contract.d.ts +76 -0
- package/dist/theme/contract.mjs +221 -0
- package/dist/theme/customizer-store.cjs +266 -0
- package/dist/theme/customizer-store.d.cts +76 -0
- package/dist/theme/customizer-store.d.ts +76 -0
- package/dist/theme/customizer-store.mjs +261 -0
- package/dist/theme/customizer.cjs +812 -0
- package/dist/theme/customizer.d.cts +13 -0
- package/dist/theme/customizer.d.ts +13 -0
- package/dist/theme/customizer.mjs +803 -0
- package/dist/theme/index.cjs +105 -0
- package/dist/theme/index.d.cts +13 -0
- package/dist/theme/index.d.ts +13 -0
- package/dist/theme/index.mjs +87 -0
- package/dist/theme/presets.cjs +1205 -0
- package/dist/theme/presets.d.cts +232 -0
- package/dist/theme/presets.d.ts +232 -0
- package/dist/theme/presets.mjs +1175 -0
- package/dist/theme/provider.cjs +122 -0
- package/dist/theme/provider.d.cts +57 -0
- package/dist/theme/provider.d.ts +57 -0
- package/dist/theme/provider.mjs +104 -0
- package/dist/{chunk-AAEWG5VR.mjs → tokens/colors.cjs} +94 -94
- package/dist/{z-index-DmLl6FUD.d.ts → tokens/colors.d.cts} +118 -72
- package/dist/{z-index-DmLl6FUD.d.cts → tokens/colors.d.ts} +118 -72
- package/dist/{chunk-6ZZZBOCH.cjs → tokens/colors.mjs} +47 -121
- package/dist/tokens/index.cjs +96 -0
- package/dist/tokens/index.d.cts +7 -0
- package/dist/tokens/index.d.ts +7 -0
- package/dist/tokens/index.mjs +71 -0
- package/dist/{chunk-XCKK6P46.cjs → tokens/motion.cjs} +46 -18
- package/dist/{motion-D9wQbcKL.d.cts → tokens/motion.d.cts} +1 -1
- package/dist/{motion-D9wQbcKL.d.ts → tokens/motion.d.ts} +1 -1
- package/dist/{chunk-EZ2L3XPS.mjs → tokens/motion.mjs} +16 -10
- package/dist/tokens/radius.cjs +41 -0
- package/dist/tokens/radius.d.cts +18 -0
- package/dist/tokens/radius.d.ts +18 -0
- package/dist/tokens/radius.mjs +17 -0
- package/dist/tokens/shadows.cjs +57 -0
- package/dist/tokens/shadows.d.cts +32 -0
- package/dist/tokens/shadows.d.ts +32 -0
- package/dist/tokens/shadows.mjs +32 -0
- package/dist/tokens/spacing.cjs +51 -0
- package/dist/tokens/spacing.d.cts +26 -0
- package/dist/tokens/spacing.d.ts +26 -0
- package/dist/{chunk-NMPHV6ZD.mjs → tokens/spacing.mjs} +4 -4
- package/dist/{chunk-ECIGDEAH.cjs → tokens/typography.cjs} +43 -16
- package/dist/{typography-DlvVjEdE.d.ts → tokens/typography.d.cts} +1 -1
- package/dist/{typography-DlvVjEdE.d.cts → tokens/typography.d.ts} +1 -1
- package/dist/{chunk-ITBG42M5.mjs → tokens/typography.mjs} +14 -9
- package/dist/tokens/z-index.cjs +47 -0
- package/dist/tokens/z-index.d.cts +24 -0
- package/dist/tokens/z-index.d.ts +24 -0
- package/dist/tokens/z-index.mjs +23 -0
- package/dist/utils/cn.cjs +102 -0
- package/dist/utils/cn.d.cts +84 -0
- package/dist/utils/cn.d.ts +84 -0
- package/dist/{chunk-ZT3PCXDF.mjs → utils/cn.mjs} +14 -7
- package/dist/{chunk-33QEKXRQ.cjs → utils/contrast.cjs} +68 -38
- package/dist/utils/contrast.d.cts +209 -0
- package/dist/utils/contrast.d.ts +209 -0
- package/dist/{chunk-5NZDQWRV.mjs → utils/contrast.mjs} +27 -18
- package/dist/utils/focus-ring.cjs +81 -0
- package/dist/utils/focus-ring.d.cts +80 -0
- package/dist/utils/focus-ring.d.ts +80 -0
- package/dist/utils/focus-ring.mjs +47 -0
- package/dist/utils/index.cjs +107 -0
- package/dist/utils/index.d.cts +6 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.mjs +88 -0
- package/dist/utils/types.cjs +38 -0
- package/dist/utils/types.d.cts +187 -0
- package/dist/utils/types.d.ts +187 -0
- package/dist/utils/types.mjs +13 -0
- package/package.json +191 -191
- package/dist/chunk-2JFREULQ.cjs +0 -29
- package/dist/chunk-3EHT6IOA.cjs +0 -49
- package/dist/chunk-4ON3M3OM.cjs +0 -73
- package/dist/chunk-A2DGHQL2.cjs +0 -21808
- package/dist/chunk-BJ55D5IK.mjs +0 -2433
- package/dist/chunk-F4JJFWWU.cjs +0 -604
- package/dist/chunk-FUWXGHWQ.cjs +0 -468
- package/dist/chunk-MBYCK2JJ.mjs +0 -37
- package/dist/chunk-OHEH57BV.mjs +0 -455
- package/dist/chunk-RUG3BW2B.cjs +0 -2471
- package/dist/chunk-XAIUX2YS.mjs +0 -21477
- package/dist/components.cjs +0 -1247
- package/dist/components.d.cts +0 -7881
- package/dist/components.d.ts +0 -7881
- package/dist/components.mjs +0 -6
- package/dist/motion.cjs +0 -264
- package/dist/motion.mjs +0 -3
- package/dist/primitives.cjs +0 -57
- package/dist/primitives.d.cts +0 -390
- package/dist/primitives.d.ts +0 -390
- package/dist/primitives.mjs +0 -4
- package/dist/theme.cjs +0 -159
- package/dist/theme.d.cts +0 -440
- package/dist/theme.d.ts +0 -440
- package/dist/theme.mjs +0 -6
- package/dist/tokens.cjs +0 -137
- package/dist/tokens.d.cts +0 -30
- package/dist/tokens.d.ts +0 -30
- package/dist/tokens.mjs +0 -4
- package/dist/utils.cjs +0 -164
- package/dist/utils.d.cts +0 -525
- package/dist/utils.d.ts +0 -525
- package/dist/utils.mjs +0 -3
|
@@ -0,0 +1,1033 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { overlayBackdrop } from "../motion/index.mjs";
|
|
4
|
+
import { cn } from "../utils/cn.mjs";
|
|
5
|
+
import { focusRingClasses } from "../utils/focus-ring.mjs";
|
|
6
|
+
import { AnimatePresence, motion, useReducedMotion } from "framer-motion";
|
|
7
|
+
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
8
|
+
import {
|
|
9
|
+
createContext,
|
|
10
|
+
forwardRef,
|
|
11
|
+
useCallback,
|
|
12
|
+
useContext,
|
|
13
|
+
useEffect,
|
|
14
|
+
useMemo,
|
|
15
|
+
useState
|
|
16
|
+
} from "react";
|
|
17
|
+
const SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
18
|
+
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
19
|
+
const SIDEBAR_WIDTH = "16rem";
|
|
20
|
+
const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
21
|
+
const SIDEBAR_WIDTH_ICON = "3rem";
|
|
22
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
23
|
+
function PanelLeftIcon({ className }) {
|
|
24
|
+
return /* @__PURE__ */ jsxs(
|
|
25
|
+
"svg",
|
|
26
|
+
{
|
|
27
|
+
className,
|
|
28
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
29
|
+
viewBox: "0 0 24 24",
|
|
30
|
+
fill: "none",
|
|
31
|
+
stroke: "currentColor",
|
|
32
|
+
strokeWidth: "2",
|
|
33
|
+
strokeLinecap: "round",
|
|
34
|
+
strokeLinejoin: "round",
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
38
|
+
/* @__PURE__ */ jsx("path", { d: "M9 3v18" })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
function _ChevronRightIcon({ className }) {
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
"svg",
|
|
46
|
+
{
|
|
47
|
+
className,
|
|
48
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
49
|
+
viewBox: "0 0 24 24",
|
|
50
|
+
fill: "none",
|
|
51
|
+
stroke: "currentColor",
|
|
52
|
+
strokeWidth: "2",
|
|
53
|
+
strokeLinecap: "round",
|
|
54
|
+
strokeLinejoin: "round",
|
|
55
|
+
"aria-hidden": "true",
|
|
56
|
+
children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
const SidebarContext = createContext({
|
|
61
|
+
state: "expanded",
|
|
62
|
+
open: true,
|
|
63
|
+
setOpen: () => {
|
|
64
|
+
},
|
|
65
|
+
openMobile: false,
|
|
66
|
+
setOpenMobile: () => {
|
|
67
|
+
},
|
|
68
|
+
isMobile: false,
|
|
69
|
+
toggleSidebar: () => {
|
|
70
|
+
},
|
|
71
|
+
variant: "default",
|
|
72
|
+
collapsible: "offcanvas",
|
|
73
|
+
side: "left"
|
|
74
|
+
});
|
|
75
|
+
function useSidebar() {
|
|
76
|
+
const context = useContext(SidebarContext);
|
|
77
|
+
if (!context) {
|
|
78
|
+
throw new Error("useSidebar must be used within a <SidebarProvider>");
|
|
79
|
+
}
|
|
80
|
+
return context;
|
|
81
|
+
}
|
|
82
|
+
const useSidebarContext = useSidebar;
|
|
83
|
+
const MOBILE_BREAKPOINT = 768;
|
|
84
|
+
function useIsMobile() {
|
|
85
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
88
|
+
const onChange = () => setIsMobile(mql.matches);
|
|
89
|
+
mql.addEventListener("change", onChange);
|
|
90
|
+
setIsMobile(mql.matches);
|
|
91
|
+
return () => mql.removeEventListener("change", onChange);
|
|
92
|
+
}, []);
|
|
93
|
+
return isMobile;
|
|
94
|
+
}
|
|
95
|
+
const SidebarProvider = forwardRef(
|
|
96
|
+
function SidebarProvider2({
|
|
97
|
+
defaultOpen = true,
|
|
98
|
+
open: openProp,
|
|
99
|
+
onOpenChange: setOpenProp,
|
|
100
|
+
variant = "default",
|
|
101
|
+
collapsible = "offcanvas",
|
|
102
|
+
side = "left",
|
|
103
|
+
className,
|
|
104
|
+
style,
|
|
105
|
+
children,
|
|
106
|
+
...rest
|
|
107
|
+
}, ref) {
|
|
108
|
+
const isMobile = useIsMobile();
|
|
109
|
+
const [openMobile, setOpenMobile] = useState(false);
|
|
110
|
+
const isControlled = openProp !== void 0;
|
|
111
|
+
const [_open, _setOpen] = useState(defaultOpen);
|
|
112
|
+
const open = isControlled ? openProp : _open;
|
|
113
|
+
const setOpen = useCallback(
|
|
114
|
+
(value) => {
|
|
115
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
116
|
+
if (setOpenProp) {
|
|
117
|
+
setOpenProp(openState);
|
|
118
|
+
} else {
|
|
119
|
+
_setOpen(openState);
|
|
120
|
+
}
|
|
121
|
+
try {
|
|
122
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
123
|
+
} catch {
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
[setOpenProp, open]
|
|
127
|
+
);
|
|
128
|
+
const toggleSidebar = useCallback(() => {
|
|
129
|
+
if (isMobile) {
|
|
130
|
+
setOpenMobile((prev) => !prev);
|
|
131
|
+
} else {
|
|
132
|
+
setOpen((prev) => !prev);
|
|
133
|
+
}
|
|
134
|
+
}, [isMobile, setOpen]);
|
|
135
|
+
useEffect(() => {
|
|
136
|
+
const handleKeyDown = (e) => {
|
|
137
|
+
if (e.key === SIDEBAR_KEYBOARD_SHORTCUT && (e.metaKey || e.ctrlKey)) {
|
|
138
|
+
e.preventDefault();
|
|
139
|
+
toggleSidebar();
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
143
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
144
|
+
}, [toggleSidebar]);
|
|
145
|
+
const state = open ? "expanded" : "collapsed";
|
|
146
|
+
const contextValue = useMemo(
|
|
147
|
+
() => ({
|
|
148
|
+
state,
|
|
149
|
+
open,
|
|
150
|
+
setOpen,
|
|
151
|
+
openMobile,
|
|
152
|
+
setOpenMobile,
|
|
153
|
+
isMobile,
|
|
154
|
+
toggleSidebar,
|
|
155
|
+
variant,
|
|
156
|
+
collapsible,
|
|
157
|
+
side
|
|
158
|
+
}),
|
|
159
|
+
[
|
|
160
|
+
state,
|
|
161
|
+
open,
|
|
162
|
+
setOpen,
|
|
163
|
+
openMobile,
|
|
164
|
+
isMobile,
|
|
165
|
+
toggleSidebar,
|
|
166
|
+
variant,
|
|
167
|
+
collapsible,
|
|
168
|
+
side
|
|
169
|
+
]
|
|
170
|
+
);
|
|
171
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration: 0, children: /* @__PURE__ */ jsx(
|
|
172
|
+
"div",
|
|
173
|
+
{
|
|
174
|
+
ref,
|
|
175
|
+
className: cn(
|
|
176
|
+
"group/sidebar-wrapper flex min-h-svh w-full",
|
|
177
|
+
"has-data-[variant=inset]:bg-sidebar",
|
|
178
|
+
className
|
|
179
|
+
),
|
|
180
|
+
style: {
|
|
181
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
182
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
183
|
+
...style
|
|
184
|
+
},
|
|
185
|
+
"data-ds": "",
|
|
186
|
+
"data-ds-component": "sidebar-provider",
|
|
187
|
+
...rest,
|
|
188
|
+
children
|
|
189
|
+
}
|
|
190
|
+
) }) });
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
SidebarProvider.displayName = "SidebarProvider";
|
|
194
|
+
const Sidebar = forwardRef(
|
|
195
|
+
function Sidebar2({
|
|
196
|
+
side: sideProp,
|
|
197
|
+
variant: variantProp,
|
|
198
|
+
collapsible: collapsibleProp,
|
|
199
|
+
className,
|
|
200
|
+
children,
|
|
201
|
+
...rest
|
|
202
|
+
}, ref) {
|
|
203
|
+
const ctx = useSidebar();
|
|
204
|
+
const side = sideProp ?? ctx.side;
|
|
205
|
+
const variant = variantProp ?? ctx.variant;
|
|
206
|
+
const collapsible = collapsibleProp ?? ctx.collapsible;
|
|
207
|
+
const shouldReduce = useReducedMotion();
|
|
208
|
+
if (collapsible === "none") {
|
|
209
|
+
return /* @__PURE__ */ jsx(
|
|
210
|
+
"div",
|
|
211
|
+
{
|
|
212
|
+
ref,
|
|
213
|
+
className: cn(
|
|
214
|
+
"flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",
|
|
215
|
+
className
|
|
216
|
+
),
|
|
217
|
+
"data-ds": "",
|
|
218
|
+
"data-ds-component": "sidebar",
|
|
219
|
+
...rest,
|
|
220
|
+
children
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
225
|
+
ctx.isMobile && /* @__PURE__ */ jsx(AnimatePresence, { children: ctx.openMobile && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
226
|
+
/* @__PURE__ */ jsx(
|
|
227
|
+
motion.div,
|
|
228
|
+
{
|
|
229
|
+
className: "fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",
|
|
230
|
+
variants: shouldReduce ? void 0 : overlayBackdrop.variants,
|
|
231
|
+
initial: shouldReduce ? { opacity: 0 } : "initial",
|
|
232
|
+
animate: shouldReduce ? { opacity: 1 } : "animate",
|
|
233
|
+
exit: shouldReduce ? { opacity: 0 } : "exit",
|
|
234
|
+
transition: shouldReduce ? { duration: 0.15 } : overlayBackdrop.transition,
|
|
235
|
+
onClick: () => ctx.setOpenMobile(false),
|
|
236
|
+
"data-ds-animated": ""
|
|
237
|
+
}
|
|
238
|
+
),
|
|
239
|
+
/* @__PURE__ */ jsx(
|
|
240
|
+
motion.div,
|
|
241
|
+
{
|
|
242
|
+
className: cn(
|
|
243
|
+
"fixed inset-y-0 z-50 flex w-[--sidebar-width-mobile] flex-col bg-sidebar text-sidebar-foreground",
|
|
244
|
+
"p-0 shadow-lg",
|
|
245
|
+
side === "left" ? "left-0 border-r border-sidebar-border" : "right-0 border-l border-sidebar-border",
|
|
246
|
+
className
|
|
247
|
+
),
|
|
248
|
+
style: {
|
|
249
|
+
"--sidebar-width-mobile": SIDEBAR_WIDTH_MOBILE
|
|
250
|
+
},
|
|
251
|
+
initial: {
|
|
252
|
+
x: side === "left" ? "-100%" : "100%",
|
|
253
|
+
opacity: shouldReduce ? 0 : 1
|
|
254
|
+
},
|
|
255
|
+
animate: {
|
|
256
|
+
x: 0,
|
|
257
|
+
opacity: 1
|
|
258
|
+
},
|
|
259
|
+
exit: {
|
|
260
|
+
x: side === "left" ? "-100%" : "100%",
|
|
261
|
+
opacity: shouldReduce ? 0 : 1
|
|
262
|
+
},
|
|
263
|
+
transition: shouldReduce ? { duration: 0.15 } : {
|
|
264
|
+
type: "spring",
|
|
265
|
+
stiffness: 300,
|
|
266
|
+
damping: 30,
|
|
267
|
+
mass: 0.8
|
|
268
|
+
},
|
|
269
|
+
"data-ds": "",
|
|
270
|
+
"data-ds-component": "sidebar",
|
|
271
|
+
"data-variant": variant,
|
|
272
|
+
"data-side": side,
|
|
273
|
+
"data-mobile": "",
|
|
274
|
+
"data-ds-animated": "",
|
|
275
|
+
children
|
|
276
|
+
}
|
|
277
|
+
)
|
|
278
|
+
] }) }),
|
|
279
|
+
!ctx.isMobile && /* @__PURE__ */ jsxs(
|
|
280
|
+
"div",
|
|
281
|
+
{
|
|
282
|
+
ref,
|
|
283
|
+
className: "group peer hidden md:block text-sidebar-foreground",
|
|
284
|
+
"data-state": ctx.state,
|
|
285
|
+
"data-collapsible": ctx.state === "collapsed" ? collapsible : "",
|
|
286
|
+
"data-variant": variant,
|
|
287
|
+
"data-side": side,
|
|
288
|
+
children: [
|
|
289
|
+
/* @__PURE__ */ jsx(
|
|
290
|
+
motion.div,
|
|
291
|
+
{
|
|
292
|
+
className: cn(
|
|
293
|
+
"relative h-svh bg-transparent",
|
|
294
|
+
"duration-200 ease-linear",
|
|
295
|
+
variant === "floating" || variant === "inset" ? "w-[calc(var(--sidebar-width)+(--spacing(4)))]" : "w-[--sidebar-width]"
|
|
296
|
+
),
|
|
297
|
+
animate: {
|
|
298
|
+
width: ctx.state === "collapsed" ? collapsible === "offcanvas" ? "0px" : variant === "floating" || variant === "inset" ? "calc(var(--sidebar-width-icon) + theme(spacing.4) + 2px)" : "var(--sidebar-width-icon)" : variant === "floating" || variant === "inset" ? "calc(var(--sidebar-width) + theme(spacing.4))" : "var(--sidebar-width)"
|
|
299
|
+
},
|
|
300
|
+
transition: shouldReduce ? { duration: 0 } : { duration: 0.2, ease: [0.25, 0.1, 0.25, 1] }
|
|
301
|
+
}
|
|
302
|
+
),
|
|
303
|
+
/* @__PURE__ */ jsx(
|
|
304
|
+
motion.div,
|
|
305
|
+
{
|
|
306
|
+
className: cn(
|
|
307
|
+
"fixed inset-y-0 z-10 hidden h-svh md:flex flex-col",
|
|
308
|
+
side === "left" ? "left-0" : "right-0",
|
|
309
|
+
// Variant styles
|
|
310
|
+
variant === "floating" && "m-2 rounded-lg border border-sidebar-border shadow-lg overflow-hidden",
|
|
311
|
+
variant === "inset" && "m-2 rounded-lg overflow-hidden",
|
|
312
|
+
variant === "default" && cn(
|
|
313
|
+
"border-sidebar-border",
|
|
314
|
+
side === "left" ? "border-r" : "border-l"
|
|
315
|
+
),
|
|
316
|
+
"bg-sidebar text-sidebar-foreground",
|
|
317
|
+
className
|
|
318
|
+
),
|
|
319
|
+
animate: {
|
|
320
|
+
width: ctx.state === "collapsed" ? collapsible === "offcanvas" ? "0px" : "var(--sidebar-width-icon)" : "var(--sidebar-width)"
|
|
321
|
+
},
|
|
322
|
+
transition: shouldReduce ? { duration: 0 } : { duration: 0.2, ease: [0.25, 0.1, 0.25, 1] },
|
|
323
|
+
"data-ds": "",
|
|
324
|
+
"data-ds-component": "sidebar",
|
|
325
|
+
"data-variant": variant,
|
|
326
|
+
"data-side": side,
|
|
327
|
+
"data-state": ctx.state,
|
|
328
|
+
"data-collapsible": ctx.state === "collapsed" ? collapsible : "",
|
|
329
|
+
children: /* @__PURE__ */ jsx(
|
|
330
|
+
"div",
|
|
331
|
+
{
|
|
332
|
+
className: cn(
|
|
333
|
+
"flex h-full w-full flex-col",
|
|
334
|
+
"group-data-[collapsible=offcanvas]:opacity-0 group-data-[collapsible=offcanvas]:pointer-events-none"
|
|
335
|
+
),
|
|
336
|
+
"data-sidebar": "content-wrapper",
|
|
337
|
+
children
|
|
338
|
+
}
|
|
339
|
+
)
|
|
340
|
+
}
|
|
341
|
+
)
|
|
342
|
+
]
|
|
343
|
+
}
|
|
344
|
+
)
|
|
345
|
+
] });
|
|
346
|
+
}
|
|
347
|
+
);
|
|
348
|
+
Sidebar.displayName = "Sidebar";
|
|
349
|
+
const SidebarTrigger = forwardRef(function SidebarTrigger2({ className, onClick, children, ...rest }, ref) {
|
|
350
|
+
const { toggleSidebar, state, isMobile: _isMobile } = useSidebar();
|
|
351
|
+
return /* @__PURE__ */ jsxs(
|
|
352
|
+
"button",
|
|
353
|
+
{
|
|
354
|
+
ref,
|
|
355
|
+
type: "button",
|
|
356
|
+
onClick: (e) => {
|
|
357
|
+
onClick?.(e);
|
|
358
|
+
toggleSidebar();
|
|
359
|
+
},
|
|
360
|
+
"aria-label": state === "expanded" ? "Collapse sidebar" : "Expand sidebar",
|
|
361
|
+
"aria-expanded": state === "expanded",
|
|
362
|
+
className: cn(
|
|
363
|
+
"inline-flex items-center justify-center size-8 shrink-0 rounded-md",
|
|
364
|
+
"text-muted-foreground hover:text-foreground hover:bg-accent",
|
|
365
|
+
"transition-colors duration-fast",
|
|
366
|
+
focusRingClasses,
|
|
367
|
+
className
|
|
368
|
+
),
|
|
369
|
+
"data-ds": "",
|
|
370
|
+
"data-ds-component": "sidebar-trigger",
|
|
371
|
+
...rest,
|
|
372
|
+
children: [
|
|
373
|
+
children ?? /* @__PURE__ */ jsx(PanelLeftIcon, { className: "size-4" }),
|
|
374
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
375
|
+
]
|
|
376
|
+
}
|
|
377
|
+
);
|
|
378
|
+
});
|
|
379
|
+
SidebarTrigger.displayName = "SidebarTrigger";
|
|
380
|
+
const SidebarToggle = SidebarTrigger;
|
|
381
|
+
const SidebarRail = forwardRef(
|
|
382
|
+
function SidebarRail2({ className, ...rest }, ref) {
|
|
383
|
+
const { toggleSidebar, side } = useSidebar();
|
|
384
|
+
return /* @__PURE__ */ jsx(
|
|
385
|
+
"button",
|
|
386
|
+
{
|
|
387
|
+
ref,
|
|
388
|
+
type: "button",
|
|
389
|
+
tabIndex: -1,
|
|
390
|
+
"aria-label": "Toggle Sidebar",
|
|
391
|
+
onClick: toggleSidebar,
|
|
392
|
+
title: "Toggle Sidebar",
|
|
393
|
+
className: cn(
|
|
394
|
+
"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 md:flex items-center justify-center",
|
|
395
|
+
"after:absolute after:inset-y-0 after:left-1/2 after:w-0.5",
|
|
396
|
+
"hover:after:bg-sidebar-border",
|
|
397
|
+
"transition-all duration-fast ease-linear",
|
|
398
|
+
"group-data-[side=left]:right-0 group-data-[side=right]:left-0",
|
|
399
|
+
side === "left" ? "cursor-w-resize group-data-[state=collapsed]:cursor-e-resize" : "cursor-e-resize group-data-[state=collapsed]:cursor-w-resize",
|
|
400
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize",
|
|
401
|
+
"[[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
402
|
+
className
|
|
403
|
+
),
|
|
404
|
+
"data-ds": "",
|
|
405
|
+
"data-ds-component": "sidebar-rail",
|
|
406
|
+
...rest
|
|
407
|
+
}
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
);
|
|
411
|
+
SidebarRail.displayName = "SidebarRail";
|
|
412
|
+
const SidebarInset = forwardRef(
|
|
413
|
+
function SidebarInset2({ className, children, ...rest }, ref) {
|
|
414
|
+
return /* @__PURE__ */ jsx(
|
|
415
|
+
"main",
|
|
416
|
+
{
|
|
417
|
+
ref,
|
|
418
|
+
className: cn(
|
|
419
|
+
"relative flex min-h-svh flex-1 flex-col bg-background",
|
|
420
|
+
"peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))]",
|
|
421
|
+
"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0",
|
|
422
|
+
"md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",
|
|
423
|
+
className
|
|
424
|
+
),
|
|
425
|
+
"data-ds": "",
|
|
426
|
+
"data-ds-component": "sidebar-inset",
|
|
427
|
+
...rest,
|
|
428
|
+
children
|
|
429
|
+
}
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
);
|
|
433
|
+
SidebarInset.displayName = "SidebarInset";
|
|
434
|
+
const SidebarHeader = forwardRef(
|
|
435
|
+
function SidebarHeader2({ className, children, ...rest }, ref) {
|
|
436
|
+
return /* @__PURE__ */ jsx(
|
|
437
|
+
"div",
|
|
438
|
+
{
|
|
439
|
+
ref,
|
|
440
|
+
className: cn(
|
|
441
|
+
"flex flex-col gap-2 p-2",
|
|
442
|
+
"group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:px-1.5",
|
|
443
|
+
className
|
|
444
|
+
),
|
|
445
|
+
"data-ds": "",
|
|
446
|
+
"data-ds-component": "sidebar-header",
|
|
447
|
+
"data-sidebar": "header",
|
|
448
|
+
...rest,
|
|
449
|
+
children
|
|
450
|
+
}
|
|
451
|
+
);
|
|
452
|
+
}
|
|
453
|
+
);
|
|
454
|
+
SidebarHeader.displayName = "SidebarHeader";
|
|
455
|
+
const SidebarContent = forwardRef(
|
|
456
|
+
function SidebarContent2({ className, children, ...rest }, ref) {
|
|
457
|
+
return /* @__PURE__ */ jsx(
|
|
458
|
+
"div",
|
|
459
|
+
{
|
|
460
|
+
ref,
|
|
461
|
+
className: cn(
|
|
462
|
+
"flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden",
|
|
463
|
+
"group-data-[collapsible=icon]:items-center",
|
|
464
|
+
className
|
|
465
|
+
),
|
|
466
|
+
"data-ds": "",
|
|
467
|
+
"data-ds-component": "sidebar-content",
|
|
468
|
+
"data-sidebar": "content",
|
|
469
|
+
...rest,
|
|
470
|
+
children
|
|
471
|
+
}
|
|
472
|
+
);
|
|
473
|
+
}
|
|
474
|
+
);
|
|
475
|
+
SidebarContent.displayName = "SidebarContent";
|
|
476
|
+
const SidebarFooter = forwardRef(
|
|
477
|
+
function SidebarFooter2({ className, children, ...rest }, ref) {
|
|
478
|
+
return /* @__PURE__ */ jsx(
|
|
479
|
+
"div",
|
|
480
|
+
{
|
|
481
|
+
ref,
|
|
482
|
+
className: cn(
|
|
483
|
+
"flex flex-col gap-2 p-2",
|
|
484
|
+
"group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:px-1.5",
|
|
485
|
+
className
|
|
486
|
+
),
|
|
487
|
+
"data-ds": "",
|
|
488
|
+
"data-ds-component": "sidebar-footer",
|
|
489
|
+
"data-sidebar": "footer",
|
|
490
|
+
...rest,
|
|
491
|
+
children
|
|
492
|
+
}
|
|
493
|
+
);
|
|
494
|
+
}
|
|
495
|
+
);
|
|
496
|
+
SidebarFooter.displayName = "SidebarFooter";
|
|
497
|
+
const SidebarSeparator = forwardRef(function SidebarSeparator2({ className, ...rest }, ref) {
|
|
498
|
+
return /* @__PURE__ */ jsx(
|
|
499
|
+
"hr",
|
|
500
|
+
{
|
|
501
|
+
ref,
|
|
502
|
+
className: cn("mx-2 w-auto border-sidebar-border", className),
|
|
503
|
+
"data-ds": "",
|
|
504
|
+
"data-ds-component": "sidebar-separator",
|
|
505
|
+
"data-sidebar": "separator",
|
|
506
|
+
...rest
|
|
507
|
+
}
|
|
508
|
+
);
|
|
509
|
+
});
|
|
510
|
+
SidebarSeparator.displayName = "SidebarSeparator";
|
|
511
|
+
const SidebarInput = forwardRef(
|
|
512
|
+
function SidebarInput2({ className, ...rest }, ref) {
|
|
513
|
+
return /* @__PURE__ */ jsx(
|
|
514
|
+
"input",
|
|
515
|
+
{
|
|
516
|
+
ref,
|
|
517
|
+
className: cn(
|
|
518
|
+
"h-8 w-full rounded-md border border-sidebar-border bg-background px-3",
|
|
519
|
+
"text-sm text-sidebar-foreground placeholder:text-sidebar-foreground/50",
|
|
520
|
+
"transition-[border-color,box-shadow] duration-fast",
|
|
521
|
+
"focus:border-sidebar-ring focus:outline-none focus:ring-2 focus:ring-sidebar-ring/20",
|
|
522
|
+
className
|
|
523
|
+
),
|
|
524
|
+
"data-ds": "",
|
|
525
|
+
"data-ds-component": "sidebar-input",
|
|
526
|
+
"data-sidebar": "input",
|
|
527
|
+
...rest
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
}
|
|
531
|
+
);
|
|
532
|
+
SidebarInput.displayName = "SidebarInput";
|
|
533
|
+
const SidebarGroup = forwardRef(
|
|
534
|
+
function SidebarGroup2({ className, children, ...rest }, ref) {
|
|
535
|
+
return /* @__PURE__ */ jsx(
|
|
536
|
+
"div",
|
|
537
|
+
{
|
|
538
|
+
ref,
|
|
539
|
+
className: cn(
|
|
540
|
+
"relative flex w-full min-w-0 flex-col p-2",
|
|
541
|
+
"group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:px-1.5",
|
|
542
|
+
className
|
|
543
|
+
),
|
|
544
|
+
"data-ds": "",
|
|
545
|
+
"data-ds-component": "sidebar-group",
|
|
546
|
+
"data-sidebar": "group",
|
|
547
|
+
...rest,
|
|
548
|
+
children
|
|
549
|
+
}
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
);
|
|
553
|
+
SidebarGroup.displayName = "SidebarGroup";
|
|
554
|
+
const SidebarGroupLabel = forwardRef(function SidebarGroupLabel2({ className, asChild = false, children, ...rest }, ref) {
|
|
555
|
+
const { state } = useSidebar();
|
|
556
|
+
const classes = cn(
|
|
557
|
+
"flex h-8 shrink-0 items-center rounded-md px-2",
|
|
558
|
+
"text-xs font-medium text-sidebar-foreground/70",
|
|
559
|
+
"outline-none ring-sidebar-ring",
|
|
560
|
+
"transition-[margin,opacity,padding] duration-200 ease-linear",
|
|
561
|
+
// When collapsed to icon mode, hide label
|
|
562
|
+
state === "collapsed" && "opacity-0 overflow-hidden h-0 p-0 m-0",
|
|
563
|
+
className
|
|
564
|
+
);
|
|
565
|
+
if (asChild) {
|
|
566
|
+
return /* @__PURE__ */ jsx(
|
|
567
|
+
"div",
|
|
568
|
+
{
|
|
569
|
+
ref,
|
|
570
|
+
className: classes,
|
|
571
|
+
"data-ds": "",
|
|
572
|
+
"data-ds-component": "sidebar-group-label",
|
|
573
|
+
"data-sidebar": "group-label",
|
|
574
|
+
...rest,
|
|
575
|
+
children
|
|
576
|
+
}
|
|
577
|
+
);
|
|
578
|
+
}
|
|
579
|
+
return /* @__PURE__ */ jsx(
|
|
580
|
+
"div",
|
|
581
|
+
{
|
|
582
|
+
ref,
|
|
583
|
+
className: classes,
|
|
584
|
+
"data-ds": "",
|
|
585
|
+
"data-ds-component": "sidebar-group-label",
|
|
586
|
+
"data-sidebar": "group-label",
|
|
587
|
+
...rest,
|
|
588
|
+
children
|
|
589
|
+
}
|
|
590
|
+
);
|
|
591
|
+
});
|
|
592
|
+
SidebarGroupLabel.displayName = "SidebarGroupLabel";
|
|
593
|
+
const SidebarGroupAction = forwardRef(function SidebarGroupAction2({ className, children, ...rest }, ref) {
|
|
594
|
+
const { state } = useSidebar();
|
|
595
|
+
return /* @__PURE__ */ jsx(
|
|
596
|
+
"button",
|
|
597
|
+
{
|
|
598
|
+
ref,
|
|
599
|
+
type: "button",
|
|
600
|
+
className: cn(
|
|
601
|
+
"absolute right-3 top-3.5 flex items-center justify-center",
|
|
602
|
+
"size-5 rounded-md p-0",
|
|
603
|
+
"text-sidebar-foreground/70 ring-sidebar-ring",
|
|
604
|
+
"outline-none",
|
|
605
|
+
"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
606
|
+
"transition-transform duration-200",
|
|
607
|
+
focusRingClasses,
|
|
608
|
+
"[&>svg]:size-4 [&>svg]:shrink-0",
|
|
609
|
+
// When icon-collapsed, hide
|
|
610
|
+
state === "collapsed" && "hidden",
|
|
611
|
+
className
|
|
612
|
+
),
|
|
613
|
+
"data-ds": "",
|
|
614
|
+
"data-ds-component": "sidebar-group-action",
|
|
615
|
+
"data-sidebar": "group-action",
|
|
616
|
+
...rest,
|
|
617
|
+
children
|
|
618
|
+
}
|
|
619
|
+
);
|
|
620
|
+
});
|
|
621
|
+
SidebarGroupAction.displayName = "SidebarGroupAction";
|
|
622
|
+
const SidebarGroupContent = forwardRef(function SidebarGroupContent2({ className, children, ...rest }, ref) {
|
|
623
|
+
return /* @__PURE__ */ jsx(
|
|
624
|
+
"div",
|
|
625
|
+
{
|
|
626
|
+
ref,
|
|
627
|
+
className: cn("w-full text-sm", className),
|
|
628
|
+
"data-ds": "",
|
|
629
|
+
"data-ds-component": "sidebar-group-content",
|
|
630
|
+
"data-sidebar": "group-content",
|
|
631
|
+
...rest,
|
|
632
|
+
children
|
|
633
|
+
}
|
|
634
|
+
);
|
|
635
|
+
});
|
|
636
|
+
SidebarGroupContent.displayName = "SidebarGroupContent";
|
|
637
|
+
const SidebarMenu = forwardRef(
|
|
638
|
+
function SidebarMenu2({ className, children, ...rest }, ref) {
|
|
639
|
+
return /* @__PURE__ */ jsx(
|
|
640
|
+
"ul",
|
|
641
|
+
{
|
|
642
|
+
ref,
|
|
643
|
+
className: cn(
|
|
644
|
+
"flex w-full min-w-0 flex-col gap-1 list-none m-0 p-0",
|
|
645
|
+
"group-data-[collapsible=icon]:items-center",
|
|
646
|
+
className
|
|
647
|
+
),
|
|
648
|
+
"data-ds": "",
|
|
649
|
+
"data-ds-component": "sidebar-menu",
|
|
650
|
+
"data-sidebar": "menu",
|
|
651
|
+
...rest,
|
|
652
|
+
children
|
|
653
|
+
}
|
|
654
|
+
);
|
|
655
|
+
}
|
|
656
|
+
);
|
|
657
|
+
SidebarMenu.displayName = "SidebarMenu";
|
|
658
|
+
const SidebarMenuItem = forwardRef(
|
|
659
|
+
function SidebarMenuItem2({ className, children, ...rest }, ref) {
|
|
660
|
+
return /* @__PURE__ */ jsx(
|
|
661
|
+
"li",
|
|
662
|
+
{
|
|
663
|
+
ref,
|
|
664
|
+
className: cn("group/menu-item relative list-none m-0 p-0", className),
|
|
665
|
+
"data-ds": "",
|
|
666
|
+
"data-ds-component": "sidebar-menu-item",
|
|
667
|
+
"data-sidebar": "menu-item",
|
|
668
|
+
...rest,
|
|
669
|
+
children
|
|
670
|
+
}
|
|
671
|
+
);
|
|
672
|
+
}
|
|
673
|
+
);
|
|
674
|
+
SidebarMenuItem.displayName = "SidebarMenuItem";
|
|
675
|
+
const SidebarMenuButton = forwardRef(function SidebarMenuButton2({
|
|
676
|
+
isActive = false,
|
|
677
|
+
size = "default",
|
|
678
|
+
variant = "default",
|
|
679
|
+
tooltip,
|
|
680
|
+
asChild = false,
|
|
681
|
+
className,
|
|
682
|
+
children,
|
|
683
|
+
...rest
|
|
684
|
+
}, ref) {
|
|
685
|
+
const { state, isMobile, collapsible } = useSidebar();
|
|
686
|
+
const isCollapsed = state === "collapsed" && collapsible === "icon";
|
|
687
|
+
const lgExpandedLayout = !isCollapsed ? [
|
|
688
|
+
"[&>*:nth-child(2)]:flex-1 [&>*:nth-child(2)]:min-w-0",
|
|
689
|
+
"[&>*:nth-child(2)]:grid [&>*:nth-child(2)]:text-left [&>*:nth-child(2)]:text-sm [&>*:nth-child(2)]:leading-tight",
|
|
690
|
+
"[&>*:nth-child(2)_span]:truncate",
|
|
691
|
+
"[&>svg:last-child]:ml-auto [&>svg:last-child]:shrink-0"
|
|
692
|
+
].join(" ") : "";
|
|
693
|
+
const sizeClasses = {
|
|
694
|
+
sm: "h-7 text-xs",
|
|
695
|
+
default: "h-8 text-sm",
|
|
696
|
+
lg: [
|
|
697
|
+
"h-12 text-sm",
|
|
698
|
+
lgExpandedLayout,
|
|
699
|
+
// lg collapsed: shrink height to match default buttons and scale
|
|
700
|
+
// the first-child wrapper (logo div, Avatar) to 24px so it fits
|
|
701
|
+
// neatly inside the 32px collapsed button.
|
|
702
|
+
"group-data-[collapsible=icon]:!h-8",
|
|
703
|
+
"group-data-[collapsible=icon]:[&>:first-child]:!size-6",
|
|
704
|
+
"group-data-[collapsible=icon]:[&>:first-child]:shrink-0",
|
|
705
|
+
"group-data-[collapsible=icon]:[&>:first-child]:overflow-hidden",
|
|
706
|
+
"group-data-[collapsible=icon]:[&>:first-child]:rounded-md"
|
|
707
|
+
].join(" ")
|
|
708
|
+
};
|
|
709
|
+
const buttonClasses = cn(
|
|
710
|
+
// Base
|
|
711
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2",
|
|
712
|
+
"outline-none ring-sidebar-ring",
|
|
713
|
+
"transition-[width,height,padding] duration-200 ease-linear",
|
|
714
|
+
focusRingClasses,
|
|
715
|
+
// Active & hover states
|
|
716
|
+
"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
717
|
+
"active:bg-sidebar-accent active:text-sidebar-accent-foreground",
|
|
718
|
+
// Size
|
|
719
|
+
sizeClasses[size],
|
|
720
|
+
// Variant
|
|
721
|
+
variant === "outline" && "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:shadow-[0_0_0_1px_var(--sidebar-accent)]",
|
|
722
|
+
// Active
|
|
723
|
+
isActive && "bg-sidebar-accent text-sidebar-accent-foreground font-medium",
|
|
724
|
+
// Icon collapse — fixed 32px button, no padding, center the icon,
|
|
725
|
+
// hide everything except the first child (icon/avatar).
|
|
726
|
+
// Plain <svg> icons stay at size-4 (16px); lg wrapper divs are
|
|
727
|
+
// handled separately by the lg sizeClass above.
|
|
728
|
+
isCollapsed && "!size-8 !p-0 !gap-0 justify-center [&>*:not(:first-child)]:hidden [&>svg]:size-4",
|
|
729
|
+
// Disabled
|
|
730
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
731
|
+
// Icon sizing
|
|
732
|
+
"[&>svg]:size-4 [&>svg]:shrink-0",
|
|
733
|
+
className
|
|
734
|
+
);
|
|
735
|
+
const button = asChild ? /* @__PURE__ */ jsx(
|
|
736
|
+
"span",
|
|
737
|
+
{
|
|
738
|
+
ref,
|
|
739
|
+
className: buttonClasses,
|
|
740
|
+
"data-ds": "",
|
|
741
|
+
"data-ds-component": "sidebar-menu-button",
|
|
742
|
+
"data-sidebar": "menu-button",
|
|
743
|
+
"data-size": size,
|
|
744
|
+
"data-active": isActive ? "" : void 0,
|
|
745
|
+
children
|
|
746
|
+
}
|
|
747
|
+
) : /* @__PURE__ */ jsx(
|
|
748
|
+
"button",
|
|
749
|
+
{
|
|
750
|
+
ref,
|
|
751
|
+
type: "button",
|
|
752
|
+
className: buttonClasses,
|
|
753
|
+
"aria-current": isActive ? "page" : void 0,
|
|
754
|
+
"data-ds": "",
|
|
755
|
+
"data-ds-component": "sidebar-menu-button",
|
|
756
|
+
"data-sidebar": "menu-button",
|
|
757
|
+
"data-size": size,
|
|
758
|
+
"data-active": isActive ? "" : void 0,
|
|
759
|
+
...rest,
|
|
760
|
+
children
|
|
761
|
+
}
|
|
762
|
+
);
|
|
763
|
+
if (!tooltip || isMobile) {
|
|
764
|
+
return button;
|
|
765
|
+
}
|
|
766
|
+
if (!isCollapsed) {
|
|
767
|
+
return button;
|
|
768
|
+
}
|
|
769
|
+
const tooltipContent = typeof tooltip === "string" ? tooltip : tooltip;
|
|
770
|
+
return /* @__PURE__ */ jsxs(TooltipPrimitive.Root, { children: [
|
|
771
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { asChild: true, children: button }),
|
|
772
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
773
|
+
TooltipPrimitive.Content,
|
|
774
|
+
{
|
|
775
|
+
side: "right",
|
|
776
|
+
align: "center",
|
|
777
|
+
sideOffset: 4,
|
|
778
|
+
className: cn(
|
|
779
|
+
"z-(--z-tooltip,9999)",
|
|
780
|
+
"overflow-hidden rounded-md px-3 py-1.5",
|
|
781
|
+
"bg-sidebar-primary text-sidebar-primary-foreground",
|
|
782
|
+
"text-xs font-medium",
|
|
783
|
+
"animate-in fade-in-0 zoom-in-95",
|
|
784
|
+
"data-[side=right]:slide-in-from-left-2"
|
|
785
|
+
),
|
|
786
|
+
children: tooltipContent
|
|
787
|
+
}
|
|
788
|
+
) })
|
|
789
|
+
] });
|
|
790
|
+
});
|
|
791
|
+
SidebarMenuButton.displayName = "SidebarMenuButton";
|
|
792
|
+
const SidebarMenuAction = forwardRef(function SidebarMenuAction2({ showOnHover = false, className, children, ...rest }, ref) {
|
|
793
|
+
const { state } = useSidebar();
|
|
794
|
+
return /* @__PURE__ */ jsx(
|
|
795
|
+
"button",
|
|
796
|
+
{
|
|
797
|
+
ref,
|
|
798
|
+
type: "button",
|
|
799
|
+
className: cn(
|
|
800
|
+
"absolute right-1 top-1.5 flex items-center justify-center",
|
|
801
|
+
"size-5 rounded-md p-0",
|
|
802
|
+
"text-sidebar-foreground/70 outline-none ring-sidebar-ring",
|
|
803
|
+
"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
804
|
+
"transition-opacity duration-fast",
|
|
805
|
+
focusRingClasses,
|
|
806
|
+
"[&>svg]:size-4 [&>svg]:shrink-0",
|
|
807
|
+
// Show on hover only
|
|
808
|
+
showOnHover && "opacity-0 group-hover/menu-item:opacity-100 group-focus-within/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground",
|
|
809
|
+
// Hide when collapsed to icon mode
|
|
810
|
+
state === "collapsed" && "hidden",
|
|
811
|
+
className
|
|
812
|
+
),
|
|
813
|
+
"data-ds": "",
|
|
814
|
+
"data-ds-component": "sidebar-menu-action",
|
|
815
|
+
"data-sidebar": "menu-action",
|
|
816
|
+
...rest,
|
|
817
|
+
children
|
|
818
|
+
}
|
|
819
|
+
);
|
|
820
|
+
});
|
|
821
|
+
SidebarMenuAction.displayName = "SidebarMenuAction";
|
|
822
|
+
const SidebarMenuBadge = forwardRef(function SidebarMenuBadge2({ className, children, ...rest }, ref) {
|
|
823
|
+
const { state } = useSidebar();
|
|
824
|
+
return /* @__PURE__ */ jsx(
|
|
825
|
+
"div",
|
|
826
|
+
{
|
|
827
|
+
ref,
|
|
828
|
+
className: cn(
|
|
829
|
+
"absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1",
|
|
830
|
+
"text-xs font-medium tabular-nums text-sidebar-foreground",
|
|
831
|
+
"select-none pointer-events-none",
|
|
832
|
+
// Hide when collapsed
|
|
833
|
+
state === "collapsed" && "hidden",
|
|
834
|
+
className
|
|
835
|
+
),
|
|
836
|
+
"data-ds": "",
|
|
837
|
+
"data-ds-component": "sidebar-menu-badge",
|
|
838
|
+
"data-sidebar": "menu-badge",
|
|
839
|
+
...rest,
|
|
840
|
+
children
|
|
841
|
+
}
|
|
842
|
+
);
|
|
843
|
+
});
|
|
844
|
+
SidebarMenuBadge.displayName = "SidebarMenuBadge";
|
|
845
|
+
const SidebarMenuSkeleton = forwardRef(function SidebarMenuSkeleton2({ className, showIcon = false, ...rest }, ref) {
|
|
846
|
+
const width = useMemo(() => {
|
|
847
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
848
|
+
}, []);
|
|
849
|
+
return /* @__PURE__ */ jsxs(
|
|
850
|
+
"div",
|
|
851
|
+
{
|
|
852
|
+
ref,
|
|
853
|
+
className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
|
|
854
|
+
"data-ds": "",
|
|
855
|
+
"data-ds-component": "sidebar-menu-skeleton",
|
|
856
|
+
"data-sidebar": "menu-skeleton",
|
|
857
|
+
...rest,
|
|
858
|
+
children: [
|
|
859
|
+
showIcon && /* @__PURE__ */ jsx("div", { className: "size-4 rounded-md bg-sidebar-accent animate-pulse" }),
|
|
860
|
+
/* @__PURE__ */ jsx(
|
|
861
|
+
"div",
|
|
862
|
+
{
|
|
863
|
+
className: "h-4 max-w-[--skeleton-width] flex-1 rounded-md bg-sidebar-accent animate-pulse",
|
|
864
|
+
style: { "--skeleton-width": width }
|
|
865
|
+
}
|
|
866
|
+
)
|
|
867
|
+
]
|
|
868
|
+
}
|
|
869
|
+
);
|
|
870
|
+
});
|
|
871
|
+
SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton";
|
|
872
|
+
const SidebarMenuSub = forwardRef(
|
|
873
|
+
function SidebarMenuSub2({ className, children, ...rest }, ref) {
|
|
874
|
+
const { state } = useSidebar();
|
|
875
|
+
return /* @__PURE__ */ jsx(
|
|
876
|
+
"ul",
|
|
877
|
+
{
|
|
878
|
+
ref,
|
|
879
|
+
className: cn(
|
|
880
|
+
"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 list-none m-0 p-0",
|
|
881
|
+
"border-l border-sidebar-border pl-2.5 py-0.5",
|
|
882
|
+
// Hide when collapsed to icon
|
|
883
|
+
state === "collapsed" && "hidden",
|
|
884
|
+
className
|
|
885
|
+
),
|
|
886
|
+
"data-ds": "",
|
|
887
|
+
"data-ds-component": "sidebar-menu-sub",
|
|
888
|
+
"data-sidebar": "menu-sub",
|
|
889
|
+
...rest,
|
|
890
|
+
children
|
|
891
|
+
}
|
|
892
|
+
);
|
|
893
|
+
}
|
|
894
|
+
);
|
|
895
|
+
SidebarMenuSub.displayName = "SidebarMenuSub";
|
|
896
|
+
const SidebarMenuSubItem = forwardRef(function SidebarMenuSubItem2({ className, children, ...rest }, ref) {
|
|
897
|
+
return /* @__PURE__ */ jsx(
|
|
898
|
+
"li",
|
|
899
|
+
{
|
|
900
|
+
ref,
|
|
901
|
+
className: cn("list-none m-0 p-0", className),
|
|
902
|
+
"data-ds": "",
|
|
903
|
+
"data-ds-component": "sidebar-menu-sub-item",
|
|
904
|
+
"data-sidebar": "menu-sub-item",
|
|
905
|
+
...rest,
|
|
906
|
+
children
|
|
907
|
+
}
|
|
908
|
+
);
|
|
909
|
+
});
|
|
910
|
+
SidebarMenuSubItem.displayName = "SidebarMenuSubItem";
|
|
911
|
+
const SidebarMenuSubButton = forwardRef(function SidebarMenuSubButton2({ isActive = false, size = "md", className, children, ...rest }, ref) {
|
|
912
|
+
return /* @__PURE__ */ jsx(
|
|
913
|
+
"a",
|
|
914
|
+
{
|
|
915
|
+
ref,
|
|
916
|
+
className: cn(
|
|
917
|
+
"flex min-w-0 items-center gap-2 overflow-hidden rounded-md px-2 no-underline",
|
|
918
|
+
"text-sidebar-foreground/70 outline-none ring-sidebar-ring",
|
|
919
|
+
"transition-colors duration-fast",
|
|
920
|
+
"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:no-underline",
|
|
921
|
+
focusRingClasses,
|
|
922
|
+
size === "sm" ? "h-6 text-xs" : "h-7 text-xs",
|
|
923
|
+
isActive && "bg-sidebar-accent text-sidebar-accent-foreground font-medium",
|
|
924
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
925
|
+
"[&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
|
|
926
|
+
className
|
|
927
|
+
),
|
|
928
|
+
"aria-current": isActive ? "page" : void 0,
|
|
929
|
+
"data-ds": "",
|
|
930
|
+
"data-ds-component": "sidebar-menu-sub-button",
|
|
931
|
+
"data-sidebar": "menu-sub-button",
|
|
932
|
+
"data-active": isActive ? "" : void 0,
|
|
933
|
+
...rest,
|
|
934
|
+
children
|
|
935
|
+
}
|
|
936
|
+
);
|
|
937
|
+
});
|
|
938
|
+
SidebarMenuSubButton.displayName = "SidebarMenuSubButton";
|
|
939
|
+
const SidebarSection = SidebarGroup;
|
|
940
|
+
const SidebarItem = forwardRef(
|
|
941
|
+
function SidebarItem2({
|
|
942
|
+
icon,
|
|
943
|
+
label,
|
|
944
|
+
active = false,
|
|
945
|
+
disabled = false,
|
|
946
|
+
badge,
|
|
947
|
+
href,
|
|
948
|
+
className,
|
|
949
|
+
children,
|
|
950
|
+
...rest
|
|
951
|
+
}, ref) {
|
|
952
|
+
const { state } = useSidebar();
|
|
953
|
+
const isCollapsed = state === "collapsed";
|
|
954
|
+
const Tag = href ? "a" : "button";
|
|
955
|
+
return /* @__PURE__ */ jsxs(
|
|
956
|
+
Tag,
|
|
957
|
+
{
|
|
958
|
+
ref,
|
|
959
|
+
href,
|
|
960
|
+
type: href ? void 0 : "button",
|
|
961
|
+
disabled,
|
|
962
|
+
"aria-current": active ? "page" : void 0,
|
|
963
|
+
className: cn(
|
|
964
|
+
"flex items-center gap-3 px-2 py-2 rounded-md w-full",
|
|
965
|
+
"text-sm font-medium leading-none",
|
|
966
|
+
"transition-colors duration-fast",
|
|
967
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
968
|
+
focusRingClasses,
|
|
969
|
+
active ? "bg-sidebar-accent text-sidebar-accent-foreground" : "text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent/60",
|
|
970
|
+
isCollapsed && "justify-center",
|
|
971
|
+
className
|
|
972
|
+
),
|
|
973
|
+
title: isCollapsed && typeof label === "string" ? label : void 0,
|
|
974
|
+
"data-ds": "",
|
|
975
|
+
"data-ds-component": "sidebar-item",
|
|
976
|
+
"data-ds-active": active ? "" : void 0,
|
|
977
|
+
...rest,
|
|
978
|
+
children: [
|
|
979
|
+
icon && /* @__PURE__ */ jsx("span", { className: "shrink-0 size-5 flex items-center justify-center", children: icon }),
|
|
980
|
+
/* @__PURE__ */ jsx(AnimatePresence, { children: !isCollapsed && (label || children) && /* @__PURE__ */ jsx(
|
|
981
|
+
motion.span,
|
|
982
|
+
{
|
|
983
|
+
className: "flex-1 truncate",
|
|
984
|
+
initial: { opacity: 0, width: 0 },
|
|
985
|
+
animate: { opacity: 1, width: "auto" },
|
|
986
|
+
exit: { opacity: 0, width: 0 },
|
|
987
|
+
transition: { duration: 0.15 },
|
|
988
|
+
"data-ds-animated": "",
|
|
989
|
+
children: label ?? children
|
|
990
|
+
}
|
|
991
|
+
) }),
|
|
992
|
+
badge && !isCollapsed && /* @__PURE__ */ jsx("span", { className: "shrink-0", children: badge })
|
|
993
|
+
]
|
|
994
|
+
}
|
|
995
|
+
);
|
|
996
|
+
}
|
|
997
|
+
);
|
|
998
|
+
SidebarItem.displayName = "SidebarItem";
|
|
999
|
+
function SidebarMobileOverlay(_props) {
|
|
1000
|
+
return null;
|
|
1001
|
+
}
|
|
1002
|
+
SidebarMobileOverlay.displayName = "SidebarMobileOverlay";
|
|
1003
|
+
export {
|
|
1004
|
+
Sidebar,
|
|
1005
|
+
SidebarContent,
|
|
1006
|
+
SidebarFooter,
|
|
1007
|
+
SidebarGroup,
|
|
1008
|
+
SidebarGroupAction,
|
|
1009
|
+
SidebarGroupContent,
|
|
1010
|
+
SidebarGroupLabel,
|
|
1011
|
+
SidebarHeader,
|
|
1012
|
+
SidebarInput,
|
|
1013
|
+
SidebarInset,
|
|
1014
|
+
SidebarItem,
|
|
1015
|
+
SidebarMenu,
|
|
1016
|
+
SidebarMenuAction,
|
|
1017
|
+
SidebarMenuBadge,
|
|
1018
|
+
SidebarMenuButton,
|
|
1019
|
+
SidebarMenuItem,
|
|
1020
|
+
SidebarMenuSkeleton,
|
|
1021
|
+
SidebarMenuSub,
|
|
1022
|
+
SidebarMenuSubButton,
|
|
1023
|
+
SidebarMenuSubItem,
|
|
1024
|
+
SidebarMobileOverlay,
|
|
1025
|
+
SidebarProvider,
|
|
1026
|
+
SidebarRail,
|
|
1027
|
+
SidebarSection,
|
|
1028
|
+
SidebarSeparator,
|
|
1029
|
+
SidebarToggle,
|
|
1030
|
+
SidebarTrigger,
|
|
1031
|
+
useSidebar,
|
|
1032
|
+
useSidebarContext
|
|
1033
|
+
};
|