@sanity/ui 3.0.0-static.27 → 3.0.0-static.29

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 (229) hide show
  1. package/README.md +5 -8
  2. package/dist/_chunks-cjs/_visual-editing.cjs +744 -874
  3. package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
  4. package/dist/_chunks-cjs/refractor.cjs +2 -2
  5. package/dist/_chunks-cjs/refractor.cjs.map +1 -1
  6. package/dist/_chunks-es/_visual-editing.js +788 -917
  7. package/dist/_chunks-es/_visual-editing.js.map +1 -1
  8. package/dist/_chunks-es/refractor.js +1 -1
  9. package/dist/{css.cjs → css/index.cjs} +72 -53
  10. package/dist/css/index.cjs.map +1 -0
  11. package/dist/css/index.css +1 -0
  12. package/dist/{css.d.ts → css/index.d.cts} +26 -8
  13. package/dist/{css.d.cts → css/index.d.ts} +26 -8
  14. package/dist/{css.js → css/index.js} +72 -53
  15. package/dist/css/index.js.map +1 -0
  16. package/dist/css/layers.css +4 -0
  17. package/dist/css/primitives/popover/popover.css +4 -0
  18. package/dist/index.cjs +2049 -1811
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +62 -26
  21. package/dist/index.d.ts +62 -26
  22. package/dist/index.js +2056 -1819
  23. package/dist/index.js.map +1 -1
  24. package/dist/theme.cjs +7 -7
  25. package/dist/theme.cjs.map +1 -1
  26. package/dist/theme.js +7 -7
  27. package/dist/theme.js.map +1 -1
  28. package/exports/_visual-editing.ts +1 -1
  29. package/package.json +14 -19
  30. package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
  31. package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +1 -1
  32. package/src/core/components/autocomplete/autocomplete.tsx +15 -19
  33. package/src/core/components/autocomplete/autocompleteOption.tsx +1 -1
  34. package/src/core/components/autocomplete/constants.ts +3 -1
  35. package/src/core/components/autocomplete/types.ts +1 -1
  36. package/src/core/components/breadcrumbs/breadcrumbs.tsx +8 -3
  37. package/src/core/components/dialog/__workshop__/activate.tsx +11 -3
  38. package/src/core/components/dialog/__workshop__/panes.tsx +12 -5
  39. package/src/core/components/dialog/dialog.tsx +12 -6
  40. package/src/core/components/dialog/dialogCard.tsx +89 -54
  41. package/src/core/components/dialog/dialogContext.ts +1 -1
  42. package/src/core/components/dialog/dialogProvider.tsx +1 -1
  43. package/src/core/components/dialog/index.ts +1 -0
  44. package/src/core/components/dialog/isTargetWithinScope.ts +1 -1
  45. package/src/core/components/hotkeys/hotkeys.tsx +3 -2
  46. package/src/core/components/menu/__workshop__/avatarMenu.tsx +12 -6
  47. package/src/core/components/menu/__workshop__/customSelectedState.tsx +1 -5
  48. package/src/core/components/menu/__workshop__/shouldFocus.tsx +1 -2
  49. package/src/core/components/menu/helpers.ts +1 -1
  50. package/src/core/components/menu/menu.tsx +6 -3
  51. package/src/core/components/menu/menuButton.tsx +5 -3
  52. package/src/core/components/menu/menuDivider.tsx +1 -1
  53. package/src/core/components/menu/menuGroup.tsx +8 -4
  54. package/src/core/components/menu/menuItem.tsx +4 -2
  55. package/src/core/components/tab/tab.tsx +2 -2
  56. package/src/core/components/tab/tabList.tsx +2 -2
  57. package/src/core/components/tab/tabPanel.tsx +2 -2
  58. package/src/core/components/toast/toast.tsx +21 -17
  59. package/src/core/components/toast/toastLayer.tsx +3 -2
  60. package/src/core/components/toast/toastProvider.tsx +15 -11
  61. package/src/core/components/tree/tree.tsx +2 -2
  62. package/src/core/components/tree/treeGroup.tsx +2 -2
  63. package/src/core/components/tree/treeItem.tsx +13 -6
  64. package/src/core/components/tree/types.ts +0 -1
  65. package/src/core/components/virtualList/virtualList.tsx +10 -5
  66. package/src/core/helpers/focus.ts +0 -8
  67. package/src/core/hooks/useArrayProp.ts +1 -1
  68. package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -3
  69. package/src/core/hooks/useElementSize.ts +1 -1
  70. package/src/core/hooks/useResponsiveProp.ts +1 -1
  71. package/src/core/index.ts +84 -7
  72. package/src/core/observers/{elementSizeObserver.ts → elementSize.ts} +1 -1
  73. package/src/core/primitives/_selectable/index.ts +1 -0
  74. package/src/core/primitives/_selectable/selectable.tsx +13 -3
  75. package/src/core/{types/selectable.ts → primitives/_selectable/types.ts} +1 -1
  76. package/src/core/primitives/arrow/arrow.tsx +1 -1
  77. package/src/core/primitives/avatar/avatar.tsx +4 -3
  78. package/src/core/primitives/avatar/avatarCounter.tsx +3 -3
  79. package/src/core/primitives/avatar/avatarStack.tsx +4 -4
  80. package/src/core/primitives/avatar/types.ts +17 -0
  81. package/src/core/primitives/badge/badge.tsx +2 -1
  82. package/src/core/primitives/badge/types.ts +11 -2
  83. package/src/core/primitives/box/__workshop__/responsive.tsx +0 -1
  84. package/src/core/primitives/box/box.tsx +1 -1
  85. package/src/core/primitives/box/index.ts +1 -0
  86. package/src/core/primitives/button/__workshop__/disabled.tsx +37 -51
  87. package/src/core/primitives/button/__workshop__/index.ts +5 -0
  88. package/src/core/primitives/button/__workshop__/textOverflow.tsx +13 -0
  89. package/src/core/primitives/button/button.tsx +15 -14
  90. package/src/core/primitives/button/index.ts +1 -0
  91. package/src/core/primitives/card/__workshop__/listNavigation.tsx +2 -2
  92. package/src/core/primitives/card/card.tsx +1 -1
  93. package/src/core/primitives/card/types.ts +3 -0
  94. package/src/core/primitives/checkbox/__workshop__/tones.tsx +9 -1
  95. package/src/core/primitives/checkbox/checkbox.tsx +3 -4
  96. package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +17 -42
  97. package/src/core/primitives/code/code.tsx +1 -1
  98. package/src/core/primitives/container/container.tsx +1 -1
  99. package/src/core/primitives/flex/flex.tsx +1 -1
  100. package/src/core/primitives/flex/index.ts +1 -0
  101. package/src/core/primitives/grid/grid.tsx +1 -1
  102. package/src/core/primitives/grid/index.ts +1 -0
  103. package/src/core/primitives/heading/heading.tsx +1 -1
  104. package/src/core/primitives/inline/inline.tsx +1 -1
  105. package/src/core/primitives/kbd/kbd.tsx +1 -1
  106. package/src/core/primitives/label/label.tsx +1 -1
  107. package/src/core/primitives/layer/layer.test.tsx +1 -1
  108. package/src/core/primitives/layer/layer.tsx +2 -2
  109. package/src/core/primitives/layer/layerCard.tsx +3 -3
  110. package/src/core/primitives/layer/layerProvider.tsx +2 -1
  111. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +12 -10
  112. package/src/core/primitives/popover/__workshop__/TestStory.tsx +9 -8
  113. package/src/core/primitives/popover/constants.ts +1 -1
  114. package/src/core/primitives/popover/floating-ui/size.ts +1 -1
  115. package/src/core/primitives/popover/popover.tsx +7 -4
  116. package/src/core/primitives/popover/popoverLayer.tsx +2 -1
  117. package/src/core/primitives/popover/types.ts +5 -0
  118. package/src/core/primitives/radio/radio.tsx +2 -2
  119. package/src/core/primitives/root/Root.tsx +89 -0
  120. package/src/core/primitives/root/__workshop__/boundary.tsx +5 -0
  121. package/src/core/primitives/root/__workshop__/index.ts +8 -0
  122. package/src/core/primitives/root/index.ts +1 -0
  123. package/src/core/primitives/select/select.tsx +2 -2
  124. package/src/core/{components → primitives}/skeleton/__workshop__/index.ts +1 -1
  125. package/src/core/{components → primitives}/skeleton/codeSkeleton.tsx +1 -1
  126. package/src/core/{components → primitives}/skeleton/headingSkeleton.tsx +1 -1
  127. package/src/core/{components → primitives}/skeleton/labelSkeleton.tsx +1 -1
  128. package/src/core/{components → primitives}/skeleton/skeleton.tsx +7 -8
  129. package/src/core/{components → primitives}/skeleton/textSkeleton.tsx +1 -1
  130. package/src/core/primitives/spinner/spinner.tsx +1 -1
  131. package/src/core/primitives/srOnly/srOnly.tsx +1 -1
  132. package/src/core/primitives/stack/stack.tsx +1 -1
  133. package/src/core/primitives/switch/switch.tsx +1 -6
  134. package/src/core/primitives/text/__workshop__/colored.tsx +2 -2
  135. package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +17 -42
  136. package/src/core/primitives/text/text.tsx +3 -1
  137. package/src/core/primitives/textArea/__workshop__/plain.tsx +2 -2
  138. package/src/core/primitives/textArea/textArea.tsx +2 -2
  139. package/src/core/primitives/textInput/textInput.tsx +3 -2
  140. package/src/core/primitives/tooltip/constants.ts +1 -1
  141. package/src/core/primitives/tooltip/tooltip.tsx +5 -3
  142. package/src/core/primitives/tooltip/tooltipLayer.tsx +1 -1
  143. package/src/core/primitives/types.ts +8 -10
  144. package/src/core/types/radius.ts +1 -1
  145. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +9 -5
  146. package/src/core/utils/elementQuery/elementQuery.tsx +2 -2
  147. package/src/core/utils/portal/portal.tsx +1 -1
  148. package/src/css/components/dialog/dialog.css.ts +26 -1
  149. package/src/css/components/dialog/dialog.ts +27 -7
  150. package/src/css/components/skeleton/skeleton.ts +3 -1
  151. package/src/css/components/skeleton/types.ts +3 -1
  152. package/src/css/components/toast/toast.css.ts +1 -0
  153. package/src/css/defaultTheme.css.ts +55 -2
  154. package/src/css/index.ts +77 -5
  155. package/src/css/primitives/_input/input.ts +2 -1
  156. package/src/css/primitives/_input/types.ts +2 -1
  157. package/src/css/primitives/_selectable/_selectable.css.ts +32 -24
  158. package/src/css/primitives/_selectable/selectable.ts +1 -1
  159. package/src/css/primitives/_selectable/types.ts +1 -1
  160. package/src/css/primitives/avatar/avatar.css.ts +8 -4
  161. package/src/css/primitives/avatar/avatar.ts +1 -1
  162. package/src/css/primitives/badge/types.ts +0 -2
  163. package/src/css/primitives/box/box.ts +35 -37
  164. package/src/css/primitives/box/types.ts +34 -36
  165. package/src/css/primitives/button/button.css.ts +4 -0
  166. package/src/css/primitives/button/button.ts +5 -2
  167. package/src/css/primitives/button/types.ts +4 -11
  168. package/src/css/primitives/card/__workshop__/color.tsx +70 -0
  169. package/src/css/primitives/card/__workshop__/index.ts +14 -0
  170. package/src/css/primitives/card/card.css.ts +4 -0
  171. package/src/css/primitives/code/code.ts +3 -1
  172. package/src/css/primitives/code/types.ts +2 -1
  173. package/src/css/primitives/container/container.ts +3 -1
  174. package/src/css/primitives/heading/heading.ts +4 -1
  175. package/src/css/primitives/heading/types.ts +3 -1
  176. package/src/css/primitives/kbd/kbd.ts +1 -1
  177. package/src/css/primitives/kbd/types.ts +1 -1
  178. package/src/css/primitives/label/label.ts +4 -1
  179. package/src/css/primitives/label/types.ts +3 -1
  180. package/src/css/primitives/root/index.ts +2 -0
  181. package/src/css/primitives/root/root.css.ts +15 -0
  182. package/src/css/primitives/root/root.ts +17 -0
  183. package/src/css/primitives/root/types.ts +10 -0
  184. package/src/css/primitives/switch/switch.css.ts +1 -1
  185. package/src/css/primitives/text/text.ts +6 -1
  186. package/src/css/primitives/text/types.ts +5 -2
  187. package/src/theme/v3/defaultFonts.ts +6 -6
  188. package/src/theme/v3/defaultTokens.ts +1 -1
  189. package/bin/sanity-ui.cjs +0 -5
  190. package/dist/css.cjs.map +0 -1
  191. package/dist/css.js.map +0 -1
  192. package/dist/ui.css +0 -1
  193. package/src/cli/buildCommand.ts +0 -10
  194. package/src/cli/index.ts +0 -26
  195. package/src/core/components/autocomplete/index.ts +0 -2
  196. package/src/core/components/index.ts +0 -10
  197. package/src/core/helpers/index.ts +0 -5
  198. package/src/core/hooks/index.ts +0 -13
  199. package/src/core/observers/index.ts +0 -2
  200. package/src/core/primitives/index.ts +0 -30
  201. package/src/core/types/avatar.ts +0 -16
  202. package/src/core/types/card.ts +0 -4
  203. package/src/core/types/index.ts +0 -15
  204. package/src/core/types/popover.ts +0 -4
  205. package/src/core/utils/index.ts +0 -4
  206. package/src/css/__theme/index.ts +0 -16
  207. package/src/css/__theme/lib/contract/buildVarContract.ts +0 -78
  208. package/src/css/__theme/lib/contract/index.ts +0 -4
  209. package/src/css/__theme/lib/contract/types.ts +0 -17
  210. package/src/css/__theme/resolveTheme.ts +0 -865
  211. package/src/css/components/index.ts +0 -6
  212. package/src/css/primitives/index.ts +0 -24
  213. package/src/css/props/index.ts +0 -37
  214. package/src/css/utils/srOnly/index.ts +0 -1
  215. /package/src/core/{global.ts → __DEV__.ts} +0 -0
  216. /package/src/core/{types/dialog.ts → components/dialog/types.ts} +0 -0
  217. /package/src/core/observers/{resizeObserver.ts → resize.ts} +0 -0
  218. /package/src/core/{types/badge.ts → primitives/badge/types2.ts} +0 -0
  219. /package/src/core/{types/box.ts → primitives/box/types.ts} +0 -0
  220. /package/src/core/{types/button.ts → primitives/button/types.ts} +0 -0
  221. /package/src/core/{types/flex.ts → primitives/flex/types.ts} +0 -0
  222. /package/src/core/{types/grid.ts → primitives/grid/types.ts} +0 -0
  223. /package/src/core/{components → primitives}/skeleton/__workshop__/delay.tsx +0 -0
  224. /package/src/core/{components → primitives}/skeleton/__workshop__/skeleton.tsx +0 -0
  225. /package/src/core/{components → primitives}/skeleton/index.ts +0 -0
  226. /package/src/core/types/{text.ts → textAlign.ts} +0 -0
  227. /package/src/css/{utils → primitives/srOnly}/index.ts +0 -0
  228. /package/src/css/{utils → primitives}/srOnly/srOnly.css.ts +0 -0
  229. /package/src/css/{utils → primitives}/srOnly/srOnly.ts +0 -0
