@cdx-ui/components 0.0.1-alpha.33 → 0.0.1-alpha.34

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 (59) hide show
  1. package/lib/commonjs/components/Button/index.js +4 -11
  2. package/lib/commonjs/components/Button/index.js.map +1 -1
  3. package/lib/commonjs/components/Button/styles.js +148 -112
  4. package/lib/commonjs/components/Button/styles.js.map +1 -1
  5. package/lib/commonjs/components/Heading/styles.js +6 -7
  6. package/lib/commonjs/components/Heading/styles.js.map +1 -1
  7. package/lib/commonjs/components/IconButton/index.js +2 -7
  8. package/lib/commonjs/components/IconButton/index.js.map +1 -1
  9. package/lib/commonjs/components/IconButton/styles.js +15 -62
  10. package/lib/commonjs/components/IconButton/styles.js.map +1 -1
  11. package/lib/commonjs/components/Input/styles.js +10 -9
  12. package/lib/commonjs/components/Input/styles.js.map +1 -1
  13. package/lib/commonjs/components/Link/styles.js +5 -7
  14. package/lib/commonjs/components/Link/styles.js.map +1 -1
  15. package/lib/commonjs/components/Text/styles.js +6 -7
  16. package/lib/commonjs/components/Text/styles.js.map +1 -1
  17. package/lib/module/components/Button/index.js +4 -11
  18. package/lib/module/components/Button/index.js.map +1 -1
  19. package/lib/module/components/Button/styles.js +149 -112
  20. package/lib/module/components/Button/styles.js.map +1 -1
  21. package/lib/module/components/Heading/styles.js +6 -7
  22. package/lib/module/components/Heading/styles.js.map +1 -1
  23. package/lib/module/components/IconButton/index.js +2 -7
  24. package/lib/module/components/IconButton/index.js.map +1 -1
  25. package/lib/module/components/IconButton/styles.js +16 -63
  26. package/lib/module/components/IconButton/styles.js.map +1 -1
  27. package/lib/module/components/Input/styles.js +11 -10
  28. package/lib/module/components/Input/styles.js.map +1 -1
  29. package/lib/module/components/Link/styles.js +6 -7
  30. package/lib/module/components/Link/styles.js.map +1 -1
  31. package/lib/module/components/Text/styles.js +6 -7
  32. package/lib/module/components/Text/styles.js.map +1 -1
  33. package/lib/typescript/components/Button/index.d.ts.map +1 -1
  34. package/lib/typescript/components/Button/styles.d.ts +3 -6
  35. package/lib/typescript/components/Button/styles.d.ts.map +1 -1
  36. package/lib/typescript/components/Heading/styles.d.ts.map +1 -1
  37. package/lib/typescript/components/IconButton/index.d.ts.map +1 -1
  38. package/lib/typescript/components/IconButton/styles.d.ts +1 -6
  39. package/lib/typescript/components/IconButton/styles.d.ts.map +1 -1
  40. package/lib/typescript/components/Input/styles.d.ts.map +1 -1
  41. package/lib/typescript/components/Link/styles.d.ts +2 -0
  42. package/lib/typescript/components/Link/styles.d.ts.map +1 -1
  43. package/lib/typescript/components/Text/styles.d.ts.map +1 -1
  44. package/package.json +5 -5
  45. package/src/components/Button/index.tsx +6 -10
  46. package/src/components/Button/styles.ts +127 -138
  47. package/src/components/Heading/styles.tsx +6 -7
  48. package/src/components/IconButton/index.tsx +2 -3
  49. package/src/components/IconButton/styles.ts +18 -90
  50. package/src/components/Input/styles.ts +26 -35
  51. package/src/components/Link/styles.ts +12 -11
  52. package/src/components/Text/styles.tsx +6 -7
  53. package/lib/commonjs/components/Button/buttonSharedVariants.js +0 -200
  54. package/lib/commonjs/components/Button/buttonSharedVariants.js.map +0 -1
  55. package/lib/module/components/Button/buttonSharedVariants.js +0 -195
  56. package/lib/module/components/Button/buttonSharedVariants.js.map +0 -1
  57. package/lib/typescript/components/Button/buttonSharedVariants.d.ts +0 -29
  58. package/lib/typescript/components/Button/buttonSharedVariants.d.ts.map +0 -1
  59. package/src/components/Button/buttonSharedVariants.ts +0 -281
