@skf-design-system/ui-components 0.0.1-beta.4 → 1.0.0-beta.3

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 (102) hide show
  1. package/dist/components/accordion/accordion.component.d.ts +9 -5
  2. package/dist/components/accordion/accordion.component.js +22 -19
  3. package/dist/components/accordion/accordion.d.ts +1 -1
  4. package/dist/components/accordion/accordion.styles.js +3 -3
  5. package/dist/components/alert/alert.component.d.ts +7 -4
  6. package/dist/components/alert/alert.component.js +1 -1
  7. package/dist/components/alert/alert.styles.js +1 -1
  8. package/dist/components/button/button.component.js +1 -1
  9. package/dist/components/button/button.styles.js +1 -1
  10. package/dist/components/card/card.component.d.ts +3 -3
  11. package/dist/components/card/card.component.js +16 -19
  12. package/dist/components/card/card.styles.js +11 -3
  13. package/dist/components/checkbox/checkbox.component.d.ts +9 -6
  14. package/dist/components/checkbox/checkbox.component.js +8 -8
  15. package/dist/components/checkbox/checkbox.styles.js +1 -1
  16. package/dist/components/checkbox/checkbox.test.d.ts +1 -0
  17. package/dist/components/collapse/collapse.component.d.ts +9 -6
  18. package/dist/components/collapse/collapse.component.js +39 -36
  19. package/dist/components/collapse/collapse.styles.js +3 -3
  20. package/dist/components/collapse/collapse.test.d.ts +1 -0
  21. package/dist/components/divider/divider.component.d.ts +13 -10
  22. package/dist/components/divider/divider.component.js +34 -29
  23. package/dist/components/divider/divider.styles.js +1 -5
  24. package/dist/components/heading/heading.component.d.ts +12 -2
  25. package/dist/components/heading/heading.component.js +14 -14
  26. package/dist/components/heading/heading.styles.js +1 -1
  27. package/dist/components/icon/icon.component.d.ts +14 -8
  28. package/dist/components/icon/icon.component.js +6 -6
  29. package/dist/components/icon/icon.styles.js +1 -1
  30. package/dist/components/input/input.component.d.ts +34 -29
  31. package/dist/components/input/input.component.js +36 -36
  32. package/dist/components/link/link.component.d.ts +15 -12
  33. package/dist/components/link/link.component.js +7 -7
  34. package/dist/components/link/link.styles.js +1 -1
  35. package/dist/components/loader/loader.component.d.ts +7 -7
  36. package/dist/components/loader/loader.component.js +35 -61
  37. package/dist/components/loader/loader.styles.js +42 -10
  38. package/dist/components/logo/logo.component.d.ts +5 -3
  39. package/dist/components/logo/logo.component.js +8 -8
  40. package/dist/components/logo/logo.styles.js +2 -2
  41. package/dist/components/radio/radio.component.d.ts +15 -13
  42. package/dist/components/radio/radio.component.js +3 -3
  43. package/dist/components/radio/radio.styles.js +3 -3
  44. package/dist/components/select/select.component.d.ts +137 -0
  45. package/dist/components/select/select.component.js +311 -0
  46. package/dist/components/select/select.controllers.d.ts +59 -0
  47. package/dist/components/select/select.controllers.js +169 -0
  48. package/dist/components/select/select.d.ts +8 -0
  49. package/dist/components/select/select.js +6 -0
  50. package/dist/components/select/select.styles.d.ts +1 -0
  51. package/dist/components/select/select.styles.js +116 -0
  52. package/dist/components/select-option/select-option.component.d.ts +77 -0
  53. package/dist/components/select-option/select-option.component.js +117 -0
  54. package/dist/components/select-option/select-option.controllers.d.ts +9 -0
  55. package/dist/components/select-option/select-option.d.ts +8 -0
  56. package/dist/components/select-option/select-option.js +6 -0
  57. package/dist/components/select-option/select-option.styles.d.ts +1 -0
  58. package/dist/components/select-option/select-option.styles.js +53 -0
  59. package/dist/components/select-option-group/select-option-group.component.d.ts +16 -0
  60. package/dist/components/select-option-group/select-option-group.component.js +31 -0
  61. package/dist/components/select-option-group/select-option-group.d.ts +8 -0
  62. package/dist/components/select-option-group/select-option-group.js +6 -0
  63. package/dist/components/select-option-group/select-option-group.style.d.ts +1 -0
  64. package/dist/components/select-option-group/select-option-group.style.js +18 -0
  65. package/dist/components/switch/switch.component.d.ts +2 -3
  66. package/dist/components/switch/switch.component.js +1 -1
  67. package/dist/components/switch/switch.styles.js +1 -1
  68. package/dist/components/switch/switch.test.d.ts +1 -0
  69. package/dist/components/tag/tag.component.d.ts +25 -4
  70. package/dist/components/tag/tag.component.js +66 -29
  71. package/dist/components/tag/tag.styles.js +6 -5
  72. package/dist/components/textarea/textarea.component.d.ts +26 -23
  73. package/dist/components/textarea/textarea.component.js +15 -12
  74. package/dist/custom-elements.json +960 -305
  75. package/dist/index.d.ts +3 -0
  76. package/dist/index.js +39 -30
  77. package/dist/internal/components/formBase.d.ts +18 -1
  78. package/dist/internal/components/formBase.js +25 -13
  79. package/dist/internal/components/skf-element.d.ts +4 -4
  80. package/dist/internal/components/skf-element.js +15 -19
  81. package/dist/internal/helpers/array.d.ts +4 -0
  82. package/dist/internal/helpers/findMatchingTags.d.ts +2 -0
  83. package/dist/internal/helpers/findMatchingTags.js +12 -0
  84. package/dist/internal/helpers/hintSeverity.d.ts +2 -0
  85. package/dist/internal/helpers/hintSeverity.js +6 -0
  86. package/dist/internal/helpers/raiseError.d.ts +28 -0
  87. package/dist/internal/helpers/raiseError.js +29 -0
  88. package/dist/internal/storybook/shadowRootTraverser.d.ts +16 -6
  89. package/dist/react/index.d.ts +3 -0
  90. package/dist/react/index.js +3 -0
  91. package/dist/react/skf-select/index.d.ts +21 -0
  92. package/dist/react/skf-select/index.js +21 -0
  93. package/dist/react/skf-select-option/index.d.ts +9 -0
  94. package/dist/react/skf-select-option/index.js +17 -0
  95. package/dist/react/skf-select-option-group/index.d.ts +3 -0
  96. package/dist/react/skf-select-option-group/index.js +13 -0
  97. package/dist/styles/form-field.styles.js +7 -7
  98. package/dist/types/jsx/custom-element-jsx.d.ts +290 -140
  99. package/dist/types/vue/index.d.ts +223 -90
  100. package/dist/vscode.html-custom-data.json +294 -97
  101. package/dist/web-types.json +614 -242
  102. package/package.json +34 -30
