@warp-ds/elements 2.9.2-next.1 → 2.10.0-next.1

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 (69) hide show
  1. package/dist/custom-elements.json +275 -58
  2. package/dist/docs/button/accessibility.md +42 -0
  3. package/dist/docs/button/api.md +63 -39
  4. package/dist/docs/button/button.md +322 -40
  5. package/dist/docs/button/examples.md +126 -0
  6. package/dist/docs/button/usage.md +89 -0
  7. package/dist/docs/modal/accessibility.md +1 -0
  8. package/dist/docs/modal/api.md +51 -0
  9. package/dist/docs/modal/examples.md +67 -0
  10. package/dist/docs/modal/modal.md +238 -0
  11. package/dist/docs/modal/usage.md +110 -0
  12. package/dist/docs/modal-footer/accessibility.md +1 -0
  13. package/dist/docs/modal-footer/api.md +11 -0
  14. package/dist/docs/modal-footer/examples.md +1 -0
  15. package/dist/docs/modal-footer/modal-footer.md +23 -0
  16. package/dist/docs/modal-footer/usage.md +1 -0
  17. package/dist/docs/modal-header/accessibility.md +1 -0
  18. package/dist/docs/modal-header/api.md +42 -0
  19. package/dist/docs/modal-header/examples.md +1 -0
  20. package/dist/docs/modal-header/modal-header.md +54 -0
  21. package/dist/docs/modal-header/usage.md +1 -0
  22. package/dist/docs/page-indicator/api.md +6 -6
  23. package/dist/docs/page-indicator/examples.md +8 -0
  24. package/dist/docs/page-indicator/page-indicator.md +23 -6
  25. package/dist/docs/page-indicator/usage.md +8 -0
  26. package/dist/docs/pagination/api.md +12 -10
  27. package/dist/docs/pagination/examples.md +20 -0
  28. package/dist/docs/pagination/pagination.md +50 -12
  29. package/dist/docs/pagination/usage.md +18 -0
  30. package/dist/docs/pill/accessibility.md +2 -0
  31. package/dist/docs/pill/api.md +10 -26
  32. package/dist/docs/pill/examples.md +23 -0
  33. package/dist/docs/pill/pill.md +43 -28
  34. package/dist/docs/pill/usage.md +8 -0
  35. package/dist/index.d.ts +305 -289
  36. package/dist/packages/attention/attention.js +23 -21
  37. package/dist/packages/attention/attention.js.map +3 -3
  38. package/dist/packages/button/button.d.ts +54 -37
  39. package/dist/packages/button/button.js +17 -15
  40. package/dist/packages/button/button.js.map +3 -3
  41. package/dist/packages/button/button.react.stories.d.ts +2 -2
  42. package/dist/packages/button/react.d.ts +1 -1
  43. package/dist/packages/modal/index.d.ts +4 -4
  44. package/dist/packages/modal/index.js +4 -4
  45. package/dist/packages/modal/modal.d.ts +21 -12
  46. package/dist/packages/modal/modal.js +4 -4
  47. package/dist/packages/modal/modal.js.map +3 -3
  48. package/dist/packages/modal/modal.react.stories.d.ts +3 -3
  49. package/dist/packages/modal/modal.stories.d.ts +2 -1
  50. package/dist/packages/modal/modal.stories.js +85 -3
  51. package/dist/packages/modal/react.d.ts +2 -2
  52. package/dist/packages/modal-footer/modal-footer.d.ts +5 -3
  53. package/dist/packages/modal-footer/modal-footer.js +4 -4
  54. package/dist/packages/modal-footer/modal-footer.js.map +3 -3
  55. package/dist/packages/modal-footer/react.d.ts +1 -1
  56. package/dist/packages/modal-header/modal-header.d.ts +21 -11
  57. package/dist/packages/modal-header/modal-header.js +1 -1
  58. package/dist/packages/modal-header/modal-header.js.map +3 -3
  59. package/dist/packages/modal-header/react.d.ts +2 -2
  60. package/dist/packages/page-indicator/page-indicator.d.ts +9 -14
  61. package/dist/packages/page-indicator/page-indicator.js.map +2 -2
  62. package/dist/packages/pagination/pagination.d.ts +11 -11
  63. package/dist/packages/pagination/pagination.js.map +2 -2
  64. package/dist/packages/pill/pill.d.ts +14 -29
  65. package/dist/packages/pill/pill.js.map +2 -2
  66. package/dist/packages/pill/pill.react.stories.d.ts +2 -2
  67. package/dist/packages/pill/react.d.ts +1 -1
  68. package/dist/web-types.json +272 -70
  69. package/package.json +5 -5
