@radix-ng/primitives 0.13.0 → 0.15.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 (99) hide show
  1. package/alert-dialog/index.d.ts +11 -0
  2. package/alert-dialog/src/alert-dialog-cancel.directive.d.ts +3 -3
  3. package/alert-dialog/src/alert-dialog-content.directive.d.ts +3 -3
  4. package/alert-dialog/src/alert-dialog-root.directive.d.ts +3 -3
  5. package/alert-dialog/src/alert-dialog-title.directive.d.ts +3 -3
  6. package/alert-dialog/src/alert-dialog-trigger.directive.d.ts +3 -3
  7. package/alert-dialog/src/alert-dialog.service.d.ts +3 -3
  8. package/aspect-ratio/README.md +1 -0
  9. package/aspect-ratio/index.d.ts +1 -0
  10. package/aspect-ratio/src/aspect-ratio.directive.d.ts +28 -0
  11. package/avatar/src/avatar-fallback.directive.d.ts +2 -1
  12. package/compodoc/documentation.json +1306 -805
  13. package/core/index.d.ts +6 -0
  14. package/core/src/accessor/provide-value-accessor.d.ts +12 -0
  15. package/core/src/auto-focus.directive.d.ts +14 -0
  16. package/core/src/document.d.ts +1 -0
  17. package/core/src/inject-ng-control.d.ts +8 -0
  18. package/core/src/is-client.d.ts +1 -0
  19. package/core/src/window.d.ts +3 -0
  20. package/esm2022/accordion/src/accordion-root.directive.mjs +14 -2
  21. package/esm2022/alert-dialog/index.mjs +35 -1
  22. package/esm2022/alert-dialog/src/alert-dialog-cancel.directive.mjs +7 -7
  23. package/esm2022/alert-dialog/src/alert-dialog-content.directive.mjs +7 -7
  24. package/esm2022/alert-dialog/src/alert-dialog-root.directive.mjs +7 -7
  25. package/esm2022/alert-dialog/src/alert-dialog-title.directive.mjs +5 -5
  26. package/esm2022/alert-dialog/src/alert-dialog-trigger.directive.mjs +7 -7
  27. package/esm2022/alert-dialog/src/alert-dialog.service.mjs +5 -5
  28. package/esm2022/aspect-ratio/index.mjs +2 -0
  29. package/esm2022/aspect-ratio/radix-ng-primitives-aspect-ratio.mjs +5 -0
  30. package/esm2022/aspect-ratio/src/aspect-ratio.directive.mjs +53 -0
  31. package/esm2022/avatar/src/avatar-fallback.directive.mjs +9 -7
  32. package/esm2022/core/index.mjs +7 -0
  33. package/esm2022/core/radix-ng-primitives-core.mjs +5 -0
  34. package/esm2022/core/src/accessor/provide-value-accessor.mjs +19 -0
  35. package/esm2022/core/src/auto-focus.directive.mjs +80 -0
  36. package/esm2022/core/src/document.mjs +6 -0
  37. package/esm2022/core/src/inject-ng-control.mjs +17 -0
  38. package/esm2022/core/src/is-client.mjs +6 -0
  39. package/esm2022/core/src/window.mjs +15 -0
  40. package/esm2022/dropdown-menu/src/dropdown-menu-item.directive.mjs +5 -3
  41. package/esm2022/radio/src/radio-root.directive.mjs +6 -6
  42. package/esm2022/separator/src/separator.directive.mjs +33 -15
  43. package/esm2022/switch/src/switch-root.directive.mjs +19 -39
  44. package/esm2022/toggle/src/toggle.directive.mjs +21 -11
  45. package/esm2022/toggle-group/index.mjs +4 -4
  46. package/esm2022/toggle-group/src/toggle-group-item.directive.mjs +84 -0
  47. package/esm2022/toggle-group/src/toggle-group-item.token.mjs +3 -0
  48. package/esm2022/toggle-group/src/toggle-group-multiple.directive.mjs +185 -0
  49. package/esm2022/toggle-group/src/toggle-group.directive.mjs +51 -6
  50. package/esm2022/toggle-group/src/toggle-group.token.mjs +1 -1
  51. package/esm2022/visually-hidden/index.mjs +4 -0
  52. package/esm2022/visually-hidden/radix-ng-primitives-visually-hidden.mjs +5 -0
  53. package/esm2022/visually-hidden/src/visually-hidden-input-bubble.directive.mjs +74 -0
  54. package/esm2022/visually-hidden/src/visually-hidden-input.directive.mjs +74 -0
  55. package/esm2022/visually-hidden/src/visually-hidden.directive.mjs +42 -0
  56. package/fesm2022/radix-ng-primitives-accordion.mjs +13 -1
  57. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  58. package/fesm2022/radix-ng-primitives-alert-dialog.mjs +59 -31
  59. package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
  60. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +60 -0
  61. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -0
  62. package/fesm2022/radix-ng-primitives-avatar.mjs +7 -5
  63. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  64. package/fesm2022/radix-ng-primitives-core.mjs +144 -0
  65. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -0
  66. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +4 -2
  67. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +1 -1
  68. package/fesm2022/radix-ng-primitives-radio.mjs +5 -5
  69. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  70. package/fesm2022/radix-ng-primitives-separator.mjs +32 -14
  71. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  72. package/fesm2022/radix-ng-primitives-switch.mjs +18 -38
  73. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  74. package/fesm2022/radix-ng-primitives-toggle-group.mjs +127 -35
  75. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  76. package/fesm2022/radix-ng-primitives-toggle.mjs +20 -10
  77. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  78. package/fesm2022/radix-ng-primitives-visually-hidden.mjs +189 -0
  79. package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -0
  80. package/package.json +19 -1
  81. package/radio/src/radio-root.directive.d.ts +2 -2
  82. package/separator/src/separator.directive.d.ts +29 -5
  83. package/switch/src/switch-root.directive.d.ts +12 -24
  84. package/toggle/src/toggle.directive.d.ts +24 -7
  85. package/toggle-group/index.d.ts +3 -3
  86. package/toggle-group/src/{toggle-group-button.directive.d.ts → toggle-group-item.directive.d.ts} +10 -4
  87. package/toggle-group/src/toggle-group-item.token.d.ts +3 -0
  88. package/toggle-group/src/{toggle-group-multi.directive.d.ts → toggle-group-multiple.directive.d.ts} +11 -5
  89. package/toggle-group/src/toggle-group.directive.d.ts +9 -3
  90. package/toggle-group/src/toggle-group.token.d.ts +3 -3
  91. package/visually-hidden/README.md +3 -0
  92. package/visually-hidden/index.d.ts +3 -0
  93. package/visually-hidden/src/visually-hidden-input-bubble.directive.d.ts +21 -0
  94. package/visually-hidden/src/visually-hidden-input.directive.d.ts +19 -0
  95. package/visually-hidden/src/visually-hidden.directive.d.ts +15 -0
  96. package/esm2022/toggle-group/src/toggle-group-button.directive.mjs +0 -75
  97. package/esm2022/toggle-group/src/toggle-group-button.token.mjs +0 -6
  98. package/esm2022/toggle-group/src/toggle-group-multi.directive.mjs +0 -143
  99. package/toggle-group/src/toggle-group-button.token.d.ts +0 -4
