@webstudio-is/sdk-components-react-radix 0.219.0 → 0.221.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/__generated__/tabs.props.js +2 -2
- package/lib/accordion.js +35 -23
- package/lib/accordion.template.js +4 -4
- package/lib/accordion.ws.js +27 -49
- package/lib/checkbox.js +17 -6
- package/lib/checkbox.ws.js +21 -36
- package/lib/collapsible.js +29 -26
- package/lib/collapsible.ws.js +8 -21
- package/lib/components.js +46 -45
- package/lib/dialog.js +50 -56
- package/lib/dialog.ws.js +36 -65
- package/lib/label.ws.js +8 -14
- package/lib/metas.js +45 -44
- package/lib/navigation-menu.ws.js +21 -35
- package/lib/popover.js +36 -32
- package/lib/popover.template.js +50 -20
- package/lib/popover.ws.js +35 -27
- package/lib/radio-group.js +10 -7
- package/lib/radio-group.ws.js +26 -44
- package/lib/select.js +49 -35
- package/lib/select.ws.js +33 -63
- package/lib/switch.js +9 -6
- package/lib/switch.ws.js +21 -44
- package/lib/tabs.js +46 -50
- package/lib/tabs.template.js +5 -5
- package/lib/tabs.ws.js +20 -42
- package/lib/tooltip.js +34 -31
- 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.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.ws.d.ts +1 -9
- 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 +9 -15
- package/lib/props.js +0 -62
- package/lib/types/props.d.ts +0 -12
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,51 @@
|
|
|
1
|
-
import { PopoverIcon as e, TriggerIcon as
|
|
2
|
-
import { div as
|
|
1
|
+
import { PopoverIcon as e, TriggerIcon as t, ContentIcon as n, ButtonElementIcon as r } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { div as p, button as i } from "@webstudio-is/sdk/normalize.css";
|
|
3
3
|
import { radix as o } from "./shared/meta.js";
|
|
4
|
-
import { propsPopover as
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { propsPopover as s, propsPopoverTrigger as c, propsPopoverContent as a, propsPopoverClose as l } from "./__generated__/popover.props.js";
|
|
5
|
+
import { buttonReset as d } from "./shared/preset-styles.js";
|
|
6
|
+
const C = {
|
|
7
|
+
icon: t,
|
|
7
8
|
contentModel: {
|
|
8
9
|
category: "none",
|
|
9
10
|
children: ["instance"]
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
},
|
|
12
|
+
props: c
|
|
13
|
+
}, y = {
|
|
14
|
+
icon: n,
|
|
13
15
|
contentModel: {
|
|
14
16
|
category: "none",
|
|
15
|
-
children: ["instance"]
|
|
17
|
+
children: ["instance"],
|
|
18
|
+
descendants: [o.PopoverClose]
|
|
16
19
|
},
|
|
17
20
|
presetStyle: {
|
|
18
|
-
div:
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
+
div: p
|
|
22
|
+
},
|
|
23
|
+
initialProps: ["side", "sideOffset", "align", "alignOffset"],
|
|
24
|
+
props: a
|
|
25
|
+
}, h = {
|
|
21
26
|
icon: e,
|
|
22
27
|
contentModel: {
|
|
23
28
|
category: "instance",
|
|
24
29
|
children: ["instance"],
|
|
25
30
|
descendants: [o.PopoverTrigger, o.PopoverContent]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
props:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
},
|
|
32
|
+
initialProps: ["open"],
|
|
33
|
+
props: s
|
|
34
|
+
}, u = {
|
|
35
|
+
icon: r,
|
|
36
|
+
label: "Close Button",
|
|
37
|
+
contentModel: {
|
|
38
|
+
category: "none",
|
|
39
|
+
children: ["instance", "rich-text"]
|
|
40
|
+
},
|
|
41
|
+
presetStyle: {
|
|
42
|
+
button: [d, i].flat()
|
|
43
|
+
},
|
|
44
|
+
props: l
|
|
35
45
|
};
|
|
36
46
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
M as propsMetaPopoverContent,
|
|
42
|
-
f as propsMetaPopoverTrigger
|
|
47
|
+
h as metaPopover,
|
|
48
|
+
u as metaPopoverClose,
|
|
49
|
+
y as metaPopoverContent,
|
|
50
|
+
C as metaPopoverTrigger
|
|
43
51
|
};
|
package/lib/radio-group.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as m } from "react";
|
|
3
|
-
import { Item as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c, useState as i, useEffect as m } from "react";
|
|
3
|
+
import { Item as s, Indicator as f, Root as d } from "@radix-ui/react-radio-group";
|
|
4
|
+
const I = c(({ defaultValue: r, ...t }, a) => {
|
|
5
|
+
const o = t.value ?? r ?? "", [u, e] = i(o);
|
|
6
|
+
return m(() => e(o), [o]), /* @__PURE__ */ n(d, { ...t, ref: a, value: u, onValueChange: e });
|
|
7
|
+
}), G = s, V = f;
|
|
5
8
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
I as RadioGroup,
|
|
10
|
+
V as RadioGroupIndicator,
|
|
11
|
+
G as RadioGroupItem
|
|
9
12
|
};
|
package/lib/radio-group.ws.js
CHANGED
|
@@ -1,67 +1,49 @@
|
|
|
1
|
-
import { RadioGroupIcon as e, ItemIcon as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const y = {
|
|
1
|
+
import { RadioGroupIcon as e, ItemIcon as t, TriggerIcon as r } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { div as n, button as a, span as i } from "@webstudio-is/sdk/normalize.css";
|
|
3
|
+
import { radix as o } from "./shared/meta.js";
|
|
4
|
+
import { buttonReset as c } from "./shared/preset-styles.js";
|
|
5
|
+
import { propsRadioGroup as p, propsRadioGroupItem as d, propsRadioGroupIndicator as s } from "./__generated__/radio-group.props.js";
|
|
6
|
+
const G = {
|
|
8
7
|
icon: e,
|
|
9
8
|
contentModel: {
|
|
10
9
|
category: "instance",
|
|
11
10
|
children: ["instance"],
|
|
12
|
-
descendants: [
|
|
11
|
+
descendants: [o.RadioGroupItem]
|
|
13
12
|
},
|
|
14
13
|
states: [
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
label: "Checked",
|
|
18
|
-
selector: "[data-state=checked]",
|
|
19
|
-
category: "component-states"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
label: "Unchecked",
|
|
23
|
-
selector: "[data-state=unchecked]",
|
|
24
|
-
category: "component-states"
|
|
25
|
-
}
|
|
14
|
+
{ label: "Checked", selector: "[data-state=checked]" },
|
|
15
|
+
{ label: "Unchecked", selector: "[data-state=unchecked]" }
|
|
26
16
|
],
|
|
27
17
|
presetStyle: {
|
|
28
18
|
div: n
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
},
|
|
20
|
+
initialProps: ["id", "class", "name", "value", "required"],
|
|
21
|
+
props: p
|
|
22
|
+
}, h = {
|
|
23
|
+
icon: t,
|
|
32
24
|
contentModel: {
|
|
33
25
|
category: "none",
|
|
34
26
|
children: ["instance"],
|
|
35
|
-
descendants: [
|
|
27
|
+
descendants: [o.RadioGroupIndicator]
|
|
36
28
|
},
|
|
37
|
-
states: o,
|
|
38
29
|
presetStyle: {
|
|
39
|
-
button: [
|
|
40
|
-
}
|
|
41
|
-
|
|
30
|
+
button: [a, c].flat()
|
|
31
|
+
},
|
|
32
|
+
initialProps: ["value"],
|
|
33
|
+
props: d
|
|
34
|
+
}, f = {
|
|
42
35
|
icon: r,
|
|
43
36
|
contentModel: {
|
|
44
37
|
category: "none",
|
|
45
38
|
children: ["instance"]
|
|
46
39
|
},
|
|
47
|
-
states: o,
|
|
48
40
|
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
|
|
41
|
+
span: i
|
|
42
|
+
},
|
|
43
|
+
props: s
|
|
59
44
|
};
|
|
60
45
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
M as propsMetaRadioGroup,
|
|
65
|
-
k as propsMetaRadioGroupIndicator,
|
|
66
|
-
b as propsMetaRadioGroupItem
|
|
46
|
+
G as metaRadioGroup,
|
|
47
|
+
f as metaRadioGroupIndicator,
|
|
48
|
+
h as metaRadioGroupItem
|
|
67
49
|
};
|
package/lib/select.js
CHANGED
|
@@ -1,44 +1,58 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Viewport as
|
|
4
|
-
import { ReactSdkContext as
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as a, useState as m, useEffect as f, useContext as g } from "react";
|
|
3
|
+
import { Viewport as C, Item as I, ItemIndicator as P, ItemText as h, Root as x, Trigger as V, Value as v, Portal as w, Content as T } from "@radix-ui/react-select";
|
|
4
|
+
import { ReactSdkContext as $, getClosestInstance as u } from "@webstudio-is/react-sdk/runtime";
|
|
5
|
+
const y = a(({ defaultOpen: t, defaultValue: e, ...n }, o) => {
|
|
6
|
+
const c = n.open ?? t ?? !1, [S, l] = m(c);
|
|
7
|
+
f(() => l(c), [c]);
|
|
8
|
+
const i = n.value ?? e ?? "", [d, p] = m(i);
|
|
9
|
+
return f(() => p(i), [i]), /* @__PURE__ */ r(
|
|
10
|
+
x,
|
|
11
|
+
{
|
|
12
|
+
...n,
|
|
13
|
+
open: S,
|
|
14
|
+
onOpenChange: l,
|
|
15
|
+
value: d,
|
|
16
|
+
onValueChange: p
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}), M = a((t, e) => {
|
|
20
|
+
const { renderer: n } = g($);
|
|
21
|
+
return /* @__PURE__ */ r(V, { onPointerDown: n === "canvas" ? (c) => {
|
|
22
|
+
c.preventDefault();
|
|
23
|
+
} : void 0, ref: e, ...t });
|
|
24
|
+
}), N = a((t, e) => /* @__PURE__ */ r(v, { ref: e, ...t })), b = a((t, e) => /* @__PURE__ */ r(w, { children: /* @__PURE__ */ r(T, { ref: e, ...t, position: "popper" }) })), j = C, E = I, U = P, _ = h, s = "@webstudio-is/sdk-components-react-radix", q = {
|
|
25
|
+
onNavigatorUnselect: (t, e) => {
|
|
26
|
+
for (const n of e.instancePath)
|
|
27
|
+
if (n.component === `${s}:SelectContent`) {
|
|
28
|
+
const o = u(
|
|
29
|
+
e.instancePath,
|
|
30
|
+
n,
|
|
31
|
+
`${s}:Select`
|
|
18
32
|
);
|
|
19
|
-
|
|
33
|
+
o && t.setMemoryProp(o, "open", void 0);
|
|
20
34
|
}
|
|
21
35
|
},
|
|
22
|
-
onNavigatorSelect: (
|
|
23
|
-
for (const
|
|
24
|
-
if (
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
`${
|
|
36
|
+
onNavigatorSelect: (t, e) => {
|
|
37
|
+
for (const n of e.instancePath)
|
|
38
|
+
if (n.component === `${s}:SelectContent`) {
|
|
39
|
+
const o = u(
|
|
40
|
+
e.instancePath,
|
|
41
|
+
n,
|
|
42
|
+
`${s}:Select`
|
|
29
43
|
);
|
|
30
|
-
|
|
44
|
+
o && t.setMemoryProp(o, "open", !0);
|
|
31
45
|
}
|
|
32
46
|
}
|
|
33
47
|
};
|
|
34
48
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
y as Select,
|
|
50
|
+
b as SelectContent,
|
|
51
|
+
E as SelectItem,
|
|
52
|
+
U as SelectItemIndicator,
|
|
53
|
+
_ as SelectItemText,
|
|
54
|
+
M as SelectTrigger,
|
|
55
|
+
N as SelectValue,
|
|
56
|
+
j as SelectViewport,
|
|
57
|
+
q as hooksSelect
|
|
44
58
|
};
|
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,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Thumb as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m, useState as n, useEffect as s } from "react";
|
|
3
|
+
import { Thumb as d, Root as u } from "@radix-ui/react-switch";
|
|
4
|
+
const C = m(({ defaultChecked: o, ...t }, r) => {
|
|
5
|
+
const e = t.checked ?? o ?? !1, [h, c] = n(e);
|
|
6
|
+
return s(() => c(e), [e]), /* @__PURE__ */ f(u, { ...t, ref: r, checked: h, onCheckedChange: c });
|
|
7
|
+
}), w = d;
|
|
5
8
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
C as Switch,
|
|
10
|
+
w as SwitchThumb
|
|
8
11
|
};
|
package/lib/switch.ws.js
CHANGED
|
@@ -1,63 +1,40 @@
|
|
|
1
|
-
import { SwitchIcon as e, TriggerIcon as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { radix as s } from "./shared/meta.js";
|
|
1
|
+
import { SwitchIcon as e, TriggerIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { button as c, span as o } from "@webstudio-is/sdk/normalize.css";
|
|
3
|
+
import { radix as a } from "./shared/meta.js";
|
|
5
4
|
import { buttonReset as n } from "./shared/preset-styles.js";
|
|
6
|
-
import { propsSwitch as r, propsSwitchThumb as
|
|
7
|
-
const
|
|
5
|
+
import { propsSwitch as r, propsSwitchThumb as s } from "./__generated__/switch.props.js";
|
|
6
|
+
const m = {
|
|
8
7
|
icon: e,
|
|
9
8
|
contentModel: {
|
|
10
9
|
category: "instance",
|
|
11
10
|
children: ["instance"],
|
|
12
|
-
descendants: [
|
|
11
|
+
descendants: [a.SwitchThumb]
|
|
13
12
|
},
|
|
14
13
|
states: [
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
label: "Checked",
|
|
18
|
-
selector: "[data-state=checked]",
|
|
19
|
-
category: "component-states"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
label: "Unchecked",
|
|
23
|
-
selector: "[data-state=unchecked]",
|
|
24
|
-
category: "component-states"
|
|
25
|
-
}
|
|
14
|
+
{ label: "Checked", selector: "[data-state=checked]" },
|
|
15
|
+
{ label: "Unchecked", selector: "[data-state=unchecked]" }
|
|
26
16
|
],
|
|
27
17
|
presetStyle: {
|
|
28
|
-
button: [
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
button: [c, n].flat()
|
|
19
|
+
},
|
|
20
|
+
initialProps: ["id", "class", "name", "value", "checked", "required"],
|
|
21
|
+
props: r
|
|
22
|
+
}, b = {
|
|
23
|
+
icon: t,
|
|
32
24
|
contentModel: {
|
|
33
25
|
category: "none",
|
|
34
26
|
children: ["instance"]
|
|
35
27
|
},
|
|
36
28
|
states: [
|
|
37
|
-
|
|
38
|
-
{
|
|
39
|
-
label: "Checked",
|
|
40
|
-
selector: "[data-state=checked]",
|
|
41
|
-
category: "component-states"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
label: "Unchecked",
|
|
45
|
-
selector: "[data-state=unchecked]",
|
|
46
|
-
category: "component-states"
|
|
47
|
-
}
|
|
29
|
+
{ label: "Checked", selector: "[data-state=checked]" },
|
|
30
|
+
{ label: "Unchecked", selector: "[data-state=unchecked]" }
|
|
48
31
|
],
|
|
49
32
|
presetStyle: {
|
|
50
|
-
span:
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
props: r,
|
|
54
|
-
initialProps: ["id", "className", "name", "value", "checked", "required"]
|
|
55
|
-
}, f = {
|
|
56
|
-
props: i
|
|
33
|
+
span: o
|
|
34
|
+
},
|
|
35
|
+
props: s
|
|
57
36
|
};
|
|
58
37
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
k as propsMetaSwitch,
|
|
62
|
-
f as propsMetaSwitchThumb
|
|
38
|
+
m as metaSwitch,
|
|
39
|
+
b as metaSwitchThumb
|
|
63
40
|
};
|