@webstudio-is/sdk-components-react 0.168.0 → 0.173.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 (40) hide show
  1. package/lib/components.js +68 -45
  2. package/lib/metas.js +223 -64
  3. package/lib/props.js +1273 -6
  4. package/lib/types/__generated__/option.props.d.ts +2 -0
  5. package/lib/types/__generated__/select.props.d.ts +2 -0
  6. package/lib/types/blockquote.d.ts +0 -1
  7. package/lib/types/body.d.ts +0 -1
  8. package/lib/types/bold.d.ts +0 -1
  9. package/lib/types/button.d.ts +0 -1
  10. package/lib/types/checkbox.d.ts +1 -2
  11. package/lib/types/code-text.d.ts +1 -2
  12. package/lib/types/components.d.ts +2 -0
  13. package/lib/types/form.d.ts +0 -1
  14. package/lib/types/hooks.d.ts +2 -0
  15. package/lib/types/html-embed.d.ts +1 -1
  16. package/lib/types/html-embed.test.d.ts +1 -1
  17. package/lib/types/image.d.ts +3 -1
  18. package/lib/types/input.d.ts +1 -2
  19. package/lib/types/italic.d.ts +0 -1
  20. package/lib/types/label.d.ts +0 -1
  21. package/lib/types/list-item.d.ts +0 -1
  22. package/lib/types/metas.d.ts +2 -0
  23. package/lib/types/option.d.ts +2 -0
  24. package/lib/types/option.ws.d.ts +3 -0
  25. package/lib/types/paragraph.d.ts +0 -1
  26. package/lib/types/props.d.ts +2 -0
  27. package/lib/types/radio-button.d.ts +1 -2
  28. package/lib/types/select.d.ts +4 -0
  29. package/lib/types/select.ws.d.ts +3 -0
  30. package/lib/types/separator.d.ts +0 -1
  31. package/lib/types/span.d.ts +0 -1
  32. package/lib/types/subscript.d.ts +0 -1
  33. package/lib/types/superscript.d.ts +0 -1
  34. package/lib/types/textarea.d.ts +0 -1
  35. package/lib/types/vimeo-play-button.d.ts +0 -1
  36. package/lib/types/vimeo-preview-image.d.ts +17 -17
  37. package/lib/types/vimeo-spinner.d.ts +0 -1
  38. package/lib/types/vimeo.d.ts +1 -1
  39. package/lib/types/xml-node.d.ts +2 -2
  40. package/package.json +13 -11
package/lib/metas.js CHANGED
@@ -23,6 +23,7 @@ import { EmbedIcon } from "@webstudio-is/icons/svg";
23
23
 
24
24
  // src/__generated__/html-embed.props.ts
