@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
package/lib/cjs/button.ws.js
DELETED
|
@@ -1,160 +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 button_ws_exports = {};
|
|
30
|
-
__export(button_ws_exports, {
|
|
31
|
-
meta: () => meta,
|
|
32
|
-
propsMeta: () => propsMeta,
|
|
33
|
-
template: () => template
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(button_ws_exports);
|
|
36
|
-
var import_svg = require("@webstudio-is/icons/svg");
|
|
37
|
-
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
38
|
-
var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
|
|
39
|
-
var import_button = require("./__generated__/button.props");
|
|
40
|
-
var tc = __toESM(require("./theme/tailwind-classes"), 1);
|
|
41
|
-
const presetStyle = {
|
|
42
|
-
button: import_css_normalize.button
|
|
43
|
-
};
|
|
44
|
-
const template = (props2) => [
|
|
45
|
-
{
|
|
46
|
-
type: "instance",
|
|
47
|
-
component: "Button",
|
|
48
|
-
styles: [
|
|
49
|
-
// 'inline-flex items-center justify-center rounded-md text-sm font-medium
|
|
50
|
-
// ring-offset-background transition-colors
|
|
51
|
-
// focus-visible:outline-none focus-visible:ring-2
|
|
52
|
-
// focus-visible:ring-ring focus-visible:ring-offset-2
|
|
53
|
-
// disabled:pointer-events-none disabled:opacity-50'
|
|
54
|
-
tc.border(0),
|
|
55
|
-
tc.bg("transparent"),
|
|
56
|
-
tc.inlineFlex(),
|
|
57
|
-
tc.items("center"),
|
|
58
|
-
tc.justify("center"),
|
|
59
|
-
tc.rounded("md"),
|
|
60
|
-
tc.text("sm"),
|
|
61
|
-
tc.font("medium"),
|
|
62
|
-
tc.focusVisible(
|
|
63
|
-
[tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()
|
|
64
|
-
),
|
|
65
|
-
tc.state([tc.pointerEvents("none"), tc.opacity(50)].flat(), ":disabled"),
|
|
66
|
-
// VARIANT
|
|
67
|
-
// default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
68
|
-
tc.state(
|
|
69
|
-
[tc.bg("primary"), tc.text("primaryForeground")].flat(),
|
|
70
|
-
"[data-variant=default]"
|
|
71
|
-
),
|
|
72
|
-
tc.state(
|
|
73
|
-
[[tc.bg("primary", 90)].flat()].flat(),
|
|
74
|
-
"[data-variant=default]:hover"
|
|
75
|
-
),
|
|
76
|
-
// destructive:'bg-destructive text-destructive-foreground hover:bg-destructive/90',
|
|
77
|
-
tc.state(
|
|
78
|
-
[tc.bg("destructive"), tc.text("destructiveForeground")].flat(),
|
|
79
|
-
"[data-variant=destructive]"
|
|
80
|
-
),
|
|
81
|
-
tc.state(
|
|
82
|
-
[[tc.bg("destructive", 90)].flat()].flat(),
|
|
83
|
-
"[data-variant=destructive]:hover"
|
|
84
|
-
),
|
|
85
|
-
// outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
|
|
86
|
-
tc.state(
|
|
87
|
-
[tc.border(), tc.border("input"), tc.bg("background")].flat(),
|
|
88
|
-
"[data-variant=outline]"
|
|
89
|
-
),
|
|
90
|
-
tc.state(
|
|
91
|
-
[[tc.bg("accent", 90), tc.text("accentForeground")].flat()].flat(),
|
|
92
|
-
"[data-variant=outline]:hover"
|
|
93
|
-
),
|
|
94
|
-
// secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
95
|
-
tc.state(
|
|
96
|
-
[tc.bg("secondary"), tc.text("secondaryForeground")].flat(),
|
|
97
|
-
"[data-variant=secondary]"
|
|
98
|
-
),
|
|
99
|
-
tc.state(
|
|
100
|
-
[[tc.bg("secondary", 80)].flat()].flat(),
|
|
101
|
-
"[data-variant=secondary]:hover"
|
|
102
|
-
),
|
|
103
|
-
// ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
104
|
-
tc.state(
|
|
105
|
-
[[tc.bg("accent"), tc.text("accentForeground")].flat()].flat(),
|
|
106
|
-
"[data-variant=ghost]:hover"
|
|
107
|
-
),
|
|
108
|
-
// link: 'text-primary underline-offset-4 hover:underline',
|
|
109
|
-
tc.state(
|
|
110
|
-
[tc.text("primary"), tc.underlineOffset(4)].flat(),
|
|
111
|
-
"[data-variant=link]"
|
|
112
|
-
),
|
|
113
|
-
tc.state([[tc.underline()].flat()].flat(), "[data-variant=link]:hover"),
|
|
114
|
-
// SIZE
|
|
115
|
-
// default: 'h-10 px-4 py-2',
|
|
116
|
-
tc.state([tc.h(10), tc.px(4), tc.py(2)].flat(), "[data-size=default]"),
|
|
117
|
-
// sm: 'h-9 rounded-md px-3',
|
|
118
|
-
tc.state([tc.h(10), tc.px(3)].flat(), "[data-size=sm]"),
|
|
119
|
-
// lg: 'h-11 rounded-md px-8',
|
|
120
|
-
tc.state([tc.h(11), tc.px(8)].flat(), "[data-size=lg]"),
|
|
121
|
-
// icon: 'h-10 w-10',
|
|
122
|
-
tc.state([tc.h(10), tc.w(10)].flat(), "[data-size=icon]")
|
|
123
|
-
].flat(),
|
|
124
|
-
children: props2?.children ?? [{ type: "text", value: "Button" }],
|
|
125
|
-
props: props2?.props
|
|
126
|
-
}
|
|
127
|
-
];
|
|
128
|
-
const meta = {
|
|
129
|
-
category: "radix",
|
|
130
|
-
type: "container",
|
|
131
|
-
invalidAncestors: ["Button"],
|
|
132
|
-
icon: import_svg.ButtonElementIcon,
|
|
133
|
-
presetStyle,
|
|
134
|
-
states: [
|
|
135
|
-
...import_react_sdk.defaultStates,
|
|
136
|
-
{ selector: ":disabled", label: "Disabled" },
|
|
137
|
-
{ selector: ":enabled", label: "Enabled" },
|
|
138
|
-
{ selector: "[data-variant=default]", label: "Default" },
|
|
139
|
-
{ selector: "[data-variant=default]:hover", label: "Default Hover" },
|
|
140
|
-
{ selector: "[data-variant=destructive]", label: "Destructive" },
|
|
141
|
-
{
|
|
142
|
-
selector: "[data-variant=destructive]:hover",
|
|
143
|
-
label: "Destructive Hover"
|
|
144
|
-
},
|
|
145
|
-
{ selector: "[data-variant=outline]", label: "Outline" },
|
|
146
|
-
{ selector: "[data-variant=outline]:hover", label: "Outline Hover" },
|
|
147
|
-
{ selector: "[data-variant=secondary]", label: "Secondary" },
|
|
148
|
-
{ selector: "[data-variant=secondary]:hover", label: "Secondary Hover" },
|
|
149
|
-
{ selector: "[data-variant=ghost]", label: "Ghost" },
|
|
150
|
-
{ selector: "[data-variant=ghost]:hover", label: "Ghost Hover" },
|
|
151
|
-
{ selector: "[data-variant=link]", label: "Link" },
|
|
152
|
-
{ selector: "[data-variant=link]:hover", label: "Link Hover" }
|
|
153
|
-
],
|
|
154
|
-
order: 1,
|
|
155
|
-
template: template()
|
|
156
|
-
};
|
|
157
|
-
const propsMeta = {
|
|
158
|
-
props: import_button.props,
|
|
159
|
-
initialProps: ["id", "type", "variant", "size", "aria-label"]
|
|
160
|
-
};
|
package/lib/cjs/input.ws.js
DELETED
|
@@ -1,103 +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 input_ws_exports = {};
|
|
30
|
-
__export(input_ws_exports, {
|
|
31
|
-
meta: () => meta,
|
|
32
|
-
propsMeta: () => propsMeta
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(input_ws_exports);
|
|
35
|
-
var import_svg = require("@webstudio-is/icons/svg");
|
|
36
|
-
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
37
|
-
var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
|
|
38
|
-
var import_input = require("./__generated__/input.props");
|
|
39
|
-
var tc = __toESM(require("./theme/tailwind-classes"), 1);
|
|
40
|
-
const presetStyle = {
|
|
41
|
-
input: import_css_normalize.input
|
|
42
|
-
};
|
|
43
|
-
const meta = {
|
|
44
|
-
category: "radix",
|
|
45
|
-
type: "control",
|
|
46
|
-
invalidAncestors: ["Button"],
|
|
47
|
-
icon: import_svg.FormTextFieldIcon,
|
|
48
|
-
presetStyle,
|
|
49
|
-
states: [
|
|
50
|
-
...import_react_sdk.defaultStates,
|
|
51
|
-
{ selector: ":disabled", label: "Disabled" },
|
|
52
|
-
{ selector: "::placeholder", label: "Placeholder" },
|
|
53
|
-
{ selector: "::file-selector-button", label: "File Selector Button" },
|
|
54
|
-
// @todo share https://github.com/webstudio-is/webstudio-builder/issues/2102
|
|
55
|
-
{ selector: ":valid", label: "Valid" },
|
|
56
|
-
{ selector: ":invalid", label: "Invalid" },
|
|
57
|
-
{ selector: ":required", label: "Required" },
|
|
58
|
-
{ selector: ":optional", label: "Optional" },
|
|
59
|
-
{ selector: ":enabled", label: "Enabled" },
|
|
60
|
-
{ selector: ":read-only", label: "Read Only" },
|
|
61
|
-
{ selector: ":read-write", label: "Read Write" }
|
|
62
|
-
],
|
|
63
|
-
order: 1,
|
|
64
|
-
template: [
|
|
65
|
-
{
|
|
66
|
-
type: "instance",
|
|
67
|
-
component: "Input",
|
|
68
|
-
styles: [
|
|
69
|
-
// flex h-10 w-full rounded-md border border-input bg-background
|
|
70
|
-
// px-3 py-2 text-sm
|
|
71
|
-
// ring-offset-background
|
|
72
|
-
// file:border-0 file:bg-transparent file:text-sm file:font-medium
|
|
73
|
-
// placeholder:text-muted-foreground
|
|
74
|
-
// focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
|
|
75
|
-
// disabled:cursor-not-allowed disabled:opacity-50"
|
|
76
|
-
tc.flex(),
|
|
77
|
-
tc.h(10),
|
|
78
|
-
tc.w("full"),
|
|
79
|
-
tc.rounded("md"),
|
|
80
|
-
tc.border(),
|
|
81
|
-
tc.border("input"),
|
|
82
|
-
tc.bg("background"),
|
|
83
|
-
tc.px(3),
|
|
84
|
-
tc.py(2),
|
|
85
|
-
tc.text("sm"),
|
|
86
|
-
tc.state(
|
|
87
|
-
[tc.border(0), tc.bg("transparent"), tc.font("medium")].flat(),
|
|
88
|
-
"::file-selector-button"
|
|
89
|
-
),
|
|
90
|
-
tc.state(tc.text("mutedForeground"), "::placeholder"),
|
|
91
|
-
tc.focusVisible(
|
|
92
|
-
[tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()
|
|
93
|
-
),
|
|
94
|
-
tc.disabled([tc.cursor("not-allowed"), tc.opacity(50)].flat())
|
|
95
|
-
].flat(),
|
|
96
|
-
children: []
|
|
97
|
-
}
|
|
98
|
-
]
|
|
99
|
-
};
|
|
100
|
-
const propsMeta = {
|
|
101
|
-
props: import_input.props,
|
|
102
|
-
initialProps: ["id", "name", "type", "placeholder", "required", "autoFocus"]
|
|
103
|
-
};
|
package/lib/cjs/textarea.ws.js
DELETED
|
@@ -1,98 +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 textarea_ws_exports = {};
|
|
30
|
-
__export(textarea_ws_exports, {
|
|
31
|
-
meta: () => meta,
|
|
32
|
-
propsMeta: () => propsMeta
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(textarea_ws_exports);
|
|
35
|
-
var import_svg = require("@webstudio-is/icons/svg");
|
|
36
|
-
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
37
|
-
var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
|
|
38
|
-
var import_textarea = require("./__generated__/textarea.props");
|
|
39
|
-
var tc = __toESM(require("./theme/tailwind-classes"), 1);
|
|
40
|
-
const presetStyle = {
|
|
41
|
-
textarea: import_css_normalize.textarea
|
|
42
|
-
};
|
|
43
|
-
const meta = {
|
|
44
|
-
category: "radix",
|
|
45
|
-
type: "control",
|
|
46
|
-
invalidAncestors: ["Button"],
|
|
47
|
-
icon: import_svg.FormTextAreaIcon,
|
|
48
|
-
presetStyle,
|
|
49
|
-
states: [
|
|
50
|
-
...import_react_sdk.defaultStates,
|
|
51
|
-
{ selector: ":disabled", label: "Disabled" },
|
|
52
|
-
{ selector: "::placeholder", label: "Placeholder" },
|
|
53
|
-
// @todo share https://github.com/webstudio-is/webstudio-builder/issues/2102
|
|
54
|
-
{ selector: ":valid", label: "Valid" },
|
|
55
|
-
{ selector: ":invalid", label: "Invalid" },
|
|
56
|
-
{ selector: ":required", label: "Required" },
|
|
57
|
-
{ selector: ":optional", label: "Optional" },
|
|
58
|
-
{ selector: ":enabled", label: "Enabled" },
|
|
59
|
-
{ selector: ":read-only", label: "Read Only" },
|
|
60
|
-
{ selector: ":read-write", label: "Read Write" }
|
|
61
|
-
],
|
|
62
|
-
order: 1,
|
|
63
|
-
template: [
|
|
64
|
-
{
|
|
65
|
-
type: "instance",
|
|
66
|
-
component: "Textarea",
|
|
67
|
-
styles: [
|
|
68
|
-
// flex min-h-[80px] w-full rounded-md
|
|
69
|
-
// border border-input bg-background
|
|
70
|
-
// px-3 py-2 text-sm ring-offset-background
|
|
71
|
-
// placeholder:text-muted-foreground
|
|
72
|
-
// focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
|
|
73
|
-
// focus-visible:ring-offset-2
|
|
74
|
-
// disabled:cursor-not-allowed disabled:opacity-50
|
|
75
|
-
tc.flex(),
|
|
76
|
-
tc.minH(20),
|
|
77
|
-
tc.w("full"),
|
|
78
|
-
tc.rounded("md"),
|
|
79
|
-
tc.border(),
|
|
80
|
-
tc.border("input"),
|
|
81
|
-
tc.bg("background"),
|
|
82
|
-
tc.px(3),
|
|
83
|
-
tc.py(2),
|
|
84
|
-
tc.text("sm"),
|
|
85
|
-
tc.state(tc.text("mutedForeground"), "::placeholder"),
|
|
86
|
-
tc.focusVisible(
|
|
87
|
-
[tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()
|
|
88
|
-
),
|
|
89
|
-
tc.disabled([tc.cursor("not-allowed"), tc.opacity(50)].flat())
|
|
90
|
-
].flat(),
|
|
91
|
-
children: []
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
};
|
|
95
|
-
const propsMeta = {
|
|
96
|
-
props: import_textarea.props,
|
|
97
|
-
initialProps: ["id", "name", "placeholder", "required", "autoFocus"]
|
|
98
|
-
};
|
package/lib/input.js
DELETED
package/lib/input.ws.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { FormTextFieldIcon } from "@webstudio-is/icons/svg";
|
|
2
|
-
import {
|
|
3
|
-
defaultStates
|
|
4
|
-
} from "@webstudio-is/react-sdk";
|
|
5
|
-
import { input } from "@webstudio-is/react-sdk/css-normalize";
|
|
6
|
-
import { props } from "./__generated__/input.props";
|
|
7
|
-
import * as tc from "./theme/tailwind-classes";
|
|
8
|
-
const presetStyle = {
|
|
9
|
-
input
|
|
10
|
-
};
|
|
11
|
-
const meta = {
|
|
12
|
-
category: "radix",
|
|
13
|
-
type: "control",
|
|
14
|
-
invalidAncestors: ["Button"],
|
|
15
|
-
icon: FormTextFieldIcon,
|
|
16
|
-
presetStyle,
|
|
17
|
-
states: [
|
|
18
|
-
...defaultStates,
|
|
19
|
-
{ selector: ":disabled", label: "Disabled" },
|
|
20
|
-
{ selector: "::placeholder", label: "Placeholder" },
|
|
21
|
-
{ selector: "::file-selector-button", label: "File Selector Button" },
|
|
22
|
-
// @todo share https://github.com/webstudio-is/webstudio-builder/issues/2102
|
|
23
|
-
{ selector: ":valid", label: "Valid" },
|
|
24
|
-
{ selector: ":invalid", label: "Invalid" },
|
|
25
|
-
{ selector: ":required", label: "Required" },
|
|
26
|
-
{ selector: ":optional", label: "Optional" },
|
|
27
|
-
{ selector: ":enabled", label: "Enabled" },
|
|
28
|
-
{ selector: ":read-only", label: "Read Only" },
|
|
29
|
-
{ selector: ":read-write", label: "Read Write" }
|
|
30
|
-
],
|
|
31
|
-
order: 1,
|
|
32
|
-
template: [
|
|
33
|
-
{
|
|
34
|
-
type: "instance",
|
|
35
|
-
component: "Input",
|
|
36
|
-
styles: [
|
|
37
|
-
// flex h-10 w-full rounded-md border border-input bg-background
|
|
38
|
-
// px-3 py-2 text-sm
|
|
39
|
-
// ring-offset-background
|
|
40
|
-
// file:border-0 file:bg-transparent file:text-sm file:font-medium
|
|
41
|
-
// placeholder:text-muted-foreground
|
|
42
|
-
// focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
|
|
43
|
-
// disabled:cursor-not-allowed disabled:opacity-50"
|
|
44
|
-
tc.flex(),
|
|
45
|
-
tc.h(10),
|
|
46
|
-
tc.w("full"),
|
|
47
|
-
tc.rounded("md"),
|
|
48
|
-
tc.border(),
|
|
49
|
-
tc.border("input"),
|
|
50
|
-
tc.bg("background"),
|
|
51
|
-
tc.px(3),
|
|
52
|
-
tc.py(2),
|
|
53
|
-
tc.text("sm"),
|
|
54
|
-
tc.state(
|
|
55
|
-
[tc.border(0), tc.bg("transparent"), tc.font("medium")].flat(),
|
|
56
|
-
"::file-selector-button"
|
|
57
|
-
),
|
|
58
|
-
tc.state(tc.text("mutedForeground"), "::placeholder"),
|
|
59
|
-
tc.focusVisible(
|
|
60
|
-
[tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()
|
|
61
|
-
),
|
|
62
|
-
tc.disabled([tc.cursor("not-allowed"), tc.opacity(50)].flat())
|
|
63
|
-
].flat(),
|
|
64
|
-
children: []
|
|
65
|
-
}
|
|
66
|
-
]
|
|
67
|
-
};
|
|
68
|
-
const propsMeta = {
|
|
69
|
-
props,
|
|
70
|
-
initialProps: ["id", "name", "type", "placeholder", "required", "autoFocus"]
|
|
71
|
-
};
|
|
72
|
-
export {
|
|
73
|
-
meta,
|
|
74
|
-
propsMeta
|
|
75
|
-
};
|
package/lib/textarea.js
DELETED
package/lib/textarea.ws.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { FormTextAreaIcon } from "@webstudio-is/icons/svg";
|
|
2
|
-
import {
|
|
3
|
-
defaultStates
|
|
4
|
-
} from "@webstudio-is/react-sdk";
|
|
5
|
-
import { textarea } from "@webstudio-is/react-sdk/css-normalize";
|
|
6
|
-
import { props } from "./__generated__/textarea.props";
|
|
7
|
-
import * as tc from "./theme/tailwind-classes";
|
|
8
|
-
const presetStyle = {
|
|
9
|
-
textarea
|
|
10
|
-
};
|
|
11
|
-
const meta = {
|
|
12
|
-
category: "radix",
|
|
13
|
-
type: "control",
|
|
14
|
-
invalidAncestors: ["Button"],
|
|
15
|
-
icon: FormTextAreaIcon,
|
|
16
|
-
presetStyle,
|
|
17
|
-
states: [
|
|
18
|
-
...defaultStates,
|
|
19
|
-
{ selector: ":disabled", label: "Disabled" },
|
|
20
|
-
{ selector: "::placeholder", label: "Placeholder" },
|
|
21
|
-
// @todo share https://github.com/webstudio-is/webstudio-builder/issues/2102
|
|
22
|
-
{ selector: ":valid", label: "Valid" },
|
|
23
|
-
{ selector: ":invalid", label: "Invalid" },
|
|
24
|
-
{ selector: ":required", label: "Required" },
|
|
25
|
-
{ selector: ":optional", label: "Optional" },
|
|
26
|
-
{ selector: ":enabled", label: "Enabled" },
|
|
27
|
-
{ selector: ":read-only", label: "Read Only" },
|
|
28
|
-
{ selector: ":read-write", label: "Read Write" }
|
|
29
|
-
],
|
|
30
|
-
order: 1,
|
|
31
|
-
template: [
|
|
32
|
-
{
|
|
33
|
-
type: "instance",
|
|
34
|
-
component: "Textarea",
|
|
35
|
-
styles: [
|
|
36
|
-
// flex min-h-[80px] w-full rounded-md
|
|
37
|
-
// border border-input bg-background
|
|
38
|
-
// px-3 py-2 text-sm ring-offset-background
|
|
39
|
-
// placeholder:text-muted-foreground
|
|
40
|
-
// focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
|
|
41
|
-
// focus-visible:ring-offset-2
|
|
42
|
-
// disabled:cursor-not-allowed disabled:opacity-50
|
|
43
|
-
tc.flex(),
|
|
44
|
-
tc.minH(20),
|
|
45
|
-
tc.w("full"),
|
|
46
|
-
tc.rounded("md"),
|
|
47
|
-
tc.border(),
|
|
48
|
-
tc.border("input"),
|
|
49
|
-
tc.bg("background"),
|
|
50
|
-
tc.px(3),
|
|
51
|
-
tc.py(2),
|
|
52
|
-
tc.text("sm"),
|
|
53
|
-
tc.state(tc.text("mutedForeground"), "::placeholder"),
|
|
54
|
-
tc.focusVisible(
|
|
55
|
-
[tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()
|
|
56
|
-
),
|
|
57
|
-
tc.disabled([tc.cursor("not-allowed"), tc.opacity(50)].flat())
|
|
58
|
-
].flat(),
|
|
59
|
-
children: []
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
};
|
|
63
|
-
const propsMeta = {
|
|
64
|
-
props,
|
|
65
|
-
initialProps: ["id", "name", "placeholder", "required", "autoFocus"]
|
|
66
|
-
};
|
|
67
|
-
export {
|
|
68
|
-
meta,
|
|
69
|
-
propsMeta
|
|
70
|
-
};
|
package/lib/types/button.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
type ButtonVariants = {
|
|
3
|
-
variant: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link";
|
|
4
|
-
size: "default" | "sm" | "lg" | "icon";
|
|
5
|
-
};
|
|
6
|
-
export declare const Button: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & ButtonVariants & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { StoryObj } from "@storybook/react";
|
|
3
|
-
import { Button as ButtonPrimitive } from "./button";
|
|
4
|
-
declare const _default: {
|
|
5
|
-
title: string;
|
|
6
|
-
component: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
7
|
-
variant: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost";
|
|
8
|
-
size: "default" | "icon" | "sm" | "lg";
|
|
9
|
-
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
10
|
-
argTypes: {
|
|
11
|
-
variant: {
|
|
12
|
-
options: string[];
|
|
13
|
-
control: {
|
|
14
|
-
type: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export default _default;
|
|
20
|
-
export declare const Button: StoryObj<typeof ButtonPrimitive>;
|
package/lib/types/button.ws.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { EmbedTemplateInstance, type WsComponentMeta, type WsComponentPropsMeta } from "@webstudio-is/react-sdk";
|
|
2
|
-
export declare const template: (props?: {
|
|
3
|
-
props?: EmbedTemplateInstance["props"];
|
|
4
|
-
children?: WsComponentMeta["template"];
|
|
5
|
-
} | undefined) => NonNullable<WsComponentMeta["template"]>;
|
|
6
|
-
export declare const meta: WsComponentMeta;
|
|
7
|
-
export declare const propsMeta: WsComponentPropsMeta;
|
package/lib/types/input.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { StoryObj } from "@storybook/react";
|
|
3
|
-
import { Input as InputPrimitive } from "./input";
|
|
4
|
-
declare const _default: {
|
|
5
|
-
title: string;
|
|
6
|
-
component: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
7
|
-
argTypes: {
|
|
8
|
-
placeholder: {
|
|
9
|
-
type: "string";
|
|
10
|
-
};
|
|
11
|
-
type: {
|
|
12
|
-
options: string[];
|
|
13
|
-
control: {
|
|
14
|
-
type: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export default _default;
|
|
20
|
-
export declare const Input: StoryObj<typeof InputPrimitive>;
|
package/lib/types/input.ws.d.ts
DELETED
package/lib/types/textarea.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const Textarea: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { StoryObj } from "@storybook/react";
|
|
3
|
-
import { Textarea as TextareaPrimitive } from "./textarea";
|
|
4
|
-
declare const _default: {
|
|
5
|
-
title: string;
|
|
6
|
-
component: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
7
|
-
argTypes: {
|
|
8
|
-
placeholder: {
|
|
9
|
-
type: "string";
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export default _default;
|
|
14
|
-
export declare const Textarea: StoryObj<typeof TextareaPrimitive>;
|
package/src/button.tsx
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/display-name */
|
|
2
|
-
// We can't use .displayName until this is merged https://github.com/styleguidist/react-docgen-typescript/pull/449
|
|
3
|
-
|
|
4
|
-
import { forwardRef, type ComponentPropsWithoutRef } from "react";
|
|
5
|
-
|
|
6
|
-
type ButtonVariants = {
|
|
7
|
-
variant:
|
|
8
|
-
| "default"
|
|
9
|
-
| "destructive"
|
|
10
|
-
| "outline"
|
|
11
|
-
| "secondary"
|
|
12
|
-
| "ghost"
|
|
13
|
-
| "link";
|
|
14
|
-
|
|
15
|
-
size: "default" | "sm" | "lg" | "icon";
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const Button = forwardRef<
|
|
19
|
-
HTMLButtonElement,
|
|
20
|
-
ComponentPropsWithoutRef<"button"> & ButtonVariants
|
|
21
|
-
>(({ variant = "default", size = "default", ...props }, ref) => {
|
|
22
|
-
return (
|
|
23
|
-
<button ref={ref} data-size={size} data-variant={variant} {...props} />
|
|
24
|
-
);
|
|
25
|
-
});
|