@skf-design-system/ui-components 1.0.2-beta.4 → 1.0.2-beta.6

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 (71) hide show
  1. package/custom-elements.json +25490 -0
  2. package/dist/components/accordion/accordion.component.d.ts +1 -1
  3. package/dist/components/accordion/accordion.component.js +2 -2
  4. package/dist/components/datepicker/datepicker.component.js +1 -0
  5. package/dist/components/divider/divider.component.d.ts +3 -0
  6. package/dist/components/divider/divider.component.js +43 -22
  7. package/dist/components/divider/divider.styles.js +8 -8
  8. package/dist/components/drawer/drawer.component.d.ts +8 -2
  9. package/dist/components/drawer/drawer.component.js +74 -54
  10. package/dist/components/drawer/drawer.styles.js +47 -40
  11. package/dist/components/input/input.component.js +1 -0
  12. package/dist/components/link/link.component.d.ts +15 -18
  13. package/dist/components/link/link.component.js +99 -108
  14. package/dist/components/link/link.styles.js +45 -45
  15. package/dist/components/loader/loader.component.d.ts +5 -1
  16. package/dist/components/loader/loader.component.js +43 -29
  17. package/dist/components/loader/loader.styles.js +5 -9
  18. package/dist/components/menu/menu-item.component.d.ts +1 -1
  19. package/dist/components/menu/menu-item.component.js +8 -8
  20. package/dist/components/menu/menu-item.styles.js +8 -5
  21. package/dist/components/menu/menu.component.d.ts +1 -1
  22. package/dist/components/menu/menu.component.js +8 -8
  23. package/dist/components/nav/nav-item.component.d.ts +4 -0
  24. package/dist/components/nav/nav-item.component.js +44 -25
  25. package/dist/components/nav/nav-item.styles.js +29 -25
  26. package/dist/components/nav/nav.component.d.ts +6 -0
  27. package/dist/components/nav/nav.component.js +42 -21
  28. package/dist/components/nav/nav.styles.js +15 -9
  29. package/dist/components/popover/popover.component.d.ts +4 -0
  30. package/dist/components/popover/popover.component.js +30 -22
  31. package/dist/components/progress/progress.component.d.ts +2 -0
  32. package/dist/components/progress/progress.component.js +38 -29
  33. package/dist/components/progress/progress.styles.js +3 -3
  34. package/dist/components/select/select-option-group.component.d.ts +4 -0
  35. package/dist/components/select/select-option-group.component.js +37 -18
  36. package/dist/components/select/select-option-group.style.js +12 -6
  37. package/dist/components/select/select-option.component.d.ts +6 -1
  38. package/dist/components/select/select-option.component.js +73 -53
  39. package/dist/components/select/select-option.styles.js +43 -31
  40. package/dist/components/select/select.component.d.ts +5 -1
  41. package/dist/components/select/select.component.js +47 -29
  42. package/dist/components/select/select.controllers.js +2 -1
  43. package/dist/components/select/select.styles.js +8 -2
  44. package/dist/components/stepper/stepper-item.component.d.ts +1 -1
  45. package/dist/components/stepper/stepper-item.component.js +26 -23
  46. package/dist/components/tabs/tab-panel.component.d.ts +1 -1
  47. package/dist/components/tabs/tab-panel.component.js +19 -16
  48. package/dist/components/tabs/tab.component.d.ts +1 -1
  49. package/dist/components/tabs/tab.component.js +17 -14
  50. package/dist/components/textarea/textarea.component.js +5 -4
  51. package/dist/components/toast/toast-item.styles.js +13 -10
  52. package/dist/components/toast/toast.component.js +9 -9
  53. package/dist/components/toast/toast.singleton.d.ts +1 -1
  54. package/dist/components/toast/toast.singleton.js +18 -18
  55. package/dist/components/tooltip/tooltip.component.d.ts +1 -0
  56. package/dist/components/tooltip/tooltip.component.js +10 -7
  57. package/dist/custom-elements.json +803 -704
  58. package/dist/index.d.ts +2 -2
  59. package/dist/index.js +20 -20
  60. package/dist/internal/base-classes/popover/popover.base.d.ts +3 -3
  61. package/dist/internal/base-classes/popover/popover.base.js +27 -26
  62. package/dist/internal/base-classes/popover/popover.styles.js +4 -5
  63. package/dist/internal/components/hint/hint.component.d.ts +4 -0
  64. package/dist/internal/components/hint/hint.component.js +47 -20
  65. package/dist/internal/components/hint/hint.styles.js +29 -25
  66. package/dist/internal/types.d.ts +4 -0
  67. package/dist/types/jsx/custom-element-jsx.d.ts +184 -81
  68. package/dist/types/vue/index.d.ts +77 -80
  69. package/dist/vscode.html-custom-data.json +93 -97
  70. package/dist/web-types.json +210 -215
  71. package/package.json +28 -28
