@solid-design-system/components 1.3.13 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/components/es/accordion-group.js +1 -0
  2. package/dist/components/es/accordion.js +1 -0
  3. package/dist/components/es/brandshape.js +1 -0
  4. package/dist/components/es/button.js +2 -121
  5. package/dist/components/es/divider.js +1 -0
  6. package/dist/components/es/icon.js +3 -3
  7. package/dist/components/es/if-defined.js +2 -7
  8. package/dist/components/es/link.js +1 -1
  9. package/dist/components/es/query.js +6 -0
  10. package/dist/components/es/slot.js +1 -0
  11. package/dist/components/es/solid-components.js +1 -1
  12. package/dist/components/es/solid-components2.js +1 -0
  13. package/dist/components/es/solid-element.js +1 -1
  14. package/dist/components/es/spinner.js +1 -1
  15. package/dist/components/es/teaser.js +1 -0
  16. package/dist/components/umd/solid-components.js +21 -140
  17. package/dist/custom-elements.json +1 -1
  18. package/dist/package/components/accordion/accordion.d.ts +23 -0
  19. package/dist/package/components/accordion/accordion.js +152 -0
  20. package/dist/package/components/accordion-group/accordion-group.d.ts +16 -0
  21. package/dist/package/components/accordion-group/accordion-group.js +63 -0
  22. package/dist/package/components/brandshape/brandshape.d.ts +26 -0
  23. package/dist/package/components/brandshape/brandshape.js +115 -0
  24. package/dist/package/components/button/button.d.ts +1 -1
  25. package/dist/package/components/button/button.js +8 -127
  26. package/dist/package/components/divider/divider.d.ts +13 -0
  27. package/dist/package/components/divider/divider.js +50 -0
  28. package/dist/package/components/icon/icon.d.ts +1 -1
  29. package/dist/package/components/icon/icon.js +1 -1
  30. package/dist/package/components/icon/library.js +18 -0
  31. package/dist/package/components/include/include.d.ts +1 -1
  32. package/dist/package/components/link/link.d.ts +1 -1
  33. package/dist/package/components/spinner/spinner.d.ts +1 -1
  34. package/dist/package/components/spinner/spinner.js +1 -1
  35. package/dist/package/components/teaser/teaser.d.ts +17 -0
  36. package/dist/package/components/teaser/teaser.js +104 -0
  37. package/dist/package/internal/animate.d.ts +10 -0
  38. package/dist/package/internal/animate.js +41 -0
  39. package/dist/package/internal/event.d.ts +1 -0
  40. package/dist/package/internal/event.js +14 -0
  41. package/dist/package/solid-components.d.ts +6 -0
  42. package/dist/package/solid-components.js +23 -10
  43. package/dist/package/styles/tailwind.css.js +1 -1
  44. package/dist/package/utilities/animation-registry.d.ts +14 -0
  45. package/dist/package/utilities/animation-registry.js +35 -0
  46. package/dist/versioned-components/es/accordion-group.js +1 -0
  47. package/dist/versioned-components/es/accordion.js +1 -0
  48. package/dist/versioned-components/es/brandshape.js +1 -0
  49. package/dist/versioned-components/es/button.js +2 -121
  50. package/dist/versioned-components/es/divider.js +1 -0
  51. package/dist/versioned-components/es/icon.js +3 -3
  52. package/dist/versioned-components/es/if-defined.js +2 -7
  53. package/dist/versioned-components/es/include.js +1 -1
  54. package/dist/versioned-components/es/link.js +1 -1
  55. package/dist/versioned-components/es/query.js +6 -0
  56. package/dist/versioned-components/es/slot.js +1 -0
  57. package/dist/versioned-components/es/solid-components.js +1 -1
  58. package/dist/versioned-components/es/solid-components2.js +1 -0
  59. package/dist/versioned-components/es/solid-element.js +1 -1
  60. package/dist/versioned-components/es/spinner.js +1 -1
  61. package/dist/versioned-components/es/teaser.js +1 -0
  62. package/dist/versioned-package/components/accordion/accordion.d.ts +23 -0
  63. package/dist/versioned-package/components/accordion/accordion.js +152 -0
  64. package/dist/versioned-package/components/accordion-group/accordion-group.d.ts +16 -0
  65. package/dist/versioned-package/components/accordion-group/accordion-group.js +63 -0
  66. package/dist/versioned-package/components/brandshape/brandshape.d.ts +26 -0
  67. package/dist/versioned-package/components/brandshape/brandshape.js +115 -0
  68. package/dist/versioned-package/components/button/button.d.ts +2 -2
  69. package/dist/versioned-package/components/button/button.js +10 -129
  70. package/dist/versioned-package/components/divider/divider.d.ts +13 -0
  71. package/dist/versioned-package/components/divider/divider.js +50 -0
  72. package/dist/versioned-package/components/icon/icon.d.ts +2 -2
  73. package/dist/versioned-package/components/icon/icon.js +2 -2
  74. package/dist/versioned-package/components/icon/library.js +18 -0
  75. package/dist/versioned-package/components/include/include.d.ts +2 -2
  76. package/dist/versioned-package/components/include/include.js +1 -1
  77. package/dist/versioned-package/components/link/link.d.ts +2 -2
  78. package/dist/versioned-package/components/link/link.js +2 -2
  79. package/dist/versioned-package/components/spinner/spinner.d.ts +2 -2
  80. package/dist/versioned-package/components/spinner/spinner.js +2 -2
  81. package/dist/versioned-package/components/teaser/teaser.d.ts +17 -0
  82. package/dist/versioned-package/components/teaser/teaser.js +104 -0
  83. package/dist/versioned-package/internal/animate.d.ts +10 -0
  84. package/dist/versioned-package/internal/animate.js +41 -0
  85. package/dist/versioned-package/internal/event.d.ts +1 -0
  86. package/dist/versioned-package/internal/event.js +14 -0
  87. package/dist/versioned-package/internal/form.js +1 -1
  88. package/dist/versioned-package/solid-components.d.ts +6 -0
  89. package/dist/versioned-package/solid-components.js +23 -10
  90. package/dist/versioned-package/styles/tailwind.css.js +1 -1
  91. package/dist/versioned-package/utilities/animation-registry.d.ts +14 -0
  92. package/dist/versioned-package/utilities/animation-registry.js +35 -0
  93. package/dist/vscode.html-custom-data.json +259 -5
  94. package/dist/web-types.json +624 -6
  95. package/package.json +22 -27
  96. package/dist/components/es/library.js +0 -1
  97. package/dist/components/es/library.system.js +0 -1
  98. package/dist/versioned-components/es/library.js +0 -1
  99. package/dist/versioned-components/es/library.system.js +0 -1
