@eagami/ui 5.90.2 → 5.91.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagami/ui",
3
- "version": "5.90.2",
3
+ "version": "5.91.1",
4
4
  "description": "Lightweight, accessible, themeable Angular UI component library and icon set built on CSS custom properties",
5
5
  "author": "Michal Wiraszka <michal@eagami.com>",
6
6
  "license": "MIT",
@@ -1,4 +1,7 @@
1
- import { EnvironmentProviders, InjectionToken } from "@angular/core";
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ import { EnvironmentProviders } from "@angular/core";
2
5
  /**
3
6
  * How a reload into the current build turned out:
4
7
  *
@@ -22,7 +25,6 @@ interface StaleBuildReloadConfig {
22
25
  /** Called once per reload with how it turned out, for example to log it. */
23
26
  onReport?: (report: StaleBuildReloadReport) => void;
24
27
  }
25
- declare const LOAD_PAGE: InjectionToken<(url: string, replace: boolean) => void>;
26
28
  /**
27
29
  * Whether `error` is a failed page load that `provideStaleBuildReload()` has
28
30
  * already answered by reloading. Error reporters can drop it, since the
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
1
4
  /**
2
5
  * Fills in the native `<dialog>` methods jsdom leaves unimplemented, and the
3
6
  * `Element.getAnimations()` an `ea-drawer` reads to follow its slide out, so a
@@ -1,6 +1,9 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
1
4
  import * as i0 from "@angular/core";
2
5
  import { AfterContentChecked, ElementRef, EnvironmentProviders, InjectionToken, Injector, OnDestroy, OnInit, Signal, TemplateRef, Type } from "@angular/core";
3
- import { AbstractControl, ControlValueAccessor } from "@angular/forms";
6
+ import { ControlValueAccessor } from "@angular/forms";
4
7
  /**
5
8
  * When a form component shows its validation error.
6
9
  *
@@ -22,8 +25,6 @@ interface EagamiFormsConfig {
22
25
  /** When form components show their validation errors; `'change'` by default. */
23
26
  showErrorsOn?: EaShowErrorsOn;
24
27
  }
25
- /** DI token carrying the consumer-supplied form defaults. */
26
- declare const EAGAMI_FORMS_CONFIG: InjectionToken<EagamiFormsConfig>;
27
28
  /**
28
29
  * BCP 47 locale tags supported out of the box. Consumers select one of these
29
30
  * via `provideEagamiUi({ locale })` or `EagamiI18nService.setLocale()`.
@@ -619,19 +620,6 @@ export declare function formatViolations(violations: readonly ContrastViolation[
619
620
  export declare function applyPalette(palette: ModePalette, nonce?: string | null): void;
620
621
  export declare function relativeLuminance(hex: string): number;
621
622
  export declare function contrastRatio(hexA: string, hexB: string): number;
622
- /** The two inks a component paints on a caller-supplied fill. */
623
- declare const INK: {
624
- readonly light: "#ffffff";
625
- readonly dark: "#030712";
626
- };
627
- /** `#abc` and `#aabbcc` alike as `#aabbcc`, or `null` for anything else. */
628
- declare function normalizeHex(color: string): string | null;
629
- /**
630
- * Whichever of the two inks reads better on `background`, for a fill the
631
- * library cannot know ahead of time (a user-chosen tag colour). Returns `null`
632
- * when the background is not a hex colour this can measure.
633
- */
634
- declare function readableInk(background: string): 'light' | 'dark' | null;
635
623
  /**
636
624
  * WCAG 2.1 AA contrast floors: 4.5:1 for body text, 3:1 for ≥ 18pt text
637
625
  * (or ≥ 14pt bold), 3:1 for UI components (icons, focus rings, meaningful
@@ -655,14 +643,6 @@ interface Oklch {
655
643
  /** Hue, 0–360 degrees. */
656
644
  h: number;
657
645
  }
658
- interface Rgb$1 {
659
- /** 0–255. */
660
- r: number;
661
- g: number;
662
- b: number;
663
- }
664
- declare function hexToRgb(hex: string): Rgb$1;
665
- declare function rgbToHex({ r, g, b }: Rgb$1): string;
666
646
  export declare function hexToOklch(hex: string): Oklch;
667
647
  export declare function oklchToHex(oklch: Oklch): string;
