@statistikzh/leu 0.14.4 → 0.15.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 (148) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +17 -0
  3. package/dist/Accordion.js +2 -30
  4. package/dist/Button.d.ts +56 -68
  5. package/dist/Button.js +74 -52
  6. package/dist/ButtonGroup.d.ts +9 -9
  7. package/dist/ButtonGroup.js +30 -20
  8. package/dist/ChartWrapper.d.ts +38 -0
  9. package/dist/ChartWrapper.js +164 -0
  10. package/dist/Checkbox.d.ts +6 -21
  11. package/dist/Checkbox.js +17 -9
  12. package/dist/CheckboxGroup.d.ts +13 -14
  13. package/dist/CheckboxGroup.js +18 -11
  14. package/dist/Chip.js +1 -1
  15. package/dist/ChipGroup.js +1 -1
  16. package/dist/ChipLink.js +1 -1
  17. package/dist/ChipRemovable.js +1 -1
  18. package/dist/ChipSelectable.js +1 -1
  19. package/dist/Dialog.js +1 -1
  20. package/dist/Dropdown.js +3 -1
  21. package/dist/Icon.js +1 -1
  22. package/dist/Input.js +1 -1
  23. package/dist/{LeuElement-x8UlIDDl.js → LeuElement-B84x5CPL.js} +1 -1
  24. package/dist/Menu.js +1 -1
  25. package/dist/MenuItem.js +1 -1
  26. package/dist/Pagination.d.ts +40 -28
  27. package/dist/Pagination.js +39 -14
  28. package/dist/Placeholder.d.ts +27 -0
  29. package/dist/Placeholder.js +90 -0
  30. package/dist/Popup.js +1 -1
  31. package/dist/Radio.d.ts +6 -21
  32. package/dist/Radio.js +17 -9
  33. package/dist/RadioGroup.d.ts +28 -23
  34. package/dist/RadioGroup.js +29 -16
  35. package/dist/Range.js +1 -1
  36. package/dist/ScrollTop.d.ts +0 -1
  37. package/dist/ScrollTop.js +3 -1
  38. package/dist/Select.js +3 -1
  39. package/dist/Spinner.js +1 -1
  40. package/dist/Table.d.ts +0 -1
  41. package/dist/Table.js +3 -1
  42. package/dist/VisuallyHidden.js +1 -1
  43. package/dist/_tslib-CNEFicEt.js +30 -0
  44. package/dist/components/button/Button.d.ts +55 -67
  45. package/dist/components/button/Button.d.ts.map +1 -1
  46. package/dist/components/button/stories/button.stories.d.ts.map +1 -1
  47. package/dist/components/button-group/ButtonGroup.d.ts +9 -9
  48. package/dist/components/button-group/ButtonGroup.d.ts.map +1 -1
  49. package/dist/components/chart-wrapper/ChartWrapper.d.ts +34 -0
  50. package/dist/components/chart-wrapper/ChartWrapper.d.ts.map +1 -0
  51. package/dist/components/chart-wrapper/leu-chart-wrapper.d.ts +3 -0
  52. package/dist/components/chart-wrapper/leu-chart-wrapper.d.ts.map +1 -0
  53. package/dist/components/chart-wrapper/stories/chart-wrapper.stories.d.ts +47 -0
  54. package/dist/components/chart-wrapper/stories/chart-wrapper.stories.d.ts.map +1 -0
  55. package/dist/components/chart-wrapper/test/chart-wrapper.test.d.ts +2 -0
  56. package/dist/components/chart-wrapper/test/chart-wrapper.test.d.ts.map +1 -0
  57. package/dist/components/checkbox/Checkbox.d.ts +6 -21
  58. package/dist/components/checkbox/Checkbox.d.ts.map +1 -1
  59. package/dist/components/checkbox/CheckboxGroup.d.ts +13 -14
  60. package/dist/components/checkbox/CheckboxGroup.d.ts.map +1 -1
  61. package/dist/components/icon/stories/icon.stories.d.ts +10 -0
  62. package/dist/components/icon/stories/icon.stories.d.ts.map +1 -1
  63. package/dist/components/pagination/Pagination.d.ts +40 -27
  64. package/dist/components/pagination/Pagination.d.ts.map +1 -1
  65. package/dist/components/pagination/stories/pagination.stories.d.ts +10 -2
  66. package/dist/components/pagination/stories/pagination.stories.d.ts.map +1 -1
  67. package/dist/components/placeholder/Placeholder.d.ts +23 -0
  68. package/dist/components/placeholder/Placeholder.d.ts.map +1 -0
  69. package/dist/components/placeholder/leu-placeholder.d.ts +3 -0
  70. package/dist/components/placeholder/leu-placeholder.d.ts.map +1 -0
  71. package/dist/components/placeholder/stories/placeholder.stories.d.ts +27 -0
  72. package/dist/components/placeholder/stories/placeholder.stories.d.ts.map +1 -0
  73. package/dist/components/placeholder/test/placeholder.test.d.ts +2 -0
  74. package/dist/components/placeholder/test/placeholder.test.d.ts.map +1 -0
  75. package/dist/components/radio/Radio.d.ts +6 -21
  76. package/dist/components/radio/Radio.d.ts.map +1 -1
  77. package/dist/components/radio/RadioGroup.d.ts +28 -23
  78. package/dist/components/radio/RadioGroup.d.ts.map +1 -1
  79. package/dist/index.d.ts +1 -0
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js +5 -2
  82. package/dist/leu-accordion.js +2 -1
  83. package/dist/leu-button-group.js +8 -1
  84. package/dist/leu-button.d.ts +0 -1
  85. package/dist/leu-button.js +3 -1
  86. package/dist/leu-chart-wrapper.d.ts +6 -0
  87. package/dist/leu-chart-wrapper.js +11 -0
  88. package/dist/leu-checkbox-group.js +5 -1
  89. package/dist/leu-checkbox.js +3 -1
  90. package/dist/leu-chip-group.js +1 -1
  91. package/dist/leu-chip-link.js +1 -1
  92. package/dist/leu-chip-removable.js +1 -1
  93. package/dist/leu-chip-selectable.js +1 -1
  94. package/dist/leu-dialog.js +1 -1
  95. package/dist/leu-dropdown.js +3 -1
  96. package/dist/leu-icon.js +1 -1
  97. package/dist/leu-input.js +1 -1
  98. package/dist/leu-menu-item.js +1 -1
  99. package/dist/leu-menu.js +1 -1
  100. package/dist/leu-pagination.d.ts +0 -1
  101. package/dist/leu-pagination.js +3 -1
  102. package/dist/leu-placeholder.d.ts +4 -0
  103. package/dist/leu-placeholder.js +7 -0
  104. package/dist/leu-popup.js +1 -1
  105. package/dist/leu-radio-group.js +4 -1
  106. package/dist/leu-radio.js +3 -1
  107. package/dist/leu-range.js +1 -1
  108. package/dist/leu-scroll-top.d.ts +0 -1
  109. package/dist/leu-scroll-top.js +3 -1
  110. package/dist/leu-select.js +3 -1
  111. package/dist/leu-spinner.js +1 -1
  112. package/dist/leu-table.d.ts +0 -1
  113. package/dist/leu-table.js +3 -1
  114. package/dist/leu-visually-hidden.js +1 -1
  115. package/dist/lib/a11y.d.ts +2 -2
  116. package/dist/theme.css +18 -18
  117. package/dist/vscode.html-custom-data.json +95 -25
  118. package/dist/vue/index.d.ts +86 -46
  119. package/dist/web-types.json +222 -80
  120. package/package.json +1 -1
  121. package/release-please-config.json +1 -2
  122. package/scripts/generate-component/templates/stories/[name].stories.ts +17 -4
  123. package/scripts/postcss-leu-font-styles.cjs +10 -10
  124. package/src/components/button/Button.ts +95 -79
  125. package/src/components/button/stories/button.stories.ts +5 -6
  126. package/src/components/button-group/ButtonGroup.ts +18 -13
  127. package/src/components/chart-wrapper/ChartWrapper.ts +78 -0
  128. package/src/components/chart-wrapper/chart-wrapper.css +87 -0
  129. package/src/components/chart-wrapper/leu-chart-wrapper.ts +5 -0
  130. package/src/components/chart-wrapper/stories/chart-wrapper.stories.ts +58 -0
  131. package/src/components/chart-wrapper/test/chart-wrapper.test.ts +77 -0
  132. package/src/components/checkbox/Checkbox.ts +13 -15
  133. package/src/components/checkbox/CheckboxGroup.ts +20 -16
  134. package/src/components/icon/stories/icon.stories.ts +27 -0
  135. package/src/components/pagination/Pagination.ts +45 -32
  136. package/src/components/pagination/stories/pagination.stories.ts +28 -17
  137. package/src/components/placeholder/Placeholder.ts +33 -0
  138. package/src/components/placeholder/leu-placeholder.ts +5 -0
  139. package/src/components/placeholder/placeholder.css +59 -0
  140. package/src/components/placeholder/stories/placeholder.stories.ts +34 -0
  141. package/src/components/placeholder/test/placeholder.test.ts +31 -0
  142. package/src/components/radio/Radio.ts +13 -15
  143. package/src/components/radio/RadioGroup.ts +42 -28
  144. package/src/docs/contributing.mdx +1 -1
  145. package/src/index.ts +1 -0
  146. package/src/lib/a11y.ts +2 -2
  147. package/src/styles/theme.css +89 -1
  148. package/src/styles/custom-properties.css +0 -89
