@sanity/ui 3.0.0-static.0 → 3.0.0-static.1

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 (216) hide show
  1. package/dist/_chunks-cjs/buildCommand.js +1387 -681
  2. package/dist/_chunks-cjs/buildCommand.js.map +1 -1
  3. package/dist/cli.js +4 -2
  4. package/dist/cli.js.map +1 -1
  5. package/dist/css.d.mts +131 -12
  6. package/dist/css.d.ts +131 -12
  7. package/dist/css.esm.js +1450 -791
  8. package/dist/css.esm.js.map +1 -1
  9. package/dist/css.js +1449 -790
  10. package/dist/css.js.map +1 -1
  11. package/dist/css.mjs +1450 -791
  12. package/dist/css.mjs.map +1 -1
  13. package/dist/index.d.mts +84 -76
  14. package/dist/index.d.ts +84 -76
  15. package/dist/index.esm.js +2734 -3146
  16. package/dist/index.esm.js.map +1 -1
  17. package/dist/index.js +2733 -3145
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +2734 -3146
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/sanity-theme.css +1 -1
  22. package/dist/system.css +1590 -1158
  23. package/dist/theme.esm.js +1565 -452
  24. package/dist/theme.esm.js.map +1 -1
  25. package/dist/theme.js +1599 -484
  26. package/dist/theme.js.map +1 -1
  27. package/dist/theme.mjs +1565 -452
  28. package/dist/theme.mjs.map +1 -1
  29. package/package.json +22 -22
  30. package/src/core/__workshop__/constants.ts +14 -5
  31. package/src/core/__workshop__/fontsPlugin.tsx +1 -1
  32. package/src/core/_compat/index.ts +2 -0
  33. package/src/core/{styles → _compat/styles}/box/boxStyle.ts +1 -1
  34. package/src/core/{styles → _compat/styles}/box/types.ts +1 -1
  35. package/src/core/{styles → _compat/styles}/card/_cardColorStyle.ts +2 -2
  36. package/src/core/{styles → _compat/styles}/flex/flexItemStyle.ts +1 -1
  37. package/src/core/{styles → _compat/styles}/font/types.ts +1 -1
  38. package/src/core/{styles → _compat/styles}/grid/types.ts +1 -1
  39. package/src/core/{styles → _compat/styles}/helpers.ts +1 -1
  40. package/src/core/{styles → _compat/styles}/input/textInputStyle.ts +2 -2
  41. package/src/core/{styles → _compat/styles}/radius/types.ts +1 -1
  42. package/src/core/{styles → _compat/styles}/shadow/shadowStyle.ts +1 -1
  43. package/src/core/components/autocomplete/__workshop__/custom.tsx +5 -4
  44. package/src/core/components/autocomplete/__workshop__/example.tsx +3 -2
  45. package/src/core/components/autocomplete/autocomplete.tsx +5 -5
  46. package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
  47. package/src/core/components/dialog/__workshop__/props.tsx +2 -0
  48. package/src/core/components/dialog/dialog.tsx +1 -5
  49. package/src/core/components/hotkeys/hotkeys.tsx +1 -1
  50. package/src/core/components/menu/menu.tsx +8 -10
  51. package/src/core/components/menu/menuDivider.tsx +16 -0
  52. package/src/core/components/menu/menuGroup.tsx +2 -8
  53. package/src/core/components/menu/menuItem.tsx +1 -1
  54. package/src/core/components/skeleton/skeleton.tsx +14 -20
  55. package/src/core/components/skeleton/textSkeleton.tsx +72 -48
  56. package/src/core/components/tab/tab.tsx +0 -1
  57. package/src/core/components/tab/tabList.tsx +4 -21
  58. package/src/core/components/tab/tabPanel.tsx +1 -0
  59. package/src/core/components/toast/toast.tsx +27 -14
  60. package/src/core/components/toast/toastProvider.tsx +4 -13
  61. package/src/core/components/tree/tree.tsx +1 -2
  62. package/src/core/components/tree/treeGroup.tsx +4 -1
  63. package/src/core/components/tree/treeItem.tsx +11 -15
  64. package/src/core/hooks/useArrayProp.ts +1 -1
  65. package/src/core/index.ts +0 -1
  66. package/src/core/lib/styled/members.ts +2 -2
  67. package/src/core/primitives/avatar/avatar.tsx +0 -21
  68. package/src/core/primitives/avatar/avatarCounter.tsx +1 -1
  69. package/src/core/primitives/avatar/avatarStack.tsx +1 -1
  70. package/src/core/primitives/avatar/styles.ts +2 -2
  71. package/src/core/primitives/box/box.tsx +4 -1
  72. package/src/core/primitives/button/__workshop__/props.tsx +2 -1
  73. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
  74. package/src/core/primitives/button/__workshop__/stacked.tsx +2 -1
  75. package/src/core/primitives/button/__workshop__/styled1.tsx +1 -1
  76. package/src/core/primitives/button/__workshop__/styled2.tsx +1 -1
  77. package/src/core/primitives/button/styles.ts +3 -3
  78. package/src/core/primitives/card/__workshop__/props.tsx +2 -2
  79. package/src/core/primitives/card/__workshop__/selected.tsx +1 -1
  80. package/src/core/primitives/card/__workshop__/styled.tsx +1 -1
  81. package/src/core/primitives/card/card.tsx +7 -10
  82. package/src/core/primitives/code/code.tsx +2 -4
  83. package/src/core/primitives/container/styles.ts +1 -1
  84. package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
  85. package/src/core/primitives/flex/flex.tsx +1 -13
  86. package/src/core/primitives/grid/grid.tsx +5 -19
  87. package/src/core/primitives/heading/heading.tsx +8 -25
  88. package/src/core/primitives/heading/styles.ts +1 -1
  89. package/src/core/primitives/inline/inline.tsx +3 -12
  90. package/src/core/primitives/inline/styles.ts +1 -1
  91. package/src/core/primitives/label/label.tsx +4 -9
  92. package/src/core/primitives/label/styles.ts +1 -1
  93. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +2 -2
  94. package/src/core/primitives/popover/__workshop__/TestStory.tsx +2 -1
  95. package/src/core/primitives/popover/popover.tsx +1 -1
  96. package/src/core/primitives/popover/popoverCard.tsx +1 -1
  97. package/src/core/primitives/radio/radio.tsx +1 -1
  98. package/src/core/primitives/radio/styles.ts +2 -2
  99. package/src/core/primitives/select/select.tsx +1 -1
  100. package/src/core/primitives/select/styles.ts +3 -3
  101. package/src/core/primitives/spinner/__workshop__/Props.tsx +2 -1
  102. package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +16 -0
  103. package/src/core/primitives/spinner/spinner.tsx +2 -2
  104. package/src/core/primitives/stack/styles.ts +1 -1
  105. package/src/core/primitives/switch/styles.ts +2 -2
  106. package/src/core/primitives/text/__workshop__/colored.tsx +1 -1
  107. package/src/core/primitives/text/styles.ts +1 -1
  108. package/src/core/primitives/text/text.tsx +1 -4
  109. package/src/core/primitives/textArea/__workshop__/plain.tsx +2 -2
  110. package/src/core/primitives/textArea/textArea.tsx +3 -3
  111. package/src/core/primitives/textInput/__workshop__/plain.tsx +3 -2
  112. package/src/core/primitives/textInput/textInput.tsx +16 -83
  113. package/src/core/primitives/tooltip/tooltipCard.tsx +5 -5
  114. package/src/core/primitives/types.ts +1 -0
  115. package/src/core/theme/__workshop__/build/Root.tsx +1 -1
  116. package/src/core/theme/__workshop__/build/story.tsx +2 -4
  117. package/src/core/theme/themeProvider.tsx +1 -1
  118. package/src/core/types/box.ts +22 -16
  119. package/src/core/types/grid.ts +17 -12
  120. package/src/core/types/text.ts +7 -4
  121. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +1 -1
  122. package/src/core/utils/layer/layer.tsx +2 -2
  123. package/src/core/utils/virtualList/virtualList.tsx +1 -1
  124. package/src/css/compile/{comileRules.ts → compileRules.ts} +2 -5
  125. package/src/css/compile/compileSystem.ts +1 -1
  126. package/src/css/compile/compileTheme.ts +4 -1
  127. package/src/css/components/breadcrumbs/rules.ts +18 -0
  128. package/src/css/components/menu/index.ts +1 -0
  129. package/src/css/components/menu/menu.ts +5 -0
  130. package/src/css/components/menu/rules.ts +10 -0
  131. package/src/css/components/skeleton/index.ts +2 -0
  132. package/src/css/components/skeleton/rules.ts +106 -0
  133. package/src/css/components/skeleton/skeleton.ts +31 -0
  134. package/src/css/components/skeleton/types.ts +24 -0
  135. package/src/css/components/toast/rules.ts +68 -0
  136. package/src/css/components/tree/rules.ts +115 -0
  137. package/src/css/index.ts +4 -0
  138. package/src/css/primitives/box/box.ts +5 -1
  139. package/src/css/primitives/box/types.ts +7 -8
  140. package/src/css/primitives/card/rules.ts +161 -13
  141. package/src/css/primitives/checkbox/__styles.ts +115 -113
  142. package/src/css/primitives/selectable/__style.ts +117 -115
  143. package/src/css/primitives/spinner/rules.ts +5 -7
  144. package/src/css/primitives/spinner/spinner.ts +4 -0
  145. package/src/css/primitives/textInput/index.ts +1 -0
  146. package/src/css/primitives/textInput/rules.ts +159 -64
  147. package/src/css/primitives/textInput/textInput.ts +11 -3
  148. package/src/css/primitives/textInput/types.ts +8 -0
  149. package/src/css/rules.ts +16 -38
  150. package/src/css/styles/font/font.ts +7 -2
  151. package/src/css/styles/font/rules.ts +23 -0
  152. package/src/css/styles/font/types.ts +6 -0
  153. package/src/css/styles/gap/rules.ts +6 -6
  154. package/src/css/styles/grid/grid.ts +13 -0
  155. package/src/css/styles/grid/index.ts +2 -0
  156. package/src/css/styles/grid/rules.ts +112 -1
  157. package/src/css/styles/grid/types.ts +29 -0
  158. package/src/css/styles/margin/rules.ts +58 -54
  159. package/src/css/styles/outline/rules.ts +7 -0
  160. package/src/css/styles/overflow/index.ts +2 -0
  161. package/src/css/styles/overflow/overflow.ts +11 -0
  162. package/src/css/styles/overflow/types.ts +11 -0
  163. package/src/css/styles/padding/rules.ts +50 -48
  164. package/src/css/types.ts +36 -1
  165. package/src/css/varNames.ts +1 -1
  166. package/src/css/vars.ts +86 -0
  167. package/dist/_chunks-cjs/getTheme_v2.js +0 -316
  168. package/dist/_chunks-cjs/getTheme_v2.js.map +0 -1
  169. package/dist/_chunks-es/getTheme_v2.mjs +0 -317
  170. package/dist/_chunks-es/getTheme_v2.mjs.map +0 -1
  171. package/dist/_legacy/getTheme_v2.esm.js +0 -317
  172. package/dist/_legacy/getTheme_v2.esm.js.map +0 -1
  173. package/src/core/components/autocomplete/autocomplete.styles.tsx +0 -38
  174. package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +0 -17
  175. package/src/core/components/menu/menuDivider.ts +0 -13
  176. package/src/core/components/skeleton/styles.ts +0 -50
  177. package/src/core/components/toast/styles.ts +0 -61
  178. package/src/core/components/tree/style.ts +0 -104
  179. package/src/core/primitives/card/styles.ts +0 -146
  180. /package/src/core/{styles → _compat/styles}/border/borderStyle.ts +0 -0
  181. /package/src/core/{styles → _compat/styles}/border/index.ts +0 -0
  182. /package/src/core/{styles → _compat/styles}/border/types.ts +0 -0
  183. /package/src/core/{styles → _compat/styles}/box/index.ts +0 -0
  184. /package/src/core/{styles → _compat/styles}/card/index.ts +0 -0
  185. /package/src/core/{styles → _compat/styles}/flex/flexStyle.ts +0 -0
  186. /package/src/core/{styles → _compat/styles}/flex/index.ts +0 -0
  187. /package/src/core/{styles → _compat/styles}/flex/types.ts +0 -0
  188. /package/src/core/{styles → _compat/styles}/focusRing/index.ts +0 -0
  189. /package/src/core/{styles → _compat/styles}/font/codeFontStyle.ts +0 -0
  190. /package/src/core/{styles → _compat/styles}/font/headingFontStyle.ts +0 -0
  191. /package/src/core/{styles → _compat/styles}/font/index.ts +0 -0
  192. /package/src/core/{styles → _compat/styles}/font/labelFontStyle.ts +0 -0
  193. /package/src/core/{styles → _compat/styles}/font/responsiveFont.ts +0 -0
  194. /package/src/core/{styles → _compat/styles}/font/textAlignStyle.ts +0 -0
  195. /package/src/core/{styles → _compat/styles}/font/textFontStyle.ts +0 -0
  196. /package/src/core/{styles → _compat/styles}/grid/gridItemStyle.ts +0 -0
  197. /package/src/core/{styles → _compat/styles}/grid/gridStyle.ts +0 -0
  198. /package/src/core/{styles → _compat/styles}/grid/index.ts +0 -0
  199. /package/src/core/{styles → _compat/styles}/index.ts +0 -0
  200. /package/src/core/{styles → _compat/styles}/input/index.ts +0 -0
  201. /package/src/core/{styles → _compat/styles}/input/responsiveInputPaddingStyle.ts +0 -0
  202. /package/src/core/{styles → _compat/styles}/internal.ts +0 -0
  203. /package/src/core/{styles → _compat/styles}/margin/index.ts +0 -0
  204. /package/src/core/{styles → _compat/styles}/margin/marginStyle.ts +0 -0
  205. /package/src/core/{styles → _compat/styles}/margin/marginsStyle.test.ts +0 -0
  206. /package/src/core/{styles → _compat/styles}/margin/types.ts +0 -0
  207. /package/src/core/{styles → _compat/styles}/padding/index.ts +0 -0
  208. /package/src/core/{styles → _compat/styles}/padding/paddingStyle.test.ts +0 -0
  209. /package/src/core/{styles → _compat/styles}/padding/paddingStyle.ts +0 -0
  210. /package/src/core/{styles → _compat/styles}/padding/types.ts +0 -0
  211. /package/src/core/{styles → _compat/styles}/radius/index.ts +0 -0
  212. /package/src/core/{styles → _compat/styles}/radius/radiusStyle.ts +0 -0
  213. /package/src/core/{styles → _compat/styles}/shadow/index.ts +0 -0
  214. /package/src/core/{styles → _compat/styles}/shadow/types.ts +0 -0
  215. /package/src/core/{styles → _compat/styles}/types.ts +0 -0
  216. /package/src/core/{_compat.ts → _compat/types.ts} +0 -0