@@ -3,14 +3,31 @@
3
3
  ## Description
4
4
 
5
5
  A page indicator component that displays a series of dots representing pages.
6
+
6
7
  One dot is highlighted to indicate the currently selected page.
7
8
 
8
9
  ## Usage
9
10
 
11
+ <elements-example>
12
+
13
+ ```html
14
+ <w-page-indicator page-count="5" selected-page="1"></w-page-indicator>
15
+ ```
16
+
17
+ </elements-example>
18
+
10
19
  ## Accessibility
11
20
 
12
21
  ## Examples
13
22
 
23
+ <elements-example>
24
+
25
+ ```html
26
+ <w-page-indicator selected-page="3" page-count="5"></w-page-indicator>
27
+ ```
28
+
29
+ </elements-example>
30
+
14
31
  ## `<w-page-indicator>` API
15
32
 
16
33
  Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
@@ -19,22 +36,22 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
19
36
 
20
37
  | Name | Type | Default | Summary |
21
38
  |-|-|-|-|
22
- | page-count | `number` | `-` | Total number of pages (minimum 1) |
23
- | selected-page | `number` | `-` | Currently selected page (1-based index, clamped to valid range) |
39
+ | page-count | `number` | `1` | Total number of pages |
40
+ | selected-page | `number` | `1` | Currently selected page (1-based index) |
24
41
 
25
42
  ### Property Details
26
43
 
27
44
  #### page-count
28
45
 
29
- Total number of pages (minimum 1)
46
+ Total number of pages
30
47
 
31
48
  - Type: `number`
32
- - Default: `-`
49
+ - Default: `1`
33
50
 
34
51
  #### selected-page
35
52
 
36
- Currently selected page (1-based index, clamped to valid range)
53
+ Currently selected page (1-based index)
37
54
 
38
55
  - Type: `number`
39
- - Default: `-`
56
+ - Default: `1`
40
57
 
@@ -1 +1,9 @@
1
1
  ## Usage
2
+
3
+ <elements-example>
4
+
5
+ ```html
6
+ <w-page-indicator page-count="5" selected-page="1"></w-page-indicator>
7
+ ```
8
+
9
+ </elements-example>
@@ -6,46 +6,48 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
6
6
 
7
7
  | Name | Type | Default | Summary |
8
8
  |-|-|-|-|
9
- | base-url | `string` | `-` | - |
10
- | current-page | `number` | `-` | - |
11
- | pages | `number` | `-` | - |
12
- | visible-pages | `number` | `-` | - |
9
+ | base-url | `string` | `-` | The base URL used to construct page links, for example `/search?page=`. |
10
+ | current-page | `number` | `1` | The currently active page number. |
11
+ | pages | `number` | `-` | The total number of pages. |
12
+ | visible-pages | `number` | `7` | The maximum number of page numbers visible. |
13
13
 
14
14
  ### Property Details
15
15
 
16
16
  #### base-url
17
17
 
18
+ The base URL used to construct page links, for example `/search?page=`.
18
19
 
20
+ The page number is appended to this URL.
19
21
 
20
22
  - Type: `string`
21
23
  - Default: `-`
22
24
 
23
25
  #### current-page
24
26
 
25
-
27
+ The currently active page number.
26
28
 
27
29
  - Type: `number`
28
- - Default: `-`
30
+ - Default: `1`
29
31
 
30
32
  #### pages
31
33
 
32
-
34
+ The total number of pages.
33
35
 
34
36
  - Type: `number`
35
37
  - Default: `-`
36
38
 
37
39
  #### visible-pages
38
40
 
39
-
41
+ The maximum number of page numbers visible.
40
42
 
41
43
  - Type: `number`
42
- - Default: `-`
44
+ - Default: `7`
43
45
 
44
46
  ### Events
45
47
 
46
48
  #### page-click
47
49
 
48
- Triggered when a link button in the pagination is clicked. Contains the page number in `string` form.
50
+ Triggered when a link in the pagination is clicked. Contains the page number in `string` form.
49
51
 
50
52
  - Type: `CustomEvent`
51
53
 
@@ -1 +1,21 @@
1
1
  ## Examples
