@statistikzh/leu 0.17.0 → 0.18.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 (80) hide show
  1. package/.release-please-manifest.json +1 -1
  2. package/CHANGELOG.md +18 -0
  3. package/dist/Accordion.js +1 -1
  4. package/dist/Button.js +1 -1
  5. package/dist/ButtonGroup.js +1 -1
  6. package/dist/ChartWrapper.js +1 -1
  7. package/dist/Checkbox.js +1 -1
  8. package/dist/CheckboxGroup.js +1 -1
  9. package/dist/Chip.js +1 -1
  10. package/dist/ChipGroup.js +1 -1
  11. package/dist/ChipLink.js +1 -1
  12. package/dist/ChipRemovable.js +3 -1
  13. package/dist/ChipSelectable.js +1 -1
  14. package/dist/Dialog.js +3 -1
  15. package/dist/Dropdown.js +1 -1
  16. package/dist/Icon.d.ts +130 -2
  17. package/dist/Icon.js +96 -69
  18. package/dist/Input.d.ts +0 -9
  19. package/dist/Input.js +6 -23
  20. package/dist/{LeuElement-BRZYxDjR.js → LeuElement-DgiuzsX9.js} +1 -1
  21. package/dist/Menu.js +3 -1
  22. package/dist/MenuItem.js +3 -1
  23. package/dist/Message.js +1 -1
  24. package/dist/Pagination.js +1 -1
  25. package/dist/Placeholder.js +1 -1
  26. package/dist/Popup.js +1 -1
  27. package/dist/Radio.js +1 -1
  28. package/dist/RadioGroup.js +1 -1
  29. package/dist/Range.js +1 -1
  30. package/dist/ScrollTop.js +1 -1
  31. package/dist/Select.js +1 -1
  32. package/dist/Spinner.js +1 -1
  33. package/dist/Table.js +2 -2
  34. package/dist/Tag.js +1 -1
  35. package/dist/VisuallyHidden.js +1 -1
  36. package/dist/components/icon/Icon.d.ts +5 -2
  37. package/dist/components/icon/Icon.d.ts.map +1 -1
  38. package/dist/components/icon/paths.d.ts +48 -23
  39. package/dist/components/icon/paths.d.ts.map +1 -1
  40. package/dist/components/icon/stories/icon.stories.d.ts.map +1 -1
  41. package/dist/components/input/Input.d.ts +0 -9
  42. package/dist/components/input/Input.d.ts.map +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/leu-accordion.js +1 -1
  45. package/dist/leu-button-group.js +1 -1
  46. package/dist/leu-button.js +1 -1
  47. package/dist/leu-chart-wrapper.js +1 -1
  48. package/dist/leu-checkbox-group.js +1 -1
  49. package/dist/leu-checkbox.js +1 -1
  50. package/dist/leu-chip-group.js +1 -1
  51. package/dist/leu-chip-link.js +1 -1
  52. package/dist/leu-chip-removable.js +3 -1
  53. package/dist/leu-chip-selectable.js +1 -1
  54. package/dist/leu-dialog.js +3 -1
  55. package/dist/leu-dropdown.js +1 -1
  56. package/dist/leu-icon.js +3 -1
  57. package/dist/leu-input.js +3 -1
  58. package/dist/leu-menu-item.js +3 -1
  59. package/dist/leu-menu.js +3 -1
  60. package/dist/leu-message.js +1 -1
  61. package/dist/leu-pagination.js +1 -1
  62. package/dist/leu-placeholder.js +1 -1
  63. package/dist/leu-popup.js +1 -1
  64. package/dist/leu-radio-group.js +1 -1
  65. package/dist/leu-radio.js +1 -1
  66. package/dist/leu-range.js +1 -1
  67. package/dist/leu-scroll-top.js +1 -1
  68. package/dist/leu-select.js +1 -1
  69. package/dist/leu-spinner.js +1 -1
  70. package/dist/leu-table.js +3 -3
  71. package/dist/leu-tag.js +1 -1
  72. package/dist/leu-visually-hidden.js +1 -1
  73. package/dist/vscode.html-custom-data.json +1 -1
  74. package/dist/web-types.json +2 -2
  75. package/package.json +1 -1
  76. package/src/components/icon/Icon.ts +7 -10
  77. package/src/components/icon/paths.ts +126 -77
  78. package/src/components/icon/stories/icon.stories.ts +5 -0
  79. package/src/components/icon/test/icon.test.ts +5 -4
  80. package/src/components/input/Input.ts +3 -26
