@mhmo91/schmancy 0.10.38 → 0.10.40

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 (111) hide show
  1. package/dist/agent/schmancy.agent.js +19 -7
  2. package/dist/agent/schmancy.agent.js.map +1 -1
  3. package/dist/avatar.cjs +1 -1
  4. package/dist/avatar.js +1 -1
  5. package/dist/badge.cjs +1 -1
  6. package/dist/badge.js +1 -1
  7. package/dist/boat-BJPl_Jti.cjs +34 -0
  8. package/dist/boat-BJPl_Jti.cjs.map +1 -0
  9. package/dist/{boat-DmyG7y1V.js → boat-BeqA9_ms.js} +10 -5
  10. package/dist/boat-BeqA9_ms.js.map +1 -0
  11. package/dist/boat.cjs +1 -1
  12. package/dist/boat.js +1 -1
  13. package/dist/{button-WRmXlNyw.cjs → button-B9RfBt-n.cjs} +1 -0
  14. package/dist/button-B9RfBt-n.cjs.map +1 -0
  15. package/dist/{button-BQSOVnHn.js → button-D6LJC-HC.js} +1 -0
  16. package/dist/button-D6LJC-HC.js.map +1 -0
  17. package/dist/button.cjs +2 -1
  18. package/dist/button.cjs.map +1 -1
  19. package/dist/button.js +2 -1
  20. package/dist/button.js.map +1 -1
  21. package/dist/{chips-DAy6v93f.js → chips-BoZSpSh_.js} +1 -0
  22. package/dist/chips-BoZSpSh_.js.map +1 -0
  23. package/dist/{chips-B1jui8Pe.cjs → chips-wfJ7YtWv.cjs} +1 -0
  24. package/dist/chips-wfJ7YtWv.cjs.map +1 -0
  25. package/dist/chips.cjs +1 -1
  26. package/dist/chips.js +1 -1
  27. package/dist/content-drawer.cjs +1 -1
  28. package/dist/content-drawer.js +1 -1
  29. package/dist/{date-range-BUaPgbTZ.cjs → date-range-BHSzlwSL.cjs} +1 -1
  30. package/dist/{date-range-BUaPgbTZ.cjs.map → date-range-BHSzlwSL.cjs.map} +1 -1
  31. package/dist/{date-range-NTpoA1in.js → date-range-DJrdpzev.js} +1 -1
  32. package/dist/{date-range-NTpoA1in.js.map → date-range-DJrdpzev.js.map} +1 -1
  33. package/dist/date-range.cjs +1 -1
  34. package/dist/date-range.js +1 -1
  35. package/dist/{directives-Bb0S1DKZ.cjs → directives-BZIRQDBq.cjs} +1 -1
  36. package/dist/{directives-Bb0S1DKZ.cjs.map → directives-BZIRQDBq.cjs.map} +1 -1
  37. package/dist/{directives-Bfm1lkoy.js → directives-BvRTjCFa.js} +5 -3
  38. package/dist/{directives-Bfm1lkoy.js.map → directives-BvRTjCFa.js.map} +1 -1
  39. package/dist/directives.cjs +1 -1
  40. package/dist/directives.js +1 -1
  41. package/dist/fab.cjs +1 -0
  42. package/dist/fab.cjs.map +1 -1
  43. package/dist/fab.js +1 -0
  44. package/dist/fab.js.map +1 -1
  45. package/dist/form.cjs +1 -1
  46. package/dist/form.js +3 -3
  47. package/dist/handover/agent-runtime-followups.md +1 -1
  48. package/dist/handover/agent-runtime-v1.md +3 -3
  49. package/dist/index.cjs +1 -1
  50. package/dist/index.js +10 -10
  51. package/dist/{menu-CBAAJoHu.js → menu-Dvi_tQgH.js} +1 -1
  52. package/dist/{menu-CBAAJoHu.js.map → menu-Dvi_tQgH.js.map} +1 -1
  53. package/dist/{menu-DFQjJk3H.cjs → menu-GZARYp6I.cjs} +1 -1
  54. package/dist/{menu-DFQjJk3H.cjs.map → menu-GZARYp6I.cjs.map} +1 -1
  55. package/dist/menu.cjs +1 -1
  56. package/dist/menu.js +1 -1
  57. package/dist/nav-drawer.cjs +1 -1
  58. package/dist/nav-drawer.js +1 -1
  59. package/dist/navigation-bar.cjs +1 -1
  60. package/dist/navigation-bar.js +1 -1
  61. package/dist/{overlay-CWsihJ-E.js → overlay-DwJWVyk2.js} +2 -2
  62. package/dist/{overlay-CWsihJ-E.js.map → overlay-DwJWVyk2.js.map} +1 -1
  63. package/dist/{overlay-DkIX9Ig3.cjs → overlay-N0trD-4u.cjs} +1 -1
  64. package/dist/{overlay-DkIX9Ig3.cjs.map → overlay-N0trD-4u.cjs.map} +1 -1
  65. package/dist/overlay.cjs +1 -1
  66. package/dist/{overlay.confirm-body-DwTfiNlV.cjs → overlay.confirm-body-CtXIi421.cjs} +1 -1
  67. package/dist/{overlay.confirm-body-DwTfiNlV.cjs.map → overlay.confirm-body-CtXIi421.cjs.map} +1 -1
  68. package/dist/{overlay.confirm-body-CPqqPNks.js → overlay.confirm-body-DwzKhXxM.js} +1 -1
  69. package/dist/{overlay.confirm-body-CPqqPNks.js.map → overlay.confirm-body-DwzKhXxM.js.map} +1 -1
  70. package/dist/overlay.js +3 -3
  71. package/dist/{overlay.service-KTgBxjFb.js → overlay.service-BDLi0p5M.js} +2 -2
  72. package/dist/{overlay.service-KTgBxjFb.js.map → overlay.service-BDLi0p5M.js.map} +1 -1
  73. package/dist/{overlay.service-DU1nqh6A.cjs → overlay.service-Dbu5uP9E.cjs} +1 -1
  74. package/dist/{overlay.service-DU1nqh6A.cjs.map → overlay.service-Dbu5uP9E.cjs.map} +1 -1
  75. package/dist/{select-Cawz88lG.js → select-CGBsblDA.js} +1 -1
  76. package/dist/{select-Cawz88lG.js.map → select-CGBsblDA.js.map} +1 -1
  77. package/dist/{select-BWpV2iv-.cjs → select-LWdPs7b_.cjs} +1 -1
  78. package/dist/{select-BWpV2iv-.cjs.map → select-LWdPs7b_.cjs.map} +1 -1
  79. package/dist/select.cjs +1 -1
  80. package/dist/select.js +1 -1
  81. package/dist/skills/SKILL.md +10 -0
  82. package/dist/skills/chips.md +41 -1
  83. package/dist/skills/schmancy/SKILL.md +10 -0
  84. package/dist/skills/schmancy/chips.md +41 -1
  85. package/dist/{src-CIqAj3Eh.js → src-Dmqjtcmp.js} +9 -8
  86. package/dist/src-Dmqjtcmp.js.map +1 -0
  87. package/dist/{src-CYqBQTyt.cjs → src-SAXA4LEH.cjs} +2 -1
  88. package/dist/src-SAXA4LEH.cjs.map +1 -0
  89. package/dist/teleport.cjs +1 -1
  90. package/dist/teleport.js +1 -1
  91. package/package.json +2 -1
  92. package/skills/schmancy/SKILL.md +10 -0
  93. package/skills/schmancy/chips.md +41 -1
  94. package/src/badge/badge.ts +1 -0
  95. package/src/boat/boat.ts +20 -5
  96. package/src/button/button.ts +1 -0
  97. package/src/button/icon-button.ts +1 -0
  98. package/src/directives/reveal.ts +7 -1
  99. package/src/fab/fab.ts +1 -0
  100. package/src/form/fields/chips/filter-chip.ts +1 -0
  101. package/types/src/boat/boat.d.ts +1 -0
  102. package/types/src/directives/reveal.d.ts +2 -0
  103. package/dist/boat-DmyG7y1V.js.map +0 -1
  104. package/dist/boat-dB1_qLm0.cjs +0 -34
  105. package/dist/boat-dB1_qLm0.cjs.map +0 -1
  106. package/dist/button-BQSOVnHn.js.map +0 -1
  107. package/dist/button-WRmXlNyw.cjs.map +0 -1
  108. package/dist/chips-B1jui8Pe.cjs.map +0 -1
  109. package/dist/chips-DAy6v93f.js.map +0 -1
  110. package/dist/src-CIqAj3Eh.js.map +0 -1
  111. package/dist/src-CYqBQTyt.cjs.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhmo91/schmancy",
3
- "version": "0.10.38",
3
+ "version": "0.10.40",
4
4
  "description": "UI library build with web components",
5
5
  "main": "./dist/index.js",
6
6
  "customElements": "custom-elements.json",
@@ -63,6 +63,7 @@
63
63
  },
