@solid-design-system/components 1.25.0 → 1.26.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/accordion-group.js +1 -1
- package/dist/components/es/accordion.js +1 -1
- package/dist/components/es/carousel.js +1 -1
- package/dist/components/es/checkbox-group.js +1 -1
- package/dist/components/es/checkbox.js +1 -1
- package/dist/components/es/directive.js +6 -0
- package/dist/components/es/drawer.js +1 -1
- package/dist/components/es/icon.js +3 -8
- package/dist/components/es/input.js +1 -1
- package/dist/components/es/live.js +1 -1
- package/dist/components/es/radio.js +1 -1
- package/dist/components/es/solid-components2.js +1 -1
- package/dist/components/es/solid-element.js +1 -1
- package/dist/components/es/switch.js +1 -0
- package/dist/components/umd/solid-components.js +10 -10
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/switch/switch.d.ts +37 -0
- package/dist/package/components/switch/switch.js +162 -0
- package/dist/package/solid-components.d.ts +1 -0
- package/dist/package/solid-components.js +10 -8
- 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/directive.js +6 -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 +3 -8
- 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/live.js +1 -1
- package/dist/versioned-components/es/navigation-item.js +1 -1
- package/dist/versioned-components/es/popup.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/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 -0
- package/dist/versioned-components/es/tag.js +1 -1
- package/dist/versioned-components/es/teaser.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/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 +6 -6
- 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 +1 -1
- package/dist/versioned-package/components/input/input.js +4 -4
- 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/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-group/radio-group.d.ts +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.js +14 -14
- 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 +37 -0
- package/dist/versioned-package/components/switch/switch.js +162 -0
- 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/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 +2 -2
- package/dist/versioned-package/solid-components.d.ts +1 -0
- package/dist/versioned-package/solid-components.js +10 -8
- package/dist/versioned-package/styles/form-control.styles.js +1 -1
- 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 +110 -26
- package/dist/web-types.json +207 -1
- package/package.json +2 -2
|
@@ -72,10 +72,10 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
72
72
|
this.formControlController.updateValidity();
|
|
73
73
|
}
|
|
74
74
|
getAllRadios() {
|
|
75
|
-
return [...this.querySelectorAll("sd-1-
|
|
75
|
+
return [...this.querySelectorAll("sd-1-26-0-radio, sd-1-26-0-radio-button")];
|
|
76
76
|
}
|
|
77
77
|
handleRadioClick(event) {
|
|
78
|
-
const target = event.target.closest("sd-1-
|
|
78
|
+
const target = event.target.closest("sd-1-26-0-radio, sd-1-26-0-radio-button");
|
|
79
79
|
const radios = this.getAllRadios();
|
|
80
80
|
const oldValue = this.value;
|
|
81
81
|
if (target.disabled) {
|
|
@@ -85,7 +85,7 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
85
85
|
radios.forEach((radio) => radio.checked = radio === target);
|
|
86
86
|
if (this.value !== oldValue) {
|
|
87
87
|
this.emit("sd-change");
|
|
88
|
-
this.emit("sd-1-
|
|
88
|
+
this.emit("sd-1-26-0-input");
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
handleKeyDown(event) {
|
|
@@ -119,7 +119,7 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
119
119
|
}
|
|
120
120
|
if (this.value !== oldValue) {
|
|
121
121
|
this.emit("sd-change");
|
|
122
|
-
this.emit("sd-1-
|
|
122
|
+
this.emit("sd-1-26-0-input");
|
|
123
123
|
}
|
|
124
124
|
event.preventDefault();
|
|
125
125
|
}
|
|
@@ -147,7 +147,7 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
147
147
|
radio.invalid = this.invalid;
|
|
148
148
|
})
|
|
149
149
|
);
|
|
150
|
-
this.hasButtonGroup = radios.some((radio) => radio.tagName.toLowerCase() === "sd-1-
|
|
150
|
+
this.hasButtonGroup = radios.some((radio) => radio.tagName.toLowerCase() === "sd-1-26-0-radio-button");
|
|
151
151
|
if (!radios.some((radio) => radio.checked)) {
|
|
152
152
|
if (this.hasButtonGroup) {
|
|
153
153
|
const buttonRadio = (_a = radios[0].shadowRoot) == null ? void 0 : _a.querySelector("button");
|
|
@@ -159,26 +159,26 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
if (this.hasButtonGroup) {
|
|
162
|
-
const buttonGroup = (_b = this.shadowRoot) == null ? void 0 : _b.querySelector("sd-1-
|
|
162
|
+
const buttonGroup = (_b = this.shadowRoot) == null ? void 0 : _b.querySelector("sd-1-26-0-button-group");
|
|
163
163
|
if (buttonGroup) {
|
|
164
164
|
buttonGroup.disableRole = true;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
syncRadios() {
|
|
169
|
-
if (customElements.get("sd-1-
|
|
169
|
+
if (customElements.get("sd-1-26-0-radio") && customElements.get("sd-1-26-0-radio-button")) {
|
|
170
170
|
this.syncRadioElements();
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
if (customElements.get("sd-1-
|
|
173
|
+
if (customElements.get("sd-1-26-0-radio")) {
|
|
174
174
|
this.syncRadioElements();
|
|
175
175
|
} else {
|
|
176
|
-
customElements.whenDefined("sd-1-
|
|
176
|
+
customElements.whenDefined("sd-1-26-0-radio").then(() => this.syncRadios());
|
|
177
177
|
}
|
|
178
|
-
if (customElements.get("sd-1-
|
|
178
|
+
if (customElements.get("sd-1-26-0-radio-button")) {
|
|
179
179
|
this.syncRadioElements();
|
|
180
180
|
} else {
|
|
181
|
-
customElements.whenDefined("sd-1-
|
|
181
|
+
customElements.whenDefined("sd-1-26-0-radio-button").then(() => this.syncRadios());
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
updateCheckedRadio() {
|
|
@@ -258,11 +258,11 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
258
258
|
)}"><div class="sr-only"><div id="error-message" aria-live="assertive">${this.errorText}</div><label><input id="validation-input" type="text" ?required="${this.required}" tabindex="-1" hidden @invalid="${this.handleInvalid}"></label></div>${defaultSlot}</div></fieldset>`;
|
|
259
259
|
}
|
|
260
260
|
};
|
|
261
|
-
SdRadioGroup.dependencies = { "sd-1-
|
|
261
|
+
SdRadioGroup.dependencies = { "sd-1-26-0-button-group": SdButtonGroup };
|
|
262
262
|
SdRadioGroup.styles = [
|
|
263
263
|
componentStyles,
|
|
264
264
|
SolidElement.styles,
|
|
265
|
-
css`:host{display:block}:host([orientation=vertical]) ::slotted(sd-1-
|
|
265
|
+
css`:host{display:block}:host([orientation=vertical]) ::slotted(sd-1-26-0-radio){margin-bottom:8px;display:flex}:host([orientation=vertical]) ::slotted(sd-1-26-0-radio:last-of-type){margin-bottom:0}:host([orientation=horizontal]) ::slotted(sd-1-26-0-radio){margin-right:24px}:host([size=sm]):host([orientation=horizontal]) ::slotted(sd-1-26-0-radio){margin-right:16px}:host([orientation=horizontal]) ::slotted(sd-1-26-0-radio:last-of-type){margin-right:0}:host([required]) #label.has-label::after{content:'*';margin-left:2px}`
|
|
266
266
|
];
|
|
267
267
|
__decorateClass([
|
|
268
268
|
query("slot:not([name])")
|
|
@@ -313,7 +313,7 @@ __decorateClass([
|
|
|
313
313
|
watch("value")
|
|
314
314
|
], SdRadioGroup.prototype, "handleValueChange", 1);
|
|
315
315
|
SdRadioGroup = __decorateClass([
|
|
316
|
-
customElement("sd-1-
|
|
316
|
+
customElement("sd-1-26-0-radio-group")
|
|
317
317
|
], SdRadioGroup);
|
|
318
318
|
export {
|
|
319
319
|
SdRadioGroup as default
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import SolidElement from '../../internal/solid-element';
|
|
2
|
+
import type { SolidFormControl } from '../../internal/solid-element';
|
|
3
|
+
export default class SdSwitch extends SolidElement implements SolidFormControl {
|
|
4
|
+
private readonly formControlController;
|
|
5
|
+
input: HTMLInputElement;
|
|
6
|
+
title: string;
|
|
7
|
+
name: string;
|
|
8
|
+
value: string;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
checked: boolean;
|
|
11
|
+
defaultChecked: boolean;
|
|
12
|
+
form: string;
|
|
13
|
+
required: boolean;
|
|
14
|
+
get validity(): ValidityState;
|
|
15
|
+
firstUpdated(): void;
|
|
16
|
+
private handleClick;
|
|
17
|
+
private handleBlur;
|
|
18
|
+
private handleInput;
|
|
19
|
+
private handleInvalid;
|
|
20
|
+
private handleFocus;
|
|
21
|
+
handleDisabledChange(): void;
|
|
22
|
+
handleStateChange(): void;
|
|
23
|
+
click(): void;
|
|
24
|
+
focus(options?: FocusOptions): void;
|
|
25
|
+
blur(): void;
|
|
26
|
+
checkValidity(): boolean;
|
|
27
|
+
getForm(): HTMLFormElement | null;
|
|
28
|
+
reportValidity(): boolean;
|
|
29
|
+
setCustomValidity(message: string): void;
|
|
30
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
31
|
+
static styles: import("lit").CSSResultGroup[];
|
|
32
|
+
}
|
|
33
|
+
declare global {
|
|
34
|
+
interface HTMLElementTagNameMap {
|
|
35
|
+
'sd-1-26-0-switch': SdSwitch;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { css, html } from "lit";
|
|
2
|
+
import { customElement } from "../../internal/register-custom-element.js";
|
|
3
|
+
import { defaultValue } from "../../internal/default-value.js";
|
|
4
|
+
import { FormControlController } from "../../internal/form.js";
|
|
5
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
6
|
+
import { live } from "lit/directives/live.js";
|
|
7
|
+
import { query, property } from "lit/decorators.js";
|
|
8
|
+
import { watch } from "../../internal/watch.js";
|
|
9
|
+
import cx from "classix";
|
|
10
|
+
import SolidElement from "../../internal/solid-element.js";
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
14
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
15
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
16
|
+
if (decorator = decorators[i])
|
|
17
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
18
|
+
if (kind && result)
|
|
19
|
+
__defProp(target, key, result);
|
|
20
|
+
return result;
|
|
21
|
+
};
|
|
22
|
+
let SdSwitch = class extends SolidElement {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.formControlController = new FormControlController(this, {
|
|
26
|
+
value: (control) => control.checked ? control.value || "on" : void 0,
|
|
27
|
+
defaultValue: (control) => control.defaultChecked,
|
|
28
|
+
setValue: (control, checked) => control.checked = checked
|
|
29
|
+
});
|
|
30
|
+
this.title = "";
|
|
31
|
+
this.name = "";
|
|
32
|
+
this.disabled = false;
|
|
33
|
+
this.checked = false;
|
|
34
|
+
this.defaultChecked = false;
|
|
35
|
+
this.form = "";
|
|
36
|
+
this.required = false;
|
|
37
|
+
}
|
|
38
|
+
/** Gets the validity state object */
|
|
39
|
+
get validity() {
|
|
40
|
+
return this.input.validity;
|
|
41
|
+
}
|
|
42
|
+
firstUpdated() {
|
|
43
|
+
this.formControlController.updateValidity();
|
|
44
|
+
}
|
|
45
|
+
handleClick() {
|
|
46
|
+
this.checked = !this.checked;
|
|
47
|
+
this.emit("sd-change");
|
|
48
|
+
}
|
|
49
|
+
handleBlur() {
|
|
50
|
+
this.emit("sd-blur");
|
|
51
|
+
}
|
|
52
|
+
handleInput() {
|
|
53
|
+
this.emit("sd-1-26-0-input");
|
|
54
|
+
}
|
|
55
|
+
handleInvalid(event) {
|
|
56
|
+
this.formControlController.setValidity(false);
|
|
57
|
+
this.formControlController.emitInvalidEvent(event);
|
|
58
|
+
}
|
|
59
|
+
handleFocus() {
|
|
60
|
+
this.emit("sd-focus");
|
|
61
|
+
}
|
|
62
|
+
handleDisabledChange() {
|
|
63
|
+
this.setAttribute("aria-disabled", this.disabled ? "true" : "false");
|
|
64
|
+
this.formControlController.setValidity(this.disabled);
|
|
65
|
+
}
|
|
66
|
+
handleStateChange() {
|
|
67
|
+
this.input.checked = this.checked;
|
|
68
|
+
this.formControlController.updateValidity();
|
|
69
|
+
}
|
|
70
|
+
/** Simulates a click on the switch. */
|
|
71
|
+
click() {
|
|
72
|
+
this.input.click();
|
|
73
|
+
}
|
|
74
|
+
/** Sets focus on the switch. */
|
|
75
|
+
focus(options) {
|
|
76
|
+
this.input.focus(options);
|
|
77
|
+
}
|
|
78
|
+
/** Removes focus from the switch. */
|
|
79
|
+
blur() {
|
|
80
|
+
this.input.blur();
|
|
81
|
+
}
|
|
82
|
+
/** Checks for validity but does not show a validation message. Returns true when valid and false when invalid. */
|
|
83
|
+
checkValidity() {
|
|
84
|
+
return this.input.checkValidity();
|
|
85
|
+
}
|
|
86
|
+
/** Gets the associated form, if one exists. */
|
|
87
|
+
getForm() {
|
|
88
|
+
return this.formControlController.getForm();
|
|
89
|
+
}
|
|
90
|
+
/** Checks for validity and shows a validation message if the control is invalid. */
|
|
91
|
+
reportValidity() {
|
|
92
|
+
return this.input.reportValidity();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Sets a custom validation message. The value provided will be shown to the user when the form is submitted. To clear
|
|
96
|
+
* the custom validation message, call this method with an empty string.
|
|
97
|
+
*/
|
|
98
|
+
setCustomValidity(message) {
|
|
99
|
+
this.input.setCustomValidity(message);
|
|
100
|
+
this.formControlController.updateValidity();
|
|
101
|
+
}
|
|
102
|
+
render() {
|
|
103
|
+
return html`<label part="base" class="${cx(
|
|
104
|
+
"group flex items-center text-base leading-normal text-black cursor-pointer",
|
|
105
|
+
this.disabled && "hover:cursor-not-allowed"
|
|
106
|
+
)}"><input id="input" class="peer absolute opacity-0 p-0 m-0 pointer-events-none" type="checkbox" title="${this.title}" name="${this.name}" value="${ifDefined(this.value)}" .checked="${live(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" aria-checked="${this.checked ? "true" : "false"}" @click="${this.handleClick}" @input="${this.handleInput}" @invalid="${this.handleInvalid}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"> <span id="control" part="control ${this.checked ? " control--checked" : "control--unchecked"}" class="${cx(
|
|
107
|
+
`relative flex flex-initial items-center justify-center border rounded-full h-4 w-8 transition-colors ease duration-100
|
|
108
|
+
peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2
|
|
109
|
+
peer-focus-visible:outline-primary`,
|
|
110
|
+
this.disabled && this.checked && "border-neutral-500 bg-neutral-500" || this.disabled && "border-neutral-500" || this.checked && "border-accent bg-accent hover:bg-accent-550 group-hover:bg-accent-550" || "border-neutral-800 bg-white hover:bg-neutral-200 group-hover:bg-neutral-200"
|
|
111
|
+
)}"><span id="thumb" part="thumb" class="${cx(
|
|
112
|
+
"w-2.5 h-2.5 rounded-full transition-transform ease-in-out duration-200",
|
|
113
|
+
this.checked && "translate-x-2 bg-white" || this.disabled && this.checked && "bg-white" || this.disabled && "-translate-x-2 bg-neutral-500" || "bg-neutral-800 -translate-x-2"
|
|
114
|
+
)}"></span> </span><span part="label" id="label" class="${cx(
|
|
115
|
+
"select-none inline-block ml-2 text-black",
|
|
116
|
+
this.disabled && "text-neutral-500" || "text-neutral-800"
|
|
117
|
+
)}"><slot></slot></span></label>`;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
SdSwitch.styles = [
|
|
121
|
+
SolidElement.styles,
|
|
122
|
+
css`:host{display:block}:host(:focus-visible){outline:0}:host([required]) #label::after{content:' *'}:host([data-user-invalid]) #label{color:rgb(var(--sd-color-error,204 25 55))}:host([data-user-invalid]) #control{border-color:rgb(var(--sd-color-error,204 25 55));background-color:rgb(var(--sd-color-error,204 25 55))}:host([data-user-invalid]) #thumb{background-color:rgb(var(--sd-white,255 255 255))}:host([data-user-invalid]) #input:hover~#control{background-color:rgb(var(--sd-color-error-400,172 25 56))}`
|
|
123
|
+
];
|
|
124
|
+
__decorateClass([
|
|
125
|
+
query("input")
|
|
126
|
+
], SdSwitch.prototype, "input", 2);
|
|
127
|
+
__decorateClass([
|
|
128
|
+
property()
|
|
129
|
+
], SdSwitch.prototype, "title", 2);
|
|
130
|
+
__decorateClass([
|
|
131
|
+
property()
|
|
132
|
+
], SdSwitch.prototype, "name", 2);
|
|
133
|
+
__decorateClass([
|
|
134
|
+
property()
|
|
135
|
+
], SdSwitch.prototype, "value", 2);
|
|
136
|
+
__decorateClass([
|
|
137
|
+
property({ type: Boolean, reflect: true })
|
|
138
|
+
], SdSwitch.prototype, "disabled", 2);
|
|
139
|
+
__decorateClass([
|
|
140
|
+
property({ type: Boolean, reflect: true })
|
|
141
|
+
], SdSwitch.prototype, "checked", 2);
|
|
142
|
+
__decorateClass([
|
|
143
|
+
defaultValue("checked")
|
|
144
|
+
], SdSwitch.prototype, "defaultChecked", 2);
|
|
145
|
+
__decorateClass([
|
|
146
|
+
property({ reflect: true })
|
|
147
|
+
], SdSwitch.prototype, "form", 2);
|
|
148
|
+
__decorateClass([
|
|
149
|
+
property({ type: Boolean, reflect: true })
|
|
150
|
+
], SdSwitch.prototype, "required", 2);
|
|
151
|
+
__decorateClass([
|
|
152
|
+
watch("disabled", { waitUntilFirstUpdate: true })
|
|
153
|
+
], SdSwitch.prototype, "handleDisabledChange", 1);
|
|
154
|
+
__decorateClass([
|
|
155
|
+
watch(["checked"], { waitUntilFirstUpdate: true })
|
|
156
|
+
], SdSwitch.prototype, "handleStateChange", 1);
|
|
157
|
+
SdSwitch = __decorateClass([
|
|
158
|
+
customElement("sd-1-26-0-switch")
|
|
159
|
+
], SdSwitch);
|
|
160
|
+
export {
|
|
161
|
+
SdSwitch as default
|
|
162
|
+
};
|
|
@@ -72,7 +72,7 @@ let SdTag = class extends SolidElement {
|
|
|
72
72
|
lg: "text-base",
|
|
73
73
|
sm: "text-[12px]"
|
|
74
74
|
}[this.size]
|
|
75
|
-
)}"><sd-1-
|
|
75
|
+
)}"><sd-1-26-0-icon library="system" name="close" label="remove"></sd-1-26-0-icon></slot></${tag}>`;
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
SdTag.styles = [
|
|
@@ -104,7 +104,7 @@ __decorateClass([
|
|
|
104
104
|
property()
|
|
105
105
|
], SdTag.prototype, "download", 2);
|
|
106
106
|
SdTag = __decorateClass([
|
|
107
|
-
customElement("sd-1-
|
|
107
|
+
customElement("sd-1-26-0-tag")
|
|
108
108
|
], SdTag);
|
|
109
109
|
export {
|
|
110
110
|
SdTag as default
|
|
@@ -161,16 +161,16 @@ let SdTooltip = class extends SolidElement {
|
|
|
161
161
|
render() {
|
|
162
162
|
const isStart = this.placement.endsWith("-start");
|
|
163
163
|
const isEnd = this.placement.endsWith("-end");
|
|
164
|
-
return html`<sd-1-
|
|
164
|
+
return html`<sd-1-26-0-popup part="base" exportparts="
|
|
165
165
|
popup:base__popup,
|
|
166
166
|
arrow:base__arrow
|
|
167
|
-
" class="${cx(this.open && "tooltip--open")}" placement="${this.placement}" distance="10" skidding="${{ start: 2, end: -2, default: 0 }[isStart ? "start" : isEnd ? "end" : "default"] * (this.size === "sm" ? -1 : 1)}" strategy="${this.hoist ? "fixed" : "absolute"}" flip shift arrow auto-size="vertical" arrow-padding="0"><slot slot="anchor" aria-describedby="tooltip" class="${cx(this.size === "lg" ? "text-xl" : "text-base")}"><button class="flex sd-interactive rounded-full"><sd-1-
|
|
167
|
+
" class="${cx(this.open && "tooltip--open")}" placement="${this.placement}" distance="10" skidding="${{ start: 2, end: -2, default: 0 }[isStart ? "start" : isEnd ? "end" : "default"] * (this.size === "sm" ? -1 : 1)}" strategy="${this.hoist ? "fixed" : "absolute"}" flip shift arrow auto-size="vertical" arrow-padding="0"><slot slot="anchor" aria-describedby="tooltip" class="${cx(this.size === "lg" ? "text-xl" : "text-base")}"><button class="flex sd-interactive rounded-full"><sd-1-26-0-icon library="system" name="info-circle" class="${cx(this.disabled && "sd-interactive--disabled")}"></sd-1-26-0-icon></button></slot><slot name="content" part="body" id="tooltip" class="bg-primary text-white py-3 px-4 block rounded-none text-sm text-left" role="tooltip" aria-label="Tooltip" aria-live="${this.open ? "polite" : "off"}">${this.content}</slot></sd-1-26-0-popup>`;
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
SdTooltip.styles = [
|
|
171
171
|
SolidElement.styles,
|
|
172
172
|
unsafeCSS(InteractiveStyles),
|
|
173
|
-
css`:host{--hide-delay:0ms;--show-delay:150ms;display:contents}sd-1-
|
|
173
|
+
css`:host{--hide-delay:0ms;--show-delay:150ms;display:contents}sd-1-26-0-popup{--arrow-color:rgb(var(--sd-color-primary, 0 53 142) / 1);--arrow-size:10px}sd-1-26-0-popup::part(popup){pointer-events:none;z-index:10;box-shadow:0 1px 3px 0 rgb(81 81 81 / 75%)}sd-1-26-0-popup::part(arrow){--tw-shadow:var(--sd-shadow, 0px 1px 3px 0px rgb(81 81 81 / 75%));--tw-shadow-colored:0px 1px 3px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}sd-1-26-0-popup[placement^=top]::part(popup){transform-origin:bottom}sd-1-26-0-popup[placement^=bottom]::part(popup){transform-origin:top}#tooltip{max-width:var(--max-width)}::slotted([slot=content]){overflow:auto;max-width:var(--auto-size-available-width)!important;max-height:var(--auto-size-available-height)!important}`
|
|
174
174
|
];
|
|
175
175
|
__decorateClass([
|
|
176
176
|
query("slot:not([name])")
|
|
@@ -179,7 +179,7 @@ __decorateClass([
|
|
|
179
179
|
query("#tooltip")
|
|
180
180
|
], SdTooltip.prototype, "body", 2);
|
|
181
181
|
__decorateClass([
|
|
182
|
-
query("sd-1-
|
|
182
|
+
query("sd-1-26-0-popup")
|
|
183
183
|
], SdTooltip.prototype, "popup", 2);
|
|
184
184
|
__decorateClass([
|
|
185
185
|
property()
|
|
@@ -212,7 +212,7 @@ __decorateClass([
|
|
|
212
212
|
watch("disabled")
|
|
213
213
|
], SdTooltip.prototype, "handleDisabledChange", 1);
|
|
214
214
|
SdTooltip = __decorateClass([
|
|
215
|
-
customElement("sd-1-
|
|
215
|
+
customElement("sd-1-26-0-tooltip")
|
|
216
216
|
], SdTooltip);
|
|
217
217
|
setDefaultAnimation("tooltip.show", {
|
|
218
218
|
keyframes: [
|
|
@@ -87,7 +87,7 @@ let SdVideo = class extends SolidElement {
|
|
|
87
87
|
this.playing ? "opacity-0" : "opacity-100",
|
|
88
88
|
this.isBelowBreakpoint ? "w-[48px] h-[48px]" : "w-[96px] h-[96px]",
|
|
89
89
|
"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 p-4 bg-white bg-opacity-75 rounded-full play-pause-transition"
|
|
90
|
-
)}"><slot name="play-icon" part="play-icon" class="${cx(this.isBelowBreakpoint ? "text-[2rem]" : "text-[4rem]")}"><sd-1-
|
|
90
|
+
)}"><slot name="play-icon" part="play-icon" class="${cx(this.isBelowBreakpoint ? "text-[2rem]" : "text-[4rem]")}"><sd-1-26-0-icon id="default-play-icon" library="system" name="start"></sd-1-26-0-icon></slot></div></button> ${this.hasSlotController.test("poster") ? html`<slot name="poster" role="presentation" @transitionend="${this.hidePoster}"></slot>` : null}<div part="overlay" id="overlay" role="presentation" class="${cx(
|
|
91
91
|
this.overlay && !this.playing ? "opacity-100" : "opacity-0",
|
|
92
92
|
"bg-[rgba(0,0,0,0.65)] w-full h-full absolute top-0 left-0 pointer-events-none z-20 play-pause-transition"
|
|
93
93
|
)}"></div><slot></slot></div>`;
|
|
@@ -110,7 +110,7 @@ __decorateClass([
|
|
|
110
110
|
property({ type: Boolean })
|
|
111
111
|
], SdVideo.prototype, "isBelowBreakpoint", 2);
|
|
112
112
|
SdVideo = __decorateClass([
|
|
113
|
-
customElement("sd-1-
|
|
113
|
+
customElement("sd-1-26-0-video")
|
|
114
114
|
], SdVideo);
|
|
115
115
|
export {
|
|
116
116
|
SdVideo as default
|
|
@@ -8,7 +8,7 @@ class FormControlController {
|
|
|
8
8
|
const disabled = this.options.disabled(this.host);
|
|
9
9
|
const name = this.options.name(this.host);
|
|
10
10
|
const value = this.options.value(this.host);
|
|
11
|
-
const isButton = this.host.tagName.toLowerCase() === "sd-1-
|
|
11
|
+
const isButton = this.host.tagName.toLowerCase() === "sd-1-26-0-button";
|
|
12
12
|
if (!disabled && !isButton && typeof name === "string" && name.length > 0 && typeof value !== "undefined") {
|
|
13
13
|
if (Array.isArray(value)) {
|
|
14
14
|
value.forEach((val) => {
|
|
@@ -65,7 +65,7 @@ class FormControlController {
|
|
|
65
65
|
disabled: (input) => input.disabled ?? false,
|
|
66
66
|
reportValidity: (input) => typeof input.reportValidity === "function" ? input.reportValidity() : true,
|
|
67
67
|
setValue: (input, value) => input.value = value,
|
|
68
|
-
assumeInteractionOn: ["sd-1-
|
|
68
|
+
assumeInteractionOn: ["sd-1-26-0-input"],
|
|
69
69
|
...options
|
|
70
70
|
};
|
|
71
71
|
}
|
|
@@ -20,6 +20,7 @@ export { default as SdPopup } from './components/popup/popup';
|
|
|
20
20
|
export { default as SdRadio } from './components/radio/radio';
|
|
21
21
|
export { default as SdRadioGroup } from './components/radio-group/radio-group';
|
|
22
22
|
export { default as SdSpinner } from './components/spinner/spinner';
|
|
23
|
+
export { default as SdSwitch } from './components/switch/switch';
|
|
23
24
|
export { default as SdTag } from './components/tag/tag';
|
|
24
25
|
export { default as SdTeaser } from './components/teaser/teaser';
|
|
25
26
|
export { default as SdTooltip } from './components/tooltip/tooltip';
|
|
@@ -20,10 +20,11 @@ import { default as default20 } from "./components/popup/popup.js";
|
|
|
20
20
|
import { default as default21 } from "./components/radio/radio.js";
|
|
21
21
|
import { default as default22 } from "./components/radio-group/radio-group.js";
|
|
22
22
|
import { default as default23 } from "./components/spinner/spinner.js";
|
|
23
|
-
import { default as default24 } from "./components/
|
|
24
|
-
import { default as default25 } from "./components/
|
|
25
|
-
import { default as default26 } from "./components/
|
|
26
|
-
import { default as default27 } from "./components/
|
|
23
|
+
import { default as default24 } from "./components/switch/switch.js";
|
|
24
|
+
import { default as default25 } from "./components/tag/tag.js";
|
|
25
|
+
import { default as default26 } from "./components/teaser/teaser.js";
|
|
26
|
+
import { default as default27 } from "./components/tooltip/tooltip.js";
|
|
27
|
+
import { default as default28 } from "./components/video/video.js";
|
|
27
28
|
import { registerIconLibrary, unregisterIconLibrary } from "./components/icon/library.js";
|
|
28
29
|
import { LocalizeController } from "./utilities/localize.js";
|
|
29
30
|
export {
|
|
@@ -50,10 +51,11 @@ export {
|
|
|
50
51
|
default21 as SdRadio,
|
|
51
52
|
default22 as SdRadioGroup,
|
|
52
53
|
default23 as SdSpinner,
|
|
53
|
-
default24 as
|
|
54
|
-
default25 as
|
|
55
|
-
default26 as
|
|
56
|
-
default27 as
|
|
54
|
+
default24 as SdSwitch,
|
|
55
|
+
default25 as SdTag,
|
|
56
|
+
default26 as SdTeaser,
|
|
57
|
+
default27 as SdTooltip,
|
|
58
|
+
default28 as SdVideo,
|
|
57
59
|
registerIconLibrary,
|
|
58
60
|
unregisterIconLibrary
|
|
59
61
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
|
-
const formControlStyles = css`.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--sd-1-
|
|
2
|
+
const formControlStyles = css`.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--sd-1-26-0-input-label-color);margin-bottom:var(--sd-spacing-3x-small)}.form-control--has-label.form-control--small .form-control__label{font-size:var(--sd-1-26-0-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--sd-1-26-0-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--sd-1-26-0-input-label-font-size-large)}:host([required]) .form-control--has-label .form-control__label::after{content:var(--sd-1-26-0-input-required-content);margin-inline-start:var(--sd-1-26-0-input-required-content-offset);color:var(--sd-1-26-0-input-required-content-color)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--sd-1-26-0-input-help-text-color);margin-top:var(--sd-spacing-3x-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--sd-1-26-0-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--sd-1-26-0-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--sd-1-26-0-input-help-text-font-size-large)}.form-control--has-help-text.form-control--radio-group .form-control__help-text{margin-top:var(--sd-spacing-2x-small)}`;
|
|
3
3
|
export {
|
|
4
4
|
formControlStyles as default
|
|
5
5
|
};
|