@radix-ng/primitives 0.50.0 → 1.0.0-beta.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 (207) hide show
  1. package/collection/README.md +1 -0
  2. package/fesm2022/radix-ng-primitives-accordion.mjs +134 -66
  3. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  4. package/fesm2022/radix-ng-primitives-alert-dialog.mjs +224 -132
  5. package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
  6. package/fesm2022/radix-ng-primitives-arrow.mjs +26 -10
  7. package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
  8. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +6 -6
  9. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
  10. package/fesm2022/radix-ng-primitives-avatar.mjs +68 -75
  11. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  12. package/fesm2022/radix-ng-primitives-button.mjs +123 -0
  13. package/fesm2022/radix-ng-primitives-button.mjs.map +1 -0
  14. package/fesm2022/radix-ng-primitives-calendar.mjs +104 -103
  15. package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
  16. package/fesm2022/radix-ng-primitives-checkbox.mjs +414 -80
  17. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  18. package/fesm2022/radix-ng-primitives-collapsible.mjs +193 -92
  19. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  20. package/fesm2022/radix-ng-primitives-collection.mjs +72 -0
  21. package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -0
  22. package/fesm2022/radix-ng-primitives-config.mjs +5 -5
  23. package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
  24. package/fesm2022/radix-ng-primitives-context-menu.mjs +143 -427
  25. package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
  26. package/fesm2022/radix-ng-primitives-core.mjs +757 -757
  27. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  28. package/fesm2022/radix-ng-primitives-cropper.mjs +55 -53
  29. package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
  30. package/fesm2022/radix-ng-primitives-date-field.mjs +93 -86
  31. package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
  32. package/fesm2022/radix-ng-primitives-dialog.mjs +658 -330
  33. package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
  34. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +98 -76
  35. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
  36. package/fesm2022/radix-ng-primitives-drawer.mjs +1059 -0
  37. package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -0
  38. package/fesm2022/radix-ng-primitives-editable.mjs +20 -20
  39. package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
  40. package/fesm2022/radix-ng-primitives-field.mjs +363 -0
  41. package/fesm2022/radix-ng-primitives-field.mjs.map +1 -0
  42. package/fesm2022/radix-ng-primitives-fieldset.mjs +79 -0
  43. package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -0
  44. package/fesm2022/radix-ng-primitives-focus-guards.mjs +3 -3
  45. package/fesm2022/radix-ng-primitives-focus-guards.mjs.map +1 -1
  46. package/fesm2022/radix-ng-primitives-focus-scope.mjs +29 -14
  47. package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
  48. package/fesm2022/radix-ng-primitives-input.mjs +172 -0
  49. package/fesm2022/radix-ng-primitives-input.mjs.map +1 -0
  50. package/fesm2022/radix-ng-primitives-label.mjs +11 -11
  51. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  52. package/fesm2022/radix-ng-primitives-menu.mjs +1484 -353
  53. package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
  54. package/fesm2022/radix-ng-primitives-menubar.mjs +290 -162
  55. package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
  56. package/fesm2022/radix-ng-primitives-meter.mjs +271 -0
  57. package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -0
  58. package/fesm2022/radix-ng-primitives-navigation-menu.mjs +1060 -1553
  59. package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
  60. package/fesm2022/radix-ng-primitives-number-field.mjs +1102 -366
  61. package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
  62. package/fesm2022/radix-ng-primitives-pagination.mjs +51 -51
  63. package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
  64. package/fesm2022/radix-ng-primitives-popover.mjs +980 -995
  65. package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
  66. package/fesm2022/radix-ng-primitives-popper.mjs +137 -82
  67. package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
  68. package/fesm2022/radix-ng-primitives-portal.mjs +40 -16
  69. package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
  70. package/fesm2022/radix-ng-primitives-presence.mjs +134 -246
  71. package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
  72. package/fesm2022/radix-ng-primitives-preview-card.mjs +997 -0
  73. package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -0
  74. package/fesm2022/radix-ng-primitives-progress.mjs +231 -92
  75. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  76. package/fesm2022/radix-ng-primitives-radio.mjs +211 -70
  77. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  78. package/fesm2022/radix-ng-primitives-roving-focus.mjs +127 -77
  79. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
  80. package/fesm2022/radix-ng-primitives-select.mjs +791 -511
  81. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  82. package/fesm2022/radix-ng-primitives-separator.mjs +16 -45
  83. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  84. package/fesm2022/radix-ng-primitives-slider.mjs +976 -720
  85. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  86. package/fesm2022/radix-ng-primitives-stepper.mjs +69 -71
  87. package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
  88. package/fesm2022/radix-ng-primitives-switch.mjs +128 -124
  89. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  90. package/fesm2022/radix-ng-primitives-tabs.mjs +388 -115
  91. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  92. package/fesm2022/radix-ng-primitives-time-field.mjs +111 -117
  93. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
  94. package/fesm2022/radix-ng-primitives-toggle-group.mjs +122 -248
  95. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  96. package/fesm2022/radix-ng-primitives-toggle.mjs +99 -62
  97. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  98. package/fesm2022/radix-ng-primitives-toolbar.mjs +307 -94
  99. package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
  100. package/fesm2022/radix-ng-primitives-tooltip.mjs +690 -1079
  101. package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
  102. package/fesm2022/radix-ng-primitives-visually-hidden.mjs +46 -87
  103. package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
  104. package/fesm2022/radix-ng-primitives.mjs.map +1 -1
  105. package/meter/README.md +3 -0
  106. package/navigation-menu/README.md +2 -1
  107. package/package.json +85 -63
  108. package/portal/README.md +2 -0
  109. package/preview-card/README.md +3 -0
  110. package/schematics/collection.json +1 -0
  111. package/schematics/ng-add/index.d.ts +3 -2
  112. package/schematics/ng-add/index.js +62 -31
  113. package/schematics/ng-add/index.js.map +1 -1
  114. package/schematics/ng-add/package-config.d.ts +4 -2
  115. package/schematics/ng-add/package-config.js +10 -2
  116. package/schematics/ng-add/package-config.js.map +1 -1
  117. package/schematics/ng-add/schema.d.ts +3 -0
  118. package/schematics/ng-add/schema.js +3 -0
  119. package/schematics/ng-add/schema.js.map +1 -0
  120. package/schematics/ng-add/schema.json +14 -0
  121. package/select/README.md +2 -0
  122. package/{accordion/index.d.ts → types/radix-ng-primitives-accordion.d.ts} +102 -67
  123. package/types/radix-ng-primitives-alert-dialog.d.ts +114 -0
  124. package/{arrow/index.d.ts → types/radix-ng-primitives-arrow.d.ts} +1 -1
  125. package/{aspect-ratio/index.d.ts → types/radix-ng-primitives-aspect-ratio.d.ts} +1 -1
  126. package/{avatar/index.d.ts → types/radix-ng-primitives-avatar.d.ts} +7 -11
  127. package/types/radix-ng-primitives-button.d.ts +73 -0
  128. package/{calendar/index.d.ts → types/radix-ng-primitives-calendar.d.ts} +2 -3
  129. package/types/radix-ng-primitives-checkbox.d.ts +337 -0
  130. package/types/radix-ng-primitives-collapsible.d.ts +159 -0
  131. package/types/radix-ng-primitives-collection.d.ts +44 -0
  132. package/{config/index.d.ts → types/radix-ng-primitives-config.d.ts} +1 -1
  133. package/types/radix-ng-primitives-context-menu.d.ts +73 -0
  134. package/{core/index.d.ts → types/radix-ng-primitives-core.d.ts} +311 -236
  135. package/{cropper/index.d.ts → types/radix-ng-primitives-cropper.d.ts} +6 -5
  136. package/{date-field/index.d.ts → types/radix-ng-primitives-date-field.d.ts} +42 -27
  137. package/types/radix-ng-primitives-dialog.d.ts +323 -0
  138. package/{dismissable-layer/index.d.ts → types/radix-ng-primitives-dismissable-layer.d.ts} +15 -7
  139. package/types/radix-ng-primitives-drawer.d.ts +448 -0
  140. package/{editable/index.d.ts → types/radix-ng-primitives-editable.d.ts} +1 -1
  141. package/types/radix-ng-primitives-field.d.ts +373 -0
  142. package/types/radix-ng-primitives-fieldset.d.ts +48 -0
  143. package/{focus-scope/index.d.ts → types/radix-ng-primitives-focus-scope.d.ts} +13 -5
  144. package/types/radix-ng-primitives-input.d.ts +87 -0
  145. package/{label/index.d.ts → types/radix-ng-primitives-label.d.ts} +0 -1
  146. package/types/radix-ng-primitives-menu.d.ts +612 -0
  147. package/types/radix-ng-primitives-menubar.d.ts +66 -0
  148. package/types/radix-ng-primitives-meter.d.ts +193 -0
  149. package/types/radix-ng-primitives-navigation-menu.d.ts +488 -0
  150. package/types/radix-ng-primitives-number-field.d.ts +464 -0
  151. package/{pagination/index.d.ts → types/radix-ng-primitives-pagination.d.ts} +2 -2
  152. package/types/radix-ng-primitives-popover.d.ts +416 -0
  153. package/{popper/index.d.ts → types/radix-ng-primitives-popper.d.ts} +50 -9
  154. package/types/radix-ng-primitives-portal.d.ts +30 -0
  155. package/types/radix-ng-primitives-presence.d.ts +55 -0
  156. package/types/radix-ng-primitives-preview-card.d.ts +359 -0
  157. package/types/radix-ng-primitives-progress.d.ts +206 -0
  158. package/{radio/index.d.ts → types/radix-ng-primitives-radio.d.ts} +56 -26
  159. package/{roving-focus/index.d.ts → types/radix-ng-primitives-roving-focus.d.ts} +38 -27
  160. package/types/radix-ng-primitives-select.d.ts +512 -0
  161. package/types/radix-ng-primitives-separator.d.ts +38 -0
  162. package/types/radix-ng-primitives-slider.d.ts +377 -0
  163. package/{stepper/index.d.ts → types/radix-ng-primitives-stepper.d.ts} +21 -22
  164. package/types/radix-ng-primitives-switch.d.ts +121 -0
  165. package/types/radix-ng-primitives-tabs.d.ts +247 -0
  166. package/{time-field/index.d.ts → types/radix-ng-primitives-time-field.d.ts} +46 -31
  167. package/types/radix-ng-primitives-toggle-group.d.ts +116 -0
  168. package/types/radix-ng-primitives-toggle.d.ts +65 -0
  169. package/types/radix-ng-primitives-toolbar.d.ts +180 -0
  170. package/types/radix-ng-primitives-tooltip.d.ts +395 -0
  171. package/{visually-hidden/index.d.ts → types/radix-ng-primitives-visually-hidden.d.ts} +19 -19
  172. package/alert-dialog/index.d.ts +0 -57
  173. package/checkbox/index.d.ts +0 -164
  174. package/collapsible/index.d.ts +0 -85
  175. package/context-menu/index.d.ts +0 -129
  176. package/dialog/index.d.ts +0 -205
  177. package/dropdown-menu/README.md +0 -1
  178. package/dropdown-menu/index.d.ts +0 -171
  179. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +0 -583
  180. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +0 -1
  181. package/fesm2022/radix-ng-primitives-hover-card.mjs +0 -1246
  182. package/fesm2022/radix-ng-primitives-hover-card.mjs.map +0 -1
  183. package/fesm2022/radix-ng-primitives-tooltip2.mjs +0 -740
  184. package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +0 -1
  185. package/hover-card/README.md +0 -3
  186. package/hover-card/index.d.ts +0 -472
  187. package/menu/index.d.ts +0 -139
  188. package/menubar/index.d.ts +0 -56
  189. package/navigation-menu/index.d.ts +0 -405
  190. package/number-field/index.d.ts +0 -203
  191. package/popover/index.d.ts +0 -403
  192. package/portal/index.d.ts +0 -22
  193. package/presence/index.d.ts +0 -103
  194. package/progress/index.d.ts +0 -79
  195. package/select/index.d.ts +0 -214
  196. package/separator/index.d.ts +0 -63
  197. package/slider/index.d.ts +0 -263
  198. package/switch/index.d.ts +0 -105
  199. package/tabs/index.d.ts +0 -112
  200. package/toggle/index.d.ts +0 -75
  201. package/toggle-group/index.d.ts +0 -194
  202. package/toolbar/index.d.ts +0 -55
  203. package/tooltip/index.d.ts +0 -433
  204. package/tooltip2/README.md +0 -3
  205. package/tooltip2/index.d.ts +0 -325
  206. /package/{focus-guards/index.d.ts → types/radix-ng-primitives-focus-guards.d.ts} +0 -0
  207. /package/{index.d.ts → types/radix-ng-primitives.d.ts} +0 -0
