@sanity/ui 2.9.0-canary.6 → 2.9.0-corel.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/dist/_chunks-cjs/getTheme_v2.js +54 -84
- package/dist/_chunks-cjs/getTheme_v2.js.map +1 -1
- package/dist/_chunks-es/getTheme_v2.mjs +54 -84
- package/dist/_chunks-es/getTheme_v2.mjs.map +1 -1
- package/dist/_legacy/getTheme_v2.esm.js +54 -84
- package/dist/_legacy/getTheme_v2.esm.js.map +1 -1
- package/dist/index.d.mts +21 -14
- package/dist/index.d.ts +21 -14
- package/dist/index.esm.js +3150 -3805
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3148 -3802
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3150 -3805
- package/dist/index.mjs.map +1 -1
- package/dist/theme.d.mts +22 -28
- package/dist/theme.d.ts +22 -28
- package/dist/theme.esm.js +630 -1318
- package/dist/theme.esm.js.map +1 -1
- package/dist/theme.js +630 -1318
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +630 -1318
- package/dist/theme.mjs.map +1 -1
- package/package.json +1 -2
- package/src/core/__workshop__/constants.ts +13 -13
- package/src/core/components/autocomplete/autocomplete.tsx +31 -42
- package/src/core/components/breadcrumbs/__workshop__/buttons.tsx +58 -0
- package/src/core/components/breadcrumbs/__workshop__/example.tsx +3 -1
- package/src/core/components/breadcrumbs/__workshop__/index.ts +5 -0
- package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +1 -13
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +70 -50
- package/src/core/components/dialog/dialog.tsx +3 -5
- package/src/core/components/menu/menu.tsx +11 -15
- package/src/core/components/menu/menuButton.tsx +36 -14
- package/src/core/components/menu/menuGroup.tsx +1 -2
- package/src/core/components/menu/menuItem.tsx +2 -4
- package/src/core/components/menu/useMenuController.ts +21 -18
- package/src/core/components/tab/tabList.tsx +11 -3
- package/src/core/components/toast/toastProvider.tsx +6 -5
- package/src/core/components/tree/treeItem.tsx +15 -18
- package/src/core/constants.ts +1 -1
- package/src/core/hooks/useArrayProp.ts +9 -14
- package/src/core/hooks/useMatchMedia.ts +22 -12
- package/src/core/primitives/avatar/avatarStack.tsx +5 -2
- package/src/core/primitives/button/__workshop__/props.tsx +1 -1
- package/src/core/primitives/button/button.tsx +11 -6
- package/src/core/primitives/button/styles.ts +1 -1
- package/src/core/primitives/flex/flex.tsx +5 -1
- package/src/core/primitives/heading/heading.tsx +1 -1
- package/src/core/primitives/popover/popover.tsx +139 -74
- package/src/core/primitives/popover/popoverCard.tsx +4 -1
- package/src/core/primitives/text/styles.ts +1 -0
- package/src/core/primitives/text/text.tsx +4 -2
- package/src/core/primitives/tooltip/tooltip.tsx +17 -47
- package/src/core/styles/card/_cardColorStyle.ts +8 -0
- package/src/core/styles/flex/flexStyle.ts +18 -0
- package/src/core/styles/flex/types.ts +2 -0
- package/src/core/theme/themeProvider.tsx +6 -4
- package/src/core/utils/elementQuery/elementQuery.tsx +17 -16
- package/src/core/utils/layer/layerProvider.tsx +1 -1
- package/src/core/utils/portal/portalProvider.tsx +5 -5
- 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 +45 -39
- package/src/theme/build/renderColorTheme.ts +239 -65
- package/src/theme/build/resolveColorTokens.ts +51 -115
- package/src/theme/config/tokens/color/types.ts +4 -18
- package/src/theme/defaults/colorTokens.ts +19 -11
- package/src/theme/getScopedTheme.ts +9 -2
- package/src/theme/system/color/_constants.ts +8 -0
- package/src/theme/system/color/badge.ts +3 -7
- package/src/theme/system/v0/color/_system.ts +8 -4
- package/src/theme/system/v0/color/color.ts +3 -2
- package/src/theme/versioning/themeColor_v0_v2.ts +26 -0
- package/src/theme/versioning/v0_v2.ts +4 -0
- package/src/core/components/toast/toastState.ts +0 -6
package/dist/theme.d.mts
CHANGED
|
@@ -116,6 +116,8 @@ export declare const COLOR_CONFIG_CARD_TONES: readonly [
|
|
|
116
116
|
'positive',
|
|
117
117
|
'caution',
|
|
118
118
|
'critical',
|
|
119
|
+
'prospect',
|
|
120
|
+
'explore',
|
|
119
121
|
]
|
|
120
122
|
|
|
121
123
|
/** @public */
|
|
@@ -156,6 +158,8 @@ export declare const COLOR_CONFIG_STATE_TONES: readonly [
|
|
|
156
158
|
'positive',
|
|
157
159
|
'caution',
|
|
158
160
|
'critical',
|
|
161
|
+
'prospect',
|
|
162
|
+
'explore',
|
|
159
163
|
]
|
|
160
164
|
|
|
161
165
|
/** @public */
|
|
@@ -454,6 +458,8 @@ export declare const THEME_COLOR_CARD_TONES: readonly [
|
|
|
454
458
|
'positive',
|
|
455
459
|
'caution',
|
|
456
460
|
'critical',
|
|
461
|
+
'prospect',
|
|
462
|
+
'explore',
|
|
457
463
|
]
|
|
458
464
|
|
|
459
465
|
/** @public */
|
|
@@ -477,6 +483,8 @@ export declare const THEME_COLOR_STATE_TONES: readonly [
|
|
|
477
483
|
'positive',
|
|
478
484
|
'caution',
|
|
479
485
|
'critical',
|
|
486
|
+
'prospect',
|
|
487
|
+
'explore',
|
|
480
488
|
]
|
|
481
489
|
|
|
482
490
|
/** @public */
|
|
@@ -589,32 +597,12 @@ export declare interface ThemeColorAvatarTokens {
|
|
|
589
597
|
/**
|
|
590
598
|
* @public
|
|
591
599
|
*/
|
|
592
|
-
export declare
|
|
593
|
-
default: ThemeColorBadgeTone_v2
|
|
594
|
-
primary: ThemeColorBadgeTone_v2
|
|
595
|
-
positive: ThemeColorBadgeTone_v2
|
|
596
|
-
caution: ThemeColorBadgeTone_v2
|
|
597
|
-
critical: ThemeColorBadgeTone_v2
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
/** @public */
|
|
601
|
-
export declare interface ThemeColorBadgeTokens {
|
|
602
|
-
_hue?: ColorHueKey
|
|
603
|
-
bg?: ThemeColorTokenValue
|
|
604
|
-
fg?: ThemeColorTokenValue
|
|
605
|
-
dot?: ThemeColorTokenValue
|
|
606
|
-
icon?: ThemeColorTokenValue
|
|
607
|
-
}
|
|
600
|
+
export declare type ThemeColorBadge_v2 = Record<ThemeColorStateToneKey, ThemeColorBadgeTone_v2>
|
|
608
601
|
|
|
609
602
|
/** @public */
|
|
610
|
-
export declare
|
|
611
|
-
'*'
|
|
612
|
-
|
|
613
|
-
'primary'?: ThemeColorBadgeToneTokens
|
|
614
|
-
'positive'?: ThemeColorBadgeToneTokens
|
|
615
|
-
'caution'?: ThemeColorBadgeToneTokens
|
|
616
|
-
'critical'?: ThemeColorBadgeToneTokens
|
|
617
|
-
}
|
|
603
|
+
export declare type ThemeColorBadgeTokens = Partial<
|
|
604
|
+
Record<'*' | ThemeColorStateToneKey, ThemeColorBadgeToneTokens>
|
|
605
|
+
>
|
|
618
606
|
|
|
619
607
|
/**
|
|
620
608
|
* @public
|
|
@@ -682,7 +670,7 @@ export declare interface ThemeColorBuilderOpts {
|
|
|
682
670
|
solid: (opts: {
|
|
683
671
|
base: ThemeColorBase
|
|
684
672
|
dark: boolean
|
|
685
|
-
tone:
|
|
673
|
+
tone: ThemeColorName
|
|
686
674
|
name: ThemeColorName
|
|
687
675
|
state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected'
|
|
688
676
|
}) => ThemeColorGenericState
|
|
@@ -990,7 +978,13 @@ export declare interface ThemeColorMutedTone {
|
|
|
990
978
|
* @public
|
|
991
979
|
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
992
980
|
*/
|
|
993
|
-
export declare type ThemeColorName =
|
|
981
|
+
export declare type ThemeColorName =
|
|
982
|
+
| 'transparent'
|
|
983
|
+
| 'default'
|
|
984
|
+
| 'primary'
|
|
985
|
+
| 'positive'
|
|
986
|
+
| 'caution'
|
|
987
|
+
| 'critical'
|
|
994
988
|
|
|
995
989
|
/** @public */
|
|
996
990
|
export declare type ThemeColorPalette = {
|
|
@@ -1002,7 +996,7 @@ export declare type ThemeColorPalette = {
|
|
|
1002
996
|
* @public
|
|
1003
997
|
* @deprecated Use `ThemeColorScheme_v2` instead.
|
|
1004
998
|
*/
|
|
1005
|
-
export declare type ThemeColorScheme = Record<
|
|
999
|
+
export declare type ThemeColorScheme = Record<ThemeColorName, ThemeColor>
|
|
1006
1000
|
|
|
1007
1001
|
/**
|
|
1008
1002
|
* @public
|
|
@@ -1263,7 +1257,7 @@ export declare type ThemeColorTokenValue = [ColorConfigValue, ColorConfigValue]
|
|
|
1263
1257
|
* @public
|
|
1264
1258
|
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
1265
1259
|
*/
|
|
1266
|
-
export declare type ThemeColorToneKey =
|
|
1260
|
+
export declare type ThemeColorToneKey = ThemeColorName
|
|
1267
1261
|
|
|
1268
1262
|
/** @public */
|
|
1269
1263
|
export declare interface ThemeConfig {
|
package/dist/theme.d.ts
CHANGED
|
@@ -116,6 +116,8 @@ export declare const COLOR_CONFIG_CARD_TONES: readonly [
|
|
|
116
116
|
'positive',
|
|
117
117
|
'caution',
|
|
118
118
|
'critical',
|
|
119
|
+
'prospect',
|
|
120
|
+
'explore',
|
|
119
121
|
]
|
|
120
122
|
|
|
121
123
|
/** @public */
|
|
@@ -156,6 +158,8 @@ export declare const COLOR_CONFIG_STATE_TONES: readonly [
|
|
|
156
158
|
'positive',
|
|
157
159
|
'caution',
|
|
158
160
|
'critical',
|
|
161
|
+
'prospect',
|
|
162
|
+
'explore',
|
|
159
163
|
]
|
|
160
164
|
|
|
161
165
|
/** @public */
|
|
@@ -454,6 +458,8 @@ export declare const THEME_COLOR_CARD_TONES: readonly [
|
|
|
454
458
|
'positive',
|
|
455
459
|
'caution',
|
|
456
460
|
'critical',
|
|
461
|
+
'prospect',
|
|
462
|
+
'explore',
|
|
457
463
|
]
|
|
458
464
|
|
|
459
465
|
/** @public */
|
|
@@ -477,6 +483,8 @@ export declare const THEME_COLOR_STATE_TONES: readonly [
|
|
|
477
483
|
'positive',
|
|
478
484
|
'caution',
|
|
479
485
|
'critical',
|
|
486
|
+
'prospect',
|
|
487
|
+
'explore',
|
|
480
488
|
]
|
|
481
489
|
|
|
482
490
|
/** @public */
|
|
@@ -589,32 +597,12 @@ export declare interface ThemeColorAvatarTokens {
|
|
|
589
597
|
/**
|
|
590
598
|
* @public
|
|
591
599
|
*/
|
|
592
|
-
export declare
|
|
593
|
-
default: ThemeColorBadgeTone_v2
|
|
594
|
-
primary: ThemeColorBadgeTone_v2
|
|
595
|
-
positive: ThemeColorBadgeTone_v2
|
|
596
|
-
caution: ThemeColorBadgeTone_v2
|
|
597
|
-
critical: ThemeColorBadgeTone_v2
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
/** @public */
|
|
601
|
-
export declare interface ThemeColorBadgeTokens {
|
|
602
|
-
_hue?: ColorHueKey
|
|
603
|
-
bg?: ThemeColorTokenValue
|
|
604
|
-
fg?: ThemeColorTokenValue
|
|
605
|
-
dot?: ThemeColorTokenValue
|
|
606
|
-
icon?: ThemeColorTokenValue
|
|
607
|
-
}
|
|
600
|
+
export declare type ThemeColorBadge_v2 = Record<ThemeColorStateToneKey, ThemeColorBadgeTone_v2>
|
|
608
601
|
|
|
609
602
|
/** @public */
|
|
610
|
-
export declare
|
|
611
|
-
'*'
|
|
612
|
-
|
|
613
|
-
'primary'?: ThemeColorBadgeToneTokens
|
|
614
|
-
'positive'?: ThemeColorBadgeToneTokens
|
|
615
|
-
'caution'?: ThemeColorBadgeToneTokens
|
|
616
|
-
'critical'?: ThemeColorBadgeToneTokens
|
|
617
|
-
}
|
|
603
|
+
export declare type ThemeColorBadgeTokens = Partial<
|
|
604
|
+
Record<'*' | ThemeColorStateToneKey, ThemeColorBadgeToneTokens>
|
|
605
|
+
>
|
|
618
606
|
|
|
619
607
|
/**
|
|
620
608
|
* @public
|
|
@@ -682,7 +670,7 @@ export declare interface ThemeColorBuilderOpts {
|
|
|
682
670
|
solid: (opts: {
|
|
683
671
|
base: ThemeColorBase
|
|
684
672
|
dark: boolean
|
|
685
|
-
tone:
|
|
673
|
+
tone: ThemeColorName
|
|
686
674
|
name: ThemeColorName
|
|
687
675
|
state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected'
|
|
688
676
|
}) => ThemeColorGenericState
|
|
@@ -990,7 +978,13 @@ export declare interface ThemeColorMutedTone {
|
|
|
990
978
|
* @public
|
|
991
979
|
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
992
980
|
*/
|
|
993
|
-
export declare type ThemeColorName =
|
|
981
|
+
export declare type ThemeColorName =
|
|
982
|
+
| 'transparent'
|
|
983
|
+
| 'default'
|
|
984
|
+
| 'primary'
|
|
985
|
+
| 'positive'
|
|
986
|
+
| 'caution'
|
|
987
|
+
| 'critical'
|
|
994
988
|
|
|
995
989
|
/** @public */
|
|
996
990
|
export declare type ThemeColorPalette = {
|
|
@@ -1002,7 +996,7 @@ export declare type ThemeColorPalette = {
|
|
|
1002
996
|
* @public
|
|
1003
997
|
* @deprecated Use `ThemeColorScheme_v2` instead.
|
|
1004
998
|
*/
|
|
1005
|
-
export declare type ThemeColorScheme = Record<
|
|
999
|
+
export declare type ThemeColorScheme = Record<ThemeColorName, ThemeColor>
|
|
1006
1000
|
|
|
1007
1001
|
/**
|
|
1008
1002
|
* @public
|
|
@@ -1263,7 +1257,7 @@ export declare type ThemeColorTokenValue = [ColorConfigValue, ColorConfigValue]
|
|
|
1263
1257
|
* @public
|
|
1264
1258
|
* @deprecated Use `ThemeColorCardToneKey` instead.
|
|
1265
1259
|
*/
|
|
1266
|
-
export declare type ThemeColorToneKey =
|
|
1260
|
+
export declare type ThemeColorToneKey = ThemeColorName
|
|
1267
1261
|
|
|
1268
1262
|
/** @public */
|
|
1269
1263
|
export declare interface ThemeConfig {
|