@webstudio-is/sdk-components-react-radix 0.90.0 → 0.92.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 +6 -12
- package/lib/__generated__/checkbox.props.js +3 -6
- package/lib/__generated__/collapsible.props.js +4 -8
- package/lib/__generated__/dialog.props.js +8 -16
- package/lib/__generated__/label.props.js +2 -4
- package/lib/__generated__/navigation-menu.props.js +8 -16
- package/lib/__generated__/popover.props.js +4 -8
- package/lib/__generated__/radio-group.props.js +4 -8
- package/lib/__generated__/select.props.js +15 -19
- package/lib/__generated__/sheet.props.js +8 -16
- package/lib/__generated__/switch.props.js +3 -6
- package/lib/__generated__/tabs.props.js +5 -10
- package/lib/__generated__/tooltip.props.js +4 -8
- package/lib/accordion.js +7 -14
- package/{src/accordion.stories.tsx → lib/accordion.stories.js} +9 -12
- package/lib/accordion.ws.js +11 -22
- package/lib/checkbox.js +3 -6
- package/lib/checkbox.stories.js +19 -0
- package/lib/checkbox.ws.js +5 -10
- package/lib/collapsible.js +5 -10
- package/{src/collapsible.stories.tsx → lib/collapsible.stories.js} +9 -12
- package/lib/collapsible.ws.js +7 -14
- package/lib/components.js +13 -62
- package/lib/dialog.js +9 -18
- package/{src/dialog.stories.tsx → lib/dialog.stories.js} +9 -12
- package/lib/dialog.ws.js +17 -30
- package/lib/hooks.js +2 -4
- package/lib/label.js +2 -4
- package/lib/label.stories.js +19 -0
- package/lib/label.ws.js +3 -6
- package/lib/metas.js +55 -105
- package/lib/navigation-menu.js +9 -18
- package/{src/navigation-menu.stories.tsx → lib/navigation-menu.stories.js} +9 -12
- package/lib/navigation-menu.ws.js +16 -31
- package/lib/popover.js +5 -10
- package/{src/popover.stories.tsx → lib/popover.stories.js} +9 -12
- package/lib/popover.ws.js +7 -14
- package/lib/props-descriptions.js +2 -4
- package/lib/props.js +54 -103
- package/lib/radio-group.js +4 -8
- package/lib/radio-group.stories.js +19 -0
- package/lib/radio-group.ws.js +7 -14
- package/lib/select.js +10 -20
- package/{src/select.stories.tsx → lib/select.stories.js} +9 -12
- package/lib/select.ws.js +17 -34
- package/lib/sheet.js +9 -18
- package/{src/sheet.stories.tsx → lib/sheet.stories.js} +9 -12
- package/lib/sheet.ws.js +2 -4
- package/lib/switch.js +3 -6
- package/lib/switch.stories.js +19 -0
- package/lib/switch.ws.js +5 -10
- package/lib/tabs.js +6 -12
- package/{src/tabs.stories.tsx → lib/tabs.stories.js} +9 -12
- package/lib/tabs.ws.js +9 -18
- package/lib/theme/__generated__/tailwind-theme.js +517 -0
- package/lib/theme/styles.js +3 -6
- package/lib/theme/tailwind-classes.js +149 -301
- package/lib/theme/tailwind-colors.js +2 -4
- package/lib/tooltip.js +5 -10
- package/{src/tooltip.stories.tsx → lib/tooltip.stories.js} +9 -12
- package/lib/tooltip.ws.js +7 -14
- package/lib/types/__generated__/accordion.props.d.ts +1 -1
- package/lib/types/__generated__/checkbox.props.d.ts +1 -1
- package/lib/types/__generated__/collapsible.props.d.ts +1 -1
- package/lib/types/__generated__/dialog.props.d.ts +1 -1
- package/lib/types/__generated__/label.props.d.ts +1 -1
- package/lib/types/__generated__/navigation-menu.props.d.ts +1 -1
- package/lib/types/__generated__/popover.props.d.ts +1 -1
- package/lib/types/__generated__/radio-group.props.d.ts +1 -1
- package/lib/types/__generated__/select.props.d.ts +1 -1
- package/lib/types/__generated__/sheet.props.d.ts +1 -1
- package/lib/types/__generated__/switch.props.d.ts +1 -1
- package/lib/types/__generated__/tabs.props.d.ts +1 -1
- package/lib/types/__generated__/tooltip.props.d.ts +1 -1
- package/lib/types/accordion.d.ts +1 -1
- package/lib/types/sheet.d.ts +1 -1
- package/lib/types/theme/__generated__/tailwind-theme.d.ts +26 -0
- package/lib/types/theme/styles.d.ts +60 -60
- package/lib/types/theme/tailwind-classes.d.ts +33 -33
- package/package.json +20 -23
- package/lib/__generated__/button.props.js +0 -565
- package/lib/__generated__/input.props.js +0 -668
- package/lib/__generated__/textarea.props.js +0 -577
- package/lib/cjs/__generated__/accordion.props.js +0 -2645
- package/lib/cjs/__generated__/button.props.js +0 -585
- package/lib/cjs/__generated__/checkbox.props.js +0 -1103
- package/lib/cjs/__generated__/collapsible.props.js +0 -1050
- package/lib/cjs/__generated__/dialog.props.js +0 -2623
- package/lib/cjs/__generated__/input.props.js +0 -688
- package/lib/cjs/__generated__/label.props.js +0 -541
- package/lib/cjs/__generated__/navigation-menu.props.js +0 -2585
- package/lib/cjs/__generated__/popover.props.js +0 -582
- package/lib/cjs/__generated__/radio-group.props.js +0 -1647
- package/lib/cjs/__generated__/select.props.js +0 -3698
- package/lib/cjs/__generated__/sheet.props.js +0 -2642
- package/lib/cjs/__generated__/switch.props.js +0 -1103
- package/lib/cjs/__generated__/tabs.props.js +0 -2144
- package/lib/cjs/__generated__/textarea.props.js +0 -597
- package/lib/cjs/__generated__/tooltip.props.js +0 -593
- package/lib/cjs/accordion.js +0 -67
- package/lib/cjs/accordion.ws.js +0 -285
- package/lib/cjs/checkbox.js +0 -31
- package/lib/cjs/checkbox.ws.js +0 -174
- package/lib/cjs/collapsible.js +0 -53
- package/lib/cjs/collapsible.ws.js +0 -122
- package/lib/cjs/components.js +0 -82
- package/lib/cjs/dialog.js +0 -89
- package/lib/cjs/dialog.ws.js +0 -314
- package/lib/cjs/hooks.js +0 -43
- package/lib/cjs/label.js +0 -37
- package/lib/cjs/label.ws.js +0 -75
- package/lib/cjs/metas.js +0 -84
- package/lib/cjs/navigation-menu.js +0 -107
- package/lib/cjs/navigation-menu.ws.js +0 -514
- package/lib/cjs/package.json +0 -1
- package/lib/cjs/popover.js +0 -90
- package/lib/cjs/popover.ws.js +0 -142
- package/lib/cjs/props-descriptions.js +0 -56
- package/lib/cjs/props.js +0 -82
- package/lib/cjs/radio-group.js +0 -30
- package/lib/cjs/radio-group.ws.js +0 -191
- package/lib/cjs/select.js +0 -83
- package/lib/cjs/select.ws.js +0 -350
- package/lib/cjs/sheet.js +0 -96
- package/lib/cjs/sheet.ws.js +0 -257
- package/lib/cjs/switch.js +0 -27
- package/lib/cjs/switch.ws.js +0 -173
- package/lib/cjs/tabs.js +0 -59
- package/lib/cjs/tabs.ws.js +0 -196
- package/lib/cjs/theme/radix-common-types.js +0 -16
- package/lib/cjs/theme/styles.js +0 -96
- package/lib/cjs/theme/tailwind-classes.js +0 -819
- package/lib/cjs/theme/tailwind-colors.js +0 -45
- package/lib/cjs/theme/tailwind-theme.js +0 -46
- package/lib/cjs/tooltip.js +0 -87
- package/lib/cjs/tooltip.ws.js +0 -143
- package/lib/theme/radix-common-types.js +0 -0
- package/lib/theme/tailwind-theme.js +0 -16
- package/lib/types/__generated__/button.props.d.ts +0 -2
- package/lib/types/__generated__/input.props.d.ts +0 -2
- package/lib/types/__generated__/textarea.props.d.ts +0 -2
- package/lib/types/theme/radix-common-types.d.ts +0 -85
- package/lib/types/theme/tailwind-theme.d.ts +0 -72
- package/src/__generated__/accordion.props.ts +0 -2949
- package/src/__generated__/button.props.ts +0 -635
- package/src/__generated__/checkbox.props.ts +0 -1217
- package/src/__generated__/collapsible.props.ts +0 -1156
- package/src/__generated__/dialog.props.ts +0 -2923
- package/src/__generated__/input.props.ts +0 -748
- package/src/__generated__/label.props.ts +0 -585
- package/src/__generated__/navigation-menu.props.ts +0 -2882
- package/src/__generated__/popover.props.ts +0 -626
- package/src/__generated__/radio-group.props.ts +0 -1828
- package/src/__generated__/select.props.ts +0 -4130
- package/src/__generated__/sheet.props.ts +0 -2942
- package/src/__generated__/switch.props.ts +0 -1217
- package/src/__generated__/tabs.props.ts +0 -2386
- package/src/__generated__/textarea.props.ts +0 -645
- package/src/__generated__/tooltip.props.ts +0 -639
- package/src/accordion.tsx +0 -88
- package/src/accordion.ws.ts +0 -296
- package/src/checkbox.stories.ts +0 -22
- package/src/checkbox.tsx +0 -22
- package/src/checkbox.ws.ts +0 -154
- package/src/collapsible.tsx +0 -62
- package/src/collapsible.ws.ts +0 -115
- package/src/components.ts +0 -50
- package/src/dialog.tsx +0 -92
- package/src/dialog.ws.tsx +0 -318
- package/src/hooks.ts +0 -22
- package/src/label.stories.ts +0 -22
- package/src/label.tsx +0 -15
- package/src/label.ws.ts +0 -50
- package/src/metas.ts +0 -74
- package/src/navigation-menu.tsx +0 -130
- package/src/navigation-menu.ws.ts +0 -524
- package/src/popover.tsx +0 -96
- package/src/popover.ws.tsx +0 -128
- package/src/props-descriptions.ts +0 -43
- package/src/props.ts +0 -73
- package/src/radio-group.stories.ts +0 -22
- package/src/radio-group.tsx +0 -17
- package/src/radio-group.ws.ts +0 -178
- package/src/select.tsx +0 -112
- package/src/select.ws.ts +0 -349
- package/src/sheet.tsx +0 -79
- package/src/sheet.ws.tsx +0 -236
- package/src/switch.stories.ts +0 -22
- package/src/switch.tsx +0 -10
- package/src/switch.ws.ts +0 -146
- package/src/tabs.tsx +0 -64
- package/src/tabs.ws.ts +0 -198
- package/src/theme/radix-common-types.ts +0 -496
- package/src/theme/styles.ts +0 -76
- package/src/theme/tailwind-classes.ts +0 -1026
- package/src/theme/tailwind-colors.ts +0 -39
- package/src/theme/tailwind-theme.ts +0 -24
- package/src/tooltip.tsx +0 -95
- package/src/tooltip.ws.tsx +0 -130
package/lib/cjs/accordion.ws.js
DELETED
|
@@ -1,285 +0,0 @@
|
|
|
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 accordion_ws_exports = {};
|
|
30
|
-
__export(accordion_ws_exports, {
|
|
31
|
-
metaAccordion: () => metaAccordion,
|
|
32
|
-
metaAccordionContent: () => metaAccordionContent,
|
|
33
|
-
metaAccordionHeader: () => metaAccordionHeader,
|
|
34
|
-
metaAccordionItem: () => metaAccordionItem,
|
|
35
|
-
metaAccordionTrigger: () => metaAccordionTrigger,
|
|
36
|
-
propsMetaAccordion: () => propsMetaAccordion,
|
|
37
|
-
propsMetaAccordionContent: () => propsMetaAccordionContent,
|
|
38
|
-
propsMetaAccordionHeader: () => propsMetaAccordionHeader,
|
|
39
|
-
propsMetaAccordionItem: () => propsMetaAccordionItem,
|
|
40
|
-
propsMetaAccordionTrigger: () => propsMetaAccordionTrigger
|
|
41
|
-
});
|
|
42
|
-
module.exports = __toCommonJS(accordion_ws_exports);
|
|
43
|
-
var import_svg = require("@webstudio-is/icons/svg");
|
|
44
|
-
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
45
|
-
var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
|
|
46
|
-
var tc = __toESM(require("./theme/tailwind-classes"), 1);
|
|
47
|
-
var import_styles = require("./theme/styles");
|
|
48
|
-
var import_accordion = require("./__generated__/accordion.props");
|
|
49
|
-
const presetStyle = {
|
|
50
|
-
div: import_css_normalize.div
|
|
51
|
-
};
|
|
52
|
-
const accordionItemStyles = [tc.borderB()].flat();
|
|
53
|
-
const createAccordionTrigger = ({
|
|
54
|
-
children
|
|
55
|
-
}) => ({
|
|
56
|
-
type: "instance",
|
|
57
|
-
component: "AccordionHeader",
|
|
58
|
-
// flex
|
|
59
|
-
styles: [tc.flex()].flat(),
|
|
60
|
-
children: [
|
|
61
|
-
{
|
|
62
|
-
type: "instance",
|
|
63
|
-
component: "AccordionTrigger",
|
|
64
|
-
// flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180
|
|
65
|
-
styles: [
|
|
66
|
-
tc.flex(),
|
|
67
|
-
tc.flex(1),
|
|
68
|
-
tc.items("center"),
|
|
69
|
-
tc.justify("between"),
|
|
70
|
-
tc.py(4),
|
|
71
|
-
tc.font("medium"),
|
|
72
|
-
tc.hover([tc.underline()].flat()),
|
|
73
|
-
tc.property("--accordion-trigger-icon-transform", "0deg"),
|
|
74
|
-
tc.state(
|
|
75
|
-
[tc.property("--accordion-trigger-icon-transform", "180deg")],
|
|
76
|
-
"[data-state=open]"
|
|
77
|
-
)
|
|
78
|
-
].flat(),
|
|
79
|
-
children: [
|
|
80
|
-
{
|
|
81
|
-
type: "instance",
|
|
82
|
-
component: "Text",
|
|
83
|
-
children
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
type: "instance",
|
|
87
|
-
component: "Box",
|
|
88
|
-
label: "Icon Container",
|
|
89
|
-
// h-4 w-4 shrink-0 transition-transform duration-200
|
|
90
|
-
styles: [
|
|
91
|
-
tc.property("rotate", "--accordion-trigger-icon-transform"),
|
|
92
|
-
tc.h(4),
|
|
93
|
-
tc.w(4),
|
|
94
|
-
tc.shrink(0),
|
|
95
|
-
tc.transition("all"),
|
|
96
|
-
tc.duration(200)
|
|
97
|
-
].flat(),
|
|
98
|
-
children: [
|
|
99
|
-
{
|
|
100
|
-
type: "instance",
|
|
101
|
-
component: "HtmlEmbed",
|
|
102
|
-
label: "Chevron Icon",
|
|
103
|
-
props: [
|
|
104
|
-
{
|
|
105
|
-
type: "string",
|
|
106
|
-
name: "code",
|
|
107
|
-
value: import_svg.ChevronDownIcon
|
|
108
|
-
}
|
|
109
|
-
],
|
|
110
|
-
children: []
|
|
111
|
-
}
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
]
|
|
117
|
-
});
|
|
118
|
-
const accordionContentStyles = [
|
|
119
|
-
tc.overflow("hidden"),
|
|
120
|
-
tc.text("sm"),
|
|
121
|
-
// transition does not work with display: none
|
|
122
|
-
// tc.transition("all"),
|
|
123
|
-
tc.pb(4)
|
|
124
|
-
].flat();
|
|
125
|
-
const metaAccordion = {
|
|
126
|
-
category: "radix",
|
|
127
|
-
order: 3,
|
|
128
|
-
type: "container",
|
|
129
|
-
icon: import_svg.AccordionIcon,
|
|
130
|
-
presetStyle,
|
|
131
|
-
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.",
|
|
132
|
-
template: [
|
|
133
|
-
{
|
|
134
|
-
type: "instance",
|
|
135
|
-
component: "Accordion",
|
|
136
|
-
dataSources: {
|
|
137
|
-
accordionValue: { type: "variable", initialValue: "0" }
|
|
138
|
-
},
|
|
139
|
-
props: [
|
|
140
|
-
{ type: "boolean", name: "collapsible", value: true },
|
|
141
|
-
{ type: "dataSource", name: "value", dataSourceName: "accordionValue" },
|
|
142
|
-
{
|
|
143
|
-
name: "onValueChange",
|
|
144
|
-
type: "action",
|
|
145
|
-
value: [
|
|
146
|
-
{
|
|
147
|
-
type: "execute",
|
|
148
|
-
args: ["value"],
|
|
149
|
-
code: `accordionValue = value`
|
|
150
|
-
}
|
|
151
|
-
]
|
|
152
|
-
}
|
|
153
|
-
],
|
|
154
|
-
children: [
|
|
155
|
-
{
|
|
156
|
-
type: "instance",
|
|
157
|
-
component: "AccordionItem",
|
|
158
|
-
styles: accordionItemStyles,
|
|
159
|
-
children: [
|
|
160
|
-
createAccordionTrigger({
|
|
161
|
-
children: [{ type: "text", value: "Is it accessible?" }]
|
|
162
|
-
}),
|
|
163
|
-
{
|
|
164
|
-
type: "instance",
|
|
165
|
-
component: "AccordionContent",
|
|
166
|
-
styles: accordionContentStyles,
|
|
167
|
-
children: [
|
|
168
|
-
{
|
|
169
|
-
type: "text",
|
|
170
|
-
value: "Yes. It adheres to the WAI-ARIA design pattern."
|
|
171
|
-
}
|
|
172
|
-
]
|
|
173
|
-
}
|
|
174
|
-
]
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
type: "instance",
|
|
178
|
-
component: "AccordionItem",
|
|
179
|
-
styles: accordionItemStyles,
|
|
180
|
-
children: [
|
|
181
|
-
createAccordionTrigger({
|
|
182
|
-
children: [{ type: "text", value: "Is it styled?" }]
|
|
183
|
-
}),
|
|
184
|
-
{
|
|
185
|
-
type: "instance",
|
|
186
|
-
component: "AccordionContent",
|
|
187
|
-
styles: accordionContentStyles,
|
|
188
|
-
children: [
|
|
189
|
-
{
|
|
190
|
-
type: "text",
|
|
191
|
-
value: "Yes. It comes with default styles that matches the other components' aesthetic."
|
|
192
|
-
}
|
|
193
|
-
]
|
|
194
|
-
}
|
|
195
|
-
]
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
type: "instance",
|
|
199
|
-
component: "AccordionItem",
|
|
200
|
-
styles: accordionItemStyles,
|
|
201
|
-
children: [
|
|
202
|
-
createAccordionTrigger({
|
|
203
|
-
children: [{ type: "text", value: "Is it animated?" }]
|
|
204
|
-
}),
|
|
205
|
-
{
|
|
206
|
-
type: "instance",
|
|
207
|
-
component: "AccordionContent",
|
|
208
|
-
styles: accordionContentStyles,
|
|
209
|
-
children: [
|
|
210
|
-
{
|
|
211
|
-
type: "text",
|
|
212
|
-
value: "Yes. It's animated by default, but you can disable it if you prefer."
|
|
213
|
-
}
|
|
214
|
-
]
|
|
215
|
-
}
|
|
216
|
-
]
|
|
217
|
-
}
|
|
218
|
-
]
|
|
219
|
-
}
|
|
220
|
-
]
|
|
221
|
-
};
|
|
222
|
-
const metaAccordionItem = {
|
|
223
|
-
category: "hidden",
|
|
224
|
-
type: "container",
|
|
225
|
-
label: "Item",
|
|
226
|
-
icon: import_svg.ItemIcon,
|
|
227
|
-
requiredAncestors: ["Accordion"],
|
|
228
|
-
indexWithinAncestor: "Accordion",
|
|
229
|
-
presetStyle
|
|
230
|
-
};
|
|
231
|
-
const metaAccordionHeader = {
|
|
232
|
-
category: "hidden",
|
|
233
|
-
type: "container",
|
|
234
|
-
label: "Item Header",
|
|
235
|
-
icon: import_svg.HeaderIcon,
|
|
236
|
-
requiredAncestors: ["AccordionItem"],
|
|
237
|
-
detachable: false,
|
|
238
|
-
presetStyle: {
|
|
239
|
-
h3: [import_css_normalize.h3, tc.my(0)].flat()
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
const metaAccordionTrigger = {
|
|
243
|
-
category: "hidden",
|
|
244
|
-
type: "container",
|
|
245
|
-
label: "Item Trigger",
|
|
246
|
-
icon: import_svg.TriggerIcon,
|
|
247
|
-
requiredAncestors: ["AccordionHeader"],
|
|
248
|
-
detachable: false,
|
|
249
|
-
states: [
|
|
250
|
-
...import_react_sdk.defaultStates,
|
|
251
|
-
{
|
|
252
|
-
category: "component-states",
|
|
253
|
-
label: "Open",
|
|
254
|
-
selector: "[data-state=open]"
|
|
255
|
-
}
|
|
256
|
-
],
|
|
257
|
-
presetStyle: {
|
|
258
|
-
button: [import_css_normalize.button, import_styles.buttonReset].flat()
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
const metaAccordionContent = {
|
|
262
|
-
category: "hidden",
|
|
263
|
-
type: "container",
|
|
264
|
-
label: "Item Content",
|
|
265
|
-
icon: import_svg.ContentIcon,
|
|
266
|
-
requiredAncestors: ["AccordionItem"],
|
|
267
|
-
detachable: false,
|
|
268
|
-
presetStyle
|
|
269
|
-
};
|
|
270
|
-
const propsMetaAccordion = {
|
|
271
|
-
props: import_accordion.propsAccordion,
|
|
272
|
-
initialProps: ["value", "collapsible"]
|
|
273
|
-
};
|
|
274
|
-
const propsMetaAccordionItem = {
|
|
275
|
-
props: import_accordion.propsAccordionItem
|
|
276
|
-
};
|
|
277
|
-
const propsMetaAccordionHeader = {
|
|
278
|
-
props: import_accordion.propsAccordionHeader
|
|
279
|
-
};
|
|
280
|
-
const propsMetaAccordionTrigger = {
|
|
281
|
-
props: import_accordion.propsAccordionTrigger
|
|
282
|
-
};
|
|
283
|
-
const propsMetaAccordionContent = {
|
|
284
|
-
props: import_accordion.propsAccordionContent
|
|
285
|
-
};
|
package/lib/cjs/checkbox.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var checkbox_exports = {};
|
|
20
|
-
__export(checkbox_exports, {
|
|
21
|
-
Checkbox: () => Checkbox,
|
|
22
|
-
CheckboxIndicator: () => CheckboxIndicator
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(checkbox_exports);
|
|
25
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
-
var import_react = require("react");
|
|
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 });
|
|
30
|
-
});
|
|
31
|
-
const CheckboxIndicator = import_react_checkbox.Indicator;
|
package/lib/cjs/checkbox.ws.js
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
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
|
-
};
|
package/lib/cjs/collapsible.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var collapsible_exports = {};
|
|
20
|
-
__export(collapsible_exports, {
|
|
21
|
-
Collapsible: () => Collapsible,
|
|
22
|
-
CollapsibleContent: () => CollapsibleContent,
|
|
23
|
-
CollapsibleTrigger: () => CollapsibleTrigger,
|
|
24
|
-
hooksCollapsible: () => hooksCollapsible
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(collapsible_exports);
|
|
27
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
-
var import_react = require("react");
|
|
29
|
-
var import_react_collapsible = require("@radix-ui/react-collapsible");
|
|
30
|
-
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
31
|
-
const Collapsible = import_react_collapsible.Root;
|
|
32
|
-
const CollapsibleTrigger = (0, import_react.forwardRef)(({ children, ...props }, ref) => {
|
|
33
|
-
const firstChild = import_react.Children.toArray(children)[0];
|
|
34
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_collapsible.Trigger, { asChild: true, ref, ...props, children: firstChild ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { children: "Add button" }) });
|
|
35
|
-
});
|
|
36
|
-
const CollapsibleContent = import_react_collapsible.Content;
|
|
37
|
-
const namespace = "@webstudio-is/sdk-components-react-radix";
|
|
38
|
-
const hooksCollapsible = {
|
|
39
|
-
onNavigatorSelect: (context, event) => {
|
|
40
|
-
for (const instance of event.instancePath) {
|
|
41
|
-
if (instance.component === `${namespace}:CollapsibleContent`) {
|
|
42
|
-
const collapsible = (0, import_react_sdk.getClosestInstance)(
|
|
43
|
-
event.instancePath,
|
|
44
|
-
instance,
|
|
45
|
-
`${namespace}:Collapsible`
|
|
46
|
-
);
|
|
47
|
-
if (collapsible) {
|
|
48
|
-
context.setPropVariable(collapsible.id, "open", true);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var collapsible_ws_exports = {};
|
|
20
|
-
__export(collapsible_ws_exports, {
|
|
21
|
-
metaCollapsible: () => metaCollapsible,
|
|
22
|
-
metaCollapsibleContent: () => metaCollapsibleContent,
|
|
23
|
-
metaCollapsibleTrigger: () => metaCollapsibleTrigger,
|
|
24
|
-
propsMetaCollapsible: () => propsMetaCollapsible,
|
|
25
|
-
propsMetaCollapsibleContent: () => propsMetaCollapsibleContent,
|
|
26
|
-
propsMetaCollapsibleTrigger: () => propsMetaCollapsibleTrigger
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(collapsible_ws_exports);
|
|
29
|
-
var import_svg = require("@webstudio-is/icons/svg");
|
|
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");
|
|
33
|
-
const presetStyle = {
|
|
34
|
-
div: import_css_normalize.div
|
|
35
|
-
};
|
|
36
|
-
const metaCollapsible = {
|
|
37
|
-
category: "radix",
|
|
38
|
-
order: 5,
|
|
39
|
-
type: "container",
|
|
40
|
-
presetStyle,
|
|
41
|
-
icon: import_svg.CollapsibleIcon,
|
|
42
|
-
description: "An interactive component which expands and collapses some content, triggered by a button.",
|
|
43
|
-
template: [
|
|
44
|
-
{
|
|
45
|
-
type: "instance",
|
|
46
|
-
component: "Collapsible",
|
|
47
|
-
dataSources: {
|
|
48
|
-
collapsibleOpen: { type: "variable", initialValue: false }
|
|
49
|
-
},
|
|
50
|
-
props: [
|
|
51
|
-
{
|
|
52
|
-
type: "dataSource",
|
|
53
|
-
name: "open",
|
|
54
|
-
dataSourceName: "collapsibleOpen"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: "onOpenChange",
|
|
58
|
-
type: "action",
|
|
59
|
-
value: [
|
|
60
|
-
{ type: "execute", args: ["open"], code: `collapsibleOpen = open` }
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
children: [
|
|
65
|
-
{
|
|
66
|
-
type: "instance",
|
|
67
|
-
component: "CollapsibleTrigger",
|
|
68
|
-
children: [
|
|
69
|
-
{
|
|
70
|
-
type: "instance",
|
|
71
|
-
component: "Button",
|
|
72
|
-
styles: (0, import_styles.getButtonStyles)("outline"),
|
|
73
|
-
children: [{ type: "text", value: "Click to toggle content" }]
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
type: "instance",
|
|
79
|
-
component: "CollapsibleContent",
|
|
80
|
-
children: [
|
|
81
|
-
{
|
|
82
|
-
type: "instance",
|
|
83
|
-
component: "Text",
|
|
84
|
-
children: [{ type: "text", value: "Collapsible Content" }]
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
]
|
|
89
|
-
}
|
|
90
|
-
]
|
|
91
|
-
};
|
|
92
|
-
const metaCollapsibleTrigger = {
|
|
93
|
-
category: "hidden",
|
|
94
|
-
type: "container",
|
|
95
|
-
icon: import_svg.TriggerIcon,
|
|
96
|
-
stylable: false,
|
|
97
|
-
detachable: false
|
|
98
|
-
};
|
|
99
|
-
const metaCollapsibleContent = {
|
|
100
|
-
category: "hidden",
|
|
101
|
-
type: "container",
|
|
102
|
-
presetStyle,
|
|
103
|
-
icon: import_svg.ContentIcon,
|
|
104
|
-
detachable: false
|
|
105
|
-
};
|
|
106
|
-
const propsMetaCollapsible = {
|
|
107
|
-
props: {
|
|
108
|
-
...import_collapsible.propsCollapsible,
|
|
109
|
-
onOpenChange: {
|
|
110
|
-
type: "action",
|
|
111
|
-
control: "action",
|
|
112
|
-
required: false
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
initialProps: ["open", "onOpenChange"]
|
|
116
|
-
};
|
|
117
|
-
const propsMetaCollapsibleTrigger = {
|
|
118
|
-
props: import_collapsible.propsCollapsibleTrigger
|
|
119
|
-
};
|
|
120
|
-
const propsMetaCollapsibleContent = {
|
|
121
|
-
props: import_collapsible.propsCollapsibleContent
|
|
122
|
-
};
|