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