@warp-ds/elements 2.8.1 → 2.8.2-next.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 (84) hide show
  1. package/dist/custom-elements.json +37 -60
  2. package/dist/index.d.ts +3 -25
  3. package/dist/packages/affix/affix.js +5 -5
  4. package/dist/packages/affix/affix.js.map +3 -3
  5. package/dist/packages/alert/alert.d.ts +1 -0
  6. package/dist/packages/alert/alert.js +7 -7
  7. package/dist/packages/alert/alert.js.map +3 -3
  8. package/dist/packages/alert/alert.test.js +21 -0
  9. package/dist/packages/attention/attention.js +9 -9
  10. package/dist/packages/attention/attention.js.map +3 -3
  11. package/dist/packages/badge/badge.js +2 -2
  12. package/dist/packages/badge/badge.js.map +3 -3
  13. package/dist/packages/badge/badge.test.js +14 -0
  14. package/dist/packages/breadcrumbs/breadcrumbs.d.ts +1 -1
  15. package/dist/packages/breadcrumbs/breadcrumbs.js +7 -7
  16. package/dist/packages/breadcrumbs/breadcrumbs.js.map +3 -3
  17. package/dist/packages/breadcrumbs/breadcrumbs.test.js +3 -1
  18. package/dist/packages/button/button.js +7 -7
  19. package/dist/packages/button/button.js.map +3 -3
  20. package/dist/packages/combobox/combobox.js +2 -2
  21. package/dist/packages/combobox/combobox.js.map +2 -2
  22. package/dist/packages/combobox/combobox.test.js +5 -2
  23. package/dist/packages/datepicker/datepicker.js +5 -5
  24. package/dist/packages/datepicker/datepicker.js.map +3 -3
  25. package/dist/packages/expandable/expandable.js +11 -11
  26. package/dist/packages/expandable/expandable.js.map +3 -3
  27. package/dist/packages/icon/icon.js +2 -2
  28. package/dist/packages/icon/icon.js.map +3 -3
  29. package/dist/packages/icon/icon.test.d.ts +1 -0
  30. package/dist/packages/icon/icon.test.js +51 -0
  31. package/dist/packages/link/link.js +4 -4
  32. package/dist/packages/link/link.js.map +3 -3
  33. package/dist/packages/link/link.test.js +14 -0
  34. package/dist/packages/modal-header/modal-header.js +1 -1
  35. package/dist/packages/modal-header/modal-header.js.map +3 -3
  36. package/dist/packages/page-indicator/page-indicator.js +7 -7
  37. package/dist/packages/page-indicator/page-indicator.js.map +3 -3
  38. package/dist/packages/page-indicator/page-indicator.test.js +23 -0
  39. package/dist/packages/pagination/pagination.d.ts +4 -0
  40. package/dist/packages/pagination/pagination.js +14 -14
  41. package/dist/packages/pagination/pagination.js.map +3 -3
  42. package/dist/packages/pagination/pagination.react.stories.d.ts +1 -1
  43. package/dist/packages/pagination/pagination.test.js +18 -0
  44. package/dist/packages/pill/pill.js +5 -5
  45. package/dist/packages/pill/pill.js.map +3 -3
  46. package/dist/packages/radio/radio.a11y.test.js +15 -6
  47. package/dist/packages/radio/radio.js +2 -2
  48. package/dist/packages/radio/radio.js.map +2 -2
  49. package/dist/packages/radio/radio.test.js +7 -7
  50. package/dist/packages/radio-group/radio-group.js +9 -9
  51. package/dist/packages/radio-group/radio-group.js.map +2 -2
  52. package/dist/packages/radio-group/radio-group.test.js +3 -2
  53. package/dist/packages/select/select.js +13 -13
  54. package/dist/packages/select/select.js.map +3 -3
  55. package/dist/packages/slider/slider.test.js +41 -0
  56. package/dist/packages/slider-thumb/slider-thumb.js +1 -1
  57. package/dist/packages/slider-thumb/slider-thumb.js.map +2 -2
  58. package/dist/packages/step/step.d.ts +1 -0
  59. package/dist/packages/step/step.js +4 -4
  60. package/dist/packages/step/step.js.map +3 -3
  61. package/dist/packages/step-indicator/step-indicator.a11y.test.js +3 -1
  62. package/dist/packages/switch/switch.a11y.test.js +10 -6
  63. package/dist/packages/switch/switch.js +2 -2
  64. package/dist/packages/switch/switch.js.map +3 -3
  65. package/dist/packages/switch/switch.test.js +0 -5
  66. package/dist/packages/tab/tab.d.ts +2 -0
  67. package/dist/packages/tab/tab.js +5 -5
  68. package/dist/packages/tab/tab.js.map +3 -3
  69. package/dist/packages/tab-panel/tab-panel.d.ts +2 -1
  70. package/dist/packages/tab-panel/tab-panel.js +7 -3
  71. package/dist/packages/tab-panel/tab-panel.js.map +3 -3
  72. package/dist/packages/tabs/tabs.a11y.test.js +16 -7
  73. package/dist/packages/tabs/tabs.js +1 -1
  74. package/dist/packages/tabs/tabs.js.map +2 -2
  75. package/dist/packages/tabs/tabs.test.js +45 -1
  76. package/dist/packages/textfield/textfield.js +2 -2
  77. package/dist/packages/textfield/textfield.js.map +2 -2
  78. package/dist/packages/textfield/textfield.test.js +26 -0
  79. package/dist/packages/toast/toast.js +3 -3
  80. package/dist/packages/toast/toast.js.map +3 -3
  81. package/dist/packages/toast/toast.test.d.ts +1 -0
  82. package/dist/packages/toast/toast.test.js +58 -0
  83. package/dist/web-types.json +18 -52
  84. package/package.json +4 -3
