@spartan-ng/brain 0.0.1-alpha.533 → 0.0.1-alpha.535

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.
@@ -1,19 +1,26 @@
1
- import type { CustomElementClassSettable } from '@spartan-ng/brain/core';
2
- import type { ClassValue } from 'clsx';
3
1
  import * as i0 from "@angular/core";
4
- export declare class BrnAccordionContent implements CustomElementClassSettable {
2
+ export declare class BrnAccordionContent {
5
3
  private readonly _item;
4
+ private readonly _elementRef;
5
+ protected readonly _width: import("@angular/core").WritableSignal<number | null>;
6
+ protected readonly _height: import("@angular/core").WritableSignal<number | null>;
7
+ protected readonly _dimensionsInitiated: import("@angular/core").WritableSignal<boolean>;
8
+ protected readonly _inert: import("@angular/core").Signal<true | undefined>;
6
9
  readonly state: import("@angular/core").Signal<"open" | "closed">;
7
10
  readonly id: string;
8
11
  readonly ariaLabeledBy: string;
9
- protected readonly _addInert: import("@angular/core").Signal<true | undefined>;
10
12
  /**
11
- * The class to be applied to the content element.
13
+ * The style to be applied to the host element after the dimensions are calculated.
14
+ * @default 'overflow: hidden'
12
15
  */
13
- readonly contentClass: import("@angular/core").InputSignal<ClassValue>;
14
- protected readonly _contentClass: import("@angular/core").WritableSignal<ClassValue>;
16
+ readonly style: import("@angular/core").InputSignal<string>;
17
+ /**
18
+ * The style to be applied to the host element while the dimensions are being calculated.
19
+ * @default 'opacity: 0'
20
+ */
21
+ readonly styleWhileDimensionsAreInitiating: import("@angular/core").InputSignal<string>;
22
+ protected readonly _mutableStyle: import("@angular/core").WritableSignal<string>;
15
23
  constructor();
16
- setClassToCustomElement(classes: ClassValue): void;
17
24
  static ɵfac: i0.ɵɵFactoryDeclaration<BrnAccordionContent, never>;
18
- static ɵcmp: i0.ɵɵComponentDeclaration<BrnAccordionContent, "brn-accordion-content", never, { "contentClass": { "alias": "contentClass"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
25
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BrnAccordionContent, "brn-accordion-content,[brnAccordionContent]", never, { "style": { "alias": "style"; "required": false; "isSignal": true; }; "styleWhileDimensionsAreInitiating": { "alias": "styleWhileDimensionsAreInitiating"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
19
26
  }
@@ -7,14 +7,26 @@ export declare class BrnAccordionItem {
7
7
  readonly id: number;
8
8
  private readonly _accordion;
9
9
  /**
10
- * Whether the accordion item is opened or closed.
10
+ * Whether the item is opened or closed.
11
11
  * @default false
12
12
  */
13
13
  readonly isOpened: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
14
+ /**
15
+ * Computed state of the item, either 'open' or 'closed'
16
+ * @default closed
17
+ */
14
18
  readonly state: import("@angular/core").Signal<"open" | "closed">;
19
+ /**
20
+ * Emits boolean when the item is opened or closed.
21
+ */
22
+ readonly stateChange: import("@angular/core").OutputEmitterRef<"open" | "closed">;
23
+ /**
24
+ * Emits state change when item is opened or closed
25
+ */
26
+ readonly openedChange: import("@angular/core").OutputEmitterRef<boolean>;
15
27
  constructor();
16
28
  static ɵfac: i0.ɵɵFactoryDeclaration<BrnAccordionItem, never>;
17
- static ɵdir: i0.ɵɵDirectiveDeclaration<BrnAccordionItem, "[brnAccordionItem]", ["brnAccordionItem"], { "isOpened": { "alias": "isOpened"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
29
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BrnAccordionItem, "[brnAccordionItem]", ["brnAccordionItem"], { "isOpened": { "alias": "isOpened"; "required": false; "isSignal": true; }; }, { "stateChange": "stateChange"; "openedChange": "openedChange"; }, never, never, true, never>;
18
30
  }
19
31
  export declare class BrnAccordionTrigger implements FocusableOption {
20
32
  private readonly _accordion;
@@ -5,9 +5,10 @@ export declare class BrnAutocompleteSearchInput extends DefaultValueAccessor {
5
5
  private readonly elementRef;
6
6
  private readonly _autocomplete;
7
7
  /** The initial value of the search input */
8
- readonly value: import("@angular/core").InputSignal<string>;
9
- /** @internal The "real" value of the search input */
10
- readonly valueState: import("@angular/core").WritableSignal<string>;
8
+ readonly value: import("@angular/core").ModelSignal<string>;
9
+ /** Emitted when the value changes */
10
+ readonly valueChange: import("@angular/core").OutputEmitterRef<string>;
11
+ /** Whether the autocomplete panel is expanded */
11
12
  protected readonly _isExpanded: import("@angular/core").Signal<boolean>;
12
13
  /** The id of the active option */
13
14
  protected readonly _activeDescendant: import("@angular/core").WritableSignal<string | undefined>;
@@ -19,5 +20,5 @@ export declare class BrnAutocompleteSearchInput extends DefaultValueAccessor {
19
20
  /** CONROL VALUE ACCESSOR */
20
21
  writeValue(value: string | null): void;
21
22
  static ɵfac: i0.ɵɵFactoryDeclaration<BrnAutocompleteSearchInput, [null, null, { optional: true; }]>;
22
- static ɵdir: i0.ɵɵDirectiveDeclaration<BrnAutocompleteSearchInput, "input[brnAutocompleteSearchInput]", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
23
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BrnAutocompleteSearchInput, "input[brnAutocompleteSearchInput]", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "valueChange": "valueChange"; }, never, never, true, never>;
23
24
  }
@@ -14,6 +14,8 @@ export declare class BrnAutocomplete<T> {
14
14
  private readonly _brnPopover;
15
15
  /** Access the search input if present */
16
16
  private readonly _searchInput;
17
+ /** @internal The focus strategy when opening */
18
+ private readonly _focus;
17
19
  /** @internal Access all the items within the autocomplete */
18
20
  readonly items: import("@angular/core").Signal<readonly BrnAutocompleteItem<T>[]>;
19
21
  /** @internal The key manager for managing active descendant */
@@ -22,6 +24,9 @@ export declare class BrnAutocomplete<T> {
22
24
  readonly isExpanded: import("@angular/core").Signal<boolean>;
23
25
  constructor();
24
26
  protected selectActiveItem(): void;
27
+ open(focus?: 'first' | 'last'): void;
28
+ close(): void;
29
+ toggle(): void;
25
30
  static ɵfac: i0.ɵɵFactoryDeclaration<BrnAutocomplete<any>, never>;
26
31
  static ɵdir: i0.ɵɵDirectiveDeclaration<BrnAutocomplete<any>, "[brnAutocomplete]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, ["_searchInput", "items"], never, true, never>;
27
32
  }
@@ -9,9 +9,9 @@ export declare class BrnCalendarMonthSelect {
9
9
  /** Access the calendar i18n */
10
10
  protected readonly _i18n: import("./i18n/calendar-i18n").BrnCalendarI18nService;
11
11
  protected readonly _selectedMonth: import("@angular/core").Signal<string>;
12
+ constructor();
12
13
  /** Focus selected month */
13
14
  protected monthSelected(selectedMonth: string): void;
14
- constructor();
15
15
  static ɵfac: i0.ɵɵFactoryDeclaration<BrnCalendarMonthSelect, never>;
16
16
  static ɵdir: i0.ɵɵDirectiveDeclaration<BrnCalendarMonthSelect, "brn-select[brnCalendarMonthSelect]", never, {}, {}, never, never, true, never>;
17
17
  }
@@ -8,9 +8,9 @@ export declare class BrnCalendarYearSelect {
8
8
  private readonly _dateAdapter;
9
9
  /** Access the calendar i18n */
10
10
  protected readonly _i18n: import("./i18n/calendar-i18n").BrnCalendarI18nService;
11
+ constructor();
11
12
  /** Focus selected year */
12
13
  protected yearSelected(year: number): void;
13
- constructor();
14
14
  static ɵfac: i0.ɵɵFactoryDeclaration<BrnCalendarYearSelect, never>;
15
15
  static ɵdir: i0.ɵɵDirectiveDeclaration<BrnCalendarYearSelect, "brn-select[brnCalendarYearSelect]", never, {}, {}, never, never, true, never>;
16
16
  }
@@ -31,17 +31,10 @@ export declare class BrnCalendar<T> implements BrnCalendarBase<T> {
31
31
  readonly header: import("@angular/core").Signal<BrnCalendarHeader | undefined>;
32
32
  /** Store the cells */
33
33
  protected readonly _cells: import("@angular/core").Signal<readonly BrnCalendarCellButton<T>[]>;
34
- /**
35
- * @internal
36
- * The internal state of the component.
37
- */
38
- readonly state: import("@angular/core").Signal<{
39
- focusedDate: import("@angular/core").WritableSignal<T>;
40
- }>;
41
34
  /**
42
35
  * The focused date.
43
36
  */
44
- readonly focusedDate: import("@angular/core").Signal<T>;
37
+ readonly focusedDate: import("@angular/core").WritableSignal<T>;
45
38
  /**
46
39
  * Get all the days to display, this is the days of the current month
47
40
  * and the days of the previous and next month to fill the grid.
@@ -10,11 +10,8 @@ export interface BrnCalendarBase<T> {
10
10
  isEndOfRange: (date: T) => boolean;
11
11
  isBetweenRange: (date: T) => boolean;
12
12
  disabled: Signal<boolean>;
13
- focusedDate: Signal<T>;
13
+ focusedDate: WritableSignal<T>;
14
14
  header: Signal<BrnCalendarHeader | undefined>;
15
- state: Signal<{
16
- focusedDate: WritableSignal<T>;
17
- }>;
18
15
  days: Signal<T[]>;
19
16
  }
20
17
  export declare const BrnCalendarToken: InjectionToken<BrnCalendarBase<unknown>>;
@@ -55,17 +55,10 @@ export declare class BrnCalendarMulti<T> implements BrnCalendarBase<T> {
55
55
  readonly header: import("@angular/core").Signal<BrnCalendarHeader | undefined>;
56
56
  /** Store the cells */
57
57
  protected readonly _cells: import("@angular/core").Signal<readonly BrnCalendarCellButton<T>[]>;
58
- /**
59
- * @internal
60
- * The internal state of the component.
61
- */
62
- readonly state: import("@angular/core").Signal<{
63
- focusedDate: import("@angular/core").WritableSignal<T>;
64
- }>;
65
58
  /**
66
59
  * The focused date.
67
60
  */
68
- readonly focusedDate: import("@angular/core").Signal<T>;
61
+ readonly focusedDate: import("@angular/core").WritableSignal<T>;
69
62
  /**
70
63
  * Get all the days to display, this is the days of the current month
71
64
  * and the days of the previous and next month to fill the grid.
@@ -28,17 +28,10 @@ export declare class BrnCalendarRange<T> implements BrnCalendarBase<T> {
28
28
  readonly header: import("@angular/core").Signal<BrnCalendarHeader | undefined>;
29
29
  /** Store the cells */
30
30
  protected readonly _cells: import("@angular/core").Signal<readonly BrnCalendarCellButton<T>[]>;
31
- /**
32
- * @internal
33
- * The internal state of the component.
34
- */
35
- readonly state: import("@angular/core").Signal<{
36
- focusedDate: import("@angular/core").WritableSignal<T>;
37
- }>;
38
31
  /**
39
32
  * The focused date.
40
33
  */
41
- readonly focusedDate: import("@angular/core").Signal<T>;
34
+ readonly focusedDate: import("@angular/core").WritableSignal<T>;
42
35
  /**
43
36
  * The selected start date
44
37
  */
@@ -19,18 +19,18 @@ export declare class BrnCheckbox implements ControlValueAccessor, AfterContentIn
19
19
  protected readonly _focusVisible: import("@angular/core").WritableSignal<boolean>;
20
20
  protected readonly _focused: import("@angular/core").WritableSignal<boolean>;
21
21
  /**
22
- * Current checked state of checkbox.
23
- * Can be boolean (true/false) or 'indeterminate'.
22
+ * The checked state of the checkbox.
24
23
  * Can be bound with [(checked)] for two-way binding.
25
24
  */
26
- readonly checked: import("@angular/core").ModelSignal<BrnCheckboxValue>;
25
+ readonly checked: import("@angular/core").ModelSignal<boolean>;
27
26
  /** Emits when checked state changes. */
28
- readonly checkedChange: import("@angular/core").OutputEmitterRef<BrnCheckboxValue>;
27
+ readonly checkedChange: import("@angular/core").OutputEmitterRef<boolean>;
29
28
  /**
30
29
  * Read-only signal of current checkbox state.
31
30
  * Use this when you only need to read state without changing it.
32
31
  */
33
- readonly isChecked: import("@angular/core").Signal<BrnCheckboxValue>;
32
+ readonly isChecked: import("@angular/core").Signal<boolean>;
33
+ readonly indeterminate: import("@angular/core").ModelSignal<boolean>;
34
34
  /**
35
35
  * Computed data-state attribute value based on checked state.
36
36
  * Returns 'checked', 'unchecked', or 'indeterminate'.
@@ -89,7 +89,7 @@ export declare class BrnCheckbox implements ControlValueAccessor, AfterContentIn
89
89
  name: string | null;
90
90
  id: string | null;
91
91
  }>;
92
- protected _onChange: ChangeFn<BrnCheckboxValue>;
92
+ protected _onChange: ChangeFn<boolean>;
93
93
  private _onTouched;
94
94
  /**
95
95
  * Reference to the checkbox button element in the template.
@@ -116,7 +116,7 @@ export declare class BrnCheckbox implements ControlValueAccessor, AfterContentIn
116
116
  * @param idPassedToContainer - ID applied to container element
117
117
  * @returns ID to use for inner button or null
118
118
  */
119
- protected getCheckboxButtonId(idPassedToContainer: string | null | undefined): string | null;
119
+ protected _getCheckboxButtonId(idPassedToContainer: string | null | undefined): string | null;
120
120
  /**
121
121
  * Updates internal state when control value changes from outside.
122
122
  * Handles boolean and 'indeterminate' values.
@@ -124,14 +124,14 @@ export declare class BrnCheckbox implements ControlValueAccessor, AfterContentIn
124
124
  *
125
125
  * @param value - New checkbox state (true/false/'indeterminate')
126
126
  */
127
- writeValue(value: BrnCheckboxValue): void;
127
+ writeValue(value: boolean): void;
128
128
  /**
129
129
  * Registers callback for value changes.
130
130
  * Part of ControlValueAccessor interface.
131
131
  *
132
132
  * @param fn - Function to call when value changes
133
133
  */
134
- registerOnChange(fn: ChangeFn<BrnCheckboxValue>): void;
134
+ registerOnChange(fn: ChangeFn<boolean>): void;
135
135
  /**
136
136
  * Registers callback for touched events.
137
137
  * Part of ControlValueAccessor interface.
@@ -147,7 +147,5 @@ export declare class BrnCheckbox implements ControlValueAccessor, AfterContentIn
147
147
  */
148
148
  setDisabledState(isDisabled: boolean): void;
149
149
  static ɵfac: i0.ɵɵFactoryDeclaration<BrnCheckbox, never>;
150
- static ɵcmp: i0.ɵɵComponentDeclaration<BrnCheckbox, "brn-checkbox", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "checkedChange": "checkedChange"; "touched": "touched"; }, never, ["*"], true, never>;
150
+ static ɵcmp: i0.ɵɵComponentDeclaration<BrnCheckbox, "brn-checkbox", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "checkedChange": "checkedChange"; "indeterminate": "indeterminateChange"; "touched": "touched"; }, never, ["*"], true, never>;
151
151
  }
152
- type BrnCheckboxValue = boolean | 'indeterminate';
153
- export {};
@@ -1,7 +1,7 @@
1
1
  import { FocusMonitor, FocusKeyManager } from '@angular/cdk/a11y';
2
2
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
3
3
  import * as i0 from '@angular/core';
4
- import { inject, input, computed, effect, untracked, Directive, ElementRef, isDevMode, HostListener, signal, contentChildren, linkedSignal, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { inject, input, computed, output, effect, untracked, Directive, ElementRef, isDevMode, signal, contentChildren, linkedSignal, afterNextRender } from '@angular/core';
5
5
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
6
  import { fromEvent } from 'rxjs';
7
7
 
@@ -10,15 +10,34 @@ class BrnAccordionItem {
10
10
  id = ++BrnAccordionItem._itemIdGenerator;
11
11
  _accordion = inject(BrnAccordion);
12
12
  /**
13
- * Whether the accordion item is opened or closed.
13
+ * Whether the item is opened or closed.
14
14
  * @default false
15
15
  */
16
16
  isOpened = input(false, { transform: coerceBooleanProperty });
17
+ /**
18
+ * Computed state of the item, either 'open' or 'closed'
19
+ * @default closed
20
+ */
17
21
  state = computed(() => (this._accordion.openItemIds().includes(this.id) ? 'open' : 'closed'));
22
+ /**
23
+ * Emits boolean when the item is opened or closed.
24
+ */
25
+ stateChange = output();
26
+ /**
27
+ * Emits state change when item is opened or closed
28
+ */
29
+ openedChange = output();
18
30
  constructor() {
19
31
  if (!this._accordion) {
20
32
  throw Error('Accordion item can only be used inside an Accordion. Add brnAccordion to ancestor.');
21
33
  }
34
+ effect(() => {
35
+ const state = this.state();
36
+ untracked(() => {
37
+ this.stateChange.emit(state);
38
+ this.openedChange.emit(state === 'open');
39
+ });
40
+ });
22
41
  effect(() => {
23
42
  const isOpened = this.isOpened();
24
43
  untracked(() => {
@@ -32,7 +51,7 @@ class BrnAccordionItem {
32
51
  });
33
52
  }
34
53
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnAccordionItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
35
- /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: BrnAccordionItem, isStandalone: true, selector: "[brnAccordionItem]", inputs: { isOpened: { classPropertyName: "isOpened", publicName: "isOpened", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-state": "state()" } }, exportAs: ["brnAccordionItem"], ngImport: i0 });
54
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: BrnAccordionItem, isStandalone: true, selector: "[brnAccordionItem]", inputs: { isOpened: { classPropertyName: "isOpened", publicName: "isOpened", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stateChange: "stateChange", openedChange: "openedChange" }, host: { properties: { "attr.data-state": "state()" } }, exportAs: ["brnAccordionItem"], ngImport: i0 });
36
55
  }
37
56
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnAccordionItem, decorators: [{
38
57
  type: Directive,
@@ -111,18 +130,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
111
130
  '[attr.aria-controls]': 'ariaControls',
112
131
  '[id]': 'id',
113
132
  '[attr.role]': '"button"',
133
+ '(click)': 'toggle($event)',
134
+ '(keyup.space)': 'toggle($event)',
135
+ '(keyup.enter)': 'toggle($event)',
114
136
  },
115
137
  }]
116
- }], ctorParameters: () => [], propDecorators: { toggle: [{
117
- type: HostListener,
118
- args: ['click', ['$event']]
119
- }, {
120
- type: HostListener,
121
- args: ['keyup.space', ['$event']]
122
- }, {
123
- type: HostListener,
124
- args: ['keyup.enter', ['$event']]
125
- }] } });
138
+ }], ctorParameters: () => [] });
126
139
  const HORIZONTAL_KEYS_TO_PREVENT_DEFAULT = [
127
140
  'ArrowLeft',
128
141
  'ArrowRight',
@@ -257,51 +270,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
257
270
 
258
271
  class BrnAccordionContent {
259
272
  _item = inject(BrnAccordionItem);
273
+ _elementRef = inject(ElementRef);
274
+ _width = signal(null);
275
+ _height = signal(null);
276
+ _dimensionsInitiated = signal(false);
277
+ _inert = computed(() => (this.state() === 'closed' ? true : undefined));
260
278
  state = this._item.state;
261
279
  id = `brn-accordion-content-${this._item.id}`;
262
280
  ariaLabeledBy = `brn-accordion-trigger-${this._item.id}`;
263
- _addInert = computed(() => (this.state() === 'closed' ? true : undefined));
264
281
  /**
265
- * The class to be applied to the content element.
282
+ * The style to be applied to the host element after the dimensions are calculated.
283
+ * @default 'overflow: hidden'
284
+ */
285
+ style = input('overflow: hidden');
286
+ /**
287
+ * The style to be applied to the host element while the dimensions are being calculated.
288
+ * @default 'opacity: 0'
266
289
  */
267
- contentClass = input('');
268
- _contentClass = linkedSignal(() => this.contentClass());
290
+ styleWhileDimensionsAreInitiating = input('overflow: hidden');
291
+ _mutableStyle = linkedSignal(() => this._dimensionsInitiated() ? this.style() : this.styleWhileDimensionsAreInitiating());
269
292
  constructor() {
270
293
  if (!this._item) {
271
294
  throw Error('Accordion Content can only be used inside an AccordionItem. Add brnAccordionItem to parent.');
272
295
  }
296
+ afterNextRender(() => {
297
+ const content = this._elementRef.nativeElement.firstChild;
298
+ if (!content)
299
+ return;
300
+ const { width, height } = content.getBoundingClientRect();
301
+ this._width.set(width);
302
+ this._height.set(height);
303
+ this._dimensionsInitiated.set(true);
304
+ });
273
305
  }
274
- setClassToCustomElement(classes) {
275
- this._contentClass.set(classes);
276
- }
277
- /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnAccordionContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
278
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.8", type: BrnAccordionContent, isStandalone: true, selector: "brn-accordion-content", inputs: { contentClass: { classPropertyName: "contentClass", publicName: "contentClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "region" }, properties: { "attr.data-state": "state()", "attr.aria-labelledby": "ariaLabeledBy", "id": "id" } }, ngImport: i0, template: `
279
- <div [attr.inert]="_addInert()" style="overflow: hidden">
280
- <p [class]="_contentClass()">
281
- <ng-content />
282
- </p>
283
- </div>
284
- `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
306
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnAccordionContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
307
+ /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: BrnAccordionContent, isStandalone: true, selector: "brn-accordion-content,[brnAccordionContent]", inputs: { style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, styleWhileDimensionsAreInitiating: { classPropertyName: "styleWhileDimensionsAreInitiating", publicName: "styleWhileDimensionsAreInitiating", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "region" }, properties: { "attr.data-state": "state()", "attr.aria-labelledby": "ariaLabeledBy", "id": "id", "style.--brn-accordion-content-width.px": "_width()", "style.--brn-accordion-content-height.px": "_height()", "attr.inert": "_inert()", "attr.style": "_mutableStyle()" } }, ngImport: i0 });
285
308
  }
