@cngx/ui 0.0.1-rc.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.
Files changed (60) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +550 -0
  3. package/action-button/README.md +98 -0
  4. package/empty-state/README.md +103 -0
  5. package/feedback/README.md +33 -0
  6. package/fesm2022/cngx-ui-action-button.mjs +319 -0
  7. package/fesm2022/cngx-ui-action-button.mjs.map +1 -0
  8. package/fesm2022/cngx-ui-empty-state.mjs +138 -0
  9. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -0
  10. package/fesm2022/cngx-ui-feedback.mjs +2962 -0
  11. package/fesm2022/cngx-ui-feedback.mjs.map +1 -0
  12. package/fesm2022/cngx-ui-layout.mjs +89 -0
  13. package/fesm2022/cngx-ui-layout.mjs.map +1 -0
  14. package/fesm2022/cngx-ui-mat-stepper.mjs +567 -0
  15. package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -0
  16. package/fesm2022/cngx-ui-mat-tabs.mjs +1405 -0
  17. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -0
  18. package/fesm2022/cngx-ui-material.mjs +79 -0
  19. package/fesm2022/cngx-ui-material.mjs.map +1 -0
  20. package/fesm2022/cngx-ui-overlay.mjs +91 -0
  21. package/fesm2022/cngx-ui-overlay.mjs.map +1 -0
  22. package/fesm2022/cngx-ui-sidenav.mjs +521 -0
  23. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -0
  24. package/fesm2022/cngx-ui-skeleton.mjs +158 -0
  25. package/fesm2022/cngx-ui-skeleton.mjs.map +1 -0
  26. package/fesm2022/cngx-ui-speak.mjs +112 -0
  27. package/fesm2022/cngx-ui-speak.mjs.map +1 -0
  28. package/fesm2022/cngx-ui-stepper.mjs +312 -0
  29. package/fesm2022/cngx-ui-stepper.mjs.map +1 -0
  30. package/fesm2022/cngx-ui-tabs.mjs +507 -0
  31. package/fesm2022/cngx-ui-tabs.mjs.map +1 -0
  32. package/fesm2022/cngx-ui.mjs +45 -0
  33. package/fesm2022/cngx-ui.mjs.map +1 -0
  34. package/layout/README.md +133 -0
  35. package/mat-stepper/README.md +34 -0
  36. package/mat-tabs/README.md +163 -0
  37. package/mat-tabs/styles/mat-tabs.css +233 -0
  38. package/material/README.md +90 -0
  39. package/overlay/README.md +99 -0
  40. package/package.json +98 -0
  41. package/sidenav/README.md +127 -0
  42. package/skeleton/README.md +98 -0
  43. package/speak/README.md +93 -0
  44. package/speak/speak-button-theme.scss +78 -0
  45. package/stepper/README.md +40 -0
  46. package/tabs/README.md +28 -0
  47. package/types/cngx-ui-action-button.d.ts +126 -0
  48. package/types/cngx-ui-empty-state.d.ts +41 -0
  49. package/types/cngx-ui-feedback.d.ts +1174 -0
  50. package/types/cngx-ui-layout.d.ts +56 -0
  51. package/types/cngx-ui-mat-stepper.d.ts +234 -0
  52. package/types/cngx-ui-mat-tabs.d.ts +664 -0
  53. package/types/cngx-ui-material.d.ts +36 -0
  54. package/types/cngx-ui-overlay.d.ts +57 -0
  55. package/types/cngx-ui-sidenav.d.ts +209 -0
  56. package/types/cngx-ui-skeleton.d.ts +97 -0
  57. package/types/cngx-ui-speak.d.ts +31 -0
  58. package/types/cngx-ui-stepper.d.ts +129 -0
  59. package/types/cngx-ui-tabs.d.ts +165 -0
  60. package/types/cngx-ui.d.ts +18 -0
