@webstudio-is/sdk-components-react 0.189.0 → 0.191.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.
Files changed (126) hide show
  1. package/lib/__generated__/blockquote.props.js +514 -0
  2. package/lib/__generated__/body.props.js +508 -0
  3. package/lib/__generated__/bold.props.js +508 -0
  4. package/lib/__generated__/box.props.js +527 -0
  5. package/lib/__generated__/button.props.js +570 -0
  6. package/lib/__generated__/checkbox.props.js +672 -0
  7. package/lib/__generated__/code-text.props.js +509 -0
  8. package/lib/__generated__/form.props.js +556 -0
  9. package/lib/__generated__/heading.props.js +516 -0
  10. package/lib/__generated__/html-embed.props.js +13 -0
  11. package/lib/__generated__/image.props.js +592 -0
  12. package/lib/__generated__/input.props.js +696 -0
  13. package/lib/__generated__/italic.props.js +508 -0
  14. package/lib/__generated__/label.props.js +520 -0
  15. package/lib/__generated__/link.props.js +568 -0
  16. package/lib/__generated__/list-item.props.js +514 -0
  17. package/lib/__generated__/list.props.js +534 -0
  18. package/lib/__generated__/markdown-embed.props.js +7 -0
  19. package/lib/__generated__/option.props.js +532 -0
  20. package/lib/__generated__/paragraph.props.js +508 -0
  21. package/lib/__generated__/radio-button.props.js +672 -0
  22. package/lib/__generated__/select.props.js +556 -0
  23. package/lib/__generated__/separator.props.js +508 -0
  24. package/lib/__generated__/span.props.js +508 -0
  25. package/lib/__generated__/subscript.props.js +508 -0
  26. package/lib/__generated__/superscript.props.js +508 -0
  27. package/lib/__generated__/text.props.js +516 -0
  28. package/lib/__generated__/textarea.props.js +587 -0
  29. package/lib/__generated__/time.props.js +312 -0
  30. package/lib/__generated__/vimeo-play-button.props.js +569 -0
  31. package/lib/__generated__/vimeo-preview-image.props.js +586 -0
  32. package/lib/__generated__/vimeo-spinner.props.js +508 -0
  33. package/lib/__generated__/vimeo.props.js +674 -0
  34. package/lib/__generated__/xml-node.props.js +7 -0
  35. package/lib/__generated__/xml-time.props.js +18 -0
  36. package/lib/blockquote.js +9 -0
  37. package/lib/blockquote.ws.js +79 -0
  38. package/lib/body.js +7 -0
  39. package/lib/body.ws.js +30 -0
  40. package/lib/bold.js +7 -0
  41. package/lib/bold.ws.js +20 -0
  42. package/lib/box.js +9 -0
  43. package/lib/box.ws.js +31 -0
  44. package/lib/button.js +9 -0
  45. package/lib/button.ws.js +44 -0
  46. package/lib/checkbox.js +15 -0
  47. package/lib/checkbox.ws.js +59 -0
  48. package/lib/code-text.js +10 -0
  49. package/lib/code-text.ws.js +60 -0
  50. package/lib/components.js +77 -1357
  51. package/lib/content-embed.ws.js +77 -0
  52. package/lib/form.js +7 -0
  53. package/lib/form.ws.js +31 -0
  54. package/lib/fragment.js +7 -0
  55. package/lib/fragment.ws.js +11 -0
  56. package/lib/heading.js +9 -0
  57. package/lib/heading.ws.js +45 -0
  58. package/lib/home_wsKvRSqvkajPPBeycZ-C8.svg +3 -0
  59. package/lib/hooks.js +5 -0
  60. package/lib/html-embed-patchers.js +29 -0
  61. package/lib/html-embed.js +112 -0
  62. package/lib/html-embed.ws.js +46 -0
  63. package/lib/image.js +40 -0
  64. package/lib/image.ws.js +65 -0
  65. package/lib/input.js +17 -0
  66. package/lib/input.ws.js +55 -0
  67. package/lib/italic.js +7 -0
  68. package/lib/italic.ws.js +26 -0
  69. package/lib/label.js +7 -0
  70. package/lib/label.ws.js +43 -0
  71. package/lib/link.js +15 -0
  72. package/lib/link.ws.js +68 -0
  73. package/lib/list-item.js +9 -0
  74. package/lib/list-item.ws.js +40 -0
  75. package/lib/list.js +6 -0
  76. package/lib/list.ws.js +92 -0
  77. package/lib/markdown-embed.js +14 -0
  78. package/lib/markdown-embed.ws.js +111 -0
  79. package/lib/metas.js +79 -4581
  80. package/lib/option.js +7 -0
  81. package/lib/option.ws.js +47 -0
  82. package/lib/paragraph.js +7 -0
  83. package/lib/paragraph.ws.js +40 -0
  84. package/lib/props.js +77 -17919
  85. package/lib/radio-button.js +15 -0
  86. package/lib/radio-button.ws.js +61 -0
  87. package/lib/rich-text-link.js +8 -0
  88. package/lib/rich-text-link.ws.js +11 -0
  89. package/lib/select.js +19 -0
  90. package/lib/select.ws.js +97 -0
  91. package/lib/separator.js +9 -0
  92. package/lib/separator.ws.js +48 -0
  93. package/lib/slot.js +14 -0
  94. package/lib/slot.ws.js +15 -0
  95. package/lib/span.js +7 -0
  96. package/lib/span.ws.js +20 -0
  97. package/lib/subscript.js +7 -0
  98. package/lib/subscript.ws.js +20 -0
  99. package/lib/superscript.js +7 -0
  100. package/lib/superscript.ws.js +20 -0
  101. package/lib/text.js +10 -0
  102. package/lib/text.ws.js +41 -0
  103. package/lib/textarea.js +7 -0
  104. package/lib/textarea.ws.js +56 -0
  105. package/lib/time.js +319 -0
  106. package/lib/time.ws.js +22 -0
  107. package/lib/types/__generated__/xml-time.props.d.ts +2 -0
  108. package/lib/types/components.d.ts +1 -0
  109. package/lib/types/metas.d.ts +1 -0
  110. package/lib/types/props.d.ts +1 -0
  111. package/lib/types/vimeo-preview-image.d.ts +94 -94
  112. package/lib/types/xml-time.d.ts +6 -0
  113. package/lib/types/xml-time.ws.d.ts +3 -0
  114. package/lib/vimeo-play-button.js +15 -0
  115. package/lib/vimeo-play-button.ws.js +33 -0
  116. package/lib/vimeo-preview-image.js +19 -0
  117. package/lib/vimeo-preview-image.ws.js +20 -0
  118. package/lib/vimeo-spinner.js +13 -0
  119. package/lib/vimeo-spinner.ws.js +26 -0
  120. package/lib/vimeo.js +215 -0
  121. package/lib/vimeo.ws.js +330 -0
  122. package/lib/xml-node.js +44 -0
  123. package/lib/xml-node.ws.js +18 -0
  124. package/lib/xml-time.js +25 -0
  125. package/lib/xml-time.ws.js +18 -0
  126. package/package.json +8 -11
