@webstudio-is/sdk-components-react-radix 0.191.4 → 0.192.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/__generated__/accordion.props.js +2631 -0
- package/lib/__generated__/checkbox.props.js +1084 -0
- package/lib/__generated__/collapsible.props.js +1024 -0
- package/lib/__generated__/dialog.props.js +2599 -0
- package/lib/__generated__/label.props.js +519 -0
- package/lib/__generated__/navigation-menu.props.js +3660 -0
- package/lib/__generated__/popover.props.js +564 -0
- package/lib/__generated__/radio-group.props.js +1619 -0
- package/lib/__generated__/select.props.js +3681 -0
- package/lib/__generated__/switch.props.js +1084 -0
- package/lib/__generated__/tabs.props.js +2121 -0
- package/lib/__generated__/tooltip.props.js +575 -0
- package/lib/accordion.js +36 -0
- package/lib/accordion.ws.js +250 -0
- package/lib/checkbox.js +8 -0
- package/lib/checkbox.ws.js +141 -0
- package/lib/collapsible.js +26 -0
- package/lib/collapsible.ws.js +92 -0
- package/lib/components.js +62 -0
- package/lib/dialog.js +84 -0
- package/lib/dialog.ws.js +260 -0
- package/lib/hooks.js +23 -0
- package/lib/label.js +7 -0
- package/lib/label.ws.js +43 -0
- package/lib/metas.js +64 -0
- package/lib/navigation-menu.js +59 -0
- package/lib/navigation-menu.ws.js +475 -0
- package/lib/popover.js +48 -0
- package/lib/popover.ws.js +96 -0
- package/lib/props.js +62 -0
- package/lib/radio-group.js +9 -0
- package/lib/radio-group.ws.js +158 -0
- package/lib/select.js +46 -0
- package/lib/select.ws.js +305 -0
- package/lib/sheet.js +43 -0
- package/lib/sheet.ws.js +217 -0
- package/lib/switch.js +8 -0
- package/lib/switch.ws.js +140 -0
- package/lib/tabs.js +31 -0
- package/lib/tabs.ws.js +183 -0
- package/lib/theme/__generated__/tailwind-theme.js +503 -0
- package/lib/theme/styles.js +52 -0
- package/lib/theme/tailwind-classes.js +474 -0
- package/lib/tooltip.js +45 -0
- package/lib/tooltip.ws.js +97 -0
- package/lib/types/__generated__/accordion.props.d.ts +6 -0
- package/lib/types/__generated__/checkbox.props.d.ts +3 -0
- package/lib/types/__generated__/collapsible.props.d.ts +4 -0
- package/lib/types/__generated__/dialog.props.d.ts +8 -0
- package/lib/types/__generated__/label.props.d.ts +2 -0
- package/lib/types/__generated__/navigation-menu.props.d.ts +8 -0
- package/lib/types/__generated__/popover.props.d.ts +4 -0
- package/lib/types/__generated__/radio-group.props.d.ts +4 -0
- package/lib/types/__generated__/select.props.d.ts +9 -0
- package/lib/types/__generated__/sheet.props.d.ts +8 -0
- package/lib/types/__generated__/switch.props.d.ts +3 -0
- package/lib/types/__generated__/tabs.props.d.ts +5 -0
- package/lib/types/__generated__/tooltip.props.d.ts +4 -0
- package/lib/types/accordion.d.ts +11 -0
- package/lib/types/accordion.ws.d.ts +11 -0
- package/lib/types/checkbox.d.ts +9 -0
- package/lib/types/checkbox.ws.d.ts +5 -0
- package/lib/types/collapsible.d.ts +15 -0
- package/lib/types/collapsible.ws.d.ts +7 -0
- package/lib/types/components.d.ts +12 -0
- package/lib/types/dialog.d.ts +23 -0
- package/lib/types/dialog.ws.d.ts +23 -0
- package/lib/types/hooks.d.ts +2 -0
- package/lib/types/label.d.ts +2 -0
- package/lib/types/label.ws.d.ts +3 -0
- package/lib/types/metas.d.ts +13 -0
- package/lib/types/navigation-menu.d.ts +10 -0
- package/lib/types/navigation-menu.ws.d.ts +15 -0
- package/lib/types/popover.d.ts +15 -0
- package/lib/types/popover.ws.d.ts +15 -0
- package/lib/types/props-descriptions.d.ts +29 -0
- package/lib/types/props.d.ts +12 -0
- package/lib/types/radio-group.d.ts +5 -0
- package/lib/types/radio-group.ws.d.ts +7 -0
- package/lib/types/select.d.ts +14 -0
- package/lib/types/select.ws.d.ts +17 -0
- package/lib/types/sheet.d.ts +16 -0
- package/lib/types/sheet.ws.d.ts +10 -0
- package/lib/types/switch.d.ts +4 -0
- package/lib/types/switch.ws.d.ts +5 -0
- package/lib/types/tabs.d.ts +12 -0
- package/lib/types/tabs.ws.d.ts +9 -0
- package/lib/types/theme/__generated__/tailwind-theme.d.ts +26 -0
- package/lib/types/theme/styles.d.ts +278 -0
- package/lib/types/theme/tailwind-classes.d.ts +104 -0
- package/lib/types/theme/tailwind-colors.d.ts +31 -0
- package/lib/types/tooltip.d.ts +15 -0
- package/lib/types/tooltip.ws.d.ts +15 -0
- package/package.json +7 -7
package/lib/dialog.ws.js
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { TriggerIcon as c, ContentIcon as g, OverlayIcon as y, HeadingIcon as d, TextIcon as m, ButtonElementIcon as u, DialogIcon as D, LargeXIcon as h } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as f } from "@webstudio-is/react-sdk";
|
|
3
|
+
import { button as b, div as v, h2 as x, p as T } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { fixed as C, inset as I, z as n, bg as t, backdropBlur as P, flex as e, overflow as S, w as i, gap as a, m as w, maxW as B, border as l, p as M, shadow as k, relative as O, my as r, leading as H, text as o, tracking as E, absolute as j, right as z, top as F, rounded as L, opacity as p, items as R, justify as W, h as X, outline as $, hover as q, focus as A, ring as G } from "./theme/tailwind-classes.js";
|
|
5
|
+
import { propsDialog as J, propsDialogTrigger as K, propsDialogContent as N, propsDialogOverlay as Q, propsDialogClose as U, propsDialogTitle as V, propsDialogDescription as Y } from "./__generated__/dialog.props.js";
|
|
6
|
+
import { buttonReset as Z, getButtonStyles as _ } from "./theme/styles.js";
|
|
7
|
+
const s = {
|
|
8
|
+
div: v
|
|
9
|
+
}, ee = {
|
|
10
|
+
h2: x
|
|
11
|
+
}, te = {
|
|
12
|
+
p: T
|
|
13
|
+
}, pe = {
|
|
14
|
+
category: "hidden",
|
|
15
|
+
type: "container",
|
|
16
|
+
icon: c,
|
|
17
|
+
stylable: !1,
|
|
18
|
+
detachable: !1
|
|
19
|
+
}, se = {
|
|
20
|
+
category: "hidden",
|
|
21
|
+
type: "container",
|
|
22
|
+
presetStyle: s,
|
|
23
|
+
icon: g,
|
|
24
|
+
detachable: !1
|
|
25
|
+
}, ce = {
|
|
26
|
+
category: "hidden",
|
|
27
|
+
type: "container",
|
|
28
|
+
presetStyle: s,
|
|
29
|
+
icon: y,
|
|
30
|
+
detachable: !1
|
|
31
|
+
}, ge = {
|
|
32
|
+
category: "hidden",
|
|
33
|
+
type: "container",
|
|
34
|
+
presetStyle: ee,
|
|
35
|
+
icon: d
|
|
36
|
+
}, ye = {
|
|
37
|
+
category: "hidden",
|
|
38
|
+
type: "container",
|
|
39
|
+
presetStyle: te,
|
|
40
|
+
icon: m
|
|
41
|
+
}, de = {
|
|
42
|
+
category: "hidden",
|
|
43
|
+
type: "container",
|
|
44
|
+
presetStyle: {
|
|
45
|
+
button: [Z, b].flat()
|
|
46
|
+
},
|
|
47
|
+
states: f,
|
|
48
|
+
icon: u,
|
|
49
|
+
label: "Close Button"
|
|
50
|
+
}, me = {
|
|
51
|
+
category: "radix",
|
|
52
|
+
order: 4,
|
|
53
|
+
type: "container",
|
|
54
|
+
icon: D,
|
|
55
|
+
stylable: !1,
|
|
56
|
+
description: "Displays content with an overlay that covers the window, triggered by a button. Clicking the overlay will close the dialog.",
|
|
57
|
+
template: [
|
|
58
|
+
{
|
|
59
|
+
type: "instance",
|
|
60
|
+
component: "Dialog",
|
|
61
|
+
children: [
|
|
62
|
+
{
|
|
63
|
+
type: "instance",
|
|
64
|
+
component: "DialogTrigger",
|
|
65
|
+
children: [
|
|
66
|
+
{
|
|
67
|
+
type: "instance",
|
|
68
|
+
component: "Button",
|
|
69
|
+
styles: _("outline"),
|
|
70
|
+
children: [{ type: "text", value: "Button", placeholder: !0 }]
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: "instance",
|
|
76
|
+
component: "DialogOverlay",
|
|
77
|
+
/**
|
|
78
|
+
* fixed inset-0 z-50 bg-background/80 backdrop-blur-sm
|
|
79
|
+
* flex
|
|
80
|
+
**/
|
|
81
|
+
styles: [
|
|
82
|
+
C(),
|
|
83
|
+
I(0),
|
|
84
|
+
n(50),
|
|
85
|
+
t("background", 80),
|
|
86
|
+
P("sm"),
|
|
87
|
+
// To allow positioning Content
|
|
88
|
+
e(),
|
|
89
|
+
S("auto")
|
|
90
|
+
].flat(),
|
|
91
|
+
children: [
|
|
92
|
+
{
|
|
93
|
+
type: "instance",
|
|
94
|
+
component: "DialogContent",
|
|
95
|
+
/**
|
|
96
|
+
* fixed w-full z-50
|
|
97
|
+
* grid gap-4 max-w-lg
|
|
98
|
+
* m-auto
|
|
99
|
+
* border bg-background p-6 shadow-lg
|
|
100
|
+
**/
|
|
101
|
+
styles: [
|
|
102
|
+
i("full"),
|
|
103
|
+
n(50),
|
|
104
|
+
e(),
|
|
105
|
+
e("col"),
|
|
106
|
+
a(4),
|
|
107
|
+
w("auto"),
|
|
108
|
+
B("lg"),
|
|
109
|
+
l(),
|
|
110
|
+
t("background"),
|
|
111
|
+
M(6),
|
|
112
|
+
k("lg"),
|
|
113
|
+
O()
|
|
114
|
+
].flat(),
|
|
115
|
+
children: [
|
|
116
|
+
{
|
|
117
|
+
type: "instance",
|
|
118
|
+
component: "Box",
|
|
119
|
+
label: "Dialog Header",
|
|
120
|
+
styles: [e(), e("col"), a(1)].flat(),
|
|
121
|
+
children: [
|
|
122
|
+
{
|
|
123
|
+
type: "instance",
|
|
124
|
+
component: "DialogTitle",
|
|
125
|
+
/**
|
|
126
|
+
* text-lg leading-none tracking-tight
|
|
127
|
+
**/
|
|
128
|
+
styles: [
|
|
129
|
+
r(0),
|
|
130
|
+
H("none"),
|
|
131
|
+
o("lg"),
|
|
132
|
+
E("tight")
|
|
133
|
+
].flat(),
|
|
134
|
+
children: [
|
|
135
|
+
{
|
|
136
|
+
type: "text",
|
|
137
|
+
value: "Dialog Title you can edit",
|
|
138
|
+
placeholder: !0
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
type: "instance",
|
|
144
|
+
component: "DialogDescription",
|
|
145
|
+
/**
|
|
146
|
+
* text-sm text-muted-foreground
|
|
147
|
+
**/
|
|
148
|
+
styles: [
|
|
149
|
+
r(0),
|
|
150
|
+
o("sm"),
|
|
151
|
+
o("mutedForeground")
|
|
152
|
+
].flat(),
|
|
153
|
+
children: [
|
|
154
|
+
{
|
|
155
|
+
type: "text",
|
|
156
|
+
value: "Dialog description text you can edit",
|
|
157
|
+
placeholder: !0
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
type: "instance",
|
|
165
|
+
component: "Text",
|
|
166
|
+
children: [
|
|
167
|
+
{
|
|
168
|
+
type: "text",
|
|
169
|
+
value: "The text you can edit",
|
|
170
|
+
placeholder: !0
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
type: "instance",
|
|
176
|
+
component: "DialogClose",
|
|
177
|
+
/**
|
|
178
|
+
* absolute right-4 top-4
|
|
179
|
+
* rounded-sm opacity-70
|
|
180
|
+
* ring-offset-background
|
|
181
|
+
* hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
|
|
182
|
+
* flex items-center justify-center h-4 w-4
|
|
183
|
+
**/
|
|
184
|
+
styles: [
|
|
185
|
+
j(),
|
|
186
|
+
z(4),
|
|
187
|
+
F(4),
|
|
188
|
+
L("sm"),
|
|
189
|
+
p(70),
|
|
190
|
+
e(),
|
|
191
|
+
R("center"),
|
|
192
|
+
W("center"),
|
|
193
|
+
X(4),
|
|
194
|
+
i(4),
|
|
195
|
+
l(0),
|
|
196
|
+
t("transparent"),
|
|
197
|
+
$(),
|
|
198
|
+
q(p(100)),
|
|
199
|
+
A(G("ring", 2, "background", 2))
|
|
200
|
+
].flat(),
|
|
201
|
+
children: [
|
|
202
|
+
{
|
|
203
|
+
type: "instance",
|
|
204
|
+
component: "HtmlEmbed",
|
|
205
|
+
label: "Close Icon",
|
|
206
|
+
props: [
|
|
207
|
+
{
|
|
208
|
+
type: "string",
|
|
209
|
+
name: "code",
|
|
210
|
+
value: h
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
children: []
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
}, ue = {
|
|
225
|
+
props: J,
|
|
226
|
+
initialProps: []
|
|
227
|
+
}, De = {
|
|
228
|
+
props: K
|
|
229
|
+
}, he = {
|
|
230
|
+
props: N,
|
|
231
|
+
initialProps: []
|
|
232
|
+
}, fe = {
|
|
233
|
+
props: Q,
|
|
234
|
+
initialProps: []
|
|
235
|
+
}, be = {
|
|
236
|
+
props: U,
|
|
237
|
+
initialProps: []
|
|
238
|
+
}, ve = {
|
|
239
|
+
props: V,
|
|
240
|
+
initialProps: []
|
|
241
|
+
}, xe = {
|
|
242
|
+
props: Y,
|
|
243
|
+
initialProps: []
|
|
244
|
+
};
|
|
245
|
+
export {
|
|
246
|
+
me as metaDialog,
|
|
247
|
+
de as metaDialogClose,
|
|
248
|
+
se as metaDialogContent,
|
|
249
|
+
ye as metaDialogDescription,
|
|
250
|
+
ce as metaDialogOverlay,
|
|
251
|
+
ge as metaDialogTitle,
|
|
252
|
+
pe as metaDialogTrigger,
|
|
253
|
+
ue as propsMetaDialog,
|
|
254
|
+
be as propsMetaDialogClose,
|
|
255
|
+
he as propsMetaDialogContent,
|
|
256
|
+
xe as propsMetaDialogDescription,
|
|
257
|
+
fe as propsMetaDialogOverlay,
|
|
258
|
+
ve as propsMetaDialogTitle,
|
|
259
|
+
De as propsMetaDialogTrigger
|
|
260
|
+
};
|
package/lib/hooks.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { hooksCollapsible as o } from "./collapsible.js";
|
|
2
|
+
import { hooksTabs as r } from "./tabs.js";
|
|
3
|
+
import { hooksDialog as m } from "./dialog.js";
|
|
4
|
+
import { hooksPopover as i } from "./popover.js";
|
|
5
|
+
import { hooksSheet as t } from "./sheet.js";
|
|
6
|
+
import { hooksTooltip as p } from "./tooltip.js";
|
|
7
|
+
import { hooksAccordion as s } from "./accordion.js";
|
|
8
|
+
import { hooksNavigationMenu as h } from "./navigation-menu.js";
|
|
9
|
+
import { hooksSelect as k } from "./select.js";
|
|
10
|
+
const S = [
|
|
11
|
+
o,
|
|
12
|
+
r,
|
|
13
|
+
m,
|
|
14
|
+
i,
|
|
15
|
+
t,
|
|
16
|
+
p,
|
|
17
|
+
s,
|
|
18
|
+
h,
|
|
19
|
+
k
|
|
20
|
+
];
|
|
21
|
+
export {
|
|
22
|
+
S as hooks
|
|
23
|
+
};
|
package/lib/label.js
ADDED
package/lib/label.ws.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { LabelIcon as e } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as o } from "@webstudio-is/react-sdk";
|
|
3
|
+
import { label as r } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as t } from "./__generated__/label.props.js";
|
|
5
|
+
import { text as a, font as l, leading as p } from "./theme/tailwind-classes.js";
|
|
6
|
+
const n = {
|
|
7
|
+
label: r
|
|
8
|
+
}, d = {
|
|
9
|
+
category: "radix",
|
|
10
|
+
order: 102,
|
|
11
|
+
type: "container",
|
|
12
|
+
icon: e,
|
|
13
|
+
presetStyle: n,
|
|
14
|
+
states: o,
|
|
15
|
+
description: "An accessible label to describe the purpose of an input. Match the “For” property on the label with the “ID” of the input to connect them.",
|
|
16
|
+
template: [
|
|
17
|
+
{
|
|
18
|
+
type: "instance",
|
|
19
|
+
component: "Label",
|
|
20
|
+
styles: [
|
|
21
|
+
// text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70
|
|
22
|
+
a("sm"),
|
|
23
|
+
l("medium"),
|
|
24
|
+
p("none")
|
|
25
|
+
// We are not supporting peer like styles yet
|
|
26
|
+
].flat(),
|
|
27
|
+
children: [{ type: "text", value: "Form Label", placeholder: !0 }]
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}, f = {
|
|
31
|
+
props: {
|
|
32
|
+
...t,
|
|
33
|
+
htmlFor: {
|
|
34
|
+
...t.htmlFor,
|
|
35
|
+
label: "For"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
initialProps: ["id", "className", "htmlFor"]
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
d as meta,
|
|
42
|
+
f as propsMeta
|
|
43
|
+
};
|
package/lib/metas.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { metaCollapsible as t, metaCollapsibleContent as o, metaCollapsibleTrigger as i } from "./collapsible.ws.js";
|
|
2
|
+
import { metaDialog as n, metaDialogClose as m, metaDialogContent as s, metaDialogDescription as l, metaDialogOverlay as g, metaDialogTitle as c, metaDialogTrigger as p } from "./dialog.ws.js";
|
|
3
|
+
import { meta as C } from "./sheet.ws.js";
|
|
4
|
+
import { metaPopover as u, metaPopoverContent as v, metaPopoverTrigger as b } from "./popover.ws.js";
|
|
5
|
+
import { metaTooltip as x, metaTooltipContent as I, metaTooltipTrigger as D } from "./tooltip.ws.js";
|
|
6
|
+
import { metaTabs as N, metaTabsContent as f, metaTabsList as h, metaTabsTrigger as A } from "./tabs.ws.js";
|
|
7
|
+
import { meta as L } from "./label.ws.js";
|
|
8
|
+
import { metaAccordion as G, metaAccordionContent as P, metaAccordionHeader as R, metaAccordionItem as V, metaAccordionTrigger as y } from "./accordion.ws.js";
|
|
9
|
+
import { metaNavigationMenu as O, metaNavigationMenuContent as j, metaNavigationMenuItem as q, metaNavigationMenuLink as z, metaNavigationMenuList as B, metaNavigationMenuTrigger as E, metaNavigationMenuViewport as F } from "./navigation-menu.ws.js";
|
|
10
|
+
import { metaSelect as K, metaSelectContent as Q, metaSelectItem as U, metaSelectItemIndicator as W, metaSelectItemText as X, metaSelectTrigger as Y, metaSelectValue as Z, metaSelectViewport as _ } from "./select.ws.js";
|
|
11
|
+
import { metaSwitch as ee, metaSwitchThumb as ae } from "./switch.ws.js";
|
|
12
|
+
import { metaCheckbox as oe, metaCheckboxIndicator as ie } from "./checkbox.ws.js";
|
|
13
|
+
import { metaRadioGroup as ne, metaRadioGroupIndicator as me, metaRadioGroupItem as se } from "./radio-group.ws.js";
|
|
14
|
+
export {
|
|
15
|
+
G as Accordion,
|
|
16
|
+
P as AccordionContent,
|
|
17
|
+
R as AccordionHeader,
|
|
18
|
+
V as AccordionItem,
|
|
19
|
+
y as AccordionTrigger,
|
|
20
|
+
oe as Checkbox,
|
|
21
|
+
ie as CheckboxIndicator,
|
|
22
|
+
t as Collapsible,
|
|
23
|
+
o as CollapsibleContent,
|
|
24
|
+
i as CollapsibleTrigger,
|
|
25
|
+
n as Dialog,
|
|
26
|
+
m as DialogClose,
|
|
27
|
+
s as DialogContent,
|
|
28
|
+
l as DialogDescription,
|
|
29
|
+
g as DialogOverlay,
|
|
30
|
+
c as DialogTitle,
|
|
31
|
+
p as DialogTrigger,
|
|
32
|
+
L as Label,
|
|
33
|
+
O as NavigationMenu,
|
|
34
|
+
j as NavigationMenuContent,
|
|
35
|
+
q as NavigationMenuItem,
|
|
36
|
+
z as NavigationMenuLink,
|
|
37
|
+
B as NavigationMenuList,
|
|
38
|
+
E as NavigationMenuTrigger,
|
|
39
|
+
F as NavigationMenuViewport,
|
|
40
|
+
u as Popover,
|
|
41
|
+
v as PopoverContent,
|
|
42
|
+
b as PopoverTrigger,
|
|
43
|
+
ne as RadioGroup,
|
|
44
|
+
me as RadioGroupIndicator,
|
|
45
|
+
se as RadioGroupItem,
|
|
46
|
+
K as Select,
|
|
47
|
+
Q as SelectContent,
|
|
48
|
+
U as SelectItem,
|
|
49
|
+
W as SelectItemIndicator,
|
|
50
|
+
X as SelectItemText,
|
|
51
|
+
Y as SelectTrigger,
|
|
52
|
+
Z as SelectValue,
|
|
53
|
+
_ as SelectViewport,
|
|
54
|
+
C as Sheet,
|
|
55
|
+
ee as Switch,
|
|
56
|
+
ae as SwitchThumb,
|
|
57
|
+
N as Tabs,
|
|
58
|
+
f as TabsContent,
|
|
59
|
+
h as TabsList,
|
|
60
|
+
A as TabsTrigger,
|
|
61
|
+
x as Tooltip,
|
|
62
|
+
I as TooltipContent,
|
|
63
|
+
D as TooltipTrigger
|
|
64
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "@radix-ui/react-navigation-menu";
|
|
3
|
+
import { ReactSdkContext as v, getIndexWithinAncestorFromComponentProps as l, getClosestInstance as d } from "@webstudio-is/react-sdk/runtime";
|
|
4
|
+
import { forwardRef as c, useContext as f, Children as m } from "react";
|
|
5
|
+
const p = c(({ value: o, ...n }, e) => {
|
|
6
|
+
const { renderer: t } = f(v);
|
|
7
|
+
let i = o;
|
|
8
|
+
return t === "canvas" && (i = i === "" ? "-1" : i), /* @__PURE__ */ r(a.Root, { ref: e, value: i, ...n });
|
|
9
|
+
}), C = a.List, P = a.Viewport, k = a.Content, x = c(({ value: o, ...n }, e) => {
|
|
10
|
+
const t = l(n);
|
|
11
|
+
return /* @__PURE__ */ r(a.Item, { ref: e, value: o ?? t, ...n });
|
|
12
|
+
}), A = c(({ children: o, ...n }, e) => {
|
|
13
|
+
const t = m.toArray(o)[0];
|
|
14
|
+
return /* @__PURE__ */ r(a.Link, { asChild: !0, ref: e, ...n, children: t ?? /* @__PURE__ */ r("a", { children: "Add link component" }) });
|
|
15
|
+
}), I = c(({ children: o, ...n }, e) => {
|
|
16
|
+
const t = m.toArray(o)[0];
|
|
17
|
+
return /* @__PURE__ */ r(a.Trigger, { asChild: !0, ref: e, ...n, children: t ?? /* @__PURE__ */ r("button", { children: "Add button or link" }) });
|
|
18
|
+
}), s = "@webstudio-is/sdk-components-react-radix", $ = {
|
|
19
|
+
onNavigatorUnselect: (o, n) => {
|
|
20
|
+
for (const e of n.instancePath)
|
|
21
|
+
if (e.component === `${s}:NavigationMenuContent`) {
|
|
22
|
+
const t = d(
|
|
23
|
+
n.instancePath,
|
|
24
|
+
e,
|
|
25
|
+
`${s}:NavigationMenu`
|
|
26
|
+
);
|
|
27
|
+
t && o.setMemoryProp(t, "value", void 0);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
onNavigatorSelect: (o, n) => {
|
|
31
|
+
var e;
|
|
32
|
+
for (const t of n.instancePath)
|
|
33
|
+
if (t.component === `${s}:NavigationMenuContent`) {
|
|
34
|
+
const i = d(
|
|
35
|
+
n.instancePath,
|
|
36
|
+
t,
|
|
37
|
+
`${s}:NavigationMenu`
|
|
38
|
+
), u = d(
|
|
39
|
+
n.instancePath,
|
|
40
|
+
t,
|
|
41
|
+
`${s}:NavigationMenuItem`
|
|
42
|
+
);
|
|
43
|
+
if (u === void 0 || i === void 0)
|
|
44
|
+
return;
|
|
45
|
+
const g = o.getPropValue(u, "value") ?? ((e = o.indexesWithinAncestors.get(u.id)) == null ? void 0 : e.toString());
|
|
46
|
+
g && o.setMemoryProp(i, "value", g);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
p as NavigationMenu,
|
|
52
|
+
k as NavigationMenuContent,
|
|
53
|
+
x as NavigationMenuItem,
|
|
54
|
+
A as NavigationMenuLink,
|
|
55
|
+
C as NavigationMenuList,
|
|
56
|
+
I as NavigationMenuTrigger,
|
|
57
|
+
P as NavigationMenuViewport,
|
|
58
|
+
$ as hooksNavigationMenu
|
|
59
|
+
};
|