@sanity/ui 3.0.0-static.10 → 3.0.0-static.12

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 (275) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +1300 -1269
  2. package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
  3. package/dist/_chunks-cjs/buildCommand.js +28 -10
  4. package/dist/_chunks-cjs/buildCommand.js.map +1 -1
  5. package/dist/_chunks-es/_visual-editing.mjs +1298 -1263
  6. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  7. package/dist/_visual-editing.d.mts +516 -360
  8. package/dist/_visual-editing.d.ts +516 -360
  9. package/dist/cli.js +1 -1
  10. package/dist/css.d.mts +258 -75
  11. package/dist/css.d.ts +258 -75
  12. package/dist/css.js +746 -752
  13. package/dist/css.js.map +1 -1
  14. package/dist/css.mjs +748 -754
  15. package/dist/css.mjs.map +1 -1
  16. package/dist/index.d.mts +1342 -871
  17. package/dist/index.d.ts +1342 -871
  18. package/dist/index.js +433 -325
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.mjs +429 -321
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/sanity-palette.css +105 -1
  23. package/dist/sanity-palette.min.css +1 -0
  24. package/dist/sanity-theme.css +4571 -1
  25. package/dist/sanity-theme.min.css +1 -0
  26. package/dist/system.css +22053 -21710
  27. package/dist/system.min.css +1 -0
  28. package/dist/theme.d.mts +51 -106
  29. package/dist/theme.d.ts +51 -106
  30. package/dist/theme.js +19 -20
  31. package/dist/theme.js.map +1 -1
  32. package/dist/theme.mjs +19 -20
  33. package/dist/theme.mjs.map +1 -1
  34. package/package.json +10 -5
  35. package/src/cli/buildCommand.ts +46 -19
  36. package/src/css/_comp.ts +2 -2
  37. package/src/css/{compile/compileStyle.ts → _compileStyle.ts} +7 -7
  38. package/src/css/_resp.ts +0 -1
  39. package/src/css/{system.style.ts → _system.style.ts} +3 -2
  40. package/src/css/aspects/display/display.ts +1 -0
  41. package/src/css/aspects/display/types.ts +2 -3
  42. package/src/css/aspects/flex/types.ts +4 -12
  43. package/src/css/aspects/flexItem/types.ts +1 -3
  44. package/src/css/aspects/font/font.style.ts +7 -66
  45. package/src/css/aspects/font/types.ts +1 -3
  46. package/src/css/aspects/grid/grid.ts +1 -0
  47. package/src/css/aspects/grid/types.ts +5 -9
  48. package/src/css/aspects/gridItem/gridItem.ts +1 -1
  49. package/src/css/aspects/gridItem/types.ts +7 -18
  50. package/src/css/aspects/height/height.ts +3 -4
  51. package/src/css/aspects/inset/inset.ts +1 -0
  52. package/src/css/aspects/margin/margin.ts +1 -0
  53. package/src/css/aspects/margin/types.ts +1 -0
  54. package/src/css/aspects/maxWidth/maxWidth.ts +1 -0
  55. package/src/css/aspects/maxWidth/types.ts +1 -0
  56. package/src/css/aspects/minWidth/minWidth.ts +1 -0
  57. package/src/css/aspects/minWidth/types.ts +2 -0
  58. package/src/css/aspects/overflow/overflow.ts +1 -0
  59. package/src/css/aspects/padding/padding.ts +1 -0
  60. package/src/css/aspects/pointerEvents/pointerEvents.ts +1 -0
  61. package/src/css/aspects/position/position.ts +1 -0
  62. package/src/css/aspects/shadow/shadow.style.ts +16 -41
  63. package/src/css/aspects/shadow/shadow.ts +1 -0
  64. package/src/css/aspects/textOverflow/textOverflow.ts +1 -0
  65. package/src/css/aspects/textOverflow/types.ts +1 -0
  66. package/src/css/aspects/width/types.ts +2 -0
  67. package/src/css/aspects/width/width.ts +1 -0
  68. package/src/css/compilePalette.ts +32 -0
  69. package/src/css/compileSystem.ts +7 -0
  70. package/src/css/{compile/compileTheme.ts → compileTheme.ts} +1 -0
  71. package/src/css/compileTheme_v3.ts +434 -0
  72. package/src/css/components/breadcrumbs/breadcrumbs.ts +1 -0
  73. package/src/css/components/dialog/dialog.ts +7 -0
  74. package/src/css/components/menu/menu.ts +2 -0
  75. package/src/css/components/skeleton/skeleton.style.ts +8 -4
  76. package/src/css/components/skeleton/skeleton.ts +4 -0
  77. package/src/css/components/skeleton/types.ts +4 -0
  78. package/src/css/components/toast/toast.ts +5 -0
  79. package/src/css/components/tree/tree.ts +1 -0
  80. package/src/css/composeClassNames.ts +4 -2
  81. package/src/css/constants.ts +11 -0
  82. package/src/css/index.ts +4 -3
  83. package/src/css/primitives/_arrow/_arrow.style.ts +6 -8
  84. package/src/css/primitives/_arrow/_arrow.ts +7 -0
  85. package/src/css/primitives/_input/input.ts +2 -0
  86. package/src/css/primitives/_selectable/_selectable.style.ts +24 -25
  87. package/src/css/primitives/_selectable/selectable.ts +1 -2
  88. package/src/css/primitives/avatar/avatar.style.ts +5 -8
  89. package/src/css/primitives/avatar/avatar.ts +6 -0
  90. package/src/css/primitives/avatar/types.ts +1 -0
  91. package/src/css/primitives/box/types.ts +1 -3
  92. package/src/css/primitives/button/button.style.ts +48 -15
  93. package/src/css/primitives/button/button.ts +4 -21
  94. package/src/css/primitives/button/index.ts +1 -0
  95. package/src/css/primitives/button/types.ts +18 -0
  96. package/src/css/primitives/card/card.style.ts +4 -7
  97. package/src/css/primitives/card/card.ts +2 -2
  98. package/src/css/primitives/card/types.ts +2 -2
  99. package/src/css/primitives/checkbox/checkbox.ts +2 -0
  100. package/src/css/primitives/container/container.ts +1 -0
  101. package/src/css/primitives/container/types.ts +1 -0
  102. package/src/css/primitives/kbd/kbd.ts +1 -0
  103. package/src/css/primitives/label/types.ts +7 -2
  104. package/src/css/primitives/popover/popover.ts +2 -0
  105. package/src/css/primitives/radio/radio.ts +1 -0
  106. package/src/css/primitives/select/select.ts +2 -0
  107. package/src/css/primitives/spinner/spinner.ts +2 -0
  108. package/src/css/primitives/switch/switch.ts +5 -0
  109. package/src/css/primitives/text/types.ts +4 -0
  110. package/src/css/primitives/textArea/textArea.ts +1 -0
  111. package/src/css/primitives/textInput/textInput.ts +1 -0
  112. package/src/css/primitives/token/token.style.ts +37 -36
  113. package/src/css/primitives/tooltip/tooltip.ts +2 -0
  114. package/src/css/responsiveRules.ts +12 -19
  115. package/src/css/scopeClassName.ts +1 -0
  116. package/src/css/types.ts +115 -15
  117. package/src/css/util.ts +5 -0
  118. package/src/css/utils/srOnly/srOnly.ts +1 -0
  119. package/src/css/varNames.ts +230 -143
  120. package/src/css/vars.ts +53 -22
  121. package/src/theme/palette/constants.ts +2 -0
  122. package/src/theme/palette/types.ts +3 -0
  123. package/src/theme/types.ts +2 -6
  124. package/src/theme/v0/focusRing.ts +1 -3
  125. package/src/theme/v0/font.ts +6 -18
  126. package/src/theme/v0/layer.ts +1 -3
  127. package/src/theme/v0/shadow.ts +2 -6
  128. package/src/theme/v2/avatar.ts +1 -3
  129. package/src/theme/v2/color/_system.ts +1 -3
  130. package/src/theme/v2/color/avatar.ts +2 -6
  131. package/src/theme/v2/color/badge.ts +2 -6
  132. package/src/theme/v2/color/button.ts +3 -9
  133. package/src/theme/v2/color/color.ts +3 -9
  134. package/src/theme/v2/color/input.ts +3 -9
  135. package/src/theme/v2/color/kbd.ts +1 -3
  136. package/src/theme/v2/color/selectable.ts +2 -6
  137. package/src/theme/v2/color/state.ts +1 -3
  138. package/src/theme/v2/color/syntax.ts +1 -3
  139. package/src/theme/v2/input.ts +1 -3
  140. package/src/theme/v2/theme.ts +2 -6
  141. package/src/theme/v3/buildTheme_v3.ts +2 -1
  142. package/src/theme/v3/color/color.ts +6 -4
  143. package/src/theme/v3/color/renderColor.ts +4 -1
  144. package/src/theme/v3/{defaults.ts → defaultTokens.ts} +2 -2
  145. package/src/theme/v3/index.ts +1 -1
  146. package/src/theme/v3/resolveTokens.ts +18 -18
  147. package/src/ui/RootClassNames.tsx +44 -0
  148. package/src/ui/StyleTags.tsx +3 -1
  149. package/src/ui/_compat/helpers.ts +72 -0
  150. package/src/ui/_compat/index.ts +2 -6
  151. package/src/ui/_compat/studioTheme.ts +7 -0
  152. package/src/ui/_compat/theme/themeColorProvider.tsx +2 -6
  153. package/src/ui/_compat/theme/themeProvider.tsx +2 -6
  154. package/src/ui/_compat/theme/types.ts +1 -3
  155. package/src/ui/_compat/theme/useRootTheme.ts +1 -3
  156. package/src/ui/_compat/theme/useTheme.ts +2 -6
  157. package/src/ui/_compat/types.ts +0 -83
  158. package/src/ui/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
  159. package/src/ui/components/autocomplete/autocomplete.tsx +86 -114
  160. package/src/ui/components/autocomplete/autocompleteOption.tsx +2 -0
  161. package/src/ui/components/autocomplete/types.ts +3 -8
  162. package/src/ui/components/breadcrumbs/breadcrumbs.tsx +27 -21
  163. package/src/ui/components/dialog/dialog.tsx +89 -291
  164. package/src/ui/components/dialog/dialogCard.tsx +183 -0
  165. package/src/ui/components/dialog/isTargetWithinScope.ts +14 -0
  166. package/src/ui/components/hotkeys/hotkeys.tsx +33 -15
  167. package/src/ui/components/menu/__workshop__/asComponent.tsx +6 -6
  168. package/src/ui/components/menu/menu.tsx +27 -33
  169. package/src/ui/components/menu/menuButton.tsx +10 -14
  170. package/src/ui/components/menu/menuDivider.tsx +25 -13
  171. package/src/ui/components/menu/menuGroup.tsx +34 -26
  172. package/src/ui/components/menu/menuItem.tsx +51 -40
  173. package/src/ui/components/skeleton/codeSkeleton.tsx +53 -0
  174. package/src/ui/components/skeleton/headingSkeleton.tsx +52 -0
  175. package/src/ui/components/skeleton/index.ts +3 -0
  176. package/src/ui/components/skeleton/labelSkeleton.tsx +51 -0
  177. package/src/ui/components/skeleton/skeleton.tsx +39 -16
  178. package/src/ui/components/skeleton/textSkeleton.tsx +31 -110
  179. package/src/ui/components/tab/tab.tsx +23 -19
  180. package/src/ui/components/tab/tabList.tsx +34 -33
  181. package/src/ui/components/tab/tabPanel.tsx +25 -19
  182. package/src/ui/components/toast/toast.tsx +21 -16
  183. package/src/ui/components/toast/toastLayer.tsx +28 -10
  184. package/src/ui/components/toast/toastProvider.tsx +2 -6
  185. package/src/ui/components/toast/types.ts +2 -6
  186. package/src/ui/components/toast/useToast.ts +1 -3
  187. package/src/ui/components/tree/tree.tsx +194 -187
  188. package/src/ui/components/tree/treeGroup.tsx +25 -5
  189. package/src/ui/components/tree/treeItem.tsx +35 -23
  190. package/src/ui/hooks/useClickOutside.ts +2 -6
  191. package/src/ui/hooks/useClickOutsideEvent.ts +3 -9
  192. package/src/ui/index.ts +1 -0
  193. package/src/ui/primitives/_selectable/selectable.tsx +33 -20
  194. package/src/ui/primitives/avatar/avatar.tsx +28 -31
  195. package/src/ui/primitives/avatar/avatarCounter.tsx +33 -25
  196. package/src/ui/primitives/avatar/avatarStack.tsx +31 -24
  197. package/src/ui/primitives/avatar/types.ts +2 -0
  198. package/src/ui/primitives/badge/__workshop__/props.tsx +1 -9
  199. package/src/ui/primitives/badge/__workshop__/tones.tsx +1 -6
  200. package/src/ui/primitives/badge/badge.tsx +33 -32
  201. package/src/ui/primitives/badge/types.ts +2 -1
  202. package/src/ui/primitives/box/box.tsx +59 -29
  203. package/src/ui/primitives/button/__workshop__/sanityUploadButton.tsx +3 -3
  204. package/src/ui/primitives/button/__workshop__/uploadButton.tsx +2 -1
  205. package/src/ui/primitives/button/button.test.tsx +1 -15
  206. package/src/ui/primitives/button/button.tsx +63 -70
  207. package/src/ui/primitives/card/__workshop__/asComponent.tsx +3 -3
  208. package/src/ui/primitives/card/card.tsx +22 -22
  209. package/src/ui/primitives/card/cardProvider.tsx +2 -0
  210. package/src/ui/primitives/checkbox/checkbox.tsx +26 -15
  211. package/src/ui/primitives/code/code.tsx +24 -22
  212. package/src/ui/primitives/container/container.tsx +26 -15
  213. package/src/ui/primitives/flex/flex.tsx +21 -19
  214. package/src/ui/primitives/grid/grid.tsx +21 -16
  215. package/src/ui/primitives/heading/heading.tsx +42 -19
  216. package/src/ui/primitives/inline/inline.tsx +26 -23
  217. package/src/ui/primitives/kbd/kbd.tsx +25 -23
  218. package/src/ui/primitives/label/label.tsx +29 -26
  219. package/src/ui/primitives/popover/popover.tsx +293 -271
  220. package/src/ui/primitives/popover/popoverCard.tsx +122 -120
  221. package/src/ui/primitives/radio/radio.tsx +30 -14
  222. package/src/ui/primitives/select/select.tsx +24 -16
  223. package/src/ui/primitives/spinner/animatedSpinnerIcon.tsx +4 -2
  224. package/src/ui/primitives/spinner/spinner.tsx +24 -12
  225. package/src/ui/primitives/stack/stack.tsx +27 -18
  226. package/src/ui/primitives/switch/switch.tsx +31 -14
  227. package/src/ui/primitives/text/text.tsx +30 -24
  228. package/src/ui/primitives/textArea/textArea.tsx +33 -18
  229. package/src/ui/primitives/textInput/textInput.tsx +28 -40
  230. package/src/ui/primitives/tooltip/constants.ts +1 -1
  231. package/src/ui/primitives/tooltip/tooltip.tsx +85 -61
  232. package/src/ui/primitives/tooltip/tooltipCard.tsx +89 -82
  233. package/src/ui/primitives/types.ts +1 -3
  234. package/src/ui/types/avatar.ts +3 -6
  235. package/src/ui/types/badge.ts +1 -3
  236. package/src/ui/types/button.ts +1 -3
  237. package/src/ui/types/card.ts +1 -3
  238. package/src/ui/types/dialog.ts +1 -3
  239. package/src/ui/types/props.ts +20 -10
  240. package/src/ui/utils/arrow/arrow.tsx +43 -25
  241. package/src/ui/utils/boundaryElement/boundaryElementProvider.tsx +2 -6
  242. package/src/ui/utils/boundaryElement/types.ts +1 -3
  243. package/src/ui/utils/boundaryElement/useBoundaryElement.ts +1 -3
  244. package/src/ui/utils/elementQuery/elementQuery.tsx +43 -19
  245. package/src/ui/utils/errorBoundary.tsx +2 -0
  246. package/src/ui/utils/index.ts +0 -1
  247. package/src/ui/utils/layer/layer.tsx +23 -93
  248. package/src/ui/utils/layer/layerCard.tsx +92 -0
  249. package/src/ui/utils/layer/layerProvider.tsx +2 -6
  250. package/src/ui/utils/layer/useLayer.ts +1 -3
  251. package/src/ui/utils/portal/portal.ts +2 -6
  252. package/src/ui/utils/portal/portalProvider.tsx +2 -6
  253. package/src/ui/utils/portal/types.ts +1 -3
  254. package/src/ui/utils/portal/usePortal.ts +1 -3
  255. package/src/ui/utils/srOnly/srOnly.tsx +25 -20
  256. package/src/ui/utils/virtualList/virtualList.tsx +69 -50
  257. package/src/css/compile/compilePalette.ts +0 -27
  258. package/src/css/compile/compileRule.ts +0 -97
  259. package/src/css/compile/compileRules.test.ts +0 -36
  260. package/src/css/compile/compileRules.ts +0 -43
  261. package/src/css/compile/compileSystem.ts +0 -10
  262. package/src/css/compile/compileTheme_v3.ts +0 -401
  263. package/src/css/compile/types.ts +0 -6
  264. package/src/css/components/breadcrumbs/rules.ts +0 -25
  265. package/src/css/components/dialog/rules.ts +0 -78
  266. package/src/css/components/skeleton/rules.ts +0 -113
  267. package/src/css/components/toast/rules.ts +0 -18
  268. package/src/css/components/tree/rules.ts +0 -168
  269. package/src/css/primitives/_selectable/_contants.ts +0 -11
  270. package/src/css/primitives/card/_constants.ts +0 -13
  271. package/src/css/primitives/popover/rules.ts +0 -5
  272. package/src/css/primitives/spinner/rules.ts +0 -21
  273. package/src/css/primitives/token/rules.ts +0 -45
  274. package/src/ui/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
  275. package/src/ui/utils/conditionalWrapper/index.ts +0 -1