@@ -1,105 +1,140 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, input, booleanAttribute, model, Directive, NgModule } from '@angular/core';
3
- import { _IdGenerator } from '@angular/cdk/a11y';
4
- import { outputFromObservable, outputToObservable } from '@angular/core/rxjs-interop';
2
+ import { Directive, inject, computed, input, booleanAttribute, model, output, NgModule } from '@angular/core';
5
3
  import * as i1 from '@radix-ng/primitives/core';
6
- import { createContext, injectControlValueAccessor, RdxControlValueAccessor } from '@radix-ng/primitives/core';
4
+ import { createContext, injectControlValueAccessor, injectId, RdxControlValueAccessor } from '@radix-ng/primitives/core';
7
5
 
8
- const [injectSwitchRootContext, provideSwitchRootContext] = createContext('Switch');
9
- const rootContext = () => {
10
- const instance = inject(RdxSwitchRootDirective);
6
+ const [injectSwitchContext, provideSwitchContext] = createContext('RdxSwitchContext');
7
+
8
+ /**
9
+ * The hidden native checkbox that mirrors the switch state for form submission and screen readers.
10
+ *
11
+ * @see https://base-ui.com/react/components/switch
12
+ */
13
+ class RdxSwitchInput {
14
+ constructor() {
15
+ this.rootContext = injectSwitchContext();
16
+ }
17
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSwitchInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
18
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxSwitchInput, isStandalone: true, selector: "input[rdxSwitchInput]", host: { attributes: { "type": "checkbox", "tabindex": "-1", "aria-hidden": "true" }, listeners: { "blur": "rootContext.markAsTouched()" }, properties: { "attr.name": "rootContext.name()", "attr.value": "rootContext.value()", "checked": "rootContext.checked()", "disabled": "rootContext.disabled()", "attr.required": "rootContext.required() ? \"\" : undefined", "attr.aria-label": "rootContext.ariaLabel()", "attr.aria-labelledby": "rootContext.ariaLabelledBy()", "attr.data-checked": "rootContext.checked() ? \"\" : undefined", "attr.data-unchecked": "rootContext.checked() ? undefined : \"\"" }, styleAttribute: "transform: translateX(-100%); position: absolute; overflow: hidden; pointer-events: none; opacity: 0; margin: 0;" }, exportAs: ["rdxSwitchInput"], ngImport: i0 }); }
19
+ }
20
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSwitchInput, decorators: [{
21
+ type: Directive,
22
+ args: [{
23
+ selector: 'input[rdxSwitchInput]',
24
+ exportAs: 'rdxSwitchInput',
25
+ host: {
26
+ type: 'checkbox',
27
+ tabindex: '-1',
28
+ 'aria-hidden': 'true',
29
+ '[attr.name]': 'rootContext.name()',
30
+ '[attr.value]': 'rootContext.value()',
31
+ '[checked]': 'rootContext.checked()',
32
+ '[disabled]': 'rootContext.disabled()',
33
+ '[attr.required]': 'rootContext.required() ? "" : undefined',
34
+ '[attr.aria-label]': 'rootContext.ariaLabel()',
35
+ '[attr.aria-labelledby]': 'rootContext.ariaLabelledBy()',
36
+ '[attr.data-checked]': 'rootContext.checked() ? "" : undefined',
37
+ '[attr.data-unchecked]': 'rootContext.checked() ? undefined : ""',
38
+ style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointer-events: none; opacity: 0; margin: 0;',
39
+ '(blur)': 'rootContext.markAsTouched()'
40
+ }
41
+ }]
42
+ }] });
43
+
44
+ const context = () => {
45
+ const root = inject(RdxSwitchRoot);
11
46
  const cva = injectControlValueAccessor();
12
47
  return {
13
- required: instance.required,
14
- value: instance.checked,
15
- checked: cva.value,
16
- disabled: cva.disabled,
17
- ariaLabel: instance.ariaLabel,
18
- ariaLabelledBy: instance.ariaLabelledBy,
19
- markAsTouched: () => cva.markAsTouched(),
20
- toggle: () => instance.toggle()
48
+ checked: root.checkedState,
49
+ disabled: computed(() => !!cva.disabled()),
50
+ readonly: root.readonly,
51
+ required: root.required,
52
+ name: root.name,
53
+ value: root.submitValue,
54
+ ariaLabel: root.ariaLabel,
55
+ ariaLabelledBy: root.ariaLabelledBy,
56
+ markAsTouched: () => cva.markAsTouched()
21
57
  };
22
58
  };
