@webstudio-is/react-sdk 0.60.0 → 0.62.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/app/custom-components/__generated__/form.props.js +412 -0
- package/lib/app/custom-components/__generated__/image.props.js +442 -0
- package/lib/app/custom-components/__generated__/link-block.props.js +432 -0
- package/lib/app/custom-components/__generated__/link.props.js +432 -0
- package/lib/app/custom-components/__generated__/rich-text-link.props.js +432 -0
- package/lib/app/custom-components/form.js +54 -0
- package/lib/app/custom-components/form.ws.js +81 -0
- package/lib/app/custom-components/index.js +10 -4
- package/lib/cjs/app/custom-components/__generated__/form.props.js +432 -0
- package/lib/cjs/app/custom-components/__generated__/image.props.js +462 -0
- package/lib/cjs/app/custom-components/__generated__/link-block.props.js +452 -0
- package/lib/cjs/app/custom-components/__generated__/link.props.js +452 -0
- package/lib/cjs/app/custom-components/__generated__/rich-text-link.props.js +452 -0
- package/lib/cjs/app/custom-components/form.js +70 -0
- package/lib/cjs/app/custom-components/form.ws.js +101 -0
- package/lib/cjs/app/custom-components/index.js +12 -6
- package/lib/cjs/components/__generated__/checkbox-field.props.js +419 -0
- package/lib/cjs/components/__generated__/checkbox.props.js +459 -0
- package/lib/cjs/components/__generated__/error-message.props.js +418 -0
- package/lib/cjs/components/__generated__/input.props.js +8 -3
- package/lib/cjs/components/__generated__/label.props.js +420 -0
- package/lib/cjs/components/__generated__/radio-button-field.props.js +419 -0
- package/lib/cjs/components/__generated__/radio-button.props.js +459 -0
- package/lib/cjs/components/__generated__/success-message.props.js +418 -0
- package/lib/cjs/components/__generated__/textarea.props.js +432 -0
- package/lib/cjs/components/blockquote.ws.js +36 -48
- package/lib/cjs/components/body.ws.js +20 -17
- package/lib/cjs/components/button.ws.js +8 -3
- package/lib/cjs/components/checkbox-field.js +29 -0
- package/lib/cjs/components/checkbox-field.ws.js +53 -0
- package/lib/cjs/components/checkbox.js +29 -0
- package/lib/cjs/components/checkbox.ws.js +55 -0
- package/lib/cjs/components/code.ws.js +20 -28
- package/lib/cjs/components/component-meta.js +3 -1
- package/lib/cjs/components/components-utils.js +9 -1
- package/lib/cjs/components/components.js +17 -1
- package/lib/cjs/components/error-message.js +29 -0
- package/lib/cjs/components/error-message.ws.js +40 -0
- package/lib/cjs/components/form.js +1 -1
- package/lib/cjs/components/form.ws.js +35 -9
- package/lib/cjs/components/heading.ws.js +1 -1
- package/lib/cjs/components/image.ws.js +8 -9
- package/lib/cjs/components/index.js +43 -2
- package/lib/cjs/components/input.ws.js +15 -3
- package/lib/cjs/components/italic.ws.js +5 -5
- package/lib/cjs/components/label.js +29 -0
- package/lib/cjs/components/label.ws.js +54 -0
- package/lib/cjs/components/link-block.ws.js +6 -6
- package/lib/cjs/components/link.ws.js +9 -10
- package/lib/cjs/components/list-item.ws.js +2 -1
- package/lib/cjs/components/list.ws.js +22 -22
- package/lib/cjs/components/paragraph.ws.js +1 -1
- package/lib/cjs/components/radio-button-field.js +29 -0
- package/lib/cjs/components/radio-button-field.ws.js +53 -0
- package/lib/cjs/components/radio-button.js +29 -0
- package/lib/cjs/components/radio-button.ws.js +55 -0
- package/lib/cjs/components/separator.ws.js +20 -20
- package/lib/cjs/components/success-message.js +29 -0
- package/lib/cjs/components/success-message.ws.js +40 -0
- package/lib/cjs/components/text-block.ws.js +6 -7
- package/lib/cjs/components/textarea.js +29 -0
- package/lib/cjs/components/textarea.ws.js +56 -0
- package/lib/cjs/css/css.js +6 -9
- package/lib/cjs/css/normalize.js +168 -185
- package/lib/cjs/css/presets.js +14 -34
- package/lib/cjs/css/style-rules.js +17 -0
- package/lib/cjs/embed-template.js +160 -0
- package/lib/cjs/index.js +1 -0
- package/lib/components/__generated__/checkbox-field.props.js +399 -0
- package/lib/components/__generated__/checkbox.props.js +439 -0
- package/lib/components/__generated__/error-message.props.js +398 -0
- package/lib/components/__generated__/input.props.js +8 -3
- package/lib/components/__generated__/label.props.js +400 -0
- package/lib/components/__generated__/radio-button-field.props.js +399 -0
- package/lib/components/__generated__/radio-button.props.js +439 -0
- package/lib/components/__generated__/success-message.props.js +398 -0
- package/lib/components/__generated__/textarea.props.js +412 -0
- package/lib/components/blockquote.ws.js +36 -48
- package/lib/components/body.ws.js +20 -17
- package/lib/components/button.ws.js +8 -3
- package/lib/components/checkbox-field.js +9 -0
- package/lib/components/checkbox-field.ws.js +33 -0
- package/lib/components/checkbox.js +9 -0
- package/lib/components/checkbox.ws.js +35 -0
- package/lib/components/code.ws.js +20 -28
- package/lib/components/component-meta.js +3 -1
- package/lib/components/components-utils.js +9 -1
- package/lib/components/components.js +17 -1
- package/lib/components/error-message.js +9 -0
- package/lib/components/error-message.ws.js +20 -0
- package/lib/components/form.js +1 -1
- package/lib/components/form.ws.js +35 -9
- package/lib/components/heading.ws.js +1 -1
- package/lib/components/image.ws.js +8 -9
- package/lib/components/index.js +43 -2
- package/lib/components/input.ws.js +15 -3
- package/lib/components/italic.ws.js +5 -5
- package/lib/components/label.js +9 -0
- package/lib/components/label.ws.js +34 -0
- package/lib/components/link-block.ws.js +7 -7
- package/lib/components/link.ws.js +9 -10
- package/lib/components/list-item.ws.js +2 -1
- package/lib/components/list.ws.js +22 -22
- package/lib/components/paragraph.ws.js +1 -1
- package/lib/components/radio-button-field.js +9 -0
- package/lib/components/radio-button-field.ws.js +33 -0
- package/lib/components/radio-button.js +9 -0
- package/lib/components/radio-button.ws.js +35 -0
- package/lib/components/separator.ws.js +20 -20
- package/lib/components/success-message.js +9 -0
- package/lib/components/success-message.ws.js +20 -0
- package/lib/components/text-block.ws.js +6 -7
- package/lib/components/textarea.js +9 -0
- package/lib/components/textarea.ws.js +36 -0
- package/lib/css/css.js +8 -11
- package/lib/css/normalize.js +168 -185
- package/lib/css/presets.js +14 -34
- package/lib/css/style-rules.js +17 -0
- package/lib/embed-template.js +140 -0
- package/lib/index.js +1 -0
- package/lib/types/app/custom-components/__generated__/form.props.d.ts +2 -0
- package/lib/types/app/custom-components/__generated__/image.props.d.ts +2 -0
- package/lib/types/app/custom-components/__generated__/link-block.props.d.ts +2 -0
- package/lib/types/app/custom-components/__generated__/link.props.d.ts +2 -0
- package/lib/types/app/custom-components/__generated__/rich-text-link.props.d.ts +2 -0
- package/lib/types/app/custom-components/form.d.ts +5 -0
- package/lib/types/app/custom-components/form.ws.d.ts +3 -0
- package/lib/types/app/custom-components/index.d.ts +6 -1
- package/lib/types/components/__generated__/checkbox-field.props.d.ts +2 -0
- package/lib/types/components/__generated__/checkbox.props.d.ts +2 -0
- package/lib/types/components/__generated__/error-message.props.d.ts +2 -0
- package/lib/types/components/__generated__/label.props.d.ts +2 -0
- package/lib/types/components/__generated__/radio-button-field.props.d.ts +2 -0
- package/lib/types/components/__generated__/radio-button.props.d.ts +2 -0
- package/lib/types/components/__generated__/success-message.props.d.ts +2 -0
- package/lib/types/components/__generated__/textarea.props.d.ts +2 -0
- package/lib/types/components/box.stories.d.ts +2 -2
- package/lib/types/components/checkbox-field.d.ts +3 -0
- package/lib/types/components/checkbox-field.ws.d.ts +3 -0
- package/lib/types/components/checkbox.d.ts +3 -0
- package/lib/types/components/checkbox.ws.d.ts +3 -0
- package/lib/types/components/component-meta.d.ts +23 -5
- package/lib/types/components/components-utils.d.ts +5 -20
- package/lib/types/components/components.d.ts +8 -0
- package/lib/types/components/error-message.d.ts +3 -0
- package/lib/types/components/error-message.ws.d.ts +3 -0
- package/lib/types/components/index.d.ts +1 -0
- package/lib/types/components/input.d.ts +3 -1
- package/lib/types/components/input.stories.d.ts +6 -2
- package/lib/types/components/label.d.ts +3 -0
- package/lib/types/components/label.ws.d.ts +3 -0
- package/lib/types/components/radio-button-field.d.ts +3 -0
- package/lib/types/components/radio-button-field.ws.d.ts +3 -0
- package/lib/types/components/radio-button.d.ts +3 -0
- package/lib/types/components/radio-button.ws.d.ts +3 -0
- package/lib/types/components/success-message.d.ts +3 -0
- package/lib/types/components/success-message.ws.d.ts +3 -0
- package/lib/types/components/textarea.d.ts +3 -0
- package/lib/types/components/textarea.ws.d.ts +3 -0
- package/lib/types/css/normalize.d.ts +8977 -2286
- package/lib/types/css/presets.d.ts +2 -38
- package/lib/types/css/style-rules.d.ts +11 -9
- package/lib/types/embed-template.d.ts +1725 -0
- package/lib/types/embed-template.test.d.ts +1 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +15 -14
- package/src/app/custom-components/__generated__/form.props.ts +457 -0
- package/src/app/custom-components/__generated__/image.props.ts +487 -0
- package/src/app/custom-components/__generated__/link-block.props.ts +477 -0
- package/src/app/custom-components/__generated__/link.props.ts +477 -0
- package/src/app/custom-components/__generated__/rich-text-link.props.ts +477 -0
- package/src/app/custom-components/form.tsx +94 -0
- package/src/app/custom-components/form.ws.tsx +86 -0
- package/src/app/custom-components/index.ts +9 -4
- package/src/components/__generated__/checkbox-field.props.ts +444 -0
- package/src/components/__generated__/checkbox.props.ts +484 -0
- package/src/components/__generated__/error-message.props.ts +443 -0
- package/src/components/__generated__/input.props.ts +8 -3
- package/src/components/__generated__/label.props.ts +445 -0
- package/src/components/__generated__/radio-button-field.props.ts +444 -0
- package/src/components/__generated__/radio-button.props.ts +484 -0
- package/src/components/__generated__/success-message.props.ts +443 -0
- package/src/components/__generated__/textarea.props.ts +457 -0
- package/src/components/blockquote.ws.tsx +42 -52
- package/src/components/body.ws.tsx +26 -23
- package/src/components/bold.ws.tsx +6 -3
- package/src/components/box.ws.ts +6 -3
- package/src/components/button.ws.tsx +13 -5
- package/src/components/checkbox-field.tsx +10 -0
- package/src/components/checkbox-field.ws.tsx +38 -0
- package/src/components/checkbox.tsx +13 -0
- package/src/components/checkbox.ws.tsx +40 -0
- package/src/components/code.ws.tsx +26 -32
- package/src/components/component-meta.ts +6 -3
- package/src/components/components-utils.ts +16 -10
- package/src/components/components.ts +8 -0
- package/src/components/error-message.tsx +10 -0
- package/src/components/error-message.ws.tsx +24 -0
- package/src/components/form.tsx +5 -1
- package/src/components/form.ws.tsx +39 -10
- package/src/components/heading.ws.tsx +7 -4
- package/src/components/image.ws.tsx +14 -12
- package/src/components/index.ts +47 -0
- package/src/components/input.tsx +3 -1
- package/src/components/input.ws.tsx +19 -4
- package/src/components/italic.ws.tsx +11 -8
- package/src/components/label.tsx +10 -0
- package/src/components/label.ws.tsx +39 -0
- package/src/components/link-block.ws.tsx +13 -10
- package/src/components/link.ws.tsx +15 -13
- package/src/components/list-item.ws.tsx +8 -4
- package/src/components/list.ws.tsx +28 -25
- package/src/components/paragraph.ws.tsx +7 -4
- package/src/components/radio-button-field.tsx +10 -0
- package/src/components/radio-button-field.ws.tsx +38 -0
- package/src/components/radio-button.tsx +13 -0
- package/src/components/radio-button.ws.tsx +40 -0
- package/src/components/separator.ws.tsx +26 -25
- package/src/components/span.ws.tsx +6 -3
- package/src/components/subscript.ws.tsx +6 -3
- package/src/components/success-message.tsx +10 -0
- package/src/components/success-message.ws.tsx +24 -0
- package/src/components/superscript.ws.tsx +6 -3
- package/src/components/text-block.ws.tsx +12 -11
- package/src/components/textarea.tsx +13 -0
- package/src/components/textarea.ws.tsx +41 -0
- package/src/css/css.ts +8 -11
- package/src/css/normalize.ts +166 -188
- package/src/css/presets.ts +15 -37
- package/src/css/style-rules.ts +24 -0
- package/src/embed-template.test.ts +210 -0
- package/src/embed-template.ts +187 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var label_ws_exports = {};
|
|
20
|
+
__export(label_ws_exports, {
|
|
21
|
+
meta: () => meta,
|
|
22
|
+
propsMeta: () => propsMeta
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(label_ws_exports);
|
|
25
|
+
var import_icons = require("@webstudio-is/icons");
|
|
26
|
+
var import_label = require("./__generated__/label.props");
|
|
27
|
+
var import_normalize = require("../css/normalize");
|
|
28
|
+
const presetStyle = {
|
|
29
|
+
label: [
|
|
30
|
+
...import_normalize.label,
|
|
31
|
+
{ property: "display", value: { type: "keyword", value: "block" } }
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
const meta = {
|
|
35
|
+
category: "forms",
|
|
36
|
+
type: "rich-text",
|
|
37
|
+
label: "Input Label",
|
|
38
|
+
Icon: import_icons.TextBlockIcon,
|
|
39
|
+
presetStyle,
|
|
40
|
+
children: [{ type: "text", value: "Form Label" }]
|
|
41
|
+
};
|
|
42
|
+
const propsMeta = {
|
|
43
|
+
props: {
|
|
44
|
+
...import_label.props,
|
|
45
|
+
htmlFor: {
|
|
46
|
+
required: false,
|
|
47
|
+
control: "text",
|
|
48
|
+
type: "string",
|
|
49
|
+
rows: 0,
|
|
50
|
+
label: "For"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
initialProps: ["htmlFor"]
|
|
54
|
+
};
|
|
@@ -27,19 +27,19 @@ var import_link_block = require("./__generated__/link-block.props");
|
|
|
27
27
|
var import_link = require("./link.ws");
|
|
28
28
|
var import_normalize = require("../css/normalize");
|
|
29
29
|
const presetStyle = {
|
|
30
|
-
a:
|
|
30
|
+
a: [
|
|
31
31
|
...import_normalize.a,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
value: "inline-block"
|
|
32
|
+
{
|
|
33
|
+
property: "display",
|
|
34
|
+
value: { type: "keyword", value: "inline-block" }
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
]
|
|
37
37
|
};
|
|
38
38
|
const meta = {
|
|
39
39
|
category: "general",
|
|
40
40
|
type: "container",
|
|
41
41
|
label: "Link Block",
|
|
42
|
-
Icon: import_icons.
|
|
42
|
+
Icon: import_icons.LinkBlockIcon,
|
|
43
43
|
states: import_link.meta.states,
|
|
44
44
|
presetStyle
|
|
45
45
|
};
|
|
@@ -26,18 +26,17 @@ var import_icons = require("@webstudio-is/icons");
|
|
|
26
26
|
var import_normalize = require("../css/normalize");
|
|
27
27
|
var import_link = require("./__generated__/link.props");
|
|
28
28
|
const presetStyle = {
|
|
29
|
-
a:
|
|
29
|
+
a: [
|
|
30
30
|
...import_normalize.a,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
unit: "em",
|
|
34
|
-
value: 1
|
|
31
|
+
{
|
|
32
|
+
property: "minHeight",
|
|
33
|
+
value: { type: "unit", unit: "em", value: 1 }
|
|
35
34
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
value: "inline-block"
|
|
35
|
+
{
|
|
36
|
+
property: "display",
|
|
37
|
+
value: { type: "keyword", value: "inline-block" }
|
|
39
38
|
}
|
|
40
|
-
|
|
39
|
+
]
|
|
41
40
|
};
|
|
42
41
|
const meta = {
|
|
43
42
|
category: "general",
|
|
@@ -46,7 +45,7 @@ const meta = {
|
|
|
46
45
|
Icon: import_icons.LinkIcon,
|
|
47
46
|
presetStyle,
|
|
48
47
|
states: [{ selector: "[aria-current=page]", label: "Current page" }],
|
|
49
|
-
children: ["Link text you can edit"]
|
|
48
|
+
children: [{ type: "text", value: "Link text you can edit" }]
|
|
50
49
|
};
|
|
51
50
|
const propsMeta = {
|
|
52
51
|
props: {
|
|
@@ -31,9 +31,10 @@ const presetStyle = {
|
|
|
31
31
|
const meta = {
|
|
32
32
|
category: "typography",
|
|
33
33
|
type: "rich-text",
|
|
34
|
+
acceptedParents: ["List"],
|
|
34
35
|
label: "List Item",
|
|
35
36
|
Icon: import_icons.ListItemIcon,
|
|
36
|
-
children: ["List Item you can edit"],
|
|
37
|
+
children: [{ type: "text", value: "List Item you can edit" }],
|
|
37
38
|
presetStyle
|
|
38
39
|
};
|
|
39
40
|
const propsMeta = {
|
|
@@ -26,36 +26,36 @@ var import_icons = require("@webstudio-is/icons");
|
|
|
26
26
|
var import_list = require("./__generated__/list.props");
|
|
27
27
|
var import_normalize = require("../css/normalize");
|
|
28
28
|
const presetStyle = {
|
|
29
|
-
ol:
|
|
29
|
+
ol: [
|
|
30
30
|
...import_normalize.ol,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
value: "0"
|
|
31
|
+
{
|
|
32
|
+
property: "marginTop",
|
|
33
|
+
value: { type: "keyword", value: "0" }
|
|
34
34
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
value: "10px"
|
|
35
|
+
{
|
|
36
|
+
property: "marginBottom",
|
|
37
|
+
value: { type: "keyword", value: "10px" }
|
|
38
38
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
value: "40px"
|
|
39
|
+
{
|
|
40
|
+
property: "paddingLeft",
|
|
41
|
+
value: { type: "keyword", value: "40px" }
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
ul:
|
|
43
|
+
],
|
|
44
|
+
ul: [
|
|
45
45
|
...import_normalize.ul,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
value: "0"
|
|
46
|
+
{
|
|
47
|
+
property: "marginTop",
|
|
48
|
+
value: { type: "keyword", value: "0" }
|
|
49
49
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
value: "10px"
|
|
50
|
+
{
|
|
51
|
+
property: "marginBottom",
|
|
52
|
+
value: { type: "keyword", value: "10px" }
|
|
53
53
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
value: "40px"
|
|
54
|
+
{
|
|
55
|
+
property: "paddingLeft",
|
|
56
|
+
value: { type: "keyword", value: "40px" }
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
]
|
|
59
59
|
};
|
|
60
60
|
const meta = {
|
|
61
61
|
category: "typography",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var radio_button_field_exports = {};
|
|
20
|
+
__export(radio_button_field_exports, {
|
|
21
|
+
RadioButtonField: () => RadioButtonField,
|
|
22
|
+
defaultTag: () => defaultTag
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(radio_button_field_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
const defaultTag = "label";
|
|
28
|
+
const RadioButtonField = (0, import_react.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { ...props, ref }));
|
|
29
|
+
RadioButtonField.displayName = "RadioButtonField";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var radio_button_field_ws_exports = {};
|
|
20
|
+
__export(radio_button_field_ws_exports, {
|
|
21
|
+
meta: () => meta,
|
|
22
|
+
propsMeta: () => propsMeta
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(radio_button_field_ws_exports);
|
|
25
|
+
var import_icons = require("@webstudio-is/icons");
|
|
26
|
+
var import_radio_button_field = require("./__generated__/radio-button-field.props");
|
|
27
|
+
var import_normalize = require("../css/normalize");
|
|
28
|
+
const presetStyle = {
|
|
29
|
+
label: [
|
|
30
|
+
...import_normalize.label,
|
|
31
|
+
{ property: "display", value: { type: "keyword", value: "flex" } }
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
const meta = {
|
|
35
|
+
category: "forms",
|
|
36
|
+
type: "container",
|
|
37
|
+
label: "Radio Button Field",
|
|
38
|
+
Icon: import_icons.RadioCheckedIcon,
|
|
39
|
+
presetStyle,
|
|
40
|
+
children: [
|
|
41
|
+
{ type: "instance", component: "RadioButton", props: [], children: [] },
|
|
42
|
+
{
|
|
43
|
+
type: "instance",
|
|
44
|
+
component: "TextBlock",
|
|
45
|
+
props: [],
|
|
46
|
+
children: [{ type: "text", value: "Radio" }]
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
};
|
|
50
|
+
const propsMeta = {
|
|
51
|
+
props: import_radio_button_field.props,
|
|
52
|
+
initialProps: []
|
|
53
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var radio_button_exports = {};
|
|
20
|
+
__export(radio_button_exports, {
|
|
21
|
+
RadioButton: () => RadioButton,
|
|
22
|
+
defaultTag: () => defaultTag
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(radio_button_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
const defaultTag = "input";
|
|
28
|
+
const RadioButton = (0, import_react.forwardRef)(({ children: _children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { ...props, type: "radio", ref }));
|
|
29
|
+
RadioButton.displayName = "RadioButton";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var radio_button_ws_exports = {};
|
|
20
|
+
__export(radio_button_ws_exports, {
|
|
21
|
+
meta: () => meta,
|
|
22
|
+
propsMeta: () => propsMeta
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(radio_button_ws_exports);
|
|
25
|
+
var import_icons = require("@webstudio-is/icons");
|
|
26
|
+
var import_normalize = require("../css/normalize");
|
|
27
|
+
var import_radio_button = require("./__generated__/radio-button.props");
|
|
28
|
+
const presetStyle = {
|
|
29
|
+
input: [
|
|
30
|
+
...import_normalize.input,
|
|
31
|
+
{
|
|
32
|
+
property: "marginRight",
|
|
33
|
+
value: { type: "unit", unit: "em", value: 0.5 }
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
const meta = {
|
|
38
|
+
type: "control",
|
|
39
|
+
label: "Radio Button",
|
|
40
|
+
Icon: import_icons.RadioCheckedIcon,
|
|
41
|
+
presetStyle,
|
|
42
|
+
states: [
|
|
43
|
+
{ selector: ":checked", label: "Checked" },
|
|
44
|
+
{ selector: ":required", label: "Required" },
|
|
45
|
+
{ selector: ":optional", label: "Optional" },
|
|
46
|
+
{ selector: ":disabled", label: "Disabled" },
|
|
47
|
+
{ selector: ":enabled", label: "Enabled" },
|
|
48
|
+
{ selector: ":read-only", label: "Read Only" },
|
|
49
|
+
{ selector: ":read-write", label: "Read Write" }
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
const propsMeta = {
|
|
53
|
+
props: import_radio_button.props,
|
|
54
|
+
initialProps: ["name"]
|
|
55
|
+
};
|
|
@@ -26,33 +26,33 @@ var import_icons = require("@webstudio-is/icons");
|
|
|
26
26
|
var import_separator = require("./__generated__/separator.props");
|
|
27
27
|
var import_normalize = require("../css/normalize");
|
|
28
28
|
const presetStyle = {
|
|
29
|
-
hr:
|
|
29
|
+
hr: [
|
|
30
30
|
...import_normalize.hr,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
value: "1px"
|
|
31
|
+
{
|
|
32
|
+
property: "height",
|
|
33
|
+
value: { type: "keyword", value: "1px" }
|
|
34
34
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
value: "gray"
|
|
35
|
+
{
|
|
36
|
+
property: "backgroundColor",
|
|
37
|
+
value: { type: "keyword", value: "gray" }
|
|
38
38
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
value: "none"
|
|
39
|
+
{
|
|
40
|
+
property: "borderTopStyle",
|
|
41
|
+
value: { type: "keyword", value: "none" }
|
|
42
42
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
value: "none"
|
|
43
|
+
{
|
|
44
|
+
property: "borderRightStyle",
|
|
45
|
+
value: { type: "keyword", value: "none" }
|
|
46
46
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
value: "none"
|
|
47
|
+
{
|
|
48
|
+
property: "borderLeftStyle",
|
|
49
|
+
value: { type: "keyword", value: "none" }
|
|
50
50
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
value: "none"
|
|
51
|
+
{
|
|
52
|
+
property: "borderBottomStyle",
|
|
53
|
+
value: { type: "keyword", value: "none" }
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
]
|
|
56
56
|
};
|
|
57
57
|
const meta = {
|
|
58
58
|
category: "general",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var success_message_exports = {};
|
|
20
|
+
__export(success_message_exports, {
|
|
21
|
+
SuccessMessage: () => SuccessMessage,
|
|
22
|
+
defaultTag: () => defaultTag
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(success_message_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
const defaultTag = "div";
|
|
28
|
+
const SuccessMessage = (0, import_react.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...props, ref }));
|
|
29
|
+
SuccessMessage.displayName = "SuccessMessage";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var success_message_ws_exports = {};
|
|
20
|
+
__export(success_message_ws_exports, {
|
|
21
|
+
meta: () => meta,
|
|
22
|
+
propsMeta: () => propsMeta
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(success_message_ws_exports);
|
|
25
|
+
var import_icons = require("@webstudio-is/icons");
|
|
26
|
+
var import_success_message = require("./__generated__/success-message.props");
|
|
27
|
+
var import_normalize = require("../css/normalize");
|
|
28
|
+
const presetStyle = {
|
|
29
|
+
div: import_normalize.div
|
|
30
|
+
};
|
|
31
|
+
const meta = {
|
|
32
|
+
type: "container",
|
|
33
|
+
label: "Success Message",
|
|
34
|
+
Icon: import_icons.BoxIcon,
|
|
35
|
+
presetStyle
|
|
36
|
+
};
|
|
37
|
+
const propsMeta = {
|
|
38
|
+
props: import_success_message.props,
|
|
39
|
+
initialProps: []
|
|
40
|
+
};
|
|
@@ -26,14 +26,13 @@ var import_icons = require("@webstudio-is/icons");
|
|
|
26
26
|
var import_text_block = require("./__generated__/text-block.props");
|
|
27
27
|
var import_normalize = require("../css/normalize");
|
|
28
28
|
const presetStyle = {
|
|
29
|
-
div:
|
|
29
|
+
div: [
|
|
30
30
|
...import_normalize.div,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
unit: "em",
|
|
34
|
-
value: 1
|
|
31
|
+
{
|
|
32
|
+
property: "minHeight",
|
|
33
|
+
value: { type: "unit", unit: "em", value: 1 }
|
|
35
34
|
}
|
|
36
|
-
|
|
35
|
+
]
|
|
37
36
|
};
|
|
38
37
|
const meta = {
|
|
39
38
|
category: "typography",
|
|
@@ -41,7 +40,7 @@ const meta = {
|
|
|
41
40
|
label: "Text Block",
|
|
42
41
|
Icon: import_icons.TextBlockIcon,
|
|
43
42
|
presetStyle,
|
|
44
|
-
children: ["Block of text you can edit"]
|
|
43
|
+
children: [{ type: "text", value: "Block of text you can edit" }]
|
|
45
44
|
};
|
|
46
45
|
const propsMeta = {
|
|
47
46
|
props: import_text_block.props
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var textarea_exports = {};
|
|
20
|
+
__export(textarea_exports, {
|
|
21
|
+
Textarea: () => Textarea,
|
|
22
|
+
defaultTag: () => defaultTag
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(textarea_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
const defaultTag = "textarea";
|
|
28
|
+
const Textarea = (0, import_react.forwardRef)(({ children: _children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("textarea", { ...props, ref }));
|
|
29
|
+
Textarea.displayName = "Textarea";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var textarea_ws_exports = {};
|
|
20
|
+
__export(textarea_ws_exports, {
|
|
21
|
+
meta: () => meta,
|
|
22
|
+
propsMeta: () => propsMeta
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(textarea_ws_exports);
|
|
25
|
+
var import_icons = require("@webstudio-is/icons");
|
|
26
|
+
var import_normalize = require("../css/normalize");
|
|
27
|
+
var import_textarea = require("./__generated__/textarea.props");
|
|
28
|
+
const presetStyle = {
|
|
29
|
+
textarea: [
|
|
30
|
+
...import_normalize.textarea,
|
|
31
|
+
// resize doesn't work well while on canvas
|
|
32
|
+
{ property: "resize", value: { type: "keyword", value: "none" } }
|
|
33
|
+
]
|
|
34
|
+
};
|
|
35
|
+
const meta = {
|
|
36
|
+
category: "forms",
|
|
37
|
+
type: "control",
|
|
38
|
+
label: "Text Area",
|
|
39
|
+
Icon: import_icons.FormTextAreaIcon,
|
|
40
|
+
presetStyle,
|
|
41
|
+
states: [
|
|
42
|
+
{ selector: "::placeholder", label: "Placeholder" },
|
|
43
|
+
{ selector: ":valid", label: "Valid" },
|
|
44
|
+
{ selector: ":invalid", label: "Invalid" },
|
|
45
|
+
{ selector: ":required", label: "Required" },
|
|
46
|
+
{ selector: ":optional", label: "Optional" },
|
|
47
|
+
{ selector: ":disabled", label: "Disabled" },
|
|
48
|
+
{ selector: ":enabled", label: "Enabled" },
|
|
49
|
+
{ selector: ":read-only", label: "Read Only" },
|
|
50
|
+
{ selector: ":read-write", label: "Read Write" }
|
|
51
|
+
]
|
|
52
|
+
};
|
|
53
|
+
const propsMeta = {
|
|
54
|
+
props: import_textarea.props,
|
|
55
|
+
initialProps: ["name", "placeholder", "required", "autoFocus"]
|
|
56
|
+
};
|
package/lib/cjs/css/css.js
CHANGED
|
@@ -64,15 +64,12 @@ const generateCssText = (data, options) => {
|
|
|
64
64
|
for (const component of (0, import_components_utils.getComponentNames)()) {
|
|
65
65
|
const meta = (0, import_components.getComponentMeta)(component);
|
|
66
66
|
const presetStyle = meta?.presetStyle;
|
|
67
|
-
if (presetStyle
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
}
|
|
67
|
+
if (presetStyle === void 0) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const rules = (0, import_style_rules.getPresetStyleRules)(component, presetStyle);
|
|
71
|
+
for (const [selector, style] of rules) {
|
|
72
|
+
engine.addStyleRule(selector, { style });
|
|
76
73
|
}
|
|
77
74
|
}
|
|
78
75
|
const styleRules = (0, import_style_rules.getStyleRules)(styles, styleSourceSelections);
|