@sanity/ui 4.2.0 → 5.0.0-alpha.10

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 (339) hide show
  1. package/README.md +194 -28
  2. package/bin/sanity-ui.js +14 -0
  3. package/dist/_chunks-es/LazyRefractor.js +20 -0
  4. package/dist/_chunks-es/LazyRefractor.js.map +1 -0
  5. package/dist/cli/checks.js +148 -0
  6. package/dist/cli/config.js +23 -0
  7. package/dist/cli/detect.js +181 -0
  8. package/dist/cli/doctor.js +49 -0
  9. package/dist/cli/index.js +69 -0
  10. package/dist/cli/init.js +189 -0
  11. package/dist/cli/install.js +79 -0
  12. package/dist/cli/log.js +66 -0
  13. package/dist/cli/selfPackage.js +11 -0
  14. package/dist/cli/styles.js +185 -0
  15. package/dist/cli/test-utils.js +8 -0
  16. package/dist/cli/tsconfig.js +236 -0
  17. package/dist/cli/types.js +1 -0
  18. package/dist/cli/versions.js +45 -0
  19. package/dist/index.d.ts +1203 -1469
  20. package/dist/index.js +2123 -1989
  21. package/dist/index.js.map +1 -1
  22. package/dist/polyfills.d.ts +1 -0
  23. package/dist/polyfills.js +5 -0
  24. package/dist/polyfills.js.map +1 -0
  25. package/dist/styles.css +1 -547
  26. package/package.json +57 -58
  27. package/src/cli/checks.test.ts +38 -0
  28. package/src/cli/checks.ts +200 -0
  29. package/src/cli/config.ts +44 -0
  30. package/src/cli/detect.test.ts +191 -0
  31. package/src/cli/detect.ts +205 -0
  32. package/src/cli/doctor.test.ts +52 -0
  33. package/src/cli/doctor.ts +65 -0
  34. package/src/cli/index.ts +77 -0
  35. package/src/cli/init.ts +225 -0
  36. package/src/cli/install.test.ts +52 -0
  37. package/src/cli/install.ts +108 -0
  38. package/src/cli/log.ts +79 -0
  39. package/src/cli/selfPackage.ts +14 -0
  40. package/src/cli/styles.test.ts +130 -0
  41. package/src/cli/styles.ts +205 -0
  42. package/src/cli/test-utils.ts +10 -0
  43. package/src/cli/tsconfig.test.ts +174 -0
  44. package/src/cli/tsconfig.ts +282 -0
  45. package/src/cli/types.ts +77 -0
  46. package/src/cli/versions.test.ts +35 -0
  47. package/src/cli/versions.ts +41 -0
  48. package/src/components/badge/Badge.tsx +53 -0
  49. package/src/components/badge/badge.css +6 -0
  50. package/src/components/badge/badge.props.ts +31 -0
  51. package/src/components/box/Box.tsx +30 -0
  52. package/src/components/box/box.css +4 -0
  53. package/src/components/box/box.props.ts +29 -0
  54. package/src/components/button/Button.tsx +78 -0
  55. package/src/components/button/button.css +72 -0
  56. package/src/components/button/button.props.ts +122 -0
  57. package/src/components/card/Card.tsx +31 -0
  58. package/src/components/card/card.css +4 -0
  59. package/src/components/card/card.props.ts +58 -0
  60. package/src/components/checkbox/Checkbox.tsx +64 -0
  61. package/src/components/checkbox/checkbox.css +100 -0
  62. package/src/components/checkbox/checkbox.props.ts +33 -0
  63. package/src/components/code/Code.tsx +38 -0
  64. package/src/components/code/LazyRefractor.tsx +9 -0
  65. package/src/components/code/code.css +40 -0
  66. package/src/components/code/code.props.ts +44 -0
  67. package/src/components/container/Container.tsx +30 -0
  68. package/src/components/container/container.css +4 -0
  69. package/src/components/container/container.props.ts +28 -0
  70. package/src/components/dialog/Dialog.tsx +139 -0
  71. package/src/components/dialog/dialog.css +49 -0
  72. package/src/components/dialog/dialog.props.ts +45 -0
  73. package/src/components/divider/Divider.tsx +23 -0
  74. package/src/components/divider/divider.props.ts +9 -0
  75. package/src/components/eyebrow/Eyebrow.tsx +54 -0
  76. package/src/components/eyebrow/eyebrow.css +11 -0
  77. package/src/components/eyebrow/eyebrow.props.ts +28 -0
  78. package/src/components/flex/Flex.tsx +30 -0
  79. package/src/components/flex/flex.css +4 -0
  80. package/src/components/flex/flex.props.ts +33 -0
  81. package/src/components/grid/Grid.tsx +30 -0
  82. package/src/components/grid/grid.css +4 -0
  83. package/src/components/grid/grid.props.ts +33 -0
  84. package/src/components/h-stack/HStack.tsx +34 -0
  85. package/src/components/h-stack/hStack.props.ts +17 -0
  86. package/src/components/heading/Heading.tsx +54 -0
  87. package/src/components/heading/heading.css +9 -0
  88. package/src/components/heading/heading.props.ts +31 -0
  89. package/src/components/icon/Icon.tsx +24 -0
  90. package/src/components/icon/icon.css +17 -0
  91. package/src/components/icon/icon.props.ts +35 -0
  92. package/src/components/icon-button/IconButton.tsx +32 -0
  93. package/src/components/icon-button/iconButton.props.ts +31 -0
  94. package/src/components/index.css +28 -0
  95. package/src/components/indicator/Indicator.tsx +42 -0
  96. package/src/components/indicator/indicator.css +4 -0
  97. package/src/components/indicator/indicator.props.ts +24 -0
  98. package/src/components/indicator-stack/IndicatorStack.tsx +31 -0
  99. package/src/components/indicator-stack/indicator-stack.css +7 -0
  100. package/src/components/indicator-stack/indicatorStack.props.ts +15 -0
  101. package/src/components/inline/Inline.tsx +38 -0
  102. package/src/components/inline/inline.css +4 -0
  103. package/src/components/inline/inline.props.ts +100 -0
  104. package/src/components/label/Label.tsx +34 -0
  105. package/src/components/label/label.css +3 -0
  106. package/src/components/label/label.props.ts +25 -0
  107. package/src/components/link/Link.tsx +29 -0
  108. package/src/components/link/link.css +12 -0
  109. package/src/components/link/link.props.ts +23 -0
  110. package/src/components/list/List.tsx +167 -0
  111. package/src/components/list/list.css +25 -0
  112. package/src/components/list/list.props.ts +130 -0
  113. package/src/components/popover/Popover.tsx +85 -0
  114. package/src/components/popover/popover.css +21 -0
  115. package/src/components/popover/popover.props.ts +38 -0
  116. package/src/components/press-area/PressArea.tsx +29 -0
  117. package/src/components/press-area/press-area.css +22 -0
  118. package/src/components/press-area/pressArea.props.ts +16 -0
  119. package/src/components/radio/Radio.tsx +48 -0
  120. package/src/components/radio/radio.css +97 -0
  121. package/src/components/radio/radio.props.ts +25 -0
  122. package/src/components/skip-to-content/SkipToContent.tsx +35 -0
  123. package/src/components/skip-to-content/skip-to-content.css +9 -0
  124. package/src/components/skip-to-content/skipToContent.props.ts +25 -0
  125. package/src/components/spinner/Spinner.tsx +28 -0
  126. package/src/components/spinner/spinner.css +10 -0
  127. package/src/components/spinner/spinner.props.ts +19 -0
  128. package/src/components/switch/Switch.tsx +48 -0
  129. package/src/components/switch/switch.css +119 -0
  130. package/src/components/switch/switch.props.ts +25 -0
  131. package/src/components/text/Text.tsx +53 -0
  132. package/src/components/text/text.css +9 -0
  133. package/src/components/text/text.props.ts +28 -0
  134. package/src/components/tooltip/Tooltip.tsx +97 -0
  135. package/src/components/tooltip/tooltip.css +31 -0
  136. package/src/components/tooltip/tooltip.props.ts +36 -0
  137. package/src/components/tooltip-group/TooltipGroup.tsx +64 -0
  138. package/src/components/tooltip-group/tooltipGroup.props.ts +15 -0
  139. package/src/components/v-stack/VStack.tsx +32 -0
  140. package/src/components/v-stack/vStack.props.ts +17 -0
  141. package/src/components/visually-hidden/VisuallyHidden.tsx +29 -0
  142. package/src/components/visually-hidden/visually-hidden.css +9 -0
  143. package/src/components/visually-hidden/visuallyHidden.props.ts +23 -0
  144. package/src/css/classes/dynamic/flex-child.css +5 -0
  145. package/src/css/classes/dynamic/grid-child.css +8 -0
  146. package/src/css/classes/dynamic/grid-parent.css +6 -0
  147. package/src/css/classes/dynamic/height.css +5 -0
  148. package/src/css/classes/dynamic/index.css +7 -0
  149. package/src/css/classes/dynamic/line-clamp.css +5 -0
  150. package/src/css/classes/dynamic/readme.md +3 -0
  151. package/src/css/classes/dynamic/width.css +7 -0
  152. package/src/css/classes/dynamic/z-index.css +3 -0
  153. package/src/css/classes/generic/display.css +10 -0
  154. package/src/css/classes/generic/flex.css +24 -0
  155. package/src/css/classes/generic/grid.css +7 -0
  156. package/src/css/classes/generic/index.css +7 -0
  157. package/src/css/classes/generic/overflow.css +19 -0
  158. package/src/css/classes/generic/placement.css +202 -0
  159. package/src/css/classes/generic/position.css +7 -0
  160. package/src/css/classes/generic/readme.md +3 -0
  161. package/src/css/classes/generic/text-align.css +5 -0
  162. package/src/css/classes/index.css +4 -0
  163. package/src/css/classes/local/animation.css +4 -0
  164. package/src/css/classes/local/border.css +20 -0
  165. package/src/css/classes/local/index.css +6 -0
  166. package/src/css/classes/local/readme.md +3 -0
  167. package/src/css/classes/local/text-overflow.css +5 -0
  168. package/src/css/classes/local/text-trim.css +45 -0
  169. package/src/css/classes/local/tone.css +75 -0
  170. package/src/css/classes/local/top-anchor.css +4 -0
  171. package/src/css/classes/system/color.css +223 -0
  172. package/src/css/classes/system/container.css +8 -0
  173. package/src/css/classes/system/font-family.css +2 -0
  174. package/src/css/classes/system/font-weight.css +4 -0
  175. package/src/css/classes/system/gap.css +37 -0
  176. package/src/css/classes/system/index.css +10 -0
  177. package/src/css/classes/system/inset.css +56 -0
  178. package/src/css/classes/system/margin.css +148 -0
  179. package/src/css/classes/system/padding.css +78 -0
  180. package/src/css/classes/system/radius.css +10 -0
  181. package/src/css/classes/system/readme.md +3 -0
  182. package/src/css/classes/system/shadow.css +6 -0
  183. package/src/css/classes/system/typography.css +31 -0
  184. package/src/css/global/font-face.css +20 -0
  185. package/src/css/global/index.css +2 -0
  186. package/src/css/global/reset.css +76 -0
  187. package/src/css/tokens/index.css +3 -0
  188. package/src/css/tokens/opacity.css +6 -0
  189. package/src/css/tokens/semantic.css +25 -0
  190. package/src/css/tokens/surface.css +27 -0
  191. package/src/hooks/useIsClient.ts +10 -0
  192. package/src/index.css +18 -0
  193. package/src/index.ts +65 -0
  194. package/src/polyfills.ts +15 -0
  195. package/src/props/border.ts +51 -0
  196. package/src/props/flexChild.ts +29 -0
  197. package/src/props/flexParent.ts +47 -0
  198. package/src/props/gap.ts +31 -0
  199. package/src/props/gridChild.ts +50 -0
  200. package/src/props/gridParent.ts +45 -0
  201. package/src/props/height.ts +29 -0
  202. package/src/props/layout.ts +44 -0
  203. package/src/props/margin.ts +59 -0
  204. package/src/props/overflow.ts +30 -0
  205. package/src/props/padding.ts +59 -0
  206. package/src/props/placement.ts +16 -0
  207. package/src/props/position.ts +52 -0
  208. package/src/props/shadow.ts +15 -0
  209. package/src/props/tone.ts +15 -0
  210. package/src/props/typography.ts +62 -0
  211. package/src/props/width.ts +29 -0
  212. package/src/props/zIndex.ts +15 -0
  213. package/src/styles.css.d.ts +1 -0
  214. package/src/styles.css.node.js +2 -0
  215. package/src/styles.css.test.ts +24 -0
  216. package/src/types/Button.ts +8 -0
  217. package/src/types/Code.ts +6 -0
  218. package/src/types/Container.ts +3 -0
  219. package/src/types/Density.ts +3 -0
  220. package/src/types/Display.ts +11 -0
  221. package/src/types/Eyebrow.ts +3 -0
  222. package/src/types/Flex.ts +22 -0
  223. package/src/types/FontWeight.ts +3 -0
  224. package/src/types/Grid.ts +3 -0
  225. package/src/types/Heading.ts +6 -0
  226. package/src/types/Icon.ts +3 -0
  227. package/src/types/Interactive.ts +8 -0
  228. package/src/types/List.ts +2 -0
  229. package/src/types/Overflow.ts +3 -0
  230. package/src/types/Placement.ts +16 -0
  231. package/src/types/Position.ts +3 -0
  232. package/src/types/PropDef.ts +73 -0
  233. package/src/types/Radius.ts +3 -0
  234. package/src/types/Responsive.ts +10 -0
  235. package/src/types/Shadow.ts +3 -0
  236. package/src/types/Space.ts +15 -0
  237. package/src/types/Text.ts +3 -0
  238. package/src/types/TextAlign.ts +3 -0
  239. package/src/types/Tone.ts +3 -0
  240. package/src/utils/getProps.test.ts +156 -0
  241. package/src/utils/getProps.ts +156 -0
  242. package/src/utils/mergeTriggerProps.ts +66 -0
  243. package/src/utils/renderPortal.tsx +14 -0
  244. package/src/utils/suffixClassName.ts +5 -0
  245. package/src/version.ts +3 -0
  246. package/LICENSE +0 -21
  247. package/dist/_system-CTe2lb5l.d.ts +0 -40
  248. package/dist/_system-CTe2lb5l.d.ts.map +0 -1
  249. package/dist/arrow-BmX6qbAS.js +0 -170
  250. package/dist/arrow-BmX6qbAS.js.map +0 -1
  251. package/dist/autocomplete.d.ts +0 -140
  252. package/dist/autocomplete.d.ts.map +0 -1
  253. package/dist/autocomplete.js +0 -470
  254. package/dist/autocomplete.js.map +0 -1
  255. package/dist/breadcrumbs.d.ts +0 -18
  256. package/dist/breadcrumbs.d.ts.map +0 -1
  257. package/dist/breadcrumbs.js +0 -119
  258. package/dist/breadcrumbs.js.map +0 -1
  259. package/dist/button-BNyKSDyA.js +0 -180
  260. package/dist/button-BNyKSDyA.js.map +0 -1
  261. package/dist/button-dnqMFkWg.d.ts +0 -76
  262. package/dist/button-dnqMFkWg.d.ts.map +0 -1
  263. package/dist/card-C0a0wQTc.d.ts +0 -7
  264. package/dist/card-C0a0wQTc.d.ts.map +0 -1
  265. package/dist/code.d.ts +0 -20
  266. package/dist/code.d.ts.map +0 -1
  267. package/dist/code.js +0 -90
  268. package/dist/code.js.map +0 -1
  269. package/dist/codeFontStyle-84SMhFtI.js +0 -11
  270. package/dist/codeFontStyle-84SMhFtI.js.map +0 -1
  271. package/dist/component-DVlwaWB-.d.ts +0 -25
  272. package/dist/component-DVlwaWB-.d.ts.map +0 -1
  273. package/dist/element-BYgCE_iK.js +0 -51
  274. package/dist/element-BYgCE_iK.js.map +0 -1
  275. package/dist/factory-BzXTX8_Q.js +0 -3056
  276. package/dist/factory-BzXTX8_Q.js.map +0 -1
  277. package/dist/flex-DmbDG2ks.js +0 -76
  278. package/dist/flex-DmbDG2ks.js.map +0 -1
  279. package/dist/font-EtfxKPUz.d.ts +0 -49
  280. package/dist/font-EtfxKPUz.d.ts.map +0 -1
  281. package/dist/getElementRef-Jw7gY0eV.js +0 -102
  282. package/dist/getElementRef-Jw7gY0eV.js.map +0 -1
  283. package/dist/getScopedTheme-C-sZsyAz.js +0 -267
  284. package/dist/getScopedTheme-C-sZsyAz.js.map +0 -1
  285. package/dist/getTheme_v2-y09KqtEb.js +0 -487
  286. package/dist/getTheme_v2-y09KqtEb.js.map +0 -1
  287. package/dist/grid-6JSgMj1O.js +0 -115
  288. package/dist/grid-6JSgMj1O.js.map +0 -1
  289. package/dist/helpers-C8xxXAQC.js +0 -63
  290. package/dist/helpers-C8xxXAQC.js.map +0 -1
  291. package/dist/hotkeys-CaHsQlsO.js +0 -168
  292. package/dist/hotkeys-CaHsQlsO.js.map +0 -1
  293. package/dist/index.d.ts.map +0 -1
  294. package/dist/layer-Bl5R3uNR.js +0 -61
  295. package/dist/layer-Bl5R3uNR.js.map +0 -1
  296. package/dist/layer-ChlP9Ik6.d.ts +0 -242
  297. package/dist/layer-ChlP9Ik6.d.ts.map +0 -1
  298. package/dist/menu.d.ts +0 -146
  299. package/dist/menu.d.ts.map +0 -1
  300. package/dist/menu.js +0 -626
  301. package/dist/menu.js.map +0 -1
  302. package/dist/popover-B7-28L8y.js +0 -408
  303. package/dist/popover-B7-28L8y.js.map +0 -1
  304. package/dist/popover-CMlQeKn0.d.ts +0 -96
  305. package/dist/popover-CMlQeKn0.d.ts.map +0 -1
  306. package/dist/popover.d.ts +0 -2
  307. package/dist/popover.js +0 -3
  308. package/dist/refractor-CC48DwHi.js +0 -20
  309. package/dist/refractor-CC48DwHi.js.map +0 -1
  310. package/dist/responsiveFont-CilwaORG.js +0 -55
  311. package/dist/responsiveFont-CilwaORG.js.map +0 -1
  312. package/dist/rgba-BSYaEUW6.d.ts +0 -846
  313. package/dist/rgba-BSYaEUW6.d.ts.map +0 -1
  314. package/dist/selectable-B0GUIL74.d.ts +0 -7
  315. package/dist/selectable-B0GUIL74.d.ts.map +0 -1
  316. package/dist/stack-rsNFPq2-.js +0 -112
  317. package/dist/stack-rsNFPq2-.js.map +0 -1
  318. package/dist/styles-css.d.ts +0 -2
  319. package/dist/styles-css.js +0 -4
  320. package/dist/textInput-pSfQjkmx.js +0 -313
  321. package/dist/textInput-pSfQjkmx.js.map +0 -1
  322. package/dist/theme.d.ts +0 -280
  323. package/dist/theme.d.ts.map +0 -1
  324. package/dist/theme.js +0 -55
  325. package/dist/theme.js.map +0 -1
  326. package/dist/toast.d.ts +0 -73
  327. package/dist/toast.d.ts.map +0 -1
  328. package/dist/toast.js +0 -302
  329. package/dist/toast.js.map +0 -1
  330. package/dist/tooltip.d.ts +0 -88
  331. package/dist/tooltip.d.ts.map +0 -1
  332. package/dist/tooltip.js +0 -435
  333. package/dist/tooltip.js.map +0 -1
  334. package/dist/useClickOutsideEvent-wGLGWBZN.js +0 -36
  335. package/dist/useClickOutsideEvent-wGLGWBZN.js.map +0 -1
  336. package/dist/useElementSize-BJvbGHq8.js +0 -51
  337. package/dist/useElementSize-BJvbGHq8.js.map +0 -1
  338. package/dist/useLayer-D1usxIE0.js +0 -712
  339. package/dist/useLayer-D1usxIE0.js.map +0 -1
