UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

1 lines 709 B
{"version":3,"file":"context.mjs","names":[],"sources":["../../src/Toast/context.ts"],"sourcesContent":["'use client';\n\nimport { createContext, useContext } from 'react';\n\nimport type { ToastPosition } from './type';\n\nexport interface ToastContextValue {\n position: ToastPosition;\n swipeDirection: ('left' | 'right' | 'up' | 'down') | ('left' | 'right' | 'up' | 'down')[];\n}\n\nexport const ToastContext = createContext<ToastContextValue>({\n position: 'bottom-right',\n swipeDirection: ['down', 'right'],\n});\n\nexport const useToastContext = () => useContext(ToastContext);\n"],"mappings":";;;;;AAWA,MAAa,eAAe,cAAiC;CAC3D,UAAU;CACV,gBAAgB,CAAC,QAAQ,QAAQ;CAClC,CAAC;AAEF,MAAa,wBAAwB,WAAW,aAAa"}