@@ -0,0 +1,115 @@
1
+ import { css, html } from "lit";
2
+ import { query, property, state, customElement } from "lit/decorators.js";
3
+ import componentStyles from "../../styles/component.styles.js";
4
+ import cx from "classix";
5
+ import SolidElement from "../../internal/solid-element.js";
6
+ var __defProp = Object.defineProperty;
7
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
+ var __decorateClass = (decorators, target, key, kind) => {
9
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
10
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
11
+ if (decorator = decorators[i])
12
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
13
+ if (kind && result)
14
+ __defProp(target, key, result);
15
+ return result;
16
+ };
17
+ let SdBrandshape = class extends SolidElement {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.variant = "primary";
21
+ this.shapes = ["top", "middle", "bottom"];
22
+ this.componentBreakpoint = 0;
23
+ }
24
+ getSvg(breakpoint, shape) {
25
+ return {
26
+ 0: this.smallSvg(shape),
27
+ 414: this.mediumSvg(shape),
28
+ 640: this.largeSvg(shape)
29
+ }[breakpoint];
30
+ }
31
+ largeSvg(shape) {
32
+ return shape === "top" ? html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121" part="shape-top"><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>` : html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 123" part="shape-bottom"><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>`;
33
+ }
34
+ mediumSvg(shape) {
35
+ return shape === "top" ? html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 119" part="shape-top"><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>` : html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 121" part="shape-bottom"><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>`;
36
+ }
37
+ smallSvg(shape) {
38
+ return shape === "top" ? html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 113" part="shape-top"><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>` : html`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 116" part="shape-bottom"><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>`;
39
+ }
40
+ setBreakpoint() {
41
+ switch (true) {
42
+ case this.containerElem.clientWidth <= 414:
43
+ this.componentBreakpoint = 0;
44
+ break;
45
+ case this.containerElem.clientWidth < 640:
46
+ this.componentBreakpoint = 414;
47
+ break;
48
+ default:
49
+ this.componentBreakpoint = 640;
50
+ }
51
+ }
52
+ connectedCallback() {
53
+ super.connectedCallback();
54
+ this.resizeObserver = new ResizeObserver(() => this.setBreakpoint());
55
+ this.updateComplete.then(() => {
56
+ this.setBreakpoint();
57
+ this.resizeObserver.observe(this.containerElem);
58
+ });
59
+ }
60
+ disconnectedCallback() {
61
+ super.disconnectedCallback();
62
+ this.resizeObserver.unobserve(this.containerElem);
63
+ }
64
+ renderTopBrandshape() {
65
+ return this.shapes.length === 1 ? html`<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");
66
+ }
67
+ renderMiddleBrandshape() {
68
+ return html`<div class="${cx(
69
+ { 0: "px-6 py-4", 414: "px-10 py-8", 640: "px-10 py-8" }[this.componentBreakpoint],
70
+ "w-full block relative"
71
+ )}"><div part="shape-middle" class="${cx(
72
+ {
73
+ "neutral-100": "bg-neutral-100",
74
+ primary: "bg-primary",
75
+ white: "bg-white"
76
+ }[this.variant],
77
+ "w-full block absolute h-full top-0 left-0 z-0"
78
+ )}"></div><div class="z-10 relative" part="content"><slot></slot></div></div>`;
79
+ }
80
+ renderBottomBrandshape() {
81
+ return this.getSvg(this.componentBreakpoint, "bottom");
82
+ }
83
+ render() {
84
+ return html`<div class="${cx(
85
+ {
86
+ "neutral-100": "fill-neutral-100",
87
+ primary: "fill-primary",
88
+ white: "fill-white"
89
+ }[this.variant]
90
+ )}" part="base">${this.shapes.includes("top") ? this.renderTopBrandshape() : null} ${this.shapes.includes("middle") ? this.renderMiddleBrandshape() : null} ${this.shapes.includes("bottom") ? this.renderBottomBrandshape() : null}</div>`;
91
+ }
92
+ };
93
+ SdBrandshape.styles = [
94
+ componentStyles,
95
+ SolidElement.styles,
96
+ css`:host{display:block}`
97
+ ];
98
+ __decorateClass([
99
+ query("[part=base]")
100
+ ], SdBrandshape.prototype, "containerElem", 2);
101
+ __decorateClass([
102
+ property({ type: String })
103
+ ], SdBrandshape.prototype, "variant", 2);
104
+ __decorateClass([
105
+ property({ type: Array })
106
+ ], SdBrandshape.prototype, "shapes", 2);
107
+ __decorateClass([
108
+ state()
109
+ ], SdBrandshape.prototype, "componentBreakpoint", 2);
110
+ SdBrandshape = __decorateClass([
111
+ customElement("sd-brandshape")
112
+ ], SdBrandshape);
113
+ export {
114
+ SdBrandshape as default
115
+ };
@@ -38,7 +38,7 @@ export default class SdButton extends SolidElement implements SolidFormControl {
38
38
  checkValidity(): boolean;
39
39
  reportValidity(): boolean;
40
40
  setCustomValidity(message: string): void;
41
- render(): import("lit").TemplateResult;
41
+ render(): import("lit-html").TemplateResult;
42
42
  static styles: import("lit").CSSResultGroup[];
43
43
  }
