@koobiq/components 20.1.0 → 20.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/accordion/_accordion-theme.scss +1 -1
  2. package/accordion/accordion-tokens.scss +1 -0
  3. package/accordion/{accordion-trigger.component.scss → accordion-trigger.scss} +4 -0
  4. package/accordion/{accordion.component.scss → accordion.scss} +3 -3
  5. package/accordion/index.d.ts +215 -119
  6. package/alert/_alert-theme.scss +14 -0
  7. package/alert/alert.component.scss +24 -13
  8. package/alert/index.d.ts +63 -29
  9. package/autocomplete/autocomplete.scss +2 -1
  10. package/autocomplete/index.d.ts +35 -29
  11. package/badge/index.d.ts +2 -3
  12. package/clamped-text/index.d.ts +3 -2
  13. package/core/index.d.ts +116 -11
  14. package/core/styles/_core.scss +2 -0
  15. package/core/styles/common/_animation.scss +31 -24
  16. package/core/styles/common/_connected-overlay.scss +36 -0
  17. package/core/styles/common/_select.scss +7 -2
  18. package/dropdown/dropdown-item.scss +16 -0
  19. package/dropdown/dropdown-tokens.scss +2 -1
  20. package/dropdown/dropdown.scss +9 -0
  21. package/dropdown/index.d.ts +73 -6
  22. package/fesm2022/koobiq-components-accordion.mjs +406 -303
  23. package/fesm2022/koobiq-components-accordion.mjs.map +1 -1
  24. package/fesm2022/koobiq-components-actions-panel.mjs +1 -1
  25. package/fesm2022/koobiq-components-actions-panel.mjs.map +1 -1
  26. package/fesm2022/koobiq-components-alert.mjs +88 -48
  27. package/fesm2022/koobiq-components-alert.mjs.map +1 -1
  28. package/fesm2022/koobiq-components-app-switcher.mjs +1 -1
  29. package/fesm2022/koobiq-components-app-switcher.mjs.map +1 -1
  30. package/fesm2022/koobiq-components-autocomplete.mjs +37 -23
  31. package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
  32. package/fesm2022/koobiq-components-badge.mjs +5 -4
  33. package/fesm2022/koobiq-components-badge.mjs.map +1 -1
  34. package/fesm2022/koobiq-components-breadcrumbs.mjs +1 -1
  35. package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
  36. package/fesm2022/koobiq-components-clamped-text.mjs +5 -0
  37. package/fesm2022/koobiq-components-clamped-text.mjs.map +1 -1
  38. package/fesm2022/koobiq-components-code-block.mjs +1 -1
  39. package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
  40. package/fesm2022/koobiq-components-core.mjs +98 -4
  41. package/fesm2022/koobiq-components-core.mjs.map +1 -1
  42. package/fesm2022/koobiq-components-datepicker.mjs +10 -7
  43. package/fesm2022/koobiq-components-datepicker.mjs.map +1 -1
  44. package/fesm2022/koobiq-components-dropdown.mjs +99 -20
  45. package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
  46. package/fesm2022/koobiq-components-file-upload.mjs +2 -2
  47. package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
  48. package/fesm2022/koobiq-components-filter-bar.mjs +203 -32
  49. package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
  50. package/fesm2022/koobiq-components-form-field.mjs +4 -4
  51. package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
  52. package/fesm2022/koobiq-components-icon.mjs +14 -5
  53. package/fesm2022/koobiq-components-icon.mjs.map +1 -1
  54. package/fesm2022/koobiq-components-inline-edit.mjs +4 -2
  55. package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -1
  56. package/fesm2022/koobiq-components-navbar.mjs +117 -22
  57. package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
  58. package/fesm2022/koobiq-components-notification-center.mjs +19 -4
  59. package/fesm2022/koobiq-components-notification-center.mjs.map +1 -1
  60. package/fesm2022/koobiq-components-popover.mjs +5 -0
  61. package/fesm2022/koobiq-components-popover.mjs.map +1 -1
  62. package/fesm2022/koobiq-components-search-expandable.mjs +43 -8
  63. package/fesm2022/koobiq-components-search-expandable.mjs.map +1 -1
  64. package/fesm2022/koobiq-components-select.mjs +36 -45
  65. package/fesm2022/koobiq-components-select.mjs.map +1 -1
  66. package/fesm2022/koobiq-components-split-button.mjs +3 -10
  67. package/fesm2022/koobiq-components-split-button.mjs.map +1 -1
  68. package/fesm2022/koobiq-components-tabs.mjs +29 -17
  69. package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
  70. package/fesm2022/koobiq-components-tags.mjs +1 -1
  71. package/fesm2022/koobiq-components-tags.mjs.map +1 -1
  72. package/fesm2022/koobiq-components-timepicker.mjs +3 -4
  73. package/fesm2022/koobiq-components-timepicker.mjs.map +1 -1
  74. package/fesm2022/koobiq-components-timezone.mjs +3 -5
  75. package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
  76. package/fesm2022/koobiq-components-toast.mjs +1 -1
  77. package/fesm2022/koobiq-components-toast.mjs.map +1 -1
  78. package/fesm2022/koobiq-components-tooltip.mjs +118 -6
  79. package/fesm2022/koobiq-components-tooltip.mjs.map +1 -1
  80. package/fesm2022/koobiq-components-tree-select.mjs +39 -31
  81. package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
  82. package/filter-bar/_filter-bar-theme.scss +0 -4
  83. package/filter-bar/filter-bar-tokens.scss +3 -0
  84. package/filter-bar/filters.scss +3 -2
  85. package/filter-bar/index.d.ts +62 -3
  86. package/filter-bar/pipes/base-pipe.scss +0 -11
  87. package/filter-bar/pipes/pipe-input.scss +10 -0
  88. package/icon/icon-button.scss +3 -1
  89. package/icon/index.d.ts +15 -2
  90. package/navbar/_navbar-item_vertical.scss +7 -5
  91. package/navbar/index.d.ts +38 -4
  92. package/navbar/navbar-brand.scss +17 -7
  93. package/notification-center/index.d.ts +2 -1
  94. package/package.json +3 -3
  95. package/prebuilt-themes/dark-theme.css +1 -1
  96. package/prebuilt-themes/light-theme.css +1 -1
  97. package/prebuilt-themes/theme.css +1 -1
  98. package/schematics/collection.json +10 -0
  99. package/schematics/migrations/alert-signals/README.md +64 -0
  100. package/schematics/migrations/alert-signals/data.js +70 -0
  101. package/schematics/migrations/alert-signals/index.js +350 -0
  102. package/schematics/migrations/alert-signals/schema.json +20 -0
  103. package/schematics/migrations/autocomplete-panel-width-auto/README.md +68 -0
  104. package/schematics/migrations/autocomplete-panel-width-auto/index.js +70 -0
  105. package/schematics/migrations/autocomplete-panel-width-auto/schema.json +15 -0
  106. package/schematics/migrations/filter-bar-signals/README.md +1 -1
  107. package/schematics/migrations.json +11 -1
  108. package/schematics/ng-add/index.js +1 -1
  109. package/schematics/utils/angular-parsing.js +11 -2
  110. package/search-expandable/index.d.ts +3 -0
  111. package/select/index.d.ts +51 -24
  112. package/tabs/_tabs-common.scss +60 -31
  113. package/tabs/_tabs-theme.scss +12 -0
  114. package/tabs/index.d.ts +2 -2
  115. package/tabs/tab-header.scss +14 -0
  116. package/tabs/tab-nav-bar.scss +4 -0
  117. package/tabs/tabs-tokens.scss +1 -0
  118. package/timezone/index.d.ts +1 -3
  119. package/tooltip/index.d.ts +73 -4
  120. package/tree-select/index.d.ts +46 -22
