@eagami/ui 5.57.0 → 5.58.0
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/fesm2022/eagami-ui.mjs +585 -150
- package/fesm2022/eagami-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/src/styles/_mixins.scss +49 -0
- package/types/eagami-ui.d.ts +114 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eagami/ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.58.0",
|
|
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",
|
package/src/styles/_mixins.scss
CHANGED
|
@@ -191,6 +191,55 @@ $target-size-min: 24px;
|
|
|
191
191
|
user-select: none;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
+
// Floating surface of a menu-like list, sized in em so it scales with the host
|
|
195
|
+
// component's `size`. Positioned by the host `<ea-popover>`; the background is
|
|
196
|
+
// the caller's to set.
|
|
197
|
+
@mixin menu-surface {
|
|
198
|
+
overflow-y: auto;
|
|
199
|
+
min-width: 10em;
|
|
200
|
+
padding: 0.25em 0;
|
|
201
|
+
border: var(--border-width-thin) solid var(--color-border-default);
|
|
202
|
+
border-radius: var(--radius-md);
|
|
203
|
+
box-shadow: var(--shadow-lg);
|
|
204
|
+
@include elevated-surface-border;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Row of a menu-like list. `$disabled` is the selector marking a row that cannot
|
|
208
|
+
// be activated, which is left out of the hover and focus highlight.
|
|
209
|
+
@mixin menu-row($disabled) {
|
|
210
|
+
display: flex;
|
|
211
|
+
align-items: center;
|
|
212
|
+
gap: 0.5em;
|
|
213
|
+
width: 100%;
|
|
214
|
+
padding: 0.5em 0.75em;
|
|
215
|
+
// Buttons do not inherit font-size by default, so take the list's; every
|
|
216
|
+
// dimension here is in em and scales with it
|
|
217
|
+
font-size: inherit;
|
|
218
|
+
text-align: start;
|
|
219
|
+
font-family: var(--font-family-sans);
|
|
220
|
+
border: none;
|
|
221
|
+
background: transparent;
|
|
222
|
+
color: var(--color-text-primary);
|
|
223
|
+
cursor: pointer;
|
|
224
|
+
transition: var(--transition-colors);
|
|
225
|
+
|
|
226
|
+
// state-hover (a translucent wash) reads on the elevated menu surface in both
|
|
227
|
+
// themes; bg-muted collapses onto that surface's shade in dark mode.
|
|
228
|
+
&:hover:not(#{$disabled}),
|
|
229
|
+
&:focus-visible:not(#{$disabled}) {
|
|
230
|
+
background-color: var(--color-state-hover);
|
|
231
|
+
|
|
232
|
+
@media (forced-colors: active) {
|
|
233
|
+
background-color: Highlight;
|
|
234
|
+
color: HighlightText;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
&:focus-visible {
|
|
239
|
+
outline: none;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
194
243
|
// Strips the geometry the UA stylesheet forces on a `[popover]` element (a
|
|
195
244
|
// centred, viewport-filling, scrollable box) so a surface promoted into the top
|
|
196
245
|
// layer keeps the box it has in the normal layer. Colour and spacing chrome
|
package/types/eagami-ui.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ export interface EagamiMessages {
|
|
|
56
56
|
};
|
|
57
57
|
breadcrumbs: {
|
|
58
58
|
label: string;
|
|
59
|
+
showHidden: string;
|
|
59
60
|
};
|
|
60
61
|
chart: {
|
|
61
62
|
/** Announced role of a chart's plot, in place of the generic "group". */
|
|
@@ -1683,6 +1684,8 @@ export declare class BarChartComponent {
|
|
|
1683
1684
|
export type BreadcrumbsSeparator = 'chevron' | 'slash';
|
|
1684
1685
|
/** Visual size of the breadcrumb trail. */
|
|
1685
1686
|
export type BreadcrumbsSize = EaSize;
|
|
1687
|
+
/** What a trail wider than its container does: move levels into a menu, or scroll sideways. */
|
|
1688
|
+
export type BreadcrumbsOverflow = 'menu' | 'scroll';
|
|
1686
1689
|
/** Single entry in a breadcrumb trail. */
|
|
1687
1690
|
export interface BreadcrumbItem {
|
|
1688
1691
|
label: string;
|
|
@@ -1695,24 +1698,77 @@ export interface BreadcrumbClickEvent {
|
|
|
1695
1698
|
index: number;
|
|
1696
1699
|
event: MouseEvent;
|
|
1697
1700
|
}
|
|
1701
|
+
/** A breadcrumb paired with its position in the full trail. */
|
|
1702
|
+
interface IndexedBreadcrumb {
|
|
1703
|
+
item: BreadcrumbItem;
|
|
1704
|
+
index: number;
|
|
1705
|
+
}
|
|
1698
1706
|
/**
|
|
1699
1707
|
* Navigation trail that shows the user's location within a hierarchy. Items
|
|
1700
1708
|
* with an `href` render as links, others render as buttons; the final item is
|
|
1701
|
-
* always treated as the current page and is non-interactive.
|
|
1709
|
+
* always treated as the current page and is non-interactive. Levels that go
|
|
1710
|
+
* past `maxItems`, or that the container has no room for, move into a menu
|
|
1711
|
+
* behind a button after the first item, earliest levels first, and return to
|
|
1712
|
+
* the trail as room opens up.
|
|
1702
1713
|
*/
|
|
1703
1714
|
export declare class BreadcrumbsComponent {
|
|
1704
|
-
|
|
1715
|
+
protected readonly i18n: EagamiI18nService;
|
|
1716
|
+
private readonly popover;
|
|
1717
|
+
protected readonly expandEl: import("@angular/core").Signal<ElementRef<HTMLButtonElement> | undefined>;
|
|
1718
|
+
private readonly menuEl;
|
|
1719
|
+
private readonly sizerEl;
|
|
1720
|
+
private readonly sizerItemEls;
|
|
1721
|
+
private readonly sizerExpandEl;
|
|
1705
1722
|
readonly items: import("@angular/core").InputSignal<BreadcrumbItem[]>;
|
|
1706
1723
|
readonly separator: import("@angular/core").InputSignal<BreadcrumbsSeparator>;
|
|
1707
1724
|
/** Visual size of the breadcrumb trail. */
|
|
1708
1725
|
readonly size: import("@angular/core").InputSignal<EaSize>;
|
|
1726
|
+
/**
|
|
1727
|
+
* Most items shown in the trail at once. The earliest levels after the first
|
|
1728
|
+
* item move into a menu to stay within it. Never fewer than two.
|
|
1729
|
+
*/
|
|
1730
|
+
readonly maxItems: import("@angular/core").InputSignal<number | undefined>;
|
|
1731
|
+
/**
|
|
1732
|
+
* What happens when the trail is wider than its container. `menu` moves as
|
|
1733
|
+
* many levels as it takes into a menu, earliest first, keeping the first and
|
|
1734
|
+
* last item in the trail. `scroll` keeps every level and scrolls sideways.
|
|
1735
|
+
*/
|
|
1736
|
+
readonly overflow: import("@angular/core").InputSignal<BreadcrumbsOverflow>;
|
|
1709
1737
|
readonly ariaLabel: import("@angular/core").InputSignal<string | undefined>;
|
|
1710
1738
|
/** Fires when a non-disabled, non-final breadcrumb is activated. */
|
|
1711
1739
|
readonly clicked: import("@angular/core").OutputEmitterRef<BreadcrumbClickEvent>;
|
|
1740
|
+
protected readonly menuId: string;
|
|
1741
|
+
protected readonly menuOpen: import("@angular/core").WritableSignal<boolean>;
|
|
1742
|
+
private menuPinned;
|
|
1743
|
+
private readonly menuFocusPending;
|
|
1744
|
+
/** Levels the container has no room for, counted from the one after the first item. */
|
|
1745
|
+
private readonly crowdedOut;
|
|
1712
1746
|
/** Accessible label for the breadcrumb nav, falling back to the active locale. */
|
|
1713
1747
|
readonly resolvedAriaLabel: import("@angular/core").Signal<string>;
|
|
1748
|
+
private readonly indexed;
|
|
1749
|
+
private readonly menuCount;
|
|
1750
|
+
/** Items in the trail, each carrying its index into the full list. */
|
|
1751
|
+
protected readonly crumbs: import("@angular/core").Signal<IndexedBreadcrumb[]>;
|
|
1752
|
+
/** Items moved into the menu, in trail order. */
|
|
1753
|
+
protected readonly menuCrumbs: import("@angular/core").Signal<IndexedBreadcrumb[]>;
|
|
1754
|
+
constructor();
|
|
1714
1755
|
isLast(index: number): boolean;
|
|
1715
1756
|
handleClick(item: BreadcrumbItem, index: number, event: MouseEvent): void;
|
|
1757
|
+
protected toggleMenu(): void;
|
|
1758
|
+
protected handleExpandKeydown(event: KeyboardEvent): void;
|
|
1759
|
+
protected handleExpandEnter(): void;
|
|
1760
|
+
protected handleHoverLeave(event: MouseEvent): void;
|
|
1761
|
+
protected handleMenuClick(crumb: IndexedBreadcrumb, event: MouseEvent): void;
|
|
1762
|
+
protected handleMenuKeydown(event: KeyboardEvent): void;
|
|
1763
|
+
protected closeMenu(restoreFocus?: boolean): void;
|
|
1764
|
+
private openMenu;
|
|
1765
|
+
private menuItems;
|
|
1766
|
+
/**
|
|
1767
|
+
* Works out how many levels the container has no room for. The widths come
|
|
1768
|
+
* from the sizer, which lays out the whole trail whatever is collapsed, so
|
|
1769
|
+
* the answer never depends on what is currently in the menu.
|
|
1770
|
+
*/
|
|
1771
|
+
private fit;
|
|
1716
1772
|
static ɵfac: i0.ɵɵFactoryDeclaration<BreadcrumbsComponent, never>;
|
|
1717
1773
|
static ɵcmp: i0.ɵɵComponentDeclaration<BreadcrumbsComponent, "ea-breadcrumbs", never, {
|
|
1718
1774
|
"items": {
|
|
@@ -1730,6 +1786,16 @@ export declare class BreadcrumbsComponent {
|
|
|
1730
1786
|
"required": false;
|
|
1731
1787
|
"isSignal": true;
|
|
1732
1788
|
};
|
|
1789
|
+
"maxItems": {
|
|
1790
|
+
"alias": "maxItems";
|
|
1791
|
+
"required": false;
|
|
1792
|
+
"isSignal": true;
|
|
1793
|
+
};
|
|
1794
|
+
"overflow": {
|
|
1795
|
+
"alias": "overflow";
|
|
1796
|
+
"required": false;
|
|
1797
|
+
"isSignal": true;
|
|
1798
|
+
};
|
|
1733
1799
|
"ariaLabel": {
|
|
1734
1800
|
"alias": "aria-label";
|
|
1735
1801
|
"required": false;
|
|
@@ -3504,6 +3570,11 @@ export type DatePickerFormat = 'short' | 'medium' | 'long';
|
|
|
3504
3570
|
export type DatePickerWeekStart = 0 | 1;
|
|
3505
3571
|
/** Value accepted via `writeValue`: a `Date`, ISO/parseable string, or `null`. */
|
|
3506
3572
|
export type DatePickerValue = Date | string | null;
|
|
3573
|
+
/** Span of dates that includes both its start and its end. */
|
|
3574
|
+
export interface DatePickerDateRange {
|
|
3575
|
+
start: Date;
|
|
3576
|
+
end: Date;
|
|
3577
|
+
}
|
|
3507
3578
|
interface CalendarDay {
|
|
3508
3579
|
date: Date;
|
|
3509
3580
|
day: number;
|
|
@@ -3517,10 +3588,10 @@ interface CalendarDay {
|
|
|
3517
3588
|
* Date field with a calendar popover. The date can be typed straight into the
|
|
3518
3589
|
* field in any reasonable shape (ISO, all-numeric in the locale's field order,
|
|
3519
3590
|
* or with a month name) and is rewritten in the configured `format` on commit.
|
|
3520
|
-
* Supports `min`/`max` bounds,
|
|
3521
|
-
* via `Intl.DateTimeFormat`, and full keyboard
|
|
3522
|
-
* PageUp/PageDown, Home/End, Enter, Escape). Integrates
|
|
3523
|
-
* `ControlValueAccessor`.
|
|
3591
|
+
* Supports `min`/`max` bounds, disabled weekdays and dates, configurable week
|
|
3592
|
+
* start, locale-aware formatting via `Intl.DateTimeFormat`, and full keyboard
|
|
3593
|
+
* navigation (arrows, PageUp/PageDown, Home/End, Enter, Escape). Integrates
|
|
3594
|
+
* with Angular forms via `ControlValueAccessor`.
|
|
3524
3595
|
*/
|
|
3525
3596
|
export declare class DatePickerComponent implements ControlValueAccessor {
|
|
3526
3597
|
protected readonly fieldEl: import("@angular/core").Signal<ElementRef<HTMLElement> | undefined>;
|
|
@@ -3544,6 +3615,10 @@ export declare class DatePickerComponent implements ControlValueAccessor {
|
|
|
3544
3615
|
readonly errorMessages: import("@angular/core").InputSignal<Partial<Record<string, string>> | undefined>;
|
|
3545
3616
|
readonly minDate: import("@angular/core").InputSignal<Date | null>;
|
|
3546
3617
|
readonly maxDate: import("@angular/core").InputSignal<Date | null>;
|
|
3618
|
+
/** Weekdays that cannot be picked, numbered as `Date.getDay()` does: 0 for Sunday through 6 for Saturday. */
|
|
3619
|
+
readonly disabledWeekdays: import("@angular/core").InputSignal<readonly number[]>;
|
|
3620
|
+
/** Individual dates and ranges that cannot be picked, on top of the `minDate` and `maxDate` bounds. */
|
|
3621
|
+
readonly disabledDates: import("@angular/core").InputSignal<readonly (Date | DatePickerDateRange)[]>;
|
|
3547
3622
|
readonly format: import("@angular/core").InputSignal<DatePickerFormat>;
|
|
3548
3623
|
readonly weekStartsOn: import("@angular/core").InputSignal<DatePickerWeekStart>;
|
|
3549
3624
|
readonly locale: import("@angular/core").InputSignal<string | undefined>;
|
|
@@ -3632,7 +3707,8 @@ export declare class DatePickerComponent implements ControlValueAccessor {
|
|
|
3632
3707
|
protected handleInputKeydown(event: KeyboardEvent): void;
|
|
3633
3708
|
private commitDraft;
|
|
3634
3709
|
private applyValue;
|
|
3635
|
-
private
|
|
3710
|
+
private isUnavailable;
|
|
3711
|
+
private covers;
|
|
3636
3712
|
handleGridKeydown(event: KeyboardEvent): void;
|
|
3637
3713
|
/** Called by `<ea-popover>` when the user clicks outside the picker. */
|
|
3638
3714
|
onPopoverCloseRequested(): void;
|
|
@@ -3709,6 +3785,16 @@ export declare class DatePickerComponent implements ControlValueAccessor {
|
|
|
3709
3785
|
"required": false;
|
|
3710
3786
|
"isSignal": true;
|
|
3711
3787
|
};
|
|
3788
|
+
"disabledWeekdays": {
|
|
3789
|
+
"alias": "disabledWeekdays";
|
|
3790
|
+
"required": false;
|
|
3791
|
+
"isSignal": true;
|
|
3792
|
+
};
|
|
3793
|
+
"disabledDates": {
|
|
3794
|
+
"alias": "disabledDates";
|
|
3795
|
+
"required": false;
|
|
3796
|
+
"isSignal": true;
|
|
3797
|
+
};
|
|
3712
3798
|
"format": {
|
|
3713
3799
|
"alias": "format";
|
|
3714
3800
|
"required": false;
|
|
@@ -7777,6 +7863,7 @@ export declare class TabComponent implements OnInit, OnDestroy {
|
|
|
7777
7863
|
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
7778
7864
|
readonly id: import("@angular/core").InputSignal<string>;
|
|
7779
7865
|
readonly isActive: import("@angular/core").Signal<boolean>;
|
|
7866
|
+
protected readonly vertical: import("@angular/core").Signal<boolean>;
|
|
7780
7867
|
ngOnInit(): void;
|
|
7781
7868
|
ngOnDestroy(): void;
|
|
7782
7869
|
static ɵfac: i0.ɵɵFactoryDeclaration<TabComponent, never>;
|
|
@@ -7807,6 +7894,8 @@ export declare class TabComponent implements OnInit, OnDestroy {
|
|
|
7807
7894
|
export type TabsVariant = 'underline' | 'filled';
|
|
7808
7895
|
/** Visual size of the tabs. */
|
|
7809
7896
|
export type TabsSize = EaSize;
|
|
7897
|
+
/** Whether the tab bar runs along the top of the panel or down its side. */
|
|
7898
|
+
export type TabsOrientation = 'horizontal' | 'vertical';
|
|
7810
7899
|
/**
|
|
7811
7900
|
* Tab bar paired with content panels. Child `ea-tab` components register
|
|
7812
7901
|
* themselves automatically and the active panel is shown based on the
|
|
@@ -7817,6 +7906,8 @@ export declare class TabsComponent {
|
|
|
7817
7906
|
readonly registeredTabs: import("@angular/core").WritableSignal<TabComponent[]>;
|
|
7818
7907
|
readonly variant: import("@angular/core").InputSignal<TabsVariant>;
|
|
7819
7908
|
readonly size: import("@angular/core").InputSignal<EaSize>;
|
|
7909
|
+
/** Places the tab bar above the panel, or in a column beside it. */
|
|
7910
|
+
readonly orientation: import("@angular/core").InputSignal<TabsOrientation>;
|
|
7820
7911
|
/** Accessible name for the tablist, announced by screen readers. */
|
|
7821
7912
|
readonly ariaLabel: import("@angular/core").InputSignal<string | undefined>;
|
|
7822
7913
|
readonly activeTab: import("@angular/core").ModelSignal<string>;
|
|
@@ -7841,6 +7932,11 @@ export declare class TabsComponent {
|
|
|
7841
7932
|
"required": false;
|
|
7842
7933
|
"isSignal": true;
|
|
7843
7934
|
};
|
|
7935
|
+
"orientation": {
|
|
7936
|
+
"alias": "orientation";
|
|
7937
|
+
"required": false;
|
|
7938
|
+
"isSignal": true;
|
|
7939
|
+
};
|
|
7844
7940
|
"ariaLabel": {
|
|
7845
7941
|
"alias": "ariaLabel";
|
|
7846
7942
|
"required": false;
|
|
@@ -8165,8 +8261,8 @@ export interface TextareaSelection {
|
|
|
8165
8261
|
}
|
|
8166
8262
|
/**
|
|
8167
8263
|
* Multiline text field that mirrors the `ea-input` API. Supports configurable
|
|
8168
|
-
* `resize` direction
|
|
8169
|
-
* `getSelection()` and `insertText()`, and integrates with Angular
|
|
8264
|
+
* `resize` direction, `maxlength` and a character count, exposes the caret
|
|
8265
|
+
* through `getSelection()` and `insertText()`, and integrates with Angular
|
|
8170
8266
|
* forms via `ControlValueAccessor`.
|
|
8171
8267
|
*/
|
|
8172
8268
|
export declare class TextareaComponent implements ControlValueAccessor {
|
|
@@ -8189,6 +8285,8 @@ export declare class TextareaComponent implements ControlValueAccessor {
|
|
|
8189
8285
|
readonly required: import("@angular/core").InputSignal<boolean>;
|
|
8190
8286
|
readonly resize: import("@angular/core").InputSignal<TextareaResize>;
|
|
8191
8287
|
readonly maxlength: import("@angular/core").InputSignal<number | undefined>;
|
|
8288
|
+
/** Shows the number of characters typed below the field, against `maxlength` when one is set. */
|
|
8289
|
+
readonly showCount: import("@angular/core").InputSignal<boolean>;
|
|
8192
8290
|
/** Optional pixel ceiling for the textarea's height. Beyond it, the inner
|
|
8193
8291
|
* field scrolls vertically instead of growing. */
|
|
8194
8292
|
readonly maxHeight: import("@angular/core").InputSignal<number | undefined>;
|
|
@@ -8211,6 +8309,8 @@ export declare class TextareaComponent implements ControlValueAccessor {
|
|
|
8211
8309
|
readonly hasError: import("@angular/core").Signal<boolean>;
|
|
8212
8310
|
readonly showError: import("@angular/core").Signal<boolean>;
|
|
8213
8311
|
readonly showHint: import("@angular/core").Signal<boolean>;
|
|
8312
|
+
protected readonly countText: import("@angular/core").Signal<string>;
|
|
8313
|
+
protected readonly describedBy: import("@angular/core").Signal<string | null>;
|
|
8214
8314
|
readonly wrapperClasses: import("@angular/core").Signal<{
|
|
8215
8315
|
[x: string]: boolean;
|
|
8216
8316
|
'ea-textarea-wrapper--error': boolean;
|
|
@@ -8313,6 +8413,11 @@ export declare class TextareaComponent implements ControlValueAccessor {
|
|
|
8313
8413
|
"required": false;
|
|
8314
8414
|
"isSignal": true;
|
|
8315
8415
|
};
|
|
8416
|
+
"showCount": {
|
|
8417
|
+
"alias": "showCount";
|
|
8418
|
+
"required": false;
|
|
8419
|
+
"isSignal": true;
|
|
8420
|
+
};
|
|
8316
8421
|
"maxHeight": {
|
|
8317
8422
|
"alias": "maxHeight";
|
|
8318
8423
|
"required": false;
|