@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {ColorHueKey, ColorTintKey} from '@sanity/color'
|
|
2
2
|
import {
|
|
3
3
|
THEME_COLOR_AVATAR_COLORS,
|
|
4
|
-
|
|
4
|
+
THEME_COLOR_CARD_TONES,
|
|
5
5
|
THEME_COLOR_INPUT_MODES,
|
|
6
6
|
THEME_COLOR_INPUT_STATES,
|
|
7
7
|
THEME_COLOR_STATES,
|
|
@@ -9,45 +9,54 @@ import {
|
|
|
9
9
|
ThemeColorBlendModeKey,
|
|
10
10
|
} from '../system'
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const COLOR_CONFIG_STATE_KEYS = [
|
|
13
14
|
'_hue',
|
|
14
15
|
'bg',
|
|
15
16
|
'fg',
|
|
16
17
|
'border',
|
|
17
18
|
'focusRing',
|
|
18
19
|
'muted/fg',
|
|
20
|
+
'accent/fg',
|
|
19
21
|
'link/fg',
|
|
20
22
|
'code/bg',
|
|
21
23
|
'code/fg',
|
|
22
|
-
'shadow/outline',
|
|
23
|
-
'shadow/umbra',
|
|
24
|
-
'shadow/penumbra',
|
|
25
|
-
'shadow/ambient',
|
|
26
24
|
'skeleton/from',
|
|
27
25
|
'skeleton/to',
|
|
26
|
+
'status/dot',
|
|
27
|
+
'status/icon',
|
|
28
28
|
] as const
|
|
29
|
-
export type ColorConfigBaseKey = (typeof COLOR_CONFIG_BASE_KEYS)[number]
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
/** @public */
|
|
31
|
+
export type ColorConfigStateKey = (typeof COLOR_CONFIG_STATE_KEYS)[number]
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const COLOR_CONFIG_CARD_KEYS = [
|
|
35
|
+
...COLOR_CONFIG_STATE_KEYS,
|
|
32
36
|
'_hue',
|
|
33
37
|
'bg',
|
|
34
38
|
'fg',
|
|
35
39
|
'border',
|
|
36
40
|
'focusRing',
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'skeleton/from',
|
|
42
|
-
'skeleton/to',
|
|
41
|
+
'shadow/outline',
|
|
42
|
+
'shadow/umbra',
|
|
43
|
+
'shadow/penumbra',
|
|
44
|
+
'shadow/ambient',
|
|
43
45
|
] as const
|
|
44
|
-
export type ColorConfigStateKey = (typeof COLOR_CONFIG_STATE_KEYS)[number]
|
|
45
46
|
|
|
47
|
+
/** @public */
|
|
48
|
+
export type ColorConfigCardKey = (typeof COLOR_CONFIG_CARD_KEYS)[number]
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
46
51
|
export const COLOR_CONFIG_BLEND_KEYS = ['_blend'] as const
|
|
52
|
+
|
|
53
|
+
/** @public */
|
|
47
54
|
export type ColorConfigBlendKey = (typeof COLOR_CONFIG_BLEND_KEYS)[number]
|
|
48
55
|
|
|
56
|
+
/** @public */
|
|
49
57
|
export type ColorConfigOpacityValue = `0` | `0.${number}` | `1`
|
|
50
58
|
|
|
59
|
+
/** @public */
|
|
51
60
|
export type ColorConfigValue =
|
|
52
61
|
| `black`
|
|
53
62
|
| `white`
|
|
@@ -60,24 +69,44 @@ export type ColorConfigValue =
|
|
|
60
69
|
| `${ColorTintKey}/${ColorConfigOpacityValue}`
|
|
61
70
|
| ThemeColorBlendModeKey
|
|
62
71
|
|
|
72
|
+
/** @public */
|
|
63
73
|
export type ThemeColorTokenValue = [ColorConfigValue, ColorConfigValue]
|
|
64
74
|
|
|
75
|
+
/** @public */
|
|
65
76
|
export type ColorBlendModeTokenValue = [ThemeColorBlendModeKey, ThemeColorBlendModeKey]
|
|
66
77
|
|
|
78
|
+
/** @internal */
|
|
67
79
|
export const COLOR_CONFIG_AVATAR_COLORS = ['*', ...THEME_COLOR_AVATAR_COLORS] as const
|
|
80
|
+
|
|
81
|
+
/** @public */
|
|
68
82
|
export type ColorConfigAvatarColor = (typeof COLOR_CONFIG_AVATAR_COLORS)[number]
|
|
69
83
|
|
|
70
|
-
|
|
71
|
-
export
|
|
84
|
+
/** @internal */
|
|
85
|
+
export const COLOR_CONFIG_CARD_TONES = ['*', ...THEME_COLOR_CARD_TONES] as const
|
|
86
|
+
|
|
87
|
+
/** @public */
|
|
88
|
+
export type ColorConfigCardTone = (typeof COLOR_CONFIG_CARD_TONES)[number]
|
|
72
89
|
|
|
90
|
+
/** @internal */
|
|
73
91
|
export const COLOR_CONFIG_STATE_TONES = ['*', ...THEME_COLOR_STATE_TONES] as const
|
|
92
|
+
|
|
93
|
+
/** @public */
|
|
74
94
|
export type ColorConfigStateTone = (typeof COLOR_CONFIG_STATE_TONES)[number]
|
|
75
95
|
|
|
96
|
+
/** @internal */
|
|
76
97
|
export const COLOR_CONFIG_STATES = ['*', ...THEME_COLOR_STATES] as const
|
|
98
|
+
|
|
99
|
+
/** @public */
|
|
77
100
|
export type ColorConfigState = (typeof COLOR_CONFIG_STATES)[number]
|
|
78
101
|
|
|
102
|
+
/** @internal */
|
|
79
103
|
export const COLOR_CONFIG_INPUT_MODES = ['*', ...THEME_COLOR_INPUT_MODES] as const
|
|
104
|
+
|
|
105
|
+
/** @public */
|
|
80
106
|
export type ColorConfigInputMode = (typeof COLOR_CONFIG_INPUT_MODES)[number]
|
|
81
107
|
|
|
108
|
+
/** @internal */
|
|
82
109
|
export const COLOR_CONFIG_INPUT_STATES = ['*', ...THEME_COLOR_INPUT_STATES] as const
|
|
110
|
+
|
|
111
|
+
/** @public */
|
|
83
112
|
export type ColorConfigInputState = (typeof COLOR_CONFIG_INPUT_STATES)[number]
|
|
@@ -2,8 +2,7 @@ import {ColorHueKey} from '@sanity/color'
|
|
|
2
2
|
import {ThemeColorSyntax, ThemeColorButtonModeKey} from '../../../system'
|
|
3
3
|
import {
|
|
4
4
|
ColorBlendModeTokenValue,
|
|
5
|
-
|
|
6
|
-
ColorConfigBaseTone,
|
|
5
|
+
ColorConfigCardTone,
|
|
7
6
|
ColorConfigInputMode,
|
|
8
7
|
ColorConfigInputState,
|
|
9
8
|
ColorConfigState,
|
|
@@ -11,57 +10,89 @@ import {
|
|
|
11
10
|
ThemeColorTokenValue,
|
|
12
11
|
} from '../../system'
|
|
13
12
|
|
|
14
|
-
export interface
|
|
13
|
+
export interface ThemeColorAvatarHueTokens {
|
|
15
14
|
_blend?: ColorBlendModeTokenValue
|
|
16
15
|
_hue?: ColorHueKey
|
|
17
16
|
bg?: ThemeColorTokenValue
|
|
18
17
|
fg?: ThemeColorTokenValue
|
|
19
18
|
}
|
|
20
19
|
|
|
20
|
+
export interface ThemeColorAvatarTokens {
|
|
21
|
+
'*'?: ThemeColorAvatarHueTokens
|
|
22
|
+
gray?: ThemeColorAvatarHueTokens
|
|
23
|
+
blue?: ThemeColorAvatarHueTokens
|
|
24
|
+
purple?: ThemeColorAvatarHueTokens
|
|
25
|
+
magenta?: ThemeColorAvatarHueTokens
|
|
26
|
+
red?: ThemeColorAvatarHueTokens
|
|
27
|
+
orange?: ThemeColorAvatarHueTokens
|
|
28
|
+
yellow?: ThemeColorAvatarHueTokens
|
|
29
|
+
green?: ThemeColorAvatarHueTokens
|
|
30
|
+
cyan?: ThemeColorAvatarHueTokens
|
|
31
|
+
}
|
|
32
|
+
|
|
21
33
|
export interface ThemeColorBadgeTokens {
|
|
22
|
-
_blend?: ColorBlendModeTokenValue
|
|
34
|
+
// _blend?: ColorBlendModeTokenValue
|
|
23
35
|
_hue?: ColorHueKey
|
|
24
36
|
bg?: ThemeColorTokenValue
|
|
25
37
|
fg?: ThemeColorTokenValue
|
|
38
|
+
dot?: ThemeColorTokenValue
|
|
39
|
+
icon?: ThemeColorTokenValue
|
|
26
40
|
}
|
|
27
41
|
|
|
28
|
-
export interface ThemeColorBaseTokens {
|
|
29
|
-
_blend?: ColorBlendModeTokenValue
|
|
30
|
-
_hue?: ColorHueKey
|
|
31
|
-
bg?: ThemeColorTokenValue
|
|
32
|
-
fg?: ThemeColorTokenValue
|
|
33
|
-
border?: ThemeColorTokenValue
|
|
42
|
+
export interface ThemeColorBaseTokens extends ThemeColorStateTokens {
|
|
34
43
|
focusRing?: ThemeColorTokenValue
|
|
44
|
+
backdrop?: ThemeColorTokenValue
|
|
35
45
|
shadow?: {
|
|
36
46
|
outline?: ThemeColorTokenValue
|
|
37
47
|
umbra?: ThemeColorTokenValue
|
|
38
48
|
penumbra?: ThemeColorTokenValue
|
|
39
49
|
ambient?: ThemeColorTokenValue
|
|
40
50
|
}
|
|
41
|
-
skeleton?: {
|
|
42
|
-
from?: ThemeColorTokenValue
|
|
43
|
-
to?: ThemeColorTokenValue
|
|
44
|
-
}
|
|
45
51
|
}
|
|
46
52
|
|
|
47
|
-
export interface
|
|
53
|
+
export interface ThemeColorBadgeToneTokens {
|
|
48
54
|
_blend?: ColorBlendModeTokenValue
|
|
49
55
|
_hue?: ColorHueKey
|
|
50
56
|
bg?: ThemeColorTokenValue
|
|
51
|
-
|
|
57
|
+
dot?: ThemeColorTokenValue
|
|
52
58
|
fg?: ThemeColorTokenValue
|
|
53
59
|
icon?: ThemeColorTokenValue
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface ThemeColorBadgeTokens {
|
|
63
|
+
'*'?: ThemeColorBadgeToneTokens
|
|
64
|
+
default?: ThemeColorBadgeToneTokens
|
|
65
|
+
primary?: ThemeColorBadgeToneTokens
|
|
66
|
+
positive?: ThemeColorBadgeToneTokens
|
|
67
|
+
caution?: ThemeColorBadgeToneTokens
|
|
68
|
+
critical?: ThemeColorBadgeToneTokens
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface ThemeColorStateTokens {
|
|
72
|
+
_blend?: ColorBlendModeTokenValue
|
|
73
|
+
_hue?: ColorHueKey
|
|
74
|
+
accent?: {
|
|
75
|
+
fg?: ThemeColorTokenValue
|
|
76
|
+
}
|
|
77
|
+
avatar?: ThemeColorAvatarTokens
|
|
78
|
+
badge?: ThemeColorBadgeTokens
|
|
79
|
+
bg?: ThemeColorTokenValue
|
|
54
80
|
border?: ThemeColorTokenValue
|
|
55
|
-
|
|
81
|
+
code?: {
|
|
82
|
+
bg?: ThemeColorTokenValue
|
|
56
83
|
fg?: ThemeColorTokenValue
|
|
57
84
|
}
|
|
58
|
-
|
|
85
|
+
fg?: ThemeColorTokenValue
|
|
86
|
+
icon?: ThemeColorTokenValue
|
|
87
|
+
kbd?: {
|
|
88
|
+
bg?: ThemeColorTokenValue
|
|
59
89
|
fg?: ThemeColorTokenValue
|
|
90
|
+
border?: ThemeColorTokenValue
|
|
60
91
|
}
|
|
61
92
|
link?: {
|
|
62
93
|
fg?: ThemeColorTokenValue
|
|
63
94
|
}
|
|
64
|
-
|
|
95
|
+
muted?: {
|
|
65
96
|
bg?: ThemeColorTokenValue
|
|
66
97
|
fg?: ThemeColorTokenValue
|
|
67
98
|
}
|
|
@@ -82,9 +113,11 @@ export interface ThemeColorInputStateTokens {
|
|
|
82
113
|
_blend?: ColorBlendModeTokenValue
|
|
83
114
|
_hue?: ColorHueKey
|
|
84
115
|
bg?: ThemeColorTokenValue
|
|
85
|
-
bg2?: ThemeColorTokenValue
|
|
86
|
-
fg?: ThemeColorTokenValue
|
|
87
116
|
border?: ThemeColorTokenValue
|
|
117
|
+
fg?: ThemeColorTokenValue
|
|
118
|
+
muted?: {
|
|
119
|
+
bg?: ThemeColorTokenValue
|
|
120
|
+
}
|
|
88
121
|
placeholder?: ThemeColorTokenValue
|
|
89
122
|
}
|
|
90
123
|
|
|
@@ -94,19 +127,9 @@ export interface ThemeColorInputTokens
|
|
|
94
127
|
}
|
|
95
128
|
|
|
96
129
|
export interface ThemeColorTokens {
|
|
97
|
-
|
|
98
|
-
badge?: Partial<Record<ColorConfigStateTone, ThemeColorBadgeTokens>>
|
|
99
|
-
base?: Partial<Record<ColorConfigBaseTone, ThemeColorBaseTokens>>
|
|
130
|
+
base?: Partial<Record<ColorConfigCardTone, ThemeColorBaseTokens>>
|
|
100
131
|
button?: Partial<Record<ThemeColorButtonModeKey, ThemeColorButtonTokens>>
|
|
101
|
-
card?: Partial<Record<ColorConfigState, ThemeColorStateTokens>>
|
|
102
132
|
input?: Partial<Record<ColorConfigInputMode, ThemeColorInputTokens>>
|
|
103
|
-
kbd?: {
|
|
104
|
-
_blend?: ColorBlendModeTokenValue
|
|
105
|
-
bg?: ThemeColorTokenValue
|
|
106
|
-
fg?: ThemeColorTokenValue
|
|
107
|
-
border?: ThemeColorTokenValue
|
|
108
|
-
}
|
|
109
133
|
selectable?: Partial<Record<ColorConfigStateTone, {_hue?: ColorHueKey} & ThemeColorStatesTokens>>
|
|
110
|
-
spot?: Partial<Record<ColorHueKey, ThemeColorTokenValue>>
|
|
111
134
|
syntax?: Partial<Record<keyof ThemeColorSyntax, ThemeColorTokenValue>>
|
|
112
135
|
}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import {ColorHueKey, ColorTintKey} from '@sanity/color'
|
|
2
2
|
import {ThemeColorBlendModeKey, ThemeColorButtonModeKey} from '../../system'
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
ColorConfigCardKey,
|
|
5
|
+
ColorConfigCardTone,
|
|
6
6
|
ColorConfigBlendKey,
|
|
7
7
|
ColorConfigStateKey,
|
|
8
8
|
ColorConfigStateTone,
|
|
9
9
|
} from '../system'
|
|
10
10
|
|
|
11
|
+
/** @internal */
|
|
11
12
|
export interface TokenBaseKeyNode {
|
|
12
13
|
type: 'base'
|
|
13
|
-
tone:
|
|
14
|
-
key:
|
|
14
|
+
tone: ColorConfigCardTone
|
|
15
|
+
key: ColorConfigCardKey | ColorConfigBlendKey
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
/** @internal */
|
|
17
19
|
export interface TokenButtonKeyNode {
|
|
18
20
|
type: 'button'
|
|
19
21
|
tone: ColorConfigStateTone
|
|
@@ -21,8 +23,10 @@ export interface TokenButtonKeyNode {
|
|
|
21
23
|
key: ColorConfigStateKey | ColorConfigBlendKey
|
|
22
24
|
}
|
|
23
25
|
|
|
26
|
+
/** @internal */
|
|
24
27
|
export type TokenKeyNode = TokenBaseKeyNode | TokenButtonKeyNode
|
|
25
28
|
|
|
29
|
+
/** @internal */
|
|
26
30
|
export interface TokenColorValueNode {
|
|
27
31
|
type: 'color'
|
|
28
32
|
key?: 'black' | 'white' | `${ColorHueKey}/${ColorTintKey}` | ColorTintKey
|
|
@@ -31,14 +35,17 @@ export interface TokenColorValueNode {
|
|
|
31
35
|
opacity?: number
|
|
32
36
|
}
|
|
33
37
|
|
|
38
|
+
/** @internal */
|
|
34
39
|
export interface TokenHueValueNode {
|
|
35
40
|
type: 'hue'
|
|
36
41
|
value?: ColorHueKey
|
|
37
42
|
}
|
|
38
43
|
|
|
44
|
+
/** @internal */
|
|
39
45
|
export interface TokenBlendModeValueNode {
|
|
40
46
|
type: 'blendMode'
|
|
41
47
|
value?: ThemeColorBlendModeKey
|
|
42
48
|
}
|
|
43
49
|
|
|
50
|
+
/** @internal */
|
|
44
51
|
export type TokenValueNode = TokenColorValueNode | TokenHueValueNode | TokenBlendModeValueNode
|
|
@@ -11,11 +11,13 @@ import {
|
|
|
11
11
|
} from '../system'
|
|
12
12
|
import {ThemeColorTokens} from './tokens'
|
|
13
13
|
|
|
14
|
+
/** @public */
|
|
14
15
|
export type ThemeColorPalette = {
|
|
15
16
|
black: string | ColorPaletteValue
|
|
16
17
|
white: string | ColorPaletteValue
|
|
17
18
|
} & Record<ColorHueKey, Record<ColorTintKey, string | ColorPaletteValue>>
|
|
18
19
|
|
|
20
|
+
/** @public */
|
|
19
21
|
export interface ThemeConfig {
|
|
20
22
|
avatar?: ThemeAvatar
|
|
21
23
|
button?: {
|
|
@@ -30,22 +32,14 @@ export interface ThemeConfig {
|
|
|
30
32
|
}
|
|
31
33
|
color?: ThemeColorTokens
|
|
32
34
|
container?: number[]
|
|
33
|
-
/** @deprecated Use component-specific `focusRing` values instead */
|
|
34
|
-
focusRing?: {
|
|
35
|
-
offset: number
|
|
36
|
-
width: number
|
|
37
|
-
}
|
|
38
35
|
fonts?: ThemeFonts
|
|
39
36
|
input?: ThemeInput
|
|
40
|
-
/**
|
|
41
|
-
* THIS API MAY BE UNSTABLE. DO NOT USE IN PRODUCTION.
|
|
42
|
-
* @beta
|
|
43
|
-
*/
|
|
44
37
|
layer?: ThemeLayer
|
|
45
38
|
media?: number[]
|
|
46
39
|
palette?: ThemeColorPalette
|
|
47
40
|
radius?: number[]
|
|
48
|
-
|
|
41
|
+
shadow?: Array<ThemeShadow | null>
|
|
49
42
|
space?: number[]
|
|
50
|
-
|
|
43
|
+
/** @internal */
|
|
44
|
+
style?: ThemeStyles
|
|
51
45
|
}
|