@snatuva/primitives 0.0.2

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/README.md ADDED
@@ -0,0 +1,120 @@
1
+ # @snatuva/primitives
2
+
3
+ Headless, directive-first Angular UI primitives focused on behavior, accessibility,
4
+ and composability.
5
+
6
+ This library currently includes:
7
+
8
+ - Tabs primitives
9
+ - Tooltip primitives
10
+
11
+ ## Philosophy
12
+
13
+ - **Headless**: no styling is imposed by the library.
14
+ - **Directive-first**: compose behavior into your own markup.
15
+ - **Scoped state**: each primitive root creates an isolated state scope.
16
+ - **Accessible by default**: ARIA semantics are wired into directives.
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ npm install @snatuva/primitives
22
+ ```
23
+
24
+ ## Exports
25
+
26
+ ```ts
27
+ import {
28
+ TabsDirective,
29
+ TabListDirective,
30
+ TabTriggerDirective,
31
+ TabPanelDirective,
32
+ TabContentDirective,
33
+ TooltipDirective,
34
+ TooltipTriggerDirective,
35
+ TooltipContentDirective,
36
+ } from '@snatuva/primitives';
37
+ ```
38
+
39
+ ## Tabs
40
+
41
+ ### Directives
42
+
43
+ - `apTabs` — root tabs scope/state provider.
44
+ - `apTabList` — list container for tab triggers.
45
+ - `apTabTrigger` — interactive tab trigger.
46
+ - Required input: `tabId: string`
47
+ - Optional input: `disabled: boolean`
48
+ - `apTabPanel` — panel region.
49
+ - Input: `id` (forwarded to ARIA tab panel primitive value)
50
+ - Optional input: `disabled: boolean`
51
+ - `apTabContent` — structural directive to conditionally render active panel content.
52
+ - Required input: `tabId: string`
53
+
54
+ ### Minimal usage
55
+
56
+ ```html
57
+ <div apTabs>
58
+ <div apTabList>
59
+ <button apTabTrigger tabId="overview">Overview</button>
60
+ <button apTabTrigger tabId="details">Details</button>
61
+ </div>
62
+
63
+ <section apTabPanel id="overview">
64
+ <ng-template apTabContent tabId="overview">
65
+ <p>Overview content</p>
66
+ </ng-template>
67
+ </section>
68
+
69
+ <section apTabPanel id="details">
70
+ <ng-template apTabContent tabId="details">
71
+ <p>Details content</p>
72
+ </ng-template>
73
+ </section>
74
+ </div>
75
+ ```
76
+
77
+ ### Behavior notes
78
+
79
+ - The first registered panel is selected by default.
80
+ - Selecting a disabled tab is ignored.
81
+ - When an active panel is removed, selection falls back to the next available panel.
82
+
83
+ ## Tooltip
84
+
85
+ ### Directives
86
+
87
+ - `apTooltip` — root tooltip scope/state provider.
88
+ - `apTooltipTrigger` — element that opens/closes tooltip on pointer/focus interactions.
89
+ - `apTooltipContent` — template for tooltip content.
90
+
91
+ ### Minimal usage
92
+
93
+ ```html
94
+ <div apTooltip>
95
+ <button apTooltipTrigger type="button">Hover or focus me</button>
96
+
97
+ <ng-template apTooltipContent>
98
+ <span>Helpful tooltip content</span>
99
+ </ng-template>
100
+ </div>
101
+ ```
102
+
103
+ ### Behavior notes
104
+
105
+ - Opens on `mouseenter` and `focus`.
106
+ - Closes on `mouseleave`, `blur`, or <kbd>Escape</kbd>.
107
+
108
+ ## Development
109
+
110
+ ### Build library
111
+
112
+ ```bash
113
+ ng build primitives
114
+ ```
115
+
116
+ ### Run tests
117
+
118
+ ```bash
119
+ ng test
120
+ ```
@@ -0,0 +1,426 @@
1
+ import * as i0 from '@angular/core';
2
+ import { signal, computed, Injectable, Directive, inject, Input, ElementRef, HostBinding, effect, TemplateRef, contentChild, contentChildren, ViewContainerRef, Injector, runInInjectionContext } from '@angular/core';
3
+ import * as i1 from '@angular/aria/tabs';
4
+ import { Tabs, TabPanel, Tab, TabList } from '@angular/aria/tabs';
5
+ import { Overlay } from '@angular/cdk/overlay';
6
+ import { TemplatePortal } from '@angular/cdk/portal';
7
+ import { Subject, fromEvent, filter, takeUntil } from 'rxjs';
8
+ import { DOCUMENT } from '@angular/common';
9
+
10
+ class TabsState {
11
+ _panels = signal([], ...(ngDevMode ? [{ debugName: "_panels" }] : []));
12
+ _activeId = signal(null, ...(ngDevMode ? [{ debugName: "_activeId" }] : []));
13
+ panels = this._panels.asReadonly();
14
+ activeId = this._activeId.asReadonly();
15
+ activePanel = computed(() => this._panels().find(p => p.id === this._activeId()), ...(ngDevMode ? [{ debugName: "activePanel" }] : []));
16
+ register(panel) {
17
+ this._panels.update(p => [...p, panel]);
18
+ if (!this._activeId()) {
19
+ this._activeId.set(panel.id);
20
+ }
21
+ }
22
+ unregister(id) {
23
+ this._panels.update(p => p.filter(x => x.id !== id));
24
+ if (this._activeId() === id) {
25
+ this._activeId.set(this._panels()[0]?.id ?? null);
26
+ }
27
+ }
28
+ select(id) {
29
+ const panel = this._panels().find(p => p.id === id && !p.disabled);
30
+ if (panel) {
31
+ this._activeId.set(id);
32
+ }
33
+ }
34
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TabsState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
35
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TabsState });
36
+ }
37
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TabsState, decorators: [{
38
+ type: Injectable
39
+ }] });
40
+
41
+ class TabsDirective {
42
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TabsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
43
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: TabsDirective, isStandalone: true, selector: "[apTabs]", providers: [
44
+ TabsState
45
+ ], exportAs: ["apTabs"], hostDirectives: [{ directive: i1.Tabs }], ngImport: i0 });
46
+ }
47
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TabsDirective, decorators: [{
48
+ type: Directive,
49
+ args: [{
50
+ selector: '[apTabs]',
51
+ standalone: true,
52
+ exportAs: 'apTabs',
53
+ providers: [
54
+ TabsState
55
+ ],
56
+ hostDirectives: [{
57
+ directive: Tabs
58
+ }]
59
+ }]
60
+ }] });
61
+
62
+ class TabPanelDirective {
63
+ // 1. Inject the host directive instance
64
+ ariaPanel = inject(TabPanel);
65
+ disabled = false;
66
+ state = inject(TabsState);
67
+ ngOnInit() {
68
+ // 2. Use ariaPanel.value (which holds the 'id' passed by the user)
69
+ this.state.register({
70
+ id: this.ariaPanel.value(),
71
+ disabled: this.disabled
72
+ });
73
+ }
74
+ ngOnDestroy() {
75
+ this.state.unregister(this.ariaPanel.value());
76
+ }
77
+ isActive() {
78
+ // 3. Compare the active state against the primitive's value
79
+ return this.state.activeId() === this.ariaPanel.value();
80
+ }
81
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TabPanelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
82
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: TabPanelDirective, isStandalone: true, selector: "[apTabPanel]", inputs: { disabled: "disabled" }, host: { attributes: { "role": "tabpanel" }, properties: { "attr.aria-labelledby": "`ap-tab-${ariaPanel.value}`", "style.display": "isActive() ? \"block\" : \"none\"", "attr.aria-hidden": "!isActive()" } }, exportAs: ["apTabPanel"], hostDirectives: [{ directive: i1.TabPanel, inputs: ["id", "id", "value", "value"] }], ngImport: i0 });
83
+ }
84
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TabPanelDirective, decorators: [{
85
+ type: Directive,
86
+ args: [{
87
+ selector: '[apTabPanel]',
88
+ standalone: true,
89
+ exportAs: 'apTabPanel',
90
+ host: {
91
+ 'role': 'tabpanel',
92
+ // Use the ID from the injected ariaPanel
93
+ '[attr.aria-labelledby]': '`ap-tab-${ariaPanel.value}`',
94
+ '[style.display]': 'isActive() ? "block" : "none"',
95
+ '[attr.aria-hidden]': '!isActive()'
96
+ },
97
+ hostDirectives: [{
98
+ directive: TabPanel,
99
+ // We map the public "id" attribute of your directive
100
+ // to the "value" property of the TabPanel primitive.
101
+ inputs: ['id', 'value']
102
+ }]
103
+ }]
104
+ }], propDecorators: { disabled: [{
105
+ type: Input
106
+ }] } });
107
+
108
+ class TabTriggerDirective {
109
+ tabId = '';
110
+ disabled = false;
111
+ state = inject(TabsState);
112
+ el = inject((ElementRef));
113
+ // constructor(@Host() private tabs: TabsDirective) { }
114
+ activate() {
115
+ this.state.select(this.tabId);
116
+ }
117
+ focus() {
118
+ this.el.nativeElement.focus();
119
+ }
120
+ // @HostListener('keydown', ['$event'])
121
+ // onKeydown(event: KeyboardEvent) {
122
+ // this.tabs.handleKeydown(event);
123
+ // }
124
+ tabindex = '-1';
125
+ get id() {
126
+ return `ap-tab-${this.tabId}`;
127
+ }
128
+ get controls() {
129
+ return `ap-panel-${this.tabId}`;
130
+ }
131
+ setActive(isActive) {
132
+ this.tabindex = isActive ? '0' : '-1';
133
+ }
134
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TabTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
135
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: TabTriggerDirective, isStandalone: true, selector: "[apTabTrigger]", inputs: { tabId: "tabId", disabled: "disabled" }, host: { attributes: { "role": "tab" }, listeners: { "click": "activate()" }, properties: { "attr.aria-selected": "state.activeId() === tabId", "attr.aria-disabled": "disabled", "attr.tabindex": "this.tabindex", "attr.id": "this.id", "attr.aria-controls": "this.controls" } }, providers: [
136
+ { provide: Tab, useExisting: Tab }
137
+ ], hostDirectives: [{ directive: i1.Tab, inputs: ["value", "tabId"] }], ngImport: i0 });
138
+ }
139
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TabTriggerDirective, decorators: [{
140
+ type: Directive,
141
+ args: [{
142
+ selector: '[apTabTrigger]',
143
+ standalone: true,
144
+ host: {
145
+ 'role': 'tab',
146
+ '[attr.aria-selected]': 'state.activeId() === tabId',
147
+ '[attr.aria-disabled]': 'disabled',
148
+ '(click)': 'activate()'
149
+ },
150
+ providers: [
151
+ { provide: Tab, useExisting: Tab }
152
+ ],
153
+ hostDirectives: [{
154
+ directive: Tab,
155
+ inputs: ['value: tabId']
156
+ }]
157
+ }]
158
+ }], propDecorators: { tabId: [{
159
+ type: Input,
160
+ args: [{ required: true }]
161
+ }], disabled: [{
162
+ type: Input
163
+ }], tabindex: [{
164
+ type: HostBinding,
165
+ args: ['attr.tabindex']
166
+ }], id: [{
167
+ type: HostBinding,
168
+ args: ['attr.id']
169
+ }], controls: [{
170
+ type: HostBinding,
171
+ args: ['attr.aria-controls']
172
+ }] } });
173
+
174
+ class TabContentDirective {
175
+ tabId;
176
+ state = inject(TabsState);
177
+ constructor(template, vcr) {
178
+ effect(() => {
179
+ vcr.clear();
180
+ if (this.state.activeId() === this.tabId) {
181
+ vcr.createEmbeddedView(template);
182
+ }
183
+ });
184
+ }
185
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TabContentDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
186
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: TabContentDirective, isStandalone: true, selector: "[apTabContent]", inputs: { tabId: "tabId" }, ngImport: i0 });
187
+ }
188
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TabContentDirective, decorators: [{
189
+ type: Directive,
190
+ args: [{
191
+ selector: '[apTabContent]'
192
+ }]
193
+ }], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }], propDecorators: { tabId: [{
194
+ type: Input,
195
+ args: [{ required: true }]
196
+ }] } });
197
+
198
+ class TabListDirective {
199
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TabListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
200
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: TabListDirective, isStandalone: true, selector: "[apTabList]", hostDirectives: [{ directive: i1.TabList }], ngImport: i0 });
201
+ }
202
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TabListDirective, decorators: [{
203
+ type: Directive,
204
+ args: [{
205
+ selector: '[apTabList]',
206
+ standalone: true,
207
+ hostDirectives: [{
208
+ directive: TabList
209
+ }]
210
+ }]
211
+ }] });
212
+
213
+ class TooltipState {
214
+ /** Whether tooltip is open */
215
+ open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
216
+ openTooltip() {
217
+ this.open.set(true);
218
+ }
219
+ closeTooltip() {
220
+ this.open.set(false);
221
+ }
222
+ toggle() {
223
+ this.open.update(v => !v);
224
+ }
225
+ }
226
+
227
+ class TooltipTriggerDirective {
228
+ state = inject(TooltipState);
229
+ element = inject((ElementRef));
230
+ onMouseEnter() {
231
+ this.state.openTooltip();
232
+ }
233
+ onMouseLeave() {
234
+ this.state.closeTooltip();
235
+ }
236
+ onFocus() {
237
+ this.state.openTooltip();
238
+ }
239
+ onBlur() {
240
+ this.state.closeTooltip();
241
+ }
242
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TooltipTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
243
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: TooltipTriggerDirective, isStandalone: true, selector: "[apTooltipTrigger]", host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focus": "onFocus()", "blur": "onBlur()" } }, ngImport: i0 });
244
+ }
245
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TooltipTriggerDirective, decorators: [{
246
+ type: Directive,
247
+ args: [{
248
+ selector: '[apTooltipTrigger]',
249
+ standalone: true,
250
+ host: {
251
+ '(mouseenter)': 'onMouseEnter()',
252
+ '(mouseleave)': 'onMouseLeave()',
253
+ '(focus)': 'onFocus()',
254
+ '(blur)': 'onBlur()',
255
+ }
256
+ }]
257
+ }] });
258
+
259
+ class TooltipContentDirective {
260
+ template = inject((TemplateRef));
261
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TooltipContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
262
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: TooltipContentDirective, isStandalone: true, selector: "[apTooltipContent]", host: { attributes: { "role": "tooltip" } }, ngImport: i0 });
263
+ }
264
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TooltipContentDirective, decorators: [{
265
+ type: Directive,
266
+ args: [{
267
+ selector: '[apTooltipContent]',
268
+ standalone: true,
269
+ host: {
270
+ 'role': 'tooltip'
271
+ }
272
+ }]
273
+ }] });
274
+
275
+ class TooltipOverlay {
276
+ overlay;
277
+ vcr;
278
+ origin;
279
+ overlayRef;
280
+ constructor(overlay, vcr, origin) {
281
+ this.overlay = overlay;
282
+ this.vcr = vcr;
283
+ this.origin = origin;
284
+ }
285
+ attach(template) {
286
+ if (!this.overlayRef) {
287
+ this.overlayRef = this.createOverlay();
288
+ }
289
+ if (!this.overlayRef.hasAttached()) {
290
+ const portal = new TemplatePortal(template, this.vcr);
291
+ this.overlayRef.attach(portal);
292
+ }
293
+ }
294
+ detach() {
295
+ this.overlayRef?.detach();
296
+ }
297
+ destroy() {
298
+ this.overlayRef?.dispose();
299
+ }
300
+ keydownEvents() {
301
+ return this.overlayRef?.keydownEvents() ?? null;
302
+ }
303
+ createOverlay() {
304
+ const positionStrategy = this.overlay.position()
305
+ .flexibleConnectedTo(this.origin)
306
+ .withPositions([
307
+ {
308
+ originX: 'center',
309
+ originY: 'top',
310
+ overlayX: 'center',
311
+ overlayY: 'bottom',
312
+ offsetY: -8
313
+ },
314
+ {
315
+ originX: 'center',
316
+ originY: 'bottom',
317
+ overlayX: 'center',
318
+ overlayY: 'top',
319
+ offsetY: 8
320
+ }
321
+ ]);
322
+ return this.overlay.create({
323
+ positionStrategy,
324
+ scrollStrategy: this.overlay.scrollStrategies.reposition(),
325
+ hasBackdrop: false
326
+ });
327
+ }
328
+ }
329
+
330
+ class TooltipDirective {
331
+ destroy$ = new Subject();
332
+ state = inject(TooltipState);
333
+ content = contentChild(TooltipContentDirective, ...(ngDevMode ? [{ debugName: "content" }] : []));
334
+ triggers = contentChildren(TooltipTriggerDirective, ...(ngDevMode ? [{ debugName: "triggers" }] : []));
335
+ overlay = null;
336
+ overlayService = inject(Overlay);
337
+ vcr = inject(ViewContainerRef);
338
+ injector = inject(Injector);
339
+ document = inject(DOCUMENT);
340
+ constructor() {
341
+ runInInjectionContext(this.injector, () => {
342
+ effect(() => {
343
+ if (!this.state.open()) {
344
+ return;
345
+ }
346
+ const sub = fromEvent(this.document, 'keydown')
347
+ .pipe(filter(e => e.key === 'Escape'), takeUntil(this.destroy$))
348
+ .subscribe(() => {
349
+ this.state.closeTooltip();
350
+ });
351
+ // Cleanup when tooltip closes
352
+ return () => sub.unsubscribe();
353
+ });
354
+ });
355
+ }
356
+ ngAfterContentInit() {
357
+ runInInjectionContext(this.injector, () => {
358
+ effect(() => {
359
+ const content = this.content();
360
+ const triggers = this.triggers();
361
+ // Early return if required elements are missing
362
+ if (!content || triggers.length === 0) {
363
+ return;
364
+ }
365
+ // Create overlay only once
366
+ if (!this.overlay) {
367
+ const origin = triggers[0].element.nativeElement;
368
+ this.overlay = new TooltipOverlay(this.overlayService, this.vcr, origin);
369
+ this.overlay
370
+ .keydownEvents()
371
+ ?.pipe(filter(event => event.key === 'Escape'), takeUntil(this.destroy$))
372
+ .subscribe(() => {
373
+ this.state.closeTooltip();
374
+ });
375
+ }
376
+ // Toggle tooltip visibility
377
+ if (this.state.open()) {
378
+ this.showTooltip(content);
379
+ }
380
+ else {
381
+ this.hideTooltip();
382
+ }
383
+ });
384
+ });
385
+ }
386
+ showTooltip(content) {
387
+ if (!this.overlay)
388
+ return;
389
+ // Clear any existing content
390
+ this.vcr.clear();
391
+ console.log('Showing tooltip');
392
+ // Create and attach the tooltip content
393
+ this.vcr.createEmbeddedView(content.template);
394
+ // this.overlay.attach(viewRef);
395
+ }
396
+ hideTooltip() {
397
+ this.vcr.clear();
398
+ this.overlay?.detach();
399
+ }
400
+ ngOnDestroy() {
401
+ this.vcr.clear();
402
+ this.overlay?.destroy();
403
+ this.overlay = null;
404
+ this.destroy$.next();
405
+ this.destroy$.complete();
406
+ }
407
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
408
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.0.6", type: TooltipDirective, isStandalone: true, selector: "[apTooltip]", providers: [TooltipState], queries: [{ propertyName: "content", first: true, predicate: TooltipContentDirective, descendants: true, isSignal: true }, { propertyName: "triggers", predicate: TooltipTriggerDirective, isSignal: true }], ngImport: i0 });
409
+ }
410
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TooltipDirective, decorators: [{
411
+ type: Directive,
412
+ args: [{
413
+ selector: '[apTooltip]',
414
+ standalone: true,
415
+ providers: [TooltipState],
416
+ }]
417
+ }], ctorParameters: () => [], propDecorators: { content: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TooltipContentDirective), { isSignal: true }] }], triggers: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TooltipTriggerDirective), { isSignal: true }] }] } });
418
+
419
+ // public-api.ts
420
+
421
+ /**
422
+ * Generated bundle index. Do not edit.
423
+ */
424
+
425
+ export { TabContentDirective, TabListDirective, TabPanelDirective, TabTriggerDirective, TabsDirective, TooltipContentDirective, TooltipDirective, TooltipState, TooltipTriggerDirective };
426
+ //# sourceMappingURL=snatuva-primitives.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snatuva-primitives.mjs","sources":["../../../projects/primitives/src/lib/tabs/tabs.state.ts","../../../projects/primitives/src/lib/tabs/tabs.directive.ts","../../../projects/primitives/src/lib/tabs/tab-panel.directive.ts","../../../projects/primitives/src/lib/tabs/tab-trigger.directive.ts","../../../projects/primitives/src/lib/tabs/tab-content.directive.ts","../../../projects/primitives/src/lib/tabs/tabs-list.directive.ts","../../../projects/primitives/src/lib/tooltip/tooltip.state.ts","../../../projects/primitives/src/lib/tooltip/tooltip-trigger.directive.ts","../../../projects/primitives/src/lib/tooltip/tooltip-content.directive.ts","../../../projects/primitives/src/lib/tooltip/tooltip.overlay.ts","../../../projects/primitives/src/lib/tooltip/tooltip.directive.ts","../../../projects/primitives/src/public-api.ts","../../../projects/primitives/src/snatuva-primitives.ts"],"sourcesContent":["import { signal, computed, Inject, Injectable } from '@angular/core';\n\nexport interface TabPanel {\n id: string;\n disabled: boolean;\n}\n\n@Injectable()\nexport class TabsState {\n private readonly _panels = signal<TabPanel[]>([]);\n private readonly _activeId = signal<string | null>(null);\n\n readonly panels = this._panels.asReadonly();\n readonly activeId = this._activeId.asReadonly();\n\n readonly activePanel = computed(() =>\n this._panels().find(p => p.id === this._activeId())\n );\n\n register(panel: TabPanel): void {\n this._panels.update(p => [...p, panel]);\n\n if (!this._activeId()) {\n this._activeId.set(panel.id);\n }\n }\n\n unregister(id: string): void {\n this._panels.update(p => p.filter(x => x.id !== id));\n\n if (this._activeId() === id) {\n this._activeId.set(this._panels()[0]?.id ?? null);\n }\n }\n\n select(id: string): void {\n const panel = this._panels().find(p => p.id === id && !p.disabled);\n if (panel) {\n this._activeId.set(id);\n }\n }\n}\n","import { AfterContentInit, ContentChildren, Directive, effect, HostListener, inject, Injector, QueryList, runInInjectionContext } from '@angular/core';\nimport { TabsState } from './tabs.state';\nimport { TabTriggerDirective } from './tab-trigger.directive';\n// import { TabsKeyboardController } from './tabs.keyboard';\nimport { Tabs } from '@angular/aria/tabs';\n\n@Directive({\n selector: '[apTabs]',\n standalone: true,\n exportAs: 'apTabs',\n providers: [\n TabsState\n ],\n hostDirectives: [{\n directive: Tabs\n }]\n})\nexport class TabsDirective {\n // state = inject(TabsState);\n // public activeTab = this.state.activeId;\n // @ContentChildren(TabTriggerDirective, { descendants: true })\n // private readonly triggers!: QueryList<TabTriggerDirective>;\n\n // // private readonly keyboard = new TabsKeyboardController();\n // private readonly injector = inject(Injector);\n // constructor(public readonly state: TabsState) {\n // }\n\n // ngAfterContentInit(): void {\n // // const triggers = this.triggers.toArray();\n\n // // this.keyboard.init(triggers);\n\n // // runInInjectionContext(this.injector, () => {\n // // effect(() => {\n // // const id = this.state.activeId();\n\n // // triggers.forEach(trigger =>\n // // trigger.setActive(trigger.tabId === id)\n // // );\n\n // // if (id) {\n // // this.keyboard.setActiveById(id);\n // // }\n // // });\n // // });\n // }\n\n // // onKeydown(event: KeyboardEvent) {\n // // this.keyboard.handleKeydown(event);\n // // }\n\n\n\n}\n","import { Directive, OnInit, OnDestroy, inject, Input } from '@angular/core';\nimport { TabsState } from './tabs.state';\nimport { TabPanel } from '@angular/aria/tabs';\n\n@Directive({\n selector: '[apTabPanel]',\n standalone: true,\n exportAs: 'apTabPanel',\n host: {\n 'role': 'tabpanel',\n // Use the ID from the injected ariaPanel\n '[attr.aria-labelledby]': '`ap-tab-${ariaPanel.value}`',\n '[style.display]': 'isActive() ? \"block\" : \"none\"',\n '[attr.aria-hidden]': '!isActive()'\n },\n hostDirectives: [{\n directive: TabPanel,\n // We map the public \"id\" attribute of your directive \n // to the \"value\" property of the TabPanel primitive.\n inputs: ['id', 'value']\n }]\n})\nexport class TabPanelDirective implements OnInit, OnDestroy {\n // 1. Inject the host directive instance\n protected ariaPanel = inject(TabPanel);\n\n @Input() disabled = false;\n private state = inject(TabsState);\n\n ngOnInit(): void {\n // 2. Use ariaPanel.value (which holds the 'id' passed by the user)\n this.state.register({\n id: this.ariaPanel.value() as string,\n disabled: this.disabled\n });\n }\n\n ngOnDestroy(): void {\n this.state.unregister(this.ariaPanel.value() as string);\n }\n\n isActive(): boolean {\n // 3. Compare the active state against the primitive's value\n return this.state.activeId() === this.ariaPanel.value();\n }\n}","import { Directive, ElementRef, Host, HostBinding, HostListener, inject, Input, input } from '@angular/core';\nimport { FocusableOption } from '@angular/cdk/a11y';\nimport { TabsState } from './tabs.state';\nimport { Tab } from '@angular/aria/tabs';\n\n@Directive({\n selector: '[apTabTrigger]',\n standalone: true,\n host: {\n 'role': 'tab',\n '[attr.aria-selected]': 'state.activeId() === tabId',\n '[attr.aria-disabled]': 'disabled',\n '(click)': 'activate()'\n },\n providers: [\n { provide: Tab, useExisting: Tab }\n ],\n hostDirectives: [{\n directive: Tab,\n inputs: ['value: tabId']\n }]\n})\nexport class TabTriggerDirective implements FocusableOption {\n @Input({ required: true }) tabId: string = '';\n @Input() disabled = false;\n state = inject(TabsState);\n el = inject(ElementRef<HTMLElement>);\n // constructor(@Host() private tabs: TabsDirective) { }\n activate(): void {\n this.state.select(this.tabId);\n }\n\n focus(): void {\n this.el.nativeElement.focus();\n }\n\n // @HostListener('keydown', ['$event'])\n // onKeydown(event: KeyboardEvent) {\n // this.tabs.handleKeydown(event);\n // }\n\n @HostBinding('attr.tabindex')\n tabindex = '-1';\n\n @HostBinding('attr.id')\n get id() {\n return `ap-tab-${this.tabId}`;\n }\n\n @HostBinding('attr.aria-controls')\n get controls() {\n return `ap-panel-${this.tabId}`;\n }\n\n\n setActive(isActive: boolean): void {\n this.tabindex = isActive ? '0' : '-1';\n }\n}\n","import { Directive, Input, TemplateRef, ViewContainerRef, effect, inject, input } from '@angular/core';\nimport { TabsState } from './tabs.state';\n\n@Directive({\n selector: '[apTabContent]'\n})\nexport class TabContentDirective {\n @Input({ required: true }) tabId!: string;\n private state = inject(TabsState);\n constructor(\n template: TemplateRef<unknown>,\n vcr: ViewContainerRef\n ) {\n effect(() => {\n vcr.clear();\n\n if (this.state.activeId() === this.tabId) {\n vcr.createEmbeddedView(template);\n }\n });\n }\n}\n","import { Directive } from '@angular/core';\nimport { TabList } from '@angular/aria/tabs';\n\n@Directive({\n selector: '[apTabList]',\n standalone: true,\n hostDirectives: [{\n directive: TabList\n }]\n})\nexport class TabListDirective { }","import { signal } from '@angular/core';\n\nexport class TooltipState {\n /** Whether tooltip is open */\n readonly open = signal(false);\n\n openTooltip() {\n this.open.set(true);\n }\n\n closeTooltip() {\n this.open.set(false);\n }\n\n toggle() {\n this.open.update(v => !v);\n }\n}\n","import {\n Directive,\n ElementRef,\n HostListener,\n inject,\n} from '@angular/core';\nimport { TooltipState } from './tooltip.state';\n\n@Directive({\n selector: '[apTooltipTrigger]',\n standalone: true,\n host: {\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave()',\n '(focus)': 'onFocus()',\n '(blur)': 'onBlur()',\n }\n})\nexport class TooltipTriggerDirective {\n private readonly state = inject(TooltipState);\n readonly element = inject(ElementRef<HTMLElement>);\n\n onMouseEnter() {\n this.state.openTooltip();\n }\n\n onMouseLeave() {\n this.state.closeTooltip();\n }\n\n onFocus() {\n this.state.openTooltip();\n }\n\n onBlur() {\n this.state.closeTooltip();\n }\n}\n\n","import {\n Directive,\n TemplateRef,\n inject,\n} from '@angular/core';\n\n@Directive({\n selector: '[apTooltipContent]',\n standalone: true,\n host: {\n 'role': 'tooltip'\n }\n})\nexport class TooltipContentDirective {\n readonly template = inject(TemplateRef<void>);\n}\n","import {\n Overlay,\n OverlayRef\n} from '@angular/cdk/overlay';\nimport { TemplateRef, ViewContainerRef } from '@angular/core';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { Observable } from 'rxjs';\n\nexport class TooltipOverlay {\n private overlayRef?: OverlayRef;\n\n constructor(\n private readonly overlay: Overlay,\n private readonly vcr: ViewContainerRef,\n private readonly origin: HTMLElement\n ) { }\n\n attach(template: TemplateRef<unknown>): void {\n if (!this.overlayRef) {\n this.overlayRef = this.createOverlay();\n }\n\n if (!this.overlayRef.hasAttached()) {\n const portal = new TemplatePortal(template, this.vcr);\n this.overlayRef.attach(portal);\n }\n }\n\n detach(): void {\n this.overlayRef?.detach();\n }\n\n destroy(): void {\n this.overlayRef?.dispose();\n }\n\n keydownEvents(): Observable<KeyboardEvent> | null {\n return this.overlayRef?.keydownEvents() ?? null;\n }\n\n private createOverlay(): OverlayRef {\n const positionStrategy =\n this.overlay.position()\n .flexibleConnectedTo(this.origin)\n .withPositions([\n {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -8\n },\n {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: 8\n }\n ]);\n\n return this.overlay.create({\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.reposition(),\n hasBackdrop: false\n });\n }\n}\n","import {\n AfterContentInit,\n contentChild,\n contentChildren,\n Directive,\n effect,\n inject,\n Injector,\n OnDestroy,\n runInInjectionContext,\n ViewContainerRef,\n} from '@angular/core';\nimport { TooltipState } from './tooltip.state';\nimport { TooltipContentDirective } from './tooltip-content.directive';\nimport { TooltipTriggerDirective } from './tooltip-trigger.directive';\nimport { Overlay } from '@angular/cdk/overlay';\nimport { TooltipOverlay } from './tooltip.overlay';\nimport { filter, fromEvent, Subject, takeUntil } from 'rxjs';\nimport { DOCUMENT } from '@angular/common';\n\n@Directive({\n selector: '[apTooltip]',\n standalone: true,\n providers: [TooltipState],\n})\nexport class TooltipDirective implements AfterContentInit, OnDestroy {\n\n private readonly destroy$ = new Subject<void>();\n state = inject(TooltipState);\n\n content = contentChild(TooltipContentDirective);\n triggers = contentChildren(TooltipTriggerDirective);\n\n private overlay: TooltipOverlay | null = null;\n\n private readonly overlayService = inject(Overlay);\n private readonly vcr = inject(ViewContainerRef);\n private readonly injector = inject(Injector);\n private readonly document = inject(DOCUMENT);\n\n constructor() {\n runInInjectionContext(this.injector, () => {\n effect(() => {\n if (!this.state.open()) {\n return;\n }\n\n const sub = fromEvent<KeyboardEvent>(\n this.document,\n 'keydown'\n )\n .pipe(\n filter(e => e.key === 'Escape'),\n takeUntil(this.destroy$)\n )\n .subscribe(() => {\n this.state.closeTooltip();\n });\n\n // Cleanup when tooltip closes\n return () => sub.unsubscribe();\n });\n });\n }\n\n ngAfterContentInit(): void {\n runInInjectionContext(this.injector, () => {\n effect(() => {\n const content = this.content();\n const triggers = this.triggers();\n\n // Early return if required elements are missing\n if (!content || triggers.length === 0) {\n return;\n }\n\n // Create overlay only once\n if (!this.overlay) {\n const origin = triggers[0].element.nativeElement;\n this.overlay = new TooltipOverlay(\n this.overlayService,\n this.vcr,\n origin\n );\n\n this.overlay\n .keydownEvents()\n ?.pipe(\n filter(event => event.key === 'Escape'),\n takeUntil(this.destroy$)\n )\n .subscribe(() => {\n this.state.closeTooltip();\n });\n }\n\n // Toggle tooltip visibility\n if (this.state.open()) {\n this.showTooltip(content);\n } else {\n this.hideTooltip();\n }\n });\n });\n }\n\n private showTooltip(content: TooltipContentDirective): void {\n if (!this.overlay) return;\n\n // Clear any existing content\n this.vcr.clear();\n console.log('Showing tooltip');\n // Create and attach the tooltip content\n this.vcr.createEmbeddedView(content.template);\n // this.overlay.attach(viewRef);\n }\n\n private hideTooltip(): void {\n this.vcr.clear();\n this.overlay?.detach();\n }\n\n ngOnDestroy(): void {\n this.vcr.clear();\n this.overlay?.destroy();\n this.overlay = null;\n\n this.destroy$.next();\n this.destroy$.complete();\n }\n}","// public-api.ts\n\nexport * from './lib/tabs';\nexport * from './lib/tooltip';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAQa,SAAS,CAAA;AACD,IAAA,OAAO,GAAG,MAAM,CAAa,EA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AEG;;;;"}
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@snatuva/primitives",
3
+ "version": "0.0.2",
4
+ "peerDependencies": {
5
+ "@angular/common": "^21.0.2",
6
+ "@angular/core": "^21.0.2",
7
+ "@angular/cdk": "^21.0.2",
8
+ "@angular/aria": "^21.0.5"
9
+ },
10
+ "dependencies": {
11
+ "tslib": "^2.3.0"
12
+ },
13
+ "sideEffects": false,
14
+ "module": "fesm2022/snatuva-primitives.mjs",
15
+ "typings": "types/snatuva-primitives.d.ts",
16
+ "exports": {
17
+ "./package.json": {
18
+ "default": "./package.json"
19
+ },
20
+ ".": {
21
+ "types": "./types/snatuva-primitives.d.ts",
22
+ "default": "./fesm2022/snatuva-primitives.mjs"
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,112 @@
1
+ import * as i0 from '@angular/core';
2
+ import { OnInit, OnDestroy, ElementRef, TemplateRef, ViewContainerRef, AfterContentInit } from '@angular/core';
3
+ import * as i1 from '@angular/aria/tabs';
4
+ import { TabPanel as TabPanel$1 } from '@angular/aria/tabs';
5
+ import { FocusableOption } from '@angular/cdk/a11y';
6
+
7
+ declare class TabsDirective {
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabsDirective, never>;
9
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TabsDirective, "[apTabs]", ["apTabs"], {}, {}, never, never, true, [{ directive: typeof i1.Tabs; inputs: {}; outputs: {}; }]>;
10
+ }
11
+
12
+ declare class TabPanelDirective implements OnInit, OnDestroy {
13
+ protected ariaPanel: TabPanel$1;
14
+ disabled: boolean;
15
+ private state;
16
+ ngOnInit(): void;
17
+ ngOnDestroy(): void;
18
+ isActive(): boolean;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabPanelDirective, never>;
20
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TabPanelDirective, "[apTabPanel]", ["apTabPanel"], { "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.TabPanel; inputs: { "id": "id"; "value": "value"; }; outputs: {}; }]>;
21
+ }
22
+
23
+ interface TabPanel {
24
+ id: string;
25
+ disabled: boolean;
26
+ }
27
+ declare class TabsState {
28
+ private readonly _panels;
29
+ private readonly _activeId;
30
+ readonly panels: i0.Signal<TabPanel[]>;
31
+ readonly activeId: i0.Signal<string | null>;
32
+ readonly activePanel: i0.Signal<TabPanel | undefined>;
33
+ register(panel: TabPanel): void;
34
+ unregister(id: string): void;
35
+ select(id: string): void;
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabsState, never>;
37
+ static ɵprov: i0.ɵɵInjectableDeclaration<TabsState>;
38
+ }
39
+
40
+ declare class TabTriggerDirective implements FocusableOption {
41
+ tabId: string;
42
+ disabled: boolean;
43
+ state: TabsState;
44
+ el: ElementRef<any>;
45
+ activate(): void;
46
+ focus(): void;
47
+ tabindex: string;
48
+ get id(): string;
49
+ get controls(): string;
50
+ setActive(isActive: boolean): void;
51
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabTriggerDirective, never>;
52
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TabTriggerDirective, "[apTabTrigger]", never, { "tabId": { "alias": "tabId"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.Tab; inputs: { "value": "tabId"; }; outputs: {}; }]>;
53
+ }
54
+
55
+ declare class TabContentDirective {
56
+ tabId: string;
57
+ private state;
58
+ constructor(template: TemplateRef<unknown>, vcr: ViewContainerRef);
59
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabContentDirective, never>;
60
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TabContentDirective, "[apTabContent]", never, { "tabId": { "alias": "tabId"; "required": true; }; }, {}, never, never, true, never>;
61
+ }
62
+
63
+ declare class TabListDirective {
64
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabListDirective, never>;
65
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TabListDirective, "[apTabList]", never, {}, {}, never, never, true, [{ directive: typeof i1.TabList; inputs: {}; outputs: {}; }]>;
66
+ }
67
+
68
+ declare class TooltipTriggerDirective {
69
+ private readonly state;
70
+ readonly element: ElementRef<any>;
71
+ onMouseEnter(): void;
72
+ onMouseLeave(): void;
73
+ onFocus(): void;
74
+ onBlur(): void;
75
+ static ɵfac: i0.ɵɵFactoryDeclaration<TooltipTriggerDirective, never>;
76
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipTriggerDirective, "[apTooltipTrigger]", never, {}, {}, never, never, true, never>;
77
+ }
78
+
79
+ declare class TooltipContentDirective {
80
+ readonly template: TemplateRef<any>;
81
+ static ɵfac: i0.ɵɵFactoryDeclaration<TooltipContentDirective, never>;
82
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipContentDirective, "[apTooltipContent]", never, {}, {}, never, never, true, never>;
83
+ }
84
+
85
+ declare class TooltipState {
86
+ /** Whether tooltip is open */
87
+ readonly open: i0.WritableSignal<boolean>;
88
+ openTooltip(): void;
89
+ closeTooltip(): void;
90
+ toggle(): void;
91
+ }
92
+
93
+ declare class TooltipDirective implements AfterContentInit, OnDestroy {
94
+ private readonly destroy$;
95
+ state: TooltipState;
96
+ content: i0.Signal<TooltipContentDirective | undefined>;
97
+ triggers: i0.Signal<readonly TooltipTriggerDirective[]>;
98
+ private overlay;
99
+ private readonly overlayService;
100
+ private readonly vcr;
101
+ private readonly injector;
102
+ private readonly document;
103
+ constructor();
104
+ ngAfterContentInit(): void;
105
+ private showTooltip;
106
+ private hideTooltip;
107
+ ngOnDestroy(): void;
108
+ static ɵfac: i0.ɵɵFactoryDeclaration<TooltipDirective, never>;
109
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[apTooltip]", never, {}, {}, ["content", "triggers"], never, true, never>;
110
+ }
111
+
112
+ export { TabContentDirective, TabListDirective, TabPanelDirective, TabTriggerDirective, TabsDirective, TooltipContentDirective, TooltipDirective, TooltipState, TooltipTriggerDirective };