@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
|
@@ -0,0 +1,349 @@
|
|
|
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 select_ws_exports = {};
|
|
30
|
+
__export(select_ws_exports, {
|
|
31
|
+
metaSelect: () => metaSelect,
|
|
32
|
+
metaSelectContent: () => metaSelectContent,
|
|
33
|
+
metaSelectItem: () => metaSelectItem,
|
|
34
|
+
metaSelectItemIndicator: () => metaSelectItemIndicator,
|
|
35
|
+
metaSelectItemText: () => metaSelectItemText,
|
|
36
|
+
metaSelectTrigger: () => metaSelectTrigger,
|
|
37
|
+
metaSelectValue: () => metaSelectValue,
|
|
38
|
+
metaSelectViewport: () => metaSelectViewport,
|
|
39
|
+
propsMetaSelect: () => propsMetaSelect,
|
|
40
|
+
propsMetaSelectContent: () => propsMetaSelectContent,
|
|
41
|
+
propsMetaSelectItem: () => propsMetaSelectItem,
|
|
42
|
+
propsMetaSelectItemIndicator: () => propsMetaSelectItemIndicator,
|
|
43
|
+
propsMetaSelectItemText: () => propsMetaSelectItemText,
|
|
44
|
+
propsMetaSelectTrigger: () => propsMetaSelectTrigger,
|
|
45
|
+
propsMetaSelectValue: () => propsMetaSelectValue,
|
|
46
|
+
propsMetaSelectViewport: () => propsMetaSelectViewport
|
|
47
|
+
});
|
|
48
|
+
module.exports = __toCommonJS(select_ws_exports);
|
|
49
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
50
|
+
var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
|
|
51
|
+
var tc = __toESM(require("./theme/tailwind-classes"), 1);
|
|
52
|
+
var import_select = require("./__generated__/select.props");
|
|
53
|
+
const presetStyle = {
|
|
54
|
+
div: import_css_normalize.div
|
|
55
|
+
};
|
|
56
|
+
const createSelectItem = ({
|
|
57
|
+
props,
|
|
58
|
+
children
|
|
59
|
+
}) => ({
|
|
60
|
+
type: "instance",
|
|
61
|
+
component: "SelectItem",
|
|
62
|
+
props,
|
|
63
|
+
// relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none
|
|
64
|
+
// focus:bg-accent focus:text-accent-foreground
|
|
65
|
+
// data-[disabled]:pointer-events-none data-[disabled]:opacity-50
|
|
66
|
+
styles: [
|
|
67
|
+
tc.relative(),
|
|
68
|
+
tc.flex(),
|
|
69
|
+
tc.w("full"),
|
|
70
|
+
tc.cursor("default"),
|
|
71
|
+
tc.select("none"),
|
|
72
|
+
tc.items("center"),
|
|
73
|
+
tc.rounded("md"),
|
|
74
|
+
tc.py(1.5),
|
|
75
|
+
tc.pl(8),
|
|
76
|
+
tc.pr(2),
|
|
77
|
+
tc.text("sm"),
|
|
78
|
+
tc.outline("none"),
|
|
79
|
+
tc.focus([tc.bg("accent"), tc.text("accentForeground")].flat()),
|
|
80
|
+
tc.state(
|
|
81
|
+
[tc.pointerEvents("none"), tc.opacity(50)].flat(),
|
|
82
|
+
"[data-disabled]"
|
|
83
|
+
)
|
|
84
|
+
].flat(),
|
|
85
|
+
children: [
|
|
86
|
+
{
|
|
87
|
+
type: "instance",
|
|
88
|
+
component: "SelectItemIndicator",
|
|
89
|
+
// absolute left-2 flex h-3.5 w-3.5 items-center justify-center
|
|
90
|
+
styles: [
|
|
91
|
+
tc.absolute(),
|
|
92
|
+
tc.left(2),
|
|
93
|
+
tc.flex(),
|
|
94
|
+
tc.h(3.5),
|
|
95
|
+
tc.w(3.5),
|
|
96
|
+
tc.items("center"),
|
|
97
|
+
tc.justify("center")
|
|
98
|
+
].flat(),
|
|
99
|
+
children: [
|
|
100
|
+
{
|
|
101
|
+
type: "instance",
|
|
102
|
+
component: "HtmlEmbed",
|
|
103
|
+
label: "Indicator Icon",
|
|
104
|
+
props: [
|
|
105
|
+
{
|
|
106
|
+
type: "string",
|
|
107
|
+
name: "code",
|
|
108
|
+
value: import_svg.CheckMarkIcon
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
children: []
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
type: "instance",
|
|
117
|
+
component: "SelectItemText",
|
|
118
|
+
children
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
});
|
|
122
|
+
const metaSelect = {
|
|
123
|
+
category: "radix",
|
|
124
|
+
order: 10,
|
|
125
|
+
type: "container",
|
|
126
|
+
icon: import_svg.SelectIcon,
|
|
127
|
+
stylable: false,
|
|
128
|
+
template: [
|
|
129
|
+
{
|
|
130
|
+
type: "instance",
|
|
131
|
+
component: "Select",
|
|
132
|
+
dataSources: {
|
|
133
|
+
selectValue: { type: "variable", initialValue: "" },
|
|
134
|
+
selectOpen: { type: "variable", initialValue: false }
|
|
135
|
+
},
|
|
136
|
+
props: [
|
|
137
|
+
{
|
|
138
|
+
name: "value",
|
|
139
|
+
type: "dataSource",
|
|
140
|
+
dataSourceName: "selectValue"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "onValueChange",
|
|
144
|
+
type: "action",
|
|
145
|
+
value: [
|
|
146
|
+
{ type: "execute", args: ["value"], code: `selectValue = value` }
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "open",
|
|
151
|
+
type: "dataSource",
|
|
152
|
+
dataSourceName: "selectOpen"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: "onOpenChange",
|
|
156
|
+
type: "action",
|
|
157
|
+
value: [
|
|
158
|
+
{ type: "execute", args: ["open"], code: `selectOpen = open` }
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
children: [
|
|
163
|
+
{
|
|
164
|
+
type: "instance",
|
|
165
|
+
component: "SelectTrigger",
|
|
166
|
+
// flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background
|
|
167
|
+
// placeholder:text-muted-foreground
|
|
168
|
+
// focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
|
|
169
|
+
// disabled:cursor-not-allowed disabled:opacity-50
|
|
170
|
+
styles: [
|
|
171
|
+
tc.flex(),
|
|
172
|
+
tc.h(10),
|
|
173
|
+
tc.w("full"),
|
|
174
|
+
tc.items("center"),
|
|
175
|
+
tc.justify("between"),
|
|
176
|
+
tc.rounded("md"),
|
|
177
|
+
tc.border(),
|
|
178
|
+
tc.border("input"),
|
|
179
|
+
tc.bg("background"),
|
|
180
|
+
tc.px(3),
|
|
181
|
+
tc.py(2),
|
|
182
|
+
tc.text("sm"),
|
|
183
|
+
tc.state([tc.text("mutedForeground")].flat(), "::placeholder"),
|
|
184
|
+
tc.focus(
|
|
185
|
+
[tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()
|
|
186
|
+
),
|
|
187
|
+
tc.disabled([tc.cursor("not-allowed"), tc.opacity(50)].flat())
|
|
188
|
+
].flat(),
|
|
189
|
+
children: [
|
|
190
|
+
{
|
|
191
|
+
type: "instance",
|
|
192
|
+
component: "SelectValue",
|
|
193
|
+
props: [{ name: "placeholder", type: "string", value: "Theme" }],
|
|
194
|
+
children: []
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
type: "instance",
|
|
200
|
+
component: "SelectContent",
|
|
201
|
+
// relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md
|
|
202
|
+
// data-[state=open]:animate-in
|
|
203
|
+
// data-[state=closed]:animate-out data-[state=closed]:fade-out-0
|
|
204
|
+
// data-[state=open]:fade-in-0
|
|
205
|
+
// data-[state=closed]:zoom-out-95
|
|
206
|
+
// data-[state=open]:zoom-in-95
|
|
207
|
+
// data-[side=bottom]:slide-in-from-top-2
|
|
208
|
+
// data-[side=left]:slide-in-from-right-2
|
|
209
|
+
// data-[side=right]:slide-in-from-left-2
|
|
210
|
+
// data-[side=top]:slide-in-from-bottom-2
|
|
211
|
+
// position=popper
|
|
212
|
+
// data-[side=bottom]:translate-y-1
|
|
213
|
+
// data-[side=left]:-translate-x-1
|
|
214
|
+
// data-[side=right]:translate-x-1
|
|
215
|
+
// data-[side=top]:-translate-y-1
|
|
216
|
+
styles: [
|
|
217
|
+
tc.relative(),
|
|
218
|
+
tc.z(50),
|
|
219
|
+
tc.property("minWidth", "8rem"),
|
|
220
|
+
tc.overflow("hidden"),
|
|
221
|
+
tc.rounded("md"),
|
|
222
|
+
tc.border(),
|
|
223
|
+
tc.bg("popover"),
|
|
224
|
+
tc.text("popoverForeground"),
|
|
225
|
+
tc.shadow("md")
|
|
226
|
+
].flat(),
|
|
227
|
+
children: [
|
|
228
|
+
{
|
|
229
|
+
type: "instance",
|
|
230
|
+
component: "SelectViewport",
|
|
231
|
+
// p-1
|
|
232
|
+
// position=popper
|
|
233
|
+
// h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]
|
|
234
|
+
styles: [
|
|
235
|
+
tc.p(1),
|
|
236
|
+
tc.property("height", "--radix-select-trigger-height"),
|
|
237
|
+
tc.w("full"),
|
|
238
|
+
tc.property("minWidth", "--radix-select-trigger-width")
|
|
239
|
+
].flat(),
|
|
240
|
+
children: [
|
|
241
|
+
createSelectItem({
|
|
242
|
+
props: [{ name: "value", type: "string", value: "light" }],
|
|
243
|
+
children: [{ type: "text", value: "Light" }]
|
|
244
|
+
}),
|
|
245
|
+
createSelectItem({
|
|
246
|
+
props: [{ name: "value", type: "string", value: "dark" }],
|
|
247
|
+
children: [{ type: "text", value: "Dark" }]
|
|
248
|
+
}),
|
|
249
|
+
createSelectItem({
|
|
250
|
+
props: [{ name: "value", type: "string", value: "system" }],
|
|
251
|
+
children: [{ type: "text", value: "System" }]
|
|
252
|
+
})
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
}
|
|
259
|
+
]
|
|
260
|
+
};
|
|
261
|
+
const metaSelectTrigger = {
|
|
262
|
+
category: "hidden",
|
|
263
|
+
type: "container",
|
|
264
|
+
icon: import_svg.TriggerIcon,
|
|
265
|
+
detachable: false,
|
|
266
|
+
presetStyle: {
|
|
267
|
+
button: import_css_normalize.button
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
const metaSelectValue = {
|
|
271
|
+
category: "hidden",
|
|
272
|
+
type: "container",
|
|
273
|
+
label: "Value",
|
|
274
|
+
icon: import_svg.FormTextFieldIcon,
|
|
275
|
+
detachable: false,
|
|
276
|
+
presetStyle: {
|
|
277
|
+
span: import_css_normalize.span
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
const metaSelectContent = {
|
|
281
|
+
category: "hidden",
|
|
282
|
+
type: "container",
|
|
283
|
+
icon: import_svg.ContentIcon,
|
|
284
|
+
detachable: false,
|
|
285
|
+
presetStyle
|
|
286
|
+
};
|
|
287
|
+
const metaSelectViewport = {
|
|
288
|
+
category: "hidden",
|
|
289
|
+
type: "container",
|
|
290
|
+
icon: import_svg.ViewportIcon,
|
|
291
|
+
detachable: false,
|
|
292
|
+
presetStyle
|
|
293
|
+
};
|
|
294
|
+
const metaSelectItem = {
|
|
295
|
+
category: "hidden",
|
|
296
|
+
type: "container",
|
|
297
|
+
icon: import_svg.ItemIcon,
|
|
298
|
+
requiredAncestors: ["SelectViewport"],
|
|
299
|
+
presetStyle
|
|
300
|
+
};
|
|
301
|
+
const metaSelectItemIndicator = {
|
|
302
|
+
category: "hidden",
|
|
303
|
+
type: "container",
|
|
304
|
+
label: "Indicator",
|
|
305
|
+
icon: import_svg.CheckMarkIcon,
|
|
306
|
+
detachable: false,
|
|
307
|
+
requiredAncestors: ["SelectItem"],
|
|
308
|
+
presetStyle: {
|
|
309
|
+
span: import_css_normalize.span
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
const metaSelectItemText = {
|
|
313
|
+
category: "hidden",
|
|
314
|
+
type: "container",
|
|
315
|
+
label: "Item Text",
|
|
316
|
+
icon: import_svg.TextIcon,
|
|
317
|
+
detachable: false,
|
|
318
|
+
requiredAncestors: ["SelectItem"],
|
|
319
|
+
presetStyle: {
|
|
320
|
+
span: import_css_normalize.span
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
const propsMetaSelect = {
|
|
324
|
+
props: import_select.propsSelect,
|
|
325
|
+
initialProps: ["value", "open", "name", "required"]
|
|
326
|
+
};
|
|
327
|
+
const propsMetaSelectTrigger = {
|
|
328
|
+
props: import_select.propsSelectTrigger
|
|
329
|
+
};
|
|
330
|
+
const propsMetaSelectValue = {
|
|
331
|
+
props: import_select.propsSelectValue,
|
|
332
|
+
initialProps: ["placeholder"]
|
|
333
|
+
};
|
|
334
|
+
const propsMetaSelectContent = {
|
|
335
|
+
props: import_select.propsSelectContent
|
|
336
|
+
};
|
|
337
|
+
const propsMetaSelectViewport = {
|
|
338
|
+
props: import_select.propsSelectViewport
|
|
339
|
+
};
|
|
340
|
+
const propsMetaSelectItem = {
|
|
341
|
+
props: import_select.propsSelectItem,
|
|
342
|
+
initialProps: ["value"]
|
|
343
|
+
};
|
|
344
|
+
const propsMetaSelectItemIndicator = {
|
|
345
|
+
props: import_select.propsSelectItemIndicator
|
|
346
|
+
};
|
|
347
|
+
const propsMetaSelectItemText = {
|
|
348
|
+
props: import_select.propsSelectItemText
|
|
349
|
+
};
|
package/lib/cjs/sheet.ws.js
CHANGED
|
@@ -28,99 +28,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var sheet_ws_exports = {};
|
|
30
30
|
__export(sheet_ws_exports, {
|
|
31
|
-
|
|
32
|
-
metaSheetClose: () => metaSheetClose,
|
|
33
|
-
metaSheetContent: () => metaSheetContent,
|
|
34
|
-
metaSheetDescription: () => metaSheetDescription,
|
|
35
|
-
metaSheetOverlay: () => metaSheetOverlay,
|
|
36
|
-
metaSheetTitle: () => metaSheetTitle,
|
|
37
|
-
metaSheetTrigger: () => metaSheetTrigger,
|
|
38
|
-
propsMetaSheet: () => propsMetaSheet,
|
|
39
|
-
propsMetaSheetClose: () => propsMetaSheetClose,
|
|
40
|
-
propsMetaSheetContent: () => propsMetaSheetContent,
|
|
41
|
-
propsMetaSheetDescription: () => propsMetaSheetDescription,
|
|
42
|
-
propsMetaSheetOverlay: () => propsMetaSheetOverlay,
|
|
43
|
-
propsMetaSheetTitle: () => propsMetaSheetTitle,
|
|
44
|
-
propsMetaSheetTrigger: () => propsMetaSheetTrigger
|
|
31
|
+
meta: () => meta
|
|
45
32
|
});
|
|
46
33
|
module.exports = __toCommonJS(sheet_ws_exports);
|
|
47
34
|
var import_svg = require("@webstudio-is/icons/svg");
|
|
48
|
-
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
49
35
|
var tc = __toESM(require("./theme/tailwind-classes"), 1);
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
var import_button = require("./button.ws");
|
|
53
|
-
const contentPresetStyle = {
|
|
54
|
-
div: import_css_normalize.div,
|
|
55
|
-
nav: import_css_normalize.nav
|
|
56
|
-
};
|
|
57
|
-
const presetStyle = {
|
|
58
|
-
div: import_css_normalize.div
|
|
59
|
-
};
|
|
60
|
-
const buttonPresetStyle = {
|
|
61
|
-
button: import_css_normalize.button
|
|
62
|
-
};
|
|
63
|
-
const titlePresetStyle = {
|
|
64
|
-
h2: import_css_normalize.h2
|
|
65
|
-
};
|
|
66
|
-
const descriptionPresetStyle = {
|
|
67
|
-
p: import_css_normalize.p
|
|
68
|
-
};
|
|
69
|
-
const metaSheetTrigger = {
|
|
70
|
-
category: "hidden",
|
|
71
|
-
type: "container",
|
|
72
|
-
icon: import_svg.TriggerIcon,
|
|
73
|
-
stylable: false,
|
|
74
|
-
detachable: false
|
|
75
|
-
};
|
|
76
|
-
const metaSheetContent = {
|
|
77
|
-
category: "hidden",
|
|
78
|
-
type: "container",
|
|
79
|
-
icon: import_svg.ContentIcon,
|
|
80
|
-
detachable: false,
|
|
81
|
-
presetStyle: contentPresetStyle,
|
|
82
|
-
states: [
|
|
83
|
-
{ selector: "[data-side=top]", label: "Top Side" },
|
|
84
|
-
{ selector: "[data-side=right]", label: "Right Side" },
|
|
85
|
-
{ selector: "[data-side=bottom]", label: "Bottom Side" },
|
|
86
|
-
{ selector: "[data-side=left]", label: "Left Side" }
|
|
87
|
-
]
|
|
88
|
-
};
|
|
89
|
-
const metaSheetOverlay = {
|
|
90
|
-
category: "hidden",
|
|
91
|
-
type: "container",
|
|
92
|
-
presetStyle,
|
|
93
|
-
icon: import_svg.OverlayIcon,
|
|
94
|
-
detachable: false
|
|
95
|
-
};
|
|
96
|
-
const metaSheetTitle = {
|
|
97
|
-
category: "hidden",
|
|
98
|
-
type: "container",
|
|
99
|
-
presetStyle: titlePresetStyle,
|
|
100
|
-
icon: import_svg.HeadingIcon
|
|
101
|
-
};
|
|
102
|
-
const metaSheetDescription = {
|
|
103
|
-
category: "hidden",
|
|
104
|
-
type: "container",
|
|
105
|
-
presetStyle: descriptionPresetStyle,
|
|
106
|
-
icon: import_svg.TextIcon
|
|
107
|
-
};
|
|
108
|
-
const metaSheetClose = {
|
|
109
|
-
category: "hidden",
|
|
110
|
-
type: "container",
|
|
111
|
-
presetStyle: buttonPresetStyle,
|
|
112
|
-
icon: import_svg.ButtonElementIcon
|
|
113
|
-
};
|
|
114
|
-
const metaSheet = {
|
|
36
|
+
var import_styles = require("./theme/styles");
|
|
37
|
+
const meta = {
|
|
115
38
|
category: "radix",
|
|
39
|
+
order: 1,
|
|
116
40
|
type: "container",
|
|
117
41
|
icon: import_svg.HamburgerMenuIcon,
|
|
118
|
-
order: 15,
|
|
119
42
|
stylable: false,
|
|
120
43
|
template: [
|
|
121
44
|
{
|
|
122
45
|
type: "instance",
|
|
123
|
-
component: "
|
|
46
|
+
component: "Dialog",
|
|
47
|
+
label: "Sheet",
|
|
124
48
|
dataSources: {
|
|
125
49
|
sheetOpen: { type: "variable", initialValue: false }
|
|
126
50
|
},
|
|
@@ -141,32 +65,35 @@ const metaSheet = {
|
|
|
141
65
|
children: [
|
|
142
66
|
{
|
|
143
67
|
type: "instance",
|
|
144
|
-
component: "
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
68
|
+
component: "DialogTrigger",
|
|
69
|
+
label: "Sheet Trigger",
|
|
70
|
+
children: [
|
|
71
|
+
{
|
|
72
|
+
type: "instance",
|
|
73
|
+
component: "Button",
|
|
74
|
+
styles: (0, import_styles.getButtonStyles)("ghost", "icon"),
|
|
75
|
+
children: [
|
|
76
|
+
{
|
|
77
|
+
type: "instance",
|
|
78
|
+
component: "HtmlEmbed",
|
|
79
|
+
label: "Hamburger Menu Svg",
|
|
80
|
+
props: [
|
|
81
|
+
{
|
|
82
|
+
type: "string",
|
|
83
|
+
name: "code",
|
|
84
|
+
value: import_svg.HamburgerMenuIcon
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
children: []
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
]
|
|
166
92
|
},
|
|
167
93
|
{
|
|
168
94
|
type: "instance",
|
|
169
|
-
component: "
|
|
95
|
+
component: "DialogOverlay",
|
|
96
|
+
label: "Sheet Overlay",
|
|
170
97
|
/**
|
|
171
98
|
* fixed inset-0 z-50 bg-background/80 backdrop-blur-sm
|
|
172
99
|
* flex
|
|
@@ -185,7 +112,8 @@ const metaSheet = {
|
|
|
185
112
|
children: [
|
|
186
113
|
{
|
|
187
114
|
type: "instance",
|
|
188
|
-
component: "
|
|
115
|
+
component: "DialogContent",
|
|
116
|
+
label: "Sheet Content",
|
|
189
117
|
/**
|
|
190
118
|
* fixed w-full z-50
|
|
191
119
|
* grid gap-4 max-w-lg
|
|
@@ -203,71 +131,81 @@ const metaSheet = {
|
|
|
203
131
|
tc.p(6),
|
|
204
132
|
tc.shadow("lg"),
|
|
205
133
|
tc.relative(),
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
)
|
|
210
|
-
tc.state(
|
|
211
|
-
[tc.ml("auto"), tc.maxW("sm"), tc.grow()].flat(),
|
|
212
|
-
"[data-side=right]"
|
|
213
|
-
),
|
|
214
|
-
tc.state([tc.mb("auto")].flat(), "[data-side=top]"),
|
|
215
|
-
tc.state([tc.mt("auto")].flat(), "[data-side=bottom]")
|
|
134
|
+
// side=left
|
|
135
|
+
tc.mr("auto"),
|
|
136
|
+
tc.maxW("sm"),
|
|
137
|
+
tc.grow()
|
|
216
138
|
].flat(),
|
|
217
139
|
children: [
|
|
218
140
|
{
|
|
219
141
|
type: "instance",
|
|
220
142
|
component: "Box",
|
|
221
|
-
label: "
|
|
222
|
-
|
|
143
|
+
label: "Navigation",
|
|
144
|
+
props: [
|
|
145
|
+
{ name: "tag", type: "string", value: "nav" },
|
|
146
|
+
{ name: "role", type: "string", value: "navigation" }
|
|
147
|
+
],
|
|
223
148
|
children: [
|
|
224
149
|
{
|
|
225
150
|
type: "instance",
|
|
226
|
-
component: "
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
**/
|
|
230
|
-
styles: [
|
|
231
|
-
tc.my(0),
|
|
232
|
-
tc.leading("none"),
|
|
233
|
-
tc.text("lg"),
|
|
234
|
-
tc.tracking("tight")
|
|
235
|
-
].flat(),
|
|
151
|
+
component: "Box",
|
|
152
|
+
label: "Sheet Header",
|
|
153
|
+
styles: [tc.flex(), tc.flex("col"), tc.gap(1)].flat(),
|
|
236
154
|
children: [
|
|
237
155
|
{
|
|
238
|
-
type: "
|
|
239
|
-
|
|
156
|
+
type: "instance",
|
|
157
|
+
component: "DialogTitle",
|
|
158
|
+
label: "Sheet Title",
|
|
159
|
+
/**
|
|
160
|
+
* text-lg leading-none tracking-tight
|
|
161
|
+
**/
|
|
162
|
+
styles: [
|
|
163
|
+
tc.my(0),
|
|
164
|
+
tc.leading("none"),
|
|
165
|
+
tc.text("lg"),
|
|
166
|
+
tc.tracking("tight")
|
|
167
|
+
].flat(),
|
|
168
|
+
children: [
|
|
169
|
+
{
|
|
170
|
+
type: "text",
|
|
171
|
+
value: "Sheet Title"
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
type: "instance",
|
|
177
|
+
component: "DialogDescription",
|
|
178
|
+
label: "Sheet Description",
|
|
179
|
+
/**
|
|
180
|
+
* text-sm text-muted-foreground
|
|
181
|
+
**/
|
|
182
|
+
styles: [
|
|
183
|
+
tc.my(0),
|
|
184
|
+
tc.text("sm"),
|
|
185
|
+
tc.text("mutedForeground")
|
|
186
|
+
].flat(),
|
|
187
|
+
children: [
|
|
188
|
+
{
|
|
189
|
+
type: "text",
|
|
190
|
+
value: "Sheet description text you can edit"
|
|
191
|
+
}
|
|
192
|
+
]
|
|
240
193
|
}
|
|
241
194
|
]
|
|
242
195
|
},
|
|
243
196
|
{
|
|
244
197
|
type: "instance",
|
|
245
|
-
component: "
|
|
246
|
-
/**
|
|
247
|
-
* text-sm text-muted-foreground
|
|
248
|
-
**/
|
|
249
|
-
styles: [
|
|
250
|
-
tc.my(0),
|
|
251
|
-
tc.text("sm"),
|
|
252
|
-
tc.text("mutedForeground")
|
|
253
|
-
].flat(),
|
|
198
|
+
component: "Text",
|
|
254
199
|
children: [
|
|
255
|
-
{
|
|
256
|
-
type: "text",
|
|
257
|
-
value: "sheet description text you can edit"
|
|
258
|
-
}
|
|
200
|
+
{ type: "text", value: "The text you can edit" }
|
|
259
201
|
]
|
|
260
202
|
}
|
|
261
203
|
]
|
|
262
204
|
},
|
|
263
205
|
{
|
|
264
206
|
type: "instance",
|
|
265
|
-
component: "
|
|
266
|
-
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
type: "instance",
|
|
270
|
-
component: "SheetClose",
|
|
207
|
+
component: "DialogClose",
|
|
208
|
+
label: "Close Button",
|
|
271
209
|
/**
|
|
272
210
|
* absolute right-4 top-4
|
|
273
211
|
* rounded-sm opacity-70
|
|
@@ -302,30 +240,3 @@ const metaSheet = {
|
|
|
302
240
|
}
|
|
303
241
|
]
|
|
304
242
|
};
|
|
305
|
-
const propsMetaSheet = {
|
|
306
|
-
props: import_sheet.propsSheet,
|
|
307
|
-
initialProps: ["open", "modal"]
|
|
308
|
-
};
|
|
309
|
-
const propsMetaSheetTrigger = {
|
|
310
|
-
props: import_sheet.propsSheetTrigger
|
|
311
|
-
};
|
|
312
|
-
const propsMetaSheetContent = {
|
|
313
|
-
props: import_sheet.propsSheetContent,
|
|
314
|
-
initialProps: ["side", "role", "tag"]
|
|
315
|
-
};
|
|
316
|
-
const propsMetaSheetOverlay = {
|
|
317
|
-
props: import_sheet.propsSheetOverlay,
|
|
318
|
-
initialProps: []
|
|
319
|
-
};
|
|
320
|
-
const propsMetaSheetClose = {
|
|
321
|
-
props: import_sheet.propsSheetClose,
|
|
322
|
-
initialProps: []
|
|
323
|
-
};
|
|
324
|
-
const propsMetaSheetTitle = {
|
|
325
|
-
props: import_sheet.propsSheetTitle,
|
|
326
|
-
initialProps: []
|
|
327
|
-
};
|
|
328
|
-
const propsMetaSheetDescription = {
|
|
329
|
-
props: import_sheet.propsSheetDescription,
|
|
330
|
-
initialProps: []
|
|
331
|
-
};
|
|
@@ -16,13 +16,12 @@ 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
|
-
|
|
22
|
-
|
|
23
|
-
module.exports = __toCommonJS(input_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
-
var import_react = require("react");
|
|
26
|
-
const Input = (0, import_react.forwardRef)(({ children: _children, ...props }, ref) => {
|
|
27
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { ref, ...props });
|
|
19
|
+
var switch_exports = {};
|
|
20
|
+
__export(switch_exports, {
|
|
21
|
+
Switch: () => Switch,
|
|
22
|
+
SwitchThumb: () => SwitchThumb
|
|
28
23
|
});
|
|
24
|
+
module.exports = __toCommonJS(switch_exports);
|
|
25
|
+
var import_react_switch = require("@radix-ui/react-switch");
|
|
26
|
+
const Switch = import_react_switch.Root;
|
|
27
|
+
const SwitchThumb = import_react_switch.Thumb;
|