@webstudio-is/sdk-components-react 0.71.0 → 0.73.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 (178) hide show
  1. package/lib/__generated__/button.props.js +0 -6
  2. package/lib/__generated__/image.props.js +0 -1
  3. package/lib/__generated__/link-block.props.js +1 -7
  4. package/lib/__generated__/link.props.js +1 -7
  5. package/lib/__generated__/rich-text-link.props.js +1 -7
  6. package/lib/__generated__/{radio-button-field.props.js → vimeo-play-button.props.js} +14 -0
  7. package/lib/__generated__/vimeo-preview-image.props.js +441 -0
  8. package/lib/__generated__/{checkbox-field.props.js → vimeo-spinner.props.js} +0 -1
  9. package/lib/__generated__/vimeo.props.js +555 -0
  10. package/lib/blockquote.ws.js +1 -1
  11. package/lib/box.js +2 -1
  12. package/lib/button.js +1 -6
  13. package/lib/button.ws.js +9 -2
  14. package/lib/checkbox.ws.js +19 -1
  15. package/lib/cjs/__generated__/button.props.js +0 -6
  16. package/lib/cjs/__generated__/image.props.js +0 -1
  17. package/lib/cjs/__generated__/link-block.props.js +1 -7
  18. package/lib/cjs/__generated__/link.props.js +1 -7
  19. package/lib/cjs/__generated__/rich-text-link.props.js +1 -7
  20. package/lib/cjs/__generated__/{text-block.props.js → text.props.js} +3 -3
  21. package/lib/cjs/__generated__/{radio-button-field.props.js → vimeo-play-button.props.js} +17 -3
  22. package/lib/cjs/__generated__/vimeo-preview-image.props.js +461 -0
  23. package/lib/cjs/__generated__/{checkbox-field.props.js → vimeo-spinner.props.js} +3 -4
  24. package/lib/cjs/__generated__/vimeo.props.js +575 -0
  25. package/lib/cjs/blockquote.ws.js +1 -1
  26. package/lib/cjs/box.js +2 -1
  27. package/lib/cjs/button.js +1 -6
  28. package/lib/cjs/button.ws.js +9 -2
  29. package/lib/cjs/checkbox.ws.js +19 -1
  30. package/lib/cjs/code-text.ws.js +1 -1
  31. package/lib/cjs/components.js +11 -9
  32. package/lib/cjs/heading.ws.js +1 -1
  33. package/lib/cjs/image.js +3 -3
  34. package/lib/cjs/image.ws.js +12 -9
  35. package/lib/cjs/label.ws.js +3 -6
  36. package/lib/cjs/link.js +1 -1
  37. package/lib/cjs/link.ws.js +3 -3
  38. package/lib/cjs/list-item.ws.js +1 -1
  39. package/lib/cjs/metas.js +11 -9
  40. package/lib/cjs/paragraph.ws.js +2 -2
  41. package/lib/cjs/props.js +11 -9
  42. package/lib/cjs/radio-button.ws.js +19 -1
  43. package/lib/cjs/rich-text-link.ws.js +3 -10
  44. package/lib/cjs/span.ws.js +1 -1
  45. package/lib/cjs/{text-block.js → text.js} +6 -6
  46. package/lib/cjs/{text-block.ws.js → text.ws.js} +10 -10
  47. package/lib/cjs/{link-block.js → vimeo-play-button.js} +17 -9
  48. package/lib/cjs/{link-block.ws.js → vimeo-play-button.ws.js} +13 -22
  49. package/lib/cjs/vimeo-preview-image.js +40 -0
  50. package/lib/cjs/{radio-button-field.js → vimeo-preview-image.ws.js} +17 -10
  51. package/lib/cjs/{checkbox-field.js → vimeo-spinner.js} +16 -8
  52. package/lib/cjs/{checkbox-field.ws.js → vimeo-spinner.ws.js} +11 -30
  53. package/lib/cjs/vimeo.js +294 -0
  54. package/lib/cjs/vimeo.ws.js +345 -0
  55. package/lib/code-text.ws.js +1 -1
  56. package/lib/components.js +11 -9
  57. package/lib/heading.ws.js +1 -1
  58. package/lib/image.js +6 -5
  59. package/lib/image.ws.js +12 -9
  60. package/lib/label.ws.js +4 -7
  61. package/lib/link.js +3 -3
  62. package/lib/link.ws.js +3 -3
  63. package/lib/list-item.ws.js +1 -1
  64. package/lib/metas.js +52 -50
  65. package/lib/paragraph.ws.js +2 -2
  66. package/lib/props.js +52 -50
  67. package/lib/radio-button.ws.js +19 -1
  68. package/lib/rich-text-link.ws.js +3 -10
  69. package/lib/span.ws.js +1 -1
  70. package/lib/{text-block.js → text.js} +3 -3
  71. package/lib/{text-block.ws.js → text.ws.js} +7 -7
  72. package/lib/types/__generated__/vimeo-spinner.props.d.ts +2 -0
  73. package/lib/types/__generated__/vimeo.props.d.ts +2 -0
  74. package/lib/types/box.d.ts +1 -1
  75. package/lib/types/button.d.ts +2 -6
  76. package/lib/types/button.stories.d.ts +2 -6
  77. package/lib/types/components.d.ts +5 -4
  78. package/lib/types/image.d.ts +5 -6
  79. package/lib/types/image.stories.d.ts +555 -6
  80. package/lib/types/image.ws.d.ts +8 -0
  81. package/lib/types/link.d.ts +1 -3
  82. package/lib/types/link.stories.d.ts +2 -6
  83. package/lib/types/metas.d.ts +5 -4
  84. package/lib/types/props.d.ts +5 -4
  85. package/lib/types/rich-text-link.stories.d.ts +2 -6
  86. package/lib/types/{text-block.d.ts → text.d.ts} +1 -1
  87. package/lib/types/{text-block.stories.d.ts → text.stories.d.ts} +1 -1
  88. package/lib/types/vimeo-play-button.d.ts +4 -0
  89. package/lib/types/vimeo-play-button.stories.d.ts +5 -0
  90. package/lib/types/vimeo-preview-image.d.ts +281 -0
  91. package/lib/types/vimeo-preview-image.stories.d.ts +562 -0
  92. package/lib/types/vimeo-spinner.d.ts +2 -0
  93. package/lib/types/vimeo-spinner.stories.d.ts +5 -0
  94. package/lib/types/{link-block.ws.d.ts → vimeo-spinner.ws.d.ts} +1 -1
  95. package/lib/types/vimeo.d.ts +73 -0
  96. package/lib/types/vimeo.stories.d.ts +71 -0
  97. package/lib/types/vimeo.ws.d.ts +3 -0
  98. package/lib/vimeo-play-button.js +21 -0
  99. package/lib/vimeo-play-button.ws.js +26 -0
  100. package/lib/vimeo-preview-image.js +23 -0
  101. package/lib/vimeo-preview-image.ws.js +20 -0
  102. package/lib/vimeo-spinner.js +20 -0
  103. package/lib/vimeo-spinner.ws.js +25 -0
  104. package/lib/vimeo.js +282 -0
  105. package/lib/vimeo.ws.js +327 -0
  106. package/package.json +9 -7
  107. package/src/LICENSE +21 -0
  108. package/src/__generated__/button.props.ts +0 -6
  109. package/src/__generated__/image.props.ts +0 -1
  110. package/src/__generated__/link-block.props.ts +1 -7
  111. package/src/__generated__/link.props.ts +1 -7
  112. package/src/__generated__/rich-text-link.props.ts +1 -7
  113. package/src/__generated__/{checkbox-field.props.ts → vimeo-play-button.props.ts} +14 -0
  114. package/src/__generated__/vimeo-preview-image.props.ts +486 -0
  115. package/src/__generated__/{radio-button-field.props.ts → vimeo-spinner.props.ts} +0 -1
  116. package/src/__generated__/vimeo.props.ts +621 -0
  117. package/src/blockquote.ws.tsx +1 -1
  118. package/src/box.tsx +1 -1
  119. package/src/button.tsx +3 -11
  120. package/src/button.ws.tsx +8 -1
  121. package/src/checkbox.ws.tsx +19 -1
  122. package/src/code-text.ws.tsx +1 -1
  123. package/src/components.ts +5 -4
  124. package/src/heading.ws.tsx +1 -1
  125. package/src/image.tsx +6 -5
  126. package/src/image.ws.tsx +11 -9
  127. package/src/label.ws.tsx +4 -7
  128. package/src/link.tsx +5 -11
  129. package/src/link.ws.tsx +3 -3
  130. package/src/list-item.ws.tsx +1 -1
  131. package/src/metas.ts +5 -4
  132. package/src/paragraph.ws.tsx +2 -2
  133. package/src/props.ts +5 -4
  134. package/src/radio-button.ws.tsx +19 -1
  135. package/src/rich-text-link.ws.tsx +3 -11
  136. package/src/span.ws.tsx +1 -1
  137. package/src/text.stories.tsx +16 -0
  138. package/src/{text-block.tsx → text.tsx} +2 -2
  139. package/src/{text-block.ws.tsx → text.ws.tsx} +8 -8
  140. package/src/vimeo-play-button.stories.tsx +17 -0
  141. package/src/vimeo-play-button.tsx +24 -0
  142. package/src/vimeo-play-button.ws.ts +29 -0
  143. package/src/vimeo-preview-image.stories.tsx +17 -0
  144. package/src/vimeo-preview-image.tsx +30 -0
  145. package/src/vimeo-preview-image.ws.ts +22 -0
  146. package/src/vimeo-spinner.stories.tsx +17 -0
  147. package/src/vimeo-spinner.tsx +25 -0
  148. package/src/vimeo-spinner.ws.ts +27 -0
  149. package/src/vimeo.stories.tsx +17 -0
  150. package/src/vimeo.tsx +430 -0
  151. package/src/vimeo.ws.ts +331 -0
  152. package/lib/checkbox-field.js +0 -9
  153. package/lib/checkbox-field.ws.js +0 -44
  154. package/lib/cjs/radio-button-field.ws.js +0 -62
  155. package/lib/link-block.js +0 -10
  156. package/lib/link-block.ws.js +0 -33
  157. package/lib/radio-button-field.js +0 -9
  158. package/lib/radio-button-field.ws.js +0 -44
  159. package/lib/types/checkbox-field.d.ts +0 -3
  160. package/lib/types/link-block.d.ts +0 -3
  161. package/lib/types/link-block.stories.d.ts +0 -13
  162. package/lib/types/radio-button-field.d.ts +0 -3
  163. package/src/checkbox-field.tsx +0 -10
  164. package/src/checkbox-field.ws.tsx +0 -47
  165. package/src/link-block.stories.tsx +0 -16
  166. package/src/link-block.tsx +0 -9
  167. package/src/link-block.ws.tsx +0 -38
  168. package/src/radio-button-field.tsx +0 -10
  169. package/src/radio-button-field.ws.tsx +0 -47
  170. package/src/text-block.stories.tsx +0 -16
  171. /package/lib/__generated__/{text-block.props.js → text.props.js} +0 -0
  172. /package/lib/types/__generated__/{checkbox-field.props.d.ts → text.props.d.ts} +0 -0
  173. /package/lib/types/__generated__/{radio-button-field.props.d.ts → vimeo-play-button.props.d.ts} +0 -0
  174. /package/lib/types/__generated__/{text-block.props.d.ts → vimeo-preview-image.props.d.ts} +0 -0
  175. /package/lib/types/{checkbox-field.ws.d.ts → text.ws.d.ts} +0 -0
  176. /package/lib/types/{radio-button-field.ws.d.ts → vimeo-play-button.ws.d.ts} +0 -0
  177. /package/lib/types/{text-block.ws.d.ts → vimeo-preview-image.ws.d.ts} +0 -0
  178. /package/src/__generated__/{text-block.props.ts → text.props.ts} +0 -0
