@webstudio-is/sdk-components-react-radix 0.87.1 → 0.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__generated__/accordion.props.js +605 -114
- package/lib/__generated__/button.props.js +158 -47
- package/lib/__generated__/checkbox.props.js +1083 -0
- package/lib/__generated__/collapsible.props.js +234 -44
- package/lib/__generated__/dialog.props.js +611 -121
- package/lib/__generated__/input.props.js +264 -47
- package/lib/__generated__/label.props.js +123 -23
- package/lib/__generated__/navigation-menu.props.js +2565 -0
- package/lib/__generated__/popover.props.js +129 -28
- package/lib/__generated__/radio-group.props.js +1627 -0
- package/lib/__generated__/select.props.js +3678 -0
- package/lib/__generated__/sheet.props.js +591 -121
- package/lib/__generated__/switch.props.js +1083 -0
- package/lib/__generated__/tabs.props.js +906 -68
- package/lib/__generated__/textarea.props.js +177 -31
- package/lib/__generated__/tooltip.props.js +131 -29
- package/lib/accordion.js +11 -4
- package/lib/accordion.ws.js +88 -72
- package/lib/checkbox.js +13 -0
- package/lib/checkbox.ws.js +153 -0
- package/lib/cjs/__generated__/accordion.props.js +605 -114
- package/lib/cjs/__generated__/button.props.js +158 -47
- package/lib/cjs/__generated__/checkbox.props.js +1103 -0
- package/lib/cjs/__generated__/collapsible.props.js +234 -44
- package/lib/cjs/__generated__/dialog.props.js +611 -121
- package/lib/cjs/__generated__/input.props.js +264 -47
- package/lib/cjs/__generated__/label.props.js +123 -23
- package/lib/cjs/__generated__/navigation-menu.props.js +2585 -0
- package/lib/cjs/__generated__/popover.props.js +129 -28
- package/lib/cjs/__generated__/radio-group.props.js +1647 -0
- package/lib/cjs/__generated__/select.props.js +3698 -0
- package/lib/cjs/__generated__/sheet.props.js +591 -121
- package/lib/cjs/__generated__/switch.props.js +1103 -0
- package/lib/cjs/__generated__/tabs.props.js +906 -68
- package/lib/cjs/__generated__/textarea.props.js +177 -31
- package/lib/cjs/__generated__/tooltip.props.js +131 -29
- package/lib/cjs/accordion.js +11 -4
- package/lib/cjs/accordion.ws.js +86 -71
- package/lib/cjs/{textarea.js → checkbox.js} +9 -6
- package/lib/cjs/checkbox.ws.js +174 -0
- package/lib/cjs/collapsible.ws.js +5 -1
- package/lib/cjs/components.js +27 -14
- package/lib/cjs/dialog.ws.js +18 -17
- package/lib/cjs/hooks.js +5 -1
- package/lib/cjs/label.ws.js +2 -1
- package/lib/cjs/metas.js +29 -14
- package/lib/cjs/navigation-menu.js +107 -0
- package/lib/cjs/navigation-menu.ws.js +514 -0
- package/lib/cjs/popover.ws.js +13 -9
- package/lib/cjs/props-descriptions.js +56 -0
- package/lib/cjs/props.js +27 -14
- package/lib/cjs/{button.js → radio-group.js} +10 -8
- package/lib/cjs/radio-group.ws.js +191 -0
- package/lib/cjs/select.js +83 -0
- package/lib/cjs/select.ws.js +350 -0
- package/lib/cjs/sheet.ws.js +88 -176
- package/lib/cjs/{input.js → switch.js} +8 -9
- package/lib/cjs/switch.ws.js +173 -0
- package/lib/cjs/tabs.js +2 -3
- package/lib/cjs/tabs.ws.js +14 -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 +12 -8
- package/lib/collapsible.ws.js +5 -1
- package/lib/components.js +44 -22
- package/lib/dialog.ws.js +18 -17
- package/lib/hooks.js +5 -1
- package/lib/label.ws.js +2 -1
- package/lib/metas.js +58 -24
- package/lib/navigation-menu.js +85 -0
- package/lib/navigation-menu.ws.js +501 -0
- package/lib/popover.ws.js +13 -9
- package/lib/props-descriptions.js +36 -0
- package/lib/props.js +56 -24
- package/lib/radio-group.js +11 -0
- package/lib/radio-group.ws.js +173 -0
- package/lib/select.js +75 -0
- package/lib/select.ws.js +338 -0
- package/lib/sheet.ws.js +89 -194
- package/lib/switch.js +7 -0
- package/lib/switch.ws.js +145 -0
- package/lib/tabs.js +3 -5
- package/lib/tabs.ws.js +15 -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 +12 -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-descriptions.d.ts +29 -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 +14 -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 +675 -108
- package/src/__generated__/button.props.ts +177 -45
- package/src/__generated__/checkbox.props.ts +1217 -0
- package/src/__generated__/collapsible.props.ts +261 -42
- package/src/__generated__/dialog.props.ts +682 -115
- package/src/__generated__/input.props.ts +292 -44
- package/src/__generated__/label.props.ts +137 -22
- package/src/__generated__/navigation-menu.props.ts +2882 -0
- package/src/__generated__/popover.props.ts +142 -24
- package/src/__generated__/radio-group.props.ts +1828 -0
- package/src/__generated__/select.props.ts +4130 -0
- package/src/__generated__/sheet.props.ts +657 -110
- package/src/__generated__/switch.props.ts +1217 -0
- package/src/__generated__/tabs.props.ts +1019 -67
- package/src/__generated__/textarea.props.ts +195 -30
- package/src/__generated__/tooltip.props.ts +145 -25
- package/src/accordion.tsx +14 -7
- package/src/accordion.ws.ts +87 -70
- package/src/{textarea.stories.ts → checkbox.stories.ts} +6 -11
- package/src/checkbox.tsx +22 -0
- package/src/checkbox.ws.ts +154 -0
- package/src/collapsible.ws.ts +6 -1
- package/src/components.ts +25 -12
- package/src/dialog.ws.tsx +17 -16
- package/src/hooks.ts +4 -0
- package/src/label.ws.ts +3 -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 +524 -0
- package/src/popover.ws.tsx +13 -9
- package/src/props-descriptions.ts +43 -0
- 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 +178 -0
- package/src/select.stories.tsx +21 -0
- package/src/select.tsx +112 -0
- package/src/select.ws.ts +349 -0
- package/src/sheet.ws.tsx +91 -209
- package/src/{button.stories.ts → switch.stories.ts} +6 -19
- package/src/switch.tsx +10 -0
- package/src/switch.ws.ts +146 -0
- package/src/tabs.tsx +4 -17
- package/src/tabs.ws.ts +19 -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 +13 -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,350 @@
|
|
|
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
|
+
description: "Use within a form to give your users a list of options to choose from.",
|
|
129
|
+
template: [
|
|
130
|
+
{
|
|
131
|
+
type: "instance",
|
|
132
|
+
component: "Select",
|
|
133
|
+
dataSources: {
|
|
134
|
+
selectValue: { type: "variable", initialValue: "" },
|
|
135
|
+
selectOpen: { type: "variable", initialValue: false }
|
|
136
|
+
},
|
|
137
|
+
props: [
|
|
138
|
+
{
|
|
139
|
+
name: "value",
|
|
140
|
+
type: "dataSource",
|
|
141
|
+
dataSourceName: "selectValue"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: "onValueChange",
|
|
145
|
+
type: "action",
|
|
146
|
+
value: [
|
|
147
|
+
{ type: "execute", args: ["value"], code: `selectValue = value` }
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "open",
|
|
152
|
+
type: "dataSource",
|
|
153
|
+
dataSourceName: "selectOpen"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "onOpenChange",
|
|
157
|
+
type: "action",
|
|
158
|
+
value: [
|
|
159
|
+
{ type: "execute", args: ["open"], code: `selectOpen = open` }
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
children: [
|
|
164
|
+
{
|
|
165
|
+
type: "instance",
|
|
166
|
+
component: "SelectTrigger",
|
|
167
|
+
// 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
|
|
168
|
+
// placeholder:text-muted-foreground
|
|
169
|
+
// focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
|
|
170
|
+
// disabled:cursor-not-allowed disabled:opacity-50
|
|
171
|
+
styles: [
|
|
172
|
+
tc.flex(),
|
|
173
|
+
tc.h(10),
|
|
174
|
+
tc.w("full"),
|
|
175
|
+
tc.items("center"),
|
|
176
|
+
tc.justify("between"),
|
|
177
|
+
tc.rounded("md"),
|
|
178
|
+
tc.border(),
|
|
179
|
+
tc.border("input"),
|
|
180
|
+
tc.bg("background"),
|
|
181
|
+
tc.px(3),
|
|
182
|
+
tc.py(2),
|
|
183
|
+
tc.text("sm"),
|
|
184
|
+
tc.state([tc.text("mutedForeground")].flat(), "::placeholder"),
|
|
185
|
+
tc.focus(
|
|
186
|
+
[tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()
|
|
187
|
+
),
|
|
188
|
+
tc.disabled([tc.cursor("not-allowed"), tc.opacity(50)].flat())
|
|
189
|
+
].flat(),
|
|
190
|
+
children: [
|
|
191
|
+
{
|
|
192
|
+
type: "instance",
|
|
193
|
+
component: "SelectValue",
|
|
194
|
+
props: [{ name: "placeholder", type: "string", value: "Theme" }],
|
|
195
|
+
children: []
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
type: "instance",
|
|
201
|
+
component: "SelectContent",
|
|
202
|
+
// relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md
|
|
203
|
+
// data-[state=open]:animate-in
|
|
204
|
+
// data-[state=closed]:animate-out data-[state=closed]:fade-out-0
|
|
205
|
+
// data-[state=open]:fade-in-0
|
|
206
|
+
// data-[state=closed]:zoom-out-95
|
|
207
|
+
// data-[state=open]:zoom-in-95
|
|
208
|
+
// data-[side=bottom]:slide-in-from-top-2
|
|
209
|
+
// data-[side=left]:slide-in-from-right-2
|
|
210
|
+
// data-[side=right]:slide-in-from-left-2
|
|
211
|
+
// data-[side=top]:slide-in-from-bottom-2
|
|
212
|
+
// position=popper
|
|
213
|
+
// data-[side=bottom]:translate-y-1
|
|
214
|
+
// data-[side=left]:-translate-x-1
|
|
215
|
+
// data-[side=right]:translate-x-1
|
|
216
|
+
// data-[side=top]:-translate-y-1
|
|
217
|
+
styles: [
|
|
218
|
+
tc.relative(),
|
|
219
|
+
tc.z(50),
|
|
220
|
+
tc.property("minWidth", "8rem"),
|
|
221
|
+
tc.overflow("hidden"),
|
|
222
|
+
tc.rounded("md"),
|
|
223
|
+
tc.border(),
|
|
224
|
+
tc.bg("popover"),
|
|
225
|
+
tc.text("popoverForeground"),
|
|
226
|
+
tc.shadow("md")
|
|
227
|
+
].flat(),
|
|
228
|
+
children: [
|
|
229
|
+
{
|
|
230
|
+
type: "instance",
|
|
231
|
+
component: "SelectViewport",
|
|
232
|
+
// p-1
|
|
233
|
+
// position=popper
|
|
234
|
+
// h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]
|
|
235
|
+
styles: [
|
|
236
|
+
tc.p(1),
|
|
237
|
+
tc.property("height", "--radix-select-trigger-height"),
|
|
238
|
+
tc.w("full"),
|
|
239
|
+
tc.property("minWidth", "--radix-select-trigger-width")
|
|
240
|
+
].flat(),
|
|
241
|
+
children: [
|
|
242
|
+
createSelectItem({
|
|
243
|
+
props: [{ name: "value", type: "string", value: "light" }],
|
|
244
|
+
children: [{ type: "text", value: "Light" }]
|
|
245
|
+
}),
|
|
246
|
+
createSelectItem({
|
|
247
|
+
props: [{ name: "value", type: "string", value: "dark" }],
|
|
248
|
+
children: [{ type: "text", value: "Dark" }]
|
|
249
|
+
}),
|
|
250
|
+
createSelectItem({
|
|
251
|
+
props: [{ name: "value", type: "string", value: "system" }],
|
|
252
|
+
children: [{ type: "text", value: "System" }]
|
|
253
|
+
})
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
]
|
|
261
|
+
};
|
|
262
|
+
const metaSelectTrigger = {
|
|
263
|
+
category: "hidden",
|
|
264
|
+
type: "container",
|
|
265
|
+
icon: import_svg.TriggerIcon,
|
|
266
|
+
detachable: false,
|
|
267
|
+
presetStyle: {
|
|
268
|
+
button: import_css_normalize.button
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
const metaSelectValue = {
|
|
272
|
+
category: "hidden",
|
|
273
|
+
type: "container",
|
|
274
|
+
label: "Value",
|
|
275
|
+
icon: import_svg.FormTextFieldIcon,
|
|
276
|
+
detachable: false,
|
|
277
|
+
presetStyle: {
|
|
278
|
+
span: import_css_normalize.span
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
const metaSelectContent = {
|
|
282
|
+
category: "hidden",
|
|
283
|
+
type: "container",
|
|
284
|
+
icon: import_svg.ContentIcon,
|
|
285
|
+
detachable: false,
|
|
286
|
+
presetStyle
|
|
287
|
+
};
|
|
288
|
+
const metaSelectViewport = {
|
|
289
|
+
category: "hidden",
|
|
290
|
+
type: "container",
|
|
291
|
+
icon: import_svg.ViewportIcon,
|
|
292
|
+
detachable: false,
|
|
293
|
+
presetStyle
|
|
294
|
+
};
|
|
295
|
+
const metaSelectItem = {
|
|
296
|
+
category: "hidden",
|
|
297
|
+
type: "container",
|
|
298
|
+
icon: import_svg.ItemIcon,
|
|
299
|
+
requiredAncestors: ["SelectViewport"],
|
|
300
|
+
presetStyle
|
|
301
|
+
};
|
|
302
|
+
const metaSelectItemIndicator = {
|
|
303
|
+
category: "hidden",
|
|
304
|
+
type: "container",
|
|
305
|
+
label: "Indicator",
|
|
306
|
+
icon: import_svg.CheckMarkIcon,
|
|
307
|
+
detachable: false,
|
|
308
|
+
requiredAncestors: ["SelectItem"],
|
|
309
|
+
presetStyle: {
|
|
310
|
+
span: import_css_normalize.span
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
const metaSelectItemText = {
|
|
314
|
+
category: "hidden",
|
|
315
|
+
type: "container",
|
|
316
|
+
label: "Item Text",
|
|
317
|
+
icon: import_svg.TextIcon,
|
|
318
|
+
detachable: false,
|
|
319
|
+
requiredAncestors: ["SelectItem"],
|
|
320
|
+
presetStyle: {
|
|
321
|
+
span: import_css_normalize.span
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
const propsMetaSelect = {
|
|
325
|
+
props: import_select.propsSelect,
|
|
326
|
+
initialProps: ["value", "open", "name", "required"]
|
|
327
|
+
};
|
|
328
|
+
const propsMetaSelectTrigger = {
|
|
329
|
+
props: import_select.propsSelectTrigger
|
|
330
|
+
};
|
|
331
|
+
const propsMetaSelectValue = {
|
|
332
|
+
props: import_select.propsSelectValue,
|
|
333
|
+
initialProps: ["placeholder"]
|
|
334
|
+
};
|
|
335
|
+
const propsMetaSelectContent = {
|
|
336
|
+
props: import_select.propsSelectContent
|
|
337
|
+
};
|
|
338
|
+
const propsMetaSelectViewport = {
|
|
339
|
+
props: import_select.propsSelectViewport
|
|
340
|
+
};
|
|
341
|
+
const propsMetaSelectItem = {
|
|
342
|
+
props: import_select.propsSelectItem,
|
|
343
|
+
initialProps: ["value"]
|
|
344
|
+
};
|
|
345
|
+
const propsMetaSelectItemIndicator = {
|
|
346
|
+
props: import_select.propsSelectItemIndicator
|
|
347
|
+
};
|
|
348
|
+
const propsMetaSelectItemText = {
|
|
349
|
+
props: import_select.propsSelectItemText
|
|
350
|
+
};
|
package/lib/cjs/sheet.ws.js
CHANGED
|
@@ -28,99 +28,24 @@ 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,
|
|
43
|
+
description: "Displays content in a menu that slides out from the side of the screen, triggered by a button. Use this component for a typical mobile hamburger menu.",
|
|
120
44
|
template: [
|
|
121
45
|
{
|
|
122
46
|
type: "instance",
|
|
123
|
-
component: "
|
|
47
|
+
component: "Dialog",
|
|
48
|
+
label: "Sheet",
|
|
124
49
|
dataSources: {
|
|
125
50
|
sheetOpen: { type: "variable", initialValue: false }
|
|
126
51
|
},
|
|
@@ -141,32 +66,35 @@ const metaSheet = {
|
|
|
141
66
|
children: [
|
|
142
67
|
{
|
|
143
68
|
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
|
-
|
|
69
|
+
component: "DialogTrigger",
|
|
70
|
+
label: "Sheet Trigger",
|
|
71
|
+
children: [
|
|
72
|
+
{
|
|
73
|
+
type: "instance",
|
|
74
|
+
component: "Button",
|
|
75
|
+
styles: (0, import_styles.getButtonStyles)("ghost", "icon"),
|
|
76
|
+
children: [
|
|
77
|
+
{
|
|
78
|
+
type: "instance",
|
|
79
|
+
component: "HtmlEmbed",
|
|
80
|
+
label: "Hamburger Menu Svg",
|
|
81
|
+
props: [
|
|
82
|
+
{
|
|
83
|
+
type: "string",
|
|
84
|
+
name: "code",
|
|
85
|
+
value: import_svg.HamburgerMenuIcon
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
children: []
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
]
|
|
166
93
|
},
|
|
167
94
|
{
|
|
168
95
|
type: "instance",
|
|
169
|
-
component: "
|
|
96
|
+
component: "DialogOverlay",
|
|
97
|
+
label: "Sheet Overlay",
|
|
170
98
|
/**
|
|
171
99
|
* fixed inset-0 z-50 bg-background/80 backdrop-blur-sm
|
|
172
100
|
* flex
|
|
@@ -185,7 +113,8 @@ const metaSheet = {
|
|
|
185
113
|
children: [
|
|
186
114
|
{
|
|
187
115
|
type: "instance",
|
|
188
|
-
component: "
|
|
116
|
+
component: "DialogContent",
|
|
117
|
+
label: "Sheet Content",
|
|
189
118
|
/**
|
|
190
119
|
* fixed w-full z-50
|
|
191
120
|
* grid gap-4 max-w-lg
|
|
@@ -203,71 +132,81 @@ const metaSheet = {
|
|
|
203
132
|
tc.p(6),
|
|
204
133
|
tc.shadow("lg"),
|
|
205
134
|
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]")
|
|
135
|
+
// side=left
|
|
136
|
+
tc.mr("auto"),
|
|
137
|
+
tc.maxW("sm"),
|
|
138
|
+
tc.grow()
|
|
216
139
|
].flat(),
|
|
217
140
|
children: [
|
|
218
141
|
{
|
|
219
142
|
type: "instance",
|
|
220
143
|
component: "Box",
|
|
221
|
-
label: "
|
|
222
|
-
|
|
144
|
+
label: "Navigation",
|
|
145
|
+
props: [
|
|
146
|
+
{ name: "tag", type: "string", value: "nav" },
|
|
147
|
+
{ name: "role", type: "string", value: "navigation" }
|
|
148
|
+
],
|
|
223
149
|
children: [
|
|
224
150
|
{
|
|
225
151
|
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(),
|
|
152
|
+
component: "Box",
|
|
153
|
+
label: "Sheet Header",
|
|
154
|
+
styles: [tc.flex(), tc.flex("col"), tc.gap(1)].flat(),
|
|
236
155
|
children: [
|
|
237
156
|
{
|
|
238
|
-
type: "
|
|
239
|
-
|
|
157
|
+
type: "instance",
|
|
158
|
+
component: "DialogTitle",
|
|
159
|
+
label: "Sheet Title",
|
|
160
|
+
/**
|
|
161
|
+
* text-lg leading-none tracking-tight
|
|
162
|
+
**/
|
|
163
|
+
styles: [
|
|
164
|
+
tc.my(0),
|
|
165
|
+
tc.leading("none"),
|
|
166
|
+
tc.text("lg"),
|
|
167
|
+
tc.tracking("tight")
|
|
168
|
+
].flat(),
|
|
169
|
+
children: [
|
|
170
|
+
{
|
|
171
|
+
type: "text",
|
|
172
|
+
value: "Sheet Title"
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
type: "instance",
|
|
178
|
+
component: "DialogDescription",
|
|
179
|
+
label: "Sheet Description",
|
|
180
|
+
/**
|
|
181
|
+
* text-sm text-muted-foreground
|
|
182
|
+
**/
|
|
183
|
+
styles: [
|
|
184
|
+
tc.my(0),
|
|
185
|
+
tc.text("sm"),
|
|
186
|
+
tc.text("mutedForeground")
|
|
187
|
+
].flat(),
|
|
188
|
+
children: [
|
|
189
|
+
{
|
|
190
|
+
type: "text",
|
|
191
|
+
value: "Sheet description text you can edit"
|
|
192
|
+
}
|
|
193
|
+
]
|
|
240
194
|
}
|
|
241
195
|
]
|
|
242
196
|
},
|
|
243
197
|
{
|
|
244
198
|
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(),
|
|
199
|
+
component: "Text",
|
|
254
200
|
children: [
|
|
255
|
-
{
|
|
256
|
-
type: "text",
|
|
257
|
-
value: "sheet description text you can edit"
|
|
258
|
-
}
|
|
201
|
+
{ type: "text", value: "The text you can edit" }
|
|
259
202
|
]
|
|
260
203
|
}
|
|
261
204
|
]
|
|
262
205
|
},
|
|
263
206
|
{
|
|
264
207
|
type: "instance",
|
|
265
|
-
component: "
|
|
266
|
-
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
type: "instance",
|
|
270
|
-
component: "SheetClose",
|
|
208
|
+
component: "DialogClose",
|
|
209
|
+
label: "Close Button",
|
|
271
210
|
/**
|
|
272
211
|
* absolute right-4 top-4
|
|
273
212
|
* rounded-sm opacity-70
|
|
@@ -302,30 +241,3 @@ const metaSheet = {
|
|
|
302
241
|
}
|
|
303
242
|
]
|
|
304
243
|
};
|
|
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
|
-
};
|