@work-rjkashyap/unified-ui 0.3.3 → 0.3.5
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 -1933
- 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-IVZAB7BV.mjs → tokens/colors.cjs} +212 -86
- package/dist/{z-index-Dd8IllRx.d.cts → tokens/colors.d.cts} +235 -72
- package/dist/{z-index-Dd8IllRx.d.ts → tokens/colors.d.ts} +235 -72
- package/dist/{chunk-ZBGR7MUW.cjs → tokens/colors.mjs} +165 -104
- 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-5TP7J7T4.cjs +0 -1766
- package/dist/chunk-A2DGHQL2.cjs +0 -21808
- package/dist/chunk-EQWESXRH.mjs +0 -1735
- 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-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 -131
- package/dist/theme.d.cts +0 -414
- package/dist/theme.d.ts +0 -414
- 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
package/dist/chunk-5TP7J7T4.cjs
DELETED
|
@@ -1,1766 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkZBGR7MUW_cjs = require('./chunk-ZBGR7MUW.cjs');
|
|
4
|
-
var chunkECIGDEAH_cjs = require('./chunk-ECIGDEAH.cjs');
|
|
5
|
-
var chunkXCKK6P46_cjs = require('./chunk-XCKK6P46.cjs');
|
|
6
|
-
var chunk4ON3M3OM_cjs = require('./chunk-4ON3M3OM.cjs');
|
|
7
|
-
var react = require('react');
|
|
8
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
-
|
|
10
|
-
// src/theme/contract.ts
|
|
11
|
-
var colorVarNames = {
|
|
12
|
-
background: "--background",
|
|
13
|
-
foreground: "--foreground",
|
|
14
|
-
surface: "--surface",
|
|
15
|
-
surfaceRaised: "--surface-raised",
|
|
16
|
-
surfaceOverlay: "--surface-overlay",
|
|
17
|
-
card: "--card",
|
|
18
|
-
cardForeground: "--card-foreground",
|
|
19
|
-
popover: "--popover",
|
|
20
|
-
popoverForeground: "--popover-foreground",
|
|
21
|
-
muted: "--muted",
|
|
22
|
-
mutedForeground: "--muted-foreground",
|
|
23
|
-
primary: "--primary",
|
|
24
|
-
primaryForeground: "--primary-foreground",
|
|
25
|
-
primaryHover: "--primary-hover",
|
|
26
|
-
primaryActive: "--primary-active",
|
|
27
|
-
primaryMuted: "--primary-muted",
|
|
28
|
-
primaryMutedForeground: "--primary-muted-foreground",
|
|
29
|
-
secondary: "--secondary",
|
|
30
|
-
secondaryForeground: "--secondary-foreground",
|
|
31
|
-
secondaryHover: "--secondary-hover",
|
|
32
|
-
secondaryActive: "--secondary-active",
|
|
33
|
-
accent: "--accent",
|
|
34
|
-
accentForeground: "--accent-foreground",
|
|
35
|
-
success: "--success",
|
|
36
|
-
successForeground: "--success-foreground",
|
|
37
|
-
successMuted: "--success-muted",
|
|
38
|
-
successMutedForeground: "--success-muted-foreground",
|
|
39
|
-
warning: "--warning",
|
|
40
|
-
warningForeground: "--warning-foreground",
|
|
41
|
-
warningMuted: "--warning-muted",
|
|
42
|
-
warningMutedForeground: "--warning-muted-foreground",
|
|
43
|
-
danger: "--danger",
|
|
44
|
-
dangerForeground: "--danger-foreground",
|
|
45
|
-
dangerHover: "--danger-hover",
|
|
46
|
-
dangerActive: "--danger-active",
|
|
47
|
-
dangerMuted: "--danger-muted",
|
|
48
|
-
dangerMutedForeground: "--danger-muted-foreground",
|
|
49
|
-
destructive: "--destructive",
|
|
50
|
-
destructiveForeground: "--destructive-foreground",
|
|
51
|
-
info: "--info",
|
|
52
|
-
infoForeground: "--info-foreground",
|
|
53
|
-
infoMuted: "--info-muted",
|
|
54
|
-
infoMutedForeground: "--info-muted-foreground",
|
|
55
|
-
border: "--border",
|
|
56
|
-
borderMuted: "--border-muted",
|
|
57
|
-
borderStrong: "--border-strong",
|
|
58
|
-
focusRing: "--focus-ring",
|
|
59
|
-
ring: "--ring",
|
|
60
|
-
input: "--input",
|
|
61
|
-
inputForeground: "--input-foreground",
|
|
62
|
-
inputPlaceholder: "--input-placeholder",
|
|
63
|
-
disabled: "--disabled",
|
|
64
|
-
disabledForeground: "--disabled-foreground",
|
|
65
|
-
chart1: "--chart-1",
|
|
66
|
-
chart2: "--chart-2",
|
|
67
|
-
chart3: "--chart-3",
|
|
68
|
-
chart4: "--chart-4",
|
|
69
|
-
chart5: "--chart-5",
|
|
70
|
-
sidebar: "--sidebar",
|
|
71
|
-
sidebarForeground: "--sidebar-foreground",
|
|
72
|
-
sidebarPrimary: "--sidebar-primary",
|
|
73
|
-
sidebarPrimaryForeground: "--sidebar-primary-foreground",
|
|
74
|
-
sidebarAccent: "--sidebar-accent",
|
|
75
|
-
sidebarAccentForeground: "--sidebar-accent-foreground",
|
|
76
|
-
sidebarBorder: "--sidebar-border",
|
|
77
|
-
sidebarRing: "--sidebar-ring"
|
|
78
|
-
};
|
|
79
|
-
var radiusVarNames = {
|
|
80
|
-
none: "--radius-none",
|
|
81
|
-
sm: "--radius-sm",
|
|
82
|
-
md: "--radius-md",
|
|
83
|
-
lg: "--radius-lg",
|
|
84
|
-
xl: "--radius-xl",
|
|
85
|
-
full: "--radius-full"
|
|
86
|
-
};
|
|
87
|
-
var shadowVarNames = {
|
|
88
|
-
none: "--shadow-none",
|
|
89
|
-
xs: "--shadow-xs",
|
|
90
|
-
sm: "--shadow-sm",
|
|
91
|
-
md: "--shadow-md",
|
|
92
|
-
lg: "--shadow-lg",
|
|
93
|
-
xl: "--shadow-xl",
|
|
94
|
-
"2xl": "--shadow-2xl",
|
|
95
|
-
focusRing: "--shadow-focus-ring"
|
|
96
|
-
};
|
|
97
|
-
var zIndexVarNames = {
|
|
98
|
-
base: "--z-base",
|
|
99
|
-
dropdown: "--z-dropdown",
|
|
100
|
-
sticky: "--z-sticky",
|
|
101
|
-
overlay: "--z-overlay",
|
|
102
|
-
modal: "--z-modal",
|
|
103
|
-
popover: "--z-popover",
|
|
104
|
-
toast: "--z-toast",
|
|
105
|
-
tooltip: "--z-tooltip",
|
|
106
|
-
max: "--z-max"
|
|
107
|
-
};
|
|
108
|
-
var durationVarNames = {
|
|
109
|
-
instant: "--duration-instant",
|
|
110
|
-
fast: "--duration-fast",
|
|
111
|
-
moderate: "--duration-moderate",
|
|
112
|
-
normal: "--duration-normal",
|
|
113
|
-
slow: "--duration-slow",
|
|
114
|
-
slower: "--duration-slower",
|
|
115
|
-
slowest: "--duration-slowest"
|
|
116
|
-
};
|
|
117
|
-
var easingVarNames = {
|
|
118
|
-
standard: "--easing-standard",
|
|
119
|
-
decelerate: "--easing-decelerate",
|
|
120
|
-
accelerate: "--easing-accelerate",
|
|
121
|
-
emphasize: "--easing-emphasize",
|
|
122
|
-
linear: "--easing-linear",
|
|
123
|
-
snap: "--easing-snap"
|
|
124
|
-
};
|
|
125
|
-
var fontFamilyVarNames = {
|
|
126
|
-
display: "--font-display",
|
|
127
|
-
sans: "--font-sans",
|
|
128
|
-
serif: "--font-serif",
|
|
129
|
-
mono: "--font-mono",
|
|
130
|
-
inherit: "--font-inherit"
|
|
131
|
-
};
|
|
132
|
-
function mapRecord(varNames, values) {
|
|
133
|
-
const result = {};
|
|
134
|
-
for (const key of Object.keys(varNames)) {
|
|
135
|
-
result[varNames[key]] = values[key];
|
|
136
|
-
}
|
|
137
|
-
return result;
|
|
138
|
-
}
|
|
139
|
-
function buildLightThemeVars() {
|
|
140
|
-
return {
|
|
141
|
-
...mapRecord(colorVarNames, chunkZBGR7MUW_cjs.semanticLight),
|
|
142
|
-
...mapRecord(radiusVarNames, chunkZBGR7MUW_cjs.radius),
|
|
143
|
-
...mapRecord(shadowVarNames, chunkZBGR7MUW_cjs.shadow),
|
|
144
|
-
...mapRecord(zIndexVarNames, chunkZBGR7MUW_cjs.zIndex),
|
|
145
|
-
...mapRecord(durationVarNames, chunkXCKK6P46_cjs.durationCSS),
|
|
146
|
-
...mapRecord(easingVarNames, chunkXCKK6P46_cjs.easingCSS),
|
|
147
|
-
...mapRecord(fontFamilyVarNames, chunkECIGDEAH_cjs.fontFamily)
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
function buildDarkThemeVars() {
|
|
151
|
-
return {
|
|
152
|
-
...mapRecord(colorVarNames, chunkZBGR7MUW_cjs.semanticDark),
|
|
153
|
-
...mapRecord(radiusVarNames, chunkZBGR7MUW_cjs.radius),
|
|
154
|
-
...mapRecord(shadowVarNames, chunkZBGR7MUW_cjs.shadowDark),
|
|
155
|
-
...mapRecord(zIndexVarNames, chunkZBGR7MUW_cjs.zIndex),
|
|
156
|
-
...mapRecord(durationVarNames, chunkXCKK6P46_cjs.durationCSS),
|
|
157
|
-
...mapRecord(easingVarNames, chunkXCKK6P46_cjs.easingCSS),
|
|
158
|
-
...mapRecord(fontFamilyVarNames, chunkECIGDEAH_cjs.fontFamily)
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
function varsToCSS(vars) {
|
|
162
|
-
return Object.entries(vars).map(([prop, value]) => ` ${prop}: ${value};`).join("\n");
|
|
163
|
-
}
|
|
164
|
-
function buildThemeCSS() {
|
|
165
|
-
const lightVars = buildLightThemeVars();
|
|
166
|
-
const darkVars = buildDarkThemeVars();
|
|
167
|
-
return `:root {
|
|
168
|
-
${varsToCSS(lightVars)}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.dark {
|
|
172
|
-
${varsToCSS(darkVars)}
|
|
173
|
-
}`;
|
|
174
|
-
}
|
|
175
|
-
var contract = {
|
|
176
|
-
color: colorVarNames,
|
|
177
|
-
radius: radiusVarNames,
|
|
178
|
-
shadow: shadowVarNames,
|
|
179
|
-
zIndex: zIndexVarNames,
|
|
180
|
-
duration: durationVarNames,
|
|
181
|
-
easing: easingVarNames,
|
|
182
|
-
fontFamily: fontFamilyVarNames
|
|
183
|
-
};
|
|
184
|
-
var cssVar = {
|
|
185
|
-
/** Returns `var(--<key>)` for use in style props */
|
|
186
|
-
color: (key) => `var(${colorVarNames[key]})`,
|
|
187
|
-
/**
|
|
188
|
-
* Returns a color-mix() expression with a custom alpha channel.
|
|
189
|
-
*
|
|
190
|
-
* Because oklch values are stored as complete `oklch(L C H)` strings
|
|
191
|
-
* in the CSS custom property, you cannot directly decompose them with
|
|
192
|
-
* simple var() references. For alpha-modified colors, prefer using
|
|
193
|
-
* Tailwind's built-in opacity modifier syntax (e.g. `bg-primary/50`)
|
|
194
|
-
* or define a dedicated muted token.
|
|
195
|
-
*
|
|
196
|
-
* If you need programmatic alpha in JS, use this helper which produces
|
|
197
|
-
* a color-mix() expression for broad browser support.
|
|
198
|
-
*/
|
|
199
|
-
colorAlpha: (key, alpha) => `color-mix(in oklch, var(${colorVarNames[key]}) ${Math.round(alpha * 100)}%, transparent)`,
|
|
200
|
-
/** Returns `var(--radius-<key>)` */
|
|
201
|
-
radius: (key) => `var(${radiusVarNames[key]})`,
|
|
202
|
-
/** Returns `var(--shadow-<key>)` */
|
|
203
|
-
shadow: (key) => `var(${shadowVarNames[key]})`,
|
|
204
|
-
/** Returns `var(--z-<key>)` */
|
|
205
|
-
zIndex: (key) => `var(${zIndexVarNames[key]})`,
|
|
206
|
-
/** Returns `var(--duration-<key>)` */
|
|
207
|
-
duration: (key) => `var(${durationVarNames[key]})`,
|
|
208
|
-
/** Returns `var(--easing-<key>)` */
|
|
209
|
-
easing: (key) => `var(${easingVarNames[key]})`,
|
|
210
|
-
/** Returns `var(--font-<key>)` */
|
|
211
|
-
fontFamily: (key) => `var(${fontFamilyVarNames[key]})`,
|
|
212
|
-
/** Returns the raw `var(--<key>)` — same as color() since values are complete oklch */
|
|
213
|
-
colorChannels: (key) => `var(${colorVarNames[key]})`
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
// src/theme/presets.ts
|
|
217
|
-
var STATUS_LIGHT = {
|
|
218
|
-
success: chunkZBGR7MUW_cjs.green[600],
|
|
219
|
-
successForeground: "oklch(0.145 0 0)",
|
|
220
|
-
successMuted: chunkZBGR7MUW_cjs.green[50],
|
|
221
|
-
successMutedForeground: chunkZBGR7MUW_cjs.green[700],
|
|
222
|
-
warning: chunkZBGR7MUW_cjs.amber[500],
|
|
223
|
-
warningForeground: "oklch(0.145 0 0)",
|
|
224
|
-
warningMuted: chunkZBGR7MUW_cjs.amber[50],
|
|
225
|
-
warningMutedForeground: chunkZBGR7MUW_cjs.amber[700],
|
|
226
|
-
danger: chunkZBGR7MUW_cjs.red[600],
|
|
227
|
-
dangerForeground: "oklch(0.985 0 0)",
|
|
228
|
-
dangerHover: chunkZBGR7MUW_cjs.red[700],
|
|
229
|
-
dangerActive: chunkZBGR7MUW_cjs.red[800],
|
|
230
|
-
dangerMuted: chunkZBGR7MUW_cjs.red[50],
|
|
231
|
-
dangerMutedForeground: chunkZBGR7MUW_cjs.red[700],
|
|
232
|
-
destructive: chunkZBGR7MUW_cjs.red[600],
|
|
233
|
-
destructiveForeground: "oklch(0.985 0 0)",
|
|
234
|
-
info: chunkZBGR7MUW_cjs.blue[600],
|
|
235
|
-
infoForeground: "oklch(0.985 0 0)",
|
|
236
|
-
infoMuted: chunkZBGR7MUW_cjs.blue[50],
|
|
237
|
-
infoMutedForeground: chunkZBGR7MUW_cjs.blue[700]
|
|
238
|
-
};
|
|
239
|
-
var STATUS_DARK = {
|
|
240
|
-
success: chunkZBGR7MUW_cjs.green[500],
|
|
241
|
-
successForeground: "oklch(0.145 0 0)",
|
|
242
|
-
successMuted: chunkZBGR7MUW_cjs.green[950],
|
|
243
|
-
successMutedForeground: chunkZBGR7MUW_cjs.green[300],
|
|
244
|
-
warning: chunkZBGR7MUW_cjs.amber[400],
|
|
245
|
-
warningForeground: "oklch(0.145 0 0)",
|
|
246
|
-
warningMuted: chunkZBGR7MUW_cjs.amber[950],
|
|
247
|
-
warningMutedForeground: chunkZBGR7MUW_cjs.amber[300],
|
|
248
|
-
danger: chunkZBGR7MUW_cjs.red[500],
|
|
249
|
-
dangerForeground: "oklch(0.985 0 0)",
|
|
250
|
-
dangerHover: chunkZBGR7MUW_cjs.red[400],
|
|
251
|
-
dangerActive: chunkZBGR7MUW_cjs.red[300],
|
|
252
|
-
dangerMuted: chunkZBGR7MUW_cjs.red[950],
|
|
253
|
-
dangerMutedForeground: chunkZBGR7MUW_cjs.red[300],
|
|
254
|
-
destructive: chunkZBGR7MUW_cjs.red[500],
|
|
255
|
-
destructiveForeground: "oklch(0.985 0 0)",
|
|
256
|
-
info: chunkZBGR7MUW_cjs.blue[400],
|
|
257
|
-
infoForeground: "oklch(0.145 0 0)",
|
|
258
|
-
infoMuted: chunkZBGR7MUW_cjs.blue[950],
|
|
259
|
-
infoMutedForeground: chunkZBGR7MUW_cjs.blue[300]
|
|
260
|
-
};
|
|
261
|
-
var CHART_LIGHT = {
|
|
262
|
-
chart1: "oklch(0.646 0.222 41.116)",
|
|
263
|
-
chart2: "oklch(0.6 0.118 184.704)",
|
|
264
|
-
chart3: "oklch(0.398 0.07 227.392)",
|
|
265
|
-
chart4: "oklch(0.828 0.189 84.429)",
|
|
266
|
-
chart5: "oklch(0.769 0.188 70.08)"
|
|
267
|
-
};
|
|
268
|
-
var CHART_DARK = {
|
|
269
|
-
chart1: "oklch(0.488 0.243 264.376)",
|
|
270
|
-
chart2: "oklch(0.696 0.17 162.48)",
|
|
271
|
-
chart3: "oklch(0.769 0.188 70.08)",
|
|
272
|
-
chart4: "oklch(0.627 0.265 303.9)",
|
|
273
|
-
chart5: "oklch(0.645 0.246 16.439)"
|
|
274
|
-
};
|
|
275
|
-
var stone = {
|
|
276
|
-
50: "oklch(0.985 0.001 106.424)",
|
|
277
|
-
100: "oklch(0.97 0.001 106.424)",
|
|
278
|
-
200: "oklch(0.923 0.003 48.717)",
|
|
279
|
-
300: "oklch(0.869 0.005 56.366)",
|
|
280
|
-
400: "oklch(0.709 0.01 56.259)",
|
|
281
|
-
500: "oklch(0.553 0.013 58.071)",
|
|
282
|
-
600: "oklch(0.444 0.011 73.639)",
|
|
283
|
-
700: "oklch(0.374 0.01 67.558)",
|
|
284
|
-
800: "oklch(0.268 0.007 34.298)",
|
|
285
|
-
900: "oklch(0.216 0.006 56.043)",
|
|
286
|
-
950: "oklch(0.147 0.004 49.25)"
|
|
287
|
-
};
|
|
288
|
-
var neutral = {
|
|
289
|
-
50: "oklch(0.985 0 0)",
|
|
290
|
-
100: "oklch(0.97 0 0)",
|
|
291
|
-
200: "oklch(0.922 0 0)",
|
|
292
|
-
300: "oklch(0.87 0 0)",
|
|
293
|
-
400: "oklch(0.708 0 0)",
|
|
294
|
-
500: "oklch(0.556 0 0)",
|
|
295
|
-
600: "oklch(0.439 0 0)",
|
|
296
|
-
700: "oklch(0.371 0 0)",
|
|
297
|
-
800: "oklch(0.269 0 0)",
|
|
298
|
-
900: "oklch(0.205 0 0)",
|
|
299
|
-
950: "oklch(0.145 0 0)"
|
|
300
|
-
};
|
|
301
|
-
var violet = {
|
|
302
|
-
50: "oklch(0.969 0.016 293.756)",
|
|
303
|
-
300: "oklch(0.811 0.111 293.571)",
|
|
304
|
-
400: "oklch(0.702 0.183 293.541)",
|
|
305
|
-
500: "oklch(0.606 0.25 292.717)",
|
|
306
|
-
600: "oklch(0.541 0.281 293.009)",
|
|
307
|
-
700: "oklch(0.491 0.27 292.581)",
|
|
308
|
-
800: "oklch(0.432 0.232 292.759)",
|
|
309
|
-
950: "oklch(0.283 0.141 291.089)"
|
|
310
|
-
};
|
|
311
|
-
var rose = {
|
|
312
|
-
50: "oklch(0.969 0.015 12.422)",
|
|
313
|
-
300: "oklch(0.81 0.117 11.638)",
|
|
314
|
-
400: "oklch(0.712 0.194 13.428)",
|
|
315
|
-
500: "oklch(0.645 0.246 16.439)",
|
|
316
|
-
600: "oklch(0.586 0.253 17.585)",
|
|
317
|
-
700: "oklch(0.514 0.222 16.935)",
|
|
318
|
-
800: "oklch(0.455 0.188 13.697)",
|
|
319
|
-
950: "oklch(0.271 0.105 12.094)"
|
|
320
|
-
};
|
|
321
|
-
var orange = {
|
|
322
|
-
50: "oklch(0.98 0.016 73.684)",
|
|
323
|
-
300: "oklch(0.837 0.128 66.29)",
|
|
324
|
-
400: "oklch(0.75 0.183 55.934)",
|
|
325
|
-
500: "oklch(0.705 0.213 47.604)",
|
|
326
|
-
600: "oklch(0.646 0.222 41.116)",
|
|
327
|
-
700: "oklch(0.553 0.195 38.402)",
|
|
328
|
-
800: "oklch(0.47 0.157 37.304)",
|
|
329
|
-
950: "oklch(0.266 0.079 36.259)"
|
|
330
|
-
};
|
|
331
|
-
function buildNeutralPreset(name, key, palette) {
|
|
332
|
-
return {
|
|
333
|
-
name,
|
|
334
|
-
key,
|
|
335
|
-
chromatic: false,
|
|
336
|
-
light: {
|
|
337
|
-
background: "oklch(1 0 0)",
|
|
338
|
-
foreground: palette[950],
|
|
339
|
-
surface: palette[50],
|
|
340
|
-
surfaceRaised: "oklch(1 0 0)",
|
|
341
|
-
surfaceOverlay: palette[100],
|
|
342
|
-
card: "oklch(1 0 0)",
|
|
343
|
-
cardForeground: palette[950],
|
|
344
|
-
popover: "oklch(1 0 0)",
|
|
345
|
-
popoverForeground: palette[950],
|
|
346
|
-
muted: palette[100],
|
|
347
|
-
mutedForeground: palette[500],
|
|
348
|
-
primary: palette[900],
|
|
349
|
-
primaryForeground: palette[50],
|
|
350
|
-
primaryHover: palette[800],
|
|
351
|
-
primaryActive: palette[700],
|
|
352
|
-
primaryMuted: palette[100],
|
|
353
|
-
primaryMutedForeground: palette[900],
|
|
354
|
-
secondary: palette[100],
|
|
355
|
-
secondaryForeground: palette[900],
|
|
356
|
-
secondaryHover: palette[200],
|
|
357
|
-
secondaryActive: palette[300],
|
|
358
|
-
accent: palette[100],
|
|
359
|
-
accentForeground: palette[900],
|
|
360
|
-
...STATUS_LIGHT,
|
|
361
|
-
...CHART_LIGHT,
|
|
362
|
-
border: palette[200],
|
|
363
|
-
borderMuted: palette[100],
|
|
364
|
-
borderStrong: palette[400],
|
|
365
|
-
focusRing: palette[400],
|
|
366
|
-
ring: palette[400],
|
|
367
|
-
input: palette[200],
|
|
368
|
-
inputForeground: palette[900],
|
|
369
|
-
inputPlaceholder: palette[500],
|
|
370
|
-
disabled: palette[100],
|
|
371
|
-
disabledForeground: palette[500],
|
|
372
|
-
sidebar: palette[50],
|
|
373
|
-
sidebarForeground: palette[950],
|
|
374
|
-
sidebarPrimary: palette[900],
|
|
375
|
-
sidebarPrimaryForeground: palette[50],
|
|
376
|
-
sidebarAccent: palette[100],
|
|
377
|
-
sidebarAccentForeground: palette[900],
|
|
378
|
-
sidebarBorder: palette[200],
|
|
379
|
-
sidebarRing: palette[400]
|
|
380
|
-
},
|
|
381
|
-
dark: {
|
|
382
|
-
background: palette[950],
|
|
383
|
-
foreground: palette[50],
|
|
384
|
-
surface: palette[900],
|
|
385
|
-
surfaceRaised: palette[800],
|
|
386
|
-
surfaceOverlay: palette[800],
|
|
387
|
-
card: palette[900],
|
|
388
|
-
cardForeground: palette[50],
|
|
389
|
-
popover: palette[800],
|
|
390
|
-
popoverForeground: palette[50],
|
|
391
|
-
muted: palette[800],
|
|
392
|
-
mutedForeground: palette[400],
|
|
393
|
-
primary: palette[50],
|
|
394
|
-
primaryForeground: palette[900],
|
|
395
|
-
primaryHover: palette[200],
|
|
396
|
-
primaryActive: palette[300],
|
|
397
|
-
primaryMuted: palette[800],
|
|
398
|
-
primaryMutedForeground: palette[50],
|
|
399
|
-
secondary: palette[800],
|
|
400
|
-
secondaryForeground: palette[50],
|
|
401
|
-
secondaryHover: palette[700],
|
|
402
|
-
secondaryActive: palette[600],
|
|
403
|
-
accent: palette[700],
|
|
404
|
-
accentForeground: palette[50],
|
|
405
|
-
...STATUS_DARK,
|
|
406
|
-
...CHART_DARK,
|
|
407
|
-
border: `color-mix(in oklch, ${palette[50]} 10%, transparent)`,
|
|
408
|
-
borderMuted: palette[800],
|
|
409
|
-
borderStrong: palette[500],
|
|
410
|
-
focusRing: palette[500],
|
|
411
|
-
ring: palette[500],
|
|
412
|
-
input: `color-mix(in oklch, ${palette[50]} 15%, transparent)`,
|
|
413
|
-
inputForeground: palette[50],
|
|
414
|
-
inputPlaceholder: palette[500],
|
|
415
|
-
disabled: palette[800],
|
|
416
|
-
disabledForeground: palette[600],
|
|
417
|
-
sidebar: palette[900],
|
|
418
|
-
sidebarForeground: palette[50],
|
|
419
|
-
sidebarPrimary: chunkZBGR7MUW_cjs.blue[600],
|
|
420
|
-
sidebarPrimaryForeground: palette[50],
|
|
421
|
-
sidebarAccent: palette[800],
|
|
422
|
-
sidebarAccentForeground: palette[50],
|
|
423
|
-
sidebarBorder: `color-mix(in oklch, ${palette[50]} 10%, transparent)`,
|
|
424
|
-
sidebarRing: palette[600]
|
|
425
|
-
}
|
|
426
|
-
};
|
|
427
|
-
}
|
|
428
|
-
function buildChromaticPreset(name, key, primary, surface = chunkZBGR7MUW_cjs.zinc) {
|
|
429
|
-
return {
|
|
430
|
-
name,
|
|
431
|
-
key,
|
|
432
|
-
chromatic: true,
|
|
433
|
-
light: {
|
|
434
|
-
background: "oklch(1 0 0)",
|
|
435
|
-
foreground: surface[950],
|
|
436
|
-
surface: surface[50],
|
|
437
|
-
surfaceRaised: "oklch(1 0 0)",
|
|
438
|
-
surfaceOverlay: surface[100],
|
|
439
|
-
card: "oklch(1 0 0)",
|
|
440
|
-
cardForeground: surface[950],
|
|
441
|
-
popover: "oklch(1 0 0)",
|
|
442
|
-
popoverForeground: surface[950],
|
|
443
|
-
muted: surface[100],
|
|
444
|
-
mutedForeground: surface[500],
|
|
445
|
-
primary: primary[600],
|
|
446
|
-
primaryForeground: "oklch(0.985 0 0)",
|
|
447
|
-
primaryHover: primary[700],
|
|
448
|
-
primaryActive: primary[800],
|
|
449
|
-
primaryMuted: primary[50],
|
|
450
|
-
primaryMutedForeground: primary[700],
|
|
451
|
-
secondary: surface[100],
|
|
452
|
-
secondaryForeground: surface[900],
|
|
453
|
-
secondaryHover: surface[200],
|
|
454
|
-
secondaryActive: surface[300],
|
|
455
|
-
accent: primary[50],
|
|
456
|
-
accentForeground: primary[700],
|
|
457
|
-
...STATUS_LIGHT,
|
|
458
|
-
...CHART_LIGHT,
|
|
459
|
-
border: surface[200],
|
|
460
|
-
borderMuted: surface[100],
|
|
461
|
-
borderStrong: surface[400],
|
|
462
|
-
focusRing: primary[500],
|
|
463
|
-
ring: primary[500],
|
|
464
|
-
input: surface[200],
|
|
465
|
-
inputForeground: surface[900],
|
|
466
|
-
inputPlaceholder: surface[500],
|
|
467
|
-
disabled: surface[100],
|
|
468
|
-
disabledForeground: surface[500],
|
|
469
|
-
sidebar: surface[50],
|
|
470
|
-
sidebarForeground: surface[950],
|
|
471
|
-
sidebarPrimary: primary[600],
|
|
472
|
-
sidebarPrimaryForeground: "oklch(0.985 0 0)",
|
|
473
|
-
sidebarAccent: primary[50],
|
|
474
|
-
sidebarAccentForeground: primary[700],
|
|
475
|
-
sidebarBorder: surface[200],
|
|
476
|
-
sidebarRing: primary[500]
|
|
477
|
-
},
|
|
478
|
-
dark: {
|
|
479
|
-
background: surface[950],
|
|
480
|
-
foreground: surface[50],
|
|
481
|
-
surface: surface[900],
|
|
482
|
-
surfaceRaised: surface[800],
|
|
483
|
-
surfaceOverlay: surface[800],
|
|
484
|
-
card: surface[900],
|
|
485
|
-
cardForeground: surface[50],
|
|
486
|
-
popover: surface[800],
|
|
487
|
-
popoverForeground: surface[50],
|
|
488
|
-
muted: surface[800],
|
|
489
|
-
mutedForeground: surface[400],
|
|
490
|
-
primary: primary[500],
|
|
491
|
-
primaryForeground: "oklch(0.985 0 0)",
|
|
492
|
-
primaryHover: primary[400],
|
|
493
|
-
primaryActive: primary[300],
|
|
494
|
-
primaryMuted: primary[950],
|
|
495
|
-
primaryMutedForeground: primary[300],
|
|
496
|
-
secondary: surface[800],
|
|
497
|
-
secondaryForeground: surface[50],
|
|
498
|
-
secondaryHover: surface[700],
|
|
499
|
-
secondaryActive: surface[600],
|
|
500
|
-
accent: primary[950],
|
|
501
|
-
accentForeground: primary[300],
|
|
502
|
-
...STATUS_DARK,
|
|
503
|
-
...CHART_DARK,
|
|
504
|
-
border: `color-mix(in oklch, ${surface[50]} 10%, transparent)`,
|
|
505
|
-
borderMuted: surface[800],
|
|
506
|
-
borderStrong: surface[500],
|
|
507
|
-
focusRing: primary[500],
|
|
508
|
-
ring: primary[500],
|
|
509
|
-
input: `color-mix(in oklch, ${surface[50]} 15%, transparent)`,
|
|
510
|
-
inputForeground: surface[50],
|
|
511
|
-
inputPlaceholder: surface[500],
|
|
512
|
-
disabled: surface[800],
|
|
513
|
-
disabledForeground: surface[600],
|
|
514
|
-
sidebar: surface[900],
|
|
515
|
-
sidebarForeground: surface[50],
|
|
516
|
-
sidebarPrimary: primary[500],
|
|
517
|
-
sidebarPrimaryForeground: "oklch(0.985 0 0)",
|
|
518
|
-
sidebarAccent: primary[950],
|
|
519
|
-
sidebarAccentForeground: primary[300],
|
|
520
|
-
sidebarBorder: `color-mix(in oklch, ${surface[50]} 10%, transparent)`,
|
|
521
|
-
sidebarRing: primary[500]
|
|
522
|
-
}
|
|
523
|
-
};
|
|
524
|
-
}
|
|
525
|
-
var COLOR_PRESETS = [
|
|
526
|
-
// -------------------------------------------------------------------------
|
|
527
|
-
// Neutral Presets (achromatic primaries)
|
|
528
|
-
// -------------------------------------------------------------------------
|
|
529
|
-
{
|
|
530
|
-
swatch: chunkZBGR7MUW_cjs.zinc[900],
|
|
531
|
-
...buildNeutralPreset("Zinc", "zinc", chunkZBGR7MUW_cjs.zinc)
|
|
532
|
-
},
|
|
533
|
-
{
|
|
534
|
-
swatch: chunkZBGR7MUW_cjs.slate[900],
|
|
535
|
-
...buildNeutralPreset("Slate", "slate", chunkZBGR7MUW_cjs.slate)
|
|
536
|
-
},
|
|
537
|
-
{
|
|
538
|
-
swatch: chunkZBGR7MUW_cjs.gray[900],
|
|
539
|
-
...buildNeutralPreset("Gray", "gray", chunkZBGR7MUW_cjs.gray)
|
|
540
|
-
},
|
|
541
|
-
{
|
|
542
|
-
swatch: stone[900],
|
|
543
|
-
...buildNeutralPreset("Stone", "stone", stone)
|
|
544
|
-
},
|
|
545
|
-
{
|
|
546
|
-
swatch: neutral[900],
|
|
547
|
-
...buildNeutralPreset("Neutral", "neutral", neutral)
|
|
548
|
-
},
|
|
549
|
-
// -------------------------------------------------------------------------
|
|
550
|
-
// Chromatic Presets (colored primaries)
|
|
551
|
-
// -------------------------------------------------------------------------
|
|
552
|
-
{
|
|
553
|
-
swatch: chunkZBGR7MUW_cjs.blue[600],
|
|
554
|
-
...buildChromaticPreset("Blue", "blue", chunkZBGR7MUW_cjs.blue)
|
|
555
|
-
},
|
|
556
|
-
{
|
|
557
|
-
swatch: chunkZBGR7MUW_cjs.green[600],
|
|
558
|
-
...buildChromaticPreset("Green", "green", chunkZBGR7MUW_cjs.green)
|
|
559
|
-
},
|
|
560
|
-
{
|
|
561
|
-
swatch: violet[600],
|
|
562
|
-
...buildChromaticPreset("Violet", "violet", violet)
|
|
563
|
-
},
|
|
564
|
-
{
|
|
565
|
-
swatch: rose[600],
|
|
566
|
-
...buildChromaticPreset("Rose", "rose", rose)
|
|
567
|
-
},
|
|
568
|
-
{
|
|
569
|
-
swatch: orange[600],
|
|
570
|
-
...buildChromaticPreset("Orange", "orange", orange)
|
|
571
|
-
},
|
|
572
|
-
{
|
|
573
|
-
swatch: chunkZBGR7MUW_cjs.red[600],
|
|
574
|
-
...buildChromaticPreset("Red", "red", chunkZBGR7MUW_cjs.red)
|
|
575
|
-
},
|
|
576
|
-
{
|
|
577
|
-
swatch: chunkZBGR7MUW_cjs.teal[600],
|
|
578
|
-
...buildChromaticPreset("Teal", "teal", chunkZBGR7MUW_cjs.teal)
|
|
579
|
-
},
|
|
580
|
-
{
|
|
581
|
-
swatch: chunkZBGR7MUW_cjs.brand[600],
|
|
582
|
-
...buildChromaticPreset("Brand", "brand", chunkZBGR7MUW_cjs.brand)
|
|
583
|
-
}
|
|
584
|
-
];
|
|
585
|
-
function getColorPreset(key) {
|
|
586
|
-
return COLOR_PRESETS.find((p) => p.key === key) ?? COLOR_PRESETS[0];
|
|
587
|
-
}
|
|
588
|
-
var COLOR_PRESET_KEYS = COLOR_PRESETS.map((p) => p.key);
|
|
589
|
-
var RADIUS_PRESETS = [
|
|
590
|
-
{ name: "None", key: "0", value: "0px", label: "0px" },
|
|
591
|
-
{ name: "Subtle", key: "0.25", value: "0.25rem", label: "4px" },
|
|
592
|
-
{ name: "Small", key: "0.375", value: "0.375rem", label: "6px" },
|
|
593
|
-
{ name: "Medium", key: "0.5", value: "0.5rem", label: "8px" },
|
|
594
|
-
{ name: "Default", key: "0.625", value: "0.625rem", label: "10px" },
|
|
595
|
-
{ name: "Large", key: "0.75", value: "0.75rem", label: "12px" },
|
|
596
|
-
{ name: "XL", key: "1", value: "1rem", label: "16px" }
|
|
597
|
-
];
|
|
598
|
-
var DEFAULT_RADIUS_KEY = "0.625";
|
|
599
|
-
function getRadiusPreset(key) {
|
|
600
|
-
return RADIUS_PRESETS.find((r) => r.key === key) ?? RADIUS_PRESETS[4];
|
|
601
|
-
}
|
|
602
|
-
var FONT_PRESETS = [
|
|
603
|
-
{
|
|
604
|
-
name: "Outfit",
|
|
605
|
-
key: "outfit",
|
|
606
|
-
value: 'var(--font-outfit), system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
607
|
-
sample: "Aa"
|
|
608
|
-
},
|
|
609
|
-
{
|
|
610
|
-
name: "Inter",
|
|
611
|
-
key: "inter",
|
|
612
|
-
value: 'var(--font-inter), system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
613
|
-
sample: "Aa"
|
|
614
|
-
},
|
|
615
|
-
{
|
|
616
|
-
name: "System",
|
|
617
|
-
key: "system",
|
|
618
|
-
value: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
619
|
-
sample: "Aa"
|
|
620
|
-
},
|
|
621
|
-
{
|
|
622
|
-
name: "Serif",
|
|
623
|
-
key: "serif",
|
|
624
|
-
value: 'var(--font-lora), Georgia, "Times New Roman", serif',
|
|
625
|
-
sample: "Aa"
|
|
626
|
-
},
|
|
627
|
-
{
|
|
628
|
-
name: "Mono",
|
|
629
|
-
key: "mono",
|
|
630
|
-
value: 'var(--font-jetbrains), "Fira Code", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace',
|
|
631
|
-
sample: "Aa"
|
|
632
|
-
}
|
|
633
|
-
];
|
|
634
|
-
var DEFAULT_FONT_KEY = "outfit";
|
|
635
|
-
function getFontPreset(key) {
|
|
636
|
-
return FONT_PRESETS.find((f) => f.key === key) ?? FONT_PRESETS[0];
|
|
637
|
-
}
|
|
638
|
-
var SHADOW_PRESETS = [
|
|
639
|
-
{
|
|
640
|
-
name: "None",
|
|
641
|
-
key: "none",
|
|
642
|
-
description: "No shadows \u2014 flat design",
|
|
643
|
-
light: {
|
|
644
|
-
none: "none",
|
|
645
|
-
xs: "none",
|
|
646
|
-
sm: "none",
|
|
647
|
-
md: "none",
|
|
648
|
-
lg: "none",
|
|
649
|
-
xl: "none",
|
|
650
|
-
"2xl": "none"
|
|
651
|
-
},
|
|
652
|
-
dark: {
|
|
653
|
-
none: "none",
|
|
654
|
-
xs: "none",
|
|
655
|
-
sm: "none",
|
|
656
|
-
md: "none",
|
|
657
|
-
lg: "none",
|
|
658
|
-
xl: "none",
|
|
659
|
-
"2xl": "none"
|
|
660
|
-
}
|
|
661
|
-
},
|
|
662
|
-
{
|
|
663
|
-
name: "Subtle",
|
|
664
|
-
key: "subtle",
|
|
665
|
-
description: "Soft, minimal shadows",
|
|
666
|
-
light: {
|
|
667
|
-
none: "none",
|
|
668
|
-
xs: "0 1px 1px 0 oklch(0 0 0 / 0.03)",
|
|
669
|
-
sm: "0 1px 2px 0 oklch(0 0 0 / 0.05), 0 1px 1px -1px oklch(0 0 0 / 0.05)",
|
|
670
|
-
md: "0 2px 4px -1px oklch(0 0 0 / 0.06), 0 1px 2px -1px oklch(0 0 0 / 0.04)",
|
|
671
|
-
lg: "0 6px 10px -2px oklch(0 0 0 / 0.06), 0 2px 4px -2px oklch(0 0 0 / 0.04)",
|
|
672
|
-
xl: "0 12px 16px -4px oklch(0 0 0 / 0.06), 0 4px 6px -3px oklch(0 0 0 / 0.04)",
|
|
673
|
-
"2xl": "0 16px 32px -8px oklch(0 0 0 / 0.12)"
|
|
674
|
-
},
|
|
675
|
-
dark: {
|
|
676
|
-
none: "none",
|
|
677
|
-
xs: "0 1px 1px 0 oklch(0 0 0 / 0.1)",
|
|
678
|
-
sm: "0 1px 2px 0 oklch(0 0 0 / 0.15), 0 1px 1px -1px oklch(0 0 0 / 0.15)",
|
|
679
|
-
md: "0 2px 4px -1px oklch(0 0 0 / 0.2), 0 1px 2px -1px oklch(0 0 0 / 0.15)",
|
|
680
|
-
lg: "0 6px 10px -2px oklch(0 0 0 / 0.2), 0 2px 4px -2px oklch(0 0 0 / 0.15)",
|
|
681
|
-
xl: "0 12px 16px -4px oklch(0 0 0 / 0.25), 0 4px 6px -3px oklch(0 0 0 / 0.2)",
|
|
682
|
-
"2xl": "0 16px 32px -8px oklch(0 0 0 / 0.3)"
|
|
683
|
-
}
|
|
684
|
-
},
|
|
685
|
-
{
|
|
686
|
-
name: "Default",
|
|
687
|
-
key: "default",
|
|
688
|
-
description: "Standard shadow depth",
|
|
689
|
-
light: {
|
|
690
|
-
none: "none",
|
|
691
|
-
xs: "0 1px 2px 0 oklch(0 0 0 / 0.05)",
|
|
692
|
-
sm: "0 1px 3px 0 oklch(0 0 0 / 0.1), 0 1px 2px -1px oklch(0 0 0 / 0.1)",
|
|
693
|
-
md: "0 4px 6px -1px oklch(0 0 0 / 0.1), 0 2px 4px -2px oklch(0 0 0 / 0.1)",
|
|
694
|
-
lg: "0 10px 15px -3px oklch(0 0 0 / 0.1), 0 4px 6px -4px oklch(0 0 0 / 0.1)",
|
|
695
|
-
xl: "0 20px 25px -5px oklch(0 0 0 / 0.1), 0 8px 10px -6px oklch(0 0 0 / 0.1)",
|
|
696
|
-
"2xl": "0 25px 50px -12px oklch(0 0 0 / 0.25)"
|
|
697
|
-
},
|
|
698
|
-
dark: {
|
|
699
|
-
none: "none",
|
|
700
|
-
xs: "0 1px 2px 0 oklch(0 0 0 / 0.2)",
|
|
701
|
-
sm: "0 1px 3px 0 oklch(0 0 0 / 0.3), 0 1px 2px -1px oklch(0 0 0 / 0.3)",
|
|
702
|
-
md: "0 4px 6px -1px oklch(0 0 0 / 0.35), 0 2px 4px -2px oklch(0 0 0 / 0.3)",
|
|
703
|
-
lg: "0 10px 15px -3px oklch(0 0 0 / 0.35), 0 4px 6px -4px oklch(0 0 0 / 0.3)",
|
|
704
|
-
xl: "0 20px 25px -5px oklch(0 0 0 / 0.4), 0 8px 10px -6px oklch(0 0 0 / 0.35)",
|
|
705
|
-
"2xl": "0 25px 50px -12px oklch(0 0 0 / 0.5)"
|
|
706
|
-
}
|
|
707
|
-
},
|
|
708
|
-
{
|
|
709
|
-
name: "Heavy",
|
|
710
|
-
key: "heavy",
|
|
711
|
-
description: "Bold, pronounced shadows",
|
|
712
|
-
light: {
|
|
713
|
-
none: "none",
|
|
714
|
-
xs: "0 1px 3px 0 oklch(0 0 0 / 0.08)",
|
|
715
|
-
sm: "0 2px 4px 0 oklch(0 0 0 / 0.14), 0 1px 3px -1px oklch(0 0 0 / 0.12)",
|
|
716
|
-
md: "0 6px 10px -1px oklch(0 0 0 / 0.14), 0 3px 6px -2px oklch(0 0 0 / 0.12)",
|
|
717
|
-
lg: "0 14px 20px -4px oklch(0 0 0 / 0.14), 0 6px 8px -4px oklch(0 0 0 / 0.12)",
|
|
718
|
-
xl: "0 24px 32px -6px oklch(0 0 0 / 0.14), 0 10px 14px -6px oklch(0 0 0 / 0.12)",
|
|
719
|
-
"2xl": "0 32px 60px -16px oklch(0 0 0 / 0.35)"
|
|
720
|
-
},
|
|
721
|
-
dark: {
|
|
722
|
-
none: "none",
|
|
723
|
-
xs: "0 1px 3px 0 oklch(0 0 0 / 0.3)",
|
|
724
|
-
sm: "0 2px 4px 0 oklch(0 0 0 / 0.4), 0 1px 3px -1px oklch(0 0 0 / 0.4)",
|
|
725
|
-
md: "0 6px 10px -1px oklch(0 0 0 / 0.45), 0 3px 6px -2px oklch(0 0 0 / 0.4)",
|
|
726
|
-
lg: "0 14px 20px -4px oklch(0 0 0 / 0.45), 0 6px 8px -4px oklch(0 0 0 / 0.4)",
|
|
727
|
-
xl: "0 24px 32px -6px oklch(0 0 0 / 0.5), 0 10px 14px -6px oklch(0 0 0 / 0.45)",
|
|
728
|
-
"2xl": "0 32px 60px -16px oklch(0 0 0 / 0.6)"
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
];
|
|
732
|
-
var DEFAULT_SHADOW_KEY = "default";
|
|
733
|
-
function getShadowPreset(key) {
|
|
734
|
-
return SHADOW_PRESETS.find((s) => s.key === key) ?? SHADOW_PRESETS[2];
|
|
735
|
-
}
|
|
736
|
-
var SURFACE_STYLE_PRESETS = [
|
|
737
|
-
{
|
|
738
|
-
name: "Bordered",
|
|
739
|
-
key: "bordered",
|
|
740
|
-
description: "Cards and surfaces use borders for separation"
|
|
741
|
-
},
|
|
742
|
-
{
|
|
743
|
-
name: "Elevated",
|
|
744
|
-
key: "elevated",
|
|
745
|
-
description: "Cards and surfaces use shadows for depth"
|
|
746
|
-
},
|
|
747
|
-
{
|
|
748
|
-
name: "Mixed",
|
|
749
|
-
key: "mixed",
|
|
750
|
-
description: "Combines borders with subtle shadows"
|
|
751
|
-
}
|
|
752
|
-
];
|
|
753
|
-
var DEFAULT_SURFACE_STYLE_KEY = "bordered";
|
|
754
|
-
var STYLE_PRESETS = [
|
|
755
|
-
{
|
|
756
|
-
name: "Vega",
|
|
757
|
-
key: "vega",
|
|
758
|
-
description: "The classic shadcn/ui look. Clean, neutral, and familiar.",
|
|
759
|
-
iconPath: "M3 3h18v18H3V3zm2 2v14h14V5H7z",
|
|
760
|
-
defaults: {
|
|
761
|
-
radius: "0.625",
|
|
762
|
-
font: "outfit",
|
|
763
|
-
shadow: "default",
|
|
764
|
-
surfaceStyle: "bordered"
|
|
765
|
-
},
|
|
766
|
-
vars: {
|
|
767
|
-
spacingUnit: "1",
|
|
768
|
-
paddingCard: "1.5rem",
|
|
769
|
-
paddingButtonX: "1rem",
|
|
770
|
-
paddingButtonY: "0.5rem",
|
|
771
|
-
gapDefault: "0.75rem",
|
|
772
|
-
borderWidth: "1px",
|
|
773
|
-
controlHeight: "2.25rem"
|
|
774
|
-
}
|
|
775
|
-
},
|
|
776
|
-
{
|
|
777
|
-
name: "Nova",
|
|
778
|
-
key: "nova",
|
|
779
|
-
description: "Reduced padding and margins for compact layouts.",
|
|
780
|
-
iconPath: "M4 4h16v16H4V4zm1.5 1.5v13h13v-13h-13z",
|
|
781
|
-
defaults: {
|
|
782
|
-
radius: "0.5",
|
|
783
|
-
font: "inter",
|
|
784
|
-
shadow: "subtle",
|
|
785
|
-
surfaceStyle: "bordered"
|
|
786
|
-
},
|
|
787
|
-
vars: {
|
|
788
|
-
spacingUnit: "0.875",
|
|
789
|
-
paddingCard: "1rem",
|
|
790
|
-
paddingButtonX: "0.75rem",
|
|
791
|
-
paddingButtonY: "0.375rem",
|
|
792
|
-
gapDefault: "0.5rem",
|
|
793
|
-
borderWidth: "1px",
|
|
794
|
-
controlHeight: "2rem"
|
|
795
|
-
}
|
|
796
|
-
},
|
|
797
|
-
{
|
|
798
|
-
name: "Maia",
|
|
799
|
-
key: "maia",
|
|
800
|
-
description: "Soft and rounded, with generous spacing.",
|
|
801
|
-
iconPath: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z",
|
|
802
|
-
defaults: {
|
|
803
|
-
radius: "0.75",
|
|
804
|
-
font: "outfit",
|
|
805
|
-
shadow: "default",
|
|
806
|
-
surfaceStyle: "mixed"
|
|
807
|
-
},
|
|
808
|
-
vars: {
|
|
809
|
-
spacingUnit: "1.125",
|
|
810
|
-
paddingCard: "1.75rem",
|
|
811
|
-
paddingButtonX: "1.25rem",
|
|
812
|
-
paddingButtonY: "0.625rem",
|
|
813
|
-
gapDefault: "1rem",
|
|
814
|
-
borderWidth: "1px",
|
|
815
|
-
controlHeight: "2.5rem"
|
|
816
|
-
}
|
|
817
|
-
},
|
|
818
|
-
{
|
|
819
|
-
name: "Lyra",
|
|
820
|
-
key: "lyra",
|
|
821
|
-
description: "Boxy and sharp. Pairs well with mono fonts.",
|
|
822
|
-
iconPath: "M3 3h18v18H3V3zm1 1v16h16V4H4z",
|
|
823
|
-
defaults: {
|
|
824
|
-
radius: "0",
|
|
825
|
-
font: "system",
|
|
826
|
-
shadow: "none",
|
|
827
|
-
surfaceStyle: "bordered"
|
|
828
|
-
},
|
|
829
|
-
vars: {
|
|
830
|
-
spacingUnit: "1",
|
|
831
|
-
paddingCard: "1.25rem",
|
|
832
|
-
paddingButtonX: "1rem",
|
|
833
|
-
paddingButtonY: "0.5rem",
|
|
834
|
-
gapDefault: "0.75rem",
|
|
835
|
-
borderWidth: "1px",
|
|
836
|
-
controlHeight: "2.25rem"
|
|
837
|
-
}
|
|
838
|
-
},
|
|
839
|
-
{
|
|
840
|
-
name: "Mira",
|
|
841
|
-
key: "mira",
|
|
842
|
-
description: "Compact. Made for dense interfaces.",
|
|
843
|
-
iconPath: "M5 3h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2zm0 2v14h14V5H5zm2 2h10v2H7V7zm0 4h10v2H7v-2zm0 4h7v2H7v-2z",
|
|
844
|
-
defaults: {
|
|
845
|
-
radius: "0.375",
|
|
846
|
-
font: "inter",
|
|
847
|
-
shadow: "none",
|
|
848
|
-
surfaceStyle: "bordered"
|
|
849
|
-
},
|
|
850
|
-
vars: {
|
|
851
|
-
spacingUnit: "0.75",
|
|
852
|
-
paddingCard: "0.75rem",
|
|
853
|
-
paddingButtonX: "0.625rem",
|
|
854
|
-
paddingButtonY: "0.25rem",
|
|
855
|
-
gapDefault: "0.375rem",
|
|
856
|
-
borderWidth: "1px",
|
|
857
|
-
controlHeight: "1.75rem"
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
];
|
|
861
|
-
var DEFAULT_STYLE_KEY = "vega";
|
|
862
|
-
function getStylePreset(key) {
|
|
863
|
-
return STYLE_PRESETS.find((s) => s.key === key) ?? STYLE_PRESETS[0];
|
|
864
|
-
}
|
|
865
|
-
var DEFAULT_THEME_CONFIG = {
|
|
866
|
-
style: DEFAULT_STYLE_KEY,
|
|
867
|
-
colorPreset: "zinc",
|
|
868
|
-
radius: DEFAULT_RADIUS_KEY,
|
|
869
|
-
font: DEFAULT_FONT_KEY,
|
|
870
|
-
shadow: DEFAULT_SHADOW_KEY,
|
|
871
|
-
surfaceStyle: DEFAULT_SURFACE_STYLE_KEY
|
|
872
|
-
};
|
|
873
|
-
function buildThemeOverrides(config, mode) {
|
|
874
|
-
const vars = {};
|
|
875
|
-
const colorPreset = getColorPreset(config.colorPreset);
|
|
876
|
-
const colors = mode === "dark" ? colorPreset.dark : colorPreset.light;
|
|
877
|
-
const colorMapping = {
|
|
878
|
-
background: "--background",
|
|
879
|
-
foreground: "--foreground",
|
|
880
|
-
surface: "--surface",
|
|
881
|
-
surfaceRaised: "--surface-raised",
|
|
882
|
-
surfaceOverlay: "--surface-overlay",
|
|
883
|
-
card: "--card",
|
|
884
|
-
cardForeground: "--card-foreground",
|
|
885
|
-
popover: "--popover",
|
|
886
|
-
popoverForeground: "--popover-foreground",
|
|
887
|
-
muted: "--muted",
|
|
888
|
-
mutedForeground: "--muted-foreground",
|
|
889
|
-
primary: "--primary",
|
|
890
|
-
primaryForeground: "--primary-foreground",
|
|
891
|
-
primaryHover: "--primary-hover",
|
|
892
|
-
primaryActive: "--primary-active",
|
|
893
|
-
primaryMuted: "--primary-muted",
|
|
894
|
-
primaryMutedForeground: "--primary-muted-foreground",
|
|
895
|
-
secondary: "--secondary",
|
|
896
|
-
secondaryForeground: "--secondary-foreground",
|
|
897
|
-
secondaryHover: "--secondary-hover",
|
|
898
|
-
secondaryActive: "--secondary-active",
|
|
899
|
-
accent: "--accent",
|
|
900
|
-
accentForeground: "--accent-foreground",
|
|
901
|
-
success: "--success",
|
|
902
|
-
successForeground: "--success-foreground",
|
|
903
|
-
successMuted: "--success-muted",
|
|
904
|
-
successMutedForeground: "--success-muted-foreground",
|
|
905
|
-
warning: "--warning",
|
|
906
|
-
warningForeground: "--warning-foreground",
|
|
907
|
-
warningMuted: "--warning-muted",
|
|
908
|
-
warningMutedForeground: "--warning-muted-foreground",
|
|
909
|
-
danger: "--danger",
|
|
910
|
-
dangerForeground: "--danger-foreground",
|
|
911
|
-
dangerHover: "--danger-hover",
|
|
912
|
-
dangerActive: "--danger-active",
|
|
913
|
-
dangerMuted: "--danger-muted",
|
|
914
|
-
dangerMutedForeground: "--danger-muted-foreground",
|
|
915
|
-
destructive: "--destructive",
|
|
916
|
-
destructiveForeground: "--destructive-foreground",
|
|
917
|
-
info: "--info",
|
|
918
|
-
infoForeground: "--info-foreground",
|
|
919
|
-
infoMuted: "--info-muted",
|
|
920
|
-
infoMutedForeground: "--info-muted-foreground",
|
|
921
|
-
border: "--border",
|
|
922
|
-
borderMuted: "--border-muted",
|
|
923
|
-
borderStrong: "--border-strong",
|
|
924
|
-
focusRing: "--focus-ring",
|
|
925
|
-
ring: "--ring",
|
|
926
|
-
input: "--input",
|
|
927
|
-
inputForeground: "--input-foreground",
|
|
928
|
-
inputPlaceholder: "--input-placeholder",
|
|
929
|
-
disabled: "--disabled",
|
|
930
|
-
disabledForeground: "--disabled-foreground",
|
|
931
|
-
chart1: "--chart-1",
|
|
932
|
-
chart2: "--chart-2",
|
|
933
|
-
chart3: "--chart-3",
|
|
934
|
-
chart4: "--chart-4",
|
|
935
|
-
chart5: "--chart-5",
|
|
936
|
-
sidebar: "--sidebar",
|
|
937
|
-
sidebarForeground: "--sidebar-foreground",
|
|
938
|
-
sidebarPrimary: "--sidebar-primary",
|
|
939
|
-
sidebarPrimaryForeground: "--sidebar-primary-foreground",
|
|
940
|
-
sidebarAccent: "--sidebar-accent",
|
|
941
|
-
sidebarAccentForeground: "--sidebar-accent-foreground",
|
|
942
|
-
sidebarBorder: "--sidebar-border",
|
|
943
|
-
sidebarRing: "--sidebar-ring"
|
|
944
|
-
};
|
|
945
|
-
for (const [tokenKey, cssVar2] of Object.entries(colorMapping)) {
|
|
946
|
-
const value = colors[tokenKey];
|
|
947
|
-
if (value) {
|
|
948
|
-
vars[cssVar2] = value;
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
const radiusPreset = getRadiusPreset(config.radius);
|
|
952
|
-
const baseRem = Number.parseFloat(radiusPreset.value);
|
|
953
|
-
const isZero = radiusPreset.key === "0";
|
|
954
|
-
vars["--radius"] = radiusPreset.value;
|
|
955
|
-
vars["--radius-none"] = "0px";
|
|
956
|
-
vars["--radius-sm"] = isZero ? "0px" : `${Math.max(baseRem * 0.4, 0.125)}rem`;
|
|
957
|
-
vars["--radius-md"] = isZero ? "0px" : `${Math.max(baseRem * 0.6, 0.25)}rem`;
|
|
958
|
-
vars["--radius-lg"] = isZero ? "0px" : `${Math.max(baseRem * 0.8, 0.375)}rem`;
|
|
959
|
-
vars["--radius-xl"] = isZero ? "0px" : `${Math.max(baseRem * 1.2, 0.5)}rem`;
|
|
960
|
-
vars["--radius-full"] = "9999px";
|
|
961
|
-
const fontPreset = getFontPreset(config.font);
|
|
962
|
-
vars["--font-sans"] = fontPreset.value;
|
|
963
|
-
const shadowPreset = getShadowPreset(config.shadow);
|
|
964
|
-
const shadows = mode === "dark" ? shadowPreset.dark : shadowPreset.light;
|
|
965
|
-
vars["--shadow-none"] = shadows.none;
|
|
966
|
-
vars["--shadow-xs"] = shadows.xs;
|
|
967
|
-
vars["--shadow-sm"] = shadows.sm;
|
|
968
|
-
vars["--shadow-md"] = shadows.md;
|
|
969
|
-
vars["--shadow-lg"] = shadows.lg;
|
|
970
|
-
vars["--shadow-xl"] = shadows.xl;
|
|
971
|
-
vars["--shadow-2xl"] = shadows["2xl"];
|
|
972
|
-
const stylePreset = getStylePreset(config.style);
|
|
973
|
-
const sv = stylePreset.vars;
|
|
974
|
-
vars["--ds-spacing-unit"] = sv.spacingUnit;
|
|
975
|
-
vars["--ds-padding-card"] = sv.paddingCard;
|
|
976
|
-
vars["--ds-padding-button-x"] = sv.paddingButtonX;
|
|
977
|
-
vars["--ds-padding-button-y"] = sv.paddingButtonY;
|
|
978
|
-
vars["--ds-gap-default"] = sv.gapDefault;
|
|
979
|
-
vars["--ds-border-width"] = sv.borderWidth;
|
|
980
|
-
vars["--ds-control-height"] = sv.controlHeight;
|
|
981
|
-
if (config.surfaceStyle === "elevated") {
|
|
982
|
-
vars["--card"] = mode === "dark" ? "oklch(0.205 0 0)" : "oklch(1 0 0)";
|
|
983
|
-
vars["--border"] = mode === "dark" ? "oklch(0.205 0 0 / 0)" : "oklch(0.922 0 0 / 0)";
|
|
984
|
-
vars["--border-muted"] = mode === "dark" ? "oklch(0.205 0 0 / 0)" : "oklch(0.922 0 0 / 0)";
|
|
985
|
-
} else if (config.surfaceStyle === "mixed") {
|
|
986
|
-
vars["--border"] = mode === "dark" ? "oklch(0.4 0 0 / 0.15)" : "oklch(0.8 0 0 / 0.3)";
|
|
987
|
-
vars["--border-muted"] = mode === "dark" ? "oklch(0.4 0 0 / 0.1)" : "oklch(0.85 0 0 / 0.25)";
|
|
988
|
-
}
|
|
989
|
-
return vars;
|
|
990
|
-
}
|
|
991
|
-
function generateThemeCSS(config) {
|
|
992
|
-
const lightVars = buildThemeOverrides(config, "light");
|
|
993
|
-
const darkVars = buildThemeOverrides(config, "dark");
|
|
994
|
-
const formatVars = (vars) => Object.entries(vars).map(([prop, value]) => ` ${prop}: ${value};`).join("\n");
|
|
995
|
-
return [
|
|
996
|
-
"/* ============================================",
|
|
997
|
-
" * Unified UI \u2014 Custom Theme",
|
|
998
|
-
` * Preset: ${getColorPreset(config.colorPreset).name}`,
|
|
999
|
-
` * Style: ${getStylePreset(config.style).name}`,
|
|
1000
|
-
` * Radius: ${getRadiusPreset(config.radius).label}`,
|
|
1001
|
-
` * Font: ${getFontPreset(config.font).name}`,
|
|
1002
|
-
` * Shadows: ${getShadowPreset(config.shadow).name}`,
|
|
1003
|
-
" * ============================================ */",
|
|
1004
|
-
"",
|
|
1005
|
-
":root {",
|
|
1006
|
-
formatVars(lightVars),
|
|
1007
|
-
"}",
|
|
1008
|
-
"",
|
|
1009
|
-
".dark {",
|
|
1010
|
-
formatVars(darkVars),
|
|
1011
|
-
"}"
|
|
1012
|
-
].join("\n");
|
|
1013
|
-
}
|
|
1014
|
-
var STORAGE_KEY = "ds-theme-customizer";
|
|
1015
|
-
var STYLE_ELEMENT_ID = "ds-theme-customizer";
|
|
1016
|
-
var ThemeCustomizerContext = react.createContext(null);
|
|
1017
|
-
function useThemeCustomizer() {
|
|
1018
|
-
const ctx = react.useContext(ThemeCustomizerContext);
|
|
1019
|
-
if (!ctx) {
|
|
1020
|
-
throw new Error(
|
|
1021
|
-
"useThemeCustomizer must be used within a <ThemeCustomizerProvider>. Wrap your application (or layout) with <ThemeCustomizerProvider>."
|
|
1022
|
-
);
|
|
1023
|
-
}
|
|
1024
|
-
return ctx;
|
|
1025
|
-
}
|
|
1026
|
-
function loadConfig() {
|
|
1027
|
-
if (typeof window === "undefined") return DEFAULT_THEME_CONFIG;
|
|
1028
|
-
try {
|
|
1029
|
-
const raw = localStorage.getItem(STORAGE_KEY);
|
|
1030
|
-
if (!raw) return DEFAULT_THEME_CONFIG;
|
|
1031
|
-
const parsed = JSON.parse(raw);
|
|
1032
|
-
return {
|
|
1033
|
-
style: STYLE_PRESETS.some((s) => s.key === parsed.style) ? parsed.style : DEFAULT_THEME_CONFIG.style,
|
|
1034
|
-
colorPreset: COLOR_PRESET_KEYS.includes(parsed.colorPreset ?? "") ? parsed.colorPreset : DEFAULT_THEME_CONFIG.colorPreset,
|
|
1035
|
-
radius: RADIUS_PRESETS.some((r) => r.key === parsed.radius) ? parsed.radius : DEFAULT_THEME_CONFIG.radius,
|
|
1036
|
-
font: FONT_PRESETS.some((f) => f.key === parsed.font) ? parsed.font : DEFAULT_THEME_CONFIG.font,
|
|
1037
|
-
shadow: SHADOW_PRESETS.some((s) => s.key === parsed.shadow) ? parsed.shadow : DEFAULT_THEME_CONFIG.shadow,
|
|
1038
|
-
surfaceStyle: SURFACE_STYLE_PRESETS.some(
|
|
1039
|
-
(s) => s.key === parsed.surfaceStyle
|
|
1040
|
-
) ? parsed.surfaceStyle : DEFAULT_THEME_CONFIG.surfaceStyle
|
|
1041
|
-
};
|
|
1042
|
-
} catch {
|
|
1043
|
-
return DEFAULT_THEME_CONFIG;
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
function saveConfig(config) {
|
|
1047
|
-
if (typeof window === "undefined") return;
|
|
1048
|
-
try {
|
|
1049
|
-
localStorage.setItem(STORAGE_KEY, JSON.stringify(config));
|
|
1050
|
-
} catch {
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
function getResolvedMode() {
|
|
1054
|
-
if (typeof document === "undefined") return "light";
|
|
1055
|
-
return document.documentElement.classList.contains("dark") ? "dark" : "light";
|
|
1056
|
-
}
|
|
1057
|
-
function injectStyles(config) {
|
|
1058
|
-
if (typeof document === "undefined") return;
|
|
1059
|
-
let styleEl = document.getElementById(
|
|
1060
|
-
STYLE_ELEMENT_ID
|
|
1061
|
-
);
|
|
1062
|
-
if (!styleEl) {
|
|
1063
|
-
styleEl = document.createElement("style");
|
|
1064
|
-
styleEl.id = STYLE_ELEMENT_ID;
|
|
1065
|
-
styleEl.setAttribute("data-ds-customizer", "");
|
|
1066
|
-
document.head.appendChild(styleEl);
|
|
1067
|
-
}
|
|
1068
|
-
const lightVars = buildThemeOverrides(config, "light");
|
|
1069
|
-
const darkVars = buildThemeOverrides(config, "dark");
|
|
1070
|
-
const formatVars = (vars) => Object.entries(vars).map(([prop, value]) => `${prop}:${value}`).join(";");
|
|
1071
|
-
styleEl.textContent = [
|
|
1072
|
-
`:root:root{${formatVars(lightVars)}}`,
|
|
1073
|
-
`.dark:root{${formatVars(darkVars)}}`
|
|
1074
|
-
].join("\n");
|
|
1075
|
-
}
|
|
1076
|
-
function removeStyles() {
|
|
1077
|
-
if (typeof document === "undefined") return;
|
|
1078
|
-
const styleEl = document.getElementById(STYLE_ELEMENT_ID);
|
|
1079
|
-
if (styleEl) {
|
|
1080
|
-
styleEl.remove();
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
function configsEqual(a, b) {
|
|
1084
|
-
return a.style === b.style && a.colorPreset === b.colorPreset && a.radius === b.radius && a.font === b.font && a.shadow === b.shadow && a.surfaceStyle === b.surfaceStyle;
|
|
1085
|
-
}
|
|
1086
|
-
function ThemeCustomizerProvider({
|
|
1087
|
-
children,
|
|
1088
|
-
defaultConfig,
|
|
1089
|
-
applyStyles = true
|
|
1090
|
-
}) {
|
|
1091
|
-
const [config, setConfigState] = react.useState(
|
|
1092
|
-
() => defaultConfig ?? loadConfig()
|
|
1093
|
-
);
|
|
1094
|
-
const [_resolvedMode, setResolvedMode] = react.useState("light");
|
|
1095
|
-
const configRef = react.useRef(config);
|
|
1096
|
-
configRef.current = config;
|
|
1097
|
-
react.useEffect(() => {
|
|
1098
|
-
setResolvedMode(getResolvedMode());
|
|
1099
|
-
const observer = new MutationObserver(() => {
|
|
1100
|
-
const newMode = getResolvedMode();
|
|
1101
|
-
setResolvedMode((prev) => {
|
|
1102
|
-
if (prev !== newMode) return newMode;
|
|
1103
|
-
return prev;
|
|
1104
|
-
});
|
|
1105
|
-
});
|
|
1106
|
-
observer.observe(document.documentElement, {
|
|
1107
|
-
attributes: true,
|
|
1108
|
-
attributeFilter: ["class"]
|
|
1109
|
-
});
|
|
1110
|
-
return () => observer.disconnect();
|
|
1111
|
-
}, []);
|
|
1112
|
-
react.useEffect(() => {
|
|
1113
|
-
if (applyStyles) {
|
|
1114
|
-
injectStyles(config);
|
|
1115
|
-
}
|
|
1116
|
-
}, [config, applyStyles]);
|
|
1117
|
-
react.useEffect(() => {
|
|
1118
|
-
saveConfig(config);
|
|
1119
|
-
}, [config]);
|
|
1120
|
-
react.useEffect(() => {
|
|
1121
|
-
return () => {
|
|
1122
|
-
if (applyStyles) {
|
|
1123
|
-
removeStyles();
|
|
1124
|
-
}
|
|
1125
|
-
};
|
|
1126
|
-
}, [applyStyles]);
|
|
1127
|
-
react.useEffect(() => {
|
|
1128
|
-
const handleStorage = (e) => {
|
|
1129
|
-
if (e.key === STORAGE_KEY && e.newValue) {
|
|
1130
|
-
try {
|
|
1131
|
-
const parsed = JSON.parse(e.newValue);
|
|
1132
|
-
setConfigState((prev) => {
|
|
1133
|
-
if (configsEqual(prev, parsed)) return prev;
|
|
1134
|
-
return parsed;
|
|
1135
|
-
});
|
|
1136
|
-
} catch {
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
};
|
|
1140
|
-
window.addEventListener("storage", handleStorage);
|
|
1141
|
-
return () => window.removeEventListener("storage", handleStorage);
|
|
1142
|
-
}, []);
|
|
1143
|
-
const setConfig = react.useCallback((newConfig) => {
|
|
1144
|
-
setConfigState(newConfig);
|
|
1145
|
-
}, []);
|
|
1146
|
-
const setStyle = react.useCallback((key) => {
|
|
1147
|
-
const preset = getStylePreset(key);
|
|
1148
|
-
setConfigState((prev) => {
|
|
1149
|
-
if (prev.style === key) return prev;
|
|
1150
|
-
return {
|
|
1151
|
-
...prev,
|
|
1152
|
-
style: key,
|
|
1153
|
-
radius: preset.defaults.radius,
|
|
1154
|
-
font: preset.defaults.font,
|
|
1155
|
-
shadow: preset.defaults.shadow,
|
|
1156
|
-
surfaceStyle: preset.defaults.surfaceStyle
|
|
1157
|
-
};
|
|
1158
|
-
});
|
|
1159
|
-
}, []);
|
|
1160
|
-
const setColorPreset = react.useCallback((key) => {
|
|
1161
|
-
setConfigState((prev) => {
|
|
1162
|
-
if (prev.colorPreset === key) return prev;
|
|
1163
|
-
return { ...prev, colorPreset: key };
|
|
1164
|
-
});
|
|
1165
|
-
}, []);
|
|
1166
|
-
const setRadius = react.useCallback((key) => {
|
|
1167
|
-
setConfigState((prev) => {
|
|
1168
|
-
if (prev.radius === key) return prev;
|
|
1169
|
-
return { ...prev, radius: key };
|
|
1170
|
-
});
|
|
1171
|
-
}, []);
|
|
1172
|
-
const setFont = react.useCallback((key) => {
|
|
1173
|
-
setConfigState((prev) => {
|
|
1174
|
-
if (prev.font === key) return prev;
|
|
1175
|
-
return { ...prev, font: key };
|
|
1176
|
-
});
|
|
1177
|
-
}, []);
|
|
1178
|
-
const setShadow = react.useCallback((key) => {
|
|
1179
|
-
setConfigState((prev) => {
|
|
1180
|
-
if (prev.shadow === key) return prev;
|
|
1181
|
-
return { ...prev, shadow: key };
|
|
1182
|
-
});
|
|
1183
|
-
}, []);
|
|
1184
|
-
const setSurfaceStyle = react.useCallback((key) => {
|
|
1185
|
-
setConfigState((prev) => {
|
|
1186
|
-
if (prev.surfaceStyle === key) return prev;
|
|
1187
|
-
return { ...prev, surfaceStyle: key };
|
|
1188
|
-
});
|
|
1189
|
-
}, []);
|
|
1190
|
-
const resetConfig = react.useCallback(() => {
|
|
1191
|
-
setConfigState(DEFAULT_THEME_CONFIG);
|
|
1192
|
-
}, []);
|
|
1193
|
-
const isDefault = configsEqual(config, DEFAULT_THEME_CONFIG);
|
|
1194
|
-
const generateCSSFn = react.useCallback(() => {
|
|
1195
|
-
return generateThemeCSS(config);
|
|
1196
|
-
}, [config]);
|
|
1197
|
-
const value = react.useMemo(
|
|
1198
|
-
() => ({
|
|
1199
|
-
config,
|
|
1200
|
-
setConfig,
|
|
1201
|
-
setStyle,
|
|
1202
|
-
setColorPreset,
|
|
1203
|
-
setRadius,
|
|
1204
|
-
setFont,
|
|
1205
|
-
setShadow,
|
|
1206
|
-
setSurfaceStyle,
|
|
1207
|
-
resetConfig,
|
|
1208
|
-
isDefault,
|
|
1209
|
-
generateCSS: generateCSSFn
|
|
1210
|
-
}),
|
|
1211
|
-
[
|
|
1212
|
-
config,
|
|
1213
|
-
setConfig,
|
|
1214
|
-
setStyle,
|
|
1215
|
-
setColorPreset,
|
|
1216
|
-
setRadius,
|
|
1217
|
-
setFont,
|
|
1218
|
-
setShadow,
|
|
1219
|
-
setSurfaceStyle,
|
|
1220
|
-
resetConfig,
|
|
1221
|
-
isDefault,
|
|
1222
|
-
generateCSSFn
|
|
1223
|
-
]
|
|
1224
|
-
);
|
|
1225
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ThemeCustomizerContext.Provider, { value, children });
|
|
1226
|
-
}
|
|
1227
|
-
function Section({
|
|
1228
|
-
title,
|
|
1229
|
-
children,
|
|
1230
|
-
className
|
|
1231
|
-
}) {
|
|
1232
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunk4ON3M3OM_cjs.cn("space-y-2", className), children: [
|
|
1233
|
-
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: title }),
|
|
1234
|
-
children
|
|
1235
|
-
] });
|
|
1236
|
-
}
|
|
1237
|
-
function CheckIcon({ className }) {
|
|
1238
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1239
|
-
"svg",
|
|
1240
|
-
{
|
|
1241
|
-
className: chunk4ON3M3OM_cjs.cn("size-4 shrink-0", className),
|
|
1242
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1243
|
-
viewBox: "0 0 24 24",
|
|
1244
|
-
fill: "none",
|
|
1245
|
-
stroke: "currentColor",
|
|
1246
|
-
strokeWidth: "2.5",
|
|
1247
|
-
strokeLinecap: "round",
|
|
1248
|
-
strokeLinejoin: "round",
|
|
1249
|
-
"aria-hidden": "true",
|
|
1250
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 6 9 17l-5-5" })
|
|
1251
|
-
}
|
|
1252
|
-
);
|
|
1253
|
-
}
|
|
1254
|
-
function ColorSwatch({
|
|
1255
|
-
preset,
|
|
1256
|
-
isActive,
|
|
1257
|
-
onClick
|
|
1258
|
-
}) {
|
|
1259
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1260
|
-
"button",
|
|
1261
|
-
{
|
|
1262
|
-
type: "button",
|
|
1263
|
-
onClick,
|
|
1264
|
-
className: chunk4ON3M3OM_cjs.cn(
|
|
1265
|
-
"group relative flex items-center gap-2 rounded-md border px-3 py-2 text-left text-sm transition-all duration-fast ease-standard",
|
|
1266
|
-
"hover:border-border-strong hover:bg-muted/50",
|
|
1267
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
1268
|
-
isActive ? "border-primary bg-muted/60 shadow-sm" : "border-border bg-transparent"
|
|
1269
|
-
),
|
|
1270
|
-
title: preset.name,
|
|
1271
|
-
children: [
|
|
1272
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1273
|
-
"span",
|
|
1274
|
-
{
|
|
1275
|
-
className: chunk4ON3M3OM_cjs.cn(
|
|
1276
|
-
"size-5 shrink-0 rounded-full border shadow-xs",
|
|
1277
|
-
isActive ? "border-primary/50 ring-2 ring-primary/20" : "border-border"
|
|
1278
|
-
),
|
|
1279
|
-
style: { backgroundColor: preset.swatch },
|
|
1280
|
-
"aria-hidden": "true"
|
|
1281
|
-
}
|
|
1282
|
-
),
|
|
1283
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1284
|
-
"span",
|
|
1285
|
-
{
|
|
1286
|
-
className: chunk4ON3M3OM_cjs.cn(
|
|
1287
|
-
"text-sm font-medium",
|
|
1288
|
-
isActive ? "text-foreground" : "text-muted-foreground"
|
|
1289
|
-
),
|
|
1290
|
-
children: preset.name
|
|
1291
|
-
}
|
|
1292
|
-
),
|
|
1293
|
-
isActive && /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: "ml-auto text-primary" })
|
|
1294
|
-
]
|
|
1295
|
-
}
|
|
1296
|
-
);
|
|
1297
|
-
}
|
|
1298
|
-
function RadiusOption({
|
|
1299
|
-
preset,
|
|
1300
|
-
isActive,
|
|
1301
|
-
onClick
|
|
1302
|
-
}) {
|
|
1303
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1304
|
-
"button",
|
|
1305
|
-
{
|
|
1306
|
-
type: "button",
|
|
1307
|
-
onClick,
|
|
1308
|
-
className: chunk4ON3M3OM_cjs.cn(
|
|
1309
|
-
"flex flex-col items-center justify-center gap-1 rounded-md border px-3 py-2 text-center transition-all duration-fast ease-standard",
|
|
1310
|
-
"hover:border-border-strong hover:bg-muted/50",
|
|
1311
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
1312
|
-
isActive ? "border-primary bg-muted/60 shadow-sm" : "border-border bg-transparent"
|
|
1313
|
-
),
|
|
1314
|
-
title: `${preset.name} (${preset.label})`,
|
|
1315
|
-
children: [
|
|
1316
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1317
|
-
"span",
|
|
1318
|
-
{
|
|
1319
|
-
className: "size-8 border-2 border-foreground/30 bg-muted",
|
|
1320
|
-
style: { borderRadius: preset.value },
|
|
1321
|
-
"aria-hidden": "true"
|
|
1322
|
-
}
|
|
1323
|
-
),
|
|
1324
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1325
|
-
"span",
|
|
1326
|
-
{
|
|
1327
|
-
className: chunk4ON3M3OM_cjs.cn(
|
|
1328
|
-
"text-[11px] font-medium leading-none",
|
|
1329
|
-
isActive ? "text-foreground" : "text-muted-foreground"
|
|
1330
|
-
),
|
|
1331
|
-
children: preset.label
|
|
1332
|
-
}
|
|
1333
|
-
)
|
|
1334
|
-
]
|
|
1335
|
-
}
|
|
1336
|
-
);
|
|
1337
|
-
}
|
|
1338
|
-
function FontOption({
|
|
1339
|
-
preset,
|
|
1340
|
-
isActive,
|
|
1341
|
-
onClick
|
|
1342
|
-
}) {
|
|
1343
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1344
|
-
"button",
|
|
1345
|
-
{
|
|
1346
|
-
type: "button",
|
|
1347
|
-
onClick,
|
|
1348
|
-
className: chunk4ON3M3OM_cjs.cn(
|
|
1349
|
-
"flex items-center gap-2 rounded-md border px-3 py-2 text-left transition-all duration-fast ease-standard",
|
|
1350
|
-
"hover:border-border-strong hover:bg-muted/50",
|
|
1351
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
1352
|
-
isActive ? "border-primary bg-muted/60 shadow-sm" : "border-border bg-transparent"
|
|
1353
|
-
),
|
|
1354
|
-
title: preset.name,
|
|
1355
|
-
children: [
|
|
1356
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1357
|
-
"span",
|
|
1358
|
-
{
|
|
1359
|
-
className: chunk4ON3M3OM_cjs.cn(
|
|
1360
|
-
"text-base font-semibold leading-none",
|
|
1361
|
-
isActive ? "text-foreground" : "text-muted-foreground"
|
|
1362
|
-
),
|
|
1363
|
-
style: { fontFamily: preset.value },
|
|
1364
|
-
children: preset.sample
|
|
1365
|
-
}
|
|
1366
|
-
),
|
|
1367
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1368
|
-
"span",
|
|
1369
|
-
{
|
|
1370
|
-
className: chunk4ON3M3OM_cjs.cn(
|
|
1371
|
-
"text-sm",
|
|
1372
|
-
isActive ? "text-foreground font-medium" : "text-muted-foreground"
|
|
1373
|
-
),
|
|
1374
|
-
children: preset.name
|
|
1375
|
-
}
|
|
1376
|
-
),
|
|
1377
|
-
isActive && /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: "ml-auto text-primary" })
|
|
1378
|
-
]
|
|
1379
|
-
}
|
|
1380
|
-
);
|
|
1381
|
-
}
|
|
1382
|
-
function PillToggle({
|
|
1383
|
-
label,
|
|
1384
|
-
isActive,
|
|
1385
|
-
onClick,
|
|
1386
|
-
description
|
|
1387
|
-
}) {
|
|
1388
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1389
|
-
"button",
|
|
1390
|
-
{
|
|
1391
|
-
type: "button",
|
|
1392
|
-
onClick,
|
|
1393
|
-
className: chunk4ON3M3OM_cjs.cn(
|
|
1394
|
-
"rounded-md border px-3 py-2 text-left text-sm transition-all duration-fast ease-standard",
|
|
1395
|
-
"hover:border-border-strong hover:bg-muted/50",
|
|
1396
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
1397
|
-
isActive ? "border-primary bg-muted/60 shadow-sm font-medium text-foreground" : "border-border bg-transparent text-muted-foreground"
|
|
1398
|
-
),
|
|
1399
|
-
title: description,
|
|
1400
|
-
children: label
|
|
1401
|
-
}
|
|
1402
|
-
);
|
|
1403
|
-
}
|
|
1404
|
-
function StyleOption({
|
|
1405
|
-
preset,
|
|
1406
|
-
isActive,
|
|
1407
|
-
onClick
|
|
1408
|
-
}) {
|
|
1409
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1410
|
-
"button",
|
|
1411
|
-
{
|
|
1412
|
-
type: "button",
|
|
1413
|
-
onClick,
|
|
1414
|
-
className: chunk4ON3M3OM_cjs.cn(
|
|
1415
|
-
"flex items-start gap-3 rounded-md border px-3 py-3 text-left transition-all duration-fast ease-standard",
|
|
1416
|
-
"hover:border-border-strong hover:bg-muted/50",
|
|
1417
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
1418
|
-
isActive ? "border-primary bg-muted/60 shadow-sm" : "border-border bg-transparent"
|
|
1419
|
-
),
|
|
1420
|
-
title: preset.description,
|
|
1421
|
-
children: [
|
|
1422
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1423
|
-
"svg",
|
|
1424
|
-
{
|
|
1425
|
-
className: chunk4ON3M3OM_cjs.cn(
|
|
1426
|
-
"size-5 shrink-0 mt-0.5",
|
|
1427
|
-
isActive ? "text-primary" : "text-muted-foreground"
|
|
1428
|
-
),
|
|
1429
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1430
|
-
viewBox: "0 0 24 24",
|
|
1431
|
-
fill: "none",
|
|
1432
|
-
stroke: "currentColor",
|
|
1433
|
-
strokeWidth: "1.5",
|
|
1434
|
-
strokeLinecap: "round",
|
|
1435
|
-
strokeLinejoin: "round",
|
|
1436
|
-
"aria-hidden": "true",
|
|
1437
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: preset.iconPath })
|
|
1438
|
-
}
|
|
1439
|
-
),
|
|
1440
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
1441
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1442
|
-
"div",
|
|
1443
|
-
{
|
|
1444
|
-
className: chunk4ON3M3OM_cjs.cn(
|
|
1445
|
-
"text-sm font-semibold leading-tight",
|
|
1446
|
-
isActive ? "text-foreground" : "text-foreground"
|
|
1447
|
-
),
|
|
1448
|
-
children: preset.name
|
|
1449
|
-
}
|
|
1450
|
-
),
|
|
1451
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1452
|
-
"div",
|
|
1453
|
-
{
|
|
1454
|
-
className: chunk4ON3M3OM_cjs.cn(
|
|
1455
|
-
"mt-0.5 text-xs leading-snug",
|
|
1456
|
-
isActive ? "text-muted-foreground" : "text-muted-foreground/70"
|
|
1457
|
-
),
|
|
1458
|
-
children: preset.description
|
|
1459
|
-
}
|
|
1460
|
-
)
|
|
1461
|
-
] }),
|
|
1462
|
-
isActive && /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: "shrink-0 mt-0.5 text-primary" })
|
|
1463
|
-
]
|
|
1464
|
-
}
|
|
1465
|
-
);
|
|
1466
|
-
}
|
|
1467
|
-
function CopyButton({
|
|
1468
|
-
getText,
|
|
1469
|
-
className,
|
|
1470
|
-
children
|
|
1471
|
-
}) {
|
|
1472
|
-
const [copied, setCopied] = react.useState(false);
|
|
1473
|
-
const timeoutRef = react.useRef(null);
|
|
1474
|
-
const handleCopy = react.useCallback(() => {
|
|
1475
|
-
const text = getText();
|
|
1476
|
-
navigator.clipboard.writeText(text).then(() => {
|
|
1477
|
-
setCopied(true);
|
|
1478
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
1479
|
-
timeoutRef.current = setTimeout(() => setCopied(false), 2e3);
|
|
1480
|
-
});
|
|
1481
|
-
}, [getText]);
|
|
1482
|
-
react.useEffect(() => {
|
|
1483
|
-
return () => {
|
|
1484
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
1485
|
-
};
|
|
1486
|
-
}, []);
|
|
1487
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1488
|
-
"button",
|
|
1489
|
-
{
|
|
1490
|
-
type: "button",
|
|
1491
|
-
onClick: handleCopy,
|
|
1492
|
-
className: chunk4ON3M3OM_cjs.cn(
|
|
1493
|
-
"inline-flex items-center justify-center gap-2 rounded-md border border-border bg-secondary px-4 py-2 text-sm font-medium text-secondary-foreground transition-all duration-fast ease-standard",
|
|
1494
|
-
"hover:bg-secondary-hover active:bg-secondary-active",
|
|
1495
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
1496
|
-
className
|
|
1497
|
-
),
|
|
1498
|
-
children: copied ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1499
|
-
/* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: "text-success" }),
|
|
1500
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Copied!" })
|
|
1501
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1502
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1503
|
-
"svg",
|
|
1504
|
-
{
|
|
1505
|
-
className: "size-4",
|
|
1506
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1507
|
-
viewBox: "0 0 24 24",
|
|
1508
|
-
fill: "none",
|
|
1509
|
-
stroke: "currentColor",
|
|
1510
|
-
strokeWidth: "2",
|
|
1511
|
-
strokeLinecap: "round",
|
|
1512
|
-
strokeLinejoin: "round",
|
|
1513
|
-
"aria-hidden": "true",
|
|
1514
|
-
children: [
|
|
1515
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" }),
|
|
1516
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })
|
|
1517
|
-
]
|
|
1518
|
-
}
|
|
1519
|
-
),
|
|
1520
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: children ?? "Copy CSS" })
|
|
1521
|
-
] })
|
|
1522
|
-
}
|
|
1523
|
-
);
|
|
1524
|
-
}
|
|
1525
|
-
function ThemeCustomizer({
|
|
1526
|
-
className,
|
|
1527
|
-
showCopyButton = true,
|
|
1528
|
-
showResetButton = true
|
|
1529
|
-
}) {
|
|
1530
|
-
const {
|
|
1531
|
-
config,
|
|
1532
|
-
setStyle,
|
|
1533
|
-
setColorPreset,
|
|
1534
|
-
setRadius,
|
|
1535
|
-
setFont,
|
|
1536
|
-
setShadow,
|
|
1537
|
-
setSurfaceStyle,
|
|
1538
|
-
resetConfig,
|
|
1539
|
-
isDefault,
|
|
1540
|
-
generateCSS
|
|
1541
|
-
} = useThemeCustomizer();
|
|
1542
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1543
|
-
"div",
|
|
1544
|
-
{
|
|
1545
|
-
className: chunk4ON3M3OM_cjs.cn("space-y-6", className),
|
|
1546
|
-
"data-ds": "",
|
|
1547
|
-
"data-ds-component": "theme-customizer",
|
|
1548
|
-
children: [
|
|
1549
|
-
/* @__PURE__ */ jsxRuntime.jsx(Section, { title: "Style", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-2", children: STYLE_PRESETS.map((preset) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1550
|
-
StyleOption,
|
|
1551
|
-
{
|
|
1552
|
-
preset,
|
|
1553
|
-
isActive: config.style === preset.key,
|
|
1554
|
-
onClick: () => setStyle(preset.key)
|
|
1555
|
-
},
|
|
1556
|
-
preset.key
|
|
1557
|
-
)) }) }),
|
|
1558
|
-
/* @__PURE__ */ jsxRuntime.jsx(Section, { title: "Color", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-2", children: COLOR_PRESETS.map((preset) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1559
|
-
ColorSwatch,
|
|
1560
|
-
{
|
|
1561
|
-
preset,
|
|
1562
|
-
isActive: config.colorPreset === preset.key,
|
|
1563
|
-
onClick: () => setColorPreset(preset.key)
|
|
1564
|
-
},
|
|
1565
|
-
preset.key
|
|
1566
|
-
)) }) }),
|
|
1567
|
-
/* @__PURE__ */ jsxRuntime.jsx(Section, { title: "Radius", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: RADIUS_PRESETS.map((preset) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1568
|
-
RadiusOption,
|
|
1569
|
-
{
|
|
1570
|
-
preset,
|
|
1571
|
-
isActive: config.radius === preset.key,
|
|
1572
|
-
onClick: () => setRadius(preset.key)
|
|
1573
|
-
},
|
|
1574
|
-
preset.key
|
|
1575
|
-
)) }) }),
|
|
1576
|
-
/* @__PURE__ */ jsxRuntime.jsx(Section, { title: "Font", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-2", children: FONT_PRESETS.map((preset) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1577
|
-
FontOption,
|
|
1578
|
-
{
|
|
1579
|
-
preset,
|
|
1580
|
-
isActive: config.font === preset.key,
|
|
1581
|
-
onClick: () => setFont(preset.key)
|
|
1582
|
-
},
|
|
1583
|
-
preset.key
|
|
1584
|
-
)) }) }),
|
|
1585
|
-
/* @__PURE__ */ jsxRuntime.jsx(Section, { title: "Shadow", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: SHADOW_PRESETS.map((preset) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1586
|
-
PillToggle,
|
|
1587
|
-
{
|
|
1588
|
-
label: preset.name,
|
|
1589
|
-
isActive: config.shadow === preset.key,
|
|
1590
|
-
onClick: () => setShadow(preset.key),
|
|
1591
|
-
description: preset.description
|
|
1592
|
-
},
|
|
1593
|
-
preset.key
|
|
1594
|
-
)) }) }),
|
|
1595
|
-
/* @__PURE__ */ jsxRuntime.jsx(Section, { title: "Surface", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: SURFACE_STYLE_PRESETS.map((preset) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1596
|
-
PillToggle,
|
|
1597
|
-
{
|
|
1598
|
-
label: preset.name,
|
|
1599
|
-
isActive: config.surfaceStyle === preset.key,
|
|
1600
|
-
onClick: () => setSurfaceStyle(preset.key),
|
|
1601
|
-
description: preset.description
|
|
1602
|
-
},
|
|
1603
|
-
preset.key
|
|
1604
|
-
)) }) }),
|
|
1605
|
-
(showCopyButton || showResetButton) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 border-t border-border pt-4", children: [
|
|
1606
|
-
showCopyButton && /* @__PURE__ */ jsxRuntime.jsx(CopyButton, { getText: generateCSS, className: "flex-1" }),
|
|
1607
|
-
showResetButton && !isDefault && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1608
|
-
"button",
|
|
1609
|
-
{
|
|
1610
|
-
type: "button",
|
|
1611
|
-
onClick: resetConfig,
|
|
1612
|
-
className: chunk4ON3M3OM_cjs.cn(
|
|
1613
|
-
"inline-flex items-center justify-center gap-2 rounded-md border border-border bg-transparent px-4 py-2 text-sm font-medium text-muted-foreground transition-all duration-fast ease-standard",
|
|
1614
|
-
"hover:bg-muted hover:text-foreground",
|
|
1615
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
|
|
1616
|
-
),
|
|
1617
|
-
children: [
|
|
1618
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1619
|
-
"svg",
|
|
1620
|
-
{
|
|
1621
|
-
className: "size-4",
|
|
1622
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1623
|
-
viewBox: "0 0 24 24",
|
|
1624
|
-
fill: "none",
|
|
1625
|
-
stroke: "currentColor",
|
|
1626
|
-
strokeWidth: "2",
|
|
1627
|
-
strokeLinecap: "round",
|
|
1628
|
-
strokeLinejoin: "round",
|
|
1629
|
-
"aria-hidden": "true",
|
|
1630
|
-
children: [
|
|
1631
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
1632
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 3v5h5" })
|
|
1633
|
-
]
|
|
1634
|
-
}
|
|
1635
|
-
),
|
|
1636
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Reset" })
|
|
1637
|
-
]
|
|
1638
|
-
}
|
|
1639
|
-
)
|
|
1640
|
-
] })
|
|
1641
|
-
]
|
|
1642
|
-
}
|
|
1643
|
-
);
|
|
1644
|
-
}
|
|
1645
|
-
ThemeCustomizer.displayName = "ThemeCustomizer";
|
|
1646
|
-
var DSThemeContext = react.createContext(null);
|
|
1647
|
-
function useDSTheme() {
|
|
1648
|
-
const ctx = react.useContext(DSThemeContext);
|
|
1649
|
-
if (!ctx) {
|
|
1650
|
-
throw new Error(
|
|
1651
|
-
"useDSTheme must be used within a <DSThemeProvider>. Wrap your application (or layout) with <DSThemeProvider>."
|
|
1652
|
-
);
|
|
1653
|
-
}
|
|
1654
|
-
return ctx;
|
|
1655
|
-
}
|
|
1656
|
-
function getSystemPreference() {
|
|
1657
|
-
if (typeof window === "undefined") return "light";
|
|
1658
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
1659
|
-
}
|
|
1660
|
-
function resolveTheme(theme) {
|
|
1661
|
-
if (theme === "system") return getSystemPreference();
|
|
1662
|
-
return theme;
|
|
1663
|
-
}
|
|
1664
|
-
var STORAGE_KEY2 = "ds-theme-preference";
|
|
1665
|
-
function getStoredTheme() {
|
|
1666
|
-
if (typeof window === "undefined") return "system";
|
|
1667
|
-
try {
|
|
1668
|
-
const stored = localStorage.getItem(STORAGE_KEY2);
|
|
1669
|
-
if (stored === "light" || stored === "dark" || stored === "system") {
|
|
1670
|
-
return stored;
|
|
1671
|
-
}
|
|
1672
|
-
} catch {
|
|
1673
|
-
}
|
|
1674
|
-
return "system";
|
|
1675
|
-
}
|
|
1676
|
-
function storeTheme(theme) {
|
|
1677
|
-
try {
|
|
1678
|
-
localStorage.setItem(STORAGE_KEY2, theme);
|
|
1679
|
-
} catch {
|
|
1680
|
-
}
|
|
1681
|
-
}
|
|
1682
|
-
function DSThemeProvider({
|
|
1683
|
-
children,
|
|
1684
|
-
defaultTheme,
|
|
1685
|
-
manageHtmlClass = false
|
|
1686
|
-
}) {
|
|
1687
|
-
const [theme, setThemeState] = react.useState(
|
|
1688
|
-
() => defaultTheme ?? getStoredTheme()
|
|
1689
|
-
);
|
|
1690
|
-
const [systemPreference, setSystemPreference] = react.useState("light");
|
|
1691
|
-
react.useEffect(() => {
|
|
1692
|
-
setSystemPreference(getSystemPreference());
|
|
1693
|
-
const mql = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1694
|
-
const handler = (e) => {
|
|
1695
|
-
setSystemPreference(e.matches ? "dark" : "light");
|
|
1696
|
-
};
|
|
1697
|
-
mql.addEventListener("change", handler);
|
|
1698
|
-
return () => mql.removeEventListener("change", handler);
|
|
1699
|
-
}, []);
|
|
1700
|
-
const resolvedTheme = react.useMemo(
|
|
1701
|
-
() => theme === "system" ? systemPreference : theme,
|
|
1702
|
-
[theme, systemPreference]
|
|
1703
|
-
);
|
|
1704
|
-
react.useEffect(() => {
|
|
1705
|
-
if (!manageHtmlClass) return;
|
|
1706
|
-
const root = document.documentElement;
|
|
1707
|
-
if (resolvedTheme === "dark") {
|
|
1708
|
-
root.classList.add("dark");
|
|
1709
|
-
} else {
|
|
1710
|
-
root.classList.remove("dark");
|
|
1711
|
-
}
|
|
1712
|
-
}, [resolvedTheme, manageHtmlClass]);
|
|
1713
|
-
const setTheme = react.useCallback((newTheme) => {
|
|
1714
|
-
setThemeState(newTheme);
|
|
1715
|
-
storeTheme(newTheme);
|
|
1716
|
-
}, []);
|
|
1717
|
-
const toggleTheme = react.useCallback(() => {
|
|
1718
|
-
setThemeState((current) => {
|
|
1719
|
-
const resolved = resolveTheme(current);
|
|
1720
|
-
const next = resolved === "dark" ? "light" : "dark";
|
|
1721
|
-
storeTheme(next);
|
|
1722
|
-
return next;
|
|
1723
|
-
});
|
|
1724
|
-
}, []);
|
|
1725
|
-
const value = react.useMemo(
|
|
1726
|
-
() => ({
|
|
1727
|
-
theme,
|
|
1728
|
-
resolvedTheme,
|
|
1729
|
-
setTheme,
|
|
1730
|
-
toggleTheme
|
|
1731
|
-
}),
|
|
1732
|
-
[theme, resolvedTheme, setTheme, toggleTheme]
|
|
1733
|
-
);
|
|
1734
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DSThemeContext.Provider, { value, children });
|
|
1735
|
-
}
|
|
1736
|
-
|
|
1737
|
-
exports.COLOR_PRESETS = COLOR_PRESETS;
|
|
1738
|
-
exports.COLOR_PRESET_KEYS = COLOR_PRESET_KEYS;
|
|
1739
|
-
exports.DEFAULT_FONT_KEY = DEFAULT_FONT_KEY;
|
|
1740
|
-
exports.DEFAULT_RADIUS_KEY = DEFAULT_RADIUS_KEY;
|
|
1741
|
-
exports.DEFAULT_SHADOW_KEY = DEFAULT_SHADOW_KEY;
|
|
1742
|
-
exports.DEFAULT_STYLE_KEY = DEFAULT_STYLE_KEY;
|
|
1743
|
-
exports.DEFAULT_SURFACE_STYLE_KEY = DEFAULT_SURFACE_STYLE_KEY;
|
|
1744
|
-
exports.DEFAULT_THEME_CONFIG = DEFAULT_THEME_CONFIG;
|
|
1745
|
-
exports.DSThemeProvider = DSThemeProvider;
|
|
1746
|
-
exports.FONT_PRESETS = FONT_PRESETS;
|
|
1747
|
-
exports.RADIUS_PRESETS = RADIUS_PRESETS;
|
|
1748
|
-
exports.SHADOW_PRESETS = SHADOW_PRESETS;
|
|
1749
|
-
exports.STYLE_PRESETS = STYLE_PRESETS;
|
|
1750
|
-
exports.SURFACE_STYLE_PRESETS = SURFACE_STYLE_PRESETS;
|
|
1751
|
-
exports.ThemeCustomizer = ThemeCustomizer;
|
|
1752
|
-
exports.ThemeCustomizerProvider = ThemeCustomizerProvider;
|
|
1753
|
-
exports.buildDarkThemeVars = buildDarkThemeVars;
|
|
1754
|
-
exports.buildLightThemeVars = buildLightThemeVars;
|
|
1755
|
-
exports.buildThemeCSS = buildThemeCSS;
|
|
1756
|
-
exports.buildThemeOverrides = buildThemeOverrides;
|
|
1757
|
-
exports.contract = contract;
|
|
1758
|
-
exports.cssVar = cssVar;
|
|
1759
|
-
exports.generateThemeCSS = generateThemeCSS;
|
|
1760
|
-
exports.getColorPreset = getColorPreset;
|
|
1761
|
-
exports.getFontPreset = getFontPreset;
|
|
1762
|
-
exports.getRadiusPreset = getRadiusPreset;
|
|
1763
|
-
exports.getShadowPreset = getShadowPreset;
|
|
1764
|
-
exports.getStylePreset = getStylePreset;
|
|
1765
|
-
exports.useDSTheme = useDSTheme;
|
|
1766
|
-
exports.useThemeCustomizer = useThemeCustomizer;
|