@esportsplus/ui 0.59.1 → 0.61.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/.audit/audit.json +2810 -0
- package/.audit/check-scss.mjs +20 -0
- package/.audit/rules-audit.md +542 -0
- package/README.md +42 -31
- package/RULES.md +115 -0
- package/build/components/accordion/index.d.ts +12 -2175
- package/build/components/accordion/index.js +3 -4
- package/build/components/accordion/scss/index.scss +1 -1
- package/build/components/announcement/scss/index.scss +1 -1
- package/build/components/breadcrumb/index.js +47 -64
- package/build/components/breadcrumb/scss/index.scss +1 -1
- package/build/components/button/copy.d.ts +6 -4
- package/build/components/button/copy.js +24 -20
- package/build/components/button/faces.d.ts +0 -1
- package/build/components/button/faces.js +5 -6
- package/build/components/button/index.d.ts +3 -7
- package/build/components/button/index.js +3 -5
- package/build/components/button/kbd.d.ts +12 -8
- package/build/components/button/kbd.js +59 -74
- package/build/components/button/morph/index.d.ts +2169 -0
- package/build/components/button/morph/index.js +4 -0
- package/build/components/button/morph/save.d.ts +19 -0
- package/build/components/button/morph/save.js +57 -0
- package/build/components/button/morph/template.d.ts +22 -0
- package/build/components/button/morph/template.js +90 -0
- package/build/components/button/scss/index.scss +1 -1
- package/build/components/button/sidebar.js +2 -2
- package/build/components/button/split.d.ts +1 -1
- package/build/components/button/split.js +11 -15
- package/build/components/capslock/index.js +6 -5
- package/build/components/capslock/scss/index.scss +1 -1
- package/build/components/card/scss/index.scss +1 -1
- package/build/components/cc/index.js +103 -111
- package/build/components/cc/scss/index.scss +1 -1
- package/build/components/chat/index.d.ts +6 -0
- package/build/components/chat/index.js +3 -0
- package/build/components/chat/minimap/index.d.ts +52 -0
- package/build/components/chat/minimap/index.js +248 -0
- package/build/components/{chat-minimap/range.js → chat/minimap/model.js} +1 -1
- package/build/components/{chat-minimap → chat/minimap}/spy.d.ts +1 -1
- package/build/components/{chat-minimap → chat/minimap}/spy.js +1 -1
- package/build/components/checkbox/index.d.ts +1 -0
- package/build/components/checkbox/index.js +1 -0
- package/build/components/checkbox/options.d.ts +0 -1
- package/build/components/checkbox/options.js +0 -1
- package/build/components/checkbox/scss/index.scss +1 -1
- package/build/components/clipboard/index.d.ts +3 -2181
- package/build/components/clipboard/index.js +2 -3
- package/build/components/color-picker/index.d.ts +21 -0
- package/build/components/color-picker/index.js +153 -138
- package/build/components/color-picker/scss/index.scss +1 -1
- package/build/components/command/index.d.ts +6 -93
- package/build/components/command/index.js +4 -601
- package/build/components/command/palette.d.ts +103 -0
- package/build/components/command/palette.js +595 -0
- package/build/components/command/scss/index.scss +1 -1
- package/build/components/command/search.d.ts +37 -0
- package/build/components/command/search.js +67 -0
- package/build/components/counter/index.d.ts +15 -4
- package/build/components/counter/index.js +3 -2
- package/build/components/counter/scss/index.scss +1 -1
- package/build/components/datalist/scss/index.scss +1 -1
- package/build/components/dock/index.d.ts +24 -5
- package/build/components/dock/index.js +389 -51
- package/build/components/dock/scss/index.scss +1 -1
- package/build/components/editor/markdown/index.d.ts +3 -22
- package/build/components/editor/markdown/index.js +3 -30
- package/build/components/editor/markdown/render.js +3 -5
- package/build/components/editor/markdown/template.d.ts +22 -0
- package/build/components/editor/markdown/template.js +30 -0
- package/build/components/editor/tree/find.js +3 -3
- package/build/components/editor/tree/index.d.ts +3 -116
- package/build/components/editor/tree/index.js +3 -2225
- package/build/components/editor/tree/template.d.ts +116 -0
- package/build/components/editor/tree/template.js +2225 -0
- package/build/components/editor/viewer/index.d.ts +3 -26
- package/build/components/editor/viewer/index.js +3 -249
- package/build/components/editor/viewer/template.d.ts +26 -0
- package/build/components/editor/viewer/template.js +249 -0
- package/build/components/editor/workspace/index.d.ts +4 -65
- package/build/components/editor/workspace/index.js +4 -1228
- package/build/components/editor/workspace/model.d.ts +29 -37
- package/build/components/editor/workspace/model.js +186 -155
- package/build/components/editor/workspace/session.d.ts +3 -0
- package/build/components/editor/workspace/session.js +61 -34
- package/build/components/editor/workspace/shortcuts.d.ts +0 -2
- package/build/components/editor/workspace/shortcuts.js +0 -2
- package/build/components/editor/workspace/status.d.ts +4 -5
- package/build/components/editor/workspace/status.js +79 -61
- package/build/components/editor/workspace/statusbar.d.ts +5 -3
- package/build/components/editor/workspace/statusbar.js +66 -80
- package/build/components/editor/workspace/strip.d.ts +1 -2
- package/build/components/editor/workspace/strip.js +4 -3
- package/build/components/editor/workspace/tabs.d.ts +35 -3
- package/build/components/editor/workspace/tabs.js +75 -13
- package/build/components/editor/workspace/template.d.ts +65 -0
- package/build/components/editor/workspace/template.js +1145 -0
- package/build/components/error/scss/index.scss +1 -1
- package/build/components/filter/index.js +0 -3
- package/build/components/filter/scss/index.scss +1 -1
- package/build/components/form/index.d.ts +6 -32
- package/build/components/form/index.js +2 -1
- package/build/components/frame/scss/index.scss +1 -1
- package/build/components/grid/scss/index.scss +1 -1
- package/build/components/group/index.d.ts +12 -0
- package/build/components/group/index.js +15 -0
- package/build/components/group/scss/index.scss +2 -0
- package/build/components/heatmap/index.js +10 -32
- package/build/components/heatmap/scss/index.scss +1 -1
- package/build/components/highlight/index.d.ts +2 -3
- package/build/components/highlight/index.js +79 -78
- package/build/components/highlight/scss/index.scss +1 -1
- package/build/components/icon/index.d.ts +4 -3
- package/build/components/icon/index.js +2 -1
- package/build/components/icon/scss/index.scss +1 -1
- package/build/components/image/index.d.ts +3 -16
- package/build/components/image/index.js +2 -2
- package/build/components/image/scss/index.scss +1 -1
- package/build/components/index.d.ts +6 -4
- package/build/components/index.js +6 -4
- package/build/components/inline-edit/index.js +5 -4
- package/build/components/inline-edit/rich.js +79 -82
- package/build/components/inline-edit/scss/index.scss +1 -1
- package/build/components/inline-edit/status.js +4 -3
- package/build/components/input/scss/index.scss +1 -1
- package/build/components/input/tag.js +84 -67
- package/build/components/json/index.d.ts +4 -3
- package/build/components/json/index.js +2 -1
- package/build/components/link/scss/index.scss +1 -1
- package/build/components/loading/scss/index.scss +1 -1
- package/build/components/marquee/index.js +74 -71
- package/build/components/marquee/scss/index.scss +1 -1
- package/build/components/metric/flash.js +12 -11
- 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/toc.d.ts +8 -13
- package/build/components/nav/toc.js +9 -21
- package/build/components/nav/tree.d.ts +13 -14
- package/build/components/nav/tree.js +32 -19
- package/build/components/notification/index.d.ts +14 -3
- package/build/components/notification/index.js +4 -3
- 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/cards.d.ts +1 -0
- package/build/components/pagination/cards.js +4 -6
- package/build/components/pagination/scss/index.scss +1 -1
- package/build/components/panels/dnd.d.ts +47 -0
- package/build/components/panels/dnd.js +106 -0
- package/build/components/panels/group.d.ts +35 -0
- package/build/components/panels/group.js +319 -0
- package/build/components/panels/index.d.ts +25 -0
- package/build/components/panels/index.js +520 -0
- package/build/components/panels/model.d.ts +64 -0
- package/build/components/panels/model.js +446 -0
- package/build/components/panels/resize.d.ts +9 -0
- package/build/components/panels/resize.js +87 -0
- package/build/components/panels/scss/index.scss +2 -0
- package/build/components/panels/subtree.d.ts +3 -0
- package/build/components/panels/subtree.js +43 -0
- package/build/components/preview/buttons.d.ts +20 -0
- package/build/components/preview/buttons.js +26 -0
- package/build/components/{copy/index.d.ts → preview/code.d.ts} +3 -9
- package/build/components/preview/code.js +18 -0
- package/build/components/preview/header.d.ts +16 -0
- package/build/components/preview/header.js +18 -0
- package/build/components/preview/index.d.ts +8704 -0
- package/build/components/preview/index.js +123 -0
- package/build/components/preview/scss/index.scss +2 -0
- package/build/components/preview/source.d.ts +21 -0
- package/build/components/preview/source.js +76 -0
- package/build/components/preview/stage.d.ts +16 -0
- package/build/components/preview/stage.js +24 -0
- package/build/components/progress/scss/index.scss +1 -1
- package/build/components/progress/text.js +9 -11
- package/build/components/radio/index.d.ts +3 -2
- package/build/components/radio/index.js +2 -2
- package/build/components/range/filter.js +8 -9
- package/build/components/range/scss/index.scss +1 -1
- package/build/components/relative-time/index.js +4 -7
- package/build/components/relative-time/scss/index.scss +1 -1
- package/build/components/root/scss/index.scss +1 -1
- package/build/components/select/index.d.ts +1 -1
- package/build/components/select/index.js +72 -59
- package/build/components/select/scss/index.scss +1 -1
- package/build/components/shell/index.d.ts +22 -0
- package/build/components/shell/index.js +272 -0
- package/build/components/shell/scss/index.scss +2 -0
- package/build/components/shortcut-recorder/index.d.ts +2 -3
- package/build/components/shortcut-recorder/index.js +3 -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/scss/index.scss +1 -1
- package/build/components/story/index.d.ts +10 -6
- package/build/components/story/index.js +27 -47
- package/build/components/story/scss/index.scss +1 -1
- package/build/components/surface-field/index.js +13 -16
- package/build/components/surface-field/scss/index.scss +1 -1
- package/build/components/switch/index.d.ts +3 -2
- package/build/components/switch/index.js +2 -2
- package/build/components/tasklist/index.js +3 -1
- package/build/components/tasklist/scss/index.scss +1 -1
- package/build/components/textarea/scss/index.scss +1 -1
- package/build/components/theme/index.d.ts +6 -2
- package/build/components/theme/index.js +4 -3
- package/build/components/theme/scss/index.scss +1 -1
- package/build/components/theme-picker/cards.d.ts +13 -0
- package/build/components/theme-picker/cards.js +17 -0
- package/build/components/theme-picker/index.d.ts +9 -49
- package/build/components/theme-picker/index.js +5 -165
- package/build/components/theme-picker/scss/index.scss +1 -1
- package/build/components/theme-picker/shared.d.ts +26 -0
- package/build/components/theme-picker/shared.js +24 -0
- package/build/components/theme-picker/swatches.d.ts +13 -0
- package/build/components/theme-picker/swatches.js +17 -0
- package/build/components/theme-picker/toggle.d.ts +19 -0
- package/build/components/theme-picker/toggle.js +109 -0
- package/build/components/toast/index.js +10 -10
- package/build/components/toast/scss/index.scss +1 -1
- package/build/components/tooltip/menu.d.ts +2 -0
- package/build/components/tooltip/menu.js +88 -45
- package/build/components/tooltip/scss/index.scss +1 -1
- package/build/components/tooltip/shared.js +2 -2
- package/build/components/typewriter/rotate.js +7 -16
- package/build/components/typewriter/scss/index.scss +1 -1
- package/build/components/uptime/index.js +26 -33
- package/build/components/uptime/scss/index.scss +1 -1
- package/build/components/usage-meter/scss/index.scss +1 -1
- package/build/modifiers/background/scss/index.scss +2 -0
- package/build/modifiers/border/scss/index.scss +2 -0
- package/build/modifiers/box-shadow/scss/index.scss +2 -0
- package/build/modifiers/color/scss/index.scss +2 -0
- package/build/modifiers/scrollbar/scss/index.scss +1 -1
- package/build/shared/animation.js +1 -1
- package/build/shared/drag.d.ts +2 -1
- package/build/shared/drag.js +4 -3
- package/package.json +5 -5
- package/scripts/code-editor-services.test.mjs +1 -1
- package/scripts/code-editor-workspace.test.mjs +28 -18
- package/scripts/panels.test.mjs +262 -0
- package/scripts/workspace-keybindings.test.mjs +1 -1
- package/scripts/workspace-session.test.mjs +8 -6
- package/scripts/workspace-status.test.mjs +9 -1
- package/scripts/workspace-tabs.test.mjs +5 -5
- package/src/components/accordion/index.ts +11 -8
- package/src/components/accordion/scss/index.scss +15 -15
- package/src/components/accordion/scss/variables.scss +11 -7
- package/src/components/announcement/scss/index.scss +21 -24
- package/src/components/announcement/scss/variables.scss +13 -7
- package/src/components/breadcrumb/index.ts +8 -10
- package/src/components/breadcrumb/scss/index.scss +48 -122
- package/src/components/breadcrumb/scss/variables.scss +73 -55
- package/src/components/button/copy.ts +34 -27
- package/src/components/button/faces.ts +2 -4
- package/src/components/button/index.ts +3 -7
- package/src/components/button/kbd.ts +37 -95
- package/src/components/button/morph/index.ts +6 -0
- package/src/components/button/morph/save.ts +55 -0
- package/src/components/button/morph/template.ts +135 -0
- package/src/components/button/scss/index.scss +218 -99
- package/src/components/button/scss/variables.scss +160 -115
- package/src/components/button/sidebar.ts +6 -6
- package/src/components/button/split.ts +5 -6
- package/src/components/capslock/index.ts +9 -8
- package/src/components/capslock/scss/index.scss +21 -25
- package/src/components/capslock/scss/variables.scss +31 -12
- package/src/components/card/scss/index.scss +9 -24
- package/src/components/card/scss/variables.scss +29 -76
- package/src/components/cc/index.ts +15 -10
- package/src/components/cc/scss/index.scss +110 -153
- package/src/components/cc/scss/variables.scss +231 -44
- package/src/components/chat/index.ts +10 -0
- package/src/components/{chat-minimap → chat/minimap}/index.ts +66 -21
- package/src/components/{chat-minimap → chat/minimap}/scss/index.scss +26 -54
- package/src/components/chat/minimap/scss/variables.scss +178 -0
- package/src/components/{chat-minimap → chat/minimap}/spy.ts +1 -1
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/checkbox/options.ts +0 -1
- package/src/components/checkbox/scss/index.scss +25 -31
- package/src/components/checkbox/scss/variables.scss +50 -19
- package/src/components/clipboard/index.ts +4 -3
- package/src/components/color-picker/index.ts +131 -67
- package/src/components/color-picker/scss/index.scss +138 -221
- package/src/components/color-picker/scss/variables.scss +228 -81
- package/src/components/command/index.ts +5 -860
- package/src/components/command/palette.ts +879 -0
- package/src/components/command/scss/index.scss +82 -99
- package/src/components/command/scss/variables.scss +129 -50
- package/src/components/command/search.ts +67 -0
- package/src/components/counter/index.ts +90 -85
- package/src/components/counter/scss/index.scss +32 -41
- package/src/components/counter/scss/variables.scss +44 -16
- package/src/components/datalist/scss/index.scss +25 -25
- package/src/components/datalist/scss/variables.scss +21 -11
- package/src/components/dock/index.ts +505 -42
- package/src/components/dock/scss/index.scss +318 -73
- package/src/components/dock/scss/variables.scss +310 -39
- package/src/components/editor/code/features.ts +0 -1
- package/src/components/editor/code/find.ts +0 -1
- package/src/components/editor/code/keymap.ts +0 -1
- package/src/components/editor/code/scss/_editor.scss +12 -31
- package/src/components/editor/code/scss/_features.scss +12 -45
- package/src/components/editor/code/scss/_services.scss +15 -23
- package/src/components/editor/code/scss/index.scss +1 -1
- package/src/components/editor/code/scss/variables.scss +195 -42
- package/src/components/editor/code/view.ts +0 -1
- package/src/components/editor/diffs/scss/_diffs.scss +24 -77
- package/src/components/editor/diffs/scss/_merge.scss +5 -16
- package/src/components/editor/diffs/scss/index.scss +1 -1
- package/src/components/editor/diffs/scss/variables.scss +148 -11
- package/src/components/editor/markdown/index.ts +3 -67
- package/src/components/editor/markdown/render.ts +3 -6
- package/src/components/editor/markdown/scss/index.scss +30 -48
- package/src/components/editor/markdown/scss/variables.scss +117 -32
- package/src/components/editor/markdown/template.ts +69 -0
- package/src/components/editor/tree/drag.ts +5 -2
- package/src/components/editor/tree/find.ts +5 -4
- package/src/components/editor/tree/index.ts +3 -3434
- package/src/components/editor/tree/scss/index.scss +204 -262
- package/src/components/editor/tree/scss/variables.scss +198 -31
- package/src/components/editor/tree/template.ts +3436 -0
- package/src/components/editor/viewer/index.ts +3 -318
- package/src/components/editor/viewer/scss/_viewer.scss +15 -31
- package/src/components/editor/viewer/scss/index.scss +1 -1
- package/src/components/editor/viewer/scss/variables.scss +56 -14
- package/src/components/editor/viewer/template.ts +321 -0
- package/src/components/editor/workspace/index.ts +4 -1480
- package/src/components/editor/workspace/model.ts +225 -185
- package/src/components/editor/workspace/scss/_keybindings.scss +163 -0
- package/src/components/editor/workspace/scss/{status.scss → _status.scss} +11 -44
- package/src/components/editor/workspace/scss/_tabs.scss +57 -0
- package/src/components/editor/workspace/scss/index.scss +82 -312
- package/src/components/editor/workspace/scss/variables.scss +427 -0
- package/src/components/editor/workspace/session.ts +80 -44
- package/src/components/editor/workspace/shortcuts.ts +0 -2
- package/src/components/editor/workspace/status.ts +110 -80
- package/src/components/editor/workspace/statusbar.ts +38 -35
- package/src/components/editor/workspace/strip.ts +6 -5
- package/src/components/editor/workspace/tabs.ts +115 -15
- package/src/components/editor/workspace/template.ts +1486 -0
- package/src/components/error/index.ts +3 -0
- package/src/components/error/scss/index.scss +34 -65
- package/src/components/error/scss/variables.scss +28 -9
- package/src/components/filter/index.ts +2 -6
- package/src/components/filter/scss/index.scss +9 -2
- package/src/components/filter/scss/variables.scss +6 -6
- package/src/components/form/index.ts +4 -1
- package/src/components/frame/scss/index.scss +31 -42
- package/src/components/frame/scss/variables.scss +25 -18
- package/src/components/grid/scss/index.scss +2 -1
- package/src/components/group/index.ts +24 -0
- package/src/components/group/scss/index.scss +6 -0
- package/src/components/group/scss/variables.scss +4 -0
- package/src/components/heatmap/index.ts +14 -44
- package/src/components/heatmap/scss/index.scss +38 -44
- package/src/components/heatmap/scss/variables.scss +100 -59
- package/src/components/highlight/index.ts +133 -119
- package/src/components/highlight/scss/index.scss +49 -43
- package/src/components/highlight/scss/variables.scss +71 -30
- package/src/components/icon/index.ts +7 -5
- package/src/components/icon/scss/index.scss +7 -2
- package/src/components/icon/scss/variables.scss +2 -0
- package/src/components/image/index.ts +4 -2
- package/src/components/image/scss/index.scss +14 -22
- package/src/components/image/scss/variables.scss +30 -15
- package/src/components/index.ts +6 -4
- package/src/components/inline-edit/index.ts +3 -2
- package/src/components/inline-edit/rich.ts +17 -15
- package/src/components/inline-edit/scss/index.scss +165 -254
- package/src/components/inline-edit/scss/variables.scss +311 -83
- package/src/components/inline-edit/status.ts +2 -1
- package/src/components/input/scrub.ts +1 -1
- package/src/components/input/scss/_field.scss +1 -1
- package/src/components/input/scss/_scrub.scss +14 -25
- package/src/components/input/scss/_tag.scss +26 -46
- package/src/components/input/scss/variables.scss +167 -77
- package/src/components/input/tag.ts +59 -49
- package/src/components/json/index.ts +4 -1
- package/src/components/link/scss/index.scss +1 -4
- package/src/components/link/scss/variables.scss +5 -1
- package/src/components/loading/scss/index.scss +3 -23
- package/src/components/loading/scss/variables.scss +3 -6
- package/src/components/marquee/index.ts +33 -28
- package/src/components/marquee/scss/index.scss +32 -26
- package/src/components/marquee/scss/variables.scss +35 -23
- package/src/components/metric/flash.ts +2 -1
- package/src/components/metric/scss/_flash.scss +125 -145
- package/src/components/metric/scss/index.scss +31 -43
- package/src/components/metric/scss/variables.scss +192 -98
- package/src/components/nav/index.ts +1 -1
- package/src/components/nav/scss/index.scss +46 -49
- package/src/components/nav/scss/variables.scss +61 -64
- package/src/components/nav/spy.ts +2 -0
- package/src/components/nav/toc.ts +11 -31
- package/src/components/nav/tree.ts +56 -24
- package/src/components/notification/index.ts +94 -89
- package/src/components/notification/scss/index.scss +77 -76
- package/src/components/notification/scss/variables.scss +55 -38
- package/src/components/overlay/index.ts +3 -1
- package/src/components/overlay/scss/index.scss +94 -114
- package/src/components/overlay/scss/variables.scss +46 -18
- package/src/components/page/scss/variables.scss +1 -1
- package/src/components/pagination/cards.ts +2 -1
- package/src/components/pagination/scss/index.scss +191 -7
- package/src/components/pagination/scss/variables.scss +112 -36
- package/src/components/panels/dnd.ts +184 -0
- package/src/components/panels/group.ts +437 -0
- package/src/components/panels/index.ts +678 -0
- package/src/components/panels/model.ts +675 -0
- package/src/components/panels/resize.ts +131 -0
- package/src/components/panels/scss/index.scss +394 -0
- package/src/components/panels/scss/variables.scss +197 -0
- package/src/components/panels/subtree.ts +65 -0
- package/src/components/preview/buttons.ts +48 -0
- package/src/components/preview/code.ts +28 -0
- package/src/components/preview/header.ts +23 -0
- package/src/components/preview/index.ts +144 -0
- package/src/components/preview/scss/index.scss +143 -0
- package/src/components/preview/scss/variables.scss +127 -0
- package/src/components/preview/source.ts +73 -0
- package/src/components/preview/stage.ts +33 -0
- package/src/components/progress/scss/index.scss +117 -15
- package/src/components/progress/scss/variables.scss +140 -40
- package/src/components/progress/text.ts +5 -4
- package/src/components/radio/index.ts +2 -4
- package/src/components/range/filter.ts +7 -11
- package/src/components/range/scss/_filter.scss +301 -327
- package/src/components/range/scss/_slider.scss +31 -110
- package/src/components/range/scss/_vertical.scss +8 -20
- package/src/components/range/scss/index.scss +1 -4
- package/src/components/range/scss/variables.scss +374 -70
- package/src/components/relative-time/index.ts +9 -14
- package/src/components/relative-time/scss/index.scss +13 -21
- package/src/components/relative-time/scss/variables.scss +46 -29
- package/src/components/root/scss/index.scss +11 -20
- package/src/components/root/scss/variables.scss +17 -15
- package/src/components/select/index.ts +37 -15
- package/src/components/select/scss/index.scss +24 -51
- package/src/components/select/scss/variables.scss +77 -19
- package/src/components/shell/index.ts +321 -0
- package/src/components/shell/scss/index.scss +214 -0
- package/src/components/shell/scss/variables.scss +89 -0
- package/src/components/shortcut-recorder/index.ts +6 -3
- package/src/components/shortcut-recorder/scss/index.scss +71 -56
- package/src/components/shortcut-recorder/scss/variables.scss +47 -21
- package/src/components/sortable/index.ts +1 -0
- package/src/components/sortable/scss/index.scss +37 -42
- package/src/components/sortable/scss/variables.scss +76 -52
- package/src/components/sticky-header/scss/index.scss +11 -10
- package/src/components/sticky-header/scss/variables.scss +36 -4
- package/src/components/story/index.ts +1 -36
- package/src/components/story/scss/index.scss +22 -98
- package/src/components/story/scss/variables.scss +57 -15
- package/src/components/surface-field/index.ts +18 -20
- package/src/components/surface-field/scss/index.scss +32 -46
- package/src/components/surface-field/scss/variables.scss +92 -23
- package/src/components/switch/index.ts +2 -4
- package/src/components/tasklist/index.ts +8 -2
- package/src/components/tasklist/scss/index.scss +7 -7
- package/src/components/tasklist/scss/variables.scss +18 -13
- package/src/components/textarea/index.ts +1 -0
- package/src/components/textarea/scss/index.scss +9 -7
- package/src/components/textarea/scss/variables.scss +2 -2
- package/src/components/theme/index.ts +12 -4
- package/src/components/theme/scss/index.scss +13 -0
- package/src/components/theme/scss/variables.scss +5 -16
- package/src/components/theme-picker/cards.ts +19 -0
- package/src/components/theme-picker/index.ts +6 -225
- package/src/components/theme-picker/scss/index.scss +77 -167
- package/src/components/theme-picker/scss/variables.scss +220 -0
- package/src/components/theme-picker/shared.ts +54 -0
- package/src/components/theme-picker/swatches.ts +15 -0
- package/src/components/theme-picker/toggle.ts +150 -0
- package/src/components/toast/index.ts +14 -14
- package/src/components/toast/scss/index.scss +130 -155
- package/src/components/toast/scss/variables.scss +89 -52
- package/src/components/tooltip/menu.ts +77 -10
- package/src/components/tooltip/scss/_menu.scss +96 -138
- package/src/components/tooltip/scss/_shared.scss +93 -90
- package/src/components/tooltip/scss/index.scss +52 -54
- package/src/components/tooltip/scss/variables.scss +187 -67
- package/src/components/tooltip/shared.ts +8 -6
- package/src/components/typewriter/rotate.ts +15 -24
- package/src/components/typewriter/scss/index.scss +131 -3
- package/src/components/typewriter/scss/variables.scss +56 -44
- package/src/components/uptime/index.ts +1 -13
- package/src/components/uptime/scss/index.scss +28 -66
- package/src/components/uptime/scss/variables.scss +63 -48
- package/src/components/usage-meter/scss/index.scss +19 -19
- package/src/components/usage-meter/scss/variables.scss +80 -35
- package/src/css-utilities/absolute.scss +54 -52
- package/src/css-utilities/background.scss +22 -24
- package/src/css-utilities/border.scss +21 -21
- package/src/css-utilities/box-shadow.scss +32 -21
- package/src/css-utilities/color.scss +23 -21
- package/src/css-utilities/flex.scss +55 -53
- package/src/css-utilities/group.scss +7 -0
- package/src/css-utilities/hidden.scss +22 -20
- package/src/css-utilities/icon.scss +32 -30
- package/src/css-utilities/layer.scss +10 -10
- package/src/css-utilities/reset.scss +27 -16
- package/src/css-utilities/surface.scss +206 -128
- package/src/css-utilities/text.scss +114 -114
- package/src/modifiers/background/scss/index.scss +1 -0
- package/src/modifiers/background/scss/variables.scss +24 -0
- package/src/modifiers/border/scss/index.scss +1 -0
- package/src/modifiers/border/scss/variables.scss +21 -0
- package/src/modifiers/box-shadow/scss/index.scss +1 -0
- package/src/modifiers/box-shadow/scss/variables.scss +12 -0
- package/src/modifiers/color/scss/index.scss +1 -0
- package/src/modifiers/color/scss/variables.scss +10 -0
- package/src/modifiers/scrollbar/scss/index.scss +3 -2
- package/src/modifiers/scrollbar/scss/variables.scss +4 -3
- package/src/shared/animation.ts +3 -3
- package/src/shared/drag.ts +8 -3
- package/src/tokens/scss/color.scss +53 -37
- package/src/tokens/scss/index.scss +0 -1
- package/src/tokens/scss/state.scss +16 -1
- package/storage/svg/code.svg +1 -1
- package/storage/svg/collapse.svg +1 -0
- package/storage/svg/grid.svg +1 -0
- package/storage/svg/stack.svg +1 -0
- package/build/components/banner/scss/index.scss +0 -2
- package/build/components/button/fan.d.ts +0 -24
- package/build/components/button/fan.js +0 -118
- package/build/components/button/hold.d.ts +0 -31
- package/build/components/button/hold.js +0 -115
- package/build/components/button/icons.d.ts +0 -6
- package/build/components/button/icons.js +0 -35
- package/build/components/button/loading.d.ts +0 -22
- package/build/components/button/loading.js +0 -60
- package/build/components/button/morph.d.ts +0 -22
- package/build/components/button/morph.js +0 -115
- package/build/components/card/expand.d.ts +0 -22
- package/build/components/card/expand.js +0 -118
- package/build/components/card/index.d.ts +0 -6
- package/build/components/card/index.js +0 -4
- package/build/components/chat-minimap/index.d.ts +0 -28
- package/build/components/chat-minimap/index.js +0 -223
- package/build/components/chat-minimap/scss/index.scss +0 -2
- package/build/components/clipboard/copy.d.ts +0 -27
- package/build/components/clipboard/copy.js +0 -48
- package/build/components/copy/index.js +0 -61
- package/build/components/copy/scss/index.scss +0 -2
- package/build/components/highlight/easing.d.ts +0 -2
- package/build/components/highlight/easing.js +0 -19
- package/build/components/pull-to-refresh/index.d.ts +0 -18
- package/build/components/pull-to-refresh/index.js +0 -222
- package/build/components/pull-to-refresh/scss/index.scss +0 -2
- package/src/components/banner/scss/index.scss +0 -37
- package/src/components/banner/scss/variables.scss +0 -16
- package/src/components/button/fan.ts +0 -170
- package/src/components/button/hold.ts +0 -154
- package/src/components/button/icons.ts +0 -21
- package/src/components/button/loading.ts +0 -77
- package/src/components/button/morph.ts +0 -153
- package/src/components/button/scss/_fan.scss +0 -121
- package/src/components/button/scss/_kbd.scss +0 -11
- package/src/components/button/scss/_morph.scss +0 -107
- package/src/components/button/scss/_sidebar.scss +0 -61
- package/src/components/button/scss/_split.scss +0 -53
- package/src/components/card/expand.ts +0 -141
- package/src/components/card/index.ts +0 -8
- package/src/components/card/scss/_expand.scss +0 -234
- package/src/components/chat-minimap/scss/variables.scss +0 -97
- package/src/components/clipboard/copy.ts +0 -49
- package/src/components/copy/index.ts +0 -69
- package/src/components/copy/scss/index.scss +0 -52
- package/src/components/copy/scss/variables.scss +0 -19
- package/src/components/editor/workspace/scss/keybindings.scss +0 -190
- package/src/components/editor/workspace/scss/tabs.scss +0 -56
- package/src/components/highlight/easing.ts +0 -33
- package/src/components/pagination/scss/_arrows.scss +0 -69
- package/src/components/pagination/scss/_cards.scss +0 -121
- package/src/components/pagination/scss/_dots.scss +0 -64
- package/src/components/progress/scss/_text.scss +0 -135
- package/src/components/pull-to-refresh/index.ts +0 -316
- package/src/components/pull-to-refresh/scss/index.scss +0 -128
- package/src/components/pull-to-refresh/scss/variables.scss +0 -38
- package/src/components/typewriter/scss/_caret.scss +0 -34
- package/src/components/typewriter/scss/_retype.scss +0 -68
- package/src/components/typewriter/scss/_rotate.scss +0 -29
- package/src/tokens/scss/transition.scss +0 -21
- /package/build/components/{chat-minimap/range.d.ts → chat/minimap/model.d.ts} +0 -0
- /package/src/components/{chat-minimap/range.ts → chat/minimap/model.ts} +0 -0
|
@@ -3,9 +3,18 @@
|
|
|
3
3
|
@use 'sass:math';
|
|
4
4
|
@use 'sass:meta';
|
|
5
5
|
@use '../tokens/scss' as tokens;
|
|
6
|
+
@use './background';
|
|
7
|
+
@use './border';
|
|
8
|
+
@use './box-shadow';
|
|
9
|
+
@use './color';
|
|
6
10
|
|
|
7
11
|
|
|
8
|
-
// The
|
|
12
|
+
// The levels the style queries count through: the deepest a lowered layer sinks and the highest, where the dark steps
|
|
13
|
+
// top out.
|
|
14
|
+
$level-max: 6;
|
|
15
|
+
$level-min: -3;
|
|
16
|
+
|
|
17
|
+
// The shadow at each whole weight, 0 to 7, fractions blending between them, as two layers of y offset, blur, spread in px and opacity: Tailwind v4's
|
|
9
18
|
// 'shadow-2xs' through 'shadow-2xl', a missing second layer written as zeros. Every opacity runs at the mode's shadow
|
|
10
19
|
// 'opacity' in the theme's surface tokens over Tailwind's 10%.
|
|
11
20
|
$shadow-steps: (
|
|
@@ -28,9 +37,17 @@ $shadow-weight-max: list.length($shadow-steps) - 1;
|
|
|
28
37
|
@return math.div(map.get(tokens.$themes, $mode, surface, $key), 100);
|
|
29
38
|
}
|
|
30
39
|
|
|
31
|
-
// The lightness a level moves from the page in a mode: raised levels by one step,
|
|
40
|
+
// The lightness a level moves from the page in a mode: raised levels by one step, lowered ones by another, a single
|
|
41
|
+
// product when the two steps match.
|
|
32
42
|
@function level-offset($level, $mode) {
|
|
33
|
-
|
|
43
|
+
$lowered: ladder-step($mode, lowered);
|
|
44
|
+
$raised: ladder-step($mode, raised);
|
|
45
|
+
|
|
46
|
+
@if $lowered == $raised {
|
|
47
|
+
@return '#{$level} * #{$raised}';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@return 'max(#{$level}, 0) * #{$raised} + min(#{$level}, 0) * #{$lowered}';
|
|
34
51
|
}
|
|
35
52
|
|
|
36
53
|
// Light chroma at a new lightness, holding the origin's ratio of chroma to its distance from white: fading to none at
|
|
@@ -40,21 +57,57 @@ $shadow-weight-max: list.length($shadow-steps) - 1;
|
|
|
40
57
|
}
|
|
41
58
|
|
|
42
59
|
// The background at a level, stepped from the theme's surface by the ladder: light raised levels climb to white, where
|
|
43
|
-
// the shadow alone carries elevation, and dark ones stop
|
|
60
|
+
// the shadow alone carries elevation, and dark ones stop at the top level. Chroma keeps the page's tint on its hue,
|
|
44
61
|
// scaled with the distance from white in light and from black in dark.
|
|
45
62
|
@function surface-background($level) {
|
|
46
|
-
|
|
47
|
-
|
|
63
|
+
@return light-dark(#{surface-background-in($level, light)}, #{surface-background-in($level, dark)});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// The background at a level in one mode, for colors that read a different level in each.
|
|
67
|
+
@function surface-background-in($level, $mode) {
|
|
68
|
+
@if $mode == light {
|
|
69
|
+
$light: 'clamp(0, l + #{level-offset($level, light)}, 1)';
|
|
70
|
+
|
|
71
|
+
@return 'oklch(from var(--color-surface) #{$light} #{light-chroma($light)} h)';
|
|
72
|
+
}
|
|
48
73
|
|
|
74
|
+
$dark: 'clamp(0, l + #{level-offset($level, dark)}, l + #{$level-max * ladder-step(dark, raised)})';
|
|
75
|
+
|
|
76
|
+
@return 'oklch(from var(--color-surface) #{$dark} calc(c * #{$dark} / max(l, 0.01)) h)';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// A primary fill on the surface it sits on, at its offset level, so it reads as a quiet fill set into the light page
|
|
80
|
+
// and lifted off the dark one.
|
|
81
|
+
@function surface-primary() {
|
|
49
82
|
@return light-dark(
|
|
50
|
-
#{'
|
|
51
|
-
#{'
|
|
83
|
+
#{surface-background-in('calc(var(--surface-level) + #{surface-primary-offset(light)})', light)},
|
|
84
|
+
#{surface-background-in('calc(var(--surface-level) + #{surface-primary-offset(dark)})', dark)}
|
|
52
85
|
);
|
|
53
86
|
}
|
|
54
87
|
|
|
55
|
-
// The
|
|
88
|
+
// The levels a primary fill sits from its surface in a mode: the mode's 'primary', below it in light and above it in
|
|
89
|
+
// dark.
|
|
90
|
+
@function surface-primary-offset($mode) {
|
|
91
|
+
$levels: map.get(tokens.$themes, $mode, surface, primary);
|
|
92
|
+
|
|
93
|
+
@if $mode == light {
|
|
94
|
+
@return -$levels;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@return $levels;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// The shadow weight a primary fill takes in a mode on a layer at a level: the level it sits at, once lifted above the
|
|
101
|
+
// layer, and none when set into it.
|
|
102
|
+
@function surface-primary-weight($level, $mode) {
|
|
103
|
+
$offset: surface-primary-offset($mode);
|
|
104
|
+
|
|
105
|
+
@return math.clamp(0, $level + $offset, $level-max) * math.clamp(0, $offset, 1);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// A default background moved for a state, so it follows any background a component sets in its place: active and
|
|
56
109
|
// hover lighter, pressed darker, in both modes.
|
|
57
|
-
@function surface-shift($state) {
|
|
110
|
+
@function surface-shift($state, $base: 'var(--surface-background-default)') {
|
|
58
111
|
$sign: '+';
|
|
59
112
|
|
|
60
113
|
@if $state == 'pressed' {
|
|
@@ -62,17 +115,17 @@ $shadow-weight-max: list.length($shadow-steps) - 1;
|
|
|
62
115
|
}
|
|
63
116
|
|
|
64
117
|
@return light-dark(
|
|
65
|
-
#{'oklch(from
|
|
66
|
-
#{'oklch(from
|
|
118
|
+
#{'oklch(from #{$base} calc(l #{$sign} #{ladder-step(light, $state)}) c h)'},
|
|
119
|
+
#{'oklch(from #{$base} calc(l #{$sign} #{ladder-step(dark, $state)}) c h)'}
|
|
67
120
|
);
|
|
68
121
|
}
|
|
69
122
|
|
|
70
123
|
// A state's background moved by the mode's border step, darker in light and lighter in dark, so each border follows the
|
|
71
124
|
// background it edges in that state and stands out from it in both modes.
|
|
72
|
-
@function surface-border($state) {
|
|
125
|
+
@function surface-border($state, $background: 'var(--surface-background-#{$state})') {
|
|
73
126
|
@return light-dark(
|
|
74
|
-
#{'oklch(from
|
|
75
|
-
#{'oklch(from
|
|
127
|
+
#{'oklch(from #{$background} max(0, l - #{ladder-step(light, border)}) c h)'},
|
|
128
|
+
#{'oklch(from #{$background} min(1, l + #{ladder-step(dark, border)}) c h)'}
|
|
76
129
|
);
|
|
77
130
|
}
|
|
78
131
|
|
|
@@ -95,78 +148,86 @@ $shadow-weight-max: list.length($shadow-steps) - 1;
|
|
|
95
148
|
@return light-dark(#{shadow-color-in($background, light)}, #{shadow-color-in($background, dark)});
|
|
96
149
|
}
|
|
97
150
|
|
|
98
|
-
//
|
|
99
|
-
//
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
$
|
|
151
|
+
// The ladder's layers at a weight, held to the ladder: a whole weight reads its step, and a fraction blends each value
|
|
152
|
+
// of the two steps around it by how far it sits between them, so a weight such as 1.5 lands halfway from 1 to 2.
|
|
153
|
+
@function shadow-step($weight) {
|
|
154
|
+
$weight: math.clamp(0, $weight, $shadow-weight-max);
|
|
155
|
+
$lower: math.floor($weight);
|
|
156
|
+
$share: $weight - $lower;
|
|
103
157
|
|
|
104
|
-
@if
|
|
105
|
-
@return list.nth(
|
|
158
|
+
@if $share == 0 {
|
|
159
|
+
@return list.nth($shadow-steps, $lower + 1);
|
|
106
160
|
}
|
|
107
161
|
|
|
108
|
-
$
|
|
162
|
+
$from: list.nth($shadow-steps, $lower + 1);
|
|
163
|
+
$layers: ();
|
|
164
|
+
$to: list.nth($shadow-steps, $lower + 2);
|
|
165
|
+
|
|
166
|
+
@for $i from 1 through list.length($from) {
|
|
167
|
+
$values: ();
|
|
109
168
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
list.nth(list.nth(
|
|
169
|
+
@for $j from 1 through 4 {
|
|
170
|
+
$a: list.nth(list.nth($from, $i), $j);
|
|
171
|
+
$b: list.nth(list.nth($to, $i), $j);
|
|
113
172
|
|
|
114
|
-
|
|
115
|
-
$terms: '#{$terms} + #{$delta} * clamp(0, #{$weight} - #{$i - 2}, 1)';
|
|
173
|
+
$values: list.append($values, $a + ($b - $a) * $share, space);
|
|
116
174
|
}
|
|
175
|
+
|
|
176
|
+
$layers: list.append($layers, $values, comma);
|
|
117
177
|
}
|
|
118
178
|
|
|
119
|
-
@return
|
|
179
|
+
@return $layers;
|
|
120
180
|
}
|
|
121
181
|
|
|
122
182
|
// Both layers of the shadow at a weight, in a shadow color: by default the color of a shadow falling on the surface it
|
|
123
|
-
// is used in.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
$fixed: meta.type-of($weight) == 'number';
|
|
131
|
-
|
|
132
|
-
@for $i from 1 through 3 {
|
|
133
|
-
$length: shadow-value($layer, $i, $weight);
|
|
134
|
-
|
|
135
|
-
@if $fixed {
|
|
136
|
-
$length: $length * 1px;
|
|
137
|
-
}
|
|
138
|
-
@else {
|
|
139
|
-
$length: 'calc(#{$length} * 1px)';
|
|
140
|
-
}
|
|
183
|
+
// is used in. Given a mode, the layers show in that mode alone and go transparent in the other, so two modes' weights
|
|
184
|
+
// can share one shadow.
|
|
185
|
+
@function shadow($weight, $color: 'var(--surface-shadow-color)', $mode: null) {
|
|
186
|
+
@if meta.type-of($weight) != 'number' {
|
|
187
|
+
@error 'surface: a shadow weight is a number, not #{meta.inspect($weight)}';
|
|
188
|
+
}
|
|
141
189
|
|
|
142
|
-
|
|
143
|
-
}
|
|
190
|
+
$layers: ();
|
|
144
191
|
|
|
192
|
+
@each $layer in shadow-step($weight) {
|
|
145
193
|
// The step's opacity over a 10% step, the opacity the shadow color carries.
|
|
146
|
-
$
|
|
194
|
+
$fill: 'oklch(from #{$color} l c h / calc(alpha * #{list.nth($layer, 4) * 10}))';
|
|
147
195
|
|
|
148
|
-
@if $
|
|
149
|
-
$
|
|
196
|
+
@if $mode == light {
|
|
197
|
+
$fill: 'light-dark(#{$fill}, transparent)';
|
|
150
198
|
}
|
|
151
|
-
@else {
|
|
152
|
-
$
|
|
199
|
+
@else if $mode == dark {
|
|
200
|
+
$fill: 'light-dark(transparent, #{$fill})';
|
|
153
201
|
}
|
|
154
202
|
|
|
155
|
-
$
|
|
156
|
-
|
|
203
|
+
$layers: list.append(
|
|
204
|
+
$layers,
|
|
205
|
+
'0 #{list.nth($layer, 1) * 1px} #{list.nth($layer, 2) * 1px} #{list.nth($layer, 3) * 1px} #{$fill}'
|
|
206
|
+
);
|
|
157
207
|
}
|
|
158
208
|
|
|
159
209
|
@return list.join($layers, (), comma);
|
|
160
210
|
}
|
|
161
211
|
|
|
212
|
+
// The weights a layer's states take from its own: lifted one step on hover, settled one when pressed.
|
|
213
|
+
@function shadow-states($weight) {
|
|
214
|
+
@return (
|
|
215
|
+
default: $weight,
|
|
216
|
+
hover: math.min($weight + 1, $shadow-weight-max),
|
|
217
|
+
pressed: math.max($weight - 1, 0)
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
162
221
|
|
|
163
222
|
// A layer's colors, read from its level: 0 the page, each surface a level above the one it sits in, in the states
|
|
164
223
|
// components already name, following any background a component sets in its place. Active, hover and pressed step the
|
|
165
|
-
// background as 'surface-shift()' sets. Each state's border is that state's background moved by
|
|
166
|
-
// darker in light and lighter in dark.
|
|
167
|
-
//
|
|
224
|
+
// background, and the primary fill, as 'surface-shift()' sets. Each state's border is that state's background moved by
|
|
225
|
+
// the border step, darker in light and lighter in dark. Its shadows fall on the level below, the background a shadow
|
|
226
|
+
// casts on. Another level is never a color to paint: an element reaches it by extending '%surface' or one of its kin,
|
|
227
|
+
// or by setting '--surface-level' on one, so whatever sits in it reads its states from the level it shows.
|
|
168
228
|
@mixin surface-colors {
|
|
169
229
|
--surface-background-active: #{surface-shift('active')};
|
|
230
|
+
--surface-background-below: #{surface-background('calc(var(--surface-level) - 1)')};
|
|
170
231
|
--surface-background-default: #{surface-background('var(--surface-level)')};
|
|
171
232
|
--surface-background-hover: #{surface-shift('hover')};
|
|
172
233
|
--surface-background-pressed: #{surface-shift('pressed')};
|
|
@@ -174,93 +235,110 @@ $shadow-weight-max: list.length($shadow-steps) - 1;
|
|
|
174
235
|
--surface-border-default: #{surface-border('default')};
|
|
175
236
|
--surface-border-hover: #{surface-border('hover')};
|
|
176
237
|
--surface-border-pressed: #{surface-border('pressed')};
|
|
238
|
+
--surface-primary-active: #{surface-shift('active', 'var(--surface-primary-default)')};
|
|
239
|
+
--surface-primary-default: #{surface-primary()};
|
|
240
|
+
--surface-primary-hover: #{surface-shift('hover', 'var(--surface-primary-default)')};
|
|
241
|
+
--surface-primary-pressed: #{surface-shift('pressed', 'var(--surface-primary-default)')};
|
|
177
242
|
--surface-shadow-active: var(--surface-shadow-hover);
|
|
243
|
+
--surface-shadow-cast: #{shadow-color('var(--surface-background-below)')};
|
|
178
244
|
--surface-shadow-color: #{shadow-color('var(--surface-background-default)')};
|
|
179
245
|
}
|
|
180
246
|
|
|
181
|
-
// A layer's
|
|
182
|
-
// to choose another step without moving the level.
|
|
247
|
+
// A layer's shadows at a weight, a step on the ladder, cast on what it sits in. Each surface sets them from its level;
|
|
248
|
+
// include it on a surface to choose another step without moving the level.
|
|
183
249
|
@mixin surface-shadow($weight) {
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// A layer's shadows at its weight, cast on what it sits in, a level below: lifted one step on hover and while active,
|
|
188
|
-
// settled one when pressed.
|
|
189
|
-
@mixin surface-shadows {
|
|
190
|
-
--surface-shadow-cast: #{shadow-color(surface-background('calc(var(--surface-level) - 1)'))};
|
|
191
|
-
--surface-shadow-default: #{shadow('var(--surface-shadow-weight)', 'var(--surface-shadow-cast)')};
|
|
192
|
-
--surface-shadow-hover: #{
|
|
193
|
-
shadow('min(var(--surface-shadow-weight) + 1, #{$shadow-weight-max})', 'var(--surface-shadow-cast)')
|
|
194
|
-
};
|
|
195
|
-
--surface-shadow-pressed: #{shadow('max(var(--surface-shadow-weight) - 1, 0)', 'var(--surface-shadow-cast)')};
|
|
250
|
+
@each $state, $step in shadow-states($weight) {
|
|
251
|
+
--surface-shadow-#{$state}: #{shadow($step, 'var(--surface-shadow-cast)')};
|
|
252
|
+
}
|
|
196
253
|
}
|
|
197
254
|
|
|
255
|
+
// A primary fill's shadows on a layer at a level, at each mode's weight, the two modes' layers stacked where they
|
|
256
|
+
// differ.
|
|
257
|
+
@mixin surface-primary-shadows($level) {
|
|
258
|
+
$dark: shadow-states(surface-primary-weight($level, dark));
|
|
259
|
+
$light: shadow-states(surface-primary-weight($level, light));
|
|
198
260
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
261
|
+
@each $state, $weight in $light {
|
|
262
|
+
@if $weight == map.get($dark, $state) {
|
|
263
|
+
--box-shadow-#{$state}: #{shadow($weight)};
|
|
264
|
+
}
|
|
265
|
+
@else {
|
|
266
|
+
--box-shadow-#{$state}: #{list.join(shadow($weight, $mode: light), shadow(map.get($dark, $state), $mode: dark))};
|
|
267
|
+
}
|
|
268
|
+
}
|
|
202
269
|
}
|
|
203
270
|
|
|
204
|
-
// A layer a level above or below whatever it sits in, counted and colored without being painted: for components that
|
|
205
|
-
// route their background and shadow through their own variables, pointing them at '--surface-background-*' and
|
|
206
|
-
// '--surface-shadow-*'. A sunken layer is recessed, so it casts no shadow.
|
|
207
|
-
%surface-raised-level,
|
|
208
|
-
%surface-sunken-level {
|
|
209
|
-
@include surface-colors;
|
|
210
|
-
@include surface-shadows;
|
|
211
|
-
}
|
|
212
271
|
|
|
213
|
-
%surface
|
|
214
|
-
|
|
215
|
-
|
|
272
|
+
%surface {
|
|
273
|
+
// The weights a layer keeps when no query matches it, past either end of the ladder: a raised layer already at the
|
|
274
|
+
// top keeps the top level's weight, and the others cast no shadow.
|
|
275
|
+
&,
|
|
276
|
+
&-lower {
|
|
277
|
+
@include surface-shadow(0);
|
|
278
|
+
}
|
|
216
279
|
|
|
217
|
-
//
|
|
218
|
-
//
|
|
219
|
-
//
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
--surface-level: #{$level + 1};
|
|
226
|
-
@include surface-shadow(math.max($level + 1, 0));
|
|
227
|
-
}
|
|
280
|
+
// A layer counted and colored from its level without being painted: it sets '--surface-level' and the
|
|
281
|
+
// '--surface-*' colors and shadows read from it, and leaves painting to '%background-surface', '%border-surface' and
|
|
282
|
+
// '%box-shadow-surface' or the component's own declarations.
|
|
283
|
+
&,
|
|
284
|
+
&-lower,
|
|
285
|
+
&-raise,
|
|
286
|
+
&-root {
|
|
287
|
+
@include surface-colors;
|
|
228
288
|
}
|
|
229
|
-
}
|
|
230
289
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
290
|
+
// A primary fill painted on the layer it sits in, with text, edges and shadows that follow its states. Only a fill
|
|
291
|
+
// lifted above its layer casts a shadow, at the weight of the level it sits at; the queries below set that from the
|
|
292
|
+
// layer's level, the page's here.
|
|
293
|
+
&-primary {
|
|
294
|
+
@extend %background-state, %border-state, %box-shadow-state, %color-state, %color-text;
|
|
295
|
+
@include surface-primary-shadows(0);
|
|
296
|
+
--background-active: var(--surface-primary-active);
|
|
297
|
+
--background-default: var(--surface-primary-default);
|
|
298
|
+
--background-hover: var(--surface-primary-hover);
|
|
299
|
+
--background-pressed: var(--surface-primary-pressed);
|
|
300
|
+
--border-color-active: #{surface-border('active', 'var(--surface-primary-active)')};
|
|
301
|
+
--border-color-default: #{surface-border('default', 'var(--surface-primary-default)')};
|
|
302
|
+
--border-color-hover: #{surface-border('hover', 'var(--surface-primary-hover)')};
|
|
303
|
+
--border-color-pressed: #{surface-border('pressed', 'var(--surface-primary-pressed)')};
|
|
304
|
+
--box-shadow-active: var(--box-shadow-hover);
|
|
236
305
|
}
|
|
237
|
-
}
|
|
238
306
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
307
|
+
&-raise {
|
|
308
|
+
@include surface-shadow($level-max);
|
|
309
|
+
}
|
|
242
310
|
|
|
243
|
-
//
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
311
|
+
// Its level is its parent's moved: one up for '%surface-raise' and one down for '%surface-lower', while '%surface'
|
|
312
|
+
// keeps its parent's. Every element is a style container, so a style query reads the parent's level where the layer
|
|
313
|
+
// sets its own, which a 'var()' on the same property could not, and hands each branch its level as a number, so the
|
|
314
|
+
// shadows there are written out for it. A layer past either end matches no query and keeps its parent's level. Only
|
|
315
|
+
// a layer moved up casts a shadow, at its new level's weight. A primary fill sets no level of its own, so its
|
|
316
|
+
// parent's is the one it sits at.
|
|
317
|
+
@for $level from $level-min through $level-max {
|
|
318
|
+
@container style(--surface-level: #{$level}) {
|
|
319
|
+
@if $level > $level-min {
|
|
320
|
+
&-lower {
|
|
321
|
+
--surface-level: #{$level - 1};
|
|
322
|
+
}
|
|
323
|
+
}
|
|
250
324
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
325
|
+
@if $level < $level-max {
|
|
326
|
+
&-raise {
|
|
327
|
+
--surface-level: #{$level + 1};
|
|
328
|
+
@include surface-shadow(math.max($level + 1, 0));
|
|
329
|
+
}
|
|
330
|
+
}
|
|
254
331
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
@include surface-shadows;
|
|
261
|
-
--surface-level: 1;
|
|
262
|
-
}
|
|
332
|
+
&-primary {
|
|
333
|
+
@include surface-primary-shadows($level);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
263
337
|
|
|
264
|
-
|
|
265
|
-
|
|
338
|
+
// A fresh stack above everything, for dialogs: level 0 wherever it opens, so whatever opens inside counts up from it,
|
|
339
|
+
// with the heaviest shadow since nothing sits above it. Not counted from its parent, so it skips the queries.
|
|
340
|
+
&-root {
|
|
341
|
+
@include surface-shadow($shadow-weight-max);
|
|
342
|
+
--surface-level: 0;
|
|
343
|
+
}
|
|
266
344
|
}
|