@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/switch.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var switch_exports = {};
|
|
20
|
-
__export(switch_exports, {
|
|
21
|
-
Switch: () => Switch,
|
|
22
|
-
SwitchThumb: () => SwitchThumb
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(switch_exports);
|
|
25
|
-
var import_react_switch = require("@radix-ui/react-switch");
|
|
26
|
-
const Switch = import_react_switch.Root;
|
|
27
|
-
const SwitchThumb = import_react_switch.Thumb;
|
package/lib/cjs/switch.ws.js
DELETED
|
@@ -1,173 +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 switch_ws_exports = {};
|
|
30
|
-
__export(switch_ws_exports, {
|
|
31
|
-
metaSwitch: () => metaSwitch,
|
|
32
|
-
metaSwitchThumb: () => metaSwitchThumb,
|
|
33
|
-
propsMetaSwitch: () => propsMetaSwitch,
|
|
34
|
-
propsMetaSwitchThumb: () => propsMetaSwitchThumb
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(switch_ws_exports);
|
|
37
|
-
var import_svg = require("@webstudio-is/icons/svg");
|
|
38
|
-
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
39
|
-
var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
|
|
40
|
-
var tc = __toESM(require("./theme/tailwind-classes"), 1);
|
|
41
|
-
var import_styles = require("./theme/styles");
|
|
42
|
-
var import_switch = require("./__generated__/switch.props");
|
|
43
|
-
const metaSwitch = {
|
|
44
|
-
category: "radix",
|
|
45
|
-
order: 11,
|
|
46
|
-
type: "container",
|
|
47
|
-
description: "A control that allows the user to toggle between checked and not checked.",
|
|
48
|
-
icon: import_svg.SwitchIcon,
|
|
49
|
-
states: [
|
|
50
|
-
...import_react_sdk.defaultStates,
|
|
51
|
-
{
|
|
52
|
-
label: "Checked",
|
|
53
|
-
selector: "[data-state=checked]",
|
|
54
|
-
category: "component-states"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
label: "Unchecked",
|
|
58
|
-
selector: "[data-state=unchecked]",
|
|
59
|
-
category: "component-states"
|
|
60
|
-
}
|
|
61
|
-
],
|
|
62
|
-
presetStyle: {
|
|
63
|
-
button: [import_css_normalize.button, import_styles.buttonReset].flat()
|
|
64
|
-
},
|
|
65
|
-
template: [
|
|
66
|
-
{
|
|
67
|
-
type: "instance",
|
|
68
|
-
component: "Switch",
|
|
69
|
-
dataSources: {
|
|
70
|
-
switchChecked: { type: "variable", initialValue: false }
|
|
71
|
-
},
|
|
72
|
-
props: [
|
|
73
|
-
{
|
|
74
|
-
name: "checked",
|
|
75
|
-
type: "dataSource",
|
|
76
|
-
dataSourceName: "switchChecked"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
name: "onCheckedChange",
|
|
80
|
-
type: "action",
|
|
81
|
-
value: [
|
|
82
|
-
{
|
|
83
|
-
type: "execute",
|
|
84
|
-
args: ["checked"],
|
|
85
|
-
code: `switchChecked = checked`
|
|
86
|
-
}
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
// peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors
|
|
91
|
-
// focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background
|
|
92
|
-
// disabled:cursor-not-allowed disabled:opacity-50
|
|
93
|
-
// data-[state=checked]:bg-primary
|
|
94
|
-
// data-[state=unchecked]:bg-input
|
|
95
|
-
styles: [
|
|
96
|
-
// We are not supporting peer like styles yet
|
|
97
|
-
tc.inlineFlex(),
|
|
98
|
-
tc.property("height", "24px"),
|
|
99
|
-
tc.property("width", "44px"),
|
|
100
|
-
tc.shrink(0),
|
|
101
|
-
tc.cursor("pointer"),
|
|
102
|
-
tc.items("center"),
|
|
103
|
-
tc.rounded("full"),
|
|
104
|
-
tc.border(2),
|
|
105
|
-
tc.border("transparent"),
|
|
106
|
-
tc.transition("all"),
|
|
107
|
-
tc.focusVisible(
|
|
108
|
-
[tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()
|
|
109
|
-
),
|
|
110
|
-
tc.disabled([tc.cursor("not-allowed"), tc.opacity(50)].flat()),
|
|
111
|
-
tc.state([tc.bg("primary")].flat(), "[data-state=checked]"),
|
|
112
|
-
tc.state([tc.bg("input")].flat(), "[data-state=unchecked]")
|
|
113
|
-
].flat(),
|
|
114
|
-
children: [
|
|
115
|
-
{
|
|
116
|
-
type: "instance",
|
|
117
|
-
component: "SwitchThumb",
|
|
118
|
-
// pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform
|
|
119
|
-
// data-[state=checked]:translate-x-5
|
|
120
|
-
// data-[state=unchecked]:translate-x-0
|
|
121
|
-
styles: [
|
|
122
|
-
tc.pointerEvents("none"),
|
|
123
|
-
tc.block(),
|
|
124
|
-
tc.h(5),
|
|
125
|
-
tc.w(5),
|
|
126
|
-
tc.rounded("full"),
|
|
127
|
-
tc.bg("background"),
|
|
128
|
-
tc.shadow("lg"),
|
|
129
|
-
tc.transition("transform"),
|
|
130
|
-
tc.state(
|
|
131
|
-
[tc.property("transform", "translateX(20px)")].flat(),
|
|
132
|
-
"[data-state=checked]"
|
|
133
|
-
),
|
|
134
|
-
tc.state(
|
|
135
|
-
[tc.property("transform", "translateX(0px)")].flat(),
|
|
136
|
-
"[data-state=unchecked]"
|
|
137
|
-
)
|
|
138
|
-
].flat(),
|
|
139
|
-
children: []
|
|
140
|
-
}
|
|
141
|
-
]
|
|
142
|
-
}
|
|
143
|
-
]
|
|
144
|
-
};
|
|
145
|
-
const metaSwitchThumb = {
|
|
146
|
-
category: "hidden",
|
|
147
|
-
type: "container",
|
|
148
|
-
detachable: false,
|
|
149
|
-
icon: import_svg.TriggerIcon,
|
|
150
|
-
states: [
|
|
151
|
-
...import_react_sdk.defaultStates,
|
|
152
|
-
{
|
|
153
|
-
label: "Checked",
|
|
154
|
-
selector: "[data-state=checked]",
|
|
155
|
-
category: "component-states"
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
label: "Unchecked",
|
|
159
|
-
selector: "[data-state=unchecked]",
|
|
160
|
-
category: "component-states"
|
|
161
|
-
}
|
|
162
|
-
],
|
|
163
|
-
presetStyle: {
|
|
164
|
-
span: import_css_normalize.span
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
const propsMetaSwitch = {
|
|
168
|
-
props: import_switch.propsSwitch,
|
|
169
|
-
initialProps: ["id", "checked", "name", "required"]
|
|
170
|
-
};
|
|
171
|
-
const propsMetaSwitchThumb = {
|
|
172
|
-
props: import_switch.propsSwitchThumb
|
|
173
|
-
};
|
package/lib/cjs/tabs.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var tabs_exports = {};
|
|
20
|
-
__export(tabs_exports, {
|
|
21
|
-
Tabs: () => Tabs,
|
|
22
|
-
TabsContent: () => TabsContent,
|
|
23
|
-
TabsList: () => TabsList,
|
|
24
|
-
TabsTrigger: () => TabsTrigger,
|
|
25
|
-
hooksTabs: () => hooksTabs
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(tabs_exports);
|
|
28
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
-
var import_react = require("react");
|
|
30
|
-
var import_react_tabs = require("@radix-ui/react-tabs");
|
|
31
|
-
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
32
|
-
const Tabs = import_react_tabs.Root;
|
|
33
|
-
const TabsList = import_react_tabs.List;
|
|
34
|
-
const TabsTrigger = (0, import_react.forwardRef)(({ value, ...props }, ref) => {
|
|
35
|
-
const index = (0, import_react_sdk.getIndexWithinAncestorFromComponentProps)(props);
|
|
36
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_tabs.Trigger, { ref, value: value ?? index, ...props });
|
|
37
|
-
});
|
|
38
|
-
const TabsContent = (0, import_react.forwardRef)(({ value, ...props }, ref) => {
|
|
39
|
-
const index = (0, import_react_sdk.getIndexWithinAncestorFromComponentProps)(props);
|
|
40
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_tabs.Content, { ref, value: value ?? index, ...props });
|
|
41
|
-
});
|
|
42
|
-
const namespace = "@webstudio-is/sdk-components-react-radix";
|
|
43
|
-
const hooksTabs = {
|
|
44
|
-
onNavigatorSelect: (context, event) => {
|
|
45
|
-
for (const instance of event.instancePath) {
|
|
46
|
-
if (instance.component === `${namespace}:TabsContent`) {
|
|
47
|
-
const tabs = (0, import_react_sdk.getClosestInstance)(
|
|
48
|
-
event.instancePath,
|
|
49
|
-
instance,
|
|
50
|
-
`${namespace}:Tabs`
|
|
51
|
-
);
|
|
52
|
-
const contentValue = context.getPropValue(instance.id, "value") ?? context.indexesWithinAncestors.get(instance.id)?.toString();
|
|
53
|
-
if (tabs && contentValue) {
|
|
54
|
-
context.setPropVariable(tabs.id, "value", contentValue);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
};
|
package/lib/cjs/tabs.ws.js
DELETED
|
@@ -1,196 +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 tabs_ws_exports = {};
|
|
30
|
-
__export(tabs_ws_exports, {
|
|
31
|
-
metaTabs: () => metaTabs,
|
|
32
|
-
metaTabsContent: () => metaTabsContent,
|
|
33
|
-
metaTabsList: () => metaTabsList,
|
|
34
|
-
metaTabsTrigger: () => metaTabsTrigger,
|
|
35
|
-
propsMetaTabs: () => propsMetaTabs,
|
|
36
|
-
propsMetaTabsContent: () => propsMetaTabsContent,
|
|
37
|
-
propsMetaTabsList: () => propsMetaTabsList,
|
|
38
|
-
propsMetaTabsTrigger: () => propsMetaTabsTrigger
|
|
39
|
-
});
|
|
40
|
-
module.exports = __toCommonJS(tabs_ws_exports);
|
|
41
|
-
var import_svg = require("@webstudio-is/icons/svg");
|
|
42
|
-
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
43
|
-
var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
|
|
44
|
-
var tc = __toESM(require("./theme/tailwind-classes"), 1);
|
|
45
|
-
var import_styles = require("./theme/styles");
|
|
46
|
-
var import_tabs = require("./__generated__/tabs.props");
|
|
47
|
-
const presetStyle = {
|
|
48
|
-
div: import_css_normalize.div
|
|
49
|
-
};
|
|
50
|
-
const tabsTriggerStyles = [
|
|
51
|
-
tc.inlineFlex(),
|
|
52
|
-
tc.items("center"),
|
|
53
|
-
tc.justify("center"),
|
|
54
|
-
tc.whitespace("nowrap"),
|
|
55
|
-
tc.rounded("md"),
|
|
56
|
-
tc.px(3),
|
|
57
|
-
tc.py(1.5),
|
|
58
|
-
tc.text("sm"),
|
|
59
|
-
tc.font("medium"),
|
|
60
|
-
tc.transition("all"),
|
|
61
|
-
tc.focusVisible(
|
|
62
|
-
[tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()
|
|
63
|
-
),
|
|
64
|
-
tc.disabled([tc.pointerEvents("none"), tc.opacity(50)].flat()),
|
|
65
|
-
tc.state(
|
|
66
|
-
[tc.bg("background"), tc.text("foreground"), tc.shadow("sm")].flat(),
|
|
67
|
-
"[data-state=active]"
|
|
68
|
-
)
|
|
69
|
-
].flat();
|
|
70
|
-
const tabsContentStyles = [
|
|
71
|
-
tc.mt(2),
|
|
72
|
-
tc.focusVisible(
|
|
73
|
-
[tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()
|
|
74
|
-
)
|
|
75
|
-
].flat();
|
|
76
|
-
const metaTabs = {
|
|
77
|
-
category: "radix",
|
|
78
|
-
order: 2,
|
|
79
|
-
type: "container",
|
|
80
|
-
icon: import_svg.TabsIcon,
|
|
81
|
-
presetStyle,
|
|
82
|
-
description: "A set of panels with content that are displayed one at a time. Duplicate both a tab trigger and tab content to add more tabs. Triggers and content are connected according to their order in the Navigator.",
|
|
83
|
-
template: [
|
|
84
|
-
{
|
|
85
|
-
type: "instance",
|
|
86
|
-
component: "Tabs",
|
|
87
|
-
dataSources: {
|
|
88
|
-
tabsValue: { type: "variable", initialValue: "0" }
|
|
89
|
-
},
|
|
90
|
-
props: [
|
|
91
|
-
{ type: "dataSource", name: "value", dataSourceName: "tabsValue" },
|
|
92
|
-
{
|
|
93
|
-
name: "onValueChange",
|
|
94
|
-
type: "action",
|
|
95
|
-
value: [
|
|
96
|
-
{ type: "execute", args: ["value"], code: `tabsValue = value` }
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
],
|
|
100
|
-
children: [
|
|
101
|
-
{
|
|
102
|
-
type: "instance",
|
|
103
|
-
component: "TabsList",
|
|
104
|
-
// inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground
|
|
105
|
-
styles: [
|
|
106
|
-
tc.inlineFlex(),
|
|
107
|
-
tc.h(10),
|
|
108
|
-
tc.items("center"),
|
|
109
|
-
tc.justify("center"),
|
|
110
|
-
tc.rounded("md"),
|
|
111
|
-
tc.bg("muted"),
|
|
112
|
-
tc.p(1),
|
|
113
|
-
tc.text("mutedForeground")
|
|
114
|
-
].flat(),
|
|
115
|
-
children: [
|
|
116
|
-
{
|
|
117
|
-
type: "instance",
|
|
118
|
-
component: "TabsTrigger",
|
|
119
|
-
styles: tabsTriggerStyles,
|
|
120
|
-
children: [{ type: "text", value: "Account" }]
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
type: "instance",
|
|
124
|
-
component: "TabsTrigger",
|
|
125
|
-
styles: tabsTriggerStyles,
|
|
126
|
-
children: [{ type: "text", value: "Password" }]
|
|
127
|
-
}
|
|
128
|
-
]
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
type: "instance",
|
|
132
|
-
component: "TabsContent",
|
|
133
|
-
styles: tabsContentStyles,
|
|
134
|
-
children: [
|
|
135
|
-
{ type: "text", value: "Make changes to your account here." }
|
|
136
|
-
]
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
type: "instance",
|
|
140
|
-
component: "TabsContent",
|
|
141
|
-
styles: tabsContentStyles,
|
|
142
|
-
children: [{ type: "text", value: "Change your password here." }]
|
|
143
|
-
}
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
]
|
|
147
|
-
};
|
|
148
|
-
const metaTabsList = {
|
|
149
|
-
category: "hidden",
|
|
150
|
-
detachable: false,
|
|
151
|
-
type: "container",
|
|
152
|
-
icon: import_svg.HeaderIcon,
|
|
153
|
-
requiredAncestors: ["Tabs"],
|
|
154
|
-
presetStyle
|
|
155
|
-
};
|
|
156
|
-
const metaTabsTrigger = {
|
|
157
|
-
category: "hidden",
|
|
158
|
-
type: "container",
|
|
159
|
-
icon: import_svg.TriggerIcon,
|
|
160
|
-
requiredAncestors: ["TabsList"],
|
|
161
|
-
invalidAncestors: ["TabsTrigger"],
|
|
162
|
-
indexWithinAncestor: "Tabs",
|
|
163
|
-
label: "Tab Trigger",
|
|
164
|
-
states: [
|
|
165
|
-
...import_react_sdk.defaultStates,
|
|
166
|
-
{
|
|
167
|
-
category: "component-states",
|
|
168
|
-
label: "Active",
|
|
169
|
-
selector: "[data-state=active]"
|
|
170
|
-
}
|
|
171
|
-
],
|
|
172
|
-
presetStyle: {
|
|
173
|
-
button: [import_css_normalize.button, import_styles.buttonReset].flat()
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
const metaTabsContent = {
|
|
177
|
-
category: "hidden",
|
|
178
|
-
type: "container",
|
|
179
|
-
label: "Tab Content",
|
|
180
|
-
icon: import_svg.ContentIcon,
|
|
181
|
-
requiredAncestors: ["Tabs"],
|
|
182
|
-
indexWithinAncestor: "Tabs",
|
|
183
|
-
presetStyle
|
|
184
|
-
};
|
|
185
|
-
const propsMetaTabs = {
|
|
186
|
-
props: import_tabs.propsTabs
|
|
187
|
-
};
|
|
188
|
-
const propsMetaTabsList = {
|
|
189
|
-
props: import_tabs.propsTabsList
|
|
190
|
-
};
|
|
191
|
-
const propsMetaTabsTrigger = {
|
|
192
|
-
props: import_tabs.propsTabsTrigger
|
|
193
|
-
};
|
|
194
|
-
const propsMetaTabsContent = {
|
|
195
|
-
props: import_tabs.propsTabsContent
|
|
196
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var radix_common_types_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(radix_common_types_exports);
|
package/lib/cjs/theme/styles.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 styles_exports = {};
|
|
30
|
-
__export(styles_exports, {
|
|
31
|
-
buttonReset: () => buttonReset,
|
|
32
|
-
getButtonStyles: () => getButtonStyles
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(styles_exports);
|
|
35
|
-
var tc = __toESM(require("./tailwind-classes"), 1);
|
|
36
|
-
const getButtonStyles = (variant, size = "default") => {
|
|
37
|
-
const styles = [
|
|
38
|
-
// 'inline-flex items-center justify-center rounded-md text-sm font-medium
|
|
39
|
-
// ring-offset-background transition-colors
|
|
40
|
-
// focus-visible:outline-none focus-visible:ring-2
|
|
41
|
-
// focus-visible:ring-ring focus-visible:ring-offset-2
|
|
42
|
-
// disabled:pointer-events-none disabled:opacity-50'
|
|
43
|
-
tc.border(0),
|
|
44
|
-
tc.bg("transparent"),
|
|
45
|
-
tc.inlineFlex(),
|
|
46
|
-
tc.items("center"),
|
|
47
|
-
tc.justify("center"),
|
|
48
|
-
tc.rounded("md"),
|
|
49
|
-
tc.text("sm"),
|
|
50
|
-
tc.font("medium"),
|
|
51
|
-
tc.focusVisible(
|
|
52
|
-
[tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()
|
|
53
|
-
),
|
|
54
|
-
tc.state([tc.pointerEvents("none"), tc.opacity(50)].flat(), ":disabled")
|
|
55
|
-
].flat();
|
|
56
|
-
let variantStyles = [];
|
|
57
|
-
if (variant === "ghost") {
|
|
58
|
-
variantStyles = [
|
|
59
|
-
tc.state([tc.bg("accent"), tc.text("accentForeground")].flat(), ":hover")
|
|
60
|
-
].flat();
|
|
61
|
-
}
|
|
62
|
-
if (variant === "outline") {
|
|
63
|
-
variantStyles = [
|
|
64
|
-
tc.border(),
|
|
65
|
-
tc.border("input"),
|
|
66
|
-
tc.bg("background"),
|
|
67
|
-
tc.state(
|
|
68
|
-
[tc.bg("accent", 90), tc.text("accentForeground")].flat(),
|
|
69
|
-
":hover"
|
|
70
|
-
)
|
|
71
|
-
].flat();
|
|
72
|
-
}
|
|
73
|
-
let sizeStyles = [];
|
|
74
|
-
if (size === "icon") {
|
|
75
|
-
sizeStyles = [tc.h(10), tc.w(10)].flat();
|
|
76
|
-
}
|
|
77
|
-
if (size === "sm") {
|
|
78
|
-
sizeStyles = [tc.h(10), tc.px(3)].flat();
|
|
79
|
-
}
|
|
80
|
-
if (size === "default") {
|
|
81
|
-
sizeStyles = [tc.h(10), tc.px(4), tc.py(2)].flat();
|
|
82
|
-
}
|
|
83
|
-
return [...styles, ...variantStyles, ...sizeStyles];
|
|
84
|
-
};
|
|
85
|
-
const buttonReset = [
|
|
86
|
-
{
|
|
87
|
-
property: "backgroundColor",
|
|
88
|
-
value: { type: "keyword", value: "transparent" }
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
property: "backgroundImage",
|
|
92
|
-
value: { type: "keyword", value: "none" }
|
|
93
|
-
},
|
|
94
|
-
tc.border(0),
|
|
95
|
-
tc.p(0)
|
|
96
|
-
].flat();
|