@webstudio-is/sdk-components-react 0.82.0 → 0.83.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/LICENSE +661 -21
- package/lib/__generated__/blockquote.props.js +30 -5
- package/lib/__generated__/body.props.js +30 -5
- package/lib/__generated__/bold.props.js +30 -5
- package/lib/__generated__/box.props.js +30 -5
- package/lib/__generated__/button.props.js +30 -5
- package/lib/__generated__/checkbox.props.js +31 -6
- package/lib/__generated__/code-text.props.js +30 -5
- package/lib/__generated__/form.props.js +30 -5
- package/lib/__generated__/heading.props.js +30 -5
- package/lib/__generated__/image.props.js +30 -5
- package/lib/__generated__/input.props.js +30 -5
- package/lib/__generated__/italic.props.js +30 -5
- package/lib/__generated__/label.props.js +30 -5
- package/lib/__generated__/link.props.js +30 -5
- package/lib/__generated__/list-item.props.js +30 -5
- package/lib/__generated__/list.props.js +30 -5
- package/lib/__generated__/paragraph.props.js +30 -5
- package/lib/__generated__/radio-button.props.js +31 -6
- package/lib/__generated__/radix-dialog.props.js +2120 -0
- package/lib/__generated__/radix-popover.props.js +463 -0
- package/lib/__generated__/radix-tooltip.props.js +473 -0
- package/lib/__generated__/rich-text-link.props.js +30 -5
- package/lib/__generated__/separator.props.js +30 -5
- package/lib/__generated__/span.props.js +30 -5
- package/lib/__generated__/subscript.props.js +30 -5
- package/lib/__generated__/superscript.props.js +30 -5
- package/lib/__generated__/text.props.js +30 -5
- package/lib/__generated__/textarea.props.js +30 -5
- package/lib/__generated__/vimeo-play-button.props.js +30 -5
- package/lib/__generated__/vimeo-preview-image.props.js +30 -5
- package/lib/__generated__/vimeo-spinner.props.js +30 -5
- package/lib/__generated__/vimeo.props.js +30 -5
- package/lib/body.ws.js +11 -1
- package/lib/cjs/__generated__/blockquote.props.js +30 -5
- package/lib/cjs/__generated__/body.props.js +30 -5
- package/lib/cjs/__generated__/bold.props.js +30 -5
- package/lib/cjs/__generated__/box.props.js +30 -5
- package/lib/cjs/__generated__/button.props.js +30 -5
- package/lib/cjs/__generated__/checkbox.props.js +31 -6
- package/lib/cjs/__generated__/code-text.props.js +30 -5
- package/lib/cjs/__generated__/form.props.js +30 -5
- package/lib/cjs/__generated__/heading.props.js +30 -5
- package/lib/cjs/__generated__/image.props.js +30 -5
- package/lib/cjs/__generated__/input.props.js +30 -5
- package/lib/cjs/__generated__/italic.props.js +30 -5
- package/lib/cjs/__generated__/label.props.js +30 -5
- package/lib/cjs/__generated__/link.props.js +30 -5
- package/lib/cjs/__generated__/list-item.props.js +30 -5
- package/lib/cjs/__generated__/list.props.js +30 -5
- package/lib/cjs/__generated__/paragraph.props.js +30 -5
- package/lib/cjs/__generated__/radio-button.props.js +31 -6
- package/lib/cjs/__generated__/radix-dialog.props.js +2140 -0
- package/lib/cjs/__generated__/radix-popover.props.js +483 -0
- package/lib/cjs/__generated__/radix-tooltip.props.js +493 -0
- package/lib/cjs/__generated__/rich-text-link.props.js +30 -5
- package/lib/cjs/__generated__/separator.props.js +30 -5
- package/lib/cjs/__generated__/span.props.js +30 -5
- package/lib/cjs/__generated__/subscript.props.js +30 -5
- package/lib/cjs/__generated__/superscript.props.js +30 -5
- package/lib/cjs/__generated__/text.props.js +30 -5
- package/lib/cjs/__generated__/textarea.props.js +30 -5
- package/lib/cjs/__generated__/vimeo-play-button.props.js +30 -5
- package/lib/cjs/__generated__/vimeo-preview-image.props.js +30 -5
- package/lib/cjs/__generated__/vimeo-spinner.props.js +30 -5
- package/lib/cjs/__generated__/vimeo.props.js +30 -5
- package/lib/cjs/body.ws.js +11 -1
- package/lib/cjs/components.js +16 -0
- package/lib/cjs/label.ws.js +1 -1
- package/lib/cjs/metas.js +16 -0
- package/lib/cjs/props.js +16 -0
- package/lib/cjs/radix-dialog.js +61 -0
- package/lib/cjs/radix-dialog.ws.js +300 -0
- package/lib/cjs/radix-popover.js +59 -0
- package/lib/cjs/radix-popover.ws.js +139 -0
- package/lib/cjs/radix-tooltip.js +51 -0
- package/lib/cjs/radix-tooltip.ws.js +140 -0
- package/lib/cjs/theme/radix-common-types.js +16 -0
- package/lib/cjs/theme/tailwind-classes.js +439 -0
- package/lib/cjs/theme/tailwind-colors.js +33 -0
- package/lib/cjs/theme/tailwind-theme.js +46 -0
- package/lib/cjs/vimeo-play-button.ws.js +1 -0
- package/lib/cjs/vimeo-preview-image.ws.js +1 -0
- package/lib/cjs/vimeo.ws.js +1 -0
- package/lib/components.js +24 -0
- package/lib/label.ws.js +2 -2
- package/lib/metas.js +32 -0
- package/lib/props.js +32 -0
- package/lib/radix-dialog.js +36 -0
- package/lib/radix-dialog.ws.js +279 -0
- package/lib/radix-popover.js +34 -0
- package/lib/radix-popover.ws.js +114 -0
- package/lib/radix-tooltip.js +26 -0
- package/lib/radix-tooltip.ws.js +115 -0
- package/lib/theme/radix-common-types.js +0 -0
- package/lib/theme/tailwind-classes.js +419 -0
- package/lib/theme/tailwind-colors.js +13 -0
- package/lib/theme/tailwind-theme.js +16 -0
- package/lib/types/__generated__/radix-dialog.props.d.ts +8 -0
- package/lib/types/__generated__/radix-popover.props.d.ts +4 -0
- package/lib/types/__generated__/radix-tooltip.props.d.ts +4 -0
- package/lib/types/components.d.ts +3 -0
- package/lib/types/metas.d.ts +3 -0
- package/lib/types/props.d.ts +3 -0
- package/lib/types/radix-dialog.d.ts +26 -0
- package/lib/types/radix-dialog.ws.d.ts +23 -0
- package/lib/types/radix-popover.d.ts +22 -0
- package/lib/types/radix-popover.ws.d.ts +15 -0
- package/lib/types/radix-tooltip.d.ts +22 -0
- package/lib/types/radix-tooltip.ws.d.ts +15 -0
- package/lib/types/theme/radix-common-types.d.ts +84 -0
- package/lib/types/theme/tailwind-classes.d.ts +69 -0
- package/lib/types/theme/tailwind-colors.d.ts +19 -0
- package/lib/types/theme/tailwind-theme.d.ts +72 -0
- package/lib/types/vimeo-preview-image.d.ts +6 -1
- package/lib/vimeo-play-button.ws.js +1 -0
- package/lib/vimeo-preview-image.js +1 -1
- package/lib/vimeo-preview-image.ws.js +2 -0
- package/lib/vimeo.ws.js +1 -0
- package/package.json +18 -13
- package/src/LICENSE +661 -21
- package/src/__generated__/blockquote.props.ts +34 -5
- package/src/__generated__/body.props.ts +34 -5
- package/src/__generated__/bold.props.ts +34 -5
- package/src/__generated__/box.props.ts +34 -5
- package/src/__generated__/button.props.ts +34 -5
- package/src/__generated__/checkbox.props.ts +35 -6
- package/src/__generated__/code-text.props.ts +34 -5
- package/src/__generated__/form.props.ts +34 -5
- package/src/__generated__/heading.props.ts +34 -5
- package/src/__generated__/image.props.ts +34 -5
- package/src/__generated__/input.props.ts +34 -5
- package/src/__generated__/italic.props.ts +34 -5
- package/src/__generated__/label.props.ts +34 -5
- package/src/__generated__/link.props.ts +34 -5
- package/src/__generated__/list-item.props.ts +34 -5
- package/src/__generated__/list.props.ts +34 -5
- package/src/__generated__/paragraph.props.ts +34 -5
- package/src/__generated__/radio-button.props.ts +35 -6
- package/src/__generated__/radix-dialog.props.ts +2363 -0
- package/src/__generated__/radix-popover.props.ts +510 -0
- package/src/__generated__/radix-tooltip.props.ts +521 -0
- package/src/__generated__/rich-text-link.props.ts +34 -5
- package/src/__generated__/separator.props.ts +34 -5
- package/src/__generated__/span.props.ts +34 -5
- package/src/__generated__/subscript.props.ts +34 -5
- package/src/__generated__/superscript.props.ts +34 -5
- package/src/__generated__/text.props.ts +34 -5
- package/src/__generated__/textarea.props.ts +34 -5
- package/src/__generated__/vimeo-play-button.props.ts +34 -5
- package/src/__generated__/vimeo-preview-image.props.ts +34 -5
- package/src/__generated__/vimeo-spinner.props.ts +34 -5
- package/src/__generated__/vimeo.props.ts +34 -5
- package/src/body.ws.tsx +11 -1
- package/src/components.ts +11 -0
- package/src/label.ws.tsx +2 -2
- package/src/metas.ts +21 -0
- package/src/props.ts +19 -0
- package/src/radix-dialog.tsx +91 -0
- package/src/radix-dialog.ws.tsx +291 -0
- package/src/radix-popover.tsx +89 -0
- package/src/radix-popover.ws.tsx +124 -0
- package/src/radix-tooltip.tsx +84 -0
- package/src/radix-tooltip.ws.tsx +125 -0
- package/src/theme/radix-common-types.ts +495 -0
- package/src/theme/tailwind-classes.ts +570 -0
- package/src/theme/tailwind-colors.ts +47 -0
- package/src/theme/tailwind-theme.ts +24 -0
|
@@ -0,0 +1,439 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
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";
|
|
@@ -26,6 +26,7 @@ var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
|
26
26
|
var import_vimeo_play_button = require("./__generated__/vimeo-play-button.props");
|
|
27
27
|
var import_svg = require("@webstudio-is/icons/svg");
|
|
28
28
|
var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
|
|
29
|
+
var import_vimeo_play_button2 = require("./vimeo-play-button");
|
|
29
30
|
const presetStyle = {
|
|
30
31
|
button: import_css_normalize.button
|
|
31
32
|
};
|
|
@@ -22,6 +22,7 @@ __export(vimeo_preview_image_ws_exports, {
|
|
|
22
22
|
propsMeta: () => propsMeta
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(vimeo_preview_image_ws_exports);
|
|
25
|
+
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
25
26
|
var import_image = require("./image.ws");
|
|
26
27
|
var import_vimeo_preview_image = require("./__generated__/vimeo-preview-image.props");
|
|
27
28
|
const meta = {
|
package/lib/cjs/vimeo.ws.js
CHANGED
|
@@ -26,6 +26,7 @@ var import_svg = require("@webstudio-is/icons/svg");
|
|
|
26
26
|
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
27
27
|
var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
|
|
28
28
|
var import_vimeo = require("./__generated__/vimeo.props");
|
|
29
|
+
var import_vimeo2 = require("./vimeo");
|
|
29
30
|
const presetStyle = {
|
|
30
31
|
div: import_css_normalize.div
|
|
31
32
|
};
|
package/lib/components.js
CHANGED
|
@@ -30,6 +30,17 @@ import { Vimeo } from "./vimeo";
|
|
|
30
30
|
import { VimeoPreviewImage } from "./vimeo-preview-image";
|
|
31
31
|
import { VimeoPlayButton } from "./vimeo-play-button";
|
|
32
32
|
import { VimeoSpinner } from "./vimeo-spinner";
|
|
33
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "./radix-tooltip";
|
|
34
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./radix-popover";
|
|
35
|
+
import {
|
|
36
|
+
Dialog,
|
|
37
|
+
DialogContent,
|
|
38
|
+
DialogTrigger,
|
|
39
|
+
DialogOverlay,
|
|
40
|
+
DialogClose,
|
|
41
|
+
DialogDescription,
|
|
42
|
+
DialogTitle
|
|
43
|
+
} from "./radix-dialog";
|
|
33
44
|
export {
|
|
34
45
|
Blockquote,
|
|
35
46
|
Body,
|
|
@@ -38,6 +49,13 @@ export {
|
|
|
38
49
|
Button,
|
|
39
50
|
Checkbox,
|
|
40
51
|
CodeText,
|
|
52
|
+
Dialog,
|
|
53
|
+
DialogClose,
|
|
54
|
+
DialogContent,
|
|
55
|
+
DialogDescription,
|
|
56
|
+
DialogOverlay,
|
|
57
|
+
DialogTitle,
|
|
58
|
+
DialogTrigger,
|
|
41
59
|
Form,
|
|
42
60
|
Fragment,
|
|
43
61
|
Heading,
|
|
@@ -50,6 +68,9 @@ export {
|
|
|
50
68
|
List,
|
|
51
69
|
ListItem,
|
|
52
70
|
Paragraph,
|
|
71
|
+
Popover,
|
|
72
|
+
PopoverContent,
|
|
73
|
+
PopoverTrigger,
|
|
53
74
|
RadioButton,
|
|
54
75
|
RichTextLink,
|
|
55
76
|
Separator,
|
|
@@ -59,6 +80,9 @@ export {
|
|
|
59
80
|
Superscript,
|
|
60
81
|
Text,
|
|
61
82
|
Textarea,
|
|
83
|
+
Tooltip,
|
|
84
|
+
TooltipContent,
|
|
85
|
+
TooltipTrigger,
|
|
62
86
|
Vimeo,
|
|
63
87
|
VimeoPlayButton,
|
|
64
88
|
VimeoPreviewImage,
|
package/lib/label.ws.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LabelIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import {
|
|
3
3
|
defaultStates
|
|
4
4
|
} from "@webstudio-is/react-sdk";
|
|
@@ -15,7 +15,7 @@ const meta = {
|
|
|
15
15
|
invalidAncestors: ["Button"],
|
|
16
16
|
type: "container",
|
|
17
17
|
label: "Input Label",
|
|
18
|
-
icon:
|
|
18
|
+
icon: LabelIcon,
|
|
19
19
|
states: defaultStates,
|
|
20
20
|
presetStyle,
|
|
21
21
|
order: 2,
|
package/lib/metas.js
CHANGED
|
@@ -30,6 +30,25 @@ import { meta as meta29 } from "./vimeo.ws";
|
|
|
30
30
|
import { meta as meta30 } from "./vimeo-preview-image.ws";
|
|
31
31
|
import { meta as meta31 } from "./vimeo-play-button.ws";
|
|
32
32
|
import { meta as meta32 } from "./vimeo-spinner.ws";
|
|
33
|
+
import {
|
|
34
|
+
metaTooltip,
|
|
35
|
+
metaTooltipContent,
|
|
36
|
+
metaTooltipTrigger
|
|
37
|
+
} from "./radix-tooltip.ws";
|
|
38
|
+
import {
|
|
39
|
+
metaPopover,
|
|
40
|
+
metaPopoverContent,
|
|
41
|
+
metaPopoverTrigger
|
|
42
|
+
} from "./radix-popover.ws";
|
|
43
|
+
import {
|
|
44
|
+
metaDialog,
|
|
45
|
+
metaDialogContent,
|
|
46
|
+
metaDialogTrigger,
|
|
47
|
+
metaDialogOverlay,
|
|
48
|
+
metaDialogClose,
|
|
49
|
+
metaDialogDescription,
|
|
50
|
+
metaDialogTitle
|
|
51
|
+
} from "./radix-dialog.ws";
|
|
33
52
|
export {
|
|
34
53
|
meta20 as Blockquote,
|
|
35
54
|
meta4 as Body,
|
|
@@ -38,6 +57,13 @@ export {
|
|
|
38
57
|
meta16 as Button,
|
|
39
58
|
meta28 as Checkbox,
|
|
40
59
|
meta24 as CodeText,
|
|
60
|
+
metaDialog as Dialog,
|
|
61
|
+
metaDialogClose as DialogClose,
|
|
62
|
+
metaDialogContent as DialogContent,
|
|
63
|
+
metaDialogDescription as DialogDescription,
|
|
64
|
+
metaDialogOverlay as DialogOverlay,
|
|
65
|
+
metaDialogTitle as DialogTitle,
|
|
66
|
+
metaDialogTrigger as DialogTrigger,
|
|
41
67
|
meta18 as Form,
|
|
42
68
|
meta2 as Fragment,
|
|
43
69
|
meta7 as Heading,
|
|
@@ -50,6 +76,9 @@ export {
|
|
|
50
76
|
meta21 as List,
|
|
51
77
|
meta22 as ListItem,
|
|
52
78
|
meta8 as Paragraph,
|
|
79
|
+
metaPopover as Popover,
|
|
80
|
+
metaPopoverContent as PopoverContent,
|
|
81
|
+
metaPopoverTrigger as PopoverTrigger,
|
|
53
82
|
meta27 as RadioButton,
|
|
54
83
|
meta10 as RichTextLink,
|
|
55
84
|
meta23 as Separator,
|
|
@@ -59,6 +88,9 @@ export {
|
|
|
59
88
|
meta14 as Superscript,
|
|
60
89
|
meta6 as Text,
|
|
61
90
|
meta26 as Textarea,
|
|
91
|
+
metaTooltip as Tooltip,
|
|
92
|
+
metaTooltipContent as TooltipContent,
|
|
93
|
+
metaTooltipTrigger as TooltipTrigger,
|
|
62
94
|
meta29 as Vimeo,
|
|
63
95
|
meta31 as VimeoPlayButton,
|
|
64
96
|
meta30 as VimeoPreviewImage,
|