@webstudio-is/sdk-components-react-radix 0.195.0 → 0.197.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.
Files changed (88) hide show
  1. package/lib/__generated__/select.props.js +6 -0
  2. package/lib/__generated__/tabs.props.js +2 -2
  3. package/lib/accordion.template.js +95 -0
  4. package/lib/accordion.ws.js +53 -205
  5. package/lib/checkbox.template.js +63 -0
  6. package/lib/checkbox.ws.js +22 -119
  7. package/lib/collapsible.template.js +16 -0
  8. package/lib/collapsible.ws.js +21 -71
  9. package/lib/dialog.template.js +119 -0
  10. package/lib/dialog.ws.js +60 -237
  11. package/lib/label.template.js +23 -0
  12. package/lib/label.ws.js +12 -36
  13. package/lib/metas.js +48 -50
  14. package/lib/navigation-menu.template.js +283 -0
  15. package/lib/navigation-menu.ws.js +54 -420
  16. package/lib/popover.template.js +33 -0
  17. package/lib/popover.ws.js +19 -79
  18. package/lib/radio-group.template.js +66 -0
  19. package/lib/radio-group.ws.js +27 -125
  20. package/lib/select.template.js +121 -0
  21. package/lib/select.ws.js +61 -262
  22. package/lib/shared/preset-styles.js +38 -0
  23. package/lib/shared/proxy.js +5 -0
  24. package/lib/shared/styles.js +51 -0
  25. package/lib/shared/theme.js +162 -0
  26. package/lib/sheet.template.js +129 -0
  27. package/lib/switch.js +1 -1
  28. package/lib/switch.template.js +63 -0
  29. package/lib/switch.ws.js +22 -106
  30. package/lib/tabs.template.js +66 -0
  31. package/lib/tabs.ws.js +36 -131
  32. package/lib/templates.js +28 -0
  33. package/lib/tooltip.template.js +33 -0
  34. package/lib/tooltip.ws.js +24 -84
  35. package/lib/types/__generated__/accordion.props.d.ts +1 -1
  36. package/lib/types/__generated__/checkbox.props.d.ts +1 -1
  37. package/lib/types/__generated__/collapsible.props.d.ts +1 -1
  38. package/lib/types/__generated__/dialog.props.d.ts +1 -1
  39. package/lib/types/__generated__/label.props.d.ts +1 -1
  40. package/lib/types/__generated__/navigation-menu.props.d.ts +1 -1
  41. package/lib/types/__generated__/popover.props.d.ts +1 -1
  42. package/lib/types/__generated__/radio-group.props.d.ts +1 -1
  43. package/lib/types/__generated__/select.props.d.ts +1 -1
  44. package/lib/types/__generated__/switch.props.d.ts +1 -1
  45. package/lib/types/__generated__/tabs.props.d.ts +1 -1
  46. package/lib/types/__generated__/tooltip.props.d.ts +1 -1
  47. package/lib/types/accordion.template.d.ts +10 -0
  48. package/lib/types/accordion.ws.d.ts +1 -1
  49. package/lib/types/checkbox.d.ts +1 -1
  50. package/lib/types/checkbox.template.d.ts +2 -0
  51. package/lib/types/checkbox.ws.d.ts +1 -1
  52. package/lib/types/collapsible.template.d.ts +2 -0
  53. package/lib/types/collapsible.ws.d.ts +1 -1
  54. package/lib/types/dialog.template.d.ts +10 -0
  55. package/lib/types/dialog.ws.d.ts +1 -9
  56. package/lib/types/label.template.d.ts +10 -0
  57. package/lib/types/label.ws.d.ts +1 -1
  58. package/lib/types/metas.d.ts +0 -1
  59. package/lib/types/navigation-menu.template.d.ts +2 -0
  60. package/lib/types/navigation-menu.ws.d.ts +1 -1
  61. package/lib/types/popover.template.d.ts +10 -0
  62. package/lib/types/popover.ws.d.ts +1 -9
  63. package/lib/types/radio-group.template.d.ts +2 -0
  64. package/lib/types/radio-group.ws.d.ts +1 -1
  65. package/lib/types/select.template.d.ts +2 -0
  66. package/lib/types/select.ws.d.ts +1 -1
  67. package/lib/types/shared/preset-styles.d.ts +2 -0
  68. package/lib/types/shared/proxy.d.ts +17 -0
  69. package/lib/types/shared/styles.d.ts +2 -0
  70. package/lib/types/shared/theme.d.ts +212 -0
  71. package/lib/types/{sheet.ws.d.ts → sheet.template.d.ts} +2 -2
  72. package/lib/types/switch.template.d.ts +2 -0
  73. package/lib/types/switch.ws.d.ts +1 -1
  74. package/lib/types/tabs.template.d.ts +2 -0
  75. package/lib/types/tabs.ws.d.ts +1 -1
  76. package/lib/types/templates.d.ts +13 -0
  77. package/lib/types/tooltip.template.d.ts +10 -0
  78. package/lib/types/tooltip.ws.d.ts +1 -9
  79. package/package.json +26 -23
  80. package/lib/sheet.ws.js +0 -217
  81. package/lib/theme/__generated__/tailwind-theme.js +0 -503
  82. package/lib/theme/styles.js +0 -52
  83. package/lib/theme/tailwind-classes.js +0 -474
  84. package/lib/types/__generated__/sheet.props.d.ts +0 -8
  85. package/lib/types/theme/__generated__/tailwind-theme.d.ts +0 -26
  86. package/lib/types/theme/styles.d.ts +0 -278
  87. package/lib/types/theme/tailwind-classes.d.ts +0 -104
  88. package/lib/types/theme/tailwind-colors.d.ts +0 -31
