@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/accordion.ws.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
import {
|
|
2
3
|
AccordionIcon,
|
|
3
4
|
ItemIcon,
|
|
@@ -95,7 +96,7 @@ const accordionContentStyles = [
|
|
|
95
96
|
// tc.transition("all"),
|
|
96
97
|
tc.pb(4)
|
|
97
98
|
].flat();
|
|
98
|
-
const metaAccordion = {
|
|
99
|
+
export const metaAccordion = {
|
|
99
100
|
category: "radix",
|
|
100
101
|
order: 3,
|
|
101
102
|
type: "container",
|
|
@@ -192,7 +193,7 @@ const metaAccordion = {
|
|
|
192
193
|
}
|
|
193
194
|
]
|
|
194
195
|
};
|
|
195
|
-
const metaAccordionItem = {
|
|
196
|
+
export const metaAccordionItem = {
|
|
196
197
|
category: "hidden",
|
|
197
198
|
type: "container",
|
|
198
199
|
label: "Item",
|
|
@@ -201,7 +202,7 @@ const metaAccordionItem = {
|
|
|
201
202
|
indexWithinAncestor: "Accordion",
|
|
202
203
|
presetStyle
|
|
203
204
|
};
|
|
204
|
-
const metaAccordionHeader = {
|
|
205
|
+
export const metaAccordionHeader = {
|
|
205
206
|
category: "hidden",
|
|
206
207
|
type: "container",
|
|
207
208
|
label: "Item Header",
|
|
@@ -212,7 +213,7 @@ const metaAccordionHeader = {
|
|
|
212
213
|
h3: [h3, tc.my(0)].flat()
|
|
213
214
|
}
|
|
214
215
|
};
|
|
215
|
-
const metaAccordionTrigger = {
|
|
216
|
+
export const metaAccordionTrigger = {
|
|
216
217
|
category: "hidden",
|
|
217
218
|
type: "container",
|
|
218
219
|
label: "Item Trigger",
|
|
@@ -231,7 +232,7 @@ const metaAccordionTrigger = {
|
|
|
231
232
|
button: [button, buttonReset].flat()
|
|
232
233
|
}
|
|
233
234
|
};
|
|
234
|
-
const metaAccordionContent = {
|
|
235
|
+
export const metaAccordionContent = {
|
|
235
236
|
category: "hidden",
|
|
236
237
|
type: "container",
|
|
237
238
|
label: "Item Content",
|
|
@@ -240,31 +241,19 @@ const metaAccordionContent = {
|
|
|
240
241
|
detachable: false,
|
|
241
242
|
presetStyle
|
|
242
243
|
};
|
|
243
|
-
const propsMetaAccordion = {
|
|
244
|
+
export const propsMetaAccordion = {
|
|
244
245
|
props: propsAccordion,
|
|
245
246
|
initialProps: ["value", "collapsible"]
|
|
246
247
|
};
|
|
247
|
-
const propsMetaAccordionItem = {
|
|
248
|
+
export const propsMetaAccordionItem = {
|
|
248
249
|
props: propsAccordionItem
|
|
249
250
|
};
|
|
250
|
-
const propsMetaAccordionHeader = {
|
|
251
|
+
export const propsMetaAccordionHeader = {
|
|
251
252
|
props: propsAccordionHeader
|
|
252
253
|
};
|
|
253
|
-
const propsMetaAccordionTrigger = {
|
|
254
|
+
export const propsMetaAccordionTrigger = {
|
|
254
255
|
props: propsAccordionTrigger
|
|
255
256
|
};
|
|
256
|
-
const propsMetaAccordionContent = {
|
|
257
|
+
export const propsMetaAccordionContent = {
|
|
257
258
|
props: propsAccordionContent
|
|
258
259
|
};
|
|
259
|
-
export {
|
|
260
|
-
metaAccordion,
|
|
261
|
-
metaAccordionContent,
|
|
262
|
-
metaAccordionHeader,
|
|
263
|
-
metaAccordionItem,
|
|
264
|
-
metaAccordionTrigger,
|
|
265
|
-
propsMetaAccordion,
|
|
266
|
-
propsMetaAccordionContent,
|
|
267
|
-
propsMetaAccordionHeader,
|
|
268
|
-
propsMetaAccordionItem,
|
|
269
|
-
propsMetaAccordionTrigger
|
|
270
|
-
};
|
package/lib/checkbox.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import {
|
|
3
4
|
forwardRef
|
|
4
5
|
} from "react";
|
|
5
6
|
import { Root, Indicator } from "@radix-ui/react-checkbox";
|
|
6
|
-
const Checkbox = forwardRef((props, ref) => {
|
|
7
|
+
export const Checkbox = forwardRef((props, ref) => {
|
|
7
8
|
return /* @__PURE__ */ jsx(Root, { ref, ...props });
|
|
8
9
|
});
|
|
9
|
-
const CheckboxIndicator = Indicator;
|
|
10
|
-
export {
|
|
11
|
-
Checkbox,
|
|
12
|
-
CheckboxIndicator
|
|
13
|
-
};
|
|
10
|
+
export const CheckboxIndicator = Indicator;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { renderComponentTemplate } from "@webstudio-is/react-sdk";
|
|
3
|
+
import * as baseComponents from "@webstudio-is/sdk-components-react";
|
|
4
|
+
import * as baseMetas from "@webstudio-is/sdk-components-react/metas";
|
|
5
|
+
import * as radixComponents from "./components";
|
|
6
|
+
import * as radixMetas from "./metas";
|
|
7
|
+
import { Checkbox as CheckboxPrimitive } from "./checkbox";
|
|
8
|
+
export default {
|
|
9
|
+
title: "Components/Checkbox",
|
|
10
|
+
component: CheckboxPrimitive
|
|
11
|
+
};
|
|
12
|
+
export const Checkbox = {
|
|
13
|
+
render: (props) => renderComponentTemplate({
|
|
14
|
+
name: "Checkbox",
|
|
15
|
+
props: { ...props },
|
|
16
|
+
components: { ...baseComponents, ...radixComponents },
|
|
17
|
+
metas: { ...baseMetas, ...radixMetas }
|
|
18
|
+
})
|
|
19
|
+
};
|
package/lib/checkbox.ws.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
import {
|
|
2
3
|
CheckMarkIcon,
|
|
3
4
|
CheckboxCheckedIcon,
|
|
@@ -13,7 +14,7 @@ import {
|
|
|
13
14
|
propsCheckbox,
|
|
14
15
|
propsCheckboxIndicator
|
|
15
16
|
} from "./__generated__/checkbox.props";
|
|
16
|
-
const metaCheckbox = {
|
|
17
|
+
export const metaCheckbox = {
|
|
17
18
|
category: "radix",
|
|
18
19
|
order: 101,
|
|
19
20
|
type: "container",
|
|
@@ -128,7 +129,7 @@ const metaCheckbox = {
|
|
|
128
129
|
}
|
|
129
130
|
]
|
|
130
131
|
};
|
|
131
|
-
const metaCheckboxIndicator = {
|
|
132
|
+
export const metaCheckboxIndicator = {
|
|
132
133
|
category: "hidden",
|
|
133
134
|
type: "container",
|
|
134
135
|
detachable: false,
|
|
@@ -138,16 +139,10 @@ const metaCheckboxIndicator = {
|
|
|
138
139
|
span
|
|
139
140
|
}
|
|
140
141
|
};
|
|
141
|
-
const propsMetaCheckbox = {
|
|
142
|
+
export const propsMetaCheckbox = {
|
|
142
143
|
props: propsCheckbox,
|
|
143
144
|
initialProps: ["id", "checked", "name", "required"]
|
|
144
145
|
};
|
|
145
|
-
const propsMetaCheckboxIndicator = {
|
|
146
|
+
export const propsMetaCheckboxIndicator = {
|
|
146
147
|
props: propsCheckboxIndicator
|
|
147
148
|
};
|
|
148
|
-
export {
|
|
149
|
-
metaCheckbox,
|
|
150
|
-
metaCheckboxIndicator,
|
|
151
|
-
propsMetaCheckbox,
|
|
152
|
-
propsMetaCheckboxIndicator
|
|
153
|
-
};
|
package/lib/collapsible.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import {
|
|
3
4
|
forwardRef,
|
|
@@ -5,14 +6,14 @@ import {
|
|
|
5
6
|
} from "react";
|
|
6
7
|
import { Root, Trigger, Content } from "@radix-ui/react-collapsible";
|
|
7
8
|
import { getClosestInstance } from "@webstudio-is/react-sdk";
|
|
8
|
-
const Collapsible = Root;
|
|
9
|
-
const CollapsibleTrigger = forwardRef(({ children, ...props }, ref) => {
|
|
9
|
+
export const Collapsible = Root;
|
|
10
|
+
export const CollapsibleTrigger = forwardRef(({ children, ...props }, ref) => {
|
|
10
11
|
const firstChild = Children.toArray(children)[0];
|
|
11
12
|
return /* @__PURE__ */ jsx(Trigger, { asChild: true, ref, ...props, children: firstChild ?? /* @__PURE__ */ jsx("button", { children: "Add button" }) });
|
|
12
13
|
});
|
|
13
|
-
const CollapsibleContent = Content;
|
|
14
|
+
export const CollapsibleContent = Content;
|
|
14
15
|
const namespace = "@webstudio-is/sdk-components-react-radix";
|
|
15
|
-
const hooksCollapsible = {
|
|
16
|
+
export const hooksCollapsible = {
|
|
16
17
|
onNavigatorSelect: (context, event) => {
|
|
17
18
|
for (const instance of event.instancePath) {
|
|
18
19
|
if (instance.component === `${namespace}:CollapsibleContent`) {
|
|
@@ -28,9 +29,3 @@ const hooksCollapsible = {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
|
-
export {
|
|
32
|
-
Collapsible,
|
|
33
|
-
CollapsibleContent,
|
|
34
|
-
CollapsibleTrigger,
|
|
35
|
-
hooksCollapsible
|
|
36
|
-
};
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
import { renderComponentTemplate } from "@webstudio-is/react-sdk";
|
|
3
3
|
import { Collapsible as CollapsiblePrimitive } from "./collapsible";
|
|
4
4
|
import * as baseComponents from "@webstudio-is/sdk-components-react";
|
|
5
5
|
import * as baseMetas from "@webstudio-is/sdk-components-react/metas";
|
|
6
6
|
import * as radixComponents from "./components";
|
|
7
7
|
import * as radixMetas from "./metas";
|
|
8
|
-
|
|
9
8
|
export default {
|
|
10
9
|
title: "Components/Collapsible",
|
|
11
|
-
component: CollapsiblePrimitive
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
metas: { ...baseMetas, ...radixMetas },
|
|
20
|
-
}),
|
|
10
|
+
component: CollapsiblePrimitive
|
|
11
|
+
};
|
|
12
|
+
export const Collapsible = {
|
|
13
|
+
render: () => renderComponentTemplate({
|
|
14
|
+
name: "Collapsible",
|
|
15
|
+
components: { ...baseComponents, ...radixComponents },
|
|
16
|
+
metas: { ...baseMetas, ...radixMetas }
|
|
17
|
+
})
|
|
21
18
|
};
|
package/lib/collapsible.ws.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
import {
|
|
2
3
|
CollapsibleIcon,
|
|
3
4
|
TriggerIcon,
|
|
@@ -13,7 +14,7 @@ import { getButtonStyles } from "./theme/styles";
|
|
|
13
14
|
const presetStyle = {
|
|
14
15
|
div
|
|
15
16
|
};
|
|
16
|
-
const metaCollapsible = {
|
|
17
|
+
export const metaCollapsible = {
|
|
17
18
|
category: "radix",
|
|
18
19
|
order: 5,
|
|
19
20
|
type: "container",
|
|
@@ -69,21 +70,21 @@ const metaCollapsible = {
|
|
|
69
70
|
}
|
|
70
71
|
]
|
|
71
72
|
};
|
|
72
|
-
const metaCollapsibleTrigger = {
|
|
73
|
+
export const metaCollapsibleTrigger = {
|
|
73
74
|
category: "hidden",
|
|
74
75
|
type: "container",
|
|
75
76
|
icon: TriggerIcon,
|
|
76
77
|
stylable: false,
|
|
77
78
|
detachable: false
|
|
78
79
|
};
|
|
79
|
-
const metaCollapsibleContent = {
|
|
80
|
+
export const metaCollapsibleContent = {
|
|
80
81
|
category: "hidden",
|
|
81
82
|
type: "container",
|
|
82
83
|
presetStyle,
|
|
83
84
|
icon: ContentIcon,
|
|
84
85
|
detachable: false
|
|
85
86
|
};
|
|
86
|
-
const propsMetaCollapsible = {
|
|
87
|
+
export const propsMetaCollapsible = {
|
|
87
88
|
props: {
|
|
88
89
|
...propsCollapsible,
|
|
89
90
|
onOpenChange: {
|
|
@@ -94,17 +95,9 @@ const propsMetaCollapsible = {
|
|
|
94
95
|
},
|
|
95
96
|
initialProps: ["open", "onOpenChange"]
|
|
96
97
|
};
|
|
97
|
-
const propsMetaCollapsibleTrigger = {
|
|
98
|
+
export const propsMetaCollapsibleTrigger = {
|
|
98
99
|
props: propsCollapsibleTrigger
|
|
99
100
|
};
|
|
100
|
-
const propsMetaCollapsibleContent = {
|
|
101
|
+
export const propsMetaCollapsibleContent = {
|
|
101
102
|
props: propsCollapsibleContent
|
|
102
103
|
};
|
|
103
|
-
export {
|
|
104
|
-
metaCollapsible,
|
|
105
|
-
metaCollapsibleContent,
|
|
106
|
-
metaCollapsibleTrigger,
|
|
107
|
-
propsMetaCollapsible,
|
|
108
|
-
propsMetaCollapsibleContent,
|
|
109
|
-
propsMetaCollapsibleTrigger
|
|
110
|
-
};
|
package/lib/components.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
export {
|
|
2
3
|
Collapsible,
|
|
3
4
|
CollapsibleTrigger,
|
|
4
5
|
CollapsibleContent
|
|
5
6
|
} from "./collapsible";
|
|
6
|
-
|
|
7
|
+
export {
|
|
7
8
|
Dialog,
|
|
8
9
|
DialogTrigger,
|
|
9
10
|
DialogOverlay,
|
|
@@ -12,18 +13,18 @@ import {
|
|
|
12
13
|
DialogTitle,
|
|
13
14
|
DialogDescription
|
|
14
15
|
} from "./dialog";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
export { Popover, PopoverTrigger, PopoverContent } from "./popover";
|
|
17
|
+
export { Tooltip, TooltipTrigger, TooltipContent } from "./tooltip";
|
|
18
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent } from "./tabs";
|
|
19
|
+
export { Label } from "./label";
|
|
20
|
+
export {
|
|
20
21
|
Accordion,
|
|
21
22
|
AccordionItem,
|
|
22
23
|
AccordionHeader,
|
|
23
24
|
AccordionTrigger,
|
|
24
25
|
AccordionContent
|
|
25
26
|
} from "./accordion";
|
|
26
|
-
|
|
27
|
+
export {
|
|
27
28
|
NavigationMenu,
|
|
28
29
|
NavigationMenuList,
|
|
29
30
|
NavigationMenuItem,
|
|
@@ -32,7 +33,7 @@ import {
|
|
|
32
33
|
NavigationMenuLink,
|
|
33
34
|
NavigationMenuViewport
|
|
34
35
|
} from "./navigation-menu";
|
|
35
|
-
|
|
36
|
+
export {
|
|
36
37
|
Select,
|
|
37
38
|
SelectTrigger,
|
|
38
39
|
SelectValue,
|
|
@@ -42,56 +43,6 @@ import {
|
|
|
42
43
|
SelectItemIndicator,
|
|
43
44
|
SelectItemText
|
|
44
45
|
} from "./select";
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
export {
|
|
49
|
-
Accordion,
|
|
50
|
-
AccordionContent,
|
|
51
|
-
AccordionHeader,
|
|
52
|
-
AccordionItem,
|
|
53
|
-
AccordionTrigger,
|
|
54
|
-
Checkbox,
|
|
55
|
-
CheckboxIndicator,
|
|
56
|
-
Collapsible,
|
|
57
|
-
CollapsibleContent,
|
|
58
|
-
CollapsibleTrigger,
|
|
59
|
-
Dialog,
|
|
60
|
-
DialogClose,
|
|
61
|
-
DialogContent,
|
|
62
|
-
DialogDescription,
|
|
63
|
-
DialogOverlay,
|
|
64
|
-
DialogTitle,
|
|
65
|
-
DialogTrigger,
|
|
66
|
-
Label,
|
|
67
|
-
NavigationMenu,
|
|
68
|
-
NavigationMenuContent,
|
|
69
|
-
NavigationMenuItem,
|
|
70
|
-
NavigationMenuLink,
|
|
71
|
-
NavigationMenuList,
|
|
72
|
-
NavigationMenuTrigger,
|
|
73
|
-
NavigationMenuViewport,
|
|
74
|
-
Popover,
|
|
75
|
-
PopoverContent,
|
|
76
|
-
PopoverTrigger,
|
|
77
|
-
RadioGroup,
|
|
78
|
-
RadioGroupIndicator,
|
|
79
|
-
RadioGroupItem,
|
|
80
|
-
Select,
|
|
81
|
-
SelectContent,
|
|
82
|
-
SelectItem,
|
|
83
|
-
SelectItemIndicator,
|
|
84
|
-
SelectItemText,
|
|
85
|
-
SelectTrigger,
|
|
86
|
-
SelectValue,
|
|
87
|
-
SelectViewport,
|
|
88
|
-
Switch,
|
|
89
|
-
SwitchThumb,
|
|
90
|
-
Tabs,
|
|
91
|
-
TabsContent,
|
|
92
|
-
TabsList,
|
|
93
|
-
TabsTrigger,
|
|
94
|
-
Tooltip,
|
|
95
|
-
TooltipContent,
|
|
96
|
-
TooltipTrigger
|
|
97
|
-
};
|
|
46
|
+
export { Switch, SwitchThumb } from "./switch";
|
|
47
|
+
export { Checkbox, CheckboxIndicator } from "./checkbox";
|
|
48
|
+
export { RadioGroup, RadioGroupItem, RadioGroupIndicator } from "./radio-group";
|
package/lib/dialog.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import {
|
|
3
4
|
forwardRef,
|
|
@@ -5,22 +6,22 @@ import {
|
|
|
5
6
|
} from "react";
|
|
6
7
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
7
8
|
import { getClosestInstance } from "@webstudio-is/react-sdk";
|
|
8
|
-
const Dialog = forwardRef((props, _ref) => {
|
|
9
|
+
export const Dialog = forwardRef((props, _ref) => {
|
|
9
10
|
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...props });
|
|
10
11
|
});
|
|
11
|
-
const DialogTrigger = forwardRef(({ children, ...props }, ref) => {
|
|
12
|
+
export const DialogTrigger = forwardRef(({ children, ...props }, ref) => {
|
|
12
13
|
const firstChild = Children.toArray(children)[0];
|
|
13
14
|
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ref, asChild: true, ...props, children: firstChild ?? /* @__PURE__ */ jsx("button", { children: "Add button or link" }) });
|
|
14
15
|
});
|
|
15
|
-
const DialogOverlay = forwardRef((props, ref) => {
|
|
16
|
+
export const DialogOverlay = forwardRef((props, ref) => {
|
|
16
17
|
return /* @__PURE__ */ jsx(DialogPrimitive.DialogPortal, { children: /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { ref, ...props }) });
|
|
17
18
|
});
|
|
18
|
-
const DialogContent = DialogPrimitive.Content;
|
|
19
|
-
const DialogClose = DialogPrimitive.Close;
|
|
20
|
-
const DialogTitle = DialogPrimitive.Title;
|
|
21
|
-
const DialogDescription = DialogPrimitive.Description;
|
|
19
|
+
export const DialogContent = DialogPrimitive.Content;
|
|
20
|
+
export const DialogClose = DialogPrimitive.Close;
|
|
21
|
+
export const DialogTitle = DialogPrimitive.Title;
|
|
22
|
+
export const DialogDescription = DialogPrimitive.Description;
|
|
22
23
|
const namespace = "@webstudio-is/sdk-components-react-radix";
|
|
23
|
-
const hooksDialog = {
|
|
24
|
+
export const hooksDialog = {
|
|
24
25
|
onNavigatorUnselect: (context, event) => {
|
|
25
26
|
for (const instance of event.instancePath) {
|
|
26
27
|
if (instance.component === `${namespace}:DialogOverlay`) {
|
|
@@ -50,13 +51,3 @@ const hooksDialog = {
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
|
-
export {
|
|
54
|
-
Dialog,
|
|
55
|
-
DialogClose,
|
|
56
|
-
DialogContent,
|
|
57
|
-
DialogDescription,
|
|
58
|
-
DialogOverlay,
|
|
59
|
-
DialogTitle,
|
|
60
|
-
DialogTrigger,
|
|
61
|
-
hooksDialog
|
|
62
|
-
};
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
import { renderComponentTemplate } from "@webstudio-is/react-sdk";
|
|
3
3
|
import { Dialog as DialogPrimitive } from "./dialog";
|
|
4
4
|
import * as baseComponents from "@webstudio-is/sdk-components-react";
|
|
5
5
|
import * as baseMetas from "@webstudio-is/sdk-components-react/metas";
|
|
6
6
|
import * as radixComponents from "./components";
|
|
7
7
|
import * as radixMetas from "./metas";
|
|
8
|
-
|
|
9
8
|
export default {
|
|
10
9
|
title: "Components/Dialog",
|
|
11
|
-
component: DialogPrimitive
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
metas: { ...baseMetas, ...radixMetas },
|
|
20
|
-
}),
|
|
10
|
+
component: DialogPrimitive
|
|
11
|
+
};
|
|
12
|
+
export const Dialog = {
|
|
13
|
+
render: () => renderComponentTemplate({
|
|
14
|
+
name: "Dialog",
|
|
15
|
+
components: { ...baseComponents, ...radixComponents },
|
|
16
|
+
metas: { ...baseMetas, ...radixMetas }
|
|
17
|
+
})
|
|
21
18
|
};
|
package/lib/dialog.ws.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
import {
|
|
2
3
|
DialogIcon,
|
|
3
4
|
TriggerIcon,
|
|
@@ -32,40 +33,40 @@ const titlePresetStyle = {
|
|
|
32
33
|
const descriptionPresetStyle = {
|
|
33
34
|
p
|
|
34
35
|
};
|
|
35
|
-
const metaDialogTrigger = {
|
|
36
|
+
export const metaDialogTrigger = {
|
|
36
37
|
category: "hidden",
|
|
37
38
|
type: "container",
|
|
38
39
|
icon: TriggerIcon,
|
|
39
40
|
stylable: false,
|
|
40
41
|
detachable: false
|
|
41
42
|
};
|
|
42
|
-
const metaDialogContent = {
|
|
43
|
+
export const metaDialogContent = {
|
|
43
44
|
category: "hidden",
|
|
44
45
|
type: "container",
|
|
45
46
|
presetStyle,
|
|
46
47
|
icon: ContentIcon,
|
|
47
48
|
detachable: false
|
|
48
49
|
};
|
|
49
|
-
const metaDialogOverlay = {
|
|
50
|
+
export const metaDialogOverlay = {
|
|
50
51
|
category: "hidden",
|
|
51
52
|
type: "container",
|
|
52
53
|
presetStyle,
|
|
53
54
|
icon: OverlayIcon,
|
|
54
55
|
detachable: false
|
|
55
56
|
};
|
|
56
|
-
const metaDialogTitle = {
|
|
57
|
+
export const metaDialogTitle = {
|
|
57
58
|
category: "hidden",
|
|
58
59
|
type: "container",
|
|
59
60
|
presetStyle: titlePresetStyle,
|
|
60
61
|
icon: HeadingIcon
|
|
61
62
|
};
|
|
62
|
-
const metaDialogDescription = {
|
|
63
|
+
export const metaDialogDescription = {
|
|
63
64
|
category: "hidden",
|
|
64
65
|
type: "container",
|
|
65
66
|
presetStyle: descriptionPresetStyle,
|
|
66
67
|
icon: TextIcon
|
|
67
68
|
};
|
|
68
|
-
const metaDialogClose = {
|
|
69
|
+
export const metaDialogClose = {
|
|
69
70
|
category: "hidden",
|
|
70
71
|
type: "container",
|
|
71
72
|
presetStyle: {
|
|
@@ -75,7 +76,7 @@ const metaDialogClose = {
|
|
|
75
76
|
icon: ButtonElementIcon,
|
|
76
77
|
label: "Close Button"
|
|
77
78
|
};
|
|
78
|
-
const metaDialog = {
|
|
79
|
+
export const metaDialog = {
|
|
79
80
|
category: "radix",
|
|
80
81
|
order: 4,
|
|
81
82
|
type: "container",
|
|
@@ -259,46 +260,30 @@ const metaDialog = {
|
|
|
259
260
|
}
|
|
260
261
|
]
|
|
261
262
|
};
|
|
262
|
-
const propsMetaDialog = {
|
|
263
|
+
export const propsMetaDialog = {
|
|
263
264
|
props: propsDialog,
|
|
264
265
|
initialProps: ["open"]
|
|
265
266
|
};
|
|
266
|
-
const propsMetaDialogTrigger = {
|
|
267
|
+
export const propsMetaDialogTrigger = {
|
|
267
268
|
props: propsDialogTrigger
|
|
268
269
|
};
|
|
269
|
-
const propsMetaDialogContent = {
|
|
270
|
+
export const propsMetaDialogContent = {
|
|
270
271
|
props: propsDialogContent,
|
|
271
272
|
initialProps: []
|
|
272
273
|
};
|
|
273
|
-
const propsMetaDialogOverlay = {
|
|
274
|
+
export const propsMetaDialogOverlay = {
|
|
274
275
|
props: propsDialogOverlay,
|
|
275
276
|
initialProps: []
|
|
276
277
|
};
|
|
277
|
-
const propsMetaDialogClose = {
|
|
278
|
+
export const propsMetaDialogClose = {
|
|
278
279
|
props: propsDialogClose,
|
|
279
280
|
initialProps: []
|
|
280
281
|
};
|
|
281
|
-
const propsMetaDialogTitle = {
|
|
282
|
+
export const propsMetaDialogTitle = {
|
|
282
283
|
props: propsDialogTitle,
|
|
283
284
|
initialProps: []
|
|
284
285
|
};
|
|
285
|
-
const propsMetaDialogDescription = {
|
|
286
|
+
export const propsMetaDialogDescription = {
|
|
286
287
|
props: propsDialogDescription,
|
|
287
288
|
initialProps: []
|
|
288
289
|
};
|
|
289
|
-
export {
|
|
290
|
-
metaDialog,
|
|
291
|
-
metaDialogClose,
|
|
292
|
-
metaDialogContent,
|
|
293
|
-
metaDialogDescription,
|
|
294
|
-
metaDialogOverlay,
|
|
295
|
-
metaDialogTitle,
|
|
296
|
-
metaDialogTrigger,
|
|
297
|
-
propsMetaDialog,
|
|
298
|
-
propsMetaDialogClose,
|
|
299
|
-
propsMetaDialogContent,
|
|
300
|
-
propsMetaDialogDescription,
|
|
301
|
-
propsMetaDialogOverlay,
|
|
302
|
-
propsMetaDialogTitle,
|
|
303
|
-
propsMetaDialogTrigger
|
|
304
|
-
};
|
package/lib/hooks.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
import { hooksCollapsible } from "./collapsible";
|
|
2
3
|
import { hooksTabs } from "./tabs";
|
|
3
4
|
import { hooksDialog } from "./dialog";
|
|
@@ -7,7 +8,7 @@ import { hooksTooltip } from "./tooltip";
|
|
|
7
8
|
import { hooksAccordion } from "./accordion";
|
|
8
9
|
import { hooksNavigationMenu } from "./navigation-menu";
|
|
9
10
|
import { hooksSelect } from "./select";
|
|
10
|
-
const hooks = [
|
|
11
|
+
export const hooks = [
|
|
11
12
|
hooksCollapsible,
|
|
12
13
|
hooksTabs,
|
|
13
14
|
hooksDialog,
|
|
@@ -18,6 +19,3 @@ const hooks = [
|
|
|
18
19
|
hooksNavigationMenu,
|
|
19
20
|
hooksSelect
|
|
20
21
|
];
|
|
21
|
-
export {
|
|
22
|
-
hooks
|
|
23
|
-
};
|
package/lib/label.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import {
|
|
3
4
|
forwardRef
|
|
4
5
|
} from "react";
|
|
5
6
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
6
|
-
const Label = forwardRef((props, ref) => /* @__PURE__ */ jsx(LabelPrimitive.Root, { ref, ...props }));
|
|
7
|
-
export {
|
|
8
|
-
Label
|
|
9
|
-
};
|
|
7
|
+
export const Label = forwardRef((props, ref) => /* @__PURE__ */ jsx(LabelPrimitive.Root, { ref, ...props }));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { renderComponentTemplate } from "@webstudio-is/react-sdk";
|
|
3
|
+
import { Label as LabelPrimitive } from "./label";
|
|
4
|
+
import * as baseComponents from "@webstudio-is/sdk-components-react";
|
|
5
|
+
import * as baseMetas from "@webstudio-is/sdk-components-react/metas";
|
|
6
|
+
import * as radixComponents from "./components";
|
|
7
|
+
import * as radixMetas from "./metas";
|
|
8
|
+
export default {
|
|
9
|
+
title: "Components/Label",
|
|
10
|
+
component: LabelPrimitive
|
|
11
|
+
};
|
|
12
|
+
export const Label = {
|
|
13
|
+
render: (props) => renderComponentTemplate({
|
|
14
|
+
name: "Label",
|
|
15
|
+
props: { ...props },
|
|
16
|
+
components: { ...baseComponents, ...radixComponents },
|
|
17
|
+
metas: { ...baseMetas, ...radixMetas }
|
|
18
|
+
})
|
|
19
|
+
};
|
package/lib/label.ws.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
import { LabelIcon } from "@webstudio-is/icons/svg";
|
|
2
3
|
import {
|
|
3
4
|
defaultStates
|
|
@@ -8,7 +9,7 @@ import * as tc from "./theme/tailwind-classes";
|
|
|
8
9
|
const presetStyle = {
|
|
9
10
|
label
|
|
10
11
|
};
|
|
11
|
-
const meta = {
|
|
12
|
+
export const meta = {
|
|
12
13
|
category: "radix",
|
|
13
14
|
order: 102,
|
|
14
15
|
type: "container",
|
|
@@ -31,7 +32,7 @@ const meta = {
|
|
|
31
32
|
}
|
|
32
33
|
]
|
|
33
34
|
};
|
|
34
|
-
const propsMeta = {
|
|
35
|
+
export const propsMeta = {
|
|
35
36
|
props: {
|
|
36
37
|
...props,
|
|
37
38
|
htmlFor: {
|
|
@@ -41,7 +42,3 @@ const propsMeta = {
|
|
|
41
42
|
},
|
|
42
43
|
initialProps: ["id", "htmlFor"]
|
|
43
44
|
};
|
|
44
|
-
export {
|
|
45
|
-
meta,
|
|
46
|
-
propsMeta
|
|
47
|
-
};
|