@webstudio-is/sdk-components-react 0.194.0 → 0.196.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.
@@ -0,0 +1,127 @@
1
+ import { meta as t } from "./form.ws.js";
2
+ import { showAttribute as e } from "@webstudio-is/react-sdk";
3
+ import { props as o } from "./__generated__/webhook-form.props.js";
4
+ import { WebhookFormIcon as a } from "@webstudio-is/icons/svg";
5
+ const c = {
6
+ ...t,
7
+ category: "data",
8
+ label: "Webhook Form",
9
+ description: "Collect user data and send it to any webhook.",
10
+ order: 1,
11
+ icon: a,
12
+ states: [
13
+ { selector: "[data-state=error]", label: "Error" },
14
+ { selector: "[data-state=success]", label: "Success" }
15
+ ],
16
+ template: [
17
+ {
18
+ type: "instance",
19
+ component: "Form",
20
+ variables: {
21
+ formState: { initialValue: "initial" }
22
+ },
23
+ props: [
24
+ {
25
+ type: "expression",
26
+ name: "state",
27
+ code: "formState"
28
+ },
29
+ {
30
+ type: "action",
31
+ name: "onStateChange",
32
+ value: [
33
+ { type: "execute", args: ["state"], code: "formState = state" }
34
+ ]
35
+ }
36
+ ],
37
+ children: [
38
+ {
39
+ type: "instance",
40
+ label: "Form Content",
41
+ component: "Box",
42
+ props: [
43
+ {
44
+ type: "expression",
45
+ name: e,
46
+ code: "formState === 'initial' || formState === 'error'"
47
+ }
48
+ ],
49
+ children: [
50
+ {
51
+ type: "instance",
52
+ component: "Label",
53
+ children: [{ type: "text", value: "Name", placeholder: !0 }]
54
+ },
55
+ {
56
+ type: "instance",
57
+ component: "Input",
58
+ props: [{ type: "string", name: "name", value: "name" }],
59
+ children: []
60
+ },
61
+ {
62
+ type: "instance",
63
+ component: "Label",
64
+ children: [{ type: "text", value: "Email", placeholder: !0 }]
65
+ },
66
+ {
67
+ type: "instance",
68
+ component: "Input",
69
+ props: [{ type: "string", name: "name", value: "email" }],
70
+ children: []
71
+ },
72
+ {
73
+ type: "instance",
74
+ component: "Button",
75
+ children: [{ type: "text", value: "Submit", placeholder: !0 }]
76
+ }
77
+ ]
78
+ },
79
+ {
80
+ type: "instance",
81
+ label: "Success Message",
82
+ component: "Box",
83
+ props: [
84
+ {
85
+ type: "expression",
86
+ name: e,
87
+ code: "formState === 'success'"
88
+ }
89
+ ],
90
+ children: [
91
+ {
92
+ type: "text",
93
+ value: "Thank you for getting in touch!",
94
+ placeholder: !0
95
+ }
96
+ ]
97
+ },
98
+ {
99
+ type: "instance",
100
+ label: "Error Message",
101
+ component: "Box",
102
+ props: [
103
+ {
104
+ type: "expression",
105
+ name: e,
106
+ code: "formState === 'error'"
107
+ }
108
+ ],
109
+ children: [
110
+ {
111
+ type: "text",
112
+ value: "Sorry, something went wrong.",
113
+ placeholder: !0
114
+ }
115
+ ]
116
+ }
117
+ ]
118
+ }
119
+ ]
120
+ }, i = {
121
+ props: o,
122
+ initialProps: ["id", "className", "state", "action"]
123
+ };
124
+ export {
125
+ c as meta,
126
+ i as propsMeta
127
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk-components-react",
3
- "version": "0.194.0",
3
+ "version": "0.196.0",
4
4
  "description": "Webstudio default library for react",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -32,6 +32,11 @@
32
32
  "webstudio": "./src/hooks.ts",
33
33
  "types": "./lib/types/hooks.d.ts",
34
34
  "import": "./lib/hooks.js"
35
+ },
36
+ "./templates": {
37
+ "webstudio": "./src/templates.ts",
38
+ "types": "./lib/types/templates.d.ts",
39
+ "import": "./lib/templates.js"
35
40
  }
36
41
  },
37
42
  "peerDependencies": {
@@ -43,10 +48,10 @@
43
48
  "colord": "^2.9.3",
44
49
  "micromark": "^4.0.0",
45
50
  "await-interaction-response": "^0.0.2",
46
- "@webstudio-is/icons": "0.194.0",
47
- "@webstudio-is/image": "0.194.0",
48
- "@webstudio-is/sdk": "0.194.0",
49
- "@webstudio-is/react-sdk": "0.194.0"
51
+ "@webstudio-is/icons": "0.196.0",
52
+ "@webstudio-is/image": "0.196.0",
53
+ "@webstudio-is/react-sdk": "0.196.0",
54
+ "@webstudio-is/sdk": "0.196.0"
50
55
  },
51
56
  "devDependencies": {
52
57
  "@testing-library/react": "^14.2.2",
@@ -55,8 +60,9 @@
55
60
  "react": "18.3.0-canary-14898b6a9-20240318",
56
61
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
57
62
  "vitest": "^2.1.8",
63
+ "@webstudio-is/tsconfig": "1.0.7",
58
64
  "@webstudio-is/generate-arg-types": "0.0.0",
59
- "@webstudio-is/tsconfig": "1.0.7"
65
+ "@webstudio-is/template": "0.196.0"
60
66
  },
61
67
  "scripts": {
62
68
  "build": "vite build --config ../../vite.sdk-components.config.ts",
@@ -1,8 +0,0 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as m } from "react";
3
- import { Link as t } from "./link.js";
4
- const e = m((i, o) => /* @__PURE__ */ r(t, { ...i, ref: o }));
5
- e.displayName = "RichTextLink";
6
- export {
7
- e as RichTextLink
8
- };