@webstudio-is/sdk-components-react-radix 0.87.0 → 0.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__generated__/accordion.props.js +0 -5
- package/lib/__generated__/button.props.js +0 -21
- package/lib/__generated__/checkbox.props.js +850 -0
- package/lib/__generated__/collapsible.props.js +0 -2
- package/lib/__generated__/dialog.props.js +0 -11
- package/lib/__generated__/label.props.js +0 -1
- package/lib/__generated__/navigation-menu.props.js +2104 -0
- package/lib/__generated__/popover.props.js +0 -3
- package/lib/__generated__/radio-group.props.js +1282 -0
- package/lib/__generated__/select.props.js +2962 -0
- package/lib/__generated__/sheet.props.js +0 -11
- package/lib/__generated__/switch.props.js +850 -0
- package/lib/__generated__/tabs.props.js +428 -5
- package/lib/__generated__/tooltip.props.js +0 -2
- package/lib/accordion.js +11 -4
- package/lib/accordion.ws.js +87 -72
- package/lib/checkbox.js +13 -0
- package/lib/checkbox.ws.js +151 -0
- package/lib/cjs/__generated__/accordion.props.js +0 -5
- package/lib/cjs/__generated__/button.props.js +0 -21
- package/lib/cjs/__generated__/checkbox.props.js +870 -0
- package/lib/cjs/__generated__/collapsible.props.js +0 -2
- package/lib/cjs/__generated__/dialog.props.js +0 -11
- package/lib/cjs/__generated__/label.props.js +0 -1
- package/lib/cjs/__generated__/navigation-menu.props.js +2124 -0
- package/lib/cjs/__generated__/popover.props.js +0 -3
- package/lib/cjs/__generated__/radio-group.props.js +1302 -0
- package/lib/cjs/__generated__/select.props.js +2982 -0
- package/lib/cjs/__generated__/sheet.props.js +0 -11
- package/lib/cjs/__generated__/switch.props.js +870 -0
- package/lib/cjs/__generated__/tabs.props.js +428 -5
- package/lib/cjs/__generated__/tooltip.props.js +0 -2
- package/lib/cjs/accordion.js +11 -4
- package/lib/cjs/accordion.ws.js +85 -71
- package/lib/cjs/{textarea.js → checkbox.js} +9 -6
- package/lib/cjs/checkbox.ws.js +172 -0
- package/lib/cjs/collapsible.ws.js +4 -1
- package/lib/cjs/components.js +27 -14
- package/lib/cjs/dialog.ws.js +17 -17
- package/lib/cjs/hooks.js +5 -1
- package/lib/cjs/label.ws.js +1 -1
- package/lib/cjs/metas.js +29 -14
- package/lib/cjs/navigation-menu.js +107 -0
- package/lib/cjs/navigation-menu.ws.js +513 -0
- package/lib/cjs/popover.ws.js +12 -9
- package/lib/cjs/props.js +27 -14
- package/lib/cjs/{button.js → radio-group.js} +10 -8
- package/lib/cjs/radio-group.ws.js +188 -0
- package/lib/cjs/select.js +81 -0
- package/lib/cjs/select.ws.js +349 -0
- package/lib/cjs/sheet.ws.js +87 -176
- package/lib/cjs/{input.js → switch.js} +8 -9
- package/lib/cjs/switch.ws.js +171 -0
- package/lib/cjs/tabs.js +2 -3
- package/lib/cjs/tabs.ws.js +13 -18
- package/lib/cjs/theme/styles.js +100 -0
- package/lib/cjs/theme/tailwind-classes.js +125 -16
- package/lib/cjs/theme/tailwind-colors.js +1 -0
- package/lib/cjs/tooltip.ws.js +11 -8
- package/lib/collapsible.ws.js +4 -1
- package/lib/components.js +44 -22
- package/lib/dialog.ws.js +17 -17
- package/lib/hooks.js +5 -1
- package/lib/label.ws.js +1 -1
- package/lib/metas.js +58 -24
- package/lib/navigation-menu.js +85 -0
- package/lib/navigation-menu.ws.js +500 -0
- package/lib/popover.ws.js +12 -9
- package/lib/props.js +56 -24
- package/lib/radio-group.js +11 -0
- package/lib/radio-group.ws.js +170 -0
- package/lib/select.js +73 -0
- package/lib/select.ws.js +337 -0
- package/lib/sheet.ws.js +88 -194
- package/lib/switch.js +7 -0
- package/lib/switch.ws.js +143 -0
- package/lib/tabs.js +3 -5
- package/lib/tabs.ws.js +14 -19
- package/lib/theme/styles.js +70 -0
- package/lib/theme/tailwind-classes.js +125 -16
- package/lib/theme/tailwind-colors.js +1 -0
- package/lib/tooltip.ws.js +11 -8
- package/lib/types/__generated__/checkbox.props.d.ts +3 -0
- package/lib/types/__generated__/navigation-menu.props.d.ts +8 -0
- package/lib/types/__generated__/radio-group.props.d.ts +4 -0
- package/lib/types/__generated__/select.props.d.ts +9 -0
- package/lib/types/__generated__/switch.props.d.ts +3 -0
- package/lib/types/checkbox.d.ts +6 -0
- package/lib/types/checkbox.stories.d.ts +11 -0
- package/lib/types/checkbox.ws.d.ts +5 -0
- package/lib/types/components.d.ts +5 -4
- package/lib/types/metas.d.ts +6 -4
- package/lib/types/navigation-menu.d.ts +15 -0
- package/lib/types/navigation-menu.ws.d.ts +15 -0
- package/lib/types/props.d.ts +5 -4
- package/lib/types/radio-group.d.ts +5 -0
- package/lib/types/radio-group.stories.d.ts +9 -0
- package/lib/types/radio-group.ws.d.ts +7 -0
- package/lib/types/select.d.ts +12 -0
- package/lib/types/select.ws.d.ts +17 -0
- package/lib/types/sheet.ws.d.ts +2 -15
- package/lib/types/switch.d.ts +4 -0
- package/lib/types/switch.stories.d.ts +9 -0
- package/lib/types/switch.ws.d.ts +5 -0
- package/lib/types/tabs.d.ts +3 -12
- package/lib/types/theme/radix-common-types.d.ts +3 -2
- package/lib/types/theme/styles.d.ts +215 -0
- package/lib/types/theme/tailwind-classes.d.ts +16 -6
- package/lib/types/theme/tailwind-colors.d.ts +1 -0
- package/lib/types/theme/tailwind-theme.d.ts +1 -1
- package/package.json +12 -7
- package/src/__generated__/accordion.props.ts +0 -5
- package/src/__generated__/button.props.ts +0 -21
- package/src/__generated__/checkbox.props.ts +948 -0
- package/src/__generated__/collapsible.props.ts +0 -2
- package/src/__generated__/dialog.props.ts +0 -11
- package/src/__generated__/label.props.ts +0 -1
- package/src/__generated__/navigation-menu.props.ts +2349 -0
- package/src/__generated__/popover.props.ts +0 -3
- package/src/__generated__/radio-group.props.ts +1429 -0
- package/src/__generated__/select.props.ts +3304 -0
- package/src/__generated__/sheet.props.ts +0 -11
- package/src/__generated__/switch.props.ts +948 -0
- package/src/__generated__/tabs.props.ts +477 -4
- package/src/__generated__/tooltip.props.ts +0 -2
- package/src/accordion.tsx +14 -7
- package/src/accordion.ws.ts +85 -70
- package/src/{textarea.stories.ts → checkbox.stories.ts} +6 -11
- package/src/checkbox.tsx +22 -0
- package/src/checkbox.ws.ts +151 -0
- package/src/collapsible.ws.ts +4 -1
- package/src/components.ts +25 -12
- package/src/dialog.ws.tsx +15 -16
- package/src/hooks.ts +4 -0
- package/src/label.ws.ts +1 -1
- package/src/metas.ts +36 -12
- package/src/navigation-menu.stories.tsx +21 -0
- package/src/navigation-menu.tsx +130 -0
- package/src/navigation-menu.ws.ts +523 -0
- package/src/popover.ws.tsx +12 -9
- package/src/props.ts +35 -12
- package/src/{input.stories.ts → radio-group.stories.ts} +6 -15
- package/src/radio-group.tsx +17 -0
- package/src/radio-group.ws.ts +174 -0
- package/src/select.stories.tsx +21 -0
- package/src/select.tsx +107 -0
- package/src/select.ws.ts +347 -0
- package/src/sheet.ws.tsx +89 -209
- package/src/{button.stories.ts → switch.stories.ts} +6 -19
- package/src/switch.tsx +10 -0
- package/src/switch.ws.ts +143 -0
- package/src/tabs.tsx +4 -17
- package/src/tabs.ws.ts +17 -19
- package/src/theme/radix-common-types.ts +3 -2
- package/src/theme/styles.ts +80 -0
- package/src/theme/tailwind-classes.ts +150 -14
- package/src/theme/tailwind-colors.ts +1 -0
- package/src/tooltip.ws.tsx +11 -8
- package/lib/button.js +0 -8
- package/lib/button.ws.js +0 -133
- package/lib/cjs/button.ws.js +0 -160
- package/lib/cjs/input.ws.js +0 -103
- package/lib/cjs/textarea.ws.js +0 -98
- package/lib/input.js +0 -8
- package/lib/input.ws.js +0 -75
- package/lib/textarea.js +0 -8
- package/lib/textarea.ws.js +0 -70
- package/lib/types/button.d.ts +0 -7
- package/lib/types/button.stories.d.ts +0 -20
- package/lib/types/button.ws.d.ts +0 -7
- package/lib/types/input.d.ts +0 -2
- package/lib/types/input.stories.d.ts +0 -20
- package/lib/types/input.ws.d.ts +0 -3
- package/lib/types/textarea.d.ts +0 -2
- package/lib/types/textarea.stories.d.ts +0 -14
- package/lib/types/textarea.ws.d.ts +0 -3
- package/src/button.tsx +0 -25
- package/src/button.ws.ts +0 -155
- package/src/input.tsx +0 -12
- package/src/input.ws.ts +0 -78
- package/src/textarea.tsx +0 -12
- package/src/textarea.ws.ts +0 -74
package/lib/cjs/accordion.ws.js
CHANGED
|
@@ -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
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
tc.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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,6 +123,7 @@ 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,
|
|
@@ -99,19 +155,9 @@ const metaAccordion = {
|
|
|
99
155
|
component: "AccordionItem",
|
|
100
156
|
styles: accordionItemStyles,
|
|
101
157
|
children: [
|
|
102
|
-
{
|
|
103
|
-
type: "
|
|
104
|
-
|
|
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
|
-
},
|
|
158
|
+
createAccordionTrigger({
|
|
159
|
+
children: [{ type: "text", value: "Is it accessible?" }]
|
|
160
|
+
}),
|
|
115
161
|
{
|
|
116
162
|
type: "instance",
|
|
117
163
|
component: "AccordionContent",
|
|
@@ -130,19 +176,9 @@ const metaAccordion = {
|
|
|
130
176
|
component: "AccordionItem",
|
|
131
177
|
styles: accordionItemStyles,
|
|
132
178
|
children: [
|
|
133
|
-
{
|
|
134
|
-
type: "
|
|
135
|
-
|
|
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
|
-
},
|
|
179
|
+
createAccordionTrigger({
|
|
180
|
+
children: [{ type: "text", value: "Is it styled?" }]
|
|
181
|
+
}),
|
|
146
182
|
{
|
|
147
183
|
type: "instance",
|
|
148
184
|
component: "AccordionContent",
|
|
@@ -161,19 +197,9 @@ const metaAccordion = {
|
|
|
161
197
|
component: "AccordionItem",
|
|
162
198
|
styles: accordionItemStyles,
|
|
163
199
|
children: [
|
|
164
|
-
{
|
|
165
|
-
type: "
|
|
166
|
-
|
|
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
|
-
},
|
|
200
|
+
createAccordionTrigger({
|
|
201
|
+
children: [{ type: "text", value: "Is it animated?" }]
|
|
202
|
+
}),
|
|
177
203
|
{
|
|
178
204
|
type: "instance",
|
|
179
205
|
component: "AccordionContent",
|
|
@@ -197,7 +223,8 @@ const metaAccordionItem = {
|
|
|
197
223
|
icon: import_svg.ItemIcon,
|
|
198
224
|
requiredAncestors: ["Accordion"],
|
|
199
225
|
indexWithinAncestor: "Accordion",
|
|
200
|
-
presetStyle
|
|
226
|
+
presetStyle,
|
|
227
|
+
label: "Item"
|
|
201
228
|
};
|
|
202
229
|
const metaAccordionHeader = {
|
|
203
230
|
category: "hidden",
|
|
@@ -207,7 +234,8 @@ const metaAccordionHeader = {
|
|
|
207
234
|
detachable: false,
|
|
208
235
|
presetStyle: {
|
|
209
236
|
h3: [import_css_normalize.h3, tc.my(0)].flat()
|
|
210
|
-
}
|
|
237
|
+
},
|
|
238
|
+
label: "Item Header"
|
|
211
239
|
};
|
|
212
240
|
const metaAccordionTrigger = {
|
|
213
241
|
category: "hidden",
|
|
@@ -216,24 +244,9 @@ const metaAccordionTrigger = {
|
|
|
216
244
|
requiredAncestors: ["AccordionHeader"],
|
|
217
245
|
detachable: false,
|
|
218
246
|
presetStyle: {
|
|
219
|
-
button: [
|
|
220
|
-
|
|
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
|
-
}
|
|
247
|
+
button: [import_css_normalize.button, import_styles.buttonReset].flat()
|
|
248
|
+
},
|
|
249
|
+
label: "Item Trigger"
|
|
237
250
|
};
|
|
238
251
|
const metaAccordionContent = {
|
|
239
252
|
category: "hidden",
|
|
@@ -241,7 +254,8 @@ const metaAccordionContent = {
|
|
|
241
254
|
icon: import_svg.ContentIcon,
|
|
242
255
|
requiredAncestors: ["AccordionItem"],
|
|
243
256
|
detachable: false,
|
|
244
|
-
presetStyle
|
|
257
|
+
presetStyle,
|
|
258
|
+
label: "Item Content"
|
|
245
259
|
};
|
|
246
260
|
const propsMetaAccordion = {
|
|
247
261
|
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
|
|
20
|
-
__export(
|
|
21
|
-
|
|
19
|
+
var checkbox_exports = {};
|
|
20
|
+
__export(checkbox_exports, {
|
|
21
|
+
Checkbox: () => Checkbox,
|
|
22
|
+
CheckboxIndicator: () => CheckboxIndicator
|
|
22
23
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(checkbox_exports);
|
|
24
25
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
26
|
var import_react = require("react");
|
|
26
|
-
|
|
27
|
-
|
|
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,172 @@
|
|
|
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
|
+
states: [
|
|
49
|
+
...import_react_sdk.defaultStates,
|
|
50
|
+
{
|
|
51
|
+
label: "Checked",
|
|
52
|
+
selector: "[data-state=checked]",
|
|
53
|
+
category: "component-states"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: "Unchecked",
|
|
57
|
+
selector: "[data-state=unchecked]",
|
|
58
|
+
category: "component-states"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
presetStyle: {
|
|
62
|
+
button: [import_css_normalize.button, import_styles.buttonReset].flat()
|
|
63
|
+
},
|
|
64
|
+
template: [
|
|
65
|
+
{
|
|
66
|
+
type: "instance",
|
|
67
|
+
component: "Label",
|
|
68
|
+
label: "Checkbox Field",
|
|
69
|
+
styles: [tc.flex(), tc.gap(2), tc.items("center")].flat(),
|
|
70
|
+
children: [
|
|
71
|
+
{
|
|
72
|
+
type: "instance",
|
|
73
|
+
component: "Checkbox",
|
|
74
|
+
dataSources: {
|
|
75
|
+
checkboxChecked: { type: "variable", initialValue: false }
|
|
76
|
+
},
|
|
77
|
+
props: [
|
|
78
|
+
{
|
|
79
|
+
name: "checked",
|
|
80
|
+
type: "dataSource",
|
|
81
|
+
dataSourceName: "checkboxChecked"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "onCheckedChange",
|
|
85
|
+
type: "action",
|
|
86
|
+
value: [
|
|
87
|
+
{
|
|
88
|
+
type: "execute",
|
|
89
|
+
args: ["checked"],
|
|
90
|
+
code: `checkboxChecked = checked`
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
// peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background
|
|
96
|
+
// focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
|
|
97
|
+
// disabled:cursor-not-allowed disabled:opacity-50
|
|
98
|
+
// data-[state=checked]:bg-primary
|
|
99
|
+
// data-[state=checked]:text-primary-foreground",
|
|
100
|
+
styles: [
|
|
101
|
+
// We are not supporting peer like styles yet
|
|
102
|
+
tc.h(4),
|
|
103
|
+
tc.w(4),
|
|
104
|
+
tc.shrink(0),
|
|
105
|
+
tc.rounded("sm"),
|
|
106
|
+
tc.border(),
|
|
107
|
+
tc.border("primary"),
|
|
108
|
+
tc.focusVisible(
|
|
109
|
+
[tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()
|
|
110
|
+
),
|
|
111
|
+
tc.disabled([tc.cursor("not-allowed"), tc.opacity(50)].flat()),
|
|
112
|
+
tc.state(
|
|
113
|
+
[tc.bg("primary"), tc.text("primaryForeground")].flat(),
|
|
114
|
+
"[data-state=checked]"
|
|
115
|
+
)
|
|
116
|
+
].flat(),
|
|
117
|
+
children: [
|
|
118
|
+
{
|
|
119
|
+
type: "instance",
|
|
120
|
+
component: "CheckboxIndicator",
|
|
121
|
+
// flex items-center justify-center text-current
|
|
122
|
+
styles: [
|
|
123
|
+
tc.flex(),
|
|
124
|
+
tc.items("center"),
|
|
125
|
+
tc.justify("center"),
|
|
126
|
+
tc.text("current")
|
|
127
|
+
].flat(),
|
|
128
|
+
children: [
|
|
129
|
+
{
|
|
130
|
+
type: "instance",
|
|
131
|
+
component: "HtmlEmbed",
|
|
132
|
+
label: "Indicator Icon",
|
|
133
|
+
props: [
|
|
134
|
+
{
|
|
135
|
+
type: "string",
|
|
136
|
+
name: "code",
|
|
137
|
+
value: import_svg.CheckMarkIcon
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
children: []
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
type: "instance",
|
|
148
|
+
component: "Text",
|
|
149
|
+
label: "Checkbox Label",
|
|
150
|
+
props: [{ name: "tag", type: "string", value: "span" }],
|
|
151
|
+
children: [{ type: "text", value: "Checkbox" }]
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
};
|
|
157
|
+
const metaCheckboxIndicator = {
|
|
158
|
+
category: "hidden",
|
|
159
|
+
type: "container",
|
|
160
|
+
icon: import_svg.TriggerIcon,
|
|
161
|
+
states: import_react_sdk.defaultStates,
|
|
162
|
+
presetStyle: {
|
|
163
|
+
span: import_css_normalize.span
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
const propsMetaCheckbox = {
|
|
167
|
+
props: import_checkbox.propsCheckbox,
|
|
168
|
+
initialProps: ["id", "checked", "name", "required"]
|
|
169
|
+
};
|
|
170
|
+
const propsMetaCheckboxIndicator = {
|
|
171
|
+
props: import_checkbox.propsCheckboxIndicator
|
|
172
|
+
};
|
|
@@ -27,13 +27,15 @@ __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,
|
|
@@ -66,6 +68,7 @@ const metaCollapsible = {
|
|
|
66
68
|
{
|
|
67
69
|
type: "instance",
|
|
68
70
|
component: "Button",
|
|
71
|
+
styles: (0, import_styles.getButtonStyles)("outline"),
|
|
69
72
|
children: [{ type: "text", value: "Click to toggle content" }]
|
|
70
73
|
}
|
|
71
74
|
]
|
package/lib/cjs/components.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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");
|
package/lib/cjs/dialog.ws.js
CHANGED
|
@@ -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
|
|
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,13 +99,14 @@ 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,
|
|
110
111
|
template: [
|
|
111
112
|
{
|
|
@@ -132,15 +133,18 @@ const metaDialog = {
|
|
|
132
133
|
{
|
|
133
134
|
type: "instance",
|
|
134
135
|
component: "DialogTrigger",
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
children: [
|
|
137
|
+
{
|
|
138
|
+
type: "instance",
|
|
139
|
+
component: "Button",
|
|
140
|
+
styles: (0, import_styles.getButtonStyles)("outline"),
|
|
141
|
+
children: [{ type: "text", value: "Button" }]
|
|
142
|
+
}
|
|
143
|
+
]
|
|
139
144
|
},
|
|
140
145
|
{
|
|
141
146
|
type: "instance",
|
|
142
147
|
component: "DialogOverlay",
|
|
143
|
-
props: [],
|
|
144
148
|
/**
|
|
145
149
|
* fixed inset-0 z-50 bg-background/80 backdrop-blur-sm
|
|
146
150
|
* flex
|
|
@@ -152,13 +156,13 @@ const metaDialog = {
|
|
|
152
156
|
tc.bg("background", 80),
|
|
153
157
|
tc.backdropBlur("sm"),
|
|
154
158
|
// To allow positioning Content
|
|
155
|
-
tc.flex()
|
|
159
|
+
tc.flex(),
|
|
160
|
+
tc.overflow("auto")
|
|
156
161
|
].flat(),
|
|
157
162
|
children: [
|
|
158
163
|
{
|
|
159
164
|
type: "instance",
|
|
160
165
|
component: "DialogContent",
|
|
161
|
-
props: [],
|
|
162
166
|
/**
|
|
163
167
|
* fixed w-full z-50
|
|
164
168
|
* grid gap-4 max-w-lg
|
|
@@ -184,13 +188,11 @@ const metaDialog = {
|
|
|
184
188
|
type: "instance",
|
|
185
189
|
component: "Box",
|
|
186
190
|
label: "Dialog Header",
|
|
187
|
-
props: [],
|
|
188
191
|
styles: [tc.flex(), tc.flex("col"), tc.gap(1)].flat(),
|
|
189
192
|
children: [
|
|
190
193
|
{
|
|
191
194
|
type: "instance",
|
|
192
195
|
component: "DialogTitle",
|
|
193
|
-
props: [],
|
|
194
196
|
/**
|
|
195
197
|
* text-lg leading-none tracking-tight
|
|
196
198
|
**/
|
|
@@ -210,7 +212,6 @@ const metaDialog = {
|
|
|
210
212
|
{
|
|
211
213
|
type: "instance",
|
|
212
214
|
component: "DialogDescription",
|
|
213
|
-
props: [],
|
|
214
215
|
/**
|
|
215
216
|
* text-sm text-muted-foreground
|
|
216
217
|
**/
|
|
@@ -222,7 +223,7 @@ const metaDialog = {
|
|
|
222
223
|
children: [
|
|
223
224
|
{
|
|
224
225
|
type: "text",
|
|
225
|
-
value: "
|
|
226
|
+
value: "Dialog description text you can edit"
|
|
226
227
|
}
|
|
227
228
|
]
|
|
228
229
|
}
|
|
@@ -236,7 +237,6 @@ const metaDialog = {
|
|
|
236
237
|
{
|
|
237
238
|
type: "instance",
|
|
238
239
|
component: "DialogClose",
|
|
239
|
-
props: [],
|
|
240
240
|
/**
|
|
241
241
|
* absolute right-4 top-4
|
|
242
242
|
* rounded-sm opacity-70
|
|
@@ -273,7 +273,7 @@ const metaDialog = {
|
|
|
273
273
|
};
|
|
274
274
|
const propsMetaDialog = {
|
|
275
275
|
props: import_dialog.propsDialog,
|
|
276
|
-
initialProps: ["open"
|
|
276
|
+
initialProps: ["open"]
|
|
277
277
|
};
|
|
278
278
|
const propsMetaDialogTrigger = {
|
|
279
279
|
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
|
];
|
package/lib/cjs/label.ws.js
CHANGED
|
@@ -42,11 +42,11 @@ 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
50
|
template: [
|
|
51
51
|
{
|
|
52
52
|
type: "instance",
|