@skf-design-system/ui-components 1.0.2-beta.1 → 1.0.2-beta.10

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 (220) hide show
  1. package/README.md +25 -1
  2. package/dist/components/accordion/accordion-item.component.js +49 -38
  3. package/dist/components/accordion/accordion.component.d.ts +2 -2
  4. package/dist/components/accordion/accordion.component.js +12 -12
  5. package/dist/components/alert/alert.component.d.ts +8 -3
  6. package/dist/components/alert/alert.component.js +59 -50
  7. package/dist/components/alert/alert.styles.js +51 -47
  8. package/dist/components/breadcrumb/breadcrumb-item.component.js +30 -32
  9. package/dist/components/breadcrumb/breadcrumb-item.d.ts +2 -2
  10. package/dist/components/breadcrumb/breadcrumb-item.styles.js +16 -15
  11. package/dist/components/breadcrumb/breadcrumb.component.d.ts +5 -2
  12. package/dist/components/breadcrumb/breadcrumb.component.js +51 -46
  13. package/dist/components/breadcrumb/breadcrumb.d.ts +2 -2
  14. package/dist/components/breadcrumb/breadcrumb.styles.js +13 -10
  15. package/dist/components/button/button.component.js +63 -67
  16. package/dist/components/button/button.styles.js +5 -4
  17. package/dist/components/card/card.component.d.ts +5 -0
  18. package/dist/components/card/card.component.js +46 -24
  19. package/dist/components/card/card.styles.js +31 -14
  20. package/dist/components/checkbox/checkbox.component.d.ts +6 -5
  21. package/dist/components/checkbox/checkbox.component.js +67 -69
  22. package/dist/components/checkbox/checkbox.styles.js +1 -1
  23. package/dist/components/{date-picker/datepicker.calendar.component.d.ts → datepicker/datepicker-calendar.component.d.ts} +8 -1
  24. package/dist/components/{date-picker/datepicker.calendar.component.js → datepicker/datepicker-calendar.component.js} +109 -115
  25. package/dist/components/datepicker/datepicker-calendar.d.ts +8 -0
  26. package/dist/components/datepicker/datepicker-calendar.js +6 -0
  27. package/dist/components/{date-picker/datepicker.component.d.ts → datepicker/datepicker-popup.component.d.ts} +9 -20
  28. package/dist/components/datepicker/datepicker-popup.component.js +272 -0
  29. package/dist/components/datepicker/datepicker-popup.d.ts +8 -0
  30. package/dist/components/{date-picker/datepicker.helpers.d.ts → datepicker/datepicker-popup.helpers.d.ts} +3 -3
  31. package/dist/components/datepicker/datepicker-popup.helpers.js +83 -0
  32. package/dist/components/datepicker/datepicker-popup.js +6 -0
  33. package/dist/components/{date-picker/datepicker.styles.js → datepicker/datepicker-popup.styles.js} +3 -3
  34. package/dist/components/{date-picker-input/datepicker-input.component.d.ts → datepicker/datepicker.component.d.ts} +21 -14
  35. package/dist/components/datepicker/datepicker.component.js +455 -0
  36. package/dist/components/datepicker/datepicker.d.ts +8 -0
  37. package/dist/components/datepicker/datepicker.js +6 -0
  38. package/dist/components/dialog/dialog.component.d.ts +3 -2
  39. package/dist/components/dialog/dialog.component.js +49 -49
  40. package/dist/components/dialog/dialog.d.ts +2 -2
  41. package/dist/components/divider/divider.component.d.ts +3 -0
  42. package/dist/components/divider/divider.component.js +43 -22
  43. package/dist/components/divider/divider.styles.js +9 -9
  44. package/dist/components/drawer/drawer.component.d.ts +12 -4
  45. package/dist/components/drawer/drawer.component.js +84 -61
  46. package/dist/components/drawer/drawer.d.ts +2 -2
  47. package/dist/components/drawer/drawer.styles.js +47 -40
  48. package/dist/components/header/header.component.d.ts +4 -2
  49. package/dist/components/header/header.component.js +64 -57
  50. package/dist/components/header/header.d.ts +2 -2
  51. package/dist/components/header/header.styles.js +2 -2
  52. package/dist/components/heading/heading.component.d.ts +5 -1
  53. package/dist/components/heading/heading.component.js +54 -27
  54. package/dist/components/heading/heading.styles.js +34 -36
  55. package/dist/components/icon/icon.component.d.ts +4 -0
  56. package/dist/components/icon/icon.component.js +62 -43
  57. package/dist/components/icon/icon.styles.js +60 -60
  58. package/dist/components/input/input.component.d.ts +4 -8
  59. package/dist/components/input/input.component.js +90 -97
  60. package/dist/components/input/input.controllers.d.ts +0 -1
  61. package/dist/components/input/input.controllers.js +14 -19
  62. package/dist/components/link/link.component.d.ts +15 -18
  63. package/dist/components/link/link.component.js +104 -107
  64. package/dist/components/link/link.styles.js +53 -45
  65. package/dist/components/loader/loader.component.d.ts +5 -3
  66. package/dist/components/loader/loader.component.js +39 -28
  67. package/dist/components/loader/loader.styles.js +6 -10
  68. package/dist/components/logo/logo.component.d.ts +4 -1
  69. package/dist/components/logo/logo.component.js +55 -51
  70. package/dist/components/logo/logo.styles.js +26 -16
  71. package/dist/components/menu/menu-item.component.d.ts +1 -1
  72. package/dist/components/menu/menu-item.component.js +8 -8
  73. package/dist/components/menu/menu-item.d.ts +2 -2
  74. package/dist/components/menu/menu-item.styles.js +13 -9
  75. package/dist/components/menu/menu.component.d.ts +5 -2
  76. package/dist/components/menu/menu.component.js +8 -8
  77. package/dist/components/menu/menu.d.ts +2 -2
  78. package/dist/components/nav/nav-item.component.d.ts +6 -2
  79. package/dist/components/nav/nav-item.component.js +44 -25
  80. package/dist/components/nav/nav-item.styles.js +29 -25
  81. package/dist/components/nav/nav.component.d.ts +9 -0
  82. package/dist/components/nav/nav.component.js +47 -21
  83. package/dist/components/nav/nav.d.ts +2 -2
  84. package/dist/components/nav/nav.styles.js +15 -9
  85. package/dist/components/popover/popover.component.d.ts +10 -3
  86. package/dist/components/popover/popover.component.js +30 -22
  87. package/dist/components/popover/popover.d.ts +2 -2
  88. package/dist/components/progress/progress.component.d.ts +2 -0
  89. package/dist/components/progress/progress.component.js +38 -29
  90. package/dist/components/progress/progress.d.ts +2 -2
  91. package/dist/components/progress/progress.styles.js +10 -8
  92. package/dist/components/radio/radio.component.d.ts +4 -2
  93. package/dist/components/radio/radio.component.js +96 -91
  94. package/dist/components/radio/radio.styles.js +1 -1
  95. package/dist/components/segmented-button/segmented-button-item.component.js +1 -1
  96. package/dist/components/segmented-button/segmented-button-item.d.ts +2 -2
  97. package/dist/components/segmented-button/segmented-button-item.styles.js +1 -1
  98. package/dist/components/segmented-button/segmented-button.component.js +22 -24
  99. package/dist/components/segmented-button/segmented-button.d.ts +2 -2
  100. package/dist/components/select/select-option-group.component.d.ts +4 -0
  101. package/dist/components/select/select-option-group.component.js +37 -18
  102. package/dist/components/select/select-option-group.d.ts +2 -2
  103. package/dist/components/select/select-option-group.style.js +12 -6
  104. package/dist/components/select/select-option.component.d.ts +9 -4
  105. package/dist/components/select/select-option.component.js +70 -58
  106. package/dist/components/select/select-option.styles.js +43 -31
  107. package/dist/components/select/select.component.d.ts +21 -12
  108. package/dist/components/select/select.component.js +125 -87
  109. package/dist/components/select/select.controllers.js +15 -20
  110. package/dist/components/select/select.styles.js +8 -2
  111. package/dist/components/stepper/stepper-item.component.d.ts +1 -1
  112. package/dist/components/stepper/stepper-item.component.js +59 -56
  113. package/dist/components/stepper/stepper-item.d.ts +2 -2
  114. package/dist/components/stepper/stepper-item.styles.js +4 -4
  115. package/dist/components/stepper/stepper.component.js +2 -3
  116. package/dist/components/stepper/stepper.d.ts +2 -2
  117. package/dist/components/stepper/stepper.helpers.js +6 -7
  118. package/dist/components/switch/switch.component.d.ts +4 -2
  119. package/dist/components/switch/switch.component.js +64 -58
  120. package/dist/components/switch/switch.d.ts +2 -2
  121. package/dist/components/switch/switch.styles.js +1 -1
  122. package/dist/components/{tab-panel → tabs}/tab-panel.component.d.ts +1 -1
  123. package/dist/components/tabs/tab-panel.component.js +39 -0
  124. package/dist/components/{tab-panel → tabs}/tab-panel.d.ts +2 -2
  125. package/dist/components/{tab → tabs}/tab.component.d.ts +3 -3
  126. package/dist/components/{tab → tabs}/tab.component.js +17 -14
  127. package/dist/components/{tab → tabs}/tab.d.ts +2 -2
  128. package/dist/components/{tab → tabs}/tab.styles.js +2 -2
  129. package/dist/components/{tab-group/tab-group.component.d.ts → tabs/tabs.component.d.ts} +3 -4
  130. package/dist/components/{tab-group/tab-group.component.js → tabs/tabs.component.js} +35 -36
  131. package/dist/components/tabs/tabs.d.ts +8 -0
  132. package/dist/components/tabs/tabs.js +6 -0
  133. package/dist/components/{tab-group/tab-group.styles.js → tabs/tabs.styles.js} +16 -16
  134. package/dist/components/tag/tag.component.d.ts +10 -2
  135. package/dist/components/tag/tag.component.js +77 -65
  136. package/dist/components/tag/tag.d.ts +2 -2
  137. package/dist/components/tag/tag.styles.js +63 -50
  138. package/dist/components/textarea/textarea.component.d.ts +4 -2
  139. package/dist/components/textarea/textarea.component.js +102 -95
  140. package/dist/components/toast/toast-item.styles.js +13 -10
  141. package/dist/components/toast/toast.component.js +9 -9
  142. package/dist/components/toast/toast.singleton.d.ts +1 -1
  143. package/dist/components/toast/toast.singleton.js +19 -20
  144. package/dist/components/tooltip/tooltip.component.d.ts +9 -2
  145. package/dist/components/tooltip/tooltip.component.js +15 -11
  146. package/dist/components/tooltip/tooltip.d.ts +2 -2
  147. package/dist/custom-elements.json +1681 -1112
  148. package/dist/index.d.ts +8 -7
  149. package/dist/index.js +96 -93
  150. package/dist/internal/base-classes/popover/popover.base.d.ts +24 -5
  151. package/dist/internal/base-classes/popover/popover.base.js +41 -44
  152. package/dist/internal/base-classes/popover/popover.styles.js +4 -5
  153. package/dist/internal/components/formBase.d.ts +1 -0
  154. package/dist/internal/components/formBase.js +11 -19
  155. package/dist/internal/components/hint/hint.component.d.ts +4 -0
  156. package/dist/internal/components/hint/hint.component.js +47 -20
  157. package/dist/internal/components/hint/hint.styles.js +29 -25
  158. package/dist/internal/components/skf-element.d.ts +1 -3
  159. package/dist/internal/components/skf-element.js +4 -9
  160. package/dist/internal/controllers/popover.controller.d.ts +2 -0
  161. package/dist/internal/controllers/popover.controller.js +11 -14
  162. package/dist/internal/helpers/stateMap.d.ts +14 -0
  163. package/dist/internal/helpers/stateMap.js +68 -0
  164. package/dist/internal/helpers/uuid.d.ts +8 -10
  165. package/dist/internal/helpers/uuid.js +4 -11
  166. package/dist/internal/helpers/watch.d.ts +1 -1
  167. package/dist/internal/helpers/watch.js +12 -12
  168. package/dist/internal/templates/asterisk.d.ts +1 -1
  169. package/dist/internal/templates/asterisk.js +4 -4
  170. package/dist/internal/types.d.ts +4 -0
  171. package/dist/styles/component.styles.js +37 -36
  172. package/dist/styles/global-alt.css +1 -0
  173. package/dist/styles/global.css +1 -1
  174. package/dist/translations/en.d.ts +3 -0
  175. package/dist/translations/en.js +27 -0
  176. package/dist/translations/es.d.ts +3 -0
  177. package/dist/translations/es.js +27 -0
  178. package/dist/translations/index.d.ts +4 -0
  179. package/dist/translations/pt.d.ts +3 -0
  180. package/dist/translations/pt.js +27 -0
  181. package/dist/translations/sv.d.ts +3 -0
  182. package/dist/translations/sv.js +27 -0
  183. package/dist/types/jsx/custom-element-jsx.d.ts +1988 -866
  184. package/dist/types/vue/index.d.ts +220 -169
  185. package/dist/utilities/localize.d.ts +28 -0
  186. package/dist/utilities/localize.js +13 -0
  187. package/dist/vscode.html-custom-data.json +265 -188
  188. package/dist/web-types.json +731 -548
  189. package/package.json +38 -51
  190. package/dist/components/accordion/accordion-item.test.d.ts +0 -1
  191. package/dist/components/accordion/accordion.test.d.ts +0 -1
  192. package/dist/components/checkbox/checkbox.test.d.ts +0 -1
  193. package/dist/components/date-picker/datepicker.component.js +0 -261
  194. package/dist/components/date-picker/datepicker.d.ts +0 -10
  195. package/dist/components/date-picker/datepicker.helpers.js +0 -76
  196. package/dist/components/date-picker/datepicker.js +0 -8
  197. package/dist/components/date-picker-input/datepicker-input.component.js +0 -442
  198. package/dist/components/date-picker-input/datepicker-input.d.ts +0 -8
  199. package/dist/components/date-picker-input/datepicker-input.js +0 -6
  200. package/dist/components/input/input.test.d.ts +0 -1
  201. package/dist/components/radio/radio.test.d.ts +0 -1
  202. package/dist/components/switch/switch.test.d.ts +0 -1
  203. package/dist/components/tab-group/tab-group.d.ts +0 -8
  204. package/dist/components/tab-group/tab-group.js +0 -6
  205. package/dist/components/tab-panel/tab-panel.component.js +0 -36
  206. package/dist/internal/playwright/index.d.ts +0 -1
  207. /package/dist/components/{date-picker/datepicker.calendar.styles.d.ts → datepicker/datepicker-calendar.styles.d.ts} +0 -0
  208. /package/dist/components/{date-picker/datepicker.calendar.styles.js → datepicker/datepicker-calendar.styles.js} +0 -0
  209. /package/dist/components/{date-picker/datepicker.styles.d.ts → datepicker/datepicker-popup.styles.d.ts} +0 -0
  210. /package/dist/components/{date-picker-input/datepicker-input.helpers.d.ts → datepicker/datepicker.helpers.d.ts} +0 -0
  211. /package/dist/components/{date-picker-input/datepicker-input.helpers.js → datepicker/datepicker.helpers.js} +0 -0
  212. /package/dist/components/{date-picker-input/datepicker-input.styles.d.ts → datepicker/datepicker.styles.d.ts} +0 -0
  213. /package/dist/components/{date-picker-input/datepicker-input.styles.js → datepicker/datepicker.styles.js} +0 -0
  214. /package/dist/components/select/{select.stories.icons.d.ts → stories/select.stories.icons.d.ts} +0 -0
  215. /package/dist/components/{tab-panel → tabs}/tab-panel.js +0 -0
  216. /package/dist/components/{tab-panel → tabs}/tab-panel.styles.d.ts +0 -0
  217. /package/dist/components/{tab-panel → tabs}/tab-panel.styles.js +0 -0
  218. /package/dist/components/{tab → tabs}/tab.js +0 -0
  219. /package/dist/components/{tab → tabs}/tab.styles.d.ts +0 -0
  220. /package/dist/components/{tab-group/tab-group.styles.d.ts → tabs/tabs.styles.d.ts} +0 -0
