@janbox/storefront-ui 4.0.15 → 4.0.17

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,2 +1,2 @@
1
1
  import { TooltipProps } from './types';
2
- export declare function Tooltip({ children, defaultOpen, placement, open, onOpenChange, content, contentWidth, enable, handleClose, arrowProps, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function Tooltip({ children, defaultOpen, placement, open, onOpenChange, content, contentWidth, enable, handleClose, arrowProps, sx, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
@@ -3,10 +3,11 @@ import { useRef, cloneElement } from "react";
3
3
  import { useFloating, autoUpdate, offset, flip, shift, arrow, size, useHover, safePolygon, useFocus, useDismiss, useRole, useInteractions, useMergeRefs, FloatingPortal, FloatingArrow } from "@floating-ui/react";
4
4
  import { isUndefined, get } from "lodash-es";
5
5
  import { useControllableState } from "../../hooks/use-controllable-state.js";
6
- import { getColorVar } from "../../theme/palette.js";
7
- import { getTypographyVar } from "../../theme/typography.js";
6
+ import { FLOATING_Z_INDEX } from "../../theme/index.js";
8
7
  import { usePortalContainer } from "../../theme/provider.js";
9
8
  import { Primitive } from "../primitive/primitive.js";
9
+ import { getColorVar } from "../../theme/palette.js";
10
+ import { getTypographyVar } from "../../theme/typography.js";
10
11
  function Tooltip({
11
12
  children,
12
13
  defaultOpen = false,
@@ -17,7 +18,8 @@ function Tooltip({
17
18
  contentWidth,
18
19
  enable = true,
19
20
  handleClose,
20
- arrowProps
21
+ arrowProps,
22
+ sx
21
23
  }) {
22
24
  const [visible, setVisible] = useControllableState({
23
25
  defaultValue: defaultOpen,
@@ -88,6 +90,7 @@ function Tooltip({
88
90
  },
89
91
  ref: refs.setFloating,
90
92
  sx: {
93
+ zIndex: FLOATING_Z_INDEX,
91
94
  borderRadius: 8,
92
95
  backgroundColor: getColorVar("neutral.600"),
93
96
  paddingLeft: 12,
@@ -96,7 +99,8 @@ function Tooltip({
96
99
  paddingBottom: 8,
97
100
  fontSize: getTypographyVar("sm").fontSize,
98
101
  lineHeight: getTypographyVar("sm").lineHeight,
99
- color: "white"
102
+ color: "white",
103
+ ...sx
100
104
  },
101
105
  ...getFloatingProps(),
102
106
  children: [
@@ -1,10 +1,11 @@
1
1
  import { ReactElement, ReactNode, Ref } from 'react';
2
2
  import { Placement, UseFloatingOptions, UseHoverProps, FloatingArrowProps } from '@floating-ui/react';
3
+ import { PropsWithSx } from '../../types';
3
4
  export type TooltipProps<T extends {
4
5
  ref?: Ref<Element>;
5
6
  } = {
6
7
  ref?: Ref<Element>;
7
- }> = {
8
+ }> = PropsWithSx<{
8
9
  defaultOpen?: boolean;
9
10
  placement?: Placement;
10
11
  open?: boolean;
@@ -16,4 +17,4 @@ export type TooltipProps<T extends {
16
17
  handleClose?: UseHoverProps['handleClose'] | 'safe-polygon';
17
18
  arrowProps?: Partial<FloatingArrowProps>;
18
19
  children: ReactElement<T>;
19
- };
20
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@janbox/storefront-ui",
3
- "version": "4.0.15",
3
+ "version": "4.0.17",
4
4
  "description": "Storefront UI component library for Janbox",
5
5
  "author": "Janbox",
6
6
  "keywords": [
@@ -55,7 +55,7 @@
55
55
  "peerDependencies": {
56
56
  "react": ">=19.0.0",
57
57
  "react-dom": ">=19.0.0",
58
- "react-router": ">=7.0.0"
58
+ "react-router": "^7 || ^8"
59
59
  },
60
60
  "dependencies": {
61
61
  "@emotion/cache": "11.14.0",