@cdx-ui/components 0.0.1-alpha.2 → 0.0.1-alpha.21

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 (262) hide show
  1. package/README.md +2 -2
  2. package/lib/commonjs/components/Avatar/index.js +156 -0
  3. package/lib/commonjs/components/Avatar/index.js.map +1 -0
  4. package/lib/commonjs/components/Avatar/styles.js +80 -0
  5. package/lib/commonjs/components/Avatar/styles.js.map +1 -0
  6. package/lib/commonjs/components/BottomSheet/index.js +248 -0
  7. package/lib/commonjs/components/BottomSheet/index.js.map +1 -0
  8. package/lib/commonjs/components/BottomSheet/styles.js +61 -0
  9. package/lib/commonjs/components/BottomSheet/styles.js.map +1 -0
  10. package/lib/commonjs/components/Box/Box.js +1 -0
  11. package/lib/commonjs/components/Box/Box.js.map +1 -1
  12. package/lib/commonjs/components/Button/index.js +28 -13
  13. package/lib/commonjs/components/Button/index.js.map +1 -1
  14. package/lib/commonjs/components/Button/styles.js +323 -139
  15. package/lib/commonjs/components/Button/styles.js.map +1 -1
  16. package/lib/commonjs/components/Card/index.js +104 -0
  17. package/lib/commonjs/components/Card/index.js.map +1 -0
  18. package/lib/commonjs/components/Card/styles.js +28 -0
  19. package/lib/commonjs/components/Card/styles.js.map +1 -0
  20. package/lib/commonjs/components/Checkbox/index.js +180 -0
  21. package/lib/commonjs/components/Checkbox/index.js.map +1 -0
  22. package/lib/commonjs/components/Checkbox/styles.js +68 -0
  23. package/lib/commonjs/components/Checkbox/styles.js.map +1 -0
  24. package/lib/commonjs/components/Chip/index.js +103 -0
  25. package/lib/commonjs/components/Chip/index.js.map +1 -0
  26. package/lib/commonjs/components/Chip/styles.js +50 -0
  27. package/lib/commonjs/components/Chip/styles.js.map +1 -0
  28. package/lib/commonjs/components/Heading/index.js +35 -0
  29. package/lib/commonjs/components/Heading/index.js.map +1 -0
  30. package/lib/commonjs/components/Heading/styles.js +24 -0
  31. package/lib/commonjs/components/Heading/styles.js.map +1 -0
  32. package/lib/commonjs/components/Icon/index.js +61 -0
  33. package/lib/commonjs/components/Icon/index.js.map +1 -0
  34. package/lib/commonjs/components/Input/index.js +10 -16
  35. package/lib/commonjs/components/Input/index.js.map +1 -1
  36. package/lib/commonjs/components/Input/styles.js +16 -30
  37. package/lib/commonjs/components/Input/styles.js.map +1 -1
  38. package/lib/commonjs/components/Link/index.js +94 -0
  39. package/lib/commonjs/components/Link/index.js.map +1 -0
  40. package/lib/commonjs/components/Link/styles.js +16 -0
  41. package/lib/commonjs/components/Link/styles.js.map +1 -0
  42. package/lib/commonjs/components/Select/index.js +11 -12
  43. package/lib/commonjs/components/Select/index.js.map +1 -1
  44. package/lib/commonjs/components/Select/styles.js +29 -53
  45. package/lib/commonjs/components/Select/styles.js.map +1 -1
  46. package/lib/commonjs/components/Stack/HStack.js +8 -21
  47. package/lib/commonjs/components/Stack/HStack.js.map +1 -1
  48. package/lib/commonjs/components/Stack/VStack.js +8 -21
  49. package/lib/commonjs/components/Stack/VStack.js.map +1 -1
  50. package/lib/commonjs/components/Stack/styles.js +39 -0
  51. package/lib/commonjs/components/Stack/styles.js.map +1 -0
  52. package/lib/commonjs/components/Switch/BaseSwitch.js +46 -0
  53. package/lib/commonjs/components/Switch/BaseSwitch.js.map +1 -0
  54. package/lib/commonjs/components/Switch/BaseSwitch.web.js +56 -0
  55. package/lib/commonjs/components/Switch/BaseSwitch.web.js.map +1 -0
  56. package/lib/commonjs/components/Switch/index.js +13 -0
  57. package/lib/commonjs/components/Switch/index.js.map +1 -0
  58. package/lib/commonjs/components/Switch/styles.js +128 -0
  59. package/lib/commonjs/components/Switch/styles.js.map +1 -0
  60. package/lib/commonjs/components/Text/index.js +18 -9
  61. package/lib/commonjs/components/Text/index.js.map +1 -1
  62. package/lib/commonjs/components/Text/styles.js +24 -0
  63. package/lib/commonjs/components/Text/styles.js.map +1 -0
  64. package/lib/commonjs/components/VirtualizedList/index.js +19 -0
  65. package/lib/commonjs/components/VirtualizedList/index.js.map +1 -0
  66. package/lib/commonjs/components/index.js +120 -0
  67. package/lib/commonjs/components/index.js.map +1 -1
  68. package/lib/commonjs/metro/withCdxMetroConfig.js +24 -0
  69. package/lib/commonjs/metro/withCdxMetroConfig.js.map +1 -0
  70. package/lib/commonjs/styles/index.js +17 -0
  71. package/lib/commonjs/styles/index.js.map +1 -0
  72. package/lib/commonjs/styles/primitives.js +123 -0
  73. package/lib/commonjs/styles/primitives.js.map +1 -0
  74. package/lib/module/components/Avatar/index.js +152 -0
  75. package/lib/module/components/Avatar/index.js.map +1 -0
  76. package/lib/module/components/Avatar/styles.js +77 -0
  77. package/lib/module/components/Avatar/styles.js.map +1 -0
  78. package/lib/module/components/BottomSheet/index.js +242 -0
  79. package/lib/module/components/BottomSheet/index.js.map +1 -0
  80. package/lib/module/components/BottomSheet/styles.js +58 -0
  81. package/lib/module/components/BottomSheet/styles.js.map +1 -0
  82. package/lib/module/components/Box/Box.js +1 -0
  83. package/lib/module/components/Box/Box.js.map +1 -1
  84. package/lib/module/components/Button/index.js +29 -14
  85. package/lib/module/components/Button/index.js.map +1 -1
  86. package/lib/module/components/Button/styles.js +322 -138
  87. package/lib/module/components/Button/styles.js.map +1 -1
  88. package/lib/module/components/Card/index.js +100 -0
  89. package/lib/module/components/Card/index.js.map +1 -0
  90. package/lib/module/components/Card/styles.js +25 -0
  91. package/lib/module/components/Card/styles.js.map +1 -0
  92. package/lib/module/components/Checkbox/index.js +176 -0
  93. package/lib/module/components/Checkbox/index.js.map +1 -0
  94. package/lib/module/components/Checkbox/styles.js +64 -0
  95. package/lib/module/components/Checkbox/styles.js.map +1 -0
  96. package/lib/module/components/Chip/index.js +99 -0
  97. package/lib/module/components/Chip/index.js.map +1 -0
  98. package/lib/module/components/Chip/styles.js +46 -0
  99. package/lib/module/components/Chip/styles.js.map +1 -0
  100. package/lib/module/components/Heading/index.js +31 -0
  101. package/lib/module/components/Heading/index.js.map +1 -0
  102. package/lib/module/components/Heading/styles.js +20 -0
  103. package/lib/module/components/Heading/styles.js.map +1 -0
  104. package/lib/module/components/Icon/index.js +57 -0
  105. package/lib/module/components/Icon/index.js.map +1 -0
  106. package/lib/module/components/Input/index.js +10 -16
  107. package/lib/module/components/Input/index.js.map +1 -1
  108. package/lib/module/components/Input/styles.js +16 -30
  109. package/lib/module/components/Input/styles.js.map +1 -1
  110. package/lib/module/components/Link/index.js +85 -0
  111. package/lib/module/components/Link/index.js.map +1 -0
  112. package/lib/module/components/Link/styles.js +12 -0
  113. package/lib/module/components/Link/styles.js.map +1 -0
  114. package/lib/module/components/Select/index.js +12 -13
  115. package/lib/module/components/Select/index.js.map +1 -1
  116. package/lib/module/components/Select/styles.js +29 -53
  117. package/lib/module/components/Select/styles.js.map +1 -1
  118. package/lib/module/components/Stack/HStack.js +8 -21
  119. package/lib/module/components/Stack/HStack.js.map +1 -1
  120. package/lib/module/components/Stack/VStack.js +8 -21
  121. package/lib/module/components/Stack/VStack.js.map +1 -1
  122. package/lib/module/components/Stack/styles.js +35 -0
  123. package/lib/module/components/Stack/styles.js.map +1 -0
  124. package/lib/module/components/Switch/BaseSwitch.js +42 -0
  125. package/lib/module/components/Switch/BaseSwitch.js.map +1 -0
  126. package/lib/module/components/Switch/BaseSwitch.web.js +52 -0
  127. package/lib/module/components/Switch/BaseSwitch.web.js.map +1 -0
  128. package/lib/module/components/Switch/index.js +9 -0
  129. package/lib/module/components/Switch/index.js.map +1 -0
  130. package/lib/module/components/Switch/styles.js +125 -0
  131. package/lib/module/components/Switch/styles.js.map +1 -0
  132. package/lib/module/components/Text/index.js +19 -1
  133. package/lib/module/components/Text/index.js.map +1 -1
  134. package/lib/module/components/Text/styles.js +20 -0
  135. package/lib/module/components/Text/styles.js.map +1 -0
  136. package/lib/module/components/VirtualizedList/index.js +15 -0
  137. package/lib/module/components/VirtualizedList/index.js.map +1 -0
  138. package/lib/module/components/index.js +10 -0
  139. package/lib/module/components/index.js.map +1 -1
  140. package/lib/module/metro/withCdxMetroConfig.js +20 -0
  141. package/lib/module/metro/withCdxMetroConfig.js.map +1 -0
  142. package/lib/module/styles/index.js +4 -0
  143. package/lib/module/styles/index.js.map +1 -0
  144. package/lib/module/styles/primitives.js +119 -0
  145. package/lib/module/styles/primitives.js.map +1 -0
  146. package/lib/typescript/components/Avatar/index.d.ts +40 -0
  147. package/lib/typescript/components/Avatar/index.d.ts.map +1 -0
  148. package/lib/typescript/components/Avatar/styles.d.ts +16 -0
  149. package/lib/typescript/components/Avatar/styles.d.ts.map +1 -0
  150. package/lib/typescript/components/BottomSheet/index.d.ts +61 -0
  151. package/lib/typescript/components/BottomSheet/index.d.ts.map +1 -0
  152. package/lib/typescript/components/BottomSheet/styles.d.ts +16 -0
  153. package/lib/typescript/components/BottomSheet/styles.d.ts.map +1 -0
  154. package/lib/typescript/components/Box/Box.d.ts +1 -0
  155. package/lib/typescript/components/Box/Box.d.ts.map +1 -1
  156. package/lib/typescript/components/Button/index.d.ts +6 -3
  157. package/lib/typescript/components/Button/index.d.ts.map +1 -1
  158. package/lib/typescript/components/Button/styles.d.ts +14 -8
  159. package/lib/typescript/components/Button/styles.d.ts.map +1 -1
  160. package/lib/typescript/components/Card/index.d.ts +30 -0
  161. package/lib/typescript/components/Card/index.d.ts.map +1 -0
  162. package/lib/typescript/components/Card/styles.d.ts +6 -0
  163. package/lib/typescript/components/Card/styles.d.ts.map +1 -0
  164. package/lib/typescript/components/Checkbox/index.d.ts +46 -0
  165. package/lib/typescript/components/Checkbox/index.d.ts.map +1 -0
  166. package/lib/typescript/components/Checkbox/styles.d.ts +18 -0
  167. package/lib/typescript/components/Checkbox/styles.d.ts.map +1 -0
  168. package/lib/typescript/components/Chip/index.d.ts +27 -0
  169. package/lib/typescript/components/Chip/index.d.ts.map +1 -0
  170. package/lib/typescript/components/Chip/styles.d.ts +12 -0
  171. package/lib/typescript/components/Chip/styles.d.ts.map +1 -0
  172. package/lib/typescript/components/Heading/index.d.ts +10 -0
  173. package/lib/typescript/components/Heading/index.d.ts.map +1 -0
  174. package/lib/typescript/components/Heading/styles.d.ts +6 -0
  175. package/lib/typescript/components/Heading/styles.d.ts.map +1 -0
  176. package/lib/typescript/components/Icon/index.d.ts +27 -0
  177. package/lib/typescript/components/Icon/index.d.ts.map +1 -0
  178. package/lib/typescript/components/Input/index.d.ts +6 -4
  179. package/lib/typescript/components/Input/index.d.ts.map +1 -1
  180. package/lib/typescript/components/Input/styles.d.ts +5 -7
  181. package/lib/typescript/components/Input/styles.d.ts.map +1 -1
  182. package/lib/typescript/components/Link/index.d.ts +26 -0
  183. package/lib/typescript/components/Link/index.d.ts.map +1 -0
  184. package/lib/typescript/components/Link/styles.d.ts +4 -0
  185. package/lib/typescript/components/Link/styles.d.ts.map +1 -0
  186. package/lib/typescript/components/Select/index.d.ts +6 -3
  187. package/lib/typescript/components/Select/index.d.ts.map +1 -1
  188. package/lib/typescript/components/Select/styles.d.ts +6 -8
  189. package/lib/typescript/components/Select/styles.d.ts.map +1 -1
  190. package/lib/typescript/components/Stack/HStack.d.ts +1 -12
  191. package/lib/typescript/components/Stack/HStack.d.ts.map +1 -1
  192. package/lib/typescript/components/Stack/VStack.d.ts +1 -12
  193. package/lib/typescript/components/Stack/VStack.d.ts.map +1 -1
  194. package/lib/typescript/components/Stack/styles.d.ts +10 -0
  195. package/lib/typescript/components/Stack/styles.d.ts.map +1 -0
  196. package/lib/typescript/components/Switch/BaseSwitch.d.ts +9 -0
  197. package/lib/typescript/components/Switch/BaseSwitch.d.ts.map +1 -0
  198. package/lib/typescript/components/Switch/BaseSwitch.web.d.ts +15 -0
  199. package/lib/typescript/components/Switch/BaseSwitch.web.d.ts.map +1 -0
  200. package/lib/typescript/components/Switch/index.d.ts +8 -0
  201. package/lib/typescript/components/Switch/index.d.ts.map +1 -0
  202. package/lib/typescript/components/Switch/styles.d.ts +26 -0
  203. package/lib/typescript/components/Switch/styles.d.ts.map +1 -0
  204. package/lib/typescript/components/Text/index.d.ts +9 -1
  205. package/lib/typescript/components/Text/index.d.ts.map +1 -1
  206. package/lib/typescript/components/Text/styles.d.ts +6 -0
  207. package/lib/typescript/components/Text/styles.d.ts.map +1 -0
  208. package/lib/typescript/components/VirtualizedList/index.d.ts +8 -0
  209. package/lib/typescript/components/VirtualizedList/index.d.ts.map +1 -0
  210. package/lib/typescript/components/index.d.ts +10 -0
  211. package/lib/typescript/components/index.d.ts.map +1 -1
  212. package/lib/typescript/metro/withCdxMetroConfig.d.ts +19 -0
  213. package/lib/typescript/metro/withCdxMetroConfig.d.ts.map +1 -0
  214. package/lib/typescript/styles/index.d.ts +2 -0
  215. package/lib/typescript/styles/index.d.ts.map +1 -0
  216. package/lib/typescript/styles/primitives.d.ts +85 -0
  217. package/lib/typescript/styles/primitives.d.ts.map +1 -0
  218. package/package.json +22 -13
  219. package/src/components/Avatar/index.tsx +174 -0
  220. package/src/components/Avatar/styles.ts +83 -0
  221. package/src/components/BottomSheet/index.tsx +316 -0
  222. package/src/components/BottomSheet/styles.ts +79 -0
  223. package/src/components/Box/Box.tsx +1 -0
  224. package/src/components/Button/index.tsx +23 -15
  225. package/src/components/Button/styles.ts +353 -144
  226. package/src/components/Card/index.tsx +115 -0
  227. package/src/components/Card/styles.ts +41 -0
  228. package/src/components/Checkbox/index.tsx +209 -0
  229. package/src/components/Checkbox/styles.ts +103 -0
  230. package/src/components/Chip/index.tsx +91 -0
  231. package/src/components/Chip/styles.ts +51 -0
  232. package/src/components/Heading/index.tsx +36 -0
  233. package/src/components/Heading/styles.tsx +26 -0
  234. package/src/components/Icon/index.tsx +54 -0
  235. package/src/components/Input/index.tsx +9 -20
  236. package/src/components/Input/styles.ts +42 -37
  237. package/src/components/Link/index.tsx +83 -0
  238. package/src/components/Link/styles.ts +20 -0
  239. package/src/components/Select/index.tsx +12 -11
  240. package/src/components/Select/styles.ts +63 -74
  241. package/src/components/Stack/HStack.tsx +8 -19
  242. package/src/components/Stack/VStack.tsx +8 -23
  243. package/src/components/Stack/styles.ts +37 -0
  244. package/src/components/Switch/BaseSwitch.tsx +38 -0
  245. package/src/components/Switch/BaseSwitch.web.tsx +69 -0
  246. package/src/components/Switch/index.tsx +13 -0
  247. package/src/components/Switch/styles.ts +120 -0
  248. package/src/components/Text/index.tsx +16 -0
  249. package/src/components/Text/styles.tsx +26 -0
  250. package/src/components/VirtualizedList/index.tsx +19 -0
  251. package/src/components/index.ts +10 -0
  252. package/src/metro/withCdxMetroConfig.ts +29 -0
  253. package/src/styles/index.ts +1 -0
  254. package/src/styles/primitives.ts +107 -0
  255. package/lib/commonjs/components/Text/Text.js +0 -30
  256. package/lib/commonjs/components/Text/Text.js.map +0 -1
  257. package/lib/module/components/Text/Text.js +0 -26
  258. package/lib/module/components/Text/Text.js.map +0 -1
  259. package/lib/typescript/components/Text/Text.d.ts +0 -11
  260. package/lib/typescript/components/Text/Text.d.ts.map +0 -1
  261. package/src/components/Text/Text.tsx +0 -58
  262. package/src/components/Text/index.ts +0 -1
