sodtrack-web-ui 0.2.0 → 0.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.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import React, { FC } from 'react';
2
2
  import { VariantProps } from 'cva';
3
+ import * as _radix_ui_react_tooltip from '@radix-ui/react-tooltip';
3
4
  import { TooltipContentProps, TooltipProps } from '@radix-ui/react-tooltip';
4
5
 
5
6
  type ButtonProps = {
@@ -139,8 +140,9 @@ declare const iconButton: (props?: ({
139
140
  })) | undefined) => string;
140
141
  declare const IconButton: FC<IconButtonProps>;
141
142
 
143
+ declare const TooltipProvider: React.FC<_radix_ui_react_tooltip.TooltipProviderProps>;
142
144
  declare const Tooltip: FC<TooltipContentProps & Pick<TooltipProps, "open"> & Pick<TooltipProps, "defaultOpen"> & Pick<TooltipProps, "onOpenChange"> & {
143
145
  size?: "small" | "medium";
144
146
  }>;
145
147
 
146
- export { Alert, Button, type ButtonProps, IconButton, Tooltip };
148
+ export { Alert, Button, type ButtonProps, IconButton, Tooltip, TooltipProvider };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import React, { FC } from 'react';
2
2
  import { VariantProps } from 'cva';
3
+ import * as _radix_ui_react_tooltip from '@radix-ui/react-tooltip';
3
4
  import { TooltipContentProps, TooltipProps } from '@radix-ui/react-tooltip';
4
5
 
5
6
  type ButtonProps = {
@@ -139,8 +140,9 @@ declare const iconButton: (props?: ({
139
140
  })) | undefined) => string;
140
141
  declare const IconButton: FC<IconButtonProps>;
141
142
 
143
+ declare const TooltipProvider: React.FC<_radix_ui_react_tooltip.TooltipProviderProps>;
142
144
  declare const Tooltip: FC<TooltipContentProps & Pick<TooltipProps, "open"> & Pick<TooltipProps, "defaultOpen"> & Pick<TooltipProps, "onOpenChange"> & {
143
145
  size?: "small" | "medium";
144
146
  }>;
145
147
 
146
- export { Alert, Button, type ButtonProps, IconButton, Tooltip };
148
+ export { Alert, Button, type ButtonProps, IconButton, Tooltip, TooltipProvider };
package/dist/index.js CHANGED
@@ -33,7 +33,8 @@ __export(src_exports, {
33
33
  Alert: () => Alert,
34
34
  Button: () => Button,
35
35
  IconButton: () => IconButton,
36
- Tooltip: () => Tooltip
36
+ Tooltip: () => Tooltip,
37
+ TooltipProvider: () => TooltipProvider
37
38
  });
38
39
  module.exports = __toCommonJS(src_exports);
39
40
 
@@ -5678,8 +5679,42 @@ var [$a093c7e1ec25a057$var$createTooltipContext, $a093c7e1ec25a057$export$1c540a
5678
5679
  ]);
5679
5680
  var $a093c7e1ec25a057$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923();
5680
5681
  var $a093c7e1ec25a057$var$PROVIDER_NAME = "TooltipProvider";
5682
+ var $a093c7e1ec25a057$var$DEFAULT_DELAY_DURATION = 700;
5681
5683
  var $a093c7e1ec25a057$var$TOOLTIP_OPEN = "tooltip.open";
5682
5684
  var [$a093c7e1ec25a057$var$TooltipProviderContextProvider, $a093c7e1ec25a057$var$useTooltipProviderContext] = $a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$PROVIDER_NAME);
5685
+ var $a093c7e1ec25a057$export$f78649fb9ca566b8 = (props) => {
5686
+ const { __scopeTooltip, delayDuration = $a093c7e1ec25a057$var$DEFAULT_DELAY_DURATION, skipDelayDuration = 300, disableHoverableContent = false, children } = props;
5687
+ const [isOpenDelayed, setIsOpenDelayed] = (0, import_react21.useState)(true);
5688
+ const isPointerInTransitRef = (0, import_react21.useRef)(false);
5689
+ const skipDelayTimerRef = (0, import_react21.useRef)(0);
5690
+ (0, import_react21.useEffect)(() => {
5691
+ const skipDelayTimer = skipDelayTimerRef.current;
5692
+ return () => window.clearTimeout(skipDelayTimer);
5693
+ }, []);
5694
+ return /* @__PURE__ */ (0, import_react21.createElement)($a093c7e1ec25a057$var$TooltipProviderContextProvider, {
5695
+ scope: __scopeTooltip,
5696
+ isOpenDelayed,
5697
+ delayDuration,
5698
+ onOpen: (0, import_react21.useCallback)(() => {
5699
+ window.clearTimeout(skipDelayTimerRef.current);
5700
+ setIsOpenDelayed(false);
5701
+ }, []),
5702
+ onClose: (0, import_react21.useCallback)(() => {
5703
+ window.clearTimeout(skipDelayTimerRef.current);
5704
+ skipDelayTimerRef.current = window.setTimeout(
5705
+ () => setIsOpenDelayed(true),
5706
+ skipDelayDuration
5707
+ );
5708
+ }, [
5709
+ skipDelayDuration
5710
+ ]),
5711
+ isPointerInTransitRef,
5712
+ onPointerInTransitChange: (0, import_react21.useCallback)((inTransit) => {
5713
+ isPointerInTransitRef.current = inTransit;
5714
+ }, []),
5715
+ disableHoverableContent
5716
+ }, children);
5717
+ };
5683
5718
  var $a093c7e1ec25a057$var$TOOLTIP_NAME = "Tooltip";
5684
5719
  var [$a093c7e1ec25a057$var$TooltipContextProvider, $a093c7e1ec25a057$var$useTooltipContext] = $a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$TOOLTIP_NAME);
5685
5720
  var $a093c7e1ec25a057$export$28c660c63b792dea = (props) => {
@@ -6145,6 +6180,7 @@ function $a093c7e1ec25a057$var$getHullPresorted(points) {
6145
6180
  var $a093c7e1ec25a057$export$be92b6f5f03c0fe9 = $a093c7e1ec25a057$export$28c660c63b792dea;
6146
6181
 
6147
6182
  // src/components/tooltip.tsx
6183
+ var TooltipProvider = $a093c7e1ec25a057$export$f78649fb9ca566b8;
6148
6184
  var Tooltip = ({
6149
6185
  children,
6150
6186
  content,
@@ -6177,7 +6213,8 @@ var Tooltip = ({
6177
6213
  Alert,
6178
6214
  Button,
6179
6215
  IconButton,
6180
- Tooltip
6216
+ Tooltip,
6217
+ TooltipProvider
6181
6218
  });
6182
6219
  /*! Bundled license information:
6183
6220