@sanity/ui 2.0.0-alpha.34 → 2.0.0-alpha.36
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/index.cjs.mjs +4 -3
- package/dist/index.d.ts +29 -22
- package/dist/index.esm.js +397 -518
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +413 -534
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs.mjs +10 -4
- package/dist/theme.d.ts +489 -201
- package/dist/theme.esm.js +2934 -2748
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +2943 -2751
- package/dist/theme.js.map +1 -1
- package/package.json +3 -3
- package/src/core/_compat.ts +7 -7
- package/src/core/components/dialog/dialog.tsx +5 -5
- package/src/core/components/dialog/styles.ts +4 -5
- package/src/core/components/hotkeys/hotkeys.tsx +4 -2
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +50 -0
- package/src/core/components/menu/__workshop__/index.ts +5 -0
- package/src/core/components/menu/menuItem.tsx +7 -1
- package/src/core/components/skeleton/textSkeleton.tsx +12 -14
- package/src/core/components/tree/style.ts +14 -17
- package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +3 -3
- package/src/core/hooks/useMediaIndex/useMediaIndex.ts +2 -3
- package/src/core/primitives/_selectable/style.ts +18 -18
- package/src/core/primitives/avatar/avatar.tsx +3 -3
- package/src/core/primitives/avatar/avatarCounter.tsx +4 -4
- package/src/core/primitives/avatar/avatarStack.tsx +2 -2
- package/src/core/primitives/avatar/styles.ts +7 -8
- package/src/core/primitives/avatar/types.ts +2 -2
- package/src/core/primitives/badge/__workshop__/props.tsx +1 -1
- package/src/core/primitives/badge/__workshop__/tones.tsx +1 -1
- package/src/core/primitives/badge/badge.tsx +1 -1
- package/src/core/primitives/badge/styles.ts +5 -6
- package/src/core/primitives/button/button.tsx +3 -4
- package/src/core/primitives/button/styles.ts +22 -23
- package/src/core/primitives/card/__workshop__/selected.tsx +15 -15
- package/src/core/primitives/card/card.tsx +1 -1
- package/src/core/primitives/card/styles.ts +22 -22
- package/src/core/primitives/checkbox/styles.ts +21 -22
- package/src/core/primitives/code/styles.ts +4 -1
- package/src/core/primitives/container/styles.ts +2 -3
- package/src/core/primitives/heading/styles.ts +4 -2
- package/src/core/primitives/inline/styles.ts +6 -6
- package/src/core/primitives/kbd/kbd.tsx +7 -11
- package/src/core/primitives/label/styles.ts +4 -3
- package/src/core/primitives/popover/helpers.ts +3 -4
- package/src/core/primitives/popover/popover.tsx +8 -4
- package/src/core/primitives/popover/types.ts +1 -1
- package/src/core/primitives/radio/styles.ts +17 -19
- package/src/core/primitives/select/styles.ts +27 -32
- package/src/core/primitives/stack/styles.ts +2 -3
- package/src/core/primitives/switch/__workshop__/props.tsx +11 -31
- package/src/core/primitives/switch/styles.ts +18 -21
- package/src/core/primitives/text/__workshop__/colored.tsx +10 -10
- package/src/core/primitives/text/styles.ts +9 -4
- package/src/core/primitives/tooltip/tooltip.tsx +3 -3
- package/src/core/styles/border/borderStyle.ts +6 -11
- package/src/core/styles/box/boxStyle.ts +5 -9
- package/src/core/styles/card/_cardColorStyle.ts +99 -0
- package/src/core/styles/card/index.ts +1 -0
- package/src/core/styles/flex/flexItemStyle.ts +2 -3
- package/src/core/styles/flex/flexStyle.ts +6 -11
- package/src/core/styles/font/responsiveFont.ts +4 -4
- package/src/core/styles/font/textAlignStyle.ts +3 -3
- package/src/core/styles/grid/gridItemStyle.ts +7 -13
- package/src/core/styles/grid/gridStyle.ts +9 -17
- package/src/core/styles/helpers.ts +5 -3
- package/src/core/styles/input/responsiveInputPaddingStyle.ts +6 -6
- package/src/core/styles/input/textInputStyle.ts +36 -40
- package/src/core/styles/margin/marginsStyle.test.ts +2 -3
- package/src/core/styles/padding/paddingStyle.test.ts +2 -3
- package/src/core/styles/radius/radiusStyle.ts +2 -3
- package/src/core/styles/shadow/shadowStyle.ts +4 -5
- package/src/core/theme/__workshop__/build/Root.tsx +24 -20
- package/src/core/theme/__workshop__/build/story.tsx +22 -26
- package/src/core/theme/__workshop__/canvas.tsx +21 -40
- package/src/core/theme/theme.test.tsx +2 -35
- package/src/core/theme/themeColorProvider.tsx +2 -2
- package/src/core/theme/themeContext.ts +2 -2
- package/src/core/theme/themeProvider.tsx +25 -25
- package/src/core/theme/types.ts +3 -2
- package/src/core/theme/useRootTheme.ts +1 -9
- package/src/core/theme/useTheme.ts +8 -1
- package/src/core/types/card.ts +2 -2
- package/src/core/utils/arrow/arrow.tsx +3 -3
- package/src/core/utils/elementQuery/elementQuery.tsx +3 -3
- package/src/core/utils/virtualList/virtualList.tsx +2 -2
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +2 -2
- package/src/theme/build/buildColorTheme.test.ts +14 -15
- package/src/theme/build/buildColorTheme.ts +239 -292
- package/src/theme/build/buildTheme.test.ts +9 -7
- package/src/theme/build/buildTheme.ts +12 -9
- package/src/theme/build/colorToken.ts +3 -1
- package/src/theme/build/lib/color-fns/contrastRatio.ts +1 -0
- package/src/theme/build/lib/isRecord.ts +3 -0
- package/src/theme/build/merge.ts +18 -13
- package/src/theme/build/renderColorTheme.ts +205 -213
- package/src/theme/build/renderColorValue.ts +15 -8
- package/src/theme/build/resolveColorTokens.ts +177 -198
- package/src/theme/build/theme.test.ts +27 -0
- package/src/theme/config/helpers.ts +16 -8
- package/src/theme/config/system.ts +46 -17
- package/src/theme/config/tokens/color/types.ts +55 -32
- package/src/theme/config/tokens/types.ts +11 -4
- package/src/theme/config/types.ts +5 -11
- package/src/theme/{build/defaults → defaults}/colorPalette.ts +1 -1
- package/src/theme/{build/defaults → defaults}/colorTokens.ts +189 -136
- package/src/theme/{build/defaults → defaults}/config.ts +14 -12
- package/src/theme/{build/defaults → defaults}/fonts.ts +6 -6
- package/src/theme/getScopedTheme.ts +81 -0
- package/src/theme/index.ts +9 -1
- package/src/theme/system/avatar.ts +1 -1
- package/src/theme/system/color/_constants.ts +11 -11
- package/src/theme/system/color/_system.ts +10 -71
- package/src/theme/system/color/avatar.ts +22 -10
- package/src/theme/system/color/badge.ts +18 -7
- package/src/theme/system/color/button.ts +17 -23
- package/src/theme/system/color/color.ts +34 -0
- package/src/theme/system/color/index.ts +3 -10
- package/src/theme/system/color/input.ts +13 -11
- package/src/theme/system/color/kbd.ts +3 -3
- package/src/theme/system/color/selectable.ts +13 -19
- package/src/theme/system/color/shadow.ts +7 -0
- package/src/theme/system/color/state.ts +37 -0
- package/src/theme/system/css.ts +9 -0
- package/src/theme/system/focusRing.ts +7 -0
- package/src/theme/system/index.ts +5 -1
- package/src/theme/system/input.ts +1 -1
- package/src/theme/system/layer.ts +1 -2
- package/src/theme/system/shadow.ts +1 -0
- package/src/theme/system/styles.ts +19 -0
- package/src/theme/system/theme.ts +128 -0
- package/src/theme/system/{color → v0/color}/_generic.ts +2 -1
- package/src/theme/system/v0/color/_system.ts +13 -0
- package/src/theme/system/{color → v0/color}/base.ts +2 -0
- package/src/theme/system/v0/color/button.ts +42 -0
- package/src/theme/system/{color → v0/color}/card.ts +2 -1
- package/src/theme/system/v0/color/color.ts +40 -0
- package/src/theme/system/v0/color/index.ts +11 -0
- package/src/theme/system/v0/color/input.ts +34 -0
- package/src/theme/system/{color/_deprecated → v0/color}/muted.ts +1 -1
- package/src/theme/system/v0/color/selectable.ts +31 -0
- package/src/theme/system/{color/_deprecated → v0/color}/solid.ts +1 -1
- package/src/theme/system/v0/color/spot.ts +13 -0
- package/src/theme/system/v0/index.ts +1 -0
- package/src/theme/versioning/getTheme_v2.ts +38 -0
- package/src/theme/versioning/index.ts +5 -0
- package/src/theme/versioning/is_v0.ts +6 -0
- package/src/theme/versioning/is_v2.ts +6 -0
- package/src/theme/versioning/themeColor_v0_v2.ts +217 -0
- package/src/theme/versioning/v0_v2.ts +72 -0
- package/src/theme/versioning/v2_v0.ts +126 -0
- package/src/core/styles/colorVars/colorVarsStyle.ts +0 -43
- package/src/core/styles/colorVars/index.ts +0 -1
- package/src/core/theme/defaults.ts +0 -7
- package/src/theme/system/_system.ts +0 -95
- package/src/theme/system/color/_deprecated/spot.ts +0 -13
- package/src/theme/themes/studio/config.ts +0 -69
- package/src/theme/themes/studio/fonts.ts +0 -219
- package/src/theme/themes/studio/index.ts +0 -1
- package/src/theme/themes/studio/studioTheme.test.ts +0 -27
- package/src/theme/themes/studio/studioTheme.ts +0 -8
package/dist/theme.d.ts
CHANGED
|
@@ -6,46 +6,72 @@ import type {StyledObject} from 'styled-components'
|
|
|
6
6
|
/**
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
|
-
export declare interface BaseTheme
|
|
9
|
+
export declare interface BaseTheme {
|
|
10
|
+
_version?: 0
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Use `v2.avatar` instead
|
|
13
|
+
*/
|
|
10
14
|
avatar: ThemeAvatar
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use `v2.button` instead
|
|
17
|
+
*/
|
|
11
18
|
button: {
|
|
12
|
-
border: {
|
|
13
|
-
width: number
|
|
14
|
-
}
|
|
15
|
-
focusRing: ThemeFocusRing
|
|
16
19
|
textWeight: ThemeFontWeightKey
|
|
17
20
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
focusRing: ThemeFocusRing
|
|
23
|
-
shadow: {
|
|
24
|
-
outline: number
|
|
25
|
-
}
|
|
26
|
-
}
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Use `v2.color` instead
|
|
23
|
+
*/
|
|
27
24
|
color: ThemeColorSchemes
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use `v2.container` instead
|
|
27
|
+
*/
|
|
28
28
|
container: number[]
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated Use component-specific `v2.{button | card | input}.focusRing` values instead
|
|
31
|
+
*/
|
|
30
32
|
focusRing: {
|
|
31
33
|
offset: number
|
|
32
34
|
width: number
|
|
33
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Use `v2.font` instead
|
|
38
|
+
*/
|
|
34
39
|
fonts: ThemeFonts
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated Use `v2.input` instead
|
|
42
|
+
*/
|
|
35
43
|
input: ThemeInput
|
|
36
44
|
/**
|
|
37
45
|
* THIS API MAY BE UNSTABLE. DO NOT USE IN PRODUCTION.
|
|
38
46
|
* @beta
|
|
47
|
+
* @deprecated Use `v2.layer` instead
|
|
39
48
|
*/
|
|
40
49
|
layer?: ThemeLayer
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated Use `v2.media` instead
|
|
52
|
+
*/
|
|
41
53
|
media: number[]
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated Use `v2.radius` instead
|
|
56
|
+
*/
|
|
42
57
|
radius: number[]
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated Use `v2.shadow` instead
|
|
60
|
+
*/
|
|
43
61
|
shadows: Array<ThemeShadow | null>
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated Use `v2.space` instead
|
|
64
|
+
*/
|
|
44
65
|
space: number[]
|
|
45
|
-
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated Use `v2.style` instead
|
|
68
|
+
*/
|
|
69
|
+
styles?: ThemeStyles
|
|
70
|
+
v2?: RootTheme_v2
|
|
46
71
|
}
|
|
47
72
|
|
|
48
73
|
/**
|
|
74
|
+
* @public
|
|
49
75
|
* @deprecated Use `ThemeBoxShadow` instead
|
|
50
76
|
*/
|
|
51
77
|
export declare type BoxShadow = ThemeBoxShadow
|
|
@@ -53,27 +79,41 @@ export declare type BoxShadow = ThemeBoxShadow
|
|
|
53
79
|
/** @internal */
|
|
54
80
|
export declare function buildTheme(config?: ThemeConfig): RootTheme
|
|
55
81
|
|
|
82
|
+
/** @internal */
|
|
56
83
|
export declare const COLOR_CONFIG_AVATAR_COLORS: readonly ['*', ...ColorHueKey[]]
|
|
57
84
|
|
|
58
|
-
|
|
85
|
+
/** @internal */
|
|
86
|
+
export declare const COLOR_CONFIG_BLEND_KEYS: readonly ['_blend']
|
|
87
|
+
|
|
88
|
+
/** @internal */
|
|
89
|
+
export declare const COLOR_CONFIG_CARD_KEYS: readonly [
|
|
59
90
|
'_hue',
|
|
60
91
|
'bg',
|
|
61
92
|
'fg',
|
|
62
93
|
'border',
|
|
63
94
|
'focusRing',
|
|
64
95
|
'muted/fg',
|
|
96
|
+
'accent/fg',
|
|
65
97
|
'link/fg',
|
|
66
98
|
'code/bg',
|
|
67
99
|
'code/fg',
|
|
100
|
+
'skeleton/from',
|
|
101
|
+
'skeleton/to',
|
|
102
|
+
'status/dot',
|
|
103
|
+
'status/icon',
|
|
104
|
+
'_hue',
|
|
105
|
+
'bg',
|
|
106
|
+
'fg',
|
|
107
|
+
'border',
|
|
108
|
+
'focusRing',
|
|
68
109
|
'shadow/outline',
|
|
69
110
|
'shadow/umbra',
|
|
70
111
|
'shadow/penumbra',
|
|
71
112
|
'shadow/ambient',
|
|
72
|
-
'skeleton/from',
|
|
73
|
-
'skeleton/to',
|
|
74
113
|
]
|
|
75
114
|
|
|
76
|
-
|
|
115
|
+
/** @internal */
|
|
116
|
+
export declare const COLOR_CONFIG_CARD_TONES: readonly [
|
|
77
117
|
'*',
|
|
78
118
|
'transparent',
|
|
79
119
|
'default',
|
|
@@ -83,10 +123,10 @@ export declare const COLOR_CONFIG_BASE_TONES: readonly [
|
|
|
83
123
|
'critical',
|
|
84
124
|
]
|
|
85
125
|
|
|
86
|
-
|
|
87
|
-
|
|
126
|
+
/** @internal */
|
|
88
127
|
export declare const COLOR_CONFIG_INPUT_MODES: readonly ['*', 'default', 'invalid']
|
|
89
128
|
|
|
129
|
+
/** @internal */
|
|
90
130
|
export declare const COLOR_CONFIG_INPUT_STATES: readonly [
|
|
91
131
|
'*',
|
|
92
132
|
'enabled',
|
|
@@ -95,6 +135,7 @@ export declare const COLOR_CONFIG_INPUT_STATES: readonly [
|
|
|
95
135
|
'disabled',
|
|
96
136
|
]
|
|
97
137
|
|
|
138
|
+
/** @internal */
|
|
98
139
|
export declare const COLOR_CONFIG_STATE_KEYS: readonly [
|
|
99
140
|
'_hue',
|
|
100
141
|
'bg',
|
|
@@ -102,13 +143,17 @@ export declare const COLOR_CONFIG_STATE_KEYS: readonly [
|
|
|
102
143
|
'border',
|
|
103
144
|
'focusRing',
|
|
104
145
|
'muted/fg',
|
|
146
|
+
'accent/fg',
|
|
105
147
|
'link/fg',
|
|
106
148
|
'code/bg',
|
|
107
149
|
'code/fg',
|
|
108
150
|
'skeleton/from',
|
|
109
151
|
'skeleton/to',
|
|
152
|
+
'status/dot',
|
|
153
|
+
'status/icon',
|
|
110
154
|
]
|
|
111
155
|
|
|
156
|
+
/** @internal */
|
|
112
157
|
export declare const COLOR_CONFIG_STATE_TONES: readonly [
|
|
113
158
|
'*',
|
|
114
159
|
'default',
|
|
@@ -118,6 +163,7 @@ export declare const COLOR_CONFIG_STATE_TONES: readonly [
|
|
|
118
163
|
'critical',
|
|
119
164
|
]
|
|
120
165
|
|
|
166
|
+
/** @internal */
|
|
121
167
|
export declare const COLOR_CONFIG_STATES: readonly [
|
|
122
168
|
'*',
|
|
123
169
|
'enabled',
|
|
@@ -127,28 +173,40 @@ export declare const COLOR_CONFIG_STATES: readonly [
|
|
|
127
173
|
'disabled',
|
|
128
174
|
]
|
|
129
175
|
|
|
176
|
+
/** @public */
|
|
130
177
|
export declare type ColorBlendModeTokenValue = [ThemeColorBlendModeKey, ThemeColorBlendModeKey]
|
|
131
178
|
|
|
179
|
+
/** @public */
|
|
132
180
|
export declare type ColorConfigAvatarColor = (typeof COLOR_CONFIG_AVATAR_COLORS)[number]
|
|
133
181
|
|
|
134
|
-
|
|
182
|
+
/** @public */
|
|
183
|
+
export declare type ColorConfigBlendKey = (typeof COLOR_CONFIG_BLEND_KEYS)[number]
|
|
135
184
|
|
|
136
|
-
|
|
185
|
+
/** @public */
|
|
186
|
+
export declare type ColorConfigCardKey = (typeof COLOR_CONFIG_CARD_KEYS)[number]
|
|
137
187
|
|
|
138
|
-
|
|
188
|
+
/** @public */
|
|
189
|
+
export declare type ColorConfigCardTone = (typeof COLOR_CONFIG_CARD_TONES)[number]
|
|
139
190
|
|
|
191
|
+
/** @public */
|
|
140
192
|
export declare type ColorConfigInputMode = (typeof COLOR_CONFIG_INPUT_MODES)[number]
|
|
141
193
|
|
|
194
|
+
/** @public */
|
|
142
195
|
export declare type ColorConfigInputState = (typeof COLOR_CONFIG_INPUT_STATES)[number]
|
|
143
196
|
|
|
197
|
+
/** @public */
|
|
144
198
|
export declare type ColorConfigOpacityValue = `0` | `0.${number}` | `1`
|
|
145
199
|
|
|
200
|
+
/** @public */
|
|
146
201
|
export declare type ColorConfigState = (typeof COLOR_CONFIG_STATES)[number]
|
|
147
202
|
|
|
203
|
+
/** @public */
|
|
148
204
|
export declare type ColorConfigStateKey = (typeof COLOR_CONFIG_STATE_KEYS)[number]
|
|
149
205
|
|
|
206
|
+
/** @public */
|
|
150
207
|
export declare type ColorConfigStateTone = (typeof COLOR_CONFIG_STATE_TONES)[number]
|
|
151
208
|
|
|
209
|
+
/** @public */
|
|
152
210
|
export declare type ColorConfigValue =
|
|
153
211
|
| `black`
|
|
154
212
|
| `white`
|
|
@@ -170,14 +228,30 @@ export declare function createColorTheme(
|
|
|
170
228
|
): ThemeColorSchemes
|
|
171
229
|
|
|
172
230
|
/**
|
|
173
|
-
*
|
|
231
|
+
* Work around types that are missing in `styled-components@6`
|
|
174
232
|
* https://github.com/styled-components/styled-components/issues/4062
|
|
175
233
|
* @internal
|
|
176
234
|
* */
|
|
177
235
|
export declare type CSSObject = StyledObject<any>
|
|
178
236
|
|
|
237
|
+
/**
|
|
238
|
+
* @public
|
|
239
|
+
*/
|
|
240
|
+
export declare const defaultTheme: BaseTheme
|
|
241
|
+
|
|
242
|
+
/** @internal */
|
|
179
243
|
export declare function getContrastRatio(bg: string, fg: string): number
|
|
180
244
|
|
|
245
|
+
/** @internal */
|
|
246
|
+
export declare function getScopedTheme(
|
|
247
|
+
themeProp: RootTheme | RootTheme_v2,
|
|
248
|
+
scheme: ThemeColorSchemeKey,
|
|
249
|
+
tone: ThemeColorCardToneKey,
|
|
250
|
+
): Theme
|
|
251
|
+
|
|
252
|
+
/** @public */
|
|
253
|
+
export declare function getTheme_v2(theme: Theme): Theme_v2
|
|
254
|
+
|
|
181
255
|
/**
|
|
182
256
|
* @internal
|
|
183
257
|
*/
|
|
@@ -197,32 +271,46 @@ export declare interface HSL {
|
|
|
197
271
|
*/
|
|
198
272
|
export declare function hslToRgb(hsl: HSL): RGB
|
|
199
273
|
|
|
274
|
+
/** @internal */
|
|
275
|
+
export declare function is_v0(themeProp: RootTheme | RootTheme_v2): themeProp is RootTheme
|
|
276
|
+
|
|
277
|
+
/** @internal */
|
|
278
|
+
export declare function is_v2(themeProp: RootTheme | RootTheme_v2): themeProp is RootTheme_v2
|
|
279
|
+
|
|
200
280
|
/** @internal */
|
|
201
281
|
export declare function isColorBlendModeValue(str: string): str is ThemeColorBlendModeKey
|
|
202
282
|
|
|
203
283
|
/** @internal */
|
|
204
284
|
export declare function isColorButtonMode(str: string): str is ThemeColorButtonModeKey
|
|
205
285
|
|
|
206
|
-
|
|
286
|
+
/** @internal */
|
|
287
|
+
export declare function isColorConfigBaseKey(str: string): str is ColorConfigCardKey
|
|
207
288
|
|
|
208
|
-
|
|
289
|
+
/** @internal */
|
|
290
|
+
export declare function isColorConfigBaseTone(str: string): str is ColorConfigCardTone
|
|
209
291
|
|
|
292
|
+
/** @internal */
|
|
210
293
|
export declare function isColorConfigBlendKey(str: string): str is ColorConfigBlendKey
|
|
211
294
|
|
|
295
|
+
/** @internal */
|
|
212
296
|
export declare function isColorConfigStateKey(str: string): str is ColorConfigStateKey
|
|
213
297
|
|
|
298
|
+
/** @internal */
|
|
214
299
|
export declare function isColorConfigStateTone(str: string): str is ColorConfigStateTone
|
|
215
300
|
|
|
216
301
|
/** @internal */
|
|
217
302
|
export declare function isColorHueKey(str: string): str is ColorHueKey
|
|
218
303
|
|
|
304
|
+
/** @internal */
|
|
219
305
|
export declare function isColorOpacityValue(str: string): str is ColorConfigOpacityValue
|
|
220
306
|
|
|
221
307
|
/** @internal */
|
|
222
308
|
export declare function isColorTintKey(str: string): str is ColorTintKey
|
|
223
309
|
|
|
310
|
+
/** @internal */
|
|
224
311
|
export declare function isColorTokenValue(str: string): str is ColorConfigValue
|
|
225
312
|
|
|
313
|
+
/** @internal */
|
|
226
314
|
export declare function isColorValue(str: string): str is 'black' | 'white'
|
|
227
315
|
|
|
228
316
|
/**
|
|
@@ -297,7 +385,41 @@ export declare function rgbToHsl({r, g, b}: RGB): HSL
|
|
|
297
385
|
/**
|
|
298
386
|
* @public
|
|
299
387
|
*/
|
|
300
|
-
export declare type RootTheme = BaseTheme
|
|
388
|
+
export declare type RootTheme = BaseTheme
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* @public
|
|
392
|
+
*/
|
|
393
|
+
export declare interface RootTheme_v2 {
|
|
394
|
+
_version: 2
|
|
395
|
+
avatar: ThemeAvatar
|
|
396
|
+
button: {
|
|
397
|
+
border: {
|
|
398
|
+
width: number
|
|
399
|
+
}
|
|
400
|
+
focusRing: ThemeFocusRing
|
|
401
|
+
textWeight: ThemeFontWeightKey
|
|
402
|
+
}
|
|
403
|
+
card: {
|
|
404
|
+
border: {
|
|
405
|
+
width: number
|
|
406
|
+
}
|
|
407
|
+
focusRing: ThemeFocusRing
|
|
408
|
+
shadow: {
|
|
409
|
+
outline: number
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
color: ThemeColorSchemes_v2
|
|
413
|
+
container: number[]
|
|
414
|
+
font: ThemeFonts
|
|
415
|
+
input: ThemeInput
|
|
416
|
+
layer: ThemeLayer
|
|
417
|
+
media: number[]
|
|
418
|
+
radius: number[]
|
|
419
|
+
shadow: Array<ThemeShadow | null>
|
|
420
|
+
space: number[]
|
|
421
|
+
style?: ThemeStyles
|
|
422
|
+
}
|
|
301
423
|
|
|
302
424
|
/**
|
|
303
425
|
* Apply the \`screen\` blend mode
|
|
@@ -307,14 +429,9 @@ export declare type RootTheme = BaseTheme<ThemeStyles>
|
|
|
307
429
|
declare function screen_2(b: RGB | RGBA, s: RGB | RGBA): RGB
|
|
308
430
|
export {screen_2 as screen}
|
|
309
431
|
|
|
310
|
-
/**
|
|
311
|
-
* @public
|
|
312
|
-
*/
|
|
313
|
-
export declare const studioTheme: RootTheme
|
|
314
|
-
|
|
315
432
|
/**
|
|
316
433
|
* @deprecated Use `ThemeStyles` instead
|
|
317
|
-
* @
|
|
434
|
+
* @internal
|
|
318
435
|
*/
|
|
319
436
|
export declare type Styles = ThemeStyles
|
|
320
437
|
|
|
@@ -322,16 +439,26 @@ export declare type Styles = ThemeStyles
|
|
|
322
439
|
* @public
|
|
323
440
|
*/
|
|
324
441
|
export declare interface Theme {
|
|
325
|
-
sanity: Omit<RootTheme, 'color'> & {
|
|
442
|
+
sanity: Omit<RootTheme, 'color' | 'v2'> & {
|
|
443
|
+
/**
|
|
444
|
+
* @deprecated Use `v2.color` instead
|
|
445
|
+
*/
|
|
326
446
|
color: ThemeColor
|
|
447
|
+
v2?: Theme_v2
|
|
327
448
|
}
|
|
328
449
|
}
|
|
329
450
|
|
|
330
|
-
/** @
|
|
451
|
+
/** @public */
|
|
331
452
|
export declare const THEME_COLOR_AVATAR_COLORS: ColorHueKey[]
|
|
332
453
|
|
|
333
|
-
/** @
|
|
334
|
-
export declare const
|
|
454
|
+
/** @public */
|
|
455
|
+
export declare const THEME_COLOR_BLEND_MODES: readonly ['multiply', 'screen']
|
|
456
|
+
|
|
457
|
+
/** @public */
|
|
458
|
+
export declare const THEME_COLOR_BUTTON_MODES: readonly ['default', 'ghost', 'bleed']
|
|
459
|
+
|
|
460
|
+
/** @public */
|
|
461
|
+
export declare const THEME_COLOR_CARD_TONES: readonly [
|
|
335
462
|
'transparent',
|
|
336
463
|
'default',
|
|
337
464
|
'primary',
|
|
@@ -340,16 +467,10 @@ export declare const THEME_COLOR_BASE_TONES: readonly [
|
|
|
340
467
|
'critical',
|
|
341
468
|
]
|
|
342
469
|
|
|
343
|
-
/** @
|
|
344
|
-
export declare const THEME_COLOR_BLEND_MODES: readonly ['multiply', 'screen']
|
|
345
|
-
|
|
346
|
-
/** @internal */
|
|
347
|
-
export declare const THEME_COLOR_BUTTON_MODES: readonly ['default', 'ghost', 'bleed']
|
|
348
|
-
|
|
349
|
-
/** @internal */
|
|
470
|
+
/** @public */
|
|
350
471
|
export declare const THEME_COLOR_INPUT_MODES: readonly ['default', 'invalid']
|
|
351
472
|
|
|
352
|
-
/** @
|
|
473
|
+
/** @public */
|
|
353
474
|
export declare const THEME_COLOR_INPUT_STATES: readonly [
|
|
354
475
|
'enabled',
|
|
355
476
|
'hovered',
|
|
@@ -357,7 +478,7 @@ export declare const THEME_COLOR_INPUT_STATES: readonly [
|
|
|
357
478
|
'disabled',
|
|
358
479
|
]
|
|
359
480
|
|
|
360
|
-
/** @
|
|
481
|
+
/** @public */
|
|
361
482
|
export declare const THEME_COLOR_STATE_TONES: readonly [
|
|
362
483
|
'default',
|
|
363
484
|
'primary',
|
|
@@ -366,7 +487,7 @@ export declare const THEME_COLOR_STATE_TONES: readonly [
|
|
|
366
487
|
'critical',
|
|
367
488
|
]
|
|
368
489
|
|
|
369
|
-
/** @
|
|
490
|
+
/** @public */
|
|
370
491
|
export declare const THEME_COLOR_STATES: readonly [
|
|
371
492
|
'enabled',
|
|
372
493
|
'hovered',
|
|
@@ -375,6 +496,13 @@ export declare const THEME_COLOR_STATES: readonly [
|
|
|
375
496
|
'disabled',
|
|
376
497
|
]
|
|
377
498
|
|
|
499
|
+
/**
|
|
500
|
+
* @public
|
|
501
|
+
*/
|
|
502
|
+
export declare type Theme_v2 = Omit<RootTheme_v2, 'color'> & {
|
|
503
|
+
color: ThemeColorCard_v2
|
|
504
|
+
}
|
|
505
|
+
|
|
378
506
|
/**
|
|
379
507
|
* @public
|
|
380
508
|
*/
|
|
@@ -395,131 +523,126 @@ export declare type ThemeBoxShadow = [number, number, number, number]
|
|
|
395
523
|
|
|
396
524
|
/**
|
|
397
525
|
* @public
|
|
526
|
+
* @deprecated Use `ThemeColor_v2` instead.
|
|
398
527
|
*/
|
|
399
|
-
export declare interface ThemeColor {
|
|
400
|
-
/** @internal */
|
|
401
|
-
_blend?: ThemeColorBlendModeKey
|
|
402
|
-
_dark?: boolean
|
|
403
|
-
avatar?: ThemeColorAvatar
|
|
404
|
-
badge?: ThemeColorBadge
|
|
528
|
+
export declare interface ThemeColor extends Partial<Omit<ThemeColorGenericState, 'muted'>> {
|
|
405
529
|
base: ThemeColorBase
|
|
406
530
|
button: ThemeColorButton
|
|
407
531
|
card: ThemeColorCard
|
|
408
|
-
input: ThemeColorInput
|
|
409
|
-
kbd?: ThemeColorKBD
|
|
410
|
-
selectable?: ThemeColorSelectable
|
|
411
|
-
syntax: ThemeColorSyntax
|
|
412
|
-
/** @deprecated Use `_dark` instead */
|
|
413
532
|
dark: boolean
|
|
414
|
-
|
|
533
|
+
focusRing?: string
|
|
534
|
+
input: ThemeColorInput
|
|
415
535
|
muted: ThemeColorMuted
|
|
416
|
-
|
|
417
|
-
spot: ThemeColorSpot
|
|
418
|
-
/** @deprecated */
|
|
536
|
+
selectable?: ThemeColorSelectable
|
|
419
537
|
solid: ThemeColorSolid
|
|
538
|
+
spot: ThemeColorSpot
|
|
539
|
+
syntax: ThemeColorSyntax
|
|
420
540
|
}
|
|
421
541
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
bg: string
|
|
436
|
-
fg: string
|
|
437
|
-
}
|
|
438
|
-
magenta: {
|
|
439
|
-
_blend?: ThemeColorBlendModeKey
|
|
440
|
-
bg: string
|
|
441
|
-
fg: string
|
|
442
|
-
}
|
|
443
|
-
red: {
|
|
444
|
-
_blend?: ThemeColorBlendModeKey
|
|
445
|
-
bg: string
|
|
446
|
-
fg: string
|
|
447
|
-
}
|
|
448
|
-
orange: {
|
|
449
|
-
_blend?: ThemeColorBlendModeKey
|
|
450
|
-
bg: string
|
|
451
|
-
fg: string
|
|
452
|
-
}
|
|
453
|
-
yellow: {
|
|
454
|
-
_blend?: ThemeColorBlendModeKey
|
|
455
|
-
bg: string
|
|
456
|
-
fg: string
|
|
457
|
-
}
|
|
458
|
-
green: {
|
|
459
|
-
_blend?: ThemeColorBlendModeKey
|
|
460
|
-
bg: string
|
|
461
|
-
fg: string
|
|
462
|
-
}
|
|
463
|
-
cyan: {
|
|
464
|
-
_blend?: ThemeColorBlendModeKey
|
|
465
|
-
bg: string
|
|
466
|
-
fg: string
|
|
467
|
-
}
|
|
542
|
+
/**
|
|
543
|
+
* @public
|
|
544
|
+
*/
|
|
545
|
+
export declare interface ThemeColorAvatar_v2 {
|
|
546
|
+
gray: ThemeColorAvatarHue_v2
|
|
547
|
+
blue: ThemeColorAvatarHue_v2
|
|
548
|
+
purple: ThemeColorAvatarHue_v2
|
|
549
|
+
magenta: ThemeColorAvatarHue_v2
|
|
550
|
+
red: ThemeColorAvatarHue_v2
|
|
551
|
+
orange: ThemeColorAvatarHue_v2
|
|
552
|
+
yellow: ThemeColorAvatarHue_v2
|
|
553
|
+
green: ThemeColorAvatarHue_v2
|
|
554
|
+
cyan: ThemeColorAvatarHue_v2
|
|
468
555
|
}
|
|
469
556
|
|
|
470
|
-
/** @
|
|
557
|
+
/** @public */
|
|
471
558
|
export declare type ThemeColorAvatarColorKey = (typeof THEME_COLOR_AVATAR_COLORS)[number]
|
|
472
559
|
|
|
473
|
-
|
|
560
|
+
/**
|
|
561
|
+
* @public
|
|
562
|
+
*/
|
|
563
|
+
export declare interface ThemeColorAvatarHue_v2 {
|
|
564
|
+
_blend?: ThemeColorBlendModeKey
|
|
565
|
+
bg: string
|
|
566
|
+
fg: string
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
export declare interface ThemeColorAvatarHueTokens {
|
|
474
570
|
_blend?: ColorBlendModeTokenValue
|
|
475
571
|
_hue?: ColorHueKey
|
|
476
572
|
bg?: ThemeColorTokenValue
|
|
477
573
|
fg?: ThemeColorTokenValue
|
|
478
574
|
}
|
|
479
575
|
|
|
480
|
-
export declare interface
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
critical:
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
576
|
+
export declare interface ThemeColorAvatarTokens {
|
|
577
|
+
'*'?: ThemeColorAvatarHueTokens
|
|
578
|
+
gray?: ThemeColorAvatarHueTokens
|
|
579
|
+
blue?: ThemeColorAvatarHueTokens
|
|
580
|
+
purple?: ThemeColorAvatarHueTokens
|
|
581
|
+
magenta?: ThemeColorAvatarHueTokens
|
|
582
|
+
red?: ThemeColorAvatarHueTokens
|
|
583
|
+
orange?: ThemeColorAvatarHueTokens
|
|
584
|
+
yellow?: ThemeColorAvatarHueTokens
|
|
585
|
+
green?: ThemeColorAvatarHueTokens
|
|
586
|
+
cyan?: ThemeColorAvatarHueTokens
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* @public
|
|
591
|
+
*/
|
|
592
|
+
export declare interface ThemeColorBadge_v2 {
|
|
593
|
+
default: ThemeColorBadgeTone_v2
|
|
594
|
+
primary: ThemeColorBadgeTone_v2
|
|
595
|
+
positive: ThemeColorBadgeTone_v2
|
|
596
|
+
caution: ThemeColorBadgeTone_v2
|
|
597
|
+
critical: ThemeColorBadgeTone_v2
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
export declare interface ThemeColorBadgeTokens {
|
|
601
|
+
_hue?: ColorHueKey
|
|
602
|
+
bg?: ThemeColorTokenValue
|
|
603
|
+
fg?: ThemeColorTokenValue
|
|
604
|
+
dot?: ThemeColorTokenValue
|
|
605
|
+
icon?: ThemeColorTokenValue
|
|
506
606
|
}
|
|
507
607
|
|
|
508
608
|
export declare interface ThemeColorBadgeTokens {
|
|
609
|
+
'*'?: ThemeColorBadgeToneTokens
|
|
610
|
+
default?: ThemeColorBadgeToneTokens
|
|
611
|
+
primary?: ThemeColorBadgeToneTokens
|
|
612
|
+
positive?: ThemeColorBadgeToneTokens
|
|
613
|
+
caution?: ThemeColorBadgeToneTokens
|
|
614
|
+
critical?: ThemeColorBadgeToneTokens
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* @public
|
|
619
|
+
*/
|
|
620
|
+
export declare interface ThemeColorBadgeTone_v2 {
|
|
621
|
+
bg: string
|
|
622
|
+
fg: string
|
|
623
|
+
dot: string
|
|
624
|
+
icon: string
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
export declare interface ThemeColorBadgeToneTokens {
|
|
509
628
|
_blend?: ColorBlendModeTokenValue
|
|
510
629
|
_hue?: ColorHueKey
|
|
511
630
|
bg?: ThemeColorTokenValue
|
|
631
|
+
dot?: ThemeColorTokenValue
|
|
512
632
|
fg?: ThemeColorTokenValue
|
|
633
|
+
icon?: ThemeColorTokenValue
|
|
513
634
|
}
|
|
514
635
|
|
|
515
636
|
/**
|
|
516
637
|
* @public
|
|
638
|
+
* @deprecated Use `ThemeColorCard_v2` instead.
|
|
517
639
|
*/
|
|
518
640
|
export declare interface ThemeColorBase {
|
|
519
641
|
bg: string
|
|
520
642
|
fg: string
|
|
521
643
|
border: string
|
|
522
644
|
focusRing: string
|
|
645
|
+
backdrop?: string
|
|
523
646
|
shadow: {
|
|
524
647
|
outline: string
|
|
525
648
|
umbra: string
|
|
@@ -532,29 +655,18 @@ export declare interface ThemeColorBase {
|
|
|
532
655
|
}
|
|
533
656
|
}
|
|
534
657
|
|
|
535
|
-
export declare interface ThemeColorBaseTokens {
|
|
536
|
-
_blend?: ColorBlendModeTokenValue
|
|
537
|
-
_hue?: ColorHueKey
|
|
538
|
-
bg?: ThemeColorTokenValue
|
|
539
|
-
fg?: ThemeColorTokenValue
|
|
540
|
-
border?: ThemeColorTokenValue
|
|
658
|
+
export declare interface ThemeColorBaseTokens extends ThemeColorStateTokens {
|
|
541
659
|
focusRing?: ThemeColorTokenValue
|
|
660
|
+
backdrop?: ThemeColorTokenValue
|
|
542
661
|
shadow?: {
|
|
543
662
|
outline?: ThemeColorTokenValue
|
|
544
663
|
umbra?: ThemeColorTokenValue
|
|
545
664
|
penumbra?: ThemeColorTokenValue
|
|
546
665
|
ambient?: ThemeColorTokenValue
|
|
547
666
|
}
|
|
548
|
-
skeleton?: {
|
|
549
|
-
from?: ThemeColorTokenValue
|
|
550
|
-
to?: ThemeColorTokenValue
|
|
551
|
-
}
|
|
552
667
|
}
|
|
553
668
|
|
|
554
|
-
/** @
|
|
555
|
-
export declare type ThemeColorBaseToneKey = (typeof THEME_COLOR_BASE_TONES)[number]
|
|
556
|
-
|
|
557
|
-
/** @internal */
|
|
669
|
+
/** @public */
|
|
558
670
|
export declare type ThemeColorBlendModeKey = (typeof THEME_COLOR_BLEND_MODES)[number]
|
|
559
671
|
|
|
560
672
|
/**
|
|
@@ -614,6 +726,7 @@ export declare interface ThemeColorBuilderOpts {
|
|
|
614
726
|
|
|
615
727
|
/**
|
|
616
728
|
* @public
|
|
729
|
+
* @deprecated
|
|
617
730
|
*/
|
|
618
731
|
export declare interface ThemeColorButton {
|
|
619
732
|
default: ThemeColorButtonTones
|
|
@@ -621,17 +734,27 @@ export declare interface ThemeColorButton {
|
|
|
621
734
|
bleed: ThemeColorButtonTones
|
|
622
735
|
}
|
|
623
736
|
|
|
624
|
-
/**
|
|
737
|
+
/**
|
|
738
|
+
* @public
|
|
739
|
+
*/
|
|
740
|
+
export declare interface ThemeColorButton_v2 {
|
|
741
|
+
default: ThemeColorButtonTones_v2
|
|
742
|
+
ghost: ThemeColorButtonTones_v2
|
|
743
|
+
bleed: ThemeColorButtonTones_v2
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
/** @public */
|
|
625
747
|
export declare type ThemeColorButtonModeKey = (typeof THEME_COLOR_BUTTON_MODES)[number]
|
|
626
748
|
|
|
627
749
|
/**
|
|
628
|
-
* @deprecated Use `ThemeColorGenericState` instead.
|
|
629
750
|
* @public
|
|
751
|
+
* @deprecated Use `ThemeColorGenericState` instead.
|
|
630
752
|
*/
|
|
631
753
|
export declare type ThemeColorButtonState = ThemeColorGenericState
|
|
632
754
|
|
|
633
755
|
/**
|
|
634
756
|
* @public
|
|
757
|
+
* @deprecated
|
|
635
758
|
*/
|
|
636
759
|
export declare interface ThemeColorButtonStates {
|
|
637
760
|
enabled: ThemeColorGenericState
|
|
@@ -641,6 +764,17 @@ export declare interface ThemeColorButtonStates {
|
|
|
641
764
|
disabled: ThemeColorGenericState
|
|
642
765
|
}
|
|
643
766
|
|
|
767
|
+
/**
|
|
768
|
+
* @public
|
|
769
|
+
*/
|
|
770
|
+
export declare interface ThemeColorButtonStates_v2 {
|
|
771
|
+
enabled: ThemeColorState_v2
|
|
772
|
+
hovered: ThemeColorState_v2
|
|
773
|
+
pressed: ThemeColorState_v2
|
|
774
|
+
selected: ThemeColorState_v2
|
|
775
|
+
disabled: ThemeColorState_v2
|
|
776
|
+
}
|
|
777
|
+
|
|
644
778
|
export declare interface ThemeColorButtonTokens
|
|
645
779
|
extends Partial<Record<ColorConfigStateTone, ThemeColorStatesTokens>> {
|
|
646
780
|
_hue?: ColorHueKey
|
|
@@ -649,6 +783,7 @@ export declare interface ThemeColorButtonTokens
|
|
|
649
783
|
/**
|
|
650
784
|
* TODO: Rename to `ThemeColorButtonMode`.
|
|
651
785
|
* @public
|
|
786
|
+
* @deprecated
|
|
652
787
|
*/
|
|
653
788
|
export declare interface ThemeColorButtonTones {
|
|
654
789
|
default: ThemeColorButtonStates
|
|
@@ -659,8 +794,21 @@ export declare interface ThemeColorButtonTones {
|
|
|
659
794
|
}
|
|
660
795
|
|
|
661
796
|
/**
|
|
797
|
+
* TODO: Rename to `ThemeColorButtonMode`.
|
|
662
798
|
* @public
|
|
663
799
|
*/
|
|
800
|
+
export declare interface ThemeColorButtonTones_v2 {
|
|
801
|
+
default: ThemeColorButtonStates_v2
|
|
802
|
+
primary: ThemeColorButtonStates_v2
|
|
803
|
+
positive: ThemeColorButtonStates_v2
|
|
804
|
+
caution: ThemeColorButtonStates_v2
|
|
805
|
+
critical: ThemeColorButtonStates_v2
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* @public
|
|
810
|
+
* @deprecated
|
|
811
|
+
*/
|
|
664
812
|
export declare interface ThemeColorCard {
|
|
665
813
|
enabled: ThemeColorGenericState
|
|
666
814
|
hovered: ThemeColorGenericState
|
|
@@ -670,13 +818,33 @@ export declare interface ThemeColorCard {
|
|
|
670
818
|
}
|
|
671
819
|
|
|
672
820
|
/**
|
|
673
|
-
* @deprecated Use `ThemeColorGenericState` instead.
|
|
674
821
|
* @public
|
|
675
822
|
*/
|
|
823
|
+
export declare interface ThemeColorCard_v2 extends ThemeColorState_v2 {
|
|
824
|
+
/** @internal */
|
|
825
|
+
_blend: ThemeColorBlendModeKey
|
|
826
|
+
_dark: boolean
|
|
827
|
+
backdrop: string
|
|
828
|
+
button: ThemeColorButton_v2
|
|
829
|
+
focusRing: string
|
|
830
|
+
input: ThemeColorInput_v2
|
|
831
|
+
selectable: ThemeColorSelectable_v2
|
|
832
|
+
shadow: ThemeColorShadow
|
|
833
|
+
syntax: ThemeColorSyntax
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* @public
|
|
838
|
+
* @deprecated Use `ThemeColorGenericState` instead.
|
|
839
|
+
*/
|
|
676
840
|
export declare type ThemeColorCardState = ThemeColorGenericState
|
|
677
841
|
|
|
842
|
+
/** @public */
|
|
843
|
+
export declare type ThemeColorCardToneKey = (typeof THEME_COLOR_CARD_TONES)[number]
|
|
844
|
+
|
|
678
845
|
/**
|
|
679
846
|
* @public
|
|
847
|
+
* @deprecated Use `ThemeColorState_v2` instead.
|
|
680
848
|
*/
|
|
681
849
|
export declare interface ThemeColorGenericState {
|
|
682
850
|
/** @internal */
|
|
@@ -710,32 +878,57 @@ export declare interface ThemeColorGenericState {
|
|
|
710
878
|
|
|
711
879
|
/**
|
|
712
880
|
* @public
|
|
881
|
+
* @deprecated
|
|
713
882
|
*/
|
|
714
883
|
export declare interface ThemeColorInput {
|
|
715
884
|
default: ThemeColorInputStates
|
|
716
885
|
invalid: ThemeColorInputStates
|
|
717
886
|
}
|
|
718
887
|
|
|
719
|
-
/**
|
|
888
|
+
/**
|
|
889
|
+
* @public
|
|
890
|
+
*/
|
|
891
|
+
export declare interface ThemeColorInput_v2 {
|
|
892
|
+
default: ThemeColorInputStates_v2
|
|
893
|
+
invalid: ThemeColorInputStates_v2
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
/** @public */
|
|
720
897
|
export declare type ThemeColorInputModeKey = (typeof THEME_COLOR_INPUT_MODES)[number]
|
|
721
898
|
|
|
722
899
|
/**
|
|
723
900
|
* @public
|
|
901
|
+
* @deprecated
|
|
724
902
|
*/
|
|
725
903
|
export declare interface ThemeColorInputState {
|
|
726
904
|
_blend?: ThemeColorBlendModeKey
|
|
727
905
|
bg: string
|
|
728
906
|
bg2: string
|
|
907
|
+
border: string
|
|
729
908
|
fg: string
|
|
909
|
+
placeholder: string
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
/**
|
|
913
|
+
* @public
|
|
914
|
+
*/
|
|
915
|
+
export declare interface ThemeColorInputState_v2 {
|
|
916
|
+
_blend?: ThemeColorBlendModeKey
|
|
917
|
+
bg: string
|
|
730
918
|
border: string
|
|
919
|
+
fg: string
|
|
920
|
+
muted: {
|
|
921
|
+
bg: string
|
|
922
|
+
}
|
|
731
923
|
placeholder: string
|
|
732
924
|
}
|
|
733
925
|
|
|
734
|
-
/** @
|
|
926
|
+
/** @public */
|
|
735
927
|
export declare type ThemeColorInputStateKey = (typeof THEME_COLOR_INPUT_STATES)[number]
|
|
736
928
|
|
|
737
929
|
/**
|
|
738
930
|
* @public
|
|
931
|
+
* @deprecated
|
|
739
932
|
*/
|
|
740
933
|
export declare interface ThemeColorInputStates {
|
|
741
934
|
enabled: ThemeColorInputState
|
|
@@ -744,13 +937,25 @@ export declare interface ThemeColorInputStates {
|
|
|
744
937
|
readOnly: ThemeColorInputState
|
|
745
938
|
}
|
|
746
939
|
|
|
940
|
+
/**
|
|
941
|
+
* @public
|
|
942
|
+
*/
|
|
943
|
+
export declare interface ThemeColorInputStates_v2 {
|
|
944
|
+
enabled: ThemeColorInputState_v2
|
|
945
|
+
disabled: ThemeColorInputState_v2
|
|
946
|
+
hovered: ThemeColorInputState_v2
|
|
947
|
+
readOnly: ThemeColorInputState_v2
|
|
948
|
+
}
|
|
949
|
+
|
|
747
950
|
export declare interface ThemeColorInputStateTokens {
|
|
748
951
|
_blend?: ColorBlendModeTokenValue
|
|
749
952
|
_hue?: ColorHueKey
|
|
750
953
|
bg?: ThemeColorTokenValue
|
|
751
|
-
bg2?: ThemeColorTokenValue
|
|
752
|
-
fg?: ThemeColorTokenValue
|
|
753
954
|
border?: ThemeColorTokenValue
|
|
955
|
+
fg?: ThemeColorTokenValue
|
|
956
|
+
muted?: {
|
|
957
|
+
bg?: ThemeColorTokenValue
|
|
958
|
+
}
|
|
754
959
|
placeholder?: ThemeColorTokenValue
|
|
755
960
|
}
|
|
756
961
|
|
|
@@ -759,8 +964,10 @@ export declare interface ThemeColorInputTokens
|
|
|
759
964
|
_hue?: ColorHueKey
|
|
760
965
|
}
|
|
761
966
|
|
|
967
|
+
/**
|
|
968
|
+
* @public
|
|
969
|
+
*/
|
|
762
970
|
export declare interface ThemeColorKBD {
|
|
763
|
-
_blend?: ThemeColorBlendModeKey
|
|
764
971
|
bg: string
|
|
765
972
|
fg: string
|
|
766
973
|
border: string
|
|
@@ -795,8 +1002,9 @@ export declare interface ThemeColorMutedTone {
|
|
|
795
1002
|
* @public
|
|
796
1003
|
* @deprecated Use `ThemeColorBaseToneKey` instead.
|
|
797
1004
|
*/
|
|
798
|
-
export declare type ThemeColorName =
|
|
1005
|
+
export declare type ThemeColorName = ThemeColorCardToneKey
|
|
799
1006
|
|
|
1007
|
+
/** @public */
|
|
800
1008
|
export declare type ThemeColorPalette = {
|
|
801
1009
|
black: string | ColorTint
|
|
802
1010
|
white: string | ColorTint
|
|
@@ -804,8 +1012,14 @@ export declare type ThemeColorPalette = {
|
|
|
804
1012
|
|
|
805
1013
|
/**
|
|
806
1014
|
* @public
|
|
1015
|
+
* @deprecated Use `ThemeColorScheme_v2` instead.
|
|
807
1016
|
*/
|
|
808
|
-
export declare type ThemeColorScheme = Record<
|
|
1017
|
+
export declare type ThemeColorScheme = Record<ThemeColorCardToneKey, ThemeColor>
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* @public
|
|
1021
|
+
*/
|
|
1022
|
+
export declare type ThemeColorScheme_v2 = Record<ThemeColorCardToneKey, ThemeColorCard_v2>
|
|
809
1023
|
|
|
810
1024
|
/**
|
|
811
1025
|
* @public
|
|
@@ -814,12 +1028,19 @@ export declare type ThemeColorSchemeKey = 'dark' | 'light'
|
|
|
814
1028
|
|
|
815
1029
|
/**
|
|
816
1030
|
* @public
|
|
1031
|
+
* @deprecated Use `ThemeColorSchemes_v2` instead.
|
|
817
1032
|
*/
|
|
818
1033
|
export declare type ThemeColorSchemes = Record<ThemeColorSchemeKey, ThemeColorScheme>
|
|
819
1034
|
|
|
820
1035
|
/**
|
|
821
1036
|
* @public
|
|
822
1037
|
*/
|
|
1038
|
+
export declare type ThemeColorSchemes_v2 = Record<ThemeColorSchemeKey, ThemeColorScheme_v2>
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* @public
|
|
1042
|
+
* @deprecated Use `ThemeColorSelectable_v2` instead.
|
|
1043
|
+
*/
|
|
823
1044
|
export declare interface ThemeColorSelectable {
|
|
824
1045
|
default: ThemeColorSelectableStates
|
|
825
1046
|
primary: ThemeColorSelectableStates
|
|
@@ -829,13 +1050,25 @@ export declare interface ThemeColorSelectable {
|
|
|
829
1050
|
}
|
|
830
1051
|
|
|
831
1052
|
/**
|
|
832
|
-
* @deprecated Use `ThemeColorGenericState` instead.
|
|
833
1053
|
* @public
|
|
834
1054
|
*/
|
|
1055
|
+
export declare interface ThemeColorSelectable_v2 {
|
|
1056
|
+
default: ThemeColorSelectableStates_v2
|
|
1057
|
+
primary: ThemeColorSelectableStates_v2
|
|
1058
|
+
positive: ThemeColorSelectableStates_v2
|
|
1059
|
+
caution: ThemeColorSelectableStates_v2
|
|
1060
|
+
critical: ThemeColorSelectableStates_v2
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* @public
|
|
1065
|
+
* @deprecated Use `ThemeColorState_v2` instead.
|
|
1066
|
+
*/
|
|
835
1067
|
export declare type ThemeColorSelectableState = ThemeColorGenericState
|
|
836
1068
|
|
|
837
1069
|
/**
|
|
838
1070
|
* @public
|
|
1071
|
+
* @deprecated Use `ThemeColorSelectableStates_v2` instead.
|
|
839
1072
|
*/
|
|
840
1073
|
export declare interface ThemeColorSelectableStates {
|
|
841
1074
|
enabled: ThemeColorSelectableState
|
|
@@ -845,6 +1078,25 @@ export declare interface ThemeColorSelectableStates {
|
|
|
845
1078
|
disabled: ThemeColorSelectableState
|
|
846
1079
|
}
|
|
847
1080
|
|
|
1081
|
+
/**
|
|
1082
|
+
* @public
|
|
1083
|
+
*/
|
|
1084
|
+
export declare interface ThemeColorSelectableStates_v2 {
|
|
1085
|
+
enabled: ThemeColorState_v2
|
|
1086
|
+
hovered: ThemeColorState_v2
|
|
1087
|
+
pressed: ThemeColorState_v2
|
|
1088
|
+
selected: ThemeColorState_v2
|
|
1089
|
+
disabled: ThemeColorState_v2
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
/** @public */
|
|
1093
|
+
export declare interface ThemeColorShadow {
|
|
1094
|
+
outline: string
|
|
1095
|
+
umbra: string
|
|
1096
|
+
penumbra: string
|
|
1097
|
+
ambient: string
|
|
1098
|
+
}
|
|
1099
|
+
|
|
848
1100
|
/**
|
|
849
1101
|
* @public
|
|
850
1102
|
* @deprecated
|
|
@@ -872,17 +1124,50 @@ export declare interface ThemeColorSolidTone {
|
|
|
872
1124
|
|
|
873
1125
|
/**
|
|
874
1126
|
* @public
|
|
875
|
-
* @deprecated Use `
|
|
1127
|
+
* @deprecated Use `ThemeColorAvatar_v2` instead
|
|
876
1128
|
*/
|
|
877
1129
|
export declare type ThemeColorSpot = Record<ThemeColorSpotKey, string>
|
|
878
1130
|
|
|
879
1131
|
/**
|
|
880
1132
|
* @public
|
|
881
|
-
* @deprecated Use `
|
|
1133
|
+
* @deprecated Use `ThemeColorAvatarColorKey` instead
|
|
882
1134
|
*/
|
|
883
1135
|
export declare type ThemeColorSpotKey = ThemeColorAvatarColorKey
|
|
884
1136
|
|
|
885
|
-
/**
|
|
1137
|
+
/**
|
|
1138
|
+
* @public
|
|
1139
|
+
*/
|
|
1140
|
+
export declare interface ThemeColorState_v2 {
|
|
1141
|
+
/** @internal */
|
|
1142
|
+
_blend?: ThemeColorBlendModeKey
|
|
1143
|
+
accent: {
|
|
1144
|
+
fg: string
|
|
1145
|
+
}
|
|
1146
|
+
avatar: ThemeColorAvatar_v2
|
|
1147
|
+
badge: ThemeColorBadge_v2
|
|
1148
|
+
bg: string
|
|
1149
|
+
border: string
|
|
1150
|
+
code: {
|
|
1151
|
+
bg: string
|
|
1152
|
+
fg: string
|
|
1153
|
+
}
|
|
1154
|
+
fg: string
|
|
1155
|
+
icon: string
|
|
1156
|
+
kbd: ThemeColorKBD
|
|
1157
|
+
link: {
|
|
1158
|
+
fg: string
|
|
1159
|
+
}
|
|
1160
|
+
muted: {
|
|
1161
|
+
bg: string
|
|
1162
|
+
fg: string
|
|
1163
|
+
}
|
|
1164
|
+
skeleton: {
|
|
1165
|
+
from: string
|
|
1166
|
+
to: string
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
/** @public */
|
|
886
1171
|
export declare type ThemeColorStateKey = (typeof THEME_COLOR_STATES)[number]
|
|
887
1172
|
|
|
888
1173
|
export declare type ThemeColorStatesTokens = Partial<
|
|
@@ -892,21 +1177,28 @@ export declare type ThemeColorStatesTokens = Partial<
|
|
|
892
1177
|
export declare interface ThemeColorStateTokens {
|
|
893
1178
|
_blend?: ColorBlendModeTokenValue
|
|
894
1179
|
_hue?: ColorHueKey
|
|
1180
|
+
accent?: {
|
|
1181
|
+
fg?: ThemeColorTokenValue
|
|
1182
|
+
}
|
|
1183
|
+
avatar?: ThemeColorAvatarTokens
|
|
1184
|
+
badge?: ThemeColorBadgeTokens
|
|
895
1185
|
bg?: ThemeColorTokenValue
|
|
896
|
-
bg2?: ThemeColorTokenValue
|
|
897
|
-
fg?: ThemeColorTokenValue
|
|
898
|
-
icon?: ThemeColorTokenValue
|
|
899
1186
|
border?: ThemeColorTokenValue
|
|
900
|
-
|
|
1187
|
+
code?: {
|
|
1188
|
+
bg?: ThemeColorTokenValue
|
|
901
1189
|
fg?: ThemeColorTokenValue
|
|
902
1190
|
}
|
|
903
|
-
|
|
1191
|
+
fg?: ThemeColorTokenValue
|
|
1192
|
+
icon?: ThemeColorTokenValue
|
|
1193
|
+
kbd?: {
|
|
1194
|
+
bg?: ThemeColorTokenValue
|
|
904
1195
|
fg?: ThemeColorTokenValue
|
|
1196
|
+
border?: ThemeColorTokenValue
|
|
905
1197
|
}
|
|
906
1198
|
link?: {
|
|
907
1199
|
fg?: ThemeColorTokenValue
|
|
908
1200
|
}
|
|
909
|
-
|
|
1201
|
+
muted?: {
|
|
910
1202
|
bg?: ThemeColorTokenValue
|
|
911
1203
|
fg?: ThemeColorTokenValue
|
|
912
1204
|
}
|
|
@@ -916,7 +1208,7 @@ export declare interface ThemeColorStateTokens {
|
|
|
916
1208
|
}
|
|
917
1209
|
}
|
|
918
1210
|
|
|
919
|
-
/** @
|
|
1211
|
+
/** @public */
|
|
920
1212
|
export declare type ThemeColorStateToneKey = (typeof THEME_COLOR_STATE_TONES)[number]
|
|
921
1213
|
|
|
922
1214
|
/**
|
|
@@ -962,18 +1254,9 @@ export declare interface ThemeColorSyntax {
|
|
|
962
1254
|
}
|
|
963
1255
|
|
|
964
1256
|
export declare interface ThemeColorTokens {
|
|
965
|
-
|
|
966
|
-
badge?: Partial<Record<ColorConfigStateTone, ThemeColorBadgeTokens>>
|
|
967
|
-
base?: Partial<Record<ColorConfigBaseTone, ThemeColorBaseTokens>>
|
|
1257
|
+
base?: Partial<Record<ColorConfigCardTone, ThemeColorBaseTokens>>
|
|
968
1258
|
button?: Partial<Record<ThemeColorButtonModeKey, ThemeColorButtonTokens>>
|
|
969
|
-
card?: Partial<Record<ColorConfigState, ThemeColorStateTokens>>
|
|
970
1259
|
input?: Partial<Record<ColorConfigInputMode, ThemeColorInputTokens>>
|
|
971
|
-
kbd?: {
|
|
972
|
-
_blend?: ColorBlendModeTokenValue
|
|
973
|
-
bg?: ThemeColorTokenValue
|
|
974
|
-
fg?: ThemeColorTokenValue
|
|
975
|
-
border?: ThemeColorTokenValue
|
|
976
|
-
}
|
|
977
1260
|
selectable?: Partial<
|
|
978
1261
|
Record<
|
|
979
1262
|
ColorConfigStateTone,
|
|
@@ -982,18 +1265,19 @@ export declare interface ThemeColorTokens {
|
|
|
982
1265
|
} & ThemeColorStatesTokens
|
|
983
1266
|
>
|
|
984
1267
|
>
|
|
985
|
-
spot?: Partial<Record<ColorHueKey, ThemeColorTokenValue>>
|
|
986
1268
|
syntax?: Partial<Record<keyof ThemeColorSyntax, ThemeColorTokenValue>>
|
|
987
1269
|
}
|
|
988
1270
|
|
|
1271
|
+
/** @public */
|
|
989
1272
|
export declare type ThemeColorTokenValue = [ColorConfigValue, ColorConfigValue]
|
|
990
1273
|
|
|
991
1274
|
/**
|
|
992
1275
|
* @public
|
|
993
1276
|
* @deprecated Use `ThemeColorBaseToneKey` instead.
|
|
994
1277
|
*/
|
|
995
|
-
export declare type ThemeColorToneKey =
|
|
1278
|
+
export declare type ThemeColorToneKey = ThemeColorCardToneKey
|
|
996
1279
|
|
|
1280
|
+
/** @public */
|
|
997
1281
|
export declare interface ThemeConfig {
|
|
998
1282
|
avatar?: ThemeAvatar
|
|
999
1283
|
button?: {
|
|
@@ -1014,24 +1298,16 @@ export declare interface ThemeConfig {
|
|
|
1014
1298
|
}
|
|
1015
1299
|
color?: ThemeColorTokens
|
|
1016
1300
|
container?: number[]
|
|
1017
|
-
/** @deprecated Use component-specific `focusRing` values instead */
|
|
1018
|
-
focusRing?: {
|
|
1019
|
-
offset: number
|
|
1020
|
-
width: number
|
|
1021
|
-
}
|
|
1022
1301
|
fonts?: ThemeFonts
|
|
1023
1302
|
input?: ThemeInput
|
|
1024
|
-
/**
|
|
1025
|
-
* THIS API MAY BE UNSTABLE. DO NOT USE IN PRODUCTION.
|
|
1026
|
-
* @beta
|
|
1027
|
-
*/
|
|
1028
1303
|
layer?: ThemeLayer
|
|
1029
1304
|
media?: number[]
|
|
1030
1305
|
palette?: ThemeColorPalette
|
|
1031
1306
|
radius?: number[]
|
|
1032
|
-
|
|
1307
|
+
shadow?: Array<ThemeShadow | null>
|
|
1033
1308
|
space?: number[]
|
|
1034
|
-
|
|
1309
|
+
/** @internal */
|
|
1310
|
+
style?: ThemeStyles
|
|
1035
1311
|
}
|
|
1036
1312
|
|
|
1037
1313
|
/**
|
|
@@ -1128,8 +1404,7 @@ export declare interface ThemeInput {
|
|
|
1128
1404
|
}
|
|
1129
1405
|
|
|
1130
1406
|
/**
|
|
1131
|
-
*
|
|
1132
|
-
* @beta
|
|
1407
|
+
* @public
|
|
1133
1408
|
*/
|
|
1134
1409
|
export declare interface ThemeLayer {
|
|
1135
1410
|
dialog: {
|
|
@@ -1153,7 +1428,7 @@ export declare interface ThemeShadow {
|
|
|
1153
1428
|
}
|
|
1154
1429
|
|
|
1155
1430
|
/**
|
|
1156
|
-
* @
|
|
1431
|
+
* @internal
|
|
1157
1432
|
*/
|
|
1158
1433
|
export declare interface ThemeStyles {
|
|
1159
1434
|
button?: {
|
|
@@ -1164,17 +1439,20 @@ export declare interface ThemeStyles {
|
|
|
1164
1439
|
}
|
|
1165
1440
|
}
|
|
1166
1441
|
|
|
1442
|
+
/** @internal */
|
|
1167
1443
|
export declare interface TokenBaseKeyNode {
|
|
1168
1444
|
type: 'base'
|
|
1169
|
-
tone:
|
|
1170
|
-
key:
|
|
1445
|
+
tone: ColorConfigCardTone
|
|
1446
|
+
key: ColorConfigCardKey | ColorConfigBlendKey
|
|
1171
1447
|
}
|
|
1172
1448
|
|
|
1449
|
+
/** @internal */
|
|
1173
1450
|
export declare interface TokenBlendModeValueNode {
|
|
1174
1451
|
type: 'blendMode'
|
|
1175
1452
|
value?: ThemeColorBlendModeKey
|
|
1176
1453
|
}
|
|
1177
1454
|
|
|
1455
|
+
/** @internal */
|
|
1178
1456
|
export declare interface TokenButtonKeyNode {
|
|
1179
1457
|
type: 'button'
|
|
1180
1458
|
tone: ColorConfigStateTone
|
|
@@ -1182,6 +1460,7 @@ export declare interface TokenButtonKeyNode {
|
|
|
1182
1460
|
key: ColorConfigStateKey | ColorConfigBlendKey
|
|
1183
1461
|
}
|
|
1184
1462
|
|
|
1463
|
+
/** @internal */
|
|
1185
1464
|
export declare interface TokenColorValueNode {
|
|
1186
1465
|
type: 'color'
|
|
1187
1466
|
key?: 'black' | 'white' | `${ColorHueKey}/${ColorTintKey}` | ColorTintKey
|
|
@@ -1190,16 +1469,25 @@ export declare interface TokenColorValueNode {
|
|
|
1190
1469
|
opacity?: number
|
|
1191
1470
|
}
|
|
1192
1471
|
|
|
1472
|
+
/** @internal */
|
|
1193
1473
|
export declare interface TokenHueValueNode {
|
|
1194
1474
|
type: 'hue'
|
|
1195
1475
|
value?: ColorHueKey
|
|
1196
1476
|
}
|
|
1197
1477
|
|
|
1478
|
+
/** @internal */
|
|
1198
1479
|
export declare type TokenKeyNode = TokenBaseKeyNode | TokenButtonKeyNode
|
|
1199
1480
|
|
|
1481
|
+
/** @internal */
|
|
1200
1482
|
export declare type TokenValueNode =
|
|
1201
1483
|
| TokenColorValueNode
|
|
1202
1484
|
| TokenHueValueNode
|
|
1203
1485
|
| TokenBlendModeValueNode
|
|
1204
1486
|
|
|
1487
|
+
/** @internal */
|
|
1488
|
+
export declare function v0_v2(v0: RootTheme): RootTheme_v2
|
|
1489
|
+
|
|
1490
|
+
/** @internal */
|
|
1491
|
+
export declare function v2_v0(v2: RootTheme_v2): RootTheme
|
|
1492
|
+
|
|
1205
1493
|
export {}
|