@skf-design-system/ui-components 1.0.1-beta.1 → 1.0.2-beta.1
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 +13 -26
- package/dist/components/accordion/accordion-item.component.d.ts +36 -0
- package/dist/components/accordion/accordion-item.component.js +87 -0
- package/dist/components/accordion/accordion-item.d.ts +3 -3
- package/dist/components/accordion/accordion-item.js +4 -5
- package/dist/components/accordion/accordion-item.styles.js +77 -0
- package/dist/components/accordion/accordion.component.d.ts +9 -13
- package/dist/components/accordion/accordion.component.js +12 -13
- package/dist/components/accordion/accordion.d.ts +0 -1
- package/dist/components/accordion/accordion.js +0 -2
- package/dist/components/alert/alert.component.d.ts +6 -10
- package/dist/components/alert/alert.component.js +15 -16
- package/dist/components/alert/alert.styles.js +0 -5
- package/dist/components/breadcrumb/breadcrumb-item.component.js +61 -0
- package/dist/components/breadcrumb/breadcrumb-item.js +6 -0
- package/dist/components/breadcrumb/breadcrumb-item.styles.js +62 -0
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb.component.js +60 -0
- package/dist/components/breadcrumb/breadcrumb.js +6 -0
- package/dist/components/breadcrumb/breadcrumb.styles.js +22 -0
- package/dist/components/button/button.component.d.ts +13 -10
- package/dist/components/button/button.component.js +83 -76
- package/dist/components/button/button.styles.d.ts +1 -2
- package/dist/components/button/button.styles.js +1 -1
- package/dist/components/card/card.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 +16 -14
- package/dist/components/checkbox/checkbox.component.js +5 -5
- package/dist/components/checkbox/checkbox.styles.d.ts +1 -2
- package/dist/components/checkbox/checkbox.styles.js +1 -5
- 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 +14 -5
- package/dist/components/date-picker-input/datepicker-input.component.js +264 -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 +20 -29
- package/dist/components/dialog/dialog.component.js +85 -75
- package/dist/components/dialog/dialog.styles.js +4 -4
- 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 +61 -0
- package/dist/components/drawer/drawer.component.js +125 -0
- package/dist/components/drawer/drawer.d.ts +8 -0
- package/dist/components/drawer/drawer.js +6 -0
- package/dist/components/drawer/drawer.styles.js +71 -0
- package/dist/components/header/header.component.d.ts +46 -0
- package/dist/components/header/header.component.js +116 -0
- package/dist/components/header/header.d.ts +8 -0
- package/dist/components/header/header.js +6 -0
- package/dist/components/header/header.styles.js +68 -0
- package/dist/components/heading/heading.component.d.ts +3 -11
- package/dist/components/heading/heading.component.js +24 -23
- 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 +11 -17
- package/dist/components/icon/icon.component.js +2 -2
- package/dist/components/icon/icon.styles.d.ts +1 -2
- package/dist/components/icon/icon.styles.js +1 -1
- package/dist/components/input/input.component.d.ts +30 -31
- package/dist/components/input/input.component.js +138 -125
- 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.d.ts +12 -14
- package/dist/components/link/link.component.js +35 -34
- package/dist/components/link/link.styles.d.ts +1 -2
- package/dist/components/link/link.styles.js +24 -20
- package/dist/components/loader/loader.component.d.ts +1 -1
- package/dist/components/loader/loader.component.js +36 -40
- package/dist/components/loader/loader.styles.d.ts +1 -2
- package/dist/components/loader/loader.styles.js +40 -32
- package/dist/components/logo/logo.component.d.ts +4 -5
- package/dist/components/logo/logo.component.js +1 -1
- package/dist/components/menu/menu-item.component.d.ts +13 -0
- package/dist/components/{menu-item → menu}/menu-item.component.js +3 -3
- package/dist/components/menu/menu.component.d.ts +10 -8
- package/dist/components/menu/menu.component.js +8 -10
- package/dist/components/nav/nav-item.component.d.ts +18 -0
- package/dist/components/nav/nav-item.component.js +38 -0
- package/dist/components/nav/nav-item.d.ts +8 -0
- package/dist/components/nav/nav-item.js +6 -0
- package/dist/components/nav/nav-item.styles.js +39 -0
- 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/popover/popover.component.d.ts +11 -8
- package/dist/components/popover/popover.component.js +24 -26
- package/dist/components/progress/progress.component.d.ts +2 -2
- package/dist/components/progress/progress.component.js +31 -37
- package/dist/components/progress/progress.styles.js +40 -35
- package/dist/components/radio/radio.component.d.ts +19 -13
- package/dist/components/radio/radio.component.js +12 -12
- 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-item.component.d.ts +36 -0
- package/dist/components/segmented-button/segmented-button-item.component.js +56 -0
- package/dist/components/segmented-button/segmented-button-item.d.ts +8 -0
- package/dist/components/segmented-button/segmented-button-item.js +6 -0
- package/dist/components/segmented-button/segmented-button-item.styles.d.ts +1 -0
- package/dist/components/segmented-button/segmented-button-item.styles.js +62 -0
- package/dist/components/segmented-button/segmented-button.component.d.ts +30 -0
- package/dist/components/segmented-button/segmented-button.component.js +73 -0
- package/dist/components/segmented-button/segmented-button.d.ts +8 -0
- package/dist/components/segmented-button/segmented-button.js +6 -0
- package/dist/components/segmented-button/segmented-button.styles.d.ts +1 -0
- package/dist/components/segmented-button/segmented-button.styles.js +16 -0
- package/dist/components/{select-option-group → select}/select-option-group.component.js +1 -1
- package/dist/components/select/select-option-group.style.d.ts +1 -0
- package/dist/components/{select-option → select}/select-option.component.d.ts +7 -8
- package/dist/components/{select-option → select}/select-option.component.js +15 -15
- package/dist/components/select/select-option.controllers.d.ts +15 -0
- package/dist/components/select/select-option.styles.d.ts +1 -0
- package/dist/components/select/select.component.d.ts +16 -15
- package/dist/components/select/select.component.js +19 -19
- package/dist/components/select/select.controllers.d.ts +21 -10
- package/dist/components/select/select.controllers.js +31 -23
- package/dist/components/select/select.stories.icons.d.ts +7 -0
- package/dist/components/{stepper-item → stepper}/stepper-item.component.js +8 -8
- package/dist/components/stepper/stepper-item.styles.d.ts +1 -0
- package/dist/components/stepper/stepper.component.d.ts +4 -3
- package/dist/components/stepper/stepper.component.js +15 -15
- package/dist/components/stepper/stepper.helpers.d.ts +1 -1
- package/dist/components/switch/switch.component.d.ts +7 -6
- package/dist/components/switch/switch.component.js +21 -21
- package/dist/components/tab/tab.component.js +1 -1
- package/dist/components/tab-group/tab-group.component.js +1 -1
- package/dist/components/tab-panel/tab-panel.component.js +1 -1
- package/dist/components/tag/tag.component.d.ts +14 -16
- package/dist/components/tag/tag.component.js +36 -39
- package/dist/components/textarea/textarea.component.d.ts +10 -11
- package/dist/components/textarea/textarea.component.js +65 -67
- package/dist/components/{toast-item → toast}/toast-item.d.ts +2 -0
- package/dist/components/{toast-item → toast}/toast-item.js +4 -0
- package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.js +1 -1
- package/dist/components/toast/toast-wrapper.styles.d.ts +1 -0
- package/dist/components/toast/toast.component.d.ts +6 -5
- package/dist/components/toast/toast.component.js +15 -15
- package/dist/components/toast/toast.singleton.d.ts +4 -4
- package/dist/components/toast/toast.singleton.js +12 -12
- package/dist/components/tooltip/tooltip.component.d.ts +7 -7
- package/dist/components/tooltip/tooltip.component.js +16 -11
- package/dist/custom-elements.json +2718 -2073
- package/dist/index.d.ts +16 -6
- package/dist/index.js +103 -75
- package/dist/internal/base-classes/popover/popover.base.d.ts +24 -9
- package/dist/internal/base-classes/popover/popover.base.js +138 -77
- package/dist/internal/base-classes/popover/popover.styles.js +14 -1
- package/dist/internal/components/hint/hint.component.d.ts +2 -2
- package/dist/internal/components/hint/hint.component.js +2 -2
- package/dist/internal/components/hint/hint.styles.d.ts +1 -2
- package/dist/internal/components/hint/hint.styles.js +1 -1
- package/dist/internal/constants/iconSeverity.d.ts +3 -2
- package/dist/internal/constants/iconSeverity.js +2 -3
- 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/hintSeverity.d.ts +2 -2
- package/dist/internal/helpers/hintSeverity.js +1 -1
- 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/internal/types/formField.d.ts +1 -1
- package/dist/internal/types.d.ts +18 -0
- package/dist/styles/component.styles.d.ts +1 -2
- package/dist/styles/component.styles.js +1 -1
- 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 +673 -1310
- package/dist/types/vue/index.d.ts +456 -319
- package/dist/vscode.html-custom-data.json +402 -1080
- package/dist/web-types.json +986 -767
- package/package.json +44 -55
- package/dist/components/collapse/collapse.component.d.ts +0 -40
- package/dist/components/collapse/collapse.component.js +0 -86
- package/dist/components/collapse/collapse.d.ts +0 -8
- package/dist/components/collapse/collapse.js +0 -6
- package/dist/components/collapse/collapse.styles.d.ts +0 -2
- package/dist/components/collapse/collapse.styles.js +0 -77
- package/dist/components/menu-item/menu-item.component.d.ts +0 -25
- package/dist/components/select-option/select-option.controllers.d.ts +0 -9
- package/dist/internal/constants/heading.d.ts +0 -2
- 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
- /package/dist/components/{breadcrumb-item/breadcrumb-item.styles.d.ts → accordion/accordion-item.styles.d.ts} +0 -0
- /package/dist/components/{collapse/collapse.test.d.ts → accordion/accordion-item.test.d.ts} +0 -0
- /package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.component.d.ts +0 -0
- /package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.d.ts +0 -0
- /package/dist/components/{menu-item/menu-item.styles.d.ts → breadcrumb/breadcrumb-item.styles.d.ts} +0 -0
- /package/dist/components/{select-option-group/select-option-group.style.d.ts → drawer/drawer.styles.d.ts} +0 -0
- /package/dist/components/{select-option/select-option.styles.d.ts → header/header.styles.d.ts} +0 -0
- /package/dist/components/{menu-item → menu}/menu-item.d.ts +0 -0
- /package/dist/components/{menu-item → menu}/menu-item.js +0 -0
- /package/dist/components/{stepper-item/stepper-item.styles.d.ts → menu/menu-item.styles.d.ts} +0 -0
- /package/dist/components/{menu-item → menu}/menu-item.styles.js +0 -0
- /package/dist/components/{toast-wrapper/toast-wrapper.styles.d.ts → nav/nav-item.styles.d.ts} +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.component.d.ts +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.d.ts +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.js +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.style.js +0 -0
- /package/dist/components/{select-option → select}/select-option.d.ts +0 -0
- /package/dist/components/{select-option → select}/select-option.js +0 -0
- /package/dist/components/{select-option → select}/select-option.styles.js +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.component.d.ts +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.d.ts +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.js +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.styles.js +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.component.d.ts +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.component.js +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.styles.d.ts +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.styles.js +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.d.ts +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.d.ts +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.js +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.styles.js +0 -0
@@ -1,43 +1,47 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
|
-
const
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
const e = r`
|
3
|
+
@layer components {
|
4
|
+
@layer base {
|
5
|
+
:host {
|
6
|
+
--_skf-divider-border: var(--skf-border-width-sm) solid
|
7
|
+
var(--_skf-divider-border-color, var(--skf-border-color-primary));
|
7
8
|
|
8
|
-
|
9
|
+
display: block;
|
10
|
+
}
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
:host(:not([vertical])) {
|
13
|
+
border-top: var(--_skf-divider-border);
|
14
|
+
margin-block: var(--skf-divider-spacing, var(--skf-spacing-100));
|
15
|
+
margin-inline: var(--skf-divider-inset, 0);
|
16
|
+
}
|
14
17
|
}
|
15
|
-
}
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
@layer mods {
|
20
|
+
:host([vertical]) {
|
21
|
+
block-size: 100%;
|
22
|
+
border-left: var(--_skf-divider-border);
|
23
|
+
margin-block: var(--skf-divider-inset, 0);
|
24
|
+
margin-inline: var(--skf-divider-spacing, var(--skf-spacing-100));
|
25
|
+
}
|
23
26
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
}
|
27
|
+
:host([color='emphasised']) {
|
28
|
+
--_skf-divider-border-color: var(--skf-border-color-emphasised);
|
29
|
+
}
|
28
30
|
|
29
|
-
|
30
|
-
|
31
|
-
|
31
|
+
:host([color='inverse']) {
|
32
|
+
--_skf-divider-border-color: var(--skf-border-color-inverse);
|
33
|
+
}
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
-
|
35
|
+
:host([color='secondary']) {
|
36
|
+
--_skf-divider-border-color: var(--skf-border-color-secondary);
|
37
|
+
}
|
36
38
|
|
37
|
-
|
38
|
-
|
39
|
+
:host([color='tertiary']) {
|
40
|
+
--_skf-divider-border-color: var(--skf-border-color-tertiary);
|
41
|
+
}
|
42
|
+
}
|
39
43
|
}
|
40
44
|
`;
|
41
45
|
export {
|
42
|
-
|
46
|
+
e as styles
|
43
47
|
};
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import '../icon/icon.js';
|
2
|
+
import { SkfElement } from '../../internal/components/skf-element';
|
3
|
+
import { type CSSResultGroup } from 'lit';
|
4
|
+
/**
|
5
|
+
* TODO:
|
6
|
+
*
|
7
|
+
* - Fix drag outside closes the drawer
|
8
|
+
* - add tests
|
9
|
+
* - add documentation
|
10
|
+
*/
|
11
|
+
/**
|
12
|
+
* The `<skf-drawer>` is a modal component that displays content and toggle by sliding from left/right viewport edge
|
13
|
+
*
|
14
|
+
* @documentation See [zeroheight](https://zeroheight.com/853e936c9/p/0789c4-drawer) for design principles
|
15
|
+
*
|
16
|
+
* @event {CustomEvent} skf-drawer-opened - Fires when the drawer is opened (after transitioned in)
|
17
|
+
* @event {CustomEvent} skf-drawer-closing - Fires when the drawer is closing (before transitioned out)
|
18
|
+
* @event {CustomEvent} skf-drawer-closed - Fires when the drawer is closed (after transitioned out)
|
19
|
+
*
|
20
|
+
* @slot - The Drawer's main content
|
21
|
+
*
|
22
|
+
* @tagname skf-drawer
|
23
|
+
*/
|
24
|
+
export declare class SkfDrawer extends SkfElement {
|
25
|
+
static styles: CSSResultGroup;
|
26
|
+
/** @internal */
|
27
|
+
private _abortController?;
|
28
|
+
/** @internal */
|
29
|
+
private _signal?;
|
30
|
+
/** If defined, sets the aria-label for the close button */
|
31
|
+
closeButtonAriaLabel: string;
|
32
|
+
/** Heading for the Drawer */
|
33
|
+
heading?: string;
|
34
|
+
/** Sets the max-width */
|
35
|
+
size: 'sm' | 'md' | 'lg';
|
36
|
+
/** If true, Drawer is open */
|
37
|
+
open: boolean;
|
38
|
+
/** Placement of the Drawer */
|
39
|
+
placement: 'left' | 'right';
|
40
|
+
/** @internal */
|
41
|
+
$dialog: HTMLDialogElement;
|
42
|
+
disconnectedCallback(): void;
|
43
|
+
/** @internal */
|
44
|
+
_placementChanged: () => void;
|
45
|
+
/** @internal */
|
46
|
+
_openChanged(): Promise<void>;
|
47
|
+
/** @internal */
|
48
|
+
private _startListeners;
|
49
|
+
/** @internal */
|
50
|
+
private _clickIsInsideElement;
|
51
|
+
/** @internal */
|
52
|
+
private _animateDrawer;
|
53
|
+
/** @internal */
|
54
|
+
private _clickstartInDialog;
|
55
|
+
/** @internal */
|
56
|
+
private _handleMouseDown;
|
57
|
+
/** @internal */
|
58
|
+
private _handleMouseUp;
|
59
|
+
close(): void;
|
60
|
+
render(): import("lit").TemplateResult<1>;
|
61
|
+
}
|
@@ -0,0 +1,125 @@
|
|
1
|
+
import "../icon/icon.js";
|
2
|
+
import { SkfElement as m } from "../../internal/components/skf-element.js";
|
3
|
+
import { watch as d } from "../../internal/helpers/watch.js";
|
4
|
+
import { MOTION_DURATIONS as p } from "@skf-design-system/ui-assets";
|
5
|
+
import { componentStyles as f } from "../../styles/component.styles.js";
|
6
|
+
import { html as g } from "lit";
|
7
|
+
import { property as r, query as u } from "lit/decorators.js";
|
8
|
+
import { styles as _ } from "./drawer.styles.js";
|
9
|
+
var b = Object.defineProperty, w = Object.getOwnPropertyDescriptor, a = (h, t, i, e) => {
|
10
|
+
for (var o = e > 1 ? void 0 : e ? w(t, i) : t, n = h.length - 1, l; n >= 0; n--)
|
11
|
+
(l = h[n]) && (o = (e ? l(t, i, o) : l(o)) || o);
|
12
|
+
return e && o && b(t, i, o), o;
|
13
|
+
};
|
14
|
+
const c = class c extends m {
|
15
|
+
constructor() {
|
16
|
+
super(...arguments), this.closeButtonAriaLabel = "Close dialog", this.size = "md", this.open = !1, this.placement = "right", this._placementChanged = () => {
|
17
|
+
this.$dialog.getAnimations().forEach((i) => {
|
18
|
+
i.cancel();
|
19
|
+
});
|
20
|
+
}, this._clickstartInDialog = !1, this._handleMouseDown = (t) => {
|
21
|
+
this._clickIsInsideElement(t, this.$dialog) && (this._clickstartInDialog = !0);
|
22
|
+
}, this._handleMouseUp = () => {
|
23
|
+
if (this._clickstartInDialog) {
|
24
|
+
this._clickstartInDialog = !1;
|
25
|
+
return;
|
26
|
+
}
|
27
|
+
};
|
28
|
+
}
|
29
|
+
disconnectedCallback() {
|
30
|
+
var t;
|
31
|
+
super.disconnectedCallback(), (t = this._abortController) == null || t.abort();
|
32
|
+
}
|
33
|
+
async _openChanged() {
|
34
|
+
var t;
|
35
|
+
this.open ? (this._abortController = new AbortController(), this._signal = this._abortController.signal, this.$dialog.showModal(), this._startListeners(), await this._animateDrawer(), this.emit("skf-drawer-opened")) : ((t = this._abortController) == null || t.abort(), this.emit("skf-drawer-closing"), await this._animateDrawer(), this.emit("skf-drawer-closed"), this.$dialog.close());
|
36
|
+
}
|
37
|
+
/** @internal */
|
38
|
+
_startListeners() {
|
39
|
+
window.addEventListener(
|
40
|
+
"keydown",
|
41
|
+
(t) => {
|
42
|
+
t.key === "Escape" && (t.preventDefault(), this.close());
|
43
|
+
},
|
44
|
+
{ signal: this._signal }
|
45
|
+
), this.addEventListener("click", (t) => {
|
46
|
+
!this._clickIsInsideElement(t, this.$dialog) && !this._clickstartInDialog && this.close();
|
47
|
+
});
|
48
|
+
}
|
49
|
+
/** @internal */
|
50
|
+
_clickIsInsideElement(t, i) {
|
51
|
+
const e = i.getBoundingClientRect();
|
52
|
+
return e.top <= t.clientY && t.clientY <= e.top + e.height && e.left <= t.clientX && t.clientX <= e.left + e.width;
|
53
|
+
}
|
54
|
+
/** @internal */
|
55
|
+
_animateDrawer() {
|
56
|
+
const t = this.open ? [{ opacity: 0 }, { opacity: 0.4 }] : [{ opacity: 0 }], i = this.open ? [{ translate: "0" }] : [{ translate: this.placement === "right" ? "100%" : "-100%" }];
|
57
|
+
return new Promise((e) => {
|
58
|
+
requestAnimationFrame(() => {
|
59
|
+
const o = this.$dialog.animate(t, {
|
60
|
+
duration: p.normal,
|
61
|
+
fill: "forwards",
|
62
|
+
pseudoElement: "::backdrop"
|
63
|
+
}), n = this.$dialog.animate(i, {
|
64
|
+
duration: p.normal,
|
65
|
+
easing: "ease-out",
|
66
|
+
fill: "forwards"
|
67
|
+
});
|
68
|
+
Promise.all([o.finished, n.finished]).then(() => {
|
69
|
+
e("Animations finished");
|
70
|
+
}).catch(() => {
|
71
|
+
throw new Error("Animation failed");
|
72
|
+
});
|
73
|
+
});
|
74
|
+
});
|
75
|
+
}
|
76
|
+
close() {
|
77
|
+
this.open = !1;
|
78
|
+
}
|
79
|
+
render() {
|
80
|
+
return g`
|
81
|
+
<dialog @mousedown="${this._handleMouseDown}" @mouseup="${this._handleMouseUp}">
|
82
|
+
<header>
|
83
|
+
<h2>${this.heading}</h2>
|
84
|
+
<button
|
85
|
+
aria-label=${this.closeButtonAriaLabel}
|
86
|
+
id="close-button"
|
87
|
+
@click="${() => this.open = !1}"
|
88
|
+
>
|
89
|
+
<skf-icon name="close" color="inverse"></skf-icon>
|
90
|
+
</button>
|
91
|
+
</header>
|
92
|
+
<slot id="body" part="body">${this.slot}</slot>
|
93
|
+
</dialog>
|
94
|
+
`;
|
95
|
+
}
|
96
|
+
};
|
97
|
+
c.styles = [f, _];
|
98
|
+
let s = c;
|
99
|
+
a([
|
100
|
+
r({ attribute: "close-button-aria-label" })
|
101
|
+
], s.prototype, "closeButtonAriaLabel", 2);
|
102
|
+
a([
|
103
|
+
r()
|
104
|
+
], s.prototype, "heading", 2);
|
105
|
+
a([
|
106
|
+
r({ reflect: !0 })
|
107
|
+
], s.prototype, "size", 2);
|
108
|
+
a([
|
109
|
+
r({ type: Boolean, reflect: !0 })
|
110
|
+
], s.prototype, "open", 2);
|
111
|
+
a([
|
112
|
+
r({ reflect: !0 })
|
113
|
+
], s.prototype, "placement", 2);
|
114
|
+
a([
|
115
|
+
u("dialog")
|
116
|
+
], s.prototype, "$dialog", 2);
|
117
|
+
a([
|
118
|
+
d("placement", { waitUntilFirstUpdate: !0 })
|
119
|
+
], s.prototype, "_placementChanged", 2);
|
120
|
+
a([
|
121
|
+
d("open", { waitUntilFirstUpdate: !0, afterUpdate: !0 })
|
122
|
+
], s.prototype, "_openChanged", 1);
|
123
|
+
export {
|
124
|
+
s as SkfDrawer
|
125
|
+
};
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import { css as e } from "lit";
|
2
|
+
const o = e`
|
3
|
+
@layer components {
|
4
|
+
dialog {
|
5
|
+
all: unset;
|
6
|
+
background-color: var(--skf-bg-color-neutral-1);
|
7
|
+
display: none;
|
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;
|
14
|
+
|
15
|
+
&[open] {
|
16
|
+
display: flex;
|
17
|
+
|
18
|
+
&::backdrop {
|
19
|
+
background-color: var(--skf-bg-color-neutral-7);
|
20
|
+
opacity: 0.4;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
:host([placement='left']) & {
|
25
|
+
--_skf-drawer-inset: 0 auto;
|
26
|
+
|
27
|
+
translate: -100% 0;
|
28
|
+
}
|
29
|
+
|
30
|
+
:host([size='sm']) & {
|
31
|
+
--_skf-drawer-size: 400px;
|
32
|
+
}
|
33
|
+
|
34
|
+
:host([size='lg']) & {
|
35
|
+
--_skf-drawer-size: 680px;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
header {
|
40
|
+
align-items: center;
|
41
|
+
background-color: var(--skf-bg-color-emphasised);
|
42
|
+
block-size: var(--skf-size-48);
|
43
|
+
color: var(--skf-text-color-inverse);
|
44
|
+
display: flex;
|
45
|
+
justify-content: space-between;
|
46
|
+
padding-inline: var(--skf-box-spacing);
|
47
|
+
}
|
48
|
+
|
49
|
+
h2 {
|
50
|
+
font-size: var(--skf-font-size-200);
|
51
|
+
}
|
52
|
+
|
53
|
+
#close-button {
|
54
|
+
display: inline-flex;
|
55
|
+
|
56
|
+
&:focus-visible {
|
57
|
+
border-radius: var(--skf-border-radius-sm);
|
58
|
+
outline: var(--skf-border-width-sm) solid var(--skf-interactive-text-color-inverse);
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
#body {
|
63
|
+
display: block;
|
64
|
+
flex: auto;
|
65
|
+
padding: var(--skf-box-spacing);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
`;
|
69
|
+
export {
|
70
|
+
o as styles
|
71
|
+
};
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import '../button/button.js';
|
2
|
+
import '../drawer/drawer.js';
|
3
|
+
import '../logo/logo.js';
|
4
|
+
import { SkfElement } from '../../internal/components/skf-element';
|
5
|
+
import { type CSSResultGroup } from 'lit';
|
6
|
+
/**
|
7
|
+
* 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.
|
8
|
+
*
|
9
|
+
* @documentation See [zeroheight](https://zeroheight.com/****) for design principles
|
10
|
+
*
|
11
|
+
* @slot - Navigation items
|
12
|
+
*
|
13
|
+
* @tagname skf-header
|
14
|
+
*/
|
15
|
+
export declare class SkfHeader extends SkfElement {
|
16
|
+
static styles: CSSResultGroup;
|
17
|
+
/** @internal */
|
18
|
+
private _dynamicBreakpoint?;
|
19
|
+
/** @internal */
|
20
|
+
private _widthObserver?;
|
21
|
+
/** If true, sets header to display in compact mode only (hanburger menu and drawer) */
|
22
|
+
set compact(value: boolean);
|
23
|
+
get compact(): boolean;
|
24
|
+
/** If defined, sets the aria-label for the hamburger button */
|
25
|
+
hamburgerAriaLabel: string;
|
26
|
+
/** If defined, sets the app or site's name */
|
27
|
+
siteName?: string;
|
28
|
+
/** If defined, sets the site's base-url for the "logo-link" */
|
29
|
+
siteUrl?: string;
|
30
|
+
/** @internal */
|
31
|
+
isCompact: boolean;
|
32
|
+
/** @internal */
|
33
|
+
private openDrawer;
|
34
|
+
/** @internal */
|
35
|
+
private nav;
|
36
|
+
/** @internal */
|
37
|
+
private $navWrapper;
|
38
|
+
firstUpdated(): void;
|
39
|
+
/** @internal */
|
40
|
+
private _observeHostWidth;
|
41
|
+
/** @internal */
|
42
|
+
private _observeNavContainer;
|
43
|
+
/** @internal */
|
44
|
+
private _renderMeta;
|
45
|
+
render(): import("lit").TemplateResult<1>;
|
46
|
+
}
|
@@ -0,0 +1,116 @@
|
|
1
|
+
import "../button/button.js";
|
2
|
+
import "../drawer/drawer.js";
|
3
|
+
import "../logo/logo.js";
|
4
|
+
import { SkfElement as d } from "../../internal/components/skf-element.js";
|
5
|
+
import { componentStyles as b } from "../../styles/component.styles.js";
|
6
|
+
import { nothing as u, html as o } from "lit";
|
7
|
+
import { property as s, state as f, queryAssignedElements as w, query as _ } from "lit/decorators.js";
|
8
|
+
import { ifDefined as m } from "lit/directives/if-defined.js";
|
9
|
+
import { literal as v, html as y } from "lit/static-html.js";
|
10
|
+
import { styles as $ } from "./header.styles.js";
|
11
|
+
var g = Object.defineProperty, C = Object.getOwnPropertyDescriptor, r = (c, e, n, a) => {
|
12
|
+
for (var i = a > 1 ? void 0 : a ? C(e, n) : e, p = c.length - 1, h; p >= 0; p--)
|
13
|
+
(h = c[p]) && (i = (a ? h(e, n, i) : h(i)) || i);
|
14
|
+
return a && i && g(e, n, i), i;
|
15
|
+
};
|
16
|
+
const l = class l extends d {
|
17
|
+
constructor() {
|
18
|
+
super(...arguments), this.hamburgerAriaLabel = "Show navigation", this.isCompact = !1, this.openDrawer = !1;
|
19
|
+
}
|
20
|
+
set compact(e) {
|
21
|
+
this.isCompact = e;
|
22
|
+
}
|
23
|
+
get compact() {
|
24
|
+
return this.isCompact;
|
25
|
+
}
|
26
|
+
firstUpdated() {
|
27
|
+
this.updateComplete.then(() => {
|
28
|
+
if (this.compact) {
|
29
|
+
this.isCompact = !0, this.nav[0].vertical = !0;
|
30
|
+
return;
|
31
|
+
}
|
32
|
+
this._observeHostWidth();
|
33
|
+
}).catch(console.error);
|
34
|
+
}
|
35
|
+
/** @internal */
|
36
|
+
_observeHostWidth() {
|
37
|
+
this._widthObserver = new ResizeObserver(() => {
|
38
|
+
var e;
|
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());
|
40
|
+
}), this._widthObserver.observe(this);
|
41
|
+
}
|
42
|
+
/** @internal */
|
43
|
+
_observeNavContainer() {
|
44
|
+
this._widthObserver = new ResizeObserver(() => {
|
45
|
+
var e;
|
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());
|
47
|
+
}), this._widthObserver.observe(this.$navWrapper);
|
48
|
+
}
|
49
|
+
/** @internal */
|
50
|
+
_renderMeta() {
|
51
|
+
const e = this.siteUrl ? v`a` : v`div`;
|
52
|
+
return y`
|
53
|
+
<${e} href=${m(this.siteUrl)} id="meta">
|
54
|
+
<skf-logo color="inverse"></skf-logo>
|
55
|
+
${this.siteName ? o`<h2>${this.siteName}</h2>` : u}
|
56
|
+
</${e}>
|
57
|
+
`;
|
58
|
+
}
|
59
|
+
render() {
|
60
|
+
return o`
|
61
|
+
<header role="banner">
|
62
|
+
${this._renderMeta()}
|
63
|
+
<div id="nav-wrapper">
|
64
|
+
${this.isCompact ? o`
|
65
|
+
<button
|
66
|
+
@click=${() => this.openDrawer = !this.openDrawer}
|
67
|
+
aria-controls="drawer"
|
68
|
+
aria-expanded=${this.openDrawer}
|
69
|
+
aria-label=${this.hamburgerAriaLabel}
|
70
|
+
>
|
71
|
+
<skf-icon color="inverse" name="hamburgerMenu" size="lg"></skf-icon>
|
72
|
+
</button>
|
73
|
+
<skf-drawer
|
74
|
+
?open=${this.openDrawer}
|
75
|
+
@close=${() => this.openDrawer = !1}
|
76
|
+
heading=${m(this.siteName)}
|
77
|
+
id="drawer"
|
78
|
+
placement="right"
|
79
|
+
>
|
80
|
+
<slot></slot>
|
81
|
+
</skf-drawer>
|
82
|
+
` : o`<slot></slot>`}
|
83
|
+
</div>
|
84
|
+
</header>
|
85
|
+
`;
|
86
|
+
}
|
87
|
+
};
|
88
|
+
l.styles = [b, $];
|
89
|
+
let t = l;
|
90
|
+
r([
|
91
|
+
s({ type: Boolean, reflect: !0 })
|
92
|
+
], t.prototype, "compact", 1);
|
93
|
+
r([
|
94
|
+
s({ attribute: "hamburger-aria-label" })
|
95
|
+
], t.prototype, "hamburgerAriaLabel", 2);
|
96
|
+
r([
|
97
|
+
s({ attribute: "site-name" })
|
98
|
+
], t.prototype, "siteName", 2);
|
99
|
+
r([
|
100
|
+
s({ attribute: "site-url" })
|
101
|
+
], t.prototype, "siteUrl", 2);
|
102
|
+
r([
|
103
|
+
s({ type: Boolean, reflect: !0, state: !0, attribute: "is-compact" })
|
104
|
+
], t.prototype, "isCompact", 2);
|
105
|
+
r([
|
106
|
+
f()
|
107
|
+
], t.prototype, "openDrawer", 2);
|
108
|
+
r([
|
109
|
+
w({ selector: "skf-nav" })
|
110
|
+
], t.prototype, "nav", 2);
|
111
|
+
r([
|
112
|
+
_("#nav-wrapper")
|
113
|
+
], t.prototype, "$navWrapper", 2);
|
114
|
+
export {
|
115
|
+
t as SkfHeader
|
116
|
+
};
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import { css as e } from "lit";
|
2
|
+
const a = e`
|
3
|
+
@layer components {
|
4
|
+
:host {
|
5
|
+
--skf-header-height: 60px;
|
6
|
+
}
|
7
|
+
|
8
|
+
header {
|
9
|
+
align-items: center;
|
10
|
+
background-color: var(--skf-bg-color-emphasised);
|
11
|
+
block-size: var(--skf-header-height);
|
12
|
+
display: flex;
|
13
|
+
gap: var(--skf-spacing-125);
|
14
|
+
justify-content: space-between;
|
15
|
+
padding-inline: var(--skf-spacing-100);
|
16
|
+
}
|
17
|
+
|
18
|
+
#meta {
|
19
|
+
align-items: inherit;
|
20
|
+
color: var(--skf-text-color-inverse);
|
21
|
+
display: inherit;
|
22
|
+
gap: var(--skf-spacing-100);
|
23
|
+
|
24
|
+
&:is(a) {
|
25
|
+
text-decoration: none;
|
26
|
+
}
|
27
|
+
|
28
|
+
:host(:not([is-compact])) &:has(h2)::after {
|
29
|
+
align-self: normal;
|
30
|
+
border-right: 1px solid var(--skf-border-color-inverse);
|
31
|
+
content: '';
|
32
|
+
display: block;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
h2 {
|
37
|
+
font-size: var(--skf-font-size-200);
|
38
|
+
font-weight: var(--skf-font-weight-regular);
|
39
|
+
white-space: nowrap;
|
40
|
+
}
|
41
|
+
|
42
|
+
#nav-wrapper:has(skf-drawer) {
|
43
|
+
display: inline-flex; /** Shrink-wrap icon-button */
|
44
|
+
}
|
45
|
+
|
46
|
+
#nav-wrapper:not(:has(skf-drawer)) {
|
47
|
+
overflow: hidden;
|
48
|
+
}
|
49
|
+
|
50
|
+
skf-drawer::part(body) {
|
51
|
+
background-color: var(--skf-bg-color-emphasised);
|
52
|
+
padding: 0;
|
53
|
+
}
|
54
|
+
|
55
|
+
button {
|
56
|
+
color: var(--_skf-header-button-color, var(--skf-interactive-text-color-inverse));
|
57
|
+
display: inline-flex;
|
58
|
+
|
59
|
+
&:focus-visible {
|
60
|
+
border-radius: var(--skf-border-radius-sm);
|
61
|
+
outline: var(--skf-border-width-sm) solid var(--skf-interactive-text-color-inverse);
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
`;
|
66
|
+
export {
|
67
|
+
a as styles
|
68
|
+
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { SkfElement } from '../../internal/components/skf-element.js';
|
2
|
-
import type { HeadingType } from '../../internal/
|
2
|
+
import type { HeadingType } from '../../internal/types.js';
|
3
3
|
import { type CSSResultGroup } from 'lit';
|
4
4
|
/**
|
5
5
|
* The `<Heading>` component is to deliniate content on a page. When using, take note not to skip heading levels.<br>
|
@@ -11,17 +11,9 @@ import { type CSSResultGroup } from 'lit';
|
|
11
11
|
*/
|
12
12
|
export declare class SkfHeading extends SkfElement {
|
13
13
|
static styles: CSSResultGroup;
|
14
|
-
/**
|
15
|
-
* Controls which heading element will be rendered. Should not be used to affect appearance
|
16
|
-
*
|
17
|
-
* @type { "h1" | "h2" | "h3" | "h4" }
|
18
|
-
*/
|
14
|
+
/** Controls which heading element will be rendered. Should not be used to affect appearance */
|
19
15
|
as: HeadingType;
|
20
|
-
/**
|
21
|
-
* If provided, changes the appearance of the heading
|
22
|
-
*
|
23
|
-
* @type { "h1" | "h2" | "h3" | "h4" }
|
24
|
-
*/
|
16
|
+
/** If defined, changes the appearance of the heading */
|
25
17
|
styledAs?: HeadingType;
|
26
18
|
render(): import("lit").TemplateResult;
|
27
19
|
}
|