@skf-design-system/ui-components 1.0.1-beta.1 → 1.0.2-beta.0
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 +1 -18
- package/dist/components/accordion/accordion.component.d.ts +4 -4
- package/dist/components/accordion/accordion.component.js +8 -8
- package/dist/components/alert/alert.component.d.ts +8 -9
- package/dist/components/alert/alert.component.js +7 -7
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +1 -1
- package/dist/components/card/card.component.js +18 -30
- package/dist/components/card/card.styles.js +25 -28
- package/dist/components/checkbox/checkbox.component.d.ts +8 -8
- package/dist/components/checkbox/checkbox.component.js +3 -3
- package/dist/components/collapse/collapse.component.js +1 -1
- package/dist/components/date-picker/datepicker.calendar.component.d.ts +5 -0
- package/dist/components/date-picker/datepicker.calendar.component.js +128 -95
- package/dist/components/date-picker/datepicker.calendar.styles.js +35 -25
- package/dist/components/date-picker/datepicker.component.d.ts +5 -0
- package/dist/components/date-picker/datepicker.component.js +117 -97
- package/dist/components/date-picker/datepicker.helpers.d.ts +3 -2
- package/dist/components/date-picker/datepicker.helpers.js +46 -39
- package/dist/components/date-picker/datepicker.styles.js +14 -26
- package/dist/components/date-picker-input/datepicker-input.component.d.ts +13 -5
- package/dist/components/date-picker-input/datepicker-input.component.js +263 -219
- package/dist/components/date-picker-input/datepicker-input.helpers.d.ts +36 -2
- package/dist/components/date-picker-input/datepicker-input.helpers.js +25 -23
- package/dist/components/date-picker-input/datepicker-input.styles.js +6 -10
- package/dist/components/dialog/dialog.component.d.ts +18 -28
- package/dist/components/dialog/dialog.component.js +89 -79
- package/dist/components/divider/divider.component.d.ts +4 -8
- package/dist/components/divider/divider.component.js +24 -46
- package/dist/components/divider/divider.styles.js +34 -30
- package/dist/components/drawer/drawer.component.d.ts +57 -0
- package/dist/components/drawer/drawer.component.js +124 -0
- package/dist/components/drawer/drawer.d.ts +8 -0
- package/dist/components/drawer/drawer.js +6 -0
- package/dist/components/drawer/drawer.styles.d.ts +1 -0
- package/dist/components/drawer/drawer.styles.js +71 -0
- package/dist/components/header/header.component.d.ts +45 -0
- package/dist/components/header/header.component.js +110 -0
- package/dist/components/header/header.d.ts +8 -0
- package/dist/components/header/header.js +6 -0
- package/dist/components/header/header.styles.d.ts +1 -0
- package/dist/components/header/header.styles.js +68 -0
- package/dist/components/heading/heading.component.d.ts +6 -12
- package/dist/components/heading/heading.component.js +11 -11
- package/dist/components/heading/heading.styles.d.ts +1 -2
- package/dist/components/heading/heading.styles.js +1 -1
- package/dist/components/icon/icon.component.d.ts +1 -1
- package/dist/components/input/input.component.d.ts +2 -2
- package/dist/components/input/input.component.js +3 -3
- package/dist/components/input/input.controllers.d.ts +20 -6
- package/dist/components/input/input.controllers.js +14 -10
- package/dist/components/link/link.component.js +1 -0
- package/dist/components/link/link.styles.js +24 -20
- package/dist/components/menu/menu.component.d.ts +4 -5
- package/dist/components/menu/menu.component.js +1 -1
- package/dist/components/nav/nav.component.d.ts +17 -0
- package/dist/components/nav/nav.component.js +34 -0
- package/dist/components/nav/nav.d.ts +8 -0
- package/dist/components/nav/nav.js +6 -0
- package/dist/components/nav/nav.styles.d.ts +1 -0
- package/dist/components/nav/nav.styles.js +17 -0
- package/dist/components/nav-item/nav-item.component.d.ts +20 -0
- package/dist/components/nav-item/nav-item.component.js +38 -0
- package/dist/components/nav-item/nav-item.d.ts +8 -0
- package/dist/components/nav-item/nav-item.js +6 -0
- package/dist/components/nav-item/nav-item.styles.d.ts +1 -0
- package/dist/components/nav-item/nav-item.styles.js +39 -0
- package/dist/components/popover/popover.component.d.ts +5 -6
- package/dist/components/popover/popover.component.js +19 -19
- package/dist/components/radio/radio.component.d.ts +10 -6
- package/dist/components/radio/radio.component.js +10 -10
- package/dist/components/radio/radio.styles.d.ts +1 -2
- package/dist/components/radio/radio.styles.js +1 -1
- package/dist/components/segmented-button/segmented-button.component.d.ts +32 -0
- package/dist/components/segmented-button/segmented-button.d.ts +8 -0
- package/dist/components/segmented-button/segmented-button.styles.d.ts +1 -0
- package/dist/components/segmented-button-item/segmented-button-item.component.d.ts +36 -0
- package/dist/components/segmented-button-item/segmented-button-item.d.ts +8 -0
- package/dist/components/segmented-button-item/segmented-button-item.styles.d.ts +1 -0
- package/dist/components/select/select.component.js +2 -2
- package/dist/components/select/select.controllers.d.ts +20 -9
- package/dist/components/select/select.controllers.js +27 -22
- package/dist/components/select-option/select-option.controllers.d.ts +11 -5
- package/dist/components/stepper/stepper.component.d.ts +2 -1
- package/dist/components/stepper-item/stepper-item.component.js +2 -2
- package/dist/components/switch/switch.component.d.ts +7 -6
- package/dist/components/switch/switch.component.js +7 -7
- package/dist/components/tag/tag.component.d.ts +4 -2
- package/dist/components/tag/tag.component.js +6 -6
- package/dist/components/textarea/textarea.component.js +7 -7
- package/dist/components/toast/toast.component.d.ts +1 -1
- package/dist/components/tooltip/tooltip.component.d.ts +5 -6
- package/dist/components/tooltip/tooltip.component.js +11 -11
- package/dist/custom-elements.json +2477 -1745
- package/dist/index.d.ts +4 -0
- package/dist/index.js +82 -70
- package/dist/internal/base-classes/popover/popover.base.d.ts +17 -7
- package/dist/internal/base-classes/popover/popover.base.js +119 -75
- package/dist/internal/base-classes/popover/popover.styles.js +14 -1
- package/dist/internal/controllers/elementOverflowController.d.ts +13 -0
- package/dist/internal/controllers/popover.controller.d.ts +12 -7
- package/dist/internal/controllers/popover.controller.js +9 -14
- package/dist/internal/helpers/utilityTypes.d.ts +1 -1
- package/dist/internal/helpers/uuid.d.ts +15 -0
- package/dist/internal/helpers/uuid.js +14 -0
- package/dist/internal/storybook/styles.d.ts +1 -0
- package/dist/styles/form-field.styles.js +11 -6
- package/dist/styles/global.css +1 -1
- package/dist/types/jsx/custom-element-jsx.d.ts +642 -1261
- package/dist/types/vue/index.d.ts +422 -267
- package/dist/vscode.html-custom-data.json +805 -525
- package/dist/web-types.json +928 -653
- package/package.json +41 -51
- package/dist/react/index.d.ts +0 -36
- package/dist/react/index.js +0 -36
- package/dist/react/skf-accordion/index.d.ts +0 -3
- package/dist/react/skf-accordion/index.js +0 -13
- package/dist/react/skf-alert/index.d.ts +0 -9
- package/dist/react/skf-alert/index.js +0 -17
- package/dist/react/skf-breadcrumb/index.d.ts +0 -9
- package/dist/react/skf-breadcrumb/index.js +0 -17
- package/dist/react/skf-breadcrumb-item/index.d.ts +0 -3
- package/dist/react/skf-breadcrumb-item/index.js +0 -13
- package/dist/react/skf-button/index.d.ts +0 -9
- package/dist/react/skf-button/index.js +0 -17
- package/dist/react/skf-card/index.d.ts +0 -3
- package/dist/react/skf-card/index.js +0 -13
- package/dist/react/skf-checkbox/index.d.ts +0 -9
- package/dist/react/skf-checkbox/index.js +0 -17
- package/dist/react/skf-collapse/index.d.ts +0 -9
- package/dist/react/skf-collapse/index.js +0 -17
- package/dist/react/skf-datepicker/index.d.ts +0 -12
- package/dist/react/skf-datepicker/index.js +0 -18
- package/dist/react/skf-dialog/index.d.ts +0 -15
- package/dist/react/skf-dialog/index.js +0 -19
- package/dist/react/skf-divider/index.d.ts +0 -3
- package/dist/react/skf-divider/index.js +0 -13
- package/dist/react/skf-heading/index.d.ts +0 -3
- package/dist/react/skf-heading/index.js +0 -13
- package/dist/react/skf-icon/index.d.ts +0 -3
- package/dist/react/skf-icon/index.js +0 -13
- package/dist/react/skf-input/index.d.ts +0 -12
- package/dist/react/skf-input/index.js +0 -18
- package/dist/react/skf-link/index.d.ts +0 -3
- package/dist/react/skf-link/index.js +0 -13
- package/dist/react/skf-loader/index.d.ts +0 -3
- package/dist/react/skf-loader/index.js +0 -13
- package/dist/react/skf-logo/index.d.ts +0 -3
- package/dist/react/skf-logo/index.js +0 -13
- package/dist/react/skf-menu/index.d.ts +0 -12
- package/dist/react/skf-menu/index.js +0 -18
- package/dist/react/skf-menu-item/index.d.ts +0 -27
- package/dist/react/skf-menu-item/index.js +0 -23
- package/dist/react/skf-popover/index.d.ts +0 -12
- package/dist/react/skf-popover/index.js +0 -18
- package/dist/react/skf-progress/index.d.ts +0 -3
- package/dist/react/skf-progress/index.js +0 -13
- package/dist/react/skf-radio/index.d.ts +0 -9
- package/dist/react/skf-radio/index.js +0 -17
- package/dist/react/skf-select/index.d.ts +0 -21
- package/dist/react/skf-select/index.js +0 -21
- package/dist/react/skf-select-option/index.d.ts +0 -9
- package/dist/react/skf-select-option/index.js +0 -17
- package/dist/react/skf-select-option-group/index.d.ts +0 -3
- package/dist/react/skf-select-option-group/index.js +0 -13
- package/dist/react/skf-stepper/index.d.ts +0 -9
- package/dist/react/skf-stepper/index.js +0 -17
- package/dist/react/skf-stepper-item/index.d.ts +0 -9
- package/dist/react/skf-stepper-item/index.js +0 -17
- package/dist/react/skf-switch/index.d.ts +0 -3
- package/dist/react/skf-switch/index.js +0 -13
- package/dist/react/skf-tab/index.d.ts +0 -12
- package/dist/react/skf-tab/index.js +0 -18
- package/dist/react/skf-tab-group/index.d.ts +0 -3
- package/dist/react/skf-tab-group/index.js +0 -13
- package/dist/react/skf-tab-panel/index.d.ts +0 -3
- package/dist/react/skf-tab-panel/index.js +0 -13
- package/dist/react/skf-tag/index.d.ts +0 -3
- package/dist/react/skf-tag/index.js +0 -13
- package/dist/react/skf-textarea/index.d.ts +0 -12
- package/dist/react/skf-textarea/index.js +0 -18
- package/dist/react/skf-toast/index.d.ts +0 -3
- package/dist/react/skf-toast/index.js +0 -13
- package/dist/react/skf-toast-wrapper/index.d.ts +0 -3
- package/dist/react/skf-toast-wrapper/index.js +0 -13
- package/dist/react/skf-tooltip/index.d.ts +0 -12
- package/dist/react/skf-tooltip/index.js +0 -18
@@ -71,7 +71,7 @@ const p = class p extends b {
|
|
71
71
|
};
|
72
72
|
}
|
73
73
|
set customInvalid(s) {
|
74
|
-
this.customError = s
|
74
|
+
this.customError = s ?? "";
|
75
75
|
}
|
76
76
|
get customInvalid() {
|
77
77
|
return this.customError;
|
@@ -93,7 +93,7 @@ const p = class p extends b {
|
|
93
93
|
this.removeAttribute("invalid"), !this._pristine && this.showValid && this.setAttribute("valid", "true"), this.hint = this.getAttribute("hint") ?? "";
|
94
94
|
}
|
95
95
|
valueChanged() {
|
96
|
-
this._internals.setFormValue(this.value),
|
96
|
+
this._internals.setFormValue(this.value), this.validateInput();
|
97
97
|
}
|
98
98
|
attributeChangedCallback(s, r, a) {
|
99
99
|
if (super.attributeChangedCallback(s, r, a), s === "value" && this._internals.setFormValue(a), s === "custom-invalid")
|
@@ -184,7 +184,7 @@ const p = class p extends b {
|
|
184
184
|
aria-live=${this.invalid ? "assertive" : "polite"}
|
185
185
|
id="hint"
|
186
186
|
severity=${n(v(this.severity, this.invalid))}
|
187
|
-
>${this.customInvalid
|
187
|
+
>${this.customInvalid ?? this.hint}
|
188
188
|
</skf-hint>
|
189
189
|
`}
|
190
190
|
</div>
|
@@ -1,17 +1,31 @@
|
|
1
1
|
import type { Icon } from '@skf-design-system/ui-assets';
|
2
|
-
import type { ReactiveController } from 'lit';
|
2
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
3
3
|
import type { SkfInput } from './input.component.js';
|
4
|
-
|
4
|
+
/**
|
5
|
+
* Workaround for storybook helper not being able to import types
|
6
|
+
* E.g type ControllerHost = SkfInput;
|
7
|
+
*/
|
8
|
+
interface ControllerHostProps {
|
9
|
+
$input?: HTMLInputElement;
|
10
|
+
_internals: ElementInternals;
|
11
|
+
value: string;
|
12
|
+
validateInput: () => void;
|
13
|
+
buttonAriaLabelShow: string;
|
14
|
+
buttonAriaLabelHide: string;
|
15
|
+
_handleInput: () => void;
|
16
|
+
_manageRequired: () => void;
|
17
|
+
_setFormValue: (value: string) => void;
|
18
|
+
}
|
5
19
|
/**
|
6
20
|
* Number
|
7
21
|
*/
|
8
22
|
export type IncrementDecrement = 'inc' | 'dec';
|
9
23
|
export declare class InputNumberController implements ReactiveController {
|
10
|
-
host
|
24
|
+
host?: ReactiveControllerHost & Partial<ControllerHostProps>;
|
11
25
|
private _longPressId?;
|
12
26
|
private _repeaterId?;
|
13
27
|
private _inputElement?;
|
14
|
-
constructor(host:
|
28
|
+
constructor(host: ReactiveControllerHost);
|
15
29
|
hostUpdated(): void;
|
16
30
|
handleActionBtnClick: (_: Event, type: IncrementDecrement) => void;
|
17
31
|
handleActionBtnLongPressStart: (e: Event) => void;
|
@@ -21,12 +35,12 @@ export declare class InputNumberController implements ReactiveController {
|
|
21
35
|
* password
|
22
36
|
*/
|
23
37
|
export declare class InputPasswordController implements ReactiveController {
|
24
|
-
host
|
38
|
+
host?: ReactiveControllerHost & Partial<ControllerHostProps>;
|
25
39
|
_inputElement?: HTMLInputElement;
|
26
40
|
_icon: Extract<Icon, 'visibility' | 'visibilityOff'>;
|
27
41
|
_buttonAriaLabel: string;
|
28
42
|
_type: Extract<SkfInput['type'], 'password' | 'text'>;
|
29
|
-
constructor(host:
|
43
|
+
constructor(host: ReactiveControllerHost);
|
30
44
|
hostUpdated(): void;
|
31
45
|
handleFieldLoaded: () => void;
|
32
46
|
toggleVisibility: () => void;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
class l {
|
2
2
|
constructor(t) {
|
3
3
|
this.handleActionBtnClick = (i, s) => {
|
4
|
-
var n;
|
4
|
+
var h, n;
|
5
5
|
const e = this._inputElement;
|
6
|
-
e
|
6
|
+
!e || !this.host || (s === "inc" ? e.stepUp() : e.stepDown(), this.host.value = ((h = this._inputElement) == null ? void 0 : h.value) ?? "", (n = this.host._internals) == null || n.setFormValue(this.host.value), this.host.validateInput && this.host.validateInput());
|
7
7
|
}, this.handleActionBtnLongPressStart = (i) => {
|
8
8
|
const s = i.target.getAttribute("aria-label") === "Increment" ? "inc" : "dec";
|
9
9
|
this._longPressId = setTimeout(() => {
|
@@ -13,25 +13,29 @@ class l {
|
|
13
13
|
}, 400);
|
14
14
|
}, this.handleActionBtnLongPressEnd = () => {
|
15
15
|
clearTimeout(this._longPressId), clearInterval(this._repeaterId);
|
16
|
-
}, this.host = t
|
16
|
+
}, (this.host = t).addController(this);
|
17
17
|
}
|
18
18
|
hostUpdated() {
|
19
|
-
|
19
|
+
var t;
|
20
|
+
this._inputElement = (t = this.host) == null ? void 0 : t.$input;
|
20
21
|
}
|
21
22
|
}
|
22
|
-
class
|
23
|
+
class a {
|
23
24
|
constructor(t) {
|
24
25
|
this._icon = "visibility", this._type = "password", this.handleFieldLoaded = () => {
|
25
|
-
|
26
|
+
var i;
|
27
|
+
!this._inputElement || !((i = this.host) != null && i._handleInput) || (this.host.value = this._inputElement.value, this.host._handleInput());
|
26
28
|
}, this.toggleVisibility = () => {
|
27
|
-
|
28
|
-
|
29
|
+
var i;
|
30
|
+
!this._inputElement || !((i = this.host) != null && i._handleInput) || (this.host._handleInput(), this._type === "text" ? (this._buttonAriaLabel = this.host.buttonAriaLabelShow ?? "", this._icon = "visibility", this._type = "password") : (this._buttonAriaLabel = this.host.buttonAriaLabelHide ?? "", this._icon = "visibilityOff", this._type = "text"), this.host.requestUpdate(), this._inputElement.value = this.host.value ?? "");
|
31
|
+
}, (this.host = t).addController(this), this._buttonAriaLabel = this.host.buttonAriaLabelShow ?? "";
|
29
32
|
}
|
30
33
|
hostUpdated() {
|
31
|
-
|
34
|
+
var t;
|
35
|
+
this._inputElement = (t = this.host) == null ? void 0 : t.$input;
|
32
36
|
}
|
33
37
|
}
|
34
38
|
export {
|
35
39
|
l as InputNumberController,
|
36
|
-
|
40
|
+
a as InputPasswordController
|
37
41
|
};
|
@@ -1,53 +1,57 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
|
-
const
|
2
|
+
const i = r`
|
3
3
|
/* stylelint-disable selector-class-pattern */
|
4
4
|
@layer components {
|
5
|
+
:host {
|
6
|
+
contain: layout;
|
7
|
+
display: inline;
|
8
|
+
}
|
9
|
+
|
5
10
|
.link {
|
6
11
|
align-items: center;
|
7
|
-
color: var(--state-color, var(--color));
|
12
|
+
color: var(--_skf-link-state-color, var(--_skf-link-color));
|
8
13
|
display: inline-flex;
|
9
|
-
flex-direction: var(--flex-direction, rows);
|
10
14
|
font-weight: var(--skf-font-weight-bold);
|
11
|
-
gap: var(--skf-spacing-
|
12
|
-
|
15
|
+
gap: 0 var(--skf-spacing-25);
|
16
|
+
vertical-align: top;
|
13
17
|
|
14
18
|
&:is(a) {
|
15
19
|
text-decoration: none;
|
16
20
|
}
|
17
21
|
|
18
22
|
&:disabled {
|
19
|
-
--state-color: var(--color-disabled);
|
23
|
+
--_skf-link-state-color: var(--_skf-link-color-disabled);
|
20
24
|
}
|
21
25
|
|
22
26
|
&:hover {
|
23
|
-
--state-color: var(--color-hover);
|
27
|
+
--_skf-link-state-color: var(--_skf-link-color-hover);
|
24
28
|
}
|
25
29
|
|
26
30
|
&:focus-visible {
|
27
31
|
border-radius: var(--skf-border-radius-sm);
|
28
|
-
outline: var(--skf-border-width-md) solid var(--outline-color);
|
32
|
+
outline: var(--skf-border-width-md) solid var(--_skf-link-outline-color);
|
29
33
|
outline-offset: var(--skf-size-2);
|
30
34
|
}
|
31
35
|
}
|
32
36
|
|
33
37
|
.link--color-primary {
|
34
|
-
--color: var(--skf-interactive-text-color-primary);
|
35
|
-
--color-active: var(--skf-interactive-text-color-primary-active);
|
36
|
-
--color-disabled: var(--skf-interactive-text-color-disabled);
|
37
|
-
--color-hover: var(--skf-interactive-text-color-primary-hover);
|
38
|
-
--outline-color: var(--skf-interactive-text-color-primary);
|
38
|
+
--_skf-link-color: var(--skf-interactive-text-color-primary);
|
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);
|
39
43
|
}
|
40
44
|
|
41
45
|
.link--color-inverse {
|
42
|
-
--color: var(--skf-interactive-text-color-inverse);
|
43
|
-
--color-active: var(--skf-interactive-text-color-inverse-active);
|
44
|
-
--color-disabled: var(--skf-interactive-text-color-disabled);
|
45
|
-
--color-hover: var(--skf-interactive-text-color-inverse-hover);
|
46
|
-
--outline-color: var(--skf-interactive-text-color-inverse);
|
46
|
+
--_skf-link-color: var(--skf-interactive-text-color-inverse);
|
47
|
+
--_skf-link-color-active: var(--skf-interactive-text-color-inverse-active);
|
48
|
+
--_skf-link-color-disabled: var(--skf-interactive-text-color-disabled);
|
49
|
+
--_skf-link-color-hover: var(--skf-interactive-text-color-inverse-hover);
|
50
|
+
--_skf-link-outline-color: var(--skf-interactive-text-color-inverse);
|
47
51
|
}
|
48
52
|
|
49
53
|
.link--icon-right {
|
50
|
-
|
54
|
+
flex-direction: row-reverse;
|
51
55
|
}
|
52
56
|
|
53
57
|
.link--stretch {
|
@@ -56,5 +60,5 @@ const o = r`
|
|
56
60
|
}
|
57
61
|
`;
|
58
62
|
export {
|
59
|
-
|
63
|
+
i as default
|
60
64
|
};
|
@@ -5,12 +5,11 @@ import type { CSSResultGroup } from 'lit';
|
|
5
5
|
*
|
6
6
|
* @documentation See [zeroheight](https://zeroheight.com/****) for design principles
|
7
7
|
*
|
8
|
-
* @
|
9
|
-
* @
|
10
|
-
* @property {string} [anchor] - The id of the element the menu will be anchored to
|
8
|
+
* @attribute {"top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"} [placement='bottom-start'] - The placement of the menu
|
9
|
+
* @attribute {string} [anchor] - The id of the element the menu will be anchored to
|
11
10
|
*
|
12
|
-
* @event
|
13
|
-
* @event
|
11
|
+
* @event skf-opened - Fired when the menu is opened
|
12
|
+
* @event skf-closed - Fired when the menu is closed
|
14
13
|
*
|
15
14
|
* @slot - The menu popover content
|
16
15
|
*
|
@@ -2,7 +2,7 @@ import { SkfPopoverBase as t } from "../../internal/base-classes/popover/popover
|
|
2
2
|
import { styles as o } from "./menu.styles.js";
|
3
3
|
const s = class s extends t {
|
4
4
|
constructor() {
|
5
|
-
super(), this.placement = "bottom-start", t.classMap = { menu: !0 };
|
5
|
+
super(), this.placement = "bottom-start", this.triggerEvent = "click", t.classMap = { menu: !0 };
|
6
6
|
}
|
7
7
|
addEventListeners(e) {
|
8
8
|
e.addEventListener("mouseenter", this.open);
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { SkfElement } from '../../internal/components/skf-element';
|
2
|
+
import { type CSSResultGroup } from 'lit';
|
3
|
+
/**
|
4
|
+
* The `<skf-nav>` is a component that displays a list of <nav-items>.
|
5
|
+
*
|
6
|
+
* @documentation See [zeroheight](https://zeroheight.com/****) for design principles
|
7
|
+
*
|
8
|
+
* @slot - The component's main content
|
9
|
+
*
|
10
|
+
* @tagname skf-nav
|
11
|
+
*/
|
12
|
+
export declare class SkfNav extends SkfElement {
|
13
|
+
static styles: CSSResultGroup;
|
14
|
+
vertical: boolean;
|
15
|
+
connectedCallback(): void;
|
16
|
+
render(): import("lit").TemplateResult<1>;
|
17
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { SkfElement as s } from "../../internal/components/skf-element.js";
|
2
|
+
import m from "../../styles/component.styles.js";
|
3
|
+
import { html as p } from "lit";
|
4
|
+
import { property as c } from "lit/decorators.js";
|
5
|
+
import { ifDefined as f } from "lit/directives/if-defined.js";
|
6
|
+
import { styles as u } from "./nav.styles.js";
|
7
|
+
var v = Object.defineProperty, d = (i, a, l, h) => {
|
8
|
+
for (var e = void 0, r = i.length - 1, n; r >= 0; r--)
|
9
|
+
(n = i[r]) && (e = n(a, l, e) || e);
|
10
|
+
return e && v(a, l, e), e;
|
11
|
+
};
|
12
|
+
const o = class o extends s {
|
13
|
+
constructor() {
|
14
|
+
super(...arguments), this.vertical = !1;
|
15
|
+
}
|
16
|
+
connectedCallback() {
|
17
|
+
super.connectedCallback(), this.ariaLabel = this.ariaLabel ?? "Main navigation", this.role = "nav";
|
18
|
+
}
|
19
|
+
render() {
|
20
|
+
return p`
|
21
|
+
<ul aria-orientation=${f(this.vertical ? "vertical" : void 0)} role="menubar">
|
22
|
+
<slot></slot>
|
23
|
+
</ul>
|
24
|
+
`;
|
25
|
+
}
|
26
|
+
};
|
27
|
+
o.styles = [m, u];
|
28
|
+
let t = o;
|
29
|
+
d([
|
30
|
+
c({ type: Boolean, reflect: !0 })
|
31
|
+
], t.prototype, "vertical");
|
32
|
+
export {
|
33
|
+
t as SkfNav
|
34
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import '../link/link.js';
|
2
|
+
import type SkfLink from '../link/link.js';
|
3
|
+
import { SkfElement } from '../../internal/components/skf-element';
|
4
|
+
import { type CSSResultGroup } from 'lit';
|
5
|
+
/**
|
6
|
+
* The `<skf-nav>` is a component that displays a list of <nav-items>.
|
7
|
+
*
|
8
|
+
* @documentation See [zeroheight](https://zeroheight.com/****) for design principles
|
9
|
+
*
|
10
|
+
* @slot - The component's main content
|
11
|
+
*
|
12
|
+
* @tagname skf-nav-item
|
13
|
+
*/
|
14
|
+
export declare class SkfNavItem extends SkfElement {
|
15
|
+
static styles: CSSResultGroup;
|
16
|
+
href: string;
|
17
|
+
icon?: SkfLink['icon'];
|
18
|
+
connectedCallback(): void;
|
19
|
+
render(): import("lit").TemplateResult<1>;
|
20
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import "../link/link.js";
|
2
|
+
import { SkfElement as m } from "../../internal/components/skf-element.js";
|
3
|
+
import c from "../../styles/component.styles.js";
|
4
|
+
import { html as h } from "lit";
|
5
|
+
import { property as f } from "lit/decorators.js";
|
6
|
+
import { ifDefined as u } from "lit/directives/if-defined.js";
|
7
|
+
import { styles as a } from "./nav-item.styles.js";
|
8
|
+
var d = Object.defineProperty, p = (i, s, n, y) => {
|
9
|
+
for (var r = void 0, t = i.length - 1, l; t >= 0; t--)
|
10
|
+
(l = i[t]) && (r = l(s, n, r) || r);
|
11
|
+
return r && d(s, n, r), r;
|
12
|
+
};
|
13
|
+
const o = class o extends m {
|
14
|
+
constructor() {
|
15
|
+
super(...arguments), this.href = "#";
|
16
|
+
}
|
17
|
+
connectedCallback() {
|
18
|
+
super.connectedCallback(), this.role = "menuitem";
|
19
|
+
}
|
20
|
+
render() {
|
21
|
+
return h`
|
22
|
+
<skf-link color="inverse" href=${this.href} icon=${u(this.icon)}>
|
23
|
+
<slot></slot>
|
24
|
+
</skf-link>
|
25
|
+
`;
|
26
|
+
}
|
27
|
+
};
|
28
|
+
o.styles = [c, a];
|
29
|
+
let e = o;
|
30
|
+
p([
|
31
|
+
f({ reflect: !0 })
|
32
|
+
], e.prototype, "href");
|
33
|
+
p([
|
34
|
+
f()
|
35
|
+
], e.prototype, "icon");
|
36
|
+
export {
|
37
|
+
e as SkfNavItem
|
38
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { css as t } from "lit";
|
2
|
+
const s = t`
|
3
|
+
@layer components {
|
4
|
+
skf-link::part(root) {
|
5
|
+
block-size: var(--skf-header-height);
|
6
|
+
display: flex;
|
7
|
+
padding-inline: var(--skf-spacing-100);
|
8
|
+
position: relative;
|
9
|
+
}
|
10
|
+
|
11
|
+
skf-link::part(root)::after {
|
12
|
+
content: '';
|
13
|
+
position: absolute;
|
14
|
+
transition: translate calc(var(--skf-motion-duration-fast) * 1ms)
|
15
|
+
var(--skf-motion-easing-ease-in);
|
16
|
+
}
|
17
|
+
|
18
|
+
skf-link::part(root):hover::after {
|
19
|
+
--_skf-nav-link-translate: 0;
|
20
|
+
}
|
21
|
+
|
22
|
+
:host-context(skf-nav:not([vertical])) skf-link::part(root)::after {
|
23
|
+
border-bottom: var(--skf-size-4) solid var(--skf-border-color-inverse);
|
24
|
+
inset-block-end: 0;
|
25
|
+
inset-inline: 0;
|
26
|
+
translate: 0 var(--_skf-nav-link-translate, 100%);
|
27
|
+
}
|
28
|
+
|
29
|
+
:host-context(skf-nav[vertical]) skf-link::part(root)::after {
|
30
|
+
border-left: var(--skf-size-4) solid var(--skf-border-color-inverse);
|
31
|
+
inset-block: 0;
|
32
|
+
inset-inline-start: 0;
|
33
|
+
translate: var(--_skf-nav-link-translate, -100%) 0;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
`;
|
37
|
+
export {
|
38
|
+
s as styles
|
39
|
+
};
|
@@ -1,16 +1,15 @@
|
|
1
1
|
import { SkfPopoverBase } from '../../internal/base-classes/popover/popover.base.js';
|
2
2
|
import type { CSSResultGroup } from 'lit';
|
3
3
|
/**
|
4
|
-
* The `<skf-popover>` is a general purpose component that displays the slot content.
|
4
|
+
* The `<skf-popover>` is a general purpose component that displays the slot content in a popover.
|
5
5
|
*
|
6
6
|
* @documentation See [zeroheight](https://zeroheight.com/****) for design principles
|
7
7
|
*
|
8
|
-
* @
|
9
|
-
* @
|
10
|
-
* @property {string} [anchor] - The id of the element the menu will be anchored to
|
8
|
+
* @attribute {"top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"} [placement='bottom-start'] - The placement of the menu
|
9
|
+
* @attribute {string} [anchor] - The id of the element the menu will be anchored to
|
11
10
|
*
|
12
|
-
* @event
|
13
|
-
* @event
|
11
|
+
* @event skf-opened - Fired when the menu is opened
|
12
|
+
* @event skf-closed - Fired when the menu is closed
|
14
13
|
*
|
15
14
|
* @slot - The popover content
|
16
15
|
*
|
@@ -1,37 +1,37 @@
|
|
1
1
|
import { SkfPopoverBase as h } from "../../internal/base-classes/popover/popover.base.js";
|
2
|
-
import { watch as
|
3
|
-
import { property as
|
4
|
-
import { styles as
|
5
|
-
var
|
6
|
-
for (var
|
7
|
-
(p =
|
8
|
-
return
|
2
|
+
import { watch as f } from "../../internal/helpers/watch.js";
|
3
|
+
import { property as l } from "lit/decorators.js";
|
4
|
+
import { styles as m } from "./popover.styles.js";
|
5
|
+
var d = Object.defineProperty, w = Object.getOwnPropertyDescriptor, n = (v, e, o, s) => {
|
6
|
+
for (var t = s > 1 ? void 0 : s ? w(e, o) : e, i = v.length - 1, p; i >= 0; i--)
|
7
|
+
(p = v[i]) && (t = (s ? p(e, o, t) : p(t)) || t);
|
8
|
+
return s && t && d(e, o, t), t;
|
9
9
|
};
|
10
10
|
const a = class a extends h {
|
11
11
|
constructor() {
|
12
|
-
super(), this.offset = 8, this.hideArrow = !1, this.arrow = !this.hideArrow, this.placement = "bottom-start", h.classMap = { popover: !0 };
|
12
|
+
super(), this.offset = 8, this.hideArrow = !1, this.arrow = !this.hideArrow, this.placement = "bottom-start", this.triggerEvent = "click", h.classMap = { popover: !0 };
|
13
13
|
}
|
14
14
|
hideArrowChanged() {
|
15
15
|
this.arrow = !this.hideArrow;
|
16
16
|
}
|
17
17
|
addEventListeners(e) {
|
18
|
-
e.addEventListener(
|
18
|
+
e.addEventListener(this.triggerEvent, this.open, { signal: this.signal });
|
19
19
|
}
|
20
20
|
removeEventListeners(e) {
|
21
|
-
e.removeEventListener(
|
21
|
+
e.removeEventListener(this.triggerEvent, this.open);
|
22
22
|
}
|
23
23
|
};
|
24
|
-
a.styles = [h.styles,
|
25
|
-
let
|
24
|
+
a.styles = [h.styles, m];
|
25
|
+
let r = a;
|
26
26
|
n([
|
27
|
-
|
28
|
-
],
|
27
|
+
l({ type: Number })
|
28
|
+
], r.prototype, "offset", 2);
|
29
29
|
n([
|
30
|
-
|
31
|
-
],
|
30
|
+
l({ type: Boolean })
|
31
|
+
], r.prototype, "hideArrow", 2);
|
32
32
|
n([
|
33
|
-
|
34
|
-
],
|
33
|
+
f("hideArrow")
|
34
|
+
], r.prototype, "hideArrowChanged", 1);
|
35
35
|
export {
|
36
|
-
|
36
|
+
r as SkfPopover
|
37
37
|
};
|
@@ -7,8 +7,8 @@ import { type CSSResultGroup } from 'lit';
|
|
7
7
|
*
|
8
8
|
* @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/78d5dd-radio-button) for design principles
|
9
9
|
*
|
10
|
-
* @attribute {boolean} disabled - If true, sets disabled state
|
11
|
-
* @attribute {boolean} required - If true, value is required or must be checked for the form to be submittable
|
10
|
+
* @attribute {boolean} [disabled=false] - If true, sets disabled state
|
11
|
+
* @attribute {boolean} [required=false] - 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
|
*
|
@@ -18,13 +18,17 @@ import { type CSSResultGroup } from 'lit';
|
|
18
18
|
*/
|
19
19
|
export declare class SkfRadio extends FormBase implements FormFieldBaseProps {
|
20
20
|
static styles: CSSResultGroup;
|
21
|
+
/**
|
22
|
+
* @internal
|
23
|
+
* Initial state saved here as default for form resets.
|
24
|
+
*/
|
21
25
|
private _initialChecked;
|
22
26
|
/** If true, outputs helping hints in console */
|
23
|
-
debug
|
27
|
+
debug: boolean;
|
24
28
|
/** If true, outputs helping hints in console */
|
25
|
-
checked
|
29
|
+
checked: boolean;
|
26
30
|
/** If true, forces component to invalid state until removed */
|
27
|
-
customInvalid
|
31
|
+
customInvalid: boolean;
|
28
32
|
/** If defined, sets the input's label unless the default slot is used. Alternatively, you can use the `label` attribute. */
|
29
33
|
label?: string;
|
30
34
|
/** If defined, adds name to the input-element */
|
@@ -39,7 +43,7 @@ export declare class SkfRadio extends FormBase implements FormFieldBaseProps {
|
|
39
43
|
*/
|
40
44
|
severity?: FormFieldBaseProps['severity'];
|
41
45
|
/** If true, displays valid state after interaction */
|
42
|
-
showValid
|
46
|
+
showValid: boolean;
|
43
47
|
/** The current value of the input field */
|
44
48
|
value: string;
|
45
49
|
/** @internal */
|
@@ -7,15 +7,15 @@ import { html as m } from "lit";
|
|
7
7
|
import { property as r, state as f, query as y } from "lit/decorators.js";
|
8
8
|
import { ifDefined as b } from "lit/directives/if-defined.js";
|
9
9
|
import { live as _ } from "lit/directives/live.js";
|
10
|
-
import g from "./radio.styles.js";
|
11
|
-
var k = Object.defineProperty, C = Object.getOwnPropertyDescriptor, i = (u, e, s,
|
12
|
-
for (var a =
|
13
|
-
(h = u[
|
14
|
-
return
|
10
|
+
import { styles as g } from "./radio.styles.js";
|
11
|
+
var k = Object.defineProperty, C = Object.getOwnPropertyDescriptor, i = (u, e, s, l) => {
|
12
|
+
for (var a = l > 1 ? void 0 : l ? C(e, s) : e, o = u.length - 1, h; o >= 0; o--)
|
13
|
+
(h = u[o]) && (a = (l ? h(e, s, a) : h(a)) || a);
|
14
|
+
return l && a && k(e, s, a), a;
|
15
15
|
};
|
16
16
|
const d = class d extends c {
|
17
17
|
constructor() {
|
18
|
-
super(...arguments), this._initialChecked = !1, this.size = "md", this.value = "", this._invalid = !1, this._resetValue = (e) => {
|
18
|
+
super(...arguments), this._initialChecked = !1, this.debug = !1, this.checked = !1, this.customInvalid = !1, this.size = "md", this.showValid = !1, this.value = "", this._invalid = !1, this._resetValue = (e) => {
|
19
19
|
e.stopPropagation(), this.checked = this._initialChecked, this.$input && (this.$input.checked = !!this._initialChecked), this.setFormValue(this.checked ? this.value : "");
|
20
20
|
};
|
21
21
|
}
|
@@ -25,8 +25,8 @@ const d = class d extends c {
|
|
25
25
|
firstUpdated() {
|
26
26
|
var e;
|
27
27
|
(e = this.$input) == null || e.addEventListener("change", (s) => {
|
28
|
-
var
|
29
|
-
s.stopPropagation(), this.pristine = !1, this.checked = (
|
28
|
+
var l;
|
29
|
+
s.stopPropagation(), this.pristine = !1, this.checked = ((l = this.$input) == null ? void 0 : l.checked) ?? !1, this._validateInput(), this.checked ? this.setFormValue(this.value) : this.setFormValue(""), this.emitEvent("change");
|
30
30
|
}), this.addEventListener("invalid", (s) => {
|
31
31
|
this.pristine = !1, this._invalid = !0, this.customErrorDisplay && s.preventDefault();
|
32
32
|
}), this._initialChecked = this.checked, this.addEventListener("reset", this._resetValue);
|
@@ -55,8 +55,8 @@ const d = class d extends c {
|
|
55
55
|
const e = this.name;
|
56
56
|
if (!e) return;
|
57
57
|
(this.form ?? document).querySelectorAll(`skf-radio[name="${e}"]`).forEach((a) => {
|
58
|
-
const
|
59
|
-
a !== this && (
|
58
|
+
const o = this.form === a.form, h = !this.form && !a.form;
|
59
|
+
a !== this && (o || h) && (a.checked = !1);
|
60
60
|
});
|
61
61
|
}
|
62
62
|
/** @internal */
|
@@ -1,2 +1 @@
|
|
1
|
-
declare const
|
2
|
-
export default _default;
|
1
|
+
export declare const styles: import("lit").CSSResult[];
|