@shoplflow/base 0.32.4 → 0.32.6
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/dist/index.cjs +16 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +16 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -657,6 +657,17 @@ declare const Callout: {
|
|
|
657
657
|
interface PopperProps extends PopperOptionProps {
|
|
658
658
|
}
|
|
659
659
|
interface PopperOptionProps extends ChildrenProps {
|
|
660
|
+
/**
|
|
661
|
+
* tooltip open 상태
|
|
662
|
+
* onOpenChange와 함께 사용해야 합니다!
|
|
663
|
+
*/
|
|
664
|
+
open?: boolean;
|
|
665
|
+
/**
|
|
666
|
+
* open 상태 변경 감지 이벤트입니다.
|
|
667
|
+
* @param open
|
|
668
|
+
* @returns
|
|
669
|
+
*/
|
|
670
|
+
onOpenChange?: (open: boolean) => void;
|
|
660
671
|
/**
|
|
661
672
|
* popper의 offset을 설정합니다.
|
|
662
673
|
*
|
|
@@ -1130,7 +1141,7 @@ interface TooltipContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
1130
1141
|
}
|
|
1131
1142
|
|
|
1132
1143
|
declare const Tooltip: {
|
|
1133
|
-
({ trigger, popper, placement, offset, triggerRef, portalRef, ...popperProps }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
1144
|
+
({ open, onOpenChange, trigger, popper, placement, offset, triggerRef, portalRef, ...popperProps }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
1134
1145
|
Content: ({ content, ...args }: TooltipContentProps) => react_jsx_runtime.JSX.Element;
|
|
1135
1146
|
};
|
|
1136
1147
|
|
package/dist/index.d.ts
CHANGED
|
@@ -657,6 +657,17 @@ declare const Callout: {
|
|
|
657
657
|
interface PopperProps extends PopperOptionProps {
|
|
658
658
|
}
|
|
659
659
|
interface PopperOptionProps extends ChildrenProps {
|
|
660
|
+
/**
|
|
661
|
+
* tooltip open 상태
|
|
662
|
+
* onOpenChange와 함께 사용해야 합니다!
|
|
663
|
+
*/
|
|
664
|
+
open?: boolean;
|
|
665
|
+
/**
|
|
666
|
+
* open 상태 변경 감지 이벤트입니다.
|
|
667
|
+
* @param open
|
|
668
|
+
* @returns
|
|
669
|
+
*/
|
|
670
|
+
onOpenChange?: (open: boolean) => void;
|
|
660
671
|
/**
|
|
661
672
|
* popper의 offset을 설정합니다.
|
|
662
673
|
*
|
|
@@ -1130,7 +1141,7 @@ interface TooltipContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
1130
1141
|
}
|
|
1131
1142
|
|
|
1132
1143
|
declare const Tooltip: {
|
|
1133
|
-
({ trigger, popper, placement, offset, triggerRef, portalRef, ...popperProps }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
1144
|
+
({ open, onOpenChange, trigger, popper, placement, offset, triggerRef, portalRef, ...popperProps }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
1134
1145
|
Content: ({ content, ...args }: TooltipContentProps) => react_jsx_runtime.JSX.Element;
|
|
1135
1146
|
};
|
|
1136
1147
|
|
package/dist/index.js
CHANGED
|
@@ -1356,7 +1356,7 @@ var getNextColor = (color, step = 1) => {
|
|
|
1356
1356
|
if (newIndex < 0 || newIndex >= sortColorToken.length) {
|
|
1357
1357
|
break;
|
|
1358
1358
|
}
|
|
1359
|
-
if (!sortColorToken[newIndex].endsWith("_5") && !sortColorToken[newIndex].
|
|
1359
|
+
if (!sortColorToken[newIndex].endsWith("_5") && !sortColorToken[newIndex].endsWith("50")) {
|
|
1360
1360
|
stepCount++;
|
|
1361
1361
|
}
|
|
1362
1362
|
}
|
|
@@ -3612,6 +3612,8 @@ var TooltipContent = (_a) => {
|
|
|
3612
3612
|
};
|
|
3613
3613
|
var Tooltip = (_a) => {
|
|
3614
3614
|
var _b = _a, {
|
|
3615
|
+
open,
|
|
3616
|
+
onOpenChange,
|
|
3615
3617
|
trigger,
|
|
3616
3618
|
popper,
|
|
3617
3619
|
placement = "bottom-start",
|
|
@@ -3619,6 +3621,8 @@ var Tooltip = (_a) => {
|
|
|
3619
3621
|
triggerRef,
|
|
3620
3622
|
portalRef
|
|
3621
3623
|
} = _b, popperProps = __objRest(_b, [
|
|
3624
|
+
"open",
|
|
3625
|
+
"onOpenChange",
|
|
3622
3626
|
"trigger",
|
|
3623
3627
|
"popper",
|
|
3624
3628
|
"placement",
|
|
@@ -3628,17 +3632,23 @@ var Tooltip = (_a) => {
|
|
|
3628
3632
|
]);
|
|
3629
3633
|
const [isOpen, setIsOpen] = useState(false);
|
|
3630
3634
|
const showHandler = useCallback(() => {
|
|
3631
|
-
|
|
3632
|
-
|
|
3635
|
+
if (open === void 0) {
|
|
3636
|
+
setIsOpen(true);
|
|
3637
|
+
}
|
|
3638
|
+
onOpenChange == null ? void 0 : onOpenChange(true);
|
|
3639
|
+
}, [open, onOpenChange]);
|
|
3633
3640
|
const hideHandler = useCallback(() => {
|
|
3634
|
-
|
|
3635
|
-
|
|
3641
|
+
if (open === void 0) {
|
|
3642
|
+
setIsOpen(false);
|
|
3643
|
+
}
|
|
3644
|
+
onOpenChange == null ? void 0 : onOpenChange(false);
|
|
3645
|
+
}, [open, onOpenChange]);
|
|
3636
3646
|
return /* @__PURE__ */ jsxs(Popper_default, __spreadProps(__spreadValues({ offset: offset3, placement, middlewares: [flip(), shift({ padding: 5 })] }, popperProps), { children: [
|
|
3637
3647
|
/* @__PURE__ */ jsx(
|
|
3638
3648
|
Popper_default.Trigger,
|
|
3639
3649
|
{
|
|
3640
3650
|
ref: triggerRef,
|
|
3641
|
-
isOpen,
|
|
3651
|
+
isOpen: isOpen || open,
|
|
3642
3652
|
onMouseOver: showHandler,
|
|
3643
3653
|
onMouseLeave: hideHandler,
|
|
3644
3654
|
onFocus: showHandler,
|