ng-primitives 0.120.4 → 0.121.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 (147) hide show
  1. package/example-theme/index.css +9 -0
  2. package/fesm2022/ng-primitives-a11y.mjs +5 -5
  3. package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
  4. package/fesm2022/ng-primitives-accordion.mjs +34 -51
  5. package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
  6. package/fesm2022/ng-primitives-ai.mjs +39 -52
  7. package/fesm2022/ng-primitives-ai.mjs.map +1 -1
  8. package/fesm2022/ng-primitives-autofill.mjs +4 -4
  9. package/fesm2022/ng-primitives-autofill.mjs.map +1 -1
  10. package/fesm2022/ng-primitives-avatar.mjs +14 -17
  11. package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
  12. package/fesm2022/ng-primitives-breadcrumbs.mjs +21 -21
  13. package/fesm2022/ng-primitives-breadcrumbs.mjs.map +1 -1
  14. package/fesm2022/ng-primitives-button.mjs +7 -9
  15. package/fesm2022/ng-primitives-button.mjs.map +1 -1
  16. package/fesm2022/ng-primitives-checkbox.mjs +15 -30
  17. package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
  18. package/fesm2022/ng-primitives-combobox.mjs +60 -92
  19. package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
  20. package/fesm2022/ng-primitives-common.mjs +4 -4
  21. package/fesm2022/ng-primitives-common.mjs.map +1 -1
  22. package/fesm2022/ng-primitives-context-menu.mjs +68 -121
  23. package/fesm2022/ng-primitives-context-menu.mjs.map +1 -1
  24. package/fesm2022/ng-primitives-date-picker.mjs +91 -115
  25. package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
  26. package/fesm2022/ng-primitives-dialog.mjs +35 -51
  27. package/fesm2022/ng-primitives-dialog.mjs.map +1 -1
  28. package/fesm2022/ng-primitives-file-upload.mjs +26 -53
  29. package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
  30. package/fesm2022/ng-primitives-focus-trap.mjs +5 -8
  31. package/fesm2022/ng-primitives-focus-trap.mjs.map +1 -1
  32. package/fesm2022/ng-primitives-form-field.mjs +39 -44
  33. package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
  34. package/fesm2022/ng-primitives-input-otp.mjs +30 -43
  35. package/fesm2022/ng-primitives-input-otp.mjs.map +1 -1
  36. package/fesm2022/ng-primitives-input.mjs +6 -8
  37. package/fesm2022/ng-primitives-input.mjs.map +1 -1
  38. package/fesm2022/ng-primitives-interactions.mjs +31 -48
  39. package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
  40. package/fesm2022/ng-primitives-internal.mjs +39 -35
  41. package/fesm2022/ng-primitives-internal.mjs.map +1 -1
  42. package/fesm2022/ng-primitives-listbox.mjs +34 -48
  43. package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
  44. package/fesm2022/ng-primitives-menu.mjs +85 -151
  45. package/fesm2022/ng-primitives-menu.mjs.map +1 -1
  46. package/fesm2022/ng-primitives-meter.mjs +25 -36
  47. package/fesm2022/ng-primitives-meter.mjs.map +1 -1
  48. package/fesm2022/ng-primitives-navigation-menu.mjs +60 -108
  49. package/fesm2022/ng-primitives-navigation-menu.mjs.map +1 -1
  50. package/fesm2022/ng-primitives-number-field.mjs +35 -59
  51. package/fesm2022/ng-primitives-number-field.mjs.map +1 -1
  52. package/fesm2022/ng-primitives-pagination.mjs +270 -297
  53. package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
  54. package/fesm2022/ng-primitives-popover.mjs +209 -223
  55. package/fesm2022/ng-primitives-popover.mjs.map +1 -1
  56. package/fesm2022/ng-primitives-portal.mjs +88 -59
  57. package/fesm2022/ng-primitives-portal.mjs.map +1 -1
  58. package/fesm2022/ng-primitives-progress.mjs +30 -41
  59. package/fesm2022/ng-primitives-progress.mjs.map +1 -1
  60. package/fesm2022/ng-primitives-radio.mjs +20 -30
  61. package/fesm2022/ng-primitives-radio.mjs.map +1 -1
  62. package/fesm2022/ng-primitives-resize.mjs +3 -3
  63. package/fesm2022/ng-primitives-resize.mjs.map +1 -1
  64. package/fesm2022/ng-primitives-roving-focus.mjs +20 -34
  65. package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
  66. package/fesm2022/ng-primitives-search.mjs +9 -9
  67. package/fesm2022/ng-primitives-search.mjs.map +1 -1
  68. package/fesm2022/ng-primitives-select.mjs +720 -620
  69. package/fesm2022/ng-primitives-select.mjs.map +1 -1
  70. package/fesm2022/ng-primitives-separator.mjs +4 -6
  71. package/fesm2022/ng-primitives-separator.mjs.map +1 -1
  72. package/fesm2022/ng-primitives-slider.mjs +63 -100
  73. package/fesm2022/ng-primitives-slider.mjs.map +1 -1
  74. package/fesm2022/ng-primitives-state.mjs +3 -3
  75. package/fesm2022/ng-primitives-state.mjs.map +1 -1
  76. package/fesm2022/ng-primitives-switch.mjs +15 -21
  77. package/fesm2022/ng-primitives-switch.mjs.map +1 -1
  78. package/fesm2022/ng-primitives-tabs.mjs +31 -41
  79. package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
  80. package/fesm2022/ng-primitives-textarea.mjs +5 -7
  81. package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
  82. package/fesm2022/ng-primitives-toast.mjs +30 -23
  83. package/fesm2022/ng-primitives-toast.mjs.map +1 -1
  84. package/fesm2022/ng-primitives-toggle-group.mjs +20 -36
  85. package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
  86. package/fesm2022/ng-primitives-toggle.mjs +10 -19
  87. package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
  88. package/fesm2022/ng-primitives-toolbar.mjs +4 -6
  89. package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
  90. package/fesm2022/ng-primitives-tooltip.mjs +401 -402
  91. package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
  92. package/fesm2022/ng-primitives-utils.mjs +5 -4
  93. package/fesm2022/ng-primitives-utils.mjs.map +1 -1
  94. package/package.json +56 -55
  95. package/schematics/ng-generate/templates/select/select.__fileSuffix@dasherize__.ts.template +48 -48
  96. package/{a11y/index.d.ts → types/ng-primitives-a11y.d.ts} +18 -24
  97. package/{accordion/index.d.ts → types/ng-primitives-accordion.d.ts} +85 -98
  98. package/{autofill/index.d.ts → types/ng-primitives-autofill.d.ts} +3 -10
  99. package/{avatar/index.d.ts → types/ng-primitives-avatar.d.ts} +7 -30
  100. package/{breadcrumbs/index.d.ts → types/ng-primitives-breadcrumbs.d.ts} +15 -70
  101. package/{button/index.d.ts → types/ng-primitives-button.d.ts} +23 -29
  102. package/{checkbox/index.d.ts → types/ng-primitives-checkbox.d.ts} +68 -74
  103. package/{combobox/index.d.ts → types/ng-primitives-combobox.d.ts} +35 -35
  104. package/{context-menu/index.d.ts → types/ng-primitives-context-menu.d.ts} +2 -1
  105. package/{date-picker/index.d.ts → types/ng-primitives-date-picker.d.ts} +2 -2
  106. package/{dialog/index.d.ts → types/ng-primitives-dialog.d.ts} +7 -2
  107. package/{file-upload/index.d.ts → types/ng-primitives-file-upload.d.ts} +5 -20
  108. package/{focus-trap/index.d.ts → types/ng-primitives-focus-trap.d.ts} +3 -10
  109. package/{form-field/index.d.ts → types/ng-primitives-form-field.d.ts} +9 -40
  110. package/{input/index.d.ts → types/ng-primitives-input.d.ts} +3 -10
  111. package/{menu/index.d.ts → types/ng-primitives-menu.d.ts} +17 -63
  112. package/{navigation-menu/index.d.ts → types/ng-primitives-navigation-menu.d.ts} +15 -70
  113. package/{number-field/index.d.ts → types/ng-primitives-number-field.d.ts} +80 -110
  114. package/types/ng-primitives-pagination.d.ts +502 -0
  115. package/{popover/index.d.ts → types/ng-primitives-popover.d.ts} +244 -57
  116. package/{portal/index.d.ts → types/ng-primitives-portal.d.ts} +22 -13
  117. package/{progress/index.d.ts → types/ng-primitives-progress.d.ts} +3 -10
  118. package/{roving-focus/index.d.ts → types/ng-primitives-roving-focus.d.ts} +65 -79
  119. package/types/ng-primitives-select.d.ts +687 -0
  120. package/{separator/index.d.ts → types/ng-primitives-separator.d.ts} +3 -10
  121. package/{slider/index.d.ts → types/ng-primitives-slider.d.ts} +76 -138
  122. package/{state/index.d.ts → types/ng-primitives-state.d.ts} +26 -21
  123. package/{switch/index.d.ts → types/ng-primitives-switch.d.ts} +50 -64
  124. package/{tabs/index.d.ts → types/ng-primitives-tabs.d.ts} +9 -40
  125. package/{textarea/index.d.ts → types/ng-primitives-textarea.d.ts} +3 -10
  126. package/{toast/index.d.ts → types/ng-primitives-toast.d.ts} +13 -1
  127. package/{toggle-group/index.d.ts → types/ng-primitives-toggle-group.d.ts} +75 -89
  128. package/{toggle/index.d.ts → types/ng-primitives-toggle.d.ts} +50 -56
  129. package/{toolbar/index.d.ts → types/ng-primitives-toolbar.d.ts} +3 -10
  130. package/types/ng-primitives-tooltip.d.ts +691 -0
  131. package/pagination/index.d.ts +0 -211
  132. package/select/index.d.ts +0 -396
  133. package/tooltip/index.d.ts +0 -384
  134. /package/{ai/index.d.ts → types/ng-primitives-ai.d.ts} +0 -0
  135. /package/{common/index.d.ts → types/ng-primitives-common.d.ts} +0 -0
  136. /package/{date-time-luxon/index.d.ts → types/ng-primitives-date-time-luxon.d.ts} +0 -0
  137. /package/{date-time/index.d.ts → types/ng-primitives-date-time.d.ts} +0 -0
  138. /package/{input-otp/index.d.ts → types/ng-primitives-input-otp.d.ts} +0 -0
  139. /package/{interactions/index.d.ts → types/ng-primitives-interactions.d.ts} +0 -0
  140. /package/{internal/index.d.ts → types/ng-primitives-internal.d.ts} +0 -0
  141. /package/{listbox/index.d.ts → types/ng-primitives-listbox.d.ts} +0 -0
  142. /package/{meter/index.d.ts → types/ng-primitives-meter.d.ts} +0 -0
  143. /package/{radio/index.d.ts → types/ng-primitives-radio.d.ts} +0 -0
  144. /package/{resize/index.d.ts → types/ng-primitives-resize.d.ts} +0 -0
  145. /package/{search/index.d.ts → types/ng-primitives-search.d.ts} +0 -0
  146. /package/{utils/index.d.ts → types/ng-primitives-utils.d.ts} +0 -0
  147. /package/{index.d.ts → types/ng-primitives.d.ts} +0 -0