@@ -1,78 +0,0 @@
1
- import {Rules} from '../../types'
2
- import {vars} from '../../vars'
3
-
4
- export const dialogRules: Rules = {
5
- 'dialog': {
6
- 'top': 0,
7
- 'left': 0,
8
- 'right': 0,
9
- 'bottom': 0,
10
- 'alignItems': 'center',
11
- 'justifyContent': 'center',
12
- 'outline': 'none',
13
-
14
- 'background': vars.color.backdrop,
15
-
16
- // @ts-expect-error - TODO: fix this
17
- '@keyframes': {
18
- 'dialog-zoom-in': {
19
- from: {
20
- opacity: 0,
21
- transform: 'scale(0.95)',
22
- },
23
- to: {
24
- opacity: 1,
25
- transform: 'scale(1)',
26
- },
27
- },
28
- 'dialog-fade-in': {
29
- from: {
30
- opacity: 0,
31
- },
32
- to: {
33
- opacity: 1,
34
- },
35
- },
36
- },
37
-
38
- '@nest': {
39
- '&[data-animate]': {
40
- animation: 'dialog-fade-in 200ms ease-out',
41
- },
42
-
43
- // Animates the dialog card.
44
- '&[data-animate] > [data-ui="DialogCard"]': {
45
- animation: 'dialog-zoom-in 200ms ease-out',
46
- },
47
- },
48
- },
49
-
50
- 'dialog-container': {
51
- width: '100%',
52
- height: '100%',
53
- },
54
-
55
- 'dialog-card-root': {
56
- width: '100%',
57
- maxHeight: '100%',
58
- // @ts-expect-error - TODO: fix this
59
- overflow: ['hidden', 'clip'],
60
- },
61
-
62
- 'dialog-layout': {
63
- width: '100%',
64
- },
65
-
66
- 'dialog-header': {
67
- zIndex: 2,
68
- },
69
-
70
- 'dialog-content': {
71
- zIndex: 1,
72
- outline: 'none',
73
- },
74
-
75
- 'dialog-footer': {
76
- zIndex: 3,
77
- },
78
- }
@@ -1,113 +0,0 @@
1
- import {FONT_CODE_SIZE, FONT_HEADING_SIZE, FONT_LABEL_SIZE, FONT_TEXT_SIZE} from '@sanity/ui/theme'
2
-
3
- import {responsiveRules} from '../../responsiveRules'
4
- import {Rules} from '../../types'
5
- import {vars} from '../../vars'
6
-
7
- export const skeletonRules: Rules = {
8
- 'skeleton': {
9
- '--color-skeleton-from': `color-mix(in srgb, transparent, ${vars.color.muted.fg} 5%)`,
10
- '--color-skeleton-to': `color-mix(in srgb, transparent, ${vars.color.muted.fg} 10%)`,
11
-
12
- 'backgroundColor': vars.color.skeleton.from,
13
- 'backgroundPosition': '100%',
14
- 'backgroundSize': '200% 100%',
15
- 'backgroundAttachment': 'fixed',
16
- 'opacity': 0,
17
- 'transition': 'opacity 200ms ease-in',
18
-
19
- // @ts-expect-error - TODO: fix this
20
- '@keyframes': {
21
- 'skeleton-pulse': {
22
- '0%': {
23
- backgroundPosition: '100%',
24
- },
25
- '100%': {
26
- backgroundPosition: '-100%',
27
- },
28
- },
29
- },
30
-
31
- '@nest': {
32
- '&[data-animated]': {
33
- backgroundImage: [
34
- `linear-gradient(to right`,
35
- vars.color.skeleton.from,
36
- vars.color.skeleton.to,
37
- vars.color.skeleton.from,
38
- vars.color.skeleton.from,
39
- vars.color.skeleton.from,
40
- `)`,
41
- ].join(', '),
42
- animationName: 'skeleton-pulse',
43
- animationTimingFunction: 'ease-in-out',
44
- animationIterationCount: 'infinite',
45
- animationDuration: '2000ms',
46
- },
47
-
48
- '&[data-visible]': {
49
- opacity: 1,
50
- },
51
- },
52
-
53
- '@media': {
54
- 'screen and (prefers-reduced-motion: no-preference)': {
55
- backgroundColor: vars.color.skeleton.from,
56
- },
57
- },
58
- },
59
-
60
- 'font-skeleton': {
61
- height: `calc(var(--font-skeleton-line-height) - var(--font-skeleton-ascender-height) - var(--font-skeleton-descender-height))`,
62
- },
63
-
64
- // ...responsiveRules('text-skeleton-0', {
65
- // '--font-skeleton-line-height': 'var(--font-text-0-line-height)',
66
- // '--font-skeleton-ascender-height': 'var(--font-text-0-ascender-height)',
67
- // '--font-skeleton-descender-height': 'var(--font-text-0-descender-height)',
68
- // }),
69
-
70
- ...FONT_CODE_SIZE.reduce((acc, size) => {
71
- return {
72
- ...acc,
73
- ...responsiveRules(`code-skeleton-${size}`, {
74
- '--font-skeleton-line-height': vars.font.code.sizes[size].lineHeight,
75
- '--font-skeleton-ascender-height': vars.font.code.sizes[size].ascenderHeight,
76
- '--font-skeleton-descender-height': vars.font.code.sizes[size].descenderHeight,
77
- }),
78
- }
79
- }, {}),
80
-
81
- ...FONT_HEADING_SIZE.reduce((acc, size) => {
82
- return {
83
- ...acc,
84
- ...responsiveRules(`heading-skeleton-${size}`, {
85
- '--font-skeleton-line-height': vars.font.heading.sizes[size].lineHeight,
86
- '--font-skeleton-ascender-height': vars.font.heading.sizes[size].ascenderHeight,
87
- '--font-skeleton-descender-height': vars.font.heading.sizes[size].descenderHeight,
88
- }),
89
- }
90
- }, {}),
91
-
92
- ...FONT_LABEL_SIZE.reduce((acc, size) => {
93
- return {
94
- ...acc,
95
- ...responsiveRules(`label-skeleton-${size}`, {
96
- '--font-skeleton-line-height': vars.font.label.sizes[size].lineHeight,
97
- '--font-skeleton-ascender-height': vars.font.label.sizes[size].ascenderHeight,
98
- '--font-skeleton-descender-height': vars.font.label.sizes[size].descenderHeight,
99
- }),
100
- }
101
- }, {}),
102
-
103
- ...FONT_TEXT_SIZE.reduce((acc, size) => {
104
- return {
105
- ...acc,
106
- ...responsiveRules(`text-skeleton-${size}`, {
107
- '--font-skeleton-line-height': vars.font.text.sizes[size].lineHeight,
108
- '--font-skeleton-ascender-height': vars.font.text.sizes[size].ascenderHeight,
109
- '--font-skeleton-descender-height': vars.font.text.sizes[size].descenderHeight,
110
- }),
111
- }
112
- }, {}),
113
- }
@@ -1,18 +0,0 @@
1
- import {Rules} from '../../types'
2
-
3
- export const toastRules: Rules = {
4
- 'toast-layer': {
5
- position: 'fixed',
6
- right: 0,
7
- bottom: 0,
8
- pointerEvents: 'none',
9
- maxWidth: '420px',
10
- width: '100%',
11
- },
12
-
13
- 'toast': {
14
- pointerEvents: 'all',
15
- // @ts-expect-error - TODO: fix this
16
- overflow: ['hidden', 'clip'],
17
- },
18
- }
@@ -1,168 +0,0 @@
1
- import {Rules} from '../../types'
2
- import {vars} from '../../vars'
3
-
4
- export const treeRules: Rules = {
5
- 'tree-item': {
6
- '@nest': {
7
- '&[role="none"] > [role="treeitem"]': {
8
- outline: 'none',
9
- cursor: 'default',
10
- borderRadius: '3px',
11
-
12
- backgroundColor: vars.color.bg, // 'var(--card-bg-color)',
13
- color: 'var(--treeitem-fg-color)',
14
- },
15
-
16
- '&[role="none"] > [role="treeitem"]:focus': {
17
- position: 'relative',
18
- },
19
-
20
- '&[role="treeitem"]': {
21
- outline: 'none',
22
- },
23
-
24
- '&[role="treeitem"] > div': {
25
- cursor: 'default',
26
- borderRadius: '3px',
27
-
28
- backgroundColor: vars.color.bg, // 'var(--card-bg-color)',
29
- color: 'var(--treeitem-fg-color)',
30
- },
31
-
32
- '&[role="treeitem"]:focus > div': {
33
- position: 'relative',
34
- },
35
-
36
- // &[role='treeitem'] {
37
- // outline: none;
38
-
39
- // & > div {
40
- // cursor: default;
41
- // border-radius: 3px;
42
-
43
- // background-color: var(--card-bg-color);
44
- // color: var(--treeitem-fg-color);
45
- // }
46
-
47
- // &:focus > div {
48
- // position: relative;
49
- // }
50
- // }
51
- },
52
- },
53
- }
54
-
55
- // const Root = memo(styled.li(treeItemRootStyle, treeItemRootColorStyle))
56
-
57
- // const TreeItemBox = styled(Box).attrs({forwardedAs: 'a'})<TreeItemBoxStyleProps>(treeItemBoxStyle)
58
-
59
- // const ToggleArrowText = styled(Text)`
60
- // & > svg {
61
- // transition: transform 100ms;
62
- // }
63
- // `
64
-
65
- // import {getTheme_v2} from '@sanity/ui/theme'
66
- // import {css} from '../../lib/styled'
67
- // import {rem, ThemeProps} from '../../styles'
68
- // import {_cardColorStyle} from '../../styles/card'
69
-
70
- // export function treeItemRootStyle(): ReturnType<typeof css> {
71
- // return css`
72
- // &[role='none'] > [role='treeitem'] {
73
- // outline: none;
74
- // cursor: default;
75
- // border-radius: 3px;
76
-
77
- // background-color: var(--card-bg-color);
78
- // color: var(--treeitem-fg-color);
79
-
80
- // &:focus {
81
- // position: relative;
82
- // }
83
- // }
84
-
85
- // &[role='treeitem'] {
86
- // outline: none;
87
-
88
- // & > div {
89
- // cursor: default;
90
- // border-radius: 3px;
91
-
92
- // background-color: var(--card-bg-color);
93
- // color: var(--treeitem-fg-color);
94
- // }
95
-
96
- // &:focus > div {
97
- // position: relative;
98
- // }
99
- // }
100
- // `
101
- // }
102
-
103
- // export function treeItemRootColorStyle(props: ThemeProps): ReturnType<typeof css> {
104
- // const $tone = 'default'
105
- // const {color} = getTheme_v2(props.theme)
106
- // const tone = color.selectable[$tone]
107
-
108
- // return css`
109
- // &[role='none'] {
110
- // & > [role='treeitem'] {
111
- // ${_cardColorStyle(color, tone.enabled)}
112
- // }
113
-
114
- // &[data-selected] > [role='treeitem'] {
115
- // ${_cardColorStyle(color, tone.pressed)}
116
- // }
117
-
118
- // @media (hover: hover) {
119
- // &:not([data-selected]) > [role='treeitem']:not(:focus):hover {
120
- // ${_cardColorStyle(color, tone.hovered)}
121
- // }
122
-
123
- // & > [role='treeitem']:focus {
124
- // ${_cardColorStyle(color, tone.selected)}
125
- // }
126
- // }
127
- // }
128
-
129
- // &[role='treeitem'] {
130
- // & > [data-ui='TreeItem__box'] {
131
- // ${_cardColorStyle(color, tone.enabled)}
132
- // }
133
-
134
- // &[data-selected] > [data-ui='TreeItem__box'] {
135
- // ${_cardColorStyle(color, tone.pressed)}
136
- // }
137
-
138
- // @media (hover: hover) {
139
- // &:not([data-selected]):not(:focus) > [data-ui='TreeItem__box']:hover {
140
- // ${_cardColorStyle(color, tone.hovered)}
141
- // }
142
-
143
- // &:focus > [data-ui='TreeItem__box'] {
144
- // ${_cardColorStyle(color, tone.selected)}
145
- // }
146
- // }
147
- // }
148
- // `
149
- // }
150
-
151
- // export interface TreeItemBoxStyleProps {
152
- // $level: number
153
- // }
154
-
155
- // export function treeItemBoxStyle(
156
- // props: TreeItemBoxStyleProps & ThemeProps,
157
- // ): ReturnType<typeof css> {
158
- // const {$level} = props
159
- // const {space} = getTheme_v2(props.theme)
160
-
161
- // return css`
162
- // padding-left: ${rem(space[2] * $level)};
163
-
164
- // &[data-as='a'] {
165
- // text-decoration: none;
166
- // }
167
- // `
168
- // }
@@ -1,11 +0,0 @@
1
- import {ThemeColorStateToneKey} from '@sanity/ui/theme'
2
-
3
- export const toneMap: Record<ThemeColorStateToneKey, string | undefined> = {
4
- default: 'default',
5
- neutral: 'neutral',
6
- suggest: 'suggest',
7
- primary: 'accent',
8
- positive: 'positive',
9
- caution: 'caution',
10
- critical: 'critical',
11
- } as const
@@ -1,13 +0,0 @@
1
- import {ThemeColorCardToneKey} from '@sanity/ui/theme'
2
-
3
- export const toneMap: Record<ThemeColorCardToneKey | 'inherit', string | undefined> = {
4
- transparent: 'transparent',
5
- default: 'default',
6
- neutral: 'neutral',
7
- suggest: 'suggest',
8
- primary: 'accent',
9
- positive: 'positive',
10
- caution: 'caution',
11
- critical: 'critical',
12
- inherit: undefined,
13
- } as const
@@ -1,5 +0,0 @@
1
- import {Rules} from '../../types'
2
-
3
- export const popoverRules: Rules = {
4
- //
5
- }
@@ -1,21 +0,0 @@
1
- import {Rules} from '../../types'
2
-
3
- export const spinnerRules: Rules = {
4
- 'spinner': {},
5
-
6
- 'animated-spinner-icon': {
7
- 'animation': 'spinner-rotate 500ms linear infinite',
8
-
9
- // @ts-expect-error - TODO: fix this
10
- '@keyframes': {
11
- 'spinner-rotate': {
12
- from: {
13
- transform: 'rotate(0deg)',
14
- },
15
- to: {
16
- transform: 'rotate(360deg)',
17
- },
18
- },
19
- },
20
- },
21
- }
@@ -1,45 +0,0 @@
1
- import type {Rules} from '../../types'
2
-
3
- export const tokenRules: Rules = {
4
- token: {
5
- '@nest': {
6
- '&.atrule': {color: 'var(--color-token-atrule)'},
7
- '&.attr-name': {color: 'var(--color-token-attr-name)'},
8
- '&.attr-value': {color: 'var(--color-token-attr-value)'},
9
- '&.attribute': {color: 'var(--color-token-attribute)'},
10
- '&.boolean': {color: 'var(--color-token-boolean)'},
11
- '&.builtin': {color: 'var(--color-token-builtin)'},
12
- '&.cdata': {color: 'var(--color-token-cdata)'},
13
- '&.char': {color: 'var(--color-token-char)'},
14
- '&.class': {color: 'var(--color-token-class)'},
15
- '&.class-name': {color: 'var(--color-token-class-name)'},
16
- '&.comment': {color: 'var(--color-token-comment)'},
17
- '&.constant': {color: 'var(--color-token-constant)'},
18
- '&.deleted': {color: 'var(--color-token-deleted)'},
19
- '&.doctype': {color: 'var(--color-token-doctype)'},
20
- '&.entity': {color: 'var(--color-token-entity)'},
21
- '&.function': {color: 'var(--color-token-function)'},
22
- '&.hexcode': {color: 'var(--color-token-hexcode)'},
23
- '&.id': {color: 'var(--color-token-id)'},
24
- '&.important': {color: 'var(--color-token-important)'},
25
- '&.inserted': {color: 'var(--color-token-inserted)'},
26
- '&.keyword': {color: 'var(--color-token-keyword)'},
27
- '&.number': {color: 'var(--color-token-number)'},
28
- '&.operator': {color: 'var(--color-token-operator)'},
29
- '&.prolog': {color: 'var(--color-token-prolog)'},
30
- '&.property': {color: 'var(--color-token-property)'},
31
- '&.pseudo-class': {color: 'var(--color-token-pseudo-class)'},
32
- '&.pseudo-element': {color: 'var(--color-token-pseudo-element)'},
33
- '&.punctuation': {color: 'var(--color-token-punctuation)'},
34
- '&.attr-value &:not(.attr-equals).punctuation': {color: 'inherit'},
35
- '&.regex': {color: 'var(--color-token-regex)'},
36
- '&.selector': {color: 'var(--color-token-selector)'},
37
- '&.string': {color: 'var(--color-token-string)'},
38
- '&.symbol': {color: 'var(--color-token-symbol)'},
39
- '&.tag': {color: 'var(--color-token-tag)'},
40
- '&.unit': {color: 'var(--color-token-unit)'},
41
- '&.url': {color: 'var(--color-token-url)'},
42
- '&.variable': {color: 'var(--color-token-variable)'},
43
- },
44
- },
45
- }
@@ -1,23 +0,0 @@
1
- import {ReactNode} from 'react'
2
-
3
- /**
4
- * @internal
5
- * @deprecated this component will be removed in the next major release
6
- */
7
- export function ConditionalWrapper({
8
- children,
9
- condition,
10
- wrapper,
11
- }: {
12
- children: ReactNode
13
- condition: boolean
14
- wrapper: (children: ReactNode) => ReactNode
15
- }): ReactNode {
16
- if (!condition) {
17
- return children
18
- }
19
-
20
- return wrapper(children)
21
- }
22
-
23
- ConditionalWrapper.displayName = 'ConditionalWrapper'
@@ -1 +0,0 @@
1
- export * from './conditionalWrapper'