@@ -0,0 +1,331 @@
1
+ import { PlayIcon, SpinnerIcon, VimeoIcon } from "@webstudio-is/icons/svg";
2
+ import {
3
+ defaultStates,
4
+ type PresetStyle,
5
+ type WsComponentMeta,
6
+ type WsComponentPropsMeta,
7
+ } from "@webstudio-is/react-sdk";
8
+ import { div } from "@webstudio-is/react-sdk/css-normalize";
9
+ import { props } from "./__generated__/vimeo.props";
10
+ import { type VimeoOptions } from "./vimeo";
11
+
12
+ const presetStyle = {
13
+ div,
14
+ } satisfies PresetStyle<"div">;
15
+
16
+ export const meta: WsComponentMeta = {
17
+ category: "media",
18
+ type: "container",
19
+ label: "Vimeo",
20
+ order: 1,
21
+ icon: VimeoIcon,
22
+ states: defaultStates,
23
+ presetStyle,
24
+ template: [
25
+ {
26
+ type: "instance",
27
+ component: "Vimeo",
28
+ styles: [
29
+ {
30
+ property: "position",
31
+ value: { type: "keyword", value: "relative" },
32
+ },
33
+ {
34
+ property: "aspectRatio",
35
+ value: { type: "keyword", value: "640/360" },
36
+ },
37
+ {
38
+ property: "width",
39
+ value: { type: "unit", value: 100, unit: "%" },
40
+ },
41
+ ],
42
+ children: [
43
+ {
44
+ type: "instance",
45
+ component: "VimeoPreviewImage",
46
+ styles: [
47
+ {
48
+ property: "position",
49
+ value: { type: "keyword", value: "absolute" },
50
+ },
51
+ {
52
+ property: "objectFit",
53
+ value: { type: "keyword", value: "cover" },
54
+ },
55
+ {
56
+ property: "width",
57
+ value: { type: "unit", value: 100, unit: "%" },
58
+ },
59
+ {
60
+ property: "height",
61
+ value: { type: "unit", value: 100, unit: "%" },
62
+ },
63
+ {
64
+ property: "borderTopLeftRadius",
65
+ value: { type: "unit", value: 20, unit: "px" },
66
+ },
67
+ {
68
+ property: "borderTopRightRadius",
69
+ value: { type: "unit", value: 20, unit: "px" },
70
+ },
71
+ {
72
+ property: "borderBottomLeftRadius",
73
+ value: { type: "unit", value: 20, unit: "px" },
74
+ },
75
+ {
76
+ property: "borderBottomRightRadius",
77
+ value: { type: "unit", value: 20, unit: "px" },
78
+ },
79
+ {
80
+ property: "objectPosition",
81
+ value: { type: "keyword", value: "cover" },
82
+ },
83
+ ],
84
+ children: [],
85
+ props: [
86
+ {
87
+ type: "string",
88
+ name: "alt",
89
+ value: "Vimeo video preview image",
90
+ },
91
+ {
92
+ type: "string",
93
+ name: "sizes",
94
+ value: "100vw",
95
+ },
96
+ ],
97
+ },
98
+ {
99
+ type: "instance",
100
+ component: "Box",
101
+ label: "Spinner",
102
+ styles: [
103
+ {
104
+ property: "position",
105
+ value: { type: "keyword", value: "absolute" },
106
+ },
107
+ {
108
+ property: "top",
109
+ value: { type: "unit", value: 50, unit: "%" },
110
+ },
111
+ {
112
+ property: "left",
113
+ value: { type: "unit", value: 50, unit: "%" },
114
+ },
115
+ {
116
+ property: "width",
117
+ value: { type: "unit", value: 70, unit: "px" },
118
+ },
119
+ {
120
+ property: "height",
121
+ value: { type: "unit", value: 70, unit: "px" },
122
+ },
123
+ {
124
+ property: "marginTop",
125
+ value: { type: "unit", value: -35, unit: "px" },
126
+ },
127
+ {
128
+ property: "marginLeft",
129
+ value: { type: "unit", value: -35, unit: "px" },
130
+ },
131
+ ],
132
+ children: [
133
+ {
134
+ type: "instance",
135
+ component: "HtmlEmbed",
136
+ label: "Spinner SVG",
137
+ props: [
138
+ {
139
+ type: "string",
140
+ name: "code",
141
+ value: SpinnerIcon,
142
+ },
143
+ ],
144
+ children: [],
145
+ },
146
+ ],
147
+ },
148
+ {
149
+ type: "instance",
150
+ component: "VimeoPlayButton",
151
+ props: [
152
+ {
153
+ type: "string",
154
+ name: "aria-label",
155
+ value: "Play button",
156
+ },
157
+ ],
158
+ styles: [
159
+ {
160
+ property: "position",
161
+ value: { type: "keyword", value: "absolute" },
162
+ },
163
+ {
164
+ property: "width",
165
+ value: { type: "unit", value: 140, unit: "px" },
166
+ },
167
+ {
168
+ property: "height",
169
+ value: { type: "unit", value: 80, unit: "px" },
170
+ },
171
+ {
172
+ property: "top",
173
+ value: { type: "unit", value: 50, unit: "%" },
174
+ },
175
+ {
176
+ property: "left",
177
+ value: { type: "unit", value: 50, unit: "%" },
178
+ },
179
+ {
180
+ property: "marginTop",
181
+ value: { type: "unit", value: -40, unit: "px" },
182
+ },
183
+ {
184
+ property: "marginLeft",
185
+ value: { type: "unit", value: -70, unit: "px" },
186
+ },
187
+ {
188
+ property: "display",
189
+ value: { type: "keyword", value: "flex" },
190
+ },
191
+ {
192
+ property: "alignItems",
193
+ value: { type: "keyword", value: "center" },
194
+ },
195
+ {
196
+ property: "justifyContent",
197
+ value: { type: "keyword", value: "center" },
198
+ },
199
+ {
200
+ property: "borderTopStyle",
201
+ value: { type: "keyword", value: "none" },
202
+ },
203
+ {
204
+ property: "borderRightStyle",
205
+ value: { type: "keyword", value: "none" },
206
+ },
207
+ {
208
+ property: "borderBottomStyle",
209
+ value: { type: "keyword", value: "none" },
210
+ },
211
+ {
212
+ property: "borderLeftStyle",
213
+ value: { type: "keyword", value: "none" },
214
+ },
215
+ {
216
+ property: "borderTopLeftRadius",
217
+ value: { type: "unit", value: 5, unit: "px" },
218
+ },
219
+ {
220
+ property: "borderTopRightRadius",
221
+ value: { type: "unit", value: 5, unit: "px" },
222
+ },
223
+ {
224
+ property: "borderBottomLeftRadius",
225
+ value: { type: "unit", value: 5, unit: "px" },
226
+ },
227
+ {
228
+ property: "borderBottomRightRadius",
229
+ value: { type: "unit", value: 5, unit: "px" },
230
+ },
231
+ {
232
+ property: "cursor",
233
+ value: { type: "keyword", value: "pointer" },
234
+ },
235
+ {
236
+ property: "backgroundColor",
237
+ value: {
238
+ type: "rgb",
239
+ r: 18,
240
+ g: 18,
241
+ b: 18,
242
+ alpha: 1,
243
+ },
244
+ },
245
+ {
246
+ property: "color",
247
+ value: {
248
+ type: "rgb",
249
+ r: 255,
250
+ g: 255,
251
+ b: 255,
252
+ alpha: 1,
253
+ },
254
+ },
255
+ {
256
+ state: ":hover",
257
+ property: "backgroundColor",
258
+ value: {
259
+ type: "rgb",
260
+ r: 0,
261
+ g: 173,
262
+ b: 239,
263
+ alpha: 1,
264
+ },
265
+ },
266
+ ],
267
+ children: [
268
+ {
269
+ type: "instance",
270
+ component: "Box",
271
+ label: "Play Icon",
272
+ styles: [
273
+ {
274
+ property: "width",
275
+ value: { type: "unit", value: 60, unit: "px" },
276
+ },
277
+ {
278
+ property: "height",
279
+ value: { type: "unit", value: 60, unit: "px" },
280
+ },
281
+ ],
282
+ props: [
283
+ {
284
+ type: "string",
285
+ name: "aria-hidden",
286
+ value: "true",
287
+ },
288
+ ],
289
+ children: [
290
+ {
291
+ type: "instance",
292
+ component: "HtmlEmbed",
293
+ label: "Play SVG",
294
+ props: [
295
+ {
296
+ type: "string",
297
+ name: "code",
298
+ value: PlayIcon,
299
+ },
300
+ ],
301
+ children: [],
302
+ },
303
+ ],
304
+ },
305
+ ],
306
+ },
307
+ ],
308
+ },
309
+ ],
310
+ };
311
+
312
+ const initialProps: Array<keyof VimeoOptions> = [
313
+ "url",
314
+ "quality",
315
+ "showPreview",
316
+ "autoplay",
317
+ "backgroundMode",
318
+ "doNotTrack",
319
+ "loop",
320
+ "muted",
321
+ "showPortrait",
322
+ "showByline",
323
+ "showTitle",
324
+ "showControls",
325
+ "controlsColor",
326
+ ];
327
+
328
+ export const propsMeta: WsComponentPropsMeta = {
329
+ props,
330
+ initialProps,
331
+ };
@@ -1,9 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- const defaultTag = "label";
4
- const CheckboxField = forwardRef((props, ref) => /* @__PURE__ */ jsx("label", { ...props, ref }));
5
- CheckboxField.displayName = "CheckboxField";
6
- export {
7
- CheckboxField,
8
- defaultTag
9
- };
@@ -1,44 +0,0 @@
1
- import { CheckboxCheckedIcon } from "@webstudio-is/icons/svg";
2
- import {
3
- defaultStates
4
- } from "@webstudio-is/react-sdk";
5
- import { label } from "@webstudio-is/react-sdk/css-normalize";
6
- import { props } from "./__generated__/checkbox-field.props";
7
- const presetStyle = {
8
- label: [
9
- ...label,
10
- { property: "display", value: { type: "keyword", value: "flex" } }
11
- ]
12
- };
13
- const meta = {
14
- category: "forms",
15
- type: "container",
16
- label: "Checkbox",
17
- icon: CheckboxCheckedIcon,
18
- states: defaultStates,
19
- presetStyle,
20
- template: [
21
- {
22
- type: "instance",
23
- component: "CheckboxField",
24
- children: [
25
- { type: "instance", component: "Checkbox", children: [] },
26
- {
27
- type: "instance",
28
- component: "TextBlock",
29
- label: "Checkbox Label",
30
- props: [],
31
- children: [{ type: "text", value: "Checkbox" }]
32
- }
33
- ]
34
- }
35
- ]
36
- };
37
- const propsMeta = {
38
- props,
39
- initialProps: []
40
- };
41
- export {
42
- meta,
43
- propsMeta
44
- };
@@ -1,62 +0,0 @@
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_svg = require("@webstudio-is/icons/svg");
26
- var import_react_sdk = require("@webstudio-is/react-sdk");
27
- var import_radio_button_field = require("./__generated__/radio-button-field.props");
28
- var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
29
- const presetStyle = {
30
- label: [
31
- ...import_css_normalize.label,
32
- { property: "display", value: { type: "keyword", value: "flex" } }
33
- ]
34
- };
35
- const meta = {
36
- category: "forms",
37
- type: "container",
38
- label: "Radio",
39
- icon: import_svg.RadioCheckedIcon,
40
- states: import_react_sdk.defaultStates,
41
- presetStyle,
42
- template: [
43
- {
44
- type: "instance",
45
- component: "RadioButtonField",
46
- children: [
47
- { type: "instance", component: "RadioButton", props: [], children: [] },
48
- {
49
- type: "instance",
50
- component: "TextBlock",
51
- label: "Radio Label",
52
- props: [],
53
- children: [{ type: "text", value: "Radio" }]
54
- }
55
- ]
56
- }
57
- ]
58
- };
59
- const propsMeta = {
60
- props: import_radio_button_field.props,
61
- initialProps: []
62
- };
package/lib/link-block.js DELETED
@@ -1,10 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- import { Link } from "./link";
4
- import { defaultTag } from "./link";
5
- const LinkBlock = forwardRef((props, ref) => /* @__PURE__ */ jsx(Link, { ...props, ref }));
6
- LinkBlock.displayName = "LinkBlock";
7
- export {
8
- LinkBlock,
9
- defaultTag
10
- };
@@ -1,33 +0,0 @@
1
- import { LinkBlockIcon } from "@webstudio-is/icons/svg";
2
- import { a } from "@webstudio-is/react-sdk/css-normalize";
3
- import { props } from "./__generated__/link-block.props";
4
- import { meta as linkMeta, propsMeta as linkPropsMeta } from "./link.ws";
5
- const presetStyle = {
6
- a: [
7
- ...a,
8
- {
9
- property: "display",
10
- value: { type: "keyword", value: "inline-block" }
11
- }
12
- ]
13
- };
14
- const meta = {
15
- category: "general",
16
- type: "container",
17
- label: "Link Block",
18
- icon: LinkBlockIcon,
19
- states: linkMeta.states,
20
- presetStyle,
21
- order: 2
22
- };
23
- const propsMeta = {
24
- props: {
25
- ...props,
26
- href: linkPropsMeta.props.href
27
- },
28
- initialProps: linkPropsMeta.initialProps
29
- };
30
- export {
31
- meta,
32
- propsMeta
33
- };
@@ -1,9 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- const defaultTag = "label";
4
- const RadioButtonField = forwardRef((props, ref) => /* @__PURE__ */ jsx("label", { ...props, ref }));
5
- RadioButtonField.displayName = "RadioButtonField";
6
- export {
7
- RadioButtonField,
8
- defaultTag
9
- };
@@ -1,44 +0,0 @@
1
- import { RadioCheckedIcon } from "@webstudio-is/icons/svg";
2
- import {
3
- defaultStates
4
- } from "@webstudio-is/react-sdk";
5
- import { props } from "./__generated__/radio-button-field.props";
6
- import { label } from "@webstudio-is/react-sdk/css-normalize";
7
- const presetStyle = {
8
- label: [
9
- ...label,
10
- { property: "display", value: { type: "keyword", value: "flex" } }
11
- ]
12
- };
13
- const meta = {
14
- category: "forms",
15
- type: "container",
16
- label: "Radio",
17
- icon: RadioCheckedIcon,
18
- states: defaultStates,
19
- presetStyle,
20
- template: [
21
- {
22
- type: "instance",
23
- component: "RadioButtonField",
24
- children: [
25
- { type: "instance", component: "RadioButton", props: [], children: [] },
26
- {
27
- type: "instance",
28
- component: "TextBlock",
29
- label: "Radio Label",
30
- props: [],
31
- children: [{ type: "text", value: "Radio" }]
32
- }
33
- ]
34
- }
35
- ]
36
- };
37
- const propsMeta = {
38
- props,
39
- initialProps: []
40
- };
41
- export {
42
- meta,
43
- propsMeta
44
- };
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const defaultTag = "label";
3
- export declare const CheckboxField: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "htmlFor">, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
@@ -1,3 +0,0 @@
1
- import { Link } from "./link";
2
- export { defaultTag } from "./link";
3
- export declare const LinkBlock: typeof Link;
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- import type { ComponentStory, ComponentMeta } from "@storybook/react";
3
- declare const _default: ComponentMeta<import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
4
- href?: string | undefined;
5
- target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
6
- prefetch?: "none" | "intent" | "render" | undefined;
7
- }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>>;
8
- export default _default;
9
- export declare const LinkBlock: ComponentStory<import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
10
- href?: string | undefined;
11
- target?: "_self" | "_blank" | "_parent" | "_top" | undefined;
12
- prefetch?: "none" | "intent" | "render" | undefined;
13
- }, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>>;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const defaultTag = "label";
3
- export declare const RadioButtonField: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "htmlFor">, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
@@ -1,10 +0,0 @@
1
- import { forwardRef, type ElementRef, type ComponentProps } from "react";
2
-
3
- export const defaultTag = "label";
4
-
5
- export const CheckboxField = forwardRef<
6
- ElementRef<typeof defaultTag>,
7
- Omit<ComponentProps<typeof defaultTag>, "htmlFor">
8
- >((props, ref) => <label {...props} ref={ref} />);
9
-
10
- CheckboxField.displayName = "CheckboxField";
@@ -1,47 +0,0 @@
1
- import { CheckboxCheckedIcon } from "@webstudio-is/icons/svg";
2
- import {
3
- type WsComponentMeta,
4
- type WsComponentPropsMeta,
5
- type PresetStyle,
6
- defaultStates,
7
- } from "@webstudio-is/react-sdk";
8
- import { label } from "@webstudio-is/react-sdk/css-normalize";
9
- import { props } from "./__generated__/checkbox-field.props";
10
- import type { defaultTag } from "./checkbox-field";
11
-
12
- const presetStyle = {
13
- label: [
14
- ...label,
15
- { property: "display", value: { type: "keyword", value: "flex" } },
16
- ],
17
- } satisfies PresetStyle<typeof defaultTag>;
18
-
19
- export const meta: WsComponentMeta = {
20
- category: "forms",
21
- type: "container",
22
- label: "Checkbox",
23
- icon: CheckboxCheckedIcon,
24
- states: defaultStates,
25
- presetStyle,
26
- template: [
27
- {
28
- type: "instance",
29
- component: "CheckboxField",
30
- children: [
31
- { type: "instance", component: "Checkbox", children: [] },
32
- {
33
- type: "instance",
34
- component: "TextBlock",
35
- label: "Checkbox Label",
36
- props: [],
37
- children: [{ type: "text", value: "Checkbox" }],
38
- },
39
- ],
40
- },
41
- ],
42
- };
43
-
44
- export const propsMeta: WsComponentPropsMeta = {
45
- props,
46
- initialProps: [],
47
- };
@@ -1,16 +0,0 @@
1
- import type { ComponentStory, ComponentMeta } from "@storybook/react";
2
- import { LinkBlock as LinkBlockPrimitive } from "./link-block";
3
-
4
- export default {
5
- title: "Components/Link Block",
6
- component: LinkBlockPrimitive,
7
- } as ComponentMeta<typeof LinkBlockPrimitive>;
8
-
9
- const Template: ComponentStory<typeof LinkBlockPrimitive> = (args) => (
10
- <LinkBlockPrimitive {...args} />
11
- );
12
-
13
- export const LinkBlock = Template.bind({});
14
- LinkBlock.args = {
15
- children: "Link Block",
16
- };
@@ -1,9 +0,0 @@
1
- import { forwardRef } from "react";
2
- import { Link } from "./link";
3
- export { defaultTag } from "./link";
4
-
5
- export const LinkBlock: typeof Link = forwardRef((props, ref) => (
6
- <Link {...props} ref={ref} />
7
- ));
8
-
9
- LinkBlock.displayName = "LinkBlock";