@povio/ui 2.1.6 → 2.1.8

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.
@@ -7,5 +7,6 @@ export interface SplitButtonProps extends ButtonVariantProps, Omit<AriaButtonPro
7
7
  labelRight: string;
8
8
  link?: LinkNavigationProps;
9
9
  items: MenuItem[];
10
+ isLoading?: boolean;
10
11
  }
11
- export declare const SplitButton: ({ variant, color, width, size, label, labelRight, link, items, className, ...props }: SplitButtonProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const SplitButton: ({ variant, color, width, size, label, labelRight, link, items, className, isLoading, ...props }: SplitButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -14,6 +14,7 @@ const SplitButton = ({
14
14
  link,
15
15
  items,
16
16
  className,
17
+ isLoading,
17
18
  ...props
18
19
  }) => {
19
20
  return /* @__PURE__ */ jsxs(
@@ -31,8 +32,9 @@ const SplitButton = ({
31
32
  variant,
32
33
  color,
33
34
  link,
34
- className: clsx("!rounded-r-none! border-r border-solid", className),
35
+ className: clsx("rounded-r-none! border-r border-solid", className),
35
36
  "data-separator": "",
37
+ isLoading,
36
38
  children: label
37
39
  }
38
40
  ),
@@ -47,7 +49,8 @@ const SplitButton = ({
47
49
  color,
48
50
  label: labelRight,
49
51
  icon: ChevronDownIcon,
50
- className: "rounded-l-none! border-l-0!"
52
+ className: "rounded-l-none! border-l-0!",
53
+ isDisabled: props.isDisabled || isLoading
51
54
  }
52
55
  ),
53
56
  items
@@ -3,6 +3,8 @@ interface TooltipWrapperProps {
3
3
  error?: string;
4
4
  as?: TextInputProps["as"];
5
5
  children: React.ReactNode;
6
+ triggerClassName?: string;
7
+ triggerTabIndex?: number;
6
8
  }
7
9
  export declare const TooltipWrapper: (props: TooltipWrapperProps) => string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | null | undefined;
8
10
  export {};
@@ -12,7 +12,9 @@ const TooltipWrapper = (props) => {
12
12
  color: "error",
13
13
  hidden: !props.error,
14
14
  isNonInteractiveTrigger: true,
15
- children: /* @__PURE__ */ jsx("div", { children: props.children })
15
+ triggerClassName: props.triggerClassName,
16
+ triggerTabIndex: props.triggerTabIndex,
17
+ children: /* @__PURE__ */ jsx("div", { tabIndex: -1, children: props.children })
16
18
  }
17
19
  );
18
20
  };
@@ -8,5 +8,6 @@ export interface TooltipProps extends PropsWithChildren<AriaTooltipProps>, Toolt
8
8
  closeDelay?: number;
9
9
  isNonInteractiveTrigger?: boolean;
10
10
  triggerClassName?: string;
11
+ triggerTabIndex?: number;
11
12
  }
12
- export declare const Tooltip: ({ children, text, isDisabled, delay, closeDelay, color, isNonInteractiveTrigger, triggerClassName, ...tooltipProps }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const Tooltip: ({ children, text, isDisabled, delay, closeDelay, color, isNonInteractiveTrigger, triggerClassName, triggerTabIndex, ...tooltipProps }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
@@ -4,10 +4,14 @@ import { useFocusable } from "react-aria";
4
4
  import { TooltipTrigger, Tooltip as Tooltip$1, OverlayArrow } from "react-aria-components";
5
5
  import { PointerHorizontalIcon } from "../../../assets/icons/PointerHorizontal.js";
6
6
  import { PointerVerticalIcon } from "../../../assets/icons/PointerVertical.js";
7
- import { tooltipCva, tooltipTextCva, tooltipPointerHorizontalCva, tooltipPointerVerticalCva } from "./tooltip.cva.js";
7
+ import { tooltipCva, tooltipPointerHorizontalCva, tooltipPointerVerticalCva, tooltipTextCva } from "./tooltip.cva.js";
8
8
  import { Typography } from "../../text/Typography/Typography.js";
9
9
  import { UIStyle } from "../../../config/uiStyle.context.js";
10
- const CustomTrigger = ({ children, className }) => {
10
+ const CustomTrigger = ({
11
+ children,
12
+ className,
13
+ tabIndex
14
+ }) => {
11
15
  const ref = useRef(null);
12
16
  const { focusableProps } = useFocusable({}, ref);
13
17
  return /* @__PURE__ */ jsx(
@@ -15,7 +19,7 @@ const CustomTrigger = ({ children, className }) => {
15
19
  {
16
20
  ref,
17
21
  ...focusableProps,
18
- tabIndex: 0,
22
+ tabIndex: tabIndex ?? 0,
19
23
  className,
20
24
  children
21
25
  }
@@ -30,10 +34,13 @@ const Tooltip = ({
30
34
  color,
31
35
  isNonInteractiveTrigger,
32
36
  triggerClassName,
37
+ triggerTabIndex,
33
38
  ...tooltipProps
34
39
  }) => {
35
40
  const uiStyle = UIStyle.useConfig();
36
41
  const tooltipCva$1 = uiStyle?.tooltip?.cva ?? tooltipCva;
42
+ const tooltipPointerHorizontalCva$1 = uiStyle?.tooltip?.pointerHorizontalCva ?? tooltipPointerHorizontalCva;
43
+ const tooltipPointerVerticalCva$1 = uiStyle?.tooltip?.pointerVerticalCva ?? tooltipPointerVerticalCva;
37
44
  const tooltipTextCva$1 = uiStyle?.tooltip?.textCva ?? tooltipTextCva;
38
45
  const Trigger = isNonInteractiveTrigger ? CustomTrigger : Fragment;
39
46
  return /* @__PURE__ */ jsxs(
@@ -43,15 +50,16 @@ const Tooltip = ({
43
50
  closeDelay: closeDelay ?? 0,
44
51
  isDisabled,
45
52
  children: [
46
- /* @__PURE__ */ jsx(
53
+ isNonInteractiveTrigger ? /* @__PURE__ */ jsx(
47
54
  Trigger,
48
55
  {
49
56
  ...isNonInteractiveTrigger && {
50
57
  className: triggerClassName
51
58
  },
59
+ tabIndex: triggerTabIndex,
52
60
  children
53
61
  }
54
- ),
62
+ ) : /* @__PURE__ */ jsx(Trigger, { children }),
55
63
  /* @__PURE__ */ jsxs(
56
64
  Tooltip$1,
57
65
  {
@@ -60,8 +68,8 @@ const Tooltip = ({
60
68
  offset: 13,
61
69
  children: [
62
70
  /* @__PURE__ */ jsxs(OverlayArrow, { children: [
63
- /* @__PURE__ */ jsx(PointerHorizontalIcon, { className: tooltipPointerHorizontalCva({ color }) }),
64
- /* @__PURE__ */ jsx(PointerVerticalIcon, { className: tooltipPointerVerticalCva({ color }) })
71
+ /* @__PURE__ */ jsx(PointerHorizontalIcon, { className: tooltipPointerHorizontalCva$1({ color }) }),
72
+ /* @__PURE__ */ jsx(PointerVerticalIcon, { className: tooltipPointerVerticalCva$1({ color }) })
65
73
  ] }),
66
74
  /* @__PURE__ */ jsx(
67
75
  Typography,
@@ -7,7 +7,7 @@ import { RadioVariantProps } from '../components/inputs/RadioGroup/radio.cva';
7
7
  import { InputBaseProps, InputSideProps, InputSizeProps } from '../components/inputs/shared/input.cva';
8
8
  import { LabelBaseProps } from '../components/inputs/shared/label.cva';
9
9
  import { ToggleVariantProps } from '../components/inputs/Toggle/toggle.cva';
10
- import { TooltipTextVariantProps, TooltipVariantProps } from '../components/overlays/Tooltip/tooltip.cva';
10
+ import { TooltipPointerHorizontalVariantProps, TooltipPointerVerticalVariantProps, TooltipTextVariantProps, TooltipVariantProps } from '../components/overlays/Tooltip/tooltip.cva';
11
11
  import { AlertVariantProps } from '../components/status/Alert/alert.cva';
12
12
  import { ToastVariantProps } from '../components/status/Toast/toast.cva';
13
13
  import { TableDataVariantProps, TableHeadDataVariantProps, TableHeadRowVariantProps, TableRowVariantProps } from '../components/table/table.cva';
@@ -78,6 +78,8 @@ export declare namespace UIStyle {
78
78
  };
79
79
  tooltip: {
80
80
  cva?: Cva<TooltipVariantProps>;
81
+ pointerHorizontalCva?: Cva<TooltipPointerHorizontalVariantProps>;
82
+ pointerVerticalCva?: Cva<TooltipPointerVerticalVariantProps>;
81
83
  textCva?: Cva<TooltipTextVariantProps>;
82
84
  };
83
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "2.1.6",
3
+ "version": "2.1.8",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",