44
44
  declare global {
@@ -123,10 +123,7 @@ let SdButton = class extends SolidElement {
123
123
  "icon-right": this.hasSlotController.test("icon-right"),
124
124
  "icon-only": this._iconsInDefaultSlot.length > 0
125
125
  };
126
- return html`
127
- <${tag}
128
- part="base"
129
- class=${cx(
126
+ return html`<${tag} part="base" class="${cx(
130
127
  `font-md leading-[calc(var(--tw-varspacing)-2px)] no-underline
131
128
  w-full h-varspacing whitespace-nowrap align-middle inline-flex items-stretch justify-center
132
129
  border transition-colors duration-200 ease-in-out rounded-md
@@ -168,28 +165,11 @@ let SdButton = class extends SolidElement {
168
165
  active:text-primary-200 active:bg-primary-800
169
166
  disabled:text-neutral-600`,
170
167
  cta: `text-white bg-accent border-transparent
171
- hover:bg-accent-300
172
- active:bg-accent-500
168
+ hover:bg-accent-550
169
+ active:bg-accent-700
173
170
  ${!this.inverted ? "disabled:bg-neutral-500" : "disabled:bg-neutral-600"} disabled:text-white`
174
171
  }[this.variant]
175
- )}
176
- ?disabled=${ifDefined(isLink ? void 0 : this.disabled)}
177
- type=${ifDefined(isLink ? void 0 : this.type)}
178
- title=${this.title}
179
- name=${ifDefined(isLink ? void 0 : this.name)}
180
- value=${ifDefined(isLink ? void 0 : this.value)}
181
- href=${ifDefined(isLink ? this.href : void 0)}
182
- target=${ifDefined(isLink ? this.target : void 0)}
183
- download=${ifDefined(isLink ? this.download : void 0)}
184
- rel=${ifDefined(isLink && this.target ? "noreferrer noopener" : void 0)}
185
- role=${ifDefined(isLink ? void 0 : "button")}
186
- aria-disabled=${this.disabled ? "true" : "false"}
187
- tabindex=${this.disabled ? "-1" : "0"}
188
- @blur=${this.handleBlur}
189
- @focus=${this.handleFocus}
190
- @click=${this.handleClick}
191
- >
192
- <slot name="icon-left" part="icon-left" class=${cx(
172
+ )}" ?disabled="${ifDefined(isLink ? void 0 : this.disabled)}" type="${ifDefined(isLink ? void 0 : this.type)}" title="${this.title}" name="${ifDefined(isLink ? void 0 : this.name)}" value="${ifDefined(isLink ? void 0 : this.value)}" href="${ifDefined(isLink ? this.href : void 0)}" target="${ifDefined(isLink ? this.target : void 0)}" download="${ifDefined(isLink ? this.download : void 0)}" rel="${ifDefined(isLink && this.target ? "noreferrer noopener" : void 0)}" role="${ifDefined(isLink ? 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="${cx(
193
173
  "flex flex-auto items-center pointer-events-none",
194
174
  slots["icon-only"] && "hidden",
195
175
  this.loading && "invisible",
@@ -198,14 +178,10 @@ let SdButton = class extends SolidElement {
198
178
  md: "mr-2",
199
179
  lg: "mr-2"
200
180
  }[this.size]
201
- )}></slot>
202
- <slot part="label" class=${cx(
181
+ )}"></slot><slot part="label" class="${cx(
203
182
  slots["icon-only"] ? "flex flex-auto items-center pointer-events-none" : "inline-block",
204
183
  this.loading && "invisible"
205
- )}></slot>
206
- <slot name="icon-right"
207
- part="icon-right"
208
- class=${cx(
184
+ )}"></slot><slot name="icon-right" part="icon-right" class="${cx(
209
185
  "flex flex-auto items-center pointer-events-none",
210
186
  this.loading && "invisible",
211
187
  slots["icon-only"] && "hidden",
@@ -214,108 +190,13 @@ let SdButton = class extends SolidElement {
214
190
  md: "ml-2",
215
191
  lg: "ml-2"
216
192
  }[this.size]
217
- )}>
218
- </slot>
219
- ${this.loading ? html`<sd-spinner
220
- class="${cx("absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2")}"
221
- ></sd-spinner>` : ""}
222
- </${tag}>
223
- `;
193
+ )}"></slot>${this.loading ? html`<sd-spinner class="${cx("absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2")}"></sd-spinner>` : ""}</${tag}>`;
224
194
  }
