@sanity/ui 2.1.4 → 2.1.5
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.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/theme.esm.js +72 -10
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +72 -10
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +72 -10
- package/dist/theme.mjs.map +1 -1
- package/package.json +15 -15
- package/src/core/primitives/avatar/__workshop__/index.ts +10 -0
- package/src/core/primitives/avatar/__workshop__/withinButton.tsx +62 -0
- package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +69 -0
- package/src/core/theme/__workshop__/debug/story.tsx +256 -51
- package/src/theme/build/renderColorTheme.ts +1 -1
- package/src/theme/defaults/colorTokens.ts +70 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/ui",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"sanity",
|
|
6
6
|
"ui",
|
|
@@ -116,10 +116,10 @@
|
|
|
116
116
|
"@babel/preset-env": "^7.24.4",
|
|
117
117
|
"@babel/preset-react": "^7.24.1",
|
|
118
118
|
"@babel/preset-typescript": "^7.24.1",
|
|
119
|
-
"@commitlint/cli": "^19.
|
|
119
|
+
"@commitlint/cli": "^19.3.0",
|
|
120
120
|
"@commitlint/config-conventional": "^19.2.2",
|
|
121
121
|
"@juggle/resize-observer": "^3.4.0",
|
|
122
|
-
"@sanity/pkg-utils": "^6.
|
|
122
|
+
"@sanity/pkg-utils": "^6.8.10",
|
|
123
123
|
"@sanity/semantic-release-preset": "^4.1.7",
|
|
124
124
|
"@sanity/ui-workshop": "^2.0.12",
|
|
125
125
|
"@storybook/addon-a11y": "^8.0.8",
|
|
@@ -142,15 +142,15 @@
|
|
|
142
142
|
"@types/jest": "^29.5.12",
|
|
143
143
|
"@types/jest-axe": "^3.5.9",
|
|
144
144
|
"@types/node": "^20.12.7",
|
|
145
|
-
"@types/react": "^18.
|
|
146
|
-
"@types/react-dom": "^18.
|
|
147
|
-
"@types/react-is": "^18.
|
|
145
|
+
"@types/react": "^18.3.1",
|
|
146
|
+
"@types/react-dom": "^18.3.0",
|
|
147
|
+
"@types/react-is": "^18.3.0",
|
|
148
148
|
"@types/refractor": "^3.4.1",
|
|
149
149
|
"@types/testing-library__jest-dom": "^5.14.9",
|
|
150
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
151
|
-
"@typescript-eslint/parser": "^7.
|
|
150
|
+
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
|
151
|
+
"@typescript-eslint/parser": "^7.8.0",
|
|
152
152
|
"commitizen": "^4.3.0",
|
|
153
|
-
"cypress": "^13.
|
|
153
|
+
"cypress": "^13.8.1",
|
|
154
154
|
"cypress-real-events": "^1.12.0",
|
|
155
155
|
"cz-conventional-changelog": "^3.3.0",
|
|
156
156
|
"eslint": "^8.57.0",
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
161
161
|
"eslint-plugin-prettier": "^5.1.3",
|
|
162
162
|
"eslint-plugin-react": "^7.34.1",
|
|
163
|
-
"eslint-plugin-react-hooks": "^4.6.
|
|
163
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
164
164
|
"eslint-plugin-storybook": "^0.8.0",
|
|
165
165
|
"http-server": "^14.1.1",
|
|
166
166
|
"husky": "^8.0.3",
|
|
@@ -172,9 +172,9 @@
|
|
|
172
172
|
"npm-run-all2": "^5.0.2",
|
|
173
173
|
"prettier": "^3.2.5",
|
|
174
174
|
"prettier-plugin-packagejson": "^2.5.0",
|
|
175
|
-
"react": "^18.
|
|
176
|
-
"react-dom": "^18.
|
|
177
|
-
"react-is": "^18.
|
|
175
|
+
"react": "^18.3.1",
|
|
176
|
+
"react-dom": "^18.3.1",
|
|
177
|
+
"react-is": "^18.3.1",
|
|
178
178
|
"refractor": "^4.8.1",
|
|
179
179
|
"rimraf": "^5.0.5",
|
|
180
180
|
"semantic-release": "^23.0.8",
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
"styled-components": "^6.1.8",
|
|
184
184
|
"tsconfig-paths": "^4.2.0",
|
|
185
185
|
"typescript": "5.4.5",
|
|
186
|
-
"vite": "^5.2.
|
|
186
|
+
"vite": "^5.2.11",
|
|
187
187
|
"vite-tsconfig-paths": "^4.3.2"
|
|
188
188
|
},
|
|
189
189
|
"peerDependencies": {
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
"react-is": "^18",
|
|
193
193
|
"styled-components": "^5.2 || ^6"
|
|
194
194
|
},
|
|
195
|
-
"packageManager": "pnpm@9.0.
|
|
195
|
+
"packageManager": "pnpm@9.0.6",
|
|
196
196
|
"engines": {
|
|
197
197
|
"node": ">=14.0.0"
|
|
198
198
|
},
|
|
@@ -15,5 +15,15 @@ export default defineScope({
|
|
|
15
15
|
title: 'Avatar stack',
|
|
16
16
|
component: lazy(() => import('./stack')),
|
|
17
17
|
},
|
|
18
|
+
{
|
|
19
|
+
name: 'within-button',
|
|
20
|
+
title: 'Within button',
|
|
21
|
+
component: lazy(() => import('./withinButton')),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'within-menu-item',
|
|
25
|
+
title: 'Within menu item',
|
|
26
|
+
component: lazy(() => import('./withinMenuItem')),
|
|
27
|
+
},
|
|
18
28
|
],
|
|
19
29
|
})
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {useBoolean} from '@sanity/ui-workshop'
|
|
2
|
+
import {Box} from '../../box'
|
|
3
|
+
import {Button} from '../../button'
|
|
4
|
+
import {Container} from '../../container'
|
|
5
|
+
import {Flex} from '../../flex'
|
|
6
|
+
import {Stack} from '../../stack'
|
|
7
|
+
import {Text} from '../../text'
|
|
8
|
+
import {Avatar} from '../avatar'
|
|
9
|
+
import {AvatarStack} from '../avatarStack'
|
|
10
|
+
|
|
11
|
+
export default function WithinButtonStory() {
|
|
12
|
+
const disabled = useBoolean('Disabled', false, 'Props')
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Container width={1}>
|
|
16
|
+
<Stack paddingX={4} paddingY={[5, 6, 7]} space={1}>
|
|
17
|
+
<Button disabled={disabled} padding={1}>
|
|
18
|
+
<Flex align="center" gap={3} padding={2}>
|
|
19
|
+
<Box flex={1}>
|
|
20
|
+
<Text size={1}>Default button</Text>
|
|
21
|
+
</Box>
|
|
22
|
+
<Box flex="none">
|
|
23
|
+
<AvatarStack>
|
|
24
|
+
<Avatar color="blue" initials="AB" />
|
|
25
|
+
<Avatar color="magenta" initials="CD" />
|
|
26
|
+
<Avatar color="purple" initials="EF" />
|
|
27
|
+
</AvatarStack>
|
|
28
|
+
</Box>
|
|
29
|
+
</Flex>
|
|
30
|
+
</Button>
|
|
31
|
+
<Button disabled={disabled} mode="ghost" padding={1}>
|
|
32
|
+
<Flex align="center" gap={3} padding={2}>
|
|
33
|
+
<Box flex={1}>
|
|
34
|
+
<Text size={1}>Ghost button</Text>
|
|
35
|
+
</Box>
|
|
36
|
+
<Box flex="none">
|
|
37
|
+
<AvatarStack>
|
|
38
|
+
<Avatar color="blue" initials="AB" />
|
|
39
|
+
<Avatar color="magenta" initials="CD" />
|
|
40
|
+
<Avatar color="purple" initials="EF" />
|
|
41
|
+
</AvatarStack>
|
|
42
|
+
</Box>
|
|
43
|
+
</Flex>
|
|
44
|
+
</Button>
|
|
45
|
+
<Button disabled={disabled} mode="bleed" padding={1}>
|
|
46
|
+
<Flex align="center" gap={3} padding={2}>
|
|
47
|
+
<Box flex={1}>
|
|
48
|
+
<Text size={1}>Bleed button</Text>
|
|
49
|
+
</Box>
|
|
50
|
+
<Box flex="none">
|
|
51
|
+
<AvatarStack>
|
|
52
|
+
<Avatar color="blue" initials="AB" />
|
|
53
|
+
<Avatar color="magenta" initials="CD" />
|
|
54
|
+
<Avatar color="purple" initials="EF" />
|
|
55
|
+
</AvatarStack>
|
|
56
|
+
</Box>
|
|
57
|
+
</Flex>
|
|
58
|
+
</Button>
|
|
59
|
+
</Stack>
|
|
60
|
+
</Container>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {useBoolean} from '@sanity/ui-workshop'
|
|
2
|
+
import {Menu, MenuItem} from '../../../components'
|
|
3
|
+
import {Layer} from '../../../utils'
|
|
4
|
+
import {Box} from '../../box'
|
|
5
|
+
import {Card} from '../../card'
|
|
6
|
+
import {Container} from '../../container'
|
|
7
|
+
import {Flex} from '../../flex'
|
|
8
|
+
import {Text} from '../../text'
|
|
9
|
+
import {Avatar} from '../avatar'
|
|
10
|
+
import {AvatarStack} from '../avatarStack'
|
|
11
|
+
|
|
12
|
+
export default function WithinMenuItemStory() {
|
|
13
|
+
const disabled = useBoolean('Disabled', false, 'Props')
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Container width={1}>
|
|
17
|
+
<Layer>
|
|
18
|
+
<Box paddingX={4} paddingY={[5, 6, 7]}>
|
|
19
|
+
<Card radius={3} shadow={3}>
|
|
20
|
+
<Menu space={1}>
|
|
21
|
+
<MenuItem disabled={disabled} padding={0}>
|
|
22
|
+
<Flex align="center" gap={2} padding={2}>
|
|
23
|
+
<Box flex={1}>
|
|
24
|
+
<Text size={1}>Menu item 1</Text>
|
|
25
|
+
</Box>
|
|
26
|
+
<Box flex="none">
|
|
27
|
+
<AvatarStack>
|
|
28
|
+
<Avatar color="blue" initials="AB" />
|
|
29
|
+
<Avatar color="magenta" initials="CD" />
|
|
30
|
+
<Avatar color="purple" initials="EF" />
|
|
31
|
+
</AvatarStack>
|
|
32
|
+
</Box>
|
|
33
|
+
</Flex>
|
|
34
|
+
</MenuItem>
|
|
35
|
+
<MenuItem disabled={disabled} padding={0}>
|
|
36
|
+
<Flex align="center" gap={2} padding={2}>
|
|
37
|
+
<Box flex={1}>
|
|
38
|
+
<Text size={1}>Menu item 1</Text>
|
|
39
|
+
</Box>
|
|
40
|
+
<Box flex="none">
|
|
41
|
+
<AvatarStack>
|
|
42
|
+
<Avatar color="blue" initials="AB" />
|
|
43
|
+
<Avatar color="magenta" initials="CD" />
|
|
44
|
+
<Avatar color="purple" initials="EF" />
|
|
45
|
+
</AvatarStack>
|
|
46
|
+
</Box>
|
|
47
|
+
</Flex>
|
|
48
|
+
</MenuItem>
|
|
49
|
+
<MenuItem disabled={disabled} padding={0}>
|
|
50
|
+
<Flex align="center" gap={2} padding={2}>
|
|
51
|
+
<Box flex={1}>
|
|
52
|
+
<Text size={1}>Menu item 1</Text>
|
|
53
|
+
</Box>
|
|
54
|
+
<Box flex="none">
|
|
55
|
+
<AvatarStack>
|
|
56
|
+
<Avatar color="blue" initials="AB" />
|
|
57
|
+
<Avatar color="magenta" initials="CD" />
|
|
58
|
+
<Avatar color="purple" initials="EF" />
|
|
59
|
+
</AvatarStack>
|
|
60
|
+
</Box>
|
|
61
|
+
</Flex>
|
|
62
|
+
</MenuItem>
|
|
63
|
+
</Menu>
|
|
64
|
+
</Card>
|
|
65
|
+
</Box>
|
|
66
|
+
</Layer>
|
|
67
|
+
</Container>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
@@ -1,69 +1,93 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
|
|
1
3
|
import {CropIcon} from '@sanity/icons'
|
|
2
4
|
import {
|
|
3
5
|
THEME_COLOR_BUTTON_MODES,
|
|
4
|
-
THEME_COLOR_CARD_TONES,
|
|
5
|
-
THEME_COLOR_SCHEMES,
|
|
6
6
|
THEME_COLOR_STATES,
|
|
7
7
|
THEME_COLOR_STATE_TONES,
|
|
8
|
+
ThemeColorCardToneKey,
|
|
8
9
|
ThemeColorCard_v2,
|
|
10
|
+
ThemeColorSchemeKey,
|
|
9
11
|
ThemeColorScheme_v2,
|
|
10
12
|
ThemeColorState_v2,
|
|
11
13
|
} from '@sanity/ui/theme'
|
|
12
|
-
import {useBoolean} from '@sanity/ui-workshop'
|
|
13
|
-
import {CSSProperties} from 'react'
|
|
14
|
+
import {useBoolean, useSelect} from '@sanity/ui-workshop'
|
|
15
|
+
import {CSSProperties, useMemo} from 'react'
|
|
14
16
|
import {Badge, Box, Flex, KBD, Stack, Text} from '../../../primitives'
|
|
15
17
|
import {useRootTheme} from '../../useRootTheme'
|
|
16
18
|
|
|
19
|
+
interface Features {
|
|
20
|
+
base: boolean
|
|
21
|
+
button: boolean
|
|
22
|
+
schemes: ThemeColorSchemeKey[]
|
|
23
|
+
selectable: boolean
|
|
24
|
+
tones: ThemeColorCardToneKey[]
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const SCHEME_OPTIONS: {[key: string]: ThemeColorSchemeKey | 'all'} = {
|
|
28
|
+
All: 'all',
|
|
29
|
+
Dark: 'dark',
|
|
30
|
+
Light: 'light',
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const TONE_OPTIONS: {[key: string]: ThemeColorCardToneKey | 'all'} = {
|
|
34
|
+
All: 'all',
|
|
35
|
+
Transparent: 'transparent',
|
|
36
|
+
Default: 'default',
|
|
37
|
+
Primary: 'primary',
|
|
38
|
+
Positive: 'positive',
|
|
39
|
+
Caution: 'caution',
|
|
40
|
+
Critical: 'critical',
|
|
41
|
+
}
|
|
42
|
+
|
|
17
43
|
export default function DebugStory() {
|
|
18
44
|
const {color} = useRootTheme().theme.v2!
|
|
19
45
|
|
|
46
|
+
const scheme = useSelect('Color scheme', SCHEME_OPTIONS, 'all', 'Props') || 'all'
|
|
47
|
+
const tone = useSelect('Tone', TONE_OPTIONS, 'default', 'Props') || 'all'
|
|
48
|
+
|
|
49
|
+
const base = useBoolean('Base', true, 'Props') || false
|
|
50
|
+
const button = useBoolean('Button', false, 'Props') || false
|
|
51
|
+
const selectable = useBoolean('Selectable', false, 'Props') || false
|
|
52
|
+
|
|
53
|
+
const features: Features = useMemo(
|
|
54
|
+
() => ({
|
|
55
|
+
base,
|
|
56
|
+
button,
|
|
57
|
+
schemes: scheme == 'all' ? ['light', 'dark'] : [scheme],
|
|
58
|
+
selectable,
|
|
59
|
+
tones: tone == 'all' ? ['transparent', 'default'] : [tone],
|
|
60
|
+
}),
|
|
61
|
+
[base, button, scheme, selectable, tone],
|
|
62
|
+
)
|
|
63
|
+
|
|
20
64
|
return (
|
|
21
65
|
<Flex>
|
|
22
|
-
{
|
|
23
|
-
<DebugScheme key={scheme} scheme={color[scheme]} />
|
|
66
|
+
{features.schemes.map((scheme) => (
|
|
67
|
+
<DebugScheme features={features} key={scheme} scheme={color[scheme]} />
|
|
24
68
|
))}
|
|
25
69
|
</Flex>
|
|
26
70
|
)
|
|
27
71
|
}
|
|
28
72
|
|
|
29
|
-
function DebugScheme(props: {scheme: ThemeColorScheme_v2}) {
|
|
30
|
-
const {scheme} = props
|
|
31
|
-
|
|
32
|
-
const button = useBoolean('Button', false, 'Props') || false
|
|
33
|
-
const selectable = useBoolean('Selectable', false, 'Props') || false
|
|
73
|
+
function DebugScheme(props: {features: Features; scheme: ThemeColorScheme_v2}) {
|
|
74
|
+
const {features, scheme} = props
|
|
34
75
|
|
|
35
76
|
return (
|
|
36
77
|
<Box flex={1} style={{backgroundColor: scheme.default.bg}}>
|
|
37
|
-
{
|
|
38
|
-
<DebugCard card={scheme[tone]} features={
|
|
78
|
+
{features.tones.map((tone) => (
|
|
79
|
+
<DebugCard card={scheme[tone]} features={features} key={tone} />
|
|
39
80
|
))}
|
|
40
81
|
</Box>
|
|
41
82
|
)
|
|
42
83
|
}
|
|
43
84
|
|
|
44
|
-
function DebugCard(props: {
|
|
45
|
-
card: ThemeColorCard_v2
|
|
46
|
-
features: {button: boolean; selectable: boolean}
|
|
47
|
-
}) {
|
|
85
|
+
function DebugCard(props: {card: ThemeColorCard_v2; features: Features}) {
|
|
48
86
|
const {card, features} = props
|
|
49
87
|
|
|
50
|
-
// card.avatar
|
|
51
|
-
// card.backdrop
|
|
52
|
-
// card.badge
|
|
53
|
-
// card.button
|
|
54
|
-
// card.focusRing
|
|
55
|
-
// card.icon
|
|
56
|
-
// card.input
|
|
57
|
-
// card.kbd
|
|
58
|
-
// card.link
|
|
59
|
-
// card.selectable
|
|
60
|
-
// card.shadow
|
|
61
|
-
// card.skeleton
|
|
62
|
-
// card.syntax
|
|
63
|
-
|
|
64
88
|
return (
|
|
65
89
|
<Box style={getStateVars(card)}>
|
|
66
|
-
<DebugState />
|
|
90
|
+
{features.base && <DebugState />}
|
|
67
91
|
|
|
68
92
|
{features.button && (
|
|
69
93
|
<Stack padding={2} space={1}>
|
|
@@ -120,12 +144,19 @@ function DebugState() {
|
|
|
120
144
|
<CropIcon />
|
|
121
145
|
</Text>
|
|
122
146
|
</Flex>
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
|
|
147
|
+
<Box padding={1} style={{backgroundColor: 'var(--card-muted-bg-color)'}}>
|
|
148
|
+
<Text muted size={1}>
|
|
149
|
+
Muted
|
|
150
|
+
</Text>
|
|
151
|
+
</Box>
|
|
126
152
|
<Text accent size={1}>
|
|
127
153
|
Accent
|
|
128
154
|
</Text>
|
|
155
|
+
<Text size={1}>
|
|
156
|
+
<a href="#" style={{color: 'var(--card-link-fg-color)'}}>
|
|
157
|
+
Link
|
|
158
|
+
</a>
|
|
159
|
+
</Text>
|
|
129
160
|
<Text size={1}>
|
|
130
161
|
<code>Code</code>
|
|
131
162
|
</Text>
|
|
@@ -140,6 +171,155 @@ function DebugState() {
|
|
|
140
171
|
))}
|
|
141
172
|
</Flex>
|
|
142
173
|
<div style={{borderBottom: '1px solid var(--card-border-color)'}} />
|
|
174
|
+
<Flex>
|
|
175
|
+
<Box
|
|
176
|
+
flex={1}
|
|
177
|
+
paddingBottom={3}
|
|
178
|
+
style={{backgroundColor: 'var(--card-skeleton-from-color)'}}
|
|
179
|
+
/>
|
|
180
|
+
<Box
|
|
181
|
+
flex={1}
|
|
182
|
+
paddingBottom={3}
|
|
183
|
+
style={{backgroundColor: 'var(--card-skeleton-to-color)'}}
|
|
184
|
+
/>
|
|
185
|
+
</Flex>
|
|
186
|
+
<Flex style={{gap: 1}}>
|
|
187
|
+
<Box
|
|
188
|
+
flex={1}
|
|
189
|
+
overflow="hidden"
|
|
190
|
+
padding={1}
|
|
191
|
+
style={
|
|
192
|
+
{
|
|
193
|
+
'--card-fg-color': 'var(--card-avatar-gray-fg-color)',
|
|
194
|
+
backgroundColor: 'var(--card-avatar-gray-bg-color)',
|
|
195
|
+
} as any
|
|
196
|
+
}
|
|
197
|
+
>
|
|
198
|
+
<Text size={1} weight="bold">
|
|
199
|
+
A
|
|
200
|
+
</Text>
|
|
201
|
+
</Box>
|
|
202
|
+
<Box
|
|
203
|
+
flex={1}
|
|
204
|
+
overflow="hidden"
|
|
205
|
+
padding={1}
|
|
206
|
+
style={
|
|
207
|
+
{
|
|
208
|
+
'--card-fg-color': 'var(--card-avatar-red-fg-color)',
|
|
209
|
+
backgroundColor: 'var(--card-avatar-red-bg-color)',
|
|
210
|
+
} as any
|
|
211
|
+
}
|
|
212
|
+
>
|
|
213
|
+
<Text size={1} weight="bold">
|
|
214
|
+
A
|
|
215
|
+
</Text>
|
|
216
|
+
</Box>
|
|
217
|
+
<Box
|
|
218
|
+
flex={1}
|
|
219
|
+
overflow="hidden"
|
|
220
|
+
padding={1}
|
|
221
|
+
style={
|
|
222
|
+
{
|
|
223
|
+
'--card-fg-color': 'var(--card-avatar-orange-fg-color)',
|
|
224
|
+
backgroundColor: 'var(--card-avatar-orange-bg-color)',
|
|
225
|
+
} as any
|
|
226
|
+
}
|
|
227
|
+
>
|
|
228
|
+
<Text size={1} weight="bold">
|
|
229
|
+
A
|
|
230
|
+
</Text>
|
|
231
|
+
</Box>
|
|
232
|
+
<Box
|
|
233
|
+
flex={1}
|
|
234
|
+
overflow="hidden"
|
|
235
|
+
padding={1}
|
|
236
|
+
style={
|
|
237
|
+
{
|
|
238
|
+
'--card-fg-color': 'var(--card-avatar-yellow-fg-color)',
|
|
239
|
+
backgroundColor: 'var(--card-avatar-yellow-bg-color)',
|
|
240
|
+
} as any
|
|
241
|
+
}
|
|
242
|
+
>
|
|
243
|
+
<Text size={1} weight="bold">
|
|
244
|
+
A
|
|
245
|
+
</Text>
|
|
246
|
+
</Box>
|
|
247
|
+
<Box
|
|
248
|
+
flex={1}
|
|
249
|
+
overflow="hidden"
|
|
250
|
+
padding={1}
|
|
251
|
+
style={
|
|
252
|
+
{
|
|
253
|
+
'--card-fg-color': 'var(--card-avatar-green-fg-color)',
|
|
254
|
+
backgroundColor: 'var(--card-avatar-green-bg-color)',
|
|
255
|
+
} as any
|
|
256
|
+
}
|
|
257
|
+
>
|
|
258
|
+
<Text size={1} weight="bold">
|
|
259
|
+
A
|
|
260
|
+
</Text>
|
|
261
|
+
</Box>
|
|
262
|
+
<Box
|
|
263
|
+
flex={1}
|
|
264
|
+
overflow="hidden"
|
|
265
|
+
padding={1}
|
|
266
|
+
style={
|
|
267
|
+
{
|
|
268
|
+
'--card-fg-color': 'var(--card-avatar-cyan-fg-color)',
|
|
269
|
+
backgroundColor: 'var(--card-avatar-cyan-bg-color)',
|
|
270
|
+
} as any
|
|
271
|
+
}
|
|
272
|
+
>
|
|
273
|
+
<Text size={1} weight="bold">
|
|
274
|
+
A
|
|
275
|
+
</Text>
|
|
276
|
+
</Box>
|
|
277
|
+
<Box
|
|
278
|
+
flex={1}
|
|
279
|
+
overflow="hidden"
|
|
280
|
+
padding={1}
|
|
281
|
+
style={
|
|
282
|
+
{
|
|
283
|
+
'--card-fg-color': 'var(--card-avatar-blue-fg-color)',
|
|
284
|
+
backgroundColor: 'var(--card-avatar-blue-bg-color)',
|
|
285
|
+
} as any
|
|
286
|
+
}
|
|
287
|
+
>
|
|
288
|
+
<Text size={1} weight="bold">
|
|
289
|
+
A
|
|
290
|
+
</Text>
|
|
291
|
+
</Box>
|
|
292
|
+
<Box
|
|
293
|
+
flex={1}
|
|
294
|
+
overflow="hidden"
|
|
295
|
+
padding={1}
|
|
296
|
+
style={
|
|
297
|
+
{
|
|
298
|
+
'--card-fg-color': 'var(--card-avatar-purple-fg-color)',
|
|
299
|
+
backgroundColor: 'var(--card-avatar-purple-bg-color)',
|
|
300
|
+
} as any
|
|
301
|
+
}
|
|
302
|
+
>
|
|
303
|
+
<Text size={1} weight="bold">
|
|
304
|
+
A
|
|
305
|
+
</Text>
|
|
306
|
+
</Box>
|
|
307
|
+
<Box
|
|
308
|
+
flex={1}
|
|
309
|
+
overflow="hidden"
|
|
310
|
+
padding={1}
|
|
311
|
+
style={
|
|
312
|
+
{
|
|
313
|
+
'--card-fg-color': 'var(--card-avatar-magenta-fg-color)',
|
|
314
|
+
backgroundColor: 'var(--card-avatar-magenta-bg-color)',
|
|
315
|
+
} as any
|
|
316
|
+
}
|
|
317
|
+
>
|
|
318
|
+
<Text size={1} weight="bold">
|
|
319
|
+
A
|
|
320
|
+
</Text>
|
|
321
|
+
</Box>
|
|
322
|
+
</Flex>
|
|
143
323
|
</Stack>
|
|
144
324
|
)
|
|
145
325
|
}
|
|
@@ -148,22 +328,24 @@ function getStateVars(state: ThemeColorState_v2) {
|
|
|
148
328
|
return {
|
|
149
329
|
'--card-accent-fg-color': state.accent.fg,
|
|
150
330
|
|
|
151
|
-
'--card-
|
|
152
|
-
'--card-
|
|
153
|
-
|
|
154
|
-
'--card-
|
|
155
|
-
|
|
156
|
-
'--card-
|
|
157
|
-
|
|
158
|
-
'--card-fg-color': state.fg,
|
|
159
|
-
|
|
160
|
-
'--card-
|
|
161
|
-
|
|
162
|
-
'--card-
|
|
163
|
-
|
|
164
|
-
'--card-
|
|
165
|
-
'--card-
|
|
166
|
-
'--card-
|
|
331
|
+
'--card-avatar-gray-bg-color': state.avatar.gray.bg,
|
|
332
|
+
'--card-avatar-gray-fg-color': state.avatar.gray.fg,
|
|
333
|
+
'--card-avatar-red-bg-color': state.avatar.red.bg,
|
|
334
|
+
'--card-avatar-red-fg-color': state.avatar.red.fg,
|
|
335
|
+
'--card-avatar-orange-bg-color': state.avatar.orange.bg,
|
|
336
|
+
'--card-avatar-orange-fg-color': state.avatar.orange.fg,
|
|
337
|
+
'--card-avatar-yellow-bg-color': state.avatar.yellow.bg,
|
|
338
|
+
'--card-avatar-yellow-fg-color': state.avatar.yellow.fg,
|
|
339
|
+
'--card-avatar-green-bg-color': state.avatar.green.bg,
|
|
340
|
+
'--card-avatar-green-fg-color': state.avatar.green.fg,
|
|
341
|
+
'--card-avatar-cyan-bg-color': state.avatar.cyan.bg,
|
|
342
|
+
'--card-avatar-cyan-fg-color': state.avatar.cyan.fg,
|
|
343
|
+
'--card-avatar-blue-bg-color': state.avatar.blue.bg,
|
|
344
|
+
'--card-avatar-blue-fg-color': state.avatar.blue.fg,
|
|
345
|
+
'--card-avatar-purple-bg-color': state.avatar.purple.bg,
|
|
346
|
+
'--card-avatar-purple-fg-color': state.avatar.purple.fg,
|
|
347
|
+
'--card-avatar-magenta-bg-color': state.avatar.magenta.bg,
|
|
348
|
+
'--card-avatar-magenta-fg-color': state.avatar.magenta.fg,
|
|
167
349
|
|
|
168
350
|
'--card-badge-default-bg-color': state.badge.default.bg,
|
|
169
351
|
'--card-badge-default-dot-color': state.badge.default.dot,
|
|
@@ -190,6 +372,29 @@ function getStateVars(state: ThemeColorState_v2) {
|
|
|
190
372
|
'--card-badge-critical-fg-color': state.badge.critical.fg,
|
|
191
373
|
'--card-badge-critical-icon-color': state.badge.critical.icon,
|
|
192
374
|
|
|
375
|
+
'--card-bg-color': state.bg,
|
|
376
|
+
|
|
377
|
+
'--card-border-color': state.border,
|
|
378
|
+
|
|
379
|
+
'--card-code-bg-color': state.code.bg,
|
|
380
|
+
'--card-code-fg-color': state.code.fg,
|
|
381
|
+
|
|
382
|
+
'--card-fg-color': state.fg,
|
|
383
|
+
|
|
384
|
+
'--card-icon-color': state.icon,
|
|
385
|
+
|
|
386
|
+
'--card-kbd-bg-color': state.kbd.bg,
|
|
387
|
+
'--card-kbd-border-color': state.kbd.border,
|
|
388
|
+
'--card-kbd-fg-color': state.kbd.fg,
|
|
389
|
+
|
|
390
|
+
'--card-link-fg-color': state.link.fg,
|
|
391
|
+
|
|
392
|
+
'--card-muted-bg-color': state.muted.bg,
|
|
393
|
+
'--card-muted-fg-color': state.muted.fg,
|
|
394
|
+
|
|
395
|
+
'--card-skeleton-from-color': state.skeleton.from,
|
|
396
|
+
'--card-skeleton-to-color': state.skeleton.to,
|
|
397
|
+
|
|
193
398
|
backgroundColor: 'var(--card-bg-color)',
|
|
194
399
|
color: 'var(--card-fg-color)',
|
|
195
400
|
} as CSSProperties
|
|
@@ -364,7 +364,7 @@ function renderThemeColorState(
|
|
|
364
364
|
accent: {
|
|
365
365
|
fg: renderColorValue(value.accent.fg, colorOptions),
|
|
366
366
|
},
|
|
367
|
-
avatar: renderThemeColorAvatar(value.avatar, {baseBg, colorPalette, blendMode}),
|
|
367
|
+
avatar: renderThemeColorAvatar(value.avatar, {baseBg: bg, colorPalette, blendMode}),
|
|
368
368
|
badge: renderThemeColorBadge(value.badge, {baseBg: bg, colorPalette, blendMode}),
|
|
369
369
|
bg,
|
|
370
370
|
border: renderColorValue(value.border, colorOptions),
|