@@ -0,0 +1,189 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, Directive, inject, ElementRef, effect, computed } from '@angular/core';
3
+
4
+ /**
5
+ *
6
+ * <span rdxVisuallyHidden [feature]="'fully-hidden'">
7
+ * <ng-content></ng-content>
8
+ * </span>
9
+ *
10
+ * <button (click)="directiveInstance.feature.set('focusable')">Make Focusable</button>
11
+ * <button (click)="directiveInstance.feature.set('fully-hidden')">Hide</button>
12
+ */
13
+ class RdxVisuallyHiddenDirective {
14
+ constructor() {
15
+ this.feature = input('focusable');
16
+ }
17
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxVisuallyHiddenDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
18
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.1", type: RdxVisuallyHiddenDirective, isStandalone: true, selector: "[rdxVisuallyHidden]", inputs: { feature: { classPropertyName: "feature", publicName: "feature", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-hidden": "feature() === \"focusable\" ? \"true\" : null", "hidden": "feature() === \"fully-hidden\" ? true : null", "attr.tabindex": "feature() === \"fully-hidden\" ? \"-1\" : null", "style.position": "\"absolute\"", "style.border": "\"0\"", "style.width": "\"1px\"", "style.display": "feature() === \"focusable\" ? \"inline-block\" : \"none\"", "style.height": "\"1px\"", "style.padding": "\"0\"", "style.margin": "\"-1px\"", "style.overflow": "\"hidden\"", "style.clip": "\"rect(0, 0, 0, 0)\"", "style.white-space": "\"nowrap\"", "style.word-wrap": "\"normal\"" } }, ngImport: i0 }); }
19
+ }
20
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxVisuallyHiddenDirective, decorators: [{
21
+ type: Directive,
22
+ args: [{
23
+ selector: '[rdxVisuallyHidden]',
24
+ standalone: true,
25
+ host: {
26
+ '[attr.aria-hidden]': 'feature() === "focusable" ? "true" : null',
27
+ '[hidden]': 'feature() === "fully-hidden" ? true : null',
28
+ '[attr.tabindex]': 'feature() === "fully-hidden" ? "-1" : null',
29
+ '[style.position]': '"absolute"',
30
+ '[style.border]': '"0"',
31
+ '[style.width]': '"1px"',
32
+ '[style.display]': 'feature() === "focusable" ? "inline-block" : "none"',
33
+ '[style.height]': '"1px"',
34
+ '[style.padding]': '"0"',
35
+ '[style.margin]': '"-1px"',
36
+ '[style.overflow]': '"hidden"',
37
+ '[style.clip]': '"rect(0, 0, 0, 0)"',
38
+ '[style.white-space]': '"nowrap"',
39
+ '[style.word-wrap]': '"normal"'
40
+ }
41
+ }]
42
+ }] });
43
+
44
+ /**
45
+ *
46
+ */
47
+ class RdxVisuallyHiddenInputBubbleDirective {
48
+ constructor() {
49
+ this.elementRef = inject(ElementRef);
50
+ this.name = input('');
51
+ this.value = input(null);
52
+ this.checked = input(undefined);
53
+ this.required = input(undefined);
54
+ this.disabled = input(undefined);
55
+ this.feature = input('fully-hidden');
56
+ effect(() => {
57
+ this.updateInputValue();
58
+ });
59
+ }
60
+ onChange() {
61
+ this.updateInputValue();
62
+ }
63
+ updateInputValue() {
64
+ let valueChanged = false;
65
+ let checkedChanged = false;
66
+ // Check if the value has changed before applying the update
67
+ const currentValue = this.inputElement.value;
68
+ const newValue = String(this.value());
69
+ if (currentValue !== newValue) {
70
+ this.inputElement.value = newValue;
71
+ valueChanged = true;
72
+ }
73
+ if (this.inputElement.type === 'checkbox' || this.inputElement.type === 'radio') {
74
+ const currentChecked = this.inputElement.checked;
75
+ const newChecked = !!this.checked();
76
+ if (currentChecked !== newChecked) {
77
+ this.inputElement.checked = newChecked;
78
+ checkedChanged = true;
79
+ }
80
+ }
81
+ if (valueChanged || checkedChanged) {
82
+ this.dispatchInputEvents();
83
+ }
84
+ }
85
+ get inputElement() {
86
+ return this.elementRef.nativeElement;
87
+ }
88
+ dispatchInputEvents() {
89
+ const inputEvent = new Event('input', { bubbles: true });
90
+ const changeEvent = new Event('change', { bubbles: true });
91
+ this.inputElement.dispatchEvent(inputEvent);
92
+ this.inputElement.dispatchEvent(changeEvent);
93
+ }
94
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxVisuallyHiddenInputBubbleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
95
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.1", type: RdxVisuallyHiddenInputBubbleDirective, isStandalone: true, selector: "[rdxVisuallyHiddenInputBubble]", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, feature: { classPropertyName: "feature", publicName: "feature", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "change": "onChange()" }, properties: { "attr.name": "name()", "attr.required": "required()", "attr.disabled": "disabled()", "attr.checked": "checked()", "value": "value()" } }, hostDirectives: [{ directive: RdxVisuallyHiddenDirective, inputs: ["feature", "feature"] }], ngImport: i0 }); }
96
+ }
97
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxVisuallyHiddenInputBubbleDirective, decorators: [{
98
+ type: Directive,
99
+ args: [{
100
+ selector: '[rdxVisuallyHiddenInputBubble]',
101
+ standalone: true,
102
+ hostDirectives: [{ directive: RdxVisuallyHiddenDirective, inputs: ['feature: feature'] }],
103
+ host: {
104
+ '[attr.name]': 'name()',
105
+ '[attr.required]': 'required()',
106
+ '[attr.disabled]': 'disabled()',
107
+ '[attr.checked]': 'checked()',
108
+ '[value]': 'value()',
109
+ '(change)': 'onChange()'
110
+ }
111
+ }]
112
+ }], ctorParameters: () => [] });
113
+
114
+ // Implementation from https://github.com/unovue/radix-vue
115
+ class RdxVisuallyHiddenInputDirective {
116
+ constructor() {
117
+ this.elementRef = inject(ElementRef);
118
+ this.name = input('');
119
+ this.value = input(null);
120
+ this.checked = input(undefined);
121
+ this.required = input(undefined);
122
+ this.disabled = input(undefined);
123
+ this.feature = input('fully-hidden');
124
+ this.parsedValue = computed(() => {
125
+ const value = this.value();
126
+ const name = this.name();
127
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
128
+ return [{ name, value }];
129
+ }
130
+ if (Array.isArray(value)) {
131
+ return value.flatMap((obj, index) => {
132
+ if (typeof obj === 'object') {
133
+ return Object.entries(obj).map(([key, val]) => ({
134
+ name: `[${name}][${index}][${key}]`,
135
+ value: val
136
+ }));
137
+ }
138
+ else {
139
+ return { name: `[${name}][${index}]`, value: obj };
140
+ }
141
+ });
142
+ }
143
+ if (value !== null && typeof value === 'object') {
144
+ return Object.entries(value).map(([key, val]) => ({
145
+ name: `[${name}][${key}]`,
146
+ value: val
147
+ }));
148
+ }
149
+ return [];
150
+ });
151
+ }
152
+ ngOnInit() {
153
+ const parsedValues = this.parsedValue();
154
+ parsedValues.forEach((parsed) => {
155
+ const inputElement = this.elementRef.nativeElement;
156
+ inputElement.setAttribute('name', parsed.name);
157
+ inputElement.setAttribute('value', parsed.value);
158
+ });
159
+ }
160
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxVisuallyHiddenInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
161
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.1", type: RdxVisuallyHiddenInputDirective, isStandalone: true, selector: "[rdxVisuallyHiddenInput]", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, feature: { classPropertyName: "feature", publicName: "feature", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: RdxVisuallyHiddenInputBubbleDirective, inputs: ["feature", "feature", "name", "name", "value", "value", "checked", "checked", "disabled", "disabled", "required", "required"] }], ngImport: i0 }); }
162
+ }
163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxVisuallyHiddenInputDirective, decorators: [{
164
+ type: Directive,
165
+ args: [{
166
+ selector: '[rdxVisuallyHiddenInput]',
167
+ standalone: true,
168
+ hostDirectives: [
169
+ {
170
+ directive: RdxVisuallyHiddenInputBubbleDirective,
171
+ inputs: [
172
+ 'feature: feature',
173
+ 'name: name ',
174
+ 'value: value',
175
+ 'checked: checked',
176
+ 'disabled: disabled',
177
+ 'required: required'
178
+ ]
179
+ }
180
+ ]
181
+ }]
182
+ }] });
183
+
184
+ /**
185
+ * Generated bundle index. Do not edit.
186
+ */
187
+
188
+ export { RdxVisuallyHiddenDirective, RdxVisuallyHiddenInputBubbleDirective, RdxVisuallyHiddenInputDirective };
189
+ //# sourceMappingURL=radix-ng-primitives-visually-hidden.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radix-ng-primitives-visually-hidden.mjs","sources":["../../../packages/primitives/visually-hidden/src/visually-hidden.directive.ts","../../../packages/primitives/visually-hidden/src/visually-hidden-input-bubble.directive.ts","../../../packages/primitives/visually-hidden/src/visually-hidden-input.directive.ts","../../../packages/primitives/visually-hidden/radix-ng-primitives-visually-hidden.ts"],"sourcesContent":["import { Directive, input } from '@angular/core';\n\n/**\n *\n * <span rdxVisuallyHidden [feature]=\"'fully-hidden'\">\n * <ng-content></ng-content>\n * </span>\n *\n * <button (click)=\"directiveInstance.feature.set('focusable')\">Make Focusable</button>\n * <button (click)=\"directiveInstance.feature.set('fully-hidden')\">Hide</button>\n */\n@Directive({\n selector: '[rdxVisuallyHidden]',\n standalone: true,\n host: {\n '[attr.aria-hidden]': 'feature() === \"focusable\" ? \"true\" : null',\n '[hidden]': 'feature() === \"fully-hidden\" ? true : null',\n '[attr.tabindex]': 'feature() === \"fully-hidden\" ? \"-1\" : null',\n '[style.position]': '\"absolute\"',\n '[style.border]': '\"0\"',\n '[style.width]': '\"1px\"',\n '[style.display]': 'feature() === \"focusable\" ? \"inline-block\" : \"none\"',\n '[style.height]': '\"1px\"',\n '[style.padding]': '\"0\"',\n '[style.margin]': '\"-1px\"',\n '[style.overflow]': '\"hidden\"',\n '[style.clip]': '\"rect(0, 0, 0, 0)\"',\n '[style.white-space]': '\"nowrap\"',\n '[style.word-wrap]': '\"normal\"'\n }\n})\nexport class RdxVisuallyHiddenDirective {\n readonly feature = input<'focusable' | 'fully-hidden'>('focusable');\n}\n","import { Directive, effect, ElementRef, inject, input } from '@angular/core';\nimport { RdxVisuallyHiddenDirective } from './visually-hidden.directive';\n\n/**\n *\n */\n@Directive({\n selector: '[rdxVisuallyHiddenInputBubble]',\n standalone: true,\n hostDirectives: [{ directive: RdxVisuallyHiddenDirective, inputs: ['feature: feature'] }],\n host: {\n '[attr.name]': 'name()',\n '[attr.required]': 'required()',\n '[attr.disabled]': 'disabled()',\n '[attr.checked]': 'checked()',\n '[value]': 'value()',\n '(change)': 'onChange()'\n }\n})\nexport class RdxVisuallyHiddenInputBubbleDirective<T> {\n private readonly elementRef = inject(ElementRef);\n\n readonly name = input<string>('');\n readonly value = input<T | null>(null);\n readonly checked = input<boolean | undefined>(undefined);\n readonly required = input<boolean | undefined>(undefined);\n readonly disabled = input<boolean | undefined>(undefined);\n readonly feature = input<string>('fully-hidden');\n\n constructor() {\n effect(() => {\n this.updateInputValue();\n });\n }\n\n protected onChange() {\n this.updateInputValue();\n }\n\n private updateInputValue() {\n let valueChanged = false;\n let checkedChanged = false;\n\n // Check if the value has changed before applying the update\n const currentValue = this.inputElement.value;\n const newValue = String(this.value());\n\n if (currentValue !== newValue) {\n this.inputElement.value = newValue;\n valueChanged = true;\n }\n\n if (this.inputElement.type === 'checkbox' || this.inputElement.type === 'radio') {\n const currentChecked = this.inputElement.checked;\n const newChecked = !!this.checked();\n\n if (currentChecked !== newChecked) {\n this.inputElement.checked = newChecked;\n checkedChanged = true;\n }\n }\n\n if (valueChanged || checkedChanged) {\n this.dispatchInputEvents();\n }\n }\n\n private get inputElement() {\n return this.elementRef.nativeElement;\n }\n\n private dispatchInputEvents() {\n const inputEvent = new Event('input', { bubbles: true });\n const changeEvent = new Event('change', { bubbles: true });\n\n this.inputElement.dispatchEvent(inputEvent);\n this.inputElement.dispatchEvent(changeEvent);\n }\n}\n","// Implementation from https://github.com/unovue/radix-vue\n\nimport { Directive, ElementRef, OnInit, computed, inject, input } from '@angular/core';\nimport { RdxVisuallyHiddenInputBubbleDirective } from './visually-hidden-input-bubble.directive';\n\n@Directive({\n selector: '[rdxVisuallyHiddenInput]',\n standalone: true,\n hostDirectives: [\n {\n directive: RdxVisuallyHiddenInputBubbleDirective,\n inputs: [\n 'feature: feature',\n 'name: name ',\n 'value: value',\n 'checked: checked',\n 'disabled: disabled',\n 'required: required'\n ]\n }\n ]\n})\nexport class RdxVisuallyHiddenInputDirective<T> implements OnInit {\n private readonly elementRef = inject(ElementRef);\n\n readonly name = input<string>('');\n readonly value = input<T | null>(null);\n readonly checked = input<boolean | undefined>(undefined);\n readonly required = input<boolean | undefined>(undefined);\n readonly disabled = input<boolean | undefined>(undefined);\n readonly feature = input<'focusable' | 'fully-hidden'>('fully-hidden');\n\n readonly parsedValue = computed<{ name: string; value: any }[]>(() => {\n const value = this.value();\n const name = this.name();\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n return [{ name, value }];\n }\n\n if (Array.isArray(value)) {\n return value.flatMap((obj, index) => {\n if (typeof obj === 'object') {\n return Object.entries(obj).map(([key, val]) => ({\n name: `[${name}][${index}][${key}]`,\n value: val\n }));\n } else {\n return { name: `[${name}][${index}]`, value: obj };\n }\n });\n }\n\n if (value !== null && typeof value === 'object') {\n return Object.entries(value).map(([key, val]) => ({\n name: `[${name}][${key}]`,\n value: val\n }));\n }\n\n return [];\n });\n\n ngOnInit() {\n const parsedValues = this.parsedValue();\n\n parsedValues.forEach((parsed) => {\n const inputElement = this.elementRef.nativeElement;\n inputElement.setAttribute('name', parsed.name);\n inputElement.setAttribute('value', parsed.value);\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.RdxVisuallyHiddenDirective","i1.RdxVisuallyHiddenInputBubbleDirective"],"mappings":";;;AAEA;;;;;;;;AAQG;MAqBU,0BAA0B,CAAA;AApBvC,IAAA,WAAA,GAAA;AAqBa,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAA+B,WAAW,CAAC,CAAC;AACvE,KAAA;8GAFY,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA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,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAAC,qCAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,EAAA,MAAA,EAAA,OAAA,EAAA,OAAA,EAAA,SAAA,EAAA,SAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAA/B,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAjB3C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,0BAA0B;AACpC,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,cAAc,EAAE;AACZ,wBAAA;AACI,4BAAA,SAAS,EAAE,qCAAqC;AAChD,4BAAA,MAAM,EAAE;gCACJ,kBAAkB;gCAClB,aAAa;gCACb,cAAc;gCACd,kBAAkB;gCAClB,oBAAoB;gCACpB,oBAAoB;AACvB,6BAAA;AACJ,yBAAA;AACJ,qBAAA;AACJ,iBAAA,CAAA;;;ACrBD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-ng/primitives",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -49,6 +49,12 @@
49
49
  "esm": "./esm2022/alert-dialog/radix-ng-primitives-alert-dialog.mjs",
