@webstudio-is/sdk-components-react-radix 0.91.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 +15 -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 -315
- 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 -320
- 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/select.ws.js
DELETED
|
@@ -1,350 +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 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.js
DELETED
|
@@ -1,96 +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 sheet_exports = {};
|
|
30
|
-
__export(sheet_exports, {
|
|
31
|
-
Sheet: () => Sheet,
|
|
32
|
-
SheetClose: () => SheetClose,
|
|
33
|
-
SheetContent: () => SheetContent,
|
|
34
|
-
SheetDescription: () => SheetDescription,
|
|
35
|
-
SheetOverlay: () => SheetOverlay,
|
|
36
|
-
SheetTitle: () => SheetTitle,
|
|
37
|
-
SheetTrigger: () => SheetTrigger,
|
|
38
|
-
hooksSheet: () => hooksSheet
|
|
39
|
-
});
|
|
40
|
-
module.exports = __toCommonJS(sheet_exports);
|
|
41
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
-
var import_react = require("react");
|
|
43
|
-
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
44
|
-
var Dialog = __toESM(require("./dialog"), 1);
|
|
45
|
-
const Sheet = Dialog.Dialog;
|
|
46
|
-
const SheetTrigger = Dialog.DialogTrigger;
|
|
47
|
-
const SheetOverlay = Dialog.DialogOverlay;
|
|
48
|
-
const SheetClose = Dialog.DialogClose;
|
|
49
|
-
const SheetTitle = Dialog.DialogTitle;
|
|
50
|
-
const SheetDescription = Dialog.DialogDescription;
|
|
51
|
-
const SheetContent = (0, import_react.forwardRef)(
|
|
52
|
-
({ tag = "nav", side = "left", role = "navigation", children, ...props }, ref) => {
|
|
53
|
-
const Tag = tag;
|
|
54
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55
|
-
Dialog.DialogContent,
|
|
56
|
-
{
|
|
57
|
-
asChild: true,
|
|
58
|
-
"data-side": side,
|
|
59
|
-
role,
|
|
60
|
-
...props,
|
|
61
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tag, { ref, children })
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
const namespace = "@webstudio-is/sdk-components-react-radix";
|
|
67
|
-
const hooksSheet = {
|
|
68
|
-
onNavigatorUnselect: (context, event) => {
|
|
69
|
-
for (const instance of event.instancePath) {
|
|
70
|
-
if (instance.component === `${namespace}:SheetOverlay`) {
|
|
71
|
-
const sheet = (0, import_react_sdk.getClosestInstance)(
|
|
72
|
-
event.instancePath,
|
|
73
|
-
instance,
|
|
74
|
-
`${namespace}:Sheet`
|
|
75
|
-
);
|
|
76
|
-
if (sheet) {
|
|
77
|
-
context.setPropVariable(sheet.id, "open", false);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
onNavigatorSelect: (context, event) => {
|
|
83
|
-
for (const instance of event.instancePath) {
|
|
84
|
-
if (instance.component === `${namespace}:SheetOverlay`) {
|
|
85
|
-
const sheet = (0, import_react_sdk.getClosestInstance)(
|
|
86
|
-
event.instancePath,
|
|
87
|
-
instance,
|
|
88
|
-
`${namespace}:Sheet`
|
|
89
|
-
);
|
|
90
|
-
if (sheet) {
|
|
91
|
-
context.setPropVariable(sheet.id, "open", true);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
};
|
package/lib/cjs/sheet.ws.js
DELETED
|
@@ -1,257 +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 sheet_ws_exports = {};
|
|
30
|
-
__export(sheet_ws_exports, {
|
|
31
|
-
meta: () => meta
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(sheet_ws_exports);
|
|
34
|
-
var import_svg = require("@webstudio-is/icons/svg");
|
|
35
|
-
var tc = __toESM(require("./theme/tailwind-classes"), 1);
|
|
36
|
-
var import_styles = require("./theme/styles");
|
|
37
|
-
const meta = {
|
|
38
|
-
category: "radix",
|
|
39
|
-
order: 1,
|
|
40
|
-
type: "container",
|
|
41
|
-
icon: import_svg.HamburgerMenuIcon,
|
|
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.",
|
|
44
|
-
template: [
|
|
45
|
-
{
|
|
46
|
-
type: "instance",
|
|
47
|
-
component: "Dialog",
|
|
48
|
-
label: "Sheet",
|
|
49
|
-
dataSources: {
|
|
50
|
-
sheetOpen: { type: "variable", initialValue: false }
|
|
51
|
-
},
|
|
52
|
-
props: [
|
|
53
|
-
{
|
|
54
|
-
type: "dataSource",
|
|
55
|
-
name: "open",
|
|
56
|
-
dataSourceName: "sheetOpen"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
name: "onOpenChange",
|
|
60
|
-
type: "action",
|
|
61
|
-
value: [
|
|
62
|
-
{ type: "execute", args: ["open"], code: `sheetOpen = open` }
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
],
|
|
66
|
-
children: [
|
|
67
|
-
{
|
|
68
|
-
type: "instance",
|
|
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
|
-
]
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
type: "instance",
|
|
96
|
-
component: "DialogOverlay",
|
|
97
|
-
label: "Sheet Overlay",
|
|
98
|
-
/**
|
|
99
|
-
* fixed inset-0 z-50 bg-background/80 backdrop-blur-sm
|
|
100
|
-
* flex
|
|
101
|
-
**/
|
|
102
|
-
styles: [
|
|
103
|
-
tc.fixed(),
|
|
104
|
-
tc.inset(0),
|
|
105
|
-
tc.z(50),
|
|
106
|
-
tc.bg("background", 80),
|
|
107
|
-
tc.backdropBlur("sm"),
|
|
108
|
-
// To allow positioning Content
|
|
109
|
-
tc.flex(),
|
|
110
|
-
tc.flex("col"),
|
|
111
|
-
tc.overflow("auto")
|
|
112
|
-
].flat(),
|
|
113
|
-
children: [
|
|
114
|
-
{
|
|
115
|
-
type: "instance",
|
|
116
|
-
component: "DialogContent",
|
|
117
|
-
label: "Sheet Content",
|
|
118
|
-
/**
|
|
119
|
-
* fixed w-full z-50
|
|
120
|
-
* grid gap-4 max-w-lg
|
|
121
|
-
* m-auto
|
|
122
|
-
* border bg-background p-6 shadow-lg
|
|
123
|
-
**/
|
|
124
|
-
styles: [
|
|
125
|
-
tc.w("full"),
|
|
126
|
-
tc.z(50),
|
|
127
|
-
tc.flex(),
|
|
128
|
-
tc.flex("col"),
|
|
129
|
-
tc.gap(4),
|
|
130
|
-
tc.border(),
|
|
131
|
-
tc.bg("background"),
|
|
132
|
-
tc.p(6),
|
|
133
|
-
tc.shadow("lg"),
|
|
134
|
-
tc.relative(),
|
|
135
|
-
// side=left
|
|
136
|
-
tc.mr("auto"),
|
|
137
|
-
tc.maxW("sm"),
|
|
138
|
-
tc.grow()
|
|
139
|
-
].flat(),
|
|
140
|
-
children: [
|
|
141
|
-
{
|
|
142
|
-
type: "instance",
|
|
143
|
-
component: "Box",
|
|
144
|
-
label: "Navigation",
|
|
145
|
-
props: [
|
|
146
|
-
{ name: "tag", type: "string", value: "nav" },
|
|
147
|
-
{ name: "role", type: "string", value: "navigation" }
|
|
148
|
-
],
|
|
149
|
-
children: [
|
|
150
|
-
{
|
|
151
|
-
type: "instance",
|
|
152
|
-
component: "Box",
|
|
153
|
-
label: "Sheet Header",
|
|
154
|
-
styles: [tc.flex(), tc.flex("col"), tc.gap(1)].flat(),
|
|
155
|
-
children: [
|
|
156
|
-
{
|
|
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
|
-
]
|
|
194
|
-
}
|
|
195
|
-
]
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
type: "instance",
|
|
199
|
-
component: "Text",
|
|
200
|
-
children: [
|
|
201
|
-
{ type: "text", value: "The text you can edit" }
|
|
202
|
-
]
|
|
203
|
-
}
|
|
204
|
-
]
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
type: "instance",
|
|
208
|
-
component: "DialogClose",
|
|
209
|
-
label: "Close Button",
|
|
210
|
-
/**
|
|
211
|
-
* absolute right-4 top-4
|
|
212
|
-
* rounded-sm opacity-70
|
|
213
|
-
* ring-offset-background
|
|
214
|
-
* hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
|
|
215
|
-
* flex items-center justify-center h-4 w-4
|
|
216
|
-
**/
|
|
217
|
-
styles: [
|
|
218
|
-
tc.absolute(),
|
|
219
|
-
tc.right(4),
|
|
220
|
-
tc.top(4),
|
|
221
|
-
tc.rounded("sm"),
|
|
222
|
-
tc.opacity(70),
|
|
223
|
-
tc.flex(),
|
|
224
|
-
tc.items("center"),
|
|
225
|
-
tc.justify("center"),
|
|
226
|
-
tc.h(4),
|
|
227
|
-
tc.w(4),
|
|
228
|
-
tc.border(0),
|
|
229
|
-
tc.bg("transparent"),
|
|
230
|
-
tc.outline("none"),
|
|
231
|
-
tc.hover(tc.opacity(100)),
|
|
232
|
-
tc.focus(tc.ring("ring", 2, "background", 2))
|
|
233
|
-
].flat(),
|
|
234
|
-
children: [
|
|
235
|
-
{
|
|
236
|
-
type: "instance",
|
|
237
|
-
component: "HtmlEmbed",
|
|
238
|
-
label: "Close Icon",
|
|
239
|
-
props: [
|
|
240
|
-
{
|
|
241
|
-
type: "string",
|
|
242
|
-
name: "code",
|
|
243
|
-
value: import_svg.LargeXIcon
|
|
244
|
-
}
|
|
245
|
-
],
|
|
246
|
-
children: []
|
|
247
|
-
}
|
|
248
|
-
]
|
|
249
|
-
}
|
|
250
|
-
]
|
|
251
|
-
}
|
|
252
|
-
]
|
|
253
|
-
}
|
|
254
|
-
]
|
|
255
|
-
}
|
|
256
|
-
]
|
|
257
|
-
};
|