@webstudio-is/sdk-components-react 0.83.0 → 0.85.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.
- package/lib/cjs/components.js +0 -16
- package/lib/cjs/form.ws.js +1 -1
- package/lib/cjs/list.ws.js +1 -1
- package/lib/cjs/metas.js +0 -16
- package/lib/cjs/props.js +0 -16
- package/lib/components.js +0 -24
- package/lib/form.ws.js +1 -1
- package/lib/list.ws.js +1 -1
- package/lib/metas.js +0 -32
- package/lib/props.js +0 -32
- package/lib/types/components.d.ts +0 -3
- package/lib/types/metas.d.ts +0 -3
- package/lib/types/props.d.ts +0 -3
- package/lib/types/vimeo-preview-image.d.ts +3 -3
- package/package.json +8 -13
- package/src/components.ts +0 -11
- package/src/form.ws.tsx +1 -1
- package/src/list.ws.tsx +1 -1
- package/src/metas.ts +0 -21
- package/src/props.ts +0 -19
- package/lib/__generated__/radix-dialog.props.js +0 -2120
- package/lib/__generated__/radix-popover.props.js +0 -463
- package/lib/__generated__/radix-tooltip.props.js +0 -473
- package/lib/cjs/__generated__/radix-dialog.props.js +0 -2140
- package/lib/cjs/__generated__/radix-popover.props.js +0 -483
- package/lib/cjs/__generated__/radix-tooltip.props.js +0 -493
- package/lib/cjs/radix-dialog.js +0 -61
- package/lib/cjs/radix-dialog.ws.js +0 -300
- package/lib/cjs/radix-popover.js +0 -59
- package/lib/cjs/radix-popover.ws.js +0 -139
- package/lib/cjs/radix-tooltip.js +0 -51
- package/lib/cjs/radix-tooltip.ws.js +0 -140
- package/lib/cjs/theme/radix-common-types.js +0 -16
- package/lib/cjs/theme/tailwind-classes.js +0 -439
- package/lib/cjs/theme/tailwind-colors.js +0 -33
- package/lib/cjs/theme/tailwind-theme.js +0 -46
- package/lib/radix-dialog.js +0 -36
- package/lib/radix-dialog.ws.js +0 -279
- package/lib/radix-popover.js +0 -34
- package/lib/radix-popover.ws.js +0 -114
- package/lib/radix-tooltip.js +0 -26
- package/lib/radix-tooltip.ws.js +0 -115
- package/lib/theme/radix-common-types.js +0 -0
- package/lib/theme/tailwind-classes.js +0 -419
- package/lib/theme/tailwind-colors.js +0 -13
- package/lib/theme/tailwind-theme.js +0 -16
- package/lib/types/__generated__/radix-dialog.props.d.ts +0 -8
- package/lib/types/__generated__/radix-popover.props.d.ts +0 -4
- package/lib/types/__generated__/radix-tooltip.props.d.ts +0 -4
- package/lib/types/radix-dialog.d.ts +0 -26
- package/lib/types/radix-dialog.ws.d.ts +0 -23
- package/lib/types/radix-popover.d.ts +0 -22
- package/lib/types/radix-popover.ws.d.ts +0 -15
- package/lib/types/radix-tooltip.d.ts +0 -22
- package/lib/types/radix-tooltip.ws.d.ts +0 -15
- package/lib/types/theme/radix-common-types.d.ts +0 -84
- package/lib/types/theme/tailwind-classes.d.ts +0 -69
- package/lib/types/theme/tailwind-colors.d.ts +0 -19
- package/lib/types/theme/tailwind-theme.d.ts +0 -72
- package/src/__generated__/radix-dialog.props.ts +0 -2363
- package/src/__generated__/radix-popover.props.ts +0 -510
- package/src/__generated__/radix-tooltip.props.ts +0 -521
- package/src/radix-dialog.tsx +0 -91
- package/src/radix-dialog.ws.tsx +0 -291
- package/src/radix-popover.tsx +0 -89
- package/src/radix-popover.ws.tsx +0 -124
- package/src/radix-tooltip.tsx +0 -84
- package/src/radix-tooltip.ws.tsx +0 -125
- package/src/theme/radix-common-types.ts +0 -495
- package/src/theme/tailwind-classes.ts +0 -570
- package/src/theme/tailwind-colors.ts +0 -47
- package/src/theme/tailwind-theme.ts +0 -24
|
@@ -1,16 +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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var radix_common_types_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(radix_common_types_exports);
|
|
@@ -1,439 +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
|
-
backdropBlur: () => backdropBlur,
|
|
23
|
-
bg: () => bg,
|
|
24
|
-
border: () => border,
|
|
25
|
-
bottom: () => bottom,
|
|
26
|
-
fixed: () => fixed,
|
|
27
|
-
flex: () => flex,
|
|
28
|
-
focus: () => focus,
|
|
29
|
-
gap: () => gap,
|
|
30
|
-
grid: () => grid,
|
|
31
|
-
h: () => h,
|
|
32
|
-
hover: () => hover,
|
|
33
|
-
inset: () => inset,
|
|
34
|
-
items: () => items,
|
|
35
|
-
justify: () => justify,
|
|
36
|
-
leading: () => leading,
|
|
37
|
-
left: () => left,
|
|
38
|
-
m: () => m,
|
|
39
|
-
maxW: () => maxW,
|
|
40
|
-
mx: () => mx,
|
|
41
|
-
my: () => my,
|
|
42
|
-
opacity: () => opacity,
|
|
43
|
-
outline: () => outline,
|
|
44
|
-
overflow: () => overflow,
|
|
45
|
-
p: () => p,
|
|
46
|
-
px: () => px,
|
|
47
|
-
py: () => py,
|
|
48
|
-
relative: () => relative,
|
|
49
|
-
right: () => right,
|
|
50
|
-
ring: () => ring,
|
|
51
|
-
rounded: () => rounded,
|
|
52
|
-
shadow: () => shadow,
|
|
53
|
-
text: () => text,
|
|
54
|
-
top: () => top,
|
|
55
|
-
tracking: () => tracking,
|
|
56
|
-
w: () => w,
|
|
57
|
-
z: () => z
|
|
58
|
-
});
|
|
59
|
-
module.exports = __toCommonJS(tailwind_classes_exports);
|
|
60
|
-
var import_tailwind_theme = require("./tailwind-theme");
|
|
61
|
-
var import_css_data = require("@webstudio-is/css-data");
|
|
62
|
-
const preflight = () => {
|
|
63
|
-
const borderColorValue = (0, import_css_data.parseCssValue)("color", (0, import_tailwind_theme.theme)("colors")["border"]);
|
|
64
|
-
return [
|
|
65
|
-
{
|
|
66
|
-
property: "borderTopStyle",
|
|
67
|
-
value: { type: "keyword", value: "solid" }
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
property: "borderRightStyle",
|
|
71
|
-
value: { type: "keyword", value: "solid" }
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
property: "borderBottomStyle",
|
|
75
|
-
value: { type: "keyword", value: "solid" }
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
property: "borderLeftStyle",
|
|
79
|
-
value: { type: "keyword", value: "solid" }
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
property: "borderTopColor",
|
|
83
|
-
value: borderColorValue
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
property: "borderRightColor",
|
|
87
|
-
value: borderColorValue
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
property: "borderBottomColor",
|
|
91
|
-
value: borderColorValue
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
property: "borderLeftColor",
|
|
95
|
-
value: borderColorValue
|
|
96
|
-
}
|
|
97
|
-
];
|
|
98
|
-
};
|
|
99
|
-
const z = (zIndex) => {
|
|
100
|
-
const valueString = (0, import_tailwind_theme.theme)("zIndex")[zIndex ?? "auto"];
|
|
101
|
-
const value = (0, import_css_data.parseCssValue)("zIndex", valueString);
|
|
102
|
-
return [
|
|
103
|
-
{
|
|
104
|
-
property: "zIndex",
|
|
105
|
-
value
|
|
106
|
-
}
|
|
107
|
-
];
|
|
108
|
-
};
|
|
109
|
-
const overflow = (value) => [
|
|
110
|
-
{
|
|
111
|
-
property: "overflow",
|
|
112
|
-
value: { type: "keyword", value }
|
|
113
|
-
}
|
|
114
|
-
];
|
|
115
|
-
const rounded = (radius) => {
|
|
116
|
-
const valueString = (0, import_tailwind_theme.theme)("borderRadius")[radius ?? "DEFAULT"];
|
|
117
|
-
const value = (0, import_css_data.parseCssValue)("borderTopWidth", valueString);
|
|
118
|
-
return [
|
|
119
|
-
{
|
|
120
|
-
property: "borderTopLeftRadius",
|
|
121
|
-
value
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
property: "borderTopRightRadius",
|
|
125
|
-
value
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
property: "borderBottomRightRadius",
|
|
129
|
-
value
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
property: "borderBottomLeftRadius",
|
|
133
|
-
value
|
|
134
|
-
}
|
|
135
|
-
];
|
|
136
|
-
};
|
|
137
|
-
const border = (borderWidth) => {
|
|
138
|
-
const key = `${borderWidth ?? "DEFAULT"}`;
|
|
139
|
-
const valueString = (0, import_tailwind_theme.theme)("borderWidth")?.[key] ?? "1px";
|
|
140
|
-
const value = (0, import_css_data.parseCssValue)("borderTopWidth", valueString);
|
|
141
|
-
return [
|
|
142
|
-
...preflight(),
|
|
143
|
-
{ property: "borderTopWidth", value },
|
|
144
|
-
{ property: "borderRightWidth", value },
|
|
145
|
-
{ property: "borderBottomWidth", value },
|
|
146
|
-
{ property: "borderLeftWidth", value }
|
|
147
|
-
];
|
|
148
|
-
};
|
|
149
|
-
const px = (padding) => {
|
|
150
|
-
const key = `${padding}`;
|
|
151
|
-
const valueString = (0, import_tailwind_theme.theme)("padding")?.[key] ?? "0";
|
|
152
|
-
const value = (0, import_css_data.parseCssValue)("paddingLeft", valueString);
|
|
153
|
-
return [
|
|
154
|
-
{ property: "paddingLeft", value },
|
|
155
|
-
{ property: "paddingRight", value }
|
|
156
|
-
];
|
|
157
|
-
};
|
|
158
|
-
const py = (padding) => {
|
|
159
|
-
const key = `${padding}`;
|
|
160
|
-
const valueString = (0, import_tailwind_theme.theme)("padding")[key];
|
|
161
|
-
const value = (0, import_css_data.parseCssValue)("paddingTop", valueString);
|
|
162
|
-
return [
|
|
163
|
-
{ property: "paddingTop", value },
|
|
164
|
-
{ property: "paddingBottom", value }
|
|
165
|
-
];
|
|
166
|
-
};
|
|
167
|
-
const p = (padding) => {
|
|
168
|
-
return [...px(padding), ...py(padding)];
|
|
169
|
-
};
|
|
170
|
-
const mx = (margin) => {
|
|
171
|
-
const key = `${margin}`;
|
|
172
|
-
const valueString = (0, import_tailwind_theme.theme)("margin")?.[key] ?? "0";
|
|
173
|
-
const value = (0, import_css_data.parseCssValue)("marginLeft", valueString);
|
|
174
|
-
return [
|
|
175
|
-
{ property: "marginLeft", value },
|
|
176
|
-
{ property: "marginRight", value }
|
|
177
|
-
];
|
|
178
|
-
};
|
|
179
|
-
const my = (margin) => {
|
|
180
|
-
const key = `${margin}`;
|
|
181
|
-
const valueString = (0, import_tailwind_theme.theme)("margin")[key];
|
|
182
|
-
const value = (0, import_css_data.parseCssValue)("marginTop", valueString);
|
|
183
|
-
return [
|
|
184
|
-
{ property: "marginTop", value },
|
|
185
|
-
{ property: "marginBottom", value }
|
|
186
|
-
];
|
|
187
|
-
};
|
|
188
|
-
const m = (margin) => {
|
|
189
|
-
return [...mx(margin), ...my(margin)];
|
|
190
|
-
};
|
|
191
|
-
const w = (spacing) => {
|
|
192
|
-
const key = `${spacing}`;
|
|
193
|
-
const valueString = (0, import_tailwind_theme.theme)("width")?.[key] ?? "0";
|
|
194
|
-
const value = (0, import_css_data.parseCssValue)("width", valueString);
|
|
195
|
-
return [{ property: "width", value }];
|
|
196
|
-
};
|
|
197
|
-
const h = (spacing) => {
|
|
198
|
-
const key = `${spacing}`;
|
|
199
|
-
const valueString = (0, import_tailwind_theme.theme)("height")?.[key] ?? "0";
|
|
200
|
-
const value = (0, import_css_data.parseCssValue)("height", valueString);
|
|
201
|
-
return [{ property: "height", value }];
|
|
202
|
-
};
|
|
203
|
-
const opacity = (opacity2) => {
|
|
204
|
-
const key = `${opacity2}`;
|
|
205
|
-
const valueString = (0, import_tailwind_theme.theme)("opacity")?.[key] ?? "0";
|
|
206
|
-
const value = (0, import_css_data.parseCssValue)("opacity", valueString);
|
|
207
|
-
return [
|
|
208
|
-
{
|
|
209
|
-
property: "opacity",
|
|
210
|
-
value
|
|
211
|
-
}
|
|
212
|
-
];
|
|
213
|
-
};
|
|
214
|
-
const maxW = (spacing) => {
|
|
215
|
-
const key = `${spacing}`;
|
|
216
|
-
const valueString = (0, import_tailwind_theme.theme)("maxWidth")?.[key] ?? "0";
|
|
217
|
-
const value = (0, import_css_data.parseCssValue)("width", valueString);
|
|
218
|
-
return [{ property: "maxWidth", value }];
|
|
219
|
-
};
|
|
220
|
-
const positionStyle = (property, spacing) => {
|
|
221
|
-
const key = `${spacing}`;
|
|
222
|
-
const valueString = (0, import_tailwind_theme.theme)("spacing")?.[key] ?? "0";
|
|
223
|
-
const value = (0, import_css_data.parseCssValue)(property, valueString);
|
|
224
|
-
return { property, value };
|
|
225
|
-
};
|
|
226
|
-
const top = (spacing) => [positionStyle("top", spacing)];
|
|
227
|
-
const right = (spacing) => [positionStyle("right", spacing)];
|
|
228
|
-
const bottom = (spacing) => [positionStyle("bottom", spacing)];
|
|
229
|
-
const left = (spacing) => [positionStyle("left", spacing)];
|
|
230
|
-
const inset = (spacing) => [
|
|
231
|
-
positionStyle("left", spacing),
|
|
232
|
-
positionStyle("right", spacing),
|
|
233
|
-
positionStyle("top", spacing),
|
|
234
|
-
positionStyle("bottom", spacing)
|
|
235
|
-
];
|
|
236
|
-
const backdropBlur = (blur) => {
|
|
237
|
-
const valueString = (0, import_tailwind_theme.theme)("blur")[blur];
|
|
238
|
-
const value = {
|
|
239
|
-
type: "unparsed",
|
|
240
|
-
value: `blur(${valueString})`
|
|
241
|
-
};
|
|
242
|
-
return [{ property: "backdropFilter", value }];
|
|
243
|
-
};
|
|
244
|
-
const bg = (color, alpha) => {
|
|
245
|
-
const value = (0, import_css_data.parseCssValue)("backgroundColor", (0, import_tailwind_theme.theme)("colors")[color]);
|
|
246
|
-
if (alpha !== void 0 && value.type === "rgb") {
|
|
247
|
-
value.alpha = alpha / 100;
|
|
248
|
-
}
|
|
249
|
-
return [
|
|
250
|
-
{
|
|
251
|
-
property: "backgroundColor",
|
|
252
|
-
value
|
|
253
|
-
}
|
|
254
|
-
];
|
|
255
|
-
};
|
|
256
|
-
const fixed = () => {
|
|
257
|
-
return [{ property: "position", value: { type: "keyword", value: "fixed" } }];
|
|
258
|
-
};
|
|
259
|
-
const relative = () => {
|
|
260
|
-
return [
|
|
261
|
-
{ property: "position", value: { type: "keyword", value: "relative" } }
|
|
262
|
-
];
|
|
263
|
-
};
|
|
264
|
-
const absolute = () => {
|
|
265
|
-
return [
|
|
266
|
-
{ property: "position", value: { type: "keyword", value: "absolute" } }
|
|
267
|
-
];
|
|
268
|
-
};
|
|
269
|
-
const grid = () => {
|
|
270
|
-
return [{ property: "display", value: { type: "keyword", value: "grid" } }];
|
|
271
|
-
};
|
|
272
|
-
const alignItems = {
|
|
273
|
-
start: "flex-start",
|
|
274
|
-
end: "flex-end",
|
|
275
|
-
center: "center",
|
|
276
|
-
baseline: "baseline",
|
|
277
|
-
stretch: "stretch"
|
|
278
|
-
};
|
|
279
|
-
const items = (alignItemsParam) => {
|
|
280
|
-
return [
|
|
281
|
-
{
|
|
282
|
-
property: "alignItems",
|
|
283
|
-
value: {
|
|
284
|
-
type: "keyword",
|
|
285
|
-
value: alignItems[alignItemsParam]
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
];
|
|
289
|
-
};
|
|
290
|
-
const justifyContent = {
|
|
291
|
-
start: "flex-start",
|
|
292
|
-
end: "flex-end",
|
|
293
|
-
center: "center",
|
|
294
|
-
between: "space-between",
|
|
295
|
-
around: "space-around",
|
|
296
|
-
evenly: "space-evenly",
|
|
297
|
-
stretch: "stretch"
|
|
298
|
-
};
|
|
299
|
-
const justify = (justifyContentParam) => {
|
|
300
|
-
return [
|
|
301
|
-
{
|
|
302
|
-
property: "justifyContent",
|
|
303
|
-
value: {
|
|
304
|
-
type: "keyword",
|
|
305
|
-
value: justifyContent[justifyContentParam]
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
];
|
|
309
|
-
};
|
|
310
|
-
const flexDirection = { row: "row", col: "column" };
|
|
311
|
-
const flex = (flexParam) => {
|
|
312
|
-
if (flexParam === void 0) {
|
|
313
|
-
return [{ property: "display", value: { type: "keyword", value: "flex" } }];
|
|
314
|
-
}
|
|
315
|
-
return [
|
|
316
|
-
{
|
|
317
|
-
property: "flexDirection",
|
|
318
|
-
value: {
|
|
319
|
-
type: "keyword",
|
|
320
|
-
value: flexDirection[flexParam]
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
];
|
|
324
|
-
};
|
|
325
|
-
const gap = (gapValue) => {
|
|
326
|
-
const key = `${gapValue}`;
|
|
327
|
-
const valueString = (0, import_tailwind_theme.theme)("spacing")?.[key] ?? "0";
|
|
328
|
-
const value = (0, import_css_data.parseCssValue)("rowGap", valueString);
|
|
329
|
-
return [
|
|
330
|
-
{ property: "rowGap", value },
|
|
331
|
-
{ property: "columnGap", value }
|
|
332
|
-
];
|
|
333
|
-
};
|
|
334
|
-
const leading = (lineHeight) => {
|
|
335
|
-
const key = `${lineHeight}`;
|
|
336
|
-
const valueString = (0, import_tailwind_theme.theme)("lineHeight")[key];
|
|
337
|
-
const value = (0, import_css_data.parseCssValue)("lineHeight", valueString);
|
|
338
|
-
return [{ property: "lineHeight", value }];
|
|
339
|
-
};
|
|
340
|
-
const tracking = (letterSpacing) => {
|
|
341
|
-
const key = `${letterSpacing}`;
|
|
342
|
-
const valueString = (0, import_tailwind_theme.theme)("letterSpacing")[key];
|
|
343
|
-
const value = (0, import_css_data.parseCssValue)("letterSpacing", valueString);
|
|
344
|
-
return [{ property: "letterSpacing", value }];
|
|
345
|
-
};
|
|
346
|
-
const outline = (value) => {
|
|
347
|
-
return [
|
|
348
|
-
{
|
|
349
|
-
property: "outlineWidth",
|
|
350
|
-
value: { type: "unit", value: 2, unit: "px" }
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
property: "outlineStyle",
|
|
354
|
-
value: { type: "keyword", value: "solid" }
|
|
355
|
-
},
|
|
356
|
-
{
|
|
357
|
-
property: "outlineColor",
|
|
358
|
-
value: { type: "keyword", value: "transparent" }
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
property: "outlineOffset",
|
|
362
|
-
value: { type: "unit", value: 2, unit: "px" }
|
|
363
|
-
}
|
|
364
|
-
];
|
|
365
|
-
};
|
|
366
|
-
const textSizes = [
|
|
367
|
-
"sm",
|
|
368
|
-
"base",
|
|
369
|
-
"lg",
|
|
370
|
-
"xs",
|
|
371
|
-
"xl",
|
|
372
|
-
"2xl",
|
|
373
|
-
"3xl",
|
|
374
|
-
"4xl",
|
|
375
|
-
"5xl",
|
|
376
|
-
"6xl",
|
|
377
|
-
"7xl",
|
|
378
|
-
"8xl",
|
|
379
|
-
"9xl"
|
|
380
|
-
];
|
|
381
|
-
const isTextSize = (value) => textSizes.includes(value);
|
|
382
|
-
const text = (sizeOrColor) => {
|
|
383
|
-
if (isTextSize(sizeOrColor)) {
|
|
384
|
-
const valueArr = (0, import_tailwind_theme.theme)("fontSize")[sizeOrColor];
|
|
385
|
-
const [fontSizeString, { lineHeight: lineHeightString }] = valueArr;
|
|
386
|
-
const fontSize = (0, import_css_data.parseCssValue)("fontSize", fontSizeString);
|
|
387
|
-
const lineHeight = (0, import_css_data.parseCssValue)("lineHeight", lineHeightString);
|
|
388
|
-
return [
|
|
389
|
-
{ property: "fontSize", value: fontSize },
|
|
390
|
-
{ property: "lineHeight", value: lineHeight }
|
|
391
|
-
];
|
|
392
|
-
}
|
|
393
|
-
const value = (0, import_css_data.parseCssValue)("color", (0, import_tailwind_theme.theme)("colors")[sizeOrColor]);
|
|
394
|
-
return [
|
|
395
|
-
{
|
|
396
|
-
property: "color",
|
|
397
|
-
value
|
|
398
|
-
}
|
|
399
|
-
];
|
|
400
|
-
};
|
|
401
|
-
const shadow = (shadowSize) => {
|
|
402
|
-
const valueString = (0, import_tailwind_theme.theme)("boxShadow")[shadowSize];
|
|
403
|
-
const value = (0, import_css_data.parseBoxShadow)(valueString);
|
|
404
|
-
return [
|
|
405
|
-
{
|
|
406
|
-
property: "boxShadow",
|
|
407
|
-
value
|
|
408
|
-
}
|
|
409
|
-
];
|
|
410
|
-
};
|
|
411
|
-
const ring = (ringColor, ringWidth, ringOffsetColor = "background", ringOffsetWidth = 0, inset2 = "") => {
|
|
412
|
-
const ringWidthUnits = (0, import_tailwind_theme.theme)("ringWidth")[ringWidth];
|
|
413
|
-
const ringOffsetWidthUnits = (0, import_tailwind_theme.theme)("ringOffsetWidth")[ringOffsetWidth];
|
|
414
|
-
const ringColorRgb = (0, import_tailwind_theme.theme)("colors")[ringColor];
|
|
415
|
-
const ringOffsetColorRgb = (0, import_tailwind_theme.theme)("colors")[ringOffsetColor];
|
|
416
|
-
const ringOffsetShadow = `${inset2} 0 0 0 ${ringOffsetWidthUnits} ${ringOffsetColorRgb}`;
|
|
417
|
-
const ringWidthParsed = parseFloat(ringWidthUnits);
|
|
418
|
-
const ringOffsetWidthParsed = parseFloat(ringOffsetWidthUnits);
|
|
419
|
-
const ringShadow = `${inset2} 0 0 0 ${ringWidthParsed + ringOffsetWidthParsed}px ${ringColorRgb}`;
|
|
420
|
-
const value = (0, import_css_data.parseBoxShadow)(`${ringOffsetShadow}, ${ringShadow}`);
|
|
421
|
-
return [
|
|
422
|
-
{
|
|
423
|
-
property: "boxShadow",
|
|
424
|
-
value
|
|
425
|
-
}
|
|
426
|
-
];
|
|
427
|
-
};
|
|
428
|
-
const hover = (value) => {
|
|
429
|
-
return value.map((decl) => ({
|
|
430
|
-
...decl,
|
|
431
|
-
state: ":hover"
|
|
432
|
-
}));
|
|
433
|
-
};
|
|
434
|
-
const focus = (value) => {
|
|
435
|
-
return value.map((decl) => ({
|
|
436
|
-
...decl,
|
|
437
|
-
state: ":focus"
|
|
438
|
-
}));
|
|
439
|
-
};
|
|
@@ -1,33 +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_colors_exports = {};
|
|
20
|
-
__export(tailwind_colors_exports, {
|
|
21
|
-
colors: () => colors
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(tailwind_colors_exports);
|
|
24
|
-
const colors = {
|
|
25
|
-
transparent: "transparent",
|
|
26
|
-
current: "currentColor",
|
|
27
|
-
popover: "rgb(255, 255, 255)",
|
|
28
|
-
popoverForeground: "rgb(2, 8, 23)",
|
|
29
|
-
border: "rgb(226, 232, 240)",
|
|
30
|
-
background: "rgb(255, 255, 255)",
|
|
31
|
-
ring: "rgb(148, 163, 184)",
|
|
32
|
-
mutedForeground: "rgb(100, 116, 139)"
|
|
33
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var tailwind_theme_exports = {};
|
|
30
|
-
__export(tailwind_theme_exports, {
|
|
31
|
-
theme: () => theme
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(tailwind_theme_exports);
|
|
34
|
-
var import_defaultTheme = __toESM(require("tailwindcss/defaultTheme"), 1);
|
|
35
|
-
var import_tailwind_colors = require("./tailwind-colors");
|
|
36
|
-
const localTheme = { ...import_defaultTheme.default };
|
|
37
|
-
const theme = (name) => {
|
|
38
|
-
const value = localTheme?.[name];
|
|
39
|
-
if (typeof value === "function") {
|
|
40
|
-
return value({ theme, colors: import_tailwind_colors.colors, breakpoints: () => ({}) });
|
|
41
|
-
}
|
|
42
|
-
return value;
|
|
43
|
-
};
|
|
44
|
-
localTheme.colors = import_tailwind_colors.colors;
|
|
45
|
-
localTheme.borderRadius = { ...theme("borderRadius") };
|
|
46
|
-
localTheme.borderRadius.DEFAULT = "0.5rem";
|
package/lib/radix-dialog.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
-
import {
|
|
4
|
-
splitPropsWithWebstudioAttributes
|
|
5
|
-
} from "@webstudio-is/react-sdk";
|
|
6
|
-
import {
|
|
7
|
-
forwardRef,
|
|
8
|
-
Children
|
|
9
|
-
} from "react";
|
|
10
|
-
const DisplayContentsStyle = { display: "contents" };
|
|
11
|
-
const Dialog = forwardRef(({ open: openProp, isOpen, ...props }, ref) => {
|
|
12
|
-
const [webstudioAttributes, restProps] = splitPropsWithWebstudioAttributes(props);
|
|
13
|
-
const open = openProp ?? (isOpen === "open" ? true : isOpen === "closed" ? false : void 0);
|
|
14
|
-
return /* @__PURE__ */ jsx("div", { ref, style: DisplayContentsStyle, ...webstudioAttributes, children: /* @__PURE__ */ jsx(DialogPrimitive.Root, { open, ...restProps }) });
|
|
15
|
-
});
|
|
16
|
-
const DialogTrigger = forwardRef(({ children, ...props }, ref) => {
|
|
17
|
-
const firstChild = Children.toArray(children)[0];
|
|
18
|
-
const [webstudioAttributes, restProps] = splitPropsWithWebstudioAttributes(props);
|
|
19
|
-
return /* @__PURE__ */ jsx("div", { ref, style: DisplayContentsStyle, ...webstudioAttributes, children: /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { asChild: true, ...restProps, children: firstChild ?? /* @__PURE__ */ jsx("button", { children: "Add button or link" }) }) });
|
|
20
|
-
});
|
|
21
|
-
const DialogOverlay = forwardRef((props, ref) => {
|
|
22
|
-
return /* @__PURE__ */ jsx(DialogPrimitive.DialogPortal, { children: /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { ref, ...props }) });
|
|
23
|
-
});
|
|
24
|
-
const DialogContent = DialogPrimitive.Content;
|
|
25
|
-
const DialogClose = DialogPrimitive.Close;
|
|
26
|
-
const DialogTitle = DialogPrimitive.Title;
|
|
27
|
-
const DialogDescription = DialogPrimitive.Description;
|
|
28
|
-
export {
|
|
29
|
-
Dialog,
|
|
30
|
-
DialogClose,
|
|
31
|
-
DialogContent,
|
|
32
|
-
DialogDescription,
|
|
33
|
-
DialogOverlay,
|
|
34
|
-
DialogTitle,
|
|
35
|
-
DialogTrigger
|
|
36
|
-
};
|