50
50
  "default": "./fesm2022/radix-ng-primitives-alert-dialog.mjs"
51
51
  },
52
+ "./aspect-ratio": {
53
+ "types": "./aspect-ratio/index.d.ts",
54
+ "esm2022": "./esm2022/aspect-ratio/radix-ng-primitives-aspect-ratio.mjs",
55
+ "esm": "./esm2022/aspect-ratio/radix-ng-primitives-aspect-ratio.mjs",
56
+ "default": "./fesm2022/radix-ng-primitives-aspect-ratio.mjs"
57
+ },
52
58
  "./avatar": {
53
59
  "types": "./avatar/index.d.ts",
54
60
  "esm2022": "./esm2022/avatar/radix-ng-primitives-avatar.mjs",
@@ -73,6 +79,12 @@
73
79
  "esm": "./esm2022/context-menu/radix-ng-primitives-context-menu.mjs",
74
80
  "default": "./fesm2022/radix-ng-primitives-context-menu.mjs"
75
81
  },
82
+ "./core": {
83
+ "types": "./core/index.d.ts",
84
+ "esm2022": "./esm2022/core/radix-ng-primitives-core.mjs",
85
+ "esm": "./esm2022/core/radix-ng-primitives-core.mjs",
86
+ "default": "./fesm2022/radix-ng-primitives-core.mjs"
87
+ },
76
88
  "./dialog": {
77
89
  "types": "./dialog/index.d.ts",
78
90
  "esm2022": "./esm2022/dialog/radix-ng-primitives-dialog.mjs",
@@ -144,6 +156,12 @@
144
156
  "esm2022": "./esm2022/toggle-group/radix-ng-primitives-toggle-group.mjs",
145
157
  "esm": "./esm2022/toggle-group/radix-ng-primitives-toggle-group.mjs",
146
158
  "default": "./fesm2022/radix-ng-primitives-toggle-group.mjs"
159
+ },
160
+ "./visually-hidden": {
161
+ "types": "./visually-hidden/index.d.ts",
162
+ "esm2022": "./esm2022/visually-hidden/radix-ng-primitives-visually-hidden.mjs",
163
+ "esm": "./esm2022/visually-hidden/radix-ng-primitives-visually-hidden.mjs",
164
+ "default": "./fesm2022/radix-ng-primitives-visually-hidden.mjs"
147
165
  }