@@ -2,16 +2,17 @@ import { html } from "lit"
2
2
  import { fixture, expect } from "@open-wc/testing"
3
3
 
4
4
  import "../leu-icon.js"
5
+ import { IconPathName } from "../paths.js"
5
6
 
6
- async function defaultFixture(name = "close") {
7
+ async function defaultFixture(name: IconPathName | "" = "close") {
7
8
  return fixture(html` <leu-icon name=${name}></leu-icon> `)
8
9
  }
9
10
 
10
11
  describe("LeuIcon", () => {
11
12
  it("is a defined element", async () => {
12
- const el = await customElements.get("leu-icon")
13
+ const el = customElements.get("leu-icon")
13
14
 
14
- await expect(el).not.to.be.undefined
15
+ expect(el).not.to.be.undefined
15
16
  })
16
17
 
17
18
  it("passes the a11y audit", async () => {
@@ -30,7 +31,7 @@ describe("LeuIcon", () => {
30
31
  })
31
32
 
32
33
  it("renders the correct icon path", async () => {
33
- const el = await defaultFixture("angleDropup")
34
+ const el = await defaultFixture("angleDropUp")
34
35
 
35
36
  const path = el.shadowRoot.querySelector("path")
36
37
  expect(path).to.have.attribute("d", "M7 14.5L12 9.5L17 14.5H7Z")
@@ -250,29 +250,6 @@ export class LeuInput extends LeuElement {
250
250
  )
251
251
  }
252
252
 
253
- /**
254
- * Method for getting the id of the input element.
255
- * If the id attribute is set, the value of the id attribute is returned.
256
- * Otherwise a random id is generated and returned.
257
- *
258
- * @private
259
- * @returns {string} id
260
- */
261
- getId() {
262
- const id = this.getAttribute("id")
263
-
264
- if (id !== null && id !== "") {
265
- return id
266
- }
267
-
268
- if (this._identifier !== "") {
269
- return this._identifier
270
- }
271
-
272
- this._identifier = crypto.randomUUID()
273
- return this._identifier
274
- }
275
-
276
253
  /**
277
254
  * Merge custom and default validation messages.
278
255
  * A validation message can be a function or a string.
@@ -352,7 +329,7 @@ export class LeuInput extends LeuElement {
352
329
  }
353
330
 
354
331
  return html`
355
- <ul class="error" aria-errormessage=${`input-${this.getId()}`}>
332
+ <ul class="error" aria-errormessage="input">
356
333
  ${errorMessages.map(
357
334
  (message) => html`<li class="error-message">${message}</li>`,
358
335
  )}
@@ -412,7 +389,7 @@ export class LeuInput extends LeuElement {
412
389
  >
413
390
  <input
414
391
  class="input"
415
- id="input-${this.getId()}"
392
+ id="input"
416
393
  type=${this.type}
417
394
  name=${this.name}
418
395
  @change=${this.handleChange}
@@ -431,7 +408,7 @@ export class LeuInput extends LeuElement {
431
408
  ref=${ref(this._inputRef)}
432
409
  aria-invalid=${isInvalid}
433
410
  />
434
- <label for="input-${this.getId()}" class="label">${this.label}</label>
411
+ <label for="input" class="label">${this.label}</label>
435
412
  ${this.prefix
436
413
  ? html`<div class="prefix" .aria-hidden=${true}>${this.prefix}</div>`
437
414
  : nothing}