@nmnmcc/standard 0.0.0-stage → 0.4.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/LICENSE +21 -0
- package/README.md +516 -2
- package/dist/Extend.d.ts +15 -0
- package/dist/Extend.d.ts.map +1 -0
- package/dist/Extend.js +1 -0
- package/dist/Node.d.ts +71 -0
- package/dist/Node.d.ts.map +1 -0
- package/dist/Palette-BIJ96BEh.js +84 -0
- package/dist/Palette.d.ts +8 -0
- package/dist/Palette.d.ts.map +1 -0
- package/dist/Palette.js +1 -0
- package/dist/Standard-BPpzr5SM.js +488 -0
- package/dist/Standard.d.ts +249 -0
- package/dist/Standard.d.ts.map +1 -0
- package/dist/Standard.js +1 -0
- package/dist/Ui-B9xQqqNT.js +468 -0
- package/dist/Ui.d.ts +500 -0
- package/dist/Ui.d.ts.map +1 -0
- package/dist/Ui.js +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/rolldown-runtime-BMBA7GOT.js +10 -0
- package/dist/standard/button/button.d.ts +21 -0
- package/dist/standard/button/button.d.ts.map +1 -0
- package/dist/standard/colour/colour.d.ts +93 -0
- package/dist/standard/colour/colour.d.ts.map +1 -0
- package/dist/standard/field/field.d.ts +91 -0
- package/dist/standard/field/field.d.ts.map +1 -0
- package/dist/standard/form/form.d.ts +16 -0
- package/dist/standard/form/form.d.ts.map +1 -0
- package/dist/standard/icon/icon.d.ts +31 -0
- package/dist/standard/icon/icon.d.ts.map +1 -0
- package/dist/standard/image/image.d.ts +21 -0
- package/dist/standard/image/image.d.ts.map +1 -0
- package/dist/standard/layout/layout.d.ts +73 -0
- package/dist/standard/layout/layout.d.ts.map +1 -0
- package/dist/standard/list/list.d.ts +26 -0
- package/dist/standard/list/list.d.ts.map +1 -0
- package/dist/standard/page/page.d.ts +20 -0
- package/dist/standard/page/page.d.ts.map +1 -0
- package/dist/standard/table/table.d.ts +18 -0
- package/dist/standard/table/table.d.ts.map +1 -0
- package/dist/standard/text/text.d.ts +39 -0
- package/dist/standard/text/text.d.ts.map +1 -0
- package/dist/standard/tokens/classes.d.ts +16 -0
- package/dist/standard/tokens/classes.d.ts.map +1 -0
- package/dist/standard/tokens/tokens.d.ts +162 -0
- package/dist/standard/tokens/tokens.d.ts.map +1 -0
- package/dist/standard.css +2 -0
- package/dist/ui/arrow/arrow.d.ts +18 -0
- package/dist/ui/arrow/arrow.d.ts.map +1 -0
- package/dist/ui/avatar/avatar.d.ts +15 -0
- package/dist/ui/avatar/avatar.d.ts.map +1 -0
- package/dist/ui/board/board.d.ts +34 -0
- package/dist/ui/board/board.d.ts.map +1 -0
- package/dist/ui/bullet/bullet.d.ts +15 -0
- package/dist/ui/bullet/bullet.d.ts.map +1 -0
- package/dist/ui/card/card.d.ts +24 -0
- package/dist/ui/card/card.d.ts.map +1 -0
- package/dist/ui/carousel/carousel.d.ts +17 -0
- package/dist/ui/carousel/carousel.d.ts.map +1 -0
- package/dist/ui/check/check.d.ts +20 -0
- package/dist/ui/check/check.d.ts.map +1 -0
- package/dist/ui/choice/choice.d.ts +19 -0
- package/dist/ui/choice/choice.d.ts.map +1 -0
- package/dist/ui/control/control.d.ts +57 -0
- package/dist/ui/control/control.d.ts.map +1 -0
- package/dist/ui/dialog/dialog.d.ts +30 -0
- package/dist/ui/dialog/dialog.d.ts.map +1 -0
- package/dist/ui/disclosure/disclosure.d.ts +20 -0
- package/dist/ui/disclosure/disclosure.d.ts.map +1 -0
- package/dist/ui/flap/flap.d.ts +18 -0
- package/dist/ui/flap/flap.d.ts.map +1 -0
- package/dist/ui/item/item.d.ts +21 -0
- package/dist/ui/item/item.d.ts.map +1 -0
- package/dist/ui/key/key.d.ts +12 -0
- package/dist/ui/key/key.d.ts.map +1 -0
- package/dist/ui/menu/menu.d.ts +26 -0
- package/dist/ui/menu/menu.d.ts.map +1 -0
- package/dist/ui/modal/modal.d.ts +22 -0
- package/dist/ui/modal/modal.d.ts.map +1 -0
- package/dist/ui/navigator/navigator.d.ts +137 -0
- package/dist/ui/navigator/navigator.d.ts.map +1 -0
- package/dist/ui/notice/notice.d.ts +34 -0
- package/dist/ui/notice/notice.d.ts.map +1 -0
- package/dist/ui/options/options.d.ts +19 -0
- package/dist/ui/options/options.d.ts.map +1 -0
- package/dist/ui/pager/pager.d.ts +29 -0
- package/dist/ui/pager/pager.d.ts.map +1 -0
- package/dist/ui/pagination/pagination.d.ts +14 -0
- package/dist/ui/pagination/pagination.d.ts.map +1 -0
- package/dist/ui/popover/popover.d.ts +20 -0
- package/dist/ui/popover/popover.d.ts.map +1 -0
- package/dist/ui/progress/progress.d.ts +17 -0
- package/dist/ui/progress/progress.d.ts.map +1 -0
- package/dist/ui/route/route.d.ts +27 -0
- package/dist/ui/route/route.d.ts.map +1 -0
- package/dist/ui/sheet/sheet.d.ts +35 -0
- package/dist/ui/sheet/sheet.d.ts.map +1 -0
- package/dist/ui/skeleton/skeleton.d.ts +15 -0
- package/dist/ui/skeleton/skeleton.d.ts.map +1 -0
- package/dist/ui/slider/slider.d.ts +23 -0
- package/dist/ui/slider/slider.d.ts.map +1 -0
- package/dist/ui/stepper/stepper.d.ts +32 -0
- package/dist/ui/stepper/stepper.d.ts.map +1 -0
- package/dist/ui/tabs/tabs.d.ts +22 -0
- package/dist/ui/tabs/tabs.d.ts.map +1 -0
- package/dist/ui/tag/tag.d.ts +17 -0
- package/dist/ui/tag/tag.d.ts.map +1 -0
- package/dist/ui/tile/tile.d.ts +38 -0
- package/dist/ui/tile/tile.d.ts.map +1 -0
- package/dist/ui/toasts/toasts.d.ts +17 -0
- package/dist/ui/toasts/toasts.d.ts.map +1 -0
- package/dist/ui/toggle/toggle.d.ts +17 -0
- package/dist/ui/toggle/toggle.d.ts.map +1 -0
- package/dist/ui/trail/trail.d.ts +22 -0
- package/dist/ui/trail/trail.d.ts.map +1 -0
- package/package.json +70 -3
- package/src/Extend.ts +14 -0
- package/src/Node.ts +44 -0
- package/src/Palette.ts +7 -0
- package/src/Standard.ts +109 -0
- package/src/Ui.ts +156 -0
- package/src/index.ts +27 -0
- package/src/standard/button/button.module.css +43 -0
- package/src/standard/button/button.module.d.css.ts +6 -0
- package/src/standard/button/button.ts +38 -0
- package/src/standard/colour/colour.ts +197 -0
- package/src/standard/field/field.module.css +222 -0
- package/src/standard/field/field.module.d.css.ts +13 -0
- package/src/standard/field/field.ts +266 -0
- package/src/standard/form/form.ts +25 -0
- package/src/standard/icon/icon.module.css +349 -0
- package/src/standard/icon/icon.module.d.css.ts +112 -0
- package/src/standard/icon/icon.ts +148 -0
- package/src/standard/image/image.module.css +42 -0
- package/src/standard/image/image.module.d.css.ts +12 -0
- package/src/standard/image/image.ts +39 -0
- package/src/standard/layout/layout.module.css +224 -0
- package/src/standard/layout/layout.module.d.css.ts +41 -0
- package/src/standard/layout/layout.ts +133 -0
- package/src/standard/list/list.module.css +71 -0
- package/src/standard/list/list.module.d.css.ts +10 -0
- package/src/standard/list/list.ts +53 -0
- package/src/standard/page/page.module.css +244 -0
- package/src/standard/page/page.module.d.css.ts +9 -0
- package/src/standard/page/page.ts +32 -0
- package/src/standard/table/table.module.css +40 -0
- package/src/standard/table/table.module.d.css.ts +6 -0
- package/src/standard/table/table.ts +36 -0
- package/src/standard/text/text.module.css +149 -0
- package/src/standard/text/text.module.d.css.ts +19 -0
- package/src/standard/text/text.ts +77 -0
- package/src/standard/tokens/classes.ts +31 -0
- package/src/standard/tokens/tokens.module.css +294 -0
- package/src/standard/tokens/tokens.module.d.css.ts +40 -0
- package/src/standard/tokens/tokens.ts +339 -0
- package/src/ui/arrow/arrow.module.css +38 -0
- package/src/ui/arrow/arrow.module.d.css.ts +13 -0
- package/src/ui/arrow/arrow.ts +35 -0
- package/src/ui/avatar/avatar.module.css +25 -0
- package/src/ui/avatar/avatar.module.d.css.ts +5 -0
- package/src/ui/avatar/avatar.ts +28 -0
- package/src/ui/board/board.module.css +94 -0
- package/src/ui/board/board.module.d.css.ts +10 -0
- package/src/ui/board/board.ts +84 -0
- package/src/ui/bullet/bullet.module.css +28 -0
- package/src/ui/bullet/bullet.module.d.css.ts +5 -0
- package/src/ui/bullet/bullet.ts +16 -0
- package/src/ui/card/card.module.css +80 -0
- package/src/ui/card/card.module.d.css.ts +6 -0
- package/src/ui/card/card.ts +42 -0
- package/src/ui/carousel/carousel.module.css +24 -0
- package/src/ui/carousel/carousel.module.d.css.ts +5 -0
- package/src/ui/carousel/carousel.ts +30 -0
- package/src/ui/check/check.module.css +53 -0
- package/src/ui/check/check.module.d.css.ts +8 -0
- package/src/ui/check/check.ts +46 -0
- package/src/ui/choice/choice.module.css +32 -0
- package/src/ui/choice/choice.module.d.css.ts +6 -0
- package/src/ui/choice/choice.ts +31 -0
- package/src/ui/control/control.module.css +127 -0
- package/src/ui/control/control.module.d.css.ts +12 -0
- package/src/ui/control/control.ts +97 -0
- package/src/ui/dialog/dialog.module.css +42 -0
- package/src/ui/dialog/dialog.module.d.css.ts +6 -0
- package/src/ui/dialog/dialog.ts +44 -0
- package/src/ui/disclosure/disclosure.module.css +57 -0
- package/src/ui/disclosure/disclosure.module.d.css.ts +7 -0
- package/src/ui/disclosure/disclosure.ts +32 -0
- package/src/ui/flap/flap.module.css +161 -0
- package/src/ui/flap/flap.module.d.css.ts +48 -0
- package/src/ui/flap/flap.ts +78 -0
- package/src/ui/item/item.module.css +39 -0
- package/src/ui/item/item.module.d.css.ts +7 -0
- package/src/ui/item/item.ts +33 -0
- package/src/ui/key/key.module.css +15 -0
- package/src/ui/key/key.module.d.css.ts +5 -0
- package/src/ui/key/key.ts +13 -0
- package/src/ui/menu/menu.module.css +11 -0
- package/src/ui/menu/menu.module.d.css.ts +5 -0
- package/src/ui/menu/menu.ts +48 -0
- package/src/ui/modal/modal.module.css +66 -0
- package/src/ui/modal/modal.module.d.css.ts +8 -0
- package/src/ui/modal/modal.ts +55 -0
- package/src/ui/navigator/navigator.module.css +658 -0
- package/src/ui/navigator/navigator.module.d.css.ts +39 -0
- package/src/ui/navigator/navigator.ts +337 -0
- package/src/ui/notice/notice.module.css +80 -0
- package/src/ui/notice/notice.module.d.css.ts +10 -0
- package/src/ui/notice/notice.ts +57 -0
- package/src/ui/options/options.module.css +30 -0
- package/src/ui/options/options.module.d.css.ts +6 -0
- package/src/ui/options/options.ts +31 -0
- package/src/ui/pager/pager.module.css +38 -0
- package/src/ui/pager/pager.module.d.css.ts +8 -0
- package/src/ui/pager/pager.ts +48 -0
- package/src/ui/pagination/pagination.module.css +38 -0
- package/src/ui/pagination/pagination.module.d.css.ts +7 -0
- package/src/ui/pagination/pagination.ts +52 -0
- package/src/ui/popover/popover.module.css +94 -0
- package/src/ui/popover/popover.module.d.css.ts +8 -0
- package/src/ui/popover/popover.ts +139 -0
- package/src/ui/progress/progress.module.css +69 -0
- package/src/ui/progress/progress.module.d.css.ts +6 -0
- package/src/ui/progress/progress.ts +26 -0
- package/src/ui/route/route.module.css +116 -0
- package/src/ui/route/route.module.d.css.ts +11 -0
- package/src/ui/route/route.ts +58 -0
- package/src/ui/sheet/sheet.module.css +194 -0
- package/src/ui/sheet/sheet.module.d.css.ts +7 -0
- package/src/ui/sheet/sheet.ts +47 -0
- package/src/ui/skeleton/skeleton.module.css +44 -0
- package/src/ui/skeleton/skeleton.module.d.css.ts +6 -0
- package/src/ui/skeleton/skeleton.ts +20 -0
- package/src/ui/slider/slider.module.css +56 -0
- package/src/ui/slider/slider.module.d.css.ts +6 -0
- package/src/ui/slider/slider.ts +48 -0
- package/src/ui/stepper/stepper.module.css +32 -0
- package/src/ui/stepper/stepper.module.d.css.ts +7 -0
- package/src/ui/stepper/stepper.ts +62 -0
- package/src/ui/tabs/tabs.module.css +38 -0
- package/src/ui/tabs/tabs.module.d.css.ts +6 -0
- package/src/ui/tabs/tabs.ts +24 -0
- package/src/ui/tag/tag.module.css +23 -0
- package/src/ui/tag/tag.module.d.css.ts +5 -0
- package/src/ui/tag/tag.ts +17 -0
- package/src/ui/tile/tile.module.css +137 -0
- package/src/ui/tile/tile.module.d.css.ts +13 -0
- package/src/ui/tile/tile.ts +69 -0
- package/src/ui/toasts/toasts.module.css +38 -0
- package/src/ui/toasts/toasts.module.d.css.ts +6 -0
- package/src/ui/toasts/toasts.ts +26 -0
- package/src/ui/toggle/toggle.module.css +46 -0
- package/src/ui/toggle/toggle.module.d.css.ts +6 -0
- package/src/ui/toggle/toggle.ts +29 -0
- package/src/ui/trail/trail.module.css +42 -0
- package/src/ui/trail/trail.module.d.css.ts +5 -0
- package/src/ui/trail/trail.ts +28 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/* flap: a split-flap readout. */
|
|
2
|
+
|
|
3
|
+
@layer standard.ui {
|
|
4
|
+
/*
|
|
5
|
+
* A split-flap readout, as on a departure board. Each cell holds a reel of
|
|
6
|
+
* every glyph and shows one of them; a new value rolls the reel past all
|
|
7
|
+
* the glyphs between, so a number is seen to count, not just to change.
|
|
8
|
+
*/
|
|
9
|
+
.flap {
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
column-gap: 1px;
|
|
12
|
+
font-weight: 700;
|
|
13
|
+
font-variant-numeric: tabular-nums;
|
|
14
|
+
letter-spacing: 0;
|
|
15
|
+
line-height: 1.5;
|
|
16
|
+
vertical-align: bottom;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.flap-cell {
|
|
20
|
+
inline-size: 0.82em;
|
|
21
|
+
block-size: 1lh;
|
|
22
|
+
background: var(--s-fg);
|
|
23
|
+
color: var(--s-bg);
|
|
24
|
+
overflow: clip;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.flap-reel {
|
|
28
|
+
display: grid;
|
|
29
|
+
justify-items: center;
|
|
30
|
+
translate: 0 calc(var(--s-ui-glyph, 0) * -1lh);
|
|
31
|
+
transition: translate calc(2 * var(--s-travel)) var(--s-glide);
|
|
32
|
+
|
|
33
|
+
& > span {
|
|
34
|
+
block-size: 1lh;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.g-0 {
|
|
39
|
+
--s-ui-glyph: 0;
|
|
40
|
+
}
|
|
41
|
+
.g-1 {
|
|
42
|
+
--s-ui-glyph: 1;
|
|
43
|
+
}
|
|
44
|
+
.g-2 {
|
|
45
|
+
--s-ui-glyph: 2;
|
|
46
|
+
}
|
|
47
|
+
.g-3 {
|
|
48
|
+
--s-ui-glyph: 3;
|
|
49
|
+
}
|
|
50
|
+
.g-4 {
|
|
51
|
+
--s-ui-glyph: 4;
|
|
52
|
+
}
|
|
53
|
+
.g-5 {
|
|
54
|
+
--s-ui-glyph: 5;
|
|
55
|
+
}
|
|
56
|
+
.g-6 {
|
|
57
|
+
--s-ui-glyph: 6;
|
|
58
|
+
}
|
|
59
|
+
.g-7 {
|
|
60
|
+
--s-ui-glyph: 7;
|
|
61
|
+
}
|
|
62
|
+
.g-8 {
|
|
63
|
+
--s-ui-glyph: 8;
|
|
64
|
+
}
|
|
65
|
+
.g-9 {
|
|
66
|
+
--s-ui-glyph: 9;
|
|
67
|
+
}
|
|
68
|
+
.g-10 {
|
|
69
|
+
--s-ui-glyph: 10;
|
|
70
|
+
}
|
|
71
|
+
.g-11 {
|
|
72
|
+
--s-ui-glyph: 11;
|
|
73
|
+
}
|
|
74
|
+
.g-12 {
|
|
75
|
+
--s-ui-glyph: 12;
|
|
76
|
+
}
|
|
77
|
+
.g-13 {
|
|
78
|
+
--s-ui-glyph: 13;
|
|
79
|
+
}
|
|
80
|
+
.g-14 {
|
|
81
|
+
--s-ui-glyph: 14;
|
|
82
|
+
}
|
|
83
|
+
.g-15 {
|
|
84
|
+
--s-ui-glyph: 15;
|
|
85
|
+
}
|
|
86
|
+
.g-16 {
|
|
87
|
+
--s-ui-glyph: 16;
|
|
88
|
+
}
|
|
89
|
+
.g-17 {
|
|
90
|
+
--s-ui-glyph: 17;
|
|
91
|
+
}
|
|
92
|
+
.g-18 {
|
|
93
|
+
--s-ui-glyph: 18;
|
|
94
|
+
}
|
|
95
|
+
.g-19 {
|
|
96
|
+
--s-ui-glyph: 19;
|
|
97
|
+
}
|
|
98
|
+
.g-20 {
|
|
99
|
+
--s-ui-glyph: 20;
|
|
100
|
+
}
|
|
101
|
+
.g-21 {
|
|
102
|
+
--s-ui-glyph: 21;
|
|
103
|
+
}
|
|
104
|
+
.g-22 {
|
|
105
|
+
--s-ui-glyph: 22;
|
|
106
|
+
}
|
|
107
|
+
.g-23 {
|
|
108
|
+
--s-ui-glyph: 23;
|
|
109
|
+
}
|
|
110
|
+
.g-24 {
|
|
111
|
+
--s-ui-glyph: 24;
|
|
112
|
+
}
|
|
113
|
+
.g-25 {
|
|
114
|
+
--s-ui-glyph: 25;
|
|
115
|
+
}
|
|
116
|
+
.g-26 {
|
|
117
|
+
--s-ui-glyph: 26;
|
|
118
|
+
}
|
|
119
|
+
.g-27 {
|
|
120
|
+
--s-ui-glyph: 27;
|
|
121
|
+
}
|
|
122
|
+
.g-28 {
|
|
123
|
+
--s-ui-glyph: 28;
|
|
124
|
+
}
|
|
125
|
+
.g-29 {
|
|
126
|
+
--s-ui-glyph: 29;
|
|
127
|
+
}
|
|
128
|
+
.g-30 {
|
|
129
|
+
--s-ui-glyph: 30;
|
|
130
|
+
}
|
|
131
|
+
.g-31 {
|
|
132
|
+
--s-ui-glyph: 31;
|
|
133
|
+
}
|
|
134
|
+
.g-32 {
|
|
135
|
+
--s-ui-glyph: 32;
|
|
136
|
+
}
|
|
137
|
+
.g-33 {
|
|
138
|
+
--s-ui-glyph: 33;
|
|
139
|
+
}
|
|
140
|
+
.g-34 {
|
|
141
|
+
--s-ui-glyph: 34;
|
|
142
|
+
}
|
|
143
|
+
.g-35 {
|
|
144
|
+
--s-ui-glyph: 35;
|
|
145
|
+
}
|
|
146
|
+
.g-36 {
|
|
147
|
+
--s-ui-glyph: 36;
|
|
148
|
+
}
|
|
149
|
+
.g-37 {
|
|
150
|
+
--s-ui-glyph: 37;
|
|
151
|
+
}
|
|
152
|
+
.g-38 {
|
|
153
|
+
--s-ui-glyph: 38;
|
|
154
|
+
}
|
|
155
|
+
.g-39 {
|
|
156
|
+
--s-ui-glyph: 39;
|
|
157
|
+
}
|
|
158
|
+
.g-40 {
|
|
159
|
+
--s-ui-glyph: 40;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
declare const styles: {
|
|
2
|
+
readonly "flap": string;
|
|
3
|
+
readonly "flap-cell": string;
|
|
4
|
+
readonly "flap-reel": string;
|
|
5
|
+
readonly "g-0": string;
|
|
6
|
+
readonly "g-1": string;
|
|
7
|
+
readonly "g-10": string;
|
|
8
|
+
readonly "g-11": string;
|
|
9
|
+
readonly "g-12": string;
|
|
10
|
+
readonly "g-13": string;
|
|
11
|
+
readonly "g-14": string;
|
|
12
|
+
readonly "g-15": string;
|
|
13
|
+
readonly "g-16": string;
|
|
14
|
+
readonly "g-17": string;
|
|
15
|
+
readonly "g-18": string;
|
|
16
|
+
readonly "g-19": string;
|
|
17
|
+
readonly "g-2": string;
|
|
18
|
+
readonly "g-20": string;
|
|
19
|
+
readonly "g-21": string;
|
|
20
|
+
readonly "g-22": string;
|
|
21
|
+
readonly "g-23": string;
|
|
22
|
+
readonly "g-24": string;
|
|
23
|
+
readonly "g-25": string;
|
|
24
|
+
readonly "g-26": string;
|
|
25
|
+
readonly "g-27": string;
|
|
26
|
+
readonly "g-28": string;
|
|
27
|
+
readonly "g-29": string;
|
|
28
|
+
readonly "g-3": string;
|
|
29
|
+
readonly "g-30": string;
|
|
30
|
+
readonly "g-31": string;
|
|
31
|
+
readonly "g-32": string;
|
|
32
|
+
readonly "g-33": string;
|
|
33
|
+
readonly "g-34": string;
|
|
34
|
+
readonly "g-35": string;
|
|
35
|
+
readonly "g-36": string;
|
|
36
|
+
readonly "g-37": string;
|
|
37
|
+
readonly "g-38": string;
|
|
38
|
+
readonly "g-39": string;
|
|
39
|
+
readonly "g-4": string;
|
|
40
|
+
readonly "g-40": string;
|
|
41
|
+
readonly "g-5": string;
|
|
42
|
+
readonly "g-6": string;
|
|
43
|
+
readonly "g-7": string;
|
|
44
|
+
readonly "g-8": string;
|
|
45
|
+
readonly "g-9": string;
|
|
46
|
+
};
|
|
47
|
+
export = styles;
|
|
48
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `flap`: a readout that rolls to a new value.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.4.0
|
|
5
|
+
*/
|
|
6
|
+
import type { Html } from "effect/ui/html"
|
|
7
|
+
import { node, type Node } from "../../Node.ts"
|
|
8
|
+
import styles from "./flap.module.css"
|
|
9
|
+
|
|
10
|
+
/** The glyphs on the reel of a split-flap cell, in the order it rolls through them, each with its class. */
|
|
11
|
+
const reel = [
|
|
12
|
+
["\u00a0", styles["g-0"]],
|
|
13
|
+
["0", styles["g-1"]],
|
|
14
|
+
["1", styles["g-2"]],
|
|
15
|
+
["2", styles["g-3"]],
|
|
16
|
+
["3", styles["g-4"]],
|
|
17
|
+
["4", styles["g-5"]],
|
|
18
|
+
["5", styles["g-6"]],
|
|
19
|
+
["6", styles["g-7"]],
|
|
20
|
+
["7", styles["g-8"]],
|
|
21
|
+
["8", styles["g-9"]],
|
|
22
|
+
["9", styles["g-10"]],
|
|
23
|
+
["A", styles["g-11"]],
|
|
24
|
+
["B", styles["g-12"]],
|
|
25
|
+
["C", styles["g-13"]],
|
|
26
|
+
["D", styles["g-14"]],
|
|
27
|
+
["E", styles["g-15"]],
|
|
28
|
+
["F", styles["g-16"]],
|
|
29
|
+
["G", styles["g-17"]],
|
|
30
|
+
["H", styles["g-18"]],
|
|
31
|
+
["I", styles["g-19"]],
|
|
32
|
+
["J", styles["g-20"]],
|
|
33
|
+
["K", styles["g-21"]],
|
|
34
|
+
["L", styles["g-22"]],
|
|
35
|
+
["M", styles["g-23"]],
|
|
36
|
+
["N", styles["g-24"]],
|
|
37
|
+
["O", styles["g-25"]],
|
|
38
|
+
["P", styles["g-26"]],
|
|
39
|
+
["Q", styles["g-27"]],
|
|
40
|
+
["R", styles["g-28"]],
|
|
41
|
+
["S", styles["g-29"]],
|
|
42
|
+
["T", styles["g-30"]],
|
|
43
|
+
["U", styles["g-31"]],
|
|
44
|
+
["V", styles["g-32"]],
|
|
45
|
+
["W", styles["g-33"]],
|
|
46
|
+
["X", styles["g-34"]],
|
|
47
|
+
["Y", styles["g-35"]],
|
|
48
|
+
["Z", styles["g-36"]],
|
|
49
|
+
["/", styles["g-37"]],
|
|
50
|
+
[":", styles["g-38"]],
|
|
51
|
+
["-", styles["g-39"]],
|
|
52
|
+
[".", styles["g-40"]]
|
|
53
|
+
] as const
|
|
54
|
+
|
|
55
|
+
export const flap = <Msg>(h: Html.H<Msg>) => ({
|
|
56
|
+
/**
|
|
57
|
+
* A readout of the kind a split-flap board gives: numbers and capital
|
|
58
|
+
* letters that roll to a new value through every glyph between. For a
|
|
59
|
+
* value that changes while it is watched, such as minutes, a count, or
|
|
60
|
+
* where the window is. Keep the text the same length, so each cell keeps
|
|
61
|
+
* its place. Anything not on the reel shows as a blank.
|
|
62
|
+
*/
|
|
63
|
+
flap: (text: string): Node<"inline", Msg> =>
|
|
64
|
+
node(
|
|
65
|
+
h.span
|
|
66
|
+
.class(styles.flap)
|
|
67
|
+
.attr("role", "img")
|
|
68
|
+
.attr("aria-label", text)
|
|
69
|
+
.children(
|
|
70
|
+
[...text.toUpperCase().replaceAll(" ", "\u00a0")].map((glyph) =>
|
|
71
|
+
h.span
|
|
72
|
+
.class(styles["flap-cell"], reel.find(([on]) => on === glyph)?.[1] ?? reel[0][1])
|
|
73
|
+
.attr("aria-hidden", "true")
|
|
74
|
+
.children(h.span.class(styles["flap-reel"]).children(reel.map(([on]) => h.span.children(on))))
|
|
75
|
+
)
|
|
76
|
+
)
|
|
77
|
+
)
|
|
78
|
+
})
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* item: one thing in a list, and what can be done to it. */
|
|
2
|
+
|
|
3
|
+
@layer standard.ui {
|
|
4
|
+
/* Its actions are across its foot, edge to edge. */
|
|
5
|
+
.item {
|
|
6
|
+
display: grid;
|
|
7
|
+
grid-template-columns: minmax(0, 1fr);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* What it says keeps the margin a row of a ruled list has. */
|
|
11
|
+
.item-body {
|
|
12
|
+
display: grid;
|
|
13
|
+
grid-template-columns: minmax(0, 1fr);
|
|
14
|
+
align-content: start;
|
|
15
|
+
row-gap: var(--s-unit);
|
|
16
|
+
padding: calc(1.5 * var(--s-unit)) calc(2 * var(--s-unit));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* A row is a tint of its text, so its actions step on towards the text. Smaller than a dialog's, as the row is. */
|
|
20
|
+
.item-actions {
|
|
21
|
+
--s-ui-step: var(--s-fg);
|
|
22
|
+
|
|
23
|
+
& > button {
|
|
24
|
+
min-block-size: var(--s-target);
|
|
25
|
+
padding: calc(1.5 * var(--s-unit)) calc(2 * var(--s-unit));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Where there is room they are at the end of the row instead: as high as it, each as wide as its label needs, and the last out to the row's edge. */
|
|
30
|
+
@container s-page (inline-size >= 48rem) {
|
|
31
|
+
.item {
|
|
32
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.item > .item-actions {
|
|
36
|
+
grid-auto-columns: minmax(calc(14 * var(--s-unit)), auto);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `item`: one thing in a list, and what can be done to it.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.4.0
|
|
5
|
+
*/
|
|
6
|
+
import type { Html } from "effect/ui/html"
|
|
7
|
+
import { type Child, contents as inner, type Kind, node, type Node } from "../../Node.ts"
|
|
8
|
+
import { type Actions, actions } from "../control/control.ts"
|
|
9
|
+
import styles from "./item.module.css"
|
|
10
|
+
|
|
11
|
+
export const item = <Msg>(h: Html.H<Msg>) => ({
|
|
12
|
+
/**
|
|
13
|
+
* One thing in a ruled `list`, and what can be done to it. The actions are
|
|
14
|
+
* large buttons at the end of its row, as high as the row and out to its
|
|
15
|
+
* edge, as the answers of a `dialog` are across its bottom; where the page
|
|
16
|
+
* is narrow they are across the row's foot. They are part of the row's
|
|
17
|
+
* block, so there is no doubt which thing they act on.
|
|
18
|
+
*/
|
|
19
|
+
item: <R = never>(
|
|
20
|
+
options: { readonly actions?: Actions<Msg> },
|
|
21
|
+
...children: ReadonlyArray<Child<Kind, Msg, R>>
|
|
22
|
+
): Node<"block", Msg, R> => {
|
|
23
|
+
const list = options.actions ?? []
|
|
24
|
+
return node(
|
|
25
|
+
h.div
|
|
26
|
+
.class(styles.item)
|
|
27
|
+
.children(
|
|
28
|
+
h.div.class(styles["item-body"]).children(inner(children)),
|
|
29
|
+
list.length > 0 && actions(h, styles["item-actions"], list)
|
|
30
|
+
)
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* key: a key of the keyboard. */
|
|
2
|
+
|
|
3
|
+
@layer standard.ui {
|
|
4
|
+
.key {
|
|
5
|
+
display: inline-block;
|
|
6
|
+
min-inline-size: 1.75em;
|
|
7
|
+
padding: 0 0.5em;
|
|
8
|
+
background: color-mix(in oklch, var(--s-fg) 16%, transparent);
|
|
9
|
+
font-size: 0.8em;
|
|
10
|
+
font-weight: 700;
|
|
11
|
+
line-height: 1.5;
|
|
12
|
+
text-align: start;
|
|
13
|
+
white-space: nowrap;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `key`: a key of the keyboard.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.4.0
|
|
5
|
+
*/
|
|
6
|
+
import type { Html } from "effect/ui/html"
|
|
7
|
+
import { node, type Node } from "../../Node.ts"
|
|
8
|
+
import styles from "./key.module.css"
|
|
9
|
+
|
|
10
|
+
export const key = <Msg>(h: Html.H<Msg>) => ({
|
|
11
|
+
/** A key of the keyboard. */
|
|
12
|
+
key: (label: string): Node<"inline", Msg> => node(h.kbd.class(styles.key).children(label))
|
|
13
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* menu: a few things to do, in a popover. */
|
|
2
|
+
|
|
3
|
+
@layer standard.ui {
|
|
4
|
+
.menu-item {
|
|
5
|
+
padding: calc((var(--s-target) - 1.5rem) / 2) calc(2 * var(--s-unit));
|
|
6
|
+
background: color-mix(in oklch, var(--s-fg) var(--s-ui-press), transparent);
|
|
7
|
+
line-height: 1.5rem;
|
|
8
|
+
font-weight: 700;
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `menu`: a few things to do, behind one button.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.4.0
|
|
5
|
+
*/
|
|
6
|
+
import type { Html } from "effect/ui/html"
|
|
7
|
+
import { node, type Node } from "../../Node.ts"
|
|
8
|
+
import control from "../control/control.module.css"
|
|
9
|
+
import { type Icon, leading } from "../../standard/icon/icon.ts"
|
|
10
|
+
import styles from "./menu.module.css"
|
|
11
|
+
import { anchored } from "../popover/popover.ts"
|
|
12
|
+
|
|
13
|
+
export const menu = <Msg>(h: Html.H<Msg>) => ({
|
|
14
|
+
/**
|
|
15
|
+
* A few things to do, behind one button. It opens against the button,
|
|
16
|
+
* closes on Escape, on a press anywhere else and on a choice, and gives
|
|
17
|
+
* the focus back.
|
|
18
|
+
*/
|
|
19
|
+
menu: (options: {
|
|
20
|
+
readonly name: string
|
|
21
|
+
readonly label: string
|
|
22
|
+
readonly items: ReadonlyArray<{
|
|
23
|
+
readonly label: string
|
|
24
|
+
readonly onPress: Msg
|
|
25
|
+
readonly icon?: Icon
|
|
26
|
+
readonly disabled?: boolean
|
|
27
|
+
}>
|
|
28
|
+
}): Node<"block", Msg> => {
|
|
29
|
+
const id = h.id(`s-ui-popover-${options.name}`)
|
|
30
|
+
return node(
|
|
31
|
+
anchored(
|
|
32
|
+
h,
|
|
33
|
+
{ name: options.name, label: options.label, role: "menu" },
|
|
34
|
+
options.items.map((item) =>
|
|
35
|
+
h.button
|
|
36
|
+
.class(control.control, styles["menu-item"])
|
|
37
|
+
.attr("type", "button")
|
|
38
|
+
.attr("role", "menuitem")
|
|
39
|
+
.attr("popovertarget", id)
|
|
40
|
+
.attr("popovertargetaction", "hide")
|
|
41
|
+
.disabled(item.disabled === true)
|
|
42
|
+
.on("click", item.onPress)
|
|
43
|
+
.children(leading(h, item.icon), item.label)
|
|
44
|
+
)
|
|
45
|
+
).content
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
})
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/* What a sheet and a dialog share. */
|
|
2
|
+
|
|
3
|
+
@layer standard.ui {
|
|
4
|
+
/*
|
|
5
|
+
* Neither is a layer over the page. A sheet is the place next to this one
|
|
6
|
+
* on the canvas: the window moves over to it, so the page slides out by
|
|
7
|
+
* exactly as much as the sheet slides in, and back again when the sheet
|
|
8
|
+
* closes. A dialog comes down into the window from above. Behind a sheet
|
|
9
|
+
* nothing is dimmed: the page has moved aside. Behind a dialog the page
|
|
10
|
+
* steps back, under a veil of its own ground. And nothing fades: where
|
|
11
|
+
* things are says what is going on. Each is told apart from the page by
|
|
12
|
+
* its ground: a sheet is a step from the page's, a dialog is the accent.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
.modal {
|
|
16
|
+
position: fixed;
|
|
17
|
+
max-inline-size: none;
|
|
18
|
+
max-block-size: none;
|
|
19
|
+
padding: calc(3 * var(--s-unit));
|
|
20
|
+
background: var(--s-bg);
|
|
21
|
+
color: var(--s-fg);
|
|
22
|
+
overflow-y: auto;
|
|
23
|
+
overscroll-behavior: contain;
|
|
24
|
+
transition:
|
|
25
|
+
translate var(--s-travel) var(--s-glide),
|
|
26
|
+
display var(--s-travel) allow-discrete,
|
|
27
|
+
overlay var(--s-travel) allow-discrete;
|
|
28
|
+
|
|
29
|
+
&[open] {
|
|
30
|
+
display: grid;
|
|
31
|
+
grid-template-columns: minmax(0, 1fr);
|
|
32
|
+
align-content: start;
|
|
33
|
+
row-gap: calc(3 * var(--s-unit));
|
|
34
|
+
translate: 0 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* It takes presses meant for the page, and shows nothing. */
|
|
38
|
+
&::backdrop {
|
|
39
|
+
background: transparent;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.modal-head {
|
|
44
|
+
display: grid;
|
|
45
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
46
|
+
column-gap: var(--s-gutter);
|
|
47
|
+
align-items: start;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.modal-body {
|
|
51
|
+
display: contents;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.modal-title {
|
|
55
|
+
font-size: 1.5rem;
|
|
56
|
+
line-height: 2rem;
|
|
57
|
+
font-weight: 700;
|
|
58
|
+
letter-spacing: -0.015em;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media print {
|
|
63
|
+
.modal {
|
|
64
|
+
display: none;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a `sheet` and a `dialog` share: a modal `dialog` element with a
|
|
3
|
+
* title and the button that closes it.
|
|
4
|
+
*
|
|
5
|
+
* @since 0.4.0
|
|
6
|
+
*/
|
|
7
|
+
import type { View } from "effect/ui"
|
|
8
|
+
import type { Html } from "effect/ui/html"
|
|
9
|
+
import { type Child, content, contents as inner, type Kind } from "../../Node.ts"
|
|
10
|
+
import { button } from "../../standard/button/button.ts"
|
|
11
|
+
import styles from "./modal.module.css"
|
|
12
|
+
|
|
13
|
+
/** The Model decides when it is open. */
|
|
14
|
+
export const modal = <Msg, R>(
|
|
15
|
+
h: Html.H<Msg>,
|
|
16
|
+
name: "sheet" | "dialog",
|
|
17
|
+
look: ReadonlyArray<string | false>,
|
|
18
|
+
options: {
|
|
19
|
+
readonly open: boolean
|
|
20
|
+
readonly title: string
|
|
21
|
+
readonly close: { readonly label: string; readonly onPress: Msg }
|
|
22
|
+
readonly alert?: boolean
|
|
23
|
+
},
|
|
24
|
+
children: ReadonlyArray<Child<Kind, Msg, R>>,
|
|
25
|
+
/** What comes after its children, at its bottom. */
|
|
26
|
+
foot?: View.Input<Msg>
|
|
27
|
+
) => {
|
|
28
|
+
const id = h.id(`s-ui-${name}-title`)
|
|
29
|
+
return (
|
|
30
|
+
h.dialog
|
|
31
|
+
.class(styles.modal, ...look)
|
|
32
|
+
.attr("role", options.alert === true ? "alertdialog" : undefined)
|
|
33
|
+
.attr("aria-labelledby", id)
|
|
34
|
+
// A question that must be answered isn't dismissed by a press outside it.
|
|
35
|
+
.attr("closedby", options.alert === true ? "closerequest" : "any")
|
|
36
|
+
.modal(options.open)
|
|
37
|
+
.on("cancel", options.close.onPress)
|
|
38
|
+
.children(
|
|
39
|
+
h.div
|
|
40
|
+
.class(styles["modal-head"])
|
|
41
|
+
.children(
|
|
42
|
+
h.h2.class(styles["modal-title"]).attr("id", id).children(options.title),
|
|
43
|
+
content(
|
|
44
|
+
button(h).button(
|
|
45
|
+
{ kind: "secondary", icon: "close", onClick: options.close.onPress },
|
|
46
|
+
options.close.label
|
|
47
|
+
)
|
|
48
|
+
)
|
|
49
|
+
),
|
|
50
|
+
// Its own box only where a sheet needs one to scroll in; everywhere else its children are laid out as the dialog's own.
|
|
51
|
+
h.div.class(styles["modal-body"]).children(inner(children)),
|
|
52
|
+
foot
|
|
53
|
+
)
|
|
54
|
+
)
|
|
55
|
+
}
|