@skf-design-system/ui-components 1.0.2-beta.1 → 1.0.2-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/dist/components/accordion/accordion-item.component.js +49 -38
- package/dist/components/accordion/accordion.component.d.ts +2 -2
- package/dist/components/accordion/accordion.component.js +12 -12
- package/dist/components/alert/alert.component.d.ts +8 -3
- package/dist/components/alert/alert.component.js +59 -50
- package/dist/components/alert/alert.styles.js +51 -47
- package/dist/components/breadcrumb/breadcrumb-item.component.js +30 -32
- package/dist/components/breadcrumb/breadcrumb-item.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb-item.styles.js +16 -15
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +5 -2
- package/dist/components/breadcrumb/breadcrumb.component.js +51 -46
- package/dist/components/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb.styles.js +13 -10
- package/dist/components/button/button.component.js +63 -67
- package/dist/components/button/button.styles.js +5 -4
- package/dist/components/card/card.component.d.ts +5 -0
- package/dist/components/card/card.component.js +46 -24
- package/dist/components/card/card.styles.js +31 -14
- package/dist/components/checkbox/checkbox.component.d.ts +6 -5
- package/dist/components/checkbox/checkbox.component.js +67 -69
- package/dist/components/checkbox/checkbox.styles.js +1 -1
- package/dist/components/{date-picker/datepicker.calendar.component.d.ts → datepicker/datepicker-calendar.component.d.ts} +8 -1
- package/dist/components/{date-picker/datepicker.calendar.component.js → datepicker/datepicker-calendar.component.js} +109 -115
- package/dist/components/datepicker/datepicker-calendar.d.ts +8 -0
- package/dist/components/datepicker/datepicker-calendar.js +6 -0
- package/dist/components/{date-picker/datepicker.component.d.ts → datepicker/datepicker-popup.component.d.ts} +9 -20
- package/dist/components/datepicker/datepicker-popup.component.js +272 -0
- package/dist/components/datepicker/datepicker-popup.d.ts +8 -0
- package/dist/components/{date-picker/datepicker.helpers.d.ts → datepicker/datepicker-popup.helpers.d.ts} +3 -3
- package/dist/components/datepicker/datepicker-popup.helpers.js +83 -0
- package/dist/components/datepicker/datepicker-popup.js +6 -0
- package/dist/components/{date-picker/datepicker.styles.js → datepicker/datepicker-popup.styles.js} +3 -3
- package/dist/components/{date-picker-input/datepicker-input.component.d.ts → datepicker/datepicker.component.d.ts} +21 -14
- package/dist/components/datepicker/datepicker.component.js +455 -0
- package/dist/components/datepicker/datepicker.d.ts +8 -0
- package/dist/components/datepicker/datepicker.js +6 -0
- package/dist/components/dialog/dialog.component.d.ts +3 -2
- package/dist/components/dialog/dialog.component.js +49 -49
- package/dist/components/dialog/dialog.d.ts +2 -2
- 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 +9 -9
- package/dist/components/drawer/drawer.component.d.ts +12 -4
- package/dist/components/drawer/drawer.component.js +84 -61
- package/dist/components/drawer/drawer.d.ts +2 -2
- package/dist/components/drawer/drawer.styles.js +47 -40
- package/dist/components/header/header.component.d.ts +4 -2
- package/dist/components/header/header.component.js +64 -57
- package/dist/components/header/header.d.ts +2 -2
- package/dist/components/header/header.styles.js +2 -2
- package/dist/components/heading/heading.component.d.ts +5 -1
- package/dist/components/heading/heading.component.js +54 -27
- package/dist/components/heading/heading.styles.js +34 -36
- package/dist/components/icon/icon.component.d.ts +4 -0
- package/dist/components/icon/icon.component.js +62 -43
- package/dist/components/icon/icon.styles.js +60 -60
- package/dist/components/input/input.component.d.ts +4 -8
- package/dist/components/input/input.component.js +90 -97
- package/dist/components/input/input.controllers.d.ts +0 -1
- package/dist/components/input/input.controllers.js +14 -19
- package/dist/components/link/link.component.d.ts +15 -18
- package/dist/components/link/link.component.js +104 -107
- package/dist/components/link/link.styles.js +53 -45
- package/dist/components/loader/loader.component.d.ts +5 -3
- package/dist/components/loader/loader.component.js +39 -28
- package/dist/components/loader/loader.styles.js +6 -10
- package/dist/components/logo/logo.component.d.ts +4 -1
- package/dist/components/logo/logo.component.js +55 -51
- package/dist/components/logo/logo.styles.js +26 -16
- 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.d.ts +2 -2
- package/dist/components/menu/menu-item.styles.js +13 -9
- package/dist/components/menu/menu.component.d.ts +5 -2
- package/dist/components/menu/menu.component.js +8 -8
- package/dist/components/menu/menu.d.ts +2 -2
- package/dist/components/nav/nav-item.component.d.ts +6 -2
- 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 +9 -0
- package/dist/components/nav/nav.component.js +47 -21
- package/dist/components/nav/nav.d.ts +2 -2
- package/dist/components/nav/nav.styles.js +15 -9
- package/dist/components/popover/popover.component.d.ts +10 -3
- package/dist/components/popover/popover.component.js +30 -22
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/progress/progress.component.d.ts +2 -0
- package/dist/components/progress/progress.component.js +38 -29
- package/dist/components/progress/progress.d.ts +2 -2
- package/dist/components/progress/progress.styles.js +10 -8
- package/dist/components/radio/radio.component.d.ts +4 -2
- package/dist/components/radio/radio.component.js +96 -91
- package/dist/components/radio/radio.styles.js +1 -1
- package/dist/components/segmented-button/segmented-button-item.component.js +1 -1
- package/dist/components/segmented-button/segmented-button-item.d.ts +2 -2
- package/dist/components/segmented-button/segmented-button-item.styles.js +1 -1
- package/dist/components/segmented-button/segmented-button.component.js +22 -24
- package/dist/components/segmented-button/segmented-button.d.ts +2 -2
- 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.d.ts +2 -2
- package/dist/components/select/select-option-group.style.js +12 -6
- package/dist/components/select/select-option.component.d.ts +9 -4
- package/dist/components/select/select-option.component.js +70 -58
- package/dist/components/select/select-option.styles.js +43 -31
- package/dist/components/select/select.component.d.ts +21 -12
- package/dist/components/select/select.component.js +125 -87
- package/dist/components/select/select.controllers.js +15 -20
- 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 +59 -56
- package/dist/components/stepper/stepper-item.d.ts +2 -2
- package/dist/components/stepper/stepper-item.styles.js +4 -4
- package/dist/components/stepper/stepper.component.js +2 -3
- package/dist/components/stepper/stepper.d.ts +2 -2
- package/dist/components/stepper/stepper.helpers.js +6 -7
- package/dist/components/switch/switch.component.d.ts +4 -2
- package/dist/components/switch/switch.component.js +64 -58
- package/dist/components/switch/switch.d.ts +2 -2
- package/dist/components/switch/switch.styles.js +1 -1
- package/dist/components/{tab-panel → tabs}/tab-panel.component.d.ts +1 -1
- package/dist/components/tabs/tab-panel.component.js +39 -0
- package/dist/components/{tab-panel → tabs}/tab-panel.d.ts +2 -2
- package/dist/components/{tab → tabs}/tab.component.d.ts +3 -3
- package/dist/components/{tab → tabs}/tab.component.js +17 -14
- package/dist/components/{tab → tabs}/tab.d.ts +2 -2
- package/dist/components/{tab → tabs}/tab.styles.js +2 -2
- package/dist/components/{tab-group/tab-group.component.d.ts → tabs/tabs.component.d.ts} +3 -4
- package/dist/components/{tab-group/tab-group.component.js → tabs/tabs.component.js} +35 -36
- package/dist/components/tabs/tabs.d.ts +8 -0
- package/dist/components/tabs/tabs.js +6 -0
- package/dist/components/{tab-group/tab-group.styles.js → tabs/tabs.styles.js} +16 -16
- package/dist/components/tag/tag.component.d.ts +10 -2
- package/dist/components/tag/tag.component.js +77 -65
- package/dist/components/tag/tag.d.ts +2 -2
- package/dist/components/tag/tag.styles.js +63 -50
- package/dist/components/textarea/textarea.component.d.ts +4 -2
- package/dist/components/textarea/textarea.component.js +102 -95
- 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 +19 -20
- package/dist/components/tooltip/tooltip.component.d.ts +9 -2
- package/dist/components/tooltip/tooltip.component.js +15 -11
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/custom-elements.json +1681 -1112
- package/dist/index.d.ts +8 -7
- package/dist/index.js +96 -93
- package/dist/internal/base-classes/popover/popover.base.d.ts +24 -5
- package/dist/internal/base-classes/popover/popover.base.js +41 -44
- package/dist/internal/base-classes/popover/popover.styles.js +4 -5
- package/dist/internal/components/formBase.d.ts +1 -0
- package/dist/internal/components/formBase.js +11 -19
- 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/components/skf-element.d.ts +1 -3
- package/dist/internal/components/skf-element.js +4 -9
- package/dist/internal/controllers/popover.controller.d.ts +2 -0
- package/dist/internal/controllers/popover.controller.js +11 -14
- package/dist/internal/helpers/stateMap.d.ts +14 -0
- package/dist/internal/helpers/stateMap.js +68 -0
- package/dist/internal/helpers/uuid.d.ts +8 -10
- package/dist/internal/helpers/uuid.js +4 -11
- package/dist/internal/helpers/watch.d.ts +1 -1
- package/dist/internal/helpers/watch.js +12 -12
- package/dist/internal/templates/asterisk.d.ts +1 -1
- package/dist/internal/templates/asterisk.js +4 -4
- package/dist/internal/types.d.ts +4 -0
- package/dist/styles/component.styles.js +37 -36
- package/dist/styles/global-alt.css +1 -0
- package/dist/styles/global.css +1 -1
- package/dist/translations/en.d.ts +3 -0
- package/dist/translations/en.js +27 -0
- package/dist/translations/es.d.ts +3 -0
- package/dist/translations/es.js +27 -0
- package/dist/translations/index.d.ts +4 -0
- package/dist/translations/pt.d.ts +3 -0
- package/dist/translations/pt.js +27 -0
- package/dist/translations/sv.d.ts +3 -0
- package/dist/translations/sv.js +27 -0
- package/dist/types/jsx/custom-element-jsx.d.ts +1988 -866
- package/dist/types/vue/index.d.ts +220 -169
- package/dist/utilities/localize.d.ts +28 -0
- package/dist/utilities/localize.js +13 -0
- package/dist/vscode.html-custom-data.json +265 -188
- package/dist/web-types.json +731 -548
- package/package.json +38 -51
- package/dist/components/accordion/accordion-item.test.d.ts +0 -1
- package/dist/components/accordion/accordion.test.d.ts +0 -1
- package/dist/components/checkbox/checkbox.test.d.ts +0 -1
- package/dist/components/date-picker/datepicker.component.js +0 -261
- package/dist/components/date-picker/datepicker.d.ts +0 -10
- package/dist/components/date-picker/datepicker.helpers.js +0 -76
- package/dist/components/date-picker/datepicker.js +0 -8
- package/dist/components/date-picker-input/datepicker-input.component.js +0 -442
- package/dist/components/date-picker-input/datepicker-input.d.ts +0 -8
- package/dist/components/date-picker-input/datepicker-input.js +0 -6
- package/dist/components/input/input.test.d.ts +0 -1
- package/dist/components/radio/radio.test.d.ts +0 -1
- package/dist/components/switch/switch.test.d.ts +0 -1
- package/dist/components/tab-group/tab-group.d.ts +0 -8
- package/dist/components/tab-group/tab-group.js +0 -6
- package/dist/components/tab-panel/tab-panel.component.js +0 -36
- package/dist/internal/playwright/index.d.ts +0 -1
- /package/dist/components/{date-picker/datepicker.calendar.styles.d.ts → datepicker/datepicker-calendar.styles.d.ts} +0 -0
- /package/dist/components/{date-picker/datepicker.calendar.styles.js → datepicker/datepicker-calendar.styles.js} +0 -0
- /package/dist/components/{date-picker/datepicker.styles.d.ts → datepicker/datepicker-popup.styles.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.helpers.d.ts → datepicker/datepicker.helpers.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.helpers.js → datepicker/datepicker.helpers.js} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.styles.d.ts → datepicker/datepicker.styles.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.styles.js → datepicker/datepicker.styles.js} +0 -0
- /package/dist/components/select/{select.stories.icons.d.ts → stories/select.stories.icons.d.ts} +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.js +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.styles.d.ts +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.styles.js +0 -0
- /package/dist/components/{tab → tabs}/tab.js +0 -0
- /package/dist/components/{tab → tabs}/tab.styles.d.ts +0 -0
- /package/dist/components/{tab-group/tab-group.styles.d.ts → tabs/tabs.styles.d.ts} +0 -0
@@ -1,14 +1,13 @@
|
|
1
|
-
class
|
1
|
+
class n {
|
2
2
|
constructor(t) {
|
3
|
-
this.handleActionBtnClick = (
|
4
|
-
var h, n;
|
3
|
+
this.handleActionBtnClick = (s, i) => {
|
5
4
|
const e = this._inputElement;
|
6
|
-
!e || !this.host || (
|
7
|
-
}, this.handleActionBtnLongPressStart = (
|
8
|
-
const
|
5
|
+
!e || !this.host || (i === "inc" ? e.stepUp() : e.stepDown(), this.host.value = this._inputElement?.value ?? "", this.host._internals?.setFormValue(this.host.value), this.host.validateInput && this.host.validateInput());
|
6
|
+
}, this.handleActionBtnLongPressStart = (s) => {
|
7
|
+
const i = s.target.getAttribute("aria-label") === "Increment" ? "inc" : "dec";
|
9
8
|
this._longPressId = setTimeout(() => {
|
10
9
|
this._repeaterId = setInterval(() => {
|
11
|
-
this.handleActionBtnClick(
|
10
|
+
this.handleActionBtnClick(s, i);
|
12
11
|
}, 50);
|
13
12
|
}, 400);
|
14
13
|
}, this.handleActionBtnLongPressEnd = () => {
|
@@ -16,26 +15,22 @@ class l {
|
|
16
15
|
}, (this.host = t).addController(this);
|
17
16
|
}
|
18
17
|
hostUpdated() {
|
19
|
-
|
20
|
-
this._inputElement = (t = this.host) == null ? void 0 : t.$input;
|
18
|
+
this._inputElement = this.host?.$input;
|
21
19
|
}
|
22
20
|
}
|
23
|
-
class
|
21
|
+
class l {
|
24
22
|
constructor(t) {
|
25
23
|
this._icon = "visibility", this._type = "password", this.handleFieldLoaded = () => {
|
26
|
-
|
27
|
-
!this._inputElement || !((i = this.host) != null && i._handleInput) || (this.host.value = this._inputElement.value, this.host._handleInput());
|
24
|
+
!this._inputElement || !this.host?._handleInput || (this.host.value = this._inputElement.value, this.host._handleInput());
|
28
25
|
}, this.toggleVisibility = () => {
|
29
|
-
|
30
|
-
|
31
|
-
}, (this.host = t).addController(this), this._buttonAriaLabel = this.host.buttonAriaLabelShow ?? "";
|
26
|
+
!this._inputElement || !this.host?._handleInput || (this.host._handleInput(), this._type === "text" ? (this._icon = "visibility", this._type = "password") : (this._icon = "visibilityOff", this._type = "text"), this.host.requestUpdate(), this._inputElement.value = this.host.value ?? "");
|
27
|
+
}, (this.host = t).addController(this);
|
32
28
|
}
|
33
29
|
hostUpdated() {
|
34
|
-
|
35
|
-
this._inputElement = (t = this.host) == null ? void 0 : t.$input;
|
30
|
+
this._inputElement = this.host?.$input;
|
36
31
|
}
|
37
32
|
}
|
38
33
|
export {
|
39
|
-
|
40
|
-
|
34
|
+
n as InputNumberController,
|
35
|
+
l as InputPasswordController
|
41
36
|
};
|
@@ -2,54 +2,51 @@ import '../icon/icon.js';
|
|
2
2
|
import { SkfElement } from '../../internal/components/skf-element.js';
|
3
3
|
import type { Icon } from '../../internal/types.js';
|
4
4
|
import { type CSSResultGroup } from 'lit';
|
5
|
-
type
|
5
|
+
type Color = 'primary' | 'inverse';
|
6
6
|
/**
|
7
|
-
* The `<skf-link>` can be used as either a regular link or a
|
7
|
+
* The `<skf-link>` can be used as either a regular link or a semantic button. The button variant is
|
8
|
+
* intended to be used for triggering javascript functions, not handling forms.
|
8
9
|
*
|
9
10
|
* @documentation See [zeroheight](https://zeroheight.com/****) for design principles
|
10
11
|
*
|
12
|
+
* @event {CustomEvent} skf-link-click - Fired when the link is clicked
|
13
|
+
*
|
11
14
|
* @slot - The links' main content
|
12
15
|
*
|
13
16
|
* @tagname skf-link
|
14
17
|
*/
|
15
18
|
export declare class SkfLink extends SkfElement {
|
19
|
+
#private;
|
16
20
|
static styles: CSSResultGroup;
|
17
|
-
static classMap: {};
|
18
|
-
/** @internal */
|
19
|
-
private _onClick?;
|
20
21
|
/** Defines the semantic element to render */
|
21
|
-
as: 'button' | '
|
22
|
+
as: 'button' | 'link';
|
22
23
|
/** Defines the text-color */
|
23
|
-
color:
|
24
|
+
color: Color;
|
24
25
|
/** If true, disables the link */
|
25
26
|
disabled: boolean;
|
26
27
|
/** If defined, downloads the url */
|
27
|
-
download
|
28
|
+
download: boolean;
|
28
29
|
/** If defined, loads url on click */
|
29
30
|
href?: string;
|
30
31
|
/** If defined, renders an icon before or after the text */
|
31
32
|
icon?: Icon;
|
32
|
-
/**
|
33
|
-
|
34
|
-
/** If defined, accepts a function that runs on click. Forwards optional route as second argument. */
|
35
|
-
set onClick(onClickFn: ((event: Event, route?: string) => void) | undefined);
|
36
|
-
get onClick(): ((event: Event, route?: string) => void) | undefined;
|
33
|
+
/** If true, the icon is placed to the right in relation to the text */
|
34
|
+
iconRight: boolean;
|
37
35
|
/** If defined, describes the relationship between a linked resource and the current document */
|
38
36
|
rel?: string;
|
39
|
-
/** If defined, used on conjunction with onClick property
|
37
|
+
/** If defined, used on conjunction with onClick property. **Notice!** Only applicable to as=button. */
|
40
38
|
route?: string;
|
41
39
|
/** If true, fills the parents horizontal axis */
|
42
40
|
stretch: boolean;
|
43
41
|
/** If defined, specifies where to open the linked document */
|
44
42
|
target?: '_blank' | '_parent' | '_self' | '_top';
|
45
|
-
/** Defines the type of button */
|
46
|
-
type: SkfLinkType;
|
47
43
|
connectedCallback(): void;
|
44
|
+
_handleAsChange(): void;
|
48
45
|
/** @internal */
|
49
|
-
|
46
|
+
_handleStateChange(property: string, _prev: unknown, next: unknown): void;
|
50
47
|
/** @internal */
|
51
48
|
/** retargets click event to host */
|
52
|
-
private
|
49
|
+
private _handleClick;
|
53
50
|
/** @internal */
|
54
51
|
private _renderIcon;
|
55
52
|
render(): import("lit").TemplateResult;
|
@@ -1,123 +1,120 @@
|
|
1
|
+
var b = (e) => {
|
2
|
+
throw TypeError(e);
|
3
|
+
};
|
4
|
+
var g = (e, i, t) => i.has(e) || b("Cannot " + t);
|
5
|
+
var d = (e, i, t) => (g(e, i, "read from private field"), t ? t.call(e) : i.get(e)), f = (e, i, t) => i.has(e) ? b("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), m = (e, i, t, s) => (g(e, i, "write to private field"), s ? s.call(e, t) : i.set(e, t), t);
|
1
6
|
import "../icon/icon.js";
|
2
|
-
import { SkfElement as
|
3
|
-
import {
|
4
|
-
import "
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
import { SkfElement as C } from "../../internal/components/skf-element.js";
|
8
|
+
import { stateMap as k } from "../../internal/helpers/stateMap.js";
|
9
|
+
import { watch as v } from "../../internal/helpers/watch.js";
|
10
|
+
import { componentStyles as S } from "../../styles/component.styles.js";
|
11
|
+
import { nothing as y } from "lit";
|
12
|
+
import { property as n } from "lit/decorators.js";
|
13
|
+
import { ifDefined as x } from "lit/directives/if-defined.js";
|
14
|
+
import { html as _ } from "lit/static-html.js";
|
15
|
+
import { styles as A } from "./link.styles.js";
|
16
|
+
var D = Object.defineProperty, E = Object.getOwnPropertyDescriptor, r = (e, i, t, s) => {
|
17
|
+
for (var h = s > 1 ? void 0 : s ? E(i, t) : i, p = e.length - 1, c; p >= 0; p--)
|
18
|
+
(c = e[p]) && (h = (s ? c(i, t, h) : c(h)) || h);
|
19
|
+
return s && h && D(i, t, h), h;
|
20
|
+
};
|
21
|
+
const w = {
|
22
|
+
color: ["inverse", "primary"],
|
23
|
+
stretch: "stretch"
|
24
|
+
};
|
25
|
+
var a, l;
|
26
|
+
const u = class u extends C {
|
16
27
|
constructor() {
|
17
|
-
super(...arguments)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
28
|
+
super(...arguments);
|
29
|
+
f(this, a);
|
30
|
+
f(this, l);
|
31
|
+
m(this, a, this.attachInternals()), m(this, l, d(this, a).states), this.as = "link", this.color = "primary", this.disabled = !1, this.download = !1, this.iconRight = !1, this.stretch = !1, this._handleClick = () => {
|
32
|
+
if (!(this.as === "button" && this.disabled) && (this.emit("skf-link-click", { detail: { href: this.href, route: this.route } }), this.as === "link" && !this.route && this.href?.trim()))
|
33
|
+
if (this.target)
|
34
|
+
window.open(this.href, this.target);
|
35
|
+
else if (this.download) {
|
36
|
+
const t = document.createElement("a");
|
37
|
+
t.href = this.href, t.download = this.href, document.body.appendChild(t), t.click(), document.body.removeChild(t);
|
38
|
+
} else
|
39
|
+
window.location.href = this.href;
|
26
40
|
};
|
27
|
-
this._assertValidOnClick(t), this.removeEventListener("click", i), this.addEventListener("click", i);
|
28
|
-
}
|
29
|
-
get onClick() {
|
30
|
-
return this._onClick;
|
31
41
|
}
|
32
42
|
connectedCallback() {
|
33
|
-
super.connectedCallback(), this.
|
34
|
-
|
35
|
-
|
43
|
+
super.connectedCallback(), this.ariaDisabled = this.as === "button" && this.disabled ? "true" : null, this.role = this.as;
|
44
|
+
const t = this.hasAttribute("tabindex") ? Number(this.getAttribute("tabindex")) : 0;
|
45
|
+
this.ariaDisabled !== "true" && (this.tabIndex = t), this.addEventListener("keydown", (s) => {
|
46
|
+
(s.key === "Enter" || s.key === " ") && this._handleClick();
|
47
|
+
}), this.addEventListener("click", this._handleClick);
|
36
48
|
}
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
);
|
49
|
+
_handleAsChange() {
|
50
|
+
this.as === "button" ? this.setAttribute("type", "button") : this.removeAttribute("type");
|
51
|
+
}
|
52
|
+
_handleStateChange(t, s, h) {
|
53
|
+
k(d(this, l), w[t]).set(h);
|
43
54
|
}
|
44
55
|
/** @internal */
|
45
56
|
_renderIcon() {
|
46
|
-
const t =
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
57
|
+
const t = this.color === "inverse" ? "inverse" : "emphasized";
|
58
|
+
return _`
|
59
|
+
<skf-icon
|
60
|
+
color=${t}
|
61
|
+
data-color=${this.disabled ? "custom" : y}
|
62
|
+
name=${x(this.icon)}
|
63
|
+
size="sm"
|
64
|
+
></skf-icon>
|
52
65
|
`;
|
53
66
|
}
|
54
67
|
render() {
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
link: !0,
|
62
|
-
"link--color-inverse": this.color === "inverse",
|
63
|
-
"link--color-primary": this.color === "primary",
|
64
|
-
"link--icon-right": this.iconPlacement === "right",
|
65
|
-
"link--stretch": this.stretch,
|
66
|
-
...s.classMap
|
67
|
-
})}
|
68
|
-
download=${l(t ? this.download : void 0)}
|
69
|
-
href=${l(t ? this.href : void 0)}
|
70
|
-
part="root"
|
71
|
-
rel=${l(t ? this.rel : void 0)}
|
72
|
-
target=${l(t ? this.target : void 0)}
|
73
|
-
type=${l(t ? void 0 : this.type)}
|
74
|
-
>
|
75
|
-
${this.icon && this._renderIcon()}
|
76
|
-
<slot>Default link text</slot>
|
77
|
-
</${i}>
|
68
|
+
return _`
|
69
|
+
<div id="root" part="root">
|
70
|
+
${this.icon && !this.iconRight ? this._renderIcon() : y}
|
71
|
+
<slot></slot>
|
72
|
+
${this.icon && this.iconRight ? this._renderIcon() : y}
|
73
|
+
</div>
|
78
74
|
`;
|
79
75
|
}
|
80
|
-
}
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
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
|
-
|
76
|
+
};
|
77
|
+
a = new WeakMap(), l = new WeakMap(), u.styles = [S, A];
|
78
|
+
let o = u;
|
79
|
+
r([
|
80
|
+
n({ type: String })
|
81
|
+
], o.prototype, "as", 2);
|
82
|
+
r([
|
83
|
+
n({ type: String })
|
84
|
+
], o.prototype, "color", 2);
|
85
|
+
r([
|
86
|
+
n({ type: Boolean })
|
87
|
+
], o.prototype, "disabled", 2);
|
88
|
+
r([
|
89
|
+
n({ type: Boolean })
|
90
|
+
], o.prototype, "download", 2);
|
91
|
+
r([
|
92
|
+
n({ type: String })
|
93
|
+
], o.prototype, "href", 2);
|
94
|
+
r([
|
95
|
+
n({ type: String })
|
96
|
+
], o.prototype, "icon", 2);
|
97
|
+
r([
|
98
|
+
n({ type: Boolean, attribute: "icon-right" })
|
99
|
+
], o.prototype, "iconRight", 2);
|
100
|
+
r([
|
101
|
+
n({ type: String })
|
102
|
+
], o.prototype, "rel", 2);
|
103
|
+
r([
|
104
|
+
n({ type: String })
|
105
|
+
], o.prototype, "route", 2);
|
106
|
+
r([
|
107
|
+
n({ type: Boolean })
|
108
|
+
], o.prototype, "stretch", 2);
|
109
|
+
r([
|
110
|
+
n({ type: String })
|
111
|
+
], o.prototype, "target", 2);
|
112
|
+
r([
|
113
|
+
v("as")
|
114
|
+
], o.prototype, "_handleAsChange", 1);
|
115
|
+
r([
|
116
|
+
v(Object.keys(w))
|
117
|
+
], o.prototype, "_handleStateChange", 1);
|
121
118
|
export {
|
122
|
-
|
119
|
+
o as SkfLink
|
123
120
|
};
|
@@ -1,61 +1,69 @@
|
|
1
|
-
import { css as
|
2
|
-
const e =
|
3
|
-
/* stylelint-disable selector-class-pattern */
|
1
|
+
import { css as o } from "lit";
|
2
|
+
const e = o`
|
4
3
|
@layer components {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
@layer base {
|
5
|
+
:host {
|
6
|
+
contain: layout;
|
7
|
+
cursor: pointer;
|
8
|
+
display: inline;
|
9
|
+
}
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
vertical-align: top;
|
11
|
+
#root {
|
12
|
+
--_skf-link-color: var(--skf-interactive-text-color-primary);
|
13
|
+
--_skf-link-color-active: var(--skf-interactive-text-color-primary-active);
|
14
|
+
--_skf-link-color-disabled: var(--skf-interactive-text-color-disabled);
|
15
|
+
--_skf-link-color-hover: var(--skf-interactive-text-color-primary-hover);
|
16
|
+
--_skf-link-outline-color: var(--skf-interactive-text-color-primary);
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
align-items: center;
|
19
|
+
color: var(--_skf-link-color);
|
20
|
+
display: inline-flex;
|
21
|
+
font-weight: var(--skf-font-weight-bold);
|
22
|
+
gap: 0 var(--skf-spacing-25);
|
23
|
+
vertical-align: top;
|
20
24
|
}
|
25
|
+
}
|
21
26
|
|
22
|
-
|
23
|
-
|
24
|
-
|
27
|
+
@layer states {
|
28
|
+
:host(:focus-visible) {
|
29
|
+
outline: unset;
|
25
30
|
|
26
|
-
|
27
|
-
|
31
|
+
#root {
|
32
|
+
border-radius: var(--skf-border-radius-sm);
|
33
|
+
outline: var(--skf-border-width-md) solid var(--_skf-link-outline-color);
|
34
|
+
outline-offset: var(--skf-size-2);
|
35
|
+
}
|
28
36
|
}
|
29
37
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
outline-offset: var(--skf-size-2);
|
34
|
-
}
|
35
|
-
}
|
38
|
+
:host([aria-disabled]) {
|
39
|
+
#root {
|
40
|
+
--_skf-link-color: var(--_skf-link-color-disabled);
|
36
41
|
|
37
|
-
|
38
|
-
|
39
|
-
--_skf-link-color-active: var(--skf-interactive-text-color-primary-active);
|
40
|
-
--_skf-link-color-disabled: var(--skf-interactive-text-color-disabled);
|
41
|
-
--_skf-link-color-hover: var(--skf-interactive-text-color-primary-hover);
|
42
|
-
--_skf-link-outline-color: var(--skf-interactive-text-color-primary);
|
43
|
-
}
|
42
|
+
cursor: not-allowed;
|
43
|
+
}
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
--_skf-link-color-hover: var(--skf-interactive-text-color-inverse-hover);
|
50
|
-
--_skf-link-outline-color: var(--skf-interactive-text-color-inverse);
|
51
|
-
}
|
45
|
+
skf-icon {
|
46
|
+
color: inherit;
|
47
|
+
}
|
48
|
+
}
|
52
49
|
|
53
|
-
|
54
|
-
|
50
|
+
:host(:not([aria-disabled]):hover) #root {
|
51
|
+
--_skf-link-color: var(--_skf-link-color-hover);
|
52
|
+
}
|
55
53
|
}
|
56
54
|
|
57
|
-
|
58
|
-
|
55
|
+
@layer mods {
|
56
|
+
:host(:state(inverse)) #root {
|
57
|
+
--_skf-link-color: var(--skf-interactive-text-color-inverse);
|
58
|
+
--_skf-link-color-active: var(--skf-interactive-text-color-inverse-active);
|
59
|
+
--_skf-link-color-disabled: var(--skf-interactive-text-color-disabled);
|
60
|
+
--_skf-link-color-hover: var(--skf-interactive-text-color-inverse-hover);
|
61
|
+
--_skf-link-outline-color: var(--skf-interactive-text-color-inverse);
|
62
|
+
}
|
63
|
+
|
64
|
+
:host(:state(stretch)) #root {
|
65
|
+
inline-size: 100%;
|
66
|
+
}
|
59
67
|
}
|
60
68
|
}
|
61
69
|
`;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { SkfElement } from '../../internal/components/skf-element.js';
|
2
2
|
import { type CSSResultGroup } from 'lit';
|
3
|
+
type Size = 'md' | 'sm';
|
3
4
|
/**
|
4
5
|
* The `<skf-loader>` component is a progress indicator that uses circular indicators for short, indeterminate activities
|
5
6
|
*
|
@@ -10,12 +11,13 @@ import { type CSSResultGroup } from 'lit';
|
|
10
11
|
export declare class SkfLoader extends SkfElement {
|
11
12
|
#private;
|
12
13
|
static styles: CSSResultGroup;
|
13
|
-
/** Defines the aria-label */
|
14
|
-
ariaLabel: string;
|
15
14
|
/** If true, inverts the color (to be used on colored backgrounds) */
|
16
15
|
invert: boolean;
|
17
16
|
/** Defines the size of the loader */
|
18
|
-
size
|
17
|
+
size: Size;
|
19
18
|
connectedCallback(): void;
|
19
|
+
/** @internal */
|
20
|
+
_handleStateChange(property: string, _prev: unknown, next: unknown): void;
|
20
21
|
render(): import("lit").TemplateResult<1>;
|
21
22
|
}
|
23
|
+
export {};
|
@@ -1,29 +1,40 @@
|
|
1
|
-
var
|
1
|
+
var f = (t) => {
|
2
2
|
throw TypeError(t);
|
3
3
|
};
|
4
|
-
var
|
5
|
-
var
|
4
|
+
var y = (t, e, r) => e.has(t) || f("Cannot " + r);
|
5
|
+
var c = (t, e, r) => (y(t, e, "read from private field"), r ? r.call(t) : e.get(t)), m = (t, e, r) => e.has(t) ? f("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), v = (t, e, r, i) => (y(t, e, "write to private field"), i ? i.call(t, r) : e.set(t, r), r);
|
6
6
|
import { SkfElement as b } from "../../internal/components/skf-element.js";
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
import { stateMap as g } from "../../internal/helpers/stateMap.js";
|
8
|
+
import { watch as C } from "../../internal/helpers/watch.js";
|
9
|
+
import { componentStyles as O } from "../../styles/component.styles.js";
|
10
|
+
import { html as P } from "lit";
|
11
|
+
import { property as _ } from "lit/decorators.js";
|
12
|
+
import { styles as j } from "./loader.styles.js";
|
13
|
+
var w = Object.defineProperty, z = Object.getOwnPropertyDescriptor, h = (t, e, r, i) => {
|
14
|
+
for (var s = i > 1 ? void 0 : i ? z(e, r) : e, n = t.length - 1, l; n >= 0; n--)
|
15
|
+
(l = t[n]) && (s = (i ? l(e, r, s) : l(s)) || s);
|
16
|
+
return i && s && w(e, r, s), s;
|
17
|
+
};
|
18
|
+
const u = {
|
19
|
+
invert: "invert",
|
20
|
+
size: ["md", "sm"]
|
21
|
+
};
|
22
|
+
var a, p;
|
16
23
|
const d = class d extends b {
|
17
24
|
constructor() {
|
18
25
|
super(...arguments);
|
19
|
-
|
20
|
-
|
26
|
+
m(this, a);
|
27
|
+
m(this, p);
|
28
|
+
v(this, a, this.attachInternals()), v(this, p, c(this, a).states), this.invert = !1, this.size = "md";
|
21
29
|
}
|
22
30
|
connectedCallback() {
|
23
|
-
super.connectedCallback(),
|
31
|
+
super.connectedCallback(), this.role = "progressbar", this.ariaLive = "polite";
|
32
|
+
}
|
33
|
+
_handleStateChange(r, i, s) {
|
34
|
+
g(c(this, p), u[r]).set(s);
|
24
35
|
}
|
25
36
|
render() {
|
26
|
-
return
|
37
|
+
return P`
|
27
38
|
<div id="root">
|
28
39
|
<div class="circle"></div>
|
29
40
|
<div class="circle"></div>
|
@@ -32,17 +43,17 @@ const d = class d extends b {
|
|
32
43
|
`;
|
33
44
|
}
|
34
45
|
};
|
35
|
-
|
36
|
-
let
|
37
|
-
|
38
|
-
|
39
|
-
],
|
40
|
-
|
41
|
-
|
42
|
-
],
|
43
|
-
|
44
|
-
|
45
|
-
],
|
46
|
+
a = new WeakMap(), p = new WeakMap(), d.styles = [O, j];
|
47
|
+
let o = d;
|
48
|
+
h([
|
49
|
+
_({ type: Boolean })
|
50
|
+
], o.prototype, "invert", 2);
|
51
|
+
h([
|
52
|
+
_({ type: String })
|
53
|
+
], o.prototype, "size", 2);
|
54
|
+
h([
|
55
|
+
C(Object.keys(u))
|
56
|
+
], o.prototype, "_handleStateChange", 1);
|
46
57
|
export {
|
47
|
-
|
58
|
+
o as SkfLoader
|
48
59
|
};
|
@@ -7,7 +7,7 @@ const o = a`
|
|
7
7
|
}
|
8
8
|
|
9
9
|
#root {
|
10
|
-
--_skf-loader-color: var(--skf-bg-color-
|
10
|
+
--_skf-loader-color: var(--skf-bg-color-emphasized);
|
11
11
|
--_skf-loader-gap: var(--skf-spacing-50);
|
12
12
|
--_skf-loader-size: var(--skf-size-12);
|
13
13
|
|
@@ -33,17 +33,13 @@ const o = a`
|
|
33
33
|
}
|
34
34
|
|
35
35
|
@layer mods {
|
36
|
-
:host(
|
37
|
-
|
38
|
-
--_skf-loader-color: var(--skf-bg-color-neutral-1);
|
39
|
-
}
|
36
|
+
:host(:state(invert)) #root {
|
37
|
+
--_skf-loader-color: var(--skf-bg-color-neutral-1);
|
40
38
|
}
|
41
39
|
|
42
|
-
:host(
|
43
|
-
|
44
|
-
|
45
|
-
--_skf-loader-size: var(--skf-size-4);
|
46
|
-
}
|
40
|
+
:host(:state(sm)) #root {
|
41
|
+
--_skf-loader-gap: var(--skf-spacing-25);
|
42
|
+
--_skf-loader-size: var(--skf-size-4);
|
47
43
|
}
|
48
44
|
}
|
49
45
|
}
|
@@ -5,16 +5,19 @@ type SkfLogoColor = Logo;
|
|
5
5
|
/**
|
6
6
|
* The `<skf-logo>` component is used to display the SKF logo.
|
7
7
|
*
|
8
|
-
* @cssproperty --
|
8
|
+
* @cssproperty --mod-logo-height - The height of the logo
|
9
9
|
*
|
10
10
|
* @tagname skf-logo
|
11
11
|
*/
|
12
12
|
export declare class SkfLogo extends SkfElement {
|
13
|
+
#private;
|
13
14
|
static styles: CSSResultGroup;
|
14
15
|
/** Defines the title of the logo */
|
15
16
|
title: string;
|
16
17
|
/** Defines the color of the logo */
|
17
18
|
color: SkfLogoColor;
|
19
|
+
/** @internal */
|
20
|
+
_handleStateChange(): void;
|
18
21
|
render(): import("lit").TemplateResult<1>;
|
19
22
|
}
|
20
23
|
export {};
|