@@ -0,0 +1 @@
1
+ import './toast.js';
@@ -0,0 +1,58 @@
1
+ import { html } from 'lit';
2
+ import { expect, test } from 'vitest';
3
+ import { render } from 'vitest-browser-lit';
4
+ import './toast.js';
5
+ test('renders the toast with text', async () => {
6
+ const component = html `<w-toast text="Test message" data-testid="toast"></w-toast>`;
7
+ const page = render(component);
8
+ await expect.element(page.getByTestId('toast')).toBeVisible();
9
+ await expect.element(page.getByText('Test message')).toBeVisible();
10
+ });
11
+ test('defaults to success type when no type attribute is set', async () => {
12
+ const component = html `<w-toast text="Success message" data-testid="toast"></w-toast>`;
13
+ const page = render(component);
14
+ const el = page.getByTestId('toast').element();
15
+ // The type attribute should not be reflected (to avoid hydration mismatch)
16
+ expect(el.hasAttribute('type')).toBe(false);
17
+ // But the success icon should be rendered (default behavior)
18
+ await expect
19
+ .poll(() => {
20
+ const icon = el.shadowRoot?.querySelector('w-icon');
21
+ return icon?.getAttribute('name');
22
+ })
23
+ .toBe('Success');
24
+ });
25
+ test('generates unique id when no id attribute is set', async () => {
26
+ const component = html `<w-toast text="Test message" data-testid="toast"></w-toast>`;
27
+ const page = render(component);
28
+ const el = page.getByTestId('toast').element();
29
+ // An id should be generated
30
+ expect(el.id).toBeTruthy();
31
+ expect(el.id.length).toBeGreaterThan(0);
32
+ });
33
+ test('uses specified type when type attribute is set', async () => {
34
+ const component = html `<w-toast text="Warning message" type="warning" data-testid="toast"></w-toast>`;
35
+ const page = render(component);
36
+ const el = page.getByTestId('toast').element();
37
+ // The type attribute should be reflected
38
+ expect(el.getAttribute('type')).toBe('warning');
39
+ // And the warning icon should be rendered
40
+ await expect
41
+ .poll(() => {
42
+ const icon = el.shadowRoot?.querySelector('w-icon');
43
+ return icon?.getAttribute('name');
44
+ })
45
+ .toBe('Warning');
46
+ });
47
+ test('renders error type correctly', async () => {
48
+ const component = html `<w-toast text="Error message" type="error" data-testid="toast"></w-toast>`;
49
+ const page = render(component);
50
+ const el = page.getByTestId('toast').element();
51
+ // The error icon should be rendered
52
+ await expect
53
+ .poll(() => {
54
+ const icon = el.shadowRoot?.querySelector('w-icon');
55
+ return icon?.getAttribute('name');
56
+ })
57
+ .toBe('Error');
58
+ });
@@ -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.8.1-next.5",
4
+ "version": "2.8.2-next.1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -19,15 +19,12 @@
19
19
  {
20
20
  "name": "size",
21
21
  "description": "Size: small, medium, large or pixel value (e.g. \"32px\")",
22
- "value": {
23
- "type": "'small' | 'medium' | 'large' | string",
24
- "default": "'medium'"
25
- }
22
+ "value": { "type": "'small' | 'medium' | 'large' | string" }
26
23
  },
