@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
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { component, html, type Attributes } from '@esportsplus/template';
|
|
2
|
+
import { flush, reactive } from '@esportsplus/reactivity';
|
|
3
|
+
import faces from '~/components/button/faces';
|
|
4
|
+
import dismiss from '~/shared/dismiss';
|
|
5
|
+
import monitor from '@esportsplus/ui/svg/monitor.svg';
|
|
6
|
+
import moon from '@esportsplus/ui/svg/moon.svg';
|
|
7
|
+
import sun from '@esportsplus/ui/svg/sun.svg';
|
|
8
|
+
import type { Mode, Preference } from '~/components/theme';
|
|
9
|
+
import '~/components/button/scss/index.scss';
|
|
10
|
+
import './scss/index.scss';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const TOGGLE_OPTION = Symbol.for('@esportsplus/ui/theme-picker.toggle.option');
|
|
14
|
+
|
|
15
|
+
const TOGGLE_TRIGGER = Symbol.for('@esportsplus/ui/theme-picker.toggle.trigger');
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
type A = Attributes & {
|
|
19
|
+
mode: Theme;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type Choice = {
|
|
23
|
+
icon: string;
|
|
24
|
+
label: string;
|
|
25
|
+
value: Preference;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type T = A & {
|
|
29
|
+
[TOGGLE_OPTION]?: Attributes;
|
|
30
|
+
[TOGGLE_TRIGGER]?: Attributes;
|
|
31
|
+
onconnect?: never;
|
|
32
|
+
ondocumentclick?: never;
|
|
33
|
+
onkeydown?: never;
|
|
34
|
+
onpointerenter?: never;
|
|
35
|
+
onpointerleave?: never;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// The slice of a 'theme()' instance the pickers read and drive.
|
|
39
|
+
type Theme = {
|
|
40
|
+
readonly mode: Mode;
|
|
41
|
+
readonly preference: Preference;
|
|
42
|
+
set(preference: Preference): void;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
const CHOICES: Choice[] = [
|
|
47
|
+
{ icon: sun, label: 'Light', value: 'light' },
|
|
48
|
+
{ icon: moon, label: 'Dark', value: 'dark' },
|
|
49
|
+
{ icon: monitor, label: 'System', value: 'system' }
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
function choice(mode: Theme) {
|
|
54
|
+
return CHOICES.find((choice) => choice.value === mode.preference) ?? CHOICES[2];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function icon(id: string) {
|
|
58
|
+
return html`<svg aria-hidden='true' class='theme-picker-icon'><use href='#${id}' /></svg>`;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Chosen-ness lives in 'aria-checked' alone: '--active' on a tooltip trigger means its tooltip is showing.
|
|
62
|
+
function radio(mode: Theme, choice: Choice) {
|
|
63
|
+
return {
|
|
64
|
+
'aria-checked': () => mode.preference === choice.value ? 'true' : 'false',
|
|
65
|
+
onclick: () => mode.set(choice.value),
|
|
66
|
+
role: 'radio',
|
|
67
|
+
type: 'button'
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
// Miniature pages, System split diagonally between the two.
|
|
73
|
+
const cards = component(({ mode, ...attributes }: A) => html`
|
|
74
|
+
<div aria-label='Theme' class='theme-picker-cards' role='radiogroup' ${attributes}>
|
|
75
|
+
${CHOICES.map((choice) => html`
|
|
76
|
+
<button class='theme-picker-cards-option' ${radio(mode, choice)}>
|
|
77
|
+
<span class='theme-picker-cards-preview theme-picker-cards-preview--${choice.value}'>
|
|
78
|
+
<span class='theme-picker-cards-preview-bar'></span>
|
|
79
|
+
<span class='theme-picker-cards-preview-line'></span>
|
|
80
|
+
<span class='theme-picker-cards-preview-line theme-picker-cards-preview-line--short'></span>
|
|
81
|
+
</span>
|
|
82
|
+
<span class='theme-picker-cards-label'>${choice.label}</span>
|
|
83
|
+
</button>
|
|
84
|
+
`)}
|
|
85
|
+
</div>
|
|
86
|
+
`);
|
|
87
|
+
|
|
88
|
+
// Round swatches, System split down the middle.
|
|
89
|
+
const swatches = component(({ mode, ...attributes }: A) => html`
|
|
90
|
+
<div aria-label='Theme' class='theme-picker-swatches' role='radiogroup' ${attributes}>
|
|
91
|
+
${CHOICES.map((choice) => html`
|
|
92
|
+
<button class='theme-picker-swatches-option' ${radio(mode, choice)}>
|
|
93
|
+
<span class='theme-picker-swatches-circle theme-picker-swatches-circle--${choice.value}'></span>
|
|
94
|
+
<span class='theme-picker-swatches-label'>${choice.label}</span>
|
|
95
|
+
</button>
|
|
96
|
+
`)}
|
|
97
|
+
</div>
|
|
98
|
+
`);
|
|
99
|
+
|
|
100
|
+
// The current choice's icon. Hovering or clicking morphs it into a row of every choice laid over the button, the
|
|
101
|
+
// current one where the button's icon was, the way a select menu opens over its value; picking one, clicking outside,
|
|
102
|
+
// Escape or the pointer leaving closes it again.
|
|
103
|
+
const toggle = component(({ mode, ...attributes }: T) => {
|
|
104
|
+
let options: HTMLElement[] = [],
|
|
105
|
+
state = reactive({ active: false }),
|
|
106
|
+
trigger: HTMLElement | undefined;
|
|
107
|
+
|
|
108
|
+
function close(focus = false) {
|
|
109
|
+
state.active = false;
|
|
110
|
+
|
|
111
|
+
if (focus) {
|
|
112
|
+
trigger?.focus();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// A keyboard open moves focus into the row once it is no longer inert.
|
|
117
|
+
function open(focus = false) {
|
|
118
|
+
state.active = true;
|
|
119
|
+
|
|
120
|
+
if (focus) {
|
|
121
|
+
flush();
|
|
122
|
+
options[CHOICES.indexOf(choice(mode))]?.focus();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return html`
|
|
127
|
+
<div
|
|
128
|
+
class='theme-picker-toggle'
|
|
129
|
+
${attributes}
|
|
130
|
+
${{
|
|
131
|
+
class: () => state.active && '--active',
|
|
132
|
+
ondocumentclick: dismiss(() => state.active, () => close()),
|
|
133
|
+
onkeydown: (event: KeyboardEvent) => {
|
|
134
|
+
if (!state.active) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (event.key === 'Escape') {
|
|
139
|
+
event.stopPropagation();
|
|
140
|
+
close(true);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
let step = event.key === 'ArrowRight' ? 1 : event.key === 'ArrowLeft' ? -1 : 0;
|
|
145
|
+
|
|
146
|
+
if (!step) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
let i = options.indexOf(document.activeElement as HTMLElement),
|
|
151
|
+
n = options.length;
|
|
152
|
+
|
|
153
|
+
event.preventDefault();
|
|
154
|
+
options[((i === -1 ? CHOICES.indexOf(choice(mode)) : i) + step + n) % n]?.focus();
|
|
155
|
+
},
|
|
156
|
+
// Touch has no hover to leave, so a tap opens through the click alone.
|
|
157
|
+
onpointerenter: (event: PointerEvent) => {
|
|
158
|
+
if (event.pointerType !== 'touch') {
|
|
159
|
+
open();
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
onpointerleave: (event: PointerEvent) => {
|
|
163
|
+
if (event.pointerType !== 'touch') {
|
|
164
|
+
close();
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
style: () => `--index: ${CHOICES.indexOf(choice(mode))};`
|
|
168
|
+
}}
|
|
169
|
+
>
|
|
170
|
+
<button
|
|
171
|
+
aria-haspopup='true'
|
|
172
|
+
class='button button--feedback theme-picker-toggle-trigger'
|
|
173
|
+
type='button'
|
|
174
|
+
${attributes[TOGGLE_TRIGGER]}
|
|
175
|
+
${{
|
|
176
|
+
'aria-expanded': () => state.active ? 'true' : 'false',
|
|
177
|
+
'aria-label': () => `Theme: ${choice(mode).label}`,
|
|
178
|
+
onclick: (event: MouseEvent) => {
|
|
179
|
+
if (state.active) {
|
|
180
|
+
close();
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
open(event.detail === 0);
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
onconnect: (element: HTMLElement) => {
|
|
187
|
+
trigger = element;
|
|
188
|
+
}
|
|
189
|
+
}}
|
|
190
|
+
>
|
|
191
|
+
${faces(() => choice(mode).value, CHOICES.map((choice) => ({
|
|
192
|
+
content: '',
|
|
193
|
+
icon: () => icon(choice.icon),
|
|
194
|
+
key: choice.value
|
|
195
|
+
})))}
|
|
196
|
+
</button>
|
|
197
|
+
|
|
198
|
+
<div
|
|
199
|
+
aria-label='Theme'
|
|
200
|
+
class='theme-picker-toggle-menu'
|
|
201
|
+
role='radiogroup'
|
|
202
|
+
${{ inert: () => !state.active }}
|
|
203
|
+
>
|
|
204
|
+
${CHOICES.map((choice, i) => html`
|
|
205
|
+
<button
|
|
206
|
+
aria-label='${choice.label}'
|
|
207
|
+
class='theme-picker-toggle-option'
|
|
208
|
+
title='${choice.label}'
|
|
209
|
+
${attributes[TOGGLE_OPTION]}
|
|
210
|
+
${radio(mode, choice)}
|
|
211
|
+
${{
|
|
212
|
+
onclick: () => {
|
|
213
|
+
mode.set(choice.value);
|
|
214
|
+
close(true);
|
|
215
|
+
},
|
|
216
|
+
onconnect: (element: HTMLElement) => {
|
|
217
|
+
options[i] = element;
|
|
218
|
+
}
|
|
219
|
+
}}
|
|
220
|
+
>
|
|
221
|
+
${icon(choice.icon)}
|
|
222
|
+
</button>
|
|
223
|
+
`)}
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
`;
|
|
227
|
+
}, { option: TOGGLE_OPTION, trigger: TOGGLE_TRIGGER });
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
export default { cards, swatches, toggle };
|
|
231
|
+
export type { Theme };
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
@use 'css-utilities/surface';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
%theme-picker-reset {
|
|
6
|
+
background: transparent;
|
|
7
|
+
border: 0;
|
|
8
|
+
color: inherit;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
font: inherit;
|
|
11
|
+
padding: 0;
|
|
12
|
+
|
|
13
|
+
&:focus-visible {
|
|
14
|
+
outline: 2px solid var(--color-blue-400);
|
|
15
|
+
outline-offset: calc(var(--size-100) / 4);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
.theme-picker {
|
|
21
|
+
&-cards {
|
|
22
|
+
display: flex;
|
|
23
|
+
gap: var(--size-300);
|
|
24
|
+
|
|
25
|
+
&-label {
|
|
26
|
+
color: var(--color-text-300);
|
|
27
|
+
font-size: var(--font-size-200);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-option {
|
|
31
|
+
@extend %theme-picker-reset;
|
|
32
|
+
display: grid;
|
|
33
|
+
gap: var(--size-200);
|
|
34
|
+
justify-items: center;
|
|
35
|
+
|
|
36
|
+
&[aria-checked='true'] .theme-picker-cards-label {
|
|
37
|
+
--font-weight: var(--font-weight-500);
|
|
38
|
+
color: var(--color-text-500);
|
|
39
|
+
font-weight: var(--font-weight);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&[aria-checked='true'] .theme-picker-cards-preview {
|
|
43
|
+
outline: 2px solid var(--color-blue-400);
|
|
44
|
+
outline-offset: calc(var(--size-100) / 4);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&-preview {
|
|
49
|
+
border: 1px solid var(--surface-border-default);
|
|
50
|
+
border-radius: var(--border-radius-300);
|
|
51
|
+
display: grid;
|
|
52
|
+
gap: calc(var(--size-200) / 2);
|
|
53
|
+
height: 48px;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
padding: 7px;
|
|
56
|
+
width: 64px;
|
|
57
|
+
|
|
58
|
+
&--dark {
|
|
59
|
+
--bar: var(--color-white-300);
|
|
60
|
+
background: var(--color-black-400);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&--light {
|
|
64
|
+
--bar: var(--color-black-300);
|
|
65
|
+
background: var(--color-white-300);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&--system {
|
|
69
|
+
--bar: color-mix(in oklab, var(--color-white-300), var(--color-black-400));
|
|
70
|
+
background: linear-gradient(135deg, var(--color-white-300) 50%, var(--color-black-400) 50%);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&-bar {
|
|
74
|
+
background: var(--bar);
|
|
75
|
+
border-radius: var(--border-radius-100);
|
|
76
|
+
height: 6px;
|
|
77
|
+
opacity: 0.8;
|
|
78
|
+
width: 60%;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&-line {
|
|
82
|
+
background: var(--bar);
|
|
83
|
+
border-radius: var(--border-radius-100);
|
|
84
|
+
height: 4px;
|
|
85
|
+
opacity: 0.35;
|
|
86
|
+
|
|
87
|
+
&--short {
|
|
88
|
+
width: 70%;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&-icon {
|
|
95
|
+
display: block;
|
|
96
|
+
fill: none;
|
|
97
|
+
flex-shrink: 0;
|
|
98
|
+
height: var(--size-400);
|
|
99
|
+
stroke: currentColor;
|
|
100
|
+
width: var(--size-400);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&-swatches {
|
|
104
|
+
display: flex;
|
|
105
|
+
gap: var(--size-500);
|
|
106
|
+
|
|
107
|
+
&-circle {
|
|
108
|
+
border: 1px solid var(--surface-border-hover);
|
|
109
|
+
border-radius: 50%;
|
|
110
|
+
display: block;
|
|
111
|
+
height: 36px;
|
|
112
|
+
width: 36px;
|
|
113
|
+
|
|
114
|
+
&--dark {
|
|
115
|
+
background: var(--color-black-400);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&--light {
|
|
119
|
+
background: var(--color-white-300);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&--system {
|
|
123
|
+
background: linear-gradient(90deg, var(--color-white-300) 50%, var(--color-black-400) 50%);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&-label {
|
|
128
|
+
color: var(--color-text-300);
|
|
129
|
+
font-size: var(--font-size-200);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&-option {
|
|
133
|
+
@extend %theme-picker-reset;
|
|
134
|
+
display: grid;
|
|
135
|
+
gap: var(--size-200);
|
|
136
|
+
justify-items: center;
|
|
137
|
+
|
|
138
|
+
&[aria-checked='true'] .theme-picker-swatches-circle {
|
|
139
|
+
box-shadow:
|
|
140
|
+
0 0 0 2px var(--surface-background-default),
|
|
141
|
+
0 0 0 4px var(--color-blue-400);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&[aria-checked='true'] .theme-picker-swatches-label {
|
|
145
|
+
--font-weight: var(--font-weight-500);
|
|
146
|
+
color: var(--color-text-500);
|
|
147
|
+
font-weight: var(--font-weight);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// The menu sits with the current option's centre on the trigger's.
|
|
153
|
+
&-toggle {
|
|
154
|
+
--trigger-size: 36px;
|
|
155
|
+
display: inline-flex;
|
|
156
|
+
position: relative;
|
|
157
|
+
|
|
158
|
+
// Every length the menu's width and the current option's centre are built from, so the closed clip can
|
|
159
|
+
// match the trigger's own box and opening reads as the button growing into the row. A surface, opening a
|
|
160
|
+
// level above whatever holds the toggle.
|
|
161
|
+
&-menu {
|
|
162
|
+
@extend %surface-raised-level;
|
|
163
|
+
--border-width: var(--border-width-400);
|
|
164
|
+
--center: calc(
|
|
165
|
+
var(--border-width) + var(--padding) + var(--index) * (var(--option-size) + var(--gap)) +
|
|
166
|
+
var(--option-size) / 2
|
|
167
|
+
);
|
|
168
|
+
--count: 3;
|
|
169
|
+
--gap: calc(var(--size-100) / 4);
|
|
170
|
+
--option-size: 28px;
|
|
171
|
+
--padding: calc(var(--size-300) / 4);
|
|
172
|
+
--width: calc(
|
|
173
|
+
var(--count) * var(--option-size) + (var(--count) - 1) * var(--gap) +
|
|
174
|
+
2 * (var(--padding) + var(--border-width))
|
|
175
|
+
);
|
|
176
|
+
background: var(--surface-background-default);
|
|
177
|
+
border: var(--border-width) solid var(--surface-border-default);
|
|
178
|
+
border-radius: 999px;
|
|
179
|
+
box-shadow: var(--surface-shadow-default);
|
|
180
|
+
clip-path: inset(
|
|
181
|
+
0
|
|
182
|
+
calc(var(--width) - var(--center) - var(--trigger-size) / 2)
|
|
183
|
+
0
|
|
184
|
+
calc(var(--center) - var(--trigger-size) / 2)
|
|
185
|
+
round var(--border-radius-400)
|
|
186
|
+
);
|
|
187
|
+
display: flex;
|
|
188
|
+
gap: var(--gap);
|
|
189
|
+
left: calc(var(--trigger-size) / 2 - var(--center));
|
|
190
|
+
opacity: 0;
|
|
191
|
+
padding: var(--padding);
|
|
192
|
+
position: absolute;
|
|
193
|
+
top: calc((var(--trigger-size) - var(--option-size)) / 2 - var(--padding) - var(--border-width));
|
|
194
|
+
transition:
|
|
195
|
+
clip-path var(--duration-moderate-exit) var(--easing-spring),
|
|
196
|
+
opacity var(--duration-fast) var(--easing-spring),
|
|
197
|
+
visibility 0s linear var(--duration-moderate-exit);
|
|
198
|
+
visibility: hidden;
|
|
199
|
+
width: var(--width);
|
|
200
|
+
z-index: 10;
|
|
201
|
+
|
|
202
|
+
.theme-picker-toggle.--active > & {
|
|
203
|
+
clip-path: inset(0 round 999px);
|
|
204
|
+
opacity: 1;
|
|
205
|
+
transition:
|
|
206
|
+
clip-path var(--duration-moderate) var(--easing-spring),
|
|
207
|
+
opacity var(--duration-fast-exit) var(--easing-spring);
|
|
208
|
+
visibility: visible;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@media (prefers-reduced-motion: reduce) {
|
|
212
|
+
&,
|
|
213
|
+
.theme-picker-toggle.--active > & {
|
|
214
|
+
transition: opacity var(--duration-fast) var(--easing-spring), visibility 0s linear var(--duration-fast);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// The current choice takes the filled active background rather than a check.
|
|
220
|
+
&-option {
|
|
221
|
+
@extend %theme-picker-reset;
|
|
222
|
+
align-items: center;
|
|
223
|
+
border-radius: 999px;
|
|
224
|
+
color: var(--color-text-300);
|
|
225
|
+
display: flex;
|
|
226
|
+
flex: 0 0 var(--option-size);
|
|
227
|
+
height: var(--option-size);
|
|
228
|
+
justify-content: center;
|
|
229
|
+
transition:
|
|
230
|
+
background-color var(--duration-fast) var(--easing-spring),
|
|
231
|
+
color var(--duration-fast) var(--easing-spring);
|
|
232
|
+
|
|
233
|
+
&:hover,
|
|
234
|
+
&[aria-checked='true'] {
|
|
235
|
+
color: var(--color-text-500);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
&[aria-checked='true'] {
|
|
239
|
+
background: var(--surface-background-active);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// The button's faces carry the blur swap; this only sizes and frames it, fading under the open menu.
|
|
244
|
+
&-trigger.button {
|
|
245
|
+
--background-hover: var(--surface-background-hover);
|
|
246
|
+
--border-color-default: var(--surface-border-default);
|
|
247
|
+
--border-radius: var(--border-radius-400);
|
|
248
|
+
--border-width: var(--border-width-400);
|
|
249
|
+
--color-default: var(--color-text-400);
|
|
250
|
+
--color-hover: var(--color-text-500);
|
|
251
|
+
--icon-size: var(--size-400);
|
|
252
|
+
--padding-horizontal: 0px;
|
|
253
|
+
--padding-vertical: 0px;
|
|
254
|
+
border: var(--border-width) solid var(--border-color);
|
|
255
|
+
height: var(--trigger-size);
|
|
256
|
+
transition: opacity var(--duration-fast) var(--easing-spring);
|
|
257
|
+
width: var(--trigger-size);
|
|
258
|
+
|
|
259
|
+
.theme-picker-toggle.--active > & {
|
|
260
|
+
opacity: 0;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
@@ -80,37 +80,35 @@ const UNPLACED: Edge = { x: 1, y: -1 };
|
|
|
80
80
|
function row(toast: Toast, layout: () => Layout, remove: (toast: Toast) => void) {
|
|
81
81
|
let element: HTMLElement | undefined,
|
|
82
82
|
frontmost = 0,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
release: (element, drag, dismiss) => {
|
|
103
|
-
local.swiping = false;
|
|
104
|
-
local.thrown = dismiss ? fling(element, drag) : null;
|
|
105
|
-
|
|
106
|
-
if (dismiss) {
|
|
107
|
-
toast.state.active = false;
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
83
|
+
gesture = drag({
|
|
84
|
+
// Swiped back toward the edges the stack is pinned to.
|
|
85
|
+
begin: (e, element) => e.button === 0 ? toward(edge(element.closest('.toaster') ?? element, 'toaster') ?? UNPLACED) : null,
|
|
86
|
+
capture: () => {
|
|
87
|
+
local.swiping = true;
|
|
88
|
+
},
|
|
89
|
+
move: (_, { x, y }) => {
|
|
90
|
+
local.swipe = { x, y };
|
|
91
|
+
},
|
|
92
|
+
// Dismissing, it is thrown on from where the pointer let go until it has left the screen; under reduced
|
|
93
|
+
// motion it fades there like any other exit.
|
|
94
|
+
release: (element, drag, dismiss) => {
|
|
95
|
+
local.swiping = false;
|
|
96
|
+
local.thrown = dismiss ? fling(element, drag) : null;
|
|
97
|
+
|
|
98
|
+
if (dismiss) {
|
|
99
|
+
toast.state.active = false;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
110
102
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
103
|
+
local.swipe = null;
|
|
104
|
+
}
|
|
105
|
+
}),
|
|
106
|
+
// 'swipe' is where a swipe holds it, 'thrown' the way a dismissing swipe flings it on.
|
|
107
|
+
local = reactive({ swipe: null as { x: number, y: number } | null, swiping: false, thrown: null as Fling | null }),
|
|
108
|
+
// Layout height, unaffected by the collapsed scale.
|
|
109
|
+
size = observeSize(({ height }) => {
|
|
110
|
+
toast.measured.height = height;
|
|
111
|
+
});
|
|
114
112
|
|
|
115
113
|
return html`
|
|
116
114
|
<div
|