@aceshooting/lyra-ui 24.1.0 → 24.2.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 +14 -0
- package/README.md +4 -11
- package/custom-elements.json +1 -1
- package/dist/components/data/table/table.class.d.ts +14 -3
- package/dist/components/data/table/table.class.js +8 -6
- package/dist/components/data/table/table.styles.js +1 -1
- package/dist/components/overlays/overlay/popover.class.d.ts +11 -3
- package/dist/components/overlays/overlay/popover.class.js +1 -1
- package/dist/framework-types.d.ts +1 -1
- package/dist/internal/default-strings.generated.d.ts +1 -1
- package/dist/internal/default-strings.generated.js +1 -1
- package/dist/internal/localization-types.d.ts +1 -1
- package/dist/internal/localization.js +1 -1
- package/dist/internal/package-metadata.d.ts +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/positioner.js +1 -1
- package/dist/translations/am/data.js +1 -1
- package/dist/translations/ar/data.js +1 -1
- package/dist/translations/bho/data.js +1 -1
- package/dist/translations/bn/data.js +1 -1
- package/dist/translations/cs/data.js +1 -1
- package/dist/translations/da/data.js +1 -1
- package/dist/translations/de/data.js +1 -1
- package/dist/translations/el/data.js +1 -1
- package/dist/translations/es/data.js +1 -1
- package/dist/translations/fa/data.js +1 -1
- package/dist/translations/fa-AF/data.js +1 -1
- package/dist/translations/fi/data.js +1 -1
- package/dist/translations/fr/data.js +1 -1
- package/dist/translations/gu/data.js +1 -1
- package/dist/translations/ha/data.js +1 -1
- package/dist/translations/he/data.js +1 -1
- package/dist/translations/hi/data.js +1 -1
- package/dist/translations/hr/data.js +1 -1
- package/dist/translations/hu/data.js +1 -1
- package/dist/translations/id/data.js +1 -1
- package/dist/translations/ig/data.js +1 -1
- package/dist/translations/it/data.js +1 -1
- package/dist/translations/ja/data.js +1 -1
- package/dist/translations/jv/data.js +1 -1
- package/dist/translations/kk/data.js +1 -1
- package/dist/translations/kn/data.js +1 -1
- package/dist/translations/ko/data.js +1 -1
- package/dist/translations/ln/data.js +1 -1
- package/dist/translations/ml/data.js +1 -1
- package/dist/translations/mr/data.js +1 -1
- package/dist/translations/ms/data.js +1 -1
- package/dist/translations/my/data.js +1 -1
- package/dist/translations/nb/data.js +1 -1
- package/dist/translations/ne/data.js +1 -1
- package/dist/translations/nl/data.js +1 -1
- package/dist/translations/nn/data.js +1 -1
- package/dist/translations/om/data.js +1 -1
- package/dist/translations/or/data.js +1 -1
- package/dist/translations/pa/data.js +1 -1
- package/dist/translations/pcm/data.js +1 -1
- package/dist/translations/pl/data.js +1 -1
- package/dist/translations/pnb/data.js +1 -1
- package/dist/translations/ps/data.js +1 -1
- package/dist/translations/pt-BR/data.js +1 -1
- package/dist/translations/pt-PT/data.js +1 -1
- package/dist/translations/ro/data.js +1 -1
- package/dist/translations/ru/data.js +1 -1
- package/dist/translations/sd/data.js +1 -1
- package/dist/translations/sl/data.js +1 -1
- package/dist/translations/su/data.js +1 -1
- package/dist/translations/sv/data.js +1 -1
- package/dist/translations/sw/data.js +1 -1
- package/dist/translations/ta/data.js +1 -1
- package/dist/translations/te/data.js +1 -1
- package/dist/translations/th/data.js +1 -1
- package/dist/translations/tl/data.js +1 -1
- package/dist/translations/tr/data.js +1 -1
- package/dist/translations/uk/data.js +1 -1
- package/dist/translations/ur/data.js +1 -1
- package/dist/translations/uz/data.js +1 -1
- package/dist/translations/vi/data.js +1 -1
- package/dist/translations/yo/data.js +1 -1
- package/dist/translations/zh-CN/data.js +1 -1
- package/dist/translations/zh-TW/data.js +1 -1
- package/dist/translations/zu/data.js +1 -1
- package/llms/components/lr-popover.md +15 -5
- package/llms/components/lr-table.md +14 -1
- package/llms/shared/styles-and-tokens.md +97 -0
- package/llms/shared/testing-and-utilities.md +4 -1
- package/llms/shared.md +101 -1
- package/locales.json +138 -138
- package/package.json +2 -2
- package/registrations.json +1 -1
- package/vscode-html-data.json +1 -1
- package/web-types.json +1 -1
|
@@ -73,6 +73,103 @@ See [Where an override actually reaches](#where-an-override-actually-reaches) be
|
|
|
73
73
|
inheritance rules, including the one documented exception (per-component `--lr-<component>-*`
|
|
74
74
|
hooks, layer 3, which do inherit through wrappers).
|
|
75
75
|
|
|
76
|
+
### Lyra signature starter
|
|
77
|
+
|
|
78
|
+
Use this application profile for new projects unless explicit branding or user choices override it.
|
|
79
|
+
It is a composition recommendation, not a change to Lyra's runtime defaults. Existing applications
|
|
80
|
+
adopt it only during an authorized migration or redesign; valid saved style and locale choices win.
|
|
81
|
+
|
|
82
|
+
```css
|
|
83
|
+
@import "@aceshooting/lyra-ui/theme.css";
|
|
84
|
+
@import "@aceshooting/lyra-ui/tokens-root.css";
|
|
85
|
+
@import "@aceshooting/lyra-ui/looks/shadcn.css";
|
|
86
|
+
@import "@aceshooting/lyra-ui/surfaces/glass.css";
|
|
87
|
+
@import "@aceshooting/lyra-ui/accents.css";
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The first-use choices are independent axes:
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
import { setLyraStyle } from '@aceshooting/lyra-ui/theme.js';
|
|
94
|
+
|
|
95
|
+
// Apply only when initializing the application's unsaved choices.
|
|
96
|
+
setLyraStyle({ look: 'shadcn', surface: 'glass', accent: 'emerald', mode: 'system' });
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Do not run that assignment unconditionally on every visit. Restore saved choices through the
|
|
100
|
+
published style runtime; use `parseLyraStyleRecord()` when validating a persisted record, and
|
|
101
|
+
`setLyraStyle()` to normalize browser color inputs. Preserve valid custom accents, semantic-role
|
|
102
|
+
palettes, runtime looks, overrides, and historical v1 records. Fill missing or invalid choices from
|
|
103
|
+
the application profile without overwriting independently saved axes. An application Reset action
|
|
104
|
+
restores this profile: `resetLyraStyle()` alone restores the library's defaults instead.
|
|
105
|
+
|
|
106
|
+
For first paint, run the synchronous `lyraThemeBootstrap`, then apply the application's unsaved-axis
|
|
107
|
+
fallback attributes, then load the blocking stylesheets. Use the documented CSP-safe embedding or
|
|
108
|
+
classic-script asset. With empty storage, the bootstrap writes Lyra's library defaults and would
|
|
109
|
+
overwrite earlier Shadcn/glass/Emerald attributes; it has no application-defaults option. With
|
|
110
|
+
denied storage, still apply the application fallbacks after it. Retain valid restored axes and
|
|
111
|
+
record which fallbacks were used, then apply those same choices through `setLyraStyle()` during
|
|
112
|
+
runtime initialization. A later module assignment alone cannot prevent a color flash. Test fresh,
|
|
113
|
+
malformed, partial, legacy, and storage-denied records before modules load and after hydration,
|
|
114
|
+
alongside valid saved choices. Do not copy Lyra's bootstrap, normalizer, or ownership internals.
|
|
115
|
+
|
|
116
|
+
Keep spotlights in application CSS, independent of the chosen control look. The public root-token
|
|
117
|
+
stylesheet makes this static recipe follow both light/dark mode and the current accent:
|
|
118
|
+
|
|
119
|
+
```css
|
|
120
|
+
body { isolation: isolate; min-block-size: 100svh; background: var(--lr-color-surface); }
|
|
121
|
+
body::before {
|
|
122
|
+
content: '';
|
|
123
|
+
position: fixed;
|
|
124
|
+
inset: 0;
|
|
125
|
+
z-index: -1;
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
background:
|
|
128
|
+
radial-gradient(ellipse 46rem 30rem at 8% 4%, color-mix(in srgb, var(--lr-color-brand) 16%, transparent), transparent 60%),
|
|
129
|
+
radial-gradient(ellipse 40rem 30rem at 96% 22%, color-mix(in srgb, var(--lr-color-brand) 12%, transparent), transparent 58%),
|
|
130
|
+
radial-gradient(ellipse 44rem 32rem at 78% 96%, color-mix(in srgb, var(--lr-color-brand) 9%, transparent), transparent 60%),
|
|
131
|
+
var(--lr-color-surface);
|
|
132
|
+
}
|
|
133
|
+
html[data-lr-contrast='more'] body::before { background: var(--lr-color-surface); }
|
|
134
|
+
@media (forced-colors: active) { body::before { background: Canvas; } }
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
These are decorative application backgrounds, not an `accentBackground` value: that style field
|
|
138
|
+
accepts absolute colors used as contrast reference surfaces, not gradients or image URLs. Use
|
|
139
|
+
semantic surface/text pairings for content and keep the decorative layer behind it.
|
|
140
|
+
|
|
141
|
+
Use the existing [gemstoneAccentPicker composition](../components/lr-swatch-picker.md#gemstoneaccentpicker--the-signature-accent-selector),
|
|
142
|
+
with its localized caption, nine canonical gemstones, and shared selected-glyph treatment. Keep
|
|
143
|
+
`--lr-swatch-picker-wrap: nowrap`: desktop hit size `1.75rem` and gap `.25rem`; at widths up to
|
|
144
|
+
`30rem`, hit size `1.5rem` and gap `.125rem` (28/4px and 24/2px at a 16px root). Leave its fill size
|
|
145
|
+
unset. Bound the palette to the viewport and provide horizontal overflow for unusually narrow
|
|
146
|
+
allocations or enlarged text; keyboard focus must bring every swatch into view. Do not shrink
|
|
147
|
+
below the component's 24px floor or replace its Arrow/Home/End and RTL behavior.
|
|
148
|
+
|
|
149
|
+
The four separate topbar controls—gemstone, mode, design, language—stay square `2.75rem` targets
|
|
150
|
+
(44px at a 16px root), with localized names and tooltips. Use gemstone, sun/moon and horizontal-slider
|
|
151
|
+
icons, and a country flag for language. Dense gemstone options do not reduce
|
|
152
|
+
those launcher targets. Set the locale picker's `--lr-locale-picker-trigger-height: 2.75rem` and
|
|
153
|
+
use its public flag-only trigger with readable menu entries:
|
|
154
|
+
|
|
155
|
+
```ts
|
|
156
|
+
import '@aceshooting/lyra-ui/components/lr-locale-picker.js';
|
|
157
|
+
import '@aceshooting/lyra-ui/components/media/flag/flag-peer.js';
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
```html
|
|
161
|
+
<lr-locale-picker top-layer trigger-display="flag" option-display="label"
|
|
162
|
+
aria-label="Localized language action"></lr-locale-picker>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Install the optional `@aceshooting/lyra-flags` peer; the granular resolver import loads requested
|
|
166
|
+
flags without a bulk flag import. Leave `withoutFlags` false. Assign `locales` as a property with
|
|
167
|
+
`{ tag, label, country? }` entries: provide readable localized language names and an explicit ISO
|
|
168
|
+
country for regional entries when known, such as `en-US` → `US`. Keep flags as supplementary cues,
|
|
169
|
+
never the only accessible names, and preserve a valid saved locale in the controlled `value`.
|
|
170
|
+
Use the component's flag resolver rather than emoji, invented flag SVGs, or guessed display APIs.
|
|
171
|
+
Verify 320px and desktop, light/dark, RTL, enlarged text, keyboard focus, and saved preferences.
|
|
172
|
+
|
|
76
173
|
### Reading the resolved tokens from your own components — `tokens-root.css`
|
|
77
174
|
|
|
78
175
|
The paragraph above is a real problem for any application that has custom elements of its own: they
|
|
@@ -320,7 +320,10 @@ void`, and `virtualAnchorFromRect()`** — thin wrapper over `@floating-ui/dom`'
|
|
|
320
320
|
`computePosition` + `autoUpdate`. Forces `strategy: 'fixed'` (matching the
|
|
321
321
|
popup's own `position: fixed` CSS — otherwise it lands offset by the page scroll), middleware
|
|
322
322
|
`offset(opts.offset ?? 4)`, `flip()`, `shift({ padding: 8 })`, default `placement: 'bottom-start'`.
|
|
323
|
-
Returns a cleanup function that stops
|
|
323
|
+
Returns a cleanup function that stops observation and queued updates — call it in `disconnectedCallback()`.
|
|
324
|
+
For `place()`, element-resize notifications coalesce into the next animation frame; initial
|
|
325
|
+
computation, scrolling and layout-shift updates begin immediately. Cleanup cancels a pending
|
|
326
|
+
resize frame.
|
|
324
327
|
`trackRect()` reports the target's initial viewport rect exactly once before returning, follows
|
|
325
328
|
later layout/viewport changes, and returns the same cleanup shape.
|
|
326
329
|
`virtualAnchorFromRect()` adapts a live rectangle provider to the exported `VirtualAnchor`
|
package/llms/shared.md
CHANGED
|
@@ -881,6 +881,103 @@ See [Where an override actually reaches](#where-an-override-actually-reaches) be
|
|
|
881
881
|
inheritance rules, including the one documented exception (per-component `--lr-<component>-*`
|
|
882
882
|
hooks, layer 3, which do inherit through wrappers).
|
|
883
883
|
|
|
884
|
+
### Lyra signature starter
|
|
885
|
+
|
|
886
|
+
Use this application profile for new projects unless explicit branding or user choices override it.
|
|
887
|
+
It is a composition recommendation, not a change to Lyra's runtime defaults. Existing applications
|
|
888
|
+
adopt it only during an authorized migration or redesign; valid saved style and locale choices win.
|
|
889
|
+
|
|
890
|
+
```css
|
|
891
|
+
@import "@aceshooting/lyra-ui/theme.css";
|
|
892
|
+
@import "@aceshooting/lyra-ui/tokens-root.css";
|
|
893
|
+
@import "@aceshooting/lyra-ui/looks/shadcn.css";
|
|
894
|
+
@import "@aceshooting/lyra-ui/surfaces/glass.css";
|
|
895
|
+
@import "@aceshooting/lyra-ui/accents.css";
|
|
896
|
+
```
|
|
897
|
+
|
|
898
|
+
The first-use choices are independent axes:
|
|
899
|
+
|
|
900
|
+
```ts
|
|
901
|
+
import { setLyraStyle } from '@aceshooting/lyra-ui/theme.js';
|
|
902
|
+
|
|
903
|
+
// Apply only when initializing the application's unsaved choices.
|
|
904
|
+
setLyraStyle({ look: 'shadcn', surface: 'glass', accent: 'emerald', mode: 'system' });
|
|
905
|
+
```
|
|
906
|
+
|
|
907
|
+
Do not run that assignment unconditionally on every visit. Restore saved choices through the
|
|
908
|
+
published style runtime; use `parseLyraStyleRecord()` when validating a persisted record, and
|
|
909
|
+
`setLyraStyle()` to normalize browser color inputs. Preserve valid custom accents, semantic-role
|
|
910
|
+
palettes, runtime looks, overrides, and historical v1 records. Fill missing or invalid choices from
|
|
911
|
+
the application profile without overwriting independently saved axes. An application Reset action
|
|
912
|
+
restores this profile: `resetLyraStyle()` alone restores the library's defaults instead.
|
|
913
|
+
|
|
914
|
+
For first paint, run the synchronous `lyraThemeBootstrap`, then apply the application's unsaved-axis
|
|
915
|
+
fallback attributes, then load the blocking stylesheets. Use the documented CSP-safe embedding or
|
|
916
|
+
classic-script asset. With empty storage, the bootstrap writes Lyra's library defaults and would
|
|
917
|
+
overwrite earlier Shadcn/glass/Emerald attributes; it has no application-defaults option. With
|
|
918
|
+
denied storage, still apply the application fallbacks after it. Retain valid restored axes and
|
|
919
|
+
record which fallbacks were used, then apply those same choices through `setLyraStyle()` during
|
|
920
|
+
runtime initialization. A later module assignment alone cannot prevent a color flash. Test fresh,
|
|
921
|
+
malformed, partial, legacy, and storage-denied records before modules load and after hydration,
|
|
922
|
+
alongside valid saved choices. Do not copy Lyra's bootstrap, normalizer, or ownership internals.
|
|
923
|
+
|
|
924
|
+
Keep spotlights in application CSS, independent of the chosen control look. The public root-token
|
|
925
|
+
stylesheet makes this static recipe follow both light/dark mode and the current accent:
|
|
926
|
+
|
|
927
|
+
```css
|
|
928
|
+
body { isolation: isolate; min-block-size: 100svh; background: var(--lr-color-surface); }
|
|
929
|
+
body::before {
|
|
930
|
+
content: '';
|
|
931
|
+
position: fixed;
|
|
932
|
+
inset: 0;
|
|
933
|
+
z-index: -1;
|
|
934
|
+
pointer-events: none;
|
|
935
|
+
background:
|
|
936
|
+
radial-gradient(ellipse 46rem 30rem at 8% 4%, color-mix(in srgb, var(--lr-color-brand) 16%, transparent), transparent 60%),
|
|
937
|
+
radial-gradient(ellipse 40rem 30rem at 96% 22%, color-mix(in srgb, var(--lr-color-brand) 12%, transparent), transparent 58%),
|
|
938
|
+
radial-gradient(ellipse 44rem 32rem at 78% 96%, color-mix(in srgb, var(--lr-color-brand) 9%, transparent), transparent 60%),
|
|
939
|
+
var(--lr-color-surface);
|
|
940
|
+
}
|
|
941
|
+
html[data-lr-contrast='more'] body::before { background: var(--lr-color-surface); }
|
|
942
|
+
@media (forced-colors: active) { body::before { background: Canvas; } }
|
|
943
|
+
```
|
|
944
|
+
|
|
945
|
+
These are decorative application backgrounds, not an `accentBackground` value: that style field
|
|
946
|
+
accepts absolute colors used as contrast reference surfaces, not gradients or image URLs. Use
|
|
947
|
+
semantic surface/text pairings for content and keep the decorative layer behind it.
|
|
948
|
+
|
|
949
|
+
Use the existing [gemstoneAccentPicker composition](../components/lr-swatch-picker.md#gemstoneaccentpicker--the-signature-accent-selector),
|
|
950
|
+
with its localized caption, nine canonical gemstones, and shared selected-glyph treatment. Keep
|
|
951
|
+
`--lr-swatch-picker-wrap: nowrap`: desktop hit size `1.75rem` and gap `.25rem`; at widths up to
|
|
952
|
+
`30rem`, hit size `1.5rem` and gap `.125rem` (28/4px and 24/2px at a 16px root). Leave its fill size
|
|
953
|
+
unset. Bound the palette to the viewport and provide horizontal overflow for unusually narrow
|
|
954
|
+
allocations or enlarged text; keyboard focus must bring every swatch into view. Do not shrink
|
|
955
|
+
below the component's 24px floor or replace its Arrow/Home/End and RTL behavior.
|
|
956
|
+
|
|
957
|
+
The four separate topbar controls—gemstone, mode, design, language—stay square `2.75rem` targets
|
|
958
|
+
(44px at a 16px root), with localized names and tooltips. Use gemstone, sun/moon and horizontal-slider
|
|
959
|
+
icons, and a country flag for language. Dense gemstone options do not reduce
|
|
960
|
+
those launcher targets. Set the locale picker's `--lr-locale-picker-trigger-height: 2.75rem` and
|
|
961
|
+
use its public flag-only trigger with readable menu entries:
|
|
962
|
+
|
|
963
|
+
```ts
|
|
964
|
+
import '@aceshooting/lyra-ui/components/lr-locale-picker.js';
|
|
965
|
+
import '@aceshooting/lyra-ui/components/media/flag/flag-peer.js';
|
|
966
|
+
```
|
|
967
|
+
|
|
968
|
+
```html
|
|
969
|
+
<lr-locale-picker top-layer trigger-display="flag" option-display="label"
|
|
970
|
+
aria-label="Localized language action"></lr-locale-picker>
|
|
971
|
+
```
|
|
972
|
+
|
|
973
|
+
Install the optional `@aceshooting/lyra-flags` peer; the granular resolver import loads requested
|
|
974
|
+
flags without a bulk flag import. Leave `withoutFlags` false. Assign `locales` as a property with
|
|
975
|
+
`{ tag, label, country? }` entries: provide readable localized language names and an explicit ISO
|
|
976
|
+
country for regional entries when known, such as `en-US` → `US`. Keep flags as supplementary cues,
|
|
977
|
+
never the only accessible names, and preserve a valid saved locale in the controlled `value`.
|
|
978
|
+
Use the component's flag resolver rather than emoji, invented flag SVGs, or guessed display APIs.
|
|
979
|
+
Verify 320px and desktop, light/dark, RTL, enlarged text, keyboard focus, and saved preferences.
|
|
980
|
+
|
|
884
981
|
### Reading the resolved tokens from your own components — `tokens-root.css`
|
|
885
982
|
|
|
886
983
|
The paragraph above is a real problem for any application that has custom elements of its own: they
|
|
@@ -2755,7 +2852,10 @@ void`, and `virtualAnchorFromRect()`** — thin wrapper over `@floating-ui/dom`'
|
|
|
2755
2852
|
`computePosition` + `autoUpdate`. Forces `strategy: 'fixed'` (matching the
|
|
2756
2853
|
popup's own `position: fixed` CSS — otherwise it lands offset by the page scroll), middleware
|
|
2757
2854
|
`offset(opts.offset ?? 4)`, `flip()`, `shift({ padding: 8 })`, default `placement: 'bottom-start'`.
|
|
2758
|
-
Returns a cleanup function that stops
|
|
2855
|
+
Returns a cleanup function that stops observation and queued updates — call it in `disconnectedCallback()`.
|
|
2856
|
+
For `place()`, element-resize notifications coalesce into the next animation frame; initial
|
|
2857
|
+
computation, scrolling and layout-shift updates begin immediately. Cleanup cancels a pending
|
|
2858
|
+
resize frame.
|
|
2759
2859
|
`trackRect()` reports the target's initial viewport rect exactly once before returning, follows
|
|
2760
2860
|
later layout/viewport changes, and returns the same cleanup shape.
|
|
2761
2861
|
`virtualAnchorFromRect()` adapts a live rectangle provider to the exported `VirtualAnchor`
|