@solid-design-system/components 1.14.2 → 1.14.4

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.
Files changed (88) hide show
  1. package/dist/components/es/accordion-group.js +1 -1
  2. package/dist/components/es/accordion.js +1 -1
  3. package/dist/components/es/badge.js +1 -1
  4. package/dist/components/es/brandshape.js +1 -1
  5. package/dist/components/es/button.js +1 -1
  6. package/dist/components/es/divider.js +1 -1
  7. package/dist/components/es/drawer.js +1 -1
  8. package/dist/components/es/dropdown.js +1 -1
  9. package/dist/components/es/icon.js +2 -2
  10. package/dist/components/es/include.js +1 -1
  11. package/dist/components/es/link.js +1 -1
  12. package/dist/components/es/popup.js +1 -1
  13. package/dist/components/es/solid-element.js +3 -8
  14. package/dist/components/es/spinner.js +1 -1
  15. package/dist/components/es/tag.js +1 -1
  16. package/dist/components/es/teaser.js +1 -1
  17. package/dist/components/umd/solid-components.js +2 -8
  18. package/dist/custom-elements.json +1 -1
  19. package/dist/package/components/accordion/accordion.js +2 -1
  20. package/dist/package/components/accordion-group/accordion-group.js +2 -1
  21. package/dist/package/components/badge/badge.js +2 -1
  22. package/dist/package/components/brandshape/brandshape.js +2 -1
  23. package/dist/package/components/button/button.js +2 -1
  24. package/dist/package/components/divider/divider.js +2 -1
  25. package/dist/package/components/drawer/drawer.js +2 -1
  26. package/dist/package/components/dropdown/dropdown.js +2 -1
  27. package/dist/package/components/icon/icon.js +2 -1
  28. package/dist/package/components/include/include.js +2 -1
  29. package/dist/package/components/link/link.js +2 -1
  30. package/dist/package/components/popup/popup.js +2 -1
  31. package/dist/package/components/spinner/spinner.js +2 -1
  32. package/dist/package/components/tag/tag.js +2 -1
  33. package/dist/package/components/teaser/teaser.js +2 -1
  34. package/dist/package/internal/register-custom-element.d.ts +19 -0
  35. package/dist/package/internal/register-custom-element.js +30 -0
  36. package/dist/styles/solid-styles.css +1 -0
  37. package/dist/versioned-components/es/accordion-group.js +1 -1
  38. package/dist/versioned-components/es/accordion.js +1 -1
  39. package/dist/versioned-components/es/badge.js +1 -1
  40. package/dist/versioned-components/es/brandshape.js +1 -1
  41. package/dist/versioned-components/es/button.js +1 -1
  42. package/dist/versioned-components/es/divider.js +1 -1
  43. package/dist/versioned-components/es/drawer.js +1 -1
  44. package/dist/versioned-components/es/dropdown.js +1 -1
  45. package/dist/versioned-components/es/icon.js +2 -2
  46. package/dist/versioned-components/es/include.js +1 -1
  47. package/dist/versioned-components/es/link.js +1 -1
  48. package/dist/versioned-components/es/popup.js +1 -1
  49. package/dist/versioned-components/es/solid-element.js +3 -8
  50. package/dist/versioned-components/es/spinner.js +1 -1
  51. package/dist/versioned-components/es/tag.js +1 -1
  52. package/dist/versioned-components/es/teaser.js +1 -1
  53. package/dist/versioned-package/components/accordion/accordion.d.ts +1 -1
  54. package/dist/versioned-package/components/accordion/accordion.js +4 -3
  55. package/dist/versioned-package/components/accordion-group/accordion-group.d.ts +1 -1
  56. package/dist/versioned-package/components/accordion-group/accordion-group.js +5 -4
  57. package/dist/versioned-package/components/badge/badge.d.ts +1 -1
  58. package/dist/versioned-package/components/badge/badge.js +3 -2
  59. package/dist/versioned-package/components/brandshape/brandshape.d.ts +1 -1
  60. package/dist/versioned-package/components/brandshape/brandshape.js +3 -2
  61. package/dist/versioned-package/components/button/button.d.ts +1 -1
  62. package/dist/versioned-package/components/button/button.js +6 -5
  63. package/dist/versioned-package/components/divider/divider.d.ts +1 -1
  64. package/dist/versioned-package/components/divider/divider.js +4 -3
  65. package/dist/versioned-package/components/drawer/drawer.d.ts +1 -1
  66. package/dist/versioned-package/components/drawer/drawer.js +4 -3
  67. package/dist/versioned-package/components/dropdown/dropdown.d.ts +1 -1
  68. package/dist/versioned-package/components/dropdown/dropdown.js +8 -7
  69. package/dist/versioned-package/components/icon/icon.d.ts +1 -1
  70. package/dist/versioned-package/components/icon/icon.js +3 -2
  71. package/dist/versioned-package/components/include/include.d.ts +1 -1
  72. package/dist/versioned-package/components/include/include.js +3 -2
  73. package/dist/versioned-package/components/link/link.d.ts +1 -1
  74. package/dist/versioned-package/components/link/link.js +4 -3
  75. package/dist/versioned-package/components/popup/popup.d.ts +1 -1
  76. package/dist/versioned-package/components/popup/popup.js +3 -2
  77. package/dist/versioned-package/components/spinner/spinner.d.ts +1 -1
  78. package/dist/versioned-package/components/spinner/spinner.js +3 -2
  79. package/dist/versioned-package/components/tag/tag.d.ts +1 -1
  80. package/dist/versioned-package/components/tag/tag.js +4 -3
  81. package/dist/versioned-package/components/teaser/teaser.js +3 -2
  82. package/dist/versioned-package/internal/form.js +1 -1
  83. package/dist/versioned-package/internal/register-custom-element.d.ts +19 -0
  84. package/dist/versioned-package/internal/register-custom-element.js +30 -0
  85. package/dist/versioned-styles/solid-styles.css +1 -0
  86. package/dist/vscode.html-custom-data.json +15 -15
  87. package/dist/web-types.json +16 -16
  88. package/package.json +12 -12
@@ -1,9 +1,10 @@
1
1
  import "../icon/icon.js";
2
2
  import { stopAnimations, animateTo, shimKeyframesHeightAuto } from "../../internal/animate.js";
3
3
  import { css, html } from "lit";
4
- import { query, property, customElement } from "lit/decorators.js";
4
+ import { customElement } from "../../internal/register-custom-element.js";
5
5
  import { setDefaultAnimation, getAnimation } from "../../utilities/animation-registry.js";
6
6
  import { LocalizeController } from "../../utilities/localize.js";
7
+ import { query, property } from "lit/decorators.js";
7
8
  import { waitForEvent } from "../../internal/event.js";
8
9
  import { watch } from "../../internal/watch.js";
9
10
  import cx from "classix";
@@ -1,6 +1,7 @@
1
1
  import "../accordion/accordion.js";
2
2
  import { css, html } from "lit";
3
- import { queryAssignedElements, property, customElement } from "lit/decorators.js";
3
+ import { customElement } from "../../internal/register-custom-element.js";
4
+ import { queryAssignedElements, property } from "lit/decorators.js";
4
5
  import componentStyles from "../../styles/component.styles.js";
5
6
  import SolidElement from "../../internal/solid-element.js";
6
7
  var __defProp = Object.defineProperty;
@@ -1,5 +1,6 @@
1
1
  import { css, html } from "lit";
2
- import { property, customElement } from "lit/decorators.js";
2
+ import { customElement } from "../../internal/register-custom-element.js";
3
+ import { property } from "lit/decorators.js";
3
4
  import cx from "classix";
4
5
  import SolidElement from "../../internal/solid-element.js";
5
6
  var __defProp = Object.defineProperty;
@@ -1,5 +1,6 @@
1
1
  import { css, html } from "lit";
2
- import { query, property, state, customElement } from "lit/decorators.js";
2
+ import { customElement } from "../../internal/register-custom-element.js";
3
+ import { query, property, state } from "lit/decorators.js";
3
4
  import componentStyles from "../../styles/component.styles.js";
4
5
  import cx from "classix";
5
6
  import SolidElement from "../../internal/solid-element.js";
@@ -1,10 +1,11 @@
1
1
  import "../spinner/spinner.js";
2
2
  import { css } from "lit";
3
- import { query, queryAssignedElements, state, property, customElement } from "lit/decorators.js";
3
+ import { customElement } from "../../internal/register-custom-element.js";
4
4
  import { FormControlController } from "../../internal/form.js";
5
5
  import { HasSlotController } from "../../internal/slot.js";
6
6
  import { literal, html } from "lit/static-html.js";
7
7
  import { ifDefined } from "lit/directives/if-defined.js";
8
+ import { query, queryAssignedElements, state, property } from "lit/decorators.js";
8
9
  import { watch } from "../../internal/watch.js";
9
10
  import componentStyles from "../../styles/component.styles.js";
10
11
  import cx from "classix";
@@ -1,5 +1,6 @@
1
1
  import { css, html } from "lit";
2
- import { property, customElement } from "lit/decorators.js";
2
+ import { customElement } from "../../internal/register-custom-element.js";
3
+ import { property } from "lit/decorators.js";
3
4
  import componentStyles from "../../styles/component.styles.js";
4
5
  import cx from "classix";
5
6
  import SolidElement from "../../internal/solid-element.js";
@@ -2,12 +2,13 @@ import "../button/button.js";
2
2
  import "../icon/icon.js";
3
3
  import { animateTo, stopAnimations } from "../../internal/animate.js";
4
4
  import { css, html } from "lit";
5
- import { query, property, customElement } from "lit/decorators.js";
5
+ import { customElement } from "../../internal/register-custom-element.js";
6
6
  import { setDefaultAnimation, getAnimation } from "../../utilities/animation-registry.js";
7
7
  import { HasSlotController } from "../../internal/slot.js";
8
8
  import { ifDefined } from "lit/directives/if-defined.js";
9
9
  import { LocalizeController } from "../../utilities/localize.js";
10
10
  import { lockBodyScrolling, unlockBodyScrolling } from "../../internal/scroll.js";
11
+ import { query, property } from "lit/decorators.js";
11
12
  import { uppercaseFirstLetter } from "../../internal/string.js";
12
13
  import { waitForEvent } from "../../internal/event.js";
13
14
  import { watch } from "../../internal/watch.js";
@@ -1,10 +1,11 @@
1
1
  import "../popup/popup.js";
2
2
  import { stopAnimations, animateTo } from "../../internal/animate.js";
3
3
  import { css, html } from "lit";
4
- import { query, property, customElement } from "lit/decorators.js";
4
+ import { customElement } from "../../internal/register-custom-element.js";
5
5
  import { setDefaultAnimation, getAnimation } from "../../utilities/animation-registry.js";
6
6
  import { getTabbableBoundary } from "../../internal/tabbable.js";
7
7
  import { LocalizeController } from "../../utilities/localize.js";
8
+ import { query, property } from "lit/decorators.js";
8
9
  import { scrollIntoView } from "../../internal/scroll.js";
9
10
  import { waitForEvent } from "../../internal/event.js";
10
11
  import { watch } from "../../internal/watch.js";
@@ -1,6 +1,7 @@
1
1
  import { css, html } from "lit";
2
- import { state, property, customElement } from "lit/decorators.js";
2
+ import { customElement } from "../../internal/register-custom-element.js";
3
3
  import { watchIcon, unwatchIcon, getIconLibrary } from "./library.js";
4
+ import { state, property } from "lit/decorators.js";
4
5
  import { requestIcon } from "./request.js";
5
6
  import { unsafeSVG } from "lit/directives/unsafe-svg.js";
6
7
  import { watch } from "../../internal/watch.js";
@@ -1,5 +1,6 @@
1
- import { property, customElement } from "lit/decorators.js";
1
+ import { customElement } from "../../internal/register-custom-element.js";
2
2
  import { html } from "lit";
