@aceshooting/lyra-ui 21.0.0 → 21.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 +56 -0
- package/README.md +6 -3
- package/custom-elements.json +1 -1
- package/dist/ai/runtime.js +1 -1
- package/dist/ai/types.d.ts +13 -5
- package/dist/cli/lyra-rename-ledger.mjs +1 -0
- package/dist/cli/migrate-wa.mjs +33 -13
- package/dist/cli/migration-contract.json +1 -1
- package/dist/components/agent-tools/agent-trace/agent-trace.class.d.ts +5 -3
- package/dist/components/agent-tools/agent-trace/agent-trace.class.js +3 -2
- package/dist/components/agent-tools/tool-call-block/tool-call-block.class.d.ts +15 -3
- package/dist/components/agent-tools/tool-call-block/tool-call-block.class.js +3 -3
- package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.d.ts +24 -8
- package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.js +3 -3
- package/dist/components/agent-tools/tool-param-form/tool-param-form.class.js +4 -0
- package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.class.d.ts +9 -5
- package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.class.js +2 -2
- package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.styles.js +1 -1
- package/dist/components/agent-tools/tool-status.js +2 -2
- package/dist/components/agent-tools/tool-timeline/tool-timeline.class.d.ts +8 -0
- package/dist/components/agent-tools/tool-timeline/tool-timeline.class.js +3 -2
- package/dist/components/agent-tools/tool-timeline/tool-timeline.styles.js +1 -1
- package/dist/components/agent-tools/trace-tree/span.d.ts +2 -2
- package/dist/components/charts/chart/box-plot.class.d.ts +3 -1
- package/dist/components/charts/chart/box-plot.class.js +9 -9
- package/dist/components/charts/chart/chart-bidi.d.ts +109 -0
- package/dist/components/charts/chart/chart-bidi.js +1 -0
- package/dist/components/charts/chart/chart.class.d.ts +17 -2
- package/dist/components/charts/chart/chart.class.js +10 -8
- package/dist/components/charts/chart/histogram.class.js +1 -1
- package/dist/components/charts/chart/lite-chart.class.d.ts +24 -5
- package/dist/components/charts/chart/lite-chart.class.js +9 -9
- package/dist/components/charts/chart/lite-chart.styles.js +1 -1
- package/dist/components/conversation/code-block/shiki-dark-theme.d.ts +2 -2
- package/dist/components/conversation/code-block/shiki-dark-theme.js +1 -1
- package/dist/components/conversation/conversation-item/conversation-item.class.d.ts +18 -2
- package/dist/components/conversation/conversation-item/conversation-item.class.js +3 -3
- package/dist/components/conversation/conversation-item/conversation-item.styles.js +1 -1
- package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
- package/dist/components/conversation/markdown/markdown-core.class.d.ts +3 -1
- package/dist/components/conversation/markdown/markdown.class.d.ts +3 -1
- package/dist/components/conversation/message-actions/message-actions.class.d.ts +7 -2
- package/dist/components/conversation/message-actions/message-actions.class.js +2 -2
- package/dist/components/conversation/message-parts/message-parts.class.d.ts +6 -2
- package/dist/components/conversation/message-parts/message-parts.class.js +5 -3
- package/dist/components/conversation/selection-toolbar/selection-toolbar.class.d.ts +3 -2
- package/dist/components/conversation/selection-toolbar/selection-toolbar.class.js +1 -1
- package/dist/components/conversation/streaming-text/streaming-text-base.class.d.ts +1 -5
- package/dist/components/conversation/streaming-text/streaming-text-base.class.js +2 -2
- package/dist/components/conversation/streaming-text/streaming-text-core.class.d.ts +7 -1
- package/dist/components/conversation/streaming-text/streaming-text-core.class.js +3 -4
- package/dist/components/conversation/streaming-text/streaming-text.class.d.ts +7 -1
- package/dist/components/conversation/streaming-text/streaming-text.class.js +3 -4
- package/dist/components/conversation/thread-list/thread-list.class.d.ts +13 -2
- package/dist/components/conversation/thread-list/thread-list.class.js +3 -3
- package/dist/components/data/data-grid/data-grid.class.js +1 -1
- package/dist/components/data/document-library/document-library.class.js +2 -0
- package/dist/components/data/flow-canvas/flow-canvas.class.js +1 -1
- package/dist/components/data/flow-minimap/flow-minimap.class.js +1 -1
- package/dist/components/data/flow-node/flow-node.class.d.ts +6 -2
- package/dist/components/data/flow-node/flow-node.class.js +6 -2
- package/dist/components/data/flow-node/flow-node.styles.js +1 -1
- package/dist/components/data/gauge/gauge.styles.js +1 -1
- package/dist/components/data/heatmap/heatmap.class.d.ts +3 -0
- package/dist/components/data/heatmap/heatmap.class.js +2 -2
- package/dist/components/data/heatmap/heatmap.styles.js +1 -1
- package/dist/components/data/sparkline/sparkline.class.d.ts +5 -3
- package/dist/components/data/stat/stat.class.d.ts +4 -3
- package/dist/components/data/table/table.class.d.ts +32 -5
- package/dist/components/data/table/table.class.js +3 -2
- package/dist/components/forms/button/button.class.d.ts +7 -1
- package/dist/components/forms/button/button.styles.js +1 -1
- package/dist/components/forms/date-picker/date-input.styles.js +1 -1
- package/dist/components/forms/input/input.styles.js +1 -1
- package/dist/components/forms/rubric-form/rubric-form.class.js +1 -0
- package/dist/components/layout/app-rail/app-rail.class.d.ts +50 -11
- package/dist/components/layout/app-rail/app-rail.class.js +2 -2
- package/dist/components/layout/command-palette/command-palette.class.js +1 -1
- package/dist/components/layout/menu/menu.class.d.ts +6 -5
- package/dist/components/layout/split-panel/split-panel.class.d.ts +2 -1
- package/dist/components/media/flag/language-map.d.ts +8 -0
- package/dist/components/media/flag/language-map.js +1 -1
- package/dist/components/media/map/map-loader.d.ts +7 -1
- package/dist/components/media/map/map.class.d.ts +111 -5
- package/dist/components/media/map/map.class.js +3 -3
- package/dist/components/media/media-card/media-card.class.d.ts +18 -5
- package/dist/components/media/media-card/media-card.class.js +1 -1
- package/dist/components/overlays/overlay/popover.class.d.ts +20 -0
- package/dist/components/overlays/overlay/popover.class.js +2 -2
- package/dist/components/retrieval/graph/graph.class.d.ts +3 -3
- package/dist/components/retrieval/graph/graph.class.js +1 -1
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.d.ts +5 -3
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js +3 -2
- package/dist/components/retrieval/mind-map/mind-map.class.d.ts +3 -3
- package/dist/components/retrieval/mind-map/mind-map.class.js +1 -1
- package/dist/components/retrieval/retrieval-results/retrieval-results.class.d.ts +4 -1
- package/dist/components/retrieval/retrieval-results/retrieval-results.class.js +5 -1
- package/dist/components/retrieval/source-picker/source-picker.class.d.ts +4 -1
- package/dist/components/retrieval/source-picker/source-picker.class.js +5 -1
- package/dist/components/utility/icon/icon.class.d.ts +9 -3
- package/dist/components/utility/icon/icon.class.js +1 -1
- package/dist/components/utility/mutation-observer/mutation-observer.class.d.ts +14 -8
- package/dist/components/utility/mutation-observer/mutation-observer.class.js +1 -1
- package/dist/components/viewers/document-viewer/document-viewer.class.d.ts +6 -1
- package/dist/components/viewers/document-viewer/document-viewer.class.js +7 -1
- package/dist/components/viewers/document-viewer/registry.d.ts +12 -3
- package/dist/components/viewers/geojson-view/geojson-view.class.d.ts +13 -5
- package/dist/components/viewers/geojson-view/geojson-view.class.js +1 -1
- package/dist/components/viewers/geojson-view/geojson-viewer.class.d.ts +3 -2
- package/dist/custom-elements-jsx.d.ts +1 -1
- package/dist/events.d.ts +644 -1242
- package/dist/internal/anchored-overlay-runtime.d.ts +2 -2
- package/dist/internal/cell-range.d.ts +0 -6
- package/dist/internal/cell-range.js +1 -1
- package/dist/internal/css-token-length.d.ts +7 -0
- package/dist/internal/css-token-length.js +1 -0
- package/dist/internal/default-strings.generated.d.ts +1 -1
- package/dist/internal/default-strings.generated.js +1 -1
- package/dist/internal/deferred-focus-return.d.ts +7 -4
- package/dist/internal/deferred-focus-return.js +1 -1
- package/dist/internal/dev-mode-attribute-warning.d.ts +35 -0
- package/dist/internal/dev-mode-attribute-warning.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 +2 -2
- package/dist/internal/package-metadata.d.ts +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/papaparse-loader.d.ts +1 -1
- package/dist/internal/papaparse-loader.js +1 -1
- package/dist/internal/positioner.d.ts +10 -0
- package/dist/internal/positioner.js +1 -1
- package/dist/internal/shared-unions.d.ts +2 -1
- package/dist/internal/slotted-overlay-controller.d.ts +20 -0
- package/dist/internal/slotted-overlay-controller.js +1 -0
- package/dist/internal/text-quote.d.ts +1 -1
- package/dist/internal/text-quote.js +1 -1
- package/dist/internal/theme-observation.d.ts +4 -0
- package/dist/internal/theme-observation.js +1 -0
- package/dist/internal/theme-watcher.js +1 -1
- package/dist/localization.d.ts +6 -1
- package/dist/localization.js +1 -1
- package/dist/lyra.d.ts +1 -1
- package/dist/lyra.js +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/testing/lyra-tag-event-map.js +1 -1
- package/dist/translations/ar/agent-tools.js +1 -1
- package/dist/translations/cs/agent-tools.js +1 -1
- package/dist/translations/da/agent-tools.js +1 -1
- package/dist/translations/de/agent-tools.js +1 -1
- package/dist/translations/de-CH/agent-tools.js +1 -1
- package/dist/translations/es/agent-tools.js +1 -1
- package/dist/translations/fa/agent-tools.js +1 -1
- package/dist/translations/fi/agent-tools.js +1 -1
- package/dist/translations/fr/agent-tools.js +1 -1
- package/dist/translations/he/agent-tools.js +1 -1
- package/dist/translations/hi/agent-tools.js +1 -1
- package/dist/translations/hr/agent-tools.js +1 -1
- package/dist/translations/hu/agent-tools.js +1 -1
- package/dist/translations/id/agent-tools.js +1 -1
- package/dist/translations/it/agent-tools.js +1 -1
- package/dist/translations/ja/agent-tools.js +1 -1
- package/dist/translations/kk/agent-tools.js +1 -1
- package/dist/translations/ko/agent-tools.js +1 -1
- package/dist/translations/nb/agent-tools.js +1 -1
- package/dist/translations/nl/agent-tools.js +1 -1
- package/dist/translations/nn/agent-tools.js +1 -1
- package/dist/translations/pl/agent-tools.js +1 -1
- package/dist/translations/pt-BR/agent-tools.js +1 -1
- package/dist/translations/pt-PT/agent-tools.js +1 -1
- package/dist/translations/pt-PT/charts.js +1 -1
- package/dist/translations/pt-PT/conversation.js +1 -1
- package/dist/translations/pt-PT/data.js +1 -1
- package/dist/translations/pt-PT/forms.js +1 -1
- package/dist/translations/pt-PT/layout.js +1 -1
- package/dist/translations/pt-PT/media.js +1 -1
- package/dist/translations/pt-PT/retrieval.js +1 -1
- package/dist/translations/pt-PT/shared.js +1 -1
- package/dist/translations/pt-PT/utility.js +1 -1
- package/dist/translations/pt-PT/viewers.js +2 -2
- package/dist/translations/ro/agent-tools.js +1 -1
- package/dist/translations/ru/agent-tools.js +1 -1
- package/dist/translations/sl/agent-tools.js +1 -1
- package/dist/translations/sv/agent-tools.js +1 -1
- package/dist/translations/tr/agent-tools.js +1 -1
- package/dist/translations/uk/agent-tools.js +1 -1
- package/dist/translations/zh-CN/agent-tools.js +1 -1
- package/dist/translations/zh-TW/agent-tools.js +1 -1
- package/dist/utilities/index.d.ts +1 -1
- package/dist/utilities/index.js +1 -1
- package/dist/utilities/localization.d.ts +28 -10
- package/dist/vue.d.ts +1 -1
- package/llms/components/lr-accordion-item.md +2 -344
- package/llms/components/lr-accordion.md +2 -344
- package/llms/components/lr-app-rail-group.md +2 -721
- package/llms/components/lr-app-rail-item.md +2 -721
- package/llms/components/lr-app-rail.md +29 -4
- package/llms/components/lr-bar-chart.md +2 -87
- package/llms/components/lr-box-plot.md +1 -1
- package/llms/components/lr-breadcrumb-item.md +2 -67
- package/llms/components/lr-bubble-chart.md +2 -87
- package/llms/components/lr-button.md +7 -0
- package/llms/components/lr-chart.md +4 -5
- package/llms/components/lr-chip-group.md +2 -272
- package/llms/components/lr-conversation-item.md +20 -2
- package/llms/components/lr-date-input.md +2 -457
- package/llms/components/lr-date-picker.md +6 -2
- package/llms/components/lr-document-library.md +3 -3
- package/llms/components/lr-document-viewer.md +14 -5
- package/llms/components/lr-doughnut-chart.md +2 -87
- package/llms/components/lr-dropdown-item.md +2 -306
- package/llms/components/lr-dropdown.md +6 -0
- package/llms/components/lr-flag.md +9 -1
- package/llms/components/lr-flow-node.md +4 -1
- package/llms/components/lr-geojson-view.md +3 -90
- package/llms/components/lr-geojson-viewer.md +13 -5
- package/llms/components/lr-icon-button.md +4 -1
- package/llms/components/lr-icon.md +14 -6
- package/llms/components/lr-input.md +9 -2
- package/llms/components/lr-lite-chart.md +17 -9
- package/llms/components/lr-map.md +87 -2
- package/llms/components/lr-markdown-core.md +5 -4
- package/llms/components/lr-markdown.md +4 -2
- package/llms/components/lr-media-card.md +10 -5
- package/llms/components/lr-menu-item.md +2 -306
- package/llms/components/lr-menu.md +9 -6
- package/llms/components/lr-menubar-item.md +2 -125
- package/llms/components/lr-message-actions.md +4 -1
- package/llms/components/lr-message-parts.md +14 -5
- package/llms/components/lr-mutation-observer.md +12 -6
- package/llms/components/lr-navigation-menu-item.md +2 -237
- package/llms/components/lr-number-input.md +4 -0
- package/llms/components/lr-option.md +2 -712
- package/llms/components/lr-pie-chart.md +2 -87
- package/llms/components/lr-polar-area-chart.md +2 -87
- package/llms/components/lr-popover.md +10 -0
- package/llms/components/lr-prompt-input.md +5 -1
- package/llms/components/lr-radar-chart.md +2 -87
- package/llms/components/lr-reorder-item.md +2 -157
- package/llms/components/lr-result-field.md +2 -117
- package/llms/components/lr-retrieval-results.md +3 -1
- package/llms/components/lr-rubric-form.md +3 -2
- package/llms/components/lr-scatter-chart.md +2 -87
- package/llms/components/lr-selection-toolbar.md +4 -2
- package/llms/components/lr-source-card.md +2 -186
- package/llms/components/lr-source-picker.md +3 -1
- package/llms/components/lr-sparkline.md +9 -4
- package/llms/components/lr-split-panel.md +5 -3
- package/llms/components/lr-stat.md +4 -3
- package/llms/components/lr-streaming-text-core.md +7 -5
- package/llms/components/lr-streaming-text.md +9 -6
- package/llms/components/lr-swatch-picker.md +130 -0
- package/llms/components/lr-tag.md +2 -177
- package/llms/components/lr-thread-list.md +27 -4
- package/llms/components/lr-timeline-item.md +2 -120
- package/llms/components/lr-toast-item.md +2 -223
- package/llms/components/lr-tool-call-block.md +12 -3
- package/llms/components/lr-tool-call-chip.md +12 -6
- package/llms/components/lr-tool-param-form.md +3 -2
- package/llms/components/lr-tool-result-dialog.md +7 -3
- package/llms/components/lr-tool-result-view.md +4 -3
- package/llms/components/lr-tool-timeline.md +12 -5
- package/llms/components/lr-tree-item.md +2 -354
- package/llms/index.md +22 -4
- package/llms/migration.md +75 -1
- package/llms/peers.md +1 -1
- package/llms/shared.md +86 -39
- package/llms-full.txt +739 -163
- package/package.json +6 -6
- 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
|
@@ -9,348 +9,6 @@
|
|
|
9
9
|
- **Release history** [CHANGELOG.md](../../CHANGELOG.md); family-wide breaking-change summaries: [llms-full.txt](../../llms-full.txt)
|
|
10
10
|
- **Deprecated part** `base` since `8.2.3`; use part `::part(accordion-item)`; removal not before `10.0.0` — The accordion-item part names the outer wrapper explicitly; base remains on that same node during the compatibility window. That version is a policy floor, not a plan: Web Awesome still publishes its own deprecated `base` part on `wa-accordion-item`, and a mirrored tag owes its whole upstream surface, so this alias is removed only when upstream's is.
|
|
11
11
|
- **Optional peers** none
|
|
12
|
-
- **Themeable via** 8 parts, 17 custom properties — see
|
|
13
|
-
- **Documented with** `lr-details
|
|
12
|
+
- **Themeable via** 8 parts, 17 custom properties — see `lr-details.md`
|
|
13
|
+
- **Documented with** `lr-details`: see [lr-details.md](./lr-details.md).
|
|
14
14
|
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## `lr-details`, `lr-accordion`, and `lr-accordion-item`
|
|
19
|
-
|
|
20
|
-
`lr-details` is a native-semantics disclosure panel; it mirrors `wa-details` / `sl-details`.
|
|
21
|
-
`lr-accordion` and `lr-accordion-item` mirror `wa-accordion` / `wa-accordion-item`: the group owns
|
|
22
|
-
mode, presentation, lifecycle events, and roving focus, while each item renders a heading button
|
|
23
|
-
and animated panel. The two components intentionally keep distinct vocabularies: accordion items
|
|
24
|
-
use `expanded`, `label`, and `expand()`/`collapse()`/`toggle()`, while `open`, `summary`, and
|
|
25
|
-
`show()`/`hide()` belong only to Details.
|
|
26
|
-
|
|
27
|
-
`lr-toggle` reports the direction and source of an accepted Details transition. Accordion
|
|
28
|
-
coordinates only its direct `lr-accordion-item` children; Details retains independent state and
|
|
29
|
-
optional grouping through a shared non-empty `name`.
|
|
30
|
-
|
|
31
|
-
**Breaking in 9.0.0:** an accordion coordinates direct `lr-accordion-item` children only. Direct
|
|
32
|
-
`lr-details` panels used to be accepted as well; they are not any more. A `lr-details` slotted into
|
|
33
|
-
an accordion today is ordinary content owning its own disclosure lifecycle — the group applies
|
|
34
|
-
neither its presentation, nor its single-panel invariant, nor its roving keyboard model, nor its
|
|
35
|
-
`lr-expand`/`lr-collapse` lifecycle to it, and `expandAll()`/`collapseAll()` skip it. Migrate both
|
|
36
|
-
the tag and its member vocabulary: `<lr-details summary="..." open>` becomes
|
|
37
|
-
`<lr-accordion-item label="..." expanded>`, and `show()`/`hide()` become
|
|
38
|
-
`expand()`/`collapse()`. `lr-details` on its own, outside an accordion, is unchanged.
|
|
39
|
-
|
|
40
|
-
**Accordion properties:**
|
|
41
|
-
|
|
42
|
-
- `mode: 'single' | 'single-collapsible' | 'multiple' = 'multiple'` (reflected). `multiple` allows
|
|
43
|
-
any number of expanded items. `single` permits at most one and activating the expanded item is a
|
|
44
|
-
no-op. `single-collapsible` permits at most one but allows zero.
|
|
45
|
-
- `iconPlacement: 'start' | 'end' = 'end'` (attribute `icon-placement`, reflected),
|
|
46
|
-
`headingLevel: string = '3'` (attribute `heading-level`, reflected; `1`–`6` select that heading,
|
|
47
|
-
`none` omits it, and every other value renders the documented h3 fallback), and
|
|
48
|
-
`appearance: 'filled' | 'outlined' | 'filled-outlined' | 'plain' = 'outlined'` (reflected). The
|
|
49
|
-
group applies all three to each direct `lr-accordion-item` whenever children or properties
|
|
50
|
-
change.
|
|
51
|
-
|
|
52
|
-
**Accordion-item properties:** `label: string = ''`, `expanded: boolean = false` (reflected),
|
|
53
|
-
`disabled: boolean = false` (reflected), plus the same `iconPlacement`, `headingLevel`, and
|
|
54
|
-
`appearance` properties listed above. **Removed in 9.0.0:** inherited Details members `open`,
|
|
55
|
-
`summary`, `name`, `size`, `show()`, and `hide()`; use the canonical accordion-item members or use
|
|
56
|
-
`lr-details` when the Details contract is required. Accordion expansion policy likewise has one
|
|
57
|
-
authority: migrate `multiple` to `mode="multiple"`, and `multiple="false"` to the intended
|
|
58
|
-
`mode="single"` or `mode="single-collapsible"` behavior.
|
|
59
|
-
|
|
60
|
-
**Details properties:** `open: boolean = false` (reflected), `disabled: boolean = false`
|
|
61
|
-
(reflected — blocks activation and sets `aria-disabled="true"`; its native summary uses
|
|
62
|
-
`tabindex="-1"` while disabled so sequential navigation matches a disabled accordion-item
|
|
63
|
-
trigger), `summary: string = ''`, `name: string = ''` (reflected — disclosures with the same
|
|
64
|
-
non-empty name in one document or shadow root are mutually exclusive),
|
|
65
|
-
`appearance: 'filled' | 'outlined' | 'filled-outlined' | 'plain' = 'outlined'` (reflected),
|
|
66
|
-
`iconPlacement: 'start' | 'end' = 'end'` (attribute `icon-placement`, reflected and logical), and
|
|
67
|
-
`size`.
|
|
68
|
-
|
|
69
|
-
A host `aria-label`, when present, names the actual Details summary or accordion-item trigger;
|
|
70
|
-
it wins over summary/label content even when explicitly empty. When the host attribute is absent,
|
|
71
|
-
Details and accordion-item property/localized fallbacks keep their native name-from-content
|
|
72
|
-
behavior. An active accordion-item `label` slot contributes its normalized
|
|
73
|
-
accessibility-visible text as the trigger's explicit name; its rendered subtree is inert and hidden
|
|
74
|
-
from assistive technology so the trigger remains the sole action.
|
|
75
|
-
|
|
76
|
-
`size: '2xs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'small' | 'medium' | 'large' = 'm'` (reflected, new
|
|
77
|
-
in 8.0.0) is the library's shared size ladder, so a disclosure scales with the controls around it
|
|
78
|
-
instead of being the one fixed-density element in a compact panel. Both spellings of every tier are
|
|
79
|
-
accepted — `s`/`small`, `m`/`medium`, `l`/`large` — so markup migrated from either upstream needs no
|
|
80
|
-
attribute rewrite. `m` is the default and reproduces the disclosure this component had before `size`
|
|
81
|
-
existed. The tier drives two custom properties (below) rather than any `::part()` rule, so a tier
|
|
82
|
-
the ladder doesn't cover is a two-line override rather than a fork.
|
|
83
|
-
|
|
84
|
-
**Methods:**
|
|
85
|
-
|
|
86
|
-
- Accordion: `expandAll()` expands every direct enabled item only in `multiple` mode;
|
|
87
|
-
`collapseAll()` collapses every direct expanded item. Nested accordion items are never included.
|
|
88
|
-
- Accordion item: `expand(): Promise<void>`, `collapse(): Promise<void>`, and
|
|
89
|
-
`toggle(): Promise<void>` initiate the corresponding transition and settle after its rendered
|
|
90
|
-
motion. Disabled items are unchanged. `focus()` and the host's `click()` target the trigger.
|
|
91
|
-
- Details: `show(): Promise<void>` expands and `hide(): Promise<void>` collapses. Each promise
|
|
92
|
-
settles after its matching `lr-after-show` or `lr-after-hide`; a vetoed, disabled, or
|
|
93
|
-
already-satisfied request resolves without changing state. Assigning `open` runs the same
|
|
94
|
-
Details lifecycle. `show()` is a no-op while disabled; `hide()` can still close a disabled
|
|
95
|
-
Details panel.
|
|
96
|
-
|
|
97
|
-
**Events:**
|
|
98
|
-
|
|
99
|
-
- `lr-expand`, `lr-collapse`, `lr-toggle-request`, `lr-after-expand`, `lr-after-collapse` —
|
|
100
|
-
accordion group lifecycle.
|
|
101
|
-
- `lr-show`, `lr-hide`, `lr-toggle`, `lr-after-show`, `lr-after-hide` — Details lifecycle only.
|
|
102
|
-
|
|
103
|
-
On the accordion, `lr-expand` and `lr-collapse` fire before a direct item changes, are cancelable,
|
|
104
|
-
and carry `detail: { item }`. **New in 10.0.0:** a cancelable `lr-toggle-request`
|
|
105
|
-
(`detail: { collapsed, item }`) fires alongside the matching directional event for every transition,
|
|
106
|
-
including sibling auto-collapses in `single`/`single-collapsible` mode and `collapseAll()`. It carries
|
|
107
|
-
the direction in the detail rather than the event name, matching `<lr-code-block>`/`<lr-chat-message>`'s
|
|
108
|
-
`lr-toggle-request` convention, plus an `item` reference the single-panel siblings do not need (an
|
|
109
|
-
accordion's toggling entity is one of several children, so the event target alone cannot identify it).
|
|
110
|
-
`preventDefault()` on **either** event vetoes the transition — the two are a symmetric veto pair, not
|
|
111
|
-
a primary and a notification. Note `<lr-thinking-panel>`'s own `lr-toggle-request` spells its detail
|
|
112
|
-
`{ expanded }` rather than `{ collapsed }`; the two conventions are not fully unified. **Changed in 9.0.0:** `item` is now always a `LyraAccordionItem` —
|
|
113
|
-
it could previously also be a `LyraDetails`. The exported `LyraAccordionPanel` union that spelled
|
|
114
|
-
that has been removed; use `LyraAccordionItem`. An accepted transition finishes with the
|
|
115
|
-
non-cancelable
|
|
116
|
-
`lr-after-expand` or `lr-after-collapse`, carrying the same item. In `single` mode, activating the
|
|
117
|
-
already-expanded item is a no-op and emits no collapse lifecycle. Nested accordions own their own
|
|
118
|
-
triggers; an outer group does not close siblings or emit its own lifecycle for an inner item. Item
|
|
119
|
-
methods and group methods use this lifecycle too. When opening an item in a single mode, the previously expanded
|
|
120
|
-
sibling's cancelable collapse is consulted before the new panel changes state; vetoing it keeps the
|
|
121
|
-
old item open and cancels the new expansion, so the group never silently violates its one-item
|
|
122
|
-
invariant.
|
|
123
|
-
|
|
124
|
-
> **A nested `lr-accordion`'s events are not scoped to it — filter by target.** Every accordion
|
|
125
|
-
> event goes through the shared `emit()` helper with `bubbles: true, composed: true`, so an inner
|
|
126
|
-
> `<lr-accordion>` slotted inside an outer item sends its own `lr-expand`, `lr-collapse`,
|
|
127
|
-
> `lr-toggle-request`, `lr-after-expand` and `lr-after-collapse` straight through the outer group.
|
|
128
|
-
> A listener bound directly on the outer `<lr-accordion>` therefore also receives the inner
|
|
129
|
-
> group's — and their `detail.item` is an item of the inner group, so an outer handler that looks
|
|
130
|
-
> that item up among its own children finds nothing, or acts on a panel it does not own.
|
|
131
|
-
> Coordination itself is already scoped: an outer group never applies its single-panel invariant,
|
|
132
|
-
> roving keyboard model, or lifecycle to an inner group's items. It is only the listener that
|
|
133
|
-
> needs the guard, the same one `<lr-details>` and `<lr-dialog>` document for their own events:
|
|
134
|
-
>
|
|
135
|
-
> ```html
|
|
136
|
-
> <lr-accordion id="outer">
|
|
137
|
-
> <lr-accordion-item label="Outer">
|
|
138
|
-
> <lr-accordion>
|
|
139
|
-
> <lr-accordion-item label="Inner">Inner content.</lr-accordion-item>
|
|
140
|
-
> </lr-accordion>
|
|
141
|
-
> </lr-accordion-item>
|
|
142
|
-
> </lr-accordion>
|
|
143
|
-
> <script type="module">
|
|
144
|
-
> const outer = document.querySelector('#outer');
|
|
145
|
-
> outer.addEventListener('lr-expand', (event) => {
|
|
146
|
-
> if (event.target !== event.currentTarget) return; // a nested group expanded, not this one
|
|
147
|
-
> // ...
|
|
148
|
-
> });
|
|
149
|
-
> </script>
|
|
150
|
-
> ```
|
|
151
|
-
|
|
152
|
-
The Details events `lr-show` and `lr-hide` have no detail payload and are cancelable; preventing
|
|
153
|
-
either leaves the panel in its previous state. Accepted changes emit `lr-toggle` with
|
|
154
|
-
`detail: { open, source }`, then the non-cancelable `lr-after-show` or `lr-after-hide` once
|
|
155
|
-
rendering and motion settle. `source` is `user` for a summary click or keyboard activation,
|
|
156
|
-
`programmatic` for `show()`, `hide()`, or assigning `open`, and `peer` when another Details with
|
|
157
|
-
the same non-empty `name` closes this one. The full orders are `lr-show` → `lr-toggle` →
|
|
158
|
-
`lr-after-show` and `lr-hide` → `lr-toggle` → `lr-after-hide`. Initially open markup emits
|
|
159
|
-
nothing, and an interrupted transition drops its stale after-event. The `animating` CSS custom
|
|
160
|
-
state is present only between an accepted state change and that settled boundary, and is cleared
|
|
161
|
-
when the element disconnects.
|
|
162
|
-
|
|
163
|
-
> **A nested `lr-details`' events are not scoped to it — filter by target.** Every Details event
|
|
164
|
-
> goes through the shared `emit()` helper with `bubbles: true, composed: true` hardcoded, with no
|
|
165
|
-
> exception for this component. A `<lr-details>` nested inside another `<lr-details>` (as ordinary
|
|
166
|
-
> slotted content, e.g. inside `header-actions` or the default panel) has its own
|
|
167
|
-
> `lr-show`/`lr-hide`/`lr-toggle`/`lr-after-show`/`lr-after-hide` bubble straight through the outer
|
|
168
|
-
> panel, so a listener bound directly on the outer `<lr-details>` also receives the inner one's
|
|
169
|
-
> events — an inner disclosure opening or closing looks identical to the outer one doing the same,
|
|
170
|
-
> the same failure mode `lr-dialog`'s `lr-close` carries and documents in its own section. Guard on
|
|
171
|
-
> the target:
|
|
172
|
-
>
|
|
173
|
-
> ```html
|
|
174
|
-
> <lr-details id="outer" summary="Outer">
|
|
175
|
-
> Some outer content.
|
|
176
|
-
> <lr-details id="inner" summary="Inner">Inner content.</lr-details>
|
|
177
|
-
> </lr-details>
|
|
178
|
-
> <script type="module">
|
|
179
|
-
> const outer = document.querySelector('#outer');
|
|
180
|
-
> outer.addEventListener('lr-toggle', (event) => {
|
|
181
|
-
> if (event.target !== outer) return; // the inner details toggled, not this one
|
|
182
|
-
> // ...
|
|
183
|
-
> });
|
|
184
|
-
> </script>
|
|
185
|
-
> ```
|
|
186
|
-
>
|
|
187
|
-
> This is deliberate, not a bug to fix: non-bubbling Details events would be a breaking change, and
|
|
188
|
-
> `event.target`/`event.currentTarget` already give every listener exactly what it needs to tell the
|
|
189
|
-
> two apart.
|
|
190
|
-
|
|
191
|
-
**Keyboard:** each direct enabled accordion item contributes one heading button. Exactly one is in
|
|
192
|
-
the tab order; ArrowDown/ArrowUp move cyclically, horizontal arrows provide the same next/previous
|
|
193
|
-
movement and swap under RTL, and Home/End jump to the first/last enabled item. Disabled items are
|
|
194
|
-
skipped. Enter and Space use the native button activation contract. Focus and key handling stay
|
|
195
|
-
inside the nearest nested accordion.
|
|
196
|
-
|
|
197
|
-
**Slots:** accordion has a default slot for direct items. Accordion item has default panel content,
|
|
198
|
-
`label`, and `icon`; `label` slot → `label` property → localized `"Details"` is the precedence
|
|
199
|
-
order. The label slot accepts rich visible markup, but its flattened subtree is inert and hidden
|
|
200
|
-
from assistive technology: do not place independent links, buttons, inputs, form state, or focus
|
|
201
|
-
targets there. The accordion-item `icon` slot follows the same flattened-tree inert and aria-hidden
|
|
202
|
-
visual contract, while the trigger button remains the sole action. Details has `summary`,
|
|
203
|
-
`header-actions`, `expand-icon`, `collapse-icon`, plus default content. `header-actions` renders
|
|
204
|
-
extra controls (e.g. a trailing "add" button) as a sibling of the private native `<details>` in the
|
|
205
|
-
complete header row, so they stay rendered, visible, and hit-testable while the panel is collapsed
|
|
206
|
-
or disabled. Activating one never toggles the panel: a click whose
|
|
207
|
-
composed path crosses `[part~="header-actions"]` is exempted from disclosure activation. Its wrapper
|
|
208
|
-
is hidden and reclaims layout space whenever the slot is empty.
|
|
209
|
-
|
|
210
|
-
**CSS parts:** accordion exposes `base`. Accordion item exposes `base` and `accordion-item` on the
|
|
211
|
-
same outer wrapper, plus `heading`, `button`, `label`, `icon`, `panel`, and `content`. Details
|
|
212
|
-
exposes `base` and `details` on the same outer container, plus `header`, `summary`, `icon`,
|
|
213
|
-
`header-actions`, and `content`. The native `<details>` is private; `content` is inside its
|
|
214
|
-
findable `hidden="until-found"` closed-state gate.
|
|
215
|
-
The Details icon wrapper also carries Shoelace's `summary-icon` alias, so either part name styles
|
|
216
|
-
the same node. `header-actions` is the wrapper around the `header-actions` slot.
|
|
217
|
-
|
|
218
|
-
Open panel content now fills and scrolls inside a bounded host: place `<lr-details>` (or an
|
|
219
|
-
ancestor of it) in a container with a resolved block size and, once open, `[part="content"]`
|
|
220
|
-
fills the remaining space below the summary row and scrolls its own overflow internally instead
|
|
221
|
-
of the panel growing past the host. This has no effect on an ordinary unsized disclosure — the
|
|
222
|
-
chain resolves to `auto` and the panel stays exactly as content-sized as before. It has no effect
|
|
223
|
-
on the closed state either: the private closed-state findability gate (`hidden="until-found"`)
|
|
224
|
-
is untouched, and the open/close lifecycle (`show()`/`hide()`, `lr-show`/`lr-toggle`/
|
|
225
|
-
`lr-after-show`/`lr-hide`/`lr-after-hide`) is unaffected.
|
|
226
|
-
|
|
227
|
-
For rich independent actions, reserve a useful basis on `header-actions` so the complete action
|
|
228
|
-
group wraps onto another row before its checkbox label becomes too narrow. The header already
|
|
229
|
-
wraps; its summary belongs to a private native-details flex item, so setting `flex` on
|
|
230
|
-
`::part(summary)` does not control that item's allocation. This recipe uses public parts and
|
|
231
|
-
ordinary light-DOM layout:
|
|
232
|
-
|
|
233
|
-
```html
|
|
234
|
-
<style>
|
|
235
|
-
lr-details.responsive-actions::part(header-actions) {
|
|
236
|
-
flex: 1 1 12rem;
|
|
237
|
-
min-inline-size: min(100%, 12rem);
|
|
238
|
-
padding: var(--lr-space-xs);
|
|
239
|
-
box-sizing: border-box;
|
|
240
|
-
}
|
|
241
|
-
.details-action-group {
|
|
242
|
-
display: flex;
|
|
243
|
-
flex-wrap: wrap;
|
|
244
|
-
align-items: center;
|
|
245
|
-
gap: var(--lr-space-s);
|
|
246
|
-
min-inline-size: 0;
|
|
247
|
-
}
|
|
248
|
-
.details-action-group lr-checkbox { flex: 1 1 auto; min-inline-size: 0; }
|
|
249
|
-
</style>
|
|
250
|
-
<lr-details class="responsive-actions" summary="Settings">
|
|
251
|
-
<span slot="header-actions" class="details-action-group">
|
|
252
|
-
<lr-checkbox size="s">Show distribution details</lr-checkbox>
|
|
253
|
-
<lr-badge>Live</lr-badge>
|
|
254
|
-
</span>
|
|
255
|
-
Distribution settings.
|
|
256
|
-
</lr-details>
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
Import the granular details, checkbox and badge registration entries. Adjust the `12rem` basis
|
|
260
|
-
for the actual labels. Logical sizing supports RTL and narrower allocations; the checkbox remains
|
|
261
|
-
independently focusable and operable when the summary is disabled.
|
|
262
|
-
|
|
263
|
-
**Themeable custom properties:** accordion item exposes `--lr-accordion-item-spacing` (default
|
|
264
|
-
`var(--lr-form-control-padding-inline)`), `--lr-accordion-item-show-duration` and
|
|
265
|
-
`--lr-accordion-item-hide-duration` (both default `var(--lr-duration-base)`), and
|
|
266
|
-
`--lr-accordion-item-easing` (default `var(--lr-easing-standard)`). The mapped unprefixed names
|
|
267
|
-
`--spacing`, `--show-duration`, `--hide-duration`, and `--easing` remain accepted aliases and win
|
|
268
|
-
when set. Panel and icon transitions stop under `prefers-reduced-motion: reduce`. The trigger
|
|
269
|
-
button's and panel content's padding can also be tuned independently of each other and of
|
|
270
|
-
`--lr-accordion-item-spacing`: `--lr-accordion-item-summary-padding-block` and
|
|
271
|
-
`--lr-accordion-item-summary-padding-inline` control the trigger button alone, and
|
|
272
|
-
`--lr-accordion-item-content-padding-block-end` and `--lr-accordion-item-content-padding-inline`
|
|
273
|
-
control the panel content alone. All four default to the same `--lr-accordion-item-spacing`
|
|
274
|
-
resolution, mirroring `lr-details`'s equivalent four hooks below. `--spacing` aliases the item
|
|
275
|
-
rhythm and remains the highest-precedence override, ahead of these four as well.
|
|
276
|
-
|
|
277
|
-
Accordion appearance paint is independently inheritable: `--lr-accordion-outlined-bg` (default
|
|
278
|
-
`var(--lr-color-surface)`) and `--lr-accordion-outlined-border-color` (default
|
|
279
|
-
`var(--lr-color-border-subtle)`); `--lr-accordion-filled-bg` (default
|
|
280
|
-
`var(--lr-color-surface-raised)`) and `--lr-accordion-filled-border-color` (default `transparent`);
|
|
281
|
-
and `--lr-accordion-filled-outlined-bg` (default `var(--lr-color-surface-raised)`) plus
|
|
282
|
-
`--lr-accordion-filled-outlined-border-color` (default `var(--lr-color-border-subtle)`). Direct item
|
|
283
|
-
surfaces have matching `--lr-accordion-item-outlined-bg`, `--lr-accordion-item-filled-bg`, and
|
|
284
|
-
`--lr-accordion-item-filled-outlined-bg` hooks with the same surface fallbacks. Item trigger paint
|
|
285
|
-
uses `--lr-accordion-item-button-hover-bg` (default `var(--lr-color-brand-quiet)`) and
|
|
286
|
-
`--lr-accordion-item-button-active-bg` (default the existing active `color-mix(...)`). These hooks
|
|
287
|
-
are read as inline fallbacks rather than declared on the host, so an ancestor theme can set them.
|
|
288
|
-
|
|
289
|
-
Details exposes `--lr-details-font-size` (default
|
|
290
|
-
`var(--lr-form-control-font-size)`) — the text size of both the summary and the panel.
|
|
291
|
-
`--lr-details-spacing` (default `var(--lr-form-control-padding-inline)`) — the block rhythm: the
|
|
292
|
-
summary's block padding and the panel's trailing padding, kept equal so a stack of disclosures reads
|
|
293
|
-
evenly. Each `size` tier changes both private defaults from the shared ladder; a public value on an
|
|
294
|
-
ancestor or the element remains authoritative. Note that the spacing knob
|
|
295
|
-
deliberately reads the ladder's _inline_-padding value: a stacked panel wants generous block rhythm,
|
|
296
|
-
whereas the ladder's own block padding exists to fit text inside a fixed control height and would
|
|
297
|
-
collapse the summary row. The summary's and the panel content's padding can also be tuned
|
|
298
|
-
independently of each other and of `--lr-details-spacing`: `--lr-details-summary-padding-block` and
|
|
299
|
-
`--lr-details-summary-padding-inline` control the summary alone, and
|
|
300
|
-
`--lr-details-content-padding-block-end` and `--lr-details-content-padding-inline` control the
|
|
301
|
-
panel content alone. All four default to the same `--lr-details-spacing` resolution described
|
|
302
|
-
above, mirroring how `--lr-details-gap`/`--lr-details-radius` (below) are already independent of
|
|
303
|
-
the spacing knob. `--spacing` aliases the Details rhythm and remains the highest-precedence
|
|
304
|
-
override, ahead of these four as well. `--show-duration` and
|
|
305
|
-
`--hide-duration` (both default `var(--lr-duration-base)`) tune its icon transitions. Motion stops
|
|
306
|
-
under `prefers-reduced-motion`, so the `lr-after-*` events still settle promptly in that branch.
|
|
307
|
-
`--lr-details-gap` (default `var(--lr-space-s)`) independently controls the summary content/icon
|
|
308
|
-
gap, and `--lr-details-radius` (default `var(--lr-radius)`) controls the surface corners. Both use
|
|
309
|
-
inline fallbacks, inherit from ancestors, and remain independent of the `size` density ladder.
|
|
310
|
-
Details surface paint uses `--lr-details-outlined-bg` / `--lr-details-outlined-border-color`,
|
|
311
|
-
`--lr-details-filled-bg` / `--lr-details-filled-border-color`, and
|
|
312
|
-
`--lr-details-filled-outlined-bg` / `--lr-details-filled-outlined-border-color`; their defaults are
|
|
313
|
-
respectively the existing surface/border, brand-quiet/transparent, and brand-quiet/border values.
|
|
314
|
-
Summary interaction paint uses `--lr-details-summary-hover-bg` (default
|
|
315
|
-
`var(--lr-color-brand-quiet)`) and `--lr-details-summary-active-bg` (default the existing active
|
|
316
|
-
`color-mix(...)`). All eight are inheritable inline-fallback hooks, so they isolate one disclosure
|
|
317
|
-
theme without requiring shared-token changes or shadow-part selectors.
|
|
318
|
-
|
|
319
|
-
```html
|
|
320
|
-
<lr-details summary="Advanced options">Panel content</lr-details>
|
|
321
|
-
<script type="module">
|
|
322
|
-
const panel = document.querySelector("lr-details");
|
|
323
|
-
let ready = false;
|
|
324
|
-
// Cancelable: veto the open until some precondition is met.
|
|
325
|
-
panel.addEventListener("lr-show", (e) => {
|
|
326
|
-
if (!ready) e.preventDefault();
|
|
327
|
-
});
|
|
328
|
-
panel.addEventListener("lr-after-show", () =>
|
|
329
|
-
panel.querySelector("input")?.focus()
|
|
330
|
-
);
|
|
331
|
-
ready = true;
|
|
332
|
-
await panel.show();
|
|
333
|
-
</script>
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
```html
|
|
337
|
-
<lr-accordion
|
|
338
|
-
mode="single-collapsible"
|
|
339
|
-
icon-placement="start"
|
|
340
|
-
heading-level="2"
|
|
341
|
-
>
|
|
342
|
-
<lr-accordion-item label="Account" expanded
|
|
343
|
-
>Profile settings</lr-accordion-item
|
|
344
|
-
>
|
|
345
|
-
<lr-accordion-item>
|
|
346
|
-
<strong slot="label">Notifications</strong>
|
|
347
|
-
Notification settings
|
|
348
|
-
</lr-accordion-item>
|
|
349
|
-
</lr-accordion>
|
|
350
|
-
<script type="module">
|
|
351
|
-
const accordion = document.querySelector("lr-accordion");
|
|
352
|
-
accordion.addEventListener("lr-expand", (event) => {
|
|
353
|
-
if (event.detail.item.disabled) event.preventDefault();
|
|
354
|
-
});
|
|
355
|
-
</script>
|
|
356
|
-
```
|