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