27
24
  {
28
25
  "name": "locale",
29
26
  "description": "Locale used in CDN URL",
30
- "value": { "type": "string", "default": "'en'" }
27
+ "value": { "type": "string" }
31
28
  }
32
29
  ],
33
30
  "events": [],
@@ -97,14 +94,10 @@
97
94
  {
98
95
  "name": "variant",
99
96
  "value": {
100
- "type": "'negative' | 'positive' | 'warning' | 'info'",
101
- "default": "'info'"
97
+ "type": "'negative' | 'positive' | 'warning' | 'info'"
102
98
  }
103
99
  },
104
- {
105
- "name": "show",
106
- "value": { "type": "boolean", "default": "false" }
107
- },
100
+ { "name": "show", "value": { "type": "boolean" } },
108
101
  {
109
102
  "name": "role",
110
103
  "value": { "type": "string", "default": "'alert'" }
@@ -135,8 +128,7 @@
135
128
  {
136
129
  "name": "variant",
137
130
  "value": {
138
- "type": "'negative' | 'primary' | 'secondary' | 'negativeQuiet' | 'utility' | 'quiet' | 'utilityQuiet' | 'overlay' | 'overlayInverted' | 'overlayQuiet' | 'overlayInvertedQuiet'",
139
- "default": "'secondary'"
131
+ "type": "'negative' | 'primary' | 'secondary' | 'negativeQuiet' | 'utility' | 'quiet' | 'utilityQuiet' | 'overlay' | 'overlayInverted' | 'overlayQuiet' | 'overlayInvertedQuiet'"
140
132
  }
141
133
  },
142
134
  {
@@ -180,10 +172,7 @@
180
172
  "attributes": [
181
173
  {
182
174
  "name": "type",
183
- "value": {
184
- "type": "'button' | 'submit' | 'reset'",
185
- "default": "'button'"
186
- }
175
+ "value": { "type": "'button' | 'submit' | 'reset'" }
187
176
  },
188
177
  {
189
178
  "name": "autofocus",
@@ -331,8 +320,7 @@
331
320
  {
332
321
  "name": "variant",
333
322
  "value": {
334
- "type": "'neutral' | 'info' | 'positive' | 'warning' | 'negative' | 'disabled' | 'price' | 'sponsored'",
335
- "default": "'neutral'"
323
+ "type": "'neutral' | 'info' | 'positive' | 'warning' | 'negative' | 'disabled' | 'price' | 'sponsored'"
336
324
  }
337
325
  },
338
326
  {
@@ -396,14 +384,9 @@
396
384
  "name": "w-breadcrumbs",
397
385
  "description": "Breadcrumbs show the navigation structure for the current location.\n\n[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/navigation-breadcrumbs--docs)\n---\n",
398
386
  "doc-url": "",
399
- "attributes": [
400
- { "name": "aria-label", "value": { "type": "string" } }
401
- ],
387
+ "attributes": [],
402
388
  "events": [],
403
- "js": {
404
- "properties": [{ "name": "ariaLabel", "type": "string" }],
405
- "events": []
406
- }
389
+ "js": { "properties": [{ "name": "ariaLabel" }], "events": [] }
407
390
  },
408
391
  {
409
392
  "name": "w-card",
@@ -671,7 +654,7 @@
671
654
  {
672
655
  "name": "autocomplete",
673
656
  "description": "Autocomplete attribute for the input field",
674
- "value": { "type": "string | undefined", "default": "'off'" }
657
+ "value": { "type": "string | undefined" }
675
658
  }
676
659
  ],
677
660
  "events": [],
@@ -997,12 +980,12 @@
997
980
  {
998
981
  "name": "selected-page",
999
982
  "description": "Currently selected page (1-based index, clamped to valid range)",
1000
- "value": { "type": "number", "default": "1" }
983
+ "value": { "type": "number" }
1001
984
  },
1002
985
  {
1003
986
  "name": "page-count",
1004
987
  "description": "Total number of pages (minimum 1)",
1005
- "value": { "type": "number", "default": "1" }
988
+ "value": { "type": "number" }
1006
989
  }
1007
990
  ],
1008
991
  "events": [],
@@ -1029,14 +1012,8 @@
1029
1012
  "attributes": [
1030
1013
  { "name": "base-url", "value": { "type": "string" } },
1031
1014
  { "name": "pages", "value": { "type": "number" } },
1032
- {
1033
- "name": "current-page",
1034
- "value": { "type": "number", "default": "1" }
1035
- },
1036
- {
1037
- "name": "visible-pages",
1038
- "value": { "type": "number", "default": "7" }
1039
- }
1015
+ { "name": "current-page", "value": { "type": "number" } },
1016
+ { "name": "visible-pages", "value": { "type": "number" } }
1040
1017
  ],
1041
1018
  "events": [
1042
1019
  {
@@ -1402,10 +1379,7 @@
1402
1379
  "name": "required",
1403
1380
  "value": { "type": "boolean", "default": "false" }
1404
1381
  },
1405
- {
1406
- "name": "type",
1407
- "value": { "type": "string", "default": "'text'" }
1408
- },
1382
+ { "name": "type", "value": { "type": "string" } },
1409
1383
  { "name": "value", "value": { "type": "string" } },
1410
1384
  { "name": "name", "value": { "type": "string" } },
1411
1385
  { "name": "step", "value": { "type": "number" } },
@@ -1730,17 +1704,9 @@
1730
1704
  "name": "w-tab-panel",
1731
1705
  "description": "Tab panel component that holds content for individual tabs.\nEach tab panel should have a name that matches a corresponding tab.\n\n[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/tabs--docs)\n---\n",
1732
1706
  "doc-url": "",
1733
- "attributes": [
1734
- {
1735
- "name": "hidden",
1736
- "value": { "type": "boolean", "default": "true" }
1737
- }
1738
- ],
1707
+ "attributes": [],
1739
1708
  "events": [],
1740
- "js": {
1741
- "properties": [{ "name": "hidden", "type": "boolean" }],
1742
- "events": []
1743
- }
1709
+ "js": { "properties": [], "events": [] }
1744
1710
  },
1745
1711
  {
1746
1712
  "name": "w-tabs",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@warp-ds/elements",
3
3
  "type": "module",
4
- "version": "2.8.1",
4
+ "version": "2.8.2-next.2",
5
5
  "packageManager": "pnpm@10.30.3",
6
6
  "description": "Custom elements for Warp",
7
7
  "exports": {
@@ -365,7 +365,7 @@
365
365
  "rimraf": "6.0.1",
366
366
  "rollup": "^4.52.3",
367
367
  "scroll-doctor": "2.0.2",
368
- "semantic-release": "24.0.0",
368
+ "semantic-release": "25.0.3",
369
369
  "storybook": "^9.1.4",
370
370
  "tslib": "^2.8.1",
371
371
  "typescript": "5.5.3",
@@ -381,7 +381,8 @@
381
381
  "lit": "3.x"
382
382
  },
383
383
  "publishConfig": {
384
- "access": "public"
384
+ "access": "public",
385
+ "provenance": true
385
386
  },
386
387
  "eik": {
387
388
  "files": "eik",