@webstudio-is/sdk-components-react-radix 0.87.1 → 0.89.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 (192) hide show
  1. package/lib/__generated__/accordion.props.js +605 -114
  2. package/lib/__generated__/button.props.js +158 -47
  3. package/lib/__generated__/checkbox.props.js +1083 -0
  4. package/lib/__generated__/collapsible.props.js +234 -44
  5. package/lib/__generated__/dialog.props.js +611 -121
  6. package/lib/__generated__/input.props.js +264 -47
  7. package/lib/__generated__/label.props.js +123 -23
  8. package/lib/__generated__/navigation-menu.props.js +2565 -0
  9. package/lib/__generated__/popover.props.js +129 -28
  10. package/lib/__generated__/radio-group.props.js +1627 -0
  11. package/lib/__generated__/select.props.js +3678 -0
  12. package/lib/__generated__/sheet.props.js +591 -121
  13. package/lib/__generated__/switch.props.js +1083 -0
  14. package/lib/__generated__/tabs.props.js +906 -68
  15. package/lib/__generated__/textarea.props.js +177 -31
  16. package/lib/__generated__/tooltip.props.js +131 -29
  17. package/lib/accordion.js +11 -4
  18. package/lib/accordion.ws.js +88 -72
  19. package/lib/checkbox.js +13 -0
  20. package/lib/checkbox.ws.js +153 -0
  21. package/lib/cjs/__generated__/accordion.props.js +605 -114
  22. package/lib/cjs/__generated__/button.props.js +158 -47
  23. package/lib/cjs/__generated__/checkbox.props.js +1103 -0
  24. package/lib/cjs/__generated__/collapsible.props.js +234 -44
  25. package/lib/cjs/__generated__/dialog.props.js +611 -121
  26. package/lib/cjs/__generated__/input.props.js +264 -47
  27. package/lib/cjs/__generated__/label.props.js +123 -23
  28. package/lib/cjs/__generated__/navigation-menu.props.js +2585 -0
  29. package/lib/cjs/__generated__/popover.props.js +129 -28
  30. package/lib/cjs/__generated__/radio-group.props.js +1647 -0
  31. package/lib/cjs/__generated__/select.props.js +3698 -0
  32. package/lib/cjs/__generated__/sheet.props.js +591 -121
  33. package/lib/cjs/__generated__/switch.props.js +1103 -0
  34. package/lib/cjs/__generated__/tabs.props.js +906 -68
  35. package/lib/cjs/__generated__/textarea.props.js +177 -31
  36. package/lib/cjs/__generated__/tooltip.props.js +131 -29
  37. package/lib/cjs/accordion.js +11 -4
  38. package/lib/cjs/accordion.ws.js +86 -71
  39. package/lib/cjs/{textarea.js → checkbox.js} +9 -6
  40. package/lib/cjs/checkbox.ws.js +174 -0
  41. package/lib/cjs/collapsible.ws.js +5 -1
  42. package/lib/cjs/components.js +27 -14
  43. package/lib/cjs/dialog.ws.js +18 -17
  44. package/lib/cjs/hooks.js +5 -1
  45. package/lib/cjs/label.ws.js +2 -1
  46. package/lib/cjs/metas.js +29 -14
  47. package/lib/cjs/navigation-menu.js +107 -0
  48. package/lib/cjs/navigation-menu.ws.js +514 -0
  49. package/lib/cjs/popover.ws.js +13 -9
  50. package/lib/cjs/props-descriptions.js +56 -0
  51. package/lib/cjs/props.js +27 -14
  52. package/lib/cjs/{button.js → radio-group.js} +10 -8
  53. package/lib/cjs/radio-group.ws.js +191 -0
  54. package/lib/cjs/select.js +83 -0
  55. package/lib/cjs/select.ws.js +350 -0
  56. package/lib/cjs/sheet.ws.js +88 -176
  57. package/lib/cjs/{input.js → switch.js} +8 -9
  58. package/lib/cjs/switch.ws.js +173 -0
  59. package/lib/cjs/tabs.js +2 -3
  60. package/lib/cjs/tabs.ws.js +14 -18
  61. package/lib/cjs/theme/styles.js +100 -0
  62. package/lib/cjs/theme/tailwind-classes.js +125 -16
  63. package/lib/cjs/theme/tailwind-colors.js +1 -0
  64. package/lib/cjs/tooltip.ws.js +12 -8
  65. package/lib/collapsible.ws.js +5 -1
  66. package/lib/components.js +44 -22
  67. package/lib/dialog.ws.js +18 -17
  68. package/lib/hooks.js +5 -1
  69. package/lib/label.ws.js +2 -1
  70. package/lib/metas.js +58 -24
  71. package/lib/navigation-menu.js +85 -0
  72. package/lib/navigation-menu.ws.js +501 -0
  73. package/lib/popover.ws.js +13 -9
  74. package/lib/props-descriptions.js +36 -0
  75. package/lib/props.js +56 -24
  76. package/lib/radio-group.js +11 -0
  77. package/lib/radio-group.ws.js +173 -0
  78. package/lib/select.js +75 -0
  79. package/lib/select.ws.js +338 -0
  80. package/lib/sheet.ws.js +89 -194
  81. package/lib/switch.js +7 -0
  82. package/lib/switch.ws.js +145 -0
  83. package/lib/tabs.js +3 -5
  84. package/lib/tabs.ws.js +15 -19
  85. package/lib/theme/styles.js +70 -0
  86. package/lib/theme/tailwind-classes.js +125 -16
  87. package/lib/theme/tailwind-colors.js +1 -0
  88. package/lib/tooltip.ws.js +12 -8
  89. package/lib/types/__generated__/checkbox.props.d.ts +3 -0
  90. package/lib/types/__generated__/navigation-menu.props.d.ts +8 -0
  91. package/lib/types/__generated__/radio-group.props.d.ts +4 -0
  92. package/lib/types/__generated__/select.props.d.ts +9 -0
  93. package/lib/types/__generated__/switch.props.d.ts +3 -0
  94. package/lib/types/checkbox.d.ts +6 -0
  95. package/lib/types/checkbox.stories.d.ts +11 -0
  96. package/lib/types/checkbox.ws.d.ts +5 -0
  97. package/lib/types/components.d.ts +5 -4
  98. package/lib/types/metas.d.ts +6 -4
  99. package/lib/types/navigation-menu.d.ts +15 -0
  100. package/lib/types/navigation-menu.ws.d.ts +15 -0
  101. package/lib/types/props-descriptions.d.ts +29 -0
  102. package/lib/types/props.d.ts +5 -4
  103. package/lib/types/radio-group.d.ts +5 -0
  104. package/lib/types/radio-group.stories.d.ts +9 -0
  105. package/lib/types/radio-group.ws.d.ts +7 -0
  106. package/lib/types/select.d.ts +14 -0
  107. package/lib/types/select.ws.d.ts +17 -0
  108. package/lib/types/sheet.ws.d.ts +2 -15
  109. package/lib/types/switch.d.ts +4 -0
  110. package/lib/types/switch.stories.d.ts +9 -0
  111. package/lib/types/switch.ws.d.ts +5 -0
  112. package/lib/types/tabs.d.ts +3 -12
  113. package/lib/types/theme/radix-common-types.d.ts +3 -2
  114. package/lib/types/theme/styles.d.ts +215 -0
  115. package/lib/types/theme/tailwind-classes.d.ts +16 -6
  116. package/lib/types/theme/tailwind-colors.d.ts +1 -0
  117. package/lib/types/theme/tailwind-theme.d.ts +1 -1
  118. package/package.json +12 -7
  119. package/src/__generated__/accordion.props.ts +675 -108
  120. package/src/__generated__/button.props.ts +177 -45
  121. package/src/__generated__/checkbox.props.ts +1217 -0
  122. package/src/__generated__/collapsible.props.ts +261 -42
  123. package/src/__generated__/dialog.props.ts +682 -115
  124. package/src/__generated__/input.props.ts +292 -44
  125. package/src/__generated__/label.props.ts +137 -22
  126. package/src/__generated__/navigation-menu.props.ts +2882 -0
  127. package/src/__generated__/popover.props.ts +142 -24
  128. package/src/__generated__/radio-group.props.ts +1828 -0
  129. package/src/__generated__/select.props.ts +4130 -0
  130. package/src/__generated__/sheet.props.ts +657 -110
  131. package/src/__generated__/switch.props.ts +1217 -0
  132. package/src/__generated__/tabs.props.ts +1019 -67
  133. package/src/__generated__/textarea.props.ts +195 -30
  134. package/src/__generated__/tooltip.props.ts +145 -25
  135. package/src/accordion.tsx +14 -7
  136. package/src/accordion.ws.ts +87 -70
  137. package/src/{textarea.stories.ts → checkbox.stories.ts} +6 -11
  138. package/src/checkbox.tsx +22 -0
  139. package/src/checkbox.ws.ts +154 -0
  140. package/src/collapsible.ws.ts +6 -1
  141. package/src/components.ts +25 -12
  142. package/src/dialog.ws.tsx +17 -16
  143. package/src/hooks.ts +4 -0
  144. package/src/label.ws.ts +3 -1
  145. package/src/metas.ts +36 -12
  146. package/src/navigation-menu.stories.tsx +21 -0
  147. package/src/navigation-menu.tsx +130 -0
  148. package/src/navigation-menu.ws.ts +524 -0
  149. package/src/popover.ws.tsx +13 -9
  150. package/src/props-descriptions.ts +43 -0
  151. package/src/props.ts +35 -12
  152. package/src/{input.stories.ts → radio-group.stories.ts} +6 -15
  153. package/src/radio-group.tsx +17 -0
  154. package/src/radio-group.ws.ts +178 -0
  155. package/src/select.stories.tsx +21 -0
  156. package/src/select.tsx +112 -0
  157. package/src/select.ws.ts +349 -0
  158. package/src/sheet.ws.tsx +91 -209
  159. package/src/{button.stories.ts → switch.stories.ts} +6 -19
  160. package/src/switch.tsx +10 -0
  161. package/src/switch.ws.ts +146 -0
  162. package/src/tabs.tsx +4 -17
  163. package/src/tabs.ws.ts +19 -19
  164. package/src/theme/radix-common-types.ts +3 -2
  165. package/src/theme/styles.ts +80 -0
  166. package/src/theme/tailwind-classes.ts +150 -14
  167. package/src/theme/tailwind-colors.ts +1 -0
  168. package/src/tooltip.ws.tsx +13 -8
  169. package/lib/button.js +0 -8
  170. package/lib/button.ws.js +0 -133
  171. package/lib/cjs/button.ws.js +0 -160
  172. package/lib/cjs/input.ws.js +0 -103
  173. package/lib/cjs/textarea.ws.js +0 -98
  174. package/lib/input.js +0 -8
  175. package/lib/input.ws.js +0 -75
  176. package/lib/textarea.js +0 -8
  177. package/lib/textarea.ws.js +0 -70
  178. package/lib/types/button.d.ts +0 -7
  179. package/lib/types/button.stories.d.ts +0 -20
  180. package/lib/types/button.ws.d.ts +0 -7
  181. package/lib/types/input.d.ts +0 -2
  182. package/lib/types/input.stories.d.ts +0 -20
  183. package/lib/types/input.ws.d.ts +0 -3
  184. package/lib/types/textarea.d.ts +0 -2
  185. package/lib/types/textarea.stories.d.ts +0 -14
  186. package/lib/types/textarea.ws.d.ts +0 -3
  187. package/src/button.tsx +0 -25
  188. package/src/button.ws.ts +0 -155
  189. package/src/input.tsx +0 -12
  190. package/src/input.ws.ts +0 -78
  191. package/src/textarea.tsx +0 -12
  192. package/src/textarea.ws.ts +0 -74