@@ -1,8 +1,8 @@
1
1
  import {CSSObject, getTheme_v2} from '@sanity/ui/theme'
2
+ import {ThemeProps} from '../../_compat'
3
+ import {_cardColorStyle} from '../../_compat/styles/card'
4
+ import {focusRingBorderStyle, focusRingStyle} from '../../_compat/styles/internal'
2
5
  import {css} from '../../lib/styled'
3
- import {ThemeProps} from '../../styles'
4
- import {_cardColorStyle} from '../../styles/card'
5
- import {focusRingBorderStyle, focusRingStyle} from '../../styles/internal'
6
6
  import {ButtonMode, ButtonTone, ButtonWidth} from '../../types'
7
7
 
8
8
  /**
@@ -1,4 +1,4 @@
1
- import {Card, Flex, Stack, Text} from '@sanity/ui'
1
+ import {Card, Flex, Radius, Stack, Text} from '@sanity/ui'
2
2
  import {useAction, useBoolean, useSelect} from '@sanity/ui-workshop'
3
3
  import {
4
4
  WORKSHOP_CARD_AS_OPTIONS,
@@ -28,7 +28,7 @@ export default function PropsStory() {
28
28
  muted={muted}
29
29
  onClick={useAction('onClick')}
30
30
  padding={padding}
31
- radius={radius}
31
+ radius={radius as Radius}
32
32
  selected={selected}
33
33
  shadow={shadow}
34
34
  tone={tone}
@@ -2,7 +2,7 @@ import {EditIcon, PublishIcon} from '@sanity/icons'
2
2
  import {Box, Card, Container, Flex, Inline, Stack, Text, ThemeProps, useRootTheme} from '@sanity/ui'
3
3
  import {ThemeColorStateToneKey, getTheme_v2} from '@sanity/ui/theme'
4
4
  import {useBoolean} from '@sanity/ui-workshop'
5
- import {styled, css} from '../../../lib/styled'
5
+ import {styled, css} from 'styled-components'
6
6
 
7
7
  const TextWithTone = styled(Text)<{$tone: ThemeColorStateToneKey}>((
8
8
  props: {
@@ -1,5 +1,5 @@
1
1
  import {Card, Flex, Text} from '@sanity/ui'
2
- import {styled} from '../../../lib/styled'
2
+ import {styled} from 'styled-components'
3
3
 
4
4
  const StyledCard = styled(Card).attrs({forwardedAs: 'ol'})``
5
5
 
@@ -38,8 +38,8 @@ export const Card = forwardRef(function Card(
38
38
  ref: React.ForwardedRef<HTMLDivElement>,
39
39
  ) {
40
40
  const {
41
- // __unstable_checkered: checkered = false,
42
- // __unstable_focusRing: focusRing = false,
41
+ __unstable_checkered: checkered = false,
42
+ __unstable_focusRing: focusRing = false,
43
43
  as: asProp,
44
44
  border,
45
45
  borderTop,
@@ -47,7 +47,7 @@ export const Card = forwardRef(function Card(
47
47
  borderBottom,
48
48
  borderLeft,
49
49
  className,
50
- // muted,
50
+ muted,
51
51
  pressed,
52
52
  radius = 0,
53
53
  scheme,
@@ -75,12 +75,9 @@ export const Card = forwardRef(function Card(
75
75
  data-tone={tone}
76
76
  {...restProps}
77
77
  as={as}
78
- // $checkered={checkered}
79
- // $focusRing={focusRing}
80
- // $muted={muted}
81
78
  className={composeClassNames(
82
79
  className,
83
- rootCard ? undefined : 'root',
80
+ // rootCard ? undefined : 'root',
84
81
  card({
85
82
  border,
86
83
  borderTop,
@@ -91,11 +88,11 @@ export const Card = forwardRef(function Card(
91
88
  shadow,
92
89
  }),
93
90
  )}
94
- // data-checkered={checkered ? '' : undefined}
91
+ data-checkered={checkered ? '' : undefined}
92
+ data-focus-ring={focusRing ? '' : undefined}
93
+ data-muted={muted ? '' : undefined}
95
94
  data-pressed={pressed ? '' : undefined}
96
- data-test={rootCard ? undefined : ''}
97
95
  data-selected={selected ? '' : undefined}
98
- // forwardedAs={as}
99
96
  ref={ref}
100
97
  selected={selected}
101
98
  style={style}
@@ -1,19 +1,17 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
 
3
- import {code, composeClassNames} from '@sanity/ui/css'
4
- import {FontWeight} from '@sanity/ui/theme'
3
+ import {code, composeClassNames, FontStyleProps} from '@sanity/ui/css'
5
4
  import {forwardRef} from 'react'
6
5
  import Refractor from 'react-refractor'
7
6
 
8
7
  /**
9
8
  * @public
10
9
  */