3
+ import { property } from "lit/decorators.js";
3
4
  import { requestInclude } from "./request.js";
4
5
  import { watch } from "../../internal/watch.js";
5
6
  import SolidElement from "../../internal/solid-element.js";
@@ -1,7 +1,8 @@
1
1
  import { css, html } from "lit";
2
- import { query, property, customElement } from "lit/decorators.js";
2
+ import { customElement } from "../../internal/register-custom-element.js";
3
3
  import { HasSlotController } from "../../internal/slot.js";
4
4
  import { ifDefined } from "lit/directives/if-defined.js";
5
+ import { query, property } from "lit/decorators.js";
5
6
  import cx from "classix";
6
7
  import SolidElement from "../../internal/solid-element.js";
7
8
  var __defProp = Object.defineProperty;
@@ -1,6 +1,7 @@
1
1
  import { autoUpdate, offset, size, flip, shift, arrow, computePosition } from "@floating-ui/dom";
2
2
  import { css, html } from "lit";
3
- import { query, property, customElement } from "lit/decorators.js";
3
+ import { customElement } from "../../internal/register-custom-element.js";
4
+ import { query, property } from "lit/decorators.js";
4
5
  import componentStyles from "../../styles/component.styles.js";
5
6
  import cx from "classix";
6
7
  import SolidElement from "../../internal/solid-element.js";
@@ -1,6 +1,7 @@
1
1
  import { css, html } from "lit";
2
- import { property, customElement } from "lit/decorators.js";
2
+ import { customElement } from "../../internal/register-custom-element.js";
3
3
  import { LocalizeController } from "../../utilities/localize.js";
4
+ import { property } from "lit/decorators.js";
4
5
  import cx from "classix";
5
6
  import SolidElement from "../../internal/solid-element.js";
6
7
  var __defProp = Object.defineProperty;
@@ -1,7 +1,8 @@
1
1
  import { css } from "lit";
2
- import { query, property, customElement } from "lit/decorators.js";
2
+ import { customElement } from "../../internal/register-custom-element.js";
3
3
  import { literal, html } from "lit/static-html.js";
4
4
  import { ifDefined } from "lit/directives/if-defined.js";
5
+ import { query, property } from "lit/decorators.js";
5
6
  import cx from "classix";
6
7
  import SolidElement from "../../internal/solid-element.js";
7
8
  var __defProp = Object.defineProperty;
@@ -1,6 +1,7 @@
1
1
  import { css, html } from "lit";
2
- import { property, query, state, customElement } from "lit/decorators.js";
2
+ import { customElement } from "../../internal/register-custom-element.js";
3
3
  import { HasSlotController } from "../../internal/slot.js";
4
+ import { property, query, state } from "lit/decorators.js";
4
5
  import cx from "classix";
5
6
  import SolidElement from "../../internal/solid-element.js";
6
7
  var __defProp = Object.defineProperty;
