@warp-ds/elements 2.5.1-next.5 → 2.5.2

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 (62) hide show
  1. package/dist/.storybook/utilities.d.ts +0 -1
  2. package/dist/.storybook/utilities.js +14 -22
  3. package/dist/custom-elements.json +31 -572
  4. package/dist/index.d.ts +0 -269
  5. package/dist/packages/combobox/combobox.d.ts +0 -5
  6. package/dist/packages/combobox/combobox.js +12 -12
  7. package/dist/packages/combobox/combobox.js.map +3 -3
  8. package/dist/packages/combobox/combobox.stories.js +7 -7
  9. package/dist/packages/combobox/combobox.test.js +0 -90
  10. package/dist/packages/toast/toast.d.ts +1 -0
  11. package/dist/packages/toast/toast.js +11 -11
  12. package/dist/packages/toast/toast.js.map +4 -4
  13. package/dist/web-types.json +1 -91
  14. package/package.json +1 -9
  15. package/dist/packages/pagination/locales/da/messages.d.mts +0 -1
  16. package/dist/packages/pagination/locales/da/messages.mjs +0 -1
  17. package/dist/packages/pagination/locales/en/messages.d.mts +0 -1
  18. package/dist/packages/pagination/locales/en/messages.mjs +0 -1
  19. package/dist/packages/pagination/locales/fi/messages.d.mts +0 -1
  20. package/dist/packages/pagination/locales/fi/messages.mjs +0 -1
  21. package/dist/packages/pagination/locales/nb/messages.d.mts +0 -1
  22. package/dist/packages/pagination/locales/nb/messages.mjs +0 -1
  23. package/dist/packages/pagination/locales/sv/messages.d.mts +0 -1
  24. package/dist/packages/pagination/locales/sv/messages.mjs +0 -1
  25. package/dist/packages/pagination/pagination.d.ts +0 -32
  26. package/dist/packages/pagination/pagination.js +0 -2503
  27. package/dist/packages/pagination/pagination.js.map +0 -7
  28. package/dist/packages/pagination/pagination.react.stories.d.ts +0 -21
  29. package/dist/packages/pagination/pagination.react.stories.js +0 -45
  30. package/dist/packages/pagination/pagination.stories.d.ts +0 -14
  31. package/dist/packages/pagination/pagination.stories.js +0 -56
  32. package/dist/packages/pagination/pagination.test.d.ts +0 -1
  33. package/dist/packages/pagination/pagination.test.js +0 -76
  34. package/dist/packages/pagination/react.d.ts +0 -5
  35. package/dist/packages/pagination/react.js +0 -15
  36. package/dist/packages/pagination/styles.d.ts +0 -1
  37. package/dist/packages/pagination/styles.js +0 -2
  38. package/dist/packages/textarea/locales/da/messages.d.mts +0 -1
  39. package/dist/packages/textarea/locales/da/messages.mjs +0 -1
  40. package/dist/packages/textarea/locales/en/messages.d.mts +0 -1
  41. package/dist/packages/textarea/locales/en/messages.mjs +0 -1
  42. package/dist/packages/textarea/locales/fi/messages.d.mts +0 -1
  43. package/dist/packages/textarea/locales/fi/messages.mjs +0 -1
  44. package/dist/packages/textarea/locales/nb/messages.d.mts +0 -1
  45. package/dist/packages/textarea/locales/nb/messages.mjs +0 -1
  46. package/dist/packages/textarea/locales/sv/messages.d.mts +0 -1
  47. package/dist/packages/textarea/locales/sv/messages.mjs +0 -1
  48. package/dist/packages/textarea/react.d.ts +0 -11
  49. package/dist/packages/textarea/react.js +0 -21
  50. package/dist/packages/textarea/styles.d.ts +0 -1
  51. package/dist/packages/textarea/styles.js +0 -2
  52. package/dist/packages/textarea/textarea.d.ts +0 -62
  53. package/dist/packages/textarea/textarea.js +0 -2476
  54. package/dist/packages/textarea/textarea.js.map +0 -7
  55. package/dist/packages/textarea/textarea.react.stories.d.ts +0 -33
  56. package/dist/packages/textarea/textarea.react.stories.js +0 -41
  57. package/dist/packages/textarea/textarea.stories.d.ts +0 -20
  58. package/dist/packages/textarea/textarea.stories.js +0 -113
  59. package/dist/packages/textarea/textarea.test.d.ts +0 -1
  60. package/dist/packages/textarea/textarea.test.js +0 -172
  61. package/dist/packages/utils.d.ts +0 -1
  62. package/dist/packages/utils.js +0 -4
