@radix-ng/primitives 0.51.0 → 1.0.0-beta.1

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 (186) hide show
  1. package/fesm2022/radix-ng-primitives-accordion.mjs +105 -38
  2. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  3. package/fesm2022/radix-ng-primitives-alert-dialog.mjs +221 -129
  4. package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
  5. package/fesm2022/radix-ng-primitives-arrow.mjs +20 -4
  6. package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -1
  7. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
  8. package/fesm2022/radix-ng-primitives-avatar.mjs +54 -61
  9. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  10. package/fesm2022/radix-ng-primitives-button.mjs +123 -0
  11. package/fesm2022/radix-ng-primitives-button.mjs.map +1 -0
  12. package/fesm2022/radix-ng-primitives-calendar.mjs +95 -83
  13. package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
  14. package/fesm2022/radix-ng-primitives-checkbox.mjs +378 -54
  15. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  16. package/fesm2022/radix-ng-primitives-collapsible.mjs +182 -81
  17. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  18. package/fesm2022/radix-ng-primitives-collection.mjs +40 -57
  19. package/fesm2022/radix-ng-primitives-collection.mjs.map +1 -1
  20. package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
  21. package/fesm2022/radix-ng-primitives-context-menu.mjs +140 -424
  22. package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
  23. package/fesm2022/radix-ng-primitives-core.mjs +845 -744
  24. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  25. package/fesm2022/radix-ng-primitives-cropper.mjs +288 -308
  26. package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
  27. package/fesm2022/radix-ng-primitives-date-field.mjs +104 -58
  28. package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
  29. package/fesm2022/radix-ng-primitives-dialog.mjs +655 -327
  30. package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
  31. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +70 -46
  32. package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
  33. package/fesm2022/radix-ng-primitives-drawer.mjs +960 -0
  34. package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -0
  35. package/fesm2022/radix-ng-primitives-editable.mjs +304 -23
  36. package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
  37. package/fesm2022/radix-ng-primitives-field.mjs +363 -0
  38. package/fesm2022/radix-ng-primitives-field.mjs.map +1 -0
  39. package/fesm2022/radix-ng-primitives-fieldset.mjs +79 -0
  40. package/fesm2022/radix-ng-primitives-fieldset.mjs.map +1 -0
  41. package/fesm2022/radix-ng-primitives-focus-scope.mjs +23 -8
  42. package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
  43. package/fesm2022/radix-ng-primitives-input.mjs +172 -0
  44. package/fesm2022/radix-ng-primitives-input.mjs.map +1 -0
  45. package/fesm2022/radix-ng-primitives-label.mjs +6 -6
  46. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  47. package/fesm2022/radix-ng-primitives-menu.mjs +1907 -363
  48. package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
  49. package/fesm2022/radix-ng-primitives-menubar.mjs +290 -162
  50. package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
  51. package/fesm2022/radix-ng-primitives-meter.mjs +271 -0
  52. package/fesm2022/radix-ng-primitives-meter.mjs.map +1 -0
  53. package/fesm2022/radix-ng-primitives-navigation-menu.mjs +1052 -1553
  54. package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
  55. package/fesm2022/radix-ng-primitives-number-field.mjs +1102 -367
  56. package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
  57. package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
  58. package/fesm2022/radix-ng-primitives-popover.mjs +978 -989
  59. package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
  60. package/fesm2022/radix-ng-primitives-popper.mjs +111 -44
  61. package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
  62. package/fesm2022/radix-ng-primitives-portal.mjs +34 -10
  63. package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
  64. package/fesm2022/radix-ng-primitives-presence.mjs +134 -246
  65. package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
  66. package/fesm2022/radix-ng-primitives-preview-card.mjs +997 -0
  67. package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -0
  68. package/fesm2022/radix-ng-primitives-progress.mjs +223 -84
  69. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  70. package/fesm2022/radix-ng-primitives-radio.mjs +191 -51
  71. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  72. package/fesm2022/radix-ng-primitives-roving-focus.mjs +96 -50
  73. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
  74. package/fesm2022/radix-ng-primitives-scroll-area.mjs +923 -0
  75. package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -0
  76. package/fesm2022/radix-ng-primitives-select.mjs +791 -509
  77. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  78. package/fesm2022/radix-ng-primitives-separator.mjs +12 -35
  79. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  80. package/fesm2022/radix-ng-primitives-slider.mjs +969 -717
  81. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  82. package/fesm2022/radix-ng-primitives-stepper.mjs +15 -19
  83. package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
  84. package/fesm2022/radix-ng-primitives-switch.mjs +125 -113
  85. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  86. package/fesm2022/radix-ng-primitives-tabs.mjs +390 -108
  87. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  88. package/fesm2022/radix-ng-primitives-time-field.mjs +55 -46
  89. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
  90. package/fesm2022/radix-ng-primitives-toast.mjs +839 -0
  91. package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -0
  92. package/fesm2022/radix-ng-primitives-toggle-group.mjs +121 -247
  93. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  94. package/fesm2022/radix-ng-primitives-toggle.mjs +98 -61
  95. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  96. package/fesm2022/radix-ng-primitives-toolbar.mjs +303 -92
  97. package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
  98. package/fesm2022/radix-ng-primitives-tooltip.mjs +699 -1072
  99. package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
  100. package/fesm2022/radix-ng-primitives-visually-hidden.mjs +25 -66
  101. package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
  102. package/meter/README.md +3 -0
  103. package/navigation-menu/README.md +2 -1
  104. package/package.json +39 -18
  105. package/portal/README.md +2 -0
  106. package/preview-card/README.md +3 -0
  107. package/schematics/collection.json +1 -0
  108. package/schematics/ng-add/index.d.ts +3 -2
  109. package/schematics/ng-add/index.js +62 -31
  110. package/schematics/ng-add/index.js.map +1 -1
  111. package/schematics/ng-add/package-config.d.ts +4 -2
  112. package/schematics/ng-add/package-config.js +10 -2
  113. package/schematics/ng-add/package-config.js.map +1 -1
  114. package/schematics/ng-add/schema.d.ts +3 -0
  115. package/schematics/ng-add/schema.js +3 -0
  116. package/schematics/ng-add/schema.js.map +1 -0
  117. package/schematics/ng-add/schema.json +14 -0
  118. package/select/README.md +2 -0
  119. package/types/radix-ng-primitives-accordion.d.ts +51 -16
  120. package/types/radix-ng-primitives-alert-dialog.d.ts +95 -38
  121. package/types/radix-ng-primitives-arrow.d.ts +1 -1
  122. package/types/radix-ng-primitives-aspect-ratio.d.ts +1 -1
  123. package/types/radix-ng-primitives-avatar.d.ts +7 -11
  124. package/types/radix-ng-primitives-button.d.ts +73 -0
  125. package/types/radix-ng-primitives-calendar.d.ts +39 -20
  126. package/types/radix-ng-primitives-checkbox.d.ts +204 -35
  127. package/types/radix-ng-primitives-collapsible.d.ts +114 -40
  128. package/types/radix-ng-primitives-collection.d.ts +38 -34
  129. package/types/radix-ng-primitives-config.d.ts +1 -1
  130. package/types/radix-ng-primitives-context-menu.d.ts +61 -116
  131. package/types/radix-ng-primitives-core.d.ts +345 -235
  132. package/types/radix-ng-primitives-cropper.d.ts +89 -56
  133. package/types/radix-ng-primitives-date-field.d.ts +49 -28
  134. package/types/radix-ng-primitives-dialog.d.ts +283 -165
  135. package/types/radix-ng-primitives-dismissable-layer.d.ts +15 -7
  136. package/types/radix-ng-primitives-drawer.d.ts +426 -0
  137. package/types/radix-ng-primitives-editable.d.ts +91 -14
  138. package/types/radix-ng-primitives-field.d.ts +374 -0
  139. package/types/radix-ng-primitives-fieldset.d.ts +49 -0
  140. package/types/radix-ng-primitives-focus-scope.d.ts +15 -6
  141. package/types/radix-ng-primitives-input.d.ts +87 -0
  142. package/types/radix-ng-primitives-label.d.ts +0 -1
  143. package/types/radix-ng-primitives-menu.d.ts +584 -99
  144. package/types/radix-ng-primitives-menubar.d.ts +61 -50
  145. package/types/radix-ng-primitives-meter.d.ts +194 -0
  146. package/types/radix-ng-primitives-navigation-menu.d.ts +422 -340
  147. package/types/radix-ng-primitives-number-field.d.ts +405 -145
  148. package/types/radix-ng-primitives-pagination.d.ts +2 -2
  149. package/types/radix-ng-primitives-popover.d.ts +366 -351
  150. package/types/radix-ng-primitives-popper.d.ts +68 -11
  151. package/types/radix-ng-primitives-portal.d.ts +14 -6
  152. package/types/radix-ng-primitives-presence.d.ts +28 -76
  153. package/types/radix-ng-primitives-preview-card.d.ts +359 -0
  154. package/types/radix-ng-primitives-progress.d.ts +175 -48
  155. package/types/radix-ng-primitives-radio.d.ts +55 -25
  156. package/types/radix-ng-primitives-roving-focus.d.ts +33 -23
  157. package/types/radix-ng-primitives-scroll-area.d.ts +253 -0
  158. package/types/radix-ng-primitives-select.d.ts +475 -177
  159. package/types/radix-ng-primitives-separator.d.ts +7 -32
  160. package/types/radix-ng-primitives-slider.d.ts +315 -201
  161. package/types/radix-ng-primitives-stepper.d.ts +5 -7
  162. package/types/radix-ng-primitives-switch.d.ts +86 -71
  163. package/types/radix-ng-primitives-tabs.d.ts +213 -79
  164. package/types/radix-ng-primitives-time-field.d.ts +42 -27
  165. package/types/radix-ng-primitives-toast.d.ts +378 -0
  166. package/types/radix-ng-primitives-toggle-group.d.ts +86 -164
  167. package/types/radix-ng-primitives-toggle.d.ts +43 -53
  168. package/types/radix-ng-primitives-toolbar.d.ts +164 -38
  169. package/types/radix-ng-primitives-tooltip.d.ts +348 -384
  170. package/types/radix-ng-primitives-visually-hidden.d.ts +19 -19
  171. package/dropdown-menu/README.md +0 -1
  172. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +0 -581
  173. package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +0 -1
  174. package/fesm2022/radix-ng-primitives-hover-card.mjs +0 -1238
  175. package/fesm2022/radix-ng-primitives-hover-card.mjs.map +0 -1
  176. package/fesm2022/radix-ng-primitives-select2.mjs +0 -897
  177. package/fesm2022/radix-ng-primitives-select2.mjs.map +0 -1
  178. package/fesm2022/radix-ng-primitives-tooltip2.mjs +0 -735
  179. package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +0 -1
  180. package/hover-card/README.md +0 -3
  181. package/select2/README.md +0 -3
  182. package/tooltip2/README.md +0 -3
  183. package/types/radix-ng-primitives-dropdown-menu.d.ts +0 -171
  184. package/types/radix-ng-primitives-hover-card.d.ts +0 -471
  185. package/types/radix-ng-primitives-select2.d.ts +0 -511
  186. package/types/radix-ng-primitives-tooltip2.d.ts +0 -325
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radix-ng-primitives-toast.mjs","sources":["../../../packages/primitives/toast/src/toast-provider.ts","../../../packages/primitives/toast/src/toast-swipe.ts","../../../packages/primitives/toast/src/toast-root.ts","../../../packages/primitives/toast/src/toast-action.ts","../../../packages/primitives/toast/src/toast-close.ts","../../../packages/primitives/toast/src/toast-content.ts","../../../packages/primitives/toast/src/toast-description.ts","../../../packages/primitives/toast/src/toast-portal.ts","../../../packages/primitives/toast/src/toast-positioner.ts","../../../packages/primitives/toast/src/toast-title.ts","../../../packages/primitives/toast/src/toast-viewport.ts","../../../packages/primitives/toast/index.ts","../../../packages/primitives/toast/radix-ng-primitives-toast.ts"],"sourcesContent":["import { computed, Directive, effect, inject, Injectable, input, Provider, signal } from '@angular/core';\nimport { RdxIdGenerator } from '@radix-ng/primitives/core';\nimport { RdxToastAddOptions, RdxToastObject, RdxToastPromiseOptions } from './toast.types';\n\n/** Default auto-dismiss delay (ms) applied when a toast omits `timeout`. */\nconst DEFAULT_TIMEOUT = 5000;\n/** Max number of toasts kept in the queue; the oldest is dropped past this. */\nconst DEFAULT_LIMIT = 3;\n\ninterface TimerState {\n /** Active `setTimeout` handle, or `null` while paused / not scheduled. */\n handle: ReturnType<typeof setTimeout> | null;\n /** Remaining time (ms) when paused. */\n remaining: number;\n /** Timestamp (ms) the current run started, for computing `remaining` on pause. */\n start: number;\n}\n\n/**\n * App-level coordinator and imperative API for toasts — the Angular counterpart of Base UI's\n * `<Toast.Provider>` plus `useToastManager()`. Holds the queue as a signal that `RdxToastViewport`\n * renders, owns each toast's auto-dismiss timer (pausable while the viewport is hovered/focused),\n * and exposes `add` / `update` / `close` / `promise`.\n *\n * Provide it once near the app root with {@link provideRdxToastManager} or the `[rdxToastProvider]`\n * directive, then inject `RdxToastManager` anywhere to push toasts.\n */\n@Injectable()\nexport class RdxToastManager {\n private readonly idGenerator = inject(RdxIdGenerator);\n\n private readonly _toasts = signal<RdxToastObject[]>([]);\n /** The live queue, oldest first. Render it in `RdxToastViewport` (e.g. via `@for`). */\n readonly toasts = this._toasts.asReadonly();\n\n /** Whether any toast is currently in the queue. */\n readonly hasToasts = computed(() => this._toasts().length > 0);\n\n private readonly _expanded = signal(false);\n /** Whether the stack is expanded (viewport hovered or focused) — drives `data-expanded`. */\n readonly expanded = this._expanded.asReadonly();\n\n private readonly _heights = signal<Record<string, number>>({});\n /** Measured heights (px) per toast id, reported by each `RdxToastRoot` for expanded-stack offsets. */\n readonly heights = this._heights.asReadonly();\n\n /**\n * Per-toast stacking metrics, computed once for the whole queue (front = newest, index `0`):\n * `index` is the distance from the front and `offsetY` is the combined height of the toasts\n * stacked in front. Roots read this by id instead of each rescanning the queue (O(n) vs O(n²)).\n */\n readonly layout = computed<Record<string, { index: number; offsetY: number }>>(() => {\n const list = this._toasts();\n const heights = this._heights();\n const result: Record<string, { index: number; offsetY: number }> = {};\n let offsetInFront = 0;\n for (let i = list.length - 1; i >= 0; i--) {\n const toast = list[i];\n result[toast.id] = { index: list.length - 1 - i, offsetY: offsetInFront };\n offsetInFront += heights[toast.id] ?? 0;\n }\n return result;\n });\n\n /** Max number of simultaneously visible toasts. Configurable via `[rdxToastProvider]`. */\n limit = DEFAULT_LIMIT;\n\n /** Default auto-dismiss delay (ms) for toasts that omit `timeout`. Set via `[rdxToastProvider]`. */\n defaultTimeout = DEFAULT_TIMEOUT;\n\n private readonly timers = new Map<string, TimerState>();\n /** Nested-pause depth so overlapping holds (hover + swipe) resume only when all release. */\n private pauseDepth = 0;\n\n /** Queue a new toast. Returns its id (generated when not supplied). */\n add<Data = unknown>(options: RdxToastAddOptions<Data>): string {\n const id = options.id ?? this.idGenerator.getId('rdx-toast-');\n const toast: RdxToastObject<Data> = {\n ...options,\n id,\n priority: options.priority ?? 'low',\n transitionStatus: 'starting'\n };\n\n // Re-adding an id that is mid-dismissal resurrects it rather than updating it: finish the\n // abandoned dismissal so its leave handler can't later remove the replacement, and its\n // `onRemove` still fires. (A same-id toast that is still open is a normal update — left alone.)\n const existing = this._toasts().find((t) => t.id === id);\n if (existing?.transitionStatus === 'ending') {\n this.clearTimer(id);\n existing.onRemove?.();\n }\n\n let evicted: RdxToastObject[] = [];\n this._toasts.update((toasts) => {\n const next = [...toasts.filter((t) => t.id !== id), toast as RdxToastObject];\n // Enforce the limit by dropping the oldest entries.\n const overflow = next.length - this.limit;\n if (overflow > 0) {\n evicted = next.slice(0, overflow);\n return next.slice(overflow);\n }\n return next;\n });\n\n // Fully retire evicted toasts (timer + height + callback), not just their timers.\n evicted.forEach((dropped) => {\n this.clearTimer(dropped.id);\n this.clearHeight(dropped.id);\n dropped.onRemove?.();\n });\n\n this.scheduleTimeout(toast);\n return id;\n }\n\n /** Merge new options into an existing toast (no-op if the id is unknown). */\n update<Data = unknown>(id: string, options: Partial<RdxToastAddOptions<Data>>): void {\n this._toasts.update((toasts) =>\n toasts.map((toast) => (toast.id === id ? { ...toast, ...options, id } : toast))\n );\n const toast = this._toasts().find((t) => t.id === id);\n if (toast) {\n this.scheduleTimeout(toast);\n }\n }\n\n /**\n * Begin dismissing a toast: fire `onClose`, then remove it after the leave animation.\n * Omit `id` to dismiss every toast at once (mirrors Base UI's `close()`).\n */\n close(id?: string): void {\n if (id === undefined) {\n this._toasts().forEach((toast) => this.close(toast.id));\n return;\n }\n\n const toast = this._toasts().find((t) => t.id === id);\n if (!toast) {\n return;\n }\n\n this.clearTimer(id);\n toast.onClose?.();\n\n this._toasts.update((toasts) => toasts.map((t) => (t.id === id ? { ...t, transitionStatus: 'ending' } : t)));\n }\n\n /**\n * Remove a toast from the queue immediately. `RdxToastRoot` calls this once its leave animation\n * has finished; call it directly only when there is no exit animation.\n */\n remove(id: string): void {\n const toast = this._toasts().find((t) => t.id === id);\n this.clearTimer(id);\n this._toasts.update((toasts) => toasts.filter((t) => t.id !== id));\n this.clearHeight(id);\n toast?.onRemove?.();\n }\n\n /** Toggle the expanded (hover/focus) state of the stack. Called by the viewport. */\n setExpanded(expanded: boolean): void {\n this._expanded.set(expanded);\n }\n\n /** Record a toast's measured height (px) for expanded-stack offset math. Called by each root. */\n setHeight(id: string, height: number): void {\n this._heights.update((heights) => (heights[id] === height ? heights : { ...heights, [id]: height }));\n }\n\n /** Pause every auto-dismiss timer (e.g. while the viewport is hovered, focused, or being swiped). */\n pauseAll(): void {\n if (this.pauseDepth++ > 0) {\n return;\n }\n const now = Date.now();\n this.timers.forEach((timer) => {\n if (timer.handle !== null) {\n clearTimeout(timer.handle);\n timer.remaining -= now - timer.start;\n timer.handle = null;\n }\n });\n }\n\n /** Release one pause; auto-dismiss timers resume only once every hold has released. */\n resumeAll(): void {\n if (this.pauseDepth === 0 || --this.pauseDepth > 0) {\n return;\n }\n const now = Date.now();\n this.timers.forEach((timer, id) => {\n if (timer.handle === null && timer.remaining > 0) {\n timer.start = now;\n timer.handle = setTimeout(() => this.close(id), timer.remaining);\n }\n });\n }\n\n /**\n * Drive a toast through a promise's lifecycle: show `loading`, then swap to `success` or\n * `error` copy when it settles. Returns the original promise for chaining.\n */\n async promise<Value, Data = unknown>(\n promise: Promise<Value>,\n options: RdxToastPromiseOptions<Value, Data>\n ): Promise<Value> {\n const id = this.add<Data>({ ...resolveCopy(options.loading), timeout: 0, loading: true });\n\n try {\n const value = await promise;\n this.update<Data>(id, { ...resolveCopy(options.success, value), loading: false, timeout: DEFAULT_TIMEOUT });\n return value;\n } catch (error) {\n this.update<Data>(id, { ...resolveCopy(options.error, error), loading: false, timeout: DEFAULT_TIMEOUT });\n throw error;\n }\n }\n\n private scheduleTimeout(toast: RdxToastObject): void {\n this.clearTimer(toast.id);\n\n const timeout = toast.timeout ?? this.defaultTimeout;\n if (timeout <= 0 || toast.loading) {\n return;\n }\n\n const timer: TimerState = { handle: null, remaining: timeout, start: Date.now() };\n if (this.pauseDepth === 0) {\n timer.handle = setTimeout(() => this.close(toast.id), timeout);\n }\n this.timers.set(toast.id, timer);\n }\n\n private clearTimer(id: string): void {\n const timer = this.timers.get(id);\n if (timer?.handle != null) {\n clearTimeout(timer.handle);\n }\n this.timers.delete(id);\n }\n\n private clearHeight(id: string): void {\n this._heights.update((heights) => {\n if (!(id in heights)) {\n return heights;\n }\n const next = { ...heights };\n delete next[id];\n return next;\n });\n }\n}\n\n/** Normalize a string-or-options promise-copy entry (optionally derived from the settled value). */\nfunction resolveCopy<Value, Data>(\n entry: RdxToastAddOptions<Data> | string | ((value: Value) => RdxToastAddOptions<Data> | string),\n value?: Value\n): RdxToastAddOptions<Data> {\n const resolved = typeof entry === 'function' ? entry(value as Value) : entry;\n return typeof resolved === 'string' ? { title: resolved } : resolved;\n}\n\n/** Provide a {@link RdxToastManager} for an app (e.g. in `app.config.ts`). */\nexport function provideRdxToastManager(): Provider[] {\n return [RdxToastManager];\n}\n\n/**\n * Hosts a {@link RdxToastManager} for its subtree. Put it on a wrapping element (or the app root)\n * so descendant viewports and components share one queue. `limit` caps simultaneously visible toasts.\n */\n@Directive({\n selector: '[rdxToastProvider]',\n exportAs: 'rdxToastProvider',\n providers: [RdxToastManager]\n})\nexport class RdxToastProvider {\n private readonly manager = inject(RdxToastManager);\n\n /** Max number of toasts shown at once. */\n readonly limit = input<number>(DEFAULT_LIMIT);\n\n /** Default auto-dismiss delay (ms) for toasts that omit their own `timeout`. `0` disables it. */\n readonly timeout = input<number>(DEFAULT_TIMEOUT);\n\n constructor() {\n // `limit` / `defaultTimeout` are plain fields on the manager; keep them in sync with inputs.\n effect(() => {\n this.manager.limit = this.limit();\n this.manager.defaultTimeout = this.timeout();\n });\n }\n}\n","import { assertInInjectionContext, DestroyRef, inject } from '@angular/core';\nimport { usePointerDrag } from '@radix-ng/primitives/core';\n\n/** Direction a swipe travels to dismiss a toast. */\nexport type RdxToastSwipeDirection = 'up' | 'down' | 'left' | 'right';\n\n/** Unit vectors per dismiss direction (screen coordinates: +y is down). */\nconst UNIT: Record<RdxToastSwipeDirection, { x: number; y: number }> = {\n up: { x: 0, y: -1 },\n down: { x: 0, y: 1 },\n left: { x: -1, y: 0 },\n right: { x: 1, y: 0 }\n};\n\n/** Default travel (px) past which a release dismisses. */\nconst DEFAULT_THRESHOLD = 45;\n/** Signed velocity (px/ms) toward the dismiss direction that flicks a toast away. */\nconst FLICK_VELOCITY = 0.3;\n/** iOS-style resistance when dragging opposite the dismiss direction. */\nconst RUBBER_BAND = 0.5;\n\nexport interface RdxToastSwipeConfig {\n /** The toast element the gesture lives on (CSS variables + data attributes are written here). */\n element: () => HTMLElement;\n /** Allowed dismiss directions; the gesture follows whichever the user drags toward most. */\n directions: () => RdxToastSwipeDirection[];\n /** Whether the gesture is armed (false while the toast is leaving). */\n enabled: () => boolean;\n /** Travel (px) past which a release dismisses. Defaults to {@link DEFAULT_THRESHOLD}. */\n threshold?: number;\n /** Called once per release that commits to dismissal. */\n onDismiss: (event: PointerEvent) => void;\n /** Called when a swipe actually begins (e.g. to pause auto-dismiss timers). */\n onPress?: () => void;\n /** Called when a started swipe ends, dismissing or not (balances {@link RdxToastSwipeConfig.onPress}). */\n onRelease?: () => void;\n}\n\n/**\n * Headless swipe-to-dismiss for a toast, built on the shared {@link usePointerDrag} lifecycle (which\n * owns pointer capture, the start threshold, window listeners, and tap/cancel handling). This layer\n * adds the toast-specific direction projection, rubber-banding, flick detection, and the styling\n * contract — it applies no transform itself:\n *\n * - `--toast-swipe-movement-x` / `--toast-swipe-movement-y` — signed px offset along the active axis.\n * - `[data-swiping]` — present while a gesture is active (drive `transition: none` off this).\n * - `[data-swipe-direction]` — the active direction.\n * - `[data-swipe-dismiss]` — present briefly when a release commits to dismissal.\n *\n * Mark inner interactive regions with `[data-toast-swipe-ignore]` to opt them out of the gesture.\n * `RdxToastRoot` (the gesture host) sets `touch-action: none` so a touch-drag is not stolen by native\n * scrolling — without it the gesture only works with a mouse, not on touch devices.\n * Must be called from an injection context (a directive constructor).\n */\nexport function useToastSwipe(config: RdxToastSwipeConfig): void {\n assertInInjectionContext(useToastSwipe);\n\n const el = () => config.element();\n const axisSize = (direction: RdxToastSwipeDirection | null) =>\n direction === 'left' || direction === 'right' ? el().offsetWidth : el().offsetHeight;\n\n const rubber = (distance: number, direction: RdxToastSwipeDirection | null) => {\n const size = axisSize(direction) || 1;\n return (1 - 1 / ((Math.abs(distance) * RUBBER_BAND) / size + 1)) * size;\n };\n\n let active = false;\n let startX = 0;\n let startY = 0;\n let direction: RdxToastSwipeDirection | null = null;\n let pending = 0;\n let lastProjected = 0;\n let lastTime = 0;\n let velocity = 0;\n\n const write = (offset: number, dir: RdxToastSwipeDirection | null) => {\n const unit = dir ? UNIT[dir] : { x: 0, y: 0 };\n const node = el();\n node.style.setProperty('--toast-swipe-movement-x', `${unit.x * offset}px`);\n node.style.setProperty('--toast-swipe-movement-y', `${unit.y * offset}px`);\n };\n\n /** Pick the allowed direction the drag points toward most, with its signed projection (px). */\n const project = (dx: number, dy: number) => {\n let best: RdxToastSwipeDirection | null = null;\n let bestProjection = 0;\n for (const dir of config.directions()) {\n const unit = UNIT[dir];\n const projection = dx * unit.x + dy * unit.y;\n if (projection > bestProjection) {\n bestProjection = projection;\n best = dir;\n }\n }\n return { direction: best, projection: bestProjection };\n };\n\n usePointerDrag({\n canStart: (event) => {\n if (!config.enabled()) {\n return false;\n }\n return !(event.target as Element | null)?.closest('[data-toast-swipe-ignore]');\n },\n onStart: (event) => {\n active = true;\n startX = event.clientX;\n startY = event.clientY;\n direction = null;\n pending = 0;\n lastProjected = 0;\n lastTime = event.timeStamp;\n velocity = 0;\n\n el().setAttribute('data-swiping', '');\n el().removeAttribute('data-swipe-dismiss');\n config.onPress?.();\n },\n onMove: (event) => {\n // Abort if the toast began leaving mid-drag; the end handler settles back.\n if (!config.enabled()) {\n return false;\n }\n\n const dx = event.clientX - startX;\n const dy = event.clientY - startY;\n const { direction: dir, projection } = project(dx, dy);\n\n if (dir) {\n direction = dir;\n }\n el().setAttribute('data-swipe-direction', direction ?? '');\n\n // Move freely toward the dismiss direction; resist dragging the other way.\n pending = projection >= 0 ? projection : -rubber(projection, direction);\n\n const dt = event.timeStamp - lastTime;\n if (dt > 0) {\n velocity = (projection - lastProjected) / dt;\n lastProjected = projection;\n lastTime = event.timeStamp;\n }\n\n write(pending, direction);\n return true;\n },\n onEnd: (event, committed) => {\n active = false;\n el().removeAttribute('data-swiping');\n\n const threshold = config.threshold ?? DEFAULT_THRESHOLD;\n const dismiss = committed && config.enabled() && (pending >= threshold || velocity >= FLICK_VELOCITY);\n\n if (dismiss) {\n el().setAttribute('data-swipe-dismiss', '');\n config.onDismiss(event);\n } else {\n // Settle home; the consumer's `transition` animates the snap-back.\n write(0, direction);\n }\n\n config.onRelease?.();\n direction = null;\n }\n });\n\n // usePointerDrag does not call onEnd when the host is destroyed mid-gesture; balance the onPress\n // that paused the timers so the manager doesn't stay paused forever.\n inject(DestroyRef).onDestroy(() => {\n if (active) {\n active = false;\n config.onRelease?.();\n }\n });\n}\n","import { computed, DestroyRef, Directive, effect, ElementRef, inject, Injector, input, signal } from '@angular/core';\nimport { createContext, elementSize, injectId } from '@radix-ng/primitives/core';\nimport { RdxToastManager } from './toast-provider';\nimport { RdxToastSwipeDirection, useToastSwipe } from './toast-swipe';\nimport { RdxToastObject } from './toast.types';\n\nexport interface RdxToastRootContext {\n /** The toast model this part tree renders. */\n readonly toast: () => RdxToastObject;\n /** `id` of the title element, wired to `aria-labelledby` once a title registers. */\n readonly titleId: string;\n /** `id` of the description element, wired to `aria-describedby` once a description registers. */\n readonly descriptionId: string;\n /** Register/unregister the title part so the root only points `aria-labelledby` at a real element. */\n readonly setTitlePresent: (present: boolean) => void;\n /** Register/unregister the description part so `aria-describedby` only targets a real element. */\n readonly setDescriptionPresent: (present: boolean) => void;\n /** Begin dismissing this toast. */\n readonly close: () => void;\n}\n\nexport const [injectRdxToastRootContext, provideRdxToastRootContext] =\n createContext<RdxToastRootContext>('RdxToastRootContext');\n\nconst rootContext = (): RdxToastRootContext => {\n const instance = inject(RdxToastRoot);\n return {\n toast: () => instance.toast(),\n titleId: instance.titleId,\n descriptionId: instance.descriptionId,\n setTitlePresent: (present) => instance.titlePresent.set(present),\n setDescriptionPresent: (present) => instance.descriptionPresent.set(present),\n close: () => instance.close()\n };\n};\n\n/**\n * A single toast — the Angular counterpart of `<Toast.Root>`. Bind the toast model from the\n * viewport's `@for`; this directive owns the announcement `role`, the `data-state` enter/leave\n * contract, swipe-to-dismiss, and the stacking variables consumers style against.\n *\n * Stacking / styling contract written to the host (no transform is applied for you):\n * - `--toast-index` — position from the front (`0` = frontmost).\n * - `--toast-height` — this toast's measured height (px).\n * - `--toast-offset-y` — combined height (px) of the toasts stacked in front, for expanded layout.\n * - `--toast-swipe-movement-x` / `--toast-swipe-movement-y` — live swipe offset (px).\n * - `[data-front]` — present on the frontmost toast.\n * - `[data-expanded]` — present while the viewport is hovered/focused.\n * - `[data-state]` — `open` while visible, `closed` once dismissal begins.\n * - `[data-swiping]` / `[data-swipe-direction]` / `[data-swipe-dismiss]` — gesture state.\n *\n * When the leave animation (driven by `data-state=\"closed\"`) ends, the toast leaves the queue.\n */\n@Directive({\n selector: '[rdxToastRoot]',\n exportAs: 'rdxToastRoot',\n providers: [provideRdxToastRootContext(rootContext)],\n host: {\n // Own the swipe gesture's touch behavior on the element usePointerDrag binds to. Without\n // touch-action:none a touch-drag is claimed by native scrolling (pointercancel fires before\n // the gesture starts), so swipe-to-dismiss works with a mouse but not on touch devices. The\n // toast surface never scrolls, so disabling pan/zoom here is safe; user-select stops text\n // selection mid-swipe. Mirrors number-field's scrub area.\n '[style.touch-action]': '\"none\"',\n '[style.user-select]': '\"none\"',\n '[style.-webkit-user-select]': '\"none\"',\n '[attr.role]': 'role()',\n '[attr.aria-labelledby]': 'titlePresent() ? titleId : undefined',\n '[attr.aria-describedby]': 'descriptionPresent() ? descriptionId : undefined',\n '[attr.data-state]': 'dataState()',\n '[attr.data-type]': 'toast().type ?? undefined',\n '[attr.data-front]': 'index() === 0 ? \"\" : undefined',\n '[attr.data-expanded]': 'manager.expanded() ? \"\" : undefined',\n '[style.--toast-index]': 'index()',\n '[style.--toast-height]': 'height() + \"px\"',\n '[style.--toast-offset-y]': 'offsetY() + \"px\"',\n '(animationend)': 'onAnimationEnd()'\n }\n})\nexport class RdxToastRoot {\n protected readonly manager = inject(RdxToastManager);\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n\n /** The toast model to render — pass the item from the viewport's `@for`. */\n readonly toast = input.required<RdxToastObject>();\n\n /** Allowed swipe-to-dismiss directions. Accepts a single direction or a list. */\n readonly swipeDirection = input<RdxToastSwipeDirection | RdxToastSwipeDirection[]>(['down', 'right']);\n\n readonly titleId = injectId('rdx-toast-title-');\n readonly descriptionId = injectId('rdx-toast-description-');\n\n /** Whether a title / description part has registered, gating the aria-* references. */\n readonly titlePresent = signal(false);\n readonly descriptionPresent = signal(false);\n\n private readonly size = elementSize({ elementRef: this.elementRef, injector: this.injector });\n /** This toast's measured height (px). */\n readonly height = computed(() => this.size().height);\n\n /** Position from the front of the stack — `0` is the newest/frontmost toast. */\n readonly index = computed(() => this.manager.layout()[this.toast().id]?.index ?? 0);\n\n /** Combined height (px) of the toasts stacked in front of this one (for expanded layout). */\n readonly offsetY = computed(() => this.manager.layout()[this.toast().id]?.offsetY ?? 0);\n\n /** `alert` (assertive) for high-priority toasts, otherwise `status`. */\n readonly role = computed(() => (this.toast().priority === 'high' ? 'alert' : 'status'));\n\n /** `open` while visible, `closed` once dismissal begins — drives enter/leave animations. */\n readonly dataState = computed(() => (this.toast().transitionStatus === 'ending' ? 'closed' : 'open'));\n\n private readonly directions = computed<RdxToastSwipeDirection[]>(() => {\n const value = this.swipeDirection();\n return Array.isArray(value) ? value : [value];\n });\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n // Mirror the measured height into the manager for the expanded-stack offset math.\n effect(() => {\n this.manager.setHeight(this.toast().id, this.size().height);\n });\n\n useToastSwipe({\n element: () => this.elementRef.nativeElement,\n directions: () => this.directions(),\n enabled: () => this.toast().transitionStatus !== 'ending',\n onDismiss: () => this.close(),\n onPress: () => this.manager.pauseAll(),\n onRelease: () => this.manager.resumeAll()\n });\n\n // Replay the enter animation on an upsert that bumps `updateKey`. The toast keeps the same\n // DOM node (tracked by id), so restart the running animation by clearing and re-reading it.\n let firstKey = true;\n effect(() => {\n this.toast().updateKey;\n if (firstKey) {\n firstKey = false;\n return;\n }\n const node = this.elementRef.nativeElement;\n node.style.animation = 'none';\n void node.offsetWidth; // force reflow so the animation can restart\n node.style.animation = '';\n });\n\n destroyRef.onDestroy(() => this.manager.setHeight(this.toast().id, 0));\n }\n\n close(): void {\n this.manager.close(this.toast().id);\n }\n\n protected onAnimationEnd(): void {\n // Remove from the queue only after the leave (\"closed\") animation completes.\n if (this.toast().transitionStatus === 'ending') {\n this.manager.remove(this.toast().id);\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectRdxToastRootContext } from './toast-root';\n\n/**\n * An action button inside a toast (e.g. \"Undo\"). Unlike {@link RdxToastClose} it does not dismiss\n * on its own — wire your handler with `(click)` and call `close()` from the exposed context when\n * the action should also close the toast.\n */\n@Directive({\n selector: '[rdxToastAction]',\n exportAs: 'rdxToastAction',\n host: {\n type: 'button'\n }\n})\nexport class RdxToastAction {\n /** The toast root context, so handlers can read the toast or dismiss it after acting. */\n readonly rootContext = injectRdxToastRootContext();\n}\n","import { Directive } from '@angular/core';\nimport { injectRdxToastRootContext } from './toast-root';\n\n/** Button that dismisses its toast. Put it on a native `<button>` for built-in semantics. */\n@Directive({\n selector: '[rdxToastClose]',\n exportAs: 'rdxToastClose',\n host: {\n type: 'button',\n '(click)': 'rootContext.close()'\n }\n})\nexport class RdxToastClose {\n protected readonly rootContext = injectRdxToastRootContext();\n}\n","import { Directive } from '@angular/core';\nimport { injectRdxToastRootContext } from './toast-root';\n\n/**\n * Wraps a toast's inner parts (title, description, actions) — the Angular counterpart of\n * `<Toast.Content>`. Headless: it carries no styles; consumers apply `overflow: hidden` to clip\n * taller toasts during the stack/expand animation. It mirrors the root's `data-state` so content\n * can transition together with the root.\n */\n@Directive({\n selector: '[rdxToastContent]',\n exportAs: 'rdxToastContent',\n host: {\n '[attr.data-state]': 'rootContext.toast().transitionStatus === \"ending\" ? \"closed\" : \"open\"'\n }\n})\nexport class RdxToastContent {\n protected readonly rootContext = injectRdxToastRootContext();\n}\n","import { DestroyRef, Directive, inject } from '@angular/core';\nimport { injectRdxToastRootContext } from './toast-root';\n\n/** Supporting body text for a toast; registers so `aria-describedby` only targets a real node. */\n@Directive({\n selector: '[rdxToastDescription]',\n exportAs: 'rdxToastDescription',\n host: {\n '[id]': 'rootContext.descriptionId'\n }\n})\nexport class RdxToastDescription {\n protected readonly rootContext = injectRdxToastRootContext();\n\n constructor() {\n this.rootContext.setDescriptionPresent(true);\n inject(DestroyRef).onDestroy(() => this.rootContext.setDescriptionPresent(false));\n }\n}\n","import { Directive } from '@angular/core';\nimport { RdxPortal } from '@radix-ng/primitives/portal';\n\n/**\n * Moves the toast viewport to a different part of the DOM — the Angular counterpart of\n * `<Toast.Portal>`. Defaults to `document.body`; pass `container` to target another element.\n */\n@Directive({\n selector: '[rdxToastPortal]',\n exportAs: 'rdxToastPortal',\n hostDirectives: [\n {\n directive: RdxPortal,\n inputs: ['container']\n }\n ]\n})\nexport class RdxToastPortal {}\n","import { Directive, inject } from '@angular/core';\nimport { provideRdxPopperContentConfig, RdxPopper, RdxPopperContentWrapper } from '@radix-ng/primitives/popper';\n\n/**\n * Positions an anchored toast against an element — the Angular counterpart of `<Toast.Positioner>`.\n * Composes the popper machinery so a toast can point at a trigger instead of living in the stack.\n *\n * Bind `anchor` (and optionally `side`/`align`/offsets) — typically from a toast's `positionerProps`.\n * It hosts its own `RdxPopper` so it is self-contained (no surrounding `rdxPopperRoot` needed), and\n * mirrors the popper measurements as friendlier CSS variables plus `data-side` / `data-align`.\n */\n@Directive({\n selector: '[rdxToastPositioner]',\n exportAs: 'rdxToastPositioner',\n providers: [\n provideRdxPopperContentConfig({\n side: 'top',\n sideOffset: 8,\n align: 'center',\n arrowPadding: 6,\n collisionPadding: 8,\n updatePositionStrategy: 'always'\n })\n ],\n hostDirectives: [\n RdxPopper,\n {\n directive: RdxPopperContentWrapper,\n inputs: [\n 'anchor',\n 'side',\n 'sideOffset',\n 'align',\n 'alignOffset',\n 'arrowPadding',\n 'avoidCollisions',\n 'collisionBoundary',\n 'collisionPadding',\n 'sticky',\n 'hideWhenDetached',\n 'positionStrategy',\n 'updatePositionStrategy'\n ]\n }\n ],\n host: {\n '[attr.data-side]': 'wrapper.placedSide()',\n '[attr.data-align]': 'wrapper.placedAlign()',\n '[attr.data-anchor-hidden]': 'wrapper.anchorHidden() ? \"\" : undefined',\n '[style.--toast-anchor-width]': '\"var(--radix-popper-anchor-width)\"',\n '[style.--toast-transform-origin]': '\"var(--radix-popper-transform-origin)\"'\n }\n})\nexport class RdxToastPositioner {\n protected readonly wrapper = inject(RdxPopperContentWrapper);\n}\n","import { DestroyRef, Directive, inject } from '@angular/core';\nimport { injectRdxToastRootContext } from './toast-root';\n\n/** Accessible title for a toast; registers so the root only points `aria-labelledby` at a real node. */\n@Directive({\n selector: '[rdxToastTitle]',\n exportAs: 'rdxToastTitle',\n host: {\n '[id]': 'rootContext.titleId'\n }\n})\nexport class RdxToastTitle {\n protected readonly rootContext = injectRdxToastRootContext();\n\n constructor() {\n this.rootContext.setTitlePresent(true);\n inject(DestroyRef).onDestroy(() => this.rootContext.setTitlePresent(false));\n }\n}\n","import { DestroyRef, Directive, effect, inject, signal } from '@angular/core';\nimport { RdxToastManager } from './toast-provider';\n\n/**\n * The positioned region that holds the visible toasts — the Angular counterpart of\n * `<Toast.Viewport>`. Exposes the queue for templates to render, and while it is hovered or focused\n * it expands the stack (`data-expanded` on each root) and pauses every auto-dismiss timer, resuming\n * once neither hover nor focus remains — matching Base UI.\n *\n * Headless: it carries no positioning styles. Consumers position it (e.g. fixed bottom-right) and\n * iterate `viewport.toasts()` with `@for`.\n */\n@Directive({\n selector: '[rdxToastViewport]',\n exportAs: 'rdxToastViewport',\n host: {\n role: 'region',\n tabindex: '-1',\n '(mouseenter)': 'hovered.set(true)',\n '(mouseleave)': 'hovered.set(false)',\n '(focusin)': 'focused.set(true)',\n '(focusout)': 'onFocusOut($event)'\n }\n})\nexport class RdxToastViewport {\n protected readonly manager = inject(RdxToastManager);\n\n /** The live toast queue to render. */\n readonly toasts = this.manager.toasts;\n\n protected readonly hovered = signal(false);\n protected readonly focused = signal(false);\n\n /** Tracks the last expanded state so pause/resume stay balanced across transitions. */\n private wasExpanded = false;\n\n constructor() {\n effect(() => {\n const expanded = this.hovered() || this.focused();\n this.manager.setExpanded(expanded);\n\n if (expanded && !this.wasExpanded) {\n this.wasExpanded = true;\n this.manager.pauseAll();\n } else if (!expanded && this.wasExpanded) {\n this.wasExpanded = false;\n this.manager.resumeAll();\n }\n });\n\n // If the viewport is destroyed while still expanded, balance the outstanding pause so a\n // longer-lived manager doesn't stay paused forever.\n inject(DestroyRef).onDestroy(() => {\n if (this.wasExpanded) {\n this.wasExpanded = false;\n this.manager.setExpanded(false);\n this.manager.resumeAll();\n }\n });\n }\n\n protected onFocusOut(event: FocusEvent): void {\n // Only clear focus when it actually leaves the viewport subtree.\n const next = event.relatedTarget as Node | null;\n const host = event.currentTarget as HTMLElement | null;\n if (!host || !next || !host.contains(next)) {\n this.focused.set(false);\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxToastAction } from './src/toast-action';\nimport { RdxToastClose } from './src/toast-close';\nimport { RdxToastContent } from './src/toast-content';\nimport { RdxToastDescription } from './src/toast-description';\nimport { RdxToastPortal } from './src/toast-portal';\nimport { RdxToastPositioner } from './src/toast-positioner';\nimport { RdxToastProvider } from './src/toast-provider';\nimport { RdxToastRoot } from './src/toast-root';\nimport { RdxToastTitle } from './src/toast-title';\nimport { RdxToastViewport } from './src/toast-viewport';\n\nexport * from './src/toast-action';\nexport * from './src/toast-close';\nexport * from './src/toast-content';\nexport * from './src/toast-description';\nexport * from './src/toast-portal';\nexport * from './src/toast-positioner';\nexport * from './src/toast-provider';\nexport * from './src/toast-root';\nexport * from './src/toast-swipe';\nexport * from './src/toast-title';\nexport * from './src/toast-viewport';\nexport * from './src/toast.types';\n\nexport const toastImports = [\n RdxToastProvider,\n RdxToastPortal,\n RdxToastViewport,\n RdxToastPositioner,\n RdxToastRoot,\n RdxToastContent,\n RdxToastTitle,\n RdxToastDescription,\n RdxToastClose,\n RdxToastAction\n];\n\n@NgModule({\n imports: [...toastImports],\n exports: [...toastImports]\n})\nexport class RdxToastModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;AAIA;AACA,MAAM,eAAe,GAAG,IAAI;AAC5B;AACA,MAAM,aAAa,GAAG,CAAC;AAWvB;;;;;;;;AAQG;MAEU,eAAe,CAAA;AAD5B,IAAA,WAAA,GAAA;AAEqB,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,cAAc,CAAC;AAEpC,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAmB,EAAE,8EAAC;;AAE9C,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;;AAGlC,QAAA,IAAA,CAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,GAAG,CAAC,gFAAC;AAE7C,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,KAAK,gFAAC;;AAEjC,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE;AAE9B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAyB,EAAE,+EAAC;;AAErD,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;AAE7C;;;;AAIG;AACM,QAAA,IAAA,CAAA,MAAM,GAAG,QAAQ,CAAqD,MAAK;AAChF,YAAA,MAAM,IAAI,GAAG,IA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AAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAhBvB,gBAAgB;YAChB,cAAc;YACd,gBAAgB;YAChB,kBAAkB;YAClB,YAAY;YACZ,eAAe;YACf,aAAa;YACb,mBAAmB;YACnB,aAAa;AACb,YAAA,cAAc,aATd,gBAAgB;YAChB,cAAc;YACd,gBAAgB;YAChB,kBAAkB;YAClB,YAAY;YACZ,eAAe;YACf,aAAa;YACb,mBAAmB;YACnB,aAAa;YACb,cAAc,CAAA,EAAA,CAAA,CAAA;+GAOL,cAAc,EAAA,CAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,YAAY,CAAC;AAC1B,oBAAA,OAAO,EAAE,CAAC,GAAG,YAAY;AAC5B,iBAAA;;;ACzCD;;AAEG;;;;"}
@@ -1,313 +1,187 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, input, booleanAttribute, computed, effect, Directive, model, output, signal } from '@angular/core';
2
+ import { model, input, booleanAttribute, output, computed, signal, effect, untracked, Directive, inject } from '@angular/core';
3
+ import { createContext, provideValueAccessor } from '@radix-ng/primitives/core';
3
4
  import * as i1 from '@radix-ng/primitives/roving-focus';
4
- import { RdxRovingFocusItemDirective, RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';
5
- import * as i2 from '@radix-ng/primitives/toggle';
6
- import { RdxToggleDirective } from '@radix-ng/primitives/toggle';
7
- import { provideValueAccessor, isEqual, isValueEqualOrExist, provideToken } from '@radix-ng/primitives/core';
5
+ import { RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';
8
6
 
9
- const RdxToggleGroupItemToken = new InjectionToken('RdxToggleGroupItemToken');
10
- function injectToggleGroupItem() {
11
- return inject(RdxToggleGroupItemToken);
7
+ /** Builds the shared context a {@link RdxToggle} reads when it belongs to this group. */
8
+ function toggleGroupContext(instance) {
9
+ return {
10
+ value: instance.pressedValues,
11
+ disabled: instance.isDisabled,
12
+ multiple: instance.multiple,
13
+ orientation: instance.orientation,
14
+ toggle: (value) => instance.toggle(value)
15
+ };
12
16
  }
13
-
14
- const RdxToggleGroupToken = new InjectionToken('RdxToggleGroupToken');
15
- function injectToggleGroup() {
16
- return inject(RdxToggleGroupToken);
17
- }
18
-
19
17
  /**
20
- * @group Components
18
+ * Shared state and behavior for the toggle group. Concrete directives add the roving-focus group
19
+ * ({@link RdxToggleGroup}) or omit it when an ancestor already owns focus, e.g. a toolbar
20
+ * ({@link RdxToggleGroupWithoutFocus}).
21
21
  */
22
- class RdxToggleGroupItemDirective {
22
+ class RdxToggleGroupBase {
23
23
  constructor() {
24
- this.rdxToggleDirective = inject(RdxToggleDirective);
25
- this.rdxRovingFocusItemDirective = inject(RdxRovingFocusItemDirective);
26
24
  /**
27
- * Access the toggle group.
28
- * @ignore
25
+ * The pressed values. Always an array — a single value is `[value]`. Use with `(onValueChange)`
26
+ * for controlled state.
29
27
  */
30
- this.rootContext = injectToggleGroup();
28
+ this.value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
29
+ /** The values pressed when the group is initially rendered (uncontrolled). */
30
+ this.defaultValue = input(...(ngDevMode ? [undefined, { debugName: "defaultValue" }] : /* istanbul ignore next */ []));
31
31
  /**
32
- * The value of this toggle button.
32
+ * Whether multiple items can be pressed at the same time.
33
33
  *
34
- * @group Props
35
- */
36
- this.value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
37
- /**
38
- * Whether this toggle button is disabled.
39
- * @defaultValue false
40
- * @group Props
41
- */
42
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
43
- this.isPressed = computed(() => {
44
- return this.rootContext.type() === 'single'
45
- ? this.rootContext.value() === this.value()
46
- : this.rootContext.value()?.includes(this.value());
47
- }, ...(ngDevMode ? [{ debugName: "isPressed" }] : /* istanbul ignore next */ []));
48
- this.isDisabled = computed(() => this.rootContext.disabled() || this.rootContext.accessorDisabled() || this.disabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
49
- effect(() => {
50
- this.rdxToggleDirective.cva.writeValue(!!this.isPressed());
51
- this.rdxToggleDirective.cva.setValue(!!this.isPressed());
52
- this.rdxToggleDirective.cva.setDisabledState(this.isDisabled());
53
- this.rdxRovingFocusItemDirective.setActive(!!this.isPressed());
54
- });
55
- }
56
- /**
57
- * @ignore
58
- */
59
- toggle() {
60
- if (this.disabled()) {
61
- return;
62
- }
63
- this.rootContext.toggle(this.value());
64
- }
65
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggleGroupItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
66
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToggleGroupItemDirective, isStandalone: true, selector: "[rdxToggleGroupItem]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "toggle()" } }, providers: [{ provide: RdxToggleGroupItemToken, useExisting: RdxToggleGroupItemDirective }], exportAs: ["rdxToggleGroupItem"], hostDirectives: [{ directive: i1.RdxRovingFocusItemDirective, inputs: ["focusable", "focusable", "active", "active", "allowShiftKey", "allowShiftKey"] }, { directive: i2.RdxToggleDirective, inputs: ["pressed", "pressed", "disabled", "disabled"] }], ngImport: i0 }); }
67
- }
68
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggleGroupItemDirective, decorators: [{
69
- type: Directive,
70
- args: [{
71
- selector: '[rdxToggleGroupItem]',
72
- exportAs: 'rdxToggleGroupItem',
73
- providers: [{ provide: RdxToggleGroupItemToken, useExisting: RdxToggleGroupItemDirective }],
74
- hostDirectives: [
75
- {
76
- directive: RdxRovingFocusItemDirective,
77
- inputs: ['focusable', 'active', 'allowShiftKey']
78
- },
79
- {
80
- directive: RdxToggleDirective,
81
- inputs: ['pressed', 'disabled']
82
- }
83
- ],
84
- host: {
85
- '(click)': 'toggle()'
86
- }
87
- }]
88
- }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
89
-
90
- let nextId$1 = 0;
91
- class RdxToggleGroupWithoutFocusDirective {
92
- constructor() {
93
- /**
94
- * @ignore
95
- */
96
- this.id = `rdx-toggle-group-${nextId$1++}`;
97
- /**
98
- * @group Props
34
+ * @default false
99
35
  */
100
- this.value = model(undefined, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
36
+ this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
101
37
  /**
102
- * @group Props
103
- */
104
- this.type = input('single', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
105
- /**
106
- * Whether the toggle group is disabled.
107
- * @defaultValue false
108
- * @group Props
38
+ * Whether the whole group is disabled.
39
+ *
40
+ * @default false
109
41
  */
110
42
  this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
111
43
  /**
112
- * Event emitted when the selected toggle button changes.
113
- * @group Emits
44
+ * The orientation of the group, controlling arrow-key navigation.
45
+ *
46
+ * @default 'horizontal'
114
47
  */
48
+ this.orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
49
+ /** Event emitted when the pressed values change. */
115
50
  this.onValueChange = output();
51
+ /** @ignore */
52
+ this.pressedValues = computed(() => this.value() ?? [], ...(ngDevMode ? [{ debugName: "pressedValues" }] : /* istanbul ignore next */ []));
116
53
  this.accessorDisabled = signal(false, ...(ngDevMode ? [{ debugName: "accessorDisabled" }] : /* istanbul ignore next */ []));
54
+ /** @ignore */
55
+ this.isDisabled = computed(() => this.disabled() || this.accessorDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
56
+ effect(() => {
57
+ const initial = this.defaultValue();
58
+ if (initial !== undefined && untracked(this.value) === undefined) {
59
+ this.value.set(initial);
60
+ }
61
+ });
117
62
  }
118
- /**
119
- * Toggle a value.
120
- * @param value The value to toggle.
121
- * @ignore
122
- */
63
+ /** @ignore */
123
64
  toggle(value) {
124
- if (this.disabled()) {
65
+ if (this.isDisabled()) {
125
66
  return;
126
67
  }
127
- if (this.type() === 'single') {
128
- this.value.set(value);
68
+ const current = this.pressedValues();
69
+ let next;
70
+ if (this.multiple()) {
71
+ next = current.includes(value) ? current.filter((item) => item !== value) : [...current, value];
129
72
  }
130
73
  else {
131
- this.value.set(((currentValue) => currentValue && Array.isArray(currentValue)
132
- ? currentValue.includes(value)
133
- ? currentValue.filter((v) => v !== value) // delete
134
- : [...currentValue, value] // update
135
- : [value])(this.value()));
74
+ next = current.includes(value) ? [] : [value];
136
75
  }
137
- this.onValueChange.emit(this.value());
138
- this.onChange?.(this.value());
76
+ this.value.set(next);
77
+ this.onValueChange.emit(next);
78
+ this.onChange?.(next);
139
79
  }
140
- /**
141
- * Select a value from Angular forms.
142
- * @param value The value to select.
143
- * @ignore
144
- */
80
+ /** @ignore */
145
81
  writeValue(value) {
146
- this.value.set(value);
82
+ this.value.set(value == null ? [] : Array.isArray(value) ? value : [value]);
147
83
  }
148
- /**
149
- * Register a callback to be called when the value changes.
150
- * @param fn The callback to register.
151
- * @ignore
152
- */
84
+ /** @ignore */
153
85
  registerOnChange(fn) {
154
86
  this.onChange = fn;
155
87
  }
156
- /**
157
- * Register a callback to be called when the toggle group is touched.
158
- * @param fn The callback to register.
159
- * @ignore
160
- */
88
+ /** @ignore */
161
89
  registerOnTouched(fn) {
162
90
  this.onTouched = fn;
163
91
  }
164
- /**
165
- * Set the disabled state of the toggle group.
166
- * @param isDisabled Whether the toggle group is disabled.
167
- * @ignore
168
- */
92
+ /** @ignore */
169
93
  setDisabledState(isDisabled) {
170
94
  this.accessorDisabled.set(isDisabled);
171
95
  }
172
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggleGroupWithoutFocusDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
173
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToggleGroupWithoutFocusDirective, isStandalone: true, selector: "[rdxToggleGroupWithoutFocus]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onValueChange: "onValueChange" }, host: { attributes: { "role": "group" }, listeners: { "focusout": "onTouched?.()" } }, providers: [
174
- { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupWithoutFocusDirective },
175
- provideValueAccessor(RdxToggleGroupWithoutFocusDirective)
176
- ], exportAs: ["rdxToggleGroupWithoutFocus"], ngImport: i0 }); }
96
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggleGroupBase, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
97
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToggleGroupBase, isStandalone: true, inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onValueChange: "onValueChange" }, host: { attributes: { "role": "group" }, listeners: { "focusout": "onTouched?.()" }, properties: { "attr.data-orientation": "orientation()", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.data-multiple": "multiple() ? \"\" : undefined" } }, ngImport: i0 }); }
177
98
  }
178
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggleGroupWithoutFocusDirective, decorators: [{
99
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggleGroupBase, decorators: [{
179
100
  type: Directive,
180
101
  args: [{
181
- selector: '[rdxToggleGroupWithoutFocus]',
182
- exportAs: 'rdxToggleGroupWithoutFocus',
183
- providers: [
184
- { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupWithoutFocusDirective },
185
- provideValueAccessor(RdxToggleGroupWithoutFocusDirective)
186
- ],
187
102
  host: {
188
103
  role: 'group',
104
+ '[attr.data-orientation]': 'orientation()',
105
+ '[attr.data-disabled]': 'isDisabled() ? "" : undefined',
106
+ '[attr.data-multiple]': 'multiple() ? "" : undefined',
189
107
  '(focusout)': 'onTouched?.()'
190
108
  }
191
109
  }]
192
- }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], onValueChange: [{ type: i0.Output, args: ["onValueChange"] }] } });
110
+ }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], defaultValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValue", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], onValueChange: [{ type: i0.Output, args: ["onValueChange"] }] } });
111
+
112
+ const [injectToggleGroupContext, provideToggleGroupContext] = createContext('RdxToggleGroupContext');
193
113
 
194
- let nextId = 0;
195
114
  /**
196
- * @group Components
115
+ * A set of two-state buttons that can be toggled on or off. Owns roving keyboard focus over its
116
+ * `[rdxToggle]` children.
117
+ *
118
+ * @see https://base-ui.com/react/components/toggle-group
197
119
  */
198
- class RdxToggleGroupDirective {
120
+ class RdxToggleGroup extends RdxToggleGroupBase {
199
121
  constructor() {
122
+ super();
123
+ /** Text direction for arrow-key navigation. */
124
+ this.dir = input('ltr', ...(ngDevMode ? [{ debugName: "dir" }] : /* istanbul ignore next */ []));
200
125
  /**
201
- * @ignore
202
- */
203
- this.id = `rdx-toggle-group-${nextId++}`;
204
- /**
205
- * @group Props
206
- */
207
- this.value = model(undefined, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
208
- /**
209
- * @group Props
210
- */
211
- this.type = input('single', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
212
- /**
213
- * Whether the toggle group is disabled.
214
- * @defaultValue false
215
- * @group Props
216
- */
217
- this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
218
- /**
219
- * Event emitted when the selected toggle button changes.
220
- * @group Emits
126
+ * Whether keyboard navigation should loop from the last item back to the first.
127
+ *
128
+ * @default true
221
129
  */
222
- this.onValueChange = output();
223
- this.accessorDisabled = signal(false, ...(ngDevMode ? [{ debugName: "accessorDisabled" }] : /* istanbul ignore next */ []));
224
- }
225
- /**
226
- * Toggle a value.
227
- * @param value The value to toggle.
228
- * @ignore
229
- */
230
- toggle(value) {
231
- if (this.disabled()) {
232
- return;
233
- }
234
- if (this.type() === 'single') {
235
- this.value.set(isEqual(value, this.value()) ? undefined : value);
236
- }
237
- else {
238
- const modelValueArray = Array.isArray(this.value())
239
- ? [...(this.value() || [])]
240
- : [this.value()].filter(Boolean);
241
- if (isValueEqualOrExist(modelValueArray, value)) {
242
- const index = modelValueArray.findIndex((i) => isEqual(i, value));
243
- modelValueArray.splice(index, 1);
244
- }
245
- else {
246
- modelValueArray.push(value);
247
- }
248
- this.value.set(modelValueArray);
249
- }
250
- this.onValueChange.emit(this.value());
251
- this.onChange?.(this.value());
252
- }
253
- /**
254
- * Select a value from Angular forms.
255
- * @param value The value to select.
256
- * @ignore
257
- */
258
- writeValue(value) {
259
- this.value.set(value);
260
- }
261
- /**
262
- * Register a callback to be called when the value changes.
263
- * @param fn The callback to register.
264
- * @ignore
265
- */
266
- registerOnChange(fn) {
267
- this.onChange = fn;
268
- }
269
- /**
270
- * Register a callback to be called when the toggle group is touched.
271
- * @param fn The callback to register.
272
- * @ignore
273
- */
274
- registerOnTouched(fn) {
275
- this.onTouched = fn;
276
- }
277
- /**
278
- * Set the disabled state of the toggle group.
279
- * @param isDisabled Whether the toggle group is disabled.
280
- * @ignore
281
- */
282
- setDisabledState(isDisabled) {
283
- this.accessorDisabled.set(isDisabled);
130
+ this.loopFocus = input(true, { ...(ngDevMode ? { debugName: "loopFocus" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
131
+ this.rovingFocusGroup = inject(RdxRovingFocusGroupDirective, { self: true });
132
+ effect(() => {
133
+ this.rovingFocusGroup.setOrientation(this.orientation());
134
+ this.rovingFocusGroup.setDir(this.dir());
135
+ this.rovingFocusGroup.setLoop(this.loopFocus());
136
+ });
284
137
  }
285
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggleGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
286
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToggleGroupDirective, isStandalone: true, selector: "[rdxToggleGroup]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onValueChange: "onValueChange" }, host: { attributes: { "role": "group" }, listeners: { "focusout": "onTouched?.()" } }, providers: [
287
- provideToken(RdxToggleGroupToken, RdxToggleGroupDirective),
288
- provideValueAccessor(RdxToggleGroupDirective)
289
- ], exportAs: ["rdxToggleGroup"], hostDirectives: [{ directive: i1.RdxRovingFocusGroupDirective, inputs: ["dir", "dir", "orientation", "orientation", "loop", "loop"] }], ngImport: i0 }); }
138
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggleGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
139
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToggleGroup, isStandalone: true, selector: "[rdxToggleGroup]", inputs: { dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, loopFocus: { classPropertyName: "loopFocus", publicName: "loopFocus", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
140
+ provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroup))),
141
+ provideValueAccessor(RdxToggleGroup)
142
+ ], exportAs: ["rdxToggleGroup"], usesInheritance: true, hostDirectives: [{ directive: i1.RdxRovingFocusGroupDirective }], ngImport: i0 }); }
290
143
  }