23
59
  /**
24
- * @group Components
60
+ * A control that toggles between on and off.
61
+ *
62
+ * @see https://base-ui.com/react/components/switch
25
63
  */
26
- class RdxSwitchRootDirective {
64
+ class RdxSwitchRoot {
27
65
  constructor() {
66
+ /** @ignore */
28
67
  this.cva = injectControlValueAccessor();
29
- this.id = input(inject(_IdGenerator).getId('rdx-switch-'), ...(ngDevMode ? [{ debugName: "id" }] : []));
68
+ this.id = input(injectId('rdx-switch-'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
30
69
  /**
31
- * When true, indicates that the user must check the switch before the owning form can be submitted.
70
+ * The state of the switch when it is initially rendered. Use when you do not need to control its state.
32
71
  *
33
72
  * @default false
34
- * @group Props
35
- */
36
- this.required = input(false, ...(ngDevMode ? [{ debugName: "required", transform: booleanAttribute }] : [{
37
- transform: booleanAttribute
38
- }]));
39
- /**
40
- * Establishes relationships between the component and label(s) where its value should be one or more element IDs.
41
- * @default null
42
- * @group Props
43
73
  */
44
- this.ariaLabelledBy = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabelledBy", alias: 'aria-labelledby' }] : [{
45
- alias: 'aria-labelledby'
46
- }]));
74
+ this.defaultChecked = input(false, { ...(ngDevMode ? { debugName: "defaultChecked" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
47
75
  /**
48
- * Used to define a string that autocomplete attribute the current element.
49
- * @default null
50
- * @group Props
76
+ * The controlled checked state. Use with `(onCheckedChange)` or two-way `[(checked)]`.
51
77
  */
52
- this.ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabel", alias: 'aria-label' }] : [{
53
- alias: 'aria-label'
54
- }]));
78
+ this.checked = model(this.defaultChecked(), ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
55
79
  /**
56
- * The state of the switch when it is initially rendered. Use when you do not need to control its state.
80
+ * When `true`, prevents the user from interacting with the switch.
81
+ *
57
82
  * @default false
58
- * @group Props
59
83
  */
60
- this.defaultChecked = input(false, ...(ngDevMode ? [{ debugName: "defaultChecked", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
84
+ this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
61
85
  /**
62
- * The controlled state of the switch. Must be used in conjunction with onCheckedChange.
63
- * @defaultValue false
64
- * @group Props
86
+ * When `true`, the switch is focusable but cannot be toggled.
87
+ *
88
+ * @default false
65
89
  */
66
- this.checked = model(this.defaultChecked(), ...(ngDevMode ? [{ debugName: "checked" }] : []));
90
+ this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
67
91
  /**
68
- * When `true`, prevents the user from interacting with the switch.
92
+ * When `true`, the switch must be on before the owning form can be submitted.
93
+ *
69
94
  * @default false
70
- * @group Props
71
95
  */
72
- this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{
73
- transform: booleanAttribute
74
- }]));
96
+ this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
97
+ /** Name of the hidden form input rendered by `[rdxSwitchInput]`. */
98
+ this.name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
75
99
  /**
76
- * Event handler called when the state of the switch changes.
100
+ * Value submitted with the form when the switch is on.
77
101
  *
78
- * @param {boolean} value - Boolean value indicates that the option is changed.
79
- * @group Emits
102
+ * Bound publicly as `[value]`; the TS member is named `submitValue` so the
103
+ * directive can satisfy `RdxFormCheckboxControl`, whose contract reserves a
104
+ * `value` member for `RdxFormValueControl` and forbids it on checkbox-style
105
+ * controls.
106
+ *
107
+ * @default 'on'
80
108
  */
81
- this.onCheckedChange = outputFromObservable(outputToObservable(this.cva.valueChange));
109
+ this.submitValue = input('on', { ...(ngDevMode ? { debugName: "submitValue" } : /* istanbul ignore next */ {}), alias: 'value' });
110
+ this.ariaLabelledBy = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabelledBy" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
111
+ this.ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
112
+ /** Event handler called when the checked state of the switch changes. */
113
+ this.onCheckedChange = output();
114
+ /** @ignore */
115
+ this.checkedState = computed(() => !!this.cva.value(), ...(ngDevMode ? [{ debugName: "checkedState" }] : /* istanbul ignore next */ []));
116
+ /** @ignore */
117
+ this.isDisabled = computed(() => !!this.cva.disabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
82
118
  }
83
- /**
84
- * Toggles the checked state of the switch.
85
- * If the switch is disabled, the function returns early.
86
- * @ignore
87
- */
119
+ /** @ignore Toggles the checked state unless disabled or read-only. */
88
120
  toggle() {
89
- if (!this.disabled()) {
90
- this.checked.set(!this.checked());
91
- this.cva.setValue(this.checked());
121
+ if (this.isDisabled() || this.readonly()) {
122
+ return;
92
123
  }
124
+ const next = !this.cva.value();
125
+ this.checked.set(next);
126
+ this.cva.setValue(next);
127
+ this.onCheckedChange.emit(next);
93
128
  }
94
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxSwitchRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
95
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.3", type: RdxSwitchRootDirective, isStandalone: true, selector: "button[rdxSwitchRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, defaultChecked: { classPropertyName: "defaultChecked", publicName: "defaultChecked", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", onCheckedChange: "onCheckedChange" }, host: { attributes: { "role": "switch", "type": "button" }, listeners: { "click": "toggle()", "keydown.enter": "$event.preventDefault()" }, properties: { "id": "id()", "attr.aria-checked": "cva.value()", "attr.aria-required": "required()", "attr.data-state": "cva.value() ? \"checked\" : \"unchecked\"", "attr.data-disabled": "cva.disabled() ? \"true\" : undefined", "attr.disabled": "cva.disabled() ? cva.disabled() : undefined", "value": "cva.value()" } }, providers: [provideSwitchRootContext(rootContext)], exportAs: ["rdxSwitchRoot"], hostDirectives: [{ directive: i1.RdxControlValueAccessor, inputs: ["value", "checked", "disabled", "disabled"] }], ngImport: i0 }); }
129
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSwitchRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
130
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxSwitchRoot, isStandalone: true, selector: "button[rdxSwitchRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, defaultChecked: { classPropertyName: "defaultChecked", publicName: "defaultChecked", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, submitValue: { classPropertyName: "submitValue", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", onCheckedChange: "onCheckedChange" }, host: { attributes: { "role": "switch", "type": "button" }, listeners: { "click": "toggle()", "keydown.enter": "$event.preventDefault()" }, properties: { "id": "id()", "attr.aria-checked": "checkedState()", "attr.aria-required": "required() ? \"true\" : undefined", "attr.aria-readonly": "readonly() ? \"true\" : undefined", "attr.data-checked": "checkedState() ? \"\" : undefined", "attr.data-unchecked": "checkedState() ? undefined : \"\"", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.data-readonly": "readonly() ? \"\" : undefined", "attr.data-required": "required() ? \"\" : undefined", "attr.disabled": "isDisabled() ? \"\" : undefined" } }, providers: [provideSwitchContext(context)], exportAs: ["rdxSwitchRoot"], hostDirectives: [{ directive: i1.RdxControlValueAccessor, inputs: ["value", "checked", "disabled", "disabled"] }], ngImport: i0 }); }
96
131
  }
