@radix-ng/primitives 1.0.0-beta.3 → 1.0.0-beta.5
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.
- package/README.md +1 -1
- package/fesm2022/radix-ng-primitives-accordion.mjs +5 -3
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +3 -2
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-autocomplete.mjs +617 -659
- package/fesm2022/radix-ng-primitives-autocomplete.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-calendar.mjs +5 -3
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +33 -18
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-combobox.mjs +1305 -572
- package/fesm2022/radix-ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-config.mjs +13 -4
- package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs +51 -10
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +1352 -64
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +5 -3
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +290 -120
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-direction-provider.mjs +70 -0
- package/fesm2022/radix-ng-primitives-direction-provider.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +519 -184
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-drawer.mjs +3 -3
- package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-editable.mjs +12 -7
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-field.mjs +3 -2
- package/fesm2022/radix-ng-primitives-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs +803 -0
- package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +305 -70
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +893 -289
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +32 -4
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +144 -159
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +7 -2
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +284 -212
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +94 -51
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs +1 -1
- package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-preview-card.mjs +141 -173
- package/fesm2022/radix-ng-primitives-preview-card.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +19 -14
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +4 -2
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-scroll-area.mjs +5 -4
- package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +241 -164
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +262 -29
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +16 -10
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +10 -5
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +15 -10
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +5 -3
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toast.mjs +15 -36
- package/fesm2022/radix-ng-primitives-toast.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +14 -7
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +12 -6
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +5 -3
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +251 -143
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/package.json +10 -1
- package/types/radix-ng-primitives-accordion.d.ts +4 -3
- package/types/radix-ng-primitives-autocomplete.d.ts +217 -152
- package/types/radix-ng-primitives-calendar.d.ts +5 -3
- package/types/radix-ng-primitives-checkbox.d.ts +27 -15
- package/types/radix-ng-primitives-combobox.d.ts +672 -283
- package/types/radix-ng-primitives-config.d.ts +1 -1
- package/types/radix-ng-primitives-context-menu.d.ts +15 -5
- package/types/radix-ng-primitives-core.d.ts +764 -14
- package/types/radix-ng-primitives-date-field.d.ts +3 -2
- package/types/radix-ng-primitives-dialog.d.ts +88 -32
- package/types/radix-ng-primitives-direction-provider.d.ts +41 -0
- package/types/radix-ng-primitives-dismissable-layer.d.ts +147 -99
- package/types/radix-ng-primitives-editable.d.ts +11 -5
- package/types/radix-ng-primitives-field.d.ts +1 -0
- package/types/radix-ng-primitives-floating-focus-manager.d.ts +272 -0
- package/types/radix-ng-primitives-focus-scope.d.ts +132 -1
- package/types/radix-ng-primitives-menu.d.ts +192 -103
- package/types/radix-ng-primitives-navigation-menu.d.ts +37 -75
- package/types/radix-ng-primitives-number-field.d.ts +8 -3
- package/types/radix-ng-primitives-popover.d.ts +71 -92
- package/types/radix-ng-primitives-popper.d.ts +39 -9
- package/types/radix-ng-primitives-preview-card.d.ts +39 -72
- package/types/radix-ng-primitives-radio.d.ts +13 -6
- package/types/radix-ng-primitives-roving-focus.d.ts +7 -6
- package/types/radix-ng-primitives-scroll-area.d.ts +2 -2
- package/types/radix-ng-primitives-select.d.ts +142 -109
- package/types/radix-ng-primitives-slider.d.ts +64 -12
- package/types/radix-ng-primitives-stepper.d.ts +15 -7
- package/types/radix-ng-primitives-switch.d.ts +10 -4
- package/types/radix-ng-primitives-tabs.d.ts +12 -6
- package/types/radix-ng-primitives-time-field.d.ts +3 -2
- package/types/radix-ng-primitives-toast.d.ts +7 -7
- package/types/radix-ng-primitives-toggle-group.d.ts +15 -8
- package/types/radix-ng-primitives-toggle.d.ts +10 -3
- package/types/radix-ng-primitives-toolbar.d.ts +3 -2
- package/types/radix-ng-primitives-tooltip.d.ts +61 -80
|
@@ -1 +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] = createContext<RdxToastRootContext>(\n 'RdxToastRootContext',\n 'components/toast'\n);\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,IAAI,CAAC,OAAO,EAAE;AAC3B,YAAA,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE;YAC/B,MAAM,MAAM,GAAuD,EAAE;YACrE,IAAI,aAAa,GAAG,CAAC;AACrB,YAAA,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;AACvC,gBAAA,MAAM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Ae;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
|
+
{"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] = createContext<RdxToastRootContext>(\n 'RdxToastRootContext',\n 'components/toast'\n);\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 } from '@angular/core';\nimport {\n provideRdxPopperContentConfig,\n provideRdxPopperContentWrapper,\n RdxPopper,\n RdxPopperContentWrapper\n} from '@radix-ng/primitives/popper';\n\n/**\n * Positions an anchored toast against an element — the Angular counterpart of `<Toast.Positioner>`.\n *\n * A \"thin\" positioner (ADR 0012): it inherits the popper positioning surface (inputs, `placed`\n * output, unified vars + placement attrs) from {@link RdxPopperContentWrapper}. Bind `anchor` (and\n * optionally `side`/`align`/offsets) — typically from a toast's `positionerProps`. It also composes\n * its own {@link RdxPopper} so it is self-contained (no surrounding `rdxPopperRoot` needed), and\n * mirrors the anchor width / transform origin as friendlier `--toast-*` CSS variables.\n */\n@Directive({\n selector: '[rdxToastPositioner]',\n exportAs: 'rdxToastPositioner',\n providers: [\n ...provideRdxPopperContentWrapper(RdxToastPositioner),\n provideRdxPopperContentConfig({\n side: 'top',\n sideOffset: 8,\n align: 'center',\n arrowPadding: 6,\n collisionPadding: 8,\n updatePositionStrategy: 'always'\n })\n ],\n hostDirectives: [RdxPopper],\n host: {\n // `data-side`/`data-align`/`data-anchor-hidden` and the unified vars come from the inherited\n // wrapper (ADR 0012); only toast's own `--toast-*` aliases remain.\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 extends RdxPopperContentWrapper {}\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;;A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ular/core';
|
|
2
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
|
+
import { createCancelableChangeEventDetails, createContext, provideValueAccessor } from '@radix-ng/primitives/core';
|
|
4
|
+
import { injectDirection } from '@radix-ng/primitives/direction-provider';
|
|
4
5
|
import * as i1 from '@radix-ng/primitives/roving-focus';
|
|
5
6
|
import { RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';
|
|
6
7
|
|
|
@@ -11,7 +12,7 @@ function toggleGroupContext(instance) {
|
|
|
11
12
|
disabled: instance.isDisabled,
|
|
12
13
|
multiple: instance.multiple,
|
|
13
14
|
orientation: instance.orientation,
|
|
14
|
-
toggle: (value) => instance.toggle(value)
|
|
15
|
+
toggle: (value, event) => instance.toggle(value, event)
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
@@ -61,7 +62,7 @@ class RdxToggleGroupBase {
|
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
64
|
/** @ignore */
|
|
64
|
-
toggle(value) {
|
|
65
|
+
toggle(value, event) {
|
|
65
66
|
if (this.isDisabled()) {
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
@@ -73,8 +74,13 @@ class RdxToggleGroupBase {
|
|
|
73
74
|
else {
|
|
74
75
|
next = current.includes(value) ? [] : [value];
|
|
75
76
|
}
|
|
77
|
+
const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;
|
|
78
|
+
const { eventDetails } = createCancelableChangeEventDetails(event ? 'trigger-press' : 'none', event ?? new Event('toggle-group.value-change'), trigger);
|
|
79
|
+
this.onValueChange.emit({ value: next, eventDetails });
|
|
80
|
+
if (eventDetails.isCanceled()) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
76
83
|
this.value.set(next);
|
|
77
|
-
this.onValueChange.emit(next);
|
|
78
84
|
this.onChange?.(next);
|
|
79
85
|
}
|
|
80
86
|
/** @ignore */
|
|
@@ -121,7 +127,8 @@ class RdxToggleGroup extends RdxToggleGroupBase {
|
|
|
121
127
|
constructor() {
|
|
122
128
|
super();
|
|
123
129
|
/** Text direction for arrow-key navigation. */
|
|
124
|
-
this.
|
|
130
|
+
this.dirInput = input(undefined, { ...(ngDevMode ? { debugName: "dirInput" } : /* istanbul ignore next */ {}), alias: 'dir' });
|
|
131
|
+
this.dir = injectDirection(this.dirInput);
|
|
125
132
|
/**
|
|
126
133
|
* Whether keyboard navigation should loop from the last item back to the first.
|
|
127
134
|
*
|
|
@@ -136,7 +143,7 @@ class RdxToggleGroup extends RdxToggleGroupBase {
|
|
|
136
143
|
});
|
|
137
144
|
}
|
|
138
145
|
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: {
|
|
146
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToggleGroup, isStandalone: true, selector: "[rdxToggleGroup]", inputs: { dirInput: { classPropertyName: "dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, loopFocus: { classPropertyName: "loopFocus", publicName: "loopFocus", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
140
147
|
provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroup))),
|
|
141
148
|
provideValueAccessor(RdxToggleGroup)
|
|
142
149
|
], exportAs: ["rdxToggleGroup"], usesInheritance: true, hostDirectives: [{ directive: i1.RdxRovingFocusGroupDirective }], ngImport: i0 }); }
|
|
@@ -152,7 +159,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
152
159
|
provideValueAccessor(RdxToggleGroup)
|
|
153
160
|
]
|
|
154
161
|
}]
|
|
155
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
162
|
+
}], ctorParameters: () => [], propDecorators: { dirInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], loopFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "loopFocus", required: false }] }] } });
|
|
156
163
|
|
|
157
164
|
/**
|
|
158
165
|
* A toggle group that does NOT create its own roving-focus group, for use inside a container that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-toggle-group.mjs","sources":["../../../packages/primitives/toggle-group/src/toggle-group-base.ts","../../../packages/primitives/toggle-group/src/toggle-group-context.ts","../../../packages/primitives/toggle-group/src/toggle-group.ts","../../../packages/primitives/toggle-group/src/toggle-group-without-focus.ts","../../../packages/primitives/toggle-group/radix-ng-primitives-toggle-group.ts"],"sourcesContent":["import { booleanAttribute, computed, Directive, effect, input, model, output, signal, untracked } from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { BooleanInput, DataOrientation } from '@radix-ng/primitives/core';\nimport { RdxToggleGroupContext } from './toggle-group-context';\n\n/** Builds the shared context a {@link RdxToggle} reads when it belongs to this group. */\nexport function toggleGroupContext(instance: RdxToggleGroupBase): RdxToggleGroupContext {\n return {\n value: instance.pressedValues,\n disabled: instance.isDisabled,\n multiple: instance.multiple,\n orientation: instance.orientation,\n toggle: (value) => instance.toggle(value)\n };\n}\n\n/**\n * Shared state and behavior for the toggle group. Concrete directives add the roving-focus group\n * ({@link RdxToggleGroup}) or omit it when an ancestor already owns focus, e.g. a toolbar\n * ({@link RdxToggleGroupWithoutFocus}).\n */\n@Directive({\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'multiple() ? \"\" : undefined',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport abstract class RdxToggleGroupBase implements ControlValueAccessor {\n /**\n * The pressed values. Always an array — a single value is `[value]`. Use with `(onValueChange)`\n * for controlled state.\n */\n readonly value = model<string[]>();\n\n /** The values pressed when the group is initially rendered (uncontrolled). */\n readonly defaultValue = input<string[]>();\n\n /**\n * Whether multiple items can be pressed at the same time.\n *\n * @default false\n */\n readonly multiple = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the whole group is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The orientation of the group, controlling arrow-key navigation.\n *\n * @default 'horizontal'\n */\n readonly orientation = input<DataOrientation>('horizontal');\n\n /** Event emitted when the pressed values change. */\n readonly onValueChange = output<string[]>();\n\n /** @ignore */\n readonly pressedValues = computed(() => this.value() ?? []);\n\n protected readonly accessorDisabled = signal(false);\n /** @ignore */\n readonly isDisabled = computed(() => this.disabled() || this.accessorDisabled());\n\n private onChange?: (value: string[]) => void;\n protected onTouched?: () => void;\n\n constructor() {\n effect(() => {\n const initial = this.defaultValue();\n if (initial !== undefined && untracked(this.value) === undefined) {\n this.value.set(initial);\n }\n });\n }\n\n /** @ignore */\n toggle(value: string): void {\n if (this.isDisabled()) {\n return;\n }\n\n const current = this.pressedValues();\n let next: string[];\n\n if (this.multiple()) {\n next = current.includes(value) ? current.filter((item) => item !== value) : [...current, value];\n } else {\n next = current.includes(value) ? [] : [value];\n }\n\n this.value.set(next);\n this.onValueChange.emit(next);\n this.onChange?.(next);\n }\n\n /** @ignore */\n writeValue(value: string[] | string | null): void {\n this.value.set(value == null ? [] : Array.isArray(value) ? value : [value]);\n }\n\n /** @ignore */\n registerOnChange(fn: (value: string[]) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n","import { Signal } from '@angular/core';\nimport { createContext, DataOrientation } from '@radix-ng/primitives/core';\n\n/**\n * Shared state a {@link RdxToggle} reads when it participates in a toggle group.\n */\nexport interface RdxToggleGroupContext {\n /** The currently pressed values. */\n readonly value: Signal<string[]>;\n\n /** Whether the whole group is disabled. */\n readonly disabled: Signal<boolean>;\n\n /** Whether more than one item can be pressed at a time. */\n readonly multiple: Signal<boolean>;\n\n /** The orientation of the group. */\n readonly orientation: Signal<DataOrientation>;\n\n /** Toggle the pressed state of `value` within the group. */\n toggle(value: string): void;\n}\n\nexport const [injectToggleGroupContext, provideToggleGroupContext] = createContext<RdxToggleGroupContext>(\n 'RdxToggleGroupContext',\n 'components/toggle-group'\n);\n","import { booleanAttribute, Directive, effect, inject, input } from '@angular/core';\nimport { BooleanInput, provideValueAccessor } from '@radix-ng/primitives/core';\nimport { Direction, RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';\nimport { RdxToggleGroupBase, toggleGroupContext } from './toggle-group-base';\nimport { provideToggleGroupContext } from './toggle-group-context';\n\n/**\n * A set of two-state buttons that can be toggled on or off. Owns roving keyboard focus over its\n * `[rdxToggle]` children.\n *\n * @see https://base-ui.com/react/components/toggle-group\n */\n@Directive({\n selector: '[rdxToggleGroup]',\n exportAs: 'rdxToggleGroup',\n hostDirectives: [RdxRovingFocusGroupDirective],\n providers: [\n provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroup))),\n provideValueAccessor(RdxToggleGroup)\n ]\n})\nexport class RdxToggleGroup extends RdxToggleGroupBase {\n /** Text direction for arrow-key navigation. */\n readonly dir = input<Direction>('ltr');\n\n /**\n * Whether keyboard navigation should loop from the last item back to the first.\n *\n * @default true\n */\n readonly loopFocus = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n private readonly rovingFocusGroup = inject(RdxRovingFocusGroupDirective, { self: true });\n\n constructor() {\n super();\n\n effect(() => {\n this.rovingFocusGroup.setOrientation(this.orientation());\n this.rovingFocusGroup.setDir(this.dir());\n this.rovingFocusGroup.setLoop(this.loopFocus());\n });\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { provideValueAccessor } from '@radix-ng/primitives/core';\nimport { RdxToggleGroupBase, toggleGroupContext } from './toggle-group-base';\nimport { provideToggleGroupContext } from './toggle-group-context';\n\n/**\n * A toggle group that does NOT create its own roving-focus group, for use inside a container that\n * already owns keyboard focus (e.g. a toolbar). The `[rdxToggle]` children register with the nearest\n * ancestor roving-focus group instead. Mirrors Base UI's behavior of skipping its composite root\n * when nested in a toolbar.\n */\n@Directive({\n selector: '[rdxToggleGroupWithoutFocus]',\n exportAs: 'rdxToggleGroupWithoutFocus',\n providers: [\n provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroupWithoutFocus))),\n provideValueAccessor(RdxToggleGroupWithoutFocus)\n ]\n})\nexport class RdxToggleGroupWithoutFocus extends RdxToggleGroupBase {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAKA;AACM,SAAU,kBAAkB,CAAC,QAA4B,EAAA;IAC3D,OAAO;QACH,KAAK,EAAE,QAAQ,CAAC,aAAa;QAC7B,QAAQ,EAAE,QAAQ,CAAC,UAAU;QAC7B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,MAAM,EAAE,CAAC,KAAK,KAAK,QAAQ,CAAC,MAAM,CAAC,KAAK;KAC3C;AACL;AAEA;;;;AAIG;MAUmB,kBAAkB,CAAA;AA4CpC,IAAA,WAAA,GAAA;AA3CA;;;AAGG;QACM,IAAA,CAAA,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAY;;QAGzB,IAAA,CAAA,YAAY,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,cAAA,EAAA,CAAA,8BAAA,EA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AAA,4BAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAEQ,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBARtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,8BAA8B;AACxC,oBAAA,QAAQ,EAAE,4BAA4B;AACtC,oBAAA,SAAS,EAAE;wBACP,yBAAyB,CAAC,MAAM,kBAAkB,CAAC,MAAM,CAAA,0BAAA,CAA4B,CAAC,CAAC;AACvF,wBAAA,oBAAoB,CAAA,0BAAA;AACvB;AACJ,iBAAA;;;AClBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-toggle-group.mjs","sources":["../../../packages/primitives/toggle-group/src/toggle-group-base.ts","../../../packages/primitives/toggle-group/src/toggle-group-context.ts","../../../packages/primitives/toggle-group/src/toggle-group.ts","../../../packages/primitives/toggle-group/src/toggle-group-without-focus.ts","../../../packages/primitives/toggle-group/radix-ng-primitives-toggle-group.ts"],"sourcesContent":["import { booleanAttribute, computed, Directive, effect, input, model, output, signal, untracked } from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport {\n BooleanInput,\n createCancelableChangeEventDetails,\n DataOrientation,\n RdxCancelableChangeEventDetails\n} from '@radix-ng/primitives/core';\nimport { RdxToggleGroupContext } from './toggle-group-context';\n\nexport type RdxToggleGroupValueChangeReason = 'trigger-press' | 'none';\nexport type RdxToggleGroupValueChangeEventDetails = RdxCancelableChangeEventDetails<RdxToggleGroupValueChangeReason>;\n\nexport interface RdxToggleGroupValueChangeEvent {\n value: string[];\n eventDetails: RdxToggleGroupValueChangeEventDetails;\n}\n\n/** Builds the shared context a {@link RdxToggle} reads when it belongs to this group. */\nexport function toggleGroupContext(instance: RdxToggleGroupBase): RdxToggleGroupContext {\n return {\n value: instance.pressedValues,\n disabled: instance.isDisabled,\n multiple: instance.multiple,\n orientation: instance.orientation,\n toggle: (value, event) => instance.toggle(value, event)\n };\n}\n\n/**\n * Shared state and behavior for the toggle group. Concrete directives add the roving-focus group\n * ({@link RdxToggleGroup}) or omit it when an ancestor already owns focus, e.g. a toolbar\n * ({@link RdxToggleGroupWithoutFocus}).\n */\n@Directive({\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-multiple]': 'multiple() ? \"\" : undefined',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport abstract class RdxToggleGroupBase implements ControlValueAccessor {\n /**\n * The pressed values. Always an array — a single value is `[value]`. Use with `(onValueChange)`\n * for controlled state.\n */\n readonly value = model<string[]>();\n\n /** The values pressed when the group is initially rendered (uncontrolled). */\n readonly defaultValue = input<string[]>();\n\n /**\n * Whether multiple items can be pressed at the same time.\n *\n * @default false\n */\n readonly multiple = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the whole group is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The orientation of the group, controlling arrow-key navigation.\n *\n * @default 'horizontal'\n */\n readonly orientation = input<DataOrientation>('horizontal');\n\n /** Event emitted when the pressed values change. */\n readonly onValueChange = output<RdxToggleGroupValueChangeEvent>();\n\n /** @ignore */\n readonly pressedValues = computed(() => this.value() ?? []);\n\n protected readonly accessorDisabled = signal(false);\n /** @ignore */\n readonly isDisabled = computed(() => this.disabled() || this.accessorDisabled());\n\n private onChange?: (value: string[]) => void;\n protected onTouched?: () => void;\n\n constructor() {\n effect(() => {\n const initial = this.defaultValue();\n if (initial !== undefined && untracked(this.value) === undefined) {\n this.value.set(initial);\n }\n });\n }\n\n /** @ignore */\n toggle(value: string, event?: Event): void {\n if (this.isDisabled()) {\n return;\n }\n\n const current = this.pressedValues();\n let next: string[];\n\n if (this.multiple()) {\n next = current.includes(value) ? current.filter((item) => item !== value) : [...current, value];\n } else {\n next = current.includes(value) ? [] : [value];\n }\n\n const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;\n const { eventDetails } = createCancelableChangeEventDetails(\n event ? 'trigger-press' : 'none',\n event ?? new Event('toggle-group.value-change'),\n trigger\n );\n this.onValueChange.emit({ value: next, eventDetails });\n if (eventDetails.isCanceled()) {\n return;\n }\n\n this.value.set(next);\n this.onChange?.(next);\n }\n\n /** @ignore */\n writeValue(value: string[] | string | null): void {\n this.value.set(value == null ? [] : Array.isArray(value) ? value : [value]);\n }\n\n /** @ignore */\n registerOnChange(fn: (value: string[]) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n","import { Signal } from '@angular/core';\nimport { createContext, DataOrientation } from '@radix-ng/primitives/core';\n\n/**\n * Shared state a {@link RdxToggle} reads when it participates in a toggle group.\n */\nexport interface RdxToggleGroupContext {\n /** The currently pressed values. */\n readonly value: Signal<string[]>;\n\n /** Whether the whole group is disabled. */\n readonly disabled: Signal<boolean>;\n\n /** Whether more than one item can be pressed at a time. */\n readonly multiple: Signal<boolean>;\n\n /** The orientation of the group. */\n readonly orientation: Signal<DataOrientation>;\n\n /** Toggle the pressed state of `value` within the group. */\n toggle(value: string, event?: Event): void;\n}\n\nexport const [injectToggleGroupContext, provideToggleGroupContext] = createContext<RdxToggleGroupContext>(\n 'RdxToggleGroupContext',\n 'components/toggle-group'\n);\n","import { booleanAttribute, Directive, effect, inject, input } from '@angular/core';\nimport { BooleanInput, provideValueAccessor } from '@radix-ng/primitives/core';\nimport { injectDirection } from '@radix-ng/primitives/direction-provider';\nimport { Direction, RdxRovingFocusGroupDirective } from '@radix-ng/primitives/roving-focus';\nimport { RdxToggleGroupBase, toggleGroupContext } from './toggle-group-base';\nimport { provideToggleGroupContext } from './toggle-group-context';\n\n/**\n * A set of two-state buttons that can be toggled on or off. Owns roving keyboard focus over its\n * `[rdxToggle]` children.\n *\n * @see https://base-ui.com/react/components/toggle-group\n */\n@Directive({\n selector: '[rdxToggleGroup]',\n exportAs: 'rdxToggleGroup',\n hostDirectives: [RdxRovingFocusGroupDirective],\n providers: [\n provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroup))),\n provideValueAccessor(RdxToggleGroup)\n ]\n})\nexport class RdxToggleGroup extends RdxToggleGroupBase {\n /** Text direction for arrow-key navigation. */\n readonly dirInput = input<Direction | undefined>(undefined, { alias: 'dir' });\n readonly dir = injectDirection(this.dirInput);\n\n /**\n * Whether keyboard navigation should loop from the last item back to the first.\n *\n * @default true\n */\n readonly loopFocus = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n private readonly rovingFocusGroup = inject(RdxRovingFocusGroupDirective, { self: true });\n\n constructor() {\n super();\n\n effect(() => {\n this.rovingFocusGroup.setOrientation(this.orientation());\n this.rovingFocusGroup.setDir(this.dir());\n this.rovingFocusGroup.setLoop(this.loopFocus());\n });\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { provideValueAccessor } from '@radix-ng/primitives/core';\nimport { RdxToggleGroupBase, toggleGroupContext } from './toggle-group-base';\nimport { provideToggleGroupContext } from './toggle-group-context';\n\n/**\n * A toggle group that does NOT create its own roving-focus group, for use inside a container that\n * already owns keyboard focus (e.g. a toolbar). The `[rdxToggle]` children register with the nearest\n * ancestor roving-focus group instead. Mirrors Base UI's behavior of skipping its composite root\n * when nested in a toolbar.\n */\n@Directive({\n selector: '[rdxToggleGroupWithoutFocus]',\n exportAs: 'rdxToggleGroupWithoutFocus',\n providers: [\n provideToggleGroupContext(() => toggleGroupContext(inject(RdxToggleGroupWithoutFocus))),\n provideValueAccessor(RdxToggleGroupWithoutFocus)\n ]\n})\nexport class RdxToggleGroupWithoutFocus extends RdxToggleGroupBase {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAkBA;AACM,SAAU,kB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AS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,8BAA8B;AACxC,oBAAA,QAAQ,EAAE,4BAA4B;AACtC,oBAAA,SAAS,EAAE;wBACP,yBAAyB,CAAC,MAAM,kBAAkB,CAAC,MAAM,CAAA,0BAAA,CAA4B,CAAC,CAAC;AACvF,wBAAA,oBAAoB,CAAA,0BAAA;AACvB;AACJ,iBAAA;;;AClBD;;AAEG;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, input, booleanAttribute, model, output, linkedSignal, computed, effect, Directive } from '@angular/core';
|
|
3
|
+
import { createCancelableChangeEventDetails } from '@radix-ng/primitives/core';
|
|
3
4
|
import * as i1 from '@radix-ng/primitives/roving-focus';
|
|
4
5
|
import { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';
|
|
5
6
|
import { injectToggleGroupContext } from '@radix-ng/primitives/toggle-group';
|
|
@@ -62,21 +63,26 @@ class RdxToggle {
|
|
|
62
63
|
effect(() => this.rovingItem.setFocusable(!this.isDisabled()));
|
|
63
64
|
}
|
|
64
65
|
/** @ignore */
|
|
65
|
-
onClick() {
|
|
66
|
+
onClick(event) {
|
|
66
67
|
if (this.isDisabled()) {
|
|
67
68
|
return;
|
|
68
69
|
}
|
|
69
70
|
if (this.group) {
|
|
70
71
|
const value = this.value();
|
|
71
72
|
if (value !== undefined) {
|
|
72
|
-
this.group.toggle(value);
|
|
73
|
+
this.group.toggle(value, event);
|
|
73
74
|
}
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
77
|
const next = !this.internalPressed();
|
|
78
|
+
const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;
|
|
79
|
+
const { eventDetails } = createCancelableChangeEventDetails(event ? 'trigger-press' : 'none', event ?? new Event('toggle.pressed-change'), trigger);
|
|
80
|
+
this.onPressedChange.emit({ pressed: next, eventDetails });
|
|
81
|
+
if (eventDetails.isCanceled()) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
77
84
|
this.internalPressed.set(next);
|
|
78
85
|
this.pressed.set(next);
|
|
79
|
-
this.onPressedChange.emit(next);
|
|
80
86
|
}
|
|
81
87
|
/** @ignore */
|
|
82
88
|
onKeyDown(event) {
|
|
@@ -85,11 +91,11 @@ class RdxToggle {
|
|
|
85
91
|
}
|
|
86
92
|
if (event.key === ' ' || event.key === 'Enter') {
|
|
87
93
|
event.preventDefault();
|
|
88
|
-
this.onClick();
|
|
94
|
+
this.onClick(event);
|
|
89
95
|
}
|
|
90
96
|
}
|
|
91
97
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
92
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToggle, isStandalone: true, selector: "[rdxToggle]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultPressed: { classPropertyName: "defaultPressed", publicName: "defaultPressed", isSignal: true, isRequired: false, transformFunction: null }, pressed: { classPropertyName: "pressed", publicName: "pressed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, nativeButton: { classPropertyName: "nativeButton", publicName: "nativeButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressedChange", onPressedChange: "onPressedChange" }, host: { listeners: { "click": "onClick()", "keydown": "onKeyDown($event)" }, properties: { "attr.type": "nativeButton() ? \"button\" : undefined", "attr.role": "nativeButton() ? undefined : \"button\"", "attr.aria-pressed": "pressedState()", "attr.data-pressed": "pressedState() ? \"\" : undefined", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.disabled": "nativeButton() && isDisabled() ? \"\" : undefined", "attr.aria-disabled": "!nativeButton() && isDisabled() ? \"true\" : undefined" } }, exportAs: ["rdxToggle"], hostDirectives: [{ directive: i1.RdxRovingFocusItemDirective }], ngImport: i0 }); }
|
|
98
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxToggle, isStandalone: true, selector: "[rdxToggle]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultPressed: { classPropertyName: "defaultPressed", publicName: "defaultPressed", isSignal: true, isRequired: false, transformFunction: null }, pressed: { classPropertyName: "pressed", publicName: "pressed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, nativeButton: { classPropertyName: "nativeButton", publicName: "nativeButton", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressedChange", onPressedChange: "onPressedChange" }, host: { listeners: { "click": "onClick($event)", "keydown": "onKeyDown($event)" }, properties: { "attr.type": "nativeButton() ? \"button\" : undefined", "attr.role": "nativeButton() ? undefined : \"button\"", "attr.aria-pressed": "pressedState()", "attr.data-pressed": "pressedState() ? \"\" : undefined", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.disabled": "nativeButton() && isDisabled() ? \"\" : undefined", "attr.aria-disabled": "!nativeButton() && isDisabled() ? \"true\" : undefined" } }, exportAs: ["rdxToggle"], hostDirectives: [{ directive: i1.RdxRovingFocusItemDirective }], ngImport: i0 }); }
|
|
93
99
|
}
|
|
94
100
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxToggle, decorators: [{
|
|
95
101
|
type: Directive,
|
|
@@ -105,7 +111,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
105
111
|
'[attr.data-disabled]': 'isDisabled() ? "" : undefined',
|
|
106
112
|
'[attr.disabled]': 'nativeButton() && isDisabled() ? "" : undefined',
|
|
107
113
|
'[attr.aria-disabled]': '!nativeButton() && isDisabled() ? "true" : undefined',
|
|
108
|
-
'(click)': 'onClick()',
|
|
114
|
+
'(click)': 'onClick($event)',
|
|
109
115
|
'(keydown)': 'onKeyDown($event)'
|
|
110
116
|
}
|
|
111
117
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle.ts","../../../packages/primitives/toggle/src/toggle-visually-hidden-input.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n linkedSignal,\n model,\n output\n} from '@angular/core';\nimport { BooleanInput } from '@radix-ng/primitives/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { injectToggleGroupContext } from '@radix-ng/primitives/toggle-group';\n\n/**\n * A two-state button that can be either on (pressed) or off.\n *\n * Works standalone or as an item of a `[rdxToggleGroup]`: inside a group it derives its pressed\n * state from the group's value (matched by `value`) and participates in the group's roving focus.\n *\n * @see https://base-ui.com/react/components/toggle\n */\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n hostDirectives: [RdxRovingFocusItemDirective],\n host: {\n '[attr.type]': 'nativeButton() ? \"button\" : undefined',\n '[attr.role]': 'nativeButton() ? undefined : \"button\"',\n '[attr.aria-pressed]': 'pressedState()',\n '[attr.data-pressed]': 'pressedState() ? \"\" : undefined',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.disabled]': 'nativeButton() && isDisabled() ? \"\" : undefined',\n '[attr.aria-disabled]': '!nativeButton() && isDisabled() ? \"true\" : undefined',\n '(click)': 'onClick()',\n '(keydown)': 'onKeyDown($event)'\n }\n})\nexport class RdxToggle {\n private readonly group = injectToggleGroupContext(true);\n private readonly rovingItem = inject(RdxRovingFocusItemDirective);\n\n /**\n * A value identifying this toggle inside a `[rdxToggleGroup]`. Required when used in a group.\n */\n readonly value = input<string>();\n\n /**\n * The pressed state when initially rendered (uncontrolled, standalone only).\n *\n * @default false\n */\n readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled pressed state (standalone). Use with `(onPressedChange)` or two-way `[(pressed)]`.\n */\n readonly pressed = model<boolean | undefined>(undefined);\n\n /**\n * Whether the toggle is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the host is a native `<button>`. When `false`, the toggle adds `role=\"button\"` and\n * handles Enter/Space itself.\n *\n * @default true\n */\n readonly nativeButton = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** Event emitted when the pressed state changes (standalone). */\n readonly onPressedChange = output<boolean>();\n\n private readonly internalPressed = linkedSignal(() => this.pressed() ?? this.defaultPressed());\n\n /** @ignore Whether the toggle is currently pressed (from the group when grouped). */\n readonly pressedState = computed(() => {\n if (this.group) {\n const value = this.value();\n return value !== undefined && this.group.value().includes(value);\n }\n return this.internalPressed();\n });\n\n /** @ignore */\n readonly isDisabled = computed(() => this.disabled() || (this.group?.disabled() ?? false));\n\n constructor() {\n effect(() => this.rovingItem.setActive(this.pressedState()));\n effect(() => this.rovingItem.setFocusable(!this.isDisabled()));\n }\n\n /** @ignore */\n protected onClick(): void {\n if (this.isDisabled()) {\n return;\n }\n\n if (this.group) {\n const value = this.value();\n if (value !== undefined) {\n this.group.toggle(value);\n }\n return;\n }\n\n const next = !this.internalPressed();\n this.internalPressed.set(next);\n this.pressed.set(next);\n this.onPressedChange.emit(next);\n }\n\n /** @ignore */\n protected onKeyDown(event: KeyboardEvent): void {\n if (this.nativeButton()) {\n return;\n }\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.onClick();\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { RdxVisuallyHiddenInputBubbleDirective } from '@radix-ng/primitives/visually-hidden';\n\n@Directive({\n selector: 'input[rdxToggleVisuallyHiddenInput]',\n exportAs: 'rdxToggleVisuallyHiddenInput',\n hostDirectives: [\n {\n directive: RdxVisuallyHiddenInputBubbleDirective,\n inputs: ['name', 'required', 'value', 'disabled']\n }\n ],\n host: {\n type: 'checkbox'\n }\n})\nexport class RdxToggleVisuallyHiddenInputDirective {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;AAeA;;;;;;;AAOG;MAiBU,SAAS,CAAA;AAqDlB,IAAA,WAAA,GAAA;AApDiB,QAAA,IAAA,CAAA,KAAK,GAAG,wBAAwB,CAAC,IAAI,CAAC;AACtC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAEjE;;AAEG;QACM,IAAA,CAAA,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;AAEhC;;;;AAIG;QACM,IAAA,CAAA,cAAc,GAAG,KAAK,CAAwB,KAAK,sFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAE9F;;AAEG;AACM,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAsB,SAAS,8EAAC;AAExD;;;;AAIG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAExF;;;;;AAKG;QACM,IAAA,CAAA,YAAY,GAAG,KAAK,CAAwB,IAAI,oFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;QAGlF,IAAA,CAAA,eAAe,GAAG,MAAM,EAAW;AAE3B,QAAA,IAAA,CAAA,eAAe,GAAG,YAAY,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,cAAc,EAAE,sFAAC;;AAGrF,QAAA,IAAA,CAAA,YAAY,GAAG,QAAQ,CAAC,MAAK;AAClC,YAAA,IAAI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A,qCAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,8BAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAAA,IAAA,CAAA,qCAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,UAAA,EAAA,UAAA,EAAA,OAAA,EAAA,OAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAArC,qCAAqC,EAAA,UAAA,EAAA,CAAA;kBAbjD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,qCAAqC;AAC/C,oBAAA,QAAQ,EAAE,8BAA8B;AACxC,oBAAA,cAAc,EAAE;AACZ,wBAAA;AACI,4BAAA,SAAS,EAAE,qCAAqC;4BAChD,MAAM,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU;AACnD;AACJ,qBAAA;AACD,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE;AACT;AACJ,iBAAA;;;ACfD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle.ts","../../../packages/primitives/toggle/src/toggle-visually-hidden-input.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n linkedSignal,\n model,\n output\n} from '@angular/core';\nimport {\n BooleanInput,\n createCancelableChangeEventDetails,\n RdxCancelableChangeEventDetails\n} from '@radix-ng/primitives/core';\nimport { RdxRovingFocusItemDirective } from '@radix-ng/primitives/roving-focus';\nimport { injectToggleGroupContext } from '@radix-ng/primitives/toggle-group';\n\nexport type RdxTogglePressedChangeReason = 'trigger-press' | 'none';\nexport type RdxTogglePressedChangeEventDetails = RdxCancelableChangeEventDetails<RdxTogglePressedChangeReason>;\n\nexport interface RdxTogglePressedChangeEvent {\n pressed: boolean;\n eventDetails: RdxTogglePressedChangeEventDetails;\n}\n\n/**\n * A two-state button that can be either on (pressed) or off.\n *\n * Works standalone or as an item of a `[rdxToggleGroup]`: inside a group it derives its pressed\n * state from the group's value (matched by `value`) and participates in the group's roving focus.\n *\n * @see https://base-ui.com/react/components/toggle\n */\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n hostDirectives: [RdxRovingFocusItemDirective],\n host: {\n '[attr.type]': 'nativeButton() ? \"button\" : undefined',\n '[attr.role]': 'nativeButton() ? undefined : \"button\"',\n '[attr.aria-pressed]': 'pressedState()',\n '[attr.data-pressed]': 'pressedState() ? \"\" : undefined',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.disabled]': 'nativeButton() && isDisabled() ? \"\" : undefined',\n '[attr.aria-disabled]': '!nativeButton() && isDisabled() ? \"true\" : undefined',\n '(click)': 'onClick($event)',\n '(keydown)': 'onKeyDown($event)'\n }\n})\nexport class RdxToggle {\n private readonly group = injectToggleGroupContext(true);\n private readonly rovingItem = inject(RdxRovingFocusItemDirective);\n\n /**\n * A value identifying this toggle inside a `[rdxToggleGroup]`. Required when used in a group.\n */\n readonly value = input<string>();\n\n /**\n * The pressed state when initially rendered (uncontrolled, standalone only).\n *\n * @default false\n */\n readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled pressed state (standalone). Use with `(onPressedChange)` or two-way `[(pressed)]`.\n */\n readonly pressed = model<boolean | undefined>(undefined);\n\n /**\n * Whether the toggle is disabled.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the host is a native `<button>`. When `false`, the toggle adds `role=\"button\"` and\n * handles Enter/Space itself.\n *\n * @default true\n */\n readonly nativeButton = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** Event emitted when the pressed state changes (standalone). */\n readonly onPressedChange = output<RdxTogglePressedChangeEvent>();\n\n private readonly internalPressed = linkedSignal(() => this.pressed() ?? this.defaultPressed());\n\n /** @ignore Whether the toggle is currently pressed (from the group when grouped). */\n readonly pressedState = computed(() => {\n if (this.group) {\n const value = this.value();\n return value !== undefined && this.group.value().includes(value);\n }\n return this.internalPressed();\n });\n\n /** @ignore */\n readonly isDisabled = computed(() => this.disabled() || (this.group?.disabled() ?? false));\n\n constructor() {\n effect(() => this.rovingItem.setActive(this.pressedState()));\n effect(() => this.rovingItem.setFocusable(!this.isDisabled()));\n }\n\n /** @ignore */\n protected onClick(event?: Event): void {\n if (this.isDisabled()) {\n return;\n }\n\n if (this.group) {\n const value = this.value();\n if (value !== undefined) {\n this.group.toggle(value, event);\n }\n return;\n }\n\n const next = !this.internalPressed();\n const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;\n const { eventDetails } = createCancelableChangeEventDetails(\n event ? 'trigger-press' : 'none',\n event ?? new Event('toggle.pressed-change'),\n trigger\n );\n this.onPressedChange.emit({ pressed: next, eventDetails });\n if (eventDetails.isCanceled()) {\n return;\n }\n\n this.internalPressed.set(next);\n this.pressed.set(next);\n }\n\n /** @ignore */\n protected onKeyDown(event: KeyboardEvent): void {\n if (this.nativeButton()) {\n return;\n }\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.onClick(event);\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { RdxVisuallyHiddenInputBubbleDirective } from '@radix-ng/primitives/visually-hidden';\n\n@Directive({\n selector: 'input[rdxToggleVisuallyHiddenInput]',\n exportAs: 'rdxToggleVisuallyHiddenInput',\n hostDirectives: [\n {\n directive: RdxVisuallyHiddenInputBubbleDirective,\n inputs: ['name', 'required', 'value', 'disabled']\n }\n ],\n host: {\n type: 'checkbox'\n }\n})\nexport class RdxToggleVisuallyHiddenInputDirective {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\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