@aceshooting/lyra-ui 24.1.0 → 25.0.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 +29 -20
- package/README.md +24 -28
- package/custom-elements.json +1 -1
- package/design-tokens.json +1 -1
- package/dist/components/agent-tools/activity-feed/activity-feed.styles.js +1 -1
- package/dist/components/agent-tools/task-list/task-list.styles.js +1 -1
- package/dist/components/agent-tools/thinking-panel/thinking-panel.styles.js +1 -1
- package/dist/components/conversation/chat-viewport/chat-viewport.class.js +1 -1
- package/dist/components/conversation/code-block/code-block.styles.js +1 -1
- package/dist/components/conversation/markdown/markdown.styles.js +1 -1
- package/dist/components/conversation/model-select/model-select.class.js +2 -1
- package/dist/components/conversation/model-select/model-select.styles.js +1 -1
- package/dist/components/conversation/selection-toolbar/selection-toolbar.styles.js +1 -1
- package/dist/components/conversation/voice-picker/voice-picker.class.js +2 -1
- package/dist/components/conversation/voice-picker/voice-picker.styles.js +1 -1
- package/dist/components/data/document-library/document-library.class.js +1 -1
- package/dist/components/data/table/table.class.d.ts +14 -3
- package/dist/components/data/table/table.class.js +8 -6
- package/dist/components/data/table/table.styles.js +1 -1
- package/dist/components/forms/color-picker/color-picker.class.js +2 -1
- package/dist/components/forms/color-picker/color-picker.styles.js +1 -1
- package/dist/components/forms/combobox/combobox.class.js +2 -1
- package/dist/components/forms/combobox/combobox.styles.js +1 -1
- package/dist/components/forms/date-picker/date-input.class.d.ts +3 -0
- package/dist/components/forms/date-picker/date-input.class.js +2 -1
- package/dist/components/forms/date-picker/date-input.styles.js +1 -1
- package/dist/components/forms/input/time-input.class.js +2 -1
- package/dist/components/forms/input/time-input.styles.js +1 -1
- package/dist/components/forms/locale-picker/locale-picker.class.d.ts +2 -1
- package/dist/components/forms/locale-picker/locale-picker.class.js +2 -1
- package/dist/components/forms/locale-picker/locale-picker.styles.js +1 -1
- package/dist/components/forms/otp-input/otp-input.class.js +1 -1
- package/dist/components/forms/select/select.class.js +2 -1
- package/dist/components/forms/select/select.styles.js +1 -1
- package/dist/components/forms/swatch-picker/swatch-picker.class.d.ts +6 -1
- package/dist/components/forms/swatch-picker/swatch-picker.class.js +1 -1
- package/dist/components/layout/app-rail/app-rail.styles.js +1 -1
- package/dist/components/layout/menu/menu.styles.js +1 -1
- package/dist/components/layout/menubar/menubar.styles.js +1 -1
- package/dist/components/layout/navigation-menu-item/navigation-menu-item.class.js +2 -2
- package/dist/components/layout/navigation-menu-item/navigation-menu-item.styles.js +1 -1
- package/dist/components/layout/scroller/scroller.styles.js +1 -1
- package/dist/components/media/av-player/av-player.styles.js +1 -1
- package/dist/components/media/image-viewer/image-viewer.styles.js +1 -1
- package/dist/components/media/map/map.class.d.ts +5 -2
- package/dist/components/media/map/map.class.js +4 -3
- package/dist/components/media/map/map.styles.js +1 -1
- package/dist/components/overlays/dialog/dialog.class.d.ts +1 -1
- package/dist/components/overlays/dialog/dialog.class.js +2 -1
- package/dist/components/overlays/dialog/dialog.styles.js +1 -1
- package/dist/components/overlays/overlay/overlay.styles.d.ts +1 -1
- package/dist/components/overlays/overlay/overlay.styles.js +1 -1
- package/dist/components/overlays/overlay/popover-glass.styles.d.ts +1 -0
- package/dist/components/overlays/overlay/popover-glass.styles.js +1 -0
- package/dist/components/overlays/overlay/popover.class.d.ts +11 -3
- package/dist/components/overlays/overlay/popover.class.js +1 -1
- package/dist/components/retrieval/knowledge-base/knowledge-base.class.js +1 -1
- package/dist/components/retrieval/source-list/source-list.styles.js +1 -1
- package/dist/components/utility/export-button/export-button.class.d.ts +1 -1
- package/dist/components/utility/export-button/export-button.class.js +2 -1
- package/dist/components/utility/export-button/export-button.styles.js +1 -1
- package/dist/components/utility/mention-popover/mention-popover.class.d.ts +1 -1
- package/dist/components/utility/mention-popover/mention-popover.class.js +2 -1
- package/dist/components/utility/mention-popover/mention-popover.styles.js +1 -1
- package/dist/components/viewers/document-compare/document-compare.styles.js +1 -1
- package/dist/components/viewers/document-preview/document-preview.class.js +1 -1
- package/dist/framework-types.d.ts +1 -1
- package/dist/internal/default-strings.generated.d.ts +1 -1
- package/dist/internal/default-strings.generated.js +1 -1
- package/dist/internal/glass-independent-root.styles.d.ts +2 -0
- package/dist/internal/glass-independent-root.styles.js +1 -0
- package/dist/internal/glass-scroll-layer.d.ts +1 -1
- package/dist/internal/glass-scroll-layer.js +1 -1
- package/dist/internal/glass-scroll-layer.styles.d.ts +2 -0
- package/dist/internal/glass-scroll-layer.styles.js +1 -0
- package/dist/internal/glass-surface.styles.d.ts +0 -2
- package/dist/internal/glass-surface.styles.js +1 -1
- package/dist/internal/localization-types.d.ts +1 -1
- package/dist/internal/localization.js +1 -1
- package/dist/internal/native-modal-carrier.js +2 -2
- package/dist/internal/package-metadata.d.ts +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/positioner.js +1 -1
- package/dist/internal/sizes.styles.js +1 -1
- package/dist/internal/specialist-tokens.styles.js +1 -1
- package/dist/internal/theme-token-types.d.ts +16 -0
- package/dist/internal/tokens/palette.styles.js +1 -1
- package/dist/internal/tokens.styles.js +1 -1
- package/dist/looks/material.css +1 -1
- package/dist/styles/design-tokens.css +1 -1
- package/dist/styles/tokens-root.css +1 -1
- package/dist/surfaces/glass.css +1 -1
- package/dist/theme/gemstones.d.ts +7 -0
- package/dist/theme/gemstones.js +1 -1
- package/dist/theme/looks/material.d.ts +1 -1
- package/dist/theme/looks/material.js +1 -1
- package/dist/theme/startup-resolution.d.ts +1 -0
- package/dist/theme/startup-resolution.js +1 -0
- package/dist/theme/style-ownership.js +1 -1
- package/dist/theme/theme-bootstrap.js +1 -1
- package/dist/theme/theme.d.ts +6 -21
- package/dist/theme/theme.js +1 -1
- package/dist/theme.css +1 -1
- package/dist/translations/am/data.js +1 -1
- package/dist/translations/ar/data.js +1 -1
- package/dist/translations/bho/data.js +1 -1
- package/dist/translations/bn/data.js +1 -1
- package/dist/translations/cs/data.js +1 -1
- package/dist/translations/da/data.js +1 -1
- package/dist/translations/de/data.js +1 -1
- package/dist/translations/el/data.js +1 -1
- package/dist/translations/es/data.js +1 -1
- package/dist/translations/fa/data.js +1 -1
- package/dist/translations/fa-AF/data.js +1 -1
- package/dist/translations/fi/data.js +1 -1
- package/dist/translations/fr/data.js +1 -1
- package/dist/translations/gu/data.js +1 -1
- package/dist/translations/ha/data.js +1 -1
- package/dist/translations/he/data.js +1 -1
- package/dist/translations/hi/data.js +1 -1
- package/dist/translations/hr/data.js +1 -1
- package/dist/translations/hu/data.js +1 -1
- package/dist/translations/id/data.js +1 -1
- package/dist/translations/ig/data.js +1 -1
- package/dist/translations/it/data.js +1 -1
- package/dist/translations/ja/data.js +1 -1
- package/dist/translations/jv/data.js +1 -1
- package/dist/translations/kk/data.js +1 -1
- package/dist/translations/kn/data.js +1 -1
- package/dist/translations/ko/data.js +1 -1
- package/dist/translations/ln/data.js +1 -1
- package/dist/translations/ml/data.js +1 -1
- package/dist/translations/mr/data.js +1 -1
- package/dist/translations/ms/data.js +1 -1
- package/dist/translations/my/data.js +1 -1
- package/dist/translations/nb/data.js +1 -1
- package/dist/translations/ne/data.js +1 -1
- package/dist/translations/nl/data.js +1 -1
- package/dist/translations/nn/data.js +1 -1
- package/dist/translations/om/data.js +1 -1
- package/dist/translations/or/data.js +1 -1
- package/dist/translations/pa/data.js +1 -1
- package/dist/translations/pcm/data.js +1 -1
- package/dist/translations/pl/data.js +1 -1
- package/dist/translations/pnb/data.js +1 -1
- package/dist/translations/ps/data.js +1 -1
- package/dist/translations/pt-BR/data.js +1 -1
- package/dist/translations/pt-PT/data.js +1 -1
- package/dist/translations/ro/data.js +1 -1
- package/dist/translations/ru/data.js +1 -1
- package/dist/translations/sd/data.js +1 -1
- package/dist/translations/sl/data.js +1 -1
- package/dist/translations/su/data.js +1 -1
- package/dist/translations/sv/data.js +1 -1
- package/dist/translations/sw/data.js +1 -1
- package/dist/translations/ta/data.js +1 -1
- package/dist/translations/te/data.js +1 -1
- package/dist/translations/th/data.js +1 -1
- package/dist/translations/tl/data.js +1 -1
- package/dist/translations/tr/data.js +1 -1
- package/dist/translations/uk/data.js +1 -1
- package/dist/translations/ur/data.js +1 -1
- package/dist/translations/uz/data.js +1 -1
- package/dist/translations/vi/data.js +1 -1
- package/dist/translations/yo/data.js +1 -1
- package/dist/translations/zh-CN/data.js +1 -1
- package/dist/translations/zh-TW/data.js +1 -1
- package/dist/translations/zu/data.js +1 -1
- package/llms/components/lr-date-input.md +1 -1
- package/llms/components/lr-date-picker.md +6 -0
- package/llms/components/lr-dialog.md +3 -0
- package/llms/components/lr-export-button.md +2 -0
- package/llms/components/lr-icon.md +1 -1
- package/llms/components/lr-locale-picker.md +7 -1
- package/llms/components/lr-map.md +7 -0
- package/llms/components/lr-mention-popover.md +3 -0
- package/llms/components/lr-model-select.md +3 -0
- package/llms/components/lr-navigation-menu.md +3 -0
- package/llms/components/lr-otp-input.md +3 -1
- package/llms/components/lr-popover.md +15 -5
- package/llms/components/lr-select.md +3 -0
- package/llms/components/lr-swatch-picker.md +17 -5
- package/llms/components/lr-table.md +14 -1
- package/llms/components/lr-voice-picker.md +3 -0
- package/llms/shared/native-styles-and-utilities.md +40 -0
- package/llms/shared/styles-and-tokens.md +257 -60
- package/llms/shared/testing-and-utilities.md +4 -1
- package/llms/shared.md +300 -61
- package/llms/tokens.md +82 -82
- package/locales.json +138 -138
- package/package.json +2 -2
- package/registrations.json +1 -1
- package/vscode-css-data.json +1 -1
- package/vscode-html-data.json +1 -1
- package/web-types.json +1 -1
- package/dist/components/agent-tools/run-events.js +0 -1
- package/dist/components/agent-tools/tool-param-form/tool-param-types.js +0 -1
- package/dist/components/forms/emoji-picker/emoji-types.js +0 -1
- package/dist/components/layout/dashboard-grid/layout-types.js +0 -1
- package/dist/components/layout/details/accordion-types.js +0 -1
- package/dist/components/viewers/viewer-diagnostics.js +0 -1
- package/dist/internal/localization-types.js +0 -1
- package/dist/internal/node-type-style.js +0 -1
- package/dist/internal/picker-value.js +0 -1
- package/dist/internal/shared-unions.js +0 -1
- package/dist/internal/stream-phase.js +0 -1
|
@@ -9,13 +9,17 @@
|
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md); family-wide breaking-change summaries: [forms](https://github.com/aceshooting/lyra-ui/blob/main/packages/lyra-ui/llms/forms.md)
|
|
10
10
|
- **Deprecations** none
|
|
11
11
|
- **Optional peers** none
|
|
12
|
-
- **Themeable via** 4 parts,
|
|
12
|
+
- **Themeable via** 4 parts, 10 custom properties — see this component's own `@csspart`/`@cssprop` list below
|
|
13
13
|
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
17
|
## `lr-swatch-picker`
|
|
18
18
|
|
|
19
|
+
Keyboard navigation and item-update focus restoration reveal the complete focused swatch
|
|
20
|
+
inside scrolling containers, including single-row `nowrap` palettes. Public
|
|
21
|
+
`focus({ preventScroll: true })` continues to suppress scrolling.
|
|
22
|
+
|
|
19
23
|
A single-select picker over a small, fixed set of color swatches with the WAI-ARIA APG
|
|
20
24
|
`radiogroup` contract built in: `role="radiogroup"`/`role="radio"`, roving tabindex, automatic
|
|
21
25
|
activation (click or arrow-key move both select immediately, like a native radio group), cyclic
|
|
@@ -120,7 +124,8 @@ gemstone mode, same aliasing and scope as `--lr-swatch-picker-gemstone-selected-
|
|
|
120
124
|
plus shared tokens — `--lr-color-border`/`-brand`, `--lr-space-xs`,
|
|
121
125
|
`--lr-border-width-thin`/`-thick`, `--lr-radius`, `--lr-transition-fast`, `--lr-focus-ring-*`,
|
|
122
126
|
and the per-tier `--lr-size-*` tokens. The automatic gemstone glyph's own checked-state halo/shine
|
|
123
|
-
is themed independently, through `--lr-gemstone-selected-color`/`-blur`/`-shine-duration`
|
|
127
|
+
is themed independently, through `--lr-gemstone-selected-color`/`-blur`/`-shine-duration` and
|
|
128
|
+
`--lr-gemstone-selected-animation` — see
|
|
124
129
|
`theme/gemstones.js`'s `gemstoneSelectedGlyphStyles` below, the exact stylesheet this picker
|
|
125
130
|
includes in its own `static styles` for that glyph.
|
|
126
131
|
|
|
@@ -200,7 +205,7 @@ class AccentTrigger extends LitElement {
|
|
|
200
205
|
- the semantic `radiogroup` lives inside shadow DOM. Set `accessibleLabel` or a host `aria-label`;
|
|
201
206
|
the component deliberately forwards the resulting name to that internal role.
|
|
202
207
|
- the automatic gemstone glyph's checked-state halo/shine is themed through
|
|
203
|
-
`--lr-gemstone-selected-color`/`-blur`/`-shine-duration`, not through
|
|
208
|
+
`--lr-gemstone-selected-color`/`-blur`/`-shine-duration`/`-animation`, not through
|
|
204
209
|
`--lr-swatch-picker-selected-*`/`-gemstone-*` — those style a plain color-fill swatch or a
|
|
205
210
|
consumer-supplied `icon` override instead, even while `mode="gemstone"`.
|
|
206
211
|
|
|
@@ -246,7 +251,12 @@ import {
|
|
|
246
251
|
`--lr-overlay-max-inline-size` lifts the popup's default 20rem cap so the 20rem palette plus the
|
|
247
252
|
popover's own padding fits. Both `--lr-gemstone-selected-*` values reach the trigger glyph and the
|
|
248
253
|
picker's checked glyph alike: a 0.42rem halo at 92% of the accent. Leave
|
|
249
|
-
`--lr-gemstone-selected-shine-duration` unset to keep the default 1.8s shine.
|
|
254
|
+
`--lr-gemstone-selected-shine-duration` unset to keep the default 1.8s shine. For an independent
|
|
255
|
+
**Shine OFF** choice, set `--lr-gemstone-selected-animation: none` on the common popover scope or
|
|
256
|
+
another ancestor of both glyphs. This stops the animation while preserving the static halo,
|
|
257
|
+
selected accent, and checked semantics. Remove the property to restore the default shine;
|
|
258
|
+
do not use a zero duration or pause an infinite animation as an OFF setting. Persistence of
|
|
259
|
+
this choice stays with the application, separately from its motion preference. The
|
|
250
260
|
`--lr-icon-button-*` values keep the trigger free of a rectangular fill at rest, on hover, and
|
|
251
261
|
while pressed:
|
|
252
262
|
|
|
@@ -337,7 +347,9 @@ The parts already supply the behavior, so do not re-implement it. The picker is
|
|
|
337
347
|
`radiogroup` with `aria-checked` and a `:focus-visible` ring per swatch, and its Arrow keys swap
|
|
338
348
|
under RTL. The popover keeps `bottom-end` on the logical end under RTL and returns focus to the
|
|
339
349
|
trigger on Escape. `gemstoneSelectedGlyphStyles` stops the shine under
|
|
340
|
-
`prefers-reduced-motion: reduce
|
|
350
|
+
`prefers-reduced-motion: reduce` and under application `motion: 'reduce'` with `preferences.css`
|
|
351
|
+
loaded, even when the public animation hook explicitly requests a loop. Verify 320px and desktop
|
|
352
|
+
layouts, enlarged text, and both color
|
|
341
353
|
modes. In a sidebar or settings panel, the caption and row may appear inline with the same glow
|
|
342
354
|
and spacing; use the compact tier when the container is narrow and allow wrapping if even that
|
|
343
355
|
tier cannot fit. Never shrink targets below 24px. Application theme application, default accent,
|
|
@@ -338,6 +338,19 @@ cell: (row) => unknown }` — `cell` is required for every `editTrigger` except
|
|
|
338
338
|
exists again (the same convention `selectedRowKeys` follows for server pagination). Reads return
|
|
339
339
|
immutable detached `ReadonlySet` facades; reassign a new set to update
|
|
340
340
|
- `hasMore: boolean = false` (attribute `has-more`, reflected)
|
|
341
|
+
- `loadingMore: boolean = false` (attribute `loading-more`, reflected) — controlled busy state
|
|
342
|
+
for the built-in incremental action. With `hasMore`, keeps existing rows and the same focusable
|
|
343
|
+
`more-button` mounted, exposes `aria-busy="true"` and `aria-disabled="true"`, and suppresses
|
|
344
|
+
pointer and keyboard `lr-load-more` requests while pending. Set it synchronously in the event
|
|
345
|
+
handler before awaiting the next page, then clear it when the request settles. It does not fetch
|
|
346
|
+
or append data itself; reassign `rows` when results arrive. `hasMore` still controls the button's
|
|
347
|
+
presence, and `loading` retains its separate full-table loading behavior. Left unset, the
|
|
348
|
+
continuation markup and activation behavior are unchanged.
|
|
349
|
+
- `loadingMoreLabel?: string` (attribute `loading-more-label`) — omission renders localized
|
|
350
|
+
`tableLoadingMore` (`'Loading more rows'` in the built-in English catalog); supplied strings,
|
|
351
|
+
including `''`, render verbatim. Post-mount transitions into incremental loading append this
|
|
352
|
+
copy to the shared light-DOM polite sink only when the continuation is rendered and initial
|
|
353
|
+
`loading` is false. Declarative initial busy state remains silent.
|
|
341
354
|
- `moreLabel?: string` (attribute `more-label`) — omission renders localized `loadMore` (`'Load more'` in the built-in English catalog); a supplied string, including `''`, renders verbatim
|
|
342
355
|
- `error: boolean = false` (attribute `error`, reflected) — replaces `<tbody>`'s row content with
|
|
343
356
|
a built-in failed-load state while keeping the surrounding `<thead>`, filter field, and
|
|
@@ -449,7 +462,7 @@ any of the attributes — a consumer-supplied key is not safe to interpolate int
|
|
|
449
462
|
`detail: { phase: 'request', sortKey, sortDir }`) precedes `lr-sort` (frozen readonly
|
|
450
463
|
`detail: { phase: 'commit', sortKey, sortDir }`) only when accepted. Client mode also updates its
|
|
451
464
|
sort properties; server mode leaves them controlled. Other events are `lr-row-activate`
|
|
452
|
-
(a row was activated by pointer or Enter/Space, `detail: { row }`), `lr-load-more` (fired on the "load more" button),
|
|
465
|
+
(a row was activated by pointer or Enter/Space, `detail: { row }`), `lr-load-more` (fired on the "load more" button only while `loadingMore` is false),
|
|
453
466
|
`lr-priority-columns-visibility-change` (frozen readonly `detail: { visible }`), and the expansion
|
|
454
467
|
pair `lr-row-expand-request` (**cancelable**, frozen readonly `detail: { row, rowKey, expanded }`,
|
|
455
468
|
emitted only while `expansionMode` is `'single'` or `'multiple'`; `preventDefault()` skips the
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
|
|
17
17
|
## `lr-voice-picker`
|
|
18
18
|
|
|
19
|
+
The voice list follows the [shared surface treatment](shared/styles-and-tokens.md);
|
|
20
|
+
its editing field retains an opaque fill.
|
|
21
|
+
|
|
19
22
|
A TTS voice selector over a host-supplied `catalog`, mirroring `lr-model-select`'s
|
|
20
23
|
closed-dropdown/free-text-combobox dual mode, stale-value handling, and form-association verbatim
|
|
21
24
|
(see that section for the full mode-switching contract this one shares), extended with a
|
|
@@ -261,3 +261,43 @@ and opacity tokens first. These additional hooks customize only the light-DOM bu
|
|
|
261
261
|
| `--lr-native-legend-padding` | `--lr-space-xs`; legend inline padding |
|
|
262
262
|
| `--lr-native-table-cell-padding` | `--lr-space-s`; caption and table-cell padding |
|
|
263
263
|
| `--lr-native-rule-space` | `--lr-space-l`; horizontal-rule block margin |
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
### Native navigation and floating chrome
|
|
267
|
+
|
|
268
|
+
The opt-in `.lr-surface-chrome` class uses the same protected Glass material as Lyra navigation,
|
|
269
|
+
menus and modal panels. It is shipped by `theme.css` for the built-in profile and by the separate
|
|
270
|
+
`surfaces/glass.css` asset for applications composing their own stylesheet set:
|
|
271
|
+
|
|
272
|
+
```css
|
|
273
|
+
@import "@aceshooting/lyra-ui/theme.css";
|
|
274
|
+
@import "@aceshooting/lyra-ui/tokens-root.css";
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
```html
|
|
278
|
+
<nav class="lr-surface-chrome" aria-label="Primary navigation">…</nav>
|
|
279
|
+
<section class="lr-surface-chrome" aria-labelledby="settings-title">
|
|
280
|
+
<h2 id="settings-title">Settings</h2>
|
|
281
|
+
<div class="settings-scrollport">…</div>
|
|
282
|
+
</section>
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Localize the example's names. Keep the material wrapper non-scrolling and put overflow on an inner
|
|
286
|
+
scrollport. The decorative pseudo-element filters the backdrop without changing fixed descendant
|
|
287
|
+
coordinates. The wrapper reserves `::before` and supplies a low-specificity `position: relative`;
|
|
288
|
+
application fixed, sticky or absolute positioning still wins. Avoid an extra opaque wrapper inside
|
|
289
|
+
an already treated Lyra popup.
|
|
290
|
+
|
|
291
|
+
`--lr-surface-background` optionally supplies this native wrapper's base fill. It falls back to the
|
|
292
|
+
local high container surface, then the overlay surface, and resolves on the painted wrapper, so nearer
|
|
293
|
+
theme inputs work.
|
|
294
|
+
The existing `--lr-theme-surface-opacity`, `--lr-theme-surface-blur`,
|
|
295
|
+
`--lr-theme-surface-saturation` and `--lr-theme-surface-highlight` controls apply. Glass uses 70%
|
|
296
|
+
opacity by default, 12px blur with a 16px ceiling, and qualified text, edges and focus.
|
|
297
|
+
The public opacity input accepts 0–1; lower custom opacity may expose backdrops that need
|
|
298
|
+
stronger foreground contrast. Solid and accessibility preferences still force opaque fills.
|
|
299
|
+
Explicit `data-lr-surface="solid"`, unsupported backdrop filtering, reduced transparency, increased
|
|
300
|
+
contrast and forced colors retain opaque fills. Load `preferences.css` for explicit inherited
|
|
301
|
+
contrast/motion choices. Nested chrome suppresses repeated blur; independently presented top-layer
|
|
302
|
+
surfaces begin their own material root. Keep cards, data tables, charts, map layers and editing
|
|
303
|
+
fields outside the automatic chrome class.
|
|
@@ -73,6 +73,193 @@ See [Where an override actually reaches](#where-an-override-actually-reaches) be
|
|
|
73
73
|
inheritance rules, including the one documented exception (per-component `--lr-<component>-*`
|
|
74
74
|
hooks, layer 3, which do inherit through wrappers).
|
|
75
75
|
|
|
76
|
+
### Lyra signature starter
|
|
77
|
+
|
|
78
|
+
Lyra's built-in profile is Shadcn, Glass, Emerald, System mode and comfortable density. Plain
|
|
79
|
+
component imports receive these defaults and a host-level Solid opt-out; `theme.css` provides the
|
|
80
|
+
full look/accent/mode resolver and the same profile for document scopes, including native chrome.
|
|
81
|
+
Explicit saved choices remain independent and win over missing or invalid fields. Use the existing style API to opt into Solid, the Lyra look, another accent or
|
|
82
|
+
mode; `accent: null` explicitly clears the accent, while `resetLyraStyle()` restores Emerald.
|
|
83
|
+
|
|
84
|
+
```css
|
|
85
|
+
@layer lr-base, lr-theme, lr-theme-preset, lr-utilities, lr-overrides;
|
|
86
|
+
@layer lr-theme-preset.look, lr-theme-preset.density, lr-theme-preset.surface, lr-theme-preset.accent, lr-theme-preset.mode;
|
|
87
|
+
@import "@aceshooting/lyra-ui/theme.css";
|
|
88
|
+
@import "@aceshooting/lyra-ui/tokens-root.css";
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Keep both layer-order statements before these imports. Bundlers can hoist statements from imported
|
|
92
|
+
stylesheets; the declarations preserve the order when imports are flattened. See
|
|
93
|
+
[Cascade layers](#cascade-layers). Separate Shadcn, Glass and Emerald imports remain compatible,
|
|
94
|
+
but are unnecessary for this profile. Import other optional looks, accents and densities when
|
|
95
|
+
exposing those choices.
|
|
96
|
+
|
|
97
|
+
For first paint, run the synchronous `lyraThemeBootstrap` before blocking stylesheets, using the
|
|
98
|
+
[CSP-safe embedding or classic-script asset](#style-runtime--aceshootinglyra-uithemejs). It restores
|
|
99
|
+
valid saved axes and fills missing or invalid choices with the built-in profile. Keep the
|
|
100
|
+
application's legacy-key precedence in an application adapter, and retain saved Solid, Lyra,
|
|
101
|
+
custom accents, runtime looks, overrides and historical records. Do not reconstruct a saved record
|
|
102
|
+
from the normalized `parseLyraStyleRecord()` snapshot: it is not a lossless persistence format.
|
|
103
|
+
`getLyraStyle()` reads the same choices at runtime; user changes use `setLyraStyle()`. An application
|
|
104
|
+
Reset can call `resetLyraStyle()` and restore any separate application preferences. Selectable
|
|
105
|
+
alternate looks and an explicitly cleared accent require `theme.css`; the intrinsic component
|
|
106
|
+
profile does not replace that scope resolver.
|
|
107
|
+
|
|
108
|
+
Keep spotlights in application CSS, independent of the chosen control look. The public root-token
|
|
109
|
+
stylesheet makes this static recipe follow both light/dark mode and the current accent:
|
|
110
|
+
|
|
111
|
+
```css
|
|
112
|
+
body { isolation: isolate; min-block-size: 100svh; background: var(--lr-color-surface); }
|
|
113
|
+
body::before {
|
|
114
|
+
content: '';
|
|
115
|
+
position: fixed;
|
|
116
|
+
inset: 0;
|
|
117
|
+
z-index: -1;
|
|
118
|
+
pointer-events: none;
|
|
119
|
+
background:
|
|
120
|
+
radial-gradient(ellipse 46rem 30rem at 8% 4%, color-mix(in srgb, var(--lr-color-brand) 16%, transparent), transparent 60%),
|
|
121
|
+
radial-gradient(ellipse 40rem 30rem at 96% 22%, color-mix(in srgb, var(--lr-color-brand) 12%, transparent), transparent 58%),
|
|
122
|
+
radial-gradient(ellipse 44rem 32rem at 78% 96%, color-mix(in srgb, var(--lr-color-brand) 9%, transparent), transparent 60%),
|
|
123
|
+
var(--lr-color-surface);
|
|
124
|
+
}
|
|
125
|
+
html[data-lr-contrast='more'] body::before { background: var(--lr-color-surface); }
|
|
126
|
+
@media (forced-colors: active) { body::before { background: Canvas; } }
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Keep an existing application's multicolor spotlight palette when adopting a control look. For
|
|
130
|
+
example, an accent/violet/pink canvas should retain all three gradient colors across Lyra, Shadcn,
|
|
131
|
+
and Material; changing `look` must not replace those colors with the same-accent starter above.
|
|
132
|
+
Keep application background rules outside look selectors, while letting mode and accent update
|
|
133
|
+
their own inputs.
|
|
134
|
+
|
|
135
|
+
These are decorative application backgrounds, not an `accentBackground` value: that style field
|
|
136
|
+
accepts absolute colors used as contrast reference surfaces, not gradients or image URLs. Use
|
|
137
|
+
semantic surface/text pairings for content and keep the decorative layer behind it.
|
|
138
|
+
|
|
139
|
+
Use the existing [gemstoneAccentPicker composition](../components/lr-swatch-picker.md#gemstoneaccentpicker--the-signature-accent-selector),
|
|
140
|
+
with its localized caption, nine canonical gemstones, and shared selected-glyph treatment. Keep
|
|
141
|
+
`--lr-swatch-picker-wrap: nowrap`: desktop hit size `1.75rem` and gap `.25rem`; at widths up to
|
|
142
|
+
`30rem`, hit size `1.5rem` and gap `.125rem` (28/4px and 24/2px at a 16px root). Leave its fill size
|
|
143
|
+
unset. Bound the palette to the viewport and provide horizontal overflow for unusually narrow
|
|
144
|
+
allocations or enlarged text; keyboard focus must bring every swatch into view. Do not shrink
|
|
145
|
+
below the component's 24px floor or replace its Arrow/Home/End and RTL behavior. For an independent
|
|
146
|
+
Shine preference, set `--lr-gemstone-selected-animation: none` on the scope shared by the trigger
|
|
147
|
+
and picker; remove that declaration for Shine ON. OFF preserves the halo and selected accent.
|
|
148
|
+
Application and OS reduced motion still take precedence; persist Shine independently from motion.
|
|
149
|
+
See the composition guide for the controlled picker and preference wiring.
|
|
150
|
+
|
|
151
|
+
The four separate topbar controls—gemstone, mode, design, language—stay square `2.75rem` targets
|
|
152
|
+
(44px at a 16px root), with localized names and tooltips. Use gemstone, sun/moon and horizontal-slider
|
|
153
|
+
icons, and a country flag for language. Dense gemstone options do not reduce
|
|
154
|
+
those launcher targets. Size icon launchers directly and keep their slotted glyphs bounded:
|
|
155
|
+
|
|
156
|
+
```css
|
|
157
|
+
.appearance-launcher { --lr-icon-button-size: 2.75rem; }
|
|
158
|
+
.appearance-launcher::part(button) { inline-size: 2.75rem; block-size: 2.75rem; }
|
|
159
|
+
.appearance-launcher > svg,
|
|
160
|
+
.appearance-launcher > lr-icon { inline-size: 1.125rem; block-size: 1.125rem; }
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Apply `appearance-launcher` to each `lr-icon-button`, including buttons slotted through a popover.
|
|
164
|
+
Keep the mode action separate from the design fields. Set the locale picker's
|
|
165
|
+
`--lr-locale-picker-trigger-height: 2.75rem` and
|
|
166
|
+
use its public flag-only trigger with readable menu entries:
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
import '@aceshooting/lyra-ui/components/lr-locale-picker.js';
|
|
170
|
+
import '@aceshooting/lyra-ui/components/media/flag/flag-peer.js';
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
```html
|
|
174
|
+
<lr-locale-picker top-layer trigger-display="flag" option-display="label"
|
|
175
|
+
aria-label="Localized language action"></lr-locale-picker>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Install the optional `@aceshooting/lyra-flags` peer; the granular resolver import loads requested
|
|
179
|
+
flags without a bulk flag import. Leave `withoutFlags` false. Assign `locales` as a property with
|
|
180
|
+
`{ tag, label, country? }` entries: provide readable localized language names and an explicit ISO
|
|
181
|
+
country for regional entries when known, such as `en-US` → `US`. Keep flags as supplementary cues,
|
|
182
|
+
never the only accessible names, and preserve a valid saved locale in the controlled `value`.
|
|
183
|
+
Use the component's flag resolver rather than emoji, invented flag SVGs, or guessed display APIs.
|
|
184
|
+
Verify 320px and desktop, light/dark, RTL, enlarged text, keyboard focus, and saved preferences.
|
|
185
|
+
|
|
186
|
+
#### Two-column design panel
|
|
187
|
+
|
|
188
|
+
Compose a settings form inside `lr-popover`; use its dialog behavior rather than assigning menu or
|
|
189
|
+
ARIA grid roles to form fields. Import the existing native utility stylesheet and granular controls:
|
|
190
|
+
|
|
191
|
+
```css
|
|
192
|
+
@import "@aceshooting/lyra-ui/utilities.css";
|
|
193
|
+
|
|
194
|
+
.design-popover { --lr-overlay-max-inline-size: min(29rem, calc(100dvw - 1rem)); }
|
|
195
|
+
.design-popover::part(content) { padding: 0; }
|
|
196
|
+
.design-panel {
|
|
197
|
+
box-sizing: border-box;
|
|
198
|
+
inline-size: 29rem;
|
|
199
|
+
max-inline-size: calc(100dvw - 1rem);
|
|
200
|
+
padding: var(--lr-space-l);
|
|
201
|
+
max-block-size: min(75dvh, 40rem);
|
|
202
|
+
overflow: auto;
|
|
203
|
+
overflow-wrap: anywhere;
|
|
204
|
+
}
|
|
205
|
+
.design-fields { --lr-grid-min-inline-size: 12rem; }
|
|
206
|
+
.design-fields > * { min-inline-size: 0; max-inline-size: 100%; }
|
|
207
|
+
.design-reset { inline-size: 100%; margin-block-start: var(--lr-space-l); }
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
```ts
|
|
211
|
+
import '@aceshooting/lyra-ui/components/lr-popover.js';
|
|
212
|
+
import '@aceshooting/lyra-ui/components/lr-icon-button.js';
|
|
213
|
+
import '@aceshooting/lyra-ui/components/lr-select.js';
|
|
214
|
+
import '@aceshooting/lyra-ui/components/lr-option.js';
|
|
215
|
+
import '@aceshooting/lyra-ui/components/lr-button.js';
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
```html
|
|
219
|
+
<lr-popover class="design-popover" top-layer placement="bottom-end" aria-label="Design settings">
|
|
220
|
+
<lr-icon-button slot="trigger" class="appearance-launcher" label="Design settings">
|
|
221
|
+
<!-- Application's decorative horizontal-slider glyph -->
|
|
222
|
+
</lr-icon-button>
|
|
223
|
+
<section class="design-panel">
|
|
224
|
+
<div class="design-fields lr-grid-auto lr-gap-s">
|
|
225
|
+
<lr-select label="Look" value="shadcn">
|
|
226
|
+
<lr-option value="shadcn">Shadcn</lr-option>
|
|
227
|
+
<lr-option value="lyra">Lyra</lr-option>
|
|
228
|
+
<lr-option value="material">Material</lr-option>
|
|
229
|
+
</lr-select>
|
|
230
|
+
<lr-select label="Surface" value="glass">
|
|
231
|
+
<lr-option value="glass">Glass</lr-option>
|
|
232
|
+
<lr-option value="solid">Solid</lr-option>
|
|
233
|
+
</lr-select>
|
|
234
|
+
<lr-select label="Density" value="comfortable">
|
|
235
|
+
<lr-option value="compact">Compact</lr-option>
|
|
236
|
+
<lr-option value="comfortable">Comfortable</lr-option>
|
|
237
|
+
<lr-option value="touch">Touch</lr-option>
|
|
238
|
+
</lr-select>
|
|
239
|
+
<!-- Further independent settings in their reading order -->
|
|
240
|
+
</div>
|
|
241
|
+
<lr-button class="design-reset" type="button">Reset appearance</lr-button>
|
|
242
|
+
</section>
|
|
243
|
+
</lr-popover>
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Localize the example's labels and options, bind values to the current application state, and handle
|
|
247
|
+
each select's `lr-change` through the relevant public style or preference API. Reset restores the
|
|
248
|
+
application profile and any separate application preferences.
|
|
249
|
+
|
|
250
|
+
`lr-grid-auto` already uses `auto-fit` with a `min(100%, minimum)` track floor. A bounded `29rem`
|
|
251
|
+
panel and `12rem` minimum give two columns when both fit, then one in narrow allocations; a third
|
|
252
|
+
column would need at least `36rem` before gaps. Keep those bounds together when customizing the
|
|
253
|
+
recipe. The existing `lr-gap-s` supplies the gap; no extra grid component or layout controller is
|
|
254
|
+
needed. The minimum is measured in rem, so enlarged text can also reduce the column count.
|
|
255
|
+
|
|
256
|
+
Keep every field in one row-major source list. Default grid placement and native Tab order then
|
|
257
|
+
agree: first row, second row, and so on; inherited RTL starts each row on the right. Do not split
|
|
258
|
+
fields into separate column wrappers, reorder with CSS, or add positive tabindex values. Leave the
|
|
259
|
+
full-width Reset action outside the field grid. Verify two columns at desktop allocation, one at
|
|
260
|
+
320px and enlarged text, long translated labels, RTL reading order, and Escape/focus return to the
|
|
261
|
+
design launcher. Keep these layout rules shared across application headers and administrative views.
|
|
262
|
+
|
|
76
263
|
### Reading the resolved tokens from your own components — `tokens-root.css`
|
|
77
264
|
|
|
78
265
|
The paragraph above is a real problem for any application that has custom elements of its own: they
|
|
@@ -628,7 +815,7 @@ resetLyraStyle(["look"]); // reset only the look axis
|
|
|
628
815
|
setLyraStyle({ mode: "unset", accent: null, accentBackground: null, overrides: null });
|
|
629
816
|
~~~
|
|
630
817
|
|
|
631
|
-
setLyraStyle() accepts independent choices for look, surface, density, mode, accent, accentBackground, and overrides. Omitted axes keep their current selection; null resets
|
|
818
|
+
setLyraStyle() accepts independent choices for look, surface, density, mode, accent, accentBackground, and overrides. Omitted axes keep their current selection. Null restores the built-in value for look, surface, density and mode; `accent: null` explicitly clears the accent, and null clears accentBackground or overrides. `resetLyraStyle()` restores Shadcn/Glass/Emerald/System/comfortable; a field list resets only those fields. The returned LyraStyle snapshot includes the selected values, a resolved mode when the choice is system, and lookForm to distinguish a stylesheet look from a runtime look.
|
|
632
819
|
|
|
633
820
|
mode is light, dark, system, or unset. Explicit modes set both data-lr-theme and data-theme; system follows the operating system and updates both attributes when it changes; unset removes Lyra's mode attributes. The lr-style-change event carries { style, changed }, where changed lists the affected fields. Applications can listen to this one event for document style changes.
|
|
634
821
|
|
|
@@ -702,10 +889,8 @@ The complete native CSS and utility contract is in the [native styles guide](./n
|
|
|
702
889
|
|
|
703
890
|
### Composing looks, surfaces and density
|
|
704
891
|
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
shadcn with glass and compact density is valid. Selecting another look replaces that scope's look;
|
|
708
|
-
it does not stack two competing look definitions.
|
|
892
|
+
`@aceshooting/lyra-ui/theme.js` exports the API. Each scope selects one look, surface, density,
|
|
893
|
+
mode and accent; the axes compose independently.
|
|
709
894
|
|
|
710
895
|
```js
|
|
711
896
|
import '@aceshooting/lyra-ui/theme.css';
|
|
@@ -717,60 +902,48 @@ import '@aceshooting/lyra-ui/accents.css';
|
|
|
717
902
|
import { setLyraStyle, resetLyraStyle, applyLyraStyleScope } from '@aceshooting/lyra-ui/theme.js';
|
|
718
903
|
|
|
719
904
|
setLyraStyle({ look: 'shadcn', mode: 'system', accent: 'sapphire' });
|
|
720
|
-
setLyraStyle({ surface: 'glass' }); // keeps
|
|
721
|
-
applyLyraStyleScope(tableRegion, { density: 'compact' }); //
|
|
905
|
+
setLyraStyle({ surface: 'glass' }); // keeps others
|
|
906
|
+
applyLyraStyleScope(tableRegion, { density: 'compact' }); // others inherit
|
|
722
907
|
applyLyraStyleScope(previewRegion, { look: 'material', mode: 'dark' });
|
|
723
|
-
resetLyraStyle(['look']); //
|
|
724
|
-
applyLyraStyleScope(tableRegion, null); // restores
|
|
908
|
+
resetLyraStyle(['look']); // resets look only
|
|
909
|
+
applyLyraStyleScope(tableRegion, null); // restores authored values
|
|
725
910
|
```
|
|
726
911
|
|
|
727
|
-
`setLyraStyle()`
|
|
728
|
-
`applyLyraStyleScope()` replaces
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
`
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
`
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
Exported look CSS comes from `lyraLookCss()` and requires `theme.css`, the selected optional sheets
|
|
764
|
-
and axis attributes. It is not an export of every axis or preference. Use the complete runtime
|
|
765
|
-
recipe for custom accent derivation, or the separate style/preference files to retain those choices.
|
|
766
|
-
Server-rendered attributes use `lyraStyleAttributes()` and `lyraPreferenceAttributes()`; system mode
|
|
767
|
-
is not falsely resolved on the server. Install the required CSS in each application-owned shadow
|
|
768
|
-
root that contains a local style boundary.
|
|
769
|
-
|
|
770
|
-
Diagnostics describe measured specimen colors and states, not universal accessibility
|
|
771
|
-
certification. Unknown/dynamic backgrounds remain unmeasured. Chart series keep text and non-color
|
|
772
|
-
cues; color-vision simulation does not replace them. Font availability, physical blur and native
|
|
773
|
-
platform accessibility settings still require evidence on the relevant platform.
|
|
912
|
+
`setLyraStyle()` persists supplied fields and retains omitted ones; null resets profile axes, while
|
|
913
|
+
`accent: null` clears it. `applyLyraStyleScope()` replaces an element's selection (omitted fields
|
|
914
|
+
inherit), without persistence or global events; clearing preserves later author changes. `getLyraStyle()`
|
|
915
|
+
reports requested axes and resolved mode.
|
|
916
|
+
|
|
917
|
+
Set `data-lr-look`, `data-lr-surface`, `data-lr-density`, `data-lr-mode` and `data-lr-accent`
|
|
918
|
+
directly if needed. Stylesheet look ids need their sheet; arbitrary ids neither load nor register.
|
|
919
|
+
`defineLyraLook({ id, tokens })` defines a validated immutable runtime look;
|
|
920
|
+
`lyraLookCss()` from `theme/look-css.js` creates CSS without DOM access. In app-owned shadow roots
|
|
921
|
+
with local boundaries, install `theme.css` and selected sheets; selectors stop at roots, inheritance
|
|
922
|
+
crosses.
|
|
923
|
+
|
|
924
|
+
`@aceshooting/lyra-ui/design-tokens.json` exports `$extensions['com.aceshooting.lyra.looks']`
|
|
925
|
+
(schemaVersion 1, base `lyra`), definitions `lyra`, `material`, `shadcn`, `data`, `terminal`,
|
|
926
|
+
`high-contrast`, and `defaultStyle`: Shadcn/Glass/Emerald/System/comfortable. The original token tree remains
|
|
927
|
+
authoritative; empty `lyra` restores it. Runtime CSS/editor/preview project the default separately.
|
|
928
|
+
Portable `{ id, tokens }` works with `defineLyraLook()`; sparse/null branches stay sparse. Load its
|
|
929
|
+
resolver to apply a look.
|
|
930
|
+
|
|
931
|
+
The [theme builder](https://www.lyra-ui.com/docs/?path=/story/theming-theme-builder--editor) previews
|
|
932
|
+
modes and edits contrast/motion, fonts, shape, elevation and chart palettes. It is documentation only,
|
|
933
|
+
not an entry point or element; component imports do not load it.
|
|
934
|
+
|
|
935
|
+
Import/export uses `LyraLook`, `LyraThemeTokens`, version-2 saved-style records and separate
|
|
936
|
+
`LyraPreferences`. Preserve runtime look tokens; `getLyraStyle()` snapshots omit them. Imports are
|
|
937
|
+
atomic (256 KiB max), reject network-bearing/executable CSS and preserve the last preview on error.
|
|
938
|
+
Group reset removes its writes; resetting a token to its look value removes it from every group.
|
|
939
|
+
|
|
940
|
+
`lyraLookCss()` exports only look CSS (requires `theme.css`, selected sheets and axis attributes).
|
|
941
|
+
Use the runtime recipe for custom accent derivation or separate style/preference files. SSR helpers
|
|
942
|
+
`lyraStyleAttributes()` and `lyraPreferenceAttributes()` leave system mode unresolved. Install CSS
|
|
943
|
+
in every app-owned shadow root with a local boundary.
|
|
944
|
+
|
|
945
|
+
Diagnostics measure specimens, not certify accessibility; dynamic backgrounds are unmeasured. Keep
|
|
946
|
+
chart text/non-color cues. See [contrast guidance](#scoped-contrast-and-motion-preferences).
|
|
774
947
|
|
|
775
948
|
### Optional shape, typography and elevation presets
|
|
776
949
|
|
|
@@ -937,18 +1110,42 @@ lyraStyleAttributes() provide DOM-free server-rendering helpers; render the retu
|
|
|
937
1110
|
through the framework's normal HTML escaping.
|
|
938
1111
|
|
|
939
1112
|
Glass is a treatment for eligible navigation and floating chrome. It does not make content panels,
|
|
940
|
-
|
|
1113
|
+
editing controls, charts or base map layers translucent. Dialog and drawer panels, menus and
|
|
1114
|
+
control-owned listboxes share the chrome treatment; their input interiors stay opaque. Unsupported blur, reduced transparency, increased contrast and
|
|
941
1115
|
forced colors retain solid fills. Solid surfaces use `backdrop-filter: none`; forced colours paint
|
|
942
1116
|
`Canvas`. Offer a solid choice wherever the application offers glass, since reduced-transparency
|
|
943
1117
|
media-query support varies between browsers.
|
|
944
1118
|
|
|
945
|
-
Regular glass defaults to
|
|
1119
|
+
Regular glass defaults to 70% opacity with a 12px blur clamped to 16px.
|
|
1120
|
+
The public `--lr-theme-surface-opacity` input accepts 0 through 1. Lower opacity exposes more
|
|
1121
|
+
of the backdrop; the default foreground qualification covers 70%, while a custom lower setting
|
|
1122
|
+
cannot guarantee contrast against every backdrop. Solid and accessibility preferences retain
|
|
1123
|
+
opaque fills regardless of this input.
|
|
946
1124
|
Quiet text, necessary control edges, focus indicators and transparent actions gain a local
|
|
947
1125
|
contrast-qualified foreground; opaque accent fills retain their own on-colours. Supported chrome
|
|
948
1126
|
includes app rails, navigation menus, menubars, menus and their context-menu composition, popovers,
|
|
949
1127
|
selection toolbars, toast items and the owned playback-rate toolbar of `lr-av-player`. Nested glass
|
|
950
|
-
chrome is opaque, preventing repeated blur.
|
|
951
|
-
|
|
1128
|
+
chrome is opaque, preventing repeated blur. Independently promoted menus and modal panels start a
|
|
1129
|
+
new material root. Content cards and editing fields remain opaque.
|
|
1130
|
+
A design panel can offer a Glass opacity range from 0–100%, shown when the selected surface is
|
|
1131
|
+
Glass. Start and reset it at 70%; convert the displayed percentage to the public token's 0–1 range.
|
|
1132
|
+
Apply this CSS input independently of look overrides: `setLyraStyle()` does not accept surface
|
|
1133
|
+
inputs in its `overrides` allowlist. Persist the percentage in the application's own settings and
|
|
1134
|
+
apply it before first paint, including after restoring those settings. Reset the app setting to 70
|
|
1135
|
+
and reapply it. Native `.lr-surface-chrome` wrappers and eligible component chrome consume the
|
|
1136
|
+
same input:
|
|
1137
|
+
|
|
1138
|
+
```js
|
|
1139
|
+
function applyGlassOpacity(percent) {
|
|
1140
|
+
if (!Number.isFinite(percent)) return;
|
|
1141
|
+
const opacity = Math.min(100, Math.max(0, percent)) / 100;
|
|
1142
|
+
document.documentElement.style.setProperty('--lr-theme-surface-opacity', String(opacity));
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
applyGlassOpacity(70); // Default and reset value; apply saved app settings before first paint.
|
|
1146
|
+
```
|
|
1147
|
+
|
|
1148
|
+
Scrolling rail, popup, modal-panel and selection-toolbar surfaces keep a stationary decorative blur layer;
|
|
952
1149
|
the public surface continues to own scrolling, focus and author overflow hooks.
|
|
953
1150
|
|
|
954
1151
|
`lr-av-player` additionally offers `controls-surface="clear"`, restricted to its owned toolbar and
|
|
@@ -320,7 +320,10 @@ void`, and `virtualAnchorFromRect()`** — thin wrapper over `@floating-ui/dom`'
|
|
|
320
320
|
`computePosition` + `autoUpdate`. Forces `strategy: 'fixed'` (matching the
|
|
321
321
|
popup's own `position: fixed` CSS — otherwise it lands offset by the page scroll), middleware
|
|
322
322
|
`offset(opts.offset ?? 4)`, `flip()`, `shift({ padding: 8 })`, default `placement: 'bottom-start'`.
|
|
323
|
-
Returns a cleanup function that stops
|
|
323
|
+
Returns a cleanup function that stops observation and queued updates — call it in `disconnectedCallback()`.
|
|
324
|
+
For `place()`, element-resize notifications coalesce into the next animation frame; initial
|
|
325
|
+
computation, scrolling and layout-shift updates begin immediately. Cleanup cancels a pending
|
|
326
|
+
resize frame.
|
|
324
327
|
`trackRect()` reports the target's initial viewport rect exactly once before returning, follows
|
|
325
328
|
later layout/viewport changes, and returns the same cleanup shape.
|
|
326
329
|
`virtualAnchorFromRect()` adapts a live rectangle provider to the exported `VirtualAnchor`
|