@radix-ng/primitives 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/composite/README.md +1 -1
  2. package/fesm2022/radix-ng-primitives-accordion.mjs +10 -10
  3. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  4. package/fesm2022/radix-ng-primitives-checkbox.mjs +134 -58
  5. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  6. package/fesm2022/radix-ng-primitives-composite.mjs +127 -43
  7. package/fesm2022/radix-ng-primitives-composite.mjs.map +1 -1
  8. package/fesm2022/radix-ng-primitives-menu.mjs +288 -63
  9. package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
  10. package/fesm2022/radix-ng-primitives-menubar.mjs +24 -1
  11. package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
  12. package/fesm2022/radix-ng-primitives-select.mjs +56 -29
  13. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  14. package/fesm2022/radix-ng-primitives-slider.mjs +57 -13
  15. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  16. package/fesm2022/radix-ng-primitives-tabs.mjs +292 -59
  17. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  18. package/fesm2022/radix-ng-primitives-toolbar.mjs +19 -13
  19. package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
  20. package/package.json +2 -10
  21. package/types/radix-ng-primitives-accordion.d.ts +4 -4
  22. package/types/radix-ng-primitives-checkbox.d.ts +98 -70
  23. package/types/radix-ng-primitives-composite.d.ts +58 -15
  24. package/types/radix-ng-primitives-menu.d.ts +44 -16
  25. package/types/radix-ng-primitives-menubar.d.ts +2 -0
  26. package/types/radix-ng-primitives-select.d.ts +46 -32
  27. package/types/radix-ng-primitives-slider.d.ts +19 -4
  28. package/types/radix-ng-primitives-tabs.d.ts +63 -11
  29. package/types/radix-ng-primitives-toolbar.d.ts +80 -73
  30. package/collection/README.md +0 -1
  31. package/fesm2022/radix-ng-primitives-collection.mjs +0 -72
  32. package/fesm2022/radix-ng-primitives-collection.mjs.map +0 -1
  33. package/fesm2022/radix-ng-primitives-roving-focus.mjs +0 -420
  34. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +0 -1
  35. package/roving-focus/README.md +0 -3
  36. package/types/radix-ng-primitives-collection.d.ts +0 -44
  37. package/types/radix-ng-primitives-roving-focus.d.ts +0 -201