2
+
3
+ ### Single-page app behavior
4
+
5
+ By default the pagination component uses link which trigger a full page navigation.
6
+
7
+ If you want to override this in your app and handle things like scroll and focus management on your own you can add an event listener to the pagination component and prevent the default navigation.
8
+
9
+ ```html
10
+ <w-pagination base-url="/search?page=" pages="10" current-page="5"></w-pagination>
11
+
12
+ <script type="module">
13
+ const pagination = document.querySelector('w-pagination');
14
+
15
+ pagination.addEventListener('page-click', (event) => {
16
+ event.preventDefault();
17
+ // event.detail = { clickedPage: string }
18
+ console.log('Do something with the clicked page after preventing default navigation:', event.detail.clickedPage);
19
+ });
20
+ </script>
21
+ ```
@@ -4,14 +4,50 @@
4
4
 
5
5
  Pagination allows users to navigate through multiple pages of content by providing navigation controls with page numbers and directional arrows.
6
6
 
7
- [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/navigation-pagination--docs)
8
-
9
7
  ## Usage
10
8
 
9
+
10
+ The pagination component automatically shows/hides navigation buttons based on the current page:
11
+
12
+ - **First page button** (double chevron): Shown when current page is greater than 2
13
+ - **Previous page button** (single chevron): Shown when current page is greater than 1
14
+ - **Next page button** (single chevron): Shown when current page is less than total pages
15
+
16
+ On mobile devices, the page numbers are hidden and replaced with a "Page X" label for a cleaner interface.
17
+
18
+
19
+ <elements-example>
20
+
21
+ ```html
22
+ <w-pagination base-url="#/search?page=" pages="5" current-page="1"></w-pagination>
23
+ ```
24
+
25
+ </elements-example>
26
+
11
27
  ## Accessibility
12
28
 
13
29
  ## Examples
14
30
 
31
+ ### Single-page app behavior
32
+
33
+ By default the pagination component uses link which trigger a full page navigation.
34
+
35
+ If you want to override this in your app and handle things like scroll and focus management on your own you can add an event listener to the pagination component and prevent the default navigation.
36
+
37
+ ```html
38
+ <w-pagination base-url="/search?page=" pages="10" current-page="5"></w-pagination>
39
+
40
+ <script type="module">
41
+ const pagination = document.querySelector('w-pagination');
42
+
43
+ pagination.addEventListener('page-click', (event) => {
44
+ event.preventDefault();
45
+ // event.detail = { clickedPage: string }
46
+ console.log('Do something with the clicked page after preventing default navigation:', event.detail.clickedPage);
47
+ });
48
+ </script>
49
+ ```
50
+
15
51
  ## `<w-pagination>` API
16
52
 
17
53
  Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
@@ -20,46 +56,48 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
20
56
 
21
57
  | Name | Type | Default | Summary |
22
58
  |-|-|-|-|
23
- | base-url | `string` | `-` | - |
24
- | current-page | `number` | `-` | - |
25
- | pages | `number` | `-` | - |
26
- | visible-pages | `number` | `-` | - |
59
+ | base-url | `string` | `-` | The base URL used to construct page links, for example `/search?page=`. |
60
+ | current-page | `number` | `1` | The currently active page number. |
61
+ | pages | `number` | `-` | The total number of pages. |
62
+ | visible-pages | `number` | `7` | The maximum number of page numbers visible. |
27
63
 
28
64
  ### Property Details
29
65
 
30
66
  #### base-url
31
67
 
68
+ The base URL used to construct page links, for example `/search?page=`.
32
69
 
70
+ The page number is appended to this URL.
33
71
 
34
72
  - Type: `string`
35
73
  - Default: `-`
36
74
 
37
75
  #### current-page
38
76
 
39
-
77
+ The currently active page number.
40
78
 
41
79
  - Type: `number`
42
- - Default: `-`
80
+ - Default: `1`
43
81
 
44
82
  #### pages
45
83
 
46
-
84
+ The total number of pages.
47
85
 
48
86
  - Type: `number`
49
87
  - Default: `-`
50
88
 
51
89
  #### visible-pages
52
90
 
53
-
91
+ The maximum number of page numbers visible.
54
92
 
55
93
  - Type: `number`
56
- - Default: `-`
94
+ - Default: `7`
57
95
 
58
96
  ### Events
59
97
 
60
98
  #### page-click
61
99
 
62
- Triggered when a link button in the pagination is clicked. Contains the page number in `string` form.
100
+ Triggered when a link in the pagination is clicked. Contains the page number in `string` form.
63
101
 
64
102
  - Type: `CustomEvent`
65
103
 
@@ -1 +1,19 @@
1
1
  ## Usage
