@webstudio-is/sdk-components-react-radix 0.189.0 → 0.191.4
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/package.json +11 -12
- package/lib/components.js +0 -408
- package/lib/hooks.js +0 -658
- package/lib/metas.js +0 -4572
- package/lib/props.js +0 -24210
- package/lib/types/__generated__/accordion.props.d.ts +0 -6
- package/lib/types/__generated__/checkbox.props.d.ts +0 -3
- package/lib/types/__generated__/collapsible.props.d.ts +0 -4
- package/lib/types/__generated__/dialog.props.d.ts +0 -8
- package/lib/types/__generated__/label.props.d.ts +0 -2
- package/lib/types/__generated__/navigation-menu.props.d.ts +0 -8
- package/lib/types/__generated__/popover.props.d.ts +0 -4
- package/lib/types/__generated__/radio-group.props.d.ts +0 -4
- package/lib/types/__generated__/select.props.d.ts +0 -9
- package/lib/types/__generated__/sheet.props.d.ts +0 -8
- package/lib/types/__generated__/switch.props.d.ts +0 -3
- package/lib/types/__generated__/tabs.props.d.ts +0 -5
- package/lib/types/__generated__/tooltip.props.d.ts +0 -4
- package/lib/types/accordion.d.ts +0 -11
- package/lib/types/accordion.ws.d.ts +0 -11
- package/lib/types/checkbox.d.ts +0 -9
- package/lib/types/checkbox.ws.d.ts +0 -5
- package/lib/types/collapsible.d.ts +0 -15
- package/lib/types/collapsible.ws.d.ts +0 -7
- package/lib/types/components.d.ts +0 -12
- package/lib/types/dialog.d.ts +0 -23
- package/lib/types/dialog.ws.d.ts +0 -23
- package/lib/types/hooks.d.ts +0 -2
- package/lib/types/label.d.ts +0 -2
- package/lib/types/label.ws.d.ts +0 -3
- package/lib/types/metas.d.ts +0 -13
- package/lib/types/navigation-menu.d.ts +0 -10
- package/lib/types/navigation-menu.ws.d.ts +0 -15
- package/lib/types/popover.d.ts +0 -15
- package/lib/types/popover.ws.d.ts +0 -15
- package/lib/types/props-descriptions.d.ts +0 -29
- package/lib/types/props.d.ts +0 -12
- package/lib/types/radio-group.d.ts +0 -5
- package/lib/types/radio-group.ws.d.ts +0 -7
- package/lib/types/select.d.ts +0 -14
- package/lib/types/select.ws.d.ts +0 -17
- package/lib/types/sheet.d.ts +0 -16
- package/lib/types/sheet.ws.d.ts +0 -10
- package/lib/types/switch.d.ts +0 -4
- package/lib/types/switch.ws.d.ts +0 -5
- package/lib/types/tabs.d.ts +0 -12
- package/lib/types/tabs.ws.d.ts +0 -9
- package/lib/types/theme/__generated__/tailwind-theme.d.ts +0 -26
- package/lib/types/theme/styles.d.ts +0 -278
- package/lib/types/theme/tailwind-classes.d.ts +0 -104
- package/lib/types/theme/tailwind-colors.d.ts +0 -31
- package/lib/types/tooltip.d.ts +0 -15
- package/lib/types/tooltip.ws.d.ts +0 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk-components-react-radix",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.191.4",
|
|
4
4
|
"description": "Webstudio wrapper for radix library",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -50,28 +50,27 @@
|
|
|
50
50
|
"@radix-ui/react-select": "^2.1.2",
|
|
51
51
|
"@radix-ui/react-switch": "^1.1.1",
|
|
52
52
|
"@radix-ui/react-tabs": "^1.1.1",
|
|
53
|
-
"@radix-ui/react-tooltip": "^1.1.
|
|
54
|
-
"@webstudio-is/
|
|
55
|
-
"@webstudio-is/
|
|
56
|
-
"@webstudio-is/icons": "0.
|
|
57
|
-
"@webstudio-is/sdk": "0.
|
|
53
|
+
"@radix-ui/react-tooltip": "^1.1.4",
|
|
54
|
+
"@webstudio-is/react-sdk": "0.191.4",
|
|
55
|
+
"@webstudio-is/css-engine": "0.191.4",
|
|
56
|
+
"@webstudio-is/icons": "0.191.4",
|
|
57
|
+
"@webstudio-is/sdk": "0.191.4"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@types/node": "^22.
|
|
60
|
+
"@types/node": "^22.9.3",
|
|
61
61
|
"@types/react": "^18.2.70",
|
|
62
62
|
"@types/react-dom": "^18.2.25",
|
|
63
63
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
64
64
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
65
65
|
"tailwindcss": "^3.3.3",
|
|
66
|
-
"typescript": "^5.6.3",
|
|
67
|
-
"@webstudio-is/css-data": "0.0.0",
|
|
68
66
|
"@webstudio-is/generate-arg-types": "0.0.0",
|
|
69
67
|
"@webstudio-is/sdk-cli": "^0.94.0",
|
|
70
|
-
"@webstudio-is/
|
|
71
|
-
"@webstudio-is/sdk-components-react": "0.
|
|
68
|
+
"@webstudio-is/css-data": "0.0.0",
|
|
69
|
+
"@webstudio-is/sdk-components-react": "0.191.4",
|
|
70
|
+
"@webstudio-is/tsconfig": "1.0.7"
|
|
72
71
|
},
|
|
73
72
|
"scripts": {
|
|
74
|
-
"build": "
|
|
73
|
+
"build": "vite build --config ../../vite.sdk-components.config.ts",
|
|
75
74
|
"build:args": "NODE_OPTIONS=--conditions=webstudio generate-arg-types './src/*.tsx !./src/*.stories.tsx !./src/*.ws.ts !./src/*.test.{ts,tsx}' -e asChild -e modal -e defaultOpen -e defaultChecked && prettier --write \"**/*.props.ts\"",
|
|
76
75
|
"build:tailwind": "tsx scripts/generate-tailwind-theme.ts && prettier --write src/theme/__generated__",
|
|
77
76
|
"build:stories": "webstudio-sdk generate-stories && prettier --write \"src/__generated__/*.stories.tsx\"",
|
package/lib/components.js
DELETED
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
// src/collapsible.tsx
|
|
2
|
-
import {
|
|
3
|
-
forwardRef,
|
|
4
|
-
Children
|
|
5
|
-
} from "react";
|
|
6
|
-
import { Root, Trigger, Content } from "@radix-ui/react-collapsible";
|
|
7
|
-
import {
|
|
8
|
-
getClosestInstance,
|
|
9
|
-
getInstanceSelectorById
|
|
10
|
-
} from "@webstudio-is/react-sdk/runtime";
|
|
11
|
-
import { jsx } from "react/jsx-runtime";
|
|
12
|
-
var Collapsible = Root;
|
|
13
|
-
var CollapsibleTrigger = forwardRef(({ children, ...props }, ref) => {
|
|
14
|
-
const firstChild = Children.toArray(children)[0];
|
|
15
|
-
return /* @__PURE__ */ jsx(Trigger, { asChild: true, ref, ...props, children: firstChild ?? /* @__PURE__ */ jsx("button", { children: "Add button" }) });
|
|
16
|
-
});
|
|
17
|
-
var CollapsibleContent = Content;
|
|
18
|
-
|
|
19
|
-
// src/dialog.tsx
|
|
20
|
-
import {
|
|
21
|
-
forwardRef as forwardRef2,
|
|
22
|
-
Children as Children2,
|
|
23
|
-
useEffect,
|
|
24
|
-
useRef,
|
|
25
|
-
useContext
|
|
26
|
-
} from "react";
|
|
27
|
-
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
28
|
-
import {
|
|
29
|
-
ReactSdkContext,
|
|
30
|
-
getClosestInstance as getClosestInstance2,
|
|
31
|
-
getInstanceSelectorById as getInstanceSelectorById2
|
|
32
|
-
} from "@webstudio-is/react-sdk/runtime";
|
|
33
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
34
|
-
var willNavigate = (event) => {
|
|
35
|
-
const { target } = event;
|
|
36
|
-
if (target instanceof HTMLAnchorElement === false) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
if (target.hasAttribute("href") === false) {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
if (target.href === "#") {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
if (target.hasAttribute("target") && target.target === "_blank") {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
if (event.ctrlKey || event.metaKey) {
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
return true;
|
|
52
|
-
};
|
|
53
|
-
var Dialog = forwardRef2((props, _ref) => {
|
|
54
|
-
const { open, onOpenChange } = props;
|
|
55
|
-
const { renderer } = useContext(ReactSdkContext);
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
if (renderer !== void 0) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (open === false) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const handleClick = (event) => {
|
|
64
|
-
const { target } = event;
|
|
65
|
-
if (willNavigate(event) === false) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
if (target instanceof HTMLAnchorElement === false) {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
if (target.closest('[role="dialog"]')) {
|
|
72
|
-
onOpenChange?.(false);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
window.addEventListener("click", handleClick);
|
|
76
|
-
return () => window.removeEventListener("click", handleClick);
|
|
77
|
-
}, [open, onOpenChange, renderer]);
|
|
78
|
-
return /* @__PURE__ */ jsx2(DialogPrimitive.Root, { ...props });
|
|
79
|
-
});
|
|
80
|
-
var DialogTrigger = forwardRef2(({ children, ...props }, ref) => {
|
|
81
|
-
const firstChild = Children2.toArray(children)[0];
|
|
82
|
-
return /* @__PURE__ */ jsx2(DialogPrimitive.Trigger, { ref, asChild: true, ...props, children: firstChild ?? /* @__PURE__ */ jsx2("button", { children: "Add button or link" }) });
|
|
83
|
-
});
|
|
84
|
-
var DialogOverlay = forwardRef2((props, ref) => {
|
|
85
|
-
return /* @__PURE__ */ jsx2(DialogPrimitive.DialogPortal, { children: /* @__PURE__ */ jsx2(DialogPrimitive.Overlay, { ref, ...props }) });
|
|
86
|
-
});
|
|
87
|
-
var DialogContent = forwardRef2((props, ref) => {
|
|
88
|
-
const preventAutoFocusOnClose = useRef(false);
|
|
89
|
-
const { renderer } = useContext(ReactSdkContext);
|
|
90
|
-
useEffect(() => {
|
|
91
|
-
if (renderer !== void 0) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
preventAutoFocusOnClose.current = false;
|
|
95
|
-
const handleClick = (event) => {
|
|
96
|
-
const { target } = event;
|
|
97
|
-
if (willNavigate(event) === false) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
if (target instanceof HTMLAnchorElement === false) {
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
if (target.closest('[role="dialog"]')) {
|
|
104
|
-
preventAutoFocusOnClose.current = true;
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
window.addEventListener("click", handleClick);
|
|
108
|
-
return () => window.removeEventListener("click", handleClick);
|
|
109
|
-
}, [renderer]);
|
|
110
|
-
return /* @__PURE__ */ jsx2(
|
|
111
|
-
DialogPrimitive.Content,
|
|
112
|
-
{
|
|
113
|
-
ref,
|
|
114
|
-
...props,
|
|
115
|
-
onCloseAutoFocus: (event) => {
|
|
116
|
-
if (preventAutoFocusOnClose.current) {
|
|
117
|
-
event.preventDefault();
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
);
|
|
122
|
-
});
|
|
123
|
-
var DialogClose = DialogPrimitive.Close;
|
|
124
|
-
var defaultTag = "h1";
|
|
125
|
-
var DialogTitle2 = forwardRef2(({ tag: Tag = defaultTag, children, ...props }, ref) => /* @__PURE__ */ jsx2(DialogPrimitive.DialogTitle, { asChild: true, children: /* @__PURE__ */ jsx2(Tag, { ref, ...props, children }) }));
|
|
126
|
-
var DialogDescription = DialogPrimitive.Description;
|
|
127
|
-
|
|
128
|
-
// src/popover.tsx
|
|
129
|
-
import {
|
|
130
|
-
forwardRef as forwardRef3,
|
|
131
|
-
Children as Children3
|
|
132
|
-
} from "react";
|
|
133
|
-
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
134
|
-
import {
|
|
135
|
-
getClosestInstance as getClosestInstance3,
|
|
136
|
-
getInstanceSelectorById as getInstanceSelectorById3
|
|
137
|
-
} from "@webstudio-is/react-sdk/runtime";
|
|
138
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
139
|
-
var Popover = forwardRef3((props, _ref) => {
|
|
140
|
-
return /* @__PURE__ */ jsx3(PopoverPrimitive.Root, { ...props });
|
|
141
|
-
});
|
|
142
|
-
var PopoverTrigger = forwardRef3(({ children, ...props }, ref) => {
|
|
143
|
-
const firstChild = Children3.toArray(children)[0];
|
|
144
|
-
return /* @__PURE__ */ jsx3(PopoverPrimitive.Trigger, { asChild: true, ref, ...props, children: firstChild ?? /* @__PURE__ */ jsx3("button", { children: "Add button or link" }) });
|
|
145
|
-
});
|
|
146
|
-
var PopoverContent = forwardRef3(
|
|
147
|
-
({ sideOffset = 4, align = "center", hideWhenDetached = true, ...props }, ref) => /* @__PURE__ */ jsx3(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx3(
|
|
148
|
-
PopoverPrimitive.Content,
|
|
149
|
-
{
|
|
150
|
-
ref,
|
|
151
|
-
align: "center",
|
|
152
|
-
sideOffset,
|
|
153
|
-
hideWhenDetached,
|
|
154
|
-
...props
|
|
155
|
-
}
|
|
156
|
-
) })
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
// src/tooltip.tsx
|
|
160
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
161
|
-
import {
|
|
162
|
-
getClosestInstance as getClosestInstance4,
|
|
163
|
-
getInstanceSelectorById as getInstanceSelectorById4
|
|
164
|
-
} from "@webstudio-is/react-sdk/runtime";
|
|
165
|
-
import {
|
|
166
|
-
forwardRef as forwardRef4,
|
|
167
|
-
Children as Children4
|
|
168
|
-
} from "react";
|
|
169
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
170
|
-
var Tooltip = forwardRef4((props, _ref) => {
|
|
171
|
-
return /* @__PURE__ */ jsx4(TooltipPrimitive.Provider, { children: /* @__PURE__ */ jsx4(TooltipPrimitive.Root, { ...props }) });
|
|
172
|
-
});
|
|
173
|
-
var TooltipTrigger = forwardRef4(({ children, ...props }, ref) => {
|
|
174
|
-
const firstChild = Children4.toArray(children)[0];
|
|
175
|
-
return /* @__PURE__ */ jsx4(TooltipPrimitive.Trigger, { asChild: true, ref, ...props, children: firstChild ?? /* @__PURE__ */ jsx4("button", { children: "Add button or link" }) });
|
|
176
|
-
});
|
|
177
|
-
var TooltipContent = forwardRef4(({ sideOffset = 4, hideWhenDetached = true, ...props }, ref) => /* @__PURE__ */ jsx4(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx4(
|
|
178
|
-
TooltipPrimitive.Content,
|
|
179
|
-
{
|
|
180
|
-
ref,
|
|
181
|
-
hideWhenDetached,
|
|
182
|
-
sideOffset,
|
|
183
|
-
...props
|
|
184
|
-
}
|
|
185
|
-
) }));
|
|
186
|
-
|
|
187
|
-
// src/tabs.tsx
|
|
188
|
-
import {
|
|
189
|
-
forwardRef as forwardRef5
|
|
190
|
-
} from "react";
|
|
191
|
-
import { Root as Root5, List, Trigger as Trigger5, Content as Content5 } from "@radix-ui/react-tabs";
|
|
192
|
-
import {
|
|
193
|
-
getClosestInstance as getClosestInstance5,
|
|
194
|
-
getIndexWithinAncestorFromComponentProps,
|
|
195
|
-
getInstanceSelectorById as getInstanceSelectorById5
|
|
196
|
-
} from "@webstudio-is/react-sdk/runtime";
|
|
197
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
198
|
-
var Tabs = Root5;
|
|
199
|
-
var TabsList = List;
|
|
200
|
-
var TabsTrigger = forwardRef5(({ value, ...props }, ref) => {
|
|
201
|
-
const index = getIndexWithinAncestorFromComponentProps(props);
|
|
202
|
-
return /* @__PURE__ */ jsx5(Trigger5, { ref, value: value ?? index ?? "", ...props });
|
|
203
|
-
});
|
|
204
|
-
var TabsContent = forwardRef5(({ value, ...props }, ref) => {
|
|
205
|
-
const index = getIndexWithinAncestorFromComponentProps(props);
|
|
206
|
-
return /* @__PURE__ */ jsx5(Content5, { ref, value: value ?? index ?? "", ...props });
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
// src/label.tsx
|
|
210
|
-
import {
|
|
211
|
-
forwardRef as forwardRef6
|
|
212
|
-
} from "react";
|
|
213
|
-
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
214
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
215
|
-
var Label = forwardRef6((props, ref) => /* @__PURE__ */ jsx6(LabelPrimitive.Root, { ref, ...props }));
|
|
216
|
-
|
|
217
|
-
// src/accordion.tsx
|
|
218
|
-
import {
|
|
219
|
-
forwardRef as forwardRef7
|
|
220
|
-
} from "react";
|
|
221
|
-
import {
|
|
222
|
-
Root as Root7,
|
|
223
|
-
Item,
|
|
224
|
-
Header,
|
|
225
|
-
Trigger as Trigger6,
|
|
226
|
-
Content as Content6
|
|
227
|
-
} from "@radix-ui/react-accordion";
|
|
228
|
-
import {
|
|
229
|
-
getClosestInstance as getClosestInstance6,
|
|
230
|
-
getIndexWithinAncestorFromComponentProps as getIndexWithinAncestorFromComponentProps2,
|
|
231
|
-
getInstanceSelectorById as getInstanceSelectorById6
|
|
232
|
-
} from "@webstudio-is/react-sdk/runtime";
|
|
233
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
234
|
-
var Accordion = forwardRef7((props, ref) => {
|
|
235
|
-
return /* @__PURE__ */ jsx7(Root7, { ref, type: "single", ...props });
|
|
236
|
-
});
|
|
237
|
-
var AccordionItem = forwardRef7(({ value, ...props }, ref) => {
|
|
238
|
-
const index = getIndexWithinAncestorFromComponentProps2(props);
|
|
239
|
-
return /* @__PURE__ */ jsx7(Item, { ref, value: value ?? index ?? "", ...props });
|
|
240
|
-
});
|
|
241
|
-
var AccordionHeader = Header;
|
|
242
|
-
var AccordionTrigger = Trigger6;
|
|
243
|
-
var AccordionContent = Content6;
|
|
244
|
-
|
|
245
|
-
// src/navigation-menu.tsx
|
|
246
|
-
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
247
|
-
import {
|
|
248
|
-
getClosestInstance as getClosestInstance7,
|
|
249
|
-
getIndexWithinAncestorFromComponentProps as getIndexWithinAncestorFromComponentProps3,
|
|
250
|
-
getInstanceSelectorById as getInstanceSelectorById7,
|
|
251
|
-
ReactSdkContext as ReactSdkContext2
|
|
252
|
-
} from "@webstudio-is/react-sdk/runtime";
|
|
253
|
-
import {
|
|
254
|
-
Children as Children5,
|
|
255
|
-
forwardRef as forwardRef8,
|
|
256
|
-
useContext as useContext2
|
|
257
|
-
} from "react";
|
|
258
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
259
|
-
var NavigationMenu = forwardRef8(({ value: propsValue, ...props }, ref) => {
|
|
260
|
-
const { renderer } = useContext2(ReactSdkContext2);
|
|
261
|
-
let value = propsValue;
|
|
262
|
-
if (renderer === "canvas") {
|
|
263
|
-
value = value === "" ? "-1" : value;
|
|
264
|
-
}
|
|
265
|
-
return /* @__PURE__ */ jsx8(NavigationMenuPrimitive.Root, { ref, value, ...props });
|
|
266
|
-
});
|
|
267
|
-
var NavigationMenuList = NavigationMenuPrimitive.List;
|
|
268
|
-
var NavigationMenuViewport = NavigationMenuPrimitive.Viewport;
|
|
269
|
-
var NavigationMenuContent = NavigationMenuPrimitive.Content;
|
|
270
|
-
var NavigationMenuItem = forwardRef8(({ value, ...props }, ref) => {
|
|
271
|
-
const index = getIndexWithinAncestorFromComponentProps3(props);
|
|
272
|
-
return /* @__PURE__ */ jsx8(NavigationMenuPrimitive.Item, { ref, value: value ?? index, ...props });
|
|
273
|
-
});
|
|
274
|
-
var NavigationMenuLink = forwardRef8(({ children, ...props }, ref) => {
|
|
275
|
-
const firstChild = Children5.toArray(children)[0];
|
|
276
|
-
return /* @__PURE__ */ jsx8(NavigationMenuPrimitive.Link, { asChild: true, ref, ...props, children: firstChild ?? /* @__PURE__ */ jsx8("a", { children: "Add link component" }) });
|
|
277
|
-
});
|
|
278
|
-
var NavigationMenuTrigger = forwardRef8(({ children, ...props }, ref) => {
|
|
279
|
-
const firstChild = Children5.toArray(children)[0];
|
|
280
|
-
return /* @__PURE__ */ jsx8(NavigationMenuPrimitive.Trigger, { asChild: true, ref, ...props, children: firstChild ?? /* @__PURE__ */ jsx8("button", { children: "Add button or link" }) });
|
|
281
|
-
});
|
|
282
|
-
|
|
283
|
-
// src/select.tsx
|
|
284
|
-
import {
|
|
285
|
-
forwardRef as forwardRef9,
|
|
286
|
-
useContext as useContext3
|
|
287
|
-
} from "react";
|
|
288
|
-
import {
|
|
289
|
-
Root as Root9,
|
|
290
|
-
Value,
|
|
291
|
-
Trigger as Trigger8,
|
|
292
|
-
Content as Content8,
|
|
293
|
-
Item as Item3,
|
|
294
|
-
ItemIndicator,
|
|
295
|
-
ItemText,
|
|
296
|
-
Portal as Portal3,
|
|
297
|
-
Viewport as Viewport2
|
|
298
|
-
} from "@radix-ui/react-select";
|
|
299
|
-
import {
|
|
300
|
-
getClosestInstance as getClosestInstance8,
|
|
301
|
-
getInstanceSelectorById as getInstanceSelectorById8,
|
|
302
|
-
ReactSdkContext as ReactSdkContext3
|
|
303
|
-
} from "@webstudio-is/react-sdk/runtime";
|
|
304
|
-
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
305
|
-
var Select = forwardRef9(
|
|
306
|
-
({ value, defaultValue, ...props }, _ref) => {
|
|
307
|
-
return /* @__PURE__ */ jsx9(Root9, { ...props, defaultValue: value ?? defaultValue });
|
|
308
|
-
}
|
|
309
|
-
);
|
|
310
|
-
var SelectTrigger = forwardRef9((props, ref) => {
|
|
311
|
-
const { renderer } = useContext3(ReactSdkContext3);
|
|
312
|
-
const onPointerDown = renderer === "canvas" ? (event) => {
|
|
313
|
-
event.preventDefault();
|
|
314
|
-
} : void 0;
|
|
315
|
-
return /* @__PURE__ */ jsx9(Trigger8, { onPointerDown, ref, ...props });
|
|
316
|
-
});
|
|
317
|
-
var SelectValue = forwardRef9((props, ref) => {
|
|
318
|
-
return /* @__PURE__ */ jsx9(Value, { ref, ...props });
|
|
319
|
-
});
|
|
320
|
-
var SelectContent = forwardRef9((props, ref) => {
|
|
321
|
-
return /* @__PURE__ */ jsx9(Portal3, { children: /* @__PURE__ */ jsx9(Content8, { ref, ...props, position: "popper" }) });
|
|
322
|
-
});
|
|
323
|
-
var SelectViewport = Viewport2;
|
|
324
|
-
var SelectItem = Item3;
|
|
325
|
-
var SelectItemIndicator = ItemIndicator;
|
|
326
|
-
var SelectItemText = ItemText;
|
|
327
|
-
|
|
328
|
-
// src/switch.tsx
|
|
329
|
-
import {
|
|
330
|
-
forwardRef as forwardRef10
|
|
331
|
-
} from "react";
|
|
332
|
-
import { Root as Root10, Thumb } from "@radix-ui/react-switch";
|
|
333
|
-
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
334
|
-
var Switch = forwardRef10(({ checked, defaultChecked, ...props }, ref) => {
|
|
335
|
-
return /* @__PURE__ */ jsx10(Root10, { ...props, ref, defaultChecked: checked ?? defaultChecked });
|
|
336
|
-
});
|
|
337
|
-
var SwitchThumb = Thumb;
|
|
338
|
-
|
|
339
|
-
// src/checkbox.tsx
|
|
340
|
-
import {
|
|
341
|
-
forwardRef as forwardRef11
|
|
342
|
-
} from "react";
|
|
343
|
-
import { Root as Root11, Indicator } from "@radix-ui/react-checkbox";
|
|
344
|
-
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
345
|
-
var Checkbox = forwardRef11(({ checked, defaultChecked, ...props }, ref) => {
|
|
346
|
-
return /* @__PURE__ */ jsx11(Root11, { ...props, ref, defaultChecked: checked ?? defaultChecked });
|
|
347
|
-
});
|
|
348
|
-
var CheckboxIndicator = Indicator;
|
|
349
|
-
|
|
350
|
-
// src/radio-group.tsx
|
|
351
|
-
import {
|
|
352
|
-
forwardRef as forwardRef12
|
|
353
|
-
} from "react";
|
|
354
|
-
import { Root as Root12, Item as Item4, Indicator as Indicator2 } from "@radix-ui/react-radio-group";
|
|
355
|
-
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
356
|
-
var RadioGroup = forwardRef12(({ value, defaultValue, ...props }, ref) => /* @__PURE__ */ jsx12(Root12, { ...props, defaultValue: value ?? defaultValue, ref }));
|
|
357
|
-
var RadioGroupItem = Item4;
|
|
358
|
-
var RadioGroupIndicator = Indicator2;
|
|
359
|
-
export {
|
|
360
|
-
Accordion,
|
|
361
|
-
AccordionContent,
|
|
362
|
-
AccordionHeader,
|
|
363
|
-
AccordionItem,
|
|
364
|
-
AccordionTrigger,
|
|
365
|
-
Checkbox,
|
|
366
|
-
CheckboxIndicator,
|
|
367
|
-
Collapsible,
|
|
368
|
-
CollapsibleContent,
|
|
369
|
-
CollapsibleTrigger,
|
|
370
|
-
Dialog,
|
|
371
|
-
DialogClose,
|
|
372
|
-
DialogContent,
|
|
373
|
-
DialogDescription,
|
|
374
|
-
DialogOverlay,
|
|
375
|
-
DialogTitle2 as DialogTitle,
|
|
376
|
-
DialogTrigger,
|
|
377
|
-
Label,
|
|
378
|
-
NavigationMenu,
|
|
379
|
-
NavigationMenuContent,
|
|
380
|
-
NavigationMenuItem,
|
|
381
|
-
NavigationMenuLink,
|
|
382
|
-
NavigationMenuList,
|
|
383
|
-
NavigationMenuTrigger,
|
|
384
|
-
NavigationMenuViewport,
|
|
385
|
-
Popover,
|
|
386
|
-
PopoverContent,
|
|
387
|
-
PopoverTrigger,
|
|
388
|
-
RadioGroup,
|
|
389
|
-
RadioGroupIndicator,
|
|
390
|
-
RadioGroupItem,
|
|
391
|
-
Select,
|
|
392
|
-
SelectContent,
|
|
393
|
-
SelectItem,
|
|
394
|
-
SelectItemIndicator,
|
|
395
|
-
SelectItemText,
|
|
396
|
-
SelectTrigger,
|
|
397
|
-
SelectValue,
|
|
398
|
-
SelectViewport,
|
|
399
|
-
Switch,
|
|
400
|
-
SwitchThumb,
|
|
401
|
-
Tabs,
|
|
402
|
-
TabsContent,
|
|
403
|
-
TabsList,
|
|
404
|
-
TabsTrigger,
|
|
405
|
-
Tooltip,
|
|
406
|
-
TooltipContent,
|
|
407
|
-
TooltipTrigger
|
|
408
|
-
};
|