@statistikzh/leu 0.23.0 → 0.24.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 (97) hide show
  1. package/.github/workflows/ci.yml +8 -8
  2. package/.github/workflows/deploy-github-pages.yaml +2 -2
  3. package/.github/workflows/publish.yml +37 -0
  4. package/.github/workflows/release-please.yml +1 -19
  5. package/.release-please-manifest.json +1 -1
  6. package/CHANGELOG.md +26 -0
  7. package/dist/Accordion.js +1 -1
  8. package/dist/Button.js +1 -1
  9. package/dist/ButtonGroup.js +1 -1
  10. package/dist/ChartWrapper.js +1 -1
  11. package/dist/Checkbox.js +1 -1
  12. package/dist/CheckboxGroup.js +1 -1
  13. package/dist/Chip.js +1 -1
  14. package/dist/ChipGroup.js +1 -1
  15. package/dist/ChipLink.js +1 -1
  16. package/dist/ChipRemovable.js +1 -1
  17. package/dist/ChipSelectable.js +1 -1
  18. package/dist/Dialog.js +1 -1
  19. package/dist/Dropdown.js +1 -1
  20. package/dist/FileInput.d.ts +0 -1
  21. package/dist/FileInput.js +1 -35
  22. package/dist/Icon.js +1 -1
  23. package/dist/Input.js +1 -1
  24. package/dist/{LeuElement-CWseJvWv.js → LeuElement-jrR2M5pZ.js} +1 -1
  25. package/dist/Menu.js +1 -1
  26. package/dist/MenuItem.js +1 -1
  27. package/dist/Message.js +1 -1
  28. package/dist/Pagination.js +1 -1
  29. package/dist/Placeholder.js +1 -1
  30. package/dist/Popup.js +1 -1
  31. package/dist/ProgressBar.js +1 -1
  32. package/dist/Radio.js +1 -1
  33. package/dist/RadioGroup.js +1 -1
  34. package/dist/Range.d.ts +83 -20
  35. package/dist/Range.js +276 -73
  36. package/dist/ScrollTop.js +2 -25
  37. package/dist/Select.js +1 -1
  38. package/dist/Spinner.js +1 -1
  39. package/dist/Table.js +1 -1
  40. package/dist/Tag.js +1 -1
  41. package/dist/VisuallyHidden.js +1 -1
  42. package/dist/components/file-input/FileInput.d.ts +2 -2
  43. package/dist/components/file-input/FileInput.d.ts.map +1 -1
  44. package/dist/components/range/Range.d.ts +84 -20
  45. package/dist/components/range/Range.d.ts.map +1 -1
  46. package/dist/components/range/stories/range.stories.d.ts +231 -0
  47. package/dist/components/range/stories/range.stories.d.ts.map +1 -0
  48. package/dist/components/range/test/range.test.d.ts.map +1 -1
  49. package/dist/index.js +2 -2
  50. package/dist/leu-accordion.js +1 -1
  51. package/dist/leu-button-group.js +1 -1
  52. package/dist/leu-button.js +1 -1
  53. package/dist/leu-chart-wrapper.js +1 -1
  54. package/dist/leu-checkbox-group.js +1 -1
  55. package/dist/leu-checkbox.js +1 -1
  56. package/dist/leu-chip-group.js +1 -1
  57. package/dist/leu-chip-link.js +1 -1
  58. package/dist/leu-chip-removable.js +1 -1
  59. package/dist/leu-chip-selectable.js +1 -1
  60. package/dist/leu-dialog.js +1 -1
  61. package/dist/leu-dropdown.js +1 -1
  62. package/dist/leu-file-input.d.ts +0 -1
  63. package/dist/leu-file-input.js +1 -35
  64. package/dist/leu-icon.js +1 -1
  65. package/dist/leu-input.js +1 -1
  66. package/dist/leu-menu-item.js +1 -1
  67. package/dist/leu-menu.js +1 -1
  68. package/dist/leu-message.js +1 -1
  69. package/dist/leu-pagination.js +1 -1
  70. package/dist/leu-placeholder.js +1 -1
  71. package/dist/leu-popup.js +1 -1
  72. package/dist/leu-progress-bar.js +1 -1
  73. package/dist/leu-radio-group.js +1 -1
  74. package/dist/leu-radio.js +1 -1
  75. package/dist/leu-range.js +3 -1
  76. package/dist/leu-scroll-top.js +2 -1
  77. package/dist/leu-select.js +1 -1
  78. package/dist/leu-spinner.js +1 -1
  79. package/dist/leu-table.js +1 -1
  80. package/dist/leu-tag.js +1 -1
  81. package/dist/leu-visually-hidden.js +1 -1
  82. package/dist/lib/utils.d.ts +10 -3
  83. package/dist/lib/utils.d.ts.map +1 -1
  84. package/dist/utils-DBGsNSJW.js +33 -0
  85. package/dist/vscode.html-custom-data.json +142 -89
  86. package/dist/vue/index.d.ts +132 -107
  87. package/dist/web-types.json +269 -169
  88. package/package.json +6 -2
  89. package/src/components/file-input/FileInput.ts +2 -2
  90. package/src/components/range/Range.ts +257 -85
  91. package/src/components/range/range.css +48 -1
  92. package/src/components/range/stories/range.stories.ts +185 -0
  93. package/src/components/range/test/range.test.ts +210 -6
  94. package/src/lib/utils.ts +13 -3
  95. package/dist/components/range/stories/range-slider.stories.d.ts +0 -26
  96. package/dist/components/range/stories/range-slider.stories.d.ts.map +0 -1
  97. package/src/components/range/stories/range-slider.stories.ts +0 -142