668
648
  /**
@@ -906,28 +886,8 @@ interface RenderedGroup {
906
886
  rule: boolean;
907
887
  options: IndexedOption[];
908
888
  }
909
- /**
910
- * Lowercased with diacritics folded away, so a search typed on a plain
911
- * keyboard still finds the accented spelling: "jablko" finds "Jabłko".
912
- */
913
- declare function foldForSearch(value: string): string;
914
889
  /** Whether the consumer supplied groups rather than a flat option list. */
915
890
  export declare function isGrouped(options: SelectOptions): options is readonly SelectOptionGroup[];
916
- /** Normalizes either accepted shape to groups; a flat list becomes one unlabelled group. */
917
- declare function toGroups(options: SelectOptions): readonly SelectOptionGroup[];
918
- /** Drops every option failing `keep`, then every group left empty. */
919
- declare function filterGroups(groups: readonly SelectOptionGroup[], keep: (option: SelectOption) => boolean): SelectOptionGroup[];
920
- /** Trims the groups down to at most `max` options in total, dropping any that no longer fit. */
921
- declare function limitGroups(groups: readonly SelectOptionGroup[], max: number): SelectOptionGroup[];
922
- /** Flattens groups back into a single option list, in the order they were given. */
923
- declare function flattenGroups(groups: readonly SelectOptionGroup[]): SelectOption[];
924
- /**
925
- * Pairs every option with its index into the flattened list, so keyboard
926
- * navigation and selection count options alone while the template still renders
927
- * the headings and rules that sit between them. Groups holding no options are
928
- * left out, so neither a heading nor a rule can render over nothing.
929
- */
930
- declare function toRenderedGroups(groups: readonly SelectOptionGroup[]): RenderedGroup[];
931
891
  /**
932
892
  * Label, hint and validation inputs shared by every form control that renders
933
893
  * `<ea-field-messages>`. Controls with an inline label (checkbox, switch)
@@ -1242,6 +1202,7 @@ export declare class AvatarEditorComponent implements OnDestroy {
1242
1202
  readonly frameHeight: import("@angular/core").Signal<number>;
1243
1203
  /** Lowest zoom the controls reach, down to the whole image fitting the frame when `letterbox` is on. */
1244
1204
  readonly lowestZoom: import("@angular/core").Signal<number>;
1205
+ private readonly hasFillStop;
1245
1206
  /** True when the part of the image inside the frame is narrower than `displayWidth`, so the exported crop would be upscaled. */
1246
1207
  readonly isLowResolution: import("@angular/core").Signal<boolean>;
1247
1208
  /** True when the visible crop is darker than mid-grey; drives the `--on-light` class on the overlay so the "Change photo" affordance stays readable. */
