@webstudio-is/sdk-components-react-remix 0.145.0 → 0.151.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/components.js CHANGED
@@ -42,7 +42,7 @@ var Link = wrapLinkComponent(BaseLink);
42
42
  import { RichTextLink as BaseLink2 } from "@webstudio-is/sdk-components-react";
43
43
  var RichTextLink = wrapLinkComponent(BaseLink2);
44
44
 
45
- // src/server-form.tsx
45
+ // src/webhook-form.tsx
46
46
  import {
47
47
  forwardRef as forwardRef3,
48
48
  useRef,
@@ -63,7 +63,7 @@ var useOnFetchEnd = (fetcher, handler) => {
63
63
  prevFetcher.current = fetcher;
64
64
  }, [fetcher]);
65
65
  };
66
- var ServerForm = forwardRef3(
66
+ var WebhookForm = forwardRef3(
67
67
  ({ children, action, method, state = "initial", onStateChange, ...rest }, ref) => {
68
68
  const fetcher = useFetcher();
69
69
  const instanceId = getInstanceIdFromComponentProps(rest);
@@ -77,19 +77,22 @@ var ServerForm = forwardRef3(
77
77
  ] });
78
78
  }
79
79
  );
80
- ServerForm.displayName = "Form";
80
+ WebhookForm.displayName = "WebhookForm";
81
81
 
82
82
  // src/remix-form.tsx
83
83
  import { forwardRef as forwardRef4 } from "react";
84
84
  import { Form } from "@remix-run/react";
85
85
  import { jsx as jsx4 } from "react/jsx-runtime";
86
86
  var RemixForm = forwardRef4((props, ref) => {
87
- return /* @__PURE__ */ jsx4(Form, { ...props, ref });
87
+ if (props.action === "" || props.action?.startsWith("/")) {
88
+ return /* @__PURE__ */ jsx4(Form, { ...props, ref });
89
+ }
90
+ return /* @__PURE__ */ jsx4("form", { ...props, ref });
88
91
  });
89
92
  RemixForm.displayName = "Form";