11
- export interface CodeProps {
10
+ export interface CodeProps extends Omit<FontStyleProps, 'align'> {
12
11
  as?: React.ElementType | keyof JSX.IntrinsicElements
13
12
  /** Define the language to use for syntax highlighting. */
14
13
  language?: string
15
14
  size?: number | number[]
16
- weight?: FontWeight
17
15
  }
18
16
 
19
17
  /**
@@ -1,5 +1,5 @@
1
1
  import {CSSObject, getTheme_v2} from '@sanity/ui/theme'
2
- import {rem, _responsive, ThemeProps} from '../../styles'
2
+ import {rem, _responsive, ThemeProps} from '../../_compat'
3
3
  import {ResponsiveWidthStyleProps} from './types'
4
4
 
5
5
  const BASE_STYLE: CSSObject = {
@@ -1,6 +1,6 @@
1
1
  import {Card, Code, Flex} from '@sanity/ui'
2
2
  import {useSelect} from '@sanity/ui-workshop'
3
- import {styled} from '../../../lib/styled'
3
+ import {styled} from 'styled-components'
4
4
  import {WORKSHOP_FLEX_DIRECTION_OPTIONS} from '../../../__workshop__/constants'
5
5
 
6
6
  const DebugCard = styled(Card)`
@@ -1,11 +1,4 @@
1
1
  import {forwardRef} from 'react'
2
- import {styled} from '../../lib/styled'
3
- import {
4
- flexItemStyle,
5
- FlexItemStyleProps,
6
- responsiveFlexStyle,
7
- ResponsiveFlexStyleProps,
8
- } from '../../styles/internal'
9
2
  import {Box, BoxProps} from '../box'
10
3
 
11
4
  /**
@@ -13,11 +6,6 @@ import {Box, BoxProps} from '../box'
13
6
  */
14
7
  export interface FlexProps extends Omit<BoxProps, 'display'> {}
15
8
 
16
- const Root = styled(Box)<FlexItemStyleProps & ResponsiveFlexStyleProps>(
17
- flexItemStyle,
18
- responsiveFlexStyle,
19
- )
20
-
21
9
  /**
22
10
  * The `Flex` component is a wrapper component for flexible elements (`Box`, `Card` and `Flex`).
23
11
  *
@@ -30,7 +18,7 @@ export const Flex = forwardRef(function Flex(
30
18
  const {as, direction = 'row', ...restProps} = props
31
19
 
32
20
  return (
33
- <Root
21
+ <Box
34
22
  data-ui="Flex"
35
23
  {...restProps}
36
24
  direction={direction}
@@ -1,16 +1,10 @@
1
1
  import {forwardRef} from 'react'
2
- import {useArrayProp} from '../../hooks'
3
- import {styled} from '../../lib/styled'
4
- import {responsiveGridStyle, ResponsiveGridStyleProps} from '../../styles/internal'
5
2
  import {Box, BoxProps} from '../box'
6
- import {ResponsiveGridProps} from '../types'
7
3
 
8
4
  /**
9
5
  * @public
10
6
  */
11
- export interface GridProps extends Omit<BoxProps, 'display'>, ResponsiveGridProps {}
12
-
13
- const Root = styled(Box)<ResponsiveGridStyleProps>(responsiveGridStyle)
7
+ export interface GridProps extends Omit<BoxProps, 'display'> {}
14
8
 
15
9
  /**
16
10
  * The `Grid` component is for building 2-dimensional layers (based on CSS grid).
@@ -21,28 +15,20 @@ export const Grid = forwardRef(function Grid(
21
15
  props: GridProps & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'rows'>,
22
16
  ref: React.ForwardedRef<HTMLDivElement>,
23
17
  ) {
24
- const {as, autoRows, autoCols, autoFlow, columns, gap, gapX, gapY, rows, children, ...restProps} =
25
- props
18
+ const {as, children, ...restProps} = props
26
19
 
27
20
  return (
28
- <Root
21
+ <Box
29
22
  data-as={typeof as === 'string' ? as : undefined}
30
23
  data-ui="Grid"
31
24
  {...restProps}
32
- $autoRows={useArrayProp(autoRows)}
33
- $autoCols={useArrayProp(autoCols)}
34
- $autoFlow={useArrayProp(autoFlow)}
35
- $columns={useArrayProp(columns)}
36
- $gap={useArrayProp(gap)}
37
- $gapX={useArrayProp(gapX)}
38
- $gapY={useArrayProp(gapY)}
39
- $rows={useArrayProp(rows)}
40
25
  display="grid"
41
26
  forwardedAs={as}
42
27
  ref={ref}
43
28
  >
44
29
  {children}
45
- </Root>
30
+ </Box>
46
31
  )
47
32
  })
33
+
48
34
  Grid.displayName = 'ForwardRef(Grid)'
@@ -1,40 +1,25 @@
1
- import {composeClassNames, heading} from '@sanity/ui/css'
2
- import {ThemeFontWeightKey} from '@sanity/ui/theme'
1
+ import {composeClassNames, FontStyleProps, heading, ResponsiveProp} from '@sanity/ui/css'
2
+ import {FontHeadingSize} from '@sanity/ui/theme'
3
3
  import {forwardRef} from 'react'
4
- import {useArrayProp} from '../../hooks'
5
4
  import {styled} from '../../lib/styled'
6
- // import {
7
- // ResponsiveFontStyleProps,
8
- // responsiveHeadingFont,
9
- // responsiveTextAlignStyle,
10
- // ResponsiveTextAlignStyleProps,
11
- // } from '../../styles/internal'
12
- import {TextAlign} from '../../types'
13
- // import {headingBaseStyle} from './styles'
14
- // import {HeadingStyleProps} from './types'
15
5
 
16
6
  /**
17
7
  * @public
18
8
  */
19
- export interface HeadingProps {
9
+ export interface HeadingProps extends FontStyleProps {
20
10
  accent?: boolean
21
- align?: TextAlign | TextAlign[]
22
11
  as?: React.ElementType | keyof JSX.IntrinsicElements
23
12
  muted?: boolean
24
- size?: number | number[]
13
+ size?: ResponsiveProp<FontHeadingSize>
25
14
  /**
26
15
  * Controls how overflowing text is treated.
27
16
  * Use `textOverflow="ellipsis"` to render text as a single line which is concatenated with a `…` symbol.
28
17
  * @beta
29
18
  */
30
19
  textOverflow?: 'ellipsis'
31
- weight?: ThemeFontWeightKey
32
20
  }
33
21
 
34
- // const Root = styled.div<
35
- // HeadingStyleProps & ResponsiveTextAlignStyleProps & ResponsiveFontStyleProps
36
- // >(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont)
37
-
22
+ // todo
38
23
  const SpanWithTextOverflow = styled.span`
39
24
  display: block;
40
25
  white-space: nowrap;
@@ -75,15 +60,13 @@ export const Heading = forwardRef(function Heading(
75
60
  <As
76
61
  data-ui="Heading"
77
62
  {...restProps}
78
- // $accent={accent}
79
- $align={useArrayProp(align)}
80
- // $muted={muted}
81
- // $size={useArrayProp(size)}
82
- // $weight={weight}
63
+ // todo
64
+ // $align={useArrayProp(align)}
83
65
  className={composeClassNames(
84
66
  className,
85
67
  heading({
86
68
  accent,
69
+ align,
87
70
  muted,
88
71
  size,
89
72
  weight,
@@ -1,6 +1,6 @@
1
1
  import {getTheme_v2} from '@sanity/ui/theme'
2
+ import {ThemeProps} from '../../_compat'
2
3
  import {css} from '../../lib/styled'
3
- import {ThemeProps} from '../../styles'
4
4
  import {HeadingStyleProps} from './types'
5
5
 
6
6
  export function headingBaseStyle(props: HeadingStyleProps & ThemeProps): ReturnType<typeof css> {
@@ -1,11 +1,7 @@
1
1
  import {ResponsiveProp} from '@sanity/ui/css'
2
2
  import {Space} from '@sanity/ui/theme'
3
- import {forwardRef, useMemo, Children} from 'react'
4
- // import {useArrayProp} from '../../hooks'
5
- // import {styled} from '../../lib/styled'
3
+ import {forwardRef, useMemo, Children, ForwardedRef} from 'react'
6
4
  import {Box, BoxProps} from '../box'
7
- // import {inlineBaseStyle, inlineSpaceStyle} from './styles'
8
- // import {ResponsiveInlineSpaceStyleProps} from './types'
9
5
 
10
6
  /**
11
7
  * @public
@@ -16,8 +12,6 @@ export interface InlineProps
16
12
  space?: ResponsiveProp<Space>
17
13
  }
18
14
 
19
- // const Root = styled(Box)<ResponsiveInlineSpaceStyleProps>(inlineBaseStyle, inlineSpaceStyle)
20
-
21
15
  /**
22
16
  * The `Inline` component is a layout utility for aligning and spacing items horizontally.
23
17
  *
@@ -25,7 +19,7 @@ export interface InlineProps
25
19
  */
26
20
  export const Inline = forwardRef(function Inline(
27
21
  props: InlineProps & Omit<React.HTMLProps<HTMLDivElement>, 'wrap'>,
28
- ref,
22
+ ref: ForwardedRef<HTMLDivElement>,
29
23
  ) {
30
24
  const {as, children: childrenProp, space, ...restProps} = props
31
25
 
@@ -38,14 +32,11 @@ export const Inline = forwardRef(function Inline(
38
32
  <Box
39
33
  data-ui="Inline"
40
34
  {...restProps}
41
- // $space={useArrayProp(space)}
42
35
  align="center"
43
36
  as={as}
44
37
  display="flex"
45
- // forwardedAs={as}
46
38
  gap={space}
47
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
- ref={ref as any}
39
+ ref={ref}
49
40
  wrap="wrap"
50
41
  >
51
42
  {children}
@@ -1,5 +1,5 @@
1
1
  import {CSSObject, getTheme_v2} from '@sanity/ui/theme'
2
- import {rem, _responsive, ThemeProps} from '../../styles'
2
+ import {rem, _responsive, ThemeProps} from '../../_compat'
3
3
  import {ResponsiveInlineSpaceStyleProps} from './types'
4
4
 
5
5
  export function inlineBaseStyle(): CSSObject {
@@ -1,18 +1,16 @@
1
- import {composeClassNames, label} from '@sanity/ui/css'
1
+ import {composeClassNames, FontStyleProps, label} from '@sanity/ui/css'
2
2
  import {ThemeFontWeightKey} from '@sanity/ui/theme'
3
3
  import {forwardRef} from 'react'
4
- import {useArrayProp} from '../../hooks'
4
+ import {responsiveLabelFont, responsiveTextAlignStyle} from '../../_compat/styles/internal'
5
5
  import {styled} from '../../lib/styled'
6
- import {responsiveLabelFont, responsiveTextAlignStyle} from '../../styles/internal'
7
6
  import {TextAlign} from '../../types'
8
7
  import {labelBaseStyle} from './styles'
9
8
 
10
9
  /**
11
10
  * @public
12
11
  */
13
- export interface LabelProps {
12
+ export interface LabelProps extends FontStyleProps {
14
13
  accent?: boolean
15
- align?: TextAlign | TextAlign[]
16
14
  as?: React.ElementType | keyof JSX.IntrinsicElements
17
15
  muted?: boolean
18
16
  size?: number | number[]
@@ -73,15 +71,12 @@ export const Label = forwardRef(function Label(
73
71
  <Root
74
72
  data-ui="Label"
75
73
  {...restProps}
76
- // $accent={accent}
77
- $align={useArrayProp(align)}
78
- // $muted={muted}
79
- // $size={useArrayProp(size)}
80
74
  $weight={weight}
81
75
  className={composeClassNames(
82
76
  className,
83
77
  label({
84
78
  accent,
79
+ align,
85
80
  muted,
86
81
  size,
87
82
  }),
@@ -1,6 +1,6 @@
1
1
  import {getTheme_v2} from '@sanity/ui/theme'
2
+ import {ThemeProps} from '../../_compat'
2
3
  import {css} from '../../lib/styled'
3
- import {ThemeProps} from '../../styles'
4
4
 
5
5
  export function labelBaseStyle(
6
6
  props: {$accent?: boolean; $muted: boolean} & ThemeProps,
@@ -1,4 +1,4 @@
1
- import {Button, Card, Popover, PortalProvider, Text} from '@sanity/ui'
1
+ import {Button, Card, Popover, PortalProvider, Radius, Text} from '@sanity/ui'
2
2
  import {useBoolean, useSelect} from '@sanity/ui-workshop'
3
3
  import {useState} from 'react'
4
4
  import {
@@ -56,7 +56,7 @@ export default function PlainStory() {
56
56
  placement={placement}
57
57
  portal={portal}
58
58
  preventOverflow={preventOverflow}
59
- radius={radius}
59
+ radius={radius as Radius}
60
60
  width={width}
61
61
  >
62
62
  <Button text="This button is the popover reference" />
@@ -1,3 +1,4 @@
1
+ import {Radius} from '@sanity/ui/theme'
1
2
  import {useBoolean, useSelect, useText} from '@sanity/ui-workshop'
2
3
  import {ReactElement, useRef, useState} from 'react'
3
4
  import {
@@ -80,7 +81,7 @@ export default function TestStory(): ReactElement {
80
81
  placement={placement}
81
82
  portal={portal}
82
83
  preventOverflow={preventOverflow}
83
- radius={radius}
84
+ radius={radius as Radius}
84
85
  updateRef={updateRef}
85
86
  width={width}
86
87
  >
@@ -120,7 +120,7 @@ export const Popover = memo(
120
120
  props: PopoverProps &
121
121
  Omit<
122
122
  React.HTMLProps<HTMLDivElement>,
123
- 'as' | 'children' | 'content' | 'height' | 'width' | 'wrap'
123
+ 'as' | 'children' | 'content' | 'height' | 'rows' | 'width' | 'wrap'
124
124
  >,
125
125
  forwardedRef: React.ForwardedRef<HTMLDivElement>,
126
126
  ): React.ReactElement {
@@ -49,7 +49,7 @@ const MotionCard = motion(Card)
49
49
  export const PopoverCard = memo(
50
50
  forwardRef(function PopoverCard(
51
51
  props: PopoverCardProps &
52
- Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'width' | 'wrap'>,
52
+ Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'rows' | 'width' | 'wrap'>,
53
53
  ref: React.ForwardedRef<HTMLDivElement>,
54
54
  ) {
55
55
  const {
@@ -1,6 +1,6 @@
1
1
  import {forwardRef, useImperativeHandle, useRef} from 'react'
2
- import {styled} from '../../lib/styled'
3
2
  import {useCustomValidity} from '../../hooks'
3
+ import {styled} from '../../lib/styled'
4
4
  import {radioBaseStyle, inputElementStyle} from './styles'
5
5
 
6
6
  /**
@@ -1,7 +1,7 @@
1
1
  import {getTheme_v2} from '@sanity/ui/theme'
2
+ import {rem, ThemeProps} from '../../_compat'
3
+ import {focusRingBorderStyle, focusRingStyle} from '../../_compat/styles/internal'
2
4
  import {css} from '../../lib/styled'
3
- import {rem, ThemeProps} from '../../styles'
4
- import {focusRingBorderStyle, focusRingStyle} from '../../styles/internal'
5
5
 
6
6
  export function radioBaseStyle(): ReturnType<typeof css> {
7
7
  return css`
@@ -1,7 +1,7 @@
1
1
  import {ChevronDownIcon} from '@sanity/icons'
2
2
  import {forwardRef, useImperativeHandle, useRef} from 'react'
3
- import {styled} from '../../lib/styled'
4
3
  import {useCustomValidity, useArrayProp} from '../../hooks'
4
+ import {styled} from '../../lib/styled'
5
5
  import {Radius} from '../../types'
6
6
  import {Box} from '../box'
7
7
  import {Text} from '../text'
@@ -1,14 +1,14 @@
1
1
  import {ThemeFontSize, getTheme_v2} from '@sanity/ui/theme'
2
2
  import {CSSObject} from '@sanity/ui/theme'
3
- import {css} from '../../lib/styled'
4
- import {rem, _responsive, ThemeProps} from '../../styles'
3
+ import {rem, _responsive, ThemeProps} from '../../_compat'
5
4
  import {
6
5
  focusRingBorderStyle,
7
6
  focusRingStyle,
8
7
  responsiveInputPaddingIconRightStyle,
9
8
  responsiveRadiusStyle,
10
9
  ResponsiveRadiusStyleProps,
11
- } from '../../styles/internal'
10
+ } from '../../_compat/styles/internal'
11
+ import {css} from '../../lib/styled'
12
12
 
13
13
  function rootStyle(): ReturnType<typeof css> {
14
14
  return css`
@@ -1,4 +1,5 @@
1
1
  import {Flex, Spinner} from '@sanity/ui'
2
+ import {FontTextSize} from '@sanity/ui/theme'
2
3
  import {useBoolean, useSelect} from '@sanity/ui-workshop'
3
4
  import {WORKSHOP_TEXT_SIZE_OPTIONS} from '../../../__workshop__/constants'
4
5
 
@@ -8,7 +9,7 @@ export default function Props() {
8
9
 
9
10
  return (
10
11
  <Flex align="center" height="fill" justify="center">
11
- <Spinner muted={muted} size={size} />
12
+ <Spinner muted={muted} size={size as FontTextSize} />
12
13
  </Flex>
13
14
  )
14
15
  }
@@ -0,0 +1,16 @@
1
+ import {SpinnerIcon} from '@sanity/icons'
2
+ import {animatedSpinnerIcon, composeClassNames} from '@sanity/ui/css'
3
+ import {ReactElement, SVGProps} from 'react'
4
+
5
+ /** @internal */
6
+ export function AnimatedSpinnerIcon(props: SVGProps<SVGSVGElement>): ReactElement {
7
+ const {className, ...restProps} = props
8
+
9
+ return (
10
+ <SpinnerIcon
11
+ {...restProps}
12
+ data-sanity-icon="animated-spinner"
13
+ className={composeClassNames(className, animatedSpinnerIcon())}
14
+ />
15
+ )
16
+ }
@@ -1,8 +1,8 @@
1
- import {SpinnerIcon} from '@sanity/icons'
2
1
  import {ResponsiveProp, spinner} from '@sanity/ui/css'
3
2
  import {FontTextSize} from '@sanity/ui/theme'
4
3
  import {forwardRef} from 'react'
5
4
  import {Text} from '../text'
5
+ import {AnimatedSpinnerIcon} from './animatedSpinnerIcon'
6
6
 
7
7
  /**
8
8
  * @public
@@ -23,7 +23,7 @@ export const Spinner = forwardRef(function Spinner(
23
23
  ) {
24
24
  return (
25
25
  <Text data-ui="Spinner" {...props} className={spinner()} ref={ref}>
26
- <SpinnerIcon />
26
+ <AnimatedSpinnerIcon />
27
27
  </Text>
28
28
  )
29
29
  })
@@ -1,5 +1,5 @@
1
1
  import {CSSObject, getTheme_v2} from '@sanity/ui/theme'
2
- import {rem, _responsive, ThemeProps} from '../../styles'
2
+ import {rem, _responsive, ThemeProps} from '../../_compat'
3
3
 
4
4
  export interface ResponsiveStackSpaceStyleProps {
5
5
  $space: number[]
@@ -1,7 +1,7 @@
1
1
  import {getTheme_v2} from '@sanity/ui/theme'
2
+ import {rem, ThemeProps} from '../../_compat'
3
+ import {focusRingStyle} from '../../_compat/styles/internal'
2
4
  import {css} from '../../lib/styled'
3
- import {rem, ThemeProps} from '../../styles'
4
- import {focusRingStyle} from '../../styles/internal'
5
5
 
6
6
  /* Root */
7
7
  // export function switchBaseStyles(): ReturnType<typeof css> {
@@ -1,7 +1,7 @@
1
1
  import {Flex, Text, ThemeProps} from '@sanity/ui'
2
2
  import {ThemeColorAvatarColorKey, ThemeColorSpotKey, getTheme_v2} from '@sanity/ui/theme'
3
3
  import {useSelect} from '@sanity/ui-workshop'
4
- import {styled, css} from '../../../lib/styled'
4
+ import {styled, css} from 'styled-components'
5
5
  import {WORKSHOP_SPOT_COLOR_OPTIONS} from '../../../__workshop__/constants'
6
6
 
7
7
  const ColoredText = styled(Text)<{$color?: ThemeColorSpotKey}>((
@@ -1,6 +1,6 @@
1
1
  import {getTheme_v2} from '@sanity/ui/theme'
2
+ import {ThemeProps} from '../../_compat'
2
3
  import {css} from '../../lib/styled'
3
- import {ThemeProps} from '../../styles'
4
4
 
5
5
  export function textBaseStyle(
6
6
  props: {$accent?: boolean; $muted?: boolean} & ThemeProps,
@@ -1,16 +1,13 @@
1
1
  import {composeClassNames, text, TextStyleProps} from '@sanity/ui/css'
2
2
  import {ThemeFontWeightKey} from '@sanity/ui/theme'
3
3
  import {forwardRef} from 'react'
4
- import {useArrayProp} from '../../hooks'
5
4
  import {styled} from '../../lib/styled'
6
- import {TextAlign} from '../../types'
7
5
 
8
6
  /**
9
7
  * @public
10
8
  */
11
9
  export interface TextProps extends TextStyleProps {
12
10
  accent?: boolean
13
- align?: TextAlign | TextAlign[]
14
11
  as?: React.ElementType | keyof JSX.IntrinsicElements
15
12
  /** When `true` the text color will be muted. */
16
13
  muted?: boolean
@@ -65,12 +62,12 @@ export const Text = forwardRef(function Text(
65
62
  <As
66
63
  data-ui="Text"
67
64
  {...restProps}
68
- $align={useArrayProp(align)}
69
65
  ref={ref}
70
66
  className={composeClassNames(
71
67
  className,
72
68
  text({
73
69
  accent,
70
+ align,
74
71
  muted,
75
72
  size,
76
73
  weight,
@@ -1,4 +1,4 @@
1
- import {Card, Container, Flex, Stack, Text, TextArea} from '@sanity/ui'
1
+ import {Card, Container, Flex, Radius, Stack, Text, TextArea} from '@sanity/ui'
2
2
  import {useBoolean, useSelect, useText} from '@sanity/ui-workshop'
3
3
  import {
4
4
  WORKSHOP_CARD_TONE_OPTIONS,
@@ -37,7 +37,7 @@ export default function PlainStory() {
37
37
  id="text-area-example"
38
38
  padding={padding}
39
39
  placeholder={placeholder}
40
- radius={radius}
40
+ radius={radius as Radius}
41
41
  readOnly={readOnly}
42
42
  weight={weight}
43
43
  />
@@ -1,7 +1,5 @@
1
1
  import {ThemeFontWeightKey} from '@sanity/ui/theme'
2
2
  import {forwardRef, useImperativeHandle, useRef} from 'react'
3
- import {styled} from '../../lib/styled'
4
- import {useCustomValidity, useArrayProp} from '../../hooks'
5
3
  import {
6
4
  responsiveInputPaddingStyle,
7
5
  responsiveRadiusStyle,
@@ -13,7 +11,9 @@ import {
13
11
  textInputBaseStyle,
14
12
  textInputFontSizeStyle,
15
13
  textInputRepresentationStyle,
16
- } from '../../styles/internal'
14
+ } from '../../_compat/styles/internal'
15
+ import {useCustomValidity, useArrayProp} from '../../hooks'
16
+ import {styled} from '../../lib/styled'
17
17
  import {useRootTheme} from '../../theme'
18
18
  import {ResponsiveRadiusProps} from '../types'
19
19