@webstudio-is/sdk-components-react-radix 0.219.0 → 0.220.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__/popover.props.js +2 -1
- package/lib/accordion.ws.js +29 -43
- package/lib/checkbox.js +19 -4
- package/lib/checkbox.ws.js +5 -9
- package/lib/collapsible.ws.js +8 -21
- package/lib/components.js +46 -45
- package/lib/dialog.ws.js +37 -65
- package/lib/label.ws.js +9 -11
- package/lib/metas.js +45 -44
- package/lib/navigation-menu.ws.js +21 -35
- package/lib/popover.js +17 -16
- package/lib/popover.template.js +50 -20
- package/lib/popover.ws.js +37 -27
- package/lib/radio-group.js +14 -7
- package/lib/radio-group.ws.js +25 -31
- package/lib/select.ws.js +33 -63
- package/lib/switch.js +19 -4
- package/lib/switch.ws.js +15 -19
- package/lib/tabs.ws.js +16 -30
- package/lib/tooltip.ws.js +12 -20
- 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.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.ws.d.ts +1 -4
- package/lib/types/select.ws.d.ts +1 -9
- package/lib/types/switch.ws.d.ts +1 -3
- package/lib/types/tabs.ws.d.ts +1 -5
- package/lib/types/tooltip.ws.d.ts +1 -4
- package/package.json +9 -14
- package/lib/props.js +0 -62
- package/lib/types/props.d.ts +0 -12
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { NavigationMenuIcon as t, ListIcon as o, ListItemIcon as i, TriggerIcon as a, ContentIcon as r, BoxIcon as
|
|
1
|
+
import { NavigationMenuIcon as t, ListIcon as o, ListItemIcon as i, TriggerIcon as a, ContentIcon as r, BoxIcon as c, ViewportIcon as s } from "@webstudio-is/icons/svg";
|
|
2
2
|
import { div as e } from "@webstudio-is/sdk/normalize.css";
|
|
3
3
|
import { radix as n } from "./shared/meta.js";
|
|
4
|
-
import { propsNavigationMenu as p, propsNavigationMenuList as g, propsNavigationMenuItem as M, propsNavigationMenuTrigger as
|
|
5
|
-
const
|
|
4
|
+
import { propsNavigationMenu as p, propsNavigationMenuList as g, propsNavigationMenuItem as M, propsNavigationMenuTrigger as l, propsNavigationMenuContent as u, propsNavigationMenuLink as d, propsNavigationMenuViewport as v } from "./__generated__/navigation-menu.props.js";
|
|
5
|
+
const L = {
|
|
6
6
|
icon: t,
|
|
7
7
|
contentModel: {
|
|
8
8
|
category: "instance",
|
|
@@ -11,7 +11,8 @@ const y = {
|
|
|
11
11
|
},
|
|
12
12
|
presetStyle: {
|
|
13
13
|
div: e
|
|
14
|
-
}
|
|
14
|
+
},
|
|
15
|
+
props: p
|
|
15
16
|
}, h = {
|
|
16
17
|
icon: o,
|
|
17
18
|
label: "Menu List",
|
|
@@ -22,7 +23,8 @@ const y = {
|
|
|
22
23
|
},
|
|
23
24
|
presetStyle: {
|
|
24
25
|
div: e
|
|
25
|
-
}
|
|
26
|
+
},
|
|
27
|
+
props: g
|
|
26
28
|
}, b = {
|
|
27
29
|
icon: i,
|
|
28
30
|
label: "Menu Item",
|
|
@@ -38,14 +40,16 @@ const y = {
|
|
|
38
40
|
},
|
|
39
41
|
presetStyle: {
|
|
40
42
|
div: e
|
|
41
|
-
}
|
|
43
|
+
},
|
|
44
|
+
props: M
|
|
42
45
|
}, k = {
|
|
43
46
|
icon: a,
|
|
44
47
|
label: "Menu Trigger",
|
|
45
48
|
contentModel: {
|
|
46
49
|
category: "none",
|
|
47
50
|
children: ["instance"]
|
|
48
|
-
}
|
|
51
|
+
},
|
|
52
|
+
props: l
|
|
49
53
|
}, w = {
|
|
50
54
|
icon: r,
|
|
51
55
|
label: "Menu Content",
|
|
@@ -56,16 +60,18 @@ const y = {
|
|
|
56
60
|
},
|
|
57
61
|
presetStyle: {
|
|
58
62
|
div: e
|
|
59
|
-
}
|
|
63
|
+
},
|
|
64
|
+
props: u
|
|
60
65
|
}, C = {
|
|
61
|
-
icon:
|
|
66
|
+
icon: c,
|
|
62
67
|
label: "Accessible Link Wrapper",
|
|
63
68
|
contentModel: {
|
|
64
69
|
category: "none",
|
|
65
70
|
children: ["instance"]
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
},
|
|
72
|
+
props: d
|
|
73
|
+
}, S = {
|
|
74
|
+
icon: s,
|
|
69
75
|
label: "Menu Viewport",
|
|
70
76
|
contentModel: {
|
|
71
77
|
category: "none",
|
|
@@ -73,35 +79,15 @@ const y = {
|
|
|
73
79
|
},
|
|
74
80
|
presetStyle: {
|
|
75
81
|
div: e
|
|
76
|
-
}
|
|
77
|
-
}, V = {
|
|
78
|
-
props: p
|
|
79
|
-
}, S = {
|
|
80
|
-
props: M
|
|
81
|
-
}, f = {
|
|
82
|
-
props: u
|
|
83
|
-
}, x = {
|
|
84
|
-
props: l
|
|
85
|
-
}, A = {
|
|
82
|
+
},
|
|
86
83
|
props: v
|
|
87
|
-
}, W = {
|
|
88
|
-
props: g
|
|
89
|
-
}, B = {
|
|
90
|
-
props: N
|
|
91
84
|
};
|
|
92
85
|
export {
|
|
93
|
-
|
|
86
|
+
L as metaNavigationMenu,
|
|
94
87
|
w as metaNavigationMenuContent,
|
|
95
88
|
b as metaNavigationMenuItem,
|
|
96
89
|
C as metaNavigationMenuLink,
|
|
97
90
|
h as metaNavigationMenuList,
|
|
98
91
|
k as metaNavigationMenuTrigger,
|
|
99
|
-
|
|
100
|
-
V as propsMetaNavigationMenu,
|
|
101
|
-
x as propsMetaNavigationMenuContent,
|
|
102
|
-
S as propsMetaNavigationMenuItem,
|
|
103
|
-
A as propsMetaNavigationMenuLink,
|
|
104
|
-
W as propsMetaNavigationMenuList,
|
|
105
|
-
f as propsMetaNavigationMenuTrigger,
|
|
106
|
-
B as propsMetaNavigationMenuViewport
|
|
92
|
+
S as metaNavigationMenuViewport
|
|
107
93
|
};
|
package/lib/popover.js
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as c, Children as P } from "react";
|
|
3
|
-
import * as
|
|
4
|
-
import { getClosestInstance as
|
|
5
|
-
const
|
|
3
|
+
import * as i from "@radix-ui/react-popover";
|
|
4
|
+
import { getClosestInstance as p } from "@webstudio-is/react-sdk/runtime";
|
|
5
|
+
const v = c((o, t) => /* @__PURE__ */ n(i.Root, { ...o })), d = c(({ children: o, ...t }, e) => {
|
|
6
6
|
const r = P.toArray(o)[0];
|
|
7
|
-
return /* @__PURE__ */ n(
|
|
7
|
+
return /* @__PURE__ */ n(i.Trigger, { asChild: !0, ref: e, ...t, children: r ?? /* @__PURE__ */ n("button", { children: "Add button or link" }) });
|
|
8
8
|
}), h = c(
|
|
9
|
-
({ sideOffset: o = 4, align: t = "center", hideWhenDetached: e = !0, ...r },
|
|
10
|
-
|
|
9
|
+
({ sideOffset: o = 4, align: t = "center", hideWhenDetached: e = !0, ...r }, a) => /* @__PURE__ */ n(i.Portal, { children: /* @__PURE__ */ n(
|
|
10
|
+
i.Content,
|
|
11
11
|
{
|
|
12
|
-
ref:
|
|
12
|
+
ref: a,
|
|
13
13
|
align: "center",
|
|
14
14
|
sideOffset: o,
|
|
15
15
|
hideWhenDetached: e,
|
|
16
16
|
...r
|
|
17
17
|
}
|
|
18
18
|
) })
|
|
19
|
-
), i = "@webstudio-is/sdk-components-react-radix", g = {
|
|
19
|
+
), C = i.Close, s = "@webstudio-is/sdk-components-react-radix", g = {
|
|
20
20
|
onNavigatorUnselect: (o, t) => {
|
|
21
21
|
for (const e of t.instancePath)
|
|
22
|
-
if (e.component === `${
|
|
23
|
-
const r =
|
|
22
|
+
if (e.component === `${s}:PopoverContent`) {
|
|
23
|
+
const r = p(
|
|
24
24
|
t.instancePath,
|
|
25
25
|
e,
|
|
26
|
-
`${
|
|
26
|
+
`${s}:Popover`
|
|
27
27
|
);
|
|
28
28
|
r && o.setMemoryProp(r, "open", void 0);
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
onNavigatorSelect: (o, t) => {
|
|
32
32
|
for (const e of t.instancePath)
|
|
33
|
-
if (e.component === `${
|
|
34
|
-
const r =
|
|
33
|
+
if (e.component === `${s}:PopoverContent`) {
|
|
34
|
+
const r = p(
|
|
35
35
|
t.instancePath,
|
|
36
36
|
e,
|
|
37
|
-
`${
|
|
37
|
+
`${s}:Popover`
|
|
38
38
|
);
|
|
39
39
|
r && o.setMemoryProp(r, "open", !0);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
export {
|
|
44
|
-
|
|
44
|
+
v as Popover,
|
|
45
|
+
C as PopoverClose,
|
|
45
46
|
h as PopoverContent,
|
|
46
|
-
|
|
47
|
+
d as PopoverTrigger,
|
|
47
48
|
g as hooksPopover
|
|
48
49
|
};
|
package/lib/popover.template.js
CHANGED
|
@@ -1,33 +1,63 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { LargeXIcon as p } from "@webstudio-is/icons/svg";
|
|
3
|
+
import { $ as r, PlaceholderValue as d, css as l } from "@webstudio-is/template";
|
|
4
|
+
import { radix as e } from "./shared/proxy.js";
|
|
5
|
+
import { getButtonStyle as h } from "./shared/styles.js";
|
|
6
|
+
import { spacing as t, borderRadius as s, height as a, opacity as m, boxShadow as c, zIndex as b, width as u, borderWidth as g, colors as i } from "./shared/theme.js";
|
|
7
|
+
const P = {
|
|
7
8
|
category: "radix",
|
|
8
9
|
description: "Displays rich content in a portal, triggered by a button.",
|
|
9
10
|
order: 6,
|
|
10
|
-
template: /* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */ o(
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
|
|
11
|
+
template: /* @__PURE__ */ n(e.Popover, { children: [
|
|
12
|
+
/* @__PURE__ */ o(e.PopoverTrigger, { children: /* @__PURE__ */ o(r.Button, { "ws:style": h("outline"), children: new d("Button") }) }),
|
|
13
|
+
/* @__PURE__ */ n(
|
|
14
|
+
e.PopoverContent,
|
|
14
15
|
{
|
|
15
|
-
"ws:style":
|
|
16
|
-
z-index: ${
|
|
17
|
-
width: ${
|
|
16
|
+
"ws:style": l`
|
|
17
|
+
z-index: ${b[50]};
|
|
18
|
+
width: ${u[72]};
|
|
18
19
|
border-radius: ${s.md};
|
|
19
|
-
border: ${
|
|
20
|
-
background-color: ${
|
|
21
|
-
padding: ${
|
|
22
|
-
color: ${
|
|
23
|
-
box-shadow: ${
|
|
20
|
+
border: ${g.DEFAULT} solid ${i.border};
|
|
21
|
+
background-color: ${i.popover};
|
|
22
|
+
padding: ${t[4]};
|
|
23
|
+
color: ${i.popoverForeground};
|
|
24
|
+
box-shadow: ${c.md};
|
|
24
25
|
outline: none;
|
|
25
26
|
`,
|
|
26
|
-
children:
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ o(r.Text, { children: new d("The text you can edit") }),
|
|
29
|
+
/* @__PURE__ */ o(
|
|
30
|
+
e.PopoverClose,
|
|
31
|
+
{
|
|
32
|
+
"ws:label": "Close Button",
|
|
33
|
+
"ws:style": l`
|
|
34
|
+
position: absolute;
|
|
35
|
+
right: ${t[4]};
|
|
36
|
+
top: ${t[4]};
|
|
37
|
+
border-radius: ${s.sm};
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
height: ${a[4]};
|
|
42
|
+
width: ${a[4]};
|
|
43
|
+
border: 0;
|
|
44
|
+
background-color: transparent;
|
|
45
|
+
outline: none;
|
|
46
|
+
&:hover {
|
|
47
|
+
opacity: ${m[100]};
|
|
48
|
+
}
|
|
49
|
+
&:focus-visible {
|
|
50
|
+
box-shadow: ${c.ring};
|
|
51
|
+
}
|
|
52
|
+
`,
|
|
53
|
+
children: /* @__PURE__ */ o(r.HtmlEmbed, { "ws:label": "Close Icon", code: p })
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
]
|
|
27
57
|
}
|
|
28
58
|
)
|
|
29
59
|
] })
|
|
30
60
|
};
|
|
31
61
|
export {
|
|
32
|
-
|
|
62
|
+
P as meta
|
|
33
63
|
};
|
package/lib/popover.ws.js
CHANGED
|
@@ -1,43 +1,53 @@
|
|
|
1
|
-
import { PopoverIcon as e, TriggerIcon as
|
|
2
|
-
import {
|
|
1
|
+
import { PopoverIcon as e, TriggerIcon as t, ContentIcon as n, ButtonElementIcon as r } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as p } from "@webstudio-is/sdk";
|
|
3
|
+
import { div as s, button as i } from "@webstudio-is/sdk/normalize.css";
|
|
3
4
|
import { radix as o } from "./shared/meta.js";
|
|
4
|
-
import { propsPopover as
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { propsPopover as c, propsPopoverTrigger as a, propsPopoverContent as l, propsPopoverClose as d } from "./__generated__/popover.props.js";
|
|
6
|
+
import { buttonReset as m } from "./shared/preset-styles.js";
|
|
7
|
+
const y = {
|
|
8
|
+
icon: t,
|
|
7
9
|
contentModel: {
|
|
8
10
|
category: "none",
|
|
9
11
|
children: ["instance"]
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
},
|
|
13
|
+
props: a
|
|
14
|
+
}, h = {
|
|
15
|
+
icon: n,
|
|
13
16
|
contentModel: {
|
|
14
17
|
category: "none",
|
|
15
|
-
children: ["instance"]
|
|
18
|
+
children: ["instance"],
|
|
19
|
+
descendants: [o.PopoverClose]
|
|
16
20
|
},
|
|
17
21
|
presetStyle: {
|
|
18
|
-
div:
|
|
19
|
-
}
|
|
20
|
-
|
|
22
|
+
div: s
|
|
23
|
+
},
|
|
24
|
+
initialProps: ["side", "sideOffset", "align", "alignOffset"],
|
|
25
|
+
props: l
|
|
26
|
+
}, b = {
|
|
21
27
|
icon: e,
|
|
22
28
|
contentModel: {
|
|
23
29
|
category: "instance",
|
|
24
30
|
children: ["instance"],
|
|
25
31
|
descendants: [o.PopoverTrigger, o.PopoverContent]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
props:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
},
|
|
33
|
+
initialProps: ["open"],
|
|
34
|
+
props: c
|
|
35
|
+
}, I = {
|
|
36
|
+
icon: r,
|
|
37
|
+
label: "Close Button",
|
|
38
|
+
contentModel: {
|
|
39
|
+
category: "none",
|
|
40
|
+
children: ["instance", "rich-text"]
|
|
41
|
+
},
|
|
42
|
+
states: p,
|
|
43
|
+
presetStyle: {
|
|
44
|
+
button: [m, i].flat()
|
|
45
|
+
},
|
|
46
|
+
props: d
|
|
35
47
|
};
|
|
36
48
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
M as propsMetaPopoverContent,
|
|
42
|
-
f as propsMetaPopoverTrigger
|
|
49
|
+
b as metaPopover,
|
|
50
|
+
I as metaPopoverClose,
|
|
51
|
+
h as metaPopoverContent,
|
|
52
|
+
y as metaPopoverTrigger
|
|
43
53
|
};
|
package/lib/radio-group.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Item as
|
|
4
|
-
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as n } from "react";
|
|
3
|
+
import { Item as i, Indicator as p, Root as u } from "@radix-ui/react-radio-group";
|
|
4
|
+
import { useControllableState as d } from "@radix-ui/react-use-controllable-state";
|
|
5
|
+
const R = n(({ defaultValue: r, ...o }, t) => {
|
|
6
|
+
const [a, e] = d({
|
|
7
|
+
prop: o.value ?? r ?? "",
|
|
8
|
+
defaultProp: ""
|
|
9
|
+
});
|
|
10
|
+
return /* @__PURE__ */ m(u, { ...o, value: a, onValueChange: e, ref: t });
|
|
11
|
+
}), I = i, G = p;
|
|
5
12
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
13
|
+
R as RadioGroup,
|
|
14
|
+
G as RadioGroupIndicator,
|
|
15
|
+
I as RadioGroupItem
|
|
9
16
|
};
|
package/lib/radio-group.ws.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { RadioGroupIcon as
|
|
2
|
-
import { defaultStates as
|
|
3
|
-
import { div as n, button as
|
|
4
|
-
import { radix as
|
|
5
|
-
import { buttonReset as
|
|
6
|
-
import { propsRadioGroup as
|
|
1
|
+
import { RadioGroupIcon as o, ItemIcon as r, TriggerIcon as a } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as t } from "@webstudio-is/sdk";
|
|
3
|
+
import { div as n, button as c, span as s } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { radix as e } from "./shared/meta.js";
|
|
5
|
+
import { buttonReset as i } from "./shared/preset-styles.js";
|
|
6
|
+
import { propsRadioGroup as p, propsRadioGroupItem as d, propsRadioGroupIndicator as l } from "./__generated__/radio-group.props.js";
|
|
7
7
|
const y = {
|
|
8
|
-
icon:
|
|
8
|
+
icon: o,
|
|
9
9
|
contentModel: {
|
|
10
10
|
category: "instance",
|
|
11
11
|
children: ["instance"],
|
|
12
|
-
descendants: [
|
|
12
|
+
descendants: [e.RadioGroupItem]
|
|
13
13
|
},
|
|
14
14
|
states: [
|
|
15
|
-
...
|
|
15
|
+
...t,
|
|
16
16
|
{
|
|
17
17
|
label: "Checked",
|
|
18
18
|
selector: "[data-state=checked]",
|
|
@@ -26,42 +26,36 @@ const y = {
|
|
|
26
26
|
],
|
|
27
27
|
presetStyle: {
|
|
28
28
|
div: n
|
|
29
|
-
}
|
|
29
|
+
},
|
|
30
|
+
initialProps: ["id", "class", "name", "value", "required"],
|
|
31
|
+
props: p
|
|
30
32
|
}, g = {
|
|
31
|
-
icon:
|
|
33
|
+
icon: r,
|
|
32
34
|
contentModel: {
|
|
33
35
|
category: "none",
|
|
34
36
|
children: ["instance"],
|
|
35
|
-
descendants: [
|
|
37
|
+
descendants: [e.RadioGroupIndicator]
|
|
36
38
|
},
|
|
37
|
-
states:
|
|
39
|
+
states: t,
|
|
38
40
|
presetStyle: {
|
|
39
|
-
button: [
|
|
40
|
-
}
|
|
41
|
+
button: [c, i].flat()
|
|
42
|
+
},
|
|
43
|
+
initialProps: ["value"],
|
|
44
|
+
props: d
|
|
41
45
|
}, h = {
|
|
42
|
-
icon:
|
|
46
|
+
icon: a,
|
|
43
47
|
contentModel: {
|
|
44
48
|
category: "none",
|
|
45
49
|
children: ["instance"]
|
|
46
50
|
},
|
|
47
|
-
states:
|
|
51
|
+
states: t,
|
|
48
52
|
presetStyle: {
|
|
49
|
-
span:
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
props: i,
|
|
53
|
-
initialProps: ["id", "className", "name", "value", "required"]
|
|
54
|
-
}, b = {
|
|
55
|
-
props: d,
|
|
56
|
-
initialProps: ["value"]
|
|
57
|
-
}, k = {
|
|
58
|
-
props: m
|
|
53
|
+
span: s
|
|
54
|
+
},
|
|
55
|
+
props: l
|
|
59
56
|
};
|
|
60
57
|
export {
|
|
61
58
|
y as metaRadioGroup,
|
|
62
59
|
h as metaRadioGroupIndicator,
|
|
63
|
-
g as metaRadioGroupItem
|
|
64
|
-
M as propsMetaRadioGroup,
|
|
65
|
-
k as propsMetaRadioGroupIndicator,
|
|
66
|
-
b as propsMetaRadioGroupItem
|
|
60
|
+
g as metaRadioGroupItem
|
|
67
61
|
};
|
package/lib/select.ws.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { SelectIcon as o, TriggerIcon as c, FormTextFieldIcon as r, ViewportIcon as l, ContentIcon as
|
|
2
|
-
import { button as
|
|
1
|
+
import { SelectIcon as o, TriggerIcon as c, FormTextFieldIcon as r, ViewportIcon as l, ContentIcon as i, ItemIcon as p, CheckMarkIcon as s, TextIcon as a } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { button as d, span as t, div as n } from "@webstudio-is/sdk/normalize.css";
|
|
3
3
|
import { radix as e } from "./shared/meta.js";
|
|
4
|
-
import { propsSelect as
|
|
5
|
-
const
|
|
4
|
+
import { propsSelect as S, propsSelectTrigger as m, propsSelectValue as I, propsSelectViewport as g, propsSelectContent as y, propsSelectItem as h, propsSelectItemIndicator as T, propsSelectItemText as x } from "./__generated__/select.props.js";
|
|
5
|
+
const b = {
|
|
6
6
|
icon: o,
|
|
7
7
|
contentModel: {
|
|
8
8
|
category: "instance",
|
|
9
9
|
children: ["instance"],
|
|
10
10
|
descendants: [e.SelectTrigger, e.SelectContent]
|
|
11
|
-
}
|
|
12
|
-
|
|
11
|
+
},
|
|
12
|
+
initialProps: ["name", "value", "open", "required"],
|
|
13
|
+
props: S
|
|
14
|
+
}, f = {
|
|
13
15
|
icon: c,
|
|
14
16
|
contentModel: {
|
|
15
17
|
category: "none",
|
|
16
18
|
children: ["instance"],
|
|
17
19
|
descendants: [e.SelectValue]
|
|
18
20
|
},
|
|
19
|
-
presetStyle: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}, f = {
|
|
21
|
+
presetStyle: { button: d },
|
|
22
|
+
props: m
|
|
23
|
+
}, w = {
|
|
23
24
|
label: "Value",
|
|
24
25
|
icon: r,
|
|
25
26
|
contentModel: {
|
|
26
27
|
category: "none",
|
|
27
28
|
children: []
|
|
28
29
|
},
|
|
29
|
-
presetStyle: {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
presetStyle: { span: t },
|
|
31
|
+
initialProps: ["placeholder"],
|
|
32
|
+
props: I
|
|
32
33
|
}, v = {
|
|
33
|
-
icon:
|
|
34
|
+
icon: i,
|
|
34
35
|
contentModel: {
|
|
35
36
|
category: "none",
|
|
36
37
|
children: ["instance"],
|
|
37
38
|
descendants: [e.SelectViewport]
|
|
38
39
|
},
|
|
39
|
-
presetStyle: {
|
|
40
|
-
|
|
41
|
-
}
|
|
40
|
+
presetStyle: { div: n },
|
|
41
|
+
props: y
|
|
42
42
|
}, P = {
|
|
43
43
|
icon: l,
|
|
44
44
|
contentModel: {
|
|
@@ -46,74 +46,44 @@ const w = {
|
|
|
46
46
|
children: ["instance"],
|
|
47
47
|
descendants: [e.SelectItem]
|
|
48
48
|
},
|
|
49
|
-
presetStyle: {
|
|
50
|
-
|
|
51
|
-
}
|
|
49
|
+
presetStyle: { div: n },
|
|
50
|
+
props: g
|
|
52
51
|
}, k = {
|
|
53
|
-
icon:
|
|
52
|
+
icon: p,
|
|
54
53
|
contentModel: {
|
|
55
54
|
category: "none",
|
|
56
55
|
children: ["instance"],
|
|
57
56
|
descendants: [e.SelectItemIndicator, e.SelectItemText]
|
|
58
57
|
},
|
|
59
|
-
presetStyle: {
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
presetStyle: { div: n },
|
|
59
|
+
initialProps: ["value"],
|
|
60
|
+
props: h
|
|
62
61
|
}, F = {
|
|
63
62
|
label: "Indicator",
|
|
64
|
-
icon:
|
|
63
|
+
icon: s,
|
|
65
64
|
contentModel: {
|
|
66
65
|
category: "none",
|
|
67
66
|
children: ["instance"]
|
|
68
67
|
},
|
|
69
|
-
presetStyle: {
|
|
70
|
-
|
|
71
|
-
}
|
|
68
|
+
presetStyle: { span: t },
|
|
69
|
+
props: T
|
|
72
70
|
}, q = {
|
|
73
71
|
label: "Item Text",
|
|
74
|
-
icon:
|
|
72
|
+
icon: a,
|
|
75
73
|
contentModel: {
|
|
76
74
|
category: "none",
|
|
77
75
|
children: ["instance", "rich-text"]
|
|
78
76
|
},
|
|
79
|
-
presetStyle: {
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
}, j = {
|
|
83
|
-
props: d,
|
|
84
|
-
initialProps: ["name", "value", "open", "required"]
|
|
85
|
-
}, z = {
|
|
86
|
-
props: m
|
|
87
|
-
}, A = {
|
|
88
|
-
props: I,
|
|
89
|
-
initialProps: ["placeholder"]
|
|
90
|
-
}, B = {
|
|
91
|
-
props: M
|
|
92
|
-
}, D = {
|
|
93
|
-
props: g
|
|
94
|
-
}, E = {
|
|
95
|
-
props: y,
|
|
96
|
-
initialProps: ["value"]
|
|
97
|
-
}, G = {
|
|
98
|
-
props: T
|
|
99
|
-
}, H = {
|
|
100
|
-
props: h
|
|
77
|
+
presetStyle: { span: t },
|
|
78
|
+
props: x
|
|
101
79
|
};
|
|
102
80
|
export {
|
|
103
|
-
|
|
81
|
+
b as metaSelect,
|
|
104
82
|
v as metaSelectContent,
|
|
105
83
|
k as metaSelectItem,
|
|
106
84
|
F as metaSelectItemIndicator,
|
|
107
85
|
q as metaSelectItemText,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
P as metaSelectViewport
|
|
111
|
-
j as propsMetaSelect,
|
|
112
|
-
B as propsMetaSelectContent,
|
|
113
|
-
E as propsMetaSelectItem,
|
|
114
|
-
G as propsMetaSelectItemIndicator,
|
|
115
|
-
H as propsMetaSelectItemText,
|
|
116
|
-
z as propsMetaSelectTrigger,
|
|
117
|
-
A as propsMetaSelectValue,
|
|
118
|
-
D as propsMetaSelectViewport
|
|
86
|
+
f as metaSelectTrigger,
|
|
87
|
+
w as metaSelectValue,
|
|
88
|
+
P as metaSelectViewport
|
|
119
89
|
};
|
package/lib/switch.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as f } from "react";
|
|
3
|
-
import { Thumb as
|
|
4
|
-
|
|
3
|
+
import { Thumb as h, Root as a } from "@radix-ui/react-switch";
|
|
4
|
+
import { useControllableState as n } from "@radix-ui/react-use-controllable-state";
|
|
5
|
+
const d = f(({ defaultChecked: e, ...o }, t) => {
|
|
6
|
+
const [r, c] = n({
|
|
7
|
+
prop: o.checked ?? e ?? !1,
|
|
8
|
+
defaultProp: !1
|
|
9
|
+
});
|
|
10
|
+
return /* @__PURE__ */ m(
|
|
11
|
+
a,
|
|
12
|
+
{
|
|
13
|
+
...o,
|
|
14
|
+
ref: t,
|
|
15
|
+
checked: r,
|
|
16
|
+
onCheckedChange: c
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}), u = h;
|
|
5
20
|
export {
|
|
6
21
|
d as Switch,
|
|
7
|
-
|
|
22
|
+
u as SwitchThumb
|
|
8
23
|
};
|