@@ -0,0 +1,9 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as m } from "react";
3
+ const c = m(
4
+ ({ children: o, ...r }, t) => /* @__PURE__ */ e("blockquote", { ...r, ref: t, children: o })
5
+ );
6
+ c.displayName = "Blockquote";
7
+ export {
8
+ c as Blockquote
9
+ };
@@ -0,0 +1,79 @@
1
+ import { BlockquoteIcon as e } from "@webstudio-is/icons/svg";
2
+ import { defaultStates as t } from "@webstudio-is/react-sdk";
3
+ import { props as p } from "./__generated__/blockquote.props.js";
4
+ const r = {
5
+ blockquote: [
6
+ {
7
+ property: "marginTop",
8
+ value: { type: "unit", value: 0, unit: "number" }
9
+ },
10
+ {
11
+ property: "marginRight",
12
+ value: { type: "unit", value: 0, unit: "number" }
13
+ },
14
+ {
15
+ property: "marginBottom",
16
+ value: { type: "unit", value: 10, unit: "px" }
17
+ },
18
+ {
19
+ property: "marginLeft",
20
+ value: { type: "unit", value: 0, unit: "number" }
21
+ },
22
+ {
23
+ property: "paddingTop",
24
+ value: { type: "unit", value: 10, unit: "px" }
25
+ },
26
+ {
27
+ property: "paddingBottom",
28
+ value: { type: "unit", value: 10, unit: "px" }
29
+ },
30
+ {
31
+ property: "paddingLeft",
32
+ value: { type: "unit", value: 20, unit: "px" }
33
+ },
34
+ {
35
+ property: "paddingRight",
36
+ value: { type: "unit", value: 20, unit: "px" }
37
+ },
38
+ {
39
+ property: "borderLeftWidth",
40
+ value: { type: "unit", value: 5, unit: "px" }
41
+ },
42
+ {
43
+ property: "borderLeftStyle",
44
+ value: { type: "keyword", value: "solid" }
45
+ },
46
+ {
47
+ property: "borderLeftColor",
48
+ value: { type: "rgb", r: 226, g: 226, b: 226, alpha: 1 }
49
+ }
50
+ ]
51
+ }, i = {
52
+ category: "text",
53
+ type: "container",
54
+ description: "Use to style a quote from an external source like an article or book.",
55
+ icon: e,
56
+ states: t,
57
+ presetStyle: r,
58
+ order: 3,
59
+ template: [
60
+ {
61
+ type: "instance",
62
+ component: "Blockquote",
63
+ children: [
64
+ {
65
+ type: "text",
66
+ value: "Blockquote text you can edit",
67
+ placeholder: !0
68
+ }
69
+ ]
70
+ }
71
+ ]
72
+ }, n = {
73
+ props: p,
74
+ initialProps: ["id", "className", "cite"]
75
+ };
76
+ export {
77
+ i as meta,
78
+ n as propsMeta
79
+ };
package/lib/body.js ADDED
@@ -0,0 +1,7 @@
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { forwardRef as m } from "react";
3
+ const f = m((o, r) => /* @__PURE__ */ d("body", { ...o, ref: r }));
4
+ f.displayName = "Body";
5
+ export {
6
+ f as Body
7
+ };
package/lib/body.ws.js ADDED
@@ -0,0 +1,30 @@
1
+ import { BodyIcon as o } from "@webstudio-is/icons/svg";
2
+ import { defaultStates as t } from "@webstudio-is/react-sdk";
3
+ import { body as e } from "@webstudio-is/sdk/normalize.css";
4
+ import { props as a } from "./__generated__/body.props.js";
5
+ const r = {
6
+ body: [
7
+ ...e,
8
+ {
9
+ property: "WebkitFontSmoothing",
10
+ value: { type: "keyword", value: "antialiased" }
11
+ },
12
+ {
13
+ property: "MozOsxFontSmoothing",
14
+ value: { type: "keyword", value: "grayscale" }
15
+ }
16
+ ]
17
+ }, l = {
18
+ type: "container",
19
+ icon: o,
20
+ states: t,
21
+ presetStyle: r,
22
+ detachable: !1
23
+ }, m = {
24
+ props: a,
25
+ initialProps: ["id", "className"]
26
+ };
27
+ export {
28
+ l as meta,
29
+ m as propsMeta
30
+ };
package/lib/bold.js ADDED
@@ -0,0 +1,7 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { forwardRef as d } from "react";
3
+ const f = d((o, r) => /* @__PURE__ */ m("b", { ...o, ref: r }));
4
+ f.displayName = "Bold";
5
+ export {
6
+ f as Bold
7
+ };
package/lib/bold.ws.js ADDED
@@ -0,0 +1,20 @@
1
+ import { BoldIcon as t } from "@webstudio-is/icons/svg";
2
+ import { defaultStates as o } from "@webstudio-is/react-sdk";
3
+ import { b as e } from "@webstudio-is/sdk/normalize.css";
4
+ import { props as r } from "./__generated__/bold.props.js";
5
+ const p = {
6
+ b: e
7
+ }, l = {
8
+ type: "rich-text-child",
9
+ label: "Bold Text",
10
+ icon: t,
11
+ states: o,
12
+ presetStyle: p
13
+ }, c = {
14
+ props: r,
15
+ initialProps: ["id", "className"]
16
+ };
17
+ export {
18
+ l as meta,
19
+ c as propsMeta
20
+ };
package/lib/box.js ADDED
@@ -0,0 +1,9 @@
1
+ import { forwardRef as t, createElement as a } from "react";
2
+ const d = "div", f = t(
3
+ ({ tag: e = d, ...o }, r) => a(e, { ...o, ref: r })
4
+ );
5
+ f.displayName = "Box";
6
+ export {
7
+ f as Box,
8
+ d as defaultTag
9
+ };
package/lib/box.ws.js ADDED
@@ -0,0 +1,31 @@
1
+ import { BoxIcon as t } from "@webstudio-is/icons/svg";
2
+ import { defaultStates as e } from "@webstudio-is/react-sdk";
3
+ import { div as o, address as r, article as a, aside as i, figure as n, footer as s, header as c, main as p, nav as d, section as m } from "@webstudio-is/sdk/normalize.css";
4
+ import { props as f } from "./__generated__/box.props.js";
5
+ const g = {
6
+ div: o,
7
+ address: r,
8
+ article: a,
9
+ aside: i,
10
+ figure: n,
11
+ footer: s,
12
+ header: c,
13
+ main: p,
14
+ nav: d,
15
+ section: m
16
+ }, v = {
17
+ category: "general",
18
+ type: "container",
19
+ description: "A container for content. By default this is a Div, but the tag can be changed in settings.",
20
+ icon: t,
21
+ states: e,
22
+ presetStyle: g,
23
+ order: 0
24
+ }, b = {
25
+ props: f,
26
+ initialProps: ["id", "className", "tag"]
27
+ };
28
+ export {
29
+ v as meta,
30
+ b as propsMeta
31
+ };
package/lib/button.js ADDED
@@ -0,0 +1,9 @@
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { forwardRef as i } from "react";
3
+ const n = i(
4
+ ({ type: t = "submit", children: o, ...r }, m) => /* @__PURE__ */ f("button", { type: t, ...r, ref: m, children: o })
5
+ );
6
+ n.displayName = "Button";
7
+ export {
8
+ n as Button
9
+ };
@@ -0,0 +1,44 @@
1
+ import { ButtonElementIcon as t } from "@webstudio-is/icons/svg";
2
+ import { defaultStates as e } from "@webstudio-is/react-sdk";
3
+ import { button as o } from "@webstudio-is/sdk/normalize.css";
4
+ import { props as n } from "./__generated__/button.props.js";
5
+ const a = {
6
+ button: o
7
+ }, c = {
8
+ category: "forms",
9
+ type: "container",
10
+ invalidAncestors: ["Button", "Link"],
11
+ constraints: {
12
+ relation: "ancestor",
13
+ component: { $nin: ["Button", "Link"] }
14
+ },
15
+ description: "Use a button to submit forms or trigger actions within a page. Do not use a button to navigate users to another resource or another page - that’s what a link is used for.",
16
+ icon: t,
17
+ presetStyle: a,
18
+ states: [
19
+ ...e,
20
+ { selector: ":disabled", label: "Disabled" },
21
+ { selector: ":enabled", label: "Enabled" }
22
+ ],
23
+ order: 2,
24
+ template: [
25
+ {
26
+ type: "instance",
27
+ component: "Button",
28
+ children: [
29
+ {
30
+ type: "text",
31
+ value: "Button text you can edit",
32
+ placeholder: !0
33
+ }
34
+ ]
35
+ }
36
+ ]
37
+ }, p = {
38
+ props: n,
39
+ initialProps: ["id", "className", "type", "aria-label"]
40
+ };
41
+ export {
42
+ c as meta,
43
+ p as propsMeta
44
+ };
@@ -0,0 +1,15 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { forwardRef as d } from "react";
3
+ const h = d(({ children: i, checked: e, defaultChecked: r, ...o }, c) => /* @__PURE__ */ t(
4
+ "input",
5
+ {
6
+ ...o,
7
+ defaultChecked: e ?? r,
8
+ type: "checkbox",
9
+ ref: c
10
+ }
11
+ ));
12
+ h.displayName = "Checkbox";
13
+ export {
14
+ h as Checkbox
15
+ };
@@ -0,0 +1,59 @@
1
+ import { CheckboxCheckedIcon as e } from "@webstudio-is/icons/svg";
2
+ import { defaultStates as t } from "@webstudio-is/react-sdk";
3
+ import { checkbox as o } from "@webstudio-is/sdk/normalize.css";
4
+ import { props as n } from "./__generated__/checkbox.props.js";
5
+ const r = {
6
+ input: [
7
+ ...o,
8
+ {
9
+ property: "marginRight",
10
+ value: { type: "unit", unit: "em", value: 0.5 }
11
+ }
12
+ ]
13
+ }, s = {
14
+ category: "forms",
15
+ invalidAncestors: ["Button", "Link"],
16
+ constraints: {
17
+ relation: "ancestor",
18
+ component: { $nin: ["Button", "Link"] }
19
+ },
20
+ type: "control",
21
+ description: "Use within a form to allow your users to toggle between checked and not checked. Group checkboxes by matching their “Name” properties. Unlike radios, any number of checkboxes in a group can be checked.",
22
+ icon: e,
23
+ presetStyle: r,
24
+ order: 6,
25
+ states: [
26
+ ...t,
27
+ { selector: ":checked", label: "Checked" },
28
+ { selector: ":required", label: "Required" },
29
+ { selector: ":optional", label: "Optional" },
30
+ { selector: ":disabled", label: "Disabled" },
31
+ { selector: ":enabled", label: "Enabled" },
32
+ { selector: ":read-only", label: "Read Only" },
33
+ { selector: ":read-write", label: "Read Write" }
34
+ ],
35
+ template: [
36
+ {
37
+ type: "instance",
38
+ component: "Label",
39
+ label: "Checkbox Field",
40
+ children: [
41
+ { type: "instance", component: "Checkbox", children: [] },
42
+ {
43
+ type: "instance",
44
+ component: "Text",
45
+ label: "Checkbox Label",
46
+ props: [{ type: "string", name: "tag", value: "span" }],
47
+ children: [{ type: "text", value: "Checkbox", placeholder: !0 }]
48
+ }
49
+ ]
50
+ }
51
+ ]
52
+ }, p = {
53
+ props: n,
54
+ initialProps: ["id", "className", "name", "value", "required", "checked"]
55
+ };
56
+ export {
57
+ s as meta,
58
+ p as propsMeta
59
+ };
@@ -0,0 +1,10 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as i } from "react";
3
+ const d = ({
4
+ innerRef: e,
5
+ ...t
6
+ }) => /* @__PURE__ */ r("code", { ...t, style: { padding: 20 }, ref: e, children: 'Open the "Settings" panel to edit the code.' }), l = i(({ code: e, children: t, ...n }, o) => t === void 0 && e === void 0 || String(e).trim().length === 0 ? /* @__PURE__ */ r(d, { innerRef: o, ...n }) : /* @__PURE__ */ r("code", { ...n, ref: o, children: e ?? t }));
7
+ l.displayName = "CodeText";
8
+ export {
9
+ l as CodeText
10
+ };
@@ -0,0 +1,60 @@
1
+ import { CodeTextIcon as e } from "@webstudio-is/icons/svg";
2
+ import { defaultStates as t } from "@webstudio-is/react-sdk";
3
+ import { code as o } from "@webstudio-is/sdk/normalize.css";
4
+ import { props as r } from "./__generated__/code-text.props.js";
5
+ const p = {
6
+ code: [
7
+ ...o,
8
+ {
9
+ property: "display",
10
+ value: { type: "keyword", value: "block" }
11
+ },
12
+ {
13
+ property: "whiteSpaceCollapse",
14
+ value: { type: "keyword", value: "preserve" }
15
+ },
16
+ {
17
+ property: "textWrapMode",
18
+ value: { type: "keyword", value: "wrap" }
19
+ },
20
+ {
21
+ property: "paddingLeft",
22
+ value: { type: "unit", value: 0.2, unit: "em" }
23
+ },
24
+ {
25
+ property: "paddingRight",
26
+ value: { type: "unit", value: 0.2, unit: "em" }
27
+ },
28
+ {
29
+ property: "backgroundColor",
30
+ value: { type: "rgb", r: 238, g: 238, b: 238, alpha: 1 }
31
+ }
32
+ ]
33
+ }, l = {
34
+ category: "general",
35
+ type: "embed",
36
+ description: "Use this component when you want to display code as text on the page.",
37
+ icon: e,
38
+ invalidAncestors: ["CodeText"],
39
+ constraints: {
40
+ relation: "ancestor",
41
+ component: { $neq: "CodeText" }
42
+ },
43
+ states: t,
44
+ presetStyle: p,
45
+ order: 9
46
+ }, s = {
47
+ props: {
48
+ ...r,
49
+ code: {
50
+ required: !0,
51
+ control: "codetext",
52
+ type: "string"
53
+ }
54
+ },
55
+ initialProps: ["id", "className", "lang", "code"]
56
+ };
57
+ export {
58
+ l as meta,
59
+ s as propsMeta
60
+ };