@yahoo/uds 3.59.0-beta.1 → 3.59.0-beta.2

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 (304) hide show
  1. package/cli/bin/uds-darwin-arm64-baseline +0 -0
  2. package/cli/bin/uds-darwin-x64 +0 -0
  3. package/cli/bin/uds-linux-arm64 +0 -0
  4. package/cli/bin/uds-linux-x64-baseline +0 -0
  5. package/dist/components/Box.d.ts +2 -2
  6. package/dist/components/Box.d.ts.map +1 -1
  7. package/dist/components/Divider/Divider.d.cts +2 -2
  8. package/dist/components/Divider/Divider.d.ts +2 -2
  9. package/dist/components/Divider/DividerCore.d.cts +2 -2
  10. package/dist/components/Divider/DividerCore.d.ts +2 -2
  11. package/dist/components/Divider/DividerInternal.d.cts +2 -2
  12. package/dist/components/Divider/DividerInternal.d.ts +2 -2
  13. package/dist/components/FormLabel.d.ts +2 -2
  14. package/dist/components/HStack.d.ts +2 -2
  15. package/dist/components/Icon.d.ts +2 -2
  16. package/dist/components/Link.d.ts +2 -2
  17. package/dist/components/Text.d.cts +5 -5
  18. package/dist/components/Text.d.cts.map +1 -1
  19. package/dist/components/Text.d.ts +8 -8
  20. package/dist/components/Text.d.ts.map +1 -1
  21. package/dist/components/VStack.d.ts +2 -2
  22. package/dist/components/VStack.d.ts.map +1 -1
  23. package/dist/components/client/AnimateHeightChange.d.cts +2 -2
  24. package/dist/components/client/AnimateHeightChange.d.ts +2 -2
  25. package/dist/components/client/Avatar/Avatar.d.cts +2 -2
  26. package/dist/components/client/Avatar/Avatar.d.cts.map +1 -1
  27. package/dist/components/client/Avatar/Avatar.d.ts +2 -2
  28. package/dist/components/client/Avatar/AvatarIcon.d.cts +2 -2
  29. package/dist/components/client/Avatar/AvatarIcon.d.cts.map +1 -1
  30. package/dist/components/client/Avatar/AvatarIcon.d.ts +2 -2
  31. package/dist/components/client/Avatar/AvatarImage.d.cts +2 -2
  32. package/dist/components/client/Avatar/AvatarImage.d.ts +2 -2
  33. package/dist/components/client/Avatar/AvatarText.d.cts +2 -2
  34. package/dist/components/client/Avatar/AvatarText.d.ts +2 -2
  35. package/dist/components/client/IconButton.d.cts +2 -2
  36. package/dist/components/client/IconButton.d.ts +2 -2
  37. package/dist/components/client/IconButton.d.ts.map +1 -1
  38. package/dist/components/client/Input/Input.d.cts +2 -2
  39. package/dist/components/client/Input/Input.d.ts +2 -2
  40. package/dist/components/client/Input/InputHelpText.d.cts +2 -2
  41. package/dist/components/client/Input/InputHelpText.d.cts.map +1 -1
  42. package/dist/components/client/Input/InputHelpText.d.ts +2 -2
  43. package/dist/components/client/Input/InputHelpTextInternal.d.cts +4 -4
  44. package/dist/components/client/Input/InputHelpTextInternal.d.cts.map +1 -1
  45. package/dist/components/client/Input/InputHelpTextInternal.d.ts +4 -4
  46. package/dist/components/client/Menu/Menu.Content.d.cts +2 -2
  47. package/dist/components/client/Menu/Menu.Content.d.ts +2 -2
  48. package/dist/components/client/Menu/Menu.Divider.d.cts +2 -2
  49. package/dist/components/client/Menu/Menu.Divider.d.ts +2 -2
  50. package/dist/components/client/Menu/Menu.Item.d.cts +2 -2
  51. package/dist/components/client/Menu/Menu.ItemBase.d.cts +2 -2
  52. package/dist/components/client/Menu/Menu.ItemBase.d.ts +2 -2
  53. package/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +2 -2
  54. package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +2 -2
  55. package/dist/components/client/Menu/Menu.Provider.d.cts +2 -2
  56. package/dist/components/client/Menu/Menu.Provider.d.ts +2 -2
  57. package/dist/components/client/Menu/Menu.Trigger.d.cts +2 -2
  58. package/dist/components/client/Menu/Menu.Trigger.d.ts +2 -2
  59. package/dist/components/client/Pressable.d.cts +2 -2
  60. package/dist/components/client/Pressable.d.ts +2 -2
  61. package/dist/components/client/Pressable.d.ts.map +1 -1
  62. package/dist/components/client/Radio/RadioGroupStore.d.ts +2 -2
  63. package/dist/components/client/SpringMotionConfig.d.cts +3 -3
  64. package/dist/components/client/SpringMotionConfig.d.ts +3 -3
  65. package/dist/components/client/SpringMotionConfig.d.ts.map +1 -1
  66. package/dist/components/experimental/Spinner.d.cts +2 -2
  67. package/dist/components/experimental/Spinner.d.cts.map +1 -1
  68. package/dist/components/experimental/Spinner.d.ts +2 -2
  69. package/dist/components/experimental/Table.d.cts +2 -2
  70. package/dist/components/experimental/Table.d.ts +2 -2
  71. package/dist/components/experimental/client/Accordion.d.cts +2 -2
  72. package/dist/components/experimental/client/Accordion.d.cts.map +1 -1
  73. package/dist/components/experimental/client/Accordion.d.ts +2 -2
  74. package/dist/components/experimental/client/AvoidMotionLibraryProvider.d.cts +2 -2
  75. package/dist/components/experimental/client/AvoidMotionLibraryProvider.d.ts +2 -2
  76. package/dist/components/experimental/client/Modal.d.cts +3 -3
  77. package/dist/components/experimental/client/Modal.d.cts.map +1 -1
  78. package/dist/components/experimental/client/Modal.d.ts +3 -3
  79. package/dist/components/experimental/client/Popover.d.cts +3 -3
  80. package/dist/components/experimental/client/Popover.d.cts.map +1 -1
  81. package/dist/components/experimental/client/Popover.d.ts +3 -3
  82. package/dist/components/experimental/client/Tabs.d.cts +3 -3
  83. package/dist/components/experimental/client/Tabs.d.ts +6 -6
  84. package/dist/components/experimental/client/Toast.d.cts +2 -2
  85. package/dist/components/experimental/client/Toast.d.ts +2 -2
  86. package/dist/providers/ColorModeProvider.d.cts +4 -4
  87. package/dist/providers/ColorModeProvider.d.cts.map +1 -1
  88. package/dist/providers/ColorModeProvider.d.ts +4 -4
  89. package/dist/providers/ColorModeProvider.d.ts.map +1 -1
  90. package/dist/providers/ScaleModeProvider.d.cts +4 -4
  91. package/dist/providers/ScaleModeProvider.d.cts.map +1 -1
  92. package/dist/providers/ScaleModeProvider.d.ts +4 -4
  93. package/dist/providers/ScaleModeProvider.d.ts.map +1 -1
  94. package/dist/providers/ThemeProvider.d.cts +2 -2
  95. package/dist/providers/ThemeProvider.d.cts.map +1 -1
  96. package/dist/providers/ThemeProvider.d.ts +2 -2
  97. package/dist/styles/styler.d.cts +33 -33
  98. package/dist/styles/styler.d.ts +33 -33
  99. package/dist/styles/stylerTypes.d.ts.map +1 -1
  100. package/dist/tailwind/tailwind.config.d.ts +3 -3
  101. package/dist/tailwind/tailwindPlugin.d.ts +3 -3
  102. package/dist/tailwind/utils/getMotionStyles.d.cts +1 -1
  103. package/dist/tailwind/utils/getMotionStyles.d.ts +1 -1
  104. package/dist/tokens/automation/utils/getConfigVariantProperties.d.cts +2 -2
  105. package/dist/tokens/automation/utils/getConfigVariantProperties.d.cts.map +1 -1
  106. package/dist/tokens/automation/utils/getConfigVariantProperties.d.ts +2 -2
  107. package/dist/tokens/automation/utils/getConfigVariantProperties.d.ts.map +1 -1
  108. package/dist/tokens/types.d.cts.map +1 -1
  109. package/dist/tokens/types.d.ts.map +1 -1
  110. package/dist/utils/intersperse.d.cts +2 -2
  111. package/dist/utils/intersperse.d.ts +2 -2
  112. package/package.json +1 -3
  113. package/cli/FlattenButtonVariant.mock.tsx +0 -17
  114. package/src/components/Box.tsx +0 -181
  115. package/src/components/Divider/Divider.tsx +0 -44
  116. package/src/components/Divider/DividerCore.tsx +0 -101
  117. package/src/components/Divider/DividerInternal.tsx +0 -56
  118. package/src/components/Divider/index.ts +0 -1
  119. package/src/components/FormLabel.tsx +0 -66
  120. package/src/components/HStack.tsx +0 -53
  121. package/src/components/Icon.tsx +0 -82
  122. package/src/components/IconSlot.tsx +0 -82
  123. package/src/components/Image.tsx +0 -162
  124. package/src/components/Link.tsx +0 -134
  125. package/src/components/Text.tsx +0 -272
  126. package/src/components/VStack.tsx +0 -53
  127. package/src/components/client/AnimateHeightChange.tsx +0 -50
  128. package/src/components/client/Avatar/Avatar.tsx +0 -31
  129. package/src/components/client/Avatar/AvatarIcon.tsx +0 -103
  130. package/src/components/client/Avatar/AvatarImage.tsx +0 -147
  131. package/src/components/client/Avatar/AvatarText.tsx +0 -88
  132. package/src/components/client/Avatar/index.ts +0 -4
  133. package/src/components/client/Avatar/utils.ts +0 -105
  134. package/src/components/client/Badge.tsx +0 -133
  135. package/src/components/client/Button.tsx +0 -312
  136. package/src/components/client/Checkbox.tsx +0 -377
  137. package/src/components/client/Chip/Chip.tsx +0 -81
  138. package/src/components/client/Chip/ChipBase.tsx +0 -151
  139. package/src/components/client/Chip/ChipButton.tsx +0 -54
  140. package/src/components/client/Chip/ChipDismissible.tsx +0 -90
  141. package/src/components/client/Chip/ChipLink.tsx +0 -60
  142. package/src/components/client/Chip/ChipToggle.tsx +0 -79
  143. package/src/components/client/Chip/index.ts +0 -5
  144. package/src/components/client/IconButton.tsx +0 -198
  145. package/src/components/client/Input/Input.tsx +0 -323
  146. package/src/components/client/Input/InputHelpText.tsx +0 -52
  147. package/src/components/client/Input/InputHelpTextInternal.tsx +0 -81
  148. package/src/components/client/Input/index.ts +0 -2
  149. package/src/components/client/Menu/Menu.Content.tsx +0 -391
  150. package/src/components/client/Menu/Menu.Divider.tsx +0 -102
  151. package/src/components/client/Menu/Menu.Item.tsx +0 -114
  152. package/src/components/client/Menu/Menu.ItemBase.tsx +0 -265
  153. package/src/components/client/Menu/Menu.ItemCheckbox.tsx +0 -197
  154. package/src/components/client/Menu/Menu.Provider.tsx +0 -154
  155. package/src/components/client/Menu/Menu.Trigger.tsx +0 -119
  156. package/src/components/client/Menu/Menu.index.tsx +0 -9
  157. package/src/components/client/Menu/Menu.tsx +0 -2
  158. package/src/components/client/Menu/index.ts +0 -7
  159. package/src/components/client/Menu/utils/transformAriakitPlacement.ts +0 -66
  160. package/src/components/client/Pressable.tsx +0 -194
  161. package/src/components/client/Radio/Radio.tsx +0 -351
  162. package/src/components/client/Radio/RadioGroupProvider.tsx +0 -122
  163. package/src/components/client/Radio/RadioGroupStore.tsx +0 -56
  164. package/src/components/client/Radio/index.ts +0 -2
  165. package/src/components/client/Radio/useRadioGroup.ts +0 -149
  166. package/src/components/client/SpringMotionConfig.tsx +0 -151
  167. package/src/components/client/Switch.tsx +0 -377
  168. package/src/components/client/index.ts +0 -30
  169. package/src/components/client/motionFeatures/domAnimation.ts +0 -2
  170. package/src/components/client/motionFeatures/domMax.ts +0 -2
  171. package/src/components/experimental/Spinner.tsx +0 -30
  172. package/src/components/experimental/Table.mocks.tsx +0 -38
  173. package/src/components/experimental/Table.tsx +0 -239
  174. package/src/components/experimental/client/Accordion.tsx +0 -77
  175. package/src/components/experimental/client/AvoidMotionLibraryProvider.tsx +0 -10
  176. package/src/components/experimental/client/Modal.tsx +0 -68
  177. package/src/components/experimental/client/Popover.tsx +0 -63
  178. package/src/components/experimental/client/SwitchV2.tsx +0 -343
  179. package/src/components/experimental/client/Tabs.tsx +0 -106
  180. package/src/components/experimental/client/Toast.tsx +0 -186
  181. package/src/components/experimental/client/index.ts +0 -15
  182. package/src/components/experimental/index.ts +0 -48
  183. package/src/components/index.ts +0 -41
  184. package/src/defaultTokensConfig.ts +0 -31
  185. package/src/fixtures/index.ts +0 -638
  186. package/src/fixtures/macros/typesToConstants.ts +0 -42
  187. package/src/fixtures/utils/getScaleModeRamp.ts +0 -48
  188. package/src/fixtures/utils/getTailwindAsUdsColors.ts +0 -115
  189. package/src/flags.ts +0 -45
  190. package/src/hooks/useForkRef.ts +0 -34
  191. package/src/hooks/useNestedBorderRadius.ts +0 -138
  192. package/src/hooks/useRtl.ts +0 -64
  193. package/src/index.ts +0 -4
  194. package/src/providers/ColorModeProvider.tsx +0 -21
  195. package/src/providers/ScaleModeProvider.tsx +0 -29
  196. package/src/providers/ThemeProvider.tsx +0 -26
  197. package/src/styles/styler.ts +0 -194
  198. package/src/styles/stylerTypes.ts +0 -81
  199. package/src/styles/toast.css +0 -0
  200. package/src/styles/variants.ts +0 -1351
  201. package/src/tailwind/base/addColorModeVars.ts +0 -23
  202. package/src/tailwind/base/addColorModeVarsV2.ts +0 -57
  203. package/src/tailwind/base/addFontFaceDeclarations.ts +0 -13
  204. package/src/tailwind/base/addFontVars.ts +0 -9
  205. package/src/tailwind/base/addMotionVars.ts +0 -9
  206. package/src/tailwind/base/addScaleModeVars.ts +0 -33
  207. package/src/tailwind/base/types.ts +0 -8
  208. package/src/tailwind/components/getButtonStyles.ts +0 -240
  209. package/src/tailwind/components/getFocusRingStyles.ts +0 -32
  210. package/src/tailwind/components/getGroupedTextStyles.ts +0 -29
  211. package/src/tailwind/components/getHitTargetStyles.ts +0 -23
  212. package/src/tailwind/components/getIconButtonStyles.ts +0 -49
  213. package/src/tailwind/components/getIconStyles.ts +0 -13
  214. package/src/tailwind/components/getInputStyles.ts +0 -20
  215. package/src/tailwind/components/getResponsiveTextStyles.ts +0 -161
  216. package/src/tailwind/components/types.ts +0 -14
  217. package/src/tailwind/components/utils.ts +0 -73
  218. package/src/tailwind/defaultTailwindThemeAsUdsConfig.ts +0 -78
  219. package/src/tailwind/postcss.config.ts +0 -6
  220. package/src/tailwind/purger/index.ts +0 -1
  221. package/src/tailwind/tailwind.config.ts +0 -50
  222. package/src/tailwind/tailwind.d.ts +0 -5
  223. package/src/tailwind/tailwindPlugin.ts +0 -724
  224. package/src/tailwind/theme/getFontFamilyTheme.ts +0 -28
  225. package/src/tailwind/tsMorph.ts +0 -1
  226. package/src/tailwind/uds.css +0 -3
  227. package/src/tailwind/utils/addFontsPlugin.ts +0 -17
  228. package/src/tailwind/utils/getColorModeStyles.ts +0 -21
  229. package/src/tailwind/utils/getFontFaceDeclarations.ts +0 -12
  230. package/src/tailwind/utils/getFontStyles.ts +0 -38
  231. package/src/tailwind/utils/getMotionStyles.ts +0 -35
  232. package/src/tailwind/utils/getScaleModeStyles.ts +0 -23
  233. package/src/tailwind/utils/getShadowPresetValues.ts +0 -133
  234. package/src/tailwind/utils/getShadowStyles.ts +0 -26
  235. package/src/tailwind/utils/getShadowVars.ts +0 -40
  236. package/src/tailwind/utils/index.ts +0 -9
  237. package/src/tokens/automation/configs/avatar.ts +0 -297
  238. package/src/tokens/automation/configs/badge.ts +0 -306
  239. package/src/tokens/automation/configs/checkbox.ts +0 -226
  240. package/src/tokens/automation/configs/chip.ts +0 -521
  241. package/src/tokens/automation/configs/divider.ts +0 -112
  242. package/src/tokens/automation/configs/index.ts +0 -10
  243. package/src/tokens/automation/configs/input.ts +0 -496
  244. package/src/tokens/automation/configs/link.ts +0 -183
  245. package/src/tokens/automation/configs/menu.ts +0 -344
  246. package/src/tokens/automation/configs/radio.ts +0 -225
  247. package/src/tokens/automation/configs/switch.ts +0 -323
  248. package/src/tokens/automation/index.ts +0 -5
  249. package/src/tokens/automation/mapTextVariantFixtureToValue.ts +0 -8
  250. package/src/tokens/automation/properties.ts +0 -433
  251. package/src/tokens/automation/types/ComponentConfig.ts +0 -116
  252. package/src/tokens/automation/types/ComponentDB.ts +0 -1
  253. package/src/tokens/automation/types/ComponentStyles.ts +0 -47
  254. package/src/tokens/automation/types/index.ts +0 -2
  255. package/src/tokens/automation/utils/cartesianProduct.ts +0 -13
  256. package/src/tokens/automation/utils/coalesceConfigVariant.ts +0 -49
  257. package/src/tokens/automation/utils/defaults.ts +0 -29
  258. package/src/tokens/automation/utils/generateKeyFromFlatConfigPath.ts +0 -15
  259. package/src/tokens/automation/utils/generateSchemaKey.ts +0 -29
  260. package/src/tokens/automation/utils/getConfigComponentVariant.ts +0 -28
  261. package/src/tokens/automation/utils/getConfigVariantComponentStatesMatrix.ts +0 -40
  262. package/src/tokens/automation/utils/getConfigVariantProperties.ts +0 -32
  263. package/src/tokens/automation/utils/getConfigVariantPseudoStates.ts +0 -70
  264. package/src/tokens/automation/utils/getConfigVariants.ts +0 -73
  265. package/src/tokens/automation/utils/index.ts +0 -939
  266. package/src/tokens/automation/utils/mapColorFixtureToValue.ts +0 -34
  267. package/src/tokens/automation/utils/subcomponents.ts +0 -13
  268. package/src/tokens/automation/utils/variableData.ts +0 -79
  269. package/src/tokens/automation/utils/variantConfigGuards.ts +0 -17
  270. package/src/tokens/configs/borderRadius.ts +0 -23
  271. package/src/tokens/configs/borderWidth.ts +0 -17
  272. package/src/tokens/configs/button.ts +0 -888
  273. package/src/tokens/configs/colorMode.ts +0 -14
  274. package/src/tokens/configs/font.ts +0 -9
  275. package/src/tokens/configs/iconButton.ts +0 -28
  276. package/src/tokens/configs/motion.ts +0 -135
  277. package/src/tokens/configs/palette.ts +0 -124
  278. package/src/tokens/configs/scaleMode.ts +0 -28
  279. package/src/tokens/configs/shadow.ts +0 -286
  280. package/src/tokens/configs/sizes.ts +0 -23
  281. package/src/tokens/configs/spectrum.ts +0 -729
  282. package/src/tokens/configs/typography.ts +0 -417
  283. package/src/tokens/configs/yosConfig.ts +0 -7651
  284. package/src/tokens/consts/buttonMotionTokens.ts +0 -99
  285. package/src/tokens/consts/cssTokens.ts +0 -110
  286. package/src/tokens/consts/defaultModes.ts +0 -15
  287. package/src/tokens/consts/fontDeclarationsMap.ts +0 -509
  288. package/src/tokens/index.ts +0 -15
  289. package/src/tokens/parseButtonVariants.ts +0 -59
  290. package/src/tokens/parseTokens.ts +0 -122
  291. package/src/tokens/types.ts +0 -1882
  292. package/src/tokens/utils/entries.ts +0 -14
  293. package/src/tokens/utils/fromEntries.ts +0 -11
  294. package/src/tokens/utils/mapValues.ts +0 -15
  295. package/src/types.ts +0 -2
  296. package/src/utils/assertUnreachable.ts +0 -6
  297. package/src/utils/composeRefs.ts +0 -23
  298. package/src/utils/createSlot.tsx +0 -131
  299. package/src/utils/entries.ts +0 -6
  300. package/src/utils/falsyToString.ts +0 -3
  301. package/src/utils/getMotionVar.ts +0 -18
  302. package/src/utils/intersperse.ts +0 -45
  303. package/src/utils/mapValues.ts +0 -15
  304. package/src/utils/mergeSlotProps.ts +0 -70