@@ -1261,6 +1222,8 @@ export declare class AvatarEditorComponent implements OnDestroy {
1261
1222
  private readonly originalCaptured;
1262
1223
  private originalImage;
1263
1224
  private originalCropState;
1225
+ private lastFrame;
1226
+ private fillWheelTravel;
1264
1227
  readonly hostClasses: import("@angular/core").Signal<{
1265
1228
  [x: string]: boolean;
1266
1229
  'ea-avatar-editor--has-image': boolean;
@@ -1290,9 +1253,11 @@ export declare class AvatarEditorComponent implements OnDestroy {
1290
1253
  private onTouchMove;
1291
1254
  private onTouchEnd;
1292
1255
  private onWheel;
1256
+ private holdsAtFill;
1293
1257
  onCanvasKeydown(event: KeyboardEvent): void;
1294
1258
  /** Sets the zoom level, clamped to the configured `minZoom`/`maxZoom` range. */
1295
1259
  setZoom(value: number): void;
1260
+ protected stepZoom(value: number): void;
1296
1261
  onZoomInput(event: Event): void;
1297
1262
  /** Clears the loaded image and resets pan/zoom to defaults. */
1298
1263
  removeImage(): void;
@@ -1317,6 +1282,7 @@ export declare class AvatarEditorComponent implements OnDestroy {
1317
1282
  private traceEllipse;
1318
1283
  private getDrawParams;
1319
1284
  private applyZoom;
1285
+ private scaleOffsets;
1320
1286
  private clampOffset;
1321
1287
  private clampAxis;
1322
1288
  private letterboxColor;
@@ -1548,65 +1514,12 @@ interface ChartReferenceLine {
1548
1514
  }
1549
1515
  /** How a line bends between points. */
1550
1516
  type ChartCurve = 'linear' | 'smooth' | 'step';
1551
- /** Number of categorical colors in the `--color-chart-*` palette. */
1552
- declare const CHART_COLOR_COUNT = 8;
1553
- /** Resolves a series' color, falling back to its slot of the chart palette. */
1554
- declare function chartColor(index: number, override?: string): string;
1555
- /** A value axis extended to round numbers, with the ticks drawn along it. */
1556
- interface NiceScale {
1557
- min: number;
1558
- max: number;
1559
- ticks: number[];
1560
- }
1561
- /**
1562
- * Extends `[min, max]` outward to round tick values, about `maxTicks` of them, or more
1563
- * where a gap would otherwise exceed `maxStep`.
1564
- */
1565
- declare function niceScale(min: number, max: number, maxTicks?: number, maxStep?: number): NiceScale;
1566
- /** A plotted point in pixels. */
1567
- interface CurvePoint {
1568
- x: number;
1569
- y: number;
1570
- }
1571
- /** SVG path data tracing a run of points with each curve. */
1572
- declare const CHART_CURVES: Record<ChartCurve, (points: CurvePoint[]) => string>;
1573
- /** Reference lines with a finite value, the only ones a chart can place. */
1574
- declare function plottableReferenceLines(lines: readonly ChartReferenceLine[]): ChartReferenceLine[];
1575
- /** Rough rendered width of `text` in px, for reserving axis room without a layout pass. */
1576
- declare function estimateTextWidth(text: string, fontPx: number): number;
1577
- /** Live size of a chart's host, re-measured on resize and whenever `remeasureOn` changes. */
1578
- interface ChartViewport {
1579
- width: Signal<number>;
1580
- fontSize: Signal<number>;
1581
- }
1582
- /**
1583
- * Measures the host's width and font-size so the chart can lay out its SVG in
1584
- * real pixels, keeping text and stroke widths crisp at every width.
1585
- */
1586
- declare function injectChartViewport(remeasureOn: Signal<unknown>): ChartViewport;
1587
- /** Localized value formatter honouring a consumer's own `formatValue`. */
1588
- declare function injectChartFormatter(formatValue: Signal<((value: number) => string) | null>): Signal<(value: number) => string>;
1589
- /** Keeps a value inside `[min, max]`. */
1590
- declare function clamp(value: number, min: number, max: number): number;
1591
1517
  /**
1592
1518
  * How category or x-axis labels are set: level, at 45 degrees, at 90 degrees, or
1593
1519
  * `auto`, which stays level while the labels fit and turns them 45 then 90 degrees
1594
1520
  * as they crowd.
1595
1521
  */
1596
1522
  type ChartLabelOrientation = 'horizontal' | 'diagonal' | 'vertical' | 'auto';
1597
- declare const CHART_LABEL_ANGLES: Record<Exclude<ChartLabelOrientation, 'auto'>, number>;
1598
- declare const TICK_EXTRA_PX = 2;
1599
- declare const TICK_LABEL_GAP_PX = 2;
1600
- declare const BREAK_CLEARANCE = 6;
1601
- declare const BREAK_HEIGHT = 2.5;
1602
- /** Length of a tick mark below the axis. */
1603
- declare function tickLength(axisPx: number): number;
1604
- /** Room along the axis a label needs: its width when level, a line's height when turned. */
1605
- declare function labelRoom(text: string, angle: number, axisPx: number): number;
1606
- /** Space below the plot for the axis labels, turned to `angle` degrees, and their ticks. */
1607
- declare function labelBand(widest: number, angle: number, axisPx: number, height: number): number;
1608
- /** Baseline of the axis labels below an axis at `axisY`. */
1609
- declare function labelLine(axisY: number, angle: number, axisPx: number): number;
1610
1523
  interface AxisBreak {
1611
1524
  axis: string;
1612
1525
  slashes: string;
@@ -1617,8 +1530,6 @@ interface AxisBreak {
1617
1530
  height: number;
1618
1531
  };
1619
1532
  }
1620
- /** A y-axis line up the plot's left edge, cut where two parallel slashes cross it. */
1621
- declare function axisBreak(x: number, top: number, bottom: number, y: number, axisPx: number): AxisBreak;
1622
1533
  /** Direction the bars extend from the baseline. */
1623
1534
  export type BarChartOrientation = 'vertical' | 'horizontal';
1624
1535
  /**
@@ -4846,55 +4757,6 @@ type EaValidationErrorKey = 'required' | 'email' | 'min' | 'max' | 'minlength' |
4846
4757
  * so a field whose only errors are hidden keeps out of its error state.
4847
4758
  */
4848
4759
  type EaErrorMessages = Partial<Record<string, string | null>>;
4849
- interface ControlErrorStateConfig {
4850
- /** Explicit error text; shown unconditionally and overrides any auto-derived message. */
4851
- errorMsg: Signal<string | null | undefined>;
4852
- /** Per-error-key overrides for auto-derived validation messages. */
4853
- errorMessages: Signal<EaErrorMessages | undefined>;
4854
- /** Field-level `showErrorsOn`; `undefined` falls back to the app-wide `forms` config. */
4855
- showErrorsOn?: Signal<EaShowErrorsOn | undefined>;
4856
- }
4857
- interface ControlErrorState {
4858
- /** Error text to display, or `null` when the field is valid or untouched. */
4859
- readonly error: Signal<string | null>;
4860
- /** Whether the field should render its error state. */
4861
- readonly hasError: Signal<boolean>;
4862
- }
4863
- /**
4864
- * Derives a form control's display error from, in priority order: an explicit
4865
- * `errorMsg`, a consumer `errorMessages` override, then the library's localized
4866
- * default for the active `ValidationErrors` key.
4867
- *
4868
- * Auto-derived messages surface only once the bound control is `invalid &&
4869
- * touched`. Under the default `showErrorsOn: 'change'`, a new one waits while
4870
- * focus is still inside the field, until the user leaves it or submits the
4871
- * form, so nothing is flagged mid-edit, and a field the user only passed
4872
- * through, leaving it without changing it, stays quiet until they change it or
4873
- * the form is submitted, so tabbing past an empty required field never flags
4874
- * it. `'blur'` drops the second hold and `'touch'` drops both. A message
4875
- * already showing follows the value as it is typed and clears the moment it is
4876
- * fixed. A message revealed by a pointer press moving focus away waits until
4877
- * that press has landed its click, in every mode. The control arrives as a signal
4878
- * so callers decide how it is resolved: from the host's own `NgControl` (CVA
4879
- * components) or from projected content (`<ea-form-field>`).
4880
- */
4881
- declare function controlErrorStateFrom(control: Signal<AbstractControl | null>, config: ControlErrorStateConfig): ControlErrorState;
4882
- /**
4883
- * `controlErrorStateFrom` for a component hosting its own form directive.
4884
- *
4885
- * The bound `NgControl` is resolved lazily from the injector rather than via
4886
- * constructor injection: a control that provides `NG_VALUE_ACCESSOR` cannot
4887
- * also inject its own `NgControl` directly without a circular dependency.
4888
- * `afterNextRender` defers resolution to the browser, after the host directive
4889
- * (`formControl` / `ngModel`) exists, so the server render simply shows no
4890
- * error (an untouched control never does).
4891
- *
4892
- * The lookup is `self`-scoped to the host element. Without it the search walks
4893
- * up the element injectors, so a field rendered inside another bound field
4894
- * (the checkboxes in a multi-select's option list, say) would adopt the outer
4895
- * control and repeat its error message on every row.
4896
- */
4897
- declare function injectControlErrorState(config: ControlErrorStateConfig): ControlErrorState;
4898
4760
  /** Visual size of the file uploader. */
4899
4761
  export type FileUploaderSize = EaSize;
4900
4762
  /** Presentation of the uploader: a drag-and-drop zone, or a compact picker button. */
@@ -5145,15 +5007,6 @@ interface TypedPlaceholder {
5145
5007
  /** Whether characters are still arriving; the cursor blinks only once they stop. */
5146
5008
  readonly typing: Signal<boolean>;
5147
5009
  }
5148
- /**
5149
- * Types `hints` into a field's placeholder one character at a time, holds each
5150
- * whole hint, then clears it and types the next, looping. Under
5151
- * `prefers-reduced-motion: reduce` it swaps whole hints instead and never
5152
- * animates. It starts in the browser after the first render, restarts when the
5153
- * hints change, and clears its timer on destroy. The timers run outside the
5154
- * zone so the endless loop never holds the app unstable.
5155
- */
5156
- declare function injectTypedPlaceholder(hints: Signal<readonly string[]>): TypedPlaceholder;
5157
5010
  /** Visual size of the input. */
5158
5011
  export type InputSize = EaSize;
5159
5012
  /** HTML `type` attribute applied to the underlying `<input>`. */