@statistikzh/leu 0.2.0 → 0.4.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 (153) hide show
  1. package/.github/workflows/deploy-github-pages.yaml +33 -0
  2. package/.storybook/main.js +27 -1
  3. package/.storybook/manager-head.html +1 -0
  4. package/.storybook/manager.js +9 -0
  5. package/.storybook/preview-head.html +1 -1
  6. package/.storybook/preview.js +59 -5
  7. package/.storybook/static/logo.svg +19 -0
  8. package/.storybook/theme.js +7 -0
  9. package/CHANGELOG.md +43 -0
  10. package/README.md +1 -1
  11. package/dist/Button.js +39 -30
  12. package/dist/ButtonGroup.js +5 -7
  13. package/dist/Checkbox.js +107 -88
  14. package/dist/CheckboxGroup.js +43 -38
  15. package/dist/{Chip-389013ff.js → Chip-dac7337d.js} +7 -2
  16. package/dist/ChipGroup.js +4 -6
  17. package/dist/ChipLink.js +6 -8
  18. package/dist/ChipRemovable.js +4 -7
  19. package/dist/ChipSelectable.js +10 -10
  20. package/dist/Dropdown.js +57 -27
  21. package/dist/Input.js +59 -43
  22. package/dist/Menu.js +2 -5
  23. package/dist/MenuItem.js +34 -17
  24. package/dist/Pagination.js +57 -55
  25. package/dist/Radio.js +13 -10
  26. package/dist/RadioGroup.js +43 -40
  27. package/dist/Select.js +57 -44
  28. package/dist/Table.js +147 -125
  29. package/dist/{defineElement-ba770aed.js → _rollupPluginBabelHelpers-20f659f4.js} +1 -15
  30. package/dist/defineElement-47d4f665.js +15 -0
  31. package/dist/index.js +29 -19
  32. package/dist/leu-button-group.js +7 -3
  33. package/dist/leu-button.js +6 -3
  34. package/dist/leu-checkbox-group.js +6 -3
  35. package/dist/leu-checkbox.js +6 -3
  36. package/dist/leu-chip-group.js +6 -3
  37. package/dist/leu-chip-link.js +7 -4
  38. package/dist/leu-chip-removable.js +7 -4
  39. package/dist/leu-chip-selectable.js +7 -4
  40. package/dist/leu-dropdown.js +13 -3
  41. package/dist/leu-input.js +7 -3
  42. package/dist/leu-menu-item.js +8 -3
  43. package/dist/leu-menu.js +6 -3
  44. package/dist/leu-pagination.js +8 -3
  45. package/dist/leu-popup-4bf6f1f4.js +216 -0
  46. package/dist/leu-radio-group.js +6 -3
  47. package/dist/leu-radio.js +6 -3
  48. package/dist/leu-select.js +14 -3
  49. package/dist/leu-table.js +9 -3
  50. package/package.json +29 -12
  51. package/scripts/generate-component/templates/[Name].js +0 -5
  52. package/scripts/generate-component/templates/[name].css +1 -1
  53. package/scripts/generate-component/templates/[namespace]-[name].js +5 -2
  54. package/src/components/accordion/Accordion.js +3 -9
  55. package/src/components/accordion/leu-accordion.js +5 -2
  56. package/src/components/accordion/stories/accordion.stories.js +7 -4
  57. package/src/components/accordion/test/accordion.test.js +92 -2
  58. package/src/components/breadcrumb/Breadcrumb.js +310 -0
  59. package/src/components/breadcrumb/breadcrumb.css +114 -0
  60. package/src/components/breadcrumb/leu-breadcrumb.js +6 -0
  61. package/src/components/breadcrumb/stories/breadcrumb.stories.js +73 -0
  62. package/src/components/breadcrumb/test/breadcrumb.test.js +141 -0
  63. package/src/components/button/Button.js +22 -27
  64. package/src/components/button/button.css +3 -3
  65. package/src/components/button/leu-button.js +5 -2
  66. package/src/components/button/stories/button.stories.js +58 -37
  67. package/src/components/button/test/button.test.js +112 -2
  68. package/src/components/button-group/ButtonGroup.js +1 -7
  69. package/src/components/button-group/leu-button-group.js +5 -2
  70. package/src/components/button-group/stories/button-group.stories.js +6 -0
  71. package/src/components/button-group/test/button-group.test.js +79 -3
  72. package/src/components/checkbox/Checkbox.js +9 -89
  73. package/src/components/checkbox/CheckboxGroup.js +9 -39
  74. package/src/components/checkbox/checkbox-group.css +29 -0
  75. package/src/components/checkbox/checkbox.css +76 -0
  76. package/src/components/checkbox/leu-checkbox-group.js +5 -2
  77. package/src/components/checkbox/leu-checkbox.js +5 -2
  78. package/src/components/checkbox/stories/checkbox-group.stories.js +44 -21
  79. package/src/components/checkbox/stories/checkbox.stories.js +7 -1
  80. package/src/components/checkbox/test/checkbox-group.test.js +124 -0
  81. package/src/components/checkbox/test/checkbox.test.js +72 -59
  82. package/src/components/chip/Chip.js +2 -1
  83. package/src/components/chip/ChipGroup.js +1 -6
  84. package/src/components/chip/ChipLink.js +2 -8
  85. package/src/components/chip/ChipRemovable.js +1 -6
  86. package/src/components/chip/ChipSelectable.js +4 -9
  87. package/src/components/chip/exports.js +4 -10
  88. package/src/components/chip/leu-chip-group.js +5 -2
  89. package/src/components/chip/leu-chip-link.js +5 -2
  90. package/src/components/chip/leu-chip-removable.js +5 -2
  91. package/src/components/chip/leu-chip-selectable.js +5 -2
  92. package/src/components/chip/stories/chip-group.stories.js +18 -6
  93. package/src/components/chip/stories/chip-link.stories.js +16 -4
  94. package/src/components/chip/stories/chip-removable.stories.js +15 -4
  95. package/src/components/chip/stories/chip-selectable.stories.js +13 -3
  96. package/src/components/chip/test/chip-group.test.js +124 -0
  97. package/src/components/chip/test/chip-link.test.js +58 -0
  98. package/src/components/chip/test/chip-removable.test.js +79 -0
  99. package/src/components/chip/test/chip-selectable.test.js +95 -0
  100. package/src/components/chip/test/chip.test.js +1 -1
  101. package/src/components/dropdown/Dropdown.js +53 -25
  102. package/src/components/dropdown/dropdown.css +1 -2
  103. package/src/components/dropdown/leu-dropdown.js +5 -2
  104. package/src/components/dropdown/stories/dropdown.stories.js +11 -5
  105. package/src/components/dropdown/test/dropdown.test.js +6 -6
  106. package/src/components/icon/icon.js +1 -1
  107. package/src/components/icon/test/icon.test.js +66 -0
  108. package/src/components/input/Input.js +33 -39
  109. package/src/components/input/input.css +9 -6
  110. package/src/components/input/leu-input.js +5 -2
  111. package/src/components/input/stories/input.stories.js +8 -2
  112. package/src/components/input/test/input.test.js +431 -4
  113. package/src/components/menu/Menu.js +0 -5
  114. package/src/components/menu/MenuItem.js +22 -15
  115. package/src/components/menu/leu-menu-item.js +5 -2
  116. package/src/components/menu/leu-menu.js +5 -2
  117. package/src/components/menu/menu-item.css +5 -2
  118. package/src/components/menu/stories/menu-item.stories.js +13 -4
  119. package/src/components/menu/stories/menu.stories.js +11 -5
  120. package/src/components/menu/test/menu-item.test.js +180 -0
  121. package/src/components/menu/test/menu.test.js +10 -2
  122. package/src/components/pagination/Pagination.js +53 -65
  123. package/src/components/pagination/leu-pagination.js +5 -2
  124. package/src/components/pagination/stories/pagination.stories.js +17 -9
  125. package/src/components/pagination/test/pagination.test.js +191 -5
  126. package/src/components/popup/Popup.js +200 -0
  127. package/src/components/popup/leu-popup.js +6 -0
  128. package/src/components/popup/popup.css +27 -0
  129. package/src/components/popup/stories/popup.stories.js +58 -0
  130. package/src/components/popup/test/popup.test.js +29 -0
  131. package/src/components/radio/Radio.js +5 -10
  132. package/src/components/radio/RadioGroup.js +7 -39
  133. package/src/components/radio/leu-radio-group.js +5 -2
  134. package/src/components/radio/leu-radio.js +5 -2
  135. package/src/components/radio/radio-group.css +29 -0
  136. package/src/components/radio/stories/radio-group.stories.js +38 -19
  137. package/src/components/radio/stories/radio.stories.js +7 -1
  138. package/src/components/radio/test/radio-group.test.js +86 -0
  139. package/src/components/radio/test/radio.test.js +108 -17
  140. package/src/components/select/Select.js +35 -32
  141. package/src/components/select/leu-select.js +5 -2
  142. package/src/components/select/select.css +13 -13
  143. package/src/components/select/stories/select.stories.js +15 -168
  144. package/src/components/select/test/fixtures.js +162 -0
  145. package/src/components/select/test/select.test.js +236 -12
  146. package/src/components/table/Table.js +48 -123
  147. package/src/components/table/leu-table.js +5 -2
  148. package/src/components/table/stories/table.stories.js +20 -10
  149. package/src/components/table/table.css +99 -0
  150. package/src/components/table/test/table.test.js +1 -1
  151. package/src/lib/utils.js +17 -0
  152. package/{web-dev-server-storybook.config.mjs → web-dev-server.config.mjs} +1 -2
  153. package/web-test-runner.config.mjs +15 -2
