@ojiepermana/angular 22.2.6 → 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 (107) hide show
  1. package/chart/README.md +3 -0
  2. package/fesm2022/ojiepermana-angular-chart-area.mjs +3 -3
  3. package/fesm2022/ojiepermana-angular-chart-bar.mjs +3 -3
  4. package/fesm2022/ojiepermana-angular-chart-core.mjs +71 -34
  5. package/fesm2022/ojiepermana-angular-chart-line.mjs +3 -3
  6. package/fesm2022/ojiepermana-angular-chart-pie.mjs +14 -7
  7. package/fesm2022/ojiepermana-angular-chart-primitives.mjs +33 -33
  8. package/fesm2022/ojiepermana-angular-chart-radar.mjs +3 -3
  9. package/fesm2022/ojiepermana-angular-chart-radial.mjs +3 -3
  10. package/fesm2022/ojiepermana-angular-chart-scatter.mjs +3 -3
  11. package/fesm2022/ojiepermana-angular-component-accordion.mjs +15 -15
  12. package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +27 -27
  13. package/fesm2022/ojiepermana-angular-component-alert.mjs +12 -12
  14. package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +3 -3
  15. package/fesm2022/ojiepermana-angular-component-avatar.mjs +18 -18
  16. package/fesm2022/ojiepermana-angular-component-badge.mjs +3 -3
  17. package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +21 -21
  18. package/fesm2022/ojiepermana-angular-component-button-group.mjs +9 -9
  19. package/fesm2022/ojiepermana-angular-component-button.mjs +3 -3
  20. package/fesm2022/ojiepermana-angular-component-calendar.mjs +3 -3
  21. package/fesm2022/ojiepermana-angular-component-card.mjs +21 -21
  22. package/fesm2022/ojiepermana-angular-component-carousel.mjs +18 -18
  23. package/fesm2022/ojiepermana-angular-component-checkbox.mjs +3 -3
  24. package/fesm2022/ojiepermana-angular-component-collapsible.mjs +12 -12
  25. package/fesm2022/ojiepermana-angular-component-combobox.mjs +3 -3
  26. package/fesm2022/ojiepermana-angular-component-command.mjs +27 -27
  27. package/fesm2022/ojiepermana-angular-component-composer.mjs +21 -21
  28. package/fesm2022/ojiepermana-angular-component-context-menu.mjs +3 -3
  29. package/fesm2022/ojiepermana-angular-component-date-picker.mjs +3 -3
  30. package/fesm2022/ojiepermana-angular-component-dialog.mjs +21 -21
  31. package/fesm2022/ojiepermana-angular-component-drawer.mjs +1 -2
  32. package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +39 -39
  33. package/fesm2022/ojiepermana-angular-component-editor.mjs +18 -18
  34. package/fesm2022/ojiepermana-angular-component-empty.mjs +18 -18
  35. package/fesm2022/ojiepermana-angular-component-form.mjs +36 -36
  36. package/fesm2022/ojiepermana-angular-component-hover-card.mjs +9 -9
  37. package/fesm2022/ojiepermana-angular-component-icon.mjs +6 -6
  38. package/fesm2022/ojiepermana-angular-component-input-group.mjs +18 -18
  39. package/fesm2022/ojiepermana-angular-component-input-otp.mjs +15 -15
  40. package/fesm2022/ojiepermana-angular-component-input.mjs +3 -3
  41. package/fesm2022/ojiepermana-angular-component-item.mjs +30 -30
  42. package/fesm2022/ojiepermana-angular-component-kanban.mjs +27 -27
  43. package/fesm2022/ojiepermana-angular-component-kbd.mjs +6 -6
  44. package/fesm2022/ojiepermana-angular-component-label.mjs +3 -3
  45. package/fesm2022/ojiepermana-angular-component-menubar.mjs +12 -12
  46. package/fesm2022/ojiepermana-angular-component-native-select.mjs +9 -9
  47. package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +21 -21
  48. package/fesm2022/ojiepermana-angular-component-pagination.mjs +3 -3
  49. package/fesm2022/ojiepermana-angular-component-pillbox.mjs +15 -15
  50. package/fesm2022/ojiepermana-angular-component-popover.mjs +6 -6
  51. package/fesm2022/ojiepermana-angular-component-progress.mjs +3 -3
  52. package/fesm2022/ojiepermana-angular-component-radio.mjs +6 -6
  53. package/fesm2022/ojiepermana-angular-component-resizable.mjs +12 -12
  54. package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +3 -3
  55. package/fesm2022/ojiepermana-angular-component-segmented-control.mjs +3 -3
  56. package/fesm2022/ojiepermana-angular-component-select.mjs +6 -6
  57. package/fesm2022/ojiepermana-angular-component-separator.mjs +3 -3
  58. package/fesm2022/ojiepermana-angular-component-sheet.mjs +21 -21
  59. package/fesm2022/ojiepermana-angular-component-skeleton.mjs +3 -3
  60. package/fesm2022/ojiepermana-angular-component-slider.mjs +6 -6
  61. package/fesm2022/ojiepermana-angular-component-spinner.mjs +3 -3
  62. package/fesm2022/ojiepermana-angular-component-switch.mjs +3 -3
  63. package/fesm2022/ojiepermana-angular-component-table.mjs +24 -24
  64. package/fesm2022/ojiepermana-angular-component-tabs.mjs +18 -18
  65. package/fesm2022/ojiepermana-angular-component-textarea.mjs +3 -3
  66. package/fesm2022/ojiepermana-angular-component-timeline.mjs +18 -18
  67. package/fesm2022/ojiepermana-angular-component-toast.mjs +3 -3
  68. package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +9 -9
  69. package/fesm2022/ojiepermana-angular-component-toggle.mjs +3 -3
  70. package/fesm2022/ojiepermana-angular-component-tooltip.mjs +15 -15
  71. package/fesm2022/ojiepermana-angular-component-utils-scale.mjs +3 -3
  72. package/fesm2022/ojiepermana-angular-navigation-icon.mjs +3 -3
  73. package/fesm2022/{ojiepermana-angular-navigation-navigation-badge-count.component-D-WgBF6d.mjs → ojiepermana-angular-navigation-navigation-badge-count.component-BxWVj145.mjs} +3 -3
  74. package/fesm2022/{ojiepermana-angular-navigation-navigation-dockbar-menu.component-UrcWBqBk.mjs → ojiepermana-angular-navigation-navigation-dockbar-menu.component-DTPbCqmL.mjs} +6 -6
  75. package/fesm2022/{ojiepermana-angular-navigation-navigation-entry-grid.component-1WiRlut1.mjs → ojiepermana-angular-navigation-navigation-entry-grid.component-Bw532lfJ.mjs} +4 -4
  76. package/fesm2022/{ojiepermana-angular-navigation-navigation-flyout-menu.component-dAVUnvwq.mjs → ojiepermana-angular-navigation-navigation-flyout-menu.component-vLVcVQDd.mjs} +5 -5
  77. package/fesm2022/{ojiepermana-angular-navigation-navigation-horizontal.component-OD_cAkg8.mjs → ojiepermana-angular-navigation-navigation-horizontal.component-A1zBBMDS.mjs} +6 -6
  78. package/fesm2022/{ojiepermana-angular-navigation-navigation-item.component-6mJbQ94G.mjs → ojiepermana-angular-navigation-navigation-item.component-C-nz2md7.mjs} +32 -22
  79. package/fesm2022/{ojiepermana-angular-navigation-navigation-list.component-DefF7_rB.mjs → ojiepermana-angular-navigation-navigation-list.component-CjcoYtil.mjs} +6 -7
  80. package/fesm2022/ojiepermana-angular-navigation-service.mjs +3 -3
  81. package/fesm2022/ojiepermana-angular-navigation.mjs +62 -61
  82. package/fesm2022/ojiepermana-angular-theme-component-settings.mjs +19 -33
  83. package/fesm2022/ojiepermana-angular-theme-layout-services.mjs +6 -6
  84. package/fesm2022/ojiepermana-angular-theme-layout-wrapper.mjs +30 -30
  85. package/fesm2022/ojiepermana-angular-theme-layout.mjs +24 -24
  86. package/fesm2022/ojiepermana-angular-theme-on-fill.mjs +89 -0
  87. package/fesm2022/ojiepermana-angular-theme-page-core.mjs +3 -3
  88. package/fesm2022/ojiepermana-angular-theme-page-filter.mjs +6 -6
  89. package/fesm2022/ojiepermana-angular-theme-page-overview.mjs +3 -3
  90. package/fesm2022/ojiepermana-angular-theme-page-root.mjs +3 -3
  91. package/fesm2022/ojiepermana-angular-theme-page-side.mjs +6 -6
  92. package/fesm2022/ojiepermana-angular-theme-page-slots.mjs +12 -12
  93. package/fesm2022/ojiepermana-angular-theme-shell-services.mjs +3 -3
  94. package/fesm2022/ojiepermana-angular-theme-shell.mjs +9 -9
  95. package/fesm2022/ojiepermana-angular-theme-styles.mjs +77 -44
  96. package/navigation/README.md +6 -0
  97. package/package.json +6 -2
  98. package/theme/styles/README.md +52 -3
  99. package/theme/styles/css/base/on-fill.css +153 -0
  100. package/theme/styles/css/base/package.css +1 -0
  101. package/theme/styles/css/base/prefers-dark.css +0 -5
  102. package/theme/styles/css/base/theme.css +4 -51
  103. package/theme/styles/css/color/emerald.css +1 -1
  104. package/types/ojiepermana-angular-chart-core.d.ts +3 -1
  105. package/types/ojiepermana-angular-chart-pie.d.ts +5 -0
  106. package/types/ojiepermana-angular-theme-on-fill.d.ts +45 -0
  107. package/types/ojiepermana-angular-theme-styles.d.ts +37 -4