@@ -1,16 +1,15 @@
1
- import "../card/card.js";
2
- import { SkfElement as c } from "../../internal/components/skf-element.js";
1
+ import { SkfElement as p } from "../../internal/components/skf-element.js";
3
2
  import { componentStyles as b } from "../../styles/component.styles.js";
4
3
  import { html as f } from "lit";
5
- import { property as o, queryAssignedElements as p } from "lit/decorators.js";
6
- import { classMap as u } from "lit/directives/class-map.js";
7
- import { styles as y } from "./tab-group.styles.js";
8
- var g = Object.defineProperty, i = (h, t, s, r) => {
9
- for (var e = void 0, n = h.length - 1, d; n >= 0; n--)
10
- (d = h[n]) && (e = d(t, s, e) || e);
11
- return e && g(t, s, e), e;
4
+ import { property as o, queryAssignedElements as h } from "lit/decorators.js";
5
+ import { classMap as y } from "lit/directives/class-map.js";
6
+ import { styles as m } from "./tabs.styles.js";
7
+ var u = Object.defineProperty, n = (c, t, s, i) => {
8
+ for (var e = void 0, r = c.length - 1, d; r >= 0; r--)
9
+ (d = c[r]) && (e = d(t, s, e) || e);
10
+ return e && u(t, s, e), e;
12
11
  };
13
- const l = class l extends c {
12
+ const l = class l extends p {
14
13
  constructor() {
15
14
  super(...arguments), this.defaultSelected = 0, this.noBorder = !1, this.noPadding = !1, this.stretch = !1, this.variant = "expanded", this._handleKeyDown = (t) => {
16
15
  if (["ArrowLeft", "ArrowRight"].includes(t.key)) {
@@ -22,15 +21,15 @@ const l = class l extends c {
22
21
  this._selectTab(s);
23
22
  }, this._selectTab = (t) => {
24
23
  this.tabs.forEach((s) => {
25
- const r = this.panels.find((e) => e.name === s.panel);
26
- s.selected = s === t, r && (r.active = s === t);
24
+ const i = this.panels.find((e) => e.name === s.panel);
25
+ s.selected = s === t, i && (i.active = s === t);
27
26
  });
28
27
  }, this._syncTabsAndPanels = () => {
29
28
  this.tabs.forEach((t, s) => {
30
- const r = (s + 1).toString();
31
- t.id = t.id ? t.id : `skf-tab-${r}`, t.selected = this.defaultSelected === s;
32
- const e = this.panels.find((n) => n.name === t.panel);
33
- e && (e.id = e.id ? e.id : `skf-tab-panel-${r}`, t.setAttribute("aria-controls", e.id), e.setAttribute("aria-labelledby", t.id), e.active = t.selected);
29
+ const i = (s + 1).toString();
30
+ t.id = t.id ? t.id : `skf-tab-${i}`, t.selected = this.defaultSelected === s;
31
+ const e = this.panels.find((r) => r.name === t.panel);
32
+ e && (e.id = e.id ? e.id : `skf-tab-panel-${i}`, t.setAttribute("aria-controls", e.id), e.setAttribute("aria-labelledby", t.id), e.active = t.selected);
34
33
  });
35
34
  };
36
35
  }
@@ -51,48 +50,48 @@ const l = class l extends c {
51
50
  return f`
52
51
  <div
53
52
  @keydown=${this._handleKeyDown}
54
- class=${u({
55
- "tab-group": !0,
56
- "tab-group--compressed": this.variant === "compressed",
57
- "tab-group--expanded": this.variant === "expanded",
58
- "tab-group--no-border": this.noBorder,
59
- "tab-group--no-padding": this.noPadding,
60
- "tab-group--stretch": this.stretch
53
+ class=${y({
54
+ tabs: !0,
55
+ "tabs--compressed": this.variant === "compressed",
56
+ "tabs--expanded": this.variant === "expanded",
57
+ "tabs--no-border": this.noBorder,
58
+ "tabs--no-padding": this.noPadding,
59
+ "tabs--stretch": this.stretch
61
60
  })}
62
61
  >
63
- <div class="tab-group__tabs" role="tablist">
62
+ <div class="tabs__list" role="tablist">
64
63
  <slot name="tabs"></slot>
65
64
  </div>
66
- <div class="tab-group__body">
65
+ <div class="tabs__body">
67
66
  <slot></slot>
68
67
  </div>
69
68
  </div>
70
69
  `;
71
70
  }
72
71
  };
73
- l.styles = [b, y];
72
+ l.styles = [b, m];
74
73
  let a = l;
75
- i([
74
+ n([
76
75
  o({ type: Number, attribute: "default-selected" })
77
76
  ], a.prototype, "defaultSelected");
78
- i([
77
+ n([
79
78
  o({ type: Boolean, attribute: "no-border" })
80
79
  ], a.prototype, "noBorder");
81
- i([
80
+ n([
82
81
  o({ type: Boolean, attribute: "no-padding" })
83
82
  ], a.prototype, "noPadding");
84
- i([
83
+ n([
85
84
  o({ type: Boolean })
86
85
  ], a.prototype, "stretch");
87
- i([
86
+ n([
88
87
  o({ reflect: !0 })
89
88
  ], a.prototype, "variant");
90
- i([
91
- p({ slot: "tabs" })
89
+ n([
90
+ h({ slot: "tabs", selector: "skf-tab" })
92
91
  ], a.prototype, "tabs");
93
- i([
94
- p()
92
+ n([
93
+ h({ slot: "", selector: "skf-tab-panel" })
95
94
  ], a.prototype, "panels");
96
95
  export {
97
- a as SkfTabGroup
96
+ a as SkfTabs
98
97
  };
@@ -0,0 +1,8 @@
1
+ import { SkfTabs } from './tabs.component.js';
2
+ export * from './tabs.component.js';
3
+ export default SkfTabs;
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'skf-tabs': SkfTabs;
7
+ }
8
+ }
@@ -0,0 +1,6 @@
1
+ import { SkfTabs as f } from "./tabs.component.js";
2
+ f.define("skf-tabs");
3
+ export {
4
+ f as SkfTabs,
5
+ f as default
6
+ };
@@ -1,5 +1,5 @@
1
- import { css as r } from "lit";
2
- const a = r`
1
+ import { css as s } from "lit";
2
+ const r = s`
3
3
  /* stylelint-disable selector-class-pattern */
4
4
  @layer components {
5
5
  :host {
@@ -13,13 +13,13 @@ const a = r`
13
13
  /**
14
14
  * Root
15
15
  */
16
- .tab-group {
16
+ .tabs {
17
17
  background-color: var(--skf-bg-color-neutral-1);
18
18
  }
19
19
 
20
- .tab-group--expanded {
20
+ .tabs--expanded {
21
21
  border: var(
22
- --_skf-tab-group-border,
22
+ --_skf-tabs-border,
23
23
  var(--skf-border-width-sm) solid var(--skf-border-color-tertiary)
24
24
  );
25
25
  border-end-end-radius: var(--skf-border-radius-sm);
@@ -31,11 +31,11 @@ const a = r`
31
31
  }
32
32
  }
33
33
 
34
- .tab-group--no-border {
35
- --_skf-tab-group-border: none;
34
+ .tabs--no-border {
35
+ --_skf-tabs-border: none;
36
36
  }
37
37
 
38
- .tab-group--stretch {
38
+ .tabs--stretch {
39
39
  block-size: inherit;
40
40
  display: flex;
41
41
  flex-direction: column;
@@ -44,10 +44,10 @@ const a = r`
44
44
  /**
45
45
  * Tabs
46
46
  */
47
- .tab-group__tabs {
47
+ .tabs__list {
48
48
  display: flex;
49
49
 
50
- .tab-group--compressed & {
50
+ .tabs--compressed & {
51
51
  gap: var(--skf-spacing-100);
52
52
  }
53
53
  }
@@ -55,15 +55,15 @@ const a = r`
55
55
  /**
56
56
  * Body
57
57
  */
58
- .tab-group__body {
59
- padding-block: var(--_skf-tab-group-body-padding-block, var(--skf-spacing-100) 0);
58
+ .tabs__body {
59
+ padding-block: var(--_skf-tabs-body-padding-block, var(--skf-spacing-100) 0);
60
60
 
61
- .tab-group--stretch & {
61
+ .tabs--stretch & {
62
62
  overflow-y: auto;
63
63
  }
64
64
 
65
- .tab-group--expanded:not(.tab-group--no-padding) & {
66
- --_skf-tab-group-body-padding-block: var(--skf-spacing-100);
65
+ .tabs--expanded:not(.tabs--no-padding) & {
66
+ --_skf-tabs-body-padding-block: var(--skf-spacing-100);
67
67
 
68
68
  padding-inline: var(--skf-spacing-100);
69
69
  }
@@ -71,5 +71,5 @@ const a = r`
71
71
  }
72
72
  `;
73
73
  export {
74
- a as styles
74
+ r as styles
75
75
  };
@@ -1,7 +1,9 @@
1
1
  import '../icon/icon.js';
2
2
  import { SkfElement } from '../../internal/components/skf-element';
3
3
  import type { Icon, Severity } from '../../internal/types.js';
4
+ import { type Language } from '../../utilities/localize.js';
4
5
  import { type CSSResultGroup } from 'lit';
6
+ type Size = 'sm' | 'md';
5
7
  /**
6
8
  * The `<skf-tag>` is a component that displays a list of actions or options
7
9
  *
@@ -12,17 +14,20 @@ import { type CSSResultGroup } from 'lit';
12
14
  * @tagname skf-tag
13
15
  */
14
16
  export declare class SkfTag extends SkfElement {
17
+ #private;
15
18
  static styles: CSSResultGroup;
16
19
  /** @internal */
17
20
  private _onClick?;
18
21
  /** @internal */
19
- protected _onRemove?: (event: Event) => void;
22
+ private _onRemove?;
20
23
  /** Specifies Tag size */
21
- size: 'sm' | 'md';
24
+ size: Size;
22
25
  /** If defined, displays leading/provided icon */
23
26
  icon?: Icon;
24
27
  /** If defined, gives the supplied appearance */
25
28
  color?: Severity;
29
+ /** Sets the internal language of the component */
30
+ lang: Language;
26
31
  /** If defined, accepts a function that runs on click */
27
32
  set onClick(onClickFn: ((event: Event) => void) | undefined);
28
33
  get onClick(): ((event: Event) => void) | undefined;
@@ -37,6 +42,8 @@ export declare class SkfTag extends SkfElement {
37
42
  disconnectedCallback(): void;
38
43
  attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
39
44
  /** @internal */
45
+ _handleStateChange(property: string, _prev: unknown, next: unknown): void;
46
+ /** @internal */
40
47
  private _handleKeyDown;
41
48
  /** @internal run externally provided callback (if any) first. Let click propagate to handleClick. */
42
49
  private _handleRemove;
@@ -44,3 +51,4 @@ export declare class SkfTag extends SkfElement {
44
51
  private _handleClick;
45
52
  render(): import("lit").TemplateResult<1>;
46
53
  }
54
+ export {};
@@ -1,35 +1,50 @@
1
+ var k = (e) => {
2
+ throw TypeError(e);
3
+ };
4
+ var C = (e, o, t) => o.has(e) || k("Cannot " + t);
5
+ var p = (e, o, t) => (C(e, o, "read from private field"), t ? t.call(e) : o.get(e)), m = (e, o, t) => o.has(e) ? k("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(e) : o.set(e, t), d = (e, o, t, s) => (C(e, o, "write to private field"), s ? s.call(e, t) : o.set(e, t), t);
1
6
  import "../icon/icon.js";
2
- import { SkfElement as u } from "../../internal/components/skf-element.js";
3
- import { componentStyles as f } from "../../styles/component.styles.js";
4
- import { nothing as p, html as a } from "lit";
5
- import { property as n, query as v } from "lit/decorators.js";
6
- import { classMap as d } from "lit/directives/class-map.js";
7
- import { ifDefined as _ } from "lit/directives/if-defined.js";
8
- import { styles as k } from "./tag.styles.js";
9
- var b = Object.defineProperty, y = Object.getOwnPropertyDescriptor, r = (m, e, i, s) => {
10
- for (var t = s > 1 ? void 0 : s ? y(e, i) : e, l = m.length - 1, c; l >= 0; l--)
11
- (c = m[l]) && (t = (s ? c(e, i, t) : c(t)) || t);
12
- return s && t && b(e, i, t), t;
7
+ import { SkfElement as g } from "../../internal/components/skf-element.js";
8
+ import { stateMap as w } from "../../internal/helpers/stateMap.js";
9
+ import { watch as $ } from "../../internal/helpers/watch.js";
10
+ import { componentStyles as R } from "../../styles/component.styles.js";
11
+ import { LocalizeController as z } from "../../utilities/localize.js";
12
+ import { nothing as b, html as u } from "lit";
13
+ import { property as l, query as D } from "lit/decorators.js";
14
+ import { ifDefined as E } from "lit/directives/if-defined.js";
15
+ import { styles as P } from "./tag.styles.js";
16
+ var S = Object.defineProperty, B = Object.getOwnPropertyDescriptor, r = (e, o, t, s) => {
17
+ for (var i = s > 1 ? void 0 : s ? B(o, t) : o, f = e.length - 1, v; f >= 0; f--)
18
+ (v = e[f]) && (i = (s ? v(o, t, i) : v(i)) || i);
19
+ return s && i && S(o, t, i), i;
20
+ };
21
+ const _ = {
22
+ size: ["sm", "md"],
23
+ color: ["error", "info", "success", "warning"]
13
24
  };
14
- const h = class h extends u {
25
+ var a, c, h;
26
+ const y = class y extends g {
15
27
  constructor() {
16
- super(...arguments), this.size = "md", this.removable = !1, this._handleKeyDown = (e) => {
17
- (e.key === "Enter" || e.key === " ") && this.$removeButton.click();
18
- }, this._handleRemove = (e) => {
19
- this._onRemove && this._onRemove(e);
20
- }, this._handleClick = (e) => {
21
- var t;
22
- e.stopPropagation(), e.composedPath()[0].localName === "button" ? this.remove() : (t = this.onClick) == null || t.call(this, e);
28
+ super(...arguments);
29
+ m(this, a);
30
+ m(this, c);
31
+ m(this, h);
32
+ d(this, a, new z(this)), d(this, c, this.attachInternals()), d(this, h, p(this, c).states), this.size = "md", this.lang = "en", this.removable = !1, this._handleKeyDown = (t) => {
33
+ (t.key === "Enter" || t.key === " ") && this.$removeButton.click();
34
+ }, this._handleRemove = (t) => {
35
+ this._onRemove && this._onRemove(t);
36
+ }, this._handleClick = (t) => {
37
+ t.stopPropagation(), t.composedPath()[0].localName === "button" ? this.remove() : this.onClick?.(t);
23
38
  };
24
39
  }
25
- set onClick(e) {
26
- e && (this._onClick = e);
40
+ set onClick(t) {
41
+ t && (this._onClick = t);
27
42
  }
28
43
  get onClick() {
29
44
  return this._onClick;
30
45
  }
31
- set onRemove(e) {
32
- e && (this._onRemove = e);
46
+ set onRemove(t) {
47
+ t && (this._onRemove = t);
33
48
  }
34
49
  get onRemove() {
35
50
  return this._onRemove;
@@ -40,62 +55,59 @@ const h = class h extends u {
40
55
  disconnectedCallback() {
41
56
  super.disconnectedCallback(), this.removeEventListener("click", this._handleClick);
42
57
  }
43
- attributeChangedCallback(e, i, s) {
44
- super.attributeChangedCallback(e, i, s), e === "removable" && s !== null ? this.addEventListener("keydown", this._handleKeyDown) : this.removeEventListener("keydown", this._handleKeyDown);
58
+ attributeChangedCallback(t, s, i) {
59
+ super.attributeChangedCallback(t, s, i), t === "removable" && i !== null ? this.addEventListener("keydown", this._handleKeyDown) : this.removeEventListener("keydown", this._handleKeyDown);
60
+ }
61
+ _handleStateChange(t, s, i) {
62
+ w(p(this, h), _[t]).set(i);
45
63
  }
46
64
  render() {
47
- return a`
48
- <div
49
- class=${d({
50
- tag: !0,
51
- "tag--color-error": this.color === "error",
52
- "tag--color-info": this.color === "info",
53
- "tag--color-success": this.color === "success",
54
- "tag--color-warning": this.color === "warning",
55
- "tag--small": this.size === "sm"
56
- })}
57
- >
58
- ${this.icon ? a`
59
- <skf-icon
60
- class="tag__icon"
61
- color=${_(this.color)}
62
- name=${this.icon}
63
- size="sm"
64
- ></skf-icon>
65
- ` : p}
66
- <slot class="tag__slot"></slot>
67
- ${this.removable ? a`
68
- <button @click=${this._handleRemove} class="tag__btn" type="button">
65
+ return u`
66
+ <div id="root">
67
+ ${this.icon ? u`<skf-icon color=${E(this.color)} name=${this.icon} size="sm"></skf-icon>` : b}
68
+ <slot></slot>
69
+ ${this.removable ? u`
70
+ <button
71
+ @click=${this._handleRemove}
72
+ aria-label=${p(this, a).term("close")}
73
+ type="button"
74
+ >
69
75
  <skf-icon name="close" size="xs"></skf-icon>
70
76
  </button>
71
- ` : p}
77
+ ` : b}
72
78
  </div>
73
79
  `;
74
80
  }
75
81
  };
76
- h.styles = [f, k];
77
- let o = h;
82
+ a = new WeakMap(), c = new WeakMap(), h = new WeakMap(), y.styles = [R, P];
83
+ let n = y;
84
+ r([
85
+ l({ type: String })
86
+ ], n.prototype, "size", 2);
87
+ r([
88
+ l({ type: String })
89
+ ], n.prototype, "icon", 2);
78
90
  r([
79
- n({ reflect: !0 })
80
- ], o.prototype, "size", 2);
91
+ l({ type: String })
92
+ ], n.prototype, "color", 2);
81
93
  r([
82
- n()
83
- ], o.prototype, "icon", 2);
94
+ l({ type: String })
95
+ ], n.prototype, "lang", 2);
84
96
  r([
85
- n({ reflect: !0 })
86
- ], o.prototype, "color", 2);
97
+ l({ attribute: !1 })
98
+ ], n.prototype, "onClick", 1);
87
99
  r([
88
- n({ attribute: !1 })
89
- ], o.prototype, "onClick", 1);
100
+ l({ attribute: !1 })
101
+ ], n.prototype, "onRemove", 1);
90
102
  r([
91
- n({ attribute: !1 })
92
- ], o.prototype, "onRemove", 1);
103
+ l({ type: Boolean })
104
+ ], n.prototype, "removable", 2);
93
105
  r([
94
- n({ type: Boolean, reflect: !0 })
95
- ], o.prototype, "removable", 2);
106
+ D("button")
107
+ ], n.prototype, "$removeButton", 2);
96
108
  r([
97
- v("button")
98
- ], o.prototype, "$removeButton", 2);
109
+ $(Object.keys(_))
110
+ ], n.prototype, "_handleStateChange", 1);
99
111
  export {
100
- o as SkfTag
112
+ n as SkfTag
101
113
  };
@@ -1,5 +1,5 @@
1
- import { SkfTag } from './tag.component';
2
- export * from './tag.component';
1
+ import { SkfTag } from './tag.component.js';
2
+ export * from './tag.component.js';
3
3
  export default SkfTag;
4
4
  declare global {
5
5
  interface HTMLElementTagNameMap {
@@ -1,66 +1,79 @@
1
1
  import { css as r } from "lit";
2
2
  const s = r`
3
- /* stylelint-disable selector-class-pattern */
4
3
  @layer components {
5
- .tag {
6
- align-items: center;
7
- background-color: var(--_skf-tag-bg-color, var(--skf-bg-color-neutral-1));
8
- block-size: var(--_skf-tag-height, var(--skf-size-32));
9
- border: var(--skf-border-width-sm) solid
10
- var(--_skf-tag-border-color, var(--skf-border-color-primary));
11
- border-radius: var(--_skf-tag-border-radius, var(--skf-border-radius-md));
12
- color: var(--_skf-tag-text-color, var(--skf-text-color-primary));
13
- display: inline-flex;
14
- font-size: var(--_skf-tag-font-size, var(--skf-font-size-50));
15
- gap: var(--skf-spacing-25);
16
- max-inline-size: 48ch;
17
- padding-inline: var(--skf-spacing-50);
18
- }
4
+ @layer base {
5
+ :host {
6
+ display: inline-flex;
7
+ }
19
8
 
20
- .tag--color-alert {
21
- --_skf-tag-bg-color: var(--skf-severity-bg-color-alert);
22
- --_skf-tag-border-color: var(--skf-severity-fg-color-alert);
23
- }
9
+ #root {
10
+ --_skf-tag-bg-color: var(--skf-bg-color-neutral-1);
11
+ --_skf-tag-border-color: var(--skf-border-color-primary);
12
+ --_skf-tag-border-radius: var(--skf-border-radius-md);
13
+ --_skf-tag-font-size: var(--skf-font-size-50);
14
+ --_skf-tag-height: var(--skf-size-32);
15
+ --_skf-tag-text-color: var(--skf-text-color-primary);
24
16
 
25
- .tag--color-error {
26
- --_skf-tag-bg-color: var(--skf-severity-bg-color-error);
27
- --_skf-tag-border-color: var(--skf-severity-fg-color-error);
28
- }
17
+ align-items: center;
18
+ background-color: var(--_skf-tag-bg-color);
19
+ block-size: var(--_skf-tag-height);
20
+ border: var(--skf-border-width-sm) solid var(--_skf-tag-border-color);
21
+ border-radius: var(--_skf-tag-border-radius);
22
+ color: var(--_skf-tag-text-color);
23
+ display: flex;
24
+ font-size: var(--_skf-tag-font-size);
25
+ gap: var(--skf-spacing-25);
26
+ max-inline-size: 48ch;
27
+ padding-inline: var(--skf-spacing-50);
28
+ }
29
29
 
30
- .tag--color-info {
31
- --_skf-tag-bg-color: var(--skf-severity-bg-color-info);
32
- --_skf-tag-border-color: var(--skf-severity-fg-color-info);
33
- }
30
+ slot {
31
+ display: block;
32
+ overflow: hidden;
33
+ text-overflow: ellipsis;
34
+ white-space: nowrap;
35
+ }
34
36
 
35
- .tag--color-success {
36
- --_skf-tag-bg-color: var(--skf-severity-bg-color-success);
37
- --_skf-tag-border-color: var(--skf-severity-fg-color-success);
38
- }
37
+ button {
38
+ display: flex;
39
39
 
40
- .tag--color-warning {
41
- --_skf-tag-bg-color: var(--skf-severity-bg-color-warning);
42
- --_skf-tag-border-color: var(--skf-severity-fg-color-warning);
40
+ &:focus-visible {
41
+ border-radius: var(--skf-border-radius-sm);
42
+ outline: var(--skf-border-width-md) solid var(--skf-interactive-border-color-focus);
43
+ }
44
+ }
43
45
  }
44
46
 
45
- .tag--small {
46
- --_skf-tag-border-radius: 0.25rem; /* token needed */
47
- --_skf-tag-font-size: var(--skf-font-size-25);
48
- --_skf-tag-height: var(--skf-size-24);
49
- }
47
+ @layer mods {
48
+ :host(:state(alert)) #root {
49
+ --_skf-tag-bg-color: var(--skf-severity-bg-color-alert);
50
+ --_skf-tag-border-color: var(--skf-severity-fg-color-alert);
51
+ }
50
52
 
51
- .tag__slot {
52
- display: block;
53
- overflow: hidden;
54
- text-overflow: ellipsis;
55
- white-space: nowrap;
56
- }
53
+ :host(:state(error)) #root {
54
+ --_skf-tag-bg-color: var(--skf-severity-bg-color-error);
55
+ --_skf-tag-border-color: var(--skf-severity-fg-color-error);
56
+ }
57
57
 
58
- .tag__btn {
59
- display: flex;
58
+ :host(:state(info)) #root {
59
+ --_skf-tag-bg-color: var(--skf-severity-bg-color-info);
60
+ --_skf-tag-border-color: var(--skf-severity-fg-color-info);
61
+ }
62
+
63
+ :host(:state(success)) #root {
64
+ --_skf-tag-bg-color: var(--skf-severity-bg-color-success);
65
+ --_skf-tag-border-color: var(--skf-severity-fg-color-success);
66
+ }
67
+
68
+ :host(:state(warning)) #root {
69
+ --_skf-tag-bg-color: var(--skf-severity-bg-color-warning);
70
+ --_skf-tag-border-color: var(--skf-severity-fg-color-warning);
71
+ }
60
72
 
61
- &:focus-visible {
62
- border-radius: var(--skf-border-radius-sm);
63
- outline: var(--skf-border-width-md) solid var(--skf-interactive-border-color-focus);
73
+ :host(:state(sm)) #root {
74
+ --_skf-tag-border-radius: 0.25rem; /* token needed */
75
+ --_skf-tag-font-size: var(--skf-font-size-25);
76
+ --_skf-tag-height: var(--skf-size-24);
64
77
  }
65
78
  }
66
79
  }
@@ -3,6 +3,7 @@ import { FormBase } from '../../internal/components/formBase.js';
3
3
  import '../../internal/components/hint/hint.js';
4
4
  import type { FormFieldSeverity } from '../../internal/types.js';
5
5
  import type { FormFieldBaseProps } from '../../internal/types/formField.js';
6
+ import { type Language } from '../../utilities/localize.js';
6
7
  import { type CSSResultGroup } from 'lit';
7
8
  interface SkfTextAreaProps extends Omit<FormFieldBaseProps, 'type'> {
8
9
  cols?: number;
@@ -26,6 +27,7 @@ interface SkfTextAreaProps extends Omit<FormFieldBaseProps, 'type'> {
26
27
  * @tagname skf-textarea
27
28
  */
28
29
  export declare class SkfTextArea extends FormBase implements SkfTextAreaProps {
30
+ #private;
29
31
  static styles: CSSResultGroup;
30
32
  /** @internal */
31
33
  private customError;
@@ -42,6 +44,8 @@ export declare class SkfTextArea extends FormBase implements SkfTextAreaProps {
42
44
  hint?: string;
43
45
  /** If defined, sets the input's label unless the default slot is used. Alternatively, you can use the `label` attribute. */
44
46
  label?: string;
47
+ /** Sets the internal language of the component */
48
+ lang: Language;
45
49
  /** If defined, adds name to the input-element */
46
50
  name?: string;
47
51
  /** If defined, sets the maximum character length to accept for this input */
@@ -52,8 +56,6 @@ export declare class SkfTextArea extends FormBase implements SkfTextAreaProps {
52
56
  placeholder?: string;
53
57
  /** If true, makes the element not mutable, meaning the user can not edit the control */
54
58
  readonly: boolean;
55
- /** If defined, renders an alternative A11y text for the asterisk */
56
- requiredLabel?: string;
57
59
  /** If defined, sets the rows of the textarea */
58
60
  rows?: number;
59
61
  /** If defined, displays provided severity state */