@sanity/ui 1.8.2 → 2.0.0-alpha.2
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.d.ts +42 -11
- package/dist/index.esm.js +335 -116
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +334 -115
- package/dist/index.js.map +1 -1
- package/package.json +34 -16
- package/src/components/autocomplete/autocomplete.tsx +2 -1
- package/src/components/dialog/dialog.tsx +3 -3
- package/src/components/hotkeys/hotkeys.tsx +2 -1
- package/src/components/menu/menuButton.tsx +2 -2
- package/src/components/menu/menuGroup.tsx +2 -2
- package/src/components/tab/tab.tsx +2 -1
- package/src/primitives/avatar/styles.ts +1 -1
- package/src/primitives/button/button.tsx +6 -7
- package/src/primitives/button/styles.ts +20 -3
- package/src/primitives/card/styles.ts +1 -1
- package/src/primitives/checkbox/checkbox.tsx +1 -0
- package/src/primitives/checkbox/styles.ts +47 -17
- package/src/primitives/kbd/kbd.tsx +6 -6
- package/src/primitives/popover/popoverCard.tsx +2 -2
- package/src/primitives/radio/radio.tsx +1 -0
- package/src/primitives/radio/styles.ts +17 -4
- package/src/primitives/select/select.tsx +3 -2
- package/src/primitives/select/styles.ts +2 -1
- package/src/primitives/switch/__workshop__/props.tsx +4 -4
- package/src/primitives/switch/styles.ts +19 -12
- package/src/primitives/text/styles.ts +1 -0
- package/src/primitives/textInput/textInput.tsx +2 -1
- package/src/primitives/tooltip/tooltip.tsx +2 -2
- package/src/primitives/types.ts +3 -2
- package/src/styles/colorVars/colorVarsStyle.ts +2 -0
- package/src/styles/focusRing/index.ts +3 -1
- package/src/styles/input/textInputStyle.ts +2 -1
- package/src/styles/radius/radiusStyle.ts +14 -4
- package/src/styles/radius/types.ts +3 -1
- package/src/theme/lib/theme/avatar.ts +3 -0
- package/src/theme/lib/theme/color/_generic/types.ts +1 -0
- package/src/theme/lib/theme/color/color.test.ts +1 -0
- package/src/theme/lib/theme/color/defaults.ts +8 -0
- package/src/theme/lib/theme/color/input/types.ts +1 -0
- package/src/theme/lib/theme/input.ts +11 -0
- package/src/theme/lib/theme/theme.ts +7 -1
- package/src/theme/studioTheme/color.ts +82 -70
- package/src/theme/studioTheme/fonts.ts +3 -3
- package/src/theme/studioTheme/theme.ts +17 -3
- package/src/theme/studioTheme/tints.ts +152 -0
- package/src/theme/types.ts +8 -0
- package/src/types/index.ts +1 -0
- package/src/types/radius.ts +4 -0
package/dist/index.d.ts
CHANGED
|
@@ -132,7 +132,7 @@ export declare interface AutocompleteProps<
|
|
|
132
132
|
popover?: Omit<PopoverProps, 'content' | 'onMouseEnter' | 'onMouseLeave' | 'open'> &
|
|
133
133
|
Omit<HTMLProps<HTMLDivElement>, 'as' | 'children' | 'content' | 'ref' | 'width'>
|
|
134
134
|
prefix?: ReactNode
|
|
135
|
-
radius?:
|
|
135
|
+
radius?: Radius | Radius[]
|
|
136
136
|
/** @beta */
|
|
137
137
|
relatedElements?: HTMLElement[]
|
|
138
138
|
renderOption?: (option: Option) => ReactElement
|
|
@@ -342,14 +342,20 @@ export declare interface BaseTheme<Styles extends {} = {}> {
|
|
|
342
342
|
avatar: ThemeAvatar
|
|
343
343
|
button: {
|
|
344
344
|
textWeight: ThemeFontWeightKey
|
|
345
|
+
focusRing: FocusRing
|
|
346
|
+
}
|
|
347
|
+
card: {
|
|
348
|
+
focusRing: FocusRing
|
|
345
349
|
}
|
|
346
350
|
color: ThemeColorSchemes
|
|
347
351
|
container: number[]
|
|
352
|
+
/** @deprecated Use component-specific `focusRing` values instead */
|
|
348
353
|
focusRing: {
|
|
349
354
|
offset: number
|
|
350
355
|
width: number
|
|
351
356
|
}
|
|
352
357
|
fonts: ThemeFonts
|
|
358
|
+
input: ThemeInput
|
|
353
359
|
/**
|
|
354
360
|
* THIS API MAY BE UNSTABLE. DO NOT USE IN PRODUCTION.
|
|
355
361
|
* @beta
|
|
@@ -359,7 +365,6 @@ export declare interface BaseTheme<Styles extends {} = {}> {
|
|
|
359
365
|
radius: number[]
|
|
360
366
|
shadows: Array<ThemeShadow | null>
|
|
361
367
|
space: number[]
|
|
362
|
-
input: ThemeInput
|
|
363
368
|
styles?: Styles
|
|
364
369
|
}
|
|
365
370
|
|
|
@@ -481,6 +486,7 @@ export declare interface ButtonProps extends ResponsivePaddingProps, ResponsiveR
|
|
|
481
486
|
selected?: boolean
|
|
482
487
|
space?: number | number[]
|
|
483
488
|
textAlign?: ButtonTextAlign
|
|
489
|
+
muted?: boolean
|
|
484
490
|
text?: React.ReactNode
|
|
485
491
|
tone?: ButtonTone
|
|
486
492
|
type?: 'button' | 'reset' | 'submit'
|
|
@@ -628,7 +634,7 @@ export declare function createColorTheme(
|
|
|
628
634
|
export declare type CSSObject = StyledObject<any>
|
|
629
635
|
|
|
630
636
|
/**
|
|
631
|
-
* @
|
|
637
|
+
* @public
|
|
632
638
|
*/
|
|
633
639
|
export declare type Delay =
|
|
634
640
|
| number
|
|
@@ -677,7 +683,7 @@ export declare interface DialogProps extends ResponsivePaddingProps, ResponsiveW
|
|
|
677
683
|
* @beta
|
|
678
684
|
*/
|
|
679
685
|
__unstable_hideCloseButton?: boolean
|
|
680
|
-
cardRadius?:
|
|
686
|
+
cardRadius?: Radius | Radius[]
|
|
681
687
|
cardShadow?: number | number[]
|
|
682
688
|
contentRef?: React.ForwardedRef<HTMLDivElement>
|
|
683
689
|
footer?: React.ReactNode
|
|
@@ -854,6 +860,14 @@ export declare function focusFirstDescendant(element: HTMLElement): boolean
|
|
|
854
860
|
*/
|
|
855
861
|
export declare function focusLastDescendant(element: HTMLElement): boolean
|
|
856
862
|
|
|
863
|
+
/**
|
|
864
|
+
* @public
|
|
865
|
+
*/
|
|
866
|
+
export declare interface FocusRing {
|
|
867
|
+
offset: number
|
|
868
|
+
width: number
|
|
869
|
+
}
|
|
870
|
+
|
|
857
871
|
/**
|
|
858
872
|
* @internal
|
|
859
873
|
*/
|
|
@@ -1002,7 +1016,7 @@ export declare const Hotkeys: ForwardRefExoticComponent<
|
|
|
1002
1016
|
export declare interface HotkeysProps {
|
|
1003
1017
|
fontSize?: number | number[]
|
|
1004
1018
|
padding?: number | number[]
|
|
1005
|
-
radius?:
|
|
1019
|
+
radius?: Radius | Radius[]
|
|
1006
1020
|
space?: number | number[]
|
|
1007
1021
|
keys?: string[]
|
|
1008
1022
|
}
|
|
@@ -1094,7 +1108,7 @@ export declare interface KBDProps {
|
|
|
1094
1108
|
as?: React.ElementType | keyof JSX.IntrinsicElements
|
|
1095
1109
|
fontSize?: number | number[]
|
|
1096
1110
|
padding?: number | number[]
|
|
1097
|
-
radius?:
|
|
1111
|
+
radius?: Radius | Radius[]
|
|
1098
1112
|
}
|
|
1099
1113
|
|
|
1100
1114
|
/**
|
|
@@ -1244,7 +1258,7 @@ export declare interface MenuButtonProps {
|
|
|
1244
1258
|
/**
|
|
1245
1259
|
* @deprecated Use `popover={{radius: 2}}` instead.
|
|
1246
1260
|
*/
|
|
1247
|
-
popoverRadius?:
|
|
1261
|
+
popoverRadius?: Radius | Radius[]
|
|
1248
1262
|
/**
|
|
1249
1263
|
* @beta Do not use in production.
|
|
1250
1264
|
* @deprecated Use `popover={{portal: true}}` instead.
|
|
@@ -1592,7 +1606,7 @@ export declare interface MenuGroupProps {
|
|
|
1592
1606
|
icon?: React.ElementType | React.ReactNode
|
|
1593
1607
|
padding?: number | number[]
|
|
1594
1608
|
popover?: Omit<PopoverProps, 'content' | 'open'>
|
|
1595
|
-
radius?:
|
|
1609
|
+
radius?: Radius | Radius[]
|
|
1596
1610
|
space?: number | number[]
|
|
1597
1611
|
text: React.ReactNode
|
|
1598
1612
|
tone?: SelectableTone
|
|
@@ -1799,6 +1813,11 @@ export declare interface RadioProps {
|
|
|
1799
1813
|
customValidity?: string
|
|
1800
1814
|
}
|
|
1801
1815
|
|
|
1816
|
+
/**
|
|
1817
|
+
* @public
|
|
1818
|
+
*/
|
|
1819
|
+
export declare type Radius = number | 'full'
|
|
1820
|
+
|
|
1802
1821
|
/**
|
|
1803
1822
|
* @internal
|
|
1804
1823
|
*/
|
|
@@ -1971,7 +1990,7 @@ export declare interface ResponsivePaddingProps {
|
|
|
1971
1990
|
* @public
|
|
1972
1991
|
*/
|
|
1973
1992
|
export declare interface ResponsiveRadiusProps {
|
|
1974
|
-
radius?:
|
|
1993
|
+
radius?: Radius | Radius[]
|
|
1975
1994
|
}
|
|
1976
1995
|
|
|
1977
1996
|
/**
|
|
@@ -2075,7 +2094,7 @@ export declare type SelectableTone = 'default' | 'primary' | 'positive' | 'cauti
|
|
|
2075
2094
|
export declare interface SelectProps {
|
|
2076
2095
|
fontSize?: number | number[]
|
|
2077
2096
|
padding?: number | number[]
|
|
2078
|
-
radius?:
|
|
2097
|
+
radius?: Radius | Radius[]
|
|
2079
2098
|
space?: number | number[]
|
|
2080
2099
|
customValidity?: string
|
|
2081
2100
|
}
|
|
@@ -2309,7 +2328,7 @@ export declare interface TextInputProps {
|
|
|
2309
2328
|
onClear?: () => void
|
|
2310
2329
|
padding?: number | number[]
|
|
2311
2330
|
prefix?: React.ReactNode
|
|
2312
|
-
radius?:
|
|
2331
|
+
radius?: Radius | Radius[]
|
|
2313
2332
|
space?: number | number[]
|
|
2314
2333
|
suffix?: React.ReactNode
|
|
2315
2334
|
type?: TextInputType
|
|
@@ -2388,6 +2407,7 @@ export declare interface ThemeAvatar {
|
|
|
2388
2407
|
distance: number
|
|
2389
2408
|
size: number
|
|
2390
2409
|
}[]
|
|
2410
|
+
focusRing: FocusRing
|
|
2391
2411
|
}
|
|
2392
2412
|
|
|
2393
2413
|
/**
|
|
@@ -2551,6 +2571,7 @@ export declare interface ThemeColorGenericState {
|
|
|
2551
2571
|
bg2?: string
|
|
2552
2572
|
border: string
|
|
2553
2573
|
fg: string
|
|
2574
|
+
iconColor: string
|
|
2554
2575
|
muted: {
|
|
2555
2576
|
fg: string
|
|
2556
2577
|
}
|
|
@@ -2583,6 +2604,7 @@ export declare interface ThemeColorInput {
|
|
|
2583
2604
|
*/
|
|
2584
2605
|
export declare interface ThemeColorInputState {
|
|
2585
2606
|
bg: string
|
|
2607
|
+
bg2: string
|
|
2586
2608
|
fg: string
|
|
2587
2609
|
border: string
|
|
2588
2610
|
placeholder: string
|
|
@@ -2873,10 +2895,12 @@ export declare type ThemeFontWeightKey = 'regular' | 'medium' | 'semibold' | 'bo
|
|
|
2873
2895
|
export declare interface ThemeInput {
|
|
2874
2896
|
checkbox: {
|
|
2875
2897
|
size: number
|
|
2898
|
+
focusRing: FocusRing
|
|
2876
2899
|
}
|
|
2877
2900
|
radio: {
|
|
2878
2901
|
size: number
|
|
2879
2902
|
markSize: number
|
|
2903
|
+
focusRing: FocusRing
|
|
2880
2904
|
}
|
|
2881
2905
|
switch: {
|
|
2882
2906
|
width: number
|
|
@@ -2884,10 +2908,17 @@ export declare interface ThemeInput {
|
|
|
2884
2908
|
padding: number
|
|
2885
2909
|
transitionDurationMs: number
|
|
2886
2910
|
transitionTimingFunction: string
|
|
2911
|
+
focusRing: FocusRing
|
|
2887
2912
|
}
|
|
2888
2913
|
border: {
|
|
2889
2914
|
width: number
|
|
2890
2915
|
}
|
|
2916
|
+
select: {
|
|
2917
|
+
focusRing: FocusRing
|
|
2918
|
+
}
|
|
2919
|
+
text: {
|
|
2920
|
+
focusRing: FocusRing
|
|
2921
|
+
}
|
|
2891
2922
|
}
|
|
2892
2923
|
|
|
2893
2924
|
/**
|