@aceshooting/lyra-ui 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/README.md +87 -14
  2. package/custom-elements.json +11555 -5539
  3. package/dist/components/app-rail/app-rail-item.d.ts +30 -0
  4. package/dist/components/app-rail/app-rail-item.js +68 -0
  5. package/dist/components/app-rail/app-rail-item.styles.d.ts +1 -0
  6. package/dist/components/app-rail/app-rail-item.styles.js +65 -0
  7. package/dist/components/app-rail/app-rail.d.ts +21 -24
  8. package/dist/components/app-rail/app-rail.js +68 -132
  9. package/dist/components/app-rail/app-rail.styles.js +5 -2
  10. package/dist/components/attachment-chip/attachment-chip.d.ts +38 -11
  11. package/dist/components/attachment-chip/attachment-chip.js +73 -29
  12. package/dist/components/attachment-trigger/attachment-trigger.d.ts +13 -0
  13. package/dist/components/attachment-trigger/attachment-trigger.js +13 -1
  14. package/dist/components/attachment-trigger/attachment-trigger.styles.js +28 -6
  15. package/dist/components/chart/bar-chart.js +2 -18
  16. package/dist/components/chart/box-plot.d.ts +25 -1
  17. package/dist/components/chart/box-plot.js +136 -6
  18. package/dist/components/chart/box-plot.styles.js +13 -0
  19. package/dist/components/chart/bubble-chart.js +2 -18
  20. package/dist/components/chart/chart.d.ts +54 -10
  21. package/dist/components/chart/chart.js +182 -39
  22. package/dist/components/chart/doughnut-chart.js +2 -18
  23. package/dist/components/chart/histogram-bin.d.ts +5 -2
  24. package/dist/components/chart/histogram-bin.js +12 -4
  25. package/dist/components/chart/histogram.js +8 -16
  26. package/dist/components/chart/line-chart.js +2 -18
  27. package/dist/components/chart/lite-chart.d.ts +80 -3
  28. package/dist/components/chart/lite-chart.js +250 -53
  29. package/dist/components/chart/pie-chart.js +2 -18
  30. package/dist/components/chart/polar-area-chart.js +2 -18
  31. package/dist/components/chart/radar-chart.js +2 -18
  32. package/dist/components/chart/scatter-chart.js +2 -18
  33. package/dist/components/chat-composer/chat-composer.d.ts +42 -1
  34. package/dist/components/chat-composer/chat-composer.js +84 -3
  35. package/dist/components/chat-composer/chat-composer.styles.js +11 -1
  36. package/dist/components/chat-message/chat-message.d.ts +32 -4
  37. package/dist/components/chat-message/chat-message.js +57 -17
  38. package/dist/components/checkbox/checkbox.d.ts +66 -8
  39. package/dist/components/checkbox/checkbox.js +173 -50
  40. package/dist/components/checkbox/checkbox.styles.js +9 -2
  41. package/dist/components/chip/chip-group.js +8 -2
  42. package/dist/components/chip/chip.js +9 -2
  43. package/dist/components/citation-badge/citation-badge.js +21 -3
  44. package/dist/components/code-block/code-block.d.ts +38 -0
  45. package/dist/components/code-block/code-block.js +72 -7
  46. package/dist/components/code-block/code-loader.d.ts +44 -1
  47. package/dist/components/code-block/code-loader.js +63 -0
  48. package/dist/components/combobox/combobox.d.ts +46 -5
  49. package/dist/components/combobox/combobox.js +175 -35
  50. package/dist/components/combobox/combobox.styles.js +3 -3
  51. package/dist/components/context-meter/context-meter.js +17 -8
  52. package/dist/components/context-meter/context-meter.styles.js +0 -6
  53. package/dist/components/conversation-item/conversation-item.d.ts +13 -16
  54. package/dist/components/conversation-item/conversation-item.js +29 -20
  55. package/dist/components/date-picker/calendar-core.d.ts +24 -0
  56. package/dist/components/date-picker/calendar-core.js +51 -4
  57. package/dist/components/date-picker/date-input.d.ts +77 -10
  58. package/dist/components/date-picker/date-input.js +278 -73
  59. package/dist/components/date-picker/date-picker.d.ts +28 -4
  60. package/dist/components/date-picker/date-picker.js +95 -37
  61. package/dist/components/dialog/confirm.js +3 -6
  62. package/dist/components/dialog/dialog.d.ts +75 -31
  63. package/dist/components/dialog/dialog.js +147 -131
  64. package/dist/components/dialog/dialog.styles.js +46 -2
  65. package/dist/components/dock-panel/dock-panel.d.ts +8 -0
  66. package/dist/components/dock-panel/dock-panel.js +15 -1
  67. package/dist/components/dock-panel/dock-panel.styles.js +15 -1
  68. package/dist/components/document-preview/document-preview.d.ts +15 -7
  69. package/dist/components/document-preview/document-preview.js +29 -13
  70. package/dist/components/empty/empty.d.ts +1 -2
  71. package/dist/components/empty/empty.js +18 -12
  72. package/dist/components/empty/empty.styles.js +0 -3
  73. package/dist/components/export-button/export-button.d.ts +12 -0
  74. package/dist/components/export-button/export-button.js +33 -5
  75. package/dist/components/export-button/export-button.styles.js +5 -1
  76. package/dist/components/file-input/accept.js +2 -0
  77. package/dist/components/file-input/file-input.d.ts +10 -1
  78. package/dist/components/file-input/file-input.js +36 -5
  79. package/dist/components/flag/flag.d.ts +1 -1
  80. package/dist/components/flag/flag.js +15 -1
  81. package/dist/components/flag/flag.styles.js +1 -1
  82. package/dist/components/flag/language-map.d.ts +4 -1
  83. package/dist/components/flag/language-map.js +6 -3
  84. package/dist/components/gauge/gauge.d.ts +10 -1
  85. package/dist/components/gauge/gauge.js +28 -9
  86. package/dist/components/generation-status/generation-status.d.ts +13 -5
  87. package/dist/components/generation-status/generation-status.js +59 -5
  88. package/dist/components/graph/graph.d.ts +37 -3
  89. package/dist/components/graph/graph.js +132 -20
  90. package/dist/components/heatmap/calendar-grid.d.ts +15 -6
  91. package/dist/components/heatmap/calendar-grid.js +17 -6
  92. package/dist/components/heatmap/heatmap-scale.d.ts +5 -1
  93. package/dist/components/heatmap/heatmap-scale.js +8 -2
  94. package/dist/components/heatmap/heatmap.d.ts +166 -25
  95. package/dist/components/heatmap/heatmap.js +372 -89
  96. package/dist/components/json-viewer/json-viewer.d.ts +22 -5
  97. package/dist/components/json-viewer/json-viewer.js +115 -37
  98. package/dist/components/json-viewer/json-viewer.styles.js +2 -1
  99. package/dist/components/kbd/kbd.js +24 -7
  100. package/dist/components/live-region/live-region.d.ts +10 -1
  101. package/dist/components/live-region/live-region.js +42 -6
  102. package/dist/components/map/map.d.ts +24 -1
  103. package/dist/components/map/map.js +89 -24
  104. package/dist/components/markdown/markdown-loader.d.ts +24 -0
  105. package/dist/components/markdown/markdown-loader.js +35 -1
  106. package/dist/components/markdown/markdown.d.ts +46 -8
  107. package/dist/components/markdown/markdown.js +136 -31
  108. package/dist/components/markdown/markdown.styles.js +7 -1
  109. package/dist/components/media-card/media-card.d.ts +25 -17
  110. package/dist/components/media-card/media-card.js +43 -65
  111. package/dist/components/mention-popover/mention-popover.d.ts +4 -1
  112. package/dist/components/mention-popover/mention-popover.js +23 -5
  113. package/dist/components/menu/menu-item.d.ts +32 -3
  114. package/dist/components/menu/menu-item.js +94 -7
  115. package/dist/components/menu/menu-item.styles.js +8 -0
  116. package/dist/components/menu/menu.d.ts +25 -1
  117. package/dist/components/menu/menu.js +99 -3
  118. package/dist/components/menu/menu.styles.js +3 -2
  119. package/dist/components/model-select/model-select.d.ts +48 -3
  120. package/dist/components/model-select/model-select.js +120 -22
  121. package/dist/components/model-select/model-select.styles.js +17 -3
  122. package/dist/components/model-settings-panel/model-settings-panel.d.ts +25 -1
  123. package/dist/components/model-settings-panel/model-settings-panel.js +65 -1
  124. package/dist/components/playback/playback.d.ts +6 -2
  125. package/dist/components/playback/playback.js +72 -29
  126. package/dist/components/playback/playback.styles.js +6 -1
  127. package/dist/components/responsive-panel/responsive-panel.d.ts +29 -16
  128. package/dist/components/responsive-panel/responsive-panel.js +130 -132
  129. package/dist/components/responsive-panel/responsive-panel.styles.js +1 -1
  130. package/dist/components/result-card/result-card.d.ts +8 -2
  131. package/dist/components/result-card/result-card.js +9 -3
  132. package/dist/components/result-card/result-card.styles.js +0 -1
  133. package/dist/components/select/select.d.ts +59 -20
  134. package/dist/components/select/select.js +125 -43
  135. package/dist/components/skeleton/skeleton.d.ts +3 -0
  136. package/dist/components/skeleton/skeleton.js +7 -1
  137. package/dist/components/skeleton/skeleton.styles.js +5 -4
  138. package/dist/components/slider/slider.d.ts +57 -5
  139. package/dist/components/slider/slider.js +195 -80
  140. package/dist/components/source-card/source-card.d.ts +17 -5
  141. package/dist/components/source-card/source-card.js +55 -8
  142. package/dist/components/source-card/source-card.styles.js +1 -1
  143. package/dist/components/source-list/source-list.js +9 -1
  144. package/dist/components/sparkline/sparkline.js +34 -10
  145. package/dist/components/split/split.d.ts +141 -14
  146. package/dist/components/split/split.js +357 -52
  147. package/dist/components/split/split.styles.js +18 -1
  148. package/dist/components/stat/stat.d.ts +10 -4
  149. package/dist/components/stat/stat.js +46 -11
  150. package/dist/components/stream-status/stream-status.d.ts +27 -11
  151. package/dist/components/stream-status/stream-status.js +95 -13
  152. package/dist/components/streaming-text/streaming-text.d.ts +9 -3
  153. package/dist/components/streaming-text/streaming-text.js +25 -10
  154. package/dist/components/streaming-text/streaming-text.styles.js +3 -2
  155. package/dist/components/switch/switch.d.ts +52 -7
  156. package/dist/components/switch/switch.js +111 -40
  157. package/dist/components/switch/switch.styles.js +1 -1
  158. package/dist/components/table/table.d.ts +18 -3
  159. package/dist/components/table/table.js +88 -20
  160. package/dist/components/tabs/tabs.d.ts +23 -0
  161. package/dist/components/tabs/tabs.js +76 -12
  162. package/dist/components/tabs/tabs.styles.js +11 -0
  163. package/dist/components/thinking-panel/thinking-panel.d.ts +3 -1
  164. package/dist/components/thinking-panel/thinking-panel.js +34 -9
  165. package/dist/components/thinking-panel/thinking-panel.styles.js +6 -0
  166. package/dist/components/time-range/time-range.d.ts +59 -2
  167. package/dist/components/time-range/time-range.js +163 -67
  168. package/dist/components/toast/toast-item.d.ts +12 -3
  169. package/dist/components/toast/toast-item.js +90 -53
  170. package/dist/components/toast/toast-item.styles.js +59 -28
  171. package/dist/components/toast/toast.js +17 -5
  172. package/dist/components/toast/toaster.js +10 -1
  173. package/dist/components/tool-approval-dialog/tool-approval-dialog.d.ts +11 -10
  174. package/dist/components/tool-approval-dialog/tool-approval-dialog.js +50 -124
  175. package/dist/components/tool-approval-dialog/tool-approval-dialog.styles.js +1 -1
  176. package/dist/components/tool-call-chip/tool-call-chip.d.ts +18 -2
  177. package/dist/components/tool-call-chip/tool-call-chip.js +86 -25
  178. package/dist/components/tool-param-form/tool-param-form.d.ts +89 -28
  179. package/dist/components/tool-param-form/tool-param-form.js +350 -106
  180. package/dist/components/tool-result-dialog/tool-result-dialog.d.ts +27 -7
  181. package/dist/components/tool-result-dialog/tool-result-dialog.js +80 -115
  182. package/dist/components/tool-result-dialog/tool-result-dialog.styles.js +1 -1
  183. package/dist/components/tool-result-view/registry.d.ts +0 -8
  184. package/dist/components/tool-result-view/registry.js +7 -2
  185. package/dist/components/tool-result-view/tool-result-view.d.ts +6 -3
  186. package/dist/components/tool-result-view/tool-result-view.js +18 -4
  187. package/dist/components/tool-select-dialog/tool-select-dialog.d.ts +11 -11
  188. package/dist/components/tool-select-dialog/tool-select-dialog.js +44 -133
  189. package/dist/components/tool-select-dialog/tool-select-dialog.styles.js +13 -4
  190. package/dist/components/tree/tree-node.d.ts +4 -1
  191. package/dist/components/tree/tree-node.js +4 -1
  192. package/dist/components/tree/tree.d.ts +17 -8
  193. package/dist/components/tree/tree.js +21 -20
  194. package/dist/components/typing-indicator/typing-indicator.d.ts +12 -2
  195. package/dist/components/typing-indicator/typing-indicator.js +16 -4
  196. package/dist/components/typing-indicator/typing-indicator.styles.js +2 -2
  197. package/dist/components/virtual-list/virtual-list.d.ts +56 -19
  198. package/dist/components/virtual-list/virtual-list.js +184 -38
  199. package/dist/components/virtual-list/virtual-list.styles.js +12 -0
  200. package/dist/components/widget/widget.d.ts +5 -4
  201. package/dist/components/widget/widget.js +54 -120
  202. package/dist/components/widget/widget.styles.js +8 -2
  203. package/dist/components/word-cloud/word-cloud-layout.d.ts +7 -0
  204. package/dist/components/word-cloud/word-cloud-layout.js +20 -6
  205. package/dist/components/word-cloud/word-cloud.d.ts +22 -2
  206. package/dist/components/word-cloud/word-cloud.js +45 -6
  207. package/dist/components/word-cloud/word-cloud.styles.js +13 -1
  208. package/dist/internal/anchored-validity.d.ts +1 -0
  209. package/dist/internal/anchored-validity.js +86 -0
  210. package/dist/internal/form-associated.d.ts +7 -0
  211. package/dist/internal/form-associated.js +43 -4
  212. package/dist/internal/numbers.d.ts +12 -0
  213. package/dist/internal/numbers.js +26 -0
  214. package/dist/internal/overlay-manager.d.ts +51 -0
  215. package/dist/internal/overlay-manager.js +523 -0
  216. package/dist/internal/positioner.js +27 -3
  217. package/dist/internal/safe-url.d.ts +12 -0
  218. package/dist/internal/safe-url.js +41 -0
  219. package/dist/internal/tokens.styles.js +17 -11
  220. package/dist/lyra.d.ts +5 -2
  221. package/dist/lyra.js +3 -1
  222. package/llms-full.txt +970 -426
  223. package/llms.txt +5 -4
  224. package/package.json +19 -2
