@robuust-digital/vue-components 1.1.1 → 1.2.0

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.
@@ -6,394 +6,276 @@
6
6
  export default (theme) => {
7
7
  const customColors = theme('components.button.custom') || {};
8
8
  const customColorStyles = Object.keys(customColors).reduce((acc, colorName) => {
9
- acc[`&.button-custom-${colorName}`] = {
9
+ acc[`&.rvc-button-custom-${colorName}`] = {
10
10
  ...customColors[colorName],
11
- '&:hover': {
12
- ...customColors[colorName].hover,
13
- },
14
-
15
- '&:disabled': {
16
- ...customColors[colorName].disabled,
17
- },
18
-
19
- '.button-icon': {
20
- ...customColors[colorName].icon,
21
- },
22
11
  };
23
12
  return acc;
24
13
  }, {});
25
14
 
26
15
  return {
27
- '.button': {
16
+ ':root': {
17
+ // Custom properties
18
+ '--rvc-button-height': theme('height.9'),
19
+ '--rvc-button-border-width': theme('borderWidth.DEFAULT'),
20
+ '--rvc-button-padding-x': theme('padding.3'),
21
+ '--rvc-button-gap': theme('gap[1.5]'),
22
+ '--rvc-button-border-radius': theme('borderRadius.md'),
23
+ '--rvc-button-font-weight': theme('fontWeight.semibold'),
24
+ '--rvc-button-font-size': theme('fontSize.base.0'),
25
+ '--rvc-button-transition-property': theme('transitionProperty.colors'),
26
+ '--rvc-button-transition-duration': theme('transitionDuration.DEFAULT'),
27
+ '--rvc-button-transition-timing-function': theme('transitionTimingFunction.DEFAULT'),
28
+ '--rvc-button-icon-size': theme('width.5'),
29
+ '--rvc-button-icon-loading-size': theme('width.4'),
30
+ '--rvc-button-icon-loading-animation': theme('animation.spin'),
31
+ '--rvc-button-box-shadow': 'none',
32
+
33
+ // Default color variables
34
+ '--rvc-button-bg-color': '#d9ff00',
35
+ '--rvc-button-color': '#000',
36
+ '--rvc-button-bg-color-hover': '#caf400',
37
+ '--rvc-button-color-hover': '#000',
38
+ '--rvc-button-border-color': theme('colors.transparent'),
39
+ '--rvc-button-border-color-hover': theme('colors.transparent'),
40
+ '--rvc-button-icon-color': theme('colors.slate.500'),
41
+ '--rvc-button-icon-color-hover': theme('colors.slate.950'),
42
+ },
43
+
44
+ '.rvc-button': {
45
+ height: 'var(--rvc-button-height)',
46
+ borderWidth: 'var(--rvc-button-border-width)',
47
+ borderColor: 'var(--rvc-button-border-color)',
48
+ transitionProperty: 'var(--rvc-button-transition-property)',
49
+ transitionDuration: 'var(--rvc-button-transition-duration)',
50
+ transitionTimingFunction: 'var(--rvc-button-transition-timing-function)',
51
+ paddingRight: 'var(--rvc-button-padding-x)',
52
+ paddingLeft: 'var(--rvc-button-padding-x)',
53
+ gap: 'var(--rvc-button-gap)',
54
+ borderRadius: 'var(--rvc-button-border-radius)',
55
+ fontWeight: 'var(--rvc-button-font-weight)',
56
+ fontSize: 'var(--rvc-button-font-size)',
57
+ backgroundColor: 'var(--rvc-button-bg-color)',
58
+ color: 'var(--rvc-button-color)',
59
+ boxShadow: 'var(--rvc-button-box-shadow)',
28
60
  appearance: 'none',
29
- cursor: theme('cursor.pointer'),
61
+ cursor: 'pointer',
30
62
  display: 'inline-flex',
31
63
  alignItems: 'center',
32
64
  justifyContent: 'center',
33
65
  textAlign: 'center',
34
- height: theme('height.fit'),
35
- borderWidth: theme('borderWidth.DEFAULT'),
36
66
  borderStyle: 'solid',
37
- borderColor: theme('colors.transparent'),
38
67
  position: 'relative',
39
- paddingTop: theme('padding.2'),
40
- paddingRight: theme('padding.4'),
41
- paddingBottom: theme('padding.2'),
42
- paddingLeft: theme('padding.4'),
43
- gap: theme('gap.2'),
44
- borderRadius: theme('borderRadius.xl'),
45
- fontWeight: theme('fontWeight.medium'),
46
- fontSize: theme('fontSize.base.0'),
47
68
  whiteSpace: 'nowrap',
48
- transitionProperty: theme('transitionProperty.colors'),
49
- transitionDuration: theme('transitionDuration.300'),
50
- transitionTimingFunction: theme('transitionTimingFunction.DEFAULT'),
51
69
  ...theme('components.button'),
52
70
 
71
+ // Hover state
72
+ '&:hover': {
73
+ backgroundColor: 'var(--rvc-button-bg-color-hover)',
74
+ color: 'var(--rvc-button-color-hover)',
75
+ borderColor: 'var(--rvc-button-border-color-hover)',
76
+
77
+ '.rvc-button-icon': {
78
+ color: 'var(--rvc-button-icon-color-hover)',
79
+ },
80
+ },
81
+
53
82
  // Disabled state
54
83
  '&:disabled': {
55
84
  pointerEvents: 'none',
56
85
  opacity: theme('opacity.50'),
57
- ...theme('components.button.disabled'),
58
86
  },
59
87
 
60
88
  // Icon styling
61
- '.button-icon': {
89
+ '.rvc-button-icon': {
90
+ width: 'var(--rvc-button-icon-size)',
91
+ height: 'var(--rvc-button-icon-size)',
92
+ color: 'var(--rvc-button-icon-color)',
93
+ transitionProperty: 'var(--rvc-button-transition-property)',
94
+ transitionDuration: 'var(--rvc-button-transition-duration)',
95
+ transitionTimingFunction: 'var(--rvc-button-transition-timing-function)',
62
96
  display: 'block',
63
- width: theme('width.5'),
64
- height: theme('height.5'),
65
- flexShrink: theme('flexShrink.0'),
66
- ...theme('components.button.icon'),
97
+ flexShrink: '0',
67
98
 
68
- '&.button-icon-loading': {
69
- animation: theme('animation.spin'),
70
- ...theme('components.button.icon.loading'),
99
+ '&.rvc-button-icon-loading': {
100
+ width: 'var(--rvc-button-icon-loading-size)',
101
+ height: 'var(--rvc-button-icon-loading-size)',
102
+ animation: 'var(--rvc-button-icon-loading-animation)',
71
103
  },
72
104
  },
73
105
 
74
106
  // Icon-only styling
75
- '&.button-icon-only': {
76
- padding: theme('padding.2'),
107
+ '&.rvc-button-icon-only': {
108
+ padding: 0,
77
109
  aspectRatio: '1 / 1',
78
- ...theme('components.button.iconOnly'),
79
110
  },
80
111
 
81
112
  // Reverse icon
82
- '&.button-reverse': {
113
+ '&.rvc-button-reverse': {
83
114
  flexDirection: 'row-reverse',
84
115
  },
85
116
 
86
117
  // Color variants
87
- '&.button-primary': {
88
- backgroundColor: theme('colors.lime.400'),
89
- color: theme('colors.black'),
118
+ '&.rvc-button-primary': {
90
119
  ...theme('components.button.primary'),
91
-
92
- '&:hover': {
93
- backgroundColor: theme('colors.lime.600'),
94
- color: theme('colors.black'),
95
- ...theme('components.button.primary.hover'),
96
- },
97
-
98
- '&:disabled': {
99
- ...theme('components.button.primary.disabled'),
100
- },
101
-
102
- '.button-icon': {
103
- ...theme('components.button.primary.icon'),
104
- },
105
120
  },
106
- '&.button-primary-soft': {
107
- backgroundColor: theme('colors.lime.200'),
108
- color: theme('colors.lime.600'),
109
- ...theme('components.button.primary-soft'),
110
-
111
- '&:hover': {
112
- backgroundColor: theme('colors.lime.300'),
113
- color: theme('colors.700'),
114
- ...theme('components.button.primary-soft.hover'),
115
- },
116
-
117
- '&:disabled': {
118
- ...theme('components.button.primary-soft.disabled'),
119
- },
120
121
 
121
- '.button-icon': {
122
- ...theme('components.button.primary-soft.icon'),
123
- },
124
- },
125
- '&.button-secondary': {
126
- backgroundColor: theme('colors.indigo.400'),
127
- color: theme('colors.white'),
122
+ '&.rvc-button-secondary': {
123
+ '--rvc-button-bg-color': '#4f46e5',
124
+ '--rvc-button-color': '#fff',
125
+ '--rvc-button-bg-color-hover': '#6366f1',
126
+ '--rvc-button-color-hover': '#fff',
127
+ '--rvc-button-icon-color': theme('colors.slate.300'),
128
+ '--rvc-button-icon-color-hover': '#fff',
128
129
  ...theme('components.button.secondary'),
129
-
130
- '&:hover': {
131
- backgroundColor: theme('colors.indigo.600'),
132
- color: theme('colors.white'),
133
- ...theme('components.button.secondary.hover'),
134
- },
135
-
136
- '&:disabled': {
137
- ...theme('components.button.secondary.disabled'),
138
- },
139
-
140
- '.button-icon': {
141
- ...theme('components.button.secondary.icon'),
142
- },
143
130
  },
144
- '&.button-secondary-soft': {
145
- backgroundColor: theme('colors.indigo.200'),
146
- color: theme('colors.indigo.600'),
147
- ...theme('components.button.secondary-soft'),
148
131
 
149
- '&:hover': {
150
- backgroundColor: theme('colors.indigo.300'),
151
- color: theme('colors.700'),
152
- ...theme('components.button.secondary-soft.hover'),
153
- },
154
-
155
- '&:disabled': {
156
- ...theme('components.button.secondary-soft.disabled'),
157
- },
158
-
159
- '.button-icon': {
160
- ...theme('components.button.secondary-soft.icon'),
161
- },
162
- },
163
- '&.button-tertiary': {
164
- backgroundColor: theme('colors.orange.400'),
165
- color: theme('colors.black'),
132
+ '&.rvc-button-tertiary': {
133
+ '--rvc-button-bg-color': '#475569',
134
+ '--rvc-button-color': '#fff',
135
+ '--rvc-button-bg-color-hover': '#64748b',
136
+ '--rvc-button-color-hover': '#fff',
137
+ '--rvc-button-icon-color': theme('colors.slate.300'),
138
+ '--rvc-button-icon-color-hover': '#fff',
166
139
  ...theme('components.button.tertiary'),
167
-
168
- '&:hover': {
169
- backgroundColor: theme('colors.orange.600'),
170
- color: theme('colors.black'),
171
- ...theme('components.button.tertiary.hover'),
172
- },
173
-
174
- '&:disabled': {
175
- ...theme('components.button.tertiary.disabled'),
176
- },
177
-
178
- '.button-icon': {
179
- ...theme('components.button.tertiary.icon'),
180
- },
181
140
  },
182
- '&.button-tertiary-soft': {
183
- backgroundColor: theme('colors.orange.200'),
184
- color: theme('colors.orange.600'),
185
- ...theme('components.button.tertiary-soft'),
186
-
187
- '&:hover': {
188
- backgroundColor: theme('colors.orange.300'),
189
- color: theme('colors.700'),
190
- ...theme('components.button.tertiary-soft.hover'),
191
- },
192
-
193
- '&:disabled': {
194
- ...theme('components.button.tertiary-soft.disabled'),
195
- },
196
141
 
197
- '.button-icon': {
198
- ...theme('components.button.tertiary-soft.icon'),
199
- },
200
- },
201
- '&.button-light': {
202
- backgroundColor: theme('colors.white'),
203
- color: theme('colors.stone.800'),
204
- borderColor: theme('colors.stone.300'),
142
+ '&.rvc-button-light': {
143
+ '--rvc-button-bg-color': theme('colors.white'),
144
+ '--rvc-button-color': theme('colors.black'),
145
+ '--rvc-button-bg-color-hover': theme('colors.slate.50'),
146
+ '--rvc-button-color-hover': theme('colors.black'),
147
+ '--rvc-button-border-color': theme('colors.slate.200'),
148
+ '--rvc-button-border-color-hover': theme('colors.slate.200'),
205
149
  ...theme('components.button.light'),
206
-
207
- '&:hover': {
208
- backgroundColor: theme('colors.stone.100'),
209
- color: theme('colors.stone.900'),
210
- ...theme('components.button.light.hover'),
211
- },
212
-
213
- '&:disabled': {
214
- ...theme('components.button.light.disabled'),
215
- },
216
-
217
- '.button-icon': {
218
- ...theme('components.button.light.icon'),
219
- },
220
150
  },
221
- '&.button-dark': {
222
- backgroundColor: theme('colors.black'),
223
- color: theme('colors.white'),
224
- ...theme('components.button.dark'),
225
151
 
226
- '&:hover': {
227
- backgroundColor: theme('colors.stone.800'),
228
- color: theme('colors.white'),
229
- ...theme('components.button.dark.hover'),
230
- },
231
-
232
- '&:disabled': {
233
- ...theme('components.button.dark.disabled'),
234
- },
235
-
236
- '.button-icon': {
237
- ...theme('components.button.dark.icon'),
238
- },
152
+ '&.rvc-button-dark': {
153
+ '--rvc-button-bg-color': theme('colors.slate.950'),
154
+ '--rvc-button-color': theme('colors.white'),
155
+ '--rvc-button-bg-color-hover': theme('colors.slate.800'),
156
+ '--rvc-button-color-hover': theme('colors.white'),
157
+ '--rvc-button-icon-color': theme('colors.slate.300'),
158
+ '--rvc-button-icon-color-hover': theme('colors.white'),
159
+ ...theme('components.button.dark'),
239
160
  },
240
- '&.button-danger': {
241
- backgroundColor: theme('colors.red.600'),
242
- color: theme('colors.white'),
243
- ...theme('components.button.danger'),
244
161
 
245
- '&:hover': {
246
- backgroundColor: theme('colors.red.700'),
247
- color: theme('colors.white'),
248
- ...theme('components.button.danger.hover'),
249
- },
250
-
251
- '&:disabled': {
252
- ...theme('components.button.danger.disabled'),
253
- },
254
-
255
- '.button-icon': {
256
- ...theme('components.button.danger.icon'),
257
- },
162
+ '&.rvc-button-red': {
163
+ '--rvc-button-bg-color': theme('colors.red.600'),
164
+ '--rvc-button-color': theme('colors.white'),
165
+ '--rvc-button-bg-color-hover': theme('colors.red.500'),
166
+ '--rvc-button-color-hover': theme('colors.white'),
167
+ '--rvc-button-icon-color': theme('colors.slate.300'),
168
+ '--rvc-button-icon-color-hover': theme('colors.white'),
169
+ ...theme('components.button.red'),
258
170
  },
259
- '&.button-danger-soft': {
260
- backgroundColor: theme('colors.red.200'),
261
- color: theme('colors.red.600'),
262
- ...theme('components.button.danger-soft'),
263
-
264
- '&:hover': {
265
- backgroundColor: theme('colors.red.300'),
266
- color: theme('colors.700'),
267
- ...theme('components.button.danger-soft.hover'),
268
- },
269
171
 
270
- '&:disabled': {
271
- ...theme('components.button.danger-soft.disabled'),
272
- },
273
-
274
- '.button-icon': {
275
- ...theme('components.button.danger-soft.icon'),
276
- },
172
+ '&.rvc-button-red-soft': {
173
+ '--rvc-button-bg-color': theme('colors.red.50'),
174
+ '--rvc-button-color': theme('colors.red.700'),
175
+ '--rvc-button-bg-color-hover': theme('colors.red.200'),
176
+ '--rvc-button-color-hover': theme('colors.red.700'),
177
+ '--rvc-button-border-color': theme('colors.red.200'),
178
+ '--rvc-button-border-color-hover': theme('colors.red.200'),
179
+ '--rvc-button-icon-color': theme('colors.red.500'),
180
+ '--rvc-button-icon-color-hover': theme('colors.red.700'),
181
+ ...theme('components.button.red-soft'),
277
182
  },
278
- '&.button-warning': {
279
- backgroundColor: theme('colors.yellow.400'),
280
- color: theme('colors.black'),
281
- ...theme('components.button.warning'),
282
183
 
283
- '&:hover': {
284
- backgroundColor: theme('colors.yellow.300'),
285
- color: theme('colors.black'),
286
- ...theme('components.button.warning.hover'),
287
- },
288
-
289
- '&:disabled': {
290
- ...theme('components.button.warning.disabled'),
291
- },
292
-
293
- '.button-icon': {
294
- ...theme('components.button.warning.icon'),
295
- },
184
+ '&.rvc-button-yellow': {
185
+ '--rvc-button-bg-color': theme('colors.yellow.300'),
186
+ '--rvc-button-color': theme('colors.slate.950'),
187
+ '--rvc-button-bg-color-hover': theme('colors.yellow.400'),
188
+ '--rvc-button-color-hover': theme('colors.slate.950'),
189
+ ...theme('components.button.yellow'),
296
190
  },
297
- '&.button-warning-soft': {
298
- backgroundColor: theme('colors.yellow.200'),
299
- color: theme('colors.yellow.600'),
300
- ...theme('components.button.warning-soft'),
301
-
302
- '&:hover': {
303
- backgroundColor: theme('colors.yellow.300'),
304
- color: theme('colors.700'),
305
- ...theme('components.button.warning-soft.hover'),
306
- },
307
-
308
- '&:disabled': {
309
- ...theme('components.button.warning-soft.disabled'),
310
- },
311
191
 
312
- '.button-icon': {
313
- ...theme('components.button.warning-soft.icon'),
314
- },
192
+ '&.rvc-button-yellow-soft': {
193
+ '--rvc-button-bg-color': theme('colors.yellow.50'),
194
+ '--rvc-button-color': theme('colors.yellow.700'),
195
+ '--rvc-button-bg-color-hover': theme('colors.yellow.200'),
196
+ '--rvc-button-color-hover': theme('colors.yellow.700'),
197
+ '--rvc-button-border-color': theme('colors.yellow.200'),
198
+ '--rvc-button-border-color-hover': theme('colors.yellow.200'),
199
+ '--rvc-button-icon-color': theme('colors.yellow.500'),
200
+ '--rvc-button-icon-color-hover': theme('colors.yellow.700'),
201
+ ...theme('components.button.yellow-soft'),
315
202
  },
316
- '&.button-success': {
317
- backgroundColor: theme('colors.green.500'),
318
- color: theme('colors.white'),
319
- ...theme('components.button.success'),
320
-
321
- '&:hover': {
322
- backgroundColor: theme('colors.green.700'),
323
- color: theme('colors.white'),
324
- ...theme('components.button.success.hover'),
325
- },
326
203
 
327
- '&:disabled': {
328
- ...theme('components.button.success.disabled'),
329
- },
330
-
331
- '.button-icon': {
332
- ...theme('components.button.success.icon'),
333
- },
204
+ '&.rvc-button-green': {
205
+ '--rvc-button-bg-color': theme('colors.green.600'),
206
+ '--rvc-button-color': theme('colors.white'),
207
+ '--rvc-button-bg-color-hover': theme('colors.green.500'),
208
+ '--rvc-button-color-hover': theme('colors.white'),
209
+ '--rvc-button-icon-color': theme('colors.slate.300'),
210
+ '--rvc-button-icon-color-hover': theme('colors.white'),
211
+ ...theme('components.button.green'),
334
212
  },
335
- '&.button-success-soft': {
336
- backgroundColor: theme('colors.green.200'),
337
- color: theme('colors.green.600'),
338
- ...theme('components.button.success-soft'),
339
213
 
340
- '&:hover': {
341
- backgroundColor: theme('colors.green.300'),
342
- color: theme('colors.700'),
343
- ...theme('components.button.success-soft.hover'),
344
- },
214
+ '&.rvc-button-green-soft': {
215
+ '--rvc-button-bg-color': theme('colors.green.50'),
216
+ '--rvc-button-color': theme('colors.green.700'),
217
+ '--rvc-button-bg-color-hover': theme('colors.green.200'),
218
+ '--rvc-button-color-hover': theme('colors.green.700'),
219
+ '--rvc-button-border-color': theme('colors.green.200'),
220
+ '--rvc-button-border-color-hover': theme('colors.green.200'),
221
+ '--rvc-button-icon-color': theme('colors.green.500'),
222
+ '--rvc-button-icon-color-hover': theme('colors.green.700'),
223
+ ...theme('components.button.green-soft'),
224
+ },
345
225
 
346
- '&:disabled': {
347
- ...theme('components.button.success-soft.disabled'),
348
- },
226
+ '&.rvc-button-blue': {
227
+ '--rvc-button-bg-color': theme('colors.blue.600'),
228
+ '--rvc-button-color': theme('colors.white'),
229
+ '--rvc-button-bg-color-hover': theme('colors.blue.500'),
230
+ '--rvc-button-color-hover': theme('colors.white'),
231
+ '--rvc-button-icon-color': theme('colors.slate.300'),
232
+ '--rvc-button-icon-color-hover': theme('colors.white'),
233
+ ...theme('components.button.blue'),
234
+ },
349
235
 
350
- '.button-icon': {
351
- ...theme('components.button.success-soft.icon'),
352
- },
236
+ '&.rvc-button-blue-soft': {
237
+ '--rvc-button-bg-color': theme('colors.blue.50'),
238
+ '--rvc-button-color': theme('colors.blue.700'),
239
+ '--rvc-button-bg-color-hover': theme('colors.blue.200'),
240
+ '--rvc-button-color-hover': theme('colors.blue.700'),
241
+ '--rvc-button-border-color': theme('colors.blue.200'),
242
+ '--rvc-button-border-color-hover': theme('colors.blue.200'),
243
+ '--rvc-button-icon-color': theme('colors.blue.500'),
244
+ '--rvc-button-icon-color-hover': theme('colors.blue.700'),
245
+ ...theme('components.button.blue-soft'),
353
246
  },
354
- '&.button-clear': {
355
- backgroundColor: theme('colors.transparent'),
356
- paddingLeft: theme('padding.0'),
357
- paddingRight: theme('padding.0'),
358
- color: theme('colors.stone.600'),
247
+
248
+ '&.rvc-button-clear': {
249
+ '--rvc-button-bg-color': theme('colors.transparent'),
250
+ '--rvc-button-color': theme('colors.indigo.600'),
251
+ '--rvc-button-bg-color-hover': theme('colors.transparent'),
252
+ '--rvc-button-color-hover': theme('colors.indigo.700'),
253
+ '--rvc-button-icon-color': theme('colors.indigo.600'),
254
+ '--rvc-button-icon-color-hover': theme('colors.indigo.700'),
255
+
256
+ paddingLeft: '0',
257
+ paddingRight: '0',
258
+ boxShadow: 'none',
359
259
  ...theme('components.button.clear'),
360
260
 
361
261
  '&:hover': {
362
- color: theme('colors.stone.800'),
363
- ...theme('components.button.clear.hover'),
364
- },
365
-
366
- '&:disabled': {
367
- ...theme('components.button.clear.disabled'),
368
- },
369
-
370
- '.button-icon': {
371
- ...theme('components.button.clear.icon'),
262
+ textDecoration: 'underline',
372
263
  },
373
264
  },
265
+
374
266
  ...customColorStyles,
375
267
 
376
268
  // Size variants
377
- '&.button-sm': {
378
- paddingTop: theme('padding[1.5]'),
379
- paddingRight: theme('padding.3'),
380
- paddingBottom: theme('padding[1.5]'),
381
- paddingLeft: theme('padding.3'),
382
- gap: theme('gap.2'),
383
- borderRadius: theme('borderRadius.lg'),
384
- fontWeight: theme('fontWeight.medium'),
385
- fontSize: theme('fontSize.sm.0'),
269
+ '&.rvc-button-sm': {
270
+ '--rvc-button-height': '1.875rem',
271
+ '--rvc-button-padding-x': theme('padding[2.5]'),
272
+ '--rvc-button-font-size': theme('fontSize.sm.0'),
273
+ '--rvc-button-icon-size': theme('width.4'),
274
+ '--rvc-button-icon-loading-size': theme('width.3'),
386
275
  ...theme('components.button.sm'),
387
276
 
388
- '.button-icon': {
389
- width: theme('width.4'),
390
- height: theme('height.4'),
391
- ...theme('components.button.sm.icon'),
392
- },
393
-
394
- '&.button-icon-only': {
395
- padding: theme('padding[1.5]'),
396
- ...theme('components.button.sm.iconOnly'),
277
+ '&.rvc-button-icon-only': {
278
+ padding: 0,
397
279
  },
398
280
  },
399
281
  },
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Checkbox component
3
+ *
4
+ * @param {Object} theme - The global theme object
5
+ */
6
+ export default (theme) => ({
7
+ ':root': {
8
+ '--rvc-checkbox-gap': theme('gap.2'),
9
+ '--rvc-checkbox-font-size': theme('fontSize.base.0'),
10
+ '--rvc-checkbox-font-weight': theme('fontWeight.medium'),
11
+ '--rvc-checkbox-color': theme('colors.slate.950'),
12
+ '--rvc-checkbox-input-size': theme('width.4'),
13
+ '--rvc-checkbox-input-box-shadow': theme('boxShadow.sm'),
14
+ '--rvc-checkbox-input-border-radius': theme('borderRadius.DEFAULT'),
15
+ '--rvc-checkbox-input-border-width': theme('borderWidth.DEFAULT'),
16
+ '--rvc-checkbox-input-border-color': theme('colors.slate.200'),
17
+ '--rvc-checkbox-input-checked-bg-color': theme('colors.indigo.600'),
18
+ '--rvc-checkbox-input-checked-border-color': theme('colors.indigo.600'),
19
+ '--rvc-checkbox-input-checked-icon-color': theme('colors.white'),
20
+ },
21
+
22
+ '.rvc-checkbox': {
23
+ gap: 'var(--rvc-checkbox-gap)',
24
+ position: 'relative',
25
+ display: 'flex',
26
+ alignItems: 'flex-start',
27
+ cursor: 'pointer',
28
+ ...theme('components.checkbox'),
29
+ },
30
+
31
+ label: {
32
+ fontSize: 'var(--rvc-checkbox-font-size)',
33
+ fontWeight: 'var(--rvc-checkbox-font-weight)',
34
+ color: 'var(--rvc-checkbox-color)',
35
+ display: 'block',
36
+ },
37
+
38
+ '.rvc-checkbox-input': {
39
+ width: 'var(--rvc-checkbox-input-size)',
40
+ height: 'var(--rvc-checkbox-input-size)',
41
+ borderRadius: 'var(--rvc-checkbox-input-border-radius)',
42
+ borderWidth: 'var(--rvc-checkbox-input-border-width)',
43
+ borderColor: 'var(--rvc-checkbox-input-border-color)',
44
+ boxShadow: 'var(--rvc-checkbox-input-box-shadow)',
45
+ marginTop: theme('margin[0.5]'),
46
+ display: 'flex',
47
+ alignItems: 'center',
48
+ justifyContent: 'center',
49
+
50
+ svg: {
51
+ width: '100%',
52
+ height: '100%',
53
+ color: theme('colors.transparent'),
54
+ },
55
+ },
56
+
57
+ 'input:checked + .rvc-checkbox-input': {
58
+ backgroundColor: 'var(--rvc-checkbox-input-checked-bg-color)',
59
+ borderColor: 'var(--rvc-checkbox-input-checked-border-color)',
60
+
61
+ svg: {
62
+ color: 'var(--rvc-checkbox-input-checked-icon-color)',
63
+ },
64
+ },
65
+ });