@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.
Files changed (75) hide show
  1. package/lib/__generated__/accordion.props.js +15 -2582
  2. package/lib/__generated__/checkbox.props.js +5 -1071
  3. package/lib/__generated__/collapsible.props.js +7 -1012
  4. package/lib/__generated__/dialog.props.js +10 -2585
  5. package/lib/__generated__/label.props.js +2 -517
  6. package/lib/__generated__/navigation-menu.props.js +13 -3625
  7. package/lib/__generated__/popover.props.js +7 -509
  8. package/lib/__generated__/radio-group.props.js +19 -1568
  9. package/lib/__generated__/select.props.js +42 -3615
  10. package/lib/__generated__/switch.props.js +5 -1071
  11. package/lib/__generated__/tabs.props.js +17 -2073
  12. package/lib/__generated__/tooltip.props.js +6 -503
  13. package/lib/accordion.js +33 -20
  14. package/lib/accordion.template.js +14 -14
  15. package/lib/accordion.ws.js +56 -93
  16. package/lib/checkbox.js +17 -6
  17. package/lib/checkbox.template.js +10 -10
  18. package/lib/checkbox.ws.js +26 -41
  19. package/lib/collapsible.js +29 -26
  20. package/lib/collapsible.ws.js +28 -48
  21. package/lib/components.js +46 -45
  22. package/lib/dialog.js +50 -56
  23. package/lib/dialog.template.js +19 -19
  24. package/lib/dialog.ws.js +68 -126
  25. package/lib/label.template.js +3 -3
  26. package/lib/label.ws.js +8 -15
  27. package/lib/metas.js +45 -44
  28. package/lib/navigation-menu.js +21 -20
  29. package/lib/navigation-menu.template.js +8 -8
  30. package/lib/navigation-menu.ws.js +71 -102
  31. package/lib/popover.js +36 -32
  32. package/lib/popover.template.js +50 -20
  33. package/lib/popover.ws.js +45 -44
  34. package/lib/radio-group.js +10 -7
  35. package/lib/radio-group.ws.js +37 -61
  36. package/lib/select.js +49 -37
  37. package/lib/select.ws.js +71 -137
  38. package/lib/shared/meta.js +13 -0
  39. package/lib/shared/preset-styles.js +29 -29
  40. package/lib/shared/theme.js +25 -68
  41. package/lib/sheet.template.js +32 -32
  42. package/lib/switch.js +9 -6
  43. package/lib/switch.template.js +9 -9
  44. package/lib/switch.ws.js +29 -52
  45. package/lib/tabs.js +50 -53
  46. package/lib/tabs.template.js +16 -16
  47. package/lib/tabs.ws.js +41 -76
  48. package/lib/tooltip.js +34 -31
  49. package/lib/tooltip.ws.js +27 -42
  50. package/lib/types/__generated__/popover.props.d.ts +1 -0
  51. package/lib/types/accordion.ws.d.ts +1 -6
  52. package/lib/types/checkbox.ws.d.ts +1 -3
  53. package/lib/types/collapsible.d.ts +2 -2
  54. package/lib/types/collapsible.ws.d.ts +1 -4
  55. package/lib/types/components.d.ts +1 -1
  56. package/lib/types/dialog.ws.d.ts +1 -8
  57. package/lib/types/label.ws.d.ts +1 -2
  58. package/lib/types/metas.d.ts +1 -1
  59. package/lib/types/navigation-menu.ws.d.ts +1 -8
  60. package/lib/types/popover.d.ts +1 -0
  61. package/lib/types/popover.ws.d.ts +2 -4
  62. package/lib/types/radio-group.d.ts +1 -1
  63. package/lib/types/radio-group.ws.d.ts +1 -4
  64. package/lib/types/select.d.ts +3 -3
  65. package/lib/types/select.ws.d.ts +1 -9
  66. package/lib/types/shared/meta.d.ts +1 -0
  67. package/lib/types/shared/preset-styles.d.ts +2 -2
  68. package/lib/types/shared/proxy.d.ts +1 -0
  69. package/lib/types/switch.ws.d.ts +1 -3
  70. package/lib/types/tabs.d.ts +1 -4
  71. package/lib/types/tabs.ws.d.ts +1 -5
  72. package/lib/types/tooltip.ws.d.ts +1 -4
  73. package/package.json +21 -27
  74. package/lib/props.js +0 -62
  75. package/lib/types/props.d.ts +0 -12