@@ -12,7 +12,7 @@ interface SkfTextAreaProps extends Omit<FormFieldBaseProps, 'type'> {
12
12
  /**
13
13
  * The skf-textarea is used to create a textarea. Use it inside a form element or wherever you like.
14
14
  *
15
- * @documentation See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/619e4125b3d2147c0c584b11) for design principles.
15
+ * @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/143f9d-text-area) for design principles.
16
16
  *
17
17
  * @attribute {boolean} disabled - If true, sets disabled state
18
18
  * @attribute {boolean} required - If true, value is required or must be checked for the form to be submittable
@@ -20,48 +20,51 @@ interface SkfTextAreaProps extends Omit<FormFieldBaseProps, 'type'> {
20
20
  * @event change - Fires when the value of the input changes
21
21
  * @event invalid - Fires when the input is invalid
22
22
  *
23
- * @slot The textareas label. Alternatively, you can use the `label` attribute.
23
+ * @slot - The textareas label. Alternatively, you can use the `label` attribute.
24
24
  *
25
25
  * @tagname skf-textarea
26
26
  */
27
27
  export declare class SkfTextArea extends FormBase implements SkfTextAreaProps {
28
28
  static styles: CSSResultGroup;
29
29
  private customError;
30
- /** If provided, sets the cols of the textarea */
31
- cols?: number | undefined;
32
- /** If provided, forces component to invalid state until removed. Its value is used as hint text. */
30
+ /** If defined, sets the cols of the textarea */
31
+ cols?: number;
32
+ /** If defined, forces component to invalid state until removed. Its value is used as hint text. */
33
33
  set customInvalid(value: string | undefined);
34
34
  get customInvalid(): string | undefined;
35
- /** If provided, outputs helping hints in console */
36
- debug: boolean;
37
- /** hide-label - If true, hides the label visually */
38
- hideLabel: boolean;
39
- /** If provided, displays informational text below the field */
35
+ /** If true, outputs helping hints in console */
36
+ debug?: boolean;
37
+ /** If true, hides the label visually */
38
+ hideLabel?: boolean;
39
+ /** If defined, displays informational text below the field */
40
40
  hint?: string;
41
- /** The input's label. Alternatively, you can use the component slot. */
42
- label: string;
43
- /** If provided, adds name to the input-element */
41
+ /** If defined, sets the input's label unless the default slot is used. Alternatively, you can use the `label` attribute. */
42
+ label?: string;
43
+ /** If defined, adds name to the input-element */
44
44
  name?: string;
45
- /** If provided, sets the maximum character length to accept for this input */
45
+ /** If defined, sets the maximum character length to accept for this input */
46
46
  maxLength?: number;
47
- /** If provided, sets the minimum character length to accept for this input */
47
+ /** If defined, sets the minimum character length to accept for this input */
48
48
  minLength?: number;
49
- /** If provided, displays placeholder text */
49
+ /** If defined, displays placeholder text */
50
50
  placeholder?: string;
51
51
  /** If true, makes the element not mutable, meaning the user can not edit the control */
52
52
  readonly?: boolean;
53
- /** If provided, renders an alternative A11y text for the asterisk */
53
+ /** If defined, renders an alternative A11y text for the asterisk */
54
54
  requiredLabel?: string;
55
- /** If provided, sets the rows of the textarea */
56
- rows?: number | undefined;
57
- /** @type { "success" | "error" } - If provided, displays provided severity state */
55
+ /** If defined, sets the rows of the textarea */
56
+ rows?: number;
57
+ /**
58
+ * If defined, displays provided severity state
59
+ * @type {"success" | "info" | "warning" | "alert"}
60
+ */
58
61
  severity?: SkfTextAreaProps['severity'];
59
62
  /** If true, displays valid state after interaction */
60
63
  showValid?: boolean;
61
- /** If provided, displays an alternative size */
64
+ /** Size of the Textarea */
62
65
  size?: 'sm' | 'md';
63
- /** If provided, sets validation start, "input", "change" or "submit" */
64
- validateOn?: 'input' | 'change' | 'submit';
66
+ /** Sets validation start */
67
+ validateOn: 'input' | 'change' | 'submit';
65
68
  /** The current value of the text area */
66
69
  value: string;
67
70
  /** @internal */
@@ -14,7 +14,7 @@ var $ = Object.defineProperty, E = Object.getOwnPropertyDescriptor, e = (h, t, s
14
14
  };
15
15
  const u = class u extends m {
16
16
  constructor() {
17
- super(...arguments), this.cols = 20, this.debug = !1, this.hideLabel = !1, this.label = "Default label", this.rows = 2, this.size = "md", this.validateOn = "change", this.value = "", this.invalid = !1, this._resetValue = (t) => {
17
+ super(...arguments), this.size = "md", this.validateOn = "change", this.value = "", this.invalid = !1, this._resetValue = (t) => {
18
18
  var s;
19
19
  t.stopPropagation(), this.value = ((s = this.getAttribute("value")) == null ? void 0 : s.trim()) ?? "", this._internals.setFormValue(this.value), this.$input.focus();
20
20
  }, this._handleInput = () => {
@@ -22,7 +22,7 @@ const u = class u extends m {
22
22
  };
23
23
  }
24
24
  set customInvalid(t) {
25
- this.customError = String(t);
25
+ this.customError = t || "";
26
26
  }
27
27
  get customInvalid() {
28
28
  return this.customError;
@@ -78,14 +78,15 @@ const u = class u extends m {
78
78
  render() {
79
79
  var t, s;
80
80
  return p`
81
- <div id="field">
81
+ <div id="root">
82
82
  <label>
83
83
  <div class=${this.hideLabel ? "visually-hidden" : ""} id="label">
84
- ${this.label} ${this.required ? c(this.requiredLabel) : null}
84
+ <slot>${this.label}</slot> ${this.required ? c(this.requiredLabel) : null}
85
85
  </div>
86
86
  <div id="input">
87
87
  <textarea
88
88
  ?disabled=${this.disabled}
89
+ ?readonly=${this.readonly}
89
90
  ?required=${this.required}
90
91
  .value=${this.value}
91
92
  @input=${this._handleInput}
@@ -93,22 +94,24 @@ const u = class u extends m {
93
94
  aria-errormessage=${n((s = this.hint) != null && s.trim() ? "hint" : v)}
94
95
  aria-invalid=${!!this.invalid}
95
96
  cols=${n(this.cols)}
96
- name=${n(this.name)}
97
97
  maxlength=${n(this.maxLength)}
98
98
  minlength=${n(this.minLength)}
99
+ name=${n(this.name)}
99
100
  placeholder=${n(this.placeholder)}
100
- ?readonly=${this.readonly}
101
101
  rows=${n(this.rows)}
102
102
  >
103
103
  </textarea>
104
104
  </div>
105
105
  </label>
106
- ${this.hint && p`<skf-hint
107
- aria-live=${this.invalid ? "assertive" : "polite"}
108
- id="hint"
109
- severity=${n(_(this.severity, this.invalid))}
110
- >${this.hint}</skf-hint
111
- >`}
106
+ ${this.hint && p`
107
+ <skf-hint
108
+ aria-live=${this.invalid ? "assertive" : "polite"}
109
+ id="hint"
110
+ severity=${n(_(this.severity, this.invalid))}
111
+ >
112
+ ${this.customInvalid ? this.customInvalid : this.hint}
113
+ </skf-hint>
114
+ `}
112
115
  </div>
113
116
  `;
114
117
  }