@statistikzh/leu 0.13.1 → 0.14.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 (174) hide show
  1. package/.eslintrc.json +8 -0
  2. package/.github/workflows/ci.yml +78 -0
  3. package/.github/workflows/deploy-github-pages.yaml +2 -1
  4. package/.github/workflows/release-please.yml +2 -1
  5. package/.nvmrc +1 -0
  6. package/.prettierignore +1 -0
  7. package/.storybook/main.js +19 -3
  8. package/CHANGELOG.md +16 -0
  9. package/custom-elements-manifest.config.js +2 -2
  10. package/dist/Accordion.d.ts +1 -1
  11. package/dist/Accordion.d.ts.map +1 -1
  12. package/dist/Accordion.js +2 -4
  13. package/dist/Button.d.ts +2 -2
  14. package/dist/Button.js +2 -2
  15. package/dist/ButtonGroup.d.ts +1 -1
  16. package/dist/ButtonGroup.js +1 -1
  17. package/dist/Checkbox.d.ts +1 -1
  18. package/dist/Checkbox.d.ts.map +1 -1
  19. package/dist/Checkbox.js +2 -3
  20. package/dist/CheckboxGroup.d.ts +1 -1
  21. package/dist/CheckboxGroup.d.ts.map +1 -1
  22. package/dist/CheckboxGroup.js +1 -3
  23. package/dist/Chip.d.ts +1 -1
  24. package/dist/Chip.d.ts.map +1 -1
  25. package/dist/Chip.js +1 -3
  26. package/dist/ChipGroup.d.ts +1 -1
  27. package/dist/ChipGroup.d.ts.map +1 -1
  28. package/dist/ChipGroup.js +2 -2
  29. package/dist/ChipLink.js +1 -1
  30. package/dist/ChipRemovable.js +1 -1
  31. package/dist/ChipSelectable.js +1 -1
  32. package/dist/Dialog.d.ts +1 -1
  33. package/dist/Dialog.d.ts.map +1 -1
  34. package/dist/Dialog.js +3 -5
  35. package/dist/Dropdown.d.ts +1 -1
  36. package/dist/Dropdown.js +3 -3
  37. package/dist/Icon.d.ts +2 -98
  38. package/dist/Icon.d.ts.map +1 -1
  39. package/dist/Icon.js +1 -1
  40. package/dist/Input.d.ts +7 -2
  41. package/dist/Input.d.ts.map +1 -1
  42. package/dist/Input.js +15 -8
  43. package/dist/{LeuElement-b670d77c.d.ts → LeuElement-BjGpKQpe.d.ts} +1 -1
  44. package/dist/LeuElement-BjGpKQpe.d.ts.map +1 -0
  45. package/dist/{LeuElement-b670d77c.js → LeuElement-BjGpKQpe.js} +2 -2
  46. package/dist/Menu.d.ts +2 -2
  47. package/dist/Menu.js +1 -1
  48. package/dist/MenuItem.d.ts +3 -3
  49. package/dist/MenuItem.js +1 -1
  50. package/dist/Pagination.d.ts +1 -1
  51. package/dist/Pagination.js +3 -3
  52. package/dist/Popup.d.ts +2 -2
  53. package/dist/Popup.d.ts.map +1 -1
  54. package/dist/Popup.js +1 -3
  55. package/dist/Radio.d.ts +1 -1
  56. package/dist/Radio.d.ts.map +1 -1
  57. package/dist/Radio.js +1 -3
  58. package/dist/RadioGroup.d.ts +1 -1
  59. package/dist/RadioGroup.d.ts.map +1 -1
  60. package/dist/RadioGroup.js +1 -3
  61. package/dist/Range.d.ts +1 -1
  62. package/dist/Range.d.ts.map +1 -1
  63. package/dist/Range.js +17 -19
  64. package/dist/ScrollTop.d.ts +1 -1
  65. package/dist/ScrollTop.d.ts.map +1 -1
  66. package/dist/ScrollTop.js +27 -3
  67. package/dist/Select.d.ts +3 -3
  68. package/dist/Select.d.ts.map +1 -1
  69. package/dist/Select.js +6 -4
  70. package/dist/Spinner.d.ts +1 -1
  71. package/dist/Spinner.js +1 -1
  72. package/dist/Table.d.ts +1 -1
  73. package/dist/Table.d.ts.map +1 -1
  74. package/dist/Table.js +3 -4
  75. package/dist/VisuallyHidden.d.ts +1 -1
  76. package/dist/VisuallyHidden.d.ts.map +1 -1
  77. package/dist/VisuallyHidden.js +3 -5
  78. package/dist/{hasSlotController-c09741c5.d.ts → hasSlotController-DvFw2NdC.d.ts} +1 -1
  79. package/dist/hasSlotController-DvFw2NdC.d.ts.map +1 -0
  80. package/dist/{hasSlotController-c09741c5.js → hasSlotController-DvFw2NdC.js} +1 -1
  81. package/dist/index.d.ts +1 -2
  82. package/dist/index.js +5 -7
  83. package/dist/leu-accordion.js +1 -1
  84. package/dist/leu-button-group.js +1 -1
  85. package/dist/leu-button.js +2 -2
  86. package/dist/leu-checkbox-group.js +1 -1
  87. package/dist/leu-checkbox.js +1 -1
  88. package/dist/leu-chip-group.js +1 -1
  89. package/dist/leu-chip-link.js +1 -1
  90. package/dist/leu-chip-removable.js +1 -1
  91. package/dist/leu-chip-selectable.js +1 -1
  92. package/dist/leu-dialog.js +2 -2
  93. package/dist/leu-dropdown.js +2 -2
  94. package/dist/leu-icon.js +1 -1
  95. package/dist/leu-input.js +1 -1
  96. package/dist/leu-menu-item.js +1 -1
  97. package/dist/leu-menu.js +1 -1
  98. package/dist/leu-pagination.js +2 -2
  99. package/dist/leu-popup.js +1 -1
  100. package/dist/leu-radio-group.js +1 -1
  101. package/dist/leu-radio.js +1 -1
  102. package/dist/leu-range.js +1 -1
  103. package/dist/leu-scroll-top.js +2 -3
  104. package/dist/leu-select.js +2 -2
  105. package/dist/leu-spinner.js +1 -1
  106. package/dist/leu-table.js +2 -2
  107. package/dist/leu-visually-hidden.js +1 -1
  108. package/dist/theme.css +143 -107
  109. package/dist/vscode.html-custom-data.json +3 -32
  110. package/dist/vue/index.d.ts +11 -77
  111. package/dist/web-types.json +246 -242
  112. package/index.js +0 -1
  113. package/package.json +55 -51
  114. package/rollup.config.js +3 -3
  115. package/scripts/generate-component/generate.js +5 -5
  116. package/src/components/accordion/test/accordion.test.js +24 -20
  117. package/src/components/button/Button.js +1 -1
  118. package/src/components/button/stories/button.stories.js +43 -45
  119. package/src/components/button/test/button.test.js +10 -10
  120. package/src/components/button-group/ButtonGroup.js +1 -1
  121. package/src/components/button-group/stories/button-group.stories.js +2 -2
  122. package/src/components/checkbox/checkbox.css +1 -0
  123. package/src/components/chip/ChipSelectable.js +1 -1
  124. package/src/components/chip/stories/chip-group.stories.js +4 -4
  125. package/src/components/chip/test/chip-group.test.js +25 -33
  126. package/src/components/chip/test/chip-link.test.js +5 -5
  127. package/src/components/chip/test/chip-removable.test.js +6 -8
  128. package/src/components/chip/test/chip-selectable.test.js +9 -11
  129. package/src/components/dialog/test/dialog.test.js +1 -1
  130. package/src/components/dropdown/test/dropdown.test.js +12 -13
  131. package/src/components/input/Input.js +25 -17
  132. package/src/components/input/stories/input.stories.js +0 -2
  133. package/src/components/input/test/input.test.js +26 -0
  134. package/src/components/menu/stories/menu-item.stories.js +2 -0
  135. package/src/components/menu/test/menu-item.test.js +3 -2
  136. package/src/components/menu/test/menu.test.js +24 -22
  137. package/src/components/pagination/Pagination.js +1 -1
  138. package/src/components/pagination/pagination.css +1 -1
  139. package/src/components/pagination/stories/pagination.stories.js +2 -1
  140. package/src/components/pagination/test/pagination.test.js +8 -6
  141. package/src/components/popup/Popup.js +4 -4
  142. package/src/components/popup/test/popup.test.js +6 -8
  143. package/src/components/radio/RadioGroup.js +2 -2
  144. package/src/components/range/Range.js +20 -21
  145. package/src/components/select/Select.js +6 -1
  146. package/src/components/select/stories/select.stories.js +1 -1
  147. package/src/components/select/test/select.test.js +18 -16
  148. package/src/components/table/Table.js +4 -4
  149. package/src/components/table/test/table.test.js +3 -2
  150. package/src/components/visually-hidden/test/visually-hidden.test.js +6 -8
  151. package/src/lib/LeuElement.js +2 -2
  152. package/src/lib/hasSlotController.js +1 -1
  153. package/src/styles/style.stories.js +3 -1
  154. package/tsconfig.build.json +4 -3
  155. package/web-dev-server.config.mjs +1 -0
  156. package/web-test-runner.config.mjs +1 -1
  157. package/.github/workflows/test.yml +0 -38
  158. package/.storybook/preview-head.html +0 -2
  159. package/dist/Breadcrumb.d.ts +0 -69
  160. package/dist/Breadcrumb.d.ts.map +0 -1
  161. package/dist/Breadcrumb.js +0 -391
  162. package/dist/LeuElement-b670d77c.d.ts.map +0 -1
  163. package/dist/hasSlotController-c09741c5.d.ts.map +0 -1
  164. package/dist/leu-breadcrumb.d.ts +0 -3
  165. package/dist/leu-breadcrumb.d.ts.map +0 -1
  166. package/dist/leu-breadcrumb.js +0 -17
  167. package/dist/utils-65469421.d.ts +0 -16
  168. package/dist/utils-65469421.d.ts.map +0 -1
  169. package/dist/utils-65469421.js +0 -35
  170. package/src/components/breadcrumb/Breadcrumb.js +0 -324
  171. package/src/components/breadcrumb/breadcrumb.css +0 -98
  172. package/src/components/breadcrumb/leu-breadcrumb.js +0 -5
  173. package/src/components/breadcrumb/stories/breadcrumb.stories.js +0 -73
  174. package/src/components/breadcrumb/test/breadcrumb.test.js +0 -141
