@webstudio-is/sdk-components-react-radix 0.90.0 → 0.92.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 (199) hide show
  1. package/lib/__generated__/accordion.props.js +6 -12
  2. package/lib/__generated__/checkbox.props.js +3 -6
  3. package/lib/__generated__/collapsible.props.js +4 -8
  4. package/lib/__generated__/dialog.props.js +8 -16
  5. package/lib/__generated__/label.props.js +2 -4
  6. package/lib/__generated__/navigation-menu.props.js +8 -16
  7. package/lib/__generated__/popover.props.js +4 -8
  8. package/lib/__generated__/radio-group.props.js +4 -8
  9. package/lib/__generated__/select.props.js +15 -19
  10. package/lib/__generated__/sheet.props.js +8 -16
  11. package/lib/__generated__/switch.props.js +3 -6
  12. package/lib/__generated__/tabs.props.js +5 -10
  13. package/lib/__generated__/tooltip.props.js +4 -8
  14. package/lib/accordion.js +7 -14
  15. package/{src/accordion.stories.tsx → lib/accordion.stories.js} +9 -12
  16. package/lib/accordion.ws.js +11 -22
  17. package/lib/checkbox.js +3 -6
  18. package/lib/checkbox.stories.js +19 -0
  19. package/lib/checkbox.ws.js +5 -10
  20. package/lib/collapsible.js +5 -10
  21. package/{src/collapsible.stories.tsx → lib/collapsible.stories.js} +9 -12
  22. package/lib/collapsible.ws.js +7 -14
  23. package/lib/components.js +13 -62
  24. package/lib/dialog.js +9 -18
  25. package/{src/dialog.stories.tsx → lib/dialog.stories.js} +9 -12
  26. package/lib/dialog.ws.js +17 -30
  27. package/lib/hooks.js +2 -4
  28. package/lib/label.js +2 -4
  29. package/lib/label.stories.js +19 -0
  30. package/lib/label.ws.js +3 -6
  31. package/lib/metas.js +55 -105
  32. package/lib/navigation-menu.js +9 -18
  33. package/{src/navigation-menu.stories.tsx → lib/navigation-menu.stories.js} +9 -12
  34. package/lib/navigation-menu.ws.js +16 -31
  35. package/lib/popover.js +5 -10
  36. package/{src/popover.stories.tsx → lib/popover.stories.js} +9 -12
  37. package/lib/popover.ws.js +7 -14
  38. package/lib/props-descriptions.js +2 -4
  39. package/lib/props.js +54 -103
  40. package/lib/radio-group.js +4 -8
  41. package/lib/radio-group.stories.js +19 -0
  42. package/lib/radio-group.ws.js +7 -14
  43. package/lib/select.js +10 -20
  44. package/{src/select.stories.tsx → lib/select.stories.js} +9 -12
  45. package/lib/select.ws.js +17 -34
  46. package/lib/sheet.js +9 -18
  47. package/{src/sheet.stories.tsx → lib/sheet.stories.js} +9 -12
  48. package/lib/sheet.ws.js +2 -4
  49. package/lib/switch.js +3 -6
  50. package/lib/switch.stories.js +19 -0
  51. package/lib/switch.ws.js +5 -10
  52. package/lib/tabs.js +6 -12
  53. package/{src/tabs.stories.tsx → lib/tabs.stories.js} +9 -12
  54. package/lib/tabs.ws.js +9 -18
  55. package/lib/theme/__generated__/tailwind-theme.js +517 -0
  56. package/lib/theme/styles.js +3 -6
  57. package/lib/theme/tailwind-classes.js +149 -301
  58. package/lib/theme/tailwind-colors.js +2 -4
  59. package/lib/tooltip.js +5 -10
  60. package/{src/tooltip.stories.tsx → lib/tooltip.stories.js} +9 -12
  61. package/lib/tooltip.ws.js +7 -14
  62. package/lib/types/__generated__/accordion.props.d.ts +1 -1
  63. package/lib/types/__generated__/checkbox.props.d.ts +1 -1
  64. package/lib/types/__generated__/collapsible.props.d.ts +1 -1
  65. package/lib/types/__generated__/dialog.props.d.ts +1 -1
  66. package/lib/types/__generated__/label.props.d.ts +1 -1
  67. package/lib/types/__generated__/navigation-menu.props.d.ts +1 -1
  68. package/lib/types/__generated__/popover.props.d.ts +1 -1
  69. package/lib/types/__generated__/radio-group.props.d.ts +1 -1
  70. package/lib/types/__generated__/select.props.d.ts +1 -1
  71. package/lib/types/__generated__/sheet.props.d.ts +1 -1
  72. package/lib/types/__generated__/switch.props.d.ts +1 -1
  73. package/lib/types/__generated__/tabs.props.d.ts +1 -1
  74. package/lib/types/__generated__/tooltip.props.d.ts +1 -1
  75. package/lib/types/accordion.d.ts +1 -1
  76. package/lib/types/sheet.d.ts +1 -1
  77. package/lib/types/theme/__generated__/tailwind-theme.d.ts +26 -0
  78. package/lib/types/theme/styles.d.ts +60 -60
  79. package/lib/types/theme/tailwind-classes.d.ts +33 -33
  80. package/package.json +20 -23
  81. package/lib/__generated__/button.props.js +0 -565
  82. package/lib/__generated__/input.props.js +0 -668
  83. package/lib/__generated__/textarea.props.js +0 -577
  84. package/lib/cjs/__generated__/accordion.props.js +0 -2645
  85. package/lib/cjs/__generated__/button.props.js +0 -585
  86. package/lib/cjs/__generated__/checkbox.props.js +0 -1103
  87. package/lib/cjs/__generated__/collapsible.props.js +0 -1050
  88. package/lib/cjs/__generated__/dialog.props.js +0 -2623
  89. package/lib/cjs/__generated__/input.props.js +0 -688
  90. package/lib/cjs/__generated__/label.props.js +0 -541
  91. package/lib/cjs/__generated__/navigation-menu.props.js +0 -2585
  92. package/lib/cjs/__generated__/popover.props.js +0 -582
  93. package/lib/cjs/__generated__/radio-group.props.js +0 -1647
  94. package/lib/cjs/__generated__/select.props.js +0 -3698
  95. package/lib/cjs/__generated__/sheet.props.js +0 -2642
  96. package/lib/cjs/__generated__/switch.props.js +0 -1103
  97. package/lib/cjs/__generated__/tabs.props.js +0 -2144
  98. package/lib/cjs/__generated__/textarea.props.js +0 -597
  99. package/lib/cjs/__generated__/tooltip.props.js +0 -593
  100. package/lib/cjs/accordion.js +0 -67
  101. package/lib/cjs/accordion.ws.js +0 -285
  102. package/lib/cjs/checkbox.js +0 -31
  103. package/lib/cjs/checkbox.ws.js +0 -174
  104. package/lib/cjs/collapsible.js +0 -53
  105. package/lib/cjs/collapsible.ws.js +0 -122
  106. package/lib/cjs/components.js +0 -82
  107. package/lib/cjs/dialog.js +0 -89
  108. package/lib/cjs/dialog.ws.js +0 -314
  109. package/lib/cjs/hooks.js +0 -43
  110. package/lib/cjs/label.js +0 -37
  111. package/lib/cjs/label.ws.js +0 -75
  112. package/lib/cjs/metas.js +0 -84
  113. package/lib/cjs/navigation-menu.js +0 -107
  114. package/lib/cjs/navigation-menu.ws.js +0 -514
  115. package/lib/cjs/package.json +0 -1
  116. package/lib/cjs/popover.js +0 -90
  117. package/lib/cjs/popover.ws.js +0 -142
  118. package/lib/cjs/props-descriptions.js +0 -56
  119. package/lib/cjs/props.js +0 -82
  120. package/lib/cjs/radio-group.js +0 -30
  121. package/lib/cjs/radio-group.ws.js +0 -191
  122. package/lib/cjs/select.js +0 -83
  123. package/lib/cjs/select.ws.js +0 -350
  124. package/lib/cjs/sheet.js +0 -96
  125. package/lib/cjs/sheet.ws.js +0 -257
  126. package/lib/cjs/switch.js +0 -27
  127. package/lib/cjs/switch.ws.js +0 -173
  128. package/lib/cjs/tabs.js +0 -59
  129. package/lib/cjs/tabs.ws.js +0 -196
  130. package/lib/cjs/theme/radix-common-types.js +0 -16
  131. package/lib/cjs/theme/styles.js +0 -96
  132. package/lib/cjs/theme/tailwind-classes.js +0 -819
  133. package/lib/cjs/theme/tailwind-colors.js +0 -45
  134. package/lib/cjs/theme/tailwind-theme.js +0 -46
  135. package/lib/cjs/tooltip.js +0 -87
  136. package/lib/cjs/tooltip.ws.js +0 -143
  137. package/lib/theme/radix-common-types.js +0 -0
  138. package/lib/theme/tailwind-theme.js +0 -16
  139. package/lib/types/__generated__/button.props.d.ts +0 -2
  140. package/lib/types/__generated__/input.props.d.ts +0 -2
  141. package/lib/types/__generated__/textarea.props.d.ts +0 -2
  142. package/lib/types/theme/radix-common-types.d.ts +0 -85
  143. package/lib/types/theme/tailwind-theme.d.ts +0 -72
  144. package/src/__generated__/accordion.props.ts +0 -2949
  145. package/src/__generated__/button.props.ts +0 -635
  146. package/src/__generated__/checkbox.props.ts +0 -1217
  147. package/src/__generated__/collapsible.props.ts +0 -1156
  148. package/src/__generated__/dialog.props.ts +0 -2923
  149. package/src/__generated__/input.props.ts +0 -748
  150. package/src/__generated__/label.props.ts +0 -585
  151. package/src/__generated__/navigation-menu.props.ts +0 -2882
  152. package/src/__generated__/popover.props.ts +0 -626
  153. package/src/__generated__/radio-group.props.ts +0 -1828
  154. package/src/__generated__/select.props.ts +0 -4130
  155. package/src/__generated__/sheet.props.ts +0 -2942
  156. package/src/__generated__/switch.props.ts +0 -1217
  157. package/src/__generated__/tabs.props.ts +0 -2386
  158. package/src/__generated__/textarea.props.ts +0 -645
  159. package/src/__generated__/tooltip.props.ts +0 -639
  160. package/src/accordion.tsx +0 -88
  161. package/src/accordion.ws.ts +0 -296
  162. package/src/checkbox.stories.ts +0 -22
  163. package/src/checkbox.tsx +0 -22
  164. package/src/checkbox.ws.ts +0 -154
  165. package/src/collapsible.tsx +0 -62
  166. package/src/collapsible.ws.ts +0 -115
  167. package/src/components.ts +0 -50
  168. package/src/dialog.tsx +0 -92
  169. package/src/dialog.ws.tsx +0 -318
  170. package/src/hooks.ts +0 -22
  171. package/src/label.stories.ts +0 -22
  172. package/src/label.tsx +0 -15
  173. package/src/label.ws.ts +0 -50
  174. package/src/metas.ts +0 -74
  175. package/src/navigation-menu.tsx +0 -130
  176. package/src/navigation-menu.ws.ts +0 -524
  177. package/src/popover.tsx +0 -96
  178. package/src/popover.ws.tsx +0 -128
  179. package/src/props-descriptions.ts +0 -43
  180. package/src/props.ts +0 -73
  181. package/src/radio-group.stories.ts +0 -22
  182. package/src/radio-group.tsx +0 -17
  183. package/src/radio-group.ws.ts +0 -178
  184. package/src/select.tsx +0 -112
  185. package/src/select.ws.ts +0 -349
  186. package/src/sheet.tsx +0 -79
  187. package/src/sheet.ws.tsx +0 -236
  188. package/src/switch.stories.ts +0 -22
  189. package/src/switch.tsx +0 -10
  190. package/src/switch.ws.ts +0 -146
  191. package/src/tabs.tsx +0 -64
  192. package/src/tabs.ws.ts +0 -198
  193. package/src/theme/radix-common-types.ts +0 -496
  194. package/src/theme/styles.ts +0 -76
  195. package/src/theme/tailwind-classes.ts +0 -1026
  196. package/src/theme/tailwind-colors.ts +0 -39
  197. package/src/theme/tailwind-theme.ts +0 -24
  198. package/src/tooltip.tsx +0 -95
  199. package/src/tooltip.ws.tsx +0 -130
