@webstudio-is/sdk-components-react-radix 0.0.0-5844e28 → 0.0.0-73cd6ea
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 +15 -2582
- package/lib/__generated__/checkbox.props.js +5 -1071
- package/lib/__generated__/collapsible.props.js +7 -1012
- package/lib/__generated__/dialog.props.js +10 -2585
- package/lib/__generated__/label.props.js +2 -517
- package/lib/__generated__/navigation-menu.props.js +13 -3625
- package/lib/__generated__/popover.props.js +7 -509
- package/lib/__generated__/radio-group.props.js +19 -1568
- package/lib/__generated__/select.props.js +42 -3615
- package/lib/__generated__/switch.props.js +5 -1071
- package/lib/__generated__/tabs.props.js +17 -2073
- package/lib/__generated__/tooltip.props.js +6 -503
- package/lib/accordion.js +33 -20
- package/lib/accordion.template.js +14 -14
- package/lib/accordion.ws.js +56 -93
- package/lib/checkbox.js +17 -6
- package/lib/checkbox.template.js +10 -10
- package/lib/checkbox.ws.js +26 -41
- package/lib/collapsible.js +29 -26
- package/lib/collapsible.ws.js +28 -48
- package/lib/components.js +46 -45
- package/lib/dialog.js +50 -56
- package/lib/dialog.template.js +19 -19
- package/lib/dialog.ws.js +68 -126
- package/lib/label.template.js +3 -3
- package/lib/label.ws.js +8 -15
- package/lib/metas.js +45 -44
- package/lib/navigation-menu.js +21 -20
- package/lib/navigation-menu.template.js +8 -8
- package/lib/navigation-menu.ws.js +71 -102
- package/lib/popover.js +36 -32
- package/lib/popover.template.js +50 -20
- package/lib/popover.ws.js +45 -44
- package/lib/radio-group.js +10 -7
- package/lib/radio-group.ws.js +37 -61
- package/lib/select.js +49 -37
- package/lib/select.ws.js +71 -137
- package/lib/shared/meta.js +13 -0
- package/lib/shared/preset-styles.js +29 -29
- package/lib/shared/theme.js +25 -68
- package/lib/sheet.template.js +32 -32
- package/lib/switch.js +9 -6
- package/lib/switch.template.js +9 -9
- package/lib/switch.ws.js +29 -52
- package/lib/tabs.js +50 -53
- package/lib/tabs.template.js +16 -16
- package/lib/tabs.ws.js +41 -76
- package/lib/tooltip.js +34 -31
- package/lib/tooltip.ws.js +27 -42
- package/lib/types/__generated__/popover.props.d.ts +1 -0
- package/lib/types/accordion.ws.d.ts +1 -6
- package/lib/types/checkbox.ws.d.ts +1 -3
- package/lib/types/collapsible.d.ts +2 -2
- package/lib/types/collapsible.ws.d.ts +1 -4
- package/lib/types/components.d.ts +1 -1
- package/lib/types/dialog.ws.d.ts +1 -8
- package/lib/types/label.ws.d.ts +1 -2
- package/lib/types/metas.d.ts +1 -1
- package/lib/types/navigation-menu.ws.d.ts +1 -8
- package/lib/types/popover.d.ts +1 -0
- package/lib/types/popover.ws.d.ts +2 -4
- package/lib/types/radio-group.d.ts +1 -1
- package/lib/types/radio-group.ws.d.ts +1 -4
- package/lib/types/select.d.ts +3 -3
- package/lib/types/select.ws.d.ts +1 -9
- package/lib/types/shared/meta.d.ts +1 -0
- package/lib/types/shared/preset-styles.d.ts +2 -2
- package/lib/types/shared/proxy.d.ts +1 -0
- package/lib/types/switch.ws.d.ts +1 -3
- package/lib/types/tabs.d.ts +1 -4
- package/lib/types/tabs.ws.d.ts +1 -5
- package/lib/types/tooltip.ws.d.ts +1 -4
- package/package.json +21 -27
- package/lib/props.js +0 -62
- package/lib/types/props.d.ts +0 -12
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { $ as o, PlaceholderValue as s, css as t } from "@webstudio-is/template";
|
|
3
3
|
import { radix as i } from "./shared/proxy.js";
|
|
4
|
-
import {
|
|
4
|
+
import { height as h, width as m, transition as a, spacing as c, weights as g, fontSize as f, fontSizeLineHeight as p, borderWidth as w, colors as y } from "./shared/theme.js";
|
|
5
5
|
import { ChevronDownIcon as b } from "@webstudio-is/icons/svg";
|
|
6
6
|
const n = (d, l) => /* @__PURE__ */ r(
|
|
7
7
|
i.AccordionItem,
|
|
8
8
|
{
|
|
9
9
|
"ws:style": t`
|
|
10
|
-
border-bottom: ${
|
|
10
|
+
border-bottom: ${w.DEFAULT} solid ${y.border};
|
|
11
11
|
`,
|
|
12
12
|
children: [
|
|
13
13
|
/* @__PURE__ */ e(
|
|
@@ -24,8 +24,8 @@ const n = (d, l) => /* @__PURE__ */ r(
|
|
|
24
24
|
flex: 1 1 0;
|
|
25
25
|
align-items: center;
|
|
26
26
|
justify-content: between;
|
|
27
|
-
padding: ${
|
|
28
|
-
font-weight: ${
|
|
27
|
+
padding: ${c[4]} 0;
|
|
28
|
+
font-weight: ${g.medium};
|
|
29
29
|
--accordion-trigger-icon-transform: 0deg;
|
|
30
30
|
&:hover {
|
|
31
31
|
text-decoration-line: underline;
|
|
@@ -41,11 +41,11 @@ const n = (d, l) => /* @__PURE__ */ r(
|
|
|
41
41
|
{
|
|
42
42
|
"ws:label": "Icon Container",
|
|
43
43
|
"ws:style": t`
|
|
44
|
-
rotate: --accordion-trigger-icon-transform;
|
|
45
|
-
height: ${
|
|
46
|
-
width: ${
|
|
44
|
+
rotate: var(--accordion-trigger-icon-transform);
|
|
45
|
+
height: ${h[4]};
|
|
46
|
+
width: ${m[4]};
|
|
47
47
|
flex-shrink: 0;
|
|
48
|
-
transition: ${
|
|
48
|
+
transition: ${a.all};
|
|
49
49
|
transition-duration: 200ms;
|
|
50
50
|
`,
|
|
51
51
|
children: /* @__PURE__ */ e(o.HtmlEmbed, { "ws:label": "Chevron Icon", code: b })
|
|
@@ -61,10 +61,10 @@ const n = (d, l) => /* @__PURE__ */ r(
|
|
|
61
61
|
{
|
|
62
62
|
"ws:style": t`
|
|
63
63
|
overflow: hidden;
|
|
64
|
-
font-size: ${
|
|
65
|
-
line-height: ${
|
|
66
|
-
transition: ${
|
|
67
|
-
padding-bottom: ${
|
|
64
|
+
font-size: ${f.sm};
|
|
65
|
+
line-height: ${p.sm};
|
|
66
|
+
transition: ${a.all};
|
|
67
|
+
padding-bottom: ${c[4]};
|
|
68
68
|
`,
|
|
69
69
|
children: new s(l)
|
|
70
70
|
}
|
|
@@ -75,7 +75,7 @@ const n = (d, l) => /* @__PURE__ */ r(
|
|
|
75
75
|
category: "radix",
|
|
76
76
|
description: "A vertically stacked set of interactive headings that each reveal an associated section of content. Clicking on the heading will open the item and close other items.",
|
|
77
77
|
order: 3,
|
|
78
|
-
template: /* @__PURE__ */ r(i.Accordion, { collapsible: !0,
|
|
78
|
+
template: /* @__PURE__ */ r(i.Accordion, { collapsible: !0, value: "0", children: [
|
|
79
79
|
n(
|
|
80
80
|
"Is it accessible?",
|
|
81
81
|
"Yes. It adheres to the WAI-ARIA design pattern."
|
package/lib/accordion.ws.js
CHANGED
|
@@ -1,117 +1,80 @@
|
|
|
1
|
-
import { AccordionIcon as t, ItemIcon as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { AccordionIcon as t, ItemIcon as n, HeaderIcon as r, TriggerIcon as c, ContentIcon as i } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { div as o, h3 as a, button as p } from "@webstudio-is/sdk/normalize.css";
|
|
3
|
+
import { radix as e } from "./shared/meta.js";
|
|
4
4
|
import { buttonReset as d } from "./shared/preset-styles.js";
|
|
5
|
-
import { propsAccordion as
|
|
6
|
-
const
|
|
7
|
-
div: s
|
|
8
|
-
}, f = {
|
|
9
|
-
type: "container",
|
|
5
|
+
import { propsAccordion as s, propsAccordionItem as l, propsAccordionHeader as m, propsAccordionTrigger as g, propsAccordionContent as A } from "./__generated__/accordion.props.js";
|
|
6
|
+
const v = {
|
|
10
7
|
icon: t,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
contentModel: {
|
|
9
|
+
category: "instance",
|
|
10
|
+
children: ["instance"],
|
|
11
|
+
descendants: [e.AccordionItem]
|
|
12
|
+
},
|
|
13
|
+
presetStyle: { div: o },
|
|
14
|
+
initialProps: ["value", "collapsible"],
|
|
15
|
+
props: s
|
|
16
|
+
}, x = {
|
|
20
17
|
label: "Item",
|
|
21
|
-
icon: e,
|
|
22
|
-
constraints: [
|
|
23
|
-
{
|
|
24
|
-
relation: "ancestor",
|
|
25
|
-
component: { $eq: "Accordion" }
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
relation: "descendant",
|
|
29
|
-
component: { $eq: "AccordionHeader" }
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
relation: "descendant",
|
|
33
|
-
component: { $eq: "AccordionContent" }
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
indexWithinAncestor: "Accordion",
|
|
37
|
-
presetStyle: o
|
|
38
|
-
}, H = {
|
|
39
|
-
type: "container",
|
|
40
|
-
label: "Item Header",
|
|
41
18
|
icon: n,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
19
|
+
indexWithinAncestor: e.Accordion,
|
|
20
|
+
contentModel: {
|
|
21
|
+
category: "none",
|
|
22
|
+
children: ["instance"],
|
|
23
|
+
descendants: [e.AccordionHeader, e.AccordionContent]
|
|
24
|
+
},
|
|
25
|
+
presetStyle: { div: o },
|
|
26
|
+
initialProps: ["value"],
|
|
27
|
+
props: l
|
|
28
|
+
}, f = {
|
|
29
|
+
label: "Item Header",
|
|
30
|
+
icon: r,
|
|
31
|
+
contentModel: {
|
|
32
|
+
category: "none",
|
|
33
|
+
children: ["instance"],
|
|
34
|
+
descendants: [e.AccordionTrigger]
|
|
35
|
+
},
|
|
52
36
|
presetStyle: {
|
|
53
37
|
h3: [
|
|
54
38
|
...a,
|
|
55
39
|
{
|
|
56
|
-
property: "
|
|
40
|
+
property: "margin-top",
|
|
57
41
|
value: { type: "unit", unit: "px", value: 0 }
|
|
58
42
|
},
|
|
59
43
|
{
|
|
60
|
-
property: "
|
|
44
|
+
property: "margin-bottom",
|
|
61
45
|
value: { type: "unit", unit: "px", value: 0 }
|
|
62
46
|
}
|
|
63
47
|
]
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
48
|
+
},
|
|
49
|
+
props: m
|
|
50
|
+
}, C = {
|
|
67
51
|
label: "Item Trigger",
|
|
68
|
-
icon:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
52
|
+
icon: c,
|
|
53
|
+
contentModel: {
|
|
54
|
+
category: "none",
|
|
55
|
+
children: ["instance", "rich-text"]
|
|
72
56
|
},
|
|
73
|
-
states: [
|
|
74
|
-
...i,
|
|
75
|
-
{
|
|
76
|
-
category: "component-states",
|
|
77
|
-
label: "Open",
|
|
78
|
-
selector: "[data-state=open]"
|
|
79
|
-
}
|
|
80
|
-
],
|
|
57
|
+
states: [{ label: "Open", selector: "[data-state=open]" }],
|
|
81
58
|
presetStyle: {
|
|
82
59
|
button: [p, d].flat()
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
60
|
+
},
|
|
61
|
+
props: g
|
|
62
|
+
}, H = {
|
|
86
63
|
label: "Item Content",
|
|
87
|
-
icon:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
64
|
+
icon: i,
|
|
65
|
+
contentModel: {
|
|
66
|
+
category: "none",
|
|
67
|
+
children: ["instance", "rich-text"]
|
|
68
|
+
},
|
|
69
|
+
presetStyle: {
|
|
70
|
+
div: o
|
|
91
71
|
},
|
|
92
|
-
presetStyle: o
|
|
93
|
-
}, M = {
|
|
94
|
-
props: m,
|
|
95
|
-
initialProps: ["value", "collapsible"]
|
|
96
|
-
}, x = {
|
|
97
|
-
props: l,
|
|
98
|
-
initialProps: ["value"]
|
|
99
|
-
}, S = {
|
|
100
72
|
props: A
|
|
101
|
-
}, h = {
|
|
102
|
-
props: I
|
|
103
|
-
}, P = {
|
|
104
|
-
props: g
|
|
105
73
|
};
|
|
106
74
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
M as propsMetaAccordion,
|
|
113
|
-
P as propsMetaAccordionContent,
|
|
114
|
-
S as propsMetaAccordionHeader,
|
|
115
|
-
x as propsMetaAccordionItem,
|
|
116
|
-
h as propsMetaAccordionTrigger
|
|
75
|
+
v as metaAccordion,
|
|
76
|
+
H as metaAccordionContent,
|
|
77
|
+
f as metaAccordionHeader,
|
|
78
|
+
x as metaAccordionItem,
|
|
79
|
+
C as metaAccordionTrigger
|
|
117
80
|
};
|
package/lib/checkbox.js
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as h, useState as s, useEffect as k } from "react";
|
|
3
|
+
import { Indicator as a, Root as m } from "@radix-ui/react-checkbox";
|
|
4
|
+
const x = h(({ defaultChecked: c, ...o }, r) => {
|
|
5
|
+
const e = o.checked ?? c ?? !1, [n, t] = s(e);
|
|
6
|
+
return k(() => t(e), [e]), /* @__PURE__ */ f(
|
|
7
|
+
m,
|
|
8
|
+
{
|
|
9
|
+
...o,
|
|
10
|
+
ref: r,
|
|
11
|
+
checked: n,
|
|
12
|
+
onCheckedChange: (d) => t(d === !0)
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}), b = a;
|
|
5
16
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
17
|
+
x as Checkbox,
|
|
18
|
+
b as CheckboxIndicator
|
|
8
19
|
};
|
package/lib/checkbox.template.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { CheckMarkIcon as a } from "@webstudio-is/icons/svg";
|
|
3
|
-
import {
|
|
3
|
+
import { $ as t, css as o, PlaceholderValue as l } from "@webstudio-is/template";
|
|
4
4
|
import { radix as r } from "./shared/proxy.js";
|
|
5
|
-
import {
|
|
5
|
+
import { height as s, width as d, borderRadius as n, borderWidth as h, colors as i, boxShadow as b, opacity as m, spacing as p } from "./shared/theme.js";
|
|
6
6
|
const y = {
|
|
7
7
|
category: "radix",
|
|
8
8
|
description: "Use within a form to allow your users to toggle between checked and not checked. Group checkboxes by matching their “Name” properties. Unlike radios, any number of checkboxes in a group can be checked.",
|
|
@@ -13,7 +13,7 @@ const y = {
|
|
|
13
13
|
"ws:label": "Checkbox Field",
|
|
14
14
|
"ws:style": o`
|
|
15
15
|
display: flex;
|
|
16
|
-
gap: ${
|
|
16
|
+
gap: ${p[2]};
|
|
17
17
|
align-items: center;
|
|
18
18
|
`,
|
|
19
19
|
children: [
|
|
@@ -21,18 +21,18 @@ const y = {
|
|
|
21
21
|
r.Checkbox,
|
|
22
22
|
{
|
|
23
23
|
"ws:style": o`
|
|
24
|
-
height: ${
|
|
25
|
-
width: ${
|
|
24
|
+
height: ${s[4]};
|
|
25
|
+
width: ${d[4]};
|
|
26
26
|
flex-shrink: 0;
|
|
27
|
-
border-radius: ${
|
|
28
|
-
border: ${
|
|
27
|
+
border-radius: ${n.sm};
|
|
28
|
+
border: ${h.DEFAULT} solid ${i.primary};
|
|
29
29
|
&:focus-visible {
|
|
30
30
|
outline: none;
|
|
31
|
-
box-shadow: ${
|
|
31
|
+
box-shadow: ${b.ring};
|
|
32
32
|
}
|
|
33
33
|
&:disabled {
|
|
34
34
|
cursor: not-allowed;
|
|
35
|
-
opacity: ${
|
|
35
|
+
opacity: ${m[50]};
|
|
36
36
|
}
|
|
37
37
|
&[data-state="checked"] {
|
|
38
38
|
background-color: ${i.primary};
|
|
@@ -53,7 +53,7 @@ const y = {
|
|
|
53
53
|
)
|
|
54
54
|
}
|
|
55
55
|
),
|
|
56
|
-
/* @__PURE__ */ e(t.Text, { "ws:label": "Checkbox Label", tag: "span", children: new l("Checkbox") })
|
|
56
|
+
/* @__PURE__ */ e(t.Text, { "ws:label": "Checkbox Label", "ws:tag": "span", children: new l("Checkbox") })
|
|
57
57
|
]
|
|
58
58
|
}
|
|
59
59
|
)
|
package/lib/checkbox.ws.js
CHANGED
|
@@ -1,51 +1,36 @@
|
|
|
1
|
-
import { CheckboxCheckedIcon as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { buttonReset as
|
|
5
|
-
import { propsCheckbox as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { CheckboxCheckedIcon as e, TriggerIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { button as o, span as c } from "@webstudio-is/sdk/normalize.css";
|
|
3
|
+
import { radix as n } from "./shared/meta.js";
|
|
4
|
+
import { buttonReset as r } from "./shared/preset-styles.js";
|
|
5
|
+
import { propsCheckbox as a, propsCheckboxIndicator as s } from "./__generated__/checkbox.props.js";
|
|
6
|
+
const m = {
|
|
7
|
+
icon: e,
|
|
8
|
+
contentModel: {
|
|
9
|
+
category: "instance",
|
|
10
|
+
children: ["instance"],
|
|
11
|
+
descendants: [n.CheckboxIndicator]
|
|
11
12
|
},
|
|
12
|
-
icon: t,
|
|
13
13
|
states: [
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
label: "Checked",
|
|
17
|
-
selector: "[data-state=checked]",
|
|
18
|
-
category: "component-states"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
label: "Unchecked",
|
|
22
|
-
selector: "[data-state=unchecked]",
|
|
23
|
-
category: "component-states"
|
|
24
|
-
}
|
|
14
|
+
{ label: "Checked", selector: "[data-state=checked]" },
|
|
15
|
+
{ label: "Unchecked", selector: "[data-state=unchecked]" }
|
|
25
16
|
],
|
|
26
17
|
presetStyle: {
|
|
27
|
-
button: [
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
button: [o, r].flat()
|
|
19
|
+
},
|
|
20
|
+
initialProps: ["id", "class", "name", "value", "required", "checked"],
|
|
21
|
+
props: a
|
|
22
|
+
}, k = {
|
|
23
|
+
icon: t,
|
|
24
|
+
contentModel: {
|
|
25
|
+
category: "none",
|
|
26
|
+
children: ["instance", "rich-text"]
|
|
34
27
|
},
|
|
35
|
-
icon: o,
|
|
36
|
-
states: e,
|
|
37
28
|
presetStyle: {
|
|
38
|
-
span:
|
|
39
|
-
}
|
|
40
|
-
}, b = {
|
|
41
|
-
props: r,
|
|
42
|
-
initialProps: ["id", "className", "name", "value", "required", "checked"]
|
|
43
|
-
}, C = {
|
|
29
|
+
span: c
|
|
30
|
+
},
|
|
44
31
|
props: s
|
|
45
32
|
};
|
|
46
33
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
b as propsMetaCheckbox,
|
|
50
|
-
C as propsMetaCheckboxIndicator
|
|
34
|
+
m as metaCheckbox,
|
|
35
|
+
k as metaCheckboxIndicator
|
|
51
36
|
};
|
package/lib/collapsible.js
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import {
|
|
4
|
-
import { getClosestInstance as
|
|
5
|
-
const
|
|
6
|
-
const n =
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
}),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as a, useState as c, useEffect as p, Children as f } from "react";
|
|
3
|
+
import { Content as C, Root as m, Trigger as b } from "@radix-ui/react-collapsible";
|
|
4
|
+
import { getClosestInstance as r } from "@webstudio-is/react-sdk/runtime";
|
|
5
|
+
const P = a((n, t) => {
|
|
6
|
+
const o = n.open ?? !1, [e, i] = c(o);
|
|
7
|
+
return p(() => i(o), [o]), /* @__PURE__ */ l(m, { ...n, ref: t, open: e, onOpenChange: i });
|
|
8
|
+
}), $ = a(({ children: n, ...t }, o) => {
|
|
9
|
+
const e = f.toArray(n)[0];
|
|
10
|
+
return /* @__PURE__ */ l(b, { asChild: !0, ref: o, ...t, children: e ?? /* @__PURE__ */ l("button", { children: "Add button" }) });
|
|
11
|
+
}), x = C, s = "@webstudio-is/sdk-components-react-radix", y = {
|
|
12
|
+
onNavigatorSelect: (n, t) => {
|
|
13
|
+
for (const o of t.instancePath)
|
|
14
|
+
if (o.component === `${s}:CollapsibleContent`) {
|
|
15
|
+
const e = r(
|
|
16
|
+
t.instancePath,
|
|
17
|
+
o,
|
|
15
18
|
`${s}:Collapsible`
|
|
16
19
|
);
|
|
17
|
-
|
|
20
|
+
e && n.setMemoryProp(e, "open", !0);
|
|
18
21
|
}
|
|
19
22
|
},
|
|
20
|
-
onNavigatorUnselect: (
|
|
21
|
-
for (const
|
|
22
|
-
if (
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
onNavigatorUnselect: (n, t) => {
|
|
24
|
+
for (const o of t.instancePath)
|
|
25
|
+
if (o.component === `${s}:CollapsibleContent`) {
|
|
26
|
+
const e = r(
|
|
27
|
+
t.instancePath,
|
|
28
|
+
o,
|
|
26
29
|
`${s}:Collapsible`
|
|
27
30
|
);
|
|
28
|
-
|
|
31
|
+
e && n.setMemoryProp(e, "open", void 0);
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
};
|
|
32
35
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
P as Collapsible,
|
|
37
|
+
x as CollapsibleContent,
|
|
38
|
+
$ as CollapsibleTrigger,
|
|
39
|
+
y as hooksCollapsible
|
|
37
40
|
};
|
package/lib/collapsible.ws.js
CHANGED
|
@@ -1,59 +1,39 @@
|
|
|
1
|
-
import { CollapsibleIcon as
|
|
1
|
+
import { CollapsibleIcon as n, TriggerIcon as t, ContentIcon as l } from "@webstudio-is/icons/svg";
|
|
2
2
|
import { div as o } from "@webstudio-is/sdk/normalize.css";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
constraints: [
|
|
7
|
-
{
|
|
8
|
-
relation: "descendant",
|
|
9
|
-
component: { $eq: "CollapsibleTrigger" }
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
relation: "descendant",
|
|
13
|
-
component: { $eq: "CollapsibleContent" }
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
presetStyle: {
|
|
17
|
-
div: o
|
|
18
|
-
},
|
|
19
|
-
icon: e
|
|
20
|
-
}, C = {
|
|
21
|
-
type: "container",
|
|
3
|
+
import { radix as e } from "./shared/meta.js";
|
|
4
|
+
import { propsCollapsible as r, propsCollapsibleTrigger as i, propsCollapsibleContent as p } from "./__generated__/collapsible.props.js";
|
|
5
|
+
const g = {
|
|
22
6
|
icon: n,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
type: "container",
|
|
7
|
+
contentModel: {
|
|
8
|
+
category: "instance",
|
|
9
|
+
children: ["instance"],
|
|
10
|
+
descendants: [e.CollapsibleTrigger, e.CollapsibleContent]
|
|
11
|
+
},
|
|
29
12
|
presetStyle: {
|
|
30
13
|
div: o
|
|
31
14
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
relation: "ancestor",
|
|
35
|
-
component: { $eq: "Collapsible" }
|
|
36
|
-
}
|
|
15
|
+
initialProps: ["open"],
|
|
16
|
+
props: r
|
|
37
17
|
}, m = {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
control: "action",
|
|
43
|
-
required: !1
|
|
44
|
-
}
|
|
18
|
+
icon: t,
|
|
19
|
+
contentModel: {
|
|
20
|
+
category: "none",
|
|
21
|
+
children: ["instance", "rich-text"]
|
|
45
22
|
},
|
|
46
|
-
|
|
47
|
-
}, g = {
|
|
48
|
-
props: p
|
|
23
|
+
props: i
|
|
49
24
|
}, d = {
|
|
50
|
-
|
|
25
|
+
icon: l,
|
|
26
|
+
contentModel: {
|
|
27
|
+
category: "none",
|
|
28
|
+
children: ["instance", "rich-text"]
|
|
29
|
+
},
|
|
30
|
+
presetStyle: {
|
|
31
|
+
div: o
|
|
32
|
+
},
|
|
33
|
+
props: p
|
|
51
34
|
};
|
|
52
35
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
m as propsMetaCollapsible,
|
|
57
|
-
d as propsMetaCollapsibleContent,
|
|
58
|
-
g as propsMetaCollapsibleTrigger
|
|
36
|
+
g as metaCollapsible,
|
|
37
|
+
d as metaCollapsibleContent,
|
|
38
|
+
m as metaCollapsibleTrigger
|
|
59
39
|
};
|