@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,5 +1,8 @@
|
|
|
1
|
-
@use '/shared';
|
|
2
1
|
@use '/tokens';
|
|
2
|
+
@use 'css-utilities/absolute';
|
|
3
|
+
@use 'css-utilities/layer';
|
|
4
|
+
@use 'css-utilities/surface';
|
|
5
|
+
@use 'css-utilities/text';
|
|
3
6
|
@use 'variables';
|
|
4
7
|
|
|
5
8
|
// Typed, so the canvas can transition it and JS hears it change.
|
|
@@ -35,8 +38,10 @@
|
|
|
35
38
|
|
|
36
39
|
// Geometry is written every pointer move, so only the lift eases: a scale and the fade of a second shadow, both
|
|
37
40
|
// composited rather than repainted per frame.
|
|
41
|
+
// A surface of its own, so its background is a level above whatever it floats over.
|
|
38
42
|
&-surface {
|
|
39
|
-
|
|
43
|
+
@extend %surface-raised-level;
|
|
44
|
+
background: var(--surface-background-default);
|
|
40
45
|
border-radius: var(--surface-border-radius);
|
|
41
46
|
box-shadow: 0 0 0 1px var(--surface-border-color), var(--surface-box-shadow);
|
|
42
47
|
display: flex;
|
|
@@ -62,10 +67,39 @@
|
|
|
62
67
|
display: flex;
|
|
63
68
|
flex: 1;
|
|
64
69
|
flex-direction: column;
|
|
65
|
-
gap:
|
|
70
|
+
gap: var(--size-100);
|
|
66
71
|
min-height: 0;
|
|
67
72
|
overflow: hidden;
|
|
68
|
-
padding: 0
|
|
73
|
+
padding: 0 var(--size-400) var(--size-400);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&-handle {
|
|
77
|
+
align-self: stretch;
|
|
78
|
+
border-radius: 0 var(--surface-border-radius) 0 0;
|
|
79
|
+
cursor: inherit;
|
|
80
|
+
flex-shrink: 0;
|
|
81
|
+
position: relative;
|
|
82
|
+
width: var(--surface-grip-width);
|
|
83
|
+
|
|
84
|
+
&::before {
|
|
85
|
+
background: currentColor;
|
|
86
|
+
border-radius: 999px;
|
|
87
|
+
content: '';
|
|
88
|
+
height: 2px;
|
|
89
|
+
left: 50%;
|
|
90
|
+
opacity: 0.7;
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: 50%;
|
|
93
|
+
translate: -50% -50%;
|
|
94
|
+
width: 18px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Alone in the header it is the whole bar, grip centred.
|
|
98
|
+
&:only-child {
|
|
99
|
+
border-radius: var(--surface-border-radius) var(--surface-border-radius) 0 0;
|
|
100
|
+
flex: 1;
|
|
101
|
+
margin-inline-start: calc(var(--size-400) * -1);
|
|
102
|
+
}
|
|
69
103
|
}
|
|
70
104
|
|
|
71
105
|
&-handle,
|
|
@@ -78,7 +112,7 @@
|
|
|
78
112
|
|
|
79
113
|
&:focus-visible {
|
|
80
114
|
outline: 2px solid oklch(from var(--color) l c h / 0.4);
|
|
81
|
-
outline-offset: -
|
|
115
|
+
outline-offset: calc(var(--size-100) / -4);
|
|
82
116
|
}
|
|
83
117
|
}
|
|
84
118
|
|
|
@@ -88,9 +122,9 @@
|
|
|
88
122
|
cursor: var(--surface-header-cursor);
|
|
89
123
|
display: flex;
|
|
90
124
|
flex-shrink: 0;
|
|
91
|
-
gap:
|
|
125
|
+
gap: calc(var(--size-100) / 2);
|
|
92
126
|
min-height: var(--surface-handle-height);
|
|
93
|
-
padding-inline-start:
|
|
127
|
+
padding-inline-start: var(--size-400);
|
|
94
128
|
touch-action: none;
|
|
95
129
|
}
|
|
96
130
|
|
|
@@ -102,35 +136,6 @@
|
|
|
102
136
|
transition: opacity var(--surface-lift-duration) ease;
|
|
103
137
|
}
|
|
104
138
|
|
|
105
|
-
&-handle {
|
|
106
|
-
align-self: stretch;
|
|
107
|
-
border-radius: 0 var(--surface-border-radius) 0 0;
|
|
108
|
-
cursor: inherit;
|
|
109
|
-
flex-shrink: 0;
|
|
110
|
-
position: relative;
|
|
111
|
-
width: var(--surface-grip-width);
|
|
112
|
-
|
|
113
|
-
&::before {
|
|
114
|
-
background: currentColor;
|
|
115
|
-
border-radius: 999px;
|
|
116
|
-
content: '';
|
|
117
|
-
height: 2px;
|
|
118
|
-
left: 50%;
|
|
119
|
-
opacity: 0.7;
|
|
120
|
-
position: absolute;
|
|
121
|
-
top: 50%;
|
|
122
|
-
translate: -50% -50%;
|
|
123
|
-
width: 18px;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// Alone in the header it is the whole bar, grip centred.
|
|
127
|
-
&:only-child {
|
|
128
|
-
border-radius: var(--surface-border-radius) var(--surface-border-radius) 0 0;
|
|
129
|
-
flex: 1;
|
|
130
|
-
margin-inline-start: -16px;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
139
|
// Two diagonal ticks in the corner, drawn with a gradient so no icon is needed.
|
|
135
140
|
&-resize {
|
|
136
141
|
background:
|
|
@@ -151,12 +156,12 @@
|
|
|
151
156
|
@extend %text-truncate;
|
|
152
157
|
color: var(--surface-title-color);
|
|
153
158
|
flex: 0 1 auto;
|
|
154
|
-
font-weight: 600;
|
|
159
|
+
font-weight: var(--font-weight-600);
|
|
155
160
|
min-width: 0;
|
|
156
|
-
}
|
|
157
161
|
|
|
158
|
-
|
|
159
|
-
|
|
162
|
+
& + .surface-field-surface-handle {
|
|
163
|
+
margin-inline-start: auto;
|
|
164
|
+
}
|
|
160
165
|
}
|
|
161
166
|
}
|
|
162
167
|
|
|
@@ -5,18 +5,17 @@
|
|
|
5
5
|
--color: var(--color-text-500);
|
|
6
6
|
// Read by JS: 1 draws a still texture, as the 'still' option does.
|
|
7
7
|
--still: 0;
|
|
8
|
-
--surface-background: var(--color-white-300);
|
|
9
8
|
--surface-body-color: var(--color-text-300);
|
|
10
9
|
--surface-body-font-size: calc(var(--font-size-400) * 0.8125);
|
|
11
|
-
--surface-border-color:
|
|
10
|
+
--surface-border-color: var(--surface-border-default);
|
|
12
11
|
--surface-border-radius: 14px;
|
|
13
|
-
--surface-box-shadow: 0 1px 2px oklch(from var(--
|
|
14
|
-
--surface-box-shadow-active: 0 2px 4px oklch(from var(--
|
|
15
|
-
--surface-grip-color: var(--color-
|
|
12
|
+
--surface-box-shadow: 0 1px 2px oklch(from var(--surface-shadow-color) l c h / calc(alpha * 0.6)), 0 8px 24px -8px oklch(from var(--surface-shadow-color) l c h / calc(alpha * 1.55));
|
|
13
|
+
--surface-box-shadow-active: 0 2px 4px oklch(from var(--surface-shadow-color) l c h / calc(alpha * 0.8)), 0 20px 40px -12px oklch(from var(--surface-shadow-color) l c h / calc(alpha * 2.7));
|
|
14
|
+
--surface-grip-color: var(--color-primary-300);
|
|
16
15
|
--surface-grip-width: 32px;
|
|
17
16
|
--surface-handle-height: 28px;
|
|
18
17
|
--surface-header-cursor: grab;
|
|
19
|
-
--surface-lift-duration:
|
|
18
|
+
--surface-lift-duration: var(--duration-moderate);
|
|
20
19
|
--surface-lift-opacity: 0;
|
|
21
20
|
--surface-title-color: var(--color-text-500);
|
|
22
21
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
@use '/shared';
|
|
2
1
|
@use '/tokens';
|
|
2
|
+
@use 'css-utilities/reset';
|
|
3
3
|
@use 'variables';
|
|
4
4
|
|
|
5
5
|
.tasklist {
|
|
@@ -9,6 +9,23 @@
|
|
|
9
9
|
gap: var(--gap);
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
// Numbered by task position, not DOM position, so a step keeps its number after moving
|
|
13
|
+
&--plan {
|
|
14
|
+
.tasklist-item {
|
|
15
|
+
counter-set: tasklist var(--index);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.tasklist-label::before {
|
|
19
|
+
color: var(--color);
|
|
20
|
+
content: counter(tasklist, decimal-leading-zero);
|
|
21
|
+
font-family: var(--font-family);
|
|
22
|
+
font-size: var(--font-size);
|
|
23
|
+
font-variant-numeric: tabular-nums;
|
|
24
|
+
font-weight: var(--font-weight);
|
|
25
|
+
margin-right: var(--gap);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
12
29
|
// '--line-height' comes from the row, so the box centers on the first line of the label
|
|
13
30
|
&-checkbox {
|
|
14
31
|
margin-top: calc((var(--line-height) - var(--size)) / 2);
|
|
@@ -24,7 +41,7 @@
|
|
|
24
41
|
color: var(--color);
|
|
25
42
|
display: block;
|
|
26
43
|
font-size: var(--font-size);
|
|
27
|
-
margin-top:
|
|
44
|
+
margin-top: calc(var(--size-100) / 4);
|
|
28
45
|
}
|
|
29
46
|
|
|
30
47
|
&-item {
|
|
@@ -81,21 +98,4 @@
|
|
|
81
98
|
transition: opacity var(--transition-duration) var(--timing-function);
|
|
82
99
|
}
|
|
83
100
|
}
|
|
84
|
-
|
|
85
|
-
// Numbered by task position, not DOM position, so a step keeps its number after moving
|
|
86
|
-
&--plan {
|
|
87
|
-
.tasklist-item {
|
|
88
|
-
counter-set: tasklist var(--index);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.tasklist-label::before {
|
|
92
|
-
color: var(--color);
|
|
93
|
-
content: counter(tasklist, decimal-leading-zero);
|
|
94
|
-
font-family: var(--font-family);
|
|
95
|
-
font-size: var(--font-size);
|
|
96
|
-
font-variant-numeric: tabular-nums;
|
|
97
|
-
font-weight: var(--font-weight);
|
|
98
|
-
margin-right: var(--gap);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
101
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
@use '/tokens';
|
|
2
|
+
@use 'css-utilities/background';
|
|
3
|
+
@use 'css-utilities/font/geist';
|
|
2
4
|
|
|
3
5
|
// Shared by every part so the check, strike, and fade stay in sequence
|
|
4
6
|
.tasklist {
|
|
5
|
-
--check-duration:
|
|
6
|
-
--gap:
|
|
7
|
-
--strike-duration:
|
|
7
|
+
--check-duration: var(--duration-fast);
|
|
8
|
+
--gap: calc(var(--size-100) / 4);
|
|
9
|
+
--strike-duration: var(--duration-moderate);
|
|
8
10
|
--timing-function: cubic-bezier(0.65, 0, 0.35, 1);
|
|
9
11
|
|
|
10
12
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -13,11 +15,20 @@
|
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
|
|
18
|
+
&--plan .tasklist-label::before {
|
|
19
|
+
@extend %font-geist-mono;
|
|
20
|
+
--color: var(--color-text-300);
|
|
21
|
+
--font-size: var(--font-size-200);
|
|
22
|
+
--font-weight: var(--font-weight-500);
|
|
23
|
+
--gap: calc(var(--size-300) / 2);
|
|
24
|
+
}
|
|
25
|
+
|
|
16
26
|
&-checkbox {
|
|
17
|
-
--background-active: var(--color-
|
|
18
|
-
--border-color-active: var(--color-
|
|
19
|
-
--border-color-default: var(--
|
|
27
|
+
--background-active: var(--color-primary-500);
|
|
28
|
+
--border-color-active: var(--color-primary-500);
|
|
29
|
+
--border-color-default: var(--surface-border-hover);
|
|
20
30
|
--border-width: var(--border-width-400);
|
|
31
|
+
--indicator-color-default: var(--color-surface);
|
|
21
32
|
--size: var(--size-500);
|
|
22
33
|
}
|
|
23
34
|
|
|
@@ -33,10 +44,10 @@
|
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
&-item {
|
|
36
|
-
|
|
37
|
-
--background-default: transparent;
|
|
47
|
+
@extend %background-state;
|
|
38
48
|
// Tints the default instead of replacing it, so an opaque row stays opaque while hovered
|
|
39
|
-
--background-hover: color-mix(in oklch, var(--color-
|
|
49
|
+
--background-hover: color-mix(in oklch, var(--color-primary-500) 3%, var(--background-default));
|
|
50
|
+
--background-pressed: var(--background-hover);
|
|
40
51
|
--border-radius: var(--border-radius-400);
|
|
41
52
|
// Read by JS: the slide that carries a row to its new place. Spring with stiffness 320 and damping 30,
|
|
42
53
|
// sampled across its 500ms settle
|
|
@@ -45,10 +56,9 @@
|
|
|
45
56
|
// The strike and fade wait on the check while it draws
|
|
46
57
|
--strike-delay: 0s;
|
|
47
58
|
--strike-length: 0%;
|
|
48
|
-
--transition-duration: 150ms;
|
|
49
59
|
|
|
50
|
-
|
|
51
|
-
--
|
|
60
|
+
&--checking {
|
|
61
|
+
--strike-delay: var(--check-duration);
|
|
52
62
|
}
|
|
53
63
|
|
|
54
64
|
&:has(.checkbox-tag:checked) {
|
|
@@ -59,10 +69,6 @@
|
|
|
59
69
|
}
|
|
60
70
|
}
|
|
61
71
|
|
|
62
|
-
&--checking {
|
|
63
|
-
--strike-delay: var(--check-duration);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
72
|
@media (prefers-reduced-motion: reduce) {
|
|
67
73
|
--move-duration: 0ms;
|
|
68
74
|
}
|
|
@@ -71,25 +77,24 @@
|
|
|
71
77
|
&-label {
|
|
72
78
|
--color: var(--color-text-500);
|
|
73
79
|
--font-weight: var(--font-weight-500);
|
|
74
|
-
--strike-color: var(--
|
|
80
|
+
--strike-color: var(--surface-border-hover);
|
|
75
81
|
--strike-width: 2px;
|
|
76
82
|
}
|
|
77
83
|
|
|
78
84
|
&-row {
|
|
79
85
|
--font-size: var(--font-size-400);
|
|
80
|
-
--gap:
|
|
86
|
+
--gap: var(--size-200);
|
|
81
87
|
--line-height: var(--size-500);
|
|
82
88
|
--padding-horizontal: var(--size-100);
|
|
83
89
|
--padding-vertical: var(--size-100);
|
|
84
90
|
|
|
85
91
|
&--sortable {
|
|
86
92
|
&::before {
|
|
87
|
-
--background: var(--color-
|
|
93
|
+
--background: var(--color-primary-300);
|
|
88
94
|
--opacity: var(--opacity-default);
|
|
89
95
|
--opacity-default: 0;
|
|
90
96
|
--opacity-hover: 1;
|
|
91
|
-
--size:
|
|
92
|
-
--transition-duration: 150ms;
|
|
97
|
+
--size: var(--size-400);
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
@include tokens.state(hover) {
|
|
@@ -99,12 +104,4 @@
|
|
|
99
104
|
}
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
|
-
|
|
103
|
-
&--plan .tasklist-label::before {
|
|
104
|
-
--color: var(--color-text-300);
|
|
105
|
-
--font-family: var(--font-family-mono);
|
|
106
|
-
--font-size: var(--font-size-200);
|
|
107
|
-
--font-weight: var(--font-weight-500);
|
|
108
|
-
--gap: 6px;
|
|
109
|
-
}
|
|
110
107
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
+
import './scss/index.scss';
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
type Mode = 'dark' | 'light';
|
|
@@ -13,6 +14,8 @@ type Store = {
|
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
|
|
17
|
+
const ATTRIBUTE = 'data-theme';
|
|
18
|
+
|
|
16
19
|
const KEY = 'theme';
|
|
17
20
|
|
|
18
21
|
const PREFERENCES: readonly unknown[] = ['dark', 'light', 'system'];
|
|
@@ -20,6 +23,18 @@ const PREFERENCES: readonly unknown[] = ['dark', 'light', 'system'];
|
|
|
20
23
|
const QUERY = '(prefers-color-scheme: dark)';
|
|
21
24
|
|
|
22
25
|
|
|
26
|
+
// 'system' leaves <html> bare, so the stylesheet's own prefers-color-scheme default shows.
|
|
27
|
+
function apply(preference: Preference) {
|
|
28
|
+
let root = document.documentElement;
|
|
29
|
+
|
|
30
|
+
if (preference === 'system') {
|
|
31
|
+
root.removeAttribute(ATTRIBUTE);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
root.setAttribute(ATTRIBUTE, preference);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
23
38
|
function system(dark: boolean): Mode {
|
|
24
39
|
return dark ? 'dark' : 'light';
|
|
25
40
|
}
|
|
@@ -38,15 +53,13 @@ export default (store?: Store) => {
|
|
|
38
53
|
(value) => {
|
|
39
54
|
if (!touched && PREFERENCES.includes(value)) {
|
|
40
55
|
state.preference = value as Preference;
|
|
56
|
+
apply(state.preference);
|
|
41
57
|
}
|
|
42
58
|
},
|
|
43
59
|
() => {}
|
|
44
60
|
);
|
|
45
61
|
|
|
46
62
|
return {
|
|
47
|
-
get class() {
|
|
48
|
-
return `--theme-${this.mode}`;
|
|
49
|
-
},
|
|
50
63
|
get mode(): Mode {
|
|
51
64
|
return state.preference === 'system' ? state.system : state.preference;
|
|
52
65
|
},
|
|
@@ -56,6 +69,7 @@ export default (store?: Store) => {
|
|
|
56
69
|
set(preference: Preference) {
|
|
57
70
|
touched = true;
|
|
58
71
|
state.preference = preference;
|
|
72
|
+
apply(preference);
|
|
59
73
|
|
|
60
74
|
if (preference === 'system') {
|
|
61
75
|
void store?.delete(KEY);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@use 'variables';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@use '/shared';
|
|
4
|
+
@use '/tokens';
|
|
5
|
+
@use 'css-utilities/surface';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
// Each color role and weight as one 'light-dark()' of its light and dark values; a role with a single color has no
|
|
9
|
+
// weights.
|
|
10
|
+
@function schemes($themes) {
|
|
11
|
+
$colors: ();
|
|
12
|
+
|
|
13
|
+
@each $role, $weights in map.get($themes, light, color) {
|
|
14
|
+
@if meta.type-of($weights) == 'map' {
|
|
15
|
+
@each $weight, $light in $weights {
|
|
16
|
+
$dark: map.get($themes, dark, color, $role, $weight);
|
|
17
|
+
$colors: map.set($colors, $role, $weight, light-dark($light, $dark));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
@else {
|
|
21
|
+
$colors: map.set($colors, $role, light-dark($weights, map.get($themes, dark, color, $role)));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@return $colors;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// A text weight from the theme's text, holding the mode's text step contrast against it, lighter or darker.
|
|
29
|
+
// Luminance is taken as lightness cubed, exact for a neutral and close for text's faint tint, so the step solves in
|
|
30
|
+
// closed form where the color is used. Chroma fades toward the end the weight moves to, never above 400's.
|
|
31
|
+
@function text-weight($direction, $mode) {
|
|
32
|
+
$step: map.get(tokens.$themes, $mode, text);
|
|
33
|
+
$l: 'pow(max(0, (pow(l, 3) + 0.05) / #{$step} - 0.05), 1 / 3)';
|
|
34
|
+
$fade: '#{$l} / max(l, 0.01)';
|
|
35
|
+
|
|
36
|
+
@if $direction == lighter {
|
|
37
|
+
$l: 'min(1, pow(#{$step} * (pow(l, 3) + 0.05) - 0.05, 1 / 3))';
|
|
38
|
+
$fade: '(1 - #{$l}) / max(1 - l, 0.01)';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@return 'oklch(from var(--color-text) #{$l} calc(c * min(1, #{$fade})) h)';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
// Unregistered custom properties keep 'light-dark()' unresolved, so it picks a side where it is used, by that element's
|
|
46
|
+
// color-scheme; colors declared on the root, such as '--surface-shadow-color', follow every subtree's mode too.
|
|
47
|
+
:root {
|
|
48
|
+
@include shared.css-variables(color, schemes(tokens.$themes));
|
|
49
|
+
// The page is level 0 of the surface ladder.
|
|
50
|
+
@include surface.surface-colors;
|
|
51
|
+
@include surface.surface-shadow(0);
|
|
52
|
+
@include surface.surface-shadows;
|
|
53
|
+
|
|
54
|
+
@include shared.color-weights(
|
|
55
|
+
primary,
|
|
56
|
+
map.get(tokens.$themes, light, surface, color),
|
|
57
|
+
map.get(tokens.$themes, dark, surface, color)
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
--background: var(--surface-background-default);
|
|
61
|
+
--color: var(--color-text-400);
|
|
62
|
+
// The text is 400; 300 is muted, toward the page, and 500 strongest, away from it: lighter and darker in light,
|
|
63
|
+
// the reverse in dark.
|
|
64
|
+
--color-text-300: light-dark(#{text-weight(lighter, light)}, #{text-weight(darker, dark)});
|
|
65
|
+
|
|
66
|
+
--color-text-400: var(--color-text);
|
|
67
|
+
--color-text-500: light-dark(#{text-weight(darker, light)}, #{text-weight(lighter, dark)});
|
|
68
|
+
color-scheme: light dark;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Set on <html> by 'theme()' to pin the page; any element can carry it to pin its subtree.
|
|
72
|
+
[data-theme='dark'] {
|
|
73
|
+
color-scheme: dark;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
[data-theme='light'] {
|
|
77
|
+
color-scheme: light;
|
|
78
|
+
}
|