package/dist/theme.d.ts DELETED
@@ -1,280 +0,0 @@
1
- import { _ as THEME_COLOR_STATES, a as ThemeColorInputModeKey, c as ThemeColorStateKey, d as THEME_COLOR_BLEND_MODES, f as THEME_COLOR_BUTTON_MODES, g as THEME_COLOR_SCHEMES, h as THEME_COLOR_INPUT_STATES, i as ThemeColorCardToneKey, l as ThemeColorStateToneKey, m as THEME_COLOR_INPUT_MODES, n as ThemeColorBlendModeKey, o as ThemeColorInputStateKey, p as THEME_COLOR_CARD_TONES, r as ThemeColorButtonModeKey, s as ThemeColorSchemeKey, t as ThemeColorAvatarColorKey, u as THEME_COLOR_AVATAR_COLORS, v as THEME_COLOR_STATE_TONES } from "./_system-CTe2lb5l.js";
2
- import { a as ThemeFontWeightKey, i as ThemeFontWeight, n as ThemeFontKey, o as ThemeFonts, r as ThemeFontSize, t as ThemeFont } from "./font-EtfxKPUz.js";
3
- import { $ as ThemeColorInputState_v2, A as ThemeColorMutedTone, B as ThemeColorBase, C as ThemeColorSpotKey, D as ThemeColorSelectableState, E as ThemeColorSelectable, F as ThemeColorCardState, G as ThemeInput_v2, H as ThemeColorToneKey, I as ThemeColorButton, J as ThemeColorSchemes_v2, K as ThemeColorCard_v2, L as ThemeColorButtonState, M as ThemeColorInputState, N as ThemeColorInputStates, O as ThemeColorSelectableStates, P as ThemeColorCard, Q as ThemeColorInputMode_v2, R as ThemeColorButtonStates, S as ThemeColorSpot, T as ThemeColorSolidTone, U as ThemeColorGenericState, V as ThemeColorName, W as ThemeAvatar, X as ThemeColorSelectableTone_v2, Y as ThemeColorShadow, Z as ThemeColorSelectable_v2, _ as Theme_v2, _t as ThemeColorSyntax, a as rgbToHex, at as ThemeColorKBD, b as ThemeColorScheme, bt as RGBA, c as screen, ct as ThemeColorAvatarHue_v2, d as ThemeColorBuilderOpts, dt as ThemeFocusRing, et as ThemeColorInput_v2, f as createColorTheme, ft as ThemeStyles, g as Theme, gt as ThemeLayer, h as RootTheme_v2, ht as ThemeShadow, i as hslToRgb, it as ThemeColorState_v2, j as ThemeColorInput, k as ThemeColorMuted, l as multiply, lt as ThemeColorAvatar_v2, m as RootTheme, mt as ThemeBoxShadow, n as parseColor, nt as ThemeColorButtonTone_v2, o as rgbToHsl, ot as ThemeColorBadgeTone_v2, p as BaseTheme, pt as CSSObject, q as ThemeColorScheme_v2, r as hexToRgb, rt as ThemeColorButton_v2, s as rgbaToRGBA, st as ThemeColorBadge_v2, t as rgba, tt as ThemeColorButtonMode_v2, u as PartialThemeColorBuilderOpts, ut as ThemeAvatar_v2, v as ThemeInput, vt as HSL, w as ThemeColorSolid, x as ThemeColorSchemes, y as ThemeColor, yt as RGB, z as ThemeColorButtonTones } from "./rgba-BSYaEUW6.js";
4
- import { ColorHueKey, ColorTint, ColorTintKey } from "@sanity/color";
5
- /** @public */
6
- export declare const COLOR_CONFIG_STATE_KEYS: readonly ['_hue', 'bg', 'fg', 'border', 'focusRing', 'muted/fg', 'accent/fg', 'link/fg', 'code/bg', 'code/fg', 'skeleton/from', 'skeleton/to', 'status/dot', 'status/icon'];
7
- /** @public */
8
- type ColorConfigStateKey = (typeof COLOR_CONFIG_STATE_KEYS)[number];
9
- /** @public */
10
- export declare const COLOR_CONFIG_CARD_KEYS: readonly ["_hue", "bg", "fg", "border", "focusRing", "muted/fg", "accent/fg", "link/fg", "code/bg", "code/fg", "skeleton/from", "skeleton/to", "status/dot", "status/icon", "_hue", "bg", "fg", "border", "focusRing", "shadow/outline", "shadow/umbra", "shadow/penumbra", "shadow/ambient"];
11
- /** @public */
12
- type ColorConfigCardKey = (typeof COLOR_CONFIG_CARD_KEYS)[number];
13
- /** @public */
14
- export declare const COLOR_CONFIG_BLEND_KEYS: readonly ['_blend'];
15
- /** @public */
16
- type ColorConfigBlendKey = (typeof COLOR_CONFIG_BLEND_KEYS)[number];
17
- /** @public */
18
- type ColorConfigOpacityValue = `0` | `0.${number}` | `1`;
19
- /** @public */
20
- type ColorConfigValue = `black` | `white` | `black/${ColorConfigOpacityValue}` | `white/${ColorConfigOpacityValue}` | `${ColorHueKey}` | `${ColorHueKey} ${number}%` | `${ColorHueKey}/${ColorTintKey}` | `${ColorHueKey}/${ColorTintKey} ${number}%` | `${ColorHueKey}/${ColorTintKey}/${ColorConfigOpacityValue}` | `${ColorTintKey}` | `${ColorTintKey} ${number}%` | `${ColorTintKey}/${ColorConfigOpacityValue}`;
21
- /** @public */
22
- type ThemeColorTokenValue = [ColorConfigValue, ColorConfigValue];
23
- /** @public */
24
- type ColorBlendModeTokenValue = [ThemeColorBlendModeKey, ThemeColorBlendModeKey];
25
- /** @public */
26
- export declare const COLOR_CONFIG_AVATAR_COLORS: readonly ["*", ...ColorHueKey[]];
27
- /** @public */
28
- type ColorConfigAvatarColor = (typeof COLOR_CONFIG_AVATAR_COLORS)[number];
29
- /** @public */
30
- export declare const COLOR_CONFIG_CARD_TONES: readonly ["*", "transparent", "default", "neutral", "primary", "suggest", "positive", "caution", "critical"];
31
- /** @public */
32
- type ColorConfigCardTone = (typeof COLOR_CONFIG_CARD_TONES)[number];
33
- /** @public */
34
- export declare const COLOR_CONFIG_STATE_TONES: readonly ["*", "default", "neutral", "primary", "suggest", "positive", "caution", "critical"];
35
- /** @public */
36
- type ColorConfigStateTone = (typeof COLOR_CONFIG_STATE_TONES)[number];
37
- /** @public */
38
- export declare const COLOR_CONFIG_STATES: readonly ["*", "enabled", "hovered", "pressed", "selected", "disabled"];
39
- /** @public */
40
- type ColorConfigState = (typeof COLOR_CONFIG_STATES)[number];
41
- /** @public */
42
- export declare const COLOR_CONFIG_INPUT_MODES: readonly ["*", "default", "invalid"];
43
- /** @public */
44
- type ColorConfigInputMode = (typeof COLOR_CONFIG_INPUT_MODES)[number];
45
- /** @public */
46
- export declare const COLOR_CONFIG_INPUT_STATES: readonly ["*", "enabled", "hovered", "readOnly", "disabled"];
47
- /** @public */
48
- type ColorConfigInputState = (typeof COLOR_CONFIG_INPUT_STATES)[number];
49
- /** @public */
50
- interface ThemeColorAvatarHueTokens {
51
- _blend?: ColorBlendModeTokenValue;
52
- _hue?: ColorHueKey;
53
- bg?: ThemeColorTokenValue;
54
- fg?: ThemeColorTokenValue;
55
- }
56
- /** @public */
57
- interface ThemeColorAvatarTokens {
58
- '*'?: ThemeColorAvatarHueTokens;
59
- 'gray'?: ThemeColorAvatarHueTokens;
60
- 'blue'?: ThemeColorAvatarHueTokens;
61
- 'purple'?: ThemeColorAvatarHueTokens;
62
- 'magenta'?: ThemeColorAvatarHueTokens;
63
- 'red'?: ThemeColorAvatarHueTokens;
64
- 'orange'?: ThemeColorAvatarHueTokens;
65
- 'yellow'?: ThemeColorAvatarHueTokens;
66
- 'green'?: ThemeColorAvatarHueTokens;
67
- 'cyan'?: ThemeColorAvatarHueTokens;
68
- }
69
- /** @public */
70
- interface ThemeColorBaseTokens extends ThemeColorStateTokens {
71
- focusRing?: ThemeColorTokenValue;
72
- backdrop?: ThemeColorTokenValue;
73
- shadow?: {
74
- outline?: ThemeColorTokenValue;
75
- umbra?: ThemeColorTokenValue;
76
- penumbra?: ThemeColorTokenValue;
77
- ambient?: ThemeColorTokenValue;
78
- };
79
- }
80
- /** @public */
81
- interface ThemeColorBadgeToneTokens {
82
- _blend?: ColorBlendModeTokenValue;
83
- _hue?: ColorHueKey;
84
- bg?: ThemeColorTokenValue;
85
- dot?: ThemeColorTokenValue;
86
- fg?: ThemeColorTokenValue;
87
- icon?: ThemeColorTokenValue;
88
- }
89
- /** @public */
90
- type ThemeColorBadgeTokens = Partial<Record<'*' | ThemeColorStateToneKey, ThemeColorBadgeToneTokens>>;
91
- /** @public */
92
- interface ThemeColorStateTokens {
93
- _blend?: ColorBlendModeTokenValue;
94
- _hue?: ColorHueKey;
95
- accent?: {
96
- fg?: ThemeColorTokenValue;
97
- };
98
- avatar?: ThemeColorAvatarTokens;
99
- badge?: ThemeColorBadgeTokens;
100
- bg?: ThemeColorTokenValue;
101
- border?: ThemeColorTokenValue;
102
- code?: {
103
- bg?: ThemeColorTokenValue;
104
- fg?: ThemeColorTokenValue;
105
- };
106
- fg?: ThemeColorTokenValue;
107
- icon?: ThemeColorTokenValue;
108
- kbd?: {
109
- bg?: ThemeColorTokenValue;
110
- fg?: ThemeColorTokenValue;
111
- border?: ThemeColorTokenValue;
112
- };
113
- link?: {
114
- fg?: ThemeColorTokenValue;
115
- };
116
- muted?: {
117
- bg?: ThemeColorTokenValue;
118
- fg?: ThemeColorTokenValue;
119
- };
120
- skeleton?: {
121
- from?: ThemeColorTokenValue;
122
- to?: ThemeColorTokenValue;
123
- };
124
- }
125
- /** @public */
126
- type ThemeColorStatesTokens = Partial<Record<ColorConfigState, ThemeColorStateTokens>>;
127
- /** @public */
128
- interface ThemeColorButtonTokens extends Partial<Record<ColorConfigStateTone, ThemeColorStatesTokens>> {
129
- _hue?: ColorHueKey;
130
- }
131
- /** @public */
132
- interface ThemeColorInputStateTokens {
133
- _blend?: ColorBlendModeTokenValue;
134
- _hue?: ColorHueKey;
135
- bg?: ThemeColorTokenValue;
136
- border?: ThemeColorTokenValue;
137
- fg?: ThemeColorTokenValue;
138
- muted?: {
139
- bg?: ThemeColorTokenValue;
140
- };
141
- placeholder?: ThemeColorTokenValue;
142
- }
143
- /** @public */
144
- interface ThemeColorInputTokens extends Partial<Record<ColorConfigInputState, ThemeColorInputStateTokens>> {
145
- _hue?: ColorHueKey;
146
- }
147
- /** @public */
148
- interface ThemeColorTokens {
149
- base?: Partial<Record<ColorConfigCardTone, ThemeColorBaseTokens>>;
150
- button?: Partial<Record<ThemeColorButtonModeKey, ThemeColorButtonTokens>>;
151
- input?: Partial<Record<ColorConfigInputMode, ThemeColorInputTokens>>;
152
- selectable?: Partial<Record<ColorConfigStateTone, {
153
- _hue?: ColorHueKey;
154
- } & ThemeColorStatesTokens>>;
155
- syntax?: Partial<Record<keyof ThemeColorSyntax, ThemeColorTokenValue>>;
156
- }
157
- /** @public */
158
- type ThemeColorPalette = {
159
- black: string | ColorTint;
160
- white: string | ColorTint;
161
- } & Record<ColorHueKey, Record<ColorTintKey, string | ColorTint>>;
162
- /** @public */
163
- interface ThemeConfig {
164
- avatar?: ThemeAvatar_v2;
165
- button?: {
166
- border: {
167
- width: number;
168
- };
169
- focusRing: ThemeFocusRing;
170
- textWeight: ThemeFontWeightKey;
171
- };
172
- card?: {
173
- border: {
174
- width: number;
175
- };
176
- focusRing: ThemeFocusRing;
177
- shadow: {
178
- outline: number;
179
- };
180
- };
181
- color?: ThemeColorTokens;
182
- container?: number[];
183
- font?: ThemeFonts;
184
- input?: ThemeInput_v2;
185
- layer?: ThemeLayer;
186
- media?: number[];
187
- palette?: ThemeColorPalette;
188
- radius?: number[];
189
- shadow?: Array<ThemeShadow | null>;
190
- space?: number[];
191
- /** @internal */
192
- style?: ThemeStyles;
193
- }
194
- /** @internal */
195
- export declare function buildTheme(config?: ThemeConfig): RootTheme;
196
- /**
197
- * Apply the \`mix\` blend mode
198
- * @internal
199
- */
200
- export declare function mix(b: RGB | RGBA, s: RGB | RGBA, weight: number): RGB;
201
- /** @internal */
202
- export declare function getContrastRatio(bg: string, fg: string): number;
203
- /** @internal */
204
- export declare function isColorConfigBaseTone(str: string): str is ColorConfigCardTone;
205
- /** @internal */
206
- export declare function isColorConfigBaseKey(str: string): str is ColorConfigCardKey;
207
- /** @internal */
208
- export declare function isColorConfigStateKey(str: string): str is ColorConfigStateKey;
209
- /** @internal */
210
- export declare function isColorConfigStateTone(str: string): str is ColorConfigStateTone;
211
- /** @internal */
212
- export declare function isColorConfigBlendKey(str: string): str is ColorConfigBlendKey;
213
- /** @internal */
214
- export declare function isColorTokenValue(str: string): str is ColorConfigValue;
215
- /** @internal */
216
- export declare function isColorValue(str: string): str is 'black' | 'white';
217
- /** @internal */
218
- export declare function isColorOpacityValue(str: string): str is ColorConfigOpacityValue;
219
- /** @internal */
220
- interface TokenBaseKeyNode {
221
- type: 'base';
222
- tone: ColorConfigCardTone;
223
- key: ColorConfigCardKey | ColorConfigBlendKey;
224
- }
225
- /** @internal */
226
- interface TokenButtonKeyNode {
227
- type: 'button';
228
- tone: ColorConfigStateTone;
229
- mode: ThemeColorButtonModeKey;
230
- key: ColorConfigStateKey | ColorConfigBlendKey;
231
- }
232
- /** @internal */
233
- type TokenKeyNode = TokenBaseKeyNode | TokenButtonKeyNode;
234
- /** @internal */
235
- interface TokenColorValueNode {
236
- type: 'color';
237
- key?: 'black' | 'white';
238
- hue?: ColorHueKey;
239
- mix?: number;
240
- opacity?: number;
241
- tint?: ColorTintKey;
242
- }
243
- /** @internal */
244
- interface TokenHueValueNode {
245
- type: 'hue';
246
- value?: ColorHueKey;
247
- }
248
- /** @internal */
249
- interface TokenBlendModeValueNode {
250
- type: 'blendMode';
251
- value?: ThemeColorBlendModeKey;
252
- }
253
- /** @internal */
254
- type TokenValueNode = TokenColorValueNode | TokenHueValueNode | TokenBlendModeValueNode;
255
- /** @internal */
256
- export declare function parseTokenKey(str: string): TokenKeyNode | undefined;
257
- /** @internal */
258
- export declare function parseTokenValue(str: string): TokenValueNode | undefined;
259
- /** @internal */
260
- export declare function getScopedTheme(themeProp: RootTheme | RootTheme_v2, scheme: ThemeColorSchemeKey, tone: ThemeColorCardToneKey): Theme;
261
- /** @internal */
262
- export declare function isColorBlendModeValue(str: string): str is ThemeColorBlendModeKey;
263
- /** @internal */
264
- export declare function isColorHueKey(str: string): str is ColorHueKey;
265
- /** @internal */
266
- export declare function isColorTintKey(str: string): str is ColorTintKey;
267
- /** @internal */
268
- export declare function isColorButtonMode(str: string): str is ThemeColorButtonModeKey;
269
- /** @public */
270
- export declare function getTheme_v2(theme: Theme): Theme_v2;
271
- /** @internal */
272
- export declare function is_v0(themeProp: RootTheme | RootTheme_v2): themeProp is RootTheme;
273
- /** @internal */
274
- export declare function is_v2(themeProp: RootTheme | RootTheme_v2): themeProp is RootTheme_v2;
275
- /** @internal */
276
- export declare function v0_v2(v0: RootTheme): RootTheme_v2;
277
- /** @internal */
278
- export declare function v2_v0(v2: RootTheme_v2): RootTheme;
279
- export { type BaseTheme, type CSSObject, type ColorBlendModeTokenValue, type ColorConfigAvatarColor, type ColorConfigBlendKey, type ColorConfigCardKey, type ColorConfigCardTone, type ColorConfigInputMode, type ColorConfigInputState, type ColorConfigOpacityValue, type ColorConfigState, type ColorConfigStateKey, type ColorConfigStateTone, type ColorConfigValue, type HSL, type PartialThemeColorBuilderOpts, type RGB, type RGBA, type RootTheme, type RootTheme_v2, THEME_COLOR_AVATAR_COLORS, THEME_COLOR_BLEND_MODES, THEME_COLOR_BUTTON_MODES, THEME_COLOR_CARD_TONES, THEME_COLOR_INPUT_MODES, THEME_COLOR_INPUT_STATES, THEME_COLOR_SCHEMES, THEME_COLOR_STATES, THEME_COLOR_STATE_TONES, type Theme, type ThemeAvatar, type ThemeAvatar_v2, type ThemeBoxShadow, type ThemeColor, type ThemeColorAvatarColorKey, type ThemeColorAvatarHueTokens, type ThemeColorAvatarHue_v2, type ThemeColorAvatarTokens, type ThemeColorAvatar_v2, type ThemeColorBadgeTokens, type ThemeColorBadgeToneTokens, type ThemeColorBadgeTone_v2, type ThemeColorBadge_v2, type ThemeColorBase, type ThemeColorBaseTokens, type ThemeColorBlendModeKey, type ThemeColorBuilderOpts, type ThemeColorButton, type ThemeColorButtonModeKey, type ThemeColorButtonMode_v2, type ThemeColorButtonState, type ThemeColorButtonStates, type ThemeColorButtonTokens, type ThemeColorButtonTone_v2, type ThemeColorButtonTones, type ThemeColorButton_v2, type ThemeColorCard, type ThemeColorCardState, type ThemeColorCardToneKey, type ThemeColorCard_v2, type ThemeColorGenericState, type ThemeColorInput, type ThemeColorInputModeKey, type ThemeColorInputMode_v2, type ThemeColorInputState, type ThemeColorInputStateKey, type ThemeColorInputStateTokens, type ThemeColorInputState_v2, type ThemeColorInputStates, type ThemeColorInputTokens, type ThemeColorInput_v2, type ThemeColorKBD, type ThemeColorMuted, type ThemeColorMutedTone, type ThemeColorName, type ThemeColorPalette, type ThemeColorScheme, type ThemeColorSchemeKey, type ThemeColorScheme_v2, type ThemeColorSchemes, type ThemeColorSchemes_v2, type ThemeColorSelectable, type ThemeColorSelectableState, type ThemeColorSelectableStates, type ThemeColorSelectableTone_v2, type ThemeColorSelectable_v2, type ThemeColorShadow, type ThemeColorSolid, type ThemeColorSolidTone, type ThemeColorSpot, type ThemeColorSpotKey, type ThemeColorStateKey, type ThemeColorStateTokens, type ThemeColorStateToneKey, type ThemeColorState_v2, type ThemeColorStatesTokens, type ThemeColorSyntax, type ThemeColorTokenValue, type ThemeColorTokens, type ThemeColorToneKey, type ThemeConfig, type ThemeFocusRing, type ThemeFont, type ThemeFontKey, type ThemeFontSize, type ThemeFontWeight, type ThemeFontWeightKey, type ThemeFonts, type ThemeInput, type ThemeInput_v2, type ThemeLayer, type ThemeShadow, type ThemeStyles, type Theme_v2, type TokenBaseKeyNode, type TokenBlendModeValueNode, type TokenButtonKeyNode, type TokenColorValueNode, type TokenHueValueNode, type TokenKeyNode, type TokenValueNode, createColorTheme, hexToRgb, hslToRgb, multiply, parseColor, rgbToHex, rgbToHsl, rgba, rgbaToRGBA, screen };
280
- //# sourceMappingURL=theme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme.d.ts","names":[],"sources":["../src/theme/config/system.ts","../src/theme/config/tokens/color/types.ts","../src/theme/config/types.ts","../src/theme/build/buildTheme.ts","../src/theme/build/lib/color-fns/blend/mix.ts","../src/theme/build/lib/color-fns/contrastRatio.ts","../src/theme/config/helpers.ts","../src/theme/config/tokens/types.ts","../src/theme/config/tokens/parseTokenKey.ts","../src/theme/config/tokens/parseTokenValue.ts","../src/theme/getScopedTheme.ts","../src/theme/system/color/_helpers.ts","../src/theme/versioning/getTheme_v2.ts","../src/theme/versioning/is_v0.ts","../src/theme/versioning/is_v2.ts","../src/theme/versioning/v0_v2.ts","../src/theme/versioning/v2_v0.ts"],"mappings":"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"}
package/dist/theme.js DELETED
@@ -1,55 +0,0 @@
1
- import { t as getTheme_v2 } from "./getTheme_v2-y09KqtEb.js";
2
- import { i as is_v2, n as v2_v0, r as v0_v2, t as getScopedTheme } from "./getScopedTheme-C-sZsyAz.js";
3
- import { A as COLOR_CONFIG_STATE_TONES, B as THEME_COLOR_INPUT_STATES, C as COLOR_CONFIG_BLEND_KEYS, D as COLOR_CONFIG_INPUT_STATES, E as COLOR_CONFIG_INPUT_MODES, F as THEME_COLOR_AVATAR_COLORS, H as THEME_COLOR_STATES, I as THEME_COLOR_BLEND_MODES, L as THEME_COLOR_BUTTON_MODES, M as isColorButtonMode, N as isColorHueKey, O as COLOR_CONFIG_STATES, P as isColorTintKey, R as THEME_COLOR_CARD_TONES, S as COLOR_CONFIG_AVATAR_COLORS, T as COLOR_CONFIG_CARD_TONES, U as THEME_COLOR_STATE_TONES, V as THEME_COLOR_SCHEMES, _ as isColorConfigStateKey, a as rgba, b as isColorTokenValue, c as hslToRgb, d as rgbaToRGBA, f as mix, g as isColorConfigBlendKey, h as isColorConfigBaseTone, i as multiply, j as isColorBlendModeValue, k as COLOR_CONFIG_STATE_KEYS, l as rgbToHex, m as isColorConfigBaseKey, n as buildTheme, o as parseColor, p as parseTokenValue, r as screen, s as hexToRgb, t as createColorTheme, u as rgbToHsl, v as isColorConfigStateTone, w as COLOR_CONFIG_CARD_KEYS, x as isColorValue, y as isColorOpacityValue, z as THEME_COLOR_INPUT_MODES } from "./factory-BzXTX8_Q.js";
4
- /** @internal */
5
- function getContrastRatio(bg, fg) {
6
- let rgb1 = parseColor(bg), rgb2 = parseColor(fg), c1 = rgb_lrgb(rgb1), c2 = rgb_lrgb(rgb2), l1 = lrgb_luminance(c1), l2 = lrgb_luminance(c2);
7
- return (Math.max(l1, l2) + .05) / (Math.min(l1, l2) + .05);
8
- }
9
- function rgb_lrgb({ r, g, b }) {
10
- return [
11
- rgb_lrgb1(r / 255),
12
- rgb_lrgb1(g / 255),
13
- rgb_lrgb1(b / 255)
14
- ];
15
- }
16
- function rgb_lrgb1(v) {
17
- return v <= .04045 ? v / 12.92 : ((v + .055) / 1.055) ** 2.4;
18
- }
19
- function lrgb_luminance([r, g, b]) {
20
- return .2126 * r + .7152 * g + .0722 * b;
21
- }
22
- /** @internal */
23
- function parseTokenKey(str) {
24
- let segments = str.split("/"), segment0 = segments.shift() || "";
25
- if (isColorConfigBaseTone(segment0)) {
26
- let key = segments.join("/");
27
- if (isColorConfigBaseKey(key) || isColorConfigBlendKey(key)) return {
28
- type: "base",
29
- tone: segment0,
30
- key
31
- };
32
- }
33
- if (segment0 === "button") {
34
- let segment1 = segments.shift() || "";
35
- if (isColorConfigStateTone(segment1)) {
36
- let segment2 = segments.shift() || "";
37
- if (isColorButtonMode(segment2)) {
38
- let key = segments.join("/");
39
- if (isColorConfigStateKey(key) || isColorConfigBlendKey(key)) return {
40
- type: "button",
41
- tone: segment1,
42
- mode: segment2,
43
- key
44
- };
45
- }
46
- }
47
- }
48
- }
49
- /** @internal */
50
- function is_v0(themeProp) {
51
- return themeProp._version === 0;
52
- }
53
- export { COLOR_CONFIG_AVATAR_COLORS, COLOR_CONFIG_BLEND_KEYS, COLOR_CONFIG_CARD_KEYS, COLOR_CONFIG_CARD_TONES, COLOR_CONFIG_INPUT_MODES, COLOR_CONFIG_INPUT_STATES, COLOR_CONFIG_STATES, COLOR_CONFIG_STATE_KEYS, COLOR_CONFIG_STATE_TONES, THEME_COLOR_AVATAR_COLORS, THEME_COLOR_BLEND_MODES, THEME_COLOR_BUTTON_MODES, THEME_COLOR_CARD_TONES, THEME_COLOR_INPUT_MODES, THEME_COLOR_INPUT_STATES, THEME_COLOR_SCHEMES, THEME_COLOR_STATES, THEME_COLOR_STATE_TONES, buildTheme, createColorTheme, getContrastRatio, getScopedTheme, getTheme_v2, hexToRgb, hslToRgb, isColorBlendModeValue, isColorButtonMode, isColorConfigBaseKey, isColorConfigBaseTone, isColorConfigBlendKey, isColorConfigStateKey, isColorConfigStateTone, isColorHueKey, isColorOpacityValue, isColorTintKey, isColorTokenValue, isColorValue, is_v0, is_v2, mix, multiply, parseColor, parseTokenKey, parseTokenValue, rgbToHex, rgbToHsl, rgba, rgbaToRGBA, screen, v0_v2, v2_v0 };
54
-
55
- //# sourceMappingURL=theme.js.map
package/dist/theme.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme.js","names":[],"sources":["../src/theme/build/lib/color-fns/contrastRatio.ts","../src/theme/config/tokens/parseTokenKey.ts","../src/theme/versioning/is_v0.ts"],"sourcesContent":["import {parseColor} from './parse'\nimport {RGB, RGBA} from './types'\n\n/** @internal */\nexport function getContrastRatio(bg: string, fg: string): number {\n const rgb1 = parseColor(bg) // bg: RGB | RGBA, fg: RGB | RGBA\n const rgb2 = parseColor(fg)\n\n // convert the two colors from sRGB to linear-light RGB\n const c1 = rgb_lrgb(rgb1)\n const c2 = rgb_lrgb(rgb2)\n\n // compute the relative luminances\n const l1 = lrgb_luminance(c1)\n const l2 = lrgb_luminance(c2)\n\n // compute the contrast ratio\n return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05)\n}\n\nfunction rgb_lrgb({r, g, b}: RGB | RGBA): [number, number, number] {\n return [rgb_lrgb1(r / 255), rgb_lrgb1(g / 255), rgb_lrgb1(b / 255)]\n}\n\nfunction rgb_lrgb1(v: number) {\n return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4\n}\n\nfunction lrgb_luminance([r, g, b]: [number, number, number]) {\n return 0.2126 * r + 0.7152 * g + 0.0722 * b\n}\n","import {isColorButtonMode} from '../../system/color/_helpers'\nimport {\n isColorConfigBaseKey,\n isColorConfigBaseTone,\n isColorConfigBlendKey,\n isColorConfigStateKey,\n isColorConfigStateTone,\n} from '../helpers'\nimport {TokenKeyNode} from './types'\n\n/** @internal */\nexport function parseTokenKey(str: string): TokenKeyNode | undefined {\n const segments = str.split('/')\n const segment0 = segments.shift() || ''\n\n if (isColorConfigBaseTone(segment0)) {\n const key = segments.join('/')\n\n if (isColorConfigBaseKey(key)) {\n return {\n type: 'base',\n tone: segment0,\n key,\n }\n }\n\n if (isColorConfigBlendKey(key)) {\n return {\n type: 'base',\n tone: segment0,\n key,\n }\n }\n }\n\n if (segment0 === 'button') {\n const segment1 = segments.shift() || ''\n\n if (isColorConfigStateTone(segment1)) {\n const segment2 = segments.shift() || ''\n\n if (isColorButtonMode(segment2)) {\n const key = segments.join('/')\n\n if (isColorConfigStateKey(key)) {\n return {\n type: 'button',\n tone: segment1,\n mode: segment2,\n key,\n }\n }\n\n if (isColorConfigBlendKey(key)) {\n return {\n type: 'button',\n tone: segment1,\n mode: segment2,\n key,\n }\n }\n }\n }\n }\n\n return undefined\n}\n","import {RootTheme, RootTheme_v2} from '../system/theme'\n\n/** @internal */\nexport function is_v0(themeProp: RootTheme | RootTheme_v2): themeProp is RootTheme {\n return themeProp._version === 0\n}\n"],"mappings":";;;;AAIA,SAAgB,iBAAiB,IAAY,IAAoB;CAC/D,IAAM,OAAO,WAAW,EAAE,GACpB,OAAO,WAAW,EAAE,GAGpB,KAAK,SAAS,IAAI,GAClB,KAAK,SAAS,IAAI,GAGlB,KAAK,eAAe,EAAE,GACtB,KAAK,eAAe,EAAE;CAG5B,QAAQ,KAAK,IAAI,IAAI,EAAE,IAAI,QAAS,KAAK,IAAI,IAAI,EAAE,IAAI;AACzD;AAEA,SAAS,SAAS,EAAC,GAAG,GAAG,KAA0C;CACjE,OAAO;EAAC,UAAU,IAAI,GAAG;EAAG,UAAU,IAAI,GAAG;EAAG,UAAU,IAAI,GAAG;CAAC;AACpE;AAEA,SAAS,UAAU,GAAW;CAC5B,OAAO,KAAK,SAAU,IAAI,UAAU,IAAI,QAAS,UAAU;AAC7D;AAEA,SAAS,eAAe,CAAC,GAAG,GAAG,IAA8B;CAC3D,OAAO,QAAS,IAAI,QAAS,IAAI,QAAS;AAC5C;;ACnBA,SAAgB,cAAc,KAAuC;CACnE,IAAM,WAAW,IAAI,MAAM,GAAG,GACxB,WAAW,SAAS,MAAM,KAAK;CAErC,IAAI,sBAAsB,QAAQ,GAAG;EACnC,IAAM,MAAM,SAAS,KAAK,GAAG;EAU7B,IARI,qBAAqB,GAAG,KAQxB,sBAAsB,GAAG,GAC3B,OAAO;GACL,MAAM;GACN,MAAM;GACN;EACF;CAEJ;CAEA,IAAI,aAAa,UAAU;EACzB,IAAM,WAAW,SAAS,MAAM,KAAK;EAErC,IAAI,uBAAuB,QAAQ,GAAG;GACpC,IAAM,WAAW,SAAS,MAAM,KAAK;GAErC,IAAI,kBAAkB,QAAQ,GAAG;IAC/B,IAAM,MAAM,SAAS,KAAK,GAAG;IAW7B,IATI,sBAAsB,GAAG,KASzB,sBAAsB,GAAG,GAC3B,OAAO;KACL,MAAM;KACN,MAAM;KACN,MAAM;KACN;IACF;GAEJ;EACF;CACF;AAGF;;AC/DA,SAAgB,MAAM,WAA6D;CACjF,OAAO,UAAU,aAAa;AAChC"}
package/dist/toast.d.ts DELETED
@@ -1,73 +0,0 @@
1
- /**
2
- * @public
3
- */
4
- interface ToastProps {
5
- closable?: boolean;
6
- description?: React.ReactNode;
7
- onClose: () => void;
8
- radius?: number | number[];
9
- title?: React.ReactNode;
10
- status?: 'error' | 'warning' | 'success' | 'info';
11
- duration?: number;
12
- updatedAt?: number;
13
- }
14
- /**
15
- * The `Toast` component gives feedback to users when an action has taken place.
16
- *
17
- * Toasts can be closed with a close button, or auto-dismiss after a certain timeout.
18
- *
19
- * @public
20
- */
21
- export declare function Toast(props: ToastProps & Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'title' | 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'>): React.JSX.Element;
22
- /**
23
- * @public
24
- */
25
- interface ToastLayerProps {
26
- children: React.ReactNode;
27
- padding?: number | number[];
28
- paddingX?: number | number[];
29
- paddingY?: number | number[];
30
- gap?: number | number[];
31
- }
32
- /**
33
- * @public
34
- */
35
- interface ToastProviderProps extends Omit<ToastLayerProps, 'children'> {
36
- children?: React.ReactNode;
37
- zOffset?: number | number[];
38
- }
39
- /**
40
- * @public
41
- */
42
- export declare function ToastProvider(props: ToastProviderProps): React.JSX.Element;
43
- /**
44
- * @public
45
- */
46
- interface ToastParams {
47
- closable?: boolean;
48
- description?: React.ReactNode;
49
- duration?: number;
50
- id?: string;
51
- onClose?: () => void;
52
- title?: React.ReactNode;
53
- status?: 'error' | 'warning' | 'success' | 'info';
54
- }
55
- /**
56
- * @public
57
- */
58
- interface ToastContextValue {
59
- version: 0.0;
60
- /**
61
- * Creates or updates a toast notification.
62
- * If a toast with the same ID already exists, it will be updated.
63
- * If an ID is not provided, a random one will be generated.
64
- * The returned ID can be used to programatically update a toast.
65
- */
66
- push: (params: ToastParams) => string;
67
- }
68
- /**
69
- * @public
70
- */
71
- export declare function useToast(): ToastContextValue;
72
- export type { ToastContextValue, ToastParams, ToastProps, ToastProviderProps };
73
- //# sourceMappingURL=toast.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toast.d.ts","names":[],"sources":["../src/core/components/toast/toast.tsx","../src/core/components/toast/toastLayer.tsx","../src/core/components/toast/toastProvider.tsx","../src/core/components/toast/types.ts","../src/core/components/toast/useToast.ts"],"mappings":"AAoBA;;;UAAiB;EACf;EACA,cAAc,MAAM;EACpB;EACA;EACA,QAAQ,MAAM;EACd;EACA;EACA;;;;;;;;;wBAqBc,MACd,OAAO,aACL,KACE,MAAM,UAAU,oHAUnB,MAAM,IAAI;;;;UCtDI;EACf,UAAU,MAAM;EAChB;EACA;EACA;EACA;;;;;UCQe,2BAA2B,KAAK;EAC/C,WAAW,MAAM;EACjB;;;;;wBAMc,cAAc,OAAO,qBAAqB,MAAM,IAAI;;;;UC1BnD;EACf;EACA,cAAc,MAAM;EACpB;EACA;EACA;EACA,QAAQ,MAAM;EACd;;;;;UAMe;EACf;;;;;;;EAOA,OAAO,QAAQ;;;;;wBCfD,YAAY"}