@@ -92,7 +92,7 @@ window.customElements.define("leu-input", LeuInput)
92
92
  ### Scoped styles
93
93
 
94
94
  All CSS declarations have to live inside a custom element. This way we ensure that the styles won't interfere with the environment they're loaded into.
95
- Styles that are shared between components should be defined as global custom properties inside the `styles/custom-properties.css`.
95
+ Styles that are shared between components should be defined as global custom properties inside the `styles/theme.css`.
96
96
  When a global custom property is used inside a component it could be a good practice to assign them to a local custom property with a semantic naming.
97
97
  This only make a sense when the component has a certain complexity and the global custom property are used multiple times.
98
98
 
package/src/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from "./components/accordion/Accordion.js"
2
2
  export * from "./components/button/Button.js"
3
3
  export * from "./components/button-group/ButtonGroup.js"
4
+ export * from "./components/chart-wrapper/ChartWrapper.js"
4
5
  export * from "./components/checkbox/Checkbox.js"
5
6
  export * from "./components/checkbox/CheckboxGroup.js"
6
7
  export * from "./components/chip/exports.js"
package/src/lib/a11y.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * All roles that are associated with a aria-checked attribute
3
- * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked
3
+ * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked
4
4
  */
5
5
  export const ARIA_CHECKED_ROLES = [
6
6
  "checkbox",
@@ -13,7 +13,7 @@ export const ARIA_CHECKED_ROLES = [
13
13
 
14
14
  /**
15
15
  * All roles that are associated with a aria-selected attribute
16
- * @link https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected
16
+ * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected
17
17
  */
18
18
  export const ARIA_SELECTED_ROLES = [
19
19
  "gridcell",
@@ -1 +1,89 @@
1
- @import url("./custom-properties.css");
1
+ @import url("./custom-media.css");
2
+
3
+ :root,
4
+ :host {
5
+ --leu-color-black-100: #000;
6
+ --leu-color-black-80: #333;
7
+ --leu-color-black-60: #666;
8
+ --leu-color-black-40: #949494;
9
+ --leu-color-black-20: #ccc;
10
+ --leu-color-black-10: #f0f0f0;
11
+ --leu-color-black-5: #f7f7f7;
12
+ --leu-color-black-0: #fffffe;
13
+
14
+ --leu-color-black-transp-80: rgb(0 0 0 / 80%);
15
+ --leu-color-black-transp-60: rgb(0 0 0 / 60%);
16
+ --leu-color-black-transp-40: rgb(0 0 0 / 40%);
17
+ --leu-color-black-transp-20: rgb(0 0 0 / 20%);
18
+ --leu-color-black-transp-10: rgb(0 0 0 / 10%);
19
+ --leu-color-black-transp-5: rgb(0 0 0 / 5%);
20
+
21
+ --leu-color-white-transp-90: rgb(255 255 255 / 90%);
22
+ --leu-color-white-transp-70: rgb(255 255 255 / 70%);
23
+ --leu-color-white-transp-40: rgb(255 255 255 / 40%);
24
+ --leu-color-white-transp-10: rgb(255 255 255 / 10%);
25
+
26
+ --leu-color-accent-blue: #0076bd;
27
+ --leu-color-accent-darkblue: #00407c;
28
+ --leu-color-accent-turquoise: #00797b;
29
+ --leu-color-accent-green: #1a7f1f;
30
+ --leu-color-accent-bordeaux: #b01657;
31
+ --leu-color-accent-magenta: #d40053;
32
+ --leu-color-accent-violet: #7f3da7;
33
+ --leu-color-accent-gray: var(--leu-color-black-60);
34
+
35
+ --leu-color-accent-blue-soft: #edf5fa;
36
+ --leu-color-accent-darkblue-soft: #e0e8ee;
37
+ --leu-color-accent-turquoise-soft: #e8f3f2;
38
+ --leu-color-accent-green-soft: #ebf6eb;
39
+ --leu-color-accent-bordeaux-soft: #f6e3ea;
40
+ --leu-color-accent-magenta-soft: #fcedf3;
41
+ --leu-color-accent-violet-soft: #ece2f1;
42
+ --leu-color-accent-gray-soft: var(--leu-color-black-10);
43
+
44
+ --leu-color-func-cyan: #009ee0;
45
+ --leu-color-func-red: #d93c1a;
46
+ --leu-color-func-green: #1a7f1f;
47
+
48
+ /* stylelint-disable value-keyword-case */
49
+ --leu-font-family-regular:
50
+ "InterRegular", "HelveticaNowRegular", "Helvetica", sans-serif;
51
+ --leu-font-family-black:
52
+ "InterBlack", "HelveticaNowBlack", "Arial Black", "Helvetica", sans-serif;
53
+ /* stylelint-enable value-keyword-case */
54
+
55
+ --leu-box-shadow-short: 0px 0px 2px var(--leu-color-black-transp-40);
56
+ --leu-box-shadow-regular: 0px 0px 16px var(--leu-color-black-transp-20);
57
+ --leu-box-shadow-long: 0px 0px 80px var(--leu-color-black-transp-20);
58
+
59
+ --leu-z-index-popup: 100;
60
+
61
+ @leu-font-styles './font-definitions.json';
62
+ --leu-t-font-feature-settings: "ss07", "ss08", "cv03", "cv04", "cv10";
63
+
64
+ /*
65
+ * Grid system
66
+ *
67
+ * The design system uses a 6 columns system on smaller screens.
68
+ * For simplicity we use a 12 column grid for all breakpoints (zh web implementation does the same).
69
+ *
70
+ * The goal is to keep the css footprint small
71
+ * by not generating all classes for every cell width for every breakpoint.
72
+ * Most components don't need a grid and those who do probably have a very simple configuration.
73
+ * If we have enough use cases for a more complex grid system we can add it later.
74
+ */
75
+ --leu-grid-gap: 1rem;
76
+ --leu-grid-template-columns: repeat(12, minmax(0, 4.25rem));
77
+ --leu-grid-max-width: 73rem;
78
+
79
+ --leu-grid-columns-full: 1 / -1;
80
+ --leu-grid-columns-offset: 1 / -1;
81
+
82
+ @media (--viewport-regular) {
83
+ --leu-grid-columns-offset: 3 / -1;
84
+ }
85
+
86
+ @media (--viewport-medium) {
87
+ --leu-grid-gap: 2rem;
88
+ }
89
+ }
@@ -1,89 +0,0 @@
1
- @import url("./custom-media.css");
2
-
3
- :root,
4
- :host {
5
- --leu-color-black-100: #000;
6
- --leu-color-black-80: #333;
7
- --leu-color-black-60: #666;
8
- --leu-color-black-40: #949494;
9
- --leu-color-black-20: #ccc;
10
- --leu-color-black-10: #f0f0f0;
11
- --leu-color-black-5: #f7f7f7;
12
- --leu-color-black-0: #fffffe;
13
-
14
- --leu-color-black-transp-80: rgb(0 0 0 / 80%);
15
- --leu-color-black-transp-60: rgb(0 0 0 / 60%);
16
- --leu-color-black-transp-40: rgb(0 0 0 / 40%);
17
- --leu-color-black-transp-20: rgb(0 0 0 / 20%);
18
- --leu-color-black-transp-10: rgb(0 0 0 / 10%);
19
- --leu-color-black-transp-5: rgb(0 0 0 / 5%);
20
-
21
- --leu-color-white-transp-90: rgb(255 255 255 / 90%);
22
- --leu-color-white-transp-70: rgb(255 255 255 / 70%);
23
- --leu-color-white-transp-40: rgb(255 255 255 / 40%);
24
- --leu-color-white-transp-10: rgb(255 255 255 / 10%);
25
-
26
- --leu-color-accent-blue: #0076bd;
27
- --leu-color-accent-darkblue: #00407c;
28
- --leu-color-accent-turquoise: #00797b;
29
- --leu-color-accent-green: #1a7f1f;
30
- --leu-color-accent-bordeaux: #b01657;
31
- --leu-color-accent-magenta: #d40053;
32
- --leu-color-accent-violet: #7f3da7;
33
- --leu-color-accent-gray: var(--leu-color-black-60);
34
-
35
- --leu-color-accent-blue-soft: #edf5fa;
36
- --leu-color-accent-darkblue-soft: #e0e8ee;
37
- --leu-color-accent-turquoise-soft: #e8f3f2;
38
- --leu-color-accent-green-soft: #ebf6eb;
39
- --leu-color-accent-bordeaux-soft: #f6e3ea;
40
- --leu-color-accent-magenta-soft: #fcedf3;
41
- --leu-color-accent-violet-soft: #ece2f1;
42
- --leu-color-accent-gray-soft: var(--leu-color-black-10);
43
-
44
- --leu-color-func-cyan: #009ee0;
45
- --leu-color-func-red: #d93c1a;
46
- --leu-color-func-green: #1a7f1f;
47
-
48
- /* stylelint-disable value-keyword-case */
49
- --leu-font-family-regular:
50
- "InterRegular", "HelveticaNowRegular", "Helvetica", sans-serif;
51
- --leu-font-family-black:
52
- "InterBlack", "HelveticaNowBlack", "Arial Black", "Helvetica", sans-serif;
53
- /* stylelint-enable value-keyword-case */
54
-
55
- --leu-box-shadow-short: 0px 0px 2px var(--leu-color-black-transp-40);
56
- --leu-box-shadow-regular: 0px 0px 16px var(--leu-color-black-transp-20);
57
- --leu-box-shadow-long: 0px 0px 80px var(--leu-color-black-transp-20);
58
-
59
- --leu-z-index-popup: 100;
60
-
61
- @leu-font-styles './font-definitions.json';
62
- --leu-t-font-feature-settings: "ss07", "ss08", "cv03", "cv04", "cv10";
63
-
64
- /*
65
- * Grid system
66
- *
67
- * The design system uses a 6 columns system on smaller screens.
68
- * For simplicity we use a 12 column grid for all breakpoints (zh web implementation does the same).
69
- *
70
- * The goal is to keep the css footprint small
71
- * by not generating all classes for every cell width for every breakpoint.
72
- * Most components don't need a grid and those who do probably have a very simple configuration.
73
- * If we have enough use cases for a more complex grid system we can add it later.
74
- */
75
- --leu-grid-gap: 1rem;
76
- --leu-grid-template-columns: repeat(12, minmax(0, 4.25rem));
77
- --leu-grid-max-width: 73rem;
78
-
79
- --leu-grid-columns-full: 1 / -1;
80
- --leu-grid-columns-offset: 1 / -1;
81
-
82
- @media (--viewport-regular) {
83
- --leu-grid-columns-offset: 3 / -1;
84
- }
85
-
86
- @media (--viewport-medium) {
87
- --leu-grid-gap: 2rem;
88
- }
89
- }