package/dist/index.d.cts CHANGED
@@ -76,8 +76,10 @@ import {RGB as RGB_2} from '@sanity/ui/theme'
76
76
  import {rgba as rgba_2} from '@sanity/ui/theme'
77
77
  import {rgbToHex as rgbToHex_2} from '@sanity/ui/theme'
78
78
  import {rgbToHsl as rgbToHsl_2} from '@sanity/ui/theme'
79
+ import {RootStyleProps} from '@sanity/ui/css'
79
80
  import {RootTheme as RootTheme_2} from '@sanity/ui/theme'
80
81
  import {screen as screen_3} from '@sanity/ui/theme'
82
+ import {SelectableStyleProps} from '@sanity/ui/css'
81
83
  import {SelectStyleProps} from '@sanity/ui/css'
82
84
  import {ShadowStyleProps} from '@sanity/ui/css'
83
85
  import {SkeletonStyleProps} from '@sanity/ui/css'
@@ -222,7 +224,7 @@ export declare type AutocompleteOwnProps<
222
224
  filterOption?: (query: string, option: O) => boolean
223
225
  icon?: ElementType_2 | ReactNode
224
226
  /** @beta */
225
- listBox?: BoxProps
227
+ listBox?: BoxOwnProps
226
228
  loading?: boolean
