@statistikzh/leu 0.4.0 → 0.5.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 (216) hide show
  1. package/.storybook/preview.js +1 -2
  2. package/CHANGELOG.md +24 -0
  3. package/custom-elements-manifest.config.js +46 -0
  4. package/dist/Accordion.d.ts +31 -0
  5. package/dist/Accordion.d.ts.map +1 -0
  6. package/dist/Accordion.js +257 -0
  7. package/dist/Breadcrumb.d.ts +69 -0
  8. package/dist/Breadcrumb.d.ts.map +1 -0
  9. package/dist/Breadcrumb.js +392 -0
  10. package/dist/Button-da11d064.d.ts +84 -0
  11. package/dist/Button-da11d064.d.ts.map +1 -0
  12. package/dist/Button-da11d064.js +542 -0
  13. package/dist/Button.d.ts +2 -0
  14. package/dist/Button.d.ts.map +1 -0
  15. package/dist/Button.js +6 -420
  16. package/dist/ButtonGroup.d.ts +24 -0
  17. package/dist/ButtonGroup.d.ts.map +1 -0
  18. package/dist/ButtonGroup.js +70 -39
  19. package/dist/Checkbox.d.ts +13 -0
  20. package/dist/Checkbox.d.ts.map +1 -0
  21. package/dist/Checkbox.js +2 -2
  22. package/dist/CheckboxGroup.d.ts +13 -0
  23. package/dist/CheckboxGroup.d.ts.map +1 -0
  24. package/dist/CheckboxGroup.js +3 -3
  25. package/dist/Chip.d.ts +5 -0
  26. package/dist/Chip.d.ts.map +1 -0
  27. package/dist/{Chip-dac7337d.js → Chip.js} +16 -5
  28. package/dist/ChipGroup.d.ts +28 -0
  29. package/dist/ChipGroup.d.ts.map +1 -0
  30. package/dist/ChipGroup.js +62 -5
  31. package/dist/ChipLink.d.ts +15 -0
  32. package/dist/ChipLink.d.ts.map +1 -0
  33. package/dist/ChipLink.js +1 -1
  34. package/dist/ChipRemovable.d.ts +13 -0
  35. package/dist/ChipRemovable.d.ts.map +1 -0
  36. package/dist/ChipRemovable.js +2 -2
  37. package/dist/ChipSelectable.d.ts +22 -0
  38. package/dist/ChipSelectable.d.ts.map +1 -0
  39. package/dist/ChipSelectable.js +5 -5
  40. package/dist/Dropdown.d.ts +15 -0
  41. package/dist/Dropdown.d.ts.map +1 -0
  42. package/dist/Dropdown.js +25 -7
  43. package/dist/Input.d.ts +154 -0
  44. package/dist/Input.d.ts.map +1 -0
  45. package/dist/Input.js +13 -7
  46. package/dist/Menu.d.ts +8 -0
  47. package/dist/Menu.d.ts.map +1 -0
  48. package/dist/MenuItem.d.ts +21 -0
  49. package/dist/MenuItem.d.ts.map +1 -0
  50. package/dist/MenuItem.js +3 -3
  51. package/dist/Pagination.d.ts +27 -0
  52. package/dist/Pagination.d.ts.map +1 -0
  53. package/dist/Pagination.js +93 -61
  54. package/dist/Popup.d.ts +18 -0
  55. package/dist/Popup.d.ts.map +1 -0
  56. package/dist/{leu-popup-4bf6f1f4.js → Popup.js} +4 -5
  57. package/dist/Radio.d.ts +12 -0
  58. package/dist/Radio.d.ts.map +1 -0
  59. package/dist/Radio.js +2 -2
  60. package/dist/RadioGroup.d.ts +20 -0
  61. package/dist/RadioGroup.d.ts.map +1 -0
  62. package/dist/RadioGroup.js +3 -3
  63. package/dist/ScrollTop.d.ts +19 -0
  64. package/dist/ScrollTop.d.ts.map +1 -0
  65. package/dist/ScrollTop.js +122 -0
  66. package/dist/Select.d.ts +98 -0
  67. package/dist/Select.d.ts.map +1 -0
  68. package/dist/Select.js +27 -82
  69. package/dist/Table.d.ts +48 -0
  70. package/dist/Table.d.ts.map +1 -0
  71. package/dist/Table.js +7 -4
  72. package/dist/VisuallyHidden.d.ts +8 -0
  73. package/dist/VisuallyHidden.d.ts.map +1 -0
  74. package/dist/VisuallyHidden.js +28 -0
  75. package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts +3 -0
  76. package/dist/_rollupPluginBabelHelpers-20f659f4.d.ts.map +1 -0
  77. package/dist/defineElement-40372b4b.d.ts +9 -0
  78. package/dist/defineElement-40372b4b.d.ts.map +1 -0
  79. package/dist/{defineElement-47d4f665.js → defineElement-40372b4b.js} +1 -1
  80. package/dist/icon-03e86700.d.ts +11 -0
  81. package/dist/icon-03e86700.d.ts.map +1 -0
  82. package/dist/index.js.d.ts +21 -0
  83. package/dist/index.js.d.ts.map +1 -0
  84. package/dist/{index.js → index.js.js} +14 -8
  85. package/dist/leu-accordion.d.ts +3 -0
  86. package/dist/leu-accordion.d.ts.map +1 -0
  87. package/dist/leu-accordion.js +9 -0
  88. package/dist/leu-breadcrumb.d.ts +3 -0
  89. package/dist/leu-breadcrumb.d.ts.map +1 -0
  90. package/dist/leu-breadcrumb.js +23 -0
  91. package/dist/leu-button-group.d.ts +3 -0
  92. package/dist/leu-button-group.d.ts.map +1 -0
  93. package/dist/leu-button-group.js +1 -5
  94. package/dist/leu-button.d.ts +3 -0
  95. package/dist/leu-button.d.ts.map +1 -0
  96. package/dist/leu-button.js +3 -2
  97. package/dist/leu-checkbox-group.d.ts +3 -0
  98. package/dist/leu-checkbox-group.d.ts.map +1 -0
  99. package/dist/leu-checkbox-group.js +1 -1
  100. package/dist/leu-checkbox.d.ts +3 -0
  101. package/dist/leu-checkbox.d.ts.map +1 -0
  102. package/dist/leu-checkbox.js +1 -1
  103. package/dist/leu-chip-group.d.ts +3 -0
  104. package/dist/leu-chip-group.d.ts.map +1 -0
  105. package/dist/leu-chip-group.js +2 -1
  106. package/dist/leu-chip-link.d.ts +3 -0
  107. package/dist/leu-chip-link.d.ts.map +1 -0
  108. package/dist/leu-chip-link.js +2 -2
  109. package/dist/leu-chip-removable.d.ts +3 -0
  110. package/dist/leu-chip-removable.d.ts.map +1 -0
  111. package/dist/leu-chip-removable.js +2 -2
  112. package/dist/leu-chip-selectable.d.ts +3 -0
  113. package/dist/leu-chip-selectable.d.ts.map +1 -0
  114. package/dist/leu-chip-selectable.js +2 -2
  115. package/dist/leu-dropdown.d.ts +3 -0
  116. package/dist/leu-dropdown.d.ts.map +1 -0
  117. package/dist/leu-dropdown.js +5 -4
  118. package/dist/leu-input.d.ts +3 -0
  119. package/dist/leu-input.d.ts.map +1 -0
  120. package/dist/leu-input.js +1 -1
  121. package/dist/leu-menu-item.d.ts +3 -0
  122. package/dist/leu-menu-item.d.ts.map +1 -0
  123. package/dist/leu-menu-item.js +1 -1
  124. package/dist/leu-menu.d.ts +3 -0
  125. package/dist/leu-menu.d.ts.map +1 -0
  126. package/dist/leu-menu.js +1 -1
  127. package/dist/leu-pagination.d.ts +3 -0
  128. package/dist/leu-pagination.d.ts.map +1 -0
  129. package/dist/leu-pagination.js +5 -2
  130. package/dist/leu-popup.d.ts +3 -0
  131. package/dist/leu-popup.d.ts.map +1 -0
  132. package/dist/leu-popup.js +9 -0
  133. package/dist/leu-radio-group.d.ts +3 -0
  134. package/dist/leu-radio-group.d.ts.map +1 -0
  135. package/dist/leu-radio-group.js +1 -1
  136. package/dist/leu-radio.d.ts +3 -0
  137. package/dist/leu-radio.d.ts.map +1 -0
  138. package/dist/leu-radio.js +1 -1
  139. package/dist/leu-scroll-top.d.ts +3 -0
  140. package/dist/leu-scroll-top.d.ts.map +1 -0
  141. package/dist/leu-scroll-top.js +14 -0
  142. package/dist/leu-select.d.ts +3 -0
  143. package/dist/leu-select.d.ts.map +1 -0
  144. package/dist/leu-select.js +4 -3
  145. package/dist/leu-table.d.ts +3 -0
  146. package/dist/leu-table.d.ts.map +1 -0
  147. package/dist/leu-table.js +5 -2
  148. package/dist/leu-visually-hidden.d.ts +3 -0
  149. package/dist/leu-visually-hidden.d.ts.map +1 -0
  150. package/dist/leu-visually-hidden.js +8 -0
  151. package/dist/theme.css +386 -2
  152. package/dist/utils-65469421.d.ts +16 -0
  153. package/dist/utils-65469421.d.ts.map +1 -0
  154. package/dist/utils-65469421.js +35 -0
  155. package/index.js +3 -0
  156. package/package.json +30 -12
  157. package/postcss.config.cjs +2 -0
  158. package/rollup.config.js +21 -40
  159. package/scripts/generate-component/templates/[name].css +2 -2
  160. package/scripts/postcss-leu-font-styles.cjs +160 -0
  161. package/src/components/accordion/accordion.css +2 -2
  162. package/src/components/accordion/stories/accordion.stories.js +2 -1
  163. package/src/components/accordion/test/accordion.test.js +4 -2
  164. package/src/components/breadcrumb/Breadcrumb.js +2 -1
  165. package/src/components/breadcrumb/breadcrumb.css +2 -13
  166. package/src/components/button/Button.js +69 -8
  167. package/src/components/button/button.css +10 -2
  168. package/src/components/button/stories/button.stories.js +43 -90
  169. package/src/components/button/test/button.test.js +90 -19
  170. package/src/components/button-group/ButtonGroup.js +76 -34
  171. package/src/components/button-group/stories/button-group.stories.js +13 -6
  172. package/src/components/button-group/test/button-group.test.js +38 -31
  173. package/src/components/checkbox/checkbox-group.css +2 -2
  174. package/src/components/checkbox/checkbox.css +1 -1
  175. package/src/components/chip/ChipGroup.js +42 -2
  176. package/src/components/chip/ChipRemovable.js +1 -1
  177. package/src/components/chip/ChipSelectable.js +4 -4
  178. package/src/components/chip/chip-group.css +12 -2
  179. package/src/components/chip/chip.css +14 -3
  180. package/src/components/chip/stories/chip-group.stories.js +100 -46
  181. package/src/components/chip/test/chip-removable.test.js +3 -3
  182. package/src/components/dropdown/Dropdown.js +23 -3
  183. package/src/components/input/Input.js +7 -4
  184. package/src/components/input/input.css +2 -2
  185. package/src/components/input/stories/input.stories.js +13 -0
  186. package/src/components/input/test/input.test.js +1 -0
  187. package/src/components/menu/menu-item.css +3 -3
  188. package/src/components/pagination/Pagination.js +91 -60
  189. package/src/components/pagination/pagination.css +6 -1
  190. package/src/components/pagination/stories/pagination.stories.js +15 -2
  191. package/src/components/pagination/test/pagination.test.js +15 -15
  192. package/src/components/popup/popup.css +2 -2
  193. package/src/components/popup/stories/popup.stories.js +1 -1
  194. package/src/components/radio/radio-group.css +2 -2
  195. package/src/components/radio/radio.css +1 -1
  196. package/src/components/scroll-top/ScrollTop.js +87 -0
  197. package/src/components/scroll-top/leu-scroll-top.js +6 -0
  198. package/src/components/scroll-top/scroll-top.css +34 -0
  199. package/src/components/scroll-top/stories/scroll-top.stories.js +217 -0
  200. package/src/components/scroll-top/test/scroll-top.test.js +22 -0
  201. package/src/components/select/Select.js +24 -6
  202. package/src/components/select/select.css +2 -2
  203. package/src/components/table/table.css +2 -2
  204. package/src/components/visually-hidden/VisuallyHidden.js +13 -0
  205. package/src/components/visually-hidden/leu-visually-hidden.js +6 -0
  206. package/src/components/visually-hidden/stories/visually-hidden.stories.js +22 -0
  207. package/src/components/visually-hidden/test/visually-hidden.test.js +36 -0
  208. package/src/components/visually-hidden/visually-hidden.css +10 -0
  209. package/src/lib/defineElement.js +1 -1
  210. package/src/lib/hasSlotController.js +5 -3
  211. package/src/lib/utils.js +21 -3
  212. package/src/styles/custom-properties.css +6 -2
  213. package/src/styles/font-definitions.json +202 -0
  214. package/stylelint.config.mjs +2 -0
  215. package/tsconfig.build.json +21 -0
  216. package/tsconfig.json +16 -0