@@ -1,281 +0,0 @@
1
- /**
2
- * Neutral compound-variant **slices** shared by Button and IconButton (no consumer `variant` keys).
3
- *
4
- * Each consumer maps these into its own CVA, e.g. filled surface → Button `strong` or IconButton `solid`;
5
- * ghost surface / outline+ghost foreground → attach the appropriate `variant` / tuple for that component.
6
- *
7
- * Button-only outline **surface** (borders) stays in `Button/styles.ts`.
8
- */
9
- import { Platform } from 'react-native';
10
- import { SEMANTIC_COLORS } from '../../styles/primitives';
11
-
12
- export type SharedButtonSemanticColor = 'action' | 'danger' | 'warning' | 'success' | 'info';
13
-
14
- /** Root surface: filled semantic background (maps to Button `strong`, IconButton `solid`). */
15
- export const sharedFilledSurfaceCompounds: {
16
- color: SharedButtonSemanticColor;
17
- mode?: 'dark';
18
- className: string | string[];
19
- }[] = [
20
- {
21
- color: 'action',
22
- className: [
23
- SEMANTIC_COLORS.action.bg,
24
- Platform.select({
25
- default: 'data-[active=true]:bg-slate-700',
26
- web: 'data-[hover=true]:bg-slate-800 data-[active=true]:data-[hover=true]:bg-slate-700',
27
- }),
28
- ],
29
- },
30
- {
31
- color: 'danger',
32
- className: [
33
- SEMANTIC_COLORS.danger.bg,
34
- Platform.select({
35
- default: 'data-[active=true]:bg-red-800',
36
- web: 'data-[hover=true]:bg-red-700 data-[active=true]:data-[hover=true]:bg-red-800',
37
- }),
38
- ],
39
- },
40
- {
41
- color: 'warning',
42
- className: [
43
- SEMANTIC_COLORS.warning.bg,
44
- Platform.select({
45
- default: 'data-[active=true]:bg-amber-700',
46
- web: 'data-[hover=true]:bg-amber-600 data-[active=true]:data-[hover=true]:bg-amber-700',
47
- }),
48
- ],
49
- },
50
- {
51
- color: 'success',
52
- className: [
53
- SEMANTIC_COLORS.success.bg,
54
- Platform.select({
55
- default: 'data-[active=true]:bg-green-800',
56
- web: 'data-[hover=true]:bg-green-700 data-[active=true]:data-[hover=true]:bg-green-800',
57
- }),
58
- ],
59
- },
60
- {
61
- color: 'info',
62
- className: [
63
- SEMANTIC_COLORS.info.bg,
64
- Platform.select({
65
- default: 'data-[active=true]:bg-sky-700',
66
- web: 'data-[hover=true]:bg-sky-600 data-[active=true]:data-[hover=true]:bg-sky-700',
67
- }),
68
- ],
69
- },
70
- {
71
- color: 'action',
72
- mode: 'dark',
73
- className: [
74
- 'bg-slate-200',
75
- Platform.select({
76
- default: 'data-[active=true]:bg-slate-400',
77
- web: 'data-[hover=true]:bg-slate-300 data-[active=true]:data-[hover=true]:bg-slate-400',
78
- }),
79
- ],
80
- },
81
- ];
82
-
83
- /** Root surface: ghost hover/active fills (maps to `variant: 'ghost'` on Button and IconButton). */
84
- export const sharedGhostSurfaceCompounds: {
85
- color: SharedButtonSemanticColor;
86
- mode?: 'dark';
87
- className: string | string[];
88
- }[] = [
89
- {
90
- color: 'danger',
91
- className: [
92
- Platform.select({
93
- default: 'data-[active=true]:bg-red-100',
94
- web: 'data-[hover=true]:bg-red-50 data-[active=true]:data-[hover=true]:bg-red-100',
95
- }),
96
- ],
97
- },
98
- {
99
- color: 'warning',
100
- className: [
101
- Platform.select({
102
- default: 'data-[active=true]:bg-amber-100',
103
- web: 'data-[hover=true]:bg-amber-50 data-[active=true]:data-[hover=true]:bg-amber-100',
104
- }),
105
- ],
106
- },
107
- {
108
- color: 'success',
109
- className: [
110
- Platform.select({
111
- default: 'data-[active=true]:bg-green-100',
112
- web: 'data-[hover=true]:bg-green-50 data-[active=true]:data-[hover=true]:bg-green-100',
113
- }),
114
- ],
115
- },
116
- {
117
- color: 'info',
118
- className: [
119
- Platform.select({
120
- default: 'data-[active=true]:bg-sky-100',
121
- web: 'data-[hover=true]:bg-sky-50 data-[active=true]:data-[hover=true]:bg-sky-100',
122
- }),
123
- ],
124
- },
125
- {
126
- color: 'action',
127
- mode: 'dark',
128
- className: [
129
- Platform.select({
130
- default: 'data-[active=true]:bg-slate-700',
131
- web: 'data-[hover=true]:bg-slate-800 data-[active=true]:data-[hover=true]:bg-slate-700',
132
- }),
133
- ],
134
- },
135
- {
136
- color: 'danger',
137
- mode: 'dark',
138
- className: [
139
- Platform.select({
140
- default: 'data-[active=true]:bg-red-950',
141
- web: 'data-[hover=true]:bg-red-950/50 data-[active=true]:data-[hover=true]:bg-red-950',
142
- }),
143
- ],
144
- },
145
- {
146
- color: 'warning',
147
- mode: 'dark',
148
- className: [
149
- Platform.select({
150
- default: 'data-[active=true]:bg-amber-950',
151
- web: 'data-[hover=true]:bg-amber-950/50 data-[active=true]:data-[hover=true]:bg-amber-950',
152
- }),
153
- ],
154
- },
155
- {
156
- color: 'success',
157
- mode: 'dark',
158
- className: [
159
- Platform.select({
160
- default: 'data-[active=true]:bg-green-950',
161
- web: 'data-[hover=true]:bg-green-950/50 data-[active=true]:data-[hover=true]:bg-green-950',
162
- }),
163
- ],
164
- },
165
- {
166
- color: 'info',
167
- mode: 'dark',
168
- className: [
169
- Platform.select({
170
- default: 'data-[active=true]:bg-sky-950',
171
- web: 'data-[hover=true]:bg-sky-950/50 data-[active=true]:data-[hover=true]:bg-sky-950',
172
- }),
173
- ],
174
- },
175
- ];
176
-
177
- /** Foreground on filled controls (maps to Button `strong`, IconButton `solid`). */
178
- export const sharedFilledForegroundTextCompounds: {
179
- color: SharedButtonSemanticColor;
180
- mode?: 'dark';
181
- className: string | string[];
182
- }[] = [
183
- { color: 'action', className: 'text-white' },
184
- { color: 'danger', className: 'text-white' },
185
- { color: 'warning', className: 'text-white' },
186
- { color: 'success', className: 'text-white' },
187
- { color: 'info', className: 'text-white' },
188
- { color: 'action', mode: 'dark', className: 'text-slate-900' },
189
- ];
190
-
191
- /**
192
- * Foreground for transparent controls: same class names for Button `outline` and `ghost`, and for IconButton `ghost`.
193
- * Consumers attach their own `variant` key(s).
194
- */
195
- export const sharedOutlineGhostForegroundTextCompounds: {
196
- color: SharedButtonSemanticColor;
197
- mode?: 'dark';
198
- className: string | string[];
199
- }[] = [
200
- {
201
- color: 'action',
202
- className: [
203
- 'text-slate-900',
204
- Platform.select({
205
- default: 'data-[active=true]:text-slate-700',
206
- web: 'data-[hover=true]:text-slate-800 data-[active=true]:data-[hover=true]:text-slate-700',
207
- }),
208
- ],
209
- },
210
- {
211
- color: 'danger',
212
- className: [
213
- 'text-red-600',
214
- Platform.select({
215
- default: 'data-[active=true]:text-red-800',
216
- web: 'data-[hover=true]:text-red-700 data-[active=true]:data-[hover=true]:text-red-800',
217
- }),
218
- ],
219
- },
220
- {
221
- color: 'warning',
222
- className: [
223
- 'text-amber-600',
224
- Platform.select({
225
- default: 'data-[active=true]:text-amber-800',
226
- web: 'data-[hover=true]:text-amber-700 data-[active=true]:data-[hover=true]:text-amber-800',
227
- }),
228
- ],
229
- },
230
- {
231
- color: 'success',
232
- className: [
233
- 'text-green-600',
234
- Platform.select({
235
- default: 'data-[active=true]:text-green-800',
236
- web: 'data-[hover=true]:text-green-700 data-[active=true]:data-[hover=true]:text-green-800',
237
- }),
238
- ],
239
- },
240
- {
241
- color: 'info',
242
- className: [
243
- 'text-sky-600',
244
- Platform.select({
245
- default: 'data-[active=true]:text-sky-800',
246
- web: 'data-[hover=true]:text-sky-700 data-[active=true]:data-[hover=true]:text-sky-800',
247
- }),
248
- ],
249
- },
250
- {
251
- color: 'action',
252
- mode: 'dark',
253
- className: [
254
- 'text-white',
255
- Platform.select({
256
- default: 'data-[active=true]:text-white',
257
- web: 'data-[hover=true]:text-white data-[active=true]:data-[hover=true]:text-white',
258
- }),
259
- ],
260
- },
261
- {
262
- color: 'danger',
263
- mode: 'dark',
264
- className: 'text-red-400',
265
- },
266
- {
267
- color: 'warning',
268
- mode: 'dark',
269
- className: 'text-amber-400',
270
- },
271
- {
272
- color: 'success',
273
- mode: 'dark',
274
- className: 'text-green-400',
275
- },
276
- {
277
- color: 'info',
278
- mode: 'dark',
279
- className: 'text-sky-400',
280
- },
281
- ];