64
64
  "scripts": {
65
65
  "dev": "vite build --config vite.config.ts --watch",
66
+ "build:watch": "vite build --config vite.config.ts --watch",
66
67
  "build": "tsc && vite build --config vite.config.ts && yarn manifest && yarn build:agent && yarn build:handover",
67
68
  "build:agent": "vite build --config vite.config.agent.ts",
68
69
  "build:handover": "node scripts/render-handover.mjs",
@@ -165,6 +165,16 @@ html`
165
165
 
166
166
  See `layout.md` for the full shell pattern with rail + content area.
167
167
 
168
+ ## Rules
169
+
170
+ ### INLINE_FLEX_HOST_NO_SHRINK
171
+
172
+ A web-component host that establishes `inline-flex` layout declares `flex-shrink: 0` in its `:host` block so it preserves its intrinsic content size regardless of the flex container it lands in.
173
+
174
+ ### DIRECTIVE_TRANSITION_TRACKS_PREV_VALUE
175
+
176
+ A Lit directive that gates an effect on a value transition stores the previous value in a private field and compares the incoming value against it in `update()`, firing the effect only when the two differ.
177
+
168
178
  ## Workflow
169
179
 
170
180
  1. User describes a UI task.
@@ -1,6 +1,46 @@
1
1
  # Chips
2
2
 
3
- > Four chip types: filter (toggleable), input (removable), suggestion (action), assist (action + elevated). Filter chips have embedded `magnetic` directive and selection glow.
3
+ > Four chip types: filter (toggleable), input (removable), suggestion (action), assist (action + elevated). Filter chips have embedded `magnetic` directive and selection glow. The `schmancy-chips` **container** wraps a set of chips, owns their selection state, and lays them out as one horizontally-scrolling row (or a wrapping grid).
4
+
5
+ ## Container — `schmancy-chips`
6
+
7
+ A form-associated container (`SchmancyFormField`: `name`, `required`, `disabled`, `hint`, `checkValidity()`, FormData participation). Slot `<schmancy-filter-chip>` children with **only** `.value` + label — the container drives each child's `selected` from its own `value`, so children carry no `?selected` and no per-chip `@change`. This is the primary entry point; reach for a bare `<schmancy-filter-chip>` only outside a selection group.
8
+
9
+ | Property | Type | Default | Description |
10
+ |----------|------|---------|-------------|
11
+ | `value` | `string \| string[]` | `''` / `[]` | Selected id (single mode) or ids (multi mode). |
12
+ | `values` | `string[]` | `[]` | Typed alias for `value` in multi mode. |
13
+ | `multi` | `boolean` | `false` | `true` → multiple chips selectable; `value` is `string[]`. |
14
+ | `wrap` | `boolean` | `false` | `false` → **single row, horizontal scroll** (internal `<schmancy-scroll direction="horizontal">`). `true` → multi-row wrap, vertical scroll. |
15
+ | `justify` | `'start' \| 'center' \| 'end'` | `'start'` | Main-axis alignment. |
16
+ | `required` | `boolean` | `false` | Single mode: deselecting the chosen chip is ignored (a value is mandatory). |
17
+
18
+ | Event | Detail | Fires on |
19
+ |-------|--------|----------|
20
+ | `change` | `{ value: string \| string[] }` | **User interaction only** — child chip toggled. NOT emitted on a programmatic `.value` set, so no `CONTROLLED_VALUE_ECHO_IS_NOT_INTENT` guard is needed. |
21
+
22
+ Single mode (`multi` false): selecting a chip sets `value` to its id; clicking the selected chip deselects → `change` with `value: ''` (unless `required`). Multi mode: each toggle adds/removes the id from the array.
23
+
24
+ **Host sizing — required for horizontal overscroll.** `:host` is `width: fit-content`, so by default the container hugs its chips and never scrolls. Constrain the host to trigger the single-row scroll: `class="w-full"` standalone, or `class="flex-1 min-w-0"` as a flex-row item beside other controls.
25
+
26
+ ```html
27
+ <!-- single-select, one horizontally-scrolling row -->
28
+ <schmancy-chips
29
+ class="w-full"
30
+ .value=${selectedId ?? ''}
31
+ @change=${(e: CustomEvent<{ value: string }>) =>
32
+ pick(e.detail.value || null)}
33
+ >
34
+ ${repeat(items, i => i.id, i => html`
35
+ <schmancy-filter-chip .value=${i.id}>${i.label}</schmancy-filter-chip>`)}
36
+ </schmancy-chips>
37
+
38
+ <!-- multi-select, wrapping grid -->
39
+ <schmancy-chips multi wrap required .value=${tags} @change=${onTags}>
40
+ ${repeat(opts, o => o.id, o => html`
41
+ <schmancy-filter-chip .value=${o.id}>${o.name}</schmancy-filter-chip>`)}
42
+ </schmancy-chips>
43
+ ```
4
44
 
5
45
  ## Chip Types
6
46
 
@@ -35,6 +35,7 @@ export class SchmancyBadgeV2 extends SchmancyElement {
35
35
  static styles = [css`
36
36
  :host {
37
37
  display: inline-flex;
38
+ flex-shrink: 0;
38
39
  width: fit-content;
39
40
  }
40
41
 
package/src/boat/boat.ts CHANGED
@@ -69,6 +69,7 @@ export default class SchmancyBoat extends SchmancyElement {
69
69
  #ready = false
70
70
  #sub?: Subscription
71
71
  #captured: Element[] = []
72
+ #wrapper?: HTMLElement
72
73
 
73
74
  // ============================================
74
75
  // POSITION MANAGEMENT
@@ -190,12 +191,12 @@ export default class SchmancyBoat extends SchmancyElement {
190
191
  private openOverlay() {
191
192
  if (this.#sub) return
192
193
  const anchor = this.containerRef.value
193
- const wrapper = document.createElement('div')
194
- wrapper.className = 'flex flex-col'
194
+ this.#wrapper = document.createElement('div')
195
+ this.#wrapper.className = 'flex flex-col'
195
196
  this.#captured = [...this.slotted]
196
- this.#captured.forEach(node => wrapper.appendChild(node))
197
+ this.#captured.forEach(node => this.#wrapper!.appendChild(node))
197
198
 
198
- this.#sub = show(wrapper, {
199
+ this.#sub = show(this.#wrapper, {
199
200
  anchor: anchor ?? undefined,
200
201
  dismissable: true,
201
202
  historyStrategy: 'silent',
@@ -212,6 +213,7 @@ export default class SchmancyBoat extends SchmancyElement {
212
213
  private restoreSlotted() {
213
214
  this.#captured.forEach(node => this.appendChild(node))
214
215
  this.#captured = []
216
+ this.#wrapper = undefined
215
217
  this.#sub = undefined
216
218
  if (this.open) this.open = false
217
219
  this.dispatchScopedEvent('toggle', 'closed')
@@ -353,6 +355,19 @@ export default class SchmancyBoat extends SchmancyElement {
353
355
  this.hasHandle = this.handleNodes.length > 0
354
356
  }
355
357
 
358
+ // When Lit re-renders the parent and re-asserts default-slot children back
359
+ // into this element, slotchange fires. If the overlay is live, re-relocate
360
+ // any reassigned nodes into the overlay wrapper to stop the DOM ping-pong.
361
+ private onDefaultSlotChange = () => {
362
+ if (!this.#sub || !this.#wrapper) return
363
+ this.slotted.forEach(node => {
364
+ if (node.parentElement !== this.#wrapper) {
365
+ this.#captured.push(node)
366
+ this.#wrapper!.appendChild(node)
367
+ }
368
+ })
369
+ }
370
+
356
371
  protected render(): unknown {
357
372
  const containerClasses = classMap({
358
373
  'inline-flex': true,
@@ -412,7 +427,7 @@ export default class SchmancyBoat extends SchmancyElement {
412
427
 
413
428
  <!-- Default-slot content parks here (hidden) while collapsed;
414
429
  relocated into the show() overlay on open. -->
415
- <div hidden><slot></slot></div>
430
+ <div hidden><slot @slotchange=${this.onDefaultSlotChange}></slot></div>
416
431
  </schmancy-surface>
417
432
  `
418
433
  }
@@ -27,6 +27,7 @@ export type ButtonColor = 'primary' | 'secondary' | 'success' | 'error' | 'warni
27
27
  export class SchmancyButton extends SchmancyElement {
28
28
  static styles = [css`:host{
29
29
  display: inline-flex;
30
+ flex-shrink: 0;
30
31
  overflow: hidden;
31
32
  position: relative;
32
33
  touch-action: manipulation;
@@ -17,6 +17,7 @@ export class SchmnacyIconButton extends SchmancyElement {
17
17
  static styles = [css`
18
18
  :host {
19
19
  display: inline-flex;
20
+ flex-shrink: 0;
20
21
  border-radius: 9999px;
21
22
  transition:
22
23
  box-shadow 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
@@ -77,6 +77,8 @@ class RevealDirective extends AsyncDirective {
77
77
  private teardown$ = new Subject<void>();
78
78
  /** True if this is the very first update call — used to detect always-true initial mount. */
79
79
  private firstUpdate = true;
80
+ /** Previous show value — animation only fires on false→true transitions. */
81
+ private prevShow: boolean | undefined = undefined;
80
82
 
81
83
  constructor(partInfo: PartInfo) {
82
84
  super(partInfo);
@@ -106,6 +108,8 @@ class RevealDirective extends AsyncDirective {
106
108
 
107
109
  const isFirstUpdate = this.firstUpdate;
108
110
  this.firstUpdate = false;
111
+ const didChange = show !== this.prevShow;
112
+ this.prevShow = show;
109
113
 
110
114
  if (!this.initialized) {
111
115
  this.initialized = true;
@@ -137,9 +141,11 @@ class RevealDirective extends AsyncDirective {
137
141
  }
138
142
  element.style.opacity = '1';
139
143
  element.style.transform = 'translateY(0) scale(1)';
140
- } else {
144
+ } else if (didChange) {
141
145
  // Toggle case: false→true. Animate from 0 to natural height,
142
146
  // then release the clamp so content is fully unconstrained.
147
+ // Guard: skip when show stays true across re-renders — re-animating
148
+ // every render causes the overlay to resize and flicker on every tick.
143
149
  if (reducedMotion) {
144
150
  if (explicitCap) {
145
151
  element.style.maxHeight = maxHeight;
package/src/fab/fab.ts CHANGED
@@ -34,6 +34,7 @@ export class SchmancyFab extends SchmancyElement {
34
34
  :host {
35
35
  /* M3 FAB (medium) — 16dp shape, 24dp icon, resting level 3 */
36
36
  display: inline-flex;
37
+ flex-shrink: 0;
37
38
  position: relative;
38
39
  touch-action: manipulation;
39
40
  overflow: hidden;
@@ -23,6 +23,7 @@ export class SchmancyFilterChip extends SchmancyElement {
23
23
  static styles = [css`
24
24
  :host {
25
25
  display: inline-flex;
26
+ flex-shrink: 0;
26
27
  outline: none;
27
28
  border-radius: 0.5rem;
28
29
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
@@ -56,6 +56,7 @@ export default class SchmancyBoat extends SchmancyElement {
56
56
  /** Flip open ↔ closed. */
57
57
  toggle(): void;
58
58
  private onHandleSlotChange;
59
+ private onDefaultSlotChange;
59
60
  protected render(): unknown;
60
61
  }
61
62
  declare global {
@@ -54,6 +54,8 @@ declare class RevealDirective extends AsyncDirective {
54
54
  private teardown$;
55
55
  /** True if this is the very first update call — used to detect always-true initial mount. */
56
56
  private firstUpdate;
57
+ /** Previous show value — animation only fires on false→true transitions. */
58
+ private prevShow;
57
59
  constructor(partInfo: PartInfo);
58
60
  render(show?: boolean, options?: RevealOptions): symbol;
59
61
  update(part: ElementPart, [show, options]: [boolean | undefined, RevealOptions?]): symbol;
@@ -1 +0,0 @@
1
- {"version":3,"file":"boat-DmyG7y1V.js","names":["#sub","#captured","#ready"],"sources":["../src/boat/boat.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { html, type PropertyValues } from 'lit'\nimport { customElement, property, queryAssignedElements, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport { exhaustMap, filter, finalize, fromEvent, merge, type Subscription, takeUntil, tap } from 'rxjs'\nimport { reducedMotion$ } from '../directives/reduced-motion'\nimport { show } from '../overlay/overlay.service'\nimport { theme } from '../theme/theme.service.js'\nimport { SPRING_SMOOTH } from '../utils/animation.js'\n\nconst DRAG_THRESHOLD = 5\nconst POSITION_STORAGE_KEY_PREFIX = 'schmancy-boat-'\n\ntype Corner = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'\ninterface Position {\n\tx: number\n\ty: number\n}\n\n/**\n * Corner-anchored launcher that delegates its expanded panel to the `show()`\n * overlay service.\n *\n * Three slots, three non-overlapping intents — no element-type sniffing,\n * ever:\n *\n * - `trigger` — pure consumer content. A native click anywhere on it\n * opens the panel; interactive children (buttons, FABs, inputs) work\n * with zero special-casing because the boat never calls\n * `preventDefault` / `stopPropagation` / `setPointerCapture` here.\n * - `drag-handle` — opt-in. Pointer-drag is wired ONLY to this slot's\n * boat-owned wrapper. Slot it to make the boat draggable; omit it and\n * the boat is static at its corner. (A no-move tap on the handle also\n * opens, so the grip doubles as a launcher.)\n * - _(default)_ — the panel body; parked hidden while collapsed,\n * relocated into the `show()` overlay on open.\n *\n * The boat owns drag, corner-snapping, position persistence and the glass\n * surface — never the collapsed shape.\n */\n@customElement('schmancy-boat')\nexport default class SchmancyBoat extends SchmancyElement {\n\n\n\t/** Identity for localStorage drag-position persistence. */\n\t@property({ type: String }) id: string = 'default'\n\t/** Corner the launcher is anchored to. */\n\t@property({ type: String }) corner: Corner = 'bottom-right'\n\t/** Open state. Bind `?open=${…}` to drive the overlay; reflected to the attribute. */\n\t@property({ type: Boolean, reflect: true }) open: boolean = false\n\n\t@state() private isDragging = false\n\t@state() private currentCorner: Corner = 'bottom-right'\n\t@state() private hasHandle = false\n\n\t/** Default-slot nodes — the overlay body. */\n\t@queryAssignedElements() private slotted!: Element[]\n\t/** Slotted drag-handle nodes — presence toggles draggability. */\n\t@queryAssignedElements({ slot: 'drag-handle' }) private handleNodes!: Element[]\n\n\tprivate position: Position = { x: 16, y: 16 }\n\tprivate containerRef = createRef<HTMLElement>()\n\tprivate triggerRef = createRef<HTMLElement>()\n\tprivate handleRef = createRef<HTMLElement>()\n\tprivate currentAnimation?: Animation\n\n\t#ready = false\n\t#sub?: Subscription\n\t#captured: Element[] = []\n\n\t// ============================================\n\t// POSITION MANAGEMENT\n\t// ============================================\n\n\tprivate applyContainerPosition() {\n\t\tconst container = this.containerRef.value\n\t\tif (!container) return\n\t\tcontainer.style.removeProperty('left')\n\t\tcontainer.style.removeProperty('right')\n\t\tcontainer.style.removeProperty('top')\n\t\tcontainer.style.removeProperty('bottom')\n\t\tconst { x, y } = this.position\n\t\tif (this.currentCorner.includes('right')) {\n\t\t\tcontainer.style.right = `${x}px`\n\t\t} else {\n\t\t\tcontainer.style.left = `${x}px`\n\t\t}\n\t\tif (this.currentCorner.includes('bottom')) {\n\t\t\tcontainer.style.bottom = `${y + theme.bottomOffset}px`\n\t\t} else {\n\t\t\tcontainer.style.top = `${y}px`\n\t\t}\n\t}\n\n\tprivate loadPosition() {\n\t\ttry {\n\t\t\tconst saved = localStorage.getItem(POSITION_STORAGE_KEY_PREFIX + this.id)\n\t\t\tif (saved) {\n\t\t\t\tconst parsed = JSON.parse(saved) as { x: number; y: number; anchor: Corner }\n\t\t\t\tthis.position = { x: parsed.x, y: parsed.y }\n\t\t\t\tthis.currentCorner = parsed.anchor\n\t\t\t}\n\t\t} catch {\n\t\t\t// ignore localStorage errors\n\t\t}\n\t}\n\n\tprivate savePosition() {\n\t\ttry {\n\t\t\tlocalStorage.setItem(\n\t\t\t\tPOSITION_STORAGE_KEY_PREFIX + this.id,\n\t\t\t\tJSON.stringify({ ...this.position, anchor: this.currentCorner }),\n\t\t\t)\n\t\t} catch {\n\t\t\t// ignore localStorage errors\n\t\t}\n\t}\n\n\tprivate validateBounds() {\n\t\tconst container = this.containerRef.value\n\t\tif (!container) return\n\t\tconst rect = container.getBoundingClientRect()\n\t\tif (rect.width === 0) return\n\t\tconst vw = window.innerWidth\n\t\tconst vh = window.innerHeight\n\t\tconst isRight = this.currentCorner.includes('right')\n\t\tconst isBottom = this.currentCorner.includes('bottom')\n\t\tconst actualLeft = isRight ? vw - this.position.x - rect.width : this.position.x\n\t\tconst actualTop = isBottom ? vh - this.position.y - rect.height : this.position.y\n\t\tconst newLeft = Math.max(0, Math.min(actualLeft, vw - rect.width))\n\t\tconst newTop = Math.max(0, Math.min(actualTop, vh - rect.height))\n\t\tthis.position = {\n\t\t\tx: isRight ? vw - newLeft - rect.width : newLeft,\n\t\t\ty: isBottom ? vh - newTop - rect.height : newTop,\n\t\t}\n\t\tthis.applyContainerPosition()\n\t}\n\n\t// ============================================\n\t// CORNER SNAPPING (FLIP)\n\t// ============================================\n\n\tprivate reorientToNearestCorner(): void {\n\t\tconst container = this.containerRef.value\n\t\tif (!container) return\n\n\t\tconst rect = container.getBoundingClientRect()\n\t\tconst fabCenterX = rect.left + rect.width / 2\n\t\tconst fabCenterY = rect.top + rect.height / 2\n\t\tconst side = fabCenterX > window.innerWidth / 2 ? 'right' : 'left'\n\t\tconst vert = fabCenterY > window.innerHeight / 2 ? 'bottom' : 'top'\n\t\tthis.currentCorner = `${vert}-${side}` as Corner\n\t\tthis.position = { x: 16, y: 16 }\n\t\tthis.applyContainerPosition()\n\n\t\tif (reducedMotion$.value) {\n\t\t\tthis.savePosition()\n\t\t\treturn\n\t\t}\n\n\t\tconst newRect = container.getBoundingClientRect()\n\t\tconst dx = rect.left - newRect.left\n\t\tconst dy = rect.top - newRect.top\n\t\tcontainer.style.transform = `translate(${dx}px, ${dy}px)`\n\n\t\tthis.currentAnimation?.cancel()\n\t\tconst anim = container.animate(\n\t\t\t[{ transform: container.style.transform }, { transform: 'translate(0,0)' }],\n\t\t\t{\n\t\t\t\tduration: SPRING_SMOOTH.duration,\n\t\t\t\teasing: SPRING_SMOOTH.easingFallback,\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t)\n\t\tthis.currentAnimation = anim\n\t\tanim.finished.then(() => {\n\t\t\tif (container.isConnected) container.style.transform = ''\n\t\t\treturn\n\t\t})\n\n\t\tthis.savePosition()\n\t}\n\n\t// ============================================\n\t// OVERLAY DELEGATION\n\t// ============================================\n\n\tprivate openOverlay() {\n\t\tif (this.#sub) return\n\t\tconst anchor = this.containerRef.value\n\t\tconst wrapper = document.createElement('div')\n\t\twrapper.className = 'flex flex-col'\n\t\tthis.#captured = [...this.slotted]\n\t\tthis.#captured.forEach(node => wrapper.appendChild(node))\n\n\t\tthis.#sub = show(wrapper, {\n\t\t\tanchor: anchor ?? undefined,\n\t\t\tdismissable: true,\n\t\t\thistoryStrategy: 'silent',\n\t\t})\n\t\t\t.pipe(\n\t\t\t\tfinalize(() => this.restoreSlotted()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\n\t\tthis.dispatchScopedEvent('toggle', 'open')\n\t}\n\n\tprivate restoreSlotted() {\n\t\tthis.#captured.forEach(node => this.appendChild(node))\n\t\tthis.#captured = []\n\t\tthis.#sub = undefined\n\t\tif (this.open) this.open = false\n\t\tthis.dispatchScopedEvent('toggle', 'closed')\n\t}\n\n\t// ============================================\n\t// LIFECYCLE\n\t// ============================================\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// One concern: keep the container in place when the environment\n\t\t// shifts. Viewport resize re-validates bounds; a theme bottom-offset\n\t\t// change (e.g. a snackbar pushing the safe area) re-applies position.\n\t\tmerge(\n\t\t\tfromEvent(window, 'resize').pipe(tap(() => this.validateBounds())),\n\t\t\ttheme.bottomOffset$.pipe(tap(() => this.applyContainerPosition())),\n\t\t)\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe()\n\t}\n\n\tfirstUpdated() {\n\t\tthis.currentCorner = this.corner\n\t\tthis.hasHandle = this.handleNodes.length > 0\n\t\tthis.loadPosition()\n\t\tconst container = this.containerRef.value\n\t\tconst trigger = this.triggerRef.value\n\t\tconst handle = this.handleRef.value\n\t\tif (!container || !trigger || !handle) return\n\t\tthis.applyContainerPosition()\n\n\t\t// Three intents, three sources, one pipeline, one subscribe.\n\t\t//\n\t\t// open$ — a plain click/Enter/Space on the trigger region. No\n\t\t// preventDefault/stopPropagation: a slotted button's own\n\t\t// click still fires; it merely also bubbles to \"open\".\n\t\t// drag$ — pointerdown on the boat-owned drag-handle wrapper. A\n\t\t// dedicated region, so every pointerdown there is a drag\n\t\t// intent — no element-type sniffing. A session ends on\n\t\t// pointerup/cancel; settle = move past threshold ? snap to\n\t\t// the nearest corner : treat as a tap and open.\n\t\tmerge(\n\t\t\tfromEvent<MouseEvent>(trigger, 'click').pipe(tap(() => this.toggle())),\n\t\t\tfromEvent<KeyboardEvent>(trigger, 'keydown').pipe(\n\t\t\t\tfilter(e => e.key === 'Enter' || e.key === ' '),\n\t\t\t\ttap(e => {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\tthis.toggle()\n\t\t\t\t}),\n\t\t\t),\n\t\t\tfromEvent<PointerEvent>(handle, 'pointerdown').pipe(\n\t\t\t\tfilter(e => e.button === 0),\n\t\t\t\ttap(e => {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\t// Capture can throw InvalidStateError if the pointer is\n\t\t\t\t\t// already released (fast tap) — drag still works without it.\n\t\t\t\t\ttry {\n\t\t\t\t\t\thandle.setPointerCapture(e.pointerId)\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// no active pointer to capture; ignore\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\texhaustMap(down => {\n\t\t\t\t\tconst rect = container.getBoundingClientRect()\n\t\t\t\t\tconst offsetX = down.clientX - rect.left\n\t\t\t\t\tconst offsetY = down.clientY - rect.top\n\t\t\t\t\tlet moved = false\n\t\t\t\t\tconst sameId = (e: PointerEvent) => e.pointerId === down.pointerId\n\t\t\t\t\tconst end$ = merge(\n\t\t\t\t\t\tfromEvent<PointerEvent>(window, 'pointerup'),\n\t\t\t\t\t\tfromEvent<PointerEvent>(window, 'pointercancel'),\n\t\t\t\t\t).pipe(filter(sameId))\n\n\t\t\t\t\treturn fromEvent<PointerEvent>(window, 'pointermove').pipe(\n\t\t\t\t\t\tfilter(sameId),\n\t\t\t\t\t\ttap(e => {\n\t\t\t\t\t\t\tconst dx = e.clientX - down.clientX\n\t\t\t\t\t\t\tconst dy = e.clientY - down.clientY\n\t\t\t\t\t\t\tif (!moved && Math.sqrt(dx * dx + dy * dy) > DRAG_THRESHOLD) {\n\t\t\t\t\t\t\t\tmoved = true\n\t\t\t\t\t\t\t\tthis.isDragging = true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!moved) return\n\t\t\t\t\t\t\tconst vw = window.innerWidth\n\t\t\t\t\t\t\tconst vh = window.innerHeight\n\t\t\t\t\t\t\tconst left = Math.max(0, Math.min(e.clientX - offsetX, vw - rect.width))\n\t\t\t\t\t\t\tconst top = Math.max(0, Math.min(e.clientY - offsetY, vh - rect.height))\n\t\t\t\t\t\t\tthis.position = {\n\t\t\t\t\t\t\t\tx: this.currentCorner.includes('right') ? vw - left - rect.width : left,\n\t\t\t\t\t\t\t\ty: this.currentCorner.includes('bottom') ? vh - top - rect.height : top,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.applyContainerPosition()\n\t\t\t\t\t\t}),\n\t\t\t\t\t\ttakeUntil(end$),\n\t\t\t\t\t\tfinalize(() => {\n\t\t\t\t\t\t\tif (moved) this.reorientToNearestCorner()\n\t\t\t\t\t\t\telse this.toggle()\n\t\t\t\t\t\t\tthis.isDragging = false\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t),\n\t\t)\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe()\n\n\t\tthis.#ready = true\n\t\tif (this.open) this.openOverlay()\n\t}\n\n\tprotected willUpdate(changed: PropertyValues<this>) {\n\t\tif (!this.#ready || !changed.has('open')) return\n\t\tif (this.open && !this.#sub) this.openOverlay()\n\t\telse if (!this.open && this.#sub) this.#sub.unsubscribe()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.currentAnimation?.cancel()\n\t\tthis.#sub?.unsubscribe()\n\t}\n\n\t// ============================================\n\t// PUBLIC API\n\t// ============================================\n\n\t/** Flip open ↔ closed. */\n\ttoggle() {\n\t\tthis.open = !this.open\n\t}\n\n\t// ============================================\n\t// RENDER\n\t// ============================================\n\n\tprivate onHandleSlotChange = () => {\n\t\tthis.hasHandle = this.handleNodes.length > 0\n\t}\n\n\tprotected render(): unknown {\n\t\tconst containerClasses = classMap({\n\t\t\t'inline-flex': true,\n\t\t\t'transition-opacity': true,\n\t\t\t'duration-200': true,\n\t\t\t'opacity-85': this.isDragging,\n\t\t\t'scale-95': this.isDragging,\n\t\t})\n\n\t\tconst containerStyles = styleMap({\n\t\t\tposition: 'fixed',\n\t\t\t'pointer-events': 'auto',\n\t\t})\n\n\t\t// Boat-owned drag region — wraps ONLY the drag-handle slot, so every\n\t\t// pointerdown inside it is unambiguously a drag intent. Hidden (and\n\t\t// out of layout) when the consumer slots no handle: the boat is then\n\t\t// simply not draggable.\n\t\tconst handleClasses = classMap({\n\t\t\tflex: true,\n\t\t\t'items-center': true,\n\t\t\t'touch-none': true,\n\t\t\t'select-none': true,\n\t\t\thidden: !this.hasHandle,\n\t\t\t'cursor-grabbing': this.isDragging,\n\t\t\t'cursor-grab': !this.isDragging,\n\t\t})\n\n\t\treturn html`\n\t\t\t<schmancy-surface\n\t\t\t\t${ref(this.containerRef)}\n\t\t\t\ttype=\"glass\"\n\t\t\t\trounded=\"all\"\n\t\t\t\t.elevation=${3}\n\t\t\t\tclass=\"${containerClasses} overflow-hidden rounded-2xl\"\n\t\t\t\tstyle=${containerStyles}\n\t\t\t\taria-expanded=${this.open}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\t${ref(this.handleRef)}\n\t\t\t\t\tclass=${handleClasses}\n\t\t\t\t\taria-label=\"Drag to move\"\n\t\t\t\t>\n\t\t\t\t\t<slot name=\"drag-handle\" @slotchange=${this.onHandleSlotChange}></slot>\n\t\t\t\t</div>\n\n\t\t\t\t<div\n\t\t\t\t\t${ref(this.triggerRef)}\n\t\t\t\t\tclass=\"flex items-center cursor-pointer\"\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\taria-label=\"Open panel\"\n\t\t\t\t\ttitle=\"Click to open\"\n\t\t\t\t>\n\t\t\t\t\t<slot name=\"trigger\"></slot>\n\t\t\t\t</div>\n\n\t\t\t\t<!-- Default-slot content parks here (hidden) while collapsed;\n\t\t\t\t relocated into the show() overlay on open. -->\n\t\t\t\t<div hidden><slot></slot></div>\n\t\t\t</schmancy-surface>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-boat': SchmancyBoat\n\t}\n}\n"],"mappings":";;;;;;;;;;;;AAYA,IACM,IAA8B,kBA8BrB,IAAA,cAA2B,EAAA;CAAA,YAAA,GAAA,GAAA;EAAA,MAAA,GAAA,CAAA,GAAA,KAAA,KAIA,WAAA,KAAA,SAEI,gBAAA,KAAA,OAAA,CAEe,GAAA,KAAA,aAAA,CAE9B,GAAA,KAAA,gBACW,gBAAA,KAAA,YAAA,CACZ,GAAA,KAAA,WAOA;GAAE,GAAG;GAAI,GAAG;EAAA,GAAA,KAAA,eAClB,EAAA,GAAA,KAAA,aACF,EAAA,GAAA,KAAA,YACD,EAAA,GAAA,KAAA,KAAA,CAGX,GAAA,KAAA,KAEc,CAAA,GAAA,KAAA,2BAAA;GA0RtB,KAAK,YAAY,KAAK,YAAY,SAAS;EAAA;CAAA;CA5R5C;CACA;CACA;CAMA,yBAAA;EACC,IAAM,IAAY,KAAK,aAAa;EACpC,IAAA,CAAK,GAAW;EAChB,EAAU,MAAM,eAAe,MAAA,GAC/B,EAAU,MAAM,eAAe,OAAA,GAC/B,EAAU,MAAM,eAAe,KAAA,GAC/B,EAAU,MAAM,eAAe,QAAA;EAC/B,IAAA,EAAM,GAAE,GAAA,GAAG,MAAM,KAAK;EAClB,KAAK,cAAc,SAAS,OAAA,IAC/B,EAAU,MAAM,QAAQ,GAAG,EAAA,MAE3B,EAAU,MAAM,OAAO,GAAG,EAAA,KAEvB,KAAK,cAAc,SAAS,QAAA,IAC/B,EAAU,MAAM,SAAS,GAAG,IAAI,EAAM,aAAA,MAEtC,EAAU,MAAM,MAAM,GAAG,EAAA;CAE3B;CAEA,eAAA;EACC,IAAA;GACC,IAAM,IAAQ,aAAa,QAAQ,IAA8B,KAAK,EAAA;GACt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unk-CncqDLb2.cjs`);const e=require(`./SchmancyElement-C41uPa6l.cjs`);require(`./mixins-fIpzhVMd.cjs`);const t=require(`./animation-CCOIW4wJ.cjs`),n=require(`./reduced-motion-Ds-HjMzn.cjs`),r=require(`./theme.service-B15FdjOS.cjs`),i=require(`./overlay.service-DU1nqh6A.cjs`);let a=require(`rxjs`),o=require(`lit/directives/class-map.js`),s=require(`lit/directives/style-map.js`),c=require(`lit/decorators.js`),l=require(`lit`),u=require(`lit/directives/ref.js`);var d=`schmancy-boat-`,f=class extends e.t{constructor(...e){super(...e),this.id=`default`,this.corner=`bottom-right`,this.open=!1,this.isDragging=!1,this.currentCorner=`bottom-right`,this.hasHandle=!1,this.position={x:16,y:16},this.containerRef=(0,u.createRef)(),this.triggerRef=(0,u.createRef)(),this.handleRef=(0,u.createRef)(),this.#e=!1,this.#n=[],this.onHandleSlotChange=()=>{this.hasHandle=this.handleNodes.length>0}}#e;#t;#n;applyContainerPosition(){let e=this.containerRef.value;if(!e)return;e.style.removeProperty(`left`),e.style.removeProperty(`right`),e.style.removeProperty(`top`),e.style.removeProperty(`bottom`);let{x:t,y:n}=this.position;this.currentCorner.includes(`right`)?e.style.right=`${t}px`:e.style.left=`${t}px`,this.currentCorner.includes(`bottom`)?e.style.bottom=`${n+r.n.bottomOffset}px`:e.style.top=`${n}px`}loadPosition(){try{let e=localStorage.getItem(d+this.id);if(e){let t=JSON.parse(e);this.position={x:t.x,y:t.y},this.currentCorner=t.anchor}}catch{}}savePosition(){try{localStorage.setItem(d+this.id,JSON.stringify({...this.position,anchor:this.currentCorner}))}catch{}}validateBounds(){let e=this.containerRef.value;if(!e)return;let t=e.getBoundingClientRect();if(t.width===0)return;let n=window.innerWidth,r=window.innerHeight,i=this.currentCorner.includes(`right`),a=this.currentCorner.includes(`bottom`),o=i?n-this.position.x-t.width:this.position.x,s=a?r-this.position.y-t.height:this.position.y,c=Math.max(0,Math.min(o,n-t.width)),l=Math.max(0,Math.min(s,r-t.height));this.position={x:i?n-c-t.width:c,y:a?r-l-t.height:l},this.applyContainerPosition()}reorientToNearestCorner(){let e=this.containerRef.value;if(!e)return;let r=e.getBoundingClientRect(),i=r.left+r.width/2,a=r.top+r.height/2,o=i>window.innerWidth/2?`right`:`left`,s=a>window.innerHeight/2?`bottom`:`top`;if(this.currentCorner=`${s}-${o}`,this.position={x:16,y:16},this.applyContainerPosition(),n.t.value)return void this.savePosition();let c=e.getBoundingClientRect(),l=r.left-c.left,u=r.top-c.top;e.style.transform=`translate(${l}px, ${u}px)`,this.currentAnimation?.cancel();let d=e.animate([{transform:e.style.transform},{transform:`translate(0,0)`}],{duration:t.d.duration,easing:t.d.easingFallback,fill:`forwards`});this.currentAnimation=d,d.finished.then(()=>{e.isConnected&&(e.style.transform=``)}),this.savePosition()}openOverlay(){if(this.#t)return;let e=this.containerRef.value,t=document.createElement(`div`);t.className=`flex flex-col`,this.#n=[...this.slotted],this.#n.forEach(e=>t.appendChild(e)),this.#t=i.o(t,{anchor:e??void 0,dismissable:!0,historyStrategy:`silent`}).pipe((0,a.finalize)(()=>this.restoreSlotted()),(0,a.takeUntil)(this.disconnecting)).subscribe(),this.dispatchScopedEvent(`toggle`,`open`)}restoreSlotted(){this.#n.forEach(e=>this.appendChild(e)),this.#n=[],this.#t=void 0,this.open&&=!1,this.dispatchScopedEvent(`toggle`,`closed`)}connectedCallback(){super.connectedCallback(),(0,a.merge)((0,a.fromEvent)(window,`resize`).pipe((0,a.tap)(()=>this.validateBounds())),r.n.bottomOffset$.pipe((0,a.tap)(()=>this.applyContainerPosition()))).pipe((0,a.takeUntil)(this.disconnecting)).subscribe()}firstUpdated(){this.currentCorner=this.corner,this.hasHandle=this.handleNodes.length>0,this.loadPosition();let e=this.containerRef.value,t=this.triggerRef.value,n=this.handleRef.value;e&&t&&n&&(this.applyContainerPosition(),(0,a.merge)((0,a.fromEvent)(t,`click`).pipe((0,a.tap)(()=>this.toggle())),(0,a.fromEvent)(t,`keydown`).pipe((0,a.filter)(e=>e.key===`Enter`||e.key===` `),(0,a.tap)(e=>{e.preventDefault(),this.toggle()})),(0,a.fromEvent)(n,`pointerdown`).pipe((0,a.filter)(e=>e.button===0),(0,a.tap)(e=>{e.preventDefault();try{n.setPointerCapture(e.pointerId)}catch{}}),(0,a.exhaustMap)(t=>{let n=e.getBoundingClientRect(),r=t.clientX-n.left,i=t.clientY-n.top,o=!1,s=e=>e.pointerId===t.pointerId,c=(0,a.merge)((0,a.fromEvent)(window,`pointerup`),(0,a.fromEvent)(window,`pointercancel`)).pipe((0,a.filter)(s));return(0,a.fromEvent)(window,`pointermove`).pipe((0,a.filter)(s),(0,a.tap)(e=>{let a=e.clientX-t.clientX,s=e.clientY-t.clientY;if(!o&&Math.sqrt(a*a+s*s)>5&&(o=!0,this.isDragging=!0),!o)return;let c=window.innerWidth,l=window.innerHeight,u=Math.max(0,Math.min(e.clientX-r,c-n.width)),d=Math.max(0,Math.min(e.clientY-i,l-n.height));this.position={x:this.currentCorner.includes(`right`)?c-u-n.width:u,y:this.currentCorner.includes(`bottom`)?l-d-n.height:d},this.applyContainerPosition()}),(0,a.takeUntil)(c),(0,a.finalize)(()=>{o?this.reorientToNearestCorner():this.toggle(),this.isDragging=!1}))}))).pipe((0,a.takeUntil)(this.disconnecting)).subscribe(),this.#e=!0,this.open&&this.openOverlay())}willUpdate(e){this.#e&&e.has(`open`)&&(this.open&&!this.#t?this.openOverlay():!this.open&&this.#t&&this.#t.unsubscribe())}disconnectedCallback(){super.disconnectedCallback(),this.currentAnimation?.cancel(),this.#t?.unsubscribe()}toggle(){this.open=!this.open}render(){let e=(0,o.classMap)({"inline-flex":!0,"transition-opacity":!0,"duration-200":!0,"opacity-85":this.isDragging,"scale-95":this.isDragging}),t=(0,s.styleMap)({position:`fixed`,"pointer-events":`auto`}),n=(0,o.classMap)({flex:!0,"items-center":!0,"touch-none":!0,"select-none":!0,hidden:!this.hasHandle,"cursor-grabbing":this.isDragging,"cursor-grab":!this.isDragging});return l.html`
2
- <schmancy-surface
3
- ${(0,u.ref)(this.containerRef)}
4
- type="glass"
5
- rounded="all"
6
- .elevation=${3}
7
- class="${e} overflow-hidden rounded-2xl"
8
- style=${t}
9
- aria-expanded=${this.open}
10
- >
11
- <div
12
- ${(0,u.ref)(this.handleRef)}
13
- class=${n}
14
- aria-label="Drag to move"
15
- >
16
- <slot name="drag-handle" @slotchange=${this.onHandleSlotChange}></slot>
17
- </div>
18
-
19
- <div
20
- ${(0,u.ref)(this.triggerRef)}
21
- class="flex items-center cursor-pointer"
22
- role="button"
23
- tabindex="0"
24
- aria-label="Open panel"
25
- title="Click to open"
26
- >
27
- <slot name="trigger"></slot>
28
- </div>
29
-
30
- <!-- Default-slot content parks here (hidden) while collapsed;
31
- relocated into the show() overlay on open. -->
32
- <div hidden><slot></slot></div>
33
- </schmancy-surface>
34
- `}};e.u([(0,c.property)({type:String})],f.prototype,`id`,void 0),e.u([(0,c.property)({type:String})],f.prototype,`corner`,void 0),e.u([(0,c.property)({type:Boolean,reflect:!0})],f.prototype,`open`,void 0),e.u([(0,c.state)()],f.prototype,`isDragging`,void 0),e.u([(0,c.state)()],f.prototype,`currentCorner`,void 0),e.u([(0,c.state)()],f.prototype,`hasHandle`,void 0),e.u([(0,c.queryAssignedElements)()],f.prototype,`slotted`,void 0),e.u([(0,c.queryAssignedElements)({slot:`drag-handle`})],f.prototype,`handleNodes`,void 0);var p=f=e.u([(0,c.customElement)(`schmancy-boat`)],f);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return p}});
@@ -1 +0,0 @@
1
- {"version":3,"file":"boat-dB1_qLm0.cjs","names":["#sub","#captured","#ready"],"sources":["../src/boat/boat.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { html, type PropertyValues } from 'lit'\nimport { customElement, property, queryAssignedElements, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport { exhaustMap, filter, finalize, fromEvent, merge, type Subscription, takeUntil, tap } from 'rxjs'\nimport { reducedMotion$ } from '../directives/reduced-motion'\nimport { show } from '../overlay/overlay.service'\nimport { theme } from '../theme/theme.service.js'\nimport { SPRING_SMOOTH } from '../utils/animation.js'\n\nconst DRAG_THRESHOLD = 5\nconst POSITION_STORAGE_KEY_PREFIX = 'schmancy-boat-'\n\ntype Corner = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'\ninterface Position {\n\tx: number\n\ty: number\n}\n\n/**\n * Corner-anchored launcher that delegates its expanded panel to the `show()`\n * overlay service.\n *\n * Three slots, three non-overlapping intents — no element-type sniffing,\n * ever:\n *\n * - `trigger` — pure consumer content. A native click anywhere on it\n * opens the panel; interactive children (buttons, FABs, inputs) work\n * with zero special-casing because the boat never calls\n * `preventDefault` / `stopPropagation` / `setPointerCapture` here.\n * - `drag-handle` — opt-in. Pointer-drag is wired ONLY to this slot's\n * boat-owned wrapper. Slot it to make the boat draggable; omit it and\n * the boat is static at its corner. (A no-move tap on the handle also\n * opens, so the grip doubles as a launcher.)\n * - _(default)_ — the panel body; parked hidden while collapsed,\n * relocated into the `show()` overlay on open.\n *\n * The boat owns drag, corner-snapping, position persistence and the glass\n * surface — never the collapsed shape.\n */\n@customElement('schmancy-boat')\nexport default class SchmancyBoat extends SchmancyElement {\n\n\n\t/** Identity for localStorage drag-position persistence. */\n\t@property({ type: String }) id: string = 'default'\n\t/** Corner the launcher is anchored to. */\n\t@property({ type: String }) corner: Corner = 'bottom-right'\n\t/** Open state. Bind `?open=${…}` to drive the overlay; reflected to the attribute. */\n\t@property({ type: Boolean, reflect: true }) open: boolean = false\n\n\t@state() private isDragging = false\n\t@state() private currentCorner: Corner = 'bottom-right'\n\t@state() private hasHandle = false\n\n\t/** Default-slot nodes — the overlay body. */\n\t@queryAssignedElements() private slotted!: Element[]\n\t/** Slotted drag-handle nodes — presence toggles draggability. */\n\t@queryAssignedElements({ slot: 'drag-handle' }) private handleNodes!: Element[]\n\n\tprivate position: Position = { x: 16, y: 16 }\n\tprivate containerRef = createRef<HTMLElement>()\n\tprivate triggerRef = createRef<HTMLElement>()\n\tprivate handleRef = createRef<HTMLElement>()\n\tprivate currentAnimation?: Animation\n\n\t#ready = false\n\t#sub?: Subscription\n\t#captured: Element[] = []\n\n\t// ============================================\n\t// POSITION MANAGEMENT\n\t// ============================================\n\n\tprivate applyContainerPosition() {\n\t\tconst container = this.containerRef.value\n\t\tif (!container) return\n\t\tcontainer.style.removeProperty('left')\n\t\tcontainer.style.removeProperty('right')\n\t\tcontainer.style.removeProperty('top')\n\t\tcontainer.style.removeProperty('bottom')\n\t\tconst { x, y } = this.position\n\t\tif (this.currentCorner.includes('right')) {\n\t\t\tcontainer.style.right = `${x}px`\n\t\t} else {\n\t\t\tcontainer.style.left = `${x}px`\n\t\t}\n\t\tif (this.currentCorner.includes('bottom')) {\n\t\t\tcontainer.style.bottom = `${y + theme.bottomOffset}px`\n\t\t} else {\n\t\t\tcontainer.style.top = `${y}px`\n\t\t}\n\t}\n\n\tprivate loadPosition() {\n\t\ttry {\n\t\t\tconst saved = localStorage.getItem(POSITION_STORAGE_KEY_PREFIX + this.id)\n\t\t\tif (saved) {\n\t\t\t\tconst parsed = JSON.parse(saved) as { x: number; y: number; anchor: Corner }\n\t\t\t\tthis.position = { x: parsed.x, y: parsed.y }\n\t\t\t\tthis.currentCorner = parsed.anchor\n\t\t\t}\n\t\t} catch {\n\t\t\t// ignore localStorage errors\n\t\t}\n\t}\n\n\tprivate savePosition() {\n\t\ttry {\n\t\t\tlocalStorage.setItem(\n\t\t\t\tPOSITION_STORAGE_KEY_PREFIX + this.id,\n\t\t\t\tJSON.stringify({ ...this.position, anchor: this.currentCorner }),\n\t\t\t)\n\t\t} catch {\n\t\t\t// ignore localStorage errors\n\t\t}\n\t}\n\n\tprivate validateBounds() {\n\t\tconst container = this.containerRef.value\n\t\tif (!container) return\n\t\tconst rect = container.getBoundingClientRect()\n\t\tif (rect.width === 0) return\n\t\tconst vw = window.innerWidth\n\t\tconst vh = window.innerHeight\n\t\tconst isRight = this.currentCorner.includes('right')\n\t\tconst isBottom = this.currentCorner.includes('bottom')\n\t\tconst actualLeft = isRight ? vw - this.position.x - rect.width : this.position.x\n\t\tconst actualTop = isBottom ? vh - this.position.y - rect.height : this.position.y\n\t\tconst newLeft = Math.max(0, Math.min(actualLeft, vw - rect.width))\n\t\tconst newTop = Math.max(0, Math.min(actualTop, vh - rect.height))\n\t\tthis.position = {\n\t\t\tx: isRight ? vw - newLeft - rect.width : newLeft,\n\t\t\ty: isBottom ? vh - newTop - rect.height : newTop,\n\t\t}\n\t\tthis.applyContainerPosition()\n\t}\n\n\t// ============================================\n\t// CORNER SNAPPING (FLIP)\n\t// ============================================\n\n\tprivate reorientToNearestCorner(): void {\n\t\tconst container = this.containerRef.value\n\t\tif (!container) return\n\n\t\tconst rect = container.getBoundingClientRect()\n\t\tconst fabCenterX = rect.left + rect.width / 2\n\t\tconst fabCenterY = rect.top + rect.height / 2\n\t\tconst side = fabCenterX > window.innerWidth / 2 ? 'right' : 'left'\n\t\tconst vert = fabCenterY > window.innerHeight / 2 ? 'bottom' : 'top'\n\t\tthis.currentCorner = `${vert}-${side}` as Corner\n\t\tthis.position = { x: 16, y: 16 }\n\t\tthis.applyContainerPosition()\n\n\t\tif (reducedMotion$.value) {\n\t\t\tthis.savePosition()\n\t\t\treturn\n\t\t}\n\n\t\tconst newRect = container.getBoundingClientRect()\n\t\tconst dx = rect.left - newRect.left\n\t\tconst dy = rect.top - newRect.top\n\t\tcontainer.style.transform = `translate(${dx}px, ${dy}px)`\n\n\t\tthis.currentAnimation?.cancel()\n\t\tconst anim = container.animate(\n\t\t\t[{ transform: container.style.transform }, { transform: 'translate(0,0)' }],\n\t\t\t{\n\t\t\t\tduration: SPRING_SMOOTH.duration,\n\t\t\t\teasing: SPRING_SMOOTH.easingFallback,\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t)\n\t\tthis.currentAnimation = anim\n\t\tanim.finished.then(() => {\n\t\t\tif (container.isConnected) container.style.transform = ''\n\t\t\treturn\n\t\t})\n\n\t\tthis.savePosition()\n\t}\n\n\t// ============================================\n\t// OVERLAY DELEGATION\n\t// ============================================\n\n\tprivate openOverlay() {\n\t\tif (this.#sub) return\n\t\tconst anchor = this.containerRef.value\n\t\tconst wrapper = document.createElement('div')\n\t\twrapper.className = 'flex flex-col'\n\t\tthis.#captured = [...this.slotted]\n\t\tthis.#captured.forEach(node => wrapper.appendChild(node))\n\n\t\tthis.#sub = show(wrapper, {\n\t\t\tanchor: anchor ?? undefined,\n\t\t\tdismissable: true,\n\t\t\thistoryStrategy: 'silent',\n\t\t})\n\t\t\t.pipe(\n\t\t\t\tfinalize(() => this.restoreSlotted()),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\n\t\tthis.dispatchScopedEvent('toggle', 'open')\n\t}\n\n\tprivate restoreSlotted() {\n\t\tthis.#captured.forEach(node => this.appendChild(node))\n\t\tthis.#captured = []\n\t\tthis.#sub = undefined\n\t\tif (this.open) this.open = false\n\t\tthis.dispatchScopedEvent('toggle', 'closed')\n\t}\n\n\t// ============================================\n\t// LIFECYCLE\n\t// ============================================\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// One concern: keep the container in place when the environment\n\t\t// shifts. Viewport resize re-validates bounds; a theme bottom-offset\n\t\t// change (e.g. a snackbar pushing the safe area) re-applies position.\n\t\tmerge(\n\t\t\tfromEvent(window, 'resize').pipe(tap(() => this.validateBounds())),\n\t\t\ttheme.bottomOffset$.pipe(tap(() => this.applyContainerPosition())),\n\t\t)\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe()\n\t}\n\n\tfirstUpdated() {\n\t\tthis.currentCorner = this.corner\n\t\tthis.hasHandle = this.handleNodes.length > 0\n\t\tthis.loadPosition()\n\t\tconst container = this.containerRef.value\n\t\tconst trigger = this.triggerRef.value\n\t\tconst handle = this.handleRef.value\n\t\tif (!container || !trigger || !handle) return\n\t\tthis.applyContainerPosition()\n\n\t\t// Three intents, three sources, one pipeline, one subscribe.\n\t\t//\n\t\t// open$ — a plain click/Enter/Space on the trigger region. No\n\t\t// preventDefault/stopPropagation: a slotted button's own\n\t\t// click still fires; it merely also bubbles to \"open\".\n\t\t// drag$ — pointerdown on the boat-owned drag-handle wrapper. A\n\t\t// dedicated region, so every pointerdown there is a drag\n\t\t// intent — no element-type sniffing. A session ends on\n\t\t// pointerup/cancel; settle = move past threshold ? snap to\n\t\t// the nearest corner : treat as a tap and open.\n\t\tmerge(\n\t\t\tfromEvent<MouseEvent>(trigger, 'click').pipe(tap(() => this.toggle())),\n\t\t\tfromEvent<KeyboardEvent>(trigger, 'keydown').pipe(\n\t\t\t\tfilter(e => e.key === 'Enter' || e.key === ' '),\n\t\t\t\ttap(e => {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\tthis.toggle()\n\t\t\t\t}),\n\t\t\t),\n\t\t\tfromEvent<PointerEvent>(handle, 'pointerdown').pipe(\n\t\t\t\tfilter(e => e.button === 0),\n\t\t\t\ttap(e => {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\t// Capture can throw InvalidStateError if the pointer is\n\t\t\t\t\t// already released (fast tap) — drag still works without it.\n\t\t\t\t\ttry {\n\t\t\t\t\t\thandle.setPointerCapture(e.pointerId)\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// no active pointer to capture; ignore\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\texhaustMap(down => {\n\t\t\t\t\tconst rect = container.getBoundingClientRect()\n\t\t\t\t\tconst offsetX = down.clientX - rect.left\n\t\t\t\t\tconst offsetY = down.clientY - rect.top\n\t\t\t\t\tlet moved = false\n\t\t\t\t\tconst sameId = (e: PointerEvent) => e.pointerId === down.pointerId\n\t\t\t\t\tconst end$ = merge(\n\t\t\t\t\t\tfromEvent<PointerEvent>(window, 'pointerup'),\n\t\t\t\t\t\tfromEvent<PointerEvent>(window, 'pointercancel'),\n\t\t\t\t\t).pipe(filter(sameId))\n\n\t\t\t\t\treturn fromEvent<PointerEvent>(window, 'pointermove').pipe(\n\t\t\t\t\t\tfilter(sameId),\n\t\t\t\t\t\ttap(e => {\n\t\t\t\t\t\t\tconst dx = e.clientX - down.clientX\n\t\t\t\t\t\t\tconst dy = e.clientY - down.clientY\n\t\t\t\t\t\t\tif (!moved && Math.sqrt(dx * dx + dy * dy) > DRAG_THRESHOLD) {\n\t\t\t\t\t\t\t\tmoved = true\n\t\t\t\t\t\t\t\tthis.isDragging = true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!moved) return\n\t\t\t\t\t\t\tconst vw = window.innerWidth\n\t\t\t\t\t\t\tconst vh = window.innerHeight\n\t\t\t\t\t\t\tconst left = Math.max(0, Math.min(e.clientX - offsetX, vw - rect.width))\n\t\t\t\t\t\t\tconst top = Math.max(0, Math.min(e.clientY - offsetY, vh - rect.height))\n\t\t\t\t\t\t\tthis.position = {\n\t\t\t\t\t\t\t\tx: this.currentCorner.includes('right') ? vw - left - rect.width : left,\n\t\t\t\t\t\t\t\ty: this.currentCorner.includes('bottom') ? vh - top - rect.height : top,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.applyContainerPosition()\n\t\t\t\t\t\t}),\n\t\t\t\t\t\ttakeUntil(end$),\n\t\t\t\t\t\tfinalize(() => {\n\t\t\t\t\t\t\tif (moved) this.reorientToNearestCorner()\n\t\t\t\t\t\t\telse this.toggle()\n\t\t\t\t\t\t\tthis.isDragging = false\n\t\t\t\t\t\t}),\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t),\n\t\t)\n\t\t\t.pipe(takeUntil(this.disconnecting))\n\t\t\t.subscribe()\n\n\t\tthis.#ready = true\n\t\tif (this.open) this.openOverlay()\n\t}\n\n\tprotected willUpdate(changed: PropertyValues<this>) {\n\t\tif (!this.#ready || !changed.has('open')) return\n\t\tif (this.open && !this.#sub) this.openOverlay()\n\t\telse if (!this.open && this.#sub) this.#sub.unsubscribe()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.currentAnimation?.cancel()\n\t\tthis.#sub?.unsubscribe()\n\t}\n\n\t// ============================================\n\t// PUBLIC API\n\t// ============================================\n\n\t/** Flip open ↔ closed. */\n\ttoggle() {\n\t\tthis.open = !this.open\n\t}\n\n\t// ============================================\n\t// RENDER\n\t// ============================================\n\n\tprivate onHandleSlotChange = () => {\n\t\tthis.hasHandle = this.handleNodes.length > 0\n\t}\n\n\tprotected render(): unknown {\n\t\tconst containerClasses = classMap({\n\t\t\t'inline-flex': true,\n\t\t\t'transition-opacity': true,\n\t\t\t'duration-200': true,\n\t\t\t'opacity-85': this.isDragging,\n\t\t\t'scale-95': this.isDragging,\n\t\t})\n\n\t\tconst containerStyles = styleMap({\n\t\t\tposition: 'fixed',\n\t\t\t'pointer-events': 'auto',\n\t\t})\n\n\t\t// Boat-owned drag region — wraps ONLY the drag-handle slot, so every\n\t\t// pointerdown inside it is unambiguously a drag intent. Hidden (and\n\t\t// out of layout) when the consumer slots no handle: the boat is then\n\t\t// simply not draggable.\n\t\tconst handleClasses = classMap({\n\t\t\tflex: true,\n\t\t\t'items-center': true,\n\t\t\t'touch-none': true,\n\t\t\t'select-none': true,\n\t\t\thidden: !this.hasHandle,\n\t\t\t'cursor-grabbing': this.isDragging,\n\t\t\t'cursor-grab': !this.isDragging,\n\t\t})\n\n\t\treturn html`\n\t\t\t<schmancy-surface\n\t\t\t\t${ref(this.containerRef)}\n\t\t\t\ttype=\"glass\"\n\t\t\t\trounded=\"all\"\n\t\t\t\t.elevation=${3}\n\t\t\t\tclass=\"${containerClasses} overflow-hidden rounded-2xl\"\n\t\t\t\tstyle=${containerStyles}\n\t\t\t\taria-expanded=${this.open}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\t${ref(this.handleRef)}\n\t\t\t\t\tclass=${handleClasses}\n\t\t\t\t\taria-label=\"Drag to move\"\n\t\t\t\t>\n\t\t\t\t\t<slot name=\"drag-handle\" @slotchange=${this.onHandleSlotChange}></slot>\n\t\t\t\t</div>\n\n\t\t\t\t<div\n\t\t\t\t\t${ref(this.triggerRef)}\n\t\t\t\t\tclass=\"flex items-center cursor-pointer\"\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\taria-label=\"Open panel\"\n\t\t\t\t\ttitle=\"Click to open\"\n\t\t\t\t>\n\t\t\t\t\t<slot name=\"trigger\"></slot>\n\t\t\t\t</div>\n\n\t\t\t\t<!-- Default-slot content parks here (hidden) while collapsed;\n\t\t\t\t relocated into the show() overlay on open. -->\n\t\t\t\t<div hidden><slot></slot></div>\n\t\t\t</schmancy-surface>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-boat': SchmancyBoat\n\t}\n}\n"],"mappings":"2dAYA,IACM,EAA8B,iBA8BrB,EAAA,cAA2B,EAAA,CAAA,CAAA,YAAA,GAAA,EAAA,CAAA,MAAA,GAAA,CAAA,EAAA,KAAA,GAIA,UAAA,KAAA,OAEI,eAAA,KAAA,KAAA,CAEe,EAAA,KAAA,WAAA,CAE9B,EAAA,KAAA,cACW,eAAA,KAAA,UAAA,CACZ,EAAA,KAAA,SAOA,CAAE,EAAG,GAAI,EAAG,EAAA,EAAA,KAAA,cAAA,EAAA,EAAA,WAAA,EAAA,KAAA,YAAA,EAAA,EAAA,WAAA,EAAA,KAAA,WAAA,EAAA,EAAA,WAAA,EAAA,KAAA,GAAA,CAMhC,EAAA,KAAA,GAEc,CAAA,EAAA,KAAA,uBAAA,CA0RtB,KAAK,UAAY,KAAK,YAAY,OAAS,CAAA,CAAA,CA5R5C,GACA,GACA,GAMA,wBAAA,CACC,IAAM,EAAY,KAAK,aAAa,MACpC,GAAA,CAAK,EAAW,OAChB,EAAU,MAAM,eAAe,MAAA,EAC/B,EAAU,MAAM,eAAe,OAAA,EAC/B,EAAU,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Aef,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAlXU,CAAE,KAAM,MAAA,CAAA,CAAA,EAAQ,EAAA,UAAA,KAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAEhB,CAAE,KAAM,MAAA,CAAA,CAAA,EAAQ,EAAA,UAAA,SAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAEhB,CAAE,KAAM,QAAS,QAAA,CAAS,CAAA,CAAA,CAAA,EAAM,EAAA,UAAA,OAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,OAAA,CAAA,EAEnC,EAAA,UAAA,aAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,OAAA,CAAA,EACA,EAAA,UAAA,gBAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,OAAA,CAAA,EACA,EAAA,UAAA,YAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,uBAAA,CAAA,EAGgB,EAAA,UAAA,UAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,uBAEA,CAAE,KAAM,aAAA,CAAA,CAAA,EAAe,EAAA,UAAA,cAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eAlBhC,eAAA,CAAA,EAAe,CAAA,EAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"button-BQSOVnHn.js","names":["#ariaLabel"],"sources":["../src/button/context.ts","../src/button/button.ts"],"sourcesContent":["import { createContext } from '@lit/context'\n\nexport type SchmancyButtonSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg'\n\n/**\n * Provided by `<schmancy-button>` to its descendants so children\n * (e.g. `<schmancy-icon>`) can auto-size against the enclosing button.\n */\nexport const SchmancyButtonSizeContext = createContext<SchmancyButtonSize>('schmancy-button-size')\n","import { provide } from '@lit/context'\nimport { SchmancyElement } from '@mixins/index'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { when } from 'lit/directives/when.js'\nimport { magnetic } from '../directives/magnetic'\nimport { SchmancyButtonSizeContext, type SchmancyButtonSize } from './context'\n\nexport interface SchmancyButtonEventMap {\n\tSchmancyFocus: CustomEvent<void>\n\tSchmancyBlur: CustomEvent<void>\n}\n\nexport type ButtonVariant = 'elevated' | 'filled' | 'filled tonal' | 'tonal' | 'outlined' | 'text'\nexport type ButtonColor = 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info' | 'neutral'\n\n/**\n * A button component.\n * @element schmancy-button\n * @slot - The default slot.\n * @slot prefix - The prefix slot.\n * @slot suffix - The suffix slot.\n * @csspart base - The underlying native `<button>` (or `<a>` when `href` is set).\n */\n@customElement('schmancy-button')\nexport class SchmancyButton extends SchmancyElement {\n\tstatic styles = [css`:host{\n\t\tdisplay: inline-flex;\n\t\toverflow: hidden;\n\t\tposition: relative;\n\t\ttouch-action: manipulation;\n\t\tborder-radius: 1rem;\n\t\ttransition:\n\t\t\tbox-shadow 300ms cubic-bezier(0.34, 1.56, 0.64, 1),\n\t\t\ttransform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);\n\t}\n\t:host([width=\"full\"]) {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t}\n\t:host(:hover:not([disabled])) {\n\t\tbox-shadow: 0 4px 16px -4px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 20%, transparent);\n\t}\n\t:host(:active:not([disabled])) {\n\t\ttransform: scale(0.97);\n\t\tbox-shadow: 0 1px 4px -2px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 10%, transparent);\n\t\ttransition-duration: 100ms;\n\t}\n\t@media (prefers-reduced-motion: reduce) {\n\t\t:host { transition: none; }\n\t\t:host(:hover:not([disabled])) { box-shadow: none; }\n\t\t:host(:active:not([disabled])) { transform: none; box-shadow: none; }\n\t}\n\t:host *,\n\t* {\n\t\ttouch-action: manipulation;\n\t}`]\n\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tmode: 'open',\n\t\tdelegatesFocus: true,\n\t}\n\n\tstatic formAssociated = true\n\tprivate internals: ElementInternals | undefined\n\t/**\n\t * When this button is `type=\"submit\"` and lives inside a <schmancy-form>,\n\t * the observer mirrors the form's `aria-busy` attribute onto this button\n\t * while a submit is in flight. Stays focusable; disabled buttons drop from\n\t * the tab order and are unreachable to AT (WCAG 2.2 AA).\n\t */\n\tprivate formBusyObserver?: MutationObserver\n\n\tconstructor() {\n\t\tsuper()\n\t\ttry {\n\t\t\tthis.internals = this.attachInternals()\n\t\t} catch {\n\t\t\tthis.internals = undefined\n\t\t}\n\t\t// Translate clicks into native form semantics so the button works\n\t\t// inside any <form>, not just inside <schmancy-form>.\n\t\tthis.addEventListener('click', (e: MouseEvent) => {\n\t\t\tif (this.disabled) {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopImmediatePropagation()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst form = this.internals?.form\n\t\t\tif (!form) return\n\t\t\tif (this.type === 'submit') {\n\t\t\t\te.preventDefault()\n\t\t\t\tform.requestSubmit()\n\t\t\t} else if (this.type === 'reset') {\n\t\t\t\te.preventDefault()\n\t\t\t\tform.reset()\n\t\t\t}\n\t\t})\n\t}\n\n\t/** Associated form, when placed inside a <form>. */\n\tget form(): HTMLFormElement | null {\n\t\treturn this.internals?.form ?? null\n\t}\n\n\tformDisabledCallback(disabled: boolean): void {\n\t\tthis.disabled = disabled\n\t}\n\n\toverride connectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\t// Mirror the closest <schmancy-form>'s aria-busy onto this submit button\n\t\t// so the user gets a visible busy state during async submit handlers.\n\t\t// Schmancy-form sets aria-busy=\"true\" while status === 'submitting'.\n\t\tif (this.type !== 'submit') return\n\t\tconst form = this.closest('schmancy-form') as HTMLElement | null\n\t\tif (!form) return\n\t\tconst sync = () => {\n\t\t\tconst busy = form.getAttribute('aria-busy') === 'true'\n\t\t\tif (busy) {\n\t\t\t\tthis.setAttribute('aria-busy', 'true')\n\t\t\t\tthis.internals?.states.add('submitting')\n\t\t\t} else {\n\t\t\t\tthis.removeAttribute('aria-busy')\n\t\t\t\tthis.internals?.states.delete('submitting')\n\t\t\t}\n\t\t}\n\t\tsync()\n\t\tthis.formBusyObserver = new MutationObserver(sync)\n\t\tthis.formBusyObserver.observe(form, { attributes: true, attributeFilter: ['aria-busy'] })\n\t}\n\n\toverride disconnectedCallback(): void {\n\t\tthis.formBusyObserver?.disconnect()\n\t\tthis.formBusyObserver = undefined\n\t\tsuper.disconnectedCallback()\n\t}\n\n\t@query('[part=\"base\"]', true)\n\tprivate nativeElement!: HTMLElement\n\n\t#ariaLabel!: string\n\n\t/**\n\t * The variant of the button.\n\t * @attr\n\t * @default 'text'\n\t * @public\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic variant: ButtonVariant = 'text'\n\n\t/**\n\t * The color of the button.\n\t * @attr\n\t * @default Depends on variant: 'primary' for filled/elevated/outlined/text, 'secondary' for tonal\n\t * @public\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic color?: ButtonColor\n\n\t/**\n\t * The width of the button.\n\t * @attr\n\t * @type {'full' | 'auto'}\n\t * @default 'auto'\n\t * @public\n\t */\n\t@property({ reflect: true })\n\tpublic width: 'full' | 'auto' = 'auto'\n\n\t/**\n\t * The size of the button.\n\t * Provided as `SchmancyButtonSizeContext` to descendant elements so children\n\t * (e.g. `<schmancy-icon>`) can auto-size against the enclosing button.\n\t * @attr\n\t * @type {'xxs' | 'xs' | 'sm' | 'md' | 'lg'}\n\t * @default 'md'\n\t * @public\n\t */\n\t@provide({ context: SchmancyButtonSizeContext })\n\t@property({ type: String })\n\tpublic size: SchmancyButtonSize = 'md'\n\n\t/**\n\t * The type of the button.\n\t * Defaults to 'button' (preventing accidental form submissions).\n\t * @attr\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic type: 'button' | 'reset' | 'submit' = 'button'\n\n\t/**\n\t * The URL the button points to.\n\t * If provided, the component will render as an anchor element.\n\t * @attr\n\t */\n\t@property()\n\tpublic href?: string\n\n\t/**\n\t * Determines whether the button is disabled.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\tpublic override set ariaLabel(value: string) {\n\t\tconst oldVal = this.#ariaLabel\n\t\tthis.#ariaLabel = value\n\n\t\tif (this.hasAttribute('aria-label')) {\n\t\t\tthis.removeAttribute('aria-label')\n\t\t}\n\t\tthis.requestUpdate('ariaLabel', oldVal)\n\t}\n\n\t@property({ attribute: 'aria-label' })\n\tpublic override get ariaLabel() {\n\t\treturn this.#ariaLabel\n\t}\n\n\t@queryAssignedElements({\n\t\tslot: 'prefix',\n\t\tflatten: true,\n\t\tselector: 'img',\n\t})\n\tprivate prefixImgs!: HTMLImageElement[]\n\n\t@queryAssignedElements({\n\t\tslot: 'suffix',\n\t\tflatten: true,\n\t\tselector: 'img',\n\t})\n\tprivate suffixImgs!: HTMLImageElement[]\n\n\t/** Sets focus in the button. */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.nativeElement.focus(options)\n\t}\n\n\t/** Removes focus from the button. */\n\tpublic override blur() {\n\t\tthis.nativeElement.blur()\n\t}\n\n\t/**\n\t * Get the effective color based on variant if not explicitly set\n\t * M3 spec: filled = primary, tonal = secondary, others = primary\n\t */\n\tprotected get effectiveColor(): ButtonColor {\n\t\tif (this.color) return this.color\n\n\t\t// Map 'tonal' to 'filled tonal' for checking\n\t\tconst effectiveVariant = this.variant === 'tonal' ? 'filled tonal' : this.variant\n\n\t\t// M3 defaults: tonal uses secondary, others use primary\n\t\treturn effectiveVariant === 'filled tonal' ? 'secondary' : 'primary'\n\t}\n\n\tprotected get imgClasses(): string[] {\n\t\t// M3 spec: icon sizes scale with button size\n\t\tconst sizeMap = {\n\t\t\txxs: 'w-3 h-3', // 12px for 24px button (ultra-compact)\n\t\t\txs: 'w-4 h-4', // 16px for 32px button (M3 dense)\n\t\t\tsm: 'w-5 h-5', // 20px for 40px button (M3 default)\n\t\t\tmd: 'w-6 h-6', // 24px for 48px button (M3 large)\n\t\t\tlg: 'w-7 h-7' // 28px for 56px button (M3 extra large)\n\t\t}\n\t\treturn [sizeMap[this.size], 'object-contain']\n\t}\n\n\tfirstUpdated() {\n\t\t// Add image classes and ensure decorative images have an empty alt.\n\t\tthis.prefixImgs?.forEach(img => {\n\t\t\timg.classList.add(...this.imgClasses)\n\t\t\tif (!img.hasAttribute('alt')) {\n\t\t\t\timg.setAttribute('alt', '')\n\t\t\t}\n\t\t})\n\t\tthis.suffixImgs?.forEach(img => {\n\t\t\timg.classList.add(...this.imgClasses)\n\t\t\tif (!img.hasAttribute('alt')) {\n\t\t\t\timg.setAttribute('alt', '')\n\t\t\t}\n\t\t})\n\t}\n\n\tclick(): void {\n\t\tthis.dispatchEvent(new Event('click', { bubbles: true, composed: true }))\n\t}\n\n\t// Prevent default behavior when the component is disabled.\n\tprivate preventDefault(event: Event) {\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t}\n\n\trender() {\n\t\t// Map 'tonal' variant to 'filled tonal' for backwards compatibility\n\t\tconst effectiveVariant = this.variant === 'tonal' ? 'filled tonal' : this.variant;\n\n\t\t// Compute classes for the interactive element.\n\t\tconst classes = {\n\t\t\t'z-0 transition-all duration-200 relative rounded-2xl flex justify-center items-center outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden flex-1 overflow-hidden':\n\t\t\t\ttrue,\n\t\t\t// Height - M3 spec: 24dp (xxs) → 32dp (dense) → 40dp (default) → 48dp (large) → 56dp (XL)\n\t\t\t'h-6': this.size === 'xxs', // 24px - Ultra-compact\n\t\t\t'h-8': this.size === 'xs', // 32px - M3 dense/compact\n\t\t\t'h-10': this.size === 'sm', // 40px - M3 default\n\t\t\t'h-12': this.size === 'md', // 48px - M3 large\n\t\t\t'h-14': this.size === 'lg', // 56px - M3 extra large\n\t\t\t// Padding - M3 spec: horizontal padding 24dp default, scaled proportionally\n\t\t\t'py-1 px-2': this.size === 'xxs', // 4px/8px for 24px height\n\t\t\t'py-2 px-4': this.size === 'xs', // 8px/16px for 32px height\n\t\t\t'py-2.5 px-5': this.size === 'sm', // 10px/20px for 40px height\n\t\t\t'py-3 px-6': this.size === 'md', // 12px/24px for 48px height (M3 default)\n\t\t\t'py-4 px-7': this.size === 'lg', // 16px/28px for 56px height\n\t\t\t// Typography - M3 spec: label-large (14px) default, scaled\n\t\t\t'text-[10px] font-medium leading-3': this.size === 'xxs', // 10px\n\t\t\t'text-xs font-medium leading-4': this.size === 'xs', // 12px\n\t\t\t'text-sm font-medium leading-5': this.size === 'sm' || this.size === 'md', // 14px - M3 label-large\n\t\t\t'text-base font-medium leading-6': this.size === 'lg', // 16px\n\t\t\t// Letter spacing - M3 spec\n\t\t\t'tracking-[0.1px]': true,\n\t\t\t// Gap - Scaled with size\n\t\t\t'gap-0.5': this.size === 'xxs', // 2px\n\t\t\t'gap-1': this.size === 'xs', // 4px\n\t\t\t'gap-1.5': this.size === 'sm', // 6px\n\t\t\t'gap-2': this.size === 'md', // 8px\n\t\t\t'gap-2.5': this.size === 'lg', // 10px\n\t\t\t'cursor-pointer': !this.disabled,\n\t\t\t'opacity-[0.38]': this.disabled,\n\t\t\t'hover:shadow-sm': !this.disabled && effectiveVariant === 'elevated',\n\t\t\t'w-full tex-center': this.width === 'full',\n\t\t\t// Elevated variant\n\t\t\t'bg-surface-low shadow-xs': effectiveVariant === 'elevated',\n\t\t\t// Outlined variant\n\t\t\t'bg-transparent border-1 border-solid': effectiveVariant === 'outlined',\n\t\t\t'border-outline': effectiveVariant === 'outlined' && this.effectiveColor === 'primary',\n\t\t\t'border-success-default': effectiveVariant === 'outlined' && this.effectiveColor === 'success',\n\t\t\t'border-error-default': effectiveVariant === 'outlined' && this.effectiveColor === 'error',\n\t\t\t'border-warning-default': effectiveVariant === 'outlined' && this.effectiveColor === 'warning',\n\t\t\t'border-info-default': effectiveVariant === 'outlined' && this.effectiveColor === 'info',\n\t\t\t'border-secondary-default': effectiveVariant === 'outlined' && this.effectiveColor === 'secondary',\n\t\t\t'border-outline-variant': effectiveVariant === 'outlined' && this.effectiveColor === 'neutral',\n\t\t\t// Filled variant - background colors\n\t\t\t'bg-primary-default': effectiveVariant === 'filled' && this.effectiveColor === 'primary',\n\t\t\t'bg-secondary-default': effectiveVariant === 'filled' && this.effectiveColor === 'secondary',\n\t\t\t'bg-success-default': effectiveVariant === 'filled' && this.effectiveColor === 'success',\n\t\t\t'bg-error-default': effectiveVariant === 'filled' && this.effectiveColor === 'error',\n\t\t\t'bg-warning-default': effectiveVariant === 'filled' && this.effectiveColor === 'warning',\n\t\t\t'bg-info-default': effectiveVariant === 'filled' && this.effectiveColor === 'info',\n\t\t\t'bg-surface-containerHighest': effectiveVariant === 'filled' && this.effectiveColor === 'neutral',\n\t\t\t// Filled variant - text colors\n\t\t\t'text-primary-on': effectiveVariant === 'filled' && this.effectiveColor === 'primary',\n\t\t\t'text-secondary-on': effectiveVariant === 'filled' && this.effectiveColor === 'secondary',\n\t\t\t'text-success-on': effectiveVariant === 'filled' && this.effectiveColor === 'success',\n\t\t\t'text-error-on': effectiveVariant === 'filled' && this.effectiveColor === 'error',\n\t\t\t'text-warning-on': effectiveVariant === 'filled' && this.effectiveColor === 'warning',\n\t\t\t'text-info-on': effectiveVariant === 'filled' && this.effectiveColor === 'info',\n\t\t\t'text-surface-on': effectiveVariant === 'filled' && this.effectiveColor === 'neutral',\n\t\t\t// Filled tonal variant - background colors\n\t\t\t'bg-primary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'primary',\n\t\t\t'bg-secondary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'secondary',\n\t\t\t'bg-success-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'success',\n\t\t\t'bg-error-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'error',\n\t\t\t'bg-warning-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'warning',\n\t\t\t'bg-info-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'info',\n\t\t\t'bg-surface-containerLow': effectiveVariant === 'filled tonal' && this.effectiveColor === 'neutral',\n\t\t\t// Filled tonal variant - text colors\n\t\t\t'text-primary-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'primary',\n\t\t\t'text-secondary-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'secondary',\n\t\t\t'text-success-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'success',\n\t\t\t'text-error-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'error',\n\t\t\t'text-warning-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'warning',\n\t\t\t'text-info-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'info',\n\t\t\t// Text and elevated variants - text colors\n\t\t\t'text-primary-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'primary',\n\t\t\t'text-secondary-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'secondary',\n\t\t\t'text-success-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'success',\n\t\t\t'text-error-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'error',\n\t\t\t'text-warning-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'warning',\n\t\t\t'text-info-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'info',\n\t\t\t'text-surface-onVariant': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined' || effectiveVariant === 'filled tonal') && this.effectiveColor === 'neutral',\n\t\t}\n\n\t\tconst stateLayerClasses = {\n\t\t\t'absolute inset-0 hover:opacity-[0.08] z-0 rounded-2xl': true,\n\t\t\t// M3 focus and pressed states\n\t\t\t'focus-visible:opacity-[0.10]': true, // M3 focus state\n\t\t\t'active:opacity-[0.10]': true, // M3 pressed state\n\t\t\t// Filled variant hover\n\t\t\t'hover:bg-primary-on': effectiveVariant === 'filled' && this.effectiveColor === 'primary',\n\t\t\t'hover:bg-secondary-on': effectiveVariant === 'filled' && this.effectiveColor === 'secondary',\n\t\t\t'hover:bg-success-on': effectiveVariant === 'filled' && this.effectiveColor === 'success',\n\t\t\t'hover:bg-error-on': effectiveVariant === 'filled' && this.effectiveColor === 'error',\n\t\t\t'hover:bg-warning-on': effectiveVariant === 'filled' && this.effectiveColor === 'warning',\n\t\t\t'hover:bg-info-on': effectiveVariant === 'filled' && this.effectiveColor === 'info',\n\t\t\t'hover:bg-surface-on': effectiveVariant === 'filled' && this.effectiveColor === 'neutral',\n\t\t\t// Outlined, elevated, text variants hover\n\t\t\t'hover:bg-primary-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'primary',\n\t\t\t'hover:bg-secondary-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'secondary',\n\t\t\t'hover:bg-success-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'success',\n\t\t\t'hover:bg-error-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'error',\n\t\t\t'hover:bg-warning-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'warning',\n\t\t\t'hover:bg-info-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'info',\n\t\t\t'hover:bg-surface-onVariant': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'neutral',\n\t\t\t// Filled tonal hover\n\t\t\t'hover:bg-primary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'primary',\n\t\t\t'hover:bg-secondary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'secondary',\n\t\t\t'hover:bg-success-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'success',\n\t\t\t'hover:bg-error-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'error',\n\t\t\t'hover:bg-warning-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'warning',\n\t\t\t'hover:bg-info-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'info',\n\t\t\t'hover:bg-surface-containerLow': effectiveVariant === 'filled tonal' && this.effectiveColor === 'neutral',\n\t\t}\n\n\t\t// If href is provided, render an anchor element.\n\t\tif (this.href) {\n\t\t\treturn html`\n\t\t\t\t<a\n\t\t\t\t\t${magnetic({ strength: 3, radius: 60 })}\n\t\t\t\t\tpart=\"base\"\n\t\t\t\t\thref=${ifDefined(this.disabled ? undefined : this.href)}\n\t\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\t\ttabindex=${this.disabled ? '-1' : '0'}\n\t\t\t\t\taria-disabled=${this.disabled}\n\t\t\t\t\t@click=${this.disabled ? this.preventDefault : undefined}\n\t\t\t\t>\n\t\t\t\t\t${when(!this.disabled, () => html`<div class=\"${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t\t<slot name=\"prefix\"></slot>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t<slot name=\"suffix\"></slot>\n\t\t\t\t</a>\n\t\t\t`\n\t\t}\n\n\t\t// Otherwise, render a native button element.\n\t\treturn html`\n\t\t\t<button\n\t\t\t\t${magnetic({ strength: 3, radius: 60 })}\n\t\t\t\tpart=\"base\"\n\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t?disabled=${this.disabled}\n\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\ttype=${ifDefined(this.type)}\n\t\t\t\ttabindex=${ifDefined(this.disabled ? '-1' : undefined)}\n\t\t\t>\n\t\t\t\t${when(!this.disabled, () => html`<div class=\"${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t<slot name=\"prefix\"></slot>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"suffix\"></slot>\n\t\t\t</button>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-button': SchmancyButton\n\t}\n}\n"],"mappings":";;;;;;;;AAQA,IAAa,IAA4B,EAAkC,sBAAA,GCkBpE,IAAA,cAA6B,EAAA;CAAA;EAAA,KAAA,SACnB,CAAC,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAgCiB;GAAA,GACjC,EAAW;GACd,MAAM;GACN,gBAAA,CAAgB;EAAA;CAAA;CAAA;EAAA,KAAA,iBAAA,CAGO;CAAA;CAUxB,cAAA;EACC,MAAA,GAAA,KAAA,UA4E+B,QAAA,KAAA,QAmBA,QAAA,KAAA,OAaE,MAAA,KAAA,OAQW,UAAA,KAAA,WAAA,CAe3B;EAlIjB,IAAA;GACC,KAAK,YAAY,KAAK,gBAAA;EACvB,QAAA;GACC,KAAK,YAAA,KAAY;EAClB;EAGA,KAAK,iBAAiB,UAAU,MAAA;GAC/B,IAAI,KAAK,UAGR,OAFA,EAAE,eAAA,GAAA,KACF,EAAE,yBAAA;GAGH,IAAM,IAAO,KAAK,WAAW;GACxB,MACD,KAAK,SAAS,YACjB,EAAE,eAAA,GACF,EAAK,cAAA,KACK,KAAK,SAAS,YACxB,EAAE,eAAA,GACF,EAAK,MAAA;EA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AA,GAAA,EAAA,CAGA,EAAsB;CACtB,MAAM;CACN,SAAA,CAAS;CACT,UAAU;AAAA,CAAA,CAAA,GACV,EAAA,WAAA,cAAA,KAAA,CAAA,GAAA,IAAA,EAAA,CAlND,EAAc,iBAAA,CAAA,GAAiB,CAAA;AAAA,SAAA,KAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"button-WRmXlNyw.cjs","names":["#ariaLabel"],"sources":["../src/button/context.ts","../src/button/button.ts"],"sourcesContent":["import { createContext } from '@lit/context'\n\nexport type SchmancyButtonSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg'\n\n/**\n * Provided by `<schmancy-button>` to its descendants so children\n * (e.g. `<schmancy-icon>`) can auto-size against the enclosing button.\n */\nexport const SchmancyButtonSizeContext = createContext<SchmancyButtonSize>('schmancy-button-size')\n","import { provide } from '@lit/context'\nimport { SchmancyElement } from '@mixins/index'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { when } from 'lit/directives/when.js'\nimport { magnetic } from '../directives/magnetic'\nimport { SchmancyButtonSizeContext, type SchmancyButtonSize } from './context'\n\nexport interface SchmancyButtonEventMap {\n\tSchmancyFocus: CustomEvent<void>\n\tSchmancyBlur: CustomEvent<void>\n}\n\nexport type ButtonVariant = 'elevated' | 'filled' | 'filled tonal' | 'tonal' | 'outlined' | 'text'\nexport type ButtonColor = 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'info' | 'neutral'\n\n/**\n * A button component.\n * @element schmancy-button\n * @slot - The default slot.\n * @slot prefix - The prefix slot.\n * @slot suffix - The suffix slot.\n * @csspart base - The underlying native `<button>` (or `<a>` when `href` is set).\n */\n@customElement('schmancy-button')\nexport class SchmancyButton extends SchmancyElement {\n\tstatic styles = [css`:host{\n\t\tdisplay: inline-flex;\n\t\toverflow: hidden;\n\t\tposition: relative;\n\t\ttouch-action: manipulation;\n\t\tborder-radius: 1rem;\n\t\ttransition:\n\t\t\tbox-shadow 300ms cubic-bezier(0.34, 1.56, 0.64, 1),\n\t\t\ttransform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);\n\t}\n\t:host([width=\"full\"]) {\n\t\tdisplay: flex;\n\t\twidth: 100%;\n\t}\n\t:host(:hover:not([disabled])) {\n\t\tbox-shadow: 0 4px 16px -4px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 20%, transparent);\n\t}\n\t:host(:active:not([disabled])) {\n\t\ttransform: scale(0.97);\n\t\tbox-shadow: 0 1px 4px -2px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 10%, transparent);\n\t\ttransition-duration: 100ms;\n\t}\n\t@media (prefers-reduced-motion: reduce) {\n\t\t:host { transition: none; }\n\t\t:host(:hover:not([disabled])) { box-shadow: none; }\n\t\t:host(:active:not([disabled])) { transform: none; box-shadow: none; }\n\t}\n\t:host *,\n\t* {\n\t\ttouch-action: manipulation;\n\t}`]\n\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tmode: 'open',\n\t\tdelegatesFocus: true,\n\t}\n\n\tstatic formAssociated = true\n\tprivate internals: ElementInternals | undefined\n\t/**\n\t * When this button is `type=\"submit\"` and lives inside a <schmancy-form>,\n\t * the observer mirrors the form's `aria-busy` attribute onto this button\n\t * while a submit is in flight. Stays focusable; disabled buttons drop from\n\t * the tab order and are unreachable to AT (WCAG 2.2 AA).\n\t */\n\tprivate formBusyObserver?: MutationObserver\n\n\tconstructor() {\n\t\tsuper()\n\t\ttry {\n\t\t\tthis.internals = this.attachInternals()\n\t\t} catch {\n\t\t\tthis.internals = undefined\n\t\t}\n\t\t// Translate clicks into native form semantics so the button works\n\t\t// inside any <form>, not just inside <schmancy-form>.\n\t\tthis.addEventListener('click', (e: MouseEvent) => {\n\t\t\tif (this.disabled) {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopImmediatePropagation()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst form = this.internals?.form\n\t\t\tif (!form) return\n\t\t\tif (this.type === 'submit') {\n\t\t\t\te.preventDefault()\n\t\t\t\tform.requestSubmit()\n\t\t\t} else if (this.type === 'reset') {\n\t\t\t\te.preventDefault()\n\t\t\t\tform.reset()\n\t\t\t}\n\t\t})\n\t}\n\n\t/** Associated form, when placed inside a <form>. */\n\tget form(): HTMLFormElement | null {\n\t\treturn this.internals?.form ?? null\n\t}\n\n\tformDisabledCallback(disabled: boolean): void {\n\t\tthis.disabled = disabled\n\t}\n\n\toverride connectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\t// Mirror the closest <schmancy-form>'s aria-busy onto this submit button\n\t\t// so the user gets a visible busy state during async submit handlers.\n\t\t// Schmancy-form sets aria-busy=\"true\" while status === 'submitting'.\n\t\tif (this.type !== 'submit') return\n\t\tconst form = this.closest('schmancy-form') as HTMLElement | null\n\t\tif (!form) return\n\t\tconst sync = () => {\n\t\t\tconst busy = form.getAttribute('aria-busy') === 'true'\n\t\t\tif (busy) {\n\t\t\t\tthis.setAttribute('aria-busy', 'true')\n\t\t\t\tthis.internals?.states.add('submitting')\n\t\t\t} else {\n\t\t\t\tthis.removeAttribute('aria-busy')\n\t\t\t\tthis.internals?.states.delete('submitting')\n\t\t\t}\n\t\t}\n\t\tsync()\n\t\tthis.formBusyObserver = new MutationObserver(sync)\n\t\tthis.formBusyObserver.observe(form, { attributes: true, attributeFilter: ['aria-busy'] })\n\t}\n\n\toverride disconnectedCallback(): void {\n\t\tthis.formBusyObserver?.disconnect()\n\t\tthis.formBusyObserver = undefined\n\t\tsuper.disconnectedCallback()\n\t}\n\n\t@query('[part=\"base\"]', true)\n\tprivate nativeElement!: HTMLElement\n\n\t#ariaLabel!: string\n\n\t/**\n\t * The variant of the button.\n\t * @attr\n\t * @default 'text'\n\t * @public\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic variant: ButtonVariant = 'text'\n\n\t/**\n\t * The color of the button.\n\t * @attr\n\t * @default Depends on variant: 'primary' for filled/elevated/outlined/text, 'secondary' for tonal\n\t * @public\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic color?: ButtonColor\n\n\t/**\n\t * The width of the button.\n\t * @attr\n\t * @type {'full' | 'auto'}\n\t * @default 'auto'\n\t * @public\n\t */\n\t@property({ reflect: true })\n\tpublic width: 'full' | 'auto' = 'auto'\n\n\t/**\n\t * The size of the button.\n\t * Provided as `SchmancyButtonSizeContext` to descendant elements so children\n\t * (e.g. `<schmancy-icon>`) can auto-size against the enclosing button.\n\t * @attr\n\t * @type {'xxs' | 'xs' | 'sm' | 'md' | 'lg'}\n\t * @default 'md'\n\t * @public\n\t */\n\t@provide({ context: SchmancyButtonSizeContext })\n\t@property({ type: String })\n\tpublic size: SchmancyButtonSize = 'md'\n\n\t/**\n\t * The type of the button.\n\t * Defaults to 'button' (preventing accidental form submissions).\n\t * @attr\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic type: 'button' | 'reset' | 'submit' = 'button'\n\n\t/**\n\t * The URL the button points to.\n\t * If provided, the component will render as an anchor element.\n\t * @attr\n\t */\n\t@property()\n\tpublic href?: string\n\n\t/**\n\t * Determines whether the button is disabled.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\tpublic override set ariaLabel(value: string) {\n\t\tconst oldVal = this.#ariaLabel\n\t\tthis.#ariaLabel = value\n\n\t\tif (this.hasAttribute('aria-label')) {\n\t\t\tthis.removeAttribute('aria-label')\n\t\t}\n\t\tthis.requestUpdate('ariaLabel', oldVal)\n\t}\n\n\t@property({ attribute: 'aria-label' })\n\tpublic override get ariaLabel() {\n\t\treturn this.#ariaLabel\n\t}\n\n\t@queryAssignedElements({\n\t\tslot: 'prefix',\n\t\tflatten: true,\n\t\tselector: 'img',\n\t})\n\tprivate prefixImgs!: HTMLImageElement[]\n\n\t@queryAssignedElements({\n\t\tslot: 'suffix',\n\t\tflatten: true,\n\t\tselector: 'img',\n\t})\n\tprivate suffixImgs!: HTMLImageElement[]\n\n\t/** Sets focus in the button. */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.nativeElement.focus(options)\n\t}\n\n\t/** Removes focus from the button. */\n\tpublic override blur() {\n\t\tthis.nativeElement.blur()\n\t}\n\n\t/**\n\t * Get the effective color based on variant if not explicitly set\n\t * M3 spec: filled = primary, tonal = secondary, others = primary\n\t */\n\tprotected get effectiveColor(): ButtonColor {\n\t\tif (this.color) return this.color\n\n\t\t// Map 'tonal' to 'filled tonal' for checking\n\t\tconst effectiveVariant = this.variant === 'tonal' ? 'filled tonal' : this.variant\n\n\t\t// M3 defaults: tonal uses secondary, others use primary\n\t\treturn effectiveVariant === 'filled tonal' ? 'secondary' : 'primary'\n\t}\n\n\tprotected get imgClasses(): string[] {\n\t\t// M3 spec: icon sizes scale with button size\n\t\tconst sizeMap = {\n\t\t\txxs: 'w-3 h-3', // 12px for 24px button (ultra-compact)\n\t\t\txs: 'w-4 h-4', // 16px for 32px button (M3 dense)\n\t\t\tsm: 'w-5 h-5', // 20px for 40px button (M3 default)\n\t\t\tmd: 'w-6 h-6', // 24px for 48px button (M3 large)\n\t\t\tlg: 'w-7 h-7' // 28px for 56px button (M3 extra large)\n\t\t}\n\t\treturn [sizeMap[this.size], 'object-contain']\n\t}\n\n\tfirstUpdated() {\n\t\t// Add image classes and ensure decorative images have an empty alt.\n\t\tthis.prefixImgs?.forEach(img => {\n\t\t\timg.classList.add(...this.imgClasses)\n\t\t\tif (!img.hasAttribute('alt')) {\n\t\t\t\timg.setAttribute('alt', '')\n\t\t\t}\n\t\t})\n\t\tthis.suffixImgs?.forEach(img => {\n\t\t\timg.classList.add(...this.imgClasses)\n\t\t\tif (!img.hasAttribute('alt')) {\n\t\t\t\timg.setAttribute('alt', '')\n\t\t\t}\n\t\t})\n\t}\n\n\tclick(): void {\n\t\tthis.dispatchEvent(new Event('click', { bubbles: true, composed: true }))\n\t}\n\n\t// Prevent default behavior when the component is disabled.\n\tprivate preventDefault(event: Event) {\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t}\n\n\trender() {\n\t\t// Map 'tonal' variant to 'filled tonal' for backwards compatibility\n\t\tconst effectiveVariant = this.variant === 'tonal' ? 'filled tonal' : this.variant;\n\n\t\t// Compute classes for the interactive element.\n\t\tconst classes = {\n\t\t\t'z-0 transition-all duration-200 relative rounded-2xl flex justify-center items-center outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden flex-1 overflow-hidden':\n\t\t\t\ttrue,\n\t\t\t// Height - M3 spec: 24dp (xxs) → 32dp (dense) → 40dp (default) → 48dp (large) → 56dp (XL)\n\t\t\t'h-6': this.size === 'xxs', // 24px - Ultra-compact\n\t\t\t'h-8': this.size === 'xs', // 32px - M3 dense/compact\n\t\t\t'h-10': this.size === 'sm', // 40px - M3 default\n\t\t\t'h-12': this.size === 'md', // 48px - M3 large\n\t\t\t'h-14': this.size === 'lg', // 56px - M3 extra large\n\t\t\t// Padding - M3 spec: horizontal padding 24dp default, scaled proportionally\n\t\t\t'py-1 px-2': this.size === 'xxs', // 4px/8px for 24px height\n\t\t\t'py-2 px-4': this.size === 'xs', // 8px/16px for 32px height\n\t\t\t'py-2.5 px-5': this.size === 'sm', // 10px/20px for 40px height\n\t\t\t'py-3 px-6': this.size === 'md', // 12px/24px for 48px height (M3 default)\n\t\t\t'py-4 px-7': this.size === 'lg', // 16px/28px for 56px height\n\t\t\t// Typography - M3 spec: label-large (14px) default, scaled\n\t\t\t'text-[10px] font-medium leading-3': this.size === 'xxs', // 10px\n\t\t\t'text-xs font-medium leading-4': this.size === 'xs', // 12px\n\t\t\t'text-sm font-medium leading-5': this.size === 'sm' || this.size === 'md', // 14px - M3 label-large\n\t\t\t'text-base font-medium leading-6': this.size === 'lg', // 16px\n\t\t\t// Letter spacing - M3 spec\n\t\t\t'tracking-[0.1px]': true,\n\t\t\t// Gap - Scaled with size\n\t\t\t'gap-0.5': this.size === 'xxs', // 2px\n\t\t\t'gap-1': this.size === 'xs', // 4px\n\t\t\t'gap-1.5': this.size === 'sm', // 6px\n\t\t\t'gap-2': this.size === 'md', // 8px\n\t\t\t'gap-2.5': this.size === 'lg', // 10px\n\t\t\t'cursor-pointer': !this.disabled,\n\t\t\t'opacity-[0.38]': this.disabled,\n\t\t\t'hover:shadow-sm': !this.disabled && effectiveVariant === 'elevated',\n\t\t\t'w-full tex-center': this.width === 'full',\n\t\t\t// Elevated variant\n\t\t\t'bg-surface-low shadow-xs': effectiveVariant === 'elevated',\n\t\t\t// Outlined variant\n\t\t\t'bg-transparent border-1 border-solid': effectiveVariant === 'outlined',\n\t\t\t'border-outline': effectiveVariant === 'outlined' && this.effectiveColor === 'primary',\n\t\t\t'border-success-default': effectiveVariant === 'outlined' && this.effectiveColor === 'success',\n\t\t\t'border-error-default': effectiveVariant === 'outlined' && this.effectiveColor === 'error',\n\t\t\t'border-warning-default': effectiveVariant === 'outlined' && this.effectiveColor === 'warning',\n\t\t\t'border-info-default': effectiveVariant === 'outlined' && this.effectiveColor === 'info',\n\t\t\t'border-secondary-default': effectiveVariant === 'outlined' && this.effectiveColor === 'secondary',\n\t\t\t'border-outline-variant': effectiveVariant === 'outlined' && this.effectiveColor === 'neutral',\n\t\t\t// Filled variant - background colors\n\t\t\t'bg-primary-default': effectiveVariant === 'filled' && this.effectiveColor === 'primary',\n\t\t\t'bg-secondary-default': effectiveVariant === 'filled' && this.effectiveColor === 'secondary',\n\t\t\t'bg-success-default': effectiveVariant === 'filled' && this.effectiveColor === 'success',\n\t\t\t'bg-error-default': effectiveVariant === 'filled' && this.effectiveColor === 'error',\n\t\t\t'bg-warning-default': effectiveVariant === 'filled' && this.effectiveColor === 'warning',\n\t\t\t'bg-info-default': effectiveVariant === 'filled' && this.effectiveColor === 'info',\n\t\t\t'bg-surface-containerHighest': effectiveVariant === 'filled' && this.effectiveColor === 'neutral',\n\t\t\t// Filled variant - text colors\n\t\t\t'text-primary-on': effectiveVariant === 'filled' && this.effectiveColor === 'primary',\n\t\t\t'text-secondary-on': effectiveVariant === 'filled' && this.effectiveColor === 'secondary',\n\t\t\t'text-success-on': effectiveVariant === 'filled' && this.effectiveColor === 'success',\n\t\t\t'text-error-on': effectiveVariant === 'filled' && this.effectiveColor === 'error',\n\t\t\t'text-warning-on': effectiveVariant === 'filled' && this.effectiveColor === 'warning',\n\t\t\t'text-info-on': effectiveVariant === 'filled' && this.effectiveColor === 'info',\n\t\t\t'text-surface-on': effectiveVariant === 'filled' && this.effectiveColor === 'neutral',\n\t\t\t// Filled tonal variant - background colors\n\t\t\t'bg-primary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'primary',\n\t\t\t'bg-secondary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'secondary',\n\t\t\t'bg-success-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'success',\n\t\t\t'bg-error-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'error',\n\t\t\t'bg-warning-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'warning',\n\t\t\t'bg-info-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'info',\n\t\t\t'bg-surface-containerLow': effectiveVariant === 'filled tonal' && this.effectiveColor === 'neutral',\n\t\t\t// Filled tonal variant - text colors\n\t\t\t'text-primary-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'primary',\n\t\t\t'text-secondary-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'secondary',\n\t\t\t'text-success-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'success',\n\t\t\t'text-error-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'error',\n\t\t\t'text-warning-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'warning',\n\t\t\t'text-info-onContainer': effectiveVariant === 'filled tonal' && this.effectiveColor === 'info',\n\t\t\t// Text and elevated variants - text colors\n\t\t\t'text-primary-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'primary',\n\t\t\t'text-secondary-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'secondary',\n\t\t\t'text-success-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'success',\n\t\t\t'text-error-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'error',\n\t\t\t'text-warning-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'warning',\n\t\t\t'text-info-default': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined') && this.effectiveColor === 'info',\n\t\t\t'text-surface-onVariant': (effectiveVariant === 'text' || effectiveVariant === 'elevated' || effectiveVariant === 'outlined' || effectiveVariant === 'filled tonal') && this.effectiveColor === 'neutral',\n\t\t}\n\n\t\tconst stateLayerClasses = {\n\t\t\t'absolute inset-0 hover:opacity-[0.08] z-0 rounded-2xl': true,\n\t\t\t// M3 focus and pressed states\n\t\t\t'focus-visible:opacity-[0.10]': true, // M3 focus state\n\t\t\t'active:opacity-[0.10]': true, // M3 pressed state\n\t\t\t// Filled variant hover\n\t\t\t'hover:bg-primary-on': effectiveVariant === 'filled' && this.effectiveColor === 'primary',\n\t\t\t'hover:bg-secondary-on': effectiveVariant === 'filled' && this.effectiveColor === 'secondary',\n\t\t\t'hover:bg-success-on': effectiveVariant === 'filled' && this.effectiveColor === 'success',\n\t\t\t'hover:bg-error-on': effectiveVariant === 'filled' && this.effectiveColor === 'error',\n\t\t\t'hover:bg-warning-on': effectiveVariant === 'filled' && this.effectiveColor === 'warning',\n\t\t\t'hover:bg-info-on': effectiveVariant === 'filled' && this.effectiveColor === 'info',\n\t\t\t'hover:bg-surface-on': effectiveVariant === 'filled' && this.effectiveColor === 'neutral',\n\t\t\t// Outlined, elevated, text variants hover\n\t\t\t'hover:bg-primary-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'primary',\n\t\t\t'hover:bg-secondary-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'secondary',\n\t\t\t'hover:bg-success-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'success',\n\t\t\t'hover:bg-error-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'error',\n\t\t\t'hover:bg-warning-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'warning',\n\t\t\t'hover:bg-info-default': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'info',\n\t\t\t'hover:bg-surface-onVariant': (effectiveVariant === 'outlined' || effectiveVariant === 'elevated' || effectiveVariant === 'text') && this.effectiveColor === 'neutral',\n\t\t\t// Filled tonal hover\n\t\t\t'hover:bg-primary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'primary',\n\t\t\t'hover:bg-secondary-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'secondary',\n\t\t\t'hover:bg-success-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'success',\n\t\t\t'hover:bg-error-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'error',\n\t\t\t'hover:bg-warning-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'warning',\n\t\t\t'hover:bg-info-container': effectiveVariant === 'filled tonal' && this.effectiveColor === 'info',\n\t\t\t'hover:bg-surface-containerLow': effectiveVariant === 'filled tonal' && this.effectiveColor === 'neutral',\n\t\t}\n\n\t\t// If href is provided, render an anchor element.\n\t\tif (this.href) {\n\t\t\treturn html`\n\t\t\t\t<a\n\t\t\t\t\t${magnetic({ strength: 3, radius: 60 })}\n\t\t\t\t\tpart=\"base\"\n\t\t\t\t\thref=${ifDefined(this.disabled ? undefined : this.href)}\n\t\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\t\ttabindex=${this.disabled ? '-1' : '0'}\n\t\t\t\t\taria-disabled=${this.disabled}\n\t\t\t\t\t@click=${this.disabled ? this.preventDefault : undefined}\n\t\t\t\t>\n\t\t\t\t\t${when(!this.disabled, () => html`<div class=\"${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t\t<slot name=\"prefix\"></slot>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t<slot name=\"suffix\"></slot>\n\t\t\t\t</a>\n\t\t\t`\n\t\t}\n\n\t\t// Otherwise, render a native button element.\n\t\treturn html`\n\t\t\t<button\n\t\t\t\t${magnetic({ strength: 3, radius: 60 })}\n\t\t\t\tpart=\"base\"\n\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t?disabled=${this.disabled}\n\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\ttype=${ifDefined(this.type)}\n\t\t\t\ttabindex=${ifDefined(this.disabled ? '-1' : undefined)}\n\t\t\t>\n\t\t\t\t${when(!this.disabled, () => html`<div class=\"${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t<slot name=\"prefix\"></slot>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"suffix\"></slot>\n\t\t\t</button>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-button': SchmancyButton\n\t}\n}\n"],"mappings":"0TAQA,IAAa,GAAA,EAAA,EAAA,eAA8D,sBAAA,ECkBpE,EAAA,cAA6B,EAAA,CAAA,CAAA,OAAA,KAAA,OACnB,CAAC,EAAA,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAgCiB,CAAA,GACjC,EAAA,WAAW,kBACd,KAAM,OACN,eAAA,CAAgB,CAAA,CAAA,CAAA,OAAA,KAAA,eAAA,CAGO,C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