@@ -41,18 +41,26 @@ export class LyraSparkline extends LyraElement {
41
41
  }
42
42
  static { this.styles = [LyraElement.styles, styles]; }
43
43
  points() {
44
+ // Non-finite samples (NaN/undefined/null from upstream computed data)
45
+ // can't be plotted or compared -- drop them up front so one bad point
46
+ // can't inject a literal "NaN" into the path `d` string and truncate
47
+ // every point that follows it.
48
+ const raw = this.values.filter((n) => Number.isFinite(n));
44
49
  // Auto min/max is scanned from the full, pre-decimation `values` -- doing
45
50
  // this after decimating would silently narrow the scale to whatever the
46
51
  // sampled subset happens to contain, which can clip or misproportion a
47
- // real extreme value that decimation happened to drop.
48
- const raw = this.values;
52
+ // real extreme value that decimation happened to drop. Skip the scan
53
+ // entirely when both bounds are already given explicitly -- its result
54
+ // would just be discarded.
49
55
  let autoLo = raw[0];
50
56
  let autoHi = raw[0];
51
- for (const n of raw) {
52
- if (n < autoLo)
53
- autoLo = n;
54
- if (n > autoHi)
55
- autoHi = n;
57
+ if (this.min === undefined || this.max === undefined) {
58
+ for (const n of raw) {
59
+ if (n < autoLo)
60
+ autoLo = n;
61
+ if (n > autoHi)
62
+ autoHi = n;
63
+ }
56
64
  }
57
65
  const lo = this.min ?? autoLo;
58
66
  const hi = this.max ?? autoHi;
@@ -67,7 +75,14 @@ export class LyraSparkline extends LyraElement {
67
75
  willUpdate() {
68
76
  const v = this.values;
69
77
  this.setAttribute('role', 'img');
70
- this.setAttribute('aria-label', v.length ? `Trend of ${v.length} values, last ${v.at(-1)}` : 'No data');
78
+ const last = v.at(-1);
79
+ // Real-world computed data (ratios, averages, percentages) carries
80
+ // floating-point noise that isn't meaningful to announce -- round it for
81
+ // the label the same way a human-facing value would be formatted.
82
+ const formattedLast = typeof last === 'number' && Number.isFinite(last)
83
+ ? last.toLocaleString(undefined, { maximumFractionDigits: 2 })
84
+ : last;
85
+ this.setAttribute('aria-label', v.length ? `Trend of ${v.length} values, last ${formattedLast}` : 'No data');
71
86
  }
72
87
  render() {
73
88
  const v = this.values;
@@ -84,16 +99,25 @@ export class LyraSparkline extends LyraElement {
84
99
  const slot = VIEW / pts.length;
85
100
  const barWidth = Math.min(4, Math.max(1, slot * 0.7));
86
101
  const bars = pts.map(([x, y]) => {
87
- const barY = Math.min(y, VIEW);
102
+ // Clamp symmetrically: a value below an explicit `min` pushes `y`
103
+ // above VIEW, and a value above an explicit `max` pushes it below 0 --
104
+ // only clamping one side left the other free to draw a negative-y,
105
+ // oversized rect that bled outside the sparkline's box.
106
+ const barY = Math.min(VIEW, Math.max(0, y));
88
107
  return svg `<rect part="bar" x="${x - barWidth / 2}" y="${barY}" width="${barWidth}" height="${VIEW - barY}"></rect>`;
89
108
  });
90
109
  return html `<svg viewBox="0 0 ${VIEW} ${VIEW}" preserveAspectRatio="none" aria-hidden="true">
91
110
  ${bars}
92
111
  </svg>`;
93
112
  }
113
+ // pts can end up empty even though `values` itself isn't -- e.g. every
114
+ // entry was non-finite and got filtered out -- so the single-point
115
+ // fallback below can't assume pts[0] exists.
94
116
  const d = pts.length > 1
95
117
  ? pts.map(([x, y], i) => `${i ? 'L' : 'M'}${x},${y}`).join(' ')
96
- : `M${pts[0][0]},${pts[0][1]} L${pts[0][0]},${pts[0][1]}`;
118
+ : pts.length === 1
119
+ ? `M${pts[0][0]},${pts[0][1]} L${pts[0][0]},${pts[0][1]}`
120
+ : '';
97
121
  return html `<svg viewBox="0 0 ${VIEW} ${VIEW}" preserveAspectRatio="none" aria-hidden="true">
98
122
  ${this.type === 'area' ? svg `<path part="area" d="${d} L${VIEW},${VIEW} L0,${VIEW} Z"></path>` : ''}
99
123
  <path part="line" d="${d}"></path>
@@ -7,6 +7,14 @@ export interface PanelConstraint {
7
7
  minPx?: number;
8
8
  maxPx?: number;
9
9
  }
10
+ export type SplitConstraintIssueReason = 'minimum-total' | 'maximum-total' | 'minimum-exceeds-maximum';
11
+ export interface SplitConstraintIssueDetail {
12
+ reason: SplitConstraintIssueReason;
13
+ panelCount: number;
14
+ minimumTotal: number;
15
+ maximumTotal: number | null;
16
+ containerSize: number;
17
+ }
10
18
  /** Which pane (if any) participates in responsive collapse (see `collapse`). */
11
19
  export type SplitCollapseMode = 'start' | 'end' | 'none';
12
20
  /** The collapsing pane's current responsive state — `'wide'` is the normal
@@ -14,6 +22,9 @@ export type SplitCollapseMode = 'start' | 'end' | 'none';
14
22
  * clamps it to `railWidth`; `'floating'` lifts it out of the flex flow as an
15
23
  * overlay above the other pane. */
16
24
  export type SplitCollapseState = 'wide' | 'rail' | 'floating';
25
+ /** What can be *assigned* to `collapseState` -- `'auto'` is a write-only
26
+ * sentinel; see the `collapseState` accessor doc. */
27
+ export type SplitCollapseStateInput = SplitCollapseState | 'auto';
17
28
  export interface SplitCollapseChangeDetail {
18
29
  state: SplitCollapseState;
19
30
  }
@@ -33,19 +44,58 @@ export interface SplitCollapseChangeDetail {
33
44
  * icon-only/collapsed UI of its own; slotted content is expected to adapt to
34
45
  * its own clamped width (e.g. via its own container query).
35
46
  *
47
+ * `collapseState` is a public accessor with force/auto semantics mirroring
48
+ * `<lyra-app-rail>`'s `mode`: it's normally derived automatically from the
49
+ * measured container width (via a `ResizeObserver` on `[part="base"]`)
50
+ * whenever it crosses `railBreakpoint`/`floatBreakpoint`, but assigning it a
51
+ * concrete `'wide'`/`'rail'`/`'floating'` value pins it there and stops that
52
+ * automatic tracking — useful for a consumer-driven toggle (e.g. a button
53
+ * that forces `'floating'` regardless of width). Assigning the write-only
54
+ * `'auto'` sentinel releases the pin and immediately re-derives the state
55
+ * from the current measured width, resuming automatic tracking. `'auto'` is
56
+ * never a value this getter returns.
57
+ *
58
+ * The `'floating'` state is a hidden-by-default drawer, gated by `open`
59
+ * (mirrors `<lyra-app-rail>`'s mobile overlay): while `collapseState` is
60
+ * `'floating'` and `open` is `false` (the default), the collapsing panel
61
+ * renders nothing — `hidden`, out of the accessibility tree, not just
62
+ * visually hidden — instead of the always-visible overlay card this state
63
+ * rendered before `open` existed. Setting `open = true` reveals it as a
64
+ * focus-trapped floating panel with a `[part="backdrop"]` scrim; Escape or a
65
+ * backdrop click set `open` back to `false`. `open` is preserved (not reset)
66
+ * while `collapseState` isn't `'floating'`, but no drawer chrome renders
67
+ * until it is again — except that leaving `'floating'` while `open` is
68
+ * `true` (a breakpoint crossing back to `'wide'`/`'rail'`, or a forced
69
+ * reassignment) also closes it, the same way `<lyra-app-rail>` closes its
70
+ * mobile overlay when leaving `'mobile'` while open.
71
+ *
36
72
  * @customElement lyra-split
37
73
  * @event lyra-resize - `detail: { sizes }`, fired on every drag step/release
38
74
  * and every keyboard step.
39
75
  * @event lyra-split-collapse-change - `detail: { state }` (`SplitCollapseChangeDetail`),
40
76
  * fired whenever the responsive `collapseState` actually transitions between
41
- * `'wide'`/`'rail'`/`'floating'`. Only relevant when `collapse` isn't `"none"`;
42
- * never fires otherwise.
77
+ * `'wide'`/`'rail'`/`'floating'` whether from a breakpoint crossing or an
78
+ * explicit `collapseState` assignment. Only relevant when `collapse` isn't
79
+ * `"none"`; never fires otherwise. Not fired for a redundant reassignment
80
+ * to the state already in effect.
81
+ * @event lyra-split-constraints-invalid - `detail: SplitConstraintIssueDetail`,
82
+ * fired once when the configured panel minimums/maximums cannot describe a
83
+ * layout that fits the track. The splitter rejects that infeasible set for
84
+ * interaction and falls back to a normalized percent minimum.
43
85
  * @slot - Panels to arrange side by side (or stacked, when `orientation="vertical"`); each direct child becomes one resizable panel.
44
86
  * @csspart base - The flex layout wrapper (`position: relative`, so the `'floating'` collapse state can anchor to it).
45
87
  * @csspart divider - Each divider between two panels; carries `aria-disabled="true"` and is drag/keyboard-inert while its adjacent panel is collapsed (`'rail'`/`'floating'`).
88
+ * @csspart backdrop - The `'floating'` drawer's scrim. Only rendered while `collapseState === 'floating'` and `open`.
46
89
  */
47
90
  export declare class LyraSplit extends LyraElement {
48
91
  static styles: import("lit").CSSResultGroup[];
92
+ static properties: {
93
+ collapseState: {
94
+ reflect: boolean;
95
+ attribute: string;
96
+ noAccessor: boolean;
97
+ };
98
+ };
49
99
  sizes: number[];
50
100
  min: number;
51
101
  orientation: 'horizontal' | 'vertical';
@@ -74,17 +124,74 @@ export declare class LyraSplit extends LyraElement {
74
124
  /** Container width (px) below which the collapsing pane instead becomes an
75
125
  * absolutely-positioned overlay above the other pane (`'floating'` state). */
76
126
  floatBreakpoint: number;
127
+ /** Whether the `'floating'` collapse state's drawer is shown. Only
128
+ * meaningful while `collapseState` is `'floating'` — the value is
129
+ * preserved (not reset) while another state is active, but no drawer
130
+ * chrome renders until `collapseState` is `'floating'` again. Defaults to
131
+ * `false`: the collapsing pane renders nothing while floating until a
132
+ * consumer opts in by setting this (or it's forced open programmatically)
133
+ * — see the class doc. */
134
+ open: boolean;
77
135
  private panelCount;
78
- /** The collapsing pane's current responsive state; always `'wide'` (a
79
- * no-op) while `collapse === 'none'`. */
80
- private collapseState;
136
+ private _collapseState;
137
+ private _forced;
138
+ private overlayActive;
139
+ private justOpened;
140
+ private releaseScrollLock?;
141
+ private overlayHandle?;
81
142
  private drags;
82
143
  private stylizedPanels;
144
+ private constraintIssueKey;
83
145
  private baseEl?;
84
146
  private collapseResizeObserver?;
85
147
  connectedCallback(): void;
86
148
  disconnectedCallback(): void;
87
149
  protected firstUpdated(): void;
150
+ /** Both branches here derive one reactive property from another with no
151
+ * DOM measurement involved, so they belong in `willUpdate()` rather than
152
+ * `updated()`: setting a reactive property from `updated()`/
153
+ * `firstUpdated()` schedules a *second* update on top of the one that
154
+ * just finished, which Lit's dev-mode console flags ("scheduled an
155
+ * update ... after an update completed"). Both of these were real and
156
+ * reproducible in normal usage, not just test artifacts --
157
+ * `ensureSizes()` on any direct `sizes` assignment whose length doesn't
158
+ * match `panelCount` (e.g. a consumer correcting a stale layout), and the
159
+ * `collapseState` reset on every `collapse` -> `'none'` transition. The
160
+ * `collapse !== 'none'` re-arm path in `syncCollapseObserver()` still
161
+ * needs a freshly measured container width and stays in `updated()` --
162
+ * see `armCollapseObserver()`'s own doc comment for why *that* one is the
163
+ * documented exception instead (mirrors virtual-list.ts's
164
+ * `attachContainerListeners()`). */
165
+ protected willUpdate(changed: PropertyValues): void;
166
+ /**
167
+ * The collapsing pane's current responsive state. Always one of the three
168
+ * real states — never `'auto'` — reflecting either the live measured
169
+ * width or, once forced, whatever was last assigned. See the class doc for
170
+ * the full force/auto contract (mirrors `<lyra-app-rail>`'s `mode`).
171
+ */
172
+ get collapseState(): SplitCollapseState;
173
+ set collapseState(next: SplitCollapseStateInput);
174
+ /** The container width (px) `[part="base"]` is measured at right now --
175
+ * used to re-derive `collapseState` immediately when a forced value is
176
+ * released back to `'auto'`, outside of the `ResizeObserver`'s own
177
+ * (async, entry-driven) callback. Mirrors the synchronous initial read
178
+ * `armCollapseObserver()` already does when it (re-)arms. */
179
+ private currentMeasuredWidth;
180
+ /** Resets `collapseState` back to its `'wide'` default and releases any
181
+ * force, bypassing the public accessor's pin/event-emit side effects --
182
+ * used only for the `collapse -> 'none'` housekeeping reset in
183
+ * `willUpdate()`, which is purely internal bookkeeping (the feature is
184
+ * off entirely), not a state transition a consumer forced or observed. */
185
+ private resetCollapseState;
186
+ /** Applies an actual `collapseState` transition (no-op if `next` matches
187
+ * the current value): updates the field, triggers Lit's reflect/re-render
188
+ * via `requestUpdate`, and fires `lyra-split-collapse-change`. Shared by
189
+ * both the `ResizeObserver`-driven measurement path (`updateCollapseState`)
190
+ * and the accessor's forced-value assignment, so the two never duplicate
191
+ * this logic. Leaving `'floating'` while `open` is still `true` also
192
+ * closes the drawer -- mirrors `<lyra-app-rail>` closing its mobile
193
+ * overlay when `mode` leaves `'mobile'` while open. */
194
+ private applyCollapseStateChange;
88
195
  private get storageFullKey();
89
196
  private loadPersisted;
90
197
  private persist;
@@ -118,8 +225,12 @@ export declare class LyraSplit extends LyraElement {
118
225
  * meaningful to resize against while the pane is rail/floating-width). */
119
226
  private isDividerDisabled;
120
227
  /** Classifies a measured container width into the collapsing pane's
121
- * responsive state and, only on an actual transition, updates
122
- * `collapseState` and fires `lyra-split-collapse-change`. */
228
+ * responsive state and, only on an actual transition, applies it (via the
229
+ * same `applyCollapseStateChange()` the accessor's forced-value path
230
+ * uses). Gated behind `_forced` so a pinned `collapseState` is never
231
+ * silently overwritten by a subsequent resize — this is also what the
232
+ * accessor's `'auto'` release calls (with the current measured width) to
233
+ * re-derive the state without duplicating the width-vs-breakpoint logic. */
123
234
  private updateCollapseState;
124
235
  /** Creates (idempotently) and (re-)observes `[part="base"]` with the
125
236
  * collapse-state `ResizeObserver` — a no-op until `baseEl` exists (see
@@ -130,17 +241,33 @@ export declare class LyraSplit extends LyraElement {
130
241
  * lyra-virtual-list's `containerResizeObserver` synchronous initial read. */
131
242
  private armCollapseObserver;
132
243
  /** Reacts to a live `collapse` property change (as opposed to the
133
- * connect/first-render arming above): turns the observer on/off, and
134
- * resets `collapseState` back to its `'wide'` default when collapse is
135
- * switched off so no stale rail/floating styling survives it. */
244
+ * connect/first-render arming above): turns the observer on/off. The
245
+ * `collapseState` reset for the `'none'` case lives in `willUpdate()`
246
+ * instead (see its doc comment) so no stale rail/floating styling
247
+ * survives switching collapse off, without the extra render pass a
248
+ * property set here would cost. */
136
249
  private syncCollapseObserver;
137
- /** Resolves panel `index`'s effective percent min/max for this clamp pass:
138
- * a `panelConstraints` entry's px bound converted against the live
139
- * `containerSize`, or the component's plain percent `min` (no upper
140
- * bound) when the panel carries no constraint for that side. */
250
+ /** The safe fallback for a shared percent minimum. A value above the
251
+ * available share is still useful as a consumer intent, but it cannot be
252
+ * honored for every panel at once, so reduce it proportionally. */
253
+ private normalizedDefaultMin;
254
+ /** Resolves all panel bounds together so aggregate feasibility is checked
255
+ * before an individual divider is asked to clamp a pair. An invalid set is
256
+ * rejected as a whole: interaction uses the safe shared minimum instead of
257
+ * exposing a divider whose minimum is greater than its maximum. */
258
+ private resolveConstraintBounds;
141
259
  private percentBounds;
142
260
  private clampPair;
143
261
  private applyDelta;
262
+ /** The collapsing pane's light-DOM element itself — the `'floating'`
263
+ * drawer's focus-trap/backdrop target. There's no separate shadow-DOM
264
+ * panel to trap focus within (unlike `<lyra-app-rail>`'s `[part="panel"]`):
265
+ * the slotted panel *is* the floating drawer, just repositioned via
266
+ * inline styles in `updated()`. */
267
+ private get floatingPanelEl();
268
+ private activateFloatingOverlay;
269
+ private deactivateFloatingOverlay;
270
+ private onBackdropClick;
144
271
  private onPointerDown;
145
272
  private onPointerMove;
146
273
  private onPointerUp;