227
229
  onChange?: (value: string) => void
228
230
  onQueryChange?: (query: string | null) => void
@@ -443,12 +445,6 @@ export declare function Badge<E extends BadgeElementType = typeof DEFAULT_BADGE_
443
445
  /** @public */
444
446
  export declare type BadgeElementType = 'div' | 'span' | ComponentType
445
447
 
446
- /**
447
- * @public
448
- * @deprecated No longer used
449
- */
450
- export declare type BadgeMode = 'default' | 'outline'
451
-
452
448
  /** @public */
453
449
  export declare type BadgeOwnProps = PaddingStyleProps &
454
450
  RadiusStyleProps & {
@@ -463,7 +459,7 @@ export declare type BadgeProps<E extends BadgeElementType = BadgeElementType> =
463
459
  >
464
460
 
465
461
  /** @public */
466
- export declare type BadgeTone = ThemeColorStateToneKey
462
+ declare type BadgeTone = ThemeColorStateToneKey
467
463
 
468
464
  /** @public */
469
465
  export declare interface BaseAutocompleteOption {
@@ -832,13 +828,13 @@ export declare const DEFAULT_ARROW_ELEMENT = 'div'
832
828
  export declare const DEFAULT_AUTOCOMPLETE_ELEMENT = 'input'
833
829
 
834
830
  /** @public */
835
- export declare const DEFAULT_AVATAR_COUNTER_ELEMENT = 'div'
831
+ export declare const DEFAULT_AVATAR_COUNTER_ELEMENT = 'span'
836
832
 
837
833
  /** @public */
838
834
  export declare const DEFAULT_AVATAR_ELEMENT = 'span'
839
835
 
840
836
  /** @public */
841
- export declare const DEFAULT_AVATAR_STACK_ELEMENT = 'div'
837
+ export declare const DEFAULT_AVATAR_STACK_ELEMENT = 'span'
842
838
 
843
839
  /** @public */
844
840
  export declare const DEFAULT_BADGE_ELEMENT = 'span'
@@ -921,9 +917,15 @@ export declare const DEFAULT_POPOVER_ELEMENT = 'div'
921
917
  /** @public */
922
918
  export declare const DEFAULT_RADIO_ELEMENT = 'input'
923
919
 
920
+ /** @public */
921
+ export declare const DEFAULT_ROOT_ELEMENT = 'html'
922
+
924
923
  /** @public */
925
924
  export declare const DEFAULT_SELECT_ELEMENT = 'select'
926
925
 
926
+ /** @internal */
927
+ export declare const DEFAULT_SELECTABLE_ELEMENT = 'button'
928
+
927
929
  /** @beta */
928
930
  export declare const DEFAULT_SKELETON_ELEMENT = 'div'
929
931
 
@@ -960,7 +962,7 @@ export declare const DEFAULT_TEXT_INPUT_ELEMENT = 'input'
960
962
  /** @beta */
961
963
  export declare const DEFAULT_TEXT_SKELETON_ELEMENT = 'div'
962
964
 
963
- /** @public */
965
+ /** @internal */
964
966
  export declare const DEFAULT_TOAST_ELEMENT = 'li'
965
967
 
966
968
  /** @public */
@@ -2142,6 +2144,24 @@ export declare const rgbToHex: typeof rgbToHex_2
2142
2144
  */
2143
2145
  export declare const rgbToHsl: typeof rgbToHsl_2
2144
2146
 
2147
+ /**
2148
+ * The `Root` component.
2149
+ *
2150
+ * @public
2151
+ */
2152
+ export declare function Root<E extends RootElementType = typeof DEFAULT_ROOT_ELEMENT>(
2153
+ props: RootProps<E>,
2154
+ ): JSX.Element
2155
+
2156
+ /** @public */
2157
+ export declare type RootElementType = 'html' | 'body' | 'div'
2158
+
2159
+ /** @public */
2160
+ export declare interface RootOwnProps extends BoxOwnProps, RootStyleProps {}
2161
+
2162
+ /** @public */
2163
+ export declare type RootProps<E extends RootElementType = RootElementType> = Props<RootOwnProps, E>
2164
+
2145
2165
  /**
2146
2166
  * @public
2147
2167
  * @deprecated Use `RootTheme` from `@sanity/ui/theme` instead.
@@ -2165,10 +2185,29 @@ export declare function Select<E extends SelectElementType = typeof DEFAULT_SELE
2165
2185
  ): JSX.Element
2166
2186
 
2167
2187
  /** @internal */
2168
- declare type SelectableElementType = 'button' | 'a' | ComponentType
2188
+ export declare function Selectable<
2189
+ E extends SelectableElementType = typeof DEFAULT_SELECTABLE_ELEMENT,
2190
+ >(props: SelectableProps<E>): JSX.Element
2191
+
2192
+ /** @internal */
2193
+ export declare type SelectableElementType = 'button' | 'a' | ComponentType
2194
+
2195
+ /** @internal */
2196
+ export declare type SelectableOwnProps = BoxOwnProps &
2197
+ SelectableStyleProps & {
2198
+ disabled?: boolean
2199
+ href?: string
2200
+ selected?: boolean
2201
+ tone?: ThemeColorStateToneKey
2202
+ type?: 'button'
2203
+ }
2204
+
2205
+ /** @internal */
2206
+ export declare type SelectableProps<E extends SelectableElementType = SelectableElementType> =
2207
+ Props<SelectableOwnProps, E>
2169
2208
 
2170
2209
  /**
2171
- * @public
2210
+ * @internal
2172
2211
  * @deprecated Use `ThemeColorStateToneKey` instead
2173
2212
  */
2174
2213
  export declare type SelectableTone = ThemeColorStateToneKey
@@ -2205,11 +2244,10 @@ export declare type SkeletonElementType = 'div' | 'span' | ComponentType
2205
2244
  * This API might change. DO NOT USE IN PRODUCTION.
2206
2245
  * @beta
2207
2246
  */
2208
- export declare type SkeletonOwnProps = BoxOwnProps &
2209
- SkeletonStyleProps & {
2210
- animated?: boolean
2211
- delay?: number
2212
- }
2247
+ export declare type SkeletonOwnProps = SkeletonStyleProps & {
2248
+ animated?: boolean
2249
+ delay?: number
2250
+ }
2213
2251
 
2214
2252
  /** @beta */
2215
2253
  export declare type SkeletonProps<E extends SkeletonElementType = SkeletonElementType> = Props<
@@ -2704,9 +2742,9 @@ export declare type ThemeShadow = ThemeShadow_2
2704
2742
  /**
2705
2743
  * The `Toast` component gives feedback to users when an action has taken place.
2706
2744
  *
2707
- * Toasts can be closed with a close button, or auto-dismiss after a certain timeout.
2745
+ * Toasts can be closed with a close button, or auto-dismiss when the duration expires.
2708
2746
  *
2709
- * @public
2747
+ * @internal
2710
2748
  */
2711
2749
  export declare function Toast<E extends ToastElementType = typeof DEFAULT_TOAST_ELEMENT>(
2712
2750
  props: ToastProps<E>,
@@ -2724,7 +2762,7 @@ export declare interface ToastContextValue {
2724
2762
  push: (params: ToastParams) => string
2725
2763
  }
2726
2764
 
2727
- /** @public */
2765
+ /** @internal */
2728
2766
  export declare type ToastElementType = 'li' | ComponentType
2729
2767
 
2730
2768
  /** @internal */
@@ -2739,17 +2777,14 @@ declare type ToastLayerProps<E extends ToastLayerElementType = ToastLayerElement
2739
2777
  E
2740
2778
  >
2741
2779
 
2742
- /** @public */
2780
+ /** @internal */
2743
2781
  export declare type ToastOwnProps = RadiusStyleProps & {
2744
2782
  closable?: boolean
2745
2783
  description?: ReactNode
2746
2784
  onClose?: () => void
2747
2785
  title?: ReactNode
2748
2786
  status?: 'error' | 'warning' | 'success' | 'info'
2749
- /** @deprecated */
2750
2787
  duration?: number
2751
- /** @deprecated */
2752
- updatedAt?: number
2753
2788
  }
2754
2789
 
2755
2790
  /** @public */
@@ -2763,7 +2798,7 @@ export declare interface ToastParams {
2763
2798
  status?: 'error' | 'warning' | 'success' | 'info'
2764
2799
  }
2765
2800
 
2766
- /** @public */
2801
+ /** @internal */
2767
2802
  export declare type ToastProps<E extends ToastElementType = ToastElementType> = Props<
2768
2803
  ToastOwnProps,
2769
2804
  E
@@ -2919,6 +2954,7 @@ export declare type TreeItemOwnProps = CardOwnProps & {
2919
2954
  icon?: ElementType_2
2920
2955
  /**
2921
2956
  * Allows passing a custom element type to the link component
2957
+ * @internal
2922
2958
  */
2923
2959
  linkAs?: SelectableElementType
2924
2960
  onClick?: MouseEventHandler<HTMLAnchorElement | HTMLLIElement>
package/dist/index.d.ts CHANGED
@@ -76,8 +76,10 @@ import {RGB as RGB_2} from '@sanity/ui/theme'
76
76
  import {rgba as rgba_2} from '@sanity/ui/theme'
77
77
  import {rgbToHex as rgbToHex_2} from '@sanity/ui/theme'
78
78
  import {rgbToHsl as rgbToHsl_2} from '@sanity/ui/theme'
79
+ import {RootStyleProps} from '@sanity/ui/css'
79
80
  import {RootTheme as RootTheme_2} from '@sanity/ui/theme'
80
81
  import {screen as screen_3} from '@sanity/ui/theme'
82
+ import {SelectableStyleProps} from '@sanity/ui/css'
81
83
  import {SelectStyleProps} from '@sanity/ui/css'
82
84
  import {ShadowStyleProps} from '@sanity/ui/css'
83
85
  import {SkeletonStyleProps} from '@sanity/ui/css'
@@ -222,7 +224,7 @@ export declare type AutocompleteOwnProps<
222
224
  filterOption?: (query: string, option: O) => boolean
223
225
  icon?: ElementType_2 | ReactNode
224
226
  /** @beta */
225
- listBox?: BoxProps
227
+ listBox?: BoxOwnProps
226
228
  loading?: boolean
227
229
  onChange?: (value: string) => void
228
230
  onQueryChange?: (query: string | null) => void
@@ -443,12 +445,6 @@ export declare function Badge<E extends BadgeElementType = typeof DEFAULT_BADGE_
443
445
  /** @public */
444
446
  export declare type BadgeElementType = 'div' | 'span' | ComponentType
445
447
 
446
- /**
447
- * @public
448
- * @deprecated No longer used
449
- */
450
- export declare type BadgeMode = 'default' | 'outline'
451
-
452
448
  /** @public */
453
449
  export declare type BadgeOwnProps = PaddingStyleProps &
454
450
  RadiusStyleProps & {
@@ -463,7 +459,7 @@ export declare type BadgeProps<E extends BadgeElementType = BadgeElementType> =
463
459
  >
464
460
 
465
461
  /** @public */
466
- export declare type BadgeTone = ThemeColorStateToneKey
462
+ declare type BadgeTone = ThemeColorStateToneKey
467
463
 
468
464
  /** @public */
469
465
  export declare interface BaseAutocompleteOption {
@@ -832,13 +828,13 @@ export declare const DEFAULT_ARROW_ELEMENT = 'div'
832
828
  export declare const DEFAULT_AUTOCOMPLETE_ELEMENT = 'input'
833
829
 
834
830
  /** @public */
835
- export declare const DEFAULT_AVATAR_COUNTER_ELEMENT = 'div'
831
+ export declare const DEFAULT_AVATAR_COUNTER_ELEMENT = 'span'
836
832
 
837
833
  /** @public */
838
834
  export declare const DEFAULT_AVATAR_ELEMENT = 'span'
839
835
 
840
836
  /** @public */
841
- export declare const DEFAULT_AVATAR_STACK_ELEMENT = 'div'
837
+ export declare const DEFAULT_AVATAR_STACK_ELEMENT = 'span'
842
838
 
843
839
  /** @public */
844
840
  export declare const DEFAULT_BADGE_ELEMENT = 'span'
@@ -921,9 +917,15 @@ export declare const DEFAULT_POPOVER_ELEMENT = 'div'
921
917
  /** @public */
922
918
  export declare const DEFAULT_RADIO_ELEMENT = 'input'
923
919
 
920
+ /** @public */
921
+ export declare const DEFAULT_ROOT_ELEMENT = 'html'
922
+
924
923
  /** @public */
925
924
  export declare const DEFAULT_SELECT_ELEMENT = 'select'
926
925
 
926
+ /** @internal */
927
+ export declare const DEFAULT_SELECTABLE_ELEMENT = 'button'
928
+
927
929
  /** @beta */
928
930
  export declare const DEFAULT_SKELETON_ELEMENT = 'div'
929
931
 
@@ -960,7 +962,7 @@ export declare const DEFAULT_TEXT_INPUT_ELEMENT = 'input'
960
962
  /** @beta */
961
963
  export declare const DEFAULT_TEXT_SKELETON_ELEMENT = 'div'
962
964
 
963
- /** @public */
965
+ /** @internal */
964
966
  export declare const DEFAULT_TOAST_ELEMENT = 'li'
965
967
 
966
968
  /** @public */
@@ -2142,6 +2144,24 @@ export declare const rgbToHex: typeof rgbToHex_2
2142
2144
  */
2143
2145
  export declare const rgbToHsl: typeof rgbToHsl_2
2144
2146
 
2147
+ /**
2148
+ * The `Root` component.
2149
+ *
2150
+ * @public
2151
+ */
2152
+ export declare function Root<E extends RootElementType = typeof DEFAULT_ROOT_ELEMENT>(
2153
+ props: RootProps<E>,
2154
+ ): JSX.Element
2155
+
2156
+ /** @public */
2157
+ export declare type RootElementType = 'html' | 'body' | 'div'
2158
+
2159
+ /** @public */
2160
+ export declare interface RootOwnProps extends BoxOwnProps, RootStyleProps {}
2161
+
2162
+ /** @public */
2163
+ export declare type RootProps<E extends RootElementType = RootElementType> = Props<RootOwnProps, E>
2164
+
2145
2165
  /**
2146
2166
  * @public
2147
2167
  * @deprecated Use `RootTheme` from `@sanity/ui/theme` instead.
@@ -2165,10 +2185,29 @@ export declare function Select<E extends SelectElementType = typeof DEFAULT_SELE
2165
2185
  ): JSX.Element
2166
2186
 
2167
2187
  /** @internal */
2168
- declare type SelectableElementType = 'button' | 'a' | ComponentType
2188
+ export declare function Selectable<
2189
+ E extends SelectableElementType = typeof DEFAULT_SELECTABLE_ELEMENT,
2190
+ >(props: SelectableProps<E>): JSX.Element
2191
+
2192
+ /** @internal */
2193
+ export declare type SelectableElementType = 'button' | 'a' | ComponentType
2194
+
2195
+ /** @internal */
2196
+ export declare type SelectableOwnProps = BoxOwnProps &
2197
+ SelectableStyleProps & {
2198
+ disabled?: boolean
2199
+ href?: string
2200
+ selected?: boolean
2201
+ tone?: ThemeColorStateToneKey
2202
+ type?: 'button'
2203
+ }
2204
+
2205
+ /** @internal */
2206
+ export declare type SelectableProps<E extends SelectableElementType = SelectableElementType> =
2207
+ Props<SelectableOwnProps, E>
2169
2208
 
2170
2209
  /**
2171
- * @public
2210
+ * @internal
2172
2211
  * @deprecated Use `ThemeColorStateToneKey` instead
2173
2212
  */
2174
2213
  export declare type SelectableTone = ThemeColorStateToneKey
@@ -2205,11 +2244,10 @@ export declare type SkeletonElementType = 'div' | 'span' | ComponentType
2205
2244
  * This API might change. DO NOT USE IN PRODUCTION.
2206
2245
  * @beta
2207
2246
  */
2208
- export declare type SkeletonOwnProps = BoxOwnProps &
2209
- SkeletonStyleProps & {
2210
- animated?: boolean
2211
- delay?: number
2212
- }
2247
+ export declare type SkeletonOwnProps = SkeletonStyleProps & {
2248
+ animated?: boolean
2249
+ delay?: number
2250
+ }
2213
2251
 
2214
2252
  /** @beta */
2215
2253
  export declare type SkeletonProps<E extends SkeletonElementType = SkeletonElementType> = Props<
@@ -2704,9 +2742,9 @@ export declare type ThemeShadow = ThemeShadow_2
2704
2742
  /**
2705
2743
  * The `Toast` component gives feedback to users when an action has taken place.
2706
2744
  *
2707
- * Toasts can be closed with a close button, or auto-dismiss after a certain timeout.
2745
+ * Toasts can be closed with a close button, or auto-dismiss when the duration expires.
2708
2746
  *
2709
- * @public
2747
+ * @internal
2710
2748
  */
2711
2749
  export declare function Toast<E extends ToastElementType = typeof DEFAULT_TOAST_ELEMENT>(
2712
2750
  props: ToastProps<E>,
@@ -2724,7 +2762,7 @@ export declare interface ToastContextValue {
2724
2762
  push: (params: ToastParams) => string
2725
2763
  }
2726
2764
 
2727
- /** @public */
2765
+ /** @internal */
2728
2766
  export declare type ToastElementType = 'li' | ComponentType
2729
2767
 
2730
2768
  /** @internal */
@@ -2739,17 +2777,14 @@ declare type ToastLayerProps<E extends ToastLayerElementType = ToastLayerElement
2739
2777
  E
2740
2778
  >
2741
2779
 
2742
- /** @public */
2780
+ /** @internal */
2743
2781
  export declare type ToastOwnProps = RadiusStyleProps & {
2744
2782
  closable?: boolean
2745
2783
  description?: ReactNode
2746
2784
  onClose?: () => void
2747
2785
  title?: ReactNode
2748
2786
  status?: 'error' | 'warning' | 'success' | 'info'
2749
- /** @deprecated */
2750
2787
  duration?: number
2751
- /** @deprecated */
2752
- updatedAt?: number
2753
2788
  }
2754
2789
 
2755
2790
  /** @public */
@@ -2763,7 +2798,7 @@ export declare interface ToastParams {
2763
2798
  status?: 'error' | 'warning' | 'success' | 'info'
2764
2799
  }
2765
2800
 
2766
- /** @public */
2801
+ /** @internal */
2767
2802
  export declare type ToastProps<E extends ToastElementType = ToastElementType> = Props<
2768
2803
  ToastOwnProps,
2769
2804
  E
@@ -2919,6 +2954,7 @@ export declare type TreeItemOwnProps = CardOwnProps & {
2919
2954
  icon?: ElementType_2
2920
2955
  /**
2921
2956
  * Allows passing a custom element type to the link component
2957
+ * @internal
2922
2958
  */
2923
2959
  linkAs?: SelectableElementType
2924
2960
  onClick?: MouseEventHandler<HTMLAnchorElement | HTMLLIElement>