@@ -1,20 +1,20 @@
1
1
  import type { DefineComponent } from "vue";
2
2
 
3
3
  import type { LeuAccordion } from "../Accordion.js";
4
+ import type { LeuButtonGroup } from "../ButtonGroup.js";
4
5
  import type { LeuButton } from "../Button.js";
5
6
  import type { LeuChartWrapper } from "../ChartWrapper.js";
6
- import type { LeuButtonGroup } from "../ButtonGroup.js";
7
- import type { LeuCheckbox } from "../Checkbox.js";
8
- import type { LeuCheckboxGroup } from "../CheckboxGroup.js";
9
- import type { LeuDropdown } from "../Dropdown.js";
10
7
  import type { LeuDialog } from "../Dialog.js";
11
8
  import type { LeuChipGroup } from "../ChipGroup.js";
12
9
  import type { LeuChipLink } from "../ChipLink.js";
13
10
  import type { LeuChipRemovable } from "../ChipRemovable.js";
14
11
  import type { LeuChipSelectable, CustomEvent } from "../ChipSelectable.js";
12
+ import type { LeuCheckbox } from "../Checkbox.js";
13
+ import type { LeuCheckboxGroup } from "../CheckboxGroup.js";
14
+ import type { LeuDropdown } from "../Dropdown.js";
15
15
  import type { LeuFileInput, CustomEvent } from "../FileInput.js";
16
- import type { LeuInput, CustomEvent } from "../Input.js";
17
16
  import type { LeuIcon } from "../Icon.js";
17
+ import type { LeuInput, CustomEvent } from "../Input.js";
18
18
  import type { LeuMenu } from "../Menu.js";
19
19
  import type { LeuMenuItem } from "../MenuItem.js";
20
20
  import type { LeuMessage, CustomEvent } from "../Message.js";
@@ -24,7 +24,7 @@ import type { LeuPopup } from "../Popup.js";
24
24
  import type { LeuProgressBar } from "../ProgressBar.js";
25
25
  import type { LeuRadio } from "../Radio.js";
26
26
  import type { LeuRadioGroup } from "../RadioGroup.js";
27
- import type { LeuRange } from "../Range.js";
27
+ import type { LeuRange, CustomEvent } from "../Range.js";
28
28
  import type { LeuScrollTop } from "../ScrollTop.js";
29
29
  import type { LeuSelect } from "../Select.js";
30
30
  import type { LeuSpinner } from "../Spinner.js";
@@ -43,6 +43,13 @@ type LeuAccordionProps = {
43
43
  label?: LeuAccordion["label"];
44
44
  };
45
45
 