@@ -1,888 +0,0 @@
1
- import type {
2
- ButtonBaseConfig,
3
- ButtonColorEffect,
4
- ButtonConfig,
5
- ButtonKind,
6
- ButtonMotionEffect,
7
- ButtonPalette,
8
- ButtonShadowPropertyConfig,
9
- ButtonStateEffectConfig,
10
- } from '../types';
11
-
12
- const noneOrCustomEffectOptions: ButtonColorEffect[] = ['none', 'custom'];
13
- const scaleEffectOptions: ButtonMotionEffect[] = ['none', 'up', 'down'];
14
-
15
- const defaultFillEffect: ButtonStateEffectConfig = {
16
- hover: {
17
- backgroundColor: { value: 'none', options: noneOrCustomEffectOptions },
18
- borderColor: { value: 'none', options: noneOrCustomEffectOptions },
19
- color: { value: 'none', options: noneOrCustomEffectOptions },
20
- scale: { value: 'up', options: scaleEffectOptions },
21
- },
22
- pressed: {
23
- backgroundColor: { value: 'none', options: noneOrCustomEffectOptions },
24
- borderColor: { value: 'none', options: noneOrCustomEffectOptions },
25
- color: { value: 'none', options: noneOrCustomEffectOptions },
26
- scale: { value: 'down', options: scaleEffectOptions },
27
- },
28
- };
29
-
30
- const defaultOutlineEffect: ButtonStateEffectConfig = {
31
- hover: {
32
- backgroundColor: { value: 'none', options: noneOrCustomEffectOptions },
33
- borderColor: { value: 'none', options: noneOrCustomEffectOptions },
34
- color: { value: 'none', options: noneOrCustomEffectOptions },
35
- scale: { value: 'up', options: scaleEffectOptions },
36
- },
37
- pressed: {
38
- backgroundColor: { value: 'none', options: noneOrCustomEffectOptions },
39
- borderColor: { value: 'none', options: noneOrCustomEffectOptions },
40
- color: { value: 'none', options: noneOrCustomEffectOptions },
41
- scale: { value: 'down', options: scaleEffectOptions },
42
- },
43
- };
44
-
45
- const defaultGhostEffect: ButtonStateEffectConfig = {
46
- hover: {
47
- backgroundColor: { value: 'none', options: noneOrCustomEffectOptions },
48
- borderColor: { value: 'none', options: noneOrCustomEffectOptions },
49
- color: { value: 'none', options: noneOrCustomEffectOptions },
50
- scale: { value: 'up', options: scaleEffectOptions },
51
- },
52
- pressed: {
53
- backgroundColor: { value: 'none', options: noneOrCustomEffectOptions },
54
- borderColor: { value: 'none', options: noneOrCustomEffectOptions },
55
- color: { value: 'none', options: noneOrCustomEffectOptions },
56
- scale: { value: 'down', options: scaleEffectOptions },
57
- },
58
- };
59
-
60
- const defaultShadows: ButtonShadowPropertyConfig = {
61
- dropShadow: {
62
- value: 'none',
63
- config: null,
64
- },
65
- insetShadow: {
66
- value: 'none',
67
- config: null,
68
- },
69
- };
70
-
71
- function getDefaultFillBase(alias: ButtonPalette): ButtonBaseConfig {
72
- return {
73
- borderWidth: 'none',
74
- borderRadius: 'full',
75
- borderColor: {
76
- type: 'palette',
77
- value: 'transparent',
78
- },
79
- backgroundColor: {
80
- type: 'palette',
81
- value: alias,
82
- },
83
- color: {
84
- type: 'palette',
85
- value: 'on-color',
86
- },
87
- scale: 'none',
88
- ...defaultShadows,
89
- };
90
- }
91
-
92
- function getDefaultOutlineBase(alias: ButtonPalette): ButtonBaseConfig {
93
- return {
94
- borderWidth: 'thin',
95
- borderRadius: 'full',
96
- backgroundColor: {
97
- type: 'palette',
98
- value: 'transparent',
99
- },
100
- borderColor: {
101
- type: 'palette',
102
- value: alias,
103
- },
104
- color: {
105
- type: 'palette',
106
- value: alias,
107
- },
108
- scale: 'none',
109
- ...defaultShadows,
110
- };
111
- }
112
-
113
- function getDefaultGhostBase(alias: ButtonPalette): ButtonBaseConfig {
114
- return {
115
- borderWidth: 'none',
116
- borderRadius: 'full',
117
- backgroundColor: {
118
- type: 'palette',
119
- value: 'transparent',
120
- },
121
- borderColor: {
122
- type: 'palette',
123
- value: 'transparent',
124
- },
125
- color: {
126
- type: 'palette',
127
- value: alias,
128
- },
129
- scale: 'none',
130
- ...defaultShadows,
131
- };
132
- }
133
-
134
- export const getDefaultButtonBaseMap: Record<
135
- ButtonKind,
136
- (alias: ButtonPalette) => ButtonBaseConfig
137
- > = {
138
- fill: getDefaultFillBase,
139
- outline: getDefaultOutlineBase,
140
- ghost: getDefaultGhostBase,
141
- };
142
-
143
- export const button: ButtonConfig = {
144
- defaults: {
145
- palette: 'accent',
146
- variant: 'primary',
147
- size: 'md',
148
- },
149
- size: {
150
- sm: {
151
- spacingHorizontal: '4',
152
- spacingVertical: '1',
153
- gap: '2',
154
- iconSize: 'sm',
155
- textVariant: 'label1',
156
- },
157
- md: {
158
- spacingHorizontal: '6',
159
- spacingVertical: '3',
160
- gap: '2',
161
- iconSize: 'sm',
162
- textVariant: 'label1',
163
- },
164
- lg: {
165
- spacingHorizontal: '7',
166
- spacingVertical: '4',
167
- gap: '2',
168
- iconSize: 'md',
169
- textVariant: 'headline1',
170
- },
171
- },
172
- palette: {
173
- info: {
174
- primary: {
175
- kind: 'fill',
176
- effect: defaultFillEffect,
177
- base: getDefaultFillBase('info'),
178
- state: {
179
- hover: {
180
- scale: 'up',
181
- backgroundColor: {
182
- type: 'spectrum',
183
- value: 'blue-10',
184
- },
185
- borderColor: {
186
- type: 'palette',
187
- value: 'transparent',
188
- },
189
- color: {
190
- type: 'palette',
191
- value: 'on-color',
192
- },
193
- ...defaultShadows,
194
- },
195
- pressed: {
196
- scale: 'down',
197
- backgroundColor: {
198
- type: 'spectrum',
199
- value: 'blue-11',
200
- },
201
- borderColor: {
202
- type: 'palette',
203
- value: 'transparent',
204
- },
205
- color: {
206
- type: 'palette',
207
- value: 'on-color',
208
- },
209
- ...defaultShadows,
210
- },
211
- },
212
- },
213
- secondary: {
214
- kind: 'outline',
215
- effect: defaultOutlineEffect,
216
- base: getDefaultOutlineBase('info'),
217
- state: {
218
- hover: {
219
- scale: 'up',
220
- backgroundColor: {
221
- type: 'palette',
222
- value: 'transparent',
223
- },
224
- borderColor: {
225
- type: 'spectrum',
226
- value: 'blue-10',
227
- },
228
- color: {
229
- type: 'spectrum',
230
- value: 'blue-10',
231
- },
232
- ...defaultShadows,
233
- },
234
- pressed: {
235
- scale: 'down',
236
- backgroundColor: {
237
- type: 'palette',
238
- value: 'transparent',
239
- },
240
- borderColor: {
241
- type: 'spectrum',
242
- value: 'blue-11',
243
- },
244
- color: {
245
- type: 'spectrum',
246
- value: 'blue-11',
247
- },
248
- ...defaultShadows,
249
- },
250
- },
251
- },
252
- tertiary: {
253
- kind: 'ghost',
254
- effect: defaultGhostEffect,
255
- base: getDefaultGhostBase('info'),
256
- state: {
257
- hover: {
258
- scale: 'up',
259
- backgroundColor: {
260
- type: 'spectrum',
261
- value: 'blue-2',
262
- },
263
- borderColor: {
264
- type: 'palette',
265
- value: 'transparent',
266
- },
267
- color: {
268
- type: 'palette',
269
- value: 'info',
270
- },
271
- ...defaultShadows,
272
- },
273
- pressed: {
274
- scale: 'down',
275
- backgroundColor: {
276
- type: 'spectrum',
277
- value: 'blue-4',
278
- },
279
- borderColor: {
280
- type: 'palette',
281
- value: 'transparent',
282
- },
283
- color: {
284
- type: 'palette',
285
- value: 'info',
286
- },
287
- ...defaultShadows,
288
- },
289
- },
290
- },
291
- },
292
- accent: {
293
- primary: {
294
- kind: 'fill',
295
- effect: defaultFillEffect,
296
- base: getDefaultFillBase('accent'),
297
- state: {
298
- hover: {
299
- scale: 'up',
300
- backgroundColor: {
301
- type: 'spectrum',
302
- value: 'carbon-10',
303
- },
304
- borderColor: {
305
- type: 'palette',
306
- value: 'transparent',
307
- },
308
- color: {
309
- type: 'palette',
310
- value: 'on-color',
311
- },
312
- ...defaultShadows,
313
- },
314
- pressed: {
315
- scale: 'down',
316
- backgroundColor: {
317
- type: 'spectrum',
318
- value: 'carbon-11',
319
- },
320
- borderColor: {
321
- type: 'palette',
322
- value: 'transparent',
323
- },
324
- color: {
325
- type: 'palette',
326
- value: 'on-color',
327
- },
328
- ...defaultShadows,
329
- },
330
- },
331
- },
332
- secondary: {
333
- kind: 'outline',
334
- effect: defaultOutlineEffect,
335
- base: getDefaultOutlineBase('accent'),
336
- state: {
337
- hover: {
338
- scale: 'up',
339
- backgroundColor: {
340
- type: 'palette',
341
- value: 'transparent',
342
- },
343
- borderColor: {
344
- type: 'spectrum',
345
- value: 'carbon-10',
346
- },
347
- color: {
348
- type: 'spectrum',
349
- value: 'carbon-10',
350
- },
351
- ...defaultShadows,
352
- },
353
- pressed: {
354
- scale: 'down',
355
- backgroundColor: {
356
- type: 'palette',
357
- value: 'transparent',
358
- },
359
- borderColor: {
360
- type: 'spectrum',
361
- value: 'carbon-11',
362
- },
363
- color: {
364
- type: 'spectrum',
365
- value: 'carbon-11',
366
- },
367
- ...defaultShadows,
368
- },
369
- },
370
- },
371
- tertiary: {
372
- kind: 'ghost',
373
- effect: defaultGhostEffect,
374
- base: getDefaultGhostBase('accent'),
375
- state: {
376
- hover: {
377
- scale: 'up',
378
- backgroundColor: {
379
- type: 'spectrum',
380
- value: 'carbon-2',
381
- },
382
- borderColor: {
383
- type: 'palette',
384
- value: 'transparent',
385
- },
386
- color: {
387
- type: 'palette',
388
- value: 'accent',
389
- },
390
- ...defaultShadows,
391
- },
392
- pressed: {
393
- scale: 'down',
394
- backgroundColor: {
395
- type: 'spectrum',
396
- value: 'carbon-4',
397
- },
398
- borderColor: {
399
- type: 'palette',
400
- value: 'transparent',
401
- },
402
- color: {
403
- type: 'palette',
404
- value: 'accent',
405
- },
406
- ...defaultShadows,
407
- },
408
- },
409
- },
410
- },
411
- brand: {
412
- primary: {
413
- kind: 'fill',
414
- effect: defaultFillEffect,
415
- base: getDefaultFillBase('brand'),
416
- state: {
417
- hover: {
418
- scale: 'up',
419
- backgroundColor: {
420
- type: 'spectrum',
421
- value: 'purple-10',
422
- },
423
- borderColor: {
424
- type: 'palette',
425
- value: 'transparent',
426
- },
427
- color: {
428
- type: 'palette',
429
- value: 'on-color',
430
- },
431
- ...defaultShadows,
432
- },
433
- pressed: {
434
- scale: 'down',
435
- backgroundColor: {
436
- type: 'spectrum',
437
- value: 'purple-11',
438
- },
439
- borderColor: {
440
- type: 'palette',
441
- value: 'transparent',
442
- },
443
- color: {
444
- type: 'palette',
445
- value: 'on-color',
446
- },
447
- ...defaultShadows,
448
- },
449
- },
450
- },
451
- secondary: {
452
- kind: 'outline',
453
- effect: defaultOutlineEffect,
454
- base: getDefaultOutlineBase('brand'),
455
- state: {
456
- hover: {
457
- scale: 'up',
458
- backgroundColor: {
459
- type: 'palette',
460
- value: 'transparent',
461
- },
462
- borderColor: {
463
- type: 'spectrum',
464
- value: 'purple-10',
465
- },
466
- color: {
467
- type: 'spectrum',
468
- value: 'purple-10',
469
- },
470
- ...defaultShadows,
471
- },
472
- pressed: {
473
- scale: 'down',
474
- backgroundColor: {
475
- type: 'palette',
476
- value: 'transparent',
477
- },
478
- borderColor: {
479
- type: 'spectrum',
480
- value: 'purple-11',
481
- },
482
- color: {
483
- type: 'spectrum',
484
- value: 'purple-11',
485
- },
486
- ...defaultShadows,
487
- },
488
- },
489
- },
490
- tertiary: {
491
- kind: 'ghost',
492
- effect: defaultGhostEffect,
493
- base: getDefaultGhostBase('brand'),
494
- state: {
495
- hover: {
496
- scale: 'up',
497
- backgroundColor: {
498
- type: 'spectrum',
499
- value: 'purple-2',
500
- },
501
- borderColor: {
502
- type: 'palette',
503
- value: 'transparent',
504
- },
505
- color: {
506
- type: 'palette',
507
- value: 'brand',
508
- },
509
- ...defaultShadows,
510
- },
511
- pressed: {
512
- scale: 'down',
513
- backgroundColor: {
514
- type: 'spectrum',
515
- value: 'purple-4',
516
- },
517
- borderColor: {
518
- type: 'palette',
519
- value: 'transparent',
520
- },
521
- color: {
522
- type: 'palette',
523
- value: 'brand',
524
- },
525
- ...defaultShadows,
526
- },
527
- },
528
- },
529
- },
530
- alert: {
531
- primary: {
532
- kind: 'fill',
533
- effect: defaultFillEffect,
534
- base: getDefaultFillBase('alert'),
535
- state: {
536
- hover: {
537
- scale: 'up',
538
- backgroundColor: {
539
- type: 'spectrum',
540
- value: 'red-10',
541
- },
542
- borderColor: {
543
- type: 'palette',
544
- value: 'transparent',
545
- },
546
- color: {
547
- type: 'palette',
548
- value: 'on-color',
549
- },
550
- ...defaultShadows,
551
- },
552
- pressed: {
553
- scale: 'down',
554
- backgroundColor: {
555
- type: 'spectrum',
556
- value: 'red-11',
557
- },
558
- borderColor: {
559
- type: 'palette',
560
- value: 'transparent',
561
- },
562
- color: {
563
- type: 'palette',
564
- value: 'on-color',
565
- },
566
- ...defaultShadows,
567
- },
568
- },
569
- },
570
- secondary: {
571
- kind: 'outline',
572
- effect: defaultOutlineEffect,
573
- base: getDefaultOutlineBase('alert'),
574
- state: {
575
- hover: {
576
- scale: 'up',
577
- backgroundColor: {
578
- type: 'palette',
579
- value: 'transparent',
580
- },
581
- borderColor: {
582
- type: 'spectrum',
583
- value: 'red-10',
584
- },
585
- color: {
586
- type: 'spectrum',
587
- value: 'red-10',
588
- },
589
- ...defaultShadows,
590
- },
591
- pressed: {
592
- scale: 'down',
593
- backgroundColor: {
594
- type: 'palette',
595
- value: 'transparent',
596
- },
597
- borderColor: {
598
- type: 'spectrum',
599
- value: 'red-11',
600
- },
601
- color: {
602
- type: 'spectrum',
603
- value: 'red-11',
604
- },
605
- ...defaultShadows,
606
- },
607
- },
608
- },
609
- tertiary: {
610
- kind: 'ghost',
611
- effect: defaultGhostEffect,
612
- base: getDefaultGhostBase('alert'),
613
- state: {
614
- hover: {
615
- scale: 'up',
616
- backgroundColor: {
617
- type: 'spectrum',
618
- value: 'red-2',
619
- },
620
- borderColor: {
621
- type: 'palette',
622
- value: 'transparent',
623
- },
624
- color: {
625
- type: 'palette',
626
- value: 'alert',
627
- },
628
- ...defaultShadows,
629
- },
630
- pressed: {
631
- scale: 'down',
632
- backgroundColor: {
633
- type: 'spectrum',
634
- value: 'red-4',
635
- },
636
- borderColor: {
637
- type: 'palette',
638
- value: 'transparent',
639
- },
640
- color: {
641
- type: 'palette',
642
- value: 'alert',
643
- },
644
- ...defaultShadows,
645
- },
646
- },
647
- },
648
- },
649
- positive: {
650
- primary: {
651
- kind: 'fill',
652
- effect: defaultFillEffect,
653
- base: getDefaultFillBase('positive'),
654
- state: {
655
- hover: {
656
- scale: 'up',
657
- backgroundColor: {
658
- type: 'spectrum',
659
- value: 'green-10',
660
- },
661
- borderColor: {
662
- type: 'palette',
663
- value: 'transparent',
664
- },
665
- color: {
666
- type: 'palette',
667
- value: 'on-color',
668
- },
669
- ...defaultShadows,
670
- },
671
- pressed: {
672
- scale: 'down',
673
- backgroundColor: {
674
- type: 'spectrum',
675
- value: 'green-11',
676
- },
677
- borderColor: {
678
- type: 'palette',
679
- value: 'transparent',
680
- },
681
- color: {
682
- type: 'palette',
683
- value: 'on-color',
684
- },
685
- ...defaultShadows,
686
- },
687
- },
688
- },
689
- secondary: {
690
- kind: 'outline',
691
- effect: defaultOutlineEffect,
692
- base: getDefaultOutlineBase('positive'),
693
- state: {
694
- hover: {
695
- scale: 'up',
696
- backgroundColor: {
697
- type: 'palette',
698
- value: 'transparent',
699
- },
700
- borderColor: {
701
- type: 'spectrum',
702
- value: 'green-10',
703
- },
704
- color: {
705
- type: 'spectrum',
706
- value: 'green-10',
707
- },
708
- ...defaultShadows,
709
- },
710
- pressed: {
711
- scale: 'down',
712
- backgroundColor: {
713
- type: 'palette',
714
- value: 'transparent',
715
- },
716
- borderColor: {
717
- type: 'spectrum',
718
- value: 'green-11',
719
- },
720
- color: {
721
- type: 'spectrum',
722
- value: 'green-11',
723
- },
724
- ...defaultShadows,
725
- },
726
- },
727
- },
728
- tertiary: {
729
- kind: 'ghost',
730
- effect: defaultGhostEffect,
731
- base: getDefaultGhostBase('positive'),
732
- state: {
733
- hover: {
734
- scale: 'up',
735
- backgroundColor: {
736
- type: 'spectrum',
737
- value: 'green-2',
738
- },
739
- borderColor: {
740
- type: 'palette',
741
- value: 'transparent',
742
- },
743
- color: {
744
- type: 'palette',
745
- value: 'positive',
746
- },
747
- ...defaultShadows,
748
- },
749
- pressed: {
750
- scale: 'down',
751
- backgroundColor: {
752
- type: 'spectrum',
753
- value: 'green-4',
754
- },
755
- borderColor: {
756
- type: 'palette',
757
- value: 'transparent',
758
- },
759
- color: {
760
- type: 'palette',
761
- value: 'positive',
762
- },
763
- ...defaultShadows,
764
- },
765
- },
766
- },
767
- },
768
- warning: {
769
- primary: {
770
- kind: 'fill',
771
- effect: defaultFillEffect,
772
- base: getDefaultFillBase('warning'),
773
- state: {
774
- hover: {
775
- scale: 'up',
776
- backgroundColor: {
777
- type: 'spectrum',
778
- value: 'orange-10',
779
- },
780
- borderColor: {
781
- type: 'palette',
782
- value: 'transparent',
783
- },
784
- color: {
785
- type: 'palette',
786
- value: 'on-color',
787
- },
788
- ...defaultShadows,
789
- },
790
- pressed: {
791
- scale: 'down',
792
- backgroundColor: {
793
- type: 'spectrum',
794
- value: 'orange-11',
795
- },
796
- borderColor: {
797
- type: 'palette',
798
- value: 'transparent',
799
- },
800
- color: {
801
- type: 'palette',
802
- value: 'on-color',
803
- },
804
- ...defaultShadows,
805
- },
806
- },
807
- },
808
- secondary: {
809
- kind: 'outline',
810
- effect: defaultOutlineEffect,
811
- base: getDefaultOutlineBase('warning'),
812
- state: {
813
- hover: {
814
- scale: 'up',
815
- backgroundColor: {
816
- type: 'palette',
817
- value: 'transparent',
818
- },
819
- borderColor: {
820
- type: 'spectrum',
821
- value: 'orange-10',
822
- },
823
- color: {
824
- type: 'spectrum',
825
- value: 'orange-10',
826
- },
827
- ...defaultShadows,
828
- },
829
- pressed: {
830
- scale: 'down',
831
- backgroundColor: {
832
- type: 'palette',
833
- value: 'transparent',
834
- },
835
- borderColor: {
836
- type: 'spectrum',
837
- value: 'orange-11',
838
- },
839
- color: {
840
- type: 'spectrum',
841
- value: 'orange-11',
842
- },
843
- ...defaultShadows,
844
- },
845
- },
846
- },
847
- tertiary: {
848
- kind: 'ghost',
849
- effect: defaultGhostEffect,
850
- base: getDefaultGhostBase('warning'),
851
- state: {
852
- hover: {
853
- scale: 'up',
854
- backgroundColor: {
855
- type: 'spectrum',
856
- value: 'orange-2',
857
- },
858
- borderColor: {
859
- type: 'palette',
860
- value: 'transparent',
861
- },
862
- color: {
863
- type: 'palette',
864
- value: 'warning',
865
- },
866
- ...defaultShadows,
867
- },
868
- pressed: {
869
- scale: 'down',
870
- backgroundColor: {
871
- type: 'spectrum',
872
- value: 'orange-4',
873
- },
874
- borderColor: {
875
- type: 'palette',
876
- value: 'transparent',
877
- },
878
- color: {
879
- type: 'palette',
880
- value: 'warning',
881
- },
882
- ...defaultShadows,
883
- },
884
- },
885
- },
886
- },
887
- },
888
- };