@@ -36,7 +36,7 @@
36
36
  color: var(--kbq-accordion-item-states-disabled-text-color);
37
37
 
38
38
  & .kbq-accordion-trigger__icon {
39
- color: var(--kbq-accordion-item-states-disabled-icon-color) !important;
39
+ color: var(--kbq-accordion-item-states-disabled-icon-color);
40
40
  }
41
41
  }
42
42
  }
@@ -1,4 +1,5 @@
1
1
  .kbq-accordion {
2
+ --kbq-accordion-size-item-border-width: 2px;
2
3
  --kbq-accordion-size-item-header-height: 36px;
3
4
  --kbq-accordion-size-item-header-variant-fill-padding: var(--kbq-size-xs) var(--kbq-size-s);
4
5
  --kbq-accordion-size-item-header-variant-hug-padding: var(--kbq-size-xs) var(--kbq-size-s) var(--kbq-size-xs)
@@ -11,6 +11,10 @@
11
11
  padding: var(--kbq-size-xxs);
12
12
 
13
13
  transition: transform 300ms ease-out;
14
+
15
+ @media (prefers-reduced-motion: reduce) {
16
+ transition: none;
17
+ }
14
18
  }
15
19
 
16
20
  & .kbq-accordion-trigger__badge,
@@ -8,7 +8,7 @@
8
8
  box-sizing: border-box;
9
9
  display: block;
10
10
 
11
- border-width: 2px;
11
+ border-width: var(--kbq-accordion-size-item-border-width);
12
12
  border-style: solid;
13
13
  border-color: transparent;
14
14
  }
@@ -23,14 +23,14 @@
23
23
  display: block;
24
24
  overflow: hidden;
25
25
 