@@ -19,6 +19,12 @@ const e = {
19
19
  type: "boolean",
20
20
  description: "Indicates whether the user can interact with the element."
21
21
  },
22
+ form: {
23
+ required: !1,
24
+ control: "text",
25
+ type: "string",
26
+ description: "Indicates the form that is the owner of the element."
27
+ },
22
28
  name: {
23
29
  required: !1,
24
30
  control: "text",
@@ -524,10 +524,10 @@ Mainly so arrow navigation is done accordingly (left & right vs. up & down)
524
524
  options: ["on", "off"]
525
525
  },
526
526
  value: {
527
- description: "The value for the selected tab, if controlled",
528
527
  required: !1,
529
528
  control: "text",
530
- type: "string"
529
+ type: "string",
530
+ description: "Defines a default value which will be displayed in the element on pageload."
531
531
  },
532
532
  vocab: { required: !1, control: "text", type: "string" }
533
533
  }, t = {
@@ -0,0 +1,95 @@
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ import { css as t, $ as o, PlaceholderValue as s } from "@webstudio-is/template";
3
+ import { radix as i } from "./shared/proxy.js";
4
+ import { borderWidth as h, colors as m, spacing as a, weights as f, height as g, width as p, transition as c, fontSize as w, fontSizeLineHeight as y } from "./shared/theme.js";
5
+ import { ChevronDownIcon as b } from "@webstudio-is/icons/svg";
6
+ const n = (d, l) => /* @__PURE__ */ r(
7
+ i.AccordionItem,
8
+ {
9
+ "ws:style": t`
10
+ border-bottom: ${h.DEFAULT} solid ${m.border};
11
+ `,
12
+ children: [
13
+ /* @__PURE__ */ e(
14
+ i.AccordionHeader,
15
+ {
16
+ "ws:style": t`
17
+ display: flex;
18
+ `,
19
+ children: /* @__PURE__ */ r(
20
+ i.AccordionTrigger,
21
+ {
22
+ "ws:style": t`
23
+ display: flex;
24
+ flex: 1 1 0;
25
+ align-items: center;
26
+ justify-content: between;
27
+ padding: ${a[4]} 0;
28
+ font-weight: ${f.medium};
29
+ --accordion-trigger-icon-transform: 0deg;
30
+ &:hover {
31
+ text-decoration-line: underline;
32
+ }
33
+ &[data-state="open"] {
34
+ --accordion-trigger-icon-transform: 180deg;
35
+ }
36
+ `,
37
+ children: [
38
+ /* @__PURE__ */ e(o.Text, { children: new s(d) }),
39
+ /* @__PURE__ */ e(
40
+ o.Box,
41
+ {
42
+ "ws:label": "Icon Container",
43
+ "ws:style": t`
44
+ rotate: --accordion-trigger-icon-transform;
45
+ height: ${g[4]};
46
+ width: ${p[4]};
47
+ flex-shrink: 0;
48
+ transition: ${c.all};
49
+ transition-duration: 200ms;
50
+ `,
51
+ children: /* @__PURE__ */ e(o.HtmlEmbed, { "ws:label": "Chevron Icon", code: b })
52
+ }
53
+ )
54
+ ]
55
+ }
56
+ )
57
+ }
58
+ ),
59
+ /* @__PURE__ */ e(
60
+ i.AccordionContent,
61
+ {
62
+ "ws:style": t`
63
+ overflow: hidden;
64
+ font-size: ${w.sm};
65
+ line-height: ${y.sm};
66
+ transition: ${c.all};
67
+ padding-bottom: ${a[4]};
68
+ `,
69
+ children: new s(l)
70
+ }
71
+ )
72
+ ]
73
+ }
74
+ ), v = {
75
+ category: "radix",
76
+ description: "A vertically stacked set of interactive headings that each reveal an associated section of content. Clicking on the heading will open the item and close other items.",
77
+ order: 3,
78
+ template: /* @__PURE__ */ r(i.Accordion, { collapsible: !0, defaultValue: "0", children: [
79
+ n(
80
+ "Is it accessible?",
81
+ "Yes. It adheres to the WAI-ARIA design pattern."
82
+ ),
83
+ n(
84
+ "Is it styled?",
85
+ "Yes. It comes with default styles that matches the other components' aesthetic."
86
+ ),
87
+ n(
88
+ "Is it animated?",
89
+ "Yes. It's animated by default, but you can disable it if you prefer."
90
+ )
91
+ ] })
92
+ };
93
+ export {
94
+ v as meta
95
+ };
@@ -1,183 +1,24 @@
1
- import { AccordionIcon as a, ItemIcon as s, HeaderIcon as d, TriggerIcon as l, ContentIcon as p, ChevronDownIcon as m } from "@webstudio-is/icons/svg";
2
- import { defaultStates as y } from "@webstudio-is/react-sdk";
3
- import { h3 as h, button as A, div as g } from "@webstudio-is/sdk/normalize.css";
4
- import { borderB as u, overflow as I, text as f, pb as b, my as v, flex as e, items as C, justify as x, py as H, font as T, hover as q, underline as $, property as t, state as w, h as S, w as M, shrink as k, transition as Y, duration as B } from "./theme/tailwind-classes.js";
5
- import { buttonReset as P } from "./theme/styles.js";
6
- import { propsAccordion as R, propsAccordionItem as W, propsAccordionHeader as j, propsAccordionTrigger as D, propsAccordionContent as E } from "./__generated__/accordion.props.js";
7
- const r = {
8
- div: g
9
- }, o = [u()].flat(), n = ({
10
- children: i
11
- }) => ({
12
- type: "instance",
13
- component: "AccordionHeader",
14
- // flex
15
- styles: [e()].flat(),
16
- children: [
17
- {
18
- type: "instance",
19
- component: "AccordionTrigger",
20
- // flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180
21
- styles: [
22
- e(),
23
- e(1),
24
- C("center"),
25
- x("between"),
26
- H(4),
27
- T("medium"),
28
- q([$()].flat()),
29
- t("--accordion-trigger-icon-transform", "0deg"),
30
- w(
31
- [t("--accordion-trigger-icon-transform", "180deg")],
32
- "[data-state=open]"
33
- )
34
- ].flat(),
35
- children: [
36
- {
37
- type: "instance",
38
- component: "Text",
39
- children: i
40
- },
41
- {
42
- type: "instance",
43
- component: "Box",
44
- label: "Icon Container",
45
- // h-4 w-4 shrink-0 transition-transform duration-200
46
- styles: [
47
- t("rotate", "--accordion-trigger-icon-transform"),
48
- S(4),
49
- M(4),
50
- k(0),
51
- Y("all"),
52
- B(200)
53
- ].flat(),
54
- children: [
55
- {
56
- type: "instance",
57
- component: "HtmlEmbed",
58
- label: "Chevron Icon",
59
- props: [
60
- {
61
- type: "string",
62
- name: "code",
63
- value: m
64
- }
65
- ],
66
- children: []
67
- }
68
- ]
69
- }
70
- ]
71
- }
72
- ]
73
- }), c = [
74
- I("hidden"),
75
- f("sm"),
76
- // transition does not work with display: none
77
- // tc.transition("all"),
78
- b(4)
79
- ].flat(), K = {
80
- category: "radix",
81
- order: 3,
1
+ import { AccordionIcon as t, ItemIcon as e, HeaderIcon as n, TriggerIcon as r, ContentIcon as c } from "@webstudio-is/icons/svg";
2
+ import { defaultStates as i } from "@webstudio-is/sdk";
3
+ import { h3 as a, button as p, div as s } from "@webstudio-is/sdk/normalize.css";
4
+ import { buttonReset as d } from "./shared/preset-styles.js";
5
+ import { propsAccordion as m, propsAccordionItem as l, propsAccordionHeader as A, propsAccordionTrigger as I, propsAccordionContent as g } from "./__generated__/accordion.props.js";
6
+ const o = {
7
+ div: s
8
+ }, f = {
82
9
  type: "container",
83
- icon: a,
84
- presetStyle: r,
85
- description: "A vertically stacked set of interactive headings that each reveal an associated section of content. Clicking on the heading will open the item and close other items.",
10
+ icon: t,
11
+ presetStyle: o,
86
12
  constraints: [
87
13
  {
88
14
  relation: "descendant",
89
15
  component: { $eq: "AccordionItem" }
90
16
  }
91
- ],
92
- template: [
93
- {
94
- type: "instance",
95
- component: "Accordion",
96
- props: [
97
- { type: "boolean", name: "collapsible", value: !0 },
98
- { type: "string", name: "defaultValue", value: "0" }
99
- ],
100
- children: [
101
- {
102
- type: "instance",
103
- component: "AccordionItem",
104
- styles: o,
105
- children: [
106
- n({
107
- children: [
108
- { type: "text", value: "Is it accessible?", placeholder: !0 }
109
- ]
110
- }),
111
- {
112
- type: "instance",
113
- component: "AccordionContent",
114
- styles: c,
115
- children: [
116
- {
117
- type: "text",
118
- value: "Yes. It adheres to the WAI-ARIA design pattern.",
119
- placeholder: !0
120
- }
121
- ]
122
- }
123
- ]
124
- },
125
- {
126
- type: "instance",
127
- component: "AccordionItem",
128
- styles: o,
129
- children: [
130
- n({
131
- children: [
132
- { type: "text", value: "Is it styled?", placeholder: !0 }
133
- ]
134
- }),
135
- {
136
- type: "instance",
137
- component: "AccordionContent",
138
- styles: c,
139
- children: [
140
- {
141
- type: "text",
142
- value: "Yes. It comes with default styles that matches the other components' aesthetic.",
143
- placeholder: !0
144
- }
145
- ]
146
- }
147
- ]
148
- },
149
- {
150
- type: "instance",
151
- component: "AccordionItem",
152
- styles: o,
153
- children: [
154
- n({
155
- children: [
156
- { type: "text", value: "Is it animated?", placeholder: !0 }
157
- ]
158
- }),
159
- {
160
- type: "instance",
161
- component: "AccordionContent",
162
- styles: c,
163
- children: [
164
- {
165
- type: "text",
166
- value: "Yes. It's animated by default, but you can disable it if you prefer.",
167
- placeholder: !0
168
- }
169
- ]
170
- }
171
- ]
172
- }
173
- ]
174
- }
175
17
  ]
176
- }, L = {
177
- category: "hidden",
18
+ }, v = {
178
19
  type: "container",
179
20
  label: "Item",
180
- icon: s,
21
+ icon: e,
181
22
  constraints: [
182
23
  {
183
24
  relation: "ancestor",
@@ -193,12 +34,11 @@ const r = {
193
34
  }
194
35
  ],
195
36
  indexWithinAncestor: "Accordion",
196
- presetStyle: r
197
- }, N = {
198
- category: "hidden",
37
+ presetStyle: o
38
+ }, H = {
199
39
  type: "container",
200
40
  label: "Item Header",
201
- icon: d,
41
+ icon: n,
202
42
  constraints: [
203
43
  {
204
44
  relation: "ancestor",
@@ -210,19 +50,28 @@ const r = {
210
50
  }
211
51
  ],
212
52
  presetStyle: {
213
- h3: [h, v(0)].flat()
53
+ h3: [
54
+ ...a,
55
+ {
56
+ property: "marginTop",
57
+ value: { type: "unit", unit: "px", value: 0 }
58
+ },
59
+ {
60
+ property: "marginBottom",
61
+ value: { type: "unit", unit: "px", value: 0 }
62
+ }
63
+ ]
214
64
  }
215
- }, Q = {
216
- category: "hidden",
65
+ }, T = {
217
66
  type: "container",
218
67
  label: "Item Trigger",
219
- icon: l,
68
+ icon: r,
220
69
  constraints: {
221
70
  relation: "ancestor",
222
71
  component: { $eq: "AccordionHeader" }
223
72
  },
224
73
  states: [
225
- ...y,
74
+ ...i,
226
75
  {
227
76
  category: "component-states",
228
77
  label: "Open",
@@ -230,40 +79,39 @@ const r = {
230
79
  }
231
80
  ],
232
81
  presetStyle: {
233
- button: [A, P].flat()
82
+ button: [p, d].flat()
234
83
  }
235
- }, U = {
236
- category: "hidden",
84
+ }, C = {
237
85
  type: "container",
238
86
  label: "Item Content",
239
- icon: p,
87
+ icon: c,
240
88
  constraints: {
241
89
  relation: "ancestor",
242
90
  component: { $eq: "AccordionItem" }
243
91
  },
244
- presetStyle: r
245
- }, X = {
246
- props: R,
92
+ presetStyle: o
93
+ }, M = {
94
+ props: m,
247
95
  initialProps: ["value", "collapsible"]
248
- }, Z = {
249
- props: W,
96
+ }, x = {
97
+ props: l,
250
98
  initialProps: ["value"]
251
- }, _ = {
252
- props: j
253
- }, ee = {
254
- props: D
255
- }, te = {
256
- props: E
99
+ }, S = {
100
+ props: A
101
+ }, h = {
102
+ props: I
103
+ }, P = {
104
+ props: g
257
105
  };
258
106
  export {
259
- K as metaAccordion,
260
- U as metaAccordionContent,
261
- N as metaAccordionHeader,
262
- L as metaAccordionItem,
263
- Q as metaAccordionTrigger,
264
- X as propsMetaAccordion,
265
- te as propsMetaAccordionContent,
266
- _ as propsMetaAccordionHeader,
267
- Z as propsMetaAccordionItem,
268
- ee as propsMetaAccordionTrigger
107
+ f as metaAccordion,
108
+ C as metaAccordionContent,
109
+ H as metaAccordionHeader,
110
+ v as metaAccordionItem,
111
+ T as metaAccordionTrigger,
112
+ M as propsMetaAccordion,
113
+ P as propsMetaAccordionContent,
114
+ S as propsMetaAccordionHeader,
115
+ x as propsMetaAccordionItem,
116
+ h as propsMetaAccordionTrigger
269
117
  };
@@ -0,0 +1,63 @@
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import { CheckMarkIcon as a } from "@webstudio-is/icons/svg";
3
+ import { css as o, $ as t, PlaceholderValue as l } from "@webstudio-is/template";
4
+ import { radix as r } from "./shared/proxy.js";
5
+ import { spacing as s, height as d, width as n, borderRadius as h, borderWidth as b, colors as i, boxShadow as m, opacity as p } from "./shared/theme.js";
6
+ const y = {
7
+ category: "radix",
8
+ description: "Use within a form to allow your users to toggle between checked and not checked. Group checkboxes by matching their “Name” properties. Unlike radios, any number of checkboxes in a group can be checked.",
9
+ order: 101,
10
+ template: /* @__PURE__ */ c(
11
+ r.Label,
12
+ {
13
+ "ws:label": "Checkbox Field",
14
+ "ws:style": o`
15
+ display: flex;
16
+ gap: ${s[2]};
17
+ align-items: center;
18
+ `,
19
+ children: [
20
+ /* @__PURE__ */ e(
21
+ r.Checkbox,
22
+ {
23
+ "ws:style": o`
24
+ height: ${d[4]};
25
+ width: ${n[4]};
26
+ flex-shrink: 0;
27
+ border-radius: ${h.sm};
28
+ border: ${b.DEFAULT} solid ${i.primary};
29
+ &:focus-visible {
30
+ outline: none;
31
+ box-shadow: ${m.ring};
32
+ }
33
+ &:disabled {
34
+ cursor: not-allowed;
35
+ opacity: ${p[50]};
36
+ }
37
+ &[data-state="checked"] {
38
+ background-color: ${i.primary};
39
+ color: ${i.primaryForeground};
40
+ }
41
+ `,
42
+ children: /* @__PURE__ */ e(
43
+ r.CheckboxIndicator,
44
+ {
45
+ "ws:style": o`
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: center;
49
+ color: currentColor;
50
+ `,
51
+ children: /* @__PURE__ */ e(t.HtmlEmbed, { "ws:label": "Indicator Icon", code: a })
52
+ }
53
+ )
54
+ }
55
+ ),
56
+ /* @__PURE__ */ e(t.Text, { "ws:label": "Checkbox Label", tag: "span", children: new l("Checkbox") })
57
+ ]
58
+ }
59
+ )
60
+ };
61
+ export {
62
+ y as meta
63
+ };
@@ -1,21 +1,17 @@
1
- import { CheckboxCheckedIcon as a, CheckMarkIcon as r, TriggerIcon as s } from "@webstudio-is/icons/svg";
2
- import { defaultStates as n } from "@webstudio-is/react-sdk";
3
- import { button as i, span as p } from "@webstudio-is/sdk/normalize.css";
4
- import { flex as e, gap as l, items as t, h as d, w as h, shrink as k, rounded as m, border as o, focusVisible as b, outline as y, ring as u, disabled as x, cursor as C, opacity as g, state as f, bg as I, text as c, justify as v } from "./theme/tailwind-classes.js";
5
- import { buttonReset as w } from "./theme/styles.js";
6
- import { propsCheckbox as q, propsCheckboxIndicator as M } from "./__generated__/checkbox.props.js";
7
- const V = {
8
- category: "radix",
9
- order: 101,
1
+ import { CheckboxCheckedIcon as t, TriggerIcon as o } from "@webstudio-is/icons/svg";
2
+ import { defaultStates as e } from "@webstudio-is/sdk";
3
+ import { button as c, span as n } from "@webstudio-is/sdk/normalize.css";
4
+ import { buttonReset as a } from "./shared/preset-styles.js";
5
+ import { propsCheckbox as r, propsCheckboxIndicator as s } from "./__generated__/checkbox.props.js";
6
+ const k = {
10
7
  type: "container",
11
8
  constraints: {
12
9
  relation: "descendant",
13
10
  component: { $eq: "CheckboxIndicator" }
14
11
  },
15
- icon: a,
16
- description: "Use within a form to allow your users to toggle between checked and not checked. Group checkboxes by matching their “Name” properties. Unlike radios, any number of checkboxes in a group can be checked.",
12
+ icon: t,
17
13
  states: [
18
- ...n,
14
+ ...e,
19
15
  {
20
16
  label: "Checked",
21
17
  selector: "[data-state=checked]",
@@ -28,121 +24,28 @@ const V = {
28
24
  }
29
25
  ],
30
26
  presetStyle: {
31
- button: [i, w].flat()
32
- },
33
- template: [
34
- {
35
- type: "instance",
36
- component: "Label",
37
- label: "Checkbox Field",
38
- styles: [e(), l(2), t("center")].flat(),
39
- children: [
40
- {
41
- type: "instance",
42
- component: "Checkbox",
43
- variables: {
44
- checkboxChecked: { initialValue: !1 }
45
- },
46
- props: [
47
- {
48
- name: "checked",
49
- type: "expression",
50
- code: "checkboxChecked"
51
- },
52
- {
53
- name: "onCheckedChange",
54
- type: "action",
55
- value: [
56
- {
57
- type: "execute",
58
- args: ["checked"],
59
- code: "checkboxChecked = checked"
60
- }
61
- ]
62
- }
63
- ],
64
- // peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background
65
- // focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
66
- // disabled:cursor-not-allowed disabled:opacity-50
67
- // data-[state=checked]:bg-primary
68
- // data-[state=checked]:text-primary-foreground",
69
- styles: [
70
- // We are not supporting peer like styles yet
71
- d(4),
72
- h(4),
73
- k(0),
74
- m("sm"),
75
- o(),
76
- o("primary"),
77
- b(
78
- [y(), u("ring", 2, "background", 2)].flat()
79
- ),
80
- x([C("not-allowed"), g(50)].flat()),
81
- f(
82
- [I("primary"), c("primaryForeground")].flat(),
83
- "[data-state=checked]"
84
- )
85
- ].flat(),
86
- children: [
87
- {
88
- type: "instance",
89
- component: "CheckboxIndicator",
90
- // flex items-center justify-center text-current
91
- styles: [
92
- e(),
93
- t("center"),
94
- v("center"),
95
- c("current")
96
- ].flat(),
97
- children: [
98
- {
99
- type: "instance",
100
- component: "HtmlEmbed",
101
- label: "Indicator Icon",
102
- props: [
103
- {
104
- type: "string",
105
- name: "code",
106
- value: r
107
- }
108
- ],
109
- children: []
110
- }
111
- ]
112
- }
113
- ]
114
- },
115
- {
116
- type: "instance",
117
- component: "Text",
118
- label: "Checkbox Label",
119
- props: [{ name: "tag", type: "string", value: "span" }],
120
- children: [{ type: "text", value: "Checkbox", placeholder: !0 }]
121
- }
122
- ]
123
- }
124
- ]
125
- }, $ = {
126
- category: "hidden",
27
+ button: [c, a].flat()
28
+ }
29
+ }, l = {
127
30
  type: "container",
128
31
  constraints: {
129
32
  relation: "ancestor",
130
33
  component: { $eq: "Checkbox" }
131
34
  },
132
- icon: s,
133
- states: n,
35
+ icon: o,
36
+ states: e,
134
37
  presetStyle: {
135
- span: p
38
+ span: n
136
39
  }
137
- }, j = {
138
- props: q,
40
+ }, b = {
41
+ props: r,
139
42
  initialProps: ["id", "className", "name", "value", "required", "checked"]
140
- }, E = {
141
- props: M
43
+ }, C = {
44
+ props: s
142
45
  };
143
46
  export {
144
- V as metaCheckbox,
145
- $ as metaCheckboxIndicator,
146
- j as propsMetaCheckbox,
147
- E as propsMetaCheckboxIndicator
47
+ k as metaCheckbox,
48
+ l as metaCheckboxIndicator,
49
+ b as propsMetaCheckbox,
50
+ C as propsMetaCheckboxIndicator
148
51
  };
@@ -0,0 +1,16 @@
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { $ as o, PlaceholderValue as l } from "@webstudio-is/template";
3
+ import { radix as t } from "./shared/proxy.js";
4
+ import { getButtonStyle as r } from "./shared/styles.js";
5
+ const p = {
6
+ category: "radix",
7
+ description: "An interactive component which expands and collapses some content, triggered by a button.",
8
+ order: 5,
9
+ template: /* @__PURE__ */ n(t.Collapsible, { children: [
10
+ /* @__PURE__ */ e(t.CollapsibleTrigger, { children: /* @__PURE__ */ e(o.Button, { "ws:style": r("outline"), children: new l("Click to toggle content") }) }),
11
+ /* @__PURE__ */ e(t.CollapsibleContent, { children: /* @__PURE__ */ e(o.Text, { children: new l("Collapsible Content") }) })
12
+ ] })
13
+ };
14
+ export {
15
+ p as meta
16
+ };