@esportsplus/ui 0.57.0 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -39
- package/build/components/accordion/group.d.ts +14 -0
- package/build/components/accordion/group.js +21 -0
- package/build/components/accordion/index.d.ts +9 -0
- package/build/components/accordion/index.js +20 -3
- package/build/components/accordion/scss/index.scss +1 -1
- package/build/components/announcement/scss/index.scss +1 -1
- package/build/components/breadcrumb/scss/index.scss +1 -1
- package/build/components/button/scss/index.scss +1 -1
- package/build/components/button/sidebar.d.ts +3 -0
- package/build/components/button/sidebar.js +40 -10
- package/build/components/capslock/index.js +1 -1
- package/build/components/capslock/scss/index.scss +1 -1
- package/build/components/card/scss/index.scss +1 -1
- package/build/components/cc/scss/index.scss +1 -1
- package/build/components/chat-minimap/scss/index.scss +1 -1
- package/build/components/checkbox/scss/index.scss +1 -1
- package/build/components/color-picker/index.d.ts +1 -0
- package/build/components/color-picker/index.js +166 -136
- package/build/components/color-picker/scss/index.scss +1 -1
- package/build/components/command/index.d.ts +0 -1
- package/build/components/command/index.js +3 -2
- package/build/components/command/scss/index.scss +1 -1
- package/build/components/copy/scss/index.scss +1 -1
- package/build/components/counter/scss/index.scss +1 -1
- package/build/components/datalist/index.js +3 -3
- package/build/components/datalist/scss/index.scss +1 -1
- package/build/components/dock/scss/index.scss +1 -1
- package/build/components/editor/code/index.d.ts +0 -1
- package/build/components/editor/code/index.js +0 -1
- package/build/components/editor/code/minimap.d.ts +2 -1
- package/build/components/editor/code/minimap.js +5 -2
- package/build/components/editor/code/view.d.ts +3 -1
- package/build/components/editor/code/view.js +37 -26
- package/build/components/editor/diffs/index.d.ts +0 -1
- package/build/components/editor/diffs/index.js +0 -1
- package/build/components/editor/diffs/merge.js +7 -3
- package/build/components/editor/diffs/view.js +3 -1
- package/build/components/editor/index.d.ts +4 -1
- package/build/components/editor/index.js +2 -1
- package/build/components/editor/markdown/editing.js +22 -3
- package/build/components/editor/markdown/erase.d.ts +9 -0
- package/build/components/editor/markdown/erase.js +78 -0
- package/build/components/editor/markdown/index.d.ts +0 -1
- package/build/components/editor/markdown/index.js +0 -1
- package/build/components/editor/markdown/layout.d.ts +2 -9
- package/build/components/editor/markdown/layout.js +2 -7
- package/build/components/editor/markdown/render.d.ts +0 -1
- package/build/components/editor/markdown/render.js +287 -235
- package/build/components/editor/markdown/view.js +566 -667
- package/build/components/editor/viewer/index.d.ts +27 -0
- package/build/components/editor/viewer/index.js +250 -0
- package/build/components/editor/viewer/model.d.ts +15 -0
- package/build/components/editor/viewer/model.js +73 -0
- package/build/components/editor/workspace/index.d.ts +6 -2
- package/build/components/editor/workspace/index.js +243 -137
- package/build/components/editor/workspace/keybindings.d.ts +37 -0
- package/build/components/editor/workspace/keybindings.js +288 -0
- package/build/components/editor/workspace/model.d.ts +55 -2
- package/build/components/editor/workspace/model.js +141 -3
- package/build/components/editor/workspace/navigate.d.ts +19 -0
- package/build/components/editor/workspace/navigate.js +118 -0
- package/build/components/editor/workspace/session.d.ts +29 -0
- package/build/components/editor/workspace/session.js +373 -0
- package/build/components/editor/workspace/shortcuts.d.ts +19 -0
- package/build/components/editor/workspace/shortcuts.js +185 -0
- package/build/components/editor/workspace/status.d.ts +34 -0
- package/build/components/editor/workspace/status.js +193 -0
- package/build/components/editor/workspace/statusbar.d.ts +15 -0
- package/build/components/editor/workspace/statusbar.js +190 -0
- package/build/components/editor/workspace/strip.d.ts +27 -0
- package/build/components/editor/workspace/strip.js +239 -0
- package/build/components/editor/workspace/tabs.d.ts +15 -0
- package/build/components/editor/workspace/tabs.js +63 -0
- package/build/components/error/index.js +1 -1
- package/build/components/error/scss/index.scss +1 -1
- package/build/components/filter/index.js +5 -3
- package/build/components/filter/scss/index.scss +1 -1
- package/build/components/frame/scss/index.scss +1 -1
- package/build/components/heatmap/index.js +3 -3
- package/build/components/heatmap/scss/index.scss +1 -1
- package/build/components/highlight/scss/index.scss +1 -1
- package/build/components/icon/scss/index.scss +1 -1
- package/build/components/image/scss/index.scss +1 -1
- package/build/components/index.d.ts +2 -0
- package/build/components/index.js +2 -0
- package/build/components/inline-edit/scss/index.scss +1 -1
- package/build/components/input/scss/index.scss +1 -1
- package/build/components/link/scss/index.scss +1 -1
- package/build/components/loading/scss/index.scss +1 -1
- package/build/components/marquee/scss/index.scss +1 -1
- package/build/components/metric/scss/index.scss +1 -1
- package/build/components/nav/index.d.ts +1 -1
- package/build/components/nav/scss/index.scss +1 -1
- package/build/components/nav/tree.d.ts +3 -1
- package/build/components/nav/tree.js +30 -60
- package/build/components/notification/scss/index.scss +1 -1
- package/build/components/overlay/scss/index.scss +1 -1
- package/build/components/page/scss/index.scss +1 -1
- package/build/components/pagination/arrows.d.ts +15 -0
- package/build/components/pagination/arrows.js +65 -0
- package/build/components/pagination/cards.d.ts +23 -0
- package/build/components/pagination/cards.js +66 -0
- package/build/components/pagination/index.d.ts +5 -0
- package/build/components/pagination/index.js +3 -1
- package/build/components/pagination/scss/index.scss +1 -1
- package/build/components/progress/scss/index.scss +1 -1
- package/build/components/pull-to-refresh/scss/index.scss +1 -1
- package/build/components/range/index.js +1 -1
- package/build/components/range/scss/index.scss +1 -1
- package/build/components/relative-time/scss/index.scss +1 -1
- package/build/components/root/scss/index.scss +1 -1
- package/build/components/section/scss/index.scss +2 -0
- package/build/components/select/index.d.ts +1 -0
- package/build/components/select/index.js +16 -11
- package/build/components/select/scss/index.scss +1 -1
- package/build/components/shortcut-recorder/scss/index.scss +1 -1
- package/build/components/sortable/scss/index.scss +1 -1
- package/build/components/sticky-header/index.js +3 -3
- package/build/components/sticky-header/scss/index.scss +1 -1
- package/build/components/story/scss/index.scss +1 -1
- package/build/components/surface-field/scss/index.scss +1 -1
- package/build/components/tasklist/scss/index.scss +1 -1
- package/build/components/text/scss/index.scss +1 -1
- package/build/components/textarea/scss/index.scss +1 -1
- package/build/{css-utilities → components}/theme/index.d.ts +1 -1
- package/build/{css-utilities → components}/theme/index.js +15 -5
- package/build/components/theme/scss/index.scss +2 -0
- package/build/components/theme-picker/index.d.ts +52 -0
- package/build/components/theme-picker/index.js +167 -0
- package/build/components/theme-picker/scss/index.scss +2 -0
- package/build/components/toast/index.js +3 -5
- package/build/components/toast/scss/index.scss +1 -1
- package/build/components/tooltip/menu.js +3 -1
- package/build/components/tooltip/scss/index.scss +1 -1
- package/build/components/typewriter/scss/index.scss +1 -1
- package/build/components/uptime/scss/index.scss +1 -1
- package/build/components/usage-meter/scss/index.scss +1 -1
- package/build/{css-utilities → modifiers}/glass/index.d.ts +2 -2
- package/build/modifiers/glass/index.js +28 -0
- package/build/modifiers/glass/scss/index.scss +2 -0
- package/build/{css-utilities → modifiers}/index.d.ts +0 -1
- package/build/{css-utilities → modifiers}/index.js +0 -1
- package/build/modifiers/scrollbar/index.d.ts +72 -0
- package/build/{css-utilities → modifiers}/scrollbar/index.js +52 -19
- package/build/modifiers/scrollbar/scss/index.scss +2 -0
- package/build/normalize/scss/index.scss +1 -2
- package/layer.scss +1 -1
- package/package.json +11 -18
- package/scripts/code-editor-markdown.test.mjs +45 -14
- package/scripts/code-viewer.test.mjs +69 -0
- package/scripts/workspace-keybindings.test.mjs +273 -0
- package/scripts/workspace-session.test.mjs +349 -0
- package/scripts/workspace-status.test.mjs +229 -0
- package/scripts/workspace-tabs.test.mjs +142 -0
- package/src/components/accordion/group.ts +39 -0
- package/src/components/accordion/index.ts +32 -6
- package/src/components/accordion/scss/index.scss +12 -21
- package/src/components/accordion/scss/variables.scss +18 -3
- package/src/components/announcement/scss/index.scss +4 -4
- package/src/components/announcement/scss/variables.scss +6 -6
- package/src/components/banner/scss/index.scss +1 -1
- package/src/components/breadcrumb/scss/index.scss +35 -50
- package/src/components/breadcrumb/scss/variables.scss +23 -31
- package/src/components/button/scss/_fan.scss +39 -43
- package/src/components/button/scss/_morph.scss +66 -78
- package/src/components/button/scss/_sidebar.scss +41 -30
- package/src/components/button/scss/_split.scss +9 -9
- package/src/components/button/scss/index.scss +23 -19
- package/src/components/button/scss/variables.scss +94 -90
- package/src/components/button/sidebar.ts +36 -24
- package/src/components/capslock/index.ts +2 -2
- package/src/components/capslock/scss/index.scss +11 -6
- package/src/components/capslock/scss/variables.scss +3 -5
- package/src/components/card/scss/_expand.scss +58 -64
- package/src/components/card/scss/index.scss +40 -21
- package/src/components/card/scss/variables.scss +40 -31
- package/src/components/cc/scss/index.scss +68 -68
- package/src/components/cc/scss/variables.scss +13 -14
- package/src/components/chat-minimap/scss/index.scss +24 -16
- package/src/components/chat-minimap/scss/variables.scss +37 -37
- package/src/components/checkbox/scss/index.scss +54 -52
- package/src/components/checkbox/scss/variables.scss +37 -39
- package/src/components/color-picker/index.ts +157 -120
- package/src/components/color-picker/scss/index.scss +159 -96
- package/src/components/color-picker/scss/variables.scss +33 -15
- package/src/components/command/index.ts +3 -2
- package/src/components/command/scss/index.scss +10 -14
- package/src/components/command/scss/variables.scss +12 -35
- package/src/components/copy/scss/index.scss +6 -6
- package/src/components/copy/scss/variables.scss +12 -15
- package/src/components/counter/scss/index.scss +14 -14
- package/src/components/counter/scss/variables.scss +1 -1
- package/src/components/datalist/index.ts +3 -3
- package/src/components/datalist/scss/index.scss +7 -6
- package/src/components/datalist/scss/variables.scss +7 -3
- package/src/components/dock/scss/index.scss +10 -15
- package/src/components/dock/scss/variables.scss +29 -25
- package/src/components/editor/code/index.ts +0 -1
- package/src/components/editor/code/minimap.ts +13 -5
- package/src/components/editor/code/scss/_editor.scss +83 -81
- package/src/components/editor/code/scss/_features.scss +106 -97
- package/src/components/editor/code/scss/_services.scss +27 -25
- package/src/components/editor/code/scss/index.scss +0 -1
- package/src/components/editor/code/scss/variables.scss +30 -26
- package/src/components/editor/code/view.ts +14 -5
- package/src/components/editor/diffs/index.ts +0 -1
- package/src/components/editor/diffs/merge.ts +2 -1
- package/src/components/editor/diffs/scss/_diffs.scss +67 -57
- package/src/components/editor/diffs/scss/_merge.scss +17 -14
- package/src/components/editor/diffs/scss/index.scss +0 -1
- package/src/components/editor/diffs/scss/variables.scss +25 -18
- package/src/components/editor/diffs/view.ts +2 -1
- package/src/components/editor/index.ts +7 -1
- package/src/components/editor/markdown/editing.ts +38 -3
- package/src/components/editor/markdown/erase.ts +124 -0
- package/src/components/editor/markdown/index.ts +0 -1
- package/src/components/editor/markdown/layout.ts +3 -12
- package/src/components/editor/markdown/render.ts +65 -37
- package/src/components/editor/markdown/scss/index.scss +92 -124
- package/src/components/editor/markdown/scss/variables.scss +39 -19
- package/src/components/editor/markdown/view.ts +737 -786
- package/src/components/editor/tree/scss/index.scss +121 -110
- package/src/components/editor/tree/scss/variables.scss +48 -54
- package/src/components/editor/viewer/index.ts +321 -0
- package/src/components/editor/viewer/model.ts +130 -0
- package/src/components/editor/viewer/scss/_viewer.scss +302 -0
- package/src/components/editor/viewer/scss/index.scss +2 -0
- package/src/components/editor/viewer/scss/variables.scss +69 -0
- package/src/components/editor/workspace/index.ts +159 -31
- package/src/components/editor/workspace/keybindings.ts +447 -0
- package/src/components/editor/workspace/model.ts +233 -3
- package/src/components/editor/workspace/navigate.ts +194 -0
- package/src/components/editor/workspace/scss/index.scss +72 -59
- package/src/components/editor/workspace/scss/keybindings.scss +190 -0
- package/src/components/editor/workspace/scss/status.scss +122 -0
- package/src/components/editor/workspace/scss/tabs.scss +56 -0
- package/src/components/editor/workspace/session.ts +551 -0
- package/src/components/editor/workspace/shortcuts.ts +255 -0
- package/src/components/editor/workspace/status.ts +259 -0
- package/src/components/editor/workspace/statusbar.ts +255 -0
- package/src/components/editor/workspace/strip.ts +273 -0
- package/src/components/editor/workspace/tabs.ts +106 -0
- package/src/components/error/index.ts +1 -1
- package/src/components/error/scss/index.scss +19 -19
- package/src/components/error/scss/variables.scss +2 -2
- package/src/components/filter/index.ts +7 -2
- package/src/components/filter/scss/index.scss +1 -1
- package/src/components/filter/scss/variables.scss +11 -10
- package/src/components/frame/scss/index.scss +12 -12
- package/src/components/frame/scss/variables.scss +8 -8
- package/src/components/heatmap/index.ts +3 -3
- package/src/components/heatmap/scss/index.scss +28 -26
- package/src/components/heatmap/scss/variables.scss +18 -17
- package/src/components/highlight/scss/index.scss +17 -13
- package/src/components/highlight/scss/variables.scss +8 -10
- package/src/components/icon/scss/index.scss +10 -0
- package/src/components/icon/scss/variables.scss +5 -0
- package/src/components/image/scss/index.scss +9 -9
- package/src/components/image/scss/variables.scss +7 -2
- package/src/components/index.ts +2 -0
- package/src/components/inline-edit/scss/index.scss +99 -104
- package/src/components/inline-edit/scss/variables.scss +40 -39
- package/src/components/input/scss/_field.scss +6 -20
- package/src/components/input/scss/_scrub.scss +10 -8
- package/src/components/input/scss/_tag.scss +35 -37
- package/src/components/input/scss/variables.scss +100 -99
- package/src/components/link/scss/index.scss +4 -1
- package/src/components/loading/scss/index.scss +1 -1
- package/src/components/loading/scss/variables.scss +1 -1
- package/src/components/marquee/scss/index.scss +9 -5
- package/src/components/marquee/scss/variables.scss +3 -1
- package/src/components/metric/scss/_flash.scss +3 -1
- package/src/components/metric/scss/index.scss +8 -6
- package/src/components/metric/scss/variables.scss +26 -20
- package/src/components/nav/index.ts +1 -1
- package/src/components/nav/scss/index.scss +12 -40
- package/src/components/nav/scss/variables.scss +30 -11
- package/src/components/nav/tree.ts +19 -62
- package/src/components/notification/scss/index.scss +7 -7
- package/src/components/notification/scss/variables.scss +7 -9
- package/src/components/overlay/scss/index.scss +181 -170
- package/src/components/overlay/scss/variables.scss +26 -57
- package/src/components/page/scss/index.scss +12 -11
- package/src/components/page/scss/variables.scss +5 -0
- package/src/components/pagination/arrows.ts +58 -0
- package/src/components/pagination/cards.ts +57 -0
- package/src/components/pagination/index.ts +4 -1
- package/src/components/pagination/scss/_arrows.scss +69 -0
- package/src/components/pagination/scss/_cards.scss +121 -0
- package/src/components/pagination/scss/_dots.scss +2 -5
- package/src/components/pagination/scss/index.scss +8 -6
- package/src/components/pagination/scss/variables.scss +87 -37
- package/src/components/progress/scss/_text.scss +21 -18
- package/src/components/progress/scss/index.scss +1 -1
- package/src/components/progress/scss/variables.scss +12 -12
- package/src/components/pull-to-refresh/scss/index.scss +2 -1
- package/src/components/pull-to-refresh/scss/variables.scss +11 -6
- package/src/components/range/index.ts +1 -1
- package/src/components/range/scss/_filter.scss +62 -51
- package/src/components/range/scss/_slider.scss +78 -75
- package/src/components/range/scss/_vertical.scss +6 -6
- package/src/components/range/scss/index.scss +3 -2
- package/src/components/range/scss/variables.scss +26 -23
- package/src/components/relative-time/scss/index.scss +27 -27
- package/src/components/relative-time/scss/variables.scss +10 -12
- package/src/components/root/scss/index.scss +71 -43
- package/src/components/root/scss/variables.scss +35 -31
- package/src/components/section/scss/index.scss +31 -0
- package/src/components/section/scss/variables.scss +21 -0
- package/src/components/select/index.ts +11 -6
- package/src/components/select/scss/index.scss +21 -32
- package/src/components/select/scss/variables.scss +25 -18
- package/src/components/shortcut-recorder/scss/index.scss +13 -12
- package/src/components/shortcut-recorder/scss/variables.scss +12 -13
- package/src/components/sortable/scss/index.scss +47 -44
- package/src/components/sortable/scss/variables.scss +4 -5
- package/src/components/sticky-header/index.ts +4 -4
- package/src/components/sticky-header/scss/index.scss +14 -13
- package/src/components/sticky-header/scss/variables.scss +9 -9
- package/src/components/story/scss/index.scss +26 -30
- package/src/components/story/scss/variables.scss +16 -9
- package/src/components/surface-field/scss/index.scss +45 -40
- package/src/components/surface-field/scss/variables.scss +5 -6
- package/src/components/tasklist/scss/index.scss +19 -19
- package/src/components/tasklist/scss/variables.scss +26 -29
- package/src/components/text/scss/index.scss +2 -1
- package/src/components/textarea/scss/variables.scss +1 -1
- package/src/{css-utilities → components}/theme/index.ts +17 -3
- package/src/components/theme/scss/index.scss +1 -0
- package/src/components/theme/scss/variables.scss +78 -0
- package/src/components/theme-picker/index.ts +231 -0
- package/src/components/theme-picker/scss/index.scss +264 -0
- package/src/components/toast/index.ts +28 -30
- package/src/components/toast/scss/index.scss +87 -87
- package/src/components/toast/scss/variables.scss +39 -39
- package/src/components/tooltip/menu.ts +4 -1
- package/src/components/tooltip/scss/_east.scss +10 -10
- package/src/components/tooltip/scss/_menu.scss +284 -269
- package/src/components/tooltip/scss/_north.scss +10 -10
- package/src/components/tooltip/scss/_shared.scss +7 -7
- package/src/components/tooltip/scss/_south.scss +10 -10
- package/src/components/tooltip/scss/_west.scss +10 -10
- package/src/components/tooltip/scss/index.scss +21 -20
- package/src/components/tooltip/scss/variables.scss +104 -96
- package/src/components/typewriter/scss/_retype.scss +12 -11
- package/src/components/typewriter/scss/_rotate.scss +2 -1
- package/src/components/typewriter/scss/variables.scss +41 -39
- package/src/components/uptime/scss/index.scss +15 -15
- package/src/components/uptime/scss/variables.scss +8 -8
- package/src/components/usage-meter/scss/index.scss +3 -1
- package/src/components/usage-meter/scss/variables.scss +5 -5
- package/src/css-utilities/absolute.scss +64 -0
- package/src/css-utilities/background.scss +43 -0
- package/src/css-utilities/border.scss +45 -0
- package/src/css-utilities/box-shadow.scss +29 -0
- package/src/css-utilities/color.scss +41 -0
- package/src/css-utilities/flex.scss +64 -0
- package/src/css-utilities/font/geist/{scss/index.scss → index.scss} +12 -4
- package/src/css-utilities/font/montserrat/Montserrat-Italic-Variable.woff2 +0 -0
- package/src/css-utilities/font/montserrat/Montserrat-Variable.woff2 +0 -0
- package/src/css-utilities/font/montserrat/OFL.txt +93 -0
- package/src/css-utilities/font/montserrat/index.scss +38 -0
- package/src/{shared/scss → css-utilities}/icon.scss +1 -1
- package/src/css-utilities/{inline/scss/index.scss → inline.scss} +1 -1
- package/src/css-utilities/{skeleton/scss/index.scss → skeleton.scss} +11 -11
- package/src/css-utilities/surface.scss +266 -0
- package/src/css-utilities/text.scss +191 -0
- package/src/modifiers/glass/index.ts +44 -0
- package/src/{css-utilities → modifiers}/glass/scss/index.scss +6 -6
- package/src/{css-utilities → modifiers}/glass/scss/variables.scss +1 -1
- package/src/{css-utilities → modifiers}/index.ts +0 -1
- package/src/{css-utilities → modifiers}/scrollbar/index.ts +92 -17
- package/src/{css-utilities → modifiers}/scrollbar/scss/index.scss +178 -177
- package/src/{css-utilities → modifiers}/scrollbar/scss/variables.scss +28 -21
- package/src/normalize/scss/index.scss +4 -2
- package/src/shared/scss/color-weights.scss +19 -0
- package/src/shared/scss/index.scss +1 -12
- package/src/tokens/scss/blur.scss +5 -0
- package/src/tokens/scss/color.scss +74 -50
- package/src/tokens/scss/index.scss +1 -2
- package/src/tokens/scss/size.scss +0 -2
- package/src/tokens/scss/state.scss +3 -2
- package/src/tokens/scss/transition.scss +19 -2
- package/storage/svg/monitor.svg +1 -0
- package/storage/svg/moon.svg +1 -0
- package/storage/svg/pin.svg +1 -0
- package/storage/svg/sun.svg +1 -0
- package/vite.config.ts +33 -8
- package/build/css-utilities/background/scss/index.scss +0 -2
- package/build/css-utilities/border/scss/index.scss +0 -2
- package/build/css-utilities/color/scss/index.scss +0 -2
- package/build/css-utilities/flex/scss/index.scss +0 -2
- package/build/css-utilities/font/geist/index.d.ts +0 -1
- package/build/css-utilities/font/geist/index.js +0 -1
- package/build/css-utilities/font/geist/scss/index.scss +0 -2
- package/build/css-utilities/font/montserrat/index.d.ts +0 -1
- package/build/css-utilities/font/montserrat/index.js +0 -1
- package/build/css-utilities/font/montserrat/scss/Montserrat-Bold.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-Bold.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-BoldItalic.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-BoldItalic.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-Italic.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-Italic.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-Medium.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-Medium.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-MediumItalic.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-MediumItalic.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-Regular.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-Regular.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-SemiBold.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-SemiBold.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-SemiBoldItalic.woff +0 -0
- package/build/css-utilities/font/montserrat/scss/Montserrat-SemiBoldItalic.woff2 +0 -0
- package/build/css-utilities/font/montserrat/scss/index.scss +0 -2
- package/build/css-utilities/glass/index.js +0 -26
- package/build/css-utilities/glass/scss/index.scss +0 -2
- package/build/css-utilities/index.scss +0 -2
- package/build/css-utilities/inline/scss/index.scss +0 -2
- package/build/css-utilities/scrollbar/index.d.ts +0 -42
- package/build/css-utilities/scrollbar/scss/index.scss +0 -2
- package/build/css-utilities/skeleton/scss/index.scss +0 -2
- package/build/css-utilities/text/scss/index.scss +0 -2
- package/build/themes/dark/index.d.ts +0 -3
- package/build/themes/dark/index.js +0 -3
- package/build/themes/dark/input.d.ts +0 -3
- package/build/themes/dark/input.js +0 -12
- package/build/themes/dark/select.d.ts +0 -3
- package/build/themes/dark/select.js +0 -23
- package/build/themes/dark/textarea.d.ts +0 -2186
- package/build/themes/dark/textarea.js +0 -11
- package/src/css-utilities/background/scss/index.scss +0 -1
- package/src/css-utilities/background/scss/variables.scss +0 -18
- package/src/css-utilities/border/scss/index.scss +0 -1
- package/src/css-utilities/border/scss/variables.scss +0 -23
- package/src/css-utilities/color/scss/index.scss +0 -1
- package/src/css-utilities/color/scss/variables.scss +0 -17
- package/src/css-utilities/flex/scss/index.scss +0 -57
- package/src/css-utilities/flex/scss/variables.scss +0 -16
- package/src/css-utilities/font/geist/index.ts +0 -1
- package/src/css-utilities/font/montserrat/index.ts +0 -1
- package/src/css-utilities/font/montserrat/scss/Montserrat-Bold.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-Bold.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-BoldItalic.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-BoldItalic.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-Italic.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-Italic.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-Medium.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-Medium.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-MediumItalic.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-MediumItalic.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-Regular.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-Regular.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-SemiBold.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-SemiBold.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-SemiBoldItalic.woff +0 -0
- package/src/css-utilities/font/montserrat/scss/Montserrat-SemiBoldItalic.woff2 +0 -0
- package/src/css-utilities/font/montserrat/scss/index.scss +0 -94
- package/src/css-utilities/glass/index.ts +0 -42
- package/src/css-utilities/index.scss +0 -13
- package/src/css-utilities/skeleton/scss/variables.scss +0 -3
- package/src/css-utilities/text/scss/index.scss +0 -152
- package/src/css-utilities/text/scss/variables.scss +0 -22
- package/src/shared/scss/absolute.scss +0 -28
- package/src/shared/scss/background.scss +0 -21
- package/src/shared/scss/border.scss +0 -21
- package/src/shared/scss/color.scss +0 -21
- package/src/shared/scss/position.scss +0 -55
- package/src/shared/scss/text.scss +0 -31
- package/src/themes/dark/index.ts +0 -3
- package/src/themes/dark/input.ts +0 -16
- package/src/themes/dark/select.ts +0 -28
- package/src/themes/dark/textarea.ts +0 -13
- package/src/tokens/scss/box-shadow.scss +0 -23
- package/src/tokens/scss/font-family.scss +0 -5
- package/storage/code.md +0 -180
- package/storage/editor-features.md +0 -227
- package/build/css-utilities/font/geist/{scss/Geist-Italic-Variable.woff2 → Geist-Italic-Variable.woff2} +0 -0
- package/build/css-utilities/font/geist/{scss/Geist-Variable.woff2 → Geist-Variable.woff2} +0 -0
- package/build/css-utilities/font/geist/{scss/GeistMono-Italic-Variable.woff2 → GeistMono-Italic-Variable.woff2} +0 -0
- package/build/css-utilities/font/geist/{scss/GeistMono-Variable.woff2 → GeistMono-Variable.woff2} +0 -0
- package/src/{shared/scss → css-utilities}/anchor.scss +6 -6
- package/src/{shared/scss → css-utilities}/drag.scss +0 -0
- package/src/css-utilities/font/geist/{scss/Geist-Italic-Variable.woff2 → Geist-Italic-Variable.woff2} +0 -0
- package/src/css-utilities/font/geist/{scss/Geist-Variable.woff2 → Geist-Variable.woff2} +0 -0
- package/src/css-utilities/font/geist/{scss/GeistMono-Italic-Variable.woff2 → GeistMono-Italic-Variable.woff2} +0 -0
- package/src/css-utilities/font/geist/{scss/GeistMono-Variable.woff2 → GeistMono-Variable.woff2} +0 -0
- package/src/{shared/scss → css-utilities}/hidden.scss +11 -11
- /package/src/{shared/scss → css-utilities}/layer.scss +0 -0
- /package/src/{shared/scss → css-utilities}/reset.scss +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer components{.surface-field-canvas,.surface-field-surface-lift{position:absolute;inset:0}.surface-field-surface-lift{border-radius:inherit;pointer-events:none}.surface-field-surface-title{text-overflow:ellipsis;white-space:nowrap;max-width:100%;overflow:hidden}.surface-field{--accent:#6683e8;--color:var(--color-text-500);--still:0;--surface-background:var(--color-white-300);--surface-body-color:var(--color-text-300);--surface-body-font-size:calc(var(--font-size-400) * .8125);--surface-border-color:oklch(from var(--color-black-300) l c h / .06);--surface-border-radius:14px;--surface-box-shadow:0 1px 2px oklch(from var(--color-black-300) l c h / .06), 0 8px 24px -8px oklch(from var(--color-black-300) l c h / .14);--surface-box-shadow-active:0 2px 4px oklch(from var(--color-black-300) l c h / .08), 0 20px 40px -12px oklch(from var(--color-black-300) l c h / .24);--surface-grip-color:var(--color-text-300);--surface-grip-width:32px;--surface-handle-height:28px;--surface-header-cursor:grab;--surface-lift-duration:.2s;--surface-lift-opacity:0;--surface-title-color:var(--color-text-500)}@media (prefers-reduced-motion:reduce){.surface-field{--still:1}}.surface-field-surface.--active{--surface-header-cursor:grabbing;--surface-lift-opacity:1}@property --still{syntax:"<number>";inherits:true;initial-value:0}.surface-field{isolation:isolate;position:relative}.surface-field-canvas{accent-color:var(--accent);color:var(--color);pointer-events:none;z-index:0;width:100%;height:100%;transition:--still 1ms}.surface-field-content{z-index:1;height:100%;position:relative}.surface-field-surface{background:var(--surface-background);border-radius:var(--surface-border-radius);box-shadow:0 0 0 1px var(--surface-border-color), var(--surface-box-shadow);transition:scale var(--surface-lift-duration) ease;flex-direction:column;display:flex;position:absolute;top:0;left:0}.surface-field-surface.--active{scale:1.01}.surface-field-surface-body{color:var(--surface-body-color);font-size:var(--surface-body-font-size);overflow-wrap:break-word;margin:0;line-height:1.5}.surface-field-surface-content{flex-direction:column;flex:1;gap:8px;min-height:0;padding:0 16px 16px;display:flex;overflow:hidden}.surface-field-surface-handle,.surface-field-surface-resize{color:var(--surface-grip-color);touch-action:none;background:0 0;border:0;padding:0}.surface-field-surface-handle:focus-visible,.surface-field-surface-resize:focus-visible{outline:2px solid oklch(from var(--color) l c h/.4);outline-offset:-2px}.surface-field-surface-header{cursor:var(--surface-header-cursor);min-height:var(--surface-handle-height);touch-action:none;flex-shrink:0;align-items:center;gap:4px;padding-inline-start:16px;display:flex}.surface-field-surface-lift{box-shadow:var(--surface-box-shadow-active);opacity:var(--surface-lift-opacity);transition:opacity var(--surface-lift-duration) ease}.surface-field-surface-handle{border-radius:0 var(--surface-border-radius) 0 0;cursor:inherit;width:var(--surface-grip-width);flex-shrink:0;align-self:stretch;position:relative}.surface-field-surface-handle:before{content:"";opacity:.7;background:currentColor;border-radius:999px;width:18px;height:2px;position:absolute;top:50%;left:50%;translate:-50% -50%}.surface-field-surface-handle:only-child{border-radius:var(--surface-border-radius) var(--surface-border-radius) 0 0;flex:1;margin-inline-start:-16px}.surface-field-surface-resize{border-radius:0 0 var(--surface-border-radius) 0;cursor:nwse-resize;opacity:.7;background:linear-gradient(135deg,#0000 45%,currentColor 45% 52%,#0000 52%) 4px 4px/12px 12px no-repeat,linear-gradient(135deg,#0000 70%,currentColor 70% 77%,#0000 77%) 4px 4px/12px 12px no-repeat;width:22px;height:22px;position:absolute;bottom:0;right:0}.surface-field-surface-title{color:var(--surface-title-color);flex:0 auto;min-width:0;font-weight:600}.surface-field-surface-title+.surface-field-surface-handle{margin-inline-start:auto}@media (prefers-reduced-motion:reduce){.surface-field-surface{transition:none}.surface-field-surface.--active{scale:1}}}
|
|
1
|
+
@layer components{.surface-field-canvas,.surface-field-surface-lift{position:absolute;inset:0}.surface-field-surface-lift{border-radius:inherit;pointer-events:none}.surface-field-surface{--surface-shadow-weight:6;--surface-background-active:light-dark(oklch(from var(--surface-background-default) calc(l + .01) c h),oklch(from var(--surface-background-default) calc(l + .02) c h));--surface-background-default:light-dark(oklch(from var(--color-surface) clamp(0, l + max(var(--surface-level), 0) * .01 + min(var(--surface-level), 0) * .01, 1) calc(c * (1 - clamp(0, l + max(var(--surface-level), 0) * .01 + min(var(--surface-level), 0) * .01, 1)) / max(1 - l, .01)) h),oklch(from var(--color-surface) clamp(0, l + max(var(--surface-level), 0) * .02 + min(var(--surface-level), 0) * .02, l + .12) calc(c * clamp(0, l + max(var(--surface-level), 0) * .02 + min(var(--surface-level), 0) * .02, l + .12) / max(l, .01)) h));--surface-background-hover:light-dark(oklch(from var(--surface-background-default) calc(l + .005) c h),oklch(from var(--surface-background-default) calc(l + .01) c h));--surface-background-pressed:light-dark(oklch(from var(--surface-background-default) calc(l - .02) c h),oklch(from var(--surface-background-default) calc(l - .04) c h));--surface-border-active:light-dark(oklch(from var(--surface-background-active) max(0, l - .04) c h),oklch(from var(--surface-background-active) min(1, l + .06) c h));--surface-border-default:light-dark(oklch(from var(--surface-background-default) max(0, l - .04) c h),oklch(from var(--surface-background-default) min(1, l + .06) c h));--surface-border-hover:light-dark(oklch(from var(--surface-background-hover) max(0, l - .04) c h),oklch(from var(--surface-background-hover) min(1, l + .06) c h));--surface-border-pressed:light-dark(oklch(from var(--surface-background-pressed) max(0, l - .04) c h),oklch(from var(--surface-background-pressed) min(1, l + .06) c h));--surface-shadow-active:var(--surface-shadow-hover);--surface-shadow-color:light-dark(oklch(from var(--surface-background-default) calc(l * .24) calc(c * .24) h / .08),oklch(from var(--surface-background-default) calc(l * .24) calc(c * .24) h / .16));--surface-shadow-cast:light-dark(oklch(from light-dark(oklch(from var(--color-surface) clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .01 + min(calc(var(--surface-level) - 1), 0) * .01, 1) calc(c * (1 - clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .01 + min(calc(var(--surface-level) - 1), 0) * .01, 1)) / max(1 - l, .01)) h),oklch(from var(--color-surface) clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .02 + min(calc(var(--surface-level) - 1), 0) * .02, l + .12) calc(c * clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .02 + min(calc(var(--surface-level) - 1), 0) * .02, l + .12) / max(l, .01)) h)) calc(l * .24) calc(c * .24) h / .08),oklch(from light-dark(oklch(from var(--color-surface) clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .01 + min(calc(var(--surface-level) - 1), 0) * .01, 1) calc(c * (1 - clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .01 + min(calc(var(--surface-level) - 1), 0) * .01, 1)) / max(1 - l, .01)) h),oklch(from var(--color-surface) clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .02 + min(calc(var(--surface-level) - 1), 0) * .02, l + .12) calc(c * clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .02 + min(calc(var(--surface-level) - 1), 0) * .02, l + .12) / max(l, .01)) h)) calc(l * .24) calc(c * .24) h / .16));--surface-shadow-default:0 calc((0 + 1 * clamp(0, var(--surface-shadow-weight) - 0, 1) + 3 * clamp(0, var(--surface-shadow-weight) - 3, 1) + 6 * clamp(0, var(--surface-shadow-weight) - 4, 1) + 10 * clamp(0, var(--surface-shadow-weight) - 5, 1) + 5 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, var(--surface-shadow-weight) - 1, 1) + 1 * clamp(0, var(--surface-shadow-weight) - 2, 1) + 3 * clamp(0, var(--surface-shadow-weight) - 3, 1) + 9 * clamp(0, var(--surface-shadow-weight) - 4, 1) + 10 * clamp(0, var(--surface-shadow-weight) - 5, 1) + 25 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, var(--surface-shadow-weight) - 3, 1) + -2 * clamp(0, var(--surface-shadow-weight) - 4, 1) + -2 * clamp(0, var(--surface-shadow-weight) - 5, 1) + -7 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .05 * clamp(0, var(--surface-shadow-weight) - 0, 1) + .05 * clamp(0, var(--surface-shadow-weight) - 2, 1) + .15 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 10)), 0 calc((0 + 1 * clamp(0, var(--surface-shadow-weight) - 2, 1) + 1 * clamp(0, var(--surface-shadow-weight) - 3, 1) + 2 * clamp(0, var(--surface-shadow-weight) - 4, 1) + 4 * clamp(0, var(--surface-shadow-weight) - 5, 1) + -8 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, var(--surface-shadow-weight) - 2, 1) + 2 * clamp(0, var(--surface-shadow-weight) - 3, 1) + 2 * clamp(0, var(--surface-shadow-weight) - 4, 1) + 4 * clamp(0, var(--surface-shadow-weight) - 5, 1) + -10 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, var(--surface-shadow-weight) - 2, 1) + -1 * clamp(0, var(--surface-shadow-weight) - 3, 1) + -2 * clamp(0, var(--surface-shadow-weight) - 4, 1) + -2 * clamp(0, var(--surface-shadow-weight) - 5, 1) + 6 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .1 * clamp(0, var(--surface-shadow-weight) - 2, 1) + -.1 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 10));--surface-shadow-hover:0 calc((0 + 1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 0, 1) + 3 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + 6 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + 10 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + 5 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 1, 1) + 1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + 3 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + 9 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + 10 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + 25 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + -2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + -2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + -7 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .05 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 0, 1) + .05 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + .15 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 10)), 0 calc((0 + 1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + 1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + 2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + 4 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + -8 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + 2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + 2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + 4 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + -10 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + -1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + -2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + -2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + 6 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + -.1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 10));--surface-shadow-pressed:0 calc((0 + 1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 0, 1) + 3 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + 6 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + 10 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + 5 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 1, 1) + 1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + 3 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + 9 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + 10 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + 25 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + -2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + -2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + -7 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .05 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 0, 1) + .05 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + .15 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 10)), 0 calc((0 + 1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + 1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + 2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + 4 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + -8 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + 2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + 2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + 4 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + -10 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + -1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + -2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + -2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + 6 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + -.1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 10))}@container style(--surface-level:-3){.surface-field-surface{--surface-level:-2;--surface-shadow-weight:0}}@container style(--surface-level:-2){.surface-field-surface{--surface-level:-1;--surface-shadow-weight:0}}@container style(--surface-level:-1){.surface-field-surface{--surface-level:0;--surface-shadow-weight:0}}@container style(--surface-level:0){.surface-field-surface{--surface-level:1;--surface-shadow-weight:1}}@container style(--surface-level:1){.surface-field-surface{--surface-level:2;--surface-shadow-weight:2}}@container style(--surface-level:2){.surface-field-surface{--surface-level:3;--surface-shadow-weight:3}}@container style(--surface-level:3){.surface-field-surface{--surface-level:4;--surface-shadow-weight:4}}@container style(--surface-level:4){.surface-field-surface{--surface-level:5;--surface-shadow-weight:5}}@container style(--surface-level:5){.surface-field-surface{--surface-level:6;--surface-shadow-weight:6}}.surface-field-surface-title{text-overflow:ellipsis;white-space:nowrap;max-width:100%;overflow:hidden}@keyframes text-gradient{to{background-position:var(--background-size) 0}}@keyframes text-line-shadow{0%{background-position:0 0}to{background-position:100% -100%}}@keyframes text-shiny{0%,90%,to{background-position:calc(-100% - var(--shine-width)) 0}30%,60%{background-position:calc(100% + var(--shine-width)) 0}}.surface-field{--accent:#6683e8;--color:var(--color-text-500);--still:0;--surface-body-color:var(--color-text-300);--surface-body-font-size:calc(var(--font-size-400) * .8125);--surface-border-color:var(--surface-border-default);--surface-border-radius:14px;--surface-box-shadow:0 1px 2px oklch(from var(--surface-shadow-color) l c h / calc(alpha * .6)), 0 8px 24px -8px oklch(from var(--surface-shadow-color) l c h / calc(alpha * 1.55));--surface-box-shadow-active:0 2px 4px oklch(from var(--surface-shadow-color) l c h / calc(alpha * .8)), 0 20px 40px -12px oklch(from var(--surface-shadow-color) l c h / calc(alpha * 2.7));--surface-grip-color:var(--color-primary-300);--surface-grip-width:32px;--surface-handle-height:28px;--surface-header-cursor:grab;--surface-lift-duration:var(--duration-moderate);--surface-lift-opacity:0;--surface-title-color:var(--color-text-500)}@media (prefers-reduced-motion:reduce){.surface-field{--still:1}}.surface-field-surface.--active{--surface-header-cursor:grabbing;--surface-lift-opacity:1}@property --still{syntax:"<number>";inherits:true;initial-value:0}.surface-field{isolation:isolate;position:relative}.surface-field-canvas{accent-color:var(--accent);color:var(--color);pointer-events:none;z-index:0;width:100%;height:100%;transition:--still 1ms}.surface-field-content{z-index:1;height:100%;position:relative}.surface-field-surface{background:var(--surface-background-default);border-radius:var(--surface-border-radius);box-shadow:0 0 0 1px var(--surface-border-color), var(--surface-box-shadow);transition:scale var(--surface-lift-duration) ease;flex-direction:column;display:flex;position:absolute;top:0;left:0}.surface-field-surface.--active{scale:1.01}.surface-field-surface-body{color:var(--surface-body-color);font-size:var(--surface-body-font-size);overflow-wrap:break-word;margin:0;line-height:1.5}.surface-field-surface-content{gap:var(--size-100);min-height:0;padding:0 var(--size-400) var(--size-400);flex-direction:column;flex:1;display:flex;overflow:hidden}.surface-field-surface-handle{border-radius:0 var(--surface-border-radius) 0 0;cursor:inherit;width:var(--surface-grip-width);flex-shrink:0;align-self:stretch;position:relative}.surface-field-surface-handle:before{content:"";opacity:.7;background:currentColor;border-radius:999px;width:18px;height:2px;position:absolute;top:50%;left:50%;translate:-50% -50%}.surface-field-surface-handle:only-child{border-radius:var(--surface-border-radius) var(--surface-border-radius) 0 0;flex:1;margin-inline-start:calc(var(--size-400) * -1)}.surface-field-surface-handle,.surface-field-surface-resize{color:var(--surface-grip-color);touch-action:none;background:0 0;border:0;padding:0}.surface-field-surface-handle:focus-visible,.surface-field-surface-resize:focus-visible{outline:2px solid oklch(from var(--color) l c h/.4);outline-offset:calc(var(--size-100) / -4)}.surface-field-surface-header{cursor:var(--surface-header-cursor);align-items:center;gap:calc(var(--size-100) / 2);min-height:var(--surface-handle-height);touch-action:none;flex-shrink:0;padding-inline-start:var(--size-400);display:flex}.surface-field-surface-lift{box-shadow:var(--surface-box-shadow-active);opacity:var(--surface-lift-opacity);transition:opacity var(--surface-lift-duration) ease}.surface-field-surface-resize{border-radius:0 0 var(--surface-border-radius) 0;cursor:nwse-resize;opacity:.7;background:linear-gradient(135deg,#0000 45%,currentColor 45% 52%,#0000 52%) 4px 4px/12px 12px no-repeat,linear-gradient(135deg,#0000 70%,currentColor 70% 77%,#0000 77%) 4px 4px/12px 12px no-repeat;width:22px;height:22px;position:absolute;bottom:0;right:0}.surface-field-surface-title{color:var(--surface-title-color);font-weight:var(--font-weight-600);flex:0 auto;min-width:0}.surface-field-surface-title+.surface-field-surface-handle{margin-inline-start:auto}@media (prefers-reduced-motion:reduce){.surface-field-surface{transition:none}.surface-field-surface.--active{scale:1}}}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer components{.tasklist{--check-duration
|
|
1
|
+
@layer components{.tasklist{margin:0;padding:0;list-style:none}.tasklist-item{--background:var(--background-default);--background-active:var(--background-default);--background-default:transparent;--background-hover:var(--background-default);--background-pressed:var(--background-default)}.--active.tasklist-item{--background:var(--background-active)}.tasklist-item:not(.--active):hover{--background:var(--background-hover)}.tasklist-item:not(.--active):active{--background:var(--background-pressed)}@font-face{font-display:swap;font-family:Geist;font-style:normal;font-weight:100 900;src:url(../../../css-utilities/font/geist/Geist-Variable.woff2)format("woff2")}@font-face{font-display:swap;font-family:Geist;font-style:italic;font-weight:100 900;src:url(../../../css-utilities/font/geist/Geist-Italic-Variable.woff2)format("woff2")}@font-face{font-display:swap;font-family:Geist Mono;font-style:normal;font-weight:100 900;src:url(../../../css-utilities/font/geist/GeistMono-Variable.woff2)format("woff2")}@font-face{font-display:swap;font-family:Geist Mono;font-style:italic;font-weight:100 900;src:url(../../../css-utilities/font/geist/GeistMono-Italic-Variable.woff2)format("woff2")}.tasklist--plan .tasklist-label:before{--font-weight-300:300;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-family:"Geist Mono", monospace}.tasklist{--check-duration:var(--duration-fast);--gap:calc(var(--size-100) / 4);--strike-duration:var(--duration-moderate);--timing-function:cubic-bezier(.65, 0, .35, 1)}@media (prefers-reduced-motion:reduce){.tasklist{--check-duration:0s;--strike-duration:0s}}.tasklist--plan .tasklist-label:before{--color:var(--color-text-300);--font-size:var(--font-size-200);--font-weight:var(--font-weight-500);--gap:calc(var(--size-300) / 2)}.tasklist-checkbox{--background-active:var(--color-primary-500);--border-color-active:var(--color-primary-500);--border-color-default:var(--surface-border-hover);--border-width:var(--border-width-400);--indicator-color-default:var(--color-surface);--size:var(--size-500)}.tasklist-content{--opacity:var(--opacity-default);--opacity-active:.65;--opacity-default:1}.tasklist-description{--color:var(--color-text-300);--font-size:var(--font-size-300)}.tasklist-item{--background-hover:color-mix(in oklch, var(--color-primary-500) 3%, var(--background-default));--background-pressed:var(--background-hover);--border-radius:var(--border-radius-400);--move-duration:.5s;--move-easing:linear(0, .109, .322, .536, .71, .835, .916, .965, .991, 1.003, 1.007, 1.008, 1.006, 1.005, 1.003, 1.002, 1);--strike-delay:0s;--strike-length:0%}.tasklist-item--checking{--strike-delay:var(--check-duration)}.tasklist-item:has(.checkbox-tag:checked){--strike-length:100%}.tasklist-item:has(.checkbox-tag:checked) .tasklist-content{--opacity:var(--opacity-active)}@media (prefers-reduced-motion:reduce){.tasklist-item{--move-duration:0s}}.tasklist-label{--color:var(--color-text-500);--font-weight:var(--font-weight-500);--strike-color:var(--surface-border-hover);--strike-width:2px}.tasklist-row{--font-size:var(--font-size-400);--gap:var(--size-200);--line-height:var(--size-500);--padding-horizontal:var(--size-100);--padding-vertical:var(--size-100)}.tasklist-row--sortable:before{--background:var(--color-primary-300);--opacity:var(--opacity-default);--opacity-default:0;--opacity-hover:1;--size:var(--size-400)}.tasklist-row--sortable:not(.--active):hover:before{--opacity:var(--opacity-hover)}.tasklist{gap:var(--gap);flex-direction:column;display:flex}.tasklist--plan .tasklist-item{counter-set:tasklist var(--index)}.tasklist--plan .tasklist-label:before{color:var(--color);content:counter(tasklist, decimal-leading-zero);font-family:var(--font-family);font-size:var(--font-size);font-variant-numeric:tabular-nums;font-weight:var(--font-weight);margin-right:var(--gap)}.tasklist-checkbox{margin-top:calc((var(--line-height) - var(--size)) / 2)}.tasklist-content{min-width:0;opacity:var(--opacity);transition:opacity var(--strike-duration) var(--timing-function) var(--strike-delay)}.tasklist-description{color:var(--color);font-size:var(--font-size);margin-top:calc(var(--size-100) / 4);display:block}.tasklist-item{background:var(--background);border-radius:var(--border-radius);transition:background-color var(--transition-duration) var(--timing-function);position:relative}.tasklist-item--moving{z-index:1}.tasklist-item--unchecking .tasklist-checkbox,.tasklist-item--unchecking .tasklist-checkbox .checkbox-check svg{transition-delay:var(--strike-duration)}.tasklist-label{-webkit-box-decoration-break:clone;box-decoration-break:clone;background-image:linear-gradient(var(--strike-color), var(--strike-color));background-position:0 55%;background-repeat:no-repeat;background-size:var(--strike-length) var(--strike-width);color:var(--color);font-weight:var(--font-weight);transition:background-size var(--strike-duration) var(--timing-function) var(--strike-delay)}.tasklist-row{cursor:pointer;font-size:var(--font-size);align-items:flex-start;gap:var(--gap);line-height:var(--line-height);padding:var(--padding-vertical) var(--padding-horizontal);-webkit-user-select:none;user-select:none;display:flex}.tasklist-row--sortable:before{background:var(--background);content:"";flex:0 0 var(--size);height:var(--size);margin-top:calc((var(--line-height) - var(--size)) / 2);opacity:var(--opacity);transition:opacity var(--transition-duration) var(--timing-function);mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='9' cy='5' r='1.5'/%3E%3Ccircle cx='9' cy='12' r='1.5'/%3E%3Ccircle cx='9' cy='19' r='1.5'/%3E%3Ccircle cx='15' cy='5' r='1.5'/%3E%3Ccircle cx='15' cy='12' r='1.5'/%3E%3Ccircle cx='15' cy='19' r='1.5'/%3E%3C/svg%3E") 50%/contain no-repeat}}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer components{.text{--border-width:0px;--color:var(--color-default,inherit);--color-active:var(--color-default);--color-default:var(--color-text-400);--color-hover:var(--color-default);--color-pressed:var(--color-default);--width:auto;color:var(--color);font-size:var(--font-size);font-weight:var(--font-weight);gap:var(--gap-vertical) var(--gap-horizontal);line-height:var(--line-height);transition:color var(--transition-duration) var(--transition-timing-function);width:var(--width);display:flex;position:relative}
|
|
1
|
+
@layer components{.text{--border-width:0px;--color:var(--color-default,inherit);--color-active:var(--color-default);--color-default:var(--color-text-400);--color-hover:var(--color-default);--color-pressed:var(--color-default);--width:auto;color:var(--color);font-size:var(--font-size);font-weight:var(--font-weight);gap:var(--gap-vertical) var(--gap-horizontal);line-height:var(--line-height);transition:color var(--transition-duration) var(--transition-timing-function);width:var(--width);display:flex;position:relative}@keyframes text-gradient{to{background-position:var(--background-size) 0}}@keyframes text-line-shadow{0%{background-position:0 0}to{background-position:100% -100%}}@keyframes text-shiny{0%,90%,to{background-position:calc(-100% - var(--shine-width)) 0}30%,60%{background-position:calc(100% + var(--shine-width)) 0}}}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer components{.textarea{--background:var(--background-default);--background-active:var(--background-default);--background-default:transparent;--background-hover:var(--background-default);--background-pressed:var(--background-default)}.--active.textarea{--background:var(--background-active)}.textarea:not(.--active):hover{--background:var(--background-hover)}.textarea:not(.--active):active{--background:var(--background-pressed)}.textarea{--border-color:var(--border-color-default);--border-color-active:var(--border-color-default);--border-color-default:transparent;--border-color-hover:var(--border-color-default);--border-color-pressed:var(--border-color-default)}.--active.textarea{--border-color:var(--border-color-active)}.textarea:not(.--active):hover{--border-color:var(--border-color-hover)}.textarea:not(.--active):active{--border-color:var(--border-color-pressed)}.textarea{--color:var(--color-default);--color-active:var(--color-default);--color-default:var(--color-text-400);--color-hover:var(--color-default);--color-pressed:var(--color-default)}.--active.textarea{--color:var(--color-active)}.textarea:not(.--active):hover{--color:var(--color-hover)}.textarea:not(.--active):active{--color:var(--color-pressed)}.textarea{--resize-duration
|
|
1
|
+
@layer components{.textarea{--background:var(--background-default);--background-active:var(--background-default);--background-default:transparent;--background-hover:var(--background-default);--background-pressed:var(--background-default)}.--active.textarea{--background:var(--background-active)}.textarea:not(.--active):hover{--background:var(--background-hover)}.textarea:not(.--active):active{--background:var(--background-pressed)}.textarea{--border-color:var(--border-color-default);--border-color-active:var(--border-color-default);--border-color-default:transparent;--border-color-hover:var(--border-color-default);--border-color-pressed:var(--border-color-default)}.--active.textarea{--border-color:var(--border-color-active)}.textarea:not(.--active):hover{--border-color:var(--border-color-hover)}.textarea:not(.--active):active{--border-color:var(--border-color-pressed)}.textarea{--box-shadow:var(--box-shadow-default);--box-shadow-active:var(--box-shadow-default);--box-shadow-default:none;--box-shadow-hover:var(--box-shadow-default);--box-shadow-pressed:var(--box-shadow-default)}.--active.textarea{--box-shadow:var(--box-shadow-active)}.textarea:not(.--active):hover{--box-shadow:var(--box-shadow-hover)}.textarea:not(.--active):active{--box-shadow:var(--box-shadow-pressed)}.textarea{--color:var(--color-default);--color-active:var(--color-default);--color-default:var(--color-text-400);--color-hover:var(--color-default);--color-pressed:var(--color-default)}.--active.textarea{--color:var(--color-active)}.textarea:not(.--active):hover{--color:var(--color-hover)}.textarea:not(.--active):active{--color:var(--color-pressed)}.textarea{--resize-duration:var(--duration-moderate);--resize-timing-function:cubic-bezier(.4, 0, .2, 1);--border-color-default:var(--background);--border-radius:var(--border-radius-400);--border-style:solid;--border-width:0px;--font-size:var(--font-size-400);--padding-horizontal:var(--size-400);--padding-vertical:var(--size-400);--size:var(--size-400);transition:background var(--transition-duration) var(--transition-timing-function), border-color var(--transition-duration) var(--transition-timing-function), box-shadow var(--transition-duration) var(--transition-timing-function), height var(--resize-duration) var(--resize-timing-function), opacity var(--transition-duration) var(--transition-timing-function), transform var(--transition-duration) var(--transition-timing-function);background:var(--background);border:var(--border-width) var(--border-style) var(--border-color);border-radius:var(--border-radius);color:var(--color);cursor:text;font-size:var(--font-size);min-width:0;padding-block:max(0px, var(--padding-vertical) - var(--border-width));padding-inline:max(0px, var(--padding-horizontal) - var(--border-width));flex:auto;width:100%;position:relative}.textarea:invalid,.textarea:required{box-shadow:none}.textarea--autoresize{--scrollbar-gutter:stable;--scrollbar-overflow:hidden;box-sizing:border-box;field-sizing:fixed;height:var(--height,var(--min-height));max-height:var(--max-height);min-height:var(--min-height);overflow-y:var(--scrollbar-overflow);resize:none;scrollbar-gutter:var(--scrollbar-gutter)}@media (prefers-reduced-motion:reduce){.textarea--autoresize{transition:none}}.textarea--measure{--scrollbar-gutter:stable;box-sizing:border-box;field-sizing:content;height:auto;max-height:var(--max-height);min-height:var(--min-height);pointer-events:none;resize:none;scrollbar-gutter:var(--scrollbar-gutter);visibility:hidden;transition:none;position:absolute;inset:0 auto auto 0;overflow-y:auto}.textarea--measure-fallback{height:calc(var(--content-height,var(--min-height)) + 2 * var(--border-width))}.textarea--scrollable{--scrollbar-overflow:auto}.textarea-resize{flex:auto;width:100%;min-width:0;display:grid;position:relative}}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import './scss/index.scss';
|
|
1
2
|
type Mode = 'dark' | 'light';
|
|
2
3
|
type Preference = Mode | 'system';
|
|
3
4
|
type Store = {
|
|
@@ -8,7 +9,6 @@ type Store = {
|
|
|
8
9
|
declare const KEY = "theme";
|
|
9
10
|
export default _default;
|
|
10
11
|
declare function _default(store?: Store): {
|
|
11
|
-
readonly class: string;
|
|
12
12
|
readonly mode: Mode;
|
|
13
13
|
readonly preference: Preference;
|
|
14
14
|
set(preference: Preference): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
2
|
-
|
|
2
|
+
import './scss/index.scss';
|
|
3
|
+
class ReactiveObject_1y66z620 extends reactivity_u0.ReactiveObject {
|
|
3
4
|
#preference;
|
|
4
5
|
#system;
|
|
5
6
|
constructor(_p0, _p1) {
|
|
@@ -20,26 +21,34 @@ class ReactiveObject_1grmkcs0 extends reactivity_u0.ReactiveObject {
|
|
|
20
21
|
reactivity_u0.write(this.#system, _v1);
|
|
21
22
|
}
|
|
22
23
|
}
|
|
24
|
+
const ATTRIBUTE = 'data-theme';
|
|
23
25
|
const KEY = 'theme';
|
|
24
26
|
const PREFERENCES = ['dark', 'light', 'system'];
|
|
25
27
|
const QUERY = '(prefers-color-scheme: dark)';
|
|
28
|
+
function apply(preference) {
|
|
29
|
+
let root = document.documentElement;
|
|
30
|
+
if (preference === 'system') {
|
|
31
|
+
root.removeAttribute(ATTRIBUTE);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
root.setAttribute(ATTRIBUTE, preference);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
26
37
|
function system(dark) {
|
|
27
38
|
return dark ? 'dark' : 'light';
|
|
28
39
|
}
|
|
29
40
|
export default (store) => {
|
|
30
|
-
let media = matchMedia(QUERY), state = new
|
|
41
|
+
let media = matchMedia(QUERY), state = new ReactiveObject_1y66z620('system', system(media.matches)), touched = false;
|
|
31
42
|
media.addEventListener('change', (event) => {
|
|
32
43
|
state.system = system(event.matches);
|
|
33
44
|
});
|
|
34
45
|
store?.get(KEY).then((value) => {
|
|
35
46
|
if (!touched && PREFERENCES.includes(value)) {
|
|
36
47
|
state.preference = value;
|
|
48
|
+
apply(state.preference);
|
|
37
49
|
}
|
|
38
50
|
}, () => { });
|
|
39
51
|
return {
|
|
40
|
-
get class() {
|
|
41
|
-
return `--theme-${this.mode}`;
|
|
42
|
-
},
|
|
43
52
|
get mode() {
|
|
44
53
|
return state.preference === 'system' ? state.system : state.preference;
|
|
45
54
|
},
|
|
@@ -49,6 +58,7 @@ export default (store) => {
|
|
|
49
58
|
set(preference) {
|
|
50
59
|
touched = true;
|
|
51
60
|
state.preference = preference;
|
|
61
|
+
apply(preference);
|
|
52
62
|
if (preference === 'system') {
|
|
53
63
|
void store?.delete(KEY);
|
|
54
64
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
@layer components{:root{--color-primary:light-dark(oklch(16% .0102 257),oklch(98% .0032 257));--color-surface:light-dark(oklch(98% .0032 257),oklch(16% .0102 257));--color-text:light-dark(oklch(36% .0325 257),oklch(90% .0162 257));--surface-background-active:light-dark(oklch(from var(--surface-background-default) calc(l + .01) c h),oklch(from var(--surface-background-default) calc(l + .02) c h));--surface-background-default:light-dark(oklch(from var(--color-surface) clamp(0, l + max(var(--surface-level), 0) * .01 + min(var(--surface-level), 0) * .01, 1) calc(c * (1 - clamp(0, l + max(var(--surface-level), 0) * .01 + min(var(--surface-level), 0) * .01, 1)) / max(1 - l, .01)) h),oklch(from var(--color-surface) clamp(0, l + max(var(--surface-level), 0) * .02 + min(var(--surface-level), 0) * .02, l + .12) calc(c * clamp(0, l + max(var(--surface-level), 0) * .02 + min(var(--surface-level), 0) * .02, l + .12) / max(l, .01)) h));--surface-background-hover:light-dark(oklch(from var(--surface-background-default) calc(l + .005) c h),oklch(from var(--surface-background-default) calc(l + .01) c h));--surface-background-pressed:light-dark(oklch(from var(--surface-background-default) calc(l - .02) c h),oklch(from var(--surface-background-default) calc(l - .04) c h));--surface-border-active:light-dark(oklch(from var(--surface-background-active) max(0, l - .04) c h),oklch(from var(--surface-background-active) min(1, l + .06) c h));--surface-border-default:light-dark(oklch(from var(--surface-background-default) max(0, l - .04) c h),oklch(from var(--surface-background-default) min(1, l + .06) c h));--surface-border-hover:light-dark(oklch(from var(--surface-background-hover) max(0, l - .04) c h),oklch(from var(--surface-background-hover) min(1, l + .06) c h));--surface-border-pressed:light-dark(oklch(from var(--surface-background-pressed) max(0, l - .04) c h),oklch(from var(--surface-background-pressed) min(1, l + .06) c h));--surface-shadow-active:var(--surface-shadow-hover);--surface-shadow-color:light-dark(oklch(from var(--surface-background-default) calc(l * .24) calc(c * .24) h / .08),oklch(from var(--surface-background-default) calc(l * .24) calc(c * .24) h / .16));--surface-shadow-weight:0;--surface-shadow-cast:light-dark(oklch(from light-dark(oklch(from var(--color-surface) clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .01 + min(calc(var(--surface-level) - 1), 0) * .01, 1) calc(c * (1 - clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .01 + min(calc(var(--surface-level) - 1), 0) * .01, 1)) / max(1 - l, .01)) h),oklch(from var(--color-surface) clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .02 + min(calc(var(--surface-level) - 1), 0) * .02, l + .12) calc(c * clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .02 + min(calc(var(--surface-level) - 1), 0) * .02, l + .12) / max(l, .01)) h)) calc(l * .24) calc(c * .24) h / .08),oklch(from light-dark(oklch(from var(--color-surface) clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .01 + min(calc(var(--surface-level) - 1), 0) * .01, 1) calc(c * (1 - clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .01 + min(calc(var(--surface-level) - 1), 0) * .01, 1)) / max(1 - l, .01)) h),oklch(from var(--color-surface) clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .02 + min(calc(var(--surface-level) - 1), 0) * .02, l + .12) calc(c * clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .02 + min(calc(var(--surface-level) - 1), 0) * .02, l + .12) / max(l, .01)) h)) calc(l * .24) calc(c * .24) h / .16));--surface-shadow-default:0 calc((0 + 1 * clamp(0, var(--surface-shadow-weight) - 0, 1) + 3 * clamp(0, var(--surface-shadow-weight) - 3, 1) + 6 * clamp(0, var(--surface-shadow-weight) - 4, 1) + 10 * clamp(0, var(--surface-shadow-weight) - 5, 1) + 5 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, var(--surface-shadow-weight) - 1, 1) + 1 * clamp(0, var(--surface-shadow-weight) - 2, 1) + 3 * clamp(0, var(--surface-shadow-weight) - 3, 1) + 9 * clamp(0, var(--surface-shadow-weight) - 4, 1) + 10 * clamp(0, var(--surface-shadow-weight) - 5, 1) + 25 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, var(--surface-shadow-weight) - 3, 1) + -2 * clamp(0, var(--surface-shadow-weight) - 4, 1) + -2 * clamp(0, var(--surface-shadow-weight) - 5, 1) + -7 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .05 * clamp(0, var(--surface-shadow-weight) - 0, 1) + .05 * clamp(0, var(--surface-shadow-weight) - 2, 1) + .15 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 10)), 0 calc((0 + 1 * clamp(0, var(--surface-shadow-weight) - 2, 1) + 1 * clamp(0, var(--surface-shadow-weight) - 3, 1) + 2 * clamp(0, var(--surface-shadow-weight) - 4, 1) + 4 * clamp(0, var(--surface-shadow-weight) - 5, 1) + -8 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, var(--surface-shadow-weight) - 2, 1) + 2 * clamp(0, var(--surface-shadow-weight) - 3, 1) + 2 * clamp(0, var(--surface-shadow-weight) - 4, 1) + 4 * clamp(0, var(--surface-shadow-weight) - 5, 1) + -10 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, var(--surface-shadow-weight) - 2, 1) + -1 * clamp(0, var(--surface-shadow-weight) - 3, 1) + -2 * clamp(0, var(--surface-shadow-weight) - 4, 1) + -2 * clamp(0, var(--surface-shadow-weight) - 5, 1) + 6 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .1 * clamp(0, var(--surface-shadow-weight) - 2, 1) + -.1 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 10));--surface-shadow-hover:0 calc((0 + 1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 0, 1) + 3 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + 6 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + 10 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + 5 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 1, 1) + 1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + 3 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + 9 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + 10 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + 25 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + -2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + -2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + -7 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .05 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 0, 1) + .05 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + .15 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 10)), 0 calc((0 + 1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + 1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + 2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + 4 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + -8 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + 2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + 2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + 4 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + -10 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + -1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + -2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + -2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + 6 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + -.1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 10));--surface-shadow-pressed:0 calc((0 + 1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 0, 1) + 3 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + 6 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + 10 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + 5 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 1, 1) + 1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + 3 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + 9 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + 10 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + 25 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + -2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + -2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + -7 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .05 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 0, 1) + .05 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + .15 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 10)), 0 calc((0 + 1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + 1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + 2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + 4 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + -8 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + 2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + 2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + 4 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + -10 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + -1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + -2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + -2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + 6 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + -.1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 10));--color-primary-300:light-dark(oklch(from var(--color-primary) min(1, l + .03) c h),oklch(from var(--color-primary) min(1, l + .03) c h));--color-primary-400:var(--color-primary);--color-primary-500:light-dark(oklch(from var(--color-primary) max(0, l - .03) c h),oklch(from var(--color-primary) max(0, l - .03) c h));--background:var(--surface-background-default);--color:var(--color-text-400);--color-text-300:light-dark(oklch(from var(--color-text) min(1, pow(1.5 * (pow(l, 3) + .05) - .05, 1 / 3)) calc(c * min(1, (1 - min(1, pow(1.5 * (pow(l, 3) + .05) - .05, 1 / 3))) / max(1 - l, .01))) h),oklch(from var(--color-text) pow(max(0, (pow(l, 3) + .05) / 1.5 - .05), 1 / 3) calc(c * min(1, pow(max(0, (pow(l, 3) + .05) / 1.5 - .05), 1 / 3) / max(l, .01))) h));--color-text-400:var(--color-text);--color-text-500:light-dark(oklch(from var(--color-text) pow(max(0, (pow(l, 3) + .05) / 1.5 - .05), 1 / 3) calc(c * min(1, pow(max(0, (pow(l, 3) + .05) / 1.5 - .05), 1 / 3) / max(l, .01))) h),oklch(from var(--color-text) min(1, pow(1.5 * (pow(l, 3) + .05) - .05, 1 / 3)) calc(c * min(1, (1 - min(1, pow(1.5 * (pow(l, 3) + .05) - .05, 1 / 3))) / max(1 - l, .01))) h));color-scheme:light dark}[data-theme=dark]{color-scheme:dark}[data-theme=light]{color-scheme:light}}
|
|
2
|
+
/*$vite$:1*/
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as template_u1 from '@esportsplus/template';
|
|
2
|
+
import { type Attributes } from '@esportsplus/template';
|
|
3
|
+
import type { Mode, Preference } from '../theme/index.js';
|
|
4
|
+
import '../button/scss/index.scss';
|
|
5
|
+
import './scss/index.scss';
|
|
6
|
+
declare const TOGGLE_OPTION: unique symbol;
|
|
7
|
+
declare const TOGGLE_TRIGGER: unique symbol;
|
|
8
|
+
type A = Attributes & {
|
|
9
|
+
mode: Theme;
|
|
10
|
+
};
|
|
11
|
+
type T = A & {
|
|
12
|
+
[TOGGLE_OPTION]?: Attributes;
|
|
13
|
+
[TOGGLE_TRIGGER]?: Attributes;
|
|
14
|
+
onconnect?: never;
|
|
15
|
+
ondocumentclick?: never;
|
|
16
|
+
onkeydown?: never;
|
|
17
|
+
onpointerenter?: never;
|
|
18
|
+
onpointerleave?: never;
|
|
19
|
+
};
|
|
20
|
+
type Theme = {
|
|
21
|
+
readonly mode: Mode;
|
|
22
|
+
readonly preference: Preference;
|
|
23
|
+
set(preference: Preference): void;
|
|
24
|
+
};
|
|
25
|
+
declare const _default: {
|
|
26
|
+
cards: {
|
|
27
|
+
(): template_u1.Renderable<any>;
|
|
28
|
+
<T extends A>(attributes: T): template_u1.Renderable<any>;
|
|
29
|
+
<T extends template_u1.Renderable<any>>(content: T): template_u1.Renderable<any>;
|
|
30
|
+
(attributes: A, content?: template_u1.Renderable<any>): template_u1.Renderable<any>;
|
|
31
|
+
bind(context: {
|
|
32
|
+
attributes?: Partial<A> | undefined;
|
|
33
|
+
content?: template_u1.Renderable<any>;
|
|
34
|
+
}): any;
|
|
35
|
+
};
|
|
36
|
+
swatches: {
|
|
37
|
+
(): template_u1.Renderable<any>;
|
|
38
|
+
<T extends A>(attributes: T): template_u1.Renderable<any>;
|
|
39
|
+
<T extends template_u1.Renderable<any>>(content: T): template_u1.Renderable<any>;
|
|
40
|
+
(attributes: A, content?: template_u1.Renderable<any>): template_u1.Renderable<any>;
|
|
41
|
+
bind(context: {
|
|
42
|
+
attributes?: Partial<A> | undefined;
|
|
43
|
+
content?: template_u1.Renderable<any>;
|
|
44
|
+
}): any;
|
|
45
|
+
};
|
|
46
|
+
toggle: template_u1.Factory<T, template_u1.Renderable<any>, template_u1.Renderable<any>, {
|
|
47
|
+
readonly option: typeof TOGGLE_OPTION;
|
|
48
|
+
readonly trigger: typeof TOGGLE_TRIGGER;
|
|
49
|
+
}>;
|
|
50
|
+
};
|
|
51
|
+
export default _default;
|
|
52
|
+
export type { Theme };
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import * as template_u1 from '@esportsplus/template';
|
|
2
|
+
import { component } from '@esportsplus/template';
|
|
3
|
+
import * as reactivity_u0 from '@esportsplus/reactivity';
|
|
4
|
+
import { flush } from '@esportsplus/reactivity';
|
|
5
|
+
import faces from '../button/faces.js';
|
|
6
|
+
import dismiss from '../../shared/dismiss.js';
|
|
7
|
+
import monitor from '@esportsplus/ui/svg/monitor.svg';
|
|
8
|
+
import moon from '@esportsplus/ui/svg/moon.svg';
|
|
9
|
+
import sun from '@esportsplus/ui/svg/sun.svg';
|
|
10
|
+
import '../button/scss/index.scss';
|
|
11
|
+
import './scss/index.scss';
|
|
12
|
+
const template_0kyv8md2 = template_u1.template(`<svg aria-hidden='true' class='theme-picker-icon'><use />`);
|
|
13
|
+
const template_0kyv8md5 = template_u1.template(`<div aria-label='Theme' class='theme-picker-cards' role='radiogroup'>`);
|
|
14
|
+
const template_0kyv8md8 = template_u1.template(`<button class='theme-picker-cards-option'><span class='theme-picker-cards-preview '><span class='theme-picker-cards-preview-bar'></span><span class='theme-picker-cards-preview-line'></span><span class='theme-picker-cards-preview-line theme-picker-cards-preview-line--short'></span></span><span class='theme-picker-cards-label'>`);
|
|
15
|
+
const template_0kyv8mdd = template_u1.template(`<div aria-label='Theme' class='theme-picker-swatches' role='radiogroup'>`);
|
|
16
|
+
const template_0kyv8mdg = template_u1.template(`<button class='theme-picker-swatches-option'><span class='theme-picker-swatches-circle '></span><span class='theme-picker-swatches-label'>`);
|
|
17
|
+
const template_0kyv8mdl = template_u1.template(`<div class='theme-picker-toggle'><button aria-haspopup='true' class='button button--feedback theme-picker-toggle-trigger' type='button'></button><div aria-label='Theme' class='theme-picker-toggle-menu' role='radiogroup'>`);
|
|
18
|
+
const template_0kyv8mdq = template_u1.template(`<button class='theme-picker-toggle-option'>`);
|
|
19
|
+
class ReactiveObject_0kyv8md0 extends reactivity_u0.ReactiveObject {
|
|
20
|
+
#active = this[reactivity_u0.SIGNAL](false);
|
|
21
|
+
constructor() {
|
|
22
|
+
super(null);
|
|
23
|
+
}
|
|
24
|
+
get active() {
|
|
25
|
+
return reactivity_u0.read(this.#active);
|
|
26
|
+
}
|
|
27
|
+
set active(_v0) {
|
|
28
|
+
reactivity_u0.write(this.#active, _v0);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const TOGGLE_OPTION = Symbol.for('@esportsplus/ui/theme-picker.toggle.option');
|
|
32
|
+
const TOGGLE_TRIGGER = Symbol.for('@esportsplus/ui/theme-picker.toggle.trigger');
|
|
33
|
+
const CHOICES = [
|
|
34
|
+
{ icon: sun, label: 'Light', value: 'light' },
|
|
35
|
+
{ icon: moon, label: 'Dark', value: 'dark' },
|
|
36
|
+
{ icon: monitor, label: 'System', value: 'system' }
|
|
37
|
+
];
|
|
38
|
+
function choice(mode) {
|
|
39
|
+
return CHOICES.find((choice) => choice.value === mode.preference) ?? CHOICES[2];
|
|
40
|
+
}
|
|
41
|
+
function icon(id) {
|
|
42
|
+
return (() => {
|
|
43
|
+
let root_0kyv8md1 = template_0kyv8md2(), element_0kyv8md3 = root_0kyv8md1.firstChild.firstElementChild;
|
|
44
|
+
template_u1.setProperty(element_0kyv8md3, 'href', template_u1.interpolate(["#", (id)]));
|
|
45
|
+
return root_0kyv8md1;
|
|
46
|
+
})();
|
|
47
|
+
}
|
|
48
|
+
function radio(mode, choice) {
|
|
49
|
+
return {
|
|
50
|
+
'aria-checked': () => mode.preference === choice.value ? 'true' : 'false',
|
|
51
|
+
onclick: () => mode.set(choice.value),
|
|
52
|
+
role: 'radio',
|
|
53
|
+
type: 'button'
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const cards = component(({ mode, ...attributes }) => {
|
|
57
|
+
let root_0kyv8md4 = template_0kyv8md5(), element_0kyv8md6 = root_0kyv8md4.firstChild;
|
|
58
|
+
template_u1.slot(element_0kyv8md6, CHOICES.map((choice) => {
|
|
59
|
+
let root_0kyv8md7 = template_0kyv8md8(), element_0kyv8md9 = root_0kyv8md7.firstChild, element_0kyv8mda = element_0kyv8md9.firstElementChild, element_0kyv8mdb = element_0kyv8mda.nextElementSibling;
|
|
60
|
+
template_u1.slot(element_0kyv8mdb, choice.label, 1);
|
|
61
|
+
template_u1.setList(element_0kyv8mda, 'class', template_u1.interpolate(["theme-picker-cards-preview--", (choice.value)]));
|
|
62
|
+
template_u1.setProperties(element_0kyv8md9, radio(mode, choice));
|
|
63
|
+
return root_0kyv8md7;
|
|
64
|
+
}), 1);
|
|
65
|
+
template_u1.setProperties(element_0kyv8md6, attributes);
|
|
66
|
+
return root_0kyv8md4;
|
|
67
|
+
});
|
|
68
|
+
const swatches = component(({ mode, ...attributes }) => {
|
|
69
|
+
let root_0kyv8mdc = template_0kyv8mdd(), element_0kyv8mde = root_0kyv8mdc.firstChild;
|
|
70
|
+
template_u1.slot(element_0kyv8mde, CHOICES.map((choice) => {
|
|
71
|
+
let root_0kyv8mdf = template_0kyv8mdg(), element_0kyv8mdh = root_0kyv8mdf.firstChild, element_0kyv8mdi = element_0kyv8mdh.firstElementChild, element_0kyv8mdj = element_0kyv8mdi.nextElementSibling;
|
|
72
|
+
template_u1.slot(element_0kyv8mdj, choice.label, 1);
|
|
73
|
+
template_u1.setList(element_0kyv8mdi, 'class', template_u1.interpolate(["theme-picker-swatches-circle--", (choice.value)]));
|
|
74
|
+
template_u1.setProperties(element_0kyv8mdh, radio(mode, choice));
|
|
75
|
+
return root_0kyv8mdf;
|
|
76
|
+
}), 1);
|
|
77
|
+
template_u1.setProperties(element_0kyv8mde, attributes);
|
|
78
|
+
return root_0kyv8mdc;
|
|
79
|
+
});
|
|
80
|
+
const toggle = component(({ mode, ...attributes }) => {
|
|
81
|
+
let options = [], state = new ReactiveObject_0kyv8md0(), trigger;
|
|
82
|
+
function close(focus = false) {
|
|
83
|
+
state.active = false;
|
|
84
|
+
if (focus) {
|
|
85
|
+
trigger?.focus();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function open(focus = false) {
|
|
89
|
+
state.active = true;
|
|
90
|
+
if (focus) {
|
|
91
|
+
flush();
|
|
92
|
+
options[CHOICES.indexOf(choice(mode))]?.focus();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return (() => {
|
|
96
|
+
let root_0kyv8mdk = template_0kyv8mdl(), element_0kyv8mdm = root_0kyv8mdk.firstChild, element_0kyv8mdn = element_0kyv8mdm.firstElementChild, element_0kyv8mdo = element_0kyv8mdn.nextElementSibling;
|
|
97
|
+
template_u1.slot(element_0kyv8mdn, faces(() => choice(mode).value, CHOICES.map((choice) => ({
|
|
98
|
+
content: '',
|
|
99
|
+
icon: () => icon(choice.icon),
|
|
100
|
+
key: choice.value
|
|
101
|
+
}))), 1);
|
|
102
|
+
template_u1.slot(element_0kyv8mdo, CHOICES.map((choice, i) => {
|
|
103
|
+
let root_0kyv8mdp = template_0kyv8mdq(), element_0kyv8mdr = root_0kyv8mdp.firstChild;
|
|
104
|
+
template_u1.slot(element_0kyv8mdr, icon(choice.icon), 1);
|
|
105
|
+
template_u1.setProperty(element_0kyv8mdr, 'aria-label', choice.label);
|
|
106
|
+
template_u1.setProperty(element_0kyv8mdr, 'title', choice.label);
|
|
107
|
+
template_u1.setProperties(element_0kyv8mdr, attributes[TOGGLE_OPTION]);
|
|
108
|
+
template_u1.setProperties(element_0kyv8mdr, radio(mode, choice));
|
|
109
|
+
template_u1.delegate(element_0kyv8mdr, 'click', () => {
|
|
110
|
+
mode.set(choice.value);
|
|
111
|
+
close(true);
|
|
112
|
+
});
|
|
113
|
+
template_u1.onconnect(element_0kyv8mdr, (element) => {
|
|
114
|
+
options[i] = element;
|
|
115
|
+
});
|
|
116
|
+
return root_0kyv8mdp;
|
|
117
|
+
}), 1);
|
|
118
|
+
template_u1.setProperty(element_0kyv8mdo, 'inert', () => !state.active);
|
|
119
|
+
template_u1.setProperties(element_0kyv8mdn, attributes[TOGGLE_TRIGGER]);
|
|
120
|
+
template_u1.setProperty(element_0kyv8mdn, 'aria-expanded', () => state.active ? 'true' : 'false');
|
|
121
|
+
template_u1.setProperty(element_0kyv8mdn, 'aria-label', () => `Theme: ${choice(mode).label}`);
|
|
122
|
+
template_u1.delegate(element_0kyv8mdn, 'click', (event) => {
|
|
123
|
+
if (state.active) {
|
|
124
|
+
close();
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
open(event.detail === 0);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
template_u1.onconnect(element_0kyv8mdn, (element) => {
|
|
131
|
+
trigger = element;
|
|
132
|
+
});
|
|
133
|
+
template_u1.setProperties(element_0kyv8mdm, attributes);
|
|
134
|
+
template_u1.setList(element_0kyv8mdm, 'class', () => state.active && '--active');
|
|
135
|
+
template_u1.ondocument(element_0kyv8mdm, 'click', dismiss(() => state.active, () => close()));
|
|
136
|
+
template_u1.delegate(element_0kyv8mdm, 'keydown', (event) => {
|
|
137
|
+
if (!state.active) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (event.key === 'Escape') {
|
|
141
|
+
event.stopPropagation();
|
|
142
|
+
close(true);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
let step = event.key === 'ArrowRight' ? 1 : event.key === 'ArrowLeft' ? -1 : 0;
|
|
146
|
+
if (!step) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
let i = options.indexOf(document.activeElement), n = options.length;
|
|
150
|
+
event.preventDefault();
|
|
151
|
+
options[((i === -1 ? CHOICES.indexOf(choice(mode)) : i) + step + n) % n]?.focus();
|
|
152
|
+
});
|
|
153
|
+
template_u1.on(element_0kyv8mdm, 'pointerenter', (event) => {
|
|
154
|
+
if (event.pointerType !== 'touch') {
|
|
155
|
+
open();
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
template_u1.on(element_0kyv8mdm, 'pointerleave', (event) => {
|
|
159
|
+
if (event.pointerType !== 'touch') {
|
|
160
|
+
close();
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
template_u1.setList(element_0kyv8mdm, 'style', () => `--index: ${CHOICES.indexOf(choice(mode))};`);
|
|
164
|
+
return root_0kyv8mdk;
|
|
165
|
+
})();
|
|
166
|
+
}, { option: TOGGLE_OPTION, trigger: TOGGLE_TRIGGER });
|
|
167
|
+
export default { cards, swatches, toggle };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
@layer components{.theme-picker-toggle-menu{--surface-shadow-weight:6;--surface-background-active:light-dark(oklch(from var(--surface-background-default) calc(l + .01) c h),oklch(from var(--surface-background-default) calc(l + .02) c h));--surface-background-default:light-dark(oklch(from var(--color-surface) clamp(0, l + max(var(--surface-level), 0) * .01 + min(var(--surface-level), 0) * .01, 1) calc(c * (1 - clamp(0, l + max(var(--surface-level), 0) * .01 + min(var(--surface-level), 0) * .01, 1)) / max(1 - l, .01)) h),oklch(from var(--color-surface) clamp(0, l + max(var(--surface-level), 0) * .02 + min(var(--surface-level), 0) * .02, l + .12) calc(c * clamp(0, l + max(var(--surface-level), 0) * .02 + min(var(--surface-level), 0) * .02, l + .12) / max(l, .01)) h));--surface-background-hover:light-dark(oklch(from var(--surface-background-default) calc(l + .005) c h),oklch(from var(--surface-background-default) calc(l + .01) c h));--surface-background-pressed:light-dark(oklch(from var(--surface-background-default) calc(l - .02) c h),oklch(from var(--surface-background-default) calc(l - .04) c h));--surface-border-active:light-dark(oklch(from var(--surface-background-active) max(0, l - .04) c h),oklch(from var(--surface-background-active) min(1, l + .06) c h));--surface-border-default:light-dark(oklch(from var(--surface-background-default) max(0, l - .04) c h),oklch(from var(--surface-background-default) min(1, l + .06) c h));--surface-border-hover:light-dark(oklch(from var(--surface-background-hover) max(0, l - .04) c h),oklch(from var(--surface-background-hover) min(1, l + .06) c h));--surface-border-pressed:light-dark(oklch(from var(--surface-background-pressed) max(0, l - .04) c h),oklch(from var(--surface-background-pressed) min(1, l + .06) c h));--surface-shadow-active:var(--surface-shadow-hover);--surface-shadow-color:light-dark(oklch(from var(--surface-background-default) calc(l * .24) calc(c * .24) h / .08),oklch(from var(--surface-background-default) calc(l * .24) calc(c * .24) h / .16));--surface-shadow-cast:light-dark(oklch(from light-dark(oklch(from var(--color-surface) clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .01 + min(calc(var(--surface-level) - 1), 0) * .01, 1) calc(c * (1 - clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .01 + min(calc(var(--surface-level) - 1), 0) * .01, 1)) / max(1 - l, .01)) h),oklch(from var(--color-surface) clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .02 + min(calc(var(--surface-level) - 1), 0) * .02, l + .12) calc(c * clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .02 + min(calc(var(--surface-level) - 1), 0) * .02, l + .12) / max(l, .01)) h)) calc(l * .24) calc(c * .24) h / .08),oklch(from light-dark(oklch(from var(--color-surface) clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .01 + min(calc(var(--surface-level) - 1), 0) * .01, 1) calc(c * (1 - clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .01 + min(calc(var(--surface-level) - 1), 0) * .01, 1)) / max(1 - l, .01)) h),oklch(from var(--color-surface) clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .02 + min(calc(var(--surface-level) - 1), 0) * .02, l + .12) calc(c * clamp(0, l + max(calc(var(--surface-level) - 1), 0) * .02 + min(calc(var(--surface-level) - 1), 0) * .02, l + .12) / max(l, .01)) h)) calc(l * .24) calc(c * .24) h / .16));--surface-shadow-default:0 calc((0 + 1 * clamp(0, var(--surface-shadow-weight) - 0, 1) + 3 * clamp(0, var(--surface-shadow-weight) - 3, 1) + 6 * clamp(0, var(--surface-shadow-weight) - 4, 1) + 10 * clamp(0, var(--surface-shadow-weight) - 5, 1) + 5 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, var(--surface-shadow-weight) - 1, 1) + 1 * clamp(0, var(--surface-shadow-weight) - 2, 1) + 3 * clamp(0, var(--surface-shadow-weight) - 3, 1) + 9 * clamp(0, var(--surface-shadow-weight) - 4, 1) + 10 * clamp(0, var(--surface-shadow-weight) - 5, 1) + 25 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, var(--surface-shadow-weight) - 3, 1) + -2 * clamp(0, var(--surface-shadow-weight) - 4, 1) + -2 * clamp(0, var(--surface-shadow-weight) - 5, 1) + -7 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .05 * clamp(0, var(--surface-shadow-weight) - 0, 1) + .05 * clamp(0, var(--surface-shadow-weight) - 2, 1) + .15 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 10)), 0 calc((0 + 1 * clamp(0, var(--surface-shadow-weight) - 2, 1) + 1 * clamp(0, var(--surface-shadow-weight) - 3, 1) + 2 * clamp(0, var(--surface-shadow-weight) - 4, 1) + 4 * clamp(0, var(--surface-shadow-weight) - 5, 1) + -8 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, var(--surface-shadow-weight) - 2, 1) + 2 * clamp(0, var(--surface-shadow-weight) - 3, 1) + 2 * clamp(0, var(--surface-shadow-weight) - 4, 1) + 4 * clamp(0, var(--surface-shadow-weight) - 5, 1) + -10 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, var(--surface-shadow-weight) - 2, 1) + -1 * clamp(0, var(--surface-shadow-weight) - 3, 1) + -2 * clamp(0, var(--surface-shadow-weight) - 4, 1) + -2 * clamp(0, var(--surface-shadow-weight) - 5, 1) + 6 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .1 * clamp(0, var(--surface-shadow-weight) - 2, 1) + -.1 * clamp(0, var(--surface-shadow-weight) - 6, 1)) * 10));--surface-shadow-hover:0 calc((0 + 1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 0, 1) + 3 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + 6 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + 10 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + 5 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 1, 1) + 1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + 3 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + 9 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + 10 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + 25 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + -2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + -2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + -7 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .05 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 0, 1) + .05 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + .15 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 10)), 0 calc((0 + 1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + 1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + 2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + 4 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + -8 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + 2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + 2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + 4 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + -10 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + -1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 3, 1) + -2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 4, 1) + -2 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 5, 1) + 6 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 2, 1) + -.1 * clamp(0, min(var(--surface-shadow-weight) + 1, 7) - 6, 1)) * 10));--surface-shadow-pressed:0 calc((0 + 1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 0, 1) + 3 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + 6 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + 10 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + 5 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 1, 1) + 1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + 3 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + 9 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + 10 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + 25 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + -2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + -2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + -7 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .05 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 0, 1) + .05 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + .15 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 10)), 0 calc((0 + 1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + 1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + 2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + 4 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + -8 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) calc((0 + 2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + 2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + 2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + 4 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + -10 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) calc((0 + -1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + -1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 3, 1) + -2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 4, 1) + -2 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 5, 1) + 6 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 1px) oklch(from var(--surface-shadow-cast) l c h / calc(alpha * (0 + .1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 2, 1) + -.1 * clamp(0, max(var(--surface-shadow-weight) - 1, 0) - 6, 1)) * 10))}@container style(--surface-level:-3){.theme-picker-toggle-menu{--surface-level:-2;--surface-shadow-weight:0}}@container style(--surface-level:-2){.theme-picker-toggle-menu{--surface-level:-1;--surface-shadow-weight:0}}@container style(--surface-level:-1){.theme-picker-toggle-menu{--surface-level:0;--surface-shadow-weight:0}}@container style(--surface-level:0){.theme-picker-toggle-menu{--surface-level:1;--surface-shadow-weight:1}}@container style(--surface-level:1){.theme-picker-toggle-menu{--surface-level:2;--surface-shadow-weight:2}}@container style(--surface-level:2){.theme-picker-toggle-menu{--surface-level:3;--surface-shadow-weight:3}}@container style(--surface-level:3){.theme-picker-toggle-menu{--surface-level:4;--surface-shadow-weight:4}}@container style(--surface-level:4){.theme-picker-toggle-menu{--surface-level:5;--surface-shadow-weight:5}}@container style(--surface-level:5){.theme-picker-toggle-menu{--surface-level:6;--surface-shadow-weight:6}}.theme-picker-toggle-option,.theme-picker-swatches-option,.theme-picker-cards-option{color:inherit;cursor:pointer;font:inherit;background:0 0;border:0;padding:0}.theme-picker-toggle-option:focus-visible,.theme-picker-swatches-option:focus-visible,.theme-picker-cards-option:focus-visible{outline:2px solid var(--color-blue-400);outline-offset:calc(var(--size-100) / 4)}.theme-picker-cards{gap:var(--size-300);display:flex}.theme-picker-cards-label{color:var(--color-text-300);font-size:var(--font-size-200)}.theme-picker-cards-option{gap:var(--size-200);justify-items:center;display:grid}.theme-picker-cards-option[aria-checked=true] .theme-picker-cards-label{--font-weight:var(--font-weight-500);color:var(--color-text-500);font-weight:var(--font-weight)}.theme-picker-cards-option[aria-checked=true] .theme-picker-cards-preview{outline:2px solid var(--color-blue-400);outline-offset:calc(var(--size-100) / 4)}.theme-picker-cards-preview{border:1px solid var(--surface-border-default);border-radius:var(--border-radius-300);gap:calc(var(--size-200) / 2);width:64px;height:48px;padding:7px;display:grid;overflow:hidden}.theme-picker-cards-preview--dark{--bar:var(--color-white-300);background:var(--color-black-400)}.theme-picker-cards-preview--light{--bar:var(--color-black-300);background:var(--color-white-300)}.theme-picker-cards-preview--system{--bar:color-mix(in oklab, var(--color-white-300), var(--color-black-400));background:linear-gradient(135deg, var(--color-white-300) 50%, var(--color-black-400) 50%)}.theme-picker-cards-preview-bar{background:var(--bar);border-radius:var(--border-radius-100);opacity:.8;width:60%;height:6px}.theme-picker-cards-preview-line{background:var(--bar);border-radius:var(--border-radius-100);opacity:.35;height:4px}.theme-picker-cards-preview-line--short{width:70%}.theme-picker-icon{fill:none;height:var(--size-400);stroke:currentColor;width:var(--size-400);flex-shrink:0;display:block}.theme-picker-swatches{gap:var(--size-500);display:flex}.theme-picker-swatches-circle{border:1px solid var(--surface-border-hover);border-radius:50%;width:36px;height:36px;display:block}.theme-picker-swatches-circle--dark{background:var(--color-black-400)}.theme-picker-swatches-circle--light{background:var(--color-white-300)}.theme-picker-swatches-circle--system{background:linear-gradient(90deg, var(--color-white-300) 50%, var(--color-black-400) 50%)}.theme-picker-swatches-label{color:var(--color-text-300);font-size:var(--font-size-200)}.theme-picker-swatches-option{gap:var(--size-200);justify-items:center;display:grid}.theme-picker-swatches-option[aria-checked=true] .theme-picker-swatches-circle{box-shadow:0 0 0 2px var(--surface-background-default), 0 0 0 4px var(--color-blue-400)}.theme-picker-swatches-option[aria-checked=true] .theme-picker-swatches-label{--font-weight:var(--font-weight-500);color:var(--color-text-500);font-weight:var(--font-weight)}.theme-picker-toggle{--trigger-size:36px;display:inline-flex;position:relative}.theme-picker-toggle-menu{--border-width:var(--border-width-400);--center:calc(var(--border-width) + var(--padding) + var(--index) * (var(--option-size) + var(--gap)) + var(--option-size) / 2);--count:3;--gap:calc(var(--size-100) / 4);--option-size:28px;--padding:calc(var(--size-300) / 4);--width:calc(var(--count) * var(--option-size) + (var(--count) - 1) * var(--gap) + 2 * (var(--padding) + var(--border-width)));background:var(--surface-background-default);border:var(--border-width) solid var(--surface-border-default);box-shadow:var(--surface-shadow-default);clip-path:inset(0 calc(var(--width) - var(--center) - var(--trigger-size) / 2) 0 calc(var(--center) - var(--trigger-size) / 2) round var(--border-radius-400));gap:var(--gap);left:calc(var(--trigger-size) / 2 - var(--center));opacity:0;padding:var(--padding);top:calc((var(--trigger-size) - var(--option-size)) / 2 - var(--padding) - var(--border-width));transition:clip-path var(--duration-moderate-exit) var(--easing-spring), opacity var(--duration-fast) var(--easing-spring), visibility 0s linear var(--duration-moderate-exit);visibility:hidden;width:var(--width);z-index:10;border-radius:999px;display:flex;position:absolute}.theme-picker-toggle.--active>.theme-picker-toggle-menu{clip-path:inset(0 round 999px);opacity:1;transition:clip-path var(--duration-moderate) var(--easing-spring), opacity var(--duration-fast-exit) var(--easing-spring);visibility:visible}@media (prefers-reduced-motion:reduce){.theme-picker-toggle-menu,.theme-picker-toggle.--active>.theme-picker-toggle-menu{transition:opacity var(--duration-fast) var(--easing-spring), visibility 0s linear var(--duration-fast)}}.theme-picker-toggle-option{color:var(--color-text-300);flex:0 0 var(--option-size);height:var(--option-size);transition:background-color var(--duration-fast) var(--easing-spring), color var(--duration-fast) var(--easing-spring);border-radius:999px;justify-content:center;align-items:center;display:flex}.theme-picker-toggle-option:hover,.theme-picker-toggle-option[aria-checked=true]{color:var(--color-text-500)}.theme-picker-toggle-option[aria-checked=true]{background:var(--surface-background-active)}.theme-picker-toggle-trigger.button{--background-hover:var(--surface-background-hover);--border-color-default:var(--surface-border-default);--border-radius:var(--border-radius-400);--border-width:var(--border-width-400);--color-default:var(--color-text-400);--color-hover:var(--color-text-500);--icon-size:var(--size-400);--padding-horizontal:0px;--padding-vertical:0px;border:var(--border-width) solid var(--border-color);height:var(--trigger-size);transition:opacity var(--duration-fast) var(--easing-spring);width:var(--trigger-size)}.theme-picker-toggle.--active>.theme-picker-toggle-trigger.button{opacity:0}}
|
|
2
|
+
/*$vite$:1*/
|
|
@@ -58,11 +58,7 @@ const DURATION = 4000;
|
|
|
58
58
|
const LIMIT = 3;
|
|
59
59
|
const UNPLACED = { x: 1, y: -1 };
|
|
60
60
|
function row(toast, layout, remove) {
|
|
61
|
-
let element, frontmost = 0,
|
|
62
|
-
let size = observeSize(({ height }) => {
|
|
63
|
-
toast.measured.height = height;
|
|
64
|
-
});
|
|
65
|
-
let gesture = drag({
|
|
61
|
+
let element, frontmost = 0, gesture = drag({
|
|
66
62
|
begin: (e, element) => e.button === 0 ? toward(edge(element.closest('.toaster') ?? element, 'toaster') ?? UNPLACED) : null,
|
|
67
63
|
capture: () => {
|
|
68
64
|
local.swiping = true;
|
|
@@ -79,6 +75,8 @@ function row(toast, layout, remove) {
|
|
|
79
75
|
}
|
|
80
76
|
local.swipe = null;
|
|
81
77
|
}
|
|
78
|
+
}), local = new ReactiveObject_1ali9cs0(null, null), size = observeSize(({ height }) => {
|
|
79
|
+
toast.measured.height = height;
|
|
82
80
|
});
|
|
83
81
|
return (() => {
|
|
84
82
|
let root_1ali9cs7 = template_1ali9cs8(), element_1ali9cs9 = root_1ali9cs7.firstChild, element_1ali9csa = element_1ali9cs9.firstElementChild;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer components{.toaster{--opacity:0;--stack-span:50%;--stack-translate:0 calc(var(--stack-shift) * -1);--translate:var(--translate-x) var(--translate-y);--translate-x:0px;--translate-y:0px}.toaster--e,.toaster--n,.toaster:not([class*=toaster--]),.toaster--ne,.toaster--nw,.toaster--s,.toaster--se,.toaster--sw,.toaster--w{--opacity:1;--stack-span:100%}.toaster--
|
|
1
|
+
@layer components{.toaster{--opacity:0;--stack-span:50%;--stack-translate:0 calc(var(--stack-shift) * -1);--translate:var(--translate-x) var(--translate-y);--translate-x:0px;--translate-y:0px}.toaster--e{--stack-translate:calc(var(--stack-shift) * -1) 0;--translate-x:calc(100% + var(--margin-horizontal));--translate-y:0px}.toaster--e,.toaster--n,.toaster:not([class*=toaster--]),.toaster--ne,.toaster--nw,.toaster--s,.toaster--se,.toaster--sw,.toaster--w{--opacity:1;--stack-span:100%}.toaster--n,.toaster:not([class*=toaster--]),.toaster--ne,.toaster--nw{--stack-translate:0 var(--stack-shift);--translate-x:0px;--translate-y:calc(-100% - var(--margin-vertical))}.toaster--s,.toaster--se,.toaster--sw{--stack-translate:0 calc(var(--stack-shift) * -1);--translate-x:0px;--translate-y:calc(100% + var(--margin-vertical))}.toaster--w{--stack-translate:var(--stack-shift) 0;--translate-x:calc(-100% - var(--margin-horizontal));--translate-y:0px}.toast{--depth:min(var(--toast-index), var(--toast-limit) - 1);--fling-duration:.5s;--stack-shift:calc(var(--toast-frontmost-height) + var(--depth) * var(--stack-peek) - var(--toast-scale) * var(--toast-height));--stack-translate:0 var(--stack-shift);--toast-bleed:32px;--toast-content-gap:var(--size-300);--toast-content-opacity:1;--toast-duration:0s;--toast-exit-duration:var(--duration-slow-exit);--toast-exit-timing-function:var(--easing-spring);--toast-expanded-y:calc((var(--toast-offset-y) + var(--toast-index) * var(--toast-gap)) * var(--toast-direction));--toast-height:0px;--toast-index:0;--toast-offset-y:0px;--toast-scale:pow(var(--stack-scale), var(--depth));--toast-seconds:0;--toast-swipe-x:0px;--toast-swipe-y:0px}@media (prefers-reduced-motion:reduce){.toast{--fling-duration:0s}}.toast-close.button{--background-default:var(--surface-background-default);--background-hover:var(--surface-background-hover);--border-radius:999px;--box-shadow-default:0 0 0 var(--border-width-400) var(--surface-border-hover);--color-default:var(--color-text-300);--color-hover:var(--color-text-500);--icon-size:var(--size-200);--offset:calc(var(--size-200) * -1);--padding-horizontal:0px;--padding-vertical:0px;--size:var(--size-500)}.toaster{--margin-horizontal:var(--size-500);--margin-vertical:var(--size-500);--stack-peek:var(--size-300);--stack-scale:.94;--toast-anchor-height:0px;--toast-count:0;--toast-direction:1;--toast-frontmost-height:0px;--toast-gap:var(--size-300);--toast-hidden:0;--toast-limit:3;--toast-overflow-peek:24px;--toast-stack-height:0px;--toast-transition-duration:var(--duration-slow);--toast-transition-timing-function:var(--easing-spring-bounce);--toast-width:360px}.toaster--s,.toaster--se,.toaster--sw{--toast-direction:-1}@property --toast-progress{syntax:"<number>";inherits:true;initial-value:0}.toaster{height:max(0px, var(--toast-frontmost-height) + (min(var(--toast-count), var(--toast-limit)) - 1) * var(--stack-peek) + min(1, var(--toast-hidden)) * var(--toast-overflow-peek));inset:var(--margin-vertical) var(--margin-horizontal) auto auto;transition:translate var(--toast-transition-duration) var(--toast-transition-timing-function);width:min(var(--toast-width), 100% - var(--margin-horizontal) * 2);z-index:9999;position:fixed}.toaster--e{inset:50% var(--margin-horizontal) auto auto;translate:0 calc(var(--toast-anchor-height) / -2)}.toaster--e>.toast{--stack-translate:calc(var(--stack-shift) * -1) calc((var(--toast-frontmost-height) - var(--toast-height)) / 2);transform-origin:100%}.toaster--e>.toaster-overflow{translate:calc(((var(--toast-limit) - 1) * var(--stack-peek) + var(--toast-overflow-peek)) * -1) 0}.toaster--e,.toaster--w{height:var(--toast-frontmost-height)}.toaster--e>.toast,.toaster--w>.toast{--stack-shift:calc(var(--depth) * var(--stack-peek) + (1 - var(--toast-scale)) * var(--stack-span))}.toaster--e>.toast.toast--behind,.toaster--w>.toast.toast--behind{clip-path:inset(calc((100% - var(--toast-frontmost-height)) / 2) calc(var(--toast-bleed) * -1))}.toaster--e>.toaster-overflow,.toaster--w>.toaster-overflow{height:calc(var(--toast-frontmost-height) * pow(var(--stack-scale), var(--toast-limit)));bottom:auto;left:0;right:0;top:calc(var(--toast-frontmost-height) * (1 - pow(var(--stack-scale), var(--toast-limit))) / 2);writing-mode:vertical-rl}.toaster--n{inset:var(--margin-vertical) auto auto 50%;translate:-50%}.toaster--ne{inset:var(--margin-vertical) var(--margin-horizontal) auto auto}.toaster--nw{inset:var(--margin-vertical) auto auto var(--margin-horizontal)}.toaster--s{inset:auto auto var(--margin-vertical) 50%;translate:-50%}.toaster--s>.toast,.toaster--se>.toast,.toaster--sw>.toast{--stack-translate:0 calc(var(--stack-shift) * -1);transform-origin:bottom;top:auto;bottom:0}.toaster--s>.toast.toast--behind,.toaster--se>.toast.toast--behind,.toaster--sw>.toast.toast--behind{clip-path:inset(calc(var(--toast-bleed) * -1) calc(var(--toast-bleed) * -1) calc(100% - var(--toast-frontmost-height)))}.toaster--s>.toaster-overflow,.toaster--se>.toaster-overflow,.toaster--sw>.toaster-overflow{align-items:flex-start;top:auto;bottom:0}.toaster--se{inset:auto var(--margin-horizontal) var(--margin-vertical) auto}.toaster--sw{inset:auto auto var(--margin-vertical) var(--margin-horizontal)}.toaster--w{inset:50% auto auto var(--margin-horizontal);translate:0 calc(var(--toast-anchor-height) / -2)}.toaster--w>.toast{--stack-translate:var(--stack-shift) calc((var(--toast-frontmost-height) - var(--toast-height)) / 2);transform-origin:0}.toaster--w>.toaster-overflow{translate:calc((var(--toast-limit) - 1) * var(--stack-peek) + var(--toast-overflow-peek)) 0;align-items:flex-start}.toaster>.toast{clip-path:inset(calc(var(--toast-bleed) * -1));scale:var(--toast-scale);touch-action:none;transform:translate(var(--toast-swipe-x), var(--toast-swipe-y));transform-origin:top;transition:clip-path var(--toast-transition-duration) var(--toast-transition-timing-function), opacity var(--toast-transition-duration) var(--toast-transition-timing-function), scale var(--toast-transition-duration) var(--toast-transition-timing-function), transform var(--toast-transition-duration) var(--toast-transition-timing-function), translate var(--toast-transition-duration) var(--toast-transition-timing-function);translate:var(--stack-translate);-webkit-user-select:none;user-select:none;z-index:calc(9999 - var(--toast-index));inset-inline:0;position:absolute;top:0}.toaster>.toast.toast--behind{--toast-content-opacity:0;clip-path:inset(calc(100% - var(--toast-frontmost-height)) calc(var(--toast-bleed) * -1) calc(var(--toast-bleed) * -1))}.toaster>.toast.toast--hidden{opacity:0}.toaster>.toast.toast--timed{animation:toast-timer var(--toast-duration) linear forwards}.toaster>.toaster-overflow{height:var(--toast-frontmost-height);inset-inline:calc((1 - pow(var(--stack-scale), var(--toast-limit))) * 50%);line-height:var(--toast-overflow-peek);opacity:min(1, var(--toast-hidden));pointer-events:none;transition:opacity var(--toast-transition-duration) var(--toast-transition-timing-function), translate var(--toast-transition-duration) var(--toast-transition-timing-function);translate:0 calc(((var(--toast-limit) - 1) * var(--stack-peek) + var(--toast-overflow-peek)) * var(--toast-direction));z-index:calc(9999 - var(--toast-limit));justify-content:center;align-items:flex-end;display:flex;position:absolute;top:0}.toaster:is(:hover,:focus-within)>.toast,.toaster>.toast.toast--behind,.toaster>.toast.toast--swiping{animation-play-state:paused}.toaster:is(:hover,:focus-within){height:max(0px, var(--toast-stack-height) + (var(--toast-count) - 1) * var(--toast-gap))}.toaster:is(:hover,:focus-within)>.toast{--toast-content-opacity:1;opacity:1;scale:1;translate:0 var(--toast-expanded-y)}.toaster:is(:hover,:focus-within)>.toast,.toaster:is(:hover,:focus-within)>.toast.toast--behind{clip-path:inset(calc(var(--toast-bleed) * -1))}.toaster:is(:hover,:focus-within)>.toaster-overflow{opacity:0}.toaster>.toast.toast--ending{animation:toast-exit var(--toast-exit-duration) var(--toast-exit-timing-function) forwards;pointer-events:none}.toaster>.toast.toast--ending.toast--flung{animation-name:toast-fling}.toaster>.toast.toast--ending.toast--flung.toast--timed{animation-name:toast-timer,toast-fling}.toaster>.toast.toast--ending.toast--timed{animation:toast-timer var(--toast-duration) linear forwards paused, toast-exit var(--toast-exit-duration) var(--toast-exit-timing-function) forwards}.toaster>.toast.toast--swiping{transition:none}@starting-style{.toaster>.toast{opacity:0;scale:1;transform:translate(var(--translate-x), var(--translate-y))}}.toast-close-icon{height:var(--icon-size);width:var(--icon-size)}.toast-close.button{height:var(--size);opacity:var(--toast-content-opacity);inset-inline-end:var(--offset);top:var(--offset);width:var(--size);z-index:1;position:absolute}.toast-content{align-items:center;gap:var(--toast-content-gap);min-width:0;opacity:var(--toast-content-opacity);display:flex}@media (prefers-reduced-motion:reduce){.toaster{--translate-x:0px;--translate-y:0px}.toaster>.toast{transition:none}.toaster>.toast.toast--ending{animation-name:toast-fade}.toaster>.toast.toast--ending.toast--timed{animation-name:toast-timer,toast-fade}}@keyframes toast-exit{to{opacity:0;transform:translate(calc(var(--toast-swipe-x) + var(--translate-x)), calc(var(--toast-swipe-y) + var(--translate-y)))}}@keyframes toast-fade{to{opacity:0}}@keyframes toast-fling{to{transform:translate(calc(var(--toast-swipe-x) + var(--translate-x)), calc(var(--toast-swipe-y) + var(--translate-y)))}}@keyframes toast-timer{0%{--toast-progress:0}to{--toast-progress:1}}}
|
|
2
2
|
/*$vite$:1*/
|
|
@@ -260,7 +260,9 @@ function createMenu(context = false) {
|
|
|
260
260
|
enabled(node)[0]?.button?.focus();
|
|
261
261
|
}
|
|
262
262
|
function instant() {
|
|
263
|
-
return !root.panel
|
|
263
|
+
return !root.panel
|
|
264
|
+
|| parseFloat(getComputedStyle(root.panel).getPropertyValue('--open-duration')) === 0
|
|
265
|
+
|| matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
264
266
|
}
|
|
265
267
|
function open(focus = true) {
|
|
266
268
|
stay();
|