@pibit.ai/cure-design-system 0.3.48 → 0.3.52

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.
Files changed (59) hide show
  1. package/dist/assets/icons/filtered-view.svg.js +4 -0
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +103 -92
  5. package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
  6. package/dist/patterns/table/TableWrapper.js +447 -447
  7. package/dist/patterns/table/TableZoomControl.d.ts +2 -2
  8. package/dist/patterns/table/TableZoomControl.d.ts.map +1 -1
  9. package/dist/patterns/table/TableZoomControl.js +124 -46
  10. package/dist/patterns/table/index.d.ts +2 -2
  11. package/dist/patterns/table/index.d.ts.map +1 -1
  12. package/dist/patterns/table/storyHelpers/mockTableViewsApi.d.ts +25 -0
  13. package/dist/patterns/table/storyHelpers/mockTableViewsApi.d.ts.map +1 -0
  14. package/dist/patterns/table/tableZoomLayout.d.ts +6 -0
  15. package/dist/patterns/table/tableZoomLayout.d.ts.map +1 -1
  16. package/dist/patterns/table/tableZoomLayout.js +39 -33
  17. package/dist/patterns/table/toolbar/SummaryFooter.d.ts +10 -3
  18. package/dist/patterns/table/toolbar/SummaryFooter.d.ts.map +1 -1
  19. package/dist/patterns/table/toolbar/SummaryFooter.js +61 -71
  20. package/dist/patterns/table/toolbar/TableToolbar.d.ts +8 -0
  21. package/dist/patterns/table/toolbar/TableToolbar.d.ts.map +1 -1
  22. package/dist/patterns/table/toolbar/TableToolbar.js +200 -159
  23. package/dist/patterns/table/toolbar/TableViewDirtyActions.d.ts +7 -0
  24. package/dist/patterns/table/toolbar/TableViewDirtyActions.d.ts.map +1 -0
  25. package/dist/patterns/table/toolbar/TableViewDirtyActions.js +39 -0
  26. package/dist/patterns/table/toolbar/TableViewsDropdown.d.ts +8 -0
  27. package/dist/patterns/table/toolbar/TableViewsDropdown.d.ts.map +1 -0
  28. package/dist/patterns/table/toolbar/TableViewsDropdown.js +171 -0
  29. package/dist/patterns/table/toolbar/index.d.ts +4 -0
  30. package/dist/patterns/table/toolbar/index.d.ts.map +1 -1
  31. package/dist/patterns/table/toolbar/tableViewSnapshot.d.ts +18 -0
  32. package/dist/patterns/table/toolbar/tableViewSnapshot.d.ts.map +1 -0
  33. package/dist/patterns/table/toolbar/tableViewSnapshot.js +168 -0
  34. package/dist/patterns/table/toolbar/tableViewSnapshot.test.d.ts +2 -0
  35. package/dist/patterns/table/toolbar/tableViewSnapshot.test.d.ts.map +1 -0
  36. package/dist/patterns/table/toolbar/tableViewTypes.d.ts +73 -0
  37. package/dist/patterns/table/toolbar/tableViewTypes.d.ts.map +1 -0
  38. package/dist/patterns/table/toolbar/tableViewTypes.js +4 -0
  39. package/dist/patterns/table/types.d.ts +24 -1
  40. package/dist/patterns/table/types.d.ts.map +1 -1
  41. package/dist/patterns/table/useFitTableToViewport.d.ts +15 -0
  42. package/dist/patterns/table/useFitTableToViewport.d.ts.map +1 -0
  43. package/dist/patterns/table/useFitTableToViewport.js +47 -0
  44. package/dist/patterns/table/useTableZoomState.d.ts +20 -0
  45. package/dist/patterns/table/useTableZoomState.d.ts.map +1 -0
  46. package/dist/patterns/table/useTableZoomState.js +30 -0
  47. package/dist/patterns/table-component/TableComponent.d.ts.map +1 -1
  48. package/dist/patterns/table-component/TableComponent.js +331 -335
  49. package/dist/primitives/dropdown/dropdown.d.ts +11 -2
  50. package/dist/primitives/dropdown/dropdown.d.ts.map +1 -1
  51. package/dist/primitives/dropdown/dropdown.js +95 -66
  52. package/dist/primitives/dropdown/dropdown.nestedOverlay.test.d.ts +2 -0
  53. package/dist/primitives/dropdown/dropdown.nestedOverlay.test.d.ts.map +1 -0
  54. package/dist/primitives/input/hint-text.js +1 -1
  55. package/dist/primitives/tooltip/tooltip.d.ts +5 -1
  56. package/dist/primitives/tooltip/tooltip.d.ts.map +1 -1
  57. package/dist/primitives/tooltip/tooltip.js +35 -33
  58. package/dist/styles/components.css +1 -1
  59. package/package.json +3 -6
