@skf-design-system/ui-components 1.0.2-beta.1 → 1.0.2-beta.11
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 +16 -18
- package/dist/components/link/link.component.js +109 -106
- package/dist/components/link/link.styles.js +49 -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 +1699 -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 +1990 -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 +39 -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,19 +1,20 @@
|
|
1
1
|
import { css as e } from "lit";
|
2
2
|
const o = e`
|
3
3
|
@layer components {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
flex-direction: column;
|
9
|
-
inline-size: min(100%, var(--_skf-drawer-size, 540px));
|
10
|
-
inset-block: 0;
|
11
|
-
inset-inline: var(--_skf-drawer-inset, auto 0);
|
12
|
-
position: fixed;
|
13
|
-
translate: 100% 0;
|
4
|
+
@layer base {
|
5
|
+
dialog {
|
6
|
+
--_skf-drawer-inset: auto 0;
|
7
|
+
--_skf-drawer-size: 540px;
|
14
8
|
|
15
|
-
|
16
|
-
|
9
|
+
all: unset;
|
10
|
+
background-color: var(--skf-bg-color-neutral-1);
|
11
|
+
display: none;
|
12
|
+
flex-direction: column;
|
13
|
+
inline-size: min(100%, var(--_skf-drawer-size));
|
14
|
+
inset-block: 0;
|
15
|
+
inset-inline: var(--_skf-drawer-inset);
|
16
|
+
position: fixed;
|
17
|
+
translate: 100% 0;
|
17
18
|
|
18
19
|
&::backdrop {
|
19
20
|
background-color: var(--skf-bg-color-neutral-7);
|
@@ -21,48 +22,54 @@ const o = e`
|
|
21
22
|
}
|
22
23
|
}
|
23
24
|
|
24
|
-
|
25
|
-
|
25
|
+
header {
|
26
|
+
align-items: center;
|
27
|
+
background-color: var(--skf-bg-color-emphasized);
|
28
|
+
block-size: var(--skf-size-48);
|
29
|
+
color: var(--skf-text-color-inverse);
|
30
|
+
display: flex;
|
31
|
+
justify-content: space-between;
|
32
|
+
padding-inline: var(--skf-box-spacing);
|
33
|
+
}
|
26
34
|
|
27
|
-
|
35
|
+
h2 {
|
36
|
+
font-size: var(--skf-font-size-200);
|
28
37
|
}
|
29
38
|
|
30
|
-
|
31
|
-
|
39
|
+
#close-button {
|
40
|
+
display: inline-flex;
|
32
41
|
}
|
33
42
|
|
34
|
-
|
35
|
-
|
43
|
+
#body {
|
44
|
+
display: block;
|
45
|
+
flex: auto;
|
46
|
+
padding: var(--skf-box-spacing);
|
36
47
|
}
|
37
48
|
}
|
38
49
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
display: flex;
|
45
|
-
justify-content: space-between;
|
46
|
-
padding-inline: var(--skf-box-spacing);
|
50
|
+
@layer states {
|
51
|
+
#close-button:focus-visible {
|
52
|
+
border-radius: var(--skf-border-radius-sm);
|
53
|
+
outline: var(--skf-border-width-sm) solid var(--skf-interactive-text-color-inverse);
|
54
|
+
}
|
47
55
|
}
|
48
56
|
|
49
|
-
|
50
|
-
|
51
|
-
|
57
|
+
@layer mods {
|
58
|
+
dialog[open] {
|
59
|
+
display: flex;
|
60
|
+
}
|
52
61
|
|
53
|
-
|
54
|
-
|
62
|
+
:host(:state(left)) dialog {
|
63
|
+
--_skf-drawer-inset: 0 auto;
|
64
|
+
}
|
55
65
|
|
56
|
-
|
57
|
-
|
58
|
-
outline: var(--skf-border-width-sm) solid var(--skf-interactive-text-color-inverse);
|
66
|
+
:host(:state(sm)) dialog {
|
67
|
+
--_skf-drawer-size: 400px;
|
59
68
|
}
|
60
|
-
}
|
61
69
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
padding: var(--skf-box-spacing);
|
70
|
+
:host(:state(lg)) dialog {
|
71
|
+
--_skf-drawer-size: 680px;
|
72
|
+
}
|
66
73
|
}
|
67
74
|
}
|
68
75
|
`;
|
@@ -2,6 +2,7 @@ import '../button/button.js';
|
|
2
2
|
import '../drawer/drawer.js';
|
3
3
|
import '../logo/logo.js';
|
4
4
|
import { SkfElement } from '../../internal/components/skf-element';
|
5
|
+
import { type Language } from '../../utilities/localize.js';
|
5
6
|
import { type CSSResultGroup } from 'lit';
|
6
7
|
/**
|
7
8
|
* The `<skf-header>` component is to be used as the site-header in the app. The navigation will be collapsed to mobile-view if the menu items exceed the available width.
|
@@ -13,6 +14,7 @@ import { type CSSResultGroup } from 'lit';
|
|
13
14
|
* @tagname skf-header
|
14
15
|
*/
|
15
16
|
export declare class SkfHeader extends SkfElement {
|
17
|
+
#private;
|
16
18
|
static styles: CSSResultGroup;
|
17
19
|
/** @internal */
|
18
20
|
private _dynamicBreakpoint?;
|
@@ -21,8 +23,8 @@ export declare class SkfHeader extends SkfElement {
|
|
21
23
|
/** If true, sets header to display in compact mode only (hanburger menu and drawer) */
|
22
24
|
set compact(value: boolean);
|
23
25
|
get compact(): boolean;
|
24
|
-
/**
|
25
|
-
|
26
|
+
/** Sets the internal language of the component */
|
27
|
+
lang: Language;
|
26
28
|
/** If defined, sets the app or site's name */
|
27
29
|
siteName?: string;
|
28
30
|
/** If defined, sets the site's base-url for the "logo-link" */
|
@@ -1,24 +1,32 @@
|
|
1
|
+
var v = (e) => {
|
2
|
+
throw TypeError(e);
|
3
|
+
};
|
4
|
+
var d = (e, r, t) => r.has(e) || v("Cannot " + t);
|
5
|
+
var f = (e, r, t) => (d(e, r, "read from private field"), t ? t.call(e) : r.get(e)), u = (e, r, t) => r.has(e) ? v("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, t), b = (e, r, t, o) => (d(e, r, "write to private field"), o ? o.call(e, t) : r.set(e, t), t);
|
1
6
|
import "../button/button.js";
|
2
7
|
import "../drawer/drawer.js";
|
3
8
|
import "../logo/logo.js";
|
4
|
-
import { SkfElement as
|
5
|
-
import { componentStyles as
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
import { SkfElement as y } from "../../internal/components/skf-element.js";
|
10
|
+
import { componentStyles as $ } from "../../styles/component.styles.js";
|
11
|
+
import { LocalizeController as g } from "../../utilities/localize.js";
|
12
|
+
import { nothing as C, html as h } from "lit";
|
13
|
+
import { property as p, state as O, queryAssignedElements as W, query as D } from "lit/decorators.js";
|
14
|
+
import { ifDefined as w } from "lit/directives/if-defined.js";
|
15
|
+
import { literal as _, html as N } from "lit/static-html.js";
|
16
|
+
import { styles as k } from "./header.styles.js";
|
17
|
+
var z = Object.defineProperty, B = Object.getOwnPropertyDescriptor, s = (e, r, t, o) => {
|
18
|
+
for (var a = o > 1 ? void 0 : o ? B(r, t) : r, l = e.length - 1, c; l >= 0; l--)
|
19
|
+
(c = e[l]) && (a = (o ? c(r, t, a) : c(a)) || a);
|
20
|
+
return o && a && z(r, t, a), a;
|
21
|
+
}, n;
|
22
|
+
const m = class m extends y {
|
17
23
|
constructor() {
|
18
|
-
super(...arguments)
|
24
|
+
super(...arguments);
|
25
|
+
u(this, n);
|
26
|
+
b(this, n, new g(this)), this.lang = "en", this.isCompact = !1, this.openDrawer = !1;
|
19
27
|
}
|
20
|
-
set compact(
|
21
|
-
this.isCompact =
|
28
|
+
set compact(t) {
|
29
|
+
this.isCompact = t;
|
22
30
|
}
|
23
31
|
get compact() {
|
24
32
|
return this.isCompact;
|
@@ -35,82 +43,81 @@ const l = class l extends d {
|
|
35
43
|
/** @internal */
|
36
44
|
_observeHostWidth() {
|
37
45
|
this._widthObserver = new ResizeObserver(() => {
|
38
|
-
|
39
|
-
this.clientWidth > (this._dynamicBreakpoint ?? 0) && (this._dynamicBreakpoint = null, (e = this._widthObserver) == null || e.disconnect(), this.isCompact = !1, this.nav[0].vertical = !1, this._observeNavContainer());
|
46
|
+
this.clientWidth > (this._dynamicBreakpoint ?? 0) && (this._dynamicBreakpoint = null, this._widthObserver?.disconnect(), this.isCompact = !1, this.nav[0].vertical = !1, this._observeNavContainer());
|
40
47
|
}), this._widthObserver.observe(this);
|
41
48
|
}
|
42
49
|
/** @internal */
|
43
50
|
_observeNavContainer() {
|
44
51
|
this._widthObserver = new ResizeObserver(() => {
|
45
|
-
|
46
|
-
this.$navWrapper.clientWidth < this.$navWrapper.scrollWidth && (this._dynamicBreakpoint = this.clientWidth, (e = this._widthObserver) == null || e.disconnect(), this.isCompact = !0, this.nav[0].vertical = !0, this._observeHostWidth());
|
52
|
+
this.$navWrapper.clientWidth < this.$navWrapper.scrollWidth && (this._dynamicBreakpoint = this.clientWidth, this._widthObserver?.disconnect(), this.isCompact = !0, this.nav[0].vertical = !0, this._observeHostWidth());
|
47
53
|
}), this._widthObserver.observe(this.$navWrapper);
|
48
54
|
}
|
49
55
|
/** @internal */
|
50
56
|
_renderMeta() {
|
51
|
-
const
|
52
|
-
return
|
53
|
-
<${
|
57
|
+
const t = this.siteUrl ? _`a` : _`div`;
|
58
|
+
return N`
|
59
|
+
<${t} href=${w(this.siteUrl)} id="meta">
|
54
60
|
<skf-logo color="inverse"></skf-logo>
|
55
|
-
${this.siteName ?
|
56
|
-
</${
|
61
|
+
${this.siteName ? h`<h2>${this.siteName}</h2>` : C}
|
62
|
+
</${t}>
|
57
63
|
`;
|
58
64
|
}
|
59
65
|
render() {
|
60
|
-
return
|
66
|
+
return h`
|
61
67
|
<header role="banner">
|
62
68
|
${this._renderMeta()}
|
63
69
|
<div id="nav-wrapper">
|
64
|
-
${this.isCompact ?
|
70
|
+
${this.isCompact ? h`
|
65
71
|
<button
|
66
72
|
@click=${() => this.openDrawer = !this.openDrawer}
|
67
73
|
aria-controls="drawer"
|
68
74
|
aria-expanded=${this.openDrawer}
|
69
|
-
aria-label=${this.
|
75
|
+
aria-label=${f(this, n).term("showMenu")}
|
70
76
|
>
|
71
77
|
<skf-icon color="inverse" name="hamburgerMenu" size="lg"></skf-icon>
|
72
78
|
</button>
|
73
79
|
<skf-drawer
|
74
80
|
?open=${this.openDrawer}
|
75
81
|
@close=${() => this.openDrawer = !1}
|
76
|
-
heading=${
|
82
|
+
heading=${w(this.siteName)}
|
77
83
|
id="drawer"
|
84
|
+
lang=${this.lang}
|
78
85
|
placement="right"
|
79
86
|
>
|
80
87
|
<slot></slot>
|
81
88
|
</skf-drawer>
|
82
|
-
` :
|
89
|
+
` : h`<slot></slot>`}
|
83
90
|
</div>
|
84
91
|
</header>
|
85
92
|
`;
|
86
93
|
}
|
87
94
|
};
|
88
|
-
|
89
|
-
let
|
90
|
-
|
91
|
-
|
92
|
-
],
|
93
|
-
|
94
|
-
|
95
|
-
],
|
96
|
-
|
97
|
-
|
98
|
-
],
|
99
|
-
|
100
|
-
|
101
|
-
],
|
102
|
-
|
103
|
-
|
104
|
-
],
|
105
|
-
|
106
|
-
|
107
|
-
],
|
108
|
-
|
109
|
-
|
110
|
-
],
|
111
|
-
|
112
|
-
|
113
|
-
],
|
95
|
+
n = new WeakMap(), m.styles = [$, k];
|
96
|
+
let i = m;
|
97
|
+
s([
|
98
|
+
p({ type: Boolean, reflect: !0 })
|
99
|
+
], i.prototype, "compact", 1);
|
100
|
+
s([
|
101
|
+
p({ type: String })
|
102
|
+
], i.prototype, "lang", 2);
|
103
|
+
s([
|
104
|
+
p({ attribute: "site-name" })
|
105
|
+
], i.prototype, "siteName", 2);
|
106
|
+
s([
|
107
|
+
p({ attribute: "site-url" })
|
108
|
+
], i.prototype, "siteUrl", 2);
|
109
|
+
s([
|
110
|
+
p({ type: Boolean, reflect: !0, state: !0, attribute: "is-compact" })
|
111
|
+
], i.prototype, "isCompact", 2);
|
112
|
+
s([
|
113
|
+
O()
|
114
|
+
], i.prototype, "openDrawer", 2);
|
115
|
+
s([
|
116
|
+
W({ selector: "skf-nav" })
|
117
|
+
], i.prototype, "nav", 2);
|
118
|
+
s([
|
119
|
+
D("#nav-wrapper")
|
120
|
+
], i.prototype, "$navWrapper", 2);
|
114
121
|
export {
|
115
|
-
|
122
|
+
i as SkfHeader
|
116
123
|
};
|
@@ -7,7 +7,7 @@ const a = e`
|
|
7
7
|
|
8
8
|
header {
|
9
9
|
align-items: center;
|
10
|
-
background-color: var(--skf-bg-color-
|
10
|
+
background-color: var(--skf-bg-color-emphasized);
|
11
11
|
block-size: var(--skf-header-height);
|
12
12
|
display: flex;
|
13
13
|
gap: var(--skf-spacing-125);
|
@@ -48,7 +48,7 @@ const a = e`
|
|
48
48
|
}
|
49
49
|
|
50
50
|
skf-drawer::part(body) {
|
51
|
-
background-color: var(--skf-bg-color-
|
51
|
+
background-color: var(--skf-bg-color-emphasized);
|
52
52
|
padding: 0;
|
53
53
|
}
|
54
54
|
|
@@ -10,10 +10,14 @@ import { type CSSResultGroup } from 'lit';
|
|
10
10
|
* @tagname skf-heading
|
11
11
|
*/
|
12
12
|
export declare class SkfHeading extends SkfElement {
|
13
|
+
#private;
|
13
14
|
static styles: CSSResultGroup;
|
14
15
|
/** Controls which heading element will be rendered. Should not be used to affect appearance */
|
15
16
|
as: HeadingType;
|
16
17
|
/** If defined, changes the appearance of the heading */
|
17
18
|
styledAs?: HeadingType;
|
18
|
-
|
19
|
+
connectedCallback(): void;
|
20
|
+
/** @internal */
|
21
|
+
_handleStateChange(): void;
|
22
|
+
render(): import("lit").TemplateResult<1>;
|
19
23
|
}
|
@@ -1,35 +1,62 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import "lit";
|
4
|
-
import { property as i } from "lit/decorators.js";
|
5
|
-
import { literal as u, html as c } from "lit/static-html.js";
|
6
|
-
import { styles as y } from "./heading.styles.js";
|
7
|
-
var d = Object.defineProperty, a = (l, r, p, h) => {
|
8
|
-
for (var t = void 0, o = l.length - 1, m; o >= 0; o--)
|
9
|
-
(m = l[o]) && (t = m(r, p, t) || t);
|
10
|
-
return t && d(r, p, t), t;
|
1
|
+
var y = (t) => {
|
2
|
+
throw TypeError(t);
|
11
3
|
};
|
12
|
-
|
4
|
+
var d = (t, e, s) => e.has(t) || y("Cannot " + s);
|
5
|
+
var n = (t, e, s) => (d(t, e, "read from private field"), s ? s.call(t) : e.get(t)), c = (t, e, s) => e.has(t) ? y("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), m = (t, e, s, r) => (d(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s);
|
6
|
+
import { SkfElement as b } from "../../internal/components/skf-element.js";
|
7
|
+
import { stateMap as _ } from "../../internal/helpers/stateMap.js";
|
8
|
+
import { watch as C } from "../../internal/helpers/watch.js";
|
9
|
+
import { componentStyles as g } from "../../styles/component.styles.js";
|
10
|
+
import { html as w } from "lit";
|
11
|
+
import { property as v } from "lit/decorators.js";
|
12
|
+
import { styles as L } from "./heading.styles.js";
|
13
|
+
var O = Object.defineProperty, P = Object.getOwnPropertyDescriptor, f = (t, e, s, r) => {
|
14
|
+
for (var a = r > 1 ? void 0 : r ? P(e, s) : e, l = t.length - 1, p; l >= 0; l--)
|
15
|
+
(p = t[l]) && (a = (r ? p(e, s, a) : p(a)) || a);
|
16
|
+
return r && a && O(e, s, a), a;
|
17
|
+
}, h, i;
|
18
|
+
const u = class u extends b {
|
13
19
|
constructor() {
|
14
|
-
super(...arguments)
|
20
|
+
super(...arguments);
|
21
|
+
c(this, h);
|
22
|
+
c(this, i);
|
23
|
+
m(this, h, this.attachInternals()), m(this, i, n(this, h).states), this.as = "h2";
|
24
|
+
}
|
25
|
+
connectedCallback() {
|
26
|
+
switch (super.connectedCallback(), this.role = "heading", !0) {
|
27
|
+
case this.as === "h1":
|
28
|
+
this.ariaLevel = "1";
|
29
|
+
break;
|
30
|
+
case this.as === "h3":
|
31
|
+
this.ariaLevel = "3";
|
32
|
+
break;
|
33
|
+
case this.as === "h4":
|
34
|
+
this.ariaLevel = "4";
|
35
|
+
break;
|
36
|
+
default:
|
37
|
+
this.ariaLevel = "2";
|
38
|
+
break;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
_handleStateChange() {
|
42
|
+
const s = ["h1", "h2", "h3", "h4"];
|
43
|
+
_(n(this, i), s).set(this.styledAs);
|
15
44
|
}
|
16
45
|
render() {
|
17
|
-
|
18
|
-
return c`
|
19
|
-
<${r} id="root">
|
20
|
-
<slot></slot>
|
21
|
-
</${r}>
|
22
|
-
`;
|
46
|
+
return w`<slot data-as=${this.as} id="root"></slot>`;
|
23
47
|
}
|
24
48
|
};
|
25
|
-
|
26
|
-
let
|
27
|
-
|
28
|
-
|
29
|
-
],
|
30
|
-
|
31
|
-
|
32
|
-
],
|
49
|
+
h = new WeakMap(), i = new WeakMap(), u.styles = [g, L];
|
50
|
+
let o = u;
|
51
|
+
f([
|
52
|
+
v({ type: String, reflect: !0, useDefault: !0 })
|
53
|
+
], o.prototype, "as", 2);
|
54
|
+
f([
|
55
|
+
v({ type: String, attribute: "styled-as" })
|
56
|
+
], o.prototype, "styledAs", 2);
|
57
|
+
f([
|
58
|
+
C("styledAs")
|
59
|
+
], o.prototype, "_handleStateChange", 1);
|
33
60
|
export {
|
34
|
-
|
61
|
+
o as SkfHeading
|
35
62
|
};
|
@@ -1,57 +1,55 @@
|
|
1
1
|
import { css as s } from "lit";
|
2
2
|
const t = s`
|
3
3
|
@layer components {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
:host([as='h4']) & {
|
33
|
-
--_skf-heading-size: var(--skf-font-size-200);
|
4
|
+
@layer base {
|
5
|
+
#root {
|
6
|
+
color: var(--skf-text-color-primary);
|
7
|
+
font-size: var(--_skf-heading-size);
|
8
|
+
font-weight: var(--_skf-heading-weight);
|
9
|
+
line-height: 1.2;
|
10
|
+
|
11
|
+
&[data-as='h1'] {
|
12
|
+
--_skf-heading-size: var(--skf-font-size-700);
|
13
|
+
--_skf-heading-weight: var(--skf-font-weight-regular);
|
14
|
+
}
|
15
|
+
|
16
|
+
&:is([data-as='h2'], [data-as='h3'], [data-as='h4']) {
|
17
|
+
--_skf-heading-weight: var(--skf-font-weight-bold);
|
18
|
+
}
|
19
|
+
|
20
|
+
&[data-as='h2'] {
|
21
|
+
--_skf-heading-size: var(--skf-font-size-300);
|
22
|
+
}
|
23
|
+
|
24
|
+
&[data-as='h3'] {
|
25
|
+
--_skf-heading-size: var(--skf-font-size-200);
|
26
|
+
}
|
27
|
+
|
28
|
+
&[data-as='h4'] {
|
29
|
+
--_skf-heading-size: var(--skf-font-size-200);
|
30
|
+
}
|
34
31
|
}
|
32
|
+
}
|
35
33
|
|
36
|
-
|
37
|
-
:host(
|
34
|
+
@layer mods {
|
35
|
+
:host(:state(h1)) #root {
|
38
36
|
--_skf-heading-size: var(--skf-font-size-700);
|
39
37
|
--_skf-heading-weight: var(--skf-font-weight-regular);
|
40
38
|
}
|
41
39
|
|
42
|
-
:host(:is(
|
40
|
+
:host(:is(:state(h2), :state(h3), :state(h4))) #root {
|
43
41
|
--_skf-heading-weight: var(--skf-font-weight-bold);
|
44
42
|
}
|
45
43
|
|
46
|
-
:host(
|
44
|
+
:host(:state(h2)) #root {
|
47
45
|
--_skf-heading-size: var(--skf-font-size-300);
|
48
46
|
}
|
49
47
|
|
50
|
-
:host(
|
48
|
+
:host(:state(h3)) #root {
|
51
49
|
--_skf-heading-size: var(--skf-font-size-200);
|
52
50
|
}
|
53
51
|
|
54
|
-
:host(
|
52
|
+
:host(:state(h4)) #root {
|
55
53
|
--_skf-heading-size: var(--skf-font-size-200);
|
56
54
|
}
|
57
55
|
}
|
@@ -11,6 +11,7 @@ type SkfIconSize = IconSize;
|
|
11
11
|
* @tagname skf-icon
|
12
12
|
*/
|
13
13
|
export declare class SkfIcon extends SkfElement {
|
14
|
+
#private;
|
14
15
|
static styles: CSSResultGroup;
|
15
16
|
/** Sets the color of the icon */
|
16
17
|
color: IconColor;
|
@@ -20,6 +21,9 @@ export declare class SkfIcon extends SkfElement {
|
|
20
21
|
name: Icon;
|
21
22
|
/** Size of the icon */
|
22
23
|
size: SkfIconSize;
|
24
|
+
connectedCallback(): void;
|
25
|
+
/** @internal */
|
26
|
+
_handleStateChange(property: string, _prev: unknown, next: unknown): void;
|
23
27
|
render(): import("lit").TemplateResult<1>;
|
24
28
|
}
|
25
29
|
export {};
|