-
-
Notifications
You must be signed in to change notification settings - Fork 533
/
Copy pathindex.tsx
54 lines (48 loc) · 1.49 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import './tokens.css'
import { injectStyle } from 'utils/handle-style'
import type {
ChildrenType,
DataAttribute,
EventsType,
PlacesType,
PositionStrategy,
VariantType,
WrapperType,
IPosition,
Middleware,
TooltipRefProps,
} from './components/Tooltip/TooltipTypes'
import type { ITooltipController } from './components/TooltipController/TooltipControllerTypes'
import type { ITooltipWrapper } from './components/TooltipProvider/TooltipProviderTypes'
// those content will be replaced in build time with the `react-tooltip.css` builded content
const TooltipCoreStyles = 'react-tooltip-core-css-placeholder'
const TooltipStyles = 'react-tooltip-css-placeholder'
if (typeof window !== 'undefined') {
window.addEventListener('react-tooltip-inject-styles', ((
event: CustomEvent<{ disableCore: boolean; disableBase: boolean }>,
) => {
if (!event.detail.disableCore) {
injectStyle({ css: TooltipCoreStyles, type: 'core' })
}
if (!event.detail.disableBase) {
injectStyle({ css: TooltipStyles, type: 'base' })
}
}) as EventListener)
}
export { TooltipController as Tooltip } from './components/TooltipController'
export { TooltipProvider, TooltipWrapper } from './components/TooltipProvider'
export type {
ChildrenType,
DataAttribute,
EventsType,
PlacesType,
PositionStrategy,
VariantType,
WrapperType,
ITooltipController as ITooltip,
ITooltipWrapper,
IPosition,
Middleware,
TooltipRefProps,
}
export { removeStyle } from './utils/handle-style'