@@ -13,18 +13,27 @@ interface DropdownItemProps extends AriaMenuItemProps {
13
13
  }>;
14
14
  /** If true, the item will be selected. */
15
15
  isSelected?: boolean;
16
+ /** The size of the item. */
17
+ size?: "sm" | "md";
16
18
  }
17
19
  interface DropdownMenuProps<T extends object> extends AriaMenuProps<T> {
18
20
  }
19
21
  interface DropdownPopoverProps extends AriaPopoverProps {
20
22
  }
23
+ /**
24
+ * Exported for its test only — not re-exported from index.ts, so the package's
25
+ * public surface is unchanged. This predicate is the whole point of the
26
+ * DropdownPopover wrapper, so it is worth asserting directly rather than
27
+ * through react-aria's outside-click plumbing.
28
+ */
29
+ export declare const isNestedOverlayElement: (element: Element) => boolean;
21
30
  export declare const Dropdown: {
22
31
  Root: typeof AriaMenuTrigger;
23
- Popover: (props: DropdownPopoverProps) => import("react/jsx-runtime").JSX.Element;
32
+ Popover: ({ shouldCloseOnInteractOutside, ...props }: DropdownPopoverProps) => import("react/jsx-runtime").JSX.Element;
24
33
  Menu: <T extends object>(props: DropdownMenuProps<T>) => import("react/jsx-runtime").JSX.Element;
25
34
  Section: <T extends object>(props: import('react-aria-components').MenuSectionProps<T> & React.RefAttributes<HTMLElement>) => import('react').ReactElement | null;
26
35
  SectionHeader: (props: React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>) => React.ReactElement | null;
27
- Item: ({ label, children, addon, icon: Icon, unstyled, isSelected, ...props }: DropdownItemProps) => import("react/jsx-runtime").JSX.Element;
36
+ Item: ({ label, children, addon, icon: Icon, unstyled, isSelected, size, ...props }: DropdownItemProps) => import("react/jsx-runtime").JSX.Element;
28
37
  Separator: (props: AriaSeparatorProps) => import("react/jsx-runtime").JSX.Element;
29
38
  DotsButton: (props: AriaButtonProps & RefAttributes<HTMLButtonElement>) => import("react/jsx-runtime").JSX.Element;
30
39
  };
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../src/primitives/dropdown/dropdown.tsx"],"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3
- import { Header as g, MenuSection as x, MenuTrigger as p, Button as h, Separator as y, MenuItem as m, Menu as N, Popover as b } from "react-aria-components";
4
- import { cn as i } from "../../utils/cn.js";
5
- const w = ({
1
+ import { jsx as n, jsxs as d } from "react/jsx-runtime";
2
+ import { useCallback as f } from "react";
3
+ import { DotsVertical as x, Check as g } from "@untitledui/icons";
4
+ import { Header as p, MenuSection as y, MenuTrigger as N, Button as b, Separator as h, MenuItem as c, Menu as v, Popover as w } from "react-aria-components";
5
+ import { cx as r } from "../../utils/cn.js";
6
+ const D = ({
6
7
  label: e,
7
- children: o,
8
+ children: t,
8
9
  addon: s,
9
- icon: l,
10
- unstyled: c,
11
- isSelected: a = !1,
12
- ...r
13
- }) => c ? /* @__PURE__ */ t(m, { id: e, textValue: e, ...r }) : /* @__PURE__ */ t(
14
- m,
10
+ icon: a,
11
+ unstyled: m,
12
+ isSelected: l = !1,
13
+ size: u = "sm",
14
+ ...i
15
+ }) => m ? /* @__PURE__ */ n(c, { id: e, textValue: e, ...i }) : /* @__PURE__ */ n(
16
+ c,
15
17
  {
16
- ...r,
17
- className: (n) => i(
18
+ ...i,
19
+ className: (o) => r(
18
20
  "group block cursor-pointer px-1.5 py-px outline-hidden",
19
- n.isDisabled && "cursor-not-allowed",
20
- typeof r.className == "function" ? r.className(n) : r.className
21
+ o.isDisabled && "cursor-not-allowed",
22
+ typeof i.className == "function" ? i.className(o) : i.className
21
23
  ),
22
- children: (n) => /* @__PURE__ */ d(
24
+ children: (o) => /* @__PURE__ */ d(
23
25
  "div",
24
26
  {
25
- className: i(
27
+ className: r(
26
28
  "relative flex items-center rounded-md px-2.5 py-2 outline-focus-ring transition duration-100 ease-linear",
27
- !n.isDisabled && !a && "group-hover:bg-primary_hover",
28
- n.isFocused && "bg-primary_hover",
29
- n.isFocusVisible && !a && "outline-2 -outline-offset-2",
30
- a && "bg-utility-brand-25"
29
+ !o.isDisabled && !l && "group-hover:bg-primary_hover",
30
+ o.isFocused && "bg-primary_hover",
31
+ o.isFocusVisible && !l && "outline-2 -outline-offset-2",
32
+ l && "bg-utility-brand-25"
31
33
  ),
32
34
  children: [
33
- l && /* @__PURE__ */ t(
34
- l,
35
+ a && /* @__PURE__ */ n(
36
+ a,
35
37
  {
36
38
  "aria-hidden": "true",
37
- className: i(
39
+ className: r(
38
40
  "mr-2 size-4 shrink-0 stroke-[2.25px]",
39
- n.isDisabled ? "text-fg-disabled" : "text-fg-quaternary"
41
+ o.isDisabled ? "text-fg-disabled" : "text-fg-quaternary"
40
42
  )
41
43
  }
42
44
  ),
43
- /* @__PURE__ */ t(
45
+ /* @__PURE__ */ n(
44
46
  "span",
45
47
  {
46
- className: i(
48
+ className: r(
47
49
  "grow truncate text-sm font-medium",
48
- n.isDisabled ? "text-disabled" : "text-secondary",
49
- n.isFocused && "text-secondary_hover"
50
+ o.isDisabled ? "text-disabled" : "text-secondary",
51
+ o.isFocused && "text-secondary_hover",
52
+ u === "sm" ? "text-xs" : "text-sm"
50
53
  ),
51
- children: e || (typeof o == "function" ? o(n) : o)
54
+ children: e || (typeof t == "function" ? t(o) : t)
52
55
  }
53
56
  ),
54
- a && /* @__PURE__ */ t(f, { size: 16, className: "text-brand-600" }),
55
- s && /* @__PURE__ */ t(
57
+ l && /* @__PURE__ */ n(g, { size: 16, className: "text-brand-600" }),
58
+ s && /* @__PURE__ */ n(
56
59
  "span",
57
60
  {
58
- className: i(
61
+ className: r(
59
62
  "ml-3 shrink-0 rounded px-1 py-px text-xs font-medium ring-1 ring-secondary ring-inset",
60
- n.isDisabled ? "text-disabled" : "text-quaternary"
63
+ o.isDisabled ? "text-disabled" : "text-quaternary"
61
64
  ),
62
65
  children: s
63
66
  }
@@ -66,53 +69,79 @@ const w = ({
66
69
  }
67
70
  )
68
71
  }
69
- ), D = (e) => /* @__PURE__ */ t(
70
- N,
72
+ ), E = (e) => /* @__PURE__ */ n(
73
+ v,
71
74
  {
72
75
  disallowEmptySelection: !0,
73
76
  selectionMode: "single",
74
77
  ...e,
75
- className: (o) => i(
78
+ className: (t) => r(
76
79
  "h-min overflow-y-auto py-1 outline-hidden select-none",
77
- typeof e.className == "function" ? e.className(o) : e.className
80
+ typeof e.className == "function" ? e.className(t) : e.className
78
81
  )
79
82
  }
80
- ), v = (e) => /* @__PURE__ */ t(
81
- b,
83
+ ), M = [
84
+ '[class*="react-aria-Popover"]',
85
+ '[class*="react-aria-ListBox"]',
86
+ '[class*="react-aria-Menu"]',
87
+ '[role="listbox"]',
88
+ '[role="option"]',
89
+ "[data-nested-select-overlay]"
90
+ ], S = (e) => M.some(
91
+ (t) => e.closest(t) != null
92
+ ), _ = ({
93
+ shouldCloseOnInteractOutside: e,
94
+ ...t
95
+ }) => {
96
+ const s = f(
97
+ (a) => S(a) ? !1 : (e == null ? void 0 : e(a)) ?? !0,
98
+ [e]
99
+ );
100
+ return /* @__PURE__ */ n(
101
+ w,
102
+ {
103
+ placement: "bottom left",
104
+ ...t,
105
+ shouldCloseOnInteractOutside: s,
106
+ className: (a) => r(
107
+ "max-h-max! w-62 origin-(--trigger-anchor-point) overflow-auto rounded-lg bg-primary shadow-lg ring-1 ring-secondary_alt will-change-transform",
108
+ a.isEntering && "duration-150 ease-out animate-in fade-in placement-right:slide-in-from-left-0.5 placement-top:slide-in-from-bottom-0.5 placement-bottom:slide-in-from-top-0.5",
109
+ a.isExiting && "duration-100 ease-in animate-out fade-out placement-right:slide-out-to-left-0.5 placement-top:slide-out-to-bottom-0.5 placement-bottom:slide-out-to-top-0.5",
110
+ typeof t.className == "function" ? t.className(a) : t.className
111
+ ),
112
+ children: t.children
113
+ }
114
+ );
115
+ }, k = (e) => /* @__PURE__ */ n(
116
+ h,
82
117
  {
83
- placement: "bottom left",
84
118
  ...e,
85
- className: (o) => i(
86
- "max-h-max! w-62 origin-(--trigger-anchor-point) overflow-auto rounded-lg bg-primary shadow-lg ring-1 ring-secondary_alt will-change-transform",
87
- o.isEntering && "duration-150 ease-out animate-in fade-in placement-right:slide-in-from-left-0.5 placement-top:slide-in-from-bottom-0.5 placement-bottom:slide-in-from-top-0.5",
88
- o.isExiting && "duration-100 ease-in animate-out fade-out placement-right:slide-out-to-left-0.5 placement-top:slide-out-to-bottom-0.5 placement-bottom:slide-out-to-top-0.5",
89
- typeof e.className == "function" ? e.className(o) : e.className
90
- ),
91
- children: e.children
119
+ className: r("my-1 h-px w-full bg-secondary", e.className)
92
120
  }
93
- ), M = (e) => /* @__PURE__ */ t(y, { ...e, className: i("my-1 h-px w-full bg-secondary", e.className) }), k = (e) => /* @__PURE__ */ t(
94
- h,
121
+ ), P = (e) => /* @__PURE__ */ n(
122
+ b,
95
123
  {
96
124
  ...e,
97
125
  "aria-label": "Open menu",
98
- className: (o) => i(
126
+ className: (t) => r(
99
127
  "cursor-pointer rounded-md text-fg-quaternary transition duration-100 ease-linear",
100
- (o.isPressed || o.isHovered) && "text-fg-quaternary_hover",
101
- (o.isPressed || o.isFocusVisible) && "outline-2 outline-offset-2",
102
- typeof e.className == "function" ? e.className(o) : e.className
128
+ (t.isPressed || t.isHovered) && "text-fg-quaternary_hover",
129
+ (t.isPressed || t.isFocusVisible) && "outline-2 outline-offset-2",
130
+ typeof e.className == "function" ? e.className(t) : e.className
103
131
  ),
104
- children: /* @__PURE__ */ t(u, { className: "size-5 transition-inherit-all" })
132
+ children: /* @__PURE__ */ n(x, { className: "size-5 transition-inherit-all" })
105
133
  }
106
- ), S = {
107
- Root: p,
108
- Popover: v,
109
- Menu: D,
110
- Section: x,
111
- SectionHeader: g,
112
- Item: w,
113
- Separator: M,
114
- DotsButton: k
134
+ ), H = {
135
+ Root: N,
136
+ Popover: _,
137
+ Menu: E,
138
+ Section: y,
139
+ SectionHeader: p,
140
+ Item: D,
141
+ Separator: k,
142
+ DotsButton: P
115
143
  };
116
144
  export {
117
- S as Dropdown
145
+ H as Dropdown,
146
+ S as isNestedOverlayElement
118
147
  };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dropdown.nestedOverlay.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown.nestedOverlay.test.d.ts","sourceRoot":"","sources":["../../../src/primitives/dropdown/dropdown.nestedOverlay.test.ts"],"names":[],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { cx as m } from "class-variance-authority";
2
+ import { cx as m } from "../../utils/cn.js";
3
3
  import { Text as s } from "react-aria-components";
4
4
  const i = {
5
5
  sm: "text-[11px]",
@@ -27,8 +27,12 @@ export interface TooltipProps extends AriaTooltipTriggerComponentProps, Omit<Ari
27
27
  * @default true
28
28
  */
29
29
  isHoverable?: boolean;
30
+ /**
31
+ * Optional class names for the inner tooltip content container.
32
+ */
33
+ contentClassName?: string;
30
34
  }
31
- export declare const Tooltip: ({ title, description, children, arrow, isHoverable, delay, closeDelay, trigger, isDisabled, isOpen, defaultOpen, offset, crossOffset, placement, onOpenChange, ...tooltipProps }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
35
+ export declare const Tooltip: ({ title, description, children, arrow, delay, closeDelay, trigger, isDisabled, isHoverable, contentClassName, isOpen, defaultOpen, offset, crossOffset, placement, onOpenChange, ...tooltipProps }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
32
36
  export interface TooltipTriggerProps extends AriaButtonProps {
33
37
  }
34
38
  export declare const TooltipTrigger: ({ children, className, ...buttonProps }: TooltipTriggerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/primitives/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,YAAY,IAAI,gBAAgB,EAChC,4BAA4B,IAAI,gCAAgC,EACjE,MAAM,uBAAuB,CAAC;AAS/B,MAAM,WAAW,YACf,SAAQ,gCAAgC,EAAE,IAAI,CAAC,gBAAgB,EAAE,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CAcrB,CAAC"}
@@ -1,59 +1,60 @@
1
1
  import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import { TooltipTrigger as v, Tooltip as z, OverlayArrow as B, Button as N } from "react-aria-components";
2
+ import { TooltipTrigger as z, Tooltip as B, OverlayArrow as N, Button as L } from "react-aria-components";
3
3
  import { cx as s } from "../../utils/cn.js";
4
- const A = ({
4
+ const M = ({
5
5
  title: e,
6
6
  description: t,
7
7
  children: i,
8
8
  arrow: n = !1,
9
- isHoverable: p = !0,
10
- delay: c = 300,
11
- closeDelay: d = 0,
12
- trigger: f,
13
- isDisabled: g,
14
- isOpen: h,
15
- defaultOpen: u,
16
- offset: x = 6,
17
- crossOffset: b,
9
+ delay: p = 300,
10
+ closeDelay: c = 0,
11
+ trigger: d,
12
+ isDisabled: f,
13
+ isHoverable: g = !0,
14
+ contentClassName: h,
15
+ isOpen: u,
16
+ defaultOpen: x,
17
+ offset: b = 6,
18
+ crossOffset: T,
18
19
  placement: l = "top",
19
- onOpenChange: T,
20
- ...w
20
+ onOpenChange: w,
21
+ ...y
21
22
  }) => {
22
- const y = [
23
+ const O = [
23
24
  "top left",
24
25
  "top end",
25
26
  "bottom left",
26
27
  "bottom end"
27
- ].includes(l), O = [
28
+ ].includes(l), v = [
28
29
  "top right",
29
30
  "top start",
30
31
  "bottom right",
31
32
  "bottom start"
32
33
  ].includes(l);
33
34
  return /* @__PURE__ */ m(
34
- v,
35
+ z,
35
36
  {
36
- trigger: f,
37
- delay: c,
38
- closeDelay: d,
39
- isDisabled: g,
40
- isOpen: h,
41
- defaultOpen: u,
42
- onOpenChange: T,
37
+ trigger: d,
38
+ delay: p,
39
+ closeDelay: c,
40
+ isDisabled: f,
41
+ isOpen: u,
42
+ defaultOpen: x,
43
+ onOpenChange: w,
43
44
  children: [
44
45
  i,
45
46
  /* @__PURE__ */ o(
46
- z,
47
+ B,
47
48
  {
48
- ...w,
49
- offset: x,
49
+ ...y,
50
+ offset: b,
50
51
  placement: l,
51
- crossOffset: b ?? (y ? -12 : O ? 12 : 0),
52
+ crossOffset: T ?? (O ? -12 : v ? 12 : 0),
52
53
  className: ({ isEntering: r, isExiting: a }) => s(
53
54
  r && "ease-out animate-in",
54
55
  a && "ease-in animate-out",
55
56
  !e && "hidden",
56
- !p && "pointer-events-none"
57
+ !g && "pointer-events-none"
57
58
  ),
58
59
  children: ({ isEntering: r, isExiting: a }) => /* @__PURE__ */ m(
59
60
  "div",
@@ -61,13 +62,14 @@ const A = ({
61
62
  className: s(
62
63
  "z-50 flex max-w-xs origin-(--trigger-anchor-point) flex-col items-start gap-1 rounded-lg bg-primary-solid px-3 shadow-lg will-change-transform",
63
64
  t ? "py-3" : "py-2",
65
+ h,
64
66
  r && "ease-out animate-in fade-in zoom-in-95 in-placement-left:slide-in-from-right-0.5 in-placement-right:slide-in-from-left-0.5 in-placement-top:slide-in-from-bottom-0.5 in-placement-bottom:slide-in-from-top-0.5",
65
67
  a && "ease-in animate-out fade-out zoom-out-95 in-placement-left:slide-out-to-right-0.5 in-placement-right:slide-out-to-left-0.5 in-placement-top:slide-out-to-bottom-0.5 in-placement-bottom:slide-out-to-top-0.5"
66
68
  ),
67
69
  children: [
68
70
  /* @__PURE__ */ o("span", { className: "text-xs font-semibold text-white", children: e }),
69
71
  t && /* @__PURE__ */ o("span", { className: "text-xs font-medium text-tooltip-supporting-text", children: t }),
70
- n && /* @__PURE__ */ o(B, { children: /* @__PURE__ */ o(
72
+ n && /* @__PURE__ */ o(N, { children: /* @__PURE__ */ o(
71
73
  "svg",
72
74
  {
73
75
  viewBox: "0 0 100 100",
@@ -83,12 +85,12 @@ const A = ({
83
85
  ]
84
86
  }
85
87
  );
86
- }, M = ({
88
+ }, Q = ({
87
89
  children: e,
88
90
  className: t,
89
91
  ...i
90
92
  }) => /* @__PURE__ */ o(
91
- N,
93
+ L,
92
94
  {
93
95
  ...i,
94
96
  className: (n) => s(
@@ -99,6 +101,6 @@ const A = ({
99
101
  }
100
102
  );
101
103
  export {
102
- A as Tooltip,
103
- M as TooltipTrigger
104
+ M as Tooltip,
105
+ Q as TooltipTrigger
104
106
  };