@sanity/ui 3.0.0-static.19 → 3.0.0-static.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/dist/_chunks-cjs/_visual-editing.cjs +109 -112
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
- package/dist/_chunks-cjs/buildCommand.cjs +30 -24
- package/dist/_chunks-cjs/buildCommand.cjs.map +1 -1
- package/dist/_chunks-es/_visual-editing.js +110 -113
- package/dist/_chunks-es/_visual-editing.js.map +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/css.cjs +379 -358
- package/dist/css.cjs.map +1 -1
- package/dist/css.d.cts +45 -10
- package/dist/css.d.ts +45 -10
- package/dist/css.js +379 -358
- package/dist/css.js.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/theme.cjs +89 -64
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.d.cts +28 -2
- package/dist/theme.d.ts +28 -2
- package/dist/theme.js +89 -64
- package/dist/theme.js.map +1 -1
- package/dist/ui-system.css +1236 -801
- package/dist/ui-system.min.css +1 -1
- package/dist/ui-theme.css +413 -82
- package/dist/ui-theme.min.css +1 -1
- package/dist/ui.css +1649 -883
- package/dist/ui.min.css +1 -1
- package/exports/_visual-editing.ts +0 -1
- package/package.json +6 -6
- package/src/cli/buildCommand.ts +48 -41
- package/src/core/components/autocomplete/__workshop__/async.tsx +1 -1
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +1 -1
- package/src/core/components/autocomplete/__workshop__/custom.tsx +12 -11
- package/src/core/components/autocomplete/__workshop__/example.tsx +13 -12
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +53 -54
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +1 -2
- package/src/core/components/dialog/__workshop__/autoFocus.tsx +2 -2
- package/src/core/components/dialog/__workshop__/onScroll.tsx +16 -4
- package/src/core/components/dialog/__workshop__/position.tsx +3 -3
- package/src/core/components/dialog/__workshop__/props.tsx +6 -6
- package/src/core/components/menu/__workshop__/menuButton.tsx +3 -3
- package/src/core/components/menu/__workshop__/tones.tsx +3 -3
- package/src/core/components/skeleton/__workshop__/delay.tsx +2 -2
- package/src/core/components/skeleton/__workshop__/skeleton.tsx +2 -2
- package/src/core/components/tab/__workshop__/example.tsx +1 -1
- package/src/core/components/toast/__workshop__/toast.tsx +5 -5
- package/src/core/primitives/avatar/__workshop__/asButton.tsx +2 -2
- package/src/core/primitives/avatar/__workshop__/stack.tsx +2 -2
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +1 -1
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -1
- package/src/core/primitives/badge/__workshop__/props.tsx +5 -8
- package/src/core/primitives/box/__workshop__/props.tsx +2 -2
- package/src/core/primitives/box/box.tsx +2 -0
- package/src/core/primitives/button/__workshop__/props.tsx +17 -19
- package/src/core/primitives/button/__workshop__/stacked.tsx +12 -12
- package/src/core/primitives/card/__workshop__/asButton.tsx +1 -1
- package/src/core/primitives/card/__workshop__/interactive.tsx +2 -2
- package/src/core/primitives/card/__workshop__/props.tsx +11 -11
- package/src/core/primitives/card/__workshop__/selected.tsx +2 -2
- package/src/core/primitives/checkbox/__workshop__/props.tsx +5 -5
- package/src/core/primitives/code/__workshop__/props.tsx +4 -7
- package/src/core/primitives/code/code.tsx +1 -1
- package/src/core/primitives/container/__workshop__/example.tsx +2 -2
- package/src/core/primitives/flex/__workshop__/example.tsx +2 -2
- package/src/core/primitives/heading/__workshop__/plain.tsx +11 -7
- package/src/core/primitives/heading/heading.tsx +1 -1
- package/src/core/primitives/inline/__workshop__/plain.tsx +2 -5
- package/src/core/primitives/label/__workshop__/plain.tsx +7 -8
- package/src/core/primitives/label/label.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +6 -6
- package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +3 -3
- package/src/core/primitives/popover/__workshop__/PlainStory.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +1 -1
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +3 -1
- package/src/core/primitives/radio/__workshop__/example.tsx +2 -2
- package/src/core/primitives/radio/__workshop__/plain.tsx +3 -3
- package/src/core/primitives/select/__workshop__/plain.tsx +5 -8
- package/src/core/primitives/spinner/__workshop__/Props.tsx +3 -3
- package/src/core/primitives/stack/__workshop__/plain.tsx +2 -2
- package/src/core/primitives/text/__workshop__/colored.tsx +2 -2
- package/src/core/primitives/text/__workshop__/example.tsx +8 -11
- package/src/core/primitives/textArea/__workshop__/plain.tsx +11 -12
- package/src/core/primitives/textArea/textArea.tsx +10 -7
- package/src/core/primitives/textInput/__workshop__/customValidity.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/plain.tsx +30 -18
- package/src/core/primitives/textInput/__workshop__/states.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/typed.tsx +2 -2
- package/src/core/primitives/textInput/textInput.tsx +11 -20
- package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +3 -3
- package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +1 -1
- package/src/core/primitives/tooltip/__workshop__/props.tsx +4 -4
- package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -1
- package/src/core/primitives/tooltip/tooltipLayer.tsx +1 -3
- package/src/css/_system.style.ts +2 -0
- package/src/css/aspects/font/font.style.ts +9 -8
- package/src/css/aspects/index.ts +1 -0
- package/src/css/aspects/margin/margin.style.ts +13 -0
- package/src/css/aspects/margin/types.ts +12 -7
- package/src/css/aspects/minHeight/index.ts +2 -0
- package/src/css/aspects/minHeight/minHeight.style.ts +9 -0
- package/src/css/aspects/minHeight/minHeight.ts +8 -0
- package/src/css/aspects/minHeight/types.ts +9 -0
- package/src/css/components/skeleton/skeleton.style.ts +7 -10
- package/src/css/primitives/_input/_input.style.ts +30 -51
- package/src/css/primitives/_selectable/_selectable.style.ts +2 -3
- package/src/css/primitives/box/box.style.ts +0 -3
- package/src/css/primitives/box/box.ts +2 -0
- package/src/css/primitives/box/types.ts +2 -0
- package/src/css/primitives/card/card.style.ts +3 -0
- package/src/css/primitives/code/code.style.ts +1 -0
- package/src/css/primitives/heading/heading.style.ts +1 -0
- package/src/css/primitives/label/label.style.ts +1 -0
- package/src/css/primitives/text/text.style.ts +1 -0
- package/src/css/primitives/textArea/textArea.style.ts +1 -3
- package/src/css/primitives/textInput/textInput.style.ts +10 -18
- package/src/css/primitives/textInput/textInput.ts +15 -0
- package/src/css/primitives/tooltip/tooltip.style.ts +0 -13
- package/src/css/primitives/tooltip/tooltip.ts +0 -5
- package/src/css/theme/resolveTheme.ts +29 -18
- package/src/theme/v0/font.ts +0 -1
- package/src/theme/v2/defaults/fonts.ts +0 -1
- package/src/theme/v3/_parseColorToken.ts +0 -5
- package/src/theme/v3/buildTheme_v3.ts +2 -2
- package/src/theme/v3/defaultFonts.ts +250 -0
- package/src/theme/v3/defaultTokens.ts +39 -35
- package/src/theme/v3/types.ts +35 -2
- package/src/theme/versioning/v3_v2.ts +1 -0
- package/src/css/primitives/_input/__workshop__/customInput.tsx +0 -16
- package/src/css/primitives/_input/__workshop__/index.ts +0 -14
- /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/apiStore.ts +0 -0
- /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/countries.ts +0 -0
|
@@ -9,14 +9,6 @@ const primitive: StyleRules = {
|
|
|
9
9
|
position: 'relative',
|
|
10
10
|
},
|
|
11
11
|
|
|
12
|
-
'.input-b': {
|
|
13
|
-
nest: {
|
|
14
|
-
'& .input-presentation': {
|
|
15
|
-
boxShadow: `inset 0 0 0 1px ${vars.color.input.text.border}`,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
|
|
20
12
|
'.input-element': {
|
|
21
13
|
WebkitFontSmoothing: 'inherit',
|
|
22
14
|
appearance: 'none',
|
|
@@ -45,6 +37,11 @@ const primitive: StyleRules = {
|
|
|
45
37
|
width: ['-moz-available', '-webkit-fill-available', 'stretch'],
|
|
46
38
|
|
|
47
39
|
nest: {
|
|
40
|
+
'&::placeholder': {
|
|
41
|
+
color: vars.color.input.text.placeholder,
|
|
42
|
+
opacity: 1,
|
|
43
|
+
},
|
|
44
|
+
|
|
48
45
|
'.input[data-icon-left] &': {
|
|
49
46
|
paddingLeft: `calc(${vars.input.padding} + calc(${vars.input.lineHeight} - ${vars.input.ascenderHeight} - ${vars.input.descenderHeight}) + ${vars.input.gap})`,
|
|
50
47
|
},
|
|
@@ -60,16 +57,16 @@ const primitive: StyleRules = {
|
|
|
60
57
|
},
|
|
61
58
|
},
|
|
62
59
|
|
|
63
|
-
'.input:not([data-invalid]) &::placeholder': {
|
|
64
|
-
color: vars.color.input.text.placeholder,
|
|
65
|
-
},
|
|
66
|
-
|
|
67
60
|
'.input:not([data-invalid]) &:hover': {
|
|
68
|
-
|
|
61
|
+
vars: {
|
|
62
|
+
[varNames.color.input.text.fg]: vars.color.tinted.default.fg[0],
|
|
63
|
+
},
|
|
69
64
|
},
|
|
70
65
|
|
|
71
66
|
'.input:not([data-invalid]) &:focus': {
|
|
72
|
-
|
|
67
|
+
vars: {
|
|
68
|
+
[varNames.color.input.text.fg]: vars.color.tinted.default.fg[0],
|
|
69
|
+
},
|
|
73
70
|
},
|
|
74
71
|
|
|
75
72
|
'.input:not([data-invalid]) &:disabled': {
|
|
@@ -82,24 +79,27 @@ const primitive: StyleRules = {
|
|
|
82
79
|
'.input[data-invalid] &': {
|
|
83
80
|
vars: {
|
|
84
81
|
[varNames.color.input.text.fg]: vars.color.tinted.critical.fg[2],
|
|
85
|
-
[varNames.color.input.text.placeholder]: vars.color.tinted.critical.border[
|
|
82
|
+
[varNames.color.input.text.placeholder]: vars.color.tinted.critical.border[2],
|
|
86
83
|
},
|
|
87
84
|
},
|
|
88
85
|
|
|
89
|
-
'.input[data-invalid] &::placeholder': {
|
|
90
|
-
color: vars.color.input.text.placeholder,
|
|
91
|
-
},
|
|
92
|
-
|
|
93
86
|
'.input[data-invalid] &:hover': {
|
|
94
|
-
|
|
87
|
+
vars: {
|
|
88
|
+
[varNames.color.input.text.fg]: vars.color.tinted.critical.fg[1],
|
|
89
|
+
},
|
|
95
90
|
},
|
|
96
91
|
|
|
97
92
|
'.input[data-invalid] &:focus': {
|
|
98
|
-
|
|
93
|
+
vars: {
|
|
94
|
+
[varNames.color.input.text.fg]: vars.color.tinted.critical.fg[1],
|
|
95
|
+
},
|
|
99
96
|
},
|
|
100
97
|
|
|
101
98
|
'.input[data-invalid] &:disabled': {
|
|
102
|
-
|
|
99
|
+
vars: {
|
|
100
|
+
[varNames.color.input.text.fg]: vars.color.tinted.critical.border[4],
|
|
101
|
+
[varNames.color.input.text.placeholder]: vars.color.tinted.critical.border[2],
|
|
102
|
+
},
|
|
103
103
|
},
|
|
104
104
|
},
|
|
105
105
|
},
|
|
@@ -107,6 +107,7 @@ const primitive: StyleRules = {
|
|
|
107
107
|
'.input-presentation': {
|
|
108
108
|
backgroundColor: vars.color.input.text.bg,
|
|
109
109
|
borderRadius: 'inherit',
|
|
110
|
+
boxShadow: `inset 0 0 0 1px ${vars.color.input.text.border}`,
|
|
110
111
|
position: 'absolute',
|
|
111
112
|
top: 0,
|
|
112
113
|
left: 0,
|
|
@@ -127,23 +128,18 @@ const primitive: StyleRules = {
|
|
|
127
128
|
borderBottomRightRadius: 0,
|
|
128
129
|
},
|
|
129
130
|
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
// focus ring
|
|
132
|
+
'.input .input-element:not([data-no-focus-ring]):focus + &': {
|
|
132
133
|
outlineWidth: vars.input.text.focusRing.width,
|
|
133
134
|
outlineStyle: 'solid',
|
|
134
135
|
outlineColor: vars.color.focusRing,
|
|
135
136
|
outlineOffset: vars.input.text.focusRing.offset,
|
|
136
137
|
},
|
|
137
138
|
|
|
138
|
-
'.input-element:disabled + &': {
|
|
139
|
-
opacity: 1,
|
|
140
|
-
},
|
|
141
|
-
|
|
142
139
|
// valid
|
|
143
140
|
|
|
144
141
|
'.input:not([data-invalid]) &': {
|
|
145
142
|
vars: {
|
|
146
|
-
[varNames.color.input.text.fg]: vars.color.tinted.default.fg[4],
|
|
147
143
|
[varNames.color.input.text.bg]: vars.color.tinted.default.bg[0],
|
|
148
144
|
[varNames.color.input.text.border]: vars.color.tinted.default.border[1],
|
|
149
145
|
},
|
|
@@ -155,18 +151,10 @@ const primitive: StyleRules = {
|
|
|
155
151
|
},
|
|
156
152
|
},
|
|
157
153
|
|
|
158
|
-
'.input:not([data-invalid]) .input-element:placeholder-shown + &': {
|
|
159
|
-
vars: {
|
|
160
|
-
[varNames.color.input.text.fg]: vars.color.tinted.default.border[4],
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
|
|
164
154
|
'.input:not([data-invalid]):not([data-read-only]) .input-element:not(:disabled):hover + &': {
|
|
165
155
|
vars: {
|
|
166
156
|
[varNames.color.input.text.border]: vars.color.tinted.default.border[2],
|
|
167
|
-
[varNames.color.input.text.fg]: vars.color.tinted.default.fg[1],
|
|
168
157
|
},
|
|
169
|
-
boxShadow: `inset 0 0 0 1px ${vars.color.input.text.border}`,
|
|
170
158
|
},
|
|
171
159
|
|
|
172
160
|
'.input:not([data-invalid]) .input-element:focus + &': {
|
|
@@ -174,15 +162,12 @@ const primitive: StyleRules = {
|
|
|
174
162
|
[varNames.color.input.text.border]: vars.color.tinted.default.border[2],
|
|
175
163
|
[varNames.color.input.text.fg]: vars.color.tinted.default.fg[1],
|
|
176
164
|
},
|
|
177
|
-
boxShadow: `inset 0 0 0 1px ${vars.color.input.text.border}`,
|
|
178
165
|
},
|
|
179
166
|
|
|
180
167
|
'.input:not([data-invalid]) .input-element:disabled + &': {
|
|
181
168
|
vars: {
|
|
182
169
|
[varNames.color.input.text.bg]: vars.color.tinted.default.bg[1],
|
|
183
170
|
[varNames.color.input.text.border]: vars.color.tinted.default.border[0],
|
|
184
|
-
|
|
185
|
-
// icon
|
|
186
171
|
[varNames.color.muted.fg]: vars.color.tinted.default.border[4],
|
|
187
172
|
},
|
|
188
173
|
},
|
|
@@ -191,31 +176,21 @@ const primitive: StyleRules = {
|
|
|
191
176
|
|
|
192
177
|
'.input[data-invalid] &': {
|
|
193
178
|
vars: {
|
|
194
|
-
[varNames.color.input.text.fg]: vars.color.tinted.critical.fg[4],
|
|
195
179
|
[varNames.color.input.text.bg]: vars.color.tinted.critical.bg[1],
|
|
196
180
|
[varNames.color.input.text.border]: vars.color.tinted.critical.border[1],
|
|
197
|
-
|
|
198
|
-
[varNames.color.focusRing]: vars.color.solid.critical.bg[0],
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
'.input[data-invalid] .input-element:placeholder-shown + &': {
|
|
203
|
-
vars: {
|
|
204
|
-
[varNames.color.input.text.fg]: vars.color.tinted.critical.border[4],
|
|
181
|
+
[varNames.color.muted.fg]: vars.color.tinted.critical.fg[4],
|
|
205
182
|
},
|
|
206
183
|
},
|
|
207
184
|
|
|
208
185
|
'.input[data-invalid] .input-element:not(:disabled):hover + &': {
|
|
209
186
|
vars: {
|
|
210
187
|
[varNames.color.input.text.border]: vars.color.tinted.critical.border[2],
|
|
211
|
-
[varNames.color.input.text.fg]: vars.color.tinted.critical.fg[1],
|
|
212
188
|
},
|
|
213
189
|
},
|
|
214
190
|
|
|
215
191
|
'.input[data-invalid] .input-element:focus + &': {
|
|
216
192
|
vars: {
|
|
217
193
|
[varNames.color.input.text.border]: vars.color.tinted.critical.border[2],
|
|
218
|
-
[varNames.color.input.text.fg]: vars.color.tinted.critical.fg[1],
|
|
219
194
|
},
|
|
220
195
|
},
|
|
221
196
|
|
|
@@ -225,6 +200,10 @@ const primitive: StyleRules = {
|
|
|
225
200
|
[varNames.color.input.text.border]: vars.color.tinted.critical.border[0],
|
|
226
201
|
},
|
|
227
202
|
},
|
|
203
|
+
|
|
204
|
+
'.input:not(.input-b) &': {
|
|
205
|
+
[varNames.color.input.text.border]: 'transparent',
|
|
206
|
+
},
|
|
228
207
|
},
|
|
229
208
|
},
|
|
230
209
|
}
|
|
@@ -13,7 +13,7 @@ const primitive: StyleRules = {
|
|
|
13
13
|
[varNames.color.fg]: vars.color.tinted.fg[2],
|
|
14
14
|
|
|
15
15
|
'nest': {
|
|
16
|
-
'
|
|
16
|
+
'button&': {
|
|
17
17
|
WebkitFontSmoothing: 'inherit',
|
|
18
18
|
appearance: 'none',
|
|
19
19
|
outline: 'none',
|
|
@@ -24,8 +24,7 @@ const primitive: StyleRules = {
|
|
|
24
24
|
width: ['-moz-available', '-webkit-fill-available', 'stretch'],
|
|
25
25
|
},
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
'&:is(a)': {
|
|
27
|
+
'a&': {
|
|
29
28
|
outline: 'none',
|
|
30
29
|
textDecoration: 'none',
|
|
31
30
|
},
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
inset,
|
|
14
14
|
margin,
|
|
15
15
|
maxWidth,
|
|
16
|
+
minHeight,
|
|
16
17
|
minWidth,
|
|
17
18
|
overflow,
|
|
18
19
|
padding,
|
|
@@ -40,6 +41,7 @@ export function box(props: BoxStyleProps): string | undefined {
|
|
|
40
41
|
inset(props),
|
|
41
42
|
margin(props),
|
|
42
43
|
maxWidth(props),
|
|
44
|
+
minHeight(props),
|
|
43
45
|
minWidth(props),
|
|
44
46
|
overflow(props),
|
|
45
47
|
padding(props),
|
|
@@ -11,6 +11,7 @@ import type {
|
|
|
11
11
|
InsetStyleProps,
|
|
12
12
|
MarginStyleProps,
|
|
13
13
|
MaxWidthStyleProps,
|
|
14
|
+
MinHeightStyleProps,
|
|
14
15
|
MinWidthStyleProps,
|
|
15
16
|
OverflowStyleProps,
|
|
16
17
|
PaddingStyleProps,
|
|
@@ -34,6 +35,7 @@ export interface BoxStyleProps
|
|
|
34
35
|
InsetStyleProps,
|
|
35
36
|
MarginStyleProps,
|
|
36
37
|
MaxWidthStyleProps,
|
|
38
|
+
MinHeightStyleProps,
|
|
37
39
|
MinWidthStyleProps,
|
|
38
40
|
OverflowStyleProps,
|
|
39
41
|
PaddingStyleProps,
|
|
@@ -261,6 +261,9 @@ function _assignToneProps(
|
|
|
261
261
|
[_varNames.shadow.umbra]: _vars.shadow.umbra,
|
|
262
262
|
[_varNames.shadow.penumbra]: _vars.shadow.penumbra,
|
|
263
263
|
[_varNames.shadow.ambient]: _vars.shadow.ambient,
|
|
264
|
+
|
|
265
|
+
[_varNames.skeleton.from]: _vars.skeleton.from,
|
|
266
|
+
[_varNames.skeleton.to]: _vars.skeleton.to,
|
|
264
267
|
})
|
|
265
268
|
|
|
266
269
|
for (const variant of COLOR_VARIANTS) {
|
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {vars} from '../../theme'
|
|
2
2
|
import type {Style, StyleRules} from '../../types'
|
|
3
3
|
|
|
4
4
|
const primitive: StyleRules = {
|
|
5
|
-
'.text-input': {
|
|
6
|
-
vars: {
|
|
7
|
-
[varNames.font.family]: vars.font.text.family,
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
nest: {
|
|
11
|
-
'& > span': {
|
|
12
|
-
borderRadius: 'inherit',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
5
|
+
'.text-input': {},
|
|
16
6
|
|
|
17
7
|
'.text-input-prefix': {
|
|
18
8
|
borderTop: `1px solid ${vars.color.border}`,
|
|
19
9
|
borderLeft: `1px solid ${vars.color.border}`,
|
|
20
10
|
borderBottom: `1px solid ${vars.color.border}`,
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
borderTopLeftRadius: 'inherit',
|
|
12
|
+
borderBottomLeftRadius: 'inherit',
|
|
23
13
|
|
|
24
14
|
nest: {
|
|
25
15
|
'& > span': {
|
|
@@ -29,12 +19,16 @@ const primitive: StyleRules = {
|
|
|
29
19
|
},
|
|
30
20
|
},
|
|
31
21
|
|
|
22
|
+
'.text-input-element': {
|
|
23
|
+
borderRadius: 'inherit',
|
|
24
|
+
},
|
|
25
|
+
|
|
32
26
|
'.text-input-suffix': {
|
|
33
27
|
borderTop: `1px solid ${vars.color.border}`,
|
|
34
28
|
borderRight: `1px solid ${vars.color.border}`,
|
|
35
29
|
borderBottom: `1px solid ${vars.color.border}`,
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
borderTopRightRadius: 'inherit',
|
|
31
|
+
borderBottomRightRadius: 'inherit',
|
|
38
32
|
|
|
39
33
|
nest: {
|
|
40
34
|
'& > span': {
|
|
@@ -43,8 +37,6 @@ const primitive: StyleRules = {
|
|
|
43
37
|
},
|
|
44
38
|
},
|
|
45
39
|
},
|
|
46
|
-
|
|
47
|
-
'.text-input-presentation': {},
|
|
48
40
|
}
|
|
49
41
|
|
|
50
42
|
export const textInputStyle: Style = {
|
|
@@ -7,3 +7,18 @@ import type {TextInputStyleProps} from './types'
|
|
|
7
7
|
export function textInput(props: TextInputStyleProps): string | undefined {
|
|
8
8
|
return _composeClassNames(_scopeClassNames('text-input'), _input(props))
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
/** @public */
|
|
12
|
+
export function textInputPrefix(): string | undefined {
|
|
13
|
+
return _scopeClassNames('text-input-prefix')
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** @public */
|
|
17
|
+
export function textInputElement(): string | undefined {
|
|
18
|
+
return _scopeClassNames('text-input-element')
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** @public */
|
|
22
|
+
export function textInputSuffix(): string | undefined {
|
|
23
|
+
return _scopeClassNames('text-input-suffix')
|
|
24
|
+
}
|
|
@@ -4,19 +4,6 @@ const primitive: StyleRules = {
|
|
|
4
4
|
'.tooltip': {
|
|
5
5
|
pointerEvents: 'none',
|
|
6
6
|
},
|
|
7
|
-
|
|
8
|
-
'.tooltip-card': {
|
|
9
|
-
willChange: 'transform',
|
|
10
|
-
|
|
11
|
-
nest: {
|
|
12
|
-
'&[data-animate] > *': {
|
|
13
|
-
// TODO
|
|
14
|
-
// opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
|
|
15
|
-
// opacity: `var(--motion-content-opacity, 1)`,
|
|
16
|
-
willChange: 'opacity',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
7
|
}
|
|
21
8
|
|
|
22
9
|
export const tooltipStyle: Style = {layers: {primitive}}
|
|
@@ -439,16 +439,20 @@ export function resolveTheme(options: {theme: Theme_v3}) {
|
|
|
439
439
|
iconSize: null,
|
|
440
440
|
featureSettings: null,
|
|
441
441
|
fontWeight: null,
|
|
442
|
+
|
|
443
|
+
capHeight: null,
|
|
442
444
|
iconOffset: null,
|
|
445
|
+
customIconSize: null,
|
|
446
|
+
customIconOffset: null,
|
|
443
447
|
|
|
444
448
|
code: {
|
|
445
449
|
family: theme.font.code.family,
|
|
446
450
|
featureSettings: theme.font.code.featureSettings ?? 'normal',
|
|
447
451
|
weight: {
|
|
448
|
-
regular: String(theme.font.code.
|
|
449
|
-
medium: String(theme.font.code.
|
|
450
|
-
semibold: String(theme.font.code.
|
|
451
|
-
bold: String(theme.font.code.
|
|
452
|
+
regular: String(theme.font.code.weight.regular),
|
|
453
|
+
medium: String(theme.font.code.weight.medium),
|
|
454
|
+
semibold: String(theme.font.code.weight.semibold),
|
|
455
|
+
bold: String(theme.font.code.weight.bold),
|
|
452
456
|
},
|
|
453
457
|
sizes: _fromEntries(
|
|
454
458
|
FONT_CODE_SIZE.map((s) => [
|
|
@@ -460,6 +464,7 @@ export function resolveTheme(options: {theme: Theme_v3}) {
|
|
|
460
464
|
ascenderHeight: rem(theme.font.code.sizes[s].ascenderHeight),
|
|
461
465
|
descenderHeight: rem(theme.font.code.sizes[s].descenderHeight),
|
|
462
466
|
iconSize: rem(theme.font.code.sizes[s].iconSize),
|
|
467
|
+
customIconSize: rem(theme.font.code.sizes[s].customIconSize),
|
|
463
468
|
},
|
|
464
469
|
]),
|
|
465
470
|
),
|
|
@@ -469,10 +474,10 @@ export function resolveTheme(options: {theme: Theme_v3}) {
|
|
|
469
474
|
family: theme.font.heading.family,
|
|
470
475
|
featureSettings: theme.font.heading.featureSettings ?? 'normal',
|
|
471
476
|
weight: {
|
|
472
|
-
regular: String(theme.font.heading.
|
|
473
|
-
medium: String(theme.font.heading.
|
|
474
|
-
semibold: String(theme.font.heading.
|
|
475
|
-
bold: String(theme.font.heading.
|
|
477
|
+
regular: String(theme.font.heading.weight.regular),
|
|
478
|
+
medium: String(theme.font.heading.weight.medium),
|
|
479
|
+
semibold: String(theme.font.heading.weight.semibold),
|
|
480
|
+
bold: String(theme.font.heading.weight.bold),
|
|
476
481
|
},
|
|
477
482
|
sizes: _fromEntries(
|
|
478
483
|
FONT_HEADING_SIZE.map((s) => [
|
|
@@ -484,6 +489,7 @@ export function resolveTheme(options: {theme: Theme_v3}) {
|
|
|
484
489
|
ascenderHeight: rem(theme.font.heading.sizes[s].ascenderHeight),
|
|
485
490
|
descenderHeight: rem(theme.font.heading.sizes[s].descenderHeight),
|
|
486
491
|
iconSize: rem(theme.font.heading.sizes[s].iconSize),
|
|
492
|
+
customIconSize: rem(theme.font.heading.sizes[s].customIconSize),
|
|
487
493
|
},
|
|
488
494
|
]),
|
|
489
495
|
),
|
|
@@ -493,10 +499,10 @@ export function resolveTheme(options: {theme: Theme_v3}) {
|
|
|
493
499
|
family: theme.font.label.family,
|
|
494
500
|
featureSettings: theme.font.label.featureSettings ?? 'normal',
|
|
495
501
|
weight: {
|
|
496
|
-
regular: String(theme.font.label.
|
|
497
|
-
medium: String(theme.font.label.
|
|
498
|
-
semibold: String(theme.font.label.
|
|
499
|
-
bold: String(theme.font.label.
|
|
502
|
+
regular: String(theme.font.label.weight.regular),
|
|
503
|
+
medium: String(theme.font.label.weight.medium),
|
|
504
|
+
semibold: String(theme.font.label.weight.semibold),
|
|
505
|
+
bold: String(theme.font.label.weight.bold),
|
|
500
506
|
},
|
|
501
507
|
sizes: _fromEntries(
|
|
502
508
|
FONT_LABEL_SIZE.map((s) => [
|
|
@@ -508,6 +514,7 @@ export function resolveTheme(options: {theme: Theme_v3}) {
|
|
|
508
514
|
ascenderHeight: rem(theme.font.label.sizes[s].ascenderHeight),
|
|
509
515
|
descenderHeight: rem(theme.font.label.sizes[s].descenderHeight),
|
|
510
516
|
iconSize: rem(theme.font.label.sizes[s].iconSize),
|
|
517
|
+
customIconSize: rem(theme.font.label.sizes[s].customIconSize),
|
|
511
518
|
},
|
|
512
519
|
]),
|
|
513
520
|
),
|
|
@@ -517,10 +524,10 @@ export function resolveTheme(options: {theme: Theme_v3}) {
|
|
|
517
524
|
family: theme.font.text.family,
|
|
518
525
|
featureSettings: theme.font.text.featureSettings ?? 'normal',
|
|
519
526
|
weight: {
|
|
520
|
-
regular: String(theme.font.text.
|
|
521
|
-
medium: String(theme.font.text.
|
|
522
|
-
semibold: String(theme.font.text.
|
|
523
|
-
bold: String(theme.font.text.
|
|
527
|
+
regular: String(theme.font.text.weight.regular),
|
|
528
|
+
medium: String(theme.font.text.weight.medium),
|
|
529
|
+
semibold: String(theme.font.text.weight.semibold),
|
|
530
|
+
bold: String(theme.font.text.weight.bold),
|
|
524
531
|
},
|
|
525
532
|
sizes: _fromEntries(
|
|
526
533
|
FONT_TEXT_SIZE.map((s) => [
|
|
@@ -532,6 +539,7 @@ export function resolveTheme(options: {theme: Theme_v3}) {
|
|
|
532
539
|
ascenderHeight: rem(theme.font.text.sizes[s].ascenderHeight),
|
|
533
540
|
descenderHeight: rem(theme.font.text.sizes[s].descenderHeight),
|
|
534
541
|
iconSize: rem(theme.font.text.sizes[s].iconSize),
|
|
542
|
+
customIconSize: rem(theme.font.text.sizes[s].customIconSize),
|
|
535
543
|
},
|
|
536
544
|
]),
|
|
537
545
|
),
|
|
@@ -684,7 +692,6 @@ export function resolveTheme(options: {theme: Theme_v3}) {
|
|
|
684
692
|
}) {
|
|
685
693
|
const {theme, scheme, tone} = options
|
|
686
694
|
const card = theme.color[tone]
|
|
687
|
-
const cardOptions = {defaultHue: card._hue}
|
|
688
695
|
const i = scheme === 'dark' ? 1 : 0
|
|
689
696
|
|
|
690
697
|
const defaultElement = buildElementContract({
|
|
@@ -694,6 +701,10 @@ export function resolveTheme(options: {theme: Theme_v3}) {
|
|
|
694
701
|
scheme,
|
|
695
702
|
})
|
|
696
703
|
|
|
704
|
+
const bgValue = defaultElement.bg[0]
|
|
705
|
+
|
|
706
|
+
const cardOptions = {bgValue, defaultHue: card._hue}
|
|
707
|
+
|
|
697
708
|
return {
|
|
698
709
|
avatar: _fromEntries(
|
|
699
710
|
AVATAR_COLORS.map((c) => [
|
|
@@ -775,7 +786,7 @@ export function resolveTheme(options: {theme: Theme_v3}) {
|
|
|
775
786
|
variant: v,
|
|
776
787
|
tone: e,
|
|
777
788
|
scheme,
|
|
778
|
-
bgValue
|
|
789
|
+
bgValue,
|
|
779
790
|
}),
|
|
780
791
|
]),
|
|
781
792
|
),
|
package/src/theme/v0/font.ts
CHANGED
|
@@ -55,7 +55,6 @@ export const defaultThemeFonts: ThemeFonts = {
|
|
|
55
55
|
heading: {
|
|
56
56
|
family:
|
|
57
57
|
'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
|
|
58
|
-
featureSettings: `'liga' 1, 'calt' 1, 'ss01' 1, 'ss03' 1, 'zero' 1`,
|
|
59
58
|
weights: {
|
|
60
59
|
regular: 600,
|
|
61
60
|
medium: 700,
|
|
@@ -139,11 +139,6 @@ export function _parseColorToken(str: ColorToken, options: {defaultHue: Hue}): T
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
function parseMix() {
|
|
142
|
-
// expect at least 1 white space
|
|
143
|
-
if (_peek() !== ' ') {
|
|
144
|
-
return undefined
|
|
145
|
-
}
|
|
146
|
-
|
|
147
142
|
ignoreWhitespace()
|
|
148
143
|
|
|
149
144
|
const match = RE_PERCENTAGE.exec(str.slice(cursor))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {black, hues, white} from '@sanity/color'
|
|
2
2
|
|
|
3
3
|
import {defaultThemeConfig} from '../v2/defaults/config'
|
|
4
|
-
import {defaultThemeFonts} from '
|
|
4
|
+
import {defaultThemeFonts} from './defaultFonts'
|
|
5
5
|
import {defaultTokens} from './defaultTokens'
|
|
6
6
|
import {resolveTokens} from './resolveTokens'
|
|
7
7
|
import type {Radius, Space, Theme_v3, ThemeOptions} from './types'
|
|
@@ -20,7 +20,7 @@ export function buildTheme_v3(options?: ThemeOptions): Theme_v3 {
|
|
|
20
20
|
card: v2?.card ?? defaultThemeConfig.card,
|
|
21
21
|
color: tokens.color,
|
|
22
22
|
container: v2?.container ?? defaultThemeConfig.container,
|
|
23
|
-
font:
|
|
23
|
+
font: defaultThemeFonts,
|
|
24
24
|
input: v2?.input ?? defaultThemeConfig.input,
|
|
25
25
|
layer: v2?.layer ?? defaultThemeConfig.layer,
|
|
26
26
|
media: v2?.media ?? defaultThemeConfig.media,
|