@sanity/ui 3.0.0-static.11 → 3.0.0-static.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks-cjs/_visual-editing.js +1293 -1215
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-cjs/buildCommand.js +28 -10
- package/dist/_chunks-cjs/buildCommand.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +1284 -1202
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/_visual-editing.d.mts +528 -358
- package/dist/_visual-editing.d.ts +528 -358
- package/dist/cli.js +1 -1
- package/dist/css.d.mts +143 -73
- package/dist/css.d.ts +143 -73
- package/dist/css.js +329 -472
- package/dist/css.js.map +1 -1
- package/dist/css.mjs +330 -473
- package/dist/css.mjs.map +1 -1
- package/dist/index.d.mts +1362 -869
- package/dist/index.d.ts +1362 -869
- package/dist/index.js +383 -308
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +387 -312
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-palette.css +105 -1
- package/dist/sanity-palette.min.css +1 -0
- package/dist/sanity-theme.css +4571 -1
- package/dist/sanity-theme.min.css +1 -0
- package/dist/system.css +22053 -21946
- package/dist/system.min.css +1 -0
- package/dist/theme.d.mts +51 -106
- package/dist/theme.d.ts +51 -106
- package/dist/theme.js +9 -9
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +9 -9
- package/dist/theme.mjs.map +1 -1
- package/package.json +10 -5
- package/src/cli/buildCommand.ts +46 -19
- package/src/css/_comp.ts +2 -2
- package/src/css/{compile/compileStyle.ts → _compileStyle.ts} +7 -7
- package/src/css/{system.style.ts → _system.style.ts} +3 -2
- package/src/css/aspects/display/display.ts +1 -0
- package/src/css/aspects/display/types.ts +2 -3
- package/src/css/aspects/flex/types.ts +4 -12
- package/src/css/aspects/flexItem/types.ts +1 -3
- package/src/css/aspects/font/types.ts +1 -3
- package/src/css/aspects/grid/grid.ts +1 -0
- package/src/css/aspects/grid/types.ts +5 -9
- package/src/css/aspects/gridItem/gridItem.ts +1 -1
- package/src/css/aspects/gridItem/types.ts +7 -18
- package/src/css/aspects/height/height.ts +3 -4
- package/src/css/aspects/inset/inset.ts +1 -0
- package/src/css/aspects/margin/margin.ts +1 -0
- package/src/css/aspects/margin/types.ts +1 -0
- package/src/css/aspects/maxWidth/maxWidth.ts +1 -0
- package/src/css/aspects/maxWidth/types.ts +1 -0
- package/src/css/aspects/minWidth/minWidth.ts +1 -0
- package/src/css/aspects/minWidth/types.ts +2 -0
- package/src/css/aspects/overflow/overflow.ts +1 -0
- package/src/css/aspects/padding/padding.ts +1 -0
- package/src/css/aspects/pointerEvents/pointerEvents.ts +1 -0
- package/src/css/aspects/position/position.ts +1 -0
- package/src/css/aspects/shadow/shadow.ts +1 -0
- package/src/css/aspects/textOverflow/textOverflow.ts +1 -0
- package/src/css/aspects/textOverflow/types.ts +1 -0
- package/src/css/aspects/width/types.ts +2 -0
- package/src/css/aspects/width/width.ts +1 -0
- package/src/css/{compile/compilePalette.ts → compilePalette.ts} +14 -10
- package/src/css/compileSystem.ts +7 -0
- package/src/css/{compile/compileTheme.ts → compileTheme.ts} +1 -0
- package/src/css/{compile/compileTheme_v3.ts → compileTheme_v3.ts} +123 -104
- package/src/css/components/breadcrumbs/breadcrumbs.ts +1 -0
- package/src/css/components/dialog/dialog.ts +7 -0
- package/src/css/components/menu/menu.ts +2 -0
- package/src/css/components/skeleton/skeleton.ts +4 -0
- package/src/css/components/skeleton/types.ts +4 -0
- package/src/css/components/toast/toast.ts +5 -0
- package/src/css/components/tree/tree.ts +1 -0
- package/src/css/composeClassNames.ts +4 -2
- package/src/css/constants.ts +2 -0
- package/src/css/index.ts +3 -3
- package/src/css/primitives/_arrow/_arrow.ts +3 -0
- package/src/css/primitives/_input/input.ts +2 -0
- package/src/css/primitives/_selectable/_selectable.style.ts +1 -2
- package/src/css/primitives/_selectable/selectable.ts +1 -2
- package/src/css/primitives/avatar/avatar.style.ts +5 -8
- package/src/css/primitives/avatar/avatar.ts +6 -0
- package/src/css/primitives/avatar/types.ts +1 -0
- package/src/css/primitives/box/types.ts +1 -3
- package/src/css/primitives/button/button.ts +4 -21
- package/src/css/primitives/button/index.ts +1 -0
- package/src/css/primitives/button/types.ts +18 -0
- package/src/css/primitives/card/card.style.ts +3 -6
- package/src/css/primitives/card/card.ts +2 -2
- package/src/css/primitives/card/types.ts +2 -2
- package/src/css/primitives/checkbox/checkbox.ts +2 -0
- package/src/css/primitives/container/container.ts +1 -0
- package/src/css/primitives/container/types.ts +1 -0
- package/src/css/primitives/kbd/kbd.ts +1 -0
- package/src/css/primitives/label/types.ts +7 -2
- package/src/css/primitives/popover/popover.ts +2 -0
- package/src/css/primitives/radio/radio.ts +1 -0
- package/src/css/primitives/select/select.ts +2 -0
- package/src/css/primitives/spinner/spinner.ts +2 -0
- package/src/css/primitives/switch/switch.ts +5 -0
- package/src/css/primitives/text/types.ts +4 -0
- package/src/css/primitives/textArea/textArea.ts +1 -0
- package/src/css/primitives/textInput/textInput.ts +1 -0
- package/src/css/primitives/tooltip/tooltip.ts +2 -0
- package/src/css/scopeClassName.ts +1 -0
- package/src/css/types.ts +9 -12
- package/src/css/util.ts +5 -0
- package/src/css/utils/srOnly/srOnly.ts +3 -1
- package/src/css/varNames.ts +131 -141
- package/src/css/vars.ts +1 -6
- package/src/theme/palette/constants.ts +2 -0
- package/src/theme/palette/types.ts +3 -0
- package/src/theme/types.ts +2 -6
- package/src/theme/v0/focusRing.ts +1 -3
- package/src/theme/v0/font.ts +6 -18
- package/src/theme/v0/layer.ts +1 -3
- package/src/theme/v0/shadow.ts +2 -6
- package/src/theme/v2/avatar.ts +1 -3
- package/src/theme/v2/color/_system.ts +1 -3
- package/src/theme/v2/color/avatar.ts +2 -6
- package/src/theme/v2/color/badge.ts +2 -6
- package/src/theme/v2/color/button.ts +3 -9
- package/src/theme/v2/color/color.ts +3 -9
- package/src/theme/v2/color/input.ts +3 -9
- package/src/theme/v2/color/kbd.ts +1 -3
- package/src/theme/v2/color/selectable.ts +2 -6
- package/src/theme/v2/color/state.ts +1 -3
- package/src/theme/v2/color/syntax.ts +1 -3
- package/src/theme/v2/input.ts +1 -3
- package/src/theme/v2/theme.ts +2 -6
- package/src/theme/v3/buildTheme_v3.ts +1 -0
- package/src/theme/v3/color/color.ts +6 -4
- package/src/theme/v3/color/renderColor.ts +4 -1
- package/src/theme/v3/defaultTokens.ts +1 -0
- package/src/theme/v3/resolveTokens.ts +9 -9
- package/src/ui/RootClassNames.tsx +3 -0
- package/src/ui/StyleTags.tsx +3 -1
- package/src/ui/_compat/theme/themeColorProvider.tsx +2 -6
- package/src/ui/_compat/theme/themeProvider.tsx +2 -6
- package/src/ui/_compat/theme/types.ts +1 -3
- package/src/ui/_compat/theme/useRootTheme.ts +1 -3
- package/src/ui/_compat/theme/useTheme.ts +2 -6
- package/src/ui/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
- package/src/ui/components/autocomplete/autocomplete.tsx +86 -114
- package/src/ui/components/autocomplete/autocompleteOption.tsx +2 -0
- package/src/ui/components/autocomplete/types.ts +3 -8
- package/src/ui/components/breadcrumbs/breadcrumbs.tsx +27 -21
- package/src/ui/components/dialog/dialog.tsx +89 -291
- package/src/ui/components/dialog/dialogCard.tsx +183 -0
- package/src/ui/components/dialog/isTargetWithinScope.ts +14 -0
- package/src/ui/components/hotkeys/hotkeys.tsx +33 -15
- package/src/ui/components/menu/__workshop__/asComponent.tsx +6 -6
- package/src/ui/components/menu/menu.tsx +27 -33
- package/src/ui/components/menu/menuButton.tsx +10 -14
- package/src/ui/components/menu/menuDivider.tsx +25 -13
- package/src/ui/components/menu/menuGroup.tsx +34 -26
- package/src/ui/components/menu/menuItem.tsx +51 -40
- package/src/ui/components/skeleton/codeSkeleton.tsx +53 -0
- package/src/ui/components/skeleton/headingSkeleton.tsx +52 -0
- package/src/ui/components/skeleton/index.ts +3 -0
- package/src/ui/components/skeleton/labelSkeleton.tsx +51 -0
- package/src/ui/components/skeleton/skeleton.tsx +39 -16
- package/src/ui/components/skeleton/textSkeleton.tsx +31 -110
- package/src/ui/components/tab/tab.tsx +23 -19
- package/src/ui/components/tab/tabList.tsx +34 -33
- package/src/ui/components/tab/tabPanel.tsx +25 -19
- package/src/ui/components/toast/toast.tsx +21 -16
- package/src/ui/components/toast/toastLayer.tsx +28 -10
- package/src/ui/components/toast/toastProvider.tsx +2 -6
- package/src/ui/components/toast/types.ts +2 -6
- package/src/ui/components/toast/useToast.ts +1 -3
- package/src/ui/components/tree/tree.tsx +194 -187
- package/src/ui/components/tree/treeGroup.tsx +25 -5
- package/src/ui/components/tree/treeItem.tsx +35 -23
- package/src/ui/hooks/useClickOutside.ts +2 -6
- package/src/ui/hooks/useClickOutsideEvent.ts +3 -9
- package/src/ui/primitives/_selectable/selectable.tsx +33 -20
- package/src/ui/primitives/avatar/avatar.tsx +28 -31
- package/src/ui/primitives/avatar/avatarCounter.tsx +33 -25
- package/src/ui/primitives/avatar/avatarStack.tsx +31 -24
- package/src/ui/primitives/avatar/types.ts +2 -0
- package/src/ui/primitives/badge/__workshop__/props.tsx +1 -9
- package/src/ui/primitives/badge/__workshop__/tones.tsx +1 -6
- package/src/ui/primitives/badge/badge.tsx +33 -32
- package/src/ui/primitives/badge/types.ts +2 -1
- package/src/ui/primitives/box/box.tsx +59 -29
- package/src/ui/primitives/button/__workshop__/sanityUploadButton.tsx +3 -3
- package/src/ui/primitives/button/__workshop__/uploadButton.tsx +2 -1
- package/src/ui/primitives/button/button.test.tsx +1 -15
- package/src/ui/primitives/button/button.tsx +64 -70
- package/src/ui/primitives/card/__workshop__/asComponent.tsx +3 -3
- package/src/ui/primitives/card/card.tsx +22 -22
- package/src/ui/primitives/card/cardProvider.tsx +2 -0
- package/src/ui/primitives/checkbox/checkbox.tsx +26 -15
- package/src/ui/primitives/code/code.tsx +24 -22
- package/src/ui/primitives/container/container.tsx +26 -15
- package/src/ui/primitives/flex/flex.tsx +21 -19
- package/src/ui/primitives/grid/grid.tsx +21 -16
- package/src/ui/primitives/heading/heading.tsx +42 -19
- package/src/ui/primitives/inline/inline.tsx +26 -23
- package/src/ui/primitives/kbd/kbd.tsx +25 -23
- package/src/ui/primitives/label/label.tsx +41 -26
- package/src/ui/primitives/popover/popover.tsx +281 -277
- package/src/ui/primitives/popover/popoverCard.tsx +119 -118
- package/src/ui/primitives/radio/radio.tsx +30 -14
- package/src/ui/primitives/select/select.tsx +24 -16
- package/src/ui/primitives/spinner/animatedSpinnerIcon.tsx +4 -2
- package/src/ui/primitives/spinner/spinner.tsx +24 -12
- package/src/ui/primitives/stack/stack.tsx +27 -18
- package/src/ui/primitives/switch/switch.tsx +31 -14
- package/src/ui/primitives/text/text.tsx +42 -24
- package/src/ui/primitives/textArea/textArea.tsx +33 -18
- package/src/ui/primitives/textInput/textInput.tsx +28 -40
- package/src/ui/primitives/tooltip/constants.ts +1 -1
- package/src/ui/primitives/tooltip/tooltip.tsx +76 -59
- package/src/ui/primitives/tooltip/tooltipCard.tsx +89 -82
- package/src/ui/primitives/types.ts +1 -3
- package/src/ui/types/avatar.ts +3 -6
- package/src/ui/types/badge.ts +1 -3
- package/src/ui/types/button.ts +1 -3
- package/src/ui/types/card.ts +1 -3
- package/src/ui/types/dialog.ts +1 -3
- package/src/ui/types/props.ts +20 -10
- package/src/ui/utils/arrow/arrow.tsx +40 -14
- package/src/ui/utils/boundaryElement/boundaryElementProvider.tsx +2 -6
- package/src/ui/utils/boundaryElement/types.ts +1 -3
- package/src/ui/utils/boundaryElement/useBoundaryElement.ts +1 -3
- package/src/ui/utils/elementQuery/elementQuery.tsx +36 -14
- package/src/ui/utils/errorBoundary.tsx +2 -0
- package/src/ui/utils/index.ts +0 -1
- package/src/ui/utils/layer/layer.tsx +23 -93
- package/src/ui/utils/layer/layerCard.tsx +92 -0
- package/src/ui/utils/layer/layerProvider.tsx +2 -6
- package/src/ui/utils/layer/useLayer.ts +1 -3
- package/src/ui/utils/portal/portal.ts +2 -6
- package/src/ui/utils/portal/portalProvider.tsx +2 -6
- package/src/ui/utils/portal/types.ts +1 -3
- package/src/ui/utils/portal/usePortal.ts +1 -3
- package/src/ui/utils/srOnly/srOnly.tsx +25 -20
- package/src/ui/utils/virtualList/virtualList.tsx +36 -24
- package/src/css/compile/compileRule.ts +0 -97
- package/src/css/compile/compileRules.test.ts +0 -36
- package/src/css/compile/compileRules.ts +0 -43
- package/src/css/compile/compileSystem.ts +0 -7
- package/src/css/compile/types.ts +0 -6
- package/src/css/primitives/_selectable/_contants.ts +0 -11
- package/src/css/primitives/card/_constants.ts +0 -13
- package/src/ui/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
- package/src/ui/utils/conditionalWrapper/index.ts +0 -1
package/src/css/varNames.ts
CHANGED
|
@@ -16,8 +16,10 @@ import {
|
|
|
16
16
|
Shadow,
|
|
17
17
|
SPACE,
|
|
18
18
|
type Space,
|
|
19
|
+
THEME_COLOR_CARD_TONES,
|
|
19
20
|
THEME_COLOR_STATE_TONES,
|
|
20
21
|
type ThemeColorCardToneKey as CardTone,
|
|
22
|
+
ThemeColorCardToneKey,
|
|
21
23
|
type ThemeColorSchemeKey as Scheme,
|
|
22
24
|
} from '@sanity/ui/theme'
|
|
23
25
|
|
|
@@ -29,6 +31,7 @@ import {
|
|
|
29
31
|
type VarNames,
|
|
30
32
|
} from './types'
|
|
31
33
|
|
|
34
|
+
/** @public */
|
|
32
35
|
export const varNames: VarNames = {
|
|
33
36
|
avatar: {
|
|
34
37
|
distance: `--avatar-distance`,
|
|
@@ -66,9 +69,6 @@ export const varNames: VarNames = {
|
|
|
66
69
|
},
|
|
67
70
|
color: {
|
|
68
71
|
// card scope
|
|
69
|
-
accent: {
|
|
70
|
-
fg: `--color-accent-fg`,
|
|
71
|
-
},
|
|
72
72
|
avatar: {
|
|
73
73
|
bg: `--color-avatar-bg`,
|
|
74
74
|
fg: `--color-avatar-fg`,
|
|
@@ -186,36 +186,32 @@ export const varNames: VarNames = {
|
|
|
186
186
|
tinted: buildColorVariantVarNames({variant: 'tinted'}),
|
|
187
187
|
|
|
188
188
|
// tone scopes
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
// scheme
|
|
199
|
-
dark:
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
positive: buildColorCardVarNames({scheme: 'light', tone: 'positive'}),
|
|
216
|
-
caution: buildColorCardVarNames({scheme: 'light', tone: 'caution'}),
|
|
217
|
-
critical: buildColorCardVarNames({scheme: 'light', tone: 'critical'}),
|
|
218
|
-
},
|
|
189
|
+
...THEME_COLOR_CARD_TONES.reduce(
|
|
190
|
+
(acc, tone) => {
|
|
191
|
+
acc[tone] = buildColorCardVarNames({tone})
|
|
192
|
+
|
|
193
|
+
return acc
|
|
194
|
+
},
|
|
195
|
+
{} as Record<ThemeColorCardToneKey, ColorCardVarNames>,
|
|
196
|
+
),
|
|
197
|
+
|
|
198
|
+
// scheme scopes
|
|
199
|
+
dark: THEME_COLOR_CARD_TONES.reduce(
|
|
200
|
+
(acc, tone) => {
|
|
201
|
+
acc[tone] = buildColorCardVarNames({scheme: 'dark', tone})
|
|
202
|
+
|
|
203
|
+
return acc
|
|
204
|
+
},
|
|
205
|
+
{} as Record<ThemeColorCardToneKey, ColorCardVarNames>,
|
|
206
|
+
),
|
|
207
|
+
light: THEME_COLOR_CARD_TONES.reduce(
|
|
208
|
+
(acc, tone) => {
|
|
209
|
+
acc[tone] = buildColorCardVarNames({scheme: 'light', tone})
|
|
210
|
+
|
|
211
|
+
return acc
|
|
212
|
+
},
|
|
213
|
+
{} as Record<ThemeColorCardToneKey, ColorCardVarNames>,
|
|
214
|
+
),
|
|
219
215
|
},
|
|
220
216
|
container: {
|
|
221
217
|
0: `--container-0`,
|
|
@@ -385,7 +381,6 @@ export const varNames: VarNames = {
|
|
|
385
381
|
letterSpacing: `--input-letter-spacing`,
|
|
386
382
|
ascenderHeight: `--input-ascender-height`,
|
|
387
383
|
descenderHeight: `--input-descender-height`,
|
|
388
|
-
// capHeight: `--input-cap-height`,
|
|
389
384
|
|
|
390
385
|
gap: `--input-gap`,
|
|
391
386
|
padding: `--input-padding`,
|
|
@@ -429,112 +424,107 @@ export const varNames: VarNames = {
|
|
|
429
424
|
function buildColorCardVarNames(props: {scheme?: Scheme; tone: CardTone}): ColorCardVarNames {
|
|
430
425
|
const {scheme, tone} = props
|
|
431
426
|
|
|
432
|
-
const
|
|
433
|
-
? (`--color-${scheme}-${tone}` as const)
|
|
434
|
-
: (`--color-${tone}` as const)
|
|
427
|
+
const prefix = scheme ? (`--color-${scheme}-${tone}` as const) : (`--color-${tone}` as const)
|
|
435
428
|
|
|
436
429
|
return {
|
|
437
|
-
accent: {
|
|
438
|
-
fg: `${sourcePrefix}-accent-fg`,
|
|
439
|
-
},
|
|
440
430
|
avatar: {
|
|
441
431
|
gray: {
|
|
442
|
-
bg: `${
|
|
443
|
-
fg: `${
|
|
432
|
+
bg: `${prefix}-avatar-gray-bg`,
|
|
433
|
+
fg: `${prefix}-avatar-gray-fg`,
|
|
444
434
|
},
|
|
445
435
|
blue: {
|
|
446
|
-
bg: `${
|
|
447
|
-
fg: `${
|
|
436
|
+
bg: `${prefix}-avatar-blue-bg`,
|
|
437
|
+
fg: `${prefix}-avatar-blue-fg`,
|
|
448
438
|
},
|
|
449
439
|
purple: {
|
|
450
|
-
bg: `${
|
|
451
|
-
fg: `${
|
|
440
|
+
bg: `${prefix}-avatar-purple-bg`,
|
|
441
|
+
fg: `${prefix}-avatar-purple-fg`,
|
|
452
442
|
},
|
|
453
443
|
magenta: {
|
|
454
|
-
bg: `${
|
|
455
|
-
fg: `${
|
|
444
|
+
bg: `${prefix}-avatar-magenta-bg`,
|
|
445
|
+
fg: `${prefix}-avatar-magenta-fg`,
|
|
456
446
|
},
|
|
457
447
|
red: {
|
|
458
|
-
bg: `${
|
|
459
|
-
fg: `${
|
|
448
|
+
bg: `${prefix}-avatar-red-bg`,
|
|
449
|
+
fg: `${prefix}-avatar-red-fg`,
|
|
460
450
|
},
|
|
461
451
|
orange: {
|
|
462
|
-
bg: `${
|
|
463
|
-
fg: `${
|
|
452
|
+
bg: `${prefix}-avatar-orange-bg`,
|
|
453
|
+
fg: `${prefix}-avatar-gray-fg`,
|
|
464
454
|
},
|
|
465
455
|
yellow: {
|
|
466
|
-
bg: `${
|
|
467
|
-
fg: `${
|
|
456
|
+
bg: `${prefix}-avatar-yellow-bg`,
|
|
457
|
+
fg: `${prefix}-avatar-yellow-fg`,
|
|
468
458
|
},
|
|
469
459
|
green: {
|
|
470
|
-
bg: `${
|
|
471
|
-
fg: `${
|
|
460
|
+
bg: `${prefix}-avatar-green-bg`,
|
|
461
|
+
fg: `${prefix}-avatar-green-fg`,
|
|
472
462
|
},
|
|
473
463
|
cyan: {
|
|
474
|
-
bg: `${
|
|
475
|
-
fg: `${
|
|
464
|
+
bg: `${prefix}-avatar-cyan-bg`,
|
|
465
|
+
fg: `${prefix}-avatar-yellow-fg`,
|
|
476
466
|
},
|
|
477
467
|
},
|
|
478
|
-
backdrop: `${
|
|
468
|
+
backdrop: `${prefix}-backdrop`,
|
|
479
469
|
code: {
|
|
480
|
-
bg: `${
|
|
481
|
-
fg: `${
|
|
470
|
+
bg: `${prefix}-code-bg`,
|
|
471
|
+
fg: `${prefix}-code-fg`,
|
|
482
472
|
token: {
|
|
483
|
-
atrule: `${
|
|
484
|
-
attrName: `${
|
|
485
|
-
attrValue: `${
|
|
486
|
-
attribute: `${
|
|
487
|
-
boolean: `${
|
|
488
|
-
builtin: `${
|
|
489
|
-
cdata: `${
|
|
490
|
-
char: `${
|
|
491
|
-
class: `${
|
|
492
|
-
className: `${
|
|
493
|
-
comment: `${
|
|
494
|
-
constant: `${
|
|
495
|
-
deleted: `${
|
|
496
|
-
doctype: `${
|
|
497
|
-
entity: `${
|
|
498
|
-
function: `${
|
|
499
|
-
hexcode: `${
|
|
500
|
-
id: `${
|
|
501
|
-
important: `${
|
|
502
|
-
inserted: `${
|
|
503
|
-
keyword: `${
|
|
504
|
-
number: `${
|
|
505
|
-
operator: `${
|
|
506
|
-
prolog: `${
|
|
507
|
-
property: `${
|
|
508
|
-
pseudoClass: `${
|
|
509
|
-
pseudoElement: `${
|
|
510
|
-
punctuation: `${
|
|
511
|
-
regex: `${
|
|
512
|
-
selector: `${
|
|
513
|
-
string: `${
|
|
514
|
-
symbol: `${
|
|
515
|
-
tag: `${
|
|
516
|
-
unit: `${
|
|
517
|
-
url: `${
|
|
518
|
-
variable: `${
|
|
519
|
-
},
|
|
520
|
-
},
|
|
521
|
-
focusRing: `${
|
|
473
|
+
atrule: `${prefix}-code-token-atrule`,
|
|
474
|
+
attrName: `${prefix}-code-token-attr-name`,
|
|
475
|
+
attrValue: `${prefix}-code-token-attr-value`,
|
|
476
|
+
attribute: `${prefix}-code-token-attribute`,
|
|
477
|
+
boolean: `${prefix}-code-token-boolean`,
|
|
478
|
+
builtin: `${prefix}-code-token-builtin`,
|
|
479
|
+
cdata: `${prefix}-code-token-cdata`,
|
|
480
|
+
char: `${prefix}-code-token-char`,
|
|
481
|
+
class: `${prefix}-code-token-class`,
|
|
482
|
+
className: `${prefix}-code-token-class-name`,
|
|
483
|
+
comment: `${prefix}-code-token-comment`,
|
|
484
|
+
constant: `${prefix}-code-token-constant`,
|
|
485
|
+
deleted: `${prefix}-code-token-deleted`,
|
|
486
|
+
doctype: `${prefix}-code-token-doctype`,
|
|
487
|
+
entity: `${prefix}-code-token-entity`,
|
|
488
|
+
function: `${prefix}-code-token-function`,
|
|
489
|
+
hexcode: `${prefix}-code-token-hexcode`,
|
|
490
|
+
id: `${prefix}-code-token-id`,
|
|
491
|
+
important: `${prefix}-code-token-important`,
|
|
492
|
+
inserted: `${prefix}-code-token-inserted`,
|
|
493
|
+
keyword: `${prefix}-code-token-keyword`,
|
|
494
|
+
number: `${prefix}-code-token-number`,
|
|
495
|
+
operator: `${prefix}-code-token-operator`,
|
|
496
|
+
prolog: `${prefix}-code-token-prolog`,
|
|
497
|
+
property: `${prefix}-code-token-property`,
|
|
498
|
+
pseudoClass: `${prefix}-code-token-pseudo-class`,
|
|
499
|
+
pseudoElement: `${prefix}-code-token-pseudo-element`,
|
|
500
|
+
punctuation: `${prefix}-code-token-punctuation`,
|
|
501
|
+
regex: `${prefix}-code-token-regex`,
|
|
502
|
+
selector: `${prefix}-code-token-selector`,
|
|
503
|
+
string: `${prefix}-code-token-string`,
|
|
504
|
+
symbol: `${prefix}-code-token-symbol`,
|
|
505
|
+
tag: `${prefix}-code-token-tag`,
|
|
506
|
+
unit: `${prefix}-code-token-unit`,
|
|
507
|
+
url: `${prefix}-code-token-url`,
|
|
508
|
+
variable: `${prefix}-code-token-variable`,
|
|
509
|
+
},
|
|
510
|
+
},
|
|
511
|
+
focusRing: `${prefix}-focus-ring`,
|
|
522
512
|
link: {
|
|
523
|
-
fg: `${
|
|
513
|
+
fg: `${prefix}-link-fg`,
|
|
524
514
|
},
|
|
525
515
|
muted: {
|
|
526
|
-
bg: `${
|
|
527
|
-
fg: `${
|
|
516
|
+
bg: `${prefix}-muted-bg`,
|
|
517
|
+
fg: `${prefix}-muted-fg`,
|
|
528
518
|
},
|
|
529
519
|
shadow: {
|
|
530
|
-
outline: `${
|
|
531
|
-
umbra: `${
|
|
532
|
-
penumbra: `${
|
|
533
|
-
ambient: `${
|
|
520
|
+
outline: `${prefix}-shadow-outline`,
|
|
521
|
+
umbra: `${prefix}-shadow-umbra`,
|
|
522
|
+
penumbra: `${prefix}-shadow-penumbra`,
|
|
523
|
+
ambient: `${prefix}-shadow-ambient`,
|
|
534
524
|
},
|
|
535
525
|
skeleton: {
|
|
536
|
-
from: `${
|
|
537
|
-
to: `${
|
|
526
|
+
from: `${prefix}-skeleton-from`,
|
|
527
|
+
to: `${prefix}-skeleton-to`,
|
|
538
528
|
},
|
|
539
529
|
|
|
540
530
|
solid: buildColorVariantVarNames({scheme, tone, variant: 'solid'}),
|
|
@@ -549,7 +539,7 @@ function buildColorVariantVarNames(options: {
|
|
|
549
539
|
}): ColorVariantVarNames {
|
|
550
540
|
const {scheme, tone, variant} = options
|
|
551
541
|
|
|
552
|
-
const
|
|
542
|
+
const prefix =
|
|
553
543
|
scheme && tone
|
|
554
544
|
? (`--color-${scheme}-${tone}-${variant}` as const)
|
|
555
545
|
: tone
|
|
@@ -558,30 +548,30 @@ function buildColorVariantVarNames(options: {
|
|
|
558
548
|
|
|
559
549
|
const vars = {
|
|
560
550
|
bg: {
|
|
561
|
-
0: `${
|
|
562
|
-
1: `${
|
|
563
|
-
2: `${
|
|
564
|
-
3: `${
|
|
565
|
-
4: `${
|
|
551
|
+
0: `${prefix}-bg-0`,
|
|
552
|
+
1: `${prefix}-bg-1`,
|
|
553
|
+
2: `${prefix}-bg-2`,
|
|
554
|
+
3: `${prefix}-bg-3`,
|
|
555
|
+
4: `${prefix}-bg-4`,
|
|
566
556
|
},
|
|
567
557
|
border: {
|
|
568
|
-
0: `${
|
|
569
|
-
1: `${
|
|
570
|
-
2: `${
|
|
571
|
-
3: `${
|
|
572
|
-
4: `${
|
|
558
|
+
0: `${prefix}-border-0`,
|
|
559
|
+
1: `${prefix}-border-1`,
|
|
560
|
+
2: `${prefix}-border-2`,
|
|
561
|
+
3: `${prefix}-border-3`,
|
|
562
|
+
4: `${prefix}-border-4`,
|
|
573
563
|
},
|
|
574
564
|
fg: {
|
|
575
|
-
0: `${
|
|
576
|
-
1: `${
|
|
577
|
-
2: `${
|
|
578
|
-
3: `${
|
|
579
|
-
4: `${
|
|
565
|
+
0: `${prefix}-fg-0`,
|
|
566
|
+
1: `${prefix}-fg-1`,
|
|
567
|
+
2: `${prefix}-fg-2`,
|
|
568
|
+
3: `${prefix}-fg-3`,
|
|
569
|
+
4: `${prefix}-fg-4`,
|
|
580
570
|
},
|
|
581
571
|
} as ColorVariantVarNames
|
|
582
572
|
|
|
583
573
|
for (const elementTone of THEME_COLOR_STATE_TONES) {
|
|
584
|
-
const
|
|
574
|
+
const _prefix =
|
|
585
575
|
scheme && tone
|
|
586
576
|
? (`--color-${scheme}-${tone}-${variant}-${elementTone}` as const)
|
|
587
577
|
: tone
|
|
@@ -590,25 +580,25 @@ function buildColorVariantVarNames(options: {
|
|
|
590
580
|
|
|
591
581
|
vars[elementTone] = {
|
|
592
582
|
bg: {
|
|
593
|
-
0: `${
|
|
594
|
-
1: `${
|
|
595
|
-
2: `${
|
|
596
|
-
3: `${
|
|
597
|
-
4: `${
|
|
583
|
+
0: `${_prefix}-bg-0`,
|
|
584
|
+
1: `${_prefix}-bg-1`,
|
|
585
|
+
2: `${_prefix}-bg-2`,
|
|
586
|
+
3: `${_prefix}-bg-3`,
|
|
587
|
+
4: `${_prefix}-bg-4`,
|
|
598
588
|
},
|
|
599
589
|
border: {
|
|
600
|
-
0: `${
|
|
601
|
-
1: `${
|
|
602
|
-
2: `${
|
|
603
|
-
3: `${
|
|
604
|
-
4: `${
|
|
590
|
+
0: `${_prefix}-border-0`,
|
|
591
|
+
1: `${_prefix}-border-1`,
|
|
592
|
+
2: `${_prefix}-border-2`,
|
|
593
|
+
3: `${_prefix}-border-3`,
|
|
594
|
+
4: `${_prefix}-border-4`,
|
|
605
595
|
},
|
|
606
596
|
fg: {
|
|
607
|
-
0: `${
|
|
608
|
-
1: `${
|
|
609
|
-
2: `${
|
|
610
|
-
3: `${
|
|
611
|
-
4: `${
|
|
597
|
+
0: `${_prefix}-fg-0`,
|
|
598
|
+
1: `${_prefix}-fg-1`,
|
|
599
|
+
2: `${_prefix}-fg-2`,
|
|
600
|
+
3: `${_prefix}-fg-3`,
|
|
601
|
+
4: `${_prefix}-fg-4`,
|
|
612
602
|
},
|
|
613
603
|
}
|
|
614
604
|
}
|
package/src/css/vars.ts
CHANGED
|
@@ -47,9 +47,6 @@ for (const tone of THEME_COLOR_CARD_TONES) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
const colorVars: Vars['color'] = {
|
|
50
|
-
accent: {
|
|
51
|
-
fg: `var(${varNames.color.accent.fg})`,
|
|
52
|
-
},
|
|
53
50
|
avatar: {
|
|
54
51
|
bg: `var(${varNames.color.avatar.bg})`,
|
|
55
52
|
fg: `var(${varNames.color.avatar.fg})`,
|
|
@@ -176,6 +173,7 @@ const colorVars: Vars['color'] = {
|
|
|
176
173
|
light: lightColorVars,
|
|
177
174
|
}
|
|
178
175
|
|
|
176
|
+
/** @public */
|
|
179
177
|
export const vars: Vars = {
|
|
180
178
|
avatar: {
|
|
181
179
|
distance: `var(${varNames.avatar.distance})`,
|
|
@@ -369,9 +367,6 @@ function buildColorCardVars(props: {scheme?: Scheme; tone: CardTone}): ColorCard
|
|
|
369
367
|
const prefix = scheme ? varNames.color[scheme][tone] : varNames.color[tone]
|
|
370
368
|
|
|
371
369
|
return {
|
|
372
|
-
accent: {
|
|
373
|
-
fg: `var(${prefix.accent.fg})`,
|
|
374
|
-
},
|
|
375
370
|
avatar: {
|
|
376
371
|
...THEME_COLOR_AVATAR_COLORS.reduce((acc, color) => {
|
|
377
372
|
return {
|
package/src/theme/types.ts
CHANGED
|
@@ -3,17 +3,13 @@ import {RootTheme_v0} from './v0/theme'
|
|
|
3
3
|
import {RootTheme_v2, Theme_v2} from './v2/theme'
|
|
4
4
|
import {Theme_v3} from './v3'
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
6
|
+
/** @public */
|
|
9
7
|
export interface RootTheme extends RootTheme_v0 {
|
|
10
8
|
v2?: RootTheme_v2
|
|
11
9
|
v3?: Theme_v3
|
|
12
10
|
}
|
|
13
11
|
|
|
14
|
-
/**
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
12
|
+
/** @public */
|
|
17
13
|
export type BaseTheme = RootTheme
|
|
18
14
|
|
|
19
15
|
/**
|
package/src/theme/v0/font.ts
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
*/
|
|
1
|
+
/** @public */
|
|
4
2
|
export type ThemeFontKey = 'code' | 'heading' | 'label' | 'text'
|
|
5
3
|
|
|
6
|
-
/**
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
4
|
+
/** @public */
|
|
9
5
|
export type ThemeFontWeightKey = 'regular' | 'medium' | 'semibold' | 'bold'
|
|
10
6
|
|
|
11
|
-
/**
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
7
|
+
/** @public */
|
|
14
8
|
export interface ThemeFontSize {
|
|
15
9
|
ascenderHeight: number
|
|
16
10
|
descenderHeight: number
|
|
@@ -20,9 +14,7 @@ export interface ThemeFontSize {
|
|
|
20
14
|
lineHeight: number
|
|
21
15
|
}
|
|
22
16
|
|
|
23
|
-
/**
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
17
|
+
/** @public */
|
|
26
18
|
export interface ThemeFontWeight {
|
|
27
19
|
regular: number
|
|
28
20
|
medium: number
|
|
@@ -30,9 +22,7 @@ export interface ThemeFontWeight {
|
|
|
30
22
|
bold: number
|
|
31
23
|
}
|
|
32
24
|
|
|
33
|
-
/**
|
|
34
|
-
* @public
|
|
35
|
-
*/
|
|
25
|
+
/** @public */
|
|
36
26
|
export interface ThemeFont {
|
|
37
27
|
family: string
|
|
38
28
|
featureSettings?: string
|
|
@@ -42,9 +32,7 @@ export interface ThemeFont {
|
|
|
42
32
|
horizontalOffset?: number
|
|
43
33
|
}
|
|
44
34
|
|
|
45
|
-
/**
|
|
46
|
-
* @public
|
|
47
|
-
*/
|
|
35
|
+
/** @public */
|
|
48
36
|
export interface ThemeFonts {
|
|
49
37
|
code: ThemeFont
|
|
50
38
|
heading: ThemeFont
|
package/src/theme/v0/layer.ts
CHANGED
package/src/theme/v0/shadow.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
*/
|
|
1
|
+
/** @public */
|
|
4
2
|
export type ThemeBoxShadow = [
|
|
5
3
|
// offsetX, offsetY, blurRadius, spreadRadius
|
|
6
4
|
number,
|
|
@@ -9,9 +7,7 @@ export type ThemeBoxShadow = [
|
|
|
9
7
|
number,
|
|
10
8
|
]
|
|
11
9
|
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
10
|
+
/** @public */
|
|
15
11
|
export interface ThemeShadow {
|
|
16
12
|
umbra: ThemeBoxShadow
|
|
17
13
|
penumbra: ThemeBoxShadow
|
package/src/theme/v2/avatar.ts
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import {ThemeColorAvatarColorKey, ThemeColorBlendModeKey} from './_system'
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
3
|
+
/** @public */
|
|
6
4
|
export interface ThemeColorAvatarHue_v2 {
|
|
7
5
|
_blend?: ThemeColorBlendModeKey
|
|
8
6
|
bg: string
|
|
9
7
|
fg: string
|
|
10
8
|
}
|
|
11
9
|
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
10
|
+
/** @public */
|
|
15
11
|
export type ThemeColorAvatar_v2 = Record<ThemeColorAvatarColorKey, ThemeColorAvatarHue_v2>
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import {ThemeColorStateToneKey} from './_system'
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
3
|
+
/** @public */
|
|
6
4
|
export interface ThemeColorBadgeTone_v2 {
|
|
7
5
|
bg: string
|
|
8
6
|
fg: string
|
|
@@ -10,7 +8,5 @@ export interface ThemeColorBadgeTone_v2 {
|
|
|
10
8
|
icon: string
|
|
11
9
|
}
|
|
12
10
|
|
|
13
|
-
/**
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
11
|
+
/** @public */
|
|
16
12
|
export type ThemeColorBadge_v2 = Record<ThemeColorStateToneKey, ThemeColorBadgeTone_v2>
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import {ThemeColorButtonModeKey, ThemeColorStateKey, ThemeColorStateToneKey} from './_system'
|
|
2
2
|
import {ThemeColorState_v2} from './state'
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
4
|
+
/** @public */
|
|
7
5
|
export type ThemeColorButtonTone_v2 = Record<ThemeColorStateKey, ThemeColorState_v2>
|
|
8
6
|
|
|
9
|
-
/**
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
7
|
+
/** @public */
|
|
12
8
|
export type ThemeColorButtonMode_v2 = Record<ThemeColorStateToneKey, ThemeColorButtonTone_v2>
|
|
13
9
|
|
|
14
|
-
/**
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
10
|
+
/** @public */
|
|
17
11
|
export type ThemeColorButton_v2 = Record<ThemeColorButtonModeKey, ThemeColorButtonMode_v2>
|
|
@@ -6,9 +6,7 @@ import {ThemeColorShadow} from './shadow'
|
|
|
6
6
|
import {ThemeColorState_v2} from './state'
|
|
7
7
|
import {ThemeColorSyntax} from './syntax'
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
9
|
+
/** @public */
|
|
12
10
|
export interface ThemeColorCard_v2 extends ThemeColorState_v2 {
|
|
13
11
|
/** @internal */
|
|
14
12
|
_blend: ThemeColorBlendModeKey
|
|
@@ -23,12 +21,8 @@ export interface ThemeColorCard_v2 extends ThemeColorState_v2 {
|
|
|
23
21
|
syntax: ThemeColorSyntax
|
|
24
22
|
}
|
|
25
23
|
|
|
26
|
-
/**
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
24
|
+
/** @public */
|
|
29
25
|
export type ThemeColorScheme_v2 = Record<ThemeColorCardToneKey, ThemeColorCard_v2>
|
|
30
26
|
|
|
31
|
-
/**
|
|
32
|
-
* @public
|
|
33
|
-
*/
|
|
27
|
+
/** @public */
|
|
34
28
|
export type ThemeColorSchemes_v2 = Record<ThemeColorSchemeKey, ThemeColorScheme_v2>
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import {ThemeColorBlendModeKey, ThemeColorInputModeKey, ThemeColorInputStateKey} from './_system'
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
3
|
+
/** @public */
|
|
6
4
|
export interface ThemeColorInputState_v2 {
|
|
7
5
|
_blend?: ThemeColorBlendModeKey
|
|
8
6
|
bg: string
|
|
@@ -14,12 +12,8 @@ export interface ThemeColorInputState_v2 {
|
|
|
14
12
|
placeholder: string
|
|
15
13
|
}
|
|
16
14
|
|
|
17
|
-
/**
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
15
|
+
/** @public */
|
|
20
16
|
export type ThemeColorInputMode_v2 = Record<ThemeColorInputStateKey, ThemeColorInputState_v2>
|
|
21
17
|
|
|
22
|
-
/**
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
18
|
+
/** @public */
|
|
25
19
|
export type ThemeColorInput_v2 = Record<ThemeColorInputModeKey, ThemeColorInputMode_v2>
|