@edsis/angular 22.2.8 → 22.2.10

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 (106) hide show
  1. package/chart/README.md +3 -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 +71 -34
  5. package/fesm2022/edsis-angular-chart-line.mjs +3 -3
  6. package/fesm2022/edsis-angular-chart-pie.mjs +14 -7
  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-drawer.mjs +1 -2
  32. package/fesm2022/edsis-angular-component-dropdown-menu.mjs +39 -39
  33. package/fesm2022/edsis-angular-component-editor.mjs +18 -18
  34. package/fesm2022/edsis-angular-component-empty.mjs +18 -18
  35. package/fesm2022/edsis-angular-component-form.mjs +36 -36
  36. package/fesm2022/edsis-angular-component-hover-card.mjs +9 -9
  37. package/fesm2022/edsis-angular-component-icon.mjs +6 -6
  38. package/fesm2022/edsis-angular-component-input-group.mjs +18 -18
  39. package/fesm2022/edsis-angular-component-input-otp.mjs +15 -15
  40. package/fesm2022/edsis-angular-component-input.mjs +3 -3
  41. package/fesm2022/edsis-angular-component-item.mjs +30 -30
  42. package/fesm2022/edsis-angular-component-kanban.mjs +27 -27
  43. package/fesm2022/edsis-angular-component-kbd.mjs +6 -6
  44. package/fesm2022/edsis-angular-component-label.mjs +3 -3
  45. package/fesm2022/edsis-angular-component-menubar.mjs +12 -12
  46. package/fesm2022/edsis-angular-component-native-select.mjs +9 -9
  47. package/fesm2022/edsis-angular-component-navigation-menu.mjs +21 -21
  48. package/fesm2022/edsis-angular-component-pagination.mjs +3 -3
  49. package/fesm2022/edsis-angular-component-pillbox.mjs +15 -15
  50. package/fesm2022/edsis-angular-component-popover.mjs +6 -6
  51. package/fesm2022/edsis-angular-component-progress.mjs +3 -3
  52. package/fesm2022/edsis-angular-component-radio.mjs +6 -6
  53. package/fesm2022/edsis-angular-component-resizable.mjs +12 -12
  54. package/fesm2022/edsis-angular-component-scroll-area.mjs +3 -3
  55. package/fesm2022/edsis-angular-component-segmented-control.mjs +3 -3
  56. package/fesm2022/edsis-angular-component-select.mjs +6 -6
  57. package/fesm2022/edsis-angular-component-separator.mjs +3 -3
  58. package/fesm2022/edsis-angular-component-sheet.mjs +21 -21
  59. package/fesm2022/edsis-angular-component-skeleton.mjs +3 -3
  60. package/fesm2022/edsis-angular-component-slider.mjs +6 -6
  61. package/fesm2022/edsis-angular-component-spinner.mjs +3 -3
  62. package/fesm2022/edsis-angular-component-switch.mjs +3 -3
  63. package/fesm2022/edsis-angular-component-table.mjs +24 -24
  64. package/fesm2022/edsis-angular-component-tabs.mjs +18 -18
  65. package/fesm2022/edsis-angular-component-textarea.mjs +3 -3
  66. package/fesm2022/edsis-angular-component-timeline.mjs +18 -18
  67. package/fesm2022/edsis-angular-component-toast.mjs +3 -3
  68. package/fesm2022/edsis-angular-component-toggle-group.mjs +9 -9
  69. package/fesm2022/edsis-angular-component-toggle.mjs +3 -3
  70. package/fesm2022/edsis-angular-component-tooltip.mjs +15 -15
  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-BWWWaUgy.mjs → edsis-angular-navigation-navigation-badge-count.component-D70Ju6_f.mjs} +3 -3
  74. package/fesm2022/{edsis-angular-navigation-navigation-dockbar-menu.component-Bx2bxTID.mjs → edsis-angular-navigation-navigation-dockbar-menu.component-BaFnh48V.mjs} +6 -6
  75. package/fesm2022/{edsis-angular-navigation-navigation-entry-grid.component-Duzt1ffz.mjs → edsis-angular-navigation-navigation-entry-grid.component-D39W0FQZ.mjs} +4 -4
  76. package/fesm2022/{edsis-angular-navigation-navigation-flyout-menu.component-cJ8Q1vM6.mjs → edsis-angular-navigation-navigation-flyout-menu.component-CpmsY8hb.mjs} +5 -5
  77. package/fesm2022/{edsis-angular-navigation-navigation-horizontal.component-CDQ1wt2_.mjs → edsis-angular-navigation-navigation-horizontal.component-D35IfX6r.mjs} +6 -6
  78. package/fesm2022/{edsis-angular-navigation-navigation-item.component-C1VzerJp.mjs → edsis-angular-navigation-navigation-item.component-X6JFy-ya.mjs} +10 -10
  79. package/fesm2022/{edsis-angular-navigation-navigation-list.component-BPYLfrID.mjs → edsis-angular-navigation-navigation-list.component-D6Ms8H5g.mjs} +4 -4
  80. package/fesm2022/edsis-angular-navigation-service.mjs +3 -3
  81. package/fesm2022/edsis-angular-navigation.mjs +62 -62
  82. package/fesm2022/edsis-angular-theme-component-settings.mjs +19 -33
  83. package/fesm2022/edsis-angular-theme-layout-services.mjs +6 -6
  84. package/fesm2022/edsis-angular-theme-layout-wrapper.mjs +30 -30
  85. package/fesm2022/edsis-angular-theme-layout.mjs +24 -24
  86. package/fesm2022/edsis-angular-theme-on-fill.mjs +89 -0
  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 +3 -3
  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 +3 -3
  94. package/fesm2022/edsis-angular-theme-shell.mjs +9 -9
  95. package/fesm2022/edsis-angular-theme-styles.mjs +77 -44
  96. package/package.json +6 -2
  97. package/theme/styles/README.md +52 -3
  98. package/theme/styles/css/base/on-fill.css +153 -0
  99. package/theme/styles/css/base/package.css +1 -0
  100. package/theme/styles/css/base/prefers-dark.css +0 -5
  101. package/theme/styles/css/base/theme.css +4 -51
  102. package/theme/styles/css/color/emerald.css +1 -1
  103. package/types/edsis-angular-chart-core.d.ts +3 -1
  104. package/types/edsis-angular-chart-pie.d.ts +5 -0
  105. package/types/edsis-angular-theme-on-fill.d.ts +45 -0
  106. package/types/edsis-angular-theme-styles.d.ts +37 -4