97
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxSwitchRootDirective, decorators: [{
132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSwitchRoot, decorators: [{
98
133
  type: Directive,
99
134
  args: [{
100
135
  selector: 'button[rdxSwitchRoot]',
101
136
  exportAs: 'rdxSwitchRoot',
102
- providers: [provideSwitchRootContext(rootContext)],
137
+ providers: [provideSwitchContext(context)],
103
138
  hostDirectives: [
104
139
  {
105
140
  directive: RdxControlValueAccessor,
@@ -110,85 +145,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
110
145
  role: 'switch',
111
146
  type: 'button',
112
147
  '[id]': 'id()',
113
- '[attr.aria-checked]': 'cva.value()',
114
- '[attr.aria-required]': 'required()',
115
- '[attr.data-state]': 'cva.value() ? "checked" : "unchecked"',
116
- '[attr.data-disabled]': 'cva.disabled() ? "true" : undefined',
117
- '[attr.disabled]': 'cva.disabled() ? cva.disabled() : undefined',
118
- '[value]': 'cva.value()',
148
+ '[attr.aria-checked]': 'checkedState()',
149
+ '[attr.aria-required]': 'required() ? "true" : undefined',
150
+ '[attr.aria-readonly]': 'readonly() ? "true" : undefined',
151
+ '[attr.data-checked]': 'checkedState() ? "" : undefined',
152
+ '[attr.data-unchecked]': 'checkedState() ? undefined : ""',
153
+ '[attr.data-disabled]': 'isDisabled() ? "" : undefined',
154
+ '[attr.data-readonly]': 'readonly() ? "" : undefined',
155
+ '[attr.data-required]': 'required() ? "" : undefined',
156
+ '[attr.disabled]': 'isDisabled() ? "" : undefined',
119
157
  '(click)': 'toggle()',
120
158
  '(keydown.enter)': '$event.preventDefault()'
121
159
  }
122
160
  }]
123
- }] });
124
-
125
- /**
126
- * @group Components
127
- */
128
- class RdxSwitchInputDirective {
129
- constructor() {
130
- this.rootContext = injectSwitchRootContext();
131
- }
132
- /** @ignore */
133
- onBlur() {
134
- this.rootContext?.markAsTouched();
135
- }
136
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxSwitchInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
137
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: RdxSwitchInputDirective, isStandalone: true, selector: "input[rdxSwitchInput]", host: { attributes: { "type": "checkbox", "tabindex": "-1" }, listeners: { "blur": "onBlur()" }, properties: { "attr.defaultChecked": "rootContext.checked()", "attr.aria-checked": "rootContext.checked()", "attr.aria-hidden": "true", "attr.aria-label": "rootContext.ariaLabel()", "attr.aria-labelledby": "rootContext.ariaLabelledBy()", "attr.aria-required": "rootContext.required()", "attr.data-state": "rootContext.checked() ? \"checked\" : \"unchecked\"", "attr.data-disabled": "rootContext.disabled() ? \"true\" : null", "attr.disabled": "rootContext.disabled() ? rootContext.disabled() : undefined", "attr.value": "rootContext.checked() ? \"on\" : \"off\"" }, styleAttribute: "transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; margin: 0;" }, exportAs: ["rdxSwitchInput"], ngImport: i0 }); }
138
- }
139
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxSwitchInputDirective, decorators: [{
140
- type: Directive,
141
- args: [{
142
- selector: 'input[rdxSwitchInput]',
143
- exportAs: 'rdxSwitchInput',
144
- host: {
145
- type: 'checkbox',
146
- tabindex: '-1',
147
- '[attr.defaultChecked]': 'rootContext.checked()',
148
- '[attr.aria-checked]': 'rootContext.checked()',
149
- '[attr.aria-hidden]': 'true',
150
- '[attr.aria-label]': 'rootContext.ariaLabel()',
151
- '[attr.aria-labelledby]': 'rootContext.ariaLabelledBy()',
152
- '[attr.aria-required]': 'rootContext.required()',
153
- '[attr.data-state]': 'rootContext.checked() ? "checked" : "unchecked"',
154
- '[attr.data-disabled]': 'rootContext.disabled() ? "true" : null',
155
- '[attr.disabled]': 'rootContext.disabled() ? rootContext.disabled() : undefined',
156
- '[attr.value]': 'rootContext.checked() ? "on" : "off"',
157
- style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; margin: 0;',
158
- '(blur)': 'onBlur()'
159
- }
160
- }]
161
- }] });
161
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], defaultChecked: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultChecked", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], submitValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], onCheckedChange: [{ type: i0.Output, args: ["onCheckedChange"] }] } });
162
162
 
163
163
  /**
164
- * @group Components
164
+ * The moving part of the switch that indicates whether it is on or off.
165
+ *
166
+ * @see https://base-ui.com/react/components/switch
165
167
  */
166
- class RdxSwitchThumbDirective {
168
+ class RdxSwitchThumb {
167
169
  constructor() {
168
- this.rootContext = injectSwitchRootContext();
170
+ this.rootContext = injectSwitchContext();
169
171
  }
170
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxSwitchThumbDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
171
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: RdxSwitchThumbDirective, isStandalone: true, selector: "span[rdxSwitchThumb]", host: { properties: { "attr.data-disabled": "rootContext?.disabled() ? \"\" : undefined", "attr.data-state": "rootContext?.checked() ? \"checked\" : \"unchecked\"" } }, exportAs: ["rdxSwitchThumb"], ngImport: i0 }); }
172
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSwitchThumb, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
173
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxSwitchThumb, isStandalone: true, selector: "span[rdxSwitchThumb]", host: { properties: { "attr.data-checked": "rootContext.checked() ? \"\" : undefined", "attr.data-unchecked": "rootContext.checked() ? undefined : \"\"", "attr.data-disabled": "rootContext.disabled() ? \"\" : undefined", "attr.data-readonly": "rootContext.readonly() ? \"\" : undefined" } }, exportAs: ["rdxSwitchThumb"], ngImport: i0 }); }
172
174
  }
173
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxSwitchThumbDirective, decorators: [{
175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSwitchThumb, decorators: [{
174
176
  type: Directive,
175
177
  args: [{
176
178
  selector: 'span[rdxSwitchThumb]',
177
179
  exportAs: 'rdxSwitchThumb',
178
180
  host: {
179
- '[attr.data-disabled]': 'rootContext?.disabled() ? "" : undefined',
180
- '[attr.data-state]': 'rootContext?.checked() ? "checked" : "unchecked"'
181
+ '[attr.data-checked]': 'rootContext.checked() ? "" : undefined',
182
+ '[attr.data-unchecked]': 'rootContext.checked() ? undefined : ""',
183
+ '[attr.data-disabled]': 'rootContext.disabled() ? "" : undefined',
184
+ '[attr.data-readonly]': 'rootContext.readonly() ? "" : undefined'
181
185
  }
182
186
  }]
183
187
  }] });
