@solid-design-system/components 1.21.1 → 1.23.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/carousel.js +3 -3
- package/dist/components/es/checkbox-group.js +1 -0
- package/dist/components/es/checkbox.js +11 -0
- package/dist/components/es/event.js +1 -1
- package/dist/components/es/icon.js +4 -4
- package/dist/components/es/interactive.js +1 -0
- package/dist/components/es/radio-group.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/tooltip.js +4 -0
- package/dist/components/umd/solid-components.js +29 -16
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/checkbox/checkbox.d.ts +40 -0
- package/dist/package/components/checkbox/checkbox.js +179 -0
- package/dist/package/components/checkbox-group/checkbox-group.d.ts +20 -0
- package/dist/package/components/checkbox-group/checkbox-group.js +102 -0
- package/dist/package/components/icon/library.system.d.ts +3 -0
- package/dist/package/components/icon/library.system.js +11 -0
- package/dist/package/components/radio/radio.js +1 -3
- package/dist/package/components/radio-group/radio-group.js +7 -8
- package/dist/package/components/tooltip/tooltip.d.ts +39 -0
- package/dist/package/components/tooltip/tooltip.js +233 -0
- package/dist/package/internal/animate.js +11 -0
- package/dist/package/internal/default-value.d.ts +2 -0
- package/dist/package/internal/default-value.js +21 -0
- package/dist/package/solid-components.d.ts +3 -0
- package/dist/package/solid-components.js +34 -28
- 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 -0
- package/dist/versioned-components/es/checkbox.js +11 -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/event.js +1 -1
- package/dist/versioned-components/es/form.js +1 -1
- package/dist/versioned-components/es/icon.js +4 -4
- package/dist/versioned-components/es/include.js +1 -1
- package/dist/versioned-components/es/interactive.js +1 -0
- package/dist/versioned-components/es/link.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/tag.js +1 -1
- package/dist/versioned-components/es/teaser.js +1 -1
- package/dist/versioned-components/es/tooltip.js +4 -0
- 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 +40 -0
- package/dist/versioned-package/components/checkbox/checkbox.js +179 -0
- package/dist/versioned-package/components/checkbox-group/checkbox-group.d.ts +20 -0
- package/dist/versioned-package/components/checkbox-group/checkbox-group.js +102 -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 +6 -6
- 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/icon/library.system.d.ts +3 -0
- package/dist/versioned-package/components/icon/library.system.js +11 -0
- 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/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 +3 -5
- package/dist/versioned-package/components/radio-group/radio-group.d.ts +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.js +18 -19
- 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/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 +39 -0
- package/dist/versioned-package/components/tooltip/tooltip.js +233 -0
- 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/animate.js +11 -0
- package/dist/versioned-package/internal/default-value.d.ts +2 -0
- package/dist/versioned-package/internal/default-value.js +21 -0
- package/dist/versioned-package/internal/form.js +1 -1
- package/dist/versioned-package/solid-components.d.ts +3 -0
- package/dist/versioned-package/solid-components.js +34 -28
- 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 +345 -21
- package/dist/web-types.json +504 -1
- package/package.json +3 -3
|
@@ -30,7 +30,7 @@ SdCarouselItem.styles = [
|
|
|
30
30
|
css`${componentStyles}:host{display:flex;align-items:center;justify-content:center;flex-direction:column;width:100%;height:100%;aspect-ratio:var(--aspect-ratio);scroll-snap-align:start;scroll-snap-stop:always}::slotted(img){width:100%;height:100%;object-fit:cover}`
|
|
31
31
|
];
|
|
32
32
|
SdCarouselItem = __decorateClass([
|
|
33
|
-
customElement("sd-1-
|
|
33
|
+
customElement("sd-1-23-0-carousel-item")
|
|
34
34
|
], SdCarouselItem);
|
|
35
35
|
export {
|
|
36
36
|
SdCarouselItem as default
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import '../icon/icon';
|
|
2
|
+
import SolidElement from '../../internal/solid-element';
|
|
3
|
+
import type { SolidFormControl } from '../../internal/solid-element';
|
|
4
|
+
export default class SdCheckbox extends SolidElement implements SolidFormControl {
|
|
5
|
+
private readonly formControlController;
|
|
6
|
+
input: HTMLInputElement;
|
|
7
|
+
title: string;
|
|
8
|
+
name: string;
|
|
9
|
+
value: string;
|
|
10
|
+
size: 'sm' | 'lg';
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
checked: boolean;
|
|
13
|
+
indeterminate: boolean;
|
|
14
|
+
defaultChecked: boolean;
|
|
15
|
+
form: string;
|
|
16
|
+
required: boolean;
|
|
17
|
+
get validity(): ValidityState;
|
|
18
|
+
firstUpdated(): void;
|
|
19
|
+
private handleClick;
|
|
20
|
+
private handleBlur;
|
|
21
|
+
private handleInput;
|
|
22
|
+
private handleInvalid;
|
|
23
|
+
private handleFocus;
|
|
24
|
+
handleDisabledChange(): void;
|
|
25
|
+
handleStateChange(): void;
|
|
26
|
+
click(): void;
|
|
27
|
+
focus(options?: FocusOptions): void;
|
|
28
|
+
blur(): void;
|
|
29
|
+
checkValidity(): boolean;
|
|
30
|
+
getForm(): HTMLFormElement | null;
|
|
31
|
+
reportValidity(): boolean;
|
|
32
|
+
setCustomValidity(message: string): void;
|
|
33
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
34
|
+
static styles: import("lit").CSSResultGroup[];
|
|
35
|
+
}
|
|
36
|
+
declare global {
|
|
37
|
+
interface HTMLElementTagNameMap {
|
|
38
|
+
'sd-1-23-0-checkbox': SdCheckbox;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import "../icon/icon.js";
|
|
2
|
+
import { css, html } from "lit";
|
|
3
|
+
import { customElement } from "../../internal/register-custom-element.js";
|
|
4
|
+
import { defaultValue } from "../../internal/default-value.js";
|
|
5
|
+
import { FormControlController } from "../../internal/form.js";
|
|
6
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
7
|
+
import { live } from "lit/directives/live.js";
|
|
8
|
+
import { query, property } from "lit/decorators.js";
|
|
9
|
+
import { watch } from "../../internal/watch.js";
|
|
10
|
+
import cx from "classix";
|
|
11
|
+
import SolidElement from "../../internal/solid-element.js";
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
14
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
15
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
16
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
17
|
+
if (decorator = decorators[i])
|
|
18
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
19
|
+
if (kind && result)
|
|
20
|
+
__defProp(target, key, result);
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
23
|
+
let SdCheckbox = class extends SolidElement {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
this.formControlController = new FormControlController(this, {
|
|
27
|
+
value: (control) => control.checked ? control.value || "on" : void 0,
|
|
28
|
+
defaultValue: (control) => control.defaultChecked,
|
|
29
|
+
setValue: (control, checked) => control.checked = checked
|
|
30
|
+
});
|
|
31
|
+
this.title = "";
|
|
32
|
+
this.name = "";
|
|
33
|
+
this.size = "lg";
|
|
34
|
+
this.disabled = false;
|
|
35
|
+
this.checked = false;
|
|
36
|
+
this.indeterminate = false;
|
|
37
|
+
this.defaultChecked = false;
|
|
38
|
+
this.form = "";
|
|
39
|
+
this.required = false;
|
|
40
|
+
}
|
|
41
|
+
/** Gets the validity state object */
|
|
42
|
+
get validity() {
|
|
43
|
+
return this.input.validity;
|
|
44
|
+
}
|
|
45
|
+
firstUpdated() {
|
|
46
|
+
this.formControlController.updateValidity();
|
|
47
|
+
}
|
|
48
|
+
handleClick() {
|
|
49
|
+
this.checked = !this.checked;
|
|
50
|
+
this.indeterminate = false;
|
|
51
|
+
this.emit("sd-change");
|
|
52
|
+
}
|
|
53
|
+
handleBlur() {
|
|
54
|
+
this.emit("sd-blur");
|
|
55
|
+
}
|
|
56
|
+
handleInput() {
|
|
57
|
+
this.emit("sd-input");
|
|
58
|
+
}
|
|
59
|
+
handleInvalid(event) {
|
|
60
|
+
this.formControlController.setValidity(false);
|
|
61
|
+
this.formControlController.emitInvalidEvent(event);
|
|
62
|
+
}
|
|
63
|
+
handleFocus() {
|
|
64
|
+
this.emit("sd-focus");
|
|
65
|
+
}
|
|
66
|
+
handleDisabledChange() {
|
|
67
|
+
this.setAttribute("aria-disabled", this.disabled ? "true" : "false");
|
|
68
|
+
this.formControlController.setValidity(this.disabled);
|
|
69
|
+
}
|
|
70
|
+
handleStateChange() {
|
|
71
|
+
this.input.checked = this.checked;
|
|
72
|
+
this.input.indeterminate = this.indeterminate;
|
|
73
|
+
this.formControlController.updateValidity();
|
|
74
|
+
}
|
|
75
|
+
/** Simulates a click on the checkbox. */
|
|
76
|
+
click() {
|
|
77
|
+
this.input.click();
|
|
78
|
+
}
|
|
79
|
+
/** Sets focus on the checkbox. */
|
|
80
|
+
focus(options) {
|
|
81
|
+
this.input.focus(options);
|
|
82
|
+
}
|
|
83
|
+
/** Removes focus from the checkbox. */
|
|
84
|
+
blur() {
|
|
85
|
+
this.input.blur();
|
|
86
|
+
}
|
|
87
|
+
/** Checks for validity but does not show a validation message. Returns true when valid and false when invalid. */
|
|
88
|
+
checkValidity() {
|
|
89
|
+
return this.input.checkValidity();
|
|
90
|
+
}
|
|
91
|
+
/** Gets the associated form, if one exists. */
|
|
92
|
+
getForm() {
|
|
93
|
+
return this.formControlController.getForm();
|
|
94
|
+
}
|
|
95
|
+
/** Checks for validity and shows a validation message if the control is invalid. */
|
|
96
|
+
reportValidity() {
|
|
97
|
+
return this.input.reportValidity();
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Sets a custom validation message. The value provided will be shown to the user when the form is submitted. To clear
|
|
101
|
+
* the custom validation message, call this method with an empty string.
|
|
102
|
+
*/
|
|
103
|
+
setCustomValidity(message) {
|
|
104
|
+
this.input.setCustomValidity(message);
|
|
105
|
+
this.formControlController.updateValidity();
|
|
106
|
+
}
|
|
107
|
+
render() {
|
|
108
|
+
return html`<label part="base" class="${cx(
|
|
109
|
+
"sd-1-23-0-checkbox group flex items-start text-base leading-normal text-black cursor-pointer",
|
|
110
|
+
this.disabled && "hover:cursor-not-allowed",
|
|
111
|
+
{
|
|
112
|
+
/* sizes, fonts */
|
|
113
|
+
sm: "text-sm",
|
|
114
|
+
lg: "text-base"
|
|
115
|
+
}[this.size]
|
|
116
|
+
)}"><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)}" .indeterminate="${live(this.indeterminate)}" .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"} ${this.indeterminate ? " control--indeterminate" : ""}" class="${cx(
|
|
117
|
+
`relative flex flex-initial items-center justify-center border rounded-sm h-4 w-4
|
|
118
|
+
peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2
|
|
119
|
+
peer-focus-visible:outline-primary`,
|
|
120
|
+
{
|
|
121
|
+
sm: "mt-[2px]",
|
|
122
|
+
lg: "mt-[3px]"
|
|
123
|
+
}[this.size],
|
|
124
|
+
this.disabled && this.indeterminate && "border-neutral-500 bg-neutral-500" || this.disabled && this.checked && "border-neutral-500 bg-neutral-500" || this.disabled && "border-neutral-500" || (this.checked || this.indeterminate) && "border-accent hover:border-accent-550 group-hover:border-accent-550 bg-accent group-hover:bg-accent-550" || "border-neutral-800 hover:bg-neutral-200 group-hover:bg-neutral-200 bg-white"
|
|
125
|
+
)}">${this.checked ? html`<sd-1-23-0-icon part="checked-icon" class="text-white w-3 h-3" library="system" name="status-hook"></sd-1-23-0-icon>` : ""} ${!this.checked && this.indeterminate ? html`<sd-1-23-0-icon part="indeterminate-icon" class="text-white w-3 h-3" library="system" name="status-minus"></sd-1-23-0-icon>` : ""} </span><span part="label" id="label" class="${cx(
|
|
126
|
+
"select-none inline-block ml-2 text-black",
|
|
127
|
+
this.disabled && "text-neutral-500" || "text-neutral-800"
|
|
128
|
+
)}"><slot></slot></span></label>`;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
SdCheckbox.styles = [
|
|
132
|
+
SolidElement.styles,
|
|
133
|
+
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))}:host([data-user-invalid]):host([indeterminate]) #control{background-color:rgb(var(--sd-color-error,204 25 55))}`
|
|
134
|
+
];
|
|
135
|
+
__decorateClass([
|
|
136
|
+
query('input[type="checkbox"]')
|
|
137
|
+
], SdCheckbox.prototype, "input", 2);
|
|
138
|
+
__decorateClass([
|
|
139
|
+
property()
|
|
140
|
+
], SdCheckbox.prototype, "title", 2);
|
|
141
|
+
__decorateClass([
|
|
142
|
+
property()
|
|
143
|
+
], SdCheckbox.prototype, "name", 2);
|
|
144
|
+
__decorateClass([
|
|
145
|
+
property()
|
|
146
|
+
], SdCheckbox.prototype, "value", 2);
|
|
147
|
+
__decorateClass([
|
|
148
|
+
property({ reflect: true })
|
|
149
|
+
], SdCheckbox.prototype, "size", 2);
|
|
150
|
+
__decorateClass([
|
|
151
|
+
property({ type: Boolean, reflect: true })
|
|
152
|
+
], SdCheckbox.prototype, "disabled", 2);
|
|
153
|
+
__decorateClass([
|
|
154
|
+
property({ type: Boolean, reflect: true })
|
|
155
|
+
], SdCheckbox.prototype, "checked", 2);
|
|
156
|
+
__decorateClass([
|
|
157
|
+
property({ type: Boolean, reflect: true })
|
|
158
|
+
], SdCheckbox.prototype, "indeterminate", 2);
|
|
159
|
+
__decorateClass([
|
|
160
|
+
defaultValue("checked")
|
|
161
|
+
], SdCheckbox.prototype, "defaultChecked", 2);
|
|
162
|
+
__decorateClass([
|
|
163
|
+
property({ reflect: true })
|
|
164
|
+
], SdCheckbox.prototype, "form", 2);
|
|
165
|
+
__decorateClass([
|
|
166
|
+
property({ type: Boolean, reflect: true })
|
|
167
|
+
], SdCheckbox.prototype, "required", 2);
|
|
168
|
+
__decorateClass([
|
|
169
|
+
watch("disabled", { waitUntilFirstUpdate: true })
|
|
170
|
+
], SdCheckbox.prototype, "handleDisabledChange", 1);
|
|
171
|
+
__decorateClass([
|
|
172
|
+
watch(["checked", "indeterminate"], { waitUntilFirstUpdate: true })
|
|
173
|
+
], SdCheckbox.prototype, "handleStateChange", 1);
|
|
174
|
+
SdCheckbox = __decorateClass([
|
|
175
|
+
customElement("sd-1-23-0-checkbox")
|
|
176
|
+
], SdCheckbox);
|
|
177
|
+
export {
|
|
178
|
+
SdCheckbox as default
|
|
179
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import '../icon/icon';
|
|
2
|
+
import SolidElement from '../../internal/solid-element';
|
|
3
|
+
export default class SdCheckboxGroup extends SolidElement {
|
|
4
|
+
private readonly hasSlotController;
|
|
5
|
+
label: string;
|
|
6
|
+
size: 'lg' | 'sm';
|
|
7
|
+
orientation: 'horizontal' | 'vertical';
|
|
8
|
+
private getAllCheckboxes;
|
|
9
|
+
private syncCheckboxElements;
|
|
10
|
+
private syncCheckboxes;
|
|
11
|
+
handleSizeChange(): void;
|
|
12
|
+
handleInvalid(): void;
|
|
13
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
14
|
+
static styles: import("lit").CSSResultGroup[];
|
|
15
|
+
}
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
'sd-1-23-0-checkbox-group': SdCheckboxGroup;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import "../icon/icon.js";
|
|
2
|
+
import { css, html } from "lit";
|
|
3
|
+
import { customElement } from "../../internal/register-custom-element.js";
|
|
4
|
+
import { HasSlotController } from "../../internal/slot.js";
|
|
5
|
+
import { property } from "lit/decorators.js";
|
|
6
|
+
import { watch } from "../../internal/watch.js";
|
|
7
|
+
import componentStyles from "../../styles/component.styles.js";
|
|
8
|
+
import cx from "classix";
|
|
9
|
+
import SolidElement from "../../internal/solid-element.js";
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
13
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
14
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
15
|
+
if (decorator = decorators[i])
|
|
16
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
17
|
+
if (kind && result)
|
|
18
|
+
__defProp(target, key, result);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
let SdCheckboxGroup = class extends SolidElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.hasSlotController = new HasSlotController(this, "label");
|
|
25
|
+
this.label = "";
|
|
26
|
+
this.size = "lg";
|
|
27
|
+
this.orientation = "vertical";
|
|
28
|
+
}
|
|
29
|
+
getAllCheckboxes() {
|
|
30
|
+
return [...this.querySelectorAll("sd-1-23-0-checkbox")];
|
|
31
|
+
}
|
|
32
|
+
async syncCheckboxElements() {
|
|
33
|
+
const checkboxes = this.getAllCheckboxes();
|
|
34
|
+
await Promise.all(
|
|
35
|
+
// Sync the checked state and size
|
|
36
|
+
checkboxes.map(async (checkbox) => {
|
|
37
|
+
await checkbox.updateComplete;
|
|
38
|
+
checkbox.size = this.size;
|
|
39
|
+
})
|
|
40
|
+
);
|
|
41
|
+
if (!checkboxes.some((checkbox) => checkbox.checked)) {
|
|
42
|
+
checkboxes[0].tabIndex = 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
syncCheckboxes() {
|
|
46
|
+
if (customElements.get("sd-1-23-0-checkbox")) {
|
|
47
|
+
this.syncCheckboxElements();
|
|
48
|
+
} else {
|
|
49
|
+
customElements.whenDefined("sd-1-23-0-checkbox").then(() => this.syncCheckboxes());
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
handleSizeChange() {
|
|
53
|
+
this.syncCheckboxes();
|
|
54
|
+
}
|
|
55
|
+
handleInvalid() {
|
|
56
|
+
this.syncCheckboxes();
|
|
57
|
+
}
|
|
58
|
+
render() {
|
|
59
|
+
const hasLabelSlot = this.hasSlotController.test("label");
|
|
60
|
+
const hasLabel = this.label ? true : hasLabelSlot;
|
|
61
|
+
const defaultSlot = html`<slot @slotchange="${this.syncCheckboxes}"></slot>`;
|
|
62
|
+
return html`<fieldset part="form-control" class="${cx(
|
|
63
|
+
"border-0 p-0 m-0",
|
|
64
|
+
{
|
|
65
|
+
/* sizes, fonts */
|
|
66
|
+
sm: "text-sm",
|
|
67
|
+
lg: "text-base"
|
|
68
|
+
}[this.size]
|
|
69
|
+
)}" role="group" aria-labelledby="label"><label part="form-control-label" id="label" class="${cx("mb-2 p-0 font-bold leading-normal text-black", hasLabel ? "flex" : "hidden")}" aria-hidden="${!hasLabel}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${cx(
|
|
70
|
+
{
|
|
71
|
+
vertical: "flex flex-col",
|
|
72
|
+
horizontal: "flex flex-row"
|
|
73
|
+
}[this.orientation]
|
|
74
|
+
)}">${defaultSlot}</div></fieldset>`;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
SdCheckboxGroup.styles = [
|
|
78
|
+
componentStyles,
|
|
79
|
+
SolidElement.styles,
|
|
80
|
+
css`:host{display:block}:host([orientation=vertical]) ::slotted(sd-1-23-0-checkbox){margin-bottom:8px;display:flex}:host([orientation=vertical]) ::slotted(sd-1-23-0-checkbox:last-of-type){margin-bottom:0}:host([orientation=horizontal]) ::slotted(sd-1-23-0-checkbox){margin-right:24px}:host([size=sm]):host([orientation=horizontal]) ::slotted(sd-1-23-0-checkbox){margin-right:16px}:host([orientation=horizontal]) ::slotted(sd-1-23-0-checkbox:last-of-type){margin-right:0}`
|
|
81
|
+
];
|
|
82
|
+
__decorateClass([
|
|
83
|
+
property()
|
|
84
|
+
], SdCheckboxGroup.prototype, "label", 2);
|
|
85
|
+
__decorateClass([
|
|
86
|
+
property({ reflect: true })
|
|
87
|
+
], SdCheckboxGroup.prototype, "size", 2);
|
|
88
|
+
__decorateClass([
|
|
89
|
+
property({ reflect: true })
|
|
90
|
+
], SdCheckboxGroup.prototype, "orientation", 2);
|
|
91
|
+
__decorateClass([
|
|
92
|
+
watch("size", { waitUntilFirstUpdate: true })
|
|
93
|
+
], SdCheckboxGroup.prototype, "handleSizeChange", 1);
|
|
94
|
+
__decorateClass([
|
|
95
|
+
watch("invalid", { waitUntilFirstUpdate: true })
|
|
96
|
+
], SdCheckboxGroup.prototype, "handleInvalid", 1);
|
|
97
|
+
SdCheckboxGroup = __decorateClass([
|
|
98
|
+
customElement("sd-1-23-0-checkbox-group")
|
|
99
|
+
], SdCheckboxGroup);
|
|
100
|
+
export {
|
|
101
|
+
SdCheckboxGroup as default
|
|
102
|
+
};
|
|
@@ -35,7 +35,7 @@ let SdDivider = class extends SolidElement {
|
|
|
35
35
|
SdDivider.styles = [
|
|
36
36
|
componentStyles,
|
|
37
37
|
SolidElement.styles,
|
|
38
|
-
css`:host{margin:0}:host(sd-1-
|
|
38
|
+
css`:host{margin:0}:host(sd-1-23-0-divider[orientation=horizontal]){display:block}:host(sd-1-23-0-divider[orientation=vertical]){display:inline-block}`
|
|
39
39
|
];
|
|
40
40
|
__decorateClass([
|
|
41
41
|
property({ reflect: true })
|
|
@@ -44,7 +44,7 @@ __decorateClass([
|
|
|
44
44
|
property({ type: Boolean, reflect: true })
|
|
45
45
|
], SdDivider.prototype, "inverted", 2);
|
|
46
46
|
SdDivider = __decorateClass([
|
|
47
|
-
customElement("sd-1-
|
|
47
|
+
customElement("sd-1-23-0-divider")
|
|
48
48
|
], SdDivider);
|
|
49
49
|
export {
|
|
50
50
|
SdDivider as default
|
|
@@ -183,7 +183,7 @@ let SdDrawer = class extends SolidElement {
|
|
|
183
183
|
end: "top-0 end-0 bottom-auto start-auto w-[--width] h-full",
|
|
184
184
|
start: "top-0 end-auto bottom-auto start-0 w-[--width] h-full"
|
|
185
185
|
}[this.placement]
|
|
186
|
-
)}" role="dialog" aria-modal="true" aria-hidden="${this.open ? "false" : "true"}" aria-label="${this.label}" aria-labelledby="${ifDefined(!this.noHeader ? "title" : void 0)}" tabindex="0">${!this.noHeader ? html`<header part="header" class="flex justify-between py-2 px-4 items-center flex-shrink-0" style="min-height:56px"><div part="title"><slot name="header" part="title" class="flex-auto text-xl m-0" id="title"></slot></div><div class="shrink-0 flex flex-wrap justify-end gap-1 ml-4 absolute top-2 right-2"><sd-1-
|
|
186
|
+
)}" role="dialog" aria-modal="true" aria-hidden="${this.open ? "false" : "true"}" aria-label="${this.label}" aria-labelledby="${ifDefined(!this.noHeader ? "title" : void 0)}" tabindex="0">${!this.noHeader ? html`<header part="header" class="flex justify-between py-2 px-4 items-center flex-shrink-0" style="min-height:56px"><div part="title"><slot name="header" part="title" class="flex-auto text-xl m-0" id="title"></slot></div><div class="shrink-0 flex flex-wrap justify-end gap-1 ml-4 absolute top-2 right-2"><sd-1-23-0-button variant="tertiary" size="lg" part="close-button" @click="${() => this.requestClose("close-button")}"><sd-1-23-0-icon name="close" library="system"></sd-1-23-0-icon></sd-1-23-0-button></div></header>` : ""}<div part="body" class="flex-auto block px-4"><slot></slot></div><footer part="footer" class="${cx(this.hasSlotController.test("footer") ? "text-left p-4" : "hidden")}"><slot name="footer"></slot></footer></div></div>`;
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
SdDrawer.styles = [
|
|
@@ -221,7 +221,7 @@ __decorateClass([
|
|
|
221
221
|
watch("contained", { waitUntilFirstUpdate: true })
|
|
222
222
|
], SdDrawer.prototype, "handleNoModalChange", 1);
|
|
223
223
|
SdDrawer = __decorateClass([
|
|
224
|
-
customElement("sd-1-
|
|
224
|
+
customElement("sd-1-23-0-drawer")
|
|
225
225
|
], SdDrawer);
|
|
226
226
|
setDefaultAnimation("drawer.showStart", {
|
|
227
227
|
keyframes: [
|
|
@@ -170,7 +170,7 @@ let SdDropdown = class extends SolidElement {
|
|
|
170
170
|
// that gets slotted in) so screen readers will understand them. The accessible trigger could be the slotted element,
|
|
171
171
|
// a child of the slotted element, or an element in the slotted element's shadow root.
|
|
172
172
|
//
|
|
173
|
-
// For example, the accessible trigger of an <sd-1-
|
|
173
|
+
// For example, the accessible trigger of an <sd-1-23-0-button> is a <button> located inside its shadow root.
|
|
174
174
|
//
|
|
175
175
|
// To determine this, we assume the first tabbable element in the trigger slot is the "accessible trigger."
|
|
176
176
|
//
|
|
@@ -180,8 +180,8 @@ let SdDropdown = class extends SolidElement {
|
|
|
180
180
|
let target;
|
|
181
181
|
if (accessibleTrigger) {
|
|
182
182
|
switch (accessibleTrigger.tagName.toLowerCase()) {
|
|
183
|
-
case "sd-1-
|
|
184
|
-
case "sd-1-
|
|
183
|
+
case "sd-1-23-0-button":
|
|
184
|
+
case "sd-1-23-0-icon-button":
|
|
185
185
|
target = accessibleTrigger.button;
|
|
186
186
|
break;
|
|
187
187
|
default:
|
|
@@ -257,11 +257,11 @@ let SdDropdown = class extends SolidElement {
|
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
render() {
|
|
260
|
-
return html`<sd-1-
|
|
260
|
+
return html`<sd-1-23-0-popup part="base" id="dropdown" placement="${this.placement}" distance="${this.rounded && this.distance < 1 ? 1 : this.distance}" skidding="${this.skidding}" strategy="${this.hoist ? "fixed" : "absolute"}" ?flip="${!this.noFlip}" shift auto-size="vertical" auto-size-padding="10" ?active="${this.open}"><slot name="trigger" slot="anchor" part="trigger" class="block" @click="${this.handleTriggerClick}" @keydown="${this.handleTriggerKeyDown}" @keyup="${this.handleTriggerKeyUp}" @slotchange="${this.handleTriggerSlotChange}"></slot><slot part="panel" class="${cx(
|
|
261
261
|
"shadow bg-white",
|
|
262
262
|
this.open ? "block pointer-events-auto" : "pointer-events-none",
|
|
263
263
|
this.rounded && "rounded-md"
|
|
264
|
-
)}" aria-hidden="${this.open ? "false" : "true"}" aria-labelledby="dropdown"></slot></sd-1-
|
|
264
|
+
)}" aria-hidden="${this.open ? "false" : "true"}" aria-labelledby="dropdown"></slot></sd-1-23-0-popup>`;
|
|
265
265
|
}
|
|
266
266
|
};
|
|
267
267
|
SdDropdown.styles = [
|
|
@@ -315,7 +315,7 @@ __decorateClass([
|
|
|
315
315
|
watch("open", { waitUntilFirstUpdate: true })
|
|
316
316
|
], SdDropdown.prototype, "handleOpenChange", 1);
|
|
317
317
|
SdDropdown = __decorateClass([
|
|
318
|
-
customElement("sd-1-
|
|
318
|
+
customElement("sd-1-23-0-dropdown")
|
|
319
319
|
], SdDropdown);
|
|
320
320
|
setDefaultAnimation("dropdown.show", {
|
|
321
321
|
keyframes: [
|
|
@@ -14,6 +14,17 @@ const icons = {
|
|
|
14
14
|
<path d="M21.707 2.293a1 1 0 0 0-1.414 0L12 10.586 3.707 2.293a1 1 0 0 0-1.413 1.414l-.001-.001 8.293 8.293-8.293 8.293a1 1 0 0 0 0 1.414 1 1 0 0 0 1.414 0L12 13.413l8.293 8.293a1 1 0 0 0 1.414 0 1 1 0 0 0 0-1.414l-8.293-8.293 8.293-8.293a1 1 0 0 0 0-1.414z"/></svg>
|
|
15
15
|
</svg>
|
|
16
16
|
`,
|
|
17
|
+
"info-circle": `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Z"/><path d="M13.333 7.833a1.5 1.5 0 1 1-3.001-.001 1.5 1.5 0 0 1 3.001.001ZM13 11.667a1 1 0 0 0-1-1h-1a1 1 0 0 0 0 2v2.667h2v-3.667Z"/><path d="M11 16.333v-1h-1a1 1 0 0 0 0 2h2a1 1 0 0 1-1-1Zm3-1h-1v1a1 1 0 0 1-1 1h2a1 1 0 0 0 0-2Z"/><path d="M13 16.333v-1h-2v1a1 1 0 0 0 2 0Z"/></svg>`,
|
|
18
|
+
"status-hook": `
|
|
19
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none">
|
|
20
|
+
<path fill="currentColor" d="m9.947 1.138-.005.008-.001.003-5.56 8.34-2.434-2.447-.004-.004a.648.648 0 0 0-1.093.475c0 .172.066.328.175.444l.003.004 3 2.999c.117.117.28.19.46.19h.065c.2-.021.37-.13.475-.286l.005-.008.001-.002 5.994-8.992a.65.65 0 0 0-.18-.902l-.007-.005-.002-.002a.65.65 0 0 0-.892.185Z"/>
|
|
21
|
+
</svg>
|
|
22
|
+
`,
|
|
23
|
+
"status-minus": `
|
|
24
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none">
|
|
25
|
+
<path d="M10 5.375H2C1.65496 5.375 1.375 5.65496 1.375 6C1.375 6.34504 1.65496 6.625 2 6.625H10C10.345 6.625 10.625 6.34504 10.625 6C10.625 5.65496 10.345 5.375 10 5.375Z" fill="currentColor"/>
|
|
26
|
+
</svg>
|
|
27
|
+
`,
|
|
17
28
|
start: `
|
|
18
29
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
19
30
|
<path d="m57.44 29.76-37.333-24A2.667 2.667 0 0 0 16 8v48a2.668 2.668 0 0 0 2.667 2.666 2.672 2.672 0 0 0 1.45-.431l-.01.005 37.333-24a2.67 2.67 0 0 0 1.192-2.221c0-.923-.47-1.74-1.184-2.216l-.01-.006.002-.037ZM21.333 51.112V12.89l29.734 19.112-29.734 19.11Z"/>
|
|
@@ -77,7 +77,7 @@ let SdLink = class extends SolidElement {
|
|
|
77
77
|
};
|
|
78
78
|
SdLink.styles = [
|
|
79
79
|
SolidElement.styles,
|
|
80
|
-
css`::slotted(sd-1-
|
|
80
|
+
css`::slotted(sd-1-23-0-icon){font-size:1.25em;margin-bottom:-.25em}:host([size=sm][standalone]) ::slotted(sd-1-23-0-icon){font-size:1rem}:host([size=lg][standalone]) ::slotted(sd-1-23-0-icon){font-size:1.5rem}`
|
|
81
81
|
];
|
|
82
82
|
__decorateClass([
|
|
83
83
|
query("a")
|
|
@@ -101,7 +101,7 @@ __decorateClass([
|
|
|
101
101
|
property()
|
|
102
102
|
], SdLink.prototype, "download", 2);
|
|
103
103
|
SdLink = __decorateClass([
|
|
104
|
-
customElement("sd-1-
|
|
104
|
+
customElement("sd-1-23-0-link")
|
|
105
105
|
], SdLink);
|
|
106
106
|
export {
|
|
107
107
|
SdLink as default
|
|
@@ -105,10 +105,10 @@ let SdNavigationItem = class extends SolidElement {
|
|
|
105
105
|
isAccordion ? "grow" : "w-full",
|
|
106
106
|
slots["description"] ? "pb-1" : horizontalPaddingBottom,
|
|
107
107
|
this.calculatePaddingX()
|
|
108
|
-
)}">${this.divider && this.vertical ? html`<sd-1-
|
|
108
|
+
)}">${this.divider && this.vertical ? html`<sd-1-23-0-divider part="divider" class="${cx("w-full transition-all absolute -top-[1px] left-0", this.calculatePaddingX())}"></sd-1-23-0-divider>` : ""} <span class="inline-flex items-center flex-auto"><slot part="content" class="inline"></slot></span>${(this.chevron || slots["children"]) && this.vertical ? html`<sd-1-23-0-icon name="chevron-down" part="chevron" library="system" color="currentColor" class="${cx(
|
|
109
109
|
"h-6 w-6 ml-2 transition-all",
|
|
110
110
|
isAccordion ? this.open ? "rotate-180" : "rotate-0" : "rotate-[270deg]"
|
|
111
|
-
)}"></sd-1-
|
|
111
|
+
)}"></sd-1-23-0-icon>` : ""} </span>${slots["description"] && this.vertical ? html`<slot name="description" part="description" class="${cx(
|
|
112
112
|
"inline-block text-sm text-left text-black",
|
|
113
113
|
isAccordion ? "grow" : "w-full",
|
|
114
114
|
horizontalPaddingBottom,
|
|
@@ -159,7 +159,7 @@ __decorateClass([
|
|
|
159
159
|
property({ type: Boolean, reflect: true })
|
|
160
160
|
], SdNavigationItem.prototype, "open", 2);
|
|
161
161
|
SdNavigationItem = __decorateClass([
|
|
162
|
-
customElement("sd-1-
|
|
162
|
+
customElement("sd-1-23-0-navigation-item")
|
|
163
163
|
], SdNavigationItem);
|
|
164
164
|
export {
|
|
165
165
|
SdNavigationItem as default
|
|
@@ -312,7 +312,7 @@ __decorateClass([
|
|
|
312
312
|
property({ attribute: "auto-size-padding", type: Number })
|
|
313
313
|
], SdPopup.prototype, "autoSizePadding", 2);
|
|
314
314
|
SdPopup = __decorateClass([
|
|
315
|
-
customElement("sd-1-
|
|
315
|
+
customElement("sd-1-23-0-popup")
|
|
316
316
|
], SdPopup);
|
|
317
317
|
export {
|
|
318
318
|
SdPopup as default
|