225
195
  };
226
196
  SdButton.styles = [
227
197
  componentStyles,
228
198
  SolidElement.styles,
229
- css`
230
- :host {
231
- display: inline-block;
232
- position: relative;
233
- width: auto;
234
- cursor: pointer;
235
- }
236
-
237
- sd-spinner {
238
- --indicator-color: currentColor;
239
- --track-color: var(--tw-varcolor-200);
240
- }
241
-
242
- /*
243
- * Badges:
244
- * Slotted badges are positioned absolutely in the top right corner of the button.
245
- */
246
-
247
- ::slotted(sd-badge) {
248
- position: absolute;
249
- top: 0;
250
- right: 0;
251
- translate: 50% -50%;
252
- pointer-events: none;
253
- }
254
-
255
- /**
256
- * sd-icons should automatically resize correctly based on the button size.
257
- */
258
-
259
- ::slotted(sd-icon),
260
- sd-spinner {
261
- font-size: calc(var(--tw-varspacing) / 2);
262
- }
263
-
264
- ///*
265
- // * Button groups support a variety of button types (e.g. buttons with tooltips, buttons as dropdown triggers, etc.).
266
- // * This means buttons aren't always direct descendants of the button group, thus we can't target them with the
267
- // * ::slotted selector. To work around this, the button group component does some magic to add these special classes to
268
- // * buttons and we style them here instead.
269
- // */
270
-
271
- // :host(.sd-button-group__button--first:not(.sd-button-group__button--last)) .button {
272
- // border-start-end-radius: 0;
273
- // border-end-end-radius: 0;
274
- // }
275
-
276
- // :host(.sd-button-group__button--inner) .button {
277
- // border-radius: 0;
278
- // }
279
-
280
- // :host(.sd-button-group__button--last:not(.sd-button-group__button--first)) .button {
281
- // border-start-start-radius: 0;
282
- // border-end-start-radius: 0;
283
- // }
284
-
285
- // /* All except the first */
286
- // :host(.sd-button-group__button:not(.sd-button-group__button--first)) {
287
- // margin-inline-start: calc(-1 * var(--sd-input-border-width));
288
- // }
289
-
290
- // /* Add a visual separator between solid buttons */
291
- // :host(
292
- // .sd-button-group__button:not(
293
- // .sd-button-group__button--first,
294
- // .sd-button-group__button--radio,
295
- // [variant='default']
296
- // ):not(:hover)
297
- // )
298
- // .button:after {
299
- // content: '';
300
- // position: absolute;
301
- // top: 0;
302
- // inset-inline-start: 0;
303
- // bottom: 0;
304
- // border-left: solid 1px rgb(128 128 128 / 33%);
305
- // mix-blend-mode: multiply;
306
- // }
307
-
308
- // /* Bump hovered, focused, and checked buttons up so their focus ring isn't clipped */
309
- // :host(.sd-button-group__button--hover) {
310
- // z-index: 1;
311
- // }
312
-
313
- // /* Focus and checked are always on top */
314
- // :host(.sd-button-group__button--focus),
315
- // :host(.sd-button-group__button[checked]) {
316
- // z-index: 2;
317
- // }
318
- `
199
+ css`:host{display:inline-block;position:relative;width:auto;cursor:pointer}sd-spinner{--indicator-color:currentColor;--track-color:var(--tw-varcolor-200)}::slotted(sd-badge){position:absolute;top:0;right:0;translate:50% -50%;pointer-events:none}::slotted(sd-icon),sd-spinner{font-size:calc(var(--tw-varspacing)/ 2)}`
319
200
  ];
