@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
|
@@ -17,36 +17,41 @@
|
|
|
17
17
|
|
|
18
18
|
&-cell {
|
|
19
19
|
background: var(--level-0);
|
|
20
|
-
border-radius: var(--
|
|
20
|
+
border-radius: var(--border-radius);
|
|
21
21
|
flex-shrink: 0;
|
|
22
22
|
height: var(--cell-size);
|
|
23
|
-
opacity: var(--
|
|
23
|
+
opacity: var(--opacity);
|
|
24
24
|
outline: none;
|
|
25
|
-
scale: var(--
|
|
25
|
+
scale: var(--scale);
|
|
26
26
|
transition:
|
|
27
27
|
opacity var(--transition-duration) var(--transition-timing-function) calc(var(--column) * var(--stagger)),
|
|
28
28
|
scale var(--transition-duration) var(--transition-timing-function) calc(var(--column) * var(--stagger));
|
|
29
29
|
width: var(--cell-size);
|
|
30
30
|
|
|
31
|
+
@media (prefers-reduced-motion: reduce) {
|
|
32
|
+
scale: 1;
|
|
33
|
+
transition: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
31
36
|
&--empty {
|
|
32
37
|
background: none;
|
|
33
38
|
}
|
|
34
39
|
|
|
40
|
+
@for $level from 1 through 4 {
|
|
41
|
+
&--level-#{$level} {
|
|
42
|
+
background: var(--level-#{$level});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
35
46
|
&:focus-visible {
|
|
36
|
-
outline:
|
|
37
|
-
outline-offset:
|
|
47
|
+
outline: var(--focus-width) solid var(--focus-color);
|
|
48
|
+
outline-offset: var(--focus-offset);
|
|
38
49
|
}
|
|
39
50
|
|
|
40
51
|
// Rings the hovered day outside itself, so it shows on the darkest level too.
|
|
41
52
|
&:hover {
|
|
42
|
-
outline:
|
|
43
|
-
outline-offset:
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@for $level from 1 through 4 {
|
|
47
|
-
&--level-#{$level} {
|
|
48
|
-
background: var(--level-#{$level});
|
|
49
|
-
}
|
|
53
|
+
outline: var(--hover-width) solid var(--hover-color);
|
|
54
|
+
outline-offset: var(--hover-offset);
|
|
50
55
|
}
|
|
51
56
|
}
|
|
52
57
|
|
|
@@ -59,7 +64,7 @@
|
|
|
59
64
|
&-days {
|
|
60
65
|
display: flex;
|
|
61
66
|
flex-direction: column;
|
|
62
|
-
margin-inline-end:
|
|
67
|
+
margin-inline-end: var(--spacer);
|
|
63
68
|
margin-top: calc(var(--months-height) + var(--ring-space));
|
|
64
69
|
}
|
|
65
70
|
|
|
@@ -69,6 +74,22 @@
|
|
|
69
74
|
gap: calc(var(--pitch) - var(--cell-size));
|
|
70
75
|
}
|
|
71
76
|
|
|
77
|
+
&-legend {
|
|
78
|
+
align-items: center;
|
|
79
|
+
color: var(--color);
|
|
80
|
+
display: flex;
|
|
81
|
+
font-size: var(--font-size);
|
|
82
|
+
gap: var(--gap-vertical) var(--gap-horizontal);
|
|
83
|
+
|
|
84
|
+
&-less {
|
|
85
|
+
margin-inline-end: var(--spacer);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&-more {
|
|
89
|
+
margin-inline-start: var(--spacer);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
72
93
|
&-month {
|
|
73
94
|
left: calc(var(--column) * var(--pitch));
|
|
74
95
|
line-height: 1;
|
|
@@ -89,38 +110,11 @@
|
|
|
89
110
|
// Room on every side so focus and hover rings aren't clipped, plus a gap between the weeks and the bar.
|
|
90
111
|
&-scroll {
|
|
91
112
|
min-width: 0;
|
|
92
|
-
padding: var(--
|
|
93
|
-
padding-bottom: var(--scrollbar-spacing);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
@media (prefers-reduced-motion: reduce) {
|
|
98
|
-
&-cell {
|
|
99
|
-
scale: 1;
|
|
100
|
-
transition: none;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.heatmap {
|
|
106
|
-
&-legend {
|
|
107
|
-
align-items: center;
|
|
108
|
-
color: var(--color);
|
|
109
|
-
display: flex;
|
|
110
|
-
font-size: var(--font-size);
|
|
111
|
-
gap: calc(var(--size-100) / 2);
|
|
112
|
-
|
|
113
|
-
&-less {
|
|
114
|
-
margin-inline-end: calc(var(--size-100) / 2);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
&-more {
|
|
118
|
-
margin-inline-start: calc(var(--size-100) / 2);
|
|
119
|
-
}
|
|
113
|
+
padding: var(--padding-vertical) var(--padding-horizontal) var(--padding-bottom);
|
|
120
114
|
}
|
|
121
115
|
|
|
122
116
|
&-swatch {
|
|
123
|
-
border-radius: var(--
|
|
117
|
+
border-radius: var(--border-radius);
|
|
124
118
|
height: var(--cell-size);
|
|
125
119
|
width: var(--cell-size);
|
|
126
120
|
|
|
@@ -130,4 +124,4 @@
|
|
|
130
124
|
}
|
|
131
125
|
}
|
|
132
126
|
}
|
|
133
|
-
}
|
|
127
|
+
}
|
|
@@ -1,59 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
--
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
1
|
+
.heatmap {
|
|
2
|
+
&,
|
|
3
|
+
&-legend {
|
|
4
|
+
--cell-size: var(--size-200);
|
|
5
|
+
--color: var(--color-text-300);
|
|
6
|
+
--focus-color: var(--color-primary-500);
|
|
7
|
+
--font-size: var(--font-size-300);
|
|
8
|
+
--hover-color: color-mix(in oklab, var(--color-primary-500) 50%, transparent);
|
|
9
|
+
// One hue, light to dark. Level 0 stays faintly visible so empty days still read as part of the grid.
|
|
10
|
+
--level-0: color-mix(in oklab, var(--level-color) 7%, transparent);
|
|
11
|
+
--level-1: color-mix(in oklab, var(--level-color) 25%, transparent);
|
|
12
|
+
--level-2: color-mix(in oklab, var(--level-color) 45%, transparent);
|
|
13
|
+
--level-3: color-mix(in oklab, var(--level-color) 70%, transparent);
|
|
14
|
+
--level-4: var(--level-color);
|
|
15
|
+
--level-color: var(--color-primary-500);
|
|
16
|
+
--months-height: var(--size-500);
|
|
17
|
+
--pitch: var(--size-300);
|
|
18
|
+
--ring-space: 3px;
|
|
19
|
+
// Per column, so the whole year sweeps in under half a second and reads as one gesture.
|
|
20
|
+
--stagger: 8ms;
|
|
21
|
+
--transition-duration: 0.3s;
|
|
22
|
+
--transition-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&--blue,
|
|
26
|
+
&-legend--blue {
|
|
27
|
+
--level-color: var(--color-blue-400);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
// Settles from 0.6, not 0: a square growing from nothing reads as a pop, one settling from slightly small
|
|
32
|
+
// reads as arriving.
|
|
33
|
+
&-cell {
|
|
34
|
+
--border-radius: var(--border-radius-100);
|
|
35
|
+
--focus-offset: 1px;
|
|
36
|
+
--focus-width: 2px;
|
|
37
|
+
--hover-offset: 1px;
|
|
38
|
+
--hover-width: 1px;
|
|
39
|
+
--opacity: 0;
|
|
40
|
+
--scale: 0.6;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&-days {
|
|
44
|
+
--spacer: calc(var(--size-200) / 2);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&-grid--shown .heatmap-cell {
|
|
48
|
+
--opacity: 1;
|
|
49
|
+
--scale: 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&-legend {
|
|
53
|
+
--gap-horizontal: calc(var(--size-100) / 2);
|
|
54
|
+
--gap-vertical: 0px;
|
|
55
|
+
|
|
56
|
+
&-less,
|
|
57
|
+
&-more {
|
|
58
|
+
--spacer: calc(var(--size-100) / 2);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Room on every side for the focus and hover rings, and more below them for the scroll bar.
|
|
63
|
+
&-scroll {
|
|
64
|
+
--padding-bottom: var(--size-300);
|
|
65
|
+
--padding-horizontal: var(--ring-space);
|
|
66
|
+
--padding-vertical: var(--ring-space);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&-swatch {
|
|
70
|
+
--border-radius: var(--border-radius-100);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// A long glide lags behind a pointer sweeping across 13px cells, and the content keeps pace with it. Gated so
|
|
74
|
+
// it can't undo the tooltip's reduced-motion override.
|
|
75
|
+
// The swap timings go on the layer, the 'frame' that declares its own.
|
|
76
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
77
|
+
& .tooltip-shared {
|
|
78
|
+
--glide-duration: 0.15s;
|
|
79
|
+
|
|
80
|
+
.tooltip-shared-layer {
|
|
81
|
+
--fade-duration: 0.1s;
|
|
82
|
+
--transition-duration: 0.15s;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Compact for a dense grid. Tabular figures, so the tooltip holds its width as the counts change cell to cell.
|
|
88
|
+
.tooltip-shared {
|
|
89
|
+
--glide-duration: 0s;
|
|
90
|
+
--radius: var(--border-radius-300);
|
|
91
|
+
--spacer: 6px;
|
|
92
|
+
font-variant-numeric: tabular-nums;
|
|
93
|
+
|
|
94
|
+
.tooltip-shared-layer {
|
|
95
|
+
--padding-horizontal: var(--size-300);
|
|
96
|
+
--padding-vertical: var(--size-100);
|
|
97
|
+
--transition-duration: 0s;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -2,26 +2,23 @@ import { reactive } from '@esportsplus/reactivity';
|
|
|
2
2
|
import { component, html, type Attributes } from '@esportsplus/template';
|
|
3
3
|
import { ms } from '~/shared/animation';
|
|
4
4
|
import { observer, type Observer } from '~/shared/resize';
|
|
5
|
-
import { easing } from './easing';
|
|
6
5
|
import './scss/index.scss';
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
type A = Attributes & {
|
|
10
|
-
//
|
|
9
|
+
// Draws a border along one edge of the active item, over the fill or on its own.
|
|
10
|
+
border?: 'bottom' | 'left' | 'right' | 'top';
|
|
11
|
+
// Whether the active layer fills its item; off leaves only the border, if any.
|
|
11
12
|
fill?: boolean;
|
|
12
13
|
hover?: boolean;
|
|
13
|
-
// Draws a line along one edge of the active item, over the fill or on its own.
|
|
14
|
-
line?: 'bottom' | 'left' | 'right' | 'top';
|
|
15
14
|
onconnect?: never;
|
|
16
15
|
ondisconnect?: never;
|
|
17
16
|
ondocumentanimationstart?: never;
|
|
18
17
|
ondocumentfocusin?: never;
|
|
19
18
|
ondocumentfocusout?: never;
|
|
20
|
-
ondocumentpointercancel?: never;
|
|
21
19
|
ondocumentpointerdown?: never;
|
|
22
20
|
ondocumentpointerout?: never;
|
|
23
21
|
ondocumentpointerover?: never;
|
|
24
|
-
ondocumentpointerup?: never;
|
|
25
22
|
ondocumenttransitionrun?: never;
|
|
26
23
|
// Selector for nested items to track; by default the highlight tracks its parent's direct children.
|
|
27
24
|
target?: string;
|
|
@@ -52,18 +49,18 @@ type Placement = {
|
|
|
52
49
|
timing?: Timing;
|
|
53
50
|
};
|
|
54
51
|
|
|
55
|
-
type Timing = {
|
|
56
|
-
easing: string;
|
|
57
|
-
lead: number;
|
|
58
|
-
tail: number;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
52
|
type Slide = {
|
|
62
53
|
animation: Animation;
|
|
63
54
|
// Offset the slide set out from, as x, y, width, height; it eases back to nothing.
|
|
64
55
|
from: number[];
|
|
65
56
|
};
|
|
66
57
|
|
|
58
|
+
type Timing = {
|
|
59
|
+
easing: string;
|
|
60
|
+
lead: number;
|
|
61
|
+
tail: number;
|
|
62
|
+
};
|
|
63
|
+
|
|
67
64
|
// Whether a parent lays its children out from its start, read once per parent: alignment is set up, not toggled.
|
|
68
65
|
const ANCHORED = new WeakMap<Element, boolean>();
|
|
69
66
|
|
|
@@ -76,8 +73,50 @@ const PAINT = /^(?:backdrop-filter|background|box-shadow|clip-path|color|fill|fi
|
|
|
76
73
|
// Measure every queued highlight before any of them writes styles or starts a glide.
|
|
77
74
|
const pending = new Set<() => VoidFunction | undefined>();
|
|
78
75
|
|
|
76
|
+
|
|
79
77
|
let frame = 0;
|
|
80
78
|
|
|
79
|
+
|
|
80
|
+
function dequeue(measure: () => VoidFunction | undefined) {
|
|
81
|
+
pending.delete(measure);
|
|
82
|
+
|
|
83
|
+
if (!pending.size) {
|
|
84
|
+
cancelAnimationFrame(frame);
|
|
85
|
+
frame = 0;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Bound a sampled spring's bounce in pixels, keeping its approach and the shape of its settling motion.
|
|
90
|
+
// Short glides and timing functions without sampled overshoot keep their original easing.
|
|
91
|
+
function easing(value: string, distance: number, limit = 8) {
|
|
92
|
+
if (!value.startsWith('linear(') || !distance) {
|
|
93
|
+
return value;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
let peak = 0,
|
|
97
|
+
stops = value.slice(7, -1).split(',');
|
|
98
|
+
|
|
99
|
+
for (let i = 0, n = stops.length; i < n; i++) {
|
|
100
|
+
let progress = parseFloat(stops[i]);
|
|
101
|
+
|
|
102
|
+
peak = Math.max(peak, progress - 1, -progress);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
let scale = Math.min(1, Math.max(0, limit) / (distance * peak));
|
|
106
|
+
|
|
107
|
+
if (!peak || scale === 1) {
|
|
108
|
+
return value;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return `linear(${stops.map((stop) => {
|
|
112
|
+
let progress = parseFloat(stop),
|
|
113
|
+
bounded = Math.max(0, Math.min(1, progress));
|
|
114
|
+
|
|
115
|
+
// Only change the output value; retain any explicit percentage positions on the stop.
|
|
116
|
+
return stop.replace(/[^\s]+/, String(bounded + (progress - bounded) * scale));
|
|
117
|
+
}).join(',')})`;
|
|
118
|
+
}
|
|
119
|
+
|
|
81
120
|
function enqueue(measure: () => VoidFunction | undefined) {
|
|
82
121
|
pending.add(measure);
|
|
83
122
|
frame ||= requestAnimationFrame(() => {
|
|
@@ -98,15 +137,6 @@ function enqueue(measure: () => VoidFunction | undefined) {
|
|
|
98
137
|
});
|
|
99
138
|
}
|
|
100
139
|
|
|
101
|
-
function dequeue(measure: () => VoidFunction | undefined) {
|
|
102
|
-
pending.delete(measure);
|
|
103
|
-
|
|
104
|
-
if (!pending.size) {
|
|
105
|
-
cancelAnimationFrame(frame);
|
|
106
|
-
frame = 0;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
140
|
|
|
111
141
|
function active(parent: Element, self: Element[], target?: string) {
|
|
112
142
|
if (target) {
|
|
@@ -254,8 +284,7 @@ function sibling(parent: Element, self: Element[], node: EventTarget | null, tar
|
|
|
254
284
|
// Each edge glides on its own: the edge facing the move leads with '--glide' and the one behind trails with
|
|
255
285
|
// '--glide-tail', so a longer tail stretches the layer toward the new item before it gathers there.
|
|
256
286
|
export default component<A>(
|
|
257
|
-
({ fill = true, hover = true,
|
|
258
|
-
// Both layers know the line's edge, so the hover fill keeps clear of it just as the active fill does.
|
|
287
|
+
({ border, fill = true, hover = true, target, ...attributes }) => {
|
|
259
288
|
let focused: Element | null = null,
|
|
260
289
|
following = false,
|
|
261
290
|
// Just observed after a mutation added them; their first size report is the insertion, already weighed.
|
|
@@ -267,10 +296,20 @@ export default component<A>(
|
|
|
267
296
|
mutations: MutationObserver | undefined,
|
|
268
297
|
nodes: Record<Name, HTMLElement | null> = { active: null, pointer: null },
|
|
269
298
|
parent: HTMLElement | null = null,
|
|
270
|
-
pressed = false,
|
|
271
299
|
resize: Observer | undefined,
|
|
272
300
|
self: Element[] = [];
|
|
273
301
|
|
|
302
|
+
function enter(e: PointerEvent) {
|
|
303
|
+
let item = hover && parent ? sibling(parent, self, e.target, target) : null;
|
|
304
|
+
|
|
305
|
+
if (!item || item === hovered) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
hovered = item;
|
|
310
|
+
schedule();
|
|
311
|
+
}
|
|
312
|
+
|
|
274
313
|
// Animations and transitions near the items, a folder opening or a dialog scaling in, can move them without
|
|
275
314
|
// resizing anything observed, so the layers are re-placed every frame until they finish. Only the motion
|
|
276
315
|
// that fired is followed, and only if it ends: a looping spinner nearby would otherwise keep this per-frame.
|
|
@@ -298,27 +337,6 @@ export default component<A>(
|
|
|
298
337
|
}
|
|
299
338
|
}
|
|
300
339
|
|
|
301
|
-
function moving() {
|
|
302
|
-
let running = false;
|
|
303
|
-
|
|
304
|
-
// Animation lookup forces style recalculation. Remember the animations when they start instead.
|
|
305
|
-
for (let animation of motions) {
|
|
306
|
-
if (animation.playState === 'running' || animation.pending) {
|
|
307
|
-
running = true;
|
|
308
|
-
}
|
|
309
|
-
else {
|
|
310
|
-
motions.delete(animation);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
return running;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
function near(element: Element) {
|
|
318
|
-
// Any highlight's layers sit out of flow, so their own fades and glides never move an item.
|
|
319
|
-
return !!parent && !LAYERS.has(element) && (parent.contains(element) || element.contains(parent));
|
|
320
|
-
}
|
|
321
|
-
|
|
322
340
|
function measure(name: Name, item: Element | null, box: DOMRect, variant: string): Placement | null {
|
|
323
341
|
let glide = glides[name],
|
|
324
342
|
layer = layers[name];
|
|
@@ -365,6 +383,27 @@ export default component<A>(
|
|
|
365
383
|
};
|
|
366
384
|
}
|
|
367
385
|
|
|
386
|
+
function moving() {
|
|
387
|
+
let running = false;
|
|
388
|
+
|
|
389
|
+
// Animation lookup forces style recalculation. Remember the animations when they start instead.
|
|
390
|
+
for (let animation of motions) {
|
|
391
|
+
if (animation.playState === 'running' || animation.pending) {
|
|
392
|
+
running = true;
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
motions.delete(animation);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
return running;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
function near(element: Element) {
|
|
403
|
+
// Any highlight's layers sit out of flow, so their own fades and glides never move an item.
|
|
404
|
+
return !!parent && !LAYERS.has(element) && (parent.contains(element) || element.contains(parent));
|
|
405
|
+
}
|
|
406
|
+
|
|
368
407
|
function place(name: Name, measured: Placement | null) {
|
|
369
408
|
let glide = glides[name],
|
|
370
409
|
layer = layers[name];
|
|
@@ -388,6 +427,42 @@ export default component<A>(
|
|
|
388
427
|
Object.assign(layer, measured.layer);
|
|
389
428
|
}
|
|
390
429
|
|
|
430
|
+
// Whether a mutation could move one of 'items' or change which item is active. Recycled rows, their own class
|
|
431
|
+
// flips and anything rebuilt inside them leave a resting highlight alone; an item marked active, one taken
|
|
432
|
+
// out, or anything changed ahead of one (an insert above, a reorder) is measured.
|
|
433
|
+
function relevant(record: MutationRecord, items: Element[]) {
|
|
434
|
+
let host = record.target as Element,
|
|
435
|
+
owner = target ? host.parentElement?.closest(target) : host.parentElement === parent ? null : host.parentElement;
|
|
436
|
+
|
|
437
|
+
// Within an item that holds none of them: it only reaches the others through its own observed size.
|
|
438
|
+
if (owner && parent?.contains(owner) && owner !== parent && !items.some((item) => owner.contains(item))) {
|
|
439
|
+
return false;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
if (record.type === 'attributes') {
|
|
443
|
+
// 'inert' only conceals what it holds; a class can also reflow whatever follows.
|
|
444
|
+
return items.some((item) => record.attributeName === 'inert' ? host.contains(item) : before(host, item));
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
for (let nodes of [record.addedNodes, record.removedNodes]) {
|
|
448
|
+
for (let node of nodes) {
|
|
449
|
+
if (items.some((item) => node.contains(item))) {
|
|
450
|
+
return true;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
// The change sits just before 'nextSibling', or at the end of its parent.
|
|
456
|
+
return items.some((item) =>
|
|
457
|
+
(record.nextSibling ? before(record.nextSibling, item) : !host.contains(item) && before(host, item)) ||
|
|
458
|
+
(host.contains(item) && !anchored(host))
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
function schedule() {
|
|
463
|
+
enqueue(update);
|
|
464
|
+
}
|
|
465
|
+
|
|
391
466
|
// The layer's box always sits on its item; a glide is an offset added on top, easing to nothing, so the item
|
|
392
467
|
// can keep moving underneath without restarting it.
|
|
393
468
|
function slide(name: Name, from: number[], timing: Timing) {
|
|
@@ -448,49 +523,6 @@ export default component<A>(
|
|
|
448
523
|
}
|
|
449
524
|
}
|
|
450
525
|
|
|
451
|
-
function schedule() {
|
|
452
|
-
enqueue(update);
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
// Whether a mutation could move one of 'items' or change which item is active. Recycled rows, their own class
|
|
456
|
-
// flips and anything rebuilt inside them leave a resting highlight alone; an item marked active, one taken
|
|
457
|
-
// out, or anything changed ahead of one (an insert above, a reorder) is measured.
|
|
458
|
-
function relevant(record: MutationRecord, items: Element[]) {
|
|
459
|
-
let host = record.target as Element,
|
|
460
|
-
owner = target ? host.parentElement?.closest(target) : host.parentElement === parent ? null : host.parentElement;
|
|
461
|
-
|
|
462
|
-
// Within an item that holds none of them: it only reaches the others through its own observed size.
|
|
463
|
-
if (owner && parent?.contains(owner) && owner !== parent && !items.some((item) => owner.contains(item))) {
|
|
464
|
-
return false;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
if (record.type === 'attributes') {
|
|
468
|
-
// 'inert' only conceals what it holds; a class can also reflow whatever follows.
|
|
469
|
-
return items.some((item) => record.attributeName === 'inert' ? host.contains(item) : before(host, item));
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
for (let nodes of [record.addedNodes, record.removedNodes]) {
|
|
473
|
-
for (let node of nodes) {
|
|
474
|
-
if (items.some((item) => node.contains(item))) {
|
|
475
|
-
return true;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
// The change sits just before 'nextSibling', or at the end of its parent.
|
|
481
|
-
return items.some((item) =>
|
|
482
|
-
(record.nextSibling ? before(record.nextSibling, item) : !host.contains(item) && before(host, item)) ||
|
|
483
|
-
(host.contains(item) && !anchored(host))
|
|
484
|
-
);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
function release() {
|
|
488
|
-
if (pressed) {
|
|
489
|
-
pressed = false;
|
|
490
|
-
schedule();
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
|
|
494
526
|
// What a change has to reach to matter: the items the layers rest on or are headed for, and the active one.
|
|
495
527
|
function tracked() {
|
|
496
528
|
let items = [glides.active.item, glides.pointer.item, hovered, focused, parent && active(parent, self, target)];
|
|
@@ -520,7 +552,7 @@ export default component<A>(
|
|
|
520
552
|
current = active(parent, self, target),
|
|
521
553
|
item = hovered || focused,
|
|
522
554
|
selected = measure('active', current, box, '--active'),
|
|
523
|
-
pointer = measure('pointer', item, box,
|
|
555
|
+
pointer = measure('pointer', item, box, 'highlight--hover');
|
|
524
556
|
|
|
525
557
|
return () => {
|
|
526
558
|
if (parent !== container) {
|
|
@@ -537,16 +569,18 @@ export default component<A>(
|
|
|
537
569
|
};
|
|
538
570
|
}
|
|
539
571
|
|
|
540
|
-
// Both layers sit at the same z-index, so the pointer layer comes first to paint beneath the active one.
|
|
572
|
+
// Both layers sit at the same z-index, so the pointer layer comes first to paint beneath the active one. Both
|
|
573
|
+
// know the border's edge, so the hover fill keeps clear of it just as the active fill does. Hover always fills;
|
|
574
|
+
// 'fill' only decides the active layer.
|
|
541
575
|
return html`
|
|
542
576
|
<div
|
|
543
577
|
aria-hidden='true'
|
|
544
|
-
class='highlight'
|
|
578
|
+
class='highlight highlight--fill'
|
|
545
579
|
${attributes}
|
|
546
580
|
${{
|
|
547
581
|
class: [
|
|
548
582
|
() => layers.pointer.variant,
|
|
549
|
-
|
|
583
|
+
border && `highlight--border-${border}`,
|
|
550
584
|
() => layers.pointer.visible && 'highlight--visible'
|
|
551
585
|
],
|
|
552
586
|
onconnect: (element: HTMLElement) => {
|
|
@@ -564,9 +598,9 @@ export default component<A>(
|
|
|
564
598
|
${{
|
|
565
599
|
class: [
|
|
566
600
|
() => layers.active.variant,
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
601
|
+
border && 'highlight--border',
|
|
602
|
+
border && `highlight--border-${border}`,
|
|
603
|
+
fill && 'highlight--fill',
|
|
570
604
|
() => layers.active.visible && 'highlight--visible'
|
|
571
605
|
],
|
|
572
606
|
onconnect: (element: HTMLElement) => {
|
|
@@ -700,18 +734,8 @@ export default component<A>(
|
|
|
700
734
|
focused = null;
|
|
701
735
|
schedule();
|
|
702
736
|
},
|
|
703
|
-
|
|
704
|
-
ondocumentpointerdown:
|
|
705
|
-
let item = hover && parent ? sibling(parent, self, e.target, target) : null;
|
|
706
|
-
|
|
707
|
-
if (!item) {
|
|
708
|
-
return;
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
hovered = item;
|
|
712
|
-
pressed = true;
|
|
713
|
-
schedule();
|
|
714
|
-
},
|
|
737
|
+
// Content re-rendered under a still pointer sends no 'pointerover', so a press claims the item too.
|
|
738
|
+
ondocumentpointerdown: enter,
|
|
715
739
|
// Crossing gaps between siblings keeps the last one so the highlight glides instead of snapping back.
|
|
716
740
|
ondocumentpointerout: (e: PointerEvent) => {
|
|
717
741
|
if (!hover || !parent?.contains(e.target as Node | null) || parent.contains(e.relatedTarget as Node | null)) {
|
|
@@ -719,20 +743,9 @@ export default component<A>(
|
|
|
719
743
|
}
|
|
720
744
|
|
|
721
745
|
hovered = null;
|
|
722
|
-
pressed = false;
|
|
723
|
-
schedule();
|
|
724
|
-
},
|
|
725
|
-
ondocumentpointerover: (e: PointerEvent) => {
|
|
726
|
-
let item = hover && parent ? sibling(parent, self, e.target, target) : null;
|
|
727
|
-
|
|
728
|
-
if (!item || item === hovered) {
|
|
729
|
-
return;
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
hovered = item;
|
|
733
746
|
schedule();
|
|
734
747
|
},
|
|
735
|
-
|
|
748
|
+
ondocumentpointerover: enter,
|
|
736
749
|
ondocumenttransitionrun: follow,
|
|
737
750
|
style: () => geometry(layers.active)
|
|
738
751
|
}}
|
|
@@ -740,3 +753,4 @@ export default component<A>(
|
|
|
740
753
|
`;
|
|
741
754
|
}
|
|
742
755
|
);
|
|
756
|
+
export type { A };
|