@radix-ng/primitives 0.18.2 → 0.19.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 (68) hide show
  1. package/avatar/index.d.ts +1 -2
  2. package/avatar/src/avatar-fallback.directive.d.ts +11 -23
  3. package/avatar/src/avatar-image.directive.d.ts +10 -14
  4. package/avatar/src/avatar-root.directive.d.ts +5 -15
  5. package/checkbox/index.d.ts +11 -0
  6. package/checkbox/src/checkbox-button.directive.d.ts +1 -1
  7. package/checkbox/src/checkbox-indicator.directive.d.ts +1 -1
  8. package/checkbox/src/checkbox-input.directive.d.ts +1 -1
  9. package/checkbox/src/checkbox.directive.d.ts +1 -1
  10. package/compodoc/documentation.json +4803 -2070
  11. package/core/index.d.ts +2 -0
  12. package/core/src/control-value-accessor/index.d.ts +75 -0
  13. package/core/src/create-inject-context/assert-injector.d.ts +51 -0
  14. package/core/src/create-inject-context/index.d.ts +68 -0
  15. package/core/src/types.d.ts +23 -0
  16. package/esm2022/avatar/index.mjs +1 -1
  17. package/esm2022/avatar/src/avatar-fallback.directive.mjs +38 -40
  18. package/esm2022/avatar/src/avatar-image.directive.mjs +25 -26
  19. package/esm2022/avatar/src/avatar-root.directive.mjs +13 -25
  20. package/esm2022/checkbox/index.mjs +31 -1
  21. package/esm2022/checkbox/src/checkbox-button.directive.mjs +3 -3
  22. package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +3 -3
  23. package/esm2022/checkbox/src/checkbox-input.directive.mjs +3 -3
  24. package/esm2022/checkbox/src/checkbox.directive.mjs +3 -3
  25. package/esm2022/core/index.mjs +3 -1
  26. package/esm2022/core/src/control-value-accessor/index.mjs +103 -0
  27. package/esm2022/core/src/create-inject-context/assert-injector.mjs +15 -0
  28. package/esm2022/core/src/create-inject-context/index.mjs +116 -0
  29. package/esm2022/core/src/types.mjs +2 -0
  30. package/esm2022/radio/index.mjs +2 -1
  31. package/esm2022/radio/src/radio-item-input.directive.mjs +37 -0
  32. package/esm2022/radio/src/radio-item.directive.mjs +55 -36
  33. package/esm2022/radio/src/radio-root.directive.mjs +24 -110
  34. package/esm2022/radio/src/radio-tokens.mjs +1 -1
  35. package/esm2022/roving-focus/index.mjs +3 -0
  36. package/esm2022/roving-focus/radix-ng-primitives-roving-focus.mjs +5 -0
  37. package/esm2022/roving-focus/src/roving-focus-group.directive.mjs +138 -0
  38. package/esm2022/roving-focus/src/roving-focus-item.directive.mjs +133 -0
  39. package/esm2022/roving-focus/src/utils.mjs +47 -0
  40. package/esm2022/select/src/select-item.directive.mjs +8 -2
  41. package/esm2022/toggle/src/toggle-input.directive.mjs +4 -3
  42. package/fesm2022/radix-ng-primitives-avatar.mjs +70 -85
  43. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  44. package/fesm2022/radix-ng-primitives-checkbox.mjs +35 -10
  45. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  46. package/fesm2022/radix-ng-primitives-core.mjs +230 -3
  47. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  48. package/fesm2022/radix-ng-primitives-radio.mjs +142 -176
  49. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  50. package/fesm2022/radix-ng-primitives-roving-focus.mjs +320 -0
  51. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -0
  52. package/fesm2022/radix-ng-primitives-select.mjs +7 -1
  53. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  54. package/fesm2022/radix-ng-primitives-toggle.mjs +3 -2
  55. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  56. package/package.json +7 -1
  57. package/radio/index.d.ts +1 -0
  58. package/radio/src/radio-item-input.directive.d.ts +12 -0
  59. package/radio/src/radio-item.directive.d.ts +23 -14
  60. package/radio/src/radio-root.directive.d.ts +15 -31
  61. package/radio/src/radio-tokens.d.ts +3 -3
  62. package/roving-focus/README.md +3 -0
  63. package/roving-focus/index.d.ts +3 -0
  64. package/roving-focus/src/roving-focus-group.directive.d.ts +50 -0
  65. package/roving-focus/src/roving-focus-item.directive.d.ts +50 -0
  66. package/roving-focus/src/utils.d.ts +19 -0
  67. package/select/src/select-item.directive.d.ts +7 -1
  68. package/toggle/src/toggle-input.directive.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle-input.directive.ts","../../../packages/primitives/toggle/src/toggle.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { RdxVisuallyHiddenInputDirective } from '@radix-ng/primitives/visually-hidden';\n\n@Directive({\n selector: '[rdxToggleInput]',\n exportAs: 'rdxToggleInput',\n standalone: true,\n hostDirectives: [\n {\n directive: RdxVisuallyHiddenInputDirective,\n inputs: [\n 'name',\n 'required'\n ]\n }\n ],\n host: {\n type: 'checkbox'\n }\n})\nexport class RdxToggleInputDirective {}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, model, output, OutputEmitterRef } from '@angular/core';\n\nexport interface ToggleProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?: OutputEmitterRef<boolean>;\n\n /**\n * Whether the toggle is disabled.\n * @defaultValue false\n */\n disabled?: boolean;\n}\n\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n standalone: true,\n host: {\n '[attr.aria-pressed]': 'pressed()',\n '[attr.data-state]': 'pressed() ? \"on\" : \"off\"',\n '[attr.data-disabled]': 'disabled()',\n '[disabled]': 'disabled()',\n\n '(click)': 'toggle()'\n }\n})\nexport class RdxToggleDirective {\n /**\n * The pressed state of the toggle when it is initially rendered.\n * Use when you do not need to control its pressed state.\n */\n readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled pressed state of the toggle.\n * Must be used in conjunction with `onPressedChange`.\n */\n readonly pressed = model<boolean>(this.defaultPressed());\n\n /**\n * When true, prevents the user from interacting with the toggle.\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Event handler called when the pressed state of the toggle changes.\n */\n readonly onPressedChange = output<boolean>();\n\n protected toggle(): void {\n if (!this.disabled()) {\n this.pressed.set(!this.pressed());\n this.onPressedChange.emit(this.pressed());\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAoBa,uBAAuB,CAAA;+GAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,EAAA,CAAA,+BAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAjBnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,cAAc,EAAE;AACZ,wBAAA;AACI,4BAAA,SAAS,EAAE,+BAA+B;AAC1C,4BAAA,MAAM,EAAE;gCACJ,MAAM;gCACN;AACH;AACJ;AAC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,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,OAAA,EAAA,eAAA,EAAA,eAAA,EAAA,iBAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,UAAA,EAAA,EAAA,UAAA,EAAA,EAAA,mBAAA,EAAA,WAAA,EAAA,iBAAA,EAAA,8BAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAb9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,qBAAqB,EAAE,WAAW;AAClC,wBAAA,mBAAmB,EAAE,0BAA0B;AAC/C,wBAAA,sBAAsB,EAAE,YAAY;AACpC,wBAAA,YAAY,EAAE,YAAY;AAE1B,wBAAA,SAAS,EAAE;AACd;AACJ,iBAAA;;;ACxCD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle-input.directive.ts","../../../packages/primitives/toggle/src/toggle.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { RdxVisuallyHiddenInputDirective } from '@radix-ng/primitives/visually-hidden';\n\n@Directive({\n selector: '[rdxToggleInput]',\n exportAs: 'rdxToggleInput',\n standalone: true,\n hostDirectives: [\n {\n directive: RdxVisuallyHiddenInputDirective,\n inputs: [\n 'name',\n 'required',\n 'value'\n ]\n }\n ],\n host: {\n type: 'checkbox'\n }\n})\nexport class RdxToggleInputDirective {}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, Directive, input, model, output, OutputEmitterRef } from '@angular/core';\n\nexport interface ToggleProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?: OutputEmitterRef<boolean>;\n\n /**\n * Whether the toggle is disabled.\n * @defaultValue false\n */\n disabled?: boolean;\n}\n\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n standalone: true,\n host: {\n '[attr.aria-pressed]': 'pressed()',\n '[attr.data-state]': 'pressed() ? \"on\" : \"off\"',\n '[attr.data-disabled]': 'disabled()',\n '[disabled]': 'disabled()',\n\n '(click)': 'toggle()'\n }\n})\nexport class RdxToggleDirective {\n /**\n * The pressed state of the toggle when it is initially rendered.\n * Use when you do not need to control its pressed state.\n */\n readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled pressed state of the toggle.\n * Must be used in conjunction with `onPressedChange`.\n */\n readonly pressed = model<boolean>(this.defaultPressed());\n\n /**\n * When true, prevents the user from interacting with the toggle.\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Event handler called when the pressed state of the toggle changes.\n */\n readonly onPressedChange = output<boolean>();\n\n protected toggle(): void {\n if (!this.disabled()) {\n this.pressed.set(!this.pressed());\n this.onPressedChange.emit(this.pressed());\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAqBa,uBAAuB,CAAA;+GAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CA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AkB,EAAA,UAAA,EAAA,CAAA;kBAb9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,qBAAqB,EAAE,WAAW;AAClC,wBAAA,mBAAmB,EAAE,0BAA0B;AAC/C,wBAAA,sBAAsB,EAAE,YAAY;AACpC,wBAAA,YAAY,EAAE,YAAY;AAE1B,wBAAA,SAAS,EAAE;AACd;AACJ,iBAAA;;;ACxCD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ng/primitives",
3
- "version": "0.18.2",
3
+ "version": "0.19.0",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -127,6 +127,12 @@
127
127
  "esm": "./esm2022/radio/radix-ng-primitives-radio.mjs",
128
128
  "default": "./fesm2022/radix-ng-primitives-radio.mjs"
129
129
  },
130
+ "./roving-focus": {
131
+ "types": "./roving-focus/index.d.ts",
132
+ "esm2022": "./esm2022/roving-focus/radix-ng-primitives-roving-focus.mjs",
133
+ "esm": "./esm2022/roving-focus/radix-ng-primitives-roving-focus.mjs",
134
+ "default": "./fesm2022/radix-ng-primitives-roving-focus.mjs"
135
+ },
130
136
  "./select": {
131
137
  "types": "./select/index.d.ts",
132
138
  "esm2022": "./esm2022/select/radix-ng-primitives-select.mjs",
package/radio/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './src/radio-root.directive';
2
2
  export * from './src/radio-indicator.directive';
3
+ export * from './src/radio-item-input.directive';
3
4
  export * from './src/radio-item.directive';
@@ -0,0 +1,12 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@radix-ng/primitives/visually-hidden";
3
+ export declare class RdxRadioItemInputDirective {
4
+ private readonly radioItem;
5
+ readonly name: import("@angular/core").InputSignal<string | undefined>;
6
+ readonly value: import("@angular/core").Signal<string | undefined>;
7
+ readonly checked: import("@angular/core").Signal<true | undefined>;
8
+ readonly required: import("@angular/core").InputSignal<boolean | undefined>;
9
+ readonly disabled: import("@angular/core").InputSignal<boolean | undefined>;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxRadioItemInputDirective, never>;
11
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioItemInputDirective, "[rdxRadioItemInput]", ["rdxRadioItemInput"], { "name": { "alias": "name"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.RdxVisuallyHiddenDirective; inputs: { "feature": "feature"; }; outputs: {}; }]>;
12
+ }
@@ -1,21 +1,30 @@
1
- import { FocusableOption } from '@angular/cdk/a11y';
2
- import { ElementRef, InjectionToken, OnInit } from '@angular/core';
1
+ import { BooleanInput } from '@angular/cdk/coercion';
2
+ import { InjectionToken, OnInit } from '@angular/core';
3
3
  import * as i0 from "@angular/core";
4
+ import * as i1 from "@radix-ng/primitives/roving-focus";
4
5
  export declare const RdxRadioItemToken: InjectionToken<RdxRadioItemDirective>;
5
6
  export declare function injectRadioItem(): RdxRadioItemDirective;
6
- export declare class RdxRadioItemDirective implements FocusableOption, OnInit {
7
+ export declare class RdxRadioItemDirective implements OnInit {
7
8
  private readonly radioGroup;
8
- readonly element: ElementRef<any>;
9
- id: string;
10
- value: string;
11
- disabled: boolean;
12
- get tabIndex(): number;
13
- get checked(): boolean;
9
+ private readonly elementRef;
10
+ readonly value: import("@angular/core").InputSignal<string>;
11
+ readonly id: import("@angular/core").InputSignal<string | undefined>;
12
+ readonly required: import("@angular/core").InputSignal<boolean | undefined>;
13
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
14
+ private readonly ARROW_KEYS;
15
+ private readonly isArrowKeyPressedSignal;
16
+ /** @ignore */
14
17
  ngOnInit(): void;
15
- focus(): void;
16
- _onClick(): void;
17
- _onBlur(): void;
18
+ /** @ignore */
19
+ get checked(): boolean;
20
+ /** @ignore */
21
+ onClick(): void;
22
+ /** @ignore */
23
+ onKeyDown(event: KeyboardEvent): void;
24
+ /** @ignore */
25
+ onKeyUp(): void;
26
+ /** @ignore */
27
+ onFocus(): void;
18
28
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxRadioItemDirective, never>;
19
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioItemDirective, "[rdxRadioItem]", ["rdxRadioItem"], { "id": { "alias": "id"; "required": false; }; "value": { "alias": "value"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
20
- static ngAcceptInputType_disabled: unknown;
29
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioItemDirective, "[rdxRadioItem]", ["rdxRadioItem"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.RdxRovingFocusItemDirective; inputs: { "tabStopId": "id"; "focusable": "focusable"; "active": "active"; "allowShiftKey": "allowShiftKey"; }; outputs: {}; }]>;
21
30
  }
@@ -1,25 +1,15 @@
1
- import { AfterContentInit, EventEmitter, OnDestroy, QueryList } from '@angular/core';
1
+ import { EventEmitter } from '@angular/core';
2
2
  import { ControlValueAccessor } from '@angular/forms';
3
- import { RdxRadioItemDirective } from './radio-item.directive';
3
+ import { Orientation } from '@radix-ng/primitives/roving-focus';
4
4
  import { RadioGroupDirective, RadioGroupProps } from './radio-tokens';
5
5
  import * as i0 from "@angular/core";
6
- export declare class RdxRadioGroupDirective implements RadioGroupProps, RadioGroupDirective, ControlValueAccessor, AfterContentInit, OnDestroy {
7
- radioItems: QueryList<RdxRadioItemDirective>;
8
- private focusKeyManager;
9
- private destroy$;
10
- name?: string | undefined;
11
- value?: string;
6
+ import * as i1 from "@radix-ng/primitives/roving-focus";
7
+ export declare class RdxRadioGroupDirective implements RadioGroupProps, RadioGroupDirective, ControlValueAccessor {
8
+ readonly value: import("@angular/core").ModelSignal<string | undefined>;
12
9
  disabled: boolean;
13
- dir?: string;
14
10
  defaultValue?: string;
15
- /**
16
- * The orientation of the radio group only vertical.
17
- * Horizontal radio buttons can sometimes be challenging to scan and localize.
18
- * The horizontal arrangement of radio buttons may also lead to difficulties in determining which
19
- * label corresponds to which button: whether the label is above or below the button.
20
- * @default 'vertical'
21
- */
22
- readonly _orientation = "vertical";
11
+ required: boolean;
12
+ orientation: Orientation;
23
13
  /**
24
14
  * Event handler called when the value changes.
25
15
  */
@@ -30,43 +20,37 @@ export declare class RdxRadioGroupDirective implements RadioGroupProps, RadioGro
30
20
  private onChange;
31
21
  /**
32
22
  * The callback function to call when the radio group is touched.
23
+ * @ignore
33
24
  */
34
25
  onTouched: () => void;
35
- ngAfterContentInit(): void;
36
- ngOnDestroy(): void;
37
26
  /**
38
27
  * Select a radio item.
39
28
  * @param value The value of the radio item to select.
29
+ * @ignore
40
30
  */
41
31
  select(value: string): void;
42
32
  /**
43
33
  * Update the value of the radio group.
44
34
  * @param value The new value of the radio group.
45
- * @internal
35
+ * @ignore
46
36
  */
47
37
  writeValue(value: string): void;
48
38
  /**
49
39
  * Register a callback function to call when the value of the radio group changes.
50
40
  * @param fn The callback function to call when the value of the radio group changes.
51
- * @internal
41
+ * @ignore
52
42
  */
53
43
  registerOnChange(fn: (value: string) => void): void;
44
+ /** @ignore */
54
45
  registerOnTouched(fn: () => void): void;
55
46
  /**
56
47
  * Set the disabled state of the radio group.
57
48
  * @param isDisabled Whether the radio group is disabled.
58
- * @internal
49
+ * @ignore
59
50
  */
60
51
  setDisabledState(isDisabled: boolean): void;
61
- /**
62
- * When focus leaves the radio group.
63
- */
64
- protected onFocusin(event: FocusEvent): void;
65
- protected onKeydown(event: KeyboardEvent): void;
66
- private selectFocusedItem;
67
- private updateActiveItem;
68
- private tabNavigation;
52
+ protected onKeydown(): void;
69
53
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxRadioGroupDirective, never>;
70
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioGroupDirective, "[rdxRadioRoot]", ["rdxRadioRoot"], { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; }, { "onValueChange": "onValueChange"; }, ["radioItems"], never, true, never>;
54
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioGroupDirective, "[rdxRadioRoot]", ["rdxRadioRoot"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; "required": { "alias": "required"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; }, { "value": "valueChange"; "onValueChange": "onValueChange"; }, never, never, true, [{ directive: typeof i1.RdxRovingFocusGroupDirective; inputs: { "dir": "dir"; "orientation": "orientation"; "loop": "loop"; }; outputs: {}; }]>;
71
55
  static ngAcceptInputType_disabled: unknown;
72
56
  }
@@ -1,12 +1,12 @@
1
- import { InjectionToken } from '@angular/core';
1
+ import { InjectionToken, ModelSignal } from '@angular/core';
2
2
  export interface RadioGroupProps {
3
3
  name?: string;
4
4
  disabled?: boolean;
5
5
  defaultValue?: string;
6
- value?: string;
6
+ value?: ModelSignal<string | undefined>;
7
7
  }
8
8
  export interface RadioGroupDirective extends RadioGroupProps {
9
- select(value: string): void;
9
+ select(value: string | undefined): void;
10
10
  onTouched(): void;
11
11
  }
12
12
  export declare const RDX_RADIO_GROUP: InjectionToken<RadioGroupDirective>;
@@ -0,0 +1,3 @@
1
+ # @radix-ng/primitives/roving-focus
2
+
3
+ Secondary entry point of `@radix-ng/primitives`.
@@ -0,0 +1,3 @@
1
+ export * from './src/roving-focus-group.directive';
2
+ export * from './src/roving-focus-item.directive';
3
+ export type { Direction, Orientation } from './src/utils';
@@ -0,0 +1,50 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { Direction, Orientation } from './utils';
3
+ import * as i0 from "@angular/core";
4
+ export declare class RdxRovingFocusGroupDirective {
5
+ private readonly ngZone;
6
+ private readonly elementRef;
7
+ orientation: Orientation | undefined;
8
+ dir: Direction;
9
+ loop: boolean;
10
+ preventScrollOnEntryFocus: boolean;
11
+ entryFocus: EventEmitter<Event>;
12
+ currentTabStopIdChange: EventEmitter<string | null>;
13
+ /** @ignore */
14
+ readonly currentTabStopId: import("@angular/core").WritableSignal<string | null>;
15
+ /** @ignore */
16
+ readonly focusableItems: import("@angular/core").WritableSignal<HTMLElement[]>;
17
+ private readonly isClickFocus;
18
+ private readonly isTabbingBackOut;
19
+ private readonly focusableItemsCount;
20
+ /** @ignore */
21
+ get dataOrientation(): Orientation;
22
+ /** @ignore */
23
+ get tabIndex(): 0 | -1;
24
+ /** @ignore */
25
+ handleBlur(): void;
26
+ /** @ignore */
27
+ handleMouseUp(): void;
28
+ /** @ignore */
29
+ handleFocus(event: FocusEvent): void;
30
+ /** @ignore */
31
+ handleMouseDown(): void;
32
+ /** @ignore */
33
+ onItemFocus(tabStopId: string): void;
34
+ /** @ignore */
35
+ onItemShiftTab(): void;
36
+ /** @ignore */
37
+ onFocusableItemAdd(): void;
38
+ /** @ignore */
39
+ onFocusableItemRemove(): void;
40
+ /** @ignore */
41
+ registerItem(item: HTMLElement): void;
42
+ /** @ignore */
43
+ unregisterItem(item: HTMLElement): void;
44
+ /** @ignore */
45
+ getFocusableItemsCount(): number;
46
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxRovingFocusGroupDirective, never>;
47
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRovingFocusGroupDirective, "[rdxRovingFocusGroup]", never, { "orientation": { "alias": "orientation"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; "loop": { "alias": "loop"; "required": false; }; "preventScrollOnEntryFocus": { "alias": "preventScrollOnEntryFocus"; "required": false; }; }, { "entryFocus": "entryFocus"; "currentTabStopIdChange": "currentTabStopIdChange"; }, never, never, true, never>;
48
+ static ngAcceptInputType_loop: unknown;
49
+ static ngAcceptInputType_preventScrollOnEntryFocus: unknown;
50
+ }
@@ -0,0 +1,50 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { RdxRovingFocusGroupDirective } from './roving-focus-group.directive';
3
+ import * as i0 from "@angular/core";
4
+ export declare class RdxRovingFocusItemDirective implements OnInit, OnDestroy {
5
+ private readonly elementRef;
6
+ private readonly ngZone;
7
+ protected readonly parent: RdxRovingFocusGroupDirective;
8
+ focusable: boolean;
9
+ active: boolean;
10
+ tabStopId: string;
11
+ allowShiftKey: boolean;
12
+ private readonly id;
13
+ /** @ignore */
14
+ readonly isCurrentTabStop: import("@angular/core").Signal<boolean>;
15
+ /**
16
+ * Lifecycle hook triggered on initialization.
17
+ * Registers the element with the parent roving focus group if it is focusable.
18
+ * @ignore
19
+ */
20
+ ngOnInit(): void;
21
+ /**
22
+ * Lifecycle hook triggered on destruction.
23
+ * Unregisters the element from the parent roving focus group if it is focusable.
24
+ * @ignore
25
+ */
26
+ ngOnDestroy(): void;
27
+ /**
28
+ * Determines the `tabIndex` of the element.
29
+ * Returns `0` if the element is the current tab stop; otherwise, returns `-1`.
30
+ * @ignore
31
+ */
32
+ get tabIndex(): 0 | -1;
33
+ /** @ignore */
34
+ handleMouseDown(event: MouseEvent): void;
35
+ /** @ignore */
36
+ onFocus(): void;
37
+ /**
38
+ * Handles the `keydown` event for keyboard navigation within the roving focus group.
39
+ * Supports navigation based on orientation and direction, and focuses appropriate elements.
40
+ *
41
+ * @param event The `KeyboardEvent` object.
42
+ * @ignore
43
+ */
44
+ handleKeydown(event: KeyboardEvent): void;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxRovingFocusItemDirective, never>;
46
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRovingFocusItemDirective, "[rdxRovingFocusItem]", never, { "focusable": { "alias": "focusable"; "required": false; }; "active": { "alias": "active"; "required": false; }; "tabStopId": { "alias": "tabStopId"; "required": false; }; "allowShiftKey": { "alias": "allowShiftKey"; "required": false; }; }, {}, never, never, true, never>;
47
+ static ngAcceptInputType_focusable: unknown;
48
+ static ngAcceptInputType_active: unknown;
49
+ static ngAcceptInputType_allowShiftKey: unknown;
50
+ }
@@ -0,0 +1,19 @@
1
+ export type Orientation = 'horizontal' | 'vertical';
2
+ export type Direction = 'ltr' | 'rtl';
3
+ export declare const ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
4
+ export declare const EVENT_OPTIONS: {
5
+ bubbles: boolean;
6
+ cancelable: boolean;
7
+ };
8
+ type FocusIntent = 'first' | 'last' | 'prev' | 'next';
9
+ export declare const MAP_KEY_TO_FOCUS_INTENT: Record<string, FocusIntent>;
10
+ export declare function getDirectionAwareKey(key: string, dir?: Direction): string;
11
+ export declare function getFocusIntent(event: KeyboardEvent, orientation?: Orientation, dir?: Direction): FocusIntent | undefined;
12
+ export declare function focusFirst(candidates: HTMLElement[], preventScroll?: boolean, rootNode?: Document | ShadowRoot): void;
13
+ /**
14
+ * Wraps an array around itself at a given start index
15
+ * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`
16
+ */
17
+ export declare function wrapArray<T>(array: T[], startIndex: number): T[];
18
+ export declare function generateId(): string;
19
+ export {};
@@ -30,15 +30,21 @@ export declare class RdxSelectItemDirective implements Highlightable {
30
30
  private _disabled;
31
31
  get viewValue(): string;
32
32
  constructor();
33
- /** Gets the label to be used when determining whether the option should be focused. */
33
+ /** Gets the label to be used when determining whether the option should be focused.
34
+ * @ignore
35
+ */
34
36
  getLabel(): string;
35
37
  /**
36
38
  * `Selects the option while indicating the selection came from the user. Used to
37
39
  * determine if the select's view -> model callback should be invoked.`
40
+ * @ignore
38
41
  */
39
42
  selectViaInteraction(): void;
43
+ /** @ignore */
40
44
  handleKeydown(event: KeyboardEvent): void;
45
+ /** @ignore */
41
46
  setActiveStyles(): void;
47
+ /** @ignore */
42
48
  setInactiveStyles(): void;
43
49
  protected onPointerMove(): void;
44
50
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxSelectItemDirective, never>;
@@ -2,5 +2,5 @@ import * as i0 from "@angular/core";
2
2
  import * as i1 from "@radix-ng/primitives/visually-hidden";
3
3
  export declare class RdxToggleInputDirective {
4
4
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxToggleInputDirective, never>;
5
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleInputDirective, "[rdxToggleInput]", ["rdxToggleInput"], {}, {}, never, never, true, [{ directive: typeof i1.RdxVisuallyHiddenInputDirective; inputs: { "name": "name"; "required": "required"; }; outputs: {}; }]>;
5
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleInputDirective, "[rdxToggleInput]", ["rdxToggleInput"], {}, {}, never, never, true, [{ directive: typeof i1.RdxVisuallyHiddenInputDirective; inputs: { "name": "name"; "required": "required"; "value": "value"; }; outputs: {}; }]>;
6
6
  }