@cdevhub/ngx-tw 0.6.2 → 0.8.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/cdevhub-ngx-tw-alert.mjs +8 -1
- package/fesm2022/cdevhub-ngx-tw-alert.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-badge.mjs +11 -1
- package/fesm2022/cdevhub-ngx-tw-badge.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-button.mjs +7 -1
- package/fesm2022/cdevhub-ngx-tw-button.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs +2 -2
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs +1 -1
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-popover-testing.mjs +213 -0
- package/fesm2022/cdevhub-ngx-tw-popover-testing.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-popover.mjs +10 -4
- package/fesm2022/cdevhub-ngx-tw-popover.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-radio.mjs +2 -2
- package/fesm2022/cdevhub-ngx-tw-radio.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs +29 -9
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-theme.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tooltip-testing.mjs +195 -0
- package/fesm2022/cdevhub-ngx-tw-tooltip-testing.mjs.map +1 -0
- package/index.json +1 -1
- package/package.json +9 -1
- package/types/cdevhub-ngx-tw-popover-testing.d.ts +138 -0
- package/types/cdevhub-ngx-tw-tabs.d.ts +23 -3
- package/types/cdevhub-ngx-tw-theme.d.ts +18 -1
- package/types/cdevhub-ngx-tw-tooltip-testing.d.ts +131 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { ComponentHarness, manualChangeDetection, HarnessPredicate, TestKey } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Lets the zoneless change-detection scheduler run its pending tick.
|
|
5
|
+
*
|
|
6
|
+
* `ApplicationRef` schedules a tick with `setTimeout(cb)` raced against
|
|
7
|
+
* `requestAnimationFrame`. A timer registered *after* the notify that dirtied a
|
|
8
|
+
* signal therefore fires *after* that tick, so one macrotask is enough to
|
|
9
|
+
* observe everything already scheduled. It is a fixed, bounded yield, not a
|
|
10
|
+
* stabilization await, so it cannot hang.
|
|
11
|
+
*
|
|
12
|
+
* Every method spends one: an action yields after dispatching, so the effects
|
|
13
|
+
* the directive applied synchronously are rendered; a read yields before
|
|
14
|
+
* looking, so it sees any tick that was already pending. The composition is what
|
|
15
|
+
* matters — `open()` returns while the panel's first render is still pending,
|
|
16
|
+
* and the following read's own yield is what picks the rendered content up.
|
|
17
|
+
*/
|
|
18
|
+
function afterSchedulerTick() {
|
|
19
|
+
return new Promise((resolve) => setTimeout(resolve));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Harness for a `[twPopover]` trigger and the panel it opens.
|
|
23
|
+
*
|
|
24
|
+
* ## Nothing here awaits application stabilization, and that is load-bearing
|
|
25
|
+
*
|
|
26
|
+
* `TestbedHarnessEnvironment` routes every `TestElement` operation through
|
|
27
|
+
* `forceStabilize()` — `fixture.detectChanges()` then
|
|
28
|
+
* `await fixture.whenStable()` — and that await resolves only when Angular's
|
|
29
|
+
* `PendingTasks` set is empty. Under full-suite contention it was observed
|
|
30
|
+
* **not to resolve at all**, and everything built on it hung for the whole test
|
|
31
|
+
* budget instead of failing. This harness was withdrawn twice for that.
|
|
32
|
+
*
|
|
33
|
+
* Every method body therefore runs inside CDK's `manualChangeDetection()`,
|
|
34
|
+
* which sets the flag `forceStabilize()` early-returns on, and so does
|
|
35
|
+
* acquisition, via {@link load} / {@link loadAll}. The spec beside this file
|
|
36
|
+
* adds the third piece: it never awaits `fixture.whenStable()` either, not even
|
|
37
|
+
* in `beforeEach`. All three were needed — each of the two CI failures during
|
|
38
|
+
* this restoration was traced to one of them, and the second landed on
|
|
39
|
+
* `tooltip` rather than here, which is how it became clear the fault belongs to
|
|
40
|
+
* whichever harness spec lands in the unlucky worker slot rather than to any
|
|
41
|
+
* one component. `grep -c whenStable` over this file and its spec returns zero,
|
|
42
|
+
* which is the whole claim and is checkable in one command rather than by
|
|
43
|
+
* counting green runs. The spec pins the rest with tests that hold a real
|
|
44
|
+
* `PendingTasks` entry open across acquisition and every method.
|
|
45
|
+
*
|
|
46
|
+
* Why the application stops stabilizing is **not** known; this removes the
|
|
47
|
+
* dependency rather than curing it.
|
|
48
|
+
*
|
|
49
|
+
* The cost is that change detection is not forced on your behalf. Instead every
|
|
50
|
+
* method spends one macrotask on the scheduler (see {@link afterSchedulerTick}),
|
|
51
|
+
* which covers everything already scheduled — including the panel's first
|
|
52
|
+
* render. What it does not cover is state behind the component's own timers:
|
|
53
|
+
* {@link close} dispatches Escape and returns, and the panel detaches only after
|
|
54
|
+
* the 120 ms leave window in `popover.ts`. Wait for that by polling the DOM —
|
|
55
|
+
* `document.querySelector` needs no stabilization and so can neither hang nor
|
|
56
|
+
* burn a fixed interval — and only then read through the harness.
|
|
57
|
+
*
|
|
58
|
+
* ## Loading it
|
|
59
|
+
*
|
|
60
|
+
* The host is the trigger, which lives in the fixture, so the ordinary
|
|
61
|
+
* `TestbedHarnessEnvironment.loader(fixture)` is correct. The panel renders into
|
|
62
|
+
* the CDK overlay container outside the fixture, and this harness resolves it
|
|
63
|
+
* internally via `documentRootLocatorFactory()` — a consumer never needs
|
|
64
|
+
* `documentRootLoader`.
|
|
65
|
+
*
|
|
66
|
+
* The host selector is the directive's static `data-tw-popover-trigger` marker.
|
|
67
|
+
* `[twPopover]` cannot be used: it takes a required `TemplateRef` or component
|
|
68
|
+
* type, so it is always property-bound and Angular renders no attribute for a
|
|
69
|
+
* bound input. The marker also makes the match exact, so no disambiguation
|
|
70
|
+
* against `aria-haspopup="dialog"` — which the two date-picker triggers also
|
|
71
|
+
* carry — is needed.
|
|
72
|
+
*
|
|
73
|
+
* ## The panel is detached, not disposed
|
|
74
|
+
*
|
|
75
|
+
* Unlike `tw-select`, closing a popover **detaches** the portal and keeps the
|
|
76
|
+
* `OverlayRef` for reuse; it is only rebuilt when `twPopoverBackdrop` or
|
|
77
|
+
* `twPopoverScrollStrategy` changes. The panel element is therefore absent while
|
|
78
|
+
* closed and present again after a reopen, on the same overlay.
|
|
79
|
+
*/
|
|
80
|
+
class PopoverHarness extends ComponentHarness {
|
|
81
|
+
static hostSelector = '[data-tw-popover-trigger]';
|
|
82
|
+
/**
|
|
83
|
+
* Acquires one harness without waiting for the application to stabilize —
|
|
84
|
+
* the counterpart to the guarantee the methods below make.
|
|
85
|
+
*
|
|
86
|
+
* `loader.getHarness(...)` is CDK's own acquisition path and it stabilizes:
|
|
87
|
+
* `getAllRawElements` calls `forceStabilize()`, and `HarnessPredicate`
|
|
88
|
+
* filtering routes through `parallel()`, which asks *every* active fixture in
|
|
89
|
+
* the worker to settle. Both await `fixture.whenStable()`, which is the one
|
|
90
|
+
* thing this harness exists to avoid — and the failure that withdrew it was
|
|
91
|
+
* observed there, at acquisition, before any method had run.
|
|
92
|
+
*
|
|
93
|
+
* So acquisition is wrapped too, and `manualChangeDetection()` nests: the
|
|
94
|
+
* inner `parallel()` sees the flag already set and skips the stabilization
|
|
95
|
+
* entirely. **Render the fixture first** (`fixture.detectChanges()`), because
|
|
96
|
+
* nothing here will do it for you; an unrendered fixture fails loudly with
|
|
97
|
+
* CDK's "failed to find element" rather than returning something wrong.
|
|
98
|
+
*
|
|
99
|
+
* Plain `loader.getHarness(PopoverHarness)` still works and is still supported.
|
|
100
|
+
* This is the path to use when a suite must not be able to hang.
|
|
101
|
+
*/
|
|
102
|
+
static load(loader, options = {}) {
|
|
103
|
+
return manualChangeDetection(() => loader.getHarness(PopoverHarness.with(options)));
|
|
104
|
+
}
|
|
105
|
+
/** {@link load} for every matching trigger rather than the first. */
|
|
106
|
+
static loadAll(loader, options = {}) {
|
|
107
|
+
return manualChangeDetection(() => loader.getAllHarnesses(PopoverHarness.with(options)));
|
|
108
|
+
}
|
|
109
|
+
/** Predicate for `locatorFor` / `locatorForAll`. */
|
|
110
|
+
static with(options = {}) {
|
|
111
|
+
return new HarnessPredicate(PopoverHarness, options).addOption('triggerText', options.triggerText, async (h, text) => HarnessPredicate.stringMatches(await h.getTriggerText(), text));
|
|
112
|
+
}
|
|
113
|
+
/** The text currently rendered in the trigger, trimmed. */
|
|
114
|
+
async getTriggerText() {
|
|
115
|
+
return manualChangeDetection(async () => {
|
|
116
|
+
await afterSchedulerTick();
|
|
117
|
+
return (await (await this.host()).text()).trim();
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/** Whether the popover is open, read from the trigger's `aria-expanded`. */
|
|
121
|
+
async isOpen() {
|
|
122
|
+
return manualChangeDetection(async () => {
|
|
123
|
+
await afterSchedulerTick();
|
|
124
|
+
return (await (await this.host()).getAttribute('aria-expanded')) === 'true';
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Opens the popover by clicking the trigger. No-op when already open.
|
|
129
|
+
*
|
|
130
|
+
* This is the gesture for the default `twPopoverTriggerOn="click"`. A
|
|
131
|
+
* `'focus'`- or `'manual'`-triggered popover is opened through the directive's
|
|
132
|
+
* own `open()` (reachable via `exportAs: 'twPopover'`), not through a click.
|
|
133
|
+
*/
|
|
134
|
+
async open() {
|
|
135
|
+
await manualChangeDetection(async () => {
|
|
136
|
+
await afterSchedulerTick();
|
|
137
|
+
const host = await this.host();
|
|
138
|
+
if ((await host.getAttribute('aria-expanded')) === 'true')
|
|
139
|
+
return;
|
|
140
|
+
await host.click();
|
|
141
|
+
await afterSchedulerTick();
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Closes the popover by sending Escape to the trigger — the one dismissal
|
|
146
|
+
* that works for click, focus and manual triggers alike. No-op when already
|
|
147
|
+
* closed, and deliberately inert when `twPopoverCloseOnEscape` is `false`.
|
|
148
|
+
*
|
|
149
|
+
* Returns as soon as the key is dispatched. The panel detaches only after the
|
|
150
|
+
* 120 ms leave window; poll the DOM for its removal before asserting.
|
|
151
|
+
*/
|
|
152
|
+
async close() {
|
|
153
|
+
await manualChangeDetection(async () => {
|
|
154
|
+
await afterSchedulerTick();
|
|
155
|
+
const host = await this.host();
|
|
156
|
+
if ((await host.getAttribute('aria-expanded')) !== 'true')
|
|
157
|
+
return;
|
|
158
|
+
await host.sendKeys(TestKey.ESCAPE);
|
|
159
|
+
await afterSchedulerTick();
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Text rendered inside the panel, trimmed, or `null` when the popover is
|
|
164
|
+
* closed and the panel is detached.
|
|
165
|
+
*/
|
|
166
|
+
async getText() {
|
|
167
|
+
return manualChangeDetection(async () => {
|
|
168
|
+
await afterSchedulerTick();
|
|
169
|
+
const panel = await this.getPanel();
|
|
170
|
+
return panel ? (await panel.text()).trim() : null;
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Whether the panel renders its directional arrow (`twPopoverArrow`). `false`
|
|
175
|
+
* while the popover is closed, because the panel does not exist then.
|
|
176
|
+
*/
|
|
177
|
+
async hasArrow() {
|
|
178
|
+
return manualChangeDetection(async () => {
|
|
179
|
+
await afterSchedulerTick();
|
|
180
|
+
const id = await this.getPanelId();
|
|
181
|
+
if (!id)
|
|
182
|
+
return false;
|
|
183
|
+
// The arrow has no dedicated attribute hook: it is the panel wrapper's only
|
|
184
|
+
// `aria-hidden` grandchild span, with the content nested one level deeper.
|
|
185
|
+
const arrow = await this.documentRootLocatorFactory().locatorForOptional(`#${id} > div > span[aria-hidden="true"]`)();
|
|
186
|
+
return arrow !== null;
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* The panel element, or `null` when the popover is closed. Callers are already
|
|
191
|
+
* inside `manualChangeDetection`.
|
|
192
|
+
*/
|
|
193
|
+
async getPanel() {
|
|
194
|
+
const id = await this.getPanelId();
|
|
195
|
+
if (!id)
|
|
196
|
+
return null;
|
|
197
|
+
return this.documentRootLocatorFactory().locatorForOptional(`#${id}`)();
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* The id of this trigger's own panel, or `null` when closed. Scoping by
|
|
201
|
+
* `aria-controls` keeps sibling popovers apart.
|
|
202
|
+
*/
|
|
203
|
+
async getPanelId() {
|
|
204
|
+
return (await this.host()).getAttribute('aria-controls');
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Generated bundle index. Do not edit.
|
|
210
|
+
*/
|
|
211
|
+
|
|
212
|
+
export { PopoverHarness };
|
|
213
|
+
//# sourceMappingURL=cdevhub-ngx-tw-popover-testing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cdevhub-ngx-tw-popover-testing.mjs","sources":["../../../projects/ngx-tw/popover/testing/popover-harness.ts","../../../projects/ngx-tw/popover/testing/cdevhub-ngx-tw-popover-testing.ts"],"sourcesContent":["import {\n ComponentHarness,\n HarnessPredicate,\n TestKey,\n manualChangeDetection,\n} from '@angular/cdk/testing';\nimport type { BaseHarnessFilters, HarnessLoader, TestElement } from '@angular/cdk/testing';\n\n/** Filters accepted by `PopoverHarness.with`. */\nexport interface PopoverHarnessFilters extends BaseHarnessFilters {\n /** Match by the text rendered in the trigger. */\n triggerText?: string | RegExp;\n}\n\n/**\n * Lets the zoneless change-detection scheduler run its pending tick.\n *\n * `ApplicationRef` schedules a tick with `setTimeout(cb)` raced against\n * `requestAnimationFrame`. A timer registered *after* the notify that dirtied a\n * signal therefore fires *after* that tick, so one macrotask is enough to\n * observe everything already scheduled. It is a fixed, bounded yield, not a\n * stabilization await, so it cannot hang.\n *\n * Every method spends one: an action yields after dispatching, so the effects\n * the directive applied synchronously are rendered; a read yields before\n * looking, so it sees any tick that was already pending. The composition is what\n * matters — `open()` returns while the panel's first render is still pending,\n * and the following read's own yield is what picks the rendered content up.\n */\nfunction afterSchedulerTick(): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve));\n}\n\n/**\n * Harness for a `[twPopover]` trigger and the panel it opens.\n *\n * ## Nothing here awaits application stabilization, and that is load-bearing\n *\n * `TestbedHarnessEnvironment` routes every `TestElement` operation through\n * `forceStabilize()` — `fixture.detectChanges()` then\n * `await fixture.whenStable()` — and that await resolves only when Angular's\n * `PendingTasks` set is empty. Under full-suite contention it was observed\n * **not to resolve at all**, and everything built on it hung for the whole test\n * budget instead of failing. This harness was withdrawn twice for that.\n *\n * Every method body therefore runs inside CDK's `manualChangeDetection()`,\n * which sets the flag `forceStabilize()` early-returns on, and so does\n * acquisition, via {@link load} / {@link loadAll}. The spec beside this file\n * adds the third piece: it never awaits `fixture.whenStable()` either, not even\n * in `beforeEach`. All three were needed — each of the two CI failures during\n * this restoration was traced to one of them, and the second landed on\n * `tooltip` rather than here, which is how it became clear the fault belongs to\n * whichever harness spec lands in the unlucky worker slot rather than to any\n * one component. `grep -c whenStable` over this file and its spec returns zero,\n * which is the whole claim and is checkable in one command rather than by\n * counting green runs. The spec pins the rest with tests that hold a real\n * `PendingTasks` entry open across acquisition and every method.\n *\n * Why the application stops stabilizing is **not** known; this removes the\n * dependency rather than curing it.\n *\n * The cost is that change detection is not forced on your behalf. Instead every\n * method spends one macrotask on the scheduler (see {@link afterSchedulerTick}),\n * which covers everything already scheduled — including the panel's first\n * render. What it does not cover is state behind the component's own timers:\n * {@link close} dispatches Escape and returns, and the panel detaches only after\n * the 120 ms leave window in `popover.ts`. Wait for that by polling the DOM —\n * `document.querySelector` needs no stabilization and so can neither hang nor\n * burn a fixed interval — and only then read through the harness.\n *\n * ## Loading it\n *\n * The host is the trigger, which lives in the fixture, so the ordinary\n * `TestbedHarnessEnvironment.loader(fixture)` is correct. The panel renders into\n * the CDK overlay container outside the fixture, and this harness resolves it\n * internally via `documentRootLocatorFactory()` — a consumer never needs\n * `documentRootLoader`.\n *\n * The host selector is the directive's static `data-tw-popover-trigger` marker.\n * `[twPopover]` cannot be used: it takes a required `TemplateRef` or component\n * type, so it is always property-bound and Angular renders no attribute for a\n * bound input. The marker also makes the match exact, so no disambiguation\n * against `aria-haspopup=\"dialog\"` — which the two date-picker triggers also\n * carry — is needed.\n *\n * ## The panel is detached, not disposed\n *\n * Unlike `tw-select`, closing a popover **detaches** the portal and keeps the\n * `OverlayRef` for reuse; it is only rebuilt when `twPopoverBackdrop` or\n * `twPopoverScrollStrategy` changes. The panel element is therefore absent while\n * closed and present again after a reopen, on the same overlay.\n */\nexport class PopoverHarness extends ComponentHarness {\n static hostSelector = '[data-tw-popover-trigger]';\n\n /**\n * Acquires one harness without waiting for the application to stabilize —\n * the counterpart to the guarantee the methods below make.\n *\n * `loader.getHarness(...)` is CDK's own acquisition path and it stabilizes:\n * `getAllRawElements` calls `forceStabilize()`, and `HarnessPredicate`\n * filtering routes through `parallel()`, which asks *every* active fixture in\n * the worker to settle. Both await `fixture.whenStable()`, which is the one\n * thing this harness exists to avoid — and the failure that withdrew it was\n * observed there, at acquisition, before any method had run.\n *\n * So acquisition is wrapped too, and `manualChangeDetection()` nests: the\n * inner `parallel()` sees the flag already set and skips the stabilization\n * entirely. **Render the fixture first** (`fixture.detectChanges()`), because\n * nothing here will do it for you; an unrendered fixture fails loudly with\n * CDK's \"failed to find element\" rather than returning something wrong.\n *\n * Plain `loader.getHarness(PopoverHarness)` still works and is still supported.\n * This is the path to use when a suite must not be able to hang.\n */\n static load(loader: HarnessLoader, options: PopoverHarnessFilters = {}): Promise<PopoverHarness> {\n return manualChangeDetection(() => loader.getHarness(PopoverHarness.with(options)));\n }\n\n /** {@link load} for every matching trigger rather than the first. */\n static loadAll(\n loader: HarnessLoader,\n options: PopoverHarnessFilters = {},\n ): Promise<PopoverHarness[]> {\n return manualChangeDetection(() => loader.getAllHarnesses(PopoverHarness.with(options)));\n }\n\n /** Predicate for `locatorFor` / `locatorForAll`. */\n static with(options: PopoverHarnessFilters = {}): HarnessPredicate<PopoverHarness> {\n return new HarnessPredicate(PopoverHarness, options).addOption(\n 'triggerText',\n options.triggerText,\n async (h, text) => HarnessPredicate.stringMatches(await h.getTriggerText(), text),\n );\n }\n\n /** The text currently rendered in the trigger, trimmed. */\n async getTriggerText(): Promise<string> {\n return manualChangeDetection(async () => {\n await afterSchedulerTick();\n return (await (await this.host()).text()).trim();\n });\n }\n\n /** Whether the popover is open, read from the trigger's `aria-expanded`. */\n async isOpen(): Promise<boolean> {\n return manualChangeDetection(async () => {\n await afterSchedulerTick();\n return (await (await this.host()).getAttribute('aria-expanded')) === 'true';\n });\n }\n\n /**\n * Opens the popover by clicking the trigger. No-op when already open.\n *\n * This is the gesture for the default `twPopoverTriggerOn=\"click\"`. A\n * `'focus'`- or `'manual'`-triggered popover is opened through the directive's\n * own `open()` (reachable via `exportAs: 'twPopover'`), not through a click.\n */\n async open(): Promise<void> {\n await manualChangeDetection(async () => {\n await afterSchedulerTick();\n const host = await this.host();\n if ((await host.getAttribute('aria-expanded')) === 'true') return;\n await host.click();\n await afterSchedulerTick();\n });\n }\n\n /**\n * Closes the popover by sending Escape to the trigger — the one dismissal\n * that works for click, focus and manual triggers alike. No-op when already\n * closed, and deliberately inert when `twPopoverCloseOnEscape` is `false`.\n *\n * Returns as soon as the key is dispatched. The panel detaches only after the\n * 120 ms leave window; poll the DOM for its removal before asserting.\n */\n async close(): Promise<void> {\n await manualChangeDetection(async () => {\n await afterSchedulerTick();\n const host = await this.host();\n if ((await host.getAttribute('aria-expanded')) !== 'true') return;\n await host.sendKeys(TestKey.ESCAPE);\n await afterSchedulerTick();\n });\n }\n\n /**\n * Text rendered inside the panel, trimmed, or `null` when the popover is\n * closed and the panel is detached.\n */\n async getText(): Promise<string | null> {\n return manualChangeDetection(async () => {\n await afterSchedulerTick();\n const panel = await this.getPanel();\n return panel ? (await panel.text()).trim() : null;\n });\n }\n\n /**\n * Whether the panel renders its directional arrow (`twPopoverArrow`). `false`\n * while the popover is closed, because the panel does not exist then.\n */\n async hasArrow(): Promise<boolean> {\n return manualChangeDetection(async () => {\n await afterSchedulerTick();\n const id = await this.getPanelId();\n if (!id) return false;\n // The arrow has no dedicated attribute hook: it is the panel wrapper's only\n // `aria-hidden` grandchild span, with the content nested one level deeper.\n const arrow = await this.documentRootLocatorFactory().locatorForOptional(\n `#${id} > div > span[aria-hidden=\"true\"]`,\n )();\n return arrow !== null;\n });\n }\n\n /**\n * The panel element, or `null` when the popover is closed. Callers are already\n * inside `manualChangeDetection`.\n */\n private async getPanel(): Promise<TestElement | null> {\n const id = await this.getPanelId();\n if (!id) return null;\n return this.documentRootLocatorFactory().locatorForOptional(`#${id}`)();\n }\n\n /**\n * The id of this trigger's own panel, or `null` when closed. Scoping by\n * `aria-controls` keeps sibling popovers apart.\n */\n private async getPanelId(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-controls');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAcA;;;;;;;;;;;;;;AAcG;AACH,SAAS,kBAAkB,GAAA;AACzB,IAAA,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,OAAO,CAAC,CAAC;AACtD;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DG;AACG,MAAO,cAAe,SAAQ,gBAAgB,CAAA;AAClD,IAAA,OAAO,YAAY,GAAG,2BAA2B;AAEjD;;;;;;;;;;;;;;;;;;;AAmBG;AACH,IAAA,OAAO,IAAI,CAAC,MAAqB,EAAE,UAAiC,EAAE,EAAA;AACpE,QAAA,OAAO,qBAAqB,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CA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QAAA,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE;AAClC,QAAA,IAAI,CAAC,EAAE;AAAE,YAAA,OAAO,IAAI;AACpB,QAAA,OAAO,IAAI,CAAC,0BAA0B,EAAE,CAAC,kBAAkB,CAAC,CAAA,CAAA,EAAI,EAAE,CAAA,CAAE,CAAC,EAAE;IACzE;AAEA;;;AAGG;AACK,IAAA,MAAM,UAAU,GAAA;AACtB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,eAAe,CAAC;IAC1D;;;ACzOF;;AAEG;;;;"}
|
|
@@ -5,6 +5,7 @@ import { CdkPortalOutlet, ComponentPortal, TemplatePortal } from '@angular/cdk/p
|
|
|
5
5
|
import { FocusTrapFactory, _IdGenerator } from '@angular/cdk/a11y';
|
|
6
6
|
import { Subscription } from 'rxjs';
|
|
7
7
|
import { tv } from 'tailwind-variants';
|
|
8
|
+
import { consumeOverlayEscape } from '@cdevhub/ngx-tw/core';
|
|
8
9
|
|
|
9
10
|
/** Injection token providing arbitrary data to popover component content. */
|
|
10
11
|
const TW_POPOVER_DATA = new InjectionToken('TW_POPOVER_DATA');
|
|
@@ -563,11 +564,16 @@ class PopoverDirective {
|
|
|
563
564
|
if (!hasBackdrop && this.twPopoverCloseOnOutside()) {
|
|
564
565
|
this.perOpenSubs.add(this.overlayRef.outsidePointerEvents().subscribe(() => this.close()));
|
|
565
566
|
}
|
|
566
|
-
// Escape from within the overlay
|
|
567
|
-
|
|
568
|
-
|
|
567
|
+
// Escape from within the overlay. Uses `core`'s `consumeOverlayEscape`
|
|
568
|
+
// rather than re-filtering `keydownEvents()` here: that helper is exported
|
|
569
|
+
// from `@cdevhub/ngx-tw/core` as public API, and until this call site
|
|
570
|
+
// existed the library shipped a compatibility promise for a function it
|
|
571
|
+
// never used itself while duplicating its body inline.
|
|
572
|
+
// `Subscription.add()` accepts a teardown function, which is exactly what
|
|
573
|
+
// `consumeOverlayEscape` returns — the helper's own JSDoc names this shape.
|
|
574
|
+
this.perOpenSubs.add(consumeOverlayEscape(this.overlayRef, () => {
|
|
575
|
+
if (this.twPopoverCloseOnEscape())
|
|
569
576
|
this.close();
|
|
570
|
-
}
|
|
571
577
|
}));
|
|
572
578
|
// Per-open position change subscription — torn down on close to prevent
|
|
573
579
|
// accumulation when the directive is opened/closed many times.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdevhub-ngx-tw-popover.mjs","sources":["../../../projects/ngx-tw/popover/popover-tokens.ts","../../../projects/ngx-tw/popover/popover.ts","../../../projects/ngx-tw/popover/popover-close.ts","../../../projects/ngx-tw/popover/popover-title.ts","../../../projects/ngx-tw/popover/cdevhub-ngx-tw-popover.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\n/** Context object provided to popover template content. */\nexport interface PopoverTemplateContext<T = unknown> {\n /** The data passed via `twPopoverData` input. */\n $implicit: T;\n /** Closes the popover. */\n close: () => void;\n}\n\n/** Reference to control the popover from inside component content. */\nexport interface PopoverRef {\n /** Closes the popover. */\n close(): void;\n /** @internal — used by `PopoverTitleDirective` to register itself with `aria-labelledby`. */\n _addAriaLabelledBy?: (id: string) => void;\n /** @internal — used by `PopoverTitleDirective` to unregister itself. */\n _removeAriaLabelledBy?: (id: string) => void;\n}\n\n/** Injection token providing arbitrary data to popover component content. */\nexport const TW_POPOVER_DATA = new InjectionToken<unknown>('TW_POPOVER_DATA');\n\n/** Injection token providing a `PopoverRef` to popover component content. */\nexport const TW_POPOVER_REF = new InjectionToken<PopoverRef>('TW_POPOVER_REF');\n\n/**\n * @deprecated Renamed to {@link TW_POPOVER_DATA} for consistency with every\n * other ngx-tw injection token. This is the *same token instance*, not a copy —\n * providing under either name and injecting under the other resolves — so the\n * rename is safe to adopt incrementally. Removed in the next major.\n */\nexport const POPOVER_DATA = TW_POPOVER_DATA;\n\n/**\n * @deprecated Renamed to {@link TW_POPOVER_REF} for consistency with every\n * other ngx-tw injection token. This is the *same token instance*, not a copy —\n * providing under either name and injecting under the other resolves — so the\n * rename is safe to adopt incrementally. Removed in the next major.\n */\nexport const POPOVER_REF = TW_POPOVER_REF;\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n model,\n output,\n signal,\n TemplateRef,\n type Type,\n untracked,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n type ConnectedPosition,\n type FlexibleConnectedPositionStrategy,\n Overlay,\n type OverlayRef,\n} from '@angular/cdk/overlay';\nimport { CdkPortalOutlet, ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { FocusTrapFactory } from '@angular/cdk/a11y';\nimport { Subscription } from 'rxjs';\nimport { tv } from 'tailwind-variants';\nimport type { TwColor, TwSize } from '@cdevhub/ngx-tw/core';\nimport {\n TW_POPOVER_DATA,\n TW_POPOVER_REF,\n type PopoverRef,\n type PopoverTemplateContext,\n} from './popover-tokens';\n\n// ── Types ──\n\n/** Placement position of the popover relative to its trigger element. */\nexport type PopoverPosition =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'\n | 'right'\n | 'right-start'\n | 'right-end';\n\n/** Scroll strategy for the popover overlay. */\nexport type PopoverScrollStrategy = 'reposition' | 'close' | 'block' | 'noop';\n\n/** Backdrop behavior for the popover. */\nexport type PopoverBackdrop = 'transparent' | 'dimmed' | 'none';\n\n/** Trigger interaction that opens the popover. */\nexport type PopoverTrigger = 'click' | 'focus' | 'manual';\n\n/** Direction the arrow points toward (derived from resolved overlay position). */\ntype ArrowDirection = 'top' | 'bottom' | 'left' | 'right';\n\n/** Duration of leave animation in ms (must match _base.css scale-out/fade-out). */\nconst ANIMATION_DURATION = 120;\n\n// ── Variant config ──\n\nconst popoverVariants = tv(\n {\n slots: {\n wrapper: 'relative',\n panel:\n 'bg-surface-overlay text-fg text-sm border border-border rounded-lg shadow-md overflow-hidden',\n arrow: 'absolute size-2.5 rotate-45 bg-surface-overlay border border-border',\n },\n variants: {\n size: {\n xs: { panel: 'p-2' },\n sm: { panel: 'p-3' },\n md: { panel: 'p-4' },\n lg: { panel: 'p-6' },\n xl: { panel: 'p-8' },\n },\n },\n defaultVariants: { size: 'md' },\n },\n { twMerge: true },\n);\n\n// ── Color accent classes ──\n\nconst COLOR_ACCENT_CLASSES: Record<TwColor, string> = {\n primary: 'border-t-2 border-t-primary-500',\n secondary: 'border-t-2 border-t-secondary-500',\n accent: 'border-t-2 border-t-accent-500',\n neutral: 'border-t-2 border-t-neutral-500',\n info: 'border-t-2 border-t-info-500',\n success: 'border-t-2 border-t-success-500',\n warning: 'border-t-2 border-t-warning-500',\n error: 'border-t-2 border-t-error-500',\n};\n\n// ── Position mappings ──\n\nfunction buildPositionMap(offset: number): Record<PopoverPosition, ConnectedPosition> {\n return {\n top: {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -offset,\n },\n 'top-start': {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n offsetY: -offset,\n },\n 'top-end': {\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom',\n offsetY: -offset,\n },\n bottom: {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: offset,\n },\n 'bottom-start': {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n offsetY: offset,\n },\n 'bottom-end': {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n offsetY: offset,\n },\n left: {\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -offset,\n },\n 'left-start': {\n originX: 'start',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'top',\n offsetX: -offset,\n },\n 'left-end': {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'bottom',\n offsetX: -offset,\n },\n right: {\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: offset,\n },\n 'right-start': {\n originX: 'end',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'top',\n offsetX: offset,\n },\n 'right-end': {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'bottom',\n offsetX: offset,\n },\n };\n}\n\nconst FALLBACK_ORDER: Record<string, PopoverPosition[]> = {\n top: ['bottom', 'left', 'right'],\n bottom: ['top', 'left', 'right'],\n left: ['right', 'top', 'bottom'],\n right: ['left', 'top', 'bottom'],\n};\n\nfunction buildPositions(\n preferred: PopoverPosition,\n offset: number,\n): ConnectedPosition[] {\n const positionMap = buildPositionMap(offset);\n const primary = preferred.split('-')[0];\n const positions = [positionMap[preferred]];\n const fallbacks = FALLBACK_ORDER[primary] ?? FALLBACK_ORDER['top'];\n for (const fb of fallbacks) {\n positions.push(positionMap[fb]);\n }\n return positions;\n}\n\nfunction resolveArrowDirection(position: ConnectedPosition): ArrowDirection {\n if (position.overlayY === 'bottom') return 'bottom';\n if (position.overlayY === 'top') return 'top';\n if (position.overlayX === 'end') return 'right';\n return 'left';\n}\n\n/** Arrow position classes keyed by which side the arrow sits on. */\nconst ARROW_POSITION_CLASSES: Record<ArrowDirection, string> = {\n bottom: 'left-1/2 -translate-x-1/2 bottom-0 translate-y-1/2 border-t-0 border-l-0',\n top: 'left-1/2 -translate-x-1/2 top-0 -translate-y-1/2 border-b-0 border-r-0',\n right: 'top-1/2 -translate-y-1/2 right-0 translate-x-1/2 border-b-0 border-l-0',\n left: 'top-1/2 -translate-y-1/2 left-0 -translate-x-1/2 border-t-0 border-r-0',\n};\n\n// ── Internal overlay component (not exported) ──\n\nlet nextPopoverId = 0;\n\n@Component({\n selector: 'tw-popover-overlay',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CdkPortalOutlet],\n host: {\n class: 'origin-center',\n '[id]': 'id',\n '[attr.role]': '\"dialog\"',\n '[attr.aria-modal]': 'ariaModal() ? \"true\" : null',\n '[attr.aria-label]': 'ariaLabel() ?? null',\n '[attr.aria-labelledby]': 'computedAriaLabelledBy()',\n '[animate.enter]': '\"scale-in\"',\n '[animate.leave]': '\"scale-out\"',\n },\n template: `\n <div [class]=\"wrapperClasses()\">\n <div [class]=\"panelClasses()\">\n <ng-template [cdkPortalOutlet]=\"portal()\" />\n </div>\n @if (showArrow()) {\n <span [class]=\"arrowClasses()\" aria-hidden=\"true\"></span>\n }\n </div>\n `,\n})\nclass PopoverOverlayComponent {\n readonly id = `tw-popover-${nextPopoverId++}`;\n\n readonly size = signal<TwSize>('md');\n readonly color = signal<TwColor | undefined>(undefined);\n readonly showArrow = signal(true);\n readonly arrowDirection = signal<ArrowDirection>('top');\n readonly ariaLabel = signal<string | undefined>(undefined);\n readonly ariaModal = signal(true);\n readonly ariaLabelledByQueue = signal<readonly string[]>([]);\n readonly panelClass = signal<string>('');\n readonly portal = signal<TemplatePortal<PopoverTemplateContext> | ComponentPortal<unknown> | null>(null);\n\n readonly computedAriaLabelledBy = computed(() => {\n if (this.ariaLabel()) return null;\n return this.ariaLabelledByQueue()[0] ?? null;\n });\n\n /** @internal Registers a projected title's id so the panel's `aria-labelledby` points at it. */\n _addAriaLabelledBy(id: string): void {\n this.ariaLabelledByQueue.update((q) => (q.includes(id) ? q : [...q, id]));\n }\n\n /** @internal Unregisters a previously added `aria-labelledby` id when the title is destroyed. */\n _removeAriaLabelledBy(id: string): void {\n this.ariaLabelledByQueue.update((q) => q.filter((existing) => existing !== id));\n }\n\n private readonly variantResult = computed(() =>\n popoverVariants({ size: this.size() }),\n );\n\n readonly wrapperClasses = computed(() => this.variantResult().wrapper());\n\n readonly panelClasses = computed(() => {\n const base = this.variantResult().panel();\n const colorClass = this.color() ? COLOR_ACCENT_CLASSES[this.color()!] : '';\n const custom = this.panelClass();\n return [base, colorClass, custom].filter(Boolean).join(' ');\n });\n\n readonly arrowClasses = computed(() => {\n const base = this.variantResult().arrow();\n const position = ARROW_POSITION_CLASSES[this.arrowDirection()];\n return `${base} ${position}`;\n });\n}\n\n// ── Popover directive ──\n\n@Directive({\n selector: '[twPopover]',\n exportAs: 'twPopover',\n host: {\n // Static marker so the directive is locatable in tests and by consumers.\n // Its own selector is not usable for that: `[twPopover]` takes a required\n // `TemplateRef`, so it is ALWAYS property-bound and Angular emits no\n // attribute for a bound input. Material solves this with a class\n // (`.mat-mdc-menu-trigger`); `data-tw-*` is this repo's existing convention\n // (see `data-tw-table-loading`, `data-tw-sort-arrow`) and carries no styling.\n 'data-tw-popover-trigger': '',\n '[attr.aria-haspopup]': '\"dialog\"',\n '[attr.aria-expanded]': 'twPopoverOpen()',\n '[attr.aria-controls]': 'overlayComponentId()',\n '(click)': 'onHostClick()',\n '(focus)': 'onHostFocus()',\n '(blur)': 'onHostBlur()',\n '(keydown.escape)': 'onEscape()',\n },\n})\nexport class PopoverDirective {\n /** The content to render. An `ng-template` receives context with `$implicit` (data) and `close` (function). A component class receives data and a ref via injection tokens. */\n readonly twPopover = input.required<\n TemplateRef<PopoverTemplateContext> | Type<unknown>\n >();\n\n /** Preferred placement relative to the trigger. CDK handles fallback when space is insufficient. Defaults to `'bottom'`. */\n readonly twPopoverPosition = input<PopoverPosition>('bottom');\n\n /** What user interaction opens the popover. `'manual'` means consumers call `open()`/`close()` programmatically. Defaults to `'click'`. */\n readonly twPopoverTriggerOn = input<PopoverTrigger>('click');\n\n /** When true, all trigger interactions are suppressed. Defaults to `false`. */\n readonly twPopoverDisabled = input(false);\n\n /** Two-way bindable open state. Setting to `true` opens the popover; the popover sets it to `false` on close. Defaults to `false`. */\n readonly twPopoverOpen = model(false);\n\n /** Controls panel padding using the standard spacing scale. Defaults to `'md'`. */\n readonly twPopoverSize = input<TwSize>('md');\n\n /** Pixel distance between trigger and panel edge. Defaults to `8`. */\n readonly twPopoverOffset = input(8);\n\n /** Whether to render a directional arrow pointing at the trigger. Defaults to `true` — the arrow is the visual anchor tying the panel to its trigger; the special case is a compact iconic trigger where the arrow would crowd the layout. */\n readonly twPopoverArrow = input(true);\n\n /** Backdrop behavior. `'transparent'` catches outside clicks invisibly. `'dimmed'` adds a semi-transparent overlay. `'none'` disables the backdrop. Defaults to `'transparent'`. */\n readonly twPopoverBackdrop = input<PopoverBackdrop>('transparent');\n\n /** Whether clicking outside the panel closes the popover. Only relevant when backdrop is `'none'`. Defaults to `true` — clicking away is the universal dismiss gesture for floating panels; the special case is a popover owning a multi-step flow the user must complete. */\n readonly twPopoverCloseOnOutside = input(true);\n\n /** Whether pressing Escape closes the popover. Defaults to `true` — the WAI-ARIA dialog pattern mandates that Escape closes; the special case is a popover owning a child layer (nested dialog or menu) that should consume Escape first. */\n readonly twPopoverCloseOnEscape = input(true);\n\n /** CDK scroll strategy for the overlay. Defaults to `'reposition'`. */\n readonly twPopoverScrollStrategy = input<PopoverScrollStrategy>('reposition');\n\n /** Whether to trap focus inside the popover panel using CDK FocusTrapFactory. Defaults to `true` — it matches the `role=\"dialog\"` baseline, where a focus-trapped panel announces itself as modal; the special case is an inline popover acting as an informational tooltip. */\n readonly twPopoverTrapFocus = input(true);\n\n /** Arbitrary data passed to template context or component via `TW_POPOVER_DATA` token. Defaults to `undefined`. */\n readonly twPopoverData = input<unknown>(undefined);\n\n /** Additional CSS classes applied to the overlay panel for consumer customization. Defaults to an empty string. */\n readonly twPopoverPanelClass = input<string | string[]>('');\n\n /** Optional semantic color. When set, adds a colored top border accent to the panel. */\n readonly twPopoverColor = input<TwColor | undefined>(undefined);\n\n /** Explicit `aria-label` for the dialog panel. Defaults to `undefined`. */\n readonly twPopoverAriaLabel = input<string | undefined>(undefined);\n\n /** Fires after the popover becomes visible. */\n readonly twPopoverOpened = output<void>();\n\n /** Fires after the popover is fully removed. */\n readonly twPopoverClosed = output<void>();\n\n private readonly overlay = inject(Overlay);\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n private readonly focusTrapFactory = inject(FocusTrapFactory);\n\n private overlayRef: OverlayRef | null = null;\n private popoverInstance: PopoverOverlayComponent | null = null;\n private focusTrap: ReturnType<FocusTrapFactory['create']> | null = null;\n private perOpenSubs: Subscription | null = null;\n /** The `twPopoverBackdrop` value baked into the current `overlayRef`. */\n private appliedBackdrop: PopoverBackdrop | null = null;\n /** The `twPopoverScrollStrategy` value baked into the current `overlayRef`. */\n private appliedScrollStrategy: PopoverScrollStrategy | null = null;\n private closing = false;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n /** Tracked focus-blur close timer; cleared on destroy so it can't fire post-teardown. */\n private blurCloseTimer: ReturnType<typeof setTimeout> | null = null;\n private readonly overlayId = signal<string | null>(null);\n\n /** The overlay component's id for aria-controls binding. */\n protected readonly overlayComponentId = computed(() => this.overlayId());\n\n constructor() {\n // React to model changes from the parent\n effect(() => {\n const isOpen = this.twPopoverOpen();\n const disabled = this.twPopoverDisabled();\n if (disabled && this.popoverInstance) {\n this.closePopover();\n return;\n }\n if (isOpen && this.closing && this.popoverInstance && !disabled) {\n // Reopened before the leave animation finished. Cancelling the pending\n // close is preferable to queueing a reopen: the overlay is still\n // attached, so the surface simply stays up instead of visibly closing\n // and springing back. Without this the deferred callback below would\n // also write `false` over the consumer's `true`.\n this.cancelPendingClose();\n return;\n }\n if (isOpen && !this.popoverInstance && !disabled && !this.closing) {\n this.openPopover();\n } else if (!isOpen && this.popoverInstance) {\n this.closePopover();\n }\n });\n\n this.destroyRef.onDestroy(() => {\n this.clearCloseTimer();\n if (this.blurCloseTimer !== null) {\n clearTimeout(this.blurCloseTimer);\n this.blurCloseTimer = null;\n }\n this.destroyFocusTrap();\n this.perOpenSubs?.unsubscribe();\n this.disposeOverlay();\n });\n }\n\n /** Programmatically open the popover. */\n open(): void {\n if (this.twPopoverDisabled() || this.popoverInstance || this.closing) return;\n this.twPopoverOpen.set(true);\n }\n\n /** Programmatically close the popover. */\n close(): void {\n if (!this.popoverInstance && !this.closing) return;\n this.twPopoverOpen.set(false);\n }\n\n /** Toggle open/close. */\n toggle(): void {\n if (this.popoverInstance || this.closing) {\n this.close();\n } else {\n this.open();\n }\n }\n\n /** Force CDK to recalculate overlay position. */\n reposition(): void {\n this.overlayRef?.updatePosition();\n }\n\n // ── Host event handlers ──\n\n protected onHostClick(): void {\n if (this.twPopoverTriggerOn() === 'click') {\n this.toggle();\n }\n }\n\n protected onHostFocus(): void {\n if (this.twPopoverTriggerOn() === 'focus') {\n this.open();\n }\n }\n\n protected onHostBlur(): void {\n if (this.twPopoverTriggerOn() === 'focus') {\n if (this.blurCloseTimer !== null) clearTimeout(this.blurCloseTimer);\n this.blurCloseTimer = setTimeout(() => {\n this.blurCloseTimer = null;\n const activeEl = document.activeElement;\n const overlayEl = this.overlayRef?.overlayElement;\n if (overlayEl && overlayEl.contains(activeEl)) return;\n this.close();\n });\n }\n }\n\n protected onEscape(): void {\n if (this.twPopoverCloseOnEscape() && this.popoverInstance) {\n this.close();\n }\n }\n\n // ── Private ──\n\n private openPopover(): void {\n const createdFresh = this.ensureOverlay();\n // A freshly built OverlayRef already carries a strategy made from the\n // current inputs; only a reused one needs the per-open position refresh.\n if (!createdFresh) this.updatePositionStrategy();\n this.attachContent();\n this.subscribePerOpen();\n this.overlayId.set(this.popoverInstance?.id ?? null);\n this.setupFocusTrap();\n this.twPopoverOpened.emit();\n }\n\n private closePopover(): void {\n if (this.closing) return;\n this.closing = true;\n\n // Restore focus to the trigger UNLESS the consumer has deliberately moved\n // focus to a different focusable element outside the overlay. We detect\n // that by checking whether the active element is a real focusable target\n // outside the overlay — body/null means focus is \"unset\" and we should\n // still restore (the typical case after Escape or backdrop click).\n const overlayEl = this.overlayRef?.overlayElement;\n const activeEl = document.activeElement as HTMLElement | null;\n const focusOutsideOverlayIntentionally =\n !!activeEl &&\n activeEl !== document.body &&\n activeEl !== this.elementRef.nativeElement &&\n !overlayEl?.contains(activeEl);\n\n // 1. Destroy focus trap so focus can leave\n this.destroyFocusTrap();\n\n // 2. Return focus to trigger only when appropriate\n if (!focusOutsideOverlayIntentionally) {\n this.elementRef.nativeElement.focus();\n }\n\n // 3. Wait for leave animation, then detach\n this.closeTimer = setTimeout(() => {\n this.closeTimer = null;\n\n if (this.overlayRef?.hasAttached()) {\n this.overlayRef.detach();\n }\n\n this.perOpenSubs?.unsubscribe();\n this.perOpenSubs = null;\n this.popoverInstance = null;\n this.overlayId.set(null);\n\n // Use untracked to prevent effect re-trigger\n untracked(() => this.twPopoverOpen.set(false));\n\n this.twPopoverClosed.emit();\n this.closing = false;\n }, ANIMATION_DURATION);\n }\n\n private currentPositionStrategy: FlexibleConnectedPositionStrategy | null = null;\n\n private buildPositionStrategy(): FlexibleConnectedPositionStrategy {\n const positions = buildPositions(\n this.twPopoverPosition(),\n this.twPopoverOffset(),\n );\n\n return this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef)\n .withPositions(positions)\n .withFlexibleDimensions(false)\n .withPush(true)\n .withViewportMargin(8);\n }\n\n /**\n * Ensures an `OverlayRef` exists whose creation-time configuration matches the\n * current inputs. Returns `true` when a fresh ref was built.\n *\n * `hasBackdrop` / `backdropClass` are read by CDK inside `OverlayRef.attach()`\n * straight off the config object handed to `Overlay.create()`, and there is no\n * public setter that re-renders them. Since closing only detaches, a ref built\n * on the first open would otherwise keep the first open's backdrop for the\n * directive's whole lifetime — while `subscribePerOpen` re-reads\n * `twPopoverBackdrop` every open to decide whether backdrop-click closes, so\n * the two reads of one input disagreed. Rebuilding only when a creation-time\n * input actually changed keeps the common reopen path on the same ref.\n */\n private ensureOverlay(): boolean {\n const backdrop = this.twPopoverBackdrop();\n const scrollStrategyName = this.twPopoverScrollStrategy();\n\n if (this.overlayRef) {\n if (\n backdrop === this.appliedBackdrop &&\n scrollStrategyName === this.appliedScrollStrategy\n ) {\n return false;\n }\n this.overlayRef.dispose();\n this.overlayRef = null;\n this.currentPositionStrategy = null;\n }\n\n const positionStrategy = this.buildPositionStrategy();\n this.currentPositionStrategy = positionStrategy;\n\n const hasBackdrop = backdrop !== 'none';\n const backdropClass =\n backdrop === 'dimmed' ? 'bg-black/20' : 'cdk-overlay-transparent-backdrop';\n\n const scrollStrategy = this.resolveScrollStrategy();\n\n this.appliedBackdrop = backdrop;\n this.appliedScrollStrategy = scrollStrategyName;\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy,\n hasBackdrop,\n backdropClass,\n panelClass: 'tw-popover-panel',\n });\n return true;\n }\n\n private updatePositionStrategy(): void {\n if (!this.overlayRef) return;\n const positionStrategy = this.buildPositionStrategy();\n this.currentPositionStrategy = positionStrategy;\n this.overlayRef.updatePositionStrategy(positionStrategy);\n }\n\n private subscribePerOpen(): void {\n this.perOpenSubs?.unsubscribe();\n this.perOpenSubs = new Subscription();\n\n const backdrop = this.twPopoverBackdrop();\n const hasBackdrop = backdrop !== 'none';\n\n // Backdrop click closes\n if (hasBackdrop) {\n this.perOpenSubs.add(\n this.overlayRef!.backdropClick().subscribe(() => this.close()),\n );\n }\n\n // Outside pointer events when no backdrop\n if (!hasBackdrop && this.twPopoverCloseOnOutside()) {\n this.perOpenSubs.add(\n this.overlayRef!.outsidePointerEvents().subscribe(() => this.close()),\n );\n }\n\n // Escape from within the overlay\n this.perOpenSubs.add(\n this.overlayRef!.keydownEvents().subscribe((event) => {\n if (event.key === 'Escape' && this.twPopoverCloseOnEscape()) {\n this.close();\n }\n }),\n );\n\n // Per-open position change subscription — torn down on close to prevent\n // accumulation when the directive is opened/closed many times.\n if (this.currentPositionStrategy) {\n this.perOpenSubs.add(\n this.currentPositionStrategy.positionChanges.subscribe((change) => {\n if (this.popoverInstance) {\n const dir = resolveArrowDirection(change.connectionPair);\n this.popoverInstance.arrowDirection.set(dir);\n }\n }),\n );\n }\n }\n\n private attachContent(): void {\n const content = this.twPopover();\n\n // Attach the internal overlay component\n const overlayPortal = new ComponentPortal(\n PopoverOverlayComponent,\n this.viewContainerRef,\n );\n const componentRef = this.overlayRef!.attach(overlayPortal);\n this.popoverInstance = componentRef.instance;\n\n // Configure the overlay component\n this.popoverInstance.size.set(this.twPopoverSize());\n this.popoverInstance.color.set(this.twPopoverColor());\n this.popoverInstance.showArrow.set(this.twPopoverArrow());\n this.popoverInstance.ariaLabel.set(this.twPopoverAriaLabel());\n this.popoverInstance.ariaModal.set(this.twPopoverTrapFocus());\n this.popoverInstance.ariaLabelledByQueue.set([]);\n this.popoverInstance.panelClass.set(this.resolvePanelClass());\n\n // Provide TW_POPOVER_REF for both template and component content. Title directives\n // call _addAriaLabelledBy / _removeAriaLabelledBy to register their id with the\n // overlay's aria-labelledby queue.\n const overlayInstance = this.popoverInstance;\n const popoverRef: PopoverRef = {\n close: () => this.close(),\n _addAriaLabelledBy: (id) => overlayInstance._addAriaLabelledBy(id),\n _removeAriaLabelledBy: (id) => overlayInstance._removeAriaLabelledBy(id),\n };\n\n // Create the content portal\n if (content instanceof TemplateRef) {\n const context: PopoverTemplateContext = {\n $implicit: this.twPopoverData(),\n close: () => this.close(),\n };\n const templateInjector = Injector.create({\n parent: this.injector,\n providers: [\n { provide: TW_POPOVER_DATA, useValue: this.twPopoverData() },\n { provide: TW_POPOVER_REF, useValue: popoverRef },\n ],\n });\n const templatePortal = new TemplatePortal(\n content,\n this.viewContainerRef,\n context,\n templateInjector,\n );\n this.popoverInstance.portal.set(templatePortal);\n } else {\n const contentInjector = Injector.create({\n parent: this.injector,\n providers: [\n { provide: TW_POPOVER_DATA, useValue: this.twPopoverData() },\n { provide: TW_POPOVER_REF, useValue: popoverRef },\n ],\n });\n const componentPortal = new ComponentPortal(\n content,\n this.viewContainerRef,\n contentInjector,\n );\n this.popoverInstance.portal.set(componentPortal);\n }\n }\n\n private setupFocusTrap(): void {\n if (!this.twPopoverTrapFocus() || !this.overlayRef) return;\n const overlayEl = this.overlayRef.overlayElement;\n this.focusTrap = this.focusTrapFactory.create(overlayEl);\n this.focusTrap.focusInitialElementWhenReady();\n }\n\n private destroyFocusTrap(): void {\n this.focusTrap?.destroy();\n this.focusTrap = null;\n }\n\n private disposeOverlay(): void {\n this.overlayRef?.dispose();\n this.overlayRef = null;\n this.currentPositionStrategy = null;\n this.appliedBackdrop = null;\n this.appliedScrollStrategy = null;\n this.popoverInstance = null;\n }\n\n /**\n * Aborts an in-flight close, leaving the popover open.\n *\n * `closePopover` tears the focus trap down immediately and defers only the\n * detach, so cancelling has to rebuild the trap — the overlay itself is still\n * attached and the instance still live.\n */\n private cancelPendingClose(): void {\n this.clearCloseTimer();\n this.closing = false;\n this.setupFocusTrap();\n }\n\n private clearCloseTimer(): void {\n if (this.closeTimer !== null) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n\n private resolveScrollStrategy() {\n const strategy = this.twPopoverScrollStrategy();\n switch (strategy) {\n case 'close':\n return this.overlay.scrollStrategies.close();\n case 'block':\n return this.overlay.scrollStrategies.block();\n case 'noop':\n return this.overlay.scrollStrategies.noop();\n default:\n return this.overlay.scrollStrategies.reposition();\n }\n }\n\n private resolvePanelClass(): string {\n const raw = this.twPopoverPanelClass();\n return Array.isArray(raw) ? raw.join(' ') : raw;\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { TW_POPOVER_REF } from './popover-tokens';\n\n/**\n * Convenience directive that closes the enclosing popover when the host element is clicked.\n * Place on any element inside popover content.\n *\n * ```html\n * <button twPopoverClose>Cancel</button>\n * ```\n */\n@Directive({\n selector: '[twPopoverClose]',\n host: {\n '(click)': 'closePopover()',\n '[attr.type]': '\"button\"',\n },\n})\nexport class PopoverCloseDirective {\n private readonly popoverRef = inject(TW_POPOVER_REF, { optional: true });\n\n protected closePopover(): void {\n this.popoverRef?.close();\n }\n}\n","import {\n Directive,\n ElementRef,\n inject,\n input,\n type OnDestroy,\n type OnInit,\n} from '@angular/core';\nimport { _IdGenerator } from '@angular/cdk/a11y';\nimport { TW_POPOVER_REF } from './popover-tokens';\n\n/**\n * Popover title. Registers its ID with the enclosing popover overlay's\n * `aria-labelledby` queue so screen readers announce it automatically.\n *\n * Mirrors `DialogTitleDirective` and is the recommended way to label a\n * popover whose content has a heading. Use `twPopoverAriaLabel` when no\n * heading is present.\n */\n@Directive({\n selector: '[twPopoverTitle], tw-popover-title',\n host: {\n class: 'text-sm font-semibold text-fg',\n '[id]': 'id()',\n },\n})\nexport class PopoverTitleDirective implements OnInit, OnDestroy {\n private readonly generatedId = inject(_IdGenerator).getId('tw-popover-title-');\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly popoverRef = inject(TW_POPOVER_REF, { optional: true });\n\n /** Custom id for the title element. Defaults to a generated unique id. */\n readonly id = input<string>(this.generatedId);\n\n ngOnInit(): void {\n this.popoverRef?._addAriaLabelledBy?.(this.id());\n }\n\n ngOnDestroy(): void {\n this.popoverRef?._removeAriaLabelledBy?.(this.id());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAoBA;MACa,eAAe,GAAG,IAAI,cAAc,CAAU,iBAAiB;AAE5E;MACa,cAAc,GAAG,IAAI,cAAc,CAAa,gBAAgB;AAE7E;;;;;AAKG;AACI,MAAM,YAAY,GAAG;AAE5B;;;;;AAKG;AACI,MAAM,WAAW,GAAG;;AC0B3B;AACA,MAAM,kBAAkB,GAAG,GAAG;AAE9B;AAEA,MAAM,eAAe,GAAG,EAAE,CACxB;AACE,IAAA,KAAK,EAAE;AACL,QAAA,OAAO,EAAE,UAAU;AACnB,QAAA,KAAK,EACH,8FAA8F;AAChG,QAAA,KAAK,EAAE,qEAAqE;AAC7E,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;AACpB,YAAA,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;AACpB,YAAA,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;AACpB,YAAA,EAAE,EAAE,EAAE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ources":["../../../projects/ngx-tw/popover/popover-tokens.ts","../../../projects/ngx-tw/popover/popover.ts","../../../projects/ngx-tw/popover/popover-close.ts","../../../projects/ngx-tw/popover/popover-title.ts","../../../projects/ngx-tw/popover/cdevhub-ngx-tw-popover.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\n/** Context object provided to popover template content. */\nexport interface PopoverTemplateContext<T = unknown> {\n /** The data passed via `twPopoverData` input. */\n $implicit: T;\n /** Closes the popover. */\n close: () => void;\n}\n\n/** Reference to control the popover from inside component content. */\nexport interface PopoverRef {\n /** Closes the popover. */\n close(): void;\n /** @internal — used by `PopoverTitleDirective` to register itself with `aria-labelledby`. */\n _addAriaLabelledBy?: (id: string) => void;\n /** @internal — used by `PopoverTitleDirective` to unregister itself. */\n _removeAriaLabelledBy?: (id: string) => void;\n}\n\n/** Injection token providing arbitrary data to popover component content. */\nexport const TW_POPOVER_DATA = new InjectionToken<unknown>('TW_POPOVER_DATA');\n\n/** Injection token providing a `PopoverRef` to popover component content. */\nexport const TW_POPOVER_REF = new InjectionToken<PopoverRef>('TW_POPOVER_REF');\n\n/**\n * @deprecated Renamed to {@link TW_POPOVER_DATA} for consistency with every\n * other ngx-tw injection token. This is the *same token instance*, not a copy —\n * providing under either name and injecting under the other resolves — so the\n * rename is safe to adopt incrementally. Removed in the next major.\n */\nexport const POPOVER_DATA = TW_POPOVER_DATA;\n\n/**\n * @deprecated Renamed to {@link TW_POPOVER_REF} for consistency with every\n * other ngx-tw injection token. This is the *same token instance*, not a copy —\n * providing under either name and injecting under the other resolves — so the\n * rename is safe to adopt incrementally. Removed in the next major.\n */\nexport const POPOVER_REF = TW_POPOVER_REF;\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n Injector,\n input,\n model,\n output,\n signal,\n TemplateRef,\n type Type,\n untracked,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n type ConnectedPosition,\n type FlexibleConnectedPositionStrategy,\n Overlay,\n type OverlayRef,\n} from '@angular/cdk/overlay';\nimport { CdkPortalOutlet, ComponentPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { FocusTrapFactory } from '@angular/cdk/a11y';\nimport { Subscription } from 'rxjs';\nimport { tv } from 'tailwind-variants';\nimport { consumeOverlayEscape, type TwColor, type TwSize } from '@cdevhub/ngx-tw/core';\nimport {\n TW_POPOVER_DATA,\n TW_POPOVER_REF,\n type PopoverRef,\n type PopoverTemplateContext,\n} from './popover-tokens';\n\n// ── Types ──\n\n/** Placement position of the popover relative to its trigger element. */\nexport type PopoverPosition =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'\n | 'right'\n | 'right-start'\n | 'right-end';\n\n/** Scroll strategy for the popover overlay. */\nexport type PopoverScrollStrategy = 'reposition' | 'close' | 'block' | 'noop';\n\n/** Backdrop behavior for the popover. */\nexport type PopoverBackdrop = 'transparent' | 'dimmed' | 'none';\n\n/** Trigger interaction that opens the popover. */\nexport type PopoverTrigger = 'click' | 'focus' | 'manual';\n\n/** Direction the arrow points toward (derived from resolved overlay position). */\ntype ArrowDirection = 'top' | 'bottom' | 'left' | 'right';\n\n/** Duration of leave animation in ms (must match _base.css scale-out/fade-out). */\nconst ANIMATION_DURATION = 120;\n\n// ── Variant config ──\n\nconst popoverVariants = tv(\n {\n slots: {\n wrapper: 'relative',\n panel:\n 'bg-surface-overlay text-fg text-sm border border-border rounded-lg shadow-md overflow-hidden',\n arrow: 'absolute size-2.5 rotate-45 bg-surface-overlay border border-border',\n },\n variants: {\n size: {\n xs: { panel: 'p-2' },\n sm: { panel: 'p-3' },\n md: { panel: 'p-4' },\n lg: { panel: 'p-6' },\n xl: { panel: 'p-8' },\n },\n },\n defaultVariants: { size: 'md' },\n },\n { twMerge: true },\n);\n\n// ── Color accent classes ──\n\nconst COLOR_ACCENT_CLASSES: Record<TwColor, string> = {\n primary: 'border-t-2 border-t-primary-500',\n secondary: 'border-t-2 border-t-secondary-500',\n accent: 'border-t-2 border-t-accent-500',\n neutral: 'border-t-2 border-t-neutral-500',\n info: 'border-t-2 border-t-info-500',\n success: 'border-t-2 border-t-success-500',\n warning: 'border-t-2 border-t-warning-500',\n error: 'border-t-2 border-t-error-500',\n};\n\n// ── Position mappings ──\n\nfunction buildPositionMap(offset: number): Record<PopoverPosition, ConnectedPosition> {\n return {\n top: {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -offset,\n },\n 'top-start': {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n offsetY: -offset,\n },\n 'top-end': {\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom',\n offsetY: -offset,\n },\n bottom: {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: offset,\n },\n 'bottom-start': {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n offsetY: offset,\n },\n 'bottom-end': {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n offsetY: offset,\n },\n left: {\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -offset,\n },\n 'left-start': {\n originX: 'start',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'top',\n offsetX: -offset,\n },\n 'left-end': {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'bottom',\n offsetX: -offset,\n },\n right: {\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: offset,\n },\n 'right-start': {\n originX: 'end',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'top',\n offsetX: offset,\n },\n 'right-end': {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'bottom',\n offsetX: offset,\n },\n };\n}\n\nconst FALLBACK_ORDER: Record<string, PopoverPosition[]> = {\n top: ['bottom', 'left', 'right'],\n bottom: ['top', 'left', 'right'],\n left: ['right', 'top', 'bottom'],\n right: ['left', 'top', 'bottom'],\n};\n\nfunction buildPositions(\n preferred: PopoverPosition,\n offset: number,\n): ConnectedPosition[] {\n const positionMap = buildPositionMap(offset);\n const primary = preferred.split('-')[0];\n const positions = [positionMap[preferred]];\n const fallbacks = FALLBACK_ORDER[primary] ?? FALLBACK_ORDER['top'];\n for (const fb of fallbacks) {\n positions.push(positionMap[fb]);\n }\n return positions;\n}\n\nfunction resolveArrowDirection(position: ConnectedPosition): ArrowDirection {\n if (position.overlayY === 'bottom') return 'bottom';\n if (position.overlayY === 'top') return 'top';\n if (position.overlayX === 'end') return 'right';\n return 'left';\n}\n\n/** Arrow position classes keyed by which side the arrow sits on. */\nconst ARROW_POSITION_CLASSES: Record<ArrowDirection, string> = {\n bottom: 'left-1/2 -translate-x-1/2 bottom-0 translate-y-1/2 border-t-0 border-l-0',\n top: 'left-1/2 -translate-x-1/2 top-0 -translate-y-1/2 border-b-0 border-r-0',\n right: 'top-1/2 -translate-y-1/2 right-0 translate-x-1/2 border-b-0 border-l-0',\n left: 'top-1/2 -translate-y-1/2 left-0 -translate-x-1/2 border-t-0 border-r-0',\n};\n\n// ── Internal overlay component (not exported) ──\n\nlet nextPopoverId = 0;\n\n@Component({\n selector: 'tw-popover-overlay',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [CdkPortalOutlet],\n host: {\n class: 'origin-center',\n '[id]': 'id',\n '[attr.role]': '\"dialog\"',\n '[attr.aria-modal]': 'ariaModal() ? \"true\" : null',\n '[attr.aria-label]': 'ariaLabel() ?? null',\n '[attr.aria-labelledby]': 'computedAriaLabelledBy()',\n '[animate.enter]': '\"scale-in\"',\n '[animate.leave]': '\"scale-out\"',\n },\n template: `\n <div [class]=\"wrapperClasses()\">\n <div [class]=\"panelClasses()\">\n <ng-template [cdkPortalOutlet]=\"portal()\" />\n </div>\n @if (showArrow()) {\n <span [class]=\"arrowClasses()\" aria-hidden=\"true\"></span>\n }\n </div>\n `,\n})\nclass PopoverOverlayComponent {\n readonly id = `tw-popover-${nextPopoverId++}`;\n\n readonly size = signal<TwSize>('md');\n readonly color = signal<TwColor | undefined>(undefined);\n readonly showArrow = signal(true);\n readonly arrowDirection = signal<ArrowDirection>('top');\n readonly ariaLabel = signal<string | undefined>(undefined);\n readonly ariaModal = signal(true);\n readonly ariaLabelledByQueue = signal<readonly string[]>([]);\n readonly panelClass = signal<string>('');\n readonly portal = signal<TemplatePortal<PopoverTemplateContext> | ComponentPortal<unknown> | null>(null);\n\n readonly computedAriaLabelledBy = computed(() => {\n if (this.ariaLabel()) return null;\n return this.ariaLabelledByQueue()[0] ?? null;\n });\n\n /** @internal Registers a projected title's id so the panel's `aria-labelledby` points at it. */\n _addAriaLabelledBy(id: string): void {\n this.ariaLabelledByQueue.update((q) => (q.includes(id) ? q : [...q, id]));\n }\n\n /** @internal Unregisters a previously added `aria-labelledby` id when the title is destroyed. */\n _removeAriaLabelledBy(id: string): void {\n this.ariaLabelledByQueue.update((q) => q.filter((existing) => existing !== id));\n }\n\n private readonly variantResult = computed(() =>\n popoverVariants({ size: this.size() }),\n );\n\n readonly wrapperClasses = computed(() => this.variantResult().wrapper());\n\n readonly panelClasses = computed(() => {\n const base = this.variantResult().panel();\n const colorClass = this.color() ? COLOR_ACCENT_CLASSES[this.color()!] : '';\n const custom = this.panelClass();\n return [base, colorClass, custom].filter(Boolean).join(' ');\n });\n\n readonly arrowClasses = computed(() => {\n const base = this.variantResult().arrow();\n const position = ARROW_POSITION_CLASSES[this.arrowDirection()];\n return `${base} ${position}`;\n });\n}\n\n// ── Popover directive ──\n\n@Directive({\n selector: '[twPopover]',\n exportAs: 'twPopover',\n host: {\n // Static marker so the directive is locatable in tests and by consumers.\n // Its own selector is not usable for that: `[twPopover]` takes a required\n // `TemplateRef`, so it is ALWAYS property-bound and Angular emits no\n // attribute for a bound input. Material solves this with a class\n // (`.mat-mdc-menu-trigger`); `data-tw-*` is this repo's existing convention\n // (see `data-tw-table-loading`, `data-tw-sort-arrow`) and carries no styling.\n 'data-tw-popover-trigger': '',\n '[attr.aria-haspopup]': '\"dialog\"',\n '[attr.aria-expanded]': 'twPopoverOpen()',\n '[attr.aria-controls]': 'overlayComponentId()',\n '(click)': 'onHostClick()',\n '(focus)': 'onHostFocus()',\n '(blur)': 'onHostBlur()',\n '(keydown.escape)': 'onEscape()',\n },\n})\nexport class PopoverDirective {\n /** The content to render. An `ng-template` receives context with `$implicit` (data) and `close` (function). A component class receives data and a ref via injection tokens. */\n readonly twPopover = input.required<\n TemplateRef<PopoverTemplateContext> | Type<unknown>\n >();\n\n /** Preferred placement relative to the trigger. CDK handles fallback when space is insufficient. Defaults to `'bottom'`. */\n readonly twPopoverPosition = input<PopoverPosition>('bottom');\n\n /** What user interaction opens the popover. `'manual'` means consumers call `open()`/`close()` programmatically. Defaults to `'click'`. */\n readonly twPopoverTriggerOn = input<PopoverTrigger>('click');\n\n /** When true, all trigger interactions are suppressed. Defaults to `false`. */\n readonly twPopoverDisabled = input(false);\n\n /** Two-way bindable open state. Setting to `true` opens the popover; the popover sets it to `false` on close. Defaults to `false`. */\n readonly twPopoverOpen = model(false);\n\n /** Controls panel padding using the standard spacing scale. Defaults to `'md'`. */\n readonly twPopoverSize = input<TwSize>('md');\n\n /** Pixel distance between trigger and panel edge. Defaults to `8`. */\n readonly twPopoverOffset = input(8);\n\n /** Whether to render a directional arrow pointing at the trigger. Defaults to `true` — the arrow is the visual anchor tying the panel to its trigger; the special case is a compact iconic trigger where the arrow would crowd the layout. */\n readonly twPopoverArrow = input(true);\n\n /** Backdrop behavior. `'transparent'` catches outside clicks invisibly. `'dimmed'` adds a semi-transparent overlay. `'none'` disables the backdrop. Defaults to `'transparent'`. */\n readonly twPopoverBackdrop = input<PopoverBackdrop>('transparent');\n\n /** Whether clicking outside the panel closes the popover. Only relevant when backdrop is `'none'`. Defaults to `true` — clicking away is the universal dismiss gesture for floating panels; the special case is a popover owning a multi-step flow the user must complete. */\n readonly twPopoverCloseOnOutside = input(true);\n\n /** Whether pressing Escape closes the popover. Defaults to `true` — the WAI-ARIA dialog pattern mandates that Escape closes; the special case is a popover owning a child layer (nested dialog or menu) that should consume Escape first. */\n readonly twPopoverCloseOnEscape = input(true);\n\n /** CDK scroll strategy for the overlay. Defaults to `'reposition'`. */\n readonly twPopoverScrollStrategy = input<PopoverScrollStrategy>('reposition');\n\n /** Whether to trap focus inside the popover panel using CDK FocusTrapFactory. Defaults to `true` — it matches the `role=\"dialog\"` baseline, where a focus-trapped panel announces itself as modal; the special case is an inline popover acting as an informational tooltip. */\n readonly twPopoverTrapFocus = input(true);\n\n /** Arbitrary data passed to template context or component via `TW_POPOVER_DATA` token. Defaults to `undefined`. */\n readonly twPopoverData = input<unknown>(undefined);\n\n /** Additional CSS classes applied to the overlay panel for consumer customization. Defaults to an empty string. */\n readonly twPopoverPanelClass = input<string | string[]>('');\n\n /** Optional semantic color. When set, adds a colored top border accent to the panel. */\n readonly twPopoverColor = input<TwColor | undefined>(undefined);\n\n /** Explicit `aria-label` for the dialog panel. Defaults to `undefined`. */\n readonly twPopoverAriaLabel = input<string | undefined>(undefined);\n\n /** Fires after the popover becomes visible. */\n readonly twPopoverOpened = output<void>();\n\n /** Fires after the popover is fully removed. */\n readonly twPopoverClosed = output<void>();\n\n private readonly overlay = inject(Overlay);\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n private readonly focusTrapFactory = inject(FocusTrapFactory);\n\n private overlayRef: OverlayRef | null = null;\n private popoverInstance: PopoverOverlayComponent | null = null;\n private focusTrap: ReturnType<FocusTrapFactory['create']> | null = null;\n private perOpenSubs: Subscription | null = null;\n /** The `twPopoverBackdrop` value baked into the current `overlayRef`. */\n private appliedBackdrop: PopoverBackdrop | null = null;\n /** The `twPopoverScrollStrategy` value baked into the current `overlayRef`. */\n private appliedScrollStrategy: PopoverScrollStrategy | null = null;\n private closing = false;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n /** Tracked focus-blur close timer; cleared on destroy so it can't fire post-teardown. */\n private blurCloseTimer: ReturnType<typeof setTimeout> | null = null;\n private readonly overlayId = signal<string | null>(null);\n\n /** The overlay component's id for aria-controls binding. */\n protected readonly overlayComponentId = computed(() => this.overlayId());\n\n constructor() {\n // React to model changes from the parent\n effect(() => {\n const isOpen = this.twPopoverOpen();\n const disabled = this.twPopoverDisabled();\n if (disabled && this.popoverInstance) {\n this.closePopover();\n return;\n }\n if (isOpen && this.closing && this.popoverInstance && !disabled) {\n // Reopened before the leave animation finished. Cancelling the pending\n // close is preferable to queueing a reopen: the overlay is still\n // attached, so the surface simply stays up instead of visibly closing\n // and springing back. Without this the deferred callback below would\n // also write `false` over the consumer's `true`.\n this.cancelPendingClose();\n return;\n }\n if (isOpen && !this.popoverInstance && !disabled && !this.closing) {\n this.openPopover();\n } else if (!isOpen && this.popoverInstance) {\n this.closePopover();\n }\n });\n\n this.destroyRef.onDestroy(() => {\n this.clearCloseTimer();\n if (this.blurCloseTimer !== null) {\n clearTimeout(this.blurCloseTimer);\n this.blurCloseTimer = null;\n }\n this.destroyFocusTrap();\n this.perOpenSubs?.unsubscribe();\n this.disposeOverlay();\n });\n }\n\n /** Programmatically open the popover. */\n open(): void {\n if (this.twPopoverDisabled() || this.popoverInstance || this.closing) return;\n this.twPopoverOpen.set(true);\n }\n\n /** Programmatically close the popover. */\n close(): void {\n if (!this.popoverInstance && !this.closing) return;\n this.twPopoverOpen.set(false);\n }\n\n /** Toggle open/close. */\n toggle(): void {\n if (this.popoverInstance || this.closing) {\n this.close();\n } else {\n this.open();\n }\n }\n\n /** Force CDK to recalculate overlay position. */\n reposition(): void {\n this.overlayRef?.updatePosition();\n }\n\n // ── Host event handlers ──\n\n protected onHostClick(): void {\n if (this.twPopoverTriggerOn() === 'click') {\n this.toggle();\n }\n }\n\n protected onHostFocus(): void {\n if (this.twPopoverTriggerOn() === 'focus') {\n this.open();\n }\n }\n\n protected onHostBlur(): void {\n if (this.twPopoverTriggerOn() === 'focus') {\n if (this.blurCloseTimer !== null) clearTimeout(this.blurCloseTimer);\n this.blurCloseTimer = setTimeout(() => {\n this.blurCloseTimer = null;\n const activeEl = document.activeElement;\n const overlayEl = this.overlayRef?.overlayElement;\n if (overlayEl && overlayEl.contains(activeEl)) return;\n this.close();\n });\n }\n }\n\n protected onEscape(): void {\n if (this.twPopoverCloseOnEscape() && this.popoverInstance) {\n this.close();\n }\n }\n\n // ── Private ──\n\n private openPopover(): void {\n const createdFresh = this.ensureOverlay();\n // A freshly built OverlayRef already carries a strategy made from the\n // current inputs; only a reused one needs the per-open position refresh.\n if (!createdFresh) this.updatePositionStrategy();\n this.attachContent();\n this.subscribePerOpen();\n this.overlayId.set(this.popoverInstance?.id ?? null);\n this.setupFocusTrap();\n this.twPopoverOpened.emit();\n }\n\n private closePopover(): void {\n if (this.closing) return;\n this.closing = true;\n\n // Restore focus to the trigger UNLESS the consumer has deliberately moved\n // focus to a different focusable element outside the overlay. We detect\n // that by checking whether the active element is a real focusable target\n // outside the overlay — body/null means focus is \"unset\" and we should\n // still restore (the typical case after Escape or backdrop click).\n const overlayEl = this.overlayRef?.overlayElement;\n const activeEl = document.activeElement as HTMLElement | null;\n const focusOutsideOverlayIntentionally =\n !!activeEl &&\n activeEl !== document.body &&\n activeEl !== this.elementRef.nativeElement &&\n !overlayEl?.contains(activeEl);\n\n // 1. Destroy focus trap so focus can leave\n this.destroyFocusTrap();\n\n // 2. Return focus to trigger only when appropriate\n if (!focusOutsideOverlayIntentionally) {\n this.elementRef.nativeElement.focus();\n }\n\n // 3. Wait for leave animation, then detach\n this.closeTimer = setTimeout(() => {\n this.closeTimer = null;\n\n if (this.overlayRef?.hasAttached()) {\n this.overlayRef.detach();\n }\n\n this.perOpenSubs?.unsubscribe();\n this.perOpenSubs = null;\n this.popoverInstance = null;\n this.overlayId.set(null);\n\n // Use untracked to prevent effect re-trigger\n untracked(() => this.twPopoverOpen.set(false));\n\n this.twPopoverClosed.emit();\n this.closing = false;\n }, ANIMATION_DURATION);\n }\n\n private currentPositionStrategy: FlexibleConnectedPositionStrategy | null = null;\n\n private buildPositionStrategy(): FlexibleConnectedPositionStrategy {\n const positions = buildPositions(\n this.twPopoverPosition(),\n this.twPopoverOffset(),\n );\n\n return this.overlay\n .position()\n .flexibleConnectedTo(this.elementRef)\n .withPositions(positions)\n .withFlexibleDimensions(false)\n .withPush(true)\n .withViewportMargin(8);\n }\n\n /**\n * Ensures an `OverlayRef` exists whose creation-time configuration matches the\n * current inputs. Returns `true` when a fresh ref was built.\n *\n * `hasBackdrop` / `backdropClass` are read by CDK inside `OverlayRef.attach()`\n * straight off the config object handed to `Overlay.create()`, and there is no\n * public setter that re-renders them. Since closing only detaches, a ref built\n * on the first open would otherwise keep the first open's backdrop for the\n * directive's whole lifetime — while `subscribePerOpen` re-reads\n * `twPopoverBackdrop` every open to decide whether backdrop-click closes, so\n * the two reads of one input disagreed. Rebuilding only when a creation-time\n * input actually changed keeps the common reopen path on the same ref.\n */\n private ensureOverlay(): boolean {\n const backdrop = this.twPopoverBackdrop();\n const scrollStrategyName = this.twPopoverScrollStrategy();\n\n if (this.overlayRef) {\n if (\n backdrop === this.appliedBackdrop &&\n scrollStrategyName === this.appliedScrollStrategy\n ) {\n return false;\n }\n this.overlayRef.dispose();\n this.overlayRef = null;\n this.currentPositionStrategy = null;\n }\n\n const positionStrategy = this.buildPositionStrategy();\n this.currentPositionStrategy = positionStrategy;\n\n const hasBackdrop = backdrop !== 'none';\n const backdropClass =\n backdrop === 'dimmed' ? 'bg-black/20' : 'cdk-overlay-transparent-backdrop';\n\n const scrollStrategy = this.resolveScrollStrategy();\n\n this.appliedBackdrop = backdrop;\n this.appliedScrollStrategy = scrollStrategyName;\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy,\n hasBackdrop,\n backdropClass,\n panelClass: 'tw-popover-panel',\n });\n return true;\n }\n\n private updatePositionStrategy(): void {\n if (!this.overlayRef) return;\n const positionStrategy = this.buildPositionStrategy();\n this.currentPositionStrategy = positionStrategy;\n this.overlayRef.updatePositionStrategy(positionStrategy);\n }\n\n private subscribePerOpen(): void {\n this.perOpenSubs?.unsubscribe();\n this.perOpenSubs = new Subscription();\n\n const backdrop = this.twPopoverBackdrop();\n const hasBackdrop = backdrop !== 'none';\n\n // Backdrop click closes\n if (hasBackdrop) {\n this.perOpenSubs.add(\n this.overlayRef!.backdropClick().subscribe(() => this.close()),\n );\n }\n\n // Outside pointer events when no backdrop\n if (!hasBackdrop && this.twPopoverCloseOnOutside()) {\n this.perOpenSubs.add(\n this.overlayRef!.outsidePointerEvents().subscribe(() => this.close()),\n );\n }\n\n // Escape from within the overlay. Uses `core`'s `consumeOverlayEscape`\n // rather than re-filtering `keydownEvents()` here: that helper is exported\n // from `@cdevhub/ngx-tw/core` as public API, and until this call site\n // existed the library shipped a compatibility promise for a function it\n // never used itself while duplicating its body inline.\n // `Subscription.add()` accepts a teardown function, which is exactly what\n // `consumeOverlayEscape` returns — the helper's own JSDoc names this shape.\n this.perOpenSubs.add(\n consumeOverlayEscape(this.overlayRef!, () => {\n if (this.twPopoverCloseOnEscape()) this.close();\n }),\n );\n\n // Per-open position change subscription — torn down on close to prevent\n // accumulation when the directive is opened/closed many times.\n if (this.currentPositionStrategy) {\n this.perOpenSubs.add(\n this.currentPositionStrategy.positionChanges.subscribe((change) => {\n if (this.popoverInstance) {\n const dir = resolveArrowDirection(change.connectionPair);\n this.popoverInstance.arrowDirection.set(dir);\n }\n }),\n );\n }\n }\n\n private attachContent(): void {\n const content = this.twPopover();\n\n // Attach the internal overlay component\n const overlayPortal = new ComponentPortal(\n PopoverOverlayComponent,\n this.viewContainerRef,\n );\n const componentRef = this.overlayRef!.attach(overlayPortal);\n this.popoverInstance = componentRef.instance;\n\n // Configure the overlay component\n this.popoverInstance.size.set(this.twPopoverSize());\n this.popoverInstance.color.set(this.twPopoverColor());\n this.popoverInstance.showArrow.set(this.twPopoverArrow());\n this.popoverInstance.ariaLabel.set(this.twPopoverAriaLabel());\n this.popoverInstance.ariaModal.set(this.twPopoverTrapFocus());\n this.popoverInstance.ariaLabelledByQueue.set([]);\n this.popoverInstance.panelClass.set(this.resolvePanelClass());\n\n // Provide TW_POPOVER_REF for both template and component content. Title directives\n // call _addAriaLabelledBy / _removeAriaLabelledBy to register their id with the\n // overlay's aria-labelledby queue.\n const overlayInstance = this.popoverInstance;\n const popoverRef: PopoverRef = {\n close: () => this.close(),\n _addAriaLabelledBy: (id) => overlayInstance._addAriaLabelledBy(id),\n _removeAriaLabelledBy: (id) => overlayInstance._removeAriaLabelledBy(id),\n };\n\n // Create the content portal\n if (content instanceof TemplateRef) {\n const context: PopoverTemplateContext = {\n $implicit: this.twPopoverData(),\n close: () => this.close(),\n };\n const templateInjector = Injector.create({\n parent: this.injector,\n providers: [\n { provide: TW_POPOVER_DATA, useValue: this.twPopoverData() },\n { provide: TW_POPOVER_REF, useValue: popoverRef },\n ],\n });\n const templatePortal = new TemplatePortal(\n content,\n this.viewContainerRef,\n context,\n templateInjector,\n );\n this.popoverInstance.portal.set(templatePortal);\n } else {\n const contentInjector = Injector.create({\n parent: this.injector,\n providers: [\n { provide: TW_POPOVER_DATA, useValue: this.twPopoverData() },\n { provide: TW_POPOVER_REF, useValue: popoverRef },\n ],\n });\n const componentPortal = new ComponentPortal(\n content,\n this.viewContainerRef,\n contentInjector,\n );\n this.popoverInstance.portal.set(componentPortal);\n }\n }\n\n private setupFocusTrap(): void {\n if (!this.twPopoverTrapFocus() || !this.overlayRef) return;\n const overlayEl = this.overlayRef.overlayElement;\n this.focusTrap = this.focusTrapFactory.create(overlayEl);\n this.focusTrap.focusInitialElementWhenReady();\n }\n\n private destroyFocusTrap(): void {\n this.focusTrap?.destroy();\n this.focusTrap = null;\n }\n\n private disposeOverlay(): void {\n this.overlayRef?.dispose();\n this.overlayRef = null;\n this.currentPositionStrategy = null;\n this.appliedBackdrop = null;\n this.appliedScrollStrategy = null;\n this.popoverInstance = null;\n }\n\n /**\n * Aborts an in-flight close, leaving the popover open.\n *\n * `closePopover` tears the focus trap down immediately and defers only the\n * detach, so cancelling has to rebuild the trap — the overlay itself is still\n * attached and the instance still live.\n */\n private cancelPendingClose(): void {\n this.clearCloseTimer();\n this.closing = false;\n this.setupFocusTrap();\n }\n\n private clearCloseTimer(): void {\n if (this.closeTimer !== null) {\n clearTimeout(this.closeTimer);\n this.closeTimer = null;\n }\n }\n\n private resolveScrollStrategy() {\n const strategy = this.twPopoverScrollStrategy();\n switch (strategy) {\n case 'close':\n return this.overlay.scrollStrategies.close();\n case 'block':\n return this.overlay.scrollStrategies.block();\n case 'noop':\n return this.overlay.scrollStrategies.noop();\n default:\n return this.overlay.scrollStrategies.reposition();\n }\n }\n\n private resolvePanelClass(): string {\n const raw = this.twPopoverPanelClass();\n return Array.isArray(raw) ? raw.join(' ') : raw;\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { TW_POPOVER_REF } from './popover-tokens';\n\n/**\n * Convenience directive that closes the enclosing popover when the host element is clicked.\n * Place on any element inside popover content.\n *\n * ```html\n * <button twPopoverClose>Cancel</button>\n * ```\n */\n@Directive({\n selector: '[twPopoverClose]',\n host: {\n '(click)': 'closePopover()',\n '[attr.type]': '\"button\"',\n },\n})\nexport class PopoverCloseDirective {\n private readonly popoverRef = inject(TW_POPOVER_REF, { optional: true });\n\n protected closePopover(): void {\n this.popoverRef?.close();\n }\n}\n","import {\n Directive,\n ElementRef,\n inject,\n input,\n type OnDestroy,\n type OnInit,\n} from '@angular/core';\nimport { _IdGenerator } from '@angular/cdk/a11y';\nimport { TW_POPOVER_REF } from './popover-tokens';\n\n/**\n * Popover title. Registers its ID with the enclosing popover overlay's\n * `aria-labelledby` queue so screen readers announce it automatically.\n *\n * Mirrors `DialogTitleDirective` and is the recommended way to label a\n * popover whose content has a heading. Use `twPopoverAriaLabel` when no\n * heading is present.\n */\n@Directive({\n selector: '[twPopoverTitle], tw-popover-title',\n host: {\n class: 'text-sm font-semibold text-fg',\n '[id]': 'id()',\n },\n})\nexport class PopoverTitleDirective implements OnInit, OnDestroy {\n private readonly generatedId = inject(_IdGenerator).getId('tw-popover-title-');\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly popoverRef = inject(TW_POPOVER_REF, { optional: true });\n\n /** Custom id for the title element. Defaults to a generated unique id. */\n readonly id = input<string>(this.generatedId);\n\n ngOnInit(): void {\n this.popoverRef?._addAriaLabelledBy?.(this.id());\n }\n\n ngOnDestroy(): void {\n this.popoverRef?._removeAriaLabelledBy?.(this.id());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAoBA;MACa,eAAe,GAAG,IAAI,cAAc,CAAU,iBAAiB;AAE5E;MACa,cAAc,GAAG,IAAI,cAAc,CAAa,gBAAgB;AAE7E;;;;;AAKG;AACI,MAAM,YAAY,GAAG;AAE5B;;;;;AAKG;AACI,MAAM,WAAW,GAAG;;AC0B3B;AACA,MAAM,kBAAkB,GAAG,GAAG;AAE9B;AAEA,MAAM,eAAe,GAAG,EAAE,CACxB;AACE,IAAA,KAAK,EAAE;AACL,QAAA,OAAO,EAAE,UAAU;AACnB,QAAA,KAAK,EACH,8FAA8F;AAChG,QAAA,KAAK,EAAE,qEAAqE;AAC7E,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;AACpB,YAAA,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;AACpB,YAAA,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;AACpB,YAAA,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;AACpB,YAAA,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;AACrB,SAAA;AACF,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AAQ,EAAE,IAAI,EAAE,CAAC;;AAG/D,IAAA,EAAE,GAAG,KAAK,CAAS,IAAI,CAAC,WAAW;2EAAC;IAE7C,QAAQ,GAAA;QACN,IAAI,CAAC,UAAU,EAAE,kBAAkB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IAClD;IAEA,WAAW,GAAA;QACT,IAAI,CAAC,UAAU,EAAE,qBAAqB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;IACrD;uGAdW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oCAAA,EAAA,MAAA,EAAA,EAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,+BAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oCAAoC;AAC9C,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,+BAA+B;AACtC,wBAAA,MAAM,EAAE,MAAM;AACf,qBAAA;AACF,iBAAA;;;ACzBD;;AAEG;;;;"}
|
|
@@ -128,7 +128,7 @@ const SOLID_RING = {
|
|
|
128
128
|
neutral: 'border-fg',
|
|
129
129
|
info: 'border-info-600',
|
|
130
130
|
success: 'border-success-600',
|
|
131
|
-
warning: 'border-warning-
|
|
131
|
+
warning: 'border-warning-border-strong',
|
|
132
132
|
error: 'border-error-600',
|
|
133
133
|
};
|
|
134
134
|
const SOLID_DOT = {
|
|
@@ -148,7 +148,7 @@ const OUTLINE_RING = {
|
|
|
148
148
|
neutral: 'border-fg',
|
|
149
149
|
info: 'border-info-600',
|
|
150
150
|
success: 'border-success-600',
|
|
151
|
-
warning: 'border-warning-
|
|
151
|
+
warning: 'border-warning-border-strong',
|
|
152
152
|
error: 'border-error-600',
|
|
153
153
|
};
|
|
154
154
|
const OUTLINE_DOT = {
|