148
166
  }
149
167
  }
@@ -61,8 +61,8 @@ export declare class RdxRadioGroupDirective implements RadioGroupProps, RadioGro
61
61
  /**
62
62
  * When focus leaves the radio group.
63
63
  */
64
- _onFocusin(event: FocusEvent): void;
65
- _onKeydown(event: KeyboardEvent): void;
64
+ protected onFocusin(event: FocusEvent): void;
65
+ protected onKeydown(event: KeyboardEvent): void;
66
66
  private selectFocusedItem;
67
67
  private updateActiveItem;
68
68
  private tabNavigation;
@@ -1,3 +1,4 @@
1
+ import { BooleanInput } from '@angular/cdk/coercion';
1
2
  import * as i0 from "@angular/core";
2
3
  declare const ORIENTATIONS: readonly ["horizontal", "vertical"];
3
4
  export type Orientation = (typeof ORIENTATIONS)[number];
@@ -12,11 +13,34 @@ export interface SeparatorProps {
12
13
  */
13
14
  decorative?: boolean;
14
15
  }
15
- export declare class RdxSeparatorRootDirective implements SeparatorProps {
16
- orientation: Orientation;
17
- decorative: boolean;
16
+ /**
17
+ * Directive that adds accessible and configurable separator element to the DOM.
18
+ * This can be either horizontal or vertical and optionally decorative (which removes
19
+ * it from the accessibility tree).
20
+ */
21
+ export declare class RdxSeparatorRootDirective {
22
+ /**
23
+ * Orientation of the separator, can be either 'horizontal' or 'vertical'.
24
+ * Defaults to 'horizontal'.
25
+ */
26
+ readonly orientation: import("@angular/core").InputSignal<"horizontal" | "vertical">;
27
+ /**
28
+ * If true, the separator will be considered decorative and removed from
29
+ * the accessibility tree. Defaults to false.
30
+ */
31
+ readonly decorative: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
32
+ /**
33
+ * Computes the `role` attribute for the separator. If `decorative` is true,
34
+ * the role is set to "none", otherwise it is "separator".
35
+ */
36
+ protected readonly computedRole: import("@angular/core").Signal<"none" | "separator">;
37
+ /**
38
+ * Computes the `aria-orientation` attribute. It is set to "vertical" only if
39
+ * the separator is not decorative and the orientation is set to "vertical".
40
+ * For horizontal orientation, the attribute is omitted.
41
+ */
42
+ protected readonly computedAriaOrientation: import("@angular/core").Signal<"vertical" | null>;
18
43
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxSeparatorRootDirective, never>;
19
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxSeparatorRootDirective, "div[rdxSeparatorRoot]", never, { "orientation": { "alias": "orientation"; "required": false; }; "decorative": { "alias": "decorative"; "required": false; }; }, {}, never, never, true, never>;
20
- static ngAcceptInputType_decorative: unknown;
44
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxSeparatorRootDirective, "div[rdxSeparatorRoot]", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "decorative": { "alias": "decorative"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
21
45
  }
22
46
  export {};
@@ -1,6 +1,5 @@
1
1
  import { BooleanInput } from '@angular/cdk/coercion';
2
- import { EventEmitter, InjectionToken, InputSignalWithTransform, ModelSignal } from '@angular/core';
3
- import { ControlValueAccessor } from '@angular/forms';
2
+ import { InjectionToken, InputSignalWithTransform, ModelSignal, OutputEmitterRef } from '@angular/core';
4
3
  import * as i0 from "@angular/core";
5
4
  export declare const RdxSwitchToken: InjectionToken<RdxSwitchRootDirective>;
6
5
  export declare function injectSwitch(): RdxSwitchRootDirective;
@@ -8,39 +7,28 @@ export interface SwitchProps {
8
7
  checked?: ModelSignal<boolean>;
9
8
  defaultChecked?: boolean;
10
9
  required?: InputSignalWithTransform<boolean, BooleanInput>;
11
- onCheckedChange?: EventEmitter<boolean>;
10
+ onCheckedChange?: OutputEmitterRef<boolean>;
12
11
  }
13
- export declare class RdxSwitchRootDirective implements SwitchProps, ControlValueAccessor {
12
+ export declare class RdxSwitchRootDirective implements SwitchProps {
14
13
  readonly id: import("@angular/core").InputSignal<string>;
15
14
  protected readonly elementId: import("@angular/core").Signal<string | null>;
16
- readonly required: InputSignalWithTransform<boolean, BooleanInput>;
17
- readonly checked: ModelSignal<boolean>;
18
- readonly disabled: InputSignalWithTransform<boolean, BooleanInput>;
19
- readonly disabledState: import("@angular/core").Signal<boolean>;
20
- onCheckedChange: EventEmitter<boolean>;
21
- /**
22
- * The method to be called in order to update ngModel.
23
- */
24
- _onChange?: (checked: boolean) => void;
25
15
  /**
26
- * onTouch function registered via registerOnTouch (ControlValueAccessor).
16
+ * When true, indicates that the user must check the switch before the owning form can be submitted.
27
17
  */
28
- _onTouched?: () => void;
18
+ readonly required: InputSignalWithTransform<boolean, BooleanInput>;
29
19
  /**
30
- * Registers a function to call when the checked state changes.
31
- * @param fn Function to call on change.
20
+ * The controlled state of the switch. Must be used in conjunction with onCheckedChange.
32
21
  */
33
- registerOnChange(fn: (checked: boolean) => void): void;
22
+ readonly checked: ModelSignal<boolean>;
34
23
  /**
35
- * Registers a function to call when the component is touched.
36
- * @param fn Function to call on touch.
24
+ * When true, prevents the user from interacting with the switch.
37
25
  */
38
- registerOnTouched(fn: () => void): void;
26
+ readonly disabled: InputSignalWithTransform<boolean, BooleanInput>;
27
+ readonly disabledState: import("@angular/core").Signal<boolean>;
39
28
  /**
40
- * Writes a new value to the model.
41
- * @param checked The new checked value.
29
+ * Event handler called when the state of the switch changes.
42
30
  */
43
- writeValue(checked: boolean): void;
31
+ readonly onCheckedChange: OutputEmitterRef<boolean>;
44
32
  /**
45
33
  * Toggles the checked state of the switch.
46
34
  * If the switch is disabled, the function returns early.
@@ -1,4 +1,5 @@
1
- import { EventEmitter } from '@angular/core';
1
+ import { BooleanInput } from '@angular/cdk/coercion';
2
+ import { OutputEmitterRef } from '@angular/core';
2
3
  import * as i0 from "@angular/core";
3
4
  export interface ToggleProps {
4
5
  /**
@@ -14,17 +15,33 @@ export interface ToggleProps {
14
15
  /**
15
16
  * The callback that fires when the state of the toggle changes.
16
17
  */
17
- onPressedChange?: EventEmitter<boolean>;
18
+ onPressedChange?: OutputEmitterRef<boolean>;
19
+ /**
20
+ * Whether the toggle is disabled.
21
+ * @defaultValue false
22
+ */
23
+ disabled?: boolean;
18
24
  }
19
25
  export declare class RdxToggleDirective {
20
- readonly defaultPressed: import("@angular/core").InputSignal<boolean>;
26
+ /**
27
+ * The pressed state of the toggle when it is initially rendered.
28
+ * Use when you do not need to control its pressed state.
29
+ */
30
+ readonly defaultPressed: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
31
+ /**
32
+ * The controlled pressed state of the toggle.
33
+ * Must be used in conjunction with `onPressedChange`.
34
+ */
21
35
  readonly pressed: import("@angular/core").ModelSignal<boolean>;
22
- readonly disabled: import("@angular/core").InputSignal<boolean>;
23
36
  /**
24
- * Event emitted when the toggle is pressed.
37
+ * When true, prevents the user from interacting with the toggle.
38
+ */
39
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, BooleanInput>;
40
+ /**
41
+ * Event handler called when the pressed state of the toggle changes.
25
42
  */
26
- readonly onPressedChange: EventEmitter<boolean>;
43
+ readonly onPressedChange: OutputEmitterRef<boolean>;
27
44
  protected toggle(): void;
28
45
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxToggleDirective, never>;
29
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleDirective, "button[rdxToggle]", ["rdxToggle"], { "defaultPressed": { "alias": "defaultPressed"; "required": false; "isSignal": true; }; "pressed": { "alias": "pressed"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "pressed": "pressedChange"; "onPressedChange": "onPressedChange"; }, never, never, true, never>;
46
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleDirective, "[rdxToggle]", ["rdxToggle"], { "defaultPressed": { "alias": "defaultPressed"; "required": false; "isSignal": true; }; "pressed": { "alias": "pressed"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "pressed": "pressedChange"; "onPressedChange": "onPressedChange"; }, never, never, true, never>;
30
47
  }
@@ -1,5 +1,5 @@
1
- export * from './src/toggle-group-button.directive';
2
- export * from './src/toggle-group-button.token';
3
- export * from './src/toggle-group-multi.directive';
1
+ export * from './src/toggle-group-item.directive';
2
+ export * from './src/toggle-group-item.token';
3
+ export * from './src/toggle-group-multiple.directive';
4
4
  export * from './src/toggle-group.directive';
5
5
  export * from './src/toggle-group.token';
@@ -1,11 +1,13 @@
1
+ import { FocusableOption } from '@angular/cdk/a11y';
1
2
  import { OnChanges, SimpleChanges } from '@angular/core';
2
3
  import * as i0 from "@angular/core";
3
- export declare class RdxToggleGroupButtonDirective implements OnChanges {
4
+ export declare class RdxToggleGroupItemDirective implements OnChanges, FocusableOption {
4
5
  /**
5
6
  * Access the toggle group.
6
7
  * @ignore
7
8
  */
8
- protected readonly toggleGroup: import("@radix-ng/primitives/toggle-group").RdxToggleGroupDirective | import("@radix-ng/primitives/toggle-group").RdxToggleGroupMultiDirective;
9
+ protected readonly toggleGroup: import("@radix-ng/primitives/toggle-group").RdxToggleGroupDirective | import("@radix-ng/primitives/toggle-group").RdxToggleGroupMultipleDirective;
10
+ private readonly elementRef;
9
11
  /**
10
12
  * The value of this toggle button.
11
13
  */
@@ -23,6 +25,10 @@ export declare class RdxToggleGroupButtonDirective implements OnChanges {
23
25
  * @ignore
24
26
  */
25
27
  ngOnChanges(changes: SimpleChanges): void;
28
+ /**
29
+ * @ignore
30
+ */
31
+ focus(): void;
26
32
  /**
27
33
  * @ignore
28
34
  */
@@ -33,7 +39,7 @@ export declare class RdxToggleGroupButtonDirective implements OnChanges {
33
39
  * @ignore
34
40
  */
35
41
  updateDisabled(): void;
36
- static ɵfac: i0.ɵɵFactoryDeclaration<RdxToggleGroupButtonDirective, never>;
37
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleGroupButtonDirective, "button[rdxToggleGroupButton]", never, { "value": { "alias": "value"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxToggleGroupItemDirective, never>;
43
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleGroupItemDirective, "[rdxToggleGroupItem]", ["rdxToggleGroupItem"], { "value": { "alias": "value"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
38
44
  static ngAcceptInputType_disabled: unknown;
39
45
  }
@@ -0,0 +1,3 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import type { RdxToggleGroupItemDirective } from './toggle-group-item.directive';
3
+ export declare const RdxToggleGroupItemToken: InjectionToken<RdxToggleGroupItemDirective>;
@@ -1,8 +1,8 @@
1
1
  import { AfterContentInit, EventEmitter, OnChanges, QueryList, SimpleChanges } from '@angular/core';
2
2
  import { ControlValueAccessor } from '@angular/forms';
3
- import type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';
3
+ import type { RdxToggleGroupItemDirective } from './toggle-group-item.directive';
4
4
  import * as i0 from "@angular/core";
5
- export declare class RdxToggleGroupMultiDirective implements OnChanges, AfterContentInit, ControlValueAccessor {
5
+ export declare class RdxToggleGroupMultipleDirective implements OnChanges, AfterContentInit, ControlValueAccessor {
6
6
  /**
7
7
  * The selected toggle button.
8
8
  */
@@ -30,7 +30,11 @@ export declare class RdxToggleGroupMultiDirective implements OnChanges, AfterCon
30
30
  * Access the buttons in the toggle group.
31
31
  * @ignore
32
32
  */
33
- protected buttons?: QueryList<RdxToggleGroupButtonDirective>;
33
+ protected buttons?: QueryList<RdxToggleGroupItemDirective>;
34
+ /**
35
+ * FocusKeyManager to manage keyboard interactions.
36
+ */
37
+ private keyManager;
34
38
  /**
35
39
  * The value change callback.
36
40
  * @ignore
@@ -49,6 +53,8 @@ export declare class RdxToggleGroupMultiDirective implements OnChanges, AfterCon
49
53
  * @ignore
50
54
  */
51
55
  ngAfterContentInit(): void;
56
+ protected onFocusIn(): void;
57
+ protected handleKeydown(event: KeyboardEvent): void;
52
58
  /**
53
59
  * Determine if a value is selected.
54
60
  * @param value The value to check.
@@ -86,8 +92,8 @@ export declare class RdxToggleGroupMultiDirective implements OnChanges, AfterCon
86
92
  * @ignore
87
93
  */
88
94
  setDisabledState(isDisabled: boolean): void;
89
- static ɵfac: i0.ɵɵFactoryDeclaration<RdxToggleGroupMultiDirective, never>;
90
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleGroupMultiDirective, "[rdxToggleGroupMulti]", never, { "value": { "alias": "rdxToggleGroupMultiValue"; "required": false; }; "orientation": { "alias": "rdxToggleGroupMultiOrientation"; "required": false; }; "disabled": { "alias": "rdxToggleGroupMultiDisabled"; "required": false; }; "wrap": { "alias": "rdxToggleGroupMultiWrap"; "required": false; }; "valueChange": { "alias": "rdxToggleGroupMultiValueChange"; "required": false; }; }, {}, ["buttons"], never, true, never>;
95
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxToggleGroupMultipleDirective, never>;
96
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleGroupMultipleDirective, "[rdxToggleGroupMultiple]", ["rdxToggleGroupMultiple"], { "value": { "alias": "value"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "wrap": { "alias": "wrap"; "required": false; }; "valueChange": { "alias": "valueChange"; "required": false; }; }, {}, ["buttons"], never, true, never>;
91
97
  static ngAcceptInputType_disabled: unknown;
92
98
  static ngAcceptInputType_wrap: unknown;
93
99
  }
@@ -1,6 +1,6 @@
1
1
  import { AfterContentInit, EventEmitter, OnChanges, QueryList, SimpleChanges } from '@angular/core';
2
2
  import { ControlValueAccessor } from '@angular/forms';
3
- import type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';
3
+ import type { RdxToggleGroupItemDirective } from './toggle-group-item.directive';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class RdxToggleGroupDirective implements OnChanges, AfterContentInit, ControlValueAccessor {
6
6
  /**
@@ -29,7 +29,11 @@ export declare class RdxToggleGroupDirective implements OnChanges, AfterContentI
29
29
  /**
30
30
  * Access the buttons in the toggle group.
31
31
  */
32
- protected buttons?: QueryList<RdxToggleGroupButtonDirective>;
32
+ protected buttons?: QueryList<RdxToggleGroupItemDirective>;
33
+ /**
34
+ * FocusKeyManager to manage keyboard interactions.
35
+ */
36
+ private keyManager;
33
37
  /**
34
38
  * The value change callback.
35
39
  */
@@ -40,6 +44,8 @@ export declare class RdxToggleGroupDirective implements OnChanges, AfterContentI
40
44
  protected onTouched?: () => void;
41
45
  ngOnChanges(changes: SimpleChanges): void;
42
46
  ngAfterContentInit(): void;
47
+ protected onFocusIn(): void;
48
+ protected handleKeydown(event: KeyboardEvent): void;
43
49
  /**
44
50
  * Determine if a value is selected.
45
51
  * @param value The value to check.
@@ -78,7 +84,7 @@ export declare class RdxToggleGroupDirective implements OnChanges, AfterContentI
78
84
  */
79
85
  setDisabledState(isDisabled: boolean): void;
80
86
  static ɵfac: i0.ɵɵFactoryDeclaration<RdxToggleGroupDirective, never>;
81
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleGroupDirective, "[rdxToggleGroup]", never, { "value": { "alias": "value"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "wrap": { "alias": "wrap"; "required": false; }; "valueChange": { "alias": "valueChange"; "required": false; }; }, {}, ["buttons"], never, true, never>;
87
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleGroupDirective, "[rdxToggleGroup]", ["rdxToggleGroup"], { "value": { "alias": "value"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "wrap": { "alias": "wrap"; "required": false; }; "valueChange": { "alias": "valueChange"; "required": false; }; }, {}, ["buttons"], never, true, never>;
82
88
  static ngAcceptInputType_disabled: unknown;
83
89
  static ngAcceptInputType_wrap: unknown;
84
90
  }
@@ -1,5 +1,5 @@
1
1
  import { InjectionToken } from '@angular/core';
2
- import type { RdxToggleGroupMultiDirective } from './toggle-group-multi.directive';
2
+ import type { RdxToggleGroupMultipleDirective } from './toggle-group-multiple.directive';
3
3
  import type { RdxToggleGroupDirective } from './toggle-group.directive';
4
- export declare const RdxToggleGroupToken: InjectionToken<RdxToggleGroupDirective | RdxToggleGroupMultiDirective>;
5
- export declare function injectToggleGroup(): RdxToggleGroupDirective | RdxToggleGroupMultiDirective;
4
+ export declare const RdxToggleGroupToken: InjectionToken<RdxToggleGroupDirective | RdxToggleGroupMultipleDirective>;
5
+ export declare function injectToggleGroup(): RdxToggleGroupDirective | RdxToggleGroupMultipleDirective;
@@ -0,0 +1,3 @@
1
+ # @radix-ng/primitives/visually-hidden
2
+
3
+ Secondary entry point of `@radix-ng/primitives`. It can be used by importing from `@radix-ng/primitives/visually-hidden`.
@@ -0,0 +1,3 @@
1
+ export * from './src/visually-hidden-input-bubble.directive';
2
+ export * from './src/visually-hidden-input.directive';
3
+ export * from './src/visually-hidden.directive';
@@ -0,0 +1,21 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./visually-hidden.directive";
3
+ /**
4
+ *
5
+ */
6
+ export declare class RdxVisuallyHiddenInputBubbleDirective<T> {
7
+ private readonly elementRef;
8
+ readonly name: import("@angular/core").InputSignal<string>;
9
+ readonly value: import("@angular/core").InputSignal<T | null>;
10
+ readonly checked: import("@angular/core").InputSignal<boolean | undefined>;
11
+ readonly required: import("@angular/core").InputSignal<boolean | undefined>;
12
+ readonly disabled: import("@angular/core").InputSignal<boolean | undefined>;
13
+ readonly feature: import("@angular/core").InputSignal<string>;
14
+ constructor();
15
+ protected onChange(): void;
16
+ private updateInputValue;
17
+ private get inputElement();
18
+ private dispatchInputEvents;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxVisuallyHiddenInputBubbleDirective<any>, never>;
20
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxVisuallyHiddenInputBubbleDirective<any>, "[rdxVisuallyHiddenInputBubble]", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "feature": { "alias": "feature"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.RdxVisuallyHiddenDirective; inputs: { "feature": "feature"; }; outputs: {}; }]>;
21
+ }