@solid-design-system/components 1.22.0 → 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/event.js +1 -1
- 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 +18 -15
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/icon/library.system.d.ts +1 -0
- package/dist/package/components/icon/library.system.js +2 -1
- 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/solid-components.d.ts +1 -0
- package/dist/package/solid-components.js +4 -2
- 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/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 +1 -1
- 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 +1 -1
- package/dist/versioned-package/components/checkbox/checkbox.js +3 -3
- 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/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 +1 -0
- package/dist/versioned-package/components/icon/library.system.js +2 -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/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/form.js +1 -1
- package/dist/versioned-package/solid-components.d.ts +1 -0
- package/dist/versioned-package/solid-components.js +4 -2
- 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 +159 -23
- package/dist/web-types.json +194 -1
- package/package.json +3 -3
|
@@ -39,7 +39,7 @@ let SdCarousel = class extends SolidElement {
|
|
|
39
39
|
this.pausedAutoplay = false;
|
|
40
40
|
this.autoplayController = new AutoplayController(this, () => this.next());
|
|
41
41
|
this.scrollController = new ScrollController(this);
|
|
42
|
-
this.slides = this.getElementsByTagName("sd-1-
|
|
42
|
+
this.slides = this.getElementsByTagName("sd-1-23-0-carousel-item");
|
|
43
43
|
this.intersectionObserverEntries = /* @__PURE__ */ new Map();
|
|
44
44
|
this.localize = new LocalizeController(this);
|
|
45
45
|
this.handleSlotChange = (mutations) => {
|
|
@@ -276,7 +276,7 @@ let SdCarousel = class extends SolidElement {
|
|
|
276
276
|
"!mr-6 !rounded-sm sd-interactive",
|
|
277
277
|
!prevEnabled && "sd-interactive--disabled",
|
|
278
278
|
this.inverted ? "sd-interactive--inverted" : "sd-interactive--reset"
|
|
279
|
-
)}" aria-label="${this.localize.term("previousSlide")}" aria-controls="scroll-container" aria-disabled="${prevEnabled ? "false" : "true"}" @click="${prevEnabled ? () => this.previous() : null}"><slot name="previous-icon"><sd-1-
|
|
279
|
+
)}" aria-label="${this.localize.term("previousSlide")}" aria-controls="scroll-container" aria-disabled="${prevEnabled ? "false" : "true"}" @click="${prevEnabled ? () => this.previous() : null}"><slot name="previous-icon"><sd-1-23-0-icon class="${cx("h-6 w-6 rotate-90 grid place-items-center")}" library="system" name="${isLtr ? "chevron-down" : "chevron-up"}"></sd-1-23-0-icon></slot></button> ${this.variant === "dot" ? html`<div part="pagination-dot" role="tablist" class="${cx("carousel__pagination dot flex wrap items-center gap-2")}" aria-controls="scroll-container">${map(range(pagesCount), (index) => {
|
|
280
280
|
const isActive = index === currentPage;
|
|
281
281
|
return html`<button part="pagination-item ${isActive ? "pagination-item--active" : ""}" class="${cx(
|
|
282
282
|
"carousel__pagination-item",
|
|
@@ -296,18 +296,18 @@ let SdCarousel = class extends SolidElement {
|
|
|
296
296
|
)}" aria-label="${this.localize.term("nextSlide")}" aria-controls="scroll-container" aria-disabled="${nextEnabled ? "false" : "true"}" @click="${nextEnabled ? () => {
|
|
297
297
|
console.log("click-next");
|
|
298
298
|
this.next();
|
|
299
|
-
} : null}"><slot name="next-icon"><sd-1-
|
|
299
|
+
} : null}"><slot name="next-icon"><sd-1-23-0-icon class="${cx("h-6 w-6 rotate-90 grid place-items-center")}" library="system" name="${isLtr ? "chevron-up" : "chevron-down"}"></sd-1-23-0-icon></slot></button></div><button class="${cx(
|
|
300
300
|
"ml-6 !rounded-sm",
|
|
301
301
|
"!absolute !right-0 sd-interactive",
|
|
302
302
|
this.inverted ? "sd-interactive--inverted" : "sd-interactive--reset",
|
|
303
303
|
!this.autoplay && "!hidden"
|
|
304
|
-
)}" part="autoplay-controls" @click="${() => this.pausedAutoplay = !this.pausedAutoplay}"><slot name="autoplay-start" class="${cx(!this.pausedAutoplay ? "hidden" : "")}"><sd-1-
|
|
304
|
+
)}" part="autoplay-controls" @click="${() => this.pausedAutoplay = !this.pausedAutoplay}"><slot name="autoplay-start" class="${cx(!this.pausedAutoplay ? "hidden" : "")}"><sd-1-23-0-icon class="h-6 w-6 grid place-items-center" library="system" name="start"></sd-1-23-0-icon></slot><slot name="autoplay-pause" class="${cx(this.pausedAutoplay ? "hidden" : "")}"><sd-1-23-0-icon class="h-6 w-6 grid place-items-center" library="system" name="pause"></sd-1-23-0-icon></slot></button></div></div>`;
|
|
305
305
|
}
|
|
306
306
|
};
|
|
307
307
|
SdCarousel.styles = [
|
|
308
308
|
SolidElement.styles,
|
|
309
309
|
unsafeCSS(InteractiveStyles),
|
|
310
|
-
css`${componentStyles}:host{--slide-gap:var(--sl-spacing-medium, 1rem);--scroll-hint:0px;display:flex}.carousel{grid-template-areas:'. slides .' '. pagination .'}.carousel__pagination{grid-area:pagination}.carousel__slides{grid-area:slides;scrollbar-width:none;--slide-size:calc((100% - (var(--slides-per-page) - 1) * var(--slide-gap)) / var(--slides-per-page));grid-auto-columns:var(--slide-size);column-gap:var(--slide-gap);scroll-padding-inline:var(--scroll-hint);padding-inline:var(--scroll-hint)}@media (prefers-reduced-motion){:where(.carousel__slides){scroll-behavior:auto}}.carousel__slides--dragging,.carousel__slides--dropping{scroll-snap-type:unset}.carousel__slides::-webkit-scrollbar{display:none}.carousel__navigation{grid-area:navigation}sd-1-
|
|
310
|
+
css`${componentStyles}:host{--slide-gap:var(--sl-spacing-medium, 1rem);--scroll-hint:0px;display:flex}.carousel{grid-template-areas:'. slides .' '. pagination .'}.carousel__pagination{grid-area:pagination}.carousel__slides{grid-area:slides;scrollbar-width:none;--slide-size:calc((100% - (var(--slides-per-page) - 1) * var(--slide-gap)) / var(--slides-per-page));grid-auto-columns:var(--slide-size);column-gap:var(--slide-gap);scroll-padding-inline:var(--scroll-hint);padding-inline:var(--scroll-hint)}@media (prefers-reduced-motion){:where(.carousel__slides){scroll-behavior:auto}}.carousel__slides--dragging,.carousel__slides--dropping{scroll-snap-type:unset}.carousel__slides::-webkit-scrollbar{display:none}.carousel__navigation{grid-area:navigation}sd-1-23-0-button::part(label){display:flex;flex:1 1 auto;align-items:center;pointer-events:none}`
|
|
311
311
|
];
|
|
312
312
|
__decorateClass([
|
|
313
313
|
property({ type: String, reflect: true })
|
|
@@ -359,7 +359,7 @@ __decorateClass([
|
|
|
359
359
|
watch("autoplay")
|
|
360
360
|
], SdCarousel.prototype, "handleAutoplayChange", 1);
|
|
361
361
|
SdCarousel = __decorateClass([
|
|
362
|
-
customElement("sd-1-
|
|
362
|
+
customElement("sd-1-23-0-carousel")
|
|
363
363
|
], SdCarousel);
|
|
364
364
|
export {
|
|
365
365
|
SdCarousel as default
|
|
@@ -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
|
|
@@ -106,7 +106,7 @@ let SdCheckbox = class extends SolidElement {
|
|
|
106
106
|
}
|
|
107
107
|
render() {
|
|
108
108
|
return html`<label part="base" class="${cx(
|
|
109
|
-
"sd-1-
|
|
109
|
+
"sd-1-23-0-checkbox group flex items-start text-base leading-normal text-black cursor-pointer",
|
|
110
110
|
this.disabled && "hover:cursor-not-allowed",
|
|
111
111
|
{
|
|
112
112
|
/* sizes, fonts */
|
|
@@ -122,7 +122,7 @@ let SdCheckbox = class extends SolidElement {
|
|
|
122
122
|
lg: "mt-[3px]"
|
|
123
123
|
}[this.size],
|
|
124
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-
|
|
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
126
|
"select-none inline-block ml-2 text-black",
|
|
127
127
|
this.disabled && "text-neutral-500" || "text-neutral-800"
|
|
128
128
|
)}"><slot></slot></span></label>`;
|
|
@@ -172,7 +172,7 @@ __decorateClass([
|
|
|
172
172
|
watch(["checked", "indeterminate"], { waitUntilFirstUpdate: true })
|
|
173
173
|
], SdCheckbox.prototype, "handleStateChange", 1);
|
|
174
174
|
SdCheckbox = __decorateClass([
|
|
175
|
-
customElement("sd-1-
|
|
175
|
+
customElement("sd-1-23-0-checkbox")
|
|
176
176
|
], SdCheckbox);
|
|
177
177
|
export {
|
|
178
178
|
SdCheckbox as default
|
|
@@ -27,7 +27,7 @@ let SdCheckboxGroup = class extends SolidElement {
|
|
|
27
27
|
this.orientation = "vertical";
|
|
28
28
|
}
|
|
29
29
|
getAllCheckboxes() {
|
|
30
|
-
return [...this.querySelectorAll("sd-1-
|
|
30
|
+
return [...this.querySelectorAll("sd-1-23-0-checkbox")];
|
|
31
31
|
}
|
|
32
32
|
async syncCheckboxElements() {
|
|
33
33
|
const checkboxes = this.getAllCheckboxes();
|
|
@@ -43,10 +43,10 @@ let SdCheckboxGroup = class extends SolidElement {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
syncCheckboxes() {
|
|
46
|
-
if (customElements.get("sd-1-
|
|
46
|
+
if (customElements.get("sd-1-23-0-checkbox")) {
|
|
47
47
|
this.syncCheckboxElements();
|
|
48
48
|
} else {
|
|
49
|
-
customElements.whenDefined("sd-1-
|
|
49
|
+
customElements.whenDefined("sd-1-23-0-checkbox").then(() => this.syncCheckboxes());
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
handleSizeChange() {
|
|
@@ -77,7 +77,7 @@ let SdCheckboxGroup = class extends SolidElement {
|
|
|
77
77
|
SdCheckboxGroup.styles = [
|
|
78
78
|
componentStyles,
|
|
79
79
|
SolidElement.styles,
|
|
80
|
-
css`:host{display:block}:host([orientation=vertical]) ::slotted(sd-1-
|
|
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
81
|
];
|
|
82
82
|
__decorateClass([
|
|
83
83
|
property()
|
|
@@ -95,7 +95,7 @@ __decorateClass([
|
|
|
95
95
|
watch("invalid", { waitUntilFirstUpdate: true })
|
|
96
96
|
], SdCheckboxGroup.prototype, "handleInvalid", 1);
|
|
97
97
|
SdCheckboxGroup = __decorateClass([
|
|
98
|
-
customElement("sd-1-
|
|
98
|
+
customElement("sd-1-23-0-checkbox-group")
|
|
99
99
|
], SdCheckboxGroup);
|
|
100
100
|
export {
|
|
101
101
|
SdCheckboxGroup as default
|
|
@@ -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: [
|
|
@@ -13,7 +13,8 @@ const icons = {
|
|
|
13
13
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
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>`,
|
|
17
18
|
"status-hook": `
|
|
18
19
|
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none">
|
|
19
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"/>
|
|
@@ -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
|
|
@@ -73,10 +73,8 @@ let SdRadio = class extends SolidElement {
|
|
|
73
73
|
}
|
|
74
74
|
render() {
|
|
75
75
|
return html`<span part="base" class="${cx(
|
|
76
|
-
"sd-1-
|
|
77
|
-
this.checked && "radio--checked",
|
|
76
|
+
"sd-1-23-0-radio group inline-flex items-start items-center text-base leading-normal text-black cursor-pointer align-middle",
|
|
78
77
|
this.disabled && "hover:cursor-not-allowed",
|
|
79
|
-
this.hasFocus && "radio--focused",
|
|
80
78
|
{
|
|
81
79
|
/* sizes, fonts */
|
|
82
80
|
sm: "small-size text-sm",
|
|
@@ -89,7 +87,7 @@ let SdRadio = class extends SolidElement {
|
|
|
89
87
|
"rounded-full inline-flex text-white border bg-accent h-2.5 w-2.5",
|
|
90
88
|
this.disabled && "bg-neutral-500" || this.invalid && "bg-error hover:bg-error-400 group-hover:bg-error-400" || this.checked && "bg-accent hover:bg-accent-550 group-hover:bg-accent-550" || "bg-neutral-800"
|
|
91
89
|
)}"></span>` : ""}</span><slot part="label" class="${cx(
|
|
92
|
-
"
|
|
90
|
+
"ml-2 select-none inline-block",
|
|
93
91
|
this.disabled && "text-neutral-500" || this.invalid && "text-error" || "text-black"
|
|
94
92
|
)}"></slot></span>`;
|
|
95
93
|
}
|
|
@@ -123,7 +121,7 @@ __decorateClass([
|
|
|
123
121
|
watch("disabled", { waitUntilFirstUpdate: true })
|
|
124
122
|
], SdRadio.prototype, "handleDisabledChange", 1);
|
|
125
123
|
SdRadio = __decorateClass([
|
|
126
|
-
customElement("sd-1-
|
|
124
|
+
customElement("sd-1-23-0-radio")
|
|
127
125
|
], SdRadio);
|
|
128
126
|
export {
|
|
129
127
|
SdRadio as default
|
|
@@ -4,7 +4,7 @@ import SolidElement from '../../internal/solid-element';
|
|
|
4
4
|
import type { SolidFormControl } from '../../internal/solid-element';
|
|
5
5
|
export default class SdRadioGroup extends SolidElement implements SolidFormControl {
|
|
6
6
|
static dependencies: {
|
|
7
|
-
'sd-1-
|
|
7
|
+
'sd-1-23-0-button-group': typeof SdButtonGroup;
|
|
8
8
|
};
|
|
9
9
|
protected readonly formControlController: FormControlController;
|
|
10
10
|
private readonly hasSlotController;
|
|
@@ -47,6 +47,6 @@ export default class SdRadioGroup extends SolidElement implements SolidFormContr
|
|
|
47
47
|
}
|
|
48
48
|
declare global {
|
|
49
49
|
interface HTMLElementTagNameMap {
|
|
50
|
-
'sd-1-
|
|
50
|
+
'sd-1-23-0-radio-group': SdRadioGroup;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -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-23-0-radio, sd-1-23-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-23-0-radio, sd-1-23-0-radio-button");
|
|
79
79
|
const radios = this.getAllRadios();
|
|
80
80
|
const oldValue = this.value;
|
|
81
81
|
if (target.disabled) {
|
|
@@ -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-23-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-23-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-23-0-radio") && customElements.get("sd-1-23-0-radio-button")) {
|
|
170
170
|
this.syncRadioElements();
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
if (customElements.get("sd-1-
|
|
173
|
+
if (customElements.get("sd-1-23-0-radio")) {
|
|
174
174
|
this.syncRadioElements();
|
|
175
175
|
} else {
|
|
176
|
-
customElements.whenDefined("sd-1-
|
|
176
|
+
customElements.whenDefined("sd-1-23-0-radio").then(() => this.syncRadios());
|
|
177
177
|
}
|
|
178
|
-
if (customElements.get("sd-1-
|
|
178
|
+
if (customElements.get("sd-1-23-0-radio-button")) {
|
|
179
179
|
this.syncRadioElements();
|
|
180
180
|
} else {
|
|
181
|
-
customElements.whenDefined("sd-1-
|
|
181
|
+
customElements.whenDefined("sd-1-23-0-radio-button").then(() => this.syncRadios());
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
updateCheckedRadio() {
|
|
@@ -241,35 +241,34 @@ let SdRadioGroup = class extends SolidElement {
|
|
|
241
241
|
const hasErrorText = this.errorText ? true : !!hasErrorTextSlot;
|
|
242
242
|
const defaultSlot = html`<slot @slotchange="${this.syncRadios}" @click="${this.handleRadioClick}" @keydown="${this.handleKeyDown}"></slot>`;
|
|
243
243
|
return html`<fieldset part="form-control" class="${cx(
|
|
244
|
-
"
|
|
245
|
-
hasLabel && "form-control--has-label",
|
|
244
|
+
"border-0 p-0 m-0",
|
|
246
245
|
hasErrorText && "text-error",
|
|
247
246
|
{
|
|
248
247
|
/* sizes, fonts */
|
|
249
248
|
sm: "text-sm",
|
|
250
249
|
lg: "text-base"
|
|
251
250
|
}[this.size]
|
|
252
|
-
)}" role="radiogroup" aria-labelledby="label" aria-errormessage="error-text"><label part="form-control-label" id="label" class="
|
|
251
|
+
)}" role="radiogroup" aria-labelledby="label" aria-errormessage="error-text"><label part="form-control-label" id="label" class="${cx("mb-2 p-0 font-bold leading-normal text-black", hasLabel ? "has-label flex" : "hidden")}" aria-hidden="${!hasLabel}" @click="${this.handleLabelClick}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${cx(
|
|
253
252
|
"form-control-input flex",
|
|
254
253
|
this.invalid && "form-control-input--invalid text-error",
|
|
255
254
|
{
|
|
256
|
-
vertical: "
|
|
257
|
-
horizontal: "
|
|
255
|
+
vertical: "flex-col",
|
|
256
|
+
horizontal: "flex-row"
|
|
258
257
|
}[this.orientation]
|
|
259
|
-
)}"><div class="sr-only"><div id="error-message" aria-live="assertive">${this.errorText}</div><label
|
|
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>`;
|
|
260
259
|
}
|
|
261
260
|
};
|
|
262
|
-
SdRadioGroup.dependencies = { "sd-1-
|
|
261
|
+
SdRadioGroup.dependencies = { "sd-1-23-0-button-group": SdButtonGroup };
|
|
263
262
|
SdRadioGroup.styles = [
|
|
264
263
|
componentStyles,
|
|
265
264
|
SolidElement.styles,
|
|
266
|
-
css`:host{display:block}
|
|
265
|
+
css`:host{display:block}:host([orientation=vertical]) ::slotted(sd-1-23-0-radio){margin-bottom:8px;display:flex}:host([orientation=vertical]) ::slotted(sd-1-23-0-radio:last-of-type){margin-bottom:0}:host([orientation=horizontal]) ::slotted(sd-1-23-0-radio){margin-right:24px}:host([size=sm]):host([orientation=horizontal]) ::slotted(sd-1-23-0-radio){margin-right:16px}:host([orientation=horizontal]) ::slotted(sd-1-23-0-radio:last-of-type){margin-right:0}:host([required]) #label.has-label::after{content:'*';margin-left:2px}`
|
|
267
266
|
];
|
|
268
267
|
__decorateClass([
|
|
269
268
|
query("slot:not([name])")
|
|
270
269
|
], SdRadioGroup.prototype, "defaultSlot", 2);
|
|
271
270
|
__decorateClass([
|
|
272
|
-
query("
|
|
271
|
+
query("#validation-input")
|
|
273
272
|
], SdRadioGroup.prototype, "validationInput", 2);
|
|
274
273
|
__decorateClass([
|
|
275
274
|
state()
|
|
@@ -314,7 +313,7 @@ __decorateClass([
|
|
|
314
313
|
watch("value")
|
|
315
314
|
], SdRadioGroup.prototype, "handleValueChange", 1);
|
|
316
315
|
SdRadioGroup = __decorateClass([
|
|
317
|
-
customElement("sd-1-
|
|
316
|
+
customElement("sd-1-23-0-radio-group")
|
|
318
317
|
], SdRadioGroup);
|
|
319
318
|
export {
|
|
320
319
|
SdRadioGroup as default
|