package/lib/components.js CHANGED
@@ -1,23 +1,23 @@
1
1
  import { Collapsible as t, CollapsibleContent as r, CollapsibleTrigger as i } from "./collapsible.js";
2
2
  import { Dialog as a, DialogClose as l, DialogContent as g, DialogDescription as p, DialogOverlay as c, DialogTitle as m, DialogTrigger as T } from "./dialog.js";
3
- import { Popover as C, PopoverContent as d, PopoverTrigger as f } from "./popover.js";
4
- import { Tooltip as b, TooltipContent as s, TooltipTrigger as v } from "./tooltip.js";
5
- import { Tabs as I, TabsContent as D, TabsList as M, TabsTrigger as N } from "./tabs.js";
6
- import { Label as A } from "./label.js";
7
- import { Accordion as L, AccordionContent as k, AccordionHeader as G, AccordionItem as P, AccordionTrigger as R } from "./accordion.js";
8
- import { NavigationMenu as y, NavigationMenuContent as H, NavigationMenuItem as O, NavigationMenuLink as j, NavigationMenuList as q, NavigationMenuTrigger as z, NavigationMenuViewport as B } from "./navigation-menu.js";
9
- import { Select as F, SelectContent as J, SelectItem as K, SelectItemIndicator as Q, SelectItemText as U, SelectTrigger as W, SelectValue as X, SelectViewport as Y } from "./select.js";
10
- import { Switch as _, SwitchThumb as $ } from "./switch.js";
11
- import { Checkbox as eo, CheckboxIndicator as to } from "./checkbox.js";
12
- import { RadioGroup as io, RadioGroupIndicator as no, RadioGroupItem as ao } from "./radio-group.js";
3
+ import { Popover as C, PopoverClose as d, PopoverContent as f, PopoverTrigger as s } from "./popover.js";
4
+ import { Tooltip as v, TooltipContent as b, TooltipTrigger as S } from "./tooltip.js";
5
+ import { Tabs as D, TabsContent as M, TabsList as N, TabsTrigger as h } from "./tabs.js";
6
+ import { Label as w } from "./label.js";
7
+ import { Accordion as P, AccordionContent as k, AccordionHeader as G, AccordionItem as R, AccordionTrigger as V } from "./accordion.js";
8
+ import { NavigationMenu as H, NavigationMenuContent as O, NavigationMenuItem as j, NavigationMenuLink as q, NavigationMenuList as z, NavigationMenuTrigger as B, NavigationMenuViewport as E } from "./navigation-menu.js";
9
+ import { Select as J, SelectContent as K, SelectItem as Q, SelectItemIndicator as U, SelectItemText as W, SelectTrigger as X, SelectValue as Y, SelectViewport as Z } from "./select.js";
10
+ import { Switch as $, SwitchThumb as oo } from "./switch.js";
11
+ import { Checkbox as to, CheckboxIndicator as ro } from "./checkbox.js";
12
+ import { RadioGroup as no, RadioGroupIndicator as ao, RadioGroupItem as lo } from "./radio-group.js";
13
13
  export {
14
- L as Accordion,
14
+ P as Accordion,
15
15
  k as AccordionContent,
16
16
  G as AccordionHeader,
17
- P as AccordionItem,
18
- R as AccordionTrigger,
19
- eo as Checkbox,
20
- to as CheckboxIndicator,
17
+ R as AccordionItem,
18
+ V as AccordionTrigger,
19
+ to as Checkbox,
20
+ ro as CheckboxIndicator,
21
21
  t as Collapsible,
22
22
  r as CollapsibleContent,
23
23
  i as CollapsibleTrigger,
@@ -28,35 +28,36 @@ export {
28
28
  c as DialogOverlay,
29
29
  m as DialogTitle,
30
30
  T as DialogTrigger,
31
- A as Label,
32
- y as NavigationMenu,
33
- H as NavigationMenuContent,
34
- O as NavigationMenuItem,
35
- j as NavigationMenuLink,
36
- q as NavigationMenuList,
37
- z as NavigationMenuTrigger,
38
- B as NavigationMenuViewport,
31
+ w as Label,
32
+ H as NavigationMenu,
33
+ O as NavigationMenuContent,
34
+ j as NavigationMenuItem,
35
+ q as NavigationMenuLink,
36
+ z as NavigationMenuList,
37
+ B as NavigationMenuTrigger,
38
+ E as NavigationMenuViewport,
39
39
  C as Popover,
40
- d as PopoverContent,
41
- f as PopoverTrigger,
42
- io as RadioGroup,
43
- no as RadioGroupIndicator,
44
- ao as RadioGroupItem,
45
- F as Select,
46
- J as SelectContent,
47
- K as SelectItem,
48
- Q as SelectItemIndicator,
49
- U as SelectItemText,
50
- W as SelectTrigger,
51
- X as SelectValue,
52
- Y as SelectViewport,
53
- _ as Switch,
54
- $ as SwitchThumb,
55
- I as Tabs,
56
- D as TabsContent,
57
- M as TabsList,
58
- N as TabsTrigger,
59
- b as Tooltip,
60
- s as TooltipContent,
61
- v as TooltipTrigger
40
+ d as PopoverClose,
41
+ f as PopoverContent,
42
+ s as PopoverTrigger,
43
+ no as RadioGroup,
44
+ ao as RadioGroupIndicator,
45
+ lo as RadioGroupItem,
46
+ J as Select,
47
+ K as SelectContent,
48
+ Q as SelectItem,
49
+ U as SelectItemIndicator,
50
+ W as SelectItemText,
51
+ X as SelectTrigger,
52
+ Y as SelectValue,
53
+ Z as SelectViewport,
54
+ $ as Switch,
55
+ oo as SwitchThumb,
56
+ D as Tabs,
57
+ M as TabsContent,
58
+ N as TabsList,
59
+ h as TabsTrigger,
60
+ v as Tooltip,
61
+ b as TooltipContent,
62
+ S as TooltipTrigger
62
63
  };
package/lib/dialog.js CHANGED
@@ -1,92 +1,86 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { forwardRef as c, useContext as h, useCallback as D, useEffect as m, Children as v, useRef as k } from "react";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import v from "await-interaction-response";
3
+ import { forwardRef as c, useContext as p, useState as k, useEffect as d, useCallback as w, Children as y, useRef as A } from "react";
3
4
  import * as a from "@radix-ui/react-dialog";
4
- import { ReactSdkContext as p, getClosestInstance as d } from "@webstudio-is/react-sdk/runtime";
5
- import { useControllableState as w } from "@radix-ui/react-use-controllable-state";
6
- import y from "await-interaction-response";
5
+ import { ReactSdkContext as D, getClosestInstance as m } from "@webstudio-is/react-sdk/runtime";
7
6
  const C = (t) => {
8
7
  const { target: e } = t;
9
8
  return !(!(e instanceof HTMLAnchorElement) || e.hasAttribute("href") === !1 || e.href === "#" || e.hasAttribute("target") && e.target === "_blank" || t.ctrlKey || t.metaKey);
10
9
  }, O = c((t, e) => {
11
- const { renderer: o } = h(p), [n, s] = w({
12
- prop: t.open,
13
- defaultProp: !1,
14
- onChange: t.onOpenChange
15
- }), r = D(
16
- async (l) => {
17
- await y(), s(l);
18
- },
19
- [s]
20
- );
21
- return m(() => {
22
- if (o !== void 0 || n === !1)
10
+ const { renderer: n } = p(D), o = t.open ?? !1, [r, l] = k(o);
11
+ d(() => l(o), [o]);
12
+ const i = w(async (f) => {
13
+ await v(), l(f);
14
+ }, []);
15
+ return d(() => {
16
+ if (n !== void 0 || r === !1)
23
17
  return;
24
- const l = (u) => {
25
- const { target: g } = u;
26
- if (C(u) !== !1) {
27
- if (!(g instanceof HTMLAnchorElement))
18
+ const f = (g) => {
19
+ const { target: h } = g;
20
+ if (C(g) !== !1) {
21
+ if (!(h instanceof HTMLAnchorElement))
28
22
  return !1;
29
- g.closest('[role="dialog"]') && (r == null || r(!1));
23
+ h.closest('[role="dialog"]') && (i == null || i(!1));
30
24
  }
31
25
  };
32
- return window.addEventListener("click", l), () => window.removeEventListener("click", l);
33
- }, [n, r, o]), /* @__PURE__ */ i(
26
+ return window.addEventListener("click", f), () => window.removeEventListener("click", f);
27
+ }, [r, i, n]), /* @__PURE__ */ s(
34
28
  a.Root,
35
29
  {
36
30
  ...t,
37
- onOpenChange: r,
38
- open: n
31
+ onOpenChange: i,
32
+ open: r
39
33
  }
40
34
  );
41
- }), x = c(({ children: t, ...e }, o) => {
42
- const n = v.toArray(t)[0];
43
- return /* @__PURE__ */ i(a.Trigger, { ref: o, asChild: !0, ...e, children: n ?? /* @__PURE__ */ i("button", { children: "Add button or link" }) });
44
- }), M = c((t, e) => /* @__PURE__ */ i(a.DialogPortal, { children: /* @__PURE__ */ i(a.Overlay, { ref: e, ...t }) })), R = c((t, e) => {
45
- const o = k(!1), { renderer: n } = h(p);
46
- return m(() => {
47
- if (n !== void 0)
35
+ }), x = c(({ children: t, ...e }, n) => {
36
+ const o = y.toArray(t)[0];
37
+ return /* @__PURE__ */ s(a.Trigger, { ref: n, asChild: !0, ...e, children: o ?? /* @__PURE__ */ s("button", { children: "Add button or link" }) });
38
+ }), M = c((t, e) => /* @__PURE__ */ s(a.DialogPortal, { children: /* @__PURE__ */ s(a.Overlay, { ref: e, ...t }) })), R = c((t, e) => {
39
+ const n = A(!1), { renderer: o } = p(D);
40
+ return d(() => {
41
+ if (o !== void 0)
48
42
  return;
49
- o.current = !1;
50
- const s = (r) => {
51
- const { target: l } = r;
52
- if (C(r) !== !1) {
53
- if (!(l instanceof HTMLAnchorElement))
43
+ n.current = !1;
44
+ const r = (l) => {
45
+ const { target: i } = l;
46
+ if (C(l) !== !1) {
47
+ if (!(i instanceof HTMLAnchorElement))
54
48
  return !1;
55
- l.closest('[role="dialog"]') && (o.current = !0);
49
+ i.closest('[role="dialog"]') && (n.current = !0);
56
50
  }
57
51
  };
58
- return window.addEventListener("click", s), () => window.removeEventListener("click", s);
59
- }, [n]), /* @__PURE__ */ i(
52
+ return window.addEventListener("click", r), () => window.removeEventListener("click", r);
53
+ }, [o]), /* @__PURE__ */ s(
60
54
  a.Content,
61
55
  {
62
56
  ref: e,
63
57
  ...t,
64
- onCloseAutoFocus: (s) => {
65
- o.current && s.preventDefault();
58
+ onCloseAutoFocus: (r) => {
59
+ n.current && r.preventDefault();
66
60
  }
67
61
  }
68
62
  );
69
- }), $ = a.Close, A = "h1", N = c(({ tag: t = A, children: e, ...o }, n) => /* @__PURE__ */ i(a.DialogTitle, { asChild: !0, children: /* @__PURE__ */ i(t, { ref: n, ...o, children: e }) })), S = a.Description, f = "@webstudio-is/sdk-components-react-radix", F = {
63
+ }), $ = a.Close, E = "h1", N = c(({ tag: t = E, children: e, ...n }, o) => /* @__PURE__ */ s(a.DialogTitle, { asChild: !0, children: /* @__PURE__ */ s(t, { ref: o, ...n, children: e }) })), S = a.Description, u = "@webstudio-is/sdk-components-react-radix", F = {
70
64
  onNavigatorUnselect: (t, e) => {
71
- for (const o of e.instancePath)
72
- if (o.component === `${f}:DialogOverlay`) {
73
- const n = d(
65
+ for (const n of e.instancePath)
66
+ if (n.component === `${u}:DialogOverlay`) {
67
+ const o = m(
74
68
  e.instancePath,
75
- o,
76
- `${f}:Dialog`
69
+ n,
70
+ `${u}:Dialog`
77
71
  );
78
- n && t.setMemoryProp(n, "open", void 0);
72
+ o && t.setMemoryProp(o, "open", void 0);
79
73
  }
80
74
  },
81
75
  onNavigatorSelect: (t, e) => {
82
- for (const o of e.instancePath)
83
- if (o.component === `${f}:DialogOverlay`) {
84
- const n = d(
76
+ for (const n of e.instancePath)
77
+ if (n.component === `${u}:DialogOverlay`) {
78
+ const o = m(
85
79
  e.instancePath,
86
- o,
87
- `${f}:Dialog`
80
+ n,
81
+ `${u}:Dialog`
88
82
  );
89
- n && t.setMemoryProp(n, "open", !0);
83
+ o && t.setMemoryProp(o, "open", !0);
90
84
  }
91
85
  }
92
86
  };
@@ -2,7 +2,7 @@ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
2
  import { LargeXIcon as p } from "@webstudio-is/icons/svg";
3
3
  import { $ as l, PlaceholderValue as r, css as i } from "@webstudio-is/template";
4
4
  import { radix as o } from "./shared/proxy.js";
5
- import { zIndex as d, blur as m, width as u, spacing as t, maxWidth as w, borderWidth as $, colors as a, boxShadow as s, fontSize as c, lineHeight as y, letterSpacing as b, fontSizeLineHeight as x, borderRadius as f, opacity as g, height as h } from "./shared/theme.js";
5
+ import { fontSize as d, lineHeight as m, letterSpacing as u, fontSizeLineHeight as w, colors as a, spacing as t, borderRadius as $, opacity as s, height as c, boxShadow as g, width as y, zIndex as h, maxWidth as b, borderWidth as x, blur as f } from "./shared/theme.js";
6
6
  import { getButtonStyle as D } from "./shared/styles.js";
7
7
  const S = {
8
8
  category: "radix",
@@ -16,9 +16,9 @@ const S = {
16
16
  "ws:style": i`
17
17
  position: fixed;
18
18
  inset: 0;
19
- z-index: ${d[50]};
19
+ z-index: ${h[50]};
20
20
  background-color: rgb(255 255 255 / 0.8);
21
- backdrop-filter: ${m.sm};
21
+ backdrop-filter: ${f.sm};
22
22
  /* To allow positioning Content */
23
23
  display: flex;
24
24
  overflow: auto;
@@ -27,17 +27,17 @@ const S = {
27
27
  o.DialogContent,
28
28
  {
29
29
  "ws:style": i`
30
- width: ${u.full};
31
- z-index: ${d[50]};
30
+ width: ${y.full};
31
+ z-index: ${h[50]};
32
32
  display: flex;
33
33
  flex-direction: column;
34
34
  gap: ${t[4]};
35
35
  margin: auto;
36
- max-width: ${w.lg};
37
- border: ${$.DEFAULT} solid ${a.border};
36
+ max-width: ${b.lg};
37
+ border: ${x.DEFAULT} solid ${a.border};
38
38
  background-color: ${a.background};
39
39
  padding: ${t[6]};
40
- box-shadow: ${s.lg};
40
+ box-shadow: ${g.lg};
41
41
  position: relative;
42
42
  `,
43
43
  children: [
@@ -55,9 +55,9 @@ const S = {
55
55
  o.DialogTitle,
56
56
  {
57
57
  "ws:style": i`
58
- font-size: ${c.lg};
59
- line-height: ${y.none};
60
- letter-spacing: ${b.tight};
58
+ font-size: ${d.lg};
59
+ line-height: ${m.none};
60
+ letter-spacing: ${u.tight};
61
61
  margin: 0;
62
62
  `,
63
63
  children: new r("Dialog Title you can edit")
@@ -67,8 +67,8 @@ const S = {
67
67
  o.DialogDescription,
68
68
  {
69
69
  "ws:style": i`
70
- font-size: ${c.sm};
71
- line-height: ${x.sm};
70
+ font-size: ${d.sm};
71
+ line-height: ${w.sm};
72
72
  color: ${a.mutedForeground};
73
73
  margin: 0;
74
74
  `,
@@ -87,21 +87,21 @@ const S = {
87
87
  position: absolute;
88
88
  right: ${t[4]};
89
89
  top: ${t[4]};
90
- border-radius: ${f.sm};
91
- opacity: ${g[70]};
90
+ border-radius: ${$.sm};
91
+ opacity: ${s[70]};
92
92
  display: flex;
93
93
  align-items: center;
94
94
  justify-content: center;
95
- height: ${h[4]};
96
- width: ${h[4]};
95
+ height: ${c[4]};
96
+ width: ${c[4]};
97
97
  border: 0;
98
98
  background-color: transparent;
99
99
  outline: none;
100
100
  &:hover {
101
- opacity: ${g[100]};
101
+ opacity: ${s[100]};
102
102
  }
103
103
  &:focus-visible {
104
- box-shadow: ${s.ring};
104
+ box-shadow: ${g.ring};
105
105
  }
106
106
  `,
107
107
  children: /* @__PURE__ */ e(l.HtmlEmbed, { "ws:label": "Close Icon", code: p })
package/lib/dialog.ws.js CHANGED
@@ -1,138 +1,80 @@
1
- import { TriggerIcon as t, OverlayIcon as n, ContentIcon as e, HeadingIcon as i, TextIcon as a, ButtonElementIcon as r, DialogIcon as s } from "@webstudio-is/icons/svg";
2
- import { defaultStates as p } from "@webstudio-is/sdk";
3
- import { div as o, h2 as l, p as c, button as g } from "@webstudio-is/sdk/normalize.css";
4
- import { propsDialog as D, propsDialogTrigger as m, propsDialogContent as y, propsDialogOverlay as C, propsDialogClose as d, propsDialogTitle as q, propsDialogDescription as $ } from "./__generated__/dialog.props.js";
5
- import { buttonReset as T } from "./shared/preset-styles.js";
6
- const O = {
7
- type: "container",
8
- icon: t,
9
- constraints: {
10
- relation: "ancestor",
11
- component: { $eq: "Dialog" }
12
- }
13
- }, P = {
14
- type: "container",
15
- presetStyle: {
16
- div: o
17
- },
1
+ import { DialogIcon as t, TriggerIcon as n, OverlayIcon as i, ContentIcon as r, ButtonElementIcon as c, HeadingIcon as l, TextIcon as a } from "@webstudio-is/icons/svg";
2
+ import { div as e, button as s, h2 as p, p as g } from "@webstudio-is/sdk/normalize.css";
3
+ import { radix as o } from "./shared/meta.js";
4
+ import { propsDialog as D, propsDialogTrigger as d, propsDialogOverlay as m, propsDialogContent as y, propsDialogClose as h, propsDialogTitle as C, propsDialogDescription as T } from "./__generated__/dialog.props.js";
5
+ import { buttonReset as I } from "./shared/preset-styles.js";
6
+ const S = {
18
7
  icon: n,
19
- constraints: [
20
- {
21
- relation: "ancestor",
22
- component: { $eq: "Dialog" }
23
- },
24
- {
25
- relation: "descendant",
26
- component: { $eq: "DialogContent" }
27
- }
28
- ]
29
- }, S = {
30
- type: "container",
31
- presetStyle: {
32
- div: o
8
+ contentModel: {
9
+ category: "none",
10
+ children: ["instance"]
33
11
  },
34
- icon: e,
35
- constraints: [
36
- {
37
- relation: "ancestor",
38
- component: { $eq: "DialogOverlay" }
39
- },
40
- // often deleted by users
41
- // though radix starts throwing warnings in console
42
- /*
43
- {
44
- relation: "descendant",
45
- component: { $eq: "DialogTitle" },
46
- },
47
- {
48
- relation: "descendant",
49
- component: { $eq: "DialogDescription" },
50
- },
51
- */
52
- {
53
- relation: "descendant",
54
- component: { $eq: "DialogClose" }
55
- }
56
- ]
12
+ props: d
57
13
  }, b = {
58
- type: "container",
59
- presetStyle: {
60
- h2: l
61
- },
62
14
  icon: i,
63
- constraints: {
64
- relation: "ancestor",
65
- component: { $eq: "DialogContent" }
66
- }
67
- }, x = {
68
- type: "container",
69
- presetStyle: {
70
- p: c
15
+ contentModel: {
16
+ category: "none",
17
+ children: ["instance"],
18
+ descendants: [o.DialogContent]
71
19
  },
72
- icon: a,
73
- constraints: {
74
- relation: "ancestor",
75
- component: { $eq: "DialogContent" }
76
- }
20
+ presetStyle: { div: e },
21
+ props: m
22
+ }, O = {
23
+ icon: r,
24
+ contentModel: {
25
+ category: "none",
26
+ children: ["instance"],
27
+ descendants: [
28
+ o.DialogTitle,
29
+ o.DialogDescription,
30
+ o.DialogClose
31
+ ]
32
+ },
33
+ presetStyle: { div: e },
34
+ props: y
77
35
  }, B = {
78
- type: "container",
79
- presetStyle: {
80
- button: [T, g].flat()
36
+ icon: l,
37
+ contentModel: {
38
+ category: "none",
39
+ children: ["instance", "rich-text"]
81
40
  },
82
- states: p,
83
- icon: r,
84
- label: "Close Button",
85
- constraints: {
86
- relation: "ancestor",
87
- component: { $eq: "DialogContent" }
88
- }
89
- }, h = {
90
- type: "container",
91
- icon: s,
92
- constraints: [
93
- {
94
- relation: "descendant",
95
- component: { $eq: "DialogTrigger" }
96
- },
97
- {
98
- relation: "descendant",
99
- component: { $eq: "DialogOverlay" }
100
- }
101
- ]
41
+ presetStyle: { h2: p },
42
+ props: C
102
43
  }, E = {
103
- props: D,
104
- initialProps: []
44
+ icon: a,
45
+ contentModel: {
46
+ category: "none",
47
+ children: ["instance", "rich-text"]
48
+ },
49
+ presetStyle: { p: g },
50
+ props: T
105
51
  }, H = {
106
- props: m
107
- }, R = {
108
- props: y,
109
- initialProps: []
110
- }, j = {
111
- props: C,
112
- initialProps: []
113
- }, k = {
114
- props: d,
115
- initialProps: []
116
- }, w = {
117
- props: q,
118
- initialProps: []
119
- }, z = {
120
- props: $,
121
- initialProps: []
52
+ icon: c,
53
+ label: "Close Button",
54
+ contentModel: {
55
+ category: "none",
56
+ children: ["instance", "rich-text"]
57
+ },
58
+ presetStyle: {
59
+ button: [I, s].flat()
60
+ },
61
+ props: h
62
+ }, P = {
63
+ icon: t,
64
+ contentModel: {
65
+ category: "instance",
66
+ children: ["instance"],
67
+ descendants: [o.DialogTrigger, o.DialogOverlay]
68
+ },
69
+ initialProps: ["open"],
70
+ props: D
122
71
  };
123
72
  export {
124
- h as metaDialog,
125
- B as metaDialogClose,
126
- S as metaDialogContent,
127
- x as metaDialogDescription,
128
- P as metaDialogOverlay,
129
- b as metaDialogTitle,
130
- O as metaDialogTrigger,
131
- E as propsMetaDialog,
132
- k as propsMetaDialogClose,
133
- R as propsMetaDialogContent,
134
- z as propsMetaDialogDescription,
135
- j as propsMetaDialogOverlay,
136
- w as propsMetaDialogTitle,
137
- H as propsMetaDialogTrigger
73
+ P as metaDialog,
74
+ H as metaDialogClose,
75
+ O as metaDialogContent,
76
+ E as metaDialogDescription,
77
+ b as metaDialogOverlay,
78
+ B as metaDialogTitle,
79
+ S as metaDialogTrigger
138
80
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { css as t, PlaceholderValue as o } from "@webstudio-is/template";
2
+ import { PlaceholderValue as t, css as o } from "@webstudio-is/template";
3
3
  import { radix as i } from "./shared/proxy.js";
4
4
  import { fontSize as r, lineHeight as n, weights as h } from "./shared/theme.js";
5
5
  const p = {
@@ -9,12 +9,12 @@ const p = {
9
9
  template: /* @__PURE__ */ e(
10
10
  i.Label,
11
11
  {
12
- "ws:style": t`
12
+ "ws:style": o`
13
13
  font-size: ${r.sm};
14
14
  line-height: ${n.none};
15
15
  font-weight: ${h.medium};
16
16
  `,
17
- children: new o("Form Label")
17
+ children: new t("Form Label")
18
18
  }
19
19
  )
20
20
  };
package/lib/label.ws.js CHANGED
@@ -1,19 +1,12 @@
1
- import { LabelIcon as t } from "@webstudio-is/icons/svg";
2
- import { defaultStates as o } from "@webstudio-is/sdk";
1
+ import { LabelIcon as o } from "@webstudio-is/icons/svg";
3
2
  import { label as r } from "@webstudio-is/sdk/normalize.css";
4
- import { props as e } from "./__generated__/label.props.js";
5
- const p = {
6
- label: r
7
- }, l = {
8
- type: "container",
9
- icon: t,
10
- presetStyle: p,
11
- states: o
12
- }, n = {
13
- props: e,
14
- initialProps: ["id", "className", "htmlFor"]
3
+ import { props as t } from "./__generated__/label.props.js";
4
+ const m = {
5
+ icon: o,
6
+ presetStyle: { label: r },
7
+ initialProps: ["id", "class", "for"],
8
+ props: t
15
9
  };
16
10
  export {
17
- l as meta,
18
- n as propsMeta
11
+ m as meta
19
12
  };