2
+
3
+
4
+ The pagination component automatically shows/hides navigation buttons based on the current page:
5
+
6
+ - **First page button** (double chevron): Shown when current page is greater than 2
7
+ - **Previous page button** (single chevron): Shown when current page is greater than 1
8
+ - **Next page button** (single chevron): Shown when current page is less than total pages
9
+
10
+ On mobile devices, the page numbers are hidden and replaced with a "Page X" label for a cleaner interface.
11
+
12
+
13
+ <elements-example>
14
+
15
+ ```html
16
+ <w-pagination base-url="#/search?page=" pages="5" current-page="1"></w-pagination>
17
+ ```
18
+
19
+ </elements-example>
@@ -1 +1,3 @@
1
1
  ## Accessibility
2
+
3
+ Pills are designed to show active filters. By default they include generic accessible labels, but you can override these with your own.
@@ -6,27 +6,25 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
6
6
 
7
7
  | Name | Type | Default | Summary |
8
8
  |-|-|-|-|
9
- | can-close | `boolean` | `false` | - |
10
- | close-aria-label | `string` | `-` | - |
9
+ | can-close | `boolean` | `false` | Whether the pill should be removable via a close button. |
10
+ | close-aria-label | `string` | `-` | Label read by screen readers when targeting the close button. |
11
11
  | close-sr-label | `string` | `-` | **Deprecated**: Used "close-arial-label" instead. |
12
- | open-aria-label | `string` | `-` | - |
13
- | openFilterSrText (JS only) | `unknown` | `-` | - |
12
+ | open-aria-label | `string` | `-` | Label read by screen readers when targeting the pill. |
14
13
  | open-sr-label | `string` | `-` | **Deprecated**: Used "open-arial-label" instead. |
15
- | removeFilterSrText (JS only) | `unknown` | `-` | - |
16
- | suggestion | `boolean` | `false` | - |
14
+ | suggestion | `boolean` | `false` | Whether the pill should be rendered as a suggestion. |
17
15
 
18
16
  ### Property Details
19
17
 
20
18
  #### can-close
21
19
 
22
-
20
+ Whether the pill should be removable via a close button.
23
21
 
24
22
  - Type: `boolean`
25
23
  - Default: `false`
26
24
 
27
25
  #### close-aria-label
28
26
 
29
-
27
+ Label read by screen readers when targeting the close button.
30
28
 
31
29
  - Type: `string`
32
30
  - Default: `-`
@@ -42,18 +40,11 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
42
40
 
43
41
  #### open-aria-label
44
42
 
45
-
43
+ Label read by screen readers when targeting the pill.
46
44
 
47
45
  - Type: `string`
48
46
  - Default: `-`
49
47
 
50
- #### openFilterSrText (JS only)
51
-
52
-
53
-
54
- - Type: `unknown`
55
- - Default: `-`
56
-
57
48
  #### open-sr-label
58
49
 
59
50
  **Deprecated**: Used "open-arial-label" instead.
@@ -63,16 +54,9 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
63
54
  - Type: `string`
64
55
  - Default: `-`
65
56
 
66
- #### removeFilterSrText (JS only)
67
-
68
-
69
-
70
- - Type: `unknown`
71
- - Default: `-`
72
-
73
57
  #### suggestion
74
58
 
75
-
59
+ Whether the pill should be rendered as a suggestion.
76
60
 
77
61
  - Type: `boolean`
78
62
  - Default: `false`
@@ -81,12 +65,12 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
81
65
 
82
66
  #### w-pill-click
83
67
 
84
-
68
+ Fires when the pill itself is clicked.
85
69
 
86
70
  - Type: `CustomEvent`
87
71
  #### w-pill-close
88
72
 
89
-
73
+ Fires when the pill's close button is clicked.
90
74
 
91
75
  - Type: `CustomEvent`
92
76
 
@@ -1 +1,24 @@
1
1
  ## Examples
2
+
3
+ ### Closable
4
+
5
+ For example to dismiss or turn off parts of a filter.
6
+
7
+ <elements-example>
8
+
9
+ ```html
10
+ <w-pill can-close>Filter</w-pill>
11
+ ```
12
+
13
+ </elements-example>
14
+
15
+
16
+ ### Suggestion
17
+
18
+ <elements-example>
19
+
20
+ ```html
21
+ <w-pill suggestion>Suggestion</w-pill>
22
+ ```
23
+
24
+ </elements-example>
@@ -4,14 +4,45 @@
4
4
 