@@ -1,10 +1,6 @@
1
- import { theme } from "./tailwind-theme";
2
- import {
3
- parseCssValue,
4
- parseBoxShadow,
5
- StyleValue
6
- } from "@webstudio-is/css-data";
7
- const property = (property2, value) => {
1
+ "use strict";
2
+ import * as theme from "./__generated__/tailwind-theme";
3
+ export const property = (property2, value) => {
8
4
  if (value.startsWith("--")) {
9
5
  return {
10
6
  property: property2,
@@ -17,7 +13,7 @@ const property = (property2, value) => {
17
13
  };
18
14
  };
19
15
  const preflight = () => {
20
- const borderColorValue = parseCssValue("color", theme("colors")["border"]);
16
+ const borderColorValue = theme.colors.border;
21
17
  return [
22
18
  {
23
19
  property: "borderTopStyle",
@@ -53,89 +49,55 @@ const preflight = () => {
53
49
  }
54
50
  ];
55
51
  };
56
- const z = (zIndex) => {
57
- const valueString = theme("zIndex")[zIndex ?? "auto"];
58
- const value = parseCssValue("zIndex", valueString);
52
+ export const z = (value) => {
59
53
  return [
60
54
  {
61
55
  property: "zIndex",
62
- value
56
+ value: theme.zIndex[value]
63
57
  }
64
58
  ];
65
59
  };
66
- const overflow = (value) => [
60
+ export const overflow = (value) => [
67
61
  {
68
62
  property: "overflow",
69
63
  value: { type: "keyword", value }
70
64
  }
71
65
  ];
72
- const rounded = (radius) => {
73
- const valueString = theme("borderRadius")[radius ?? "DEFAULT"];
74
- const value = parseCssValue("borderTopWidth", valueString);
66
+ export const rounded = (value = "DEFAULT") => {
67
+ const styleValue = theme.borderRadius[value];
75
68
  return [
76
- {
77
- property: "borderTopLeftRadius",
78
- value
79
- },
80
- {
81
- property: "borderTopRightRadius",
82
- value
83
- },
84
- {
85
- property: "borderBottomRightRadius",
86
- value
87
- },
88
- {
89
- property: "borderBottomLeftRadius",
90
- value
91
- }
69
+ { property: "borderTopLeftRadius", value: styleValue },
70
+ { property: "borderTopRightRadius", value: styleValue },
71
+ { property: "borderBottomRightRadius", value: styleValue },
72
+ { property: "borderBottomLeftRadius", value: styleValue }
92
73
  ];
93
74
  };
94
- const border = (borderWidthOrColor) => {
75
+ export const border = (borderWidthOrColor) => {
95
76
  if (typeof borderWidthOrColor === "number" || borderWidthOrColor === void 0) {
96
- const key = `${borderWidthOrColor ?? "DEFAULT"}`;
97
- const valueString = theme("borderWidth")?.[key] ?? "1px";
98
- const value2 = parseCssValue("borderTopWidth", valueString);
77
+ const styleValue2 = theme.borderWidth[borderWidthOrColor ?? "DEFAULT"];
99
78
  return [
100
79
  ...preflight(),
101
- { property: "borderTopWidth", value: value2 },
102
- { property: "borderRightWidth", value: value2 },
103
- { property: "borderBottomWidth", value: value2 },
104
- { property: "borderLeftWidth", value: value2 }
80
+ { property: "borderTopWidth", value: styleValue2 },
81
+ { property: "borderRightWidth", value: styleValue2 },
82
+ { property: "borderBottomWidth", value: styleValue2 },
83
+ { property: "borderLeftWidth", value: styleValue2 }
105
84
  ];
106
85
  }
107
- const value = parseCssValue("color", theme("colors")[borderWidthOrColor]);
86
+ const styleValue = theme.colors[borderWidthOrColor];
108
87
  return [
109
- {
110
- property: "borderTopColor",
111
- value
112
- },
113
- {
114
- property: "borderRightColor",
115
- value
116
- },
117
- {
118
- property: "borderBottomColor",
119
- value
120
- },
121
- {
122
- property: "borderLeftColor",
123
- value
124
- }
88
+ { property: "borderTopColor", value: styleValue },
89
+ { property: "borderRightColor", value: styleValue },
90
+ { property: "borderBottomColor", value: styleValue },
91
+ { property: "borderLeftColor", value: styleValue }
125
92
  ];
126
93
  };
127
- const borderB = (borderWidthOrColor) => {
94
+ export const borderB = (borderWidthOrColor) => {
128
95
  let widthValue = { type: "unit", value: 1, unit: "number" };
129
- let colorValue = parseCssValue(
130
- "color",
131
- theme("colors")["border"]
132
- );
96
+ let colorValue = theme.colors.border;
133
97
  if (typeof borderWidthOrColor === "number" || borderWidthOrColor === void 0) {
134
- const key = `${borderWidthOrColor ?? "DEFAULT"}`;
135
- const valueString = theme("borderWidth")[key] ?? "1px";
136
- widthValue = parseCssValue("borderTopWidth", valueString);
98
+ widthValue = theme.borderWidth[borderWidthOrColor ?? "DEFAULT"];
137
99
  } else {
138
- colorValue = parseCssValue("color", theme("colors")[borderWidthOrColor]);
100
+ colorValue = theme.colors[borderWidthOrColor];
139
101
  }
140
102
  return [
141
103
  {
@@ -153,121 +115,95 @@ const borderB = (borderWidthOrColor) => {
153
115
  ];
154
116
  };
155
117
  const paddingProperty = (property2) => (padding) => {
156
- const key = `${padding}`;
157
- const valueString = theme("padding")?.[key] ?? "0";
158
- const value = parseCssValue(property2, valueString);
159
- return [{ property: property2, value }];
118
+ return [{ property: property2, value: theme.padding[padding] }];
160
119
  };
161
- const pt = (padding) => {
120
+ export const pt = (padding) => {
162
121
  return paddingProperty("paddingTop")(padding);
163
122
  };
164
- const pb = (padding) => {
123
+ export const pb = (padding) => {
165
124
  return paddingProperty("paddingBottom")(padding);
166
125
  };
167
- const pl = (padding) => {
126
+ export const pl = (padding) => {
168
127
  return paddingProperty("paddingLeft")(padding);
169
128
  };
170
- const pr = (padding) => {
129
+ export const pr = (padding) => {
171
130
  return paddingProperty("paddingRight")(padding);
172
131
  };
173
- const px = (padding) => {
132
+ export const px = (padding) => {
174
133
  return [pl(padding), pr(padding)].flat();
175
134
  };
176
- const py = (padding) => {
135
+ export const py = (padding) => {
177
136
  return [pt(padding), pb(padding)].flat();
178
137
  };
179
- const p = (padding) => {
138
+ export const p = (padding) => {
180
139
  return [px(padding), py(padding)].flat();
181
140
  };
182
141
  const marginProperty = (property2) => (margin) => {
183
- const key = `${margin}`;
184
- const valueString = theme("margin")?.[key] ?? "0";
185
- const value = parseCssValue(property2, valueString);
186
- return [{ property: property2, value }];
142
+ return [{ property: property2, value: theme.margin[margin] }];
187
143
  };
188
- const ml = (margin) => {
144
+ export const ml = (margin) => {
189
145
  return marginProperty("marginLeft")(margin);
190
146
  };
191
- const mr = (margin) => {
147
+ export const mr = (margin) => {
192
148
  return marginProperty("marginRight")(margin);
193
149
  };
194
- const mt = (margin) => {
150
+ export const mt = (margin) => {
195
151
  return marginProperty("marginTop")(margin);
196
152
  };
197
- const mb = (margin) => {
153
+ export const mb = (margin) => {
198
154
  return marginProperty("marginBottom")(margin);
199
155
  };
200
- const mx = (margin) => {
156
+ export const mx = (margin) => {
201
157
  return [ml(margin), mr(margin)].flat();
202
158
  };
203
- const my = (margin) => {
159
+ export const my = (margin) => {
204
160
  return [mt(margin), mb(margin)].flat();
205
161
  };
206
- const m = (margin) => {
162
+ export const m = (margin) => {
207
163
  return [mx(margin), my(margin)].flat();
208
164
  };
209
- const w = (spacing) => {
210
- const key = `${spacing}`;
211
- const valueString = theme("width")?.[key] ?? "0";
212
- const value = parseCssValue("width", valueString);
213
- return [{ property: "width", value }];
165
+ export const w = (spacing) => {
166
+ return [{ property: "width", value: theme.width[spacing] }];
214
167
  };
215
- const h = (spacing) => {
216
- const key = `${spacing}`;
217
- const valueString = theme("height")?.[key] ?? "0";
218
- const value = parseCssValue("height", valueString);
219
- return [{ property: "height", value }];
168
+ export const h = (spacing) => {
169
+ return [{ property: "height", value: theme.height[spacing] }];
220
170
  };
221
- const minH = (spacing) => {
222
- const key = `${spacing}`;
223
- const valueString = theme("height")?.[key] ?? "0";
224
- const value = parseCssValue("minHeight", valueString);
225
- return [{ property: "minHeight", value }];
171
+ export const minH = (spacing) => {
172
+ return [{ property: "minHeight", value: theme.minHeight[spacing] }];
226
173
  };
227
- const opacity = (opacity2) => {
228
- const key = `${opacity2}`;
229
- const valueString = theme("opacity")?.[key] ?? "0";
230
- const value = parseCssValue("opacity", valueString);
174
+ export const opacity = (opacity2) => {
231
175
  return [
232
176
  {
233
177
  property: "opacity",
234
- value
178
+ value: theme.opacity[opacity2]
235
179
  }
236
180
  ];
237
181
  };
238
- const cursor = (cursor2) => {
239
- const valueString = theme("cursor")?.[cursor2] ?? "auto";
240
- const value = parseCssValue("cursor", valueString);
182
+ export const cursor = (cursor2) => {
241
183
  return [
242
184
  {
243
185
  property: "cursor",
244
- value
186
+ value: theme.cursor[cursor2]
245
187
  }
246
188
  ];
247
189
  };
248
- const maxW = (spacing) => {
249
- const key = `${spacing}`;
250
- const valueString = theme("maxWidth")?.[key] ?? "0";
251
- const value = parseCssValue("width", valueString);
252
- return [{ property: "maxWidth", value }];
190
+ export const maxW = (spacing) => {
191
+ return [{ property: "maxWidth", value: theme.maxWidth[spacing] }];
253
192
  };
254
193
  const positionStyle = (property2, spacing) => {
255
- const key = `${spacing}`;
256
- const valueString = theme("inset")?.[key] ?? "0";
257
- const value = parseCssValue(property2, valueString);
258
- return { property: property2, value };
259
- };
260
- const top = (spacing) => [positionStyle("top", spacing)];
261
- const right = (spacing) => [positionStyle("right", spacing)];
262
- const bottom = (spacing) => [positionStyle("bottom", spacing)];
263
- const left = (spacing) => [positionStyle("left", spacing)];
264
- const inset = (spacing) => [
194
+ return { property: property2, value: theme.inset[spacing] };
195
+ };
196
+ export const top = (spacing) => [positionStyle("top", spacing)];
197
+ export const right = (spacing) => [positionStyle("right", spacing)];
198
+ export const bottom = (spacing) => [positionStyle("bottom", spacing)];
199
+ export const left = (spacing) => [positionStyle("left", spacing)];
200
+ export const inset = (spacing) => [
265
201
  positionStyle("left", spacing),
266
202
  positionStyle("right", spacing),
267
203
  positionStyle("top", spacing),
268
204
  positionStyle("bottom", spacing)
269
205
  ];
270
- const aspect = (value) => {
206
+ export const aspect = (value) => {
271
207
  let unparsed = value;
272
208
  if (value === "square") {
273
209
  unparsed = "1 / 1";
@@ -282,20 +218,13 @@ const aspect = (value) => {
282
218
  }
283
219
  ];
284
220
  };
285
- const backdropBlur = (blur) => {
286
- const valueString = theme("blur")[blur];
287
- const value = {
288
- type: "unparsed",
289
- value: `blur(${valueString})`
290
- };
291
- return [{ property: "backdropFilter", value }];
221
+ export const backdropBlur = (blur) => {
222
+ return [{ property: "backdropFilter", value: theme.blur[blur] }];
292
223
  };
293
- const list = (listStyle) => {
294
- const valueString = theme("listStyleType")[listStyle];
295
- const value = parseCssValue("listStyleType", valueString);
296
- return [{ property: "listStyleType", value }];
224
+ export const list = (listStyle) => {
225
+ return [{ property: "listStyleType", value: theme.listStyleType[listStyle] }];
297
226
  };
298
- const select = (selectValue) => {
227
+ export const select = (_selectValue) => {
299
228
  return [
300
229
  {
301
230
  property: "userSelect",
@@ -306,8 +235,8 @@ const select = (selectValue) => {
306
235
  }
307
236
  ];
308
237
  };
309
- const bg = (color, alpha) => {
310
- const value = parseCssValue("backgroundColor", theme("colors")[color]);
238
+ export const bg = (color, alpha) => {
239
+ const value = theme.colors[color];
311
240
  if (alpha !== void 0 && value.type === "rgb") {
312
241
  value.alpha = alpha / 100;
313
242
  }
@@ -318,20 +247,20 @@ const bg = (color, alpha) => {
318
247
  }
319
248
  ];
320
249
  };
321
- const fixed = () => {
250
+ export const fixed = () => {
322
251
  return [{ property: "position", value: { type: "keyword", value: "fixed" } }];
323
252
  };
324
- const relative = () => {
253
+ export const relative = () => {
325
254
  return [
326
255
  { property: "position", value: { type: "keyword", value: "relative" } }
327
256
  ];
328
257
  };
329
- const absolute = () => {
258
+ export const absolute = () => {
330
259
  return [
331
260
  { property: "position", value: { type: "keyword", value: "absolute" } }
332
261
  ];
333
262
  };
334
- const grid = () => {
263
+ export const grid = () => {
335
264
  return [{ property: "display", value: { type: "keyword", value: "grid" } }];
336
265
  };
337
266
  const alignItems = {
@@ -341,7 +270,7 @@ const alignItems = {
341
270
  baseline: "baseline",
342
271
  stretch: "stretch"
343
272
  };
344
- const items = (alignItemsParam) => {
273
+ export const items = (alignItemsParam) => {
345
274
  return [
346
275
  {
347
276
  property: "alignItems",
@@ -361,7 +290,7 @@ const justifyContent = {
361
290
  evenly: "space-evenly",
362
291
  stretch: "stretch"
363
292
  };
364
- const justify = (justifyContentParam) => {
293
+ export const justify = (justifyContentParam) => {
365
294
  return [
366
295
  {
367
296
  property: "justifyContent",
@@ -372,16 +301,16 @@ const justify = (justifyContentParam) => {
372
301
  }
373
302
  ];
374
303
  };
375
- const inlineFlex = () => {
304
+ export const inlineFlex = () => {
376
305
  return [
377
306
  { property: "display", value: { type: "keyword", value: "inline-flex" } }
378
307
  ];
379
308
  };
380
- const block = () => {
309
+ export const block = () => {
381
310
  return [{ property: "display", value: { type: "keyword", value: "block" } }];
382
311
  };
383
312
  const flexDirection = { row: "row", col: "column" };
384
- const flex = (flexParam) => {
313
+ export const flex = (flexParam) => {
385
314
  if (flexParam === void 0) {
386
315
  return [{ property: "display", value: { type: "keyword", value: "flex" } }];
387
316
  }
@@ -459,7 +388,7 @@ const flex = (flexParam) => {
459
388
  }
460
389
  ];
461
390
  };
462
- const grow = () => {
391
+ export const grow = () => {
463
392
  return [
464
393
  {
465
394
  property: "flexGrow",
@@ -467,7 +396,7 @@ const grow = () => {
467
396
  }
468
397
  ];
469
398
  };
470
- const shrink = (value) => {
399
+ export const shrink = (value) => {
471
400
  return [
472
401
  {
473
402
  property: "flexGrow",
@@ -475,18 +404,14 @@ const shrink = (value) => {
475
404
  }
476
405
  ];
477
406
  };
478
- const gap = (gapValue) => {
479
- const key = `${gapValue}`;
480
- const valueString = theme("spacing")?.[key] ?? "0";
481
- const value = parseCssValue("rowGap", valueString);
407
+ export const gap = (gapValue) => {
408
+ const value = theme.spacing[gapValue];
482
409
  return [
483
410
  { property: "rowGap", value },
484
411
  { property: "columnGap", value }
485
412
  ];
486
413
  };
487
- const lineClamp = (lineClampValue) => {
488
- const key = `${lineClampValue}`;
489
- const valueString = theme("lineClamp")?.[key];
414
+ export const lineClamp = (lineClampValue) => {
490
415
  return [
491
416
  {
492
417
  property: "overflow",
@@ -511,26 +436,19 @@ const lineClamp = (lineClampValue) => {
511
436
  },
512
437
  {
513
438
  property: "-webkit-line-clamp",
514
- value: {
515
- type: "keyword",
516
- value: valueString
517
- }
439
+ value: theme.lineClamp[lineClampValue]
518
440
  }
519
441
  ];
520
442
  };
521
- const leading = (lineHeight) => {
522
- const key = `${lineHeight}`;
523
- const valueString = theme("lineHeight")[key];
524
- const value = parseCssValue("lineHeight", valueString);
525
- return [{ property: "lineHeight", value }];
443
+ export const leading = (lineHeight) => {
444
+ return [{ property: "lineHeight", value: theme.lineHeight[lineHeight] }];
526
445
  };
527
- const tracking = (letterSpacing) => {
528
- const key = `${letterSpacing}`;
529
- const valueString = theme("letterSpacing")[key];
530
- const value = parseCssValue("letterSpacing", valueString);
531
- return [{ property: "letterSpacing", value }];
446
+ export const tracking = (letterSpacing) => {
447
+ return [
448
+ { property: "letterSpacing", value: theme.letterSpacing[letterSpacing] }
449
+ ];
532
450
  };
533
- const outline = (value) => {
451
+ export const outline = (_value) => {
534
452
  return [
535
453
  {
536
454
  property: "outlineWidth",
@@ -550,42 +468,23 @@ const outline = (value) => {
550
468
  }
551
469
  ];
552
470
  };
553
- const textSizes = [
554
- "sm",
555
- "base",
556
- "lg",
557
- "xs",
558
- "xl",
559
- "2xl",
560
- "3xl",
561
- "4xl",
562
- "5xl",
563
- "6xl",
564
- "7xl",
565
- "8xl",
566
- "9xl"
567
- ];
471
+ const textSizes = Object.keys(theme.fontSize);
568
472
  const isTextSize = (value) => textSizes.includes(value);
569
- const text = (sizeOrColor) => {
473
+ export const text = (sizeOrColor) => {
570
474
  if (isTextSize(sizeOrColor)) {
571
- const valueArr = theme("fontSize")[sizeOrColor];
572
- const [fontSizeString, { lineHeight: lineHeightString }] = valueArr;
573
- const fontSize = parseCssValue("fontSize", fontSizeString);
574
- const lineHeight = parseCssValue("lineHeight", lineHeightString);
575
475
  return [
576
- { property: "fontSize", value: fontSize },
577
- { property: "lineHeight", value: lineHeight }
476
+ { property: "fontSize", value: theme.fontSize[sizeOrColor] },
477
+ { property: "lineHeight", value: theme.fontSizeLineHeight[sizeOrColor] }
578
478
  ];
579
479
  }
580
- const value = parseCssValue("color", theme("colors")[sizeOrColor]);
581
480
  return [
582
481
  {
583
482
  property: "color",
584
- value
483
+ value: theme.colors[sizeOrColor]
585
484
  }
586
485
  ];
587
486
  };
588
- const noUnderline = () => {
487
+ export const noUnderline = () => {
589
488
  return [
590
489
  {
591
490
  property: "textDecorationLine",
@@ -593,7 +492,7 @@ const noUnderline = () => {
593
492
  }
594
493
  ];
595
494
  };
596
- const underline = () => {
495
+ export const underline = () => {
597
496
  return [
598
497
  {
599
498
  property: "textDecorationLine",
@@ -601,14 +500,11 @@ const underline = () => {
601
500
  }
602
501
  ];
603
502
  };
604
- const underlineOffset = (offset) => {
605
- const key = `${offset}`;
606
- const valueString = theme("textUnderlineOffset")[key];
607
- const value = parseCssValue("textUnderlineOffset", valueString);
503
+ export const underlineOffset = (offset) => {
608
504
  return [
609
505
  {
610
506
  property: "textUnderlineOffset",
611
- value
507
+ value: theme.textUnderlineOffset[offset]
612
508
  }
613
509
  ];
614
510
  };
@@ -623,7 +519,7 @@ const weights = {
623
519
  extrabold: "800",
624
520
  black: "900"
625
521
  };
626
- const font = (weight) => {
522
+ export const font = (weight) => {
627
523
  return [
628
524
  {
629
525
  property: "fontWeight",
@@ -631,7 +527,7 @@ const font = (weight) => {
631
527
  }
632
528
  ];
633
529
  };
634
- const whitespace = (value) => {
530
+ export const whitespace = (value) => {
635
531
  return [
636
532
  {
637
533
  property: "whiteSpace",
@@ -639,37 +535,59 @@ const whitespace = (value) => {
639
535
  }
640
536
  ];
641
537
  };
642
- const shadow = (shadowSize) => {
643
- const valueString = theme("boxShadow")[shadowSize];
644
- const value = parseBoxShadow(valueString);
538
+ export const shadow = (shadowSize) => {
645
539
  return [
646
540
  {
647
541
  property: "boxShadow",
648
- value
542
+ value: theme.boxShadow[shadowSize]
649
543
  }
650
544
  ];
651
545
  };
652
- const ring = (ringColor, ringWidth, ringOffsetColor = "background", ringOffsetWidth = 0, inset2 = "") => {
653
- const ringWidthUnits = theme("ringWidth")[ringWidth];
654
- const ringOffsetWidthUnits = theme("ringOffsetWidth")[ringOffsetWidth];
655
- const ringColorRgb = theme("colors")[ringColor];
656
- const ringOffsetColorRgb = theme("colors")[ringOffsetColor];
657
- const ringOffsetShadow = `${inset2} 0 0 0 ${ringOffsetWidthUnits} ${ringOffsetColorRgb}`;
658
- const ringWidthParsed = parseFloat(ringWidthUnits);
659
- const ringOffsetWidthParsed = parseFloat(ringOffsetWidthUnits);
660
- const ringShadow = `${inset2} 0 0 0 ${ringWidthParsed + ringOffsetWidthParsed}px ${ringColorRgb}`;
661
- const value = parseBoxShadow(`${ringOffsetShadow}, ${ringShadow}`);
546
+ export const ring = (ringColor, ringWidth, ringOffsetColor = "background", ringOffsetWidth = 0) => {
547
+ const ringWidthStyleValue = theme.ringWidth[ringWidth];
548
+ const ringOffsetWidthStyleValue = theme.ringOffsetWidth[ringOffsetWidth];
549
+ const ringColorStyleValue = theme.colors[ringColor];
550
+ const ringOffsetColorStyleValue = theme.colors[ringOffsetColor];
551
+ const ringOffsetShadow = {
552
+ type: "tuple",
553
+ value: [
554
+ { type: "unit", value: 0, unit: "number" },
555
+ { type: "unit", value: 0, unit: "number" },
556
+ { type: "unit", value: 0, unit: "number" },
557
+ ringOffsetWidthStyleValue,
558
+ ringOffsetColorStyleValue
559
+ ]
560
+ };
561
+ const ringWidthValue = ringWidthStyleValue.type === "unit" ? ringWidthStyleValue.value : 0;
562
+ const ringOffsetWidthValue = ringOffsetWidthStyleValue.type === "unit" ? ringOffsetWidthStyleValue.value : 0;
563
+ const ringShadow = {
564
+ type: "tuple",
565
+ value: [
566
+ { type: "unit", value: 0, unit: "number" },
567
+ { type: "unit", value: 0, unit: "number" },
568
+ { type: "unit", value: 0, unit: "number" },
569
+ {
570
+ type: "unit",
571
+ value: ringWidthValue + ringOffsetWidthValue,
572
+ unit: ringWidthStyleValue.type === "unit" ? ringWidthStyleValue.unit : "number"
573
+ },
574
+ ringColorStyleValue
575
+ ]
576
+ };
662
577
  return [
663
578
  {
664
579
  property: "boxShadow",
665
- value
580
+ value: {
581
+ type: "layers",
582
+ value: [ringOffsetShadow, ringShadow]
583
+ }
666
584
  }
667
585
  ];
668
586
  };
669
- const pointerEvents = (value) => {
587
+ export const pointerEvents = (value) => {
670
588
  return [{ property: "pointerEvents", value: { type: "keyword", value } }];
671
589
  };
672
- const transition = (value) => {
590
+ export const transition = (value) => {
673
591
  if (value === "none") {
674
592
  return [
675
593
  {
@@ -693,7 +611,7 @@ const transition = (value) => {
693
611
  }
694
612
  ];
695
613
  };
696
- const duration = (ms) => {
614
+ export const duration = (ms) => {
697
615
  return [
698
616
  {
699
617
  property: "transitionDuration",
@@ -701,103 +619,33 @@ const duration = (ms) => {
701
619
  }
702
620
  ];
703
621
  };
704
- const hover = (value) => {
622
+ export const hover = (value) => {
705
623
  return value.map((decl) => ({
706
624
  ...decl,
707
625
  state: ":hover"
708
626
  }));
709
627
  };
710
- const focus = (value) => {
628
+ export const focus = (value) => {
711
629
  return value.map((decl) => ({
712
630
  ...decl,
713
631
  state: ":focus"
714
632
  }));
715
633
  };
716
- const focusVisible = (value) => {
634
+ export const focusVisible = (value) => {
717
635
  return value.map((decl) => ({
718
636
  ...decl,
719
637
  state: ":focus-visible"
720
638
  }));
721
639
  };
722
- const disabled = (value) => {
640
+ export const disabled = (value) => {
723
641
  return value.map((decl) => ({
724
642
  ...decl,
725
643
  state: ":disabled"
726
644
  }));
727
645
  };
728
- const state = (value, state2) => {
646
+ export const state = (value, state2) => {
729
647
  return value.map((decl) => ({
730
648
  ...decl,
731
649
  state: state2
732
650
  }));
733
651
  };
734
- export {
735
- absolute,
736
- aspect,
737
- backdropBlur,
738
- bg,
739
- block,
740
- border,
741
- borderB,
742
- bottom,
743
- cursor,
744
- disabled,
745
- duration,
746
- fixed,
747
- flex,
748
- focus,
749
- focusVisible,
750
- font,
751
- gap,
752
- grid,
753
- grow,
754
- h,
755
- hover,
756
- inlineFlex,
757
- inset,
758
- items,
759
- justify,
760
- leading,
761
- left,
762
- lineClamp,
763
- list,
764
- m,
765
- maxW,
766
- mb,
767
- minH,
768
- ml,
769
- mr,
770
- mt,
771
- mx,
772
- my,
773
- noUnderline,
774
- opacity,
775
- outline,
776
- overflow,
777
- p,
778
- pb,
779
- pl,
780
- pointerEvents,
781
- pr,
782
- property,
783
- pt,
784
- px,
785
- py,
786
- relative,
787
- right,
788
- ring,
789
- rounded,
790
- select,
791
- shadow,
792
- shrink,
793
- state,
794
- text,
795
- top,
796
- tracking,
797
- transition,
798
- underline,
799
- underlineOffset,
800
- w,
801
- whitespace,
802
- z
803
- };