320
201
  __decorateClass([
321
202
  query("a, button")
@@ -0,0 +1,13 @@
1
+ import SolidElement from '../../internal/solid-element';
2
+ export default class SdDivider extends SolidElement {
3
+ orientation: 'horizontal' | 'vertical';
4
+ inverted: boolean;
5
+ connectedCallback(): void;
6
+ render(): import("lit-html").TemplateResult<1>;
7
+ static styles: import("lit").CSSResultGroup[];
8
+ }
9
+ declare global {
10
+ interface HTMLElementTagNameMap {
11
+ 'sd-divider': SdDivider;
12
+ }
13
+ }
@@ -0,0 +1,50 @@
1
+ import { css, html } from "lit";
2
+ import { property, customElement } from "lit/decorators.js";
3
+ import componentStyles from "../../styles/component.styles.js";
4
+ import cx from "classix";
5
+ import SolidElement from "../../internal/solid-element.js";
6
+ var __defProp = Object.defineProperty;
7
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
+ var __decorateClass = (decorators, target, key, kind) => {
9
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
10
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
11
+ if (decorator = decorators[i])
12
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
13
+ if (kind && result)
14
+ __defProp(target, key, result);
15
+ return result;
16
+ };
17
+ let SdDivider = class extends SolidElement {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.orientation = "horizontal";
21
+ this.inverted = false;
22
+ }
23
+ connectedCallback() {
24
+ super.connectedCallback();
25
+ this.setAttribute("role", "separator");
26
+ }
27
+ render() {
28
+ return html`<hr part="main" class="${cx(
29
+ this.inverted ? "border-primary-400" : "border-neutral-400",
30
+ this.orientation === "horizontal" ? "border-t w-full" : " border-l h-full"
31
+ )}">`;
32
+ }
33
+ };
34
+ SdDivider.styles = [
35
+ componentStyles,
36
+ SolidElement.styles,
37
+ css`:host{margin:0}:host(sd-divider[orientation=horizontal]){display:block}:host(sd-divider[orientation=vertical]){display:inline-block}`
38
+ ];
39
+ __decorateClass([
40
+ property({ reflect: true })
41
+ ], SdDivider.prototype, "orientation", 2);
42
+ __decorateClass([
43
+ property({ type: Boolean, reflect: true })
44
+ ], SdDivider.prototype, "inverted", 2);
45
+ SdDivider = __decorateClass([
46
+ customElement("sd-divider")
47
+ ], SdDivider);
48
+ export {
49
+ SdDivider as default
50
+ };
@@ -12,7 +12,7 @@ export default class SdIcon extends SolidElement {
12
12
  private getUrl;
13
13
  handleLabelChange(): void;
14
14
  setIcon(): Promise<void>;
15
- render(): import("lit").TemplateResult<1>;
15
+ render(): import("lit-html").TemplateResult<1>;
16
16
  static styles: import("lit").CSSResult[];
17
17
  }
18
18
  declare global {
@@ -1,6 +1,6 @@
1
1
  import { css, html } from "lit";
2
2
  import { state, property, customElement } from "lit/decorators.js";
3
- import { unwatchIcon, getIconLibrary, watchIcon } from "./library.js";
3
+ import { watchIcon, unwatchIcon, getIconLibrary } from "./library.js";
4
4
  import { requestIcon } from "./request.js";
5
5
  import { unsafeSVG } from "lit/directives/unsafe-svg.js";
6
6
  import { watch } from "../../internal/watch.js";
@@ -10,8 +10,26 @@ function unwatchIcon(icon) {
10
10
  function getIconLibrary(name) {
11
11
  return registry.find((lib) => lib.name === name);
12
12
  }
13
+ function registerIconLibrary(name, options) {
14
+ unregisterIconLibrary(name);
15
+ registry.push({
16
+ name,
17
+ resolver: options.resolver,
18
+ mutator: options.mutator
19
+ });
20
+ watchedIcons.forEach((icon) => {
21
+ if (icon.library === name) {
22
+ icon.setIcon();
23
+ }
24
+ });
25
+ }
26
+ function unregisterIconLibrary(name) {
27
+ registry = registry.filter((lib) => lib.name !== name);
28
+ }
13
29
  export {
14
30
  getIconLibrary,
31
+ registerIconLibrary,
32
+ unregisterIconLibrary,
15
33
  unwatchIcon,
16
34
  watchIcon
17
35
  };
@@ -7,7 +7,7 @@ export default class SdInclude extends SolidElement {
7
7
  allowScripts: boolean;
8
8
  private executeScript;
9
9
  handleSrcChange(): Promise<void>;
10
- render(): import("lit").TemplateResult<1>;
10
+ render(): import("lit-html").TemplateResult<1>;
11
11
  }
12
12
  declare global {
13
13
  interface HTMLElementTagNameMap {
@@ -12,7 +12,7 @@ export default class SdLink extends SolidElement {
12
12
  private handleFocus;
13
13
  focus(options?: FocusOptions): void;
14
14
  blur(): void;
15
- render(): import("lit").TemplateResult<1>;
15
+ render(): import("lit-html").TemplateResult<1>;
16
16
  static styles: import("lit").CSSResultGroup[];
17
17
  }
18
18
  declare global {
@@ -2,7 +2,7 @@ import SolidElement from '../../internal/solid-element';
2
2
  export default class SdSpinner extends SolidElement {
3
3
  color: 'primary' | 'white' | 'currentColor';
4
4
  private readonly localize;
5
- render(): import("lit").TemplateResult<1>;
5
+ render(): import("lit-html").TemplateResult<1>;
6
6
  static styles: import("lit").CSSResultGroup[];
7
7
  }
8
8
  declare global {
@@ -28,7 +28,7 @@ let SdSpinner = class extends SolidElement {
28
28
  white: "text-white",
29
29
  currentColor: ""
30
30
  }[this.color]
31
- )}" aria-valuetext="${this.localize.term("loading")}"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" class="opacity-20" fill="currentColor"/><mask id="mask0_5273_25391" style="mask-type:alpha" maskUnits="userSpaceOnUse"><path d="M24 12C24 5.37258 18.6274 0 12 0V12H24Z" fill="currentColor"/></mask><g mask="url(#mask0_5273_25391)"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" fill="currentColor"/></g></svg>`;
31
+ )}" aria-label="${this.localize.term("loading")}"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" class="opacity-20" fill="currentColor"/><mask id="mask0_5273_25391" style="mask-type:alpha" maskUnits="userSpaceOnUse"><path d="M24 12C24 5.37258 18.6274 0 12 0V12H24Z" fill="currentColor"/></mask><g mask="url(#mask0_5273_25391)"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22ZM24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12Z" fill="currentColor"/></g></svg>`;
32
32
  }
33
33
  };
34
34
  SdSpinner.styles = [
@@ -0,0 +1,17 @@
1
+ import SolidElement from '../../internal/solid-element';
2
+ import type { PropertyValues } from 'lit';
3
+ export default class SdTeaser extends SolidElement {
4
+ variant: 'white' | 'white border-neutral-300' | 'neutral-100' | 'primary' | 'primary-100';
5
+ breakpoint: number;
6
+ inset: boolean;
7
+ teaser: HTMLElement;
8
+ private _orientation;
9
+ private readonly hasSlotController;
10
+ private resizeObserver;
11
+ connectedCallback(): void;
12
+ disconnectedCallback(): void;
13
+ updated(changedProperties: PropertyValues): void;
14
+ updateOrientation(): void;
15
+ render(): import("lit-html").TemplateResult<1>;
16
+ static styles: import("lit").CSSResultGroup[];
17
+ }
@@ -0,0 +1,104 @@
1
+ import { css, html } from "lit";
2
+ import { property, query, state, customElement } from "lit/decorators.js";
3
+ import { HasSlotController } from "../../internal/slot.js";
4
+ import cx from "classix";
5
+ import SolidElement from "../../internal/solid-element.js";
6
+ var __defProp = Object.defineProperty;
7
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
+ var __decorateClass = (decorators, target, key, kind) => {
9
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
10
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
11
+ if (decorator = decorators[i])
12
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
13
+ if (kind && result)
14
+ __defProp(target, key, result);
15
+ return result;
16
+ };
17
+ let SdTeaser = class extends SolidElement {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.variant = "white";
21
+ this.breakpoint = 448;
22
+ this.inset = false;
23
+ this.hasSlotController = new HasSlotController(this, "[default]", "media", "meta", "headline");
24
+ }
25
+ connectedCallback() {
26
+ super.connectedCallback();
27
+ if (this.breakpoint === 0) {
28
+ this._orientation = "horizontal";
29
+ } else if (this.breakpoint === 9999) {
30
+ this._orientation = "vertical";
31
+ } else if (window.ResizeObserver) {
32
+ this.resizeObserver = new ResizeObserver(() => this.updateOrientation());
33
+ this.resizeObserver.observe(this);
34
+ }
35
+ }
36
+ disconnectedCallback() {
37
+ super.disconnectedCallback();
38
+ if (this.resizeObserver) {
39
+ this.resizeObserver.disconnect();
40
+ }
41
+ }
42
+ updated(changedProperties) {
43
+ super.updated(changedProperties);
44
+ if (changedProperties.has("breakpoint")) {
45
+ this.updateOrientation();
46
+ }
47
+ }
48
+ updateOrientation() {
49
+ this._orientation = this.offsetWidth >= this.breakpoint ? "horizontal" : "vertical";
50
+ }
51
+ render() {
52
+ if (this.variant === "white border-neutral-300") {
53
+ this.inset = true;
54
+ }
55
+ const slots = {
56
+ "teaser-has-default": this.hasSlotController.test("[default]"),
57
+ "teaser-has-media": this.hasSlotController.test("media"),
58
+ "teaser-has-meta": this.hasSlotController.test("meta"),
59
+ "teaser-has-headline": this.hasSlotController.test("headline")
60
+ };
61
+ return html`<div class="${cx(
62
+ "flex",
63
+ {
64
+ white: "bg-white",
65
+ "white border-neutral-300": "bg-white border border-neutral-300",
66
+ "neutral-100": "bg-neutral-100",
67
+ primary: "bg-primary text-white",
68
+ "primary-100": "bg-primary-100"
69
+ }[this.variant],
70
+ this._orientation === "vertical" && "flex-col",
71
+ this._orientation === "horizontal" && "flex-row gap-8",
72
+ this._orientation === "horizontal" && this.inset && "py-8 px-10"
73
+ )}" part="base"><div style="${this._orientation === "horizontal" ? `width: var(--distribution-media, 100%);` : ""}" class="${cx(!this.inset && this._orientation === "vertical" && "mb-4", !slots["teaser-has-media"] && "hidden")}" part="media"><slot name="media"></slot></div><div style="${this._orientation === "horizontal" ? `width: var(--distribution-content, 100%); ${this.inset ? "width: var(--distribution-content, calc(100% - 2rem));" : ""}` : ""}" class="${cx(
74
+ "flex flex-col text-left",
75
+ this._orientation === "horizontal" && `flex flex-col`,
76
+ this._orientation === "vertical" && this.inset && "m-4"
77
+ )}" part="content"><div part="meta" class="${cx("gap-2 mb-4", !slots["teaser-has-meta"] && "hidden")}"><slot name="meta"></slot></div><div part="headline" class="${cx("text-lg font-bold m-0", this.variant === "primary" ? "text-white" : "text-black")}"><slot name="headline">Always insert one semantically correct heading element here (e. g. &lt;h2>)</slot></div><div part="main" class="${cx(!slots["teaser-has-default"] && "hidden")}"><slot></slot></div></div></div>`;
78
+ }
79
+ };
80
+ SdTeaser.styles = [
81
+ SolidElement.styles,
82
+ css`:host{display:block}::slotted(*){margin:0}::slotted([slot=headline]){font-size:var(--sd-font-size-lg,1.25rem)!important;font-weight:700;margin:0!important}`
83
+ ];
84
+ __decorateClass([
85
+ property({ reflect: true })
86
+ ], SdTeaser.prototype, "variant", 2);
87
+ __decorateClass([
88
+ property({ reflect: true, type: Number })
89
+ ], SdTeaser.prototype, "breakpoint", 2);
90
+ __decorateClass([
91
+ property({ type: Boolean, reflect: true })
92
+ ], SdTeaser.prototype, "inset", 2);
93
+ __decorateClass([
94
+ query('[part="base"]')
95
+ ], SdTeaser.prototype, "teaser", 2);
96
+ __decorateClass([
97
+ state()
98
+ ], SdTeaser.prototype, "_orientation", 2);
99
+ SdTeaser = __decorateClass([
100
+ customElement("sd-teaser")
101
+ ], SdTeaser);
102
+ export {
103
+ SdTeaser as default
104
+ };
@@ -0,0 +1,10 @@
1
+ export declare function animateTo(el: HTMLElement, keyframes: Keyframe[], options?: KeyframeAnimationOptions): Promise<unknown>;
2
+ export declare function parseDuration(delay: number | string): number;
3
+ export declare function prefersReducedMotion(): boolean;
4
+ export declare function stopAnimations(el: HTMLElement): Promise<unknown[]>;
5
+ export declare function shimKeyframesHeightAuto(keyframes: Keyframe[], calculatedHeight: number): {
6
+ height: string | number | null | undefined;
7
+ composite?: CompositeOperationOrAuto | undefined;
8
+ easing?: string | undefined;
9
+ offset?: number | null | undefined;
10
+ }[];
@@ -0,0 +1,41 @@
1
+ function animateTo(el, keyframes, options) {
2
+ return new Promise((resolve) => {
3
+ if ((options == null ? void 0 : options.duration) === Infinity) {
4
+ throw new Error("Promise-based animations must be finite.");
5
+ }
6
+ const animation = el.animate(keyframes, {
7
+ ...options,
8
+ duration: prefersReducedMotion() ? 0 : options.duration
9
+ });
10
+ animation.addEventListener("cancel", resolve, { once: true });
11
+ animation.addEventListener("finish", resolve, { once: true });
12
+ });
13
+ }
14
+ function prefersReducedMotion() {
15
+ const query = window.matchMedia("(prefers-reduced-motion: reduce)");
16
+ return query.matches;
17
+ }
18
+ function stopAnimations(el) {
19
+ return Promise.all(
20
+ el.getAnimations().map((animation) => {
21
+ return new Promise((resolve) => {
22
+ const handleAnimationEvent = requestAnimationFrame(resolve);
23
+ animation.addEventListener("cancel", () => handleAnimationEvent, { once: true });
24
+ animation.addEventListener("finish", () => handleAnimationEvent, { once: true });
25
+ animation.cancel();
26
+ });
27
+ })
28
+ );
29
+ }
30
+ function shimKeyframesHeightAuto(keyframes, calculatedHeight) {
31
+ return keyframes.map((keyframe) => ({
32
+ ...keyframe,
33
+ height: keyframe.height === "auto" ? `${calculatedHeight}px` : keyframe.height
34
+ }));
35
+ }
36
+ export {
37
+ animateTo,
38
+ prefersReducedMotion,
39
+ shimKeyframesHeightAuto,
40
+ stopAnimations
41
+ };
@@ -0,0 +1 @@
1
+ export declare function waitForEvent(el: HTMLElement, eventName: string): Promise<void>;
@@ -0,0 +1,14 @@
1
+ function waitForEvent(el, eventName) {
2
+ return new Promise((resolve) => {
3
+ function done(event) {
4
+ if (event.target === el) {
5
+ el.removeEventListener(eventName, done);
6
+ resolve();
7
+ }
8
+ }
9
+ el.addEventListener(eventName, done);
10
+ });
11
+ }
12
+ export {
13
+ waitForEvent
14
+ };
@@ -1,6 +1,12 @@
1
+ export { default as SdAccordion } from './components/accordion/accordion';
2
+ export { default as SdAccordionGroup } from './components/accordion-group/accordion-group';
3
+ export { default as SdBrandshape } from './components/brandshape/brandshape';
1
4
  export { default as SdButton } from './components/button/button';
5
+ export { default as SdDivider } from './components/divider/divider';
2
6
  export { default as SdIcon } from './components/icon/icon';
3
7
  export { default as SdInclude } from './components/include/include';
4
8
  export { default as SdLink } from './components/link/link';
5
9
  export { default as SdSpinner } from './components/spinner/spinner';
10
+ export { default as SdTeaser } from './components/teaser/teaser';
11
+ export * from './utilities/icon-library';
6
12
  export * from './utilities/localize';