@sanity/ui 2.9.0-corel.0 → 3.0.0-static.0
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/bin/ui.js +6 -0
- package/dist/_chunks-cjs/buildCommand.js +2836 -0
- package/dist/_chunks-cjs/buildCommand.js.map +1 -0
- package/dist/_chunks-cjs/getTheme_v2.js +1 -27
- package/dist/_chunks-cjs/getTheme_v2.js.map +1 -1
- package/dist/_chunks-es/getTheme_v2.mjs +1 -27
- package/dist/_chunks-es/getTheme_v2.mjs.map +1 -1
- package/dist/_legacy/getTheme_v2.esm.js +1 -27
- package/dist/_legacy/getTheme_v2.esm.js.map +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +23 -0
- package/dist/cli.js.map +1 -0
- package/dist/css.d.mts +943 -0
- package/dist/css.d.ts +943 -0
- package/dist/css.esm.js +3135 -0
- package/dist/css.esm.js.map +1 -0
- package/dist/css.js +3135 -0
- package/dist/css.js.map +1 -0
- package/dist/css.mjs +3135 -0
- package/dist/css.mjs.map +1 -0
- package/dist/index.d.mts +175 -164
- package/dist/index.d.ts +175 -164
- package/dist/index.esm.js +864 -1955
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +870 -1962
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +864 -1955
- package/dist/index.mjs.map +1 -1
- package/dist/sanity-theme.css +25 -0
- package/dist/system.css +2953 -0
- package/dist/theme.d.mts +84 -22
- package/dist/theme.d.ts +84 -22
- package/dist/theme.esm.js +232 -283
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +232 -283
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +232 -283
- package/dist/theme.mjs.map +1 -1
- package/exports/css.ts +1 -0
- package/package.json +25 -4
- package/src/core/__workshop__/constants.ts +15 -15
- package/src/core/__workshop__/fontsPlugin.tsx +1 -1
- package/src/core/components/autocomplete/autocomplete.styles.tsx +1 -1
- package/src/core/components/autocomplete/autocomplete.tsx +12 -4
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +1 -3
- package/src/core/components/breadcrumbs/__workshop__/index.ts +0 -5
- package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +14 -2
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +14 -9
- package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
- package/src/core/components/dialog/dialog.tsx +77 -92
- package/src/core/components/hotkeys/hotkeys.tsx +18 -29
- package/src/core/components/menu/menu.tsx +8 -5
- package/src/core/components/menu/menuDivider.ts +2 -1
- package/src/core/components/menu/menuGroup.tsx +16 -8
- package/src/core/components/menu/menuItem.tsx +23 -14
- package/src/core/components/skeleton/skeleton.tsx +1 -1
- package/src/core/components/skeleton/styles.ts +1 -1
- package/src/core/components/skeleton/textSkeleton.tsx +1 -1
- package/src/core/components/tab/tab.tsx +6 -7
- package/src/core/components/tab/tabList.tsx +3 -2
- package/src/core/components/toast/styles.ts +1 -1
- package/src/core/components/toast/toast.tsx +6 -4
- package/src/core/components/toast/toastProvider.tsx +31 -22
- package/src/core/components/tree/style.ts +1 -1
- package/src/core/components/tree/tree.tsx +8 -2
- package/src/core/components/tree/treeGroup.tsx +1 -1
- package/src/core/components/tree/treeItem.tsx +38 -25
- package/src/core/components/tree/types.ts +5 -1
- package/src/core/lib/styled/elements.ts +135 -0
- package/src/core/lib/styled/index.ts +2 -0
- package/src/core/lib/styled/members.ts +15 -0
- package/src/core/lib/styled/styled.ts +79 -0
- package/src/core/primitives/_selectable/selectable.tsx +27 -14
- package/src/core/primitives/avatar/avatar.tsx +52 -32
- package/src/core/primitives/avatar/avatarCounter.tsx +1 -1
- package/src/core/primitives/avatar/avatarStack.tsx +1 -1
- package/src/core/primitives/badge/__workshop__/tones.tsx +9 -16
- package/src/core/primitives/badge/badge.tsx +18 -20
- package/src/core/primitives/box/box.tsx +62 -74
- package/src/core/primitives/button/__workshop__/props.tsx +3 -1
- package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled1.tsx +1 -1
- package/src/core/primitives/button/__workshop__/styled2.tsx +1 -1
- package/src/core/primitives/button/button.tsx +38 -45
- package/src/core/primitives/button/styles.ts +2 -2
- package/src/core/primitives/card/RootCardContext.ts +3 -0
- package/src/core/primitives/card/__workshop__/selected.tsx +1 -1
- package/src/core/primitives/card/__workshop__/styled.tsx +1 -1
- package/src/core/primitives/card/card.tsx +44 -46
- package/src/core/primitives/card/styles.ts +1 -1
- package/src/core/primitives/checkbox/checkbox.tsx +6 -8
- package/src/core/primitives/code/code.tsx +23 -12
- package/src/core/primitives/code/styles.ts +1 -1
- package/src/core/primitives/container/container.tsx +7 -15
- package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
- package/src/core/primitives/flex/flex.tsx +6 -19
- package/src/core/primitives/grid/grid.tsx +2 -1
- package/src/core/primitives/heading/heading.tsx +32 -19
- package/src/core/primitives/heading/styles.ts +1 -1
- package/src/core/primitives/inline/inline.tsx +22 -13
- package/src/core/primitives/kbd/kbd.tsx +30 -37
- package/src/core/primitives/label/label.tsx +15 -4
- package/src/core/primitives/label/styles.ts +1 -1
- package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -1
- package/src/core/primitives/popover/popover.tsx +21 -15
- package/src/core/primitives/popover/popoverCard.tsx +36 -38
- package/src/core/primitives/radio/radio.tsx +1 -1
- package/src/core/primitives/radio/styles.ts +1 -1
- package/src/core/primitives/select/select.tsx +1 -1
- package/src/core/primitives/select/styles.ts +1 -1
- package/src/core/primitives/spinner/spinner.tsx +6 -20
- package/src/core/primitives/stack/stack.tsx +12 -10
- package/src/core/primitives/switch/styles.ts +9 -9
- package/src/core/primitives/switch/switch.tsx +20 -21
- package/src/core/primitives/text/__workshop__/colored.tsx +1 -1
- package/src/core/primitives/text/styles.ts +1 -2
- package/src/core/primitives/text/text.tsx +17 -21
- package/src/core/primitives/textArea/textArea.tsx +1 -1
- package/src/core/primitives/textInput/__workshop__/plain.tsx +1 -1
- package/src/core/primitives/textInput/textInput.tsx +176 -123
- package/src/core/primitives/tooltip/tooltip.test.tsx +1 -0
- package/src/core/primitives/tooltip/tooltip.tsx +13 -13
- package/src/core/primitives/tooltip/tooltipCard.tsx +15 -14
- package/src/core/primitives/types.ts +35 -16
- package/src/core/styles/border/borderStyle.ts +6 -0
- package/src/core/styles/border/types.ts +1 -0
- package/src/core/styles/box/boxStyle.ts +6 -0
- package/src/core/styles/card/_cardColorStyle.ts +0 -8
- package/src/core/styles/flex/flexStyle.ts +0 -18
- package/src/core/styles/flex/types.ts +1 -3
- package/src/core/styles/grid/gridStyle.ts +0 -10
- package/src/core/styles/helpers.ts +9 -0
- package/src/core/styles/input/textInputStyle.ts +1 -1
- package/src/core/theme/__workshop__/build/Root.tsx +1 -1
- package/src/core/theme/themeProvider.tsx +1 -1
- package/src/core/theme/useTheme.ts +1 -1
- package/src/core/types/avatar.ts +6 -1
- package/src/core/types/button.ts +1 -0
- package/src/core/types/flex.ts +27 -26
- package/src/core/types/gridItem.ts +32 -24
- package/src/core/types/radius.ts +7 -4
- package/src/core/utils/arrow/arrow.tsx +1 -1
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +1 -1
- package/src/core/utils/layer/layer.tsx +28 -11
- package/src/core/utils/srOnly/srOnly.tsx +1 -1
- package/src/core/utils/virtualList/virtualList.tsx +1 -1
- package/src/css/_resp.ts +28 -0
- package/src/css/cli/buildCommand.ts +36 -0
- package/src/css/cli/index.ts +38 -0
- package/src/css/compile/comileRules.ts +59 -0
- package/src/css/compile/compileRule.ts +58 -0
- package/src/css/compile/compileSystem.ts +7 -0
- package/src/css/compile/compileTheme.ts +509 -0
- package/src/css/components/breadcrumbs/breadcrumbs.ts +5 -0
- package/src/css/components/breadcrumbs/index.ts +1 -0
- package/src/css/components/breadcrumbs/rules.ts +7 -0
- package/src/css/components/dialog/classes.ts +29 -0
- package/src/css/components/dialog/index.ts +1 -0
- package/src/css/components/dialog/rules.ts +75 -0
- package/src/css/components/tree/index.ts +1 -0
- package/src/css/components/tree/rules.ts +52 -0
- package/src/css/components/tree/tree.ts +5 -0
- package/src/css/composeClassNames.ts +3 -0
- package/src/css/index.ts +47 -0
- package/src/css/primitives/avatar/avatar.ts +32 -0
- package/src/css/primitives/avatar/index.ts +2 -0
- package/src/css/primitives/avatar/rules.ts +190 -0
- package/src/css/primitives/avatar/types.ts +9 -0
- package/src/css/primitives/badge/badge.ts +8 -0
- package/src/css/primitives/badge/index.ts +2 -0
- package/src/css/primitives/badge/rules.ts +25 -0
- package/src/css/primitives/badge/types.ts +8 -0
- package/src/css/primitives/box/box.ts +34 -0
- package/src/css/primitives/box/index.ts +2 -0
- package/src/css/primitives/box/rules.ts +25 -0
- package/src/css/primitives/box/types.ts +49 -0
- package/src/css/primitives/button/button.ts +26 -0
- package/src/css/primitives/button/index.ts +1 -0
- package/src/css/primitives/button/rules.ts +58 -0
- package/src/css/primitives/card/card.ts +21 -0
- package/src/css/primitives/card/index.ts +1 -0
- package/src/css/primitives/card/rules.ts +93 -0
- package/src/{core/primitives/checkbox/styles.ts → css/primitives/checkbox/__styles.ts} +3 -3
- package/src/css/primitives/checkbox/checkbox.ts +9 -0
- package/src/css/primitives/checkbox/index.ts +1 -0
- package/src/css/primitives/checkbox/rules.ts +136 -0
- package/src/css/primitives/code/code.ts +9 -0
- package/src/css/primitives/code/index.ts +2 -0
- package/src/css/primitives/code/rules.ts +71 -0
- package/src/css/primitives/code/types.ts +10 -0
- package/src/css/primitives/container/container.ts +7 -0
- package/src/css/primitives/container/index.ts +2 -0
- package/src/css/primitives/container/rules.ts +8 -0
- package/src/css/primitives/container/types.ts +6 -0
- package/src/css/primitives/heading/heading.ts +16 -0
- package/src/css/primitives/heading/index.ts +2 -0
- package/src/css/primitives/heading/rules.ts +84 -0
- package/src/css/primitives/heading/types.ts +12 -0
- package/src/css/primitives/kbd/index.ts +2 -0
- package/src/css/primitives/kbd/kbd.ts +7 -0
- package/src/css/primitives/kbd/rules.ts +20 -0
- package/src/css/primitives/kbd/types.ts +5 -0
- package/src/css/primitives/label/index.ts +2 -0
- package/src/css/primitives/label/label.ts +16 -0
- package/src/css/primitives/label/rules.ts +85 -0
- package/src/css/primitives/label/types.ts +12 -0
- package/src/css/primitives/popover/index.ts +1 -0
- package/src/css/primitives/popover/popover.ts +5 -0
- package/src/css/primitives/popover/rules.ts +5 -0
- package/src/css/primitives/radio/index.ts +1 -0
- package/src/css/primitives/radio/radio.ts +5 -0
- package/src/css/primitives/radio/rules.ts +5 -0
- package/src/css/primitives/select/index.ts +1 -0
- package/src/css/primitives/select/rules.ts +5 -0
- package/src/css/primitives/select/select.ts +5 -0
- package/src/{core/primitives/_selectable/style.ts → css/primitives/selectable/__style.ts} +5 -4
- package/src/css/primitives/selectable/index.ts +2 -0
- package/src/css/primitives/selectable/rules.ts +27 -0
- package/src/css/primitives/selectable/selectable.ts +9 -0
- package/src/css/primitives/selectable/types.ts +6 -0
- package/src/css/primitives/spinner/index.ts +1 -0
- package/src/css/primitives/spinner/rules.ts +22 -0
- package/src/css/primitives/spinner/spinner.ts +5 -0
- package/src/css/primitives/switch/index.ts +1 -0
- package/src/css/primitives/switch/rules.ts +132 -0
- package/src/css/primitives/switch/switch.ts +5 -0
- package/src/css/primitives/text/index.ts +2 -0
- package/src/css/primitives/text/rules.ts +75 -0
- package/src/css/primitives/text/text.ts +16 -0
- package/src/css/primitives/text/types.ts +11 -0
- package/src/css/primitives/textArea/index.ts +1 -0
- package/src/css/primitives/textArea/rules.ts +5 -0
- package/src/css/primitives/textArea/textArea.ts +5 -0
- package/src/css/primitives/textInput/index.ts +1 -0
- package/src/css/primitives/textInput/rules.ts +226 -0
- package/src/css/primitives/textInput/textInput.ts +7 -0
- package/src/css/primitives/token/rules.ts +45 -0
- package/src/css/primitives/tooltip/index.ts +1 -0
- package/src/css/primitives/tooltip/rules.ts +17 -0
- package/src/css/primitives/tooltip/tooltip.ts +9 -0
- package/src/css/responsiveRules.ts +25 -0
- package/src/css/rules.ts +121 -0
- package/src/css/styles/border/border.ts +22 -0
- package/src/css/styles/border/index.ts +2 -0
- package/src/css/styles/border/rules.ts +24 -0
- package/src/css/styles/border/types.ts +10 -0
- package/src/css/styles/display/rules.ts +62 -0
- package/src/css/styles/flex/flex.ts +20 -0
- package/src/css/styles/flex/index.ts +2 -0
- package/src/css/styles/flex/rules.ts +28 -0
- package/src/css/styles/flex/types.ts +35 -0
- package/src/css/styles/flexItem/flexItem.ts +8 -0
- package/src/css/styles/flexItem/index.ts +2 -0
- package/src/css/styles/flexItem/rules.ts +11 -0
- package/src/css/styles/flexItem/types.ts +11 -0
- package/src/css/styles/font/font.ts +12 -0
- package/src/css/styles/font/index.ts +2 -0
- package/src/css/styles/font/rules.ts +125 -0
- package/src/css/styles/font/types.ts +6 -0
- package/src/css/styles/gap/gap.ts +8 -0
- package/src/css/styles/gap/index.ts +2 -0
- package/src/css/styles/gap/rules.ts +33 -0
- package/src/css/styles/gap/types.ts +9 -0
- package/src/css/styles/grid/rules.ts +35 -0
- package/src/css/styles/gridItem/gridItem.ts +15 -0
- package/src/css/styles/gridItem/index.ts +2 -0
- package/src/css/styles/gridItem/rules.ts +96 -0
- package/src/css/styles/gridItem/types.ts +41 -0
- package/src/css/styles/height/rules.ts +7 -0
- package/src/css/styles/margin/index.ts +2 -0
- package/src/css/styles/margin/margin.ts +15 -0
- package/src/css/styles/margin/rules.ts +59 -0
- package/src/css/styles/margin/types.ts +11 -0
- package/src/css/styles/maxWidth/index.ts +2 -0
- package/src/css/styles/maxWidth/maxWidth.ts +6 -0
- package/src/css/styles/maxWidth/rules.ts +36 -0
- package/src/css/styles/maxWidth/types.ts +6 -0
- package/src/css/styles/overflow/rules.ts +9 -0
- package/src/css/styles/padding/index.ts +2 -0
- package/src/css/styles/padding/padding.ts +15 -0
- package/src/css/styles/padding/rules.ts +59 -0
- package/src/css/styles/padding/types.ts +12 -0
- package/src/css/styles/pointerEvents/index.ts +2 -0
- package/src/css/styles/pointerEvents/pointerEvents.ts +6 -0
- package/src/css/styles/pointerEvents/rules.ts +11 -0
- package/src/css/styles/pointerEvents/types.ts +7 -0
- package/src/css/styles/position/index.ts +2 -0
- package/src/css/styles/position/position.ts +7 -0
- package/src/css/styles/position/rules.ts +31 -0
- package/src/css/styles/position/types.ts +13 -0
- package/src/css/styles/radius/index.ts +2 -0
- package/src/css/styles/radius/radius.ts +8 -0
- package/src/css/styles/radius/rules.ts +13 -0
- package/src/css/styles/radius/types.ts +7 -0
- package/src/css/styles/shadow/rules.ts +53 -0
- package/src/css/styles/width/index.ts +2 -0
- package/src/css/styles/width/rules.ts +7 -0
- package/src/css/styles/width/types.ts +8 -0
- package/src/css/styles/width/width.ts +6 -0
- package/src/css/types.ts +591 -0
- package/src/css/varNames.ts +381 -0
- package/src/css/vars.ts +313 -0
- package/src/theme/build/_deprecated/color/factory.ts +1 -1
- package/src/theme/build/_deprecated/color/muted/createMuted.ts +2 -2
- package/src/theme/build/buildColorTheme.ts +39 -45
- package/src/theme/build/renderColorTheme.ts +65 -239
- package/src/theme/build/resolveColorTokens.ts +115 -51
- package/src/theme/config/tokens/color/types.ts +18 -4
- package/src/theme/defaults/colorTokens.ts +10 -17
- package/src/theme/defaults/config.ts +1 -1
- package/src/theme/getScopedTheme.ts +2 -9
- package/src/theme/system/_constants.ts +25 -0
- package/src/theme/system/_types.ts +41 -0
- package/src/theme/system/color/_constants.ts +0 -8
- package/src/theme/system/color/badge.ts +7 -3
- package/src/theme/system/index.ts +2 -0
- package/src/theme/system/v0/color/_system.ts +4 -8
- package/src/theme/system/v0/color/color.ts +2 -3
- package/src/theme/versioning/themeColor_v0_v2.ts +0 -26
- package/src/theme/versioning/v0_v2.ts +0 -4
- package/src/core/components/breadcrumbs/__workshop__/buttons.tsx +0 -58
- package/src/core/components/dialog/styles.ts +0 -76
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {ColorHueKey} from '@sanity/color'
|
|
2
2
|
import {
|
|
3
3
|
ColorConfigCardTone,
|
|
4
4
|
ColorConfigInputMode,
|
|
5
5
|
ColorConfigInputState,
|
|
6
6
|
ColorConfigStateTone,
|
|
7
|
-
ThemeColorAvatarTokens,
|
|
8
|
-
ThemeColorBadgeTokens,
|
|
9
7
|
ThemeColorBaseTokens,
|
|
10
8
|
ThemeColorButtonTokens,
|
|
11
9
|
ThemeColorInputStateTokens,
|
|
@@ -66,22 +64,44 @@ function resolveBaseColorTones(
|
|
|
66
64
|
return {
|
|
67
65
|
...spec,
|
|
68
66
|
_hue: hue,
|
|
69
|
-
avatar:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
67
|
+
avatar: {
|
|
68
|
+
gray: merge({_hue: 'gray'}, spec.avatar?.['*'], spec.avatar?.gray),
|
|
69
|
+
blue: merge({_hue: 'blue'}, spec.avatar?.['*'], spec.avatar?.blue),
|
|
70
|
+
purple: merge({_hue: 'purple'}, spec.avatar?.['*'], spec.avatar?.purple),
|
|
71
|
+
magenta: merge({_hue: 'magenta'}, spec.avatar?.['*'], spec.avatar?.magenta),
|
|
72
|
+
red: merge({_hue: 'red'}, spec.avatar?.['*'], spec.avatar?.red),
|
|
73
|
+
orange: merge({_hue: 'orange'}, spec.avatar?.['*'], spec.avatar?.orange),
|
|
74
|
+
yellow: merge({_hue: 'yellow'}, spec.avatar?.['*'], spec.avatar?.yellow),
|
|
75
|
+
green: merge({_hue: 'green'}, spec.avatar?.['*'], spec.avatar?.green),
|
|
76
|
+
cyan: merge({_hue: 'cyan'}, spec.avatar?.['*'], spec.avatar?.cyan),
|
|
77
|
+
},
|
|
78
|
+
badge: {
|
|
79
|
+
default: {
|
|
80
|
+
_hue: inputTokens?.base?.default?._hue || hue,
|
|
81
|
+
...spec.badge?.['*'],
|
|
82
|
+
...spec.badge?.default,
|
|
83
|
+
},
|
|
84
|
+
primary: {
|
|
85
|
+
_hue: inputTokens?.base?.primary?._hue || hue,
|
|
86
|
+
...spec.badge?.['*'],
|
|
87
|
+
...spec.badge?.primary,
|
|
88
|
+
},
|
|
89
|
+
positive: {
|
|
90
|
+
_hue: inputTokens?.base?.positive?._hue || hue,
|
|
91
|
+
...spec.badge?.['*'],
|
|
92
|
+
...spec.badge?.positive,
|
|
93
|
+
},
|
|
94
|
+
caution: {
|
|
95
|
+
_hue: inputTokens?.base?.caution?._hue || hue,
|
|
96
|
+
...spec.badge?.['*'],
|
|
97
|
+
...spec.badge?.caution,
|
|
98
|
+
},
|
|
99
|
+
critical: {
|
|
100
|
+
_hue: inputTokens?.base?.critical?._hue || hue,
|
|
101
|
+
...spec.badge?.['*'],
|
|
102
|
+
...spec.badge?.critical,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
85
105
|
}
|
|
86
106
|
}
|
|
87
107
|
|
|
@@ -142,22 +162,44 @@ function resolveButtonStateColorTokens(
|
|
|
142
162
|
return {
|
|
143
163
|
...spec,
|
|
144
164
|
_hue: hue,
|
|
145
|
-
avatar:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
165
|
+
avatar: {
|
|
166
|
+
gray: merge({_hue: 'gray'}, spec.avatar?.['*'], spec.avatar?.gray),
|
|
167
|
+
blue: merge({_hue: 'blue'}, spec.avatar?.['*'], spec.avatar?.blue),
|
|
168
|
+
purple: merge({_hue: 'purple'}, spec.avatar?.['*'], spec.avatar?.purple),
|
|
169
|
+
magenta: merge({_hue: 'magenta'}, spec.avatar?.['*'], spec.avatar?.magenta),
|
|
170
|
+
red: merge({_hue: 'red'}, spec.avatar?.['*'], spec.avatar?.red),
|
|
171
|
+
orange: merge({_hue: 'orange'}, spec.avatar?.['*'], spec.avatar?.orange),
|
|
172
|
+
yellow: merge({_hue: 'yellow'}, spec.avatar?.['*'], spec.avatar?.yellow),
|
|
173
|
+
green: merge({_hue: 'green'}, spec.avatar?.['*'], spec.avatar?.green),
|
|
174
|
+
cyan: merge({_hue: 'cyan'}, spec.avatar?.['*'], spec.avatar?.cyan),
|
|
175
|
+
},
|
|
176
|
+
badge: {
|
|
177
|
+
default: {
|
|
178
|
+
_hue: inputTokens?.base?.default?._hue,
|
|
179
|
+
...spec.badge?.['*'],
|
|
180
|
+
...spec.badge?.default,
|
|
181
|
+
},
|
|
182
|
+
primary: {
|
|
183
|
+
_hue: inputTokens?.base?.primary?._hue,
|
|
184
|
+
...spec.badge?.['*'],
|
|
185
|
+
...spec.badge?.primary,
|
|
186
|
+
},
|
|
187
|
+
positive: {
|
|
188
|
+
_hue: inputTokens?.base?.positive?._hue,
|
|
189
|
+
...spec.badge?.['*'],
|
|
190
|
+
...spec.badge?.positive,
|
|
191
|
+
},
|
|
192
|
+
caution: {
|
|
193
|
+
_hue: inputTokens?.base?.caution?._hue,
|
|
194
|
+
...spec.badge?.['*'],
|
|
195
|
+
...spec.badge?.caution,
|
|
196
|
+
},
|
|
197
|
+
critical: {
|
|
198
|
+
_hue: inputTokens?.base?.critical?._hue,
|
|
199
|
+
...spec.badge?.['*'],
|
|
200
|
+
...spec.badge?.critical,
|
|
201
|
+
},
|
|
202
|
+
},
|
|
161
203
|
}
|
|
162
204
|
}
|
|
163
205
|
|
|
@@ -247,21 +289,43 @@ function resolveSelectableStateColorTokens(
|
|
|
247
289
|
return {
|
|
248
290
|
...spec,
|
|
249
291
|
_hue: hue,
|
|
250
|
-
avatar:
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
292
|
+
avatar: {
|
|
293
|
+
gray: merge({_hue: 'gray'}, spec.avatar?.['*'], spec.avatar?.gray),
|
|
294
|
+
blue: merge({_hue: 'blue'}, spec.avatar?.['*'], spec.avatar?.blue),
|
|
295
|
+
purple: merge({_hue: 'purple'}, spec.avatar?.['*'], spec.avatar?.purple),
|
|
296
|
+
magenta: merge({_hue: 'magenta'}, spec.avatar?.['*'], spec.avatar?.magenta),
|
|
297
|
+
red: merge({_hue: 'red'}, spec.avatar?.['*'], spec.avatar?.red),
|
|
298
|
+
orange: merge({_hue: 'orange'}, spec.avatar?.['*'], spec.avatar?.orange),
|
|
299
|
+
yellow: merge({_hue: 'yellow'}, spec.avatar?.['*'], spec.avatar?.yellow),
|
|
300
|
+
green: merge({_hue: 'green'}, spec.avatar?.['*'], spec.avatar?.green),
|
|
301
|
+
cyan: merge({_hue: 'cyan'}, spec.avatar?.['*'], spec.avatar?.cyan),
|
|
302
|
+
},
|
|
303
|
+
badge: {
|
|
304
|
+
default: {
|
|
305
|
+
_hue: inputTokens?.base?.default?._hue,
|
|
306
|
+
...spec.badge?.['*'],
|
|
307
|
+
...spec.badge?.default,
|
|
308
|
+
},
|
|
309
|
+
primary: {
|
|
310
|
+
_hue: inputTokens?.base?.primary?._hue,
|
|
311
|
+
...spec.badge?.['*'],
|
|
312
|
+
...spec.badge?.primary,
|
|
313
|
+
},
|
|
314
|
+
positive: {
|
|
315
|
+
_hue: inputTokens?.base?.positive?._hue,
|
|
316
|
+
...spec.badge?.['*'],
|
|
317
|
+
...spec.badge?.positive,
|
|
318
|
+
},
|
|
319
|
+
caution: {
|
|
320
|
+
_hue: inputTokens?.base?.caution?._hue,
|
|
321
|
+
...spec.badge?.['*'],
|
|
322
|
+
...spec.badge?.caution,
|
|
323
|
+
},
|
|
324
|
+
critical: {
|
|
325
|
+
_hue: inputTokens?.base?.critical?._hue,
|
|
326
|
+
...spec.badge?.['*'],
|
|
327
|
+
...spec.badge?.critical,
|
|
328
|
+
},
|
|
329
|
+
},
|
|
266
330
|
}
|
|
267
331
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {ColorHueKey} from '@sanity/color'
|
|
2
|
-
import {ThemeColorSyntax, ThemeColorButtonModeKey
|
|
2
|
+
import {ThemeColorSyntax, ThemeColorButtonModeKey} from '../../../system'
|
|
3
3
|
import {
|
|
4
4
|
ColorBlendModeTokenValue,
|
|
5
5
|
ColorConfigCardTone,
|
|
@@ -32,6 +32,15 @@ export interface ThemeColorAvatarTokens {
|
|
|
32
32
|
'cyan'?: ThemeColorAvatarHueTokens
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/** @public */
|
|
36
|
+
export interface ThemeColorBadgeTokens {
|
|
37
|
+
_hue?: ColorHueKey
|
|
38
|
+
bg?: ThemeColorTokenValue
|
|
39
|
+
fg?: ThemeColorTokenValue
|
|
40
|
+
dot?: ThemeColorTokenValue
|
|
41
|
+
icon?: ThemeColorTokenValue
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
/** @public */
|
|
36
45
|
export interface ThemeColorBaseTokens extends ThemeColorStateTokens {
|
|
37
46
|
focusRing?: ThemeColorTokenValue
|
|
@@ -55,9 +64,14 @@ export interface ThemeColorBadgeToneTokens {
|
|
|
55
64
|
}
|
|
56
65
|
|
|
57
66
|
/** @public */
|
|
58
|
-
export
|
|
59
|
-
|
|
60
|
-
|
|
67
|
+
export interface ThemeColorBadgeTokens {
|
|
68
|
+
'*'?: ThemeColorBadgeToneTokens
|
|
69
|
+
'default'?: ThemeColorBadgeToneTokens
|
|
70
|
+
'primary'?: ThemeColorBadgeToneTokens
|
|
71
|
+
'positive'?: ThemeColorBadgeToneTokens
|
|
72
|
+
'caution'?: ThemeColorBadgeToneTokens
|
|
73
|
+
'critical'?: ThemeColorBadgeToneTokens
|
|
74
|
+
}
|
|
61
75
|
|
|
62
76
|
/** @public */
|
|
63
77
|
export interface ThemeColorStateTokens {
|
|
@@ -22,9 +22,6 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
22
22
|
icon: ['500', '500'],
|
|
23
23
|
dot: ['500', '500'],
|
|
24
24
|
},
|
|
25
|
-
'default': {
|
|
26
|
-
_hue: 'gray',
|
|
27
|
-
},
|
|
28
25
|
'positive': {
|
|
29
26
|
bg: ['200 50%', '900'],
|
|
30
27
|
fg: ['600', '500'],
|
|
@@ -41,7 +38,7 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
41
38
|
fg: ['600', '400'],
|
|
42
39
|
},
|
|
43
40
|
fg: ['800', '200'],
|
|
44
|
-
focusRing: ['
|
|
41
|
+
focusRing: ['blue/500', 'blue/500'],
|
|
45
42
|
icon: ['600', '400'],
|
|
46
43
|
kbd: {
|
|
47
44
|
bg: ['white', 'black'],
|
|
@@ -49,7 +46,7 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
49
46
|
border: ['200', '800'],
|
|
50
47
|
},
|
|
51
48
|
link: {
|
|
52
|
-
fg: ['
|
|
49
|
+
fg: ['blue/600', 'blue/300'],
|
|
53
50
|
},
|
|
54
51
|
muted: {
|
|
55
52
|
bg: ['50', '950'],
|
|
@@ -76,7 +73,7 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
76
73
|
fg: ['600', '400'],
|
|
77
74
|
},
|
|
78
75
|
},
|
|
79
|
-
'primary': {_hue: '
|
|
76
|
+
'primary': {_hue: 'blue'},
|
|
80
77
|
'positive': {
|
|
81
78
|
_hue: 'green',
|
|
82
79
|
shadow: {outline: ['500/0.4', '500/0.4']},
|
|
@@ -86,8 +83,6 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
86
83
|
shadow: {outline: ['600/0.3', '500/0.4']},
|
|
87
84
|
},
|
|
88
85
|
'critical': {_hue: 'red'},
|
|
89
|
-
'prospect': {_hue: 'purple'},
|
|
90
|
-
'explore': {_hue: 'cyan'},
|
|
91
86
|
},
|
|
92
87
|
button: {
|
|
93
88
|
default: {
|
|
@@ -126,7 +121,7 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
126
121
|
border: ['800', '200'],
|
|
127
122
|
},
|
|
128
123
|
link: {
|
|
129
|
-
fg: ['
|
|
124
|
+
fg: ['blue/200', 'blue/600'],
|
|
130
125
|
},
|
|
131
126
|
muted: {
|
|
132
127
|
bg: ['950', '50'],
|
|
@@ -249,7 +244,7 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
249
244
|
border: ['200', '800'],
|
|
250
245
|
},
|
|
251
246
|
link: {
|
|
252
|
-
fg: ['
|
|
247
|
+
fg: ['blue/700 60%', 'blue/300 60%'],
|
|
253
248
|
},
|
|
254
249
|
muted: {
|
|
255
250
|
bg: ['100', '950'],
|
|
@@ -360,7 +355,7 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
360
355
|
border: ['200', '800'],
|
|
361
356
|
},
|
|
362
357
|
link: {
|
|
363
|
-
fg: ['
|
|
358
|
+
fg: ['blue/700 70%', 'blue/300 70%'],
|
|
364
359
|
},
|
|
365
360
|
muted: {
|
|
366
361
|
bg: ['100', '950'],
|
|
@@ -373,8 +368,7 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
373
368
|
},
|
|
374
369
|
'hovered': {
|
|
375
370
|
bg: ['50', '950'],
|
|
376
|
-
|
|
377
|
-
icon: ['800 70%', '300 70%'],
|
|
371
|
+
icon: ['700 70%', '400 70%'],
|
|
378
372
|
},
|
|
379
373
|
'pressed': {
|
|
380
374
|
bg: ['100', '900'],
|
|
@@ -498,7 +492,7 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
498
492
|
border: ['200', '800'],
|
|
499
493
|
},
|
|
500
494
|
link: {
|
|
501
|
-
fg: ['
|
|
495
|
+
fg: ['blue/700 70%', 'blue/300 70%'],
|
|
502
496
|
},
|
|
503
497
|
muted: {
|
|
504
498
|
bg: ['50', '950'],
|
|
@@ -513,7 +507,6 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
513
507
|
bg: ['50', '950'],
|
|
514
508
|
},
|
|
515
509
|
'pressed': {
|
|
516
|
-
// _hue: 'purple',
|
|
517
510
|
bg: ['100', '900'],
|
|
518
511
|
},
|
|
519
512
|
'selected': {
|
|
@@ -550,7 +543,7 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
550
543
|
border: ['800', '200'],
|
|
551
544
|
},
|
|
552
545
|
link: {
|
|
553
|
-
fg: ['
|
|
546
|
+
fg: ['blue/200', 'blue/600'],
|
|
554
547
|
},
|
|
555
548
|
muted: {
|
|
556
549
|
bg: ['500 10%', '400 10%'],
|
|
@@ -605,7 +598,7 @@ export const defaultColorTokens: ThemeColorTokens = {
|
|
|
605
598
|
},
|
|
606
599
|
'default': {
|
|
607
600
|
selected: {
|
|
608
|
-
_hue: '
|
|
601
|
+
_hue: 'blue',
|
|
609
602
|
},
|
|
610
603
|
},
|
|
611
604
|
'critical': {
|
|
@@ -31,7 +31,7 @@ export const defaultThemeConfig: Omit<RootTheme_v2, 'color' | 'font'> = {
|
|
|
31
31
|
popover: {zOffset: 400},
|
|
32
32
|
tooltip: {zOffset: 200},
|
|
33
33
|
},
|
|
34
|
-
radius: [0, 1,
|
|
34
|
+
radius: [0, 1, 5, 9, 13, 21, 33],
|
|
35
35
|
shadow: [
|
|
36
36
|
null,
|
|
37
37
|
{umbra: [0, 0, 0, 0], penumbra: [0, 0, 0, 0], ambient: [0, 0, 0, 0]},
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import {defaultThemeConfig} from './defaults/config'
|
|
2
|
-
import {
|
|
3
|
-
RootTheme,
|
|
4
|
-
RootTheme_v2,
|
|
5
|
-
Theme,
|
|
6
|
-
ThemeColor,
|
|
7
|
-
ThemeColorCardToneKey,
|
|
8
|
-
ThemeColorSchemeKey,
|
|
9
|
-
} from './system'
|
|
2
|
+
import {RootTheme, RootTheme_v2, Theme, ThemeColorCardToneKey, ThemeColorSchemeKey} from './system'
|
|
10
3
|
import {is_v2, v0_v2, v2_v0} from './versioning'
|
|
11
4
|
|
|
12
5
|
// cache[scheme][tone][rootTheme] = theme
|
|
@@ -29,7 +22,7 @@ export function getScopedTheme(
|
|
|
29
22
|
const v2 = is_v2(themeProp) ? themeProp : v0_v2(themeProp)
|
|
30
23
|
|
|
31
24
|
const colorScheme_v0 = v0.color[scheme] || v0.color.light
|
|
32
|
-
const color_v0 =
|
|
25
|
+
const color_v0 = colorScheme_v0[tone] || colorScheme_v0.default
|
|
33
26
|
const layer_v0 = v0.layer || defaultThemeConfig.layer
|
|
34
27
|
|
|
35
28
|
const colorScheme_v2 = v2.color[scheme] || v2.color.light
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** @public */
|
|
2
|
+
export const AVATAR_SIZE = [0, 1, 2, 3] as const
|
|
3
|
+
|
|
4
|
+
/** @public */
|
|
5
|
+
export const CONTAINER = [0, 1, 2, 3, 4, 5] as const
|
|
6
|
+
|
|
7
|
+
/** @public */
|
|
8
|
+
export const RADIUS = [0, 1, 2, 3, 4, 5, 6, 'full'] as const
|
|
9
|
+
|
|
10
|
+
/** @public */
|
|
11
|
+
export const SPACE = [0, 0.5, 1, 2, 3, 4, 5, 6, 7, 8, 9] as const
|
|
12
|
+
|
|
13
|
+
/** @public */
|
|
14
|
+
export const FONT_CODE_SIZE = [0, 1, 2, 3, 4, 5] as const
|
|
15
|
+
|
|
16
|
+
/** @public */
|
|
17
|
+
export const FONT_HEADING_SIZE = [0, 1, 2, 3, 4, 5, 6] as const
|
|
18
|
+
|
|
19
|
+
/** @public */
|
|
20
|
+
export const FONT_LABEL_SIZE = [0, 1, 2, 3, 4, 5, 6] as const
|
|
21
|
+
|
|
22
|
+
/** @public */
|
|
23
|
+
export const FONT_TEXT_SIZE = [0, 1, 2, 3, 4, 5] as const
|
|
24
|
+
|
|
25
|
+
export const SHADOW = [0, 1, 2, 3, 4, 5] as const
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AVATAR_SIZE,
|
|
3
|
+
CONTAINER,
|
|
4
|
+
FONT_CODE_SIZE,
|
|
5
|
+
FONT_HEADING_SIZE,
|
|
6
|
+
FONT_LABEL_SIZE,
|
|
7
|
+
FONT_TEXT_SIZE,
|
|
8
|
+
RADIUS,
|
|
9
|
+
SHADOW,
|
|
10
|
+
SPACE,
|
|
11
|
+
} from './_constants'
|
|
12
|
+
|
|
13
|
+
/** @public */
|
|
14
|
+
export type AvatarSize = (typeof AVATAR_SIZE)[number]
|
|
15
|
+
|
|
16
|
+
/** @public */
|
|
17
|
+
export type ContainerWidth = (typeof CONTAINER)[number] | 'auto'
|
|
18
|
+
|
|
19
|
+
/** @public */
|
|
20
|
+
export type Radius = (typeof RADIUS)[number] | 'full'
|
|
21
|
+
|
|
22
|
+
/** @public */
|
|
23
|
+
export type Space = (typeof SPACE)[number]
|
|
24
|
+
|
|
25
|
+
/** @public */
|
|
26
|
+
export type FontWeight = 'regular' | 'medium' | 'semibold' | 'bold'
|
|
27
|
+
|
|
28
|
+
/** @public */
|
|
29
|
+
export type FontCodeSize = (typeof FONT_CODE_SIZE)[number]
|
|
30
|
+
|
|
31
|
+
/** @public */
|
|
32
|
+
export type FontHeadingSize = (typeof FONT_HEADING_SIZE)[number]
|
|
33
|
+
|
|
34
|
+
/** @public */
|
|
35
|
+
export type FontLabelSize = (typeof FONT_LABEL_SIZE)[number]
|
|
36
|
+
|
|
37
|
+
/** @public */
|
|
38
|
+
export type FontTextSize = (typeof FONT_TEXT_SIZE)[number]
|
|
39
|
+
|
|
40
|
+
/** @public */
|
|
41
|
+
export type Shadow = (typeof SHADOW)[number]
|
|
@@ -14,10 +14,6 @@ export const THEME_COLOR_CARD_TONES = [
|
|
|
14
14
|
'positive',
|
|
15
15
|
'caution',
|
|
16
16
|
'critical',
|
|
17
|
-
|
|
18
|
-
// new
|
|
19
|
-
'prospect',
|
|
20
|
-
'explore',
|
|
21
17
|
] as const
|
|
22
18
|
|
|
23
19
|
/** @public */
|
|
@@ -27,10 +23,6 @@ export const THEME_COLOR_STATE_TONES = [
|
|
|
27
23
|
'positive',
|
|
28
24
|
'caution',
|
|
29
25
|
'critical',
|
|
30
|
-
|
|
31
|
-
// new
|
|
32
|
-
'prospect',
|
|
33
|
-
'explore',
|
|
34
26
|
] as const
|
|
35
27
|
|
|
36
28
|
/** @public */
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {ThemeColorStateToneKey} from './_system'
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* @public
|
|
5
3
|
*/
|
|
@@ -13,4 +11,10 @@ export interface ThemeColorBadgeTone_v2 {
|
|
|
13
11
|
/**
|
|
14
12
|
* @public
|
|
15
13
|
*/
|
|
16
|
-
export
|
|
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
|
|
20
|
+
}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
+
import {ThemeColorCardToneKey} from '../../color/_system'
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* @public
|
|
3
5
|
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
4
6
|
*/
|
|
5
|
-
export type ThemeColorName =
|
|
6
|
-
| 'transparent'
|
|
7
|
-
| 'default'
|
|
8
|
-
| 'primary'
|
|
9
|
-
| 'positive'
|
|
10
|
-
| 'caution'
|
|
11
|
-
| 'critical'
|
|
7
|
+
export type ThemeColorName = ThemeColorCardToneKey
|
|
12
8
|
|
|
13
9
|
/**
|
|
14
10
|
* @public
|
|
15
11
|
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
16
12
|
*/
|
|
17
|
-
export type ThemeColorToneKey =
|
|
13
|
+
export type ThemeColorToneKey = ThemeColorCardToneKey
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {ThemeColorSchemeKey, ThemeColorSyntax} from '../../color'
|
|
1
|
+
import {ThemeColorCardToneKey, ThemeColorSchemeKey, ThemeColorSyntax} from '../../color'
|
|
2
2
|
import {ThemeColorGenericState} from './_generic'
|
|
3
|
-
import {ThemeColorName} from './_system'
|
|
4
3
|
import {ThemeColorBase} from './base'
|
|
5
4
|
import {ThemeColorButton} from './button'
|
|
6
5
|
import {ThemeColorCard} from './card'
|
|
@@ -31,7 +30,7 @@ export interface ThemeColor extends Partial<Omit<ThemeColorGenericState, 'muted'
|
|
|
31
30
|
* @public
|
|
32
31
|
* @deprecated Use `ThemeColorScheme_v2` instead.
|
|
33
32
|
*/
|
|
34
|
-
export type ThemeColorScheme = Record<
|
|
33
|
+
export type ThemeColorScheme = Record<ThemeColorCardToneKey, ThemeColor>
|
|
35
34
|
|
|
36
35
|
/**
|
|
37
36
|
* @public
|
|
@@ -103,20 +103,6 @@ function stateTonesThemeColor_v0_v2(
|
|
|
103
103
|
selected: stateThemeColor_v0_v2(v0, t.critical.selected),
|
|
104
104
|
disabled: stateThemeColor_v0_v2(v0, t.critical.disabled),
|
|
105
105
|
},
|
|
106
|
-
prospect: {
|
|
107
|
-
enabled: stateThemeColor_v0_v2(v0, t.default.enabled),
|
|
108
|
-
hovered: stateThemeColor_v0_v2(v0, t.default.hovered),
|
|
109
|
-
pressed: stateThemeColor_v0_v2(v0, t.default.pressed),
|
|
110
|
-
selected: stateThemeColor_v0_v2(v0, t.default.selected),
|
|
111
|
-
disabled: stateThemeColor_v0_v2(v0, t.default.disabled),
|
|
112
|
-
},
|
|
113
|
-
explore: {
|
|
114
|
-
enabled: stateThemeColor_v0_v2(v0, t.default.enabled),
|
|
115
|
-
hovered: stateThemeColor_v0_v2(v0, t.default.hovered),
|
|
116
|
-
pressed: stateThemeColor_v0_v2(v0, t.default.pressed),
|
|
117
|
-
selected: stateThemeColor_v0_v2(v0, t.default.selected),
|
|
118
|
-
disabled: stateThemeColor_v0_v2(v0, t.default.disabled),
|
|
119
|
-
},
|
|
120
106
|
}
|
|
121
107
|
}
|
|
122
108
|
|
|
@@ -192,18 +178,6 @@ function stateThemeColor_v0_v2(v0: ThemeColor, state: ThemeColorGenericState): T
|
|
|
192
178
|
dot: v0.muted.critical.enabled.muted.fg,
|
|
193
179
|
icon: v0.muted.critical.enabled.muted.fg,
|
|
194
180
|
},
|
|
195
|
-
prospect: {
|
|
196
|
-
bg: v0.muted.default.enabled.bg,
|
|
197
|
-
fg: v0.muted.default.enabled.fg,
|
|
198
|
-
dot: v0.muted.default.enabled.muted.fg,
|
|
199
|
-
icon: v0.muted.default.enabled.muted.fg,
|
|
200
|
-
},
|
|
201
|
-
explore: {
|
|
202
|
-
bg: v0.muted.default.enabled.bg,
|
|
203
|
-
fg: v0.muted.default.enabled.fg,
|
|
204
|
-
dot: v0.muted.default.enabled.muted.fg,
|
|
205
|
-
icon: v0.muted.default.enabled.muted.fg,
|
|
206
|
-
},
|
|
207
181
|
},
|
|
208
182
|
kbd: {
|
|
209
183
|
bg: v0.muted.default.enabled.bg,
|
|
@@ -48,8 +48,6 @@ export function v0_v2(v0: RootTheme): RootTheme_v2 {
|
|
|
48
48
|
positive: themeColor_v0_v2(color.light.positive),
|
|
49
49
|
caution: themeColor_v0_v2(color.light.caution),
|
|
50
50
|
critical: themeColor_v0_v2(color.light.critical),
|
|
51
|
-
prospect: themeColor_v0_v2(color.light.default),
|
|
52
|
-
explore: themeColor_v0_v2(color.light.default),
|
|
53
51
|
},
|
|
54
52
|
dark: {
|
|
55
53
|
transparent: themeColor_v0_v2(color.dark.transparent),
|
|
@@ -58,8 +56,6 @@ export function v0_v2(v0: RootTheme): RootTheme_v2 {
|
|
|
58
56
|
positive: themeColor_v0_v2(color.dark.positive),
|
|
59
57
|
caution: themeColor_v0_v2(color.dark.caution),
|
|
60
58
|
critical: themeColor_v0_v2(color.dark.critical),
|
|
61
|
-
prospect: themeColor_v0_v2(color.dark.default),
|
|
62
|
-
explore: themeColor_v0_v2(color.dark.default),
|
|
63
59
|
},
|
|
64
60
|
},
|
|
65
61
|
container,
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import {ChevronRightIcon} from '@sanity/icons'
|
|
2
|
-
import {Box, Breadcrumbs, Button, Card, Flex, Text} from '@sanity/ui'
|
|
3
|
-
import {useSelect} from '@sanity/ui-workshop'
|
|
4
|
-
|
|
5
|
-
const BREADCRUMBS_MAX_LENGTH_OPTIONS = {
|
|
6
|
-
'(none)': 0,
|
|
7
|
-
'1': 1,
|
|
8
|
-
'2': 2,
|
|
9
|
-
'3': 3,
|
|
10
|
-
'4': 4,
|
|
11
|
-
'5': 5,
|
|
12
|
-
'6': 6,
|
|
13
|
-
'7': 7,
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default function Example() {
|
|
17
|
-
const maxLength =
|
|
18
|
-
useSelect('Max. length', BREADCRUMBS_MAX_LENGTH_OPTIONS, 0, 'Props') || undefined
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<Flex align="center" height="fill" justify="center" padding={4} sizing="border">
|
|
22
|
-
<Card padding={1} radius={3} shadow={1}>
|
|
23
|
-
<Breadcrumbs
|
|
24
|
-
gapX={0}
|
|
25
|
-
expandButton={{padding: 2}}
|
|
26
|
-
maxLength={maxLength}
|
|
27
|
-
separator={
|
|
28
|
-
<Box paddingY={2} style={{opacity: 0.5}}>
|
|
29
|
-
<Text muted size={1}>
|
|
30
|
-
<ChevronRightIcon />
|
|
31
|
-
</Text>
|
|
32
|
-
</Box>
|
|
33
|
-
}
|
|
34
|
-
// space={0}
|
|
35
|
-
>
|
|
36
|
-
<Button href="#" mode="bleed" padding={2} text="Root" />
|
|
37
|
-
<Button href="#" mode="bleed" padding={2} text="Category A of some length" />
|
|
38
|
-
<Button href="#" mode="bleed" padding={2} text="Category B" />
|
|
39
|
-
<Button href="#" mode="bleed" padding={2} text="Category C" />
|
|
40
|
-
<Button
|
|
41
|
-
href="#"
|
|
42
|
-
mode="bleed"
|
|
43
|
-
padding={2}
|
|
44
|
-
text="Category D of an every larger and more extended length"
|
|
45
|
-
textOverflow="none"
|
|
46
|
-
/>
|
|
47
|
-
<Button href="#" mode="bleed" padding={2} text="Category E" />
|
|
48
|
-
<Button href="#" mode="bleed" padding={2} text="Category F" />
|
|
49
|
-
<Box padding={2}>
|
|
50
|
-
<Text size={1} weight="semibold">
|
|
51
|
-
Item
|
|
52
|
-
</Text>
|
|
53
|
-
</Box>
|
|
54
|
-
</Breadcrumbs>
|
|
55
|
-
</Card>
|
|
56
|
-
</Flex>
|
|
57
|
-
)
|
|
58
|
-
}
|