@ojiepermana/angular 22.2.7 → 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.
- package/chart/README.md +3 -0
- package/fesm2022/ojiepermana-angular-chart-area.mjs +3 -3
- package/fesm2022/ojiepermana-angular-chart-bar.mjs +3 -3
- package/fesm2022/ojiepermana-angular-chart-core.mjs +71 -34
- package/fesm2022/ojiepermana-angular-chart-line.mjs +3 -3
- package/fesm2022/ojiepermana-angular-chart-pie.mjs +14 -7
- package/fesm2022/ojiepermana-angular-chart-primitives.mjs +33 -33
- package/fesm2022/ojiepermana-angular-chart-radar.mjs +3 -3
- package/fesm2022/ojiepermana-angular-chart-radial.mjs +3 -3
- package/fesm2022/ojiepermana-angular-chart-scatter.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-accordion.mjs +15 -15
- package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +27 -27
- package/fesm2022/ojiepermana-angular-component-alert.mjs +12 -12
- package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-avatar.mjs +18 -18
- package/fesm2022/ojiepermana-angular-component-badge.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +21 -21
- package/fesm2022/ojiepermana-angular-component-button-group.mjs +9 -9
- package/fesm2022/ojiepermana-angular-component-button.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-calendar.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-card.mjs +21 -21
- package/fesm2022/ojiepermana-angular-component-carousel.mjs +18 -18
- package/fesm2022/ojiepermana-angular-component-checkbox.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-collapsible.mjs +12 -12
- package/fesm2022/ojiepermana-angular-component-combobox.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-command.mjs +27 -27
- package/fesm2022/ojiepermana-angular-component-composer.mjs +21 -21
- package/fesm2022/ojiepermana-angular-component-context-menu.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-date-picker.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-dialog.mjs +21 -21
- package/fesm2022/ojiepermana-angular-component-drawer.mjs +1 -2
- package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +39 -39
- package/fesm2022/ojiepermana-angular-component-editor.mjs +18 -18
- package/fesm2022/ojiepermana-angular-component-empty.mjs +18 -18
- package/fesm2022/ojiepermana-angular-component-form.mjs +36 -36
- package/fesm2022/ojiepermana-angular-component-hover-card.mjs +9 -9
- package/fesm2022/ojiepermana-angular-component-icon.mjs +6 -6
- package/fesm2022/ojiepermana-angular-component-input-group.mjs +18 -18
- package/fesm2022/ojiepermana-angular-component-input-otp.mjs +15 -15
- package/fesm2022/ojiepermana-angular-component-input.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-item.mjs +30 -30
- package/fesm2022/ojiepermana-angular-component-kanban.mjs +27 -27
- package/fesm2022/ojiepermana-angular-component-kbd.mjs +6 -6
- package/fesm2022/ojiepermana-angular-component-label.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-menubar.mjs +12 -12
- package/fesm2022/ojiepermana-angular-component-native-select.mjs +9 -9
- package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +21 -21
- package/fesm2022/ojiepermana-angular-component-pagination.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-pillbox.mjs +15 -15
- package/fesm2022/ojiepermana-angular-component-popover.mjs +6 -6
- package/fesm2022/ojiepermana-angular-component-progress.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-radio.mjs +6 -6
- package/fesm2022/ojiepermana-angular-component-resizable.mjs +12 -12
- package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-segmented-control.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-select.mjs +6 -6
- package/fesm2022/ojiepermana-angular-component-separator.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-sheet.mjs +21 -21
- package/fesm2022/ojiepermana-angular-component-skeleton.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-slider.mjs +6 -6
- package/fesm2022/ojiepermana-angular-component-spinner.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-switch.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-table.mjs +24 -24
- package/fesm2022/ojiepermana-angular-component-tabs.mjs +18 -18
- package/fesm2022/ojiepermana-angular-component-textarea.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-timeline.mjs +18 -18
- package/fesm2022/ojiepermana-angular-component-toast.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +9 -9
- package/fesm2022/ojiepermana-angular-component-toggle.mjs +3 -3
- package/fesm2022/ojiepermana-angular-component-tooltip.mjs +15 -15
- package/fesm2022/ojiepermana-angular-component-utils-scale.mjs +3 -3
- package/fesm2022/ojiepermana-angular-navigation-icon.mjs +3 -3
- package/fesm2022/{ojiepermana-angular-navigation-navigation-badge-count.component-D-WgBF6d.mjs → ojiepermana-angular-navigation-navigation-badge-count.component-BxWVj145.mjs} +3 -3
- package/fesm2022/{ojiepermana-angular-navigation-navigation-dockbar-menu.component-DqomVKM3.mjs → ojiepermana-angular-navigation-navigation-dockbar-menu.component-DTPbCqmL.mjs} +6 -6
- package/fesm2022/{ojiepermana-angular-navigation-navigation-entry-grid.component-nge3WGLa.mjs → ojiepermana-angular-navigation-navigation-entry-grid.component-Bw532lfJ.mjs} +4 -4
- package/fesm2022/{ojiepermana-angular-navigation-navigation-flyout-menu.component-CeoyWTbP.mjs → ojiepermana-angular-navigation-navigation-flyout-menu.component-vLVcVQDd.mjs} +5 -5
- package/fesm2022/{ojiepermana-angular-navigation-navigation-horizontal.component-BhE_XVog.mjs → ojiepermana-angular-navigation-navigation-horizontal.component-A1zBBMDS.mjs} +6 -6
- package/fesm2022/{ojiepermana-angular-navigation-navigation-item.component-2R9tPqQK.mjs → ojiepermana-angular-navigation-navigation-item.component-C-nz2md7.mjs} +10 -10
- package/fesm2022/{ojiepermana-angular-navigation-navigation-list.component-DO_eoMWG.mjs → ojiepermana-angular-navigation-navigation-list.component-CjcoYtil.mjs} +4 -4
- package/fesm2022/ojiepermana-angular-navigation-service.mjs +3 -3
- package/fesm2022/ojiepermana-angular-navigation.mjs +62 -62
- package/fesm2022/ojiepermana-angular-theme-component-settings.mjs +19 -33
- package/fesm2022/ojiepermana-angular-theme-layout-services.mjs +6 -6
- package/fesm2022/ojiepermana-angular-theme-layout-wrapper.mjs +30 -30
- package/fesm2022/ojiepermana-angular-theme-layout.mjs +24 -24
- package/fesm2022/ojiepermana-angular-theme-on-fill.mjs +89 -0
- package/fesm2022/ojiepermana-angular-theme-page-core.mjs +3 -3
- package/fesm2022/ojiepermana-angular-theme-page-filter.mjs +6 -6
- package/fesm2022/ojiepermana-angular-theme-page-overview.mjs +3 -3
- package/fesm2022/ojiepermana-angular-theme-page-root.mjs +3 -3
- package/fesm2022/ojiepermana-angular-theme-page-side.mjs +6 -6
- package/fesm2022/ojiepermana-angular-theme-page-slots.mjs +12 -12
- package/fesm2022/ojiepermana-angular-theme-shell-services.mjs +3 -3
- package/fesm2022/ojiepermana-angular-theme-shell.mjs +9 -9
- package/fesm2022/ojiepermana-angular-theme-styles.mjs +77 -44
- package/package.json +6 -2
- package/theme/styles/README.md +52 -3
- package/theme/styles/css/base/on-fill.css +153 -0
- package/theme/styles/css/base/package.css +1 -0
- package/theme/styles/css/base/prefers-dark.css +0 -5
- package/theme/styles/css/base/theme.css +4 -51
- package/theme/styles/css/color/emerald.css +1 -1
- package/types/ojiepermana-angular-chart-core.d.ts +3 -1
- package/types/ojiepermana-angular-chart-pie.d.ts +5 -0
- package/types/ojiepermana-angular-theme-on-fill.d.ts +45 -0
- package/types/ojiepermana-angular-theme-styles.d.ts +37 -4
|
@@ -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
|
-
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
*
|
|
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
|
}
|
|
@@ -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
|
|
130
|
-
* is
|
|
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
|
-
/**
|
|
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;
|