@@ -1,7 +1,6 @@
1
1
  import type { DefineComponent } from "vue";
2
2
 
3
3
  import type { LeuAccordion } from "../Accordion.js";
4
- import type { LeuBreadcrumb } from "../Breadcrumb.js";
5
4
  import type { LeuButton } from "../Button.js";
6
5
  import type { LeuButtonGroup, CustomEvent } from "../ButtonGroup.js";
7
6
  import type { LeuCheckbox } from "../Checkbox.js";
@@ -38,27 +37,6 @@ type LeuAccordionProps = {
38
37
  label?: LeuAccordion["label"];
39
38
  };
40
39
 
41
- type LeuBreadcrumbProps = {
42
- /** Object array with { label, href } */
43
- items?: LeuBreadcrumb["items"];
44
- /** invert color on dark background */
45
- inverted?: LeuBreadcrumb["inverted"];
46
- /** */
47
- _hiddenItems?: LeuBreadcrumb["_hiddenItems"];
48
- /** */
49
- _showBackOnly?: LeuBreadcrumb["_showBackOnly"];
50
- /** */
51
- _isRecalculating?: LeuBreadcrumb["_isRecalculating"];
52
- /** */
53
- _isDropdownOpen?: LeuBreadcrumb["_isDropdownOpen"];
54
- /** */
55
- _handleResize?: LeuBreadcrumb["_handleResize"];
56
- /** */
57
- _closeDropdown?: LeuBreadcrumb["_closeDropdown"];
58
- /** */
59
- resizeObserver?: LeuBreadcrumb["resizeObserver"];
60
- };
61
-
62
40
  type LeuButtonProps = {
63
41
  /** */
64
42
  label?: LeuButton["label"];
@@ -90,7 +68,7 @@ type LeuButtonGroupProps = {
90
68
  /** */
91
69
  _items?: LeuButtonGroup["_items"];
92
70
  /** When the value of the group changes by clicking a button */
93
- onInput?: (e: CustomEvent<CustomEvent>) => void;
71
+ oninput?: (e: CustomEvent<CustomEvent>) => void;
94
72
  };
95
73
 
96
74
  type LeuCheckboxProps = {
@@ -130,34 +108,25 @@ If the selectionMode is single, only the first item with the given value is chec
130
108
  };
131
109
 
132
110
  type LeuChipLinkProps = {
133
- /** */
134
- ""?: LeuChipLink[""];
135
111
  /** The size of the chip */
136
112
  size?: LeuChipLink["size"];
137
113
  /** */
138
114
  href?: LeuChipLink["href"];
139
115
  /** */
140
116
  inverted?: LeuChipLink["inverted"];
141
- /** */
142
- ""?: LeuChipLink[""];
143
117
  };
144
118
 
145
119
  type LeuChipRemovableProps = {
146
- /** */
147
- ""?: LeuChipRemovable[""];
148
120
  /** The value of the chip. */
149
121
  value?: LeuChipRemovable["value"];
150
122
  /** */
151
123
  inverted?: LeuChipRemovable["inverted"];
152
- /** */
153
- ""?: LeuChipRemovable[""];
124
+
154
125
  /** Dispatched when the user clicks on the chip */
155
- onRemove?: (e: CustomEvent<never>) => void;
126
+ onremove?: (e: CustomEvent<never>) => void;
156
127
  };
157
128
 
158
129
  type LeuChipSelectableProps = {
159
- /** */
160
- ""?: LeuChipSelectable[""];
161
130
  /** The size of the chip. Not supported for radio variant. */
162
131
  size?: LeuChipSelectable["size"];
163
132
  /** `toggle` or `radio`. Determines if only one or multiple chips can be selected. */
@@ -168,10 +137,9 @@ type LeuChipSelectableProps = {
168
137
  value?: LeuChipSelectable["value"];
169
138
  /** */
170
139
  inverted?: LeuChipSelectable["inverted"];
140
+
171
141
  /** */
172
- ""?: LeuChipSelectable[""];
173
- /** */
174
- onInput?: (e: CustomEvent<CustomEvent>) => void;
142
+ oninput?: (e: CustomEvent<CustomEvent>) => void;
175
143
  };
176
144
 
177
145
  type LeuDialogProps = {
@@ -254,9 +222,9 @@ type LeuInputProps = {
254
222
  /** */
255
223
  valueAsNumber?: LeuInput["valueAsNumber"];
256
224
  /** Dispatched when the value of the input element changes. */
257
- onInput?: (e: CustomEvent<CustomEvent>) => void;
225
+ oninput?: (e: CustomEvent<CustomEvent>) => void;
258
226
  /** Dispatched when the value of the input element changes and the input element loses focus. */
259
- onChange?: (e: CustomEvent<CustomEvent>) => void;
227
+ onchange?: (e: CustomEvent<CustomEvent>) => void;
260
228
  };
261
229
 
262
230
  type LeuMenuProps = {
@@ -301,7 +269,7 @@ type LeuPaginationProps = {
301
269
  /** */
302
270
  _maxPage?: LeuPagination["_maxPage"];
303
271
  /** */
304
- onLeupagechange?: (e: CustomEvent<CustomEvent>) => void;
272
+ "onleu:pagechange"?: (e: CustomEvent<CustomEvent>) => void;
305
273
  };
306
274
 
307
275
  type LeuPopupProps = {
@@ -474,41 +442,6 @@ export type CustomElements = {
474
442
  */
475
443
  "leu-accordion": DefineComponent<LeuAccordionProps>;
476
444
 
477
- /**
478
- * A Breadcrumb Navigation.
479
- *
480
- * The breadcrumbs can be displayed in two different layouts.
481
- * Only the back link (the last item / parent of the current page)
482
- * is displayed when…
483
- * - … the width of the container is smaller
484
- * than the BACK_ONLY_BREAKPOINT.
485
- * - … less then two breadcrumb items could be displayed
486
- * without overflowing the container.
487
- *
488
- * Otherwise as many items as possible are displayed in an inline list
489
- * without overflowing the container. The remaining items are displayed
490
- * in a dropdown menu.
491
- *
492
- * In order to determine the exact numbers of items that have to be
493
- * hidden inside the dropdown, all of them have to be rendered first.
494
- * 1. Render all items
495
- * 2. Calculate (measure) the number of items that can be displayed
496
- * without overflowing the container.
497
- * 3. Updating the state (_hiddeItems) which will trigger a rerender
498
- * 4. Render the items again with the new state.
499
- *
500
- * This results in multiple updates scheduled one after another. Lit
501
- * will also print a waring in the console beacause of that.
502
- * It's no a nice behaviour but the only one that works without
503
- * having duplicate and hidden markup to derive the sizes from that.
504
- * ---
505
- *
506
- *
507
- * ### **Methods:**
508
- * - **renderDropdown(): __** - Render the dropdown menu
509
- */
510
- "leu-breadcrumb": DefineComponent<LeuBreadcrumbProps>;
511
-
512
445
  /**
513
446
  *
514
447
  * ---
@@ -593,7 +526,7 @@ export type CustomElements = {
593
526
  *
594
527
  *
595
528
  * ### **Events:**
596
- * - **input** - undefined
529
+ * - **input**
597
530
  *
598
531
  * ### **Methods:**
599
532
  * - **getValue(): _string_** - Returns the value of the chip. If `value` is not set, it will return the text content
@@ -647,6 +580,7 @@ export type CustomElements = {
647
580
  * e.g.
648
581
  * `tooLong(this.maxlength)`
649
582
  * This way the framework user can create reasonable validation messages
583
+ * - **checkValidity(): _boolean_** - Check input validation
650
584
  * - **renderErrorMessages(): _TemplateResult | nothing_** - Creates an error list with an item for the given validity state.
651
585
  */
652
586
  "leu-input": DefineComponent<LeuInputProps>;
@@ -677,7 +611,7 @@ export type CustomElements = {
677
611
  *
678
612
  *
679
613
  * ### **Events:**
680
- * - **leu:pagechange** - undefined
614
+ * - **leu:pagechange**
681
615
  */
682
616
  "leu-pagination": DefineComponent<LeuPaginationProps>;
683
617