@esportsplus/ui 0.63.0 → 0.64.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 +2 -2
- package/.audit/rules-audit.md +2 -2
- package/README.md +15 -18
- package/RULES.md +80 -9
- package/bin/agent-cli +300 -0
- package/build/components/accordion/index.d.ts +4 -0
- package/build/components/accordion/index.js +13 -10
- package/build/components/breadcrumb/index.d.ts +1 -0
- package/build/components/breadcrumb/index.js +43 -37
- package/build/components/breadcrumb/scss/index.scss +1 -1
- package/build/components/button/kbd.d.ts +1 -1
- package/build/components/button/kbd.js +17 -15
- package/build/components/button/scss/index.scss +1 -1
- package/build/components/button/split.js +14 -16
- package/build/components/capslock/scss/index.scss +1 -1
- package/build/components/card/scss/index.scss +1 -1
- package/build/components/chat/minimap/index.js +4 -5
- package/build/components/checkbox/group.d.ts +1 -0
- package/build/components/checkbox/group.js +21 -20
- package/build/components/checkbox/scss/index.scss +1 -1
- package/build/components/color-picker/index.js +6 -6
- package/build/components/color-picker/scss/index.scss +1 -1
- package/build/components/command/index.d.ts +1 -1
- package/build/components/command/palette.d.ts +13 -9
- package/build/components/command/palette.js +143 -152
- package/build/components/command/scss/index.scss +1 -1
- package/build/components/command/search.d.ts +5 -7
- package/build/components/command/search.js +6 -26
- package/build/components/counter/scss/index.scss +1 -1
- package/build/components/editor/code/commands.js +1 -1
- package/build/components/editor/code/document.d.ts +1 -3
- package/build/components/editor/code/document.js +1 -1
- package/build/components/editor/code/editor.d.ts +18 -6
- package/build/components/editor/code/editor.js +9 -7
- package/build/components/editor/code/features.js +27 -18
- package/build/components/editor/code/find.d.ts +1 -1
- package/build/components/editor/code/find.js +5 -6
- package/build/components/editor/code/folding.d.ts +3 -5
- package/build/components/editor/code/folding.js +2 -15
- package/build/components/editor/code/gutter.js +2 -2
- package/build/components/editor/code/index.d.ts +1 -0
- package/build/components/editor/code/index.js +1 -0
- package/build/components/editor/code/minimap.d.ts +3 -1
- package/build/components/editor/code/minimap.js +31 -5
- package/build/components/editor/code/services/model.js +2 -1
- package/build/components/editor/code/syntax.js +2 -1
- package/build/components/editor/code/view.d.ts +8 -2
- package/build/components/editor/code/view.js +37 -56
- package/build/components/editor/diffs/index.d.ts +1 -0
- package/build/components/editor/diffs/index.js +1 -0
- package/build/components/editor/diffs/merge.js +16 -17
- package/build/components/editor/diffs/view.js +10 -11
- package/build/components/editor/markdown/editing.d.ts +2 -1
- package/build/components/editor/markdown/editing.js +14 -5
- package/build/components/editor/markdown/format.d.ts +1 -1
- package/build/components/editor/markdown/format.js +116 -26
- package/build/components/editor/markdown/layout.js +2 -1
- package/build/components/editor/markdown/model.d.ts +1 -2
- package/build/components/editor/markdown/model.js +1 -29
- package/build/components/editor/markdown/render.js +1 -1
- package/build/components/editor/markdown/template.d.ts +3 -10
- package/build/components/editor/markdown/template.js +2 -29
- package/build/components/editor/markdown/toolbar.d.ts +2 -2
- package/build/components/editor/markdown/toolbar.js +90 -126
- package/build/components/editor/markdown/view.d.ts +1 -1
- package/build/components/editor/markdown/view.js +54 -87
- package/build/components/editor/tree/drag.js +1 -1
- package/build/components/editor/tree/find.js +70 -64
- package/build/components/editor/tree/template.js +8 -7
- package/build/components/editor/viewer/model.d.ts +1 -1
- package/build/components/editor/viewer/template.js +4 -26
- package/build/components/editor/workspace/keybindings.d.ts +1 -1
- package/build/components/editor/workspace/model.d.ts +12 -2
- package/build/components/editor/workspace/model.js +87 -31
- package/build/components/editor/workspace/session.d.ts +2 -6
- package/build/components/editor/workspace/session.js +99 -16
- package/build/components/editor/workspace/status.d.ts +1 -1
- package/build/components/editor/workspace/strip.d.ts +10 -9
- package/build/components/editor/workspace/strip.js +99 -141
- package/build/components/editor/workspace/tabs.d.ts +2 -4
- package/build/components/editor/workspace/tabs.js +1 -14
- package/build/components/editor/workspace/template.d.ts +1 -1
- package/build/components/editor/workspace/template.js +305 -435
- package/build/components/error/index.d.ts +4 -13
- package/build/components/error/index.js +53 -172
- package/build/components/error/scss/index.scss +1 -1
- package/build/components/form/action.d.ts +2 -2
- package/build/components/form/action.js +2 -2
- package/build/components/form/input.d.ts +3 -3
- package/build/components/form/input.js +32 -10
- package/build/components/frame/scss/index.scss +1 -1
- package/build/components/group/index.js +96 -9
- package/build/components/group/scss/index.scss +1 -1
- package/build/components/heatmap/scss/index.scss +1 -1
- package/build/components/highlight/index.js +55 -48
- package/build/components/highlight/scss/index.scss +1 -1
- package/build/components/icon/scss/index.scss +1 -1
- package/build/components/image/scss/index.scss +1 -1
- package/build/components/index.d.ts +3 -6
- package/build/components/index.js +3 -6
- package/build/components/inline-edit/index.d.ts +2 -2
- package/build/components/inline-edit/index.js +5 -5
- package/build/components/inline-edit/rich.js +4 -4
- package/build/components/inline-edit/scss/index.scss +1 -1
- package/build/components/inline-edit/status.js +1 -0
- package/build/components/input/index.d.ts +4 -0
- package/build/components/input/index.js +3 -1
- package/build/components/input/otp.d.ts +18 -0
- package/build/components/input/otp.js +112 -0
- package/build/components/input/password.d.ts +15 -0
- package/build/components/input/password.js +163 -0
- package/build/components/input/scrub.d.ts +1 -0
- package/build/components/input/scrub.js +103 -89
- package/build/components/input/scss/index.scss +1 -1
- package/build/components/input/tag.d.ts +5 -0
- package/build/components/input/tag.js +116 -69
- package/build/components/json/download.js +1 -1
- package/build/components/link/scss/index.scss +1 -1
- package/build/components/marquee/index.js +1 -1
- package/build/components/marquee/scss/index.scss +1 -1
- package/build/components/nav/scss/index.scss +1 -1
- package/build/components/nav/tree.d.ts +2 -1
- package/build/components/nav/tree.js +6 -5
- package/build/components/notification/index.js +3 -3
- package/build/components/notification/scss/index.scss +1 -1
- package/build/components/overlay/popup.d.ts +2 -2
- package/build/components/overlay/popup.js +1 -1
- package/build/components/overlay/scss/index.scss +1 -1
- package/build/components/pagination/arrows.js +2 -3
- package/build/components/pagination/cards.js +2 -3
- package/build/components/pagination/index.d.ts +2 -3
- package/build/components/pagination/index.js +18 -13
- package/build/components/pagination/scss/index.scss +1 -1
- package/build/components/progress/index.js +1 -1
- package/build/components/progress/scss/index.scss +1 -1
- package/build/components/progress/text.js +3 -3
- package/build/components/range/filter.d.ts +7 -1
- package/build/components/range/filter.js +188 -171
- package/build/components/range/index.d.ts +14 -9
- package/build/components/range/index.js +11 -8
- package/build/components/range/scss/index.scss +1 -1
- package/build/components/range/surface.d.ts +21 -0
- package/build/components/range/surface.js +144 -0
- package/build/components/relative-time/index.js +2 -2
- package/build/components/relative-time/scss/index.scss +1 -1
- package/build/components/root/scss/index.scss +1 -1
- package/build/components/{preview/header.d.ts → search/button.d.ts} +3 -3
- package/build/components/search/button.js +18 -0
- package/build/components/search/index.d.ts +8 -0
- package/build/components/search/index.js +5 -0
- package/build/components/search/input.d.ts +9 -0
- package/build/components/search/input.js +23 -0
- package/build/components/search/parts.d.ts +5 -0
- package/build/components/search/parts.js +17 -0
- package/build/components/search/scss/index.scss +2 -0
- package/build/components/select/expand.js +4 -5
- package/build/components/select/index.d.ts +7 -7
- package/build/components/select/index.js +127 -117
- package/build/components/select/placement.js +8 -1
- package/build/components/select/scss/index.scss +1 -1
- package/build/components/{panels → shell}/group.d.ts +21 -5
- package/build/components/shell/group.js +336 -0
- package/build/components/shell/index.d.ts +15 -17
- package/build/components/shell/index.js +583 -238
- package/build/components/shell/model.d.ts +94 -0
- package/build/components/{panels → shell}/model.js +199 -73
- package/build/components/shell/resize.d.ts +5 -0
- package/build/components/{panels → shell}/resize.js +54 -30
- package/build/components/shell/scss/index.scss +1 -1
- package/build/components/shell/sidebar.d.ts +34 -0
- package/build/components/shell/sidebar.js +362 -0
- package/build/components/{panels → shell}/subtree.js +7 -8
- package/build/components/shortcut-recorder/index.d.ts +5 -4
- package/build/components/shortcut-recorder/index.js +69 -44
- package/build/components/shortcut-recorder/scss/index.scss +1 -1
- package/build/components/sortable/index.d.ts +16 -2
- package/build/components/sortable/index.js +237 -134
- package/build/components/sortable/scss/index.scss +1 -1
- package/build/components/story/index.js +46 -34
- package/build/components/story/scss/index.scss +1 -1
- package/build/components/surface-field/engine.d.ts +2 -0
- package/build/components/surface-field/engine.js +86 -33
- package/build/components/surface-field/index.d.ts +26 -4
- package/build/components/surface-field/index.js +35 -4
- package/build/components/surface-field/scss/index.scss +1 -1
- package/build/components/surface-field/surface.d.ts +13 -1
- package/build/components/surface-field/surface.js +149 -58
- package/build/components/tasklist/index.d.ts +1 -4
- package/build/components/tasklist/index.js +36 -43
- package/build/components/tasklist/scss/index.scss +1 -1
- package/build/components/textarea/index.d.ts +1 -1
- package/build/components/textarea/index.js +14 -14
- package/build/components/theme/scss/index.scss +1 -1
- package/build/components/theme/shared.d.ts +1 -2
- package/build/components/theme/shared.js +2 -5
- package/build/components/toast/index.d.ts +3 -3
- package/build/components/toast/index.js +3 -3
- package/build/components/toast/scss/index.scss +1 -1
- package/build/components/toolbar/index.d.ts +91 -0
- package/build/components/toolbar/index.js +1281 -0
- package/build/components/toolbar/scss/index.scss +2 -0
- package/build/components/tooltip/menu.d.ts +9 -8
- package/build/components/tooltip/menu.js +397 -279
- package/build/components/tooltip/onclick.d.ts +2 -0
- package/build/components/tooltip/onclick.js +13 -4
- package/build/components/tooltip/onhover.d.ts +3 -1
- package/build/components/tooltip/onhover.js +10 -9
- package/build/components/tooltip/scss/index.scss +1 -1
- package/build/components/tooltip/shared.d.ts +4 -4
- package/build/components/tooltip/shared.js +27 -46
- package/build/components/tooltip/utilities.d.ts +5 -2
- package/build/components/tooltip/utilities.js +169 -9
- package/build/components/typewriter/rotate.js +6 -6
- package/build/components/typewriter/scss/index.scss +1 -1
- package/build/components/uptime/scss/index.scss +1 -1
- package/build/components/usage-meter/index.js +1 -1
- package/build/components/usage-meter/scss/index.scss +1 -1
- package/build/css-utilities/font/montserrat/OFL.txt +93 -0
- package/build/shared/drag.d.ts +15 -9
- package/build/shared/drag.js +41 -28
- package/build/shared/placement.d.ts +39 -0
- package/build/shared/placement.js +55 -0
- package/build/shared/transition.js +1 -1
- package/build/shared/viewport.d.ts +1 -2
- package/build/shared/viewport.js +1 -4
- package/package.json +2 -5
- package/src/components/accordion/index.ts +12 -5
- package/src/components/announcement/index.ts +1 -1
- package/src/components/breadcrumb/index.ts +13 -3
- package/src/components/breadcrumb/scss/index.scss +6 -6
- package/src/components/breadcrumb/scss/variables.scss +7 -0
- package/src/components/button/kbd.ts +22 -17
- package/src/components/button/scss/index.scss +69 -76
- package/src/components/button/scss/variables.scss +51 -18
- package/src/components/button/split.ts +12 -8
- package/src/components/capslock/index.ts +2 -0
- package/src/components/capslock/scss/index.scss +21 -21
- package/src/components/card/scss/index.scss +16 -0
- package/src/components/card/scss/variables.scss +25 -2
- package/src/components/chat/minimap/index.ts +5 -6
- package/src/components/chat/minimap/scss/index.scss +12 -11
- package/src/components/chat/minimap/scss/variables.scss +23 -17
- package/src/components/checkbox/group.ts +8 -7
- package/src/components/checkbox/scss/index.scss +59 -35
- package/src/components/checkbox/scss/variables.scss +24 -17
- package/src/components/color-picker/index.ts +6 -6
- package/src/components/color-picker/scss/index.scss +35 -22
- package/src/components/color-picker/scss/variables.scss +11 -3
- package/src/components/command/index.ts +1 -1
- package/src/components/command/palette.ts +174 -166
- package/src/components/command/scss/index.scss +18 -51
- package/src/components/command/scss/variables.scss +37 -71
- package/src/components/command/search.ts +9 -31
- package/src/components/counter/index.ts +22 -22
- package/src/components/counter/scss/variables.scss +10 -7
- package/src/components/editor/code/commands.ts +1 -1
- package/src/components/editor/code/document.ts +0 -2
- package/src/components/editor/code/editor.ts +31 -13
- package/src/components/editor/code/features.ts +39 -24
- package/src/components/editor/code/find.ts +5 -6
- package/src/components/editor/code/folding.ts +3 -21
- package/src/components/editor/code/gutter.ts +2 -2
- package/src/components/editor/code/index.ts +1 -0
- package/src/components/editor/code/minimap.ts +39 -5
- package/src/components/editor/code/scss/_editor.scss +28 -21
- package/src/components/editor/code/scss/_features.scss +19 -21
- package/src/components/editor/code/scss/_services.scss +14 -11
- package/src/components/editor/code/scss/variables.scss +31 -12
- package/src/components/editor/code/services/model.ts +2 -1
- package/src/components/editor/code/syntax.ts +2 -1
- package/src/components/editor/code/view.ts +22 -45
- package/src/components/editor/diffs/index.ts +1 -0
- package/src/components/editor/diffs/merge.ts +9 -10
- package/src/components/editor/diffs/scss/_diffs.scss +39 -63
- package/src/components/editor/diffs/scss/_merge.scss +10 -2
- package/src/components/editor/diffs/scss/index.scss +0 -1
- package/src/components/editor/diffs/scss/variables.scss +36 -17
- package/src/components/editor/diffs/view.ts +8 -9
- package/src/components/editor/markdown/editing.ts +18 -6
- package/src/components/editor/markdown/format.ts +180 -32
- package/src/components/editor/markdown/layout.ts +2 -1
- package/src/components/editor/markdown/model.ts +0 -38
- package/src/components/editor/markdown/render.ts +1 -1
- package/src/components/editor/markdown/scss/index.scss +38 -52
- package/src/components/editor/markdown/scss/variables.scss +24 -50
- package/src/components/editor/markdown/template.ts +3 -63
- package/src/components/editor/markdown/toolbar.ts +76 -127
- package/src/components/editor/markdown/view.ts +9 -32
- package/src/components/editor/tree/drag.ts +1 -1
- package/src/components/editor/tree/find.ts +61 -64
- package/src/components/editor/tree/scss/index.scss +29 -30
- package/src/components/editor/tree/scss/variables.scss +34 -15
- package/src/components/editor/tree/template.ts +9 -9
- package/src/components/editor/viewer/model.ts +1 -1
- package/src/components/editor/viewer/scss/_viewer.scss +4 -5
- package/src/components/editor/viewer/scss/variables.scss +3 -3
- package/src/components/editor/viewer/template.ts +4 -31
- package/src/components/editor/workspace/keybindings.ts +1 -1
- package/src/components/editor/workspace/model.ts +136 -37
- package/src/components/editor/workspace/scss/_keybindings.scss +3 -20
- package/src/components/editor/workspace/scss/_status.scss +0 -1
- package/src/components/editor/workspace/scss/_tabs.scss +2 -41
- package/src/components/editor/workspace/scss/index.scss +49 -71
- package/src/components/editor/workspace/scss/variables.scss +1 -135
- package/src/components/editor/workspace/session.ts +138 -18
- package/src/components/editor/workspace/status.ts +1 -1
- package/src/components/editor/workspace/strip.ts +96 -115
- package/src/components/editor/workspace/tabs.ts +2 -23
- package/src/components/editor/workspace/template.ts +323 -458
- package/src/components/error/index.ts +47 -183
- package/src/components/error/scss/index.scss +34 -35
- package/src/components/error/scss/variables.scss +14 -26
- package/src/components/filter/scss/index.scss +6 -5
- package/src/components/form/action.ts +7 -7
- package/src/components/form/input.ts +25 -12
- package/src/components/frame/scss/index.scss +5 -5
- package/src/components/group/index.ts +77 -2
- package/src/components/group/scss/index.scss +164 -0
- package/src/components/group/scss/variables.scss +110 -2
- package/src/components/heatmap/scss/variables.scss +13 -10
- package/src/components/highlight/index.ts +87 -79
- package/src/components/highlight/scss/index.scss +6 -16
- package/src/components/highlight/scss/variables.scss +33 -5
- package/src/components/icon/scss/index.scss +2 -2
- package/src/components/icon/scss/variables.scss +14 -1
- package/src/components/image/scss/index.scss +9 -9
- package/src/components/image/scss/variables.scss +1 -1
- package/src/components/index.ts +3 -6
- package/src/components/inline-edit/index.ts +8 -6
- package/src/components/inline-edit/rich.ts +8 -8
- package/src/components/inline-edit/scss/index.scss +50 -36
- package/src/components/inline-edit/scss/variables.scss +28 -18
- package/src/components/inline-edit/status.ts +2 -0
- package/src/components/input/index.ts +3 -1
- package/src/components/input/otp.ts +175 -0
- package/src/components/input/password.ts +178 -0
- package/src/components/input/scrub.ts +197 -178
- package/src/components/input/scss/index.scss +344 -4
- package/src/components/input/scss/variables.scss +234 -65
- package/src/components/input/tag.ts +98 -53
- package/src/components/json/download.ts +2 -5
- package/src/components/link/scss/index.scss +3 -5
- package/src/components/loading/scss/index.scss +1 -0
- package/src/components/loading/scss/variables.scss +1 -0
- package/src/components/marquee/index.ts +1 -1
- package/src/components/marquee/scss/index.scss +11 -4
- package/src/components/nav/scss/index.scss +10 -26
- package/src/components/nav/scss/variables.scss +13 -23
- package/src/components/nav/tree.ts +10 -8
- package/src/components/notification/index.ts +3 -3
- package/src/components/notification/scss/index.scss +7 -14
- package/src/components/notification/scss/variables.scss +10 -2
- package/src/components/number/index.ts +1 -1
- package/src/components/overlay/popup.ts +2 -2
- package/src/components/overlay/scss/index.scss +60 -51
- package/src/components/page/scss/variables.scss +1 -0
- package/src/components/pagination/arrows.ts +2 -3
- package/src/components/pagination/cards.ts +2 -3
- package/src/components/pagination/index.ts +11 -9
- package/src/components/pagination/scss/index.scss +38 -101
- package/src/components/pagination/scss/variables.scss +24 -75
- package/src/components/progress/index.ts +1 -1
- package/src/components/progress/scss/index.scss +22 -11
- package/src/components/progress/scss/variables.scss +13 -5
- package/src/components/progress/text.ts +3 -3
- package/src/components/range/filter.ts +249 -246
- package/src/components/range/index.ts +22 -7
- package/src/components/range/scss/index.scss +470 -15
- package/src/components/range/scss/variables.scss +402 -198
- package/src/components/range/surface.ts +135 -0
- package/src/components/relative-time/index.ts +2 -2
- package/src/components/relative-time/scss/index.scss +4 -2
- package/src/components/relative-time/scss/variables.scss +4 -5
- package/src/components/root/scss/index.scss +11 -11
- package/src/components/root/scss/variables.scss +4 -4
- package/src/components/search/button.ts +24 -0
- package/src/components/search/index.ts +12 -0
- package/src/components/search/input.ts +35 -0
- package/src/components/search/parts.ts +24 -0
- package/src/components/search/scss/index.scss +36 -0
- package/src/components/search/scss/variables.scss +67 -0
- package/src/components/section/scss/variables.scss +1 -0
- package/src/components/select/expand.ts +3 -4
- package/src/components/select/index.ts +55 -41
- package/src/components/select/placement.ts +17 -1
- package/src/components/select/scss/index.scss +57 -29
- package/src/components/select/scss/variables.scss +91 -53
- package/src/components/{panels → shell}/group.ts +151 -98
- package/src/components/shell/index.ts +805 -284
- package/src/components/{panels → shell}/model.ts +329 -102
- package/src/components/shell/resize.ts +176 -0
- package/src/components/shell/scss/index.scss +502 -89
- package/src/components/shell/scss/variables.scss +264 -39
- package/src/components/shell/sidebar.ts +325 -0
- package/src/components/{panels → shell}/subtree.ts +1 -2
- package/src/components/shortcut-recorder/index.ts +99 -61
- package/src/components/shortcut-recorder/scss/index.scss +76 -52
- package/src/components/shortcut-recorder/scss/variables.scss +25 -30
- package/src/components/sortable/index.ts +364 -63
- package/src/components/sortable/scss/index.scss +22 -2
- package/src/components/sortable/scss/variables.scss +16 -4
- package/src/components/story/index.ts +56 -33
- package/src/components/story/scss/index.scss +67 -16
- package/src/components/story/scss/variables.scss +59 -18
- package/src/components/surface-field/engine.ts +157 -61
- package/src/components/surface-field/index.ts +64 -9
- package/src/components/surface-field/scss/index.scss +88 -77
- package/src/components/surface-field/scss/variables.scss +84 -36
- package/src/components/surface-field/surface.ts +225 -76
- package/src/components/tasklist/index.ts +10 -14
- package/src/components/tasklist/scss/index.scss +25 -45
- package/src/components/tasklist/scss/variables.scss +12 -29
- package/src/components/textarea/index.ts +39 -42
- package/src/components/theme/reveal.ts +1 -0
- package/src/components/theme/scss/index.scss +20 -16
- package/src/components/theme/scss/variables.scss +11 -5
- package/src/components/theme/shared.ts +3 -7
- package/src/components/toast/index.ts +7 -8
- package/src/components/toast/scss/index.scss +44 -36
- package/src/components/toast/scss/variables.scss +36 -33
- package/src/components/toolbar/index.ts +1675 -0
- package/src/components/toolbar/scss/index.scss +759 -0
- package/src/components/toolbar/scss/variables.scss +555 -0
- package/src/components/tooltip/menu.ts +301 -220
- package/src/components/tooltip/onclick.ts +18 -3
- package/src/components/tooltip/onhover.ts +13 -9
- package/src/components/tooltip/scss/index.scss +155 -188
- package/src/components/tooltip/scss/variables.scss +151 -135
- package/src/components/tooltip/shared.ts +47 -74
- package/src/components/tooltip/utilities.ts +151 -10
- package/src/components/truncate/index.ts +1 -1
- package/src/components/typewriter/rotate.ts +6 -6
- package/src/components/typewriter/scss/index.scss +14 -5
- package/src/components/uptime/scss/index.scss +8 -15
- package/src/components/uptime/scss/variables.scss +12 -1
- package/src/components/usage-meter/index.ts +1 -1
- package/src/components/usage-meter/scss/index.scss +6 -4
- package/src/components/usage-meter/scss/variables.scss +11 -11
- package/src/css-utilities/box-shadow.scss +0 -1
- package/src/css-utilities/icon.scss +9 -9
- package/src/css-utilities/surface.scss +27 -17
- package/src/modifiers/glass/index.ts +2 -2
- package/src/modifiers/glass/scss/index.scss +2 -2
- package/src/normalize/scss/index.scss +1 -1
- package/src/shared/drag.ts +92 -53
- package/src/shared/placement.ts +145 -0
- package/src/shared/transition.ts +1 -1
- package/src/shared/viewport.ts +1 -7
- package/src/tokens/scss/color.scss +2 -2
- package/src/tokens/scss/scale.scss +5 -1
- package/src/tokens/scss/size.scss +0 -7
- package/storage/svg/angle.svg +1 -0
- package/storage/svg/{chevron-left.svg → arrow.svg} +1 -1
- package/storage/svg/calendar.svg +1 -0
- package/storage/svg/circle-filled.svg +1 -0
- package/storage/svg/cursor-arrow-left.svg +1 -0
- package/storage/svg/cursor-arrow-right.svg +1 -0
- package/storage/svg/fit.svg +1 -0
- package/storage/svg/grip.svg +1 -0
- package/storage/svg/mail.svg +1 -0
- package/storage/svg/{chevron-down.svg → minus.svg} +1 -1
- package/storage/svg/music.svg +1 -0
- package/storage/svg/{chevron-up.svg → rotate-ccw.svg} +1 -1
- package/vite.config.ts +9 -13
- package/build/components/dock/index.d.ts +0 -47
- package/build/components/dock/index.js +0 -469
- package/build/components/dock/scss/index.scss +0 -2
- package/build/components/metric/flash.d.ts +0 -12
- package/build/components/metric/flash.js +0 -117
- package/build/components/metric/index.d.ts +0 -44
- package/build/components/metric/index.js +0 -275
- package/build/components/metric/scss/index.scss +0 -2
- package/build/components/pagination/dots.d.ts +0 -23
- package/build/components/pagination/dots.js +0 -115
- package/build/components/panels/dnd.d.ts +0 -47
- package/build/components/panels/dnd.js +0 -114
- package/build/components/panels/group.js +0 -322
- package/build/components/panels/index.d.ts +0 -17
- package/build/components/panels/index.js +0 -524
- package/build/components/panels/model.d.ts +0 -64
- package/build/components/panels/resize.d.ts +0 -9
- package/build/components/panels/scss/index.scss +0 -2
- package/build/components/preview/buttons.d.ts +0 -12
- package/build/components/preview/buttons.js +0 -26
- package/build/components/preview/code.d.ts +0 -8
- package/build/components/preview/code.js +0 -18
- package/build/components/preview/header.js +0 -21
- package/build/components/preview/index.d.ts +0 -37
- package/build/components/preview/index.js +0 -123
- package/build/components/preview/scss/index.scss +0 -2
- package/build/components/preview/source.d.ts +0 -12
- package/build/components/preview/source.js +0 -79
- package/build/components/preview/stage.d.ts +0 -8
- package/build/components/preview/stage.js +0 -28
- package/build/components/textarea/scss/index.scss +0 -2
- package/src/components/dock/index.ts +0 -567
- package/src/components/dock/scss/index.scss +0 -346
- package/src/components/dock/scss/variables.scss +0 -357
- package/src/components/input/scss/_field.scss +0 -39
- package/src/components/input/scss/_scrub.scss +0 -89
- package/src/components/input/scss/_tag.scss +0 -142
- package/src/components/metric/flash.ts +0 -129
- package/src/components/metric/index.ts +0 -307
- package/src/components/metric/scss/_flash.scss +0 -150
- package/src/components/metric/scss/index.scss +0 -155
- package/src/components/metric/scss/variables.scss +0 -233
- package/src/components/pagination/dots.ts +0 -132
- package/src/components/panels/dnd.ts +0 -190
- package/src/components/panels/index.ts +0 -676
- package/src/components/panels/resize.ts +0 -157
- package/src/components/panels/scss/index.scss +0 -379
- package/src/components/panels/scss/variables.scss +0 -197
- package/src/components/preview/buttons.ts +0 -48
- package/src/components/preview/code.ts +0 -28
- package/src/components/preview/header.ts +0 -23
- package/src/components/preview/index.ts +0 -149
- package/src/components/preview/scss/index.scss +0 -158
- package/src/components/preview/scss/variables.scss +0 -149
- package/src/components/preview/source.ts +0 -73
- package/src/components/preview/stage.ts +0 -33
- package/src/components/range/scss/_filter.scss +0 -360
- package/src/components/range/scss/_slider.scss +0 -65
- package/src/components/range/scss/_vertical.scss +0 -10
- package/src/components/textarea/scss/index.scss +0 -72
- package/src/components/textarea/scss/variables.scss +0 -22
- package/storage/svg/amex.svg +0 -1
- package/storage/svg/arrow-down.svg +0 -1
- package/storage/svg/arrow-left.svg +0 -1
- package/storage/svg/arrow-right.svg +0 -1
- package/storage/svg/arrow-up.svg +0 -1
- package/storage/svg/card.svg +0 -1
- package/storage/svg/chip.svg +0 -1
- package/storage/svg/discover.svg +0 -1
- package/storage/svg/mastercard.svg +0 -1
- package/storage/svg/visa.svg +0 -1
- /package/build/components/{panels → shell}/subtree.d.ts +0 -0
- /package/storage/svg/{chevron-right.svg → chevron.svg} +0 -0
|
@@ -1,68 +1,223 @@
|
|
|
1
1
|
@use '/tokens';
|
|
2
2
|
@use 'css-utilities/background';
|
|
3
|
+
@use 'css-utilities/border';
|
|
4
|
+
@use 'css-utilities/box-shadow';
|
|
3
5
|
@use 'css-utilities/color';
|
|
6
|
+
@use 'css-utilities/font/geist';
|
|
4
7
|
@use 'css-utilities/surface';
|
|
5
|
-
@use 'field';
|
|
6
8
|
|
|
7
9
|
.input {
|
|
8
|
-
@
|
|
10
|
+
@extend %background-state, %border-state, %box-shadow-surface, %box-shadow-state, %color-state;
|
|
11
|
+
--font-size: var(--font-size-400);
|
|
12
|
+
--padding-horizontal: var(--size-300);
|
|
13
|
+
--padding-vertical: var(--size-100);
|
|
14
|
+
--size: var(--size-400);
|
|
9
15
|
|
|
10
16
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
// Wraps and scrolls as a textarea does, resized by hand only in height, since its width is the layout's. Out of
|
|
18
|
+
// alphabetical order and first on purpose: '--autoresize' and '--measure' only ever refine it, so they have to come
|
|
19
|
+
// after it to replace its overflow, resize and white space.
|
|
20
|
+
&--textarea {
|
|
21
|
+
--padding-vertical: var(--size-300);
|
|
22
|
+
--resize: vertical;
|
|
23
|
+
--scrollbar-overflow: auto;
|
|
24
|
+
--white-space: pre-wrap;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Its height is the text's, so it can't be dragged.
|
|
28
|
+
&--autoresize {
|
|
29
|
+
--resize: none;
|
|
30
|
+
--resize-duration: 240ms;
|
|
31
|
+
--resize-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
32
|
+
--scrollbar-gutter: stable;
|
|
33
|
+
--scrollbar-overflow: hidden;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&--border {
|
|
37
|
+
--border-color-active: var(--color-primary-300);
|
|
38
|
+
--border-color-default: var(--surface-border-default);
|
|
39
|
+
--border-color-hover: var(--surface-border-hover);
|
|
40
|
+
--border-color-pressed: var(--surface-border-pressed);
|
|
14
41
|
--border-radius: var(--border-radius-400);
|
|
15
|
-
--
|
|
42
|
+
--border-style: solid;
|
|
43
|
+
--border-width: var(--border-width-default);
|
|
44
|
+
--border-width-active: var(--border-width-500);
|
|
45
|
+
--border-width-default: var(--border-width-400);
|
|
46
|
+
--outline-width: 0px;
|
|
47
|
+
|
|
48
|
+
@include tokens.state(active) {
|
|
49
|
+
--outline-width: max(0px, calc(var(--border-width-active) - var(--border-width)));
|
|
50
|
+
|
|
51
|
+
// Keep the same outline while mouse is held down
|
|
52
|
+
&:active:not(.--focused) {
|
|
53
|
+
--outline-width: 0px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&--compact {
|
|
16
59
|
--font-size: var(--font-size-300);
|
|
17
|
-
--
|
|
60
|
+
--padding-horizontal: var(--size-200);
|
|
61
|
+
--padding-vertical: 6px;
|
|
62
|
+
--size: var(--size-100);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Never scrolls, so its height is its content's; the gutter matches the field's.
|
|
66
|
+
&--measure {
|
|
67
|
+
--scrollbar-gutter: stable;
|
|
68
|
+
--scrollbar-overflow: hidden;
|
|
69
|
+
|
|
70
|
+
&-nowrap {
|
|
71
|
+
--white-space: pre;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// One character to a square cell, its edge taking the brand color while focused.
|
|
76
|
+
&--otp {
|
|
77
|
+
@extend %font-geist-mono;
|
|
78
|
+
--border-color-active: var(--color-primary-300);
|
|
79
|
+
--font-size: var(--font-size-500);
|
|
80
|
+
--font-weight: var(--font-weight-500);
|
|
81
|
+
--padding-horizontal: 0px;
|
|
82
|
+
--padding-vertical: 0px;
|
|
83
|
+
--size: 48px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Only ever set alongside '--autoresize', once the content outgrows its maximum height; after it, so it wins.
|
|
87
|
+
&--scrollbar {
|
|
88
|
+
--scrollbar-overflow: auto;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&--surface {
|
|
92
|
+
@extend %background-surface, %border-surface, %color-text;
|
|
93
|
+
|
|
94
|
+
&-primary {
|
|
95
|
+
@extend %background-surface-primary, %border-surface, %box-shadow-surface;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Read by the field, and by a group floating items over it, which sinks in its place; held still under reduced motion.
|
|
100
|
+
@at-root #{&}--tactile,
|
|
101
|
+
.group:has(> .group-item--overlay):has(> #{&}--tactile) {
|
|
102
|
+
--translate-pressed: 0 1px;
|
|
103
|
+
|
|
104
|
+
@media (prefers-reduced-motion: reduce) {
|
|
105
|
+
--translate-pressed: none;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// A field takes focus, and so its active state, as the press starts, which the pressed state steps aside for. Held
|
|
110
|
+
// here instead, so the press that focuses it shows; one on a field already focused ('--focused') only moves the
|
|
111
|
+
// caret, so it keeps the active state. Chained through ':active' so it wins over the active state regardless of
|
|
112
|
+
// stylesheet order; before '--tactile', which drops the shadow while pressed.
|
|
113
|
+
#{tokens.state(active)}:active:not(.--focused) {
|
|
114
|
+
--background: var(--background-pressed);
|
|
115
|
+
--border-color: var(--border-color-pressed);
|
|
116
|
+
--box-shadow: var(--box-shadow-pressed);
|
|
117
|
+
--color: var(--color-pressed);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Its shadow drops while pressed, unless already focused. Chained through '.input' so it wins over the state's own
|
|
121
|
+
// shadow regardless of stylesheet order.
|
|
122
|
+
&#{&}--tactile:active:not(.--focused) {
|
|
123
|
+
--box-shadow: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
// The cells' gap, and what a group's first cell adds to it to sit a group's width apart; qualified by the group so
|
|
128
|
+
// they win over its own gaps regardless of stylesheet order.
|
|
129
|
+
&-otp.group {
|
|
130
|
+
--gap-horizontal: var(--size-100);
|
|
131
|
+
--input-otp-break: calc(var(--size-500) - var(--size-100));
|
|
132
|
+
}
|
|
18
133
|
|
|
19
|
-
|
|
134
|
+
&-password {
|
|
135
|
+
&-icon.icon {
|
|
136
|
+
--color: currentColor;
|
|
137
|
+
--size: var(--size-400);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&-toggle {
|
|
141
|
+
@extend %background-state, %color-state;
|
|
142
|
+
--background-hover: var(--surface-background-hover);
|
|
143
|
+
--background-pressed: var(--background-hover);
|
|
144
|
+
--border-radius: var(--border-radius-300);
|
|
145
|
+
--color-default: var(--color-text-300);
|
|
146
|
+
--color-hover: var(--color-text-500);
|
|
147
|
+
--color-pressed: var(--color-hover);
|
|
148
|
+
--size: 28px;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&-scrub {
|
|
153
|
+
// Qualified like the rule it feeds, so it wins over the reused input's own value regardless of stylesheet order.
|
|
20
154
|
& > #{&}-field {
|
|
21
|
-
--
|
|
22
|
-
--
|
|
23
|
-
--
|
|
24
|
-
--padding-horizontal: 0px;
|
|
25
|
-
--padding-vertical: 0px;
|
|
155
|
+
// Matches the label's '--padding-horizontal', so the value ends as far in as the label's text starts.
|
|
156
|
+
--padding-end: calc(var(--size-100) / 2);
|
|
157
|
+
--text-align: right;
|
|
26
158
|
}
|
|
27
159
|
|
|
160
|
+
// A square for one letter, growing with longer text so a word keeps the space a single letter has on each side.
|
|
161
|
+
// An icon fills the square on its own.
|
|
28
162
|
&-label {
|
|
29
163
|
@extend %color-state, %color-text;
|
|
30
|
-
--
|
|
164
|
+
--font-size: var(--font-size-300);
|
|
165
|
+
--height: var(--size-600);
|
|
166
|
+
--min-width: var(--size-600);
|
|
167
|
+
--padding-horizontal: calc(var(--size-100) / 2);
|
|
168
|
+
|
|
169
|
+
&:has(svg) {
|
|
170
|
+
--padding-horizontal: 0px;
|
|
171
|
+
}
|
|
31
172
|
}
|
|
32
173
|
|
|
174
|
+
// Hidden until a bordered field is dragged; a borderless one has no edge for it to stand on.
|
|
33
175
|
&-needle {
|
|
34
176
|
--background: var(--color-primary-500);
|
|
35
|
-
--height:
|
|
36
|
-
--
|
|
177
|
+
--height: 8px;
|
|
178
|
+
--opacity: 0;
|
|
179
|
+
--width: 8px;
|
|
37
180
|
}
|
|
38
181
|
|
|
39
|
-
//
|
|
182
|
+
// Faint at rest so it reads as a handle, full under the pointer and while scrubbing; it fades back slower
|
|
183
|
+
// than it arrives.
|
|
40
184
|
&-tape {
|
|
41
185
|
--color: var(--color-primary-300);
|
|
42
|
-
--height:
|
|
43
|
-
--opacity:
|
|
186
|
+
--height: 6px;
|
|
187
|
+
--opacity: var(--opacity-default);
|
|
188
|
+
--opacity-active: 1;
|
|
189
|
+
--opacity-default: 0.16;
|
|
190
|
+
--opacity-hover: 1;
|
|
44
191
|
--transition-duration: 200ms;
|
|
45
192
|
--transition-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
|
|
46
|
-
|
|
193
|
+
// Above the field, which is positioned, so the track takes the pointer along its strip.
|
|
194
|
+
--z-index: 1;
|
|
47
195
|
|
|
48
|
-
|
|
49
|
-
--
|
|
196
|
+
&:hover {
|
|
197
|
+
--opacity: var(--opacity-hover);
|
|
50
198
|
}
|
|
51
199
|
}
|
|
52
200
|
|
|
53
201
|
&-ticks {
|
|
54
|
-
--major-height:
|
|
55
|
-
--minor-height:
|
|
202
|
+
--major-height: 8px;
|
|
203
|
+
--minor-height: 5px;
|
|
56
204
|
// Keep in sync with the component's TICK constant; the tape offset is computed against it.
|
|
57
205
|
--tick: 6px;
|
|
58
206
|
}
|
|
59
207
|
|
|
60
|
-
//
|
|
208
|
+
// The letter or icon scrubs too, so it lights the tape as the tape's own hover does.
|
|
209
|
+
&:has(> #{&}-label:hover) > #{&}-tape {
|
|
210
|
+
--opacity: var(--opacity-hover);
|
|
211
|
+
}
|
|
212
|
+
|
|
61
213
|
@include tokens.state(active) {
|
|
62
|
-
.input-scrub-
|
|
214
|
+
&:has(> .input-scrub-field.input--border) .input-scrub-needle {
|
|
63
215
|
--opacity: 1;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.input-scrub-tape {
|
|
219
|
+
--opacity: var(--opacity-active);
|
|
64
220
|
--transition-duration: 150ms;
|
|
65
|
-
--translate: 0 0;
|
|
66
221
|
}
|
|
67
222
|
}
|
|
68
223
|
}
|
|
@@ -71,18 +226,22 @@
|
|
|
71
226
|
&-tag {
|
|
72
227
|
--color: var(--color-text-500);
|
|
73
228
|
--font-size: var(--font-size-300);
|
|
74
|
-
--gap-horizontal: 0px;
|
|
75
|
-
--gap-vertical: var(--size-100);
|
|
76
229
|
--text-inset-horizontal: var(--size-200);
|
|
77
230
|
--width: min(440px, 100%);
|
|
78
231
|
|
|
79
|
-
|
|
232
|
+
// An input holding the chips: 8px chip corners inside 6px of padding keep its 14px corners concentric.
|
|
80
233
|
&-box {
|
|
81
|
-
@extend %surface-raise;
|
|
82
|
-
--background: var(--surface-background-default);
|
|
83
|
-
--border-radius: 14px;
|
|
84
234
|
--padding-horizontal: calc(var(--size-300) / 2);
|
|
85
235
|
--padding-vertical: calc(var(--size-300) / 2);
|
|
236
|
+
|
|
237
|
+
// A chip under the pointer is its own target, so the box holds its resting state rather than reading the
|
|
238
|
+
// hover and press as its own.
|
|
239
|
+
&:not(.--active):has(.input-tag-chip:hover) {
|
|
240
|
+
--background: var(--background-default);
|
|
241
|
+
--border-color: var(--border-color-default);
|
|
242
|
+
--box-shadow: var(--box-shadow-default);
|
|
243
|
+
--color: var(--color-default);
|
|
244
|
+
}
|
|
86
245
|
}
|
|
87
246
|
|
|
88
247
|
// Read by JS, so a chip comes and goes as these say: how far it blurs (half that leaving) and what it grows from
|
|
@@ -92,11 +251,9 @@
|
|
|
92
251
|
// without reading as an error. Chips fade where they stand under reduced motion, and a repeated tag's chip dims
|
|
93
252
|
// instead of shaking.
|
|
94
253
|
&-chip {
|
|
95
|
-
@extend %color-state;
|
|
96
254
|
--blur: var(--blur-400);
|
|
97
|
-
--color
|
|
98
|
-
--
|
|
99
|
-
--gap-horizontal: calc(var(--size-100) / 4);
|
|
255
|
+
--color: var(--color-text-500);
|
|
256
|
+
--gap-horizontal: var(--size-100);
|
|
100
257
|
--gap-vertical: 0px;
|
|
101
258
|
--height: 32px;
|
|
102
259
|
--leave-duration: 150ms;
|
|
@@ -121,24 +278,17 @@
|
|
|
121
278
|
--shake-opacity: 0.4;
|
|
122
279
|
}
|
|
123
280
|
|
|
124
|
-
//
|
|
125
|
-
// with ink and drops its shadow.
|
|
281
|
+
// A card, until an armed chip fills with ink and drops its shadow.
|
|
126
282
|
&-body {
|
|
127
|
-
|
|
128
|
-
--background: var(--surface-background-default);
|
|
129
|
-
--border-radius: var(--border-radius-400);
|
|
130
|
-
--box-shadow: var(--surface-shadow-default);
|
|
283
|
+
--border-radius: var(--border-radius-300);
|
|
131
284
|
}
|
|
132
285
|
|
|
133
|
-
// Its hit area grows to 32px without growing the icon.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
--background-hover: var(--surface-background-hover);
|
|
137
|
-
--background-pressed: var(--background-hover);
|
|
286
|
+
// Its hit area grows to 32px without growing the icon; its colors are the button's, or its variant's.
|
|
287
|
+
// Chained through '.button' so it wins over the button's own spacing regardless of stylesheet order.
|
|
288
|
+
&-button.button {
|
|
138
289
|
--border-radius: var(--border-radius-300);
|
|
139
|
-
--
|
|
140
|
-
--
|
|
141
|
-
--color-pressed: var(--color-hover);
|
|
290
|
+
--padding-horizontal: 0px;
|
|
291
|
+
--padding-vertical: 0px;
|
|
142
292
|
--reach: calc(var(--size-100) / -2);
|
|
143
293
|
--size: 24px;
|
|
144
294
|
}
|
|
@@ -149,17 +299,25 @@
|
|
|
149
299
|
--size: 14px;
|
|
150
300
|
}
|
|
151
301
|
|
|
152
|
-
// An armed chip inverts, and its remove button follows it onto the dark surface.
|
|
302
|
+
// An armed chip inverts, and its remove button follows it onto the dark surface, whatever its variant.
|
|
153
303
|
@include tokens.state(active) {
|
|
304
|
+
--color: var(--color-surface);
|
|
305
|
+
|
|
154
306
|
.input-tag-chip-body {
|
|
155
|
-
--background: var(--color-primary-500);
|
|
156
|
-
--box-shadow: none;
|
|
307
|
+
--background-default: var(--color-primary-500);
|
|
308
|
+
--box-shadow-default: none;
|
|
157
309
|
}
|
|
158
310
|
|
|
159
|
-
.input-tag-chip-button {
|
|
311
|
+
.input-tag-chip-button.button {
|
|
312
|
+
--background-default: transparent;
|
|
160
313
|
--background-hover: transparent;
|
|
314
|
+
--background-pressed: transparent;
|
|
315
|
+
--box-shadow-default: none;
|
|
316
|
+
--box-shadow-hover: none;
|
|
317
|
+
--box-shadow-pressed: none;
|
|
161
318
|
--color-default: oklch(from var(--color-surface) l c h / 0.7);
|
|
162
319
|
--color-hover: var(--color-surface);
|
|
320
|
+
--color-pressed: var(--color-surface);
|
|
163
321
|
}
|
|
164
322
|
}
|
|
165
323
|
}
|
|
@@ -170,22 +328,16 @@
|
|
|
170
328
|
|
|
171
329
|
// Qualified so it wins over the reused input styles regardless of stylesheet order.
|
|
172
330
|
&-entry > #{&}-field {
|
|
331
|
+
--box-shadow-active: none;
|
|
332
|
+
--box-shadow-default: none;
|
|
333
|
+
--box-shadow-hover: none;
|
|
334
|
+
--box-shadow-pressed: none;
|
|
173
335
|
--color-default: currentColor;
|
|
174
336
|
--height: 32px;
|
|
175
337
|
--padding-end: var(--size-100);
|
|
176
338
|
--placeholder-color: var(--color-text-300);
|
|
177
339
|
}
|
|
178
340
|
|
|
179
|
-
&-hint {
|
|
180
|
-
--color: var(--color-text-300);
|
|
181
|
-
--font-size: var(--font-size-200);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
&-label {
|
|
185
|
-
--font-size: var(--font-size-300);
|
|
186
|
-
--font-weight: var(--font-weight-500);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
341
|
// Read by JS: how the row slides as chips come and go, which a formed chip's remove button eases like. No
|
|
190
342
|
// bounce, since closing up reads as settled.
|
|
191
343
|
&-list {
|
|
@@ -199,4 +351,21 @@
|
|
|
199
351
|
}
|
|
200
352
|
}
|
|
201
353
|
}
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
// Set by the consumer or by 'error': tinted and edged in red through every state, so focus never hides it.
|
|
357
|
+
&[aria-invalid='true'] {
|
|
358
|
+
--background-default: color-mix(in oklab, var(--color-red-400) 18%, var(--surface-background-default));
|
|
359
|
+
--border-color-active: var(--color-red-400);
|
|
360
|
+
--border-color-default: var(--color-red-400);
|
|
361
|
+
--border-color-hover: var(--color-red-400);
|
|
362
|
+
--border-color-pressed: var(--color-red-400);
|
|
363
|
+
--color-default: var(--color-red-400);
|
|
364
|
+
--outline-width: max(0px, calc(var(--border-width-500) - var(--border-width)));
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// A compact field's overlay icon shrinks with it. Qualified past the group's own overlay icon size.
|
|
369
|
+
.group:has(> .group-item--overlay):has(> .input--compact) > .group-item--overlay.icon {
|
|
370
|
+
--size: var(--size-400);
|
|
202
371
|
}
|
|
@@ -2,8 +2,12 @@ import { flush, reactive, ReactiveArray, type Reactive } from '@esportsplus/reac
|
|
|
2
2
|
import { component, html, type Attributes, type Renderable } from '@esportsplus/template';
|
|
3
3
|
import close from '@esportsplus/ui/svg/close.svg';
|
|
4
4
|
import icon from '~/components/icon';
|
|
5
|
+
import sortable from '~/components/sortable';
|
|
5
6
|
import { measure, ms, slides, timing } from '~/shared/animation';
|
|
6
7
|
import input from './field';
|
|
8
|
+
import '~/components/button/scss/index.scss';
|
|
9
|
+
import '~/components/card/scss/index.scss';
|
|
10
|
+
import '~/components/group/scss/index.scss';
|
|
7
11
|
|
|
8
12
|
|
|
9
13
|
type A = Attributes & {
|
|
@@ -12,8 +16,13 @@ type A = Attributes & {
|
|
|
12
16
|
label: string;
|
|
13
17
|
name?: string;
|
|
14
18
|
placeholder?: string;
|
|
19
|
+
// Chips reorder by dragging.
|
|
20
|
+
sortable?: boolean;
|
|
15
21
|
state?: State;
|
|
16
22
|
tags?: string[];
|
|
23
|
+
// The input's surface modifier, which the chips and their remove buttons take too.
|
|
24
|
+
// 'border' edges the field alone; the surfaces also tint its chips.
|
|
25
|
+
variant?: 'border' | 'surface' | 'surface-primary';
|
|
17
26
|
};
|
|
18
27
|
|
|
19
28
|
// A chip's element, carrying the shake still running on it.
|
|
@@ -83,8 +92,10 @@ export default component(
|
|
|
83
92
|
label,
|
|
84
93
|
name,
|
|
85
94
|
placeholder = 'Add a tag',
|
|
95
|
+
sortable: sorts = false,
|
|
86
96
|
tags = [],
|
|
87
97
|
state = reactive({ active: false, error: '', tags: new ReactiveArray<string>(tags) }),
|
|
98
|
+
variant,
|
|
88
99
|
...attributes
|
|
89
100
|
}: A
|
|
90
101
|
) {
|
|
@@ -93,51 +104,13 @@ export default component(
|
|
|
93
104
|
ghosts = new ReactiveArray<Ghost>(),
|
|
94
105
|
id = `input-tag-${++uid}`,
|
|
95
106
|
list: HTMLElement | undefined,
|
|
96
|
-
local = reactive({ announcement: '', armed: '', text: '' }),
|
|
97
|
-
slot = html.reactive(state.tags, (tag) => html`
|
|
98
|
-
<li
|
|
99
|
-
class='input-tag-chip ${() => local.armed === key(tag) && '--active'}'
|
|
100
|
-
${{
|
|
101
|
-
onconnect: (element: HTMLElement) => {
|
|
102
|
-
chips.set(key(tag), element);
|
|
103
|
-
},
|
|
104
|
-
ondisconnect: (element: HTMLElement) => {
|
|
105
|
-
if (chips.get(key(tag)) === element) {
|
|
106
|
-
chips.delete(key(tag));
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}}
|
|
110
|
-
>
|
|
111
|
-
<span aria-hidden='true' class='input-tag-chip-body'></span>
|
|
112
|
-
<span class='input-tag-chip-text'>${tag}</span>
|
|
113
|
-
<span class='input-tag-chip-remove'>
|
|
114
|
-
<button
|
|
115
|
-
aria-label='Remove ${tag}'
|
|
116
|
-
class='input-tag-chip-button'
|
|
117
|
-
type='button'
|
|
118
|
-
${{
|
|
119
|
-
onclick: () => {
|
|
120
|
-
remove(key(tag));
|
|
121
|
-
field?.focus();
|
|
122
|
-
},
|
|
123
|
-
// Keeps focus in the field, so typing carries straight on.
|
|
124
|
-
onpointerdown: (e: PointerEvent) => {
|
|
125
|
-
e.preventDefault();
|
|
126
|
-
}
|
|
127
|
-
}}
|
|
128
|
-
>
|
|
129
|
-
${icon({ 'aria-hidden': 'true', class: 'input-tag-chip-icon' }, close)}
|
|
130
|
-
</button>
|
|
131
|
-
</span>
|
|
132
|
-
${name && html`<input name='${name}[]' type='hidden' value='${tag}' />`}
|
|
133
|
-
</li>
|
|
134
|
-
`),
|
|
107
|
+
local = reactive({ announcement: '', armed: '', focused: false, text: '' }),
|
|
135
108
|
stand = html.reactive(ghosts, (ghost) => html`
|
|
136
109
|
<li
|
|
137
110
|
aria-hidden='true'
|
|
138
111
|
class='input-tag-chip input-tag-ghost'
|
|
139
112
|
inert
|
|
140
|
-
style='height: ${ghost.height}px; left: ${ghost.left}px; top: ${ghost.top}px; width: ${ghost.width}px;'
|
|
113
|
+
style='--ghost-height: ${ghost.height}px; --ghost-left: ${ghost.left}px; --ghost-top: ${ghost.top}px; --ghost-width: ${ghost.width}px;'
|
|
141
114
|
${{
|
|
142
115
|
// Not before: until it is in the document its node belongs to the template's own, whose clock
|
|
143
116
|
// never runs.
|
|
@@ -163,13 +136,22 @@ export default component(
|
|
|
163
136
|
}
|
|
164
137
|
}}
|
|
165
138
|
>
|
|
166
|
-
|
|
167
|
-
<span class='input-tag-chip-text'>${ghost.tag}</span>
|
|
168
|
-
<span class='input-tag-chip-remove'>
|
|
169
|
-
<span class='input-tag-chip-button'>${icon({ 'aria-hidden': 'true', class: 'input-tag-chip-icon' }, close)}</span>
|
|
170
|
-
</span>
|
|
139
|
+
${face(ghost.tag)}
|
|
171
140
|
</li>
|
|
172
|
-
`)
|
|
141
|
+
`),
|
|
142
|
+
// The chips take the surfaces alone; a border only edges the field.
|
|
143
|
+
tint = variant !== 'border' && variant,
|
|
144
|
+
view = sorts
|
|
145
|
+
// 'reactive' makes an array a ReactiveArray, though its type shows only part of one.
|
|
146
|
+
? sortable(state.tags as unknown as ReactiveArray<string>, chip, {
|
|
147
|
+
// A copy of its own: the chip's template would register the copy as the chip.
|
|
148
|
+
drag: (tag) => html`<div class='input-tag-chip'>${face(tag)}</div>`,
|
|
149
|
+
onsort: (tag, _, to) => {
|
|
150
|
+
local.announcement = `Moved ${tag} to position ${to + 1}`;
|
|
151
|
+
}
|
|
152
|
+
})
|
|
153
|
+
: null,
|
|
154
|
+
slot = view ? null : html.reactive(state.tags, (tag) => chip(tag));
|
|
173
155
|
|
|
174
156
|
function add(raw: string[], typed: boolean) {
|
|
175
157
|
let added: string[] = [],
|
|
@@ -218,11 +200,67 @@ export default component(
|
|
|
218
200
|
local.announcement = `Added ${added.join(', ')}`;
|
|
219
201
|
}
|
|
220
202
|
|
|
203
|
+
// 'sorting' is the sortable's, spread on a chip it can drag.
|
|
204
|
+
function chip(tag: string, sorting?: Attributes) {
|
|
205
|
+
return html`
|
|
206
|
+
<li
|
|
207
|
+
class='input-tag-chip ${() => local.armed === key(tag) && '--active'}'
|
|
208
|
+
${sorting}
|
|
209
|
+
${{
|
|
210
|
+
onconnect: (element: HTMLElement) => {
|
|
211
|
+
chips.set(key(tag), element);
|
|
212
|
+
},
|
|
213
|
+
ondisconnect: (element: HTMLElement) => {
|
|
214
|
+
if (chips.get(key(tag)) === element) {
|
|
215
|
+
chips.delete(key(tag));
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}}
|
|
219
|
+
>
|
|
220
|
+
<span aria-hidden='true' class='card ${tint && `card--${tint}`} input-tag-chip-body'></span>
|
|
221
|
+
<span class='input-tag-chip-text'>${tag}</span>
|
|
222
|
+
<button
|
|
223
|
+
aria-label='Remove ${tag}'
|
|
224
|
+
class='button ${tint && `button--${tint}`} input-tag-chip-button'
|
|
225
|
+
type='button'
|
|
226
|
+
${{
|
|
227
|
+
// From the keyboard the button had focus, and it's going, so focus moves to the field; a
|
|
228
|
+
// pointer leaves focus where it was.
|
|
229
|
+
onclick: (e: MouseEvent) => {
|
|
230
|
+
remove(key(tag));
|
|
231
|
+
|
|
232
|
+
if (!e.detail) {
|
|
233
|
+
field?.focus();
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
// Keeps focus where it is: in the field while typing, and off it otherwise. Its own handler
|
|
237
|
+
// also keeps the press from starting a drag.
|
|
238
|
+
onpointerdown: (e: PointerEvent) => {
|
|
239
|
+
e.preventDefault();
|
|
240
|
+
}
|
|
241
|
+
}}
|
|
242
|
+
>
|
|
243
|
+
${icon({ 'aria-hidden': 'true', class: 'input-tag-chip-icon' }, close)}
|
|
244
|
+
</button>
|
|
245
|
+
${name && html`<input name='${name}[]' type='hidden' value='${tag}' />`}
|
|
246
|
+
</li>
|
|
247
|
+
`;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// A chip's look without its behaviour, for the copies that stand in for it.
|
|
251
|
+
function face(tag: string) {
|
|
252
|
+
return html`
|
|
253
|
+
<span aria-hidden='true' class='card ${tint && `card--${tint}`} input-tag-chip-body'></span>
|
|
254
|
+
<span class='input-tag-chip-text'>${tag}</span>
|
|
255
|
+
<span class='button ${tint && `button--${tint}`} input-tag-chip-button'>${icon({ 'aria-hidden': 'true', class: 'input-tag-chip-icon' }, close)}</span>
|
|
256
|
+
`;
|
|
257
|
+
}
|
|
258
|
+
|
|
221
259
|
// Its letters are already on screen where the field was, so only the chip's body and remove button form around them.
|
|
222
260
|
// Queried, since the chip forms in the frame it renders in, ahead of its parts' connect callbacks.
|
|
223
261
|
function form(chip: HTMLElement) {
|
|
224
262
|
let body = chip.querySelector('.input-tag-chip-body'),
|
|
225
|
-
remove = chip.querySelector('.input-tag-chip-
|
|
263
|
+
remove = chip.querySelector('.input-tag-chip-button'),
|
|
226
264
|
{ blur, grow, pop, scale, swap } = motion(chip);
|
|
227
265
|
|
|
228
266
|
if (pop) {
|
|
@@ -305,18 +343,24 @@ export default component(
|
|
|
305
343
|
|
|
306
344
|
return html`
|
|
307
345
|
<div
|
|
308
|
-
class='input-tag'
|
|
346
|
+
class='group group--column input-tag'
|
|
309
347
|
${this?.attributes}
|
|
310
348
|
${attributes}
|
|
311
349
|
>
|
|
312
|
-
<label class='
|
|
350
|
+
<label class='group-label' for='${id}'>${label}</label>
|
|
313
351
|
<div
|
|
314
|
-
class='input-tag-box'
|
|
352
|
+
class='input ${variant && `input--${variant}`} input-tag-box'
|
|
315
353
|
${{
|
|
354
|
+
class: [() => state.active && '--active', () => local.focused && '--focused'],
|
|
355
|
+
onfocusout: () => {
|
|
356
|
+
local.focused = false;
|
|
357
|
+
},
|
|
316
358
|
// Pressing the field's empty space types into it, like a real input.
|
|
317
359
|
onpointerdown: (e: PointerEvent) => {
|
|
318
360
|
let target = e.target as HTMLElement;
|
|
319
361
|
|
|
362
|
+
local.focused = state.active;
|
|
363
|
+
|
|
320
364
|
if (target !== e.currentTarget && target !== list) {
|
|
321
365
|
return;
|
|
322
366
|
}
|
|
@@ -328,14 +372,15 @@ export default component(
|
|
|
328
372
|
>
|
|
329
373
|
<ul
|
|
330
374
|
class='input-tag-list'
|
|
375
|
+
${view?.attributes}
|
|
331
376
|
${{
|
|
332
|
-
'aria-label': () => `${label}, ${
|
|
377
|
+
'aria-label': () => `${label}, ${state.tags.length} added`,
|
|
333
378
|
onconnect: (element: HTMLElement) => {
|
|
334
379
|
list = element;
|
|
335
380
|
}
|
|
336
381
|
}}
|
|
337
382
|
>
|
|
338
|
-
${slot}
|
|
383
|
+
${view ? view.render() : slot}
|
|
339
384
|
${stand}
|
|
340
385
|
<li class='input-tag-entry' role='none'>
|
|
341
386
|
${input.call({ attributes: { ...this?.attributes?.[INPUT_TAG_FIELD], ...attributes[INPUT_TAG_FIELD] } }, {
|
|
@@ -403,7 +448,7 @@ export default component(
|
|
|
403
448
|
</li>
|
|
404
449
|
</ul>
|
|
405
450
|
</div>
|
|
406
|
-
${!!hint && html`<p class='
|
|
451
|
+
${!!hint && html`<p class='group-description'>${hint}</p>`}
|
|
407
452
|
<span aria-live='polite' class='input-tag-live'>${() => local.announcement}</span>
|
|
408
453
|
</div>
|
|
409
454
|
`;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
// Raw DOM, since a download starts imperatively from a clicked anchor rather than from anything rendered.
|
|
2
2
|
export default (content: any[] | Record<PropertyKey, any>, name: string) => {
|
|
3
3
|
let link = document.createElement('a'),
|
|
4
|
-
url = URL.createObjectURL(new Blob(
|
|
5
|
-
[ JSON.stringify(content) ],
|
|
6
|
-
{ type: 'application/json' }
|
|
7
|
-
));
|
|
4
|
+
url = URL.createObjectURL(new Blob([JSON.stringify(content)], { type: 'application/json' }));
|
|
8
5
|
|
|
9
|
-
link.download = name
|
|
6
|
+
link.download = `${name}.json`;
|
|
10
7
|
link.href = url;
|
|
11
8
|
|
|
12
9
|
document.body.appendChild(link);
|
|
@@ -10,11 +10,9 @@
|
|
|
10
10
|
justify-content: flex-start;
|
|
11
11
|
padding-block: max(0px, calc(var(--padding-vertical) - var(--border-width)));
|
|
12
12
|
padding-inline: max(0px, calc(var(--padding-horizontal) - var(--border-width)));
|
|
13
|
-
transition:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
color var(--transition-duration) var(--transition-timing-function),
|
|
17
|
-
opacity var(--transition-duration) var(--transition-timing-function);
|
|
13
|
+
transition-duration: var(--transition-duration);
|
|
14
|
+
transition-property: background, border-color, color, opacity;
|
|
15
|
+
transition-timing-function: var(--transition-timing-function);
|
|
18
16
|
|
|
19
17
|
|
|
20
18
|
// An icon resolves '--color' itself rather than inheriting the label's eased colour, so it eases alongside. Zero
|