@sanity/ui 3.0.0-static.11 → 3.0.0-static.13

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 (251) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +1293 -1215
  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 +1284 -1202
  6. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  7. package/dist/_visual-editing.d.mts +528 -358
  8. package/dist/_visual-editing.d.ts +528 -358
  9. package/dist/cli.js +1 -1
  10. package/dist/css.d.mts +143 -73
  11. package/dist/css.d.ts +143 -73
  12. package/dist/css.js +329 -472
  13. package/dist/css.js.map +1 -1
  14. package/dist/css.mjs +330 -473
  15. package/dist/css.mjs.map +1 -1
  16. package/dist/index.d.mts +1362 -869
  17. package/dist/index.d.ts +1362 -869
  18. package/dist/index.js +383 -308
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.mjs +387 -312
  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 -21946
  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 +9 -9
  31. package/dist/theme.js.map +1 -1
  32. package/dist/theme.mjs +9 -9
  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/{system.style.ts → _system.style.ts} +3 -2
  39. package/src/css/aspects/display/display.ts +1 -0
  40. package/src/css/aspects/display/types.ts +2 -3
  41. package/src/css/aspects/flex/types.ts +4 -12
  42. package/src/css/aspects/flexItem/types.ts +1 -3
  43. package/src/css/aspects/font/types.ts +1 -3
  44. package/src/css/aspects/grid/grid.ts +1 -0
  45. package/src/css/aspects/grid/types.ts +5 -9
  46. package/src/css/aspects/gridItem/gridItem.ts +1 -1
  47. package/src/css/aspects/gridItem/types.ts +7 -18
  48. package/src/css/aspects/height/height.ts +3 -4
  49. package/src/css/aspects/inset/inset.ts +1 -0
  50. package/src/css/aspects/margin/margin.ts +1 -0
  51. package/src/css/aspects/margin/types.ts +1 -0
  52. package/src/css/aspects/maxWidth/maxWidth.ts +1 -0
  53. package/src/css/aspects/maxWidth/types.ts +1 -0
  54. package/src/css/aspects/minWidth/minWidth.ts +1 -0
  55. package/src/css/aspects/minWidth/types.ts +2 -0
  56. package/src/css/aspects/overflow/overflow.ts +1 -0
  57. package/src/css/aspects/padding/padding.ts +1 -0
  58. package/src/css/aspects/pointerEvents/pointerEvents.ts +1 -0
  59. package/src/css/aspects/position/position.ts +1 -0
  60. package/src/css/aspects/shadow/shadow.ts +1 -0
  61. package/src/css/aspects/textOverflow/textOverflow.ts +1 -0
  62. package/src/css/aspects/textOverflow/types.ts +1 -0
  63. package/src/css/aspects/width/types.ts +2 -0
  64. package/src/css/aspects/width/width.ts +1 -0
  65. package/src/css/{compile/compilePalette.ts → compilePalette.ts} +14 -10
  66. package/src/css/compileSystem.ts +7 -0
  67. package/src/css/{compile/compileTheme.ts → compileTheme.ts} +1 -0
  68. package/src/css/{compile/compileTheme_v3.ts → compileTheme_v3.ts} +123 -104
  69. package/src/css/components/breadcrumbs/breadcrumbs.ts +1 -0
  70. package/src/css/components/dialog/dialog.ts +7 -0
  71. package/src/css/components/menu/menu.ts +2 -0
  72. package/src/css/components/skeleton/skeleton.ts +4 -0
  73. package/src/css/components/skeleton/types.ts +4 -0
  74. package/src/css/components/toast/toast.ts +5 -0
  75. package/src/css/components/tree/tree.ts +1 -0
  76. package/src/css/composeClassNames.ts +4 -2
  77. package/src/css/constants.ts +2 -0
  78. package/src/css/index.ts +3 -3
  79. package/src/css/primitives/_arrow/_arrow.ts +3 -0
  80. package/src/css/primitives/_input/input.ts +2 -0
  81. package/src/css/primitives/_selectable/_selectable.style.ts +1 -2
  82. package/src/css/primitives/_selectable/selectable.ts +1 -2
  83. package/src/css/primitives/avatar/avatar.style.ts +5 -8
  84. package/src/css/primitives/avatar/avatar.ts +6 -0
  85. package/src/css/primitives/avatar/types.ts +1 -0
  86. package/src/css/primitives/box/types.ts +1 -3
  87. package/src/css/primitives/button/button.ts +4 -21
  88. package/src/css/primitives/button/index.ts +1 -0
  89. package/src/css/primitives/button/types.ts +18 -0
  90. package/src/css/primitives/card/card.style.ts +3 -6
  91. package/src/css/primitives/card/card.ts +2 -2
  92. package/src/css/primitives/card/types.ts +2 -2
  93. package/src/css/primitives/checkbox/checkbox.ts +2 -0
  94. package/src/css/primitives/container/container.ts +1 -0
  95. package/src/css/primitives/container/types.ts +1 -0
  96. package/src/css/primitives/kbd/kbd.ts +1 -0
  97. package/src/css/primitives/label/types.ts +7 -2
  98. package/src/css/primitives/popover/popover.ts +2 -0
  99. package/src/css/primitives/radio/radio.ts +1 -0
  100. package/src/css/primitives/select/select.ts +2 -0
  101. package/src/css/primitives/spinner/spinner.ts +2 -0
  102. package/src/css/primitives/switch/switch.ts +5 -0
  103. package/src/css/primitives/text/types.ts +4 -0
  104. package/src/css/primitives/textArea/textArea.ts +1 -0
  105. package/src/css/primitives/textInput/textInput.ts +1 -0
  106. package/src/css/primitives/tooltip/tooltip.ts +2 -0
  107. package/src/css/scopeClassName.ts +1 -0
  108. package/src/css/types.ts +9 -12
  109. package/src/css/util.ts +5 -0
  110. package/src/css/utils/srOnly/srOnly.ts +3 -1
  111. package/src/css/varNames.ts +131 -141
  112. package/src/css/vars.ts +1 -6
  113. package/src/theme/palette/constants.ts +2 -0
  114. package/src/theme/palette/types.ts +3 -0
  115. package/src/theme/types.ts +2 -6
  116. package/src/theme/v0/focusRing.ts +1 -3
  117. package/src/theme/v0/font.ts +6 -18
  118. package/src/theme/v0/layer.ts +1 -3
  119. package/src/theme/v0/shadow.ts +2 -6
  120. package/src/theme/v2/avatar.ts +1 -3
  121. package/src/theme/v2/color/_system.ts +1 -3
  122. package/src/theme/v2/color/avatar.ts +2 -6
  123. package/src/theme/v2/color/badge.ts +2 -6
  124. package/src/theme/v2/color/button.ts +3 -9
  125. package/src/theme/v2/color/color.ts +3 -9
  126. package/src/theme/v2/color/input.ts +3 -9
  127. package/src/theme/v2/color/kbd.ts +1 -3
  128. package/src/theme/v2/color/selectable.ts +2 -6
  129. package/src/theme/v2/color/state.ts +1 -3
  130. package/src/theme/v2/color/syntax.ts +1 -3
  131. package/src/theme/v2/input.ts +1 -3
  132. package/src/theme/v2/theme.ts +2 -6
  133. package/src/theme/v3/buildTheme_v3.ts +1 -0
  134. package/src/theme/v3/color/color.ts +6 -4
  135. package/src/theme/v3/color/renderColor.ts +4 -1
  136. package/src/theme/v3/defaultTokens.ts +1 -0
  137. package/src/theme/v3/resolveTokens.ts +9 -9
  138. package/src/ui/RootClassNames.tsx +3 -0
  139. package/src/ui/StyleTags.tsx +3 -1
  140. package/src/ui/_compat/theme/themeColorProvider.tsx +2 -6
  141. package/src/ui/_compat/theme/themeProvider.tsx +2 -6
  142. package/src/ui/_compat/theme/types.ts +1 -3
  143. package/src/ui/_compat/theme/useRootTheme.ts +1 -3
  144. package/src/ui/_compat/theme/useTheme.ts +2 -6
  145. package/src/ui/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
  146. package/src/ui/components/autocomplete/autocomplete.tsx +86 -114
  147. package/src/ui/components/autocomplete/autocompleteOption.tsx +2 -0
  148. package/src/ui/components/autocomplete/types.ts +3 -8
  149. package/src/ui/components/breadcrumbs/breadcrumbs.tsx +27 -21
  150. package/src/ui/components/dialog/dialog.tsx +89 -291
  151. package/src/ui/components/dialog/dialogCard.tsx +183 -0
  152. package/src/ui/components/dialog/isTargetWithinScope.ts +14 -0
  153. package/src/ui/components/hotkeys/hotkeys.tsx +33 -15
  154. package/src/ui/components/menu/__workshop__/asComponent.tsx +6 -6
  155. package/src/ui/components/menu/menu.tsx +27 -33
  156. package/src/ui/components/menu/menuButton.tsx +10 -14
  157. package/src/ui/components/menu/menuDivider.tsx +25 -13
  158. package/src/ui/components/menu/menuGroup.tsx +34 -26
  159. package/src/ui/components/menu/menuItem.tsx +51 -40
  160. package/src/ui/components/skeleton/codeSkeleton.tsx +53 -0
  161. package/src/ui/components/skeleton/headingSkeleton.tsx +52 -0
  162. package/src/ui/components/skeleton/index.ts +3 -0
  163. package/src/ui/components/skeleton/labelSkeleton.tsx +51 -0
  164. package/src/ui/components/skeleton/skeleton.tsx +39 -16
  165. package/src/ui/components/skeleton/textSkeleton.tsx +31 -110
  166. package/src/ui/components/tab/tab.tsx +23 -19
  167. package/src/ui/components/tab/tabList.tsx +34 -33
  168. package/src/ui/components/tab/tabPanel.tsx +25 -19
  169. package/src/ui/components/toast/toast.tsx +21 -16
  170. package/src/ui/components/toast/toastLayer.tsx +28 -10
  171. package/src/ui/components/toast/toastProvider.tsx +2 -6
  172. package/src/ui/components/toast/types.ts +2 -6
  173. package/src/ui/components/toast/useToast.ts +1 -3
  174. package/src/ui/components/tree/tree.tsx +194 -187
  175. package/src/ui/components/tree/treeGroup.tsx +25 -5
  176. package/src/ui/components/tree/treeItem.tsx +35 -23
  177. package/src/ui/hooks/useClickOutside.ts +2 -6
  178. package/src/ui/hooks/useClickOutsideEvent.ts +3 -9
  179. package/src/ui/primitives/_selectable/selectable.tsx +33 -20
  180. package/src/ui/primitives/avatar/avatar.tsx +28 -31
  181. package/src/ui/primitives/avatar/avatarCounter.tsx +33 -25
  182. package/src/ui/primitives/avatar/avatarStack.tsx +31 -24
  183. package/src/ui/primitives/avatar/types.ts +2 -0
  184. package/src/ui/primitives/badge/__workshop__/props.tsx +1 -9
  185. package/src/ui/primitives/badge/__workshop__/tones.tsx +1 -6
  186. package/src/ui/primitives/badge/badge.tsx +33 -32
  187. package/src/ui/primitives/badge/types.ts +2 -1
  188. package/src/ui/primitives/box/box.tsx +59 -29
  189. package/src/ui/primitives/button/__workshop__/sanityUploadButton.tsx +3 -3
  190. package/src/ui/primitives/button/__workshop__/uploadButton.tsx +2 -1
  191. package/src/ui/primitives/button/button.test.tsx +1 -15
  192. package/src/ui/primitives/button/button.tsx +64 -70
  193. package/src/ui/primitives/card/__workshop__/asComponent.tsx +3 -3
  194. package/src/ui/primitives/card/card.tsx +22 -22
  195. package/src/ui/primitives/card/cardProvider.tsx +2 -0
  196. package/src/ui/primitives/checkbox/checkbox.tsx +26 -15
  197. package/src/ui/primitives/code/code.tsx +24 -22
  198. package/src/ui/primitives/container/container.tsx +26 -15
  199. package/src/ui/primitives/flex/flex.tsx +21 -19
  200. package/src/ui/primitives/grid/grid.tsx +21 -16
  201. package/src/ui/primitives/heading/heading.tsx +42 -19
  202. package/src/ui/primitives/inline/inline.tsx +26 -23
  203. package/src/ui/primitives/kbd/kbd.tsx +25 -23
  204. package/src/ui/primitives/label/label.tsx +41 -26
  205. package/src/ui/primitives/popover/popover.tsx +281 -277
  206. package/src/ui/primitives/popover/popoverCard.tsx +119 -118
  207. package/src/ui/primitives/radio/radio.tsx +30 -14
  208. package/src/ui/primitives/select/select.tsx +24 -16
  209. package/src/ui/primitives/spinner/animatedSpinnerIcon.tsx +4 -2
  210. package/src/ui/primitives/spinner/spinner.tsx +24 -12
  211. package/src/ui/primitives/stack/stack.tsx +27 -18
  212. package/src/ui/primitives/switch/switch.tsx +31 -14
  213. package/src/ui/primitives/text/text.tsx +42 -24
  214. package/src/ui/primitives/textArea/textArea.tsx +33 -18
  215. package/src/ui/primitives/textInput/textInput.tsx +28 -40
  216. package/src/ui/primitives/tooltip/constants.ts +1 -1
  217. package/src/ui/primitives/tooltip/tooltip.tsx +76 -59
  218. package/src/ui/primitives/tooltip/tooltipCard.tsx +89 -82
  219. package/src/ui/primitives/types.ts +1 -3
  220. package/src/ui/types/avatar.ts +3 -6
  221. package/src/ui/types/badge.ts +1 -3
  222. package/src/ui/types/button.ts +1 -3
  223. package/src/ui/types/card.ts +1 -3
  224. package/src/ui/types/dialog.ts +1 -3
  225. package/src/ui/types/props.ts +20 -10
  226. package/src/ui/utils/arrow/arrow.tsx +40 -14
  227. package/src/ui/utils/boundaryElement/boundaryElementProvider.tsx +2 -6
  228. package/src/ui/utils/boundaryElement/types.ts +1 -3
  229. package/src/ui/utils/boundaryElement/useBoundaryElement.ts +1 -3
  230. package/src/ui/utils/elementQuery/elementQuery.tsx +36 -14
  231. package/src/ui/utils/errorBoundary.tsx +2 -0
  232. package/src/ui/utils/index.ts +0 -1
  233. package/src/ui/utils/layer/layer.tsx +23 -93
  234. package/src/ui/utils/layer/layerCard.tsx +92 -0
  235. package/src/ui/utils/layer/layerProvider.tsx +2 -6
  236. package/src/ui/utils/layer/useLayer.ts +1 -3
  237. package/src/ui/utils/portal/portal.ts +2 -6
  238. package/src/ui/utils/portal/portalProvider.tsx +2 -6
  239. package/src/ui/utils/portal/types.ts +1 -3
  240. package/src/ui/utils/portal/usePortal.ts +1 -3
  241. package/src/ui/utils/srOnly/srOnly.tsx +25 -20
  242. package/src/ui/utils/virtualList/virtualList.tsx +36 -24
  243. package/src/css/compile/compileRule.ts +0 -97
  244. package/src/css/compile/compileRules.test.ts +0 -36
  245. package/src/css/compile/compileRules.ts +0 -43
  246. package/src/css/compile/compileSystem.ts +0 -7
  247. package/src/css/compile/types.ts +0 -6
  248. package/src/css/primitives/_selectable/_contants.ts +0 -11
  249. package/src/css/primitives/card/_constants.ts +0 -13
  250. package/src/ui/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
  251. package/src/ui/utils/conditionalWrapper/index.ts +0 -1
