@webstudio-is/sdk-components-react-radix 0.89.0 → 0.91.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/accordion.ws.js +20 -9
- package/lib/cjs/accordion.ws.js +18 -9
- package/lib/cjs/dialog.ws.js +19 -5
- package/lib/cjs/sheet.ws.js +15 -1
- package/lib/cjs/tabs.ws.js +11 -2
- package/lib/cjs/theme/styles.js +0 -4
- package/lib/dialog.ws.js +23 -7
- package/lib/sheet.ws.js +16 -2
- package/lib/tabs.ws.js +13 -2
- package/lib/theme/styles.js +0 -4
- package/lib/types/accordion.ws.d.ts +1 -1
- package/lib/types/tabs.ws.d.ts +1 -1
- package/package.json +6 -6
- package/src/accordion.ws.ts +20 -11
- package/src/dialog.ws.tsx +22 -7
- package/src/sheet.ws.tsx +16 -2
- package/src/tabs.ws.ts +15 -6
- package/src/theme/styles.ts +0 -4
package/lib/accordion.ws.js
CHANGED
|
@@ -6,6 +6,9 @@ import {
|
|
|
6
6
|
ContentIcon,
|
|
7
7
|
ChevronDownIcon
|
|
8
8
|
} from "@webstudio-is/icons/svg";
|
|
9
|
+
import {
|
|
10
|
+
defaultStates
|
|
11
|
+
} from "@webstudio-is/react-sdk";
|
|
9
12
|
import { div, h3, button } from "@webstudio-is/react-sdk/css-normalize";
|
|
10
13
|
import * as tc from "./theme/tailwind-classes";
|
|
11
14
|
import { buttonReset } from "./theme/styles";
|
|
@@ -192,46 +195,54 @@ const metaAccordion = {
|
|
|
192
195
|
const metaAccordionItem = {
|
|
193
196
|
category: "hidden",
|
|
194
197
|
type: "container",
|
|
198
|
+
label: "Item",
|
|
195
199
|
icon: ItemIcon,
|
|
196
200
|
requiredAncestors: ["Accordion"],
|
|
197
201
|
indexWithinAncestor: "Accordion",
|
|
198
|
-
presetStyle
|
|
199
|
-
label: "Item"
|
|
202
|
+
presetStyle
|
|
200
203
|
};
|
|
201
204
|
const metaAccordionHeader = {
|
|
202
205
|
category: "hidden",
|
|
203
206
|
type: "container",
|
|
207
|
+
label: "Item Header",
|
|
204
208
|
icon: HeaderIcon,
|
|
205
209
|
requiredAncestors: ["AccordionItem"],
|
|
206
210
|
detachable: false,
|
|
207
211
|
presetStyle: {
|
|
208
212
|
h3: [h3, tc.my(0)].flat()
|
|
209
|
-
}
|
|
210
|
-
label: "Item Header"
|
|
213
|
+
}
|
|
211
214
|
};
|
|
212
215
|
const metaAccordionTrigger = {
|
|
213
216
|
category: "hidden",
|
|
214
217
|
type: "container",
|
|
218
|
+
label: "Item Trigger",
|
|
215
219
|
icon: TriggerIcon,
|
|
216
220
|
requiredAncestors: ["AccordionHeader"],
|
|
217
221
|
detachable: false,
|
|
222
|
+
states: [
|
|
223
|
+
...defaultStates,
|
|
224
|
+
{
|
|
225
|
+
category: "component-states",
|
|
226
|
+
label: "Open",
|
|
227
|
+
selector: "[data-state=open]"
|
|
228
|
+
}
|
|
229
|
+
],
|
|
218
230
|
presetStyle: {
|
|
219
231
|
button: [button, buttonReset].flat()
|
|
220
|
-
}
|
|
221
|
-
label: "Item Trigger"
|
|
232
|
+
}
|
|
222
233
|
};
|
|
223
234
|
const metaAccordionContent = {
|
|
224
235
|
category: "hidden",
|
|
225
236
|
type: "container",
|
|
237
|
+
label: "Item Content",
|
|
226
238
|
icon: ContentIcon,
|
|
227
239
|
requiredAncestors: ["AccordionItem"],
|
|
228
240
|
detachable: false,
|
|
229
|
-
presetStyle
|
|
230
|
-
label: "Item Content"
|
|
241
|
+
presetStyle
|
|
231
242
|
};
|
|
232
243
|
const propsMetaAccordion = {
|
|
233
244
|
props: propsAccordion,
|
|
234
|
-
initialProps: ["value", "collapsible"
|
|
245
|
+
initialProps: ["value", "collapsible"]
|
|
235
246
|
};
|
|
236
247
|
const propsMetaAccordionItem = {
|
|
237
248
|
props: propsAccordionItem
|
package/lib/cjs/accordion.ws.js
CHANGED
|
@@ -41,6 +41,7 @@ __export(accordion_ws_exports, {
|
|
|
41
41
|
});
|
|
42
42
|
module.exports = __toCommonJS(accordion_ws_exports);
|
|
43
43
|
var import_svg = require("@webstudio-is/icons/svg");
|
|
44
|
+
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
44
45
|
var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
|
|
45
46
|
var tc = __toESM(require("./theme/tailwind-classes"), 1);
|
|
46
47
|
var import_styles = require("./theme/styles");
|
|
@@ -221,46 +222,54 @@ const metaAccordion = {
|
|
|
221
222
|
const metaAccordionItem = {
|
|
222
223
|
category: "hidden",
|
|
223
224
|
type: "container",
|
|
225
|
+
label: "Item",
|
|
224
226
|
icon: import_svg.ItemIcon,
|
|
225
227
|
requiredAncestors: ["Accordion"],
|
|
226
228
|
indexWithinAncestor: "Accordion",
|
|
227
|
-
presetStyle
|
|
228
|
-
label: "Item"
|
|
229
|
+
presetStyle
|
|
229
230
|
};
|
|
230
231
|
const metaAccordionHeader = {
|
|
231
232
|
category: "hidden",
|
|
232
233
|
type: "container",
|
|
234
|
+
label: "Item Header",
|
|
233
235
|
icon: import_svg.HeaderIcon,
|
|
234
236
|
requiredAncestors: ["AccordionItem"],
|
|
235
237
|
detachable: false,
|
|
236
238
|
presetStyle: {
|
|
237
239
|
h3: [import_css_normalize.h3, tc.my(0)].flat()
|
|
238
|
-
}
|
|
239
|
-
label: "Item Header"
|
|
240
|
+
}
|
|
240
241
|
};
|
|
241
242
|
const metaAccordionTrigger = {
|
|
242
243
|
category: "hidden",
|
|
243
244
|
type: "container",
|
|
245
|
+
label: "Item Trigger",
|
|
244
246
|
icon: import_svg.TriggerIcon,
|
|
245
247
|
requiredAncestors: ["AccordionHeader"],
|
|
246
248
|
detachable: false,
|
|
249
|
+
states: [
|
|
250
|
+
...import_react_sdk.defaultStates,
|
|
251
|
+
{
|
|
252
|
+
category: "component-states",
|
|
253
|
+
label: "Open",
|
|
254
|
+
selector: "[data-state=open]"
|
|
255
|
+
}
|
|
256
|
+
],
|
|
247
257
|
presetStyle: {
|
|
248
258
|
button: [import_css_normalize.button, import_styles.buttonReset].flat()
|
|
249
|
-
}
|
|
250
|
-
label: "Item Trigger"
|
|
259
|
+
}
|
|
251
260
|
};
|
|
252
261
|
const metaAccordionContent = {
|
|
253
262
|
category: "hidden",
|
|
254
263
|
type: "container",
|
|
264
|
+
label: "Item Content",
|
|
255
265
|
icon: import_svg.ContentIcon,
|
|
256
266
|
requiredAncestors: ["AccordionItem"],
|
|
257
267
|
detachable: false,
|
|
258
|
-
presetStyle
|
|
259
|
-
label: "Item Content"
|
|
268
|
+
presetStyle
|
|
260
269
|
};
|
|
261
270
|
const propsMetaAccordion = {
|
|
262
271
|
props: import_accordion.propsAccordion,
|
|
263
|
-
initialProps: ["value", "collapsible"
|
|
272
|
+
initialProps: ["value", "collapsible"]
|
|
264
273
|
};
|
|
265
274
|
const propsMetaAccordionItem = {
|
|
266
275
|
props: import_accordion.propsAccordionItem
|
package/lib/cjs/dialog.ws.js
CHANGED
|
@@ -53,9 +53,6 @@ var import_styles = require("./theme/styles");
|
|
|
53
53
|
const presetStyle = {
|
|
54
54
|
div: import_css_normalize.div
|
|
55
55
|
};
|
|
56
|
-
const buttonPresetStyle = {
|
|
57
|
-
button: import_css_normalize.button
|
|
58
|
-
};
|
|
59
56
|
const titlePresetStyle = {
|
|
60
57
|
h2: import_css_normalize.h2
|
|
61
58
|
};
|
|
@@ -98,7 +95,10 @@ const metaDialogDescription = {
|
|
|
98
95
|
const metaDialogClose = {
|
|
99
96
|
category: "hidden",
|
|
100
97
|
type: "container",
|
|
101
|
-
presetStyle:
|
|
98
|
+
presetStyle: {
|
|
99
|
+
button: [import_styles.buttonReset, import_css_normalize.button].flat()
|
|
100
|
+
},
|
|
101
|
+
states: import_react_sdk.defaultStates,
|
|
102
102
|
icon: import_svg.ButtonElementIcon,
|
|
103
103
|
label: "Close Button"
|
|
104
104
|
};
|
|
@@ -262,7 +262,21 @@ const metaDialog = {
|
|
|
262
262
|
tc.hover(tc.opacity(100)),
|
|
263
263
|
tc.focus(tc.ring("ring", 2, "background", 2))
|
|
264
264
|
].flat(),
|
|
265
|
-
children: [
|
|
265
|
+
children: [
|
|
266
|
+
{
|
|
267
|
+
type: "instance",
|
|
268
|
+
component: "HtmlEmbed",
|
|
269
|
+
label: "Close Icon",
|
|
270
|
+
props: [
|
|
271
|
+
{
|
|
272
|
+
type: "string",
|
|
273
|
+
name: "code",
|
|
274
|
+
value: import_svg.LargeXIcon
|
|
275
|
+
}
|
|
276
|
+
],
|
|
277
|
+
children: []
|
|
278
|
+
}
|
|
279
|
+
]
|
|
266
280
|
}
|
|
267
281
|
]
|
|
268
282
|
}
|
package/lib/cjs/sheet.ws.js
CHANGED
|
@@ -231,7 +231,21 @@ const meta = {
|
|
|
231
231
|
tc.hover(tc.opacity(100)),
|
|
232
232
|
tc.focus(tc.ring("ring", 2, "background", 2))
|
|
233
233
|
].flat(),
|
|
234
|
-
children: [
|
|
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
|
+
]
|
|
235
249
|
}
|
|
236
250
|
]
|
|
237
251
|
}
|
package/lib/cjs/tabs.ws.js
CHANGED
|
@@ -39,6 +39,7 @@ __export(tabs_ws_exports, {
|
|
|
39
39
|
});
|
|
40
40
|
module.exports = __toCommonJS(tabs_ws_exports);
|
|
41
41
|
var import_svg = require("@webstudio-is/icons/svg");
|
|
42
|
+
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
42
43
|
var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
|
|
43
44
|
var tc = __toESM(require("./theme/tailwind-classes"), 1);
|
|
44
45
|
var import_styles = require("./theme/styles");
|
|
@@ -160,6 +161,14 @@ const metaTabsTrigger = {
|
|
|
160
161
|
invalidAncestors: ["TabsTrigger"],
|
|
161
162
|
indexWithinAncestor: "Tabs",
|
|
162
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
|
+
],
|
|
163
172
|
presetStyle: {
|
|
164
173
|
button: [import_css_normalize.button, import_styles.buttonReset].flat()
|
|
165
174
|
}
|
|
@@ -167,11 +176,11 @@ const metaTabsTrigger = {
|
|
|
167
176
|
const metaTabsContent = {
|
|
168
177
|
category: "hidden",
|
|
169
178
|
type: "container",
|
|
179
|
+
label: "Tab Content",
|
|
170
180
|
icon: import_svg.ContentIcon,
|
|
171
181
|
requiredAncestors: ["Tabs"],
|
|
172
182
|
indexWithinAncestor: "Tabs",
|
|
173
|
-
presetStyle
|
|
174
|
-
label: "Tab Content"
|
|
183
|
+
presetStyle
|
|
175
184
|
};
|
|
176
185
|
const propsMetaTabs = {
|
|
177
186
|
props: import_tabs.propsTabs
|
package/lib/cjs/theme/styles.js
CHANGED
package/lib/dialog.ws.js
CHANGED
|
@@ -5,9 +5,11 @@ import {
|
|
|
5
5
|
OverlayIcon,
|
|
6
6
|
HeadingIcon,
|
|
7
7
|
TextIcon,
|
|
8
|
-
ButtonElementIcon
|
|
8
|
+
ButtonElementIcon,
|
|
9
|
+
LargeXIcon
|
|
9
10
|
} from "@webstudio-is/icons/svg";
|
|
10
11
|
import {
|
|
12
|
+
defaultStates
|
|
11
13
|
} from "@webstudio-is/react-sdk";
|
|
12
14
|
import { div, button, h2, p } from "@webstudio-is/react-sdk/css-normalize";
|
|
13
15
|
import * as tc from "./theme/tailwind-classes";
|
|
@@ -20,13 +22,10 @@ import {
|
|
|
20
22
|
propsDialogTitle,
|
|
21
23
|
propsDialogDescription
|
|
22
24
|
} from "./__generated__/dialog.props";
|
|
23
|
-
import { getButtonStyles } from "./theme/styles";
|
|
25
|
+
import { buttonReset, getButtonStyles } from "./theme/styles";
|
|
24
26
|
const presetStyle = {
|
|
25
27
|
div
|
|
26
28
|
};
|
|
27
|
-
const buttonPresetStyle = {
|
|
28
|
-
button
|
|
29
|
-
};
|
|
30
29
|
const titlePresetStyle = {
|
|
31
30
|
h2
|
|
32
31
|
};
|
|
@@ -69,7 +68,10 @@ const metaDialogDescription = {
|
|
|
69
68
|
const metaDialogClose = {
|
|
70
69
|
category: "hidden",
|
|
71
70
|
type: "container",
|
|
72
|
-
presetStyle:
|
|
71
|
+
presetStyle: {
|
|
72
|
+
button: [buttonReset, button].flat()
|
|
73
|
+
},
|
|
74
|
+
states: defaultStates,
|
|
73
75
|
icon: ButtonElementIcon,
|
|
74
76
|
label: "Close Button"
|
|
75
77
|
};
|
|
@@ -233,7 +235,21 @@ const metaDialog = {
|
|
|
233
235
|
tc.hover(tc.opacity(100)),
|
|
234
236
|
tc.focus(tc.ring("ring", 2, "background", 2))
|
|
235
237
|
].flat(),
|
|
236
|
-
children: [
|
|
238
|
+
children: [
|
|
239
|
+
{
|
|
240
|
+
type: "instance",
|
|
241
|
+
component: "HtmlEmbed",
|
|
242
|
+
label: "Close Icon",
|
|
243
|
+
props: [
|
|
244
|
+
{
|
|
245
|
+
type: "string",
|
|
246
|
+
name: "code",
|
|
247
|
+
value: LargeXIcon
|
|
248
|
+
}
|
|
249
|
+
],
|
|
250
|
+
children: []
|
|
251
|
+
}
|
|
252
|
+
]
|
|
237
253
|
}
|
|
238
254
|
]
|
|
239
255
|
}
|
package/lib/sheet.ws.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HamburgerMenuIcon } from "@webstudio-is/icons/svg";
|
|
1
|
+
import { HamburgerMenuIcon, LargeXIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import * as tc from "./theme/tailwind-classes";
|
|
3
3
|
import { getButtonStyles } from "./theme/styles";
|
|
4
4
|
const meta = {
|
|
@@ -198,7 +198,21 @@ const meta = {
|
|
|
198
198
|
tc.hover(tc.opacity(100)),
|
|
199
199
|
tc.focus(tc.ring("ring", 2, "background", 2))
|
|
200
200
|
].flat(),
|
|
201
|
-
children: [
|
|
201
|
+
children: [
|
|
202
|
+
{
|
|
203
|
+
type: "instance",
|
|
204
|
+
component: "HtmlEmbed",
|
|
205
|
+
label: "Close Icon",
|
|
206
|
+
props: [
|
|
207
|
+
{
|
|
208
|
+
type: "string",
|
|
209
|
+
name: "code",
|
|
210
|
+
value: LargeXIcon
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
children: []
|
|
214
|
+
}
|
|
215
|
+
]
|
|
202
216
|
}
|
|
203
217
|
]
|
|
204
218
|
}
|
package/lib/tabs.ws.js
CHANGED
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
TabsIcon,
|
|
5
5
|
TriggerIcon
|
|
6
6
|
} from "@webstudio-is/icons/svg";
|
|
7
|
+
import {
|
|
8
|
+
defaultStates
|
|
9
|
+
} from "@webstudio-is/react-sdk";
|
|
7
10
|
import { button, div } from "@webstudio-is/react-sdk/css-normalize";
|
|
8
11
|
import * as tc from "./theme/tailwind-classes";
|
|
9
12
|
import { buttonReset } from "./theme/styles";
|
|
@@ -130,6 +133,14 @@ const metaTabsTrigger = {
|
|
|
130
133
|
invalidAncestors: ["TabsTrigger"],
|
|
131
134
|
indexWithinAncestor: "Tabs",
|
|
132
135
|
label: "Tab Trigger",
|
|
136
|
+
states: [
|
|
137
|
+
...defaultStates,
|
|
138
|
+
{
|
|
139
|
+
category: "component-states",
|
|
140
|
+
label: "Active",
|
|
141
|
+
selector: "[data-state=active]"
|
|
142
|
+
}
|
|
143
|
+
],
|
|
133
144
|
presetStyle: {
|
|
134
145
|
button: [button, buttonReset].flat()
|
|
135
146
|
}
|
|
@@ -137,11 +148,11 @@ const metaTabsTrigger = {
|
|
|
137
148
|
const metaTabsContent = {
|
|
138
149
|
category: "hidden",
|
|
139
150
|
type: "container",
|
|
151
|
+
label: "Tab Content",
|
|
140
152
|
icon: ContentIcon,
|
|
141
153
|
requiredAncestors: ["Tabs"],
|
|
142
154
|
indexWithinAncestor: "Tabs",
|
|
143
|
-
presetStyle
|
|
144
|
-
label: "Tab Content"
|
|
155
|
+
presetStyle
|
|
145
156
|
};
|
|
146
157
|
const propsMetaTabs = {
|
|
147
158
|
props: propsTabs
|
package/lib/theme/styles.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type WsComponentMeta, type WsComponentPropsMeta } from "@webstudio-is/react-sdk";
|
|
2
2
|
export declare const metaAccordion: WsComponentMeta;
|
|
3
3
|
export declare const metaAccordionItem: WsComponentMeta;
|
|
4
4
|
export declare const metaAccordionHeader: WsComponentMeta;
|
package/lib/types/tabs.ws.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type WsComponentMeta, type WsComponentPropsMeta } from "@webstudio-is/react-sdk";
|
|
2
2
|
export declare const metaTabs: WsComponentMeta;
|
|
3
3
|
export declare const metaTabsList: WsComponentMeta;
|
|
4
4
|
export declare const metaTabsTrigger: WsComponentMeta;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk-components-react-radix",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.91.0",
|
|
4
4
|
"description": "Webstudio wrapper for radix library",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"@radix-ui/react-tabs": "^1.0.4",
|
|
57
57
|
"@radix-ui/react-tooltip": "^1.0.6",
|
|
58
58
|
"tailwindcss": "^3.3.3",
|
|
59
|
-
"@webstudio-is/css-data": "^0.
|
|
60
|
-
"@webstudio-is/generate-arg-types": "^0.
|
|
61
|
-
"@webstudio-is/icons": "^0.
|
|
62
|
-
"@webstudio-is/react-sdk": "^0.
|
|
59
|
+
"@webstudio-is/css-data": "^0.91.0",
|
|
60
|
+
"@webstudio-is/generate-arg-types": "^0.91.0",
|
|
61
|
+
"@webstudio-is/icons": "^0.91.0",
|
|
62
|
+
"@webstudio-is/react-sdk": "^0.91.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@storybook/react": "^7.2.1",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"react-dom": "^18.2.0",
|
|
70
70
|
"typescript": "^5.1.6",
|
|
71
71
|
"@webstudio-is/scripts": "^0.0.0",
|
|
72
|
-
"@webstudio-is/sdk-components-react": "^0.
|
|
72
|
+
"@webstudio-is/sdk-components-react": "^0.91.0",
|
|
73
73
|
"@webstudio-is/storybook-config": "^0.0.0",
|
|
74
74
|
"@webstudio-is/tsconfig": "^1.0.7"
|
|
75
75
|
},
|
package/src/accordion.ws.ts
CHANGED
|
@@ -6,12 +6,13 @@ import {
|
|
|
6
6
|
ContentIcon,
|
|
7
7
|
ChevronDownIcon,
|
|
8
8
|
} from "@webstudio-is/icons/svg";
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
import {
|
|
10
|
+
defaultStates,
|
|
11
|
+
type EmbedTemplateStyleDecl,
|
|
12
|
+
type PresetStyle,
|
|
13
|
+
type WsComponentMeta,
|
|
14
|
+
type WsComponentPropsMeta,
|
|
15
|
+
type WsEmbedTemplate,
|
|
15
16
|
} from "@webstudio-is/react-sdk";
|
|
16
17
|
import { div, h3, button } from "@webstudio-is/react-sdk/css-normalize";
|
|
17
18
|
import * as tc from "./theme/tailwind-classes";
|
|
@@ -224,50 +225,58 @@ export const metaAccordion: WsComponentMeta = {
|
|
|
224
225
|
export const metaAccordionItem: WsComponentMeta = {
|
|
225
226
|
category: "hidden",
|
|
226
227
|
type: "container",
|
|
228
|
+
label: "Item",
|
|
227
229
|
icon: ItemIcon,
|
|
228
230
|
requiredAncestors: ["Accordion"],
|
|
229
231
|
indexWithinAncestor: "Accordion",
|
|
230
232
|
presetStyle,
|
|
231
|
-
label: "Item",
|
|
232
233
|
};
|
|
233
234
|
|
|
234
235
|
export const metaAccordionHeader: WsComponentMeta = {
|
|
235
236
|
category: "hidden",
|
|
236
237
|
type: "container",
|
|
238
|
+
label: "Item Header",
|
|
237
239
|
icon: HeaderIcon,
|
|
238
240
|
requiredAncestors: ["AccordionItem"],
|
|
239
241
|
detachable: false,
|
|
240
242
|
presetStyle: {
|
|
241
243
|
h3: [h3, tc.my(0)].flat(),
|
|
242
244
|
},
|
|
243
|
-
label: "Item Header",
|
|
244
245
|
};
|
|
245
246
|
|
|
246
247
|
export const metaAccordionTrigger: WsComponentMeta = {
|
|
247
248
|
category: "hidden",
|
|
248
249
|
type: "container",
|
|
250
|
+
label: "Item Trigger",
|
|
249
251
|
icon: TriggerIcon,
|
|
250
252
|
requiredAncestors: ["AccordionHeader"],
|
|
251
253
|
detachable: false,
|
|
254
|
+
states: [
|
|
255
|
+
...defaultStates,
|
|
256
|
+
{
|
|
257
|
+
category: "component-states",
|
|
258
|
+
label: "Open",
|
|
259
|
+
selector: "[data-state=open]",
|
|
260
|
+
},
|
|
261
|
+
],
|
|
252
262
|
presetStyle: {
|
|
253
263
|
button: [button, buttonReset].flat(),
|
|
254
264
|
},
|
|
255
|
-
label: "Item Trigger",
|
|
256
265
|
};
|
|
257
266
|
|
|
258
267
|
export const metaAccordionContent: WsComponentMeta = {
|
|
259
268
|
category: "hidden",
|
|
260
269
|
type: "container",
|
|
270
|
+
label: "Item Content",
|
|
261
271
|
icon: ContentIcon,
|
|
262
272
|
requiredAncestors: ["AccordionItem"],
|
|
263
273
|
detachable: false,
|
|
264
274
|
presetStyle,
|
|
265
|
-
label: "Item Content",
|
|
266
275
|
};
|
|
267
276
|
|
|
268
277
|
export const propsMetaAccordion: WsComponentPropsMeta = {
|
|
269
278
|
props: propsAccordion,
|
|
270
|
-
initialProps: ["value", "collapsible"
|
|
279
|
+
initialProps: ["value", "collapsible"],
|
|
271
280
|
};
|
|
272
281
|
|
|
273
282
|
export const propsMetaAccordionItem: WsComponentPropsMeta = {
|
package/src/dialog.ws.tsx
CHANGED
|
@@ -6,8 +6,10 @@ import {
|
|
|
6
6
|
HeadingIcon,
|
|
7
7
|
TextIcon,
|
|
8
8
|
ButtonElementIcon,
|
|
9
|
+
LargeXIcon,
|
|
9
10
|
} from "@webstudio-is/icons/svg";
|
|
10
11
|
import {
|
|
12
|
+
defaultStates,
|
|
11
13
|
type PresetStyle,
|
|
12
14
|
type WsComponentMeta,
|
|
13
15
|
type WsComponentPropsMeta,
|
|
@@ -23,16 +25,12 @@ import {
|
|
|
23
25
|
propsDialogTitle,
|
|
24
26
|
propsDialogDescription,
|
|
25
27
|
} from "./__generated__/dialog.props";
|
|
26
|
-
import { getButtonStyles } from "./theme/styles";
|
|
28
|
+
import { buttonReset, getButtonStyles } from "./theme/styles";
|
|
27
29
|
|
|
28
30
|
const presetStyle = {
|
|
29
31
|
div,
|
|
30
32
|
} satisfies PresetStyle<"div">;
|
|
31
33
|
|
|
32
|
-
const buttonPresetStyle = {
|
|
33
|
-
button,
|
|
34
|
-
} satisfies PresetStyle<"button">;
|
|
35
|
-
|
|
36
34
|
const titlePresetStyle = {
|
|
37
35
|
h2,
|
|
38
36
|
} satisfies PresetStyle<"h2">;
|
|
@@ -83,7 +81,10 @@ export const metaDialogDescription: WsComponentMeta = {
|
|
|
83
81
|
export const metaDialogClose: WsComponentMeta = {
|
|
84
82
|
category: "hidden",
|
|
85
83
|
type: "container",
|
|
86
|
-
presetStyle:
|
|
84
|
+
presetStyle: {
|
|
85
|
+
button: [buttonReset, button].flat(),
|
|
86
|
+
},
|
|
87
|
+
states: defaultStates,
|
|
87
88
|
icon: ButtonElementIcon,
|
|
88
89
|
label: "Close Button",
|
|
89
90
|
};
|
|
@@ -259,7 +260,21 @@ export const metaDialog: WsComponentMeta = {
|
|
|
259
260
|
tc.hover(tc.opacity(100)),
|
|
260
261
|
tc.focus(tc.ring("ring", 2, "background", 2)),
|
|
261
262
|
].flat(),
|
|
262
|
-
children: [
|
|
263
|
+
children: [
|
|
264
|
+
{
|
|
265
|
+
type: "instance",
|
|
266
|
+
component: "HtmlEmbed",
|
|
267
|
+
label: "Close Icon",
|
|
268
|
+
props: [
|
|
269
|
+
{
|
|
270
|
+
type: "string",
|
|
271
|
+
name: "code",
|
|
272
|
+
value: LargeXIcon,
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
children: [],
|
|
276
|
+
},
|
|
277
|
+
],
|
|
263
278
|
},
|
|
264
279
|
],
|
|
265
280
|
},
|
package/src/sheet.ws.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HamburgerMenuIcon } from "@webstudio-is/icons/svg";
|
|
1
|
+
import { HamburgerMenuIcon, LargeXIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import type { WsComponentMeta } from "@webstudio-is/react-sdk";
|
|
3
3
|
import * as tc from "./theme/tailwind-classes";
|
|
4
4
|
import { getButtonStyles } from "./theme/styles";
|
|
@@ -210,7 +210,21 @@ export const meta: WsComponentMeta = {
|
|
|
210
210
|
tc.hover(tc.opacity(100)),
|
|
211
211
|
tc.focus(tc.ring("ring", 2, "background", 2)),
|
|
212
212
|
].flat(),
|
|
213
|
-
children: [
|
|
213
|
+
children: [
|
|
214
|
+
{
|
|
215
|
+
type: "instance",
|
|
216
|
+
component: "HtmlEmbed",
|
|
217
|
+
label: "Close Icon",
|
|
218
|
+
props: [
|
|
219
|
+
{
|
|
220
|
+
type: "string",
|
|
221
|
+
name: "code",
|
|
222
|
+
value: LargeXIcon,
|
|
223
|
+
},
|
|
224
|
+
],
|
|
225
|
+
children: [],
|
|
226
|
+
},
|
|
227
|
+
],
|
|
214
228
|
},
|
|
215
229
|
],
|
|
216
230
|
},
|
package/src/tabs.ws.ts
CHANGED
|
@@ -4,11 +4,12 @@ import {
|
|
|
4
4
|
TabsIcon,
|
|
5
5
|
TriggerIcon,
|
|
6
6
|
} from "@webstudio-is/icons/svg";
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
import {
|
|
8
|
+
defaultStates,
|
|
9
|
+
type EmbedTemplateStyleDecl,
|
|
10
|
+
type PresetStyle,
|
|
11
|
+
type WsComponentMeta,
|
|
12
|
+
type WsComponentPropsMeta,
|
|
12
13
|
} from "@webstudio-is/react-sdk";
|
|
13
14
|
import { button, div } from "@webstudio-is/react-sdk/css-normalize";
|
|
14
15
|
import * as tc from "./theme/tailwind-classes";
|
|
@@ -157,6 +158,14 @@ export const metaTabsTrigger: WsComponentMeta = {
|
|
|
157
158
|
invalidAncestors: ["TabsTrigger"],
|
|
158
159
|
indexWithinAncestor: "Tabs",
|
|
159
160
|
label: "Tab Trigger",
|
|
161
|
+
states: [
|
|
162
|
+
...defaultStates,
|
|
163
|
+
{
|
|
164
|
+
category: "component-states",
|
|
165
|
+
label: "Active",
|
|
166
|
+
selector: "[data-state=active]",
|
|
167
|
+
},
|
|
168
|
+
],
|
|
160
169
|
presetStyle: {
|
|
161
170
|
button: [button, buttonReset].flat(),
|
|
162
171
|
},
|
|
@@ -165,11 +174,11 @@ export const metaTabsTrigger: WsComponentMeta = {
|
|
|
165
174
|
export const metaTabsContent: WsComponentMeta = {
|
|
166
175
|
category: "hidden",
|
|
167
176
|
type: "container",
|
|
177
|
+
label: "Tab Content",
|
|
168
178
|
icon: ContentIcon,
|
|
169
179
|
requiredAncestors: ["Tabs"],
|
|
170
180
|
indexWithinAncestor: "Tabs",
|
|
171
181
|
presetStyle,
|
|
172
|
-
label: "Tab Content",
|
|
173
182
|
};
|
|
174
183
|
|
|
175
184
|
export const propsMetaTabs: WsComponentPropsMeta = {
|
package/src/theme/styles.ts
CHANGED
|
@@ -71,10 +71,6 @@ export const buttonReset: EmbedTemplateStyleDecl[] = [
|
|
|
71
71
|
property: "backgroundImage",
|
|
72
72
|
value: { type: "keyword", value: "none" },
|
|
73
73
|
} as const,
|
|
74
|
-
{
|
|
75
|
-
property: "cursor",
|
|
76
|
-
value: { type: "keyword", value: "pointer" },
|
|
77
|
-
} as const,
|
|
78
74
|
tc.border(0),
|
|
79
75
|
tc.p(0),
|
|
80
76
|
].flat();
|