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