@@ -1,6 +1,7 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { Signal, Provider, TemplateRef, Type } from '@angular/core';
3
3
  import * as ng_primitives_internal from 'ng-primitives/internal';
4
+ import * as ng_primitives_toast from 'ng-primitives/toast';
4
5
  import { NgpPortal } from 'ng-primitives/portal';
5
6
 
6
7
  interface NgpToastOptions$1 {
@@ -37,12 +38,17 @@ interface NgpToastOptions$1 {
37
38
  * @internal
38
39
  */
39
40
  sequential: boolean;
41
+ /**
42
+ * When true, the toast will not auto-dismiss and must be dismissed explicitly.
43
+ * @internal
44
+ */
45
+ persistent: boolean;
40
46
  }
41
47
 
42
48
  declare class NgpToast {
43
49
  private readonly manager;
44
50
  private readonly injector;
45
- protected readonly config: NgpToastConfig;
51
+ protected readonly config: ng_primitives_toast.NgpToastConfig;
46
52
  /** @internal */
47
53
  readonly options: NgpToastOptions$1;
48
54
  private readonly interactivityChecker;
@@ -170,6 +176,10 @@ interface NgpToastConfig {
170
176
  * When a toast is dismissed, the timer will start on the next toast.
171
177
  */
172
178
  sequential: boolean;
179
+ /**
180
+ * When true, toasts will not auto-dismiss and must be dismissed explicitly.
181
+ */
182
+ persistent: boolean;
173
183
  }
174
184
  /**
175
185
  * Provide the default Toast configuration
@@ -218,6 +228,8 @@ interface NgpToastOptions<T = unknown> {
218
228
  context?: T;
219
229
  /** When enabled, only the front toast's timer will run */
220
230
  sequential?: boolean;
231
+ /** When true, the toast will not auto-dismiss and must be dismissed explicitly */
232
+ persistent?: boolean;
221
233
  }
222
234
  interface NgpToastRecord {
223
235
  instance: NgpToast;
@@ -2,8 +2,10 @@ import * as _angular_core from '@angular/core';
2
2
  import { Provider, OnInit, Signal, WritableSignal } from '@angular/core';
3
3
  import { NgpOrientation } from 'ng-primitives/common';
4
4
  import { BooleanInput } from '@angular/cdk/coercion';
5
- import { NgpRovingFocusGroupState } from 'ng-primitives/roving-focus';
5
+ import * as ng_primitives_state from 'ng-primitives/state';
6
6
  import { SetterOptions } from 'ng-primitives/state';
7
+ import * as ng_primitives_toggle_group from 'ng-primitives/toggle-group';
8
+ import { NgpRovingFocusGroupState } from 'ng-primitives/roving-focus';
7
9
  import { Observable } from 'rxjs';
8
10
 
9
11
  interface NgpToggleGroupConfig {
@@ -74,21 +76,81 @@ interface NgpToggleGroupItemProps {
74
76
  declare const ngpToggleGroupItem: ({ value, disabled }: NgpToggleGroupItemProps) => NgpToggleGroupItemState;
75
77
  declare const injectToggleGroupItemState: {
76
78
  (): Signal<NgpToggleGroupItemState>;
77
- (options: {
78
- hoisted: true;
79
- optional?: boolean;
80
- skipSelf?: boolean;
81
- }): Signal<NgpToggleGroupItemState | null>;
82
- (options?: {
83
- hoisted?: boolean;
84
- optional?: boolean;
85
- skipSelf?: boolean;
86
- }): Signal<NgpToggleGroupItemState> | Signal<NgpToggleGroupItemState | null>;
79
+ (options: ng_primitives_state.StateInjectionOptions): Signal<NgpToggleGroupItemState | null>;
80
+ (options?: ng_primitives_state.StateInjectionOptions): Signal<NgpToggleGroupItemState> | Signal<NgpToggleGroupItemState | null>;
87
81
  };
88
82
  declare const provideToggleGroupItemState: (opts?: {
89
83
  inherit?: boolean;
90
84
  }) => _angular_core.FactoryProvider;
91
85
 
86
+ declare class NgpToggleGroup {
87
+ /**
88
+ * Access the global toggle group configuration.
89
+ */
90
+ private readonly config;
91
+ /**
92
+ * The orientation of the toggle group.
93
+ */
94
+ readonly orientation: _angular_core.InputSignal<NgpOrientation>;
95
+ /**
96
+ * Whether focus should wrap around when reaching the end of the toggle group.
97
+ * @default true
98
+ */
99
+ readonly wrap: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
100
+ /**
101
+ * Whether toggle buttons can be deselected. If set to `false`, clicking a selected toggle button will not deselect it.
102
+ * @default true
103
+ */
104
+ readonly allowDeselection: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
105
+ /**
106
+ * The type of the toggle group, whether only one item can be selected or multiple.
107
+ */
108
+ readonly type: _angular_core.InputSignal<"single" | "multiple">;
109
+ /**
110
+ * The selected value(s) of the toggle group.
111
+ */
112
+ readonly value: _angular_core.InputSignal<string[] | undefined>;
113
+ /**
114
+ * The default selected value(s) for uncontrolled usage.
115
+ * @default []
116
+ */
117
+ readonly defaultValue: _angular_core.InputSignal<string[]>;
118
+ /**
119
+ * Emits when the value of the toggle group changes.
120
+ */
121
+ readonly valueChange: _angular_core.OutputEmitterRef<string[]>;
122
+ /**
123
+ * Whether the toggle group is disabled.
124
+ */
125
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
126
+ /**
127
+ * The state of the toggle group.
128
+ */
129
+ protected readonly state: ng_primitives_toggle_group.NgpToggleGroupState;
130
+ /**
131
+ * Toggle a value in the toggle group.
132
+ */
133
+ toggle(value: string): void;
134
+ /**
135
+ * Set the value(s) of the toggle group.
136
+ */
137
+ setValue(newValue: string[], options?: SetterOptions): void;
138
+ /**
139
+ * Set the default value(s) of the toggle group.
140
+ */
141
+ setDefaultValue(defaultValue: string[]): void;
142
+ /**
143
+ * Set the disabled state of the toggle group.
144
+ */
145
+ setDisabled(isDisabled: boolean): void;
146
+ /**
147
+ * Set the orientation of the toggle group.
148
+ */
149
+ setOrientation(newOrientation: NgpOrientation): void;
150
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpToggleGroup, never>;
151
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpToggleGroup, "[ngpToggleGroup]", ["ngpToggleGroup"], { "orientation": { "alias": "ngpToggleGroupOrientation"; "required": false; "isSignal": true; }; "wrap": { "alias": "ngpToggleGroupWrap"; "required": false; "isSignal": true; }; "allowDeselection": { "alias": "ngpToggleGroupAllowDeselection"; "required": false; "isSignal": true; }; "type": { "alias": "ngpToggleGroupType"; "required": false; "isSignal": true; }; "value": { "alias": "ngpToggleGroupValue"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "ngpToggleGroupDefaultValue"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpToggleGroupDisabled"; "required": false; "isSignal": true; }; }, { "valueChange": "ngpToggleGroupValueChange"; }, never, never, true, never>;
152
+ }
153
+
92
154
  /**
93
155
  * The state interface for the ToggleGroup pattern.
94
156
  */
@@ -182,88 +244,12 @@ interface NgpToggleGroupProps {
182
244
  declare const ngpToggleGroup: ({ rovingFocusGroup, orientation: _orientation, allowDeselection: _allowDeselection, type: _type, value: _value, defaultValue: _defaultValue, disabled: _disabled, onValueChange, }: NgpToggleGroupProps) => NgpToggleGroupState;
183
245
  declare const injectToggleGroupState: {
184
246
  (): Signal<NgpToggleGroupState>;
185
- (options: {
186
- hoisted: true;
187
- optional?: boolean;
188
- skipSelf?: boolean;
189
- }): Signal<NgpToggleGroupState | null>;
190
- (options?: {
191
- hoisted?: boolean;
192
- optional?: boolean;
193
- skipSelf?: boolean;
194
- }): Signal<NgpToggleGroupState> | Signal<NgpToggleGroupState | null>;
247
+ (options: ng_primitives_state.StateInjectionOptions): Signal<NgpToggleGroupState | null>;
248
+ (options?: ng_primitives_state.StateInjectionOptions): Signal<NgpToggleGroupState> | Signal<NgpToggleGroupState | null>;
195
249
  };
196
250
  declare const provideToggleGroupState: (opts?: {
197
251
  inherit?: boolean;
198
252
  }) => _angular_core.FactoryProvider;
199
253
 
200
- declare class NgpToggleGroup {
201
- /**
202
- * Access the global toggle group configuration.
203
- */
204
- private readonly config;
205
- /**
206
- * The orientation of the toggle group.
207
- */
208
- readonly orientation: _angular_core.InputSignal<NgpOrientation>;
209
- /**
210
- * Whether focus should wrap around when reaching the end of the toggle group.
211
- * @default true
212
- */
213
- readonly wrap: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
214
- /**
215
- * Whether toggle buttons can be deselected. If set to `false`, clicking a selected toggle button will not deselect it.
216
- * @default true
217
- */
218
- readonly allowDeselection: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
219
- /**
220
- * The type of the toggle group, whether only one item can be selected or multiple.
221
- */
222
- readonly type: _angular_core.InputSignal<"single" | "multiple">;
223
- /**
224
- * The selected value(s) of the toggle group.
225
- */
226
- readonly value: _angular_core.InputSignal<string[] | undefined>;
227
- /**
228
- * The default selected value(s) for uncontrolled usage.
229
- * @default []
230
- */
231
- readonly defaultValue: _angular_core.InputSignal<string[]>;
232
- /**
233
- * Emits when the value of the toggle group changes.
234
- */
235
- readonly valueChange: _angular_core.OutputEmitterRef<string[]>;
236
- /**
237
- * Whether the toggle group is disabled.
238
- */
239
- readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
240
- /**
241
- * The state of the toggle group.
242
- */
243
- protected readonly state: NgpToggleGroupState;
244
- /**
245
- * Toggle a value in the toggle group.
246
- */
247
- toggle(value: string): void;
248
- /**
249
- * Set the value(s) of the toggle group.
250
- */
251
- setValue(newValue: string[], options?: SetterOptions): void;
252
- /**
253
- * Set the default value(s) of the toggle group.
254
- */
255
- setDefaultValue(defaultValue: string[]): void;
256
- /**
257
- * Set the disabled state of the toggle group.
258
- */
259
- setDisabled(isDisabled: boolean): void;
260
- /**
261
- * Set the orientation of the toggle group.
262
- */
263
- setOrientation(newOrientation: NgpOrientation): void;
264
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpToggleGroup, never>;
265
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpToggleGroup, "[ngpToggleGroup]", ["ngpToggleGroup"], { "orientation": { "alias": "ngpToggleGroupOrientation"; "required": false; "isSignal": true; }; "wrap": { "alias": "ngpToggleGroupWrap"; "required": false; "isSignal": true; }; "allowDeselection": { "alias": "ngpToggleGroupAllowDeselection"; "required": false; "isSignal": true; }; "type": { "alias": "ngpToggleGroupType"; "required": false; "isSignal": true; }; "value": { "alias": "ngpToggleGroupValue"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "ngpToggleGroupDefaultValue"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpToggleGroupDisabled"; "required": false; "isSignal": true; }; }, { "valueChange": "ngpToggleGroupValueChange"; }, never, never, true, never>;
266
- }
267
-
268
254
  export { NgpToggleGroup, NgpToggleGroupItem, injectToggleGroupItemState, injectToggleGroupState, ngpToggleGroup, ngpToggleGroupItem, provideToggleGroupConfig, provideToggleGroupItemState, provideToggleGroupState };
269
255
  export type { NgpToggleGroupConfig, NgpToggleGroupItemProps, NgpToggleGroupItemState, NgpToggleGroupProps, NgpToggleGroupState };
@@ -1,8 +1,54 @@
1
+ import * as ng_primitives_toggle from 'ng-primitives/toggle';
1
2
  import * as _angular_core from '@angular/core';
2
- import { WritableSignal, Signal } from '@angular/core';
3
+ import { Signal, WritableSignal } from '@angular/core';
4
+ import { BooleanInput } from '@angular/cdk/coercion';
5
+ import * as ng_primitives_state from 'ng-primitives/state';
3
6
  import { SetterOptions } from 'ng-primitives/state';
4
7
  import { Observable } from 'rxjs';
5
- import { BooleanInput } from '@angular/cdk/coercion';
8
+
9
+ /**
10
+ * Apply the `ngpToggle` directive to an element to manage the toggle state. This must be applied to a `button` element.
11
+ */
12
+ declare class NgpToggle {
13
+ /**
14
+ * Whether the toggle is selected.
15
+ */
16
+ readonly selected: _angular_core.InputSignalWithTransform<boolean | undefined, BooleanInput>;
17
+ /**
18
+ * The default selected state for uncontrolled usage.
19
+ * @default false
20
+ */
21
+ readonly defaultSelected: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
22
+ /**
23
+ * Emits when the selected state changes.
24
+ */
25
+ readonly selectedChange: _angular_core.OutputEmitterRef<boolean>;
26
+ /**
27
+ * Whether the toggle is disabled.
28
+ * @default false
29
+ */
30
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
31
+ /**
32
+ * The state for the toggle primitive.
33
+ * @internal
34
+ */
35
+ protected readonly state: ng_primitives_toggle.NgpToggleState;
36
+ /**
37
+ * Toggle the selected state.
38
+ */
39
+ toggle(): void;
40
+ /**
41
+ * Set the selected state.
42
+ */
43
+ setSelected(value: boolean, options?: SetterOptions): void;
44
+ /**
45
+ * Set the default selected state.
46
+ */
47
+ setDefaultSelected(value: boolean): void;
48
+ setDisabled(value: boolean): void;
49
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpToggle, never>;
50
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpToggle, "[ngpToggle]", ["ngpToggle"], { "selected": { "alias": "ngpToggleSelected"; "required": false; "isSignal": true; }; "defaultSelected": { "alias": "ngpToggleDefaultSelected"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpToggleDisabled"; "required": false; "isSignal": true; }; }, { "selectedChange": "ngpToggleSelectedChange"; }, never, never, true, never>;
51
+ }
6
52
 
7
53
  /**
8
54
  * Public state surface for the Toggle primitive.
@@ -61,64 +107,12 @@ interface NgpToggleProps {
61
107
  declare const ngpToggle: ({ selected: _selected, defaultSelected: _defaultSelected, disabled: _disabled, onSelectedChange, }: NgpToggleProps) => NgpToggleState;
62
108
  declare const injectToggleState: {
63
109
  (): Signal<NgpToggleState>;
64
- (options: {
65
- hoisted: true;
66
- optional?: boolean;
67
- skipSelf?: boolean;
68
- }): Signal<NgpToggleState | null>;
69
- (options?: {
70
- hoisted?: boolean;
71
- optional?: boolean;
72
- skipSelf?: boolean;
73
- }): Signal<NgpToggleState> | Signal<NgpToggleState | null>;
110
+ (options: ng_primitives_state.StateInjectionOptions): Signal<NgpToggleState | null>;
111
+ (options?: ng_primitives_state.StateInjectionOptions): Signal<NgpToggleState> | Signal<NgpToggleState | null>;
74
112
  };
75
113
  declare const provideToggleState: (opts?: {
76
114
  inherit?: boolean;
77
115
  }) => _angular_core.FactoryProvider;
78
116
 
79
- /**
80
- * Apply the `ngpToggle` directive to an element to manage the toggle state. This must be applied to a `button` element.
81
- */
82
- declare class NgpToggle {
83
- /**
84
- * Whether the toggle is selected.
85
- */
86
- readonly selected: _angular_core.InputSignalWithTransform<boolean | undefined, BooleanInput>;
87
- /**
88
- * The default selected state for uncontrolled usage.
89
- * @default false
90
- */
91
- readonly defaultSelected: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
92
- /**
93
- * Emits when the selected state changes.
94
- */
95
- readonly selectedChange: _angular_core.OutputEmitterRef<boolean>;
96
- /**
97
- * Whether the toggle is disabled.
98
- * @default false
99
- */
100
- readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
101
- /**
102
- * The state for the toggle primitive.
103
- * @internal
104
- */
105
- protected readonly state: NgpToggleState;
106
- /**
107
- * Toggle the selected state.
108
- */
109
- toggle(): void;
110
- /**
111
- * Set the selected state.
112
- */
113
- setSelected(value: boolean, options?: SetterOptions): void;
114
- /**
115
- * Set the default selected state.
116
- */
117
- setDefaultSelected(value: boolean): void;
118
- setDisabled(value: boolean): void;
119
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpToggle, never>;
120
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpToggle, "[ngpToggle]", ["ngpToggle"], { "selected": { "alias": "ngpToggleSelected"; "required": false; "isSignal": true; }; "defaultSelected": { "alias": "ngpToggleDefaultSelected"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpToggleDisabled"; "required": false; "isSignal": true; }; }, { "selectedChange": "ngpToggleSelectedChange"; }, never, never, true, never>;
121
- }
122
-
123
117
  export { NgpToggle, injectToggleState, ngpToggle, provideToggleState };
124
118
  export type { NgpToggleProps, NgpToggleState };
@@ -1,6 +1,7 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { Signal, WritableSignal } from '@angular/core';
3
3
  import { NgpOrientation } from 'ng-primitives/common';
4
+ import * as ng_primitives_state from 'ng-primitives/state';
4
5
  import { NgpRovingFocusGroupState } from 'ng-primitives/roving-focus';
5
6
 
6
7
  declare class NgpToolbar {
@@ -49,19 +50,11 @@ declare const injectToolbarState: {
49
50
  orientation: WritableSignal<NgpOrientation>;
50
51
  setOrientation: (value: NgpOrientation) => void;
51
52
  }>;
52
- (options: {
53
- hoisted: true;
54
- optional?: boolean;
55
- skipSelf?: boolean;
56
- }): Signal<{
53
+ (options: ng_primitives_state.StateInjectionOptions): Signal<{
57
54
  orientation: WritableSignal<NgpOrientation>;
58
55
  setOrientation: (value: NgpOrientation) => void;
59
56
  } | null>;
60
- (options?: {
61
- hoisted?: boolean;
62
- optional?: boolean;
63
- skipSelf?: boolean;
64
- }): Signal<{
57
+ (options?: ng_primitives_state.StateInjectionOptions): Signal<{
65
58
  orientation: WritableSignal<NgpOrientation>;
66
59
  setOrientation: (value: NgpOrientation) => void;
67
60
  }> | Signal<{