package/dist/index.d.ts CHANGED
@@ -28,8 +28,8 @@ export { default as SkfProgress } from './components/progress/progress.js';
28
28
  export { default as SkfRadio } from './components/radio/radio.js';
29
29
  export { default as SkfSegmentedButtonItem } from './components/segmented-button/segmented-button-item.js';
30
30
  export { default as SkfSegmentedButton } from './components/segmented-button/segmented-button.js';
31
- export { default as SkfOptionGroup } from './components/select/select-option-group.js';
32
- export { default as SkfOption } from './components/select/select-option.js';
31
+ export { default as SkfSelectOptionGroup } from './components/select/select-option-group.js';
32
+ export { default as SkfSelectOption } from './components/select/select-option.js';
33
33
  export { default as SkfSelect } from './components/select/select.js';
34
34
  export { default as SkfStepperItem } from './components/stepper/stepper-item.js';
35
35
  export { default as SkfStepper } from './components/stepper/stepper.js';
package/dist/index.js CHANGED
@@ -56,14 +56,14 @@ import { SkfDatepickerPopup as ao } from "./components/datepicker/datepicker-pop
56
56
  import { SkfDatepicker as co } from "./components/datepicker/datepicker.component.js";
57
57
  import { SkfDialog as Io } from "./components/dialog/dialog.component.js";
58
58
  import { SkfDivider as lo } from "./components/divider/divider.component.js";
59
- import { SkfDrawer as go } from "./components/drawer/drawer.component.js";
59
+ import { SkfDrawer as bo } from "./components/drawer/drawer.component.js";
60
60
  import { SkfHeader as Do } from "./components/header/header.component.js";
61
61
  import { SkfHeading as vo } from "./components/heading/heading.component.js";
62
- import { SkfIcon as Oo } from "./components/icon/icon.component.js";
63
- import { SkfInput as Co } from "./components/input/input.component.js";
64
- import { SkfLink as ho } from "./components/link/link.component.js";
65
- import { SkfLoader as Go } from "./components/loader/loader.component.js";
66
- import { SkfLogo as Mo } from "./components/logo/logo.component.js";
62
+ import { SkfIcon as Po } from "./components/icon/icon.component.js";
63
+ import { SkfInput as Lo } from "./components/input/input.component.js";
64
+ import { SkfLink as wo } from "./components/link/link.component.js";
65
+ import { SkfLoader as Mo } from "./components/loader/loader.component.js";
66
+ import { SkfLogo as Oo } from "./components/logo/logo.component.js";
67
67
  import { SkfMenuItem as Ro } from "./components/menu/menu-item.component.js";
68
68
  import { SkfMenu as jo } from "./components/menu/menu.component.js";
69
69
  import { SkfNavItem as yo } from "./components/nav/nav-item.component.js";
@@ -83,11 +83,11 @@ import { SkfTabPanel as nr } from "./components/tabs/tab-panel.component.js";
83
83
  import { SkfTab as dr } from "./components/tabs/tab.component.js";
84
84
  import { SkfTabs as Ir } from "./components/tabs/tabs.component.js";
85
85
  import { SkfTag as lr } from "./components/tag/tag.component.js";
86
- import { SkfTextArea as gr } from "./components/textarea/textarea.component.js";
86
+ import { SkfTextArea as br } from "./components/textarea/textarea.component.js";
87
87
  import { SkfToastItem as Dr } from "./components/toast/toast-item.component.js";
88
88
  import { SkfToastWrapper as vr } from "./components/toast/toast-wrapper.component.js";