@@ -1,201 +0,0 @@
1
- import * as _radix_ng_primitives_core from '@radix-ng/primitives/core';
2
- import { BooleanInput } from '@radix-ng/primitives/core';
3
- import * as _angular_core from '@angular/core';
4
- import * as _radix_ng_primitives_roving_focus from '@radix-ng/primitives/roving-focus';
5
-
6
- type Orientation = 'horizontal' | 'vertical';
7
- type Direction = 'ltr' | 'rtl';
8
- declare function focusFirst(candidates: HTMLElement[], preventScroll?: boolean, rootNode?: Document | ShadowRoot): void;
9
-
10
- declare const rootContext: () => {
11
- enabled: _angular_core.Signal<boolean>;
12
- loop: _angular_core.Signal<boolean>;
13
- dir: _angular_core.Signal<_radix_ng_primitives_core.Direction>;
14
- orientation: _angular_core.Signal<Orientation>;
15
- currentTabStopId: _angular_core.ModelSignal<string | undefined>;
16
- focusableItems: _angular_core.WritableSignal<HTMLElement[]>;
17
- onItemFocus: (tabStopId: string) => void;
18
- onItemShiftTab: () => void;
19
- registerItem: (item: HTMLElement, tabStopId: string) => void;
20
- unregisterItem: (item: HTMLElement, tabStopId: string) => void;
21
- };
22
- type RovingFocusGroupContext = ReturnType<typeof rootContext>;
23
- declare const injectRovingFocusGroupContext: _radix_ng_primitives_core.InjectContext<{
24
- enabled: _angular_core.Signal<boolean>;
25
- loop: _angular_core.Signal<boolean>;
26
- dir: _angular_core.Signal<_radix_ng_primitives_core.Direction>;
27
- orientation: _angular_core.Signal<Orientation>;
28
- currentTabStopId: _angular_core.ModelSignal<string | undefined>;
29
- focusableItems: _angular_core.WritableSignal<HTMLElement[]>;
30
- onItemFocus: (tabStopId: string) => void;
31
- onItemShiftTab: () => void;
32
- registerItem: (item: HTMLElement, tabStopId: string) => void;
33
- unregisterItem: (item: HTMLElement, tabStopId: string) => void;
34
- }>;
35
- declare const provideRovingFocusGroupContext: (useFactory: () => {
36
- enabled: _angular_core.Signal<boolean>;
37
- loop: _angular_core.Signal<boolean>;
38
- dir: _angular_core.Signal<_radix_ng_primitives_core.Direction>;
39
- orientation: _angular_core.Signal<Orientation>;
40
- currentTabStopId: _angular_core.ModelSignal<string | undefined>;
41
- focusableItems: _angular_core.WritableSignal<HTMLElement[]>;
42
- onItemFocus: (tabStopId: string) => void;
43
- onItemShiftTab: () => void;
44
- registerItem: (item: HTMLElement, tabStopId: string) => void;
45
- unregisterItem: (item: HTMLElement, tabStopId: string) => void;
46
- }) => _angular_core.Provider;
47
- /**
48
- * @group Components
49
- */
50
- declare class RdxRovingFocusGroupDirective {
51
- private readonly isBrowser;
52
- private readonly elementRef;
53
- private readonly destroyRef;
54
- /**
55
- * The orientation of the group. Mainly so arrow navigation is done accordingly (left & right vs. up & down)
56
- */
57
- readonly orientationInput: _angular_core.InputSignal<Orientation>;
58
- /**
59
- * The direction of navigation between items.
60
- */
61
- readonly dirInput: _angular_core.InputSignal<Direction | undefined>;
62
- private readonly effectiveDir;
63
- /**
64
- * Whether keyboard navigation should loop around
65
- */
66
- readonly loopInput: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
67
- /**
68
- * Whether roving focus behavior is active for the group.
69
- * @group Props
70
- */
71
- readonly enabledInput: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
72
- /**
73
- * When `true`, will prevent scrolling to the focus item when focused.
74
- * @group Props
75
- */
76
- readonly preventScrollOnEntryFocus: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
77
- /**
78
- * The value of the current stop item.
79
- *
80
- * Use when you do not need to control the state of the stop item.
81
- * @group Props
82
- */
83
- readonly defaultCurrentTabStopId: _angular_core.InputSignal<string | undefined>;
84
- /**
85
- * The controlled value of the current stop item. Can be binded as `model`.
86
- * @group Props
87
- */
88
- readonly currentTabStopId: _angular_core.ModelSignal<string | undefined>;
89
- /**
90
- * Event handler called when container is being focused. Can be prevented.
91
- * @group Emits
92
- */
93
- readonly entryFocus: _angular_core.OutputEmitterRef<Event>;
94
- private readonly _orientation;
95
- readonly orientation: _angular_core.Signal<Orientation>;
96
- private readonly _dir;
97
- readonly dir: _angular_core.Signal<_radix_ng_primitives_core.Direction>;
98
- private readonly _loop;
99
- readonly loop: _angular_core.Signal<boolean>;
100
- private readonly _enabled;
101
- readonly enabled: _angular_core.Signal<boolean>;
102
- readonly focusableItems: _angular_core.WritableSignal<HTMLElement[]>;
103
- protected readonly isClickFocus: _angular_core.WritableSignal<boolean>;
104
- readonly isTabbingBackOut: _angular_core.WritableSignal<boolean>;
105
- private readonly itemIds;
106
- private isDestroyed;
107
- constructor();
108
- setOrientation(value: Orientation): void;
109
- setDir(value: Direction): void;
110
- setLoop(value: boolean): void;
111
- setEnabled(value: boolean): void;
112
- /** @ignore */
113
- registerItem(item: HTMLElement, tabStopId: string): void;
114
- /** @ignore */
115
- unregisterItem(item: HTMLElement, tabStopId: string): void;
116
- /** @ignore */
117
- handleMouseUp(): void;
118
- /** @ignore */
119
- handleFocus(event: Event): void;
120
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxRovingFocusGroupDirective, never>;
121
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxRovingFocusGroupDirective, "[rdxRovingFocusGroup]", never, { "orientationInput": { "alias": "orientation"; "required": false; "isSignal": true; }; "dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; "loopInput": { "alias": "loop"; "required": false; "isSignal": true; }; "enabledInput": { "alias": "enabled"; "required": false; "isSignal": true; }; "preventScrollOnEntryFocus": { "alias": "preventScrollOnEntryFocus"; "required": false; "isSignal": true; }; "defaultCurrentTabStopId": { "alias": "defaultCurrentTabStopId"; "required": false; "isSignal": true; }; "currentTabStopId": { "alias": "currentTabStopId"; "required": false; "isSignal": true; }; }, { "currentTabStopId": "currentTabStopIdChange"; "entryFocus": "entryFocus"; }, never, never, true, never>;
122
- }
123
-
124
- /**
125
- * @group Components
126
- */
127
- declare class RdxRovingFocusItemDirective {
128
- private readonly isBrowser;
129
- private readonly elementRef;
130
- /**
131
- * The enclosing roving-focus group. Optional: when the item is used outside a group
132
- * (e.g. a standalone Toggle), it degrades to a plain element and does not manage focus.
133
- */
134
- protected readonly rootContext: {
135
- enabled: _angular_core.Signal<boolean>;
136
- loop: _angular_core.Signal<boolean>;
137
- dir: _angular_core.Signal<_radix_ng_primitives_core.Direction>;
138
- orientation: _angular_core.Signal<_radix_ng_primitives_roving_focus.Orientation>;
139
- currentTabStopId: _angular_core.ModelSignal<string | undefined>;
140
- focusableItems: _angular_core.WritableSignal<HTMLElement[]>;
141
- onItemFocus: (tabStopId: string) => void;
142
- onItemShiftTab: () => void;
143
- registerItem: (item: HTMLElement, tabStopId: string) => void;
144
- unregisterItem: (item: HTMLElement, tabStopId: string) => void;
145
- } | null;
146
- /**
147
- * When false, item will not be focusable.
148
- * @group Props
149
- */
150
- readonly focusableInput: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
151
- /**
152
- * When `true`, marks the item as the active one, so it is preferred when focus enters the group.
153
- * @group Props
154
- */
155
- readonly activeInput: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
156
- /**
157
- * @group Props
158
- */
159
- readonly tabStopIdInput: _angular_core.InputSignal<string | undefined>;
160
- /**
161
- * When true, shift + arrow key will allow focusing on next/previous item.
162
- * @group Props
163
- */
164
- readonly allowShiftKey: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
165
- private readonly generatedId;
166
- protected readonly id: _angular_core.Signal<string>;
167
- protected readonly isCurrentTabStop: _angular_core.Signal<boolean>;
168
- protected readonly focusable: _angular_core.WritableSignal<boolean>;
169
- protected readonly active: _angular_core.WritableSignal<boolean>;
170
- protected readonly enabled: _angular_core.WritableSignal<boolean>;
171
- private readonly tabStopId;
172
- /**
173
- * The roving tabindex. Without a group the item keeps its natural tab order (`null`); inside a
174
- * group exactly one focusable item is a tab stop (`0`), the rest are reachable only via arrows (`-1`).
175
- */
176
- protected readonly tabindex: _angular_core.Signal<-1 | 0 | null>;
177
- constructor();
178
- setFocusable(value: boolean): void;
179
- setEnabled(value: boolean): void;
180
- setActive(value: boolean): void;
181
- setTabStopId(value: string): void;
182
- /** @ignore */
183
- onFocus(): void;
184
- /** @ignore */
185
- handleMouseDown(event: Event): void;
186
- /**
187
- * Handles the `keydown` event for keyboard navigation within the roving focus group.
188
- * Supports navigation based on orientation and direction, and focuses appropriate elements.
189
- *
190
- * @param event The `KeyboardEvent` object.
191
- * @ignore
192
- */
193
- handleKeydown(event: Event): void;
194
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdxRovingFocusItemDirective, never>;
195
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdxRovingFocusItemDirective, "[rdxRovingFocusItem]", never, { "focusableInput": { "alias": "focusable"; "required": false; "isSignal": true; }; "activeInput": { "alias": "active"; "required": false; "isSignal": true; }; "tabStopIdInput": { "alias": "tabStopId"; "required": false; "isSignal": true; }; "allowShiftKey": { "alias": "allowShiftKey"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
196
- }
197
-
198
- declare const rovingFocusImports: (typeof RdxRovingFocusGroupDirective | typeof RdxRovingFocusItemDirective)[];
199
-
200
- export { RdxRovingFocusGroupDirective, RdxRovingFocusItemDirective, focusFirst, injectRovingFocusGroupContext, provideRovingFocusGroupContext, rovingFocusImports };
201
- export type { Direction, Orientation, RovingFocusGroupContext };