@@ -0,0 +1,165 @@
1
+ import * as _cngx_common_tabs from '@cngx/common/tabs';
2
+ import { CngxTabPanelHost, CngxTabGroupAnnouncements, CngxTabGroupTemplateBindings, CngxTabHandle, CngxTabErrorBadgeContext, CngxTabBusySpinnerContext, CngxTabRejectionIconContext, tabOverflowOptionId } from '@cngx/common/tabs';
3
+ import * as _angular_core from '@angular/core';
4
+ import { Signal, TemplateRef } from '@angular/core';
5
+ import * as i2 from '@cngx/common/a11y';
6
+ import { CngxPopover } from '@cngx/common/popover';
7
+
8
+ /**
9
+ * CNGX tab-group organism. Thin shell over {@link CngxTabGroupPresenter}
10
+ * + `CngxRovingTabindex` + `CngxFocusRestore` via `hostDirectives`.
11
+ * Material variant lives at `[cngxMatTabs]` in `@cngx/ui/mat-tabs`.
12
+ *
13
+ * All ARIA attrs are signal-driven — never one-shot bindings.
14
+ * `CngxLiveRegion` is mounted as a child `<span>` rather than a
15
+ * host directive: its `role="status"` would clobber the wrapper's
16
+ * `role="group"` landmark.
17
+ */
18
+ declare class CngxTabGroup implements CngxTabPanelHost {
19
+ readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
20
+ readonly ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
21
+ protected readonly presenter: _cngx_common_tabs.CngxTabGroupHost;
22
+ protected readonly i18n: _cngx_common_tabs.CngxTabsI18n;
23
+ protected readonly config: _cngx_common_tabs.CngxTabsConfig;
24
+ /** Default-glyph table for the template's fallback spans. Pillar 1. */
25
+ protected readonly glyphs: {
26
+ readonly errorBadge: "!";
27
+ readonly rejectionIcon: "!";
28
+ };
29
+ private readonly hostElement;
30
+ private readonly injector;
31
+ private readonly tabDirectives;
32
+ /**
33
+ * Per-instance skin slots. Resolved via 3-stage cascade in {@link templates}:
34
+ * `*cngxTab*` directive > `CNGX_TABS_CONFIG.templates.<key>` > built-in.
35
+ * AOT (NG8110) requires `contentChild()` to be a direct field initialiser
36
+ * on the variant — cascade resolution is delegated to the factory.
37
+ */
38
+ private readonly errorBadgeSlot;
39
+ private readonly rejectionIconSlot;
40
+ private readonly busySpinnerSlot;
41
+ /**
42
+ * AT-announcement bundle from `@cngx/common/tabs/announcements/`.
43
+ * Owns role descriptions, resolved aria-label, live-region phrasing,
44
+ * and the prior-active-index `linkedSignal` driving the success-arm
45
+ * direction prefix.
46
+ */
47
+ protected readonly announcements: CngxTabGroupAnnouncements;
48
+ constructor();
49
+ private readonly tabDirectiveById;
50
+ /**
51
+ * Resolved 3-stage cascade for `errorBadge`, `rejectionIcon`, `busySpinner`.
52
+ * `null` -> render built-in default span.
53
+ */
54
+ protected readonly templates: CngxTabGroupTemplateBindings;
55
+ readonly tabs: Signal<readonly CngxTabHandle[]>;
56
+ readonly activeIndex: Signal<number>;
57
+ readonly activeId: Signal<string | null>;
58
+ readonly orientation: Signal<'horizontal' | 'vertical'>;
59
+ protected isSelected(tab: CngxTabHandle): boolean;
60
+ protected isTabBusy(tab: CngxTabHandle): boolean;
61
+ protected tabHeaderId(tab: CngxTabHandle): string;
62
+ protected tabPanelId(tab: CngxTabHandle): string;
63
+ protected tabDescriptorId(tab: CngxTabHandle): string;
64
+ /** `true` when a bound error-aggregator opted in to revealing errors. */
65
+ protected showErrorBadge(tab: CngxTabHandle): boolean;
66
+ /**
67
+ * Stable per-tab `*cngxTabErrorBadge` context cache. Context is
68
+ * `{ tab }` only (no reactive fields), so a `WeakMap` keeps the
69
+ * reference stable and lets `*ngTemplateOutlet`'s `Object.is`
70
+ * input-diff short-circuit the embedded-view rebind.
71
+ */
72
+ private readonly errorBadgeContextCache;
73
+ /** `WeakMap`-cached context for `*cngxTabErrorBadge`. Stable ref per tab. */
74
+ protected errorBadgeContextFor(tab: CngxTabHandle): CngxTabErrorBadgeContext;
75
+ /**
76
+ * Context for `*cngxTabBusySpinner`. Allocates fresh per CD —
77
+ * `intendedIndex` is reactive, and `*ngTemplateOutlet` only
78
+ * re-evaluates `let-*` bindings when the context reference changes
79
+ * (`Object.is` input-diff); a cached mutated object would leave
80
+ * consumer bindings stale. `intendedIndex` is non-undefined by gate
81
+ * — `isTabBusy(tab)` returning `true` requires it.
82
+ */
83
+ protected busySpinnerContextFor(tab: CngxTabHandle): CngxTabBusySpinnerContext;
84
+ /**
85
+ * Context for `*cngxTabRejectionIcon`. `originLabel` matches the
86
+ * `liveAnnouncement` priority chain so visual + SR phrasing align.
87
+ * Allocates fresh per CD for the same reason as
88
+ * {@link busySpinnerContextFor}.
89
+ */
90
+ protected rejectionIconContextFor(failedIndex: number): CngxTabRejectionIconContext;
91
+ protected handleHeaderClick(tab: CngxTabHandle): void;
92
+ selectById(id: string): void;
93
+ /**
94
+ * Clear the presenter's `lastFailedIndex` rejection flag — exposed
95
+ * so template-ref consumers (`#tg="cngxTabGroup"`) can dismiss the
96
+ * decoration without injecting the host token.
97
+ */
98
+ clearLastFailed(): void;
99
+ labelTemplateFor(id: string): TemplateRef<unknown> | null;
100
+ contentTemplateFor(id: string): TemplateRef<unknown> | null;
101
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxTabGroup, never>;
102
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxTabGroup, "cngx-tab-group", ["cngxTabGroup"], { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; }, {}, ["tabDirectives", "errorBadgeSlot", "rejectionIconSlot", "busySpinnerSlot"], ["cngx-tab-overflow", "*"], true, [{ directive: typeof _cngx_common_tabs.CngxTabGroupPresenter; inputs: { "activeIndex": "activeIndex"; "orientation": "orientation"; "loop": "loop"; "commitAction": "commitAction"; "commitMode": "commitMode"; }; outputs: { "activeIndexChange": "activeIndexChange"; }; }, { directive: typeof i2.CngxRovingTabindex; inputs: { "orientation": "orientation"; "loop": "loop"; }; outputs: {}; }, { directive: typeof i2.CngxFocusRestore; inputs: {}; outputs: {}; }]>;
103
+ }
104
+
105
+ /**
106
+ * Opt-in overflow indicator for `<cngx-tab-group>`. Surfaces clipped
107
+ * tab buttons through a "More" `CngxPopover` dropdown. Talks to the
108
+ * organism only via {@link CNGX_TAB_PANEL_HOST}.
109
+ *
110
+ * Visibility is tracked through a native `IntersectionObserver`
111
+ * rooted on the parent strip — `CngxIntersectionObserver` doesn't
112
+ * fit (single-element scope, can't reach sibling `viewChildren`).
113
+ * `threshold: 0` — only fully-clipped tabs surface. Combined with
114
+ * the organism's `scrollIntoView` effect this forms the self-healing
115
+ * loop: pick hidden tab -> strip scrolls -> IO fires -> `hiddenTabs`
116
+ * self-trims.
117
+ */
118
+ declare class CngxTabOverflow {
119
+ protected readonly panelHost: CngxTabPanelHost;
120
+ protected readonly i18n: _cngx_common_tabs.CngxTabsI18n;
121
+ protected readonly popover: _angular_core.Signal<CngxPopover>;
122
+ private readonly adRef;
123
+ private readonly hostElement;
124
+ private readonly destroyRef;
125
+ private readonly adapter;
126
+ private readonly visibilityState;
127
+ protected readonly hiddenTabs: _angular_core.Signal<readonly CngxTabHandle[]>;
128
+ protected readonly hasHiddenTabs: _angular_core.Signal<boolean>;
129
+ protected readonly hiddenCount: _angular_core.Signal<number>;
130
+ protected readonly adItemId: typeof tabOverflowOptionId;
131
+ private readonly tabsConfig;
132
+ private readonly triggerSlot;
133
+ private readonly itemSlot;
134
+ protected readonly templates: _cngx_common_tabs.CngxTabOverflowTemplateBindings;
135
+ private observer;
136
+ private readonly targetToHandleId;
137
+ private readonly stabilizeMs;
138
+ private readonly maxDeferMs;
139
+ private stabilizeHandle;
140
+ private pendingEntries;
141
+ private firstPendingAt;
142
+ private readonly attachRetry;
143
+ constructor();
144
+ protected pickTab(tab: CngxTabHandle): void;
145
+ /** AD `(activated)` — Enter / Space on a highlighted option picks. */
146
+ protected handleAdActivated(value: unknown): void;
147
+ /**
148
+ * Auto-opens popover on nav-key when collapsed. AD's host listener
149
+ * fires first, so `activeIndex` is already set when this runs.
150
+ * No-op while open — AD owns navigation.
151
+ */
152
+ protected handleTriggerKeydown(event: KeyboardEvent): void;
153
+ private observeCurrentTabs;
154
+ private handleIntersections;
155
+ private commitPendingVisibility;
156
+ /**
157
+ * IO-root resolution via the injected adapter. Returns `null`
158
+ * before the molecule is anchored — the rAF retry loop re-polls.
159
+ */
160
+ private resolveStrip;
161
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxTabOverflow, never>;
162
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxTabOverflow, "cngx-tab-overflow", ["cngxTabOverflow"], {}, {}, ["triggerSlot", "itemSlot"], never, true, never>;
163
+ }
164
+
165
+ export { CngxTabGroup, CngxTabOverflow };
@@ -0,0 +1,18 @@
1
+ import * as _cngx_utils from '@cngx/utils';
2
+ export * from '@cngx/ui/action-button';
3
+ export * from '@cngx/ui/sidenav';
4
+ export * from '@cngx/ui/skeleton';
5
+ export * from '@cngx/ui/speak';
6
+ export { CngxFailed, CngxPending, CngxSucceeded } from '@cngx/common/interactive';
7
+
8
+ /**
9
+ * @cngx/ui
10
+ *
11
+ * UI components for cngx composable Angular extensions.
12
+ * Secondary entry points:
13
+ * @cngx/ui/layout – CngxStack, CngxGrid
14
+ * @cngx/ui/overlay – CngxOverlay, CngxOverlayRef
15
+ */
16
+ declare const VERSION: _cngx_utils.Version;
17
+
18
+ export { VERSION };