26
- & > p {
26
+ & > .kbq-accordion-content__body {
27
27
  margin: unset;
28
28
  padding: var(--kbq-accordion-size-item-content-padding);
29
29
  }
30
30
 
31
31
  &[data-state='open'] {
32
32
  transition: height 300ms ease-out;
33
- height: var(--radix-accordion-content-height);
33
+ height: var(--kbq-accordion-content-height);
34
34
  }
35
35
 
36
36
  &[data-state='closed'] {
@@ -1,83 +1,55 @@
1
- import * as i0 from '@angular/core';
2
- import { OnDestroy, AfterViewInit, AfterContentInit, ElementRef, ChangeDetectorRef, EventEmitter } from '@angular/core';
3
- import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
4
- import * as i1 from '@koobiq/components/icon';
5
- import { KbqIcon } from '@koobiq/components/icon';
1
+ import * as _angular_core from '@angular/core';
2
+ import { InjectionToken, AfterViewInit, OnDestroy, ChangeDetectorRef, AfterContentInit, ElementRef } from '@angular/core';
6
3
  import { FocusMonitor, FocusKeyManager } from '@angular/cdk/a11y';
7
4
  import { Directionality } from '@angular/cdk/bidi';
5
+ import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
8
6
  import { Subject } from 'rxjs';
7
+ import * as i1 from '@koobiq/components/icon';
8
+ import { KbqIcon } from '@koobiq/components/icon';
9
9
 
10
- declare enum KbqAccordionVariant {
11
- fill = "fill",
12
- hug = "hug",
13
- hugSpaceBetween = "hugSpaceBetween"
10
+ /** A snapshot of a single accordion item's persisted state. */
11
+ interface KbqAccordionItemSnapshot {
12
+ /** Whether the item is expanded. */
13
+ expanded: boolean;
14
+ /** The item's value. */
15
+ value: string;
14
16
  }
15
- type KbqAccordionType = 'single' | 'multiple';
16
- type KbqAccordionOrientation = 'horizontal' | 'vertical';
17
- declare class KbqAccordion implements OnDestroy, AfterViewInit, AfterContentInit {
17
+ /** The persisted state of an accordion, keyed by accordion item id. */
18
+ interface KbqAccordionState {
19
+ [itemId: string]: KbqAccordionItemSnapshot;
20
+ }
21
+ /**
22
+ * Strategy used by `KbqAccordion` to persist and restore the expanded state of its items
23
+ * while `useStateSaving` is enabled.
24
+ *
25
+ * Provide a custom implementation through the `KBQ_ACCORDION_STATE_STORE` token to change
26
+ * where the state is stored (e.g. `sessionStorage`, a backend, or an in-memory map).
27
+ */
28
+ interface KbqAccordionStateStore {
29
+ /** Returns the previously saved state for the given key, or `null` when nothing is stored/available. */
30
+ getState(key: string): KbqAccordionState | null;
31
+ /** Persists the state for the given key. */
32
+ setState(key: string, state: KbqAccordionState): void;
33
+ }
34
+ /**
35
+ * Default `KbqAccordionStateStore` implementation backed by `localStorage`.
36
+ *
37
+ * All access is guarded so it is safe on the server (SSR) and in environments where storage
38
+ * throws on access (private mode, sandboxed iframes) or contains corrupt JSON.
39
+ */
40
+ declare class KbqAccordionLocalStorageStateStore implements KbqAccordionStateStore {
18
41
  private readonly isBrowser;
19
- private readonly localStorage;
20
- /** @docs-private */
21
- protected readonly focusMonitor: FocusMonitor;
22
- /** @docs-private */
23
- protected readonly elementRef: ElementRef<any>;
24
- /** @docs-private */
25
- protected readonly changeDetectorRef: ChangeDetectorRef;
26
- /** @docs-private */
27
- protected readonly selectionDispatcher: UniqueSelectionDispatcher;
28
- /** @docs-private */
29
- protected readonly dir: Directionality | null;
30
- /** @docs-private */
31
- protected keyManager: FocusKeyManager<KbqAccordionItem>;
32
- /** @docs-private */
33
- readonly openCloseAllActions: Subject<boolean>;
34
- /** @docs-private */
35
- readonly items: i0.Signal<readonly any[]>;
36
- /** Specifies whether the accordion saves its states. Default is false */
37
- useStateSaving: boolean;
38
- readonly variant: i0.InputSignal<string>;
39
- /** Whether the Accordion is disabled. */
40
- readonly disabled: i0.InputSignalWithTransform<boolean, unknown>;
41
- /** The orientation of the accordion. */
42
- readonly orientation: i0.InputSignal<KbqAccordionOrientation>;
43
- /**
44
- * The value of the item to expand when initially rendered and type is "single". Use when you do not need to control the state of the items.
45
- */
46
- get defaultValue(): string[] | string;
47
- set defaultValue(value: string[] | string);
48
- /** Determines whether one or multiple items can be opened at the same time. */
49
- readonly type: i0.InputSignal<KbqAccordionType>;
50
- readonly collapsible: i0.InputSignal<boolean>;
51
- /** The controlled value of the item to expand */
52
- get value(): string[] | string;
53
- set value(value: string[] | string);
54
- readonly onValueChange: i0.OutputEmitterRef<void>;
55
- get id(): string;
56
- get isMultiple(): boolean;
57
- get hasSavedState(): boolean;
58
- private _value?;
59
- private _defaultValue;
60
- private onValueChangeSubscription;
61
- private _id;
62
- private state;
63
- constructor();
64
- ngAfterContentInit(): void;
65
- ngAfterViewInit(): void;
66
- ngOnDestroy(): void;
67
- /** @docs-private */
68
- keydownHandler(event: KeyboardEvent): void;
69
- /** Opens all enabled accordion items in an accordion where multi is enabled. */
70
- openAll(): void;
71
- /** Closes all enabled accordion items. */
72
- closeAll(): void;
73
- /** @docs-private */
74
- setActiveItem(item: KbqAccordionItem): void;
75
- /** @docs-private */
76
- saveItemState(item: KbqAccordionItem, force?: boolean): void;
77
- private getSavedState;
78
- static ɵfac: i0.ɵɵFactoryDeclaration<KbqAccordion, never>;
79
- static ɵcmp: i0.ɵɵComponentDeclaration<KbqAccordion, "kbq-accordion, [kbq-accordion]", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; }; }, { "onValueChange": "onValueChange"; }, ["items"], ["*"], true, never>;
42
+ private readonly window;
43
+ getState(key: string): KbqAccordionState | null;
44
+ setState(key: string, state: KbqAccordionState): void;
45
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionLocalStorageStateStore, never>;
46
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<KbqAccordionLocalStorageStateStore>;
80
47
  }
48
+ /**
49
+ * Injection token for the store used to persist accordion state while `useStateSaving` is enabled.
50
+ * Defaults to a `localStorage`-backed implementation (`KbqAccordionLocalStorageStateStore`).
51
+ */
52
+ declare const KBQ_ACCORDION_STATE_STORE: InjectionToken<KbqAccordionStateStore>;
81
53
 
82
54
  declare class KbqAccordionTriggerDirective {
83
55
  /** @docs-private */
@@ -92,30 +64,38 @@ declare class KbqAccordionTriggerDirective {
92
64
  get contentId(): string;
93
65
  /** Fires when trigger clicked */
94
66
  onClick(): void;
67
+ /**
68
+ * Keeps the accordion's key manager in sync with native focus so that arrow-key navigation
69
+ * continues from the header the user has just tabbed/focused into.
70
+ * @docs-private
71
+ */
72
+ onFocus(): void;
95
73
  /** @docs-private */
96
74
  focus(): void;
97
- static ɵfac: i0.ɵɵFactoryDeclaration<KbqAccordionTriggerDirective, never>;
98
- static ɵdir: i0.ɵɵDirectiveDeclaration<KbqAccordionTriggerDirective, "[kbqAccordionTrigger]", never, {}, {}, never, never, true, never>;
75
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionTriggerDirective, never>;
76
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KbqAccordionTriggerDirective, "[kbqAccordionTrigger]", never, {}, {}, never, never, true, never>;
99
77
  }
100
78
 
101
- declare class KbqAccordionTrigger implements AfterViewInit {
79
+ declare class KbqAccordionTrigger implements AfterViewInit, OnDestroy {
102
80
  /** @docs-private */
103
81
  protected readonly nativeElement: HTMLElement;
104
82
  /** @docs-private */
105
83
  protected readonly accordion: KbqAccordion;
106
84
  /** @docs-private */
107
- readonly icon: i0.Signal<KbqIcon>;
85
+ readonly icon: _angular_core.Signal<KbqIcon>;
108
86
  private savedTransition;
109
87
  private readonly afterRenderRef?;
88
+ private animationTimerId?;
110
89
  get isFill(): boolean;
111
90
  get isHug(): boolean;
112
91
  get isHugSpaceBetween(): boolean;
113
92
  constructor();
114
93
  ngAfterViewInit(): void;
94
+ ngOnDestroy(): void;
115
95
  disableAnimation(): void;
116
96
  enableAnimation(): void;
117
- static ɵfac: i0.ɵɵFactoryDeclaration<KbqAccordionTrigger, never>;
118
- static ɵcmp: i0.ɵɵComponentDeclaration<KbqAccordionTrigger, "kbq-accordion-trigger, [kbq-accordion-trigger]", never, {}, {}, never, ["*"], true, [{ directive: typeof KbqAccordionTriggerDirective; inputs: {}; outputs: {}; }]>;
97
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionTrigger, never>;
98
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<KbqAccordionTrigger, "kbq-accordion-trigger, [kbq-accordion-trigger]", never, {}, {}, never, ["*"], true, [{ directive: typeof KbqAccordionTriggerDirective; inputs: {}; outputs: {}; }]>;
119
99
  }
120
100
 
121
101
  type KbqAccordionItemState = 'open' | 'closed';
@@ -127,49 +107,51 @@ declare class KbqAccordionItem implements OnDestroy {
127
107
  /** @docs-private */
128
108
  protected readonly expansionDispatcher: UniqueSelectionDispatcher;
129
109
  /** @docs-private */
130
- readonly trigger: i0.Signal<KbqAccordionTriggerDirective | undefined>;
110
+ readonly trigger: _angular_core.Signal<KbqAccordionTriggerDirective | undefined>;
131
111
  /** @docs-private */
132
- readonly triggerComponent: i0.Signal<KbqAccordionTrigger | undefined>;
112
+ readonly triggerComponent: _angular_core.Signal<KbqAccordionTrigger | undefined>;
133
113
  /** @docs-private */
134
- readonly content: i0.Signal<any>;
114
+ readonly content: _angular_core.Signal<any>;
135
115
  /** The unique AccordionItem id. */
136
116
  get id(): string;
137
117
  private _id;
118
+ /** The current open/closed state of the item. @docs-private */
138
119
  get dataState(): KbqAccordionItemState;
120
+ /** The layout orientation inherited from the parent accordion. @docs-private */
139
121
  get orientation(): KbqAccordionOrientation;
140
122
  /** Whether the AccordionItem is expanded. */
141
123
  get expanded(): boolean;
142
124
  set expanded(expanded: boolean);
143
125
  private _expanded;
144
- set value(value: string);
145
- get value(): string;
146
- private _value?;
126
+ /**
127
+ * The item's own `value` input. Must stay `public`: a `protected` input cannot be bound from a
128
+ * consumer template (TS2445 under full AOT template type-checking).
129
+ * @docs-private
130
+ */
131
+ readonly valueInput: _angular_core.InputSignal<string>;
132
+ /** The item's effective value — its own value, or the item id when none is provided. */
133
+ readonly value: _angular_core.Signal<string>;
147
134
  /** Whether the AccordionItem is disabled. */
148
135
  get disabled(): boolean;
149
136
  set disabled(value: boolean);
150
137
  private _disabled;
151
138
  /** Event emitted every time the AccordionItem is closed. */
152
- readonly closed: i0.OutputEmitterRef<void>;
139
+ readonly closed: _angular_core.OutputEmitterRef<void>;
153
140
  /** Event emitted every time the AccordionItem is opened. */
154
- readonly opened: i0.OutputEmitterRef<void>;
141
+ readonly opened: _angular_core.OutputEmitterRef<void>;
155
142
  /**
156
- * Event emitted when the AccordionItem is destroyed.
157
- * @docs-private
158
- */
159
- readonly destroyed: EventEmitter<void>;
160
- /**
161
- * Emits whenever the expanded state of the accordion changes.
143
+ * Emits whenever the expanded state of the accordion item changes.
162
144
  * Primarily used to facilitate two-way binding.
163
145
  * @docs-private
164
146
  */
165
- readonly expandedChange: i0.OutputEmitterRef<boolean>;
147
+ readonly expandedChange: _angular_core.OutputEmitterRef<boolean>;
166
148
  /** Unregister function for expansionDispatcher. */
167
149
  private removeUniqueSelectionListener;
168
150
  /** Subscription to openAll/closeAll events. */
169
151
  private openCloseAllSubscription;
170
152
  constructor();
171
- /** Emits an event for the accordion item being destroyed. */
172
153
  ngOnDestroy(): void;
154
+ /** Moves focus to the item's trigger. */
173
155
  focus(): void;
174
156
  /** Toggles the expanded state of the accordion item. */
175
157
  toggle(): void;
@@ -177,19 +159,125 @@ declare class KbqAccordionItem implements OnDestroy {
177
159
  close(): void;
178
160
  /** Sets the expanded state of the accordion item to true. */
179
161
  open(): void;
180
- getState(): any;
162
+ /** Returns a snapshot of the item's current persisted state. @docs-private */
163
+ getState(): KbqAccordionItemSnapshot;
164
+ /** Disables the open/close animation of the item's content and chevron. @docs-private */
181
165
  disableAnimation(): void;
166
+ /** Restores the open/close animation of the item's content and chevron. @docs-private */
182
167
  enableAnimation(): void;
183
168
  private subscribeToOpenCloseAllActions;
184
- static ɵfac: i0.ɵɵFactoryDeclaration<KbqAccordionItem, never>;
185
- static ɵdir: i0.ɵɵDirectiveDeclaration<KbqAccordionItem, "kbq-accordion-item, [kbq-accordion-item]", never, { "expanded": { "alias": "expanded"; "required": false; }; "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "closed": "closed"; "opened": "opened"; "expandedChange": "expandedChange"; }, ["trigger", "triggerComponent", "content"], never, true, never>;
169
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionItem, never>;
170
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KbqAccordionItem, "kbq-accordion-item, [kbq-accordion-item]", never, { "expanded": { "alias": "expanded"; "required": false; }; "valueInput": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "closed": "closed"; "opened": "opened"; "expandedChange": "expandedChange"; }, ["trigger", "triggerComponent", "content"], never, true, never>;
186
171
  static ngAcceptInputType_expanded: unknown;
187
172
  static ngAcceptInputType_disabled: unknown;
188
173
  }
189
174
 
190
- declare class KbqAccordionContentDirective implements AfterContentInit, AfterViewInit {
175
+ /** Available visual variants of the accordion. */
176
+ type KbqAccordionVariant = 'fill' | 'hug' | 'hugSpaceBetween';
177
+ /** Determines whether one or multiple items can be expanded at the same time. */
178
+ type KbqAccordionType = 'single' | 'multiple';
179
+ /** The layout orientation of the accordion. */
180
+ type KbqAccordionOrientation = 'horizontal' | 'vertical';
181
+ declare class KbqAccordion implements OnDestroy, AfterViewInit, AfterContentInit {
182
+ /** @docs-private */
183
+ protected readonly focusMonitor: FocusMonitor;
184
+ /** @docs-private */
185
+ protected readonly elementRef: ElementRef<any>;
186
+ /** @docs-private */
187
+ protected readonly changeDetectorRef: ChangeDetectorRef;
188
+ /** @docs-private */
189
+ protected readonly selectionDispatcher: UniqueSelectionDispatcher;
190
+ /** @docs-private */
191
+ protected readonly dir: Directionality | null;
192
+ private readonly injector;
193
+ private readonly stateStore;
194
+ /** @docs-private */
195
+ protected keyManager: FocusKeyManager<KbqAccordionItem>;
196
+ /** Emits every time `openAll()` or `closeAll()` is called. @docs-private */
197
+ readonly openCloseAllActions: Subject<boolean>;
198
+ /** The accordion items projected into this accordion. @docs-private */
199
+ readonly items: _angular_core.Signal<readonly any[]>;
200
+ /** Whether the accordion persists the expanded state of its items across reloads. Defaults to `false`. */
201
+ readonly useStateSaving: _angular_core.InputSignalWithTransform<boolean, unknown>;
202
+ /**
203
+ * A stable, consumer-provided key used to persist state when `useStateSaving` is enabled.
204
+ * Strongly recommended: without it the accordion falls back to an auto-generated,
205
+ * instantiation-order-dependent id that is unreliable under lazy/conditional/reordered rendering.
206
+ */
207
+ readonly stateSavingKey: _angular_core.InputSignal<string>;
208
+ /** The visual variant of the accordion. Defaults to `fill`. */
209
+ readonly variant: _angular_core.InputSignal<KbqAccordionVariant>;
210
+ /** Whether the whole accordion is disabled. */
211
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
212
+ /** The layout orientation of the accordion. Defaults to `vertical`. */
213
+ readonly orientation: _angular_core.InputSignal<KbqAccordionOrientation>;
214
+ /**
215
+ * The `aria-level` applied to the item headings. Defaults to `2`.
216
+ * Set it to match the surrounding document outline (e.g. `3` when nested under an `<h2>` section).
217
+ */
218
+ readonly level: _angular_core.InputSignalWithTransform<number, unknown>;
219
+ /**
220
+ * The value of the item(s) to expand when initially rendered.
221
+ * Use when you do not need to control the state of the items.
222
+ */
223
+ readonly defaultValue: _angular_core.InputSignal<string | string[]>;
224
+ /** Determines whether one or multiple items can be expanded at the same time. */
225
+ readonly type: _angular_core.InputSignal<KbqAccordionType>;
226
+ /** Whether an expanded item can be collapsed by the user. Defaults to `true`. */
227
+ readonly collapsible: _angular_core.InputSignal<boolean>;
228
+ /**
229
+ * The raw controlled `value` input. Must stay `public`: a `protected` input cannot be bound from
230
+ * a consumer template (TS2445 under full AOT template type-checking).
231
+ * @docs-private
232
+ */
233
+ readonly valueInput: _angular_core.InputSignal<string | string[] | undefined>;
234
+ /**
235
+ * The controlled value of the item(s) to expand, reshaped by mode. Supports `[(value)]`.
236
+ * Falls back to `defaultValue` while `value` is unbound.
237
+ *
238
+ * Always an array in `multiple` mode and always a string in `single` mode — an empty string
239
+ * when nothing is expanded, matching what `valueChange` emits.
240
+ */
241
+ readonly value: _angular_core.Signal<string | string[]>;
242
+ /** Emits the current value whenever the expanded state of the accordion changes. */
243
+ readonly valueChange: _angular_core.OutputEmitterRef<string | string[]>;
244
+ /** The unique id of this accordion. */
245
+ get id(): string;
246
+ /** Whether multiple items can be expanded at the same time. */
247
+ get isMultiple(): boolean;
248
+ /** Whether a persisted state exists for this accordion. */
249
+ get hasSavedState(): boolean;
250
+ /** `defaultValue` normalized to an array for internal coordination. */
251
+ private readonly defaultValueArray;
252
+ private _id;
253
+ private state;
254
+ constructor();
255
+ ngAfterContentInit(): void;
256
+ ngAfterViewInit(): void;
257
+ ngOnDestroy(): void;
258
+ /** @docs-private */
259
+ keydownHandler(event: KeyboardEvent): void;
260
+ /** Opens all enabled accordion items in an accordion where `type` is `multiple`. */
261
+ openAll(): void;
262
+ /** Closes all enabled accordion items. */
263
+ closeAll(): void;
264
+ /** @docs-private */
265
+ setActiveItem(item: KbqAccordionItem): void;
266
+ /**
267
+ * Persists the current state of the given item when `useStateSaving` is enabled.
268
+ * @docs-private
269
+ */
270
+ saveItemState(item: KbqAccordionItem, force?: boolean): void;
271
+ /** The current expanded value(s) derived from the live item state. */
272
+ private getCurrentValue;
273
+ /** The key used to persist/restore state. */
274
+ private get stateStorageKey();
275
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordion, never>;
276
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<KbqAccordion, "kbq-accordion, [kbq-accordion]", never, { "useStateSaving": { "alias": "useStateSaving"; "required": false; "isSignal": true; }; "stateSavingKey": { "alias": "stateSavingKey"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "level": { "alias": "level"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "valueInput": { "alias": "value"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, ["items"], ["*"], true, never>;
277
+ }
278
+
279
+ declare class KbqAccordionContentDirective implements AfterViewInit {
191
280
  private readonly renderer;
192
- private readonly platform;
193
281
  /** @docs-private */
194
282
  protected readonly nativeElement: HTMLElement;
195
283
  /** @docs-private */
@@ -199,40 +287,48 @@ declare class KbqAccordionContentDirective implements AfterContentInit, AfterVie
199
287
  /** @docs-private */
200
288
  get triggerId(): string;
201
289
  /** @docs-private */
202
- protected readonly hidden: i0.WritableSignal<boolean>;
290
+ protected readonly hidden: _angular_core.WritableSignal<boolean>;
203
291
  private savedTransition;
204
292
  private readonly afterRenderRef?;
293
+ /** Whether the first browser render has happened, i.e. whether the content can be measured. */
294
+ private rendered;
205
295
  constructor();
206
296
  ngAfterViewInit(): void;
207
- ngAfterContentInit(): void;
208
297
  toggle(): void;
209
298
  disableAnimation(): void;
210
299
  enableAnimation(): void;
211
- static ɵfac: i0.ɵɵFactoryDeclaration<KbqAccordionContentDirective, never>;
212
- static ɵdir: i0.ɵɵDirectiveDeclaration<KbqAccordionContentDirective, "[kbqAccordionContent]", ["kbqAccordionContent"], {}, {}, never, never, true, never>;
300
+ /**
301
+ * Publishes the natural height of the projected content as `--kbq-accordion-content-height`,
302
+ * which the open state animates towards.
303
+ *
304
+ * `scrollHeight` is used rather than `getBoundingClientRect()`: the host is `overflow: hidden`
305
+ * and collapsed to `height: 0` while closed, so its box reports `0`, whereas `scrollHeight`
306
+ * still reports the height of the content it clips.
307
+ */
308
+ private updateHeight;
309
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionContentDirective, never>;
310
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KbqAccordionContentDirective, "[kbqAccordionContent]", ["kbqAccordionContent"], {}, {}, never, never, true, never>;
213
311
  }
214
312
 
215
313
  declare class KbqAccordionContent {
216
- static ɵfac: i0.ɵɵFactoryDeclaration<KbqAccordionContent, never>;
217
- static ɵcmp: i0.ɵɵComponentDeclaration<KbqAccordionContent, "kbq-accordion-content, [kbq-accordion-content]", never, {}, {}, never, ["*"], true, [{ directive: typeof KbqAccordionContentDirective; inputs: {}; outputs: {}; }]>;
218
- }
219
-
220
- declare class KbqAccordionHeaderDirective {
221
- protected readonly item: KbqAccordionItem;
222
- static ɵfac: i0.ɵɵFactoryDeclaration<KbqAccordionHeaderDirective, never>;
223
- static ɵdir: i0.ɵɵDirectiveDeclaration<KbqAccordionHeaderDirective, "[kbqAccordionHeader]", never, {}, {}, never, never, true, never>;
314
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionContent, never>;
315
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<KbqAccordionContent, "kbq-accordion-content, [kbq-accordion-content]", never, {}, {}, never, ["*"], true, [{ directive: typeof KbqAccordionContentDirective; inputs: {}; outputs: {}; }]>;
224
316
  }
225
317
 
226
318
  declare class KbqAccordionHeader {
227
- static ɵfac: i0.ɵɵFactoryDeclaration<KbqAccordionHeader, never>;
228
- static ɵdir: i0.ɵɵDirectiveDeclaration<KbqAccordionHeader, "kbq-accordion-header, [kbq-accordion-header]", never, {}, {}, never, never, true, [{ directive: typeof KbqAccordionHeaderDirective; inputs: {}; outputs: {}; }]>;
319
+ /** @docs-private */
320
+ protected readonly item: KbqAccordionItem;
321
+ /** @docs-private */
322
+ protected readonly accordion: KbqAccordion;
323
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionHeader, never>;
324
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KbqAccordionHeader, "kbq-accordion-header, [kbq-accordion-header]", never, {}, {}, never, never, true, never>;
229
325
  }
230
326
 
231
327
  declare class KbqAccordionModule {
232
- static ɵfac: i0.ɵɵFactoryDeclaration<KbqAccordionModule, never>;
233
- static ɵmod: i0.ɵɵNgModuleDeclaration<KbqAccordionModule, never, [typeof i1.KbqIcon, typeof KbqAccordion, typeof KbqAccordionContent, typeof KbqAccordionHeader, typeof KbqAccordionItem, typeof KbqAccordionTrigger], [typeof KbqAccordion, typeof KbqAccordionContent, typeof KbqAccordionHeader, typeof KbqAccordionItem, typeof KbqAccordionTrigger]>;
234
- static ɵinj: i0.ɵɵInjectorDeclaration<KbqAccordionModule>;
328
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionModule, never>;
329
+ static ɵmod: _angular_core.ɵɵNgModuleDeclaration<KbqAccordionModule, never, [typeof i1.KbqIcon, typeof KbqAccordion, typeof KbqAccordionContent, typeof KbqAccordionHeader, typeof KbqAccordionItem, typeof KbqAccordionTrigger], [typeof KbqAccordion, typeof KbqAccordionContent, typeof KbqAccordionHeader, typeof KbqAccordionItem, typeof KbqAccordionTrigger]>;
330
+ static ɵinj: _angular_core.ɵɵInjectorDeclaration<KbqAccordionModule>;
235
331
  }
236
332
 
237
- export { KbqAccordion, KbqAccordionContent, KbqAccordionContentDirective, KbqAccordionHeader, KbqAccordionHeaderDirective, KbqAccordionItem, KbqAccordionModule, KbqAccordionTrigger, KbqAccordionTriggerDirective, KbqAccordionVariant };
238
- export type { KbqAccordionItemState, KbqAccordionOrientation, KbqAccordionType };
333
+ export { KBQ_ACCORDION_STATE_STORE, KbqAccordion, KbqAccordionContent, KbqAccordionContentDirective, KbqAccordionHeader, KbqAccordionItem, KbqAccordionLocalStorageStateStore, KbqAccordionModule, KbqAccordionTrigger, KbqAccordionTriggerDirective };
334
+ export type { KbqAccordionItemSnapshot, KbqAccordionItemState, KbqAccordionOrientation, KbqAccordionState, KbqAccordionStateStore, KbqAccordionType, KbqAccordionVariant };
@@ -29,6 +29,20 @@
29
29
  &.kbq-alert_info {
30
30
  @include kbq-alert-style(default, info);
31
31
  }
32
+
33
+ // The status icon is the only thing distinguishing default-style alerts, so it must clear the
34
+ // WCAG 1.4.11 3:1 non-text minimum. The `--kbq-icon-*` palette is tuned for the page background
35
+ // and does not clear it against the neutral container in the light scheme (warning 2.59:1,
36
+ // success 2.79:1); the darker `--kbq-foreground-*` values do (4.00:1 / 4.65:1). In the dark
37
+ // scheme both palettes resolve to the same value, so this override is inert there.
38
+ // The token has to be redeclared on the icon element itself: icon-tokens.scss declares
39
+ // `--kbq-icon-warning-color` on `.kbq-icon`, so a value inherited from `.kbq-alert` never wins.
40
+ // `:not()` excludes icon-item and icon-button, which inherit `.kbq-icon` from KbqIcon but paint
41
+ // their own filled backgrounds.
42
+ .kbq-alert__icon > .kbq-icon:not(.kbq-icon-item, .kbq-icon-button) {
43
+ --kbq-icon-warning-color: var(--kbq-foreground-warning);
44
+ --kbq-icon-success-color: var(--kbq-foreground-success);
45
+ }
32
46
  }
33
47
 
34
48
  .kbq-alert.kbq-alert_colored {
@@ -12,6 +12,11 @@
12
12
  }
13
13
  }
14
14
 
15
+ .kbq-alert__icon {
16
+ display: inline-flex;
17
+ align-items: flex-start;
18
+ }
19
+
15
20
  .kbq-alert__content {
16
21
  display: flex;
17
22
  flex-direction: column;
@@ -30,14 +35,13 @@
30
35
  margin: var(--kbq-alert-size-normal-no-title-icon-margin-top) var(--kbq-alert-size-normal-icon-margin-right)
31
36
  var(--kbq-alert-size-normal-icon-margin-bottom) var(--kbq-alert-size-normal-icon-margin-left);
32
37
 
38
+ padding-top: var(--kbq-alert-size-normal-no-title-icon-padding-top);
39
+
33
40
  &.kbq-alert__icon_title {
34
41
  margin-top: var(--kbq-alert-size-normal-icon-margin-top);
35
42
 
36
- padding-top: var(--kbq-alert-size-normal-no-title-icon-padding-top);
43
+ padding-top: var(--kbq-alert-size-normal-icon-padding-top);
37
44
  }
38
-
39
- display: inline-flex;
40
- align-items: flex-start;
41
45
  }
42
46
 
43
47
  & .kbq-alert__content {
@@ -50,12 +54,17 @@
50
54
  }
51
55
 
52
56
  & .kbq-alert__button-stack {
57
+ display: flex;
58
+ flex-wrap: wrap;
59
+ align-items: center;
60
+ gap: var(--kbq-size-m);
61
+
53
62
  padding-top: var(--kbq-alert-size-normal-button-stack-padding-top);
54
63
  padding-bottom: var(--kbq-alert-size-normal-button-stack-padding-bottom);
55
64
  }
56
65
 
57
66
  & .kbq-alert__button-stack_has-button {
58
- padding-top: 12px;
67
+ padding-top: var(--kbq-size-m);
59
68
  }
60
69
 
61
70
  & .kbq-alert__close-button {
@@ -63,8 +72,8 @@
63
72
  margin-left: var(--kbq-alert-size-normal-close-button-margin-left);
64
73
 
65
74
  .kbq-icon-button {
66
- --kbq-icon-button-size-normal-horizontal-padding: 4px;
67
- --kbq-icon-button-size-normal-vertical-padding: 4px;
75
+ --kbq-icon-button-size-normal-horizontal-padding: var(--kbq-size-xxs);
76
+ --kbq-icon-button-size-normal-vertical-padding: var(--kbq-size-xxs);
68
77
  }
69
78
  }
70
79
  }
@@ -86,9 +95,6 @@
86
95
 
87
96
  padding-top: var(--kbq-alert-size-compact-icon-padding-top);
88
97
  }
89
-
90
- display: inline-flex;
91
- align-items: flex-start;
92
98
  }
93
99
 
94
100
  & .kbq-alert__content {
@@ -101,12 +107,17 @@
101
107
  }
102
108
 
103
109
  & .kbq-alert__button-stack {
110
+ display: flex;
111
+ flex-wrap: wrap;
112
+ align-items: center;
113
+ gap: var(--kbq-size-m);
114
+
104
115
  padding-top: var(--kbq-alert-size-compact-button-stack-padding-top);
105
116
  padding-bottom: var(--kbq-alert-size-compact-button-stack-padding-bottom);
106
117
  }
107
118
 
108
119
  & .kbq-alert__button-stack_has-button {
109
- padding-top: 12px;
120
+ padding-top: var(--kbq-size-m);
110
121
  }
111
122
 
112
123
  & .kbq-alert__close-button {
@@ -114,8 +125,8 @@
114
125
  margin-left: var(--kbq-alert-size-compact-close-button-margin-left);
115
126
 
116
127
  .kbq-icon-button {
117
- --kbq-icon-button-size-normal-horizontal-padding: 4px;
118
- --kbq-icon-button-size-normal-vertical-padding: 4px;
128
+ --kbq-icon-button-size-normal-horizontal-padding: var(--kbq-size-xxs);
129
+ --kbq-icon-button-size-normal-vertical-padding: var(--kbq-size-xxs);
119
130
  }
120
131
  }
121
132
  }