@@ -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 '@ojiepermana/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
+ `@ojiepermana/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']) {
@@ -129,41 +129,6 @@
129
129
  --z-tooltip: calc(var(--z-base) * 700);
130
130
  --z-toast: calc(var(--z-base) * 800);
131
131
 
132
- --timeline-indicator-red: 0 72% 51%;
133
- --timeline-indicator-red-foreground: 0 0% 100%;
134
- --timeline-indicator-orange: 24 95% 53%;
135
- --timeline-indicator-orange-foreground: 0 0% 100%;
136
- --timeline-indicator-amber: 38 92% 50%;
137
- --timeline-indicator-amber-foreground: 0 0% 100%;
138
- --timeline-indicator-yellow: 48 96% 53%;
139
- --timeline-indicator-yellow-foreground: 0 0% 10%;
140
- --timeline-indicator-lime: 84 81% 44%;
141
- --timeline-indicator-lime-foreground: 0 0% 10%;
142
- --timeline-indicator-green: 142 71% 45%;
143
- --timeline-indicator-green-foreground: 0 0% 100%;
144
- --timeline-indicator-emerald: 160 84% 39%;
145
- --timeline-indicator-emerald-foreground: 0 0% 100%;
146
- --timeline-indicator-teal: 173 80% 40%;
147
- --timeline-indicator-teal-foreground: 0 0% 100%;
148
- --timeline-indicator-cyan: 191 91% 36%;
149
- --timeline-indicator-cyan-foreground: 0 0% 100%;
150
- --timeline-indicator-sky: 199 89% 48%;
151
- --timeline-indicator-sky-foreground: 0 0% 100%;
152
- --timeline-indicator-blue: 221 83% 53%;
153
- --timeline-indicator-blue-foreground: 0 0% 100%;
154
- --timeline-indicator-indigo: 239 84% 67%;
155
- --timeline-indicator-indigo-foreground: 0 0% 100%;
156
- --timeline-indicator-violet: 258 90% 66%;
157
- --timeline-indicator-violet-foreground: 0 0% 100%;
158
- --timeline-indicator-purple: 271 91% 65%;
159
- --timeline-indicator-purple-foreground: 0 0% 100%;
160
- --timeline-indicator-fuchsia: 292 84% 61%;
161
- --timeline-indicator-fuchsia-foreground: 0 0% 100%;
162
- --timeline-indicator-pink: 330 81% 60%;
163
- --timeline-indicator-pink-foreground: 0 0% 100%;
164
- --timeline-indicator-rose: 349 89% 60%;
165
- --timeline-indicator-rose-foreground: 0 0% 100%;
166
-
167
132
  /* --layout-grid-line is defined per-mode in base/tokens.css and per-neutral
168
133
  * by the generated theme-neutral CSS, so the surface grid keeps constant
169
134
  * contrast across every neutral, including base. Opacity is the global
@@ -312,16 +277,11 @@
312
277
  --destructive-foreground: 0 0% 100%;
313
278
 
314
279
  /*
315
- * Chart series palette. --chart-1 follows the selected accent (--primary)
316
- * so the primary series always reflects the picked theme color; --chart-2..5
317
- * mirror the shadcn/ui chart palette for distinguishable supporting series.
318
- * Each stays overridable per-theme via the --theme-chart-* hook.
280
+ * The chart series palette (--chart-N, --chart-N-foreground) and the
281
+ * timeline indicator fills live in on-fill.css, generated by
282
+ * scripts/generators/gen-theme-colors.mjs so every fill gets a measured
283
+ * foreground (spec 0011).
319
284
  */
320
- --chart-1: var(--theme-chart-1, var(--primary));
321
- --chart-2: var(--theme-chart-2, 173 58% 39%);
322
- --chart-3: var(--theme-chart-3, 197 37% 24%);
323
- --chart-4: var(--theme-chart-4, 43 74% 66%);
324
- --chart-5: var(--theme-chart-5, 27 87% 67%);
325
285
 
326
286
  --sidebar: var(--card);
327
287
  --sidebar-background: var(--sidebar);
@@ -342,12 +302,5 @@
342
302
  --overlay-backdrop-strong: 0 0% 0% / 0.5;
343
303
 
344
304
  --editor-highlight: 48 70% 30%;
345
-
346
- /* Chart palette (dark) — --chart-1 follows --primary; rest track shadcn/ui. */
347
- --chart-1: var(--theme-chart-1, var(--primary));
348
- --chart-2: var(--theme-chart-2, 160 60% 45%);
349
- --chart-3: var(--theme-chart-3, 30 80% 55%);
350
- --chart-4: var(--theme-chart-4, 280 65% 60%);
351
- --chart-5: var(--theme-chart-5, 340 75% 55%);
352
305
  }
353
306
  }
@@ -17,7 +17,7 @@
17
17
  --primary: 160 78% 48%;
18
18
  --primary-foreground: 0 0% 12%;
19
19
  --accent: 160 47% 94%;
20
- --accent-foreground: 160 78% 27%;
20
+ --accent-foreground: 160 78% 28%;
21
21
  --secondary: 160 31% 93%;
22
22
  --secondary-foreground: 160 78% 27%;
23
23
  --ring: 160 78% 37%;
@@ -54,7 +54,9 @@ export declare function isSafeCssColorValue(value: string): boolean;
54
54
  /**
55
55
  * Generate the CSS rule-set for a chart instance: one `--color-<key>` per
56
56
  * series, scoped to the owning `[data-chart]` element, with optional dark
57
- * variant via `[data-mode="dark"] [data-chart="…"]`.
57
+ * variant via `[data-mode="dark"] [data-chart="…"]`. Beside each colour sits a
58
+ * `--color-<key>-foreground` for text drawn on it, chosen per mode by
59
+ * {@link seriesForegroundValue} and omitted when no foreground can be promised.
58
60
  *
59
61
  * Series without any color are skipped (consumer can fall back to a default), and
60
62
  * so is any series whose color fails {@link isSafeCssColorValue}: the value never
@@ -117,6 +117,11 @@ export declare class PieChart {
117
117
  protected readonly ariaSummary: import("@angular/core").Signal<string>;
118
118
  protected readonly dataColumns: import("@angular/core").Signal<string[]>;
119
119
  protected sliceAriaLabel(s: PieSliceRect): string;
120
+ /**
121
+ * The label colour for a slice: the series foreground `buildChartCss` wrote
122
+ * for this mode, or the body foreground when the series has none.
123
+ */
124
+ protected labelFill(s: PieSliceRect): string;
120
125
  protected sliceTransform(s: PieSliceRect): string | null;
121
126
  protected emitClick(s: PieSliceRect): void;
122
127
  static ɵfac: i0.ɵɵFactoryDeclaration<PieChart, never>;
@@ -0,0 +1,45 @@
1
+ import { ON_FILL_INK, foregroundFor } from "@ojiepermana/angular/theme/styles";
2
+ import * as i0 from "@angular/core";
3
+ /** The painted fill and the text colour chosen for it, or `null` when unreadable. */
4
+ interface OnFillPaint {
5
+ readonly background: string;
6
+ readonly color: string;
7
+ }
8
+ /**
9
+ * Paints an element with a solid fill from data and gives it a readable text
10
+ * colour: white or the theme ink, whichever measures higher, deepened when
11
+ * neither reaches 4.5 to 1 (`foregroundFor`, spec 0011).
12
+ *
13
+ * ```html
14
+ * <span [OnFill]="tag.color">{{ tag.label }}</span>
15
+ * ```
16
+ *
17
+ * `OnFill` takes an HSL triplet (`'221 83% 53%'`) or a hex colour (`'#3b82f6'`).
18
+ * The mode comes from `data-mode` on `<html>`, watched with a
19
+ * `MutationObserver`, so the ink follows a light/dark switch. The directive
20
+ * never injects `ThemeModeService` and never writes to `<html>`: it works with
21
+ * or without `provideUiTheme`. Without a document (SSR) or without the
22
+ * attribute it uses light mode.
23
+ *
24
+ * A value it cannot read paints nothing, so the element keeps its inherited
25
+ * colours, and logs one warning in dev mode.
26
+ */
27
+ export declare class OnFill {
28
+ /** The fill: an HSL triplet or a hex colour. */
29
+ readonly OnFill: import("@angular/core").InputSignal<string>;
30
+ private readonly document;
31
+ private readonly mode;
32
+ /** The style the host gets, or `null` when the fill cannot be read. */
33
+ protected readonly paint: import("@angular/core").Signal<OnFillPaint | null>;
34
+ constructor();
35
+ private readMode;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<OnFill, never>;
37
+ static ɵdir: i0.ɵɵDirectiveDeclaration<OnFill, "[OnFill]", never, {
38
+ "OnFill": {
39
+ "alias": "OnFill";
40
+ "required": true;
41
+ "isSignal": true;
42
+ };
43
+ }, {}, never, never, true, never>;
44
+ }
45
+ export { ON_FILL_INK, foregroundFor };
@@ -126,8 +126,10 @@ export declare class ThemeBrandService {
126
126
  /**
127
127
  * Set the brand color. `color`/`foreground` are HSL triplets (e.g.
128
128
  * `'221 83% 53%'`); a hex color is converted, since that is what a native
129
- * picker hands back. The fill is kept exactly as chosen — `--brand-foreground`
130
- * is moved until text on it clears 4.5 to 1, and the focus ring is solved
129
+ * picker hands back. The fill is kept exactly as chosen. Without `foreground`,
130
+ * `--brand-foreground` is white or the theme ink, whichever measures higher
131
+ * (`foregroundFor`); an explicit `foreground` is kept only when it clears 4.5
132
+ * to 1, otherwise it is replaced by that same choice. The focus ring is solved
131
133
  * separately per mode, so a pale brand can never leave the ring invisible.
132
134
  */
133
135
  setBrand(color: string, foreground?: string): void;
@@ -271,7 +273,13 @@ export declare class ThemeSpaceService {
271
273
  export interface ThemeBrandOptions {
272
274
  /** Brand color, e.g. `'221 83% 53%'`. */
273
275
  readonly color: string;
274
- /** Foreground on solid brand fills. Defaults to white. */
276
+ /**
277
+ * Foreground on solid brand fills. Omit it to get white or the theme ink,
278
+ * whichever measures higher against `color` (`foregroundFor`). An explicit
279
+ * value is kept only when it clears 4.5 to 1; otherwise it is replaced by that
280
+ * same choice. When `color` is a `var()` reference nothing can be measured, so
281
+ * this value (or white) is used as given.
282
+ */
275
283
  readonly foreground?: string;
276
284
  }
277
285
  export interface ThemeOptions {
@@ -292,4 +300,29 @@ export interface ThemeOptions {
292
300
  readonly brand?: string | ThemeBrandOptions;
293
301
  }
294
302
  export declare const THEME_OPTIONS: InjectionToken<Readonly<ThemeOptions>>;
295
- export declare function provideUiTheme(options?: ThemeOptions): EnvironmentProviders;
303
+ export declare function provideUiTheme(options?: ThemeOptions): EnvironmentProviders;
304
+ /**
305
+ * The theme's dark ink per mode: `--foreground` of the base theme, which is what
306
+ * a solid fill falls back to when white does not measure higher against it.
307
+ *
308
+ * Same values as `DARK_INK` in scripts/generators/gen-theme-colors.mjs, so a fill
309
+ * the generator measured and a fill a consumer hands over at runtime get the
310
+ * same answer. Read only.
311
+ */
312
+ export declare const ON_FILL_INK: Readonly<{
313
+ readonly light: string;
314
+ readonly dark: string;
315
+ }>;
316
+ /**
317
+ * The text colour for a solid fill: white or the theme's dark ink
318
+ * ({@link ON_FILL_INK}), whichever gives the higher WCAG ratio, with the ink
319
+ * deepened step by step when neither reaches 4.5 to 1.
320
+ *
321
+ * `fill` is an HSL triplet (`'221 83% 53%'`) or a hex colour (`'#3b82f6'`).
322
+ * Returns an HSL triplet for `hsl(<triplet>)`, or `null` when `fill` cannot be
323
+ * read. The fill itself is never changed; only the foreground is chosen.
324
+ *
325
+ * The result equals the generator's for every canonical `H S% L%` input, which
326
+ * scripts/generators/fixtures/on-fill-parity.json locks.
327
+ */
328
+ export declare function foregroundFor(fill: string, mode?: 'light' | 'dark'): string | null;