89
- import { SkfToast as Or } from "./components/toast/toast.component.js";
90
- import { SkfTooltip as Cr } from "./components/tooltip/tooltip.component.js";
89
+ import { SkfToast as Pr } from "./components/toast/toast.component.js";
90
+ import { SkfTooltip as Lr } from "./components/tooltip/tooltip.component.js";
91
91
  export {
92
92
  X as SkfAccordion,
93
93
  U as SkfAccordionItem,
@@ -102,26 +102,26 @@ export {
102
102
  ao as SkfDatepickerPopup,
103
103
  Io as SkfDialog,
104
104
  lo as SkfDivider,
105
- go as SkfDrawer,
105
+ bo as SkfDrawer,
106
106
  Do as SkfHeader,
107
107
  vo as SkfHeading,
108
- Oo as SkfIcon,
109
- Co as SkfInput,
110
- ho as SkfLink,
111
- Go as SkfLoader,
112
- Mo as SkfLogo,
108
+ Po as SkfIcon,
109
+ Lo as SkfInput,
110
+ wo as SkfLink,
111
+ Mo as SkfLoader,
112
+ Oo as SkfLogo,
113
113
  jo as SkfMenu,
114
114
  Ro as SkfMenuItem,
115
115
  Eo as SkfNav,
116
116
  yo as SkfNavItem,
117
- tr as SkfOption,
118
- or as SkfOptionGroup,
119
117
  Jo as SkfPopover,
120
118
  Qo as SkfProgress,
121
119
  Vo as SkfRadio,
122
120
  _o as SkfSegmentedButton,
123
121
  Yo as SkfSegmentedButtonItem,
124
122
  mr as SkfSelect,
123
+ tr as SkfSelectOption,
124
+ or as SkfSelectOptionGroup,
125
125
  Sr as SkfStepper,
126
126
  fr as SkfStepperItem,
127
127
  xr as SkfSwitch,
@@ -129,9 +129,9 @@ export {
129
129
  nr as SkfTabPanel,
130
130
  Ir as SkfTabs,
131
131
  lr as SkfTag,
132
- gr as SkfTextArea,
133
- Or as SkfToast,
132
+ br as SkfTextArea,
133
+ Pr as SkfToast,
134
134
  Dr as SkfToastItem,
135
135
  vr as SkfToastWrapper,
136
- Cr as SkfTooltip
136
+ Lr as SkfTooltip
137
137
  };
@@ -19,7 +19,7 @@ export declare class SkfPopoverBase extends SkfElement {
19
19
  protected abortEventsController: AbortController;
20
20
  protected signal: AbortSignal;
21
21
  protected popoverController: PopoverController;
22
- constructor();
22
+ connectedCallback(): void;
23
23
  disconnectedCallback(): void;
24
24
  protected _toggleOpen: (newValue?: boolean) => void;
25
25
  private _handleToggle;
@@ -28,10 +28,10 @@ export declare class SkfPopoverBase extends SkfElement {
28
28
  handleAnchorChange: () => Promise<void>;
29
29
  reposition: () => Promise<void>;
30
30
  handleEscapeKey: (e: KeyboardEvent) => void;
31
- open(e: Event): void;
31
+ open: (e: Event) => void;
32
32
  /** @internal add additional open tasks here in UI component */
33
33
  openExtended(): void;
34
- close(): void;
34
+ close: () => void;
35
35
  /** @internal add additional close tasks here in UI component */
36
36
  closeExtended(): void;
37
37
  /** @internal eventlisteners here should implement abort signal */
@@ -1,13 +1,13 @@
1
- import { flip as O, offset as x, arrow as A, computePosition as C } from "@floating-ui/dom";
1
+ import { flip as O, offset as C, arrow as x, computePosition as A } from "@floating-ui/dom";
2
2
  import { SkfElement as S } from "../../components/skf-element.js";
3
3
  import { PopoverController as P } from "../../controllers/popover.controller.js";
4
4
  import { uuid as _ } from "../../helpers/uuid.js";
5
5
  import { watch as f } from "../../helpers/watch.js";
6
6
  import { componentStyles as L } from "../../../styles/component.styles.js";
7
7
  import { nothing as F, html as y } from "lit";
8
- import { property as u, state as c, query as T } from "lit/decorators.js";
9
- import { classMap as j } from "lit/directives/class-map.js";
10
- import { styles as k } from "./popover.styles.js";
8
+ import { property as u, state as c, query as k } from "lit/decorators.js";
9
+ import { classMap as T } from "lit/directives/class-map.js";
10
+ import { styles as j } from "./popover.styles.js";
11
11
  var M = Object.defineProperty, R = Object.getOwnPropertyDescriptor, r = (m, t, o, i) => {
12
12
  for (var e = i > 1 ? void 0 : i ? R(t, o) : t, n = m.length - 1, a; n >= 0; n--)
13
13
  (a = m[n]) && (e = (i ? a(t, o, e) : a(e)) || e);
@@ -15,7 +15,7 @@ var M = Object.defineProperty, R = Object.getOwnPropertyDescriptor, r = (m, t, o
15
15
  }, p;
16
16
  const s = (p = class extends S {
17
17
  constructor() {
18
- super(), this.$popover = this, this.placement = "top", this.variant = "popup", this.isOpen = !1, this.offset = 0, this.arrow = !1, this.triggerEvent = "mouseenter", this.abortEventsController = new AbortController(), this.signal = this.abortEventsController.signal, this.popoverController = new P(this), this._toggleOpen = (t) => {
18
+ super(...arguments), this.$popover = this, this.placement = "top", this.variant = "popup", this.isOpen = !1, this.offset = 0, this.arrow = !1, this.triggerEvent = "mouseenter", this.abortEventsController = new AbortController(), this.signal = this.abortEventsController.signal, this.popoverController = new P(this), this._toggleOpen = (t) => {
19
19
  this.isOpen = t ?? !this.isOpen;
20
20
  }, this._handleToggle = (t) => {
21
21
  const o = t.newState === "open";
@@ -30,9 +30,9 @@ const s = (p = class extends S {
30
30
  }, this.reposition = async () => {
31
31
  var n, a, h;
32
32
  if (!this.$anchor) return;
33
- const t = [O(), x(this.offset)];
34
- this.arrow && t.push(A({ element: this.$arrow }));
35
- const { x: o, y: i, middlewareData: e } = await C(this.$anchor, this.$popover, {
33
+ const t = [O(), C(this.offset)];
34
+ this.arrow && t.push(x({ element: this.$arrow }));
35
+ const { x: o, y: i, middlewareData: e } = await A(this.$anchor, this.$popover, {
36
36
  placement: this.placement,
37
37
  middleware: t,
38
38
  strategy: "fixed"
@@ -41,22 +41,29 @@ const s = (p = class extends S {
41
41
  left: `${String(o)}px`,
42
42
  top: `${String(i)}px`
43
43
  }), this.arrow) {
44
- const d = this.placement.split("-")[0], l = { top: "bottom", right: "left", bottom: "top", left: "right" }[d] ?? "", v = (n = e.flip) == null ? void 0 : n.index, g = (a = e.arrow) == null ? void 0 : a.x, b = (h = e.arrow) == null ? void 0 : h.y, w = typeof g == "number" ? `${String(g)}px` : "", $ = typeof b == "number" ? `${String(b)}px` : "", E = {
44
+ const d = this.placement.split("-")[0], l = { top: "bottom", right: "left", bottom: "top", left: "right" }[d] ?? "", g = (n = e.flip) == null ? void 0 : n.index, v = (a = e.arrow) == null ? void 0 : a.x, b = (h = e.arrow) == null ? void 0 : h.y, $ = typeof v == "number" ? `${String(v)}px` : "", w = typeof b == "number" ? `${String(b)}px` : "", E = {
45
45
  bottom: 45,
46
46
  right: 135,
47
47
  top: 225,
48
48
  left: 315
49
49
  };
50
50
  Object.assign(this.$arrow.style, {
51
- top: $,
52
- [this.placement.includes("left") ? "right" : "left"]: w,
53
- [v ? d : l]: "calc(var(--_skf-popover-arrow-size) * -1)",
54
- rotate: `${(E[l] + (v ? 180 : 0)).toString()}deg`
51
+ top: w,
52
+ [this.placement.includes("left") ? "right" : "left"]: $,
53
+ [g ? d : l]: "calc(var(--_skf-popover-arrow-size) * -1)",
54
+ rotate: `${(E[l] + (g ? 180 : 0)).toString()}deg`
55
55
  });
56
56
  }
57
57
  }, this.handleEscapeKey = (t) => {
58
58
  t.key === "Escape" && this.close();
59
- }, this.setAttribute("popover", "");
59
+ }, this.open = (t) => {
60
+ t.stopPropagation(), this._toggleOpen(!0), this.abortEventsController = new AbortController(), this.signal = this.abortEventsController.signal, document.addEventListener("keydown", this.handleEscapeKey, { signal: this.signal }), this.openExtended();
61
+ }, this.close = () => {
62
+ this.closeExtended(), this._toggleOpen(!1), this.abortEventsController.abort();
63
+ };
64
+ }
65
+ connectedCallback() {
66
+ super.connectedCallback(), this.setAttribute("popover", "");
60
67
  }
61
68
  disconnectedCallback() {
62
69
  super.disconnectedCallback(), this.abortEventsController.abort();
@@ -78,17 +85,11 @@ const s = (p = class extends S {
78
85
  t && i || this.close();
79
86
  },
80
87
  { signal: this.signal }
81
- ), this.$popover.id = _(this.$anchor.id), ["popup", "menu"].includes(this.variant) && (this.$anchor.setAttribute("aria-haspopup", "true"), this.setAttribute("aria-labelledby", this.$anchor.id)), ["menu"].includes(this.variant) && this.$anchor.setAttribute("aria-controls", this.$popover.id), ["popup"].includes(this.variant) && t && (this.role = "dialog"), ["tooltip"].includes(this.variant) && this.$anchor.addEventListener("focusin", this.open.bind(this), { signal: this.signal });
82
- }
83
- open(t) {
84
- t.stopPropagation(), this._toggleOpen(!0), document.addEventListener("keydown", this.handleEscapeKey.bind(this), { signal: this.signal }), this.openExtended();
88
+ ), this.$popover.id = _(this.$anchor.id), ["popup", "menu"].includes(this.variant) && (this.$anchor.setAttribute("aria-haspopup", "true"), this.setAttribute("aria-labelledby", this.$anchor.id)), ["menu"].includes(this.variant) && this.$anchor.setAttribute("aria-controls", this.$popover.id), ["popup"].includes(this.variant) && t && (this.role = "dialog"), ["tooltip"].includes(this.variant) && this.$anchor.addEventListener("focusin", this.open, { signal: this.signal });
85
89
  }
86
90
  /** @internal add additional open tasks here in UI component */
87
91
  openExtended() {
88
92
  }
89
- close() {
90
- this.closeExtended(), this._toggleOpen(!1), document.removeEventListener("keydown", this.handleEscapeKey.bind(this));
91
- }
92
93
  /** @internal add additional close tasks here in UI component */
93
94
  closeExtended() {
94
95
  }
@@ -105,11 +106,11 @@ const s = (p = class extends S {
105
106
  return ["popup", "menu"].includes(this.variant) && ((t = this.$anchor) == null || t.setAttribute("aria-expanded", this.isOpen ? "true" : "false")), y`
106
107
  <div
107
108
  @toggle=${this._handleToggle}
108
- class=${j({ popover: !0, ...p.classMap })}
109
- id="popover"
109
+ class=${T({ popover: !0, ...p.classMap })}
110
+ id="root"
110
111
  >
111
112
  <slot></slot>
112
- ${this.arrow ? y`<div class="popover__arrow" id="arrow"></div>` : F}
113
+ ${this.arrow ? y`<div id="arrow"></div>` : F}
113
114
  </div>
114
115
  `;
115
116
  }
@@ -134,7 +135,7 @@ const s = (p = class extends S {
134
135
  return h;
135
136
  }
136
137
  }
137
- }, p.styles = [L, k], p.classMap = {}, p);
138
+ }, p.styles = [L, j], p.classMap = {}, p);
138
139
  r([
139
140
  u()
140
141
  ], s.prototype, "placement", 2);
@@ -160,7 +161,7 @@ r([
160
161
  c()
161
162
  ], s.prototype, "triggerEvent", 2);
162
163
  r([
163
- T("#arrow")
164
+ k("#arrow")
164
165
  ], s.prototype, "$arrow", 2);
165
166
  r([
166
167
  f("isOpen", { afterUpdate: !0 })
@@ -1,9 +1,7 @@
1
1
  import { css as o } from "lit";
2
2
  const e = o`
3
- /* stylelint-disable selector-class-pattern */
4
3
  @layer components {
5
4
  :host {
6
- background-color: var(--skf-bg-color-neutral-1);
7
5
  border: none;
8
6
  border-radius: var(--skf-border-radius-sm);
9
7
  box-shadow: var(--skf-shadow-md);
@@ -19,15 +17,16 @@ const e = o`
19
17
  display: none;
20
18
  }
21
19
 
22
- #popover {
20
+ #root {
21
+ background-color: var(--skf-bg-color-neutral-1);
23
22
  height: 100%;
24
23
  width: 100%;
25
24
  }
26
25
 
27
- .popover__arrow {
26
+ #arrow {
28
27
  --_skf-popover-arrow-size: calc(6px * 0.7071);
29
28
 
30
- background-color: var(--skf-bg-color-neutral-1);
29
+ background-color: inherit;
31
30
  block-size: calc(var(--_skf-popover-arrow-size) * 2);
32
31
  box-shadow: 1px 1px 2px 0 rgb(0 0 0 / 5%);
33
32
  inline-size: calc(var(--_skf-popover-arrow-size) * 2);
@@ -3,7 +3,11 @@ import { SkfElement } from '../../components/skf-element.js';
3
3
  import type { Severity } from '../../types.js';
4
4
  import { type CSSResultGroup } from 'lit';
5
5
  export declare class SkfHint extends SkfElement {
6
+ #private;
6
7
  static styles: CSSResultGroup;
8
+ disabled: boolean;
7
9
  severity?: Severity;
10
+ /** @internal */
11
+ _handleStateChange(property: string, _prev: unknown, next: unknown): void;
8
12
  render(): import("lit").TemplateResult<1>;
9
13
  }
@@ -1,21 +1,42 @@
1
+ var v = (t) => {
2
+ throw TypeError(t);
3
+ };
4
+ var d = (t, e, s) => e.has(t) || v("Cannot " + s);
5
+ var m = (t, e, s) => (d(t, e, "read from private field"), s ? s.call(t) : e.get(t)), h = (t, e, s) => e.has(t) ? v("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), c = (t, e, s, o) => (d(t, e, "write to private field"), o ? o.call(t, s) : e.set(t, s), s);
1
6
  import "../../../components/icon/icon.js";
2
- import { SkfElement as l } from "../skf-element.js";
3
- import { ICON_SEVERITY as n } from "../../constants/iconSeverity.js";
4
- import { componentStyles as v } from "../../../styles/component.styles.js";
5
- import { html as f } from "lit";
6
- import { property as y } from "lit/decorators.js";
7
- import { styles as d } from "./hint.styles.js";
8
- var a = Object.defineProperty, c = (s, i, m, h) => {
9
- for (var r = void 0, t = s.length - 1, p; t >= 0; t--)
10
- (p = s[t]) && (r = p(i, m, r) || r);
11
- return r && a(i, m, r), r;
7
+ import { SkfElement as O } from "../skf-element.js";
8
+ import { ICON_SEVERITY as g } from "../../constants/iconSeverity.js";
9
+ import { stateMap as w } from "../../helpers/stateMap.js";
10
+ import { watch as C } from "../../helpers/watch.js";
11
+ import { componentStyles as P } from "../../../styles/component.styles.js";
12
+ import { html as _ } from "lit";
13
+ import { property as b } from "lit/decorators.js";
14
+ import { styles as S } from "./hint.styles.js";
15
+ var j = Object.defineProperty, x = Object.getOwnPropertyDescriptor, f = (t, e, s, o) => {
16
+ for (var r = o > 1 ? void 0 : o ? x(e, s) : e, n = t.length - 1, l; n >= 0; n--)
17
+ (l = t[n]) && (r = (o ? l(e, s, r) : l(r)) || r);
18
+ return o && r && j(e, s, r), r;
19
+ };
20
+ const u = {
21
+ disabled: "disabled",
22
+ severity: ["error", "info", "success", "warning"]
12
23
  };
13
- const o = class o extends l {
24
+ var p, a;
25
+ const y = class y extends O {
26
+ constructor() {
27
+ super(...arguments);
28
+ h(this, p);
29
+ h(this, a);
30
+ c(this, p, this.attachInternals()), c(this, a, m(this, p).states), this.disabled = !1;
31
+ }
32
+ _handleStateChange(s, o, r) {
33
+ w(m(this, a), u[s]).set(r);
34
+ }
14
35
  render() {
15
- return f`
36
+ return _`
16
37
  <div id="root">
17
- ${this.severity && f`
18
- <skf-icon color=${this.severity} name="${n[this.severity]}" size="xs">
38
+ ${this.severity && _`
39
+ <skf-icon color=${this.severity} name="${g[this.severity]}" size="xs">
19
40
  </skf-icon>
20
41
  `}
21
42
  <slot></slot>
@@ -23,11 +44,17 @@ const o = class o extends l {
23
44
  `;
24
45
  }
25
46
  };
26
- o.styles = [v, d];
27
- let e = o;
28
- c([
29
- y()
30
- ], e.prototype, "severity");
47
+ p = new WeakMap(), a = new WeakMap(), y.styles = [P, S];
48
+ let i = y;
49
+ f([
50
+ b({ type: Boolean })
51
+ ], i.prototype, "disabled", 2);
52
+ f([
53
+ b({ type: String })
54
+ ], i.prototype, "severity", 2);
55
+ f([
56
+ C(Object.keys(u))
57
+ ], i.prototype, "_handleStateChange", 1);
31
58
  export {
32
- e as SkfHint
59
+ i as SkfHint
33
60
  };
@@ -1,35 +1,39 @@
1
- import { css as r } from "lit";
2
- const s = r`
3
- #root {
4
- align-items: center;
5
- color: var(--_skf-hint-color, var(--skf-text-color-secondary));
6
- display: flex;
7
- font-size: var(--skf-font-size-75);
8
- font-weight: var(--skf-font-weight-medium);
9
- gap: var(--skf-spacing-25);
1
+ import { css as o } from "lit";
2
+ const s = o`
3
+ @layer components {
4
+ @layer base {
5
+ #root {
6
+ --_skf-hint-color: var(--skf-text-color-secondary);
10
7
 
11
- :host-context(:disabled) & {
12
- color: inherit;
8
+ align-items: center;
9
+ color: var(--_skf-hint-color);
10
+ display: flex;
11
+ font-size: var(--skf-font-size-75);
12
+ font-weight: var(--skf-font-weight-medium);
13
+ gap: var(--skf-spacing-25);
14
+ }
13
15
  }
14
16
 
15
- :host([severity='alert']) & {
16
- --_skf-hint-color: var(--skf-severity-fg-color-alert);
17
- }
17
+ @layer mods {
18
+ :host(:state(disabled)) #root {
19
+ --_skf-hint-color: var(--skf-interactive-text-color-disabled);
20
+ }
18
21
 
19
- :host([severity='error']) & {
20
- --_skf-hint-color: var(--skf-severity-fg-color-error);
21
- }
22
+ :host(:not(:state(disabled)):state(error)) #root {
23
+ --_skf-hint-color: var(--skf-severity-fg-color-error);
24
+ }
22
25
 
23
- :host([severity='info']) & {
24
- --_skf-hint-color: var(--skf-severity-fg-color-info);
25
- }
26
+ :host(:not(:state(disabled)):state(info)) #root {
27
+ --_skf-hint-color: var(--skf-severity-fg-color-info);
28
+ }
26
29
 
27
- :host([severity='success']) & {
28
- --_skf-hint-color: var(--skf-severity-fg-color-success);
29
- }
30
+ :host(:not(:state(disabled)):state(success)) #root {
31
+ --_skf-hint-color: var(--skf-severity-fg-color-success);
32
+ }
30
33
 
31
- :host([severity='warning']) & {
32
- --_skf-hint-color: var(--skf-severity-fg-color-warning);
34
+ :host(:not(:state(disabled)):state(warning)) #root {
35
+ --_skf-hint-color: var(--skf-severity-fg-color-warning);
36
+ }
33
37
  }
34
38
  }
35
39
  `;
@@ -16,3 +16,7 @@ export type HeadingType = 'h1' | 'h2' | 'h3' | 'h4';
16
16
  * Forms
17
17
  */
18
18
  export type FormFieldSeverity = Exclude<Severity, 'error'>;
19
+ /**
20
+ * States
21
+ */
22
+ export type States<T extends string> = Record<string, T | T[]>;