@webstudio-is/sdk-components-react 0.83.0 → 0.84.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.
Files changed (72) hide show
  1. package/lib/cjs/components.js +0 -16
  2. package/lib/cjs/form.ws.js +1 -1
  3. package/lib/cjs/list.ws.js +1 -1
  4. package/lib/cjs/metas.js +0 -16
  5. package/lib/cjs/props.js +0 -16
  6. package/lib/components.js +0 -24
  7. package/lib/form.ws.js +1 -1
  8. package/lib/list.ws.js +1 -1
  9. package/lib/metas.js +0 -32
  10. package/lib/props.js +0 -32
  11. package/lib/types/components.d.ts +0 -3
  12. package/lib/types/metas.d.ts +0 -3
  13. package/lib/types/props.d.ts +0 -3
  14. package/lib/types/vimeo-preview-image.d.ts +3 -3
  15. package/package.json +8 -13
  16. package/src/components.ts +0 -11
  17. package/src/form.ws.tsx +1 -1
  18. package/src/list.ws.tsx +1 -1
  19. package/src/metas.ts +0 -21
  20. package/src/props.ts +0 -19
  21. package/lib/__generated__/radix-dialog.props.js +0 -2120
  22. package/lib/__generated__/radix-popover.props.js +0 -463
  23. package/lib/__generated__/radix-tooltip.props.js +0 -473
  24. package/lib/cjs/__generated__/radix-dialog.props.js +0 -2140
  25. package/lib/cjs/__generated__/radix-popover.props.js +0 -483
  26. package/lib/cjs/__generated__/radix-tooltip.props.js +0 -493
  27. package/lib/cjs/radix-dialog.js +0 -61
  28. package/lib/cjs/radix-dialog.ws.js +0 -300
  29. package/lib/cjs/radix-popover.js +0 -59
  30. package/lib/cjs/radix-popover.ws.js +0 -139
  31. package/lib/cjs/radix-tooltip.js +0 -51
  32. package/lib/cjs/radix-tooltip.ws.js +0 -140
  33. package/lib/cjs/theme/radix-common-types.js +0 -16
  34. package/lib/cjs/theme/tailwind-classes.js +0 -439
  35. package/lib/cjs/theme/tailwind-colors.js +0 -33
  36. package/lib/cjs/theme/tailwind-theme.js +0 -46
  37. package/lib/radix-dialog.js +0 -36
  38. package/lib/radix-dialog.ws.js +0 -279
  39. package/lib/radix-popover.js +0 -34
  40. package/lib/radix-popover.ws.js +0 -114
  41. package/lib/radix-tooltip.js +0 -26
  42. package/lib/radix-tooltip.ws.js +0 -115
  43. package/lib/theme/radix-common-types.js +0 -0
  44. package/lib/theme/tailwind-classes.js +0 -419
  45. package/lib/theme/tailwind-colors.js +0 -13
  46. package/lib/theme/tailwind-theme.js +0 -16
  47. package/lib/types/__generated__/radix-dialog.props.d.ts +0 -8
  48. package/lib/types/__generated__/radix-popover.props.d.ts +0 -4
  49. package/lib/types/__generated__/radix-tooltip.props.d.ts +0 -4
  50. package/lib/types/radix-dialog.d.ts +0 -26
  51. package/lib/types/radix-dialog.ws.d.ts +0 -23
  52. package/lib/types/radix-popover.d.ts +0 -22
  53. package/lib/types/radix-popover.ws.d.ts +0 -15
  54. package/lib/types/radix-tooltip.d.ts +0 -22
  55. package/lib/types/radix-tooltip.ws.d.ts +0 -15
  56. package/lib/types/theme/radix-common-types.d.ts +0 -84
  57. package/lib/types/theme/tailwind-classes.d.ts +0 -69
  58. package/lib/types/theme/tailwind-colors.d.ts +0 -19
  59. package/lib/types/theme/tailwind-theme.d.ts +0 -72
  60. package/src/__generated__/radix-dialog.props.ts +0 -2363
  61. package/src/__generated__/radix-popover.props.ts +0 -510
  62. package/src/__generated__/radix-tooltip.props.ts +0 -521
  63. package/src/radix-dialog.tsx +0 -91
  64. package/src/radix-dialog.ws.tsx +0 -291
  65. package/src/radix-popover.tsx +0 -89
  66. package/src/radix-popover.ws.tsx +0 -124
  67. package/src/radix-tooltip.tsx +0 -84
  68. package/src/radix-tooltip.ws.tsx +0 -125
  69. package/src/theme/radix-common-types.ts +0 -495
  70. package/src/theme/tailwind-classes.ts +0 -570
  71. package/src/theme/tailwind-colors.ts +0 -47
  72. package/src/theme/tailwind-theme.ts +0 -24
