ng-primitives 0.90.0 → 0.91.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 (93) hide show
  1. package/a11y/index.d.ts +38 -46
  2. package/accordion/index.d.ts +252 -104
  3. package/ai/index.d.ts +1 -1
  4. package/autofill/index.d.ts +49 -9
  5. package/avatar/index.d.ts +96 -61
  6. package/breadcrumbs/index.d.ts +156 -16
  7. package/button/index.d.ts +23 -28
  8. package/checkbox/index.d.ts +93 -14
  9. package/combobox/index.d.ts +1 -1
  10. package/date-picker/index.d.ts +12 -11
  11. package/fesm2022/ng-primitives-a11y.mjs +36 -52
  12. package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
  13. package/fesm2022/ng-primitives-accordion.mjs +210 -189
  14. package/fesm2022/ng-primitives-accordion.mjs.map +1 -1
  15. package/fesm2022/ng-primitives-ai.mjs +4 -4
  16. package/fesm2022/ng-primitives-ai.mjs.map +1 -1
  17. package/fesm2022/ng-primitives-autofill.mjs +53 -36
  18. package/fesm2022/ng-primitives-autofill.mjs.map +1 -1
  19. package/fesm2022/ng-primitives-avatar.mjs +97 -138
  20. package/fesm2022/ng-primitives-avatar.mjs.map +1 -1
  21. package/fesm2022/ng-primitives-breadcrumbs.mjs +92 -35
  22. package/fesm2022/ng-primitives-breadcrumbs.mjs.map +1 -1
  23. package/fesm2022/ng-primitives-button.mjs +14 -36
  24. package/fesm2022/ng-primitives-button.mjs.map +1 -1
  25. package/fesm2022/ng-primitives-checkbox.mjs +87 -65
  26. package/fesm2022/ng-primitives-checkbox.mjs.map +1 -1
  27. package/fesm2022/ng-primitives-combobox.mjs +9 -9
  28. package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
  29. package/fesm2022/ng-primitives-date-picker.mjs +5 -4
  30. package/fesm2022/ng-primitives-date-picker.mjs.map +1 -1
  31. package/fesm2022/ng-primitives-form-field.mjs +48 -16
  32. package/fesm2022/ng-primitives-form-field.mjs.map +1 -1
  33. package/fesm2022/ng-primitives-input.mjs +32 -48
  34. package/fesm2022/ng-primitives-input.mjs.map +1 -1
  35. package/fesm2022/ng-primitives-interactions.mjs +4 -4
  36. package/fesm2022/ng-primitives-interactions.mjs.map +1 -1
  37. package/fesm2022/ng-primitives-listbox.mjs.map +1 -1
  38. package/fesm2022/ng-primitives-menu.mjs +13 -6
  39. package/fesm2022/ng-primitives-menu.mjs.map +1 -1
  40. package/fesm2022/ng-primitives-pagination.mjs +6 -6
  41. package/fesm2022/ng-primitives-pagination.mjs.map +1 -1
  42. package/fesm2022/ng-primitives-progress.mjs +2 -2
  43. package/fesm2022/ng-primitives-progress.mjs.map +1 -1
  44. package/fesm2022/ng-primitives-radio.mjs +3 -3
  45. package/fesm2022/ng-primitives-radio.mjs.map +1 -1
  46. package/fesm2022/ng-primitives-roving-focus.mjs +259 -236
  47. package/fesm2022/ng-primitives-roving-focus.mjs.map +1 -1
  48. package/fesm2022/ng-primitives-search.mjs.map +1 -1
  49. package/fesm2022/ng-primitives-select.mjs +8 -8
  50. package/fesm2022/ng-primitives-select.mjs.map +1 -1
  51. package/fesm2022/ng-primitives-slider.mjs +195 -172
  52. package/fesm2022/ng-primitives-slider.mjs.map +1 -1
  53. package/fesm2022/ng-primitives-state.mjs +172 -2
  54. package/fesm2022/ng-primitives-state.mjs.map +1 -1
  55. package/fesm2022/ng-primitives-switch.mjs +90 -88
  56. package/fesm2022/ng-primitives-switch.mjs.map +1 -1
  57. package/fesm2022/ng-primitives-tabs.mjs +4 -1
  58. package/fesm2022/ng-primitives-tabs.mjs.map +1 -1
  59. package/fesm2022/ng-primitives-textarea.mjs +27 -35
  60. package/fesm2022/ng-primitives-textarea.mjs.map +1 -1
  61. package/fesm2022/ng-primitives-toggle-group.mjs +134 -136
  62. package/fesm2022/ng-primitives-toggle-group.mjs.map +1 -1
  63. package/fesm2022/ng-primitives-toggle.mjs +69 -58
  64. package/fesm2022/ng-primitives-toggle.mjs.map +1 -1
  65. package/fesm2022/ng-primitives-toolbar.mjs +26 -35
  66. package/fesm2022/ng-primitives-toolbar.mjs.map +1 -1
  67. package/fesm2022/ng-primitives-utils.mjs +48 -35
  68. package/fesm2022/ng-primitives-utils.mjs.map +1 -1
  69. package/form-field/index.d.ts +7 -3
  70. package/input/index.d.ts +61 -24
  71. package/interactions/index.d.ts +5 -5
  72. package/listbox/index.d.ts +1 -1
  73. package/menu/index.d.ts +3 -2
  74. package/package.json +1 -1
  75. package/pagination/index.d.ts +7 -7
  76. package/roving-focus/index.d.ts +77 -101
  77. package/schematics/ng-add/schema.d.ts +0 -1
  78. package/schematics/ng-generate/templates/checkbox/checkbox.__fileSuffix@dasherize__.ts.template +2 -2
  79. package/schematics/ng-generate/templates/slider/slider.__fileSuffix@dasherize__.ts.template +6 -3
  80. package/schematics/ng-generate/templates/switch/switch.__fileSuffix@dasherize__.ts.template +2 -2
  81. package/schematics/ng-generate/templates/toggle/toggle.__fileSuffix@dasherize__.ts.template +2 -2
  82. package/schematics/ng-generate/templates/toggle-group/toggle-group.__fileSuffix@dasherize__.ts.template +2 -2
  83. package/schematics/ng-generate/templates/toolbar/toolbar.__fileSuffix@dasherize__.ts.template +1 -1
  84. package/search/index.d.ts +1 -1
  85. package/select/index.d.ts +2 -2
  86. package/slider/index.d.ts +195 -56
  87. package/state/index.d.ts +57 -3
  88. package/switch/index.d.ts +103 -28
  89. package/textarea/index.d.ts +63 -8
  90. package/toggle/index.d.ts +65 -24
  91. package/toggle-group/index.d.ts +79 -54
  92. package/toolbar/index.d.ts +27 -17
  93. package/utils/index.d.ts +1 -0
