@aceshooting/lyra-ui 18.0.0 → 18.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.
- package/CHANGELOG.md +229 -0
- package/custom-elements.json +1 -1
- package/design-tokens.json +1 -1
- package/dist/cli/migration-contract.json +1 -1
- package/dist/components/conversation/message-actions/message-actions.class.d.ts +2 -1
- package/dist/components/forms/combobox/combobox.styles.js +1 -1
- package/dist/components/forms/icon-button/icon-button.class.d.ts +18 -9
- package/dist/components/forms/select/select.class.d.ts +34 -5
- package/dist/components/forms/select/select.class.js +4 -4
- package/dist/components/forms/select/select.styles.js +1 -1
- package/dist/components/layout/filter-bar/filter-bar.class.d.ts +80 -8
- package/dist/components/layout/filter-bar/filter-bar.class.js +11 -3
- package/dist/components/layout/filter-bar/filter-bar.styles.js +1 -1
- package/dist/components/layout/virtual-list/virtual-list.class.d.ts +47 -16
- package/dist/components/layout/virtual-list/virtual-list.class.js +1 -1
- package/dist/components/media/map/map.class.d.ts +134 -5
- package/dist/components/media/map/map.class.js +48 -21
- package/dist/components/media/map/map.styles.js +1 -1
- package/dist/components/utility/copy-button/copy-button.class.d.ts +4 -3
- package/dist/custom-elements-jsx.d.ts +1 -1
- package/dist/events.d.ts +7 -1
- package/dist/internal/package-metadata.d.ts +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/tokens.styles.js +1 -1
- package/dist/lyra.d.ts +1 -1
- package/dist/styles/tokens-root.css +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/testing/lyra-tag-event-map.js +1 -1
- package/dist/vue.d.ts +1 -1
- package/llms/components/lr-combobox.md +8 -4
- package/llms/components/lr-filter-bar.md +37 -4
- package/llms/components/lr-icon-button.md +15 -7
- package/llms/components/lr-map.md +68 -6
- package/llms/components/lr-option.md +8 -4
- package/llms/components/lr-select.md +30 -5
- package/llms/shared.md +41 -0
- package/llms/tokens.md +7 -4
- package/llms-full.txt +203 -25
- package/package.json +1 -1
- package/vscode-css-data.json +1 -1
- package/vscode-html-data.json +1 -1
- package/web-types.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,234 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 18.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6137062: `<lr-filter-bar>`: under `activeFiltersDisplay="changed"`, the reset button now keys its enablement
|
|
8
|
+
on `hasChangedFilters` instead of `hasActiveFilters`.
|
|
9
|
+
|
|
10
|
+
`'changed'` exists to say that a filter sitting at its own declared `defaultValue` is not something
|
|
11
|
+
the user applied, and it already suppressed that filter's chip. The reset button next to the empty
|
|
12
|
+
chip row stayed enabled anyway, so a defaults-only bar rendered "nothing is applied" and "press here
|
|
13
|
+
to clear what's applied" side by side, and pressing it was a no-op that still emitted `lr-input` and
|
|
14
|
+
`lr-reset`.
|
|
15
|
+
|
|
16
|
+
Nothing else changes: enablement under `activeFiltersDisplay="all"` (the default) and `"hidden"` is
|
|
17
|
+
byte for byte what it was, `disabled`/`loading` still win in every mode, `hasActiveFilters` keeps its
|
|
18
|
+
meaning, and `reset()` itself is untouched — it still restores every declared `defaultValue`.
|
|
19
|
+
- 6137062: `<lr-filter-bar>`: add a public read-only `hasChangedFilters`.
|
|
20
|
+
|
|
21
|
+
`hasActiveFilters` answers "does any filter hold a value", which is deliberately `true` for a bar
|
|
22
|
+
whose filters were declared with their own non-empty `defaultValue` and have never been touched —
|
|
23
|
+
so a host that wanted to show "3 filters applied", enable an "Apply"/"Save search" action, or badge
|
|
24
|
+
a collapsed filter panel had to re-derive the default comparison itself from `filters` and `value`.
|
|
25
|
+
`hasChangedFilters` exposes it directly, using the exact equality `activeFiltersDisplay: 'changed'`
|
|
26
|
+
already filters its chip row on: a `readonly string[]` default compares positionally, everything
|
|
27
|
+
else compares with `Object.is`, and a filter with no declared `defaultValue` counts as changed the
|
|
28
|
+
moment it holds any value at all. Clearing a filter that *does* declare one also counts as changed,
|
|
29
|
+
since `reset()` would restore it — which is the one case where it differs from the `'changed'` chip
|
|
30
|
+
row, whose entries are non-empty values by construction.
|
|
31
|
+
|
|
32
|
+
`hasActiveFilters` is unchanged, and so is every existing behaviour keyed on it.
|
|
33
|
+
- 6137062: `<lr-filter-bar>`: a filter definition's `labelVisibility` accepts a third value, `'auto'`.
|
|
34
|
+
|
|
35
|
+
`'visible'` and `'hidden'` were an all-or-nothing choice made once, at definition time, for a
|
|
36
|
+
component that is as likely to sit in a 320px side panel as across a full page — so a bar authored
|
|
37
|
+
for a dashboard lost a whole row of vertical space in a drawer, and one authored for the drawer
|
|
38
|
+
shipped unlabelled fields to the dashboard. `'auto'` renders exactly what `'visible'` does (same
|
|
39
|
+
stacked label element, same accessible name computed from it, no `aria-label` and no placeholder
|
|
40
|
+
fallback) and visually clips that label once the bar's **own** allocation — a container query on the
|
|
41
|
+
host, not the viewport — drops below `30rem`. The label element stays in the DOM at every width, so
|
|
42
|
+
the field's accessible name is identical in both states; the previous workaround, visually hiding
|
|
43
|
+
`::part(filter-control-label)` from a consumer stylesheet, removed the name along with the text.
|
|
44
|
+
|
|
45
|
+
`'checkbox-menu'` participates through its own trigger label run, the same one `'hidden'` already
|
|
46
|
+
clips there.
|
|
47
|
+
|
|
48
|
+
`'visible'`, `'hidden'` and an unset `labelVisibility` are unchanged at every allocation. The host
|
|
49
|
+
does become an inline-size query container (with the library's standard
|
|
50
|
+
`contain-intrinsic-inline-size` fallback), which is a no-op for a bar in an ordinary block or flex
|
|
51
|
+
allocation.
|
|
52
|
+
- 3f4be41: `<lr-map>`: add `legendCollapsible`/`legendOpen` and the cancelable `lr-map-legend-panel-toggle`.
|
|
53
|
+
|
|
54
|
+
The legend panel could not be collapsed at all, so a large key permanently covered part of the map.
|
|
55
|
+
`legend-collapsible` renders a native disclosure button inside the panel whose visible localized
|
|
56
|
+
text is its accessible name, whose `aria-expanded` renders the literal `"true"`/`"false"`, and whose
|
|
57
|
+
`aria-controls` names the row list in the same shadow root. `legendOpen` defaults **open**, so adding
|
|
58
|
+
only `legendCollapsible` never hides an existing key; it is a `true`-defaulting boolean, so
|
|
59
|
+
`legend-open="false"` parses and the open default reflects as an absent attribute.
|
|
60
|
+
|
|
61
|
+
Activation emits the cancelable `lr-map-legend-panel-toggle` (`detail: { open }`). `preventDefault()`
|
|
62
|
+
is a real veto — nothing is written and nothing re-renders — so a host can own the open state, and a
|
|
63
|
+
programmatic `legendOpen` assignment reconciles without emitting, so a controlled host cannot loop.
|
|
64
|
+
Collapsing hides the gradient, the rows, the `legend-limit` summary and the trailing `legend` slot;
|
|
65
|
+
the `legend-start` slot and the disclosure stay visible. New `legend-disclosure` and
|
|
66
|
+
`legend-disclosure-icon` parts. With `legendCollapsible` unset the rendered legend is unchanged.
|
|
67
|
+
- 3f4be41: `<lr-map>`: add an optional `group` to `LyraMapLegendEntry`, splitting the legend into sections.
|
|
68
|
+
|
|
69
|
+
`legend` was one flat array rendered as a single list, so a key covering two layers could not say
|
|
70
|
+
which rows belonged to which. Consecutive entries sharing an identical `group` now render as one
|
|
71
|
+
section — a visible `legend-group-heading` plus a `role="group"` that heading names through
|
|
72
|
+
`aria-labelledby`. The grouping rule is pinned rather than inferred: an entry with no `group` keeps
|
|
73
|
+
its **declared** position (never hoisted or sunk), and a `group` that reappears after an interruption
|
|
74
|
+
opens a second section rather than reordering rows to merge them.
|
|
75
|
+
|
|
76
|
+
`group` is caller-supplied data, so it renders verbatim and is never passed through the locale
|
|
77
|
+
catalog; it is trimmed, bounded to 256 characters, and a non-string, empty or whitespace-only value
|
|
78
|
+
means "ungrouped" rather than an empty heading. Sections are not rows: the 100-row cap and the
|
|
79
|
+
`legend-limit` summary still count rows. A grouped legend gives each run its own `role="list"`
|
|
80
|
+
(a `list` may only own `listitem`s), while a legend with no groups renders exactly as before. New
|
|
81
|
+
`legend-group` and `legend-group-heading` parts.
|
|
82
|
+
- 3f4be41: `<lr-map>`: add a `legend-start` slot that renders at the top of the legend panel.
|
|
83
|
+
|
|
84
|
+
The panel's only host extension point was `slot="legend"`, which renders after the gradient bar and
|
|
85
|
+
every projected row — so a host-authored panel header (a title, a source note, a control) could only
|
|
86
|
+
ever be a footer. `legend-start` renders ahead of both. Content in it alone opens the panel, exactly
|
|
87
|
+
as `legend` content alone already did, and it is never made interactive by `legendInteractive`. The
|
|
88
|
+
existing `legend` slot keeps its position, so an unset map's legend markup is unchanged.
|
|
89
|
+
- 42af229: `<lr-select>`: `loading` now covers the whole pending state, not only its committed-value half.
|
|
90
|
+
It already rewrote an unresolved committed value's label to the localized `loading` text and
|
|
91
|
+
suppressed the "not in catalog" badge; with nothing selected at all -- a create form whose option
|
|
92
|
+
catalogue is still being fetched, or an edit form whose saved selection is legitimately empty --
|
|
93
|
+
`labelFor()` was never reached and the trigger fell through to the consumer's own `placeholder`.
|
|
94
|
+
Covering that half meant hand-writing a conditional placeholder bound to the same flag and
|
|
95
|
+
re-localizing, in the consuming app's own catalogue, the exact string this control already owns.
|
|
96
|
+
|
|
97
|
+
The trigger now renders the same localized text in place of `placeholder` while `loading` is
|
|
98
|
+
`true` and the selection is empty -- the existing `loading` message key, so both halves always read
|
|
99
|
+
the same words and a `registerLyraLocale()` translation reaches them both. With `loading` false an
|
|
100
|
+
empty selection renders the consumer's `placeholder` exactly as before, `value` is never touched,
|
|
101
|
+
and the trigger's accessible name is unchanged: a host `aria-label` still wins, then `label`, then
|
|
102
|
+
`placeholder`, then the localized `select` fallback.
|
|
103
|
+
- 42af229: `<lr-select>`: new `sync` property, closing the shared anchored-surface sizing vocabulary
|
|
104
|
+
`<lr-popup>`, `<lr-popover>`, `<lr-dropdown>` and `<lr-combobox>` already spell. It takes the same
|
|
105
|
+
`'width' | 'height' | 'both'` type (`PlaceSync`), the same unset default, and is wired through the
|
|
106
|
+
same `place()` option, so `sync="width"` copies the rendered trigger width onto the listbox: a
|
|
107
|
+
full-width select with short option labels no longer opens a listbox visibly narrower than, and
|
|
108
|
+
floating centred under, its own trigger. Changes reposition an already-open listbox without closing
|
|
109
|
+
it, and unsetting it releases the inline width the positioner wrote.
|
|
110
|
+
|
|
111
|
+
With `sync` unset the listbox renders exactly as before -- `inline-size: max-content` between
|
|
112
|
+
`--lr-size-12rem` and `min(--lr-popover-viewport-clamp, --lr-size-28rem)`. A synced listbox is
|
|
113
|
+
capped on `--lr-positioner-available-inline-size` alone, adopting the corrected clamp rather than
|
|
114
|
+
the viewport-clamp shortfall it would otherwise have inherited, so it matches its trigger at any
|
|
115
|
+
width while the measured available space still keeps it on screen.
|
|
116
|
+
- b22fdbb: Design tokens: add `--lr-icon-button-size-scope`, an ancestor-scoped input for the icon-only
|
|
117
|
+
control size.
|
|
118
|
+
|
|
119
|
+
`--lr-icon-button-size` is element-scoped and has to stay that way: the shared token layer
|
|
120
|
+
re-declares it on every `lr-*` host so the coarse-pointer touch-target floor can apply per element.
|
|
121
|
+
The side effect is that a wrapper setting `--lr-icon-button-size` is replaced at the first
|
|
122
|
+
component in between, so it never reaches an icon button composed inside another component — a
|
|
123
|
+
`<lr-icon-button>` slotted through `<lr-popover>`, or the copy affordance inside `<lr-code-block>`.
|
|
124
|
+
The only ancestor lever was `--lr-theme-icon-button-size`, which is application-wide by design, so
|
|
125
|
+
"make just this toolbar denser" meant reaching for the global theme input and scoping it by hand.
|
|
126
|
+
|
|
127
|
+
`--lr-icon-button-size-scope` is declared nowhere, so it inherits the whole way down and reaches
|
|
128
|
+
every icon-only control below the wrapper that sets it:
|
|
129
|
+
|
|
130
|
+
```css
|
|
131
|
+
.message-toolbar {
|
|
132
|
+
--lr-icon-button-size-scope: 1.75rem;
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Precedence is `--lr-theme-icon-button-size` → `--lr-icon-button-size-scope` → the `2.5rem` default,
|
|
137
|
+
and the coarse-pointer floor still raises a resolved value below `2.75rem` back to it, so the new
|
|
138
|
+
knob is not a route around WCAG 2.2 SC 2.5.8. Purely additive: `--lr-icon-button-size` keeps its
|
|
139
|
+
current element-scoped behaviour exactly, and the resolved default is unchanged.
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- 6137062: Docs: `<lr-filter-bar>`'s consumer reference now covers `hasChangedFilters` (and how it differs from
|
|
144
|
+
`hasActiveFilters` on a defaults-only bar), the `activeFiltersDisplay="changed"` reset-enablement
|
|
145
|
+
coupling, and `labelVisibility: 'auto'` with its `30rem` container-query threshold.
|
|
146
|
+
- 3f4be41: Document `<lr-map>`'s collapsible legend, `legend-start` slot and legend sections in the authored
|
|
147
|
+
`llms/media.md` reference: `legendCollapsible`/`legendOpen` (including the `true` default and the
|
|
148
|
+
`legend-open="false"` parse), the cancelable `lr-map-legend-panel-toggle`, the `group` field and its
|
|
149
|
+
pinned ordering rule, and the four new parts.
|
|
150
|
+
- 42af229: `<lr-combobox>`: a `sync="width"`/`sync="both"` listbox is no longer shortened by
|
|
151
|
+
`--lr-popover-viewport-clamp`. The synced rule capped the listbox at
|
|
152
|
+
`min(var(--lr-popover-viewport-clamp), var(--lr-positioner-available-inline-size, 100vw))`, and the
|
|
153
|
+
clamp's 92vw default resolves below the width of exactly the full-width trigger `sync` exists to
|
|
154
|
+
serve -- a 738px trigger in an 800px viewport got a 736px listbox, and the shortfall grows with the
|
|
155
|
+
trigger. The synced rule now caps on `var(--lr-positioner-available-inline-size, 100vw)` alone,
|
|
156
|
+
matching `<lr-popup>`: a width-synced listbox is anchored to an element already on screen and
|
|
157
|
+
measured against the space actually available beside it, so the extra viewport ceiling had nothing
|
|
158
|
+
left to protect against, while the available-space term still keeps an over-wide anchor from
|
|
159
|
+
pushing the listbox off-screen. An unsynced listbox is unchanged and keeps
|
|
160
|
+
`min(--lr-popover-viewport-clamp, --lr-size-28rem)`.
|
|
161
|
+
- 42af229: Docs: `llms/forms.md` now documents `<lr-select>`'s new `sync` property (same vocabulary note as
|
|
162
|
+
`<lr-combobox>`'s, stating its unset default), records that a width-synced listbox on **both**
|
|
163
|
+
controls is capped on `--lr-positioner-available-inline-size` alone rather than also by
|
|
164
|
+
`--lr-popover-viewport-clamp`, and describes `loading`'s coverage of an empty selection alongside
|
|
165
|
+
the `placeholder` entry it now takes precedence over.
|
|
166
|
+
- b22fdbb: Design tokens: derive the dark-mode overlay surface from the page surface instead of pinning it.
|
|
167
|
+
|
|
168
|
+
`--lr-color-surface-overlay` is the panel colour behind every floating surface — dropdowns,
|
|
169
|
+
listboxes, menus, toasts, popovers, dialogs, and the `lr-app-rail` mobile drawer. In light mode it
|
|
170
|
+
already resolves straight to `--lr-color-surface`, so one `--lr-theme-color-surface-default`
|
|
171
|
+
override carries all of them with it. Dark mode pinned a literal instead, because panel and page
|
|
172
|
+
resolving to the same near-black makes an open dialog read as a scrim with text floating on it and
|
|
173
|
+
no panel at all. The cost was that re-skinning the dark base surface left every floating surface at
|
|
174
|
+
the stock colour — a mismatched panel rather than a themed one.
|
|
175
|
+
|
|
176
|
+
It is now derived, keeping the elevation delta the literal existed to provide:
|
|
177
|
+
|
|
178
|
+
```css
|
|
179
|
+
--lr-color-surface-overlay: var(
|
|
180
|
+
--lr-theme-color-surface-overlay,
|
|
181
|
+
color-mix(in srgb, var(--lr-color-surface) 85%, #8bade2)
|
|
182
|
+
);
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
At the built-in dark base the pair resolves to the same panel colour it always has, so no existing
|
|
186
|
+
dark theme moves. Light mode is untouched, and an explicit `--lr-theme-color-surface-overlay` still
|
|
187
|
+
wins outright.
|
|
188
|
+
- b22fdbb: Docs: state the icon-button size scopes and the derived dark overlay surface in `llms/shared.md`.
|
|
189
|
+
|
|
190
|
+
Three properties now resize icon-only controls and they differ only in how far they reach, which is
|
|
191
|
+
not something a consumer can infer from the names: `--lr-theme-icon-button-size` is
|
|
192
|
+
application-wide, `--lr-icon-button-size-scope` covers one subtree, and `--lr-icon-button-size` is
|
|
193
|
+
element-scoped because the shared token layer re-declares it on every host. The reference now says
|
|
194
|
+
so in one table, with the precedence order and the coarse-pointer floor spelled out, instead of
|
|
195
|
+
leaving "my wrapper rule does nothing" to be rediscovered per project.
|
|
196
|
+
|
|
197
|
+
The overlay-surface entry records that `--lr-color-surface-overlay` follows
|
|
198
|
+
`--lr-theme-color-surface-default` in dark mode as well as light, so a single base-surface override
|
|
199
|
+
re-skins every dropdown, listbox, menu, toast and drawer, and explains why dark derives the value
|
|
200
|
+
rather than resolving straight to the page surface the way light does.
|
|
201
|
+
- 90449c6: `<lr-virtual-list>`: `row-height="auto"` driven by an external `scrollElement` no longer raises the
|
|
202
|
+
uncaught window error "ResizeObserver loop completed with undelivered notifications." when the
|
|
203
|
+
scroller jumps to its end and the newly revealed window measures. Nothing was ever dropped -- the
|
|
204
|
+
browser re-delivers on the following frame -- but the notice arrives as an uncaught `ErrorEvent` on
|
|
205
|
+
`window`, so it landed on whatever was running at the time and failed consumers' clean-console e2e
|
|
206
|
+
gates with a message that named no component.
|
|
207
|
+
|
|
208
|
+
The offending write is `[part="spacer"]`'s height, the list's whole virtual extent. `onRowsResized()`
|
|
209
|
+
folded each newly measured row height into the offsets and asked for a render; Lit flushes that
|
|
210
|
+
render on the microtask checkpoint that follows the observer callback, which is still inside the
|
|
211
|
+
browser's resize-observation delivery. Under an external `scrollElement` that write resizes an
|
|
212
|
+
*observed* box, because `[part="base"][data-external-scroll]` takes its own block size from the
|
|
213
|
+
spacer and is watched by the container `ResizeObserver` -- and `[part="base"]` sits shallower in the
|
|
214
|
+
tree than the rows just broadcast, so the browser records the resize as a skipped observation and
|
|
215
|
+
ends the loop with the error. Reproduced deterministically in WebKit and, with a large enough first
|
|
216
|
+
measurement delta, in Chromium too.
|
|
217
|
+
|
|
218
|
+
Reading inside the delivery is fine; folding the result into the offsets is what resizes the box.
|
|
219
|
+
So the measurement callbacks now only stash what they observed, and the offsets rebuild -- with the
|
|
220
|
+
scroll-anchor correction that belongs to it, so neither is ever painted without the other -- runs on
|
|
221
|
+
the animation frame this component already used to defer `observe()` calls out of the same delivery.
|
|
222
|
+
A render that still lands mid-delivery then re-reads offsets nothing has changed and writes the
|
|
223
|
+
extent already in the DOM, which resizes nothing. Renders themselves are never held: this element's
|
|
224
|
+
`updateComplete` keeps settling in the same microtask run as before, which is what every component
|
|
225
|
+
composing it relies on when it reads rendered rows back after its own update. Only the
|
|
226
|
+
external-`scrollElement` case defers at all -- with the list's own viewport scrolling,
|
|
227
|
+
`[part="base"]` takes its block size from `--lr-virtual-list-height` rather than from the spacer, so
|
|
228
|
+
the extent write reaches no observed box and every measurement there stays as immediate as it was,
|
|
229
|
+
fixed numeric `row-height` included. The error message itself is neither suppressed nor filtered
|
|
230
|
+
anywhere.
|
|
231
|
+
|
|
3
232
|
## 18.0.0
|
|
4
233
|
|
|
5
234
|
### Major Changes
|