@sanity/ui 5.0.0-alpha.2 → 5.0.0-alpha.20
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/README.md +1 -1
- package/dist/LazyRefractor-CQ22IeXB.js +19 -0
- package/dist/LazyRefractor-CQ22IeXB.js.map +1 -0
- package/dist/cli/install.js +2 -1
- package/dist/index.d.ts +825 -855
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2460 -1796
- package/dist/index.js.map +1 -1
- package/dist/polyfills.d.ts +1 -0
- package/dist/polyfills.js +5 -0
- package/dist/polyfills.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +16 -9
- package/src/cli/install.ts +2 -1
- package/src/components/avatar/Avatar.tsx +50 -0
- package/src/components/avatar/avatar.css +51 -0
- package/src/components/avatar/avatar.props.ts +57 -0
- package/src/components/avatar-counter/AvatarCounter.tsx +38 -0
- package/src/components/avatar-counter/avatar-counter.css +8 -0
- package/src/components/avatar-counter/avatarCounter.props.ts +44 -0
- package/src/components/avatar-stack/AvatarStack.tsx +60 -0
- package/src/components/avatar-stack/avatar-stack.css +16 -0
- package/src/components/avatar-stack/avatarStack.props.ts +20 -0
- package/src/components/badge/Badge.tsx +53 -0
- package/src/components/badge/badge.css +6 -0
- package/src/components/badge/badge.props.ts +31 -0
- package/src/components/box/box.css +5 -0
- package/src/components/box/box.props.ts +7 -2
- package/src/components/button/Button.tsx +7 -1
- package/src/components/button/button.css +51 -23
- package/src/components/button/button.props.ts +27 -9
- package/src/components/card/Card.tsx +1 -1
- package/src/components/card/card.props.ts +10 -5
- package/src/components/checkbox/Checkbox.tsx +15 -29
- package/src/components/checkbox/checkbox.css +19 -20
- package/src/components/checkbox/checkbox.props.ts +11 -12
- package/src/components/code/code.props.ts +10 -3
- package/src/components/container/Container.tsx +5 -1
- package/src/components/container/container.css +4 -0
- package/src/components/container/container.props.ts +6 -2
- package/src/components/dialog/Dialog.tsx +139 -0
- package/src/components/dialog/dialog.css +49 -0
- package/src/components/dialog/dialog.props.ts +45 -0
- package/src/components/eyebrow/eyebrow.props.ts +6 -2
- package/src/components/flex/flex.css +5 -0
- package/src/components/flex/flex.props.ts +6 -2
- package/src/components/grid/grid.css +5 -0
- package/src/components/grid/grid.props.ts +14 -3
- package/src/components/h-stack/HStack.tsx +8 -14
- package/src/components/h-stack/hStack.props.ts +5 -13
- package/src/components/heading/heading.props.ts +8 -2
- package/src/components/hotkeys/Hotkeys.tsx +29 -0
- package/src/components/hotkeys/hotkeys.css +3 -0
- package/src/components/hotkeys/hotkeys.props.ts +15 -0
- package/src/components/icon/Icon.tsx +22 -11
- package/src/components/icon/icon.props.ts +7 -3
- package/src/components/icon-button/iconButton.props.ts +7 -2
- package/src/components/index.css +12 -1
- package/src/components/indicator/indicator.css +1 -1
- package/src/components/indicator/indicator.props.ts +6 -2
- package/src/components/indicator-stack/indicatorStack.props.ts +3 -1
- package/src/components/inline/inline.props.ts +6 -2
- package/src/components/kbd/KBD.tsx +33 -0
- package/src/components/kbd/kbd.css +6 -0
- package/src/components/kbd/kbd.props.ts +20 -0
- package/src/components/link/link.props.ts +4 -4
- package/src/components/list/list.props.ts +27 -9
- package/src/components/popover/Popover.tsx +85 -0
- package/src/components/popover/popover.css +21 -0
- package/src/components/popover/popover.props.ts +38 -0
- package/src/components/press-area/pressArea.props.ts +3 -1
- package/src/components/radio/Radio.tsx +10 -28
- package/src/components/radio/radio.css +17 -32
- package/src/components/radio/radio.props.ts +1 -19
- package/src/components/select/Select.tsx +41 -0
- package/src/components/select/select.css +67 -0
- package/src/components/select/select.props.ts +18 -0
- package/src/components/skip-to-content/skipToContent.props.ts +9 -3
- package/src/components/spinner/Spinner.tsx +2 -1
- package/src/components/spinner/spinner.props.ts +3 -0
- package/src/components/switch/Switch.tsx +9 -21
- package/src/components/switch/switch.css +22 -23
- package/src/components/switch/switch.props.ts +7 -11
- package/src/components/tabs/Tabs.tsx +186 -0
- package/src/components/tabs/tabs.css +34 -0
- package/src/components/tabs/tabs.props.ts +66 -0
- package/src/components/text/text.props.ts +6 -2
- package/src/components/text-area/TextArea.tsx +32 -0
- package/src/components/text-area/text-area.css +56 -0
- package/src/components/text-area/textArea.props.ts +35 -0
- package/src/components/text-input/TextInput.tsx +32 -0
- package/src/components/text-input/text-input.css +55 -0
- package/src/components/text-input/textInput.props.ts +42 -0
- package/src/components/tooltip/Tooltip.tsx +59 -55
- package/src/components/tooltip/tooltip.css +21 -40
- package/src/components/tooltip/tooltip.props.ts +24 -8
- package/src/components/tooltip-group/TooltipGroup.tsx +2 -5
- package/src/components/tooltip-group/tooltipGroup.props.ts +3 -1
- package/src/components/v-stack/VStack.tsx +8 -14
- package/src/components/v-stack/vStack.props.ts +5 -13
- package/src/components/visually-hidden/visuallyHidden.props.ts +6 -2
- package/src/css/classes/dynamic/height.css +2 -0
- package/src/css/classes/generic/display.css +8 -8
- package/src/css/classes/generic/placement.css +105 -86
- package/src/css/classes/local/animation.css +4 -0
- package/src/css/classes/local/field-sizing.css +3 -0
- package/src/css/classes/local/index.css +3 -1
- package/src/css/classes/local/text-trim.css +11 -4
- package/src/css/classes/local/top-anchor.css +4 -0
- package/src/css/classes/system/shadow.css +6 -6
- package/src/css/classes/system/typography.css +0 -4
- package/src/css/global/reset.css +12 -1
- package/src/css/tokens/semantic.css +7 -6
- package/src/css/tokens/surface.css +80 -12
- package/src/hooks/useIsClient.ts +10 -0
- package/src/index.ts +17 -2
- package/src/polyfills.ts +17 -0
- package/src/props/formElement.ts +34 -0
- package/src/props/layout.ts +3 -3
- package/src/props/tone.ts +13 -2
- package/src/types/Avatar.ts +14 -0
- package/src/types/Eyebrow.ts +1 -1
- package/src/types/FormElement.ts +2 -0
- package/src/types/Heading.ts +1 -1
- package/src/types/TextAlign.ts +1 -1
- package/src/types/Tone.ts +2 -0
- package/src/utils/getProps.ts +1 -1
- package/src/utils/mergeTriggerProps.ts +66 -0
- package/src/utils/renderPortal.tsx +14 -0
- package/src/version.ts +2 -2
- package/dist/_chunks-es/LazyRefractor.js +0 -20
- package/dist/_chunks-es/LazyRefractor.js.map +0 -1
- package/src/components/label/Label.tsx +0 -34
- package/src/components/label/label.css +0 -3
- package/src/components/label/label.props.ts +0 -19
- package/src/css/classes/local/tone.css +0 -75
|
@@ -1,104 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
bottom: anchor(top);
|
|
5
|
-
left: anchor(center);
|
|
6
|
-
translate: -50% 0;
|
|
1
|
+
[class*="placement-"] {
|
|
2
|
+
inset: auto;
|
|
3
|
+
margin: 0;
|
|
7
4
|
}
|
|
8
5
|
|
|
9
6
|
@position-try --top-start {
|
|
10
|
-
|
|
11
|
-
right: auto;
|
|
7
|
+
inset: auto;
|
|
12
8
|
bottom: anchor(top);
|
|
13
9
|
left: anchor(left);
|
|
14
|
-
translate: none;
|
|
15
10
|
}
|
|
16
11
|
|
|
17
12
|
@position-try --top-end {
|
|
18
|
-
|
|
19
|
-
left: auto;
|
|
13
|
+
inset: auto;
|
|
20
14
|
bottom: anchor(top);
|
|
21
15
|
right: anchor(right);
|
|
22
|
-
translate: none;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@position-try --bottom-center {
|
|
26
|
-
bottom: auto;
|
|
27
|
-
right: auto;
|
|
28
|
-
top: anchor(bottom);
|
|
29
|
-
left: anchor(center);
|
|
30
|
-
translate: -50% 0;
|
|
31
16
|
}
|
|
32
17
|
|
|
33
18
|
@position-try --bottom-start {
|
|
34
|
-
|
|
35
|
-
right: auto;
|
|
19
|
+
inset: auto;
|
|
36
20
|
top: anchor(bottom);
|
|
37
21
|
left: anchor(left);
|
|
38
|
-
translate: none;
|
|
39
22
|
}
|
|
40
23
|
|
|
41
24
|
@position-try --bottom-end {
|
|
42
|
-
|
|
43
|
-
left: auto;
|
|
25
|
+
inset: auto;
|
|
44
26
|
top: anchor(bottom);
|
|
45
27
|
right: anchor(right);
|
|
46
|
-
translate: none;
|
|
47
28
|
}
|
|
48
29
|
|
|
49
|
-
@position-try --
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
30
|
+
@position-try --left-start {
|
|
31
|
+
inset: auto;
|
|
32
|
+
top: anchor(top);
|
|
33
|
+
right: anchor(left);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@position-try --left-end {
|
|
37
|
+
inset: auto;
|
|
38
|
+
bottom: anchor(bottom);
|
|
39
|
+
right: anchor(left);
|
|
55
40
|
}
|
|
56
41
|
|
|
57
42
|
@position-try --right-start {
|
|
58
|
-
|
|
59
|
-
bottom: auto;
|
|
60
|
-
left: anchor(right);
|
|
43
|
+
inset: auto;
|
|
61
44
|
top: anchor(top);
|
|
62
|
-
|
|
45
|
+
left: anchor(right);
|
|
63
46
|
}
|
|
64
47
|
|
|
65
48
|
@position-try --right-end {
|
|
66
|
-
|
|
67
|
-
top: auto;
|
|
68
|
-
left: anchor(right);
|
|
49
|
+
inset: auto;
|
|
69
50
|
bottom: anchor(bottom);
|
|
70
|
-
|
|
51
|
+
left: anchor(right);
|
|
71
52
|
}
|
|
72
53
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
translate: 0 -50%;
|
|
54
|
+
.sui-placement-top {
|
|
55
|
+
bottom: anchor(top);
|
|
56
|
+
left: anchor(center);
|
|
57
|
+
translate: -50% 0;
|
|
58
|
+
position-try-fallbacks: flip-block;
|
|
79
59
|
}
|
|
80
60
|
|
|
81
|
-
@
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
61
|
+
@supports (justify-self: anchor-center) {
|
|
62
|
+
.sui-placement-top {
|
|
63
|
+
left: auto;
|
|
64
|
+
translate: none;
|
|
65
|
+
justify-self: anchor-center;
|
|
66
|
+
margin-inline: var(--space-2);
|
|
67
|
+
}
|
|
87
68
|
}
|
|
88
69
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
70
|
+
.sui-placement-top-start {
|
|
71
|
+
bottom: anchor(top);
|
|
72
|
+
left: anchor(left);
|
|
73
|
+
position-try-fallbacks: --bottom-start;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.sui-placement-top-end {
|
|
77
|
+
bottom: anchor(top);
|
|
78
|
+
right: anchor(right);
|
|
79
|
+
position-try-fallbacks: --bottom-end;
|
|
95
80
|
}
|
|
96
81
|
|
|
97
82
|
.sui-placement-bottom {
|
|
98
83
|
top: anchor(bottom);
|
|
99
84
|
left: anchor(center);
|
|
100
85
|
translate: -50% 0;
|
|
101
|
-
position-try-fallbacks:
|
|
86
|
+
position-try-fallbacks: flip-block;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@supports (justify-self: anchor-center) {
|
|
90
|
+
.sui-placement-bottom {
|
|
91
|
+
left: auto;
|
|
92
|
+
translate: none;
|
|
93
|
+
justify-self: anchor-center;
|
|
94
|
+
margin-inline: var(--space-2);
|
|
95
|
+
}
|
|
102
96
|
}
|
|
103
97
|
|
|
104
98
|
.sui-placement-bottom-start {
|
|
@@ -113,59 +107,84 @@
|
|
|
113
107
|
position-try-fallbacks: --top-end;
|
|
114
108
|
}
|
|
115
109
|
|
|
116
|
-
.sui-placement-top {
|
|
117
|
-
bottom: anchor(top);
|
|
118
|
-
left: anchor(center);
|
|
119
|
-
translate: -50% 0;
|
|
120
|
-
position-try-fallbacks: --bottom-center;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.sui-placement-top-start {
|
|
124
|
-
bottom: anchor(top);
|
|
125
|
-
left: anchor(left);
|
|
126
|
-
position-try-fallbacks: --bottom-start;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.sui-placement-top-end {
|
|
130
|
-
bottom: anchor(top);
|
|
131
|
-
right: anchor(right);
|
|
132
|
-
position-try-fallbacks: --bottom-end;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
110
|
.sui-placement-left {
|
|
136
|
-
right: anchor(left);
|
|
137
111
|
top: anchor(center);
|
|
112
|
+
right: anchor(left);
|
|
138
113
|
translate: 0 -50%;
|
|
139
|
-
position-try-fallbacks:
|
|
114
|
+
position-try-fallbacks: flip-inline;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@supports (align-self: anchor-center) {
|
|
118
|
+
.sui-placement-left {
|
|
119
|
+
top: auto;
|
|
120
|
+
translate: none;
|
|
121
|
+
align-self: anchor-center;
|
|
122
|
+
margin-block: var(--space-2);
|
|
123
|
+
}
|
|
140
124
|
}
|
|
141
125
|
|
|
142
126
|
.sui-placement-left-start {
|
|
143
|
-
right: anchor(left);
|
|
144
127
|
top: anchor(top);
|
|
128
|
+
right: anchor(left);
|
|
145
129
|
position-try-fallbacks: --right-start;
|
|
146
130
|
}
|
|
147
131
|
|
|
148
132
|
.sui-placement-left-end {
|
|
149
|
-
right: anchor(left);
|
|
150
133
|
bottom: anchor(bottom);
|
|
134
|
+
right: anchor(left);
|
|
151
135
|
position-try-fallbacks: --right-end;
|
|
152
136
|
}
|
|
153
137
|
|
|
154
138
|
.sui-placement-right {
|
|
155
|
-
left: anchor(right);
|
|
156
139
|
top: anchor(center);
|
|
140
|
+
left: anchor(right);
|
|
157
141
|
translate: 0 -50%;
|
|
158
|
-
position-try-fallbacks:
|
|
142
|
+
position-try-fallbacks: flip-inline;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@supports (align-self: anchor-center) {
|
|
146
|
+
.sui-placement-right {
|
|
147
|
+
top: auto;
|
|
148
|
+
translate: none;
|
|
149
|
+
align-self: anchor-center;
|
|
150
|
+
margin-block: var(--space-2);
|
|
151
|
+
}
|
|
159
152
|
}
|
|
160
153
|
|
|
161
154
|
.sui-placement-right-start {
|
|
162
|
-
left: anchor(right);
|
|
163
155
|
top: anchor(top);
|
|
156
|
+
left: anchor(right);
|
|
164
157
|
position-try-fallbacks: --left-start;
|
|
165
158
|
}
|
|
166
159
|
|
|
167
160
|
.sui-placement-right-end {
|
|
168
|
-
left: anchor(right);
|
|
169
161
|
bottom: anchor(bottom);
|
|
162
|
+
left: anchor(right);
|
|
170
163
|
position-try-fallbacks: --left-end;
|
|
171
164
|
}
|
|
165
|
+
|
|
166
|
+
[class*="placement-bottom"],
|
|
167
|
+
[class*="placement-top"] {
|
|
168
|
+
margin-block: var(--space-1);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
[class*="placement-left"],
|
|
172
|
+
[class*="placement-right"] {
|
|
173
|
+
margin-inline: var(--space-1);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
[class*="placement-top"] {
|
|
177
|
+
transform-origin: center bottom;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
[class*="placement-bottom"] {
|
|
181
|
+
transform-origin: center top;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
[class*="placement-left"] {
|
|
185
|
+
transform-origin: right center;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
[class*="placement-right"] {
|
|
189
|
+
transform-origin: left center;
|
|
190
|
+
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
.sui-text-trim-edge {
|
|
2
|
+
text-box: trim-both cap alphabetic;
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
.sui-text-trim:before,
|
|
2
6
|
.sui-text-trim:after {
|
|
3
7
|
content: '';
|
|
@@ -32,14 +36,17 @@
|
|
|
32
36
|
.sui-text-heading3 { --trim: -7px; }
|
|
33
37
|
.sui-text-heading4 { --trim: -8px; }
|
|
34
38
|
.sui-text-heading5 { --trim: -10px; }
|
|
35
|
-
.sui-text-heading6 { --trim: -13px; }
|
|
36
|
-
.sui-text-heading7 { --trim: -16px; }
|
|
37
|
-
.sui-text-heading8 { --trim: -22px; }
|
|
38
|
-
.sui-text-heading9 { --trim: -30px; }
|
|
39
39
|
|
|
40
40
|
.sui-text-code0 { --trim: -4px; }
|
|
41
41
|
.sui-text-code1 { --trim: -5px; }
|
|
42
42
|
.sui-text-code2 { --trim: -6px; }
|
|
43
43
|
.sui-text-code3 { --trim: -7px; }
|
|
44
44
|
.sui-text-code4 { --trim: -8px; }
|
|
45
|
+
|
|
46
|
+
.sui-text-eyebrow0 { --trim: -2px; }
|
|
47
|
+
.sui-text-eyebrow1 { --trim: -2.5px; }
|
|
48
|
+
.sui-text-eyebrow2 { --trim: -3px; }
|
|
49
|
+
.sui-text-eyebrow3 { --trim: -3.5px; }
|
|
50
|
+
.sui-text-eyebrow4 { --trim: -4px; }
|
|
51
|
+
.sui-text-eyebrow5 { --trim: -4.5px; }
|
|
45
52
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
.sui-shadow0 { box-shadow: var(--
|
|
2
|
-
.sui-shadow1 { box-shadow: var(--
|
|
3
|
-
.sui-shadow2 { box-shadow: var(--
|
|
4
|
-
.sui-shadow3 { box-shadow: var(--
|
|
5
|
-
.sui-shadow4 { box-shadow: var(--
|
|
6
|
-
.sui-shadow5 { box-shadow: var(--
|
|
1
|
+
.sui-shadow0 { box-shadow: var(--shadow-0); }
|
|
2
|
+
.sui-shadow1 { box-shadow: var(--shadow-1); }
|
|
3
|
+
.sui-shadow2 { box-shadow: var(--shadow-2); }
|
|
4
|
+
.sui-shadow3 { box-shadow: var(--shadow-3); }
|
|
5
|
+
.sui-shadow4 { box-shadow: var(--shadow-4); }
|
|
6
|
+
.sui-shadow5 { box-shadow: var(--shadow-5); }
|
|
@@ -17,10 +17,6 @@
|
|
|
17
17
|
.sui-text-heading3 { font: var(--heading-3); }
|
|
18
18
|
.sui-text-heading4 { font: var(--heading-4); }
|
|
19
19
|
.sui-text-heading5 { font: var(--heading-5); }
|
|
20
|
-
.sui-text-heading6 { font: var(--heading-6); }
|
|
21
|
-
.sui-text-heading7 { font: var(--heading-7); }
|
|
22
|
-
.sui-text-heading8 { font: var(--heading-8); }
|
|
23
|
-
.sui-text-heading9 { font: var(--heading-9); }
|
|
24
20
|
|
|
25
21
|
.sui-text-eyebrow0 { font: var(--label-0); }
|
|
26
22
|
.sui-text-eyebrow1 { font: var(--label-1); }
|
package/src/css/global/reset.css
CHANGED
|
@@ -52,9 +52,20 @@
|
|
|
52
52
|
select,
|
|
53
53
|
textarea
|
|
54
54
|
) {
|
|
55
|
+
appearance: none;
|
|
56
|
+
color: inherit;
|
|
55
57
|
font: inherit;
|
|
56
58
|
line-height: inherit;
|
|
57
|
-
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Remove user agent reduced opacity on disabled form elements */
|
|
62
|
+
:where(
|
|
63
|
+
button,
|
|
64
|
+
input,
|
|
65
|
+
select,
|
|
66
|
+
textarea
|
|
67
|
+
):disabled {
|
|
68
|
+
opacity: 1;
|
|
58
69
|
}
|
|
59
70
|
|
|
60
71
|
/* Remove excess space for table borders */
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--
|
|
3
|
-
--brand-background: #eb5228;
|
|
4
|
-
--brand-foreground: var(--black);
|
|
5
|
-
--placeholder-opacity: var(--opacity-mid);
|
|
2
|
+
--placeholder-opacity: 0.64;
|
|
6
3
|
--overlay-opacity: var(--opacity-mid);
|
|
7
4
|
/* State */
|
|
8
5
|
--active-background-normal: light-dark(var(--blue-50), var(--blue-950));
|
|
@@ -15,7 +12,11 @@
|
|
|
15
12
|
--focus-outline: 2px solid var(--blue-500);
|
|
16
13
|
--focus-offset: 2px;
|
|
17
14
|
--hover-lightness-delta: 0.125;
|
|
18
|
-
--hover-transition: border-color 100ms linear, background-color 100ms linear;
|
|
19
|
-
--inert-background: light-dark(var(--gray-50), var(--gray-
|
|
15
|
+
--hover-transition: border-color 100ms linear, background-color 100ms linear, transform 100ms linear;
|
|
16
|
+
--inert-background: light-dark(var(--gray-50), var(--gray-800));
|
|
20
17
|
--inert-foreground: light-dark(var(--gray-400), var(--gray-600));
|
|
18
|
+
--fade-in-transition:
|
|
19
|
+
opacity 200ms cubic-bezier(0.34, 1.2, 0.64, 1),
|
|
20
|
+
scale 200ms cubic-bezier(0.34, 1.2, 0.64, 1), visibility 0s linear,
|
|
21
|
+
display 200ms linear allow-discrete;
|
|
21
22
|
}
|
|
@@ -1,27 +1,95 @@
|
|
|
1
|
+
/* Untoned surface */
|
|
1
2
|
:root {
|
|
2
|
-
|
|
3
|
+
--backdrop: light-dark(var(--white), var(--black));
|
|
3
4
|
--background-high: light-dark(var(--gray-100), var(--gray-900));
|
|
4
5
|
--background-high-emphasized: light-dark(var(--gray-800), var(--gray-200));
|
|
5
6
|
--background-low: light-dark(var(--gray-50), var(--gray-950));
|
|
6
7
|
--background-low-emphasized: light-dark(var(--gray-600), var(--gray-400));
|
|
8
|
+
--brand-background: #eb5228;
|
|
9
|
+
--brand-foreground: var(--black);
|
|
7
10
|
--separator-high: light-dark(var(--gray-400), var(--gray-600));
|
|
8
11
|
--separator-low: rgb(from var(--separator-high) r g b / var(--opacity-low));
|
|
9
12
|
--foreground-high: light-dark(var(--gray-800), var(--gray-200));
|
|
13
|
+
/* This property stable across all tones */
|
|
10
14
|
--foreground-high-emphasized: light-dark(var(--white), var(--black));
|
|
11
15
|
--foreground-low: light-dark(var(--gray-600), var(--gray-400));
|
|
12
16
|
--foreground-low-emphasized: light-dark(var(--gray-100), var(--gray-900));
|
|
17
|
+
/* Used to create equivalent text + block size for form elements vs UI v3/4. Can drop once migration is complete. */
|
|
18
|
+
--form-element-text: var(--regular) 13px / 1.15 var(--sans);
|
|
19
|
+
/* Used to increase hit sizes across smaller inputs. */
|
|
20
|
+
--form-element-inset: -4.5px;
|
|
13
21
|
}
|
|
14
22
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
--background-high: var(--
|
|
18
|
-
--background-high-emphasized: var(--
|
|
19
|
-
--background-low: var(--
|
|
20
|
-
--background-low-emphasized: var(--
|
|
21
|
-
--separator-high: var(--
|
|
23
|
+
/* Default tone mirrors untoned surface except for backgrounds */
|
|
24
|
+
.sui-tone-default {
|
|
25
|
+
--background-high: var(--backdrop);
|
|
26
|
+
--background-high-emphasized: var(--backdrop);
|
|
27
|
+
--background-low: var(--backdrop);
|
|
28
|
+
--background-low-emphasized: var(--backdrop);
|
|
29
|
+
--separator-high: light-dark(var(--gray-400), var(--gray-600));
|
|
30
|
+
--separator-low: rgb(from var(--separator-high) r g b / var(--opacity-low));
|
|
31
|
+
--foreground-high: light-dark(var(--gray-800), var(--gray-200));
|
|
32
|
+
--foreground-low: light-dark(var(--gray-600), var(--gray-400));
|
|
33
|
+
--foreground-low-emphasized: light-dark(var(--gray-100), var(--gray-900));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Toned surfaces */
|
|
37
|
+
.sui-tone-neutral {
|
|
38
|
+
--background-high: light-dark(var(--gray-100), var(--gray-900));
|
|
39
|
+
--background-high-emphasized: light-dark(var(--gray-800), var(--gray-200));
|
|
40
|
+
--background-low: light-dark(var(--gray-50), var(--gray-950));
|
|
41
|
+
--background-low-emphasized: light-dark(var(--gray-600), var(--gray-400));
|
|
42
|
+
--separator-high: light-dark(var(--gray-400), var(--gray-600));
|
|
43
|
+
--separator-low: rgb(from var(--separator-high) r g b / var(--opacity-low));
|
|
44
|
+
--foreground-high: light-dark(var(--gray-800), var(--gray-200));
|
|
45
|
+
--foreground-low: light-dark(var(--gray-600), var(--gray-400));
|
|
46
|
+
--foreground-low-emphasized: light-dark(var(--gray-100), var(--gray-900));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.sui-tone-suggest {
|
|
50
|
+
--background-high: light-dark(var(--purple-100), var(--purple-900));
|
|
51
|
+
--background-high-emphasized: light-dark(var(--purple-800), var(--purple-200));
|
|
52
|
+
--background-low: light-dark(var(--purple-50), var(--purple-950));
|
|
53
|
+
--background-low-emphasized: light-dark(var(--purple-600), var(--purple-400));
|
|
54
|
+
--separator-high: light-dark(var(--purple-400), var(--purple-600));
|
|
55
|
+
--separator-low: rgb(from var(--separator-high) r g b / var(--opacity-low));
|
|
56
|
+
--foreground-high: light-dark(var(--purple-800), var(--purple-200));
|
|
57
|
+
--foreground-low: light-dark(var(--purple-600), var(--purple-400));
|
|
58
|
+
--foreground-low-emphasized: light-dark(var(--purple-100), var(--purple-900));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.sui-tone-positive {
|
|
62
|
+
--background-high: light-dark(var(--green-100), var(--green-900));
|
|
63
|
+
--background-high-emphasized: light-dark(var(--green-800), var(--green-200));
|
|
64
|
+
--background-low: light-dark(var(--green-50), var(--green-950));
|
|
65
|
+
--background-low-emphasized: light-dark(var(--green-600), var(--green-400));
|
|
66
|
+
--separator-high: light-dark(var(--green-400), var(--green-600));
|
|
67
|
+
--separator-low: rgb(from var(--separator-high) r g b / var(--opacity-low));
|
|
68
|
+
--foreground-high: light-dark(var(--green-800), var(--green-200));
|
|
69
|
+
--foreground-low: light-dark(var(--green-600), var(--green-400));
|
|
70
|
+
--foreground-low-emphasized: light-dark(var(--green-100), var(--green-900));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.sui-tone-caution {
|
|
74
|
+
--background-high: light-dark(var(--yellow-100), var(--yellow-900));
|
|
75
|
+
--background-high-emphasized: light-dark(var(--yellow-800), var(--yellow-200));
|
|
76
|
+
--background-low: light-dark(var(--yellow-50), var(--yellow-950));
|
|
77
|
+
--background-low-emphasized: light-dark(var(--yellow-600), var(--yellow-400));
|
|
78
|
+
--separator-high: light-dark(var(--yellow-400), var(--yellow-600));
|
|
79
|
+
--separator-low: rgb(from var(--separator-high) r g b / var(--opacity-low));
|
|
80
|
+
--foreground-high: light-dark(var(--yellow-800), var(--yellow-200));
|
|
81
|
+
--foreground-low: light-dark(var(--yellow-600), var(--yellow-400));
|
|
82
|
+
--foreground-low-emphasized: light-dark(var(--yellow-100), var(--yellow-900));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.sui-tone-critical {
|
|
86
|
+
--background-high: light-dark(var(--red-100), var(--red-900));
|
|
87
|
+
--background-high-emphasized: light-dark(var(--red-800), var(--red-200));
|
|
88
|
+
--background-low: light-dark(var(--red-50), var(--red-950));
|
|
89
|
+
--background-low-emphasized: light-dark(var(--red-600), var(--red-400));
|
|
90
|
+
--separator-high: light-dark(var(--red-400), var(--red-600));
|
|
22
91
|
--separator-low: rgb(from var(--separator-high) r g b / var(--opacity-low));
|
|
23
|
-
--foreground-high: var(--
|
|
24
|
-
--foreground-
|
|
25
|
-
--foreground-low: var(--
|
|
26
|
-
--foreground-low-emphasized: var(--tone-100);
|
|
92
|
+
--foreground-high: light-dark(var(--red-800), var(--red-200));
|
|
93
|
+
--foreground-low: light-dark(var(--red-600), var(--red-400));
|
|
94
|
+
--foreground-low-emphasized: light-dark(var(--red-100), var(--red-900));
|
|
27
95
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,34 +1,49 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
export * from './components/avatar/Avatar'
|
|
4
|
+
export * from './components/avatar-counter/AvatarCounter'
|
|
5
|
+
export * from './components/avatar-stack/AvatarStack'
|
|
6
|
+
export * from './components/badge/Badge'
|
|
1
7
|
export * from './components/box/Box'
|
|
2
8
|
export * from './components/button/Button'
|
|
3
9
|
export * from './components/card/Card'
|
|
4
10
|
export * from './components/checkbox/Checkbox'
|
|
5
11
|
export * from './components/code/Code'
|
|
6
12
|
export * from './components/container/Container'
|
|
13
|
+
export * from './components/dialog/Dialog'
|
|
7
14
|
export * from './components/divider/Divider'
|
|
8
15
|
export * from './components/eyebrow/Eyebrow'
|
|
9
16
|
export * from './components/flex/Flex'
|
|
10
17
|
export * from './components/grid/Grid'
|
|
11
18
|
export * from './components/h-stack/HStack'
|
|
12
19
|
export * from './components/heading/Heading'
|
|
20
|
+
export * from './components/hotkeys/Hotkeys'
|
|
13
21
|
export * from './components/icon/Icon'
|
|
14
22
|
export * from './components/icon-button/IconButton'
|
|
15
23
|
export * from './components/indicator/Indicator'
|
|
16
24
|
export * from './components/indicator-stack/IndicatorStack'
|
|
17
25
|
export * from './components/inline/Inline'
|
|
18
|
-
export * from './components/
|
|
26
|
+
export * from './components/kbd/KBD'
|
|
19
27
|
export * from './components/link/Link'
|
|
20
28
|
export * from './components/list/List'
|
|
29
|
+
export * from './components/popover/Popover'
|
|
21
30
|
export * from './components/press-area/PressArea'
|
|
22
31
|
export * from './components/radio/Radio'
|
|
32
|
+
export * from './components/select/Select'
|
|
23
33
|
export * from './components/skip-to-content/SkipToContent'
|
|
24
34
|
export * from './components/spinner/Spinner'
|
|
25
35
|
export * from './components/switch/Switch'
|
|
36
|
+
export * from './components/tabs/Tabs'
|
|
26
37
|
export * from './components/text/Text'
|
|
38
|
+
export * from './components/text-area/TextArea'
|
|
39
|
+
export * from './components/text-input/TextInput'
|
|
27
40
|
export * from './components/tooltip/Tooltip'
|
|
28
41
|
export * from './components/tooltip-group/TooltipGroup'
|
|
29
42
|
export * from './components/v-stack/VStack'
|
|
30
43
|
export * from './components/visually-hidden/VisuallyHidden'
|
|
31
44
|
|
|
45
|
+
export * from './hooks/useIsClient'
|
|
46
|
+
|
|
32
47
|
export type {FlexParentProps} from './props/flexParent'
|
|
33
48
|
export type {GapProps} from './props/gap'
|
|
34
49
|
export type {GridParentProps} from './props/gridParent'
|
|
@@ -44,6 +59,7 @@ export type {Density} from './types/Density'
|
|
|
44
59
|
export type {DisplayBlock, DisplayFlex, DisplayGrid} from './types/Display'
|
|
45
60
|
export type {EyebrowSize} from './types/Eyebrow'
|
|
46
61
|
export type {AlignItems, FlexDirection, FlexWrap, JustifyContent} from './types/Flex'
|
|
62
|
+
export type {FontWeight} from './types/FontWeight'
|
|
47
63
|
export type {GridAutoFlow} from './types/Grid'
|
|
48
64
|
export type {HeadingSize} from './types/Heading'
|
|
49
65
|
export type {IconSize} from './types/Icon'
|
|
@@ -56,5 +72,4 @@ export type {Shadow} from './types/Shadow'
|
|
|
56
72
|
export type {Space, SpaceAuto, SpaceAutoNegative, SpaceInherit} from './types/Space'
|
|
57
73
|
export type {TextSize} from './types/Text'
|
|
58
74
|
export type {TextAlign} from './types/TextAlign'
|
|
59
|
-
export type {FontWeight} from './types/FontWeight'
|
|
60
75
|
export type {Tone} from './types/Tone'
|
package/src/polyfills.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
apply as applyClosedByPolyfill,
|
|
5
|
+
isSupported as isClosedBySupported,
|
|
6
|
+
} from 'dialog-closedby-polyfill'
|
|
7
|
+
|
|
8
|
+
if (
|
|
9
|
+
typeof HTMLButtonElement !== 'undefined' &&
|
|
10
|
+
!('interestForElement' in HTMLButtonElement.prototype)
|
|
11
|
+
) {
|
|
12
|
+
void import('interestfor')
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (typeof HTMLDialogElement !== 'undefined' && !isClosedBySupported()) {
|
|
16
|
+
applyClosedByPolyfill()
|
|
17
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {FORM_ELEMENT_DENSITY, type FormElementDensity} from '../types/FormElement'
|
|
2
|
+
import type {PropDef} from '../types/PropDef'
|
|
3
|
+
import {paddingProps} from './padding'
|
|
4
|
+
|
|
5
|
+
/** @public */
|
|
6
|
+
export type FormElementDensityProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Sets padding, gap, and other spacing values on the form element.
|
|
9
|
+
*/
|
|
10
|
+
density?: FormElementDensity
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const formElementDensityProps: Record<string, PropDef> = {
|
|
14
|
+
density: {
|
|
15
|
+
type: 'composite',
|
|
16
|
+
values: FORM_ELEMENT_DENSITY,
|
|
17
|
+
composition: {
|
|
18
|
+
paddingX: {
|
|
19
|
+
propDef: paddingProps['paddingX'] as PropDef,
|
|
20
|
+
mapping: {
|
|
21
|
+
regular: 2,
|
|
22
|
+
loose: 3,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
paddingY: {
|
|
26
|
+
propDef: paddingProps['paddingY'] as PropDef,
|
|
27
|
+
mapping: {
|
|
28
|
+
regular: 1,
|
|
29
|
+
loose: 2,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
}
|
package/src/props/layout.ts
CHANGED
|
@@ -8,14 +8,14 @@ import {type OverflowProps, overflowProps} from './overflow'
|
|
|
8
8
|
import {type PaddingProps, paddingProps} from './padding'
|
|
9
9
|
import {type PositionProps, positionProps} from './position'
|
|
10
10
|
import {type ShadowProps, shadowProps} from './shadow'
|
|
11
|
-
import {type
|
|
11
|
+
import {toneWithDefaultProps, type ToneWithDefaultProps} from './tone'
|
|
12
12
|
import {type WidthProps, widthProps} from './width'
|
|
13
13
|
import {type ZIndexProps, zIndexProps} from './zIndex'
|
|
14
14
|
|
|
15
15
|
/** @public */
|
|
16
16
|
export interface LayoutProps
|
|
17
17
|
extends
|
|
18
|
-
|
|
18
|
+
ToneWithDefaultProps,
|
|
19
19
|
WidthProps,
|
|
20
20
|
HeightProps,
|
|
21
21
|
MarginProps,
|
|
@@ -29,7 +29,7 @@ export interface LayoutProps
|
|
|
29
29
|
ShadowProps {}
|
|
30
30
|
|
|
31
31
|
export const layoutProps: Record<string, PropDef> = {
|
|
32
|
-
...
|
|
32
|
+
...toneWithDefaultProps,
|
|
33
33
|
...widthProps,
|
|
34
34
|
...heightProps,
|
|
35
35
|
...marginProps,
|