package/avatar/index.d.ts CHANGED
@@ -1,82 +1,132 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnInit, Provider } from '@angular/core';
2
+ import { Signal, Provider } from '@angular/core';
3
3
  import { NumberInput } from '@angular/cdk/coercion';
4
- import * as ng_primitives_state from 'ng-primitives/state';
5
- import * as i1 from 'ng-primitives/a11y';
6
- import { NgpVisuallyHidden } from 'ng-primitives/a11y';
7
4
 
8
5
  /**
9
6
  * Apply the `ngpAvatarFallback` directive to an element that represents the user in the absence of an image. This is typically the user's initials.
10
7
  */
11
- declare class NgpAvatarFallback implements OnInit {
12
- /**
13
- * Access the avatar
14
- */
15
- private readonly avatar;
8
+ declare class NgpAvatarFallback {
16
9
  /**
17
10
  * Access the global configuration.
18
11
  */
19
12
  private readonly config;
20
- /**
21
- * Access the disposable utilities.
22
- */
23
- private readonly disposables;
24
13
  /**
25
14
  * Define a delay before the fallback is shown. This is useful to only show the fallback for those with slower connections.
26
15
  * @default 0
27
16
  */
28
17
  readonly delay: _angular_core.InputSignalWithTransform<number, NumberInput>;
29
- /**
30
- * Determine if this element should be hidden.
31
- * @returns True if the element should be visible
32
- */
33
- protected readonly visible: _angular_core.Signal<boolean>;
34
- /**
35
- * Determine the delay has elapsed, and we can show the fallback.
36
- */
37
- private delayElapsed;
38
- ngOnInit(): void;
18
+ constructor();
39
19
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpAvatarFallback, never>;
40
20
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpAvatarFallback, "[ngpAvatarFallback]", ["ngpAvatarFallback"], { "delay": { "alias": "ngpAvatarFallbackDelay"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
41
21
  }
42
22
 
23
+ interface NgpAvatarFallbackState {
24
+ }
25
+ interface NgpAvatarFallbackProps {
26
+ /**
27
+ * The delay before showing the fallback.
28
+ */
29
+ delay?: Signal<number>;
30
+ }
31
+ declare const NgpAvatarFallbackStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{}>>;
32
+ declare const ngpAvatarFallback: ({}: NgpAvatarFallbackProps) => {};
33
+ declare const injectAvatarFallbackState: {
34
+ (): Signal<{}>;
35
+ (options: {
36
+ hoisted: true;
37
+ }): Signal<{} | null>;
38
+ (options?: {
39
+ hoisted?: boolean;
40
+ }): Signal<{} | null>;
41
+ };
42
+ declare const provideAvatarFallbackState: (opts?: {
43
+ inherit?: boolean;
44
+ }) => _angular_core.FactoryProvider;
45
+
43
46
  /**
44
47
  * Apply the `ngpAvatarImage` directive to an element that represents the avatar image. This would typically be an `img` element or a `div` with a background image.
45
48
  */
46
- declare class NgpAvatarImage implements OnInit {
47
- /**
48
- * Control the visibility of the image.
49
- */
50
- protected readonly visuallyHidden: _angular_core.Signal<ng_primitives_state.State<NgpVisuallyHidden>>;
49
+ declare class NgpAvatarImage {
50
+ constructor();
51
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpAvatarImage, never>;
52
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpAvatarImage, "img[ngpAvatarImage]", ["ngpAvatarImage"], {}, {}, never, never, true, never>;
53
+ }
54
+
55
+ interface NgpAvatarImageState {
56
+ }
57
+ interface NgpAvatarImageProps {
58
+ }
59
+ declare const NgpAvatarImageStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{}>>;
60
+ declare const ngpAvatarImage: ({}: NgpAvatarImageProps) => {};
61
+ declare const injectAvatarImageState: {
62
+ (): _angular_core.Signal<{}>;
63
+ (options: {
64
+ hoisted: true;
65
+ }): _angular_core.Signal<{} | null>;
66
+ (options?: {
67
+ hoisted?: boolean;
68
+ }): _angular_core.Signal<{} | null>;
69
+ };
70
+ declare const provideAvatarImageState: (opts?: {
71
+ inherit?: boolean;
72
+ }) => _angular_core.FactoryProvider;
73
+
74
+ interface NgpAvatarState {
51
75
  /**
52
- * Access the avatar
76
+ * The avatar status.
53
77
  */
54
- private readonly avatar;
78
+ status: Signal<NgpAvatarStatus>;
55
79
  /**
56
- * Access the image element ref.
80
+ * Set the avatar status.
57
81
  */
58
- private readonly elementRef;
59
- ngOnInit(): void;
60
- protected onLoad(): void;
61
- protected onError(): void;
62
- private setState;
63
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpAvatarImage, never>;
64
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpAvatarImage, "img[ngpAvatarImage]", ["ngpAvatarImage"], {}, {}, never, never, true, [{ directive: typeof i1.NgpVisuallyHidden; inputs: {}; outputs: {}; }]>;
82
+ setStatus(status: NgpAvatarStatus): void;
83
+ }
84
+ interface NgpAvatarProps {
85
+ }
86
+ declare const NgpAvatarStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{
87
+ status: _angular_core.WritableSignal<NgpAvatarStatus>;
88
+ setStatus: (newStatus: NgpAvatarStatus) => void;
89
+ }>>;
90
+ declare const ngpAvatar: ({}: NgpAvatarProps) => {
91
+ status: _angular_core.WritableSignal<NgpAvatarStatus>;
92
+ setStatus: (newStatus: NgpAvatarStatus) => void;
93
+ };
94
+ declare const injectAvatarState: {
95
+ (): Signal<{
96
+ status: _angular_core.WritableSignal<NgpAvatarStatus>;
97
+ setStatus: (newStatus: NgpAvatarStatus) => void;
98
+ }>;
99
+ (options: {
100
+ hoisted: true;
101
+ }): Signal<{
102
+ status: _angular_core.WritableSignal<NgpAvatarStatus>;
103
+ setStatus: (newStatus: NgpAvatarStatus) => void;
104
+ } | null>;
105
+ (options?: {
106
+ hoisted?: boolean;
107
+ }): Signal<{
108
+ status: _angular_core.WritableSignal<NgpAvatarStatus>;
109
+ setStatus: (newStatus: NgpAvatarStatus) => void;
110
+ } | null>;
111
+ };
112
+ declare const provideAvatarState: (opts?: {
113
+ inherit?: boolean;
114
+ }) => _angular_core.FactoryProvider;
115
+ declare enum NgpAvatarStatus {
116
+ Idle = "idle",
117
+ Loading = "loading",
118
+ Loaded = "loaded",
119
+ Error = "error"
65
120
  }
66
121
 
67
122
  /**
68
123
  * Apply the `ngpAvatar` directive to an element that represents the avatar. This directive is a container for the image and/or fallback.
69
124
  */
70
125
  declare class NgpAvatar {
71
- /**
72
- * Store the current status of the avatar.
73
- * @internal
74
- */
75
- readonly status: _angular_core.WritableSignal<NgpAvatarStatus>;
76
126
  /**
77
127
  * The avatar state.
78
128
  */
79
- protected readonly state: ng_primitives_state.CreatedState<NgpAvatar>;
129
+ private readonly state;
80
130
  /**
81
131
  * Set the avatar status.
82
132
  * @param status The status to set.
@@ -86,21 +136,6 @@ declare class NgpAvatar {
86
136
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpAvatar, never>;
87
137
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpAvatar, "[ngpAvatar]", ["ngpAvatar"], {}, {}, never, never, true, never>;
88
138
  }
89
- declare enum NgpAvatarStatus {
90
- Idle = "idle",
91
- Loading = "loading",
92
- Loaded = "loaded",
93
- Error = "error"
94
- }
95
-
96
- /**
97
- * Provides the Avatar state.
98
- */
99
- declare const provideAvatarState: (options?: ng_primitives_state.CreateStateProviderOptions) => _angular_core.FactoryProvider;
100
- /**
101
- * Injects the Avatar state.
102
- */
103
- declare const injectAvatarState: <U = NgpAvatar>(injectOptions?: _angular_core.InjectOptions) => _angular_core.Signal<ng_primitives_state.State<U>>;
104
139
 
105
140
  interface NgpAvatarConfig {
106
141
  /**
@@ -116,5 +151,5 @@ interface NgpAvatarConfig {
116
151
  */
117
152
  declare function provideAvatarConfig(config: Partial<NgpAvatarConfig>): Provider[];
118
153
 
119
- export { NgpAvatar, NgpAvatarFallback, NgpAvatarImage, NgpAvatarStatus, injectAvatarState, provideAvatarConfig, provideAvatarState };
120
- export type { NgpAvatarConfig };
154
+ export { NgpAvatar, NgpAvatarFallback, NgpAvatarFallbackStateToken, NgpAvatarImage, NgpAvatarImageStateToken, NgpAvatarStateToken, NgpAvatarStatus, injectAvatarFallbackState, injectAvatarImageState, injectAvatarState, ngpAvatar, ngpAvatarFallback, ngpAvatarImage, provideAvatarConfig, provideAvatarFallbackState, provideAvatarImageState, provideAvatarState };
155
+ export type { NgpAvatarConfig, NgpAvatarFallbackProps, NgpAvatarFallbackState, NgpAvatarImageProps, NgpAvatarImageState, NgpAvatarProps, NgpAvatarState };
@@ -1,19 +1,21 @@
1
- import * as i0 from '@angular/core';
1
+ import * as _angular_core from '@angular/core';
2
2
 
3
3
  /**
4
4
  * Apply `ngpBreadcrumbEllipsis` to elements that represent collapsed breadcrumb items.
5
5
  */
6
6
  declare class NgpBreadcrumbEllipsis {
7
- static ɵfac: i0.ɵɵFactoryDeclaration<NgpBreadcrumbEllipsis, never>;
8
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgpBreadcrumbEllipsis, "[ngpBreadcrumbEllipsis]", ["ngpBreadcrumbEllipsis"], {}, {}, never, never, true, never>;
7
+ constructor();
8
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpBreadcrumbEllipsis, never>;
9
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpBreadcrumbEllipsis, "[ngpBreadcrumbEllipsis]", ["ngpBreadcrumbEllipsis"], {}, {}, never, never, true, never>;
9
10
  }
10
11
 
11
12
  /**
12
13
  * Apply `ngpBreadcrumbItem` to each list item in the breadcrumb trail.
13
14
  */
14
15
  declare class NgpBreadcrumbItem {
15
- static ɵfac: i0.ɵɵFactoryDeclaration<NgpBreadcrumbItem, never>;
16
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgpBreadcrumbItem, "[ngpBreadcrumbItem]", ["ngpBreadcrumbItem"], {}, {}, never, never, true, never>;
16
+ constructor();
17
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpBreadcrumbItem, never>;
18
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpBreadcrumbItem, "[ngpBreadcrumbItem]", ["ngpBreadcrumbItem"], {}, {}, never, never, true, never>;
17
19
  }
18
20
 
19
21
  /**
@@ -21,40 +23,178 @@ declare class NgpBreadcrumbItem {
21
23
  */
22
24
  declare class NgpBreadcrumbLink {
23
25
  constructor();
24
- static ɵfac: i0.ɵɵFactoryDeclaration<NgpBreadcrumbLink, never>;
25
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgpBreadcrumbLink, "[ngpBreadcrumbLink]", ["ngpBreadcrumbLink"], {}, {}, never, never, true, never>;
26
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpBreadcrumbLink, never>;
27
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpBreadcrumbLink, "[ngpBreadcrumbLink]", ["ngpBreadcrumbLink"], {}, {}, never, never, true, never>;
26
28
  }
27
29
 
28
30
  /**
29
31
  * Apply `ngpBreadcrumbList` to the ordered list that groups breadcrumb items.
30
32
  */
31
33
  declare class NgpBreadcrumbList {
32
- static ɵfac: i0.ɵɵFactoryDeclaration<NgpBreadcrumbList, never>;
33
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgpBreadcrumbList, "[ngpBreadcrumbList]", ["ngpBreadcrumbList"], {}, {}, never, never, true, never>;
34
+ constructor();
35
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpBreadcrumbList, never>;
36
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpBreadcrumbList, "[ngpBreadcrumbList]", ["ngpBreadcrumbList"], {}, {}, never, never, true, never>;
34
37
  }
35
38
 
36
39
  /**
37
40
  * Apply `ngpBreadcrumbPage` to non-link content that represents the active page.
38
41
  */
39
42
  declare class NgpBreadcrumbPage {
40
- static ɵfac: i0.ɵɵFactoryDeclaration<NgpBreadcrumbPage, never>;
41
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgpBreadcrumbPage, "[ngpBreadcrumbPage]", ["ngpBreadcrumbPage"], {}, {}, never, never, true, never>;
43
+ constructor();
44
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpBreadcrumbPage, never>;
45
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpBreadcrumbPage, "[ngpBreadcrumbPage]", ["ngpBreadcrumbPage"], {}, {}, never, never, true, never>;
42
46
  }
43
47
 
44
48
  /**
45
49
  * Apply `ngpBreadcrumbSeparator` between breadcrumb items to render a visual divider.
46
50
  */
47
51
  declare class NgpBreadcrumbSeparator {
48
- static ɵfac: i0.ɵɵFactoryDeclaration<NgpBreadcrumbSeparator, never>;
49
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgpBreadcrumbSeparator, "[ngpBreadcrumbSeparator]", ["ngpBreadcrumbSeparator"], {}, {}, never, never, true, never>;
52
+ constructor();
53
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpBreadcrumbSeparator, never>;
54
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpBreadcrumbSeparator, "[ngpBreadcrumbSeparator]", ["ngpBreadcrumbSeparator"], {}, {}, never, never, true, never>;
50
55
  }
51
56
 
52
57
  /**
53
58
  * Apply `ngpBreadcrumbs` to the navigation element that wraps the breadcrumb trail.
54
59
  */
55
60
  declare class NgpBreadcrumbs {
56
- static ɵfac: i0.ɵɵFactoryDeclaration<NgpBreadcrumbs, never>;
57
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgpBreadcrumbs, "[ngpBreadcrumbs]", ["ngpBreadcrumbs"], {}, {}, never, never, true, never>;
61
+ constructor();
62
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpBreadcrumbs, never>;
63
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpBreadcrumbs, "[ngpBreadcrumbs]", ["ngpBreadcrumbs"], {}, {}, never, never, true, never>;
64
+ }
65
+
66
+ interface NgpBreadcrumbsState {
67
+ }
68
+ interface NgpBreadcrumbsProps {
69
+ }
70
+ declare const NgpBreadcrumbsStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{}>>;
71
+ declare const ngpBreadcrumbs: ({}: NgpBreadcrumbsProps) => {};
72
+ declare const injectBreadcrumbsState: {
73
+ (): _angular_core.Signal<{}>;
74
+ (options: {
75
+ hoisted: true;
76
+ }): _angular_core.Signal<{} | null>;
77
+ (options?: {
78
+ hoisted?: boolean;
79
+ }): _angular_core.Signal<{} | null>;
80
+ };
81
+ declare const provideBreadcrumbsState: (opts?: {
82
+ inherit?: boolean;
83
+ }) => _angular_core.FactoryProvider;
84
+
85
+ interface NgpBreadcrumbListState {
86
+ }
87
+ interface NgpBreadcrumbListProps {
88
+ }
89
+ declare const NgpBreadcrumbListStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{}>>;
90
+ declare const ngpBreadcrumbList: ({}: NgpBreadcrumbListProps) => {};
91
+ declare const injectBreadcrumbListState: {
92
+ (): _angular_core.Signal<{}>;
93
+ (options: {
94
+ hoisted: true;
95
+ }): _angular_core.Signal<{} | null>;
96
+ (options?: {
97
+ hoisted?: boolean;
98
+ }): _angular_core.Signal<{} | null>;
99
+ };
100
+ declare const provideBreadcrumbListState: (opts?: {
101
+ inherit?: boolean;
102
+ }) => _angular_core.FactoryProvider;
103
+
104
+ interface NgpBreadcrumbItemState {
105
+ }
106
+ interface NgpBreadcrumbItemProps {
107
+ }
108
+ declare const NgpBreadcrumbItemStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{}>>;
109
+ declare const ngpBreadcrumbItem: ({}: NgpBreadcrumbItemProps) => {};
110
+ declare const injectBreadcrumbItemState: {
111
+ (): _angular_core.Signal<{}>;
112
+ (options: {
113
+ hoisted: true;
114
+ }): _angular_core.Signal<{} | null>;
115
+ (options?: {
116
+ hoisted?: boolean;
117
+ }): _angular_core.Signal<{} | null>;
118
+ };
119
+ declare const provideBreadcrumbItemState: (opts?: {
120
+ inherit?: boolean;
121
+ }) => _angular_core.FactoryProvider;
122
+
123
+ interface NgpBreadcrumbLinkState {
124
+ }
125
+ interface NgpBreadcrumbLinkProps {
126
+ }
127
+ declare const NgpBreadcrumbLinkStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{}>>;
128
+ declare const ngpBreadcrumbLink: ({}: NgpBreadcrumbLinkProps) => {};
129
+ declare const injectBreadcrumbLinkState: {
130
+ (): _angular_core.Signal<{}>;
131
+ (options: {
132
+ hoisted: true;
133
+ }): _angular_core.Signal<{} | null>;
134
+ (options?: {
135
+ hoisted?: boolean;
136
+ }): _angular_core.Signal<{} | null>;
137
+ };
138
+ declare const provideBreadcrumbLinkState: (opts?: {
139
+ inherit?: boolean;
140
+ }) => _angular_core.FactoryProvider;
141
+
142
+ interface NgpBreadcrumbPageState {
143
+ }
144
+ interface NgpBreadcrumbPageProps {
145
+ }
146
+ declare const NgpBreadcrumbPageStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{}>>;
147
+ declare const ngpBreadcrumbPage: ({}: NgpBreadcrumbPageProps) => {};
148
+ declare const injectBreadcrumbPageState: {
149
+ (): _angular_core.Signal<{}>;
150
+ (options: {
151
+ hoisted: true;
152
+ }): _angular_core.Signal<{} | null>;
153
+ (options?: {
154
+ hoisted?: boolean;
155
+ }): _angular_core.Signal<{} | null>;
156
+ };
157
+ declare const provideBreadcrumbPageState: (opts?: {
158
+ inherit?: boolean;
159
+ }) => _angular_core.FactoryProvider;
160
+
161
+ interface NgpBreadcrumbSeparatorState {
162
+ }
163
+ interface NgpBreadcrumbSeparatorProps {
164
+ }
165
+ declare const NgpBreadcrumbSeparatorStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{}>>;
166
+ declare const ngpBreadcrumbSeparator: ({}: NgpBreadcrumbSeparatorProps) => {};
167
+ declare const injectBreadcrumbSeparatorState: {
168
+ (): _angular_core.Signal<{}>;
169
+ (options: {
170
+ hoisted: true;
171
+ }): _angular_core.Signal<{} | null>;
172
+ (options?: {
173
+ hoisted?: boolean;
174
+ }): _angular_core.Signal<{} | null>;
175
+ };
176
+ declare const provideBreadcrumbSeparatorState: (opts?: {
177
+ inherit?: boolean;
178
+ }) => _angular_core.FactoryProvider;
179
+
180
+ interface NgpBreadcrumbEllipsisState {
181
+ }
182
+ interface NgpBreadcrumbEllipsisProps {
58
183
  }
184
+ declare const NgpBreadcrumbEllipsisStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{}>>;
185
+ declare const ngpBreadcrumbEllipsis: ({}: NgpBreadcrumbEllipsisProps) => {};
186
+ declare const injectBreadcrumbEllipsisState: {
187
+ (): _angular_core.Signal<{}>;
188
+ (options: {
189
+ hoisted: true;
190
+ }): _angular_core.Signal<{} | null>;
191
+ (options?: {
192
+ hoisted?: boolean;
193
+ }): _angular_core.Signal<{} | null>;
194
+ };
195
+ declare const provideBreadcrumbEllipsisState: (opts?: {
196
+ inherit?: boolean;
197
+ }) => _angular_core.FactoryProvider;
59
198
 
60
- export { NgpBreadcrumbEllipsis, NgpBreadcrumbItem, NgpBreadcrumbLink, NgpBreadcrumbList, NgpBreadcrumbPage, NgpBreadcrumbSeparator, NgpBreadcrumbs };
199
+ export { NgpBreadcrumbEllipsis, NgpBreadcrumbEllipsisStateToken, NgpBreadcrumbItem, NgpBreadcrumbItemStateToken, NgpBreadcrumbLink, NgpBreadcrumbLinkStateToken, NgpBreadcrumbList, NgpBreadcrumbListStateToken, NgpBreadcrumbPage, NgpBreadcrumbPageStateToken, NgpBreadcrumbSeparator, NgpBreadcrumbSeparatorStateToken, NgpBreadcrumbs, NgpBreadcrumbsStateToken, injectBreadcrumbEllipsisState, injectBreadcrumbItemState, injectBreadcrumbLinkState, injectBreadcrumbListState, injectBreadcrumbPageState, injectBreadcrumbSeparatorState, injectBreadcrumbsState, ngpBreadcrumbEllipsis, ngpBreadcrumbItem, ngpBreadcrumbLink, ngpBreadcrumbList, ngpBreadcrumbPage, ngpBreadcrumbSeparator, ngpBreadcrumbs, provideBreadcrumbEllipsisState, provideBreadcrumbItemState, provideBreadcrumbLinkState, provideBreadcrumbListState, provideBreadcrumbPageState, provideBreadcrumbSeparatorState, provideBreadcrumbsState };
200
+ export type { NgpBreadcrumbEllipsisProps, NgpBreadcrumbEllipsisState, NgpBreadcrumbItemProps, NgpBreadcrumbItemState, NgpBreadcrumbLinkProps, NgpBreadcrumbLinkState, NgpBreadcrumbListProps, NgpBreadcrumbListState, NgpBreadcrumbPageProps, NgpBreadcrumbPageState, NgpBreadcrumbSeparatorProps, NgpBreadcrumbSeparatorState, NgpBreadcrumbsProps, NgpBreadcrumbsState };
package/button/index.d.ts CHANGED
@@ -1,8 +1,27 @@
1
- import * as ng_primitives_state from 'ng-primitives/state';
2
1
  import * as _angular_core from '@angular/core';
3
2
  import { Signal } from '@angular/core';
4
3
  import { BooleanInput } from '@angular/cdk/coercion';
5
4
 
5
+ interface NgpButtonState {
6
+ disabled: Signal<boolean>;
7
+ }
8
+ interface NgpButtonProps {
9
+ disabled: Signal<boolean>;
10
+ }
11
+ declare const ngpButton: ({ disabled }: NgpButtonProps) => NgpButtonState;
12
+ declare const injectButtonState: {
13
+ (): Signal<NgpButtonState>;
14
+ (options: {
15
+ hoisted: true;
16
+ }): Signal<NgpButtonState | null>;
17
+ (options?: {
18
+ hoisted?: boolean;
19
+ }): Signal<NgpButtonState | null>;
20
+ };
21
+ declare const provideButtonState: (opts?: {
22
+ inherit?: boolean;
23
+ }) => _angular_core.FactoryProvider;
24
+
6
25
  declare class NgpButton {
7
26
  /**
8
27
  * Whether the button is disabled.
@@ -11,34 +30,10 @@ declare class NgpButton {
11
30
  /**
12
31
  * The button state.
13
32
  */
14
- protected readonly state: ng_primitives_state.CreatedState<NgpButton>;
15
- constructor();
33
+ protected readonly state: NgpButtonState;
16
34
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpButton, never>;
17
35
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpButton, "[ngpButton]", ["ngpButton"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
18
36
  }
19
37
 
20
- /**
21
- * Provides the Button state.
22
- */
23
- declare const provideButtonState: (options?: ng_primitives_state.CreateStateProviderOptions) => _angular_core.FactoryProvider;
24
- /**
25
- * Injects the Button state.
26
- */
27
- declare const injectButtonState: <U = NgpButton>(injectOptions?: _angular_core.InjectOptions) => _angular_core.Signal<ng_primitives_state.State<U>>;
28
-
29
- /** @internal */
30
- interface NgpButtonOptions {
31
- /**
32
- * Whether the button is disabled.
33
- * @default false
34
- */
35
- disabled?: Signal<boolean>;
36
- }
37
- /**
38
- * @internal
39
- * Setup the button interactions and attributes.
40
- * @param options - The options for the button.
41
- */
42
- declare function setupButton({ disabled }: NgpButtonOptions): void;
43
-
44
- export { NgpButton, injectButtonState, provideButtonState, setupButton };
38
+ export { NgpButton, injectButtonState, ngpButton, provideButtonState };
39
+ export type { NgpButtonProps, NgpButtonState };
@@ -1,7 +1,96 @@
1
- import * as ng_primitives_state from 'ng-primitives/state';
2
1
  import * as _angular_core from '@angular/core';
2
+ import { Signal, WritableSignal } from '@angular/core';
3
+ import { Observable } from 'rxjs';
3
4
  import { BooleanInput } from '@angular/cdk/coercion';
4
5
 
6
+ /**
7
+ * Public state surface for the Checkbox primitive.
8
+ */
9
+ interface NgpCheckboxState {
10
+ /**
11
+ * The id of the checkbox.
12
+ */
13
+ readonly id: Signal<string>;
14
+ /**
15
+ * Whether the checkbox is checked.
16
+ */
17
+ readonly checked: WritableSignal<boolean>;
18
+ /**
19
+ * Whether the checkbox is indeterminate.
20
+ */
21
+ readonly indeterminate: WritableSignal<boolean>;
22
+ /**
23
+ * Whether the checkbox is disabled.
24
+ */
25
+ readonly disabled: WritableSignal<boolean>;
26
+ /**
27
+ * Emits when the checked state changes.
28
+ */
29
+ readonly checkedChange: Observable<boolean>;
30
+ /**
31
+ * Emits when the indeterminate state changes.
32
+ */
33
+ readonly indeterminateChange: Observable<boolean>;
34
+ /**
35
+ * Toggle the checkbox value.
36
+ */
37
+ toggle(event?: Event): void;
38
+ /**
39
+ * Update the checked value.
40
+ */
41
+ setChecked(value: boolean): void;
42
+ /**
43
+ * Update the indeterminate value.
44
+ */
45
+ setIndeterminate(value: boolean): void;
46
+ /**
47
+ * Set the disabled value.
48
+ */
49
+ setDisabled(value: boolean): void;
50
+ }
51
+ /**
52
+ * Inputs for configuring the Checkbox primitive.
53
+ */
54
+ interface NgpCheckboxProps {
55
+ /**
56
+ * The id of the checkbox.
57
+ */
58
+ readonly id?: Signal<string>;
59
+ /**
60
+ * Whether the checkbox is checked.
61
+ */
62
+ readonly checked?: Signal<boolean>;
63
+ /**
64
+ * Whether the checkbox is indeterminate.
65
+ */
66
+ readonly indeterminate?: Signal<boolean>;
67
+ /**
68
+ * Whether the checkbox is disabled.
69
+ */
70
+ readonly disabled?: Signal<boolean>;
71
+ /**
72
+ * Callback fired when the checked state changes.
73
+ */
74
+ readonly onCheckedChange?: (checked: boolean) => void;
75
+ /**
76
+ * Callback fired when the indeterminate state changes.
77
+ */
78
+ readonly onIndeterminateChange?: (indeterminate: boolean) => void;
79
+ }
80
+ declare const ngpCheckbox: ({ id, checked: _checked, indeterminate: _indeterminate, disabled: _disabled, onCheckedChange, onIndeterminateChange, }: NgpCheckboxProps) => NgpCheckboxState;
81
+ declare const injectCheckboxState: {
82
+ (): Signal<NgpCheckboxState>;
83
+ (options: {
84
+ hoisted: true;
85
+ }): Signal<NgpCheckboxState | null>;
86
+ (options?: {
87
+ hoisted?: boolean;
88
+ }): Signal<NgpCheckboxState | null>;
89
+ };
90
+ declare const provideCheckboxState: (opts?: {
91
+ inherit?: boolean;
92
+ }) => _angular_core.FactoryProvider;
93
+
5
94
  /**
6
95
  * Apply the `ngpCheckbox` directive to an element to that represents the checkbox, such as a `button`.
7
96
  */
@@ -38,21 +127,11 @@ declare class NgpCheckbox {
38
127
  /**
39
128
  * The state of the checkbox.
40
129
  */
41
- protected readonly state: ng_primitives_state.CreatedState<NgpCheckbox>;
42
- constructor();
43
- protected onEnter(event: KeyboardEvent): void;
130
+ protected readonly state: NgpCheckboxState;
44
131
  toggle(event?: Event): void;
45
132
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpCheckbox, never>;
46
133
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpCheckbox, "[ngpCheckbox]", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "checked": { "alias": "ngpCheckboxChecked"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "ngpCheckboxIndeterminate"; "required": false; "isSignal": true; }; "required": { "alias": "ngpCheckboxRequired"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpCheckboxDisabled"; "required": false; "isSignal": true; }; }, { "checkedChange": "ngpCheckboxCheckedChange"; "indeterminateChange": "ngpCheckboxIndeterminateChange"; }, never, never, true, never>;
47
134
  }
48
135
 
49
- /**
50
- * Provides the Checkbox state.
51
- */
52
- declare const provideCheckboxState: (options?: ng_primitives_state.CreateStateProviderOptions) => _angular_core.FactoryProvider;
53
- /**
54
- * Injects the Checkbox state.
55
- */
56
- declare const injectCheckboxState: <U = NgpCheckbox>(injectOptions?: _angular_core.InjectOptions) => _angular_core.Signal<ng_primitives_state.State<U>>;
57
-
58
- export { NgpCheckbox, injectCheckboxState, provideCheckboxState };
136
+ export { NgpCheckbox, injectCheckboxState, ngpCheckbox, provideCheckboxState };
137
+ export type { NgpCheckboxProps, NgpCheckboxState };
@@ -24,7 +24,7 @@ declare class NgpComboboxButton {
24
24
  constructor();
25
25
  protected toggleDropdown(): Promise<void>;
26
26
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgpComboboxButton, never>;
27
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpComboboxButton, "[ngpComboboxButton]", ["ngpComboboxButton"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
27
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgpComboboxButton, "button[ngpComboboxButton]", ["ngpComboboxButton"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
28
28
  }
29
29
 
30
30
  declare class NgpComboboxDropdown {