90
93
  export {
91
94
  Body,
92
- ServerForm as Form,
95
+ WebhookForm as Form,
93
96
  Link,
94
97
  RemixForm,
95
98
  RichTextLink
package/lib/metas.js CHANGED
@@ -31,50 +31,50 @@ var props = {
31
31
  options: ["list", "none", "inline", "both"]
32
32
  },
33
33
  "aria-braillelabel": {
34
- description: "Defines a string value that labels the current element, which is intended to be converted into Braille.\n@see aria-label.",
34
+ description: "Defines a string value that labels the current element, which is intended to be converted into Braille.",
35
35
  required: false,
36
36
  control: "text",
37
37
  type: "string"
38
38
  },
39
39
  "aria-brailleroledescription": {
40
- description: "Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.\n@see aria-roledescription.",
40
+ description: "Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.",
41
41
  required: false,
42
42
  control: "text",
43
43
  type: "string"
44
44
  },
45
45
  "aria-busy": { required: false, control: "boolean", type: "boolean" },
46
46
  "aria-checked": {
47
- description: 'Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.\n@see aria-pressed\n@see aria-selected.',
47
+ description: 'Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.',
48
48
  required: false,
49
49
  control: "text",
50
50
  type: "string"
51
51
  },
52
52
  "aria-colcount": {
53
- description: "Defines the total number of columns in a table, grid, or treegrid.\n@see aria-colindex.",
53
+ description: "Defines the total number of columns in a table, grid, or treegrid.",
54
54
  required: false,
55
55
  control: "number",
56
56
  type: "number"
57
57
  },
58
58
  "aria-colindex": {
59
- description: "Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.\n@see aria-colcount\n@see aria-colspan.",
59
+ description: "Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.",
60
60
  required: false,
61
61
  control: "number",
62
62
  type: "number"
63
63
  },
64
64
  "aria-colindextext": {
65
- description: "Defines a human readable text alternative of aria-colindex.\n@see aria-rowindextext.",
65
+ description: "Defines a human readable text alternative of aria-colindex.",
66
66
  required: false,
67
67
  control: "text",
68
68
  type: "string"
69
69
  },
70
70
  "aria-colspan": {
71
- description: "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-colindex\n@see aria-rowspan.",
71
+ description: "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.",
72
72
  required: false,
73
73
  control: "number",
74
74
  type: "number"
75
75
  },
76
76
  "aria-controls": {
77
- description: "Identifies the element (or elements) whose contents or presence are controlled by the current element.\n@see aria-owns.",
77
+ description: "Identifies the element (or elements) whose contents or presence are controlled by the current element.",
78
78
  required: false,
79
79
  control: "text",
80
80
  type: "string"
@@ -86,38 +86,38 @@ var props = {
86
86
  type: "string"
87
87
  },
88
88
  "aria-describedby": {
89
- description: "Identifies the element (or elements) that describes the object.\n@see aria-labelledby",
89
+ description: "Identifies the element (or elements) that describes the object.",
90
90
  required: false,
91
91
  control: "text",
92
92
  type: "string"
93
93
  },
94
94
  "aria-description": {
95
- description: "Defines a string value that describes or annotates the current element.\n@see related aria-describedby.",
95
+ description: "Defines a string value that describes or annotates the current element.",
96
96
  required: false,
97
97
  control: "text",
98
98
  type: "string"
99
99
  },
100
100
  "aria-details": {
101
- description: "Identifies the element that provides a detailed, extended description for the object.\n@see aria-describedby.",
101
+ description: "Identifies the element that provides a detailed, extended description for the object.",
102
102
  required: false,
103
103
  control: "text",
104
104
  type: "string"
105
105
  },
106
106
  "aria-disabled": {
107
- description: "Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.\n@see aria-hidden\n@see aria-readonly.",
107
+ description: "Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.",
108
108
  required: false,
109
109
  control: "boolean",
110
110
  type: "boolean"
111
111
  },
112
112
  "aria-dropeffect": {
113
- description: "Indicates what functions can be performed when a dragged object is released on the drop target.\n@deprecated in ARIA 1.1",
113
+ description: "Indicates what functions can be performed when a dragged object is released on the drop target.",
114
114
  required: false,
115
115
  control: "select",
116
116
  type: "string",
117
117
  options: ["link", "none", "copy", "execute", "move", "popup"]
118
118
  },
119
119
  "aria-errormessage": {
120
- description: "Identifies the element that provides an error message for the object.\n@see aria-invalid\n@see aria-describedby.",
120
+ description: "Identifies the element that provides an error message for the object.",
121
121
  required: false,
122
122
  control: "text",
123
123
  type: "string"
@@ -135,8 +135,7 @@ var props = {
135
135
  type: "string"
136
136
  },
137
137
  "aria-grabbed": {
138
- description: `Indicates an element's "grabbed" state in a drag-and-drop operation.
139
- @deprecated in ARIA 1.1`,
138
+ description: `Indicates an element's "grabbed" state in a drag-and-drop operation.`,
140
139
  required: false,
141
140
  control: "boolean",
142
141
  type: "boolean"
@@ -148,13 +147,13 @@ var props = {
148
147
  type: "string"
149
148
  },
150
149
  "aria-hidden": {
151
- description: "Indicates whether the element is exposed to an accessibility API.\n@see aria-disabled.",
150
+ description: "Indicates whether the element is exposed to an accessibility API.",
152
151
  required: false,
153
152
  control: "boolean",
154
153
  type: "boolean"
155
154
  },
156
155
  "aria-invalid": {
157
- description: "Indicates the entered value does not conform to the format expected by the application.\n@see aria-errormessage.",
156
+ description: "Indicates the entered value does not conform to the format expected by the application.",
158
157
  required: false,
159
158
  control: "text",
160
159
  type: "string"
@@ -172,7 +171,7 @@ var props = {
172
171
  type: "string"
173
172
  },
174
173
  "aria-labelledby": {
175
- description: "Identifies the element (or elements) that labels the current element.\n@see aria-describedby.",
174
+ description: "Identifies the element (or elements) that labels the current element.",
176
175
  required: false,
177
176
  control: "text",
178
177
  type: "string"
@@ -216,7 +215,7 @@ var props = {
216
215
  options: ["horizontal", "vertical"]
217
216
  },
218
217
  "aria-owns": {
219
- description: "Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship\nbetween DOM elements where the DOM hierarchy cannot be used to represent the relationship.\n@see aria-controls.",
218
+ description: "Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship\nbetween DOM elements where the DOM hierarchy cannot be used to represent the relationship.",
220
219
  required: false,
221
220
  control: "text",
222
221
  type: "string"
@@ -228,25 +227,25 @@ var props = {
228
227
  type: "string"
229
228
  },
230
229
  "aria-posinset": {
231
- description: "Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-setsize.",
230
+ description: "Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.",
232
231
  required: false,
233
232
  control: "number",
234
233
  type: "number"
235
234
  },
236
235
  "aria-pressed": {
237
- description: 'Indicates the current "pressed" state of toggle buttons.\n@see aria-checked\n@see aria-selected.',
236
+ description: 'Indicates the current "pressed" state of toggle buttons.',
238
237
  required: false,
239
238
  control: "text",
240
239
  type: "string"
241
240
  },
242
241
  "aria-readonly": {
243
- description: "Indicates that the element is not editable, but is otherwise operable.\n@see aria-disabled.",
242
+ description: "Indicates that the element is not editable, but is otherwise operable.",
244
243
  required: false,
245
244
  control: "boolean",
246
245
  type: "boolean"
247
246
  },
248
247
  "aria-relevant": {
249
- description: "Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.\n@see aria-atomic.",
248
+ description: "Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.",
250
249
  required: false,
251
250
  control: "select",
252
251
  type: "string",
@@ -276,37 +275,37 @@ var props = {
276
275
  type: "string"
277
276
  },
278
277
  "aria-rowcount": {
279
- description: "Defines the total number of rows in a table, grid, or treegrid.\n@see aria-rowindex.",
278
+ description: "Defines the total number of rows in a table, grid, or treegrid.",
280
279
  required: false,
281
280
  control: "number",
282
281
  type: "number"
283
282
  },
284
283
  "aria-rowindex": {
285
- description: "Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.\n@see aria-rowcount\n@see aria-rowspan.",
284
+ description: "Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.",
286
285
  required: false,
287
286
  control: "number",
288
287
  type: "number"
289
288
  },
290
289
  "aria-rowindextext": {
291
- description: "Defines a human readable text alternative of aria-rowindex.\n@see aria-colindextext.",
290
+ description: "Defines a human readable text alternative of aria-rowindex.",
292
291
  required: false,
293
292
  control: "text",
294
293
  type: "string"
295
294
  },
296
295
  "aria-rowspan": {
297
- description: "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-rowindex\n@see aria-colspan.",
296
+ description: "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.",
298
297
  required: false,
299
298
  control: "number",
300
299
  type: "number"
301
300
  },
302
301
  "aria-selected": {
303
- description: 'Indicates the current "selected" state of various widgets.\n@see aria-checked\n@see aria-pressed.',
302
+ description: 'Indicates the current "selected" state of various widgets.',
304
303
  required: false,
305
304
  control: "boolean",
306
305
  type: "boolean"
307
306
  },
308
307
  "aria-setsize": {
309
- description: "Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-posinset.",
308
+ description: "Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.",
310
309
  required: false,
311
310
  control: "number",
312
311
  type: "number"
@@ -331,7 +330,7 @@ var props = {
331
330
  type: "number"
332
331
  },
333
332
  "aria-valuenow": {
334
- description: "Defines the current value for a range widget.\n@see aria-valuetext.",
333
+ description: "Defines the current value for a range widget.",
335
334
  required: false,
336
335
  control: "number",
337
336
  type: "number"
@@ -414,7 +413,7 @@ var props = {
414
413
  description: "Often used with CSS to style a specific element. The value of this attribute must be unique."
415
414
  },
416
415
  inputMode: {
417
- description: "Hints at the type of data that might be entered by the user while editing the element or its contents\n@see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute",
416
+ description: "Hints at the type of data that might be entered by the user while editing the element or its contents",
418
417
  required: false,
419
418
  control: "select",
420
419
  type: "string",
@@ -430,7 +429,7 @@ var props = {
430
429
  ]
431
430
  },
432
431
  is: {
433
- description: "Specify that a standard HTML element should behave like a defined custom built-in element\n@see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is",
432
+ description: "Specify that a standard HTML element should behave like a defined custom built-in element",
434
433
  required: false,
435
434
  control: "text",
436
435
  type: "string"
@@ -459,12 +458,6 @@ var props = {
459
458
  type: "string",
460
459
  description: "The ping attribute specifies a space-separated list of URLs to be notified if a user follows the hyperlink."
461
460
  },
462
- placeholder: {
463
- required: false,
464
- control: "text",
465
- type: "string",
466
- description: "Provides a hint to the user of what can be entered in the field."
467
- },
468
461
  prefetch: {
469
462
  required: false,
470
463
  control: "select",
@@ -592,14 +585,19 @@ var propsMeta = {
592
585
  // src/rich-text-link.ws.ts
593
586
  import { RichTextLink } from "@webstudio-is/sdk-components-react/metas";
594
587
 
595
- // src/server-form.ws.ts
588
+ // src/webhook-form.ws.ts
596
589
  import { Form as baseMeta } from "@webstudio-is/sdk-components-react/metas";
597
590
  import {
598
591
  showAttribute
599
592
  } from "@webstudio-is/react-sdk";
593
+ import { WebhookFormIcon } from "@webstudio-is/icons/svg";
600
594
  var meta = {
601
595
  ...baseMeta,
602
- label: "Form",
596
+ category: "data",
597
+ label: "Webhook Form",
598
+ description: "Collect user data and send it to any webhook.",
599
+ order: 1,
600
+ icon: WebhookFormIcon,
603
601
  states: [
604
602
  { selector: "[data-state=error]", label: "Error" },
605
603
  { selector: "[data-state=success]", label: "Success" }
@@ -701,29 +699,12 @@ var meta = {
701
699
  };
702
700
 
703
701
  // src/remix-form.ws.ts
704
- import {
705
- defaultStates
706
- } from "@webstudio-is/react-sdk";
707
- import { form } from "@webstudio-is/react-sdk/css-normalize";
708
- import { FormIcon } from "@webstudio-is/icons/svg";
709
- var presetStyle = {
710
- form
711
- };
712
- var meta2 = {
713
- category: "forms",
714
- type: "container",
715
- invalidAncestors: ["Form", "Button", "Link"],
716
- label: "Form",
717
- description: "Form control.",
718
- icon: FormIcon,
719
- states: defaultStates,
720
- presetStyle,
721
- order: 0
722
- };
702
+ import { Form } from "@webstudio-is/sdk-components-react/metas";
703
+ import { Form as Form2 } from "@webstudio-is/sdk-components-react/props";
723
704
  export {
724
705
  Body,
725
706
  meta as Form,
726
707
  Link,
727
- meta2 as RemixForm,
708
+ Form as RemixForm,
728
709
  RichTextLink
729
710
  };