@sanity/ui 4.0.0-static.33 → 4.0.0-static.35

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.
Files changed (32) hide show
  1. package/dist/index.d.ts +6 -20
  2. package/dist/index.js +284 -230
  3. package/dist/index.js.map +1 -1
  4. package/package.json +1 -1
  5. package/src/core/components/dialog/Dialog.tsx +16 -7
  6. package/src/core/components/dialog/DialogCard.tsx +4 -4
  7. package/src/core/components/dialog/DialogProvider.tsx +1 -1
  8. package/src/core/components/menu/Menu.test.tsx +6 -6
  9. package/src/core/components/menu/Menu.tsx +2 -2
  10. package/src/core/components/toast/Toast.test.tsx +6 -6
  11. package/src/core/components/toast/ToastProvider.tsx +2 -2
  12. package/src/core/components/tree/Tree.tsx +2 -2
  13. package/src/core/components/tree/TreeItem.tsx +4 -4
  14. package/src/core/helpers/props.ts +0 -9
  15. package/src/core/hooks/useResponsiveProp.ts +4 -17
  16. package/src/core/index.ts +4 -5
  17. package/src/core/primitives/avatar/Avatar.tsx +2 -2
  18. package/src/core/primitives/card/CardProvider.tsx +2 -11
  19. package/src/core/primitives/card/useCard.ts +8 -3
  20. package/src/core/primitives/layer/Layer.test.tsx +6 -6
  21. package/src/core/primitives/layer/LayerProvider.tsx +3 -3
  22. package/src/core/primitives/popover/Popover.tsx +22 -17
  23. package/src/core/primitives/textInput/TextInput.tsx +73 -53
  24. package/src/core/primitives/tooltip/Tooltip.tsx +30 -20
  25. package/src/core/primitives/tooltip/tooltipDelayGroup/TooltipDelayGroupProvider.tsx +1 -3
  26. package/src/core/utils/boundaryElement/BoundaryElementContext.ts +2 -5
  27. package/src/core/utils/boundaryElement/BoundaryElementProvider.tsx +2 -4
  28. package/src/core/utils/boundaryElement/types.ts +1 -4
  29. package/src/core/utils/boundaryElement/useBoundaryElement.ts +6 -18
  30. package/src/core/utils/portal/Portal.tsx +6 -3
  31. package/src/core/utils/portal/usePortal.ts +9 -2
  32. package/src/core/utils/boundaryElement/BoundaryElement.test.tsx +0 -102
package/dist/index.d.ts CHANGED
@@ -41,7 +41,7 @@ import type {Radius} from '@sanity/ui/theme'
41
41
  import {RadiusStyleProps} from '@sanity/ui/css'
42
42
  import {ReactElement} from 'react'
43
43
  import {ReactNode} from 'react'
44
- import type {ReactPortal} from 'react'
44
+ import {ReactPortal} from 'react'
45
45
  import {Ref} from 'react'
46
46
  import {RefAttributes} from 'react'
47
47
  import {ResponsiveProp} from '@sanity/ui/css'
@@ -359,10 +359,7 @@ export declare interface BaseAutocompleteOption {
359
359
  }
360
360
 
361
361
  /** @public */
362
- export declare interface BoundaryElementContextValue {
363
- version: 0.0
364
- element: HTMLElement | null
365
- }
362
+ export declare type BoundaryElementContextValue = HTMLElement | null
366
363
 
367
364
  /** @public */
368
365
  export declare function BoundaryElementProvider(
@@ -1040,11 +1037,6 @@ export declare function focusFirstDescendant(element: HTMLElement): boolean
1040
1037
  */
1041
1038
  export declare function focusLastDescendant(element: HTMLElement): boolean
1042
1039
 
1043
- /**
1044
- * @internal
1045
- */
1046
- export declare function _getArrayProp<T>(val: T | T[] | undefined, defaultVal?: T[]): T[]
1047
-
1048
1040
  /**
1049
1041
  * @internal
1050
1042
  */
@@ -2369,7 +2361,10 @@ export declare interface TreeState {
2369
2361
  }
2370
2362
 
2371
2363
  /** @public */
2372
- export declare function useBoundaryElement(): BoundaryElementContextValue
2364
+ export declare function useBoundaryElement(): {
2365
+ version: 0.0
2366
+ element: BoundaryElementContextValue
2367
+ }
2373
2368
 
2374
2369
  /** @public */
2375
2370
  export declare function useCard(): CardContextValue
@@ -2467,15 +2462,6 @@ export declare function usePrefersDark(getServerSnapshot?: () => boolean): boole
2467
2462
  */
2468
2463
  export declare function usePrefersReducedMotion(getServerSnapshot?: () => boolean): boolean
2469
2464
 
2470
- /**
2471
- * This API might change. DO NOT USE IN PRODUCTION.
2472
- * @beta
2473
- */
2474
- export declare function useResponsiveProp<T>(
2475
- val: ResponsiveProp<T> | undefined,
2476
- defaultVal?: Partial<Record<Breakpoint, T>>,
2477
- ): Partial<Record<Breakpoint, T>>
2478
-
2479
2465
  /** @public */
2480
2466
  export declare function useToast(): ToastContextValue
2481
2467