@douglasneuroinformatics/libui 4.5.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/dist/{chunk-SGSRBDMT.js → chunk-LEIF262P.js} +40 -10
- package/dist/chunk-LEIF262P.js.map +1 -0
- package/dist/chunk-X2FQXQHP.js +325 -0
- package/dist/chunk-X2FQXQHP.js.map +1 -0
- package/dist/components.d.ts +8 -8
- package/dist/components.js +836 -1137
- package/dist/components.js.map +1 -1
- package/dist/hooks.d.ts +6 -2
- package/dist/hooks.js +3 -1
- package/dist/i18n.d.ts +2 -2
- package/dist/providers.d.ts +5 -0
- package/dist/providers.js +73 -0
- package/dist/providers.js.map +1 -0
- package/dist/{types-CxoDu4Em.d.ts → types-CwW4nA_v.d.ts} +7 -5
- package/package.json +5 -1
- package/src/components/OneTimePasswordInput/OneTimePasswordInput.stories.tsx +4 -4
- package/src/components/index.ts +2 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useDestructiveAction/index.ts +1 -0
- package/src/hooks/useDestructiveAction/useDestructiveAction.ts +12 -0
- package/src/hooks/useDestructiveAction/useDestructiveActionStore.test.ts +79 -0
- package/src/hooks/useDestructiveAction/useDestructiveActionStore.ts +25 -0
- package/src/i18n/types.ts +7 -8
- package/src/providers/CoreProvider/CoreProvider.stories.tsx +44 -0
- package/src/providers/CoreProvider/CoreProvider.tsx +12 -0
- package/src/providers/CoreProvider/DestructiveActionDialog.tsx +65 -0
- package/src/{components/NotificationHub → providers/CoreProvider}/NotificationHub.tsx +1 -1
- package/src/providers/CoreProvider/index.ts +1 -0
- package/src/providers/index.ts +1 -0
- package/dist/chunk-SGSRBDMT.js.map +0 -1
- package/src/components/NotificationHub/NotificationHub.stories.tsx +0 -40
- package/src/components/NotificationHub/index.ts +0 -1
- /package/src/{components/NotificationHub → providers/CoreProvider}/NotificationIcon.tsx +0 -0
package/README.md
CHANGED
|
@@ -43,7 +43,5 @@ We welcome contributions! If you're interested in improving the library or addin
|
|
|
43
43
|
|
|
44
44
|
## License
|
|
45
45
|
|
|
46
|
-
Copyright (C) 2024 Douglas Neuroinformatics Platform
|
|
47
|
-
|
|
48
46
|
This program is free software: you can redistribute it and/or modify
|
|
49
47
|
it under the terms of the Apache License 2.0.
|
|
@@ -22,12 +22,40 @@ function useChart() {
|
|
|
22
22
|
return context;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
// src/hooks/useDestructiveAction/useDestructiveAction.ts
|
|
26
|
+
import { useCallback } from "react";
|
|
27
|
+
|
|
28
|
+
// src/hooks/useDestructiveAction/useDestructiveActionStore.ts
|
|
29
|
+
import { create } from "zustand";
|
|
30
|
+
var useDestructiveActionStore = create((set) => ({
|
|
31
|
+
addPendingDestructiveAction: (action) => {
|
|
32
|
+
set((state) => ({
|
|
33
|
+
pendingDestructiveActions: [...state.pendingDestructiveActions, action]
|
|
34
|
+
}));
|
|
35
|
+
},
|
|
36
|
+
deletePendingDestructiveAction: (action) => {
|
|
37
|
+
set((state) => ({
|
|
38
|
+
...state,
|
|
39
|
+
pendingDestructiveActions: state.pendingDestructiveActions.filter((_action) => _action !== action)
|
|
40
|
+
}));
|
|
41
|
+
},
|
|
42
|
+
pendingDestructiveActions: []
|
|
43
|
+
}));
|
|
44
|
+
|
|
45
|
+
// src/hooks/useDestructiveAction/useDestructiveAction.ts
|
|
46
|
+
function useDestructiveAction(destructiveAction) {
|
|
47
|
+
const addPendingDestructiveAction = useDestructiveActionStore((store) => store.addPendingDestructiveAction);
|
|
48
|
+
return useCallback(() => {
|
|
49
|
+
addPendingDestructiveAction(destructiveAction);
|
|
50
|
+
}, [destructiveAction, addPendingDestructiveAction]);
|
|
51
|
+
}
|
|
52
|
+
|
|
25
53
|
// src/hooks/useDownload/useDownload.ts
|
|
26
54
|
import { useEffect, useState } from "react";
|
|
27
55
|
|
|
28
56
|
// src/hooks/useNotificationsStore/useNotificationsStore.ts
|
|
29
|
-
import { create } from "zustand";
|
|
30
|
-
var useNotificationsStore =
|
|
57
|
+
import { create as create2 } from "zustand";
|
|
58
|
+
var useNotificationsStore = create2((set) => ({
|
|
31
59
|
addNotification: (notification) => {
|
|
32
60
|
set((state) => ({
|
|
33
61
|
notifications: [...state.notifications, { id: Date.now(), ...notification }]
|
|
@@ -82,7 +110,7 @@ function useDownload() {
|
|
|
82
110
|
}
|
|
83
111
|
|
|
84
112
|
// src/hooks/useEventCallback/useEventCallback.ts
|
|
85
|
-
import { useCallback, useRef } from "react";
|
|
113
|
+
import { useCallback as useCallback2, useRef } from "react";
|
|
86
114
|
|
|
87
115
|
// src/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.ts
|
|
88
116
|
import { useEffect as useEffect2, useLayoutEffect } from "react";
|
|
@@ -96,7 +124,7 @@ function useEventCallback(fn) {
|
|
|
96
124
|
useIsomorphicLayoutEffect(() => {
|
|
97
125
|
ref.current = fn;
|
|
98
126
|
}, [fn]);
|
|
99
|
-
return
|
|
127
|
+
return useCallback2((...args) => ref.current(...args), [ref]);
|
|
100
128
|
}
|
|
101
129
|
|
|
102
130
|
// src/hooks/useEventListener/useEventListener.ts
|
|
@@ -169,11 +197,11 @@ function useOnClickOutside(ref, handler, mouseEvent = "mousedown") {
|
|
|
169
197
|
}
|
|
170
198
|
|
|
171
199
|
// src/hooks/useStorage/useStorage.ts
|
|
172
|
-
import { useCallback as
|
|
200
|
+
import { useCallback as useCallback3, useEffect as useEffect6, useState as useState3 } from "react";
|
|
173
201
|
function useStorage(key, initialValue, storageName, options = {}) {
|
|
174
202
|
const { initializeWithValue = true } = options;
|
|
175
203
|
const storage = window[storageName];
|
|
176
|
-
const serializer =
|
|
204
|
+
const serializer = useCallback3(
|
|
177
205
|
(value) => {
|
|
178
206
|
if (options.serializer) {
|
|
179
207
|
return options.serializer(value);
|
|
@@ -182,7 +210,7 @@ function useStorage(key, initialValue, storageName, options = {}) {
|
|
|
182
210
|
},
|
|
183
211
|
[options]
|
|
184
212
|
);
|
|
185
|
-
const deserializer =
|
|
213
|
+
const deserializer = useCallback3(
|
|
186
214
|
(value) => {
|
|
187
215
|
if (options.deserializer) {
|
|
188
216
|
return options.deserializer(value);
|
|
@@ -201,7 +229,7 @@ function useStorage(key, initialValue, storageName, options = {}) {
|
|
|
201
229
|
},
|
|
202
230
|
[options, initialValue]
|
|
203
231
|
);
|
|
204
|
-
const readValue =
|
|
232
|
+
const readValue = useCallback3(() => {
|
|
205
233
|
const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;
|
|
206
234
|
if (!isBrowser()) {
|
|
207
235
|
return initialValueToUse;
|
|
@@ -231,7 +259,7 @@ function useStorage(key, initialValue, storageName, options = {}) {
|
|
|
231
259
|
useEffect6(() => {
|
|
232
260
|
setStoredValue(readValue());
|
|
233
261
|
}, [key]);
|
|
234
|
-
const handleStorageChange =
|
|
262
|
+
const handleStorageChange = useCallback3(
|
|
235
263
|
(event) => {
|
|
236
264
|
if (event.key && event.key !== key) {
|
|
237
265
|
return;
|
|
@@ -353,6 +381,8 @@ function useWindowSize() {
|
|
|
353
381
|
export {
|
|
354
382
|
ChartContext,
|
|
355
383
|
useChart,
|
|
384
|
+
useDestructiveActionStore,
|
|
385
|
+
useDestructiveAction,
|
|
356
386
|
useNotificationsStore,
|
|
357
387
|
useDownload,
|
|
358
388
|
useIsomorphicLayoutEffect,
|
|
@@ -372,4 +402,4 @@ export {
|
|
|
372
402
|
useTranslation,
|
|
373
403
|
useWindowSize
|
|
374
404
|
};
|
|
375
|
-
//# sourceMappingURL=chunk-
|
|
405
|
+
//# sourceMappingURL=chunk-LEIF262P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/useChart/useChart.ts","../src/context/ChartContext.tsx","../src/hooks/useDestructiveAction/useDestructiveAction.ts","../src/hooks/useDestructiveAction/useDestructiveActionStore.ts","../src/hooks/useDownload/useDownload.ts","../src/hooks/useNotificationsStore/useNotificationsStore.ts","../src/hooks/useEventCallback/useEventCallback.ts","../src/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.ts","../src/hooks/useEventListener/useEventListener.ts","../src/hooks/useInterval/useInterval.ts","../src/hooks/useMediaQuery/useMediaQuery.ts","../src/hooks/useOnClickOutside/useOnClickOutside.ts","../src/hooks/useStorage/useStorage.ts","../src/hooks/useStorage/useLocalStorage.ts","../src/hooks/useStorage/useSessionStorage.ts","../src/hooks/useTheme/useTheme.ts","../src/hooks/useTranslation/useTranslation.ts","../src/hooks/useWindowSize/useWindowSize.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { ChartContext } from '@/context/ChartContext';\n\nexport function useChart() {\n const context = useContext(ChartContext);\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n return context;\n}\n","import { createContext } from 'react';\n\nimport type { ChartConfig } from '@/components';\n\ntype ChartContextProps = {\n config: ChartConfig;\n};\n\nexport const ChartContext = createContext<ChartContextProps | null>(null);\n","import { useCallback } from 'react';\n\nimport { useDestructiveActionStore } from './useDestructiveActionStore';\n\nimport type { DestructiveAction } from './useDestructiveActionStore';\n\nexport function useDestructiveAction(destructiveAction: DestructiveAction) {\n const addPendingDestructiveAction = useDestructiveActionStore((store) => store.addPendingDestructiveAction);\n return useCallback(() => {\n addPendingDestructiveAction(destructiveAction);\n }, [destructiveAction, addPendingDestructiveAction]);\n}\n","import type { Promisable } from 'type-fest';\nimport { create } from 'zustand';\n\nexport type DestructiveAction = () => Promisable<void>;\n\nexport type DestructiveActionStore = {\n addPendingDestructiveAction: (action: DestructiveAction) => void;\n deletePendingDestructiveAction: (action: DestructiveAction) => void;\n pendingDestructiveActions: DestructiveAction[];\n};\n\nexport const useDestructiveActionStore = create<DestructiveActionStore>((set) => ({\n addPendingDestructiveAction: (action) => {\n set((state) => ({\n pendingDestructiveActions: [...state.pendingDestructiveActions, action]\n }));\n },\n deletePendingDestructiveAction: (action) => {\n set((state) => ({\n ...state,\n pendingDestructiveActions: state.pendingDestructiveActions.filter((_action) => _action !== action)\n }));\n },\n pendingDestructiveActions: []\n}));\n","import { useEffect, useState } from 'react';\n\nimport type { Promisable } from 'type-fest';\n\nimport { useNotificationsStore } from '../useNotificationsStore';\n\ntype DownloadTextOptions = {\n blobType: 'text/csv' | 'text/plain';\n};\n\ntype DownloadBlobOptions = {\n blobType: 'application/zip' | 'image/jpeg' | 'image/png' | 'image/webp';\n};\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\ninterface DownloadFunction {\n (filename: string, data: Blob, options: DownloadBlobOptions): Promise<void>;\n (filename: string, data: () => Promisable<Blob>, options: DownloadBlobOptions): Promise<void>;\n (filename: string, data: string, options?: DownloadTextOptions): Promise<void>;\n (filename: string, data: () => Promisable<string>, options?: DownloadTextOptions): Promise<void>;\n}\n\ntype Downloadable = {\n blobType: string;\n data: Blob | string;\n filename: string;\n id: string;\n};\n\n/**\n * Used to trigger downloads of arbitrary data to the client\n * @returns A function to invoke the download\n */\nexport function useDownload(): DownloadFunction {\n const notifications = useNotificationsStore();\n const [downloads, setDownloads] = useState<Downloadable[]>([]);\n\n useEffect(() => {\n if (downloads.length) {\n const { blobType, data, filename, id } = downloads.at(-1)!;\n const anchor = document.createElement('a');\n document.body.appendChild(anchor);\n const blob = new Blob([data], { type: blobType });\n const url = URL.createObjectURL(blob);\n anchor.href = url;\n anchor.download = filename;\n anchor.click();\n URL.revokeObjectURL(url);\n anchor.remove();\n setDownloads((prevDownloads) => prevDownloads.filter((item) => item.id !== id));\n }\n }, [downloads]);\n\n return async (filename, _data, options) => {\n try {\n const data = typeof _data === 'function' ? await _data() : _data;\n if (typeof data !== 'string' && !options?.blobType) {\n throw new Error(\"argument 'blobType' must be defined when download is called with a Blob object\");\n }\n setDownloads((prevDownloads) => [\n ...prevDownloads,\n { blobType: options?.blobType ?? 'text/plain', data, filename, id: crypto.randomUUID() }\n ]);\n } catch (error) {\n const message = error instanceof Error ? error.message : 'An unknown error occurred';\n notifications.addNotification({\n message,\n title: 'Error',\n type: 'error'\n });\n }\n };\n}\n","import { create } from 'zustand';\n\nexport type NotificationInterface = {\n id: number;\n message?: string;\n title?: string;\n type: 'error' | 'info' | 'success' | 'warning';\n variant?: 'critical' | 'standard';\n};\n\nexport type NotificationsStore = {\n addNotification: (notification: Omit<NotificationInterface, 'id'>) => void;\n dismissNotification: (id: number) => void;\n notifications: NotificationInterface[];\n};\n\nexport const useNotificationsStore = create<NotificationsStore>((set) => ({\n addNotification: (notification) => {\n set((state) => ({\n notifications: [...state.notifications, { id: Date.now(), ...notification }]\n }));\n },\n dismissNotification: (id) => {\n set((state) => ({\n notifications: state.notifications.filter((notification) => notification.id !== id)\n }));\n },\n notifications: []\n}));\n","import { useCallback, useRef } from 'react';\n\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect';\n\nexport function useEventCallback<Args extends unknown[], R>(fn: (...args: Args) => R) {\n const ref = useRef<typeof fn>(() => {\n throw new Error('Cannot call an event handler while rendering.');\n });\n\n useIsomorphicLayoutEffect(() => {\n ref.current = fn;\n }, [fn]);\n\n return useCallback((...args: Args) => ref.current(...args), [ref]);\n}\n","import { useEffect, useLayoutEffect } from 'react';\n\nimport { isBrowser } from '@/utils';\n\nexport const useIsomorphicLayoutEffect = isBrowser() ? useLayoutEffect : useEffect;\n","import { useEffect, useRef } from 'react';\nimport type { RefObject } from 'react';\n\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect';\n\n// MediaQueryList Event based useEventListener interface\nfunction useEventListener<K extends keyof MediaQueryListEventMap>(\n eventName: K,\n handler: (event: MediaQueryListEventMap[K]) => void,\n element: RefObject<MediaQueryList>,\n options?: AddEventListenerOptions | boolean\n): void;\n\n// Window Event based useEventListener interface\nfunction useEventListener<K extends keyof WindowEventMap>(\n eventName: K,\n handler: (event: WindowEventMap[K]) => void,\n element?: undefined,\n options?: AddEventListenerOptions | boolean\n): void;\n\n// Element Event based useEventListener interface\nfunction useEventListener<K extends keyof HTMLElementEventMap, T extends HTMLElement = HTMLDivElement>(\n eventName: K,\n handler: (event: HTMLElementEventMap[K]) => void,\n element: RefObject<T>,\n options?: AddEventListenerOptions | boolean\n): void;\n\n// Document Event based useEventListener interface\nfunction useEventListener<K extends keyof DocumentEventMap>(\n eventName: K,\n handler: (event: DocumentEventMap[K]) => void,\n element: RefObject<Document>,\n options?: AddEventListenerOptions | boolean\n): void;\n\nfunction useEventListener<\n KW extends keyof WindowEventMap,\n KH extends keyof HTMLElementEventMap,\n KM extends keyof MediaQueryListEventMap,\n T extends HTMLElement | MediaQueryList | void = void\n>(\n eventName: KH | KM | KW,\n handler: (event: Event | HTMLElementEventMap[KH] | MediaQueryListEventMap[KM] | WindowEventMap[KW]) => void,\n element?: RefObject<T>,\n options?: AddEventListenerOptions | boolean\n) {\n // Create a ref that stores handler\n const savedHandler = useRef(handler);\n\n useIsomorphicLayoutEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n\n useEffect(() => {\n // Define the listening target\n const targetElement: T | Window = element?.current ?? window;\n\n if (!(targetElement && targetElement.addEventListener)) return;\n\n // Create event listener that calls handler function stored in ref\n const listener: typeof handler = (event) => savedHandler.current(event);\n\n targetElement.addEventListener(eventName, listener, options);\n\n // Remove event listener on cleanup\n return () => {\n targetElement.removeEventListener(eventName, listener, options);\n };\n }, [eventName, element, options]);\n}\n\nexport { useEventListener };\n","import { useEffect, useRef } from 'react';\n\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect';\n\nexport function useInterval(callback: () => void, delay: null | number) {\n const savedCallback = useRef(callback);\n\n // Remember the latest callback if it changes.\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n\n // Set up the interval.\n useEffect(() => {\n // Don't schedule if no delay is specified.\n // Note: 0 is a valid value for delay.\n if (!delay && delay !== 0) {\n return;\n }\n\n const id = setInterval(() => savedCallback.current(), delay);\n\n return () => clearInterval(id);\n }, [delay]);\n}\n","import { useEffect, useState } from 'react';\n\nimport { isBrowser } from '@/utils';\n\n/**\n * Get the result of an arbitrary CSS media query\n *\n * @param query - the CSS media query\n * @returns a boolean indicating the result of the query\n * @example\n * // true if the viewport is at least 768px wide\n * const matches = useMediaQuery('(min-width: 768px)')\n */\nexport function useMediaQuery(query: string): boolean {\n const getMatches = (query: string): boolean => {\n // Prevents SSR issues\n if (isBrowser()) {\n return window.matchMedia(query).matches;\n }\n return false;\n };\n\n const [matches, setMatches] = useState<boolean>(getMatches(query));\n\n function handleChange() {\n setMatches(getMatches(query));\n }\n\n useEffect(() => {\n const matchMedia = window.matchMedia(query);\n\n // Triggered at the first client-side load and if query changes\n handleChange();\n\n matchMedia.addEventListener('change', handleChange);\n\n return () => {\n matchMedia.removeEventListener('change', handleChange);\n };\n }, [query]);\n\n return matches;\n}\n","import type { RefObject } from 'react';\n\nimport { useEventListener } from '../useEventListener';\n\ntype Handler = (event: MouseEvent) => void;\n\nexport function useOnClickOutside<T extends HTMLElement | null = HTMLElement>(\n ref: RefObject<T>,\n handler: Handler,\n mouseEvent: 'mousedown' | 'mouseup' = 'mousedown'\n): void {\n useEventListener(mouseEvent, (event) => {\n const el = ref.current;\n\n // Do nothing if clicking ref's element or descendent elements\n if (!el || el.contains(event.target as Node)) {\n return;\n }\n\n handler(event);\n });\n}\n","import { useCallback, useEffect, useState } from 'react';\nimport type { Dispatch, SetStateAction } from 'react';\n\nimport { isBrowser } from '@/utils';\n\nimport { useEventCallback } from '../useEventCallback';\nimport { useEventListener } from '../useEventListener';\n\ntype StorageName = 'localStorage' | 'sessionStorage';\n\ntype StorageEventMap = {\n [K in StorageName]: CustomEvent;\n};\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/consistent-type-definitions, @typescript-eslint/no-empty-object-type\n interface WindowEventMap extends StorageEventMap {}\n}\n\n/**\n * Represents the options for customizing the behavior of serialization and deserialization.\n * @template T - The type of the state to be stored in storage.\n */\ntype UseStorageOptions<T> = {\n /** A function to deserialize the stored value. */\n deserializer?: (value: string) => T;\n /**\n * If `true` (default), the hook will initialize reading the storage. In SSR, you should set it to `false`, returning the initial value initially.\n * @default true\n */\n initializeWithValue?: boolean;\n /** A function to serialize the value before storing it. */\n serializer?: (value: T) => string;\n};\n\n/**\n * Custom hook that uses local or session storage to persist state across page reloads.\n * @template T - The type of the state to be stored in storage.\n * @param key - The key under which the value will be stored in storage.\n * @param initialValue - The initial value of the state or a function that returns the initial value.\n * @param options - Options for customizing the behavior of serialization and deserialization (optional).\n * @returns A tuple containing the stored value and a function to set the value.\n * @public\n * @example\n * ```tsx\n * const [count, setCount] = useStorage('count', 0);\n * // Access the `count` value and the `setCount` function to update it.\n * ```\n */\nexport function useStorage<T>(\n key: string,\n initialValue: (() => T) | T,\n storageName: StorageName,\n options: UseStorageOptions<T> = {}\n): [T, Dispatch<SetStateAction<T>>] {\n const { initializeWithValue = true } = options;\n const storage = window[storageName];\n\n const serializer = useCallback<(value: T) => string>(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n\n const deserializer = useCallback<(value: string) => T>(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n } else if (value === 'undefined') {\n return undefined as unknown as T;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed: unknown;\n try {\n parsed = JSON.parse(value);\n } catch (err) {\n console.error(`Error parsing JSON: ${(err as Error).message}`);\n return defaultValue;\n }\n return parsed as T;\n },\n [options, initialValue]\n );\n\n const readValue = useCallback((): T => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (!isBrowser()) {\n return initialValueToUse;\n }\n const raw = storage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n }, [initialValue, key, deserializer]);\n\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n\n const setValue: Dispatch<SetStateAction<T>> = useEventCallback((value) => {\n if (!isBrowser()) {\n console.warn(`Tried setting storage key “${key}” even though environment is not a client`);\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n storage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(storageName, { key }));\n } catch (error) {\n console.warn(`Error setting storage key “${key}”:`, error);\n }\n });\n\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n\n const handleStorageChange = useCallback(\n (event: CustomEvent | StorageEvent) => {\n if ((event as StorageEvent).key && (event as StorageEvent).key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n\n // this only works for other documents, not the current one\n useEventListener('storage', handleStorageChange);\n\n useEventListener(storageName, handleStorageChange);\n\n return [storedValue, setValue];\n}\n\nexport type { StorageName, UseStorageOptions };\n","import type { Dispatch, SetStateAction } from 'react';\n\nimport { useStorage } from './useStorage';\n\nimport type { UseStorageOptions } from './useStorage';\n\n/** Custom hook that uses local storage to persist state across page reloads */\nexport function useLocalStorage<T>(\n key: string,\n initialValue: (() => T) | T,\n options: UseStorageOptions<T> = {}\n): [T, Dispatch<SetStateAction<T>>] {\n return useStorage(key, initialValue, 'localStorage', options);\n}\n","import type { Dispatch, SetStateAction } from 'react';\n\nimport { useStorage } from './useStorage';\n\nimport type { UseStorageOptions } from './useStorage';\n\n/** Custom hook that uses session storage to persist state across page reloads */\nexport function useSessionStorage<T>(\n key: string,\n initialValue: (() => T) | T,\n options: UseStorageOptions<T> = {}\n): [T, Dispatch<SetStateAction<T>>] {\n return useStorage(key, initialValue, 'sessionStorage', options);\n}\n","import { useEffect, useState } from 'react';\n\n// this is required since our storybook manager plugin cannot use vite aliases\nimport { isBrowser } from '../../utils';\n\ntype Theme = 'dark' | 'light';\n\ntype UpdateTheme = (theme: Theme) => void;\n\n/** @private */\nconst DEFAULT_THEME: Theme = 'light';\n\n/** @private */\nconst THEME_ATTRIBUTE = 'data-mode';\n\n/** @private */\nconst THEME_KEY = 'theme';\n\n/** @private */\nconst SYS_DARK_MEDIA_QUERY = '(prefers-color-scheme: dark)';\n\n/**\n * Returns the current theme and a function to update the current theme\n *\n * The reason the implementation of this hook is rather convoluted is for\n * cases where the theme is updated outside this hook\n */\nfunction useTheme(): readonly [Theme, UpdateTheme] {\n // Initial theme value is based on the value saved in local storage or the system theme\n const [theme, setTheme] = useState<Theme>(() => {\n if (!isBrowser()) {\n return DEFAULT_THEME;\n }\n const savedTheme = window.localStorage.getItem(THEME_KEY);\n let initialTheme: Theme;\n if (savedTheme === 'dark' || savedTheme === 'light') {\n initialTheme = savedTheme;\n } else {\n initialTheme = window.matchMedia(SYS_DARK_MEDIA_QUERY).matches ? 'dark' : 'light';\n }\n document.documentElement.setAttribute(THEME_ATTRIBUTE, initialTheme);\n return initialTheme;\n });\n\n useEffect(() => {\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n if (mutation.attributeName === THEME_ATTRIBUTE) {\n const updatedTheme = (mutation.target as HTMLHtmlElement).getAttribute(THEME_ATTRIBUTE);\n if (updatedTheme === 'light' || updatedTheme === 'dark') {\n window.localStorage.setItem(THEME_KEY, updatedTheme);\n setTheme(updatedTheme);\n } else {\n console.error(`Unexpected value for 'data-mode' attribute: ${updatedTheme}`);\n }\n }\n });\n });\n observer.observe(document.documentElement, {\n attributes: true\n });\n return () => observer.disconnect();\n }, []);\n\n // When the user wants to change the theme\n const updateTheme = (theme: Theme) => {\n document.documentElement.setAttribute(THEME_ATTRIBUTE, theme);\n };\n\n return [theme, updateTheme] as const;\n}\n\nexport { DEFAULT_THEME, SYS_DARK_MEDIA_QUERY, type Theme, THEME_ATTRIBUTE, THEME_KEY, useTheme };\n","import { useEffect, useMemo, useState } from 'react';\n\nimport type {\n TranslateFunction,\n TranslationKey,\n TranslationKeyForNamespace,\n TranslationNamespace,\n TranslatorType\n} from '@/i18n';\n\n// this is required since our storybook manager plugin cannot use vite aliases\nimport { i18n } from '../../i18n';\n\nexport function useTranslation(): TranslatorType<TranslationKey>;\nexport function useTranslation<TNamespace extends TranslationNamespace>(\n namespace: TNamespace\n): TranslatorType<TranslationKeyForNamespace<TNamespace>>;\nexport function useTranslation(namespace?: TranslationNamespace): TranslatorType<string> {\n const [resolvedLanguage, setResolvedLanguage] = useState(i18n.resolvedLanguage);\n const { changeLanguage, t } = useMemo(() => {\n const t: TranslateFunction<string> = (target, options) => {\n if (typeof target === 'object') {\n return i18n.t(target, options);\n }\n return i18n.t((namespace ? `${namespace}.${target}` : target) as TranslationKey, options);\n };\n return {\n changeLanguage: i18n.changeLanguage.bind(i18n),\n t\n };\n }, []);\n\n useEffect(() => {\n i18n.addEventListener('languageChange', setResolvedLanguage);\n return () => {\n i18n.removeEventListener('languageChange', setResolvedLanguage);\n };\n }, []);\n\n return {\n changeLanguage,\n resolvedLanguage,\n t\n };\n}\n","import { useState } from 'react';\n\nimport { useEventListener } from '../useEventListener';\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect';\n\nexport type WindowSize = {\n height: number;\n width: number;\n};\n\nexport function useWindowSize(): WindowSize {\n const [windowSize, setWindowSize] = useState<WindowSize>({\n height: 0,\n width: 0\n });\n\n const handleSize = () => {\n setWindowSize({\n height: window.innerHeight,\n width: window.innerWidth\n });\n };\n\n useEventListener('resize', handleSize);\n\n // Set size at the first client-side load\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n\n return windowSize;\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,kBAAkB;;;ACA3B,SAAS,qBAAqB;AAQvB,IAAM,eAAe,cAAwC,IAAI;;;ADJjE,SAAS,WAAW;AACzB,QAAM,UAAU,WAAW,YAAY;AACvC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,mDAAmD;AAAA,EACrE;AACA,SAAO;AACT;;;AEVA,SAAS,mBAAmB;;;ACC5B,SAAS,cAAc;AAUhB,IAAM,4BAA4B,OAA+B,CAAC,SAAS;AAAA,EAChF,6BAA6B,CAAC,WAAW;AACvC,QAAI,CAAC,WAAW;AAAA,MACd,2BAA2B,CAAC,GAAG,MAA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AO,CAAC,OAAO,WAAW;AAC5B;;;ACtEA,SAAS,aAAAC,YAAW,SAAS,YAAAC,iBAAgB;AAiBtC,SAAS,eAAe,WAA0D;AACvF,QAAM,CAAC,kBAAkB,mBAAmB,IAAIC,UAAS,KAAK,gBAAgB;AAC9E,QAAM,EAAE,gBAAgB,EAAE,IAAI,QAAQ,MAAM;AAC1C,UAAMC,KAA+B,CAAC,QAAQ,YAAY;AACxD,UAAI,OAAO,WAAW,UAAU;AAC9B,eAAO,KAAK,EAAE,QAAQ,OAAO;AAAA,MAC/B;AACA,aAAO,KAAK,EAAG,YAAY,GAAG,SAAS,IAAI,MAAM,KAAK,QAA2B,OAAO;AAAA,IAC1F;AACA,WAAO;AAAA,MACL,gBAAgB,KAAK,eAAe,KAAK,IAAI;AAAA,MAC7C,GAAAA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,EAAAC,WAAU,MAAM;AACd,SAAK,iBAAiB,kBAAkB,mBAAmB;AAC3D,WAAO,MAAM;AACX,WAAK,oBAAoB,kBAAkB,mBAAmB;AAAA,IAChE;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;;;AC5CA,SAAS,YAAAC,iBAAgB;AAUlB,SAAS,gBAA4B;AAC1C,QAAM,CAAC,YAAY,aAAa,IAAIC,UAAqB;AAAA,IACvD,QAAQ;AAAA,IACR,OAAO;AAAA,EACT,CAAC;AAED,QAAM,aAAa,MAAM;AACvB,kBAAc;AAAA,MACZ,QAAQ,OAAO;AAAA,MACf,OAAO,OAAO;AAAA,IAChB,CAAC;AAAA,EACH;AAEA,mBAAiB,UAAU,UAAU;AAGrC,4BAA0B,MAAM;AAC9B,eAAW;AAAA,EACb,GAAG,CAAC,CAAC;AAEL,SAAO;AACT;","names":["create","useCallback","useEffect","useEffect","useCallback","useEffect","useRef","useRef","useEffect","useEffect","useRef","useRef","useEffect","useEffect","useState","query","useState","useEffect","useCallback","useEffect","useState","useCallback","useState","useEffect","useEffect","useState","useState","useEffect","theme","useEffect","useState","useState","t","useEffect","useState","useState"]}
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import {
|
|
3
|
+
useNotificationsStore,
|
|
4
|
+
useTranslation
|
|
5
|
+
} from "./chunk-LEIF262P.js";
|
|
6
|
+
import {
|
|
7
|
+
cn
|
|
8
|
+
} from "./chunk-HCQE34RL.js";
|
|
9
|
+
|
|
10
|
+
// src/components/Button/Button.tsx
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
import { Slot, Slottable } from "@radix-ui/react-slot";
|
|
13
|
+
import { cva } from "class-variance-authority";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var BUTTON_ICON_SIZE = {
|
|
16
|
+
lg: 18,
|
|
17
|
+
md: 16,
|
|
18
|
+
sm: 14
|
|
19
|
+
};
|
|
20
|
+
var buttonVariants = cva(
|
|
21
|
+
"flex items-center justify-center whitespace-nowrap cursor-pointer rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
22
|
+
{
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
size: "md",
|
|
25
|
+
variant: "primary"
|
|
26
|
+
},
|
|
27
|
+
variants: {
|
|
28
|
+
size: {
|
|
29
|
+
icon: "p-1.5 aspect-square",
|
|
30
|
+
lg: "h-10 rounded-md px-8 text-base",
|
|
31
|
+
md: "h-9 px-4 py-2",
|
|
32
|
+
sm: "h-8 rounded-md px-3 text-xs"
|
|
33
|
+
},
|
|
34
|
+
variant: {
|
|
35
|
+
danger: "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/70",
|
|
36
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
37
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
38
|
+
outline: "border border-input bg-inherit shadow-xs",
|
|
39
|
+
primary: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
|
|
40
|
+
secondary: "bg-secondary border text-secondary-foreground shadow-xs hover:bg-secondary/10"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
var Button = React.forwardRef(function Button2({ asChild, children, className, label, size = "md", variant = "primary", ...props }, ref) {
|
|
46
|
+
const Comp = asChild ? Slot : "button";
|
|
47
|
+
return /* @__PURE__ */ jsxs(Comp, { className: cn(buttonVariants({ className, size, variant })), ref, ...props, children: [
|
|
48
|
+
label,
|
|
49
|
+
/* @__PURE__ */ jsx(Slottable, { children })
|
|
50
|
+
] });
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// src/components/Card/Card.tsx
|
|
54
|
+
import * as React2 from "react";
|
|
55
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
56
|
+
var CardRoot = React2.forwardRef(function CardRoot2({ className, ...props }, ref) {
|
|
57
|
+
return /* @__PURE__ */ jsx2(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
className: cn("bg-card text-card-foreground rounded-xl border shadow-sm", className),
|
|
61
|
+
"data-testid": "card",
|
|
62
|
+
ref,
|
|
63
|
+
...props
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
var Card = Object.assign(CardRoot, {
|
|
68
|
+
Content: ({ className, ...props }) => /* @__PURE__ */ jsx2("div", { className: cn("p-6 pt-0", className), ...props }),
|
|
69
|
+
Description: ({ className, ...props }) => /* @__PURE__ */ jsx2("p", { className: cn("text-muted-foreground text-sm", className), ...props }),
|
|
70
|
+
Footer: ({ className, ...props }) => {
|
|
71
|
+
return /* @__PURE__ */ jsx2("div", { className: cn("flex items-center p-6 pt-0", className), ...props });
|
|
72
|
+
},
|
|
73
|
+
Header: ({ className, ...props }) => /* @__PURE__ */ jsx2("div", { className: cn("flex flex-col space-y-1.5 p-6", className), ...props }),
|
|
74
|
+
Title: ({ children, className, ...props }) => /* @__PURE__ */ jsx2("h3", { className: cn("leading-none font-semibold tracking-tight", className), ...props, children })
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// src/components/Dialog/Dialog.tsx
|
|
78
|
+
import { Root, Trigger } from "@radix-ui/react-dialog";
|
|
79
|
+
|
|
80
|
+
// src/components/Dialog/DialogBody.tsx
|
|
81
|
+
import "react";
|
|
82
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
83
|
+
var DialogBody = ({
|
|
84
|
+
children,
|
|
85
|
+
className,
|
|
86
|
+
...props
|
|
87
|
+
}) => {
|
|
88
|
+
return /* @__PURE__ */ jsx3("div", { className: cn("py-4", className), ...props, children });
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// src/components/Dialog/DialogContent.tsx
|
|
92
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
93
|
+
import { Close, Content, Portal } from "@radix-ui/react-dialog";
|
|
94
|
+
import { XIcon } from "lucide-react";
|
|
95
|
+
|
|
96
|
+
// src/components/Dialog/DialogOverlay.tsx
|
|
97
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
98
|
+
import { Overlay } from "@radix-ui/react-dialog";
|
|
99
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
100
|
+
var DialogOverlay = forwardRef3(function DialogOverlay2({ className, ...props }, ref) {
|
|
101
|
+
return /* @__PURE__ */ jsx4(
|
|
102
|
+
Overlay,
|
|
103
|
+
{
|
|
104
|
+
className: cn(
|
|
105
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80 duration-200",
|
|
106
|
+
className
|
|
107
|
+
),
|
|
108
|
+
ref,
|
|
109
|
+
...props
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// src/components/Dialog/DialogContent.tsx
|
|
115
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
116
|
+
var DialogContent = forwardRef4(function DialogContent2({ children, className, ...props }, ref) {
|
|
117
|
+
return /* @__PURE__ */ jsxs2(Portal, { children: [
|
|
118
|
+
/* @__PURE__ */ jsx5(DialogOverlay, {}),
|
|
119
|
+
/* @__PURE__ */ jsxs2(
|
|
120
|
+
Content,
|
|
121
|
+
{
|
|
122
|
+
className: cn(
|
|
123
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",
|
|
124
|
+
className
|
|
125
|
+
),
|
|
126
|
+
ref,
|
|
127
|
+
...props,
|
|
128
|
+
children: [
|
|
129
|
+
children,
|
|
130
|
+
/* @__PURE__ */ jsx5(Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: /* @__PURE__ */ jsx5(XIcon, { className: "h-4 w-4" }) })
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
] });
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
// src/components/Dialog/DialogDescription.tsx
|
|
138
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
139
|
+
import { Description } from "@radix-ui/react-dialog";
|
|
140
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
141
|
+
var DialogDescription = forwardRef5(function DialogDescription2({ className, ...props }, ref) {
|
|
142
|
+
return /* @__PURE__ */ jsx6(Description, { className: cn("text-sm text-muted-foreground", className), ref, ...props });
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// src/components/Dialog/DialogFooter.tsx
|
|
146
|
+
import "react";
|
|
147
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
148
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx7("div", { className: cn("flex flex-col gap-x-2 gap-y-0.5 sm:flex-row", className), ...props });
|
|
149
|
+
|
|
150
|
+
// src/components/Dialog/DialogHeader.tsx
|
|
151
|
+
import "react";
|
|
152
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
153
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx8("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
|
|
154
|
+
|
|
155
|
+
// src/components/Dialog/DialogTitle.tsx
|
|
156
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
157
|
+
import { Title } from "@radix-ui/react-dialog";
|
|
158
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
159
|
+
var DialogTitle = forwardRef6(
|
|
160
|
+
function DialogTitle2({ className, ...props }, ref) {
|
|
161
|
+
return /* @__PURE__ */ jsx9(Title, { className: cn("text-lg font-semibold leading-none tracking-tight", className), ref, ...props });
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
// src/components/Dialog/Dialog.tsx
|
|
166
|
+
var Dialog = Object.assign(Root.bind(null), {
|
|
167
|
+
Body: DialogBody,
|
|
168
|
+
Content: DialogContent,
|
|
169
|
+
Description: DialogDescription,
|
|
170
|
+
Footer: DialogFooter,
|
|
171
|
+
Header: DialogHeader,
|
|
172
|
+
Title: DialogTitle,
|
|
173
|
+
Trigger
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
// src/providers/CoreProvider/NotificationHub.tsx
|
|
177
|
+
import { XIcon as XIcon2 } from "lucide-react";
|
|
178
|
+
import { AnimatePresence, motion } from "motion/react";
|
|
179
|
+
|
|
180
|
+
// src/providers/CoreProvider/NotificationIcon.tsx
|
|
181
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
182
|
+
var NotificationIcon = ({ type }) => {
|
|
183
|
+
switch (type) {
|
|
184
|
+
case "error":
|
|
185
|
+
return /* @__PURE__ */ jsx10(
|
|
186
|
+
"svg",
|
|
187
|
+
{
|
|
188
|
+
"aria-hidden": "true",
|
|
189
|
+
className: "h-6 w-6 text-red-500",
|
|
190
|
+
"data-slot": "icon",
|
|
191
|
+
fill: "currentColor",
|
|
192
|
+
viewBox: "0 0 24 24",
|
|
193
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
194
|
+
children: /* @__PURE__ */ jsx10(
|
|
195
|
+
"path",
|
|
196
|
+
{
|
|
197
|
+
clipRule: "evenodd",
|
|
198
|
+
d: "M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",
|
|
199
|
+
fillRule: "evenodd"
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
case "info":
|
|
205
|
+
return /* @__PURE__ */ jsx10(
|
|
206
|
+
"svg",
|
|
207
|
+
{
|
|
208
|
+
"aria-hidden": "true",
|
|
209
|
+
className: "h-6 w-6 text-blue-500",
|
|
210
|
+
"data-slot": "icon",
|
|
211
|
+
fill: "currentColor",
|
|
212
|
+
viewBox: "0 0 24 24",
|
|
213
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
214
|
+
children: /* @__PURE__ */ jsx10(
|
|
215
|
+
"path",
|
|
216
|
+
{
|
|
217
|
+
clipRule: "evenodd",
|
|
218
|
+
d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",
|
|
219
|
+
fillRule: "evenodd"
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
}
|
|
223
|
+
);
|
|
224
|
+
case "success":
|
|
225
|
+
return /* @__PURE__ */ jsx10(
|
|
226
|
+
"svg",
|
|
227
|
+
{
|
|
228
|
+
"aria-hidden": "true",
|
|
229
|
+
className: "h-6 w-6 text-green-500",
|
|
230
|
+
"data-slot": "icon",
|
|
231
|
+
fill: "currentColor",
|
|
232
|
+
viewBox: "0 0 24 24",
|
|
233
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
234
|
+
children: /* @__PURE__ */ jsx10(
|
|
235
|
+
"path",
|
|
236
|
+
{
|
|
237
|
+
clipRule: "evenodd",
|
|
238
|
+
d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",
|
|
239
|
+
fillRule: "evenodd"
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
case "warning":
|
|
245
|
+
return /* @__PURE__ */ jsx10(
|
|
246
|
+
"svg",
|
|
247
|
+
{
|
|
248
|
+
"aria-hidden": "true",
|
|
249
|
+
className: "h-6 w-6 text-yellow-500",
|
|
250
|
+
"data-slot": "icon",
|
|
251
|
+
fill: "currentColor",
|
|
252
|
+
viewBox: "0 0 24 24",
|
|
253
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
254
|
+
children: /* @__PURE__ */ jsx10(
|
|
255
|
+
"path",
|
|
256
|
+
{
|
|
257
|
+
clipRule: "evenodd",
|
|
258
|
+
d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75Zm0 8.25a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",
|
|
259
|
+
fillRule: "evenodd"
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
}
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
// src/providers/CoreProvider/NotificationHub.tsx
|
|
268
|
+
import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
269
|
+
var NotificationHub = ({ timeout = 5e3 }) => {
|
|
270
|
+
const { t } = useTranslation("libui");
|
|
271
|
+
const { dismissNotification, notifications } = useNotificationsStore();
|
|
272
|
+
return /* @__PURE__ */ jsx11("div", { className: "fixed bottom-0 z-50 w-full print:hidden", children: /* @__PURE__ */ jsx11(AnimatePresence, { children: notifications.map((item) => /* @__PURE__ */ jsx11(
|
|
273
|
+
motion.div,
|
|
274
|
+
{
|
|
275
|
+
animate: { height: "auto", opacity: 1 },
|
|
276
|
+
className: "relative max-w-sm",
|
|
277
|
+
exit: { height: 0, opacity: 0 },
|
|
278
|
+
initial: { height: 0, opacity: 0 },
|
|
279
|
+
transition: { bounce: 0.1, type: "spring" },
|
|
280
|
+
children: /* @__PURE__ */ jsx11("div", { className: "w-full p-2", children: /* @__PURE__ */ jsxs3(Card, { className: "w-full rounded-lg p-0", children: [
|
|
281
|
+
/* @__PURE__ */ jsxs3("div", { className: "p-4", children: [
|
|
282
|
+
/* @__PURE__ */ jsxs3("div", { className: "mb-2 flex items-center", children: [
|
|
283
|
+
/* @__PURE__ */ jsx11(NotificationIcon, { type: item.type }),
|
|
284
|
+
/* @__PURE__ */ jsx11("h5", { className: "ml-3 grow font-medium text-slate-900 dark:text-slate-100", children: item.title ?? t(`notifications.types.${item.type}`) }),
|
|
285
|
+
/* @__PURE__ */ jsx11(
|
|
286
|
+
"button",
|
|
287
|
+
{
|
|
288
|
+
className: "inline-flex rounded-md text-slate-400 hover:text-slate-500 focus:ring-1 focus:ring-sky-500 focus:outline-hidden dark:focus:ring-sky-600",
|
|
289
|
+
type: "button",
|
|
290
|
+
onClick: () => {
|
|
291
|
+
dismissNotification(item.id);
|
|
292
|
+
},
|
|
293
|
+
children: /* @__PURE__ */ jsx11(XIcon2, { "aria-hidden": "true", className: "h-5 w-5" })
|
|
294
|
+
}
|
|
295
|
+
)
|
|
296
|
+
] }),
|
|
297
|
+
/* @__PURE__ */ jsx11("p", { className: "text-muted-foreground my-2", children: item.message })
|
|
298
|
+
] }),
|
|
299
|
+
/* @__PURE__ */ jsx11(
|
|
300
|
+
motion.div,
|
|
301
|
+
{
|
|
302
|
+
animate: { width: "100%" },
|
|
303
|
+
className: "h-1 bg-slate-500",
|
|
304
|
+
initial: { width: "0%" },
|
|
305
|
+
transition: { duration: timeout / 1e3, ease: "linear" },
|
|
306
|
+
onAnimationComplete: () => {
|
|
307
|
+
dismissNotification(item.id);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
)
|
|
311
|
+
] }) })
|
|
312
|
+
},
|
|
313
|
+
item.id
|
|
314
|
+
)) }) });
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
export {
|
|
318
|
+
BUTTON_ICON_SIZE,
|
|
319
|
+
buttonVariants,
|
|
320
|
+
Button,
|
|
321
|
+
Card,
|
|
322
|
+
Dialog,
|
|
323
|
+
NotificationHub
|
|
324
|
+
};
|
|
325
|
+
//# sourceMappingURL=chunk-X2FQXQHP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Button/Button.tsx","../src/components/Card/Card.tsx","../src/components/Dialog/Dialog.tsx","../src/components/Dialog/DialogBody.tsx","../src/components/Dialog/DialogContent.tsx","../src/components/Dialog/DialogOverlay.tsx","../src/components/Dialog/DialogDescription.tsx","../src/components/Dialog/DialogFooter.tsx","../src/components/Dialog/DialogHeader.tsx","../src/components/Dialog/DialogTitle.tsx","../src/providers/CoreProvider/NotificationHub.tsx","../src/providers/CoreProvider/NotificationIcon.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Slot, Slottable } from '@radix-ui/react-slot';\nimport { cva } from 'class-variance-authority';\nimport type { VariantProps } from 'class-variance-authority';\nimport type { Simplify } from 'type-fest';\n\nimport { cn } from '@/utils';\n\nexport const BUTTON_ICON_SIZE = {\n lg: 18,\n md: 16,\n sm: 14\n};\n\nexport const buttonVariants = cva(\n 'flex items-center justify-center whitespace-nowrap cursor-pointer rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',\n {\n defaultVariants: {\n size: 'md',\n variant: 'primary'\n },\n variants: {\n size: {\n icon: 'p-1.5 aspect-square',\n lg: 'h-10 rounded-md px-8 text-base',\n md: 'h-9 px-4 py-2',\n sm: 'h-8 rounded-md px-3 text-xs'\n },\n variant: {\n danger: 'bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/70',\n ghost: 'hover:bg-accent hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n outline: 'border border-input bg-inherit shadow-xs',\n primary: 'bg-primary text-primary-foreground shadow-sm hover:bg-primary/90',\n secondary: 'bg-secondary border text-secondary-foreground shadow-xs hover:bg-secondary/10'\n }\n }\n }\n);\n\nexport type ButtonProps = Simplify<\n React.ButtonHTMLAttributes<HTMLButtonElement> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n /** @deprecated - use children */\n label?: string;\n }\n>;\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n { asChild, children, className, label, size = 'md', variant = 'primary', ...props },\n ref\n) {\n const Comp = asChild ? Slot : 'button';\n return (\n <Comp className={cn(buttonVariants({ className, size, variant }))} ref={ref} {...props}>\n {label}\n <Slottable>{children}</Slottable>\n </Comp>\n );\n});\n","import * as React from 'react';\n\nimport { cn } from '@/utils';\n\nconst CardRoot = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(function CardRoot(\n { className, ...props },\n ref\n) {\n return (\n <div\n className={cn('bg-card text-card-foreground rounded-xl border shadow-sm', className)}\n data-testid=\"card\"\n ref={ref}\n {...props}\n />\n );\n});\n\nexport const Card = Object.assign(CardRoot, {\n Content: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('p-6 pt-0', className)} {...props} />\n ),\n Description: ({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>) => (\n <p className={cn('text-muted-foreground text-sm', className)} {...props} />\n ),\n Footer: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => {\n return <div className={cn('flex items-center p-6 pt-0', className)} {...props} />;\n },\n Header: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-1.5 p-6', className)} {...props} />\n ),\n Title: ({ children, className, ...props }: React.HTMLAttributes<HTMLHeadingElement>) => (\n <h3 className={cn('leading-none font-semibold tracking-tight', className)} {...props}>\n {children}\n </h3>\n )\n});\n","import { Root, Trigger } from '@radix-ui/react-dialog';\n\nimport { DialogBody } from './DialogBody';\nimport { DialogContent } from './DialogContent';\nimport { DialogDescription } from './DialogDescription';\nimport { DialogFooter } from './DialogFooter';\nimport { DialogHeader } from './DialogHeader';\nimport { DialogTitle } from './DialogTitle';\n\nexport const Dialog = Object.assign(Root.bind(null), {\n Body: DialogBody,\n Content: DialogContent,\n Description: DialogDescription,\n Footer: DialogFooter,\n Header: DialogHeader,\n Title: DialogTitle,\n Trigger\n});\n","import * as React from 'react';\n\nimport { cn } from '@/utils';\n\nexport const DialogBody = ({\n children,\n className,\n ...props\n}: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => {\n return (\n <div className={cn('py-4', className)} {...props}>\n {children}\n </div>\n );\n};\n","import { forwardRef } from 'react';\n\nimport { Close, Content, Portal } from '@radix-ui/react-dialog';\nimport { XIcon } from 'lucide-react';\n\nimport { cn } from '@/utils';\n\nimport { DialogOverlay } from './DialogOverlay';\n\nexport const DialogContent = forwardRef<\n React.ElementRef<typeof Content>,\n React.ComponentPropsWithoutRef<typeof Content>\n>(function DialogContent({ children, className, ...props }, ref) {\n return (\n <Portal>\n <DialogOverlay />\n <Content\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg',\n className\n )}\n ref={ref}\n {...props}\n >\n {children}\n <Close className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none\">\n <XIcon className=\"h-4 w-4\" />\n </Close>\n </Content>\n </Portal>\n );\n});\n","import { forwardRef } from 'react';\n\nimport { Overlay } from '@radix-ui/react-dialog';\n\nimport { cn } from '@/utils';\n\nexport const DialogOverlay = forwardRef<\n React.ElementRef<typeof Overlay>,\n React.ComponentPropsWithoutRef<typeof Overlay>\n>(function DialogOverlay({ className, ...props }, ref) {\n return (\n <Overlay\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80 duration-200',\n className\n )}\n ref={ref}\n {...props}\n />\n );\n});\n","import { forwardRef } from 'react';\n\nimport { Description } from '@radix-ui/react-dialog';\n\nimport { cn } from '@/utils';\n\nexport const DialogDescription = forwardRef<\n React.ElementRef<typeof Description>,\n React.ComponentPropsWithoutRef<typeof Description>\n>(function DialogDescription({ className, ...props }, ref) {\n return <Description className={cn('text-sm text-muted-foreground', className)} ref={ref} {...props} />;\n});\n","import * as React from 'react';\n\nimport { cn } from '@/utils';\n\nexport const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col gap-x-2 gap-y-0.5 sm:flex-row', className)} {...props} />\n);\n","import * as React from 'react';\n\nimport { cn } from '@/utils';\n\nexport const DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />\n);\n","import { forwardRef } from 'react';\n\nimport { Title } from '@radix-ui/react-dialog';\n\nimport { cn } from '@/utils';\n\nexport const DialogTitle = forwardRef<React.ElementRef<typeof Title>, React.ComponentPropsWithoutRef<typeof Title>>(\n function DialogTitle({ className, ...props }, ref) {\n return (\n <Title className={cn('text-lg font-semibold leading-none tracking-tight', className)} ref={ref} {...props} />\n );\n }\n);\n","import { XIcon } from 'lucide-react';\nimport { AnimatePresence, motion } from 'motion/react';\n\nimport { Card } from '@/components/Card';\nimport { useTranslation } from '@/hooks';\nimport { useNotificationsStore } from '@/hooks/useNotificationsStore';\n\nimport { NotificationIcon } from './NotificationIcon';\n\ntype NotificationHubProps = {\n /** The number of milliseconds before the notification is automatically cleared */\n timeout?: number;\n};\n\nconst NotificationHub = ({ timeout = 5000 }: NotificationHubProps) => {\n const { t } = useTranslation('libui');\n const { dismissNotification, notifications } = useNotificationsStore();\n\n return (\n <div className=\"fixed bottom-0 z-50 w-full print:hidden\">\n <AnimatePresence>\n {notifications.map((item) => (\n <motion.div\n animate={{ height: 'auto', opacity: 1 }}\n className=\"relative max-w-sm\"\n exit={{ height: 0, opacity: 0 }}\n initial={{ height: 0, opacity: 0 }}\n key={item.id}\n transition={{ bounce: 0.1, type: 'spring' }}\n >\n <div className=\"w-full p-2\">\n <Card className=\"w-full rounded-lg p-0\">\n <div className=\"p-4\">\n <div className=\"mb-2 flex items-center\">\n <NotificationIcon type={item.type} />\n <h5 className=\"ml-3 grow font-medium text-slate-900 dark:text-slate-100\">\n {item.title ?? t(`notifications.types.${item.type}`)}\n </h5>\n <button\n className=\"inline-flex rounded-md text-slate-400 hover:text-slate-500 focus:ring-1 focus:ring-sky-500 focus:outline-hidden dark:focus:ring-sky-600\"\n type=\"button\"\n onClick={() => {\n dismissNotification(item.id);\n }}\n >\n <XIcon aria-hidden=\"true\" className=\"h-5 w-5\" />\n </button>\n </div>\n <p className=\"text-muted-foreground my-2\">{item.message}</p>\n </div>\n <motion.div\n animate={{ width: '100%' }}\n className=\"h-1 bg-slate-500\"\n initial={{ width: '0%' }}\n transition={{ duration: timeout / 1000, ease: 'linear' }}\n onAnimationComplete={() => {\n dismissNotification(item.id);\n }}\n />\n </Card>\n </div>\n </motion.div>\n ))}\n </AnimatePresence>\n </div>\n );\n};\n\nexport { NotificationHub, type NotificationHubProps };\n","import type { NotificationInterface } from '@/hooks/useNotificationsStore';\n\nexport type NotificationIconProps = {\n type: NotificationInterface['type'];\n};\n\nexport const NotificationIcon = ({ type }: NotificationIconProps) => {\n switch (type) {\n case 'error':\n return (\n <svg\n aria-hidden=\"true\"\n className=\"h-6 w-6 text-red-500\"\n data-slot=\"icon\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n clipRule=\"evenodd\"\n d=\"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z\"\n fillRule=\"evenodd\"\n ></path>\n </svg>\n );\n case 'info':\n return (\n <svg\n aria-hidden=\"true\"\n className=\"h-6 w-6 text-blue-500\"\n data-slot=\"icon\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n clipRule=\"evenodd\"\n d=\"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z\"\n fillRule=\"evenodd\"\n ></path>\n </svg>\n );\n case 'success':\n return (\n <svg\n aria-hidden=\"true\"\n className=\"h-6 w-6 text-green-500\"\n data-slot=\"icon\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n clipRule=\"evenodd\"\n d=\"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z\"\n fillRule=\"evenodd\"\n />\n </svg>\n );\n case 'warning':\n return (\n <svg\n aria-hidden=\"true\"\n className=\"h-6 w-6 text-yellow-500\"\n data-slot=\"icon\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n clipRule=\"evenodd\"\n d=\"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Z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gBAAAA;AAAA,cAAC;AAAA;AAAA,gBACC,WAAU;AAAA,gBACV,MAAK;AAAA,gBACL,SAAS,MAAM;AACb,sCAAoB,KAAK,EAAE;AAAA,gBAC7B;AAAA,gBAEA,0BAAAA,MAACE,QAAA,EAAM,eAAY,QAAO,WAAU,WAAU;AAAA;AAAA,YAChD;AAAA,aACF;AAAA,UACA,gBAAAF,MAAC,OAAE,WAAU,8BAA8B,eAAK,SAAQ;AAAA,WAC1D;AAAA,QACA,gBAAAA;AAAA,UAAC,OAAO;AAAA,UAAP;AAAA,YACC,SAAS,EAAE,OAAO,OAAO;AAAA,YACzB,WAAU;AAAA,YACV,SAAS,EAAE,OAAO,KAAK;AAAA,YACvB,YAAY,EAAE,UAAU,UAAU,KAAM,MAAM,SAAS;AAAA,YACvD,qBAAqB,MAAM;AACzB,kCAAoB,KAAK,EAAE;AAAA,YAC7B;AAAA;AAAA,QACF;AAAA,SACF,GACF;AAAA;AAAA,IAjCK,KAAK;AAAA,EAkCZ,CACD,GACH,GACF;AAEJ;","names":["Button","React","jsx","CardRoot","jsx","forwardRef","forwardRef","jsx","forwardRef","DialogOverlay","jsx","jsxs","forwardRef","DialogContent","forwardRef","jsx","forwardRef","DialogDescription","jsx","jsx","forwardRef","jsx","forwardRef","DialogTitle","XIcon","jsx","jsx","jsxs","XIcon"]}
|
package/dist/components.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ import { ZodTypeLike, ZodErrorLike } from '@douglasneuroinformatics/libjs';
|
|
|
25
25
|
import { FormDataType, FormContent, PartialNullableFormDataType } from '@douglasneuroinformatics/libui-form-types';
|
|
26
26
|
import * as _radix_ui_react_hover_card from '@radix-ui/react-hover-card';
|
|
27
27
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
28
|
-
import { L as Language } from './types-
|
|
28
|
+
import { L as Language } from './types-CwW4nA_v.js';
|
|
29
29
|
import * as _radix_ui_react_menubar from '@radix-ui/react-menubar';
|
|
30
30
|
import { MenubarMenuProps } from '@radix-ui/react-menubar';
|
|
31
31
|
import * as _radix_ui_react_popover from '@radix-ui/react-popover';
|
|
@@ -1450,12 +1450,6 @@ declare const MenuBar: React$1.ForwardRefExoticComponent<Omit<_radix_ui_react_me
|
|
|
1450
1450
|
Trigger: React$1.ForwardRefExoticComponent<Omit<_radix_ui_react_menubar.MenubarTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1451
1451
|
};
|
|
1452
1452
|
|
|
1453
|
-
type NotificationHubProps = {
|
|
1454
|
-
/** The number of milliseconds before the notification is automatically cleared */
|
|
1455
|
-
timeout?: number;
|
|
1456
|
-
};
|
|
1457
|
-
declare const NotificationHub: ({ timeout }: NotificationHubProps) => react_jsx_runtime.JSX.Element;
|
|
1458
|
-
|
|
1459
1453
|
type OneTimePasswordInputProps = {
|
|
1460
1454
|
[key: `data-${string}`]: unknown;
|
|
1461
1455
|
className?: string;
|
|
@@ -1638,4 +1632,10 @@ declare const Tooltip: (({ children, delayDuration, onOpenChange, open, skipDela
|
|
|
1638
1632
|
Trigger: React$1.ForwardRefExoticComponent<TooltipTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
1639
1633
|
};
|
|
1640
1634
|
|
|
1641
|
-
|
|
1635
|
+
type NotificationHubProps = {
|
|
1636
|
+
/** The number of milliseconds before the notification is automatically cleared */
|
|
1637
|
+
timeout?: number;
|
|
1638
|
+
};
|
|
1639
|
+
declare const NotificationHub: ({ timeout }: NotificationHubProps) => react_jsx_runtime.JSX.Element;
|
|
1640
|
+
|
|
1641
|
+
export { Accordion, ActionDropdown, type ActionDropdownProps, AlertDialog, ArrowToggle, type ArrowToggleProps, Avatar, BUTTON_ICON_SIZE, Badge, type BadgeProps, type BaseSearchBarProps, Breadcrumb, Button, type ButtonProps, Card, Chart, ChartConfig, Checkbox, type ClientFieldFactory, ClientTable, type ClientTableColumn, type ClientTableColumnProps, type ClientTableDropdownOptions, type ClientTableEntry, type ClientTableProps, Collapsible, Command, ContextMenu, CopyButton, DataTable, type DataTableColumn, DatePicker, type DatePickerProps, Dialog, Drawer, DropdownButton, DropdownMenu, ErrorBoundary, ErrorFallback, type ErrorFallbackProps, FileDropzone, type FileDropzoneProps, Form, type FormProps, Heading, type HeadingProps, HoverCard, Input, type InputProps, Label, LanguageToggle, type LanguageToggleProps, LineGraph, type LineGraphData, type LineGraphLine, ListboxDropdown, type ListboxDropdownOption, type ListboxDropdownProps, MenuBar, NotificationHub, OneTimePasswordInput, Popover, Progress, RadioGroup, type RadioGroupProps, Resizable, ScrollArea, SearchBar, type SearchBarProps, Select, Separator, Sheet, Slider, Spinner, SpinnerIcon, StatisticCard, Switch, Table, Tabs, TextArea, type TextAreaProps, ThemeToggle, type ThemeToggleProps, Tooltip, badgeVariants, buttonVariants, labelVariants };
|