5
5
  Pill is a type of button that is often used as a filter, but can also be used as a rounded button for overlays, etc.
6
6
 
7
- [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/buttons-pill--docs)
8
-
9
7
  ## Usage
10
8
 
9
+ <elements-example>
10
+
11
+ ```html
12
+ <w-pill>Filter</w-pill>
13
+ ```
14
+
15
+ </elements-example>
16
+
11
17
  ## Accessibility
12
18
 
19
+ Pills are designed to show active filters. By default they include generic accessible labels, but you can override these with your own.
20
+
13
21
  ## Examples
14
22
 
23
+ ### Closable
24
+
25
+ For example to dismiss or turn off parts of a filter.
26
+
27
+ <elements-example>
28
+
29
+ ```html
30
+ <w-pill can-close>Filter</w-pill>
31
+ ```
32
+
33
+ </elements-example>
34
+
35
+
36
+ ### Suggestion
37
+
38
+ <elements-example>
39
+
40
+ ```html
41
+ <w-pill suggestion>Suggestion</w-pill>
42
+ ```
43
+
44
+ </elements-example>
45
+
15
46
  ## `<w-pill>` API
16
47
 
17
48
  Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
@@ -20,27 +51,25 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
20
51
 
21
52
  | Name | Type | Default | Summary |
22
53
  |-|-|-|-|
23
- | can-close | `boolean` | `false` | - |
24
- | close-aria-label | `string` | `-` | - |
54
+ | can-close | `boolean` | `false` | Whether the pill should be removable via a close button. |
55
+ | close-aria-label | `string` | `-` | Label read by screen readers when targeting the close button. |
25
56
  | close-sr-label | `string` | `-` | **Deprecated**: Used "close-arial-label" instead. |
26
- | open-aria-label | `string` | `-` | - |
27
- | openFilterSrText (JS only) | `unknown` | `-` | - |
57
+ | open-aria-label | `string` | `-` | Label read by screen readers when targeting the pill. |
28
58
  | open-sr-label | `string` | `-` | **Deprecated**: Used "open-arial-label" instead. |
29
- | removeFilterSrText (JS only) | `unknown` | `-` | - |
30
- | suggestion | `boolean` | `false` | - |
59
+ | suggestion | `boolean` | `false` | Whether the pill should be rendered as a suggestion. |
31
60
 
32
61
  ### Property Details
33
62
 
34
63
  #### can-close
35
64
 
36
-
65
+ Whether the pill should be removable via a close button.
37
66
 
38
67
  - Type: `boolean`
39
68
  - Default: `false`
40
69
 
41
70
  #### close-aria-label
42
71
 
43
-
72
+ Label read by screen readers when targeting the close button.
44
73
 
45
74
  - Type: `string`
46
75
  - Default: `-`
@@ -56,18 +85,11 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
56
85
 
57
86
  #### open-aria-label
58
87
 
59
-
88
+ Label read by screen readers when targeting the pill.
60
89
 
61
90
  - Type: `string`
62
91
  - Default: `-`
63
92
 
64
- #### openFilterSrText (JS only)
65
-
66
-
67
-
68
- - Type: `unknown`
69
- - Default: `-`
70
-
71
93
  #### open-sr-label
72
94
 
73
95
  **Deprecated**: Used "open-arial-label" instead.
@@ -77,16 +99,9 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
77
99
  - Type: `string`
78
100
  - Default: `-`
79
101
 
80
- #### removeFilterSrText (JS only)
81
-
82
-
83
-
84
- - Type: `unknown`
85
- - Default: `-`
86
-
87
102
  #### suggestion
88
103
 
89
-
104
+ Whether the pill should be rendered as a suggestion.
90
105
 
91
106
  - Type: `boolean`
92
107
  - Default: `false`
@@ -95,12 +110,12 @@ Unless otherwise noted all properties are HTML attributes (as opposed to JavaScr
95
110
 
96
111
  #### w-pill-click
97
112
 
98
-
113
+ Fires when the pill itself is clicked.
99
114
 
100
115
  - Type: `CustomEvent`
101
116
  #### w-pill-close
102
117
 
103
-
118
+ Fires when the pill's close button is clicked.
104
119
 
105
120
  - Type: `CustomEvent`
106
121
 
@@ -1 +1,9 @@
1
1
  ## Usage
2
+
3
+ <elements-example>
4
+
5
+ ```html
6
+ <w-pill>Filter</w-pill>
7
+ ```
8
+
9
+ </elements-example>