@webstudio-is/sdk-components-react-radix 0.0.0-c1d6247 → 0.0.0-ca00e2a

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 (48) 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 +5 -508
  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 +16 -2072
  12. package/lib/__generated__/tooltip.props.js +6 -503
  13. package/lib/accordion.js +24 -23
  14. package/lib/accordion.template.js +12 -12
  15. package/lib/accordion.ws.js +67 -82
  16. package/lib/checkbox.js +2 -2
  17. package/lib/checkbox.template.js +10 -10
  18. package/lib/checkbox.ws.js +21 -21
  19. package/lib/collapsible.js +3 -3
  20. package/lib/collapsible.ws.js +30 -37
  21. package/lib/dialog.template.js +19 -19
  22. package/lib/dialog.ws.js +85 -114
  23. package/lib/label.template.js +3 -3
  24. package/lib/label.ws.js +8 -9
  25. package/lib/navigation-menu.js +21 -20
  26. package/lib/navigation-menu.template.js +8 -8
  27. package/lib/navigation-menu.ws.js +82 -99
  28. package/lib/popover.ws.js +31 -38
  29. package/lib/radio-group.js +2 -2
  30. package/lib/radio-group.ws.js +37 -43
  31. package/lib/select.js +4 -6
  32. package/lib/select.ws.js +91 -127
  33. package/lib/shared/meta.js +13 -0
  34. package/lib/shared/preset-styles.js +29 -29
  35. package/lib/shared/theme.js +25 -68
  36. package/lib/sheet.template.js +32 -32
  37. package/lib/switch.js +2 -2
  38. package/lib/switch.template.js +9 -9
  39. package/lib/switch.ws.js +25 -25
  40. package/lib/tabs.js +41 -40
  41. package/lib/tabs.template.js +15 -15
  42. package/lib/tabs.ws.js +45 -58
  43. package/lib/tooltip.ws.js +32 -39
  44. package/lib/types/select.d.ts +3 -3
  45. package/lib/types/shared/meta.d.ts +1 -0
  46. package/lib/types/shared/preset-styles.d.ts +2 -2
  47. package/lib/types/shared/proxy.d.ts +1 -0
  48. package/package.json +21 -21
package/lib/popover.ws.js CHANGED
@@ -1,50 +1,43 @@
1
- import { TriggerIcon as o, ContentIcon as e, PopoverIcon as n } from "@webstudio-is/icons/svg";
1
+ import { PopoverIcon as e, TriggerIcon as n, ContentIcon as r } from "@webstudio-is/icons/svg";
2
2
  import { div as t } from "@webstudio-is/sdk/normalize.css";