@@ -1,570 +0,0 @@
1
- /**
2
- * Quik and dirty implementation of tailwind classes conversion to webstudio styles.
3
- */
4
- import type { EmbedTemplateStyleDecl } from "@webstudio-is/react-sdk";
5
- import { theme } from "./tailwind-theme";
6
- import { parseCssValue, parseBoxShadow } from "@webstudio-is/css-data";
7
- import type { EvaluatedDefaultTheme } from "./radix-common-types";
8
-
9
- // https://github.com/tailwindlabs/tailwindcss/blob/master/src/css/preflight.css
10
- const preflight = (): EmbedTemplateStyleDecl[] => {
11
- const borderColorValue = parseCssValue("color", theme("colors")["border"]);
12
-
13
- return [
14
- {
15
- property: "borderTopStyle",
16
- value: { type: "keyword", value: "solid" },
17
- },
18
- {
19
- property: "borderRightStyle",
20
- value: { type: "keyword", value: "solid" },
21
- },
22
- {
23
- property: "borderBottomStyle",
24
- value: { type: "keyword", value: "solid" },
25
- },
26
- {
27
- property: "borderLeftStyle",
28
- value: { type: "keyword", value: "solid" },
29
- },
30
-
31
- {
32
- property: "borderTopColor",
33
- value: borderColorValue,
34
- },
35
- {
36
- property: "borderRightColor",
37
- value: borderColorValue,
38
- },
39
- {
40
- property: "borderBottomColor",
41
- value: borderColorValue,
42
- },
43
- {
44
- property: "borderLeftColor",
45
- value: borderColorValue,
46
- },
47
- ];
48
- };
49
-
50
- export const z = (
51
- zIndex?: StringEnumToNumeric<keyof EvaluatedDefaultTheme["zIndex"]>
52
- ): EmbedTemplateStyleDecl[] => {
53
- const valueString = theme("zIndex")[zIndex ?? "auto"];
54
- const value = parseCssValue("zIndex", valueString);
55
-
56
- return [
57
- {
58
- property: "zIndex",
59
- value,
60
- },
61
- ];
62
- };
63
-
64
- export const overflow = (
65
- value: "hidden" | "visible" | "scroll" | "auto"
66
- ): EmbedTemplateStyleDecl[] => [
67
- {
68
- property: "overflow",
69
- value: { type: "keyword", value },
70
- },
71
- ];
72
-
73
- export const rounded = (
74
- radius?: keyof EvaluatedDefaultTheme["borderRadius"]
75
- ): EmbedTemplateStyleDecl[] => {
76
- const valueString = theme("borderRadius")[radius ?? "DEFAULT"];
77
- const value = parseCssValue("borderTopWidth", valueString);
78
-
79
- return [
80
- {
81
- property: "borderTopLeftRadius",
82
- value,
83
- },
84
- {
85
- property: "borderTopRightRadius",
86
- value,
87
- },
88
- {
89
- property: "borderBottomRightRadius",
90
- value,
91
- },
92
- {
93
- property: "borderBottomLeftRadius",
94
- value,
95
- },
96
- ];
97
- };
98
-
99
- type StringEnumToNumeric<T extends string> = T extends `${infer Z extends
100
- number}`
101
- ? Z
102
- : never;
103
-
104
- type NonNumeric<T extends string> = T extends `${infer Z extends number}`
105
- ? never
106
- : T;
107
-
108
- export const border = (
109
- borderWidth?: StringEnumToNumeric<keyof EvaluatedDefaultTheme["borderWidth"]>
110
- ): EmbedTemplateStyleDecl[] => {
111
- const key = `${borderWidth ?? "DEFAULT"}` as const;
112
-
113
- const valueString = theme("borderWidth")?.[key] ?? "1px";
114
-
115
- const value = parseCssValue("borderTopWidth", valueString);
116
- return [
117
- ...preflight(),
118
- { property: "borderTopWidth", value },
119
- { property: "borderRightWidth", value },
120
- { property: "borderBottomWidth", value },
121
- { property: "borderLeftWidth", value },
122
- ];
123
- };
124
-
125
- export const px = (
126
- padding:
127
- | StringEnumToNumeric<keyof EvaluatedDefaultTheme["padding"]>
128
- | NonNumeric<keyof EvaluatedDefaultTheme["padding"]>
129
- ): EmbedTemplateStyleDecl[] => {
130
- const key = `${padding}` as const;
131
- const valueString = theme("padding")?.[key] ?? "0";
132
- const value = parseCssValue("paddingLeft", valueString);
133
-
134
- return [
135
- { property: "paddingLeft", value },
136
- { property: "paddingRight", value },
137
- ];
138
- };
139
-
140
- export const py = (
141
- padding:
142
- | StringEnumToNumeric<keyof EvaluatedDefaultTheme["padding"]>
143
- | NonNumeric<keyof EvaluatedDefaultTheme["padding"]>
144
- ): EmbedTemplateStyleDecl[] => {
145
- const key = `${padding}` as const;
146
- const valueString = theme("padding")[key];
147
- const value = parseCssValue("paddingTop", valueString);
148
-
149
- return [
150
- { property: "paddingTop", value },
151
- { property: "paddingBottom", value },
152
- ];
153
- };
154
-
155
- export const p = (
156
- padding:
157
- | StringEnumToNumeric<keyof EvaluatedDefaultTheme["padding"]>
158
- | NonNumeric<keyof EvaluatedDefaultTheme["padding"]>
159
- ): EmbedTemplateStyleDecl[] => {
160
- return [...px(padding), ...py(padding)];
161
- };
162
-
163
- export const mx = (
164
- margin:
165
- | StringEnumToNumeric<keyof EvaluatedDefaultTheme["margin"]>
166
- | NonNumeric<keyof EvaluatedDefaultTheme["margin"]>
167
- ): EmbedTemplateStyleDecl[] => {
168
- const key = `${margin}` as const;
169
- const valueString = theme("margin")?.[key] ?? "0";
170
- const value = parseCssValue("marginLeft", valueString);
171
-
172
- return [
173
- { property: "marginLeft", value },
174
- { property: "marginRight", value },
175
- ];
176
- };
177
-
178
- export const my = (
179
- margin:
180
- | StringEnumToNumeric<keyof EvaluatedDefaultTheme["margin"]>
181
- | NonNumeric<keyof EvaluatedDefaultTheme["margin"]>
182
- ): EmbedTemplateStyleDecl[] => {
183
- const key = `${margin}` as const;
184
- const valueString = theme("margin")[key];
185
- const value = parseCssValue("marginTop", valueString);
186
-
187
- return [
188
- { property: "marginTop", value },
189
- { property: "marginBottom", value },
190
- ];
191
- };
192
-
193
- export const m = (
194
- margin:
195
- | StringEnumToNumeric<keyof EvaluatedDefaultTheme["margin"]>
196
- | NonNumeric<keyof EvaluatedDefaultTheme["margin"]>
197
- ): EmbedTemplateStyleDecl[] => {
198
- return [...mx(margin), ...my(margin)];
199
- };
200
-
201
- export const w = (
202
- spacing:
203
- | StringEnumToNumeric<keyof EvaluatedDefaultTheme["width"]>
204
- | NonNumeric<keyof EvaluatedDefaultTheme["width"]>
205
- ): EmbedTemplateStyleDecl[] => {
206
- const key = `${spacing}` as const;
207
- const valueString = theme("width")?.[key] ?? "0";
208
- const value = parseCssValue("width", valueString);
209
-
210
- return [{ property: "width", value }];
211
- };
212
-
213
- export const h = (
214
- spacing:
215
- | StringEnumToNumeric<keyof EvaluatedDefaultTheme["height"]>
216
- | NonNumeric<keyof EvaluatedDefaultTheme["height"]>
217
- ): EmbedTemplateStyleDecl[] => {
218
- const key = `${spacing}` as const;
219
- const valueString = theme("height")?.[key] ?? "0";
220
- const value = parseCssValue("height", valueString);
221
-
222
- return [{ property: "height", value }];
223
- };
224
-
225
- export const opacity = (
226
- opacity: StringEnumToNumeric<keyof EvaluatedDefaultTheme["opacity"]>
227
- ): EmbedTemplateStyleDecl[] => {
228
- const key = `${opacity}` as const;
229
- const valueString = theme("opacity")?.[key] ?? "0";
230
- const value = parseCssValue("opacity", valueString);
231
-
232
- return [
233
- {
234
- property: "opacity",
235
- value,
236
- },
237
- ];
238
- };
239
-
240
- export const maxW = (
241
- spacing:
242
- | StringEnumToNumeric<keyof EvaluatedDefaultTheme["maxWidth"]>
243
- | NonNumeric<keyof EvaluatedDefaultTheme["maxWidth"]>
244
- ): EmbedTemplateStyleDecl[] => {
245
- const key = `${spacing}` as const;
246
- const valueString = theme("maxWidth")?.[key] ?? "0";
247
- const value = parseCssValue("width", valueString);
248
-
249
- return [{ property: "maxWidth", value }];
250
- };
251
-
252
- const positionStyle = (
253
- property: "left" | "right" | "top" | "bottom",
254
- spacing: StringEnumToNumeric<keyof EvaluatedDefaultTheme["spacing"]>
255
- ): EmbedTemplateStyleDecl => {
256
- const key = `${spacing}` as const;
257
- const valueString = theme("spacing")?.[key] ?? "0";
258
- const value = parseCssValue(property, valueString);
259
-
260
- return { property, value };
261
- };
262
-
263
- export const top = (
264
- spacing: StringEnumToNumeric<keyof EvaluatedDefaultTheme["spacing"]>
265
- ): EmbedTemplateStyleDecl[] => [positionStyle("top", spacing)];
266
-
267
- export const right = (
268
- spacing: StringEnumToNumeric<keyof EvaluatedDefaultTheme["spacing"]>
269
- ): EmbedTemplateStyleDecl[] => [positionStyle("right", spacing)];
270
-
271
- export const bottom = (
272
- spacing: StringEnumToNumeric<keyof EvaluatedDefaultTheme["spacing"]>
273
- ): EmbedTemplateStyleDecl[] => [positionStyle("bottom", spacing)];
274
-
275
- export const left = (
276
- spacing: StringEnumToNumeric<keyof EvaluatedDefaultTheme["spacing"]>
277
- ): EmbedTemplateStyleDecl[] => [positionStyle("left", spacing)];
278
-
279
- export const inset = (
280
- spacing: StringEnumToNumeric<keyof EvaluatedDefaultTheme["spacing"]>
281
- ): EmbedTemplateStyleDecl[] => [
282
- positionStyle("left", spacing),
283
- positionStyle("right", spacing),
284
- positionStyle("top", spacing),
285
- positionStyle("bottom", spacing),
286
- ];
287
-
288
- export const backdropBlur = (
289
- blur: keyof EvaluatedDefaultTheme["blur"]
290
- ): EmbedTemplateStyleDecl[] => {
291
- const valueString = theme("blur")[blur];
292
- const value = {
293
- type: "unparsed" as const,
294
- value: `blur(${valueString})`,
295
- };
296
-
297
- return [{ property: "backdropFilter", value }];
298
- };
299
-
300
- export const bg = (
301
- color: keyof EvaluatedDefaultTheme["colors"],
302
- alpha?: number
303
- ): EmbedTemplateStyleDecl[] => {
304
- const value = parseCssValue("backgroundColor", theme("colors")[color]);
305
-
306
- if (alpha !== undefined && value.type === "rgb") {
307
- value.alpha = alpha / 100;
308
- }
309
-
310
- return [
311
- {
312
- property: "backgroundColor",
313
- value,
314
- },
315
- ];
316
- };
317
-
318
- export const fixed = (): EmbedTemplateStyleDecl[] => {
319
- return [{ property: "position", value: { type: "keyword", value: "fixed" } }];
320
- };
321
-
322
- export const relative = (): EmbedTemplateStyleDecl[] => {
323
- return [
324
- { property: "position", value: { type: "keyword", value: "relative" } },
325
- ];
326
- };
327
-
328
- export const absolute = (): EmbedTemplateStyleDecl[] => {
329
- return [
330
- { property: "position", value: { type: "keyword", value: "absolute" } },
331
- ];
332
- };
333
-
334
- export const grid = (): EmbedTemplateStyleDecl[] => {
335
- return [{ property: "display", value: { type: "keyword", value: "grid" } }];
336
- };
337
-
338
- const alignItems = {
339
- start: "flex-start",
340
- end: "flex-end",
341
- center: "center",
342
- baseline: "baseline",
343
- stretch: "stretch",
344
- } as const;
345
- type AlignItems = keyof typeof alignItems;
346
-
347
- export const items = (
348
- alignItemsParam: AlignItems
349
- ): EmbedTemplateStyleDecl[] => {
350
- return [
351
- {
352
- property: "alignItems",
353
- value: {
354
- type: "keyword",
355
- value: alignItems[alignItemsParam],
356
- },
357
- },
358
- ];
359
- };
360
-
361
- const justifyContent = {
362
- start: "flex-start",
363
- end: "flex-end",
364
- center: "center",
365
- between: "space-between",
366
- around: "space-around",
367
- evenly: "space-evenly",
368
- stretch: "stretch",
369
- } as const;
370
- type JustifyContent = keyof typeof justifyContent;
371
-
372
- export const justify = (
373
- justifyContentParam: JustifyContent
374
- ): EmbedTemplateStyleDecl[] => {
375
- return [
376
- {
377
- property: "justifyContent",
378
- value: {
379
- type: "keyword",
380
- value: justifyContent[justifyContentParam],
381
- },
382
- },
383
- ];
384
- };
385
-
386
- const flexDirection = { row: "row", col: "column" } as const;
387
- type FlexDirection = keyof typeof flexDirection;
388
-
389
- export const flex = (flexParam?: FlexDirection): EmbedTemplateStyleDecl[] => {
390
- if (flexParam === undefined) {
391
- return [{ property: "display", value: { type: "keyword", value: "flex" } }];
392
- }
393
-
394
- return [
395
- {
396
- property: "flexDirection",
397
- value: {
398
- type: "keyword",
399
- value: flexDirection[flexParam],
400
- },
401
- },
402
- ];
403
- };
404
-
405
- export const gap = (
406
- gapValue: StringEnumToNumeric<keyof EvaluatedDefaultTheme["spacing"]>
407
- ): EmbedTemplateStyleDecl[] => {
408
- const key = `${gapValue}` as const;
409
- const valueString = theme("spacing")?.[key] ?? "0";
410
- const value = parseCssValue("rowGap", valueString);
411
-
412
- return [
413
- { property: "rowGap", value },
414
- { property: "columnGap", value },
415
- ];
416
- };
417
-
418
- export const leading = (
419
- lineHeight:
420
- | StringEnumToNumeric<keyof EvaluatedDefaultTheme["lineHeight"]>
421
- | NonNumeric<keyof EvaluatedDefaultTheme["lineHeight"]>
422
- ): EmbedTemplateStyleDecl[] => {
423
- const key = `${lineHeight}` as const;
424
- const valueString = theme("lineHeight")[key];
425
- const value = parseCssValue("lineHeight", valueString);
426
-
427
- return [{ property: "lineHeight", value }];
428
- };
429
-
430
- export const tracking = (
431
- letterSpacing:
432
- | StringEnumToNumeric<keyof EvaluatedDefaultTheme["letterSpacing"]>
433
- | NonNumeric<keyof EvaluatedDefaultTheme["letterSpacing"]>
434
- ): EmbedTemplateStyleDecl[] => {
435
- const key = `${letterSpacing}` as const;
436
- const valueString = theme("letterSpacing")[key];
437
- const value = parseCssValue("letterSpacing", valueString);
438
-
439
- return [{ property: "letterSpacing", value }];
440
- };
441
-
442
- export const outline = (value: "none"): EmbedTemplateStyleDecl[] => {
443
- return [
444
- {
445
- property: "outlineWidth",
446
- value: { type: "unit", value: 2, unit: "px" },
447
- },
448
- {
449
- property: "outlineStyle",
450
- value: { type: "keyword", value: "solid" },
451
- },
452
- {
453
- property: "outlineColor",
454
- value: { type: "keyword", value: "transparent" },
455
- },
456
- {
457
- property: "outlineOffset",
458
- value: { type: "unit", value: 2, unit: "px" },
459
- },
460
- ];
461
- };
462
-
463
- const textSizes = [
464
- "sm",
465
- "base",
466
- "lg",
467
- "xs",
468
- "xl",
469
- "2xl",
470
- "3xl",
471
- "4xl",
472
- "5xl",
473
- "6xl",
474
- "7xl",
475
- "8xl",
476
- "9xl",
477
- ] as const satisfies readonly (keyof EvaluatedDefaultTheme["fontSize"])[];
478
- type TextSize = keyof EvaluatedDefaultTheme["fontSize"];
479
-
480
- const isTextSize = (value: string): value is TextSize =>
481
- textSizes.includes(value as TextSize);
482
-
483
- export const text = (
484
- sizeOrColor: TextSize | keyof EvaluatedDefaultTheme["colors"]
485
- ): EmbedTemplateStyleDecl[] => {
486
- if (isTextSize(sizeOrColor)) {
487
- const valueArr = theme("fontSize")[sizeOrColor];
488
- const [fontSizeString, { lineHeight: lineHeightString }] = valueArr;
489
-
490
- const fontSize = parseCssValue("fontSize", fontSizeString);
491
- const lineHeight = parseCssValue("lineHeight", lineHeightString);
492
- return [
493
- { property: "fontSize", value: fontSize },
494
- { property: "lineHeight", value: lineHeight },
495
- ];
496
- }
497
-
498
- const value = parseCssValue("color", theme("colors")[sizeOrColor]);
499
-
500
- return [
501
- {
502
- property: "color",
503
- value,
504
- },
505
- ];
506
- };
507
-
508
- export const shadow = (
509
- shadowSize: keyof EvaluatedDefaultTheme["boxShadow"]
510
- ): EmbedTemplateStyleDecl[] => {
511
- const valueString = theme("boxShadow")[shadowSize];
512
- const value = parseBoxShadow(valueString);
513
-
514
- return [
515
- {
516
- property: "boxShadow",
517
- value,
518
- },
519
- ];
520
- };
521
-
522
- export const ring = (
523
- ringColor: keyof EvaluatedDefaultTheme["colors"],
524
- ringWidth: StringEnumToNumeric<keyof EvaluatedDefaultTheme["ringWidth"]>,
525
- ringOffsetColor: keyof EvaluatedDefaultTheme["colors"] = "background",
526
- ringOffsetWidth: StringEnumToNumeric<
527
- keyof EvaluatedDefaultTheme["ringOffsetWidth"]
528
- > = 0,
529
- inset: "inset" | "" = ""
530
- ): EmbedTemplateStyleDecl[] => {
531
- const ringWidthUnits = theme("ringWidth")[ringWidth];
532
- const ringOffsetWidthUnits = theme("ringOffsetWidth")[ringOffsetWidth];
533
- const ringColorRgb = theme("colors")[ringColor];
534
- const ringOffsetColorRgb = theme("colors")[ringOffsetColor];
535
- const ringOffsetShadow = `${inset} 0 0 0 ${ringOffsetWidthUnits} ${ringOffsetColorRgb}`;
536
-
537
- const ringWidthParsed = parseFloat(ringWidthUnits);
538
- const ringOffsetWidthParsed = parseFloat(ringOffsetWidthUnits);
539
-
540
- const ringShadow = `${inset} 0 0 0 ${
541
- ringWidthParsed + ringOffsetWidthParsed
542
- }px ${ringColorRgb}`;
543
-
544
- const value = parseBoxShadow(`${ringOffsetShadow}, ${ringShadow}`);
545
-
546
- return [
547
- {
548
- property: "boxShadow",
549
- value,
550
- },
551
- ];
552
- };
553
-
554
- export const hover = (
555
- value: EmbedTemplateStyleDecl[]
556
- ): EmbedTemplateStyleDecl[] => {
557
- return value.map((decl) => ({
558
- ...decl,
559
- state: ":hover",
560
- }));
561
- };
562
-
563
- export const focus = (
564
- value: EmbedTemplateStyleDecl[]
565
- ): EmbedTemplateStyleDecl[] => {
566
- return value.map((decl) => ({
567
- ...decl,
568
- state: ":focus",
569
- }));
570
- };
@@ -1,47 +0,0 @@
1
- /**
2
- * Variables source:
3
- * https://github.com/shadcn-ui/ui/blob/main/apps/www/registry/themes.ts#L1
4
- * https://github.com/shadcn-ui/ui/blob/5e172fc34fdf015aa0d141f52cc8c082b8ae6613/apps/www/scripts/build-registry.ts#L220
5
- *
6
- * Attributions
7
- * MIT License
8
- * Copyright (c) 2023 shadcn
9
- **/
10
-
11
- export const colors = {
12
- transparent: "transparent",
13
- current: "currentColor",
14
- popover: "rgb(255, 255, 255)",
15
- popoverForeground: "rgb(2, 8, 23)",
16
- border: "rgb(226, 232, 240)",
17
- background: "rgb(255, 255, 255)",
18
- ring: "rgb(148, 163, 184)",
19
- mutedForeground: "rgb(100, 116, 139)",
20
- } as const;
21
-
22
- /*
23
- // Not used, leave it for the following components.
24
-
25
- --background: 0 0% 100%;
26
- --foreground: 222.2 84% 4.9%;
27
-
28
- --muted: 210 40% 96.1%;
29
- --card: 0 0% 100%;
30
- --card-foreground: 222.2 84% 4.9%;
31
-
32
- --input: 214.3 31.8% 91.4%;
33
-
34
- --primary: 222.2 47.4% 11.2%;
35
- --primary-foreground: 210 40% 98%;
36
-
37
- --secondary: 210 40% 96.1%;
38
- --secondary-foreground: 222.2 47.4% 11.2%;
39
-
40
- --accent: 210 40% 96.1%;
41
- --accent-foreground: 222.2 47.4% 11.2%;
42
-
43
- --destructive: 0 84.2% 60.2%;
44
- --destructive-foreground: 210 40% 98%;
45
-
46
- --ring: 215 20.2% 65.1%;
47
- */
@@ -1,24 +0,0 @@
1
- // eslint-disable-next-line import/no-internal-modules
2
- import defaultTheme from "tailwindcss/defaultTheme"; // Imported theme https://github.com/tailwindlabs/tailwindcss/blob/e0c52a9332a64ef7eb0ba23d2a0fd5a16fe57ab7/stubs/config.full.js
3
- import type { EvaluatedDefaultTheme } from "./radix-common-types";
4
- import { colors } from "./tailwind-colors";
5
-
6
- // Override the default theme with our own colors and other values if needed
7
- const localTheme = { ...defaultTheme };
8
-
9
- export const theme = <T extends keyof EvaluatedDefaultTheme>(
10
- name: T
11
- ): EvaluatedDefaultTheme[T] => {
12
- const value = localTheme?.[name] as unknown;
13
-
14
- if (typeof value === "function") {
15
- return value({ theme, colors, breakpoints: () => ({}) });
16
- }
17
-
18
- return value as never;
19
- };
20
-
21
- // Override with our own colors, and other values if needed
22
- localTheme.colors = colors;
23
- localTheme.borderRadius = { ...theme("borderRadius") };
24
- localTheme.borderRadius.DEFAULT = "0.5rem";