@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
package/README.md
CHANGED
|
@@ -63,30 +63,27 @@ html`
|
|
|
63
63
|
| `tasklist` | Checklist that strikes through checked tasks and moves them below the open ones; `ordered` keeps both groups in task order, `sortable` lets rows be dragged within their group | `tasklist.checkbox`, `tasklist.content`, `tasklist.description`, `tasklist.item`, `tasklist.label`, `tasklist.row` |
|
|
64
64
|
| `form` | Form wrapper | `form.action`, `form.input` |
|
|
65
65
|
| `cc` | Payment card form (`input` fields) with a live card preview that flips for the CVC, brand detection, caret-safe formatting and Luhn/expiry validation; `onvalid` receives brand, last 4, expiry and name | `cc.field`, `cc.submit` |
|
|
66
|
-
| `colorPicker` | Saturation pad, hue/opacity sliders (`range`), hex field (`input`) with a `copy
|
|
66
|
+
| `colorPicker` | Saturation pad, hue/opacity sliders (`range`), hex field (`input`) with a `button.copy`, and an animated recent-colors row (hidden while empty; `recent: false` leaves it out entirely); `value` is required, no surface of its own, so place it in a `card` | `colorPicker.swatch` |
|
|
67
67
|
| `inlineEdit` | Click-to-edit text that swaps in an `input` (or `textarea` with `multiline`) without moving a glyph; Enter/blur saves, Escape cancels, `onsave` fires. `inlineEdit.rich` edits markdown in place as a controlled editor: the text is a document of blocks and marks rendered by the template, every input (typing, deleting, Enter, formatting, paste, drop, an input method's composition) changes that document rather than the DOM, and it keeps its own undo/redo (Mod+Z, Mod+Shift+Z/Mod+Y). `features` whitelists what each field allows (bold, italic, strike, code, highlight, link, heading, quote, codeblock, bullet, ordered, task, clear, copy), and only those appear in its selection toolbar, shortcuts, pastes and saved markdown. `status: true` (or a `{ phase, savedAt }` object to read or drive it) shows the save status under either field: unsaved while the edit differs, saving while a promise returned by `onsave` is pending, then saved, rolling to "Saved 3 min ago" | `inlineEdit.display`, `inlineEdit.field`, `inlineEdit.status`, `inlineEdit.rich.editor`, `inlineEdit.rich.status`, `inlineEdit.rich.toolbar`, `inline-edit--seamless` |
|
|
68
68
|
|
|
69
69
|
### Interactive
|
|
70
70
|
| Component | Description | Variants |
|
|
71
71
|
|-----------|-------------|----------|
|
|
72
|
-
| `button` | Standard button
|
|
73
|
-
| `tooltip` | Popup content; `tooltip.onhover` also opens on keyboard focus and closes on Escape, and `tooltip.onhover.trigger({ delay, state })` is the same behaviour to spread on your own `.tooltip` element; `delay: { open?, close? }` (ms, on `tooltip.onhover` and `tooltip.shared`; each left out is instant) holds the pointer before opening and after leaving, and for 500ms after a delayed tooltip closes the next opens at once, without its entrance; `tooltip.menu` is a keyboard menu (arrows, Home/End, Escape returns focus, Tab closes) that closes once an option is chosen; `tooltip.nestedMenu({ animate, items, onnavigate, state })` is a drill-down menu whose `items` nest to any depth: a branch's panel grows out of its row over the dimmed parent, and its header or the parent's scrim goes back; arrows/Home/End move, Right/Left drill and return, Escape goes back a level then closes (`animate: false` skips the motion, `tooltip.nestedMenu.trigger` styles the button); `tooltip.shared({ delay, direction, dismiss, interactive, keep, state })` is one tooltip for any number of triggers: spread `tip.bind(content)` on a trigger (a string, or a function returning a template, rendered on every open unless `keep`), or `tip.delegate({ content, edge, selector })` on a container to make every matching descendant a trigger (default `[data-tooltip]`, its value the content; `edge` lines the tooltip up past the container's edge), and place `tip.render(attributes)` once; it opens in the top layer beside the trigger, flips when out of room, and glides between triggers while its content slides in the direction of travel; `interactive` makes it a card the pointer can enter, toggled by taps and keys, with Tab carried into it; `keep` mounts each bound trigger's content on its first open and keeps it for reopening until that trigger unmounts; `dismiss` is a selector whose clicks inside close it (`'a[href]'` for navigation); `state.active` is whether it is open and `state.index` which bound trigger, numbered in `bind()` order (-1 for none), and setting it opens that trigger | `tooltip.context`, `tooltip.menu`, `tooltip.nestedMenu`, `tooltip.onclick`, `tooltip.onhover`, `tooltip.onhover.trigger`, `tooltip.shared` |
|
|
72
|
+
| `button` | Standard button, filled by `button--black`, `button--primary` (the theme's ink, lettered in the page color), `button--surface` (its raised surface), `button--surface-primary` or `button--white`; `button.copy` is an icon button copying `value` (a string or a function read on click) whose copy icon turns into a check that draws in, then back after `timeout` ms (default `3000`), with `label`, `success` and `error` as its accessible name per state; `button.faces(status, faces)` stacks keyed faces in one grid cell and shows the one whose `key` matches `status()`; `button.morph` runs an async `onaction` through idle, loading, success and error, carrying the status as a `button--morph-{status}` class (also readable through a passed `state`), collapsing to a circle while `compact(status)` holds (default: loading and success), shaking on error and announcing `announce[status]`; its content is yours, layered with `button-morph-text` (mark the shown one `--active`) and `button-morph-icon--loading` / `--success`; `button.morph.save` is the ready-made save (`onsave`, `label`, `retryLabel`) that morphs into a spinner circle and confirms with a check, coloured by its `--background-default` | `button.copy`, `button.faces`, `button.morph`, `button.morph.save`, `button--black`, `button--primary`, `button--surface`, `button--surface-primary`, `button--white` |
|
|
73
|
+
| `tooltip` | Popup content; `tooltip.onhover` also opens on keyboard focus and closes on Escape, and `tooltip.onhover.trigger({ delay, state })` is the same behaviour to spread on your own `.tooltip` element; `delay: { open?, close? }` (ms, on `tooltip.onhover` and `tooltip.shared`; each left out is instant) holds the pointer before opening and after leaving, and for 500ms after a delayed tooltip closes the next opens at once, without its entrance; `tooltip.menu` is a keyboard menu (arrows, Home/End, Escape returns focus, Tab closes) that opens in the top layer, above every stacking context around it, and closes once an option is chosen, `highlight` (default `false`; `true` or the highlight's own attributes) glides a layer between its rows on hover and keyboard focus in place of each item's own fill, its panels a surface whose item hover and pressed fills and highlight are surface primary, `tooltip-menu--surface` restoring that fill on the menu or any ancestor (such as a `button.split`); `tooltip.nestedMenu({ animate, items, onnavigate, state })` is a drill-down menu whose `items` nest to any depth: a branch's panel grows out of its row over the dimmed parent, and its header or the parent's scrim goes back; arrows/Home/End move, Right/Left drill and return, Escape goes back a level then closes (`animate: false` skips the motion, `tooltip.nestedMenu.trigger` styles the button); `tooltip.shared({ delay, direction, dismiss, interactive, keep, state })` is one tooltip for any number of triggers: spread `tip.bind(content)` on a trigger (a string, or a function returning a template, rendered on every open unless `keep`), or `tip.delegate({ content, edge, selector })` on a container to make every matching descendant a trigger (default `[data-tooltip]`, its value the content; `edge` lines the tooltip up past the container's edge), and place `tip.render(attributes)` once; it opens in the top layer beside the trigger, flips when out of room, and glides between triggers while its content slides in the direction of travel; `interactive` makes it a card the pointer can enter, toggled by taps and keys, with Tab carried into it; `keep` mounts each bound trigger's content on its first open and keeps it for reopening until that trigger unmounts; `dismiss` is a selector whose clicks inside close it (`'a[href]'` for navigation); `state.active` is whether it is open and `state.index` which bound trigger, numbered in `bind()` order (-1 for none), and setting it opens that trigger | `tooltip.context`, `tooltip.menu`, `tooltip.nestedMenu`, `tooltip.onclick`, `tooltip.onhover`, `tooltip.onhover.trigger`, `tooltip.shared`, `tooltip-menu--surface` |
|
|
74
74
|
| `accordion` | Collapsible sections driven by `state.active`; `group` (from `accordion.group()`) keeps at most one member open, closing the rest when one opens, and `accordion.group({ required: true })` keeps exactly one open, reopening a member closed while nothing else is. Several opened at once leave the last to join or open; a required group opens its first member when none starts open. Members join while mounted | `accordion.group` |
|
|
75
|
-
| `clipboard` |
|
|
76
|
-
| `copy` | Icon button copying `value` (a string or a function read on click); the copy icon turns into a check that draws in, then back after `timeout` ms (default `3000`); `label`, `success` and `error` set its accessible name per state | - |
|
|
75
|
+
| `clipboard` | `clipboard.write(value)` copies text, resolving `true` once it lands and `false` if the browser refuses | `clipboard.write` |
|
|
77
76
|
| `command` | ⌘K/Ctrl+K command palette on `overlay` + `input`: substring-then-subsequence matching with highlighted runs, grouped results, arrow/Enter keys, `onrun`; `tabs` adds a row of tabs under the search, marked by `highlight`, whose views are `frame--swap`s, drifting in from their side, and cycle with Tab/Shift+Tab (All leads with recent commands, persisted through any `store` implementing `get`/`set`, then lists every command; each command group gets its own tab; a Shortcuts tab lists `shortcuts`); setting `state.tab` (`'all'`, `'shortcuts'` or a group name) switches views and clears the search. `render(groups)` supplies custom result markup: each item exposes its `label`, highlighted `content`, command `id`, and `attributes` to spread onto the option element so selection and keyboard navigation keep working. Icons are sprite ids; `.command-trigger` also styles standalone search buttons | `command.dialog` (e.g. `overlay--blur`), `command.input`, `command.option`, `command.trigger`, `command--centered` |
|
|
78
77
|
| `editor` | Editor family under one namespace. `editor.code` is a source editor on a persistent native textarea editing an `EditorDocument` that keeps its own undo history: syntax colors (TypeScript/TSX, JavaScript, CSS/SCSS, HTML, JSON, Python, Markdown), line numbers, multiple and rectangular selections, find/replace, go to line, folding, wrap, visible whitespace and a minimap; `options.services` adds completion, hover and diagnostics from a language-server `transport` (or completes from the document's own words); `editor.markdown` renders Markdown in place and edits one block at a time; `editor.code` adds sticky scroll, color swatches, links, unicode warnings, rulers, a git gutter (`baseline`), keybinding overrides (`keybindings`, exported `commands`) and merge-conflict lenses; `editor.tree` is the file tree, with drops from the desktop (`operations.import`), dragging files out (`export`) and next/previous change or problem; `editor.diffs` is a split or unified diff viewer and `editor.diffs.merge` a three-way merge editor; `editor.workspace` combines them with an explorer, tabs, quick open and file operations over a host you supply; `editor.viewer` shows source read-only with syntax colors, line numbers, folding, wrap, visible whitespace, a minimap and an optional copy button, without the editor (import `@esportsplus/ui/editor/viewer` directly to leave the rest of the family out of the bundle) | `editor.code`, `editor.diffs`, `editor.diffs.merge`, `editor.markdown`, `editor.tree`, `editor.viewer`, `editor.workspace` |
|
|
79
78
|
| `alert` | Notifications | error, info, success types |
|
|
80
|
-
| `chatMinimap` | Rail of lines mapping a conversation, one per turn: the hovered line swells its two neighbours either side, one gliding `tooltip.shared` card previews each turn's `title` and `description`, previous/next buttons step through the thread, and `state` (`start`/`end`) lights the turns in view. `turns` may be a `ReactiveArray` so the rail grows with the chat; `chatMinimap.spy({ state, turns })` drives `state` from an `IntersectionObserver` on the thread and its `scrollTo` is the `onnavigate` | `chatMinimap.item`, `side: 'left'` |
|
|
81
|
-
| `dock` | macOS-style
|
|
82
|
-
| `card.expand` | List of `card--expand` cards that each morph into their own `card` `overlay` and fly back into their slot through a view transition (a plain `overlay` fade where unsupported, a cross-fade under reduced motion); `state.open` is two-way | `card.expand.trigger` |
|
|
79
|
+
| `chatMinimap` | Rail of lines mapping a conversation, one per turn: the hovered line swells its two neighbours either side, one gliding `tooltip.shared` card previews each turn's `title` and `description`, previous/next buttons step through the thread, and `state` (`start`/`end`) lights the turns in view. `turns` may be a `ReactiveArray` so the rail grows with the chat; `chatMinimap.spy({ state, turns })` drives `state` from an `IntersectionObserver` on the thread and its `scrollTo` is the `onnavigate` | `chatMinimap.card`, `chatMinimap.description`, `chatMinimap.item`, `chatMinimap.items`, `chatMinimap.label`, `chatMinimap.line`, `chatMinimap.nav`, `chatMinimap.preview`, `chatMinimap.title`, `side: 'left'` |
|
|
80
|
+
| `dock` | macOS-style shelf, unpainted so it is themed where it is placed, whose icons swell toward the cursor on a spring, with one delayed `tooltip.shared` label gliding between its items, items showing an `icon` (a sprite id or a function rendering it) or a `thumbnail` image covering the button, each optionally shaped by its own `modifier` (`plain` for the icon alone, `square`, `squircle`), sortable by drag, with `arrows` paging through whole icons once they outgrow the room the dock has; `direction` (`n`, `s`, `e`, `w`) sets the side the launcher and labels open toward and the way icons swell, east and west standing the dock upright; given `apps`, an 'All apps' button opens a launcher on that side, centered on the dock as a `tooltip-content`, laid out like `command`: a search (an `input`), the apps in a grid the arrow keys walk and Enter opens, and a legend of its keys; the dock and the launcher sort into each other, so dragging moves apps in and out of `items` (`state.active` opens it, `onsort` reports each move), and a hop-and-squash launch that lights a running dot (per-item `state.running`, `onlaunch`) | `dock.button`, `dock.launcher`, `dock--plain`, `dock--square`, `dock--squircle` |
|
|
83
81
|
| `pagination.dots` | Page indicator driven by a continuous `state.progress`; the pill stretches between dots like a worm, with an optional autoplay countdown | `pagination.dots.dot`, `pagination--dots-large` |
|
|
84
82
|
| `pagination.cards` | Previous and next links as two cards, each a small `label` (default 'Previous'/'Next'), a `title` and an optional `description`; the chevron nudges the way it points on hover and focus, and a lone next card keeps the right column | `{ next, previous }`, each `{ description?, href, label?, title }` |
|
|
85
83
|
| `pagination.arrows` | The same links as two square arrow buttons; a missing side stays in place, disabled, so the pair never shifts | `{ next, previous }` |
|
|
86
|
-
| `nav` | `nav.tree` link tree
|
|
87
|
-
| `pullToRefresh` | Rubber-band pull gesture (touch and mouse) with a stepped tick spinner; new items above the old first one slide in | - |
|
|
84
|
+
| `nav` | `nav.tree` link tree marking the active link with a gliding `highlight`: given its attributes as `[nav.tree.highlight]`, left out for none: a pill, or with a `border` a `highlight--rail` along a rail on that edge; `nav.toc` table of contents, a `nav.tree` of one group with `{ border: 'left', fill: false }`; `nav.spy(ids)` marks the section in view within whichever ancestor scrolls it | `nav.tree`, `nav.toc`, `nav.spy` |
|
|
88
85
|
| `sortable` | Drag-and-drop reordering of a reactive list's items, across lists with `group` | `sortable--{effect}` modifiers |
|
|
89
|
-
| `story` | Auto-advancing stories, each any `Renderable`, on a `frame--slide` track with segmented progress bars whose CSS fill is the timer (`--duration`, or `duration` in ms); tap the left third to go back (replaying the first story) and the rest to advance, drag or flick between stories (rubber-banding at the ends), press-and-hold or Space to pause; links and controls inside a story keep their own clicks |
|
|
86
|
+
| `story` | Auto-advancing stories, each any `Renderable`, on a `frame--slide` track filling the card, with segmented progress bars overlaid on top whose CSS fill is the timer (`--duration`, or `duration` in ms); tap the left third to go back (replaying the first story) and the rest to advance, drag or flick between stories (rubber-banding at the ends), press-and-hold or Space to pause; links and controls inside a story keep their own clicks | |
|
|
90
87
|
|
|
91
88
|
### Display
|
|
92
89
|
| Component | Description |
|
|
@@ -95,14 +92,17 @@ html`
|
|
|
95
92
|
| `loader` | Loading spinner |
|
|
96
93
|
| `loading` | Border loading indicator |
|
|
97
94
|
| `typewriter` | Animated typing effect; `typewriter.retype` is a headline word that is selected and typed over with a jittered, human rhythm, landing whole words under reduced motion. Both share the caret variables and `--block`/`--hard`/`--underscore` modifiers. `typewriter.rotate` is a rotating word (`state.index`, `state.paused`) whose shared letters glide into place while the others blur out and in; `typewriter-rotate--accent` |
|
|
98
|
-
| `
|
|
95
|
+
| `group` | Row of items on `%group`, spaced by `--gap-horizontal` / `--gap-vertical` (a quarter of `--size-100`); attributes under `[group.highlight]` add a `highlight` behind the items, none without them; `button--group` items make a segmented control, medium weight while `--active` | `group.highlight` |
|
|
96
|
+
| `preview` | An example's card that mounts its content once near the viewport and answers its hash (and its `anchors`) by revealing itself; its parts compose inside it, sharing one `preview.state()`: `preview.header` (numbered title plus controls), `preview.stage` (renders the example untracked, hidden while the source shows), `preview.source` (loads, caches and retries a source on the code view) and `preview.code` (a flush `editor.viewer` with a copy button). `preview.buttons` sits just above the card, a `group` of view buttons from `{ content, view }` items | `preview.buttons`, `preview.code`, `preview.header`, `preview.source`, `preview.stage`, `preview.state` |
|
|
97
|
+
| `panels` | Tabbed groups of surfaces in resizable splits, from a `catalog` of kinds (`title`, `render`, optional `icon`, `description`, `shortcut`, `multiple`) and a `panels.state()` holding the layout (`root`, optional `storage` key to persist it); `icons: true` shows tabs as their kind's icon alone, closed from their menu. Tabs drag to reorder, into another group, onto a group's half to split it, or onto the bottom strip to dock a full-width bottom group; separators resize, a double-clicked header maximizes, groups clicked with Ctrl (⌘ on Apple platforms) held fill the layout together once it is let go (Esc cancels) until a double click steps back out, and tabs carry a close menu. `+` and an empty group's launcher open a kind. Each surface renders once and moves between slots, keeping its state until its tab closes | `panels.state` |
|
|
98
|
+
| `highlight` | Layer that glides behind its parent's children on hover and focus and rests on the `--active` one (`target` for nested items, `hover: false` for the active layer only); `border: 'bottom' \| 'left' \| 'right' \| 'top'` adds an edge border to the active layer with both fills kept `--border-inset-horizontal` / `--border-inset-vertical` clear of it, `fill: false` drops the active background, `--glide-tail-duration-active` longer than `--glide-duration-active` stretches it toward the next item, `--inset-horizontal` / `--inset-vertical` pull the fill in from the item; `highlight--rail` on the highlight and `highlight-rail` with `highlight-rail--{bottom,left,right,top}` on its container make tabs along a rail at `--rail-width`, the border on the same edge lying over it |
|
|
99
99
|
| `ellipsis` | Animated dots |
|
|
100
|
-
| `icon` | SVG sprite wrapper; `icon--rotate` turns it by `--rotate` (default `0deg`) with an eased transition, skipped under reduced motion |
|
|
100
|
+
| `icon` | SVG sprite wrapper, `icon(attributes, href)`: the sized box (`--size`, or `--width`/`--height`) colored by `--color`, whose `fill` the `<svg>` inherits, so a stroked icon sets `fill: none` on the box; attributes under `[icon.svg]` go on the `<svg>` itself, `class` included; `icon--rotate` turns it by `--rotate` (default `0deg`) with an eased transition, skipped under reduced motion | `icon.svg` |
|
|
101
101
|
| `number` | Number formatting |
|
|
102
102
|
| `truncate` | Text truncation |
|
|
103
103
|
| `json` | JSON display |
|
|
104
104
|
| `announcement` | Animated top-of-page container (`state.active`) built on a non-modal `overlay` in the page flow; slides its content in and collapses the space it held, with overlay's drag dismissal and background fill when pulled away from its top edge; the content and close control are the consumer's |
|
|
105
|
-
| `toaster` | `toaster(attributes)` returns `{ content, toast }`: place `content` on the page, and `toast(attributes, (state) => content)` queues into that toaster alone, so separate toasters can differ in placement and style. Placed with overlay's own placement modifiers and variables (`toaster--{n,ne,e,se,s,sw,w,nw}`, `--margin-*`, `--translate`, `--stack-peek`, `--stack-scale`); side stacks recede sideways like overlay's; collapsed it shows `limit` toasts (default 3) and an overflow card counting the rest (`overflow: (count) => content`, `toaster.overflow` attributes), and hovering fans all of them out. Content renders lazily with the toast's `state`: `state.active = false` dismisses it and changing `state.duration` keeps the time already spent; pass `state` to hold it from outside, `toast.dismiss()` clears the toaster. The timer is a CSS animation, exposed as `--
|
|
105
|
+
| `toaster` | `toaster(attributes)` returns `{ content, toast }`: place `content` on the page, and `toast(attributes, (state) => content)` queues into that toaster alone, so separate toasters can differ in placement and style. Placed with overlay's own placement modifiers and variables (`toaster--{n,ne,e,se,s,sw,w,nw}`, `--margin-*`, `--translate`, `--stack-peek`, `--stack-scale`); side stacks recede sideways like overlay's; collapsed it shows `limit` toasts (default 3) and an overflow card counting the rest (`overflow: (count) => content`, `toaster.overflow` attributes), and hovering fans all of them out. Content renders lazily with the toast's `state`: `state.active = false` dismisses it and changing `state.duration` keeps the time already spent; pass `state` to hold it from outside, `toast.dismiss()` clears the toaster. The timer is a CSS animation, exposed as `--progress` (0 to 1) and `--seconds`, that runs only on the front toast and stops while the stack is hovered. The toast is only the stacking container, so its surface is the consumer's class; it keeps a close button (`toast.close` attributes) around its content (`toast.content` attributes) |
|
|
106
106
|
| `progress` | Progress bar (`state.value`) with an optional label, percentage and a `status` line derived from the value; `progress.text` is a `progressbar` whose label fills with ink on a spring (`state.value`), with rolling digits and a drawn check on done |
|
|
107
107
|
| `heatmap` | Calendar of daily values that sweeps in by column; one `tooltip.shared` delegated across the cells renders each day through your `tooltip(day, index)` template (`describe(day)` names the cell), drag-to-scroll via `scrollbar.drag`, roving-tabindex grid keys and `heatmap.legend`; `heatmap--blue` |
|
|
108
108
|
| `relativeTime` | Self-updating `<time>` ("4 min ago") that wakes once per visible change and rolls its digits; full date in a `tooltip` on hover/focus; `state.now` pins the clock |
|
|
@@ -117,6 +117,7 @@ html`
|
|
|
117
117
|
| `frame.scss` | Sibling frames sharing one spot, the `--active` one shown: instant by default, `frame--slide` / `frame--scroll` move them like a horizontal / vertical track, `frame--swap` crossfades in place with a directional drift and blur (the `tooltip.shared` swap); shared by `command`, `tooltip.shared` and `card--morph` |
|
|
118
118
|
| `overlay` | Native `<dialog>` driven by `state.active` (Esc and backdrop click close it), placed by `overlay--c` (default), an edge (`overlay--n`, `overlay--s`, `overlay--w`, `overlay--e`) or a corner (`overlay--ne`, `overlay--se`, `overlay--sw`, `overlay--nw`, which enter and drag off by their top or bottom edge); placements slide in from their side on the iOS drawer curve and square the corners they touch unless `overlay--floating`. Every overlay but a rail drags to dismiss (toward its edge, or downward when centered) past 25% or on a flick, rubber-bands inward and fades the backdrop with the drag; when its own content scrolls, touch drags only from `overlay.handle`. Overlays opened over one another stack: each covered layer shrinks, dims and peeks out from under the one above (`--stack-scale`, `--stack-dim`, `--stack-peek`) and follows the top layer back as it is dragged away; an `overlay-page` direct child of `<body>` (or of a non-modal overlay's container) recedes the same way; `modal: false` opens without a backdrop, leaves the page interactive and sits in its positioned container; `flow: true` keeps it non-modal in the page layout, preserves focus, skips layer stacking, and collapses its parent row during vertical drag dismissal (used by `announcement`); `rail: true` keeps it open non-modal and widens it while a mouse hovers or keyboard focus is inside (or `state.active` is set) from `--width-closed` to `--max-width`, clipping rows rather than reflowing them. Motion: `overlay--fade`, `overlay--scale`, `overlay--spring`, `overlay--alert`, `overlay--blur` |
|
|
119
119
|
| `breadcrumb` | Path trail that folds middle segments into a `tooltip.menu` as space runs out, the rest sliding over as each one closes; `onnavigate` intercepts links; `separator: 'chevron' \| 'slash'` (default `'slash'`) |
|
|
120
|
+
| `shell` | App frame `shell({ left, right }, content)`: a sidebar on either edge (`Side`: `id`, `label`, `state.active`, optional `content`, `class` and `hover` to peek while the pointer rests on its edge), each with a mirrored `button.sidebar` toggle in its top corner, around a root-surface `card` the page scrolls in. A closed side's edge holds a handle that follows the pointer; dragging from the edge opens the sidebar and dragging a sidebar toward its edge closes it. Below 1024px one sidebar opens at a time; `shell.close(side)` closes one, returning focus to its toggle. `--gap-horizontal` / `--gap-vertical` inset the card from the window, `--space` sizes an open sidebar, `--slide-duration` / `--slide-easing` time the motion |
|
|
120
121
|
|
|
121
122
|
### Utility
|
|
122
123
|
| Component | Description |
|
|
@@ -157,11 +158,12 @@ frames in one grid cell so the tallest sets the height:
|
|
|
157
158
|
- `.frame--slide` / `.frame--scroll` move the frames together like a
|
|
158
159
|
horizontal / vertical track.
|
|
159
160
|
- `.frame--swap` crossfades in place, like `tooltip.shared` content: a waiting
|
|
160
|
-
frame sits one `--
|
|
161
|
+
frame sits one `--shift` off to its side, faded and blurred, so the
|
|
161
162
|
incoming frame drifts in while the outgoing one carries on out the other way.
|
|
162
|
-
Frames without an index set the direction themselves through `--
|
|
163
|
-
`--
|
|
164
|
-
|
|
163
|
+
Frames without an index set the direction themselves through `--translate-x` /
|
|
164
|
+
`--translate-y` and mark the outgoing frame `frame--swap-leaving`.
|
|
165
|
+
`--transition-duration`, `--fade-duration` and `--blur` tune it; the outgoing
|
|
166
|
+
frame takes `--fade-duration` throughout.
|
|
165
167
|
|
|
166
168
|
```html
|
|
167
169
|
<div style="overflow: hidden; --i: 1;">
|
|
@@ -332,7 +334,7 @@ plugin. `check.svg` carries no stroke styling, so set `fill: none` and a `stroke
|
|
|
332
334
|
|
|
333
335
|
Located in `tokens.scss`:
|
|
334
336
|
|
|
335
|
-
- **Colors**: `--color-{name}` (black, blue, green, grey, purple, red, white, yellow), each written once and weighted at the root as `--color-{name}-{300|400|500}`: 400 itself, 300 and 500 the mode's `color`
|
|
337
|
+
- **Colors**: `--color-{name}` (black, blue, green, grey, purple, red, white, yellow), each written once and weighted at the root as `--color-{name}-{300|400|500}`: 400 itself, 300 and 500 the mode's `color` weight (in `$themes` `weights`) lightness points lighter and darker
|
|
336
338
|
- **Theme colors**: `--color-surface`, `--color-primary-{300|400|500}` and `--color-text-{300|400|500}`, the only colors that change with the mode, declared by the theme stylesheet (see Theming)
|
|
337
339
|
- **Sizing**: `--size-{300-800}` (12px-80px)
|
|
338
340
|
- **Spacing**: `--spacing-{0-600}`
|
|
@@ -376,7 +378,8 @@ family is its own stylesheet, used where it is extended, so a stylesheet only em
|
|
|
376
378
|
`--gap-vertical` to space children.
|
|
377
379
|
- **text**: `%text`, `%text-crop` (`-top`, `-bottom`, `-first-child`, `-last-child`), `%text-gradient`,
|
|
378
380
|
`%text-line-shadow`, `%text-shiny` and `%text-truncate`.
|
|
379
|
-
- **surface**: `%surface-
|
|
381
|
+
- **surface**: `%surface-raise` / `%surface-lower` (one level up or down), `%surface` (its parent's level) and
|
|
382
|
+
`%surface-root`; all count and color without painting, and `--surface-level` pins any of them.
|
|
380
383
|
- **font/geist**, **font/montserrat**: see Fonts.
|
|
381
384
|
- **drag**, **hidden**, **icon**, **inline** and **skeleton** (painted from `--from` to `--to`).
|
|
382
385
|
|
|
@@ -402,15 +405,18 @@ Each component exposes CSS custom properties:
|
|
|
402
405
|
```typescript
|
|
403
406
|
import theme from '@esportsplus/ui/theme';
|
|
404
407
|
|
|
405
|
-
let mode = theme();
|
|
408
|
+
let mode = theme({ fallback: 'dark', store });
|
|
406
409
|
|
|
407
|
-
mode.set('
|
|
410
|
+
mode.set('light'); // 'dark' | 'light' | 'system'
|
|
408
411
|
```
|
|
409
412
|
|
|
413
|
+
`fallback` (default `'system'`) is the mode shown until the user picks one; `store` keeps their pick across reloads.
|
|
414
|
+
Picking the fallback clears the stored pick, so the page follows the site's default again.
|
|
415
|
+
|
|
410
416
|
`theme.scss` declares the only colors that change with the mode once on `:root`, as a `light-dark()` of their light and
|
|
411
417
|
dark values: `--color-surface` (the page, a 99% neutral in light and `black-400` in dark), `--color-primary-*` (its
|
|
412
418
|
opposite, `black-*` in light and `white-*` in dark), `--color-text` (text, one color, which is `--color-text-400`;
|
|
413
|
-
`--color-text-300` and `-500` derive from it in CSS, each holding the mode's `text` contrast in `$themes` against it, so
|
|
419
|
+
`--color-text-300` and `-500` derive from it in CSS, each holding the mode's `text` weight, a contrast ratio in `$themes` `weights`, against it, so
|
|
414
420
|
setting `--color-text` on `:root` moves all three). It also sets `--background`, `--color` and `color-scheme: light dark`, so with no script at all the page
|
|
415
421
|
follows the operating system.
|
|
416
422
|
|
|
@@ -425,19 +431,24 @@ the `--surface-level` custom property, and reads its colors from that level inst
|
|
|
425
431
|
parent's level with a container style query, so it counts up even set directly inside another surface; levels stop at 6.
|
|
426
432
|
Its tokens follow the state names components use, `default`, `hover`, `active` and `pressed`:
|
|
427
433
|
`--surface-background-*` steps the default from `--color-surface` by the lightness points in each mode's `$themes`
|
|
428
|
-
`surface` map, raised levels lighter and
|
|
434
|
+
`surface` map, raised levels lighter and lowered ones darker (in light mode raised levels climb to white, leaving further
|
|
429
435
|
elevation to the shadow), then moves it for each state, active and hover lighter and pressed darker in both modes;
|
|
430
436
|
`--surface-border-*` moves the matching `--surface-background-*` by the mode's `border` step, darker in light and
|
|
431
437
|
lighter in dark, for lines, rings and small marks; and `--surface-shadow-*` is the
|
|
432
|
-
shadow at the layer's
|
|
433
|
-
|
|
434
|
-
|
|
438
|
+
shadow at the layer's weight, a step on Tailwind v4's `shadow-2xs` to `shadow-2xl` ladder (1 to 7), a step heavier on
|
|
439
|
+
hover and a step lighter when pressed. The weight follows the level (lowered layers 0, dialogs 7), written out as fixed
|
|
440
|
+
shadows for each level; include `surface.surface-shadow($weight)` on a surface to pick another step. A shadow takes the color of what it falls
|
|
435
441
|
on, that background deepened in its own hue, at the mode's shadow `opacity`; `--surface-shadow-
|
|
436
|
-
color` is that color for whatever casts onto a layer, for component shadows and scrims.
|
|
442
|
+
color` is that color for whatever casts onto a layer, for component shadows and scrims. `--surface-primary-{state}` is a
|
|
443
|
+
primary fill on a layer, the mode's `primary` levels below it in light and above it in dark, its states stepped from it as
|
|
444
|
+
the layer's own are. A quiet fill, such as a track
|
|
437
445
|
or an inline code chip, is a surface of its own a level below what holds it. Dialogs reset the stack to level 1 wherever they open. Another level is never a color to paint: a
|
|
438
|
-
component reaches it by extending `%surface-
|
|
439
|
-
`%surface-
|
|
440
|
-
|
|
446
|
+
component reaches it by extending `%surface-raise` or `%surface-lower` (one level up or down), `%surface` (its
|
|
447
|
+
parent's level) or `%surface-root`, or by setting `--surface-level` on one to pin it, so whatever sits in it reads its
|
|
448
|
+
states from the level it shows; only a layer moved up casts a shadow. None of them paint: set
|
|
449
|
+
`background`/`box-shadow` from `--surface-background-default`/`--surface-shadow-default`, or extend
|
|
450
|
+
`%background-surface`, `%border-surface` and `%box-shadow-surface` with their state placeholders for fills that step with
|
|
451
|
+
the state. Style queries on custom
|
|
441
452
|
properties need Chrome and Edge 111, Safari 18 or Firefox 151; elsewhere every surface keeps its parent's level. The
|
|
442
453
|
ladder and shadows live in each mode's `surface` map in `$themes` (`tokens/scss/color.scss`), with `shadow` holding its
|
|
443
454
|
`depth` and `opacity`; the Tailwind shadow ladder itself sits with the surface utilities, and `surface.shadow($weight)`
|
package/RULES.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Rules
|
|
2
|
+
|
|
3
|
+
Component conventions. Reference implementation: `src/components/button`.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Directory structure
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
src/components/{component}/
|
|
10
|
+
├── index.ts barrel; imports './scss/index.scss' and exports the default object
|
|
11
|
+
├── {variant}.ts one file per sub-component (copy.ts, kbd.ts, split.ts, ...)
|
|
12
|
+
├── {variant}/ a sub-component spanning several files (index.ts, template.ts, save.ts, ...)
|
|
13
|
+
└── scss/
|
|
14
|
+
├── index.scss logic, rules, structure
|
|
15
|
+
├── variables.scss css variables only
|
|
16
|
+
└── _{partial}.scss optional partials when index.scss grows too large (see tooltip)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- SCSS always lives in `{component}/scss/`; CSS-only components may have nothing but `scss/`.
|
|
20
|
+
- `index.ts` imports sub-components alphabetically, then `./scss/index.scss`, and exports a typed object of them:
|
|
21
|
+
`const button: { copy: typeof copy, ... } = { copy, ... }; export default button;`
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## TypeScript
|
|
25
|
+
|
|
26
|
+
- Use CSS whenever it can do the job, so the browser does the work instead of the script. States (`:hover`, `:active`,
|
|
27
|
+
`:focus-visible`, `:has()`), transitions, `@starting-style`, layout and `@media` preferences belong in SCSS. Keep TS
|
|
28
|
+
for what CSS can't express, such as measuring layout or state CSS can't see.
|
|
29
|
+
- Build components with `@esportsplus/template` (`component`, `html`, attribute objects) and
|
|
30
|
+
`@esportsplus/reactivity` (`reactive`, ...). We own both libraries; use them for as much as possible.
|
|
31
|
+
- Don't manipulate the DOM directly (`addEventListener`, `classList`, `setAttribute`, `appendChild`, manual `window`
|
|
32
|
+
listeners, ...) when template has a way to do it. Template handles cleanup and lifecycle. For example, bind
|
|
33
|
+
`onwindowkeydown` / `onpointerdown` and reactive `class: () => ...` in the attribute object, as `button/kbd.ts` does.
|
|
34
|
+
- Optimize with fine-grained reactivity: keep state in `reactive(...)` and bind functions only where a value changes,
|
|
35
|
+
so updates touch only the affected node or attribute. Never re-render whole templates for a small change.
|
|
36
|
+
- Drop to raw DOM only when neither library covers the case (e.g. measuring layout). Keep it minimal and say why in a
|
|
37
|
+
comment.
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## index.scss vs variables.scss
|
|
41
|
+
|
|
42
|
+
- `index.scss` holds the logic: layout, properties, selectors, transitions, keyframes. Values come from `var(--*)`, not literals.
|
|
43
|
+
- `variables.scss` holds only css variables (plus themed `%placeholder` extends such as `%background-primary`). They act as
|
|
44
|
+
arguments: every tunable value is a variable so variants and consumers can finely control the component without
|
|
45
|
+
touching the logic.
|
|
46
|
+
- `index.scss` `@use`s `variables`; both `@use '/tokens'` and any `css-utilities/*` they need, alphabetically.
|
|
47
|
+
- Variants (`&--primary`, `&--kbd`, ...) should mostly be variable overrides in `variables.scss`; only add rules to
|
|
48
|
+
`index.scss` when the structure actually changes.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## Variables
|
|
52
|
+
|
|
53
|
+
- Split multi-value properties into one variable per axis/side so the logic can compute with each part:
|
|
54
|
+
`--padding-horizontal` / `--padding-vertical`, `--gap-horizontal` / `--gap-vertical`. A single `--padding` would need
|
|
55
|
+
parsing of 1/2/4-value shorthands. Example from button:
|
|
56
|
+
```scss
|
|
57
|
+
padding-block: max(0px, calc(var(--padding-vertical) - var(--border-width)));
|
|
58
|
+
padding-inline: max(0px, calc(var(--padding-horizontal) - var(--border-width)));
|
|
59
|
+
```
|
|
60
|
+
- Variables live on the selector that consumes them, not on a parent with a prefix. The icon's size is `--size` set on
|
|
61
|
+
`.button-icon` / `&-kbd-icon.icon`, not `--icon-size` on `.button` that reaches down into the child. Prefixes are
|
|
62
|
+
only for distinct concerns of the same selector that would otherwise collide, e.g. `card--morph`'s `--morph-duration`,
|
|
63
|
+
`--morph-fade-duration` alongside its own `--transition-duration`.
|
|
64
|
+
- Stateful values use a `-default` / `-hover` / `-active` / `-pressed` family, with the bare variable resolving to the
|
|
65
|
+
current state: `--background: var(--background-default)`.
|
|
66
|
+
- Timing is always a pair: `--transition-duration` + `--transition-timing-function` (likewise `--{name}-duration` /
|
|
67
|
+
`--{name}-timing-function` for animations, e.g. `--shake-duration`).
|
|
68
|
+
- Prefer tokens (`--size-*`, `--border-radius-*`, `--font-size-*`, `--color-*`) over raw values.
|
|
69
|
+
- Reduced motion is handled by zeroing durations or removing transitions/animations under
|
|
70
|
+
`@media (prefers-reduced-motion: reduce)`.
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## Naming (BEM-like)
|
|
74
|
+
|
|
75
|
+
- Block: `.button`
|
|
76
|
+
- Modifier: `.button--kbd`, `.button--processing` (double dash)
|
|
77
|
+
- Element: `.button-face`, `.button-split-chevron` (single dash, not `__`)
|
|
78
|
+
- Element modifier: `.button-face--error`, `.button-icon--draw`
|
|
79
|
+
- Modifier element/sub-state: `.button--morph-error`, `.button--sidebar-right`
|
|
80
|
+
- States use the `tokens.state(...)` mixin (`--active`, `pressed`, ...), not hand-written state classes.
|
|
81
|
+
- Always build names with `&--` / `&-` nesting rather than repeating the block name.
|
|
82
|
+
- Nested/chained selectors are fine when composing components or winning specificity regardless of load order
|
|
83
|
+
(`& > &-menu > &-trigger`, `&-kbd-icon.icon`, `> .tooltip-menu-layer > .tooltip-menu-panel`). Use `:where()` for
|
|
84
|
+
zero-specificity defaults that the other component should be able to override.
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## Keyframes
|
|
88
|
+
|
|
89
|
+
- Name keyframes after the class that uses them when possible: `.button--processing` → `button--processing`. When a
|
|
90
|
+
name describes the motion rather than a single class, prefix it with the block/element path (`button-icon-draw`,
|
|
91
|
+
`button-morph-shake`).
|
|
92
|
+
- Place them either nested inside the class using them or at the bottom of `index.scss`.
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
## Ordering
|
|
96
|
+
|
|
97
|
+
Alphabetize everything: `@use` statements, selectors, properties, variables, transition lists, `@extend` lists.
|
|
98
|
+
|
|
99
|
+
Within a block, in this order. Two blank lines separate each group; one blank line separates rules within a group:
|
|
100
|
+
|
|
101
|
+
1. `@extend`s, then variables (`--*`), then properties — each alphabetical
|
|
102
|
+
2. Pseudo elements (`&::after`), nested `:where()` / descendant rules, `@media` for the block itself
|
|
103
|
+
3. Modifiers `&--*`, alphabetical
|
|
104
|
+
4. Elements `&-*`, alphabetical
|
|
105
|
+
5. State / relational selectors (`&:has(...)`, `&:not(...)`) and descendant selectors (`.button-check`, `svg`)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
## SCSS style
|
|
109
|
+
|
|
110
|
+
- Use nesting wherever possible: `&--`, `&-`, `&::before`, `&:focus-visible`, `@media` and `@include tokens.state()`
|
|
111
|
+
nested inside the selector they affect.
|
|
112
|
+
- Reuse `css-utilities` placeholders via `@extend` (`%absolute-center`, `%hidden-visually`, `%icon-stroke`, ...) instead
|
|
113
|
+
of rewriting their rules.
|
|
114
|
+
- Use `@each` loops for symmetric variants (`left`/`right`) instead of duplicating rules.
|
|
115
|
+
- Comments only for a non-obvious why (specificity tricks, timing choices, math); never restate the code.
|