@@ -16,8 +16,10 @@ import {
16
16
  Shadow,
17
17
  SPACE,
18
18
  type Space,
19
+ THEME_COLOR_CARD_TONES,
19
20
  THEME_COLOR_STATE_TONES,
20
21
  type ThemeColorCardToneKey as CardTone,
22
+ ThemeColorCardToneKey,
21
23
  type ThemeColorSchemeKey as Scheme,
22
24
  } from '@sanity/ui/theme'
23
25
 
@@ -29,6 +31,7 @@ import {
29
31
  type VarNames,
30
32
  } from './types'
31
33
 
34
+ /** @public */
32
35
  export const varNames: VarNames = {
33
36
  avatar: {
34
37
  distance: `--avatar-distance`,
@@ -66,9 +69,6 @@ export const varNames: VarNames = {
66
69
  },
67
70
  color: {
68
71
  // card scope
69
- accent: {
70
- fg: `--color-accent-fg`,
71
- },
72
72
  avatar: {
73
73
  bg: `--color-avatar-bg`,
74
74
  fg: `--color-avatar-fg`,
@@ -186,36 +186,32 @@ export const varNames: VarNames = {
186
186
  tinted: buildColorVariantVarNames({variant: 'tinted'}),
187
187
 
188
188
  // tone scopes
189
- transparent: buildColorCardVarNames({tone: 'transparent'}),
190
- default: buildColorCardVarNames({tone: 'default'}),
191
- neutral: buildColorCardVarNames({tone: 'neutral'}),
192
- primary: buildColorCardVarNames({tone: 'primary'}),
193
- suggest: buildColorCardVarNames({tone: 'suggest'}),
194
- positive: buildColorCardVarNames({tone: 'positive'}),
195
- caution: buildColorCardVarNames({tone: 'caution'}),
196
- critical: buildColorCardVarNames({tone: 'critical'}),
197
-
198
- // scheme scope
199
- dark: {
200
- transparent: buildColorCardVarNames({scheme: 'dark', tone: 'transparent'}),
201
- default: buildColorCardVarNames({scheme: 'dark', tone: 'default'}),
202
- neutral: buildColorCardVarNames({scheme: 'dark', tone: 'neutral'}),
203
- primary: buildColorCardVarNames({scheme: 'dark', tone: 'primary'}),
204
- suggest: buildColorCardVarNames({scheme: 'dark', tone: 'neutral'}),
205
- positive: buildColorCardVarNames({scheme: 'dark', tone: 'positive'}),
206
- caution: buildColorCardVarNames({scheme: 'dark', tone: 'caution'}),
207
- critical: buildColorCardVarNames({scheme: 'dark', tone: 'critical'}),
208
- },
209
- light: {
210
- transparent: buildColorCardVarNames({scheme: 'light', tone: 'transparent'}),
211
- default: buildColorCardVarNames({scheme: 'light', tone: 'default'}),
212
- neutral: buildColorCardVarNames({scheme: 'light', tone: 'neutral'}),
213
- primary: buildColorCardVarNames({scheme: 'light', tone: 'primary'}),
214
- suggest: buildColorCardVarNames({scheme: 'light', tone: 'suggest'}),
215
- positive: buildColorCardVarNames({scheme: 'light', tone: 'positive'}),
216
- caution: buildColorCardVarNames({scheme: 'light', tone: 'caution'}),
217
- critical: buildColorCardVarNames({scheme: 'light', tone: 'critical'}),
218
- },
189
+ ...THEME_COLOR_CARD_TONES.reduce(
190
+ (acc, tone) => {
191
+ acc[tone] = buildColorCardVarNames({tone})
192
+
193
+ return acc
194
+ },
195
+ {} as Record<ThemeColorCardToneKey, ColorCardVarNames>,
196
+ ),
197
+
198
+ // scheme scopes
199
+ dark: THEME_COLOR_CARD_TONES.reduce(
200
+ (acc, tone) => {
201
+ acc[tone] = buildColorCardVarNames({scheme: 'dark', tone})
202
+
203
+ return acc
204
+ },
205
+ {} as Record<ThemeColorCardToneKey, ColorCardVarNames>,
206
+ ),
207
+ light: THEME_COLOR_CARD_TONES.reduce(
208
+ (acc, tone) => {
209
+ acc[tone] = buildColorCardVarNames({scheme: 'light', tone})
210
+
211
+ return acc
212
+ },
213
+ {} as Record<ThemeColorCardToneKey, ColorCardVarNames>,
214
+ ),
219
215
  },
220
216
  container: {
221
217
  0: `--container-0`,
@@ -385,7 +381,6 @@ export const varNames: VarNames = {
385
381
  letterSpacing: `--input-letter-spacing`,
386
382
  ascenderHeight: `--input-ascender-height`,
387
383
  descenderHeight: `--input-descender-height`,
388
- // capHeight: `--input-cap-height`,
389
384
 
390
385
  gap: `--input-gap`,
391
386
  padding: `--input-padding`,
@@ -429,112 +424,107 @@ export const varNames: VarNames = {
429
424
  function buildColorCardVarNames(props: {scheme?: Scheme; tone: CardTone}): ColorCardVarNames {
430
425
  const {scheme, tone} = props
431
426
 
432
- const sourcePrefix = scheme
433
- ? (`--color-${scheme}-${tone}` as const)
434
- : (`--color-${tone}` as const)
427
+ const prefix = scheme ? (`--color-${scheme}-${tone}` as const) : (`--color-${tone}` as const)
435
428
 
436
429
  return {
437
- accent: {
438
- fg: `${sourcePrefix}-accent-fg`,
439
- },
440
430
  avatar: {
441
431
  gray: {
442
- bg: `${sourcePrefix}-avatar-gray-bg`,
443
- fg: `${sourcePrefix}-avatar-gray-fg`,
432
+ bg: `${prefix}-avatar-gray-bg`,
433
+ fg: `${prefix}-avatar-gray-fg`,
444
434
  },
445
435
  blue: {
446
- bg: `${sourcePrefix}-avatar-blue-bg`,
447
- fg: `${sourcePrefix}-avatar-blue-fg`,
436
+ bg: `${prefix}-avatar-blue-bg`,
437
+ fg: `${prefix}-avatar-blue-fg`,
448
438
  },
449
439
  purple: {
450
- bg: `${sourcePrefix}-avatar-purple-bg`,
451
- fg: `${sourcePrefix}-avatar-purple-fg`,
440
+ bg: `${prefix}-avatar-purple-bg`,
441
+ fg: `${prefix}-avatar-purple-fg`,
452
442
  },
453
443
  magenta: {
454
- bg: `${sourcePrefix}-avatar-magenta-bg`,
455
- fg: `${sourcePrefix}-avatar-magenta-fg`,
444
+ bg: `${prefix}-avatar-magenta-bg`,
445
+ fg: `${prefix}-avatar-magenta-fg`,
456
446
  },
457
447
  red: {
458
- bg: `${sourcePrefix}-avatar-red-bg`,
459
- fg: `${sourcePrefix}-avatar-red-fg`,
448
+ bg: `${prefix}-avatar-red-bg`,
449
+ fg: `${prefix}-avatar-red-fg`,
460
450
  },
461
451
  orange: {
462
- bg: `${sourcePrefix}-avatar-orange-bg`,
463
- fg: `${sourcePrefix}-avatar-gray-fg`,
452
+ bg: `${prefix}-avatar-orange-bg`,
453
+ fg: `${prefix}-avatar-gray-fg`,
464
454
  },
465
455
  yellow: {
466
- bg: `${sourcePrefix}-avatar-yellow-bg`,
467
- fg: `${sourcePrefix}-avatar-yellow-fg`,
456
+ bg: `${prefix}-avatar-yellow-bg`,
457
+ fg: `${prefix}-avatar-yellow-fg`,
468
458
  },
469
459
  green: {
470
- bg: `${sourcePrefix}-avatar-green-bg`,
471
- fg: `${sourcePrefix}-avatar-green-fg`,
460
+ bg: `${prefix}-avatar-green-bg`,
461
+ fg: `${prefix}-avatar-green-fg`,
472
462
  },
473
463
  cyan: {
474
- bg: `${sourcePrefix}-avatar-cyan-bg`,
475
- fg: `${sourcePrefix}-avatar-yellow-fg`,
464
+ bg: `${prefix}-avatar-cyan-bg`,
465
+ fg: `${prefix}-avatar-yellow-fg`,
476
466
  },
477
467
  },
478
- backdrop: `${sourcePrefix}-backdrop`,
468
+ backdrop: `${prefix}-backdrop`,
479
469
  code: {
480
- bg: `${sourcePrefix}-code-bg`,
481
- fg: `${sourcePrefix}-code-fg`,
470
+ bg: `${prefix}-code-bg`,
471
+ fg: `${prefix}-code-fg`,
482
472
  token: {
483
- atrule: `${sourcePrefix}-code-token-atrule`,
484
- attrName: `${sourcePrefix}-code-token-attr-name`,
485
- attrValue: `${sourcePrefix}-code-token-attr-value`,
486
- attribute: `${sourcePrefix}-code-token-attribute`,
487
- boolean: `${sourcePrefix}-code-token-boolean`,
488
- builtin: `${sourcePrefix}-code-token-builtin`,
489
- cdata: `${sourcePrefix}-code-token-cdata`,
490
- char: `${sourcePrefix}-code-token-char`,
491
- class: `${sourcePrefix}-code-token-class`,
492
- className: `${sourcePrefix}-code-token-class-name`,
493
- comment: `${sourcePrefix}-code-token-comment`,
494
- constant: `${sourcePrefix}-code-token-constant`,
495
- deleted: `${sourcePrefix}-code-token-deleted`,
496
- doctype: `${sourcePrefix}-code-token-doctype`,
497
- entity: `${sourcePrefix}-code-token-entity`,
498
- function: `${sourcePrefix}-code-token-function`,
499
- hexcode: `${sourcePrefix}-code-token-hexcode`,
500
- id: `${sourcePrefix}-code-token-id`,
501
- important: `${sourcePrefix}-code-token-important`,
502
- inserted: `${sourcePrefix}-code-token-inserted`,
503
- keyword: `${sourcePrefix}-code-token-keyword`,
504
- number: `${sourcePrefix}-code-token-number`,
505
- operator: `${sourcePrefix}-code-token-operator`,
506
- prolog: `${sourcePrefix}-code-token-prolog`,
507
- property: `${sourcePrefix}-code-token-property`,
508
- pseudoClass: `${sourcePrefix}-code-token-pseudo-class`,
509
- pseudoElement: `${sourcePrefix}-code-token-pseudo-element`,
510
- punctuation: `${sourcePrefix}-code-token-punctuation`,
511
- regex: `${sourcePrefix}-code-token-regex`,
512
- selector: `${sourcePrefix}-code-token-selector`,
513
- string: `${sourcePrefix}-code-token-string`,
514
- symbol: `${sourcePrefix}-code-token-symbol`,
515
- tag: `${sourcePrefix}-code-token-tag`,
516
- unit: `${sourcePrefix}-code-token-unit`,
517
- url: `${sourcePrefix}-code-token-url`,
518
- variable: `${sourcePrefix}-code-token-variable`,
519
- },
520
- },
521
- focusRing: `${sourcePrefix}-focus-ring`,
473
+ atrule: `${prefix}-code-token-atrule`,
474
+ attrName: `${prefix}-code-token-attr-name`,
475
+ attrValue: `${prefix}-code-token-attr-value`,
476
+ attribute: `${prefix}-code-token-attribute`,
477
+ boolean: `${prefix}-code-token-boolean`,
478
+ builtin: `${prefix}-code-token-builtin`,
479
+ cdata: `${prefix}-code-token-cdata`,
480
+ char: `${prefix}-code-token-char`,
481
+ class: `${prefix}-code-token-class`,
482
+ className: `${prefix}-code-token-class-name`,
483
+ comment: `${prefix}-code-token-comment`,
484
+ constant: `${prefix}-code-token-constant`,
485
+ deleted: `${prefix}-code-token-deleted`,
486
+ doctype: `${prefix}-code-token-doctype`,
487
+ entity: `${prefix}-code-token-entity`,
488
+ function: `${prefix}-code-token-function`,
489
+ hexcode: `${prefix}-code-token-hexcode`,
490
+ id: `${prefix}-code-token-id`,
491
+ important: `${prefix}-code-token-important`,
492
+ inserted: `${prefix}-code-token-inserted`,
493
+ keyword: `${prefix}-code-token-keyword`,
494
+ number: `${prefix}-code-token-number`,
495
+ operator: `${prefix}-code-token-operator`,
496
+ prolog: `${prefix}-code-token-prolog`,
497
+ property: `${prefix}-code-token-property`,
498
+ pseudoClass: `${prefix}-code-token-pseudo-class`,
499
+ pseudoElement: `${prefix}-code-token-pseudo-element`,
500
+ punctuation: `${prefix}-code-token-punctuation`,
501
+ regex: `${prefix}-code-token-regex`,
502
+ selector: `${prefix}-code-token-selector`,
503
+ string: `${prefix}-code-token-string`,
504
+ symbol: `${prefix}-code-token-symbol`,
505
+ tag: `${prefix}-code-token-tag`,
506
+ unit: `${prefix}-code-token-unit`,
507
+ url: `${prefix}-code-token-url`,
508
+ variable: `${prefix}-code-token-variable`,
509
+ },
510
+ },
511
+ focusRing: `${prefix}-focus-ring`,
522
512
  link: {
523
- fg: `${sourcePrefix}-link-fg`,
513
+ fg: `${prefix}-link-fg`,
524
514
  },
525
515
  muted: {
526
- bg: `${sourcePrefix}-muted-bg`,
527
- fg: `${sourcePrefix}-muted-fg`,
516
+ bg: `${prefix}-muted-bg`,
517
+ fg: `${prefix}-muted-fg`,
528
518
  },
529
519
  shadow: {
530
- outline: `${sourcePrefix}-shadow-outline`,
531
- umbra: `${sourcePrefix}-shadow-umbra`,
532
- penumbra: `${sourcePrefix}-shadow-penumbra`,
533
- ambient: `${sourcePrefix}-shadow-ambient`,
520
+ outline: `${prefix}-shadow-outline`,
521
+ umbra: `${prefix}-shadow-umbra`,
522
+ penumbra: `${prefix}-shadow-penumbra`,
523
+ ambient: `${prefix}-shadow-ambient`,
534
524
  },
535
525
  skeleton: {
536
- from: `${sourcePrefix}-skeleton-from`,
537
- to: `${sourcePrefix}-skeleton-to`,
526
+ from: `${prefix}-skeleton-from`,
527
+ to: `${prefix}-skeleton-to`,
538
528
  },
539
529
 
540
530
  solid: buildColorVariantVarNames({scheme, tone, variant: 'solid'}),
@@ -549,7 +539,7 @@ function buildColorVariantVarNames(options: {
549
539
  }): ColorVariantVarNames {
550
540
  const {scheme, tone, variant} = options
551
541
 
552
- const _prefix =
542
+ const prefix =
553
543
  scheme && tone
554
544
  ? (`--color-${scheme}-${tone}-${variant}` as const)
555
545
  : tone
@@ -558,30 +548,30 @@ function buildColorVariantVarNames(options: {
558
548
 
559
549
  const vars = {
560
550
  bg: {
561
- 0: `${_prefix}-bg-0`,
562
- 1: `${_prefix}-bg-1`,
563
- 2: `${_prefix}-bg-2`,
564
- 3: `${_prefix}-bg-3`,
565
- 4: `${_prefix}-bg-4`,
551
+ 0: `${prefix}-bg-0`,
552
+ 1: `${prefix}-bg-1`,
553
+ 2: `${prefix}-bg-2`,
554
+ 3: `${prefix}-bg-3`,
555
+ 4: `${prefix}-bg-4`,
566
556
  },
567
557
  border: {
568
- 0: `${_prefix}-border-0`,
569
- 1: `${_prefix}-border-1`,
570
- 2: `${_prefix}-border-2`,
571
- 3: `${_prefix}-border-3`,
572
- 4: `${_prefix}-border-4`,
558
+ 0: `${prefix}-border-0`,
559
+ 1: `${prefix}-border-1`,
560
+ 2: `${prefix}-border-2`,
561
+ 3: `${prefix}-border-3`,
562
+ 4: `${prefix}-border-4`,
573
563
  },
574
564
  fg: {
575
- 0: `${_prefix}-fg-0`,
576
- 1: `${_prefix}-fg-1`,
577
- 2: `${_prefix}-fg-2`,
578
- 3: `${_prefix}-fg-3`,
579
- 4: `${_prefix}-fg-4`,
565
+ 0: `${prefix}-fg-0`,
566
+ 1: `${prefix}-fg-1`,
567
+ 2: `${prefix}-fg-2`,
568
+ 3: `${prefix}-fg-3`,
569
+ 4: `${prefix}-fg-4`,
580
570
  },
581
571
  } as ColorVariantVarNames
582
572
 
583
573
  for (const elementTone of THEME_COLOR_STATE_TONES) {
584
- const prefix =
574
+ const _prefix =
585
575
  scheme && tone
586
576
  ? (`--color-${scheme}-${tone}-${variant}-${elementTone}` as const)
587
577
  : tone
@@ -590,25 +580,25 @@ function buildColorVariantVarNames(options: {
590
580
 
591
581
  vars[elementTone] = {
592
582
  bg: {
593
- 0: `${prefix}-bg-0`,
594
- 1: `${prefix}-bg-1`,
595
- 2: `${prefix}-bg-2`,
596
- 3: `${prefix}-bg-3`,
597
- 4: `${prefix}-bg-4`,
583
+ 0: `${_prefix}-bg-0`,
584
+ 1: `${_prefix}-bg-1`,
585
+ 2: `${_prefix}-bg-2`,
586
+ 3: `${_prefix}-bg-3`,
587
+ 4: `${_prefix}-bg-4`,
598
588
  },
599
589
  border: {
600
- 0: `${prefix}-border-0`,
601
- 1: `${prefix}-border-1`,
602
- 2: `${prefix}-border-2`,
603
- 3: `${prefix}-border-3`,
604
- 4: `${prefix}-border-4`,
590
+ 0: `${_prefix}-border-0`,
591
+ 1: `${_prefix}-border-1`,
592
+ 2: `${_prefix}-border-2`,
593
+ 3: `${_prefix}-border-3`,
594
+ 4: `${_prefix}-border-4`,
605
595
  },
606
596
  fg: {
607
- 0: `${prefix}-fg-0`,
608
- 1: `${prefix}-fg-1`,
609
- 2: `${prefix}-fg-2`,
610
- 3: `${prefix}-fg-3`,
611
- 4: `${prefix}-fg-4`,
597
+ 0: `${_prefix}-fg-0`,
598
+ 1: `${_prefix}-fg-1`,
599
+ 2: `${_prefix}-fg-2`,
600
+ 3: `${_prefix}-fg-3`,
601
+ 4: `${_prefix}-fg-4`,
612
602
  },
613
603
  }
614
604
  }
package/src/css/vars.ts CHANGED
@@ -47,9 +47,6 @@ for (const tone of THEME_COLOR_CARD_TONES) {
47
47
  }
48
48
 
49
49
  const colorVars: Vars['color'] = {
50
- accent: {
51
- fg: `var(${varNames.color.accent.fg})`,
52
- },
53
50
  avatar: {
54
51
  bg: `var(${varNames.color.avatar.bg})`,
55
52
  fg: `var(${varNames.color.avatar.fg})`,
@@ -176,6 +173,7 @@ const colorVars: Vars['color'] = {
176
173
  light: lightColorVars,
177
174
  }
178
175
 
176
+ /** @public */
179
177
  export const vars: Vars = {
180
178
  avatar: {
181
179
  distance: `var(${varNames.avatar.distance})`,
@@ -369,9 +367,6 @@ function buildColorCardVars(props: {scheme?: Scheme; tone: CardTone}): ColorCard
369
367
  const prefix = scheme ? varNames.color[scheme][tone] : varNames.color[tone]
370
368
 
371
369
  return {
372
- accent: {
373
- fg: `var(${prefix.accent.fg})`,
374
- },
375
370
  avatar: {
376
371
  ...THEME_COLOR_AVATAR_COLORS.reduce((acc, color) => {
377
372
  return {
@@ -1,3 +1,4 @@
1
+ /** @public */
1
2
  export const HUES = [
2
3
  'gray',
3
4
  'blue',
@@ -10,4 +11,5 @@ export const HUES = [
10
11
  'cyan',
11
12
  ] as const
12
13
 
14
+ /** @public */
13
15
  export const TINTS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950] as const
@@ -1,4 +1,7 @@
1
1
  import {type HUES, type TINTS} from './constants'
2
2
 
3
+ /** @public */
3
4
  export type Hue = (typeof HUES)[number]
5
+
6
+ /** @public */
4
7
  export type Tint = (typeof TINTS)[number]
@@ -3,17 +3,13 @@ import {RootTheme_v0} from './v0/theme'
3
3
  import {RootTheme_v2, Theme_v2} from './v2/theme'
4
4
  import {Theme_v3} from './v3'
5
5
 
6
- /**
7
- * @public
8
- */
6
+ /** @public */
9
7
  export interface RootTheme extends RootTheme_v0 {
10
8
  v2?: RootTheme_v2
11
9
  v3?: Theme_v3
12
10
  }
13
11
 
14
- /**
15
- * @public
16
- */
12
+ /** @public */
17
13
  export type BaseTheme = RootTheme
18
14
 
19
15
  /**
@@ -1,6 +1,4 @@
1
- /**
2
- * @public
3
- */
1
+ /** @public */
4
2
  export interface ThemeFocusRing {
5
3
  offset: number
6
4
  width: number
@@ -1,16 +1,10 @@
1
- /**
2
- * @public
3
- */
1
+ /** @public */
4
2
  export type ThemeFontKey = 'code' | 'heading' | 'label' | 'text'
5
3
 
6
- /**
7
- * @public
8
- */
4
+ /** @public */
9
5
  export type ThemeFontWeightKey = 'regular' | 'medium' | 'semibold' | 'bold'
10
6
 
11
- /**
12
- * @public
13
- */
7
+ /** @public */
14
8
  export interface ThemeFontSize {
15
9
  ascenderHeight: number
16
10
  descenderHeight: number
@@ -20,9 +14,7 @@ export interface ThemeFontSize {
20
14
  lineHeight: number
21
15
  }
22
16
 
23
- /**
24
- * @public
25
- */
17
+ /** @public */
26
18
  export interface ThemeFontWeight {
27
19
  regular: number
28
20
  medium: number
@@ -30,9 +22,7 @@ export interface ThemeFontWeight {
30
22
  bold: number
31
23
  }
32
24
 
33
- /**
34
- * @public
35
- */
25
+ /** @public */
36
26
  export interface ThemeFont {
37
27
  family: string
38
28
  featureSettings?: string
@@ -42,9 +32,7 @@ export interface ThemeFont {
42
32
  horizontalOffset?: number
43
33
  }
44
34
 
45
- /**
46
- * @public
47
- */
35
+ /** @public */
48
36
  export interface ThemeFonts {
49
37
  code: ThemeFont
50
38
  heading: ThemeFont
@@ -1,6 +1,4 @@
1
- /**
2
- * @public
3
- */
1
+ /** @public */
4
2
  export interface ThemeLayer {
5
3
  dialog: {zOffset: number}
6
4
  popover: {zOffset: number}
@@ -1,6 +1,4 @@
1
- /**
2
- * @public
3
- */
1
+ /** @public */
4
2
  export type ThemeBoxShadow = [
5
3
  // offsetX, offsetY, blurRadius, spreadRadius
6
4
  number,
@@ -9,9 +7,7 @@ export type ThemeBoxShadow = [
9
7
  number,
10
8
  ]
11
9
 
12
- /**
13
- * @public
14
- */
10
+ /** @public */
15
11
  export interface ThemeShadow {
16
12
  umbra: ThemeBoxShadow
17
13
  penumbra: ThemeBoxShadow
@@ -1,8 +1,6 @@
1
1
  import {ThemeFocusRing} from '../v0/focusRing'
2
2
 
3
- /**
4
- * @public
5
- */
3
+ /** @public */
6
4
  export interface ThemeAvatar_v2 {
7
5
  sizes: {
8
6
  /** Spacing between avatars in an <AvatarStack> component (px) */
@@ -10,9 +10,7 @@ import {
10
10
  THEME_COLOR_STATES,
11
11
  } from './_constants'
12
12
 
13
- /**
14
- * @public
15
- */
13
+ /** @public */
16
14
  export type ThemeColorSchemeKey = (typeof THEME_COLOR_SCHEMES)[number]
17
15
 
18
16
  /** @public */
@@ -1,15 +1,11 @@
1
1
  import {ThemeColorAvatarColorKey, ThemeColorBlendModeKey} from './_system'
2
2
 
3
- /**
4
- * @public
5
- */
3
+ /** @public */
6
4
  export interface ThemeColorAvatarHue_v2 {
7
5
  _blend?: ThemeColorBlendModeKey
8
6
  bg: string
9
7
  fg: string
10
8
  }
11
9
 
12
- /**
13
- * @public
14
- */
10
+ /** @public */
15
11
  export type ThemeColorAvatar_v2 = Record<ThemeColorAvatarColorKey, ThemeColorAvatarHue_v2>
@@ -1,8 +1,6 @@
1
1
  import {ThemeColorStateToneKey} from './_system'
2
2
 
3
- /**
4
- * @public
5
- */
3
+ /** @public */
6
4
  export interface ThemeColorBadgeTone_v2 {
7
5
  bg: string
8
6
  fg: string
@@ -10,7 +8,5 @@ export interface ThemeColorBadgeTone_v2 {
10
8
  icon: string
11
9
  }
12
10
 
13
- /**
14
- * @public
15
- */
11
+ /** @public */
16
12
  export type ThemeColorBadge_v2 = Record<ThemeColorStateToneKey, ThemeColorBadgeTone_v2>
@@ -1,17 +1,11 @@
1
1
  import {ThemeColorButtonModeKey, ThemeColorStateKey, ThemeColorStateToneKey} from './_system'
2
2
  import {ThemeColorState_v2} from './state'
3
3
 
4
- /**
5
- * @public
6
- */
4
+ /** @public */
7
5
  export type ThemeColorButtonTone_v2 = Record<ThemeColorStateKey, ThemeColorState_v2>
8
6
 
9
- /**
10
- * @public
11
- */
7
+ /** @public */
12
8
  export type ThemeColorButtonMode_v2 = Record<ThemeColorStateToneKey, ThemeColorButtonTone_v2>
13
9
 
14
- /**
15
- * @public
16
- */
10
+ /** @public */
17
11
  export type ThemeColorButton_v2 = Record<ThemeColorButtonModeKey, ThemeColorButtonMode_v2>
@@ -6,9 +6,7 @@ import {ThemeColorShadow} from './shadow'
6
6
  import {ThemeColorState_v2} from './state'
7
7
  import {ThemeColorSyntax} from './syntax'
8
8
 
9
- /**
10
- * @public
11
- */
9
+ /** @public */
12
10
  export interface ThemeColorCard_v2 extends ThemeColorState_v2 {
13
11
  /** @internal */
14
12
  _blend: ThemeColorBlendModeKey
@@ -23,12 +21,8 @@ export interface ThemeColorCard_v2 extends ThemeColorState_v2 {
23
21
  syntax: ThemeColorSyntax
24
22
  }
25
23
 
26
- /**
27
- * @public
28
- */
24
+ /** @public */
29
25
  export type ThemeColorScheme_v2 = Record<ThemeColorCardToneKey, ThemeColorCard_v2>
30
26
 
31
- /**
32
- * @public
33
- */
27
+ /** @public */
34
28
  export type ThemeColorSchemes_v2 = Record<ThemeColorSchemeKey, ThemeColorScheme_v2>
@@ -1,8 +1,6 @@
1
1
  import {ThemeColorBlendModeKey, ThemeColorInputModeKey, ThemeColorInputStateKey} from './_system'
2
2
 
3
- /**
4
- * @public
5
- */
3
+ /** @public */
6
4
  export interface ThemeColorInputState_v2 {
7
5
  _blend?: ThemeColorBlendModeKey
8
6
  bg: string
@@ -14,12 +12,8 @@ export interface ThemeColorInputState_v2 {
14
12
  placeholder: string
15
13
  }
16
14
 
17
- /**
18
- * @public
19
- */
15
+ /** @public */
20
16
  export type ThemeColorInputMode_v2 = Record<ThemeColorInputStateKey, ThemeColorInputState_v2>
21
17
 
22
- /**
23
- * @public
24
- */
18
+ /** @public */
25
19
  export type ThemeColorInput_v2 = Record<ThemeColorInputModeKey, ThemeColorInputMode_v2>