@webstudio-is/sdk-components-react 0.82.0 → 0.83.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/LICENSE +661 -21
- package/lib/__generated__/blockquote.props.js +30 -5
- package/lib/__generated__/body.props.js +30 -5
- package/lib/__generated__/bold.props.js +30 -5
- package/lib/__generated__/box.props.js +30 -5
- package/lib/__generated__/button.props.js +30 -5
- package/lib/__generated__/checkbox.props.js +31 -6
- package/lib/__generated__/code-text.props.js +30 -5
- package/lib/__generated__/form.props.js +30 -5
- package/lib/__generated__/heading.props.js +30 -5
- package/lib/__generated__/image.props.js +30 -5
- package/lib/__generated__/input.props.js +30 -5
- package/lib/__generated__/italic.props.js +30 -5
- package/lib/__generated__/label.props.js +30 -5
- package/lib/__generated__/link.props.js +30 -5
- package/lib/__generated__/list-item.props.js +30 -5
- package/lib/__generated__/list.props.js +30 -5
- package/lib/__generated__/paragraph.props.js +30 -5
- package/lib/__generated__/radio-button.props.js +31 -6
- package/lib/__generated__/radix-dialog.props.js +2120 -0
- package/lib/__generated__/radix-popover.props.js +463 -0
- package/lib/__generated__/radix-tooltip.props.js +473 -0
- package/lib/__generated__/rich-text-link.props.js +30 -5
- package/lib/__generated__/separator.props.js +30 -5
- package/lib/__generated__/span.props.js +30 -5
- package/lib/__generated__/subscript.props.js +30 -5
- package/lib/__generated__/superscript.props.js +30 -5
- package/lib/__generated__/text.props.js +30 -5
- package/lib/__generated__/textarea.props.js +30 -5
- package/lib/__generated__/vimeo-play-button.props.js +30 -5
- package/lib/__generated__/vimeo-preview-image.props.js +30 -5
- package/lib/__generated__/vimeo-spinner.props.js +30 -5
- package/lib/__generated__/vimeo.props.js +30 -5
- package/lib/body.ws.js +11 -1
- package/lib/cjs/__generated__/blockquote.props.js +30 -5
- package/lib/cjs/__generated__/body.props.js +30 -5
- package/lib/cjs/__generated__/bold.props.js +30 -5
- package/lib/cjs/__generated__/box.props.js +30 -5
- package/lib/cjs/__generated__/button.props.js +30 -5
- package/lib/cjs/__generated__/checkbox.props.js +31 -6
- package/lib/cjs/__generated__/code-text.props.js +30 -5
- package/lib/cjs/__generated__/form.props.js +30 -5
- package/lib/cjs/__generated__/heading.props.js +30 -5
- package/lib/cjs/__generated__/image.props.js +30 -5
- package/lib/cjs/__generated__/input.props.js +30 -5
- package/lib/cjs/__generated__/italic.props.js +30 -5
- package/lib/cjs/__generated__/label.props.js +30 -5
- package/lib/cjs/__generated__/link.props.js +30 -5
- package/lib/cjs/__generated__/list-item.props.js +30 -5
- package/lib/cjs/__generated__/list.props.js +30 -5
- package/lib/cjs/__generated__/paragraph.props.js +30 -5
- package/lib/cjs/__generated__/radio-button.props.js +31 -6
- package/lib/cjs/__generated__/radix-dialog.props.js +2140 -0
- package/lib/cjs/__generated__/radix-popover.props.js +483 -0
- package/lib/cjs/__generated__/radix-tooltip.props.js +493 -0
- package/lib/cjs/__generated__/rich-text-link.props.js +30 -5
- package/lib/cjs/__generated__/separator.props.js +30 -5
- package/lib/cjs/__generated__/span.props.js +30 -5
- package/lib/cjs/__generated__/subscript.props.js +30 -5
- package/lib/cjs/__generated__/superscript.props.js +30 -5
- package/lib/cjs/__generated__/text.props.js +30 -5
- package/lib/cjs/__generated__/textarea.props.js +30 -5
- package/lib/cjs/__generated__/vimeo-play-button.props.js +30 -5
- package/lib/cjs/__generated__/vimeo-preview-image.props.js +30 -5
- package/lib/cjs/__generated__/vimeo-spinner.props.js +30 -5
- package/lib/cjs/__generated__/vimeo.props.js +30 -5
- package/lib/cjs/body.ws.js +11 -1
- package/lib/cjs/components.js +16 -0
- package/lib/cjs/label.ws.js +1 -1
- package/lib/cjs/metas.js +16 -0
- package/lib/cjs/props.js +16 -0
- package/lib/cjs/radix-dialog.js +61 -0
- package/lib/cjs/radix-dialog.ws.js +300 -0
- package/lib/cjs/radix-popover.js +59 -0
- package/lib/cjs/radix-popover.ws.js +139 -0
- package/lib/cjs/radix-tooltip.js +51 -0
- package/lib/cjs/radix-tooltip.ws.js +140 -0
- package/lib/cjs/theme/radix-common-types.js +16 -0
- package/lib/cjs/theme/tailwind-classes.js +439 -0
- package/lib/cjs/theme/tailwind-colors.js +33 -0
- package/lib/cjs/theme/tailwind-theme.js +46 -0
- package/lib/cjs/vimeo-play-button.ws.js +1 -0
- package/lib/cjs/vimeo-preview-image.ws.js +1 -0
- package/lib/cjs/vimeo.ws.js +1 -0
- package/lib/components.js +24 -0
- package/lib/label.ws.js +2 -2
- package/lib/metas.js +32 -0
- package/lib/props.js +32 -0
- package/lib/radix-dialog.js +36 -0
- package/lib/radix-dialog.ws.js +279 -0
- package/lib/radix-popover.js +34 -0
- package/lib/radix-popover.ws.js +114 -0
- package/lib/radix-tooltip.js +26 -0
- package/lib/radix-tooltip.ws.js +115 -0
- package/lib/theme/radix-common-types.js +0 -0
- package/lib/theme/tailwind-classes.js +419 -0
- package/lib/theme/tailwind-colors.js +13 -0
- package/lib/theme/tailwind-theme.js +16 -0
- package/lib/types/__generated__/radix-dialog.props.d.ts +8 -0
- package/lib/types/__generated__/radix-popover.props.d.ts +4 -0
- package/lib/types/__generated__/radix-tooltip.props.d.ts +4 -0
- package/lib/types/components.d.ts +3 -0
- package/lib/types/metas.d.ts +3 -0
- package/lib/types/props.d.ts +3 -0
- package/lib/types/radix-dialog.d.ts +26 -0
- package/lib/types/radix-dialog.ws.d.ts +23 -0
- package/lib/types/radix-popover.d.ts +22 -0
- package/lib/types/radix-popover.ws.d.ts +15 -0
- package/lib/types/radix-tooltip.d.ts +22 -0
- package/lib/types/radix-tooltip.ws.d.ts +15 -0
- package/lib/types/theme/radix-common-types.d.ts +84 -0
- package/lib/types/theme/tailwind-classes.d.ts +69 -0
- package/lib/types/theme/tailwind-colors.d.ts +19 -0
- package/lib/types/theme/tailwind-theme.d.ts +72 -0
- package/lib/types/vimeo-preview-image.d.ts +6 -1
- package/lib/vimeo-play-button.ws.js +1 -0
- package/lib/vimeo-preview-image.js +1 -1
- package/lib/vimeo-preview-image.ws.js +2 -0
- package/lib/vimeo.ws.js +1 -0
- package/package.json +18 -13
- package/src/LICENSE +661 -21
- package/src/__generated__/blockquote.props.ts +34 -5
- package/src/__generated__/body.props.ts +34 -5
- package/src/__generated__/bold.props.ts +34 -5
- package/src/__generated__/box.props.ts +34 -5
- package/src/__generated__/button.props.ts +34 -5
- package/src/__generated__/checkbox.props.ts +35 -6
- package/src/__generated__/code-text.props.ts +34 -5
- package/src/__generated__/form.props.ts +34 -5
- package/src/__generated__/heading.props.ts +34 -5
- package/src/__generated__/image.props.ts +34 -5
- package/src/__generated__/input.props.ts +34 -5
- package/src/__generated__/italic.props.ts +34 -5
- package/src/__generated__/label.props.ts +34 -5
- package/src/__generated__/link.props.ts +34 -5
- package/src/__generated__/list-item.props.ts +34 -5
- package/src/__generated__/list.props.ts +34 -5
- package/src/__generated__/paragraph.props.ts +34 -5
- package/src/__generated__/radio-button.props.ts +35 -6
- package/src/__generated__/radix-dialog.props.ts +2363 -0
- package/src/__generated__/radix-popover.props.ts +510 -0
- package/src/__generated__/radix-tooltip.props.ts +521 -0
- package/src/__generated__/rich-text-link.props.ts +34 -5
- package/src/__generated__/separator.props.ts +34 -5
- package/src/__generated__/span.props.ts +34 -5
- package/src/__generated__/subscript.props.ts +34 -5
- package/src/__generated__/superscript.props.ts +34 -5
- package/src/__generated__/text.props.ts +34 -5
- package/src/__generated__/textarea.props.ts +34 -5
- package/src/__generated__/vimeo-play-button.props.ts +34 -5
- package/src/__generated__/vimeo-preview-image.props.ts +34 -5
- package/src/__generated__/vimeo-spinner.props.ts +34 -5
- package/src/__generated__/vimeo.props.ts +34 -5
- package/src/body.ws.tsx +11 -1
- package/src/components.ts +11 -0
- package/src/label.ws.tsx +2 -2
- package/src/metas.ts +21 -0
- package/src/props.ts +19 -0
- package/src/radix-dialog.tsx +91 -0
- package/src/radix-dialog.ws.tsx +291 -0
- package/src/radix-popover.tsx +89 -0
- package/src/radix-popover.ws.tsx +124 -0
- package/src/radix-tooltip.tsx +84 -0
- package/src/radix-tooltip.ws.tsx +125 -0
- package/src/theme/radix-common-types.ts +495 -0
- package/src/theme/tailwind-classes.ts +570 -0
- package/src/theme/tailwind-colors.ts +47 -0
- package/src/theme/tailwind-theme.ts +24 -0
package/lib/cjs/body.ws.js
CHANGED
|
@@ -27,7 +27,17 @@ var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
|
27
27
|
var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
|
|
28
28
|
var import_body = require("./__generated__/body.props");
|
|
29
29
|
const presetStyle = {
|
|
30
|
-
body:
|
|
30
|
+
body: [
|
|
31
|
+
...import_css_normalize.body,
|
|
32
|
+
{
|
|
33
|
+
property: "WebkitFontSmoothing",
|
|
34
|
+
value: { type: "keyword", value: "antialiased" }
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
property: "MozOsxFontSmoothing",
|
|
38
|
+
value: { type: "keyword", value: "grayscale" }
|
|
39
|
+
}
|
|
40
|
+
]
|
|
31
41
|
};
|
|
32
42
|
const meta = {
|
|
33
43
|
type: "container",
|
package/lib/cjs/components.js
CHANGED
|
@@ -25,6 +25,13 @@ __export(components_exports, {
|
|
|
25
25
|
Button: () => import_button.Button,
|
|
26
26
|
Checkbox: () => import_checkbox.Checkbox,
|
|
27
27
|
CodeText: () => import_code_text.CodeText,
|
|
28
|
+
Dialog: () => import_radix_dialog.Dialog,
|
|
29
|
+
DialogClose: () => import_radix_dialog.DialogClose,
|
|
30
|
+
DialogContent: () => import_radix_dialog.DialogContent,
|
|
31
|
+
DialogDescription: () => import_radix_dialog.DialogDescription,
|
|
32
|
+
DialogOverlay: () => import_radix_dialog.DialogOverlay,
|
|
33
|
+
DialogTitle: () => import_radix_dialog.DialogTitle,
|
|
34
|
+
DialogTrigger: () => import_radix_dialog.DialogTrigger,
|
|
28
35
|
Form: () => import_form.Form,
|
|
29
36
|
Fragment: () => import_fragment.Fragment,
|
|
30
37
|
Heading: () => import_heading.Heading,
|
|
@@ -37,6 +44,9 @@ __export(components_exports, {
|
|
|
37
44
|
List: () => import_list.List,
|
|
38
45
|
ListItem: () => import_list_item.ListItem,
|
|
39
46
|
Paragraph: () => import_paragraph.Paragraph,
|
|
47
|
+
Popover: () => import_radix_popover.Popover,
|
|
48
|
+
PopoverContent: () => import_radix_popover.PopoverContent,
|
|
49
|
+
PopoverTrigger: () => import_radix_popover.PopoverTrigger,
|
|
40
50
|
RadioButton: () => import_radio_button.RadioButton,
|
|
41
51
|
RichTextLink: () => import_rich_text_link.RichTextLink,
|
|
42
52
|
Separator: () => import_separator.Separator,
|
|
@@ -46,6 +56,9 @@ __export(components_exports, {
|
|
|
46
56
|
Superscript: () => import_superscript.Superscript,
|
|
47
57
|
Text: () => import_text.Text,
|
|
48
58
|
Textarea: () => import_textarea.Textarea,
|
|
59
|
+
Tooltip: () => import_radix_tooltip.Tooltip,
|
|
60
|
+
TooltipContent: () => import_radix_tooltip.TooltipContent,
|
|
61
|
+
TooltipTrigger: () => import_radix_tooltip.TooltipTrigger,
|
|
49
62
|
Vimeo: () => import_vimeo.Vimeo,
|
|
50
63
|
VimeoPlayButton: () => import_vimeo_play_button.VimeoPlayButton,
|
|
51
64
|
VimeoPreviewImage: () => import_vimeo_preview_image.VimeoPreviewImage,
|
|
@@ -84,3 +97,6 @@ var import_vimeo = require("./vimeo");
|
|
|
84
97
|
var import_vimeo_preview_image = require("./vimeo-preview-image");
|
|
85
98
|
var import_vimeo_play_button = require("./vimeo-play-button");
|
|
86
99
|
var import_vimeo_spinner = require("./vimeo-spinner");
|
|
100
|
+
var import_radix_tooltip = require("./radix-tooltip");
|
|
101
|
+
var import_radix_popover = require("./radix-popover");
|
|
102
|
+
var import_radix_dialog = require("./radix-dialog");
|
package/lib/cjs/label.ws.js
CHANGED
package/lib/cjs/metas.js
CHANGED
|
@@ -25,6 +25,13 @@ __export(metas_exports, {
|
|
|
25
25
|
Button: () => import_button.meta,
|
|
26
26
|
Checkbox: () => import_checkbox.meta,
|
|
27
27
|
CodeText: () => import_code_text.meta,
|
|
28
|
+
Dialog: () => import_radix_dialog.metaDialog,
|
|
29
|
+
DialogClose: () => import_radix_dialog.metaDialogClose,
|
|
30
|
+
DialogContent: () => import_radix_dialog.metaDialogContent,
|
|
31
|
+
DialogDescription: () => import_radix_dialog.metaDialogDescription,
|
|
32
|
+
DialogOverlay: () => import_radix_dialog.metaDialogOverlay,
|
|
33
|
+
DialogTitle: () => import_radix_dialog.metaDialogTitle,
|
|
34
|
+
DialogTrigger: () => import_radix_dialog.metaDialogTrigger,
|
|
28
35
|
Form: () => import_form.meta,
|
|
29
36
|
Fragment: () => import_fragment.meta,
|
|
30
37
|
Heading: () => import_heading.meta,
|
|
@@ -37,6 +44,9 @@ __export(metas_exports, {
|
|
|
37
44
|
List: () => import_list.meta,
|
|
38
45
|
ListItem: () => import_list_item.meta,
|
|
39
46
|
Paragraph: () => import_paragraph.meta,
|
|
47
|
+
Popover: () => import_radix_popover.metaPopover,
|
|
48
|
+
PopoverContent: () => import_radix_popover.metaPopoverContent,
|
|
49
|
+
PopoverTrigger: () => import_radix_popover.metaPopoverTrigger,
|
|
40
50
|
RadioButton: () => import_radio_button.meta,
|
|
41
51
|
RichTextLink: () => import_rich_text_link.meta,
|
|
42
52
|
Separator: () => import_separator.meta,
|
|
@@ -46,6 +56,9 @@ __export(metas_exports, {
|
|
|
46
56
|
Superscript: () => import_superscript.meta,
|
|
47
57
|
Text: () => import_text.meta,
|
|
48
58
|
Textarea: () => import_textarea.meta,
|
|
59
|
+
Tooltip: () => import_radix_tooltip.metaTooltip,
|
|
60
|
+
TooltipContent: () => import_radix_tooltip.metaTooltipContent,
|
|
61
|
+
TooltipTrigger: () => import_radix_tooltip.metaTooltipTrigger,
|
|
49
62
|
Vimeo: () => import_vimeo.meta,
|
|
50
63
|
VimeoPlayButton: () => import_vimeo_play_button.meta,
|
|
51
64
|
VimeoPreviewImage: () => import_vimeo_preview_image.meta,
|
|
@@ -84,3 +97,6 @@ var import_vimeo = require("./vimeo.ws");
|
|
|
84
97
|
var import_vimeo_preview_image = require("./vimeo-preview-image.ws");
|
|
85
98
|
var import_vimeo_play_button = require("./vimeo-play-button.ws");
|
|
86
99
|
var import_vimeo_spinner = require("./vimeo-spinner.ws");
|
|
100
|
+
var import_radix_tooltip = require("./radix-tooltip.ws");
|
|
101
|
+
var import_radix_popover = require("./radix-popover.ws");
|
|
102
|
+
var import_radix_dialog = require("./radix-dialog.ws");
|
package/lib/cjs/props.js
CHANGED
|
@@ -25,6 +25,13 @@ __export(props_exports, {
|
|
|
25
25
|
Button: () => import_button.propsMeta,
|
|
26
26
|
Checkbox: () => import_checkbox.propsMeta,
|
|
27
27
|
CodeText: () => import_code_text.propsMeta,
|
|
28
|
+
Dialog: () => import_radix_dialog.propsMetaDialog,
|
|
29
|
+
DialogClose: () => import_radix_dialog.propsMetaDialogClose,
|
|
30
|
+
DialogContent: () => import_radix_dialog.propsMetaDialogContent,
|
|
31
|
+
DialogDescription: () => import_radix_dialog.propsMetaDialogDescription,
|
|
32
|
+
DialogOverlay: () => import_radix_dialog.propsMetaDialogOverlay,
|
|
33
|
+
DialogTitle: () => import_radix_dialog.propsMetaDialogTitle,
|
|
34
|
+
DialogTrigger: () => import_radix_dialog.propsMetaDialogTrigger,
|
|
28
35
|
Form: () => import_form.propsMeta,
|
|
29
36
|
Fragment: () => import_fragment.propsMeta,
|
|
30
37
|
Heading: () => import_heading.propsMeta,
|
|
@@ -37,6 +44,9 @@ __export(props_exports, {
|
|
|
37
44
|
List: () => import_list.propsMeta,
|
|
38
45
|
ListItem: () => import_list_item.propsMeta,
|
|
39
46
|
Paragraph: () => import_paragraph.propsMeta,
|
|
47
|
+
Popover: () => import_radix_popover.propsMetaPopover,
|
|
48
|
+
PopoverContent: () => import_radix_popover.propsMetaPopoverContent,
|
|
49
|
+
PopoverTrigger: () => import_radix_popover.propsMetaPopoverTrigger,
|
|
40
50
|
RadioButton: () => import_radio_button.propsMeta,
|
|
41
51
|
RichTextLink: () => import_rich_text_link.propsMeta,
|
|
42
52
|
Separator: () => import_separator.propsMeta,
|
|
@@ -46,6 +56,9 @@ __export(props_exports, {
|
|
|
46
56
|
Superscript: () => import_superscript.propsMeta,
|
|
47
57
|
Text: () => import_text.propsMeta,
|
|
48
58
|
Textarea: () => import_textarea.propsMeta,
|
|
59
|
+
Tooltip: () => import_radix_tooltip.propsMetaTooltip,
|
|
60
|
+
TooltipContent: () => import_radix_tooltip.propsMetaTooltipContent,
|
|
61
|
+
TooltipTrigger: () => import_radix_tooltip.propsMetaTooltipTrigger,
|
|
49
62
|
Vimeo: () => import_vimeo.propsMeta,
|
|
50
63
|
VimeoPlayButton: () => import_vimeo_play_button.propsMeta,
|
|
51
64
|
VimeoPreviewImage: () => import_vimeo_preview_image.propsMeta,
|
|
@@ -84,3 +97,6 @@ var import_vimeo = require("./vimeo.ws");
|
|
|
84
97
|
var import_vimeo_preview_image = require("./vimeo-preview-image.ws");
|
|
85
98
|
var import_vimeo_play_button = require("./vimeo-play-button.ws");
|
|
86
99
|
var import_vimeo_spinner = require("./vimeo-spinner.ws");
|
|
100
|
+
var import_radix_tooltip = require("./radix-tooltip.ws");
|
|
101
|
+
var import_radix_popover = require("./radix-popover.ws");
|
|
102
|
+
var import_radix_dialog = require("./radix-dialog.ws");
|
|
@@ -0,0 +1,61 @@
|
|
|
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 radix_dialog_exports = {};
|
|
30
|
+
__export(radix_dialog_exports, {
|
|
31
|
+
Dialog: () => Dialog,
|
|
32
|
+
DialogClose: () => DialogClose,
|
|
33
|
+
DialogContent: () => DialogContent,
|
|
34
|
+
DialogDescription: () => DialogDescription,
|
|
35
|
+
DialogOverlay: () => DialogOverlay,
|
|
36
|
+
DialogTitle: () => DialogTitle,
|
|
37
|
+
DialogTrigger: () => DialogTrigger
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(radix_dialog_exports);
|
|
40
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
+
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
42
|
+
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
43
|
+
var import_react = require("react");
|
|
44
|
+
const DisplayContentsStyle = { display: "contents" };
|
|
45
|
+
const Dialog = (0, import_react.forwardRef)(({ open: openProp, isOpen, ...props }, ref) => {
|
|
46
|
+
const [webstudioAttributes, restProps] = (0, import_react_sdk.splitPropsWithWebstudioAttributes)(props);
|
|
47
|
+
const open = openProp ?? (isOpen === "open" ? true : isOpen === "closed" ? false : void 0);
|
|
48
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, style: DisplayContentsStyle, ...webstudioAttributes, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Root, { open, ...restProps }) });
|
|
49
|
+
});
|
|
50
|
+
const DialogTrigger = (0, import_react.forwardRef)(({ children, ...props }, ref) => {
|
|
51
|
+
const firstChild = import_react.Children.toArray(children)[0];
|
|
52
|
+
const [webstudioAttributes, restProps] = (0, import_react_sdk.splitPropsWithWebstudioAttributes)(props);
|
|
53
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, style: DisplayContentsStyle, ...webstudioAttributes, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Trigger, { asChild: true, ...restProps, children: firstChild ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { children: "Add button or link" }) }) });
|
|
54
|
+
});
|
|
55
|
+
const DialogOverlay = (0, import_react.forwardRef)((props, ref) => {
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.DialogPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Overlay, { ref, ...props }) });
|
|
57
|
+
});
|
|
58
|
+
const DialogContent = DialogPrimitive.Content;
|
|
59
|
+
const DialogClose = DialogPrimitive.Close;
|
|
60
|
+
const DialogTitle = DialogPrimitive.Title;
|
|
61
|
+
const DialogDescription = DialogPrimitive.Description;
|
|
@@ -0,0 +1,300 @@
|
|
|
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 radix_dialog_ws_exports = {};
|
|
30
|
+
__export(radix_dialog_ws_exports, {
|
|
31
|
+
metaDialog: () => metaDialog,
|
|
32
|
+
metaDialogClose: () => metaDialogClose,
|
|
33
|
+
metaDialogContent: () => metaDialogContent,
|
|
34
|
+
metaDialogDescription: () => metaDialogDescription,
|
|
35
|
+
metaDialogOverlay: () => metaDialogOverlay,
|
|
36
|
+
metaDialogTitle: () => metaDialogTitle,
|
|
37
|
+
metaDialogTrigger: () => metaDialogTrigger,
|
|
38
|
+
propsMetaDialog: () => propsMetaDialog,
|
|
39
|
+
propsMetaDialogClose: () => propsMetaDialogClose,
|
|
40
|
+
propsMetaDialogContent: () => propsMetaDialogContent,
|
|
41
|
+
propsMetaDialogDescription: () => propsMetaDialogDescription,
|
|
42
|
+
propsMetaDialogOverlay: () => propsMetaDialogOverlay,
|
|
43
|
+
propsMetaDialogTitle: () => propsMetaDialogTitle,
|
|
44
|
+
propsMetaDialogTrigger: () => propsMetaDialogTrigger
|
|
45
|
+
});
|
|
46
|
+
module.exports = __toCommonJS(radix_dialog_ws_exports);
|
|
47
|
+
var import_svg = require("@webstudio-is/icons/svg");
|
|
48
|
+
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
49
|
+
var tc = __toESM(require("./theme/tailwind-classes"), 1);
|
|
50
|
+
var import_radix_dialog = require("./__generated__/radix-dialog.props");
|
|
51
|
+
const metaDialogTrigger = {
|
|
52
|
+
category: "hidden",
|
|
53
|
+
invalidAncestors: [],
|
|
54
|
+
type: "container",
|
|
55
|
+
label: "DialogTrigger",
|
|
56
|
+
icon: import_svg.RadioCheckedIcon,
|
|
57
|
+
stylable: false,
|
|
58
|
+
detachable: false
|
|
59
|
+
};
|
|
60
|
+
const metaDialogContent = {
|
|
61
|
+
category: "hidden",
|
|
62
|
+
invalidAncestors: [],
|
|
63
|
+
type: "container",
|
|
64
|
+
label: "DialogContent",
|
|
65
|
+
icon: import_svg.RadioCheckedIcon,
|
|
66
|
+
detachable: false
|
|
67
|
+
};
|
|
68
|
+
const metaDialogOverlay = {
|
|
69
|
+
category: "hidden",
|
|
70
|
+
invalidAncestors: [],
|
|
71
|
+
type: "container",
|
|
72
|
+
label: "DialogOverlay",
|
|
73
|
+
icon: import_svg.RadioCheckedIcon,
|
|
74
|
+
detachable: false
|
|
75
|
+
};
|
|
76
|
+
const metaDialogTitle = {
|
|
77
|
+
category: "hidden",
|
|
78
|
+
invalidAncestors: [],
|
|
79
|
+
type: "container",
|
|
80
|
+
label: "DialogTitle",
|
|
81
|
+
icon: import_svg.RadioCheckedIcon
|
|
82
|
+
};
|
|
83
|
+
const metaDialogDescription = {
|
|
84
|
+
category: "hidden",
|
|
85
|
+
invalidAncestors: [],
|
|
86
|
+
type: "container",
|
|
87
|
+
label: "DialogDescription",
|
|
88
|
+
icon: import_svg.RadioCheckedIcon
|
|
89
|
+
};
|
|
90
|
+
const metaDialogClose = {
|
|
91
|
+
category: "hidden",
|
|
92
|
+
invalidAncestors: [],
|
|
93
|
+
type: "container",
|
|
94
|
+
label: "DialogClose",
|
|
95
|
+
icon: import_svg.RadioCheckedIcon
|
|
96
|
+
};
|
|
97
|
+
const metaDialog = {
|
|
98
|
+
category: "radix",
|
|
99
|
+
invalidAncestors: [],
|
|
100
|
+
type: "container",
|
|
101
|
+
label: "Dialog",
|
|
102
|
+
icon: import_svg.RadioCheckedIcon,
|
|
103
|
+
order: 15,
|
|
104
|
+
stylable: false,
|
|
105
|
+
template: [
|
|
106
|
+
{
|
|
107
|
+
type: "instance",
|
|
108
|
+
component: "Dialog",
|
|
109
|
+
label: "Dialog",
|
|
110
|
+
props: [
|
|
111
|
+
{
|
|
112
|
+
name: "isOpen",
|
|
113
|
+
// We don't have support for boolean or undefined, instead of binding on open we bind on a string
|
|
114
|
+
type: "string",
|
|
115
|
+
value: "initial",
|
|
116
|
+
dataSourceRef: {
|
|
117
|
+
type: "variable",
|
|
118
|
+
name: "isOpen"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
children: [
|
|
123
|
+
{
|
|
124
|
+
type: "instance",
|
|
125
|
+
component: "DialogTrigger",
|
|
126
|
+
props: [],
|
|
127
|
+
children: [
|
|
128
|
+
{
|
|
129
|
+
type: "instance",
|
|
130
|
+
component: "Button",
|
|
131
|
+
children: [{ type: "text", value: "Button" }]
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
type: "instance",
|
|
137
|
+
component: "DialogOverlay",
|
|
138
|
+
label: "Dialog Overlay",
|
|
139
|
+
props: [],
|
|
140
|
+
/**
|
|
141
|
+
* fixed inset-0 z-50 bg-background/80 backdrop-blur-sm
|
|
142
|
+
* flex
|
|
143
|
+
**/
|
|
144
|
+
styles: [
|
|
145
|
+
tc.fixed(),
|
|
146
|
+
tc.inset(0),
|
|
147
|
+
tc.z(50),
|
|
148
|
+
tc.bg("background", 80),
|
|
149
|
+
tc.backdropBlur("sm"),
|
|
150
|
+
// To allow positioning Content
|
|
151
|
+
tc.flex()
|
|
152
|
+
].flat(),
|
|
153
|
+
children: [
|
|
154
|
+
{
|
|
155
|
+
type: "instance",
|
|
156
|
+
component: "DialogContent",
|
|
157
|
+
label: "Dialog Content",
|
|
158
|
+
props: [],
|
|
159
|
+
/**
|
|
160
|
+
* fixed w-full z-50
|
|
161
|
+
* grid gap-4 max-w-lg
|
|
162
|
+
* m-auto
|
|
163
|
+
* border bg-background p-6 shadow-lg
|
|
164
|
+
**/
|
|
165
|
+
styles: [
|
|
166
|
+
tc.w("full"),
|
|
167
|
+
tc.z(50),
|
|
168
|
+
tc.flex(),
|
|
169
|
+
tc.flex("col"),
|
|
170
|
+
tc.gap(4),
|
|
171
|
+
tc.m("auto"),
|
|
172
|
+
tc.maxW("lg"),
|
|
173
|
+
tc.border(),
|
|
174
|
+
tc.bg("background"),
|
|
175
|
+
tc.p(6),
|
|
176
|
+
tc.shadow("lg"),
|
|
177
|
+
tc.relative()
|
|
178
|
+
].flat(),
|
|
179
|
+
children: [
|
|
180
|
+
{
|
|
181
|
+
type: "instance",
|
|
182
|
+
component: "Box",
|
|
183
|
+
label: "Dialog Header",
|
|
184
|
+
props: [],
|
|
185
|
+
styles: [tc.flex(), tc.flex("col"), tc.gap(1)].flat(),
|
|
186
|
+
children: [
|
|
187
|
+
{
|
|
188
|
+
type: "instance",
|
|
189
|
+
component: "DialogTitle",
|
|
190
|
+
label: "Dialog Title",
|
|
191
|
+
props: [],
|
|
192
|
+
/**
|
|
193
|
+
* text-lg leading-none tracking-tight
|
|
194
|
+
**/
|
|
195
|
+
styles: [
|
|
196
|
+
tc.my(0),
|
|
197
|
+
tc.leading("none"),
|
|
198
|
+
tc.text("lg"),
|
|
199
|
+
tc.tracking("tight")
|
|
200
|
+
].flat(),
|
|
201
|
+
children: [
|
|
202
|
+
{
|
|
203
|
+
type: "text",
|
|
204
|
+
value: "Dialog Title"
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
type: "instance",
|
|
210
|
+
component: "DialogDescription",
|
|
211
|
+
label: "Dialog Description",
|
|
212
|
+
props: [],
|
|
213
|
+
/**
|
|
214
|
+
* text-sm text-muted-foreground
|
|
215
|
+
**/
|
|
216
|
+
styles: [
|
|
217
|
+
tc.my(0),
|
|
218
|
+
tc.text("sm"),
|
|
219
|
+
tc.text("mutedForeground")
|
|
220
|
+
].flat(),
|
|
221
|
+
children: [
|
|
222
|
+
{
|
|
223
|
+
type: "text",
|
|
224
|
+
value: "dialog description text you can edit"
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
type: "instance",
|
|
232
|
+
component: "Text",
|
|
233
|
+
children: [{ type: "text", value: "The text you can edit" }]
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
type: "instance",
|
|
237
|
+
component: "DialogClose",
|
|
238
|
+
label: "Dialog Close",
|
|
239
|
+
props: [],
|
|
240
|
+
/**
|
|
241
|
+
* absolute right-4 top-4
|
|
242
|
+
* rounded-sm opacity-70
|
|
243
|
+
* ring-offset-background
|
|
244
|
+
* hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
|
|
245
|
+
* flex items-center justify-center h-4 w-4
|
|
246
|
+
**/
|
|
247
|
+
styles: [
|
|
248
|
+
tc.absolute(),
|
|
249
|
+
tc.right(4),
|
|
250
|
+
tc.top(4),
|
|
251
|
+
tc.rounded("sm"),
|
|
252
|
+
tc.opacity(70),
|
|
253
|
+
tc.flex(),
|
|
254
|
+
tc.items("center"),
|
|
255
|
+
tc.justify("center"),
|
|
256
|
+
tc.h(4),
|
|
257
|
+
tc.w(4),
|
|
258
|
+
tc.border(0),
|
|
259
|
+
tc.bg("transparent"),
|
|
260
|
+
tc.outline("none"),
|
|
261
|
+
tc.hover(tc.opacity(100)),
|
|
262
|
+
tc.focus(tc.ring("ring", 2, "background", 2))
|
|
263
|
+
].flat(),
|
|
264
|
+
children: [{ type: "text", value: "\u2715" }]
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
};
|
|
274
|
+
const propsMetaDialog = {
|
|
275
|
+
props: import_radix_dialog.propsDialog,
|
|
276
|
+
initialProps: ["isOpen", "modal"]
|
|
277
|
+
};
|
|
278
|
+
const propsMetaDialogTrigger = {
|
|
279
|
+
props: import_radix_dialog.propsDialogTrigger
|
|
280
|
+
};
|
|
281
|
+
const propsMetaDialogContent = {
|
|
282
|
+
props: import_radix_dialog.propsDialogContent,
|
|
283
|
+
initialProps: []
|
|
284
|
+
};
|
|
285
|
+
const propsMetaDialogOverlay = {
|
|
286
|
+
props: import_radix_dialog.propsDialogOverlay,
|
|
287
|
+
initialProps: []
|
|
288
|
+
};
|
|
289
|
+
const propsMetaDialogClose = {
|
|
290
|
+
props: import_radix_dialog.propsDialogClose,
|
|
291
|
+
initialProps: []
|
|
292
|
+
};
|
|
293
|
+
const propsMetaDialogTitle = {
|
|
294
|
+
props: import_radix_dialog.propsDialogTitle,
|
|
295
|
+
initialProps: []
|
|
296
|
+
};
|
|
297
|
+
const propsMetaDialogDescription = {
|
|
298
|
+
props: import_radix_dialog.propsDialogDescription,
|
|
299
|
+
initialProps: []
|
|
300
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
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 radix_popover_exports = {};
|
|
30
|
+
__export(radix_popover_exports, {
|
|
31
|
+
Popover: () => Popover,
|
|
32
|
+
PopoverContent: () => PopoverContent,
|
|
33
|
+
PopoverTrigger: () => PopoverTrigger
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(radix_popover_exports);
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
|
|
38
|
+
var import_react_sdk = require("@webstudio-is/react-sdk");
|
|
39
|
+
var import_react = require("react");
|
|
40
|
+
const DisplayContentsStyle = { display: "contents" };
|
|
41
|
+
const Popover = (0, import_react.forwardRef)(({ open: openProp, isOpen, ...props }, ref) => {
|
|
42
|
+
const [webstudioAttributes, restProps] = (0, import_react_sdk.splitPropsWithWebstudioAttributes)(props);
|
|
43
|
+
const open = openProp ?? (isOpen === "open" ? true : isOpen === "closed" ? false : void 0);
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, style: DisplayContentsStyle, ...webstudioAttributes, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Root, { open, ...restProps }) });
|
|
45
|
+
});
|
|
46
|
+
const PopoverTrigger = (0, import_react.forwardRef)(({ children, ...props }, ref) => {
|
|
47
|
+
const firstChild = import_react.Children.toArray(children)[0];
|
|
48
|
+
const [webstudioAttributes, restProps] = (0, import_react_sdk.splitPropsWithWebstudioAttributes)(props);
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, style: DisplayContentsStyle, ...webstudioAttributes, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Trigger, { asChild: true, ...restProps, children: firstChild ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { children: "Add button or link" }) }) });
|
|
50
|
+
});
|
|
51
|
+
const PopoverContent = (0, import_react.forwardRef)(({ sideOffset = 4, align = "center", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
+
PopoverPrimitive.Content,
|
|
53
|
+
{
|
|
54
|
+
ref,
|
|
55
|
+
align: "center",
|
|
56
|
+
sideOffset,
|
|
57
|
+
...props
|
|
58
|
+
}
|
|
59
|
+
) }));
|