291
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggleGroupDirective, decorators: [{
144
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggleGroup, decorators: [{
292
145
  type: Directive,
293
146
  args: [{
294
147
  selector: '[rdxToggleGroup]',
295
148
  exportAs: 'rdxToggleGroup',
149
+ hostDirectives: [RdxRovingFocusGroupDirective],
296
150
  providers: [
297
- provideToken(RdxToggleGroupToken, RdxToggleGroupDirective),
298
- provideValueAccessor(RdxToggleGroupDirective)
299
- ],
300
- hostDirectives: [{ directive: RdxRovingFocusGroupDirective, inputs: ['dir', 'orientation', 'loop'] }],
301
- host: {
302
- role: 'group',
303
- '(focusout)': 'onTouched?.()'
304
- }
151
+ provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroup))),
152
+ provideValueAccessor(RdxToggleGroup)
153
+ ]
154
+ }]
155
+ }], ctorParameters: () => [], propDecorators: { dir: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], loopFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "loopFocus", required: false }] }] } });
156
+
157
+ /**
158
+ * A toggle group that does NOT create its own roving-focus group, for use inside a container that
159
+ * already owns keyboard focus (e.g. a toolbar). The `[rdxToggle]` children register with the nearest
160
+ * ancestor roving-focus group instead. Mirrors Base UI's behavior of skipping its composite root
161
+ * when nested in a toolbar.
162
+ */
163
+ class RdxToggleGroupWithoutFocus extends RdxToggleGroupBase {
164
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggleGroupWithoutFocus, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
165
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxToggleGroupWithoutFocus, isStandalone: true, selector: "[rdxToggleGroupWithoutFocus]", providers: [
166
+ provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroupWithoutFocus))),
167
+ provideValueAccessor(RdxToggleGroupWithoutFocus)
168
+ ], exportAs: ["rdxToggleGroupWithoutFocus"], usesInheritance: true, ngImport: i0 }); }
169
+ }
170
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggleGroupWithoutFocus, decorators: [{
171
+ type: Directive,
172
+ args: [{
173
+ selector: '[rdxToggleGroupWithoutFocus]',
174
+ exportAs: 'rdxToggleGroupWithoutFocus',
175
+ providers: [
176
+ provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroupWithoutFocus))),
177
+ provideValueAccessor(RdxToggleGroupWithoutFocus)
178
+ ]
305
179
  }]
306
- }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], onValueChange: [{ type: i0.Output, args: ["onValueChange"] }] } });
180
+ }] });
307
181
 
308
182
  /**
309
183
  * Generated bundle index. Do not edit.
310
184
  */
311
185
 
312
- export { RdxToggleGroupDirective, RdxToggleGroupItemDirective, RdxToggleGroupItemToken, RdxToggleGroupToken, RdxToggleGroupWithoutFocusDirective, injectToggleGroup, injectToggleGroupItem };
186
+ export { RdxToggleGroup, RdxToggleGroupBase, RdxToggleGroupWithoutFocus, injectToggleGroupContext, provideToggleGroupContext, toggleGroupContext };
313
187
  //# sourceMappingURL=radix-ng-primitives-toggle-group.mjs.map