@warp-ds/elements 2.3.0-next.24 → 2.3.0-next.26

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 (68) hide show
  1. package/dist/custom-elements.json +311 -22
  2. package/dist/index.d.ts +261 -0
  3. package/dist/packages/attention/index.js +20 -20
  4. package/dist/packages/attention/index.js.map +3 -3
  5. package/dist/packages/button/button.react.stories.d.ts +1 -1
  6. package/dist/packages/button/button.test.js +30 -1
  7. package/dist/packages/button/index.d.ts +2 -0
  8. package/dist/packages/button/index.js +12 -12
  9. package/dist/packages/button/index.js.map +3 -3
  10. package/dist/packages/checkbox/checkbox-group.js +2 -2
  11. package/dist/packages/checkbox/checkbox-group.js.map +2 -2
  12. package/dist/packages/checkbox/checkbox.js +1 -1
  13. package/dist/packages/checkbox/checkbox.js.map +2 -2
  14. package/dist/packages/checkbox/index.d.ts +2 -1
  15. package/dist/packages/checkbox/index.js +2 -6
  16. package/dist/packages/combobox/combobox.react.stories.d.ts +1 -1
  17. package/dist/packages/combobox/combobox.stories.d.ts +1 -0
  18. package/dist/packages/combobox/combobox.stories.js +29 -3
  19. package/dist/packages/combobox/index.d.ts +7 -1
  20. package/dist/packages/combobox/index.js +19 -19
  21. package/dist/packages/combobox/index.js.map +4 -4
  22. package/dist/packages/datepicker/datepicker.d.ts +1 -0
  23. package/dist/packages/datepicker/datepicker.js +35 -35
  24. package/dist/packages/datepicker/datepicker.js.map +3 -3
  25. package/dist/packages/datepicker/datepicker.react.stories.d.ts +1 -1
  26. package/dist/packages/datepicker/datepicker.test.js +27 -0
  27. package/dist/packages/link/link.react.stories.d.ts +1 -1
  28. package/dist/packages/radio/index.d.ts +2 -1
  29. package/dist/packages/radio/index.js +2 -6
  30. package/dist/packages/radio/radio-group.js +5 -5
  31. package/dist/packages/radio/radio-group.js.map +2 -2
  32. package/dist/packages/radio/radio.js +1 -1
  33. package/dist/packages/radio/radio.js.map +2 -2
  34. package/dist/packages/radio/radio.stories.js +3 -3
  35. package/dist/packages/radio/radio.stories.js.map +4 -4
  36. package/dist/packages/select/index.d.ts +1 -0
  37. package/dist/packages/select/index.js +15 -15
  38. package/dist/packages/select/index.js.map +3 -3
  39. package/dist/packages/select/select.react.stories.d.ts +1 -1
  40. package/dist/packages/select/select.test.js +30 -0
  41. package/dist/packages/slider/slider-thumb.d.ts +1 -0
  42. package/dist/packages/slider/slider-thumb.js +23 -23
  43. package/dist/packages/slider/slider-thumb.js.map +3 -3
  44. package/dist/packages/slider/slider.d.ts +1 -2
  45. package/dist/packages/slider/slider.js +20 -20
  46. package/dist/packages/slider/slider.js.map +4 -4
  47. package/dist/packages/slider/slider.stories.js +2 -2
  48. package/dist/packages/slider/slider.test.js +28 -0
  49. package/dist/packages/switch/index.d.ts +10 -2
  50. package/dist/packages/switch/index.js +5 -5
  51. package/dist/packages/switch/index.js.map +4 -4
  52. package/dist/packages/switch/switch.react.stories.js +4 -4
  53. package/dist/packages/switch/switch.stories.js +6 -5
  54. package/dist/packages/switch/switch.test.d.ts +1 -0
  55. package/dist/packages/switch/switch.test.js +40 -0
  56. package/dist/packages/textarea/textarea.d.ts +1 -0
  57. package/dist/packages/textarea/textarea.js +14 -14
  58. package/dist/packages/textarea/textarea.js.map +3 -3
  59. package/dist/packages/textarea/textarea.react.stories.d.ts +1 -1
  60. package/dist/packages/textarea/textarea.test.js +19 -0
  61. package/dist/packages/textfield/index.d.ts +3 -0
  62. package/dist/packages/textfield/index.js +8 -8
  63. package/dist/packages/textfield/index.js.map +3 -3
  64. package/dist/packages/textfield/textfield.react.stories.d.ts +1 -1
  65. package/dist/packages/textfield/textfield.stories.d.ts +1 -0
  66. package/dist/packages/textfield/textfield.stories.js +17 -0
  67. package/dist/web-types.json +340 -3
  68. package/package.json +1 -1
