@doist/reactist 26.1.0 → 26.2.1

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.
@@ -575,20 +575,45 @@ function Spinner({
575
575
 
576
576
  var modules_95f1407a = {"tooltip":"_487c82cd"};
577
577
 
578
+ const defaultShowTimeout = 500;
579
+ const defaultHideTimeout = 100;
580
+ const TooltipContext = /*#__PURE__*/React__namespace.createContext({
581
+ showTimeout: defaultShowTimeout,
582
+ hideTimeout: defaultHideTimeout
583
+ });
584
+
585
+ function TooltipProvider({
586
+ showTimeout = defaultShowTimeout,
587
+ hideTimeout = defaultHideTimeout,
588
+ children
589
+ }) {
590
+ const value = React__namespace.useMemo(() => ({
591
+ showTimeout,
592
+ hideTimeout
593
+ }), [showTimeout, hideTimeout]);
594
+ return /*#__PURE__*/React__namespace.createElement(TooltipContext.Provider, {
595
+ value: value
596
+ }, children);
597
+ }
598
+
578
599
  function Tooltip({
579
600
  children,
580
601
  content,
581
602
  position = 'top',
582
603
  gapSize = 3,
583
604
  withArrow = false,
584
- showTimeout = 500,
585
- hideTimeout = 100,
605
+ showTimeout,
606
+ hideTimeout,
586
607
  exceptionallySetClassName
587
608
  }) {
609
+ const {
610
+ showTimeout: globalShowTimeout,
611
+ hideTimeout: globalHideTimeout
612
+ } = React__namespace.useContext(TooltipContext);
588
613
  const tooltip = react.useTooltipStore({
589
614
  placement: position,
590
- showTimeout,
591
- hideTimeout
615
+ showTimeout: showTimeout != null ? showTimeout : globalShowTimeout,
616
+ hideTimeout: hideTimeout != null ? hideTimeout : globalHideTimeout
592
617
  });
593
618
  const isOpen = tooltip.useState('open');
594
619
  const child = React__namespace.Children.only(children);
@@ -3928,6 +3953,7 @@ exports.Time = Time;
3928
3953
  exports.Toast = Toast;
3929
3954
  exports.ToastsProvider = ToastsProvider;
3930
3955
  exports.Tooltip = Tooltip;
3956
+ exports.TooltipProvider = TooltipProvider;
3931
3957
  exports.getBoxClassNames = getBoxClassNames;
3932
3958
  exports.useToasts = useToasts;
3933
3959
  //# sourceMappingURL=reactist.cjs.development.js.map