@@ -26,7 +26,7 @@ var ShellNavigationFlyoutComponent = class ShellNavigationFlyoutComponent {
26
26
  user = computed(() => this.identity?.user() ?? null, ...ngDevMode ? [{ debugName: "user" }] : /* istanbul ignore next */ []);
27
27
  static ɵfac = i0.ɵɵngDeclareFactory({
28
28
  minVersion: "12.0.0",
29
- version: "22.2.3",
29
+ version: "22.2.4",
30
30
  ngImport: i0,
31
31
  type: ShellNavigationFlyoutComponent,
32
32
  deps: [],
@@ -34,7 +34,7 @@ var ShellNavigationFlyoutComponent = class ShellNavigationFlyoutComponent {
34
34
  });
35
35
  static ɵcmp = i0.ɵɵngDeclareComponent({
36
36
  minVersion: "17.0.0",
37
- version: "22.2.3",
37
+ version: "22.2.4",
38
38
  type: ShellNavigationFlyoutComponent,
39
39
  isStandalone: true,
40
40
  selector: "ShellNavigationFlyout",
@@ -181,7 +181,7 @@ var ShellNavigationFlyoutComponent = class ShellNavigationFlyoutComponent {
181
181
  };
182
182
  i0.ɵɵngDeclareClassMetadata({
183
183
  minVersion: "12.0.0",
184
- version: "22.2.3",
184
+ version: "22.2.4",
185
185
  ngImport: i0,
186
186
  type: ShellNavigationFlyoutComponent,
187
187
  decorators: [{
@@ -318,7 +318,7 @@ var ShellBarComponent = class ShellBarComponent {
318
318
  }
319
319
  static ɵfac = i0.ɵɵngDeclareFactory({
320
320
  minVersion: "12.0.0",
321
- version: "22.2.3",
321
+ version: "22.2.4",
322
322
  ngImport: i0,
323
323
  type: ShellBarComponent,
324
324
  deps: [],
@@ -326,7 +326,7 @@ var ShellBarComponent = class ShellBarComponent {
326
326
  });
327
327
  static ɵcmp = i0.ɵɵngDeclareComponent({
328
328
  minVersion: "17.0.0",
329
- version: "22.2.3",
329
+ version: "22.2.4",
330
330
  type: ShellBarComponent,
331
331
  isStandalone: true,
332
332
  selector: "ShellBar",
@@ -623,7 +623,7 @@ var ShellBarComponent = class ShellBarComponent {
623
623
  };
624
624
  i0.ɵɵngDeclareClassMetadata({
625
625
  minVersion: "12.0.0",
626
- version: "22.2.3",
626
+ version: "22.2.4",
627
627
  ngImport: i0,
628
628
  type: ShellBarComponent,
629
629
  decorators: [{
@@ -962,7 +962,7 @@ var ShellComponent = class ShellComponent {
962
962
  hostClasses = computed(() => cn("relative isolate flex h-dvh w-full min-w-0 flex-col overflow-hidden text-foreground", this.showsBar() && this.drag() && "shell-drag-region", this.resolvedColor() === "sync" || this.resolvedFrame() === "modern" ? "bg-[hsl(var(--shell-bar-background))]" : "bg-layout-canvas", this.class()), ...ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []);
963
963
  static ɵfac = i0.ɵɵngDeclareFactory({
964
964
  minVersion: "12.0.0",
965
- version: "22.2.3",
965
+ version: "22.2.4",
966
966
  ngImport: i0,
967
967
  type: ShellComponent,
968
968
  deps: [],
@@ -970,7 +970,7 @@ var ShellComponent = class ShellComponent {
970
970
  });
971
971
  static ɵcmp = i0.ɵɵngDeclareComponent({
972
972
  minVersion: "17.0.0",
973
- version: "22.2.3",
973
+ version: "22.2.4",
974
974
  type: ShellComponent,
975
975
  isStandalone: true,
976
976
  selector: "Shell",
@@ -1163,7 +1163,7 @@ var ShellComponent = class ShellComponent {
1163
1163
  };
1164
1164
  i0.ɵɵngDeclareClassMetadata({
1165
1165
  minVersion: "12.0.0",
1166
- version: "22.2.3",
1166
+ version: "22.2.4",
1167
1167
  ngImport: i0,
1168
1168
  type: ShellComponent,
1169
1169
  decorators: [{
@@ -104,6 +104,14 @@ function formatHslTriplet({ h, s, l }) {
104
104
  return `${h} ${clamp(Math.round(s), 0, 100)}% ${clamp(Math.round(l), 0, 100)}%`;
105
105
  }
106
106
  function hexToHslTriplet(value) {
107
+ const exact = hexToHsl(value);
108
+ return exact ? formatHslTriplet({
109
+ h: Math.round(exact.h),
110
+ s: exact.s,
111
+ l: exact.l
112
+ }) : null;
113
+ }
114
+ function hexToHsl(value) {
107
115
  const match = HEX_COLOR.exec(value.trim());
108
116
  if (!match) return null;
109
117
  const digits = match[1];
@@ -124,11 +132,11 @@ function hexToHslTriplet(value) {
124
132
  else hue = 60 * ((red - green) / delta + 4);
125
133
  }
126
134
  const saturation = delta === 0 ? 0 : delta / (1 - Math.abs(2 * lightness - 1));
127
- return formatHslTriplet({
128
- h: Math.round(hue),
135
+ return {
136
+ h: hue,
129
137
  s: saturation * 100,
130
138
  l: lightness * 100
131
- });
139
+ };
132
140
  }
133
141
  function hslToRgb({ h, s, l }) {
134
142
  const saturation = clamp(s, 0, 100) / 100;
@@ -143,10 +151,11 @@ function hslToRgb({ h, s, l }) {
143
151
  ];
144
152
  }
145
153
  const toLinear = (channel) => channel <= .03928 ? channel / 12.92 : Math.pow((channel + .055) / 1.055, 2.4);
154
+ const toPainted = (channel) => Math.round(clamp(channel, 0, 1) * 255) / 255;
146
155
  function relativeLuminance(triplet) {
147
156
  const parsed = parseHslTriplet(triplet);
148
157
  if (!parsed) return 0;
149
- const [r, g, b] = hslToRgb(parsed);
158
+ const [r, g, b] = hslToRgb(parsed).map(toPainted);
150
159
  return .2126 * toLinear(r) + .7152 * toLinear(g) + .0722 * toLinear(b);
151
160
  }
152
161
  function contrastRatio(a, b) {
@@ -168,18 +177,40 @@ function solveLightnessNearest(options) {
168
177
  }
169
178
  return null;
170
179
  }
171
- function fitForeground(options) {
172
- const min = options.min ?? 4.5;
173
- if (contrastRatio(options.foreground, options.background) >= min) return options.foreground;
174
- const parsed = parseHslTriplet(options.foreground);
175
- if (!parsed) return options.foreground;
180
+ const ON_FILL_INK = Object.freeze({
181
+ light: "0 0% 12%",
182
+ dark: "0 0% 10%"
183
+ });
184
+ const ON_FILL_WHITE = "0 0% 100%";
185
+ function pickFillForeground(fill, dark, min = TEXT_CONTRAST_MIN) {
186
+ const lightRatio = contrastRatio(ON_FILL_WHITE, fill);
187
+ const darkRatio = contrastRatio(dark, fill);
188
+ const preferred = lightRatio >= darkRatio ? ON_FILL_WHITE : dark;
189
+ if (Math.max(lightRatio, darkRatio) >= min) return preferred;
190
+ const ink = parseHslTriplet(dark);
176
191
  return solveLightnessNearest({
177
- h: parsed.h,
178
- s: parsed.s,
179
- against: [options.background],
192
+ h: ink.h,
193
+ s: ink.s,
194
+ against: [fill],
180
195
  min,
181
- from: parsed.l
182
- }) ?? options.foreground;
196
+ from: ink.l
197
+ }) ?? formatHslTriplet({
198
+ h: ink.h,
199
+ s: ink.s,
200
+ l: 0
201
+ });
202
+ }
203
+ function toFillTriplet(fill) {
204
+ const parsed = parseHslTriplet(fill);
205
+ if (parsed) return `${parsed.h} ${parsed.s}% ${parsed.l}%`;
206
+ const hex = hexToHsl(fill);
207
+ return hex ? `${hex.h} ${hex.s}% ${hex.l}%` : null;
208
+ }
209
+ function foregroundFor(fill, mode = "light") {
210
+ if (typeof fill !== "string") return null;
211
+ const triplet = toFillTriplet(fill.trim());
212
+ if (!triplet) return null;
213
+ return pickFillForeground(triplet, ON_FILL_INK[mode === "dark" ? "dark" : "light"]);
183
214
  }
184
215
  const THEME_OPTIONS = new InjectionToken("THEME_OPTIONS");
185
216
  const THEME_MODES = [
@@ -274,7 +305,7 @@ function normalizeThemeRadius(value) {
274
305
  function normalizeThemeSpace(value) {
275
306
  return isThemeSpace(value) ? value : DEFAULT_THEME_SPACE;
276
307
  }
277
- const DEFAULT_BRAND_FOREGROUND = "0 0% 100%";
308
+ const UNMEASURABLE_BRAND_FOREGROUND = "0 0% 100%";
278
309
  const RING_BACKGROUNDS = {
279
310
  light: "0 0% 100%",
280
311
  dark: "0 0% 5%"
@@ -286,14 +317,19 @@ function toBrandTriplet(color) {
286
317
  }
287
318
  function hardenBrand(brand) {
288
319
  const color = toBrandTriplet(brand.color);
289
- if (!color) return brand;
320
+ if (!color) return {
321
+ color: brand.color,
322
+ foreground: brand.foreground ?? UNMEASURABLE_BRAND_FOREGROUND
323
+ };
324
+ const chosen = foregroundFor(color, "light");
325
+ const explicit = brand.foreground;
326
+ if (explicit !== void 0 && parseHslTriplet(explicit) && contrastRatio(explicit, color) >= 4.5) return {
327
+ color,
328
+ foreground: explicit
329
+ };
290
330
  return {
291
331
  color,
292
- foreground: fitForeground({
293
- foreground: brand.foreground,
294
- background: color,
295
- min: TEXT_CONTRAST_MIN
296
- })
332
+ foreground: chosen
297
333
  };
298
334
  }
299
335
  function brandRing(color, background) {
@@ -323,7 +359,7 @@ var ThemeBrandService = class ThemeBrandService {
323
359
  constructor() {
324
360
  htmlStylePropertyEffect({ source: () => this.brandProperties(this.brandState()) });
325
361
  }
326
- setBrand(color, foreground = DEFAULT_BRAND_FOREGROUND) {
362
+ setBrand(color, foreground) {
327
363
  this.brandState.set(hardenBrand({
328
364
  color,
329
365
  foreground
@@ -334,13 +370,10 @@ var ThemeBrandService = class ThemeBrandService {
334
370
  }
335
371
  normalizeOption(brand) {
336
372
  if (!brand) return null;
337
- if (typeof brand === "string") return hardenBrand({
338
- color: brand,
339
- foreground: DEFAULT_BRAND_FOREGROUND
340
- });
373
+ if (typeof brand === "string") return hardenBrand({ color: brand });
341
374
  return hardenBrand({
342
375
  color: brand.color,
343
- foreground: brand.foreground ?? DEFAULT_BRAND_FOREGROUND
376
+ foreground: brand.foreground
344
377
  });
345
378
  }
346
379
  brandProperties(brand) {
@@ -366,7 +399,7 @@ var ThemeBrandService = class ThemeBrandService {
366
399
  if (typeof parsed?.color !== "string") return null;
367
400
  return hardenBrand({
368
401
  color: parsed.color,
369
- foreground: typeof parsed.foreground === "string" ? parsed.foreground : DEFAULT_BRAND_FOREGROUND
402
+ foreground: typeof parsed.foreground === "string" ? parsed.foreground : void 0
370
403
  });
371
404
  } catch {
372
405
  return null;
@@ -374,7 +407,7 @@ var ThemeBrandService = class ThemeBrandService {
374
407
  }
375
408
  static ɵfac = i0.ɵɵngDeclareFactory({
376
409
  minVersion: "12.0.0",
377
- version: "22.2.3",
410
+ version: "22.2.4",
378
411
  ngImport: i0,
379
412
  type: ThemeBrandService,
380
413
  deps: [],
@@ -382,14 +415,14 @@ var ThemeBrandService = class ThemeBrandService {
382
415
  });
383
416
  static ɵprov = i0.ɵɵngDeclareService({
384
417
  minVersion: "22.0.0",
385
- version: "22.2.3",
418
+ version: "22.2.4",
386
419
  ngImport: i0,
387
420
  type: ThemeBrandService
388
421
  });
389
422
  };
390
423
  i0.ɵɵngDeclareClassMetadata({
391
424
  minVersion: "12.0.0",
392
- version: "22.2.3",
425
+ version: "22.2.4",
393
426
  ngImport: i0,
394
427
  type: ThemeBrandService,
395
428
  decorators: [{ type: Service }],
@@ -419,7 +452,7 @@ var ThemeColorService = class ThemeColorService {
419
452
  }
420
453
  static ɵfac = i0.ɵɵngDeclareFactory({
421
454
  minVersion: "12.0.0",
422
- version: "22.2.3",
455
+ version: "22.2.4",
423
456
  ngImport: i0,
424
457
  type: ThemeColorService,
425
458
  deps: [],
@@ -427,14 +460,14 @@ var ThemeColorService = class ThemeColorService {
427
460
  });
428
461
  static ɵprov = i0.ɵɵngDeclareService({
429
462
  minVersion: "22.0.0",
430
- version: "22.2.3",
463
+ version: "22.2.4",
431
464
  ngImport: i0,
432
465
  type: ThemeColorService
433
466
  });
434
467
  };
435
468
  i0.ɵɵngDeclareClassMetadata({
436
469
  minVersion: "12.0.0",
437
- version: "22.2.3",
470
+ version: "22.2.4",
438
471
  ngImport: i0,
439
472
  type: ThemeColorService,
440
473
  decorators: [{ type: Service }]
@@ -460,7 +493,7 @@ var ThemeModeService = class ThemeModeService {
460
493
  }
461
494
  static ɵfac = i0.ɵɵngDeclareFactory({
462
495
  minVersion: "12.0.0",
463
- version: "22.2.3",
496
+ version: "22.2.4",
464
497
  ngImport: i0,
465
498
  type: ThemeModeService,
466
499
  deps: [],
@@ -468,14 +501,14 @@ var ThemeModeService = class ThemeModeService {
468
501
  });
469
502
  static ɵprov = i0.ɵɵngDeclareService({
470
503
  minVersion: "22.0.0",
471
- version: "22.2.3",
504
+ version: "22.2.4",
472
505
  ngImport: i0,
473
506
  type: ThemeModeService
474
507
  });
475
508
  };
476
509
  i0.ɵɵngDeclareClassMetadata({
477
510
  minVersion: "12.0.0",
478
- version: "22.2.3",
511
+ version: "22.2.4",
479
512
  ngImport: i0,
480
513
  type: ThemeModeService,
481
514
  decorators: [{ type: Service }]
@@ -503,7 +536,7 @@ var ThemeRadiusService = class ThemeRadiusService {
503
536
  }
504
537
  static ɵfac = i0.ɵɵngDeclareFactory({
505
538
  minVersion: "12.0.0",
506
- version: "22.2.3",
539
+ version: "22.2.4",
507
540
  ngImport: i0,
508
541
  type: ThemeRadiusService,
509
542
  deps: [],
@@ -511,14 +544,14 @@ var ThemeRadiusService = class ThemeRadiusService {
511
544
  });
512
545
  static ɵprov = i0.ɵɵngDeclareService({
513
546
  minVersion: "22.0.0",
514
- version: "22.2.3",
547
+ version: "22.2.4",
515
548
  ngImport: i0,
516
549
  type: ThemeRadiusService
517
550
  });
518
551
  };
519
552
  i0.ɵɵngDeclareClassMetadata({
520
553
  minVersion: "12.0.0",
521
- version: "22.2.3",
554
+ version: "22.2.4",
522
555
  ngImport: i0,
523
556
  type: ThemeRadiusService,
524
557
  decorators: [{ type: Service }]
@@ -537,7 +570,7 @@ var ThemeSpaceService = class ThemeSpaceService {
537
570
  }
538
571
  static ɵfac = i0.ɵɵngDeclareFactory({
539
572
  minVersion: "12.0.0",
540
- version: "22.2.3",
573
+ version: "22.2.4",
541
574
  ngImport: i0,
542
575
  type: ThemeSpaceService,
543
576
  deps: [],
@@ -545,14 +578,14 @@ var ThemeSpaceService = class ThemeSpaceService {
545
578
  });
546
579
  static ɵprov = i0.ɵɵngDeclareService({
547
580
  minVersion: "22.0.0",
548
- version: "22.2.3",
581
+ version: "22.2.4",
549
582
  ngImport: i0,
550
583
  type: ThemeSpaceService
551
584
  });
552
585
  };
553
586
  i0.ɵɵngDeclareClassMetadata({
554
587
  minVersion: "12.0.0",
555
- version: "22.2.3",
588
+ version: "22.2.4",
556
589
  ngImport: i0,
557
590
  type: ThemeSpaceService,
558
591
  decorators: [{ type: Service }]
@@ -569,4 +602,4 @@ function provideUiTheme(options = {}) {
569
602
  inject(ThemeSpaceService);
570
603
  })]);
571
604
  }
572
- export { DEFAULT_THEME_COLOR, DEFAULT_THEME_MODE, DEFAULT_THEME_NEUTRAL, DEFAULT_THEME_RADIUS, DEFAULT_THEME_SPACE, RESOLVED_THEME_MODES, THEME_BRAND_STORAGE_KEY, THEME_COLORS, THEME_COLOR_STORAGE_KEY, THEME_MODES, THEME_MODE_STORAGE_KEY, THEME_NEUTRALS, THEME_NEUTRAL_STORAGE_KEY, THEME_OPTIONS, THEME_RADII, THEME_RADIUS_STORAGE_KEY, THEME_SPACES, THEME_SPACE_STORAGE_KEY, ThemeBrandService, ThemeColorService, ThemeModeService, ThemeRadiusService, ThemeSpaceService, htmlAttributeEffect, htmlStylePropertyEffect, isResolvedThemeMode, isThemeColor, isThemeMode, isThemeNeutral, isThemeRadius, isThemeSpace, normalizeThemeColor, normalizeThemeMode, normalizeThemeNeutral, normalizeThemeRadius, normalizeThemeSpace, persistedHtmlAttributeSignal, persistedSignal, prefersDarkSignal, provideUiTheme };
605
+ export { DEFAULT_THEME_COLOR, DEFAULT_THEME_MODE, DEFAULT_THEME_NEUTRAL, DEFAULT_THEME_RADIUS, DEFAULT_THEME_SPACE, ON_FILL_INK, RESOLVED_THEME_MODES, THEME_BRAND_STORAGE_KEY, THEME_COLORS, THEME_COLOR_STORAGE_KEY, THEME_MODES, THEME_MODE_STORAGE_KEY, THEME_NEUTRALS, THEME_NEUTRAL_STORAGE_KEY, THEME_OPTIONS, THEME_RADII, THEME_RADIUS_STORAGE_KEY, THEME_SPACES, THEME_SPACE_STORAGE_KEY, ThemeBrandService, ThemeColorService, ThemeModeService, ThemeRadiusService, ThemeSpaceService, foregroundFor, htmlAttributeEffect, htmlStylePropertyEffect, isResolvedThemeMode, isThemeColor, isThemeMode, isThemeNeutral, isThemeRadius, isThemeSpace, normalizeThemeColor, normalizeThemeMode, normalizeThemeNeutral, normalizeThemeRadius, normalizeThemeSpace, persistedHtmlAttributeSignal, persistedSignal, prefersDarkSignal, provideUiTheme };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edsis/angular",
3
- "version": "22.2.8",
3
+ "version": "22.2.10",
4
4
  "description": "Accessible, tree-shakable Angular 22 design system from Edsis: UI components, charts, navigation shells, theme tokens, and an OpenAPI SDK generator.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -444,6 +444,10 @@
444
444
  "types": "./types/edsis-angular-theme-layout-wrapper.d.ts",
445
445
  "default": "./fesm2022/edsis-angular-theme-layout-wrapper.mjs"
446
446
  },
447
+ "./theme/on-fill": {
448
+ "types": "./types/edsis-angular-theme-on-fill.d.ts",
449
+ "default": "./fesm2022/edsis-angular-theme-on-fill.mjs"
450
+ },
447
451
  "./theme/page": {
448
452
  "types": "./types/edsis-angular-theme-page.d.ts",
449
453
  "default": "./fesm2022/edsis-angular-theme-page.mjs"
@@ -503,5 +507,5 @@
503
507
  "module": "fesm2022/edsis-angular.mjs",
504
508
  "typings": "types/edsis-angular.d.ts",
505
509
  "type": "module",
506
- "gitHead": "7170ac230e2674644df5a7538feda1ae6df9503e"
510
+ "gitHead": "d3aaf1554eb4753e224deca4a507cc76ac16d74a"
507
511
  }
@@ -106,7 +106,11 @@ same way. `ThemeBrandService.setBrand()` measures it with the same WCAG formula
106
106
  - `--brand` itself is never moved. Like a generated `--primary`, the fill keeps
107
107
  the lightness it was chosen with, so `theme-color='brand'` ships the colour the
108
108
  consumer asked for;
109
- - `--brand-foreground` is moved until text on the brand clears 4.5 to 1;
109
+ - `--brand-foreground` follows the foreground-on-fill contract below: without a
110
+ `foreground`, or with one that is not a triplet, it is `foregroundFor(color,
111
+ 'light')`; an explicit triplet that clears 4.5 to 1 is kept as given, and one
112
+ that fails is replaced by `foregroundFor(color, 'light')`, never nudged to an
113
+ arbitrary grey;
110
114
  - the focus ring is solved separately, once per mode, into `--brand-ring-light`
111
115
  and `--brand-ring-dark`. `css/color/brand.css` maps `--ring` to
112
116
  `var(--brand-ring, var(--brand))` and picks the right one per `data-mode`, so
@@ -117,8 +121,53 @@ Every HSL form CSS accepts is normalised first — space or comma separated, a h
117
121
  written with `deg`/`grad`/`rad`/`turn`, a hue outside 0..360 — so none of them can
118
122
  paint while skipping the measurement. Hex is accepted and converted too, since
119
123
  that is what a native colour picker returns. A value with nothing to measure in
120
- it (`var(--consumer-brand)`, say) is passed through as given, and forfeits the
121
- guarantee.
124
+ it (`var(--consumer-brand)`, say) is passed through as given with the given
125
+ foreground (white by default), and forfeits the guarantee.
126
+
127
+ ## Kontrak Foreground di Atas Fill
128
+
129
+ Setiap warna latar solid di library mendapat warna teks dari satu aturan
130
+ ([spec 0011](../../../../docs/specs/0011-kontrak-foreground-fill/index.md)): putih atau
131
+ tinta tema (`0 0% 12%` di light, `0 0% 10%` di dark), mana yang rasio WCAG-nya lebih
132
+ tinggi. Kalau keduanya belum mencapai 4.5 banding 1, tinta digelapkan bertahap (hue dan
133
+ saturasi tetap) sampai lolos. Fill itu sendiri tidak pernah diubah.
134
+
135
+ Aturan yang sama tersedia untuk warna dari data konsumen:
136
+
137
+ ```ts
138
+ import { ON_FILL_INK, foregroundFor } from '@edsis/angular/theme/styles';
139
+
140
+ foregroundFor('48 96% 89%'); // '0 0% 12%' (tinta tema)
141
+ foregroundFor('#1e3a8a', 'dark'); // '0 0% 100%'
142
+ foregroundFor('var(--x)'); // null, tidak bisa diukur
143
+ ```
144
+
145
+ `foregroundFor(fill, mode = 'light')` menerima HSL triplet atau hex, lalu mengembalikan
146
+ HSL triplet atau `null`. Untuk elemen template, directive `[OnFill]` dari
147
+ `@edsis/angular/theme/on-fill` memasang `background-color` dan `color` sekaligus,
148
+ dan mengikuti `data-mode` pada `<html>` tanpa menulis apa pun ke sana:
149
+
150
+ ```html
151
+ <span [OnFill]="tag.color">{{ tag.label }}</span>
152
+ ```
153
+
154
+ Pasangan statis digenerate ke `css/base/on-fill.css` (jangan diedit tangan):
155
+
156
+ | Token | Keterangan |
157
+ | ----------------------------------------------------------- | ------------------------------------------------------------------------ |
158
+ | `--chart-1` … `--chart-5` | fill seri chart, per mode; `--chart-1` mengikuti `--primary` |
159
+ | `--chart-1-foreground` … `--chart-5-foreground` | teks di atas fill chart; `--chart-1-foreground` = `--primary-foreground` |
160
+ | `--timeline-indicator-<warna>` dan `-foreground` (17 warna) | indikator timeline, fill sama di kedua mode, foreground per mode |
161
+
162
+ `--theme-chart-N` dan `--theme-chart-N-foreground` menimpa fill dan foreground satu seri.
163
+ Timpa keduanya berpasangan: build tidak bisa memeriksa CSS milik konsumen.
164
+
165
+ `node scripts/generators/gen-theme-colors.mjs --check` memeriksa semua pasangan teks di
166
+ atas fill di CSS base (`:root`, `[data-mode='dark']`, `:root[data-mode='dark']` di
167
+ `theme.css`, `tokens.css`, `status.css`, `on-fill.css`) di kedua mode, setelah `var()`
168
+ dan default `var(--theme-*, d)` di-resolve. Daftarnya `ON_FILL_PAIRS` di generator; token
169
+ `-foreground` baru di CSS base yang belum didaftarkan membuat `--check` gagal sampai
170
+ didaftarkan bersama fill-nya.
122
171
 
123
172
  Jalankan `node scripts/generators/gen-theme-colors.mjs --check` untuk memastikan CSS yang
124
173
  ter commit masih cocok dengan seed. Cek ini juga berjalan di `verify:libs` dan CI.
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Text on fill: chart series and timeline indicators.
3
+ *
4
+ * Generated by scripts/generators/gen-theme-colors.mjs — do not edit. Each fill
5
+ * is paired with a foreground chosen by measured contrast (white or the theme
6
+ * ink, deepened when neither reaches 4.5 to 1), the rule in
7
+ * docs/specs/0011-kontrak-foreground-fill. Override a chart series with
8
+ * --theme-chart-N and --theme-chart-N-foreground together.
9
+ */
10
+ @layer tokens {
11
+ :root {
12
+ --chart-1: var(--theme-chart-1, var(--primary));
13
+ --chart-1-foreground: var(--theme-chart-1-foreground, var(--primary-foreground));
14
+ --chart-2: var(--theme-chart-2, 173 58% 39%);
15
+ --chart-2-foreground: var(--theme-chart-2-foreground, 0 0% 12%);
16
+ --chart-3: var(--theme-chart-3, 197 37% 24%);
17
+ --chart-3-foreground: var(--theme-chart-3-foreground, 0 0% 100%);
18
+ --chart-4: var(--theme-chart-4, 43 74% 66%);
19
+ --chart-4-foreground: var(--theme-chart-4-foreground, 0 0% 12%);
20
+ --chart-5: var(--theme-chart-5, 27 87% 67%);
21
+ --chart-5-foreground: var(--theme-chart-5-foreground, 0 0% 12%);
22
+ --timeline-indicator-red: 0 72% 51%;
23
+ --timeline-indicator-red-foreground: 0 0% 100%;
24
+ --timeline-indicator-orange: 24 95% 53%;
25
+ --timeline-indicator-orange-foreground: 0 0% 12%;
26
+ --timeline-indicator-amber: 38 92% 50%;
27
+ --timeline-indicator-amber-foreground: 0 0% 12%;
28
+ --timeline-indicator-yellow: 48 96% 53%;
29
+ --timeline-indicator-yellow-foreground: 0 0% 12%;
30
+ --timeline-indicator-lime: 84 81% 44%;
31
+ --timeline-indicator-lime-foreground: 0 0% 12%;
32
+ --timeline-indicator-green: 142 71% 45%;
33
+ --timeline-indicator-green-foreground: 0 0% 12%;
34
+ --timeline-indicator-emerald: 160 84% 39%;
35
+ --timeline-indicator-emerald-foreground: 0 0% 12%;
36
+ --timeline-indicator-teal: 173 80% 40%;
37
+ --timeline-indicator-teal-foreground: 0 0% 12%;
38
+ --timeline-indicator-cyan: 191 91% 36%;
39
+ --timeline-indicator-cyan-foreground: 0 0% 11%;
40
+ --timeline-indicator-sky: 199 89% 48%;
41
+ --timeline-indicator-sky-foreground: 0 0% 12%;
42
+ --timeline-indicator-blue: 221 83% 53%;
43
+ --timeline-indicator-blue-foreground: 0 0% 100%;
44
+ --timeline-indicator-indigo: 239 84% 67%;
45
+ --timeline-indicator-indigo-foreground: 0 0% 3%;
46
+ --timeline-indicator-violet: 258 90% 66%;
47
+ --timeline-indicator-violet-foreground: 0 0% 4%;
48
+ --timeline-indicator-purple: 271 91% 65%;
49
+ --timeline-indicator-purple-foreground: 0 0% 9%;
50
+ --timeline-indicator-fuchsia: 292 84% 61%;
51
+ --timeline-indicator-fuchsia-foreground: 0 0% 12%;
52
+ --timeline-indicator-pink: 330 81% 60%;
53
+ --timeline-indicator-pink-foreground: 0 0% 12%;
54
+ --timeline-indicator-rose: 349 89% 60%;
55
+ --timeline-indicator-rose-foreground: 0 0% 11%;
56
+ }
57
+
58
+ [data-mode='dark'] {
59
+ --chart-1: var(--theme-chart-1, var(--primary));
60
+ --chart-1-foreground: var(--theme-chart-1-foreground, var(--primary-foreground));
61
+ --chart-2: var(--theme-chart-2, 160 60% 45%);
62
+ --chart-2-foreground: var(--theme-chart-2-foreground, 0 0% 10%);
63
+ --chart-3: var(--theme-chart-3, 30 80% 55%);
64
+ --chart-3-foreground: var(--theme-chart-3-foreground, 0 0% 10%);
65
+ --chart-4: var(--theme-chart-4, 280 65% 60%);
66
+ --chart-4-foreground: var(--theme-chart-4-foreground, 0 0% 8%);
67
+ --chart-5: var(--theme-chart-5, 340 75% 55%);
68
+ --chart-5-foreground: var(--theme-chart-5-foreground, 0 0% 6%);
69
+ --timeline-indicator-red: 0 72% 51%;
70
+ --timeline-indicator-red-foreground: 0 0% 100%;
71
+ --timeline-indicator-orange: 24 95% 53%;
72
+ --timeline-indicator-orange-foreground: 0 0% 10%;
73
+ --timeline-indicator-amber: 38 92% 50%;
74
+ --timeline-indicator-amber-foreground: 0 0% 10%;
75
+ --timeline-indicator-yellow: 48 96% 53%;
76
+ --timeline-indicator-yellow-foreground: 0 0% 10%;
77
+ --timeline-indicator-lime: 84 81% 44%;
78
+ --timeline-indicator-lime-foreground: 0 0% 10%;
79
+ --timeline-indicator-green: 142 71% 45%;
80
+ --timeline-indicator-green-foreground: 0 0% 10%;
81
+ --timeline-indicator-emerald: 160 84% 39%;
82
+ --timeline-indicator-emerald-foreground: 0 0% 10%;
83
+ --timeline-indicator-teal: 173 80% 40%;
84
+ --timeline-indicator-teal-foreground: 0 0% 10%;
85
+ --timeline-indicator-cyan: 191 91% 36%;
86
+ --timeline-indicator-cyan-foreground: 0 0% 10%;
87
+ --timeline-indicator-sky: 199 89% 48%;
88
+ --timeline-indicator-sky-foreground: 0 0% 10%;
89
+ --timeline-indicator-blue: 221 83% 53%;
90
+ --timeline-indicator-blue-foreground: 0 0% 100%;
91
+ --timeline-indicator-indigo: 239 84% 67%;
92
+ --timeline-indicator-indigo-foreground: 0 0% 3%;
93
+ --timeline-indicator-violet: 258 90% 66%;
94
+ --timeline-indicator-violet-foreground: 0 0% 4%;
95
+ --timeline-indicator-purple: 271 91% 65%;
96
+ --timeline-indicator-purple-foreground: 0 0% 9%;
97
+ --timeline-indicator-fuchsia: 292 84% 61%;
98
+ --timeline-indicator-fuchsia-foreground: 0 0% 10%;
99
+ --timeline-indicator-pink: 330 81% 60%;
100
+ --timeline-indicator-pink-foreground: 0 0% 10%;
101
+ --timeline-indicator-rose: 349 89% 60%;
102
+ --timeline-indicator-rose-foreground: 0 0% 10%;
103
+ }
104
+
105
+ @media (prefers-color-scheme: dark) {
106
+ :root:not([data-mode='light']) {
107
+ --chart-1: var(--theme-chart-1, var(--primary));
108
+ --chart-1-foreground: var(--theme-chart-1-foreground, var(--primary-foreground));
109
+ --chart-2: var(--theme-chart-2, 160 60% 45%);
110
+ --chart-2-foreground: var(--theme-chart-2-foreground, 0 0% 10%);
111
+ --chart-3: var(--theme-chart-3, 30 80% 55%);
112
+ --chart-3-foreground: var(--theme-chart-3-foreground, 0 0% 10%);
113
+ --chart-4: var(--theme-chart-4, 280 65% 60%);
114
+ --chart-4-foreground: var(--theme-chart-4-foreground, 0 0% 8%);
115
+ --chart-5: var(--theme-chart-5, 340 75% 55%);
116
+ --chart-5-foreground: var(--theme-chart-5-foreground, 0 0% 6%);
117
+ --timeline-indicator-red: 0 72% 51%;
118
+ --timeline-indicator-red-foreground: 0 0% 100%;
119
+ --timeline-indicator-orange: 24 95% 53%;
120
+ --timeline-indicator-orange-foreground: 0 0% 10%;
121
+ --timeline-indicator-amber: 38 92% 50%;
122
+ --timeline-indicator-amber-foreground: 0 0% 10%;
123
+ --timeline-indicator-yellow: 48 96% 53%;
124
+ --timeline-indicator-yellow-foreground: 0 0% 10%;
125
+ --timeline-indicator-lime: 84 81% 44%;
126
+ --timeline-indicator-lime-foreground: 0 0% 10%;
127
+ --timeline-indicator-green: 142 71% 45%;
128
+ --timeline-indicator-green-foreground: 0 0% 10%;
129
+ --timeline-indicator-emerald: 160 84% 39%;
130
+ --timeline-indicator-emerald-foreground: 0 0% 10%;
131
+ --timeline-indicator-teal: 173 80% 40%;
132
+ --timeline-indicator-teal-foreground: 0 0% 10%;
133
+ --timeline-indicator-cyan: 191 91% 36%;
134
+ --timeline-indicator-cyan-foreground: 0 0% 10%;
135
+ --timeline-indicator-sky: 199 89% 48%;
136
+ --timeline-indicator-sky-foreground: 0 0% 10%;
137
+ --timeline-indicator-blue: 221 83% 53%;
138
+ --timeline-indicator-blue-foreground: 0 0% 100%;
139
+ --timeline-indicator-indigo: 239 84% 67%;
140
+ --timeline-indicator-indigo-foreground: 0 0% 3%;
141
+ --timeline-indicator-violet: 258 90% 66%;
142
+ --timeline-indicator-violet-foreground: 0 0% 4%;
143
+ --timeline-indicator-purple: 271 91% 65%;
144
+ --timeline-indicator-purple-foreground: 0 0% 9%;
145
+ --timeline-indicator-fuchsia: 292 84% 61%;
146
+ --timeline-indicator-fuchsia-foreground: 0 0% 10%;
147
+ --timeline-indicator-pink: 330 81% 60%;
148
+ --timeline-indicator-pink-foreground: 0 0% 10%;
149
+ --timeline-indicator-rose: 349 89% 60%;
150
+ --timeline-indicator-rose-foreground: 0 0% 10%;
151
+ }
152
+ }
153
+ }
@@ -4,6 +4,7 @@
4
4
  @import './theme.css';
5
5
  @import './tokens.css';
6
6
  @import './status.css';
7
+ @import './on-fill.css';
7
8
  @import './prefers-dark.css';
8
9
  @import './components.css';
9
10
  @import './print.css';
@@ -18,11 +18,6 @@
18
18
  --overlay-backdrop: 0 0% 0% / 0.64;
19
19
  --overlay-backdrop-strong: 0 0% 0% / 0.5;
20
20
  --editor-highlight: 48 70% 30%;
21
- --chart-1: var(--theme-chart-1, var(--primary));
22
- --chart-2: var(--theme-chart-2, 160 60% 45%);
23
- --chart-3: var(--theme-chart-3, 30 80% 55%);
24
- --chart-4: var(--theme-chart-4, 280 65% 60%);
25
- --chart-5: var(--theme-chart-5, 340 75% 55%);
26
21
  }
27
22
 
28
23
  :root:not([data-mode='light']) {