@@ -3,7 +3,7 @@ import { StoryObj } from '@storybook/react';
3
3
  import { TextField } from './react';
4
4
  declare const _default: {
5
5
  title: string;
6
- render(args: Omit<React.HTMLAttributes<import(".").WarpTextField>, "label" | "onblur" | "onchange" | "onfocus" | "oninput" | "onFocus" | "onBlur" | "onChange" | "onInput" | "render" | "renderOptions" | "connectedCallback" | "disconnectedCallback" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "form" | "mask" | "pattern" | "disabled" | "name" | "type" | "value" | "updated" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "resetFormControl" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "invalid" | "step" | "helpText" | "readOnly" | "readonly" | "size" | "max" | "min" | "minLength" | "maxLength" | "placeholder" | "required" | "formatter" | "_hasPrefix" | "_hasSuffix" | "_inputstyles" | "_helptextstyles" | "_label" | "_helpId" | "_id" | "_error" | "handler" | "prefixSlotChange" | "suffixSlotChange"> & {
6
+ render(args: Omit<React.HTMLAttributes<import(".").WarpTextField>, "label" | "onblur" | "onchange" | "onfocus" | "oninput" | "onFocus" | "onBlur" | "onChange" | "onInput" | "render" | "renderOptions" | "connectedCallback" | "disconnectedCallback" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "form" | "mask" | "pattern" | "disabled" | "name" | "type" | "value" | "updated" | "firstUpdated" | "resetFormControl" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "invalid" | "step" | "helpText" | "readOnly" | "readonly" | "size" | "max" | "min" | "minLength" | "maxLength" | "placeholder" | "required" | "formatter" | "_hasPrefix" | "_hasSuffix" | "_inputstyles" | "_helptextstyles" | "_label" | "_helpId" | "_id" | "_error" | "handler" | "prefixSlotChange" | "suffixSlotChange"> & {
7
7
  onBlur?: (e: Event) => void;
8
8
  onblur?: (e: Event) => void;
9
9
  onChange?: (e: Event) => void;
@@ -16,3 +16,4 @@ export declare const ReadOnly: Story;
16
16
  export declare const Required: Story;
17
17
  export declare const WithAffix: Story;
18
18
  export declare const Masking: Story;
19
+ export declare const FormParticipation: Story;
@@ -103,3 +103,20 @@ export const Masking = {
103
103
  `;
104
104
  },
105
105
  };
106
+ export const FormParticipation = {
107
+ args: {
108
+ type: 'text',
109
+ },
110
+ render({ locale, ...args }) {
111
+ return html `
112
+ <p>Resetting the form should return values to the initial values</p>
113
+ <p>Submitting the form should result in the values being in the resulting pages query parameters</p>
114
+ <form>
115
+ <w-textfield ${spread(prespread(args))} name="warp-textfield-1" placeholder="type here" label="field 1"></w-textfield>
116
+ <w-textfield ${spread(prespread(args))} name="warp-textfield-2" value="prefilled" label="field 2"></w-textfield>
117
+ <button type="reset">Reset</button>
118
+ <button type="submit">Submit</button>
119
+ </form>
120
+ `;
121
+ },
122
+ };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@warp-ds/elements",
4
- "version": "2.3.0-next.23",
4
+ "version": "2.3.0-next.25",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1093,6 +1093,339 @@
1093
1093
  ]
1094
1094
  }
1095
1095
  },
1096
+ {
1097
+ "name": "w-radio",
1098
+ "description": "\n---\n",
1099
+ "doc-url": "",
1100
+ "attributes": [
1101
+ {
1102
+ "name": "form",
1103
+ "description": "The string pointing to a form's id.",
1104
+ "value": { "type": "string | null", "default": "null" }
1105
+ },
1106
+ {
1107
+ "name": "value",
1108
+ "description": "The radio's value. When selected, the radio group will receive this value.",
1109
+ "value": { "type": "string" }
1110
+ },
1111
+ {
1112
+ "name": "appearance",
1113
+ "description": "The radio's value. When selected, the radio group will receive this value.",
1114
+ "value": {
1115
+ "type": "'default' | 'button' | 'clickable'",
1116
+ "default": "'default'"
1117
+ }
1118
+ },
1119
+ {
1120
+ "name": "size",
1121
+ "description": "The radio's size. When used inside a radio group, the size will be determined by the radio group's size so this\nattribute can typically be omitted.",
1122
+ "value": {
1123
+ "type": "'small' | 'medium' | 'large'",
1124
+ "default": "'medium'"
1125
+ }
1126
+ },
1127
+ {
1128
+ "name": "disabled",
1129
+ "description": "Disables the radio.",
1130
+ "value": { "type": "boolean", "default": "false" }
1131
+ }
1132
+ ],
1133
+ "events": [],
1134
+ "js": {
1135
+ "properties": [
1136
+ { "name": "checked", "type": "boolean" },
1137
+ {
1138
+ "name": "form",
1139
+ "description": "The string pointing to a form's id.",
1140
+ "type": "string | null"
1141
+ },
1142
+ {
1143
+ "name": "value",
1144
+ "description": "The radio's value. When selected, the radio group will receive this value.",
1145
+ "type": "string"
1146
+ },
1147
+ {
1148
+ "name": "appearance",
1149
+ "description": "The radio's value. When selected, the radio group will receive this value.",
1150
+ "type": "'default' | 'button' | 'clickable'"
1151
+ },
1152
+ {
1153
+ "name": "size",
1154
+ "description": "The radio's size. When used inside a radio group, the size will be determined by the radio group's size so this\nattribute can typically be omitted.",
1155
+ "type": "'small' | 'medium' | 'large'"
1156
+ },
1157
+ {
1158
+ "name": "disabled",
1159
+ "description": "Disables the radio.",
1160
+ "type": "boolean"
1161
+ }
1162
+ ],
1163
+ "events": []
1164
+ }
1165
+ },
1166
+ {
1167
+ "name": "w-radio-group",
1168
+ "description": "\n---\n\n\n### **Events:**\n - **input**\n- **change**\n\n### **Methods:**\n - **focus(options: _FocusOptions_)** - Sets focus on the radio group.\n\n### **Slots:**\n - **label** - Alternative to the `label` attribute should you need custom HTML.",
1169
+ "doc-url": "",
1170
+ "attributes": [
1171
+ {
1172
+ "name": "label",
1173
+ "description": "The radio group's label. Required for proper accessibility. If you need to display HTML, use the `label` slot\ninstead.",
1174
+ "value": { "type": "string", "default": "''" }
1175
+ },
1176
+ {
1177
+ "name": "hint",
1178
+ "description": "The radio groups's hint. If you need to display HTML, use the `hint` slot instead.",
1179
+ "value": { "type": "string", "default": "''" }
1180
+ },
1181
+ {
1182
+ "name": "name",
1183
+ "description": "The name of the radio group, submitted as a name/value pair with form data.",
1184
+ "value": { "type": "string | null", "default": "null" }
1185
+ },
1186
+ {
1187
+ "name": "disabled",
1188
+ "description": "Disables the radio group and all child radios.",
1189
+ "value": { "type": "boolean", "default": "false" }
1190
+ },
1191
+ {
1192
+ "name": "orientation",
1193
+ "description": "The orientation in which to show radio items.",
1194
+ "value": {
1195
+ "type": "'horizontal' | 'vertical'",
1196
+ "default": "'vertical'"
1197
+ }
1198
+ },
1199
+ {
1200
+ "name": "value",
1201
+ "description": "The default value of the form control. Primarily used for resetting the form control.",
1202
+ "value": { "type": "string | null" }
1203
+ },
1204
+ {
1205
+ "name": "size",
1206
+ "description": "The radio group's size. This size will be applied to all child radios and radio buttons, except when explicitly overridden.",
1207
+ "value": {
1208
+ "type": "'small' | 'medium' | 'large'",
1209
+ "default": "'medium'"
1210
+ }
1211
+ },
1212
+ {
1213
+ "name": "required",
1214
+ "description": "Ensures a child radio is checked before allowing the containing form to submit.",
1215
+ "value": { "type": "boolean", "default": "false" }
1216
+ },
1217
+ {
1218
+ "name": "with-label",
1219
+ "description": "Used for SSR. if true, will show slotted label on initial render.",
1220
+ "value": { "type": "boolean", "default": "false" }
1221
+ },
1222
+ {
1223
+ "name": "with-hint",
1224
+ "description": "Used for SSR. if true, will show slotted hint on initial render.",
1225
+ "value": { "type": "boolean", "default": "false" }
1226
+ }
1227
+ ],
1228
+ "slots": [
1229
+ {
1230
+ "name": "label",
1231
+ "description": "Alternative to the `label` attribute should you need custom HTML."
1232
+ }
1233
+ ],
1234
+ "events": [
1235
+ { "name": "input", "type": "InputEvent" },
1236
+ { "name": "change", "type": "Event" }
1237
+ ],
1238
+ "js": {
1239
+ "properties": [
1240
+ { "name": "hasRadioButtons", "type": "boolean" },
1241
+ { "name": "defaultSlot", "type": "HTMLSlotElement" },
1242
+ {
1243
+ "name": "label",
1244
+ "description": "The radio group's label. Required for proper accessibility. If you need to display HTML, use the `label` slot\ninstead.",
1245
+ "type": "string"
1246
+ },
1247
+ {
1248
+ "name": "hint",
1249
+ "description": "The radio groups's hint. If you need to display HTML, use the `hint` slot instead.",
1250
+ "type": "string"
1251
+ },
1252
+ {
1253
+ "name": "name",
1254
+ "description": "The name of the radio group, submitted as a name/value pair with form data.",
1255
+ "type": "string | null"
1256
+ },
1257
+ {
1258
+ "name": "disabled",
1259
+ "description": "Disables the radio group and all child radios.",
1260
+ "type": "boolean"
1261
+ },
1262
+ {
1263
+ "name": "orientation",
1264
+ "description": "The orientation in which to show radio items.",
1265
+ "type": "'horizontal' | 'vertical'"
1266
+ },
1267
+ {
1268
+ "name": "value",
1269
+ "description": "The current value of the radio group, submitted as a name/value pair with form data."
1270
+ },
1271
+ {
1272
+ "name": "defaultValue",
1273
+ "description": "The default value of the form control. Primarily used for resetting the form control.",
1274
+ "type": "string | null"
1275
+ },
1276
+ {
1277
+ "name": "size",
1278
+ "description": "The radio group's size. This size will be applied to all child radios and radio buttons, except when explicitly overridden.",
1279
+ "type": "'small' | 'medium' | 'large'"
1280
+ },
1281
+ {
1282
+ "name": "required",
1283
+ "description": "Ensures a child radio is checked before allowing the containing form to submit.",
1284
+ "type": "boolean"
1285
+ },
1286
+ {
1287
+ "name": "withLabel",
1288
+ "description": "Used for SSR. if true, will show slotted label on initial render.",
1289
+ "type": "boolean"
1290
+ },
1291
+ {
1292
+ "name": "withHint",
1293
+ "description": "Used for SSR. if true, will show slotted hint on initial render.",
1294
+ "type": "boolean"
1295
+ },
1296
+ {
1297
+ "name": "validationTarget",
1298
+ "description": "We use the first available radio as the validationTarget similar to native HTML that shows the validation popup on\nthe first radio element."
1299
+ }
1300
+ ],
1301
+ "events": [
1302
+ { "name": "input", "type": "InputEvent" },
1303
+ { "name": "change", "type": "Event" }
1304
+ ]
1305
+ }
1306
+ },
1307
+ {
1308
+ "name": "w-checkbox",
1309
+ "description": "\n---\n\n\n### **Events:**\n - **change**\n\n### **Methods:**\n - **click()** - Simulates a click on the checkbox.\n- **focus(options: _FocusOptions_)** - Sets focus on the checkbox.\n- **blur()** - Removes focus from the checkbox.",
1310
+ "doc-url": "",
1311
+ "attributes": [
1312
+ { "name": "title", "value": { "type": "string", "default": "''" } },
1313
+ {
1314
+ "name": "name",
1315
+ "description": "The name of the checkbox, submitted as a name/value pair with form data.",
1316
+ "value": { "type": "string", "default": "''" }
1317
+ },
1318
+ {
1319
+ "name": "value",
1320
+ "description": "The value of the checkbox, submitted as a name/value pair with form data.",
1321
+ "value": { "type": "string | null" }
1322
+ },
1323
+ {
1324
+ "name": "size",
1325
+ "description": "The checkbox's size.",
1326
+ "value": {
1327
+ "type": "'small' | 'medium' | 'large'",
1328
+ "default": "'medium'"
1329
+ }
1330
+ },
1331
+ {
1332
+ "name": "disabled",
1333
+ "description": "Disables the checkbox.",
1334
+ "value": { "type": "boolean", "default": "false" }
1335
+ },
1336
+ {
1337
+ "name": "indeterminate",
1338
+ "description": "Draws the checkbox in an indeterminate state. This is usually applied to checkboxes that represents a \"select\nall/none\" behavior when associated checkboxes have a mix of checked and unchecked states.",
1339
+ "value": { "type": "boolean", "default": "false" }
1340
+ },
1341
+ {
1342
+ "name": "checked",
1343
+ "description": "The default value of the form control. Primarily used for resetting the form control.",
1344
+ "value": { "type": "boolean" }
1345
+ },
1346
+ {
1347
+ "name": "form",
1348
+ "description": "By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\nto place the form control outside of a form and associate it with the form that has this `id`. The form must be in\nthe same document or shadow root for this to work.",
1349
+ "value": { "type": "null", "default": "null" }
1350
+ },
1351
+ {
1352
+ "name": "required",
1353
+ "description": "Makes the checkbox a required field.",
1354
+ "value": { "type": "boolean", "default": "false" }
1355
+ },
1356
+ {
1357
+ "name": "hint",
1358
+ "description": "The checkbox's hint. If you need to display HTML, use the `hint` slot instead.",
1359
+ "value": { "type": "string", "default": "''" }
1360
+ }
1361
+ ],
1362
+ "events": [{ "name": "change", "type": "Event" }],
1363
+ "js": {
1364
+ "properties": [
1365
+ { "name": "input", "type": "HTMLInputElement" },
1366
+ { "name": "title", "type": "string" },
1367
+ {
1368
+ "name": "name",
1369
+ "description": "The name of the checkbox, submitted as a name/value pair with form data.",
1370
+ "type": "string"
1371
+ },
1372
+ {
1373
+ "name": "value",
1374
+ "description": "The value of the checkbox, submitted as a name/value pair with form data.",
1375
+ "type": "string | null"
1376
+ },
1377
+ {
1378
+ "name": "size",
1379
+ "description": "The checkbox's size.",
1380
+ "type": "'small' | 'medium' | 'large'"
1381
+ },
1382
+ {
1383
+ "name": "disabled",
1384
+ "description": "Disables the checkbox.",
1385
+ "type": "boolean"
1386
+ },
1387
+ {
1388
+ "name": "indeterminate",
1389
+ "description": "Draws the checkbox in an indeterminate state. This is usually applied to checkboxes that represents a \"select\nall/none\" behavior when associated checkboxes have a mix of checked and unchecked states.",
1390
+ "type": "boolean"
1391
+ },
1392
+ {
1393
+ "name": "checked",
1394
+ "description": "Draws the checkbox in a checked state.",
1395
+ "type": "boolean"
1396
+ },
1397
+ {
1398
+ "name": "defaultChecked",
1399
+ "description": "The default value of the form control. Primarily used for resetting the form control.",
1400
+ "type": "boolean"
1401
+ },
1402
+ {
1403
+ "name": "form",
1404
+ "description": "By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\nto place the form control outside of a form and associate it with the form that has this `id`. The form must be in\nthe same document or shadow root for this to work.",
1405
+ "type": "null"
1406
+ },
1407
+ {
1408
+ "name": "required",
1409
+ "description": "Makes the checkbox a required field.",
1410
+ "type": "boolean"
1411
+ },
1412
+ {
1413
+ "name": "hint",
1414
+ "description": "The checkbox's hint. If you need to display HTML, use the `hint` slot instead.",
1415
+ "type": "string"
1416
+ }
1417
+ ],
1418
+ "events": [{ "name": "change", "type": "Event" }]
1419
+ }
1420
+ },
1421
+ {
1422
+ "name": "w-checkbox-group",
1423
+ "description": "\n---\n",
1424
+ "doc-url": "",
1425
+ "attributes": [],
1426
+ "events": [],
1427
+ "js": { "properties": [], "events": [] }
1428
+ },
1096
1429
  {
1097
1430
  "name": "w-slider-thumb",
1098
1431
  "description": "Component to place inside a `<w-slider>`.\n\n[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-slider-and-range-slider--docs)\n---\n\n\n### **Events:**\n - **slidervalidity**",
@@ -1340,8 +1673,10 @@
1340
1673
  "description": "\n---\n\n\n### **Events:**\n - **change**",
1341
1674
  "doc-url": "",
1342
1675
  "attributes": [
1676
+ { "name": "name", "value": { "type": "string", "default": "''" } },
1677
+ { "name": "value", "value": { "type": "string", "default": "''" } },
1343
1678
  {
1344
- "name": "value",
1679
+ "name": "checked",
1345
1680
  "value": { "type": "boolean", "default": "false" }
1346
1681
  },
1347
1682
  {
@@ -1352,7 +1687,9 @@
1352
1687
  "events": [{ "name": "change", "type": "CustomEvent" }],
1353
1688
  "js": {
1354
1689
  "properties": [
1355
- { "name": "value", "type": "boolean" },
1690
+ { "name": "name", "type": "string" },
1691
+ { "name": "value", "type": "string" },
1692
+ { "name": "checked", "type": "boolean" },
1356
1693
  { "name": "disabled", "type": "boolean" }
1357
1694
  ],
1358
1695
  "events": [{ "name": "change", "type": "CustomEvent" }]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@warp-ds/elements",
3
3
  "type": "module",
4
- "version": "2.3.0-next.24",
4
+ "version": "2.3.0-next.26",
5
5
  "packageManager": "pnpm@10.20.0",
6
6
  "description": "Custom elements for Warp",
7
7
  "exports": {