@4sh/ui-kit 0.1.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/LICENSE +201 -0
- package/NOTICE +7 -0
- package/README.md +229 -0
- package/fesm2022/4sh-ui-kit-forms.mjs +501 -0
- package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-motion.mjs +155 -0
- package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-overlay.mjs +61 -0
- package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-theming.mjs +120 -0
- package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-types.mjs +12 -0
- package/fesm2022/4sh-ui-kit-types.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-accordion.mjs +244 -0
- package/fesm2022/4sh-ui-kit-ui-accordion.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-alert.mjs +160 -0
- package/fesm2022/4sh-ui-kit-ui-alert.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-autocomplete.mjs +926 -0
- package/fesm2022/4sh-ui-kit-ui-autocomplete.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-avatar-group.mjs +34 -0
- package/fesm2022/4sh-ui-kit-ui-avatar-group.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-avatar.mjs +122 -0
- package/fesm2022/4sh-ui-kit-ui-avatar.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-badge.mjs +95 -0
- package/fesm2022/4sh-ui-kit-ui-badge.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-breadcrumb.mjs +190 -0
- package/fesm2022/4sh-ui-kit-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-button-split.mjs +151 -0
- package/fesm2022/4sh-ui-kit-ui-button-split.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-button.mjs +222 -0
- package/fesm2022/4sh-ui-kit-ui-button.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-card.mjs +164 -0
- package/fesm2022/4sh-ui-kit-ui-card.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-checkbox.mjs +118 -0
- package/fesm2022/4sh-ui-kit-ui-checkbox.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-chip.mjs +205 -0
- package/fesm2022/4sh-ui-kit-ui-chip.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-context-menu.mjs +219 -0
- package/fesm2022/4sh-ui-kit-ui-context-menu.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-datepicker.mjs +1508 -0
- package/fesm2022/4sh-ui-kit-ui-datepicker.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-drawer.mjs +300 -0
- package/fesm2022/4sh-ui-kit-ui-drawer.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-empty-state.mjs +148 -0
- package/fesm2022/4sh-ui-kit-ui-empty-state.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-field.mjs +102 -0
- package/fesm2022/4sh-ui-kit-ui-field.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-file-upload.mjs +568 -0
- package/fesm2022/4sh-ui-kit-ui-file-upload.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-helper.mjs +85 -0
- package/fesm2022/4sh-ui-kit-ui-helper.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-icon.mjs +98 -0
- package/fesm2022/4sh-ui-kit-ui-icon.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-image.mjs +201 -0
- package/fesm2022/4sh-ui-kit-ui-image.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input-group.mjs +119 -0
- package/fesm2022/4sh-ui-kit-ui-input-group.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input-mask.mjs +125 -0
- package/fesm2022/4sh-ui-kit-ui-input-mask.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input-number.mjs +234 -0
- package/fesm2022/4sh-ui-kit-ui-input-number.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input-otp.mjs +288 -0
- package/fesm2022/4sh-ui-kit-ui-input-otp.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input-tags.mjs +679 -0
- package/fesm2022/4sh-ui-kit-ui-input-tags.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input.mjs +121 -0
- package/fesm2022/4sh-ui-kit-ui-input.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-label.mjs +61 -0
- package/fesm2022/4sh-ui-kit-ui-label.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-link.mjs +147 -0
- package/fesm2022/4sh-ui-kit-ui-link.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-menu.mjs +484 -0
- package/fesm2022/4sh-ui-kit-ui-menu.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-modal.mjs +555 -0
- package/fesm2022/4sh-ui-kit-ui-modal.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-nudger.mjs +168 -0
- package/fesm2022/4sh-ui-kit-ui-nudger.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-paginator.mjs +245 -0
- package/fesm2022/4sh-ui-kit-ui-paginator.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-popover.mjs +296 -0
- package/fesm2022/4sh-ui-kit-ui-popover.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-progress-bar.mjs +124 -0
- package/fesm2022/4sh-ui-kit-ui-progress-bar.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-radio.mjs +92 -0
- package/fesm2022/4sh-ui-kit-ui-radio.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-rating.mjs +185 -0
- package/fesm2022/4sh-ui-kit-ui-rating.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-read-only.mjs +146 -0
- package/fesm2022/4sh-ui-kit-ui-read-only.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-segment-control.mjs +386 -0
- package/fesm2022/4sh-ui-kit-ui-segment-control.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-select.mjs +868 -0
- package/fesm2022/4sh-ui-kit-ui-select.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-separator.mjs +77 -0
- package/fesm2022/4sh-ui-kit-ui-separator.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-sidebar.mjs +577 -0
- package/fesm2022/4sh-ui-kit-ui-sidebar.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-skeleton.mjs +81 -0
- package/fesm2022/4sh-ui-kit-ui-skeleton.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-slider.mjs +340 -0
- package/fesm2022/4sh-ui-kit-ui-slider.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-spinner.mjs +132 -0
- package/fesm2022/4sh-ui-kit-ui-spinner.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-stepper.mjs +389 -0
- package/fesm2022/4sh-ui-kit-ui-stepper.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-table.mjs +1406 -0
- package/fesm2022/4sh-ui-kit-ui-table.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-tabs.mjs +503 -0
- package/fesm2022/4sh-ui-kit-ui-tabs.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-tag.mjs +84 -0
- package/fesm2022/4sh-ui-kit-ui-tag.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-textarea.mjs +119 -0
- package/fesm2022/4sh-ui-kit-ui-textarea.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-toast.mjs +424 -0
- package/fesm2022/4sh-ui-kit-ui-toast.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-toggle.mjs +120 -0
- package/fesm2022/4sh-ui-kit-ui-toggle.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-tooltip.mjs +445 -0
- package/fesm2022/4sh-ui-kit-ui-tooltip.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit.mjs +16 -0
- package/fesm2022/4sh-ui-kit.mjs.map +1 -0
- package/package.json +287 -0
- package/styles/base/_base.scss +19 -0
- package/styles/base/_motion.scss +144 -0
- package/styles/base/_typography.scss +99 -0
- package/styles/generated/_tokens-breakpoint.scss +8 -0
- package/styles/generated/_tokens-metrics.scss +37 -0
- package/styles/generated/_tokens-primitives.scss +284 -0
- package/styles/generated/_tokens-responsive.scss +99 -0
- package/styles/generated/_tokens-semantics.scss +1274 -0
- package/styles/generated/_tokens-styles.scss +35 -0
- package/styles/generated/_tokens-transitions.scss +11 -0
- package/styles/generated/_tokens-typography.scss +14 -0
- package/styles/generated/_tokens.scss +10 -0
- package/styles/index.scss +25 -0
- package/styles/settings/_ui-config.scss +67 -0
- package/styles/utils/_functions.scss +67 -0
- package/styles/utils/_helpers.scss +129 -0
- package/styles/utils/_mixins.scss +186 -0
- package/styles/utils/_motion.scss +47 -0
- package/styles/utils/_overlay.scss +26 -0
- package/styles/utils.scss +15 -0
- package/styles.css +1 -0
- package/types/4sh-ui-kit-forms.d.ts +259 -0
- package/types/4sh-ui-kit-motion.d.ts +111 -0
- package/types/4sh-ui-kit-overlay.d.ts +31 -0
- package/types/4sh-ui-kit-theming.d.ts +54 -0
- package/types/4sh-ui-kit-types.d.ts +13 -0
- package/types/4sh-ui-kit-ui-accordion.d.ts +140 -0
- package/types/4sh-ui-kit-ui-alert.d.ts +89 -0
- package/types/4sh-ui-kit-ui-autocomplete.d.ts +411 -0
- package/types/4sh-ui-kit-ui-avatar-group.d.ts +17 -0
- package/types/4sh-ui-kit-ui-avatar.d.ts +55 -0
- package/types/4sh-ui-kit-ui-badge.d.ts +38 -0
- package/types/4sh-ui-kit-ui-breadcrumb.d.ts +131 -0
- package/types/4sh-ui-kit-ui-button-split.d.ts +102 -0
- package/types/4sh-ui-kit-ui-button.d.ts +91 -0
- package/types/4sh-ui-kit-ui-card.d.ts +102 -0
- package/types/4sh-ui-kit-ui-checkbox.d.ts +54 -0
- package/types/4sh-ui-kit-ui-chip.d.ts +114 -0
- package/types/4sh-ui-kit-ui-context-menu.d.ts +105 -0
- package/types/4sh-ui-kit-ui-datepicker.d.ts +539 -0
- package/types/4sh-ui-kit-ui-drawer.d.ts +147 -0
- package/types/4sh-ui-kit-ui-empty-state.d.ts +93 -0
- package/types/4sh-ui-kit-ui-field.d.ts +53 -0
- package/types/4sh-ui-kit-ui-file-upload.d.ts +268 -0
- package/types/4sh-ui-kit-ui-helper.d.ts +46 -0
- package/types/4sh-ui-kit-ui-icon.d.ts +69 -0
- package/types/4sh-ui-kit-ui-image.d.ts +88 -0
- package/types/4sh-ui-kit-ui-input-group.d.ts +54 -0
- package/types/4sh-ui-kit-ui-input-mask.d.ts +63 -0
- package/types/4sh-ui-kit-ui-input-number.d.ts +96 -0
- package/types/4sh-ui-kit-ui-input-otp.d.ts +130 -0
- package/types/4sh-ui-kit-ui-input-tags.d.ts +350 -0
- package/types/4sh-ui-kit-ui-input.d.ts +78 -0
- package/types/4sh-ui-kit-ui-label.d.ts +36 -0
- package/types/4sh-ui-kit-ui-link.d.ts +72 -0
- package/types/4sh-ui-kit-ui-menu.d.ts +235 -0
- package/types/4sh-ui-kit-ui-modal.d.ts +241 -0
- package/types/4sh-ui-kit-ui-nudger.d.ts +79 -0
- package/types/4sh-ui-kit-ui-paginator.d.ts +150 -0
- package/types/4sh-ui-kit-ui-popover.d.ts +125 -0
- package/types/4sh-ui-kit-ui-progress-bar.d.ts +82 -0
- package/types/4sh-ui-kit-ui-radio.d.ts +44 -0
- package/types/4sh-ui-kit-ui-rating.d.ts +90 -0
- package/types/4sh-ui-kit-ui-read-only.d.ts +70 -0
- package/types/4sh-ui-kit-ui-segment-control.d.ts +184 -0
- package/types/4sh-ui-kit-ui-select.d.ts +392 -0
- package/types/4sh-ui-kit-ui-separator.d.ts +43 -0
- package/types/4sh-ui-kit-ui-sidebar.d.ts +358 -0
- package/types/4sh-ui-kit-ui-skeleton.d.ts +52 -0
- package/types/4sh-ui-kit-ui-slider.d.ts +127 -0
- package/types/4sh-ui-kit-ui-spinner.d.ts +67 -0
- package/types/4sh-ui-kit-ui-stepper.d.ts +220 -0
- package/types/4sh-ui-kit-ui-table.d.ts +570 -0
- package/types/4sh-ui-kit-ui-tabs.d.ts +225 -0
- package/types/4sh-ui-kit-ui-tag.d.ts +46 -0
- package/types/4sh-ui-kit-ui-textarea.d.ts +61 -0
- package/types/4sh-ui-kit-ui-toast.d.ts +247 -0
- package/types/4sh-ui-kit-ui-toggle.d.ts +67 -0
- package/types/4sh-ui-kit-ui-tooltip.d.ts +167 -0
- package/types/4sh-ui-kit.d.ts +4 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ElementRef, TemplateRef } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/** Identifier of a tab / panel pair (matched against the container `value`). */
|
|
5
|
+
type UiTabValue = string | number;
|
|
6
|
+
/** Layout axis of the tab list. */
|
|
7
|
+
type UiTabsOrientation = 'horizontal' | 'vertical';
|
|
8
|
+
/** Position of a tab's icon relative to its label. */
|
|
9
|
+
type UiTabIconPos = 'left' | 'right';
|
|
10
|
+
/** Payload emitted when the active tab changes. */
|
|
11
|
+
interface UiTabsChangeEvent {
|
|
12
|
+
/** Value of the tab that became active. */
|
|
13
|
+
value: UiTabValue;
|
|
14
|
+
/** Originating DOM event (click / keyboard / focus). */
|
|
15
|
+
originalEvent: Event;
|
|
16
|
+
}
|
|
17
|
+
/** @ignore Measured geometry of the active-tab indicator bar. */
|
|
18
|
+
interface ActiveBarMetrics {
|
|
19
|
+
/** Offset along the main axis (px) from the tab list origin. */
|
|
20
|
+
offset: number;
|
|
21
|
+
/** Length along the main axis (px): tab width (horizontal) or height (vertical). */
|
|
22
|
+
length: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* ui-tab , a single tab button inside a {@link UiTabList}.
|
|
26
|
+
*
|
|
27
|
+
* Renders a real native `<button role="tab">` (the `ui-tab` host is
|
|
28
|
+
* `display: contents`, so the button sits directly inside the `role="tablist"`).
|
|
29
|
+
* Keyboard roving and the active indicator are driven by the list; this element
|
|
30
|
+
* only reports its value/state and activates on click or `selectOnFocus`.
|
|
31
|
+
*
|
|
32
|
+
* Declared before {@link UiTabList} / {@link UiTabs} so their content queries
|
|
33
|
+
* can reference it without a temporal-dead-zone error at class-definition time.
|
|
34
|
+
*/
|
|
35
|
+
declare class UiTab {
|
|
36
|
+
/** Identifier of this tab (matched against the container `value`). */
|
|
37
|
+
value: _angular_core.InputSignal<UiTabValue>;
|
|
38
|
+
/** Disable the tab (not selectable, skipped by keyboard navigation). */
|
|
39
|
+
disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
40
|
+
/** Optional leading (or trailing) icon name. */
|
|
41
|
+
icon: _angular_core.InputSignal<string | undefined>;
|
|
42
|
+
/** Icon position relative to the label. */
|
|
43
|
+
iconPos: _angular_core.InputSignal<UiTabIconPos>;
|
|
44
|
+
/** Accessible name override (falls back to the projected label). */
|
|
45
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
46
|
+
/** @ignore Parent container (owns the active state + group options). */
|
|
47
|
+
protected readonly tabs: UiTabs;
|
|
48
|
+
/** @ignore The native tab button (for focus + indicator measurement). */
|
|
49
|
+
readonly buttonEl: _angular_core.Signal<ElementRef<HTMLButtonElement>>;
|
|
50
|
+
/** @ignore Whether this tab is the active one. */
|
|
51
|
+
readonly active: _angular_core.Signal<boolean>;
|
|
52
|
+
/** @ignore Roving tabindex: only the group's tab stop is reachable via Tab. */
|
|
53
|
+
protected readonly tabindex: _angular_core.Signal<number>;
|
|
54
|
+
/** Move focus to this tab's button. */
|
|
55
|
+
focus(options?: FocusOptions): void;
|
|
56
|
+
/** @ignore */
|
|
57
|
+
protected onClick(event: MouseEvent): void;
|
|
58
|
+
/** @ignore Automatic activation on focus (when the group opts in). */
|
|
59
|
+
protected onFocus(event: FocusEvent): void;
|
|
60
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiTab, never>;
|
|
61
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiTab, "ui-tab", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "iconPos": { "alias": "iconPos"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* ui-tab-panel , the content region tied to a {@link UiTab} by shared `value`.
|
|
65
|
+
*
|
|
66
|
+
* The panel stays in the DOM but is `hidden` (and skipped by AT) when inactive,
|
|
67
|
+
* so its state is preserved. With `lazy` (per panel or group-wide) the content
|
|
68
|
+
* is rendered only once the panel is first activated; wrap expensive content in
|
|
69
|
+
* a `<ng-template #content>` so it initialises lazily.
|
|
70
|
+
*/
|
|
71
|
+
declare class UiTabPanel {
|
|
72
|
+
/** Identifier of this panel (matched against the container `value`). */
|
|
73
|
+
value: _angular_core.InputSignal<UiTabValue>;
|
|
74
|
+
/** Render this panel's content only once it is first activated (overrides the group default). */
|
|
75
|
+
lazy: _angular_core.InputSignalWithTransform<boolean | undefined, unknown>;
|
|
76
|
+
/** Optional lazy content template (`<ng-template #content>`). */
|
|
77
|
+
protected readonly content: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
78
|
+
/** @ignore Parent container (active state + group `lazy` default). */
|
|
79
|
+
protected readonly tabs: UiTabs;
|
|
80
|
+
/** @ignore */
|
|
81
|
+
protected readonly active: _angular_core.Signal<boolean>;
|
|
82
|
+
/** @ignore Panel-level `lazy` overrides the group default when explicitly set. */
|
|
83
|
+
private readonly isLazy;
|
|
84
|
+
/** @ignore Sticks once the panel has been activated at least once. */
|
|
85
|
+
private readonly hasRendered;
|
|
86
|
+
constructor();
|
|
87
|
+
/** @ignore Eager panels always render; lazy ones only after first activation. */
|
|
88
|
+
protected readonly shouldRender: _angular_core.Signal<boolean>;
|
|
89
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiTabPanel, never>;
|
|
90
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiTabPanel, "ui-tab-panel", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; }, {}, ["content"], ["*"], true, never>;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* ui-tab-list , the horizontal (or vertical) strip of {@link UiTab} buttons.
|
|
94
|
+
*
|
|
95
|
+
* Owns the WAI-ARIA `role="tablist"`, the roving-focus keyboard navigation
|
|
96
|
+
* (Arrow keys along the axis, Home/End), the sliding active indicator measured
|
|
97
|
+
* from the active tab, and , when the container is `scrollable` , the prev/next
|
|
98
|
+
* navigators that scroll the overflowing strip.
|
|
99
|
+
*/
|
|
100
|
+
declare class UiTabList {
|
|
101
|
+
/** Accessible name for the tab list (recommended). */
|
|
102
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
103
|
+
/** @ignore Parent container (state + group options). */
|
|
104
|
+
protected readonly tabs: UiTabs;
|
|
105
|
+
/** @ignore */
|
|
106
|
+
private readonly destroyRef;
|
|
107
|
+
/** @ignore Tabs projected into this list, in DOM order. */
|
|
108
|
+
private readonly tabItems;
|
|
109
|
+
/** @ignore Scroll viewport around the tab strip. */
|
|
110
|
+
private readonly scrollEl;
|
|
111
|
+
/** @ignore The `role="tablist"` inner element (indicator's offset parent). */
|
|
112
|
+
private readonly innerEl;
|
|
113
|
+
/** @ignore Measured indicator geometry (null when there is no active tab). */
|
|
114
|
+
protected readonly bar: _angular_core.WritableSignal<ActiveBarMetrics | null>;
|
|
115
|
+
/** @ignore Bumped by the ResizeObserver / scroll to re-measure. */
|
|
116
|
+
private readonly resizeTick;
|
|
117
|
+
/** @ignore Whether scrolling further back is possible. */
|
|
118
|
+
protected readonly prevEnabled: _angular_core.WritableSignal<boolean>;
|
|
119
|
+
/** @ignore Whether scrolling further forward is possible. */
|
|
120
|
+
protected readonly nextEnabled: _angular_core.WritableSignal<boolean>;
|
|
121
|
+
/** @ignore */
|
|
122
|
+
protected readonly orientation: _angular_core.Signal<UiTabsOrientation>;
|
|
123
|
+
/** @ignore */
|
|
124
|
+
protected readonly scrollable: _angular_core.Signal<boolean>;
|
|
125
|
+
/** @ignore Navigators render only when scrollable AND explicitly enabled. */
|
|
126
|
+
protected readonly showNavigators: _angular_core.Signal<boolean>;
|
|
127
|
+
constructor();
|
|
128
|
+
/** @ignore CSS transform positioning the indicator along the main axis. */
|
|
129
|
+
protected readonly barTransform: _angular_core.Signal<string | null>;
|
|
130
|
+
/** @ignore Roving focus across enabled tabs (WAI-ARIA tabs pattern). */
|
|
131
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
132
|
+
/**
|
|
133
|
+
* @ignore Bring the given tab fully inside the scroll viewport, scrolling by
|
|
134
|
+
* the minimum needed along the active axis. Uses the viewport's own metrics
|
|
135
|
+
* (never the page): a tab clipped at either edge slides back into view.
|
|
136
|
+
*/
|
|
137
|
+
private scrollIntoView;
|
|
138
|
+
/** @ignore Refresh the prev/next enabled state from the scroll position. */
|
|
139
|
+
private updateNavigators;
|
|
140
|
+
/** @ignore */
|
|
141
|
+
protected onScroll(): void;
|
|
142
|
+
/**
|
|
143
|
+
* @ignore Scroll the strip by roughly one viewport in the given direction.
|
|
144
|
+
* Smoothness comes from the container's CSS `scroll-behavior` (motion-aware),
|
|
145
|
+
* not the JS `behavior` option.
|
|
146
|
+
*/
|
|
147
|
+
protected scrollBy(direction: -1 | 1): void;
|
|
148
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiTabList, never>;
|
|
149
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiTabList, "ui-tab-list", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, ["tabItems"], ["*"], true, never>;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* ui-tab-panels , thin wrapper grouping the {@link UiTabPanel}s. Fills the
|
|
153
|
+
* remaining space beside/under the tab list.
|
|
154
|
+
*/
|
|
155
|
+
declare class UiTabPanels {
|
|
156
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiTabPanels, never>;
|
|
157
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiTabPanels, "ui-tab-panels", never, {}, {}, never, ["*"], true, never>;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* ui-tabs , headless container orchestrating a set of tabs and their panels.
|
|
161
|
+
*
|
|
162
|
+
* Composition API: a root `ui-tabs` owns the shared state (`value` two-way
|
|
163
|
+
* model, `orientation`, `scrollable`, `lazy`, `selectOnFocus`, `motion`), a
|
|
164
|
+
* `ui-tab-list` renders the strip of `ui-tab` buttons (plus the sliding active
|
|
165
|
+
* indicator and, when scrollable, the prev/next navigators), and a
|
|
166
|
+
* `ui-tab-panels` holds one `ui-tab-panel` per tab. Every colour/metric comes
|
|
167
|
+
* from the `navigation.*` design tokens; the active indicator glides , and each
|
|
168
|
+
* panel fades in , via the shared motion system (reduced-motion aware).
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```html
|
|
172
|
+
* <ui-tabs [(value)]="active">
|
|
173
|
+
* <ui-tab-list ariaLabel="Sections">
|
|
174
|
+
* <ui-tab [value]="0">Onglet 1</ui-tab>
|
|
175
|
+
* <ui-tab [value]="1">Onglet 2</ui-tab>
|
|
176
|
+
* </ui-tab-list>
|
|
177
|
+
* <ui-tab-panels>
|
|
178
|
+
* <ui-tab-panel [value]="0">Contenu 1…</ui-tab-panel>
|
|
179
|
+
* <ui-tab-panel [value]="1">Contenu 2…</ui-tab-panel>
|
|
180
|
+
* </ui-tab-panels>
|
|
181
|
+
* </ui-tabs>
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
declare class UiTabs {
|
|
185
|
+
/** Value of the active tab (two-way). `undefined` = no active tab. */
|
|
186
|
+
value: _angular_core.ModelSignal<UiTabValue | undefined>;
|
|
187
|
+
/** Layout axis: `horizontal` (list on top) or `vertical` (list on the side). */
|
|
188
|
+
orientation: _angular_core.InputSignal<UiTabsOrientation>;
|
|
189
|
+
/** Enable overflow scrolling of the tab list with prev/next navigators. */
|
|
190
|
+
scrollable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
191
|
+
/** Group default: render an inactive tab's panel only once it is first activated. */
|
|
192
|
+
lazy: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
193
|
+
/** Activate a tab as soon as it receives keyboard focus (automatic activation). */
|
|
194
|
+
selectOnFocus: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
195
|
+
/** Show the prev/next navigators when `scrollable` (they still gate on overflow). */
|
|
196
|
+
showNavigators: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
197
|
+
/** Animate the active indicator and panel transitions (reduced-motion always wins). */
|
|
198
|
+
motion: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
199
|
+
/** Tabindex applied to the active tab (the group's single tab stop). */
|
|
200
|
+
tabindex: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
201
|
+
/** Fired whenever the active tab changes (user click / keyboard / focus). */
|
|
202
|
+
tabChange: _angular_core.OutputEmitterRef<UiTabsChangeEvent>;
|
|
203
|
+
/** @ignore Unique id root for aria wiring between tabs and panels. */
|
|
204
|
+
readonly id: string;
|
|
205
|
+
/** @ignore All tabs projected under this container (across the list boundary). */
|
|
206
|
+
private readonly tabs;
|
|
207
|
+
/** @ignore id of the tab button for a given value. */
|
|
208
|
+
tabId(value: UiTabValue): string;
|
|
209
|
+
/** @ignore id of the panel for a given value. */
|
|
210
|
+
panelId(value: UiTabValue): string;
|
|
211
|
+
/** @ignore Whether the given value is the active tab. */
|
|
212
|
+
isActive(value: UiTabValue): boolean;
|
|
213
|
+
/**
|
|
214
|
+
* @ignore Value that owns the group's single tab stop (roving tabindex):
|
|
215
|
+
* the active tab, or the first enabled tab when none is active.
|
|
216
|
+
*/
|
|
217
|
+
readonly tabStopValue: _angular_core.Signal<UiTabValue | undefined>;
|
|
218
|
+
/** @ignore Activate a tab (no-op if already active); emits `tabChange`. */
|
|
219
|
+
updateValue(value: UiTabValue, event: Event): void;
|
|
220
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiTabs, never>;
|
|
221
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiTabs, "ui-tabs", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "scrollable": { "alias": "scrollable"; "required": false; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; "selectOnFocus": { "alias": "selectOnFocus"; "required": false; "isSignal": true; }; "showNavigators": { "alias": "showNavigators"; "required": false; "isSignal": true; }; "motion": { "alias": "motion"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "tabChange": "tabChange"; }, ["tabs"], ["*"], true, never>;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export { UiTab, UiTabList, UiTabPanel, UiTabPanels, UiTabs };
|
|
225
|
+
export type { UiTabIconPos, UiTabValue, UiTabsChangeEvent, UiTabsOrientation };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { UiIconSize } from '@4sh/ui-kit/ui-icon';
|
|
3
|
+
import { UiFeedbackLevel, UiSubLevel } from '@4sh/ui-kit/types';
|
|
4
|
+
|
|
5
|
+
type TagSize = 'default' | 'small';
|
|
6
|
+
/**
|
|
7
|
+
* ui-tag — informative label / status pill.
|
|
8
|
+
*
|
|
9
|
+
* design system: `level` × `subLevel` (informative color families) instead of a
|
|
10
|
+
* flat `severity`, an optional icon on each side, and a pill/square shape.
|
|
11
|
+
*
|
|
12
|
+
* Fully token-driven (like `ui-badge`) — the color families are the built-in
|
|
13
|
+
* customization surface; no per-component CSS hooks.
|
|
14
|
+
*/
|
|
15
|
+
declare class UiTag {
|
|
16
|
+
/** Text content of the tag. */
|
|
17
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
18
|
+
/** Color family. */
|
|
19
|
+
level: _angular_core.InputSignal<UiFeedbackLevel>;
|
|
20
|
+
/** Intensity: high (solid) or low (subtle). */
|
|
21
|
+
subLevel: _angular_core.InputSignal<UiSubLevel>;
|
|
22
|
+
/** Size. */
|
|
23
|
+
size: _angular_core.InputSignal<TagSize>;
|
|
24
|
+
/** FontAwesome name of the leading icon (optional). */
|
|
25
|
+
iconLeft: _angular_core.InputSignal<string | undefined>;
|
|
26
|
+
/** FontAwesome name of the trailing icon (optional). */
|
|
27
|
+
iconRight: _angular_core.InputSignal<string | undefined>;
|
|
28
|
+
/** Pill shape when true (default); rounded-rectangle when false. */
|
|
29
|
+
rounded: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
30
|
+
/** Accessible name (recommended when the tag has no textual label). */
|
|
31
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
32
|
+
constructor();
|
|
33
|
+
/** @ignore There is a textual label. */
|
|
34
|
+
protected readonly hasLabel: _angular_core.Signal<boolean>;
|
|
35
|
+
/** @ignore At least one icon and no label. */
|
|
36
|
+
protected readonly isIconOnly: _angular_core.Signal<boolean>;
|
|
37
|
+
/** @ignore Icon size derived from the tag size. */
|
|
38
|
+
protected readonly iconSize: _angular_core.Signal<UiIconSize>;
|
|
39
|
+
/** @ignore */
|
|
40
|
+
protected readonly classes: _angular_core.Signal<string>;
|
|
41
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiTag, never>;
|
|
42
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiTag, "ui-tag", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "level": { "alias": "level"; "required": false; "isSignal": true; }; "subLevel": { "alias": "subLevel"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "iconLeft": { "alias": "iconLeft"; "required": false; "isSignal": true; }; "iconRight": { "alias": "iconRight"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { UiTag };
|
|
46
|
+
export type { TagSize };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { BaseFormField } from '@4sh/ui-kit/forms';
|
|
3
|
+
|
|
4
|
+
/** Which axes the user can manually resize (ignored when `autoResize` is on). */
|
|
5
|
+
type TextareaResize = 'none' | 'vertical' | 'horizontal' | 'both';
|
|
6
|
+
/**
|
|
7
|
+
* ui-textarea — headless multiline text field, built on the `ui-field` shell
|
|
8
|
+
* (label + box + helper) in **multiline** mode + a native `<textarea>`.
|
|
9
|
+
*
|
|
10
|
+
* The native `<textarea>` provides the resize grip (`resize: vertical`, the
|
|
11
|
+
* Figma "resizer" affordance). `autoResize` grows the box with the content and
|
|
12
|
+
* disables the manual grip.
|
|
13
|
+
*
|
|
14
|
+
* Standalone, `[(ngModel)]` or reactive forms (ControlValueAccessor via BaseFormField).
|
|
15
|
+
*/
|
|
16
|
+
declare class UiTextarea extends BaseFormField<string> {
|
|
17
|
+
/** Native placeholder. */
|
|
18
|
+
placeholder: _angular_core.InputSignal<string | undefined>;
|
|
19
|
+
/** Initial number of visible text rows. */
|
|
20
|
+
rows: _angular_core.InputSignal<number>;
|
|
21
|
+
/** Native maxlength (caps the character count). */
|
|
22
|
+
maxlength: _angular_core.InputSignal<number | undefined>;
|
|
23
|
+
/** Grows the box height with the content (disables the manual resize grip). */
|
|
24
|
+
autoResize: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
25
|
+
/** Manual resize axis (`vertical` by default; ignored when `autoResize`). */
|
|
26
|
+
resize: _angular_core.InputSignal<TextareaResize>;
|
|
27
|
+
/** Shows a character counter under the field (`count` or `count / maxlength`). */
|
|
28
|
+
showCount: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
29
|
+
/** Emitted on each input with the new value. */
|
|
30
|
+
valueChange: _angular_core.OutputEmitterRef<string>;
|
|
31
|
+
/** Emitted when the textarea receives focus. */
|
|
32
|
+
textareaFocus: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
33
|
+
/** Emitted when the textarea loses focus. */
|
|
34
|
+
textareaBlur: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
35
|
+
/** @ignore */
|
|
36
|
+
private readonly textareaEl;
|
|
37
|
+
/** @ignore Effective resize axis (`none` while auto-resizing). */
|
|
38
|
+
protected readonly effectiveResize: _angular_core.Signal<TextareaResize>;
|
|
39
|
+
/** @ignore Current character count. */
|
|
40
|
+
protected readonly charCount: _angular_core.Signal<number>;
|
|
41
|
+
/** @ignore Over the maxlength (only reachable programmatically). */
|
|
42
|
+
protected readonly overLimit: _angular_core.Signal<boolean>;
|
|
43
|
+
/** @ignore id of the character counter (for `aria-describedby`). */
|
|
44
|
+
protected readonly countId: _angular_core.Signal<string>;
|
|
45
|
+
/** @ignore `aria-describedby` combines the message and the counter, whichever are shown. */
|
|
46
|
+
protected readonly describedByIds: _angular_core.Signal<string | null>;
|
|
47
|
+
constructor();
|
|
48
|
+
/** Focuses the textarea. */
|
|
49
|
+
focus(options?: FocusOptions): void;
|
|
50
|
+
/** @ignore Input: single source of the value (view → form). */
|
|
51
|
+
protected onInput(): void;
|
|
52
|
+
/** @ignore */
|
|
53
|
+
protected onBlur(event: FocusEvent): void;
|
|
54
|
+
/** @ignore Recomputes the height to fit the content. */
|
|
55
|
+
private resizeToContent;
|
|
56
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiTextarea, never>;
|
|
57
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiTextarea, "ui-textarea", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; "maxlength": { "alias": "maxlength"; "required": false; "isSignal": true; }; "autoResize": { "alias": "autoResize"; "required": false; "isSignal": true; }; "resize": { "alias": "resize"; "required": false; "isSignal": true; }; "showCount": { "alias": "showCount"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "textareaFocus": "textareaFocus"; "textareaBlur": "textareaBlur"; }, never, never, true, never>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { UiTextarea };
|
|
61
|
+
export type { TextareaResize };
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { UiMotionPreset } from '@4sh/ui-kit/motion';
|
|
4
|
+
import { UiFeedbackLevel, UiSubLevel } from '@4sh/ui-kit/types';
|
|
5
|
+
|
|
6
|
+
/** Unique identifier of a toast message (auto-generated when omitted). */
|
|
7
|
+
type UiToastId = string | number;
|
|
8
|
+
/**
|
|
9
|
+
* Where a {@link UiToastContainer} pins its stack in the viewport.
|
|
10
|
+
*/
|
|
11
|
+
type UiToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'center';
|
|
12
|
+
/** All positions, in declaration order (handy for stories/docs). */
|
|
13
|
+
declare const UI_TOAST_POSITIONS: readonly UiToastPosition[];
|
|
14
|
+
/**
|
|
15
|
+
* A single toast message pushed through the {@link UiToastService}.
|
|
16
|
+
*
|
|
17
|
+
* Only `title`/`text` are typically needed; everything else has a sensible
|
|
18
|
+
* default resolved by the container.
|
|
19
|
+
* remapped to this design system's semantic `level` / `subLevel` vocabulary.
|
|
20
|
+
*/
|
|
21
|
+
interface UiToastMessage {
|
|
22
|
+
/** Unique id. Auto-generated by the service when omitted. */
|
|
23
|
+
id?: UiToastId;
|
|
24
|
+
/** Routes the message to the container(s) sharing the same `key`. */
|
|
25
|
+
key?: string;
|
|
26
|
+
/** Semantic level (drives colours + default icon). */
|
|
27
|
+
level?: UiFeedbackLevel;
|
|
28
|
+
/** Hierarchical intensity (`high` = solid, `low` = subtle). */
|
|
29
|
+
subLevel?: UiSubLevel;
|
|
30
|
+
/** Bold heading line. */
|
|
31
|
+
title?: string;
|
|
32
|
+
/** Supporting body line. */
|
|
33
|
+
text?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Leading icon: a FontAwesome name to override the level default, `false`
|
|
36
|
+
* to hide it, or omit / `true` for the level's default icon.
|
|
37
|
+
*/
|
|
38
|
+
icon?: string | boolean;
|
|
39
|
+
/** Show the dismiss button (default `true`). */
|
|
40
|
+
closable?: boolean;
|
|
41
|
+
/** Never auto-dismiss — the user must close it (default `false`). */
|
|
42
|
+
sticky?: boolean;
|
|
43
|
+
/** Auto-dismiss delay in ms. Falls back to the container `life`. */
|
|
44
|
+
life?: number;
|
|
45
|
+
/** Arbitrary payload forwarded to a custom `template` (custom / action toasts). */
|
|
46
|
+
data?: unknown;
|
|
47
|
+
/** Extra class(es) applied to the toast card for one-off styling. */
|
|
48
|
+
styleClass?: string;
|
|
49
|
+
}
|
|
50
|
+
/** Context object handed to a container's custom content `template`. */
|
|
51
|
+
interface UiToastTemplateContext {
|
|
52
|
+
/** The message being rendered. */
|
|
53
|
+
$implicit: UiToastMessage;
|
|
54
|
+
/** Dismisses this toast (same as clicking the close button). */
|
|
55
|
+
closeFn: () => void;
|
|
56
|
+
}
|
|
57
|
+
/** Default leading icon per semantic level (FontAwesome names, from the Figma source). */
|
|
58
|
+
declare const UI_TOAST_DEFAULT_ICONS: Record<UiFeedbackLevel, string>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* ui-toast-container — the viewport-pinned stack that renders {@link UiToastService}
|
|
62
|
+
* messages as {@link UiToast} cards.
|
|
63
|
+
*
|
|
64
|
+
* Drop one near the app root (e.g. in `app.html`). It reads the service store
|
|
65
|
+
* reactively, shows the slice matching its `key`, animates insert/remove through
|
|
66
|
+
* the shared motion system (`animate.enter` / `animate.leave`), and auto-dismisses
|
|
67
|
+
* non-sticky toasts after `life` ms — pausing the countdown while hovered.
|
|
68
|
+
*
|
|
69
|
+
* Positioning is `fixed` by default (relative to the viewport); set `contained`
|
|
70
|
+
* to switch to `absolute` so the stack stays inside the nearest positioned
|
|
71
|
+
* ancestor (used by the Storybook demos).
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```html
|
|
75
|
+
* <ui-toast-container position="top-right" [life]="4000" />
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
declare class UiToastContainer {
|
|
79
|
+
/** Only render messages whose `key` matches (omit to render key-less messages). */
|
|
80
|
+
key: _angular_core.InputSignal<string | undefined>;
|
|
81
|
+
/** Where the stack is pinned in the viewport. */
|
|
82
|
+
position: _angular_core.InputSignal<UiToastPosition>;
|
|
83
|
+
/** Default auto-dismiss delay (ms) for non-sticky toasts. Per-message `life` wins. */
|
|
84
|
+
life: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
85
|
+
/** Render toasts as full-width banners (fill the region width). */
|
|
86
|
+
expanded: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
87
|
+
/** Motion preset override. Defaults to a per-position choice. */
|
|
88
|
+
motion: _angular_core.InputSignal<UiMotionPreset | undefined>;
|
|
89
|
+
/** Disable enter/leave animation for this stack. */
|
|
90
|
+
motionDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
91
|
+
/** Use `position: absolute` (scoped to a positioned ancestor) instead of `fixed`. */
|
|
92
|
+
contained: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
93
|
+
/**
|
|
94
|
+
* Custom content template rendered inside each card in place of `title`/`text`.
|
|
95
|
+
* Context: `{ $implicit: message, closeFn }`.
|
|
96
|
+
*/
|
|
97
|
+
template: _angular_core.InputSignal<TemplateRef<unknown> | undefined>;
|
|
98
|
+
/** Extra class(es) merged onto the region root. */
|
|
99
|
+
styleClass: _angular_core.InputSignal<string | undefined>;
|
|
100
|
+
/** Show only the N most recent toasts; older ones wait their turn (`0` = no limit). */
|
|
101
|
+
stackVisibleLimit: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
102
|
+
/** Gap between stacked cards in px (overrides the `--units-sm` token default). */
|
|
103
|
+
stackGap: _angular_core.InputSignal<number | undefined>;
|
|
104
|
+
/** Skip a new toast whose content (level + title + text) matches a live one. */
|
|
105
|
+
preventDuplicates: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
106
|
+
/** Automatically layer this stack above earlier ones (later container wins). */
|
|
107
|
+
autoZIndex: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
108
|
+
/** Floor z-index for the stack (added to the auto value, or used as-is when `autoZIndex=false`). */
|
|
109
|
+
baseZIndex: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
110
|
+
/** @ignore */
|
|
111
|
+
private readonly service;
|
|
112
|
+
/** @ignore Per-instance layering rank for `autoZIndex`. */
|
|
113
|
+
private readonly zSeq;
|
|
114
|
+
/** @ignore */
|
|
115
|
+
private readonly isBrowser;
|
|
116
|
+
/** @ignore All live messages routed to this container (drives timers/dedup). */
|
|
117
|
+
private readonly keyed;
|
|
118
|
+
/** @ignore Rendered slice — the most recent `stackVisibleLimit` toasts. */
|
|
119
|
+
protected readonly items: _angular_core.Signal<UiToastMessage[]>;
|
|
120
|
+
/** @ignore Effective stacking level. */
|
|
121
|
+
protected readonly zIndex: _angular_core.Signal<number>;
|
|
122
|
+
/** @ignore Resolved enter/leave preset. */
|
|
123
|
+
protected readonly motionPreset: _angular_core.Signal<UiMotionPreset>;
|
|
124
|
+
/** @ignore */
|
|
125
|
+
protected readonly regionClass: _angular_core.Signal<string>;
|
|
126
|
+
/** @ignore Active timeout handles, keyed by message id. */
|
|
127
|
+
private readonly timers;
|
|
128
|
+
/** @ignore Remaining ms per message (survives hover pause). */
|
|
129
|
+
private readonly remaining;
|
|
130
|
+
/** @ignore Wall-clock start of the running countdown, per message. */
|
|
131
|
+
private readonly startedAt;
|
|
132
|
+
constructor();
|
|
133
|
+
/** @ignore Start (or restart) a countdown of `ms` for a message. */
|
|
134
|
+
private arm;
|
|
135
|
+
/** @ignore Cancel and drop all timer bookkeeping for a message. */
|
|
136
|
+
private forget;
|
|
137
|
+
/** @ignore Pause the countdown on hover/focus (banks the remaining time). */
|
|
138
|
+
protected pause(id: UiToastId | undefined): void;
|
|
139
|
+
/** @ignore Resume a paused countdown when the pointer/focus leaves. */
|
|
140
|
+
protected resume(id: UiToastId | undefined): void;
|
|
141
|
+
/** @ignore Dismiss a toast (close button or a custom template's `closeFn`). */
|
|
142
|
+
protected dismiss(message: UiToastMessage): void;
|
|
143
|
+
/** @ignore Template-context factory: a bound close handler for one message. */
|
|
144
|
+
protected closeFn(message: UiToastMessage): () => void;
|
|
145
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiToastContainer, never>;
|
|
146
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiToastContainer, "ui-toast-container", never, { "key": { "alias": "key"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "life": { "alias": "life"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; "motion": { "alias": "motion"; "required": false; "isSignal": true; }; "motionDisabled": { "alias": "motionDisabled"; "required": false; "isSignal": true; }; "contained": { "alias": "contained"; "required": false; "isSignal": true; }; "template": { "alias": "template"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "stackVisibleLimit": { "alias": "stackVisibleLimit"; "required": false; "isSignal": true; }; "stackGap": { "alias": "stackGap"; "required": false; "isSignal": true; }; "preventDuplicates": { "alias": "preventDuplicates"; "required": false; "isSignal": true; }; "autoZIndex": { "alias": "autoZIndex"; "required": false; "isSignal": true; }; "baseZIndex": { "alias": "baseZIndex"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* ui-toast service — programmatic entry point to push and clear toasts.
|
|
151
|
+
*
|
|
152
|
+
* Signal-based store:
|
|
153
|
+
* `add`/`addAll` append messages, `clear`/`remove` drop them. One or more
|
|
154
|
+
* {@link UiToastContainer} instances read this store reactively and render the
|
|
155
|
+
* slice that matches their `key`. Provided in root, so a single injection is
|
|
156
|
+
* shared across the app.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```ts
|
|
160
|
+
* private readonly toast = inject(UiToastService);
|
|
161
|
+
* this.toast.add({ level: 'success', title: 'Enregistré', text: 'Profil mis à jour.' });
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
declare class UiToastService {
|
|
165
|
+
/** @ignore Backing store of live messages. */
|
|
166
|
+
private readonly _messages;
|
|
167
|
+
/** Live messages, in insertion order (read-only). */
|
|
168
|
+
readonly messages: _angular_core.Signal<UiToastMessage[]>;
|
|
169
|
+
/** Total number of live messages across every key. */
|
|
170
|
+
readonly count: _angular_core.Signal<number>;
|
|
171
|
+
/**
|
|
172
|
+
* Push a single message. Returns its (possibly generated) id so the caller
|
|
173
|
+
* can dismiss it later (e.g. resolving a "loading" toast into a result).
|
|
174
|
+
*/
|
|
175
|
+
add(message: UiToastMessage): UiToastId;
|
|
176
|
+
/** Push several messages at once. Returns their ids, in order. */
|
|
177
|
+
addAll(messages: UiToastMessage[]): UiToastId[];
|
|
178
|
+
/**
|
|
179
|
+
* Remove messages. With no argument, clears everything; with a `key`, clears
|
|
180
|
+
* only the messages routed to that key.
|
|
181
|
+
*/
|
|
182
|
+
clear(key?: string): void;
|
|
183
|
+
/** Remove a single message by id (no-op if it is already gone). */
|
|
184
|
+
remove(id: UiToastId): void;
|
|
185
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiToastService, never>;
|
|
186
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<UiToastService>;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* ui-toast — presentational notification card.
|
|
191
|
+
*
|
|
192
|
+
* Headless & fully token-driven (the `informative` category): surface, content
|
|
193
|
+
* and stroke all come from `--informative-{level}{sub}-*`. It renders the Figma
|
|
194
|
+
* anatomy (leading icon · title/text · dismiss button) and projects `<ng-content>`
|
|
195
|
+
* in the content region for custom bodies or action buttons.
|
|
196
|
+
*
|
|
197
|
+
* Usually rendered for you by {@link UiToastContainer} from a {@link UiToastService}
|
|
198
|
+
* message, but it is a plain standalone card — drop `<ui-toast>` anywhere.
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```html
|
|
202
|
+
* <ui-toast level="success" title="Enregistré" text="Profil mis à jour." (closed)="…" />
|
|
203
|
+
* ```
|
|
204
|
+
*/
|
|
205
|
+
declare class UiToast {
|
|
206
|
+
/** Bold heading line. */
|
|
207
|
+
title: _angular_core.InputSignal<string | undefined>;
|
|
208
|
+
/** Supporting body line. */
|
|
209
|
+
text: _angular_core.InputSignal<string | undefined>;
|
|
210
|
+
/** Semantic level — colours + default icon. */
|
|
211
|
+
level: _angular_core.InputSignal<UiFeedbackLevel>;
|
|
212
|
+
/** Hierarchical intensity (`high` = solid, `low` = subtle). */
|
|
213
|
+
subLevel: _angular_core.InputSignal<UiSubLevel>;
|
|
214
|
+
/**
|
|
215
|
+
* Leading icon: a FontAwesome name to override the level default, `false`
|
|
216
|
+
* to hide it, or `true` (default) for the level's default icon.
|
|
217
|
+
*/
|
|
218
|
+
icon: _angular_core.InputSignal<string | boolean>;
|
|
219
|
+
/** Show the dismiss button (default `true`). */
|
|
220
|
+
closable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
221
|
+
/** FontAwesome name of the dismiss icon. */
|
|
222
|
+
closeIcon: _angular_core.InputSignal<string>;
|
|
223
|
+
/** Accessible label of the dismiss button. */
|
|
224
|
+
closeAriaLabel: _angular_core.InputSignal<string>;
|
|
225
|
+
/** Stretch the card to fill its region width (banner-style). */
|
|
226
|
+
expanded: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
227
|
+
/** Extra class(es) merged onto the card root. */
|
|
228
|
+
styleClass: _angular_core.InputSignal<string | undefined>;
|
|
229
|
+
/** Emitted when the user clicks the dismiss button. */
|
|
230
|
+
closed: _angular_core.OutputEmitterRef<MouseEvent>;
|
|
231
|
+
/** @ignore Resolved leading icon name (null when hidden). */
|
|
232
|
+
protected readonly iconName: _angular_core.Signal<string | null>;
|
|
233
|
+
/** @ignore ARIA role — assertive alert for error/warning, polite status otherwise
|
|
234
|
+
* (mirrors ui-alert, so a standalone ui-toast self-announces without the container). */
|
|
235
|
+
protected readonly role: _angular_core.Signal<"alert" | "status">;
|
|
236
|
+
/** @ignore */
|
|
237
|
+
protected readonly ariaLive: _angular_core.Signal<"assertive" | "polite">;
|
|
238
|
+
/** @ignore */
|
|
239
|
+
protected readonly classes: _angular_core.Signal<string>;
|
|
240
|
+
/** @ignore */
|
|
241
|
+
protected onClose(event: MouseEvent): void;
|
|
242
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiToast, never>;
|
|
243
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiToast, "ui-toast", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; "level": { "alias": "level"; "required": false; "isSignal": true; }; "subLevel": { "alias": "subLevel"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; "isSignal": true; }; "closeIcon": { "alias": "closeIcon"; "required": false; "isSignal": true; }; "closeAriaLabel": { "alias": "closeAriaLabel"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, never, ["*"], true, never>;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export { UI_TOAST_DEFAULT_ICONS, UI_TOAST_POSITIONS, UiToast, UiToastContainer, UiToastService };
|
|
247
|
+
export type { UiToastId, UiToastMessage, UiToastPosition, UiToastTemplateContext };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { BaseFieldControl } from '@4sh/ui-kit/forms';
|
|
4
|
+
|
|
5
|
+
type ToggleSize = 'default' | 'small';
|
|
6
|
+
type ToggleLabelPosition = 'before' | 'after';
|
|
7
|
+
interface ToggleHandleContext {
|
|
8
|
+
checked: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* ui-toggle — headless switch built on a real native `<input type="checkbox" role="switch">`.
|
|
12
|
+
*
|
|
13
|
+
* The native input stays in the DOM (invisible, covering the track) so keyboard,
|
|
14
|
+
* screen readers, label click and form semantics come for free. `role="switch"`
|
|
15
|
+
* + `aria-checked` make assistive tech announce it as on/off. Interactive states
|
|
16
|
+
* (hover/focus/disabled/checked) are pure CSS driven by `form.*` design tokens.
|
|
17
|
+
*
|
|
18
|
+
* Works standalone, with `[(ngModel)]` or reactive forms (ControlValueAccessor).
|
|
19
|
+
* By default the model value is boolean; `trueValue`/`falseValue` let the model
|
|
20
|
+
* carry any pair of values (e.g. 'on'/'off', 1/0).
|
|
21
|
+
*/
|
|
22
|
+
declare class UiToggle<T = boolean> extends BaseFieldControl<T> {
|
|
23
|
+
/** Label displayed next to the switch (clicking it toggles the switch). */
|
|
24
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
25
|
+
/** Side of the switch the label sits on (both sides are clickable). */
|
|
26
|
+
labelPosition: _angular_core.InputSignal<ToggleLabelPosition>;
|
|
27
|
+
/** Size. */
|
|
28
|
+
size: _angular_core.InputSignal<ToggleSize>;
|
|
29
|
+
/** Model value emitted when on. */
|
|
30
|
+
trueValue: _angular_core.InputSignal<T>;
|
|
31
|
+
/** Model value emitted when off. */
|
|
32
|
+
falseValue: _angular_core.InputSignal<T>;
|
|
33
|
+
/**
|
|
34
|
+
* Custom handle (thumb) template. Receives a `{ checked }` context, so the
|
|
35
|
+
* rendered content can react to the on/off state (e.g. a check / times icon).
|
|
36
|
+
*/
|
|
37
|
+
handle: _angular_core.InputSignal<TemplateRef<ToggleHandleContext> | undefined>;
|
|
38
|
+
/** Emitted on user toggle with the new model value (never when disabled/readonly). */
|
|
39
|
+
toggleChange: _angular_core.OutputEmitterRef<T>;
|
|
40
|
+
/** Emitted when the native input receives focus. */
|
|
41
|
+
toggleFocus: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
42
|
+
/** Emitted when the native input loses focus. */
|
|
43
|
+
toggleBlur: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
44
|
+
/** @ignore */
|
|
45
|
+
private readonly inputEl;
|
|
46
|
+
/** @ignore */
|
|
47
|
+
protected readonly checked: _angular_core.Signal<boolean>;
|
|
48
|
+
/** @ignore A visible label is provided. */
|
|
49
|
+
protected readonly hasLabel: _angular_core.Signal<boolean>;
|
|
50
|
+
/** @ignore Context handed to the custom handle template. */
|
|
51
|
+
protected readonly handleContext: _angular_core.Signal<ToggleHandleContext>;
|
|
52
|
+
/** @ignore */
|
|
53
|
+
protected readonly classes: _angular_core.Signal<string>;
|
|
54
|
+
/** @ignore */
|
|
55
|
+
protected uidPrefix(): string;
|
|
56
|
+
/** Focus the native input programmatically. */
|
|
57
|
+
focus(options?: FocusOptions): void;
|
|
58
|
+
/** @ignore Native change: single source of truth for user toggles. */
|
|
59
|
+
protected onNativeChange(): void;
|
|
60
|
+
/** @ignore */
|
|
61
|
+
protected onBlur(event: FocusEvent): void;
|
|
62
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiToggle<any>, never>;
|
|
63
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiToggle<any>, "ui-toggle", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "trueValue": { "alias": "trueValue"; "required": false; "isSignal": true; }; "falseValue": { "alias": "falseValue"; "required": false; "isSignal": true; }; "handle": { "alias": "handle"; "required": false; "isSignal": true; }; }, { "toggleChange": "toggleChange"; "toggleFocus": "toggleFocus"; "toggleBlur": "toggleBlur"; }, never, never, true, never>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { UiToggle };
|
|
67
|
+
export type { ToggleHandleContext, ToggleLabelPosition, ToggleSize };
|