@rimelight/ui 0.0.26 → 0.0.28

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.
@@ -1,6 +1,8 @@
1
1
  import { defineTheme } from "../utils/defineTheme"
2
2
 
3
- export default defineTheme({
3
+ const defaultColors = ["primary", "secondary", "info", "success", "warning", "error", "commentary", "ideation", "source"];
4
+
5
+ export const createButtonTheme = (colors: string[] = defaultColors) => defineTheme({
4
6
  slots: ["root", "label", "leadingIcon", "trailingIcon"],
5
7
  base: {
6
8
  root: [
@@ -16,49 +18,41 @@ export default defineTheme({
16
18
  },
17
19
  variants: {
18
20
  variant: {
19
- solid: { root: "b shadow-xs" },
20
- outline: { root: "b shadow-xs border" },
21
+ solid: { root: "shadow-sm border border-transparent" },
22
+ outline: { root: "b shadow-sm border" },
21
23
  soft: { root: "" },
22
24
  subtle: { root: "" },
23
25
  ghost: { root: "" },
24
- link: { root: "p-0 h-auto" }
26
+ link: { root: "p-0 h-auto no-underline" }
25
27
  },
26
28
  color: {
27
- primary: { root: "" },
28
- secondary: { root: "" },
29
- info: { root: "" },
30
- success: { root: "" },
31
- warning: { root: "" },
32
- error: { root: "" },
33
- commentary: { root: "" },
34
- ideation: { root: "" },
35
- source: { root: "" }
29
+ ...Object.fromEntries(colors.map(color => [color, { root: "" }]))
36
30
  },
37
31
  size: {
38
32
  xs: {
39
33
  root: "h-7 px-2xs text-xs [&_svg]:size-3.5",
40
- leadingIcon: "[&_svg]:size-3.5",
41
- trailingIcon: "[&_svg]:size-3.5"
34
+ leadingIcon: "[&_svg]:size-3.5 [&_span]:size-3.5",
35
+ trailingIcon: "[&_svg]:size-3.5 [&_span]:size-3.5"
42
36
  },
43
37
  sm: {
44
38
  root: "h-8 px-xs text-sm [&_svg]:size-4",
45
- leadingIcon: "[&_svg]:size-4",
46
- trailingIcon: "[&_svg]:size-4"
39
+ leadingIcon: "[&_svg]:size-4 [&_span]:size-4",
40
+ trailingIcon: "[&_svg]:size-4 [&_span]:size-4"
47
41
  },
48
42
  md: {
49
43
  root: "h-9 px-sm text-sm [&_svg]:size-4",
50
- leadingIcon: "[&_svg]:size-4",
51
- trailingIcon: "[&_svg]:size-4"
44
+ leadingIcon: "[&_svg]:size-4 [&_span]:size-4",
45
+ trailingIcon: "[&_svg]:size-4 [&_span]:size-4"
52
46
  },
53
47
  lg: {
54
48
  root: "h-10 px-md text-base [&_svg]:size-4.5",
55
- leadingIcon: "[&_svg]:size-4.5",
56
- trailingIcon: "[&_svg]:size-4.5"
49
+ leadingIcon: "[&_svg]:size-4.5 [&_span]:size-4.5",
50
+ trailingIcon: "[&_svg]:size-4.5 [&_span]:size-4.5"
57
51
  },
58
52
  xl: {
59
53
  root: "h-11 px-lg text-base [&_svg]:size-5",
60
- leadingIcon: "[&_svg]:size-5",
61
- trailingIcon: "[&_svg]:size-5"
54
+ leadingIcon: "[&_svg]:size-5 [&_span]:size-5",
55
+ trailingIcon: "[&_svg]:size-5 [&_span]:size-5"
62
56
  }
63
57
  },
64
58
  block: {
@@ -76,384 +70,48 @@ export default defineTheme({
76
70
  }
77
71
  },
78
72
  compoundVariants: [
79
- {
80
- variant: "solid",
81
- color: "primary",
82
- classNames: {
83
- root: "bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-primary/50"
84
- }
85
- },
86
- {
87
- variant: "solid",
88
- color: "secondary",
89
- classNames: {
90
- root: "bg-secondary text-secondary-foreground hover:bg-secondary/90 focus-visible:ring-secondary/50"
91
- }
92
- },
93
- {
94
- variant: "solid",
95
- color: "info",
96
- classNames: {
97
- root: "bg-info text-info-foreground hover:bg-info/90 focus-visible:ring-info/50"
98
- }
99
- },
100
- {
101
- variant: "solid",
102
- color: "success",
103
- classNames: {
104
- root: "bg-success text-success-foreground hover:bg-success/90 focus-visible:ring-success/50"
105
- }
106
- },
107
- {
108
- variant: "solid",
109
- color: "warning",
110
- classNames: {
111
- root: "bg-warning text-warning-foreground hover:bg-warning/90 focus-visible:ring-warning/50"
112
- }
113
- },
114
- {
115
- variant: "solid",
116
- color: "error",
117
- classNames: {
118
- root: "bg-error text-error-foreground hover:bg-error/90 focus-visible:ring-error/50"
119
- }
120
- },
121
- {
122
- variant: "solid",
123
- color: "commentary",
124
- classNames: {
125
- root: "bg-commentary text-commentary-foreground hover:bg-commentary/90 focus-visible:ring-commentary/50"
126
- }
127
- },
128
- {
129
- variant: "solid",
130
- color: "ideation",
131
- classNames: {
132
- root: "bg-ideation text-ideation-foreground hover:bg-ideation/90 focus-visible:ring-ideation/50"
133
- }
134
- },
135
- {
136
- variant: "solid",
137
- color: "source",
138
- classNames: {
139
- root: "bg-source text-source-foreground hover:bg-source/90 focus-visible:ring-source/50"
140
- }
141
- },
142
- {
143
- variant: "outline",
144
- color: "primary",
145
- classNames: {
146
- root: "border-primary/20 text-primary-600 bg-primary/5 hover:bg-primary/10 hover:border-primary/30 focus-visible:ring-primary/40"
147
- }
148
- },
149
- {
150
- variant: "outline",
151
- color: "secondary",
152
- classNames: {
153
- root: "border-secondary/20 text-secondary-600 bg-secondary/5 hover:bg-secondary/10 hover:border-secondary/30 focus-visible:ring-secondary/40"
154
- }
155
- },
156
- {
157
- variant: "outline",
158
- color: "info",
159
- classNames: {
160
- root: "border-info/20 text-info-600 bg-info/5 hover:bg-info/10 hover:border-info/30 focus-visible:ring-info/40"
161
- }
162
- },
163
- {
164
- variant: "outline",
165
- color: "success",
166
- classNames: {
167
- root: "border-success/20 text-success-600 bg-success/5 hover:bg-success/10 hover:border-success/30 focus-visible:ring-success/40"
168
- }
169
- },
170
- {
171
- variant: "outline",
172
- color: "warning",
173
- classNames: {
174
- root: "border-warning/20 text-warning-600 bg-warning/5 hover:bg-warning/10 hover:border-warning/30 focus-visible:ring-warning/40"
175
- }
176
- },
177
- {
178
- variant: "outline",
179
- color: "error",
180
- classNames: {
181
- root: "border-error/20 text-error-600 bg-error/5 hover:bg-error/10 hover:border-error/30 focus-visible:ring-error/40"
182
- }
183
- },
184
- {
185
- variant: "outline",
186
- color: "commentary",
187
- classNames: {
188
- root: "border-commentary/20 text-commentary-600 bg-commentary/5 hover:bg-commentary/10 hover:border-commentary/30 focus-visible:ring-commentary/40"
189
- }
190
- },
191
- {
192
- variant: "outline",
193
- color: "ideation",
194
- classNames: {
195
- root: "border-ideation/20 text-ideation-600 bg-ideation/5 hover:bg-ideation/10 hover:border-ideation/30 focus-visible:ring-ideation/40"
196
- }
197
- },
198
- {
199
- variant: "outline",
200
- color: "source",
201
- classNames: {
202
- root: "border-source/20 text-source-600 bg-source/5 hover:bg-source/10 hover:border-source/30 focus-visible:ring-source/40"
203
- }
204
- },
205
- {
206
- variant: "subtle",
207
- color: "primary",
208
- classNames: {
209
- root: "text-primary-600 bg-primary/10 hover:bg-primary/20 focus-visible:ring-primary/40"
210
- }
211
- },
212
- {
213
- variant: "subtle",
214
- color: "secondary",
215
- classNames: {
216
- root: "text-secondary-600 bg-secondary/10 hover:bg-secondary/20 focus-visible:ring-secondary/40"
217
- }
218
- },
219
- {
220
- variant: "subtle",
221
- color: "info",
222
- classNames: {
223
- root: "text-info-600 bg-info/10 hover:bg-info/20 focus-visible:ring-info/40"
224
- }
225
- },
226
- {
227
- variant: "subtle",
228
- color: "success",
229
- classNames: {
230
- root: "text-success-600 bg-success/10 hover:bg-success/20 focus-visible:ring-success/40"
231
- }
232
- },
233
- {
234
- variant: "subtle",
235
- color: "warning",
236
- classNames: {
237
- root: "text-warning-600 bg-warning/10 hover:bg-warning/20 focus-visible:ring-warning/40"
238
- }
239
- },
240
- {
241
- variant: "subtle",
242
- color: "error",
243
- classNames: {
244
- root: "text-error-600 bg-error/10 hover:bg-error/20 focus-visible:ring-error/40"
245
- }
246
- },
247
- {
248
- variant: "subtle",
249
- color: "commentary",
250
- classNames: {
251
- root: "text-commentary-600 bg-commentary/10 hover:bg-commentary/20 focus-visible:ring-commentary/40"
252
- }
253
- },
254
- {
255
- variant: "subtle",
256
- color: "ideation",
257
- classNames: {
258
- root: "text-ideation-600 bg-ideation/10 hover:bg-ideation/20 focus-visible:ring-ideation/40"
259
- }
260
- },
261
- {
262
- variant: "subtle",
263
- color: "source",
264
- classNames: {
265
- root: "text-source-600 bg-source/10 hover:bg-source/20 focus-visible:ring-source/40"
266
- }
267
- },
268
- {
269
- variant: "ghost",
270
- color: "primary",
271
- classNames: {
272
- root: "text-primary-600 hover:bg-primary/10 focus-visible:ring-primary/40"
273
- }
274
- },
275
- {
276
- variant: "ghost",
277
- color: "secondary",
278
- classNames: {
279
- root: "text-secondary-600 hover:bg-secondary/10 focus-visible:ring-secondary/40"
280
- }
281
- },
282
- {
283
- variant: "ghost",
284
- color: "info",
285
- classNames: {
286
- root: "text-info-600 hover:bg-info/10 focus-visible:ring-info/40"
287
- }
288
- },
289
- {
290
- variant: "ghost",
291
- color: "success",
292
- classNames: {
293
- root: "text-success-600 hover:bg-success/10 focus-visible:ring-success/40"
294
- }
295
- },
296
- {
297
- variant: "ghost",
298
- color: "warning",
299
- classNames: {
300
- root: "text-warning-600 hover:bg-warning/10 focus-visible:ring-warning/40"
301
- }
302
- },
303
- {
304
- variant: "ghost",
305
- color: "error",
306
- classNames: {
307
- root: "text-error-600 hover:bg-error/10 focus-visible:ring-error/40"
308
- }
309
- },
310
- {
311
- variant: "ghost",
312
- color: "commentary",
313
- classNames: {
314
- root: "text-commentary-600 hover:bg-commentary/10 focus-visible:ring-commentary/40"
315
- }
316
- },
317
- {
318
- variant: "ghost",
319
- color: "ideation",
320
- classNames: {
321
- root: "text-ideation-600 hover:bg-ideation/10 hover:bg-ideation/20 focus-visible:ring-ideation/40"
322
- }
323
- },
324
- {
325
- variant: "ghost",
326
- color: "source",
73
+ ...colors.map(color => ({
74
+ variant: "solid" as const,
75
+ color,
327
76
  classNames: {
328
- root: "text-source-600 hover:bg-source/10 focus-visible:ring-source/40"
77
+ root: `bg-${color}-500 text-white hover:bg-${color}-600 focus-visible:ring-${color}-500/50`
329
78
  }
330
- },
331
- {
332
- variant: "link",
333
- color: "primary",
79
+ })),
80
+ ...colors.map(color => ({
81
+ variant: "outline" as const,
82
+ color,
334
83
  classNames: {
335
- root: "text-primary-600 hover:underline hover:decoration-primary/30"
84
+ root: `border-${color}-500/20 text-${color}-600 bg-${color}-500/5 hover:bg-${color}-500/10 hover:border-${color}-500/30 focus-visible:ring-${color}-500/40`
336
85
  }
337
- },
338
- {
339
- variant: "link",
340
- color: "secondary",
86
+ })),
87
+ ...colors.map(color => ({
88
+ variant: "soft" as const,
89
+ color,
341
90
  classNames: {
342
- root: "text-secondary-600 hover:underline hover:decoration-secondary/30"
91
+ root: `text-${color}-600 bg-${color}-500/10 hover:bg-${color}-500/20 focus-visible:ring-${color}-500/40`
343
92
  }
344
- },
345
- {
346
- variant: "link",
347
- color: "info",
93
+ })),
94
+ ...colors.map(color => ({
95
+ variant: "subtle" as const,
96
+ color,
348
97
  classNames: {
349
- root: "text-info-600 hover:underline hover:decoration-info/30"
98
+ root: `text-${color}-600 bg-${color}-500/10 hover:bg-${color}-500/20 focus-visible:ring-${color}-500/40`
350
99
  }
351
- },
352
- {
353
- variant: "link",
354
- color: "success",
100
+ })),
101
+ ...colors.map(color => ({
102
+ variant: "ghost" as const,
103
+ color,
355
104
  classNames: {
356
- root: "text-success-600 hover:underline hover:decoration-success/30"
105
+ root: `text-${color}-600 hover:bg-${color}-500/10 focus-visible:ring-${color}-500/40`
357
106
  }
358
- },
359
- {
360
- variant: "link",
361
- color: "warning",
107
+ })),
108
+ ...colors.map(color => ({
109
+ variant: "link" as const,
110
+ color,
362
111
  classNames: {
363
- root: "text-warning-600 hover:underline hover:decoration-warning/30"
112
+ root: `text-${color}-600 hover:underline hover:decoration-${color}-300`
364
113
  }
365
- },
366
- {
367
- variant: "link",
368
- color: "error",
369
- classNames: {
370
- root: "text-error-600 hover:underline hover:decoration-error/30"
371
- }
372
- },
373
- {
374
- variant: "link",
375
- color: "commentary",
376
- classNames: {
377
- root: "text-commentary-600 hover:underline hover:decoration-commentary/30"
378
- }
379
- },
380
- {
381
- variant: "link",
382
- color: "ideation",
383
- classNames: {
384
- root: "text-ideation-600 hover:underline hover:decoration-ideation/30"
385
- }
386
- },
387
- {
388
- variant: "link",
389
- color: "source",
390
- classNames: {
391
- root: "text-source-600 hover:underline hover:decoration-source/30"
392
- }
393
- },
394
- {
395
- variant: "soft",
396
- color: "primary",
397
- classNames: {
398
- root: "text-primary-600 bg-primary/10 hover:bg-primary/20 focus-visible:ring-primary/40"
399
- }
400
- },
401
- {
402
- variant: "soft",
403
- color: "secondary",
404
- classNames: {
405
- root: "text-secondary-600 bg-secondary/10 hover:bg-secondary/20 focus-visible:ring-secondary/40"
406
- }
407
- },
408
- {
409
- variant: "soft",
410
- color: "info",
411
- classNames: {
412
- root: "text-info-600 bg-info/10 hover:bg-info/20 focus-visible:ring-info/40"
413
- }
414
- },
415
- {
416
- variant: "soft",
417
- color: "success",
418
- classNames: {
419
- root: "text-success-600 bg-success/10 hover:bg-success/20 focus-visible:ring-success/40"
420
- }
421
- },
422
- {
423
- variant: "soft",
424
- color: "warning",
425
- classNames: {
426
- root: "text-warning-600 bg-warning/10 hover:bg-warning/20 focus-visible:ring-warning/40"
427
- }
428
- },
429
- {
430
- variant: "soft",
431
- color: "error",
432
- classNames: {
433
- root: "text-error-600 bg-error/10 hover:bg-error/20 focus-visible:ring-error/40"
434
- }
435
- },
436
- {
437
- variant: "soft",
438
- color: "commentary",
439
- classNames: {
440
- root: "text-commentary-600 bg-commentary/10 hover:bg-commentary/20 focus-visible:ring-commentary/40"
441
- }
442
- },
443
- {
444
- variant: "soft",
445
- color: "ideation",
446
- classNames: {
447
- root: "text-ideation-600 bg-ideation/10 hover:bg-ideation/20 focus-visible:ring-ideation/40"
448
- }
449
- },
450
- {
451
- variant: "soft",
452
- color: "source",
453
- classNames: {
454
- root: "text-source-600 bg-source/10 hover:bg-source/20 focus-visible:ring-source/40"
455
- }
456
- },
114
+ })),
457
115
  {
458
116
  square: true,
459
117
  size: "xs",
@@ -519,3 +177,5 @@ export default defineTheme({
519
177
  size: "md"
520
178
  }
521
179
  })
180
+
181
+ export default createButtonTheme()
@@ -0,0 +1,19 @@
1
+ import { defineTheme } from "../utils/defineTheme"
2
+
3
+ export default defineTheme({
4
+ slots: [
5
+ "root",
6
+ "trigger",
7
+ "image",
8
+ "icon"
9
+ ],
10
+ base: {
11
+ root: "relative aspect-video h-full w-full cursor-pointer overflow-hidden",
12
+ trigger: "group absolute inset-0 aspect-video h-full w-full overflow-hidden",
13
+ image: "h-full w-full object-cover",
14
+ icon: "absolute inset-0 m-auto h-24 w-24 text-white opacity-75 transition-opacity group-hover:opacity-100"
15
+ },
16
+ variants: {},
17
+ compoundVariants: [],
18
+ defaultVariants: {}
19
+ })
@@ -19,7 +19,7 @@ export default defineTheme({
19
19
  base: {
20
20
  root: "relative isolate",
21
21
  background: "absolute inset-0 -z-1 overflow-hidden",
22
- container: "flex flex-col lg:grid",
22
+ container: "mx-auto w-full max-w-90rem px-md flex flex-col lg:grid",
23
23
  wrapper: "",
24
24
  header: "",
25
25
  leading: "flex items-center mb-6",