@@ -28,7 +28,7 @@ table {
28
28
  border-spacing: 0;
29
29
  color: rgb(0 0 0 / 60%);
30
30
  font-size: 16px;
31
- font-family: var(--leu-font-regular);
31
+ font-family: var(--leu-font-family-regular);
32
32
  line-height: 1.5;
33
33
  }
34
34
 
@@ -41,7 +41,7 @@ th {
41
41
  text-align: left;
42
42
  font-size: 12px;
43
43
  font-weight: normal;
44
- font-family: var(--leu-font-black);
44
+ font-family: var(--leu-font-family-black);
45
45
  background: var(--table-even-row-bg);
46
46
  }
47
47
 
@@ -0,0 +1,13 @@
1
+ import { html, LitElement } from "lit"
2
+ import styles from "./visually-hidden.css"
3
+
4
+ /**
5
+ * @tagname leu-visually-hidden
6
+ */
7
+ export class LeuVisuallyHidden extends LitElement {
8
+ static styles = styles
9
+
10
+ render() {
11
+ return html`<slot></slot>`
12
+ }
13
+ }
@@ -0,0 +1,6 @@
1
+ import { defineElement } from "../../lib/defineElement.js"
2
+ import { LeuVisuallyHidden } from "./VisuallyHidden.js"
3
+
4
+ export { LeuVisuallyHidden }
5
+
6
+ defineElement("visually-hidden", LeuVisuallyHidden)
@@ -0,0 +1,22 @@
1
+ import { html } from "lit"
2
+ import "../leu-visually-hidden.js"
3
+
4
+ export default {
5
+ title: "VisuallyHidden",
6
+ component: "leu-visually-hidden",
7
+ argTypes: {
8
+ content: {
9
+ control: "text",
10
+ },
11
+ },
12
+ }
13
+
14
+ function Template({ content }) {
15
+ return html` <leu-visually-hidden>${content}</leu-visually-hidden>`
16
+ }
17
+
18
+ export const Regular = Template.bind({})
19
+ Regular.args = {
20
+ content:
21
+ "This is a text that isn't visible but still accessible for screenreaders.",
22
+ }
@@ -0,0 +1,36 @@
1
+ import { html } from "lit"
2
+ import { fixture, expect } from "@open-wc/testing"
3
+
4
+ import "../leu-visually-hidden.js"
5
+
6
+ async function defaultFixture() {
7
+ return fixture(
8
+ html`
9
+ <leu-visually-hidden>
10
+ This is a text that shouldn't be visible but still accessible.
11
+ </leu-visually-hidden>
12
+ `
13
+ )
14
+ }
15
+
16
+ describe("LeuVisuallyHidden", () => {
17
+ it("is a defined element", async () => {
18
+ const el = await customElements.get("leu-visually-hidden")
19
+
20
+ await expect(el).not.to.be.undefined
21
+ })
22
+
23
+ it("passes the a11y audit", async () => {
24
+ const el = await defaultFixture()
25
+
26
+ await expect(el).to.be.accessible()
27
+ })
28
+
29
+ it("renders the default slot content", async () => {
30
+ const el = await defaultFixture()
31
+
32
+ expect(el).dom.to.equal(
33
+ "<leu-visually-hidden>This is a text that shouldn't be visible but still accessible.</leu-visually-hidden>"
34
+ )
35
+ })
36
+ })
@@ -0,0 +1,10 @@
1
+ :host {
2
+ clip: rect(0 0 0 0);
3
+ border: 0;
4
+ height: 1px;
5
+ margin: -1px !important;
6
+ overflow: hidden;
7
+ padding: 0 !important;
8
+ position: absolute;
9
+ width: 1px;
10
+ }
@@ -2,7 +2,7 @@
2
2
  * Adds a definition for a custom element to the custom element