@@ -43,22 +43,77 @@ module.exports = __toCommonJS(accordion_ws_exports);
43
43
  var import_svg = require("@webstudio-is/icons/svg");
44
44
  var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
45
45
  var tc = __toESM(require("./theme/tailwind-classes"), 1);
46
+ var import_styles = require("./theme/styles");
46
47
  var import_accordion = require("./__generated__/accordion.props");
47
48
  const presetStyle = {
48
49
  div: import_css_normalize.div
49
50
  };
50
51
  const accordionItemStyles = [tc.borderB()].flat();
51
- const accordionHeaderStyles = [tc.flex()].flat();
52
- const accordionTriggerStyles = [
53
- tc.flex(),
54
- tc.flex(1),
55
- tc.items("center"),
56
- tc.justify("between"),
57
- tc.py(4),
58
- tc.font("medium"),
59
- tc.transition("all"),
60
- tc.hover([tc.underline()].flat())
61
- ].flat();
52
+ const createAccordionTrigger = ({
53
+ children
54
+ }) => ({
55
+ type: "instance",
56
+ component: "AccordionHeader",
57
+ // flex
58
+ styles: [tc.flex()].flat(),
59
+ children: [
60
+ {
61
+ type: "instance",
62
+ component: "AccordionTrigger",
63
+ // flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180
64
+ styles: [
65
+ tc.flex(),
66
+ tc.flex(1),
67
+ tc.items("center"),
68
+ tc.justify("between"),
69
+ tc.py(4),
70
+ tc.font("medium"),
71
+ tc.hover([tc.underline()].flat()),
72
+ tc.property("--accordion-trigger-icon-transform", "0deg"),
73
+ tc.state(
74
+ [tc.property("--accordion-trigger-icon-transform", "180deg")],
75
+ "[data-state=open]"
76
+ )
77
+ ].flat(),
78
+ children: [
79
+ {
80
+ type: "instance",
81
+ component: "Text",
82
+ children
83
+ },
84
+ {
85
+ type: "instance",
86
+ component: "Box",
87
+ label: "Icon Container",
88
+ // h-4 w-4 shrink-0 transition-transform duration-200
89
+ styles: [
90
+ tc.property("rotate", "--accordion-trigger-icon-transform"),
91
+ tc.h(4),
92
+ tc.w(4),
93
+ tc.shrink(0),
94
+ tc.transition("all"),
95
+ tc.duration(200)
96
+ ].flat(),
97
+ children: [
98
+ {
99
+ type: "instance",
100
+ component: "HtmlEmbed",
101
+ label: "Chevron Icon",
102
+ props: [
103
+ {
104
+ type: "string",
105
+ name: "code",
106
+ value: import_svg.ChevronDownIcon
107
+ }
108
+ ],
109
+ children: []
110
+ }
111
+ ]
112
+ }
113
+ ]
114
+ }
115
+ ]
116
+ });
62
117
  const accordionContentStyles = [
63
118
  tc.overflow("hidden"),
64
119
  tc.text("sm"),
@@ -68,9 +123,11 @@ const accordionContentStyles = [
68
123
  ].flat();
69
124
  const metaAccordion = {
70
125
  category: "radix",
126
+ order: 3,
71
127
  type: "container",
72
128
  icon: import_svg.AccordionIcon,
73
129
  presetStyle,
130
+ 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.",
74
131
  template: [
75
132
  {
76
133
  type: "instance",
@@ -99,19 +156,9 @@ const metaAccordion = {
99
156
  component: "AccordionItem",
100
157
  styles: accordionItemStyles,
101
158
  children: [
102
- {
103
- type: "instance",
104
- component: "AccordionHeader",
105
- styles: accordionHeaderStyles,
106
- children: [
107
- {
108
- type: "instance",
109
- component: "AccordionTrigger",
110
- styles: accordionTriggerStyles,
111
- children: [{ type: "text", value: "Is it accessible?" }]
112
- }
113
- ]
114
- },
159
+ createAccordionTrigger({
160
+ children: [{ type: "text", value: "Is it accessible?" }]
161
+ }),
115
162
  {
116
163
  type: "instance",
117
164
  component: "AccordionContent",
@@ -130,19 +177,9 @@ const metaAccordion = {
130
177
  component: "AccordionItem",
131
178
  styles: accordionItemStyles,
132
179
  children: [
133
- {
134
- type: "instance",
135
- component: "AccordionHeader",
136
- styles: accordionHeaderStyles,
137
- children: [
138
- {
139
- type: "instance",
140
- component: "AccordionTrigger",
141
- styles: accordionTriggerStyles,
142
- children: [{ type: "text", value: "Is it styled?" }]
143
- }
144
- ]
145
- },
180
+ createAccordionTrigger({
181
+ children: [{ type: "text", value: "Is it styled?" }]
182
+ }),
146
183
  {
147
184
  type: "instance",
148
185
  component: "AccordionContent",
@@ -161,19 +198,9 @@ const metaAccordion = {
161
198
  component: "AccordionItem",
162
199
  styles: accordionItemStyles,
163
200
  children: [
164
- {
165
- type: "instance",
166
- component: "AccordionHeader",
167
- styles: accordionHeaderStyles,
168
- children: [
169
- {
170
- type: "instance",
171
- component: "AccordionTrigger",
172
- styles: accordionTriggerStyles,
173
- children: [{ type: "text", value: "Is it animated?" }]
174
- }
175
- ]
176
- },
201
+ createAccordionTrigger({
202
+ children: [{ type: "text", value: "Is it animated?" }]
203
+ }),
177
204
  {
178
205
  type: "instance",
179
206
  component: "AccordionContent",
@@ -197,7 +224,8 @@ const metaAccordionItem = {
197
224
  icon: import_svg.ItemIcon,
198
225
  requiredAncestors: ["Accordion"],
199
226
  indexWithinAncestor: "Accordion",
200
- presetStyle
227
+ presetStyle,
228
+ label: "Item"
201
229
  };
202
230
  const metaAccordionHeader = {
203
231
  category: "hidden",
@@ -207,7 +235,8 @@ const metaAccordionHeader = {
207
235
  detachable: false,
208
236
  presetStyle: {
209
237
  h3: [import_css_normalize.h3, tc.my(0)].flat()
210
- }
238
+ },
239
+ label: "Item Header"
211
240
  };
212
241
  const metaAccordionTrigger = {
213
242
  category: "hidden",
@@ -216,24 +245,9 @@ const metaAccordionTrigger = {
216
245
  requiredAncestors: ["AccordionHeader"],
217
246
  detachable: false,
218
247
  presetStyle: {
219
- button: [
220
- import_css_normalize.button,
221
- {
222
- property: "backgroundColor",
223
- value: { type: "keyword", value: "transparent" }
224
- },
225
- {
226
- property: "backgroundImage",
227
- value: { type: "keyword", value: "none" }
228
- },
229
- {
230
- property: "cursor",
231
- value: { type: "keyword", value: "pointer" }
232
- },
233
- tc.px(0),
234
- tc.border(0)
235
- ].flat()
236
- }
248
+ button: [import_css_normalize.button, import_styles.buttonReset].flat()
249
+ },
250
+ label: "Item Trigger"
237
251
  };
238
252
  const metaAccordionContent = {
239
253
  category: "hidden",
@@ -241,7 +255,8 @@ const metaAccordionContent = {
241
255
  icon: import_svg.ContentIcon,
242
256
  requiredAncestors: ["AccordionItem"],
243
257
  detachable: false,
244
- presetStyle
258
+ presetStyle,
259
+ label: "Item Content"
245
260
  };
246
261
  const propsMetaAccordion = {
247
262
  props: import_accordion.propsAccordion,
@@ -16,13 +16,16 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var textarea_exports = {};
20
- __export(textarea_exports, {
21
- Textarea: () => Textarea
19
+ var checkbox_exports = {};
20
+ __export(checkbox_exports, {
21
+ Checkbox: () => Checkbox,
22
+ CheckboxIndicator: () => CheckboxIndicator
22
23
  });
23
- module.exports = __toCommonJS(textarea_exports);
24
+ module.exports = __toCommonJS(checkbox_exports);
24
25
  var import_jsx_runtime = require("react/jsx-runtime");
25
26
  var import_react = require("react");
26
- const Textarea = (0, import_react.forwardRef)(({ children: _children, ...props }, ref) => {
27
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("textarea", { ref, ...props });
27
+ var import_react_checkbox = require("@radix-ui/react-checkbox");
28
+ const Checkbox = (0, import_react.forwardRef)((props, ref) => {
29
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_checkbox.Root, { ref, ...props });
28
30
  });
31
+ const CheckboxIndicator = import_react_checkbox.Indicator;
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var checkbox_ws_exports = {};
30
+ __export(checkbox_ws_exports, {
31
+ metaCheckbox: () => metaCheckbox,
32
+ metaCheckboxIndicator: () => metaCheckboxIndicator,
33
+ propsMetaCheckbox: () => propsMetaCheckbox,
34
+ propsMetaCheckboxIndicator: () => propsMetaCheckboxIndicator
35
+ });
36
+ module.exports = __toCommonJS(checkbox_ws_exports);
37
+ var import_svg = require("@webstudio-is/icons/svg");
38
+ var import_react_sdk = require("@webstudio-is/react-sdk");
39
+ var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
40
+ var tc = __toESM(require("./theme/tailwind-classes"), 1);
41
+ var import_styles = require("./theme/styles");
42
+ var import_checkbox = require("./__generated__/checkbox.props");
43
+ const metaCheckbox = {
44
+ category: "radix",
45
+ order: 101,
46
+ type: "container",
47
+ icon: import_svg.CheckboxCheckedIcon,
48
+ description: "Use within a form to allow your users to toggle between checked and not checked. Group checkboxes by matching their \u201CName\u201D properties. Unlike radios, any number of checkboxes in a group can be checked.",
49
+ states: [
50
+ ...import_react_sdk.defaultStates,
51
+ {
52
+ label: "Checked",
53
+ selector: "[data-state=checked]",
54
+ category: "component-states"
55
+ },
56
+ {
57
+ label: "Unchecked",
58
+ selector: "[data-state=unchecked]",
59
+ category: "component-states"
60
+ }
61
+ ],
62
+ presetStyle: {
63
+ button: [import_css_normalize.button, import_styles.buttonReset].flat()
64
+ },
65
+ template: [
66
+ {
67
+ type: "instance",
68
+ component: "Label",
69
+ label: "Checkbox Field",
70
+ styles: [tc.flex(), tc.gap(2), tc.items("center")].flat(),
71
+ children: [
72
+ {
73
+ type: "instance",
74
+ component: "Checkbox",
75
+ dataSources: {
76
+ checkboxChecked: { type: "variable", initialValue: false }
77
+ },
78
+ props: [
79
+ {
80
+ name: "checked",
81
+ type: "dataSource",
82
+ dataSourceName: "checkboxChecked"
83
+ },
84
+ {
85
+ name: "onCheckedChange",
86
+ type: "action",
87
+ value: [
88
+ {
89
+ type: "execute",
90
+ args: ["checked"],
91
+ code: `checkboxChecked = checked`
92
+ }
93
+ ]
94
+ }
95
+ ],
96
+ // peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background
97
+ // focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
98
+ // disabled:cursor-not-allowed disabled:opacity-50
99
+ // data-[state=checked]:bg-primary
100
+ // data-[state=checked]:text-primary-foreground",
101
+ styles: [
102
+ // We are not supporting peer like styles yet
103
+ tc.h(4),
104
+ tc.w(4),
105
+ tc.shrink(0),
106
+ tc.rounded("sm"),
107
+ tc.border(),
108
+ tc.border("primary"),
109
+ tc.focusVisible(
110
+ [tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()
111
+ ),
112
+ tc.disabled([tc.cursor("not-allowed"), tc.opacity(50)].flat()),
113
+ tc.state(
114
+ [tc.bg("primary"), tc.text("primaryForeground")].flat(),
115
+ "[data-state=checked]"
116
+ )
117
+ ].flat(),
118
+ children: [
119
+ {
120
+ type: "instance",
121
+ component: "CheckboxIndicator",
122
+ // flex items-center justify-center text-current
123
+ styles: [
124
+ tc.flex(),
125
+ tc.items("center"),
126
+ tc.justify("center"),
127
+ tc.text("current")
128
+ ].flat(),
129
+ children: [
130
+ {
131
+ type: "instance",
132
+ component: "HtmlEmbed",
133
+ label: "Indicator Icon",
134
+ props: [
135
+ {
136
+ type: "string",
137
+ name: "code",
138
+ value: import_svg.CheckMarkIcon
139
+ }
140
+ ],
141
+ children: []
142
+ }
143
+ ]
144
+ }
145
+ ]
146
+ },
147
+ {
148
+ type: "instance",
149
+ component: "Text",
150
+ label: "Checkbox Label",
151
+ props: [{ name: "tag", type: "string", value: "span" }],
152
+ children: [{ type: "text", value: "Checkbox" }]
153
+ }
154
+ ]
155
+ }
156
+ ]
157
+ };
158
+ const metaCheckboxIndicator = {
159
+ category: "hidden",
160
+ type: "container",
161
+ detachable: false,
162
+ icon: import_svg.TriggerIcon,
163
+ states: import_react_sdk.defaultStates,
164
+ presetStyle: {
165
+ span: import_css_normalize.span
166
+ }
167
+ };
168
+ const propsMetaCheckbox = {
169
+ props: import_checkbox.propsCheckbox,
170
+ initialProps: ["id", "checked", "name", "required"]
171
+ };
172
+ const propsMetaCheckboxIndicator = {
173
+ props: import_checkbox.propsCheckboxIndicator
174
+ };
@@ -27,16 +27,19 @@ __export(collapsible_ws_exports, {
27
27
  });
28
28
  module.exports = __toCommonJS(collapsible_ws_exports);
29
29
  var import_svg = require("@webstudio-is/icons/svg");
30
- var import_collapsible = require("./__generated__/collapsible.props");
31
30
  var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
31
+ var import_collapsible = require("./__generated__/collapsible.props");
32
+ var import_styles = require("./theme/styles");
32
33
  const presetStyle = {
33
34
  div: import_css_normalize.div
34
35
  };
35
36
  const metaCollapsible = {
36
37
  category: "radix",
38
+ order: 5,
37
39
  type: "container",
38
40
  presetStyle,
39
41
  icon: import_svg.CollapsibleIcon,
42
+ description: "An interactive component which expands and collapses some content, triggered by a button.",
40
43
  template: [
41
44
  {
42
45
  type: "instance",
@@ -66,6 +69,7 @@ const metaCollapsible = {
66
69
  {
67
70
  type: "instance",
68
71
  component: "Button",
72
+ styles: (0, import_styles.getButtonStyles)("outline"),
69
73
  children: [{ type: "text", value: "Click to toggle content" }]
70
74
  }
71
75
  ]
@@ -23,7 +23,8 @@ __export(components_exports, {
23
23
  AccordionHeader: () => import_accordion.AccordionHeader,
24
24
  AccordionItem: () => import_accordion.AccordionItem,
25
25
  AccordionTrigger: () => import_accordion.AccordionTrigger,
26
- Button: () => import_button.Button,
26
+ Checkbox: () => import_checkbox.Checkbox,
27
+ CheckboxIndicator: () => import_checkbox.CheckboxIndicator,
27
28
  Collapsible: () => import_collapsible.Collapsible,
28
29
  CollapsibleContent: () => import_collapsible.CollapsibleContent,
29
30
  CollapsibleTrigger: () => import_collapsible.CollapsibleTrigger,
@@ -34,23 +35,34 @@ __export(components_exports, {
34
35
  DialogOverlay: () => import_dialog.DialogOverlay,
35
36
  DialogTitle: () => import_dialog.DialogTitle,
36
37
  DialogTrigger: () => import_dialog.DialogTrigger,
37
- Input: () => import_input.Input,
38
38
  Label: () => import_label.Label,
39
+ NavigationMenu: () => import_navigation_menu.NavigationMenu,
40
+ NavigationMenuContent: () => import_navigation_menu.NavigationMenuContent,
41
+ NavigationMenuItem: () => import_navigation_menu.NavigationMenuItem,
42
+ NavigationMenuLink: () => import_navigation_menu.NavigationMenuLink,
43
+ NavigationMenuList: () => import_navigation_menu.NavigationMenuList,
44
+ NavigationMenuTrigger: () => import_navigation_menu.NavigationMenuTrigger,
45
+ NavigationMenuViewport: () => import_navigation_menu.NavigationMenuViewport,
39
46
  Popover: () => import_popover.Popover,
40
47
  PopoverContent: () => import_popover.PopoverContent,
41
48
  PopoverTrigger: () => import_popover.PopoverTrigger,
42
- Sheet: () => import_sheet.Sheet,
43
- SheetClose: () => import_sheet.SheetClose,
44
- SheetContent: () => import_sheet.SheetContent,
45
- SheetDescription: () => import_sheet.SheetDescription,
46
- SheetOverlay: () => import_sheet.SheetOverlay,
47
- SheetTitle: () => import_sheet.SheetTitle,
48
- SheetTrigger: () => import_sheet.SheetTrigger,
49
+ RadioGroup: () => import_radio_group.RadioGroup,
50
+ RadioGroupIndicator: () => import_radio_group.RadioGroupIndicator,
51
+ RadioGroupItem: () => import_radio_group.RadioGroupItem,
52
+ Select: () => import_select.Select,
53
+ SelectContent: () => import_select.SelectContent,
54
+ SelectItem: () => import_select.SelectItem,
55
+ SelectItemIndicator: () => import_select.SelectItemIndicator,
56
+ SelectItemText: () => import_select.SelectItemText,
57
+ SelectTrigger: () => import_select.SelectTrigger,
58
+ SelectValue: () => import_select.SelectValue,
59
+ SelectViewport: () => import_select.SelectViewport,
60
+ Switch: () => import_switch.Switch,
61
+ SwitchThumb: () => import_switch.SwitchThumb,
49
62
  Tabs: () => import_tabs.Tabs,
50
63
  TabsContent: () => import_tabs.TabsContent,
51
64
  TabsList: () => import_tabs.TabsList,
52
65
  TabsTrigger: () => import_tabs.TabsTrigger,
53
- Textarea: () => import_textarea.Textarea,
54
66
  Tooltip: () => import_tooltip.Tooltip,
55
67
  TooltipContent: () => import_tooltip.TooltipContent,
56
68
  TooltipTrigger: () => import_tooltip.TooltipTrigger
@@ -60,10 +72,11 @@ var import_collapsible = require("./collapsible");
60
72
  var import_dialog = require("./dialog");
61
73
  var import_popover = require("./popover");
62
74
  var import_tooltip = require("./tooltip");
63
- var import_sheet = require("./sheet");
64
75
  var import_tabs = require("./tabs");
65
- var import_button = require("./button");
66
- var import_input = require("./input");
67
- var import_textarea = require("./textarea");
68
76
  var import_label = require("./label");
69
77
  var import_accordion = require("./accordion");
78
+ var import_navigation_menu = require("./navigation-menu");
79
+ var import_select = require("./select");
80
+ var import_switch = require("./switch");
81
+ var import_checkbox = require("./checkbox");
82
+ var import_radio_group = require("./radio-group");
@@ -46,10 +46,10 @@ __export(dialog_ws_exports, {
46
46
  module.exports = __toCommonJS(dialog_ws_exports);
47
47
  var import_svg = require("@webstudio-is/icons/svg");
48
48
  var import_react_sdk = require("@webstudio-is/react-sdk");
49
+ var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
49
50
  var tc = __toESM(require("./theme/tailwind-classes"), 1);
50
51
  var import_dialog = require("./__generated__/dialog.props");
51
- var import_button = require("./button.ws");
52
- var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
52
+ var import_styles = require("./theme/styles");
53
53
  const presetStyle = {
54
54
  div: import_css_normalize.div
55
55
  };
@@ -99,14 +99,16 @@ const metaDialogClose = {
99
99
  category: "hidden",
100
100
  type: "container",
101
101
  presetStyle: buttonPresetStyle,
102
- icon: import_svg.ButtonElementIcon
102
+ icon: import_svg.ButtonElementIcon,
103
+ label: "Close Button"
103
104
  };
104
105
  const metaDialog = {
105
106
  category: "radix",
107
+ order: 4,
106
108
  type: "container",
107
109
  icon: import_svg.DialogIcon,
108
- order: 15,
109
110
  stylable: false,
111
+ description: "Displays content with an overlay that covers the window, triggered by a button. Clicking the overlay will close the dialog.",
110
112
  template: [
111
113
  {
112
114
  type: "instance",
@@ -132,15 +134,18 @@ const metaDialog = {
132
134
  {
133
135
  type: "instance",
134
136
  component: "DialogTrigger",
135
- props: [],
136
- children: (0, import_button.template)({
137
- children: [{ type: "text", value: "Button" }]
138
- })
137
+ children: [
138
+ {
139
+ type: "instance",
140
+ component: "Button",
141
+ styles: (0, import_styles.getButtonStyles)("outline"),
142
+ children: [{ type: "text", value: "Button" }]
143
+ }
144
+ ]
139
145
  },
140
146
  {
141
147
  type: "instance",
142
148
  component: "DialogOverlay",
143
- props: [],
144
149
  /**
145
150
  * fixed inset-0 z-50 bg-background/80 backdrop-blur-sm
146
151
  * flex
@@ -152,13 +157,13 @@ const metaDialog = {
152
157
  tc.bg("background", 80),
153
158
  tc.backdropBlur("sm"),
154
159
  // To allow positioning Content
155
- tc.flex()
160
+ tc.flex(),
161
+ tc.overflow("auto")
156
162
  ].flat(),
157
163
  children: [
158
164
  {
159
165
  type: "instance",
160
166
  component: "DialogContent",
161
- props: [],
162
167
  /**
163
168
  * fixed w-full z-50
164
169
  * grid gap-4 max-w-lg
@@ -184,13 +189,11 @@ const metaDialog = {
184
189
  type: "instance",
185
190
  component: "Box",
186
191
  label: "Dialog Header",
187
- props: [],
188
192
  styles: [tc.flex(), tc.flex("col"), tc.gap(1)].flat(),
189
193
  children: [
190
194
  {
191
195
  type: "instance",
192
196
  component: "DialogTitle",
193
- props: [],
194
197
  /**
195
198
  * text-lg leading-none tracking-tight
196
199
  **/
@@ -210,7 +213,6 @@ const metaDialog = {
210
213
  {
211
214
  type: "instance",
212
215
  component: "DialogDescription",
213
- props: [],
214
216
  /**
215
217
  * text-sm text-muted-foreground
216
218
  **/
@@ -222,7 +224,7 @@ const metaDialog = {
222
224
  children: [
223
225
  {
224
226
  type: "text",
225
- value: "dialog description text you can edit"
227
+ value: "Dialog description text you can edit"
226
228
  }
227
229
  ]
228
230
  }
@@ -236,7 +238,6 @@ const metaDialog = {
236
238
  {
237
239
  type: "instance",
238
240
  component: "DialogClose",
239
- props: [],
240
241
  /**
241
242
  * absolute right-4 top-4
242
243
  * rounded-sm opacity-70
@@ -273,7 +274,7 @@ const metaDialog = {
273
274
  };
274
275
  const propsMetaDialog = {
275
276
  props: import_dialog.propsDialog,
276
- initialProps: ["open", "modal"]
277
+ initialProps: ["open"]
277
278
  };
278
279
  const propsMetaDialogTrigger = {
279
280
  props: import_dialog.propsDialogTrigger
package/lib/cjs/hooks.js CHANGED
@@ -28,6 +28,8 @@ var import_popover = require("./popover");
28
28
  var import_sheet = require("./sheet");
29
29
  var import_tooltip = require("./tooltip");
30
30
  var import_accordion = require("./accordion");
31
+ var import_navigation_menu = require("./navigation-menu");
32
+ var import_select = require("./select");
31
33
  const hooks = [
32
34
  import_collapsible.hooksCollapsible,
33
35
  import_tabs.hooksTabs,
@@ -35,5 +37,7 @@ const hooks = [
35
37
  import_popover.hooksPopover,
36
38
  import_sheet.hooksSheet,
37
39
  import_tooltip.hooksTooltip,
38
- import_accordion.hooksAccordion
40
+ import_accordion.hooksAccordion,
41
+ import_navigation_menu.hooksNavigationMenu,
42
+ import_select.hooksSelect
39
43
  ];
@@ -42,11 +42,12 @@ const presetStyle = {
42
42
  };
43
43
  const meta = {
44
44
  category: "radix",
45
+ order: 102,
45
46
  type: "container",
46
47
  icon: import_svg.LabelIcon,
47
48
  presetStyle,
48
49
  states: import_react_sdk.defaultStates,
49
- order: 1,
50
+ description: "An accessible label to describe the purpose of an input. Match the \u201CFor\u201D property on the label with the \u201CID\u201D of the input to connect them.",
50
51
  template: [
51
52
  {
52
53
  type: "instance",