184
188
 
185
- const switchImports = [RdxSwitchRootDirective, RdxSwitchInputDirective, RdxSwitchThumbDirective];
189
+ const switchImports = [RdxSwitchRoot, RdxSwitchInput, RdxSwitchThumb];
186
190
  class RdxSwitchModule {
187
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxSwitchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
188
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.3", ngImport: i0, type: RdxSwitchModule, imports: [RdxSwitchRootDirective, RdxSwitchInputDirective, RdxSwitchThumbDirective], exports: [RdxSwitchRootDirective, RdxSwitchInputDirective, RdxSwitchThumbDirective] }); }
189
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxSwitchModule }); }
191
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSwitchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
192
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.9", ngImport: i0, type: RdxSwitchModule, imports: [RdxSwitchRoot, RdxSwitchInput, RdxSwitchThumb], exports: [RdxSwitchRoot, RdxSwitchInput, RdxSwitchThumb] }); }
193
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSwitchModule }); }
190
194
  }
191
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxSwitchModule, decorators: [{
195
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxSwitchModule, decorators: [{
192
196
  type: NgModule,
193
197
  args: [{
194
198
  imports: [...switchImports],
@@ -200,5 +204,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
200
204
  * Generated bundle index. Do not edit.
201
205
  */
202
206
 
203
- export { RdxSwitchInputDirective, RdxSwitchModule, RdxSwitchRootDirective, RdxSwitchThumbDirective, injectSwitchRootContext, provideSwitchRootContext };
207
+ export { RdxSwitchInput, RdxSwitchModule, RdxSwitchRoot, RdxSwitchThumb, injectSwitchContext, provideSwitchContext, switchImports };
204
208
  //# sourceMappingURL=radix-ng-primitives-switch.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-switch.mjs","sources":["../tmp-esm2022/switch/src/switch-root.directive.js","../tmp-esm2022/switch/src/switch-input.directive.js","../tmp-esm2022/switch/src/switch-thumb.directive.js","../tmp-esm2022/switch/index.js","../tmp-esm2022/switch/radix-ng-primitives-switch.js"],"sourcesContent":["import { _IdGenerator } from '@angular/cdk/a11y';\nimport { booleanAttribute, Directive, inject, input, model } from '@angular/core';\nimport { outputFromObservable, outputToObservable } from '@angular/core/rxjs-interop';\nimport { createContext, injectControlValueAccessor, RdxControlValueAccessor } from '@radix-ng/primitives/core';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"@radix-ng/primitives/core\";\nexport const [injectSwitchRootContext, provideSwitchRootContext] = createContext('Switch');\nconst rootContext = () => {\n const instance = inject(RdxSwitchRootDirective);\n const cva = injectControlValueAccessor();\n return {\n required: instance.required,\n value: instance.checked,\n checked: cva.value,\n disabled: cva.disabled,\n ariaLabel: instance.ariaLabel,\n ariaLabelledBy: instance.ariaLabelledBy,\n markAsTouched: () => cva.markAsTouched(),\n toggle: () => instance.toggle()\n };\n};\n/**\n * @group Components\n */\nexport class RdxSwitchRootDirective {\n constructor() {\n this.cva = injectControlValueAccessor();\n this.id = input(inject(_IdGenerator).getId('rdx-switch-'), ...(ngDevMode ? [{ debugName: \"id\" }] : []));\n /**\n * When true, indicates that the user must check the switch before the owning form can be submitted.\n *\n * @default false\n * @group Props\n */\n this.required = input(false, ...(ngDevMode ? [{ debugName: \"required\", transform: booleanAttribute }] : [{\n transform: booleanAttribute\n }]));\n /**\n * Establishes relationships between the component and label(s) where its value should be one or more element IDs.\n * @default null\n * @group Props\n */\n this.ariaLabelledBy = input(undefined, ...(ngDevMode ? [{ debugName: \"ariaLabelledBy\", alias: 'aria-labelledby' }] : [{\n alias: 'aria-labelledby'\n }]));\n /**\n * Used to define a string that autocomplete attribute the current element.\n * @default null\n * @group Props\n */\n this.ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: \"ariaLabel\", alias: 'aria-label' }] : [{\n alias: 'aria-label'\n }]));\n /**\n * The state of the switch when it is initially rendered. Use when you do not need to control its state.\n * @default false\n * @group Props\n */\n this.defaultChecked = input(false, ...(ngDevMode ? [{ debugName: \"defaultChecked\", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));\n /**\n * The controlled state of the switch. Must be used in conjunction with onCheckedChange.\n * @defaultValue false\n * @group Props\n */\n this.checked = model(this.defaultChecked(), ...(ngDevMode ? [{ debugName: \"checked\" }] : []));\n /**\n * When `true`, prevents the user from interacting with the switch.\n * @default false\n * @group Props\n */\n this.disabled = input(false, ...(ngDevMode ? [{ debugName: \"disabled\", transform: booleanAttribute }] : [{\n transform: booleanAttribute\n }]));\n /**\n * Event handler called when the state of the switch changes.\n *\n * @param {boolean} value - Boolean value indicates that the option is changed.\n * @group Emits\n */\n this.onCheckedChange = outputFromObservable(outputToObservable(this.cva.valueChange));\n }\n /**\n * Toggles the checked state of the switch.\n * If the switch is disabled, the function returns early.\n * @ignore\n */\n toggle() {\n if (!this.disabled()) {\n this.checked.set(!this.checked());\n this.cva.setValue(this.checked());\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"20.3.3\", ngImport: i0, type: RdxSwitchRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"17.1.0\", version: \"20.3.3\", type: RdxSwitchRootDirective, isStandalone: true, selector: \"button[rdxSwitchRoot]\", inputs: { id: { classPropertyName: \"id\", publicName: \"id\", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: \"required\", publicName: \"required\", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: \"ariaLabelledBy\", publicName: \"aria-labelledby\", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: \"ariaLabel\", publicName: \"aria-label\", isSignal: true, isRequired: false, transformFunction: null }, defaultChecked: { classPropertyName: \"defaultChecked\", publicName: \"defaultChecked\", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: \"checked\", publicName: \"checked\", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: \"disabled\", publicName: \"disabled\", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: \"checkedChange\", onCheckedChange: \"onCheckedChange\" }, host: { attributes: { \"role\": \"switch\", \"type\": \"button\" }, listeners: { \"click\": \"toggle()\", \"keydown.enter\": \"$event.preventDefault()\" }, properties: { \"id\": \"id()\", \"attr.aria-checked\": \"cva.value()\", \"attr.aria-required\": \"required()\", \"attr.data-state\": \"cva.value() ? \\\"checked\\\" : \\\"unchecked\\\"\", \"attr.data-disabled\": \"cva.disabled() ? \\\"true\\\" : undefined\", \"attr.disabled\": \"cva.disabled() ? cva.disabled() : undefined\", \"value\": \"cva.value()\" } }, providers: [provideSwitchRootContext(rootContext)], exportAs: [\"rdxSwitchRoot\"], hostDirectives: [{ directive: i1.RdxControlValueAccessor, inputs: [\"value\", \"checked\", \"disabled\", \"disabled\"] }], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"20.3.3\", ngImport: i0, type: RdxSwitchRootDirective, decorators: [{\n type: Directive,\n args: [{\n selector: 'button[rdxSwitchRoot]',\n exportAs: 'rdxSwitchRoot',\n providers: [provideSwitchRootContext(rootContext)],\n hostDirectives: [\n {\n directive: RdxControlValueAccessor,\n inputs: ['value: checked', 'disabled']\n }\n ],\n host: {\n role: 'switch',\n type: 'button',\n '[id]': 'id()',\n '[attr.aria-checked]': 'cva.value()',\n '[attr.aria-required]': 'required()',\n '[attr.data-state]': 'cva.value() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'cva.disabled() ? \"true\" : undefined',\n '[attr.disabled]': 'cva.disabled() ? cva.disabled() : undefined',\n '[value]': 'cva.value()',\n '(click)': 'toggle()',\n '(keydown.enter)': '$event.preventDefault()'\n }\n }]\n }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3dpdGNoLXJvb3QuZGlyZWN0aXZlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvcHJpbWl0aXZlcy9zd2l0Y2gvc3JjL3N3aXRjaC1yb290LmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFFakQsT0FBTyxFQUNILGdCQUFnQixFQUNoQixTQUFTLEVBQ1QsTUFBTSxFQUNOLEtBQUssRUFHTCxLQUFLLEVBRVIsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUFFLG9CQUFvQixFQUFFLGtCQUFrQixFQUFFLE1BQU0sNEJBQTRCLENBQUM7QUFDdEYsT0FBTyxFQUFFLGFBQWEsRUFBRSwwQkFBMEIsRUFBRS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NoIGNoYW5nZXMuXG4gICAgICpcbiAgICAgKiBAcGFyYW0ge2Jvb2xlYW59IHZhbHVlIC0gQm9vbGVhbiB2YWx1ZSBpbmRpY2F0ZXMgdGhhdCB0aGUgb3B0aW9uIGlzIGNoYW5nZWQuXG4gICAgICogQGdyb3VwIEVtaXRzXG4gICAgICovXG4gICAgcmVhZG9ubHkgb25DaGVja2VkQ2hhbmdlID0gb3V0cHV0RnJvbU9ic2VydmFibGUob3V0cHV0VG9PYnNlcnZhYmxlKHRoaXMuY3ZhLnZhbHVlQ2hhbmdlKSk7XG5cbiAgICAvKipcbiAgICAgKiBUb2dnbGVzIHRoZSBjaGVja2VkIHN0YXRlIG9mIHRoZSBzd2l0Y2guXG4gICAgICogSWYgdGhlIHN3aXRjaCBpcyBkaXNhYmxlZCwgdGhlIGZ1bmN0aW9uIHJldHVybnMgZWFybHkuXG4gICAgICogQGlnbm9yZVxuICAgICAqL1xuICAgIHRvZ2dsZSgpOiB2b2lkIHtcbiAgICAgICAgaWYgKCF0aGlzLmRpc2FibGVkKCkpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tlZC5zZXQoIXRoaXMuY2hlY2tlZCgpKTtcbiAgICAgICAgICAgIHRoaXMuY3ZhLnNldFZhbHVlKHRoaXMuY2hlY2tlZCgpKTtcbiAgICAgICAgfVxuICAgIH1cbn1cbiJdfQ==","import { Directive } from '@angular/core';\nimport { injectSwitchRootContext } from './switch-root.directive';\nimport * as i0 from \"@angular/core\";\n/**\n * @group Components\n */\nexport class RdxSwitchInputDirective {\n constructor() {\n this.rootContext = injectSwitchRootContext();\n }\n /** @ignore */\n onBlur() {\n this.rootContext?.markAsTouched();\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"20.3.3\", ngImport: i0, type: RdxSwitchInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"20.3.3\", type: RdxSwitchInputDirective, isStandalone: true, selector: \"input[rdxSwitchInput]\", host: { attributes: { \"type\": \"checkbox\", \"tabindex\": \"-1\" }, listeners: { \"blur\": \"onBlur()\" }, properties: { \"attr.defaultChecked\": \"rootContext.checked()\", \"attr.aria-checked\": \"rootContext.checked()\", \"attr.aria-hidden\": \"true\", \"attr.aria-label\": \"rootContext.ariaLabel()\", \"attr.aria-labelledby\": \"rootContext.ariaLabelledBy()\", \"attr.aria-required\": \"rootContext.required()\", \"attr.data-state\": \"rootContext.checked() ? \\\"checked\\\" : \\\"unchecked\\\"\", \"attr.data-disabled\": \"rootContext.disabled() ? \\\"true\\\" : null\", \"attr.disabled\": \"rootContext.disabled() ? rootContext.disabled() : undefined\", \"attr.value\": \"rootContext.checked() ? \\\"on\\\" : \\\"off\\\"\" }, styleAttribute: \"transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; margin: 0;\" }, exportAs: [\"rdxSwitchInput\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"20.3.3\", ngImport: i0, type: RdxSwitchInputDirective, decorators: [{\n type: Directive,\n args: [{\n selector: 'input[rdxSwitchInput]',\n exportAs: 'rdxSwitchInput',\n host: {\n type: 'checkbox',\n tabindex: '-1',\n '[attr.defaultChecked]': 'rootContext.checked()',\n '[attr.aria-checked]': 'rootContext.checked()',\n '[attr.aria-hidden]': 'true',\n '[attr.aria-label]': 'rootContext.ariaLabel()',\n '[attr.aria-labelledby]': 'rootContext.ariaLabelledBy()',\n '[attr.aria-required]': 'rootContext.required()',\n '[attr.data-state]': 'rootContext.checked() ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"true\" : null',\n '[attr.disabled]': 'rootContext.disabled() ? rootContext.disabled() : undefined',\n '[attr.value]': 'rootContext.checked() ? \"on\" : \"off\"',\n style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointerEvents: none; opacity: 0; marg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LFxuICAgICAgICAnW2F0dHIuZGF0YS1zdGF0ZV0nOiAncm9vdENvbnRleHQuY2hlY2tlZCgpID8gXCJjaGVja2VkXCIgOiBcInVuY2hlY2tlZFwiJyxcbiAgICAgICAgJ1thdHRyLmRhdGEtZGlzYWJsZWRdJzogJ3Jvb3RDb250ZXh0LmRpc2FibGVkKCkgPyBcInRydWVcIiA6IG51bGwnLFxuICAgICAgICAnW2F0dHIuZGlzYWJsZWRdJzogJ3Jvb3RDb250ZXh0LmRpc2FibGVkKCkgPyByb290Q29udGV4dC5kaXNhYmxlZCgpIDogdW5kZWZpbmVkJyxcbiAgICAgICAgJ1thdHRyLnZhbHVlXSc6ICdyb290Q29udGV4dC5jaGVja2VkKCkgPyBcIm9uXCIgOiBcIm9mZlwiJyxcbiAgICAgICAgc3R5bGU6ICd0cmFuc2Zvcm06IHRyYW5zbGF0ZVgoLTEwMCUpOyBwb3NpdGlvbjogYWJzb2x1dGU7IG92ZXJmbG93OiBoaWRkZW47IHBvaW50ZXJFdmVudHM6IG5vbmU7IG9wYWNpdHk6IDA7IG1hcmdpbjogMDsnLFxuXG4gICAgICAgICcoYmx1ciknOiAnb25CbHVyKCknXG4gICAgfVxufSlcbmV4cG9ydCBjbGFzcyBSZHhTd2l0Y2hJbnB1dERpcmVjdGl2ZSB7XG4gICAgcHJvdGVjdGVkIHJlYWRvbmx5IHJvb3RDb250ZXh0ID0gaW5qZWN0U3dpdGNoUm9vdENvbnRleHQoKSE7XG5cbiAgICAvKiogQGlnbm9yZSAqL1xuICAgIHByb3RlY3RlZCBvbkJsdXIoKSB7XG4gICAgICAgIHRoaXMucm9vdENvbnRleHQ/Lm1hcmtBc1RvdWNoZWQoKTtcbiAgICB9XG59XG4iXX0=","import { Directive } from '@angular/core';\nimport { injectSwitchRootContext } from './switch-root.directive';\nimport * as i0 from \"@angular/core\";\n/**\n * @group Components\n */\nexport class RdxSwitchThumbDirective {\n constructor() {\n this.rootContext = injectSwitchRootContext();\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"20.3.3\", ngImport: i0, type: RdxSwitchThumbDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"20.3.3\", type: RdxSwitchThumbDirective, isStandalone: true, selector: \"span[rdxSwitchThumb]\", host: { properties: { \"attr.data-disabled\": \"rootContext?.disabled() ? \\\"\\\" : undefined\", \"attr.data-state\": \"rootContext?.checked() ? \\\"checked\\\" : \\\"unchecked\\\"\" } }, exportAs: [\"rdxSwitchThumb\"], ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"20.3.3\", ngImport: i0, type: RdxSwitchThumbDirective, decorators: [{\n type: Directive,\n args: [{\n selector: 'span[rdxSwitchThumb]',\n exportAs: 'rdxSwitchThumb',\n host: {\n '[attr.data-disabled]': 'rootContext?.disabled() ? \"\" : undefined',\n '[attr.data-state]': 'rootContext?.checked() ? \"checked\" : \"unchecked\"'\n }\n }]\n }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3dpdGNoLXRodW1iLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3ByaW1pdGl2ZXMvc3dpdGNoL3NyYy9zd2l0Y2gtdGh1bWIuZGlyZWN0aXZlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDMUMsT0FBTyxFQUFFLHVCQUF1QixFQUFFLE1BQU0seUJBQXlCLENBQUM7O0FBRWxFOztHQUVHO0FBU0gsTUFBTSxPQUFPLHVCQUF1QjtJQVJwQztRQVN1QixnQkFBVyxHQUFHLHVCQUF1QixFQUFFLENBQUM7S0FDOUQ7OEdBRlksdUJBQXVCO2tHQUF2Qix1QkFBdUI7OzJGQUF2Qix1QkFBdUI7a0JBUm5DLFNBQVM7bUJBQUM7b0JBQ1AsUUFBUSxFQUFFLHNCQUFzQjtvQkFDaEMsUUFBUSxFQUFFLGdCQUFnQjtvQkFDMUIsSUFBSSxFQUFFO3dCQUNGLHNCQUFzQixFQUFFLDBDQUEwQzt3QkFDbEUsbUJBQW1CLEVBQUUsa0RBQWtEO3FCQUMxRTtpQkFDSiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IERpcmVjdGl2ZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgaW5qZWN0U3dpdGNoUm9vdENvbnRleHQgfSBmcm9tICcuL3N3aXRjaC1yb290LmRpcmVjdGl2ZSc7XG5cbi8qKlxuICogQGdyb3VwIENvbXBvbmVudHNcbiAqL1xuQERpcmVjdGl2ZSh7XG4gICAgc2VsZWN0b3I6ICdzcGFuW3JkeFN3aXRjaFRodW1iXScsXG4gICAgZXhwb3J0QXM6ICdyZHhTd2l0Y2hUaHVtYicsXG4gICAgaG9zdDoge1xuICAgICAgICAnW2F0dHIuZGF0YS1kaXNhYmxlZF0nOiAncm9vdENvbnRleHQ/LmRpc2FibGVkKCkgPyBcIlwiIDogdW5kZWZpbmVkJyxcbiAgICAgICAgJ1thdHRyLmRhdGEtc3RhdGVdJzogJ3Jvb3RDb250ZXh0Py5jaGVja2VkKCkgPyBcImNoZWNrZWRcIiA6IFwidW5jaGVja2VkXCInXG4gICAgfVxufSlcbmV4cG9ydCBjbGFzcyBSZHhTd2l0Y2hUaHVtYkRpcmVjdGl2ZSB7XG4gICAgcHJvdGVjdGVkIHJlYWRvbmx5IHJvb3RDb250ZXh0ID0gaW5qZWN0U3dpdGNoUm9vdENvbnRleHQoKTtcbn1cbiJdfQ==","import { NgModule } from '@angular/core';\nimport { RdxSwitchInputDirective } from './src/switch-input.directive';\nimport { RdxSwitchRootDirective } from './src/switch-root.directive';\nimport { RdxSwitchThumbDirective } from './src/switch-thumb.directive';\nimport * as i0 from \"@angular/core\";\nexport * from './src/switch-input.directive';\nexport * from './src/switch-root.directive';\nexport * from './src/switch-thumb.directive';\nconst switchImports = [RdxSwitchRootDirective, RdxSwitchInputDirective, RdxSwitchThumbDirective];\nexport class RdxSwitchModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"20.3.3\", ngImport: i0, type: RdxSwitchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"20.3.3\", ngImport: i0, type: RdxSwitchModule, imports: [RdxSwitchRootDirective, RdxSwitchInputDirective, RdxSwitchThumbDirective], exports: [RdxSwitchRootDirective, RdxSwitchInputDirective, RdxSwitchThumbDirective] }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"20.3.3\", ngImport: i0, type: RdxSwitchModule }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"20.3.3\", ngImport: i0, type: RdxSwitchModule, decorators: [{\n type: NgModule,\n args: [{\n imports: [...switchImports],\n exports: [...switchImports]\n }]\n }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9wcmltaXRpdmVzL3N3aXRjaC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3pDLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLDhCQUE4QixDQUFDO0FBQ3ZFLE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ3JFLE9BQ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CAqIGZyb20gJy4vc3JjL3N3aXRjaC10aHVtYi5kaXJlY3RpdmUnO1xuXG5jb25zdCBzd2l0Y2hJbXBvcnRzID0gW1JkeFN3aXRjaFJvb3REaXJlY3RpdmUsIFJkeFN3aXRjaElucHV0RGlyZWN0aXZlLCBSZHhTd2l0Y2hUaHVtYkRpcmVjdGl2ZV07XG5cbkBOZ01vZHVsZSh7XG4gICAgaW1wb3J0czogWy4uLnN3aXRjaEltcG9ydHNdLFxuICAgIGV4cG9ydHM6IFsuLi5zd2l0Y2hJbXBvcnRzXVxufSlcbmV4cG9ydCBjbGFzcyBSZHhTd2l0Y2hNb2R1bGUge31cbiJdfQ==","/**\n * Generated bundle index. Do not edit.\n */\nexport * from './index';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFkaXgtbmctcHJpbWl0aXZlcy1zd2l0Y2guanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9wcmltaXRpdmVzL3N3aXRjaC9yYWRpeC1uZy1wcmltaXRpdmVzLXN3aXRjaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ=="],"names":[],"mappings":";;;;;;;AAMY,MAAC,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,GAAG,aAAa,CAAC,QAAQ;AACzF,MAAM,WAAW,GAAG,MAAM;AAC1B,IAAI,MAAM,QAAQ,GAAG,MAAM,CAAC,sBAAsB,CAAC;AACnD,IAAI,MAAM,GAAG,GAAG,0BAA0B,EAAE;AAC5C,IAAI,OAAO;AACX,QAAQ,QAAQ,EAAE,QAAQ,CA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mBAAmB,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;AAClI;AACA,EAAE,CAAC,wBAAwB,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC;AACzH,YAAY,IAAI,EAAE,QAAQ;AAC1B,YAAY,IAAI,EAAE,CAAC;AACnB,oBAAoB,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC;AAC/C,oBAAoB,OAAO,EAAE,CAAC,GAAG,aAAa;AAC9C,iBAAiB;AACjB,SAAS,CAAC,EAAE,CAAC;;ACpBb;AACA;AACA;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-switch.mjs","sources":["../../../packages/primitives/switch/src/switch-context.ts","../../../packages/primitives/switch/src/switch-input.ts","../../../packages/primitives/switch/src/switch-root.ts","../../../packages/primitives/switch/src/switch-thumb.ts","../../../packages/primitives/switch/index.ts","../../../packages/primitives/switch/radix-ng-primitives-switch.ts"],"sourcesContent":["import { Signal } from '@angular/core';\nimport { createContext } from '@radix-ng/primitives/core';\n\nexport interface RdxSwitchContext {\n /** Whether the switch is on. */\n readonly checked: Signal<boolean>;\n\n /** Whether the switch is disabled. */\n readonly disabled: Signal<boolean>;\n\n /** Whether the switch is read-only (focusable, but cannot be toggled). */\n readonly readonly: Signal<boolean>;\n\n /** Whether the switch must be on to submit the owning form. */\n readonly required: Signal<boolean>;\n\n /** Name of the hidden form input. */\n readonly name: Signal<string | undefined>;\n\n /** Value submitted with the form when the switch is on. */\n readonly value: Signal<string>;\n\n readonly ariaLabel: Signal<string | undefined>;\n readonly ariaLabelledBy: Signal<string | undefined>;\n\n markAsTouched(): void;\n}\n\nexport const [injectSwitchContext, provideSwitchContext] = createContext<RdxSwitchContext>('RdxSwitchContext');\n","import { Directive } from '@angular/core';\nimport { injectSwitchContext } from './switch-context';\n\n/**\n * The hidden native checkbox that mirrors the switch state for form submission and screen readers.\n *\n * @see https://base-ui.com/react/components/switch\n */\n@Directive({\n selector: 'input[rdxSwitchInput]',\n exportAs: 'rdxSwitchInput',\n host: {\n type: 'checkbox',\n tabindex: '-1',\n 'aria-hidden': 'true',\n '[attr.name]': 'rootContext.name()',\n '[attr.value]': 'rootContext.value()',\n '[checked]': 'rootContext.checked()',\n '[disabled]': 'rootContext.disabled()',\n '[attr.required]': 'rootContext.required() ? \"\" : undefined',\n '[attr.aria-label]': 'rootContext.ariaLabel()',\n '[attr.aria-labelledby]': 'rootContext.ariaLabelledBy()',\n '[attr.data-checked]': 'rootContext.checked() ? \"\" : undefined',\n '[attr.data-unchecked]': 'rootContext.checked() ? undefined : \"\"',\n style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointer-events: none; opacity: 0; margin: 0;',\n '(blur)': 'rootContext.markAsTouched()'\n }\n})\nexport class RdxSwitchInput {\n protected readonly rootContext = injectSwitchContext()!;\n}\n","import { booleanAttribute, computed, Directive, inject, input, model, output } from '@angular/core';\nimport {\n BooleanInput,\n injectControlValueAccessor,\n injectId,\n RdxControlValueAccessor,\n RdxFormCheckboxControl\n} from '@radix-ng/primitives/core';\nimport { provideSwitchContext, RdxSwitchContext } from './switch-context';\n\nconst context = (): RdxSwitchContext => {\n const root = inject(RdxSwitchRoot);\n const cva = injectControlValueAccessor<boolean | undefined>();\n\n return {\n checked: root.checkedState,\n disabled: computed(() => !!cva.disabled()),\n readonly: root.readonly,\n required: root.required,\n name: root.name,\n value: root.submitValue,\n ariaLabel: root.ariaLabel,\n ariaLabelledBy: root.ariaLabelledBy,\n markAsTouched: () => cva.markAsTouched()\n };\n};\n\n/**\n * A control that toggles between on and off.\n *\n * @see https://base-ui.com/react/components/switch\n */\n@Directive({\n selector: 'button[rdxSwitchRoot]',\n exportAs: 'rdxSwitchRoot',\n providers: [provideSwitchContext(context)],\n hostDirectives: [\n {\n directive: RdxControlValueAccessor,\n inputs: ['value: checked', 'disabled']\n }\n ],\n host: {\n role: 'switch',\n type: 'button',\n '[id]': 'id()',\n '[attr.aria-checked]': 'checkedState()',\n '[attr.aria-required]': 'required() ? \"true\" : undefined',\n '[attr.aria-readonly]': 'readonly() ? \"true\" : undefined',\n '[attr.data-checked]': 'checkedState() ? \"\" : undefined',\n '[attr.data-unchecked]': 'checkedState() ? undefined : \"\"',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'readonly() ? \"\" : undefined',\n '[attr.data-required]': 'required() ? \"\" : undefined',\n '[attr.disabled]': 'isDisabled() ? \"\" : undefined',\n '(click)': 'toggle()',\n '(keydown.enter)': '$event.preventDefault()'\n }\n})\nexport class RdxSwitchRoot implements RdxFormCheckboxControl {\n /** @ignore */\n protected readonly cva = injectControlValueAccessor<boolean | undefined>();\n\n readonly id = input<string>(injectId('rdx-switch-'));\n\n /**\n * The state of the switch when it is initially rendered. Use when you do not need to control its state.\n *\n * @default false\n */\n readonly defaultChecked = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled checked state. Use with `(onCheckedChange)` or two-way `[(checked)]`.\n */\n readonly checked = model<boolean>(this.defaultChecked());\n\n /**\n * When `true`, prevents the user from interacting with the switch.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * When `true`, the switch is focusable but cannot be toggled.\n *\n * @default false\n */\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * When `true`, the switch must be on before the owning form can be submitted.\n *\n * @default false\n */\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Name of the hidden form input rendered by `[rdxSwitchInput]`. */\n readonly name = input<string>();\n\n /**\n * Value submitted with the form when the switch is on.\n *\n * Bound publicly as `[value]`; the TS member is named `submitValue` so the\n * directive can satisfy `RdxFormCheckboxControl`, whose contract reserves a\n * `value` member for `RdxFormValueControl` and forbids it on checkbox-style\n * controls.\n *\n * @default 'on'\n */\n readonly submitValue = input<string>('on', { alias: 'value' });\n\n readonly ariaLabelledBy = input<string | undefined>(undefined, { alias: 'aria-labelledby' });\n readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n /** Event handler called when the checked state of the switch changes. */\n readonly onCheckedChange = output<boolean>();\n\n /** @ignore */\n readonly checkedState = computed(() => !!this.cva.value());\n /** @ignore */\n protected readonly isDisabled = computed(() => !!this.cva.disabled());\n\n /** @ignore Toggles the checked state unless disabled or read-only. */\n toggle(): void {\n if (this.isDisabled() || this.readonly()) {\n return;\n }\n\n const next = !this.cva.value();\n this.checked.set(next);\n this.cva.setValue(next);\n this.onCheckedChange.emit(next);\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectSwitchContext } from './switch-context';\n\n/**\n * The moving part of the switch that indicates whether it is on or off.\n *\n * @see https://base-ui.com/react/components/switch\n */\n@Directive({\n selector: 'span[rdxSwitchThumb]',\n exportAs: 'rdxSwitchThumb',\n host: {\n '[attr.data-checked]': 'rootContext.checked() ? \"\" : undefined',\n '[attr.data-unchecked]': 'rootContext.checked() ? undefined : \"\"',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'rootContext.readonly() ? \"\" : undefined'\n }\n})\nexport class RdxSwitchThumb {\n protected readonly rootContext = injectSwitchContext()!;\n}\n","import { NgModule } from '@angular/core';\nimport { RdxSwitchInput } from './src/switch-input';\nimport { RdxSwitchRoot } from './src/switch-root';\nimport { RdxSwitchThumb } from './src/switch-thumb';\n\nexport * from './src/switch-context';\nexport * from './src/switch-input';\nexport * from './src/switch-root';\nexport * from './src/switch-thumb';\n\nexport const switchImports = [RdxSwitchRoot, RdxSwitchInput, RdxSwitchThumb];\n\n@NgModule({\n imports: [...switchImports],\n exports: [...switchImports]\n})\nexport class RdxSwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */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