@edsis/angular 22.2.10 → 22.2.12

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.
Files changed (112) hide show
  1. package/component/icon/README.md +17 -0
  2. package/fesm2022/edsis-angular-chart-area.mjs +3 -3
  3. package/fesm2022/edsis-angular-chart-bar.mjs +3 -3
  4. package/fesm2022/edsis-angular-chart-core.mjs +34 -34
  5. package/fesm2022/edsis-angular-chart-line.mjs +3 -3
  6. package/fesm2022/edsis-angular-chart-pie.mjs +3 -3
  7. package/fesm2022/edsis-angular-chart-primitives.mjs +33 -33
  8. package/fesm2022/edsis-angular-chart-radar.mjs +3 -3
  9. package/fesm2022/edsis-angular-chart-radial.mjs +3 -3
  10. package/fesm2022/edsis-angular-chart-scatter.mjs +3 -3
  11. package/fesm2022/edsis-angular-component-accordion.mjs +15 -15
  12. package/fesm2022/edsis-angular-component-alert-dialog.mjs +27 -27
  13. package/fesm2022/edsis-angular-component-alert.mjs +12 -12
  14. package/fesm2022/edsis-angular-component-aspect-ratio.mjs +3 -3
  15. package/fesm2022/edsis-angular-component-avatar.mjs +18 -18
  16. package/fesm2022/edsis-angular-component-badge.mjs +3 -3
  17. package/fesm2022/edsis-angular-component-breadcrumb.mjs +21 -21
  18. package/fesm2022/edsis-angular-component-button-group.mjs +9 -9
  19. package/fesm2022/edsis-angular-component-button.mjs +3 -3
  20. package/fesm2022/edsis-angular-component-calendar.mjs +3 -3
  21. package/fesm2022/edsis-angular-component-card.mjs +21 -21
  22. package/fesm2022/edsis-angular-component-carousel.mjs +18 -18
  23. package/fesm2022/edsis-angular-component-checkbox.mjs +3 -3
  24. package/fesm2022/edsis-angular-component-collapsible.mjs +12 -12
  25. package/fesm2022/edsis-angular-component-combobox.mjs +3 -3
  26. package/fesm2022/edsis-angular-component-command.mjs +27 -27
  27. package/fesm2022/edsis-angular-component-composer.mjs +21 -21
  28. package/fesm2022/edsis-angular-component-context-menu.mjs +3 -3
  29. package/fesm2022/edsis-angular-component-date-picker.mjs +3 -3
  30. package/fesm2022/edsis-angular-component-dialog.mjs +21 -21
  31. package/fesm2022/edsis-angular-component-dropdown-menu.mjs +39 -39
  32. package/fesm2022/edsis-angular-component-editor.mjs +18 -18
  33. package/fesm2022/edsis-angular-component-empty.mjs +18 -18
  34. package/fesm2022/edsis-angular-component-form.mjs +36 -36
  35. package/fesm2022/edsis-angular-component-hover-card.mjs +9 -9
  36. package/fesm2022/edsis-angular-component-icon.mjs +6 -6
  37. package/fesm2022/edsis-angular-component-input-group.mjs +18 -18
  38. package/fesm2022/edsis-angular-component-input-otp.mjs +15 -15
  39. package/fesm2022/edsis-angular-component-input.mjs +3 -3
  40. package/fesm2022/edsis-angular-component-item.mjs +30 -30
  41. package/fesm2022/edsis-angular-component-kanban.mjs +27 -27
  42. package/fesm2022/edsis-angular-component-kbd.mjs +6 -6
  43. package/fesm2022/edsis-angular-component-label.mjs +3 -3
  44. package/fesm2022/edsis-angular-component-menubar.mjs +12 -12
  45. package/fesm2022/edsis-angular-component-native-select.mjs +9 -9
  46. package/fesm2022/edsis-angular-component-navigation-menu.mjs +21 -21
  47. package/fesm2022/edsis-angular-component-pagination.mjs +3 -3
  48. package/fesm2022/edsis-angular-component-pillbox.mjs +15 -15
  49. package/fesm2022/edsis-angular-component-popover.mjs +6 -6
  50. package/fesm2022/edsis-angular-component-progress.mjs +3 -3
  51. package/fesm2022/edsis-angular-component-radio.mjs +6 -6
  52. package/fesm2022/edsis-angular-component-resizable.mjs +12 -12
  53. package/fesm2022/edsis-angular-component-scroll-area.mjs +3 -3
  54. package/fesm2022/edsis-angular-component-segmented-control.mjs +9 -7
  55. package/fesm2022/edsis-angular-component-select.mjs +6 -6
  56. package/fesm2022/edsis-angular-component-separator.mjs +3 -3
  57. package/fesm2022/edsis-angular-component-sheet.mjs +32 -24
  58. package/fesm2022/edsis-angular-component-skeleton.mjs +3 -3
  59. package/fesm2022/edsis-angular-component-slider.mjs +6 -6
  60. package/fesm2022/edsis-angular-component-spinner.mjs +3 -3
  61. package/fesm2022/edsis-angular-component-switch.mjs +3 -3
  62. package/fesm2022/edsis-angular-component-table.mjs +24 -24
  63. package/fesm2022/edsis-angular-component-tabs.mjs +18 -18
  64. package/fesm2022/edsis-angular-component-textarea.mjs +3 -3
  65. package/fesm2022/edsis-angular-component-timeline.mjs +18 -18
  66. package/fesm2022/edsis-angular-component-toast.mjs +3 -3
  67. package/fesm2022/edsis-angular-component-toggle-group.mjs +9 -9
  68. package/fesm2022/edsis-angular-component-toggle.mjs +3 -3
  69. package/fesm2022/edsis-angular-component-tooltip.mjs +15 -15
  70. package/fesm2022/edsis-angular-component-utils-core.mjs +420 -4
  71. package/fesm2022/edsis-angular-component-utils-scale.mjs +3 -3
  72. package/fesm2022/edsis-angular-navigation-icon.mjs +3 -3
  73. package/fesm2022/{edsis-angular-navigation-navigation-badge-count.component-D70Ju6_f.mjs → edsis-angular-navigation-navigation-badge-count.component-CLXtMyMX.mjs} +3 -3
  74. package/fesm2022/{edsis-angular-navigation-navigation-dockbar-menu.component-BaFnh48V.mjs → edsis-angular-navigation-navigation-dockbar-menu.component-CSXPm1pJ.mjs} +41 -10
  75. package/fesm2022/{edsis-angular-navigation-navigation-entry-grid.component-D39W0FQZ.mjs → edsis-angular-navigation-navigation-entry-grid.component-BJgfe_dF.mjs} +71 -24
  76. package/fesm2022/{edsis-angular-navigation-navigation-flyout-menu.component-CpmsY8hb.mjs → edsis-angular-navigation-navigation-flyout-menu.component-CacQc46w.mjs} +28 -10
  77. package/fesm2022/{edsis-angular-navigation-navigation-horizontal.component-D35IfX6r.mjs → edsis-angular-navigation-navigation-horizontal.component-B30vIs1R.mjs} +10 -8
  78. package/fesm2022/{edsis-angular-navigation-navigation-item.component-X6JFy-ya.mjs → edsis-angular-navigation-navigation-item.component-ByQVStr8.mjs} +188 -56
  79. package/fesm2022/{edsis-angular-navigation-navigation-list.component-D6Ms8H5g.mjs → edsis-angular-navigation-navigation-list.component-R-2HuZnv.mjs} +24 -4
  80. package/fesm2022/edsis-angular-navigation-service.mjs +7 -7
  81. package/fesm2022/edsis-angular-navigation.mjs +119 -71
  82. package/fesm2022/edsis-angular-theme-component-settings.mjs +329 -69
  83. package/fesm2022/edsis-angular-theme-layout-services.mjs +7 -7
  84. package/fesm2022/edsis-angular-theme-layout-wrapper.mjs +83 -35
  85. package/fesm2022/edsis-angular-theme-layout.mjs +25 -25
  86. package/fesm2022/edsis-angular-theme-on-fill.mjs +3 -3
  87. package/fesm2022/edsis-angular-theme-page-core.mjs +3 -3
  88. package/fesm2022/edsis-angular-theme-page-filter.mjs +6 -6
  89. package/fesm2022/edsis-angular-theme-page-overview.mjs +3 -3
  90. package/fesm2022/edsis-angular-theme-page-root.mjs +15 -6
  91. package/fesm2022/edsis-angular-theme-page-side.mjs +6 -6
  92. package/fesm2022/edsis-angular-theme-page-slots.mjs +12 -12
  93. package/fesm2022/edsis-angular-theme-shell-services.mjs +4 -4
  94. package/fesm2022/edsis-angular-theme-shell.mjs +21 -12
  95. package/fesm2022/edsis-angular-theme-styles.mjs +109 -178
  96. package/navigation/README.md +32 -2
  97. package/package.json +3 -2
  98. package/theme/README.md +5 -0
  99. package/theme/component/settings/README.md +15 -0
  100. package/theme/styles/README.md +71 -1
  101. package/theme/styles/css/base/components.css +29 -75
  102. package/theme/styles/css/base/theme.css +3 -3
  103. package/theme/styles/css/base/tokens.css +8 -0
  104. package/types/edsis-angular-component-card.d.ts +1 -1
  105. package/types/edsis-angular-component-command.d.ts +1 -1
  106. package/types/edsis-angular-component-segmented-control.d.ts +3 -3
  107. package/types/edsis-angular-component-utils-core.d.ts +147 -3
  108. package/types/edsis-angular-navigation-types.d.ts +2 -0
  109. package/types/edsis-angular-navigation.d.ts +8 -1
  110. package/types/edsis-angular-theme-component-settings.d.ts +11 -3
  111. package/types/edsis-angular-theme-layout-wrapper.d.ts +9 -2
  112. package/types/edsis-angular-theme-styles.d.ts +30 -26
