@sanity/ui 1.7.2 → 1.7.4
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/README.md +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/index.esm.js +340 -103
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +340 -103
- package/dist/index.js.map +1 -1
- package/package.json +33 -33
- package/src/__workshop__/constants.ts +2 -2
- package/src/components/autocomplete/__mocks__/apiStore.ts +2 -2
- package/src/components/autocomplete/__workshop__/async.tsx +2 -2
- package/src/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
- package/src/components/autocomplete/__workshop__/custom.tsx +1 -1
- package/src/components/autocomplete/__workshop__/fullscreen.tsx +6 -6
- package/src/components/autocomplete/autocomplete.tsx +20 -20
- package/src/components/autocomplete/autocompleteOption.tsx +1 -1
- package/src/components/autocomplete/autocompleteReducer.ts +1 -1
- package/src/components/breadcrumbs/breadcrumbs.tsx +2 -2
- package/src/components/dialog/dialog.tsx +11 -11
- package/src/components/dialog/dialogProvider.tsx +1 -1
- package/src/components/dialog/styles.ts +1 -1
- package/src/components/hotkeys/hotkeys.tsx +1 -1
- package/src/components/menu/__workshop__/asComponent.tsx +1 -1
- package/src/components/menu/__workshop__/index.ts +5 -0
- package/src/components/menu/__workshop__/menuButton.tsx +1 -1
- package/src/components/menu/__workshop__/shouldFocus.tsx +46 -0
- package/src/components/menu/menu.test.tsx +3 -3
- package/src/components/menu/menu.tsx +7 -7
- package/src/components/menu/menuButton.tsx +7 -7
- package/src/components/menu/menuGroup.tsx +4 -4
- package/src/components/menu/menuItem.tsx +4 -4
- package/src/components/menu/useMenuController.ts +10 -5
- package/src/components/skeleton/skeleton.tsx +2 -2
- package/src/components/skeleton/textSkeleton.tsx +25 -19
- package/src/components/tab/tab.tsx +2 -2
- package/src/components/tab/tabList.tsx +3 -3
- package/src/components/tab/tabPanel.tsx +1 -1
- package/src/components/toast/toast.test.tsx +2 -1
- package/src/components/toast/toast.tsx +1 -1
- package/src/components/toast/toastProvider.tsx +1 -1
- package/src/components/tree/__workshop__/basic.perf.ts +1 -1
- package/src/components/tree/helpers.ts +2 -2
- package/src/components/tree/style.ts +1 -1
- package/src/components/tree/tree.tsx +9 -9
- package/src/components/tree/treeGroup.tsx +1 -1
- package/src/components/tree/treeItem.tsx +4 -4
- package/src/hooks/useArrayProp.ts +2 -2
- package/src/hooks/useClickOutside.ts +2 -2
- package/src/hooks/useCustomValidity.ts +1 -1
- package/src/hooks/useMediaIndex/useMediaIndex.test.tsx +4 -4
- package/src/hooks/usePrefersDark.hydration.test.tsx +2 -1
- package/src/hooks/usePrefersReducedMotion.hydration.test.tsx +2 -1
- package/src/lib/globalScope.ts +1 -0
- package/src/primitives/_selectable/selectable.tsx +1 -1
- package/src/primitives/_selectable/style.ts +1 -1
- package/src/primitives/avatar/avatar.tsx +3 -3
- package/src/primitives/avatar/avatarCounter.tsx +5 -3
- package/src/primitives/avatar/avatarStack.tsx +2 -2
- package/src/primitives/avatar/styles.ts +1 -1
- package/src/primitives/badge/badge.tsx +2 -2
- package/src/primitives/box/box.tsx +2 -2
- package/src/primitives/button/button.tsx +2 -2
- package/src/primitives/button/styles.ts +1 -1
- package/src/primitives/card/__workshop__/asComponent.tsx +1 -1
- package/src/primitives/card/__workshop__/selected.tsx +19 -15
- package/src/primitives/card/card.tsx +1 -1
- package/src/primitives/card/styles.ts +1 -1
- package/src/primitives/checkbox/checkbox.tsx +1 -1
- package/src/primitives/code/code.tsx +2 -1
- package/src/primitives/container/container.tsx +2 -2
- package/src/primitives/container/styles.ts +1 -1
- package/src/primitives/flex/flex.tsx +2 -2
- package/src/primitives/grid/grid.tsx +1 -1
- package/src/primitives/heading/heading.tsx +1 -1
- package/src/primitives/heading/styles.ts +4 -2
- package/src/primitives/helpers.ts +2 -2
- package/src/primitives/inline/inline.tsx +2 -2
- package/src/primitives/kbd/kbd.tsx +1 -1
- package/src/primitives/label/label.tsx +1 -1
- package/src/primitives/label/styles.ts +1 -1
- package/src/primitives/popover/__workshop__/RecursiveStory.tsx +1 -1
- package/src/primitives/popover/__workshop__/TestStory.tsx +1 -1
- package/src/primitives/popover/helpers.ts +1 -1
- package/src/primitives/popover/popover.tsx +11 -11
- package/src/primitives/popover/popoverArrow.tsx +1 -1
- package/src/primitives/popover/popoverCard.tsx +4 -4
- package/src/primitives/radio/radio.tsx +1 -1
- package/src/primitives/select/select.tsx +1 -1
- package/src/primitives/select/styles.ts +2 -2
- package/src/primitives/spinner/spinner.tsx +1 -1
- package/src/primitives/stack/stack.tsx +1 -1
- package/src/primitives/stack/styles.ts +1 -1
- package/src/primitives/switch/__workshop__/props.tsx +1 -1
- package/src/primitives/switch/styles.ts +1 -1
- package/src/primitives/switch/switch.tsx +1 -1
- package/src/primitives/text/__workshop__/colored.tsx +9 -8
- package/src/primitives/text/styles.ts +4 -2
- package/src/primitives/text/text.tsx +2 -2
- package/src/primitives/textArea/textArea.tsx +3 -3
- package/src/primitives/textInput/__workshop__/plain.tsx +2 -2
- package/src/primitives/textInput/textInput.tsx +11 -11
- package/src/primitives/tooltip/tooltip.tsx +8 -7
- package/src/primitives/tooltip/tooltipArrow.tsx +1 -1
- package/src/styles/border/borderStyle.ts +5 -5
- package/src/styles/colorVars/colorVarsStyle.ts +1 -1
- package/src/styles/flex/flexItemStyle.ts +1 -1
- package/src/styles/flex/flexStyle.ts +3 -3
- package/src/styles/font/responsiveFont.ts +1 -1
- package/src/styles/font/textAlignStyle.ts +1 -1
- package/src/styles/helpers.ts +3 -3
- package/src/styles/input/responsiveInputPaddingStyle.ts +4 -4
- package/src/styles/input/textInputStyle.ts +2 -2
- package/src/styles/margin/marginStyle.ts +1 -1
- package/src/styles/padding/paddingStyle.ts +1 -1
- package/src/theme/__workshop__/color.tsx +1 -0
- package/src/theme/lib/theme/color/button/createButtonModes.ts +1 -1
- package/src/theme/lib/theme/color/button/createButtonTones.ts +1 -1
- package/src/theme/lib/theme/color/card/createCardStates.ts +1 -1
- package/src/theme/lib/theme/color/factory.ts +2 -2
- package/src/theme/lib/theme/color/input/createInputModes.ts +1 -1
- package/src/theme/lib/theme/color/muted/createMuted.ts +1 -1
- package/src/theme/lib/theme/color/selectable/createSelectableTones.ts +2 -2
- package/src/theme/lib/theme/color/solid/createSolidTones.ts +1 -1
- package/src/theme/lib/theme/color/spot/createSpot.ts +1 -1
- package/src/theme/lib/theme/shadow.ts +1 -1
- package/src/theme/lib/theme/theme.ts +1 -1
- package/src/theme/theme.test.tsx +2 -1
- package/src/theme/themeProvider.tsx +1 -1
- package/src/theme/useRootTheme.ts +1 -0
- package/src/utils/boundaryElement/boundaryElement.test.tsx +2 -1
- package/src/utils/elementQuery/elementQuery.tsx +2 -2
- package/src/utils/layer/layer.test.tsx +2 -1
- package/src/utils/layer/layer.tsx +3 -3
- package/src/utils/layer/layerProvider.tsx +2 -2
- package/src/utils/portal/portal.test.tsx +2 -1
- package/src/utils/srOnly/srOnly.tsx +1 -1
- package/src/utils/virtualList/__workshop__/changingProps.tsx +1 -1
- package/src/utils/virtualList/virtualList.tsx +2 -1
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare const Autocomplete: <Option extends BaseAutocompleteOption>(
|
|
|
51
51
|
| 'autoComplete'
|
|
52
52
|
> & {
|
|
53
53
|
ref?: Ref<HTMLInputElement> | undefined
|
|
54
|
-
}
|
|
54
|
+
},
|
|
55
55
|
) => ReactElement
|
|
56
56
|
|
|
57
57
|
/**
|
|
@@ -93,7 +93,7 @@ export declare type AutocompleteOpenButtonProps = Omit<ButtonProps, 'as'> &
|
|
|
93
93
|
* @public
|
|
94
94
|
*/
|
|
95
95
|
export declare interface AutocompleteProps<
|
|
96
|
-
Option extends BaseAutocompleteOption = BaseAutocompleteOption
|
|
96
|
+
Option extends BaseAutocompleteOption = BaseAutocompleteOption,
|
|
97
97
|
> {
|
|
98
98
|
border?: boolean
|
|
99
99
|
customValidity?: string
|
|
@@ -127,7 +127,7 @@ export declare interface AutocompleteProps<
|
|
|
127
127
|
onMouseEnter: () => void
|
|
128
128
|
onMouseLeave: () => void
|
|
129
129
|
},
|
|
130
|
-
ref: Ref<HTMLDivElement
|
|
130
|
+
ref: Ref<HTMLDivElement>,
|
|
131
131
|
) => ReactNode
|
|
132
132
|
renderValue?: (value: string, option?: Option) => string
|
|
133
133
|
suffix?: ReactNode
|
|
@@ -357,7 +357,7 @@ export declare interface BoundaryElementContextValue {
|
|
|
357
357
|
* @public
|
|
358
358
|
*/
|
|
359
359
|
export declare function BoundaryElementProvider(
|
|
360
|
-
props: BoundaryElementProviderProps
|
|
360
|
+
props: BoundaryElementProviderProps,
|
|
361
361
|
): React.ReactElement
|
|
362
362
|
|
|
363
363
|
/**
|
|
@@ -602,7 +602,7 @@ export declare function containsOrEqualsElement(element: HTMLElement, node: Node
|
|
|
602
602
|
* @public
|
|
603
603
|
*/
|
|
604
604
|
export declare function createColorTheme(
|
|
605
|
-
partialOpts?: PartialThemeColorBuilderOpts
|
|
605
|
+
partialOpts?: PartialThemeColorBuilderOpts,
|
|
606
606
|
): ThemeColorSchemes
|
|
607
607
|
|
|
608
608
|
/**
|
|
@@ -760,7 +760,7 @@ export declare interface ErrorBoundaryState {
|
|
|
760
760
|
*/
|
|
761
761
|
export declare function _fillCSSObject(
|
|
762
762
|
keys: string[],
|
|
763
|
-
value: string | number | CSSObject
|
|
763
|
+
value: string | number | CSSObject,
|
|
764
764
|
): CSSObject
|
|
765
765
|
|
|
766
766
|
/**
|
|
@@ -840,7 +840,7 @@ export declare function _getArrayProp<T = number>(val: T | T[] | undefined, defa
|
|
|
840
840
|
export declare function _getResponsiveSpace(
|
|
841
841
|
theme: Theme,
|
|
842
842
|
props: string[],
|
|
843
|
-
spaceIndexes?: number[]
|
|
843
|
+
spaceIndexes?: number[],
|
|
844
844
|
): CSSObject[] | null
|
|
845
845
|
|
|
846
846
|
/**
|
|
@@ -1234,7 +1234,7 @@ export declare const MenuDivider: StyledComponent<'hr', Theme>
|
|
|
1234
1234
|
*/
|
|
1235
1235
|
export declare function MenuGroup(
|
|
1236
1236
|
props: MenuGroupProps &
|
|
1237
|
-
Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'tabIndex'
|
|
1237
|
+
Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'tabIndex'>,
|
|
1238
1238
|
): React.ReactElement
|
|
1239
1239
|
|
|
1240
1240
|
/**
|
|
@@ -1479,7 +1479,7 @@ export declare const _ResizeObserver: typeof ResizeObserver
|
|
|
1479
1479
|
export declare function _responsive<T>(
|
|
1480
1480
|
media: number[],
|
|
1481
1481
|
values: T[],
|
|
1482
|
-
callback: (value: T, index: number, array: T[]) => CSSObject
|
|
1482
|
+
callback: (value: T, index: number, array: T[]) => CSSObject,
|
|
1483
1483
|
): CSSObject[]
|
|
1484
1484
|
|
|
1485
1485
|
/**
|
|
@@ -1515,7 +1515,7 @@ export declare interface ResponsiveBoxProps {
|
|
|
1515
1515
|
* @internal
|
|
1516
1516
|
*/
|
|
1517
1517
|
export declare function responsiveCodeFontStyle(
|
|
1518
|
-
props: ResponsiveFontStyleProps & ThemeProps
|
|
1518
|
+
props: ResponsiveFontStyleProps & ThemeProps,
|
|
1519
1519
|
): CSSObject[]
|
|
1520
1520
|
|
|
1521
1521
|
/**
|
|
@@ -1584,7 +1584,7 @@ export declare interface ResponsiveGridProps {
|
|
|
1584
1584
|
* @internal
|
|
1585
1585
|
*/
|
|
1586
1586
|
export declare function responsiveHeadingFont(
|
|
1587
|
-
props: ResponsiveFontStyleProps & ThemeProps
|
|
1587
|
+
props: ResponsiveFontStyleProps & ThemeProps,
|
|
1588
1588
|
): CSSObject[]
|
|
1589
1589
|
|
|
1590
1590
|
/**
|
|
@@ -1592,7 +1592,7 @@ export declare function responsiveHeadingFont(
|
|
|
1592
1592
|
* @internal
|
|
1593
1593
|
*/
|
|
1594
1594
|
export declare function responsiveLabelFont(
|
|
1595
|
-
props: ResponsiveFontStyleProps & ThemeProps
|
|
1595
|
+
props: ResponsiveFontStyleProps & ThemeProps,
|
|
1596
1596
|
): CSSObject[]
|
|
1597
1597
|
|
|
1598
1598
|
/**
|
|
@@ -1640,7 +1640,7 @@ export declare interface ResponsiveShadowProps {
|
|
|
1640
1640
|
* @internal
|
|
1641
1641
|
*/
|
|
1642
1642
|
export declare function responsiveTextAlignStyle(
|
|
1643
|
-
props: ResponsiveTextAlignStyleProps & ThemeProps
|
|
1643
|
+
props: ResponsiveTextAlignStyleProps & ThemeProps,
|
|
1644
1644
|
): CSSObject[]
|
|
1645
1645
|
|
|
1646
1646
|
/**
|
|
@@ -1655,7 +1655,7 @@ export declare interface ResponsiveTextAlignStyleProps {
|
|
|
1655
1655
|
* @internal
|
|
1656
1656
|
*/
|
|
1657
1657
|
export declare function responsiveTextFont(
|
|
1658
|
-
props: ResponsiveFontStyleProps & ThemeProps
|
|
1658
|
+
props: ResponsiveFontStyleProps & ThemeProps,
|
|
1659
1659
|
): CSSObject[]
|
|
1660
1660
|
|
|
1661
1661
|
/**
|
|
@@ -2595,7 +2595,7 @@ export declare interface ThemeShadow {
|
|
|
2595
2595
|
* @public
|
|
2596
2596
|
*/
|
|
2597
2597
|
export declare function Toast(
|
|
2598
|
-
props: ToastProps & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'title'
|
|
2598
|
+
props: ToastProps & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'title'>,
|
|
2599
2599
|
): React.ReactElement
|
|
2600
2600
|
|
|
2601
2601
|
/**
|
|
@@ -2750,7 +2750,7 @@ export declare interface TreeState {
|
|
|
2750
2750
|
*/
|
|
2751
2751
|
export declare function useArrayProp<T extends ArrayPropPrimitive = ArrayPropPrimitive>(
|
|
2752
2752
|
val: T | T[] | undefined,
|
|
2753
|
-
defaultVal?: T[]
|
|
2753
|
+
defaultVal?: T[],
|
|
2754
2754
|
): T[]
|
|
2755
2755
|
|
|
2756
2756
|
/**
|
|
@@ -2764,7 +2764,7 @@ export declare function useBoundaryElement(): BoundaryElementContextValue
|
|
|
2764
2764
|
export declare function useClickOutside(
|
|
2765
2765
|
listener: ClickOutsideListener,
|
|
2766
2766
|
elementsArg?: Array<HTMLElement | HTMLElement[] | null>,
|
|
2767
|
-
boundaryElement?: HTMLElement | null
|
|
2767
|
+
boundaryElement?: HTMLElement | null,
|
|
2768
2768
|
): (el: HTMLElement | null) => void
|
|
2769
2769
|
|
|
2770
2770
|
/**
|
|
@@ -2776,7 +2776,7 @@ export declare function useCustomValidity(
|
|
|
2776
2776
|
setCustomValidity: (validity: string) => void
|
|
2777
2777
|
}
|
|
2778
2778
|
},
|
|
2779
|
-
customValidity: string | undefined
|
|
2779
|
+
customValidity: string | undefined,
|
|
2780
2780
|
): void
|
|
2781
2781
|
|
|
2782
2782
|
/**
|
|
@@ -2803,7 +2803,7 @@ export declare function useElementSize(element: HTMLElement | null): ElementSize
|
|
|
2803
2803
|
* @beta
|
|
2804
2804
|
*/
|
|
2805
2805
|
export declare function useForwardedRef<T>(
|
|
2806
|
-
ref: React.ForwardedRef<T
|
|
2806
|
+
ref: React.ForwardedRef<T>,
|
|
2807
2807
|
): React.MutableRefObject<T | null>
|
|
2808
2808
|
|
|
2809
2809
|
/**
|