@@ -1,5 +1,13 @@
1
1
  import { Platform } from 'react-native';
2
2
  import { cva, type VariantProps } from 'class-variance-authority';
3
+ import {
4
+ COLOR_BORDER_DEFAULT,
5
+ DISABLED_CURSOR,
6
+ DISABLED_OPACITY,
7
+ RADIUS_SM,
8
+ SEMANTIC_COLORS,
9
+ TRANSITION_COLORS,
10
+ } from '../../styles/primitives';
3
11
 
4
12
  // TODO: Split into 2 files
5
13
  // TODO: Create cva wrapper
@@ -7,37 +15,43 @@ import { cva, type VariantProps } from 'class-variance-authority';
7
15
  export const buttonRootVariants = cva(
8
16
  [
9
17
  'flex-row items-center justify-center',
10
- 'rounded-md',
11
- 'transition-colors duration-150', // TODO: Transition not working on mobile
12
- 'data-[disabled=true]:opacity-60 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:pointer-events-none',
13
- 'data-[focus-visible=true]:ring-2 data-[focus-visible=true]:ring-ring data-[focus-visible=true]:ring-offset-2 data-[focus-visible=true]:ring-offset-bg',
18
+ RADIUS_SM,
19
+ 'web:outline-none web:focus:outline-none web:focus-visible:outline-none',
20
+ TRANSITION_COLORS,
21
+ DISABLED_OPACITY,
22
+ DISABLED_CURSOR,
23
+ 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-slate-400/50 web:data-[focus-visible=true]:ring-offset-2',
14
24
  ],
15
25
  {
16
26
  variants: {
17
27
  variant: {
18
- solid: [],
19
- subtle: [],
28
+ strong: [],
20
29
  outline: [
21
- 'bg-transparent border border-border',
22
- 'data-[hover=true]:bg-surface',
23
- 'data-[active=true]:bg-surface-raised',
30
+ 'bg-transparent',
31
+ `border ${COLOR_BORDER_DEFAULT}`,
32
+ 'data-[hover=true]:bg-slate-50',
33
+ 'data-[active=true]:bg-slate-100',
24
34
  ],
25
35
  ghost: [
26
36
  'bg-transparent',
27
- 'data-[hover=true]:bg-surface',
28
- 'data-[active=true]:bg-surface-raised',
37
+ 'data-[hover=true]:bg-slate-50',
38
+ 'data-[active=true]:bg-slate-100',
29
39
  ],
30
40
  },
31
41
  color: {
32
- primary: [],
33
- secondary: [],
34
- success: [],
42
+ action: [],
35
43
  danger: [],
44
+ warning: [],
45
+ success: [],
46
+ info: [],
36
47
  },
37
48
  size: {
38
- sm: 'h-8 px-3 gap-1.5',
39
- md: 'h-10 px-4 gap-2',
40
- lg: 'h-12 px-6 gap-2.5',
49
+ default: 'h-10 px-4 gap-2',
50
+ small: 'h-8 px-3 gap-1.5',
51
+ },
52
+ mode: {
53
+ light: [],
54
+ dark: [],
41
55
  },
42
56
  fullWidth: {
43
57
  true: 'w-full',
@@ -45,22 +59,34 @@ export const buttonRootVariants = cva(
45
59
  },
46
60
  },
47
61
  compoundVariants: [
62
+ // --- strong × color (light mode) ---
48
63
  {
49
- variant: 'solid',
50
- color: 'primary',
64
+ variant: 'strong',
65
+ color: 'action',
66
+ className: [
67
+ SEMANTIC_COLORS.action.bg,
68
+ Platform.select({
69
+ default: 'data-[active=true]:bg-slate-700',
70
+ web: 'data-[hover=true]:bg-slate-800 data-[active=true]:data-[hover=true]:bg-slate-700',
71
+ }),
72
+ ],
73
+ },
74
+ {
75
+ variant: 'strong',
76
+ color: 'danger',
51
77
  className: [
52
- 'bg-blue-500',
78
+ SEMANTIC_COLORS.danger.bg,
53
79
  Platform.select({
54
- default: 'data-[active=true]:bg-blue-700',
55
- web: 'data-[hover=true]:bg-blue-600 data-[active=true]:data-[hover=true]:bg-blue-700',
80
+ default: 'data-[active=true]:bg-red-800',
81
+ web: 'data-[hover=true]:bg-red-700 data-[active=true]:data-[hover=true]:bg-red-800',
56
82
  }),
57
83
  ],
58
84
  },
59
85
  {
60
- variant: 'solid',
61
- color: 'secondary',
86
+ variant: 'strong',
87
+ color: 'warning',
62
88
  className: [
63
- 'bg-amber-500',
89
+ SEMANTIC_COLORS.warning.bg,
64
90
  Platform.select({
65
91
  default: 'data-[active=true]:bg-amber-700',
66
92
  web: 'data-[hover=true]:bg-amber-600 data-[active=true]:data-[hover=true]:bg-amber-700',
@@ -68,131 +94,177 @@ export const buttonRootVariants = cva(
68
94
  ],
69
95
  },
70
96
  {
71
- variant: 'solid',
97
+ variant: 'strong',
72
98
  color: 'success',
73
99
  className: [
74
- 'bg-green-500',
100
+ SEMANTIC_COLORS.success.bg,
75
101
  Platform.select({
76
- default: 'data-[active=true]:bg-green-700',
77
- web: 'data-[hover=true]:bg-green-600 data-[active=true]:data-[hover=true]:bg-green-700',
102
+ default: 'data-[active=true]:bg-green-800',
103
+ web: 'data-[hover=true]:bg-green-700 data-[active=true]:data-[hover=true]:bg-green-800',
78
104
  }),
79
105
  ],
80
106
  },
81
107
  {
82
- variant: 'solid',
83
- color: 'danger',
108
+ variant: 'strong',
109
+ color: 'info',
110
+ className: [
111
+ SEMANTIC_COLORS.info.bg,
112
+ Platform.select({
113
+ default: 'data-[active=true]:bg-sky-700',
114
+ web: 'data-[hover=true]:bg-sky-600 data-[active=true]:data-[hover=true]:bg-sky-700',
115
+ }),
116
+ ],
117
+ },
118
+
119
+ // --- strong × action × mode: dark ---
120
+ {
121
+ variant: 'strong',
122
+ color: 'action',
123
+ mode: 'dark',
124
+ className: [
125
+ 'bg-slate-200',
126
+ Platform.select({
127
+ default: 'data-[active=true]:bg-slate-400',
128
+ web: 'data-[hover=true]:bg-slate-300 data-[active=true]:data-[hover=true]:bg-slate-400',
129
+ }),
130
+ ],
131
+ },
132
+
133
+ // --- outline × color (light mode) ---
134
+ {
135
+ variant: 'outline',
136
+ color: 'action',
84
137
  className: [
85
- 'bg-red-500',
138
+ 'border-slate-300',
86
139
  Platform.select({
87
- default: 'data-[active=true]:bg-red-700',
88
- web: 'data-[hover=true]:bg-red-600 data-[active=true]:data-[hover=true]:bg-red-700',
140
+ default: 'data-[active=true]:border-slate-500 data-[active=true]:bg-slate-100',
141
+ web: 'data-[hover=true]:border-slate-400 data-[hover=true]:bg-slate-50 data-[active=true]:data-[hover=true]:border-slate-500 data-[active=true]:data-[hover=true]:bg-slate-100',
89
142
  }),
90
143
  ],
91
144
  },
92
145
  {
93
- variant: 'subtle',
94
- color: 'primary',
146
+ variant: 'outline',
147
+ color: 'danger',
95
148
  className: [
96
- 'bg-blue-100',
149
+ 'border-red-600',
97
150
  Platform.select({
98
- default: 'data-[active=true]:bg-blue-200',
99
- web: 'data-[hover=true]:bg-blue-200 data-[active=true]:data-[hover=true]:bg-blue-300',
151
+ default: 'data-[active=true]:border-red-800 data-[active=true]:bg-red-100',
152
+ web: 'data-[hover=true]:border-red-700 data-[hover=true]:bg-red-50 data-[active=true]:data-[hover=true]:border-red-800 data-[active=true]:data-[hover=true]:bg-red-100',
100
153
  }),
101
154
  ],
102
155
  },
103
156
  {
104
- variant: 'subtle',
105
- color: 'secondary',
157
+ variant: 'outline',
158
+ color: 'warning',
106
159
  className: [
107
- 'bg-amber-200',
160
+ 'border-amber-500',
108
161
  Platform.select({
109
- default: 'data-[active=true]:bg-amber-300',
110
- web: 'data-[hover=true]:bg-amber-300 data-[active=true]:data-[hover=true]:bg-amber-400',
162
+ default: 'data-[active=true]:border-amber-700 data-[active=true]:bg-amber-50',
163
+ web: 'data-[hover=true]:border-amber-600 data-[hover=true]:bg-amber-50 data-[active=true]:data-[hover=true]:border-amber-700 data-[active=true]:data-[hover=true]:bg-amber-100',
111
164
  }),
112
165
  ],
113
166
  },
114
167
  {
115
- variant: 'subtle',
168
+ variant: 'outline',
116
169
  color: 'success',
117
170
  className: [
118
- 'bg-green-200',
171
+ 'border-green-600',
119
172
  Platform.select({
120
- default: 'data-[active=true]:bg-green-300',
121
- web: 'data-[hover=true]:bg-green-300 data-[active=true]:data-[hover=true]:bg-green-400',
173
+ default: 'data-[active=true]:border-green-800 data-[active=true]:bg-green-100',
174
+ web: 'data-[hover=true]:border-green-700 data-[hover=true]:bg-green-50 data-[active=true]:data-[hover=true]:border-green-800 data-[active=true]:data-[hover=true]:bg-green-100',
122
175
  }),
123
176
  ],
124
177
  },
125
178
  {
126
- variant: 'subtle',
127
- color: 'danger',
179
+ variant: 'outline',
180
+ color: 'info',
128
181
  className: [
129
- 'bg-red-200',
182
+ 'border-sky-500',
130
183
  Platform.select({
131
- default: 'data-[active=true]:bg-red-300',
132
- web: 'data-[hover=true]:bg-red-300 data-[active=true]:data-[hover=true]:bg-red-400',
184
+ default: 'data-[active=true]:border-sky-700 data-[active=true]:bg-sky-100',
185
+ web: 'data-[hover=true]:border-sky-600 data-[hover=true]:bg-sky-50 data-[active=true]:data-[hover=true]:border-sky-700 data-[active=true]:data-[hover=true]:bg-sky-100',
133
186
  }),
134
187
  ],
135
188
  },
189
+
190
+ // --- outline × action × mode: dark ---
136
191
  {
137
192
  variant: 'outline',
138
- color: 'primary',
193
+ color: 'action',
194
+ mode: 'dark',
139
195
  className: [
140
- 'border-blue-500',
196
+ 'bg-transparent border-slate-700',
141
197
  Platform.select({
142
- default: 'data-[active=true]:border-blue-700 data-[active=true]:bg-blue-100',
143
- web: 'data-[hover=true]:border-blue-600 data-[hover=true]:bg-blue-100 data-[active=true]:data-[hover=true]:border-blue-700 data-[active=true]:data-[hover=true]:bg-blue-200',
198
+ default: 'data-[active=true]:bg-slate-700',
199
+ web: 'data-[hover=true]:bg-slate-800 data-[active=true]:data-[hover=true]:bg-slate-700',
144
200
  }),
145
201
  ],
146
202
  },
203
+ // --- outline × semantic colors × mode: dark ---
147
204
  {
148
205
  variant: 'outline',
149
- color: 'secondary',
206
+ color: 'danger',
207
+ mode: 'dark',
150
208
  className: [
151
- 'border-amber-500',
209
+ 'bg-transparent border-red-500',
152
210
  Platform.select({
153
- default: 'data-[active=true]:border-amber-700 data-[active=true]:bg-amber-50',
154
- web: 'data-[hover=true]:border-amber-600 data-[hover=true]:bg-amber-50 data-[active=true]:data-[hover=true]:border-amber-700 data-[active=true]:data-[hover=true]:bg-amber-100',
211
+ default: 'data-[active=true]:bg-red-950',
212
+ web: 'data-[hover=true]:bg-red-950/50 data-[active=true]:data-[hover=true]:bg-red-950',
213
+ }),
214
+ ],
215
+ },
216
+ {
217
+ variant: 'outline',
218
+ color: 'warning',
219
+ mode: 'dark',
220
+ className: [
221
+ 'bg-transparent border-amber-500',
222
+ Platform.select({
223
+ default: 'data-[active=true]:bg-amber-950',
224
+ web: 'data-[hover=true]:bg-amber-950/50 data-[active=true]:data-[hover=true]:bg-amber-950',
155
225
  }),
156
226
  ],
157
227
  },
158
228
  {
159
229
  variant: 'outline',
160
230
  color: 'success',
231
+ mode: 'dark',
161
232
  className: [
162
- 'border-green-500',
233
+ 'bg-transparent border-green-500',
163
234
  Platform.select({
164
- default: 'data-[active=true]:border-green-700 data-[active=true]:bg-green-100',
165
- web: 'data-[hover=true]:border-green-600 data-[hover=true]:bg-green-100 data-[active=true]:data-[hover=true]:border-green-700 data-[active=true]:data-[hover=true]:bg-green-200',
235
+ default: 'data-[active=true]:bg-green-950',
236
+ web: 'data-[hover=true]:bg-green-950/50 data-[active=true]:data-[hover=true]:bg-green-950',
166
237
  }),
167
238
  ],
168
239
  },
169
240
  {
170
241
  variant: 'outline',
171
- color: 'danger',
242
+ color: 'info',
243
+ mode: 'dark',
172
244
  className: [
173
- 'border-red-500',
245
+ 'bg-transparent border-sky-500',
174
246
  Platform.select({
175
- default: 'data-[active=true]:border-red-700 data-[active=true]:bg-red-100',
176
- web: 'data-[hover=true]:border-red-600 data-[hover=true]:bg-red-100 data-[active=true]:data-[hover=true]:border-red-700 data-[active=true]:data-[hover=true]:bg-red-200',
247
+ default: 'data-[active=true]:bg-sky-950',
248
+ web: 'data-[hover=true]:bg-sky-950/50 data-[active=true]:data-[hover=true]:bg-sky-950',
177
249
  }),
178
250
  ],
179
251
  },
252
+
253
+ // --- ghost × color (light mode, non-action) ---
180
254
  {
181
255
  variant: 'ghost',
182
- color: 'primary',
256
+ color: 'danger',
183
257
  className: [
184
- 'bg-transparent',
185
258
  Platform.select({
186
- default: 'data-[active=true]:bg-blue-100',
187
- web: 'data-[hover=true]:bg-blue-50 data-[active=true]:data-[hover=true]:bg-blue-100',
259
+ default: 'data-[active=true]:bg-red-100',
260
+ web: 'data-[hover=true]:bg-red-50 data-[active=true]:data-[hover=true]:bg-red-100',
188
261
  }),
189
262
  ],
190
263
  },
191
264
  {
192
265
  variant: 'ghost',
193
- color: 'secondary',
266
+ color: 'warning',
194
267
  className: [
195
- 'bg-transparent',
196
268
  Platform.select({
197
269
  default: 'data-[active=true]:bg-amber-100',
198
270
  web: 'data-[hover=true]:bg-amber-50 data-[active=true]:data-[hover=true]:bg-amber-100',
@@ -203,29 +275,86 @@ export const buttonRootVariants = cva(
203
275
  variant: 'ghost',
204
276
  color: 'success',
205
277
  className: [
206
- 'bg-transparent',
207
278
  Platform.select({
208
279
  default: 'data-[active=true]:bg-green-100',
209
280
  web: 'data-[hover=true]:bg-green-50 data-[active=true]:data-[hover=true]:bg-green-100',
210
281
  }),
211
282
  ],
212
283
  },
284
+ {
285
+ variant: 'ghost',
286
+ color: 'info',
287
+ className: [
288
+ Platform.select({
289
+ default: 'data-[active=true]:bg-sky-100',
290
+ web: 'data-[hover=true]:bg-sky-50 data-[active=true]:data-[hover=true]:bg-sky-100',
291
+ }),
292
+ ],
293
+ },
294
+
295
+ // --- ghost × action × mode: dark ---
296
+ {
297
+ variant: 'ghost',
298
+ color: 'action',
299
+ mode: 'dark',
300
+ className: [
301
+ Platform.select({
302
+ default: 'data-[active=true]:bg-slate-700',
303
+ web: 'data-[hover=true]:bg-slate-800 data-[active=true]:data-[hover=true]:bg-slate-700',
304
+ }),
305
+ ],
306
+ },
307
+ // --- ghost × semantic colors × mode: dark ---
213
308
  {
214
309
  variant: 'ghost',
215
310
  color: 'danger',
311
+ mode: 'dark',
216
312
  className: [
217
- 'bg-transparent',
218
313
  Platform.select({
219
- default: 'data-[active=true]:bg-red-100',
220
- web: 'data-[hover=true]:bg-red-50 data-[active=true]:data-[hover=true]:bg-red-100',
314
+ default: 'data-[active=true]:bg-red-950',
315
+ web: 'data-[hover=true]:bg-red-950/50 data-[active=true]:data-[hover=true]:bg-red-950',
316
+ }),
317
+ ],
318
+ },
319
+ {
320
+ variant: 'ghost',
321
+ color: 'warning',
322
+ mode: 'dark',
323
+ className: [
324
+ Platform.select({
325
+ default: 'data-[active=true]:bg-amber-950',
326
+ web: 'data-[hover=true]:bg-amber-950/50 data-[active=true]:data-[hover=true]:bg-amber-950',
327
+ }),
328
+ ],
329
+ },
330
+ {
331
+ variant: 'ghost',
332
+ color: 'success',
333
+ mode: 'dark',
334
+ className: [
335
+ Platform.select({
336
+ default: 'data-[active=true]:bg-green-950',
337
+ web: 'data-[hover=true]:bg-green-950/50 data-[active=true]:data-[hover=true]:bg-green-950',
338
+ }),
339
+ ],
340
+ },
341
+ {
342
+ variant: 'ghost',
343
+ color: 'info',
344
+ mode: 'dark',
345
+ className: [
346
+ Platform.select({
347
+ default: 'data-[active=true]:bg-sky-950',
348
+ web: 'data-[hover=true]:bg-sky-950/50 data-[active=true]:data-[hover=true]:bg-sky-950',
221
349
  }),
222
350
  ],
223
351
  },
224
352
  ],
225
353
  defaultVariants: {
226
- variant: 'solid',
227
- color: 'primary',
228
- size: 'md',
354
+ variant: 'strong',
355
+ color: 'action',
356
+ size: 'default',
357
+ mode: 'light',
229
358
  fullWidth: false,
230
359
  },
231
360
  },
@@ -234,58 +363,63 @@ export const buttonRootVariants = cva(
234
363
  export const buttonTextVariants = cva(['font-medium', 'text-center'], {
235
364
  variants: {
236
365
  variant: {
237
- solid: 'text-white',
238
- subtle: [],
366
+ strong: [],
239
367
  outline: [],
240
368
  ghost: [],
241
369
  },
242
370
  color: {
243
- primary: [],
244
- secondary: [],
245
- success: [],
371
+ action: [],
246
372
  danger: [],
373
+ warning: [],
374
+ success: [],
375
+ info: [],
247
376
  },
248
377
  size: {
249
- sm: 'text-sm',
250
- md: 'text-base',
251
- lg: 'text-lg',
378
+ default: 'text-base',
379
+ small: 'text-sm',
380
+ },
381
+ mode: {
382
+ light: [],
383
+ dark: [],
252
384
  },
253
385
  },
254
386
  compoundVariants: [
387
+ // --- strong × color (light mode) — always white text ---
388
+ { variant: 'strong', color: 'action', className: 'text-white' },
389
+ { variant: 'strong', color: 'danger', className: 'text-white' },
390
+ { variant: 'strong', color: 'warning', className: 'text-white' },
391
+ { variant: 'strong', color: 'success', className: 'text-white' },
392
+ { variant: 'strong', color: 'info', className: 'text-white' },
393
+
394
+ // --- strong × action × mode: dark ---
395
+ { variant: 'strong', color: 'action', mode: 'dark', className: 'text-slate-900' },
396
+
397
+ // --- outline/ghost × color (light mode text) ---
255
398
  {
256
- variant: 'subtle',
257
- color: 'primary',
258
- className: 'text-blue-950',
259
- },
260
- {
261
- variant: 'subtle',
262
- color: 'secondary',
263
- className: 'text-amber-950',
264
- },
265
- {
266
- variant: 'subtle',
267
- color: 'success',
268
- className: 'text-green-950',
269
- },
270
- {
271
- variant: 'subtle',
272
- color: 'danger',
273
- className: 'text-red-950',
399
+ variant: ['outline', 'ghost'],
400
+ color: 'action',
401
+ className: [
402
+ 'text-slate-900',
403
+ Platform.select({
404
+ default: 'data-[active=true]:text-slate-700',
405
+ web: 'data-[hover=true]:text-slate-800 data-[active=true]:data-[hover=true]:text-slate-700',
406
+ }),
407
+ ],
274
408
  },
275
409
  {
276
410
  variant: ['outline', 'ghost'],
277
- color: 'primary',
411
+ color: 'danger',
278
412
  className: [
279
- 'text-blue-500',
413
+ 'text-red-600',
280
414
  Platform.select({
281
- default: 'data-[active=true]:text-blue-700',
282
- web: 'data-[hover=true]:text-blue-600 data-[active=true]:data-[hover=true]:text-blue-700',
415
+ default: 'data-[active=true]:text-red-800',
416
+ web: 'data-[hover=true]:text-red-700 data-[active=true]:data-[hover=true]:text-red-800',
283
417
  }),
284
418
  ],
285
419
  },
286
420
  {
287
421
  variant: ['outline', 'ghost'],
288
- color: 'secondary',
422
+ color: 'warning',
289
423
  className: [
290
424
  'text-amber-600',
291
425
  Platform.select({
@@ -307,83 +441,146 @@ export const buttonTextVariants = cva(['font-medium', 'text-center'], {
307
441
  },
308
442
  {
309
443
  variant: ['outline', 'ghost'],
310
- color: 'danger',
444
+ color: 'info',
311
445
  className: [
312
- 'text-red-500',
446
+ 'text-sky-600',
313
447
  Platform.select({
314
- default: 'data-[active=true]:text-red-700',
315
- web: 'data-[hover=true]:text-red-600 data-[active=true]:data-[hover=true]:text-red-700',
448
+ default: 'data-[active=true]:text-sky-800',
449
+ web: 'data-[hover=true]:text-sky-700 data-[active=true]:data-[hover=true]:text-sky-800',
316
450
  }),
317
451
  ],
318
452
  },
453
+
454
+ // --- outline/ghost × action × mode: dark ---
455
+ {
456
+ variant: ['outline', 'ghost'],
457
+ color: 'action',
458
+ mode: 'dark',
459
+ className: [
460
+ 'text-white',
461
+ Platform.select({
462
+ default: 'data-[active=true]:text-white',
463
+ web: 'data-[hover=true]:text-white data-[active=true]:data-[hover=true]:text-white',
464
+ }),
465
+ ],
466
+ },
467
+ // --- outline/ghost × semantic colors × mode: dark ---
468
+ {
469
+ variant: ['outline', 'ghost'],
470
+ color: 'danger',
471
+ mode: 'dark',
472
+ className: 'text-red-400',
473
+ },
474
+ {
475
+ variant: ['outline', 'ghost'],
476
+ color: 'warning',
477
+ mode: 'dark',
478
+ className: 'text-amber-400',
479
+ },
480
+ {
481
+ variant: ['outline', 'ghost'],
482
+ color: 'success',
483
+ mode: 'dark',
484
+ className: 'text-green-400',
485
+ },
486
+ {
487
+ variant: ['outline', 'ghost'],
488
+ color: 'info',
489
+ mode: 'dark',
490
+ className: 'text-sky-400',
491
+ },
319
492
  ],
320
493
  defaultVariants: {
321
- variant: 'solid',
322
- color: 'primary',
323
- size: 'md',
494
+ variant: 'strong',
495
+ color: 'action',
496
+ size: 'default',
497
+ mode: 'light',
324
498
  },
325
499
  });
326
500
 
327
501
  export const buttonSpinnerVariants = cva([], {
328
502
  variants: {
329
503
  variant: {
330
- solid: 'accent-white',
331
- subtle: [],
504
+ strong: 'accent-white',
332
505
  outline: [],
333
506
  ghost: [],
334
507
  },
335
508
  color: {
336
- primary: [],
337
- secondary: [],
338
- success: [],
509
+ action: [],
339
510
  danger: [],
511
+ warning: [],
512
+ success: [],
513
+ info: [],
514
+ },
515
+ mode: {
516
+ light: [],
517
+ dark: [],
340
518
  },
341
519
  },
342
520
  compoundVariants: [
521
+ // --- outline/ghost × color (light mode) ---
522
+ {
523
+ variant: ['outline', 'ghost'],
524
+ color: 'action',
525
+ className: 'accent-slate-900',
526
+ },
343
527
  {
344
- variant: 'subtle',
345
- color: 'primary',
346
- className: 'accent-blue-950',
528
+ variant: ['outline', 'ghost'],
529
+ color: 'danger',
530
+ className: 'accent-red-600',
347
531
  },
348
532
  {
349
- variant: 'subtle',
350
- color: 'secondary',
351
- className: 'accent-amber-950',
533
+ variant: ['outline', 'ghost'],
534
+ color: 'warning',
535
+ className: 'accent-amber-600',
352
536
  },
353
537
  {
354
- variant: 'subtle',
538
+ variant: ['outline', 'ghost'],
355
539
  color: 'success',
356
- className: 'accent-green-950',
540
+ className: 'accent-green-600',
357
541
  },
358
542
  {
359
- variant: 'subtle',
360
- color: 'danger',
361
- className: 'accent-red-950',
543
+ variant: ['outline', 'ghost'],
544
+ color: 'info',
545
+ className: 'accent-sky-600',
362
546
  },
547
+
548
+ // --- outline/ghost × color × mode: dark ---
363
549
  {
364
550
  variant: ['outline', 'ghost'],
365
- color: 'primary',
366
- className: 'accent-blue-500',
551
+ color: 'action',
552
+ mode: 'dark',
553
+ className: 'accent-white',
367
554
  },
368
555
  {
369
556
  variant: ['outline', 'ghost'],
370
- color: 'secondary',
371
- className: 'accent-amber-600',
557
+ color: 'danger',
558
+ mode: 'dark',
559
+ className: 'accent-red-300',
560
+ },
561
+ {
562
+ variant: ['outline', 'ghost'],
563
+ color: 'warning',
564
+ mode: 'dark',
565
+ className: 'accent-amber-300',
372
566
  },
373
567
  {
374
568
  variant: ['outline', 'ghost'],
375
569
  color: 'success',
376
- className: 'accent-green-600',
570
+ mode: 'dark',
571
+ className: 'accent-green-300',
377
572
  },
378
573
  {
379
574
  variant: ['outline', 'ghost'],
380
- color: 'danger',
381
- className: 'accent-red-500',
575
+ color: 'info',
576
+ mode: 'dark',
577
+ className: 'accent-sky-300',
382
578
  },
383
579
  ],
384
580
  defaultVariants: {
385
- variant: 'solid',
386
- color: 'primary',
581
+ variant: 'strong',
582
+ color: 'action',
583
+ mode: 'light',
387
584
  },
388
585
  });
389
586
 
@@ -406,5 +603,17 @@ export const buttonGroupVariants = cva([], {
406
603
  },
407
604
  });
408
605
 
606
+ export const buttonIconVariants = cva([], {
607
+ variants: {
608
+ size: {
609
+ default: 'size-5',
610
+ small: 'size-4',
611
+ },
612
+ },
613
+ defaultVariants: {
614
+ size: 'default',
615
+ },
616
+ });
617
+
409
618
  export type ButtonVariantProps = VariantProps<typeof buttonRootVariants>;
410
619
  export type ButtonGroupVariantProps = VariantProps<typeof buttonGroupVariants>;