@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
package/README.md
CHANGED
@@ -87,10 +87,16 @@ How you get started using our components is of course a bit different depending
|
|
87
87
|
|
88
88
|
In order for our components to work as intended you need to import our global styles where appropiate e.g. App.tsx.
|
89
89
|
|
90
|
-
```
|
90
|
+
```ts
|
91
91
|
import '@skf-design-system/ui-components/styles/global.css';
|
92
92
|
```
|
93
93
|
|
94
|
+
If you want to handle the loading of the SKF fonts yourself, you can use the alternative global css file:
|
95
|
+
|
96
|
+
```ts
|
97
|
+
import '@skf-design-system/ui-components/styles/global-alt.css';
|
98
|
+
```
|
99
|
+
|
94
100
|
### Angular
|
95
101
|
|
96
102
|
In order for our components to get the correct styling you need add our global styling to your project. In angular you can do that in the angular.json like this:
|
@@ -345,6 +351,24 @@ Checklist:
|
|
345
351
|
|
346
352
|
</details>
|
347
353
|
|
354
|
+
## Known inconsistencies coming from the React library and v1 Web Components
|
355
|
+
|
356
|
+
Our focus going forward is on the v2 package of Web Components (new brand design) and as our bandwidth is limited work done to the v1 Web Compnent library will be very limited.
|
357
|
+
|
358
|
+
| React Component | WC v1 - Solution |
|
359
|
+
| --------------- | ----------------------------------------------------------------------------- |
|
360
|
+
| IconButton | Use `skf-link` without text or `skf-button` variant tertiary, without a label |
|
361
|
+
| Search | Search is now a variant of `skf-input` |
|
362
|
+
| Image | Was deemed not adding value over the native `picture`/`img` tag |
|
363
|
+
| Paragraph | Was deemed not adding value over the native p tag |
|
364
|
+
| useTooltip | Not needed, `skf-tooltip` handles it common state internally |
|
365
|
+
| usePopup | Renamed `skf-popover`, no need for a hook |
|
366
|
+
| EmptyState | Missing but easy to copy svg from React and recreate |
|
367
|
+
| SkfUiProvider | Not needed, you add our global css as mentioned above |
|
368
|
+
| ToastProvider | `skf-toast` handles its own internal state, no provider needed |
|
369
|
+
| ts tokens | The global css contains all tokens as css custom vars which should suffice |
|
370
|
+
| Missing tokens | A few tokens are missing. Report as issue but expect to create your own |
|
371
|
+
|
348
372
|
## 🧑⚖️ License
|
349
373
|
|
350
374
|
Copyright SKF 2024
|
@@ -1,17 +1,17 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
|
-
import { SkfElement as
|
3
|
-
import { componentStyles as
|
4
|
-
import { property as
|
5
|
-
import { classMap as
|
6
|
-
import { ifDefined as
|
7
|
-
import { literal as
|
2
|
+
import { SkfElement as p } from "../../internal/components/skf-element.js";
|
3
|
+
import { componentStyles as m } from "../../styles/component.styles.js";
|
4
|
+
import { property as i } from "lit/decorators.js";
|
5
|
+
import { classMap as h } from "lit/directives/class-map.js";
|
6
|
+
import { ifDefined as u } from "lit/directives/if-defined.js";
|
7
|
+
import { literal as r, html as f } from "lit/static-html.js";
|
8
8
|
import { styles as _ } from "./accordion-item.styles.js";
|
9
|
-
var
|
10
|
-
for (var
|
11
|
-
(
|
12
|
-
return
|
9
|
+
var g = Object.defineProperty, s = (d, e, c, y) => {
|
10
|
+
for (var a = void 0, o = d.length - 1, l; o >= 0; o--)
|
11
|
+
(l = d[o]) && (a = l(e, c, a) || a);
|
12
|
+
return a && g(e, c, a), a;
|
13
13
|
};
|
14
|
-
const n = class n extends
|
14
|
+
const n = class n extends p {
|
15
15
|
constructor() {
|
16
16
|
super(...arguments), this.animated = !1, this.expanded = !1, this.headingAs = "h2", this.small = !1, this.truncate = !1, this._toggle = () => {
|
17
17
|
this.dispatchEvent(
|
@@ -32,27 +32,38 @@ const n = class n extends l {
|
|
32
32
|
this.expanded = !0;
|
33
33
|
}
|
34
34
|
render() {
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
let e;
|
36
|
+
switch (!0) {
|
37
|
+
case this.headingAs === "h3":
|
38
|
+
e = r`h3`;
|
39
|
+
break;
|
40
|
+
case this.headingAs === "h4":
|
41
|
+
e = r`h4`;
|
42
|
+
break;
|
43
|
+
default:
|
44
|
+
e = r`h2`;
|
45
|
+
break;
|
46
|
+
}
|
47
|
+
return f`
|
48
|
+
<div class=${h({
|
38
49
|
"accordion-item": !0,
|
39
50
|
"accordion-item--animated": this.animated,
|
40
51
|
"accordion-item--expanded": this.expanded,
|
41
52
|
"accordion-item--small": this.small,
|
42
53
|
"accordion-item--truncate": this.truncate
|
43
54
|
})}>
|
44
|
-
<${
|
55
|
+
<${e} class="accordion-item__heading">
|
45
56
|
<button
|
46
57
|
@click=${this._toggle}
|
47
58
|
aria-controls="main"
|
48
|
-
aria-expanded=${
|
59
|
+
aria-expanded=${u(this.expanded ? "true" : "false")}
|
49
60
|
class="accordion-item__btn"
|
50
61
|
type="button"
|
51
62
|
>
|
52
63
|
<span class="accordion-item__label">${this.heading}</span>
|
53
64
|
<skf-icon class="accordion-item__icon" name=${this.expanded ? "caretUp" : "caretDown"}></skf-icon>
|
54
65
|
</button>
|
55
|
-
</${
|
66
|
+
</${e}>
|
56
67
|
<div class="accordion-item__body">
|
57
68
|
<div class="accordion-item__main" data-testid="main" id="main">
|
58
69
|
<slot></slot>
|
@@ -62,26 +73,26 @@ const n = class n extends l {
|
|
62
73
|
`;
|
63
74
|
}
|
64
75
|
};
|
65
|
-
n.styles = [
|
66
|
-
let
|
67
|
-
|
68
|
-
|
69
|
-
],
|
70
|
-
|
71
|
-
|
72
|
-
],
|
73
|
-
|
74
|
-
|
75
|
-
],
|
76
|
-
|
77
|
-
|
78
|
-
],
|
79
|
-
|
80
|
-
|
81
|
-
],
|
82
|
-
|
83
|
-
|
84
|
-
],
|
76
|
+
n.styles = [m, _];
|
77
|
+
let t = n;
|
78
|
+
s([
|
79
|
+
i({ type: Boolean, reflect: !0 })
|
80
|
+
], t.prototype, "animated");
|
81
|
+
s([
|
82
|
+
i({ type: Boolean, reflect: !0 })
|
83
|
+
], t.prototype, "expanded");
|
84
|
+
s([
|
85
|
+
i()
|
86
|
+
], t.prototype, "heading");
|
87
|
+
s([
|
88
|
+
i({ attribute: "heading-as" })
|
89
|
+
], t.prototype, "headingAs");
|
90
|
+
s([
|
91
|
+
i({ type: Boolean, reflect: !0 })
|
92
|
+
], t.prototype, "small");
|
93
|
+
s([
|
94
|
+
i({ type: Boolean, reflect: !0 })
|
95
|
+
], t.prototype, "truncate");
|
85
96
|
export {
|
86
|
-
|
97
|
+
t as SkfAccordionItem
|
87
98
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { SkfElement } from '../../internal/components/skf-element.js';
|
2
2
|
import { type CSSResultGroup, type PropertyValues } from 'lit';
|
3
|
-
import type { SkfAccordionItemHeadingType } from './accordion-item.js';
|
3
|
+
import type { SkfAccordionItemHeadingType } from './accordion-item.component.js';
|
4
4
|
/**
|
5
5
|
* The `<skf-accordion>` component consists of one or more `<skf-accordion-item>` item(s) working together
|
6
6
|
*
|
@@ -25,7 +25,7 @@ export declare class SkfAccordion extends SkfElement {
|
|
25
25
|
/** If true, will truncate all headings in collapsed state */
|
26
26
|
truncate: boolean;
|
27
27
|
/** @internal */
|
28
|
-
private
|
28
|
+
private _accordionItems;
|
29
29
|
protected updated(_changedProperties: PropertyValues): void;
|
30
30
|
/** @internal */
|
31
31
|
private get items();
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { SkfElement as p } from "../../internal/components/skf-element.js";
|
2
|
-
import { componentStyles as
|
3
|
-
import { html as
|
2
|
+
import { componentStyles as m } from "../../styles/component.styles.js";
|
3
|
+
import { html as f } from "lit";
|
4
4
|
import { property as a, queryAssignedNodes as d } from "lit/decorators.js";
|
5
5
|
import { classMap as c } from "lit/directives/class-map.js";
|
6
6
|
import { styles as g } from "./accordion.styles.js";
|
7
|
-
var y = Object.defineProperty, s = (u, t, i,
|
8
|
-
for (var r = void 0,
|
9
|
-
(h = u[
|
7
|
+
var y = Object.defineProperty, s = (u, t, i, o) => {
|
8
|
+
for (var r = void 0, l = u.length - 1, h; l >= 0; l--)
|
9
|
+
(h = u[l]) && (r = h(t, i, r) || r);
|
10
10
|
return r && y(t, i, r), r;
|
11
11
|
};
|
12
12
|
const n = class n extends p {
|
@@ -22,20 +22,20 @@ const n = class n extends p {
|
|
22
22
|
}
|
23
23
|
/** @internal */
|
24
24
|
get items() {
|
25
|
-
return [...this
|
25
|
+
return [...this._accordionItems].filter((t) => t.localName === "skf-accordion-item");
|
26
26
|
}
|
27
27
|
_onChildToggle(t) {
|
28
28
|
if (this.multiple || t.defaultPrevented) return;
|
29
29
|
const i = t.target;
|
30
|
-
this.items.length && this.items.forEach((
|
31
|
-
|
30
|
+
this.items.length && this.items.forEach((o) => {
|
31
|
+
o !== i && o.hasAttribute("expanded") && o.setClose();
|
32
32
|
});
|
33
33
|
}
|
34
34
|
render() {
|
35
|
-
return
|
35
|
+
return f`
|
36
36
|
<div class=${c({ "accordion--gap": this.gap })}>
|
37
37
|
<slot
|
38
|
-
@skf-
|
38
|
+
@skf-accordion-item-toggle=${(t) => {
|
39
39
|
this._onChildToggle(t);
|
40
40
|
}}
|
41
41
|
@slotchange=${this._setItemAttributes}
|
@@ -44,7 +44,7 @@ const n = class n extends p {
|
|
44
44
|
`;
|
45
45
|
}
|
46
46
|
};
|
47
|
-
n.styles = [g,
|
47
|
+
n.styles = [g, m];
|
48
48
|
let e = n;
|
49
49
|
s([
|
50
50
|
a({ type: Boolean, reflect: !0 })
|
@@ -66,7 +66,7 @@ s([
|
|
66
66
|
], e.prototype, "truncate");
|
67
67
|
s([
|
68
68
|
d()
|
69
|
-
], e.prototype, "
|
69
|
+
], e.prototype, "_accordionItems");
|
70
70
|
export {
|
71
71
|
e as SkfAccordion
|
72
72
|
};
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import '../icon/icon.js';
|
2
2
|
import { SkfElement } from '../../internal/components/skf-element.js';
|
3
3
|
import type { Icon, Severity } from '../../internal/types.js';
|
4
|
+
import { type Language } from '../../utilities/localize.js';
|
4
5
|
import { type CSSResultGroup } from 'lit';
|
5
6
|
/**
|
6
7
|
* The `<skf-alert>` is a type of notification that appears in-line
|
7
8
|
*
|
8
9
|
* See [zeroheight](https://zeroheight.com/853e936c9/p/990ec5-alert) for design principles
|
9
10
|
*
|
10
|
-
* @event skf-alert-close - Fires when the close button is clicked
|
11
|
+
* @event {CustomEvent} skf-alert-close - Fires when the close button is clicked
|
11
12
|
*
|
12
13
|
* @slot - Alert message. **Notice!** See design principles for approved content
|
13
14
|
* @slot link - Slot for the link
|
@@ -15,15 +16,19 @@ import { type CSSResultGroup } from 'lit';
|
|
15
16
|
* @tagname skf-alert
|
16
17
|
*/
|
17
18
|
export declare class SkfAlert extends SkfElement {
|
19
|
+
#private;
|
18
20
|
static styles: CSSResultGroup;
|
19
|
-
/** Close button aria-label */
|
20
|
-
buttonLabel: string;
|
21
21
|
/** If defined, displays leading icon */
|
22
22
|
icon?: Icon;
|
23
|
+
/** Sets the internal language of the component */
|
24
|
+
lang: Language;
|
23
25
|
/** If true, renders with an close button and sets aria-role to `status` */
|
24
26
|
persistent: boolean;
|
25
27
|
/** If defined, gives the supplied appearance */
|
26
28
|
severity?: Severity;
|
29
|
+
connectedCallback(): void;
|
30
|
+
/** @internal */
|
31
|
+
_handleStateChange(): void;
|
27
32
|
/** @internal */
|
28
33
|
private _handleClose;
|
29
34
|
render(): import("lit").TemplateResult<1>;
|
@@ -1,73 +1,82 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import { componentStyles as y } from "../../styles/component.styles.js";
|
4
|
-
import { nothing as h, html as p } from "lit";
|
5
|
-
import { property as s } from "lit/decorators.js";
|
6
|
-
import { classMap as u } from "lit/directives/class-map.js";
|
7
|
-
import { ifDefined as m } from "lit/directives/if-defined.js";
|
8
|
-
import { styles as v } from "./alert.styles.js";
|
9
|
-
var b = Object.defineProperty, r = (n, l, a, d) => {
|
10
|
-
for (var t = void 0, i = n.length - 1, c; i >= 0; i--)
|
11
|
-
(c = n[i]) && (t = c(l, a, t) || t);
|
12
|
-
return t && b(l, a, t), t;
|
1
|
+
var u = (t) => {
|
2
|
+
throw TypeError(t);
|
13
3
|
};
|
14
|
-
|
4
|
+
var g = (t, e, s) => e.has(t) || u("Cannot " + s);
|
5
|
+
var c = (t, e, s) => (g(t, e, "read from private field"), s ? s.call(t) : e.get(t)), h = (t, e, s) => e.has(t) ? u("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), m = (t, e, s, o) => (g(t, e, "write to private field"), o ? o.call(t, s) : e.set(t, s), s);
|
6
|
+
import "../icon/icon.js";
|
7
|
+
import { SkfElement as C } from "../../internal/components/skf-element.js";
|
8
|
+
import { stateMap as w } from "../../internal/helpers/stateMap.js";
|
9
|
+
import { watch as S } from "../../internal/helpers/watch.js";
|
10
|
+
import { componentStyles as $ } from "../../styles/component.styles.js";
|
11
|
+
import { LocalizeController as z } from "../../utilities/localize.js";
|
12
|
+
import { nothing as O, html as b } from "lit";
|
13
|
+
import { property as f } from "lit/decorators.js";
|
14
|
+
import { ifDefined as _ } from "lit/directives/if-defined.js";
|
15
|
+
import { styles as P } from "./alert.styles.js";
|
16
|
+
var k = Object.defineProperty, D = Object.getOwnPropertyDescriptor, p = (t, e, s, o) => {
|
17
|
+
for (var i = o > 1 ? void 0 : o ? D(e, s) : e, y = t.length - 1, d; y >= 0; y--)
|
18
|
+
(d = t[y]) && (i = (o ? d(e, s, i) : d(i)) || i);
|
19
|
+
return o && i && k(e, s, i), i;
|
20
|
+
}, n, a, l;
|
21
|
+
const v = class v extends C {
|
15
22
|
constructor() {
|
16
|
-
super(...arguments)
|
23
|
+
super(...arguments);
|
24
|
+
h(this, n);
|
25
|
+
h(this, a);
|
26
|
+
h(this, l);
|
27
|
+
m(this, n, new z(this)), m(this, a, this.attachInternals()), m(this, l, c(this, a).states), this.lang = "en", this.persistent = !1, this._handleClose = () => {
|
17
28
|
this.emit("skf-alert-close");
|
18
29
|
};
|
19
30
|
}
|
31
|
+
connectedCallback() {
|
32
|
+
super.connectedCallback(), this.role = this.persistent ? "status" : "alert";
|
33
|
+
}
|
34
|
+
_handleStateChange() {
|
35
|
+
const s = ["error", "info", "success", "warning"];
|
36
|
+
w(c(this, l), s).set(this.severity);
|
37
|
+
}
|
20
38
|
render() {
|
21
|
-
return
|
22
|
-
<div
|
23
|
-
aria-describedby="main"
|
24
|
-
class=${u({
|
25
|
-
alert: !0,
|
26
|
-
"alert--severity-error": this.severity === "error",
|
27
|
-
"alert--severity-info": this.severity === "info",
|
28
|
-
"alert--severity-success": this.severity === "success",
|
29
|
-
"alert--severity-warning": this.severity === "warning",
|
30
|
-
[this.className]: !0
|
31
|
-
})}
|
32
|
-
role=${this.persistent ? "status" : "alert"}
|
33
|
-
>
|
39
|
+
return b`
|
40
|
+
<div id="root">
|
34
41
|
<skf-icon
|
35
|
-
color=${
|
36
|
-
name=${
|
42
|
+
color=${_(this.severity ?? "secondary")}
|
43
|
+
name=${_(this.icon ?? "info")}
|
37
44
|
size="sm"
|
38
45
|
></skf-icon>
|
39
|
-
<div
|
40
|
-
<slot
|
46
|
+
<div id="body">
|
47
|
+
<slot id="main"></slot>
|
41
48
|
<slot name="link"></slot>
|
42
49
|
</div>
|
43
|
-
${this.persistent ?
|
50
|
+
${this.persistent ? b`
|
44
51
|
<button
|
45
52
|
@click="${this._handleClose}"
|
46
|
-
aria-label=${this.
|
47
|
-
class="alert__btn"
|
53
|
+
aria-label=${c(this, n).term("close")}
|
48
54
|
type="button"
|
49
55
|
>
|
50
56
|
<skf-icon name="close" size="sm"></skf-icon>
|
51
57
|
</button>
|
52
|
-
` :
|
58
|
+
` : O}
|
53
59
|
</div>
|
54
60
|
`;
|
55
61
|
}
|
56
62
|
};
|
57
|
-
|
58
|
-
let
|
59
|
-
|
60
|
-
|
61
|
-
],
|
62
|
-
|
63
|
-
|
64
|
-
],
|
65
|
-
|
66
|
-
|
67
|
-
],
|
68
|
-
|
69
|
-
|
70
|
-
],
|
63
|
+
n = new WeakMap(), a = new WeakMap(), l = new WeakMap(), v.styles = [$, P];
|
64
|
+
let r = v;
|
65
|
+
p([
|
66
|
+
f({ type: String })
|
67
|
+
], r.prototype, "icon", 2);
|
68
|
+
p([
|
69
|
+
f({ type: String })
|
70
|
+
], r.prototype, "lang", 2);
|
71
|
+
p([
|
72
|
+
f({ type: Boolean })
|
73
|
+
], r.prototype, "persistent", 2);
|
74
|
+
p([
|
75
|
+
f({ type: String })
|
76
|
+
], r.prototype, "severity", 2);
|
77
|
+
p([
|
78
|
+
S("severity")
|
79
|
+
], r.prototype, "_handleStateChange", 1);
|
71
80
|
export {
|
72
|
-
|
81
|
+
r as SkfAlert
|
73
82
|
};
|
@@ -1,63 +1,67 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
2
|
const s = r`
|
3
|
-
/* stylelint-disable selector-class-pattern */
|
4
3
|
@layer components {
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
@layer base {
|
5
|
+
:host {
|
6
|
+
contain: layout;
|
7
|
+
}
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
var(--_skf-alert-border-color, var(--skf-border-color-primary));
|
13
|
-
border-radius: var(--skf-border-radius-sm);
|
14
|
-
box-shadow: var(--skf-shadow-md);
|
15
|
-
display: flex;
|
16
|
-
font-size: var(--skf-font-size-75);
|
17
|
-
gap: var(--skf-spacing-50);
|
18
|
-
padding-block: var(--skf-spacing-75);
|
19
|
-
padding-inline: var(--skf-spacing-50);
|
20
|
-
}
|
9
|
+
#root {
|
10
|
+
--_skf-alert-bg-color: var(--skf-bg-color-neutral-2);
|
11
|
+
--_skf-alert-border-color: var(--skf-border-color-primary);
|
21
12
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
13
|
+
background-color: var(--_skf-alert-bg-color);
|
14
|
+
border: var(--skf-border-width-sm) solid var(--_skf-alert-border-color);
|
15
|
+
border-radius: var(--skf-border-radius-sm);
|
16
|
+
box-shadow: var(--skf-shadow-md);
|
17
|
+
display: flex;
|
18
|
+
font-size: var(--skf-font-size-75);
|
19
|
+
gap: var(--skf-spacing-50);
|
20
|
+
padding-block: var(--skf-spacing-75);
|
21
|
+
padding-inline: var(--skf-spacing-50);
|
22
|
+
}
|
26
23
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
24
|
+
#body {
|
25
|
+
display: flex;
|
26
|
+
flex: auto;
|
27
|
+
flex-wrap: wrap;
|
28
|
+
gap: var(--skf-spacing-25) var(--skf-spacing-100);
|
29
|
+
justify-content: space-between;
|
30
|
+
}
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
}
|
32
|
+
#main {
|
33
|
+
display: block;
|
34
|
+
}
|
36
35
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
}
|
36
|
+
button {
|
37
|
+
display: inline-flex;
|
38
|
+
}
|
41
39
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
flex-wrap: wrap;
|
46
|
-
gap: var(--skf-spacing-25) var(--skf-spacing-100);
|
47
|
-
justify-content: space-between;
|
40
|
+
::slotted(skf-link) {
|
41
|
+
text-transform: uppercase;
|
42
|
+
}
|
48
43
|
}
|
49
44
|
|
50
|
-
|
51
|
-
|
52
|
-
|
45
|
+
@layer mods {
|
46
|
+
:host(:state(error)) #root {
|
47
|
+
--_skf-alert-bg-color: var(--skf-severity-bg-color-error);
|
48
|
+
--_skf-alert-border-color: var(--skf-severity-fg-color-error);
|
49
|
+
}
|
53
50
|
|
54
|
-
|
55
|
-
|
56
|
-
|
51
|
+
:host(:state(info)) #root {
|
52
|
+
--_skf-alert-bg-color: var(--skf-severity-bg-color-info);
|
53
|
+
--_skf-alert-border-color: var(--skf-severity-fg-color-info);
|
54
|
+
}
|
55
|
+
|
56
|
+
:host(:state(success)) #root {
|
57
|
+
--_skf-alert-bg-color: var(--skf-severity-bg-color-success);
|
58
|
+
--_skf-alert-border-color: var(--skf-severity-fg-color-success);
|
59
|
+
}
|
57
60
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
+
:host(:state(warning)) #root {
|
62
|
+
--_skf-alert-bg-color: var(--skf-severity-bg-color-warning);
|
63
|
+
--_skf-alert-border-color: var(--skf-severity-fg-color-warning);
|
64
|
+
}
|
61
65
|
}
|
62
66
|
}
|
63
67
|
`;
|
@@ -1,21 +1,19 @@
|
|
1
1
|
import "../icon/icon.js";
|
2
|
-
import { SkfElement as
|
3
|
-
import { componentStyles as
|
4
|
-
import { html as
|
5
|
-
import { property as
|
6
|
-
import {
|
7
|
-
import { ifDefined as b } from "lit/directives/if-defined.js";
|
2
|
+
import { SkfElement as h } from "../../internal/components/skf-element.js";
|
3
|
+
import { componentStyles as m } from "../../styles/component.styles.js";
|
4
|
+
import { html as n } from "lit";
|
5
|
+
import { property as f, state as _ } from "lit/decorators.js";
|
6
|
+
import { ifDefined as u } from "lit/directives/if-defined.js";
|
8
7
|
import { styles as C } from "./breadcrumb-item.styles.js";
|
9
|
-
var
|
10
|
-
for (var
|
11
|
-
(l =
|
12
|
-
return
|
8
|
+
var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, p = (a, t, e, i) => {
|
9
|
+
for (var r = i > 1 ? void 0 : i ? y(t, e) : t, o = a.length - 1, l; o >= 0; o--)
|
10
|
+
(l = a[o]) && (r = (i ? l(t, e, r) : l(r)) || r);
|
11
|
+
return i && r && v(t, e, r), r;
|
13
12
|
};
|
14
|
-
const
|
13
|
+
const c = class c extends h {
|
15
14
|
constructor() {
|
16
|
-
super(...arguments), this._isCurrent = !1, this._clickHandler = (t,
|
17
|
-
|
18
|
-
this._onClick && t.preventDefault(), (r = this._onClick) == null || r.call(this, t, s);
|
15
|
+
super(...arguments), this._isCurrent = !1, this._clickHandler = (t, e) => {
|
16
|
+
this._onClick && t.preventDefault(), this._onClick?.(t, e);
|
19
17
|
};
|
20
18
|
}
|
21
19
|
set onClick(t) {
|
@@ -28,34 +26,34 @@ const n = class n extends f {
|
|
28
26
|
super.connectedCallback(), this.role = "listitem";
|
29
27
|
}
|
30
28
|
render() {
|
31
|
-
return
|
32
|
-
<div
|
33
|
-
${this.href ?
|
29
|
+
return n`
|
30
|
+
<div id="root">
|
31
|
+
${this.href ? n`
|
34
32
|
<a
|
35
33
|
@click=${this._clickHandler}
|
36
|
-
aria-current=${
|
37
|
-
class="
|
34
|
+
aria-current=${u(this._isCurrent ? "page" : void 0)}
|
35
|
+
class="label"
|
38
36
|
href=${this.href}
|
39
37
|
>
|
40
38
|
<slot></slot>
|
41
39
|
</a>
|
42
|
-
` :
|
43
|
-
<span
|
40
|
+
` : n`<slot class="label"></slot>`}
|
41
|
+
<span>/</span>
|
44
42
|
</div>
|
45
43
|
`;
|
46
44
|
}
|
47
45
|
};
|
48
|
-
|
49
|
-
let
|
50
|
-
|
51
|
-
|
52
|
-
],
|
53
|
-
|
54
|
-
|
55
|
-
],
|
56
|
-
|
46
|
+
c.styles = [m, C];
|
47
|
+
let s = c;
|
48
|
+
p([
|
49
|
+
f({ type: String })
|
50
|
+
], s.prototype, "href", 2);
|
51
|
+
p([
|
52
|
+
f({ attribute: !1 })
|
53
|
+
], s.prototype, "onClick", 1);
|
54
|
+
p([
|
57
55
|
_()
|
58
|
-
],
|
56
|
+
], s.prototype, "_isCurrent", 2);
|
59
57
|
export {
|
60
|
-
|
58
|
+
s as SkfBreadcrumbItem
|
61
59
|
};
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { SkfBreadcrumbItem } from './breadcrumb-item.component';
|
2
|
-
export * from './breadcrumb-item.component';
|
1
|
+
import { SkfBreadcrumbItem } from './breadcrumb-item.component.js';
|
2
|
+
export * from './breadcrumb-item.component.js';
|
3
3
|
export default SkfBreadcrumbItem;
|
4
4
|
declare global {
|
5
5
|
interface HTMLElementTagNameMap {
|