@@ -3,7 +3,6 @@
3
3
  *
4
4
  * - Empty strings are treated as not set.
5
5
  * - Boolean false don't get set.
6
- * - camelCase property names are converted to kebab-case attribute names.
7
6
  *
8
7
  * @example
9
8
  * ```ts
@@ -1,16 +1,8 @@
1
- /**
2
- * Converts camelCase to kebab-case.
3
- * @example camelToKebab('openOnFocus') // 'open-on-focus'
4
- */
5
- function camelToKebab(str) {
6
- return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
7
- }
8
1
  /**
9
2
  * Massages storybook args before being spread to HTML attributes.
10
3
  *
11
4
  * - Empty strings are treated as not set.
12
5
  * - Boolean false don't get set.
13
- * - camelCase property names are converted to kebab-case attribute names.
14
6
  *
15
7
  * @example
16
8
  * ```ts
@@ -34,27 +26,27 @@ function camelToKebab(str) {
34
26
  * ```
35
27
  */
36
28
  export function prespread(args) {
37
- const newArgs = {};
38
- for (const field of Object.keys(args)) {
29
+ const newArgs = {
30
+ ...args,
31
+ };
32
+ for (const field of Object.keys(newArgs)) {
39
33
  const value = args[field];
40
- // Skip empty strings
41
- if (value === '') {
42
- continue;
43
- }
44
- // Convert camelCase to kebab-case for attribute names
45
- const attrName = camelToKebab(field);
46
34
  // Add Lit syntax for boolean attributes
47
35
  if (typeof value === 'boolean') {
48
- newArgs[`?${attrName}`] = value;
49
- continue;
36
+ newArgs[`?${field}`] = value;
37
+ delete newArgs[field];
50
38
  }
51
- // Add Lit syntax for complex properties (keep camelCase for properties)
39
+ // Add Lit syntax for complex properties
52
40
  if (typeof value === 'object') {
53
41
  newArgs[`.${field}`] = value;
54
- continue;
42
+ delete newArgs[field];
43
+ }
44
+ // The manifest has a bunch of default empty strings (which we should probably investigate)
45
+ // that turn on features that should be off in Storybook canvases.
46
+ // Remove the empty strings.
47
+ if (newArgs[field] === '') {
48
+ delete newArgs[field];
55
49
  }
56
- // String and number values use kebab-case attribute names
57
- newArgs[attrName] = value;
58
50
  }
59
51
  return newArgs;
60
52
  }
@@ -3045,12 +3045,6 @@
3045
3045
  }
3046
3046
  ]
3047
3047
  },
3048
- {
3049
- "kind": "javascript-module",
3050
- "path": "packages/toast/toast.ts",
3051
- "declarations": [],
3052
- "exports": []
3053
- },
3054
3048
  {
3055
3049
  "kind": "javascript-module",
3056
3050
  "path": "packages/toast-container/toast-container.ts",
@@ -3176,6 +3170,37 @@
3176
3170
  }
3177
3171
  ]
3178
3172
  },
3173
+ {
3174
+ "kind": "javascript-module",
3175
+ "path": "packages/toast/toast.ts",
3176
+ "declarations": [],
3177
+ "exports": [
3178
+ {
3179
+ "kind": "js",
3180
+ "name": "removeToast",
3181
+ "declaration": {
3182
+ "name": "removeToast",
3183
+ "module": "./api.js"
3184
+ }
3185
+ },
3186
+ {
3187
+ "kind": "js",
3188
+ "name": "toast",
3189
+ "declaration": {
3190
+ "name": "toast",
3191
+ "module": "./api.js"
3192
+ }
3193
+ },
3194
+ {
3195
+ "kind": "js",
3196
+ "name": "updateToast",
3197
+ "declaration": {
3198
+ "name": "updateToast",
3199
+ "module": "./api.js"
3200
+ }
3201
+ }
3202
+ ]
3203
+ },
3179
3204
  {
3180
3205
  "kind": "javascript-module",
3181
3206
  "path": "packages/datepicker/datepicker.ts",
@@ -3912,18 +3937,10 @@
3912
3937
  "privacy": "private",
3913
3938
  "readonly": true
3914
3939
  },
3915
- {
3916
- "kind": "field",
3917
- "name": "_navigationLabelOrDisplayValue",
3918
- "privacy": "private",
3919
- "description": "Get the display text for the navigation option or current display value",
3920
- "readonly": true
3921
- },
3922
3940
  {
3923
3941
  "kind": "field",
3924
3942
  "name": "_navigationValueOrInputValue",
3925
3943
  "privacy": "private",
3926
- "description": "Get the actual value for the navigation option or current value",
3927
3944
  "readonly": true
3928
3945
  },
3929
3946
  {
@@ -4858,564 +4875,6 @@
4858
4875
  }
4859
4876
  }
4860
4877
  ]
4861
- },
4862
- {
4863
- "kind": "javascript-module",
4864
- "path": "packages/pagination/pagination.ts",
4865
- "declarations": [
4866
- {
4867
- "kind": "class",
4868
- "description": "Pagination allows users to navigate through multiple pages of content by providing navigation controls with page numbers and directional arrows.\n\n[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/navigation-pagination--docs)",
4869
- "name": "WarpPagination",
4870
- "members": [
4871
- {
4872
- "kind": "field",
4873
- "name": "baseUrl",
4874
- "type": {
4875
- "text": "string"
4876
- },
4877
- "attribute": "base-url",
4878
- "reflects": true
4879
- },
4880
- {
4881
- "kind": "field",
4882
- "name": "pages",
4883
- "type": {
4884
- "text": "number"
4885
- },
4886
- "attribute": "pages",
4887
- "reflects": true
4888
- },
4889
- {
4890
- "kind": "field",
4891
- "name": "currentPageNumber",
4892
- "type": {
4893
- "text": "number"
4894
- },
4895
- "default": "1",
4896
- "attribute": "current-page",
4897
- "reflects": true
4898
- },
4899
- {
4900
- "kind": "field",
4901
- "name": "visiblePages",
4902
- "type": {
4903
- "text": "number"
4904
- },
4905
- "default": "7",
4906
- "attribute": "visible-pages",
4907
- "reflects": true
4908
- },
4909
- {
4910
- "kind": "method",
4911
- "name": "#dispatchClickPage",
4912
- "privacy": "private",
4913
- "parameters": [
4914
- {
4915
- "name": "e",
4916
- "type": {
4917
- "text": "PointerEvent"
4918
- }
4919
- }
4920
- ]
4921
- }
4922
- ],
4923
- "events": [
4924
- {
4925
- "name": "page-click",
4926
- "type": {
4927
- "text": "CustomEvent"
4928
- },
4929
- "description": "Triggered when a link button in the pagination is clicked. Contains the page number in `string` form."
4930
- }
4931
- ],
4932
- "attributes": [
4933
- {
4934
- "name": "base-url",
4935
- "type": {
4936
- "text": "string"
4937
- },
4938
- "fieldName": "baseUrl"
4939
- },
4940
- {
4941
- "name": "pages",
4942
- "type": {
4943
- "text": "number"
4944
- },
4945
- "fieldName": "pages"
4946
- },
4947
- {
4948
- "name": "current-page",
4949
- "type": {
4950
- "text": "number"
4951
- },
4952
- "default": "1",
4953
- "fieldName": "currentPageNumber"
4954
- },
4955
- {
4956
- "name": "visible-pages",
4957
- "type": {
4958
- "text": "number"
4959
- },
4960
- "default": "7",
4961
- "fieldName": "visiblePages"
4962
- }
4963
- ],
4964
- "superclass": {
4965
- "name": "LitElement",
4966
- "package": "lit"
4967
- },
4968
- "tagName": "w-pagination",
4969
- "customElement": true,
4970
- "modulePath": "packages/pagination/pagination.ts",
4971
- "definitionPath": "packages/pagination/pagination.ts"
4972
- }
4973
- ],
4974
- "exports": [
4975
- {
4976
- "kind": "custom-element-definition",
4977
- "name": "w-pagination",
4978
- "declaration": {
4979
- "name": "WarpPagination",
4980
- "module": "packages/pagination/pagination.ts"
4981
- }
4982
- },
4983
- {
4984
- "kind": "js",
4985
- "name": "WarpPagination",
4986
- "declaration": {
4987
- "name": "WarpPagination",
4988
- "module": "packages/pagination/pagination.ts"
4989
- }
4990
- }
4991
- ]
4992
- },
4993
- {
4994
- "kind": "javascript-module",
4995
- "path": "packages/textarea/textarea.ts",
4996
- "declarations": [
4997
- {
4998
- "kind": "class",
4999
- "description": "A single line text input element.\n\n[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-textfield--docs)",
5000
- "name": "WarpTextarea",
5001
- "members": [
5002
- {
5003
- "kind": "field",
5004
- "name": "shadowRootOptions",
5005
- "type": {
5006
- "text": "object"
5007
- },
5008
- "static": true,
5009
- "default": "{ ...LitElement.shadowRootOptions, delegatesFocus: true, }"
5010
- },
5011
- {
5012
- "kind": "field",
5013
- "name": "disabled",
5014
- "type": {
5015
- "text": "boolean"
5016
- },
5017
- "attribute": "disabled",
5018
- "reflects": true
5019
- },
5020
- {
5021
- "kind": "field",
5022
- "name": "invalid",
5023
- "type": {
5024
- "text": "boolean"
5025
- },
5026
- "attribute": "invalid",
5027
- "reflects": true
5028
- },
5029
- {
5030
- "kind": "field",
5031
- "name": "label",
5032
- "type": {
5033
- "text": "string"
5034
- },
5035
- "attribute": "label",
5036
- "reflects": true
5037
- },
5038
- {
5039
- "kind": "field",
5040
- "name": "helpText",
5041
- "type": {
5042
- "text": "string"
5043
- },
5044
- "attribute": "help-text",
5045
- "reflects": true
5046
- },
5047
- {
5048
- "kind": "field",
5049
- "name": "maxRows",
5050
- "type": {
5051
- "text": "number"
5052
- },
5053
- "attribute": "maximum-rows",
5054
- "reflects": true
5055
- },
5056
- {
5057
- "kind": "field",
5058
- "name": "minRows",
5059
- "type": {
5060
- "text": "number"
5061
- },
5062
- "attribute": "minimum-rows",
5063
- "reflects": true
5064
- },
5065
- {
5066
- "kind": "field",
5067
- "name": "name",
5068
- "type": {
5069
- "text": "string"
5070
- },
5071
- "attribute": "name"
5072
- },
5073
- {
5074
- "kind": "field",
5075
- "name": "placeholder",
5076
- "type": {
5077
- "text": "string"
5078
- },
5079
- "attribute": "placeholder"
5080
- },
5081
- {
5082
- "kind": "field",
5083
- "name": "readOnly",
5084
- "type": {
5085
- "text": "boolean"
5086
- },
5087
- "deprecated": "Use the native readonly attribute instead. Here for API consistency with `w-textfield`.",
5088
- "attribute": "read-only",
5089
- "reflects": true
5090
- },
5091
- {
5092
- "kind": "field",
5093
- "name": "readonly",
5094
- "type": {
5095
- "text": "boolean"
5096
- },
5097
- "attribute": "readonly",
5098
- "reflects": true
5099
- },
5100
- {
5101
- "kind": "field",
5102
- "name": "required",
5103
- "type": {
5104
- "text": "boolean"
5105
- },
5106
- "attribute": "required",
5107
- "reflects": true
5108
- },
5109
- {
5110
- "kind": "field",
5111
- "name": "value",
5112
- "type": {
5113
- "text": "string"
5114
- },
5115
- "attribute": "value",
5116
- "reflects": true
5117
- },
5118
- {
5119
- "kind": "field",
5120
- "name": "optional",
5121
- "type": {
5122
- "text": "boolean"
5123
- },
5124
- "attribute": "optional",
5125
- "reflects": true
5126
- },
5127
- {
5128
- "kind": "field",
5129
- "name": "minHeight"
5130
- },
5131
- {
5132
- "kind": "field",
5133
- "name": "maxHeight"
5134
- },
5135
- {
5136
- "kind": "field",
5137
- "name": "_textarea",
5138
- "type": {
5139
- "text": "HTMLTextAreaElement"
5140
- },
5141
- "privacy": "private"
5142
- },
5143
- {
5144
- "kind": "field",
5145
- "name": "#initialValue",
5146
- "privacy": "private",
5147
- "type": {
5148
- "text": "string | null"
5149
- },
5150
- "default": "null"
5151
- },
5152
- {
5153
- "kind": "field",
5154
- "name": "#uniqueId",
5155
- "privacy": "private"
5156
- },
5157
- {
5158
- "kind": "field",
5159
- "name": "#validationActive",
5160
- "privacy": "private",
5161
- "type": {
5162
- "text": "boolean"
5163
- },
5164
- "default": "false"
5165
- },
5166
- {
5167
- "kind": "field",
5168
- "name": "#originalHelpText",
5169
- "privacy": "private",
5170
- "type": {
5171
- "text": "string | undefined"
5172
- },
5173
- "default": "undefined"
5174
- },
5175
- {
5176
- "kind": "field",
5177
- "name": "#hasInteracted",
5178
- "privacy": "private",
5179
- "type": {
5180
- "text": "boolean"
5181
- },
5182
- "default": "false"
5183
- },
5184
- {
5185
- "kind": "method",
5186
- "name": "resetFormControl",
5187
- "return": {
5188
- "type": {
5189
- "text": "void"
5190
- }
5191
- },
5192
- "type": {
5193
- "text": "resetFormControl() => void"
5194
- }
5195
- },
5196
- {
5197
- "kind": "field",
5198
- "name": "validationMessage",
5199
- "type": {
5200
- "text": "string"
5201
- },
5202
- "description": "Returns the validation message if the textarea is invalid, otherwise an empty string",
5203
- "readonly": true
5204
- },
5205
- {
5206
- "kind": "field",
5207
- "name": "validity",
5208
- "type": {
5209
- "text": "ValidityState"
5210
- },
5211
- "description": "Returns the validity state of the textarea",
5212
- "readonly": true
5213
- },
5214
- {
5215
- "kind": "method",
5216
- "name": "checkValidity",
5217
- "return": {
5218
- "type": {
5219
- "text": "boolean"
5220
- }
5221
- },
5222
- "description": "Checks whether the textarea passes constraint validation",
5223
- "type": {
5224
- "text": "checkValidity() => boolean"
5225
- }
5226
- },
5227
- {
5228
- "kind": "method",
5229
- "name": "reportValidity",
5230
- "return": {
5231
- "type": {
5232
- "text": "boolean"
5233
- }
5234
- },
5235
- "description": "Checks validity and shows the browser's validation message if invalid",
5236
- "type": {
5237
- "text": "reportValidity() => boolean"
5238
- }
5239
- },
5240
- {
5241
- "kind": "method",
5242
- "name": "setCustomValidity",
5243
- "return": {
5244
- "type": {
5245
- "text": "void"
5246
- }
5247
- },
5248
- "parameters": [
5249
- {
5250
- "name": "message",
5251
- "type": {
5252
- "text": "string"
5253
- }
5254
- }
5255
- ],
5256
- "description": "Sets a custom validation message. Pass an empty string to clear.",
5257
- "type": {
5258
- "text": "setCustomValidity(message: string) => void"
5259
- }
5260
- },
5261
- {
5262
- "kind": "method",
5263
- "name": "handler",
5264
- "parameters": [
5265
- {
5266
- "name": "e",
5267
- "type": {
5268
- "text": "InputEvent"
5269
- }
5270
- }
5271
- ],
5272
- "type": {
5273
- "text": "handler(e: InputEvent) => void"
5274
- }
5275
- },
5276
- {
5277
- "kind": "method",
5278
- "name": "#resize",
5279
- "privacy": "private",
5280
- "parameters": [
5281
- {
5282
- "name": "target",
5283
- "type": {
5284
- "text": "HTMLTextAreaElement"
5285
- }
5286
- }
5287
- ],
5288
- "description": "Calculate the new height for the area on input"
5289
- }
5290
- ],
5291
- "attributes": [
5292
- {
5293
- "name": "disabled",
5294
- "type": {
5295
- "text": "boolean"
5296
- },
5297
- "fieldName": "disabled"
5298
- },
5299
- {
5300
- "name": "invalid",
5301
- "type": {
5302
- "text": "boolean"
5303
- },
5304
- "fieldName": "invalid"
5305
- },
5306
- {
5307
- "name": "label",
5308
- "type": {
5309
- "text": "string"
5310
- },
5311
- "fieldName": "label"
5312
- },
5313
- {
5314
- "name": "help-text",
5315
- "type": {
5316
- "text": "string"
5317
- },
5318
- "fieldName": "helpText"
5319
- },
5320
- {
5321
- "name": "maximum-rows",
5322
- "type": {
5323
- "text": "number"
5324
- },
5325
- "fieldName": "maxRows"
5326
- },
5327
- {
5328
- "name": "minimum-rows",
5329
- "type": {
5330
- "text": "number"
5331
- },
5332
- "fieldName": "minRows"
5333
- },
5334
- {
5335
- "name": "name",
5336
- "type": {
5337
- "text": "string"
5338
- },
5339
- "fieldName": "name"
5340
- },
5341
- {
5342
- "name": "placeholder",
5343
- "type": {
5344
- "text": "string"
5345
- },
5346
- "fieldName": "placeholder"
5347
- },
5348
- {
5349
- "name": "read-only",
5350
- "type": {
5351
- "text": "boolean"
5352
- },
5353
- "deprecated": "Use the native readonly attribute instead. Here for API consistency with `w-textfield`.",
5354
- "fieldName": "readOnly"
5355
- },
5356
- {
5357
- "name": "readonly",
5358
- "type": {
5359
- "text": "boolean"
5360
- },
5361
- "fieldName": "readonly"
5362
- },
5363
- {
5364
- "name": "required",
5365
- "type": {
5366
- "text": "boolean"
5367
- },
5368
- "fieldName": "required"
5369
- },
5370
- {
5371
- "name": "value",
5372
- "type": {
5373
- "text": "string"
5374
- },
5375
- "fieldName": "value"
5376
- },
5377
- {
5378
- "name": "optional",
5379
- "type": {
5380
- "text": "boolean"
5381
- },
5382
- "fieldName": "optional"
5383
- }
5384
- ],
5385
- "mixins": [
5386
- {
5387
- "name": "FormControlMixin",
5388
- "package": "@open-wc/form-control"
5389
- }
5390
- ],
5391
- "superclass": {
5392
- "name": "LitElement",
5393
- "package": "lit"
5394
- },
5395
- "tagName": "w-textarea",
5396
- "customElement": true,
5397
- "modulePath": "packages/textarea/textarea.ts",
5398
- "definitionPath": "packages/textarea/textarea.ts"
5399
- }
5400
- ],
5401
- "exports": [
5402
- {
5403
- "kind": "custom-element-definition",
5404
- "name": "w-textarea",
5405
- "declaration": {
5406
- "name": "WarpTextarea",
5407
- "module": "packages/textarea/textarea.ts"
5408
- }
5409
- },
5410
- {
5411
- "kind": "js",
5412
- "name": "WarpTextarea",
5413
- "declaration": {
5414
- "name": "WarpTextarea",
5415
- "module": "packages/textarea/textarea.ts"
5416
- }
5417
- }
5418
- ]
5419
4878
  }
5420
4879
  ]
5421
4880
  }