@@ -141,12 +141,254 @@ function uniqueId(prefix) {
141
141
  counter += 1;
142
142
  return `${prefix}-${counter}`;
143
143
  }
144
+ const STORAGE_VERSION_KEY = "theme-storage-version";
145
+ const LOCK_NAME = "ui-theme-storage-reset";
146
+ const LOCK_WAIT_MS = 2e3;
147
+ function parseStorageVersion(value) {
148
+ if (value === null || !/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(value)) return null;
149
+ const parts = value.split(".").map(Number);
150
+ return parts.every(Number.isSafeInteger) ? parts : null;
151
+ }
152
+ function compareVersions(left, right) {
153
+ for (let index = 0; index < 3; index++) if (left[index] !== right[index]) return left[index] > right[index] ? 1 : -1;
154
+ return 0;
155
+ }
156
+ const roots = /* @__PURE__ */ new WeakMap();
157
+ function registerStorageRoot(documentRef, coordinator) {
158
+ const existing = roots.get(documentRef);
159
+ if (existing && (coordinator || existing.coordinator)) throw new Error("Automatic theme storage reset permits only one theme root per Document.");
160
+ const root = existing ?? {
161
+ owners: /* @__PURE__ */ new Set(),
162
+ coordinator
163
+ };
164
+ const owner = {};
165
+ root.owners.add(owner);
166
+ roots.set(documentRef, root);
167
+ coordinator?.listen();
168
+ return () => {
169
+ coordinator?.destroy();
170
+ root.owners.delete(owner);
171
+ if (roots.get(documentRef) === root && root.owners.size === 0) roots.delete(documentRef);
172
+ };
173
+ }
174
+ function storageCoordinator(documentRef) {
175
+ return documentRef ? roots.get(documentRef)?.coordinator ?? null : null;
176
+ }
177
+ var StorageCoordinator = class {
178
+ documentRef;
179
+ version;
180
+ preserveKeys;
181
+ setStatus;
182
+ state = "pending";
183
+ versionParts;
184
+ invalidations = /* @__PURE__ */ new Set();
185
+ requests = /* @__PURE__ */ new Set();
186
+ tail = Promise.resolve();
187
+ initialization;
188
+ destroyed = false;
189
+ reloadPending = false;
190
+ lastReloadTarget = null;
191
+ window;
192
+ constructor(documentRef, version, preserveKeys, setStatus) {
193
+ this.documentRef = documentRef;
194
+ this.version = version;
195
+ this.preserveKeys = preserveKeys;
196
+ this.setStatus = setStatus;
197
+ const parts = parseStorageVersion(version);
198
+ if (!parts) throw new Error("Theme package version must use stable MAJOR.MINOR.PATCH.");
199
+ this.versionParts = parts;
200
+ this.window = documentRef.defaultView;
201
+ setStatus("pending");
202
+ }
203
+ listen() {
204
+ this.window?.addEventListener("storage", this.onStorage);
205
+ this.window?.addEventListener("focus", this.onWake);
206
+ this.window?.addEventListener("pageshow", this.onWake);
207
+ }
208
+ initialize(hydrate) {
209
+ this.initialization ??= this.bootstrap(hydrate);
210
+ return this.initialization;
211
+ }
212
+ async bootstrap(hydrate) {
213
+ try {
214
+ if (!this.window) this.transition("unavailable");
215
+ else if (!this.window.navigator.locks) this.transition("unsupported");
216
+ else await this.lock(() => {
217
+ const storage = this.nativeStorage();
218
+ const previous = parseStorageVersion(storage.getItem(STORAGE_VERSION_KEY));
219
+ if (!previous) {
220
+ storage.setItem(STORAGE_VERSION_KEY, this.version);
221
+ this.transition("adopted");
222
+ } else {
223
+ const order = compareVersions(this.versionParts, previous);
224
+ if (order < 0) {
225
+ this.lastReloadTarget = previous;
226
+ this.transition("stale");
227
+ } else if (order === 0) this.transition("ready");
228
+ else {
229
+ const keys = [];
230
+ for (let index = 0; index < storage.length; index++) {
231
+ const key = storage.key(index);
232
+ if (key !== null) keys.push(key);
233
+ }
234
+ for (const key of keys) if (key !== "theme-storage-version" && !this.preserveKeys.has(key)) storage.removeItem(key);
235
+ storage.setItem(STORAGE_VERSION_KEY, this.version);
236
+ this.transition("reset");
237
+ }
238
+ }
239
+ if (this.canPersist() && this.observeMarker(storage)) hydrate();
240
+ });
241
+ } catch {
242
+ this.fail();
243
+ }
244
+ if (!this.destroyed && !this.canPersist()) hydrate();
245
+ }
246
+ nativeStorage() {
247
+ const storage = this.window?.localStorage;
248
+ if (!storage) throw new Error("Storage unavailable.");
249
+ return storage;
250
+ }
251
+ canPersist() {
252
+ return !this.destroyed && [
253
+ "ready",
254
+ "adopted",
255
+ "reset"
256
+ ].includes(this.state);
257
+ }
258
+ assertInitialized() {
259
+ if (!this.destroyed && this.state === "pending") throw new Error("Theme storage is pending. Await ThemeStorageVersionService.initialize() before reading preferences.");
260
+ }
261
+ read(key) {
262
+ this.assertInitialized();
263
+ if (!this.canPersist()) return null;
264
+ try {
265
+ return this.nativeStorage().getItem(key);
266
+ } catch {
267
+ this.fail();
268
+ return null;
269
+ }
270
+ }
271
+ write(key, value, owner) {
272
+ this.mutate((storage) => storage.setItem(key, value), owner);
273
+ }
274
+ remove(key, owner) {
275
+ this.mutate((storage) => storage.removeItem(key), owner);
276
+ }
277
+ mutate(action, owner) {
278
+ this.assertInitialized();
279
+ if (!this.canPersist()) return;
280
+ this.tail = this.tail.then(async () => {
281
+ if (!this.canPersist() || owner?.destroyed) return;
282
+ await this.lock(() => {
283
+ if (!this.canPersist() || owner?.destroyed) return;
284
+ const storage = this.nativeStorage();
285
+ if (this.observeMarker(storage)) action(storage);
286
+ });
287
+ });
288
+ }
289
+ onInvalidation(callback) {
290
+ this.invalidations.add(callback);
291
+ return () => this.invalidations.delete(callback);
292
+ }
293
+ transition(status) {
294
+ if (this.destroyed) return;
295
+ this.state = status;
296
+ this.setStatus(status);
297
+ }
298
+ fail() {
299
+ if (this.destroyed || [
300
+ "failed",
301
+ "unsupported",
302
+ "unavailable"
303
+ ].includes(this.state)) return;
304
+ this.transition("failed");
305
+ for (const request of this.requests) request.abort();
306
+ for (const callback of this.invalidations) callback();
307
+ }
308
+ observeMarker(storage) {
309
+ const marker = parseStorageVersion(storage.getItem(STORAGE_VERSION_KEY));
310
+ if (this.state === "stale" && (!marker || compareVersions(marker, this.lastReloadTarget ?? this.versionParts) <= 0)) return false;
311
+ if (!marker) {
312
+ this.fail();
313
+ return false;
314
+ }
315
+ const order = compareVersions(marker, this.versionParts);
316
+ if (order > 0) {
317
+ this.transition("stale");
318
+ if (!this.lastReloadTarget || compareVersions(marker, this.lastReloadTarget) > 0) {
319
+ this.lastReloadTarget = marker;
320
+ this.reloadPending = true;
321
+ }
322
+ return false;
323
+ }
324
+ if (order < 0) {
325
+ this.fail();
326
+ return false;
327
+ }
328
+ return true;
329
+ }
330
+ async lock(action) {
331
+ if (this.destroyed) return;
332
+ const controller = new AbortController();
333
+ this.requests.add(controller);
334
+ const timeout = setTimeout(() => controller.abort(), LOCK_WAIT_MS);
335
+ try {
336
+ const manager = this.window?.navigator.locks;
337
+ if (!manager) {
338
+ this.fail();
339
+ return;
340
+ }
341
+ await manager.request(LOCK_NAME, {
342
+ mode: "exclusive",
343
+ signal: controller.signal
344
+ }, () => {
345
+ clearTimeout(timeout);
346
+ if (!this.destroyed && !controller.signal.aborted) action();
347
+ });
348
+ } catch {
349
+ this.fail();
350
+ } finally {
351
+ clearTimeout(timeout);
352
+ this.requests.delete(controller);
353
+ }
354
+ if (this.reloadPending) {
355
+ this.reloadPending = false;
356
+ if (!this.destroyed && this.state === "stale") this.window?.location.reload();
357
+ }
358
+ }
359
+ onStorage = (event) => {
360
+ if (event.storageArea && event.storageArea !== this.window?.localStorage) return;
361
+ if (event.key === null || event.key === "theme-storage-version") this.onWake();
362
+ };
363
+ onWake = () => {
364
+ if (this.destroyed || this.state === "pending" || [
365
+ "failed",
366
+ "unsupported",
367
+ "unavailable"
368
+ ].includes(this.state)) return;
369
+ this.lock(() => {
370
+ if (!this.destroyed && ![
371
+ "failed",
372
+ "unsupported",
373
+ "unavailable"
374
+ ].includes(this.state)) this.observeMarker(this.nativeStorage());
375
+ });
376
+ };
377
+ destroy() {
378
+ this.destroyed = true;
379
+ for (const request of this.requests) request.abort();
380
+ this.invalidations.clear();
381
+ this.window?.removeEventListener("storage", this.onStorage);
382
+ this.window?.removeEventListener("focus", this.onWake);
383
+ this.window?.removeEventListener("pageshow", this.onWake);
384
+ }
385
+ };
144
386
  const UNAVAILABLE = {
145
387
  read: () => null,
146
388
  write: () => {},
147
389
  remove: () => {}
148
390
  };
