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

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 +16 -18
  63. package/dist/components/link/link.component.js +109 -106
  64. package/dist/components/link/link.styles.js +49 -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 +1699 -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 +1990 -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 +39 -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,18 +1,28 @@
1
1
  import { css as r } from "lit";
2
- const o = r`
3
- /* stylelint-disable selector-class-pattern */
2
+ const e = r`
4
3
  @layer components {
5
4
  :host {
6
5
  contain: layout;
7
6
  }
8
7
 
9
- .breadcrumb-item {
8
+ #root {
9
+ --_skf-breadcrumb-item-color: inherit;
10
+
10
11
  align-items: center;
11
12
  display: flex;
12
13
  }
13
14
 
14
- .breadcrumb-item__label {
15
- color: var(--_skf-breadcrumb-item-color, inherit);
15
+ span {
16
+ display: block;
17
+ margin-inline: var(--skf-spacing-25);
18
+
19
+ :host(:last-of-type) & {
20
+ display: none;
21
+ }
22
+ }
23
+
24
+ .label {
25
+ color: var(--_skf-breadcrumb-item-color);
16
26
 
17
27
  &:is(slot) {
18
28
  display: inline;
@@ -46,17 +56,8 @@ const o = r`
46
56
  }
47
57
  }
48
58
  }
49
-
50
- .breadcrumb-item__separator {
51
- display: block;
52
- margin-inline: var(--skf-spacing-25);
53
-
54
- :host(:last-of-type) & {
55
- display: none;
56
- }
57
- }
58
59
  }
59
60
  `;
60
61
  export {
61
- o as styles
62
+ e as styles
62
63
  };
@@ -13,17 +13,20 @@ import type { SkfBreadcrumbItem } from './breadcrumb-item.component.js';
13
13
  * @tagname skf-breadcrumb
14
14
  */
15
15
  export declare class SkfBreadcrumb extends SkfElement {
16
+ #private;
16
17
  static styles: CSSResultGroup;
17
18
  /** aria-label for the breadcrumb control */
18
19
  label: string;
19
- /** Displays an alternative size */
20
- size: 'md' | 'sm';
20
+ /** If true, renders a smaller version */
21
+ small: boolean;
21
22
  /** @internal */
22
23
  _isDynamic: boolean;
23
24
  /** @internal */
24
25
  _items: NodeListOf<SkfBreadcrumbItem>;
25
26
  firstUpdated(): void;
26
27
  /** @internal */
28
+ _handleStateChange(): void;
29
+ /** @internal */
27
30
  private _handleSlotChange;
28
31
  render(): import("lit").TemplateResult;
29
32
  }
@@ -1,60 +1,65 @@
1
- import { SkfElement as c } from "../../internal/components/skf-element.js";
2
- import { componentStyles as f } from "../../styles/component.styles.js";
3
- import "lit";
4
- import { property as p, state as _, queryAssignedElements as d } from "lit/decorators.js";
5
- import { classMap as y } from "lit/directives/class-map.js";
6
- import { ifDefined as u } from "lit/directives/if-defined.js";
7
- import { literal as h, html as b } from "lit/static-html.js";
8
- import { styles as g } from "./breadcrumb.styles.js";
9
- var v = Object.defineProperty, r = (a, t, i, n) => {
10
- for (var s = void 0, l = a.length - 1, m; l >= 0; l--)
11
- (m = a[l]) && (s = m(t, i, s) || s);
12
- return s && v(t, i, s), s;
1
+ var f = (t) => {
2
+ throw TypeError(t);
13
3
  };
14
- const o = class o extends c {
4
+ var g = (t, s, e) => s.has(t) || f("Cannot " + e);
5
+ var p = (t, s, e) => (g(t, s, "read from private field"), e ? e.call(t) : s.get(t)), _ = (t, s, e) => s.has(t) ? f("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), y = (t, s, e, i) => (g(t, s, "write to private field"), i ? i.call(t, e) : s.set(t, e), e);
6
+ import { SkfElement as d } from "../../internal/components/skf-element.js";
7
+ import { stateMap as C } from "../../internal/helpers/stateMap.js";
8
+ import { watch as D } from "../../internal/helpers/watch.js";
9
+ import { componentStyles as v } from "../../styles/component.styles.js";
10
+ import "lit";
11
+ import { property as u, state as S, queryAssignedElements as O } from "lit/decorators.js";
12
+ import { html as P } from "lit/static-html.js";
13
+ import { styles as b } from "./breadcrumb.styles.js";
14
+ var w = Object.defineProperty, E = Object.getOwnPropertyDescriptor, n = (t, s, e, i) => {
15
+ for (var r = i > 1 ? void 0 : i ? E(s, e) : s, h = t.length - 1, m; h >= 0; h--)
16
+ (m = t[h]) && (r = (i ? m(s, e, r) : m(r)) || r);
17
+ return i && r && w(s, e, r), r;
18
+ }, a, l;
19
+ const c = class c extends d {
15
20
  constructor() {
16
- super(...arguments), this.label = "Breadcrumb", this.size = "md", this._isDynamic = !1, this._handleSlotChange = () => {
17
- this._items.forEach((t, i) => {
18
- this._isDynamic = !!t.href;
19
- const n = i === this._items.length - 1;
20
- this._isDynamic && n && (t._isCurrent = !0);
21
+ super(...arguments);
22
+ _(this, a);
23
+ _(this, l);
24
+ y(this, a, this.attachInternals()), y(this, l, p(this, a).states), this.label = "Breadcrumb", this.small = !1, this._isDynamic = !1, this._handleSlotChange = () => {
25
+ this._items.forEach((e, i) => {
26
+ this._isDynamic = this._isDynamic || !!e.href, this.role = this._isDynamic ? "navigation" : null;
27
+ const r = i === this._items.length - 1;
28
+ this._isDynamic && r && (e._isCurrent = !0);
21
29
  });
22
30
  };
23
31
  }
24
32
  firstUpdated() {
25
33
  this._handleSlotChange();
26
34
  }
35
+ _handleStateChange() {
36
+ C(p(this, l), "small").set(this.small);
37
+ }
27
38
  render() {
28
- const t = this._isDynamic ? h`nav` : h`div`;
29
- return b`
30
- <${t}
31
- aria-label=${u(this.label && this._isDynamic ? this.label : void 0)}
32
- class=${y({
33
- breadcrumb: !0,
34
- "breadcrumb--small": this.size === "sm"
35
- })}
36
- >
37
- <ol class="breadcrumb__list">
38
- <slot @slotchange=${this._handleSlotChange}></slot>
39
- </ol>
40
- </{tag}>
39
+ return P`
40
+ <ol id="root">
41
+ <slot @slotchange=${this._handleSlotChange}></slot>
42
+ </ol>
41
43
  `;
42
44
  }
43
45
  };
44
- o.styles = [f, g];
45
- let e = o;
46
- r([
47
- p()
48
- ], e.prototype, "label");
49
- r([
50
- p({ reflect: !0 })
51
- ], e.prototype, "size");
52
- r([
53
- _()
54
- ], e.prototype, "_isDynamic");
55
- r([
56
- d()
57
- ], e.prototype, "_items");
46
+ a = new WeakMap(), l = new WeakMap(), c.styles = [v, b];
47
+ let o = c;
48
+ n([
49
+ u({ type: String })
50
+ ], o.prototype, "label", 2);
51
+ n([
52
+ u({ type: Boolean })
53
+ ], o.prototype, "small", 2);
54
+ n([
55
+ S()
56
+ ], o.prototype, "_isDynamic", 2);
57
+ n([
58
+ O()
59
+ ], o.prototype, "_items", 2);
60
+ n([
61
+ D("small")
62
+ ], o.prototype, "_handleStateChange", 1);
58
63
  export {
59
- e as SkfBreadcrumb
64
+ o as SkfBreadcrumb
60
65
  };
@@ -1,5 +1,5 @@
1
- import { SkfBreadcrumb } from './breadcrumb.component';
2
- export * from './breadcrumb.component';
1
+ import { SkfBreadcrumb } from './breadcrumb.component.js';
2
+ export * from './breadcrumb.component.js';
3
3
  export default SkfBreadcrumb;
4
4
  declare global {
5
5
  interface HTMLElementTagNameMap {
@@ -1,19 +1,22 @@
1
1
  import { css as t } from "lit";
2
2
  const s = t`
3
- /* stylelint-disable selector-class-pattern */
4
3
  @layer components {
5
- :host {
6
- contain: layout;
7
- }
4
+ @layer base {
5
+ :host {
6
+ contain: layout;
7
+ }
8
8
 
9
- .breadcrumb--small {
10
- font-size: var(--skf-font-size-75);
11
- font-weight: var(--skf-font-weight-medium);
9
+ #root {
10
+ align-items: center;
11
+ display: flex;
12
+ }
12
13
  }
13
14
 
14
- .breadcrumb__list {
15
- align-items: center;
16
- display: flex;
15
+ @layer mods {
16
+ :host(:state(small)) #root {
17
+ font-size: var(--skf-font-size-75);
18
+ font-weight: var(--skf-font-weight-medium);
19
+ }
17
20
  }
18
21
  }
19
22
  `;
@@ -1,40 +1,38 @@
1
- var u = (i) => {
1
+ var f = (i) => {
2
2
  throw TypeError(i);
3
3
  };
4
- var _ = (i, s, t) => s.has(i) || u("Cannot " + t);
5
- var p = (i, s, t) => (_(i, s, "read from private field"), t ? t.call(i) : s.get(i)), v = (i, s, t) => s.has(i) ? u("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, t), $ = (i, s, t, a) => (_(i, s, "write to private field"), a ? a.call(i, t) : s.set(i, t), t);
4
+ var u = (i, e, t) => e.has(i) || f("Cannot " + t);
5
+ var h = (i, e, t) => (u(i, e, "read from private field"), t ? t.call(i) : e.get(i)), _ = (i, e, t) => e.has(i) ? f("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), v = (i, e, t, a) => (u(i, e, "write to private field"), a ? a.call(i, t) : e.set(i, t), t);
6
6
  import "../icon/icon.js";
7
7
  import "../loader/loader.js";
8
- import { SkfElement as O } from "../../internal/components/skf-element.js";
9
- import { watch as V } from "../../internal/helpers/watch.js";
10
- import { componentStyles as w } from "../../styles/component.styles.js";
11
- import { html as y, LitElement as z, nothing as b } from "lit";
12
- import { property as r, state as P, query as m } from "lit/decorators.js";
13
- import { classMap as L } from "lit/directives/class-map.js";
14
- import { ifDefined as g } from "lit/directives/if-defined.js";
15
- import { styles as C } from "./button.styles.js";
16
- var F = Object.defineProperty, k = Object.getOwnPropertyDescriptor, o = (i, s, t, a) => {
17
- for (var n = a > 1 ? void 0 : a ? k(s, t) : s, h = i.length - 1, d; h >= 0; h--)
18
- (d = i[h]) && (n = (a ? d(s, t, n) : d(n)) || n);
19
- return a && n && F(s, t, n), n;
8
+ import { SkfElement as g } from "../../internal/components/skf-element.js";
9
+ import { watch as O } from "../../internal/helpers/watch.js";
10
+ import { componentStyles as V } from "../../styles/component.styles.js";
11
+ import { html as p, LitElement as w, nothing as b } from "lit";
12
+ import { property as r, state as z, query as m } from "lit/decorators.js";
13
+ import { classMap as P } from "lit/directives/class-map.js";
14
+ import { ifDefined as $ } from "lit/directives/if-defined.js";
15
+ import { styles as L } from "./button.styles.js";
16
+ var C = Object.defineProperty, F = Object.getOwnPropertyDescriptor, s = (i, e, t, a) => {
17
+ for (var n = a > 1 ? void 0 : a ? F(e, t) : e, c = i.length - 1, y; c >= 0; c--)
18
+ (y = i[c]) && (n = (a ? y(e, t, n) : y(n)) || n);
19
+ return a && n && C(e, t, n), n;
20
20
  }, l;
21
- const c = class c extends O {
21
+ const d = class d extends g {
22
22
  constructor() {
23
23
  super();
24
- v(this, l);
24
+ _(this, l);
25
25
  this._transitionOptions = {
26
26
  duration: 200,
27
27
  fill: "forwards"
28
28
  }, this.destructive = !1, this.disabled = !1, this.iconOnly = !1, this.iconPosition = "left", this.loading = !1, this.noValidate = !1, this.size = "md", this.type = "button", this.variant = "primary", this._loaderVisible = !1, this._handleClick = (t) => {
29
29
  t.preventDefault(), t.stopPropagation(), !(this.disabled || this.loading) && (this.dispatchEvent(new CustomEvent("click", { bubbles: !0, composed: !0, detail: t })), this.type === "submit" && this._submitForm(), this.type === "reset" && this._resetForm());
30
30
  }, this._submitForm = () => {
31
- var h, d, f;
32
- const t = !((h = p(this, l).form) != null && h.reportValidity()), a = !this.noValidate, n = !((d = p(this, l).form) != null && d.hasAttribute("no-validate"));
33
- (a || n) && t || (f = p(this, l).form) == null || f.requestSubmit();
31
+ const t = !h(this, l).form?.reportValidity(), a = !this.noValidate, n = !h(this, l).form?.hasAttribute("no-validate");
32
+ (a || n) && t || h(this, l).form?.requestSubmit();
34
33
  }, this._resetForm = () => {
35
- var t;
36
- (t = p(this, l).form) == null || t.reset();
37
- }, this._renderIcon = () => y`<skf-icon class="skf-icon-host" name=${g(this.icon)}></skf-icon>`, $(this, l, this.attachInternals());
34
+ h(this, l).form?.reset();
35
+ }, this._renderIcon = () => p`<skf-icon data-color="custom" name=${$(this.icon)}></skf-icon>`, v(this, l, this.attachInternals());
38
36
  }
39
37
  firstUpdated(t) {
40
38
  if (t.has("loading") && this.loading) {
@@ -47,25 +45,23 @@ const c = class c extends O {
47
45
  }
48
46
  /** Simulates a click on the button. */
49
47
  click() {
50
- var t;
51
- (t = this.$button) == null || t.click();
48
+ this.$button?.click();
52
49
  }
53
50
  /** @internal */
54
51
  async _showLoader() {
55
- var t;
56
- this._loaderVisible = !0, await ((t = this.$body) == null ? void 0 : t.animate({ opacity: 0 }, this._transitionOptions).finished), !(!this.$body || !this.$loader) && this.$loader.animate({ opacity: 1 }, this._transitionOptions);
52
+ this._loaderVisible = !0, await this.$body?.animate({ opacity: 0 }, this._transitionOptions).finished, !(!this.$body || !this.$loader) && this.$loader.animate({ opacity: 1 }, this._transitionOptions);
57
53
  }
58
54
  /** @internal */
59
55
  async _hideLoader() {
60
56
  !this.$body || !this.$loader || (await this.$loader.animate({ opacity: 0 }, this._transitionOptions).finished, this._loaderVisible = !1, this.$body.animate({ opacity: 1 }, this._transitionOptions));
61
57
  }
62
58
  render() {
63
- return y`
59
+ return p`
64
60
  <button
65
61
  ?disabled=${this.disabled || this.loading}
66
62
  @click=${this._handleClick}
67
63
  aria-busy=${this.loading}
68
- class=${L({
64
+ class=${P({
69
65
  btn: !0,
70
66
  "btn--destructive": this.destructive,
71
67
  "btn--icon-only": this.iconOnly,
@@ -76,67 +72,67 @@ const c = class c extends O {
76
72
  "btn--variant-secondary": this.variant === "secondary",
77
73
  "btn--variant-tertiary": this.variant === "tertiary"
78
74
  })}
79
- type=${g(this.type)}
75
+ type=${$(this.type)}
80
76
  title=${/* An empty title prevents browser validation tooltips from appearing on hover */
81
77
  this.title}
82
78
  >
83
- ${this.variant === "primary" && this._loaderVisible ? y`<skf-loader class="btn__loader" invert size="sm"></skf-loader>` : ""}
79
+ ${this.variant === "primary" && this._loaderVisible ? p`<skf-loader class="btn__loader" invert size="sm"></skf-loader>` : ""}
84
80
  <div class="btn__body" id="body">
85
81
  ${this.icon && this.iconPosition === "left" ? this._renderIcon() : b}
86
- ${this.iconOnly ? b : y`<slot class="btn__label"></slot>`}
82
+ ${this.iconOnly ? b : p`<slot class="btn__label"></slot>`}
87
83
  ${this.icon && this.iconPosition === "right" ? this._renderIcon() : b}
88
84
  </div>
89
85
  </button>
90
86
  `;
91
87
  }
92
88
  };
93
- l = new WeakMap(), c.styles = [w, C], c.formAssociated = !0, c.shadowRootOptions = { ...z.shadowRootOptions, delegatesFocus: !0 };
94
- let e = c;
95
- o([
89
+ l = new WeakMap(), d.styles = [V, L], d.formAssociated = !0, d.shadowRootOptions = { ...w.shadowRootOptions, delegatesFocus: !0 };
90
+ let o = d;
91
+ s([
96
92
  r({ type: Boolean })
97
- ], e.prototype, "destructive", 2);
98
- o([
93
+ ], o.prototype, "destructive", 2);
94
+ s([
99
95
  r({ type: Boolean })
100
- ], e.prototype, "disabled", 2);
101
- o([
96
+ ], o.prototype, "disabled", 2);
97
+ s([
102
98
  r()
103
- ], e.prototype, "icon", 2);
104
- o([
99
+ ], o.prototype, "icon", 2);
100
+ s([
105
101
  r({ type: Boolean, attribute: "icon-only" })
106
- ], e.prototype, "iconOnly", 2);
107
- o([
102
+ ], o.prototype, "iconOnly", 2);
103
+ s([
108
104
  r({ attribute: "icon-position" })
109
- ], e.prototype, "iconPosition", 2);
110
- o([
105
+ ], o.prototype, "iconPosition", 2);
106
+ s([
111
107
  r({ type: Boolean, reflect: !0 })
112
- ], e.prototype, "loading", 2);
113
- o([
108
+ ], o.prototype, "loading", 2);
109
+ s([
114
110
  r({ type: Boolean, attribute: "no-validate" })
115
- ], e.prototype, "noValidate", 2);
116
- o([
111
+ ], o.prototype, "noValidate", 2);
112
+ s([
117
113
  r({ reflect: !0 })
118
- ], e.prototype, "size", 2);
119
- o([
114
+ ], o.prototype, "size", 2);
115
+ s([
120
116
  r()
121
- ], e.prototype, "type", 2);
122
- o([
117
+ ], o.prototype, "type", 2);
118
+ s([
123
119
  r({ reflect: !0 })
124
- ], e.prototype, "variant", 2);
125
- o([
126
- P()
127
- ], e.prototype, "_loaderVisible", 2);
128
- o([
120
+ ], o.prototype, "variant", 2);
121
+ s([
122
+ z()
123
+ ], o.prototype, "_loaderVisible", 2);
124
+ s([
129
125
  m("skf-loader")
130
- ], e.prototype, "$loader", 2);
131
- o([
126
+ ], o.prototype, "$loader", 2);
127
+ s([
132
128
  m("#body")
133
- ], e.prototype, "$body", 2);
134
- o([
129
+ ], o.prototype, "$body", 2);
130
+ s([
135
131
  m("button")
136
- ], e.prototype, "$button", 2);
137
- o([
138
- V("loading", { afterUpdate: !0 })
139
- ], e.prototype, "_handleLoadingChange", 1);
132
+ ], o.prototype, "$button", 2);
133
+ s([
134
+ O("loading", { afterUpdate: !0 })
135
+ ], o.prototype, "_handleLoadingChange", 1);
140
136
  export {
141
- e as SkfButton
137
+ o as SkfButton
142
138
  };
@@ -49,7 +49,8 @@ const r = o`
49
49
 
50
50
  .btn--icon-only {
51
51
  aspect-ratio: 1;
52
- place-items: center;
52
+ display: inherit;
53
+ place-content: center;
53
54
  }
54
55
 
55
56
  /**
@@ -85,9 +86,9 @@ const r = o`
85
86
  --_skf-button-bg-color: var(--skf-interactive-bg-color-secondary);
86
87
  --_skf-button-bg-color-active: var(--skf-interactive-bg-color-secondary-active);
87
88
  --_skf-button-bg-color-hover: var(--skf-interactive-bg-color-secondary-hover);
88
- --_skf-button-border-color: var(--skf-border-color-emphasised);
89
+ --_skf-button-border-color: var(--skf-border-color-emphasized);
89
90
  --_skf-button-border-color-disabled: var(--skf-interactive-border-color-disabled);
90
- --_skf-button-color: var(--skf-text-color-emphasised);
91
+ --_skf-button-color: var(--skf-text-color-emphasized);
91
92
  --_skf-button-color-disabled: var(--skf-interactive-text-color-disabled);
92
93
  }
93
94
 
@@ -96,7 +97,7 @@ const r = o`
96
97
  --_skf-button-bg-color-active: var(--skf-interactive-bg-color-secondary-active);
97
98
  --_skf-button-bg-color-hover: var(--skf-interactive-bg-color-secondary-hover);
98
99
  --_skf-button-border-color: transparent;
99
- --_skf-button-color: var(--skf-text-color-emphasised);
100
+ --_skf-button-color: var(--skf-text-color-emphasized);
100
101
  --_skf-button-color-disabled: var(--skf-interactive-text-color-disabled);
101
102
  }
102
103
 
@@ -7,9 +7,12 @@ import { type CSSResultGroup } from 'lit';
7
7
  *
8
8
  * @slot - The card's main content
9
9
  *
10
+ * @cssproperty --mod-card-bg-color - Ability to set a custom background color
11
+ *
10
12
  * @tagname skf-card
11
13
  */
12
14
  export declare class SkfCard extends SkfElement {
15
+ #private;
13
16
  static styles: CSSResultGroup;
14
17
  /** If true, removes border */
15
18
  noBorder: boolean;
@@ -17,5 +20,7 @@ export declare class SkfCard extends SkfElement {
17
20
  noPadding: boolean;
18
21
  /** If true, the Card fills the parent element height */
19
22
  stretch: boolean;
23
+ /** @internal */
24
+ _handleStateChange(property: string, _prev: unknown, next: unknown): void;
20
25
  render(): import("lit").TemplateResult<1>;
21
26
  }
@@ -1,32 +1,54 @@
1
- import { SkfElement as f } from "../../internal/components/skf-element.js";
2
- import { componentStyles as m } from "../../styles/component.styles.js";
3
- import { html as d } from "lit";
4
- import { property as o } from "lit/decorators.js";
5
- import { styles as u } from "./card.styles.js";
6
- var c = Object.defineProperty, s = (p, l, i, y) => {
7
- for (var t = void 0, r = p.length - 1, a; r >= 0; r--)
8
- (a = p[r]) && (t = a(l, i, t) || t);
9
- return t && c(l, i, t), t;
1
+ var g = (t) => {
2
+ throw TypeError(t);
10
3
  };
11
- const n = class n extends f {
4
+ var u = (t, e, o) => e.has(t) || g("Cannot " + o);
5
+ var m = (t, e, o) => (u(t, e, "read from private field"), o ? o.call(t) : e.get(t)), d = (t, e, o) => e.has(t) ? g("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, o), c = (t, e, o, s) => (u(t, e, "write to private field"), s ? s.call(t, o) : e.set(t, o), o);
6
+ import { SkfElement as b } from "../../internal/components/skf-element.js";
7
+ import { stateMap as v } from "../../internal/helpers/stateMap.js";
8
+ import { watch as P } from "../../internal/helpers/watch.js";
9
+ import { componentStyles as B } from "../../styles/component.styles.js";
10
+ import { html as O } from "lit";
11
+ import { property as f } from "lit/decorators.js";
12
+ import { styles as j } from "./card.styles.js";
13
+ var w = Object.defineProperty, x = Object.getOwnPropertyDescriptor, i = (t, e, o, s) => {
14
+ for (var r = s > 1 ? void 0 : s ? x(e, o) : e, h = t.length - 1, l; h >= 0; h--)
15
+ (l = t[h]) && (r = (s ? l(e, o, r) : l(r)) || r);
16
+ return s && r && w(e, o, r), r;
17
+ };
18
+ const _ = {
19
+ noBorder: "no-border",
20
+ noPadding: "no-padding",
21
+ stretch: "stretch"
22
+ };
23
+ var p, a;
24
+ const y = class y extends b {
12
25
  constructor() {
13
- super(...arguments), this.noBorder = !1, this.noPadding = !1, this.stretch = !1;
26
+ super(...arguments);
27
+ d(this, p);
28
+ d(this, a);
29
+ c(this, p, this.attachInternals()), c(this, a, m(this, p).states), this.noBorder = !1, this.noPadding = !1, this.stretch = !1;
30
+ }
31
+ _handleStateChange(o, s, r) {
32
+ v(m(this, a), _[o]).set(r);
14
33
  }
15
34
  render() {
16
- return d`<slot></slot>`;
35
+ return O`<slot id="root"></slot>`;
17
36
  }
18
37
  };
19
- n.styles = [m, u];
20
- let e = n;
21
- s([
22
- o({ type: Boolean, attribute: "no-border", reflect: !0 })
23
- ], e.prototype, "noBorder");
24
- s([
25
- o({ type: Boolean, attribute: "no-padding", reflect: !0 })
26
- ], e.prototype, "noPadding");
27
- s([
28
- o({ type: Boolean, reflect: !0 })
29
- ], e.prototype, "stretch");
38
+ p = new WeakMap(), a = new WeakMap(), y.styles = [B, j];
39
+ let n = y;
40
+ i([
41
+ f({ type: Boolean, attribute: "no-border" })
42
+ ], n.prototype, "noBorder", 2);
43
+ i([
44
+ f({ type: Boolean, attribute: "no-padding" })
45
+ ], n.prototype, "noPadding", 2);
46
+ i([
47
+ f({ type: Boolean })
48
+ ], n.prototype, "stretch", 2);
49
+ i([
50
+ P(Object.keys(_))
51
+ ], n.prototype, "_handleStateChange", 1);
30
52
  export {
31
- e as SkfCard
53
+ n as SkfCard
32
54
  };
@@ -1,33 +1,50 @@
1
1
  import { css as r } from "lit";
2
- const s = r`
2
+ const a = r`
3
3
  @layer components {
4
4
  @layer base {
5
5
  :host {
6
- background-color: var(--skf-bg-color-neutral-1);
7
- border: var(--skf-border-width-sm) solid
8
- var(--_skf-card-border-color, var(--skf-border-color-tertiary));
9
- border-radius: var(--skf-border-radius-sm);
10
- box-shadow: var(--skf-shadow-md);
11
6
  contain: layout;
12
- padding: var(--_skf-card-padding, var(--skf-spacing-100));
7
+ }
8
+
9
+ #root {
10
+ --_skf-card-bg-color: var(--mod-card-bg-color, var(--skf-bg-color-neutral-1));
11
+ --_skf-card-border-color: var(--skf-border-color-tertiary);
12
+ --_skf-card-padding: var(--skf-spacing-100);
13
+ --_skf-card-shadow: var(--skf-shadow-md);
14
+
15
+ background-color: var(--_skf-card-bg-color);
16
+ border: var(--skf-border-width-sm) solid var(--_skf-card-border-color);
17
+ border-radius: var(--skf-border-radius-sm);
18
+ box-shadow: var(--_skf-card-shadow);
19
+ display: block;
20
+ padding: var(--_skf-card-padding);
13
21
  }
14
22
  }
15
23
 
16
24
  @layer mods {
17
- :host([stretch]) {
18
- block-size: 100%;
25
+ :host(:state(no-border)) {
26
+ #root {
27
+ --_skf-card-border-color: transparent;
28
+ --_skf-card-shadow: none;
29
+ }
19
30
  }
20
31
 
21
- :host([no-border]) {
22
- --_skf-card-border-color: transparent;
32
+ :host(:state(no-padding)) {
33
+ #root {
34
+ --_skf-card-padding: 0;
35
+ }
23
36
  }
24
37
 
25
- :host([no-padding]) {
26
- --_skf-card-padding: 0;
38
+ :host(:state(stretch)) {
39
+ block-size: 100%;
40
+
41
+ #root {
42
+ block-size: inherit;
43
+ }
27
44
  }
28
45
  }
29
46
  }
30
47
  `;
31
48
  export {
32
- s as styles
49
+ a as styles
33
50
  };