46
+ type LeuButtonGroupProps = {
47
+ /** The value of the currently selected (active) button */
48
+ value?: LeuButtonGroup["value"];
49
+ /** When the value of the group changes by clicking a button */
50
+ oninput?: (e: CustomEvent<never>) => void;
51
+ };
52
+
46
53
  type LeuButtonProps = {
47
54
  /** `aria-label` of the underlying button elements.
48
55
  Use it to provide a label when only an icon is visible. */
@@ -82,42 +89,6 @@ When set to `true`, a spinner will be shown in the chart container. */
82
89
  hasSlotController?: LeuChartWrapper["hasSlotController"];
83
90
  };
84
91
 
85
- type LeuButtonGroupProps = {
86
- /** The value of the currently selected (active) button */
87
- value?: LeuButtonGroup["value"];
88
- /** When the value of the group changes by clicking a button */
89
- oninput?: (e: CustomEvent<never>) => void;
90
- };
91
-
92
- type LeuCheckboxProps = {
93
- /** */
94
- checked?: LeuCheckbox["checked"];
95
- /** */
96
- disabled?: LeuCheckbox["disabled"];
97
- /** */
98
- value?: LeuCheckbox["value"];
99
- /** */
100
- name?: LeuCheckbox["name"];
101
- };
102
-
103
- type LeuCheckboxGroupProps = {
104
- /** Defines how the checkboxes should be aligned. */
105
- orientation?: LeuCheckboxGroup["orientation"];
106
- /** The label of the checkbox group */
107
- label?: LeuCheckboxGroup["label"];
108
- /** */
109
- value?: LeuCheckboxGroup["value"];
110
- };
111
-
112
- type LeuDropdownProps = {
113
- /** */
114
- label?: LeuDropdown["label"];
115
- /** */
116
- expanded?: LeuDropdown["expanded"];
117
- /** */
118
- inverted?: LeuDropdown["inverted"];
119
- };
120
-
121
92
  type LeuDialogProps = {
122
93
  /** */
123
94
  label?: LeuDialog["label"];
@@ -176,6 +147,35 @@ type LeuChipSelectableProps = {
176
147
  oninput?: (e: CustomEvent<CustomEvent>) => void;
177
148
  };
178
149
 
150
+ type LeuCheckboxProps = {
151
+ /** */
152
+ checked?: LeuCheckbox["checked"];
153
+ /** */
154
+ disabled?: LeuCheckbox["disabled"];
155
+ /** */
156
+ value?: LeuCheckbox["value"];
157
+ /** */
158
+ name?: LeuCheckbox["name"];
159
+ };
160
+
161
+ type LeuCheckboxGroupProps = {
162
+ /** Defines how the checkboxes should be aligned. */
163
+ orientation?: LeuCheckboxGroup["orientation"];
164
+ /** The label of the checkbox group */
165
+ label?: LeuCheckboxGroup["label"];
166
+ /** */
167
+ value?: LeuCheckboxGroup["value"];
168
+ };
169
+
170
+ type LeuDropdownProps = {
171
+ /** */
172
+ label?: LeuDropdown["label"];
173
+ /** */
174
+ expanded?: LeuDropdown["expanded"];
175
+ /** */
176
+ inverted?: LeuDropdown["inverted"];
177
+ };
178
+
179
179
  type LeuFileInputProps = {
180
180
  /** */
181
181
  label?: LeuFileInput["label"];
@@ -203,6 +203,11 @@ type LeuFileInputProps = {
203
203
  onchange?: (e: CustomEvent<CustomEvent>) => void;
204
204
  };
205
205
 
206
+ type LeuIconProps = {
207
+ /** The name of the icon to display. */
208
+ name?: LeuIcon["name"];
209
+ };
210
+
206
211
  type LeuInputProps = {
207
212
  /** Disables the input element. */
208
213
  disabled?: LeuInput["disabled"];
@@ -254,11 +259,6 @@ type LeuInputProps = {
254
259
  onchange?: (e: CustomEvent<CustomEvent>) => void;
255
260
  };
256
261
 
257
- type LeuIconProps = {
258
- /** The name of the icon to display. */
259
- name?: LeuIcon["name"];
260
- };
261
-
262
262
  type LeuMenuProps = {
263
263
  /** This has only an effect when the role is 'menu'. It defines which role the menu items will get. Default is 'none'. */
264
264
  selects?: LeuMenu["selects"];
@@ -377,25 +377,45 @@ type LeuRadioGroupProps = {
377
377
  };
378
378
 
379
379
  type LeuRangeProps = {
380
- /** */
380
+ /** The default value of the range slider.
381
+ String input is parsed as a comma-separated list of numbers. */
381
382
  value?: LeuRange["defaultValue"];
382
- /** */
383
+ /** The minimum value of the range slider. */
383
384
  min?: LeuRange["min"];
384
- /** */
385
+ /** The maximum value of the range slider. */
385
386
  max?: LeuRange["max"];
386
- /** */
387
+ /** The step size of the range slider. */
387
388
  step?: LeuRange["step"];
388
389
  /** */
389
390
  name?: LeuRange["name"];
390
- /** */
391
+ /** The label of the range slider. */
391
392
  label?: LeuRange["label"];
392
- /** */
393
+ /** Whether to hide the label of the range slider.
394
+ If true, the label will still be available for screen readers
395
+ and is only visually hidden. */
396
+ "hide-label"?: LeuRange["hideLabel"];
397
+ /** Whether the range slider is disabled. */
393
398
  disabled?: LeuRange["disabled"];
394
- /** */
399
+ /** Whether to use a range with two handles. */
395
400
  multiple?: LeuRange["multiple"];
396
- /** Sets the value of the underlying input element(s).
397
- The value has to be an array if "multiple" range is used.
398
- Otherwise it has to be a string. */
401
+ /** Wheter to show tick marks below the range slider.
402
+ One tick mark per step will be rendered. */
403
+ "show-ticks"?: LeuRange["showTicks"];
404
+ /** Whether to show the min and max labels below the range slider. */
405
+ "show-range-labels"?: LeuRange["showRangeLabels"];
406
+ /** A prefix to display before the value in the output element(s).
407
+ Is ignored if a custom valueFormatter is provided. */
408
+ prefix?: LeuRange["prefix"];
409
+ /** A suffix to display after the value in the output element(s).
410
+ Is ignored if a custom valueFormatter is provided. */
411
+ suffix?: LeuRange["suffix"];
412
+ /** A custom function to format the value displayed in the output element(s).
413
+ If provided, the prefix and suffix properties will be ignored. */
414
+ valueFormatter?: LeuRange["valueFormatter"];
415
+ /** The value of the range slider.
416
+ String input is parsed as a comma-separated list of numbers.
417
+ In multiple mode, if only a single value is provided, the second handle will be set to the minimum value.
418
+ In single mode, only the first value will be used. */
399
419
  value?: LeuRange["value"];
400
420
  /** */
401
421
  valueAsArray?: LeuRange["valueAsArray"];
@@ -403,6 +423,8 @@ Otherwise it has to be a string. */
403
423
  valueLow?: LeuRange["valueLow"];
404
424
  /** */
405
425
  valueHigh?: LeuRange["valueHigh"];
426
+ /** */
427
+ oninput?: (e: CustomEvent<CustomEvent>) => void;
406
428
  };
407
429
 
408
430
  type LeuScrollTopProps = {
@@ -492,32 +514,6 @@ export type CustomElements = {
492
514
  */
493
515
  "leu-accordion": DefineComponent<LeuAccordionProps>;
494
516
 
495
- /**
496
- *
497
- * ---
498
- *
499
- *
500
- * ### **Slots:**
501
- * - **before** - The icon to display before the label
502
- * - **after** - The icon to display after the label
503
- * - _default_ - The label of the button or the icon if no label is set
504
- */
505
- "leu-button": DefineComponent<LeuButtonProps>;
506
-
507
- /**
508
- * A wrapper element for charts.
509
- * ---
510
- *
511
- *
512
- * ### **Slots:**
513
- * - **title** - The title of the chart. Use a heading tag (h2-4) depending on your context.
514
- * - **description** - A description of the chart. Content is wrapped in a `<p>` tag by the component.
515
- * - **chart** - The actual chart
516
- * - **caption** - A caption for the chart, e.g. a source or explanation of the data.
517
- * - **download** - A download button or dropdown to export the chart in different formats.
518
- */
519
- "leu-chart-wrapper": DefineComponent<LeuChartWrapperProps>;
520
-
521
517
  /**
522
518
  * A radio input-like button group component.
523
519
  * It allows only one button to be active at a time.
@@ -532,29 +528,31 @@ export type CustomElements = {
532
528
  */
533
529
  "leu-button-group": DefineComponent<LeuButtonGroupProps>;
534
530
 
535
- /**
536
- *
537
- * ---
538
- *
539
- */
540
- "leu-checkbox": DefineComponent<LeuCheckboxProps>;
541
-
542
531
  /**
543
532
  *
544
533
  * ---
545
534
  *
546
535
  *
547
536
  * ### **Slots:**
548
- * - _default_ - Place the checkboxes inside the default slot.
537
+ * - **before** - The icon to display before the label
538
+ * - **after** - The icon to display after the label
539
+ * - _default_ - The label of the button or the icon if no label is set
549
540
  */
550
- "leu-checkbox-group": DefineComponent<LeuCheckboxGroupProps>;
541
+ "leu-button": DefineComponent<LeuButtonProps>;
551
542
 
552
543
  /**
553
- *
544
+ * A wrapper element for charts.
554
545
  * ---
555
546
  *
547
+ *
548
+ * ### **Slots:**
549
+ * - **title** - The title of the chart. Use a heading tag (h2-4) depending on your context.
550
+ * - **description** - A description of the chart. Content is wrapped in a `<p>` tag by the component.
551
+ * - **chart** - The actual chart
552
+ * - **caption** - A caption for the chart, e.g. a source or explanation of the data.
553
+ * - **download** - A download button or dropdown to export the chart in different formats.
556
554
  */
557
- "leu-dropdown": DefineComponent<LeuDropdownProps>;
555
+ "leu-chart-wrapper": DefineComponent<LeuChartWrapperProps>;
558
556
 
559
557
  /**
560
558
  *
@@ -618,6 +616,30 @@ export type CustomElements = {
618
616
  */
619
617
  "leu-chip-selectable": DefineComponent<LeuChipSelectableProps>;
620
618
 
619
+ /**
620
+ *
621
+ * ---
622
+ *
623
+ */
624
+ "leu-checkbox": DefineComponent<LeuCheckboxProps>;
625
+
626
+ /**
627
+ *
628
+ * ---
629
+ *
630
+ *
631
+ * ### **Slots:**
632
+ * - _default_ - Place the checkboxes inside the default slot.
633
+ */
634
+ "leu-checkbox-group": DefineComponent<LeuCheckboxGroupProps>;
635
+
636
+ /**
637
+ *
638
+ * ---
639
+ *
640
+ */
641
+ "leu-dropdown": DefineComponent<LeuDropdownProps>;
642
+
621
643
  /**
622
644
  *
623
645
  * ---
@@ -629,6 +651,19 @@ export type CustomElements = {
629
651
  */
630
652
  "leu-file-input": DefineComponent<LeuFileInputProps>;
631
653
 
654
+ /**
655
+ * A component to render all defined zhWeb icons.
656
+ * The `fill` of the icon is set to `currentColor` and
657
+ * can be overriden by setting the css `color` property.
658
+ * If the icon name is not found, a placeholder will be displayed.
659
+ * ---
660
+ *
661
+ *
662
+ * ### **CSS Properties:**
663
+ * - **--leu-icon-size** - The size of the icon. _(default: undefined)_
664
+ */
665
+ "leu-icon": DefineComponent<LeuIconProps>;
666
+
632
667
  /**
633
668
  * A text input element.
634
669
  * ---
@@ -652,19 +687,6 @@ export type CustomElements = {
652
687
  */
653
688
  "leu-input": DefineComponent<LeuInputProps>;
654
689
 
655
- /**
656
- * A component to render all defined zhWeb icons.
657
- * The `fill` of the icon is set to `currentColor` and
658
- * can be overriden by setting the css `color` property.
659
- * If the icon name is not found, a placeholder will be displayed.
660
- * ---
661
- *
662
- *
663
- * ### **CSS Properties:**
664
- * - **--leu-icon-size** - The size of the icon. _(default: undefined)_
665
- */
666
- "leu-icon": DefineComponent<LeuIconProps>;
667
-
668
690
  /**
669
691
  *
670
692
  * ---
@@ -760,6 +782,9 @@ export type CustomElements = {
760
782
  * ---
761
783
  *
762
784
  *
785
+ * ### **Events:**
786
+ * - **input**
787
+ *
763
788
  * ### **Methods:**
764
789
  *
765
790
  */