@spark-ui/components 10.11.2 → 10.11.3
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/CHANGELOG.md +6 -0
- package/dist/snackbar/index.d.mts +1 -46
- package/dist/snackbar/index.d.ts +1 -46
- package/dist/snackbar/index.js +37 -185
- package/dist/snackbar/index.js.map +1 -1
- package/dist/snackbar/index.mjs +12 -157
- package/dist/snackbar/index.mjs.map +1 -1
- package/package.json +7 -9
package/dist/snackbar/index.mjs
CHANGED
|
@@ -12,158 +12,13 @@ import "../chunk-KEGAAGJW.mjs";
|
|
|
12
12
|
import "../chunk-6QCEPQ3U.mjs";
|
|
13
13
|
|
|
14
14
|
// src/snackbar/Snackbar.tsx
|
|
15
|
+
import {
|
|
16
|
+
ToastQueue,
|
|
17
|
+
useToastQueue
|
|
18
|
+
} from "@react-stately/toast";
|
|
15
19
|
import { useEffect as useEffect2, useRef as useRef4 } from "react";
|
|
16
20
|
import { createPortal } from "react-dom";
|
|
17
21
|
|
|
18
|
-
// src/snackbar/local-toast/useToastState.ts
|
|
19
|
-
import { useCallback, useMemo } from "react";
|
|
20
|
-
import { useSyncExternalStore } from "use-sync-external-store/shim/index.js";
|
|
21
|
-
function useToastQueue(queue) {
|
|
22
|
-
let subscribe = useCallback((fn) => queue.subscribe(fn), [queue]);
|
|
23
|
-
let getSnapshot = useCallback(() => queue.visibleToasts, [queue]);
|
|
24
|
-
let visibleToasts = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
25
|
-
return {
|
|
26
|
-
visibleToasts,
|
|
27
|
-
add: (content, options) => queue.add(content, options),
|
|
28
|
-
close: (key) => queue.close(key),
|
|
29
|
-
remove: (key) => queue.remove(key),
|
|
30
|
-
pauseAll: () => queue.pauseAll(),
|
|
31
|
-
resumeAll: () => queue.resumeAll()
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
var ToastQueue = class {
|
|
35
|
-
queue = [];
|
|
36
|
-
subscriptions = /* @__PURE__ */ new Set();
|
|
37
|
-
maxVisibleToasts;
|
|
38
|
-
hasExitAnimation;
|
|
39
|
-
/** The currently visible toasts. */
|
|
40
|
-
visibleToasts = [];
|
|
41
|
-
constructor(options) {
|
|
42
|
-
this.maxVisibleToasts = options?.maxVisibleToasts ?? 1;
|
|
43
|
-
this.hasExitAnimation = options?.hasExitAnimation ?? false;
|
|
44
|
-
}
|
|
45
|
-
/** Subscribes to updates to the visible toasts. */
|
|
46
|
-
subscribe(fn) {
|
|
47
|
-
this.subscriptions.add(fn);
|
|
48
|
-
return () => this.subscriptions.delete(fn);
|
|
49
|
-
}
|
|
50
|
-
/** Adds a new toast to the queue. */
|
|
51
|
-
add(content, options = {}) {
|
|
52
|
-
let toastKey = Math.random().toString(36);
|
|
53
|
-
let toast = {
|
|
54
|
-
...options,
|
|
55
|
-
content,
|
|
56
|
-
key: toastKey,
|
|
57
|
-
timer: options.timeout ? new Timer(() => this.close(toastKey), options.timeout) : void 0
|
|
58
|
-
};
|
|
59
|
-
let low = 0;
|
|
60
|
-
let high = this.queue.length;
|
|
61
|
-
while (low < high) {
|
|
62
|
-
let mid = Math.floor((low + high) / 2);
|
|
63
|
-
if ((toast.priority || 0) > (this.queue[mid]?.priority || 0)) {
|
|
64
|
-
high = mid;
|
|
65
|
-
} else {
|
|
66
|
-
low = mid + 1;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
this.queue.splice(low, 0, toast);
|
|
70
|
-
toast.animation = low < this.maxVisibleToasts ? "entering" : "queued";
|
|
71
|
-
let i = this.maxVisibleToasts;
|
|
72
|
-
while (i < this.queue.length) {
|
|
73
|
-
;
|
|
74
|
-
this.queue[i++].animation = "queued";
|
|
75
|
-
}
|
|
76
|
-
this.updateVisibleToasts({ action: "add" });
|
|
77
|
-
return toastKey;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Closes a toast. If `hasExitAnimation` is true, the toast
|
|
81
|
-
* transitions to an "exiting" state instead of being removed immediately.
|
|
82
|
-
*/
|
|
83
|
-
close(key) {
|
|
84
|
-
let index = this.queue.findIndex((t) => t.key === key);
|
|
85
|
-
if (index >= 0) {
|
|
86
|
-
this.queue[index]?.onClose?.();
|
|
87
|
-
this.queue.splice(index, 1);
|
|
88
|
-
}
|
|
89
|
-
this.updateVisibleToasts({ action: "close", key });
|
|
90
|
-
}
|
|
91
|
-
/** Removes a toast from the visible toasts after an exiting animation. */
|
|
92
|
-
remove(key) {
|
|
93
|
-
this.updateVisibleToasts({ action: "remove", key });
|
|
94
|
-
}
|
|
95
|
-
updateVisibleToasts(options) {
|
|
96
|
-
let { action, key } = options;
|
|
97
|
-
let toasts = this.queue.slice(0, this.maxVisibleToasts);
|
|
98
|
-
if (action === "add" && this.hasExitAnimation) {
|
|
99
|
-
let prevToasts = this.visibleToasts.filter((t) => !toasts.some((t2) => t.key === t2.key)).map((t) => ({ ...t, animation: "exiting" }));
|
|
100
|
-
this.visibleToasts = prevToasts.concat(toasts).sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
101
|
-
} else if (action === "close" && this.hasExitAnimation) {
|
|
102
|
-
this.visibleToasts = this.visibleToasts.map((t) => {
|
|
103
|
-
if (t.key !== key) {
|
|
104
|
-
return t;
|
|
105
|
-
} else {
|
|
106
|
-
return { ...t, animation: "exiting" };
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
} else {
|
|
110
|
-
this.visibleToasts = toasts;
|
|
111
|
-
}
|
|
112
|
-
for (let fn of this.subscriptions) {
|
|
113
|
-
fn();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
/** Pauses the timers for all visible toasts. */
|
|
117
|
-
pauseAll() {
|
|
118
|
-
for (let toast of this.visibleToasts) {
|
|
119
|
-
if (toast.timer) {
|
|
120
|
-
toast.timer.pause();
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
/** Resumes the timers for all visible toasts. */
|
|
125
|
-
resumeAll() {
|
|
126
|
-
for (let toast of this.visibleToasts) {
|
|
127
|
-
if (toast.timer) {
|
|
128
|
-
toast.timer.resume();
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
var Timer = class {
|
|
134
|
-
timerId;
|
|
135
|
-
startTime = null;
|
|
136
|
-
remaining;
|
|
137
|
-
callback;
|
|
138
|
-
constructor(callback, delay) {
|
|
139
|
-
this.remaining = delay;
|
|
140
|
-
this.callback = callback;
|
|
141
|
-
}
|
|
142
|
-
reset(delay) {
|
|
143
|
-
this.remaining = delay;
|
|
144
|
-
this.resume();
|
|
145
|
-
}
|
|
146
|
-
pause() {
|
|
147
|
-
if (this.timerId == null) {
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
clearTimeout(this.timerId);
|
|
151
|
-
this.timerId = null;
|
|
152
|
-
this.remaining -= Date.now() - this.startTime;
|
|
153
|
-
}
|
|
154
|
-
resume() {
|
|
155
|
-
if (this.remaining <= 0) {
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
this.startTime = Date.now();
|
|
159
|
-
this.timerId = setTimeout(() => {
|
|
160
|
-
this.timerId = null;
|
|
161
|
-
this.remaining = 0;
|
|
162
|
-
this.callback();
|
|
163
|
-
}, this.remaining);
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
22
|
// src/snackbar/SnackbarRegion.tsx
|
|
168
23
|
import { useToastRegion } from "@react-aria/toast";
|
|
169
24
|
import { cloneElement as cloneElement2, useRef as useRef3 } from "react";
|
|
@@ -174,7 +29,7 @@ import {
|
|
|
174
29
|
Children,
|
|
175
30
|
cloneElement,
|
|
176
31
|
isValidElement,
|
|
177
|
-
useCallback
|
|
32
|
+
useCallback,
|
|
178
33
|
useRef as useRef2
|
|
179
34
|
} from "react";
|
|
180
35
|
|
|
@@ -648,7 +503,7 @@ var SnackbarItem = ({
|
|
|
648
503
|
state,
|
|
649
504
|
ref
|
|
650
505
|
);
|
|
651
|
-
const findElement =
|
|
506
|
+
const findElement = useCallback(
|
|
652
507
|
(elementDisplayName) => {
|
|
653
508
|
const childrenArray = Children.toArray(children);
|
|
654
509
|
const match = childrenArray.filter(isValidElement).find(
|
|
@@ -778,20 +633,20 @@ var SnackbarRegion = ({
|
|
|
778
633
|
};
|
|
779
634
|
|
|
780
635
|
// src/snackbar/useSnackbarGlobalStore.ts
|
|
781
|
-
import { useCallback as
|
|
636
|
+
import { useCallback as useCallback2, useSyncExternalStore } from "react";
|
|
782
637
|
var useSnackbarGlobalStore = ({
|
|
783
638
|
providers,
|
|
784
639
|
subscriptions
|
|
785
640
|
}) => {
|
|
786
|
-
const subscribe =
|
|
641
|
+
const subscribe = useCallback2(
|
|
787
642
|
(listener) => {
|
|
788
643
|
subscriptions.add(listener);
|
|
789
644
|
return () => subscriptions.delete(listener);
|
|
790
645
|
},
|
|
791
646
|
[subscriptions]
|
|
792
647
|
);
|
|
793
|
-
const getLastSnackbarProvider =
|
|
794
|
-
const addProvider =
|
|
648
|
+
const getLastSnackbarProvider = useCallback2(() => [...providers].reverse()[0], [providers]);
|
|
649
|
+
const addProvider = useCallback2(
|
|
795
650
|
(provider2) => {
|
|
796
651
|
providers.add(provider2);
|
|
797
652
|
for (const subscribeFn of subscriptions) {
|
|
@@ -800,7 +655,7 @@ var useSnackbarGlobalStore = ({
|
|
|
800
655
|
},
|
|
801
656
|
[providers, subscriptions]
|
|
802
657
|
);
|
|
803
|
-
const deleteProvider =
|
|
658
|
+
const deleteProvider = useCallback2(
|
|
804
659
|
(provider2) => {
|
|
805
660
|
providers.delete(provider2);
|
|
806
661
|
for (const subscribeFn of subscriptions) {
|
|
@@ -809,7 +664,7 @@ var useSnackbarGlobalStore = ({
|
|
|
809
664
|
},
|
|
810
665
|
[providers, subscriptions]
|
|
811
666
|
);
|
|
812
|
-
const provider =
|
|
667
|
+
const provider = useSyncExternalStore(subscribe, getLastSnackbarProvider, getLastSnackbarProvider);
|
|
813
668
|
return {
|
|
814
669
|
provider,
|
|
815
670
|
addProvider,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/snackbar/Snackbar.tsx","../../src/snackbar/local-toast/useToastState.ts","../../src/snackbar/SnackbarRegion.tsx","../../src/snackbar/SnackbarItem.tsx","../../src/snackbar/SnackbarItem.styles.ts","../../src/snackbar/snackbarVariants.ts","../../src/snackbar/SnackbarItemAction.tsx","../../src/snackbar/SnackbarItemContext.tsx","../../src/snackbar/SnackbarItemClose.tsx","../../src/snackbar/SnackbarItemIcon.tsx","../../src/snackbar/useSwipe.ts","../../src/snackbar/SnackbarRegion.styles.ts","../../src/snackbar/useSnackbarGlobalStore.ts","../../src/snackbar/index.ts"],"sourcesContent":["import { type ReactElement, Ref, type RefObject, useEffect, useRef } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { type ToastOptions as SnackBarItemOptions, ToastQueue, useToastQueue } from './local-toast'\nimport { type SnackbarItemValue } from './SnackbarItem'\nimport { SnackbarRegion, type SnackbarRegionProps } from './SnackbarRegion'\nimport { useSnackbarGlobalStore } from './useSnackbarGlobalStore'\n\n/**\n * We define here a global queue thanks to dedicated util from React Spectrum.\n * It is based on React `useSyncExternalStore` and allows us to consume data from\n * an external data store, and thus preventing use of React context that could\n * lead to unwanted rerenderings. It also simplifies initial implementation.\n */\nlet GLOBAL_SNACKBAR_QUEUE: ToastQueue<SnackbarItemValue> | null = null\n\nconst getGlobalSnackBarQueue = () => {\n if (!GLOBAL_SNACKBAR_QUEUE) {\n GLOBAL_SNACKBAR_QUEUE = new ToastQueue({\n maxVisibleToasts: 1,\n hasExitAnimation: true,\n })\n }\n\n return GLOBAL_SNACKBAR_QUEUE\n}\n\nexport const clearSnackbarQueue = () => {\n GLOBAL_SNACKBAR_QUEUE = null\n}\n\n/**\n * We define a global store to keep track of all providers instances, to ensure\n * we always have a single Snackbar container.\n */\nconst GLOBAL_SNACKBAR_STORE = {\n providers: new Set<RefObject<HTMLDivElement | null>>(),\n subscriptions: new Set<() => void>(),\n}\n\nexport type SnackbarProps = Omit<SnackbarRegionProps, 'state'> & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Snackbar = ({ ref: forwardedRef, ...props }: SnackbarProps): ReactElement | null => {\n const ref = useRef<HTMLDivElement>(null)\n\n const state = useToastQueue(getGlobalSnackBarQueue())\n\n const { provider, addProvider, deleteProvider } = useSnackbarGlobalStore(GLOBAL_SNACKBAR_STORE)\n\n useEffect(() => {\n addProvider(ref)\n\n return () => {\n for (const toast of getGlobalSnackBarQueue().visibleToasts) {\n toast.animation = undefined\n }\n\n deleteProvider(ref)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n return ref === provider && state.visibleToasts.length > 0\n ? createPortal(<SnackbarRegion ref={forwardedRef} state={state} {...props} />, document.body)\n : null\n}\n\nSnackbar.displayName = 'Snackbar'\n\nexport interface AddSnackbarArgs extends SnackbarItemValue, Omit<SnackBarItemOptions, 'timeout'> {\n /**\n * Handler that is called when the snackbar is closed, either by the user\n * or after a timeout.\n */\n onClose?: () => void\n /**\n * A timeout to automatically close the snackbar after, in milliseconds.\n * @default 5000\n */\n timeout?: number | null\n /**\n * The priority of the snackbar relative to other snackbars. Larger numbers indicate higher priority.\n */\n priority?: number\n}\n\nexport const addSnackbar = ({ onClose, timeout = 5000, priority, ...content }: AddSnackbarArgs) => {\n const queue = getGlobalSnackBarQueue()\n\n queue.add(content, {\n onClose,\n timeout: timeout && !content.onAction ? Math.max(timeout, 5000) : undefined,\n priority,\n })\n}\n","/* eslint-disable @typescript-eslint/no-use-before-define */\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useCallback, useMemo } from 'react'\n// Shim to support React 17 and below.\nimport { useSyncExternalStore } from 'use-sync-external-store/shim/index.js'\n\nexport interface ToastStateProps {\n /** The maximum number of toasts to display at a time. */\n maxVisibleToasts?: number\n /**\n * Whether toasts have an exit animation. If true, toasts are not\n * removed immediately but transition into an \"exiting\" state instead.\n * Once the animation is complete, call the `remove` function.\n */\n hasExitAnimation?: boolean\n}\n\nexport interface ToastOptions {\n /** Handler that is called when the toast is closed, either by the user or after a timeout. */\n onClose?: () => void\n /** A timeout to automatically close the toast after, in milliseconds. */\n timeout?: number\n /** The priority of the toast relative to other toasts. Larger numbers indicate higher priority. */\n priority?: number\n}\n\nexport interface QueuedToast<T> extends ToastOptions {\n /** The content of the toast. */\n content: T\n /** A unique key for the toast. */\n key: string\n /** A timer for the toast, if a timeout was set. */\n timer?: Timer\n /** The current animation state for the toast. */\n animation?: 'entering' | 'queued' | 'exiting' | null\n}\n\nexport interface ToastState<T> {\n /** Adds a new toast to the queue. */\n add(content: T, options?: ToastOptions): string\n /**\n * Closes a toast. If `hasExitAnimation` is true, the toast\n * transitions to an \"exiting\" state instead of being removed immediately.\n */\n close(key: string): void\n /** Removes a toast from the visible toasts after an exiting animation. */\n remove(key: string): void\n /** Pauses the timers for all visible toasts. */\n pauseAll(): void\n /** Resumes the timers for all visible toasts. */\n resumeAll(): void\n /** The visible toasts. */\n visibleToasts: QueuedToast<T>[]\n}\n\n/**\n * Provides state management for a toast queue. Toasts display brief, temporary notifications\n * of actions, errors, or other events in an application.\n */\nexport function useToastState<T>(props: ToastStateProps = {}): ToastState<T> {\n let { maxVisibleToasts = 1, hasExitAnimation = false } = props\n let queue = useMemo(\n () => new ToastQueue<T>({ maxVisibleToasts, hasExitAnimation }),\n [maxVisibleToasts, hasExitAnimation]\n )\n\n return useToastQueue(queue)\n}\n\n/**\n * Subscribes to a provided toast queue and provides methods to update it.\n */\nexport function useToastQueue<T>(queue: ToastQueue<T>): ToastState<T> {\n let subscribe = useCallback((fn: any) => queue.subscribe(fn), [queue])\n let getSnapshot = useCallback(() => queue.visibleToasts, [queue])\n let visibleToasts = useSyncExternalStore(subscribe, getSnapshot, getSnapshot)\n\n return {\n visibleToasts,\n add: (content, options) => queue.add(content, options),\n close: key => queue.close(key),\n remove: key => queue.remove(key),\n pauseAll: () => queue.pauseAll(),\n resumeAll: () => queue.resumeAll(),\n }\n}\n\n/**\n * A ToastQueue is a priority queue of toasts.\n */\nexport class ToastQueue<T> {\n private queue: QueuedToast<T>[] = []\n private subscriptions: Set<() => void> = new Set()\n private maxVisibleToasts: number\n private hasExitAnimation: boolean\n /** The currently visible toasts. */\n visibleToasts: QueuedToast<T>[] = []\n\n constructor(options?: ToastStateProps) {\n this.maxVisibleToasts = options?.maxVisibleToasts ?? 1\n this.hasExitAnimation = options?.hasExitAnimation ?? false\n }\n\n /** Subscribes to updates to the visible toasts. */\n subscribe(fn: () => void) {\n this.subscriptions.add(fn)\n\n return () => this.subscriptions.delete(fn)\n }\n\n /** Adds a new toast to the queue. */\n add(content: T, options: ToastOptions = {}) {\n let toastKey = Math.random().toString(36)\n let toast: QueuedToast<T> = {\n ...options,\n content,\n key: toastKey,\n timer: options.timeout ? new Timer(() => this.close(toastKey), options.timeout) : undefined,\n }\n\n let low = 0\n let high = this.queue.length\n while (low < high) {\n let mid = Math.floor((low + high) / 2)\n if ((toast.priority || 0) > (this.queue[mid]?.priority || 0)) {\n high = mid\n } else {\n low = mid + 1\n }\n }\n\n this.queue.splice(low, 0, toast)\n\n toast.animation = low < this.maxVisibleToasts ? 'entering' : 'queued'\n let i = this.maxVisibleToasts\n while (i < this.queue.length) {\n ;(this.queue[i++] as unknown as any).animation = 'queued'\n }\n\n this.updateVisibleToasts({ action: 'add' })\n\n return toastKey\n }\n\n /**\n * Closes a toast. If `hasExitAnimation` is true, the toast\n * transitions to an \"exiting\" state instead of being removed immediately.\n */\n close(key: string) {\n let index = this.queue.findIndex(t => t.key === key)\n if (index >= 0) {\n this.queue[index]?.onClose?.()\n this.queue.splice(index, 1)\n }\n\n this.updateVisibleToasts({ action: 'close', key })\n }\n\n /** Removes a toast from the visible toasts after an exiting animation. */\n remove(key: string) {\n this.updateVisibleToasts({ action: 'remove', key })\n }\n\n private updateVisibleToasts(options: { action: 'add' | 'close' | 'remove'; key?: string }) {\n let { action, key } = options\n let toasts = this.queue.slice(0, this.maxVisibleToasts)\n\n if (action === 'add' && this.hasExitAnimation) {\n let prevToasts: QueuedToast<T>[] = this.visibleToasts\n .filter(t => !toasts.some(t2 => t.key === t2.key))\n .map(t => ({ ...t, animation: 'exiting' }))\n this.visibleToasts = prevToasts\n .concat(toasts)\n .sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0))\n } else if (action === 'close' && this.hasExitAnimation) {\n // Cause a rerender to happen for exit animation\n this.visibleToasts = this.visibleToasts.map(t => {\n if (t.key !== key) {\n return t\n } else {\n return { ...t, animation: 'exiting' }\n }\n })\n } else {\n this.visibleToasts = toasts\n }\n\n for (let fn of this.subscriptions) {\n fn()\n }\n }\n\n /** Pauses the timers for all visible toasts. */\n pauseAll() {\n for (let toast of this.visibleToasts) {\n if (toast.timer) {\n toast.timer.pause()\n }\n }\n }\n\n /** Resumes the timers for all visible toasts. */\n resumeAll() {\n for (let toast of this.visibleToasts) {\n if (toast.timer) {\n toast.timer.resume()\n }\n }\n }\n}\n\nclass Timer {\n private timerId: any\n private startTime: number | null = null\n private remaining: number\n private callback: () => void\n\n constructor(callback: () => void, delay: number) {\n this.remaining = delay\n this.callback = callback\n }\n\n reset(delay: number) {\n this.remaining = delay\n this.resume()\n }\n\n pause() {\n if (this.timerId == null) {\n return\n }\n\n clearTimeout(this.timerId)\n this.timerId = null\n this.remaining -= Date.now() - this.startTime!\n }\n\n resume() {\n if (this.remaining <= 0) {\n return\n }\n\n this.startTime = Date.now()\n this.timerId = setTimeout(() => {\n this.timerId = null\n this.remaining = 0\n this.callback()\n }, this.remaining)\n }\n}\n","import { type AriaToastRegionProps, useToastRegion } from '@react-aria/toast'\nimport { cloneElement, type ComponentPropsWithRef, type ReactElement, useRef } from 'react'\n\nimport { SnackbarItem, type SnackbarItemProps } from './SnackbarItem'\nimport { SnackbarItemContext, type SnackbarItemState } from './SnackbarItemContext'\nimport { snackbarRegionVariant, type SnackbarRegionVariantProps } from './SnackbarRegion.styles'\n\nexport interface SnackbarRegionProps\n extends ComponentPropsWithRef<'div'>,\n AriaToastRegionProps,\n SnackbarRegionVariantProps,\n Pick<SnackbarItemState, 'state'> {\n /**\n * An accessibility label for the snackbar region.\n * @default 'Notifications'\n */\n 'aria-label'?: string\n /**\n * Identifies the element (or elements) that labels the current element.\n */\n 'aria-labelledby'?: string\n /**\n * Identifies the element (or elements) that describes the object.\n */\n 'aria-describedby'?: string\n /**\n * Identifies the element (or elements) that provide a detailed, extended description for the object.\n */\n 'aria-details'?: string\n /**\n * The component/template used to display each snackbar from the queue\n * @default 'Snackbar.Item'\n */\n children?: ReactElement<SnackbarItemProps, typeof SnackbarItem>\n}\n\nexport const SnackbarRegion = ({\n children = <SnackbarItem />,\n state,\n position = 'bottom',\n className,\n ref: forwardedRef,\n ...rest\n}: SnackbarRegionProps): ReactElement => {\n const innerRef = useRef<HTMLDivElement>(null)\n const ref = forwardedRef && typeof forwardedRef !== 'function' ? forwardedRef : innerRef\n\n const { regionProps } = useToastRegion(rest, state, ref)\n\n return (\n <div\n {...regionProps}\n ref={ref}\n data-position={position}\n className={snackbarRegionVariant({ position, className })}\n >\n {state.visibleToasts.map(toast => (\n <SnackbarItemContext.Provider key={toast.key} value={{ toast, state }}>\n {cloneElement(children, { key: toast.key })}\n </SnackbarItemContext.Provider>\n ))}\n </div>\n )\n}\n","/* eslint-disable max-lines-per-function */\n\nimport { useToast } from '@react-aria/toast'\nimport {\n Children,\n cloneElement,\n type ComponentPropsWithRef,\n type FC,\n isValidElement,\n type PropsWithChildren,\n type ReactElement,\n type ReactNode,\n useCallback,\n useRef,\n} from 'react'\n\nimport {\n snackbarItemVariant,\n snackbarItemVariantContent,\n type SnackbarItemVariantContentProps,\n type SnackbarItemVariantProps,\n} from './SnackbarItem.styles'\nimport { SnackbarItemAction, SnackbarItemActionProps } from './SnackbarItemAction'\nimport { SnackbarItemClose, SnackbarItemCloseProps } from './SnackbarItemClose'\nimport { useSnackbarItemContext } from './SnackbarItemContext'\nimport { SnackbarItemIcon, SnackbarItemIconProps } from './SnackbarItemIcon'\nimport { useSwipe } from './useSwipe'\n\nexport interface SnackbarItemValue extends SnackbarItemVariantProps {\n /**\n * Icon that will be prepended before snackbar message\n */\n icon?: ReactNode\n message: ReactNode\n /**\n * If `true` snackbar will display a close button\n * @default false\n */\n isClosable?: boolean\n /**\n * A label for the action button within the toast.\n */\n actionLabel?: string\n /**\n * Handler that is called when the action button is pressed.\n */\n onAction?: () => void\n /**\n * If `true` the action button will be displayed on a new line.\n * @default false\n */\n actionOnNewline?: boolean\n}\n\nexport interface SnackbarItemProps\n extends ComponentPropsWithRef<'div'>,\n SnackbarItemVariantProps,\n SnackbarItemVariantContentProps {\n /**\n * Defines a string value that labels the current element.\n */\n 'aria-label'?: string\n /**\n * Identifies the element (or elements) that labels the current element.\n */\n 'aria-labelledby'?: string\n /**\n * Identifies the element (or elements) that describes the object.\n */\n 'aria-describedby'?: string\n /**\n * Identifies the element (or elements) that provide a detailed, extended description for the object.\n */\n 'aria-details'?: string\n}\n\nexport const SnackbarItem = ({\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-details': ariaDetails,\n design: designProp,\n intent: intentProp,\n actionOnNewline: actionOnNewlineProp,\n className,\n children,\n ref: forwardedRef,\n ...rest\n}: PropsWithChildren<SnackbarItemProps>) => {\n const innerRef = useRef(null)\n const ref = typeof forwardedRef !== 'function' ? forwardedRef || innerRef : innerRef\n\n const { toast, state } = useSnackbarItemContext()\n\n const { state: swipeState, direction: swipeDirection } = useSwipe({\n swipeRef: ref,\n onSwipeStart: state.pauseAll,\n onSwipeCancel: state.resumeAll,\n onSwipeEnd: ({ direction }) => {\n ;['left', 'right'].includes(`${direction}`) && state.close(toast.key)\n },\n })\n\n const { message, icon, isClosable, onAction, actionLabel } = toast.content\n const intent = intentProp ?? toast.content.intent\n const design = designProp ?? toast.content.design\n const actionOnNewline = actionOnNewlineProp ?? toast.content.actionOnNewline\n\n const ariaProps = {\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n ariaDetails,\n }\n\n const { toastProps, titleProps, closeButtonProps, contentProps } = useToast(\n { toast, ...ariaProps },\n state,\n ref\n )\n\n const findElement = useCallback(\n <P extends object>(elementDisplayName: string): ReactElement<P> | undefined => {\n const childrenArray = Children.toArray(children)\n\n const match = childrenArray\n .filter(isValidElement)\n .find(\n (child): child is ReactElement<P> =>\n !!(child.type as FC<P> & { displayName?: string }).displayName?.includes(\n elementDisplayName\n )\n )\n\n return match as ReactElement<P> | undefined\n },\n [children]\n )\n\n const iconFromChildren = findElement<SnackbarItemIconProps>('Snackbar.ItemIcon')\n const actionBtnFromChildren = findElement<SnackbarItemActionProps>('Snackbar.ItemAction')\n const closeBtnFromChildren = findElement<SnackbarItemCloseProps>('Snackbar.ItemClose')\n\n return (\n <div\n data-spark-component=\"snackbar-item\"\n className={snackbarItemVariant({ design, intent, className })}\n data-animation={toast.animation}\n {...(!(swipeState === 'cancel' && toast.animation === 'exiting') && {\n 'data-swipe': swipeState,\n 'data-swipe-direction': swipeDirection,\n })}\n {...(toast.animation === 'exiting' && {\n // Remove snackbar when the exiting animation completes\n onAnimationEnd: () => state.remove(toast.key),\n })}\n ref={ref}\n {...toastProps}\n {...rest}\n >\n <div className={snackbarItemVariantContent({ actionOnNewline })} {...contentProps}>\n {/* 1. ICON */}\n {renderSubComponent(iconFromChildren, icon ? SnackbarItemIcon : null, {\n children: icon,\n })}\n\n {/* 2. MESSAGE */}\n <p\n className=\"px-md py-lg text-body-2 row-span-3\"\n style={{ gridArea: 'message' }}\n {...titleProps}\n >\n {message}\n </p>\n\n {/* 3. ACTION BUTTON */}\n {renderSubComponent(\n actionBtnFromChildren,\n actionLabel && onAction ? SnackbarItemAction : null,\n { intent, design, onClick: onAction, children: actionLabel }\n )}\n\n {/* 4. CLOSE BUTTON */}\n {renderSubComponent(closeBtnFromChildren, isClosable ? SnackbarItemClose : null, {\n intent,\n design,\n /**\n * React Spectrum typing of aria-label is inaccurate, and aria-label value should never be undefined.\n * See https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/i18n/src/useLocalizedStringFormatter.ts#L40\n */\n 'aria-label': closeButtonProps['aria-label'] as string,\n })}\n </div>\n </div>\n )\n}\n\nSnackbarItem.displayName = 'Snackbar.Item'\n\n/**\n * Returns compound item if found in children prop.\n * If not fallbacks to default item, conditionned by addSnackbar options.\n */\nconst renderSubComponent = <P extends object>(\n childItem?: ReactElement<P>,\n defaultItem?: FC<P> | null,\n props?: P\n) => {\n if (childItem) {\n return cloneElement(childItem, { ...props, ...childItem.props })\n } else if (defaultItem) {\n const Item = defaultItem\n\n return <Item {...(props as P)} />\n } else {\n return null\n }\n}\n","import { cva, VariantProps } from 'class-variance-authority'\n\nimport { filledVariants, tintedVariants } from './snackbarVariants'\n\nexport const snackbarItemVariant = cva(\n [\n 'rounded-md shadow-sm',\n 'max-w-[600px]',\n 'cursor-default pointer-events-auto touch-none select-none',\n 'absolute',\n /**\n * Focus\n */\n 'group-focus-visible:outline-hidden group-focus-visible:u-outline group-not-focus-visible:ring-inset',\n /**\n * Positionning\n */\n 'group-data-[position=bottom]:bottom-0 group-data-[position=bottom-left]:bottom-0 group-data-[position=bottom-right]:bottom-0',\n 'group-data-[position=top]:top-0 group-data-[position=top-left]:top-0 group-data-[position=top-right]:top-0',\n /**\n * Animation and opacity\n */\n '[animation-fill-mode: forwards]!',\n 'data-[animation=queued]:animate-fade-in',\n 'data-[animation=entering]:easing-decelerate-back',\n 'data-[animation=exiting]:easing-standard',\n // Parent position bottom|bottom-left|bottom-right\n 'data-[animation=entering]:group-data-[position=bottom]:[&:not([data-swipe])]:animate-slide-in-bottom',\n 'data-[animation=exiting]:opacity-0 data-[animation=exiting]:transition-opacity',\n 'data-[animation=exiting]:group-data-[position=bottom]:[&:not([data-swipe])]:animate-slide-out-bottom',\n 'data-[animation=entering]:group-data-[position=bottom-left]:[&:not([data-swipe])]:animate-slide-in-bottom',\n 'data-[animation=exiting]:group-data-[position=bottom-left]:[&:not([data-swipe])]:animate-slide-out-bottom',\n 'data-[animation=entering]:group-data-[position=bottom-right]:[&:not([data-swipe])]:animate-slide-in-bottom',\n 'data-[animation=exiting]:group-data-[position=bottom-right]:[&:not([data-swipe])]:animate-slide-out-bottom',\n // Parent position top|top-left|top-right\n 'data-[animation=entering]:group-data-[position=top]:[&:not([data-swipe])]:animate-slide-in-top',\n 'data-[animation=exiting]:group-data-[position=top]:[&:not([data-swipe])]:animate-slide-out-top',\n 'data-[animation=entering]:group-data-[position=top-left]:[&:not([data-swipe])]:animate-slide-in-top',\n 'data-[animation=exiting]:group-data-[position=top-left]:[&:not([data-swipe])]:animate-slide-out-top',\n 'data-[animation=entering]:group-data-[position=top-right]:[&:not([data-swipe])]:animate-slide-in-top',\n 'data-[animation=exiting]:group-data-[position=top-right]:[&:not([data-swipe])]:animate-slide-out-top',\n /**\n * Swipe\n */\n 'data-[swipe=move]:data-[swipe-direction=right]:translate-x-(--swipe-position-x)',\n 'data-[swipe=move]:data-[swipe-direction=left]:translate-x-(--swipe-position-x)',\n 'data-[swipe=cancel]:translate-x-0',\n 'data-[swipe=end]:data-[swipe-direction=right]:animate-standalone-swipe-out-right',\n 'data-[swipe=end]:data-[swipe-direction=left]:animate-standalone-swipe-out-left',\n ],\n {\n variants: {\n /**\n * Set different look and feel\n * @default 'filled'\n */\n design: {\n filled: '',\n tinted: '',\n },\n /**\n * Set color intent\n * @default 'neutral'\n */\n intent: {\n success: '',\n alert: '',\n error: '',\n info: '',\n neutral: '',\n main: '',\n basic: '',\n support: '',\n accent: '',\n inverse: '',\n },\n },\n compoundVariants: [...filledVariants, ...tintedVariants],\n defaultVariants: {\n design: 'filled',\n intent: 'neutral',\n },\n }\n)\n\nexport const snackbarItemVariantContent = cva(\n [\n 'inline-grid items-center',\n 'col-start-1 row-start-1',\n 'pl-md pr-lg', // applying padding on the parent prevents VoiceOver on Safari from reading snackbar content 🤷\n ],\n {\n variants: {\n /**\n * Force action button displaying on a new line\n * @default false\n */\n actionOnNewline: {\n true: [\n 'grid-rows-[52px_1fr_52px]',\n 'grid-cols-[min-content_1fr_min-content]',\n \"[grid-template-areas:'icon_message_close'_'._message_.'_'action_action_action']\",\n ],\n false: [\n 'grid-cols-[min-content_1fr_min-content_min-content]',\n \"[grid-template-areas:'icon_message_action_close']\",\n ],\n },\n },\n defaultVariants: {\n actionOnNewline: false,\n },\n }\n)\n\nexport type SnackbarItemVariantProps = VariantProps<typeof snackbarItemVariant>\nexport type SnackbarItemVariantContentProps = VariantProps<typeof snackbarItemVariantContent>\n","export const filledVariants = [\n {\n design: 'filled',\n intent: 'success',\n class: ['bg-success text-on-success'],\n },\n {\n design: 'filled',\n intent: 'alert',\n class: ['bg-alert text-on-alert'],\n },\n {\n design: 'filled',\n intent: 'error',\n class: ['bg-error text-on-error'],\n },\n {\n design: 'filled',\n intent: 'info',\n class: ['bg-info text-on-info'],\n },\n {\n design: 'filled',\n intent: 'neutral',\n class: ['bg-neutral text-on-neutral'],\n },\n {\n design: 'filled',\n intent: 'main',\n class: ['bg-main text-on-main'],\n },\n {\n design: 'filled',\n intent: 'basic',\n class: ['bg-basic text-on-basic'],\n },\n {\n design: 'filled',\n intent: 'support',\n class: ['bg-support text-on-support'],\n },\n {\n design: 'filled',\n intent: 'accent',\n class: ['bg-accent text-on-accent'],\n },\n {\n design: 'filled',\n intent: 'inverse',\n class: ['bg-surface-inverse text-on-surface-inverse'],\n },\n] as const\n\nexport const tintedVariants = [\n {\n design: 'tinted',\n intent: 'success',\n class: ['bg-success-container text-on-success-container'],\n },\n {\n design: 'tinted',\n intent: 'alert',\n class: ['bg-alert-container text-on-alert-container'],\n },\n {\n design: 'tinted',\n intent: 'error',\n class: ['bg-error-container text-on-error-container'],\n },\n {\n design: 'tinted',\n intent: 'info',\n class: ['bg-info-container text-on-info-container'],\n },\n {\n design: 'tinted',\n intent: 'neutral',\n class: ['bg-neutral-container text-on-neutral-container'],\n },\n {\n design: 'tinted',\n intent: 'main',\n class: ['bg-main-container text-on-main-container'],\n },\n {\n design: 'tinted',\n intent: 'basic',\n class: ['bg-basic-container text-on-basic-container'],\n },\n {\n design: 'tinted',\n intent: 'support',\n class: ['bg-support-container text-on-support-container'],\n },\n {\n design: 'tinted',\n intent: 'accent',\n class: ['bg-accent-container text-on-accent-container'],\n },\n {\n design: 'tinted',\n intent: 'inverse',\n class: ['bg-surface-inverse text-on-surface-inverse'],\n },\n] as const\n","import { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { Button, type ButtonProps } from '../button'\nimport type { SnackbarItemVariantProps } from './SnackbarItem.styles'\nimport { useSnackbarItemContext } from './SnackbarItemContext'\n\nexport type SnackbarItemActionProps = Omit<ButtonProps, 'size' | 'shape' | 'intent'> &\n SnackbarItemVariantProps & {\n ref?: Ref<HTMLButtonElement>\n }\n\nexport const SnackbarItemAction = ({\n design: designProp = 'filled',\n intent: intentProp = 'neutral',\n onClick,\n children,\n className,\n ref,\n ...rest\n}: SnackbarItemActionProps) => {\n const { toast, state } = useSnackbarItemContext()\n\n const intent = intentProp ?? toast.content.intent\n const design = designProp ?? toast.content.design\n\n return (\n <Button\n data-spark-component=\"snackbar-item-action\"\n ref={ref}\n size=\"md\"\n shape=\"rounded\"\n {...(intent === 'inverse'\n ? {\n design: 'ghost',\n intent: 'surface',\n }\n : {\n design,\n intent: intent === 'error' ? 'danger' : intent,\n })}\n onClick={e => {\n onClick?.(e)\n state.close(toast.key)\n }}\n style={{ gridArea: 'action', ...rest.style }}\n className={cx('ml-md justify-self-end', className)}\n {...rest}\n >\n {children}\n </Button>\n )\n}\n\nSnackbarItemAction.displayName = 'Snackbar.ItemAction'\n","import { createContext, useContext } from 'react'\n\nimport { QueuedToast, ToastState } from './local-toast'\nimport type { SnackbarItemValue } from './SnackbarItem'\n\nexport interface SnackbarItemState<T = SnackbarItemValue> {\n toast: QueuedToast<T>\n state: ToastState<T>\n}\n\nexport const SnackbarItemContext = createContext<SnackbarItemState>({} as SnackbarItemState)\n\nexport const useSnackbarItemContext = () => useContext(SnackbarItemContext)\n","import { Close } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentPropsWithRef } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton, type IconButtonProps } from '../icon-button'\nimport type { SnackbarItemVariantProps } from './SnackbarItem.styles'\nimport { useSnackbarItemContext } from './SnackbarItemContext'\n\nexport interface SnackbarItemCloseProps\n extends Omit<ComponentPropsWithRef<'button'>, 'aria-label' | 'disabled'>,\n Pick<IconButtonProps, 'aria-label'>,\n SnackbarItemVariantProps {}\n\nexport const SnackbarItemClose = ({\n design: designProp = 'filled',\n intent: intentProp = 'neutral',\n 'aria-label': ariaLabel,\n onClick,\n className,\n ref,\n ...rest\n}: SnackbarItemCloseProps) => {\n const { toast, state } = useSnackbarItemContext()\n\n const intent = intentProp ?? toast.content.intent\n const design = designProp ?? toast.content.design\n\n return (\n <IconButton\n data-spark-component=\"snackbar-item-close\"\n ref={ref}\n size=\"md\"\n shape=\"rounded\"\n {...(intent === 'inverse'\n ? {\n design: 'ghost',\n intent: 'surface',\n }\n : {\n design,\n intent: intent === 'error' ? 'danger' : intent,\n })}\n aria-label={ariaLabel}\n onClick={e => {\n onClick?.(e)\n state.close(toast.key)\n }}\n style={{ gridArea: 'close', ...rest.style }}\n className={cx('ml-md justify-self-end', className)}\n {...rest}\n >\n <Icon size=\"sm\">\n <Close />\n </Icon>\n </IconButton>\n )\n}\n\nSnackbarItemClose.displayName = 'Snackbar.ItemClose'\n","import { cx } from 'class-variance-authority'\nimport type { ReactElement } from 'react'\n\nimport { Icon, type IconProps } from '../icon'\n\nexport type SnackbarItemIconProps = IconProps\n\nexport const SnackbarItemIcon = ({\n children,\n className,\n ...rest\n}: SnackbarItemIconProps): ReactElement => (\n <Icon\n size=\"md\"\n className={cx('mx-md', className)}\n style={{ gridArea: 'icon', ...rest.style }}\n {...rest}\n >\n {children}\n </Icon>\n)\n\nSnackbarItemIcon.displayName = 'Snackbar.ItemIcon'\n","/* eslint-disable complexity */\nimport { type RefObject, useEffect, useRef, useState } from 'react'\n\ninterface SwipeArgs<T> {\n swipeRef: RefObject<T | null>\n onSwipeStart?: ({ state, direction }: SwipeReturn) => void\n onSwipeMove?: ({ state, direction }: SwipeReturn) => void\n onSwipeCancel?: ({ state, direction }: SwipeReturn) => void\n onSwipeEnd?: ({ state, direction }: SwipeReturn) => void\n threshold?: number\n}\n\ninterface SwipeReturn {\n state?: 'start' | 'move' | 'cancel' | 'end'\n direction?: 'up' | 'down' | 'right' | 'left' | null\n}\n\nconst SWIPE_THRESHOLD = 75\n\nexport const useSwipe = <T extends HTMLElement>({\n swipeRef,\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd,\n threshold = 10,\n}: SwipeArgs<T>): SwipeReturn => {\n const [state, setState] = useState<SwipeReturn['state']>()\n\n const direction = useRef<SwipeReturn['direction']>(null)\n const origin = useRef<Record<'x' | 'y', number> | null>(null)\n const delta = useRef<Record<'x' | 'y', number> | null>(null)\n\n const handleSwipeStart = (evt: PointerEvent) => {\n origin.current = { x: evt.clientX, y: evt.clientY }\n\n /**\n * Prevents unwanted text selection in Safari browser (longpress)\n */\n document.addEventListener('selectstart', e => e.preventDefault())\n }\n\n const handleSwipeMove = (evt: PointerEvent) => {\n if (!origin.current) return\n\n const deltaX = Math.abs(evt.clientX - origin.current.x)\n const deltaY = Math.abs(evt.clientY - origin.current.y)\n\n let moveState: SwipeReturn['state']\n\n if (deltaX > deltaY && deltaX > threshold) {\n direction.current = evt.clientX > origin.current.x ? 'right' : 'left'\n } else if (deltaY > threshold) {\n direction.current = evt.clientY > origin.current.y ? 'down' : 'up'\n }\n\n /**\n * If no direction could be defined, then no move should be handled.\n * This is particularly true with trackpads working with MacOS/Windows.\n */\n if (!direction.current) return\n\n if (!delta.current) {\n moveState = 'start'\n delta.current = { x: deltaX, y: deltaY }\n onSwipeStart?.({ state: moveState, direction: direction.current })\n } else {\n moveState = 'move'\n delta.current = { x: deltaX, y: deltaY }\n ;(swipeRef.current as T).style.setProperty(\n '--swipe-position-x',\n `${deltaX > deltaY ? evt.clientX - origin.current.x : 0}px`\n )\n ;(swipeRef.current as T).style.setProperty(\n '--swipe-position-y',\n `${!(deltaX > deltaY) ? evt.clientY - origin.current.y : 0}px`\n )\n onSwipeMove?.({ state: moveState, direction: direction.current })\n }\n\n setState(moveState)\n }\n\n const handleSwipeEnd = () => {\n const proxyDelta = delta.current\n\n origin.current = null\n delta.current = null\n\n if (proxyDelta) {\n const { x: deltaX, y: deltaY } = proxyDelta\n\n let endState: SwipeReturn['state']\n\n if (deltaX > deltaY) {\n if (deltaX > SWIPE_THRESHOLD) {\n endState = 'end'\n onSwipeEnd?.({ state: endState, direction: direction.current })\n } else {\n endState = 'cancel'\n onSwipeCancel?.({ state: endState, direction: direction.current })\n }\n } else {\n if (deltaY > SWIPE_THRESHOLD) {\n endState = 'end'\n onSwipeEnd?.({ state: endState, direction: direction.current })\n } else {\n endState = 'cancel'\n onSwipeCancel?.({ state: endState, direction: direction.current })\n }\n }\n\n setState(endState)\n\n /**\n * Prevents unwanted text selection in Safari browser (longpress)\n */\n document.removeEventListener('selectstart', e => e.preventDefault())\n }\n }\n\n useEffect(() => {\n if (!swipeRef.current) return\n\n const swipeElement = swipeRef.current\n\n swipeElement.addEventListener('pointerdown', handleSwipeStart)\n document.addEventListener('pointermove', handleSwipeMove)\n document.addEventListener('pointerup', handleSwipeEnd)\n\n return () => {\n swipeElement.removeEventListener('pointerdown', handleSwipeStart)\n document.removeEventListener('pointermove', handleSwipeMove)\n document.removeEventListener('pointerup', handleSwipeEnd)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n return {\n state,\n direction: direction.current,\n }\n}\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const snackbarRegionVariant = cva(\n [\n 'fixed inset-x-lg z-toast group',\n 'outline-hidden pointer-events-none',\n 'grid grid-rows-1 grid-cols-1 gap-lg',\n ],\n {\n variants: {\n /**\n * Set snackbar item position\n * @default 'bottom'\n */\n position: {\n top: 'top-lg justify-items-center',\n 'top-right': 'top-lg justify-items-end',\n 'top-left': 'top-lg justify-items-start',\n bottom: 'bottom-lg justify-items-center',\n 'bottom-right': 'bottom-lg justify-items-end',\n 'bottom-left': 'bottom-lg justify-items-start',\n },\n },\n defaultVariants: {\n position: 'bottom',\n },\n }\n)\n\nexport type SnackbarRegionVariantProps = VariantProps<typeof snackbarRegionVariant>\n","import { type RefObject, useCallback, useSyncExternalStore } from 'react'\n\ninterface UseSnackbarGlobalStoreArgs<T> {\n providers: Set<T>\n subscriptions: Set<() => void>\n}\n\ninterface UseSnackbarGlobalStoreReturn<T> {\n provider: T\n addProvider: (ref: T) => void\n deleteProvider: (ref: T) => void\n}\n\n/**\n * This hook is a basic abstraction of useSyncExternalStore hook which allows us\n * to consume data from an external data store.\n *\n * Cf. https://react.dev/reference/react/useSyncExternalStore#subscribing-to-an-external-store\n */\n\nexport const useSnackbarGlobalStore = <T = RefObject<HTMLDivElement | null>>({\n providers,\n subscriptions,\n}: UseSnackbarGlobalStoreArgs<T>): UseSnackbarGlobalStoreReturn<T> => {\n const subscribe = useCallback(\n (listener: () => void) => {\n subscriptions.add(listener)\n\n return () => subscriptions.delete(listener)\n },\n [subscriptions]\n )\n\n const getLastSnackbarProvider = useCallback(() => [...providers].reverse()[0] as T, [providers])\n\n const addProvider = useCallback(\n (provider: T) => {\n providers.add(provider)\n\n for (const subscribeFn of subscriptions) {\n subscribeFn()\n }\n },\n [providers, subscriptions]\n )\n\n const deleteProvider = useCallback(\n (provider: T) => {\n providers.delete(provider)\n\n for (const subscribeFn of subscriptions) {\n subscribeFn()\n }\n },\n [providers, subscriptions]\n )\n\n const provider = useSyncExternalStore(subscribe, getLastSnackbarProvider, getLastSnackbarProvider)\n\n return {\n provider,\n addProvider,\n deleteProvider,\n }\n}\n","import {\n addSnackbar,\n type AddSnackbarArgs,\n clearSnackbarQueue,\n Snackbar as Root,\n type SnackbarProps,\n} from './Snackbar'\nimport { SnackbarItem as Item, type SnackbarItemProps } from './SnackbarItem'\nimport {\n SnackbarItemAction as ItemAction,\n type SnackbarItemActionProps,\n} from './SnackbarItemAction'\nimport { SnackbarItemClose as ItemClose, type SnackbarItemCloseProps } from './SnackbarItemClose'\nimport { SnackbarItemIcon as ItemIcon, type SnackbarItemIconProps } from './SnackbarItemIcon'\n\nexport const Snackbar: typeof Root & {\n Item: typeof Item\n ItemAction: typeof ItemAction\n ItemClose: typeof ItemClose\n ItemIcon: typeof ItemIcon\n} = Object.assign(Root, {\n Item,\n ItemAction,\n ItemClose,\n ItemIcon,\n})\n\nSnackbar.displayName = 'Snackbar'\nItem.displayName = 'Snackbar.Item'\nItemAction.displayName = 'Snackbar.ItemAction'\nItemClose.displayName = 'Snackbar.ItemClose'\nItemIcon.displayName = 'Snackbar.ItemIcon'\n\nexport type {\n SnackbarProps,\n SnackbarItemProps,\n SnackbarItemActionProps,\n SnackbarItemCloseProps,\n SnackbarItemIconProps,\n AddSnackbarArgs,\n}\nexport { addSnackbar, clearSnackbarQueue }\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAiD,aAAAA,YAAW,UAAAC,eAAc;AAC1E,SAAS,oBAAoB;;;ACY7B,SAAS,aAAa,eAAe;AAErC,SAAS,4BAA4B;AAoE9B,SAAS,cAAiB,OAAqC;AACpE,MAAI,YAAY,YAAY,CAAC,OAAY,MAAM,UAAU,EAAE,GAAG,CAAC,KAAK,CAAC;AACrE,MAAI,cAAc,YAAY,MAAM,MAAM,eAAe,CAAC,KAAK,CA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Q,WAAW,KAAK,IAAI,SAAS,GAAI,IAAI;AAAA,IAClE;AAAA,EACF,CAAC;AACH;;;AajFO,IAAMG,YAKT,OAAO,OAAO,UAAM;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEDA,UAAS,cAAc;AACvB,aAAK,cAAc;AACnB,mBAAW,cAAc;AACzB,kBAAU,cAAc;AACxB,iBAAS,cAAc;","names":["useEffect","useRef","cloneElement","useRef","useCallback","useRef","cx","jsx","cx","cx","jsx","cx","jsx","useRef","useCallback","cva","jsx","useRef","cloneElement","useCallback","useSyncExternalStore","provider","jsx","useRef","useEffect","Snackbar"]}
|
|
1
|
+
{"version":3,"sources":["../../src/snackbar/Snackbar.tsx","../../src/snackbar/SnackbarRegion.tsx","../../src/snackbar/SnackbarItem.tsx","../../src/snackbar/SnackbarItem.styles.ts","../../src/snackbar/snackbarVariants.ts","../../src/snackbar/SnackbarItemAction.tsx","../../src/snackbar/SnackbarItemContext.tsx","../../src/snackbar/SnackbarItemClose.tsx","../../src/snackbar/SnackbarItemIcon.tsx","../../src/snackbar/useSwipe.ts","../../src/snackbar/SnackbarRegion.styles.ts","../../src/snackbar/useSnackbarGlobalStore.ts","../../src/snackbar/index.ts"],"sourcesContent":["import {\n type ToastOptions as SnackBarItemOptions,\n ToastQueue,\n useToastQueue,\n} from '@react-stately/toast'\nimport { type ReactElement, Ref, type RefObject, useEffect, useRef } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { type SnackbarItemValue } from './SnackbarItem'\nimport { SnackbarRegion, type SnackbarRegionProps } from './SnackbarRegion'\nimport { useSnackbarGlobalStore } from './useSnackbarGlobalStore'\n\n/**\n * We define here a global queue thanks to dedicated util from React Spectrum.\n * It is based on React `useSyncExternalStore` and allows us to consume data from\n * an external data store, and thus preventing use of React context that could\n * lead to unwanted rerenderings. It also simplifies initial implementation.\n */\nlet GLOBAL_SNACKBAR_QUEUE: ToastQueue<SnackbarItemValue> | null = null\n\nconst getGlobalSnackBarQueue = () => {\n if (!GLOBAL_SNACKBAR_QUEUE) {\n GLOBAL_SNACKBAR_QUEUE = new ToastQueue({\n maxVisibleToasts: 1,\n hasExitAnimation: true,\n })\n }\n\n return GLOBAL_SNACKBAR_QUEUE\n}\n\nexport const clearSnackbarQueue = () => {\n GLOBAL_SNACKBAR_QUEUE = null\n}\n\n/**\n * We define a global store to keep track of all providers instances, to ensure\n * we always have a single Snackbar container.\n */\nconst GLOBAL_SNACKBAR_STORE = {\n providers: new Set<RefObject<HTMLDivElement | null>>(),\n subscriptions: new Set<() => void>(),\n}\n\nexport type SnackbarProps = Omit<SnackbarRegionProps, 'state'> & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Snackbar = ({ ref: forwardedRef, ...props }: SnackbarProps): ReactElement | null => {\n const ref = useRef<HTMLDivElement>(null)\n\n const state = useToastQueue(getGlobalSnackBarQueue())\n\n const { provider, addProvider, deleteProvider } = useSnackbarGlobalStore(GLOBAL_SNACKBAR_STORE)\n\n useEffect(() => {\n addProvider(ref)\n\n return () => {\n for (const toast of getGlobalSnackBarQueue().visibleToasts) {\n toast.animation = undefined\n }\n\n deleteProvider(ref)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n return ref === provider && state.visibleToasts.length > 0\n ? createPortal(<SnackbarRegion ref={forwardedRef} state={state} {...props} />, document.body)\n : null\n}\n\nSnackbar.displayName = 'Snackbar'\n\nexport interface AddSnackbarArgs extends SnackbarItemValue, Omit<SnackBarItemOptions, 'timeout'> {\n /**\n * Handler that is called when the snackbar is closed, either by the user\n * or after a timeout.\n */\n onClose?: () => void\n /**\n * A timeout to automatically close the snackbar after, in milliseconds.\n * @default 5000\n */\n timeout?: number | null\n /**\n * The priority of the snackbar relative to other snackbars. Larger numbers indicate higher priority.\n */\n priority?: number\n}\n\nexport const addSnackbar = ({ onClose, timeout = 5000, priority, ...content }: AddSnackbarArgs) => {\n const queue = getGlobalSnackBarQueue()\n\n queue.add(content, {\n onClose,\n timeout: timeout && !content.onAction ? Math.max(timeout, 5000) : undefined,\n priority,\n })\n}\n","import { type AriaToastRegionProps, useToastRegion } from '@react-aria/toast'\nimport { cloneElement, type ComponentPropsWithRef, type ReactElement, useRef } from 'react'\n\nimport { SnackbarItem, type SnackbarItemProps } from './SnackbarItem'\nimport { SnackbarItemContext, type SnackbarItemState } from './SnackbarItemContext'\nimport { snackbarRegionVariant, type SnackbarRegionVariantProps } from './SnackbarRegion.styles'\n\nexport interface SnackbarRegionProps\n extends ComponentPropsWithRef<'div'>,\n AriaToastRegionProps,\n SnackbarRegionVariantProps,\n Pick<SnackbarItemState, 'state'> {\n /**\n * An accessibility label for the snackbar region.\n * @default 'Notifications'\n */\n 'aria-label'?: string\n /**\n * Identifies the element (or elements) that labels the current element.\n */\n 'aria-labelledby'?: string\n /**\n * Identifies the element (or elements) that describes the object.\n */\n 'aria-describedby'?: string\n /**\n * Identifies the element (or elements) that provide a detailed, extended description for the object.\n */\n 'aria-details'?: string\n /**\n * The component/template used to display each snackbar from the queue\n * @default 'Snackbar.Item'\n */\n children?: ReactElement<SnackbarItemProps, typeof SnackbarItem>\n}\n\nexport const SnackbarRegion = ({\n children = <SnackbarItem />,\n state,\n position = 'bottom',\n className,\n ref: forwardedRef,\n ...rest\n}: SnackbarRegionProps): ReactElement => {\n const innerRef = useRef<HTMLDivElement>(null)\n const ref = forwardedRef && typeof forwardedRef !== 'function' ? forwardedRef : innerRef\n\n const { regionProps } = useToastRegion(rest, state, ref)\n\n return (\n <div\n {...regionProps}\n ref={ref}\n data-position={position}\n className={snackbarRegionVariant({ position, className })}\n >\n {state.visibleToasts.map(toast => (\n <SnackbarItemContext.Provider key={toast.key} value={{ toast, state }}>\n {cloneElement(children, { key: toast.key })}\n </SnackbarItemContext.Provider>\n ))}\n </div>\n )\n}\n","/* eslint-disable max-lines-per-function */\n\nimport { useToast } from '@react-aria/toast'\nimport {\n Children,\n cloneElement,\n type ComponentPropsWithRef,\n type FC,\n isValidElement,\n type PropsWithChildren,\n type ReactElement,\n type ReactNode,\n useCallback,\n useRef,\n} from 'react'\n\nimport {\n snackbarItemVariant,\n snackbarItemVariantContent,\n type SnackbarItemVariantContentProps,\n type SnackbarItemVariantProps,\n} from './SnackbarItem.styles'\nimport { SnackbarItemAction, SnackbarItemActionProps } from './SnackbarItemAction'\nimport { SnackbarItemClose, SnackbarItemCloseProps } from './SnackbarItemClose'\nimport { useSnackbarItemContext } from './SnackbarItemContext'\nimport { SnackbarItemIcon, SnackbarItemIconProps } from './SnackbarItemIcon'\nimport { useSwipe } from './useSwipe'\n\nexport interface SnackbarItemValue extends SnackbarItemVariantProps {\n /**\n * Icon that will be prepended before snackbar message\n */\n icon?: ReactNode\n message: ReactNode\n /**\n * If `true` snackbar will display a close button\n * @default false\n */\n isClosable?: boolean\n /**\n * A label for the action button within the toast.\n */\n actionLabel?: string\n /**\n * Handler that is called when the action button is pressed.\n */\n onAction?: () => void\n /**\n * If `true` the action button will be displayed on a new line.\n * @default false\n */\n actionOnNewline?: boolean\n}\n\nexport interface SnackbarItemProps\n extends ComponentPropsWithRef<'div'>,\n SnackbarItemVariantProps,\n SnackbarItemVariantContentProps {\n /**\n * Defines a string value that labels the current element.\n */\n 'aria-label'?: string\n /**\n * Identifies the element (or elements) that labels the current element.\n */\n 'aria-labelledby'?: string\n /**\n * Identifies the element (or elements) that describes the object.\n */\n 'aria-describedby'?: string\n /**\n * Identifies the element (or elements) that provide a detailed, extended description for the object.\n */\n 'aria-details'?: string\n}\n\nexport const SnackbarItem = ({\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-details': ariaDetails,\n design: designProp,\n intent: intentProp,\n actionOnNewline: actionOnNewlineProp,\n className,\n children,\n ref: forwardedRef,\n ...rest\n}: PropsWithChildren<SnackbarItemProps>) => {\n const innerRef = useRef(null)\n const ref = typeof forwardedRef !== 'function' ? forwardedRef || innerRef : innerRef\n\n const { toast, state } = useSnackbarItemContext()\n\n const { state: swipeState, direction: swipeDirection } = useSwipe({\n swipeRef: ref,\n onSwipeStart: state.pauseAll,\n onSwipeCancel: state.resumeAll,\n onSwipeEnd: ({ direction }) => {\n ;['left', 'right'].includes(`${direction}`) && state.close(toast.key)\n },\n })\n\n const { message, icon, isClosable, onAction, actionLabel } = toast.content\n const intent = intentProp ?? toast.content.intent\n const design = designProp ?? toast.content.design\n const actionOnNewline = actionOnNewlineProp ?? toast.content.actionOnNewline\n\n const ariaProps = {\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n ariaDetails,\n }\n\n const { toastProps, titleProps, closeButtonProps, contentProps } = useToast(\n { toast, ...ariaProps },\n state,\n ref\n )\n\n const findElement = useCallback(\n <P extends object>(elementDisplayName: string): ReactElement<P> | undefined => {\n const childrenArray = Children.toArray(children)\n\n const match = childrenArray\n .filter(isValidElement)\n .find(\n (child): child is ReactElement<P> =>\n !!(child.type as FC<P> & { displayName?: string }).displayName?.includes(\n elementDisplayName\n )\n )\n\n return match as ReactElement<P> | undefined\n },\n [children]\n )\n\n const iconFromChildren = findElement<SnackbarItemIconProps>('Snackbar.ItemIcon')\n const actionBtnFromChildren = findElement<SnackbarItemActionProps>('Snackbar.ItemAction')\n const closeBtnFromChildren = findElement<SnackbarItemCloseProps>('Snackbar.ItemClose')\n\n return (\n <div\n data-spark-component=\"snackbar-item\"\n className={snackbarItemVariant({ design, intent, className })}\n data-animation={toast.animation}\n {...(!(swipeState === 'cancel' && toast.animation === 'exiting') && {\n 'data-swipe': swipeState,\n 'data-swipe-direction': swipeDirection,\n })}\n {...(toast.animation === 'exiting' && {\n // Remove snackbar when the exiting animation completes\n onAnimationEnd: () => state.remove(toast.key),\n })}\n ref={ref}\n {...toastProps}\n {...rest}\n >\n <div className={snackbarItemVariantContent({ actionOnNewline })} {...contentProps}>\n {/* 1. ICON */}\n {renderSubComponent(iconFromChildren, icon ? SnackbarItemIcon : null, {\n children: icon,\n })}\n\n {/* 2. MESSAGE */}\n <p\n className=\"px-md py-lg text-body-2 row-span-3\"\n style={{ gridArea: 'message' }}\n {...titleProps}\n >\n {message}\n </p>\n\n {/* 3. ACTION BUTTON */}\n {renderSubComponent(\n actionBtnFromChildren,\n actionLabel && onAction ? SnackbarItemAction : null,\n { intent, design, onClick: onAction, children: actionLabel }\n )}\n\n {/* 4. CLOSE BUTTON */}\n {renderSubComponent(closeBtnFromChildren, isClosable ? SnackbarItemClose : null, {\n intent,\n design,\n /**\n * React Spectrum typing of aria-label is inaccurate, and aria-label value should never be undefined.\n * See https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/i18n/src/useLocalizedStringFormatter.ts#L40\n */\n 'aria-label': closeButtonProps['aria-label'] as string,\n })}\n </div>\n </div>\n )\n}\n\nSnackbarItem.displayName = 'Snackbar.Item'\n\n/**\n * Returns compound item if found in children prop.\n * If not fallbacks to default item, conditionned by addSnackbar options.\n */\nconst renderSubComponent = <P extends object>(\n childItem?: ReactElement<P>,\n defaultItem?: FC<P> | null,\n props?: P\n) => {\n if (childItem) {\n return cloneElement(childItem, { ...props, ...childItem.props })\n } else if (defaultItem) {\n const Item = defaultItem\n\n return <Item {...(props as P)} />\n } else {\n return null\n }\n}\n","import { cva, VariantProps } from 'class-variance-authority'\n\nimport { filledVariants, tintedVariants } from './snackbarVariants'\n\nexport const snackbarItemVariant = cva(\n [\n 'rounded-md shadow-sm',\n 'max-w-[600px]',\n 'cursor-default pointer-events-auto touch-none select-none',\n 'absolute',\n /**\n * Focus\n */\n 'group-focus-visible:outline-hidden group-focus-visible:u-outline group-not-focus-visible:ring-inset',\n /**\n * Positionning\n */\n 'group-data-[position=bottom]:bottom-0 group-data-[position=bottom-left]:bottom-0 group-data-[position=bottom-right]:bottom-0',\n 'group-data-[position=top]:top-0 group-data-[position=top-left]:top-0 group-data-[position=top-right]:top-0',\n /**\n * Animation and opacity\n */\n '[animation-fill-mode: forwards]!',\n 'data-[animation=queued]:animate-fade-in',\n 'data-[animation=entering]:easing-decelerate-back',\n 'data-[animation=exiting]:easing-standard',\n // Parent position bottom|bottom-left|bottom-right\n 'data-[animation=entering]:group-data-[position=bottom]:[&:not([data-swipe])]:animate-slide-in-bottom',\n 'data-[animation=exiting]:opacity-0 data-[animation=exiting]:transition-opacity',\n 'data-[animation=exiting]:group-data-[position=bottom]:[&:not([data-swipe])]:animate-slide-out-bottom',\n 'data-[animation=entering]:group-data-[position=bottom-left]:[&:not([data-swipe])]:animate-slide-in-bottom',\n 'data-[animation=exiting]:group-data-[position=bottom-left]:[&:not([data-swipe])]:animate-slide-out-bottom',\n 'data-[animation=entering]:group-data-[position=bottom-right]:[&:not([data-swipe])]:animate-slide-in-bottom',\n 'data-[animation=exiting]:group-data-[position=bottom-right]:[&:not([data-swipe])]:animate-slide-out-bottom',\n // Parent position top|top-left|top-right\n 'data-[animation=entering]:group-data-[position=top]:[&:not([data-swipe])]:animate-slide-in-top',\n 'data-[animation=exiting]:group-data-[position=top]:[&:not([data-swipe])]:animate-slide-out-top',\n 'data-[animation=entering]:group-data-[position=top-left]:[&:not([data-swipe])]:animate-slide-in-top',\n 'data-[animation=exiting]:group-data-[position=top-left]:[&:not([data-swipe])]:animate-slide-out-top',\n 'data-[animation=entering]:group-data-[position=top-right]:[&:not([data-swipe])]:animate-slide-in-top',\n 'data-[animation=exiting]:group-data-[position=top-right]:[&:not([data-swipe])]:animate-slide-out-top',\n /**\n * Swipe\n */\n 'data-[swipe=move]:data-[swipe-direction=right]:translate-x-(--swipe-position-x)',\n 'data-[swipe=move]:data-[swipe-direction=left]:translate-x-(--swipe-position-x)',\n 'data-[swipe=cancel]:translate-x-0',\n 'data-[swipe=end]:data-[swipe-direction=right]:animate-standalone-swipe-out-right',\n 'data-[swipe=end]:data-[swipe-direction=left]:animate-standalone-swipe-out-left',\n ],\n {\n variants: {\n /**\n * Set different look and feel\n * @default 'filled'\n */\n design: {\n filled: '',\n tinted: '',\n },\n /**\n * Set color intent\n * @default 'neutral'\n */\n intent: {\n success: '',\n alert: '',\n error: '',\n info: '',\n neutral: '',\n main: '',\n basic: '',\n support: '',\n accent: '',\n inverse: '',\n },\n },\n compoundVariants: [...filledVariants, ...tintedVariants],\n defaultVariants: {\n design: 'filled',\n intent: 'neutral',\n },\n }\n)\n\nexport const snackbarItemVariantContent = cva(\n [\n 'inline-grid items-center',\n 'col-start-1 row-start-1',\n 'pl-md pr-lg', // applying padding on the parent prevents VoiceOver on Safari from reading snackbar content 🤷\n ],\n {\n variants: {\n /**\n * Force action button displaying on a new line\n * @default false\n */\n actionOnNewline: {\n true: [\n 'grid-rows-[52px_1fr_52px]',\n 'grid-cols-[min-content_1fr_min-content]',\n \"[grid-template-areas:'icon_message_close'_'._message_.'_'action_action_action']\",\n ],\n false: [\n 'grid-cols-[min-content_1fr_min-content_min-content]',\n \"[grid-template-areas:'icon_message_action_close']\",\n ],\n },\n },\n defaultVariants: {\n actionOnNewline: false,\n },\n }\n)\n\nexport type SnackbarItemVariantProps = VariantProps<typeof snackbarItemVariant>\nexport type SnackbarItemVariantContentProps = VariantProps<typeof snackbarItemVariantContent>\n","export const filledVariants = [\n {\n design: 'filled',\n intent: 'success',\n class: ['bg-success text-on-success'],\n },\n {\n design: 'filled',\n intent: 'alert',\n class: ['bg-alert text-on-alert'],\n },\n {\n design: 'filled',\n intent: 'error',\n class: ['bg-error text-on-error'],\n },\n {\n design: 'filled',\n intent: 'info',\n class: ['bg-info text-on-info'],\n },\n {\n design: 'filled',\n intent: 'neutral',\n class: ['bg-neutral text-on-neutral'],\n },\n {\n design: 'filled',\n intent: 'main',\n class: ['bg-main text-on-main'],\n },\n {\n design: 'filled',\n intent: 'basic',\n class: ['bg-basic text-on-basic'],\n },\n {\n design: 'filled',\n intent: 'support',\n class: ['bg-support text-on-support'],\n },\n {\n design: 'filled',\n intent: 'accent',\n class: ['bg-accent text-on-accent'],\n },\n {\n design: 'filled',\n intent: 'inverse',\n class: ['bg-surface-inverse text-on-surface-inverse'],\n },\n] as const\n\nexport const tintedVariants = [\n {\n design: 'tinted',\n intent: 'success',\n class: ['bg-success-container text-on-success-container'],\n },\n {\n design: 'tinted',\n intent: 'alert',\n class: ['bg-alert-container text-on-alert-container'],\n },\n {\n design: 'tinted',\n intent: 'error',\n class: ['bg-error-container text-on-error-container'],\n },\n {\n design: 'tinted',\n intent: 'info',\n class: ['bg-info-container text-on-info-container'],\n },\n {\n design: 'tinted',\n intent: 'neutral',\n class: ['bg-neutral-container text-on-neutral-container'],\n },\n {\n design: 'tinted',\n intent: 'main',\n class: ['bg-main-container text-on-main-container'],\n },\n {\n design: 'tinted',\n intent: 'basic',\n class: ['bg-basic-container text-on-basic-container'],\n },\n {\n design: 'tinted',\n intent: 'support',\n class: ['bg-support-container text-on-support-container'],\n },\n {\n design: 'tinted',\n intent: 'accent',\n class: ['bg-accent-container text-on-accent-container'],\n },\n {\n design: 'tinted',\n intent: 'inverse',\n class: ['bg-surface-inverse text-on-surface-inverse'],\n },\n] as const\n","import { cx } from 'class-variance-authority'\nimport { Ref } from 'react'\n\nimport { Button, type ButtonProps } from '../button'\nimport type { SnackbarItemVariantProps } from './SnackbarItem.styles'\nimport { useSnackbarItemContext } from './SnackbarItemContext'\n\nexport type SnackbarItemActionProps = Omit<ButtonProps, 'size' | 'shape' | 'intent'> &\n SnackbarItemVariantProps & {\n ref?: Ref<HTMLButtonElement>\n }\n\nexport const SnackbarItemAction = ({\n design: designProp = 'filled',\n intent: intentProp = 'neutral',\n onClick,\n children,\n className,\n ref,\n ...rest\n}: SnackbarItemActionProps) => {\n const { toast, state } = useSnackbarItemContext()\n\n const intent = intentProp ?? toast.content.intent\n const design = designProp ?? toast.content.design\n\n return (\n <Button\n data-spark-component=\"snackbar-item-action\"\n ref={ref}\n size=\"md\"\n shape=\"rounded\"\n {...(intent === 'inverse'\n ? {\n design: 'ghost',\n intent: 'surface',\n }\n : {\n design,\n intent: intent === 'error' ? 'danger' : intent,\n })}\n onClick={e => {\n onClick?.(e)\n state.close(toast.key)\n }}\n style={{ gridArea: 'action', ...rest.style }}\n className={cx('ml-md justify-self-end', className)}\n {...rest}\n >\n {children}\n </Button>\n )\n}\n\nSnackbarItemAction.displayName = 'Snackbar.ItemAction'\n","import { QueuedToast, ToastState } from '@react-stately/toast'\nimport { createContext, useContext } from 'react'\n\nimport type { SnackbarItemValue } from './SnackbarItem'\n\nexport interface SnackbarItemState<T = SnackbarItemValue> {\n toast: QueuedToast<T>\n state: ToastState<T>\n}\n\nexport const SnackbarItemContext = createContext<SnackbarItemState>({} as SnackbarItemState)\n\nexport const useSnackbarItemContext = () => useContext(SnackbarItemContext)\n","import { Close } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\nimport { type ComponentPropsWithRef } from 'react'\n\nimport { Icon } from '../icon'\nimport { IconButton, type IconButtonProps } from '../icon-button'\nimport type { SnackbarItemVariantProps } from './SnackbarItem.styles'\nimport { useSnackbarItemContext } from './SnackbarItemContext'\n\nexport interface SnackbarItemCloseProps\n extends Omit<ComponentPropsWithRef<'button'>, 'aria-label' | 'disabled'>,\n Pick<IconButtonProps, 'aria-label'>,\n SnackbarItemVariantProps {}\n\nexport const SnackbarItemClose = ({\n design: designProp = 'filled',\n intent: intentProp = 'neutral',\n 'aria-label': ariaLabel,\n onClick,\n className,\n ref,\n ...rest\n}: SnackbarItemCloseProps) => {\n const { toast, state } = useSnackbarItemContext()\n\n const intent = intentProp ?? toast.content.intent\n const design = designProp ?? toast.content.design\n\n return (\n <IconButton\n data-spark-component=\"snackbar-item-close\"\n ref={ref}\n size=\"md\"\n shape=\"rounded\"\n {...(intent === 'inverse'\n ? {\n design: 'ghost',\n intent: 'surface',\n }\n : {\n design,\n intent: intent === 'error' ? 'danger' : intent,\n })}\n aria-label={ariaLabel}\n onClick={e => {\n onClick?.(e)\n state.close(toast.key)\n }}\n style={{ gridArea: 'close', ...rest.style }}\n className={cx('ml-md justify-self-end', className)}\n {...rest}\n >\n <Icon size=\"sm\">\n <Close />\n </Icon>\n </IconButton>\n )\n}\n\nSnackbarItemClose.displayName = 'Snackbar.ItemClose'\n","import { cx } from 'class-variance-authority'\nimport type { ReactElement } from 'react'\n\nimport { Icon, type IconProps } from '../icon'\n\nexport type SnackbarItemIconProps = IconProps\n\nexport const SnackbarItemIcon = ({\n children,\n className,\n ...rest\n}: SnackbarItemIconProps): ReactElement => (\n <Icon\n size=\"md\"\n className={cx('mx-md', className)}\n style={{ gridArea: 'icon', ...rest.style }}\n {...rest}\n >\n {children}\n </Icon>\n)\n\nSnackbarItemIcon.displayName = 'Snackbar.ItemIcon'\n","/* eslint-disable complexity */\nimport { type RefObject, useEffect, useRef, useState } from 'react'\n\ninterface SwipeArgs<T> {\n swipeRef: RefObject<T | null>\n onSwipeStart?: ({ state, direction }: SwipeReturn) => void\n onSwipeMove?: ({ state, direction }: SwipeReturn) => void\n onSwipeCancel?: ({ state, direction }: SwipeReturn) => void\n onSwipeEnd?: ({ state, direction }: SwipeReturn) => void\n threshold?: number\n}\n\ninterface SwipeReturn {\n state?: 'start' | 'move' | 'cancel' | 'end'\n direction?: 'up' | 'down' | 'right' | 'left' | null\n}\n\nconst SWIPE_THRESHOLD = 75\n\nexport const useSwipe = <T extends HTMLElement>({\n swipeRef,\n onSwipeStart,\n onSwipeMove,\n onSwipeCancel,\n onSwipeEnd,\n threshold = 10,\n}: SwipeArgs<T>): SwipeReturn => {\n const [state, setState] = useState<SwipeReturn['state']>()\n\n const direction = useRef<SwipeReturn['direction']>(null)\n const origin = useRef<Record<'x' | 'y', number> | null>(null)\n const delta = useRef<Record<'x' | 'y', number> | null>(null)\n\n const handleSwipeStart = (evt: PointerEvent) => {\n origin.current = { x: evt.clientX, y: evt.clientY }\n\n /**\n * Prevents unwanted text selection in Safari browser (longpress)\n */\n document.addEventListener('selectstart', e => e.preventDefault())\n }\n\n const handleSwipeMove = (evt: PointerEvent) => {\n if (!origin.current) return\n\n const deltaX = Math.abs(evt.clientX - origin.current.x)\n const deltaY = Math.abs(evt.clientY - origin.current.y)\n\n let moveState: SwipeReturn['state']\n\n if (deltaX > deltaY && deltaX > threshold) {\n direction.current = evt.clientX > origin.current.x ? 'right' : 'left'\n } else if (deltaY > threshold) {\n direction.current = evt.clientY > origin.current.y ? 'down' : 'up'\n }\n\n /**\n * If no direction could be defined, then no move should be handled.\n * This is particularly true with trackpads working with MacOS/Windows.\n */\n if (!direction.current) return\n\n if (!delta.current) {\n moveState = 'start'\n delta.current = { x: deltaX, y: deltaY }\n onSwipeStart?.({ state: moveState, direction: direction.current })\n } else {\n moveState = 'move'\n delta.current = { x: deltaX, y: deltaY }\n ;(swipeRef.current as T).style.setProperty(\n '--swipe-position-x',\n `${deltaX > deltaY ? evt.clientX - origin.current.x : 0}px`\n )\n ;(swipeRef.current as T).style.setProperty(\n '--swipe-position-y',\n `${!(deltaX > deltaY) ? evt.clientY - origin.current.y : 0}px`\n )\n onSwipeMove?.({ state: moveState, direction: direction.current })\n }\n\n setState(moveState)\n }\n\n const handleSwipeEnd = () => {\n const proxyDelta = delta.current\n\n origin.current = null\n delta.current = null\n\n if (proxyDelta) {\n const { x: deltaX, y: deltaY } = proxyDelta\n\n let endState: SwipeReturn['state']\n\n if (deltaX > deltaY) {\n if (deltaX > SWIPE_THRESHOLD) {\n endState = 'end'\n onSwipeEnd?.({ state: endState, direction: direction.current })\n } else {\n endState = 'cancel'\n onSwipeCancel?.({ state: endState, direction: direction.current })\n }\n } else {\n if (deltaY > SWIPE_THRESHOLD) {\n endState = 'end'\n onSwipeEnd?.({ state: endState, direction: direction.current })\n } else {\n endState = 'cancel'\n onSwipeCancel?.({ state: endState, direction: direction.current })\n }\n }\n\n setState(endState)\n\n /**\n * Prevents unwanted text selection in Safari browser (longpress)\n */\n document.removeEventListener('selectstart', e => e.preventDefault())\n }\n }\n\n useEffect(() => {\n if (!swipeRef.current) return\n\n const swipeElement = swipeRef.current\n\n swipeElement.addEventListener('pointerdown', handleSwipeStart)\n document.addEventListener('pointermove', handleSwipeMove)\n document.addEventListener('pointerup', handleSwipeEnd)\n\n return () => {\n swipeElement.removeEventListener('pointerdown', handleSwipeStart)\n document.removeEventListener('pointermove', handleSwipeMove)\n document.removeEventListener('pointerup', handleSwipeEnd)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n return {\n state,\n direction: direction.current,\n }\n}\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const snackbarRegionVariant = cva(\n [\n 'fixed inset-x-lg z-toast group',\n 'outline-hidden pointer-events-none',\n 'grid grid-rows-1 grid-cols-1 gap-lg',\n ],\n {\n variants: {\n /**\n * Set snackbar item position\n * @default 'bottom'\n */\n position: {\n top: 'top-lg justify-items-center',\n 'top-right': 'top-lg justify-items-end',\n 'top-left': 'top-lg justify-items-start',\n bottom: 'bottom-lg justify-items-center',\n 'bottom-right': 'bottom-lg justify-items-end',\n 'bottom-left': 'bottom-lg justify-items-start',\n },\n },\n defaultVariants: {\n position: 'bottom',\n },\n }\n)\n\nexport type SnackbarRegionVariantProps = VariantProps<typeof snackbarRegionVariant>\n","import { type RefObject, useCallback, useSyncExternalStore } from 'react'\n\ninterface UseSnackbarGlobalStoreArgs<T> {\n providers: Set<T>\n subscriptions: Set<() => void>\n}\n\ninterface UseSnackbarGlobalStoreReturn<T> {\n provider: T\n addProvider: (ref: T) => void\n deleteProvider: (ref: T) => void\n}\n\n/**\n * This hook is a basic abstraction of useSyncExternalStore hook which allows us\n * to consume data from an external data store.\n *\n * Cf. https://react.dev/reference/react/useSyncExternalStore#subscribing-to-an-external-store\n */\n\nexport const useSnackbarGlobalStore = <T = RefObject<HTMLDivElement | null>>({\n providers,\n subscriptions,\n}: UseSnackbarGlobalStoreArgs<T>): UseSnackbarGlobalStoreReturn<T> => {\n const subscribe = useCallback(\n (listener: () => void) => {\n subscriptions.add(listener)\n\n return () => subscriptions.delete(listener)\n },\n [subscriptions]\n )\n\n const getLastSnackbarProvider = useCallback(() => [...providers].reverse()[0] as T, [providers])\n\n const addProvider = useCallback(\n (provider: T) => {\n providers.add(provider)\n\n for (const subscribeFn of subscriptions) {\n subscribeFn()\n }\n },\n [providers, subscriptions]\n )\n\n const deleteProvider = useCallback(\n (provider: T) => {\n providers.delete(provider)\n\n for (const subscribeFn of subscriptions) {\n subscribeFn()\n }\n },\n [providers, subscriptions]\n )\n\n const provider = useSyncExternalStore(subscribe, getLastSnackbarProvider, getLastSnackbarProvider)\n\n return {\n provider,\n addProvider,\n deleteProvider,\n }\n}\n","import {\n addSnackbar,\n type AddSnackbarArgs,\n clearSnackbarQueue,\n Snackbar as Root,\n type SnackbarProps,\n} from './Snackbar'\nimport { SnackbarItem as Item, type SnackbarItemProps } from './SnackbarItem'\nimport {\n SnackbarItemAction as ItemAction,\n type SnackbarItemActionProps,\n} from './SnackbarItemAction'\nimport { SnackbarItemClose as ItemClose, type SnackbarItemCloseProps } from './SnackbarItemClose'\nimport { SnackbarItemIcon as ItemIcon, type SnackbarItemIconProps } from './SnackbarItemIcon'\n\nexport const Snackbar: typeof Root & {\n Item: typeof Item\n ItemAction: typeof ItemAction\n ItemClose: typeof ItemClose\n ItemIcon: typeof ItemIcon\n} = Object.assign(Root, {\n Item,\n ItemAction,\n ItemClose,\n ItemIcon,\n})\n\nSnackbar.displayName = 'Snackbar'\nItem.displayName = 'Snackbar.Item'\nItemAction.displayName = 'Snackbar.ItemAction'\nItemClose.displayName = 'Snackbar.ItemClose'\nItemIcon.displayName = 'Snackbar.ItemIcon'\n\nexport type {\n SnackbarProps,\n SnackbarItemProps,\n SnackbarItemActionProps,\n SnackbarItemCloseProps,\n SnackbarItemIconProps,\n AddSnackbarArgs,\n}\nexport { addSnackbar, clearSnackbarQueue }\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AACP,SAAiD,aAAAA,YAAW,UAAAC,eAAc;AAC1E,SAAS,oBAAoB;;;ACN7B,SAAoC,sBAAsB;AAC1D,SAAS,gBAAAC,eAA6D,UAAAC,eAAc;;;ACCpF,SAAS,gBAAgB;AACzB;AAAA,EACE;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,QAAM,IAAI,SAAS;AAAA,IACjB;AAAA,IACA,SAAS,WAAW,CAAC,QAAQ,WAAW,KAAK,IAAI,SAAS,GAAI,IAAI;AAAA,IAClE;AAAA,EACF,CAAC;AACH;;;AYrFO,IAAMG,YAKT,OAAO,OAAO,UAAM;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEDA,UAAS,cAAc;AACvB,aAAK,cAAc;AACnB,mBAAW,cAAc;AACzB,kBAAU,cAAc;AACxB,iBAAS,cAAc;","names":["useEffect","useRef","cloneElement","useRef","useRef","cx","jsx","cx","cx","jsx","cx","jsx","useRef","cva","jsx","useRef","cloneElement","useCallback","provider","jsx","useRef","useEffect","Snackbar"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spark-ui/components",
|
|
3
|
-
"version": "10.11.
|
|
3
|
+
"version": "10.11.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Spark (Leboncoin design system) components.",
|
|
6
6
|
"exports": {
|
|
@@ -49,18 +49,17 @@
|
|
|
49
49
|
"@react-aria/numberfield": "3.11.13",
|
|
50
50
|
"@react-aria/toast": "^3.0.0-beta.18",
|
|
51
51
|
"@react-stately/numberfield": "3.9.11",
|
|
52
|
-
"@
|
|
53
|
-
"@spark-ui/
|
|
54
|
-
"@spark-ui/
|
|
55
|
-
"@
|
|
52
|
+
"@react-stately/toast": "^3.0.0-beta.7",
|
|
53
|
+
"@spark-ui/hooks": "^10.11.3",
|
|
54
|
+
"@spark-ui/icons": "^10.11.3",
|
|
55
|
+
"@spark-ui/internal-utils": "^10.11.3",
|
|
56
56
|
"@zag-js/pagination": "1.14.0",
|
|
57
57
|
"@zag-js/react": "1.14.0",
|
|
58
58
|
"class-variance-authority": "0.7.1",
|
|
59
59
|
"downshift": "9.0.9",
|
|
60
60
|
"emulate-tab": "^1.2.1",
|
|
61
61
|
"radix-ui": "1.4.2",
|
|
62
|
-
"react-snap-carousel": "^0.5.1"
|
|
63
|
-
"use-sync-external-store": "^1.2.0"
|
|
62
|
+
"react-snap-carousel": "^0.5.1"
|
|
64
63
|
},
|
|
65
64
|
"peerDependencies": {
|
|
66
65
|
"@spark-ui/theme-utils": "latest",
|
|
@@ -69,7 +68,6 @@
|
|
|
69
68
|
"tailwindcss": "^4.0.0"
|
|
70
69
|
},
|
|
71
70
|
"devDependencies": {
|
|
72
|
-
"@types/use-sync-external-store": "^0.0.3",
|
|
73
71
|
"jsdom-testing-mocks": "1.13.1"
|
|
74
72
|
},
|
|
75
73
|
"repository": {
|
|
@@ -81,5 +79,5 @@
|
|
|
81
79
|
"url": "https://github.com/leboncoin/spark-web/issues?q=is%3Aopen+label%3A%22Component%3A+button%22"
|
|
82
80
|
},
|
|
83
81
|
"homepage": "https://sparkui.vercel.app",
|
|
84
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "b3e00eefa9f2a0d52ad8c70fdaa71590e4f213f3"
|
|
85
83
|
}
|