@teamturing/react-kit 2.46.4 → 2.46.5
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { TooltipOptions } from './useTooltip';
|
|
2
3
|
type Props = {
|
|
3
4
|
/**
|
|
4
5
|
* children 컴포넌트 기준으로 Tooltip의 위치를 정의합니다.
|
|
@@ -12,7 +13,7 @@ type Props = {
|
|
|
12
13
|
* Tooltip의 활성화 여부를 정의합니다.
|
|
13
14
|
*/
|
|
14
15
|
disabled?: boolean;
|
|
15
|
-
} & PropsWithChildren
|
|
16
|
-
declare const Tooltip: ({ children, direction, text, disabled }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
} & PropsWithChildren & Pick<TooltipOptions, 'mouseOnly'>;
|
|
17
|
+
declare const Tooltip: ({ children, direction, text, disabled, mouseOnly }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export default Tooltip;
|
|
18
19
|
export type { Props as TooltipProps };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { type Placement, type UseFloatingReturn, type UseInteractionsReturn } from '@floating-ui/react';
|
|
1
|
+
import { type Placement, type UseFloatingReturn, type UseInteractionsReturn, type UseHoverProps } from '@floating-ui/react';
|
|
2
2
|
import { type MutableRefObject } from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type TooltipOptions = {
|
|
4
4
|
initialOpen?: boolean;
|
|
5
5
|
placement?: Placement;
|
|
6
6
|
open?: boolean;
|
|
7
7
|
onOpenChange?: (open: boolean) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare function useTooltip({ initialOpen, placement, open: controlledOpen, onOpenChange: setControlledOpen, }?: TooltipOptions): {
|
|
8
|
+
} & Pick<UseHoverProps, 'mouseOnly'>;
|
|
9
|
+
export declare function useTooltip({ initialOpen, placement, open: controlledOpen, onOpenChange: setControlledOpen, mouseOnly, }?: TooltipOptions): {
|
|
10
10
|
open: boolean;
|
|
11
11
|
setOpen: (open: boolean) => void;
|
|
12
12
|
} & UseInteractionsReturn & UseFloatingReturn & {
|
package/dist/index.js
CHANGED
|
@@ -34121,7 +34121,8 @@ function useTooltip({
|
|
|
34121
34121
|
initialOpen = false,
|
|
34122
34122
|
placement = 'top',
|
|
34123
34123
|
open: controlledOpen,
|
|
34124
|
-
onOpenChange: setControlledOpen
|
|
34124
|
+
onOpenChange: setControlledOpen,
|
|
34125
|
+
mouseOnly = true
|
|
34125
34126
|
} = {}) {
|
|
34126
34127
|
const theme = styled.useTheme();
|
|
34127
34128
|
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(initialOpen);
|
|
@@ -34148,7 +34149,7 @@ function useTooltip({
|
|
|
34148
34149
|
move: false,
|
|
34149
34150
|
restMs: 300,
|
|
34150
34151
|
enabled: controlledOpen == null,
|
|
34151
|
-
mouseOnly
|
|
34152
|
+
mouseOnly
|
|
34152
34153
|
});
|
|
34153
34154
|
const focus = useFocus(context, {
|
|
34154
34155
|
enabled: controlledOpen == null
|
|
@@ -34298,7 +34299,8 @@ const Tooltip = ({
|
|
|
34298
34299
|
children,
|
|
34299
34300
|
direction = 'top-center',
|
|
34300
34301
|
text,
|
|
34301
|
-
disabled = false
|
|
34302
|
+
disabled = false,
|
|
34303
|
+
mouseOnly = true
|
|
34302
34304
|
}) => {
|
|
34303
34305
|
const directionToPlacement = {
|
|
34304
34306
|
'top-center': 'top',
|
|
@@ -34312,6 +34314,7 @@ const Tooltip = ({
|
|
|
34312
34314
|
}[direction];
|
|
34313
34315
|
return /*#__PURE__*/jsxRuntimeExports.jsxs(BaseTooltip, {
|
|
34314
34316
|
placement: directionToPlacement,
|
|
34317
|
+
mouseOnly: mouseOnly,
|
|
34315
34318
|
children: [/*#__PURE__*/jsxRuntimeExports.jsx(BaseTooltipTrigger, {
|
|
34316
34319
|
className: 'tooltip__tooltip_trigger',
|
|
34317
34320
|
children: children
|
|
@@ -5,7 +5,8 @@ const Tooltip = ({
|
|
|
5
5
|
children,
|
|
6
6
|
direction = 'top-center',
|
|
7
7
|
text,
|
|
8
|
-
disabled = false
|
|
8
|
+
disabled = false,
|
|
9
|
+
mouseOnly = true
|
|
9
10
|
}) => {
|
|
10
11
|
const directionToPlacement = {
|
|
11
12
|
'top-center': 'top',
|
|
@@ -19,6 +20,7 @@ const Tooltip = ({
|
|
|
19
20
|
}[direction];
|
|
20
21
|
return /*#__PURE__*/jsxRuntimeExports.jsxs(BaseTooltip, {
|
|
21
22
|
placement: directionToPlacement,
|
|
23
|
+
mouseOnly: mouseOnly,
|
|
22
24
|
children: [/*#__PURE__*/jsxRuntimeExports.jsx(BaseTooltipTrigger, {
|
|
23
25
|
className: 'tooltip__tooltip_trigger',
|
|
24
26
|
children: children
|
|
@@ -8,7 +8,8 @@ function useTooltip({
|
|
|
8
8
|
initialOpen = false,
|
|
9
9
|
placement = 'top',
|
|
10
10
|
open: controlledOpen,
|
|
11
|
-
onOpenChange: setControlledOpen
|
|
11
|
+
onOpenChange: setControlledOpen,
|
|
12
|
+
mouseOnly = true
|
|
12
13
|
} = {}) {
|
|
13
14
|
const theme = useTheme();
|
|
14
15
|
const [uncontrolledOpen, setUncontrolledOpen] = useState(initialOpen);
|
|
@@ -35,7 +36,7 @@ function useTooltip({
|
|
|
35
36
|
move: false,
|
|
36
37
|
restMs: 300,
|
|
37
38
|
enabled: controlledOpen == null,
|
|
38
|
-
mouseOnly
|
|
39
|
+
mouseOnly
|
|
39
40
|
});
|
|
40
41
|
const focus = useFocus(context, {
|
|
41
42
|
enabled: controlledOpen == null
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamturing/react-kit",
|
|
3
|
-
"version": "2.46.
|
|
3
|
+
"version": "2.46.5",
|
|
4
4
|
"description": "React components, hooks for create teamturing web application",
|
|
5
5
|
"author": "Sungchang Park <psch300@gmail.com> (https://github.com/psch300)",
|
|
6
6
|
"homepage": "https://github.com/weareteamturing/bombe#readme",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"react-textarea-autosize": "^8.5.3",
|
|
67
67
|
"styled-system": "^5.1.5"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "fc093fecce517059d071cf41c0993cfafe8e2f90"
|
|
70
70
|
}
|