@aceshooting/lyra-ui 32.1.0 → 33.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 +247 -1576
- package/README.md +15 -2
- package/custom-elements.slim.json +1 -0
- package/dist/accent-roles.css +1 -0
- package/dist/cli/migrate-wa.mjs +50 -48
- package/dist/cli/migration-contract.json.gz +0 -0
- package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.d.ts +1 -1
- package/dist/components/conversation/chat-composer/chat-composer.class.d.ts +10 -0
- package/dist/components/conversation/code-block/code-block-base.class.d.ts +3 -1
- package/dist/components/conversation/code-block/code-block-base.class.js +1 -1
- package/dist/components/conversation/code-block/code-block-core.class.d.ts +1 -1
- package/dist/components/conversation/code-block/code-block-core.class.js +1 -1
- package/dist/components/conversation/code-block/code-block.class.d.ts +3 -2
- package/dist/components/conversation/code-block/code-block.class.js +1 -1
- package/dist/components/conversation/code-block/code-grammar-registry.d.ts +35 -0
- package/dist/components/conversation/code-block/code-grammar-registry.js +1 -0
- package/dist/components/conversation/model-select/model-select.class.d.ts +8 -7
- package/dist/components/conversation/selection-toolbar/selection-toolbar.class.d.ts +1 -1
- package/dist/components/conversation/usage-badge/usage-badge.class.d.ts +1 -1
- package/dist/components/conversation/voice-picker/voice-picker.class.d.ts +8 -7
- package/dist/components/data/table/table-support.d.ts +2 -3
- package/dist/components/data/table/table.class.d.ts +2 -1
- package/dist/components/data/timeline/timeline.class.d.ts +17 -6
- package/dist/components/data/timeline/timeline.class.js +2 -2
- package/dist/components/data/timeline/timeline.styles.js +1 -1
- package/dist/components/forms/catalog-picker-base.d.ts +14 -1
- package/dist/components/forms/checkbox/checkbox.class.js +1 -1
- package/dist/components/forms/checkbox-group/checkbox-group.class.d.ts +4 -5
- package/dist/components/forms/checkbox-group/checkbox-group.styles.js +1 -1
- package/dist/components/forms/code-editor/code-editor.class.d.ts +14 -5
- package/dist/components/forms/code-editor/code-editor.styles.js +1 -1
- package/dist/components/forms/color-picker/color-picker.class.d.ts +18 -7
- package/dist/components/forms/color-picker/color-picker.styles.js +1 -1
- package/dist/components/forms/combobox/combobox-option-html.js +1 -0
- package/dist/components/forms/combobox/combobox.class.d.ts +30 -9
- package/dist/components/forms/combobox/combobox.class.js +110 -21
- package/dist/components/forms/combobox/combobox.styles.js +1 -1
- package/dist/components/forms/country-picker/country-picker.class.d.ts +4 -5
- package/dist/components/forms/currency-picker/currency-picker.class.d.ts +4 -5
- package/dist/components/forms/date-picker/date-input.class.d.ts +14 -5
- package/dist/components/forms/date-picker/date-input.class.js +1 -1
- package/dist/components/forms/emoji-picker/emoji-picker.class.d.ts +10 -0
- package/dist/components/forms/emoji-picker/emoji-picker.class.js +1 -1
- package/dist/components/forms/icon-button/icon-button.class.d.ts +2 -1
- package/dist/components/forms/input/input-shared.d.ts +14 -5
- package/dist/components/forms/input/time-input.class.d.ts +15 -6
- package/dist/components/forms/input/time-input.styles.js +1 -1
- package/dist/components/forms/locale-picker/locale-picker.class.d.ts +8 -7
- package/dist/components/forms/otp-input/otp-input.class.d.ts +4 -5
- package/dist/components/forms/otp-input/otp-input.styles.js +1 -1
- package/dist/components/forms/phone-input/phone-input.class.d.ts +14 -5
- package/dist/components/forms/phone-input/phone-input.styles.js +1 -1
- package/dist/components/forms/radio/radio-group.class.d.ts +4 -5
- package/dist/components/forms/radio/radio-group.styles.js +1 -1
- package/dist/components/forms/radio/radio.class.js +2 -2
- package/dist/components/forms/select/select.class.d.ts +5 -6
- package/dist/components/forms/signature-pad/signature-pad.class.d.ts +4 -5
- package/dist/components/forms/signature-pad/signature-pad.styles.js +1 -1
- package/dist/components/forms/slider/slider.class.d.ts +6 -5
- package/dist/components/forms/slider/slider.styles.js +1 -1
- package/dist/components/forms/textarea/textarea.class.d.ts +14 -5
- package/dist/components/forms/time-zone-picker/time-zone-picker.class.d.ts +4 -5
- package/dist/components/forms/token-input/token-input.class.d.ts +10 -10
- package/dist/components/forms/token-input/token-input.class.js +1 -1
- package/dist/components/forms/token-input/token-input.styles.js +1 -1
- package/dist/components/forms/unit-picker/unit-picker.class.d.ts +4 -5
- package/dist/components/layout/command-palette/command-palette.class.d.ts +1 -1
- package/dist/components/layout/menu/menu.class.d.ts +1 -1
- package/dist/components/layout/navigation-menu-item/navigation-menu-item.class.d.ts +1 -1
- package/dist/components/layout/segmented/segmented.class.d.ts +2 -2
- package/dist/components/layout/stepper/step.class.d.ts +14 -1
- package/dist/components/layout/stepper/step.class.js +2 -2
- package/dist/components/lr-map-anchor.d.ts +1 -1
- package/dist/components/media/file-input/file-input.class.d.ts +2 -1
- package/dist/components/media/file-input/file-input.class.js +1 -1
- package/dist/components/media/file-input/file-input.styles.js +1 -1
- package/dist/components/media/lightbox/lightbox-item.class.d.ts +10 -0
- package/dist/components/media/lightbox/lightbox-item.class.js +1 -1
- package/dist/components/media/lightbox/lightbox-source.js +1 -1
- package/dist/components/media/lightbox/lightbox-types.d.ts +4 -1
- package/dist/components/media/lightbox/lightbox.class.d.ts +42 -19
- package/dist/components/media/lightbox/lightbox.class.js +4 -3
- package/dist/components/media/lightbox/lightbox.styles.js +1 -1
- package/dist/components/media/map/map-anchor-avoid.js +1 -1
- package/dist/components/media/map/map-anchor-options.d.ts +9 -0
- package/dist/components/media/map/map.class.d.ts +19 -5
- package/dist/components/media/map/map.class.js +3 -3
- package/dist/components/overlays/context-menu/context-menu.class.d.ts +1 -1
- package/dist/components/overlays/dialog/dialog.class.d.ts +19 -3
- package/dist/components/overlays/dialog/dialog.class.js +1 -1
- package/dist/components/overlays/dialog/dialog.styles.js +1 -1
- package/dist/components/overlays/drawer/drawer.class.d.ts +8 -2
- package/dist/components/overlays/drawer/drawer.class.js +1 -1
- package/dist/components/overlays/overlay/dropdown.class.d.ts +1 -1
- package/dist/components/overlays/overlay/overlay.styles.js +1 -1
- package/dist/components/overlays/overlay/popover.class.d.ts +1 -1
- package/dist/components/overlays/overlay/popover.class.js +1 -1
- package/dist/components/overlays/overlay/tooltip.class.d.ts +5 -0
- package/dist/components/overlays/overlay/tooltip.class.js +2 -2
- package/dist/components/overlays/toast/toast-item.class.d.ts +2 -2
- package/dist/components/overlays/toast/toast-item.styles.js +1 -1
- package/dist/components/retrieval/citation-badge/citation-badge.class.d.ts +1 -1
- package/dist/components/retrieval/entity-chip/entity-chip.class.d.ts +1 -1
- package/dist/components/utility/copy-button/copy-button.class.d.ts +2 -1
- package/dist/components/utility/copy-button/copy-button.class.js +1 -1
- package/dist/components/utility/export-button/export-button.class.d.ts +1 -1
- package/dist/components/utility/icon/icon-library-bootstrap.d.ts +50 -0
- package/dist/components/utility/icon/icon-library-bootstrap.js +1 -0
- package/dist/components/utility/icon/icon-library-font-awesome.d.ts +68 -0
- package/dist/components/utility/icon/icon-library-font-awesome.js +1 -0
- package/dist/components/utility/known-date/known-date.class.d.ts +10 -0
- package/dist/components/utility/mention-popover/mention-popover.class.d.ts +1 -1
- package/dist/components/utility/number-ticker/number-ticker.class.d.ts +10 -2
- package/dist/components/utility/number-ticker/number-ticker.class.js +1 -1
- package/dist/components/utility/tour/tour.class.d.ts +1 -1
- package/dist/framework-types.d.ts +1 -1
- package/dist/internal/accessibility-visibility.js +1 -1
- package/dist/internal/autoloader-manifest.js +1 -1
- package/dist/internal/declarative-overlay-action.js +1 -0
- package/dist/internal/default-strings/forms.generated.js +1 -1
- package/dist/internal/document-token-css.generated.js +10 -0
- package/dist/internal/document-tokens.generated.js +2 -11
- package/dist/internal/document-tokens.js +2 -2
- package/dist/internal/dom-guards.js +1 -1
- package/dist/internal/external-label-association.js +1 -0
- package/dist/internal/focus-navigation.js +1 -1
- package/dist/internal/form-control/chrome.styles.js +1 -1
- package/dist/internal/form-control-labels.js +1 -1
- package/dist/internal/localization-runtime.js +1 -1
- package/dist/internal/localization-types.d.ts +1 -1
- package/dist/internal/localization.js +1 -1
- package/dist/internal/lyra-element.d.ts +12 -3
- package/dist/internal/lyra-element.js +2 -2
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/theme-observation.js +1 -1
- package/dist/lyra.d.ts +1 -1
- package/dist/lyra.js +1 -1
- package/dist/ssr.d.ts +1 -1
- package/dist/styles/tokens-root.css +1 -1
- package/dist/styles/utilities.css +1 -1
- package/dist/theme-core.css +1 -1
- package/dist/theme.css +1 -1
- package/llms/components/lr-button.md +4 -0
- package/llms/components/lr-card.md +2 -0
- package/llms/components/lr-checkbox-group.md +2 -2
- package/llms/components/lr-citation-badge.md +1 -1
- package/llms/components/lr-code-block-core.md +3 -1
- package/llms/components/lr-code-block.md +14 -0
- package/llms/components/lr-code-editor.md +2 -2
- package/llms/components/lr-color-picker.md +4 -4
- package/llms/components/lr-combobox.md +21 -5
- package/llms/components/lr-context-menu.md +1 -1
- package/llms/components/lr-copy-button.md +4 -3
- package/llms/components/lr-country-picker.md +2 -2
- package/llms/components/lr-currency-picker.md +2 -2
- package/llms/components/lr-date-input.md +1 -1
- package/llms/components/lr-date-picker.md +1 -1
- package/llms/components/lr-dialog.md +30 -2
- package/llms/components/lr-drawer.md +7 -1
- package/llms/components/lr-entity-chip.md +1 -1
- package/llms/components/lr-export-button.md +1 -1
- package/llms/components/lr-file-input.md +1 -1
- package/llms/components/lr-icon.md +96 -0
- package/llms/components/lr-input.md +2 -2
- package/llms/components/lr-lightbox.md +43 -17
- package/llms/components/lr-locale-picker.md +2 -2
- package/llms/components/lr-map.md +16 -1
- package/llms/components/lr-mention-popover.md +1 -1
- package/llms/components/lr-menu.md +1 -1
- package/llms/components/lr-model-select.md +4 -4
- package/llms/components/lr-native-time-input.md +2 -2
- package/llms/components/lr-number-input.md +2 -2
- package/llms/components/lr-number-ticker.md +7 -2
- package/llms/components/lr-otp-input.md +2 -2
- package/llms/components/lr-phone-input.md +2 -2
- package/llms/components/lr-popover.md +1 -1
- package/llms/components/lr-radio-group.md +2 -2
- package/llms/components/lr-segmented.md +1 -1
- package/llms/components/lr-select.md +3 -3
- package/llms/components/lr-selection-toolbar.md +1 -1
- package/llms/components/lr-signature-pad.md +2 -2
- package/llms/components/lr-slider.md +1 -1
- package/llms/components/lr-step.md +7 -1
- package/llms/components/lr-textarea.md +2 -2
- package/llms/components/lr-time-input.md +3 -3
- package/llms/components/lr-time-zone-picker.md +2 -2
- package/llms/components/lr-timeline.md +12 -5
- package/llms/components/lr-toast.md +1 -1
- package/llms/components/lr-token-input.md +10 -9
- package/llms/components/lr-tool-call-chip.md +1 -1
- package/llms/components/lr-tooltip.md +5 -0
- package/llms/components/lr-unit-picker.md +2 -2
- package/llms/components/lr-usage-badge.md +1 -1
- package/llms/components/lr-voice-picker.md +4 -3
- package/llms/index.md +128 -128
- package/llms/migration.md +87 -8
- package/llms/peers.md +2 -2
- package/llms/shared/events-and-types.md +1 -1
- package/llms/shared/forms-and-accessibility.md +4 -1
- package/llms/shared/frameworks-and-ssr.md +47 -1
- package/llms/shared/imports-and-registration.md +8 -1
- package/llms/shared/localization-and-rtl.md +5 -0
- package/llms/shared/native-styles-and-utilities.md +85 -8
- package/llms/shared/styles-and-tokens.md +58 -4
- package/llms/shared/testing-and-utilities.md +9 -0
- package/llms/shared.md +217 -16
- package/locales.json +1 -1
- package/package.json +15 -6
- package/registrations.json +1 -1
- package/skills/compose-lyra-interfaces/SKILL.md +1 -1
- package/skills/lyra-ui/SKILL.md +1 -1
- package/skills/lyra-ui/commands/migrate.md +1 -1
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md)
|
|
10
10
|
- **Deprecations** none
|
|
11
11
|
- **Optional peers** none
|
|
12
|
-
- **Themeable via** 47 parts,
|
|
12
|
+
- **Themeable via** 47 parts, 48 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
|
---
|
|
@@ -313,8 +313,8 @@ The popup panel is a floating surface and paints from the **shared overlay-surfa
|
|
|
313
313
|
`--lr-overlay-surface` (default `var(--lr-color-surface-overlay)`), `--lr-overlay-border` (default
|
|
314
314
|
`var(--lr-color-border)`) and `--lr-overlay-shadow-anchored` (default `var(--lr-shadow-m)`). None is
|
|
315
315
|
declared on `:host`, so one declaration on `:root` — or on any ancestor, to scope it — retints this
|
|
316
|
-
surface together with every other floating surface in the library. `--lr-overlay-radius`
|
|
317
|
-
`--lr-color-picker-radius`, which still wins when set. The edge deliberately keeps the control tier, `var(--lr-color-border)`, rather than the
|
|
316
|
+
surface together with every other floating surface in the library. `--lr-overlay-radius` reaches it only as the middle arm of
|
|
317
|
+
`--lr-color-picker-radius`, which still wins when set; left unset, the panel keeps the component's own radius default. The edge deliberately keeps the control tier, `var(--lr-color-border)`, rather than the
|
|
318
318
|
decorative `var(--lr-color-border-subtle)` floating panels default to: this panel belongs to the
|
|
319
319
|
form control it opens from and keeps that control's boundary contrast (see `<lr-popover>`).
|
|
320
320
|
|
|
@@ -392,7 +392,7 @@ The start-placed label aligns to the first line of the field, measured with `--l
|
|
|
392
392
|
|
|
393
393
|
Further custom properties:
|
|
394
394
|
|
|
395
|
-
- `--lr-form-control-label-
|
|
395
|
+
- `--lr-form-control-label-gap` also spaces a label above the field.
|
|
396
396
|
- `--lr-form-control-label-line-height` (default `inherit`): Line height of the field label.
|
|
397
397
|
- `--lr-form-control-label-text-align` (default `inherit`): Text alignment of the field label.
|
|
398
398
|
- `--lr-form-control-label-text-transform` (default `inherit`): Text transform of the field label.
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
- **Status** `stable` since `4.0.0` — see the maturity and deprecation policy in `llms/shared.md`
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md)
|
|
10
10
|
- **Deprecations** none
|
|
11
|
-
- **Optional peers**
|
|
12
|
-
- **Themeable via**
|
|
11
|
+
- **Optional peers** `dompurify` — see `llms/peers.md`
|
|
12
|
+
- **Themeable via** 43 parts, 53 custom properties — see this component's own `@csspart`/`@cssprop` list below
|
|
13
13
|
- **Tokens by part** (prefer these over a `::part()` rule) `combobox`: `--lr-combobox-gap`, `--lr-combobox-radius`; `form-control-label`: `--lr-form-control-required-content`; `listbox`: `--lr-theme-scrollbar-color`, `--lr-theme-scrollbar-gutter`, `--lr-theme-scrollbar-width`; `option-badge`: `--lr-combobox-option-badge-bg`
|
|
14
14
|
- **Documented with** `lr-option` (same section below)
|
|
15
15
|
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`
|
|
@@ -342,6 +342,7 @@ AbortSignal; limit: number }) => Promise<readonly ComboboxSourceRow[] | { rows,
|
|
|
342
342
|
into an inert document and never inserted, so nothing in it runs; only its top-level `<option>` or
|
|
343
343
|
`*-option` elements become rows. It drives the same pipeline as
|
|
344
344
|
`source` (debounce, `lr-options-request`, cancellation, loading and failed states, row ceilings).
|
|
345
|
+
An option object may carry `html` (rich row content, see `ComboboxSourceRow.html` below).
|
|
345
346
|
Assigning either provider replaces the other, and `dataSource` reads `null` once `source` is
|
|
346
347
|
assigned; `source` keeps its `(query, { signal, limit })` shape.
|
|
347
348
|
- `server: boolean = false` (attribute `server`, reflected) — server mode without a provider:
|
|
@@ -442,7 +443,7 @@ every selection change and a `form.reset()` — like a native control, only anot
|
|
|
442
443
|
**8.0 migration:** the former camel-case string property `autoCorrect` is not retained as a public
|
|
443
444
|
alias. Set the boolean `autocorrect` IDL, or use `autocorrect="on"` / `autocorrect="off"` in markup.
|
|
444
445
|
|
|
445
|
-
`ComboboxSourceRow = { readonly value: string; readonly label: string; readonly sub?: string; readonly icon?: unknown; readonly start?: unknown;
|
|
446
|
+
`ComboboxSourceRow = { readonly value: string; readonly label: string; readonly sub?: string; readonly html?: string; readonly icon?: unknown; readonly start?: unknown;
|
|
446
447
|
readonly end?: unknown; readonly badge?: string |
|
|
447
448
|
number; readonly title?: string; accessibleLabel?: string; data?: unknown; dotColor?: string; group?: string; disabled?:
|
|
448
449
|
boolean }` — the row shape used by the async `source` path. `start` and `end` (new in 11.0.0) are
|
|
@@ -455,6 +456,19 @@ of the accessible name), and `data` is retained without being rendered
|
|
|
455
456
|
for retrieval through `selectedRows`.
|
|
456
457
|
`dotColor` accepts a valid CSS `color`; invalid values, declaration-breaking input, and `url()`
|
|
457
458
|
render a transparent dot.
|
|
459
|
+
`html` is optional rich markup shown in place of the label text, as the `option-html`
|
|
460
|
+
part. It always passes through the optional `dompurify` peer (install it to use this field) and then a
|
|
461
|
+
passive-content pass: script, event handlers, `style`, `part`, network attributes (`src`, `href`, …),
|
|
462
|
+
iframes and media are removed, and links, buttons, form controls and custom elements are replaced by
|
|
463
|
+
their text. A result superseded by a newer query is never applied. The row's text `label` remains its
|
|
464
|
+
accessible name, filter text and committed text, and the rich content is `aria-hidden`; use
|
|
465
|
+
`accessibleLabel` for a fuller spoken name as usual. While the peer loads, every row shows its plain
|
|
466
|
+
label. If the peer is missing, unusable or throws, rows stay on their plain labels (raw markup is never
|
|
467
|
+
rendered), the listbox shows the localized `comboboxRichContentUnavailable` message as
|
|
468
|
+
`option-html-fallback` (plain text, not a live region), and the same message is announced once to
|
|
469
|
+
`[data-lr-live-region="polite"]`. Markup longer than 4,096 UTF-16 code units, or markup that sanitizes
|
|
470
|
+
to nothing, leaves the plain label. Style the content through `::part(option-html)` and inherited properties; class names in the
|
|
471
|
+
markup do not match the component's shadow styles.
|
|
458
472
|
The light-DOM `<lr-option>` path normalizes its supported label/sub/dot/group/data fields to the
|
|
459
473
|
same internal row model — `<lr-option data>` is the light-DOM counterpart of an async row's own
|
|
460
474
|
`data` field, reached by reference through `selectedRows` exactly the same way.
|
|
@@ -631,6 +645,8 @@ aria-hidden adornments cloned from the source option's `start`/`prefix` and `end
|
|
|
631
645
|
from an async row's `start`/`end`), `option-label`, `option-sub` (a row's
|
|
632
646
|
secondary line, when `sub` is set), `option-badge` (an async row's trailing metadata),
|
|
633
647
|
`option-overflow` (the "+N more" indicator from `maxRender`),
|
|
648
|
+
`option-html` (the sanitized rich content of an async row carrying `html`, hidden from assistive
|
|
649
|
+
technology), `option-html-fallback` (the localized note shown when the `dompurify` peer is unavailable),
|
|
634
650
|
`source-error-row` (the listbox row holding the failed-`source` state), `source-error` (the shared
|
|
635
651
|
failed-load state itself, with `source-error-base`, `source-error-icon`, `source-error-heading`,
|
|
636
652
|
`source-error-description` and `source-error-actions` forwarded from the composed `<lr-empty>`),
|
|
@@ -717,7 +733,7 @@ can retheme the selected row without hijacking `--lr-color-brand` library-wide.
|
|
|
717
733
|
The listbox popup itself is a floating surface and paints from the **shared overlay-surface family**
|
|
718
734
|
(16.0.0), not from the page surface every card and input reads: `--lr-overlay-surface` (default
|
|
719
735
|
`var(--lr-color-surface-overlay)`), `--lr-overlay-border` (default `var(--lr-color-border)`),
|
|
720
|
-
`--lr-overlay-radius` (default `var(--lr-radius)`) and `--lr-overlay-shadow-anchored` (default
|
|
736
|
+
`--lr-overlay-radius` (default `var(--lr-radius-container)`) and `--lr-overlay-shadow-anchored` (default
|
|
721
737
|
`var(--lr-shadow-m)`). None is declared on `:host`, so one declaration on `:root` — or on any
|
|
722
738
|
ancestor, to scope it — retints this popup together with every other floating surface, and none of
|
|
723
739
|
it touches the trigger row the popup drops from. The edge deliberately keeps the control tier, `var(--lr-color-border)`, rather than the
|
|
@@ -912,7 +928,7 @@ The start-placed label aligns to the first line of the field, measured with `--l
|
|
|
912
928
|
|
|
913
929
|
Further custom properties:
|
|
914
930
|
|
|
915
|
-
- `--lr-form-control-label-
|
|
931
|
+
- `--lr-form-control-label-gap` also spaces a label above the field.
|
|
916
932
|
- `--lr-form-control-label-line-height` (default `inherit`): Line height of the field label.
|
|
917
933
|
- `--lr-form-control-label-text-align` (default `inherit`): Text alignment of the field label.
|
|
918
934
|
- `--lr-form-control-label-text-transform` (default `inherit`): Text transform of the field label.
|
|
@@ -186,7 +186,7 @@ parent; set `lr-context-menu { display: block }` to get a box.
|
|
|
186
186
|
`lr-context-menu` or any ancestor): `--max-width`
|
|
187
187
|
(`var(--lr-overlay-max-inline-size, var(--lr-size-20rem))`), `--lr-overlay-surface`
|
|
188
188
|
(`var(--lr-color-surface-overlay)`), `--lr-overlay-border` (`var(--lr-color-border-subtle)`),
|
|
189
|
-
`--lr-overlay-radius` (`var(--lr-radius)`), `--lr-overlay-shadow-anchored` (`var(--lr-shadow-m)`),
|
|
189
|
+
`--lr-overlay-radius` (`var(--lr-radius-container)`), `--lr-overlay-shadow-anchored` (`var(--lr-shadow-m)`),
|
|
190
190
|
`--lr-overlay-max-inline-size` (`var(--lr-size-20rem)`), `--lr-context-menu-min-inline-size`
|
|
191
191
|
(the menu's minimum inline size, capped by the available space; it wins over the shared
|
|
192
192
|
`--lr-overlay-min-inline-size`, default `0px`, which it falls back to while unset), and
|
|
@@ -60,9 +60,10 @@ buttons.
|
|
|
60
60
|
`xl` ladder; `small`/`medium`/`large` alias `s`/`m`/`l`. Scales the minimum hit area, glyph font
|
|
61
61
|
and corner radius. Unset preserves the established icon-button footprint and inherited font;
|
|
62
62
|
custom default-slot triggers keep their own geometry.
|
|
63
|
-
- `feedbackDuration: number =
|
|
64
|
-
confirmation **or** the failure state returns to the copy icon
|
|
65
|
-
`
|
|
63
|
+
- `feedbackDuration: number = 1000` (attribute `feedback-duration`) — milliseconds before the
|
|
64
|
+
confirmation **or** the failure state returns to the copy icon; the default matches
|
|
65
|
+
`wa-copy-button` and `sl-copy-button`. A non-finite value falls back to `1000` rather than
|
|
66
|
+
leaving the state stuck; a negative one clamps to `0`.
|
|
66
67
|
|
|
67
68
|
**Methods:** `focus(options?)`, `blur()` and `click()` forward to the active built-in or custom
|
|
68
69
|
trigger. `getToolbarActions(): readonly LyraToolbarAction[]` implements the public logical-toolbar
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md)
|
|
10
10
|
- **Deprecations** none
|
|
11
11
|
- **Optional peers** none
|
|
12
|
-
- **Themeable via** 16 parts,
|
|
12
|
+
- **Themeable via** 16 parts, 7 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
|
---
|
|
@@ -142,4 +142,4 @@ including RTL and dark themes. `--lr-form-control-invalid-border-color` themes t
|
|
|
142
142
|
|
|
143
143
|
Further custom properties:
|
|
144
144
|
|
|
145
|
-
- `--lr-form-control-label-
|
|
145
|
+
- `--lr-form-control-label-gap` also spaces a label above the field.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md)
|
|
10
10
|
- **Deprecations** none
|
|
11
11
|
- **Optional peers** none
|
|
12
|
-
- **Themeable via** 15 parts,
|
|
12
|
+
- **Themeable via** 15 parts, 7 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
|
---
|
|
@@ -148,4 +148,4 @@ preserve their shared part names and inherit shared form-control and surface tok
|
|
|
148
148
|
|
|
149
149
|
Further custom properties:
|
|
150
150
|
|
|
151
|
-
- `--lr-form-control-label-
|
|
151
|
+
- `--lr-form-control-label-gap` also spaces a label above the field.
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md)
|
|
10
10
|
- **Deprecations** none
|
|
11
11
|
- **Optional peers** none
|
|
12
|
-
- **Themeable via** 55 parts,
|
|
12
|
+
- **Themeable via** 55 parts, 43 custom properties — see `lr-date-picker.md`
|
|
13
13
|
- **Documented with** `lr-date-picker`: see [lr-date-picker.md](./lr-date-picker.md).
|
|
14
14
|
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`
|
|
@@ -590,7 +590,7 @@ and `dateTimeFormat(locale, options)`.
|
|
|
590
590
|
|
|
591
591
|
Further custom properties:
|
|
592
592
|
|
|
593
|
-
- `--lr-form-control-label-
|
|
593
|
+
- `--lr-form-control-label-gap` also spaces a label above the field.
|
|
594
594
|
- `--lr-form-control-label-line-height` (default `inherit`): Line height of the field label.
|
|
595
595
|
- `--lr-form-control-label-text-align` (default `inherit`): Text alignment of the field label.
|
|
596
596
|
- `--lr-form-control-label-text-transform` (default `inherit`): Text transform of the field label.
|
|
@@ -98,7 +98,8 @@ chrome remains visible. The fallback order appears below.
|
|
|
98
98
|
`DialogCloseReason = 'escape' | 'backdrop' | 'close-button' | 'api' | 'unmount' | string` —
|
|
99
99
|
`'escape'`/`'backdrop'` are emitted by the dialog's own built-in dismiss triggers;
|
|
100
100
|
`'close-button'` by the built-in header close button (rendered unless `without-close-button` is
|
|
101
|
-
set); `'
|
|
101
|
+
set); `'close-action'` by a declarative `data-dialog="close"` (or, in a drawer,
|
|
102
|
+
`data-drawer="close"`) action; `'api'`
|
|
102
103
|
covers `close()` with no argument, `hide()`, and `open = false`; `'unmount'` is emitted
|
|
103
104
|
automatically if the dialog is removed from the DOM while still `open` by anything other than its
|
|
104
105
|
own `close()` (a consumer's own cleanup code, a parent re-render that drops it); any other string
|
|
@@ -126,6 +127,33 @@ chrome remains visible. The fallback order appears below.
|
|
|
126
127
|
|
|
127
128
|
The two `lr-after-*` events are never cancelable.
|
|
128
129
|
|
|
130
|
+
**Declarative open and close:** markup alone can drive a dialog, with the same attribute Web
|
|
131
|
+
Awesome documents, so migrated markup keeps working:
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<button data-dialog="open edit-user">Edit user</button>
|
|
135
|
+
<lr-dialog id="edit-user" label="Edit user">
|
|
136
|
+
<p>Form fields</p>
|
|
137
|
+
<button slot="footer" data-dialog="close">Cancel</button>
|
|
138
|
+
</lr-dialog>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
- Activating any element with `data-dialog="open <id>"` calls `show()` on the `<lr-dialog>` with
|
|
142
|
+
that `id`. The id is looked up in the trigger's own tree (its shadow root or document) first, then
|
|
143
|
+
in its document. An id that matches nothing, or matches something other than a dialog, is ignored.
|
|
144
|
+
- Activating a descendant with `data-dialog="close"` (including one inside a descendant's open
|
|
145
|
+
shadow root) closes the nearest owning dialog with reason `'close-action'`; `lr-hide`'s
|
|
146
|
+
`detail.source` is the action element. A nested dialog consumes its own close action, so its
|
|
147
|
+
parent stays open. `lr-request-close` is not emitted.
|
|
148
|
+
- Both use the ordinary lifecycle, so `lr-show`, `lr-hide` and `lr-close-request` can veto them.
|
|
149
|
+
- Activation is a `click`, so Enter/Space on a native or custom button counts. A `disabled`,
|
|
150
|
+
`aria-disabled="true"` or inert action does nothing, and so does a click whose default was already
|
|
151
|
+
prevented.
|
|
152
|
+
- Dialogs register themselves, so a dialog defined under another tag name works the same. One
|
|
153
|
+
delegated document listener serves every dialog and drawer; it is installed when the first one
|
|
154
|
+
connects and removed when the last one disconnects.
|
|
155
|
+
- `<lr-drawer>` uses `data-drawer` instead; `data-dialog` never addresses a drawer.
|
|
156
|
+
|
|
129
157
|
The open sequence is `lr-show` → `lr-initial-focus` (when focus would move) → `lr-after-show`; the
|
|
130
158
|
direct close sequence is `lr-hide` → `lr-close-request` → state change → `lr-close` → `lr-after-hide`.
|
|
131
159
|
A built-in dismissal prepends `lr-request-close`. **Both state pre-events fire _before_ the state changes**, so reading
|
|
@@ -250,7 +278,7 @@ footer rows, which are tighter than the body by default), `--lr-dialog-panel-dur
|
|
|
250
278
|
The panel paints from the **shared overlay-surface family** (16.0.0), not from the page-surface
|
|
251
279
|
tokens this entry previously named: `--lr-overlay-surface` (default `var(--lr-color-surface-overlay)`
|
|
252
280
|
— the panel fill), `--lr-overlay-border` (default `var(--lr-color-border-subtle)` — the panel edge and the
|
|
253
|
-
header's and footer's dividing rules unless `--lr-dialog-divider-color` is set), `--lr-overlay-radius` (default `var(--lr-radius)` — the panel
|
|
281
|
+
header's and footer's dividing rules unless `--lr-dialog-divider-color` is set), `--lr-overlay-radius` (default `var(--lr-radius-container)` — the panel
|
|
254
282
|
corner and the close button's) and `--lr-overlay-shadow-modal` (default `var(--lr-shadow-xl)` — the
|
|
255
283
|
panel's elevation). None is declared on `:host`, so one declaration on `:root` (or on any ancestor,
|
|
256
284
|
to scope it) retints the dialog together with every popup opened from it. Two dialog-scoped hooks
|
|
@@ -36,7 +36,7 @@ the slide animation are its own.
|
|
|
36
36
|
- `floating: boolean = false` (attribute `floating`, reflected) — an inset, floating sheet: the
|
|
37
37
|
panel keeps a `--lr-drawer-inset` gap (default `var(--lr-space-s)`) from every viewport edge
|
|
38
38
|
(from the containing block's edges with `contained`; the safe-area insets still win where
|
|
39
|
-
larger) and rounds its corners with `--lr-overlay-radius` (default `var(--lr-radius)`).
|
|
39
|
+
larger) and rounds its corners with `--lr-overlay-radius` (default `var(--lr-radius-container)`).
|
|
40
40
|
Off by default, so the drawer stays square and edge-flush.
|
|
41
41
|
- `heading?: string`, `label: string`,
|
|
42
42
|
`withoutCloseButton: boolean = false` (attribute `without-close-button`, reflected),
|
|
@@ -63,6 +63,12 @@ More properties: `with-label`: see the component JSDoc.
|
|
|
63
63
|
`close(reason?: DialogCloseReason): Promise<void>` — inherited unchanged from `lr-dialog`; each
|
|
64
64
|
promise settles after the matching `lr-after-*` event.
|
|
65
65
|
|
|
66
|
+
**Declarative open and close:** `data-drawer="open <id>"` on any element opens the `<lr-drawer>`
|
|
67
|
+
with that `id`, and `data-drawer="close"` on a descendant closes the nearest owning drawer with
|
|
68
|
+
reason `'close-action'`. Lookup, nesting, vetoes and disabled/inert handling follow `lr-dialog`'s
|
|
69
|
+
declarative rules; `data-dialog` never addresses a drawer and `data-drawer` never addresses a
|
|
70
|
+
dialog.
|
|
71
|
+
|
|
66
72
|
**Events:** `lr-show` (cancelable), `lr-after-show`, `lr-hide` (cancelable), `lr-after-hide`, and
|
|
67
73
|
`lr-initial-focus` (cancelable), `lr-request-close` (cancelable, detail source), and `lr-close`
|
|
68
74
|
(`detail: { reason: DialogCloseReason }`, non-cancelable), plus cancelable `lr-close-request`
|
|
@@ -54,7 +54,7 @@ The anchored detail popover is a floating surface and paints from the **shared o
|
|
|
54
54
|
`--lr-overlay-surface` (default `var(--lr-color-surface-overlay)`), `--lr-overlay-border` (default
|
|
55
55
|
`var(--lr-color-border-subtle)`) and `--lr-overlay-shadow-anchored` (default `var(--lr-shadow-m)`). None is
|
|
56
56
|
declared on `:host`, so one declaration on `:root` — or on any ancestor, to scope it — retints this
|
|
57
|
-
surface together with every other floating surface in the library. `--lr-overlay-radius` (default `var(--lr-radius)`) is the matching corner radius.
|
|
57
|
+
surface together with every other floating surface in the library. `--lr-overlay-radius` (default `var(--lr-radius-container)`) is the matching corner radius.
|
|
58
58
|
|
|
59
59
|
`--lr-positioning-strategy` — the preview popover reads this same cascading
|
|
60
60
|
`absolute`/`fixed` override documented on `<lr-popover>` when it is (re)positioned, falling back to
|
|
@@ -142,7 +142,7 @@ The menu popup is a floating surface and paints from the **shared overlay-surfac
|
|
|
142
142
|
`--lr-overlay-surface` (default `var(--lr-color-surface-overlay)`), `--lr-overlay-border` (default
|
|
143
143
|
`var(--lr-color-border-subtle)`) and `--lr-overlay-shadow-anchored` (default `var(--lr-shadow-m)`). None is
|
|
144
144
|
declared on `:host`, so one declaration on `:root` — or on any ancestor, to scope it — retints this
|
|
145
|
-
surface together with every other floating surface in the library. `--lr-overlay-radius` (default `var(--lr-radius)`) is the matching corner radius.
|
|
145
|
+
surface together with every other floating surface in the library. `--lr-overlay-radius` (default `var(--lr-radius-container)`) is the matching corner radius.
|
|
146
146
|
|
|
147
147
|
`--lr-positioning-strategy` — the format menu reads this same cascading `absolute`/`fixed`
|
|
148
148
|
override documented on `<lr-popover>` when it is (re)positioned, falling back to its own `fixed`
|
|
@@ -376,7 +376,7 @@ Use `--lr-file-input-dropzone-active-border-color` and `--lr-file-input-dropzone
|
|
|
376
376
|
|
|
377
377
|
Further custom properties:
|
|
378
378
|
|
|
379
|
-
- `--lr-form-control-label-
|
|
379
|
+
- `--lr-form-control-label-gap` (default `var(--lr-space-xs)`): Space between the label above the field and the field.
|
|
380
380
|
- `--lr-form-control-label-line-height` (default `inherit`): Line height of the field label.
|
|
381
381
|
- `--lr-form-control-label-text-align` (default `inherit`): Text alignment of the field label.
|
|
382
382
|
- `--lr-form-control-label-text-transform` (default `inherit`): Text transform of the field label.
|
|
@@ -212,3 +212,99 @@ Promise<string>`, `LyraIconLibraryMutator = (svg: SVGElement) => void`, and
|
|
|
212
212
|
mirrored artwork in LTR and RTL. A glyph that must follow reading direction is mirrored by the
|
|
213
213
|
wrapping part of the component that owns it; a second, direction-driven flip here would silently
|
|
214
214
|
cancel that one out.
|
|
215
|
+
|
|
216
|
+
### Font Awesome preset
|
|
217
|
+
|
|
218
|
+
An opt-in resolver preset for Font Awesome lives at its own side-effect-free subpath. Importing it
|
|
219
|
+
registers and fetches nothing; the built-in glyph set stays the offline default until you call
|
|
220
|
+
`registerFontAwesomeIconLibrary()`, and even then an icon is requested only when an `<lr-icon>`
|
|
221
|
+
names that library. Every request still runs the pipeline above (fetch allowlist, 1 MiB cap,
|
|
222
|
+
DOMPurify, resource-sink stripping, shared bounded cache).
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
import "@aceshooting/lyra-ui/components/lr-icon.js";
|
|
226
|
+
import { setDefaultIconFamily } from "@aceshooting/lyra-ui/components/utility/icon/icon-library.js";
|
|
227
|
+
import { registerFontAwesomeIconLibrary } from "@aceshooting/lyra-ui/components/utility/icon/icon-library-font-awesome.js";
|
|
228
|
+
|
|
229
|
+
// Free tier from a pinned jsDelivr release: classic solid/regular and brands.
|
|
230
|
+
const unregister = registerFontAwesomeIconLibrary(); // library name "fa"
|
|
231
|
+
// Pro and Pro+ families: a kit code (Font Awesome's kit SVG host) or a self-hosted copy.
|
|
232
|
+
registerFontAwesomeIconLibrary({ name: "fa-pro", kitCode: "abc123" });
|
|
233
|
+
registerFontAwesomeIconLibrary({ name: "fa-local", basePath: "/assets/fontawesome/svgs" });
|
|
234
|
+
setDefaultIconFamily("sharp", "light"); // used by icons whose family/variant are unset
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
```html
|
|
238
|
+
<lr-icon library="fa" name="house" label="Home"></lr-icon>
|
|
239
|
+
<lr-icon library="fa" family="brands" name="github"></lr-icon>
|
|
240
|
+
<lr-icon library="fa-pro" family="duotone" variant="thin" name="house" swap-opacity></lr-icon>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
- Options (`LyraFontAwesomeIconLibraryOptions`): `name` (default `'fa'`; `'default'` makes Font
|
|
244
|
+
Awesome own every icon without a `library`), `kitCode`, `basePath` (wins over `kitCode`; icons
|
|
245
|
+
resolve to `<basePath>/<folder>/<name>.svg`), `version` (exact `major.minor.patch`, default
|
|
246
|
+
`FONT_AWESOME_DEFAULT_VERSION` = `7.3.1`), `defaultFamily` (default `'classic'`) and
|
|
247
|
+
`defaultVariant`. Malformed options throw at the call site. The function returns an unregister
|
|
248
|
+
callback that only removes its own registration.
|
|
249
|
+
- Families (`LyraFontAwesomeFamily`): `classic` and `brands` (free); `duotone`, `sharp`,
|
|
250
|
+
`sharp-duotone` (Pro, each `solid`/`regular`/`light`/`thin`); and the single-style Pro+ packs
|
|
251
|
+
`chisel`, `etch`, `graphite`, `jelly`, `jelly-duo`, `jelly-fill`, `mosaic`, `notdog`,
|
|
252
|
+
`notdog-duo`, `pixel`, `slab`, `slab-press`, `slab-duo`, `slab-press-duo`, `thumbprint`,
|
|
253
|
+
`utility`, `utility-duo`, `utility-fill`, `vellum`, `whiteboard`. A single-style pack always
|
|
254
|
+
uses its own style (`jelly` → regular, `utility` → semibold, …), as `brands` ignores `variant`.
|
|
255
|
+
Variants (`LyraFontAwesomeVariant`): `solid`, `regular`, `light`, `thin`, `semibold`.
|
|
256
|
+
- Precedence: the icon's `family`/`variant`, then `setDefaultIconFamily()`, then the preset's
|
|
257
|
+
`defaultFamily`/`defaultVariant`, then `classic` and the family's first style. A family given
|
|
258
|
+
without a variant uses that family's default style.
|
|
259
|
+
- The resolver fails closed **before any request**: a name other than lowercase kebab-case (the
|
|
260
|
+
copy-pasted `fa-house` class form is accepted), an unknown family or variant, or a Pro family on
|
|
261
|
+
the free tier throws, so the icon shows the localized `iconLoadError` alert and emits `lr-error`
|
|
262
|
+
with `detail.src` set to the name. A 404, an oversized file or a missing sanitizer fails the same
|
|
263
|
+
way with `iconLoadError`, `iconTooLarge` or `iconSanitizerMissing`.
|
|
264
|
+
- Duotone layers (`.fa-primary`/`.fa-secondary`) use the `--primary-*`/`--secondary-*` hooks and
|
|
265
|
+
`swap-opacity` listed above; they inherit, so one rule on an ancestor themes every icon. The
|
|
266
|
+
preset mutator only adds `fill="currentColor"` to SVGs that declare no fill.
|
|
267
|
+
- Helpers for custom resolvers: `createFontAwesomeIconResolver(options)` (the same validated
|
|
268
|
+
resolver) and `fontAwesomeIconFolder(family, variant)` (`duotone`/`light` → `duotone-light`;
|
|
269
|
+
throws `RangeError` on unknown input). `fontAwesomeIconMutator` is exported too.
|
|
270
|
+
- Font Awesome's icons are licensed separately (Free: CC BY 4.0); a kit code is a public,
|
|
271
|
+
domain-restricted token, so restrict it to your domains in Font Awesome's kit settings.
|
|
272
|
+
|
|
273
|
+
### Bootstrap Icons preset
|
|
274
|
+
|
|
275
|
+
Bootstrap Icons (MIT) is the vocabulary Shoelace's `<sl-icon>` resolves by default. Its opt-in
|
|
276
|
+
preset lives at its own side-effect-free subpath and follows the same rules as the Font Awesome
|
|
277
|
+
preset: importing registers and fetches nothing, and every request runs the pipeline above.
|
|
278
|
+
|
|
279
|
+
```ts
|
|
280
|
+
import "@aceshooting/lyra-ui/components/lr-icon.js";
|
|
281
|
+
import { registerBootstrapIconLibrary } from "@aceshooting/lyra-ui/components/utility/icon/icon-library-bootstrap.js";
|
|
282
|
+
|
|
283
|
+
const unregister = registerBootstrapIconLibrary(); // library name "bi", pinned jsDelivr release
|
|
284
|
+
// Migrated Shoelace markup: own every icon that sets no library, from a self-hosted copy.
|
|
285
|
+
registerBootstrapIconLibrary({ name: "default", basePath: "/assets/bootstrap-icons" });
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
```html
|
|
289
|
+
<lr-icon library="bi" name="gear" label="Settings"></lr-icon>
|
|
290
|
+
<lr-icon name="house-fill"></lr-icon>
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
- Options (`LyraBootstrapIconLibraryOptions`): `name` (default `'bi'`; `'default'` matches
|
|
294
|
+
Shoelace's default library), `basePath` (the package's `icons/` folder; icons resolve to
|
|
295
|
+
`<basePath>/<name>.svg`) and `version` (exact `major.minor.patch`, default
|
|
296
|
+
`BOOTSTRAP_ICONS_DEFAULT_VERSION` = `1.13.2`; ignored with `basePath`). Malformed options throw
|
|
297
|
+
at the call site. The function returns an unregister callback that only removes its own
|
|
298
|
+
registration.
|
|
299
|
+
- Bootstrap Icons has no families or variants, so `family`/`variant` are ignored; a filled glyph is
|
|
300
|
+
its own name (`house-fill`).
|
|
301
|
+
- The resolver fails closed **before any request** for a name other than lowercase kebab-case (the
|
|
302
|
+
copy-pasted `bi-house` class form is accepted), with the localized `iconLoadError` alert and
|
|
303
|
+
`lr-error`. A 404, an oversized file or a missing sanitizer fails as described above.
|
|
304
|
+
- The preset mutator only adds `fill="currentColor"` to SVGs that declare no fill; the published
|
|
305
|
+
files already paint with `currentColor`.
|
|
306
|
+
- Helpers for custom resolvers: `createBootstrapIconResolver(options)` (the same validated resolver)
|
|
307
|
+
and `bootstrapIconMutator`.
|
|
308
|
+
- `lyra-ui-migrate` reports migrated `sl-icon`/`sl-icon-button` tags with
|
|
309
|
+
`BEHAVIOR_REVIEW_REQUIRED` and names this preset as the remedy; registering it is left to the
|
|
310
|
+
application, which chooses the CDN or a self-hosted copy.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md)
|
|
10
10
|
- **Deprecations** none
|
|
11
11
|
- **Optional peers** none
|
|
12
|
-
- **Themeable via** 17 parts,
|
|
12
|
+
- **Themeable via** 17 parts, 39 custom properties — see this component's own `@csspart`/`@cssprop` list below
|
|
13
13
|
- **Tokens by part** (prefer these over a `::part()` rule) `input-wrapper`: `--lr-input-gap`
|
|
14
14
|
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`
|
|
15
15
|
|
|
@@ -486,6 +486,6 @@ first field's, referenced here by id.
|
|
|
486
486
|
|
|
487
487
|
Further custom properties:
|
|
488
488
|
|
|
489
|
-
- `--lr-form-control-label-
|
|
489
|
+
- `--lr-form-control-label-gap` also spaces a label above the field.
|
|
490
490
|
- `--lr-form-control-label-text-align` (default `inherit`): Text alignment of the field label.
|
|
491
491
|
- `--lr-form-control-label-text-transform` (default `inherit`): Text transform of the field label.
|
|
@@ -31,7 +31,8 @@ A lightbox opened outside an existing native `dialog.showModal()` stays interact
|
|
|
31
31
|
- `open: boolean = false` (reflected) — post-render writes run the same cancelable lifecycle as
|
|
32
32
|
`show()`/`hide()`/`close()`. Initial `open` markup is state and emits no lifecycle events.
|
|
33
33
|
- `images: readonly LyraLightboxImage[] = []` (attribute: false) —
|
|
34
|
-
`LyraLightboxImage { readonly src: string; readonly alt?: string; readonly caption?: string }
|
|
34
|
+
`LyraLightboxImage { readonly src: string; readonly alt?: string; readonly caption?: string; readonly thumbnail?: string }`
|
|
35
|
+
(`thumbnail` is the `with-thumbnails` strip image, falling back to `src`).
|
|
35
36
|
Assignment clones/freezes the records and inspects at most 10,000 candidates; malformed records
|
|
36
37
|
are omitted and updates require a new collection assignment. `src` is passed to the embedded
|
|
37
38
|
frame, which runs it through `safeMediaSrc()`. `alt`/`caption` are caller data, never localized.
|
|
@@ -40,7 +41,9 @@ A lightbox opened outside an existing native `dialog.showModal()` stays interact
|
|
|
40
41
|
Invalid defined sources show a localized error and retry action; they never fall back to the
|
|
41
42
|
legacy array. Setting `undefined` restores the current `images` input. Reassign the source,
|
|
42
43
|
including the same object, or call a keyless `requestUpdate()` after changing its revision or
|
|
43
|
-
mutable provider state. Unrelated named display updates do not refresh the source.
|
|
44
|
+
mutable provider state. Unrelated named display updates do not refresh the source. With
|
|
45
|
+
`with-thumbnails`, a separate strip window reads the descriptors of the 15 positions around the
|
|
46
|
+
current one (never the whole collection); a position still loading shows its number.
|
|
44
47
|
- `index: number = 0` (reflected) — clamped defensively for rendering and re-synced (emitting
|
|
45
48
|
`lr-index-change`) when the active collection shrinks. In source mode, it retains the requested
|
|
46
49
|
logical index while its descriptor and image load.
|
|
@@ -67,8 +70,8 @@ A lightbox opened outside an existing native `dialog.showModal()` stays interact
|
|
|
67
70
|
Blank labels use the localized `lightboxLabel` default.
|
|
68
71
|
|
|
69
72
|
More properties: `withThumbnails` (attribute `with-thumbnails`, default `false`): Shows a strip of
|
|
70
|
-
thumbnails for jumping between items
|
|
71
|
-
|
|
73
|
+
thumbnails for jumping between items in every mode; each uses the item's `thumbnail`, else the
|
|
74
|
+
full image (a bounded 15-position window with `imageSource`). `withoutNavigation` (attribute `without-navigation`, default
|
|
72
75
|
`false`): Hides the previous/next buttons. Swiping and the arrow keys still navigate. `withoutZoom`
|
|
73
76
|
(attribute `without-zoom`, default `false`): Disables zooming and removes the zoom button and the
|
|
74
77
|
embedded zoom controls.
|
|
@@ -107,20 +110,24 @@ document revokes obsolete work, so a late completion cannot display an old image
|
|
|
107
110
|
pan/zoom frame stays mounted and retains focus. The provider should honor the request's abort
|
|
108
111
|
signal; stale-result protection does not make an abort-ignoring provider settle promptly.
|
|
109
112
|
|
|
110
|
-
**Events:** cancelable `lr-show`, followed after
|
|
113
|
+
**Events:** cancelable `lr-show`, followed by `lr-after-show` once the open panel has rendered and its
|
|
114
|
+
enter animation has finished;
|
|
111
115
|
conditionally cancelable `lr-hide` (`detail: LyraLightboxHideDetail = { source: Element }`):
|
|
112
116
|
cancelable before a requested close, non-cancelable when an open instance unmounts. A requested
|
|
113
117
|
close then emits cancelable `lr-close-request` with `{ reason: LyraLightboxCloseReason }`.
|
|
114
118
|
An accepted dismissal sets `open = false` and emits non-cancelable `lr-close` with the same reason
|
|
115
119
|
object. Use
|
|
116
120
|
`lr-close-request` for vetoes and `lr-close` for accepted dismissals.
|
|
117
|
-
`lr-after-hide` follows the
|
|
121
|
+
`lr-after-hide` follows once the exit animation has finished. Both after-events fire straight after
|
|
122
|
+
the render under `prefers-reduced-motion` or a zero duration, `show()`/`hide()` resolve with them,
|
|
123
|
+
and a transition interrupted by the opposite one emits no after-event. Removal while open cannot be vetoed and reports reason
|
|
118
124
|
`unmount`. `lr-index-change` (`detail: { index }`, fired
|
|
119
|
-
for internally-driven navigation — a button, a keyboard shortcut, or
|
|
120
|
-
`goTo()` — and when a shrinking active collection normalizes the index; **not** when a consumer sets
|
|
125
|
+
for internally-driven navigation — a button, a thumbnail, a swipe, a keyboard shortcut, or
|
|
126
|
+
`next()`/`previous()`/`goTo()` — and when a shrinking active collection normalizes the index; **not** when a consumer sets
|
|
121
127
|
`index` directly); `lr-item-change` (`detail: { index, previousIndex, item, previousItem }`, the
|
|
122
128
|
items `null` in data mode) fires alongside `lr-index-change` for the same navigations and, like it,
|
|
123
|
-
not when `index` is written directly
|
|
129
|
+
not when `index` is written directly, open or closed (the same rule as `lr-carousel`'s
|
|
130
|
+
`lr-slide-change` for a direct `currentSlide` write; call `goTo()` to change the item and be notified); `lr-zoom-change` (`detail: {
|
|
124
131
|
zoom }`) is not emitted by the lightbox itself — it bubbles up composed from the embedded frame.
|
|
125
132
|
|
|
126
133
|
**Slots:** `actions` — extra toolbar buttons (download/share/delete), rendered in `[part="toolbar"]`
|
|
@@ -180,9 +187,8 @@ photo content.
|
|
|
180
187
|
measured by the lightbox, so stale load events cannot apply a previous image's size. The fit
|
|
181
188
|
policy covers the painted image only; the lightbox's DOM caption, toolbar, legend-like actions,
|
|
182
189
|
and tooltip content remain outside that image surface.
|
|
183
|
-
- scope
|
|
184
|
-
|
|
185
|
-
still observable through the before/after events and methods above.
|
|
190
|
+
- scope: no dot indicators, no click-image-to-navigate and no inertial fling (only the release
|
|
191
|
+
distance decides a swipe). Per-item custom content uses `<lr-lightbox-item>` templates (below).
|
|
186
192
|
|
|
187
193
|
Set `--lr-lightbox-control-hover-bg` and `--lr-lightbox-control-hover-color` for hovered controls. Set `--lr-lightbox-control-active-bg` and `--lr-lightbox-control-active-color` for pressed controls.
|
|
188
194
|
|
|
@@ -213,12 +219,32 @@ current item while open. URLs are validated: `src` for the link with `safeLinkHr
|
|
|
213
219
|
with `safeMediaSrc()`; a rejected `src` leaves a button-style trigger and the item out of the viewer.
|
|
214
220
|
An item with no `src` is activated with Enter/Space.
|
|
215
221
|
|
|
216
|
-
**
|
|
222
|
+
**Custom slides** — anything other than an image or a native video (an embed, a player, another
|
|
223
|
+
component) goes in a `<template>` that is a direct child of the item. The lightbox copies the
|
|
224
|
+
template's content only while that slide is shown, into a `<div slot="slide-content">` it appends to
|
|
225
|
+
itself (light DOM, so page styles apply), and removes the copy on any other slide or once the close
|
|
226
|
+
motion ends. `src` is optional (it stays the no-JavaScript link when set); `width`/`height` give the
|
|
227
|
+
slide its proportions; custom content cannot be zoomed; the slotted `img` or `thumbnail` stays the
|
|
228
|
+
page and strip thumbnail. Slotted controls in the copy keep their arrow keys, and content that
|
|
229
|
+
handles its own dragging should call `preventDefault()` on `pointerdown` so no swipe starts there.
|
|
230
|
+
|
|
231
|
+
```html
|
|
232
|
+
<lr-lightbox-item width="1600" height="900" thumbnail="/maps/route-thumb.jpg" alt="Route map">
|
|
233
|
+
<template><iframe src="https://maps.example/embed/route" title="Route map" style="inline-size: 100%; block-size: 100%; border: 0"></iframe></template>
|
|
234
|
+
</lr-lightbox-item>
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Lightbox additions** — `with-thumbnails` (thumbnail strip, in every mode), `without-navigation`
|
|
217
238
|
(hides previous/next; arrow keys and swipe stay), `without-zoom` (no zoom button/controls; the toolbar zoom button exists for slotted items only), `label`
|
|
218
239
|
(reflected; names the dialog; a host `aria-label` wins), `items` and `currentItem` getters, `zoomIn()`/`zoomOut()`.
|
|
219
240
|
`lr-item-change` fires with every `lr-index-change` and adds `{ index, previousIndex, item, previousItem }`
|
|
220
|
-
(items are `null` in data mode); like `lr-index-change` it is not fired when `index` is written directly.
|
|
221
|
-
|
|
241
|
+
(items are `null` in data mode); like `lr-index-change` it is not fired when `index` is written directly.
|
|
242
|
+
Touch and pen swipes (never mouse) follow the pointer once the drag is clearly horizontal: releasing
|
|
243
|
+
at least 50px toward an existing item moves to it, the incoming slide continuing from the release
|
|
244
|
+
point; a shorter or mostly vertical drag, a drag past the first/last item without `loop` (followed
|
|
245
|
+
with resistance) and `pointercancel` settle the slide back. Directions reverse under RTL; under
|
|
246
|
+
`prefers-reduced-motion` the slide does not follow the pointer and the release navigates or stays
|
|
247
|
+
without motion. No swipe starts on a control, link, video or form field, or while zoomed. A `type="video"` item plays in a native `<video>`
|
|
222
248
|
that pauses on slide change and close; zoom is unavailable for video. Slots `close-icon`,
|
|
223
249
|
`previous-icon`, `next-icon`, `zoom-in-icon`, `zoom-out-icon`. Added part aliases: `dialog` (panel),
|
|
224
250
|
`scroll-container` (stage), `image` (the zoomable `frame`),
|
|
@@ -226,8 +252,8 @@ that pauses on slide change and close; zoom is unavailable for video. Slots `clo
|
|
|
226
252
|
Match them with `[part~="…"]` when querying.
|
|
227
253
|
Motion: `--show-duration`/`--hide-duration` (or `--lr-lightbox-panel-duration`, default
|
|
228
254
|
`--lr-duration-base`) drive the open/close and slide animations, which are flattened under
|
|
229
|
-
`prefers-reduced-motion`; `lr-after-show`/`lr-after-hide`
|
|
230
|
-
|
|
255
|
+
`prefers-reduced-motion`; `lr-after-show`/`lr-after-hide` wait for the open/close motion to finish
|
|
256
|
+
(the host stays painted with `data-closing` until the exit motion ends).
|
|
231
257
|
`--slide-gap` (`--lr-lightbox-slide-gap`), `--thumbnail-size` (`--lr-lightbox-thumbnail-size`) and
|
|
232
258
|
`--media-border-radius` (`--lr-lightbox-media-radius`) style slides and the strip.
|
|
233
259
|
Upstream-named styling properties: `--backdrop-color` (scrim), `--backdrop-filter` (default `none`,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md)
|
|
10
10
|
- **Deprecations** none
|
|
11
11
|
- **Optional peers** none
|
|
12
|
-
- **Themeable via** 18 parts,
|
|
12
|
+
- **Themeable via** 18 parts, 40 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
|
---
|
|
@@ -357,7 +357,7 @@ The start-placed label aligns to the first line of the field, measured with `--l
|
|
|
357
357
|
|
|
358
358
|
Further custom properties:
|
|
359
359
|
|
|
360
|
-
- `--lr-form-control-label-
|
|
360
|
+
- `--lr-form-control-label-gap` also spaces a label above the field.
|
|
361
361
|
- `--lr-form-control-label-line-height` (default `inherit`): Line height of the field label.
|
|
362
362
|
- `--lr-form-control-label-text-align` (default `inherit`): Text alignment of the field label.
|
|
363
363
|
- `--lr-form-control-label-text-transform` (default `inherit`): Text transform of the field label.
|
|
@@ -722,9 +722,24 @@ for the `anchor` slot and every `lr-map-anchor` child without its own `safeArea`
|
|
|
722
722
|
removing an element or disconnecting the map releases the observers. `anchorAvoidGap` (attribute
|
|
723
723
|
`anchor-avoid-gap`, CSS pixels, default `0`) keeps that much extra room beyond each edge an
|
|
724
724
|
obstacle reserves, so a panel never sits flush against it; edges no obstacle reserves stay zero.
|
|
725
|
+
Obstacles that are not rendered reserve nothing: detached, zero-size, `display: none` or
|
|
726
|
+
`visibility: hidden` (also inherited). A change to an obstacle's own `style`, `class` or `hidden`
|
|
727
|
+
attribute re-measures it.
|
|
728
|
+
|
|
729
|
+
`anchorAvoidSides?: readonly LyraMapAnchorAvoidObstacle[]` (property only) names the side of an
|
|
730
|
+
obstacle anchors stay on, for chrome whose cheapest edge changes with its size: a floating search
|
|
731
|
+
bar whose results list opens becomes taller than it is wide, and the cheapest edge would then
|
|
732
|
+
squeeze the panel into a column beside it. Each `{ element, side }` entry is observed like an
|
|
733
|
+
`anchorAvoid` element; `side: LyraMapAnchorAvoidSide` is `'block-end'` (below it), `'block-start'`
|
|
734
|
+
(above it), `'inline-start'` or `'inline-end'` (before or after it in the map's reading direction,
|
|
735
|
+
so they swap under RTL), or `'auto'`, the cheapest edge (also used for an unknown side). An element
|
|
736
|
+
in both lists takes its side from `anchorAvoidSides`; one listed only there is added. Entries are
|
|
737
|
+
read once on assignment; assign a new array to change a side.
|
|
725
738
|
|
|
726
739
|
```ts
|
|
727
|
-
|
|
740
|
+
const search = document.querySelector('.search')!;
|
|
741
|
+
map.anchorAvoid = [document.querySelector('header.app-bar')!, search];
|
|
742
|
+
map.anchorAvoidSides = [{ element: search, side: 'block-end' }];
|
|
728
743
|
```
|
|
729
744
|
|
|
730
745
|
**Multiple anchored panels:** when several panels must be open at once, each opened and closed by
|
|
@@ -157,7 +157,7 @@ The popup is a floating surface and paints from the **shared overlay-surface fam
|
|
|
157
157
|
`--lr-overlay-surface` (default `var(--lr-color-surface-overlay)`), `--lr-overlay-border` (default
|
|
158
158
|
`var(--lr-color-border)`) and `--lr-overlay-shadow-anchored` (default `var(--lr-shadow-m)`). None is
|
|
159
159
|
declared on `:host`, so one declaration on `:root` — or on any ancestor, to scope it — retints this
|
|
160
|
-
surface together with every other floating surface in the library. `--lr-overlay-radius` (default `var(--lr-radius)`) is the matching corner radius.
|
|
160
|
+
surface together with every other floating surface in the library. `--lr-overlay-radius` (default `var(--lr-radius-container)`) is the matching corner radius.
|
|
161
161
|
The edge deliberately keeps the control tier, `var(--lr-color-border)`, rather than the
|
|
162
162
|
decorative `var(--lr-color-border-subtle)` floating panels default to: the listbox completes the
|
|
163
163
|
value of the text field it is bound to and keeps that field's boundary contrast (see `<lr-popover>`).
|
|
@@ -90,7 +90,7 @@ style those on `<lr-dropdown>` when using the overlay composition.
|
|
|
90
90
|
**Themeable custom properties:** the standalone menu surface and a submenu's own surface paint from
|
|
91
91
|
the **shared overlay-surface family** (16.0.0) — `--lr-overlay-surface` (default
|
|
92
92
|
`var(--lr-color-surface-overlay)`), `--lr-overlay-border` (default `var(--lr-color-border-subtle)`),
|
|
93
|
-
`--lr-overlay-radius` (default `var(--lr-radius)`) and, on the submenu only,
|
|
93
|
+
`--lr-overlay-radius` (default `var(--lr-radius-container)`) and, on the submenu only,
|
|
94
94
|
`--lr-overlay-shadow-anchored` (default `var(--lr-shadow-m)`). None is declared on `:host`, so one
|
|
95
95
|
declaration on `:root` (or on any ancestor, to scope it) retints this menu together with every other
|
|
96
96
|
floating surface. A menu contained by `<lr-dropdown>` paints no surface of its own, so the family has
|