@webstudio-is/sdk-components-react 0.83.0 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,300 +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 radix_dialog_ws_exports = {};
|
|
30
|
-
__export(radix_dialog_ws_exports, {
|
|
31
|
-
metaDialog: () => metaDialog,
|
|
32
|
-
metaDialogClose: () => metaDialogClose,
|
|
33
|
-
metaDialogContent: () => metaDialogContent,
|
|
34
|
-
metaDialogDescription: () => metaDialogDescription,
|
|
35
|
-
metaDialogOverlay: () => metaDialogOverlay,
|
|
36
|
-
metaDialogTitle: () => metaDialogTitle,
|
|
37
|
-
metaDialogTrigger: () => metaDialogTrigger,
|
|
38
|
-
propsMetaDialog: () => propsMetaDialog,
|
|
39
|
-
propsMetaDialogClose: () => propsMetaDialogClose,
|
|
40
|
-
propsMetaDialogContent: () => propsMetaDialogContent,
|
|
41
|
-
propsMetaDialogDescription: () => propsMetaDialogDescription,
|
|
42
|
-
propsMetaDialogOverlay: () => propsMetaDialogOverlay,
|
|
43
|
-
propsMetaDialogTitle: () => propsMetaDialogTitle,
|
|
44
|
-
propsMetaDialogTrigger: () => propsMetaDialogTrigger
|
|
45
|
-
});
|
|
46
|
-
module.exports = __toCommonJS(radix_dialog_ws_exports);
|
|
47
|
-
var import_svg = require("@webstudio-is/icons/svg");
|
|
48
|
-
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
49
|
-
var tc = __toESM(require("./theme/tailwind-classes"), 1);
|
|
50
|
-
var import_radix_dialog = require("./__generated__/radix-dialog.props");
|
|
51
|
-
const metaDialogTrigger = {
|
|
52
|
-
category: "hidden",
|
|
53
|
-
invalidAncestors: [],
|
|
54
|
-
type: "container",
|
|
55
|
-
label: "DialogTrigger",
|
|
56
|
-
icon: import_svg.RadioCheckedIcon,
|
|
57
|
-
stylable: false,
|
|
58
|
-
detachable: false
|
|
59
|
-
};
|
|
60
|
-
const metaDialogContent = {
|
|
61
|
-
category: "hidden",
|
|
62
|
-
invalidAncestors: [],
|
|
63
|
-
type: "container",
|
|
64
|
-
label: "DialogContent",
|
|
65
|
-
icon: import_svg.RadioCheckedIcon,
|
|
66
|
-
detachable: false
|
|
67
|
-
};
|
|
68
|
-
const metaDialogOverlay = {
|
|
69
|
-
category: "hidden",
|
|
70
|
-
invalidAncestors: [],
|
|
71
|
-
type: "container",
|
|
72
|
-
label: "DialogOverlay",
|
|
73
|
-
icon: import_svg.RadioCheckedIcon,
|
|
74
|
-
detachable: false
|
|
75
|
-
};
|
|
76
|
-
const metaDialogTitle = {
|
|
77
|
-
category: "hidden",
|
|
78
|
-
invalidAncestors: [],
|
|
79
|
-
type: "container",
|
|
80
|
-
label: "DialogTitle",
|
|
81
|
-
icon: import_svg.RadioCheckedIcon
|
|
82
|
-
};
|
|
83
|
-
const metaDialogDescription = {
|
|
84
|
-
category: "hidden",
|
|
85
|
-
invalidAncestors: [],
|
|
86
|
-
type: "container",
|
|
87
|
-
label: "DialogDescription",
|
|
88
|
-
icon: import_svg.RadioCheckedIcon
|
|
89
|
-
};
|
|
90
|
-
const metaDialogClose = {
|
|
91
|
-
category: "hidden",
|
|
92
|
-
invalidAncestors: [],
|
|
93
|
-
type: "container",
|
|
94
|
-
label: "DialogClose",
|
|
95
|
-
icon: import_svg.RadioCheckedIcon
|
|
96
|
-
};
|
|
97
|
-
const metaDialog = {
|
|
98
|
-
category: "radix",
|
|
99
|
-
invalidAncestors: [],
|
|
100
|
-
type: "container",
|
|
101
|
-
label: "Dialog",
|
|
102
|
-
icon: import_svg.RadioCheckedIcon,
|
|
103
|
-
order: 15,
|
|
104
|
-
stylable: false,
|
|
105
|
-
template: [
|
|
106
|
-
{
|
|
107
|
-
type: "instance",
|
|
108
|
-
component: "Dialog",
|
|
109
|
-
label: "Dialog",
|
|
110
|
-
props: [
|
|
111
|
-
{
|
|
112
|
-
name: "isOpen",
|
|
113
|
-
// We don't have support for boolean or undefined, instead of binding on open we bind on a string
|
|
114
|
-
type: "string",
|
|
115
|
-
value: "initial",
|
|
116
|
-
dataSourceRef: {
|
|
117
|
-
type: "variable",
|
|
118
|
-
name: "isOpen"
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
],
|
|
122
|
-
children: [
|
|
123
|
-
{
|
|
124
|
-
type: "instance",
|
|
125
|
-
component: "DialogTrigger",
|
|
126
|
-
props: [],
|
|
127
|
-
children: [
|
|
128
|
-
{
|
|
129
|
-
type: "instance",
|
|
130
|
-
component: "Button",
|
|
131
|
-
children: [{ type: "text", value: "Button" }]
|
|
132
|
-
}
|
|
133
|
-
]
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
type: "instance",
|
|
137
|
-
component: "DialogOverlay",
|
|
138
|
-
label: "Dialog Overlay",
|
|
139
|
-
props: [],
|
|
140
|
-
/**
|
|
141
|
-
* fixed inset-0 z-50 bg-background/80 backdrop-blur-sm
|
|
142
|
-
* flex
|
|
143
|
-
**/
|
|
144
|
-
styles: [
|
|
145
|
-
tc.fixed(),
|
|
146
|
-
tc.inset(0),
|
|
147
|
-
tc.z(50),
|
|
148
|
-
tc.bg("background", 80),
|
|
149
|
-
tc.backdropBlur("sm"),
|
|
150
|
-
// To allow positioning Content
|
|
151
|
-
tc.flex()
|
|
152
|
-
].flat(),
|
|
153
|
-
children: [
|
|
154
|
-
{
|
|
155
|
-
type: "instance",
|
|
156
|
-
component: "DialogContent",
|
|
157
|
-
label: "Dialog Content",
|
|
158
|
-
props: [],
|
|
159
|
-
/**
|
|
160
|
-
* fixed w-full z-50
|
|
161
|
-
* grid gap-4 max-w-lg
|
|
162
|
-
* m-auto
|
|
163
|
-
* border bg-background p-6 shadow-lg
|
|
164
|
-
**/
|
|
165
|
-
styles: [
|
|
166
|
-
tc.w("full"),
|
|
167
|
-
tc.z(50),
|
|
168
|
-
tc.flex(),
|
|
169
|
-
tc.flex("col"),
|
|
170
|
-
tc.gap(4),
|
|
171
|
-
tc.m("auto"),
|
|
172
|
-
tc.maxW("lg"),
|
|
173
|
-
tc.border(),
|
|
174
|
-
tc.bg("background"),
|
|
175
|
-
tc.p(6),
|
|
176
|
-
tc.shadow("lg"),
|
|
177
|
-
tc.relative()
|
|
178
|
-
].flat(),
|
|
179
|
-
children: [
|
|
180
|
-
{
|
|
181
|
-
type: "instance",
|
|
182
|
-
component: "Box",
|
|
183
|
-
label: "Dialog Header",
|
|
184
|
-
props: [],
|
|
185
|
-
styles: [tc.flex(), tc.flex("col"), tc.gap(1)].flat(),
|
|
186
|
-
children: [
|
|
187
|
-
{
|
|
188
|
-
type: "instance",
|
|
189
|
-
component: "DialogTitle",
|
|
190
|
-
label: "Dialog Title",
|
|
191
|
-
props: [],
|
|
192
|
-
/**
|
|
193
|
-
* text-lg leading-none tracking-tight
|
|
194
|
-
**/
|
|
195
|
-
styles: [
|
|
196
|
-
tc.my(0),
|
|
197
|
-
tc.leading("none"),
|
|
198
|
-
tc.text("lg"),
|
|
199
|
-
tc.tracking("tight")
|
|
200
|
-
].flat(),
|
|
201
|
-
children: [
|
|
202
|
-
{
|
|
203
|
-
type: "text",
|
|
204
|
-
value: "Dialog Title"
|
|
205
|
-
}
|
|
206
|
-
]
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
type: "instance",
|
|
210
|
-
component: "DialogDescription",
|
|
211
|
-
label: "Dialog Description",
|
|
212
|
-
props: [],
|
|
213
|
-
/**
|
|
214
|
-
* text-sm text-muted-foreground
|
|
215
|
-
**/
|
|
216
|
-
styles: [
|
|
217
|
-
tc.my(0),
|
|
218
|
-
tc.text("sm"),
|
|
219
|
-
tc.text("mutedForeground")
|
|
220
|
-
].flat(),
|
|
221
|
-
children: [
|
|
222
|
-
{
|
|
223
|
-
type: "text",
|
|
224
|
-
value: "dialog description text you can edit"
|
|
225
|
-
}
|
|
226
|
-
]
|
|
227
|
-
}
|
|
228
|
-
]
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
type: "instance",
|
|
232
|
-
component: "Text",
|
|
233
|
-
children: [{ type: "text", value: "The text you can edit" }]
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
type: "instance",
|
|
237
|
-
component: "DialogClose",
|
|
238
|
-
label: "Dialog Close",
|
|
239
|
-
props: [],
|
|
240
|
-
/**
|
|
241
|
-
* absolute right-4 top-4
|
|
242
|
-
* rounded-sm opacity-70
|
|
243
|
-
* ring-offset-background
|
|
244
|
-
* hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
|
|
245
|
-
* flex items-center justify-center h-4 w-4
|
|
246
|
-
**/
|
|
247
|
-
styles: [
|
|
248
|
-
tc.absolute(),
|
|
249
|
-
tc.right(4),
|
|
250
|
-
tc.top(4),
|
|
251
|
-
tc.rounded("sm"),
|
|
252
|
-
tc.opacity(70),
|
|
253
|
-
tc.flex(),
|
|
254
|
-
tc.items("center"),
|
|
255
|
-
tc.justify("center"),
|
|
256
|
-
tc.h(4),
|
|
257
|
-
tc.w(4),
|
|
258
|
-
tc.border(0),
|
|
259
|
-
tc.bg("transparent"),
|
|
260
|
-
tc.outline("none"),
|
|
261
|
-
tc.hover(tc.opacity(100)),
|
|
262
|
-
tc.focus(tc.ring("ring", 2, "background", 2))
|
|
263
|
-
].flat(),
|
|
264
|
-
children: [{ type: "text", value: "\u2715" }]
|
|
265
|
-
}
|
|
266
|
-
]
|
|
267
|
-
}
|
|
268
|
-
]
|
|
269
|
-
}
|
|
270
|
-
]
|
|
271
|
-
}
|
|
272
|
-
]
|
|
273
|
-
};
|
|
274
|
-
const propsMetaDialog = {
|
|
275
|
-
props: import_radix_dialog.propsDialog,
|
|
276
|
-
initialProps: ["isOpen", "modal"]
|
|
277
|
-
};
|
|
278
|
-
const propsMetaDialogTrigger = {
|
|
279
|
-
props: import_radix_dialog.propsDialogTrigger
|
|
280
|
-
};
|
|
281
|
-
const propsMetaDialogContent = {
|
|
282
|
-
props: import_radix_dialog.propsDialogContent,
|
|
283
|
-
initialProps: []
|
|
284
|
-
};
|
|
285
|
-
const propsMetaDialogOverlay = {
|
|
286
|
-
props: import_radix_dialog.propsDialogOverlay,
|
|
287
|
-
initialProps: []
|
|
288
|
-
};
|
|
289
|
-
const propsMetaDialogClose = {
|
|
290
|
-
props: import_radix_dialog.propsDialogClose,
|
|
291
|
-
initialProps: []
|
|
292
|
-
};
|
|
293
|
-
const propsMetaDialogTitle = {
|
|
294
|
-
props: import_radix_dialog.propsDialogTitle,
|
|
295
|
-
initialProps: []
|
|
296
|
-
};
|
|
297
|
-
const propsMetaDialogDescription = {
|
|
298
|
-
props: import_radix_dialog.propsDialogDescription,
|
|
299
|
-
initialProps: []
|
|
300
|
-
};
|
package/lib/cjs/radix-popover.js
DELETED
|
@@ -1,59 +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 radix_popover_exports = {};
|
|
30
|
-
__export(radix_popover_exports, {
|
|
31
|
-
Popover: () => Popover,
|
|
32
|
-
PopoverContent: () => PopoverContent,
|
|
33
|
-
PopoverTrigger: () => PopoverTrigger
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(radix_popover_exports);
|
|
36
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
-
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
|
|
38
|
-
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
39
|
-
var import_react = require("react");
|
|
40
|
-
const DisplayContentsStyle = { display: "contents" };
|
|
41
|
-
const Popover = (0, import_react.forwardRef)(({ open: openProp, isOpen, ...props }, ref) => {
|
|
42
|
-
const [webstudioAttributes, restProps] = (0, import_react_sdk.splitPropsWithWebstudioAttributes)(props);
|
|
43
|
-
const open = openProp ?? (isOpen === "open" ? true : isOpen === "closed" ? false : void 0);
|
|
44
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, style: DisplayContentsStyle, ...webstudioAttributes, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Root, { open, ...restProps }) });
|
|
45
|
-
});
|
|
46
|
-
const PopoverTrigger = (0, import_react.forwardRef)(({ children, ...props }, ref) => {
|
|
47
|
-
const firstChild = import_react.Children.toArray(children)[0];
|
|
48
|
-
const [webstudioAttributes, restProps] = (0, import_react_sdk.splitPropsWithWebstudioAttributes)(props);
|
|
49
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, style: DisplayContentsStyle, ...webstudioAttributes, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Trigger, { asChild: true, ...restProps, children: firstChild ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { children: "Add button or link" }) }) });
|
|
50
|
-
});
|
|
51
|
-
const PopoverContent = (0, import_react.forwardRef)(({ sideOffset = 4, align = "center", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
-
PopoverPrimitive.Content,
|
|
53
|
-
{
|
|
54
|
-
ref,
|
|
55
|
-
align: "center",
|
|
56
|
-
sideOffset,
|
|
57
|
-
...props
|
|
58
|
-
}
|
|
59
|
-
) }));
|
|
@@ -1,139 +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 radix_popover_ws_exports = {};
|
|
30
|
-
__export(radix_popover_ws_exports, {
|
|
31
|
-
metaPopover: () => metaPopover,
|
|
32
|
-
metaPopoverContent: () => metaPopoverContent,
|
|
33
|
-
metaPopoverTrigger: () => metaPopoverTrigger,
|
|
34
|
-
propsMetaPopover: () => propsMetaPopover,
|
|
35
|
-
propsMetaPopoverContent: () => propsMetaPopoverContent,
|
|
36
|
-
propsMetaPopoverTrigger: () => propsMetaPopoverTrigger
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(radix_popover_ws_exports);
|
|
39
|
-
var import_svg = require("@webstudio-is/icons/svg");
|
|
40
|
-
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
41
|
-
var tc = __toESM(require("./theme/tailwind-classes"), 1);
|
|
42
|
-
var import_radix_popover = require("./__generated__/radix-popover.props");
|
|
43
|
-
const metaPopoverTrigger = {
|
|
44
|
-
category: "hidden",
|
|
45
|
-
invalidAncestors: [],
|
|
46
|
-
type: "container",
|
|
47
|
-
label: "PopoverTrigger",
|
|
48
|
-
icon: import_svg.RadioCheckedIcon,
|
|
49
|
-
stylable: false,
|
|
50
|
-
detachable: false
|
|
51
|
-
};
|
|
52
|
-
const metaPopoverContent = {
|
|
53
|
-
category: "hidden",
|
|
54
|
-
invalidAncestors: [],
|
|
55
|
-
type: "container",
|
|
56
|
-
label: "PopoverContent",
|
|
57
|
-
icon: import_svg.RadioCheckedIcon,
|
|
58
|
-
detachable: false
|
|
59
|
-
};
|
|
60
|
-
const metaPopover = {
|
|
61
|
-
category: "radix",
|
|
62
|
-
invalidAncestors: [],
|
|
63
|
-
type: "container",
|
|
64
|
-
label: "Popover",
|
|
65
|
-
icon: import_svg.RadioCheckedIcon,
|
|
66
|
-
order: 15,
|
|
67
|
-
stylable: false,
|
|
68
|
-
template: [
|
|
69
|
-
{
|
|
70
|
-
type: "instance",
|
|
71
|
-
component: "Popover",
|
|
72
|
-
label: "Popover",
|
|
73
|
-
props: [
|
|
74
|
-
{
|
|
75
|
-
name: "isOpen",
|
|
76
|
-
// We don't have support for boolean or undefined, instead of binding on open we bind on a string
|
|
77
|
-
type: "string",
|
|
78
|
-
value: "initial",
|
|
79
|
-
dataSourceRef: {
|
|
80
|
-
type: "variable",
|
|
81
|
-
name: "isOpen"
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
],
|
|
85
|
-
children: [
|
|
86
|
-
{
|
|
87
|
-
type: "instance",
|
|
88
|
-
component: "PopoverTrigger",
|
|
89
|
-
props: [],
|
|
90
|
-
children: [
|
|
91
|
-
{
|
|
92
|
-
type: "instance",
|
|
93
|
-
component: "Button",
|
|
94
|
-
children: [{ type: "text", value: "Button" }]
|
|
95
|
-
}
|
|
96
|
-
]
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
type: "instance",
|
|
100
|
-
component: "PopoverContent",
|
|
101
|
-
label: "Popover Content",
|
|
102
|
-
props: [],
|
|
103
|
-
/**
|
|
104
|
-
* z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none
|
|
105
|
-
**/
|
|
106
|
-
styles: [
|
|
107
|
-
tc.z(50),
|
|
108
|
-
tc.w(72),
|
|
109
|
-
tc.rounded("md"),
|
|
110
|
-
tc.border(),
|
|
111
|
-
tc.bg("popover"),
|
|
112
|
-
tc.p(4),
|
|
113
|
-
tc.text("popoverForeground"),
|
|
114
|
-
tc.shadow("md"),
|
|
115
|
-
tc.outline("none")
|
|
116
|
-
].flat(),
|
|
117
|
-
children: [
|
|
118
|
-
{
|
|
119
|
-
type: "instance",
|
|
120
|
-
component: "Text",
|
|
121
|
-
children: [{ type: "text", value: "The text you can edit" }]
|
|
122
|
-
}
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
]
|
|
126
|
-
}
|
|
127
|
-
]
|
|
128
|
-
};
|
|
129
|
-
const propsMetaPopover = {
|
|
130
|
-
props: import_radix_popover.propsPopover,
|
|
131
|
-
initialProps: ["isOpen", "modal"]
|
|
132
|
-
};
|
|
133
|
-
const propsMetaPopoverTrigger = {
|
|
134
|
-
props: import_radix_popover.propsPopoverTrigger
|
|
135
|
-
};
|
|
136
|
-
const propsMetaPopoverContent = {
|
|
137
|
-
props: import_radix_popover.propsPopoverContent,
|
|
138
|
-
initialProps: ["side", "sideOffset", "align", "alignOffset"]
|
|
139
|
-
};
|
package/lib/cjs/radix-tooltip.js
DELETED
|
@@ -1,51 +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 radix_tooltip_exports = {};
|
|
30
|
-
__export(radix_tooltip_exports, {
|
|
31
|
-
Tooltip: () => Tooltip,
|
|
32
|
-
TooltipContent: () => TooltipContent,
|
|
33
|
-
TooltipTrigger: () => TooltipTrigger
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(radix_tooltip_exports);
|
|
36
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
-
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
38
|
-
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
39
|
-
var import_react = require("react");
|
|
40
|
-
const DisplayContentsStyle = { display: "contents" };
|
|
41
|
-
const Tooltip = (0, import_react.forwardRef)(({ open: openProp, isOpen, ...props }, ref) => {
|
|
42
|
-
const [webstudioAttributes, restProps] = (0, import_react_sdk.splitPropsWithWebstudioAttributes)(props);
|
|
43
|
-
const open = openProp ?? (isOpen === "open" ? true : isOpen === "closed" ? false : void 0);
|
|
44
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, style: DisplayContentsStyle, ...webstudioAttributes, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Root, { open, ...restProps }) });
|
|
45
|
-
});
|
|
46
|
-
const TooltipTrigger = (0, import_react.forwardRef)(({ children, ...props }, ref) => {
|
|
47
|
-
const firstChild = import_react.Children.toArray(children)[0];
|
|
48
|
-
const [webstudioAttributes, restProps] = (0, import_react_sdk.splitPropsWithWebstudioAttributes)(props);
|
|
49
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, style: DisplayContentsStyle, ...webstudioAttributes, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Trigger, { asChild: true, ...restProps, children: firstChild ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { children: "Add button or link" }) }) });
|
|
50
|
-
});
|
|
51
|
-
const TooltipContent = (0, import_react.forwardRef)(({ sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Content, { ref, sideOffset, ...props }) }));
|
|
@@ -1,140 +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 radix_tooltip_ws_exports = {};
|
|
30
|
-
__export(radix_tooltip_ws_exports, {
|
|
31
|
-
metaTooltip: () => metaTooltip,
|
|
32
|
-
metaTooltipContent: () => metaTooltipContent,
|
|
33
|
-
metaTooltipTrigger: () => metaTooltipTrigger,
|
|
34
|
-
propsMetaTooltip: () => propsMetaTooltip,
|
|
35
|
-
propsMetaTooltipContent: () => propsMetaTooltipContent,
|
|
36
|
-
propsMetaTooltipTrigger: () => propsMetaTooltipTrigger
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(radix_tooltip_ws_exports);
|
|
39
|
-
var import_svg = require("@webstudio-is/icons/svg");
|
|
40
|
-
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
41
|
-
var tc = __toESM(require("./theme/tailwind-classes"), 1);
|
|
42
|
-
var import_radix_tooltip = require("./__generated__/radix-tooltip.props");
|
|
43
|
-
const metaTooltipTrigger = {
|
|
44
|
-
category: "hidden",
|
|
45
|
-
detachable: false,
|
|
46
|
-
invalidAncestors: [],
|
|
47
|
-
type: "container",
|
|
48
|
-
label: "TooltipTrigger",
|
|
49
|
-
icon: import_svg.RadioCheckedIcon,
|
|
50
|
-
stylable: false
|
|
51
|
-
};
|
|
52
|
-
const metaTooltipContent = {
|
|
53
|
-
category: "hidden",
|
|
54
|
-
detachable: false,
|
|
55
|
-
invalidAncestors: [],
|
|
56
|
-
type: "container",
|
|
57
|
-
label: "TooltipContent",
|
|
58
|
-
icon: import_svg.RadioCheckedIcon
|
|
59
|
-
};
|
|
60
|
-
const metaTooltip = {
|
|
61
|
-
category: "radix",
|
|
62
|
-
invalidAncestors: [],
|
|
63
|
-
type: "container",
|
|
64
|
-
label: "Tooltip",
|
|
65
|
-
icon: import_svg.RadioCheckedIcon,
|
|
66
|
-
order: 15,
|
|
67
|
-
stylable: false,
|
|
68
|
-
template: [
|
|
69
|
-
{
|
|
70
|
-
type: "instance",
|
|
71
|
-
component: "Tooltip",
|
|
72
|
-
label: "Tooltip",
|
|
73
|
-
props: [
|
|
74
|
-
{
|
|
75
|
-
name: "isOpen",
|
|
76
|
-
// We don't have support for boolean or undefined, instead of binding on open we bind on a string
|
|
77
|
-
type: "string",
|
|
78
|
-
value: "initial",
|
|
79
|
-
dataSourceRef: {
|
|
80
|
-
type: "variable",
|
|
81
|
-
name: "isOpen"
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
],
|
|
85
|
-
children: [
|
|
86
|
-
{
|
|
87
|
-
type: "instance",
|
|
88
|
-
component: "TooltipTrigger",
|
|
89
|
-
props: [],
|
|
90
|
-
children: [
|
|
91
|
-
{
|
|
92
|
-
type: "instance",
|
|
93
|
-
component: "Button",
|
|
94
|
-
children: [{ type: "text", value: "Button" }]
|
|
95
|
-
}
|
|
96
|
-
]
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
type: "instance",
|
|
100
|
-
component: "TooltipContent",
|
|
101
|
-
label: "Tooltip Content",
|
|
102
|
-
props: [],
|
|
103
|
-
/**
|
|
104
|
-
* z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md
|
|
105
|
-
**/
|
|
106
|
-
styles: [
|
|
107
|
-
tc.z(50),
|
|
108
|
-
tc.overflow("hidden"),
|
|
109
|
-
tc.rounded("md"),
|
|
110
|
-
tc.border(),
|
|
111
|
-
tc.bg("popover"),
|
|
112
|
-
tc.px(3),
|
|
113
|
-
tc.py(1.5),
|
|
114
|
-
tc.text("sm"),
|
|
115
|
-
tc.text("popoverForeground"),
|
|
116
|
-
tc.shadow("md")
|
|
117
|
-
].flat(),
|
|
118
|
-
children: [
|
|
119
|
-
{
|
|
120
|
-
type: "instance",
|
|
121
|
-
component: "Text",
|
|
122
|
-
children: [{ type: "text", value: "The text you can edit" }]
|
|
123
|
-
}
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
]
|
|
127
|
-
}
|
|
128
|
-
]
|
|
129
|
-
};
|
|
130
|
-
const propsMetaTooltip = {
|
|
131
|
-
props: import_radix_tooltip.propsTooltip,
|
|
132
|
-
initialProps: ["isOpen", "delayDuration", "disableHoverableContent"]
|
|
133
|
-
};
|
|
134
|
-
const propsMetaTooltipTrigger = {
|
|
135
|
-
props: import_radix_tooltip.propsTooltipTrigger
|
|
136
|
-
};
|
|
137
|
-
const propsMetaTooltipContent = {
|
|
138
|
-
props: import_radix_tooltip.propsTooltipContent,
|
|
139
|
-
initialProps: ["side", "sideOffset", "align", "alignOffset"]
|
|
140
|
-
};
|