@solid-design-system/components 3.6.0 → 3.7.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/option.js +1 -1
- package/dist/components/es/solid-components2.js +1 -1
- package/dist/components/umd/solid-components.js +2 -2
- package/dist/custom-elements.json +1 -1
- package/dist/package/components/accordion/accordion.d.ts +2 -1
- package/dist/package/components/carousel/carousel.d.ts +2 -1
- package/dist/package/components/dialog/dialog.d.ts +2 -1
- package/dist/package/components/drawer/drawer.d.ts +2 -1
- package/dist/package/components/dropdown/dropdown.d.ts +2 -1
- package/dist/package/components/input/input.d.ts +2 -1
- package/dist/package/components/notification/notification.d.ts +2 -1
- package/dist/package/components/option/option.d.ts +0 -1
- package/dist/package/components/option/option.js +0 -2
- package/dist/package/components/select/select.d.ts +2 -1
- package/dist/package/components/spinner/spinner.d.ts +2 -1
- package/dist/package/components/tab-group/tab-group.d.ts +2 -1
- package/dist/package/components/tooltip/tooltip.d.ts +2 -1
- package/dist/package/utilities/localize.d.ts +10 -0
- package/dist/package/utilities/localize.js +45 -0
- package/dist/versioned-components/es/accordion-group.js +1 -1
- package/dist/versioned-components/es/accordion.js +1 -1
- package/dist/versioned-components/es/badge.js +1 -1
- package/dist/versioned-components/es/brandshape.js +1 -1
- package/dist/versioned-components/es/button.js +1 -1
- package/dist/versioned-components/es/carousel-item.js +1 -1
- package/dist/versioned-components/es/carousel.js +3 -3
- package/dist/versioned-components/es/checkbox-group.js +1 -1
- package/dist/versioned-components/es/checkbox.js +1 -1
- package/dist/versioned-components/es/dialog.js +1 -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/form.js +1 -1
- package/dist/versioned-components/es/header.js +1 -1
- package/dist/versioned-components/es/icon.js +1 -1
- package/dist/versioned-components/es/include.js +1 -1
- package/dist/versioned-components/es/input.js +1 -1
- package/dist/versioned-components/es/link.js +1 -1
- package/dist/versioned-components/es/map-marker.js +1 -1
- package/dist/versioned-components/es/navigation-item.js +1 -1
- package/dist/versioned-components/es/notification.js +1 -1
- package/dist/versioned-components/es/option.js +1 -1
- package/dist/versioned-components/es/popup.js +1 -1
- package/dist/versioned-components/es/radio-button.js +1 -1
- package/dist/versioned-components/es/radio-group.js +1 -1
- package/dist/versioned-components/es/radio.js +1 -1
- package/dist/versioned-components/es/scrollable.js +1 -1
- package/dist/versioned-components/es/select.js +3 -3
- package/dist/versioned-components/es/solid-components2.js +1 -1
- package/dist/versioned-components/es/spinner.js +1 -1
- package/dist/versioned-components/es/step-group.js +1 -1
- package/dist/versioned-components/es/step.js +1 -1
- package/dist/versioned-components/es/switch.js +1 -1
- package/dist/versioned-components/es/tab-group.js +1 -1
- package/dist/versioned-components/es/tab-panel.js +1 -1
- package/dist/versioned-components/es/tab.js +1 -1
- package/dist/versioned-components/es/tag.js +1 -1
- package/dist/versioned-components/es/teaser-media.js +1 -1
- package/dist/versioned-components/es/teaser.js +1 -1
- package/dist/versioned-components/es/textarea.js +1 -1
- package/dist/versioned-components/es/tooltip.js +2 -2
- package/dist/versioned-components/es/video.js +1 -1
- package/dist/versioned-package/_components/button-group/button-group.d.ts +1 -1
- package/dist/versioned-package/_components/button-group/button-group.js +11 -11
- package/dist/versioned-package/components/accordion/accordion.d.ts +3 -2
- 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 +3 -2
- 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/dialog/dialog.d.ts +3 -2
- package/dist/versioned-package/components/dialog/dialog.js +2 -2
- 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 +3 -2
- package/dist/versioned-package/components/drawer/drawer.js +2 -2
- package/dist/versioned-package/components/dropdown/dropdown.d.ts +3 -2
- package/dist/versioned-package/components/dropdown/dropdown.js +8 -8
- package/dist/versioned-package/components/header/header.d.ts +1 -1
- package/dist/versioned-package/components/header/header.js +4 -4
- package/dist/versioned-package/components/icon/icon.d.ts +1 -1
- package/dist/versioned-package/components/icon/icon.js +1 -1
- package/dist/versioned-package/components/include/include.d.ts +1 -1
- package/dist/versioned-package/components/include/include.js +1 -1
- package/dist/versioned-package/components/input/input.d.ts +3 -2
- package/dist/versioned-package/components/input/input.js +2 -2
- 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/map-marker/map-marker.d.ts +1 -1
- package/dist/versioned-package/components/map-marker/map-marker.js +1 -1
- package/dist/versioned-package/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist/versioned-package/components/navigation-item/navigation-item.js +3 -3
- package/dist/versioned-package/components/notification/notification.d.ts +3 -2
- package/dist/versioned-package/components/notification/notification.js +5 -5
- package/dist/versioned-package/components/option/option.d.ts +1 -2
- package/dist/versioned-package/components/option/option.js +2 -4
- package/dist/versioned-package/components/popup/popup.d.ts +1 -1
- package/dist/versioned-package/components/popup/popup.js +1 -1
- package/dist/versioned-package/components/radio/radio.d.ts +1 -1
- package/dist/versioned-package/components/radio/radio.js +2 -2
- package/dist/versioned-package/components/radio-button/radio-button.d.ts +1 -1
- package/dist/versioned-package/components/radio-button/radio-button.js +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.d.ts +2 -2
- package/dist/versioned-package/components/radio-group/radio-group.js +13 -13
- package/dist/versioned-package/components/scrollable/scrollable.d.ts +1 -1
- package/dist/versioned-package/components/scrollable/scrollable.js +3 -3
- package/dist/versioned-package/components/select/select.d.ts +6 -5
- package/dist/versioned-package/components/select/select.js +25 -25
- package/dist/versioned-package/components/spinner/spinner.d.ts +3 -2
- package/dist/versioned-package/components/spinner/spinner.js +1 -1
- package/dist/versioned-package/components/step/step.d.ts +1 -1
- package/dist/versioned-package/components/step/step.js +5 -5
- package/dist/versioned-package/components/step-group/step-group.d.ts +1 -1
- package/dist/versioned-package/components/step-group/step-group.js +2 -2
- package/dist/versioned-package/components/switch/switch.d.ts +1 -1
- package/dist/versioned-package/components/switch/switch.js +1 -1
- package/dist/versioned-package/components/tab/tab.d.ts +1 -1
- package/dist/versioned-package/components/tab/tab.js +2 -2
- package/dist/versioned-package/components/tab-group/tab-group.d.ts +3 -2
- package/dist/versioned-package/components/tab-group/tab-group.js +13 -13
- package/dist/versioned-package/components/tab-panel/tab-panel.d.ts +1 -1
- package/dist/versioned-package/components/tab-panel/tab-panel.js +2 -2
- package/dist/versioned-package/components/tag/tag.d.ts +1 -1
- package/dist/versioned-package/components/tag/tag.js +2 -2
- package/dist/versioned-package/components/teaser/teaser.js +1 -1
- package/dist/versioned-package/components/teaser-media/teaser-media.js +1 -1
- package/dist/versioned-package/components/textarea/textarea.d.ts +1 -1
- package/dist/versioned-package/components/textarea/textarea.js +2 -2
- package/dist/versioned-package/components/tooltip/tooltip.d.ts +3 -2
- package/dist/versioned-package/components/tooltip/tooltip.js +5 -5
- package/dist/versioned-package/components/video/video.d.ts +1 -1
- package/dist/versioned-package/components/video/video.js +2 -2
- package/dist/versioned-package/internal/form.js +3 -3
- package/dist/versioned-package/styles/headline/headline.css.js +1 -1
- package/dist/versioned-package/utilities/autocomplete-config.js +4 -4
- package/dist/versioned-package/utilities/localize.d.ts +10 -0
- package/dist/versioned-package/utilities/localize.js +45 -0
- package/dist/versioned-styles/solid-styles.css +1 -1
- package/dist/vscode.html-custom-data.json +41 -41
- package/dist/web-types.json +42 -50
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import '../icon/icon';
|
|
2
|
+
import { LocalizeController } from '../../utilities/localize';
|
|
2
3
|
import SolidElement from '../../internal/solid-element';
|
|
3
4
|
export default class SdAccordion extends SolidElement {
|
|
4
|
-
|
|
5
|
+
localize: LocalizeController;
|
|
5
6
|
accordion: HTMLElement;
|
|
6
7
|
header: HTMLElement;
|
|
7
8
|
body: HTMLElement;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import '../icon/icon.js';
|
|
2
|
+
import { LocalizeController } from '../../utilities/localize.js';
|
|
2
3
|
import SolidElement from '../../internal/solid-element.js';
|
|
3
4
|
export default class SdCarousel extends SolidElement {
|
|
4
5
|
variant: 'dot' | 'number';
|
|
@@ -17,7 +18,7 @@ export default class SdCarousel extends SolidElement {
|
|
|
17
18
|
private readonly slides;
|
|
18
19
|
private intersectionObserver;
|
|
19
20
|
private readonly intersectionObserverEntries;
|
|
20
|
-
|
|
21
|
+
localize: LocalizeController;
|
|
21
22
|
private mutationObserver;
|
|
22
23
|
connectedCallback(): void;
|
|
23
24
|
disconnectedCallback(): void;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import '../button/button';
|
|
2
2
|
import '../icon/icon';
|
|
3
|
+
import { LocalizeController } from '../../utilities/localize';
|
|
3
4
|
import SolidElement from '../../internal/solid-element';
|
|
4
5
|
export default class SdDialog extends SolidElement {
|
|
5
6
|
private readonly hasSlotController;
|
|
6
|
-
|
|
7
|
+
localize: LocalizeController;
|
|
7
8
|
private modal;
|
|
8
9
|
private originalTrigger;
|
|
9
10
|
dialog: HTMLElement;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import '../button/button';
|
|
2
2
|
import '../icon/icon';
|
|
3
|
+
import { LocalizeController } from '../../utilities/localize';
|
|
3
4
|
import SolidElement from '../../internal/solid-element';
|
|
4
5
|
export default class SdDrawer extends SolidElement {
|
|
5
6
|
private readonly hasSlotController;
|
|
6
|
-
|
|
7
|
+
localize: LocalizeController;
|
|
7
8
|
private modal;
|
|
8
9
|
private originalTrigger;
|
|
9
10
|
drawer: HTMLElement;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import '../popup/popup';
|
|
2
|
+
import { LocalizeController } from '../../utilities/localize';
|
|
2
3
|
import SolidElement from '../../internal/solid-element';
|
|
3
4
|
import type SdMenu from '../../_components/menu/menu';
|
|
4
5
|
import type SdPopup from '../popup/popup';
|
|
@@ -6,7 +7,7 @@ export default class SdDropdown extends SolidElement {
|
|
|
6
7
|
popup: SdPopup;
|
|
7
8
|
trigger: HTMLSlotElement;
|
|
8
9
|
panel: HTMLSlotElement;
|
|
9
|
-
|
|
10
|
+
localize: LocalizeController;
|
|
10
11
|
open: boolean;
|
|
11
12
|
rounded: boolean;
|
|
12
13
|
placement: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import '../icon/icon';
|
|
2
2
|
import { FormControlController } from '../../internal/form';
|
|
3
|
+
import { LocalizeController } from '../../utilities/localize';
|
|
3
4
|
import SolidElement from '../../internal/solid-element';
|
|
4
5
|
import type { SolidFormControl } from '../../internal/solid-element';
|
|
5
6
|
export default class SdInput extends SolidElement implements SolidFormControl {
|
|
6
7
|
protected readonly formControlController: FormControlController;
|
|
7
8
|
private readonly hasSlotController;
|
|
8
|
-
|
|
9
|
+
localize: LocalizeController;
|
|
9
10
|
input: HTMLInputElement;
|
|
10
11
|
invalidMessage: HTMLDivElement;
|
|
11
12
|
hasFocus: boolean;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { LocalizeController } from '../../utilities/localize.js';
|
|
1
2
|
import SolidElement from '../../internal/solid-element.js';
|
|
2
3
|
export default class SdNotification extends SolidElement {
|
|
3
4
|
private autoHideTimeout;
|
|
4
|
-
|
|
5
|
+
localize: LocalizeController;
|
|
5
6
|
base: HTMLElement;
|
|
6
7
|
open: boolean;
|
|
7
8
|
closable: boolean;
|
|
@@ -3,7 +3,6 @@ import SolidElement from '../../internal/solid-element';
|
|
|
3
3
|
export default class SdOption extends SolidElement {
|
|
4
4
|
private readonly hasSlotController;
|
|
5
5
|
private cachedTextLabel;
|
|
6
|
-
private readonly localize;
|
|
7
6
|
defaultSlot: HTMLSlotElement;
|
|
8
7
|
current: boolean;
|
|
9
8
|
selected: boolean;
|
|
@@ -2,7 +2,6 @@ import "../icon/icon.js";
|
|
|
2
2
|
import { css, html } from "lit";
|
|
3
3
|
import { customElement } from "../../internal/register-custom-element.js";
|
|
4
4
|
import { HasSlotController } from "../../internal/slot.js";
|
|
5
|
-
import { LocalizeController } from "../../utilities/localize.js";
|
|
6
5
|
import { query, state, property } from "lit/decorators.js";
|
|
7
6
|
import { watch } from "../../internal/watch.js";
|
|
8
7
|
import componentStyles from "../../styles/component.styles.js";
|
|
@@ -23,7 +22,6 @@ let SdOption = class extends SolidElement {
|
|
|
23
22
|
constructor() {
|
|
24
23
|
super(...arguments);
|
|
25
24
|
this.hasSlotController = new HasSlotController(this, "default", "left", "right");
|
|
26
|
-
this.localize = new LocalizeController(this);
|
|
27
25
|
this.current = false;
|
|
28
26
|
this.selected = false;
|
|
29
27
|
this.hasHover = false;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LocalizeController } from '../../utilities/localize.js';
|
|
1
2
|
import SdIcon from '../icon/icon';
|
|
2
3
|
import SdPopup from '../popup/popup';
|
|
3
4
|
import SdTag from '../tag/tag';
|
|
@@ -13,7 +14,7 @@ export default class SdSelect extends SolidElement implements SolidFormControl {
|
|
|
13
14
|
};
|
|
14
15
|
private readonly formControlController;
|
|
15
16
|
private readonly hasSlotController;
|
|
16
|
-
|
|
17
|
+
localize: LocalizeController;
|
|
17
18
|
private typeToSelectString;
|
|
18
19
|
private typeToSelectTimeout;
|
|
19
20
|
_optionsInDefaultSlot: SdOption[];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { LocalizeController } from '../../utilities/localize';
|
|
1
2
|
import SolidElement from '../../internal/solid-element';
|
|
2
3
|
export default class SdSpinner extends SolidElement {
|
|
3
4
|
color: 'primary' | 'white' | 'currentColor';
|
|
4
|
-
|
|
5
|
+
localize: LocalizeController;
|
|
5
6
|
render(): import("lit-html").TemplateResult<1>;
|
|
6
7
|
static styles: import("lit").CSSResultGroup[];
|
|
7
8
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { LocalizeController } from '../../utilities/localize';
|
|
1
2
|
import SolidElement from '../../internal/solid-element';
|
|
2
3
|
import type SdTab from '../tab/tab';
|
|
3
4
|
export default class SdTabGroup extends SolidElement {
|
|
4
|
-
|
|
5
|
+
localize: LocalizeController;
|
|
5
6
|
private activeTab?;
|
|
6
7
|
private mutationObserver;
|
|
7
8
|
private resizeObserver;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import '../popup/popup';
|
|
2
|
+
import { LocalizeController } from '../../utilities/localize';
|
|
2
3
|
import SolidElement from '../../internal/solid-element';
|
|
3
4
|
import type SdPopup from '../popup/popup';
|
|
4
5
|
export default class SdTooltip extends SolidElement {
|
|
5
6
|
private hoverTimeout;
|
|
6
|
-
|
|
7
|
+
localize: LocalizeController;
|
|
7
8
|
defaultSlot: HTMLSlotElement;
|
|
8
9
|
body: HTMLElement;
|
|
9
10
|
popup: SdPopup;
|
|
@@ -2,7 +2,17 @@ import '../translations/de';
|
|
|
2
2
|
import '../translations/en';
|
|
3
3
|
import { LocalizeController as DefaultLocalizationController } from '@shoelace-style/localize';
|
|
4
4
|
import type { Translation as DefaultTranslation } from '@shoelace-style/localize';
|
|
5
|
+
import type { ReactiveControllerHost } from 'lit';
|
|
5
6
|
export declare class LocalizeController extends DefaultLocalizationController<Translation> {
|
|
7
|
+
private _instanceTranslations;
|
|
8
|
+
constructor(host: ReactiveControllerHost & HTMLElement);
|
|
9
|
+
get instanceTranslations(): Partial<Translation> | null;
|
|
10
|
+
set instanceTranslations(value: Partial<Translation> | null);
|
|
11
|
+
hostConnected(): void;
|
|
12
|
+
hostDisconnected(): void;
|
|
13
|
+
private setCustomLocalizationFromData;
|
|
14
|
+
term<K extends keyof Translation>(key: K, ...args: unknown[]): string;
|
|
15
|
+
setCustomLocalization(customLocalization: Partial<Translation>): void;
|
|
6
16
|
}
|
|
7
17
|
export interface Translation extends DefaultTranslation {
|
|
8
18
|
$code: string;
|
|
@@ -2,6 +2,51 @@ import "../translations/de.js";
|
|
|
2
2
|
import "../translations/en.js";
|
|
3
3
|
import { LocalizeController as LocalizeController$1 } from "../node_modules/.pnpm/@shoelace-style_localize@3.1.2/node_modules/@shoelace-style/localize/dist/index.js";
|
|
4
4
|
class LocalizeController extends LocalizeController$1 {
|
|
5
|
+
constructor(host) {
|
|
6
|
+
super(host);
|
|
7
|
+
this._instanceTranslations = null;
|
|
8
|
+
}
|
|
9
|
+
get instanceTranslations() {
|
|
10
|
+
return this._instanceTranslations;
|
|
11
|
+
}
|
|
12
|
+
set instanceTranslations(value) {
|
|
13
|
+
this._instanceTranslations = value;
|
|
14
|
+
this.host.requestUpdate();
|
|
15
|
+
}
|
|
16
|
+
hostConnected() {
|
|
17
|
+
super.hostConnected();
|
|
18
|
+
this.setCustomLocalizationFromData();
|
|
19
|
+
new MutationObserver(() => this.setCustomLocalizationFromData()).observe(this.host, {
|
|
20
|
+
attributes: true,
|
|
21
|
+
attributeFilter: ["data-custom-localization"]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
hostDisconnected() {
|
|
25
|
+
super.hostDisconnected();
|
|
26
|
+
}
|
|
27
|
+
setCustomLocalizationFromData() {
|
|
28
|
+
const dataCustomLocalization = this.host.dataset.customLocalization;
|
|
29
|
+
if (dataCustomLocalization) {
|
|
30
|
+
try {
|
|
31
|
+
this.setCustomLocalization(JSON.parse(dataCustomLocalization));
|
|
32
|
+
} catch (error) {
|
|
33
|
+
console.error("Error parsing custom-localization attribute:", error);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
term(key, ...args) {
|
|
38
|
+
const term = this.instanceTranslations && this.instanceTranslations[key];
|
|
39
|
+
if (term) {
|
|
40
|
+
if (typeof term === "function") {
|
|
41
|
+
return term(...args);
|
|
42
|
+
}
|
|
43
|
+
return term;
|
|
44
|
+
}
|
|
45
|
+
return super.term(key, ...args);
|
|
46
|
+
}
|
|
47
|
+
setCustomLocalization(customLocalization) {
|
|
48
|
+
this.instanceTranslations = { ...this.instanceTranslations, ...customLocalization };
|
|
49
|
+
}
|
|
5
50
|
}
|
|
6
51
|
export {
|
|
7
52
|
LocalizeController
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./accordion.js";import{S as e,x as t,i as o,n as s,c as r}from"./solid-element.js";import{o as c}from"./query-assigned-elements.js";import{c as n}from"./component.styles.js";var a=Object.defineProperty,d=Object.getOwnPropertyDescriptor,i=(e,t,o,s)=>{for(var r,c=s>1?void 0:s?d(t,o):t,n=e.length-1;n>=0;n--)(r=e[n])&&(c=(s?r(t,o,c):r(c))||c);return s&&c&&a(t,o,c),c};let l=class extends e{constructor(){super(...arguments),this.closeOthers=!1,this.handleAccordionShow=e=>{this.closeOthers&&this._accordionsInDefaultSlot.forEach((t=>{t!==e.target&&t.parentNode===e.target.parentNode&&t.removeAttribute("open")}))}}connectedCallback(){super.connectedCallback(),this.addEventListener("sd-show",this.handleAccordionShow)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sd-show",this.handleAccordionShow)}render(){return t`<div part="base"><slot></slot></div>`}};l.styles=[n,e.styles,o`:host{display:block}::slotted(sd-3-
|
|
1
|
+
import"./accordion.js";import{S as e,x as t,i as o,n as s,c as r}from"./solid-element.js";import{o as c}from"./query-assigned-elements.js";import{c as n}from"./component.styles.js";var a=Object.defineProperty,d=Object.getOwnPropertyDescriptor,i=(e,t,o,s)=>{for(var r,c=s>1?void 0:s?d(t,o):t,n=e.length-1;n>=0;n--)(r=e[n])&&(c=(s?r(t,o,c):r(c))||c);return s&&c&&a(t,o,c),c};let l=class extends e{constructor(){super(...arguments),this.closeOthers=!1,this.handleAccordionShow=e=>{this.closeOthers&&this._accordionsInDefaultSlot.forEach((t=>{t!==e.target&&t.parentNode===e.target.parentNode&&t.removeAttribute("open")}))}}connectedCallback(){super.connectedCallback(),this.addEventListener("sd-show",this.handleAccordionShow)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sd-show",this.handleAccordionShow)}render(){return t`<div part="base"><slot></slot></div>`}};l.styles=[n,e.styles,o`:host{display:block}::slotted(sd-3-7-0-accordion:not(:first-of-type)){margin-top:-1px}`],i([c({selector:"sd-3-7-0-accordion"})],l.prototype,"_accordionsInDefaultSlot",2),i([s({attribute:"close-others",type:Boolean})],l.prototype,"closeOthers",2),l=i([r("sd-3-7-0-accordion-group")],l);export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./icon.js";import{s as e,a as t,b as s,w as o}from"./event.js";import{S as i,x as a,i as r,n,c as h}from"./solid-element.js";import{g as d,s as l}from"./animation-registry.js";import{L as p}from"./solid-components2.js";import{e as c}from"./query.js";import{w as y}from"./watch.js";import{t as m}from"./classix.js";var u=Object.defineProperty,f=Object.getOwnPropertyDescriptor,b=(e,t,s,o)=>{for(var i,a=o>1?void 0:o?f(t,s):t,r=e.length-1;r>=0;r--)(i=e[r])&&(a=(o?i(t,s,a):i(a))||a);return o&&a&&u(t,s,a),a};let w=class extends i{constructor(){super(...arguments),this.localize=new p(this),this.open=!1}firstUpdated(){this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0"}handleSummaryClick(){this.header.focus(),this.open?this.hide():this.show()}handleSummaryKeyDown(e){("Enter"===e.key||" "===e.key)&&(e.preventDefault(),this.open?this.hide():this.show()),("ArrowUp"===e.key||"ArrowLeft"===e.key)&&(e.preventDefault(),this.hide()),("ArrowDown"===e.key||"ArrowRight"===e.key)&&(e.preventDefault(),this.show())}async handleOpenChange(){if(this.open){if(this.emit("sd-show",{cancelable:!0}).defaultPrevented)return void(this.open=!1);await e(this.body),this.body.hidden=!1;const{keyframes:o,options:i}=d(this,"accordion.show",{dir:this.localize.dir()});await t(this.body,s(o,this.body.scrollHeight),i),this.body.style.height="auto",this.emit("sd-after-show")}else{if(this.emit("sd-hide",{cancelable:!0}).defaultPrevented)return void(this.open=!0);await e(this.body);const{keyframes:o,options:i}=d(this,"accordion.hide",{dir:this.localize.dir()});await t(this.body,s(o,this.body.scrollHeight),i),this.body.hidden=!0,this.body.style.height="auto",this.emit("sd-after-hide")}}async show(){if(!this.open)return this.open=!0,o(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,o(this,"sd-after-hide")}render(){return a`<div part="base" class="border-y-[1px] border-neutral-400"><header part="header" id="header" class="${m("flex text-base gap-4 font-bold items-center cursor-pointer select-none px-4 py-3 focus-visible:focus-outline text-primary hover:bg-neutral-200 relative group")}" role="button" aria-expanded="${this.open?"true":"false"}" aria-controls="content" tabindex="0" @click="${this.handleSummaryClick}" @keydown="${this.handleSummaryKeyDown}"><div part="summary-border" class="${m(!this.open&&"opacity-0","w-1 bg-accent absolute left-0 transition-all h-[calc(100%-16px)] group-hover:h-full")}"></div><slot name="summary" part="summary" class="flex flex-auto items-center text-left">${this.summary}</slot><span part="summary-icon" class="${m("flex flex-grow-0 flex-shrink-0 flex-auto items-center transition-all ease-in-out duration-300 text-xl",this.open&&"rotate-180")}"><slot name="expand-icon" class="${m(this.open&&"hidden")}"><sd-3-
|
|
1
|
+
import"./icon.js";import{s as e,a as t,b as s,w as o}from"./event.js";import{S as i,x as a,i as r,n,c as h}from"./solid-element.js";import{g as d,s as l}from"./animation-registry.js";import{L as p}from"./solid-components2.js";import{e as c}from"./query.js";import{w as y}from"./watch.js";import{t as m}from"./classix.js";var u=Object.defineProperty,f=Object.getOwnPropertyDescriptor,b=(e,t,s,o)=>{for(var i,a=o>1?void 0:o?f(t,s):t,r=e.length-1;r>=0;r--)(i=e[r])&&(a=(o?i(t,s,a):i(a))||a);return o&&a&&u(t,s,a),a};let w=class extends i{constructor(){super(...arguments),this.localize=new p(this),this.open=!1}firstUpdated(){this.body.hidden=!this.open,this.body.style.height=this.open?"auto":"0"}handleSummaryClick(){this.header.focus(),this.open?this.hide():this.show()}handleSummaryKeyDown(e){("Enter"===e.key||" "===e.key)&&(e.preventDefault(),this.open?this.hide():this.show()),("ArrowUp"===e.key||"ArrowLeft"===e.key)&&(e.preventDefault(),this.hide()),("ArrowDown"===e.key||"ArrowRight"===e.key)&&(e.preventDefault(),this.show())}async handleOpenChange(){if(this.open){if(this.emit("sd-show",{cancelable:!0}).defaultPrevented)return void(this.open=!1);await e(this.body),this.body.hidden=!1;const{keyframes:o,options:i}=d(this,"accordion.show",{dir:this.localize.dir()});await t(this.body,s(o,this.body.scrollHeight),i),this.body.style.height="auto",this.emit("sd-after-show")}else{if(this.emit("sd-hide",{cancelable:!0}).defaultPrevented)return void(this.open=!0);await e(this.body);const{keyframes:o,options:i}=d(this,"accordion.hide",{dir:this.localize.dir()});await t(this.body,s(o,this.body.scrollHeight),i),this.body.hidden=!0,this.body.style.height="auto",this.emit("sd-after-hide")}}async show(){if(!this.open)return this.open=!0,o(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,o(this,"sd-after-hide")}render(){return a`<div part="base" class="border-y-[1px] border-neutral-400"><header part="header" id="header" class="${m("flex text-base gap-4 font-bold items-center cursor-pointer select-none px-4 py-3 focus-visible:focus-outline text-primary hover:bg-neutral-200 relative group")}" role="button" aria-expanded="${this.open?"true":"false"}" aria-controls="content" tabindex="0" @click="${this.handleSummaryClick}" @keydown="${this.handleSummaryKeyDown}"><div part="summary-border" class="${m(!this.open&&"opacity-0","w-1 bg-accent absolute left-0 transition-all h-[calc(100%-16px)] group-hover:h-full")}"></div><slot name="summary" part="summary" class="flex flex-auto items-center text-left">${this.summary}</slot><span part="summary-icon" class="${m("flex flex-grow-0 flex-shrink-0 flex-auto items-center transition-all ease-in-out duration-300 text-xl",this.open&&"rotate-180")}"><slot name="expand-icon" class="${m(this.open&&"hidden")}"><sd-3-7-0-icon library="system" name="chevron-down"></sd-3-7-0-icon></slot><slot name="collapse-icon" class="${m(!this.open&&"hidden")}"><sd-3-7-0-icon library="system" name="chevron-down"></sd-3-7-0-icon></slot></span></header><div part="content" id="content" class="overflow-hidden"><slot part="content__slot" class="block px-4 py-6" role="region" aria-labelledby="header"></slot></div></div>`}};w.styles=[i.styles,r`:host{display:block}`],b([c('[part="base"]')],w.prototype,"accordion",2),b([c('[part="header"]')],w.prototype,"header",2),b([c('[part="content"]')],w.prototype,"body",2),b([n({type:Boolean,reflect:!0})],w.prototype,"open",2),b([n()],w.prototype,"summary",2),b([y("open",{waitUntilFirstUpdate:!0})],w.prototype,"handleOpenChange",1),w=b([h("sd-3-7-0-accordion")],w),l("accordion.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:300,easing:"ease"}}),l("accordion.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:300,easing:"ease"}});export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,x as t,i as r,n as s,c as i}from"./solid-element.js";import{t as n}from"./classix.js";var a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,p=(e,t,r,s)=>{for(var i,n=s>1?void 0:s?o(t,r):t,p=e.length-1;p>=0;p--)(i=e[p])&&(n=(s?i(t,r,n):i(n))||n);return s&&n&&a(t,r,n),n};let l=class extends e{constructor(){super(...arguments),this.variant="default",this.size="lg",this.inverted=!1}render(){return t`<span tabindex="0" role="status" part="base" class="${n("inline-flex items-center justify-center gap-x-[1px] text-center leading-none whitespace-nowrap border rounded-full select-none cursor-[inherit]",{default:this.inverted?"text-primary bg-white border-primary":"text-white bg-primary-500 border-white",success:this.inverted?"text-white bg-success border-primary":"text-white bg-success border-white",error:this.inverted?"text-white bg-error border-primary":"text-white bg-error border-white"}[this.variant],{sm:"h-2 min-w-[8px] text-[10px]",md:"h-4 px-[4px] min-w-[16px] text-[10px]",lg:"h-5 px-[5px] min-w-[20px] text-[12px]"}[this.size])}"><span part="content" class="${n("sm"===this.size&&"hidden")}"><slot></slot></span></span>`}};l.styles=[e.styles,r`:host{display:inline-flex;align-items:center;justify-content:center}`],p([s({reflect:!0})],l.prototype,"variant",2),p([s({reflect:!0})],l.prototype,"size",2),p([s({type:Boolean,reflect:!0})],l.prototype,"inverted",2),l=p([i("sd-3-
|
|
1
|
+
import{S as e,x as t,i as r,n as s,c as i}from"./solid-element.js";import{t as n}from"./classix.js";var a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,p=(e,t,r,s)=>{for(var i,n=s>1?void 0:s?o(t,r):t,p=e.length-1;p>=0;p--)(i=e[p])&&(n=(s?i(t,r,n):i(n))||n);return s&&n&&a(t,r,n),n};let l=class extends e{constructor(){super(...arguments),this.variant="default",this.size="lg",this.inverted=!1}render(){return t`<span tabindex="0" role="status" part="base" class="${n("inline-flex items-center justify-center gap-x-[1px] text-center leading-none whitespace-nowrap border rounded-full select-none cursor-[inherit]",{default:this.inverted?"text-primary bg-white border-primary":"text-white bg-primary-500 border-white",success:this.inverted?"text-white bg-success border-primary":"text-white bg-success border-white",error:this.inverted?"text-white bg-error border-primary":"text-white bg-error border-white"}[this.variant],{sm:"h-2 min-w-[8px] text-[10px]",md:"h-4 px-[4px] min-w-[16px] text-[10px]",lg:"h-5 px-[5px] min-w-[20px] text-[12px]"}[this.size])}"><span part="content" class="${n("sm"===this.size&&"hidden")}"><slot></slot></span></span>`}};l.styles=[e.styles,r`:host{display:inline-flex;align-items:center;justify-content:center}`],p([s({reflect:!0})],l.prototype,"variant",2),p([s({reflect:!0})],l.prototype,"size",2),p([s({type:Boolean,reflect:!0})],l.prototype,"inverted",2),l=p([i("sd-3-7-0-badge")],l);export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as t,x as e,i as s,n as r,c as i}from"./solid-element.js";import{r as a}from"./state.js";import{e as o}from"./query.js";import{c as n}from"./component.styles.js";import{t as p}from"./classix.js";var l=Object.defineProperty,h=Object.getOwnPropertyDescriptor,v=(t,e,s,r)=>{for(var i,a=r>1?void 0:r?h(e,s):e,o=t.length-1;o>=0;o--)(i=t[o])&&(a=(r?i(e,s,a):i(a))||a);return r&&a&&l(e,s,a),a};let d=class extends t{constructor(){super(...arguments),this.variant="primary",this.shapes=["top","middle","bottom"],this.componentBreakpoint=0}getSvg(t,e){return{0:this.smallSvg(e),414:this.mediumSvg(e),640:this.largeSvg(e)}[t]}largeSvg(t){return"top"===t?e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M610.777 1.393.001 120.146 0 123h700.001V74.79c0-4.797-.462-9.585-1.381-14.294-7.909-40.537-47.237-66.998-87.843-59.103Z"/></svg>`:e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 123"><path d="M89.224 121.607 700 2.854 700.001 0h-700L0 48.21c0 4.797.463 9.584 1.381 14.294 7.909 40.537 47.237 66.998 87.843 59.103Z"/></svg>`}mediumSvg(t){return"top"===t?e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 119"><path d="M597.75 1.6 0 118.046V121h700V85.872c0-5.509-.53-11.006-1.583-16.413-9.063-46.543-54.133-76.924-100.667-67.86Z"/></svg>`:e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M102.25 119.4 700 2.954V0H0v35.128c0 5.509.53 11.006 1.583 16.413 9.063 46.543 54.134 76.924 100.667 67.859Z"/></svg>`}smallSvg(t){return"top"===t?e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 113"><path d="M566.951 2.08 0 112.466v2.934h700v-3.672c0-7.166-.689-14.314-2.059-21.348-11.789-60.557-70.436-100.09-130.99-88.3Z"/></svg>`:e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 116"><path d="M133.049 113.32 700 2.934V0H0v3.672c0 7.165.69 14.314 2.059 21.348 11.79 60.557 70.436 100.09 130.99 88.3Z"/></svg>`}setBreakpoint(){switch(!0){case this.containerElem.clientWidth<=414:this.componentBreakpoint=0;break;case this.containerElem.clientWidth<640:this.componentBreakpoint=414;break;default:this.componentBreakpoint=640}}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>this.setBreakpoint())),this.updateComplete.then((()=>{this.setBreakpoint(),this.resizeObserver.observe(this.containerElem)}))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.containerElem)}renderTopBrandshape(){return e`<div class="relative" part="shape-top">${1===this.shapes.length?e`<div class="relative">${this.getSvg(this.componentBreakpoint,"top")}<div part="content" class="absolute bottom-0 right-0 flex items-end w-2/5 h-2/3 px-6 py-4"><slot></slot></div></div>`:this.getSvg(this.componentBreakpoint,"top")} ${this.renderWhitespaceFix("top")}</div>`}renderMiddleBrandshape(){return e`<div class="${p({0:"px-6 py-4",414:"px-10 py-8",640:"px-10 py-8"}[this.componentBreakpoint],"w-full block relative")}"><div part="shape-middle" class="${p({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white"}[this.variant],"w-full block absolute h-full top-0 left-0 z-0")}"></div><div class="z-10 relative" part="content"><slot></slot></div></div>`}renderBottomBrandshape(){return e`<div class="relative" part="shape-bottom">${this.getSvg(this.componentBreakpoint,"bottom")}${this.renderWhitespaceFix("bottom")}</div>`}renderWhitespaceFix(t){return e`<div class="${p({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white"}[this.variant],{top:"bottom-0",bottom:"top-0"}[t],"block absolute left-0 w-full h-[1px]")}"></div>`}render(){return e`<div class="${p({"neutral-100":"fill-neutral-100",primary:"fill-primary",white:"fill-white"}[this.variant])}" part="base">${this.shapes.includes("top")?this.renderTopBrandshape():null} ${this.shapes.includes("middle")?this.renderMiddleBrandshape():null} ${this.shapes.includes("bottom")?this.renderBottomBrandshape():null}</div>`}};d.styles=[n,t.styles,s`:host{display:block}`],v([o("[part=base]")],d.prototype,"containerElem",2),v([r({type:String})],d.prototype,"variant",2),v([r({type:Array})],d.prototype,"shapes",2),v([a()],d.prototype,"componentBreakpoint",2),d=v([i("sd-3-
|
|
1
|
+
import{S as t,x as e,i as s,n as r,c as i}from"./solid-element.js";import{r as a}from"./state.js";import{e as o}from"./query.js";import{c as n}from"./component.styles.js";import{t as p}from"./classix.js";var l=Object.defineProperty,h=Object.getOwnPropertyDescriptor,v=(t,e,s,r)=>{for(var i,a=r>1?void 0:r?h(e,s):e,o=t.length-1;o>=0;o--)(i=t[o])&&(a=(r?i(e,s,a):i(a))||a);return r&&a&&l(e,s,a),a};let d=class extends t{constructor(){super(...arguments),this.variant="primary",this.shapes=["top","middle","bottom"],this.componentBreakpoint=0}getSvg(t,e){return{0:this.smallSvg(e),414:this.mediumSvg(e),640:this.largeSvg(e)}[t]}largeSvg(t){return"top"===t?e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M610.777 1.393.001 120.146 0 123h700.001V74.79c0-4.797-.462-9.585-1.381-14.294-7.909-40.537-47.237-66.998-87.843-59.103Z"/></svg>`:e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 123"><path d="M89.224 121.607 700 2.854 700.001 0h-700L0 48.21c0 4.797.463 9.584 1.381 14.294 7.909 40.537 47.237 66.998 87.843 59.103Z"/></svg>`}mediumSvg(t){return"top"===t?e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 119"><path d="M597.75 1.6 0 118.046V121h700V85.872c0-5.509-.53-11.006-1.583-16.413-9.063-46.543-54.133-76.924-100.667-67.86Z"/></svg>`:e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121"><path d="M102.25 119.4 700 2.954V0H0v35.128c0 5.509.53 11.006 1.583 16.413 9.063 46.543 54.134 76.924 100.667 67.859Z"/></svg>`}smallSvg(t){return"top"===t?e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 113"><path d="M566.951 2.08 0 112.466v2.934h700v-3.672c0-7.166-.689-14.314-2.059-21.348-11.789-60.557-70.436-100.09-130.99-88.3Z"/></svg>`:e`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 116"><path d="M133.049 113.32 700 2.934V0H0v3.672c0 7.165.69 14.314 2.059 21.348 11.79 60.557 70.436 100.09 130.99 88.3Z"/></svg>`}setBreakpoint(){switch(!0){case this.containerElem.clientWidth<=414:this.componentBreakpoint=0;break;case this.containerElem.clientWidth<640:this.componentBreakpoint=414;break;default:this.componentBreakpoint=640}}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver((()=>this.setBreakpoint())),this.updateComplete.then((()=>{this.setBreakpoint(),this.resizeObserver.observe(this.containerElem)}))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.unobserve(this.containerElem)}renderTopBrandshape(){return e`<div class="relative" part="shape-top">${1===this.shapes.length?e`<div class="relative">${this.getSvg(this.componentBreakpoint,"top")}<div part="content" class="absolute bottom-0 right-0 flex items-end w-2/5 h-2/3 px-6 py-4"><slot></slot></div></div>`:this.getSvg(this.componentBreakpoint,"top")} ${this.renderWhitespaceFix("top")}</div>`}renderMiddleBrandshape(){return e`<div class="${p({0:"px-6 py-4",414:"px-10 py-8",640:"px-10 py-8"}[this.componentBreakpoint],"w-full block relative")}"><div part="shape-middle" class="${p({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white"}[this.variant],"w-full block absolute h-full top-0 left-0 z-0")}"></div><div class="z-10 relative" part="content"><slot></slot></div></div>`}renderBottomBrandshape(){return e`<div class="relative" part="shape-bottom">${this.getSvg(this.componentBreakpoint,"bottom")}${this.renderWhitespaceFix("bottom")}</div>`}renderWhitespaceFix(t){return e`<div class="${p({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white"}[this.variant],{top:"bottom-0",bottom:"top-0"}[t],"block absolute left-0 w-full h-[1px]")}"></div>`}render(){return e`<div class="${p({"neutral-100":"fill-neutral-100",primary:"fill-primary",white:"fill-white"}[this.variant])}" part="base">${this.shapes.includes("top")?this.renderTopBrandshape():null} ${this.shapes.includes("middle")?this.renderMiddleBrandshape():null} ${this.shapes.includes("bottom")?this.renderBottomBrandshape():null}</div>`}};d.styles=[n,t.styles,s`:host{display:block}`],v([o("[part=base]")],d.prototype,"containerElem",2),v([r({type:String})],d.prototype,"variant",2),v([r({type:Array})],d.prototype,"shapes",2),v([a()],d.prototype,"componentBreakpoint",2),d=v([i("sd-3-7-0-brandshape")],d);export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./spinner.js";import{S as t,i as e,n as r,c as i}from"./solid-element.js";import{F as o,v as a}from"./form.js";import{H as s}from"./slot.js";import{s as n,n as l}from"./static.js";import{o as d}from"./if-defined.js";import{r as p}from"./state.js";import{e as h}from"./query.js";import{o as c}from"./query-assigned-elements.js";import{w as m}from"./watch.js";import{c as u}from"./component.styles.js";import{t as b}from"./classix.js";var v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,f=(t,e,r,i)=>{for(var o,a=i>1?void 0:i?y(e,r):e,s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i?o(e,r,a):o(a))||a);return i&&a&&v(e,r,a),a};let g=class extends t{constructor(){super(...arguments),this.formControlController=new o(this,{form:t=>{if(t.hasAttribute("form")){const e=t.getRootNode(),r=t.getAttribute("form");return e.getElementById(r)}return t.closest("form")}}),this.hasSlotController=new s(this,"[default]","icon-left","icon-right"),this.invalid=!1,this.title="",this.variant="primary",this.inverted=!1,this.size="lg",this.disabled=!1,this.loading=!1,this.type="button",this.name="",this.value="",this.href=""}get validity(){return this.isButton()?this.button.validity:a}get validationMessage(){return this.isButton()?this.button.validationMessage:""}firstUpdated(){this.isButton()&&this.formControlController.updateValidity()}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleClick(t){if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation();"submit"===this.type&&this.formControlController.submit(this),"reset"===this.type&&this.formControlController.reset(this)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t)}isButton(){return!this.href}isLink(){return!!this.href}handleDisabledChange(){this.isButton()&&this.formControlController.setValidity(this.disabled)}click(){this.button.click()}focus(t){this.button.focus(t)}blur(){this.button.blur()}checkValidity(){return!this.isButton()||this.button.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return!this.isButton()||this.button.reportValidity()}setCustomValidity(t){this.isButton()&&(this.button.setCustomValidity(t),this.formControlController.updateValidity())}render(){const t=this.isLink(),e=t?n`a`:n`button`,r={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right"),"icon-only":this._iconsInDefaultSlot.length>0};return l`<${e} part="base" class="${b("font-md leading-[calc(var(--tw-varspacing)-2px)] no-underline\n w-full h-varspacing whitespace-nowrap align-middle inline-flex items-stretch justify-center\n border transition-colors duration-200 ease-in-out rounded-default\n select-none cursor-[inherit]",this.inverted?"focus-visible:focus-outline-inverted":"focus-visible:focus-outline",this.loading&&"relative cursor-wait",this.disabled&&"cursor-not-allowed",r["icon-only"]&&"px-0 w-varspacing",{sm:"text-sm varspacing-8 px-4",md:"text-base varspacing-10 px-4",lg:"text-base varspacing-12 px-4"}[this.size],{primary:this.inverted?"text-primary bg-white border-transparent\n hover:text-primary-500 hover:bg-primary-100\n active:text-primary-800 active:bg-primary-200\n disabled:bg-neutral-600 disabled:text-white":"text-white bg-primary border-transparent\n hover:text-primary-100 hover:bg-primary-500\n active:text-primary-200 active:bg-primary-800\n disabled:bg-neutral-500",secondary:this.inverted?"text-white border-white\n hover:text-primary-100 hover:bg-primary-500 hover:border-primary-100\n active:text-primary-200 active:bg-primary-800 active:border-primary-200\n disabled:text-neutral-600 disabled:border-neutral-600":"text-primary border-primary\n hover:text-primary-500 hover:border-primary-500 hover:bg-primary-100\n active:text-primary-800 active:border-primary-800 active:bg-primary-200\n disabled:text-neutral-500 disabled:border-neutral-500",tertiary:this.inverted?"text-white border-transparent\n hover:text-primary-100 hover:bg-primary-500\n active:text-primary-200 active:bg-primary-800\n disabled:text-neutral-600":"text-primary border-transparent\n hover:text-primary-500 hover:bg-primary-100\n active:text-primary-800 active:bg-primary-200\n disabled:text-neutral-500",cta:`text-white bg-accent-500 border-transparent\n hover:bg-accent-550\n active:bg-accent-700\n ${this.inverted?"disabled:bg-neutral-600":"disabled:bg-neutral-500"} disabled:text-white`}[this.variant])}" ?disabled="${d(t?void 0:this.disabled)}" type="${d(t?void 0:this.type)}" title="${this.title}" name="${d(t?void 0:this.name)}" value="${d(t?void 0:this.value)}" href="${d(t?this.href:void 0)}" target="${d(t?this.target:void 0)}" download="${d(t?this.download:void 0)}" rel="${d(t&&this.target?"noreferrer noopener":void 0)}" role="${d(t?void 0:"button")}" aria-disabled="${this.disabled?"true":"false"}" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @invalid="${this.isButton()?this.handleInvalid:null}" @click="${this.handleClick}"><slot name="icon-left" part="icon-left" class="${b("flex flex-auto items-center pointer-events-none",r["icon-only"]&&"hidden",this.loading&&"invisible",r["icon-left"]&&{sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size])}"></slot><slot part="label" class="${b(r["icon-only"]?"flex flex-auto items-center pointer-events-none":"inline-block",this.loading&&"invisible")}"></slot><slot name="icon-right" part="icon-right" class="${b("flex flex-auto items-center pointer-events-none",this.loading&&"invisible",r["icon-only"]&&"hidden",r["icon-right"]&&{sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size])}"></slot>${this.loading?l`<sd-3-
|
|
1
|
+
import"./spinner.js";import{S as t,i as e,n as r,c as i}from"./solid-element.js";import{F as o,v as a}from"./form.js";import{H as s}from"./slot.js";import{s as n,n as l}from"./static.js";import{o as d}from"./if-defined.js";import{r as p}from"./state.js";import{e as h}from"./query.js";import{o as c}from"./query-assigned-elements.js";import{w as m}from"./watch.js";import{c as u}from"./component.styles.js";import{t as b}from"./classix.js";var v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,f=(t,e,r,i)=>{for(var o,a=i>1?void 0:i?y(e,r):e,s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i?o(e,r,a):o(a))||a);return i&&a&&v(e,r,a),a};let g=class extends t{constructor(){super(...arguments),this.formControlController=new o(this,{form:t=>{if(t.hasAttribute("form")){const e=t.getRootNode(),r=t.getAttribute("form");return e.getElementById(r)}return t.closest("form")}}),this.hasSlotController=new s(this,"[default]","icon-left","icon-right"),this.invalid=!1,this.title="",this.variant="primary",this.inverted=!1,this.size="lg",this.disabled=!1,this.loading=!1,this.type="button",this.name="",this.value="",this.href=""}get validity(){return this.isButton()?this.button.validity:a}get validationMessage(){return this.isButton()?this.button.validationMessage:""}firstUpdated(){this.isButton()&&this.formControlController.updateValidity()}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}handleClick(t){if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation();"submit"===this.type&&this.formControlController.submit(this),"reset"===this.type&&this.formControlController.reset(this)}handleInvalid(t){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(t)}isButton(){return!this.href}isLink(){return!!this.href}handleDisabledChange(){this.isButton()&&this.formControlController.setValidity(this.disabled)}click(){this.button.click()}focus(t){this.button.focus(t)}blur(){this.button.blur()}checkValidity(){return!this.isButton()||this.button.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return!this.isButton()||this.button.reportValidity()}setCustomValidity(t){this.isButton()&&(this.button.setCustomValidity(t),this.formControlController.updateValidity())}render(){const t=this.isLink(),e=t?n`a`:n`button`,r={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right"),"icon-only":this._iconsInDefaultSlot.length>0};return l`<${e} part="base" class="${b("font-md leading-[calc(var(--tw-varspacing)-2px)] no-underline\n w-full h-varspacing whitespace-nowrap align-middle inline-flex items-stretch justify-center\n border transition-colors duration-200 ease-in-out rounded-default\n select-none cursor-[inherit]",this.inverted?"focus-visible:focus-outline-inverted":"focus-visible:focus-outline",this.loading&&"relative cursor-wait",this.disabled&&"cursor-not-allowed",r["icon-only"]&&"px-0 w-varspacing",{sm:"text-sm varspacing-8 px-4",md:"text-base varspacing-10 px-4",lg:"text-base varspacing-12 px-4"}[this.size],{primary:this.inverted?"text-primary bg-white border-transparent\n hover:text-primary-500 hover:bg-primary-100\n active:text-primary-800 active:bg-primary-200\n disabled:bg-neutral-600 disabled:text-white":"text-white bg-primary border-transparent\n hover:text-primary-100 hover:bg-primary-500\n active:text-primary-200 active:bg-primary-800\n disabled:bg-neutral-500",secondary:this.inverted?"text-white border-white\n hover:text-primary-100 hover:bg-primary-500 hover:border-primary-100\n active:text-primary-200 active:bg-primary-800 active:border-primary-200\n disabled:text-neutral-600 disabled:border-neutral-600":"text-primary border-primary\n hover:text-primary-500 hover:border-primary-500 hover:bg-primary-100\n active:text-primary-800 active:border-primary-800 active:bg-primary-200\n disabled:text-neutral-500 disabled:border-neutral-500",tertiary:this.inverted?"text-white border-transparent\n hover:text-primary-100 hover:bg-primary-500\n active:text-primary-200 active:bg-primary-800\n disabled:text-neutral-600":"text-primary border-transparent\n hover:text-primary-500 hover:bg-primary-100\n active:text-primary-800 active:bg-primary-200\n disabled:text-neutral-500",cta:`text-white bg-accent-500 border-transparent\n hover:bg-accent-550\n active:bg-accent-700\n ${this.inverted?"disabled:bg-neutral-600":"disabled:bg-neutral-500"} disabled:text-white`}[this.variant])}" ?disabled="${d(t?void 0:this.disabled)}" type="${d(t?void 0:this.type)}" title="${this.title}" name="${d(t?void 0:this.name)}" value="${d(t?void 0:this.value)}" href="${d(t?this.href:void 0)}" target="${d(t?this.target:void 0)}" download="${d(t?this.download:void 0)}" rel="${d(t&&this.target?"noreferrer noopener":void 0)}" role="${d(t?void 0:"button")}" aria-disabled="${this.disabled?"true":"false"}" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @invalid="${this.isButton()?this.handleInvalid:null}" @click="${this.handleClick}"><slot name="icon-left" part="icon-left" class="${b("flex flex-auto items-center pointer-events-none",r["icon-only"]&&"hidden",this.loading&&"invisible",r["icon-left"]&&{sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size])}"></slot><slot part="label" class="${b(r["icon-only"]?"flex flex-auto items-center pointer-events-none":"inline-block",this.loading&&"invisible")}"></slot><slot name="icon-right" part="icon-right" class="${b("flex flex-auto items-center pointer-events-none",this.loading&&"invisible",r["icon-only"]&&"hidden",r["icon-right"]&&{sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size])}"></slot>${this.loading?l`<sd-3-7-0-spinner class="${b("absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2")}"></sd-3-7-0-spinner>`:""}</${e}>`}};g.styles=[u,t.styles,e`:host{position:relative;display:inline-block;width:var(--sd-spacing-auto,auto);cursor:pointer}sd-3-7-0-spinner{--indicator-color:currentColor;--track-color:var(--tw-varcolor-200)}::slotted(sd-3-7-0-badge){pointer-events:none;position:absolute;top:var(--sd-spacing-0,0);right:var(--sd-spacing-0,0);--tw-translate-x:50%!important;--tw-translate-y:-50%!important;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}::slotted(sd-3-7-0-icon),sd-3-7-0-spinner{font-size:calc(var(--tw-varspacing)/ 2)}`],f([h("a, button")],g.prototype,"button",2),f([c({selector:"sd-3-7-0-icon"})],g.prototype,"_iconsInDefaultSlot",2),f([p()],g.prototype,"invalid",2),f([r()],g.prototype,"title",2),f([r({reflect:!0})],g.prototype,"variant",2),f([r({type:Boolean,reflect:!0})],g.prototype,"inverted",2),f([r({reflect:!0})],g.prototype,"size",2),f([r({type:Boolean,reflect:!0})],g.prototype,"disabled",2),f([r({type:Boolean,reflect:!0})],g.prototype,"loading",2),f([r()],g.prototype,"type",2),f([r()],g.prototype,"name",2),f([r()],g.prototype,"value",2),f([r()],g.prototype,"href",2),f([r()],g.prototype,"target",2),f([r()],g.prototype,"download",2),f([r()],g.prototype,"form",2),f([r({attribute:"formaction"})],g.prototype,"formAction",2),f([r({attribute:"formenctype"})],g.prototype,"formEnctype",2),f([r({attribute:"formmethod"})],g.prototype,"formMethod",2),f([r({attribute:"formnovalidate",type:Boolean})],g.prototype,"formNoValidate",2),f([r({attribute:"formtarget"})],g.prototype,"formTarget",2),f([m("disabled",{waitUntilFirstUpdate:!0})],g.prototype,"handleDisabledChange",1),g=f([i("sd-3-7-0-button")],g);export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as t,x as e,i as s,c as r}from"./solid-element.js";import{c as o}from"./component.styles.js";Object.defineProperty,Object.getOwnPropertyDescriptor;let i=class extends t{static isCarouselItem(t){return t instanceof Element&&"slide"===t.getAttribute("aria-roledescription")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","group")}render(){return e`<slot></slot>`}};i.styles=[t.styles,o,s`:host{aspect-ratio:var(--aspect-ratio);scroll-snap-align:start;scroll-snap-stop:always;display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center}::slotted(img){height:100%;width:100%;-o-object-fit:cover;object-fit:cover}`],i=((t,e,s,r)=>{for(var o,i=e,l=t.length-1;l>=0;l--)(o=t[l])&&(i=o(i)||i);return i})([r("sd-3-
|
|
1
|
+
import{S as t,x as e,i as s,c as r}from"./solid-element.js";import{c as o}from"./component.styles.js";Object.defineProperty,Object.getOwnPropertyDescriptor;let i=class extends t{static isCarouselItem(t){return t instanceof Element&&"slide"===t.getAttribute("aria-roledescription")}connectedCallback(){super.connectedCallback(),this.setAttribute("role","group")}render(){return e`<slot></slot>`}};i.styles=[t.styles,o,s`:host{aspect-ratio:var(--aspect-ratio);scroll-snap-align:start;scroll-snap-stop:always;display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center}::slotted(img){height:100%;width:100%;-o-object-fit:cover;object-fit:cover}`],i=((t,e,s,r)=>{for(var o,i=e,l=t.length-1;l>=0;l--)(o=t[l])&&(i=o(i)||i);return i})([r("sd-3-7-0-carousel-item")],i);export{i as default};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import"./icon.js";import{AutoplayController as e}from"./autoplay-controller.js";import{S as t,x as i,r as s,i as o,n as r,c as a}from"./solid-element.js";import{L as l}from"./solid-components2.js";import{p as n}from"./event.js";import{r as c}from"./state.js";import{e as d}from"./query.js";import{ScrollController as p}from"./scroll-controller.js";import{w as h}from"./watch.js";import{c as u}from"./component.styles.js";import{t as g}from"./classix.js";import{I as v}from"./interactive.js";import m from"./carousel-item.js";var b=Object.defineProperty,y=Object.getOwnPropertyDescriptor,f=(e,t,i,s)=>{for(var o,r=s>1?void 0:s?y(t,i):t,a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&b(t,i,r),r};let w=class extends t{constructor(){super(...arguments),this.variant="number",this.inverted=!1,this.loop=!1,this.autoplay=!1,this.slidesPerPage=1,this.slidesPerMove=1,this.activeSlide=0,this.pausedAutoplay=!1,this.autoplayController=new e(this,(()=>this.next())),this.scrollController=new p(this),this.slides=this.getElementsByTagName("sd-3-
|
|
1
|
+
import"./icon.js";import{AutoplayController as e}from"./autoplay-controller.js";import{S as t,x as i,r as s,i as o,n as r,c as a}from"./solid-element.js";import{L as l}from"./solid-components2.js";import{p as n}from"./event.js";import{r as c}from"./state.js";import{e as d}from"./query.js";import{ScrollController as p}from"./scroll-controller.js";import{w as h}from"./watch.js";import{c as u}from"./component.styles.js";import{t as g}from"./classix.js";import{I as v}from"./interactive.js";import m from"./carousel-item.js";var b=Object.defineProperty,y=Object.getOwnPropertyDescriptor,f=(e,t,i,s)=>{for(var o,r=s>1?void 0:s?y(t,i):t,a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&b(t,i,r),r};let w=class extends t{constructor(){super(...arguments),this.variant="number",this.inverted=!1,this.loop=!1,this.autoplay=!1,this.slidesPerPage=1,this.slidesPerMove=1,this.activeSlide=0,this.pausedAutoplay=!1,this.autoplayController=new e(this,(()=>this.next())),this.scrollController=new p(this),this.slides=this.getElementsByTagName("sd-3-7-0-carousel-item"),this.intersectionObserverEntries=new Map,this.localize=new l(this),this.handleSlotChange=e=>{e.some((e=>[...e.addedNodes,...e.removedNodes].some((e=>m.isCarouselItem(e)&&!e.hasAttribute("data-clone")))))&&this.initializeSlides(),this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","region"),this.setAttribute("aria-label",this.localize.term("carousel"));const e=new IntersectionObserver((e=>{e.forEach((e=>{this.intersectionObserverEntries.set(e.target,e);const t=e.target;t.toggleAttribute("inert",!e.isIntersecting),t.classList.toggle("--in-view",e.isIntersecting),t.setAttribute("aria-hidden",e.isIntersecting?"false":"true")}))}),{root:this,threshold:.6});this.intersectionObserver=e,e.takeRecords().forEach((e=>{this.intersectionObserverEntries.set(e.target,e)}))}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.mutationObserver.disconnect()}firstUpdated(){this.initializeSlides(),this.mutationObserver=new MutationObserver(this.handleSlotChange),this.mutationObserver.observe(this,{childList:!0,subtree:!1})}getPageCount(){return Math.ceil(this.getSlides().length/this.slidesPerPage)}getCurrentPage(){return Math.ceil(this.activeSlide/this.slidesPerPage)}getSlides({excludeClones:e=!0}={}){return[...this.slides].filter((t=>!e||!t.hasAttribute("data-clone")))}handleKeyDown(e){if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key)){const t=e.target,i="rtl"===this.localize.dir(),s=null!==t.closest('[part~="pagination-item"]'),o="ArrowDown"===e.key||!i&&"ArrowRight"===e.key||i&&"ArrowLeft"===e.key,r="ArrowUp"===e.key||!i&&"ArrowLeft"===e.key||i&&"ArrowRight"===e.key;e.preventDefault(),r&&this.previous(),o&&this.next(),"Home"===e.key&&this.goToSlide(0),"End"===e.key&&this.goToSlide(this.getSlides().length-1),s&&this.updateComplete.then((()=>{var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector('[part~="pagination-item--active"]');t&&t.focus()}))}}handleScrollEnd(){const e=this.getSlides(),t=[...this.intersectionObserverEntries.values()].find((e=>e.isIntersecting));if(this.loop&&null!=t&&t.target.hasAttribute("data-clone")){const e=Number(t.target.getAttribute("data-clone"));this.goToSlide(e,"auto")}else t&&(this.activeSlide=e.indexOf(t.target))}handlePausedAutoplay(){this.pausedAutoplay?this.autoplayController.controlledPause():this.autoplay&&this.autoplayController.controlledResume()}initializeSlides(){const e=this.getSlides(),t=this.intersectionObserver;if(this.intersectionObserverEntries.clear(),this.getSlides({excludeClones:!1}).forEach(((e,i)=>{t.unobserve(e),e.classList.remove("--in-view"),e.classList.remove("--is-active"),e.setAttribute("aria-label",this.localize.term("slideNum",i+1)),e.hasAttribute("data-clone")&&e.remove()})),this.loop){const t=this.slidesPerPage,i=e.slice(-t),s=e.slice(0,t);i.reverse().forEach(((t,i)=>{const s=t.cloneNode(!0);s.setAttribute("data-clone",String(e.length-i-1)),this.prepend(s)})),s.forEach(((e,t)=>{const i=e.cloneNode(!0);i.setAttribute("data-clone",String(t)),this.append(i)}))}this.getSlides({excludeClones:!1}).forEach((e=>{t.observe(e)})),this.goToSlide(this.activeSlide,"auto")}handelSlideChange(){const e=this.getSlides();e.forEach(((e,t)=>{e.classList.toggle("--is-active",t===this.activeSlide)})),this.hasUpdated&&this.emit("sd-slide-change",{detail:{index:this.activeSlide,slide:e[this.activeSlide]}})}handleSlidesPerMoveChange(){const e=this.getSlides({excludeClones:!1}),t=this.slidesPerMove;e.forEach(((e,i)=>{Math.abs(i-t)%t==0?e.style.removeProperty("scroll-snap-align"):e.style.setProperty("scroll-snap-align","none")}))}handleAutoplayChange(){this.autoplayController.stop(),this.autoplay&&!this.pausedAutoplay&&this.autoplayController.start(3e3)}previous(e="smooth"){let t=this.activeSlide||this.activeSlide-this.slidesPerMove,i=!1;for(;!i&&t>0;)t-=1,i=Math.abs(t-this.slidesPerMove)%this.slidesPerMove==0;this.goToSlide(t,e)}next(e="smooth"){this.goToSlide(this.activeSlide+this.slidesPerMove,e)}goToSlide(e,t="smooth"){const{slidesPerPage:i,loop:s,scrollContainer:o}=this,r=this.getSlides(),a=this.getSlides({excludeClones:!1}),l=(e+r.length)%r.length;this.activeSlide=l;const c=function(e,t,i){return(e=>Object.is(e,-0)?0:e)(e<0?0:e>i?i:e)}
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2021 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
*/(e+(s?i:0),0,a.length-1),d=a[c],p=o.getBoundingClientRect(),h=d.getBoundingClientRect();o.scrollTo({left:h.left-p.left+o.scrollLeft,top:h.top-p.top+o.scrollTop,behavior:n()?"auto":t})}render(){const{scrollController:e,slidesPerPage:t}=this,s=this.getPageCount(),o=this.getCurrentPage(),r=this.loop||o>0,a=this.loop||o<s-1,l="ltr"===this.localize.dir();return i`<div part="base" class="${g("carousel h-full w-full")}"><div id="scroll-container" part="scroll-container" class="${g("carousel__slides mb-6\n grid max-h-full w-full items-center justify-items-center overflow-auto",this.inverted?"focus-visible:focus-outline-inverted":"focus-visible:focus-outline","overscroll-x-contain grid-flow-col auto-rows-[100%]\n snap-x snap-mandatory overflow-y-hidden")}" style="--slides-per-page:${this.slidesPerPage}" aria-busy="${e.scrolling?"true":"false"}" aria-atomic="true" tabindex="0" @keydown="${this.handleKeyDown}" @scrollend="${this.handleScrollEnd}"><slot></slot></div><div part="controls" class="${g("w-full flex items-center justify-center relative")}"><div part="navigation" class="${g("carousel__navigation flex items-center justify-center")}"><button part="navigation-button navigation-button--previous" id="carousel__navigation-button--previous" ?disabled="${!r}" class="${g("!mr-6 !rounded-sm sd-interactive",!r&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("previousSlide")}" aria-controls="scroll-container" aria-disabled="${r?"false":"true"}" @click="${r?()=>this.previous():null}"><slot name="previous-icon"><sd-3-
|
|
6
|
+
*/(e+(s?i:0),0,a.length-1),d=a[c],p=o.getBoundingClientRect(),h=d.getBoundingClientRect();o.scrollTo({left:h.left-p.left+o.scrollLeft,top:h.top-p.top+o.scrollTop,behavior:n()?"auto":t})}render(){const{scrollController:e,slidesPerPage:t}=this,s=this.getPageCount(),o=this.getCurrentPage(),r=this.loop||o>0,a=this.loop||o<s-1,l="ltr"===this.localize.dir();return i`<div part="base" class="${g("carousel h-full w-full")}"><div id="scroll-container" part="scroll-container" class="${g("carousel__slides mb-6\n grid max-h-full w-full items-center justify-items-center overflow-auto",this.inverted?"focus-visible:focus-outline-inverted":"focus-visible:focus-outline","overscroll-x-contain grid-flow-col auto-rows-[100%]\n snap-x snap-mandatory overflow-y-hidden")}" style="--slides-per-page:${this.slidesPerPage}" aria-busy="${e.scrolling?"true":"false"}" aria-atomic="true" tabindex="0" @keydown="${this.handleKeyDown}" @scrollend="${this.handleScrollEnd}"><slot></slot></div><div part="controls" class="${g("w-full flex items-center justify-center relative")}"><div part="navigation" class="${g("carousel__navigation flex items-center justify-center")}"><button part="navigation-button navigation-button--previous" id="carousel__navigation-button--previous" ?disabled="${!r}" class="${g("!mr-6 !rounded-sm sd-interactive",!r&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("previousSlide")}" aria-controls="scroll-container" aria-disabled="${r?"false":"true"}" @click="${r?()=>this.previous():null}"><slot name="previous-icon"><sd-3-7-0-icon class="${g("h-6 w-6 rotate-90 grid place-items-center")}" library="system" name="${l?"chevron-down":"chevron-up"}"></sd-3-7-0-icon></slot></button> ${"dot"===this.variant?i`<div part="pagination-dot" role="tablist" class="${g("carousel__pagination dot flex wrap items-center gap-2")}" aria-controls="scroll-container">${function*(e,t){if(void 0!==e){let i=0;for(const s of e)yield t(s,i++)}}
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2021 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/(function*(e,t,i=1){const s=void 0===t?0:e;t??(t=e);for(let e=s;i>0?e<t:t<e;e+=i)yield e}(s),(e=>{const r=e===o;return i`<button part="pagination-item ${r?"pagination-item--active":""}" class="${g("carousel__pagination-item","block cursor-pointer bg-none border-0 rounded-full",r?"bg-accent":"",this.inverted?"focus-within:focus-outline-inverted":"focus-within:focus-outline")}" role="tab" tabindex="0" aria-selected="${r?"true":"false"}" aria-label="${this.localize.term("goToSlide",e+1,s)}" @click="${()=>this.goToSlide(e*t)}" @keydown="${this.handleKeyDown}"><span class="${g("h-4 w-4 block border hover:border-primary-500 rounded-full",this.inverted?"border-white hover:border-primary-500":"border-primary",r&&"bg-accent border-none",r?this.inverted?"hover:bg-accent-300":"hover:bg-accent-550":"")}"></span></button>`}))}</div>`:i`<span part="pagination-number" class="carousel__pagination number flex gap-0.5 cursor-default select-none" aria-controls="scroll-container"><span part="pagination-item" class="${g("w-5 text-center border-b-2 border-accent",this.inverted?"text-white":"text-black")}">${o+1}</span> <span part="pagination-divider" class="${g("scale-y-[1.5]","text-center",this.inverted?"text-white":"text-black")}">/</span> <span part="pagination-item" class="${g("w-5 text-center",this.inverted?"text-white":"text-black")}">${s}</span></span>`} <button part="navigation-button navigation-button--next" id="carousel__navigation-button--next" ?disabled="${!a}" class="${g("!ml-6 !rounded-sm sd-interactive ",!a&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("nextSlide")}" aria-controls="scroll-container" aria-disabled="${a?"false":"true"}" @click="${a?()=>{console.log("click-next"),this.next()}:null}"><slot name="next-icon"><sd-3-
|
|
11
|
+
*/(function*(e,t,i=1){const s=void 0===t?0:e;t??(t=e);for(let e=s;i>0?e<t:t<e;e+=i)yield e}(s),(e=>{const r=e===o;return i`<button part="pagination-item ${r?"pagination-item--active":""}" class="${g("carousel__pagination-item","block cursor-pointer bg-none border-0 rounded-full",r?"bg-accent":"",this.inverted?"focus-within:focus-outline-inverted":"focus-within:focus-outline")}" role="tab" tabindex="0" aria-selected="${r?"true":"false"}" aria-label="${this.localize.term("goToSlide",e+1,s)}" @click="${()=>this.goToSlide(e*t)}" @keydown="${this.handleKeyDown}"><span class="${g("h-4 w-4 block border hover:border-primary-500 rounded-full",this.inverted?"border-white hover:border-primary-500":"border-primary",r&&"bg-accent border-none",r?this.inverted?"hover:bg-accent-300":"hover:bg-accent-550":"")}"></span></button>`}))}</div>`:i`<span part="pagination-number" class="carousel__pagination number flex gap-0.5 cursor-default select-none" aria-controls="scroll-container"><span part="pagination-item" class="${g("w-5 text-center border-b-2 border-accent",this.inverted?"text-white":"text-black")}">${o+1}</span> <span part="pagination-divider" class="${g("scale-y-[1.5]","text-center",this.inverted?"text-white":"text-black")}">/</span> <span part="pagination-item" class="${g("w-5 text-center",this.inverted?"text-white":"text-black")}">${s}</span></span>`} <button part="navigation-button navigation-button--next" id="carousel__navigation-button--next" ?disabled="${!a}" class="${g("!ml-6 !rounded-sm sd-interactive ",!a&&"sd-interactive--disabled",this.inverted?"sd-interactive--inverted":"sd-interactive--reset")}" aria-label="${this.localize.term("nextSlide")}" aria-controls="scroll-container" aria-disabled="${a?"false":"true"}" @click="${a?()=>{console.log("click-next"),this.next()}:null}"><slot name="next-icon"><sd-3-7-0-icon class="${g("h-6 w-6 rotate-90 grid place-items-center")}" library="system" name="${l?"chevron-up":"chevron-down"}"></sd-3-7-0-icon></slot></button></div><button class="${g("ml-6 !rounded-sm","!absolute !right-0 sd-interactive",this.inverted?"sd-interactive--inverted":"sd-interactive--reset",!this.autoplay&&"!hidden")}" part="autoplay-controls" @click="${()=>this.pausedAutoplay=!this.pausedAutoplay}"><slot name="autoplay-start" class="${g(this.pausedAutoplay?"":"hidden")}"><sd-3-7-0-icon class="h-6 w-6 grid place-items-center" library="system" name="start"></sd-3-7-0-icon></slot><slot name="autoplay-pause" class="${g(this.pausedAutoplay?"hidden":"")}"><sd-3-7-0-icon class="h-6 w-6 grid place-items-center" library="system" name="pause"></sd-3-7-0-icon></slot></button></div></div>`}};w.styles=[t.styles,s(v),u,o`: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);-moz-column-gap:var(--slide-gap);column-gap:var(--slide-gap);scroll-padding-inline:var(--scroll-hint);padding-inline:var(--scroll-hint)}.carousel__slides::-webkit-scrollbar{display:none}@media (prefers-reduced-motion){:where(.carousel__slides){scroll-behavior:auto}}.carousel__navigation{grid-area:navigation}sd-3-7-0-button::part(label){pointer-events:none;display:flex;flex:1 1 auto;align-items:center}`],f([r({type:String,reflect:!0})],w.prototype,"variant",2),f([r({type:Boolean,reflect:!0})],w.prototype,"inverted",2),f([r({type:Boolean,reflect:!0})],w.prototype,"loop",2),f([r({type:Boolean,reflect:!0})],w.prototype,"autoplay",2),f([r({type:Number,attribute:"slides-per-page"})],w.prototype,"slidesPerPage",2),f([r({type:Number,attribute:"slides-per-move"})],w.prototype,"slidesPerMove",2),f([d("slot:not([name])")],w.prototype,"defaultSlot",2),f([d(".carousel__slides")],w.prototype,"scrollContainer",2),f([d(".carousel__pagination")],w.prototype,"paginationContainer",2),f([c()],w.prototype,"activeSlide",2),f([c()],w.prototype,"pausedAutoplay",2),f([h("pausedAutoplay")],w.prototype,"handlePausedAutoplay",1),f([h("loop",{waitUntilFirstUpdate:!0}),h("slidesPerPage",{waitUntilFirstUpdate:!0})],w.prototype,"initializeSlides",1),f([h("activeSlide")],w.prototype,"handelSlideChange",1),f([h("slidesPerMove")],w.prototype,"handleSlidesPerMoveChange",1),f([h("autoplay")],w.prototype,"handleAutoplayChange",1),w=f([a("sd-3-7-0-carousel")],w);export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./icon.js";import{S as t,x as e,i as s,n as o,c as l}from"./solid-element.js";import{H as a}from"./slot.js";import{w as i}from"./watch.js";import{c as r}from"./component.styles.js";import{t as n}from"./classix.js";var c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,d=(t,e,s,o)=>{for(var l,a=o>1?void 0:o?h(e,s):e,i=t.length-1;i>=0;i--)(l=t[i])&&(a=(o?l(e,s,a):l(a))||a);return o&&a&&c(e,s,a),a};let p=class extends t{constructor(){super(...arguments),this.hasSlotController=new a(this,"label"),this.label="",this.size="lg",this.orientation="vertical"}getAllCheckboxes(){return[...this.querySelectorAll("sd-3-
|
|
1
|
+
import"./icon.js";import{S as t,x as e,i as s,n as o,c as l}from"./solid-element.js";import{H as a}from"./slot.js";import{w as i}from"./watch.js";import{c as r}from"./component.styles.js";import{t as n}from"./classix.js";var c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,d=(t,e,s,o)=>{for(var l,a=o>1?void 0:o?h(e,s):e,i=t.length-1;i>=0;i--)(l=t[i])&&(a=(o?l(e,s,a):l(a))||a);return o&&a&&c(e,s,a),a};let p=class extends t{constructor(){super(...arguments),this.hasSlotController=new a(this,"label"),this.label="",this.size="lg",this.orientation="vertical"}getAllCheckboxes(){return[...this.querySelectorAll("sd-3-7-0-checkbox")]}async syncCheckboxElements(){const t=this.getAllCheckboxes();await Promise.all(t.map((async t=>{await t.updateComplete,t.size=this.size}))),t.some((t=>t.checked))||(t[0].tabIndex=0)}syncCheckboxes(){customElements.get("sd-3-7-0-checkbox")?this.syncCheckboxElements():customElements.whenDefined("sd-3-7-0-checkbox").then((()=>this.syncCheckboxes()))}handleSizeChange(){this.syncCheckboxes()}handleInvalid(){this.syncCheckboxes()}render(){const t=this.hasSlotController.test("label"),s=!!this.label||t,o=e`<slot @slotchange="${this.syncCheckboxes}"></slot>`;return e`<fieldset part="form-control" class="${n("border-0 p-0 m-0",{sm:"text-sm",lg:"text-base"}[this.size])}" role="group" aria-labelledby="label"><label part="form-control-label" id="label" class="${n("mb-2 p-0 font-bold leading-normal text-black",s?"flex":"hidden")}" aria-hidden="${s?"false":"true"}"><slot name="label">${this.label}</slot></label><div part="form-control-input" class="${n({vertical:"flex flex-col",horizontal:"flex flex-row"}[this.orientation])}">${o}</div></fieldset>`}};p.styles=[r,t.styles,s`:host{display:block}:host([orientation=vertical]) ::slotted(sd-3-7-0-checkbox){margin-bottom:var(--sd-spacing-2,.5rem);display:flex}:host([orientation=vertical]) ::slotted(sd-3-7-0-checkbox:last-of-type){margin-bottom:var(--sd-spacing-0,0)}:host([orientation=horizontal]) ::slotted(sd-3-7-0-checkbox){margin-right:var(--sd-spacing-6,1.5rem)}:host([orientation=horizontal]) ::slotted(sd-3-7-0-checkbox:last-of-type){margin-right:var(--sd-spacing-0,0)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-3-7-0-checkbox){margin-right:var(--sd-spacing-4,1rem)}:host([orientation=horizontal]):host([size=sm]) ::slotted(sd-3-7-0-checkbox:last-of-type){margin-right:var(--sd-spacing-0,0)}`],d([o()],p.prototype,"label",2),d([o({reflect:!0})],p.prototype,"size",2),d([o({reflect:!0})],p.prototype,"orientation",2),d([i("size",{waitUntilFirstUpdate:!0})],p.prototype,"handleSizeChange",1),d([i("invalid",{waitUntilFirstUpdate:!0})],p.prototype,"handleInvalid",1),p=d([l("sd-3-7-0-checkbox-group")],p);export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./icon.js";import{S as e,x as t,i,n as r,c as s}from"./solid-element.js";import{d as l}from"./default-value.js";import{F as o}from"./form.js";import{o as a}from"./if-defined.js";import{l as n}from"./live.js";import{r as d}from"./state.js";import{e as h}from"./query.js";import{w as c}from"./watch.js";import{t as p}from"./classix.js";var u=Object.defineProperty,m=Object.getOwnPropertyDescriptor,b=(e,t,i,r)=>{for(var s,l=r>1?void 0:r?m(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(l=(r?s(t,i,l):s(l))||l);return r&&l&&u(t,i,l),l};let f=class extends e{constructor(){super(...arguments),this.formControlController=new o(this,{value:e=>e.checked?e.value||"on":void 0,defaultValue:e=>e.defaultChecked,setValue:(e,t)=>e.checked=t}),this.title="",this.name="",this.size="lg",this.disabled=!1,this.checked=!1,this.indeterminate=!1,this.defaultChecked=!1,this.form="",this.required=!1,this.showInvalidStyle=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.formControlController.setValidity(this.disabled)}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.formControlController.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){const e=this.disabled&&this.indeterminate?"disabledIndeterminate":this.disabled&&this.checked?"disabledChecked":this.disabled?"disabled":this.showInvalidStyle&&this.indeterminate?"invalidIndeterminate":this.showInvalidStyle?"invalid":this.checked||this.indeterminate?"filled":"default";return t`<label part="base" class="${p("sd-3-
|
|
1
|
+
import"./icon.js";import{S as e,x as t,i,n as r,c as s}from"./solid-element.js";import{d as l}from"./default-value.js";import{F as o}from"./form.js";import{o as a}from"./if-defined.js";import{l as n}from"./live.js";import{r as d}from"./state.js";import{e as h}from"./query.js";import{w as c}from"./watch.js";import{t as p}from"./classix.js";var u=Object.defineProperty,m=Object.getOwnPropertyDescriptor,b=(e,t,i,r)=>{for(var s,l=r>1?void 0:r?m(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(l=(r?s(t,i,l):s(l))||l);return r&&l&&u(t,i,l),l};let f=class extends e{constructor(){super(...arguments),this.formControlController=new o(this,{value:e=>e.checked?e.value||"on":void 0,defaultValue:e=>e.defaultChecked,setValue:(e,t)=>e.checked=t}),this.title="",this.name="",this.size="lg",this.disabled=!1,this.checked=!1,this.indeterminate=!1,this.defaultChecked=!1,this.form="",this.required=!1,this.showInvalidStyle=!1}get validity(){return this.input.validity}firstUpdated(){this.formControlController.updateValidity()}handleClick(){this.checked=!this.checked,this.indeterminate=!1,this.emit("sd-change")}handleBlur(){this.emit("sd-blur")}handleInput(){this.emit("sd-input")}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e),this.invalidMessage.textContent=e.target.validationMessage}handleFocus(){this.emit("sd-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.formControlController.setValidity(this.disabled)}handleStateChange(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.formControlController.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}checkValidity(){return this.input.checkValidity()}getForm(){return this.formControlController.getForm()}reportValidity(){return this.formControlController.fakeUserInteraction(),this.input.reportValidity()}setCustomValidity(e){this.input.setCustomValidity(e),this.formControlController.updateValidity()}render(){const e=this.disabled&&this.indeterminate?"disabledIndeterminate":this.disabled&&this.checked?"disabledChecked":this.disabled?"disabled":this.showInvalidStyle&&this.indeterminate?"invalidIndeterminate":this.showInvalidStyle?"invalid":this.checked||this.indeterminate?"filled":"default";return t`<label part="base" class="${p("sd-3-7-0-checkbox group flex items-start text-base leading-normal text-black cursor-pointer",this.disabled&&"hover:cursor-not-allowed",{sm:"text-sm",lg:"text-base"}[this.size])}"><input class="peer absolute opacity-0 p-0 m-0 pointer-events-none" type="checkbox" title="${this.title}" name="${this.name}" value="${a(this.value)}" .indeterminate="${n(this.indeterminate)}" .checked="${n(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="${p("relative flex flex-initial items-center justify-center border rounded-sm h-4 w-4\n peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2\n peer-focus-visible:outline-primary",{sm:"mt-[2px]",lg:"mt-[3px]"}[this.size],{disabledIndeterminate:"border-neutral-500 bg-neutral-500",disabledChecked:"border-neutral-500 bg-neutral-500",disabled:"border-neutral-500",invalidIndeterminate:"border-error bg-error group-hover:bg-error-400",invalid:"border-error group-hover:bg-neutral-200",filled:"border-accent hover:border-accent-550 group-hover:border-accent-550 bg-accent group-hover:bg-accent-550",default:"border-neutral-800 hover:bg-neutral-200 group-hover:bg-neutral-200 bg-white"}[e])}">${this.checked?t`<sd-3-7-0-icon part="checked-icon" class="text-white w-3 h-3" library="system" name="status-check"></sd-3-7-0-icon>`:""} ${!this.checked&&this.indeterminate?t`<sd-3-7-0-icon part="indeterminate-icon" class="text-white w-3 h-3" library="system" name="status-minus"></sd-3-7-0-icon>`:""} </span><span part="label" id="label" class="${p("select-none inline-block ml-2",this.disabled?"text-neutral-500":this.showInvalidStyle?"text-error":"text-black")}"><slot></slot></span></label> ${this.formControlController.renderInvalidMessage()}`}};f.styles=[e.styles,i`:host{display:block}:host(:focus-visible){outline-width:0}:host([required]) #label::after{content:' *'}`],b([h('input[type="checkbox"]')],f.prototype,"input",2),b([h("#invalid-message")],f.prototype,"invalidMessage",2),b([r()],f.prototype,"title",2),b([r()],f.prototype,"name",2),b([r()],f.prototype,"value",2),b([r({reflect:!0})],f.prototype,"size",2),b([r({type:Boolean,reflect:!0})],f.prototype,"disabled",2),b([r({type:Boolean,reflect:!0})],f.prototype,"checked",2),b([r({type:Boolean,reflect:!0})],f.prototype,"indeterminate",2),b([l("checked")],f.prototype,"defaultChecked",2),b([r({reflect:!0})],f.prototype,"form",2),b([r({type:Boolean,reflect:!0})],f.prototype,"required",2),b([d()],f.prototype,"showInvalidStyle",2),b([c("disabled",{waitUntilFirstUpdate:!0})],f.prototype,"handleDisabledChange",1),b([c(["checked","indeterminate"],{waitUntilFirstUpdate:!0})],f.prototype,"handleStateChange",1),f=b([s("sd-3-7-0-checkbox")],f);export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./button.js";import"./icon.js";import{a as e,s,w as i}from"./event.js";import{S as h,x as d,r as a,i as o,n,c as t}from"./solid-element.js";import{g as l,s as r}from"./animation-registry.js";import{H as p}from"./slot.js";import{L as c}from"./solid-components2.js";import{l as m,u as g}from"./scroll.js";import{e as f}from"./query.js";import{w as y}from"./watch.js";import{c as v}from"./component.styles.js";import{t as x}from"./classix.js";import{M as u}from"./modal.js";var z=Object.defineProperty,b=Object.getOwnPropertyDescriptor,w=(e,s,i,h)=>{for(var d,a=h>1?void 0:h?b(s,i):s,o=e.length-1;o>=0;o--)(d=e[o])&&(a=(h?d(s,i,a):d(a))||a);return h&&a&&z(s,i,a),a};let k=class extends h{constructor(){super(...arguments),this.hasSlotController=new p(this,"footer"),this.localize=new c(this),this.open=!1,this.headline="",this.noCloseButton=!1}connectedCallback(){super.connectedCallback(),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.modal=new u(this)}firstUpdated(){this.dialog.hidden=!this.open,this.open&&(this.addOpenListeners(),this.modal.activate(),m(this))}disconnectedCallback(){super.disconnectedCallback(),g(this)}requestClose(s){if(this.emit("sd-request-close",{cancelable:!0,detail:{source:s}}).defaultPrevented){const s=l(this,"dialog.denyClose",{dir:this.localize.dir()});e(this.panel,s.keyframes,s.options)}else this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}handleDocumentKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.requestClose("keyboard"))}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.modal.activate(),m(this);const i=this.querySelector("[autofocus]");i&&i.removeAttribute("autofocus"),await Promise.all([s(this.dialog),s(this.overlay)]),this.dialog.hidden=!1,requestAnimationFrame((()=>{this.emit("sd-initial-focus",{cancelable:!0}).defaultPrevented||(i?i.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),i&&i.setAttribute("autofocus","")}));const h=l(this,"dialog.show",{dir:this.localize.dir()}),d=l(this,"dialog.overlay.show",{dir:this.localize.dir()});await Promise.all([e(this.panel,h.keyframes,h.options),e(this.overlay,d.keyframes,d.options)]),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),this.modal.deactivate(),await Promise.all([s(this.dialog),s(this.overlay)]);const i=l(this,"dialog.hide",{dir:this.localize.dir()}),h=l(this,"dialog.overlay.hide",{dir:this.localize.dir()});await Promise.all([e(this.overlay,h.keyframes,h.options).then((()=>{this.overlay.hidden=!0})),e(this.panel,i.keyframes,i.options).then((()=>{this.panel.hidden=!0}))]),this.dialog.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1,g(this);const d=this.originalTrigger;"function"==typeof(null==d?void 0:d.focus)&&setTimeout((()=>d.focus())),this.emit("sd-after-hide")}}async show(){if(!this.open)return this.open=!0,i(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,i(this,"sd-after-hide")}render(){return d`<div part="base" class="${x("flex items-center justify-center fixed inset-0 z-dialog",this.hasSlotController.test("footer")&&"dialog--has-footer")}"><div part="overlay" class="fixed inset-0 bg-primary-800 opacity-90" @click="${()=>this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${x("flex flex-col z-20 bg-white focus:outline-none py-4 sm:py-8 relative gap-6",this.open&&"flex opacity-100")}" role="dialog" aria-modal="true" aria-hidden="${this.open?"false":"true"}" aria-label="${this.headline}" aria-labelledby="title" tabindex="0"><header part="header" class="flex flex-grow-0 flex-shrink-0 basis-auto px-6 sm:px-10"><h2 part="title" class="flex-auto m-0" id="title">${this.headline.length>0?d`<h4 class="sd-headline sd-headline--size-3xl leading-tight">${this.headline}</h4>`:d`<slot name="headline"></slot>`}</h2>${this.noCloseButton?"":d`<sd-3-6-0-button part="close-button" variant="tertiary" exportparts="base:close-button__base" class="${x("absolute top-2 right-2")}" name="x-lg" @click="${()=>this.requestClose("close-button")}" type="button"><sd-3-6-0-icon name="close" library="system" color="currentColor"></sd-3-6-0-icon></sd-3-6-0-button>`}</header><main part="body" class="flex flex-auto overflow-auto w-full px-6 sm:px-10"><slot></slot></main><footer part="footer" class="flex flex-grow-0 flex-shrink-0 basis-auto ml-auto gap-4 px-6 sm:px-10"><slot name="footer"></slot></footer></div></div>`}};k.styles=[v,a(".sd-headline,.sd-prose :is(h1,h2,h3,h4,h5){display:flex;font-weight:700;--tw-text-opacity:1;color:rgb(var(--sd-color-primary,0 53 142)/var(--tw-text-opacity))}.sd-headline sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5) sd-3-6-0-icon{flex-shrink:0;font-size:3rem;--tw-text-opacity:1;color:rgb(var(--sd-color-primary,0 53 142)/var(--tw-text-opacity))}@media (min-width:640px){.sd-headline sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5) sd-3-6-0-icon{margin-top:var(--sd-spacing-2,.5rem)}}.sd-headline.sd-headline,.sd-headline:is(h1):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline,.sd-prose :is(h1,h2,h3,h4,h5):is(h1):not(.sd-headline){font-size:var(--sd-font-size-3xl,2rem);gap:var(--sd-spacing-4,1rem);line-height:var(--sd-line-height-tight,120%)}@media (min-width:640px){.sd-headline.sd-headline,.sd-headline:is(h1):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline,.sd-prose :is(h1,h2,h3,h4,h5):is(h1):not(.sd-headline){font-size:var(--sd-font-size-4xl,2.5rem)}}.sd-headline.sd-headline sd-3-6-0-icon,.sd-headline:is(h1):not(.sd-headline) sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h1):not(.sd-headline) sd-3-6-0-icon{margin-top:calc(var(--sd-spacing-1, .25rem)*-1)}@media (min-width:640px){.sd-headline.sd-headline sd-3-6-0-icon,.sd-headline:is(h1):not(.sd-headline) sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h1):not(.sd-headline) sd-3-6-0-icon{margin-top:var(--sd-spacing-0,0)}}.sd-headline.sd-headline--size-3xl,.sd-headline:is(h2):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-3xl,.sd-prose :is(h1,h2,h3,h4,h5):is(h2):not(.sd-headline){font-size:var(--sd-font-size-2xl,1.75rem);gap:var(--sd-spacing-4,1rem);line-height:var(--sd-line-height-tight,120%)}@media (min-width:640px){.sd-headline.sd-headline--size-3xl,.sd-headline:is(h2):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-3xl,.sd-prose :is(h1,h2,h3,h4,h5):is(h2):not(.sd-headline){font-size:var(--sd-font-size-3xl,2rem)}}.sd-headline.sd-headline--size-3xl sd-3-6-0-icon,.sd-headline:is(h2):not(.sd-headline) sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-3xl sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h2):not(.sd-headline) sd-3-6-0-icon{margin-top:calc(var(--sd-spacing-1, .25rem)*-1)}@media (min-width:640px){.sd-headline.sd-headline--size-3xl sd-3-6-0-icon,.sd-headline:is(h2):not(.sd-headline) sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-3xl sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h2):not(.sd-headline) sd-3-6-0-icon{margin-top:var(--sd-spacing-0,0)}}.sd-headline.sd-headline--size-base,.sd-headline.sd-headline--size-lg,.sd-headline.sd-headline--size-xl,.sd-headline:is(h3,h4,h5):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-base,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-lg,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-xl,.sd-prose :is(h1,h2,h3,h4,h5):is(h3,h4,h5):not(.sd-headline){gap:var(--sd-spacing-2,.5rem);--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity))}.sd-headline.sd-headline--size-base sd-3-6-0-icon,.sd-headline.sd-headline--size-lg sd-3-6-0-icon,.sd-headline.sd-headline--size-xl sd-3-6-0-icon,.sd-headline:is(h3,h4,h5):not(.sd-headline) sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-base sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-lg sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-xl sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h3,h4,h5):not(.sd-headline) sd-3-6-0-icon{font-size:2rem}.sd-headline.sd-headline--size-xl,.sd-headline:is(h3):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-xl,.sd-prose :is(h1,h2,h3,h4,h5):is(h3):not(.sd-headline){font-size:var(--sd-font-size-xl,1.5rem)}.sd-headline.sd-headline--size-xl sd-3-6-0-icon,.sd-headline:is(h3):not(.sd-headline) sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-xl sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h3):not(.sd-headline) sd-3-6-0-icon{margin-top:var(--sd-spacing-0-5,.125rem)}@media (min-width:640px){.sd-headline.sd-headline--size-xl sd-3-6-0-icon,.sd-headline:is(h3):not(.sd-headline) sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-xl sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h3):not(.sd-headline) sd-3-6-0-icon{margin-top:var(--sd-spacing-0-5,.125rem)}}.sd-headline.sd-headline--size-base,.sd-headline.sd-headline--size-lg,.sd-headline:is(h4,h5):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-base,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-lg,.sd-prose :is(h1,h2,h3,h4,h5):is(h4,h5):not(.sd-headline){line-height:var(--sd-line-height-normal,150%)}.sd-headline.sd-headline--size-lg,.sd-headline:is(h4),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-lg,.sd-prose :is(h1,h2,h3,h4,h5):is(h4){font-size:var(--sd-font-size-lg,1.25rem)}.sd-headline.sd-headline--size-lg sd-3-6-0-icon,.sd-headline:is(h4) sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-lg sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h4) sd-3-6-0-icon{margin-top:var(--sd-spacing-0,0)}@media (min-width:640px){.sd-headline.sd-headline--size-lg sd-3-6-0-icon,.sd-headline:is(h4) sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-lg sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h4) sd-3-6-0-icon{margin-top:var(--sd-spacing-0,0)}}.sd-headline.sd-headline--size-base,.sd-headline:is(h5):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-base,.sd-prose :is(h1,h2,h3,h4,h5):is(h5):not(.sd-headline){font-size:var(--sd-font-size-base,1rem)}.sd-headline.sd-headline--size-base sd-3-6-0-icon,.sd-headline:is(h5):not(.sd-headline) sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-base sd-3-6-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h5):not(.sd-headline) sd-3-6-0-icon{margin-top:calc(var(--sd-spacing-1, .25rem)*-1)}.sd-headline.sd-headline--size-base mark,.sd-headline:is(h5):not(.sd-headline) mark,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-base mark,.sd-prose :is(h1,h2,h3,h4,h5):is(h5):not(.sd-headline) mark{color:inherit}.sd-headline--inline{display:inline-block}.sd-headline--inline sd-3-6-0-icon{margin-right:var(--sd-spacing-2,.5rem);margin-top:calc(var(--sd-spacing-1, .25rem)*-1);vertical-align:middle}.sd-headline--inline:is(.sd-headline--size-xl,.sd-headline--size-lg,.sd-headline--size-base) sd-3-6-0-icon{margin-right:var(--sd-spacing-0-5,.125rem)}.sd-headline--inverted:not(#\\\t),.sd-prose--inverted :is(h1,h2,h3,h4,h5):not(.sd-headline):not(#\\\t){--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255)/var(--tw-text-opacity))}.sd-headline--inverted:not(#\\\t) sd-3-6-0-icon,.sd-prose--inverted :is(h1,h2,h3,h4,h5):not(.sd-headline):not(#\\\t) sd-3-6-0-icon{--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255)/var(--tw-text-opacity))}"),h.styles,o`:host{--width:662px}[part=panel]{width:var(--width);max-height:80vh}[part=body]{-webkit-overflow-scrolling:touch}@media (max-width:414px){:host{--width:335px}[part=footer]{width:100%}}`],w([f('[part="base"]')],k.prototype,"dialog",2),w([f('[part="panel"]')],k.prototype,"panel",2),w([f('[part="overlay"]')],k.prototype,"overlay",2),w([n({type:Boolean,reflect:!0})],k.prototype,"open",2),w([n({reflect:!0})],k.prototype,"headline",2),w([n({attribute:"no-close-button",type:Boolean,reflect:!0})],k.prototype,"noCloseButton",2),w([y("open",{waitUntilFirstUpdate:!0})],k.prototype,"handleOpenChange",1),k=w([t("sd-3-6-0-dialog")],k),r("dialog.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}}),r("dialog.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}}),r("dialog.denyClose",{keyframes:[{scale:1},{scale:1.02},{scale:1}],options:{duration:250}}),r("dialog.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}}),r("dialog.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}});export{k as default};
|
|
1
|
+
import"./button.js";import"./icon.js";import{a as e,s,w as i}from"./event.js";import{S as h,x as d,r as a,i as o,n,c as t}from"./solid-element.js";import{g as l,s as r}from"./animation-registry.js";import{H as p}from"./slot.js";import{L as c}from"./solid-components2.js";import{l as m,u as g}from"./scroll.js";import{e as f}from"./query.js";import{w as y}from"./watch.js";import{c as v}from"./component.styles.js";import{t as x}from"./classix.js";import{M as u}from"./modal.js";var z=Object.defineProperty,b=Object.getOwnPropertyDescriptor,w=(e,s,i,h)=>{for(var d,a=h>1?void 0:h?b(s,i):s,o=e.length-1;o>=0;o--)(d=e[o])&&(a=(h?d(s,i,a):d(a))||a);return h&&a&&z(s,i,a),a};let k=class extends h{constructor(){super(...arguments),this.hasSlotController=new p(this,"footer"),this.localize=new c(this),this.open=!1,this.headline="",this.noCloseButton=!1}connectedCallback(){super.connectedCallback(),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.modal=new u(this)}firstUpdated(){this.dialog.hidden=!this.open,this.open&&(this.addOpenListeners(),this.modal.activate(),m(this))}disconnectedCallback(){super.disconnectedCallback(),g(this)}requestClose(s){if(this.emit("sd-request-close",{cancelable:!0,detail:{source:s}}).defaultPrevented){const s=l(this,"dialog.denyClose",{dir:this.localize.dir()});e(this.panel,s.keyframes,s.options)}else this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}handleDocumentKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.requestClose("keyboard"))}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.modal.activate(),m(this);const i=this.querySelector("[autofocus]");i&&i.removeAttribute("autofocus"),await Promise.all([s(this.dialog),s(this.overlay)]),this.dialog.hidden=!1,requestAnimationFrame((()=>{this.emit("sd-initial-focus",{cancelable:!0}).defaultPrevented||(i?i.focus({preventScroll:!0}):this.panel.focus({preventScroll:!0})),i&&i.setAttribute("autofocus","")}));const h=l(this,"dialog.show",{dir:this.localize.dir()}),d=l(this,"dialog.overlay.show",{dir:this.localize.dir()});await Promise.all([e(this.panel,h.keyframes,h.options),e(this.overlay,d.keyframes,d.options)]),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),this.modal.deactivate(),await Promise.all([s(this.dialog),s(this.overlay)]);const i=l(this,"dialog.hide",{dir:this.localize.dir()}),h=l(this,"dialog.overlay.hide",{dir:this.localize.dir()});await Promise.all([e(this.overlay,h.keyframes,h.options).then((()=>{this.overlay.hidden=!0})),e(this.panel,i.keyframes,i.options).then((()=>{this.panel.hidden=!0}))]),this.dialog.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1,g(this);const d=this.originalTrigger;"function"==typeof(null==d?void 0:d.focus)&&setTimeout((()=>d.focus())),this.emit("sd-after-hide")}}async show(){if(!this.open)return this.open=!0,i(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,i(this,"sd-after-hide")}render(){return d`<div part="base" class="${x("flex items-center justify-center fixed inset-0 z-dialog",this.hasSlotController.test("footer")&&"dialog--has-footer")}"><div part="overlay" class="fixed inset-0 bg-primary-800 opacity-90" @click="${()=>this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${x("flex flex-col z-20 bg-white focus:outline-none py-4 sm:py-8 relative gap-6",this.open&&"flex opacity-100")}" role="dialog" aria-modal="true" aria-hidden="${this.open?"false":"true"}" aria-label="${this.headline}" aria-labelledby="title" tabindex="0"><header part="header" class="flex flex-grow-0 flex-shrink-0 basis-auto px-6 sm:px-10"><h2 part="title" class="flex-auto m-0" id="title">${this.headline.length>0?d`<h4 class="sd-headline sd-headline--size-3xl leading-tight">${this.headline}</h4>`:d`<slot name="headline"></slot>`}</h2>${this.noCloseButton?"":d`<sd-3-7-0-button part="close-button" variant="tertiary" exportparts="base:close-button__base" class="${x("absolute top-2 right-2")}" name="x-lg" @click="${()=>this.requestClose("close-button")}" type="button"><sd-3-7-0-icon name="close" library="system" color="currentColor"></sd-3-7-0-icon></sd-3-7-0-button>`}</header><main part="body" class="flex flex-auto overflow-auto w-full px-6 sm:px-10"><slot></slot></main><footer part="footer" class="flex flex-grow-0 flex-shrink-0 basis-auto ml-auto gap-4 px-6 sm:px-10"><slot name="footer"></slot></footer></div></div>`}};k.styles=[v,a(".sd-headline,.sd-prose :is(h1,h2,h3,h4,h5){display:flex;font-weight:700;--tw-text-opacity:1;color:rgb(var(--sd-color-primary,0 53 142)/var(--tw-text-opacity))}.sd-headline sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5) sd-3-7-0-icon{flex-shrink:0;font-size:3rem;--tw-text-opacity:1;color:rgb(var(--sd-color-primary,0 53 142)/var(--tw-text-opacity))}@media (min-width:640px){.sd-headline sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5) sd-3-7-0-icon{margin-top:var(--sd-spacing-2,.5rem)}}.sd-headline.sd-headline,.sd-headline:is(h1):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline,.sd-prose :is(h1,h2,h3,h4,h5):is(h1):not(.sd-headline){font-size:var(--sd-font-size-3xl,2rem);gap:var(--sd-spacing-4,1rem);line-height:var(--sd-line-height-tight,120%)}@media (min-width:640px){.sd-headline.sd-headline,.sd-headline:is(h1):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline,.sd-prose :is(h1,h2,h3,h4,h5):is(h1):not(.sd-headline){font-size:var(--sd-font-size-4xl,2.5rem)}}.sd-headline.sd-headline sd-3-7-0-icon,.sd-headline:is(h1):not(.sd-headline) sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h1):not(.sd-headline) sd-3-7-0-icon{margin-top:calc(var(--sd-spacing-1, .25rem)*-1)}@media (min-width:640px){.sd-headline.sd-headline sd-3-7-0-icon,.sd-headline:is(h1):not(.sd-headline) sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h1):not(.sd-headline) sd-3-7-0-icon{margin-top:var(--sd-spacing-0,0)}}.sd-headline.sd-headline--size-3xl,.sd-headline:is(h2):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-3xl,.sd-prose :is(h1,h2,h3,h4,h5):is(h2):not(.sd-headline){font-size:var(--sd-font-size-2xl,1.75rem);gap:var(--sd-spacing-4,1rem);line-height:var(--sd-line-height-tight,120%)}@media (min-width:640px){.sd-headline.sd-headline--size-3xl,.sd-headline:is(h2):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-3xl,.sd-prose :is(h1,h2,h3,h4,h5):is(h2):not(.sd-headline){font-size:var(--sd-font-size-3xl,2rem)}}.sd-headline.sd-headline--size-3xl sd-3-7-0-icon,.sd-headline:is(h2):not(.sd-headline) sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-3xl sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h2):not(.sd-headline) sd-3-7-0-icon{margin-top:calc(var(--sd-spacing-1, .25rem)*-1)}@media (min-width:640px){.sd-headline.sd-headline--size-3xl sd-3-7-0-icon,.sd-headline:is(h2):not(.sd-headline) sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-3xl sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h2):not(.sd-headline) sd-3-7-0-icon{margin-top:var(--sd-spacing-0,0)}}.sd-headline.sd-headline--size-base,.sd-headline.sd-headline--size-lg,.sd-headline.sd-headline--size-xl,.sd-headline:is(h3,h4,h5):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-base,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-lg,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-xl,.sd-prose :is(h1,h2,h3,h4,h5):is(h3,h4,h5):not(.sd-headline){gap:var(--sd-spacing-2,.5rem);--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity))}.sd-headline.sd-headline--size-base sd-3-7-0-icon,.sd-headline.sd-headline--size-lg sd-3-7-0-icon,.sd-headline.sd-headline--size-xl sd-3-7-0-icon,.sd-headline:is(h3,h4,h5):not(.sd-headline) sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-base sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-lg sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-xl sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h3,h4,h5):not(.sd-headline) sd-3-7-0-icon{font-size:2rem}.sd-headline.sd-headline--size-xl,.sd-headline:is(h3):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-xl,.sd-prose :is(h1,h2,h3,h4,h5):is(h3):not(.sd-headline){font-size:var(--sd-font-size-xl,1.5rem)}.sd-headline.sd-headline--size-xl sd-3-7-0-icon,.sd-headline:is(h3):not(.sd-headline) sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-xl sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h3):not(.sd-headline) sd-3-7-0-icon{margin-top:var(--sd-spacing-0-5,.125rem)}@media (min-width:640px){.sd-headline.sd-headline--size-xl sd-3-7-0-icon,.sd-headline:is(h3):not(.sd-headline) sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-xl sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h3):not(.sd-headline) sd-3-7-0-icon{margin-top:var(--sd-spacing-0-5,.125rem)}}.sd-headline.sd-headline--size-base,.sd-headline.sd-headline--size-lg,.sd-headline:is(h4,h5):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-base,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-lg,.sd-prose :is(h1,h2,h3,h4,h5):is(h4,h5):not(.sd-headline){line-height:var(--sd-line-height-normal,150%)}.sd-headline.sd-headline--size-lg,.sd-headline:is(h4),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-lg,.sd-prose :is(h1,h2,h3,h4,h5):is(h4){font-size:var(--sd-font-size-lg,1.25rem)}.sd-headline.sd-headline--size-lg sd-3-7-0-icon,.sd-headline:is(h4) sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-lg sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h4) sd-3-7-0-icon{margin-top:var(--sd-spacing-0,0)}@media (min-width:640px){.sd-headline.sd-headline--size-lg sd-3-7-0-icon,.sd-headline:is(h4) sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-lg sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h4) sd-3-7-0-icon{margin-top:var(--sd-spacing-0,0)}}.sd-headline.sd-headline--size-base,.sd-headline:is(h5):not(.sd-headline),.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-base,.sd-prose :is(h1,h2,h3,h4,h5):is(h5):not(.sd-headline){font-size:var(--sd-font-size-base,1rem)}.sd-headline.sd-headline--size-base sd-3-7-0-icon,.sd-headline:is(h5):not(.sd-headline) sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-base sd-3-7-0-icon,.sd-prose :is(h1,h2,h3,h4,h5):is(h5):not(.sd-headline) sd-3-7-0-icon{margin-top:calc(var(--sd-spacing-1, .25rem)*-1)}.sd-headline.sd-headline--size-base mark,.sd-headline:is(h5):not(.sd-headline) mark,.sd-prose :is(h1,h2,h3,h4,h5).sd-headline--size-base mark,.sd-prose :is(h1,h2,h3,h4,h5):is(h5):not(.sd-headline) mark{color:inherit}.sd-headline--inline{display:inline-block}.sd-headline--inline sd-3-7-0-icon{margin-right:var(--sd-spacing-2,.5rem);margin-top:calc(var(--sd-spacing-1, .25rem)*-1);vertical-align:middle}.sd-headline--inline:is(.sd-headline--size-xl,.sd-headline--size-lg,.sd-headline--size-base) sd-3-7-0-icon{margin-right:var(--sd-spacing-0-5,.125rem)}.sd-headline--inverted:not(#\\\t),.sd-prose--inverted :is(h1,h2,h3,h4,h5):not(.sd-headline):not(#\\\t){--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255)/var(--tw-text-opacity))}.sd-headline--inverted:not(#\\\t) sd-3-7-0-icon,.sd-prose--inverted :is(h1,h2,h3,h4,h5):not(.sd-headline):not(#\\\t) sd-3-7-0-icon{--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255)/var(--tw-text-opacity))}"),h.styles,o`:host{--width:662px}[part=panel]{width:var(--width);max-height:80vh}[part=body]{-webkit-overflow-scrolling:touch}@media (max-width:414px){:host{--width:335px}[part=footer]{width:100%}}`],w([f('[part="base"]')],k.prototype,"dialog",2),w([f('[part="panel"]')],k.prototype,"panel",2),w([f('[part="overlay"]')],k.prototype,"overlay",2),w([n({type:Boolean,reflect:!0})],k.prototype,"open",2),w([n({reflect:!0})],k.prototype,"headline",2),w([n({attribute:"no-close-button",type:Boolean,reflect:!0})],k.prototype,"noCloseButton",2),w([y("open",{waitUntilFirstUpdate:!0})],k.prototype,"handleOpenChange",1),k=w([t("sd-3-7-0-dialog")],k),r("dialog.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:250,easing:"ease"}}),r("dialog.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:250,easing:"ease"}}),r("dialog.denyClose",{keyframes:[{scale:1},{scale:1.02},{scale:1}],options:{duration:250}}),r("dialog.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}}),r("dialog.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}});export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as t,x as e,i as r,n as o,c as i}from"./solid-element.js";import{c as s}from"./component.styles.js";import{t as a}from"./classix.js";var n=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=(t,e,r,o)=>{for(var i,s=o>1?void 0:o?l(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o?i(e,r,s):i(s))||s);return o&&s&&n(e,r,s),s};let c=class extends t{constructor(){super(...arguments),this.orientation="horizontal",this.inverted=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}render(){return e`<hr part="main" class="${a(this.inverted?"border-primary-400":"border-neutral-400","horizontal"===this.orientation?"border-t w-full":" border-l h-full")}">`}};c.styles=[s,t.styles,r`:host{margin:var(--sd-spacing-0,0)}:host(sd-3-
|
|
1
|
+
import{S as t,x as e,i as r,n as o,c as i}from"./solid-element.js";import{c as s}from"./component.styles.js";import{t as a}from"./classix.js";var n=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=(t,e,r,o)=>{for(var i,s=o>1?void 0:o?l(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o?i(e,r,s):i(s))||s);return o&&s&&n(e,r,s),s};let c=class extends t{constructor(){super(...arguments),this.orientation="horizontal",this.inverted=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}render(){return e`<hr part="main" class="${a(this.inverted?"border-primary-400":"border-neutral-400","horizontal"===this.orientation?"border-t w-full":" border-l h-full")}">`}};c.styles=[s,t.styles,r`:host{margin:var(--sd-spacing-0,0)}:host(sd-3-7-0-divider[orientation=horizontal]){display:block}:host(sd-3-7-0-divider[orientation=vertical]){display:inline-block}`],d([o({reflect:!0})],c.prototype,"orientation",2),d([o({type:Boolean,reflect:!0})],c.prototype,"inverted",2),c=d([i("sd-3-7-0-divider")],c);export{c as default};
|