3
3
  * registry if it isn't defined before. Prefixes the name with `leu-`.
4
4
  * @param {string} name
5
- * @param {HTMLElement} constructor
5
+ * @param {CustomElementConstructor} constructor
6
6
  */
7
7
  export function defineElement(name, constructor) {
8
8
  if (!customElements.get(`leu-${name}`)) {
@@ -5,7 +5,8 @@
5
5
 
6
6
  /**
7
7
  * A reactive controller that determines when slots exist.
8
- * @implements { import("lit").ReactiveController }
8
+ * @typedef {import("lit").ReactiveController} ReactiveController
9
+ * @implements {ReactiveController}
9
10
  */
10
11
  export class HasSlotController {
11
12
  constructor(host, slotNames) {
@@ -76,8 +77,9 @@ export class HasSlotController {
76
77
  const slot = event.target
77
78
 
78
79
  if (
79
- (this.slotNames.includes("[default]") && !slot.name) ||
80
- (slot.name && this.slotNames.includes(slot.name))
80
+ slot instanceof HTMLSlotElement &&
81
+ ((this.slotNames.includes("[default]") && !slot.name) ||
82
+ (slot.name && this.slotNames.includes(slot.name)))
81
83
  ) {
82
84
  this.host.requestUpdate()
83
85
  }
package/src/lib/utils.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Wrap a Function to nsure that time-consuming tasks do not fire so often
2
+ * Return a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was invoked.
3
3
  * @param {Function} func - Your function
4
4
  * @param {Number} timeout - Default is 500 ms
5
5
  * @returns {Function} - Your function wrapped in a timeout function
6
6
  */
7
- const debounce = function (func, timeout = 500) {
7
+ const debounce = function debounce(func, timeout = 500) {
8
8
  let timer = null
9
9
  return (...args) => {
10
10
  clearTimeout(timer)
@@ -14,4 +14,22 @@ const debounce = function (func, timeout = 500) {
14
14
  }
15
15
  }
16
16
 
17
- export { debounce }
17
+ /**
18
+ * Return a throttled function that only invokes func at most once per every wait milliseconds.
19
+ * @param {Function} func - Your function
20
+ * @param {Number} timeout - Default is 500 ms
21
+ * @returns {Function} - Your function wrapped in a timeout function
22
+ */
23
+ const throttle = function throttle(func, timeout = 500) {
24
+ let timer = null
25
+ return (...args) => {
26
+ if (timer === null) {
27
+ func(...args)
28
+ timer = setTimeout(() => {
29
+ timer = null
30
+ }, timeout)
31
+ }
32
+ }
33
+ }
34
+
35
+ export { debounce, throttle }
@@ -1,3 +1,5 @@
1
+ @import url("./custom-media.css");
2
+
1
3
  :root {
2
4
  --leu-color-black-100: #000;
3
5
  --leu-color-black-80: #333;
@@ -42,10 +44,12 @@
42
44
  --leu-color-func-red: #d93c1a;
43
45
  --leu-color-func-green: #1a7f1f;
44
46
 
45
- --leu-font-regular: HelveticaNowRegular, Helvetica, sans-serif; /* stylelint-disable-line value-keyword-case */
46
- --leu-font-black: HelveticaNowBlack, Arial Black, Helvetica, sans-serif; /* stylelint-disable-line value-keyword-case */
47
+ --leu-font-family-regular: HelveticaNowRegular, Helvetica, sans-serif; /* stylelint-disable-line value-keyword-case */
48
+ --leu-font-family-black: HelveticaNowBlack, Arial Black, Helvetica, sans-serif; /* stylelint-disable-line value-keyword-case */
47
49
 
48
50
  --leu-box-shadow-short: 0px 0px 2px var(--leu-color-black-transp-40);
49
51
  --leu-box-shadow-regular: 0px 0px 16px var(--leu-color-black-transp-20);
50
52
  --leu-box-shadow-long: 0px 0px 80px var(--leu-color-black-transp-20);
53
+
54
+ @leu-font-styles './font-definitions.json';
51
55
  }
@@ -0,0 +1,202 @@
1
+ {
2
+ "definitions": [
3
+ {
4
+ "fontSize": "12px",
5
+ "fontWeight": "regular",
6
+ "lineHeight": 1.5,
7
+ "spacing": "9px",
8
+ "name": "tiny"
9
+ },
10
+ {
11
+ "fontSize": "12px",
12
+ "fontWeight": "black",
13
+ "lineHeight": 1.5,
14
+ "spacing": "9px",
15
+ "name": "tiny"
16
+ },
17
+ {
18
+ "fontSize": "14px",
19
+ "fontWeight": "regular",
20
+ "lineHeight": 1.4,
21
+ "spacing": "10px",
22
+ "name": "small"
23
+ },
24
+ {
25
+ "fontSize": "14px",
26
+ "fontWeight": "black",
27
+ "lineHeight": 1.4,
28
+ "spacing": "10px",
29
+ "name": "small"
30
+ },
31
+ {
32
+ "fontSize": "16px",
33
+ "fontWeight": "regular",
34
+ "lineHeight": 1.5,
35
+ "spacing": "12px",
36
+ "name": "regular"
37
+ },
38
+ {
39
+ "fontSize": "16px",
40
+ "fontWeight": "black",
41
+ "lineHeight": 1.5,
42
+ "spacing": "12px",
43
+ "name": "regular"
44
+ },
45
+ {
46
+ "fontSize": "18px",
47
+ "fontWeight": "regular",
48
+ "lineHeight": 1.5,
49
+ "spacing": "13px",
50
+ "name": "biggerRegular"
51
+ },
52
+ {
53
+ "fontSize": "18px",
54
+ "fontWeight": "black",
55
+ "lineHeight": 1.3,
56
+ "spacing": "12px",
57
+ "name": "biggerRegular"
58
+ },
59
+ {
60
+ "fontSize": "20px",
61
+ "fontWeight": "regular",
62
+ "lineHeight": 1.5,
63
+ "spacing": "15px",
64
+ "name": "medium"
65
+ },
66
+ {
67
+ "fontSize": "20px",
68
+ "fontWeight": "black",
69
+ "lineHeight": 1.3,
70
+ "spacing": "13px",
71
+ "name": "medium"
72
+ },
73
+ {
74
+ "fontSize": "24px",
75
+ "fontWeight": "regular",
76
+ "lineHeight": 1.5,
77
+ "spacing": "18px",
78
+ "name": "large"
79
+ },
80
+ {
81
+ "fontSize": "24px",
82
+ "fontWeight": "black",
83
+ "lineHeight": 1.3,
84
+ "spacing": "15px",
85
+ "name": "large"
86
+ },
87
+ {
88
+ "fontSize": "28px",
89
+ "fontWeight": "black",
90
+ "lineHeight": 1.2,
91
+ "spacing": "17px",
92
+ "name": "smallBig"
93
+ },
94
+ {
95
+ "fontSize": "32px",
96
+ "fontWeight": "black",
97
+ "lineHeight": 1.2,
98
+ "spacing": "19px",
99
+ "name": "big"
100
+ },
101
+ {
102
+ "fontSize": "40px",
103
+ "fontWeight": "black",
104
+ "lineHeight": 1.2,
105
+ "spacing": "24px",
106
+ "name": "biggerBig"
107
+ },
108
+ {
109
+ "fontSize": "48px",
110
+ "fontWeight": "black",
111
+ "lineHeight": 1,
112
+ "spacing": "24px",
113
+ "name": "smallHuge"
114
+ },
115
+ {
116
+ "fontSize": "56px",
117
+ "fontWeight": "black",
118
+ "lineHeight": 1,
119
+ "spacing": "28px",
120
+ "name": "huge"
121
+ },
122
+ {
123
+ "fontSize": "72px",
124
+ "fontWeight": "black",
125
+ "lineHeight": 1,
126
+ "spacing": "36px",
127
+ "name": "giant"
128
+ }
129
+ ],
130
+ "curves": [
131
+ {
132
+ "name": "tiny",
133
+ "steps": [
134
+ [null, "tiny"],
135
+ ["--viewport-regular", "small"]
136
+ ]
137
+ },
138
+ {
139
+ "name": "small",
140
+ "steps": [
141
+ [null, "small"],
142
+ ["--viewport-regular", "regular"],
143
+ ["--viewport-large", "biggerRegular"]
144
+ ]
145
+ },
146
+ {
147
+ "name": "regular",
148
+ "steps": [
149
+ [null, "regular"],
150
+ ["--viewport-small", "biggerRegular"],
151
+ ["--viewport-xlarge", "medium"]
152
+ ]
153
+ },
154
+ {
155
+ "name": "biggerRegular",
156
+ "steps": [
157
+ [null, "biggerRegular"],
158
+ ["--viewport-regular", "medium"],
159
+ ["--viewport-xlarge", "large"]
160
+ ]
161
+ },
162
+ {
163
+ "name": "medium",
164
+ "steps": [
165
+ [null, "biggerRegular"],
166
+ ["--viewport-small", "medium"],
167
+ ["--viewport-large", "large"],
168
+ ["--viewport-xlarge", "smallBig"]
169
+ ]
170
+ },
171
+ {
172
+ "name": "large",
173
+ "steps": [
174
+ [null, "biggerRegular"],
175
+ ["--viewport-regular", "large"],
176
+ ["--viewport-large", "smallBig"],
177
+ ["--viewport-xlarge", "big"]
178
+ ]
179
+ },
180
+ {
181
+ "name": "big",
182
+ "steps": [
183
+ [null, "large"],
184
+ ["--viewport-regular", "smallBig"],
185
+ ["--viewport-medium", "big"],
186
+ ["--viewport-large", "biggerBig"],
187
+ ["--viewport-xlarge", "smallHuge"]
188
+ ]
189
+ },
190
+ {
191
+ "name": "huge",
192
+ "steps": [
193
+ [null, "smallBig"],
194
+ ["--viewport-small", "big"],
195
+ ["--viewport-regular", "biggerBig"],
196
+ ["--viewport-medium", "smallHuge"],
197
+ ["--viewport-large", "huge"],
198
+ ["--viewport-xlarge", "giant"]
199
+ ]
200
+ }
201
+ ]
202
+ }
@@ -1,3 +1,4 @@
1
+ /** @type {import('stylelint').Config} */
1
2
  export default {
2
3
  extends: "stylelint-config-standard",
3
4
  overrides: [
@@ -16,6 +17,7 @@ export default {
16
17
  // Allowing kebab-case and BEM
17
18
  "selector-class-pattern":
18
19
  "^[a-z]([-]?[a-z0-9]+)*(__[a-z0-9]([-]?[a-z0-9]+)*)?(--[a-z0-9]([-]?[a-z0-9]+)*)?$",
20
+ "at-rule-no-unknown": [true, { ignoreAtRules: ["leu-font-styles"] }],
19
21
  },
20
22
  ignoreFiles: ["scripts/generate-component/templates/**/*"],
21
23
  }
@@ -0,0 +1,21 @@
1
+ {
2
+ "include": ["dist/**/*.js"],
3
+ "exclude": ["node_modules", "dist/**/*.d.ts"],
4
+ "compilerOptions": {
5
+ // Tells TypeScript to read JS files, as
6
+ // normally they are ignored as source files
7
+ "allowJs": true,
8
+ // Generate d.ts files
9
+ "declaration": true,
10
+ // This compiler run should
11
+ // only output d.ts files
12
+ "emitDeclarationOnly": true,
13
+ // Types should go into this directory.
14
+ // Removing this would place the .d.ts files
15
+ // next to the .js files
16
+ "outDir": "dist",
17
+ // go to js file when using IDE functions like
18
+ // "Go to Definition" in VSCode
19
+ "declarationMap": true
20
+ }
21
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "include": ["src/**/*.js"],
3
+ "exclude": [
4
+ "node_modules",
5
+ "dist",
6
+ "**/*.d.ts",
7
+ "**/*.stories.js",
8
+ "**/*.test.js",
9
+ "**/*.css"
10
+ ],
11
+ "compilerOptions": {
12
+ "allowJs": true,
13
+ "checkJs": true,
14
+ "noEmit": true
15
+ }
16
+ }