@webstudio-is/sdk-components-react-radix 0.209.0 → 0.212.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/accordion.js +23 -22
- package/lib/accordion.ws.js +51 -50
- package/lib/checkbox.template.js +1 -1
- package/lib/checkbox.ws.js +19 -18
- package/lib/collapsible.ws.js +27 -26
- package/lib/dialog.ws.js +61 -60
- package/lib/navigation-menu.js +21 -20
- package/lib/navigation-menu.ws.js +56 -53
- package/lib/popover.ws.js +24 -23
- package/lib/radio-group.ws.js +33 -32
- package/lib/select.ws.js +69 -68
- package/lib/shared/meta.js +13 -0
- package/lib/sheet.template.js +13 -13
- package/lib/switch.ws.js +21 -20
- package/lib/tabs.js +40 -39
- package/lib/tabs.ws.js +37 -36
- package/lib/tooltip.ws.js +27 -26
- package/lib/types/shared/meta.d.ts +1 -0
- package/lib/types/shared/proxy.d.ts +1 -0
- package/package.json +7 -7
package/lib/accordion.js
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as m } from "react";
|
|
3
3
|
import { Root as f, Item as g, Header as p, Trigger as A, Content as l } from "@radix-ui/react-accordion";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import { getIndexWithinAncestorFromProps as u } from "@webstudio-is/sdk/runtime";
|
|
5
|
+
import { getClosestInstance as a } from "@webstudio-is/react-sdk/runtime";
|
|
6
|
+
const $ = m((t, o) => /* @__PURE__ */ d(f, { ref: o, type: "single", ...t })), k = m(({ value: t, ...o }, e) => {
|
|
7
|
+
const n = u(o);
|
|
8
|
+
return /* @__PURE__ */ d(g, { ref: e, value: t ?? n ?? "", ...o });
|
|
9
|
+
}), v = p, w = A, y = l, c = "@webstudio-is/sdk-components-react-radix", H = {
|
|
10
|
+
onNavigatorSelect: (t, o) => {
|
|
10
11
|
var e;
|
|
11
|
-
for (const
|
|
12
|
-
if (
|
|
12
|
+
for (const n of o.instancePath)
|
|
13
|
+
if (n.component === `${c}:AccordionContent`) {
|
|
13
14
|
const i = a(
|
|
14
15
|
o.instancePath,
|
|
15
|
-
|
|
16
|
-
`${
|
|
17
|
-
),
|
|
16
|
+
n,
|
|
17
|
+
`${c}:Accordion`
|
|
18
|
+
), r = a(
|
|
18
19
|
o.instancePath,
|
|
19
|
-
|
|
20
|
-
`${
|
|
20
|
+
n,
|
|
21
|
+
`${c}:AccordionItem`
|
|
21
22
|
);
|
|
22
|
-
if (i &&
|
|
23
|
-
const s =
|
|
24
|
-
s &&
|
|
23
|
+
if (i && r) {
|
|
24
|
+
const s = t.getPropValue(r, "value") ?? ((e = t.indexesWithinAncestors.get(r.id)) == null ? void 0 : e.toString());
|
|
25
|
+
s && t.setMemoryProp(i, "value", s);
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
$ as Accordion,
|
|
32
|
+
y as AccordionContent,
|
|
33
|
+
v as AccordionHeader,
|
|
34
|
+
k as AccordionItem,
|
|
35
|
+
w as AccordionTrigger,
|
|
36
|
+
H as hooksAccordion
|
|
36
37
|
};
|
package/lib/accordion.ws.js
CHANGED
|
@@ -1,57 +1,58 @@
|
|
|
1
|
-
import { AccordionIcon as
|
|
2
|
-
import { defaultStates as
|
|
3
|
-
import { h3 as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { AccordionIcon as e, ItemIcon as n, HeaderIcon as r, TriggerIcon as c, ContentIcon as i } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as a } from "@webstudio-is/sdk";
|
|
3
|
+
import { h3 as p, button as s, div as d } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { radix as o } from "./shared/meta.js";
|
|
5
|
+
import { buttonReset as m } from "./shared/preset-styles.js";
|
|
6
|
+
import { propsAccordion as l, propsAccordionItem as A, propsAccordionHeader as I, propsAccordionTrigger as g, propsAccordionContent as u } from "./__generated__/accordion.props.js";
|
|
7
|
+
const t = {
|
|
8
|
+
div: d
|
|
9
|
+
}, H = {
|
|
9
10
|
type: "container",
|
|
10
|
-
icon:
|
|
11
|
-
presetStyle:
|
|
11
|
+
icon: e,
|
|
12
|
+
presetStyle: t,
|
|
12
13
|
constraints: [
|
|
13
14
|
{
|
|
14
15
|
relation: "descendant",
|
|
15
|
-
component: { $eq:
|
|
16
|
+
component: { $eq: o.AccordionItem }
|
|
16
17
|
}
|
|
17
18
|
]
|
|
18
|
-
},
|
|
19
|
+
}, C = {
|
|
19
20
|
type: "container",
|
|
20
21
|
label: "Item",
|
|
21
|
-
icon:
|
|
22
|
+
icon: n,
|
|
22
23
|
constraints: [
|
|
23
24
|
{
|
|
24
25
|
relation: "ancestor",
|
|
25
|
-
component: { $eq:
|
|
26
|
+
component: { $eq: o.Accordion }
|
|
26
27
|
},
|
|
27
28
|
{
|
|
28
29
|
relation: "descendant",
|
|
29
|
-
component: { $eq:
|
|
30
|
+
component: { $eq: o.AccordionHeader }
|
|
30
31
|
},
|
|
31
32
|
{
|
|
32
33
|
relation: "descendant",
|
|
33
|
-
component: { $eq:
|
|
34
|
+
component: { $eq: o.AccordionContent }
|
|
34
35
|
}
|
|
35
36
|
],
|
|
36
|
-
indexWithinAncestor:
|
|
37
|
-
presetStyle:
|
|
38
|
-
},
|
|
37
|
+
indexWithinAncestor: o.Accordion,
|
|
38
|
+
presetStyle: t
|
|
39
|
+
}, T = {
|
|
39
40
|
type: "container",
|
|
40
41
|
label: "Item Header",
|
|
41
|
-
icon:
|
|
42
|
+
icon: r,
|
|
42
43
|
constraints: [
|
|
43
44
|
{
|
|
44
45
|
relation: "ancestor",
|
|
45
|
-
component: { $eq:
|
|
46
|
+
component: { $eq: o.AccordionItem }
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
49
|
relation: "descendant",
|
|
49
|
-
component: { $eq:
|
|
50
|
+
component: { $eq: o.AccordionTrigger }
|
|
50
51
|
}
|
|
51
52
|
],
|
|
52
53
|
presetStyle: {
|
|
53
54
|
h3: [
|
|
54
|
-
...
|
|
55
|
+
...p,
|
|
55
56
|
{
|
|
56
57
|
property: "margin-top",
|
|
57
58
|
value: { type: "unit", unit: "px", value: 0 }
|
|
@@ -62,16 +63,16 @@ const o = {
|
|
|
62
63
|
}
|
|
63
64
|
]
|
|
64
65
|
}
|
|
65
|
-
},
|
|
66
|
+
}, x = {
|
|
66
67
|
type: "container",
|
|
67
68
|
label: "Item Trigger",
|
|
68
|
-
icon:
|
|
69
|
+
icon: c,
|
|
69
70
|
constraints: {
|
|
70
71
|
relation: "ancestor",
|
|
71
|
-
component: { $eq:
|
|
72
|
+
component: { $eq: o.AccordionHeader }
|
|
72
73
|
},
|
|
73
74
|
states: [
|
|
74
|
-
...
|
|
75
|
+
...a,
|
|
75
76
|
{
|
|
76
77
|
category: "component-states",
|
|
77
78
|
label: "Open",
|
|
@@ -79,39 +80,39 @@ const o = {
|
|
|
79
80
|
}
|
|
80
81
|
],
|
|
81
82
|
presetStyle: {
|
|
82
|
-
button: [
|
|
83
|
+
button: [s, m].flat()
|
|
83
84
|
}
|
|
84
|
-
},
|
|
85
|
+
}, M = {
|
|
85
86
|
type: "container",
|
|
86
87
|
label: "Item Content",
|
|
87
|
-
icon:
|
|
88
|
+
icon: i,
|
|
88
89
|
constraints: {
|
|
89
90
|
relation: "ancestor",
|
|
90
|
-
component: { $eq:
|
|
91
|
+
component: { $eq: o.AccordionItem }
|
|
91
92
|
},
|
|
92
|
-
presetStyle:
|
|
93
|
-
}, M = {
|
|
94
|
-
props: m,
|
|
95
|
-
initialProps: ["value", "collapsible"]
|
|
96
|
-
}, x = {
|
|
97
|
-
props: l,
|
|
98
|
-
initialProps: ["value"]
|
|
93
|
+
presetStyle: t
|
|
99
94
|
}, S = {
|
|
100
|
-
props:
|
|
95
|
+
props: l,
|
|
96
|
+
initialProps: ["value", "collapsible"]
|
|
101
97
|
}, h = {
|
|
102
|
-
props:
|
|
98
|
+
props: A,
|
|
99
|
+
initialProps: ["value"]
|
|
103
100
|
}, P = {
|
|
101
|
+
props: I
|
|
102
|
+
}, O = {
|
|
104
103
|
props: g
|
|
104
|
+
}, R = {
|
|
105
|
+
props: u
|
|
105
106
|
};
|
|
106
107
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
H as metaAccordion,
|
|
109
|
+
M as metaAccordionContent,
|
|
110
|
+
T as metaAccordionHeader,
|
|
111
|
+
C as metaAccordionItem,
|
|
112
|
+
x as metaAccordionTrigger,
|
|
113
|
+
S as propsMetaAccordion,
|
|
114
|
+
R as propsMetaAccordionContent,
|
|
115
|
+
P as propsMetaAccordionHeader,
|
|
116
|
+
h as propsMetaAccordionItem,
|
|
117
|
+
O as propsMetaAccordionTrigger
|
|
117
118
|
};
|
package/lib/checkbox.template.js
CHANGED
package/lib/checkbox.ws.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { CheckboxCheckedIcon as
|
|
1
|
+
import { CheckboxCheckedIcon as o, TriggerIcon as c } from "@webstudio-is/icons/svg";
|
|
2
2
|
import { defaultStates as e } from "@webstudio-is/sdk";
|
|
3
|
-
import { button as
|
|
3
|
+
import { button as r, span as n } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { radix as t } from "./shared/meta.js";
|
|
4
5
|
import { buttonReset as a } from "./shared/preset-styles.js";
|
|
5
|
-
import { propsCheckbox as
|
|
6
|
-
const
|
|
6
|
+
import { propsCheckbox as s, propsCheckboxIndicator as p } from "./__generated__/checkbox.props.js";
|
|
7
|
+
const b = {
|
|
7
8
|
type: "container",
|
|
8
9
|
constraints: {
|
|
9
10
|
relation: "descendant",
|
|
10
|
-
component: { $eq:
|
|
11
|
+
component: { $eq: t.CheckboxIndicator }
|
|
11
12
|
},
|
|
12
|
-
icon:
|
|
13
|
+
icon: o,
|
|
13
14
|
states: [
|
|
14
15
|
...e,
|
|
15
16
|
{
|
|
@@ -24,28 +25,28 @@ const k = {
|
|
|
24
25
|
}
|
|
25
26
|
],
|
|
26
27
|
presetStyle: {
|
|
27
|
-
button: [
|
|
28
|
+
button: [r, a].flat()
|
|
28
29
|
}
|
|
29
|
-
},
|
|
30
|
+
}, x = {
|
|
30
31
|
type: "container",
|
|
31
32
|
constraints: {
|
|
32
33
|
relation: "ancestor",
|
|
33
|
-
component: { $eq:
|
|
34
|
+
component: { $eq: t.Checkbox }
|
|
34
35
|
},
|
|
35
|
-
icon:
|
|
36
|
+
icon: c,
|
|
36
37
|
states: e,
|
|
37
38
|
presetStyle: {
|
|
38
39
|
span: n
|
|
39
40
|
}
|
|
40
|
-
}, b = {
|
|
41
|
-
props: r,
|
|
42
|
-
initialProps: ["id", "className", "name", "value", "required", "checked"]
|
|
43
41
|
}, C = {
|
|
44
|
-
props: s
|
|
42
|
+
props: s,
|
|
43
|
+
initialProps: ["id", "className", "name", "value", "required", "checked"]
|
|
44
|
+
}, f = {
|
|
45
|
+
props: p
|
|
45
46
|
};
|
|
46
47
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
b as metaCheckbox,
|
|
49
|
+
x as metaCheckboxIndicator,
|
|
50
|
+
C as propsMetaCheckbox,
|
|
51
|
+
f as propsMetaCheckboxIndicator
|
|
51
52
|
};
|
package/lib/collapsible.ws.js
CHANGED
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import { CollapsibleIcon as
|
|
2
|
-
import { div as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { CollapsibleIcon as n, TriggerIcon as t, ContentIcon as l } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { div as e } from "@webstudio-is/sdk/normalize.css";
|
|
3
|
+
import { radix as o } from "./shared/meta.js";
|
|
4
|
+
import { propsCollapsible as p, propsCollapsibleTrigger as r, propsCollapsibleContent as i } from "./__generated__/collapsible.props.js";
|
|
5
|
+
const m = {
|
|
5
6
|
type: "container",
|
|
6
7
|
constraints: [
|
|
7
8
|
{
|
|
8
9
|
relation: "descendant",
|
|
9
|
-
component: { $eq:
|
|
10
|
+
component: { $eq: o.CollapsibleTrigger }
|
|
10
11
|
},
|
|
11
12
|
{
|
|
12
13
|
relation: "descendant",
|
|
13
|
-
component: { $eq:
|
|
14
|
+
component: { $eq: o.CollapsibleContent }
|
|
14
15
|
}
|
|
15
16
|
],
|
|
16
17
|
presetStyle: {
|
|
17
|
-
div:
|
|
18
|
+
div: e
|
|
18
19
|
},
|
|
19
|
-
icon:
|
|
20
|
-
},
|
|
20
|
+
icon: n
|
|
21
|
+
}, b = {
|
|
21
22
|
type: "container",
|
|
22
|
-
icon:
|
|
23
|
+
icon: t,
|
|
23
24
|
constraints: {
|
|
24
25
|
relation: "ancestor",
|
|
25
|
-
component: { $eq:
|
|
26
|
+
component: { $eq: o.Collapsible }
|
|
26
27
|
}
|
|
27
|
-
},
|
|
28
|
+
}, g = {
|
|
28
29
|
type: "container",
|
|
29
30
|
presetStyle: {
|
|
30
|
-
div:
|
|
31
|
+
div: e
|
|
31
32
|
},
|
|
32
|
-
icon:
|
|
33
|
+
icon: l,
|
|
33
34
|
constraints: {
|
|
34
35
|
relation: "ancestor",
|
|
35
|
-
component: { $eq:
|
|
36
|
+
component: { $eq: o.Collapsible }
|
|
36
37
|
}
|
|
37
|
-
},
|
|
38
|
+
}, d = {
|
|
38
39
|
props: {
|
|
39
|
-
...
|
|
40
|
+
...p,
|
|
40
41
|
onOpenChange: {
|
|
41
42
|
type: "action",
|
|
42
43
|
control: "action",
|
|
@@ -44,16 +45,16 @@ const c = {
|
|
|
44
45
|
}
|
|
45
46
|
},
|
|
46
47
|
initialProps: ["open", "onOpenChange"]
|
|
47
|
-
},
|
|
48
|
-
props: p
|
|
49
|
-
}, d = {
|
|
48
|
+
}, y = {
|
|
50
49
|
props: r
|
|
50
|
+
}, f = {
|
|
51
|
+
props: i
|
|
51
52
|
};
|
|
52
53
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
m as metaCollapsible,
|
|
55
|
+
g as metaCollapsibleContent,
|
|
56
|
+
b as metaCollapsibleTrigger,
|
|
57
|
+
d as propsMetaCollapsible,
|
|
58
|
+
f as propsMetaCollapsibleContent,
|
|
59
|
+
y as propsMetaCollapsibleTrigger
|
|
59
60
|
};
|
package/lib/dialog.ws.js
CHANGED
|
@@ -1,138 +1,139 @@
|
|
|
1
|
-
import { TriggerIcon as
|
|
2
|
-
import { defaultStates as
|
|
3
|
-
import { div as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { TriggerIcon as n, OverlayIcon as e, ContentIcon as i, HeadingIcon as a, TextIcon as r, ButtonElementIcon as s, DialogIcon as p } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as l } from "@webstudio-is/sdk";
|
|
3
|
+
import { div as t, h2 as c, p as g, button as D } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { radix as o } from "./shared/meta.js";
|
|
5
|
+
import { propsDialog as m, propsDialogTrigger as y, propsDialogContent as C, propsDialogOverlay as d, propsDialogClose as q, propsDialogTitle as $, propsDialogDescription as T } from "./__generated__/dialog.props.js";
|
|
6
|
+
import { buttonReset as f } from "./shared/preset-styles.js";
|
|
7
|
+
const S = {
|
|
7
8
|
type: "container",
|
|
8
|
-
icon:
|
|
9
|
+
icon: n,
|
|
9
10
|
constraints: {
|
|
10
11
|
relation: "ancestor",
|
|
11
|
-
component: { $eq:
|
|
12
|
+
component: { $eq: o.Dialog }
|
|
12
13
|
}
|
|
13
|
-
},
|
|
14
|
+
}, b = {
|
|
14
15
|
type: "container",
|
|
15
16
|
presetStyle: {
|
|
16
|
-
div:
|
|
17
|
+
div: t
|
|
17
18
|
},
|
|
18
|
-
icon:
|
|
19
|
+
icon: e,
|
|
19
20
|
constraints: [
|
|
20
21
|
{
|
|
21
22
|
relation: "ancestor",
|
|
22
|
-
component: { $eq:
|
|
23
|
+
component: { $eq: o.Dialog }
|
|
23
24
|
},
|
|
24
25
|
{
|
|
25
26
|
relation: "descendant",
|
|
26
|
-
component: { $eq:
|
|
27
|
+
component: { $eq: o.DialogContent }
|
|
27
28
|
}
|
|
28
29
|
]
|
|
29
|
-
},
|
|
30
|
+
}, x = {
|
|
30
31
|
type: "container",
|
|
31
32
|
presetStyle: {
|
|
32
|
-
div:
|
|
33
|
+
div: t
|
|
33
34
|
},
|
|
34
|
-
icon:
|
|
35
|
+
icon: i,
|
|
35
36
|
constraints: [
|
|
36
37
|
{
|
|
37
38
|
relation: "ancestor",
|
|
38
|
-
component: { $eq:
|
|
39
|
+
component: { $eq: o.DialogOverlay }
|
|
39
40
|
},
|
|
40
41
|
// often deleted by users
|
|
41
42
|
// though radix starts throwing warnings in console
|
|
42
43
|
/*
|
|
43
44
|
{
|
|
44
45
|
relation: "descendant",
|
|
45
|
-
component: { $eq:
|
|
46
|
+
component: { $eq: radix.DialogTitle },
|
|
46
47
|
},
|
|
47
48
|
{
|
|
48
49
|
relation: "descendant",
|
|
49
|
-
component: { $eq:
|
|
50
|
+
component: { $eq: radix.DialogDescription },
|
|
50
51
|
},
|
|
51
52
|
*/
|
|
52
53
|
{
|
|
53
54
|
relation: "descendant",
|
|
54
|
-
component: { $eq:
|
|
55
|
+
component: { $eq: o.DialogClose }
|
|
55
56
|
}
|
|
56
57
|
]
|
|
57
|
-
},
|
|
58
|
+
}, B = {
|
|
58
59
|
type: "container",
|
|
59
60
|
presetStyle: {
|
|
60
|
-
h2:
|
|
61
|
+
h2: c
|
|
61
62
|
},
|
|
62
|
-
icon:
|
|
63
|
+
icon: a,
|
|
63
64
|
constraints: {
|
|
64
65
|
relation: "ancestor",
|
|
65
|
-
component: { $eq:
|
|
66
|
+
component: { $eq: o.DialogContent }
|
|
66
67
|
}
|
|
67
|
-
},
|
|
68
|
+
}, h = {
|
|
68
69
|
type: "container",
|
|
69
70
|
presetStyle: {
|
|
70
|
-
p:
|
|
71
|
+
p: g
|
|
71
72
|
},
|
|
72
|
-
icon:
|
|
73
|
+
icon: r,
|
|
73
74
|
constraints: {
|
|
74
75
|
relation: "ancestor",
|
|
75
|
-
component: { $eq:
|
|
76
|
+
component: { $eq: o.DialogContent }
|
|
76
77
|
}
|
|
77
|
-
},
|
|
78
|
+
}, E = {
|
|
78
79
|
type: "container",
|
|
79
80
|
presetStyle: {
|
|
80
|
-
button: [
|
|
81
|
+
button: [f, D].flat()
|
|
81
82
|
},
|
|
82
|
-
states:
|
|
83
|
-
icon:
|
|
83
|
+
states: l,
|
|
84
|
+
icon: s,
|
|
84
85
|
label: "Close Button",
|
|
85
86
|
constraints: {
|
|
86
87
|
relation: "ancestor",
|
|
87
|
-
component: { $eq:
|
|
88
|
+
component: { $eq: o.DialogContent }
|
|
88
89
|
}
|
|
89
|
-
},
|
|
90
|
+
}, H = {
|
|
90
91
|
type: "container",
|
|
91
|
-
icon:
|
|
92
|
+
icon: p,
|
|
92
93
|
constraints: [
|
|
93
94
|
{
|
|
94
95
|
relation: "descendant",
|
|
95
|
-
component: { $eq:
|
|
96
|
+
component: { $eq: o.DialogTrigger }
|
|
96
97
|
},
|
|
97
98
|
{
|
|
98
99
|
relation: "descendant",
|
|
99
|
-
component: { $eq:
|
|
100
|
+
component: { $eq: o.DialogOverlay }
|
|
100
101
|
}
|
|
101
102
|
]
|
|
102
|
-
}, E = {
|
|
103
|
-
props: D,
|
|
104
|
-
initialProps: []
|
|
105
|
-
}, H = {
|
|
106
|
-
props: m
|
|
107
103
|
}, R = {
|
|
108
|
-
props:
|
|
104
|
+
props: m,
|
|
109
105
|
initialProps: []
|
|
110
106
|
}, j = {
|
|
107
|
+
props: y
|
|
108
|
+
}, k = {
|
|
111
109
|
props: C,
|
|
112
110
|
initialProps: []
|
|
113
|
-
},
|
|
111
|
+
}, w = {
|
|
114
112
|
props: d,
|
|
115
113
|
initialProps: []
|
|
116
|
-
},
|
|
114
|
+
}, z = {
|
|
117
115
|
props: q,
|
|
118
116
|
initialProps: []
|
|
119
|
-
},
|
|
117
|
+
}, A = {
|
|
120
118
|
props: $,
|
|
121
119
|
initialProps: []
|
|
120
|
+
}, F = {
|
|
121
|
+
props: T,
|
|
122
|
+
initialProps: []
|
|
122
123
|
};
|
|
123
124
|
export {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
125
|
+
H as metaDialog,
|
|
126
|
+
E as metaDialogClose,
|
|
127
|
+
x as metaDialogContent,
|
|
128
|
+
h as metaDialogDescription,
|
|
129
|
+
b as metaDialogOverlay,
|
|
130
|
+
B as metaDialogTitle,
|
|
131
|
+
S as metaDialogTrigger,
|
|
132
|
+
R as propsMetaDialog,
|
|
133
|
+
z as propsMetaDialogClose,
|
|
134
|
+
k as propsMetaDialogContent,
|
|
135
|
+
F as propsMetaDialogDescription,
|
|
136
|
+
w as propsMetaDialogOverlay,
|
|
137
|
+
A as propsMetaDialogTitle,
|
|
138
|
+
j as propsMetaDialogTrigger
|
|
138
139
|
};
|
package/lib/navigation-menu.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c, useContext as v, Children as g } from "react";
|
|
2
3
|
import * as a from "@radix-ui/react-navigation-menu";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
const { renderer: t } = f
|
|
4
|
+
import { getIndexWithinAncestorFromProps as l } from "@webstudio-is/sdk/runtime";
|
|
5
|
+
import { ReactSdkContext as f, getClosestInstance as d } from "@webstudio-is/react-sdk/runtime";
|
|
6
|
+
const C = c(({ value: o, ...n }, e) => {
|
|
7
|
+
const { renderer: t } = v(f);
|
|
7
8
|
let i = o;
|
|
8
9
|
return t === "canvas" && (i = i === "" ? "-1" : i), /* @__PURE__ */ r(a.Root, { ref: e, value: i, ...n });
|
|
9
|
-
}),
|
|
10
|
+
}), P = a.List, k = a.Viewport, x = a.Content, A = c(({ value: o, ...n }, e) => {
|
|
10
11
|
const t = l(n);
|
|
11
12
|
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
13
|
}), I = c(({ children: o, ...n }, e) => {
|
|
16
|
-
const t =
|
|
14
|
+
const t = g.toArray(o)[0];
|
|
15
|
+
return /* @__PURE__ */ r(a.Link, { asChild: !0, ref: e, ...n, children: t ?? /* @__PURE__ */ r("a", { children: "Add link component" }) });
|
|
16
|
+
}), $ = c(({ children: o, ...n }, e) => {
|
|
17
|
+
const t = g.toArray(o)[0];
|
|
17
18
|
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
|
+
}), s = "@webstudio-is/sdk-components-react-radix", w = {
|
|
19
20
|
onNavigatorUnselect: (o, n) => {
|
|
20
21
|
for (const e of n.instancePath)
|
|
21
22
|
if (e.component === `${s}:NavigationMenuContent`) {
|
|
@@ -42,18 +43,18 @@ const p = c(({ value: o, ...n }, e) => {
|
|
|
42
43
|
);
|
|
43
44
|
if (u === void 0 || i === void 0)
|
|
44
45
|
return;
|
|
45
|
-
const
|
|
46
|
-
|
|
46
|
+
const m = o.getPropValue(u, "value") ?? ((e = o.indexesWithinAncestors.get(u.id)) == null ? void 0 : e.toString());
|
|
47
|
+
m && o.setMemoryProp(i, "value", m);
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
C as NavigationMenu,
|
|
53
|
+
x as NavigationMenuContent,
|
|
54
|
+
A as NavigationMenuItem,
|
|
55
|
+
I as NavigationMenuLink,
|
|
56
|
+
P as NavigationMenuList,
|
|
57
|
+
$ as NavigationMenuTrigger,
|
|
58
|
+
k as NavigationMenuViewport,
|
|
59
|
+
w as hooksNavigationMenu
|
|
59
60
|
};
|