3
- import { propsPopover as r, propsPopoverTrigger as p, propsPopoverContent as i } from "./__generated__/popover.props.js";
4
- const P = {
5
- type: "container",
6
- icon: o,
7
- constraints: {
8
- relation: "ancestor",
9
- component: { $eq: "Popover" }
3
+ import { radix as o } from "./shared/meta.js";
4
+ import { propsPopover as p, propsPopoverTrigger as i, propsPopoverContent as s } from "./__generated__/popover.props.js";
5
+ const v = {
6
+ icon: n,
7
+ contentModel: {
8
+ category: "none",
9
+ children: ["instance"]
10
10
  }
11
- }, v = {
12
- type: "container",
11
+ }, d = {
12
+ icon: r,
13
+ contentModel: {
14
+ category: "none",
15
+ children: ["instance"]
16
+ },
13
17
  presetStyle: {
14
18
  div: t
15
- },
19
+ }
20
+ }, l = {
16
21
  icon: e,
17
- constraints: {
18
- relation: "ancestor",
19
- component: { $eq: "Popover" }
22
+ contentModel: {
23
+ category: "instance",
24
+ children: ["instance"],
25
+ descendants: [o.PopoverTrigger, o.PopoverContent]
20
26
  }
21
27
  }, m = {
22
- type: "container",
23
- icon: n,
24
- constraints: [
25
- {
26
- relation: "descendant",
27
- component: { $eq: "PopoverTrigger" }
28
- },
29
- {
30
- relation: "descendant",
31
- component: { $eq: "PopoverContent" }
32
- }
33
- ]
34
- }, g = {
35
- props: r,
28
+ props: p,
36
29
  initialProps: ["open"]
37
- }, l = {
38
- props: p
39
- }, d = {
40
- props: i,
30
+ }, f = {
31
+ props: i
32
+ }, M = {
33
+ props: s,
41
34
  initialProps: ["side", "sideOffset", "align", "alignOffset"]
42
35
  };
43
36
  export {
44
- m as metaPopover,
45
- v as metaPopoverContent,
46
- P as metaPopoverTrigger,
47
- g as propsMetaPopover,
48
- d as propsMetaPopoverContent,
49
- l as propsMetaPopoverTrigger
37
+ l as metaPopover,
38
+ d as metaPopoverContent,
39
+ v as metaPopoverTrigger,
40
+ m as propsMetaPopover,
41
+ M as propsMetaPopoverContent,
42
+ f as propsMetaPopoverTrigger
50
43
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import { forwardRef as m } from "react";
3
- import { Root as d, Item as p, Indicator as e } from "@radix-ui/react-radio-group";
4
- const u = m(({ value: o, defaultValue: r, ...t }, a) => /* @__PURE__ */ i(d, { ...t, defaultValue: o ?? r, ref: a })), R = p, s = e;
3
+ import { Item as d, Indicator as p, Root as e } from "@radix-ui/react-radio-group";
4
+ const u = m(({ value: o, defaultValue: r, ...t }, a) => /* @__PURE__ */ i(e, { ...t, defaultValue: o ?? r, ref: a })), R = d, s = p;
5
5
  export {
6
6
  u as RadioGroup,
7
7
  s as RadioGroupIndicator,
@@ -1,15 +1,16 @@
1
- import { RadioGroupIcon as t, ItemIcon as e, TriggerIcon as a } from "@webstudio-is/icons/svg";
1
+ import { RadioGroupIcon as e, ItemIcon as a, TriggerIcon as r } from "@webstudio-is/icons/svg";
2
2
  import { defaultStates as o } from "@webstudio-is/sdk";
3
- import { div as r, button as n, span as p } from "@webstudio-is/sdk/normalize.css";
4
- import { buttonReset as s } from "./shared/preset-styles.js";
5
- import { propsRadioGroup as i, propsRadioGroupItem as c, propsRadioGroupIndicator as d } from "./__generated__/radio-group.props.js";
6
- const I = {
7
- type: "container",
8
- constraints: {
9
- relation: "descendant",
10
- component: { $eq: "RadioGroupItem" }
3
+ import { div as n, button as s, span as c } from "@webstudio-is/sdk/normalize.css";
4
+ import { radix as t } from "./shared/meta.js";
5
+ import { buttonReset as p } from "./shared/preset-styles.js";
6
+ import { propsRadioGroup as i, propsRadioGroupItem as d, propsRadioGroupIndicator as m } from "./__generated__/radio-group.props.js";
7
+ const y = {
8
+ icon: e,
9
+ contentModel: {
10
+ category: "instance",
11
+ children: ["instance"],
12
+ descendants: [t.RadioGroupItem]
11
13
  },
12
- icon: t,
13
14
  states: [
14
15
  ...o,
15
16
  {
@@ -24,50 +25,43 @@ const I = {
24
25
  }
25
26
  ],
26
27
  presetStyle: {
27
- div: r
28
+ div: n
28
29
  }
29
- }, y = {
30
- type: "container",
31
- constraints: [
32
- {
33
- relation: "ancestor",
34
- component: { $eq: "RadioGroup" }
35
- },
36
- {
37
- relation: "descendant",
38
- component: { $eq: "RadioGroupIndicator" }
39
- }
40
- ],
41
- icon: e,
30
+ }, g = {
31
+ icon: a,
32
+ contentModel: {
33
+ category: "none",
34
+ children: ["instance"],
35
+ descendants: [t.RadioGroupIndicator]
36
+ },
42
37
  states: o,
43
38
  presetStyle: {
44
- button: [n, s].flat()
39
+ button: [s, p].flat()
45
40
  }
46
- }, f = {
47
- type: "container",
48
- icon: a,
49
- constraints: {
50
- relation: "ancestor",
51
- component: { $eq: "RadioGroupItem" }
41
+ }, h = {
42
+ icon: r,
43
+ contentModel: {
44
+ category: "none",
45
+ children: ["instance"]
52
46
  },
53
47
  states: o,
54
48
  presetStyle: {
55
- span: p
49
+ span: c
56
50
  }
57
- }, b = {
51
+ }, M = {
58
52
  props: i,
59
53
  initialProps: ["id", "className", "name", "value", "required"]
60
- }, q = {
61
- props: c,
54
+ }, b = {
55
+ props: d,
62
56
  initialProps: ["value"]
63
- }, g = {
64
- props: d
57
+ }, k = {
58
+ props: m
65
59
  };
66
60
  export {
67
- I as metaRadioGroup,
68
- f as metaRadioGroupIndicator,
69
- y as metaRadioGroupItem,
70
- b as propsMetaRadioGroup,
71
- g as propsMetaRadioGroupIndicator,
72
- q as propsMetaRadioGroupItem
61
+ y as metaRadioGroup,
62
+ h as metaRadioGroupIndicator,
63
+ g as metaRadioGroupItem,
64
+ M as propsMetaRadioGroup,
65
+ k as propsMetaRadioGroupIndicator,
66
+ b as propsMetaRadioGroupItem
73
67
  };
package/lib/select.js CHANGED
@@ -1,15 +1,13 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
2
  import { forwardRef as s, useContext as l } from "react";
3
- import { Root as m, Trigger as p, Value as f, Portal as S, Content as d, Viewport as u, Item as I, ItemIndicator as P, ItemText as g } from "@radix-ui/react-select";
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
4
  import { ReactSdkContext as x, getClosestInstance as i } from "@webstudio-is/react-sdk/runtime";
5
- const v = s(
6
- ({ value: e, defaultValue: t, ...o }, n) => /* @__PURE__ */ c(m, { ...o, defaultValue: e ?? t })
7
- ), T = s((e, t) => {
5
+ const v = s(({ value: e, defaultValue: t, ...o }, n) => /* @__PURE__ */ c(d, { ...o, defaultValue: e ?? t })), T = s((e, t) => {
8
6
  const { renderer: o } = l(x);
9
- return /* @__PURE__ */ c(p, { onPointerDown: o === "canvas" ? (a) => {
7
+ return /* @__PURE__ */ c(u, { onPointerDown: o === "canvas" ? (a) => {
10
8
  a.preventDefault();
11
9
  } : void 0, ref: t, ...e });
12
- }), $ = s((e, t) => /* @__PURE__ */ c(f, { ref: t, ...e })), k = s((e, t) => /* @__PURE__ */ c(S, { children: /* @__PURE__ */ c(d, { ref: t, ...e, position: "popper" }) })), D = u, R = I, y = P, M = g, r = "@webstudio-is/sdk-components-react-radix", N = {
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 = {
13
11
  onNavigatorUnselect: (e, t) => {
14
12
  for (const o of t.instancePath)
15
13
  if (o.component === `${r}:SelectContent`) {
package/lib/select.ws.js CHANGED
@@ -1,155 +1,119 @@
1
- import { SelectIcon as o, TriggerIcon as n, FormTextFieldIcon as c, ContentIcon as r, ViewportIcon as p, ItemIcon as a, CheckMarkIcon as s, TextIcon as l } from "@webstudio-is/icons/svg";
2
- import { button as i, span as e, div as t } from "@webstudio-is/sdk/normalize.css";
3
- import { propsSelect as m, propsSelectTrigger as S, propsSelectValue as I, propsSelectContent as d, propsSelectViewport as q, propsSelectItem as y, propsSelectItemIndicator as $, propsSelectItemText as T } from "./__generated__/select.props.js";
4
- const M = {
5
- type: "container",
1
+ import { SelectIcon as o, TriggerIcon as c, FormTextFieldIcon as r, ViewportIcon as l, ContentIcon as p, ItemIcon as s, CheckMarkIcon as a, TextIcon as i } from "@webstudio-is/icons/svg";
2
+ import { button as S, span as t, div as n } from "@webstudio-is/sdk/normalize.css";
3
+ import { radix as e } from "./shared/meta.js";
4
+ import { propsSelect as d, propsSelectTrigger as m, propsSelectValue as I, propsSelectViewport as g, propsSelectContent as M, propsSelectItem as y, propsSelectItemIndicator as T, propsSelectItemText as h } from "./__generated__/select.props.js";
5
+ const w = {
6
6
  icon: o,
7
- constraints: [
8
- {
9
- relation: "descendant",
10
- component: { $eq: "SelectTrigger" }
11
- },
12
- {
13
- relation: "descendant",
14
- component: { $eq: "SelectContent" }
15
- }
16
- ]
17
- }, x = {
18
- type: "container",
19
- icon: n,
20
- presetStyle: {
21
- button: i
22
- },
23
- constraints: [
24
- {
25
- relation: "ancestor",
26
- component: { $eq: "Select" }
27
- },
28
- {
29
- relation: "descendant",
30
- component: { $eq: "SelectValue" }
31
- }
32
- ]
33
- }, C = {
34
- type: "container",
35
- label: "Value",
7
+ contentModel: {
8
+ category: "instance",
9
+ children: ["instance"],
10
+ descendants: [e.SelectTrigger, e.SelectContent]
11
+ }
12
+ }, b = {
36
13
  icon: c,
37
- presetStyle: {
38
- span: e
14
+ contentModel: {
15
+ category: "none",
16
+ children: ["instance"],
17
+ descendants: [e.SelectValue]
39
18
  },
40
- constraints: {
41
- relation: "ancestor",
42
- component: { $eq: "SelectTrigger" }
19
+ presetStyle: {
20
+ button: S
43
21
  }
44
- }, w = {
45
- type: "container",
22
+ }, f = {
23
+ label: "Value",
46
24
  icon: r,
47
- presetStyle: {
48
- div: t
49
- },
50
- constraints: [
51
- {
52
- relation: "ancestor",
53
- component: { $eq: "Select" }
54
- },
55
- {
56
- relation: "descendant",
57
- component: { $eq: "SelectViewport" }
58
- }
59
- ]
60
- }, b = {
61
- type: "container",
62
- icon: p,
63
- presetStyle: {
64
- div: t
25
+ contentModel: {
26
+ category: "none",
27
+ children: []
65
28
  },
66
- constraints: [
67
- {
68
- relation: "ancestor",
69
- component: { $eq: "SelectContent" }
70
- },
71
- {
72
- relation: "descendant",
73
- component: { $eq: "SelectItem" }
74
- }
75
- ]
76
- }, f = {
77
- type: "container",
78
- icon: a,
79
- constraints: [
80
- {
81
- relation: "ancestor",
82
- component: { $eq: "SelectViewport" }
83
- },
84
- {
85
- relation: "descendant",
86
- component: { $eq: "SelectItemIndicator" }
87
- },
88
- {
89
- relation: "descendant",
90
- component: { $eq: "SelectItemText" }
91
- }
92
- ],
93
29
  presetStyle: {
94
- div: t
30
+ span: t
95
31
  }
96
32
  }, v = {
97
- type: "container",
98
- label: "Indicator",
99
- icon: s,
100
- constraints: {
101
- relation: "ancestor",
102
- component: { $eq: "SelectItem" }
33
+ icon: p,
34
+ contentModel: {
35
+ category: "none",
36
+ children: ["instance"],
37
+ descendants: [e.SelectViewport]
103
38
  },
104
39
  presetStyle: {
105
- span: e
40
+ div: n
106
41
  }
107
42
  }, P = {
108
- type: "container",
109
- label: "Item Text",
110
43
  icon: l,
111
- constraints: {
112
- relation: "ancestor",
113
- component: { $eq: "SelectItem" }
44
+ contentModel: {
45
+ category: "none",
46
+ children: ["instance"],
47
+ descendants: [e.SelectItem]
114
48
  },
115
49
  presetStyle: {
116
- span: e
50
+ div: n
117
51
  }
118
- }, h = {
119
- props: m,
120
- initialProps: ["name", "value", "open", "required"]
121
52
  }, k = {
122
- props: S
53
+ icon: s,
54
+ contentModel: {
55
+ category: "none",
56
+ children: ["instance"],
57
+ descendants: [e.SelectItemIndicator, e.SelectItemText]
58
+ },
59
+ presetStyle: {
60
+ div: n
61
+ }
123
62
  }, F = {
124
- props: I,
125
- initialProps: ["placeholder"]
63
+ label: "Indicator",
64
+ icon: a,
65
+ contentModel: {
66
+ category: "none",
67
+ children: ["instance"]
68
+ },
69
+ presetStyle: {
70
+ span: t
71
+ }
72
+ }, q = {
73
+ label: "Item Text",
74
+ icon: i,
75
+ contentModel: {
76
+ category: "none",
77
+ children: ["instance", "rich-text"]
78
+ },
79
+ presetStyle: {
80
+ span: t
81
+ }
126
82
  }, j = {
127
- props: d
83
+ props: d,
84
+ initialProps: ["name", "value", "open", "required"]
128
85
  }, z = {
129
- props: q
86
+ props: m
130
87
  }, A = {
131
- props: y,
132
- initialProps: ["value"]
88
+ props: I,
89
+ initialProps: ["placeholder"]
133
90
  }, B = {
134
- props: $
91
+ props: M
135
92
  }, D = {
93
+ props: g
94
+ }, E = {
95
+ props: y,
96
+ initialProps: ["value"]
97
+ }, G = {
136
98
  props: T
99
+ }, H = {
100
+ props: h
137
101
  };
138
102
  export {
139
- M as metaSelect,
140
- w as metaSelectContent,
141
- f as metaSelectItem,
142
- v as metaSelectItemIndicator,
143
- P as metaSelectItemText,
144
- x as metaSelectTrigger,
145
- C as metaSelectValue,
146
- b as metaSelectViewport,
147
- h as propsMetaSelect,
148
- j as propsMetaSelectContent,
149
- A as propsMetaSelectItem,
150
- B as propsMetaSelectItemIndicator,
151
- D as propsMetaSelectItemText,
152
- k as propsMetaSelectTrigger,
153
- F as propsMetaSelectValue,
154
- z as propsMetaSelectViewport
103
+ w as metaSelect,
104
+ v as metaSelectContent,
105
+ k as metaSelectItem,
106
+ F as metaSelectItemIndicator,
107
+ q as metaSelectItemText,
108
+ b as metaSelectTrigger,
109
+ f as metaSelectValue,
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
155
119
  };
@@ -0,0 +1,13 @@
1
+ const r = (t) => new Proxy(
2
+ {},
3
+ {
4
+ get(o, e) {
5
+ return `${t}${e}`;
6
+ }
7
+ }
8
+ ), n = r(
9
+ "@webstudio-is/sdk-components-react-radix:"
10
+ );
11
+ export {
12
+ n as radix
13
+ };
@@ -1,38 +1,38 @@
1
- const o = (e, r, p) => ({
2
- property: e,
3
- value: { type: "unit", unit: p, value: r }
4
- }), t = (e, r) => ({
5
- property: e,
6
- value: { type: "keyword", value: r }
7
- }), d = (e, r, p, l) => ({
8
- property: e,
9
- value: { type: "rgb", alpha: 1, r, g: p, b: l }
10
- }), i = [
1
+ const o = (r, t, p) => ({
2
+ property: r,
3
+ value: { type: "unit", unit: p, value: t }
4
+ }), e = (r, t) => ({
5
+ property: r,
6
+ value: { type: "keyword", value: t }
7
+ }), d = (r, t, p, l) => ({
8
+ property: r,
9
+ value: { type: "rgb", alpha: 1, r: t, g: p, b: l }
10
+ }), b = [
11
11
  {
12
- property: "backgroundColor",
12
+ property: "background-color",
13
13
  value: { type: "keyword", value: "transparent" }
14
14
  },
15
15
  {
16
- property: "backgroundImage",
16
+ property: "background-image",
17
17
  value: { type: "keyword", value: "none" }
18
18
  },
19
- o("borderTopWidth", 0, "px"),
20
- o("borderRightWidth", 0, "px"),
21
- o("borderBottomWidth", 0, "px"),
22
- o("borderLeftWidth", 0, "px"),
23
- t("borderTopStyle", "solid"),
24
- t("borderRightStyle", "solid"),
25
- t("borderBottomStyle", "solid"),
26
- t("borderLeftStyle", "solid"),
27
- d("borderTopColor", 226, 232, 240),
28
- d("borderRightColor", 226, 232, 240),
29
- d("borderBottomColor", 226, 232, 240),
30
- d("borderLeftColor", 226, 232, 240),
31
- o("paddingTop", 0, "px"),
32
- o("paddingRight", 0, "px"),
33
- o("paddingBottom", 0, "px"),
34
- o("paddingLeft", 0, "px")
19
+ o("border-top-width", 0, "px"),
20
+ o("border-right-width", 0, "px"),
21
+ o("border-bottom-width", 0, "px"),
22
+ o("border-left-width", 0, "px"),
23
+ e("border-top-style", "solid"),
24
+ e("border-right-style", "solid"),
25
+ e("border-bottom-style", "solid"),
26
+ e("border-left-style", "solid"),
27
+ d("border-top-color", 226, 232, 240),
28
+ d("border-right-color", 226, 232, 240),
29
+ d("border-bottom-color", 226, 232, 240),
30
+ d("border-left-color", 226, 232, 240),
31
+ o("padding-top", 0, "px"),
32
+ o("padding-right", 0, "px"),
33
+ o("padding-bottom", 0, "px"),
34
+ o("padding-left", 0, "px")
35
35
  ];
36
36
  export {
37
- i as buttonReset
37
+ b as buttonReset
38
38
  };