@42-central/ui-react 0.17.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -175
- package/dist/{chunk-ACE7FBWE.js → chunk-EVVMHTCL.js} +3 -3
- package/dist/chunk-EVVMHTCL.js.map +1 -0
- package/dist/{chunk-TMMEJKLI.js → chunk-NSOA3GMZ.js} +16 -3
- package/dist/chunk-NSOA3GMZ.js.map +1 -0
- package/dist/{chunk-PJL4ZL5V.js → chunk-YON5Y336.js} +3 -3
- package/dist/{chunk-PJL4ZL5V.js.map → chunk-YON5Y336.js.map} +1 -1
- package/dist/components/alert/alert.d.ts +17 -9
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/index.js +2 -2
- package/dist/components/alert/index.js.map +1 -1
- package/dist/components/calendar/calendar-body.d.ts.map +1 -1
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/date-picker/index.js +3 -3
- package/dist/components/notification/create-notifier.d.ts.map +1 -1
- package/dist/components/notification/index.js +6 -6
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/notification/notification.d.ts +4 -4
- package/dist/components/notification/notification.d.ts.map +1 -1
- package/dist/components/schedule/index.d.ts +3 -3
- package/dist/components/schedule/index.js +163 -89
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/schedule/schedule-agenda-view.d.ts +1 -1
- package/dist/components/schedule/schedule-agenda-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule-create-draft.d.ts +3 -2
- package/dist/components/schedule/schedule-create-draft.d.ts.map +1 -1
- package/dist/components/schedule/schedule-dates.d.ts.map +1 -1
- package/dist/components/schedule/schedule-days-view.d.ts +1 -1
- package/dist/components/schedule/schedule-days-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule-drag-ghost.d.ts +12 -5
- package/dist/components/schedule/schedule-drag-ghost.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-chip.d.ts.map +1 -1
- package/dist/components/schedule/schedule-geometry.d.ts +16 -0
- package/dist/components/schedule/schedule-geometry.d.ts.map +1 -1
- package/dist/components/schedule/schedule-grid-gesture.d.ts +29 -6
- package/dist/components/schedule/schedule-grid-gesture.d.ts.map +1 -1
- package/dist/components/schedule/schedule-month-view.d.ts +1 -1
- package/dist/components/schedule/schedule-month-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule-next-up.d.ts +1 -1
- package/dist/components/schedule/schedule-next-up.d.ts.map +1 -1
- package/dist/components/schedule/schedule-timed-grid.d.ts.map +1 -1
- package/dist/components/schedule/schedule-toolbar.d.ts +3 -3
- package/dist/components/schedule/schedule-toolbar.d.ts.map +1 -1
- package/dist/components/schedule/schedule-types.d.ts +4 -1
- package/dist/components/schedule/schedule-types.d.ts.map +1 -1
- package/dist/components/schedule/schedule-year-view.d.ts +1 -1
- package/dist/components/schedule/schedule-year-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule.d.ts.map +1 -1
- package/dist/components/schedule/use-event-create.d.ts.map +1 -1
- package/dist/components/schedule/use-event-drag.d.ts.map +1 -1
- package/dist/components/schedule/use-event-resize.d.ts.map +1 -1
- package/dist/theme.css +9 -3
- package/package.json +1 -1
- package/src/components/alert/alert.test.tsx +8 -2
- package/src/components/alert/alert.tsx +18 -11
- package/src/components/calendar/calendar-body.tsx +8 -1
- package/src/components/notification/create-notifier.tsx +6 -5
- package/src/components/notification/notification.test.tsx +15 -0
- package/src/components/notification/notification.tsx +4 -4
- package/src/components/schedule/now-cursor-line.tsx +1 -1
- package/src/components/schedule/schedule-agenda-view.tsx +6 -4
- package/src/components/schedule/schedule-all-day-row.tsx +1 -1
- package/src/components/schedule/schedule-create-draft.tsx +14 -5
- package/src/components/schedule/schedule-dates.ts +3 -2
- package/src/components/schedule/schedule-days-view.tsx +6 -4
- package/src/components/schedule/schedule-drag-ghost.tsx +27 -12
- package/src/components/schedule/schedule-event-chip.tsx +9 -2
- package/src/components/schedule/schedule-event-list-popover-content.tsx +1 -1
- package/src/components/schedule/schedule-geometry.ts +21 -0
- package/src/components/schedule/schedule-grid-gesture.test.ts +83 -1
- package/src/components/schedule/schedule-grid-gesture.ts +67 -28
- package/src/components/schedule/schedule-month-view.tsx +7 -5
- package/src/components/schedule/schedule-next-up.tsx +5 -3
- package/src/components/schedule/schedule-timed-grid.tsx +41 -3
- package/src/components/schedule/schedule-toolbar.tsx +23 -17
- package/src/components/schedule/schedule-types.ts +4 -1
- package/src/components/schedule/schedule-year-view.tsx +7 -5
- package/src/components/schedule/schedule.test.tsx +132 -14
- package/src/components/schedule/schedule.tsx +6 -4
- package/src/components/schedule/use-event-create.ts +7 -6
- package/src/components/schedule/use-event-drag.ts +10 -4
- package/src/components/schedule/use-event-resize.ts +4 -2
- package/src/theme.css +9 -3
- package/dist/chunk-ACE7FBWE.js.map +0 -1
- package/dist/chunk-TMMEJKLI.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/notification/store.ts","../../../src/components/notification/create-notifier.tsx"],"names":["promise","max"],"mappings":";;;;;;;;;;;;;;;;;AA4CA,IAAM,kBAAmC,MAAA,CAAO,MAAA,CAAO,EAAE,MAAA,EAAQ,IAAI,CAAA;AAI9D,SAAS,gBAAA,CAAiB,MAAA,GAA0B,EAAE,GAAA,EAAK,GAAE,EAAe;AACjF,EAAA,IAAI,KAAA,GAAyB,EAAE,MAAA,EAAQ,EAAC,EAAE;AAC1C,EAAA,MAAM,SAAA,uBAAgB,GAAA,EAAgB;AACtC,EAAA,MAAM,MAAA,uBAAa,GAAA,EAAoB;AACvC,EAAA,IAAI,MAAA,GAAS,KAAA;AAEb,EAAA,MAAM,OAAO,MAAM;AACjB,IAAA,KAAA,MAAW,QAAA,IAAY,WAAW,QAAA,EAAS;AAAA,EAC7C,CAAA;AACA,EAAA,MAAM,GAAA,GAAM,CAAC,MAAA,KAAwB;AACnC,IAAA,KAAA,GAAQ,EAAE,MAAA,EAAO;AACjB,I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QAAA,EAAS;AAAA,YACrC,cAAA,EAAgB,MAAM,KAAA,CAAM,SAAA,EAAU;AAAA,YACtC,KAAA,EAAO;AAAA,cACL,CAAC,qBAA+B,GAAG,CAAA,EAAG,WAAW,CAAA,EAAA,CAAA;AAAA,cACjD,CAAC,oBAA8B,GAAG,CAAA,EAAG,cAAc,CAAA,EAAA;AAAA,aACrD;AAAA,YACA,SAAA,EAAU,+FAAA;AAAA,YAET,QAAA,EAAA;AAAA,cAAA,KAAA,CAAM,IAAI,CAAC,EAAE,OAAO,KAAA,EAAO,MAAA,EAAQ,QAAO,qBACzC,GAAA;AAAA,gBAAC,WAAA;AAAA,gBAAA;AAAA,kBAEC,KAAA;AAAA,kBACA,KAAA;AAAA,kBACA,KAAA;AAAA,kBACA,MAAA;AAAA,kBACA,MAAA;AAAA,kBACA,WAAA;AAAA,kBACA;AAAA,iBAAA;AAAA,gBAPK,KAAA,CAAM;AAAA,eASd,CAAA;AAAA,cAKA,gBAAgB,CAAA,oBACf,GAAA;AAAA,gBAAC,MAAA;AAAA,gBAAA;AAAA,kBACC,aAAA,EAAW,IAAA;AAAA,kBACX,WAAA,EAAU,OAAA;AAAA,kBACV,OAAO,EAAE,CAAC,WAAqB,GAAG,CAAA,EAAG,aAAa,CAAA,EAAA,CAAA;AAAK;AAAA;AACzD;AAAA;AAAA;AAEJ;AAAA,KACF;AAGF,IAAA,IAAI,CAAC,cAAc,OAAO,MAAA;AAC1B,IAAA,uBAAO,GAAA,CAAC,UAAO,SAAA,EAAW,SAAA,GAAY,EAAE,OAAA,EAAS,SAAA,EAAU,GAAI,MAAA,EAAY,QAAA,EAAA,MAAA,EAAO,CAAA;AAAA,EACpF,CAAA;AAEA,EAAA,OAAO,EAAE,QAAQ,aAAA,EAAc;AACjC","file":"index.js","sourcesContent":["import type { ToastData, ToastId } from \"./types\"\n\n/**\n * Framework-agnostic toast store — a tiny vanilla pub/sub modelled on the kit's\n * overlay store (`components/overlays/store.ts`). Holds the live toast stack;\n * the React renderer (`Notifications`) subscribes via `useSyncExternalStore`,\n * and the bound `notify` controller wraps its mutators. No React here, so it's\n * safe to call from anywhere (event handlers, utils).\n *\n * Every mutation produces a fresh `state` + `toasts` array, so `getSnapshot`\n * returns a stable reference between mutations — the contract\n * `useSyncExternalStore` relies on to avoid tearing / render loops.\n *\n * Auto-dismiss timers live here (plain `setTimeout`), with remaining-time\n * bookkeeping so `pauseAll`/`resumeAll` (driven by the renderer on hover /\n * tab-hidden) can freeze and resume them. DOM listeners do NOT live here.\n */\n\nexport interface ToastStoreState {\n toasts: ToastData[]\n}\n\nexport interface ToastStore {\n subscribe: (listener: () => void) => () => void\n getSnapshot: () => ToastStoreState\n getServerSnapshot: () => ToastStoreState\n /** Upsert by id: a new id prepends (and starts its timer); an existing id\n * merges in place and restarts its timer (used for status transitions). */\n create: (data: ToastData) => ToastId\n /** Shallow-merge a patch into a live toast without touching its timer/status. */\n update: (id: ToastId, patch: Partial<ToastData>) => void\n /** Flip a toast to `dismissing` so its exit animation plays (all if no id). */\n dismiss: (id?: ToastId) => void\n /** Hard-remove a toast — called once its exit animation completes. */\n remove: (id: ToastId) => void\n /** Freeze every auto-dismiss timer (hover / tab hidden). */\n pauseAll: () => void\n /** Resume every frozen timer from its remaining time. */\n resumeAll: () => void\n has: (id: ToastId) => boolean\n}\n\n/** Frozen, module-stable empty stack for SSR — toasts are runtime-only, so the\n * server snapshot is always empty and matches the client's first render. */\nconst SERVER_SNAPSHOT: ToastStoreState = Object.freeze({ toasts: [] })\n\ntype Timer = { remaining: number; startedAt: number; handle: ReturnType<typeof setTimeout> | null }\n\nexport function createToastStore(config: { max: number } = { max: 5 }): ToastStore {\n let state: ToastStoreState = { toasts: [] }\n const listeners = new Set<() => void>()\n const timers = new Map<ToastId, Timer>()\n let paused = false\n\n const emit = () => {\n for (const listener of listeners) listener()\n }\n const set = (toasts: ToastData[]) => {\n state = { toasts }\n emit()\n }\n\n const clearTimer = (id: ToastId) => {\n const timer = timers.get(id)\n if (timer?.handle) clearTimeout(timer.handle)\n timers.delete(id)\n }\n\n const startTimer = (id: ToastId, duration: number) => {\n clearTimer(id)\n if (!Number.isFinite(duration)) return // loading / sticky toasts never expire\n const timer: Timer = { remaining: duration, startedAt: Date.now(), handle: null }\n if (!paused) timer.handle = setTimeout(() => dismiss(id), duration)\n timers.set(id, timer)\n }\n\n const dismiss: ToastStore[\"dismiss\"] = (id) => {\n if (id == null) {\n for (const toast of state.toasts) clearTimer(toast.id)\n set(state.toasts.map((t) => (t.status === \"open\" ? { ...t, status: \"dismissing\" } : t)))\n return\n }\n if (!state.toasts.some((t) => t.id === id)) return\n clearTimer(id)\n set(state.toasts.map((t) => (t.id === id ? { ...t, status: \"dismissing\" } : t)))\n }\n\n return {\n subscribe(listener) {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n getSnapshot() {\n return state\n },\n getServerSnapshot() {\n return SERVER_SNAPSHOT\n },\n create(data) {\n const exists = state.toasts.some((t) => t.id === data.id)\n if (exists) {\n set(state.toasts.map((t) => (t.id === data.id ? { ...t, ...data } : t)))\n } else {\n // Newest first (index 0 = front). Cap the number of *open* toasts at\n // `max` by dismissing the oldest beyond the limit.\n const next = [data, ...state.toasts]\n const open = next.filter((t) => t.status === \"open\")\n if (open.length > config.max) {\n const overflow = new Set(open.slice(config.max).map((t) => t.id))\n for (const id of overflow) clearTimer(id)\n set(next.map((t) => (overflow.has(t.id) ? { ...t, status: \"dismissing\" } : t)))\n } else {\n set(next)\n }\n }\n startTimer(data.id, data.duration)\n return data.id\n },\n update(id, patch) {\n if (!state.toasts.some((t) => t.id === id)) return\n set(state.toasts.map((t) => (t.id === id ? { ...t, ...patch } : t)))\n },\n dismiss,\n remove(id) {\n clearTimer(id)\n if (!state.toasts.some((t) => t.id === id)) return\n set(state.toasts.filter((t) => t.id !== id))\n },\n pauseAll() {\n if (paused) return\n paused = true\n const now = Date.now()\n for (const timer of timers.values()) {\n if (!timer.handle) continue\n clearTimeout(timer.handle)\n timer.remaining -= now - timer.startedAt\n timer.handle = null\n }\n },\n resumeAll() {\n if (!paused) return\n paused = false\n const now = Date.now()\n for (const [id, timer] of timers) {\n if (timer.remaining <= 0) {\n dismiss(id)\n continue\n }\n timer.startedAt = now\n timer.handle = setTimeout(() => dismiss(id), timer.remaining)\n }\n },\n has(id) {\n return state.toasts.some((t) => t.id === id)\n },\n }\n}\n","\"use client\"\n\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { usePresence } from \"@ark-ui/react/presence\"\nimport { customAlphabet } from \"nanoid\"\nimport {\n isValidElement,\n type PointerEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\"\nimport type { UnavailableProps } from \"../../lib/available-if\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { mergeRefs } from \"../../lib/merge-refs\"\nimport { Notification } from \"./notification\"\nimport { createToastStore, type ToastStore } from \"./store\"\nimport type { ColorWithTypeReason, ToastData, ToastHue, ToastId, ToastType } from \"./types\"\n\n/**\n * `createNotifier` — the imperative toast manager, modelled on the kit's\n * `createOverlays` (a framework-agnostic `useSyncExternalStore` store + a\n * once-mounted renderer + a bound controller).\n *\n * ```tsx\n * // notifier.ts — one instance for the app\n * export const { notify, Notifications } = createNotifier({ placement: \"bottom-end\" })\n *\n * // app root — mount the region once\n * <Notifications />\n *\n * // anywhere\n * notify(\"Copied to clipboard\") // neutral / custom toast\n * notify.success(\"Saved\")\n * notify.error({ title: \"Upload failed\", action: { label: \"Retry\", onClick: retry } })\n * notify.promise(save(), { loading: \"Saving…\", success: \"Saved\", error: \"Failed\" })\n *\n * const id = notify.loading(\"Uploading…\") // keep the id to update it\n * notify.update(id, { description: \"Halfway…\" }) // patch in place\n * notify.success({ id, title: \"Uploaded\" }) // …or transition its status\n * ```\n */\n\nexport type NotifyPlacement =\n | \"top-start\"\n | \"top\"\n | \"top-end\"\n | \"bottom-start\"\n | \"bottom\"\n | \"bottom-end\"\n\n/** The fields every toast input shares. A bare `ReactNode` (string/element)\n * is shorthand for `{ title }`. */\ntype NotifyFields = {\n title?: ReactNode\n description?: ReactNode\n /** ms until auto-dismiss. Omit for the notifier default; `loading` never\n * auto-dismisses. */\n duration?: number\n /** Provide to update/dedupe an existing toast (mint via a returned id, or\n * cast your own: `\"upload\" as ToastId`). */\n id?: ToastId\n /** Render a close button. @default true */\n withCloseButton?: boolean\n /** The action section — any `ReactNode` (e.g. an Undo `Notification.ActionTrigger`),\n * revealed independently of the description. */\n action?: ReactNode\n /** Custom leading glyph; `null` hides the default status icon. */\n icon?: ReactNode | null\n}\n\n/** Full options for a neutral `notify(...)` toast — the one call with no\n * status, so the one that takes a `color`. */\nexport type NotifyOptions = NotifyFields & {\n /** Accent palette for a custom toast. */\n color?: Color\n}\n\n/** Options for a status helper (`notify.success(...)`, …). The status sets\n * the hue, so `color` is refused — see `ToastHue`. */\nexport type NotifyStatusOptions = NotifyFields &\n UnavailableProps<Pick<NotifyOptions, \"color\">, ColorWithTypeReason>\n\n/** Options for `notify.update`. It keeps the toast's status and hue, so\n * `color` is refused; re-call `notify({ id, color })` to recolor. */\nexport type NotifyUpdateOptions = NotifyFields &\n UnavailableProps<\n Pick<NotifyOptions, \"color\">,\n \"`update` keeps the hue — re-call `notify({ id, color })` to recolor\"\n >\n\nexport type NotifyInput = ReactNode | NotifyOptions\nexport type NotifyStatusInput = ReactNode | NotifyStatusOptions\nexport type NotifyUpdateInput = ReactNode | NotifyUpdateOptions\n\nexport type CreateNotifierOptions = {\n /** Corner/edge the stack anchors to. @default \"bottom-end\" */\n placement?: NotifyPlacement\n /** Max toasts on screen before the oldest is dismissed. @default 5 */\n max?: number\n /** Default auto-dismiss duration (ms). @default 5000 */\n duration?: number\n /** Expand the collapsed deck into a column on hover/focus. @default true */\n expand?: boolean\n /** Render the region in a Portal (escape clipping ancestors). @default true */\n withinPortal?: boolean\n /** Portal target. @default document.body */\n container?: HTMLElement | null\n}\n\ntype StatusFn = (input: NotifyStatusInput) => ToastId\n\n/** The `promise` sugar: a single toast tracking an async lifecycle. */\nexport type NotifyPromise = <T>(\n promise: Promise<T> | (() => Promise<T>),\n messages: {\n loading: NotifyStatusInput\n success?: NotifyStatusInput | ((value: T) => NotifyStatusInput)\n error?: NotifyStatusInput | ((error: unknown) => NotifyStatusInput)\n },\n) => { id: ToastId; unwrap: () => Promise<T> }\n\n/** Patch a live toast by id, accepting the same shorthand. Only the fields you\n * pass change (title/description/icon/duration/withCloseButton);\n * status/type and the hue are preserved. To change status, re-call a status helper with\n * the same `id` (e.g. `notify.success({ id })`). */\nexport type NotifyUpdate = (id: ToastId, input: NotifyUpdateInput) => ToastId\n\n/** The bound controller. Callable for a neutral toast; status helpers +\n * `promise` + `update` + `dismiss`/`remove` on top. */\nexport type Notify = ((input: NotifyInput) => ToastId) & {\n success: StatusFn\n error: StatusFn\n warning: StatusFn\n info: StatusFn\n loading: StatusFn\n promise: NotifyPromise\n update: NotifyUpdate\n /** Dismiss a toast (plays its exit); all toasts if no id. */\n dismiss: (id?: ToastId) => void\n /** Immediately remove a toast (no exit animation). */\n remove: (id: ToastId) => void\n /** Whether a toast with this id is still live (open or dismissing). */\n has: (id: ToastId) => boolean\n /** Snapshot of the live toasts (advanced / testing). */\n getToasts: () => ToastData[]\n}\n\nexport type Notifier = {\n notify: Notify\n Notifications: () => ReactNode\n}\n\n/** A bare node (string/number/element/array) is a title; any other object is\n * a full `NotifyOptions`. */\n/** Any of the three option shapes; they differ only in whether `color` is accepted. */\ntype AnyOptions = NotifyOptions | NotifyStatusOptions | NotifyUpdateOptions\n\nconst isOptions = <O extends AnyOptions>(input: ReactNode | O): input is O =>\n input != null && typeof input === \"object\" && !isValidElement(input) && !Array.isArray(input)\n\nconst nanoid = customAlphabet(\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\", 8)\n/** Mint a branded `ToastId` (the one place a plain string becomes a `ToastId`). */\nconst generateId = (): ToastId => nanoid() as ToastId\n\n/** px gap between toasts when the stack is expanded. */\nconst GAP = 12\n\n/** Region positioning (fixed + anchored edge) per placement. The stacking\n * geometry itself lives in theme.css, keyed on `data-placement`. */\nconst REGION_POSITION = {\n \"top-start\": \"top-4 left-4\",\n top: \"top-4 left-1/2 -translate-x-1/2\",\n \"top-end\": \"top-4 right-4\",\n \"bottom-start\": \"bottom-4 left-4\",\n bottom: \"bottom-4 left-1/2 -translate-x-1/2\",\n \"bottom-end\": \"bottom-4 right-4\",\n} as const satisfies Record<NotifyPlacement, string>\n/** Fields `notify.update` copies from the input onto a live toast — the keys\n * shared by `NotifyOptions` and `ToastData` (excludes `id`/`status`/`type`). */\nconst NOTIFICATION_REMOVABLE_PROPS = [\n \"title\",\n \"description\",\n \"action\",\n \"icon\",\n \"duration\",\n \"withCloseButton\",\n] as const satisfies (keyof NotifyUpdateOptions & keyof ToastData)[]\n\n/** px a pointer must travel to count as a dismiss-swipe. */\nconst SWIPE_THRESHOLD = 60\n/** px of movement under which a press counts as a click (→ dismiss). */\nconst CLICK_SLOP = 5\n\ntype ToasterItemProps = {\n toast: ToastData\n store: ToastStore\n /** Position from the front (0 = newest). */\n index: number\n /** Σ heights + gaps of the newer toasts in front (expanded-column offset), px. */\n offset: number\n /** This toast's measured height, px. */\n height: number\n /** The front toast's height, px (for top-aligned collapsed peeks). */\n frontHeight: number\n onMeasure: (id: string, height: number) => void\n}\n\n/**\n * A single live toast inside the stack. Owns the toaster behavior the card\n * itself stays free of — enter/exit via Ark Presence, height measurement for the\n * stacking layout, and swipe/click-to-dismiss — then renders the presentational\n * `Notification`, forwarding the merged ref, stacking style vars and gesture\n * handlers straight onto its `Root`.\n */\nfunction ToasterItem({\n toast,\n store,\n index,\n offset,\n height,\n frontHeight,\n onMeasure,\n}: ToasterItemProps) {\n const { id } = toast\n // The store keeps `type` and `color` side by side; the card takes one or the\n // other. At most one is ever set (see `toData`), so pick whichever is.\n const { type, color, ...fields } = toast\n const hue: ToastHue = type ? { type } : { color }\n\n const presence = usePresence({\n present: toast.status === \"open\",\n lazyMount: true,\n unmountOnExit: true,\n onExitComplete: () => store.remove(id),\n })\n\n // Report the card's natural height so the renderer can lay out the stack.\n const measureRef = useRef<HTMLDivElement | null>(null)\n useEffect(() => {\n const node = measureRef.current\n if (!node) return\n onMeasure(id, node.offsetHeight)\n const observer = new ResizeObserver(() => onMeasure(id, node.offsetHeight))\n observer.observe(node)\n return () => observer.disconnect()\n }, [id, onMeasure])\n\n // Swipe / click to dismiss. Dragging past the threshold flicks the toast away\n // (`--swipe-x`/`--swipe-opacity` track the pointer, transition off for 1:1);\n // a click that barely moves dismisses too. Presses that start on an\n // interactive child (close / action) are left to that control.\n const drag = useRef<{ startX: number; interactive: boolean } | null>(null)\n const onPointerDown = (event: PointerEvent<HTMLDivElement>) => {\n if (event.button !== 0) return\n const interactive =\n (event.target as Element).closest(\"button, a, input, [role='button']\") != null\n drag.current = { startX: event.clientX, interactive }\n if (!interactive) event.currentTarget.setPointerCapture(event.pointerId)\n }\n const onPointerMove = (event: PointerEvent<HTMLDivElement>) => {\n const state = drag.current\n if (!state || state.interactive) return\n const dx = event.clientX - state.startX\n const el = event.currentTarget\n el.style.transition = \"none\"\n el.style.setProperty(\"--swipe-x\", `${dx}px`)\n el.style.setProperty(\"--swipe-opacity\", `${Math.max(0.15, 1 - Math.abs(dx) / 240)}`)\n }\n const onPointerEnd = (event: PointerEvent<HTMLDivElement>) => {\n const state = drag.current\n drag.current = null\n if (!state || state.interactive) return\n const dx = event.clientX - state.startX\n const el = event.currentTarget\n el.style.transition = \"\"\n if (Math.abs(dx) > SWIPE_THRESHOLD || Math.abs(dx) < CLICK_SLOP) {\n store.dismiss(id)\n } else {\n el.style.setProperty(\"--swipe-x\", \"0px\")\n el.style.setProperty(\"--swipe-opacity\", \"1\")\n }\n }\n\n if (presence.unmounted) return null\n\n return (\n <Notification\n ref={mergeRefs(presence.ref, measureRef)}\n {...fields}\n {...hue}\n {...presence.getPresenceProps()}\n data-part=\"toast\"\n onClose={() => store.dismiss(id)}\n // `cursor-grab` lives here (not in the shared cva) so only swipeable\n // toaster toasts show it — a standalone `Notification.Root` doesn't.\n className=\"cursor-grab touch-none select-none active:cursor-grabbing\"\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerEnd}\n onPointerCancel={onPointerEnd}\n style={{\n [\"--index\" as string]: index,\n [\"--offset\" as string]: `${offset}px`,\n [\"--height\" as string]: `${height}px`,\n [\"--front-height\" as string]: `${frontHeight}px`,\n }}\n />\n )\n}\n\nexport function createNotifier(options: CreateNotifierOptions = {}): Notifier {\n const {\n placement = \"bottom-end\",\n max = 5,\n duration: defaultDuration = 5000,\n expand = true,\n withinPortal = true,\n container,\n } = options\n\n const store = createToastStore({ max })\n\n // Generic so each call site keeps its own shape (a status input stays a\n // status input). `{ title }` alone is a valid instance of every shape.\n const normalize = <O extends AnyOptions>(input: ReactNode | O): O =>\n isOptions(input) ? input : ({ title: input as ReactNode } as O)\n\n const toData = (input: NotifyInput | NotifyStatusInput, type?: ToastType): ToastData => {\n const o = normalize(input)\n return {\n id: o.id ?? generateId(),\n status: \"open\",\n type,\n title: o.title,\n description: o.description,\n action: o.action,\n // A status sets the hue: drop any `color` a JS caller slipped past the\n // types, and clear a previous one when a status re-call dedupes by id.\n color: type === undefined ? (o as NotifyOptions).color : undefined,\n icon: o.icon,\n duration: o.duration ?? (type === \"loading\" ? Number.POSITIVE_INFINITY : defaultDuration),\n withCloseButton: o.withCloseButton ?? true,\n }\n }\n\n const status =\n (type: ToastType): StatusFn =>\n (input) =>\n store.create(toData(input, type))\n\n const show = (input: NotifyInput) => store.create(toData(input))\n\n const update: NotifyUpdate = (id, input) => {\n const o = normalize(input)\n // Copy keys that are *present* (not just defined) so an explicit\n // `{ description: undefined }` clears the field rather than being ignored.\n // An omitted key leaves the current value untouched.\n const patch: Partial<ToastData> = {}\n for (const prop of NOTIFICATION_REMOVABLE_PROPS) {\n // TS can't correlate `prop` with `o[prop]`/`patch[prop]` across a union\n // key on writes (the target collapses to their intersection, `undefined`).\n // The prop list is constrained to keys shared by NotifyOptions & ToastData\n // with compatible value types, so this write is safe.\n if (prop in o) (patch as Record<string, unknown>)[prop] = o[prop]\n }\n store.update(id, patch)\n return id\n }\n\n const promise: NotifyPromise = (promise, messages) => {\n const id = generateId()\n const resolve = (input: NotifyStatusInput, type: ToastType) =>\n store.create(toData({ ...normalize(input), id }, type))\n status(\"loading\")({ ...normalize(messages.loading), id })\n const run = typeof promise === \"function\" ? promise() : promise\n run.then(\n (value) => {\n if (messages.success === undefined) return store.dismiss(id)\n resolve(\n typeof messages.success === \"function\" ? messages.success(value) : messages.success,\n \"success\",\n )\n },\n (error) => {\n if (messages.error === undefined) return store.dismiss(id)\n resolve(\n typeof messages.error === \"function\" ? messages.error(error) : messages.error,\n \"error\",\n )\n },\n )\n return { id, unwrap: () => run }\n }\n\n const notify = Object.assign(show, {\n success: status(\"success\"),\n error: status(\"error\"),\n warning: status(\"warning\"),\n info: status(\"info\"),\n loading: status(\"loading\"),\n promise,\n update,\n dismiss: store.dismiss,\n remove: store.remove,\n has: store.has,\n getToasts: () => store.getSnapshot().toasts,\n }) as Notify\n\n const Notifications = () => {\n const { toasts } = useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getServerSnapshot,\n )\n const [heights, setHeights] = useState<Record<string, number>>({})\n\n const onMeasure = useCallback((id: string, height: number) => {\n setHeights((prev) => (prev[id] === height ? prev : { ...prev, [id]: height }))\n }, [])\n\n // Pause auto-dismiss while the tab is hidden so toasts don't expire unseen.\n useEffect(() => {\n const onVisibility = () => (document.hidden ? store.pauseAll() : store.resumeAll())\n document.addEventListener(\"visibilitychange\", onVisibility)\n return () => document.removeEventListener(\"visibilitychange\", onVisibility)\n }, [])\n\n // Toasts are absolutely stacked; the collapsed deck (top-aligned peeks) and\n // the hover-expanded column are both derived in CSS (theme.css) from these\n // measured px vars. `offset` = Σ heights + gaps of the *newer* toasts in\n // front of this one (its position in the expanded column).\n const heightOf = (toast: ToastData) => heights[toast.id] ?? 0\n const frontHeight = toasts[0] ? heightOf(toasts[0]) : 0\n const items = toasts.map((toast, index) => ({\n toast,\n index,\n height: heightOf(toast),\n offset: toasts.slice(0, index).reduce((sum, newer) => sum + heightOf(newer) + GAP, 0),\n }))\n const expandedHeight =\n toasts.reduce((sum, toast) => sum + heightOf(toast), 0) + GAP * Math.max(0, toasts.length - 1)\n // A toast behind the front that's taller overflows *below* it (toward the\n // bottom edge) in bottom placements. That strip is a hit target collapsed,\n // but expanding slides it into the column as the stack grows the other way,\n // stranding the pointer over a gap → the deck blinks open/closed. Size a\n // stationary ghost hover-bridge under the front toast to cover the strip\n // (overestimates by the peek offsets, which is harmless — see theme.css).\n const maxHeight = toasts.reduce((max, toast) => Math.max(max, heightOf(toast)), 0)\n const stackOverflow = placement.startsWith(\"bottom\") ? Math.max(0, maxHeight - frontHeight) : 0\n\n const region = (\n <section\n aria-label=\"Notifications\"\n data-scope=\"notifications\"\n data-placement={placement}\n data-expand={expand ? \"\" : undefined}\n // Slide direction for the enter/exit keyframes: from below for bottom\n // placements, from above for top.\n style={{ [\"--toast-from\" as string]: placement.startsWith(\"top\") ? \"-100%\" : \"100%\" }}\n className={cn(\n \"pointer-events-none fixed z-(--toast-z,100) justify-center flex\",\n REGION_POSITION[placement],\n // Phones (< xs): pin to the bottom, full-bleed, above the safe area.\n \"max-xs:inset-x-0! max-xs:bottom-[calc(1rem+env(safe-area-inset-bottom))]! max-xs:top-auto! max-xs:translate-x-0!\",\n )}\n >\n {/* pointer-events-auto only on the stack, so the region never blocks the\n page. Hover here pauses timers + expands the deck (enter/leave don't\n fire when moving between toasts inside). */}\n <div\n data-part=\"stack\"\n onPointerEnter={() => store.pauseAll()}\n onPointerLeave={() => store.resumeAll()}\n style={{\n [\"--stack-collapsed-h\" as string]: `${frontHeight}px`,\n [\"--stack-expanded-h\" as string]: `${expandedHeight}px`,\n }}\n className=\"pointer-events-auto relative min-w-88 max-xs:min-w-0 max-w-[calc(100vw-2rem)] max-xs:w-screen\"\n >\n {items.map(({ toast, index, offset, height }) => (\n <ToasterItem\n key={toast.id}\n toast={toast}\n store={store}\n index={index}\n offset={offset}\n height={height}\n frontHeight={frontHeight}\n onMeasure={onMeasure}\n />\n ))}\n {/* The stationary ghost hover-bridge sized by `stackOverflow` above:\n an invisible hit-area glued just below the front toast so `:hover`\n on the stack stays put through the collapse↔expand morph (see\n theme.css). Nonzero only for bottom placements with overflow. */}\n {stackOverflow > 0 && (\n <span\n aria-hidden\n data-part=\"ghost\"\n style={{ [\"--ghost-h\" as string]: `${stackOverflow}px` }}\n />\n )}\n </div>\n </section>\n )\n\n if (!withinPortal) return region\n return <Portal container={container ? { current: container } : undefined}>{region}</Portal>\n }\n\n return { notify, Notifications }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/notification/store.ts","../../../src/components/notification/create-notifier.tsx"],"names":["promise","max"],"mappings":";;;;;;;;;;;;;;;;;AA4CA,IAAM,kBAAmC,MAAA,CAAO,MAAA,CAAO,EAAE,MAAA,EAAQ,IAAI,CAAA;AAI9D,SAAS,gBAAA,CAAiB,MAAA,GAA0B,EAAE,GAAA,EAAK,GAAE,EAAe;AACjF,EAAA,IAAI,KAAA,GAAyB,EAAE,MAAA,EAAQ,EAAC,EAAE;AAC1C,EAAA,MAAM,SAAA,uBAAgB,GAAA,EAAgB;AACtC,EAAA,MAAM,MAAA,uBAAa,GAAA,EAAoB;AACvC,EAAA,IAAI,MAAA,GAAS,KAAA;AAEb,EAAA,MAAM,OAAO,MAAM;AACjB,IAAA,KAAA,MAAW,QAAA,IAAY,WAAW,QAAA,EAAS;AAAA,EAC7C,CAAA;AACA,EAAA,MAAM,GAAA,GAAM,CAAC,MAAA,KAAwB;AACnC,IAAA,KAAA,GAAQ,EAAE,MAAA,EAAO;AACjB,IAAA,IAAA,EAAK;AAAA,EACP,CAAA;AAEA,EAAA,MAAM,UAAA,GAAa,CAAC,EAAA,KAAgB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KAAA,EAAO;AAAA,cACL,CAAC,qBAA+B,GAAG,CAAA,EAAG,WAAW,CAAA,EAAA,CAAA;AAAA,cACjD,CAAC,oBAA8B,GAAG,CAAA,EAAG,cAAc,CAAA,EAAA;AAAA,aACrD;AAAA,YACA,SAAA,EAAU,+FAAA;AAAA,YAET,QAAA,EAAA;AAAA,cAAA,KAAA,CAAM,IAAI,CAAC,EAAE,OAAO,KAAA,EAAO,MAAA,EAAQ,QAAO,qBACzC,GAAA;AAAA,gBAAC,WAAA;AAAA,gBAAA;AAAA,kBAEC,KAAA;AAAA,kBACA,KAAA;AAAA,kBACA,KAAA;AAAA,kBACA,MAAA;AAAA,kBACA,MAAA;AAAA,kBACA,WAAA;AAAA,kBACA;AAAA,iBAAA;AAAA,gBAPK,KAAA,CAAM;AAAA,eASd,CAAA;AAAA,cAKA,gBAAgB,CAAA,oBACf,GAAA;AAAA,gBAAC,MAAA;AAAA,gBAAA;AAAA,kBACC,aAAA,EAAW,IAAA;AAAA,kBACX,WAAA,EAAU,OAAA;AAAA,kBACV,OAAO,EAAE,CAAC,WAAqB,GAAG,CAAA,EAAG,aAAa,CAAA,EAAA,CAAA;AAAK;AAAA;AACzD;AAAA;AAAA;AAEJ;AAAA,KACF;AAGF,IAAA,IAAI,CAAC,cAAc,OAAO,MAAA;AAC1B,IAAA,uBAAO,GAAA,CAAC,UAAO,SAAA,EAAW,SAAA,GAAY,EAAE,OAAA,EAAS,SAAA,EAAU,GAAI,MAAA,EAAY,QAAA,EAAA,MAAA,EAAO,CAAA;AAAA,EACpF,CAAA;AAEA,EAAA,OAAO,EAAE,QAAQ,aAAA,EAAc;AACjC","file":"index.js","sourcesContent":["import type { ToastData, ToastId } from \"./types\"\n\n/**\n * Framework-agnostic toast store — a tiny vanilla pub/sub modelled on the kit's\n * overlay store (`components/overlays/store.ts`). Holds the live toast stack;\n * the React renderer (`Notifications`) subscribes via `useSyncExternalStore`,\n * and the bound `notify` controller wraps its mutators. No React here, so it's\n * safe to call from anywhere (event handlers, utils).\n *\n * Every mutation produces a fresh `state` + `toasts` array, so `getSnapshot`\n * returns a stable reference between mutations — the contract\n * `useSyncExternalStore` relies on to avoid tearing / render loops.\n *\n * Auto-dismiss timers live here (plain `setTimeout`), with remaining-time\n * bookkeeping so `pauseAll`/`resumeAll` (driven by the renderer on hover /\n * tab-hidden) can freeze and resume them. DOM listeners do NOT live here.\n */\n\nexport interface ToastStoreState {\n toasts: ToastData[]\n}\n\nexport interface ToastStore {\n subscribe: (listener: () => void) => () => void\n getSnapshot: () => ToastStoreState\n getServerSnapshot: () => ToastStoreState\n /** Upsert by id: a new id prepends (and starts its timer); an existing id\n * merges in place and restarts its timer (used for status transitions). */\n create: (data: ToastData) => ToastId\n /** Shallow-merge a patch into a live toast without touching its timer/status. */\n update: (id: ToastId, patch: Partial<ToastData>) => void\n /** Flip a toast to `dismissing` so its exit animation plays (all if no id). */\n dismiss: (id?: ToastId) => void\n /** Hard-remove a toast — called once its exit animation completes. */\n remove: (id: ToastId) => void\n /** Freeze every auto-dismiss timer (hover / tab hidden). */\n pauseAll: () => void\n /** Resume every frozen timer from its remaining time. */\n resumeAll: () => void\n has: (id: ToastId) => boolean\n}\n\n/** Frozen, module-stable empty stack for SSR — toasts are runtime-only, so the\n * server snapshot is always empty and matches the client's first render. */\nconst SERVER_SNAPSHOT: ToastStoreState = Object.freeze({ toasts: [] })\n\ntype Timer = { remaining: number; startedAt: number; handle: ReturnType<typeof setTimeout> | null }\n\nexport function createToastStore(config: { max: number } = { max: 5 }): ToastStore {\n let state: ToastStoreState = { toasts: [] }\n const listeners = new Set<() => void>()\n const timers = new Map<ToastId, Timer>()\n let paused = false\n\n const emit = () => {\n for (const listener of listeners) listener()\n }\n const set = (toasts: ToastData[]) => {\n state = { toasts }\n emit()\n }\n\n const clearTimer = (id: ToastId) => {\n const timer = timers.get(id)\n if (timer?.handle) clearTimeout(timer.handle)\n timers.delete(id)\n }\n\n const startTimer = (id: ToastId, duration: number) => {\n clearTimer(id)\n if (!Number.isFinite(duration)) return // loading / sticky toasts never expire\n const timer: Timer = { remaining: duration, startedAt: Date.now(), handle: null }\n if (!paused) timer.handle = setTimeout(() => dismiss(id), duration)\n timers.set(id, timer)\n }\n\n const dismiss: ToastStore[\"dismiss\"] = (id) => {\n if (id == null) {\n for (const toast of state.toasts) clearTimer(toast.id)\n set(state.toasts.map((t) => (t.status === \"open\" ? { ...t, status: \"dismissing\" } : t)))\n return\n }\n if (!state.toasts.some((t) => t.id === id)) return\n clearTimer(id)\n set(state.toasts.map((t) => (t.id === id ? { ...t, status: \"dismissing\" } : t)))\n }\n\n return {\n subscribe(listener) {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n getSnapshot() {\n return state\n },\n getServerSnapshot() {\n return SERVER_SNAPSHOT\n },\n create(data) {\n const exists = state.toasts.some((t) => t.id === data.id)\n if (exists) {\n set(state.toasts.map((t) => (t.id === data.id ? { ...t, ...data } : t)))\n } else {\n // Newest first (index 0 = front). Cap the number of *open* toasts at\n // `max` by dismissing the oldest beyond the limit.\n const next = [data, ...state.toasts]\n const open = next.filter((t) => t.status === \"open\")\n if (open.length > config.max) {\n const overflow = new Set(open.slice(config.max).map((t) => t.id))\n for (const id of overflow) clearTimer(id)\n set(next.map((t) => (overflow.has(t.id) ? { ...t, status: \"dismissing\" } : t)))\n } else {\n set(next)\n }\n }\n startTimer(data.id, data.duration)\n return data.id\n },\n update(id, patch) {\n if (!state.toasts.some((t) => t.id === id)) return\n set(state.toasts.map((t) => (t.id === id ? { ...t, ...patch } : t)))\n },\n dismiss,\n remove(id) {\n clearTimer(id)\n if (!state.toasts.some((t) => t.id === id)) return\n set(state.toasts.filter((t) => t.id !== id))\n },\n pauseAll() {\n if (paused) return\n paused = true\n const now = Date.now()\n for (const timer of timers.values()) {\n if (!timer.handle) continue\n clearTimeout(timer.handle)\n timer.remaining -= now - timer.startedAt\n timer.handle = null\n }\n },\n resumeAll() {\n if (!paused) return\n paused = false\n const now = Date.now()\n for (const [id, timer] of timers) {\n if (timer.remaining <= 0) {\n dismiss(id)\n continue\n }\n timer.startedAt = now\n timer.handle = setTimeout(() => dismiss(id), timer.remaining)\n }\n },\n has(id) {\n return state.toasts.some((t) => t.id === id)\n },\n }\n}\n","\"use client\"\n\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { usePresence } from \"@ark-ui/react/presence\"\nimport { customAlphabet } from \"nanoid\"\nimport {\n isValidElement,\n type PointerEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\"\nimport type { UnavailableProps } from \"../../lib/available-if\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { mergeRefs } from \"../../lib/merge-refs\"\nimport { Notification } from \"./notification\"\nimport { createToastStore, type ToastStore } from \"./store\"\nimport type { ColorWithTypeReason, ToastData, ToastHue, ToastId, ToastType } from \"./types\"\n\n/**\n * `createNotifier` — the imperative toast manager, modelled on the kit's\n * `createOverlays` (a framework-agnostic `useSyncExternalStore` store + a\n * once-mounted renderer + a bound controller).\n *\n * ```tsx\n * // notifier.ts — one instance for the app\n * export const { notify, Notifications } = createNotifier({ placement: \"bottom-end\" })\n *\n * // app root — mount the region once\n * <Notifications />\n *\n * // anywhere\n * notify(\"Copied to clipboard\") // neutral / custom toast\n * notify.success(\"Saved\")\n * notify.error({ title: \"Upload failed\", action: { label: \"Retry\", onClick: retry } })\n * notify.promise(save(), { loading: \"Saving…\", success: \"Saved\", error: \"Failed\" })\n *\n * const id = notify.loading(\"Uploading…\") // keep the id to update it\n * notify.update(id, { description: \"Halfway…\" }) // patch in place\n * notify.success({ id, title: \"Uploaded\" }) // …or transition its status\n * ```\n */\n\nexport type NotifyPlacement =\n | \"top-start\"\n | \"top\"\n | \"top-end\"\n | \"bottom-start\"\n | \"bottom\"\n | \"bottom-end\"\n\n/** The fields every toast input shares. A bare `ReactNode` (string/element)\n * is shorthand for `{ title }`. */\ntype NotifyFields = {\n title?: ReactNode\n description?: ReactNode\n /** ms until auto-dismiss. Omit for the notifier default; `loading` never\n * auto-dismisses. */\n duration?: number\n /** Provide to update/dedupe an existing toast (mint via a returned id, or\n * cast your own: `\"upload\" as ToastId`). */\n id?: ToastId\n /** Render a close button. @default true */\n withCloseButton?: boolean\n /** The action section — any `ReactNode` (e.g. an Undo `Notification.ActionTrigger`),\n * revealed independently of the description. */\n action?: ReactNode\n /** Custom leading glyph; `null` hides the default status icon. */\n icon?: ReactNode | null\n}\n\n/** Full options for a neutral `notify(...)` toast — the one call with no\n * status, so the one that takes a `color`. */\nexport type NotifyOptions = NotifyFields & {\n /** Accent palette for a custom toast. */\n color?: Color\n}\n\n/** Options for a status helper (`notify.success(...)`, …). The status sets\n * the hue, so `color` is refused — see `ToastHue`. */\nexport type NotifyStatusOptions = NotifyFields &\n UnavailableProps<Pick<NotifyOptions, \"color\">, ColorWithTypeReason>\n\n/** Options for `notify.update`. It keeps the toast's status and hue, so\n * `color` is refused; re-call `notify({ id, color })` to recolor. */\nexport type NotifyUpdateOptions = NotifyFields &\n UnavailableProps<\n Pick<NotifyOptions, \"color\">,\n \"`update` keeps the hue — re-call `notify({ id, color })` to recolor\"\n >\n\nexport type NotifyInput = ReactNode | NotifyOptions\nexport type NotifyStatusInput = ReactNode | NotifyStatusOptions\nexport type NotifyUpdateInput = ReactNode | NotifyUpdateOptions\n\nexport type CreateNotifierOptions = {\n /** Corner/edge the stack anchors to. @default \"bottom-end\" */\n placement?: NotifyPlacement\n /** Max toasts on screen before the oldest is dismissed. @default 5 */\n max?: number\n /** Default auto-dismiss duration (ms). @default 5000 */\n duration?: number\n /** Expand the collapsed deck into a column on hover/focus. @default true */\n expand?: boolean\n /** Render the region in a Portal (escape clipping ancestors). @default true */\n withinPortal?: boolean\n /** Portal target. @default document.body */\n container?: HTMLElement | null\n}\n\ntype StatusFn = (input: NotifyStatusInput) => ToastId\n\n/** The `promise` sugar: a single toast tracking an async lifecycle. */\nexport type NotifyPromise = <T>(\n promise: Promise<T> | (() => Promise<T>),\n messages: {\n loading: NotifyStatusInput\n success?: NotifyStatusInput | ((value: T) => NotifyStatusInput)\n error?: NotifyStatusInput | ((error: unknown) => NotifyStatusInput)\n },\n) => { id: ToastId; unwrap: () => Promise<T> }\n\n/** Patch a live toast by id, accepting the same shorthand. Only the fields you\n * pass change (title/description/icon/duration/withCloseButton);\n * status/type and the hue are preserved. To change status, re-call a status helper with\n * the same `id` (e.g. `notify.success({ id })`). */\nexport type NotifyUpdate = (id: ToastId, input: NotifyUpdateInput) => ToastId\n\n/** The bound controller. Callable for a neutral toast; status helpers +\n * `promise` + `update` + `dismiss`/`remove` on top. */\nexport type Notify = ((input: NotifyInput) => ToastId) & {\n success: StatusFn\n error: StatusFn\n warning: StatusFn\n info: StatusFn\n loading: StatusFn\n promise: NotifyPromise\n update: NotifyUpdate\n /** Dismiss a toast (plays its exit); all toasts if no id. */\n dismiss: (id?: ToastId) => void\n /** Immediately remove a toast (no exit animation). */\n remove: (id: ToastId) => void\n /** Whether a toast with this id is still live (open or dismissing). */\n has: (id: ToastId) => boolean\n /** Snapshot of the live toasts (advanced / testing). */\n getToasts: () => ToastData[]\n}\n\nexport type Notifier = {\n notify: Notify\n Notifications: () => ReactNode\n}\n\n/** A bare node (string/number/element/array) is a title; any other object is\n * a full `NotifyOptions`. */\n/** Any of the three option shapes; they differ only in whether `color` is accepted. */\ntype AnyOptions = NotifyOptions | NotifyStatusOptions | NotifyUpdateOptions\n\nconst isOptions = <O extends AnyOptions>(input: ReactNode | O): input is O =>\n input != null && typeof input === \"object\" && !isValidElement(input) && !Array.isArray(input)\n\nconst nanoid = customAlphabet(\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\", 8)\n/** Mint a branded `ToastId` (the one place a plain string becomes a `ToastId`). */\nconst generateId = (): ToastId => nanoid() as ToastId\n\n/** px gap between toasts when the stack is expanded. */\nconst GAP = 12\n\n/** Region positioning (fixed + anchored edge) per placement. The stacking\n * geometry itself lives in theme.css, keyed on `data-placement`. `start`/`end`\n * are logical insets, so they follow the document's `dir` (end = left in RTL). */\nconst REGION_POSITION = {\n \"top-start\": \"top-4 inset-s-4\",\n top: \"top-4 left-1/2 -translate-x-1/2\",\n \"top-end\": \"top-4 inset-e-4\",\n \"bottom-start\": \"bottom-4 inset-s-4\",\n bottom: \"bottom-4 left-1/2 -translate-x-1/2\",\n \"bottom-end\": \"bottom-4 inset-e-4\",\n} as const satisfies Record<NotifyPlacement, string>\n/** Fields `notify.update` copies from the input onto a live toast — the keys\n * shared by `NotifyOptions` and `ToastData` (excludes `id`/`status`/`type`). */\nconst NOTIFICATION_REMOVABLE_PROPS = [\n \"title\",\n \"description\",\n \"action\",\n \"icon\",\n \"duration\",\n \"withCloseButton\",\n] as const satisfies (keyof NotifyUpdateOptions & keyof ToastData)[]\n\n/** px a pointer must travel to count as a dismiss-swipe. */\nconst SWIPE_THRESHOLD = 60\n/** px of movement under which a press counts as a click (→ dismiss). */\nconst CLICK_SLOP = 5\n\ntype ToasterItemProps = {\n toast: ToastData\n store: ToastStore\n /** Position from the front (0 = newest). */\n index: number\n /** Σ heights + gaps of the newer toasts in front (expanded-column offset), px. */\n offset: number\n /** This toast's measured height, px. */\n height: number\n /** The front toast's height, px (for top-aligned collapsed peeks). */\n frontHeight: number\n onMeasure: (id: string, height: number) => void\n}\n\n/**\n * A single live toast inside the stack. Owns the toaster behavior the card\n * itself stays free of — enter/exit via Ark Presence, height measurement for the\n * stacking layout, and swipe/click-to-dismiss — then renders the presentational\n * `Notification`, forwarding the merged ref, stacking style vars and gesture\n * handlers straight onto its `Root`.\n */\nfunction ToasterItem({\n toast,\n store,\n index,\n offset,\n height,\n frontHeight,\n onMeasure,\n}: ToasterItemProps) {\n const { id } = toast\n // The store keeps `type` and `color` side by side; the card takes one or the\n // other. At most one is ever set (see `toData`), so pick whichever is.\n const { type, color, ...fields } = toast\n const hue: ToastHue = type ? { type } : { color }\n\n const presence = usePresence({\n present: toast.status === \"open\",\n lazyMount: true,\n unmountOnExit: true,\n onExitComplete: () => store.remove(id),\n })\n\n // Report the card's natural height so the renderer can lay out the stack.\n const measureRef = useRef<HTMLDivElement | null>(null)\n useEffect(() => {\n const node = measureRef.current\n if (!node) return\n onMeasure(id, node.offsetHeight)\n const observer = new ResizeObserver(() => onMeasure(id, node.offsetHeight))\n observer.observe(node)\n return () => observer.disconnect()\n }, [id, onMeasure])\n\n // Swipe / click to dismiss. Dragging past the threshold flicks the toast away\n // (`--swipe-x`/`--swipe-opacity` track the pointer, transition off for 1:1);\n // a click that barely moves dismisses too. Presses that start on an\n // interactive child (close / action) are left to that control.\n const drag = useRef<{ startX: number; interactive: boolean } | null>(null)\n const onPointerDown = (event: PointerEvent<HTMLDivElement>) => {\n if (event.button !== 0) return\n const interactive =\n (event.target as Element).closest(\"button, a, input, [role='button']\") != null\n drag.current = { startX: event.clientX, interactive }\n if (!interactive) event.currentTarget.setPointerCapture(event.pointerId)\n }\n const onPointerMove = (event: PointerEvent<HTMLDivElement>) => {\n const state = drag.current\n if (!state || state.interactive) return\n const dx = event.clientX - state.startX\n const el = event.currentTarget\n el.style.transition = \"none\"\n el.style.setProperty(\"--swipe-x\", `${dx}px`)\n el.style.setProperty(\"--swipe-opacity\", `${Math.max(0.15, 1 - Math.abs(dx) / 240)}`)\n }\n const onPointerEnd = (event: PointerEvent<HTMLDivElement>) => {\n const state = drag.current\n drag.current = null\n if (!state || state.interactive) return\n const dx = event.clientX - state.startX\n const el = event.currentTarget\n el.style.transition = \"\"\n if (Math.abs(dx) > SWIPE_THRESHOLD || Math.abs(dx) < CLICK_SLOP) {\n store.dismiss(id)\n } else {\n el.style.setProperty(\"--swipe-x\", \"0px\")\n el.style.setProperty(\"--swipe-opacity\", \"1\")\n }\n }\n\n if (presence.unmounted) return null\n\n return (\n <Notification\n ref={mergeRefs(presence.ref, measureRef)}\n {...fields}\n {...hue}\n {...presence.getPresenceProps()}\n data-part=\"toast\"\n onClose={() => store.dismiss(id)}\n // `cursor-grab` lives here (not in the shared cva) so only swipeable\n // toaster toasts show it — a standalone `Notification.Root` doesn't.\n className=\"cursor-grab touch-none select-none active:cursor-grabbing\"\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerEnd}\n onPointerCancel={onPointerEnd}\n style={{\n [\"--index\" as string]: index,\n [\"--offset\" as string]: `${offset}px`,\n [\"--height\" as string]: `${height}px`,\n [\"--front-height\" as string]: `${frontHeight}px`,\n }}\n />\n )\n}\n\nexport function createNotifier(options: CreateNotifierOptions = {}): Notifier {\n const {\n placement = \"bottom-end\",\n max = 5,\n duration: defaultDuration = 5000,\n expand = true,\n withinPortal = true,\n container,\n } = options\n\n const store = createToastStore({ max })\n\n // Generic so each call site keeps its own shape (a status input stays a\n // status input). `{ title }` alone is a valid instance of every shape.\n const normalize = <O extends AnyOptions>(input: ReactNode | O): O =>\n isOptions(input) ? input : ({ title: input as ReactNode } as O)\n\n const toData = (input: NotifyInput | NotifyStatusInput, type?: ToastType): ToastData => {\n const o = normalize(input)\n return {\n id: o.id ?? generateId(),\n status: \"open\",\n type,\n title: o.title,\n description: o.description,\n action: o.action,\n // A status sets the hue: drop any `color` a JS caller slipped past the\n // types, and clear a previous one when a status re-call dedupes by id.\n color: type === undefined ? (o as NotifyOptions).color : undefined,\n icon: o.icon,\n duration: o.duration ?? (type === \"loading\" ? Number.POSITIVE_INFINITY : defaultDuration),\n withCloseButton: o.withCloseButton ?? true,\n }\n }\n\n const status =\n (type: ToastType): StatusFn =>\n (input) =>\n store.create(toData(input, type))\n\n const show = (input: NotifyInput) => store.create(toData(input))\n\n const update: NotifyUpdate = (id, input) => {\n const o = normalize(input)\n // Copy keys that are *present* (not just defined) so an explicit\n // `{ description: undefined }` clears the field rather than being ignored.\n // An omitted key leaves the current value untouched.\n const patch: Partial<ToastData> = {}\n for (const prop of NOTIFICATION_REMOVABLE_PROPS) {\n // TS can't correlate `prop` with `o[prop]`/`patch[prop]` across a union\n // key on writes (the target collapses to their intersection, `undefined`).\n // The prop list is constrained to keys shared by NotifyOptions & ToastData\n // with compatible value types, so this write is safe.\n if (prop in o) (patch as Record<string, unknown>)[prop] = o[prop]\n }\n store.update(id, patch)\n return id\n }\n\n const promise: NotifyPromise = (promise, messages) => {\n const id = generateId()\n const resolve = (input: NotifyStatusInput, type: ToastType) =>\n store.create(toData({ ...normalize(input), id }, type))\n status(\"loading\")({ ...normalize(messages.loading), id })\n const run = typeof promise === \"function\" ? promise() : promise\n run.then(\n (value) => {\n if (messages.success === undefined) return store.dismiss(id)\n resolve(\n typeof messages.success === \"function\" ? messages.success(value) : messages.success,\n \"success\",\n )\n },\n (error) => {\n if (messages.error === undefined) return store.dismiss(id)\n resolve(\n typeof messages.error === \"function\" ? messages.error(error) : messages.error,\n \"error\",\n )\n },\n )\n return { id, unwrap: () => run }\n }\n\n const notify = Object.assign(show, {\n success: status(\"success\"),\n error: status(\"error\"),\n warning: status(\"warning\"),\n info: status(\"info\"),\n loading: status(\"loading\"),\n promise,\n update,\n dismiss: store.dismiss,\n remove: store.remove,\n has: store.has,\n getToasts: () => store.getSnapshot().toasts,\n }) as Notify\n\n const Notifications = () => {\n const { toasts } = useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getServerSnapshot,\n )\n const [heights, setHeights] = useState<Record<string, number>>({})\n\n const onMeasure = useCallback((id: string, height: number) => {\n setHeights((prev) => (prev[id] === height ? prev : { ...prev, [id]: height }))\n }, [])\n\n // Pause auto-dismiss while the tab is hidden so toasts don't expire unseen.\n useEffect(() => {\n const onVisibility = () => (document.hidden ? store.pauseAll() : store.resumeAll())\n document.addEventListener(\"visibilitychange\", onVisibility)\n return () => document.removeEventListener(\"visibilitychange\", onVisibility)\n }, [])\n\n // Toasts are absolutely stacked; the collapsed deck (top-aligned peeks) and\n // the hover-expanded column are both derived in CSS (theme.css) from these\n // measured px vars. `offset` = Σ heights + gaps of the *newer* toasts in\n // front of this one (its position in the expanded column).\n const heightOf = (toast: ToastData) => heights[toast.id] ?? 0\n const frontHeight = toasts[0] ? heightOf(toasts[0]) : 0\n const items = toasts.map((toast, index) => ({\n toast,\n index,\n height: heightOf(toast),\n offset: toasts.slice(0, index).reduce((sum, newer) => sum + heightOf(newer) + GAP, 0),\n }))\n const expandedHeight =\n toasts.reduce((sum, toast) => sum + heightOf(toast), 0) + GAP * Math.max(0, toasts.length - 1)\n // A toast behind the front that's taller overflows *below* it (toward the\n // bottom edge) in bottom placements. That strip is a hit target collapsed,\n // but expanding slides it into the column as the stack grows the other way,\n // stranding the pointer over a gap → the deck blinks open/closed. Size a\n // stationary ghost hover-bridge under the front toast to cover the strip\n // (overestimates by the peek offsets, which is harmless — see theme.css).\n const maxHeight = toasts.reduce((max, toast) => Math.max(max, heightOf(toast)), 0)\n const stackOverflow = placement.startsWith(\"bottom\") ? Math.max(0, maxHeight - frontHeight) : 0\n\n const region = (\n <section\n aria-label=\"Notifications\"\n data-scope=\"notifications\"\n data-placement={placement}\n data-expand={expand ? \"\" : undefined}\n // Slide direction for the enter/exit keyframes: from below for bottom\n // placements, from above for top.\n style={{ [\"--toast-from\" as string]: placement.startsWith(\"top\") ? \"-100%\" : \"100%\" }}\n className={cn(\n \"pointer-events-none fixed z-(--toast-z,100) justify-center flex\",\n REGION_POSITION[placement],\n // Phones (< xs): pin to the bottom, full-bleed, above the safe area.\n \"max-xs:inset-x-0! max-xs:bottom-[calc(1rem+env(safe-area-inset-bottom))]! max-xs:top-auto! max-xs:translate-x-0!\",\n )}\n >\n {/* pointer-events-auto only on the stack, so the region never blocks the\n page. Hover here pauses timers + expands the deck (enter/leave don't\n fire when moving between toasts inside). */}\n <div\n data-part=\"stack\"\n onPointerEnter={() => store.pauseAll()}\n onPointerLeave={() => store.resumeAll()}\n style={{\n [\"--stack-collapsed-h\" as string]: `${frontHeight}px`,\n [\"--stack-expanded-h\" as string]: `${expandedHeight}px`,\n }}\n className=\"pointer-events-auto relative min-w-88 max-xs:min-w-0 max-w-[calc(100vw-2rem)] max-xs:w-screen\"\n >\n {items.map(({ toast, index, offset, height }) => (\n <ToasterItem\n key={toast.id}\n toast={toast}\n store={store}\n index={index}\n offset={offset}\n height={height}\n frontHeight={frontHeight}\n onMeasure={onMeasure}\n />\n ))}\n {/* The stationary ghost hover-bridge sized by `stackOverflow` above:\n an invisible hit-area glued just below the front toast so `:hover`\n on the stack stays put through the collapse↔expand morph (see\n theme.css). Nonzero only for bottom placements with overflow. */}\n {stackOverflow > 0 && (\n <span\n aria-hidden\n data-part=\"ghost\"\n style={{ [\"--ghost-h\" as string]: `${stackOverflow}px` }}\n />\n )}\n </div>\n </section>\n )\n\n if (!withinPortal) return region\n return <Portal container={container ? { current: container } : undefined}>{region}</Portal>\n }\n\n return { notify, Notifications }\n}\n"]}
|
|
@@ -22,10 +22,10 @@ import type { ToastFields, ToastHue, ToastType } from "./types";
|
|
|
22
22
|
* Enter/exit is driven by Ark Presence → `data-state` → the `toast-in/out`
|
|
23
23
|
* keyframes (like modal/drawer/popover).
|
|
24
24
|
*/
|
|
25
|
-
/** The outline surface
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* the border, text and icon through `--c-solid`. */
|
|
25
|
+
/** The outline surface. Deliberately opaque and blurred: a toast floats over
|
|
26
|
+
* arbitrary content. `Alert` (the inline sibling) shares the parts but not
|
|
27
|
+
* this surface — it sits on the page and takes a translucent tint instead.
|
|
28
|
+
* `color` tints the border, text and icon through `--c-solid`. */
|
|
29
29
|
export declare const notificationSurface: string[];
|
|
30
30
|
/** The toast card. Enter/exit via `data-state` keyframes (Ark Presence sets
|
|
31
31
|
* `data-state`); stacking position via the `[data-scope=notifications]` rules
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/components/notification/notification.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAStD,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK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iBAAS,qBAAqB,CAAC,EAC7B,IAAI,EACJ,KAAK,EACL,WAAW,EACX,MAAM,EACN,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,KAAK,EACX,eAAsB,EACtB,YAAoB,EACpB,WAAW,EACX,IAAI,EAAE,KAAK,EACX,YAAY,EACZ,OAAO,EAEP,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,SAAS,EACnB,GAAG,IAAI,EACR,EAAE,iBAAiB,+BAkDnB;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;;;;;CAQvB,CAAA"}
|
|
@@ -69,7 +69,7 @@ export declare const Schedule: typeof _ScheduleRoot & {
|
|
|
69
69
|
YearView: typeof _YearView;
|
|
70
70
|
AgendaView: typeof _AgendaView;
|
|
71
71
|
Toolbar: (({ className, testId, ...rest }: import("./schedule-toolbar").ScheduleToolbarProps) => import("react").JSX.Element) & {
|
|
72
|
-
PrevTrigger: ({ view, date, onDateChange, timeZone, translations, size, className, testId, visibleDays, }: import("../../lib/test-id").WithTestId & {
|
|
72
|
+
PrevTrigger: ({ view, date, onDateChange, timeZone: timeZoneProp, translations, size, className, testId, visibleDays, }: import("../../lib/test-id").WithTestId & {
|
|
73
73
|
view: import("./schedule-types").ScheduleView;
|
|
74
74
|
date: Date;
|
|
75
75
|
onDateChange?: (date: Date) => void;
|
|
@@ -79,7 +79,7 @@ export declare const Schedule: typeof _ScheduleRoot & {
|
|
|
79
79
|
className?: string;
|
|
80
80
|
visibleDays?: number;
|
|
81
81
|
}) => import("react").JSX.Element;
|
|
82
|
-
NextTrigger: ({ view, date, onDateChange, timeZone, translations, size, className, testId, visibleDays, }: import("../../lib/test-id").WithTestId & {
|
|
82
|
+
NextTrigger: ({ view, date, onDateChange, timeZone: timeZoneProp, translations, size, className, testId, visibleDays, }: import("../../lib/test-id").WithTestId & {
|
|
83
83
|
view: import("./schedule-types").ScheduleView;
|
|
84
84
|
date: Date;
|
|
85
85
|
onDateChange?: (date: Date) => void;
|
|
@@ -90,7 +90,7 @@ export declare const Schedule: typeof _ScheduleRoot & {
|
|
|
90
90
|
visibleDays?: number;
|
|
91
91
|
}) => import("react").JSX.Element;
|
|
92
92
|
NowTrigger: ({ onDateChange, now, translations, size, className, testId, }: import("./schedule-toolbar").ScheduleToolbarNowTriggerProps) => import("react").JSX.Element;
|
|
93
|
-
Title: ({ view, date, timeZone, locale, align, visibleDays, className, testId, ...rest }: import("./schedule-toolbar").ScheduleToolbarTitleProps) => import("react").JSX.Element;
|
|
93
|
+
Title: ({ view, date, timeZone: timeZoneProp, locale: localeProp, align, visibleDays, className, testId, ...rest }: import("./schedule-toolbar").ScheduleToolbarTitleProps) => import("react").JSX.Element;
|
|
94
94
|
ViewSwitcher: <const V extends import("./schedule-views").ScheduleViews = readonly ["days", "month", "year"]>({ view, onViewChange, views, translations, size, className, testId, }: import("./schedule-toolbar").ScheduleToolbarViewSwitcherProps<V>) => import("react").JSX.Element;
|
|
95
95
|
};
|
|
96
96
|
NextUp: typeof _ScheduleNextUp;
|