@skf-design-system/ui-components 1.0.0-beta.5 → 1.0.0-beta.7
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/dist/components/accordion/accordion-item.d.ts +1 -1
- package/dist/components/accordion/accordion.component.d.ts +4 -4
- package/dist/components/accordion/accordion.component.js +18 -17
- package/dist/components/accordion/accordion.styles.d.ts +1 -2
- package/dist/components/accordion/accordion.styles.js +5 -4
- package/dist/components/alert/alert.component.d.ts +3 -3
- package/dist/components/alert/alert.component.js +44 -33
- package/dist/components/alert/alert.styles.d.ts +1 -2
- package/dist/components/alert/alert.styles.js +29 -24
- package/dist/components/button/button.component.d.ts +26 -4
- package/dist/components/button/button.component.js +78 -54
- package/dist/components/button/button.styles.js +1 -0
- package/dist/components/card/card.component.d.ts +4 -4
- package/dist/components/card/card.component.js +35 -24
- package/dist/components/card/card.styles.d.ts +1 -2
- package/dist/components/card/card.styles.js +14 -12
- package/dist/components/checkbox/checkbox.component.d.ts +11 -12
- package/dist/components/checkbox/checkbox.component.js +95 -89
- package/dist/components/collapse/collapse.component.d.ts +8 -8
- package/dist/components/collapse/collapse.component.js +42 -34
- package/dist/components/collapse/collapse.styles.js +15 -14
- package/dist/components/dialog/dialog.component.d.ts +75 -0
- package/dist/components/dialog/dialog.component.js +189 -0
- package/dist/components/dialog/dialog.d.ts +8 -0
- package/dist/components/dialog/dialog.js +6 -0
- package/dist/components/dialog/dialog.styles.js +91 -0
- package/dist/components/divider/divider.component.d.ts +3 -3
- package/dist/components/divider/divider.component.js +39 -27
- package/dist/components/divider/divider.styles.d.ts +1 -2
- package/dist/components/divider/divider.styles.js +26 -26
- package/dist/components/heading/heading.component.d.ts +2 -2
- package/dist/components/icon/icon.component.d.ts +1 -1
- package/dist/components/input/input.component.d.ts +12 -11
- package/dist/components/input/input.component.js +88 -89
- package/dist/components/link/link.component.d.ts +6 -6
- package/dist/components/link/link.component.js +20 -14
- package/dist/components/link/link.styles.js +36 -40
- package/dist/components/loader/loader.component.d.ts +2 -2
- package/dist/components/loader/loader.component.js +32 -25
- package/dist/components/loader/loader.styles.js +11 -10
- package/dist/components/logo/logo.component.d.ts +3 -3
- package/dist/components/logo/logo.component.js +25 -14
- package/dist/components/logo/logo.styles.d.ts +1 -2
- package/dist/components/logo/logo.styles.js +11 -9
- package/dist/components/progress/progress.component.d.ts +22 -0
- package/dist/components/progress/progress.component.js +49 -0
- package/dist/components/progress/progress.d.ts +8 -0
- package/dist/components/progress/progress.js +6 -0
- package/dist/components/progress/progress.styles.js +48 -0
- package/dist/components/radio/radio.component.d.ts +7 -9
- package/dist/components/radio/radio.component.js +93 -77
- package/dist/components/select/select.component.d.ts +2 -2
- package/dist/components/select/select.component.js +16 -13
- package/dist/components/select/select.controllers.d.ts +1 -1
- package/dist/components/select-option/select-option.component.d.ts +1 -1
- package/dist/components/select-option/select-option.controllers.d.ts +1 -1
- package/dist/components/select-option-group/select-option-group.component.d.ts +1 -1
- package/dist/components/switch/switch.component.d.ts +2 -2
- package/dist/components/switch/switch.component.js +17 -7
- package/dist/components/switch/switch.styles.js +16 -13
- package/dist/components/tab/tab.component.d.ts +29 -0
- package/dist/components/tab/tab.component.js +57 -0
- package/dist/components/tab/tab.d.ts +8 -0
- package/dist/components/tab/tab.js +6 -0
- package/dist/components/tab/tab.styles.d.ts +1 -0
- package/dist/components/tab/tab.styles.js +123 -0
- package/dist/components/tab-group/tab-group.component.d.ts +43 -0
- package/dist/components/tab-group/tab-group.component.js +98 -0
- package/dist/components/tab-group/tab-group.d.ts +8 -0
- package/dist/components/tab-group/tab-group.js +6 -0
- package/dist/components/tab-group/tab-group.styles.d.ts +1 -0
- package/dist/components/tab-group/tab-group.styles.js +75 -0
- package/dist/components/tab-panel/tab-panel.component.d.ts +19 -0
- package/dist/components/tab-panel/tab-panel.component.js +36 -0
- package/dist/components/tab-panel/tab-panel.d.ts +8 -0
- package/dist/components/tab-panel/tab-panel.js +6 -0
- package/dist/components/tab-panel/tab-panel.styles.d.ts +1 -0
- package/dist/components/tab-panel/tab-panel.styles.js +13 -0
- package/dist/components/tag/tag.component.d.ts +2 -2
- package/dist/components/tag/tag.component.js +61 -45
- package/dist/components/tag/tag.styles.js +30 -28
- package/dist/components/textarea/textarea.component.d.ts +4 -4
- package/dist/components/textarea/textarea.component.js +5 -5
- package/dist/components/toast/toast.component.d.ts +1 -1
- package/dist/components/toast/toast.component.js +13 -13
- package/dist/components/toast/toast.singleton.d.ts +3 -3
- package/dist/components/toast/toast.styles.d.ts +1 -0
- package/dist/components/toast-item/toast-item.component.d.ts +1 -1
- package/dist/components/toast-item/toast-item.component.js +1 -1
- package/dist/components/toast-wrapper/toast-wrapper.component.d.ts +2 -2
- package/dist/components/toast-wrapper/toast-wrapper.component.js +1 -1
- package/dist/components/toast-wrapper/toast-wrapper.styles.d.ts +1 -0
- package/dist/custom-elements.json +1170 -511
- package/dist/index.d.ts +5 -0
- package/dist/index.js +59 -44
- package/dist/internal/components/formBase.d.ts +1 -0
- package/dist/internal/components/formBase.js +11 -11
- package/dist/internal/components/hint/hint.component.d.ts +2 -2
- package/dist/internal/components/skf-element.js +26 -25
- package/dist/internal/helpers/hintSeverity.d.ts +1 -1
- package/dist/internal/helpers/watch.d.ts +27 -0
- package/dist/internal/helpers/watch.js +28 -0
- package/dist/internal/templates/asterisk.d.ts +1 -1
- package/dist/internal/templates/asterisk.js +7 -6
- package/dist/react/index.d.ts +7 -2
- package/dist/react/index.js +7 -2
- package/dist/react/skf-button/index.d.ts +7 -1
- package/dist/react/skf-button/index.js +5 -1
- package/dist/react/skf-dialog/index.d.ts +15 -0
- package/dist/react/skf-dialog/index.js +19 -0
- package/dist/react/skf-progress/index.d.ts +3 -0
- package/dist/react/skf-progress/index.js +13 -0
- package/dist/react/skf-tab/index.d.ts +12 -0
- package/dist/react/skf-tab/index.js +18 -0
- package/dist/react/skf-tab-group/index.d.ts +3 -0
- package/dist/react/skf-tab-group/index.js +13 -0
- package/dist/react/skf-tab-panel/index.d.ts +3 -0
- package/dist/react/skf-tab-panel/index.js +13 -0
- package/dist/styles/component.styles.js +15 -2
- package/dist/types/jsx/custom-element-jsx.d.ts +246 -101
- package/dist/types/vue/index.d.ts +215 -65
- package/dist/vscode.html-custom-data.json +276 -182
- package/dist/web-types.json +556 -248
- package/package.json +33 -32
- /package/dist/components/{toast-wrapper/toast-wrapper.style.d.ts → dialog/dialog.styles.d.ts} +0 -0
- /package/dist/components/{toast/toast.style.d.ts → progress/progress.styles.d.ts} +0 -0
- /package/dist/components/toast/{toast.style.js → toast.styles.js} +0 -0
- /package/dist/components/toast-item/{toast-item.style.d.ts → toast-item.styles.d.ts} +0 -0
- /package/dist/components/toast-item/{toast-item.style.js → toast-item.styles.js} +0 -0
- /package/dist/components/toast-wrapper/{toast-wrapper.style.js → toast-wrapper.styles.js} +0 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
import '../button/button.js';
|
2
|
+
import '../heading/heading.js';
|
3
|
+
import '../icon/icon.js';
|
4
|
+
import { SkfElement } from '../../internal/components/skf-element';
|
5
|
+
import { type CSSResultGroup } from 'lit';
|
6
|
+
/**
|
7
|
+
* TODO: Is modal the right name? Should it be "blocking" or "blocking-dialog"?
|
8
|
+
*
|
9
|
+
* TBD: Should we inert the page behind the dialog? Maybe only if it is modal-dialog?
|
10
|
+
*
|
11
|
+
* TBD: Should we disable scrolling on the page behind the dialog? Maybe only if it is modal?
|
12
|
+
*/
|
13
|
+
/**
|
14
|
+
* The `<skf-dialog>` is a component that open up a dialog with the content provided
|
15
|
+
*
|
16
|
+
* @documentation See [InVision DSM](https://skf.invisionapp.com/dsm/ab-skf/4-web-applications/nav/5fa7caf78c01200018354495/asset/6229d63d9fe16020a60657e5) for design principles
|
17
|
+
*
|
18
|
+
* @slot - The dialog component's content
|
19
|
+
* @slot heading - The dialog component's heading
|
20
|
+
* @slot footer - The dialog component's buttons goes here
|
21
|
+
*
|
22
|
+
* @event skf-dialog-open - Fires when the dialog is opened (after transitioned in)
|
23
|
+
* @event skf-dialog-close - Fires when the dialog is closed (before transitioned out)
|
24
|
+
* @event close - Fires when the dialog is closed (after transitioned out)
|
25
|
+
*
|
26
|
+
* @cssproperty --skf-dialog-height - A custom height for the Dialog. Pass valid CSS **block-size** values
|
27
|
+
* @cssproperty --skf-dialog-width - A custom width for the Dialog Pass valid CSS **inline-size** values
|
28
|
+
*
|
29
|
+
* @tagname skf-dialog
|
30
|
+
*/
|
31
|
+
export declare class SkfDialog extends SkfElement {
|
32
|
+
#private;
|
33
|
+
static styles: CSSResultGroup;
|
34
|
+
/** If defined, sets the aria-label for the close button */
|
35
|
+
closeButtonAriaLabel?: string;
|
36
|
+
/** Title for the modal/dialog */
|
37
|
+
heading?: string;
|
38
|
+
/** If true, makes the dialog stretch edge to edge on screen */
|
39
|
+
fullscreen: boolean;
|
40
|
+
/** If true, removes the close button */
|
41
|
+
noCloseButton?: boolean | undefined;
|
42
|
+
/** If defined, removes the inner padding */
|
43
|
+
noPadding: boolean;
|
44
|
+
open?: boolean | null;
|
45
|
+
/** If provided, will run function on dialog close */
|
46
|
+
onClose?: ((event: Event) => void) | null;
|
47
|
+
/** @internal */
|
48
|
+
$dialog: HTMLDialogElement;
|
49
|
+
/** @internal */
|
50
|
+
footerEls?: HTMLElement[];
|
51
|
+
/** @internal */
|
52
|
+
modal: boolean;
|
53
|
+
/** @internal */
|
54
|
+
renderFoot: boolean;
|
55
|
+
protected firstUpdated(): void;
|
56
|
+
handleOpenChange(): void;
|
57
|
+
/** @internal */
|
58
|
+
show: () => Promise<boolean>;
|
59
|
+
/** @internal */
|
60
|
+
_transition(): {
|
61
|
+
entry: () => Promise<unknown>;
|
62
|
+
exit: () => Promise<unknown>;
|
63
|
+
};
|
64
|
+
/** @internal */
|
65
|
+
_handleBackdropClick: (event: MouseEvent) => void;
|
66
|
+
/** @internal */
|
67
|
+
_handleClose: (event: Event) => void;
|
68
|
+
/** @internal */
|
69
|
+
get _isModal(): boolean;
|
70
|
+
/** Method that opens the dialog in modal state */
|
71
|
+
showModal: () => Promise<boolean>;
|
72
|
+
/** Method that closes the dialog */
|
73
|
+
close: () => Promise<boolean | undefined>;
|
74
|
+
render(): import("lit").TemplateResult<1>;
|
75
|
+
}
|
@@ -0,0 +1,189 @@
|
|
1
|
+
var _ = (t) => {
|
2
|
+
throw TypeError(t);
|
3
|
+
};
|
4
|
+
var w = (t, e, o) => e.has(t) || _("Cannot " + o);
|
5
|
+
var f = (t, e, o) => (w(t, e, "read from private field"), o ? o.call(t) : e.get(t)), g = (t, e, o) => e.has(t) ? _("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, o), h = (t, e, o, a) => (w(t, e, "write to private field"), a ? a.call(t, o) : e.set(t, o), o);
|
6
|
+
import "../button/button.js";
|
7
|
+
import "../heading/heading.js";
|
8
|
+
import "../icon/icon.js";
|
9
|
+
import { SkfElement as v } from "../../internal/components/skf-element.js";
|
10
|
+
import { watch as C } from "../../internal/helpers/watch.js";
|
11
|
+
import B from "../../styles/component.styles.js";
|
12
|
+
import { html as b, nothing as k } from "lit";
|
13
|
+
import { property as c, state as m, query as P, queryAssignedElements as M } from "lit/decorators.js";
|
14
|
+
import { classMap as $ } from "lit/directives/class-map.js";
|
15
|
+
import { styles as O } from "./dialog.styles.js";
|
16
|
+
var A = Object.defineProperty, E = Object.getOwnPropertyDescriptor, i = (t, e, o, a) => {
|
17
|
+
for (var n = a > 1 ? void 0 : a ? E(e, o) : e, l = t.length - 1, r; l >= 0; l--)
|
18
|
+
(r = t[l]) && (n = (a ? r(e, o, n) : r(n)) || n);
|
19
|
+
return a && n && A(e, o, n), n;
|
20
|
+
}, p, u, d;
|
21
|
+
const y = class y extends v {
|
22
|
+
constructor() {
|
23
|
+
super(...arguments);
|
24
|
+
g(this, p);
|
25
|
+
g(this, u);
|
26
|
+
g(this, d);
|
27
|
+
h(this, p, 0), h(this, u, 20), h(this, d, !1), this.fullscreen = !1, this.noCloseButton = !1, this.noPadding = !1, this.onClose = null, this.modal = !0, this.renderFoot = !1, this.show = async () => await this.showModal(), this._handleBackdropClick = (o) => {
|
28
|
+
this._isModal || o.target !== this.$dialog || this.close();
|
29
|
+
}, this._handleClose = (o) => {
|
30
|
+
console.log("Handle close reached"), this.onClose && this.onClose(o), this.close();
|
31
|
+
}, this.showModal = async () => await (async () => (console.log("%cmodal ->", "color: red", this.modal), this.$dialog.showModal(), await this._transition().entry(), this.emit("skf-dialog-open"), !0))(), this.close = async () => (console.log("close reached"), f(this, d) ? void 0 : (h(this, d, !0), await (async () => (this.emit("skf-dialog-close"), await this._transition().exit(), this.$dialog.close(), this.open = !1, h(this, d, !1), !0))()));
|
32
|
+
}
|
33
|
+
firstUpdated() {
|
34
|
+
this.$dialog.addEventListener("close", (o) => {
|
35
|
+
o.stopPropagation(), console.log("close event detected 1", o), this.emit("close");
|
36
|
+
});
|
37
|
+
}
|
38
|
+
handleOpenChange() {
|
39
|
+
var o;
|
40
|
+
switch (!0) {
|
41
|
+
case (this.open === !0 && !!this.modal):
|
42
|
+
this.showModal();
|
43
|
+
break;
|
44
|
+
case (this.open === !0 && !this.modal):
|
45
|
+
this.show();
|
46
|
+
break;
|
47
|
+
case this.open === !1:
|
48
|
+
this.close();
|
49
|
+
break;
|
50
|
+
}
|
51
|
+
this.open && (this.renderFoot = !!((o = this.footerEls) != null && o.length));
|
52
|
+
}
|
53
|
+
/** @internal */
|
54
|
+
_transition() {
|
55
|
+
const o = this.fullscreen ? {} : {
|
56
|
+
translate: `${String(f(this, p))} ${String(f(this, u))}px`
|
57
|
+
};
|
58
|
+
return { entry: () => new Promise((l) => {
|
59
|
+
const r = this.$dialog.animate(
|
60
|
+
[
|
61
|
+
{
|
62
|
+
opacity: 0,
|
63
|
+
...o
|
64
|
+
},
|
65
|
+
{ opacity: 1, translate: "0 0" }
|
66
|
+
],
|
67
|
+
{
|
68
|
+
duration: 200,
|
69
|
+
fill: "forwards",
|
70
|
+
easing: "ease-out"
|
71
|
+
}
|
72
|
+
);
|
73
|
+
this.$dialog.animate([{ opacity: 0 }, { opacity: 1 }], {
|
74
|
+
duration: 200,
|
75
|
+
fill: "forwards",
|
76
|
+
pseudoElement: "::backdrop"
|
77
|
+
}), r.onfinish = () => {
|
78
|
+
l("opened");
|
79
|
+
};
|
80
|
+
}), exit: () => new Promise((l) => {
|
81
|
+
const r = this.$dialog.animate(
|
82
|
+
[
|
83
|
+
{ opacity: 1, translate: "0 0" },
|
84
|
+
{
|
85
|
+
opacity: 0,
|
86
|
+
...o
|
87
|
+
}
|
88
|
+
],
|
89
|
+
{
|
90
|
+
duration: 200,
|
91
|
+
fill: "forwards",
|
92
|
+
easing: "ease-in"
|
93
|
+
}
|
94
|
+
);
|
95
|
+
this.$dialog.animate([{ opacity: 1 }, { opacity: 0 }], {
|
96
|
+
duration: 200,
|
97
|
+
fill: "forwards",
|
98
|
+
pseudoElement: "::backdrop"
|
99
|
+
}), r.onfinish = () => {
|
100
|
+
l("closed");
|
101
|
+
};
|
102
|
+
}) };
|
103
|
+
}
|
104
|
+
/** @internal */
|
105
|
+
get _isModal() {
|
106
|
+
return typeof this.modal == "string";
|
107
|
+
}
|
108
|
+
render() {
|
109
|
+
return b`
|
110
|
+
<dialog
|
111
|
+
@close=${this._handleClose}
|
112
|
+
@mousedown=${this._handleBackdropClick}
|
113
|
+
@touchstart=${this._handleBackdropClick}
|
114
|
+
autofocus
|
115
|
+
class=${$({
|
116
|
+
dialog: !0,
|
117
|
+
"dialog--fullscreen": this.fullscreen,
|
118
|
+
"dialog--no-padding": this.noPadding
|
119
|
+
})}
|
120
|
+
>
|
121
|
+
<div class="dialog__head">
|
122
|
+
<h2 class="dialog__heading">
|
123
|
+
<slot name="heading"></slot>
|
124
|
+
</h2>
|
125
|
+
${this.noCloseButton ? k : b`
|
126
|
+
<button
|
127
|
+
@click=${this._handleClose}
|
128
|
+
aria-label=${this.closeButtonAriaLabel ?? "Close dialog"}
|
129
|
+
class="dialog__close-btn"
|
130
|
+
>
|
131
|
+
<skf-icon name="close" color="inverse"></skf-icon>
|
132
|
+
</button>
|
133
|
+
`}
|
134
|
+
</div>
|
135
|
+
<div class="dialog__body">
|
136
|
+
<slot class="dialog__main"></slot>
|
137
|
+
<slot
|
138
|
+
class=${$({
|
139
|
+
dialog__foot: !0,
|
140
|
+
"dialog__foot-hidden": !this.renderFoot
|
141
|
+
})}
|
142
|
+
name="footer"
|
143
|
+
></slot>
|
144
|
+
</div>
|
145
|
+
</dialog>
|
146
|
+
`;
|
147
|
+
}
|
148
|
+
};
|
149
|
+
p = new WeakMap(), u = new WeakMap(), d = new WeakMap(), y.styles = [B, O];
|
150
|
+
let s = y;
|
151
|
+
i([
|
152
|
+
c({ attribute: "close-button-aria-label" })
|
153
|
+
], s.prototype, "closeButtonAriaLabel", 2);
|
154
|
+
i([
|
155
|
+
c()
|
156
|
+
], s.prototype, "heading", 2);
|
157
|
+
i([
|
158
|
+
c({ type: Boolean })
|
159
|
+
], s.prototype, "fullscreen", 2);
|
160
|
+
i([
|
161
|
+
c({ type: Boolean, attribute: "no-close-button" })
|
162
|
+
], s.prototype, "noCloseButton", 2);
|
163
|
+
i([
|
164
|
+
c({ type: Boolean, attribute: "no-padding" })
|
165
|
+
], s.prototype, "noPadding", 2);
|
166
|
+
i([
|
167
|
+
c({ type: Boolean, reflect: !0 })
|
168
|
+
], s.prototype, "open", 2);
|
169
|
+
i([
|
170
|
+
m()
|
171
|
+
], s.prototype, "onClose", 2);
|
172
|
+
i([
|
173
|
+
P("dialog")
|
174
|
+
], s.prototype, "$dialog", 2);
|
175
|
+
i([
|
176
|
+
M({ slot: "footer" })
|
177
|
+
], s.prototype, "footerEls", 2);
|
178
|
+
i([
|
179
|
+
m()
|
180
|
+
], s.prototype, "modal", 2);
|
181
|
+
i([
|
182
|
+
m()
|
183
|
+
], s.prototype, "renderFoot", 2);
|
184
|
+
i([
|
185
|
+
C("open")
|
186
|
+
], s.prototype, "handleOpenChange", 1);
|
187
|
+
export {
|
188
|
+
s as SkfDialog
|
189
|
+
};
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import { css as a } from "lit";
|
2
|
+
const o = a`
|
3
|
+
/* stylelint-disable selector-class-pattern */
|
4
|
+
@layer components {
|
5
|
+
.dialog {
|
6
|
+
--_skf-dialog-head-height: var(--skf-size-48);
|
7
|
+
--_skf-dialog-inset: var(--skf-spacing-100);
|
8
|
+
|
9
|
+
all: unset;
|
10
|
+
background-color: var(--skf-bg-color-neutral-1);
|
11
|
+
display: none;
|
12
|
+
grid-template:
|
13
|
+
'head' auto
|
14
|
+
'body' calc(100% - var(--_skf-dialog-head-height)) / 1fr;
|
15
|
+
inset: var(--_skf-dialog-inset);
|
16
|
+
max-block-size: calc(100% - var(--_skf-dialog-inset) * 2);
|
17
|
+
overflow: hidden;
|
18
|
+
position: fixed;
|
19
|
+
|
20
|
+
&[open] {
|
21
|
+
display: grid;
|
22
|
+
}
|
23
|
+
|
24
|
+
&:not(.dialog--fullscreen) {
|
25
|
+
block-size: var(--skf-dialog-height, fit-content);
|
26
|
+
margin: auto;
|
27
|
+
max-inline-size: min(100%, var(--skf-dialog-width, 400px));
|
28
|
+
}
|
29
|
+
|
30
|
+
&::backdrop {
|
31
|
+
background-color: color-mix(in srgb, var(--skf-bg-color-neutral-7), transparent);
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
.dialog__head {
|
36
|
+
align-items: center;
|
37
|
+
background-color: var(--skf-color-brand-base);
|
38
|
+
block-size: var(--_skf-dialog-head-height);
|
39
|
+
display: flex;
|
40
|
+
grid-area: head;
|
41
|
+
justify-content: space-between;
|
42
|
+
padding-inline: var(--skf-box-spacing);
|
43
|
+
}
|
44
|
+
|
45
|
+
.dialog__heading {
|
46
|
+
color: var(--skf-text-color-inverse);
|
47
|
+
font-size: var(--skf-font-size-200);
|
48
|
+
}
|
49
|
+
|
50
|
+
.dialog__close-btn {
|
51
|
+
align-items: center;
|
52
|
+
display: flex;
|
53
|
+
|
54
|
+
&:focus-visible {
|
55
|
+
border-radius: var(--skf-border-radius-sm);
|
56
|
+
outline: var(--skf-border-width-sm) solid var(--skf-interactive-text-color-inverse);
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
.dialog__body {
|
61
|
+
/* block-size: calc(100% - (var(--_skf-dialog-head-height) + (var(--skf-box-spacing) * 2))); */
|
62
|
+
display: flex;
|
63
|
+
flex-direction: column;
|
64
|
+
row-gap: var(--skf-spacing-100);
|
65
|
+
|
66
|
+
.dialog:not(.dialog--no-padding) & {
|
67
|
+
padding: var(--skf-box-spacing);
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
.dialog__main {
|
72
|
+
display: block;
|
73
|
+
flex: 1;
|
74
|
+
overflow-y: auto;
|
75
|
+
}
|
76
|
+
|
77
|
+
.dialog__foot {
|
78
|
+
display: flex;
|
79
|
+
flex-wrap: wrap;
|
80
|
+
gap: var(--skf-spacing-100);
|
81
|
+
justify-content: flex-end;
|
82
|
+
}
|
83
|
+
|
84
|
+
.dialog__foot--hidden {
|
85
|
+
display: none;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
`;
|
89
|
+
export {
|
90
|
+
o as styles
|
91
|
+
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { SkfElement } from '
|
1
|
+
import { SkfElement } from '../../internal/components/skf-element.js';
|
2
2
|
import type { BorderColor } from '@skf-design-system/ui-assets';
|
3
3
|
import { type CSSResultGroup } from 'lit';
|
4
4
|
/**
|
@@ -20,9 +20,9 @@ export declare class SkfDivider extends SkfElement {
|
|
20
20
|
*/
|
21
21
|
color: BorderColor;
|
22
22
|
/** If true, renders a div for presentational purpose instead of the semantic hr-element */
|
23
|
-
decorative
|
23
|
+
decorative: boolean;
|
24
24
|
/** If true, renders the divider vertically */
|
25
|
-
vertical
|
25
|
+
vertical: boolean;
|
26
26
|
constructor();
|
27
27
|
connectedCallback(): void;
|
28
28
|
render(): import("lit").TemplateResult<1>;
|
@@ -1,42 +1,54 @@
|
|
1
|
-
var
|
2
|
-
throw TypeError(
|
1
|
+
var h = (r) => {
|
2
|
+
throw TypeError(r);
|
3
3
|
};
|
4
|
-
var
|
5
|
-
var
|
4
|
+
var m = (r, e, t) => e.has(r) || h("Cannot " + t);
|
5
|
+
var c = (r, e, t) => (m(r, e, "read from private field"), t ? t.call(r) : e.get(r)), f = (r, e, t) => e.has(r) ? h("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), y = (r, e, t, a) => (m(r, e, "write to private field"), a ? a.call(r, t) : e.set(r, t), t);
|
6
6
|
import { SkfElement as u } from "../../internal/components/skf-element.js";
|
7
7
|
import b from "../../styles/component.styles.js";
|
8
8
|
import { html as C } from "lit";
|
9
|
-
import { property as
|
10
|
-
import _ from "
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
import { property as n } from "lit/decorators.js";
|
10
|
+
import { classMap as _ } from "lit/directives/class-map.js";
|
11
|
+
import { styles as x } from "./divider.styles.js";
|
12
|
+
var B = Object.defineProperty, p = (r, e, t, a) => {
|
13
|
+
for (var o = void 0, l = r.length - 1, v; l >= 0; l--)
|
14
|
+
(v = r[l]) && (o = v(e, t, o) || o);
|
15
|
+
return o && B(e, t, o), o;
|
15
16
|
}, i;
|
16
|
-
const
|
17
|
+
const d = class d extends u {
|
17
18
|
constructor() {
|
18
19
|
super();
|
19
|
-
|
20
|
-
this.color = "primary", y(this, i, this.attachInternals());
|
20
|
+
f(this, i);
|
21
|
+
this.color = "primary", this.decorative = !1, this.vertical = !1, y(this, i, this.attachInternals());
|
21
22
|
}
|
22
23
|
connectedCallback() {
|
23
|
-
super.connectedCallback(),
|
24
|
+
super.connectedCallback(), c(this, i).role = this.decorative ? "generic" : "separator", c(this, i).ariaOrientation = this.vertical ? "vertical" : "horizontal";
|
24
25
|
}
|
25
26
|
render() {
|
26
|
-
return C
|
27
|
+
return C`
|
28
|
+
<div
|
29
|
+
class=${_({
|
30
|
+
divider: !0,
|
31
|
+
"divider--color-emphasised": this.color === "emphasised",
|
32
|
+
"divider--color-inverse": this.color === "inverse",
|
33
|
+
"divider--color-secondary": this.color === "secondary",
|
34
|
+
"divider--color-tertiary": this.color === "tertiary",
|
35
|
+
"divider--vertical": this.vertical
|
36
|
+
})}
|
37
|
+
></div>
|
38
|
+
`;
|
27
39
|
}
|
28
40
|
};
|
29
|
-
i = new WeakMap(),
|
30
|
-
let
|
31
|
-
|
32
|
-
|
33
|
-
],
|
34
|
-
|
35
|
-
|
36
|
-
],
|
37
|
-
|
38
|
-
|
39
|
-
],
|
41
|
+
i = new WeakMap(), d.styles = [b, x];
|
42
|
+
let s = d;
|
43
|
+
p([
|
44
|
+
n({ reflect: !0 })
|
45
|
+
], s.prototype, "color");
|
46
|
+
p([
|
47
|
+
n({ type: Boolean })
|
48
|
+
], s.prototype, "decorative");
|
49
|
+
p([
|
50
|
+
n({ type: Boolean, reflect: !0 })
|
51
|
+
], s.prototype, "vertical");
|
40
52
|
export {
|
41
|
-
|
53
|
+
s as SkfDivider
|
42
54
|
};
|
@@ -1,2 +1 @@
|
|
1
|
-
declare const
|
2
|
-
export default _default;
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
@@ -1,43 +1,43 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
|
-
const
|
3
|
-
|
4
|
-
|
5
|
-
--_skf-divider-border: var(--skf-border-width-sm) solid
|
2
|
+
const d = r`
|
3
|
+
/* stylelint-disable selector-class-pattern */
|
4
|
+
.divider {
|
5
|
+
--_skf-divider-border: var(--skf-border-width-sm) solid
|
6
|
+
var(--_skf-divider-border-color, var(--skf-border-color-primary));
|
6
7
|
|
7
8
|
display: block;
|
8
9
|
|
9
|
-
|
10
|
+
&:not(.divider--vertical) {
|
10
11
|
border-top: var(--_skf-divider-border);
|
11
12
|
margin-block: var(--skf-divider-spacing, var(--skf-spacing-100));
|
12
13
|
margin-inline: var(--skf-divider-inset, 0);
|
13
14
|
}
|
15
|
+
}
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
}
|
17
|
+
.divider--vertical {
|
18
|
+
block-size: 100%;
|
19
|
+
border-left: var(--_skf-divider-border);
|
20
|
+
margin-block: var(--skf-divider-inset, 0);
|
21
|
+
margin-inline: var(--skf-divider-spacing, var(--skf-spacing-100));
|
22
|
+
}
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
/** Colors */
|
25
|
+
.divider--color-emphasised {
|
26
|
+
--_skf-divider-border-color: var(--skf-border-color-emphasised);
|
27
|
+
}
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
29
|
+
.divider--color-inverse {
|
30
|
+
--_skf-divider-border-color: var(--skf-border-color-inverse);
|
31
|
+
}
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
33
|
+
.divider--color-secondary {
|
34
|
+
--_skf-divider-border-color: var(--skf-border-color-secondary);
|
35
|
+
}
|
35
36
|
|
36
|
-
|
37
|
-
|
38
|
-
}
|
37
|
+
.divider--color-tertiary {
|
38
|
+
--_skf-divider-border-color: var(--skf-border-color-tertiary);
|
39
39
|
}
|
40
40
|
`;
|
41
41
|
export {
|
42
|
-
|
42
|
+
d as styles
|
43
43
|
};
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { SkfElement } from '
|
2
|
-
import type { HeadingType } from '
|
1
|
+
import { SkfElement } from '../../internal/components/skf-element.js';
|
2
|
+
import type { HeadingType } from '../../internal/constants/heading.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>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { SkfElement } from '
|
1
|
+
import { SkfElement } from '../../internal/components/skf-element.js';
|
2
2
|
import { type Icon, type IconColor, type IconSize, type SeverityFgColor } from '@skf-design-system/ui-assets';
|
3
3
|
import { type CSSResultGroup } from 'lit';
|
4
4
|
/**
|
@@ -1,8 +1,9 @@
|
|
1
|
-
import '
|
2
|
-
import { FormBase } from '
|
3
|
-
import '
|
4
|
-
import type { FormFieldBaseProps } from '
|
1
|
+
import '../icon/icon.js';
|
2
|
+
import { FormBase } from '../../internal/components/formBase.js';
|
3
|
+
import '../../internal/components/hint/hint';
|
4
|
+
import type { FormFieldBaseProps } from '../../internal/types/formField.js';
|
5
5
|
import { type CSSResultGroup } from 'lit';
|
6
|
+
type AutocompleteValues = 'on' | 'off' | 'name' | 'honorific-prefix' | 'given-name' | 'additional-name' | 'family-name' | 'honorific-suffix' | 'nickname' | 'username' | 'new-password' | 'current-password' | 'one-time-code' | 'organization-title' | 'organization' | 'street-address' | 'address-line1' | 'address-line2' | 'address-line3' | 'address-level4' | 'address-level3' | 'address-level2' | 'address-level1' | 'country' | 'country-name' | 'postal-code' | 'cc-name' | 'cc-given-name' | 'cc-additional-name' | 'cc-family-name' | 'cc-number' | 'cc-exp' | 'cc-exp-month' | 'cc-exp-year' | 'cc-csc' | 'cc-type' | 'transaction-amount' | 'transaction-currency' | 'language' | 'bday' | 'bday-day' | 'bday-month' | 'bday-year' | 'sex' | 'url' | 'photo' | 'tel' | 'tel-country-code' | 'tel-national' | 'tel-area-code' | 'tel-local' | 'tel-extension' | 'email' | 'impp' | 'password' | 'webauthn' | 'work' | (string & {});
|
6
7
|
/**
|
7
8
|
* The skf-text-field is used to create a text input field. It can be used inside a form element or standalone.
|
8
9
|
*
|
@@ -24,6 +25,12 @@ import { type CSSResultGroup } from 'lit';
|
|
24
25
|
export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
25
26
|
static styles: CSSResultGroup;
|
26
27
|
private customError;
|
28
|
+
/**
|
29
|
+
* Specifies what permission the browser has to provide assistance in filling out form field values. Refer to
|
30
|
+
* [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for available values.
|
31
|
+
* @type { -m }
|
32
|
+
*/
|
33
|
+
autocomplete?: AutocompleteValues;
|
27
34
|
/** Custom aria-label for the clear button. **Notice!** Only applicable to type=search. */
|
28
35
|
buttonAriaLabelClear: string;
|
29
36
|
/** Custom aria-label for the visibility button. **Notice!** Only applicable to type=password. */
|
@@ -55,11 +62,6 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
55
62
|
minLength?: number;
|
56
63
|
/** If defined, adds name to the input-element */
|
57
64
|
name?: string;
|
58
|
-
/**
|
59
|
-
* @internal
|
60
|
-
* If true, hide empty label element
|
61
|
-
*/
|
62
|
-
protected _noLabel: boolean | undefined;
|
63
65
|
/** If defined, adds name to the input-element */
|
64
66
|
pattern?: string;
|
65
67
|
/** If defined, displays placeholder text */
|
@@ -131,7 +133,6 @@ export declare class SkfInput extends FormBase implements FormFieldBaseProps {
|
|
131
133
|
private _renderSearchButton;
|
132
134
|
/** @internal */
|
133
135
|
private _onBlur;
|
134
|
-
/** @internal */
|
135
|
-
_handleSlotChange: () => void;
|
136
136
|
render(): import("lit").TemplateResult<1>;
|
137
137
|
}
|
138
|
+
export {};
|