@skf-design-system/ui-components 0.0.1-beta.4 → 1.0.0-alpha.28
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/README.md +26 -6
- package/custom-elements.json +18265 -0
- package/dist/components/accordion/accordion.component.d.ts +9 -5
- package/dist/components/accordion/accordion.component.js +22 -19
- package/dist/components/accordion/accordion.d.ts +1 -1
- package/dist/components/accordion/accordion.styles.js +3 -3
- package/dist/components/alert/alert.component.d.ts +7 -4
- package/dist/components/alert/alert.component.js +21 -19
- package/dist/components/alert/alert.styles.js +50 -47
- package/dist/components/button/button.component.d.ts +24 -0
- package/dist/components/button/button.component.js +80 -56
- package/dist/components/button/button.styles.js +2 -1
- package/dist/components/card/card.component.d.ts +3 -3
- package/dist/components/card/card.component.js +16 -19
- package/dist/components/card/card.styles.js +11 -3
- package/dist/components/checkbox/checkbox.component.d.ts +17 -15
- package/dist/components/checkbox/checkbox.component.js +95 -89
- package/dist/components/checkbox/checkbox.styles.js +7 -2
- package/dist/components/checkbox/checkbox.test.d.ts +1 -0
- package/dist/components/collapse/collapse.component.d.ts +9 -6
- package/dist/components/collapse/collapse.component.js +39 -36
- package/dist/components/collapse/collapse.styles.js +3 -3
- package/dist/components/collapse/collapse.test.d.ts +1 -0
- package/dist/components/divider/divider.component.d.ts +13 -10
- package/dist/components/divider/divider.component.js +34 -29
- package/dist/components/divider/divider.styles.js +1 -5
- package/dist/components/heading/heading.component.d.ts +12 -2
- package/dist/components/heading/heading.component.js +14 -14
- package/dist/components/heading/heading.styles.js +1 -1
- package/dist/components/icon/icon.component.d.ts +14 -8
- package/dist/components/icon/icon.component.js +6 -6
- package/dist/components/icon/icon.styles.js +56 -54
- package/dist/components/input/input.component.d.ts +44 -29
- package/dist/components/input/input.component.js +118 -111
- package/dist/components/link/link.component.d.ts +15 -12
- package/dist/components/link/link.component.js +7 -7
- package/dist/components/link/link.styles.js +1 -1
- package/dist/components/loader/loader.component.d.ts +7 -7
- package/dist/components/loader/loader.component.js +35 -61
- package/dist/components/loader/loader.styles.js +42 -10
- package/dist/components/logo/logo.component.d.ts +5 -3
- package/dist/components/logo/logo.component.js +8 -8
- package/dist/components/logo/logo.styles.js +2 -2
- package/dist/components/progress/progress.component.d.ts +22 -0
- package/dist/components/progress/progress.component.js +40 -0
- package/dist/components/progress/progress.d.ts +8 -0
- package/dist/components/progress/progress.js +6 -0
- package/dist/components/progress/progress.styles.d.ts +1 -0
- package/dist/components/progress/progress.styles.js +47 -0
- package/dist/components/radio/radio.component.d.ts +18 -18
- package/dist/components/radio/radio.component.js +94 -78
- package/dist/components/radio/radio.styles.js +6 -1
- package/dist/components/select/select.component.d.ts +140 -0
- package/dist/components/select/select.component.js +327 -0
- package/dist/components/select/select.controllers.d.ts +59 -0
- package/dist/components/select/select.controllers.js +172 -0
- package/dist/components/select/select.d.ts +8 -0
- package/dist/components/select/select.js +6 -0
- package/dist/components/select/select.styles.d.ts +1 -0
- package/dist/components/select/select.styles.js +131 -0
- package/dist/components/select-option/select-option.component.d.ts +77 -0
- package/dist/components/select-option/select-option.component.js +123 -0
- package/dist/components/select-option/select-option.controllers.d.ts +9 -0
- package/dist/components/select-option/select-option.d.ts +8 -0
- package/dist/components/select-option/select-option.js +6 -0
- package/dist/components/select-option/select-option.styles.d.ts +1 -0
- package/dist/components/select-option/select-option.styles.js +53 -0
- package/dist/components/select-option-group/select-option-group.component.d.ts +16 -0
- package/dist/components/select-option-group/select-option-group.component.js +31 -0
- package/dist/components/select-option-group/select-option-group.d.ts +8 -0
- package/dist/components/select-option-group/select-option-group.js +6 -0
- package/dist/components/select-option-group/select-option-group.style.d.ts +1 -0
- package/dist/components/select-option-group/select-option-group.style.js +18 -0
- package/dist/components/switch/switch.component.d.ts +2 -3
- package/dist/components/switch/switch.component.js +5 -2
- package/dist/components/switch/switch.styles.js +6 -1
- package/dist/components/switch/switch.test.d.ts +1 -0
- package/dist/components/tab/tab.component.d.ts +29 -0
- package/dist/components/tab/tab.component.js +57 -0
- package/dist/components/tab/tab.d.ts +8 -0
- package/dist/components/tab/tab.js +6 -0
- package/dist/components/tab/tab.styles.d.ts +1 -0
- package/dist/components/tab/tab.styles.js +123 -0
- package/dist/components/tab-group/tab-group.component.d.ts +43 -0
- package/dist/components/tab-group/tab-group.component.js +98 -0
- package/dist/components/tab-group/tab-group.d.ts +8 -0
- package/dist/components/tab-group/tab-group.js +6 -0
- package/dist/components/tab-group/tab-group.styles.d.ts +1 -0
- package/dist/components/tab-group/tab-group.styles.js +75 -0
- package/dist/components/tab-panel/tab-panel.component.d.ts +19 -0
- package/dist/components/tab-panel/tab-panel.component.js +36 -0
- package/dist/components/tab-panel/tab-panel.d.ts +8 -0
- package/dist/components/tab-panel/tab-panel.js +6 -0
- package/dist/components/tab-panel/tab-panel.styles.d.ts +1 -0
- package/dist/components/tab-panel/tab-panel.styles.js +13 -0
- package/dist/components/tag/tag.component.d.ts +25 -4
- package/dist/components/tag/tag.component.js +66 -29
- package/dist/components/tag/tag.styles.js +6 -5
- package/dist/components/textarea/textarea.component.d.ts +26 -23
- package/dist/components/textarea/textarea.component.js +20 -17
- package/dist/components/toast/toast.component.d.ts +35 -0
- package/dist/components/toast/toast.component.js +52 -0
- package/dist/components/toast/toast.d.ts +8 -0
- package/dist/components/toast/toast.js +6 -0
- package/dist/components/toast/toast.singleton.d.ts +26 -0
- package/dist/components/toast/toast.singleton.js +53 -0
- package/dist/components/toast/toast.styles.d.ts +1 -0
- package/dist/components/toast/toast.styles.js +9 -0
- package/dist/components/toast-item/toast-item.component.d.ts +21 -0
- package/dist/components/toast-item/toast-item.component.js +65 -0
- package/dist/components/toast-item/toast-item.d.ts +6 -0
- package/dist/components/toast-item/toast-item.js +2 -0
- package/dist/components/toast-item/toast-item.styles.d.ts +2 -0
- package/dist/components/toast-item/toast-item.styles.js +16 -0
- package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +24 -0
- package/dist/components/toast-wrapper/toast-wrapper.component.js +37 -0
- package/dist/components/toast-wrapper/toast-wrapper.d.ts +8 -0
- package/dist/components/toast-wrapper/toast-wrapper.js +6 -0
- package/dist/components/toast-wrapper/toast-wrapper.styles.d.ts +1 -0
- package/dist/components/toast-wrapper/toast-wrapper.styles.js +20 -0
- package/dist/custom-elements.json +2146 -616
- package/dist/index.d.ts +8 -0
- package/dist/index.js +60 -36
- package/dist/internal/components/formBase.d.ts +19 -1
- package/dist/internal/components/formBase.js +29 -17
- package/dist/internal/components/hint/hint.component.js +12 -10
- package/dist/internal/components/hint/hint.styles.js +26 -10
- package/dist/internal/components/skf-element.d.ts +4 -4
- package/dist/internal/components/skf-element.js +15 -19
- package/dist/internal/helpers/array.d.ts +4 -0
- package/dist/internal/helpers/findMatchingTags.d.ts +2 -0
- package/dist/internal/helpers/findMatchingTags.js +12 -0
- package/dist/internal/helpers/hintSeverity.d.ts +2 -0
- package/dist/internal/helpers/hintSeverity.js +6 -0
- package/dist/internal/helpers/raiseError.d.ts +28 -0
- package/dist/internal/helpers/raiseError.js +29 -0
- package/dist/internal/helpers/watch.d.ts +27 -0
- package/dist/internal/helpers/watch.js +28 -0
- package/dist/internal/storybook/shadowRootTraverser.d.ts +16 -6
- package/dist/react/index.d.ts +9 -0
- package/dist/react/index.js +9 -0
- package/dist/react/skf-button/index.d.ts +7 -1
- package/dist/react/skf-button/index.js +5 -1
- package/dist/react/skf-progress/index.d.ts +3 -0
- package/dist/react/skf-progress/index.js +13 -0
- package/dist/react/skf-select/index.d.ts +21 -0
- package/dist/react/skf-select/index.js +21 -0
- package/dist/react/skf-select-option/index.d.ts +9 -0
- package/dist/react/skf-select-option/index.js +17 -0
- package/dist/react/skf-select-option-group/index.d.ts +3 -0
- package/dist/react/skf-select-option-group/index.js +13 -0
- package/dist/react/skf-tab/index.d.ts +12 -0
- package/dist/react/skf-tab/index.js +18 -0
- package/dist/react/skf-tab-group/index.d.ts +3 -0
- package/dist/react/skf-tab-group/index.js +13 -0
- package/dist/react/skf-tab-panel/index.d.ts +3 -0
- package/dist/react/skf-tab-panel/index.js +13 -0
- package/dist/react/skf-toast/index.d.ts +3 -0
- package/dist/react/skf-toast/index.js +13 -0
- package/dist/react/skf-toast-wrapper/index.d.ts +3 -0
- package/dist/react/skf-toast-wrapper/index.js +13 -0
- package/dist/styles/form-field.styles.js +11 -7
- package/dist/types/jsx/custom-element-jsx.d.ts +166 -995
- package/dist/types/vue/index.d.ts +368 -94
- package/dist/vscode.html-custom-data.json +408 -106
- package/dist/web-types.json +932 -281
- package/package.json +39 -35
@@ -1,36 +1,33 @@
|
|
1
1
|
import { SkfElement as d } from "../../internal/components/skf-element.js";
|
2
|
-
import
|
2
|
+
import a from "../../styles/component.styles.js";
|
3
3
|
import { html as f } from "lit";
|
4
4
|
import { property as r } from "lit/decorators.js";
|
5
5
|
import y from "./card.styles.js";
|
6
|
-
var
|
7
|
-
for (var t = void 0,
|
8
|
-
(
|
9
|
-
return t &&
|
6
|
+
var v = Object.defineProperty, p = (i, l, s, u) => {
|
7
|
+
for (var t = void 0, e = i.length - 1, m; e >= 0; e--)
|
8
|
+
(m = i[e]) && (t = m(l, s, t) || t);
|
9
|
+
return t && v(l, s, t), t;
|
10
10
|
};
|
11
11
|
const n = class n extends d {
|
12
|
-
constructor() {
|
13
|
-
super(...arguments), this.noBorder = !1, this.noPadding = !1, this.stretch = !1;
|
14
|
-
}
|
15
12
|
render() {
|
16
13
|
return f`
|
17
|
-
<div id="
|
14
|
+
<div id="root">
|
18
15
|
<slot></slot>
|
19
16
|
</div>
|
20
17
|
`;
|
21
18
|
}
|
22
19
|
};
|
23
|
-
n.styles = [
|
24
|
-
let
|
25
|
-
|
20
|
+
n.styles = [a, y];
|
21
|
+
let o = n;
|
22
|
+
p([
|
26
23
|
r({ type: Boolean, attribute: "no-border" })
|
27
|
-
],
|
28
|
-
|
24
|
+
], o.prototype, "noBorder");
|
25
|
+
p([
|
29
26
|
r({ type: Boolean, attribute: "no-padding" })
|
30
|
-
],
|
31
|
-
|
32
|
-
r({ type: Boolean })
|
33
|
-
],
|
27
|
+
], o.prototype, "noPadding");
|
28
|
+
p([
|
29
|
+
r({ type: Boolean, reflect: !0 })
|
30
|
+
], o.prototype, "stretch");
|
34
31
|
export {
|
35
|
-
|
32
|
+
o as SkfCard
|
36
33
|
};
|
@@ -1,6 +1,14 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
|
-
const
|
3
|
-
|
2
|
+
const s = r`
|
3
|
+
:host {
|
4
|
+
contain: layout;
|
5
|
+
}
|
6
|
+
|
7
|
+
:host([stretch]) {
|
8
|
+
block-size: 100%;
|
9
|
+
}
|
10
|
+
|
11
|
+
#root {
|
4
12
|
background-color: var(--skf-bg-color-neutral-1);
|
5
13
|
border: var(--skf-border-width-sm) solid
|
6
14
|
var(--_skf-card-border-color, var(--skf-border-color-tertiary));
|
@@ -22,5 +30,5 @@ const d = r`
|
|
22
30
|
}
|
23
31
|
`;
|
24
32
|
export {
|
25
|
-
|
33
|
+
s as default
|
26
34
|
};
|
@@ -5,29 +5,30 @@ import { type CSSResultGroup } from 'lit';
|
|
5
5
|
/**
|
6
6
|
* The `<skf-checkbox>` component is used to create a checkbox input
|
7
7
|
*
|
8
|
-
* @documentation See [
|
8
|
+
* @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/94464f-checkbox) for design principles
|
9
9
|
*
|
10
10
|
* @attribute {boolean} disabled - If true, sets disabled state
|
11
11
|
* @attribute {boolean} required - If true, value is required or must be checked for the form to be submittable
|
12
12
|
*
|
13
13
|
* @event change {object} - When the value of the input changes
|
14
14
|
*
|
15
|
-
* @slot
|
15
|
+
* @slot - The Radios label. Alternatively, you can use the `label` attribute.
|
16
16
|
*
|
17
17
|
* @tagname skf-checkbox
|
18
18
|
*/
|
19
19
|
export declare class SkfCheckbox extends FormBase implements FormFieldBaseProps {
|
20
20
|
static styles: CSSResultGroup;
|
21
|
-
/**
|
22
|
-
|
21
|
+
/**
|
22
|
+
* @internal
|
23
|
+
* Initial state saved here as default for form resets.
|
24
|
+
*/
|
25
|
+
private _initiallyChecked;
|
23
26
|
/** If defined, outputs helping hints in console */
|
24
27
|
debug?: boolean;
|
25
28
|
/** If true, outputs helping hints in console */
|
26
29
|
checked?: boolean;
|
27
30
|
/** If true, forces component to invalid state until removed */
|
28
31
|
customInvalid?: boolean;
|
29
|
-
/** If true, hides the label visually */
|
30
|
-
hideLabel?: boolean;
|
31
32
|
/** If true and the checkbox is unchecked, the checkbox will appear indeterminate */
|
32
33
|
indeterminate?: boolean;
|
33
34
|
/** If defined, sets the input's label. Alternatively, you can use the `label` attribute. */
|
@@ -36,12 +37,15 @@ export declare class SkfCheckbox extends FormBase implements FormFieldBaseProps
|
|
36
37
|
name?: string;
|
37
38
|
/** If defined, renders an alternative A11y text for the asterisk */
|
38
39
|
requiredLabel?: string;
|
39
|
-
/**
|
40
|
-
|
41
|
-
|
40
|
+
/**
|
41
|
+
* If defined, styles checkbox using provided severity
|
42
|
+
* @type { "alert" | "success" | "info" | "warning" }
|
43
|
+
*/
|
42
44
|
severity?: FormFieldBaseProps['severity'];
|
43
|
-
/** If
|
45
|
+
/** If true, displays valid state after interaction */
|
44
46
|
showValid?: boolean;
|
47
|
+
/** Size of the checkbox */
|
48
|
+
size: 'sm' | 'md';
|
45
49
|
/** The current value of the input field */
|
46
50
|
value: string;
|
47
51
|
/** @internal */
|
@@ -49,12 +53,10 @@ export declare class SkfCheckbox extends FormBase implements FormFieldBaseProps
|
|
49
53
|
private _invalid;
|
50
54
|
/** @internal */
|
51
55
|
private $input?;
|
52
|
-
|
53
|
-
|
56
|
+
handleInvalidChange(): void;
|
57
|
+
handleDebugInvalid(): void;
|
58
|
+
handleCustomInvalidChange(): void;
|
54
59
|
protected firstUpdated(): void;
|
55
|
-
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
56
|
-
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
57
|
-
debugOutput(): void;
|
58
60
|
/** @internal */
|
59
61
|
private _validateInput;
|
60
62
|
/** @internal */
|
@@ -1,68 +1,68 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
|
-
import { FormBase as
|
3
|
-
import {
|
4
|
-
import v from "../../
|
5
|
-
import
|
6
|
-
import {
|
2
|
+
import { FormBase as c } from "../../internal/components/formBase.js";
|
3
|
+
import { watch as h } from "../../internal/helpers/watch.js";
|
4
|
+
import { Asterisk as v } from "../../internal/templates/asterisk.js";
|
5
|
+
import m from "../../styles/component.styles.js";
|
6
|
+
import { html as p, nothing as y } from "lit";
|
7
|
+
import { property as r, state as f, query as _ } from "lit/decorators.js";
|
7
8
|
import { ifDefined as b } from "lit/directives/if-defined.js";
|
8
|
-
import
|
9
|
-
var
|
10
|
-
for (var l = void 0, o =
|
11
|
-
(
|
12
|
-
return l &&
|
9
|
+
import g from "./checkbox.styles.js";
|
10
|
+
var $ = Object.defineProperty, I = Object.getOwnPropertyDescriptor, e = (u, i, s, a) => {
|
11
|
+
for (var l = a > 1 ? void 0 : a ? I(i, s) : i, o = u.length - 1, n; o >= 0; o--)
|
12
|
+
(n = u[o]) && (l = (a ? n(i, s, l) : n(l)) || l);
|
13
|
+
return a && l && $(i, s, l), l;
|
13
14
|
};
|
14
|
-
const
|
15
|
+
const d = class d extends c {
|
15
16
|
constructor() {
|
16
|
-
super(...arguments), this.
|
17
|
-
|
18
|
-
}, this._renderIcon = (
|
19
|
-
<skf-icon color="inverse" name=${
|
17
|
+
super(...arguments), this._initiallyChecked = !1, this.size = "md", this.value = "", this._invalid = !1, this._resetValue = (i) => {
|
18
|
+
i.stopPropagation(), this.checked = this._initiallyChecked, this.$input && (this.$input.checked = !!this._initiallyChecked), this.setFormValue(this.checked ? this.value : null);
|
19
|
+
}, this._renderIcon = (i) => p`
|
20
|
+
<skf-icon color="inverse" name=${i} size=${this.size === "sm" ? "sm" : "md"}></skf-icon>
|
20
21
|
`;
|
21
22
|
}
|
22
|
-
|
23
|
-
|
23
|
+
handleInvalidChange() {
|
24
|
+
this._invalid ? (this.setAttribute("invalid", ""), this.showValid && this.removeAttribute("valid"), this.checkValidity()) : (this.removeAttribute("invalid"), !this.pristine && this.showValid && this.setAttribute("valid", "true"));
|
24
25
|
}
|
25
|
-
|
26
|
-
|
26
|
+
handleDebugInvalid() {
|
27
|
+
this._invalid && this.debug && !this.validity.valid && console.log(`Checkbox invalidity reason: ${this.validationMessage}`);
|
28
|
+
}
|
29
|
+
handleCustomInvalidChange() {
|
30
|
+
if (this.customInvalid) {
|
31
|
+
const s = (
|
32
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
33
|
+
this.getAttribute("data-customerror") || "Set a custom error message using the data-customerror attribute"
|
34
|
+
);
|
35
|
+
this.pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, s), this.checkValidity();
|
36
|
+
} else
|
37
|
+
this.setValidity({}), this._validateInput();
|
27
38
|
}
|
28
39
|
firstUpdated() {
|
29
|
-
var
|
30
|
-
(
|
40
|
+
var i;
|
41
|
+
(i = this.$input) == null || i.addEventListener("change", (s) => {
|
31
42
|
var a;
|
32
|
-
|
33
|
-
}), this.addEventListener("invalid", (
|
34
|
-
this.pristine = !1, this._invalid = !0, this.customErrorDisplay &&
|
35
|
-
}), this.
|
36
|
-
}
|
37
|
-
updated(t) {
|
38
|
-
super.updated(t), t.has("_invalid") && this._invalid && this.debug && this.debugOutput();
|
39
|
-
}
|
40
|
-
attributeChangedCallback(t, r, a) {
|
41
|
-
if (super.attributeChangedCallback(t, r, a), t === "custom-invalid")
|
42
|
-
if (typeof a == "string") {
|
43
|
-
const o = String(a).trim() || "Custom error";
|
44
|
-
this.pristine = !1, this._invalid = !0, this.setValidity({ customError: !0 }, o), this.checkValidity();
|
45
|
-
} else
|
46
|
-
this.setValidity({}), this._validateInput();
|
47
|
-
}
|
48
|
-
debugOutput() {
|
49
|
-
this.debug && !this.validity.valid && console.log(`Checkbox invalidity reason: ${this.validationMessage}`);
|
43
|
+
s.stopPropagation(), this.pristine = !1, this.checked = (a = this.$input) == null ? void 0 : a.checked, this._validateInput(), this.checked ? (this.indeterminate = !1, this.setFormValue(this.value)) : this.setFormValue(null), this.emitEvent("change");
|
44
|
+
}), this.addEventListener("invalid", (s) => {
|
45
|
+
this.pristine = !1, this._invalid = !0, this.customErrorDisplay && s.preventDefault();
|
46
|
+
}), this._initiallyChecked = this.checked, this.addEventListener("reset", this._resetValue), this._validateInput();
|
50
47
|
}
|
51
48
|
/** @internal */
|
52
49
|
_validateInput() {
|
53
|
-
var
|
50
|
+
var i;
|
54
51
|
if (this._invalid = !1, this.customInvalid)
|
55
52
|
this.setValidity({ customError: !0 }, "Custom error"), this._invalid = !0;
|
56
53
|
else if (this.required && !this.checked) {
|
57
54
|
this.pristine || (this._invalid = !0);
|
58
|
-
const
|
59
|
-
|
55
|
+
const s = this.hasAttribute("data-valuemissing") ? this.getAttribute("data-valuemissing") : (
|
56
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
57
|
+
((i = this.$input) == null ? void 0 : i.validationMessage) || "Please check this box if you want to proceed"
|
58
|
+
);
|
59
|
+
this.setValidity({ valueMissing: !0 }, String(s));
|
60
60
|
} else
|
61
61
|
this.setValidity({});
|
62
62
|
}
|
63
63
|
render() {
|
64
|
-
return
|
65
|
-
<label id="
|
64
|
+
return p`
|
65
|
+
<label id="root">
|
66
66
|
<input
|
67
67
|
?checked=${this.checked}
|
68
68
|
?disabled=${this.disabled}
|
@@ -76,56 +76,62 @@ const h = class h extends p {
|
|
76
76
|
${this._renderIcon("check")} ${this._renderIcon("removeMinus")}
|
77
77
|
<div id="label">
|
78
78
|
<slot>${this.label}</slot>
|
79
|
-
${this.required ?
|
79
|
+
${this.required ? v(this.requiredLabel) : y}
|
80
80
|
</div>
|
81
81
|
</label>
|
82
82
|
`;
|
83
83
|
}
|
84
84
|
};
|
85
|
-
|
86
|
-
let
|
87
|
-
|
88
|
-
|
89
|
-
],
|
90
|
-
|
91
|
-
|
92
|
-
],
|
93
|
-
|
94
|
-
|
95
|
-
],
|
96
|
-
|
97
|
-
|
98
|
-
],
|
99
|
-
|
100
|
-
|
101
|
-
],
|
102
|
-
|
103
|
-
|
104
|
-
],
|
105
|
-
|
106
|
-
|
107
|
-
],
|
108
|
-
|
109
|
-
|
110
|
-
],
|
111
|
-
|
112
|
-
|
113
|
-
],
|
114
|
-
|
115
|
-
|
116
|
-
],
|
117
|
-
|
118
|
-
|
119
|
-
],
|
120
|
-
|
121
|
-
s()
|
122
|
-
], e.prototype, "value");
|
123
|
-
i([
|
85
|
+
d.styles = [m, g];
|
86
|
+
let t = d;
|
87
|
+
e([
|
88
|
+
r({ type: Boolean })
|
89
|
+
], t.prototype, "debug", 2);
|
90
|
+
e([
|
91
|
+
r({ type: Boolean, reflect: !0 })
|
92
|
+
], t.prototype, "checked", 2);
|
93
|
+
e([
|
94
|
+
r({ type: Boolean, attribute: "custom-invalid", reflect: !0 })
|
95
|
+
], t.prototype, "customInvalid", 2);
|
96
|
+
e([
|
97
|
+
r({ type: Boolean, reflect: !0 })
|
98
|
+
], t.prototype, "indeterminate", 2);
|
99
|
+
e([
|
100
|
+
r()
|
101
|
+
], t.prototype, "label", 2);
|
102
|
+
e([
|
103
|
+
r()
|
104
|
+
], t.prototype, "name", 2);
|
105
|
+
e([
|
106
|
+
r({ attribute: "required-label" })
|
107
|
+
], t.prototype, "requiredLabel", 2);
|
108
|
+
e([
|
109
|
+
r({ reflect: !0 })
|
110
|
+
], t.prototype, "severity", 2);
|
111
|
+
e([
|
112
|
+
r({ type: Boolean, attribute: "show-valid" })
|
113
|
+
], t.prototype, "showValid", 2);
|
114
|
+
e([
|
115
|
+
r({ reflect: !0 })
|
116
|
+
], t.prototype, "size", 2);
|
117
|
+
e([
|
118
|
+
r()
|
119
|
+
], t.prototype, "value", 2);
|
120
|
+
e([
|
124
121
|
f()
|
125
|
-
],
|
126
|
-
|
127
|
-
|
128
|
-
],
|
122
|
+
], t.prototype, "_invalid", 2);
|
123
|
+
e([
|
124
|
+
_("input")
|
125
|
+
], t.prototype, "$input", 2);
|
126
|
+
e([
|
127
|
+
h("_invalid")
|
128
|
+
], t.prototype, "handleInvalidChange", 1);
|
129
|
+
e([
|
130
|
+
h("_invalid", { afterUpdate: !0 })
|
131
|
+
], t.prototype, "handleDebugInvalid", 1);
|
132
|
+
e([
|
133
|
+
h("customInvalid")
|
134
|
+
], t.prototype, "handleCustomInvalidChange", 1);
|
129
135
|
export {
|
130
|
-
|
136
|
+
t as SkfCheckbox
|
131
137
|
};
|
@@ -8,12 +8,17 @@ const i = [
|
|
8
8
|
contain: initial;
|
9
9
|
}
|
10
10
|
|
11
|
-
#
|
11
|
+
#root {
|
12
12
|
align-items: center;
|
13
|
+
color: var(--_skf-checkbox-color, var(--skf-text-color-primary));
|
13
14
|
display: grid;
|
14
15
|
grid-gap: var(--skf-spacing-50);
|
15
16
|
grid-template: 'input label' / auto minmax(0, 1fr);
|
16
17
|
|
18
|
+
:host([disabled]) & {
|
19
|
+
--_skf-checkbox-color: var(--skf-interactive-text-color-disabled);
|
20
|
+
}
|
21
|
+
|
17
22
|
:host([size='sm']) & {
|
18
23
|
--_skf-checkbox-size: var(--skf-size-20);
|
19
24
|
|
@@ -57,7 +62,7 @@ const i = [
|
|
57
62
|
}
|
58
63
|
|
59
64
|
:host([valid]) & {
|
60
|
-
--_skf-checkbox-border-color: var(--skf-severity-fg-color-
|
65
|
+
--_skf-checkbox-border-color: var(--skf-severity-fg-color-success);
|
61
66
|
}
|
62
67
|
|
63
68
|
:host([severity='alert']:not([invalid], [valid])) & {
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -5,7 +5,7 @@ import type { CSSResultGroup } from 'lit';
|
|
5
5
|
/**
|
6
6
|
* The `<skf-collapse>` component is a general purpose container for content that can be collapsed / expanded.
|
7
7
|
*
|
8
|
-
* See [
|
8
|
+
* See [zeroheight](https://zeroheight.com/853e936c9/p/6590bf-accordion) for design principles.
|
9
9
|
*
|
10
10
|
* @event {CustomEvent} skf-collapse-toggle - Event emitted when toggled
|
11
11
|
*
|
@@ -16,17 +16,20 @@ import type { CSSResultGroup } from 'lit';
|
|
16
16
|
export declare class SkfCollapse extends SkfElement {
|
17
17
|
static styles: CSSResultGroup;
|
18
18
|
/** If true, will animate the expand/collapse state */
|
19
|
-
animated
|
19
|
+
animated?: boolean;
|
20
20
|
/** If true, will set the collapse to be expanded by default */
|
21
|
-
expanded
|
21
|
+
expanded?: boolean;
|
22
22
|
/** Heading for the collapse */
|
23
23
|
heading?: string;
|
24
|
-
/**
|
24
|
+
/**
|
25
|
+
* Defines which heading element will be rendered
|
26
|
+
* @type { "h1" | "h2" | "h3" | "h4" }
|
27
|
+
*/
|
25
28
|
headingAs: Exclude<HeadingType, 'h1'>;
|
26
29
|
/** If true, renders the small version */
|
27
|
-
small
|
30
|
+
small?: boolean;
|
28
31
|
/** If true, will truncate the heading in collapsed state */
|
29
|
-
truncate
|
32
|
+
truncate?: boolean;
|
30
33
|
/** Class method as alternative to manipulate attribute */
|
31
34
|
setClose(): void;
|
32
35
|
/** Class method as alternative to manipulate attribute */
|
@@ -1,17 +1,18 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
2
|
import { SkfElement as h } from "../../internal/components/skf-element.js";
|
3
3
|
import m from "../../styles/component.styles.js";
|
4
|
-
import { property as
|
5
|
-
import {
|
6
|
-
import u from "
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
import { property as i } from "lit/decorators.js";
|
5
|
+
import { ifDefined as c } from "lit/directives/if-defined.js";
|
6
|
+
import { html as u, unsafeStatic as l } from "lit/static-html.js";
|
7
|
+
import f from "./collapse.styles.js";
|
8
|
+
var y = Object.defineProperty, o = (a, s, d, g) => {
|
9
|
+
for (var t = void 0, r = a.length - 1, p; r >= 0; r--)
|
10
|
+
(p = a[r]) && (t = p(s, d, t) || t);
|
11
|
+
return t && y(s, d, t), t;
|
11
12
|
};
|
12
13
|
const n = class n extends h {
|
13
14
|
constructor() {
|
14
|
-
super(...arguments), this.
|
15
|
+
super(...arguments), this.headingAs = "h2", this._toggle = () => {
|
15
16
|
this.dispatchEvent(
|
16
17
|
new CustomEvent("skf-collapse-toggle", {
|
17
18
|
bubbles: !0,
|
@@ -30,45 +31,47 @@ const n = class n extends h {
|
|
30
31
|
this.expanded = !0;
|
31
32
|
}
|
32
33
|
render() {
|
33
|
-
return
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
<div id="
|
47
|
-
<
|
34
|
+
return u`
|
35
|
+
<div id="root">
|
36
|
+
<${l(this.headingAs)} id="heading">
|
37
|
+
<button
|
38
|
+
@click=${this._toggle}
|
39
|
+
aria-controls="main"
|
40
|
+
aria-expanded=${c(this.expanded ? "true" : "false")}
|
41
|
+
type="button"
|
42
|
+
>
|
43
|
+
<span id="label">${this.heading}</span>
|
44
|
+
<skf-icon name=${this.expanded ? "caretUp" : "caretDown"}></skf-icon>
|
45
|
+
</button>
|
46
|
+
</${l(this.headingAs)}>
|
47
|
+
<div id="body">
|
48
|
+
<div id="main" data-testid="main">
|
49
|
+
<slot></slot>
|
50
|
+
</div>
|
48
51
|
</div>
|
49
52
|
</div>
|
50
53
|
`;
|
51
54
|
}
|
52
55
|
};
|
53
|
-
n.styles = [m,
|
56
|
+
n.styles = [m, f];
|
54
57
|
let e = n;
|
55
|
-
|
56
|
-
|
58
|
+
o([
|
59
|
+
i({ type: Boolean, reflect: !0 })
|
57
60
|
], e.prototype, "animated");
|
58
|
-
|
59
|
-
|
61
|
+
o([
|
62
|
+
i({ type: Boolean, reflect: !0 })
|
60
63
|
], e.prototype, "expanded");
|
61
|
-
|
62
|
-
|
64
|
+
o([
|
65
|
+
i()
|
63
66
|
], e.prototype, "heading");
|
64
|
-
|
65
|
-
|
67
|
+
o([
|
68
|
+
i({ attribute: "heading-as" })
|
66
69
|
], e.prototype, "headingAs");
|
67
|
-
|
68
|
-
|
70
|
+
o([
|
71
|
+
i({ type: Boolean, reflect: !0 })
|
69
72
|
], e.prototype, "small");
|
70
|
-
|
71
|
-
|
73
|
+
o([
|
74
|
+
i({ type: Boolean, reflect: !0 })
|
72
75
|
], e.prototype, "truncate");
|
73
76
|
export {
|
74
77
|
e as SkfCollapse
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { css as
|
2
|
-
const s =
|
1
|
+
import { css as o } from "lit";
|
2
|
+
const s = o`
|
3
3
|
@layer components {
|
4
|
-
|
4
|
+
#root {
|
5
5
|
background: var(--skf-bg-color-neutral-1);
|
6
6
|
border-bottom: var(--skf-border-width-sm) solid var(--skf-border-color-tertiary);
|
7
7
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -2,7 +2,9 @@ import { SkfElement } from '@internal/components/skf-element.js';
|
|
2
2
|
import type { BorderColor } from '@skf-design-system/ui-assets';
|
3
3
|
import { type CSSResultGroup } from 'lit';
|
4
4
|
/**
|
5
|
-
* The `<Divider>` component can separate items from each other, to visually emphasize their lack of a relationship between groups of information
|
5
|
+
* The `<Divider>` component can separate items from each other, to visually emphasize their lack of a relationship between groups of information
|
6
|
+
*
|
7
|
+
* @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/3831f1-divider) for design principles
|
6
8
|
*
|
7
9
|
* @cssproperty --skf-divider-spacing - The amount of space the divider occupies. Pass valid CSS **margin-block** values when horizontal and **margin-inline** when vertical
|
8
10
|
* @cssproperty --skf-divider-inset - The amount of space the divider should be indented. Pass valid CSS **margin-inline** values when horizontal and **margin-block** when vertical
|
@@ -10,17 +12,18 @@ import { type CSSResultGroup } from 'lit';
|
|
10
12
|
* @tagname skf-divider
|
11
13
|
*/
|
12
14
|
export declare class SkfDivider extends SkfElement {
|
15
|
+
#private;
|
13
16
|
static styles: CSSResultGroup;
|
14
|
-
/**
|
15
|
-
|
16
|
-
|
17
|
+
/**
|
18
|
+
* Defines the Divider color
|
19
|
+
* @type { "emphasised" | "primary" | "secondary" | "tertiary" | "inverse" }
|
20
|
+
*/
|
21
|
+
color: BorderColor;
|
17
22
|
/** If true, renders a div for presentational purpose instead of the semantic hr-element */
|
18
|
-
decorative?: boolean
|
23
|
+
decorative?: boolean;
|
19
24
|
/** If true, renders the divider vertically */
|
20
|
-
vertical?: boolean
|
21
|
-
|
22
|
-
|
23
|
-
/** @internal */
|
24
|
-
private renderDefault;
|
25
|
+
vertical?: boolean;
|
26
|
+
constructor();
|
27
|
+
connectedCallback(): void;
|
25
28
|
render(): import("lit").TemplateResult<1>;
|
26
29
|
}
|