@webstudio-is/sdk-components-react-radix 0.220.0 → 0.222.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/label.ws.js CHANGED
@@ -1,16 +1,12 @@
1
1
  import { LabelIcon as o } from "@webstudio-is/icons/svg";
2
- import { defaultStates as t } from "@webstudio-is/sdk";
3
2
  import { label as r } from "@webstudio-is/sdk/normalize.css";
4
- import { props as e } from "./__generated__/label.props.js";
5
- const a = {
3
+ import { props as t } from "./__generated__/label.props.js";
4
+ const m = {
6
5
  icon: o,
7
- states: t,
8
- presetStyle: {
9
- label: r
10
- },
6
+ presetStyle: { label: r },
11
7
  initialProps: ["id", "class", "for"],
12
- props: e
8
+ props: t
13
9
  };
14
10
  export {
15
- a as meta
11
+ m as meta
16
12
  };
package/lib/popover.js CHANGED
@@ -1,49 +1,52 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { forwardRef as c, Children as P } from "react";
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
- const r = P.toArray(o)[0];
7
- return /* @__PURE__ */ n(i.Trigger, { asChild: !0, ref: e, ...t, children: r ?? /* @__PURE__ */ n("button", { children: "Add button or link" }) });
8
- }), h = c(
9
- ({ sideOffset: o = 4, align: t = "center", hideWhenDetached: e = !0, ...r }, a) => /* @__PURE__ */ n(i.Portal, { children: /* @__PURE__ */ n(
10
- i.Content,
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as p, useState as f, useEffect as P, Children as l } from "react";
3
+ import * as s from "@radix-ui/react-popover";
4
+ import { getClosestInstance as a } from "@webstudio-is/react-sdk/runtime";
5
+ const h = p((t, n) => {
6
+ const o = t.open ?? !1, [e, i] = f(o);
7
+ return P(() => i(o), [o]), /* @__PURE__ */ r(s.Root, { ...t, open: e, onOpenChange: i });
8
+ }), u = p(({ children: t, ...n }, o) => {
9
+ const e = l.toArray(t)[0];
10
+ return /* @__PURE__ */ r(s.Trigger, { asChild: !0, ref: o, ...n, children: e ?? /* @__PURE__ */ r("button", { children: "Add button or link" }) });
11
+ }), C = p(
12
+ ({ sideOffset: t = 4, align: n = "center", hideWhenDetached: o = !0, ...e }, i) => /* @__PURE__ */ r(s.Portal, { children: /* @__PURE__ */ r(
13
+ s.Content,
11
14
  {
12
- ref: a,
15
+ ref: i,
13
16
  align: "center",
14
- sideOffset: o,
15
- hideWhenDetached: e,
16
- ...r
17
+ sideOffset: t,
18
+ hideWhenDetached: o,
19
+ ...e
17
20
  }
18
21
  ) })
19
- ), C = i.Close, s = "@webstudio-is/sdk-components-react-radix", g = {
20
- onNavigatorUnselect: (o, t) => {
21
- for (const e of t.instancePath)
22
- if (e.component === `${s}:PopoverContent`) {
23
- const r = p(
24
- t.instancePath,
25
- e,
26
- `${s}:Popover`
22
+ ), g = s.Close, c = "@webstudio-is/sdk-components-react-radix", $ = {
23
+ onNavigatorUnselect: (t, n) => {
24
+ for (const o of n.instancePath)
25
+ if (o.component === `${c}:PopoverContent`) {
26
+ const e = a(
27
+ n.instancePath,
28
+ o,
29
+ `${c}:Popover`
27
30
  );
28
- r && o.setMemoryProp(r, "open", void 0);
31
+ e && t.setMemoryProp(e, "open", void 0);
29
32
  }
30
33
  },
31
- onNavigatorSelect: (o, t) => {
32
- for (const e of t.instancePath)
33
- if (e.component === `${s}:PopoverContent`) {
34
- const r = p(
35
- t.instancePath,
36
- e,
37
- `${s}:Popover`
34
+ onNavigatorSelect: (t, n) => {
35
+ for (const o of n.instancePath)
36
+ if (o.component === `${c}:PopoverContent`) {
37
+ const e = a(
38
+ n.instancePath,
39
+ o,
40
+ `${c}:Popover`
38
41
  );
39
- r && o.setMemoryProp(r, "open", !0);
42
+ e && t.setMemoryProp(e, "open", !0);
40
43
  }
41
44
  }
42
45
  };
43
46
  export {
44
- v as Popover,
45
- C as PopoverClose,
46
- h as PopoverContent,
47
- d as PopoverTrigger,
48
- g as hooksPopover
47
+ h as Popover,
48
+ g as PopoverClose,
49
+ C as PopoverContent,
50
+ u as PopoverTrigger,
51
+ $ as hooksPopover
49
52
  };
package/lib/popover.ws.js CHANGED
@@ -1,17 +1,16 @@
1
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";
2
+ import { div as p, button as i } from "@webstudio-is/sdk/normalize.css";
4
3
  import { radix as o } from "./shared/meta.js";
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 = {
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 = {
8
7
  icon: t,
9
8
  contentModel: {
10
9
  category: "none",
11
10
  children: ["instance"]
12
11
  },
13
- props: a
14
- }, h = {
12
+ props: c
13
+ }, y = {
15
14
  icon: n,
16
15
  contentModel: {
17
16
  category: "none",
@@ -19,11 +18,11 @@ const y = {
19
18
  descendants: [o.PopoverClose]
20
19
  },
21
20
  presetStyle: {
22
- div: s
21
+ div: p
23
22
  },
24
23
  initialProps: ["side", "sideOffset", "align", "alignOffset"],
25
- props: l
26
- }, b = {
24
+ props: a
25
+ }, h = {
27
26
  icon: e,
28
27
  contentModel: {
29
28
  category: "instance",
@@ -31,23 +30,22 @@ const y = {
31
30
  descendants: [o.PopoverTrigger, o.PopoverContent]
32
31
  },
33
32
  initialProps: ["open"],
34
- props: c
35
- }, I = {
33
+ props: s
34
+ }, u = {
36
35
  icon: r,
37
36
  label: "Close Button",
38
37
  contentModel: {
39
38
  category: "none",
40
39
  children: ["instance", "rich-text"]
41
40
  },
42
- states: p,
43
41
  presetStyle: {
44
- button: [m, i].flat()
42
+ button: [d, i].flat()
45
43
  },
46
- props: d
44
+ props: l
47
45
  };
48
46
  export {
49
- b as metaPopover,
50
- I as metaPopoverClose,
51
- h as metaPopoverContent,
52
- y as metaPopoverTrigger
47
+ h as metaPopover,
48
+ u as metaPopoverClose,
49
+ y as metaPopoverContent,
50
+ C as metaPopoverTrigger
53
51
  };
@@ -1,16 +1,12 @@
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;
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;
12
8
  export {
13
- R as RadioGroup,
14
- G as RadioGroupIndicator,
15
- I as RadioGroupItem
9
+ I as RadioGroup,
10
+ V as RadioGroupIndicator,
11
+ G as RadioGroupItem
16
12
  };
@@ -1,61 +1,49 @@
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
- const y = {
8
- icon: o,
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 = {
7
+ icon: e,
9
8
  contentModel: {
10
9
  category: "instance",
11
10
  children: ["instance"],
12
- descendants: [e.RadioGroupItem]
11
+ descendants: [o.RadioGroupItem]
13
12
  },
14
13
  states: [
15
- ...t,
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
19
  },
30
20
  initialProps: ["id", "class", "name", "value", "required"],
31
21
  props: p
32
- }, g = {
33
- icon: r,
22
+ }, h = {
23
+ icon: t,
34
24
  contentModel: {
35
25
  category: "none",
36
26
  children: ["instance"],
37
- descendants: [e.RadioGroupIndicator]
27
+ descendants: [o.RadioGroupIndicator]
38
28
  },
39
- states: t,
40
29
  presetStyle: {
41
- button: [c, i].flat()
30
+ button: [a, c].flat()
42
31
  },
43
32
  initialProps: ["value"],
44
33
  props: d
45
- }, h = {
46
- icon: a,
34
+ }, f = {
35
+ icon: r,
47
36
  contentModel: {
48
37
  category: "none",
49
38
  children: ["instance"]
50
39
  },
51
- states: t,
52
40
  presetStyle: {
53
- span: s
41
+ span: i
54
42
  },
55
- props: l
43
+ props: s
56
44
  };
57
45
  export {
58
- y as metaRadioGroup,
59
- h as metaRadioGroupIndicator,
60
- g as metaRadioGroupItem
46
+ G as metaRadioGroup,
47
+ f as metaRadioGroupIndicator,
48
+ h as metaRadioGroupItem
61
49
  };
package/lib/select.js CHANGED
@@ -1,44 +1,58 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { forwardRef as s, useContext as l } from "react";
3
- import { Viewport as m, Item as p, ItemIndicator as f, ItemText as S, Root as d, Trigger as u, Value as I, Portal as P, Content as g } from "@radix-ui/react-select";
4
- import { ReactSdkContext as x, getClosestInstance as i } from "@webstudio-is/react-sdk/runtime";
5
- const v = s(({ value: e, defaultValue: t, ...o }, n) => /* @__PURE__ */ c(d, { ...o, defaultValue: e ?? t })), T = s((e, t) => {
6
- const { renderer: o } = l(x);
7
- return /* @__PURE__ */ c(u, { onPointerDown: o === "canvas" ? (a) => {
8
- a.preventDefault();
9
- } : void 0, ref: t, ...e });
10
- }), $ = s((e, t) => /* @__PURE__ */ c(I, { ref: t, ...e })), k = s((e, t) => /* @__PURE__ */ c(P, { children: /* @__PURE__ */ c(g, { ref: t, ...e, position: "popper" }) })), D = m, R = p, y = f, M = S, r = "@webstudio-is/sdk-components-react-radix", N = {
11
- onNavigatorUnselect: (e, t) => {
12
- for (const o of t.instancePath)
13
- if (o.component === `${r}:SelectContent`) {
14
- const n = i(
15
- t.instancePath,
16
- o,
17
- `${r}:Select`
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
- n && e.setMemoryProp(n, "open", void 0);
33
+ o && t.setMemoryProp(o, "open", void 0);
20
34
  }
21
35
  },
22
- onNavigatorSelect: (e, t) => {
23
- for (const o of t.instancePath)
24
- if (o.component === `${r}:SelectContent`) {
25
- const n = i(
26
- t.instancePath,
27
- o,
28
- `${r}:Select`
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
- n && e.setMemoryProp(n, "open", !0);
44
+ o && t.setMemoryProp(o, "open", !0);
31
45
  }
32
46
  }
33
47
  };
34
48
  export {
35
- v as Select,
36
- k as SelectContent,
37
- R as SelectItem,
38
- y as SelectItemIndicator,
39
- M as SelectItemText,
40
- T as SelectTrigger,
41
- $ as SelectValue,
42
- D as SelectViewport,
43
- N as hooksSelect
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/switch.js CHANGED
@@ -1,23 +1,11 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { forwardRef as f } from "react";
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;
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;
20
8
  export {
21
- d as Switch,
22
- u as SwitchThumb
9
+ C as Switch,
10
+ w as SwitchThumb
23
11
  };
package/lib/switch.ws.js CHANGED
@@ -1,59 +1,40 @@
1
- import { SwitchIcon as t, TriggerIcon as c } from "@webstudio-is/icons/svg";
2
- import { defaultStates as e } from "@webstudio-is/sdk";
3
- import { button as o, span as a } from "@webstudio-is/sdk/normalize.css";
4
- import { radix as n } from "./shared/meta.js";
5
- import { buttonReset as s } from "./shared/preset-styles.js";
6
- import { propsSwitch as r, propsSwitchThumb as i } from "./__generated__/switch.props.js";
7
- const b = {
8
- icon: t,
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";
4
+ import { buttonReset as n } from "./shared/preset-styles.js";
5
+ import { propsSwitch as r, propsSwitchThumb as s } from "./__generated__/switch.props.js";
6
+ const m = {
7
+ icon: e,
9
8
  contentModel: {
10
9
  category: "instance",
11
10
  children: ["instance"],
12
- descendants: [n.SwitchThumb]
11
+ descendants: [a.SwitchThumb]
13
12
  },
14
13
  states: [
15
- ...e,
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: [o, s].flat()
18
+ button: [c, n].flat()
29
19
  },
30
20
  initialProps: ["id", "class", "name", "value", "checked", "required"],
31
21
  props: r
32
- }, k = {
33
- icon: c,
22
+ }, b = {
23
+ icon: t,
34
24
  contentModel: {
35
25
  category: "none",
36
26
  children: ["instance"]
37
27
  },
38
28
  states: [
39
- ...e,
40
- {
41
- label: "Checked",
42
- selector: "[data-state=checked]",
43
- category: "component-states"
44
- },
45
- {
46
- label: "Unchecked",
47
- selector: "[data-state=unchecked]",
48
- category: "component-states"
49
- }
29
+ { label: "Checked", selector: "[data-state=checked]" },
30
+ { label: "Unchecked", selector: "[data-state=unchecked]" }
50
31
  ],
51
32
  presetStyle: {
52
- span: a
33
+ span: o
53
34
  },
54
- props: i
35
+ props: s
55
36
  };
56
37
  export {
57
- b as metaSwitch,
58
- k as metaSwitchThumb
38
+ m as metaSwitch,
39
+ b as metaSwitchThumb
59
40
  };
package/lib/tabs.js CHANGED
@@ -1,66 +1,62 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import u from "await-interaction-response";
3
- import { forwardRef as c, useCallback as f } from "react";
4
- import { useControllableState as b } from "@radix-ui/react-use-controllable-state";
5
- import { List as p, Root as T, Trigger as d, Content as h } from "@radix-ui/react-tabs";
6
- import { getIndexWithinAncestorFromProps as g } from "@webstudio-is/sdk/runtime";
7
- import { getClosestInstance as l } from "@webstudio-is/react-sdk/runtime";
8
- const k = c(({ defaultValue: e, ...n }, o) => {
9
- const [t, a] = b({
10
- prop: n.value,
11
- defaultProp: e ?? "",
12
- onChange: n.onValueChange
13
- }), s = f(
14
- async (m) => {
15
- await u(), a(m);
16
- },
17
- [a]
18
- );
19
- return /* @__PURE__ */ i(
20
- T,
21
- {
22
- ref: o,
23
- ...n,
24
- value: t,
25
- onValueChange: s
26
- }
27
- );
28
- }), w = p, y = c(({ value: e, ...n }, o) => {
29
- const t = g(n);
30
- return /* @__PURE__ */ i(d, { ref: o, value: e ?? t ?? "", ...n });
31
- }), A = c(({ value: e, ...n }, o) => {
32
- const t = g(n);
33
- return /* @__PURE__ */ i(h, { ref: o, value: e ?? t ?? "", ...n });
34
- }), r = "@webstudio-is/sdk-components-react-radix", R = {
35
- onNavigatorSelect: (e, n) => {
2
+ import f from "await-interaction-response";
3
+ import { forwardRef as c, useState as b, useEffect as T, useCallback as d } from "react";
4
+ import { List as p, Root as h, Trigger as v, Content as P } from "@radix-ui/react-tabs";
5
+ import { getIndexWithinAncestorFromProps as l } from "@webstudio-is/sdk/runtime";
6
+ import { getClosestInstance as u } from "@webstudio-is/react-sdk/runtime";
7
+ const w = c(
8
+ ({ defaultValue: n, ...e }, o) => {
9
+ const t = e.value ?? n ?? "", [s, a] = b(t);
10
+ T(() => a(t), [t]);
11
+ const m = d(async (g) => {
12
+ await f(), a(g);
13
+ }, []);
14
+ return /* @__PURE__ */ i(
15
+ h,
16
+ {
17
+ ref: o,
18
+ ...e,
19
+ value: s,
20
+ onValueChange: m
21
+ }
22
+ );
23
+ }
24
+ ), y = p, A = c(({ value: n, ...e }, o) => {
25
+ const t = l(e);
26
+ return /* @__PURE__ */ i(v, { ref: o, value: n ?? t ?? "", ...e });
27
+ }), R = c(({ value: n, ...e }, o) => {
28
+ const t = l(e);
29
+ return /* @__PURE__ */ i(P, { ref: o, value: n ?? t ?? "", ...e });
30
+ }), r = "@webstudio-is/sdk-components-react-radix", W = {
31
+ onNavigatorSelect: (n, e) => {
36
32
  var o;
37
- for (const t of n.instancePath)
33
+ for (const t of e.instancePath)
38
34
  if (t.component === `${r}:TabsContent` || t.component === `${r}:TabsTrigger`) {
39
- const a = l(
40
- n.instancePath,
35
+ const s = u(
36
+ e.instancePath,
41
37
  t,
42
38
  `${r}:Tabs`
43
- ), s = e.getPropValue(t, "value") ?? ((o = e.indexesWithinAncestors.get(t.id)) == null ? void 0 : o.toString());
44
- a && s && e.setMemoryProp(a, "value", s);
39
+ ), a = n.getPropValue(t, "value") ?? ((o = n.indexesWithinAncestors.get(t.id)) == null ? void 0 : o.toString());
40
+ s && a && n.setMemoryProp(s, "value", a);
45
41
  }
46
42
  },
47
- onNavigatorUnselect: (e, n) => {
43
+ onNavigatorUnselect: (n, e) => {
48
44
  var o;
49
- for (const t of n.instancePath)
45
+ for (const t of e.instancePath)
50
46
  if (t.component === `${r}:TabsContent` || t.component === `${r}:TabsTrigger`) {
51
- const a = l(
52
- n.instancePath,
47
+ const s = u(
48
+ e.instancePath,
53
49
  t,
54
50
  `${r}:Tabs`
55
- ), s = e.getPropValue(t, "value") ?? ((o = e.indexesWithinAncestors.get(t.id)) == null ? void 0 : o.toString());
56
- a && s && e.setMemoryProp(a, "value", void 0);
51
+ ), a = n.getPropValue(t, "value") ?? ((o = n.indexesWithinAncestors.get(t.id)) == null ? void 0 : o.toString());
52
+ s && a && n.setMemoryProp(s, "value", void 0);
57
53
  }
58
54
  }
59
55
  };
60
56
  export {
61
- k as Tabs,
62
- A as TabsContent,
63
- w as TabsList,
64
- y as TabsTrigger,
65
- R as hooksTabs
57
+ w as Tabs,
58
+ R as TabsContent,
59
+ y as TabsList,
60
+ A as TabsTrigger,
61
+ W as hooksTabs
66
62
  };
@@ -1,7 +1,7 @@
1
1
  import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
2
  import { PlaceholderValue as o, css as a } from "@webstudio-is/template";
3
3
  import { radix as e } from "./shared/proxy.js";
4
- import { height as g, borderRadius as l, colors as n, spacing as i, fontSize as h, fontSizeLineHeight as u, weights as b, transition as p, boxShadow as r, opacity as m } from "./shared/theme.js";
4
+ import { height as g, borderRadius as l, colors as n, spacing as i, fontSize as h, fontSizeLineHeight as b, weights as p, transition as u, boxShadow as r, opacity as m } from "./shared/theme.js";
5
5
  const d = a`
6
6
  display: inline-flex;
7
7
  align-items: center;
@@ -10,9 +10,9 @@ const d = a`
10
10
  border-radius: ${l.md};
11
11
  padding: ${i[1.5]} ${i[3]};
12
12
  font-size: ${h.sm};
13
- line-height: ${u.sm};
14
- font-weight: ${b.medium};
15
- transition: ${p.all};
13
+ line-height: ${b.sm};
14
+ font-weight: ${p.medium};
15
+ transition: ${u.all};
16
16
  &:focus-visible {
17
17
  outline: 2px solid transparent;
18
18
  outline-offset: 2px;
@@ -37,7 +37,7 @@ const d = a`
37
37
  category: "radix",
38
38
  description: "A set of panels with content that are displayed one at a time. Duplicate both a tab trigger and tab content to add more tabs. Triggers and content are connected according to their order in the Navigator.",
39
39
  order: 2,
40
- template: /* @__PURE__ */ s(e.Tabs, { defaultValue: "0", children: [
40
+ template: /* @__PURE__ */ s(e.Tabs, { value: "0", children: [
41
41
  /* @__PURE__ */ s(
42
42
  e.TabsList,
43
43
  {