@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,38 +1,38 @@
|
|
|
1
1
|
import {COLOR_HUES} from '@sanity/color'
|
|
2
2
|
|
|
3
|
-
/** @
|
|
3
|
+
/** @public */
|
|
4
4
|
export const THEME_COLOR_BLEND_MODES = ['multiply', 'screen'] as const
|
|
5
5
|
|
|
6
|
-
/** @
|
|
7
|
-
export const
|
|
6
|
+
/** @public */
|
|
7
|
+
export const THEME_COLOR_CARD_TONES = [
|
|
8
8
|
'transparent',
|
|
9
9
|
'default',
|
|
10
|
-
'primary', // todo: rename to `accent`
|
|
10
|
+
'primary', // todo: rename to `accent` in the next breaking major version
|
|
11
11
|
'positive',
|
|
12
12
|
'caution',
|
|
13
13
|
'critical',
|
|
14
14
|
] as const
|
|
15
15
|
|
|
16
|
-
/** @
|
|
16
|
+
/** @public */
|
|
17
17
|
export const THEME_COLOR_STATE_TONES = [
|
|
18
18
|
'default',
|
|
19
|
-
'primary', // todo: rename to `accent`
|
|
19
|
+
'primary', // todo: rename to `accent` in the next breaking major version
|
|
20
20
|
'positive',
|
|
21
21
|
'caution',
|
|
22
22
|
'critical',
|
|
23
23
|
] as const
|
|
24
24
|
|
|
25
|
-
/** @
|
|
25
|
+
/** @public */
|
|
26
26
|
export const THEME_COLOR_STATES = ['enabled', 'hovered', 'pressed', 'selected', 'disabled'] as const
|
|
27
27
|
|
|
28
|
-
/** @
|
|
28
|
+
/** @public */
|
|
29
29
|
export const THEME_COLOR_BUTTON_MODES = ['default', 'ghost', 'bleed'] as const
|
|
30
30
|
|
|
31
|
-
/** @
|
|
31
|
+
/** @public */
|
|
32
32
|
export const THEME_COLOR_INPUT_MODES = ['default', 'invalid'] as const
|
|
33
33
|
|
|
34
|
-
/** @
|
|
34
|
+
/** @public */
|
|
35
35
|
export const THEME_COLOR_INPUT_STATES = ['enabled', 'hovered', 'readOnly', 'disabled'] as const
|
|
36
36
|
|
|
37
|
-
/** @
|
|
37
|
+
/** @public */
|
|
38
38
|
export const THEME_COLOR_AVATAR_COLORS = COLOR_HUES
|
|
@@ -1,100 +1,39 @@
|
|
|
1
1
|
import {
|
|
2
2
|
THEME_COLOR_AVATAR_COLORS,
|
|
3
|
-
THEME_COLOR_BASE_TONES,
|
|
4
3
|
THEME_COLOR_BLEND_MODES,
|
|
5
4
|
THEME_COLOR_BUTTON_MODES,
|
|
5
|
+
THEME_COLOR_CARD_TONES,
|
|
6
6
|
THEME_COLOR_INPUT_MODES,
|
|
7
7
|
THEME_COLOR_INPUT_STATES,
|
|
8
8
|
THEME_COLOR_STATES,
|
|
9
9
|
THEME_COLOR_STATE_TONES,
|
|
10
10
|
} from './_constants'
|
|
11
|
-
import {ThemeColorMuted} from './_deprecated/muted'
|
|
12
|
-
import {ThemeColorSolid} from './_deprecated/solid'
|
|
13
|
-
import {ThemeColorSpot} from './_deprecated/spot'
|
|
14
|
-
import {ThemeColorAvatar} from './avatar'
|
|
15
|
-
import {ThemeColorBadge} from './badge'
|
|
16
|
-
import {ThemeColorBase} from './base'
|
|
17
|
-
import {ThemeColorButton} from './button'
|
|
18
|
-
import {ThemeColorCard} from './card'
|
|
19
|
-
import {ThemeColorInput} from './input'
|
|
20
|
-
import {ThemeColorKBD} from './kbd'
|
|
21
|
-
import {ThemeColorSelectable} from './selectable'
|
|
22
|
-
import {ThemeColorSyntax} from './syntax'
|
|
23
11
|
|
|
24
12
|
/**
|
|
25
13
|
* @public
|
|
26
14
|
*/
|
|
27
15
|
export type ThemeColorSchemeKey = 'dark' | 'light'
|
|
28
16
|
|
|
29
|
-
/** @
|
|
17
|
+
/** @public */
|
|
30
18
|
export type ThemeColorBlendModeKey = (typeof THEME_COLOR_BLEND_MODES)[number]
|
|
31
19
|
|
|
32
|
-
/** @
|
|
33
|
-
export type
|
|
20
|
+
/** @public */
|
|
21
|
+
export type ThemeColorCardToneKey = (typeof THEME_COLOR_CARD_TONES)[number]
|
|
34
22
|
|
|
35
|
-
/** @
|
|
23
|
+
/** @public */
|
|
36
24
|
export type ThemeColorButtonModeKey = (typeof THEME_COLOR_BUTTON_MODES)[number]
|
|
37
25
|
|
|
38
|
-
/** @
|
|
26
|
+
/** @public */
|
|
39
27
|
export type ThemeColorStateKey = (typeof THEME_COLOR_STATES)[number]
|
|
40
28
|
|
|
41
|
-
/** @
|
|
29
|
+
/** @public */
|
|
42
30
|
export type ThemeColorStateToneKey = (typeof THEME_COLOR_STATE_TONES)[number]
|
|
43
31
|
|
|
44
|
-
/** @
|
|
32
|
+
/** @public */
|
|
45
33
|
export type ThemeColorInputModeKey = (typeof THEME_COLOR_INPUT_MODES)[number]
|
|
46
34
|
|
|
47
|
-
/** @
|
|
35
|
+
/** @public */
|
|
48
36
|
export type ThemeColorInputStateKey = (typeof THEME_COLOR_INPUT_STATES)[number]
|
|
49
37
|
|
|
50
|
-
/** @
|
|
38
|
+
/** @public */
|
|
51
39
|
export type ThemeColorAvatarColorKey = (typeof THEME_COLOR_AVATAR_COLORS)[number]
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @public
|
|
55
|
-
* @deprecated Use `ThemeColorBaseToneKey` instead.
|
|
56
|
-
*/
|
|
57
|
-
export type ThemeColorName = ThemeColorBaseToneKey
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @public
|
|
61
|
-
* @deprecated Use `ThemeColorBaseToneKey` instead.
|
|
62
|
-
*/
|
|
63
|
-
export type ThemeColorToneKey = ThemeColorBaseToneKey
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* @public
|
|
67
|
-
*/
|
|
68
|
-
export interface ThemeColor {
|
|
69
|
-
/** @internal */
|
|
70
|
-
_blend?: ThemeColorBlendModeKey
|
|
71
|
-
_dark?: boolean
|
|
72
|
-
avatar?: ThemeColorAvatar
|
|
73
|
-
badge?: ThemeColorBadge
|
|
74
|
-
base: ThemeColorBase
|
|
75
|
-
button: ThemeColorButton
|
|
76
|
-
card: ThemeColorCard
|
|
77
|
-
input: ThemeColorInput
|
|
78
|
-
kbd?: ThemeColorKBD
|
|
79
|
-
selectable?: ThemeColorSelectable
|
|
80
|
-
syntax: ThemeColorSyntax
|
|
81
|
-
|
|
82
|
-
/** @deprecated Use `_dark` instead */
|
|
83
|
-
dark: boolean
|
|
84
|
-
/** @deprecated */
|
|
85
|
-
muted: ThemeColorMuted
|
|
86
|
-
/** @deprecated */
|
|
87
|
-
spot: ThemeColorSpot
|
|
88
|
-
/** @deprecated */
|
|
89
|
-
solid: ThemeColorSolid
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* @public
|
|
94
|
-
*/
|
|
95
|
-
export type ThemeColorScheme = Record<ThemeColorBaseToneKey, ThemeColor>
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* @public
|
|
99
|
-
*/
|
|
100
|
-
export type ThemeColorSchemes = Record<ThemeColorSchemeKey, ThemeColorScheme>
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import {ThemeColorBlendModeKey} from './_system'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface ThemeColorAvatarHue_v2 {
|
|
7
|
+
_blend?: ThemeColorBlendModeKey
|
|
8
|
+
bg: string
|
|
9
|
+
fg: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export interface ThemeColorAvatar_v2 {
|
|
16
|
+
gray: ThemeColorAvatarHue_v2
|
|
17
|
+
blue: ThemeColorAvatarHue_v2
|
|
18
|
+
purple: ThemeColorAvatarHue_v2
|
|
19
|
+
magenta: ThemeColorAvatarHue_v2
|
|
20
|
+
red: ThemeColorAvatarHue_v2
|
|
21
|
+
orange: ThemeColorAvatarHue_v2
|
|
22
|
+
yellow: ThemeColorAvatarHue_v2
|
|
23
|
+
green: ThemeColorAvatarHue_v2
|
|
24
|
+
cyan: ThemeColorAvatarHue_v2
|
|
13
25
|
}
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @public
|
|
3
|
+
*/
|
|
4
|
+
export interface ThemeColorBadgeTone_v2 {
|
|
5
|
+
bg: string
|
|
6
|
+
fg: string
|
|
7
|
+
dot: string
|
|
8
|
+
icon: string
|
|
9
|
+
}
|
|
2
10
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export interface ThemeColorBadge_v2 {
|
|
15
|
+
default: ThemeColorBadgeTone_v2
|
|
16
|
+
primary: ThemeColorBadgeTone_v2
|
|
17
|
+
positive: ThemeColorBadgeTone_v2
|
|
18
|
+
caution: ThemeColorBadgeTone_v2
|
|
19
|
+
critical: ThemeColorBadgeTone_v2
|
|
9
20
|
}
|
|
@@ -1,39 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {ThemeColorState_v2} from './state'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @deprecated Use `ThemeColorGenericState` instead.
|
|
5
4
|
* @public
|
|
6
5
|
*/
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
enabled: ThemeColorGenericState
|
|
14
|
-
hovered: ThemeColorGenericState
|
|
15
|
-
pressed: ThemeColorGenericState
|
|
16
|
-
selected: ThemeColorGenericState
|
|
17
|
-
disabled: ThemeColorGenericState
|
|
6
|
+
export interface ThemeColorButtonStates_v2 {
|
|
7
|
+
enabled: ThemeColorState_v2
|
|
8
|
+
hovered: ThemeColorState_v2
|
|
9
|
+
pressed: ThemeColorState_v2
|
|
10
|
+
selected: ThemeColorState_v2
|
|
11
|
+
disabled: ThemeColorState_v2
|
|
18
12
|
}
|
|
19
13
|
|
|
20
14
|
/**
|
|
21
15
|
* TODO: Rename to `ThemeColorButtonMode`.
|
|
22
16
|
* @public
|
|
23
17
|
*/
|
|
24
|
-
export interface
|
|
25
|
-
default:
|
|
26
|
-
primary:
|
|
27
|
-
positive:
|
|
28
|
-
caution:
|
|
29
|
-
critical:
|
|
18
|
+
export interface ThemeColorButtonTones_v2 {
|
|
19
|
+
default: ThemeColorButtonStates_v2
|
|
20
|
+
primary: ThemeColorButtonStates_v2
|
|
21
|
+
positive: ThemeColorButtonStates_v2
|
|
22
|
+
caution: ThemeColorButtonStates_v2
|
|
23
|
+
critical: ThemeColorButtonStates_v2
|
|
30
24
|
}
|
|
31
25
|
|
|
32
26
|
/**
|
|
33
27
|
* @public
|
|
34
28
|
*/
|
|
35
|
-
export interface
|
|
36
|
-
default:
|
|
37
|
-
ghost:
|
|
38
|
-
bleed:
|
|
29
|
+
export interface ThemeColorButton_v2 {
|
|
30
|
+
default: ThemeColorButtonTones_v2
|
|
31
|
+
ghost: ThemeColorButtonTones_v2
|
|
32
|
+
bleed: ThemeColorButtonTones_v2
|
|
39
33
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {ThemeColorCardToneKey, ThemeColorBlendModeKey, ThemeColorSchemeKey} from './_system'
|
|
2
|
+
import {ThemeColorButton_v2} from './button'
|
|
3
|
+
import {ThemeColorInput_v2} from './input'
|
|
4
|
+
import {ThemeColorSelectable_v2} from './selectable'
|
|
5
|
+
import {ThemeColorShadow} from './shadow'
|
|
6
|
+
import {ThemeColorState_v2} from './state'
|
|
7
|
+
import {ThemeColorSyntax} from './syntax'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export interface ThemeColorCard_v2 extends ThemeColorState_v2 {
|
|
13
|
+
/** @internal */
|
|
14
|
+
_blend: ThemeColorBlendModeKey
|
|
15
|
+
_dark: boolean
|
|
16
|
+
|
|
17
|
+
backdrop: string
|
|
18
|
+
button: ThemeColorButton_v2
|
|
19
|
+
focusRing: string
|
|
20
|
+
input: ThemeColorInput_v2
|
|
21
|
+
selectable: ThemeColorSelectable_v2
|
|
22
|
+
shadow: ThemeColorShadow
|
|
23
|
+
syntax: ThemeColorSyntax
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export type ThemeColorScheme_v2 = Record<ThemeColorCardToneKey, ThemeColorCard_v2>
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
export type ThemeColorSchemes_v2 = Record<ThemeColorSchemeKey, ThemeColorScheme_v2>
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
export * from './_constants'
|
|
2
2
|
export * from './_helpers'
|
|
3
3
|
export * from './_system'
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
export * from './_generic'
|
|
7
4
|
export * from './avatar'
|
|
8
5
|
export * from './badge'
|
|
9
|
-
export * from './base'
|
|
10
6
|
export * from './button'
|
|
11
|
-
export * from './
|
|
7
|
+
export * from './color'
|
|
12
8
|
export * from './input'
|
|
13
9
|
export * from './kbd'
|
|
14
10
|
export * from './selectable'
|
|
11
|
+
export * from './shadow'
|
|
12
|
+
export * from './state'
|
|
15
13
|
export * from './syntax'
|
|
16
|
-
|
|
17
|
-
// deprecated
|
|
18
|
-
export * from './_deprecated/muted'
|
|
19
|
-
export * from './_deprecated/solid'
|
|
20
|
-
export * from './_deprecated/spot'
|
|
@@ -3,29 +3,31 @@ import {ThemeColorBlendModeKey} from './_system'
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
6
|
+
export interface ThemeColorInputState_v2 {
|
|
7
7
|
_blend?: ThemeColorBlendModeKey
|
|
8
8
|
bg: string
|
|
9
|
-
bg2: string
|
|
10
|
-
fg: string
|
|
11
9
|
border: string
|
|
10
|
+
fg: string
|
|
11
|
+
muted: {
|
|
12
|
+
bg: string
|
|
13
|
+
}
|
|
12
14
|
placeholder: string
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* @public
|
|
17
19
|
*/
|
|
18
|
-
export interface
|
|
19
|
-
enabled:
|
|
20
|
-
disabled:
|
|
21
|
-
hovered:
|
|
22
|
-
readOnly:
|
|
20
|
+
export interface ThemeColorInputStates_v2 {
|
|
21
|
+
enabled: ThemeColorInputState_v2
|
|
22
|
+
disabled: ThemeColorInputState_v2
|
|
23
|
+
hovered: ThemeColorInputState_v2
|
|
24
|
+
readOnly: ThemeColorInputState_v2
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
/**
|
|
26
28
|
* @public
|
|
27
29
|
*/
|
|
28
|
-
export interface
|
|
29
|
-
default:
|
|
30
|
-
invalid:
|
|
30
|
+
export interface ThemeColorInput_v2 {
|
|
31
|
+
default: ThemeColorInputStates_v2
|
|
32
|
+
invalid: ThemeColorInputStates_v2
|
|
31
33
|
}
|
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {ThemeColorState_v2} from './state'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @deprecated Use `ThemeColorGenericState` instead.
|
|
5
4
|
* @public
|
|
6
5
|
*/
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
enabled: ThemeColorSelectableState
|
|
14
|
-
hovered: ThemeColorSelectableState
|
|
15
|
-
pressed: ThemeColorSelectableState
|
|
16
|
-
selected: ThemeColorSelectableState
|
|
17
|
-
disabled: ThemeColorSelectableState
|
|
6
|
+
export interface ThemeColorSelectableStates_v2 {
|
|
7
|
+
enabled: ThemeColorState_v2
|
|
8
|
+
hovered: ThemeColorState_v2
|
|
9
|
+
pressed: ThemeColorState_v2
|
|
10
|
+
selected: ThemeColorState_v2
|
|
11
|
+
disabled: ThemeColorState_v2
|
|
18
12
|
}
|
|
19
13
|
|
|
20
14
|
/**
|
|
21
15
|
* @public
|
|
22
16
|
*/
|
|
23
|
-
export interface
|
|
24
|
-
default:
|
|
25
|
-
primary:
|
|
26
|
-
positive:
|
|
27
|
-
caution:
|
|
28
|
-
critical:
|
|
17
|
+
export interface ThemeColorSelectable_v2 {
|
|
18
|
+
default: ThemeColorSelectableStates_v2
|
|
19
|
+
primary: ThemeColorSelectableStates_v2
|
|
20
|
+
positive: ThemeColorSelectableStates_v2
|
|
21
|
+
caution: ThemeColorSelectableStates_v2
|
|
22
|
+
critical: ThemeColorSelectableStates_v2
|
|
29
23
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {ThemeColorBlendModeKey} from './_system'
|
|
2
|
+
import {ThemeColorAvatar_v2} from './avatar'
|
|
3
|
+
import {ThemeColorBadge_v2} from './badge'
|
|
4
|
+
import {ThemeColorKBD} from './kbd'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export interface ThemeColorState_v2 {
|
|
10
|
+
/** @internal */
|
|
11
|
+
_blend?: ThemeColorBlendModeKey
|
|
12
|
+
accent: {
|
|
13
|
+
fg: string
|
|
14
|
+
}
|
|
15
|
+
avatar: ThemeColorAvatar_v2
|
|
16
|
+
badge: ThemeColorBadge_v2
|
|
17
|
+
bg: string
|
|
18
|
+
border: string
|
|
19
|
+
code: {
|
|
20
|
+
bg: string
|
|
21
|
+
fg: string
|
|
22
|
+
}
|
|
23
|
+
fg: string
|
|
24
|
+
icon: string
|
|
25
|
+
kbd: ThemeColorKBD
|
|
26
|
+
link: {
|
|
27
|
+
fg: string
|
|
28
|
+
}
|
|
29
|
+
muted: {
|
|
30
|
+
bg: string
|
|
31
|
+
fg: string
|
|
32
|
+
}
|
|
33
|
+
skeleton: {
|
|
34
|
+
from: string
|
|
35
|
+
to: string
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type {StyledObject} from 'styled-components'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Work around types that are missing in `styled-components@6`
|
|
5
|
+
* https://github.com/styled-components/styled-components/issues/4062
|
|
6
|
+
* @internal
|
|
7
|
+
* */
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
export type CSSObject = StyledObject<any>
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './v0'
|
|
2
2
|
|
|
3
3
|
export * from './avatar'
|
|
4
4
|
export * from './color'
|
|
5
|
+
export * from './css'
|
|
6
|
+
export * from './focusRing'
|
|
5
7
|
export * from './fonts'
|
|
6
8
|
export * from './input'
|
|
7
9
|
export * from './layer'
|
|
8
10
|
export * from './shadow'
|
|
11
|
+
export * from './styles'
|
|
12
|
+
export * from './theme'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {CSSObject} from './css'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export interface ThemeStyles {
|
|
7
|
+
button?: {
|
|
8
|
+
root?: CSSObject
|
|
9
|
+
}
|
|
10
|
+
card?: {
|
|
11
|
+
root?: CSSObject
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use `ThemeStyles` instead
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export type Styles = ThemeStyles
|