@skf-design-system/ui-components 1.0.2-beta.5 → 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.
- package/custom-elements.json +25490 -0
- package/dist/components/accordion/accordion.component.d.ts +1 -1
- package/dist/components/accordion/accordion.component.js +2 -2
- package/dist/components/datepicker/datepicker.component.js +1 -0
- package/dist/components/divider/divider.component.d.ts +3 -0
- package/dist/components/divider/divider.component.js +43 -22
- package/dist/components/divider/divider.styles.js +8 -8
- package/dist/components/drawer/drawer.component.d.ts +8 -2
- package/dist/components/drawer/drawer.component.js +74 -54
- package/dist/components/drawer/drawer.styles.js +47 -40
- package/dist/components/input/input.component.js +1 -0
- package/dist/components/link/link.component.d.ts +15 -18
- package/dist/components/link/link.component.js +99 -108
- package/dist/components/link/link.styles.js +45 -45
- package/dist/components/loader/loader.component.d.ts +5 -1
- package/dist/components/loader/loader.component.js +43 -29
- package/dist/components/loader/loader.styles.js +5 -9
- package/dist/components/menu/menu-item.component.d.ts +1 -1
- package/dist/components/menu/menu-item.component.js +8 -8
- package/dist/components/menu/menu-item.styles.js +8 -5
- package/dist/components/menu/menu.component.d.ts +1 -1
- package/dist/components/menu/menu.component.js +8 -8
- package/dist/components/nav/nav-item.component.d.ts +4 -0
- package/dist/components/nav/nav-item.component.js +44 -25
- package/dist/components/nav/nav-item.styles.js +29 -25
- package/dist/components/nav/nav.component.d.ts +6 -0
- package/dist/components/nav/nav.component.js +42 -21
- package/dist/components/nav/nav.styles.js +15 -9
- package/dist/components/popover/popover.component.d.ts +4 -0
- package/dist/components/popover/popover.component.js +30 -22
- package/dist/components/progress/progress.component.d.ts +2 -0
- package/dist/components/progress/progress.component.js +38 -29
- package/dist/components/progress/progress.styles.js +3 -3
- package/dist/components/select/select-option-group.component.d.ts +4 -0
- package/dist/components/select/select-option-group.component.js +37 -18
- package/dist/components/select/select-option-group.style.js +12 -6
- package/dist/components/select/select-option.component.d.ts +6 -1
- package/dist/components/select/select-option.component.js +73 -53
- package/dist/components/select/select-option.styles.js +43 -31
- package/dist/components/select/select.component.d.ts +5 -1
- package/dist/components/select/select.component.js +47 -29
- package/dist/components/select/select.controllers.js +2 -1
- package/dist/components/select/select.styles.js +8 -2
- package/dist/components/stepper/stepper-item.component.d.ts +1 -1
- package/dist/components/stepper/stepper-item.component.js +26 -23
- package/dist/components/tabs/tab-panel.component.d.ts +1 -1
- package/dist/components/tabs/tab-panel.component.js +19 -16
- package/dist/components/tabs/tab.component.d.ts +1 -1
- package/dist/components/tabs/tab.component.js +17 -14
- package/dist/components/textarea/textarea.component.js +5 -4
- package/dist/components/toast/toast-item.styles.js +13 -10
- package/dist/components/toast/toast.component.js +9 -9
- package/dist/components/toast/toast.singleton.d.ts +1 -1
- package/dist/components/toast/toast.singleton.js +18 -18
- package/dist/components/tooltip/tooltip.component.d.ts +1 -0
- package/dist/components/tooltip/tooltip.component.js +10 -7
- package/dist/custom-elements.json +803 -704
- package/dist/index.d.ts +2 -2
- package/dist/index.js +20 -20
- package/dist/internal/base-classes/popover/popover.base.d.ts +3 -3
- package/dist/internal/base-classes/popover/popover.base.js +27 -26
- package/dist/internal/base-classes/popover/popover.styles.js +4 -5
- package/dist/internal/components/hint/hint.component.d.ts +4 -0
- package/dist/internal/components/hint/hint.component.js +47 -20
- package/dist/internal/components/hint/hint.styles.js +29 -25
- package/dist/internal/types.d.ts +4 -0
- package/dist/types/jsx/custom-element-jsx.d.ts +184 -81
- package/dist/types/vue/index.d.ts +77 -80
- package/dist/vscode.html-custom-data.json +93 -97
- package/dist/web-types.json +210 -215
- 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
|
32
|
-
export { default as
|
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
|
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
|
63
|
-
import { SkfInput as
|
64
|
-
import { SkfLink as
|
65
|
-
import { SkfLoader as
|
66
|
-
import { SkfLogo as
|
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
|
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
|
90
|
-
import { SkfTooltip as
|
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
|
-
|
105
|
+
bo as SkfDrawer,
|
106
106
|
Do as SkfHeader,
|
107
107
|
vo as SkfHeading,
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
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
|
-
|
133
|
-
|
132
|
+
br as SkfTextArea,
|
133
|
+
Pr as SkfToast,
|
134
134
|
Dr as SkfToastItem,
|
135
135
|
vr as SkfToastWrapper,
|
136
|
-
|
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
|
-
|
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)
|
31
|
+
open: (e: Event) => void;
|
32
32
|
/** @internal add additional open tasks here in UI component */
|
33
33
|
openExtended(): void;
|
34
|
-
close()
|
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
|
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
|
9
|
-
import { classMap as
|
10
|
-
import { styles as
|
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(),
|
34
|
-
this.arrow && t.push(
|
35
|
-
const { x: o, y: i, middlewareData: e } = await
|
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] ?? "",
|
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"]:
|
53
|
-
[
|
54
|
-
rotate: `${(E[l] + (
|
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.
|
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
|
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=${
|
109
|
-
id="
|
109
|
+
class=${T({ popover: !0, ...p.classMap })}
|
110
|
+
id="root"
|
110
111
|
>
|
111
112
|
<slot></slot>
|
112
|
-
${this.arrow ? y`<div
|
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,
|
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
|
-
|
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
|
-
#
|
20
|
+
#root {
|
21
|
+
background-color: var(--skf-bg-color-neutral-1);
|
23
22
|
height: 100%;
|
24
23
|
width: 100%;
|
25
24
|
}
|
26
25
|
|
27
|
-
|
26
|
+
#arrow {
|
28
27
|
--_skf-popover-arrow-size: calc(6px * 0.7071);
|
29
28
|
|
30
|
-
background-color:
|
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
|
3
|
-
import { ICON_SEVERITY as
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
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
|
36
|
+
return _`
|
16
37
|
<div id="root">
|
17
|
-
${this.severity &&
|
18
|
-
<skf-icon color=${this.severity} name="${
|
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
|
-
|
27
|
-
let
|
28
|
-
|
29
|
-
|
30
|
-
],
|
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
|
-
|
59
|
+
i as SkfHint
|
33
60
|
};
|
@@ -1,35 +1,39 @@
|
|
1
|
-
import { css as
|
2
|
-
const s =
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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
|
-
|
12
|
-
|
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
|
-
|
16
|
-
|
17
|
-
|
17
|
+
@layer mods {
|
18
|
+
:host(:state(disabled)) #root {
|
19
|
+
--_skf-hint-color: var(--skf-interactive-text-color-disabled);
|
20
|
+
}
|
18
21
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
+
:host(:not(:state(disabled)):state(error)) #root {
|
23
|
+
--_skf-hint-color: var(--skf-severity-fg-color-error);
|
24
|
+
}
|
22
25
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
+
:host(:not(:state(disabled)):state(info)) #root {
|
27
|
+
--_skf-hint-color: var(--skf-severity-fg-color-info);
|
28
|
+
}
|
26
29
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
+
:host(:not(:state(disabled)):state(success)) #root {
|
31
|
+
--_skf-hint-color: var(--skf-severity-fg-color-success);
|
32
|
+
}
|
30
33
|
|
31
|
-
|
32
|
-
|
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
|
`;
|
package/dist/internal/types.d.ts
CHANGED