@@ -0,0 +1,19 @@
1
+ interface Constructor<T> {
2
+ new (...args: any[]): T;
3
+ }
4
+ interface ClassDescriptor {
5
+ kind: 'class';
6
+ elements: ClassElement[];
7
+ finisher?: <T>(clazz: Constructor<T>) => undefined | Constructor<T>;
8
+ }
9
+ interface ClassElement {
10
+ kind: 'field' | 'method';
11
+ key: PropertyKey;
12
+ placement: 'static' | 'prototype' | 'own';
13
+ initializer?: Function;
14
+ extras?: ClassElement[];
15
+ finisher?: <T>(clazz: Constructor<T>) => undefined | Constructor<T>;
16
+ descriptor?: PropertyDescriptor;
17
+ }
18
+ export declare const customElement: (tagName: string) => (classOrDescriptor: Constructor<HTMLElement> | ClassDescriptor) => any;
19
+ export {};
@@ -0,0 +1,30 @@
1
+ const legacyCustomElement = (tagName, clazz) => {
2
+ if (window.customElements.get(tagName)) {
3
+ console.warn(`Custom element ${tagName} already defined. Registration skipped.`);
4
+ return clazz;
5
+ }
6
+ window.customElements.define(tagName, clazz);
7
+ return clazz;
8
+ };
9
+ const standardCustomElement = (tagName, descriptor) => {
10
+ const { kind, elements } = descriptor;
11
+ return {
12
+ kind,
13
+ elements,
14
+ // This callback is called once the class is otherwise fully defined
15
+ finisher(clazz) {
16
+ if (window.customElements.get(tagName)) {
17
+ console.warn(`Custom element ${tagName} already defined. Registration skipped.`);
18
+ return;
19
+ }
20
+ window.customElements.define(tagName, clazz);
21
+ }
22
+ };
23
+ };
24
+ const customElement = (tagName) => (classOrDescriptor) => (
25
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
26
+ typeof classOrDescriptor === "function" ? legacyCustomElement(tagName, classOrDescriptor) : standardCustomElement(tagName, classOrDescriptor)
27
+ );
28
+ export {
29
+ customElement
30
+ };
@@ -0,0 +1 @@
1
+ .sd-display{font-size:var(--sd-font-size-xl,1.5rem)}.sd-display,.sd-display--size-3xl{--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity));font-weight:400;line-height:var(--sd-line-height-tight,120%)}.sd-display--size-3xl{font-size:var(--sd-font-size-2xl,1.75rem)}@media (min-width:1024px){.sd-display--size-3xl{font-size:var(--sd-font-size-3xl,2rem)}}.sd-display--size-4xl{--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity));font-size:var(--sd-font-size-3xl,2rem);font-weight:400;line-height:var(--sd-line-height-tight,120%)}@media (min-width:1024px){.sd-display--size-4xl{font-size:var(--sd-font-size-4xl,2.5rem)}}.sd-display--inverted{--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255)/var(--tw-text-opacity))}.sd-meta{--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity));font-size:var(--sd-font-size-base,1rem);font-weight:400;line-height:var(--sd-line-height-none,100%)}.sd-meta--size-sm{font-size:var(--sd-font-size-sm,.875rem)}.sd-meta--light{--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-700,104 104 104)/var(--tw-text-opacity))}.sd-meta--inverted{--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255)/var(--tw-text-opacity))}.sd-meta--inverted.sd-meta--light{--tw-text-opacity:1;color:rgb(var(--sd-color-primary-400,153 171 208)/var(--tw-text-opacity))}.sd-meta--pipe:after{content:"|";margin-left:var(--sd-spacing-1,.25rem);margin-right:var(--sd-spacing-1,.25rem)}.sd-meta--pipe.sd-meta--size-sm:after{margin-left:var(--sd-spacing-0-5,.125rem);margin-right:var(--sd-spacing-0-5,.125rem)}.sd-leadtext{font-size:var(--sd-font-size-xl,1.5rem)}.sd-leadtext,.sd-leadtext--size-lg{--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity));font-weight:400;line-height:var(--sd-line-height-normal,150%)}.sd-leadtext--size-lg{font-size:var(--sd-font-size-lg,1.25rem)}.sd-leadtext--inverted{--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255)/var(--tw-text-opacity))}.sd-paragraph{font-size:var(--sd-font-size-base,1rem)}.sd-paragraph,.sd-paragraph--size-sm{--tw-text-opacity:1;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity));font-weight:400;line-height:var(--sd-line-height-normal,150%)}.sd-paragraph--size-sm{font-size:var(--sd-font-size-sm,.875rem)}.sd-paragraph--inverted{--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255)/var(--tw-text-opacity))}mark.sd-mark{--tw-text-opacity:1;background-color:transparent;color:rgb(var(--sd-color-accent,45 157 0)/var(--tw-text-opacity))}.sd-interactive--reset{all:unset;outline:revert}.sd-interactive{--tw-text-opacity:1;color:rgb(var(--sd-color-primary,0 53 142)/var(--tw-text-opacity));cursor:pointer;text-decoration-line:none;transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.sd-interactive:hover:not([disabled]){--tw-text-opacity:1;color:rgb(var(--sd-color-primary-500,70 109 175)/var(--tw-text-opacity))}.sd-interactive:active:not([disabled]){--tw-text-opacity:1;color:rgb(var(--sd-color-primary-800,5 21 48)/var(--tw-text-opacity))}.sd-interactive:focus-visible{outline-color:rgb(var(--sd-color-primary,0 53 142)/1);outline-offset:2px;outline-style:solid;outline-width:2px}.sd-interactive--inverted{--tw-text-opacity:1;color:rgb(var(--sd-color-white,255 255 255)/var(--tw-text-opacity))}.sd-interactive--inverted:hover:not([disabled]){--tw-text-opacity:1;color:rgb(var(--sd-color-primary-200,224 233 243)/var(--tw-text-opacity))}.sd-interactive--inverted:active:not([disabled]){--tw-text-opacity:1;color:rgb(var(--sd-color-primary-400,153 171 208)/var(--tw-text-opacity))}.sd-interactive--inverted:focus-visible{outline-color:rgb(var(--sd-color-white,255 255 255)/1);outline-offset:2px;outline-style:solid;outline-width:2px}.sd-interactive--disabled,.sd-interactive[disabled]{cursor:not-allowed}.sd-interactive--disabled,.sd-interactive--disabled:active:not([disabled]),.sd-interactive--disabled:hover:not([disabled]),.sd-interactive[disabled],.sd-interactive[disabled]:active:not([disabled]),.sd-interactive[disabled]:hover:not([disabled]){--tw-text-opacity:1;color:rgb(var(--sd-color-neutral-600,136 136 136)/var(--tw-text-opacity))}.sd-table-cell{--tw-border-opacity:1;--tw-text-opacity:1;background-color:transparent;border-color:rgb(var(--sd-color-neutral-400,195 195 195)/var(--tw-border-opacity));border-style:solid;border-width:1px 0;color:rgb(var(--sd-color-black,24 24 24)/var(--tw-text-opacity));font-size:var(--sd-font-size-sm,.875rem);padding:var(--sd-spacing-4,1rem);text-align:left}.sd-table-cell--divider{border-right-width:1px}.sd-table-cell--bg-white{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-white,255 255 255)/var(--tw-bg-opacity))}.sd-table-cell--bg-primary-100{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-primary-100,236 240 249)/var(--tw-bg-opacity))}.sd-table-cell--bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(var(--sd-color-neutral-100,246 246 246)/var(--tw-bg-opacity))}.sd-table{--tw-border-spacing-x:var(--sd-spacing-0,0px);--tw-border-spacing-y:var(--sd-spacing-0,0px);all:unset;border-collapse:collapse;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);display:table}
@@ -1 +1 @@
1
- import"./accordion.js";import{x as t,i as e}from"./lit-element.js";import{S as o,l as s,n as r,e as i}from"./solid-element.js";import{c}from"./component.styles.js";import"./icon.js";import"./state.js";import"./solid-components2.js";import"./request.js";import"./request2.js";import"./watch.js";import"./event.js";import"./query.js";import"./classix.js";var n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=(t,e,o,s)=>{for(var r,i=s>1?void 0:s?a(e,o):e,c=t.length-1;c>=0;c--)(r=t[c])&&(i=(s?r(e,o,i):r(i))||i);return s&&i&&n(e,o,i),i};let d=class extends o{constructor(){super(...arguments),this.closeOthers=!1,this.handleAccordionShow=t=>{this.closeOthers&&this._accordionsInDefaultSlot.forEach((e=>{e!==t.target&&e.parentNode===t.target.parentNode&&e.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>`}};d.styles=[c,o.styles,e`:host{display:block}::slotted(sd-1-14-2-accordion:not(:first-of-type)){margin-top:-1px}`],l([s({selector:"sd-1-14-2-accordion"})],d.prototype,"_accordionsInDefaultSlot",2),l([r({attribute:"close-others",type:Boolean})],d.prototype,"closeOthers",2),d=l([i("sd-1-14-2-accordion-group")],d);export{d as default};
1
+ import"./accordion.js";import{x as t,i as e}from"./lit-element.js";import{S as o,l as s,n as r,c}from"./solid-element.js";import{c as i}from"./component.styles.js";import"./icon.js";import"./solid-components2.js";import"./state.js";import"./request.js";import"./request2.js";import"./watch.js";import"./event.js";import"./query.js";import"./classix.js";var n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=(t,e,o,s)=>{for(var r,c=s>1?void 0:s?a(e,o):e,i=t.length-1;i>=0;i--)(r=t[i])&&(c=(s?r(e,o,c):r(c))||c);return s&&c&&n(e,o,c),c};let d=class extends o{constructor(){super(...arguments),this.closeOthers=!1,this.handleAccordionShow=t=>{this.closeOthers&&this._accordionsInDefaultSlot.forEach((e=>{e!==t.target&&e.parentNode===t.target.parentNode&&e.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>`}};d.styles=[i,o.styles,e`:host{display:block}::slotted(sd-1-14-4-accordion:not(:first-of-type)){margin-top:-1px}`],l([s({selector:"sd-1-14-4-accordion"})],d.prototype,"_accordionsInDefaultSlot",2),l([r({attribute:"close-others",type:Boolean})],d.prototype,"closeOthers",2),d=l([c("sd-1-14-4-accordion-group")],d);export{d as default};
@@ -1 +1 @@
1
- import"./icon.js";import{s as e,g as t,a as s,b as o,w as i,c as a}from"./event.js";import{x as r,i as n}from"./lit-element.js";import{S as h,n as d,e as l}from"./solid-element.js";import{i as p}from"./query.js";import{L as c}from"./solid-components2.js";import{w as y}from"./watch.js";import{t as m}from"./classix.js";import"./state.js";import"./request.js";import"./request2.js";import"./component.styles.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 h{constructor(){super(...arguments),this.localize=new c(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:i,options:a}=t(this,"accordion.show",{dir:this.localize.dir()});await s(this.body,o(i,this.body.scrollHeight),a),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:i,options:a}=t(this,"accordion.hide",{dir:this.localize.dir()});await s(this.body,o(i,this.body.scrollHeight),a),this.body.hidden=!0,this.body.style.height="auto",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 r`<div part="base" class="outline outline-1 outline-neutral-400 -outline-offset-1"><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",this.open?"bg-white text-accent hover:bg-neutral-200":"text-primary bg-neutral-100 hover:bg-neutral-200")}" role="button" aria-expanded="${this.open?"true":"false"}" aria-controls="content" tabindex="0" @click="${this.handleSummaryClick}" @keydown="${this.handleSummaryKeyDown}"><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-1-14-2-icon library="system" name="chevron-down"></sd-1-14-2-icon></slot><slot name="collapse-icon" class="${m(!this.open&&"hidden")}"><sd-1-14-2-icon library="system" name="chevron-down"></sd-1-14-2-icon></slot></span></header><div part="content" id="content" class="overflow-hidden"><slot class="block px-4 py-6" role="region" aria-labelledby="header"></slot></div></div>`}};w.styles=[h.styles,n`:host{display:block}`],b([p('[part="base"]')],w.prototype,"accordion",2),b([p('[part="header"]')],w.prototype,"header",2),b([p('[part="content"]')],w.prototype,"body",2),b([d({type:Boolean,reflect:!0})],w.prototype,"open",2),b([d()],w.prototype,"summary",2),b([y("open",{waitUntilFirstUpdate:!0})],w.prototype,"handleOpenChange",1),w=b([l("sd-1-14-2-accordion")],w),a("accordion.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:300,easing:"ease"}}),a("accordion.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:300,easing:"ease"}});export{w as default};
1
+ import"./icon.js";import{s as e,g as t,a as s,b as o,w as i,c as a}from"./event.js";import{x as r,i as n}from"./lit-element.js";import{S as h,n as d,c as l}from"./solid-element.js";import{L as p}from"./solid-components2.js";import{i as c}from"./query.js";import{w as y}from"./watch.js";import{t as m}from"./classix.js";import"./state.js";import"./request.js";import"./request2.js";import"./component.styles.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 h{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:i,options:a}=t(this,"accordion.show",{dir:this.localize.dir()});await s(this.body,o(i,this.body.scrollHeight),a),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:i,options:a}=t(this,"accordion.hide",{dir:this.localize.dir()});await s(this.body,o(i,this.body.scrollHeight),a),this.body.hidden=!0,this.body.style.height="auto",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 r`<div part="base" class="outline outline-1 outline-neutral-400 -outline-offset-1"><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",this.open?"bg-white text-accent hover:bg-neutral-200":"text-primary bg-neutral-100 hover:bg-neutral-200")}" role="button" aria-expanded="${this.open?"true":"false"}" aria-controls="content" tabindex="0" @click="${this.handleSummaryClick}" @keydown="${this.handleSummaryKeyDown}"><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-1-14-4-icon library="system" name="chevron-down"></sd-1-14-4-icon></slot><slot name="collapse-icon" class="${m(!this.open&&"hidden")}"><sd-1-14-4-icon library="system" name="chevron-down"></sd-1-14-4-icon></slot></span></header><div part="content" id="content" class="overflow-hidden"><slot class="block px-4 py-6" role="region" aria-labelledby="header"></slot></div></div>`}};w.styles=[h.styles,n`: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([d({type:Boolean,reflect:!0})],w.prototype,"open",2),b([d()],w.prototype,"summary",2),b([y("open",{waitUntilFirstUpdate:!0})],w.prototype,"handleOpenChange",1),w=b([l("sd-1-14-4-accordion")],w),a("accordion.show",{keyframes:[{height:"0",opacity:"0"},{height:"auto",opacity:"1"}],options:{duration:300,easing:"ease"}}),a("accordion.hide",{keyframes:[{height:"auto",opacity:"1"},{height:"0",opacity:"0"}],options:{duration:300,easing:"ease"}});export{w as default};
@@ -1 +1 @@
1
- import{x as e,i as t}from"./lit-element.js";import{S as r,n as s,e 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 r{constructor(){super(...arguments),this.variant="default",this.size="lg",this.inverted=!1}render(){return e`<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=[r.styles,t`: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-1-14-2-badge")],l);export{l as default};
1
+ import{x as e,i as t}from"./lit-element.js";import{S as r,n as s,c as i}from"./solid-element.js";import{t as n}from"./classix.js";var o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,p=(e,t,r,s)=>{for(var i,n=s>1?void 0:s?a(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&&o(t,r,n),n};let l=class extends r{constructor(){super(...arguments),this.variant="default",this.size="lg",this.inverted=!1}render(){return e`<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=[r.styles,t`: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-1-14-4-badge")],l);export{l as default};
@@ -1 +1 @@
1
- import{x as t,i as e}from"./lit-element.js";import{S as s,n as r,e as i}from"./solid-element.js";import{t as a}from"./state.js";import{i 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 s{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(e){return"top"===e?t`<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>`:t`<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(e){return"top"===e?t`<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>`:t`<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(e){return"top"===e?t`<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>`:t`<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 t`<div class="relative" part="shape-top">${1===this.shapes.length?t`<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 t`<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 t`<div class="relative" part="shape-bottom">${this.getSvg(this.componentBreakpoint,"bottom")}${this.renderWhitespaceFix("bottom")}</div>`}renderWhitespaceFix(e){return t`<div class="${p({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white"}[this.variant],{top:"bottom-0",bottom:"top-0"}[e],"block absolute left-0 w-full h-[1px]")}"></div>`}render(){return t`<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,s.styles,e`: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-1-14-2-brandshape")],d);export{d as default};
1
+ import{x as t,i as e}from"./lit-element.js";import{S as s,n as r,c as i}from"./solid-element.js";import{t as a}from"./state.js";import{i 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 s{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(e){return"top"===e?t`<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>`:t`<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(e){return"top"===e?t`<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>`:t`<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(e){return"top"===e?t`<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>`:t`<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 t`<div class="relative" part="shape-top">${1===this.shapes.length?t`<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 t`<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 t`<div class="relative" part="shape-bottom">${this.getSvg(this.componentBreakpoint,"bottom")}${this.renderWhitespaceFix("bottom")}</div>`}renderWhitespaceFix(e){return t`<div class="${p({"neutral-100":"bg-neutral-100",primary:"bg-primary",white:"bg-white"}[this.variant],{top:"bottom-0",bottom:"top-0"}[e],"block absolute left-0 w-full h-[1px]")}"></div>`}render(){return t`<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,s.styles,e`: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-1-14-4-brandshape")],d);export{d as default};
@@ -1 +1 @@
1
- import"./spinner.js";import{i as t}from"./lit-element.js";import{S as e,l as i,n as r,e as o}from"./solid-element.js";import{t as s}from"./state.js";import{i as a}from"./query.js";import{H as n}from"./slot.js";import{i as l,n as h}from"./static.js";import{l as d}from"./if-defined.js";import{w as m}from"./watch.js";import{c as p}from"./component.styles.js";import{t as c}from"./classix.js";import"./solid-components2.js";const u=new WeakMap,f=new WeakMap,b=new WeakMap;class y{constructor(t,e){(this.host=t).addController(this),this.options={form:t=>{if(t.hasAttribute("form")&&""!==t.getAttribute("form")){const e=t.getRootNode(),i=t.getAttribute("form");if(i)return e.getElementById(i)}return t.closest("form")},name:t=>t.name,value:t=>t.value,defaultValue:t=>t.defaultValue,disabled:t=>t.disabled??!1,reportValidity:t=>"function"!=typeof t.reportValidity||t.reportValidity(),setValue:(t,e)=>t.value=e,...e},this.handleFormData=this.handleFormData.bind(this),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.handleFormReset=this.handleFormReset.bind(this),this.reportFormValidity=this.reportFormValidity.bind(this),this.handleUserInput=this.handleUserInput.bind(this)}hostConnected(){const t=this.options.form(this.host);t&&this.attachForm(t),this.host.addEventListener("sd-input",this.handleUserInput)}hostDisconnected(){this.detachForm(),this.host.removeEventListener("sd-input",this.handleUserInput)}hostUpdated(){const t=this.options.form(this.host);t||this.detachForm(),t&&this.form!==t&&(this.detachForm(),this.attachForm(t)),this.host.hasUpdated&&this.setValidity(this.host.checkValidity())}attachForm(t){t?(this.form=t,u.has(this.form)?u.get(this.form).add(this.host):u.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),b.has(this.form)||(b.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity())):this.form=void 0}detachForm(){var t;this.form&&(null==(t=u.get(this.form))||t.delete(this.host),this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),b.has(this.form)&&(this.form.reportValidity=b.get(this.form),b.delete(this.form))),this.form=void 0}handleFormData(t){const e=this.options.disabled(this.host),i=this.options.name(this.host),r=this.options.value(this.host),o="sd-1-14-2-button"===this.host.tagName.toLowerCase();!e&&!o&&"string"==typeof i&&i.length>0&&typeof r<"u"&&(Array.isArray(r)?r.forEach((e=>{t.formData.append(i,e.toString())})):t.formData.append(i,r.toString()))}handleFormSubmit(t){var e;const i=this.options.disabled(this.host),r=this.options.reportValidity;this.form&&!this.form.noValidate&&(null==(e=u.get(this.form))||e.forEach((t=>{this.setUserInteracted(t,!0)}))),this.form&&!this.form.noValidate&&!i&&!r(this.host)&&(t.preventDefault(),t.stopImmediatePropagation())}handleFormReset(){this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1)}async handleUserInput(){await this.host.updateComplete,this.setUserInteracted(this.host,!0)}reportFormValidity(){if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.reportValidity&&!e.reportValidity())return!1}return!0}setUserInteracted(t,e){f.set(t,e),t.requestUpdate()}doAction(t,e){if(this.form){const i=document.createElement("button");i.type=t,i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.clipPath="inset(50%)",i.style.overflow="hidden",i.style.whiteSpace="nowrap",e&&(i.name=e.name,i.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach((t=>{e.hasAttribute(t)&&i.setAttribute(t,e.getAttribute(t))}))),this.form.append(i),i.click(),i.remove()}}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){var e;const i=this.host,r=!!f.get(i),o=!!i.required;null!=(e=this.form)&&e.noValidate?(i.removeAttribute("data-required"),i.removeAttribute("data-optional"),i.removeAttribute("data-invalid"),i.removeAttribute("data-valid"),i.removeAttribute("data-user-invalid"),i.removeAttribute("data-user-valid")):(i.toggleAttribute("data-required",o),i.toggleAttribute("data-optional",!o),i.toggleAttribute("data-invalid",!t),i.toggleAttribute("data-valid",t),i.toggleAttribute("data-user-invalid",!t&&r),i.toggleAttribute("data-user-valid",t&&r))}updateValidity(){const t=this.host;this.setValidity(t.checkValidity())}}var v=Object.defineProperty,g=Object.getOwnPropertyDescriptor,x=(t,e,i,r)=>{for(var o,s=r>1?void 0:r?g(e,i):e,a=t.length-1;a>=0;a--)(o=t[a])&&(s=(r?o(e,i,s):o(s))||s);return r&&s&&v(e,i,s),s};let V=class extends e{constructor(){super(...arguments),this.formControlController=new y(this,{form:t=>{if(t.hasAttribute("form")){const e=t.getRootNode(),i=t.getAttribute("form");return e.getElementById(i)}return t.closest("form")}}),this.hasSlotController=new n(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=""}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)}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()}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?l`a`:l`button`,i={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 h`<${e} part="base" class="${c("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-md\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",i["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 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}" @click="${this.handleClick}"><slot name="icon-left" part="icon-left" class="${c("flex flex-auto items-center pointer-events-none",i["icon-only"]&&"hidden",this.loading&&"invisible",i["icon-left"]&&{sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size])}"></slot><slot part="label" class="${c(i["icon-only"]?"flex flex-auto items-center pointer-events-none":"inline-block",this.loading&&"invisible")}"></slot><slot name="icon-right" part="icon-right" class="${c("flex flex-auto items-center pointer-events-none",this.loading&&"invisible",i["icon-only"]&&"hidden",i["icon-right"]&&{sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size])}"></slot>${this.loading?h`<sd-1-14-2-spinner class="${c("absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2")}"></sd-1-14-2-spinner>`:""}</${e}>`}};V.styles=[p,e.styles,t`:host{display:inline-block;position:relative;width:auto;cursor:pointer}sd-1-14-2-spinner{--indicator-color:currentColor;--track-color:var(--tw-varcolor-200)}::slotted(sd-1-14-2-badge){position:absolute;top:0;right:0;translate:50% -50%;pointer-events:none}::slotted(sd-1-14-2-icon),sd-1-14-2-spinner{font-size:calc(var(--tw-varspacing)/ 2)}`],x([a("a, button")],V.prototype,"button",2),x([i({selector:"sd-1-14-2-icon"})],V.prototype,"_iconsInDefaultSlot",2),x([s()],V.prototype,"invalid",2),x([r()],V.prototype,"title",2),x([r({reflect:!0})],V.prototype,"variant",2),x([r({type:Boolean,reflect:!0})],V.prototype,"inverted",2),x([r({reflect:!0})],V.prototype,"size",2),x([r({type:Boolean,reflect:!0})],V.prototype,"disabled",2),x([r({type:Boolean,reflect:!0})],V.prototype,"loading",2),x([r()],V.prototype,"type",2),x([r()],V.prototype,"name",2),x([r()],V.prototype,"value",2),x([r()],V.prototype,"href",2),x([r()],V.prototype,"target",2),x([r()],V.prototype,"download",2),x([r()],V.prototype,"form",2),x([r({attribute:"formaction"})],V.prototype,"formAction",2),x([r({attribute:"formenctype"})],V.prototype,"formEnctype",2),x([r({attribute:"formmethod"})],V.prototype,"formMethod",2),x([r({attribute:"formnovalidate",type:Boolean})],V.prototype,"formNoValidate",2),x([r({attribute:"formtarget"})],V.prototype,"formTarget",2),x([m("disabled",{waitUntilFirstUpdate:!0})],V.prototype,"handleDisabledChange",1),V=x([o("sd-1-14-2-button")],V);export{V as default};
1
+ import"./spinner.js";import{i as t}from"./lit-element.js";import{S as e,l as i,n as r,c as o}from"./solid-element.js";import{H as s}from"./slot.js";import{i as a,n}from"./static.js";import{l}from"./if-defined.js";import{t as h}from"./state.js";import{i as d}from"./query.js";import{w as m}from"./watch.js";import{c as p}from"./component.styles.js";import{t as c}from"./classix.js";import"./solid-components2.js";const u=new WeakMap,f=new WeakMap,b=new WeakMap;class y{constructor(t,e){(this.host=t).addController(this),this.options={form:t=>{if(t.hasAttribute("form")&&""!==t.getAttribute("form")){const e=t.getRootNode(),i=t.getAttribute("form");if(i)return e.getElementById(i)}return t.closest("form")},name:t=>t.name,value:t=>t.value,defaultValue:t=>t.defaultValue,disabled:t=>t.disabled??!1,reportValidity:t=>"function"!=typeof t.reportValidity||t.reportValidity(),setValue:(t,e)=>t.value=e,...e},this.handleFormData=this.handleFormData.bind(this),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.handleFormReset=this.handleFormReset.bind(this),this.reportFormValidity=this.reportFormValidity.bind(this),this.handleUserInput=this.handleUserInput.bind(this)}hostConnected(){const t=this.options.form(this.host);t&&this.attachForm(t),this.host.addEventListener("sd-input",this.handleUserInput)}hostDisconnected(){this.detachForm(),this.host.removeEventListener("sd-input",this.handleUserInput)}hostUpdated(){const t=this.options.form(this.host);t||this.detachForm(),t&&this.form!==t&&(this.detachForm(),this.attachForm(t)),this.host.hasUpdated&&this.setValidity(this.host.checkValidity())}attachForm(t){t?(this.form=t,u.has(this.form)?u.get(this.form).add(this.host):u.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),b.has(this.form)||(b.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity())):this.form=void 0}detachForm(){var t;this.form&&(null==(t=u.get(this.form))||t.delete(this.host),this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),b.has(this.form)&&(this.form.reportValidity=b.get(this.form),b.delete(this.form))),this.form=void 0}handleFormData(t){const e=this.options.disabled(this.host),i=this.options.name(this.host),r=this.options.value(this.host),o="sd-1-14-4-button"===this.host.tagName.toLowerCase();!e&&!o&&"string"==typeof i&&i.length>0&&typeof r<"u"&&(Array.isArray(r)?r.forEach((e=>{t.formData.append(i,e.toString())})):t.formData.append(i,r.toString()))}handleFormSubmit(t){var e;const i=this.options.disabled(this.host),r=this.options.reportValidity;this.form&&!this.form.noValidate&&(null==(e=u.get(this.form))||e.forEach((t=>{this.setUserInteracted(t,!0)}))),this.form&&!this.form.noValidate&&!i&&!r(this.host)&&(t.preventDefault(),t.stopImmediatePropagation())}handleFormReset(){this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1)}async handleUserInput(){await this.host.updateComplete,this.setUserInteracted(this.host,!0)}reportFormValidity(){if(this.form&&!this.form.noValidate){const t=this.form.querySelectorAll("*");for(const e of t)if("function"==typeof e.reportValidity&&!e.reportValidity())return!1}return!0}setUserInteracted(t,e){f.set(t,e),t.requestUpdate()}doAction(t,e){if(this.form){const i=document.createElement("button");i.type=t,i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.clipPath="inset(50%)",i.style.overflow="hidden",i.style.whiteSpace="nowrap",e&&(i.name=e.name,i.value=e.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach((t=>{e.hasAttribute(t)&&i.setAttribute(t,e.getAttribute(t))}))),this.form.append(i),i.click(),i.remove()}}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}setValidity(t){var e;const i=this.host,r=!!f.get(i),o=!!i.required;null!=(e=this.form)&&e.noValidate?(i.removeAttribute("data-required"),i.removeAttribute("data-optional"),i.removeAttribute("data-invalid"),i.removeAttribute("data-valid"),i.removeAttribute("data-user-invalid"),i.removeAttribute("data-user-valid")):(i.toggleAttribute("data-required",o),i.toggleAttribute("data-optional",!o),i.toggleAttribute("data-invalid",!t),i.toggleAttribute("data-valid",t),i.toggleAttribute("data-user-invalid",!t&&r),i.toggleAttribute("data-user-valid",t&&r))}updateValidity(){const t=this.host;this.setValidity(t.checkValidity())}}var v=Object.defineProperty,g=Object.getOwnPropertyDescriptor,x=(t,e,i,r)=>{for(var o,s=r>1?void 0:r?g(e,i):e,a=t.length-1;a>=0;a--)(o=t[a])&&(s=(r?o(e,i,s):o(s))||s);return r&&s&&v(e,i,s),s};let V=class extends e{constructor(){super(...arguments),this.formControlController=new y(this,{form:t=>{if(t.hasAttribute("form")){const e=t.getRootNode(),i=t.getAttribute("form");return e.getElementById(i)}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=""}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)}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()}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?a`a`:a`button`,i={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 n`<${e} part="base" class="${c("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-md\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",i["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 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="${l(t?void 0:this.disabled)}" type="${l(t?void 0:this.type)}" title="${this.title}" name="${l(t?void 0:this.name)}" value="${l(t?void 0:this.value)}" href="${l(t?this.href:void 0)}" target="${l(t?this.target:void 0)}" download="${l(t?this.download:void 0)}" rel="${l(t&&this.target?"noreferrer noopener":void 0)}" role="${l(t?void 0:"button")}" aria-disabled="${this.disabled?"true":"false"}" tabindex="${this.disabled?"-1":"0"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}" @click="${this.handleClick}"><slot name="icon-left" part="icon-left" class="${c("flex flex-auto items-center pointer-events-none",i["icon-only"]&&"hidden",this.loading&&"invisible",i["icon-left"]&&{sm:"mr-1",md:"mr-2",lg:"mr-2"}[this.size])}"></slot><slot part="label" class="${c(i["icon-only"]?"flex flex-auto items-center pointer-events-none":"inline-block",this.loading&&"invisible")}"></slot><slot name="icon-right" part="icon-right" class="${c("flex flex-auto items-center pointer-events-none",this.loading&&"invisible",i["icon-only"]&&"hidden",i["icon-right"]&&{sm:"ml-1",md:"ml-2",lg:"ml-2"}[this.size])}"></slot>${this.loading?n`<sd-1-14-4-spinner class="${c("absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2")}"></sd-1-14-4-spinner>`:""}</${e}>`}};V.styles=[p,e.styles,t`:host{display:inline-block;position:relative;width:auto;cursor:pointer}sd-1-14-4-spinner{--indicator-color:currentColor;--track-color:var(--tw-varcolor-200)}::slotted(sd-1-14-4-badge){position:absolute;top:0;right:0;translate:50% -50%;pointer-events:none}::slotted(sd-1-14-4-icon),sd-1-14-4-spinner{font-size:calc(var(--tw-varspacing)/ 2)}`],x([d("a, button")],V.prototype,"button",2),x([i({selector:"sd-1-14-4-icon"})],V.prototype,"_iconsInDefaultSlot",2),x([h()],V.prototype,"invalid",2),x([r()],V.prototype,"title",2),x([r({reflect:!0})],V.prototype,"variant",2),x([r({type:Boolean,reflect:!0})],V.prototype,"inverted",2),x([r({reflect:!0})],V.prototype,"size",2),x([r({type:Boolean,reflect:!0})],V.prototype,"disabled",2),x([r({type:Boolean,reflect:!0})],V.prototype,"loading",2),x([r()],V.prototype,"type",2),x([r()],V.prototype,"name",2),x([r()],V.prototype,"value",2),x([r()],V.prototype,"href",2),x([r()],V.prototype,"target",2),x([r()],V.prototype,"download",2),x([r()],V.prototype,"form",2),x([r({attribute:"formaction"})],V.prototype,"formAction",2),x([r({attribute:"formenctype"})],V.prototype,"formEnctype",2),x([r({attribute:"formmethod"})],V.prototype,"formMethod",2),x([r({attribute:"formnovalidate",type:Boolean})],V.prototype,"formNoValidate",2),x([r({attribute:"formtarget"})],V.prototype,"formTarget",2),x([m("disabled",{waitUntilFirstUpdate:!0})],V.prototype,"handleDisabledChange",1),V=x([o("sd-1-14-4-button")],V);export{V as default};
@@ -1 +1 @@
1
- import{x as t,i as e}from"./lit-element.js";import{S as r,n as o,e as i}from"./solid-element.js";import{c as s}from"./component.styles.js";import{t as n}from"./classix.js";var a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=(t,e,r,o)=>{for(var i,s=o>1?void 0:o?l(e,r):e,n=t.length-1;n>=0;n--)(i=t[n])&&(s=(o?i(e,r,s):i(s))||s);return o&&s&&a(e,r,s),s};let c=class extends r{constructor(){super(...arguments),this.orientation="horizontal",this.inverted=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}render(){return t`<hr part="main" class="${n(this.inverted?"border-primary-400":"border-neutral-400","horizontal"===this.orientation?"border-t w-full":" border-l h-full")}">`}};c.styles=[s,r.styles,e`:host{margin:0}:host(sd-1-14-2-divider[orientation=horizontal]){display:block}:host(sd-1-14-2-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-1-14-2-divider")],c);export{c as default};
1
+ import{x as t,i as e}from"./lit-element.js";import{S as r,n as o,c as i}from"./solid-element.js";import{c as s}from"./component.styles.js";import{t as n}from"./classix.js";var a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=(t,e,r,o)=>{for(var i,s=o>1?void 0:o?l(e,r):e,n=t.length-1;n>=0;n--)(i=t[n])&&(s=(o?i(e,r,s):i(s))||s);return o&&s&&a(e,r,s),s};let c=class extends r{constructor(){super(...arguments),this.orientation="horizontal",this.inverted=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}render(){return t`<hr part="main" class="${n(this.inverted?"border-primary-400":"border-neutral-400","horizontal"===this.orientation?"border-t w-full":" border-l h-full")}">`}};c.styles=[s,r.styles,e`:host{margin:0}:host(sd-1-14-4-divider[orientation=horizontal]){display:block}:host(sd-1-14-4-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-1-14-4-divider")],c);export{c as default};
@@ -1 +1 @@
1
- import"./button.js";import"./icon.js";import{g as e,a as t,s,w as i,c as a}from"./event.js";import{x as o,i as r}from"./lit-element.js";import{S as n,n as l,e as d}from"./solid-element.js";import{i as h}from"./query.js";import{H as c}from"./slot.js";import{l as p}from"./if-defined.js";import{L as m}from"./solid-components2.js";import{g as u,l as y,u as f}from"./tabbable.js";import{w}from"./watch.js";import{c as v}from"./component.styles.js";import{t as b}from"./classix.js";import"./spinner.js";import"./state.js";import"./static.js";import"./request.js";import"./request2.js";function k(e){return e.charAt(0).toUpperCase()+e.slice(1)}let g=[];class x{constructor(e){this.tabDirection="forward",this.element=e,this.handleFocusIn=this.handleFocusIn.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this)}activate(){g.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){g=g.filter((e=>e!==this.element)),document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return g[g.length-1]===this.element}checkFocus(){if(this.isActive()&&!this.element.matches(":focus-within")){const{start:e,end:t}=u(this.element),s="forward"===this.tabDirection?e:t;"function"==typeof(null==s?void 0:s.focus)&&s.focus({preventScroll:!0})}}handleFocusIn(){this.checkFocus()}handleKeyDown(e){"Tab"===e.key&&e.shiftKey&&(this.tabDirection="backward",requestAnimationFrame((()=>this.checkFocus())))}handleKeyUp(){this.tabDirection="forward"}}var j=Object.defineProperty,K=Object.getOwnPropertyDescriptor,D=(e,t,s,i)=>{for(var a,o=i>1?void 0:i?K(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(o=(i?a(t,s,o):a(o))||o);return i&&o&&j(t,s,o),o};let C=class extends n{constructor(){super(...arguments),this.hasSlotController=new c(this,"footer"),this.localize=new m(this),this.modal=new x(this),this.open=!1,this.label="",this.placement="end",this.contained=!1,this.noHeader=!1,this.handleDocumentKeyDown=e=>{this.open&&"Escape"===e.key&&(e.stopPropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.drawer.hidden=!this.open,this.open&&(this.addOpenListeners(),this.contained||(this.modal.activate(),y(this)))}disconnectedCallback(){super.disconnectedCallback(),f(this)}requestClose(s){if(this.emit("sd-request-close",{cancelable:!0,detail:{source:s}}).defaultPrevented){const s=e(this,"drawer.denyClose",{dir:this.localize.dir()});t(this.panel,s.keyframes,s.options)}else this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.contained||(this.modal.activate(),y(this));const i=this.querySelector("[autofocus]");i&&i.removeAttribute("autofocus"),await Promise.all([s(this.drawer),s(this.overlay)]),this.drawer.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 a=e(this,`drawer.show${k(this.placement)}`,{dir:this.localize.dir()}),o=e(this,"drawer.overlay.show",{dir:this.localize.dir()});await Promise.all([t(this.panel,a.keyframes,a.options),t(this.overlay,o.keyframes,o.options)]),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),this.contained||(this.modal.deactivate(),f(this)),await Promise.all([s(this.drawer),s(this.overlay)]);const i=e(this,`drawer.hide${k(this.placement)}`,{dir:this.localize.dir()}),a=e(this,"drawer.overlay.hide",{dir:this.localize.dir()});await Promise.all([t(this.overlay,a.keyframes,a.options).then((()=>{this.overlay.hidden=!0})),t(this.panel,i.keyframes,i.options).then((()=>{this.panel.hidden=!0}))]),this.drawer.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1;const o=this.originalTrigger;"function"==typeof(null==o?void 0:o.focus)&&setTimeout((()=>o.focus())),this.emit("sd-after-hide")}}handleNoModalChange(){this.open&&!this.contained&&(this.modal.activate(),y(this)),this.open&&this.contained&&(this.modal.deactivate(),f(this))}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 o`<div part="base" class="${b("top-0 start-0 w-full h-full pointer-events-none overflow-hidden",this.contained?"absolute":"fixed")}"><div part="overlay" class="${b("block top-0 left-0 right-0 bottom-0 bg-neutral-800/75 pointer-events-auto",this.contained?"absolute":"fixed")}" @click="${()=>this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${b("absolute flex flex-col z-10 max-w-full max-h-full bg-white shadow-lg overflow-auto pointer-events-auto focus:outline-none",{end:"top-0 end-0 bottom-auto start-auto w-[--width] h-full",start:"top-0 end-auto bottom-auto start-0 w-[--width] h-full"}[this.placement])}" role="dialog" aria-modal="true" aria-hidden="${this.open?"false":"true"}" aria-label="${this.label}" aria-labelledby="${p(this.noHeader?void 0:"title")}" tabindex="0">${this.noHeader?"":o`<header part="header" class="flex justify-between py-2 px-4 items-center flex-shrink-0" style="min-height:56px"><div part="title"><slot name="header" part="title" class="flex-auto text-xl m-0" id="title"></slot></div><div class="shrink-0 flex flex-wrap justify-end gap-1 ml-4 absolute top-2 right-2"><sd-1-14-2-button variant="tertiary" size="lg" part="close-button" @click="${()=>this.requestClose("close-button")}"><sd-1-14-2-icon name="close" library="system"></sd-1-14-2-icon></sd-1-14-2-button></div></header>`}<div part="body" class="flex-auto block px-4"><slot></slot></div><footer part="footer" class="${b(this.hasSlotController.test("footer")?"text-left p-4":"hidden")}"><slot name="footer"></slot></footer></div></div>`}};C.styles=[n.styles,r`${v}:host{--width:25rem;display:contents}:host([contained]){z-index:initial}:host(:not([contained])){z-index:var(--sd-z-index-drawer)}[part=body]{-webkit-overflow-scrolling:touch;overflow-y:scroll;scrollbar-width:none}[part=body]::-webkit-scrollbar{width:0;height:0}`],D([h("[part=base]")],C.prototype,"drawer",2),D([h("[part=panel]")],C.prototype,"panel",2),D([h("[part=overlay]")],C.prototype,"overlay",2),D([l({type:Boolean,reflect:!0})],C.prototype,"open",2),D([l({attribute:"label",reflect:!0})],C.prototype,"label",2),D([l({reflect:!0})],C.prototype,"placement",2),D([l({type:Boolean,reflect:!0})],C.prototype,"contained",2),D([l({attribute:"no-header",type:Boolean})],C.prototype,"noHeader",2),D([w("open",{waitUntilFirstUpdate:!0})],C.prototype,"handleOpenChange",1),D([w("contained",{waitUntilFirstUpdate:!0})],C.prototype,"handleNoModalChange",1),C=D([d("sd-1-14-2-drawer")],C),a("drawer.showStart",{keyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}}),a("drawer.hideStart",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],options:{duration:250,easing:"ease"}}),a("drawer.showEnd",{keyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}}),a("drawer.hideEnd",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],options:{duration:250,easing:"ease"}}),a("drawer.denyClose",{keyframes:[{scale:1},{scale:1.01},{scale:1}],options:{duration:250}}),a("drawer.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}}),a("drawer.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}});export{C as default};
1
+ import"./button.js";import"./icon.js";import{g as e,a as t,s,w as i,c as a}from"./event.js";import{x as o,i as r}from"./lit-element.js";import{S as n,n as l,c as d}from"./solid-element.js";import{H as h}from"./slot.js";import{l as c}from"./if-defined.js";import{L as p}from"./solid-components2.js";import{g as m,l as u,u as y}from"./tabbable.js";import{i as f}from"./query.js";import{w}from"./watch.js";import{c as v}from"./component.styles.js";import{t as b}from"./classix.js";import"./spinner.js";import"./static.js";import"./state.js";import"./request.js";import"./request2.js";function k(e){return e.charAt(0).toUpperCase()+e.slice(1)}let g=[];class x{constructor(e){this.tabDirection="forward",this.element=e,this.handleFocusIn=this.handleFocusIn.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this)}activate(){g.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){g=g.filter((e=>e!==this.element)),document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return g[g.length-1]===this.element}checkFocus(){if(this.isActive()&&!this.element.matches(":focus-within")){const{start:e,end:t}=m(this.element),s="forward"===this.tabDirection?e:t;"function"==typeof(null==s?void 0:s.focus)&&s.focus({preventScroll:!0})}}handleFocusIn(){this.checkFocus()}handleKeyDown(e){"Tab"===e.key&&e.shiftKey&&(this.tabDirection="backward",requestAnimationFrame((()=>this.checkFocus())))}handleKeyUp(){this.tabDirection="forward"}}var j=Object.defineProperty,K=Object.getOwnPropertyDescriptor,D=(e,t,s,i)=>{for(var a,o=i>1?void 0:i?K(t,s):t,r=e.length-1;r>=0;r--)(a=e[r])&&(o=(i?a(t,s,o):a(o))||o);return i&&o&&j(t,s,o),o};let C=class extends n{constructor(){super(...arguments),this.hasSlotController=new h(this,"footer"),this.localize=new p(this),this.modal=new x(this),this.open=!1,this.label="",this.placement="end",this.contained=!1,this.noHeader=!1,this.handleDocumentKeyDown=e=>{this.open&&"Escape"===e.key&&(e.stopPropagation(),this.requestClose("keyboard"))}}firstUpdated(){this.drawer.hidden=!this.open,this.open&&(this.addOpenListeners(),this.contained||(this.modal.activate(),u(this)))}disconnectedCallback(){super.disconnectedCallback(),y(this)}requestClose(s){if(this.emit("sd-request-close",{cancelable:!0,detail:{source:s}}).defaultPrevented){const s=e(this,"drawer.denyClose",{dir:this.localize.dir()});t(this.panel,s.keyframes,s.options)}else this.hide()}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown)}async handleOpenChange(){if(this.open){this.emit("sd-show"),this.addOpenListeners(),this.originalTrigger=document.activeElement,this.contained||(this.modal.activate(),u(this));const i=this.querySelector("[autofocus]");i&&i.removeAttribute("autofocus"),await Promise.all([s(this.drawer),s(this.overlay)]),this.drawer.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 a=e(this,`drawer.show${k(this.placement)}`,{dir:this.localize.dir()}),o=e(this,"drawer.overlay.show",{dir:this.localize.dir()});await Promise.all([t(this.panel,a.keyframes,a.options),t(this.overlay,o.keyframes,o.options)]),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),this.contained||(this.modal.deactivate(),y(this)),await Promise.all([s(this.drawer),s(this.overlay)]);const i=e(this,`drawer.hide${k(this.placement)}`,{dir:this.localize.dir()}),a=e(this,"drawer.overlay.hide",{dir:this.localize.dir()});await Promise.all([t(this.overlay,a.keyframes,a.options).then((()=>{this.overlay.hidden=!0})),t(this.panel,i.keyframes,i.options).then((()=>{this.panel.hidden=!0}))]),this.drawer.hidden=!0,this.overlay.hidden=!1,this.panel.hidden=!1;const o=this.originalTrigger;"function"==typeof(null==o?void 0:o.focus)&&setTimeout((()=>o.focus())),this.emit("sd-after-hide")}}handleNoModalChange(){this.open&&!this.contained&&(this.modal.activate(),u(this)),this.open&&this.contained&&(this.modal.deactivate(),y(this))}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 o`<div part="base" class="${b("top-0 start-0 w-full h-full pointer-events-none overflow-hidden",this.contained?"absolute":"fixed")}"><div part="overlay" class="${b("block top-0 left-0 right-0 bottom-0 bg-neutral-800/75 pointer-events-auto",this.contained?"absolute":"fixed")}" @click="${()=>this.requestClose("overlay")}" tabindex="-1"></div><div part="panel" class="${b("absolute flex flex-col z-10 max-w-full max-h-full bg-white shadow-lg overflow-auto pointer-events-auto focus:outline-none",{end:"top-0 end-0 bottom-auto start-auto w-[--width] h-full",start:"top-0 end-auto bottom-auto start-0 w-[--width] h-full"}[this.placement])}" role="dialog" aria-modal="true" aria-hidden="${this.open?"false":"true"}" aria-label="${this.label}" aria-labelledby="${c(this.noHeader?void 0:"title")}" tabindex="0">${this.noHeader?"":o`<header part="header" class="flex justify-between py-2 px-4 items-center flex-shrink-0" style="min-height:56px"><div part="title"><slot name="header" part="title" class="flex-auto text-xl m-0" id="title"></slot></div><div class="shrink-0 flex flex-wrap justify-end gap-1 ml-4 absolute top-2 right-2"><sd-1-14-4-button variant="tertiary" size="lg" part="close-button" @click="${()=>this.requestClose("close-button")}"><sd-1-14-4-icon name="close" library="system"></sd-1-14-4-icon></sd-1-14-4-button></div></header>`}<div part="body" class="flex-auto block px-4"><slot></slot></div><footer part="footer" class="${b(this.hasSlotController.test("footer")?"text-left p-4":"hidden")}"><slot name="footer"></slot></footer></div></div>`}};C.styles=[n.styles,r`${v}:host{--width:25rem;display:contents}:host([contained]){z-index:initial}:host(:not([contained])){z-index:var(--sd-z-index-drawer)}[part=body]{-webkit-overflow-scrolling:touch;overflow-y:scroll;scrollbar-width:none}[part=body]::-webkit-scrollbar{width:0;height:0}`],D([f("[part=base]")],C.prototype,"drawer",2),D([f("[part=panel]")],C.prototype,"panel",2),D([f("[part=overlay]")],C.prototype,"overlay",2),D([l({type:Boolean,reflect:!0})],C.prototype,"open",2),D([l({attribute:"label",reflect:!0})],C.prototype,"label",2),D([l({reflect:!0})],C.prototype,"placement",2),D([l({type:Boolean,reflect:!0})],C.prototype,"contained",2),D([l({attribute:"no-header",type:Boolean})],C.prototype,"noHeader",2),D([w("open",{waitUntilFirstUpdate:!0})],C.prototype,"handleOpenChange",1),D([w("contained",{waitUntilFirstUpdate:!0})],C.prototype,"handleNoModalChange",1),C=D([d("sd-1-14-4-drawer")],C),a("drawer.showStart",{keyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}}),a("drawer.hideStart",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],options:{duration:250,easing:"ease"}}),a("drawer.showEnd",{keyframes:[{opacity:0,translate:"100%"},{opacity:1,translate:"0"}],rtlKeyframes:[{opacity:0,translate:"-100%"},{opacity:1,translate:"0"}],options:{duration:250,easing:"ease"}}),a("drawer.hideEnd",{keyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"100%"}],rtlKeyframes:[{opacity:1,translate:"0"},{opacity:0,translate:"-100%"}],options:{duration:250,easing:"ease"}}),a("drawer.denyClose",{keyframes:[{scale:1},{scale:1.01},{scale:1}],options:{duration:250}}),a("drawer.overlay.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:250}}),a("drawer.overlay.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:250}});export{C as default};
@@ -1 +1 @@
1
- import"./popup.js";import{w as e,s as t,g as n,a as i,c as o}from"./event.js";import{x as s,i as a}from"./lit-element.js";import{S as r,n as d,e as p}from"./solid-element.js";import{i as h}from"./query.js";import{s as l,g as c}from"./tabbable.js";import{L as u}from"./solid-components2.js";import{w as m}from"./watch.js";import{c as g}from"./component.styles.js";import{t as y}from"./classix.js";var f=Object.defineProperty,w=Object.getOwnPropertyDescriptor,v=(e,t,n,i)=>{for(var o,s=i>1?void 0:i?w(t,n):t,a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i?o(t,n,s):o(s))||s);return i&&s&&f(t,n,s),s};let b=class extends r{constructor(){super(...arguments),this.localize=new u(this),this.open=!1,this.rounded=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.noAutoSize=!1,this.noFlip=!1,this.hoist=!1}connectedCallback(){super.connectedCallback(),this.handleMenuItemActivate=this.handleMenuItemActivate.bind(this),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this)}firstUpdated(){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide()}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof(null==e?void 0:e.focus)&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"sd-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){var t;if("Tab"===e.key){if(this.open&&"sd-menu-item"===(null==(t=document.activeElement)?void 0:t.tagName.toLowerCase()))return e.preventDefault(),this.hide(),void this.focusOnTrigger();setTimeout((()=>{var e,t,n;const i=(null==(e=this.containingElement)?void 0:e.getRootNode())instanceof ShadowRoot?null==(n=null==(t=document.activeElement)?void 0:t.shadowRoot)?void 0:n.activeElement:document.activeElement;(!this.containingElement||(null==i?void 0:i.closest(this.containingElement.tagName.toLowerCase()))!==this.containingElement)&&this.hide()}))}}handleDocumentMouseDown(e){const t=e.composedPath();this.containingElement&&!t.includes(this.containingElement)&&this.hide()}handleMenuItemActivate(e){const t=e.target;l(t,this.panel)}handlePanelSelect(e){const t=e.target;!this.stayOpenOnSelect&&"sd-menu"===t.tagName.toLowerCase()&&(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():this.show()}handleTriggerKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();if([" ","Enter"].includes(e.key))return e.preventDefault(),void this.handleTriggerClick();const t=this.getMenu();if(t){const n=t.defaultSlot.assignedElements({flatten:!0}),i=n[0],o=n[n.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),n.length>0&&requestAnimationFrame((()=>{("ArrowDown"===e.key||"Home"===e.key)&&(t.setCurrentItem(i),i.focus()),("ArrowUp"===e.key||"End"===e.key)&&(t.setCurrentItem(o),o.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>c(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"sd-1-14-2-button":case"sd-1-14-2-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,e(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,e(this,"sd-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("sd-activate",this.handleMenuItemActivate),this.panel.addEventListener("sd-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("sd-activate",this.handleMenuItemActivate),this.panel.removeEventListener("sd-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}async handleOpenChange(){if(this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){this.emit("sd-show"),this.addOpenListeners(),await t(this),this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:o}=n(this,"dropdown.show",{dir:this.localize.dir()});await i(this.popup.popup,e,o),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await t(this);const{keyframes:e,options:o}=n(this,"dropdown.hide",{dir:this.localize.dir()});await i(this.popup.popup,e,o),this.panel.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}render(){return s`<sd-1-14-2-popup part="base" id="dropdown" placement="${this.placement}" distance="${this.rounded&&this.distance<1?1:this.distance}" skidding="${this.skidding}" strategy="${this.hoist?"fixed":"absolute"}" ?flip="${!this.noFlip}" shift auto-size="vertical" auto-size-padding="10" ?active="${this.open}"><slot name="trigger" slot="anchor" part="trigger" class="block" @click="${this.handleTriggerClick}" @keydown="${this.handleTriggerKeyDown}" @keyup="${this.handleTriggerKeyUp}" @slotchange="${this.handleTriggerSlotChange}"></slot><slot part="panel" class="${y("shadow bg-white",this.open?"block pointer-events-auto":"pointer-events-none",this.rounded&&"rounded-md")}" aria-hidden="${this.open?"false":"true"}" aria-labelledby="dropdown"></slot></sd-1-14-2-popup>`}};b.styles=[r.styles,g,a`:host{display:inline-block}#dropdown::part(popup){z-index:var(--sd-z-index-dropdown)}#dropdown[data-current-placement^=top]::part(popup){transform-origin:bottom}#dropdown[data-current-placement^=bottom]::part(popup){transform-origin:top}#dropdown[data-current-placement^=left]::part(popup){transform-origin:right}#dropdown[data-current-placement^=right]::part(popup){transform-origin:left}:host(:not([no-auto-size])) ::slotted(:not([slot=trigger])){overflow:auto;max-width:var(--auto-size-available-width)!important;max-height:var(--auto-size-available-height)!important}`],v([h("#dropdown")],b.prototype,"popup",2),v([h("[part=trigger]")],b.prototype,"trigger",2),v([h("[part=panel]")],b.prototype,"panel",2),v([d({type:Boolean,reflect:!0})],b.prototype,"open",2),v([d({type:Boolean,reflect:!0})],b.prototype,"rounded",2),v([d({reflect:!0})],b.prototype,"placement",2),v([d({type:Boolean,reflect:!0})],b.prototype,"disabled",2),v([d({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],b.prototype,"stayOpenOnSelect",2),v([d({attribute:!1})],b.prototype,"containingElement",2),v([d({type:Number})],b.prototype,"distance",2),v([d({type:Number})],b.prototype,"skidding",2),v([d({type:Boolean,reflect:!0,attribute:"no-auto-size"})],b.prototype,"noAutoSize",2),v([d({type:Boolean,reflect:!0,attribute:"no-flip"})],b.prototype,"noFlip",2),v([d({type:Boolean})],b.prototype,"hoist",2),v([m("open",{waitUntilFirstUpdate:!0})],b.prototype,"handleOpenChange",1),b=v([p("sd-1-14-2-dropdown")],b),o("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),o("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{b as default};
1
+ import"./popup.js";import{w as e,s as t,g as n,a as i,c as o}from"./event.js";import{x as s,i as a}from"./lit-element.js";import{S as r,n as d,c as p}from"./solid-element.js";import{s as h,g as l}from"./tabbable.js";import{L as c}from"./solid-components2.js";import{i as u}from"./query.js";import{w as m}from"./watch.js";import{c as g}from"./component.styles.js";import{t as y}from"./classix.js";var f=Object.defineProperty,w=Object.getOwnPropertyDescriptor,v=(e,t,n,i)=>{for(var o,s=i>1?void 0:i?w(t,n):t,a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i?o(t,n,s):o(s))||s);return i&&s&&f(t,n,s),s};let b=class extends r{constructor(){super(...arguments),this.localize=new c(this),this.open=!1,this.rounded=!1,this.placement="bottom-start",this.disabled=!1,this.stayOpenOnSelect=!1,this.distance=0,this.skidding=0,this.noAutoSize=!1,this.noFlip=!1,this.hoist=!1}connectedCallback(){super.connectedCallback(),this.handleMenuItemActivate=this.handleMenuItemActivate.bind(this),this.handlePanelSelect=this.handlePanelSelect.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this.handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this.containingElement||(this.containingElement=this)}firstUpdated(){this.panel.hidden=!this.open,this.open&&(this.addOpenListeners(),this.popup.active=!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.hide()}focusOnTrigger(){const e=this.trigger.assignedElements({flatten:!0})[0];"function"==typeof(null==e?void 0:e.focus)&&e.focus()}getMenu(){return this.panel.assignedElements({flatten:!0}).find((e=>"sd-menu"===e.tagName.toLowerCase()))}handleKeyDown(e){this.open&&"Escape"===e.key&&(e.stopPropagation(),this.hide(),this.focusOnTrigger())}handleDocumentKeyDown(e){var t;if("Tab"===e.key){if(this.open&&"sd-menu-item"===(null==(t=document.activeElement)?void 0:t.tagName.toLowerCase()))return e.preventDefault(),this.hide(),void this.focusOnTrigger();setTimeout((()=>{var e,t,n;const i=(null==(e=this.containingElement)?void 0:e.getRootNode())instanceof ShadowRoot?null==(n=null==(t=document.activeElement)?void 0:t.shadowRoot)?void 0:n.activeElement:document.activeElement;(!this.containingElement||(null==i?void 0:i.closest(this.containingElement.tagName.toLowerCase()))!==this.containingElement)&&this.hide()}))}}handleDocumentMouseDown(e){const t=e.composedPath();this.containingElement&&!t.includes(this.containingElement)&&this.hide()}handleMenuItemActivate(e){const t=e.target;h(t,this.panel)}handlePanelSelect(e){const t=e.target;!this.stayOpenOnSelect&&"sd-menu"===t.tagName.toLowerCase()&&(this.hide(),this.focusOnTrigger())}handleTriggerClick(){this.open?this.hide():this.show()}handleTriggerKeyDown(e){if("Escape"===e.key&&this.open)return e.stopPropagation(),this.focusOnTrigger(),void this.hide();if([" ","Enter"].includes(e.key))return e.preventDefault(),void this.handleTriggerClick();const t=this.getMenu();if(t){const n=t.defaultSlot.assignedElements({flatten:!0}),i=n[0],o=n[n.length-1];["ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(e.preventDefault(),this.open||this.show(),n.length>0&&requestAnimationFrame((()=>{("ArrowDown"===e.key||"Home"===e.key)&&(t.setCurrentItem(i),i.focus()),("ArrowUp"===e.key||"End"===e.key)&&(t.setCurrentItem(o),o.focus())})))}}handleTriggerKeyUp(e){" "===e.key&&e.preventDefault()}handleTriggerSlotChange(){this.updateAccessibleTrigger()}updateAccessibleTrigger(){const e=this.trigger.assignedElements({flatten:!0}).find((e=>l(e).start));let t;if(e){switch(e.tagName.toLowerCase()){case"sd-1-14-4-button":case"sd-1-14-4-icon-button":t=e.button;break;default:t=e}t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false")}}async show(){if(!this.open)return this.open=!0,e(this,"sd-after-show")}async hide(){if(this.open)return this.open=!1,e(this,"sd-after-hide")}reposition(){this.popup.reposition()}addOpenListeners(){this.panel.addEventListener("sd-activate",this.handleMenuItemActivate),this.panel.addEventListener("sd-select",this.handlePanelSelect),this.panel.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown)}removeOpenListeners(){this.panel&&(this.panel.removeEventListener("sd-activate",this.handleMenuItemActivate),this.panel.removeEventListener("sd-select",this.handlePanelSelect),this.panel.removeEventListener("keydown",this.handleKeyDown)),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown)}async handleOpenChange(){if(this.disabled)this.open=!1;else if(this.updateAccessibleTrigger(),this.open){this.emit("sd-show"),this.addOpenListeners(),await t(this),this.panel.hidden=!1,this.popup.active=!0;const{keyframes:e,options:o}=n(this,"dropdown.show",{dir:this.localize.dir()});await i(this.popup.popup,e,o),this.emit("sd-after-show")}else{this.emit("sd-hide"),this.removeOpenListeners(),await t(this);const{keyframes:e,options:o}=n(this,"dropdown.hide",{dir:this.localize.dir()});await i(this.popup.popup,e,o),this.panel.hidden=!0,this.popup.active=!1,this.emit("sd-after-hide")}}render(){return s`<sd-1-14-4-popup part="base" id="dropdown" placement="${this.placement}" distance="${this.rounded&&this.distance<1?1:this.distance}" skidding="${this.skidding}" strategy="${this.hoist?"fixed":"absolute"}" ?flip="${!this.noFlip}" shift auto-size="vertical" auto-size-padding="10" ?active="${this.open}"><slot name="trigger" slot="anchor" part="trigger" class="block" @click="${this.handleTriggerClick}" @keydown="${this.handleTriggerKeyDown}" @keyup="${this.handleTriggerKeyUp}" @slotchange="${this.handleTriggerSlotChange}"></slot><slot part="panel" class="${y("shadow bg-white",this.open?"block pointer-events-auto":"pointer-events-none",this.rounded&&"rounded-md")}" aria-hidden="${this.open?"false":"true"}" aria-labelledby="dropdown"></slot></sd-1-14-4-popup>`}};b.styles=[r.styles,g,a`:host{display:inline-block}#dropdown::part(popup){z-index:var(--sd-z-index-dropdown)}#dropdown[data-current-placement^=top]::part(popup){transform-origin:bottom}#dropdown[data-current-placement^=bottom]::part(popup){transform-origin:top}#dropdown[data-current-placement^=left]::part(popup){transform-origin:right}#dropdown[data-current-placement^=right]::part(popup){transform-origin:left}:host(:not([no-auto-size])) ::slotted(:not([slot=trigger])){overflow:auto;max-width:var(--auto-size-available-width)!important;max-height:var(--auto-size-available-height)!important}`],v([u("#dropdown")],b.prototype,"popup",2),v([u("[part=trigger]")],b.prototype,"trigger",2),v([u("[part=panel]")],b.prototype,"panel",2),v([d({type:Boolean,reflect:!0})],b.prototype,"open",2),v([d({type:Boolean,reflect:!0})],b.prototype,"rounded",2),v([d({reflect:!0})],b.prototype,"placement",2),v([d({type:Boolean,reflect:!0})],b.prototype,"disabled",2),v([d({attribute:"stay-open-on-select",type:Boolean,reflect:!0})],b.prototype,"stayOpenOnSelect",2),v([d({attribute:!1})],b.prototype,"containingElement",2),v([d({type:Number})],b.prototype,"distance",2),v([d({type:Number})],b.prototype,"skidding",2),v([d({type:Boolean,reflect:!0,attribute:"no-auto-size"})],b.prototype,"noAutoSize",2),v([d({type:Boolean,reflect:!0,attribute:"no-flip"})],b.prototype,"noFlip",2),v([d({type:Boolean})],b.prototype,"hoist",2),v([m("open",{waitUntilFirstUpdate:!0})],b.prototype,"handleOpenChange",1),b=v([p("sd-1-14-4-dropdown")],b),o("dropdown.show",{keyframes:[{opacity:0,scale:.9},{opacity:1,scale:1}],options:{duration:100,easing:"ease"}}),o("dropdown.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.9}],options:{duration:100,easing:"ease"}});export{b as default};
@@ -1,4 +1,4 @@
1
- import{A as t,T as e,x as r,i as s}from"./lit-element.js";import{S as i,n as o,e as a}from"./solid-element.js";import{t as l}from"./state.js";import{w as n,u as c,g as h}from"./solid-components2.js";import{requestIcon as p}from"./request.js";import{w as u}from"./watch.js";import{c as d}from"./component.styles.js";import"./request2.js";
1
+ import{A as t,T as e,x as r,i as s}from"./lit-element.js";import{S as i,n as o,c as a}from"./solid-element.js";import{w as l,u as n,g as c}from"./solid-components2.js";import{t as h}from"./state.js";import{requestIcon as p}from"./request.js";import{w as u}from"./watch.js";import{c as d}from"./component.styles.js";import"./request2.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2017 Google LLC
@@ -14,4 +14,4 @@ import{A as t,T as e,x as r,i as s}from"./lit-element.js";import{S as i,n as o,e
14
14
  * Copyright 2017 Google LLC
15
15
  * SPDX-License-Identifier: BSD-3-Clause
16
16
  */
17
- class g extends b{}g.directiveName="unsafeSVG",g.resultType=2;const y=(v=g,(...t)=>({_$litDirective$:v,values:t}));var v,f=Object.defineProperty,w=Object.getOwnPropertyDescriptor,A=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?w(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&f(e,r,o),o};let $,x=class extends i{constructor(){super(...arguments),this.svg="",this.label="",this.library="default",this.color="currentColor"}connectedCallback(){super.connectedCallback(),n(this)}firstUpdated(){this.setIcon()}disconnectedCallback(){super.disconnectedCallback(),c(this)}getUrl(){const t=h(this.library);return this.name&&t?t.resolver(this.name):this.src}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var t;const e=h(this.library),r=this.getUrl();if($||($=new DOMParser),r)try{const s=await p(r);if(r===this.getUrl())if(s.ok){const r=$.parseFromString(s.svg,"text/html").body.querySelector("svg");null!==r?(null==(t=null==e?void 0:e.mutator)||t.call(e,r),this.svg=r.outerHTML,this.emit("sd-load")):(this.svg="",this.emit("sd-error"))}else this.svg="",this.emit("sd-error")}catch{this.emit("sd-error")}else this.svg.length>0&&(this.svg="")}render(){return r`${y(this.svg)}`}};x.styles=[d,s`:host{display:inline-block;width:1em;height:1em;box-sizing:content-box!important}svg{display:block;height:100%;width:100%}:host([color=primary]) svg{color:rgb(var(--sd-color-primary,0 53 142) / var(--tw-text-opacity,1))}// text-primary :host([color=white]) svg{color:rgb(var(--sd-color-white,255 255 255) / var(--tw-text-opacity,1))}`],A([l()],x.prototype,"svg",2),A([o({reflect:!0})],x.prototype,"name",2),A([o()],x.prototype,"src",2),A([o()],x.prototype,"label",2),A([o({reflect:!0})],x.prototype,"library",2),A([o({reflect:!0})],x.prototype,"color",2),A([u("label")],x.prototype,"handleLabelChange",1),A([u(["name","src","library"])],x.prototype,"setIcon",1),x=A([a("sd-1-14-2-icon")],x);export{x as default};
17
+ class g extends b{}g.directiveName="unsafeSVG",g.resultType=2;const y=(v=g,(...t)=>({_$litDirective$:v,values:t}));var v,f=Object.defineProperty,w=Object.getOwnPropertyDescriptor,A=(t,e,r,s)=>{for(var i,o=s>1?void 0:s?w(e,r):e,a=t.length-1;a>=0;a--)(i=t[a])&&(o=(s?i(e,r,o):i(o))||o);return s&&o&&f(e,r,o),o};let $,x=class extends i{constructor(){super(...arguments),this.svg="",this.label="",this.library="default",this.color="currentColor"}connectedCallback(){super.connectedCallback(),l(this)}firstUpdated(){this.setIcon()}disconnectedCallback(){super.disconnectedCallback(),n(this)}getUrl(){const t=c(this.library);return this.name&&t?t.resolver(this.name):this.src}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var t;const e=c(this.library),r=this.getUrl();if($||($=new DOMParser),r)try{const s=await p(r);if(r===this.getUrl())if(s.ok){const r=$.parseFromString(s.svg,"text/html").body.querySelector("svg");null!==r?(null==(t=null==e?void 0:e.mutator)||t.call(e,r),this.svg=r.outerHTML,this.emit("sd-load")):(this.svg="",this.emit("sd-error"))}else this.svg="",this.emit("sd-error")}catch{this.emit("sd-error")}else this.svg.length>0&&(this.svg="")}render(){return r`${y(this.svg)}`}};x.styles=[d,s`:host{display:inline-block;width:1em;height:1em;box-sizing:content-box!important}svg{display:block;height:100%;width:100%}:host([color=primary]) svg{color:rgb(var(--sd-color-primary,0 53 142) / var(--tw-text-opacity,1))}// text-primary :host([color=white]) svg{color:rgb(var(--sd-color-white,255 255 255) / var(--tw-text-opacity,1))}`],A([h()],x.prototype,"svg",2),A([o({reflect:!0})],x.prototype,"name",2),A([o()],x.prototype,"src",2),A([o()],x.prototype,"label",2),A([o({reflect:!0})],x.prototype,"library",2),A([o({reflect:!0})],x.prototype,"color",2),A([u("label")],x.prototype,"handleLabelChange",1),A([u(["name","src","library"])],x.prototype,"setIcon",1),x=A([a("sd-1-14-4-icon")],x);export{x as default};
@@ -1 +1 @@
1
- import{S as t,n as e,e as r}from"./solid-element.js";import{x as s}from"./lit-element.js";import{requestInclude as o}from"./request2.js";import{w as i}from"./watch.js";import a from"./include.styles.js";import"./component.styles.js";var c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,n=(t,e,r,s)=>{for(var o,i=s>1?void 0:s?l(e,r):e,a=t.length-1;a>=0;a--)(o=t[a])&&(i=(s?o(e,r,i):o(i))||i);return s&&i&&c(e,r,i),i};let p=class extends t{constructor(){super(...arguments),this.mode="cors",this.allowScripts=!1}executeScript(t){const e=document.createElement("script");[...t.attributes].forEach((t=>e.setAttribute(t.name,t.value))),e.textContent=t.textContent,t.parentNode.replaceChild(e,t)}async handleSrcChange(){try{const t=this.src,e=await o(t,this.mode);if(t!==this.src)return;if(!e.ok)return void this.emit("sd-error",{detail:{status:e.status}});this.innerHTML=e.html,this.allowScripts&&[...this.querySelectorAll("script")].forEach((t=>this.executeScript(t))),this.emit("sd-load")}catch{this.emit("sd-error",{detail:{status:-1}})}}render(){return s`<slot></slot>`}};p.styles=a,n([e()],p.prototype,"src",2),n([e()],p.prototype,"mode",2),n([e({attribute:"allow-scripts",type:Boolean})],p.prototype,"allowScripts",2),n([i("src")],p.prototype,"handleSrcChange",1),p=n([r("sd-1-14-2-include")],p);export{p as default};
1
+ import{S as t,n as e,c as r}from"./solid-element.js";import{x as s}from"./lit-element.js";import{requestInclude as o}from"./request2.js";import{w as i}from"./watch.js";import c from"./include.styles.js";import"./component.styles.js";var a=Object.defineProperty,l=Object.getOwnPropertyDescriptor,n=(t,e,r,s)=>{for(var o,i=s>1?void 0:s?l(e,r):e,c=t.length-1;c>=0;c--)(o=t[c])&&(i=(s?o(e,r,i):o(i))||i);return s&&i&&a(e,r,i),i};let p=class extends t{constructor(){super(...arguments),this.mode="cors",this.allowScripts=!1}executeScript(t){const e=document.createElement("script");[...t.attributes].forEach((t=>e.setAttribute(t.name,t.value))),e.textContent=t.textContent,t.parentNode.replaceChild(e,t)}async handleSrcChange(){try{const t=this.src,e=await o(t,this.mode);if(t!==this.src)return;if(!e.ok)return void this.emit("sd-error",{detail:{status:e.status}});this.innerHTML=e.html,this.allowScripts&&[...this.querySelectorAll("script")].forEach((t=>this.executeScript(t))),this.emit("sd-load")}catch{this.emit("sd-error",{detail:{status:-1}})}}render(){return s`<slot></slot>`}};p.styles=c,n([e()],p.prototype,"src",2),n([e()],p.prototype,"mode",2),n([e({attribute:"allow-scripts",type:Boolean})],p.prototype,"allowScripts",2),n([i("src")],p.prototype,"handleSrcChange",1),p=n([r("sd-1-14-4-include")],p);export{p as default};
@@ -1 +1 @@
1
- import{x as t,i as e}from"./lit-element.js";import{S as s,n as i,e as o}from"./solid-element.js";import{i as r}from"./query.js";import{H as l}from"./slot.js";import{l as n}from"./if-defined.js";import{t as a}from"./classix.js";var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,m=(t,e,s,i)=>{for(var o,r=i>1?void 0:i?d(e,s):e,l=t.length-1;l>=0;l--)(o=t[l])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&h(e,s,r),r};let f=class extends s{constructor(){super(...arguments),this.hasSlotController=new l(this,"[default]","icon-left","icon-right"),this.size="inherit",this.inverted=!1,this.standalone=!1,this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}focus(t){this.button.focus(t)}blur(){this.button.blur()}render(){const e={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right")};return t`<a part="base" class="${a("inline",this.href?"cursor-pointer":"",{sm:"text-sm",lg:"text-base",inherit:""}[this.size],{disabled:this.inverted?"text-neutral-600":"text-neutral-500",enabled:this.inverted?"text-white hover:text-primary-200 active:text-primary-400 focus-visible:focus-outline-inverted":" text-primary hover:text-primary-500 active:text-primary-800 focus-visible:focus-outline"}[this.href?"enabled":"disabled"],this.standalone&&"flex items-start")}" href="${n(this.href||void 0)}" target="${n(this.target||void 0)}" download="${n(this.download||void 0)}" rel="${n(this.target?"noreferrer noopener":void 0)}" aria-disabled="${this.href?"false":"true"}" tabindex="${this.href?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"><slot name="icon-left" part="icon-left" class="${a("inline",e["icon-left"]&&(this.standalone?{sm:"mr-1",lg:"mr-2",inherit:"mr-[0.5em]"}[this.size]:"mr-[0.25em]"))}"></slot><span part="label" class="inline underline underline-offset-2"><slot></slot></span><slot name="icon-right" part="icon-right" class="${a("inline",e["icon-right"]&&(this.standalone?{sm:"ml-1",lg:"ml-2",inherit:"ml-[0.5em]"}[this.size]:"ml-[0.25em]"))}"></slot></a>`}};f.styles=[s.styles,e`::slotted(sd-1-14-2-icon){font-size:1.25em;margin-bottom:-.25em}:host([size=sm][standalone]) ::slotted(sd-1-14-2-icon){font-size:1rem}:host([size=lg][standalone]) ::slotted(sd-1-14-2-icon){font-size:1.5rem}`],m([r("a")],f.prototype,"button",2),m([i({reflect:!0})],f.prototype,"size",2),m([i({type:Boolean,reflect:!0})],f.prototype,"inverted",2),m([i({type:Boolean,reflect:!0})],f.prototype,"standalone",2),m([i()],f.prototype,"href",2),m([i()],f.prototype,"target",2),m([i()],f.prototype,"download",2),f=m([o("sd-1-14-2-link")],f);export{f as default};
1
+ import{x as t,i as e}from"./lit-element.js";import{S as s,n as i,c as o}from"./solid-element.js";import{H as r}from"./slot.js";import{l}from"./if-defined.js";import{i as n}from"./query.js";import{t as a}from"./classix.js";var h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,m=(t,e,s,i)=>{for(var o,r=i>1?void 0:i?d(e,s):e,l=t.length-1;l>=0;l--)(o=t[l])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&h(e,s,r),r};let f=class extends s{constructor(){super(...arguments),this.hasSlotController=new r(this,"[default]","icon-left","icon-right"),this.size="inherit",this.inverted=!1,this.standalone=!1,this.href=""}handleBlur(){this.emit("sd-blur")}handleFocus(){this.emit("sd-focus")}focus(t){this.button.focus(t)}blur(){this.button.blur()}render(){const e={label:this.hasSlotController.test("[default]"),"icon-left":this.hasSlotController.test("icon-left"),"icon-right":this.hasSlotController.test("icon-right")};return t`<a part="base" class="${a("inline",this.href?"cursor-pointer":"",{sm:"text-sm",lg:"text-base",inherit:""}[this.size],{disabled:this.inverted?"text-neutral-600":"text-neutral-500",enabled:this.inverted?"text-white hover:text-primary-200 active:text-primary-400 focus-visible:focus-outline-inverted":" text-primary hover:text-primary-500 active:text-primary-800 focus-visible:focus-outline"}[this.href?"enabled":"disabled"],this.standalone&&"flex items-start")}" href="${l(this.href||void 0)}" target="${l(this.target||void 0)}" download="${l(this.download||void 0)}" rel="${l(this.target?"noreferrer noopener":void 0)}" aria-disabled="${this.href?"false":"true"}" tabindex="${this.href?"0":"-1"}" @blur="${this.handleBlur}" @focus="${this.handleFocus}"><slot name="icon-left" part="icon-left" class="${a("inline",e["icon-left"]&&(this.standalone?{sm:"mr-1",lg:"mr-2",inherit:"mr-[0.5em]"}[this.size]:"mr-[0.25em]"))}"></slot><span part="label" class="inline underline underline-offset-2"><slot></slot></span><slot name="icon-right" part="icon-right" class="${a("inline",e["icon-right"]&&(this.standalone?{sm:"ml-1",lg:"ml-2",inherit:"ml-[0.5em]"}[this.size]:"ml-[0.25em]"))}"></slot></a>`}};f.styles=[s.styles,e`::slotted(sd-1-14-4-icon){font-size:1.25em;margin-bottom:-.25em}:host([size=sm][standalone]) ::slotted(sd-1-14-4-icon){font-size:1rem}:host([size=lg][standalone]) ::slotted(sd-1-14-4-icon){font-size:1.5rem}`],m([n("a")],f.prototype,"button",2),m([i({reflect:!0})],f.prototype,"size",2),m([i({type:Boolean,reflect:!0})],f.prototype,"inverted",2),m([i({type:Boolean,reflect:!0})],f.prototype,"standalone",2),m([i()],f.prototype,"href",2),m([i()],f.prototype,"target",2),m([i()],f.prototype,"download",2),f=m([o("sd-1-14-4-link")],f);export{f as default};