25
25
  var props = {
26
+ className: { required: false, control: "text", type: "string" },
26
27
  clientOnly: { required: false, control: "boolean", type: "boolean" },
27
28
  code: { required: true, control: "text", type: "string" },
28
29
  executeScriptOnCanvas: {
@@ -33,13 +34,21 @@ var props = {
33
34
  };
34
35
 
35
36
  // src/html-embed.ws.ts
37
+ var presetStyle = {
38
+ div: [
39
+ {
40
+ property: "display",
41
+ value: { type: "keyword", value: "contents" }
42
+ }
43
+ ]
44
+ };
36
45
  var meta3 = {
37
46
  category: "general",
38
47
  type: "embed",
39
48
  label: "HTML Embed",
40
49
  description: "Used to add HTML code to the page, such as an SVG or script.",
41
50
  icon: EmbedIcon,
42
- stylable: false,
51
+ presetStyle,
43
52
  order: 8
44
53
  };
45
54
  var propsMeta = {
@@ -60,7 +69,7 @@ var propsMeta = {
60
69
  type: "string"
61
70
  }
62
71
  },
63
- initialProps: ["clientOnly", "executeScriptOnCanvas"]
72
+ initialProps: ["className", "clientOnly", "executeScriptOnCanvas"]
64
73
  };
65
74
 
66
75
  // src/content-embed.ws.ts
@@ -176,7 +185,7 @@ import {
176
185
  defaultStates
177
186
  } from "@webstudio-is/react-sdk";
178
187
  import { body } from "@webstudio-is/react-sdk/css-normalize";
179
- var presetStyle = {
188
+ var presetStyle2 = {
180
189
  body: [
181
190
  ...body,
182
191
  {
@@ -194,7 +203,7 @@ var meta5 = {
194
203
  label: "Body",
195
204
  icon: BodyIcon,
196
205
  states: defaultStates,
197
- presetStyle
206
+ presetStyle: presetStyle2
198
207
  };
199
208
 
200
209
  // src/box.ws.ts
@@ -214,7 +223,7 @@ import {
214
223
  nav,
215
224
  section
216
225
  } from "@webstudio-is/react-sdk/css-normalize";
217
- var presetStyle2 = {
226
+ var presetStyle3 = {
218
227
  div,
219
228
  address,
220
229
  article,
@@ -233,7 +242,7 @@ var meta6 = {
233
242
  description: "A container for content. By default this is a Div, but the tag can be changed in settings.",
234
243
  icon: BoxIcon,
235
244
  states: defaultStates2,
236
- presetStyle: presetStyle2,
245
+ presetStyle: presetStyle3,
237
246
  order: 0
238
247
  };
239
248
 
@@ -243,7 +252,7 @@ import {
243
252
  defaultStates as defaultStates3
244
253
  } from "@webstudio-is/react-sdk";
245
254
  import { div as div2 } from "@webstudio-is/react-sdk/css-normalize";
246
- var presetStyle3 = {
255
+ var presetStyle4 = {
247
256
  div: [
248
257
  ...div2,
249
258
  {
@@ -259,7 +268,7 @@ var meta7 = {
259
268
  description: "A generic container for any text content that is not a heading or a link.",
260
269
  icon: TextIcon,
261
270
  states: defaultStates3,
262
- presetStyle: presetStyle3,
271
+ presetStyle: presetStyle4,
263
272
  order: 0,
264
273
  template: [
265
274
  {
@@ -282,7 +291,7 @@ import {
282
291
  defaultStates as defaultStates4
283
292
  } from "@webstudio-is/react-sdk";
284
293
  import { h1, h2, h3, h4, h5, h6 } from "@webstudio-is/react-sdk/css-normalize";
285
- var presetStyle4 = {
294
+ var presetStyle5 = {
286
295
  h1,
287
296
  h2,
288
297
  h3,
@@ -298,7 +307,7 @@ var meta8 = {
298
307
  icon: HeadingIcon,
299
308
  invalidAncestors: ["Heading"],
300
309
  states: defaultStates4,
301
- presetStyle: presetStyle4,
310
+ presetStyle: presetStyle5,
302
311
  order: 1,
303
312
  template: [
304
313
  {
@@ -321,7 +330,7 @@ import {
321
330
  defaultStates as defaultStates5
322
331
  } from "@webstudio-is/react-sdk";
323
332
  import { p } from "@webstudio-is/react-sdk/css-normalize";
324
- var presetStyle5 = {
333
+ var presetStyle6 = {
325
334
  p
326
335
  };
327
336
  var meta9 = {
@@ -332,7 +341,7 @@ var meta9 = {
332
341
  icon: TextAlignLeftIcon,
333
342
  invalidAncestors: ["Paragraph"],
334
343
  states: defaultStates5,
335
- presetStyle: presetStyle5,
344
+ presetStyle: presetStyle6,
336
345
  order: 2,
337
346
  template: [
338
347
  {
@@ -730,6 +739,7 @@ var props2 = {
730
739
  },
731
740
  datatype: { required: false, control: "text", type: "string" },
732
741
  defaultChecked: { required: false, control: "boolean", type: "boolean" },
742
+ defaultValue: { required: false, control: "text", type: "string" },
733
743
  dir: {
734
744
  required: false,
735
745
  control: "text",
@@ -913,7 +923,7 @@ var props2 = {
913
923
  };
914
924
 
915
925
  // src/link.ws.ts
916
- var presetStyle6 = {
926
+ var presetStyle7 = {
917
927
  a: [
918
928
  ...a,
919
929
  {
@@ -933,7 +943,7 @@ var meta10 = {
933
943
  description: "Use a link to send your users to another page, section, or resource. Configure links in the Settings panel.",
934
944
  icon: LinkIcon,
935
945
  invalidAncestors: ["Link", "Button"],
936
- presetStyle: presetStyle6,
946
+ presetStyle: presetStyle7,
937
947
  order: 1,
938
948
  states: [
939
949
  ...defaultStates6,
@@ -987,7 +997,7 @@ import {
987
997
  defaultStates as defaultStates7
988
998
  } from "@webstudio-is/react-sdk";
989
999
  import { span } from "@webstudio-is/react-sdk/css-normalize";
990
- var presetStyle7 = {
1000
+ var presetStyle8 = {
991
1001
  span
992
1002
  };
993
1003
  var meta12 = {
@@ -995,7 +1005,7 @@ var meta12 = {
995
1005
  label: "Text",
996
1006
  icon: PaintBrushIcon,
997
1007
  states: defaultStates7,
998
- presetStyle: presetStyle7
1008
+ presetStyle: presetStyle8
999
1009
  };
1000
1010
 
1001
1011
  // src/bold.ws.ts
@@ -1004,7 +1014,7 @@ import {
1004
1014
  defaultStates as defaultStates8
1005
1015
  } from "@webstudio-is/react-sdk";
1006
1016
  import { b } from "@webstudio-is/react-sdk/css-normalize";
1007
- var presetStyle8 = {
1017
+ var presetStyle9 = {
1008
1018
  b
1009
1019
  };
1010
1020
  var meta13 = {
@@ -1012,7 +1022,7 @@ var meta13 = {
1012
1022
  label: "Bold Text",
1013
1023
  icon: BoldIcon,
1014
1024
  states: defaultStates8,
1015
- presetStyle: presetStyle8
1025
+ presetStyle: presetStyle9
1016
1026
  };
1017
1027
 
1018
1028
  // src/italic.ws.ts
@@ -1021,7 +1031,7 @@ import {
1021
1031
  defaultStates as defaultStates9
1022
1032
  } from "@webstudio-is/react-sdk";
1023
1033
  import { i } from "@webstudio-is/react-sdk/css-normalize";
1024
- var presetStyle9 = {
1034
+ var presetStyle10 = {
1025
1035
  i: [
1026
1036
  ...i,
1027
1037
  {
@@ -1035,7 +1045,7 @@ var meta14 = {
1035
1045
  label: "Italic Text",
1036
1046
  icon: TextItalicIcon,
1037
1047
  states: defaultStates9,
1038
- presetStyle: presetStyle9
1048
+ presetStyle: presetStyle10
1039
1049
  };
1040
1050
 
1041
1051
  // src/superscript.ws.ts
@@ -1044,7 +1054,7 @@ import {
1044
1054
  defaultStates as defaultStates10
1045
1055
  } from "@webstudio-is/react-sdk";
1046
1056
  import { sup } from "@webstudio-is/react-sdk/css-normalize";
1047
- var presetStyle10 = {
1057
+ var presetStyle11 = {
1048
1058
  sup
1049
1059
  };
1050
1060
  var meta15 = {
@@ -1052,7 +1062,7 @@ var meta15 = {
1052
1062
  label: "Superscript Text",
1053
1063
  icon: SuperscriptIcon,
1054
1064
  states: defaultStates10,
1055
- presetStyle: presetStyle10
1065
+ presetStyle: presetStyle11
1056
1066
  };
1057
1067
 
1058
1068
  // src/subscript.ws.ts
@@ -1061,7 +1071,7 @@ import {
1061
1071
  defaultStates as defaultStates11
1062
1072
  } from "@webstudio-is/react-sdk";
1063
1073
  import { sub } from "@webstudio-is/react-sdk/css-normalize";
1064
- var presetStyle11 = {
1074
+ var presetStyle12 = {
1065
1075
  sub
1066
1076
  };
1067
1077
  var meta16 = {
@@ -1069,7 +1079,7 @@ var meta16 = {
1069
1079
  label: "Subscript Text",
1070
1080
  icon: SubscriptIcon,
1071
1081
  states: defaultStates11,
1072
- presetStyle: presetStyle11
1082
+ presetStyle: presetStyle12
1073
1083
  };
1074
1084
 
1075
1085
  // src/button.ws.ts
@@ -1078,7 +1088,7 @@ import {
1078
1088
  defaultStates as defaultStates12
1079
1089
  } from "@webstudio-is/react-sdk";
1080
1090
  import { button } from "@webstudio-is/react-sdk/css-normalize";
1081
- var presetStyle12 = {
1091
+ var presetStyle13 = {
1082
1092
  button
1083
1093
  };
1084
1094
  var meta17 = {
@@ -1088,7 +1098,7 @@ var meta17 = {
1088
1098
  label: "Button",
1089
1099
  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\u2019s what a link is used for.",
1090
1100
  icon: ButtonElementIcon,
1091
- presetStyle: presetStyle12,
1101
+ presetStyle: presetStyle13,
1092
1102
  states: [
1093
1103
  ...defaultStates12,
1094
1104
  { selector: ":disabled", label: "Disabled" },
@@ -1116,7 +1126,7 @@ import {
1116
1126
  defaultStates as defaultStates13
1117
1127
  } from "@webstudio-is/react-sdk";
1118
1128
  import { input } from "@webstudio-is/react-sdk/css-normalize";
1119
- var presetStyle13 = {
1129
+ var presetStyle14 = {
1120
1130
  input: [
1121
1131
  ...input,
1122
1132
  {
@@ -1132,7 +1142,7 @@ var meta18 = {
1132
1142
  label: "Text Input",
1133
1143
  description: "A single-line text input for collecting string data from your users.",
1134
1144
  icon: FormTextFieldIcon,
1135
- presetStyle: presetStyle13,
1145
+ presetStyle: presetStyle14,
1136
1146
  order: 3,
1137
1147
  states: [
1138
1148
  ...defaultStates13,
@@ -1155,7 +1165,7 @@ import {
1155
1165
  defaultStates as defaultStates14
1156
1166
  } from "@webstudio-is/react-sdk";
1157
1167
  import { form } from "@webstudio-is/react-sdk/css-normalize";
1158
- var presetStyle14 = {
1168
+ var presetStyle15 = {
1159
1169
  form: [
1160
1170
  ...form,
1161
1171
  { property: "minHeight", value: { type: "unit", unit: "px", value: 20 } }
@@ -1169,7 +1179,7 @@ var meta19 = {
1169
1179
  description: "Create filters, surveys, searches and more.",
1170
1180
  icon: FormIcon,
1171
1181
  states: defaultStates14,
1172
- presetStyle: presetStyle14,
1182
+ presetStyle: presetStyle15,
1173
1183
  order: 0
1174
1184
  };
1175
1185
 
@@ -1574,6 +1584,7 @@ var props3 = {
1574
1584
  description: "Indicates the preferred method to decode the image."
1575
1585
  },
1576
1586
  defaultChecked: { required: false, control: "boolean", type: "boolean" },
1587
+ defaultValue: { required: false, control: "text", type: "string" },
1577
1588
  dir: {
1578
1589
  required: false,
1579
1590
  control: "text",
@@ -1652,7 +1663,12 @@ var props3 = {
1652
1663
  description: "Determines whether the image will load as soon as possible (Eager), or when it scrolls into view (Lazy). Lazy loading is a great option for pages with many images because it can significantly reduce the time it takes for the page to load initially."
1653
1664
  },
1654
1665
  nonce: { required: false, control: "text", type: "string" },
1655
- optimize: { required: false, control: "boolean", type: "boolean" },
1666
+ optimize: {
1667
+ required: false,
1668
+ control: "boolean",
1669
+ type: "boolean",
1670
+ defaultValue: true
1671
+ },
1656
1672
  prefix: { required: false, control: "text", type: "string" },
1657
1673
  property: { required: false, control: "text", type: "string" },
1658
1674
  quality: { required: false, control: "number", type: "number" },
@@ -1762,7 +1778,7 @@ var props3 = {
1762
1778
  };
1763
1779
 
1764
1780
  // src/image.ws.ts
1765
- var presetStyle15 = {
1781
+ var presetStyle16 = {
1766
1782
  img: [
1767
1783
  ...img,
1768
1784
  // Otherwise on new image insert onto canvas it can overfit screen size multiple times
@@ -1792,7 +1808,7 @@ var meta20 = {
1792
1808
  description: "Add an image asset to the page. Webstudio automatically converts images to WebP or AVIF format and makes them responsive for best performance.",
1793
1809
  icon: ImageIcon,
1794
1810
  states: defaultStates15,
1795
- presetStyle: presetStyle15,
1811
+ presetStyle: presetStyle16,
1796
1812
  order: 0
1797
1813
  };
1798
1814
  var propsOverrides = {
@@ -1803,12 +1819,24 @@ var propsOverrides = {
1803
1819
  required: false
1804
1820
  }
1805
1821
  };
1822
+ var optimize = props3.optimize;
1823
+ optimize.description = "Optimize the image for enhanced performance.";
1806
1824
  var propsMeta3 = {
1807
1825
  props: {
1808
1826
  ...props3,
1809
- ...propsOverrides
1810
- },
1811
- initialProps: ["id", "className", "src", "width", "height", "alt", "loading"]
1827
+ ...propsOverrides,
1828
+ optimize
1829
+ },
1830
+ initialProps: [
1831
+ "id",
1832
+ "className",
1833
+ "src",
1834
+ "width",
1835
+ "height",
1836
+ "alt",
1837
+ "loading",
1838
+ "optimize"
1839
+ ]
1812
1840
  };
1813
1841
 
1814
1842
  // src/blockquote.ws.ts
@@ -1816,7 +1844,7 @@ import { BlockquoteIcon } from "@webstudio-is/icons/svg";
1816
1844
  import {
1817
1845
  defaultStates as defaultStates16
1818
1846
  } from "@webstudio-is/react-sdk";
1819
- var presetStyle16 = {
1847
+ var presetStyle17 = {
1820
1848
  blockquote: [
1821
1849
  {
1822
1850
  property: "marginTop",
@@ -1871,7 +1899,7 @@ var meta21 = {
1871
1899
  description: "Use to style a quote from an external source like an article or book.",
1872
1900
  icon: BlockquoteIcon,
1873
1901
  states: defaultStates16,
1874
- presetStyle: presetStyle16,
1902
+ presetStyle: presetStyle17,
1875
1903
  order: 3,
1876
1904
  template: [
1877
1905
  {
@@ -1894,7 +1922,7 @@ import {
1894
1922
  defaultStates as defaultStates17
1895
1923
  } from "@webstudio-is/react-sdk";
1896
1924
  import { ol, ul } from "@webstudio-is/react-sdk/css-normalize";
1897
- var presetStyle17 = {
1925
+ var presetStyle18 = {
1898
1926
  ol: [
1899
1927
  ...ol,
1900
1928
  {
@@ -1933,7 +1961,7 @@ var meta22 = {
1933
1961
  description: "Groups content, like links in a menu or steps in a recipe.",
1934
1962
  icon: ListIcon,
1935
1963
  states: defaultStates17,
1936
- presetStyle: presetStyle17,
1964
+ presetStyle: presetStyle18,
1937
1965
  order: 3,
1938
1966
  template: [
1939
1967
  {
@@ -1984,7 +2012,7 @@ import {
1984
2012
  defaultStates as defaultStates18
1985
2013
  } from "@webstudio-is/react-sdk";
1986
2014
  import { li } from "@webstudio-is/react-sdk/css-normalize";
1987
- var presetStyle18 = {
2015
+ var presetStyle19 = {
1988
2016
  li
1989
2017
  };
1990
2018
  var meta23 = {
@@ -1995,7 +2023,7 @@ var meta23 = {
1995
2023
  description: "Adds a new item to an existing list.",
1996
2024
  icon: ListItemIcon,
1997
2025
  states: defaultStates18,
1998
- presetStyle: presetStyle18,
2026
+ presetStyle: presetStyle19,
1999
2027
  order: 4,
2000
2028
  template: [
2001
2029
  {
@@ -2018,7 +2046,7 @@ import {
2018
2046
  defaultStates as defaultStates19
2019
2047
  } from "@webstudio-is/react-sdk";
2020
2048
  import { hr } from "@webstudio-is/react-sdk/css-normalize";
2021
- var presetStyle19 = {
2049
+ var presetStyle20 = {
2022
2050
  hr: [
2023
2051
  ...hr,
2024
2052
  {
@@ -2054,7 +2082,7 @@ var meta24 = {
2054
2082
  description: "Used to visually divide sections of content, helping to improve readability and organization within a webpage.",
2055
2083
  icon: DashIcon,
2056
2084
  states: defaultStates19,
2057
- presetStyle: presetStyle19,
2085
+ presetStyle: presetStyle20,
2058
2086
  order: 5
2059
2087
  };
2060
2088
 
@@ -2440,6 +2468,7 @@ var props4 = {
2440
2468
  },
2441
2469
  datatype: { required: false, control: "text", type: "string" },
2442
2470
  defaultChecked: { required: false, control: "boolean", type: "boolean" },
2471
+ defaultValue: { required: false, control: "text", type: "string" },
2443
2472
  dir: {
2444
2473
  required: false,
2445
2474
  control: "text",
@@ -2569,7 +2598,7 @@ var props4 = {
2569
2598
  };
2570
2599
 
2571
2600
  // src/code-text.ws.ts
2572
- var presetStyle20 = {
2601
+ var presetStyle21 = {
2573
2602
  code: [
2574
2603
  ...code,
2575
2604
  {
@@ -2577,8 +2606,12 @@ var presetStyle20 = {
2577
2606
  value: { type: "keyword", value: "block" }
2578
2607
  },
2579
2608
  {
2580
- property: "whiteSpace",
2581
- value: { type: "keyword", value: "pre-wrap" }
2609
+ property: "whiteSpaceCollapse",
2610
+ value: { type: "keyword", value: "preserve" }
2611
+ },
2612
+ {
2613
+ property: "textWrapMode",
2614
+ value: { type: "keyword", value: "wrap" }
2582
2615
  },
2583
2616
  {
2584
2617
  property: "paddingLeft",
@@ -2602,7 +2635,7 @@ var meta25 = {
2602
2635
  icon: CodeTextIcon,
2603
2636
  invalidAncestors: ["CodeText"],
2604
2637
  states: defaultStates20,
2605
- presetStyle: presetStyle20,
2638
+ presetStyle: presetStyle21,
2606
2639
  order: 9
2607
2640
  };
2608
2641
  var propsMeta4 = {
@@ -2998,6 +3031,7 @@ var props5 = {
2998
3031
  },
2999
3032
  datatype: { required: false, control: "text", type: "string" },
3000
3033
  defaultChecked: { required: false, control: "boolean", type: "boolean" },
3034
+ defaultValue: { required: false, control: "text", type: "string" },
3001
3035
  dir: {
3002
3036
  required: false,
3003
3037
  control: "text",
@@ -3139,7 +3173,7 @@ var props5 = {
3139
3173
  };
3140
3174
 
3141
3175
  // src/label.ws.ts
3142
- var presetStyle21 = {
3176
+ var presetStyle22 = {
3143
3177
  label: [
3144
3178
  ...label,
3145
3179
  { property: "display", value: { type: "keyword", value: "block" } }
@@ -3152,7 +3186,7 @@ var meta26 = {
3152
3186
  label: "Input Label",
3153
3187
  icon: LabelIcon,
3154
3188
  states: defaultStates21,
3155
- presetStyle: presetStyle21,
3189
+ presetStyle: presetStyle22,
3156
3190
  order: 2,
3157
3191
  template: [
3158
3192
  {
@@ -3179,7 +3213,7 @@ import {
3179
3213
  defaultStates as defaultStates22
3180
3214
  } from "@webstudio-is/react-sdk";
3181
3215
  import { textarea } from "@webstudio-is/react-sdk/css-normalize";
3182
- var presetStyle22 = {
3216
+ var presetStyle23 = {
3183
3217
  textarea: [
3184
3218
  ...textarea,
3185
3219
  // resize doesn't work well while on canvas
@@ -3196,7 +3230,7 @@ var meta27 = {
3196
3230
  label: "Text Area",
3197
3231
  description: "A multi-line text input for collecting longer string data from your users.",
3198
3232
  icon: FormTextAreaIcon,
3199
- presetStyle: presetStyle22,
3233
+ presetStyle: presetStyle23,
3200
3234
  order: 4,
3201
3235
  invalidAncestors: ["Button", "Link"],
3202
3236
  states: [
@@ -3220,7 +3254,7 @@ import {
3220
3254
  defaultStates as defaultStates23
3221
3255
  } from "@webstudio-is/react-sdk";
3222
3256
  import { radio } from "@webstudio-is/react-sdk/css-normalize";
3223
- var presetStyle23 = {
3257
+ var presetStyle24 = {
3224
3258
  input: [
3225
3259
  ...radio,
3226
3260
  {
@@ -3236,7 +3270,7 @@ var meta28 = {
3236
3270
  label: "Radio",
3237
3271
  description: "Use within a form to allow your users to select a single option from a set of mutually exclusive choices. Group multiple radios by matching their \u201CName\u201D properties.",
3238
3272
  icon: RadioCheckedIcon,
3239
- presetStyle: presetStyle23,
3273
+ presetStyle: presetStyle24,
3240
3274
  order: 5,
3241
3275
  states: [
3242
3276
  ...defaultStates23,
@@ -3274,7 +3308,7 @@ import {
3274
3308
  defaultStates as defaultStates24
3275
3309
  } from "@webstudio-is/react-sdk";
3276
3310
  import { checkbox } from "@webstudio-is/react-sdk/css-normalize";
3277
- var presetStyle24 = {
3311
+ var presetStyle25 = {
3278
3312
  input: [
3279
3313
  ...checkbox,
3280
3314
  {
@@ -3290,7 +3324,7 @@ var meta29 = {
3290
3324
  label: "Checkbox",
3291
3325
  description: "Use within a form to allow your users to toggle between checked and not checked. Group checkboxes by matching their \u201CName\u201D properties. Unlike radios, any number of checkboxes in a group can be checked.",
3292
3326
  icon: CheckboxCheckedIcon,
3293
- presetStyle: presetStyle24,
3327
+ presetStyle: presetStyle25,
3294
3328
  order: 6,
3295
3329
  states: [
3296
3330
  ...defaultStates24,
@@ -3327,7 +3361,7 @@ import {
3327
3361
  defaultStates as defaultStates25
3328
3362
  } from "@webstudio-is/react-sdk";
3329
3363
  import { div as div3 } from "@webstudio-is/react-sdk/css-normalize";
3330
- var presetStyle25 = {
3364
+ var presetStyle26 = {
3331
3365
  div: div3
3332
3366
  };
3333
3367
  var meta30 = {
@@ -3338,7 +3372,7 @@ var meta30 = {
3338
3372
  order: 1,
3339
3373
  icon: VimeoIcon,
3340
3374
  states: defaultStates25,
3341
- presetStyle: presetStyle25,
3375
+ presetStyle: presetStyle26,
3342
3376
  invalidAncestors: ["Button", "Heading", "Link"],
3343
3377
  template: [
3344
3378
  {
@@ -4025,6 +4059,7 @@ var props6 = {
4025
4059
  description: "Indicates the preferred method to decode the image."
4026
4060
  },
4027
4061
  defaultChecked: { required: false, control: "boolean", type: "boolean" },
4062
+ defaultValue: { required: false, control: "text", type: "string" },
4028
4063
  dir: {
4029
4064
  required: false,
4030
4065
  control: "text",
@@ -4229,7 +4264,7 @@ import {
4229
4264
  } from "@webstudio-is/react-sdk";
4230
4265
  import { ButtonElementIcon as ButtonElementIcon2 } from "@webstudio-is/icons/svg";
4231
4266
  import { button as button2 } from "@webstudio-is/react-sdk/css-normalize";
4232
- var presetStyle26 = {
4267
+ var presetStyle27 = {
4233
4268
  button: button2
4234
4269
  };
4235
4270
  var meta32 = {
@@ -4239,7 +4274,7 @@ var meta32 = {
4239
4274
  requiredAncestors: ["Vimeo"],
4240
4275
  label: "Play Button",
4241
4276
  icon: ButtonElementIcon2,
4242
- presetStyle: presetStyle26,
4277
+ presetStyle: presetStyle27,
4243
4278
  states: defaultStates26
4244
4279
  };
4245
4280
 
@@ -4249,14 +4284,14 @@ import {
4249
4284
  } from "@webstudio-is/react-sdk";
4250
4285
  import { div as div4 } from "@webstudio-is/react-sdk/css-normalize";
4251
4286
  import { BoxIcon as BoxIcon2 } from "@webstudio-is/icons/svg";
4252
- var presetStyle27 = {
4287
+ var presetStyle28 = {
4253
4288
  div: div4
4254
4289
  };
4255
4290
  var meta33 = {
4256
4291
  type: "container",
4257
4292
  icon: BoxIcon2,
4258
4293
  states: defaultStates27,
4259
- presetStyle: presetStyle27,
4294
+ presetStyle: presetStyle28,
4260
4295
  category: "hidden",
4261
4296
  label: "Spinner",
4262
4297
  requiredAncestors: ["Vimeo"]
@@ -4280,7 +4315,7 @@ import {
4280
4315
  defaultStates as defaultStates28
4281
4316
  } from "@webstudio-is/react-sdk";
4282
4317
  import { time } from "@webstudio-is/react-sdk/css-normalize";
4283
- var presetStyle28 = {
4318
+ var presetStyle29 = {
4284
4319
  time
4285
4320
  };
4286
4321
  var meta35 = {
@@ -4289,9 +4324,131 @@ var meta35 = {
4289
4324
  description: "Converts machine-readable date and time to a human-readable format.",
4290
4325
  icon: CalendarIcon,
4291
4326
  states: defaultStates28,
4292
- presetStyle: presetStyle28,
4327
+ presetStyle: presetStyle29,
4293
4328
  order: 4
4294
4329
  };
4330
+
4331
+ // src/select.ws.ts
4332
+ import { SelectIcon } from "@webstudio-is/icons/svg";
4333
+ import {
4334
+ defaultStates as defaultStates29
4335
+ } from "@webstudio-is/react-sdk";
4336
+ import { select } from "@webstudio-is/react-sdk/css-normalize";
4337
+ var presetStyle30 = {
4338
+ select: [
4339
+ ...select,
4340
+ {
4341
+ property: "display",
4342
+ value: { type: "keyword", value: "block" }
4343
+ }
4344
+ ]
4345
+ };
4346
+ var meta36 = {
4347
+ category: "forms",
4348
+ invalidAncestors: ["Button", "Link"],
4349
+ type: "container",
4350
+ label: "Select",
4351
+ description: "A drop-down menu for users to select a single option from a predefined list.",
4352
+ icon: SelectIcon,
4353
+ presetStyle: presetStyle30,
4354
+ order: 4,
4355
+ states: [
4356
+ ...defaultStates29,
4357
+ { selector: "::placeholder", label: "Placeholder" },
4358
+ { selector: ":valid", label: "Valid" },
4359
+ { selector: ":invalid", label: "Invalid" },
4360
+ { selector: ":required", label: "Required" },
4361
+ { selector: ":optional", label: "Optional" }
4362
+ ],
4363
+ template: [
4364
+ {
4365
+ type: "instance",
4366
+ component: "Select",
4367
+ label: "Select",
4368
+ children: [
4369
+ {
4370
+ type: "instance",
4371
+ component: "Option",
4372
+ label: "Option",
4373
+ props: [
4374
+ { type: "string", name: "label", value: "Please choose an option" },
4375
+ { type: "string", name: "value", value: "" }
4376
+ ],
4377
+ children: []
4378
+ },
4379
+ {
4380
+ type: "instance",
4381
+ component: "Option",
4382
+ label: "Option",
4383
+ props: [
4384
+ { type: "string", name: "label", value: "Option A" },
4385
+ { type: "string", name: "value", value: "a" }
4386
+ ],
4387
+ children: []
4388
+ },
4389
+ {
4390
+ type: "instance",
4391
+ component: "Option",
4392
+ label: "Option",
4393
+ props: [
4394
+ { type: "string", name: "label", value: "Option B" },
4395
+ { type: "string", name: "value", value: "b" }
4396
+ ],
4397
+ children: []
4398
+ },
4399
+ {
4400
+ type: "instance",
4401
+ component: "Option",
4402
+ label: "Option",
4403
+ props: [
4404
+ { type: "string", name: "label", value: "Option C" },
4405
+ { type: "string", name: "value", value: "c" }
4406
+ ],
4407
+ children: []
4408
+ }
4409
+ ]
4410
+ }
4411
+ ]
4412
+ };
4413
+
4414
+ // src/option.ws.ts
4415
+ import { ItemIcon } from "@webstudio-is/icons/svg";
4416
+ import "@webstudio-is/react-sdk";
4417
+ var presetStyle31 = {
4418
+ option: [
4419
+ {
4420
+ property: "backgroundColor",
4421
+ state: ":checked",
4422
+ value: {
4423
+ type: "rgb",
4424
+ alpha: 1,
4425
+ r: 209,
4426
+ g: 209,
4427
+ b: 209
4428
+ }
4429
+ }
4430
+ ]
4431
+ };
4432
+ var meta37 = {
4433
+ category: "hidden",
4434
+ // @todo: requiredAncestors should be ["Select", "Optgroup", "Datalist"] but that gives unreadable error when adding Select onto Canvas
4435
+ requiredAncestors: ["Select"],
4436
+ type: "control",
4437
+ label: "Option",
4438
+ description: "An item within a drop-down menu that users can select as their chosen value.",
4439
+ icon: ItemIcon,
4440
+ presetStyle: presetStyle31,
4441
+ states: [
4442
+ // Applies when option is being activated (clicked)
4443
+ { selector: ":active", label: "Active" },
4444
+ // Applies to the currently selected option
4445
+ { selector: ":checked", label: "Checked" },
4446
+ // For <option> elements: The :default pseudo-class selects the <option> that has the selected attribute when the page loads. This is true even if the user later selects a different option.
4447
+ { selector: ":default", label: "Default" },
4448
+ { selector: ":hover", label: "Hover" },
4449
+ { selector: ":disabled", label: "Disabled" }
4450
+ ]
4451
+ };
4295
4452
  export {
4296
4453
  meta21 as Blockquote,
4297
4454
  meta5 as Body,
@@ -4312,9 +4469,11 @@ export {
4312
4469
  meta10 as Link,
4313
4470
  meta22 as List,
4314
4471
  meta23 as ListItem,
4472
+ meta37 as Option,
4315
4473
  meta9 as Paragraph,
4316
4474
  meta28 as RadioButton,
4317
4475
  meta11 as RichTextLink,
4476
+ meta36 as Select,
4318
4477
  meta24 as Separator,
4319
4478
  meta as Slot,
4320
4479
  meta12 as Span,