286
309
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BrnAccordionContent, decorators: [{
287
- type: Component,
310
+ type: Directive,
288
311
  args: [{
289
- selector: 'brn-accordion-content',
312
+ selector: 'brn-accordion-content,[brnAccordionContent]',
290
313
  host: {
291
314
  '[attr.data-state]': 'state()',
292
315
  '[attr.aria-labelledby]': 'ariaLabeledBy',
293
316
  role: 'region',
294
317
  '[id]': 'id',
318
+ '[style.--brn-accordion-content-width.px]': '_width()',
319
+ '[style.--brn-accordion-content-height.px]': '_height()',
320
+ '[attr.inert]': '_inert()',
321
+ '[attr.style]': '_mutableStyle()',
295
322
  },
296
- template: `
297
- <div [attr.inert]="_addInert()" style="overflow: hidden">
298
- <p [class]="_contentClass()">
299
- <ng-content />
300
- </p>
301
- </div>
302
- `,
303
- changeDetection: ChangeDetectionStrategy.OnPush,
304
- encapsulation: ViewEncapsulation.None,
305
323
  }]
306
324
  }], ctorParameters: () => [] });
307
325
 
@@ -1 +1 @@
1
- {"version":3,"file":"spartan-ng-brain-accordion.mjs","sources":["../../../../libs/brain/accordion/src/lib/brn-accordion.ts","../../../../libs/brain/accordion/src/lib/brn-accordion-content.ts","../../../../libs/brain/accordion/src/index.ts","../../../../libs/brain/accordion/src/spartan-ng-brain-accordion.ts"],"sourcesContent":["import { type FocusableOption, FocusKeyManager, FocusMonitor } from '@angular/cdk/a11y';\nimport { type BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n\ttype AfterContentInit,\n\tcomputed,\n\tcontentChildren,\n\tDirective,\n\teffect,\n\tElementRef,\n\tHostListener,\n\tinject,\n\tinput,\n\tisDevMode,\n\ttype OnDestroy,\n\tsignal,\n\tuntracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent } from 'rxjs';\n\n@Directive({\n\tselector: '[brnAccordionItem]',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t},\n\texportAs: 'brnAccordionItem',\n})\nexport class BrnAccordionItem {\n\tprivate static _itemIdGenerator = 0;\n\tpublic readonly id = ++BrnAccordionItem._itemIdGenerator;\n\tprivate readonly _accordion = inject(BrnAccordion);\n\t/**\n\t * Whether the accordion item is opened or closed.\n\t * @default false\n\t */\n\tpublic readonly isOpened = input<boolean, BooleanInput>(false, { transform: coerceBooleanProperty });\n\tpublic readonly state = computed(() => (this._accordion.openItemIds().includes(this.id) ? 'open' : 'closed'));\n\n\tconstructor() {\n\t\tif (!this._accordion) {\n\t\t\tthrow Error('Accordion item can only be used inside an Accordion. Add brnAccordion to ancestor.');\n\t\t}\n\t\teffect(() => {\n\t\t\tconst isOpened = this.isOpened();\n\t\t\tuntracked(() => {\n\t\t\t\tif (isOpened) {\n\t\t\t\t\tthis._accordion.openItem(this.id);\n\t\t\t\t} else {\n\t\t\t\t\tthis._accordion.closeItem(this.id);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n\n@Directive({\n\tselector: '[brnAccordionTrigger]',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.aria-expanded]': 'state() === \"open\"',\n\t\t'[attr.aria-controls]': 'ariaControls',\n\t\t'[id]': 'id',\n\t\t'[attr.role]': '\"button\"',\n\t},\n})\nexport class BrnAccordionTrigger implements FocusableOption {\n\tprivate readonly _accordion = inject(BrnAccordion);\n\tprivate readonly _item = inject(BrnAccordionItem);\n\tprivate readonly _el = inject(ElementRef<HTMLElement>);\n\n\tpublic readonly state = this._item.state;\n\tpublic readonly id = `brn-accordion-trigger-${this._item.id}`;\n\tpublic readonly ariaControls = `brn-accordion-content-${this._item.id}`;\n\tconstructor() {\n\t\tif (!this._accordion) throw Error('Accordion trigger requires a parent Accordion.');\n\t\tif (!this._item) throw Error('Accordion trigger requires a parent AccordionItem.');\n\t\tthis.validateAriaStructure();\n\n\t\tfromEvent(this._el.nativeElement, 'focus')\n\t\t\t.pipe(takeUntilDestroyed())\n\t\t\t.subscribe(() => {\n\t\t\t\tthis._accordion.setActiveItem(this);\n\t\t\t});\n\t}\n\n\t@HostListener('click', ['$event'])\n\t@HostListener('keyup.space', ['$event'])\n\t@HostListener('keyup.enter', ['$event'])\n\tprotected toggle(event: Event): void {\n\t\tevent.preventDefault();\n\t\tthis._accordion.toggleItem(this._item.id);\n\t}\n\n\tpublic focus() {\n\t\tthis._el.nativeElement.focus();\n\t}\n\n\tprivate validateAriaStructure(): void {\n\t\tconst element = this._el.nativeElement;\n\n\t\tconst isButton = element.tagName === 'BUTTON';\n\t\tconst hasButtonRole = element.getAttribute('role') === 'button';\n\n\t\tif (!isButton && !hasButtonRole) {\n\t\t\tthrow Error(\n\t\t\t\t`BrnAccordionTrigger: The trigger element must be a <button> or have role=\"button\". ` +\n\t\t\t\t\t`Found: <${element.tagName.toLowerCase()}>`,\n\t\t\t);\n\t\t}\n\n\t\tconst parent = element.parentElement;\n\t\tif (!parent) {\n\t\t\tconst message = 'BrnAccordionTrigger: The trigger button must be wrapped in a heading element.';\n\t\t\tif (isDevMode()) {\n\t\t\t\tthrow Error(message);\n\t\t\t} else {\n\t\t\t\tconsole.warn(message);\n\t\t\t}\n\t\t}\n\n\t\tconst isNativeHeading = /^H[1-6]$/.test(parent.tagName);\n\t\tconst hasHeadingRole = parent.getAttribute('role') === 'heading';\n\n\t\tif (!isNativeHeading && !hasHeadingRole) {\n\t\t\tthrow Error(\n\t\t\t\t`BrnAccordionTrigger: The trigger button must be wrapped in a heading element ` +\n\t\t\t\t\t`(h1-h6) or an element with role=\"heading\". Found parent: <${parent.tagName.toLowerCase()}>`,\n\t\t\t);\n\t\t}\n\n\t\tif (hasHeadingRole && !parent.hasAttribute('aria-level')) {\n\t\t\tthrow Error('BrnAccordionTrigger: Elements with role=\"heading\" must have an aria-level attribute.');\n\t\t}\n\t}\n}\n\nconst HORIZONTAL_KEYS_TO_PREVENT_DEFAULT = [\n\t'ArrowLeft',\n\t'ArrowRight',\n\t'PageDown',\n\t'PageUp',\n\t'Home',\n\t'End',\n\t' ',\n\t'Enter',\n] as const;\n\nconst VERTICAL_KEYS_TO_PREVENT_DEFAULT = [\n\t'ArrowUp',\n\t'ArrowDown',\n\t'PageDown',\n\t'PageUp',\n\t'Home',\n\t'End',\n\t' ',\n\t'Enter',\n] as const;\n\n@Directive({\n\tselector: '[brnAccordion]',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.data-orientation]': 'orientation()',\n\t},\n\texportAs: 'brnAccordion',\n})\nexport class BrnAccordion implements AfterContentInit, OnDestroy {\n\tprivate readonly _el = inject(ElementRef<HTMLElement>);\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _keyManager = computed(() =>\n\t\tnew FocusKeyManager<BrnAccordionTrigger>(this.triggers())\n\t\t\t.withHomeAndEnd()\n\t\t\t.withPageUpDown()\n\t\t\t.withWrap()\n\t\t\t.withHorizontalOrientation(this.orientation() === 'vertical' ? null : (this.dir() ?? 'ltr'))\n\t\t\t.withVerticalOrientation(this.orientation() === 'vertical'),\n\t);\n\n\tprivate readonly _focused = signal<boolean>(false);\n\tprivate readonly _openItemIds = signal<number[]>([]);\n\tpublic readonly openItemIds = this._openItemIds.asReadonly();\n\tpublic readonly state = computed(() => (this._openItemIds().length > 0 ? 'open' : 'closed'));\n\n\tpublic readonly triggers = contentChildren(BrnAccordionTrigger, { descendants: true });\n\n\t/**\n\t * Whether the accordion is in single or multiple mode.\n\t * @default 'single'\n\t */\n\tpublic readonly type = input<'single' | 'multiple'>('single');\n\t/**\n\t * The direction of the accordion, either 'ltr' (left-to-right) or 'rtl' (right-to-left).\n\t * @default null\n\t */\n\tpublic readonly dir = input<'ltr' | 'rtl' | null>(null);\n\t/**\n\t * The orientation of the accordion, either 'horizontal' or 'vertical'.\n\t * @default 'vertical'\n\t */\n\tpublic readonly orientation = input<'horizontal' | 'vertical'>('vertical');\n\n\tpublic ngAfterContentInit() {\n\t\tthis._el.nativeElement.addEventListener('keydown', (event: KeyboardEvent) => {\n\t\t\tif (this.shouldIgnoreEvent(event)) return;\n\t\t\tthis._keyManager()?.onKeydown(event);\n\t\t\tthis.preventDefaultEvents(event);\n\t\t});\n\t\tthis._focusMonitor.monitor(this._el, true).subscribe((origin) => this._focused.set(origin !== null));\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._focusMonitor.stopMonitoring(this._el);\n\t}\n\n\tpublic setActiveItem(item: BrnAccordionTrigger) {\n\t\tthis._keyManager()?.setActiveItem(item);\n\t}\n\n\tpublic toggleItem(id: number) {\n\t\tif (this._openItemIds().includes(id)) {\n\t\t\tthis.closeItem(id);\n\t\t\treturn;\n\t\t}\n\t\tthis.openItem(id);\n\t}\n\n\tpublic openItem(id: number) {\n\t\tif (this.type() === 'single') {\n\t\t\tthis._openItemIds.set([id]);\n\t\t\treturn;\n\t\t}\n\t\tthis._openItemIds.update((ids) => (ids.includes(id) ? ids : [...ids, id]));\n\t}\n\n\tpublic closeItem(id: number) {\n\t\tthis._openItemIds.update((ids) => ids.filter((openId) => openId !== id));\n\t}\n\n\tprivate isEditableTarget(el: EventTarget | null): boolean {\n\t\tconst node = el as HTMLElement | null;\n\t\tif (!node) return false;\n\n\t\tconst tag = node.tagName;\n\t\tif (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') return true;\n\t\tif (node.isContentEditable) return true;\n\n\t\tconst role = node.getAttribute?.('role') ?? '';\n\t\tif (/^(textbox|searchbox|combobox|listbox|grid|tree|menu|spinbutton|slider)$/.test(role)) return true;\n\n\t\tconst editableAncestor = node.closest?.(\n\t\t\t'input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"], ' +\n\t\t\t\t'[role=\"textbox\"], [role=\"searchbox\"], [role=\"combobox\"], [role=\"listbox\"], ' +\n\t\t\t\t'[role=\"grid\"], [role=\"tree\"], [role=\"menu\"], [role=\"spinbutton\"], [role=\"slider\"]',\n\t\t);\n\t\treturn !!editableAncestor;\n\t}\n\n\tprivate shouldIgnoreEvent(e: KeyboardEvent): boolean {\n\t\tif (e.defaultPrevented) return true; // another handler already acted\n\t\tif (e.ctrlKey || e.metaKey || e.altKey) return true; // let shortcuts through\n\t\treturn this.isEditableTarget(e.target); // don't steal from editable/ARIA widgets\n\t}\n\n\tprivate preventDefaultEvents(event: KeyboardEvent) {\n\t\tif (event.defaultPrevented) return;\n\t\tif (!this._focused()) return;\n\t\tif (!('key' in event)) return;\n\n\t\tconst keys: readonly string[] =\n\t\t\tthis.orientation() === 'horizontal' ? HORIZONTAL_KEYS_TO_PREVENT_DEFAULT : VERTICAL_KEYS_TO_PREVENT_DEFAULT;\n\n\t\tif (keys.includes(event.key) && event.code !== 'NumpadEnter') {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n}\n","import {\n\tChangeDetectionStrategy,\n\tComponent,\n\tViewEncapsulation,\n\tcomputed,\n\tinject,\n\tinput,\n\tlinkedSignal,\n} from '@angular/core';\nimport type { CustomElementClassSettable } from '@spartan-ng/brain/core';\nimport type { ClassValue } from 'clsx';\nimport { BrnAccordionItem } from './brn-accordion';\n\n@Component({\n\tselector: 'brn-accordion-content',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.aria-labelledby]': 'ariaLabeledBy',\n\t\trole: 'region',\n\t\t'[id]': 'id',\n\t},\n\ttemplate: `\n\t\t<div [attr.inert]=\"_addInert()\" style=\"overflow: hidden\">\n\t\t\t<p [class]=\"_contentClass()\">\n\t\t\t\t<ng-content />\n\t\t\t</p>\n\t\t</div>\n\t`,\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tencapsulation: ViewEncapsulation.None,\n})\nexport class BrnAccordionContent implements CustomElementClassSettable {\n\tprivate readonly _item = inject(BrnAccordionItem);\n\n\tpublic readonly state = this._item.state;\n\tpublic readonly id = `brn-accordion-content-${this._item.id}`;\n\tpublic readonly ariaLabeledBy = `brn-accordion-trigger-${this._item.id}`;\n\n\tprotected readonly _addInert = computed(() => (this.state() === 'closed' ? true : undefined));\n\t/**\n\t * The class to be applied to the content element.\n\t */\n\tpublic readonly contentClass = input<ClassValue>('');\n\n\tprotected readonly _contentClass = linkedSignal(() => this.contentClass());\n\n\tconstructor() {\n\t\tif (!this._item) {\n\t\t\tthrow Error('Accordion Content can only be used inside an AccordionItem. Add brnAccordionItem to parent.');\n\t\t}\n\t}\n\n\tpublic setClassToCustomElement(classes: ClassValue) {\n\t\tthis._contentClass.set(classes);\n\t}\n}\n","import { BrnAccordion, BrnAccordionItem, BrnAccordionTrigger } from './lib/brn-accordion';\nimport { BrnAccordionContent } from './lib/brn-accordion-content';\n\nexport * from './lib/brn-accordion';\nexport * from './lib/brn-accordion-content';\n\nexport const BrnAccordionImports = [BrnAccordion, BrnAccordionContent, BrnAccordionItem, BrnAccordionTrigger] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MA2Ba,gBAAgB,CAAA;AACpB,IAAA,OAAO,gBAAgB,GAAG,CAAC;AACnB,IAAA,EAAE,GAAG,EAAE,gBAAgB,CAAC,gBAAgB;AACvC,IAAA,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC;AAClD;;;AAGG;IACa,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;AACpF,IAAA,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;AAE7G,IAAA,WAAA,GAAA;AACC,QAAA,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;AACrB,YAAA,MAAM,KAAK,CAAC,oFAAoF,CAAC;;QAElG,MAAM,CAAC,MAAK;AAC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,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,sBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAVrB;;;;;;AAMT,CAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAIW,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAlB/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,IAAI,EAAE;AACL,wBAAA,mBAAmB,EAAE,SAAS;AAC9B,wBAAA,wBAAwB,EAAE,eAAe;AACzC,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,MAAM,EAAE,IAAI;AACZ,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;AAMT,CAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;AACrC,iBAAA;;;ACxBM,MAAM,mBAAmB,GAAG,CAAC,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,mBAAmB;;ACN5G;;AAEG;;;;"}
1
+ {"version":3,"file":"spartan-ng-brain-accordion.mjs","sources":["../../../../libs/brain/accordion/src/lib/brn-accordion.ts","../../../../libs/brain/accordion/src/lib/brn-accordion-content.ts","../../../../libs/brain/accordion/src/index.ts","../../../../libs/brain/accordion/src/spartan-ng-brain-accordion.ts"],"sourcesContent":["import { type FocusableOption, FocusKeyManager, FocusMonitor } from '@angular/cdk/a11y';\nimport { type BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n\ttype AfterContentInit,\n\tcomputed,\n\tcontentChildren,\n\tDirective,\n\teffect,\n\tElementRef,\n\tinject,\n\tinput,\n\tisDevMode,\n\ttype OnDestroy,\n\toutput,\n\tsignal,\n\tuntracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { fromEvent } from 'rxjs';\n\n@Directive({\n\tselector: '[brnAccordionItem]',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t},\n\texportAs: 'brnAccordionItem',\n})\nexport class BrnAccordionItem {\n\tprivate static _itemIdGenerator = 0;\n\tpublic readonly id = ++BrnAccordionItem._itemIdGenerator;\n\tprivate readonly _accordion = inject(BrnAccordion);\n\t/**\n\t * Whether the item is opened or closed.\n\t * @default false\n\t */\n\tpublic readonly isOpened = input<boolean, BooleanInput>(false, { transform: coerceBooleanProperty });\n\t/**\n\t * Computed state of the item, either 'open' or 'closed'\n\t * @default closed\n\t */\n\tpublic readonly state = computed(() => (this._accordion.openItemIds().includes(this.id) ? 'open' : 'closed'));\n\t/**\n\t * Emits boolean when the item is opened or closed.\n\t */\n\tpublic readonly stateChange = output<'open' | 'closed'>();\n\t/**\n\t * Emits state change when item is opened or closed\n\t */\n\tpublic readonly openedChange = output<boolean>();\n\n\tconstructor() {\n\t\tif (!this._accordion) {\n\t\t\tthrow Error('Accordion item can only be used inside an Accordion. Add brnAccordion to ancestor.');\n\t\t}\n\t\teffect(() => {\n\t\t\tconst state = this.state();\n\t\t\tuntracked(() => {\n\t\t\t\tthis.stateChange.emit(state);\n\t\t\t\tthis.openedChange.emit(state === 'open');\n\t\t\t});\n\t\t});\n\t\teffect(() => {\n\t\t\tconst isOpened = this.isOpened();\n\t\t\tuntracked(() => {\n\t\t\t\tif (isOpened) {\n\t\t\t\t\tthis._accordion.openItem(this.id);\n\t\t\t\t} else {\n\t\t\t\t\tthis._accordion.closeItem(this.id);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n\n@Directive({\n\tselector: '[brnAccordionTrigger]',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.aria-expanded]': 'state() === \"open\"',\n\t\t'[attr.aria-controls]': 'ariaControls',\n\t\t'[id]': 'id',\n\t\t'[attr.role]': '\"button\"',\n\t\t'(click)': 'toggle($event)',\n\t\t'(keyup.space)': 'toggle($event)',\n\t\t'(keyup.enter)': 'toggle($event)',\n\t},\n})\nexport class BrnAccordionTrigger implements FocusableOption {\n\tprivate readonly _accordion = inject(BrnAccordion);\n\tprivate readonly _item = inject(BrnAccordionItem);\n\tprivate readonly _el = inject(ElementRef<HTMLElement>);\n\n\tpublic readonly state = this._item.state;\n\tpublic readonly id = `brn-accordion-trigger-${this._item.id}`;\n\tpublic readonly ariaControls = `brn-accordion-content-${this._item.id}`;\n\tconstructor() {\n\t\tif (!this._accordion) throw Error('Accordion trigger requires a parent Accordion.');\n\t\tif (!this._item) throw Error('Accordion trigger requires a parent AccordionItem.');\n\t\tthis.validateAriaStructure();\n\n\t\tfromEvent(this._el.nativeElement, 'focus')\n\t\t\t.pipe(takeUntilDestroyed())\n\t\t\t.subscribe(() => {\n\t\t\t\tthis._accordion.setActiveItem(this);\n\t\t\t});\n\t}\n\n\tprotected toggle(event: Event): void {\n\t\tevent.preventDefault();\n\t\tthis._accordion.toggleItem(this._item.id);\n\t}\n\n\tpublic focus() {\n\t\tthis._el.nativeElement.focus();\n\t}\n\n\tprivate validateAriaStructure(): void {\n\t\tconst element = this._el.nativeElement;\n\n\t\tconst isButton = element.tagName === 'BUTTON';\n\t\tconst hasButtonRole = element.getAttribute('role') === 'button';\n\n\t\tif (!isButton && !hasButtonRole) {\n\t\t\tthrow Error(\n\t\t\t\t`BrnAccordionTrigger: The trigger element must be a <button> or have role=\"button\". ` +\n\t\t\t\t\t`Found: <${element.tagName.toLowerCase()}>`,\n\t\t\t);\n\t\t}\n\n\t\tconst parent = element.parentElement;\n\t\tif (!parent) {\n\t\t\tconst message = 'BrnAccordionTrigger: The trigger button must be wrapped in a heading element.';\n\t\t\tif (isDevMode()) {\n\t\t\t\tthrow Error(message);\n\t\t\t} else {\n\t\t\t\tconsole.warn(message);\n\t\t\t}\n\t\t}\n\n\t\tconst isNativeHeading = /^H[1-6]$/.test(parent.tagName);\n\t\tconst hasHeadingRole = parent.getAttribute('role') === 'heading';\n\n\t\tif (!isNativeHeading && !hasHeadingRole) {\n\t\t\tthrow Error(\n\t\t\t\t`BrnAccordionTrigger: The trigger button must be wrapped in a heading element ` +\n\t\t\t\t\t`(h1-h6) or an element with role=\"heading\". Found parent: <${parent.tagName.toLowerCase()}>`,\n\t\t\t);\n\t\t}\n\n\t\tif (hasHeadingRole && !parent.hasAttribute('aria-level')) {\n\t\t\tthrow Error('BrnAccordionTrigger: Elements with role=\"heading\" must have an aria-level attribute.');\n\t\t}\n\t}\n}\n\nconst HORIZONTAL_KEYS_TO_PREVENT_DEFAULT = [\n\t'ArrowLeft',\n\t'ArrowRight',\n\t'PageDown',\n\t'PageUp',\n\t'Home',\n\t'End',\n\t' ',\n\t'Enter',\n] as const;\n\nconst VERTICAL_KEYS_TO_PREVENT_DEFAULT = [\n\t'ArrowUp',\n\t'ArrowDown',\n\t'PageDown',\n\t'PageUp',\n\t'Home',\n\t'End',\n\t' ',\n\t'Enter',\n] as const;\n\n@Directive({\n\tselector: '[brnAccordion]',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.data-orientation]': 'orientation()',\n\t},\n\texportAs: 'brnAccordion',\n})\nexport class BrnAccordion implements AfterContentInit, OnDestroy {\n\tprivate readonly _el = inject(ElementRef<HTMLElement>);\n\tprivate readonly _focusMonitor = inject(FocusMonitor);\n\tprivate readonly _keyManager = computed(() =>\n\t\tnew FocusKeyManager<BrnAccordionTrigger>(this.triggers())\n\t\t\t.withHomeAndEnd()\n\t\t\t.withPageUpDown()\n\t\t\t.withWrap()\n\t\t\t.withHorizontalOrientation(this.orientation() === 'vertical' ? null : (this.dir() ?? 'ltr'))\n\t\t\t.withVerticalOrientation(this.orientation() === 'vertical'),\n\t);\n\n\tprivate readonly _focused = signal<boolean>(false);\n\tprivate readonly _openItemIds = signal<number[]>([]);\n\tpublic readonly openItemIds = this._openItemIds.asReadonly();\n\tpublic readonly state = computed(() => (this._openItemIds().length > 0 ? 'open' : 'closed'));\n\n\tpublic readonly triggers = contentChildren(BrnAccordionTrigger, { descendants: true });\n\n\t/**\n\t * Whether the accordion is in single or multiple mode.\n\t * @default 'single'\n\t */\n\tpublic readonly type = input<'single' | 'multiple'>('single');\n\t/**\n\t * The direction of the accordion, either 'ltr' (left-to-right) or 'rtl' (right-to-left).\n\t * @default null\n\t */\n\tpublic readonly dir = input<'ltr' | 'rtl' | null>(null);\n\t/**\n\t * The orientation of the accordion, either 'horizontal' or 'vertical'.\n\t * @default 'vertical'\n\t */\n\tpublic readonly orientation = input<'horizontal' | 'vertical'>('vertical');\n\n\tpublic ngAfterContentInit() {\n\t\tthis._el.nativeElement.addEventListener('keydown', (event: KeyboardEvent) => {\n\t\t\tif (this.shouldIgnoreEvent(event)) return;\n\t\t\tthis._keyManager()?.onKeydown(event);\n\t\t\tthis.preventDefaultEvents(event);\n\t\t});\n\t\tthis._focusMonitor.monitor(this._el, true).subscribe((origin) => this._focused.set(origin !== null));\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._focusMonitor.stopMonitoring(this._el);\n\t}\n\n\tpublic setActiveItem(item: BrnAccordionTrigger) {\n\t\tthis._keyManager()?.setActiveItem(item);\n\t}\n\n\tpublic toggleItem(id: number) {\n\t\tif (this._openItemIds().includes(id)) {\n\t\t\tthis.closeItem(id);\n\t\t\treturn;\n\t\t}\n\t\tthis.openItem(id);\n\t}\n\n\tpublic openItem(id: number) {\n\t\tif (this.type() === 'single') {\n\t\t\tthis._openItemIds.set([id]);\n\t\t\treturn;\n\t\t}\n\t\tthis._openItemIds.update((ids) => (ids.includes(id) ? ids : [...ids, id]));\n\t}\n\n\tpublic closeItem(id: number) {\n\t\tthis._openItemIds.update((ids) => ids.filter((openId) => openId !== id));\n\t}\n\n\tprivate isEditableTarget(el: EventTarget | null): boolean {\n\t\tconst node = el as HTMLElement | null;\n\t\tif (!node) return false;\n\n\t\tconst tag = node.tagName;\n\t\tif (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT') return true;\n\t\tif (node.isContentEditable) return true;\n\n\t\tconst role = node.getAttribute?.('role') ?? '';\n\t\tif (/^(textbox|searchbox|combobox|listbox|grid|tree|menu|spinbutton|slider)$/.test(role)) return true;\n\n\t\tconst editableAncestor = node.closest?.(\n\t\t\t'input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"], ' +\n\t\t\t\t'[role=\"textbox\"], [role=\"searchbox\"], [role=\"combobox\"], [role=\"listbox\"], ' +\n\t\t\t\t'[role=\"grid\"], [role=\"tree\"], [role=\"menu\"], [role=\"spinbutton\"], [role=\"slider\"]',\n\t\t);\n\t\treturn !!editableAncestor;\n\t}\n\n\tprivate shouldIgnoreEvent(e: KeyboardEvent): boolean {\n\t\tif (e.defaultPrevented) return true; // another handler already acted\n\t\tif (e.ctrlKey || e.metaKey || e.altKey) return true; // let shortcuts through\n\t\treturn this.isEditableTarget(e.target); // don't steal from editable/ARIA widgets\n\t}\n\n\tprivate preventDefaultEvents(event: KeyboardEvent) {\n\t\tif (event.defaultPrevented) return;\n\t\tif (!this._focused()) return;\n\t\tif (!('key' in event)) return;\n\n\t\tconst keys: readonly string[] =\n\t\t\tthis.orientation() === 'horizontal' ? HORIZONTAL_KEYS_TO_PREVENT_DEFAULT : VERTICAL_KEYS_TO_PREVENT_DEFAULT;\n\n\t\tif (keys.includes(event.key) && event.code !== 'NumpadEnter') {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n}\n","import { Directive, ElementRef, afterNextRender, computed, inject, input, linkedSignal, signal } from '@angular/core';\nimport { BrnAccordionItem } from './brn-accordion';\n\n@Directive({\n\tselector: 'brn-accordion-content,[brnAccordionContent]',\n\thost: {\n\t\t'[attr.data-state]': 'state()',\n\t\t'[attr.aria-labelledby]': 'ariaLabeledBy',\n\t\trole: 'region',\n\t\t'[id]': 'id',\n\t\t'[style.--brn-accordion-content-width.px]': '_width()',\n\t\t'[style.--brn-accordion-content-height.px]': '_height()',\n\t\t'[attr.inert]': '_inert()',\n\t\t'[attr.style]': '_mutableStyle()',\n\t},\n})\nexport class BrnAccordionContent {\n\tprivate readonly _item = inject(BrnAccordionItem);\n\tprivate readonly _elementRef = inject(ElementRef);\n\n\tprotected readonly _width = signal<number | null>(null);\n\tprotected readonly _height = signal<number | null>(null);\n\tprotected readonly _dimensionsInitiated = signal(false);\n\tprotected readonly _inert = computed(() => (this.state() === 'closed' ? true : undefined));\n\n\tpublic readonly state = this._item.state;\n\tpublic readonly id = `brn-accordion-content-${this._item.id}`;\n\tpublic readonly ariaLabeledBy = `brn-accordion-trigger-${this._item.id}`;\n\t/**\n\t * The style to be applied to the host element after the dimensions are calculated.\n\t * @default 'overflow: hidden'\n\t */\n\tpublic readonly style = input<string>('overflow: hidden');\n\t/**\n\t * The style to be applied to the host element while the dimensions are being calculated.\n\t * @default 'opacity: 0'\n\t */\n\tpublic readonly styleWhileDimensionsAreInitiating = input<string>('overflow: hidden');\n\tprotected readonly _mutableStyle = linkedSignal(() =>\n\t\tthis._dimensionsInitiated() ? this.style() : this.styleWhileDimensionsAreInitiating(),\n\t);\n\n\tconstructor() {\n\t\tif (!this._item) {\n\t\t\tthrow Error('Accordion Content can only be used inside an AccordionItem. Add brnAccordionItem to parent.');\n\t\t}\n\t\tafterNextRender(() => {\n\t\t\tconst content = this._elementRef.nativeElement.firstChild as HTMLElement | null;\n\t\t\tif (!content) return;\n\t\t\tconst { width, height } = content.getBoundingClientRect();\n\t\t\tthis._width.set(width);\n\t\t\tthis._height.set(height);\n\t\t\tthis._dimensionsInitiated.set(true);\n\t\t});\n\t}\n}\n","import { BrnAccordion, BrnAccordionItem, BrnAccordionTrigger } from './lib/brn-accordion';\nimport { BrnAccordionContent } from './lib/brn-accordion-content';\n\nexport * from './lib/brn-accordion';\nexport * from './lib/brn-accordion-content';\n\nexport const BrnAccordionImports = [BrnAccordion, BrnAccordionContent, BrnAccordionItem, BrnAccordionTrigger] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MA2Ba,gBAAgB,CAAA;AACpB,IAAA,OAAO,gBAAgB,GAAG,CAAC;AACnB,IAAA,EAAE,GAAG,EAAE,gBAAgB,CAAC,gBAAgB;AACvC,IAAA,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC;AAClD;;;AAGG;IACa,QAAQ,GAAG,KAAK,CAAwB,KAAK,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;AACpG;;;AAGG;AACa,IAAA,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,MAAM,GAAG,QAAQ,CAAC,CAAC;AAC7G;;AAEG;IACa,WAAW,GAAG,MAAM,EAAqB;AACzD;;AAEG;IACa,YAAY,GAAG,MAAM,EAAW;AAEhD,IAAA,WAAA,GAAA;AACC,QAAA,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;AACrB,YAAA,MAAM,KAAK,CAAC,oFAAoF,CAAC;;QAElG,MAAM,CAAC,MAAK;AACX,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;YAC1B,SAAS,CAAC,MAAK;AACd,gBAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC;gBAC5B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC;AACzC,aAAC,CAAC;AACH,SAAC,CAAC;QACF,MAAM,CAAC,MAAK;AACX,YAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE;YAChC,SAAS,CAAC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