149
- function documentLocalStorage(documentRef) {
391
+ function documentLocalStorage(documentRef, owner) {
150
392
  const resolve = () => {
151
393
  try {
152
394
  return documentRef?.defaultView?.localStorage ?? null;
@@ -156,6 +398,8 @@ function documentLocalStorage(documentRef) {
156
398
  };
157
399
  return {
158
400
  read: (key) => {
401
+ const coordinator = storageCoordinator(documentRef);
402
+ if (coordinator) return coordinator.read(key);
159
403
  try {
160
404
  return resolve()?.getItem(key) ?? null;
161
405
  } catch {
@@ -163,19 +407,191 @@ function documentLocalStorage(documentRef) {
163
407
  }
164
408
  },
165
409
  write: (key, value) => {
410
+ const coordinator = storageCoordinator(documentRef);
411
+ if (owner?.destroyed) return;
412
+ if (coordinator) {
413
+ coordinator.write(key, value, owner);
414
+ return;
415
+ }
166
416
  try {
167
417
  resolve()?.setItem(key, value);
168
418
  } catch {}
169
419
  },
170
420
  remove: (key) => {
421
+ const coordinator = storageCoordinator(documentRef);
422
+ if (owner?.destroyed) return;
423
+ if (coordinator) {
424
+ coordinator.remove(key, owner);
425
+ return;
426
+ }
171
427
  try {
172
428
  resolve()?.removeItem(key);
173
429
  } catch {}
174
430
  }
175
431
  };
176
432
  }
177
- function globalLocalStorage(isBrowser) {
433
+ function globalLocalStorage(isBrowser, owner) {
178
434
  if (!isBrowser) return UNAVAILABLE;
179
- return documentLocalStorage(typeof document === "undefined" ? null : document);
435
+ return documentLocalStorage(typeof document === "undefined" ? null : document, owner);
436
+ }
437
+ const TEXT_CONTRAST_MIN = 4.5;
438
+ const NON_TEXT_CONTRAST_MIN = 3;
439
+ const SOLVE_MARGIN = .02;
440
+ const NUMBER = "[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)";
441
+ const SEPARATOR = "(?:\\s*,\\s*|\\s+)";
442
+ let hslTriplet;
443
+ const hslTripletPattern = () => hslTriplet ??= new RegExp(`^\\s*(${NUMBER})(deg|grad|rad|turn)?${SEPARATOR}(${NUMBER})%${SEPARATOR}(${NUMBER})%\\s*$`, "i");
444
+ const HEX_COLOR = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
445
+ const DEGREES_PER_UNIT = {
446
+ deg: 1,
447
+ grad: .9,
448
+ rad: 57.29577951308232,
449
+ turn: 360
450
+ };
451
+ const clamp = (value, min, max) => Math.max(min, Math.min(max, value));
452
+ const normalizeHue = (hue) => (hue % 360 + 360) % 360;
453
+ function parseHslTriplet(value) {
454
+ const match = hslTripletPattern().exec(value);
455
+ if (!match) return null;
456
+ const [h, s, l] = [
457
+ Number(match[1]),
458
+ Number(match[3]),
459
+ Number(match[4])
460
+ ];
461
+ if (![
462
+ h,
463
+ s,
464
+ l
465
+ ].every(Number.isFinite)) return null;
466
+ return {
467
+ h: normalizeHue(h * DEGREES_PER_UNIT[match[2]?.toLowerCase() ?? "deg"]),
468
+ s,
469
+ l
470
+ };
471
+ }
472
+ function formatHslTriplet({ h, s, l }) {
473
+ return `${h} ${clamp(Math.round(s), 0, 100)}% ${clamp(Math.round(l), 0, 100)}%`;
474
+ }
475
+ function hexToHslTriplet(value) {
476
+ const exact = hexToHsl(value);
477
+ return exact ? formatHslTriplet({
478
+ h: Math.round(exact.h),
479
+ s: exact.s,
480
+ l: exact.l
481
+ }) : null;
482
+ }
483
+ function hexToHsl(value) {
484
+ const match = HEX_COLOR.exec(value.trim());
485
+ if (!match) return null;
486
+ const digits = match[1];
487
+ const expanded = digits.length === 3 ? digits.split("").map((digit) => digit + digit).join("") : digits;
488
+ const [red, green, blue] = [
489
+ 0,
490
+ 2,
491
+ 4
492
+ ].map((offset) => Number.parseInt(expanded.slice(offset, offset + 2), 16) / 255);
493
+ const largest = Math.max(red, green, blue);
494
+ const smallest = Math.min(red, green, blue);
495
+ const delta = largest - smallest;
496
+ const lightness = (largest + smallest) / 2;
497
+ let hue = 0;
498
+ if (delta !== 0) {
499
+ if (largest === red) hue = 60 * (((green - blue) / delta + 6) % 6);
500
+ else if (largest === green) hue = 60 * ((blue - red) / delta + 2);
501
+ else hue = 60 * ((red - green) / delta + 4);
502
+ }
503
+ const saturation = delta === 0 ? 0 : delta / (1 - Math.abs(2 * lightness - 1));
504
+ return {
505
+ h: hue,
506
+ s: saturation * 100,
507
+ l: lightness * 100
508
+ };
509
+ }
510
+ function hslToRgb({ h, s, l }) {
511
+ const saturation = clamp(s, 0, 100) / 100;
512
+ const lightness = clamp(l, 0, 100) / 100;
513
+ const k = (n) => (n + h / 30) % 12;
514
+ const a = saturation * Math.min(lightness, 1 - lightness);
515
+ const channel = (n) => lightness - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));
516
+ return [
517
+ channel(0),
518
+ channel(8),
519
+ channel(4)
520
+ ];
521
+ }
522
+ const toLinear = (channel) => channel <= .03928 ? channel / 12.92 : Math.pow((channel + .055) / 1.055, 2.4);
523
+ const toPainted = (channel) => Math.round(clamp(channel, 0, 1) * 255) / 255;
524
+ function relativeLuminance(triplet) {
525
+ const parsed = parseHslTriplet(triplet);
526
+ if (!parsed) return 0;
527
+ const [r, g, b] = hslToRgb(parsed).map(toPainted);
528
+ return .2126 * toLinear(r) + .7152 * toLinear(g) + .0722 * toLinear(b);
529
+ }
530
+ function contrastRatio(a, b) {
531
+ const ya = relativeLuminance(a);
532
+ const yb = relativeLuminance(b);
533
+ return (Math.max(ya, yb) + .05) / (Math.min(ya, yb) + .05);
534
+ }
535
+ function solveLightnessNearest(options) {
536
+ const target = options.min + (options.margin ?? .02);
537
+ const start = Math.round(clamp(options.from, 0, 100));
538
+ for (let delta = 0; delta <= 100; delta += 1) for (const candidate of delta === 0 ? [start] : [start - delta, start + delta]) {
539
+ if (candidate < 0 || candidate > 100) continue;
540
+ const triplet = formatHslTriplet({
541
+ h: options.h,
542
+ s: options.s,
543
+ l: candidate
544
+ });
545
+ if (options.against.every((background) => contrastRatio(triplet, background) >= target)) return triplet;
546
+ }
547
+ return null;
548
+ }
549
+ function fitForeground(options) {
550
+ const min = options.min ?? 4.5;
551
+ if (contrastRatio(options.foreground, options.background) >= min) return options.foreground;
552
+ const parsed = parseHslTriplet(options.foreground);
553
+ if (!parsed) return options.foreground;
554
+ return solveLightnessNearest({
555
+ h: parsed.h,
556
+ s: parsed.s,
557
+ against: [options.background],
558
+ min,
559
+ from: parsed.l
560
+ }) ?? options.foreground;
561
+ }
562
+ const ON_FILL_INK = /* @__PURE__ */ Object.freeze({
563
+ light: "0 0% 12%",
564
+ dark: "0 0% 10%"
565
+ });
566
+ const ON_FILL_WHITE = "0 0% 100%";
567
+ function pickFillForeground(fill, dark, min = TEXT_CONTRAST_MIN) {
568
+ const lightRatio = contrastRatio(ON_FILL_WHITE, fill);
569
+ const darkRatio = contrastRatio(dark, fill);
570
+ const preferred = lightRatio >= darkRatio ? ON_FILL_WHITE : dark;
571
+ if (Math.max(lightRatio, darkRatio) >= min) return preferred;
572
+ const ink = parseHslTriplet(dark);
573
+ return solveLightnessNearest({
574
+ h: ink.h,
575
+ s: ink.s,
576
+ against: [fill],
577
+ min,
578
+ from: ink.l
579
+ }) ?? formatHslTriplet({
580
+ h: ink.h,
581
+ s: ink.s,
582
+ l: 0
583
+ });
584
+ }
585
+ function toFillTriplet(fill) {
586
+ const parsed = parseHslTriplet(fill);
587
+ if (parsed) return `${parsed.h} ${parsed.s}% ${parsed.l}%`;
588
+ const hex = hexToHsl(fill);
589
+ return hex ? `${hex.h} ${hex.s}% ${hex.l}%` : null;
590
+ }
591
+ function foregroundFor(fill, mode = "light") {
592
+ if (typeof fill !== "string") return null;
593
+ const triplet = toFillTriplet(fill.trim());
594
+ if (!triplet) return null;
595
+ return pickFillForeground(triplet, ON_FILL_INK[mode === "dark" ? "dark" : "light"]);
180
596
  }
181
- export { COMPONENT_DENSITIES, COMPONENT_RADII, RovingRow, UI_ID_GENERATOR, UiIdGenerator, cn, densityBaseValue, documentLocalStorage, globalLocalStorage, injectUniqueId, radiusBaseValue, uniqueId };
597
+ export { COMPONENT_DENSITIES, COMPONENT_RADII, NON_TEXT_CONTRAST_MIN, ON_FILL_INK, RovingRow, SOLVE_MARGIN, STORAGE_VERSION_KEY, StorageCoordinator, TEXT_CONTRAST_MIN, UI_ID_GENERATOR, UiIdGenerator, cn, contrastRatio, densityBaseValue, documentLocalStorage, fitForeground, foregroundFor, formatHslTriplet, globalLocalStorage, hexToHslTriplet, injectUniqueId, parseHslTriplet, parseStorageVersion, radiusBaseValue, registerStorageRoot, relativeLuminance, solveLightnessNearest, storageCoordinator, uniqueId };
@@ -8,7 +8,7 @@ var ComponentScaleDirective = class ComponentScaleDirective {
8
8
  densityBase = computed(() => densityBaseValue(this.density()), ...ngDevMode ? [{ debugName: "densityBase" }] : /* istanbul ignore next */ []);
9
9
  static ɵfac = i0.ɵɵngDeclareFactory({
10
10
  minVersion: "12.0.0",
11
- version: "22.2.4",
11
+ version: "22.2.6",
12
12
  ngImport: i0,
13
13
  type: ComponentScaleDirective,
14
14
  deps: [],
@@ -16,7 +16,7 @@ var ComponentScaleDirective = class ComponentScaleDirective {
16
16
  });
17
17
  static ɵdir = i0.ɵɵngDeclareDirective({
18
18
  minVersion: "17.1.0",
19
- version: "22.2.4",
19
+ version: "22.2.6",
20
20
  type: ComponentScaleDirective,
21
21
  isStandalone: true,
22
22
  inputs: {
@@ -44,7 +44,7 @@ var ComponentScaleDirective = class ComponentScaleDirective {
44
44
  };
45
45
  i0.ɵɵngDeclareClassMetadata({
46
46
  minVersion: "12.0.0",
47
- version: "22.2.4",
47
+ version: "22.2.6",
48
48
  ngImport: i0,
49
49
  type: ComponentScaleDirective,
50
50
  decorators: [{
@@ -7,7 +7,7 @@ var NavigationIconDirective = class NavigationIconDirective {
7
7
  }
8
8
  static ɵfac = i0.ɵɵngDeclareFactory({
9
9
  minVersion: "12.0.0",
10
- version: "22.2.4",
10
+ version: "22.2.6",
11
11
  ngImport: i0,
12
12
  type: NavigationIconDirective,
13
13
  deps: [],
@@ -15,7 +15,7 @@ var NavigationIconDirective = class NavigationIconDirective {
15
15
  });
16
16
  static ɵdir = i0.ɵɵngDeclareDirective({
17
17
  minVersion: "14.0.0",
18
- version: "22.2.4",
18
+ version: "22.2.6",
19
19
  type: NavigationIconDirective,
20
20
  isStandalone: true,
21
21
  selector: "ng-template[NavigationIcon]",
@@ -24,7 +24,7 @@ var NavigationIconDirective = class NavigationIconDirective {
24
24
  };
25
25
  i0.ɵɵngDeclareClassMetadata({
26
26
  minVersion: "12.0.0",
27
- version: "22.2.4",
27
+ version: "22.2.6",
28
28
  ngImport: i0,
29
29
  type: NavigationIconDirective,
30
30
  decorators: [{
@@ -124,7 +124,7 @@ var NavigationBadgeCountComponent = class NavigationBadgeCountComponent {
124
124
  badgeClasses = computed(() => cn("nav-count pointer-events-none ml-auto inline-flex shrink-0 items-center justify-center self-center rounded-full bg-destructive text-destructive-foreground", this.badge()?.classes, this.class()), ...ngDevMode ? [{ debugName: "badgeClasses" }] : /* istanbul ignore next */ []);
125
125
  static ɵfac = i0.ɵɵngDeclareFactory({
126
126
  minVersion: "12.0.0",
127
- version: "22.2.4",
127
+ version: "22.2.6",
128
128
  ngImport: i0,
129
129
  type: NavigationBadgeCountComponent,
130
130
  deps: [],
@@ -132,7 +132,7 @@ var NavigationBadgeCountComponent = class NavigationBadgeCountComponent {
132
132
  });
133
133
  static ɵcmp = i0.ɵɵngDeclareComponent({
134
134
  minVersion: "17.0.0",
135
- version: "22.2.4",
135
+ version: "22.2.6",
136
136
  type: NavigationBadgeCountComponent,
137
137
  isStandalone: true,
138
138
  selector: "NavigationBadgeCount",
@@ -180,7 +180,7 @@ var NavigationBadgeCountComponent = class NavigationBadgeCountComponent {
180
180
  };
181
181
  i0.ɵɵngDeclareClassMetadata({
182
182
  minVersion: "12.0.0",
183
- version: "22.2.4",
183
+ version: "22.2.6",
184
184
  ngImport: i0,
185
185
  type: NavigationBadgeCountComponent,
186
186
  decorators: [{
@@ -1,12 +1,12 @@
1
- import { i as hasNavigationCountBadge } from "./edsis-angular-navigation-navigation-badge-count.component-D70Ju6_f.mjs";
2
- import { a as NAVIGATION_SHELL, r as NavigationItemContentComponent, t as NavigationItemComponent } from "./edsis-angular-navigation-navigation-item.component-X6JFy-ya.mjs";
3
- import { t as NavigationListComponent } from "./edsis-angular-navigation-navigation-list.component-D6Ms8H5g.mjs";
1
+ import { i as hasNavigationCountBadge } from "./edsis-angular-navigation-navigation-badge-count.component-CLXtMyMX.mjs";
2
+ import { r as NavigationItemContentComponent, s as NAVIGATION_SHELL, t as NavigationItemComponent } from "./edsis-angular-navigation-navigation-item.component-ByQVStr8.mjs";
3
+ import { t as NavigationListComponent } from "./edsis-angular-navigation-navigation-list.component-R-2HuZnv.mjs";
4
4
  import * as i0 from "@angular/core";
5
5
  import { Component, ElementRef, Injector, afterNextRender, computed, inject, input, output, signal } from "@angular/core";
6
6
  import { cn } from "@edsis/angular/component/utils/core";
7
7
  import { NAVIGATION_ADAPTER } from "@edsis/angular/navigation/core";
8
8
  import { NgTemplateOutlet } from "@angular/common";
9
- import { LucideX } from "@lucide/angular";
9
+ import { X } from "lucide";
10
10
  import { IconComponent, provideIcons } from "@edsis/angular/component/icon";
11
11
  import { TooltipDirective } from "@edsis/angular/component/tooltip";
12
12
  const EMPTY_NAVIGATION_BADGE_CONTEXT = Object.freeze({});
@@ -29,6 +29,7 @@ var NavigationDockbarMenuComponent = class NavigationDockbarMenuComponent {
29
29
  resolvedGroup = input(void 0, ...ngDevMode ? [{ debugName: "resolvedGroup" }] : /* istanbul ignore next */ []);
30
30
  iconTemplate = input(void 0, ...ngDevMode ? [{ debugName: "iconTemplate" }] : /* istanbul ignore next */ []);
31
31
  collapseTree = input("stairs", ...ngDevMode ? [{ debugName: "collapseTree" }] : /* istanbul ignore next */ []);
32
+ rail = input("default", ...ngDevMode ? [{ debugName: "rail" }] : /* istanbul ignore next */ []);
32
33
  openedIds = input([], ...ngDevMode ? [{ debugName: "openedIds" }] : /* istanbul ignore next */ []);
33
34
  asideFooterTemplate = input(null, ...ngDevMode ? [{ debugName: "asideFooterTemplate" }] : /* istanbul ignore next */ []);
34
35
  openedIdsChange = output();
@@ -110,7 +111,7 @@ var NavigationDockbarMenuComponent = class NavigationDockbarMenuComponent {
110
111
  return this.entryState().get(entry)?.triggerClasses ?? "";
111
112
  }
112
113
  computeTriggerClasses(entry, active, open) {
113
- return cn("nav-text group/nav inline-flex size-(--nav-rail-item-size) items-center justify-center rounded-md transition-colors", "relative", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", open || active ? "bg-accent text-foreground" : "text-muted-foreground hover:bg-accent/60 hover:text-foreground", entry.classes?.wrapper, this.itemClass());
114
+ return cn("nav-text group/nav inline-flex size-(--nav-rail-item-size) items-center justify-center rounded-md transition-colors", "relative", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", active ? "text-foreground" : open ? "bg-accent text-foreground" : "text-muted-foreground hover:bg-accent/60 hover:text-foreground", entry.classes?.wrapper, this.itemClass());
114
115
  }
115
116
  toggleGroup(entry) {
116
117
  const wasOpen = this.isGroupOpen(entry);
@@ -171,7 +172,7 @@ var NavigationDockbarMenuComponent = class NavigationDockbarMenuComponent {
171
172
  }
172
173
  static ɵfac = i0.ɵɵngDeclareFactory({
173
174
  minVersion: "12.0.0",
174
- version: "22.2.4",
175
+ version: "22.2.6",
175
176
  ngImport: i0,
176
177
  type: NavigationDockbarMenuComponent,
177
178
  deps: [],
@@ -179,7 +180,7 @@ var NavigationDockbarMenuComponent = class NavigationDockbarMenuComponent {
179
180
  });
180
181
  static ɵcmp = i0.ɵɵngDeclareComponent({
181
182
  minVersion: "17.0.0",
182
- version: "22.2.4",
183
+ version: "22.2.6",
183
184
  type: NavigationDockbarMenuComponent,
184
185
  isStandalone: true,
185
186
  selector: "NavigationDockbarMenu",
@@ -268,6 +269,13 @@ var NavigationDockbarMenuComponent = class NavigationDockbarMenuComponent {
268
269
  isRequired: false,
269
270
  transformFunction: null
270
271
  },
272
+ rail: {
273
+ classPropertyName: "rail",
274
+ publicName: "rail",
275
+ isSignal: true,
276
+ isRequired: false,
277
+ transformFunction: null
278
+ },
271
279
  openedIds: {
272
280
  classPropertyName: "openedIds",
273
281
  publicName: "openedIds",
@@ -298,7 +306,11 @@ var NavigationDockbarMenuComponent = class NavigationDockbarMenuComponent {
298
306
  "attr.data-position": "position()"
299
307
  }
300
308
  },
301
- providers: [provideIcons(LucideX)],
309
+ providers: [provideIcons({
310
+ name: "x",
311
+ size: 24,
312
+ node: X
313
+ })],
302
314
  ngImport: i0,
303
315
  template: `
304
316
  <ul [class]="railClasses()" role="list">
@@ -350,6 +362,7 @@ var NavigationDockbarMenuComponent = class NavigationDockbarMenuComponent {
350
362
  [iconTemplate]="iconTemplate()"
351
363
  [tooltip-position]="tooltipPosition()"
352
364
  [collapseTree]="collapseTree()"
365
+ [rail]="rail()"
353
366
  [openedIds]="openedIds()"
354
367
  (openedIdsChange)="openedIdsChange.emit($event)"
355
368
  (itemSelected)="itemSelected.emit($event)"
@@ -420,6 +433,7 @@ var NavigationDockbarMenuComponent = class NavigationDockbarMenuComponent {
420
433
  [badgeContext]="badgeContext()"
421
434
  [iconTemplate]="iconTemplate()"
422
435
  [collapseTree]="collapseTree()"
436
+ [rail]="rail()"
423
437
  [openedIds]="openedIds()"
424
438
  (openedIdsChange)="openedIdsChange.emit($event)"
425
439
  (itemSelected)="itemSelected.emit($event)"
@@ -471,6 +485,8 @@ var NavigationDockbarMenuComponent = class NavigationDockbarMenuComponent {
471
485
  "iconTemplate",
472
486
  "tooltip-position",
473
487
  "collapseTree",
488
+ "rail",
489
+ "railSegment",
474
490
  "straightRail",
475
491
  "stairsRail",
476
492
  "straightRailActive",
@@ -511,6 +527,7 @@ var NavigationDockbarMenuComponent = class NavigationDockbarMenuComponent {
511
527
  "activeUrl",
512
528
  "iconTemplate",
513
529
  "collapseTree",
530
+ "rail",
514
531
  "openedIds"
515
532
  ],
516
533
  outputs: ["openedIdsChange", "itemSelected"]
@@ -543,7 +560,7 @@ var NavigationDockbarMenuComponent = class NavigationDockbarMenuComponent {
543
560
  };
544
561
  i0.ɵɵngDeclareClassMetadata({
545
562
  minVersion: "12.0.0",
546
- version: "22.2.4",
563
+ version: "22.2.6",
547
564
  ngImport: i0,
548
565
  type: NavigationDockbarMenuComponent,
549
566
  decorators: [{
@@ -558,7 +575,11 @@ i0.ɵɵngDeclareClassMetadata({
558
575
  NgTemplateOutlet,
559
576
  TooltipDirective
560
577
  ],
561
- providers: [provideIcons(LucideX)],
578
+ providers: [provideIcons({
579
+ name: "x",
580
+ size: 24,
581
+ node: X
582
+ })],
562
583
  host: {
563
584
  "[class]": "hostClasses()",
564
585
  "[attr.data-mode]": "mode()",
@@ -616,6 +637,7 @@ i0.ɵɵngDeclareClassMetadata({
616
637
  [iconTemplate]="iconTemplate()"
617
638
  [tooltip-position]="tooltipPosition()"
618
639
  [collapseTree]="collapseTree()"
640
+ [rail]="rail()"
619
641
  [openedIds]="openedIds()"
620
642
  (openedIdsChange)="openedIdsChange.emit($event)"
621
643
  (itemSelected)="itemSelected.emit($event)"
@@ -686,6 +708,7 @@ i0.ɵɵngDeclareClassMetadata({
686
708
  [badgeContext]="badgeContext()"
687
709
  [iconTemplate]="iconTemplate()"
688
710
  [collapseTree]="collapseTree()"
711
+ [rail]="rail()"
689
712
  [openedIds]="openedIds()"
690
713
  (openedIdsChange)="openedIdsChange.emit($event)"
691
714
  (itemSelected)="itemSelected.emit($event)"
@@ -805,6 +828,14 @@ i0.ɵɵngDeclareClassMetadata({
805
828
  required: false
806
829
  }]
807
830
  }],
831
+ rail: [{
832
+ type: i0.Input,
833
+ args: [{
834
+ isSignal: true,
835
+ alias: "rail",
836
+ required: false
837
+ }]
838
+ }],
808
839
  openedIds: [{
809
840
  type: i0.Input,
810
841
  args: [{