@@ -1,116 +1,30 @@
1
- import { html, css, LitElement, nothing } from "lit"
1
+ import { html, LitElement, nothing } from "lit"
2
2
  import { classMap } from "lit/directives/class-map.js"
3
3
  import { styleMap } from "lit/directives/style-map.js"
4
4
  import { createRef, ref } from "lit/directives/ref.js"
5
5
  import { Icon } from "../icon/icon.js"
6
- import { defineElement } from "../../lib/defineElement.js"
7
- import { definePaginationElements } from "../pagination/Pagination.js"
6
+ import "../pagination/leu-pagination.js"
7
+
8
+ import styles from "./table.css"
8
9
 
9
10
  /**
10
11
  * @tagname leu-table
11
12
  */
12
13
  export class LeuTable extends LitElement {
13
- static styles = css`
14
- :host {
15
- position: relative;
16
- display: block;
17
- }
18
- div.scroll {
19
- display: inline-block;
20
- width: 100%;
21
- overflow: auto;
22
- }
23
- div.shadow {
24
- position: absolute;
25
- left: 0;
26
- top: 0;
27
- width: 100%;
28
- height: 100%;
29
- pointer-events: none;
30
- z-index: 1;
31
- }
32
- div.pagination {
33
- height: calc(100% - 66px);
34
- }
35
- table {
36
- width: 100%;
37
- border-spacing: 0;
38
- color: rgb(0 0 0 / 60%);
39
- font-size: 16px;
40
- font-family: var(--leu-font-regular);
41
- line-height: 1.5;
42
- }
43
- td {
44
- padding: 12px;
45
- }
46
- th {
47
- padding: 16px 16px 8px;
48
- text-align: left;
49
- font-size: 12px;
50
- font-weight: normal;
51
- font-family: var(--leu-font-black);
52
- background: var(--table-even-row-bg);
53
- }
54
- td:first-child,
55
- th:first-child {
56
- left: 0;
57
- background: inherit;
58
- z-index: 1;
59
- }
60
- tr {
61
- background: #fff;
62
- }
63
- tbody tr:nth-child(odd) {
64
- background: var(--leu-color-black-5);
65
- }
66
- button {
67
- background: none;
68
- cursor: pointer;
69
- line-height: 1.5;
70
- padding: 0;
71
- border: 0;
72
- width: 100%;
73
- display: flex;
74
- align-items: flex-center;
75
- font-size: inherit;
76
- font-family: inherit;
77
- }
78
- thead svg {
79
- display: inline-block;
80
- color: var(--leu-color-accent-blue);
81
- padding: 0;
82
- }
83
-
84
- table.sticky td:first-child,
85
- table.sticky th:first-child {
86
- position: sticky;
87
- }
88
- div.shadow-left table.sticky td:first-child,
89
- div.shadow-left table.sticky th:first-child {
90
- box-shadow: 0 0 5px rgb(0 0 0 / 50%);
91
- clip-path: inset(0 -15px 0 0);
92
- }
93
- div.shadow-left {
94
- box-shadow: inset 5px 0 5px -5px rgb(0 0 0 / 50%);
95
- }
96
- div.shadow-right {
97
- box-shadow: inset -5px 0 5px -5px rgb(0 0 0 / 50%);
98
- }
99
- `
14
+ static styles = styles
100
15
 
101
16
  static properties = {
102
17
  columns: { type: Array },
103
18
  data: { type: Array },
104
- firstColumnSticky: { type: Boolean },
105
- itemsOnAPage: { type: Number },
106
- sortIndex: { type: Number },
107
- sortOrderAsc: { type: Boolean },
108
- width: { type: Number },
109
-
110
- _shadowLeft: { type: Boolean, state: true },
111
- _shadowRight: { type: Boolean, state: true },
112
- _min: { type: Number, state: true },
113
- _max: { type: Number, state: true },
19
+ firstColumnSticky: { type: Boolean, reflect: true },
20
+ itemsPerPage: { type: Number, reflect: true },
21
+ sortIndex: { type: Number, reflect: true },
22
+ sortOrderAsc: { type: Boolean, reflect: true },
23
+ width: { type: Number, reflect: true },
24
+
25
+ _shadowLeft: { state: true },
26
+ _shadowRight: { state: true },
27
+ _page: { state: true },
114
28
  }
115
29
 
116
30
  constructor() {
@@ -122,7 +36,7 @@ export class LeuTable extends LitElement {
122
36
  /** @type {boolean} */
123
37
  this.firstColumnSticky = false
124
38
  /** @type {number} */
125
- this.itemsOnAPage = null
39
+ this.itemsPerPage = null
126
40
  /** @type {number} */
127
41
  this.sortIndex = null
128
42
  /** @type {boolean} */
@@ -140,14 +54,31 @@ export class LeuTable extends LitElement {
140
54
  this._shadowRight = false
141
55
  /** @internal */
142
56
  this._scrollRef = createRef()
57
+
143
58
  /** @internal */
144
- this._min = 0
145
- /** @internal */
146
- this._max = null
59
+ this._page = 1
60
+
61
+ this._resizeObserver = new ResizeObserver(() => {
62
+ this.shadowToggle(this._scrollRef.value)
63
+ })
64
+ }
65
+
66
+ disconnectedCallback() {
67
+ this._resizeObserver.disconnect()
68
+ }
69
+
70
+ attributeChangedCallback(name, oldVal, newVal) {
71
+ super.attributeChangedCallback(name, oldVal, newVal)
72
+
73
+ if (name === "itemsperpage" || name === "data") {
74
+ this._page = 1
75
+ }
147
76
  }
148
77
 
149
78
  firstUpdated() {
150
79
  this.shadowToggle(this._scrollRef.value)
80
+
81
+ this._resizeObserver.observe(this._scrollRef.value)
151
82
  }
152
83
 
153
84
  shadowToggle(target) {
@@ -205,8 +136,11 @@ export class LeuTable extends LitElement {
205
136
  }
206
137
 
207
138
  get _data() {
208
- return this.itemsOnAPage && this.itemsOnAPage > 0
209
- ? this._sortedData.slice(this._min, this._max)
139
+ return this.itemsPerPage && this.itemsPerPage > 0
140
+ ? this._sortedData.slice(
141
+ (this._page - 1) * this.itemsPerPage,
142
+ this._page * this.itemsPerPage
143
+ )
210
144
  : this._sortedData
211
145
  }
212
146
 
@@ -219,13 +153,13 @@ export class LeuTable extends LitElement {
219
153
  const shadowClassesLeft = {
220
154
  shadow: true,
221
155
  "shadow-left": !this.firstColumnSticky && this._shadowLeft,
222
- pagination: this.itemsOnAPage > 0,
156
+ pagination: this.itemsPerPage > 0,
223
157
  }
224
158
 
225
159
  const shadowClassesRight = {
226
160
  shadow: true,
227
161
  "shadow-right": this._shadowRight,
228
- pagination: this.itemsOnAPage > 0,
162
+ pagination: this.itemsPerPage > 0,
229
163
  }
230
164
 
231
165
  const stickyClass = {
@@ -274,18 +208,14 @@ export class LeuTable extends LitElement {
274
208
  <div class=${classMap(shadowClassesRight)}></div>
275
209
  </div>
276
210
 
277
- ${this.itemsOnAPage > 0
211
+ ${this.itemsPerPage > 0
278
212
  ? html`
279
213
  <leu-pagination
280
- .dataLength=${this._sortedData.length}
281
- .itemsOnAPage=${this.itemsOnAPage}
282
- @range-updated=${(e) => {
283
- this._min = e.detail.min
284
- this._max = e.detail.max
285
- // after render
286
- setTimeout(() => {
287
- this.shadowToggle(this._scrollRef.value)
288
- }, 0)
214
+ .numOfItems=${this._sortedData.length}
215
+ .itemsPerPage=${this.itemsPerPage}
216
+ page=${this._page}
217
+ @leu:pagechange=${(e) => {
218
+ this._page = e.detail.page
289
219
  }}
290
220
  >
291
221
  </leu-pagination>
@@ -294,8 +224,3 @@ export class LeuTable extends LitElement {
294
224
  `
295
225
  }
296
226
  }
297
-
298
- export function defineTableElements() {
299
- definePaginationElements()
300
- defineElement("table", LeuTable)
301
- }
@@ -1,3 +1,6 @@
1
- import { defineTableElements } from "./Table.js"
1
+ import { defineElement } from "../../lib/defineElement.js"
2
+ import { LeuTable } from "./Table.js"
2
3
 
3
- defineTableElements()
4
+ export { LeuTable }
5
+
6
+ defineElement("table", LeuTable)
@@ -4,15 +4,17 @@ import "../leu-table.js"
4
4
  export default {
5
5
  title: "Table",
6
6
  component: "leu-table",
7
+ parameters: {
8
+ design: {
9
+ type: "figma",
10
+ url: "https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?type=design&node-id=316-2445&mode=design&t=lzVrtq8lxYVJU5TB-11",
11
+ },
12
+ },
7
13
  }
8
14
 
9
- function Template({ itemsOnAPage }) {
15
+ function Template({ itemsPerPage }) {
10
16
  return html`
11
- <leu-table
12
- id="table"
13
- itemsOnAPage=${itemsOnAPage}
14
- style="max-width:500px;"
15
- ></leu-table>
17
+ <leu-table id="table" itemsPerPage=${itemsPerPage}></leu-table>
16
18
  <script>
17
19
  {
18
20
  const table = document.querySelector("leu-table[id=table]")
@@ -39,7 +41,10 @@ function Template({ itemsOnAPage }) {
39
41
  value: (row) => row.menge,
40
42
  style: (row) => {
41
43
  return {
42
- color: row.menge > 10 ? "green" : "red",
44
+ color:
45
+ row.menge > 10
46
+ ? "var(--leu-color-func-green)"
47
+ : "var(--leu-color-func-red)",
43
48
  }
44
49
  },
45
50
  sort: {
@@ -96,7 +101,7 @@ function Template({ itemsOnAPage }) {
96
101
 
97
102
  export const Regular = Template.bind({})
98
103
  Regular.argTypes = {
99
- itemsOnAPage: { type: "number" },
104
+ itemsPerPage: { type: "number" },
100
105
  columns: { table: { disable: true } },
101
106
  data: { table: { disable: true } },
102
107
  _columns: { table: { disable: true } },
@@ -108,9 +113,14 @@ Regular.argTypes = {
108
113
  _sortArrowDown: { table: { disable: true } },
109
114
  _sortArrowUp: { table: { disable: true } },
110
115
  _scrollRef: { table: { disable: true } },
111
- _itemsOnAPage: { table: { disable: true } },
116
+ _itemsPerPage: { table: { disable: true } },
112
117
  _sortedData: { table: { disable: true } },
113
118
  }
114
119
  Regular.args = {
115
- itemsOnAPage: null,
120
+ itemsPerPage: null,
121
+ }
122
+
123
+ export const Pagination = Template.bind({})
124
+ Pagination.args = {
125
+ itemsPerPage: 10,
116
126
  }
@@ -0,0 +1,99 @@
1
+ :host {
2
+ position: relative;
3
+ display: block;
4
+ }
5
+
6
+ div.scroll {
7
+ display: inline-block;
8
+ width: 100%;
9
+ overflow: auto;
10
+ }
11
+
12
+ div.shadow {
13
+ position: absolute;
14
+ left: 0;
15
+ top: 0;
16
+ width: 100%;
17
+ height: 100%;
18
+ pointer-events: none;
19
+ z-index: 1;
20
+ }
21
+
22
+ div.pagination {
23
+ height: calc(100% - 66px);
24
+ }
25
+
26
+ table {
27
+ width: 100%;
28
+ border-spacing: 0;
29
+ color: rgb(0 0 0 / 60%);
30
+ font-size: 16px;
31
+ font-family: var(--leu-font-regular);
32
+ line-height: 1.5;
33
+ }
34
+
35
+ td {
36
+ padding: 12px;
37
+ }
38
+
39
+ th {
40
+ padding: 16px 16px 8px;
41
+ text-align: left;
42
+ font-size: 12px;
43
+ font-weight: normal;
44
+ font-family: var(--leu-font-black);
45
+ background: var(--table-even-row-bg);
46
+ }
47
+
48
+ td:first-child,
49
+ th:first-child {
50
+ left: 0;
51
+ background: inherit;
52
+ z-index: 1;
53
+ }
54
+
55
+ tr {
56
+ background: #fff;
57
+ }
58
+
59
+ tbody tr:nth-child(odd) {
60
+ background: var(--leu-color-black-5);
61
+ }
62
+
63
+ button {
64
+ background: none;
65
+ cursor: pointer;
66
+ line-height: 1.5;
67
+ padding: 0;
68
+ border: 0;
69
+ width: 100%;
70
+ display: flex;
71
+ align-items: flex-center;
72
+ font-size: inherit;
73
+ font-family: inherit;
74
+ }
75
+
76
+ thead svg {
77
+ display: inline-block;
78
+ color: var(--leu-color-accent-blue);
79
+ padding: 0;
80
+ }
81
+
82
+ table.sticky td:first-child,
83
+ table.sticky th:first-child {
84
+ position: sticky;
85
+ }
86
+
87
+ div.shadow-left table.sticky td:first-child,
88
+ div.shadow-left table.sticky th:first-child {
89
+ box-shadow: 0 0 5px rgb(0 0 0 / 50%);
90
+ clip-path: inset(0 -15px 0 0);
91
+ }
92
+
93
+ div.shadow-left {
94
+ box-shadow: inset 5px 0 5px -5px rgb(0 0 0 / 50%);
95
+ }
96
+
97
+ div.shadow-right {
98
+ box-shadow: inset -5px 0 5px -5px rgb(0 0 0 / 50%);
99
+ }
@@ -23,7 +23,7 @@ async function defaultFixture() {
23
23
 
24
24
  describe("LeuTable", () => {
25
25
  it("is a defined element", async () => {
26
- const el = await customElements.get("leu-table")
26
+ const el = customElements.get("leu-table")
27
27
 
28
28
  await expect(el).not.to.be.undefined
29
29
  })
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wrap a Function to nsure that time-consuming tasks do not fire so often
3
+ * @param {Function} func - Your function
4
+ * @param {Number} timeout - Default is 500 ms
5
+ * @returns {Function} - Your function wrapped in a timeout function
6
+ */
7
+ const debounce = function (func, timeout = 500) {
8
+ let timer = null
9
+ return (...args) => {
10
+ clearTimeout(timer)
11
+ timer = setTimeout(() => {
12
+ func.apply(this, args)
13
+ }, timeout)
14
+ }
15
+ }
16
+
17
+ export { debounce }
@@ -1,6 +1,5 @@
1
1
  import { fromRollup } from "@web/dev-server-rollup"
2
2
  import rollupJson from "@rollup/plugin-json"
3
- import { storybookPlugin } from "@web/dev-server-storybook"
4
3
 
5
4
  import { plugins as rollupPlugins } from "./rollup.config.js"
6
5
 
@@ -15,5 +14,5 @@ export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
15
14
  "**/custom-elements.json": "js",
16
15
  "src/components/**/*.css": "js",
17
16
  },
18
- plugins: [storybookPlugin({ type: "web-components" }), ...plugins, json()],
17
+ plugins: [...plugins, json()],
19
18
  })
@@ -1,12 +1,12 @@
1
1
  import { playwrightLauncher } from "@web/test-runner-playwright"
2
- import { plugins as devServerPlugins } from "./web-dev-server-storybook.config.mjs"
2
+ import { plugins as wdsPlugins } from "./web-dev-server.config.mjs"
3
3
 
4
4
  const filteredLogs = ["Running in dev mode", "lit-html is in dev mode"]
5
5
 
6
6
  export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
7
7
  /** Test files to run */
8
8
  files: "src/components/**/*.test.js",
9
- plugins: devServerPlugins,
9
+ plugins: wdsPlugins,
10
10
  mimeTypes: {
11
11
  "src/components/**/*.css": "js",
12
12
  },
@@ -45,5 +45,18 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
45
45
  // playwrightLauncher({ product: "webkit" }),
46
46
  ],
47
47
 
48
+ testRunnerHtml: (testFramework) =>
49
+ `<html>
50
+ <head>
51
+ <meta charset="utf-8" />
52
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
53
+ <link rel="stylesheet" href="dist/theme.css" />
54
+ <link rel="stylesheet" href="https://www.web.statistik.zh.ch/leu/styles/fonts.css" />
55
+ </head>
56
+ <body>
57
+ <script type="module" src="${testFramework}"></script>
58
+ </body>
59
+ </html>`,
60
+
48
61
  // See documentation for all available options
49
62
  })