@solid-design-system/components 1.39.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/es/dialog.js +1 -0
- package/dist/components/es/drawer.js +1 -1
- package/dist/components/es/input.js +1 -1
- package/dist/components/es/modal.js +1 -0
- package/dist/components/es/select.js +3 -3
- package/dist/components/es/solid-components2.js +1 -1
- package/dist/components/es/solid-element.js +1 -1
- package/dist/components/es/textarea.js +1 -1
- package/dist/components/umd/solid-components.js +18 -18
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/dialog/dialog.d.ts +32 -0
- package/dist/package/components/dialog/dialog.js +222 -0
- package/dist/package/components/input/input.d.ts +1 -0
- package/dist/package/components/input/input.js +6 -2
- package/dist/package/components/select/select.d.ts +1 -0
- package/dist/package/components/select/select.js +6 -2
- package/dist/package/components/textarea/textarea.d.ts +1 -0
- package/dist/package/components/textarea/textarea.js +7 -2
- package/dist/package/solid-components.d.ts +1 -0
- package/dist/package/solid-components.js +48 -46
- package/dist/package/styles/headline/headline.css.js +4 -0
- package/dist/package/styles/tailwind.css.js +1 -1
- package/dist/versioned-components/es/accordion-group.js +1 -1
- package/dist/versioned-components/es/accordion.js +1 -1
- package/dist/versioned-components/es/badge.js +1 -1
- package/dist/versioned-components/es/brandshape.js +1 -1
- package/dist/versioned-components/es/button.js +1 -1
- package/dist/versioned-components/es/carousel-item.js +1 -1
- package/dist/versioned-components/es/carousel.js +3 -3
- package/dist/versioned-components/es/checkbox-group.js +1 -1
- package/dist/versioned-components/es/checkbox.js +1 -1
- package/dist/versioned-components/es/dialog.js +1 -0
- package/dist/versioned-components/es/divider.js +1 -1
- package/dist/versioned-components/es/drawer.js +1 -1
- package/dist/versioned-components/es/dropdown.js +1 -1
- package/dist/versioned-components/es/form.js +1 -1
- package/dist/versioned-components/es/header.js +1 -1
- package/dist/versioned-components/es/icon.js +1 -1
- package/dist/versioned-components/es/include.js +1 -1
- package/dist/versioned-components/es/input.js +1 -1
- package/dist/versioned-components/es/link.js +1 -1
- package/dist/versioned-components/es/modal.js +1 -0
- package/dist/versioned-components/es/navigation-item.js +1 -1
- package/dist/versioned-components/es/notification.js +1 -1
- package/dist/versioned-components/es/option.js +1 -1
- package/dist/versioned-components/es/popup.js +1 -1
- package/dist/versioned-components/es/radio-button.js +1 -1
- package/dist/versioned-components/es/radio-group.js +1 -1
- package/dist/versioned-components/es/radio.js +1 -1
- package/dist/versioned-components/es/select.js +3 -3
- package/dist/versioned-components/es/solid-components2.js +1 -1
- package/dist/versioned-components/es/solid-element.js +1 -1
- package/dist/versioned-components/es/spinner.js +1 -1
- package/dist/versioned-components/es/switch.js +1 -1
- package/dist/versioned-components/es/tag.js +1 -1
- package/dist/versioned-components/es/teaser.js +1 -1
- package/dist/versioned-components/es/textarea.js +1 -1
- package/dist/versioned-components/es/tooltip.js +2 -2
- package/dist/versioned-components/es/video.js +1 -1
- package/dist/versioned-package/_components/button-group/button-group.d.ts +1 -1
- package/dist/versioned-package/_components/button-group/button-group.js +11 -11
- package/dist/versioned-package/components/accordion/accordion.d.ts +1 -1
- package/dist/versioned-package/components/accordion/accordion.js +2 -2
- package/dist/versioned-package/components/accordion-group/accordion-group.d.ts +1 -1
- package/dist/versioned-package/components/accordion-group/accordion-group.js +3 -3
- package/dist/versioned-package/components/badge/badge.d.ts +1 -1
- package/dist/versioned-package/components/badge/badge.js +1 -1
- package/dist/versioned-package/components/brandshape/brandshape.d.ts +1 -1
- package/dist/versioned-package/components/brandshape/brandshape.js +1 -1
- package/dist/versioned-package/components/button/button.d.ts +1 -1
- package/dist/versioned-package/components/button/button.js +4 -4
- package/dist/versioned-package/components/carousel/carousel.d.ts +1 -1
- package/dist/versioned-package/components/carousel/carousel.js +6 -6
- package/dist/versioned-package/components/carousel-item/carousel-item.d.ts +1 -1
- package/dist/versioned-package/components/carousel-item/carousel-item.js +1 -1
- package/dist/versioned-package/components/checkbox/checkbox.d.ts +1 -1
- package/dist/versioned-package/components/checkbox/checkbox.js +4 -4
- package/dist/versioned-package/components/checkbox-group/checkbox-group.d.ts +1 -1
- package/dist/versioned-package/components/checkbox-group/checkbox-group.js +5 -5
- package/dist/versioned-package/components/dialog/dialog.d.ts +32 -0
- package/dist/versioned-package/components/dialog/dialog.js +222 -0
- package/dist/versioned-package/components/divider/divider.d.ts +1 -1
- package/dist/versioned-package/components/divider/divider.js +2 -2
- package/dist/versioned-package/components/drawer/drawer.d.ts +1 -1
- package/dist/versioned-package/components/drawer/drawer.js +2 -2
- package/dist/versioned-package/components/dropdown/dropdown.d.ts +1 -1
- package/dist/versioned-package/components/dropdown/dropdown.js +8 -8
- package/dist/versioned-package/components/header/header.d.ts +1 -1
- package/dist/versioned-package/components/header/header.js +4 -4
- package/dist/versioned-package/components/icon/icon.d.ts +1 -1
- package/dist/versioned-package/components/icon/icon.js +1 -1
- package/dist/versioned-package/components/include/include.d.ts +1 -1
- package/dist/versioned-package/components/include/include.js +1 -1
- package/dist/versioned-package/components/input/input.d.ts +2 -1
- package/dist/versioned-package/components/input/input.js +9 -5
- package/dist/versioned-package/components/link/link.d.ts +1 -1
- package/dist/versioned-package/components/link/link.js +2 -2
- package/dist/versioned-package/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist/versioned-package/components/navigation-item/navigation-item.js +3 -3
- package/dist/versioned-package/components/notification/notification.d.ts +1 -1
- package/dist/versioned-package/components/notification/notification.js +5 -5
- package/dist/versioned-package/components/option/option.d.ts +1 -1
- package/dist/versioned-package/components/option/option.js +2 -2
- package/dist/versioned-package/components/popup/popup.d.ts +1 -1
- package/dist/versioned-package/components/popup/popup.js +1 -1
- package/dist/versioned-package/components/radio/radio.d.ts +1 -1
- package/dist/versioned-package/components/radio/radio.js +2 -2
- package/dist/versioned-package/components/radio-button/radio-button.d.ts +1 -1
- package/dist/versioned-package/components/radio-button/radio-button.js +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.d.ts +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.js +15 -15
- package/dist/versioned-package/components/select/select.d.ts +5 -4
- package/dist/versioned-package/components/select/select.js +33 -29
- package/dist/versioned-package/components/spinner/spinner.d.ts +1 -1
- package/dist/versioned-package/components/spinner/spinner.js +1 -1
- package/dist/versioned-package/components/switch/switch.d.ts +1 -1
- package/dist/versioned-package/components/switch/switch.js +2 -2
- package/dist/versioned-package/components/tag/tag.d.ts +1 -1
- package/dist/versioned-package/components/tag/tag.js +2 -2
- package/dist/versioned-package/components/teaser/teaser.js +1 -1
- package/dist/versioned-package/components/textarea/textarea.d.ts +2 -1
- package/dist/versioned-package/components/textarea/textarea.js +9 -4
- package/dist/versioned-package/components/tooltip/tooltip.d.ts +1 -1
- package/dist/versioned-package/components/tooltip/tooltip.js +5 -5
- package/dist/versioned-package/components/video/video.d.ts +1 -1
- package/dist/versioned-package/components/video/video.js +2 -2
- package/dist/versioned-package/internal/form.js +3 -3
- package/dist/versioned-package/solid-components.d.ts +1 -0
- package/dist/versioned-package/solid-components.js +48 -46
- package/dist/versioned-package/styles/headline/headline.css.js +4 -0
- package/dist/versioned-package/styles/tailwind.css.js +1 -1
- package/dist/versioned-styles/solid-styles.css +1 -1
- package/dist/vscode.html-custom-data.json +106 -32
- package/dist/web-types.json +363 -33
- package/package.json +3 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import '../button/button';
|
|
2
|
+
import '../icon/icon';
|
|
3
|
+
import SolidElement from '../../internal/solid-element';
|
|
4
|
+
export default class SdDialog extends SolidElement {
|
|
5
|
+
private readonly hasSlotController;
|
|
6
|
+
private readonly localize;
|
|
7
|
+
private modal;
|
|
8
|
+
private originalTrigger;
|
|
9
|
+
dialog: HTMLElement;
|
|
10
|
+
panel: HTMLElement;
|
|
11
|
+
overlay: HTMLElement;
|
|
12
|
+
open: boolean;
|
|
13
|
+
headline: string;
|
|
14
|
+
noCloseButton: boolean;
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
firstUpdated(): void;
|
|
17
|
+
disconnectedCallback(): void;
|
|
18
|
+
private requestClose;
|
|
19
|
+
private addOpenListeners;
|
|
20
|
+
private removeOpenListeners;
|
|
21
|
+
private handleDocumentKeyDown;
|
|
22
|
+
handleOpenChange(): Promise<void>;
|
|
23
|
+
show(): Promise<void>;
|
|
24
|
+
hide(): Promise<void>;
|
|
25
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
26
|
+
static styles: import("lit").CSSResultGroup[];
|
|
27
|
+
}
|
|
28
|
+
declare global {
|
|
29
|
+
interface HTMLElementTagNameMap {
|
|
30
|
+
'sd-dialog': SdDialog;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import "../button/button.js";
|
|
2
|
+
import "../icon/icon.js";
|
|
3
|
+
import { animateTo, stopAnimations } from "../../internal/animate.js";
|
|
4
|
+
import { unsafeCSS, css, html } from "lit";
|
|
5
|
+
import { customElement } from "../../internal/register-custom-element.js";
|
|
6
|
+
import { setDefaultAnimation, getAnimation } from "../../utilities/animation-registry.js";
|
|
7
|
+
import { HasSlotController } from "../../internal/slot.js";
|
|
8
|
+
import { LocalizeController } from "../../utilities/localize.js";
|
|
9
|
+
import { lockBodyScrolling, unlockBodyScrolling } from "../../internal/scroll.js";
|
|
10
|
+
import { query, property } from "lit/decorators.js";
|
|
11
|
+
import { waitForEvent } from "../../internal/event.js";
|
|
12
|
+
import { watch } from "../../internal/watch.js";
|
|
13
|
+
import componentStyles from "../../styles/component.styles.js";
|
|
14
|
+
import cx from "classix";
|
|
15
|
+
import HeadlineStyles from "../../styles/headline/headline.css.js";
|
|
16
|
+
import Modal from "../../internal/modal.js";
|
|
17
|
+
import SolidElement from "../../internal/solid-element.js";
|
|
18
|
+
var __defProp = Object.defineProperty;
|
|
19
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
20
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
21
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
22
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
23
|
+
if (decorator = decorators[i])
|
|
24
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
25
|
+
if (kind && result)
|
|
26
|
+
__defProp(target, key, result);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
let SdDialog = class extends SolidElement {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.hasSlotController = new HasSlotController(this, "footer");
|
|
33
|
+
this.localize = new LocalizeController(this);
|
|
34
|
+
this.open = false;
|
|
35
|
+
this.headline = "";
|
|
36
|
+
this.noCloseButton = false;
|
|
37
|
+
}
|
|
38
|
+
connectedCallback() {
|
|
39
|
+
super.connectedCallback();
|
|
40
|
+
this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);
|
|
41
|
+
this.modal = new Modal(this);
|
|
42
|
+
}
|
|
43
|
+
firstUpdated() {
|
|
44
|
+
this.dialog.hidden = !this.open;
|
|
45
|
+
if (this.open) {
|
|
46
|
+
this.addOpenListeners();
|
|
47
|
+
this.modal.activate();
|
|
48
|
+
lockBodyScrolling(this);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
disconnectedCallback() {
|
|
52
|
+
super.disconnectedCallback();
|
|
53
|
+
unlockBodyScrolling(this);
|
|
54
|
+
}
|
|
55
|
+
requestClose(source) {
|
|
56
|
+
const sdRequestClose = this.emit("sd-request-close", {
|
|
57
|
+
cancelable: true,
|
|
58
|
+
detail: { source }
|
|
59
|
+
});
|
|
60
|
+
if (sdRequestClose.defaultPrevented) {
|
|
61
|
+
const animation = getAnimation(this, "dialog.denyClose", { dir: this.localize.dir() });
|
|
62
|
+
animateTo(this.panel, animation.keyframes, animation.options);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
this.hide();
|
|
66
|
+
}
|
|
67
|
+
addOpenListeners() {
|
|
68
|
+
document.addEventListener("keydown", this.handleDocumentKeyDown);
|
|
69
|
+
}
|
|
70
|
+
removeOpenListeners() {
|
|
71
|
+
document.removeEventListener("keydown", this.handleDocumentKeyDown);
|
|
72
|
+
}
|
|
73
|
+
handleDocumentKeyDown(event) {
|
|
74
|
+
if (this.open && event.key === "Escape") {
|
|
75
|
+
event.stopPropagation();
|
|
76
|
+
this.requestClose("keyboard");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
async handleOpenChange() {
|
|
80
|
+
if (this.open) {
|
|
81
|
+
this.emit("sd-show");
|
|
82
|
+
this.addOpenListeners();
|
|
83
|
+
this.originalTrigger = document.activeElement;
|
|
84
|
+
this.modal.activate();
|
|
85
|
+
lockBodyScrolling(this);
|
|
86
|
+
const autoFocusTarget = this.querySelector("[autofocus]");
|
|
87
|
+
if (autoFocusTarget) {
|
|
88
|
+
autoFocusTarget.removeAttribute("autofocus");
|
|
89
|
+
}
|
|
90
|
+
await Promise.all([stopAnimations(this.dialog), stopAnimations(this.overlay)]);
|
|
91
|
+
this.dialog.hidden = false;
|
|
92
|
+
requestAnimationFrame(() => {
|
|
93
|
+
const slInitialFocus = this.emit("sd-initial-focus", { cancelable: true });
|
|
94
|
+
if (!slInitialFocus.defaultPrevented) {
|
|
95
|
+
if (autoFocusTarget) {
|
|
96
|
+
autoFocusTarget.focus({ preventScroll: true });
|
|
97
|
+
} else {
|
|
98
|
+
this.panel.focus({ preventScroll: true });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (autoFocusTarget) {
|
|
102
|
+
autoFocusTarget.setAttribute("autofocus", "");
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
const panelAnimation = getAnimation(this, "dialog.show", { dir: this.localize.dir() });
|
|
106
|
+
const overlayAnimation = getAnimation(this, "dialog.overlay.show", { dir: this.localize.dir() });
|
|
107
|
+
await Promise.all([
|
|
108
|
+
animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),
|
|
109
|
+
animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)
|
|
110
|
+
]);
|
|
111
|
+
this.emit("sd-after-show");
|
|
112
|
+
} else {
|
|
113
|
+
this.emit("sd-hide");
|
|
114
|
+
this.removeOpenListeners();
|
|
115
|
+
this.modal.deactivate();
|
|
116
|
+
await Promise.all([stopAnimations(this.dialog), stopAnimations(this.overlay)]);
|
|
117
|
+
const panelAnimation = getAnimation(this, "dialog.hide", { dir: this.localize.dir() });
|
|
118
|
+
const overlayAnimation = getAnimation(this, "dialog.overlay.hide", { dir: this.localize.dir() });
|
|
119
|
+
await Promise.all([
|
|
120
|
+
animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options).then(() => {
|
|
121
|
+
this.overlay.hidden = true;
|
|
122
|
+
}),
|
|
123
|
+
animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options).then(() => {
|
|
124
|
+
this.panel.hidden = true;
|
|
125
|
+
})
|
|
126
|
+
]);
|
|
127
|
+
this.dialog.hidden = true;
|
|
128
|
+
this.overlay.hidden = false;
|
|
129
|
+
this.panel.hidden = false;
|
|
130
|
+
unlockBodyScrolling(this);
|
|
131
|
+
const trigger = this.originalTrigger;
|
|
132
|
+
if (typeof (trigger == null ? void 0 : trigger.focus) === "function") {
|
|
133
|
+
setTimeout(() => trigger.focus());
|
|
134
|
+
}
|
|
135
|
+
this.emit("sd-after-hide");
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/** Shows the dialog. */
|
|
139
|
+
async show() {
|
|
140
|
+
if (this.open) {
|
|
141
|
+
return void 0;
|
|
142
|
+
}
|
|
143
|
+
this.open = true;
|
|
144
|
+
return waitForEvent(this, "sd-after-show");
|
|
145
|
+
}
|
|
146
|
+
/** Hides the dialog */
|
|
147
|
+
async hide() {
|
|
148
|
+
if (!this.open) {
|
|
149
|
+
return void 0;
|
|
150
|
+
}
|
|
151
|
+
this.open = false;
|
|
152
|
+
return waitForEvent(this, "sd-after-hide");
|
|
153
|
+
}
|
|
154
|
+
render() {
|
|
155
|
+
return html`<div part="base" class="${cx(
|
|
156
|
+
"flex items-center justify-center fixed inset-0 z-dialog",
|
|
157
|
+
this.hasSlotController.test("footer") && "dialog--has-footer"
|
|
158
|
+
)}"><div part="overlay" class="fixed inset-0 bg-primary-800 opacity-90" @click="${() => this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${cx(
|
|
159
|
+
"flex flex-col z-20 bg-white focus:outline-none py-4 sm:py-8 relative gap-6",
|
|
160
|
+
this.open && "flex opacity-100"
|
|
161
|
+
)}" role="dialog" aria-modal="true" aria-hidden="${this.open ? "false" : "true"}" aria-label="${this.headline}" aria-labelledby="title" tabindex="0"><header part="header" class="flex flex-grow-0 flex-shrink-0 basis-auto px-6 sm:px-10"><h2 part="title" class="flex-auto m-0" id="title">${this.headline.length > 0 ? html`<h4 class="sd-headline sd-headline--size-3xl leading-tight">${this.headline}</h4>` : html`<slot name="headline"></slot>`}</h2>${!this.noCloseButton ? html`<sd-button part="close-button" variant="tertiary" exportparts="base:close-button__base" class="${cx("absolute top-2 right-2")}" name="x-lg" @click="${() => this.requestClose("close-button")}" type="button"><sd-icon name="system/close" library="global-resources" color="currentColor"></sd-icon></sd-button>` : ""}</header><main part="body" class="flex flex-auto overflow-auto w-full px-6 sm:px-10"><slot></slot></main><footer part="footer" class="flex flex-grow-0 flex-shrink-0 basis-auto ml-auto gap-4 px-6 sm:px-10"><slot name="footer"></slot></footer></div></div>`;
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
SdDialog.styles = [
|
|
165
|
+
componentStyles,
|
|
166
|
+
unsafeCSS(HeadlineStyles),
|
|
167
|
+
SolidElement.styles,
|
|
168
|
+
css`:host{--width:662px}[part=panel]{width:var(--width);max-height:80vh}[part=body]{-webkit-overflow-scrolling:touch}@media (max-width:414px){:host{--width:335px}[part=footer]{width:100%}}`
|
|
169
|
+
];
|
|
170
|
+
__decorateClass([
|
|
171
|
+
query('[part="base"]')
|
|
172
|
+
], SdDialog.prototype, "dialog", 2);
|
|
173
|
+
__decorateClass([
|
|
174
|
+
query('[part="panel"]')
|
|
175
|
+
], SdDialog.prototype, "panel", 2);
|
|
176
|
+
__decorateClass([
|
|
177
|
+
query('[part="overlay"]')
|
|
178
|
+
], SdDialog.prototype, "overlay", 2);
|
|
179
|
+
__decorateClass([
|
|
180
|
+
property({ type: Boolean, reflect: true })
|
|
181
|
+
], SdDialog.prototype, "open", 2);
|
|
182
|
+
__decorateClass([
|
|
183
|
+
property({ reflect: true })
|
|
184
|
+
], SdDialog.prototype, "headline", 2);
|
|
185
|
+
__decorateClass([
|
|
186
|
+
property({ attribute: "no-close-button", type: Boolean, reflect: true })
|
|
187
|
+
], SdDialog.prototype, "noCloseButton", 2);
|
|
188
|
+
__decorateClass([
|
|
189
|
+
watch("open", { waitUntilFirstUpdate: true })
|
|
190
|
+
], SdDialog.prototype, "handleOpenChange", 1);
|
|
191
|
+
SdDialog = __decorateClass([
|
|
192
|
+
customElement("sd-dialog")
|
|
193
|
+
], SdDialog);
|
|
194
|
+
setDefaultAnimation("dialog.show", {
|
|
195
|
+
keyframes: [
|
|
196
|
+
{ opacity: 0, scale: 0.8 },
|
|
197
|
+
{ opacity: 1, scale: 1 }
|
|
198
|
+
],
|
|
199
|
+
options: { duration: 250, easing: "ease" }
|
|
200
|
+
});
|
|
201
|
+
setDefaultAnimation("dialog.hide", {
|
|
202
|
+
keyframes: [
|
|
203
|
+
{ opacity: 1, scale: 1 },
|
|
204
|
+
{ opacity: 0, scale: 0.8 }
|
|
205
|
+
],
|
|
206
|
+
options: { duration: 250, easing: "ease" }
|
|
207
|
+
});
|
|
208
|
+
setDefaultAnimation("dialog.denyClose", {
|
|
209
|
+
keyframes: [{ scale: 1 }, { scale: 1.02 }, { scale: 1 }],
|
|
210
|
+
options: { duration: 250 }
|
|
211
|
+
});
|
|
212
|
+
setDefaultAnimation("dialog.overlay.show", {
|
|
213
|
+
keyframes: [{ opacity: 0 }, { opacity: 1 }],
|
|
214
|
+
options: { duration: 250 }
|
|
215
|
+
});
|
|
216
|
+
setDefaultAnimation("dialog.overlay.hide", {
|
|
217
|
+
keyframes: [{ opacity: 1 }, { opacity: 0 }],
|
|
218
|
+
options: { duration: 250 }
|
|
219
|
+
});
|
|
220
|
+
export {
|
|
221
|
+
SdDialog as default
|
|
222
|
+
};
|
|
@@ -40,6 +40,7 @@ export default class SdInput extends SolidElement implements SolidFormControl {
|
|
|
40
40
|
autocomplete: string;
|
|
41
41
|
autofocus: boolean;
|
|
42
42
|
enterkeyhint: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
43
|
+
styleOnValid: boolean;
|
|
43
44
|
spellcheck: boolean;
|
|
44
45
|
get valueAsDate(): Date | null;
|
|
45
46
|
set valueAsDate(newValue: Date | null);
|
|
@@ -60,6 +60,7 @@ let SdInput = class extends SolidElement {
|
|
|
60
60
|
this.name = "";
|
|
61
61
|
this.title = "";
|
|
62
62
|
this.required = false;
|
|
63
|
+
this.styleOnValid = false;
|
|
63
64
|
this.spellcheck = true;
|
|
64
65
|
}
|
|
65
66
|
/** Gets or sets the current value as a `Date` object. Returns `null` if the value can't be converted. */
|
|
@@ -214,7 +215,7 @@ let SdInput = class extends SolidElement {
|
|
|
214
215
|
const hasLabel = this.label ? true : !!slots["label"];
|
|
215
216
|
const hasHelpText = this.helpText ? true : !!slots["helpText"];
|
|
216
217
|
const hasClearIcon = this.clearable && !this.readonly && (typeof this.value === "number" || this.value.length > 0);
|
|
217
|
-
const inputState = this.disabled ? "disabled" : this.readonly ? "readonly" : this.hasFocus && this.showInvalidStyle ? "activeInvalid" : this.hasFocus && this.showValidStyle ? "activeValid" : this.hasFocus ? "active" : this.showInvalidStyle ? "invalid" : this.showValidStyle ? "valid" : "default";
|
|
218
|
+
const inputState = this.disabled ? "disabled" : this.readonly ? "readonly" : this.hasFocus && this.showInvalidStyle ? "activeInvalid" : this.hasFocus && this.styleOnValid && this.showValidStyle ? "activeValid" : this.hasFocus ? "active" : this.showInvalidStyle ? "invalid" : this.styleOnValid && this.showValidStyle ? "valid" : "default";
|
|
218
219
|
const textSize = this.size === "sm" ? "text-sm" : "text-base";
|
|
219
220
|
const textColor = {
|
|
220
221
|
disabled: "text-neutral-500",
|
|
@@ -255,7 +256,7 @@ let SdInput = class extends SolidElement {
|
|
|
255
256
|
"min-w-0 flex-grow focus:outline-none bg-transparent placeholder-neutral-700",
|
|
256
257
|
this.size === "sm" ? "h-6" : "h-8",
|
|
257
258
|
textSize
|
|
258
|
-
)}" type="${this.type === "password" && this.passwordVisible ? "text" : this.type}" title="${this.title}" name="${ifDefined(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${ifDefined(this.placeholder)}" minlength="${ifDefined(this.minlength)}" maxlength="${ifDefined(this.maxlength)}" min="${ifDefined(this.min)}" max="${ifDefined(this.max)}" step="${ifDefined(this.step)}" .value="${live(this.value)}" autocapitalize="${ifDefined(this.type === "password" ? "off" : this.autocapitalize)}" autocomplete="${ifDefined(this.type === "password" ? "off" : this.autocomplete)}" autocorrect="${ifDefined(this.type === "password" ? "off" : this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${ifDefined(this.pattern)}" enterkeyhint="${ifDefined(this.enterkeyhint)}" inputmode="${ifDefined(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${hasClearIcon ? html`<button part="clear-button" class="${cx("flex justify-center ", iconMarginLeft)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${cx("text-neutral-500", iconSize)}" library="system" name="closing-round"></sd-icon></slot></button>` : ""} ${this.passwordToggle && this.type === "password" ? html`<button aria-label="${this.localize.term(this.passwordVisible ? "hidePassword" : "showPassword")}" part="password-toggle-button" class="flex items-center" type="button" @click="${this.handlePasswordToggle}" tabindex="-1">${this.passwordVisible ? html`<slot name="show-password-icon"><sd-icon class="${cx(iconColor, iconMarginLeft, iconSize)}" library="system" name="eye"></sd-icon></slot>` : html`<slot name="hide-password-icon"><sd-icon class="${cx(iconColor, iconMarginLeft, iconSize)}" library="system" name="eye-crossed-out"></sd-icon></slot>`}</button>` : ""} ${(this.type === "date" || this.type === "datetime-local") && !isFirefox ? html`<sd-icon class="${cx(iconColor, iconMarginLeft, iconSize)}" library="system" name="calendar"></sd-icon>` : ""} ${this.type === "time" ? html`<sd-icon class="${cx(iconColor, iconMarginLeft, iconSize)}" library="system" name="clock"></sd-icon>` : ""} ${this.showInvalidStyle ? html`<sd-icon part="invalid-icon" class="${cx("text-error", iconMarginLeft, iconSize)}" library="system" name="risk"></sd-icon>` : ""} ${this.showValidStyle ? html`<sd-icon class="${cx("text-success", iconMarginLeft, iconSize)}" library="system" name="confirm" part="valid-icon"></sd-icon>` : ""} ${slots["right"] ? html`<slot name="right" part="right" class="${cx("inline-flex", iconColor, iconMarginLeft, iconSize)}"></slot>` : ""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${cx("text-sm text-neutral-700", hasHelpText ? "block" : "hidden")}" aria-hidden="${!hasHelpText}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`;
|
|
259
|
+
)}" type="${this.type === "password" && this.passwordVisible ? "text" : this.type}" title="${this.title}" name="${ifDefined(this.name)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${ifDefined(this.placeholder)}" minlength="${ifDefined(this.minlength)}" maxlength="${ifDefined(this.maxlength)}" min="${ifDefined(this.min)}" max="${ifDefined(this.max)}" step="${ifDefined(this.step)}" .value="${live(this.value)}" autocapitalize="${ifDefined(this.type === "password" ? "off" : this.autocapitalize)}" autocomplete="${ifDefined(this.type === "password" ? "off" : this.autocomplete)}" autocorrect="${ifDefined(this.type === "password" ? "off" : this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${this.spellcheck}" pattern="${ifDefined(this.pattern)}" enterkeyhint="${ifDefined(this.enterkeyhint)}" inputmode="${ifDefined(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @keydown="${this.handleKeyDown}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${hasClearIcon ? html`<button part="clear-button" class="${cx("flex justify-center ", iconMarginLeft)}" type="button" aria-label="${this.localize.term("clearEntry")}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${cx("text-neutral-500", iconSize)}" library="system" name="closing-round"></sd-icon></slot></button>` : ""} ${this.passwordToggle && this.type === "password" ? html`<button aria-label="${this.localize.term(this.passwordVisible ? "hidePassword" : "showPassword")}" part="password-toggle-button" class="flex items-center" type="button" @click="${this.handlePasswordToggle}" tabindex="-1">${this.passwordVisible ? html`<slot name="show-password-icon"><sd-icon class="${cx(iconColor, iconMarginLeft, iconSize)}" library="system" name="eye"></sd-icon></slot>` : html`<slot name="hide-password-icon"><sd-icon class="${cx(iconColor, iconMarginLeft, iconSize)}" library="system" name="eye-crossed-out"></sd-icon></slot>`}</button>` : ""} ${(this.type === "date" || this.type === "datetime-local") && !isFirefox ? html`<sd-icon class="${cx(iconColor, iconMarginLeft, iconSize)}" library="system" name="calendar"></sd-icon>` : ""} ${this.type === "time" ? html`<sd-icon class="${cx(iconColor, iconMarginLeft, iconSize)}" library="system" name="clock"></sd-icon>` : ""} ${this.showInvalidStyle ? html`<sd-icon part="invalid-icon" class="${cx("text-error", iconMarginLeft, iconSize)}" library="system" name="risk"></sd-icon>` : ""} ${this.showValidStyle && this.styleOnValid ? html`<sd-icon class="${cx("text-success", iconMarginLeft, iconSize)}" library="system" name="confirm" part="valid-icon"></sd-icon>` : ""} ${slots["right"] ? html`<slot name="right" part="right" class="${cx("inline-flex", iconColor, iconMarginLeft, iconSize)}"></slot>` : ""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${cx("text-sm text-neutral-700", hasHelpText ? "block" : "hidden")}" aria-hidden="${!hasHelpText}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`;
|
|
259
260
|
}
|
|
260
261
|
};
|
|
261
262
|
SdInput.styles = [
|
|
@@ -365,6 +366,9 @@ __decorateClass([
|
|
|
365
366
|
__decorateClass([
|
|
366
367
|
property()
|
|
367
368
|
], SdInput.prototype, "enterkeyhint", 2);
|
|
369
|
+
__decorateClass([
|
|
370
|
+
property({ type: Boolean, reflect: true, attribute: "style-on-valid" })
|
|
371
|
+
], SdInput.prototype, "styleOnValid", 2);
|
|
368
372
|
__decorateClass([
|
|
369
373
|
property({
|
|
370
374
|
type: Boolean,
|
|
@@ -47,6 +47,7 @@ export default class SdSelect extends SolidElement implements SolidFormControl {
|
|
|
47
47
|
name: string;
|
|
48
48
|
value: string | string[];
|
|
49
49
|
required: boolean;
|
|
50
|
+
styleOnValid: boolean;
|
|
50
51
|
hoist: boolean;
|
|
51
52
|
getTag: (option: SdOption, index: number) => TemplateResult | string | HTMLElement;
|
|
52
53
|
get validity(): ValidityState;
|
|
@@ -60,6 +60,7 @@ let SdSelect = class extends SolidElement {
|
|
|
60
60
|
this.name = "";
|
|
61
61
|
this.value = "";
|
|
62
62
|
this.required = false;
|
|
63
|
+
this.styleOnValid = false;
|
|
63
64
|
this.hoist = false;
|
|
64
65
|
this.getTag = (option) => {
|
|
65
66
|
return html`<sd-tag ?disabled="${this.disabled}" part="tag" exportparts="
|
|
@@ -486,7 +487,7 @@ let SdSelect = class extends SolidElement {
|
|
|
486
487
|
const hasLabel = this.label ? true : !!slots["label"];
|
|
487
488
|
const hasHelpText = this.helpText ? true : !!slots["helpText"];
|
|
488
489
|
const hasClearIcon = this.clearable && !this.disabled && this.value.length > 0;
|
|
489
|
-
const selectState = this.disabled ? "disabled" : this.hasFocus && this.showInvalidStyle ? "activeInvalid" : this.hasFocus && this.showValidStyle ? "activeValid" : this.hasFocus || this.open ? "active" : this.showInvalidStyle ? "invalid" : this.showValidStyle ? "valid" : "default";
|
|
490
|
+
const selectState = this.disabled ? "disabled" : this.hasFocus && this.showInvalidStyle ? "activeInvalid" : this.hasFocus && this.styleOnValid && this.showValidStyle ? "activeValid" : this.hasFocus || this.open ? "active" : this.showInvalidStyle ? "invalid" : this.styleOnValid && this.showValidStyle ? "valid" : "default";
|
|
490
491
|
const cursorStyles = this.disabled ? "cursor-not-allowed" : "cursor-pointer";
|
|
491
492
|
const iconMarginLeft = { sm: "ml-1", md: "ml-2", lg: "ml-2" }[this.size];
|
|
492
493
|
const iconSize = {
|
|
@@ -541,7 +542,7 @@ let SdSelect = class extends SolidElement {
|
|
|
541
542
|
"appearance-none outline-none flex-grow bg-transparent",
|
|
542
543
|
cursorStyles,
|
|
543
544
|
this.multiple && this.useTags && this.value.length > 0 ? "hidden" : ""
|
|
544
|
-
)}" type="text" placeholder="${this.placeholder}" .disabled="${this.disabled}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open ? "true" : "false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled ? "true" : "false"}" aria-describedby="help-text" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${this.multiple && this.useTags ? html`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>` : ""} <input class="${cx("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10", cursorStyles)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value) ? this.value.join(", ") : this.value}" tabindex="-1" aria-hidden="true" @focus="${() => this.focus()}" @invalid="${this.handleInvalid}"> ${hasClearIcon ? html`<button part="clear-button" class="${cx("select__clear flex justify-center", iconMarginLeft)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${cx("text-neutral-500", iconSize)}" library="system" name="closing-round"></sd-icon></slot></button>` : ""} ${this.showInvalidStyle ? html`<sd-icon part="invalid-icon" class="${cx("text-error", iconMarginLeft, iconSize)}" library="system" name="risk"></sd-icon>` : ""} ${this.showValidStyle ? html`<sd-icon part="valid-icon" class="${cx("text-success", iconMarginLeft, iconSize)}" library="system" name="confirm"></sd-icon>` : ""}<slot name="expand-icon" part="expand-icon" class="${cx("inline-flex ml-2 transition-all", this.open ? "rotate-180" : "rotate-0", iconSize)}"><sd-icon name="chevron-down" part="chevron" library="system" color="currentColor"></sd-icon></slot></div><div id="listbox" role="listbox" aria-expanded="${this.open ? "true" : "false"}" aria-multiselectable="${this.multiple ? "true" : "false"}" aria-labelledby="label" part="listbox" class="${cx(
|
|
545
|
+
)}" type="text" placeholder="${this.placeholder}" .disabled="${this.disabled}" .value="${this.displayLabel}" autocomplete="off" spellcheck="false" autocapitalize="off" readonly="readonly" aria-controls="listbox" aria-expanded="${this.open ? "true" : "false"}" aria-haspopup="listbox" aria-labelledby="label" aria-disabled="${this.disabled ? "true" : "false"}" aria-describedby="help-text" role="combobox" tabindex="0" @focus="${this.handleFocus}" @blur="${this.handleBlur}"> ${this.multiple && this.useTags ? html`<div part="tags" class="flex-grow flex flex-wrap items-center gap-1">${this.tags}</div>` : ""} <input class="${cx("value-input absolute top-0 left-0 w-full h-full opacity-0 -z-10", cursorStyles)}" type="text" ?disabled="${this.disabled}" ?required="${this.required}" .value="${Array.isArray(this.value) ? this.value.join(", ") : this.value}" tabindex="-1" aria-hidden="true" @focus="${() => this.focus()}" @invalid="${this.handleInvalid}"> ${hasClearIcon ? html`<button part="clear-button" class="${cx("select__clear flex justify-center", iconMarginLeft)}" type="button" aria-label="${this.localize.term("clearEntry")}" @mousedown="${this.handleClearMouseDown}" @click="${this.handleClearClick}" tabindex="-1"><slot name="clear-icon"><sd-icon class="${cx("text-neutral-500", iconSize)}" library="system" name="closing-round"></sd-icon></slot></button>` : ""} ${this.showInvalidStyle ? html`<sd-icon part="invalid-icon" class="${cx("text-error", iconMarginLeft, iconSize)}" library="system" name="risk"></sd-icon>` : ""} ${this.styleOnValid && this.showValidStyle ? html`<sd-icon part="valid-icon" class="${cx("text-success", iconMarginLeft, iconSize)}" library="system" name="confirm"></sd-icon>` : ""}<slot name="expand-icon" part="expand-icon" class="${cx("inline-flex ml-2 transition-all", this.open ? "rotate-180" : "rotate-0", iconSize)}"><sd-icon name="chevron-down" part="chevron" library="system" color="currentColor"></sd-icon></slot></div><div id="listbox" role="listbox" aria-expanded="${this.open ? "true" : "false"}" aria-multiselectable="${this.multiple ? "true" : "false"}" aria-labelledby="label" part="listbox" class="${cx(
|
|
545
546
|
"bg-white px-2 py-3 relative",
|
|
546
547
|
this.currentPlacement === "bottom" ? "border-r-2 border-b-2 border-l-2 rounded-br-default rounded-bl-default" : "border-r-2 border-t-2 border-l-2 rounded-tr-default rounded-tl-default"
|
|
547
548
|
)}" tabindex="-1" @mouseup="${this.handleOptionClick}" @slotchange="${this.handleDefaultSlotChange}"><slot></slot></div></sd-popup></div><div class="text-sm text-neutral-700" part="form-control-help-text" id="help-text" aria-hidden="${hasHelpText ? "false" : "true"}"><slot name="help-text">${this.helpText}</slot></div></div>${this.formControlController.renderInvalidMessage()}`;
|
|
@@ -655,6 +656,9 @@ __decorateClass([
|
|
|
655
656
|
__decorateClass([
|
|
656
657
|
property({ type: Boolean, reflect: true })
|
|
657
658
|
], SdSelect.prototype, "required", 2);
|
|
659
|
+
__decorateClass([
|
|
660
|
+
property({ type: Boolean, reflect: true, attribute: "style-on-valid" })
|
|
661
|
+
], SdSelect.prototype, "styleOnValid", 2);
|
|
658
662
|
__decorateClass([
|
|
659
663
|
property({ type: Boolean })
|
|
660
664
|
], SdSelect.prototype, "hoist", 2);
|
|
@@ -27,6 +27,7 @@ export default class SdTextarea extends SolidElement implements SolidFormControl
|
|
|
27
27
|
autocomplete: string;
|
|
28
28
|
autofocus: boolean;
|
|
29
29
|
enterkeyhint: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
30
|
+
styleOnValid: boolean;
|
|
30
31
|
spellcheck: boolean;
|
|
31
32
|
inputmode: 'none' | 'text';
|
|
32
33
|
defaultValue: string;
|
|
@@ -41,6 +41,7 @@ let SdTextarea = class extends SolidElement {
|
|
|
41
41
|
this.readonly = false;
|
|
42
42
|
this.form = "";
|
|
43
43
|
this.required = false;
|
|
44
|
+
this.styleOnValid = false;
|
|
44
45
|
this.spellcheck = true;
|
|
45
46
|
this.defaultValue = "";
|
|
46
47
|
}
|
|
@@ -153,6 +154,7 @@ let SdTextarea = class extends SolidElement {
|
|
|
153
154
|
}
|
|
154
155
|
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
155
156
|
reportValidity() {
|
|
157
|
+
this.formControlController.fakeUserInteraction();
|
|
156
158
|
return this.textarea.reportValidity();
|
|
157
159
|
}
|
|
158
160
|
/** Sets a custom validation message. Pass an empty string to restore validity. */
|
|
@@ -167,7 +169,7 @@ let SdTextarea = class extends SolidElement {
|
|
|
167
169
|
};
|
|
168
170
|
const hasLabel = this.label ? true : !!slots["label"];
|
|
169
171
|
const hasHelpText = this.helpText ? true : !!slots["helpText"];
|
|
170
|
-
const textareaState = this.disabled ? "disabled" : this.readonly ? "readonly" : this.hasFocus && this.showInvalidStyle ? "activeInvalid" : this.hasFocus && this.showValidStyle ? "activeValid" : this.hasFocus ? "active" : this.showInvalidStyle ? "invalid" : this.showValidStyle ? "valid" : "default";
|
|
172
|
+
const textareaState = this.disabled ? "disabled" : this.readonly ? "readonly" : this.hasFocus && this.showInvalidStyle ? "activeInvalid" : this.hasFocus && this.styleOnValid && this.showValidStyle ? "activeValid" : this.hasFocus ? "active" : this.showInvalidStyle ? "invalid" : this.styleOnValid && this.showValidStyle ? "valid" : "default";
|
|
171
173
|
const textSize = this.size === "sm" ? "text-sm" : "text-base";
|
|
172
174
|
const iconSizeMarginLeft = {
|
|
173
175
|
sm: "text-base ml-1",
|
|
@@ -209,7 +211,7 @@ let SdTextarea = class extends SolidElement {
|
|
|
209
211
|
"flex-grow focus:outline-none bg-transparent placeholder-neutral-700 resize-none",
|
|
210
212
|
this.disabled && "cursor-not-allowed",
|
|
211
213
|
textSize
|
|
212
|
-
)}" title="${this.title}" name="${ifDefined(this.name)}" .value="${live(this.value)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${ifDefined(this.placeholder)}" minlength="${ifDefined(this.minlength)}" maxlength="${ifDefined(this.maxlength)}" rows="${ifDefined(this.rows)}" autocapitalize="${ifDefined(this.autocapitalize)}" autocorrect="${ifDefined(this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${ifDefined(this.spellcheck)}" enterkeyhint="${ifDefined(this.enterkeyhint)}" inputmode="${ifDefined(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"></textarea> ${this.showInvalidStyle ? html`<sd-icon class="${cx("text-error absolute right-4 bg-white group-hover:bg-neutral-200", iconSizeMarginLeft)}" library="system" name="risk"></sd-icon>` : ""} ${this.showValidStyle ? html`<sd-icon class="${cx("text-success absolute right-4 bg-white group-hover:bg-neutral-200", iconSizeMarginLeft)}" library="system" name="confirm"></sd-icon>` : ""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${cx("text-sm text-neutral-700", hasHelpText ? "block" : "hidden")}" aria-hidden="${hasHelpText ? "false" : "true"}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`;
|
|
214
|
+
)}" title="${this.title}" name="${ifDefined(this.name)}" .value="${live(this.value)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" placeholder="${ifDefined(this.placeholder)}" minlength="${ifDefined(this.minlength)}" maxlength="${ifDefined(this.maxlength)}" rows="${ifDefined(this.rows)}" autocapitalize="${ifDefined(this.autocapitalize)}" autocorrect="${ifDefined(this.autocorrect)}" ?autofocus="${this.autofocus}" spellcheck="${ifDefined(this.spellcheck)}" enterkeyhint="${ifDefined(this.enterkeyhint)}" inputmode="${ifDefined(this.inputmode)}" aria-describedby="help-text" @change="${this.handleChange}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @focus="${this.handleFocus}" @blur="${this.handleBlur}"></textarea> ${this.showInvalidStyle ? html`<sd-icon class="${cx("text-error absolute right-4 bg-white group-hover:bg-neutral-200", iconSizeMarginLeft)}" library="system" name="risk" part="invalid-icon"></sd-icon>` : ""} ${this.styleOnValid && this.showValidStyle ? html`<sd-icon class="${cx("text-success absolute right-4 bg-white group-hover:bg-neutral-200", iconSizeMarginLeft)}" library="system" name="confirm" part="valid-icon"></sd-icon>` : ""}</div></div><slot name="help-text" part="form-control-help-text" id="help-text" class="${cx("text-sm text-neutral-700", hasHelpText ? "block" : "hidden")}" aria-hidden="${hasHelpText ? "false" : "true"}">${this.helpText}</slot></div>${this.formControlController.renderInvalidMessage()}`;
|
|
213
215
|
}
|
|
214
216
|
};
|
|
215
217
|
SdTextarea.styles = [
|
|
@@ -289,6 +291,9 @@ __decorateClass([
|
|
|
289
291
|
__decorateClass([
|
|
290
292
|
property()
|
|
291
293
|
], SdTextarea.prototype, "enterkeyhint", 2);
|
|
294
|
+
__decorateClass([
|
|
295
|
+
property({ type: Boolean, reflect: true, attribute: "style-on-valid" })
|
|
296
|
+
], SdTextarea.prototype, "styleOnValid", 2);
|
|
292
297
|
__decorateClass([
|
|
293
298
|
property({
|
|
294
299
|
type: Boolean,
|
|
@@ -7,6 +7,7 @@ export { default as SdCarousel } from './components/carousel/carousel';
|
|
|
7
7
|
export { default as SdCarouselItem } from './components/carousel-item/carousel-item';
|
|
8
8
|
export { default as SdCheckbox } from './components/checkbox/checkbox';
|
|
9
9
|
export { default as SdCheckboxGroup } from './components/checkbox-group/checkbox-group';
|
|
10
|
+
export { default as SdDialog } from './components/dialog/dialog';
|
|
10
11
|
export { default as SdDivider } from './components/divider/divider';
|
|
11
12
|
export { default as SdDrawer } from './components/drawer/drawer';
|
|
12
13
|
export { default as SdDropdown } from './components/dropdown/dropdown';
|
|
@@ -7,29 +7,30 @@ import { default as default7 } from "./components/carousel/carousel.js";
|
|
|
7
7
|
import { default as default8 } from "./components/carousel-item/carousel-item.js";
|
|
8
8
|
import { default as default9 } from "./components/checkbox/checkbox.js";
|
|
9
9
|
import { default as default10 } from "./components/checkbox-group/checkbox-group.js";
|
|
10
|
-
import { default as default11 } from "./components/
|
|
11
|
-
import { default as default12 } from "./components/
|
|
12
|
-
import { default as default13 } from "./components/
|
|
13
|
-
import { default as default14 } from "./components/
|
|
14
|
-
import { default as default15 } from "./components/
|
|
15
|
-
import { default as default16 } from "./components/
|
|
16
|
-
import { default as default17 } from "./components/
|
|
17
|
-
import { default as default18 } from "./components/
|
|
18
|
-
import { default as default19 } from "./components/
|
|
19
|
-
import { default as default20 } from "./components/
|
|
20
|
-
import { default as default21 } from "./components/
|
|
21
|
-
import { default as default22 } from "./components/
|
|
22
|
-
import { default as default23 } from "./components/
|
|
23
|
-
import { default as default24 } from "./components/radio
|
|
24
|
-
import { default as default25 } from "./components/radio-
|
|
25
|
-
import { default as default26 } from "./components/
|
|
26
|
-
import { default as default27 } from "./components/
|
|
27
|
-
import { default as default28 } from "./components/
|
|
28
|
-
import { default as default29 } from "./components/
|
|
29
|
-
import { default as default30 } from "./components/
|
|
30
|
-
import { default as default31 } from "./components/
|
|
31
|
-
import { default as default32 } from "./components/
|
|
32
|
-
import { default as default33 } from "./components/
|
|
10
|
+
import { default as default11 } from "./components/dialog/dialog.js";
|
|
11
|
+
import { default as default12 } from "./components/divider/divider.js";
|
|
12
|
+
import { default as default13 } from "./components/drawer/drawer.js";
|
|
13
|
+
import { default as default14 } from "./components/dropdown/dropdown.js";
|
|
14
|
+
import { default as default15 } from "./components/header/header.js";
|
|
15
|
+
import { default as default16 } from "./components/icon/icon.js";
|
|
16
|
+
import { default as default17 } from "./components/include/include.js";
|
|
17
|
+
import { default as default18 } from "./components/input/input.js";
|
|
18
|
+
import { default as default19 } from "./components/link/link.js";
|
|
19
|
+
import { default as default20 } from "./components/navigation-item/navigation-item.js";
|
|
20
|
+
import { default as default21 } from "./components/notification/notification.js";
|
|
21
|
+
import { default as default22 } from "./components/option/option.js";
|
|
22
|
+
import { default as default23 } from "./components/popup/popup.js";
|
|
23
|
+
import { default as default24 } from "./components/radio/radio.js";
|
|
24
|
+
import { default as default25 } from "./components/radio-button/radio-button.js";
|
|
25
|
+
import { default as default26 } from "./components/radio-group/radio-group.js";
|
|
26
|
+
import { default as default27 } from "./components/select/select.js";
|
|
27
|
+
import { default as default28 } from "./components/spinner/spinner.js";
|
|
28
|
+
import { default as default29 } from "./components/switch/switch.js";
|
|
29
|
+
import { default as default30 } from "./components/tag/tag.js";
|
|
30
|
+
import { default as default31 } from "./components/teaser/teaser.js";
|
|
31
|
+
import { default as default32 } from "./components/textarea/textarea.js";
|
|
32
|
+
import { default as default33 } from "./components/tooltip/tooltip.js";
|
|
33
|
+
import { default as default34 } from "./components/video/video.js";
|
|
33
34
|
import { registerIconLibrary, unregisterIconLibrary } from "./components/icon/library.js";
|
|
34
35
|
import { LocalizeController } from "./utilities/localize.js";
|
|
35
36
|
export {
|
|
@@ -43,29 +44,30 @@ export {
|
|
|
43
44
|
default8 as SdCarouselItem,
|
|
44
45
|
default9 as SdCheckbox,
|
|
45
46
|
default10 as SdCheckboxGroup,
|
|
46
|
-
default11 as
|
|
47
|
-
default12 as
|
|
48
|
-
default13 as
|
|
49
|
-
default14 as
|
|
50
|
-
default15 as
|
|
51
|
-
default16 as
|
|
52
|
-
default17 as
|
|
53
|
-
default18 as
|
|
54
|
-
default19 as
|
|
55
|
-
default20 as
|
|
56
|
-
default21 as
|
|
57
|
-
default22 as
|
|
58
|
-
default23 as
|
|
59
|
-
default24 as
|
|
60
|
-
default25 as
|
|
61
|
-
default26 as
|
|
62
|
-
default27 as
|
|
63
|
-
default28 as
|
|
64
|
-
default29 as
|
|
65
|
-
default30 as
|
|
66
|
-
default31 as
|
|
67
|
-
default32 as
|
|
68
|
-
default33 as
|
|
47
|
+
default11 as SdDialog,
|
|
48
|
+
default12 as SdDivider,
|
|
49
|
+
default13 as SdDrawer,
|
|
50
|
+
default14 as SdDropdown,
|
|
51
|
+
default15 as SdHeader,
|
|
52
|
+
default16 as SdIcon,
|
|
53
|
+
default17 as SdInclude,
|
|
54
|
+
default18 as SdInput,
|
|
55
|
+
default19 as SdLink,
|
|
56
|
+
default20 as SdNavigationItem,
|
|
57
|
+
default21 as SdNotification,
|
|
58
|
+
default22 as SdOption,
|
|
59
|
+
default23 as SdPopup,
|
|
60
|
+
default24 as SdRadio,
|
|
61
|
+
default25 as SdRadioButton,
|
|
62
|
+
default26 as SdRadioGroup,
|
|
63
|
+
default27 as SdSelect,
|
|
64
|
+
default28 as SdSpinner,
|
|
65
|
+
default29 as SdSwitch,
|
|
66
|
+
default30 as SdTag,
|
|
67
|
+
default31 as SdTeaser,
|
|
68
|
+
default32 as SdTextarea,
|
|
69
|
+
default33 as SdTooltip,
|
|
70
|
+
default34 as SdVideo,
|
|
69
71
|
registerIconLibrary,
|
|
70
72
|
unregisterIconLibrary
|
|
71
73
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const HeadlineStyles = ".sd-headline{--tw-text-opacity:1;color:rgb(var(--sd-color-primary,0 53 142)/var(--tw-text-opacity));display:flex;font-size:var(--sd-font-size-3xl,2rem);font-weight:700;gap:var(--sd-spacing-4,1rem)}@media (min-width:640px){.sd-headline{font-size:var(--sd-font-size-4xl,2.5rem)}}.sd-headline sd-icon{--tw-text-opacity:1;color:rgb(var(--sd-color-primary,0 53 142)/var(--tw-text-opacity));flex-shrink:0;font-size:3rem}@media (min-width:640px){.sd-headline sd-icon{margin-top:var(--sd-spacing-2,.5rem)}}.sd-headline--size-3xl{font-size:var(--sd-font-size-2xl,1.75rem)}@media (min-width:640px){.sd-headline--size-3xl{font-size:var(--sd-font-size-3xl,2rem)}}.sd-headline--size-3xl sd-icon{margin-top:calc(var(--sd-spacing-1, .25rem)*-1)}@media (min-width:640px){.sd-headline--size-3xl sd-icon{margin-top:var(--sd-spacing-0,0)}}.sd-headline--size-base,.sd-headline--size-lg,.sd-headline--size-xl{--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity));gap:var(--sd-spacing-2,.5rem)}.sd-headline--size-base sd-icon,.sd-headline--size-lg sd-icon,.sd-headline--size-xl sd-icon{font-size:2rem}.sd-headline--size-xl{font-size:var(--sd-font-size-xl,1.5rem)}.sd-headline--size-xl sd-icon{margin-top:var(--sd-spacing-0-5,.125rem)}@media (min-width:640px){.sd-headline--size-xl sd-icon{margin-top:var(--sd-spacing-0-5,.125rem)}}.sd-headline--size-lg{font-size:var(--sd-font-size-lg,1.25rem)}.sd-headline--size-lg sd-icon{margin-top:var(--sd-spacing-0,0)}@media (min-width:640px){.sd-headline--size-lg sd-icon{margin-top:var(--sd-spacing-0,0)}}.sd-headline--size-base{--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity));font-size:var(--sd-font-size-base,1rem)}.sd-headline--size-base sd-icon{margin-top:calc(var(--sd-spacing-1, .25rem)*-1)}.sd-headline--size-base mark{color:inherit}.sd-headline--inverted,.sd-headline--inverted sd-icon{--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255)/var(--tw-text-opacity))}.sd-headline--inline{display:inline}.sd-headline--inline sd-icon{margin-right:var(--sd-spacing-2,.5rem);margin-top:calc(var(--sd-spacing-1, .25rem)*-1);vertical-align:middle}.sd-headline--inline.sd-headline--size-base sd-icon,.sd-headline--inline.sd-headline--size-lg sd-icon,.sd-headline--inline.sd-headline--size-xl sd-icon{margin-right:var(--sd-spacing-0-5,.125rem)}";
|
|
2
|
+
export {
|
|
3
|
+
HeadlineStyles as default
|
|
4
|
+
};
|