viewkitjs 0.22.0 → 0.23.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/CHANGELOG.md +27 -0
- package/package.json +2 -4
- package/views/dist/contract.d.ts +6 -289
- package/views/dist/contract.js +1 -96
- package/views/dist/controls/atoms.d.ts +8 -0
- package/views/dist/controls/atoms.js +8 -0
- package/views/dist/controls/button/tokens.d.ts +351 -0
- package/views/dist/controls/button/tokens.js +90 -0
- package/views/dist/controls/checkbox/checkbox.d.ts +28 -0
- package/views/dist/controls/checkbox/checkbox.js +15 -0
- package/views/dist/controls/checkbox/looks.d.ts +3 -0
- package/views/dist/controls/checkbox/looks.js +8 -0
- package/views/dist/controls/checkbox/map-checkbox.d.ts +2 -0
- package/views/dist/controls/checkbox/map-checkbox.js +5 -0
- package/views/dist/controls/checkbox/tokens.d.ts +131 -0
- package/views/dist/controls/checkbox/tokens.js +35 -0
- package/views/dist/controls/checkbox.css +133 -0
- package/views/dist/controls/controls.d.ts +12 -3
- package/views/dist/controls/controls.js +13 -1
- package/views/dist/controls/field/field.d.ts +94 -0
- package/views/dist/controls/field/field.js +46 -0
- package/views/dist/controls/field/looks.d.ts +13 -0
- package/views/dist/controls/field/looks.js +22 -0
- package/views/dist/controls/field/tokens.d.ts +75 -0
- package/views/dist/controls/field/tokens.js +21 -0
- package/views/dist/controls/field.css +98 -0
- package/views/dist/controls/glass-button/glass-button.d.ts +40 -0
- package/views/dist/controls/glass-button/glass-button.js +16 -0
- package/views/dist/controls/glass-button/looks.d.ts +4 -0
- package/views/dist/controls/glass-button/looks.js +4 -0
- package/views/dist/controls/glass-button/tokens.d.ts +127 -0
- package/views/dist/controls/glass-button/tokens.js +34 -0
- package/views/dist/controls/glass-button.css +111 -0
- package/views/dist/controls/index.d.ts +26 -0
- package/views/dist/controls/index.js +25 -0
- package/views/dist/controls/inline-input/inline-input.d.ts +14 -0
- package/views/dist/controls/inline-input/inline-input.js +10 -0
- package/views/dist/controls/inline-input/looks.d.ts +3 -0
- package/views/dist/controls/inline-input/looks.js +16 -0
- package/views/dist/controls/inline-input/tokens.d.ts +79 -0
- package/views/dist/controls/inline-input/tokens.js +22 -0
- package/views/dist/controls/inline-input.css +78 -0
- package/views/dist/controls/input/autofill.d.ts +25 -0
- package/views/dist/controls/input/autofill.js +17 -0
- package/views/dist/controls/input/input.d.ts +119 -0
- package/views/dist/controls/input/input.js +127 -0
- package/views/dist/controls/input/looks.d.ts +41 -0
- package/views/dist/controls/input/looks.js +48 -0
- package/views/dist/controls/input/map-input.d.ts +2 -0
- package/views/dist/controls/input/map-input.js +5 -0
- package/views/dist/controls/input/tokens.d.ts +171 -0
- package/views/dist/controls/input/tokens.js +45 -0
- package/views/dist/controls/input.css +381 -0
- package/views/dist/controls/internal/anchor.d.ts +16 -0
- package/views/dist/controls/internal/anchor.js +8 -0
- package/views/dist/controls/internal/close-reason.d.ts +5 -0
- package/views/dist/controls/internal/close-reason.js +2 -0
- package/views/dist/controls/internal/popup-host.d.ts +7 -0
- package/views/dist/controls/internal/popup-host.js +10 -0
- package/views/dist/controls/internal/scroll.d.ts +11 -0
- package/views/dist/controls/internal/scroll.js +14 -0
- package/views/dist/controls/kbd/kbd.d.ts +13 -0
- package/views/dist/controls/kbd/kbd.js +10 -0
- package/views/dist/controls/kbd/looks.d.ts +4 -0
- package/views/dist/controls/kbd/looks.js +4 -0
- package/views/dist/controls/kbd/tokens.d.ts +47 -0
- package/views/dist/controls/kbd/tokens.js +14 -0
- package/views/dist/controls/kbd.css +46 -0
- package/views/dist/controls/number-field/number-field.d.ts +48 -0
- package/views/dist/controls/number-field/number-field.js +34 -0
- package/views/dist/controls/number-field/tokens.d.ts +47 -0
- package/views/dist/controls/number-field/tokens.js +14 -0
- package/views/dist/controls/number-field.css +54 -0
- package/views/dist/controls/option/atom-tag.d.ts +6 -0
- package/views/dist/controls/option/atom-tag.js +6 -0
- package/views/dist/controls/option/looks.d.ts +7 -0
- package/views/dist/controls/option/looks.js +21 -0
- package/views/dist/controls/option/option.d.ts +35 -0
- package/views/dist/controls/option/option.js +32 -0
- package/views/dist/controls/option/tokens.d.ts +223 -0
- package/views/dist/controls/option/tokens.js +58 -0
- package/views/dist/controls/option.css +92 -0
- package/views/dist/controls/phone-header/header-bar.d.ts +18 -0
- package/views/dist/controls/phone-header/header-bar.js +9 -0
- package/views/dist/controls/phone-header/looks.d.ts +4 -0
- package/views/dist/controls/phone-header/looks.js +4 -0
- package/views/dist/controls/phone-header/soft-edge.d.ts +5 -0
- package/views/dist/controls/phone-header/soft-edge.js +3 -0
- package/views/dist/controls/phone-header/tokens.d.ts +59 -0
- package/views/dist/controls/phone-header/tokens.js +17 -0
- package/views/dist/controls/phone-header.css +51 -0
- package/views/dist/controls/popover/looks.d.ts +4 -0
- package/views/dist/controls/popover/looks.js +10 -0
- package/views/dist/controls/popover/map-popover.d.ts +3 -0
- package/views/dist/controls/popover/map-popover.js +5 -0
- package/views/dist/controls/popover/popover.d.ts +74 -0
- package/views/dist/controls/popover/popover.js +106 -0
- package/views/dist/controls/popover/tokens.d.ts +83 -0
- package/views/dist/controls/popover/tokens.js +23 -0
- package/views/dist/controls/popover.css +94 -0
- package/views/dist/controls/scrollbar/scrollbar.d.ts +10 -0
- package/views/dist/controls/scrollbar/scrollbar.js +143 -0
- package/views/dist/controls/scrollbar/tokens.d.ts +43 -0
- package/views/dist/controls/scrollbar/tokens.js +13 -0
- package/views/dist/controls/scrollbar.css +47 -0
- package/views/dist/controls/sheet/bottom-sheet.d.ts +98 -0
- package/views/dist/controls/sheet/bottom-sheet.js +372 -0
- package/views/dist/controls/sheet/forms.d.ts +38 -0
- package/views/dist/controls/sheet/forms.js +26 -0
- package/views/dist/controls/sheet/looks.d.ts +4 -0
- package/views/dist/controls/sheet/looks.js +10 -0
- package/views/dist/controls/sheet/map-sheet.d.ts +3 -0
- package/views/dist/controls/sheet/map-sheet.js +12 -0
- package/views/dist/controls/sheet/spring.d.ts +22 -0
- package/views/dist/controls/sheet/spring.js +48 -0
- package/views/dist/controls/sheet/tokens.d.ts +143 -0
- package/views/dist/controls/sheet/tokens.js +38 -0
- package/views/dist/controls/sheet.css +220 -0
- package/views/dist/controls/spinner/tokens.d.ts +55 -0
- package/views/dist/controls/spinner/tokens.js +16 -0
- package/views/dist/controls/status/atom-status-badge.d.ts +10 -0
- package/views/dist/controls/status/atom-status-badge.js +13 -0
- package/views/dist/controls/status/looks.d.ts +4 -0
- package/views/dist/controls/status/looks.js +22 -0
- package/views/dist/controls/status/marks.d.ts +26 -0
- package/views/dist/controls/status/marks.js +73 -0
- package/views/dist/controls/status/status.d.ts +43 -0
- package/views/dist/controls/status/status.js +26 -0
- package/views/dist/controls/status/tokens.d.ts +407 -0
- package/views/dist/controls/status/tokens.js +104 -0
- package/views/dist/controls/status.css +164 -0
- package/views/dist/controls/switch/looks.d.ts +4 -0
- package/views/dist/controls/switch/looks.js +19 -0
- package/views/dist/controls/switch/switch.d.ts +15 -0
- package/views/dist/controls/switch/switch.js +11 -0
- package/views/dist/controls/switch/tokens.d.ts +139 -0
- package/views/dist/controls/switch/tokens.js +37 -0
- package/views/dist/controls/switch.css +169 -0
- package/views/dist/controls/tag/atom-cell-more.d.ts +3 -0
- package/views/dist/controls/tag/atom-cell-more.js +5 -0
- package/views/dist/controls/tag/looks.d.ts +4 -0
- package/views/dist/controls/tag/looks.js +4 -0
- package/views/dist/controls/tag/tag.d.ts +25 -0
- package/views/dist/controls/tag/tag.js +19 -0
- package/views/dist/controls/tag/tokens.d.ts +63 -0
- package/views/dist/controls/tag/tokens.js +18 -0
- package/views/dist/controls/tag.css +81 -0
- package/views/dist/controls/toggle/looks.d.ts +3 -0
- package/views/dist/controls/toggle/looks.js +12 -0
- package/views/dist/controls/toggle/toggle.d.ts +47 -0
- package/views/dist/controls/toggle/toggle.js +23 -0
- package/views/dist/controls/toggle/tokens.d.ts +55 -0
- package/views/dist/controls/toggle/tokens.js +16 -0
- package/views/dist/controls/toggle.css +67 -0
- package/views/dist/controls/tokens.d.ts +16 -0
- package/views/dist/controls/tokens.js +45 -0
- package/views/dist/controls/tooltip/looks.d.ts +4 -0
- package/views/dist/controls/tooltip/looks.js +4 -0
- package/views/dist/controls/tooltip/map-tooltip.d.ts +3 -0
- package/views/dist/controls/tooltip/map-tooltip.js +5 -0
- package/views/dist/controls/tooltip/tokens.d.ts +75 -0
- package/views/dist/controls/tooltip/tokens.js +21 -0
- package/views/dist/controls/tooltip/tooltip.d.ts +54 -0
- package/views/dist/controls/tooltip/tooltip.js +78 -0
- package/views/dist/controls/tooltip.css +94 -0
- package/views/dist/grid/chrome/GridTable.js +21 -19
- package/views/dist/grid/chrome/grid-row-window.js +3 -0
- package/views/dist/grid/chrome/useGridColumnLayout.d.ts +4 -1
- package/views/dist/grid/chrome/useGridColumnLayout.js +17 -2
- package/views/dist/grid/chrome/useGridFittedWidths.d.ts +29 -0
- package/views/dist/grid/chrome/useGridFittedWidths.js +46 -0
- package/views/dist/looks/index.d.ts +15 -0
- package/views/dist/looks/index.js +15 -0
- package/views/dist/looks/pieces.js +36 -2
- package/views/dist/model/column-schema.d.ts +3 -2
- package/views/dist/model/column-state.d.ts +11 -1
- package/views/dist/model/column-state.js +8 -2
- package/views/dist/styles.css +1930 -7
- package/views/dist/styles.unlayered.css +1930 -7
- package/views/docs/contract.md +5 -97
- package/views/docs/controls/button.md +93 -0
- package/views/docs/controls/checkbox.md +38 -0
- package/views/docs/controls/field.md +26 -0
- package/views/docs/controls/glass-button.md +37 -0
- package/views/docs/controls/inline-input.md +27 -0
- package/views/docs/controls/input.md +48 -0
- package/views/docs/controls/kbd.md +17 -0
- package/views/docs/controls/number-field.md +17 -0
- package/views/docs/controls/option.md +61 -0
- package/views/docs/controls/phone-header.md +20 -0
- package/views/docs/controls/popover.md +26 -0
- package/views/docs/controls/scrollbar.md +16 -0
- package/views/docs/controls/sheet.md +41 -0
- package/views/docs/controls/spinner.md +19 -0
- package/views/docs/controls/status.md +107 -0
- package/views/docs/controls/switch.md +40 -0
- package/views/docs/controls/tag.md +21 -0
- package/views/docs/controls/toggle.md +19 -0
- package/views/docs/controls/tooltip.md +24 -0
- package/views/docs/getting-started.md +1 -1
- package/views/docs/reference/controls.md +173 -2
- package/views/docs/reference/looks.md +67 -2
- package/views/docs/reference/views.md +7 -2
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
export declare const SHEET_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-backdrop-sheet";
|
|
3
|
+
readonly kind: "colour";
|
|
4
|
+
readonly outright: "--backdrop-sheet";
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "--vk-backdrop-sheet-light";
|
|
7
|
+
readonly kind: "colour";
|
|
8
|
+
readonly outright: "--backdrop-sheet-light";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "--vk-backdrop-stacked";
|
|
11
|
+
readonly kind: "colour";
|
|
12
|
+
readonly outright: "--backdrop-stacked";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-overlay";
|
|
15
|
+
readonly kind: "colour";
|
|
16
|
+
readonly outright: "--surface-overlay";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-fg";
|
|
19
|
+
readonly kind: "colour";
|
|
20
|
+
readonly outright: "--text";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-sheet-handle";
|
|
23
|
+
readonly kind: "colour";
|
|
24
|
+
readonly outright: "--sheet-handle";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-border-subtle";
|
|
27
|
+
readonly kind: "colour";
|
|
28
|
+
readonly outright: "--border-subtle";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-shadow-2xl";
|
|
31
|
+
readonly kind: "shadow";
|
|
32
|
+
readonly outright: "--shadow-2xl";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-radius-2xl";
|
|
35
|
+
readonly kind: "size";
|
|
36
|
+
readonly outright: "--radius-2xl";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-spacing";
|
|
39
|
+
readonly kind: "size";
|
|
40
|
+
readonly outright: "--spacing";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-spring-exit";
|
|
43
|
+
readonly kind: "size";
|
|
44
|
+
readonly outright: "--spring-exit";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-spring-past";
|
|
47
|
+
readonly kind: "size";
|
|
48
|
+
readonly outright: "--spring-past";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "--vk-radius-lg";
|
|
51
|
+
readonly kind: "size";
|
|
52
|
+
readonly outright: "--radius-lg";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "--vk-radius-xl";
|
|
55
|
+
readonly kind: "size";
|
|
56
|
+
readonly outright: "--radius-xl";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "--vk-radius-3xl";
|
|
59
|
+
readonly kind: "size";
|
|
60
|
+
readonly outright: "--radius-3xl";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "--vk-radius-4xl";
|
|
63
|
+
readonly kind: "size";
|
|
64
|
+
readonly outright: "--radius-4xl";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "--vk-radius-5xl";
|
|
67
|
+
readonly kind: "size";
|
|
68
|
+
readonly outright: "--radius-5xl";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "--vk-layer-drawer";
|
|
71
|
+
readonly kind: "size";
|
|
72
|
+
readonly outright: "--layer-drawer";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "--vk-radius-full";
|
|
75
|
+
readonly kind: "size";
|
|
76
|
+
readonly outright: "--radius-full";
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "--vk-border-width";
|
|
79
|
+
readonly kind: "size";
|
|
80
|
+
readonly outright: "--border-width";
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "--vk-spring-smooth";
|
|
83
|
+
readonly kind: "motion";
|
|
84
|
+
readonly outright: "--spring-smooth";
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: "--vk-ease-spring-smooth";
|
|
87
|
+
readonly kind: "motion";
|
|
88
|
+
readonly outright: "--ease-spring-smooth";
|
|
89
|
+
}, {
|
|
90
|
+
readonly name: "--vk-duration-spring-smooth";
|
|
91
|
+
readonly kind: "motion";
|
|
92
|
+
readonly outright: "--duration-spring-smooth";
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "--vk-spring-quick";
|
|
95
|
+
readonly kind: "motion";
|
|
96
|
+
readonly outright: "--spring-quick";
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "--vk-ease-spring-quick";
|
|
99
|
+
readonly kind: "motion";
|
|
100
|
+
readonly outright: "--ease-spring-quick";
|
|
101
|
+
}, {
|
|
102
|
+
readonly name: "--vk-duration-spring-quick";
|
|
103
|
+
readonly kind: "motion";
|
|
104
|
+
readonly outright: "--duration-spring-quick";
|
|
105
|
+
}, {
|
|
106
|
+
readonly name: "--vk-spring-lively";
|
|
107
|
+
readonly kind: "motion";
|
|
108
|
+
readonly outright: "--spring-lively";
|
|
109
|
+
}, {
|
|
110
|
+
readonly name: "--vk-ease-spring-lively";
|
|
111
|
+
readonly kind: "motion";
|
|
112
|
+
readonly outright: "--ease-spring-lively";
|
|
113
|
+
}, {
|
|
114
|
+
readonly name: "--vk-duration-spring-lively";
|
|
115
|
+
readonly kind: "motion";
|
|
116
|
+
readonly outright: "--duration-spring-lively";
|
|
117
|
+
}, {
|
|
118
|
+
readonly name: "--vk-sheet-press-scale";
|
|
119
|
+
readonly kind: "motion";
|
|
120
|
+
readonly outright: "--sheet-press-scale";
|
|
121
|
+
}, {
|
|
122
|
+
readonly name: "--vk-duration-slow";
|
|
123
|
+
readonly kind: "motion";
|
|
124
|
+
readonly outright: "--duration-slow";
|
|
125
|
+
}, {
|
|
126
|
+
readonly name: "--vk-ease-out";
|
|
127
|
+
readonly kind: "motion";
|
|
128
|
+
readonly outright: "--ease-out";
|
|
129
|
+
}, {
|
|
130
|
+
readonly name: "--vk-push-scale";
|
|
131
|
+
readonly kind: "motion";
|
|
132
|
+
readonly outright: "--push-scale";
|
|
133
|
+
}, {
|
|
134
|
+
readonly name: "--vk-duration-fast";
|
|
135
|
+
readonly kind: "motion";
|
|
136
|
+
readonly outright: "--duration-fast";
|
|
137
|
+
}, {
|
|
138
|
+
readonly name: "--vk-duration-base";
|
|
139
|
+
readonly kind: "motion";
|
|
140
|
+
readonly outright: "--duration-base";
|
|
141
|
+
}];
|
|
142
|
+
/** The prefixes of its own machinery, set and read by it alone: not public. */
|
|
143
|
+
export declare const SHEET_PRIVATE: readonly ["--sheet-", "--drawer-", "--step-", "--safe-area-", "--page-padding", "--phone-padding", "--screen-curve-"];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const SHEET_TOKENS = [
|
|
2
|
+
{ name: "--vk-backdrop-sheet", kind: "colour", outright: "--backdrop-sheet" },
|
|
3
|
+
{ name: "--vk-backdrop-sheet-light", kind: "colour", outright: "--backdrop-sheet-light" },
|
|
4
|
+
{ name: "--vk-backdrop-stacked", kind: "colour", outright: "--backdrop-stacked" },
|
|
5
|
+
{ name: "--vk-overlay", kind: "colour", outright: "--surface-overlay" },
|
|
6
|
+
{ name: "--vk-fg", kind: "colour", outright: "--text" },
|
|
7
|
+
{ name: "--vk-sheet-handle", kind: "colour", outright: "--sheet-handle" },
|
|
8
|
+
{ name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
|
|
9
|
+
{ name: "--vk-shadow-2xl", kind: "shadow", outright: "--shadow-2xl" },
|
|
10
|
+
{ name: "--vk-radius-2xl", kind: "size", outright: "--radius-2xl" },
|
|
11
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
12
|
+
{ name: "--vk-spring-exit", kind: "size", outright: "--spring-exit" },
|
|
13
|
+
{ name: "--vk-spring-past", kind: "size", outright: "--spring-past" },
|
|
14
|
+
{ name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
|
|
15
|
+
{ name: "--vk-radius-xl", kind: "size", outright: "--radius-xl" },
|
|
16
|
+
{ name: "--vk-radius-3xl", kind: "size", outright: "--radius-3xl" },
|
|
17
|
+
{ name: "--vk-radius-4xl", kind: "size", outright: "--radius-4xl" },
|
|
18
|
+
{ name: "--vk-radius-5xl", kind: "size", outright: "--radius-5xl" },
|
|
19
|
+
{ name: "--vk-layer-drawer", kind: "size", outright: "--layer-drawer" },
|
|
20
|
+
{ name: "--vk-radius-full", kind: "size", outright: "--radius-full" },
|
|
21
|
+
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
22
|
+
{ name: "--vk-spring-smooth", kind: "motion", outright: "--spring-smooth" },
|
|
23
|
+
{ name: "--vk-ease-spring-smooth", kind: "motion", outright: "--ease-spring-smooth" },
|
|
24
|
+
{ name: "--vk-duration-spring-smooth", kind: "motion", outright: "--duration-spring-smooth" },
|
|
25
|
+
{ name: "--vk-spring-quick", kind: "motion", outright: "--spring-quick" },
|
|
26
|
+
{ name: "--vk-ease-spring-quick", kind: "motion", outright: "--ease-spring-quick" },
|
|
27
|
+
{ name: "--vk-duration-spring-quick", kind: "motion", outright: "--duration-spring-quick" },
|
|
28
|
+
{ name: "--vk-spring-lively", kind: "motion", outright: "--spring-lively" },
|
|
29
|
+
{ name: "--vk-ease-spring-lively", kind: "motion", outright: "--ease-spring-lively" },
|
|
30
|
+
{ name: "--vk-duration-spring-lively", kind: "motion", outright: "--duration-spring-lively" },
|
|
31
|
+
{ name: "--vk-sheet-press-scale", kind: "motion", outright: "--sheet-press-scale" },
|
|
32
|
+
{ name: "--vk-duration-slow", kind: "motion", outright: "--duration-slow" },
|
|
33
|
+
{ name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
|
|
34
|
+
{ name: "--vk-push-scale", kind: "motion", outright: "--push-scale" },
|
|
35
|
+
{ name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
|
|
36
|
+
{ name: "--vk-duration-base", kind: "motion", outright: "--duration-base" },
|
|
37
|
+
];
|
|
38
|
+
export const SHEET_PRIVATE = ["--sheet-", "--drawer-", "--step-", "--safe-area-", "--page-padding", "--phone-padding", "--screen-curve-"];
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/* The bottom Sheet. Every value it draws with is a public name (controls/sheet/tokens.ts); this file only says which name each
|
|
2
|
+
part takes. Its options (looks.ts) are data attributes on the frame around it, and each one only chooses other names:
|
|
3
|
+
|
|
4
|
+
data-sheet-spring smooth · quick · lively which spring it settles on
|
|
5
|
+
data-sheet-corners lg · xl · 2xl · 3xl · 4xl · 5xl which radius its corners take
|
|
6
|
+
data-sheet-smoothing round · smooth how its corners bend
|
|
7
|
+
data-sheet-margin 4 · 6 · 8 · 10 · 12 how far a floating sheet stands from the edges
|
|
8
|
+
data-sheet-padding page · 12 · 16 · 20 · 24 how far its content stands from its sides: the page's padding, or its own
|
|
9
|
+
data-sheet-dim deep · light which dim stands behind it
|
|
10
|
+
|
|
11
|
+
Page reads --phone-padding, the phone's page padding where what holds it sets one; with none it reads --page-padding, and
|
|
12
|
+
with neither it stands at 24. Its head is the phone header bar (phone-header.css), Glass unless the frame says
|
|
13
|
+
data-phone-header-surface="flat".
|
|
14
|
+
|
|
15
|
+
data-sheet-form on the sheet says which of its forms it is: full, floating, blend or edge (forms.ts). Base UI marks it
|
|
16
|
+
data-starting-style and data-ending-style while it comes and goes, data-swiping while it is dragged and data-expanded at
|
|
17
|
+
full height; while it comes in, until it rests, .o-sheet-shield stands over it (bottom-sheet.tsx), and moves it by
|
|
18
|
+
--drawer-snap-point-offset and --drawer-swipe-movement-y. bottom-sheet.tsx writes the rest:
|
|
19
|
+
--sheet-gone how far below its lowest stop it has been dragged, 0 to 1: the dim fades by it
|
|
20
|
+
--sheet-ease, --sheet-time the settle compiled for this release; with none, the spring's own
|
|
21
|
+
--sheet-catch how far it was caught from its stop, grabbed in mid-settle
|
|
22
|
+
--sheet-lift how far its foot is raised, so it stays at the screen's foot at a lower stop
|
|
23
|
+
--sheet-fit how tall a floating sheet's content is
|
|
24
|
+
--sheet-screen the curve of the screen it stands on, read from --screen-curve-<w>x<h> where the page declares one
|
|
25
|
+
--sheet-rise how far a blend has opened out from floating to full, 0 to 1
|
|
26
|
+
--sheet-scale how far a blend is scaled down to floating's width, 1 at full
|
|
27
|
+
--sheet-cut how much of a blend's foot is cut off, so it ends on floating's foot
|
|
28
|
+
--sheet-keyboard while a box in it has focus, how far the phone's keyboard covers the screen's foot: a full Sheet's body
|
|
29
|
+
keeps that under what it holds where it is more than its own padding
|
|
30
|
+
and reads, on it, --sheet-spring (its spring), --sheet-exit and --sheet-past (how far a settle may carry it).
|
|
31
|
+
|
|
32
|
+
The rules sit in the components layer, so a utility class on a sheet still wins. */
|
|
33
|
+
@layer components {
|
|
34
|
+
|
|
35
|
+
.o-sheet, .o-sheet-backdrop, .o-sheet-below {
|
|
36
|
+
--sheet-spring: var(--vk-spring-quick); --sheet-spring-ease: var(--vk-ease-spring-quick); --sheet-spring-time: var(--vk-duration-spring-quick);
|
|
37
|
+
}
|
|
38
|
+
[data-sheet-spring="smooth"] :is(.o-sheet, .o-sheet-backdrop) { --sheet-spring: var(--vk-spring-smooth); --sheet-spring-ease: var(--vk-ease-spring-smooth); --sheet-spring-time: var(--vk-duration-spring-smooth); }
|
|
39
|
+
[data-sheet-spring="lively"] :is(.o-sheet, .o-sheet-backdrop) { --sheet-spring: var(--vk-spring-lively); --sheet-spring-ease: var(--vk-ease-spring-lively); --sheet-spring-time: var(--vk-duration-spring-lively); }
|
|
40
|
+
.o-sheet { --sheet-radius: var(--vk-radius-2xl); --sheet-padding: var(--phone-padding, var(--page-padding, calc(var(--vk-spacing) * 6))); }
|
|
41
|
+
.o-sheet { --sheet-exit: var(--vk-spring-exit); --sheet-past: var(--vk-spring-past); }
|
|
42
|
+
[data-sheet-padding="12"] .o-sheet { --sheet-padding: calc(var(--vk-spacing) * 3); }
|
|
43
|
+
[data-sheet-padding="16"] .o-sheet { --sheet-padding: calc(var(--vk-spacing) * 4); }
|
|
44
|
+
[data-sheet-padding="20"] .o-sheet { --sheet-padding: calc(var(--vk-spacing) * 5); }
|
|
45
|
+
[data-sheet-padding="24"] .o-sheet { --sheet-padding: calc(var(--vk-spacing) * 6); }
|
|
46
|
+
[data-sheet-corners="lg"] .o-sheet { --sheet-radius: var(--vk-radius-lg); }
|
|
47
|
+
[data-sheet-corners="xl"] .o-sheet { --sheet-radius: var(--vk-radius-xl); }
|
|
48
|
+
[data-sheet-corners="3xl"] .o-sheet { --sheet-radius: var(--vk-radius-3xl); }
|
|
49
|
+
[data-sheet-corners="4xl"] .o-sheet { --sheet-radius: var(--vk-radius-4xl); }
|
|
50
|
+
[data-sheet-corners="5xl"] .o-sheet { --sheet-radius: var(--vk-radius-5xl); }
|
|
51
|
+
|
|
52
|
+
/* ── Its dim: whole at any stop, fading only below the lowest; dim and blocked travel together. It moves as the sheet
|
|
53
|
+
does. A sheet on a sheet has a lighter one of its own ──────────────────────────────────────────────────────────── */
|
|
54
|
+
.o-sheet-backdrop {
|
|
55
|
+
position: fixed; inset: 0; z-index: var(--vk-layer-drawer); background-color: var(--vk-backdrop-sheet-light); opacity: calc(1 - var(--sheet-gone, 0));
|
|
56
|
+
transition: opacity var(--sheet-time, var(--sheet-spring-time)) var(--sheet-ease, var(--sheet-spring-ease));
|
|
57
|
+
}
|
|
58
|
+
[data-sheet-dim="deep"] .o-sheet-backdrop { background-color: var(--vk-backdrop-sheet); }
|
|
59
|
+
.o-sheet-backdrop[data-stacked] { background-color: var(--vk-backdrop-stacked); }
|
|
60
|
+
.o-sheet-backdrop:is([data-starting-style], [data-ending-style]) { opacity: 0; }
|
|
61
|
+
.o-sheet-backdrop[data-swiping] { transition: none; }
|
|
62
|
+
|
|
63
|
+
/* ── What goes on under Safari's floating toolbar, in the page, where nothing fixed paints (bottom-sheet.tsx). Under full
|
|
64
|
+
it goes on as the sheet does until the sheet has gone; under floating it goes on as the dim does ────────────────── */
|
|
65
|
+
.o-sheet-below { position: absolute; left: 0; right: 0; height: calc(var(--vk-spacing) * 40); z-index: var(--vk-layer-drawer); pointer-events: none; }
|
|
66
|
+
.o-sheet-below:is([data-sheet-form="floating"], [data-sheet-form="blend"]) {
|
|
67
|
+
opacity: calc(1 - var(--sheet-gone, 0)); transition: opacity var(--sheet-time, var(--sheet-spring-time)) var(--sheet-ease, var(--sheet-spring-ease));
|
|
68
|
+
@starting-style { opacity: 0; }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* ── Where it sits: from the bottom, the gesture its own from the first touch ────────────────────────────────────── */
|
|
72
|
+
.o-sheet-viewport { position: fixed; inset: 0; z-index: var(--vk-layer-drawer); display: flex; align-items: flex-end; justify-content: center; touch-action: none; }
|
|
73
|
+
.o-sheet-viewport { --sheet-gap: calc(var(--vk-spacing) * 2); }
|
|
74
|
+
[data-sheet-margin="4"] .o-sheet-viewport { --sheet-gap: calc(var(--vk-spacing) * 1); }
|
|
75
|
+
[data-sheet-margin="6"] .o-sheet-viewport { --sheet-gap: calc(var(--vk-spacing) * 1.5); }
|
|
76
|
+
[data-sheet-margin="10"] .o-sheet-viewport { --sheet-gap: calc(var(--vk-spacing) * 2.5); }
|
|
77
|
+
[data-sheet-margin="12"] .o-sheet-viewport { --sheet-gap: calc(var(--vk-spacing) * 3); }
|
|
78
|
+
.o-sheet-viewport[data-sheet-form="floating"] {
|
|
79
|
+
padding: 0 calc(var(--sheet-gap) + var(--safe-area-right, env(safe-area-inset-right, 0px))) var(--sheet-gap) calc(var(--sheet-gap) + var(--safe-area-left, env(safe-area-inset-left, 0px)));
|
|
80
|
+
}
|
|
81
|
+
/* Coming in, over all of it, the sheet and its dim: a press lands here and nothing in it is pressed. After the sheet in
|
|
82
|
+
the page, so it is drawn and pressed over it. */
|
|
83
|
+
.o-sheet-shield { position: absolute; inset: 0; }
|
|
84
|
+
|
|
85
|
+
/* ── It: moved only by transform, from its stop and the finger; on a spring whenever no finger holds it. Base UI holds
|
|
86
|
+
transition: none on it through a drag, inline, and takes that away itself at the release: a rule of ours would outlive
|
|
87
|
+
that by a moment, in which Base UI reads its height, and a sheet let go to close would jump to its end ──────────── */
|
|
88
|
+
.o-sheet {
|
|
89
|
+
position: relative; box-sizing: border-box; display: flex; flex-direction: column; width: 100%; min-height: 0;
|
|
90
|
+
background-color: var(--vk-overlay); color: var(--vk-fg); box-shadow: var(--vk-shadow-2xl); outline: none;
|
|
91
|
+
touch-action: none; will-change: transform; transform-origin: 50% 0;
|
|
92
|
+
transform: translateY(calc(var(--drawer-snap-point-offset, 0px) + var(--drawer-swipe-movement-y, 0px) + var(--sheet-catch, 0px)));
|
|
93
|
+
transition: transform var(--sheet-time, var(--sheet-spring-time)) var(--sheet-ease, var(--sheet-spring-ease)), clip-path var(--sheet-time, var(--sheet-spring-time)) var(--sheet-ease, var(--sheet-spring-ease)), transform-origin var(--sheet-time, var(--sheet-spring-time)) var(--sheet-ease, var(--sheet-spring-ease)), scale var(--sheet-time, var(--sheet-spring-time)) var(--sheet-ease, var(--sheet-spring-ease)), height var(--sheet-spring-time) var(--sheet-spring-ease);
|
|
94
|
+
}
|
|
95
|
+
.o-sheet:is([data-starting-style], [data-ending-style]) { transform: translateY(calc(100% + var(--sheet-margin, 0px))); }
|
|
96
|
+
.o-sheet[data-swiping] { user-select: none; }
|
|
97
|
+
/* Under a finger where it can drag, a floating sheet or a blend below full grows a little, ready to be moved, and goes back on its spring. It is
|
|
98
|
+
scale and an animation, since from the touch Base UI writes transform and transition: none inline. */
|
|
99
|
+
@keyframes o-sheet-press { from { scale: var(--sheet-scale, 1); } }
|
|
100
|
+
.o-sheet[data-sheet-pressed]:is([data-sheet-form="floating"], [data-sheet-form="blend"]:not([data-expanded])) { scale: calc(var(--sheet-scale, 1) * var(--vk-sheet-press-scale)); animation: o-sheet-press var(--vk-duration-slow) var(--vk-ease-out); }
|
|
101
|
+
|
|
102
|
+
/* Full: edge to edge, rounded on top, just under the status bar. Under it, the sheet goes on past its foot, so nothing
|
|
103
|
+
shows when it is pulled above its top stop or swings past it. */
|
|
104
|
+
.o-sheet:is([data-sheet-form="full"], [data-sheet-form="blend"]) {
|
|
105
|
+
height: calc(100% - var(--safe-area-top, env(safe-area-inset-top, 0px)) - var(--vk-spacing) * 2.5); border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
|
|
106
|
+
}
|
|
107
|
+
.o-sheet:is([data-sheet-form="full"], [data-sheet-form="blend"], [data-sheet-form="edge"])::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 100%; background-color: inherit; }
|
|
108
|
+
/* Edge: full's shape, as tall as what it holds, as floating is. Its body clears the home bar and no more. */
|
|
109
|
+
.o-sheet[data-sheet-form="edge"] { height: var(--sheet-fit, auto); max-height: calc(100% - var(--safe-area-top, env(safe-area-inset-top, 0px)) - var(--vk-spacing) * 12); border-radius: var(--sheet-radius) var(--sheet-radius) 0 0; }
|
|
110
|
+
.o-sheet[data-sheet-form="edge"] .o-sheet-body { padding-bottom: calc(var(--vk-spacing) * 3 + var(--safe-area-bottom, env(safe-area-inset-bottom, 0px))); }
|
|
111
|
+
/* Floating: the same margin from the screen's left, right and bottom, past the home bar, which what it holds clears instead.
|
|
112
|
+
Its bottom corners follow the phone's own: the screen's curve less the margin, or Corners on a screen no token knows. Its
|
|
113
|
+
top corners, which stand on no screen's edge, take Corners.
|
|
114
|
+
As tall as what is in it; past its most, its body scrolls. */
|
|
115
|
+
.o-sheet[data-sheet-form="floating"] {
|
|
116
|
+
--sheet-margin: var(--sheet-gap); --sheet-curve: calc(var(--sheet-screen) - var(--sheet-gap));
|
|
117
|
+
--sheet-home: calc(var(--safe-area-bottom, env(safe-area-inset-bottom, 0px)) - var(--sheet-gap));
|
|
118
|
+
transform-origin: 50% 100%; height: var(--sheet-fit, auto); max-height: calc(100% - var(--safe-area-top, env(safe-area-inset-top, 0px)) - var(--vk-spacing) * 12); border-radius: var(--sheet-radius) var(--sheet-radius) var(--sheet-curve, var(--sheet-radius)) var(--sheet-curve, var(--sheet-radius)); overflow: clip;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* Blend: the two forms as one. It is laid out once, at full's width and height, and at its lower stops the whole of it is scaled
|
|
122
|
+
down to floating's width, its head, buttons, text and padding together, and cut to floating's foot and bottom corners. From
|
|
123
|
+
the stop under full it grows to edge to edge with the sheet, as one piece: nothing is laid out again, so no line wraps
|
|
124
|
+
differently. It cuts its own foot, so it casts no shadow. It scales from where it stands, so its stops stay where they are. */
|
|
125
|
+
.o-sheet[data-sheet-form="blend"] {
|
|
126
|
+
--sheet-margin: var(--sheet-gap); --sheet-curve: calc(var(--sheet-screen) - var(--sheet-gap));
|
|
127
|
+
--sheet-round: calc(var(--sheet-curve, var(--sheet-radius)) * (1 - var(--sheet-rise, 0)) / var(--sheet-scale, 1));
|
|
128
|
+
scroll-margin-left: var(--sheet-gap); scale: var(--sheet-scale, 1);
|
|
129
|
+
transform-origin: 50% calc(var(--drawer-snap-point-offset, 0px) + var(--drawer-swipe-movement-y, 0px));
|
|
130
|
+
clip-path: inset(0 0 var(--sheet-cut, 0px) round var(--sheet-radius) var(--sheet-radius) var(--sheet-round) var(--sheet-round));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Its corners smooth: the same corners, drawn as an outline, so every browser that knows shape() shows them; one that doesn't
|
|
134
|
+
keeps the quarter circles above. Each corner is three curves, Apple's own sheet as measured (smoothing 70%): the bend starts
|
|
135
|
+
1.7 radii from the corner and meets the quarter circle at the tip, so a corner stands as large as a round one and only comes
|
|
136
|
+
in softer. It is the one smooth outline (smooth.css): --smooth-t the top corners' radius, --smooth-b the bottom ones',
|
|
137
|
+
--smooth-foot where it ends. A blend cuts itself. Full and floating cast a shadow, which a cut would take with it, so they keep it
|
|
138
|
+
and .o-sheet-cut, inside them, is cut and carries their ground instead. */
|
|
139
|
+
/* What it holds is cut along its corners, whichever way they bend, so nothing in it, a Glass button's wide shadow, reaches past
|
|
140
|
+
the curve. It is a cut of its own, not a clip-path: under one, Firefox loses a sticky header's blur and squares what it cuts. */
|
|
141
|
+
.o-sheet-cut { display: flex; flex-direction: column; flex: 1; width: 100%; min-height: 0; background-color: inherit; border-radius: inherit; overflow: clip; }
|
|
142
|
+
@supports (clip-path: shape(from 0 0, curve by 1px 1px with 1px 0 / 1px 0, close)) {
|
|
143
|
+
.o-sheet:not([data-sheet-smoothing="round"] *) { --smooth-t: var(--sheet-radius); --smooth-b: 0px; --smooth-foot: 100%; --sheet-outline: shape(var(--smooth-outline)); }
|
|
144
|
+
.o-sheet[data-sheet-form="floating"]:not([data-sheet-smoothing="round"] *) { --smooth-b: var(--sheet-curve, var(--sheet-radius)); }
|
|
145
|
+
.o-sheet[data-sheet-form="blend"]:not([data-sheet-smoothing="round"] *) { --smooth-b: var(--sheet-round); --smooth-foot: calc(100% - var(--sheet-cut, 0px)); clip-path: var(--sheet-outline); }
|
|
146
|
+
.o-sheet:is([data-sheet-form="full"], [data-sheet-form="floating"], [data-sheet-form="edge"]):not([data-sheet-smoothing="round"] *) { background-color: transparent; }
|
|
147
|
+
.o-sheet:is([data-sheet-form="full"], [data-sheet-form="floating"], [data-sheet-form="edge"]):not([data-sheet-smoothing="round"] *)::after { background-color: var(--vk-overlay); }
|
|
148
|
+
.o-sheet:is([data-sheet-form="full"], [data-sheet-form="floating"], [data-sheet-form="edge"]):not([data-sheet-smoothing="round"] *) > .o-sheet-cut { background-color: var(--vk-overlay); clip-path: var(--sheet-outline); }
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* A sheet on a sheet: the one below steps back and stays still; only the top one is live. */
|
|
152
|
+
.o-sheet[data-nested-drawer-open] { scale: var(--vk-push-scale); }
|
|
153
|
+
|
|
154
|
+
/* ── Its handle, then its head, the drag's own ground. Its head is the one header (phone-header.css), standing under the
|
|
155
|
+
handle; the phone header's options reach it here too. With no head the handle stands alone, its drag a little taller ───────── */
|
|
156
|
+
.o-sheet-handle { flex: none; align-self: center; width: calc(var(--vk-spacing) * 9); height: calc(var(--vk-spacing) * 1.25); margin-block: calc(var(--vk-spacing) * 1) calc(var(--vk-spacing) * 0.5); border-radius: var(--vk-radius-full); background-color: var(--vk-sheet-handle); }
|
|
157
|
+
.o-sheet-handle:has(+ .o-sheet-body) { margin-bottom: calc(var(--vk-spacing) * 3); }
|
|
158
|
+
.o-sheet-head { flex: none; box-sizing: border-box; min-width: 0; user-select: none; }
|
|
159
|
+
/* The buttons in its corners stand as far from the top as from the sides: the row starts under the handle's 11. */
|
|
160
|
+
.o-sheet-row { margin: calc(var(--sheet-padding) - var(--vk-spacing) * 2.75) 0 calc(var(--vk-spacing) * 2); }
|
|
161
|
+
/* Its buttons: Its head says which of the two shows (bottom-sheet.tsx). */
|
|
162
|
+
[data-phone-header-surface="flat"] .o-sheet-row .o-sheet-glass, .o-sheet-row .o-sheet-plain:not([data-phone-header-surface="flat"] *) { display: none; }
|
|
163
|
+
.o-sheet-row .o-sheet-glass:not([data-phone-header-surface="flat"] *) { display: grid; }
|
|
164
|
+
/* One that holds a word lays its icon and its word out in a line, as the Glass button does. */
|
|
165
|
+
.o-sheet-row .o-sheet-glass.o-glass-button-worded:not([data-phone-header-surface="flat"] *) { display: inline-flex; }
|
|
166
|
+
/* Glass: its head floats. The soft edge starts at the sheet's top, on the sheet's ground, and the body runs up under it and the
|
|
167
|
+
handle, by as much as they stand tall, so what scrolls passes under the buttons and what it holds still starts where it did. */
|
|
168
|
+
.o-sheet-handle:not([data-phone-header-surface="flat"] *) { position: relative; z-index: 2; }
|
|
169
|
+
.o-sheet-head:not([data-phone-header-surface="flat"] *) { position: relative; z-index: 1; --hd-bar-room: var(--sheet-padding); --soft-edge-ground: var(--vk-overlay); }
|
|
170
|
+
.o-sheet-head + .o-sheet-body:not([data-phone-header-surface="flat"] *) { --sheet-under: calc(var(--sheet-padding) + var(--vk-spacing) * 13); }
|
|
171
|
+
/* Its head stands on the sheet's padding, not the page's, which phone-header.css reads; flat's own, below, still wins. */
|
|
172
|
+
.o-sheet-head > .o-sheet-row { padding-inline: var(--sheet-padding); }
|
|
173
|
+
.o-sheet-row > .o-hd-bar-edge { border-radius: var(--sheet-radius) var(--sheet-radius) 0 0; }
|
|
174
|
+
/* Flat, in a sheet: quiet Buttons in a shorter row. A plain button is a glyph in a 36px target, 12
|
|
175
|
+
inside it, so the target's edge stands 12 short of the padding. With nothing on its left, a title at the left stands on the
|
|
176
|
+
padding, and Back's arrow does. */
|
|
177
|
+
[data-phone-header-surface="flat"] .o-sheet-row { gap: 0; height: calc(var(--vk-spacing) * 9); margin: calc(var(--sheet-padding) - var(--vk-spacing) * 5.75) 0 calc(var(--vk-spacing) * 1); padding-inline: calc(var(--sheet-padding) - var(--vk-spacing) * 3); }
|
|
178
|
+
[data-phone-header-surface="flat"] .o-sheet-row > .o-hd-bar-side { min-width: 0; }
|
|
179
|
+
[data-phone-header-surface="flat"] .o-sheet-row[data-title-at="left"]:not([data-sides]) { padding-left: var(--sheet-padding); }
|
|
180
|
+
[data-phone-header-surface="flat"] .o-sheet-row[data-title-at="left"] .o-sheet-back { margin: 0 calc(var(--vk-spacing) * 1) 0 calc(var(--vk-spacing) * -3); }
|
|
181
|
+
|
|
182
|
+
/* ── Its body scrolls only at full height; lower, a drag up raises the sheet. Its foot clears the home bar ─────────── */
|
|
183
|
+
.o-sheet-body {
|
|
184
|
+
flex: 1; min-height: 0; overflow-y: auto; outline: none; touch-action: pan-y; overscroll-behavior: contain;
|
|
185
|
+
margin-top: calc(-1 * var(--sheet-under, 0px));
|
|
186
|
+
padding: calc(var(--vk-spacing) * 2 + var(--sheet-under, 0px)) var(--sheet-padding) max(calc(var(--vk-spacing) * 8 + var(--safe-area-bottom, env(safe-area-inset-bottom, 0px))), var(--sheet-keyboard, 0px));
|
|
187
|
+
}
|
|
188
|
+
.o-sheet:is([data-sheet-form="full"], [data-sheet-form="blend"]):not([data-expanded]) .o-sheet-body { overflow-y: hidden; }
|
|
189
|
+
.o-sheet[data-sheet-form="floating"] .o-sheet-body { padding: calc(var(--vk-spacing) * 1 + var(--sheet-under, 0px)) calc(var(--sheet-padding) - var(--vk-spacing) * 2) max(calc(var(--vk-spacing) * 2), var(--sheet-home)); }
|
|
190
|
+
|
|
191
|
+
/* ── Its foot: over the body, on the sheet's ground, a line above it; it stays at the screen's foot at every stop, moved up
|
|
192
|
+
by as much as the sheet is moved down, on the same spring, and leaves with the sheet below its lowest ──────────── */
|
|
193
|
+
.o-sheet-foot {
|
|
194
|
+
flex: none; position: relative; z-index: 1; background-color: var(--vk-overlay); border-top: var(--vk-border-width) solid var(--vk-border-subtle);
|
|
195
|
+
padding: calc(var(--vk-spacing) * 3) var(--sheet-padding) calc(var(--vk-spacing) * 3 + var(--safe-area-bottom, env(safe-area-inset-bottom, 0px)));
|
|
196
|
+
transform: translateY(calc(-1 * var(--sheet-lift, 0px)));
|
|
197
|
+
transition: transform var(--sheet-time, var(--sheet-spring-time)) var(--sheet-ease, var(--sheet-spring-ease));
|
|
198
|
+
}
|
|
199
|
+
.o-sheet[data-sheet-form="blend"] .o-sheet-foot { transform: translateY(calc(-1 * var(--sheet-cut, 0px))); }
|
|
200
|
+
.o-sheet[data-swiping] .o-sheet-foot { transition: none; }
|
|
201
|
+
.o-sheet[data-sheet-form="floating"] .o-sheet-foot { padding-bottom: max(calc(var(--vk-spacing) * 3), var(--sheet-home)); }
|
|
202
|
+
|
|
203
|
+
/* A step coming into a floating sheet, from the right, or from the left going back; the sheet resizes on its spring. */
|
|
204
|
+
@keyframes o-sheet-step { from { opacity: 0; translate: var(--step-from) 0; } }
|
|
205
|
+
.o-sheet-step { --step-from: calc(var(--vk-spacing) * 6); animation: o-sheet-step var(--vk-duration-slow) var(--vk-ease-out); }
|
|
206
|
+
.o-sheet-step[data-back] { --step-from: calc(var(--vk-spacing) * -6); }
|
|
207
|
+
/* A step takes the focus as it comes, with no ring: what it holds is what is pressed next. While it slides, the body never scrolls
|
|
208
|
+
sideways (a full Sheet's body scrolls, and a step's slide would otherwise widen it). */
|
|
209
|
+
.o-sheet-step { outline: none; }
|
|
210
|
+
.o-sheet-body:has(.o-sheet-step) { overflow-x: hidden; }
|
|
211
|
+
|
|
212
|
+
/* Less motion: a fade, no scale. */
|
|
213
|
+
@media (prefers-reduced-motion: reduce) {
|
|
214
|
+
.o-sheet { transition: transform var(--vk-duration-fast) var(--vk-ease-out), opacity var(--vk-duration-base) var(--vk-ease-out); }
|
|
215
|
+
.o-sheet:is([data-starting-style], [data-ending-style]) { opacity: 0; transform: translateY(var(--drawer-snap-point-offset, 0px)); }
|
|
216
|
+
.o-sheet[data-nested-drawer-open] { scale: 1; }
|
|
217
|
+
.o-sheet-backdrop { transition: opacity var(--vk-duration-base) var(--vk-ease-out); }
|
|
218
|
+
.o-sheet-step { animation: none; }
|
|
219
|
+
}
|
|
220
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare const SPINNER_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-brand";
|
|
3
|
+
readonly kind: "colour";
|
|
4
|
+
readonly outright: "--background-brand-bold";
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "--vk-brand-subtler";
|
|
7
|
+
readonly kind: "colour";
|
|
8
|
+
readonly outright: "--background-brand-subtler";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "--vk-duration-fast";
|
|
11
|
+
readonly kind: "motion";
|
|
12
|
+
readonly outright: "--duration-fast";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-duration-base";
|
|
15
|
+
readonly kind: "motion";
|
|
16
|
+
readonly outright: "--duration-base";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-ease-out";
|
|
19
|
+
readonly kind: "motion";
|
|
20
|
+
readonly outright: "--ease-out";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-ease-in-out";
|
|
23
|
+
readonly kind: "motion";
|
|
24
|
+
readonly outright: "--ease-in-out";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-loading-dim";
|
|
27
|
+
readonly kind: "motion";
|
|
28
|
+
readonly outright: "--loading-dim";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-progress-slide";
|
|
31
|
+
readonly kind: "motion";
|
|
32
|
+
readonly outright: "--progress-slide";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-radius-full";
|
|
35
|
+
readonly kind: "size";
|
|
36
|
+
readonly outright: "--radius-full";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-spacing";
|
|
39
|
+
readonly kind: "size";
|
|
40
|
+
readonly outright: "--spacing";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-spinner-breath";
|
|
43
|
+
readonly kind: "motion";
|
|
44
|
+
readonly outright: "--spinner-breath";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-spinner-turn";
|
|
47
|
+
readonly kind: "motion";
|
|
48
|
+
readonly outright: "--spinner-turn";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "--vk-spinner-turn-reduced";
|
|
51
|
+
readonly kind: "motion";
|
|
52
|
+
readonly outright: "--spinner-turn-reduced";
|
|
53
|
+
}];
|
|
54
|
+
/** The prefixes of the spinner's own machinery, set and read by it alone: not public. */
|
|
55
|
+
export declare const SPINNER_PRIVATE: readonly ["--o-spinner-", "--o-loading-"];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const SPINNER_TOKENS = [
|
|
2
|
+
{ name: "--vk-brand", kind: "colour", outright: "--background-brand-bold" },
|
|
3
|
+
{ name: "--vk-brand-subtler", kind: "colour", outright: "--background-brand-subtler" },
|
|
4
|
+
{ name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
|
|
5
|
+
{ name: "--vk-duration-base", kind: "motion", outright: "--duration-base" },
|
|
6
|
+
{ name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
|
|
7
|
+
{ name: "--vk-ease-in-out", kind: "motion", outright: "--ease-in-out" },
|
|
8
|
+
{ name: "--vk-loading-dim", kind: "motion", outright: "--loading-dim" },
|
|
9
|
+
{ name: "--vk-progress-slide", kind: "motion", outright: "--progress-slide" },
|
|
10
|
+
{ name: "--vk-radius-full", kind: "size", outright: "--radius-full" },
|
|
11
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
12
|
+
{ name: "--vk-spinner-breath", kind: "motion", outright: "--spinner-breath" },
|
|
13
|
+
{ name: "--vk-spinner-turn", kind: "motion", outright: "--spinner-turn" },
|
|
14
|
+
{ name: "--vk-spinner-turn-reduced", kind: "motion", outright: "--spinner-turn-reduced" },
|
|
15
|
+
];
|
|
16
|
+
export const SPINNER_PRIVATE = ["--o-spinner-", "--o-loading-"];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ViewsStatusBadgeProps } from "../../atoms/types.js";
|
|
2
|
+
import { type StatusPlace } from "./status.js";
|
|
3
|
+
type StatusSlot = ViewsStatusBadgeProps["slot"];
|
|
4
|
+
/** Where a status of a slot stands on the Status's path. */
|
|
5
|
+
export declare const statusPlaceOf: (slot: StatusSlot) => StatusPlace;
|
|
6
|
+
/** A step between, at its quarters among the steps between (`steps`, in their order). */
|
|
7
|
+
export declare function quartersOf<T>(steps: readonly T[], at: T): 1 | 2 | 3;
|
|
8
|
+
/** The StatusBadge atom: the Status at its slot's place. */
|
|
9
|
+
export declare function StatusBadgeAtom({ slot, label, place, size, className }: ViewsStatusBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from "../../internal/cx.js";
|
|
3
|
+
import { Status } from "./status.js";
|
|
4
|
+
const PLACE = { pending: "start", running: "between", primary: "between", success: "won", error: "lost", warning: "risk", muted: "archived" };
|
|
5
|
+
export const statusPlaceOf = (slot) => PLACE[slot];
|
|
6
|
+
export function quartersOf(steps, at) {
|
|
7
|
+
return Math.min(3, Math.max(1, Math.round((4 * (steps.indexOf(at) + 1)) / (steps.length + 1))));
|
|
8
|
+
}
|
|
9
|
+
export function StatusBadgeAtom({ slot, label, place, size, className }) {
|
|
10
|
+
const at = statusPlaceOf(slot), steps = place?.options.filter((o) => o.slot && statusPlaceOf(o.slot) === "between") ?? [];
|
|
11
|
+
const here = place?.options[place.index], quarters = at === "between" && here && steps.includes(here) ? quartersOf(steps, here) : 2;
|
|
12
|
+
return _jsx(Status, { place: at, quarters: quarters, size: "md", className: cx(size === "row" && "vk-status-row", className), children: label });
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const options = [
|
|
2
|
+
{ id: "mark", name: "Mark", def: "dot", values: [{ id: "quarters", name: "Today’s ring" }, { id: "none", name: "None" }, { id: "linear", name: "After Linear" }, { id: "segments", name: "Steps in the ring" }, { id: "progress", name: "A ring that grows" }, { id: "pie", name: "A pie" }, { id: "square", name: "A square" }, { id: "dot", name: "A dot" }, { id: "dots", name: "Dots in a row" }, { id: "bar", name: "A short bar" }, { id: "signal", name: "Rising bars" }, { id: "number", name: "The step’s number" }, { id: "stroke", name: "A stroke" }] },
|
|
3
|
+
{ id: "shape", name: "Shape", def: "tint", values: [{ id: "bare", name: "Bare" }, { id: "coloured", name: "Word in colour" }, { id: "tint", name: "Pale pill" }, { id: "edged", name: "Edged pill" }, { id: "quiet", name: "Quiet pill" }, { id: "solid", name: "Solid" }, { id: "lozenge", name: "Lozenge" }, { id: "tag", name: "Square tag" }, { id: "alone", name: "Mark alone" }] },
|
|
4
|
+
{ id: "colour", name: "Colour", def: "meaning", values: [{ id: "meaning", name: "By meaning" }, { id: "step", name: "Each step its own" }, { id: "deeper", name: "Deeper as it goes" }, { id: "quiet", name: "Quiet until the end" }, { id: "groups", name: "Three groups" }] },
|
|
5
|
+
{ id: "path", name: "Along the path", def: "none", values: [{ id: "none", name: "None" }, { id: "under", name: "Steps under" }, { id: "before", name: "A small path" }, { id: "words", name: "In words" }, { id: "time", name: "Time there" }] },
|
|
6
|
+
];
|
|
7
|
+
const base = { mark: "quarters", shape: "bare", colour: "meaning", path: "none" };
|
|
8
|
+
export const STATUS_LOOKS = {
|
|
9
|
+
id: "status",
|
|
10
|
+
name: "Status",
|
|
11
|
+
options,
|
|
12
|
+
looks: [
|
|
13
|
+
{ id: "today", name: "Today’s", picks: { ...base } },
|
|
14
|
+
{ id: "linear", name: "Linear", picks: { ...base, mark: "linear", colour: "quiet" } },
|
|
15
|
+
{ id: "attio", name: "Attio", picks: { ...base, mark: "dot", colour: "step" } },
|
|
16
|
+
{ id: "stripe", name: "Stripe", picks: { ...base, shape: "tint", mark: "dot" } },
|
|
17
|
+
{ id: "github", name: "GitHub", picks: { ...base, shape: "edged", mark: "dot" } },
|
|
18
|
+
{ id: "jira", name: "Jira", picks: { ...base, shape: "lozenge", mark: "none", colour: "groups" } },
|
|
19
|
+
{ id: "notion", name: "Notion", picks: { ...base, shape: "tint", mark: "dot", colour: "groups" } },
|
|
20
|
+
{ id: "monday", name: "monday.com", picks: { ...base, shape: "solid", mark: "none", colour: "step" } },
|
|
21
|
+
],
|
|
22
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { StatusPlace } from "./status.js";
|
|
2
|
+
export declare const MARKS: readonly ["quarters", "linear", "segments", "progress", "pie", "square", "dot", "dots", "bar", "signal", "number", "stroke"];
|
|
3
|
+
export type MarkId = (typeof MARKS)[number];
|
|
4
|
+
/** on: a line in the colour; off: the same, faint; fill: filled in the colour; cut: a tick, a cross or a sign cut out of the fill
|
|
5
|
+
* in the ground the status stands on; ink: a sign drawn in the colour; num: the step's number. width: the box's width, its height
|
|
6
|
+
* 16. butt: its lines end square, where its arcs keep gaps between them. spinner: the Spinner stands in it. */
|
|
7
|
+
export interface MarkDrawing {
|
|
8
|
+
width: number;
|
|
9
|
+
on?: string;
|
|
10
|
+
onWidth?: number;
|
|
11
|
+
dash?: string;
|
|
12
|
+
off?: string;
|
|
13
|
+
offWidth?: number;
|
|
14
|
+
offDash?: string;
|
|
15
|
+
fill?: string;
|
|
16
|
+
cut?: string;
|
|
17
|
+
ink?: string;
|
|
18
|
+
markWidth?: number;
|
|
19
|
+
num?: string;
|
|
20
|
+
butt?: boolean;
|
|
21
|
+
spinner?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const isDealPlace: (place: StatusPlace) => boolean;
|
|
24
|
+
export declare const stepOf: (place: StatusPlace, quarters?: 1 | 2 | 3) => number;
|
|
25
|
+
/** What a mark draws for a place. "own" is a kind's place's own mark. */
|
|
26
|
+
export declare function markOf(mark: MarkId | "own", place: StatusPlace, quarters?: 1 | 2 | 3): MarkDrawing;
|