@orfium/ictinus 5.41.2 → 5.41.4

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,9 +1,9 @@
1
1
 
2
- > @orfium/ictinus@5.41.2 build /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
2
+ > @orfium/ictinus@5.41.4 build /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
3
3
  > pnpm build:main && pnpm build:codemods && pnpm build:vanilla
4
4
 
5
5
 
6
- > @orfium/ictinus@5.41.2 build:main /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
6
+ > @orfium/ictinus@5.41.4 build:main /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
7
7
  > vite build --mode production
8
8
 
9
9
  production /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
@@ -133,9 +133,6 @@ computing gzip size...
133
133
  dist/_virtual/treeRole.js  0.04 kB │ gzip: 0.06 kB
134
134
  dist/_virtual/treegridRole.js  0.04 kB │ gzip: 0.06 kB
135
135
  dist/_virtual/treeitemRole.js  0.04 kB │ gzip: 0.06 kB
136
- dist/_virtual/graphicsDocumentRole.js  0.04 kB │ gzip: 0.06 kB
137
- dist/_virtual/graphicsObjectRole.js  0.04 kB │ gzip: 0.06 kB
138
- dist/_virtual/graphicsSymbolRole.js  0.04 kB │ gzip: 0.06 kB
139
136
  dist/_virtual/docAbstractRole.js  0.04 kB │ gzip: 0.06 kB
140
137
  dist/_virtual/docAcknowledgmentsRole.js  0.04 kB │ gzip: 0.06 kB
141
138
  dist/_virtual/docAfterwordRole.js  0.04 kB │ gzip: 0.06 kB
@@ -175,6 +172,9 @@ computing gzip size...
175
172
  dist/_virtual/docSubtitleRole.js  0.04 kB │ gzip: 0.06 kB
176
173
  dist/_virtual/docTipRole.js  0.04 kB │ gzip: 0.06 kB
177
174
  dist/_virtual/docTocRole.js  0.04 kB │ gzip: 0.06 kB
175
+ dist/_virtual/graphicsDocumentRole.js  0.04 kB │ gzip: 0.06 kB
176
+ dist/_virtual/graphicsObjectRole.js  0.04 kB │ gzip: 0.06 kB
177
+ dist/_virtual/graphicsSymbolRole.js  0.04 kB │ gzip: 0.06 kB
178
178
  dist/_virtual/__vite-browser-external.js  0.04 kB │ gzip: 0.06 kB
179
179
  dist/_virtual/lz-string2.js  0.05 kB │ gzip: 0.07 kB
180
180
  dist/_virtual/index5.js  0.05 kB │ gzip: 0.07 kB
@@ -451,8 +451,8 @@ computing gzip size...
451
451
  dist/node_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/alertdialogRole.js  0.78 kB │ gzip: 0.43 kB
452
452
  dist/components/Table/components/TH/components/SortingButton/SortingButton.js  0.79 kB │ gzip: 0.46 kB
453
453
  dist/node_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/switchRole.js  0.79 kB │ gzip: 0.44 kB
454
- dist/components/Chart/LineChart/components/CustomTooltip/CustomTooltip.js  0.79 kB │ gzip: 0.39 kB
455
454
  dist/components/Icon/assets/musicBusiness/license.svg.js  0.79 kB │ gzip: 0.47 kB
455
+ dist/components/Chart/LineChart/components/CustomTooltip/CustomTooltip.js  0.79 kB │ gzip: 0.39 kB
456
456
  dist/node_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/toolbarRole.js  0.79 kB │ gzip: 0.44 kB
457
457
  dist/components/NumberField/components/Stepper/Stepper.style.js  0.79 kB │ gzip: 0.48 kB
458
458
  dist/components/IconButton/IconButton.js  0.79 kB │ gzip: 0.46 kB
@@ -516,8 +516,8 @@ computing gzip size...
516
516
  dist/components/Search/StatefulSearch.js  0.89 kB │ gzip: 0.48 kB
517
517
  dist/components/Chart/BarChart/components/CustomTooltip/CustomTooltip.style.js  0.89 kB │ gzip: 0.45 kB
518
518
  dist/node_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/dpub/docQnaRole.js  0.90 kB │ gzip: 0.47 kB
519
- dist/node_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/menuitemcheckboxRole.js  0.90 kB │ gzip: 0.47 kB
520
519
  dist/components/Filter/components/FilterMenu/components/Options/Options.style.js  0.90 kB │ gzip: 0.49 kB
520
+ dist/node_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/menuitemcheckboxRole.js  0.90 kB │ gzip: 0.47 kB
521
521
  dist/node_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/dpub/docCreditRole.js  0.90 kB │ gzip: 0.47 kB
522
522
  dist/node_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/searchboxRole.js  0.90 kB │ gzip: 0.47 kB
523
523
  dist/components/Icon/assets/musicBusiness/recording.svg.js  0.90 kB │ gzip: 0.53 kB
@@ -590,8 +590,8 @@ computing gzip size...
590
590
  dist/node_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/listitemRole.js  1.00 kB │ gzip: 0.50 kB
591
591
  dist/node_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/columnheaderRole.js  1.01 kB │ gzip: 0.49 kB
592
592
  dist/hooks/useFieldUtils.js  1.01 kB │ gzip: 0.59 kB
593
- dist/components/TopAppBar/TopAppBar.style.js  1.01 kB │ gzip: 0.47 kB
594
593
  dist/components/Icon/assets/generic/keyword.svg.js  1.01 kB │ gzip: 0.55 kB
594
+ dist/components/TopAppBar/TopAppBar.style.js  1.01 kB │ gzip: 0.47 kB
595
595
  dist/components/Icon/assets/toggledActions/freeze.svg.js  1.02 kB │ gzip: 0.52 kB
596
596
  dist/components/Notification/NotificationVisual/NotificationVisual.js  1.03 kB │ gzip: 0.47 kB
597
597
  dist/components/Icon/assets/audioControls/resume.svg.js  1.03 kB │ gzip: 0.53 kB
@@ -609,8 +609,8 @@ computing gzip size...
609
609
  dist/components/Filter/components/FilterMenu/FilterMenu.js  1.05 kB │ gzip: 0.50 kB
610
610
  dist/node_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/optionRole.js  1.06 kB │ gzip: 0.49 kB
611
611
  dist/node_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/graphics/graphicsDocumentRole.js  1.07 kB │ gzip: 0.50 kB
612
- dist/components/Tooltip/Tooltip.style.js  1.07 kB │ gzip: 0.57 kB
613
612
  dist/components/Icon/assets/toggledActions/flagOff.svg.js  1.07 kB │ gzip: 0.61 kB
613
+ dist/components/Tooltip/Tooltip.style.js  1.07 kB │ gzip: 0.57 kB
614
614
  dist/node_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/imgRole.js  1.07 kB │ gzip: 0.47 kB
615
615
  dist/components/Icon/assets/navigation/arrowDown.svg.js  1.07 kB │ gzip: 0.60 kB
616
616
  dist/components/Icon/assets/navigation/arrowRight.svg.js  1.07 kB │ gzip: 0.60 kB
@@ -674,8 +674,8 @@ computing gzip size...
674
674
  dist/components/Notification/subcomponents/CompactNotification/CompactNotification.style.js  1.32 kB │ gzip: 0.55 kB
675
675
  dist/components/Notification/Snackbar/Snackbar.style.js  1.32 kB │ gzip: 0.62 kB
676
676
  dist/components/Icon/assets/toggledActions/pair.svg.js  1.33 kB │ gzip: 0.68 kB
677
- dist/components/Notification/Notification.style.js  1.33 kB │ gzip: 0.61 kB
678
677
  dist/components/DropdownButton/DropdownButton.style.js  1.33 kB │ gzip: 0.60 kB
678
+ dist/components/Notification/Notification.style.js  1.33 kB │ gzip: 0.61 kB
679
679
  dist/components/Icon/assets/generic/mail.svg.js  1.33 kB │ gzip: 0.71 kB
680
680
  dist/components/TextInputBase/TextInputBase.js  1.33 kB │ gzip: 0.63 kB
681
681
  dist/node_modules/is-regex/index.js  1.33 kB │ gzip: 0.57 kB
@@ -904,11 +904,11 @@ computing gzip size...
904
904
  dist/node_modules/object-inspect/index.js 12.77 kB │ gzip: 3.79 kB
905
905
  dist/index.js 13.21 kB │ gzip: 3.15 kB
906
906
  dist/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/@testing-library/dom.esm.js 55.14 kB │ gzip: 13.99 kB
907
- [vite:dts] Declaration files built in 13760ms.
907
+ [vite:dts] Declaration files built in 12487ms.
908
908
 
909
- ✓ built in 18.73s
909
+ ✓ built in 17.21s
910
910
 
911
- > @orfium/ictinus@5.41.2 build:codemods /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
911
+ > @orfium/ictinus@5.41.4 build:codemods /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
912
912
  > vite build --config vite.codemods.config.ts
913
913
 
914
914
  vite v7.1.6 building for production...
@@ -941,16 +941,16 @@ computing gzip size...
941
941
  dist/codemods/drawerCodemod.cjs 1.07 kB │ gzip: 0.42 kB
942
942
  dist/codemods/unchangedIconsCodemod.cjs 1.12 kB │ gzip: 0.56 kB
943
943
  dist/codemods/globalsCodemod.cjs 7.12 kB │ gzip: 1.12 kB
944
- [vite:dts] Declaration files built in 989ms.
944
+ [vite:dts] Declaration files built in 967ms.
945
945
 
946
- ✓ built in 1.18s
946
+ ✓ built in 1.15s
947
947
 
948
- > @orfium/ictinus@5.41.2 build:vanilla /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
948
+ > @orfium/ictinus@5.41.4 build:vanilla /home/runner/work/orfium-ictinus/orfium-ictinus/packages/ictinus
949
949
  > rm -rf dist/vanilla && NODE_ENV=production rollup -c
950
950
 
951
951
  
952
952
  ./src/vanilla/index.ts → dist/vanilla...
953
- created dist/vanilla in 945ms
953
+ created dist/vanilla in 1s
954
954
  
955
955
  ./src/vanilla/index.ts → dist/vanilla...
956
- created dist/vanilla in 4.7s
956
+ created dist/vanilla in 4.8s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @orfium/ictinus
2
2
 
3
+ ## 5.41.4
4
+
5
+ ### Patch Changes
6
+
7
+ - cc639ea: extend box props in tooltip content
8
+
9
+ ## 5.41.3
10
+
11
+ ### Patch Changes
12
+
13
+ - d6aba99: react aria tooltip
14
+
3
15
  ## 5.41.2
4
16
 
5
17
  ### Patch Changes
@@ -0,0 +1,20 @@
1
+ import { RecipeVariants } from '@vanilla-extract/recipes';
2
+ export declare const tooltip: import('@vanilla-extract/recipes').RuntimeFn<{
3
+ inverse: {
4
+ true: string;
5
+ false: string;
6
+ };
7
+ }>;
8
+ export declare const trigger: string;
9
+ export declare const arrow: import('@vanilla-extract/recipes').RuntimeFn<{
10
+ [x: string]: {
11
+ [x: string]: string | import('@vanilla-extract/css').ComplexStyleRule;
12
+ };
13
+ }>;
14
+ export declare const arrowInverse: import('@vanilla-extract/recipes').RuntimeFn<{
15
+ [x: string]: {
16
+ [x: string]: string | import('@vanilla-extract/css').ComplexStyleRule;
17
+ };
18
+ }>;
19
+ export declare const arrowInverseBorder: string;
20
+ export type TooltipVariants = RecipeVariants<typeof tooltip>;
@@ -0,0 +1,29 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ import { TooltipProps as TooltipPrimitiveProps, Focusable, TooltipTrigger as TooltipTriggerPrimitive } from 'react-aria-components';
3
+ import { ExtendProps } from '../../utils/ExtendProps';
4
+ import { BoxProps } from '../Box';
5
+ import * as styles from './Tooltip.css';
6
+ type TooltipProps = ComponentProps<typeof TooltipTriggerPrimitive> & {
7
+ /**
8
+ * Only show the tooltip when children are partially hidden due to text overflow.
9
+ */
10
+ auto?: boolean;
11
+ };
12
+ declare const Tooltip: {
13
+ ({ delay, auto, defaultOpen, onOpenChange, isOpen: openProp, ...props }: TooltipProps): import("@emotion/react/jsx-runtime").JSX.Element;
14
+ displayName: string;
15
+ };
16
+ type TooltipContentProps = Omit<TooltipPrimitiveProps, 'children'> & ExtendProps<BoxProps, NonNullable<styles.TooltipVariants>> & {
17
+ showArrow?: boolean;
18
+ children?: ReactNode;
19
+ };
20
+ declare const TooltipContent: {
21
+ ({ offset, inverse, showArrow, children, className, ...props }: TooltipContentProps): import("@emotion/react/jsx-runtime").JSX.Element;
22
+ displayName: string;
23
+ };
24
+ declare function TooltipTrigger({ ...props }: ComponentProps<typeof Focusable>): import("@emotion/react/jsx-runtime").JSX.Element;
25
+ declare namespace TooltipTrigger {
26
+ var displayName: string;
27
+ }
28
+ export { Tooltip, TooltipContent, TooltipTrigger };
29
+ export type { TooltipContentProps, TooltipProps };
@@ -0,0 +1 @@
1
+ export * from './Tooltip';
@@ -2,3 +2,4 @@ export * from './Box';
2
2
  export * from './Table';
3
3
  export * from './Text';
4
4
  export * from './ThemeProvider';
5
+ export * from './Tooltip';
@@ -0,0 +1,12 @@
1
+ import './../assets/src/layers/layers.css.ts.vanilla-CBkaYCBT.css';
2
+ import './../assets/src/vanilla-extract/global.css.ts.vanilla-t__QdzLU.css';
3
+ import './../assets/src/sprinkles/properties.css.ts.vanilla-Ckyezauv.css';
4
+ import './../assets/src/vanilla/Tooltip/Tooltip.css.ts.vanilla-nRPDcOsw.css';
5
+ import { createRuntimeFn } from '@vanilla-extract/recipes/createRuntimeFn';
6
+
7
+ var arrow = createRuntimeFn({defaultClassName:'_1gov5q56',variantClassNames:{},defaultVariants:{},compoundVariants:[]});
8
+ var arrowInverse = createRuntimeFn({defaultClassName:'_1gov5q58',variantClassNames:{},defaultVariants:{},compoundVariants:[]});
9
+ var arrowInverseBorder = '_1gov5q5a';
10
+ var tooltip = createRuntimeFn({defaultClassName:'_146hxcf13o _146hxcf2c _146hxcfk8 _146hxcf1gh _146hxcf1j1 _1gov5q50',variantClassNames:{inverse:{true:'_146hxcf1hp _146hxcf1gc _146hxcf1hj _146hxcf1hm _146hxcf1kw _146hxcf21c _146hxcf1uc _146hxcf1hu',false:'_146hxcf1l0 _146hxcf224'}},defaultVariants:{},compoundVariants:[]});
11
+
12
+ export { arrow, arrowInverse, arrowInverseBorder, tooltip };
@@ -0,0 +1,91 @@
1
+ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
2
+ import { useControllableState } from '@radix-ui/react-use-controllable-state';
3
+ import { createContext, useRef, useContext } from 'react';
4
+ import { TooltipTrigger as TooltipTrigger$1, Tooltip as Tooltip$1, OverlayArrow, Focusable } from 'react-aria-components';
5
+ import { cn } from '../src/utils/cn.js';
6
+ import { Box } from '../Box/Box.js';
7
+ import { extractBoxProps } from '../Box/extractBoxProps.js';
8
+ import { arrowInverse, arrowInverseBorder, arrow, tooltip } from './Tooltip-css.js';
9
+
10
+ const TooltipContext = createContext({ triggerRef: null });
11
+ const Tooltip = ({
12
+ delay = 500,
13
+ auto = false,
14
+ defaultOpen = false,
15
+ onOpenChange,
16
+ isOpen: openProp,
17
+ ...props
18
+ }) => {
19
+ const triggerRef = useRef(null);
20
+ const [open, setOpen] = useControllableState({
21
+ caller: "Tooltip",
22
+ defaultProp: defaultOpen,
23
+ onChange: onOpenChange,
24
+ prop: openProp
25
+ });
26
+ return /* @__PURE__ */ jsx(TooltipContext.Provider, { value: { triggerRef }, children: /* @__PURE__ */ jsx(
27
+ TooltipTrigger$1,
28
+ {
29
+ delay,
30
+ defaultOpen: auto ? open : defaultOpen,
31
+ isDisabled: auto && openProp === void 0 ? void 0 : props.isDisabled,
32
+ isOpen: auto ? open : openProp,
33
+ onOpenChange: (isOpen) => {
34
+ if (auto && isOpen && triggerRef.current && !hasTruncatedContent(triggerRef.current)) {
35
+ return;
36
+ }
37
+ setOpen(isOpen);
38
+ },
39
+ ...props
40
+ }
41
+ ) });
42
+ };
43
+ Tooltip.displayName = "Tooltip";
44
+ const TooltipContent = ({
45
+ offset = 8,
46
+ inverse = false,
47
+ showArrow = true,
48
+ children,
49
+ className,
50
+ ...props
51
+ }) => {
52
+ const { boxProps, restProps } = extractBoxProps(props);
53
+ return /* @__PURE__ */ jsx(Box, { asChild: true, className: cn(tooltip({ inverse }), className), ...boxProps, children: /* @__PURE__ */ jsxs(Tooltip$1, { ...restProps, offset, children: [
54
+ showArrow && /* @__PURE__ */ jsx(OverlayArrow, { children: inverse ? /* @__PURE__ */ jsxs("svg", { width: 18, height: 8, viewBox: "0 0 18 8", className: arrowInverse(), children: [
55
+ /* @__PURE__ */ jsx("path", { d: "M9.00744 6.52304L1.6397 0.000488281L16.3752 0.000489658L9.00744 6.52304Z" }),
56
+ /* @__PURE__ */ jsx(
57
+ "path",
58
+ {
59
+ d: "M9.00337 6.51095L16.3588 0.00158653H18.0034L9.00337 8.00049L0.00337219 0.00158653L1.6397 0.000488281L9.00337 6.51095Z",
60
+ className: arrowInverseBorder
61
+ }
62
+ )
63
+ ] }) : /* @__PURE__ */ jsx("svg", { width: 15, height: 6, viewBox: "0 0 15 6", className: arrow(), children: /* @__PURE__ */ jsx("path", { d: "M7.5 6L0.500001 -1.22392e-06L14.5 0L7.5 6Z" }) }) }),
64
+ children
65
+ ] }) });
66
+ };
67
+ TooltipContent.displayName = "TooltipContent";
68
+ function TooltipTrigger({ ...props }) {
69
+ const { triggerRef } = useContext(TooltipContext);
70
+ return /* @__PURE__ */ jsx(Focusable, { ref: triggerRef, "data-slot": "tooltip-trigger", ...props });
71
+ }
72
+ TooltipTrigger.displayName = "TooltipTrigger";
73
+ const hasTruncatedContent = (element) => {
74
+ let truncated = false;
75
+ const elements = [element];
76
+ while (!truncated && elements.length) {
77
+ const element2 = elements.shift();
78
+ if (!(element2 instanceof HTMLElement)) {
79
+ continue;
80
+ }
81
+ const { offsetHeight, offsetWidth, scrollHeight, scrollWidth } = element2;
82
+ if (offsetWidth < scrollWidth || offsetHeight < scrollHeight) {
83
+ truncated = true;
84
+ break;
85
+ }
86
+ elements.push(...element2.children);
87
+ }
88
+ return truncated;
89
+ };
90
+
91
+ export { Tooltip, TooltipContent, TooltipTrigger };
@@ -0,0 +1,39 @@
1
+ @layer ictinus._16quzhu0;
2
+ @layer ictinus._16quzhu0 {
3
+ ._1gov5q50 {
4
+ transform: translate3d(0, 0, 0);
5
+ transform-origin: var(--trigger-anchor-point);
6
+ }
7
+ ._1gov5q54 {
8
+ background: transparent;
9
+ }
10
+ ._1gov5q56 {
11
+ display: block;
12
+ fill: var(--ictinus-color-background-inverted);
13
+ }
14
+ [data-placement=bottom] ._1gov5q56 {
15
+ transform: rotate(180deg);
16
+ }
17
+ [data-placement=right] ._1gov5q56 {
18
+ transform: rotate(90deg) translateY(-5px);
19
+ }
20
+ [data-placement=left] ._1gov5q56 {
21
+ transform: rotate(-90deg) translateY(-5px);
22
+ }
23
+ ._1gov5q58 {
24
+ display: block;
25
+ fill: var(--ictinus-color-background-alt);
26
+ }
27
+ [data-placement=bottom] ._1gov5q58 {
28
+ transform: rotate(180deg);
29
+ }
30
+ [data-placement=right] ._1gov5q58 {
31
+ transform: rotate(90deg) translateY(-5px);
32
+ }
33
+ [data-placement=left] ._1gov5q58 {
34
+ transform: rotate(-90deg) translateY(-5px);
35
+ }
36
+ ._1gov5q5a {
37
+ fill: var(--ictinus-color-border-color-decorative-default);
38
+ }
39
+ }
@@ -1,8 +1,9 @@
1
1
  import * as react from 'react';
2
- import { ElementType, ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import { ElementType, ComponentPropsWithoutRef, ReactNode, ComponentProps } from 'react';
3
3
  import * as _vanilla_extract_recipes from '@vanilla-extract/recipes';
4
4
  import { RecipeVariants } from '@vanilla-extract/recipes';
5
5
  import * as _emotion_react_jsx_runtime from '@emotion/react/jsx-runtime';
6
+ import { TooltipTrigger as TooltipTrigger$1, TooltipProps as TooltipProps$1, Focusable } from 'react-aria-components';
6
7
 
7
8
  declare const sprinkles: ((props: {
8
9
  borderColor?: "decorative.transparent" | "decorative.default" | "decorative.inverted" | "interactive.default" | "interactive.active" | "interactive.error" | "interactive.upsell" | "interactive.warning" | "interactive.success" | "interactive.focused";
@@ -3805,5 +3806,36 @@ type ThemeProviderProps = {
3805
3806
  declare const ThemeProvider: ({ children, colorScheme: initialColorScheme, asChild, }: ThemeProviderProps) => _emotion_react_jsx_runtime.JSX.Element;
3806
3807
  declare const useTheme: () => ThemeContextValue;
3807
3808
 
3808
- export { Box, Table, TableBody, TableCell, TableFooter, TableHeader, TableHeaderCell, TableRow, Text, ThemeProvider, extractBoxProps, useTheme };
3809
- export type { BoxProps, TableBodyProps, TableCellProps, TableFooterProps, TableHeaderCellProps, TableHeaderProps, TableProps, TableRowProps, TextProps };
3809
+ declare const tooltip: _vanilla_extract_recipes.RuntimeFn<{
3810
+ inverse: {
3811
+ true: string;
3812
+ false: string;
3813
+ };
3814
+ }>;
3815
+ type TooltipVariants = RecipeVariants<typeof tooltip>;
3816
+
3817
+ type TooltipProps = ComponentProps<typeof TooltipTrigger$1> & {
3818
+ /**
3819
+ * Only show the tooltip when children are partially hidden due to text overflow.
3820
+ */
3821
+ auto?: boolean;
3822
+ };
3823
+ declare const Tooltip: {
3824
+ ({ delay, auto, defaultOpen, onOpenChange, isOpen: openProp, ...props }: TooltipProps): _emotion_react_jsx_runtime.JSX.Element;
3825
+ displayName: string;
3826
+ };
3827
+ type TooltipContentProps = Omit<TooltipProps$1, 'children'> & ExtendProps<BoxProps, NonNullable<TooltipVariants>> & {
3828
+ showArrow?: boolean;
3829
+ children?: ReactNode;
3830
+ };
3831
+ declare const TooltipContent: {
3832
+ ({ offset, inverse, showArrow, children, className, ...props }: TooltipContentProps): _emotion_react_jsx_runtime.JSX.Element;
3833
+ displayName: string;
3834
+ };
3835
+ declare function TooltipTrigger({ ...props }: ComponentProps<typeof Focusable>): _emotion_react_jsx_runtime.JSX.Element;
3836
+ declare namespace TooltipTrigger {
3837
+ var displayName: string;
3838
+ }
3839
+
3840
+ export { Box, Table, TableBody, TableCell, TableFooter, TableHeader, TableHeaderCell, TableRow, Text, ThemeProvider, Tooltip, TooltipContent, TooltipTrigger, extractBoxProps, useTheme };
3841
+ export type { BoxProps, TableBodyProps, TableCellProps, TableFooterProps, TableHeaderCellProps, TableHeaderProps, TableProps, TableRowProps, TextProps, TooltipContentProps, TooltipProps };
@@ -9,3 +9,4 @@ export { TableHeaderCell } from './Table/TableHeaderCell.js';
9
9
  export { TableRow } from './Table/TableRow.js';
10
10
  export { Text } from './Text/Text.js';
11
11
  export { ThemeProvider, useTheme } from './ThemeProvider/ThemeProvider.js';
12
+ export { Tooltip, TooltipContent, TooltipTrigger } from './Tooltip/Tooltip.js';
@@ -1,3 +1,3 @@
1
- var version = "5.41.2";
1
+ var version = "5.41.4";
2
2
 
3
3
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orfium/ictinus",
3
- "version": "5.41.2",
3
+ "version": "5.41.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",
@@ -93,6 +93,7 @@
93
93
  },
94
94
  "dependencies": {
95
95
  "@radix-ui/react-slot": "^1.2.3",
96
+ "@radix-ui/react-use-controllable-state": "^1.2.2",
96
97
  "@tanstack/react-table": "^8.21.3",
97
98
  "@vanilla-extract/recipes": "^0.5.7",
98
99
  "@vanilla-extract/sprinkles": "^1.6.5",
@@ -0,0 +1,93 @@
1
+ import { vars } from '@orfium/tokens';
2
+ import { recipe, type RecipeVariants } from '@vanilla-extract/recipes';
3
+
4
+ import { sprinkles } from '../../sprinkles';
5
+ import { style } from '../../vanilla-extract';
6
+
7
+ export const tooltip = recipe({
8
+ base: [
9
+ sprinkles({
10
+ display: 'flex',
11
+ flexDirection: 'column',
12
+ p: '4',
13
+ borderRadius: '2',
14
+ typography: 'body03',
15
+ }),
16
+ style({
17
+ transform: 'translate3d(0, 0, 0)',
18
+ transformOrigin: 'var(--trigger-anchor-point)',
19
+ }),
20
+ ],
21
+ variants: {
22
+ inverse: {
23
+ true: sprinkles({
24
+ bg: 'alt',
25
+ color: 'primary',
26
+ border: '1',
27
+ borderColor: 'decorative.default',
28
+ boxShadow: '2',
29
+ }),
30
+ false: sprinkles({
31
+ bg: 'inverted',
32
+ color: 'inverted.primary',
33
+ }),
34
+ },
35
+ },
36
+ });
37
+
38
+ export const trigger = style([
39
+ sprinkles({
40
+ cursor: 'default',
41
+ }),
42
+ style({
43
+ background: 'transparent',
44
+ }),
45
+ ]);
46
+
47
+ export const arrow = recipe({
48
+ base: [
49
+ style({
50
+ display: 'block',
51
+ fill: vars.color.background.inverted,
52
+
53
+ selectors: {
54
+ '[data-placement=bottom] &': {
55
+ transform: 'rotate(180deg)',
56
+ },
57
+ '[data-placement=right] &': {
58
+ transform: 'rotate(90deg) translateY(-5px)',
59
+ },
60
+ '[data-placement=left] &': {
61
+ transform: 'rotate(-90deg) translateY(-5px)',
62
+ },
63
+ },
64
+ }),
65
+ ],
66
+ });
67
+
68
+ export const arrowInverse = recipe({
69
+ base: [
70
+ style({
71
+ display: 'block',
72
+ fill: vars.color.background.alt,
73
+
74
+ selectors: {
75
+ '[data-placement=bottom] &': {
76
+ transform: 'rotate(180deg)',
77
+ },
78
+ '[data-placement=right] &': {
79
+ transform: 'rotate(90deg) translateY(-5px)',
80
+ },
81
+ '[data-placement=left] &': {
82
+ transform: 'rotate(-90deg) translateY(-5px)',
83
+ },
84
+ },
85
+ }),
86
+ ],
87
+ });
88
+
89
+ export const arrowInverseBorder = style({
90
+ fill: vars.color['border-color'].decorative.default,
91
+ });
92
+
93
+ export type TooltipVariants = RecipeVariants<typeof tooltip>;
@@ -0,0 +1,147 @@
1
+ import { useControllableState } from '@radix-ui/react-use-controllable-state';
2
+ import {
3
+ createContext,
4
+ useContext,
5
+ useRef,
6
+ type ComponentProps,
7
+ type ReactNode,
8
+ type RefObject,
9
+ } from 'react';
10
+ import type { TooltipProps as TooltipPrimitiveProps } from 'react-aria-components';
11
+ import {
12
+ Focusable,
13
+ OverlayArrow,
14
+ Tooltip as TooltipPrimitive,
15
+ TooltipTrigger as TooltipTriggerPrimitive,
16
+ } from 'react-aria-components';
17
+
18
+ import { cn } from '../../utils/cn';
19
+ import { type ExtendProps } from '../../utils/ExtendProps';
20
+ import { Box, extractBoxProps, type BoxProps } from '../Box';
21
+ import * as styles from './Tooltip.css';
22
+
23
+ const TooltipContext = createContext<{
24
+ triggerRef: RefObject<HTMLElement> | null;
25
+ }>({ triggerRef: null });
26
+
27
+ type TooltipProps = ComponentProps<typeof TooltipTriggerPrimitive> & {
28
+ /**
29
+ * Only show the tooltip when children are partially hidden due to text overflow.
30
+ */
31
+ auto?: boolean;
32
+ };
33
+
34
+ const Tooltip = ({
35
+ delay = 500,
36
+ auto = false,
37
+ defaultOpen = false,
38
+ onOpenChange,
39
+ isOpen: openProp,
40
+ ...props
41
+ }: TooltipProps) => {
42
+ const triggerRef = useRef<HTMLElement>(null);
43
+ const [open, setOpen] = useControllableState({
44
+ caller: 'Tooltip',
45
+ defaultProp: defaultOpen,
46
+ onChange: onOpenChange,
47
+ prop: openProp,
48
+ });
49
+
50
+ return (
51
+ <TooltipContext.Provider value={{ triggerRef }}>
52
+ <TooltipTriggerPrimitive
53
+ delay={delay}
54
+ defaultOpen={auto ? open : defaultOpen}
55
+ isDisabled={auto && openProp === undefined ? undefined : props.isDisabled}
56
+ isOpen={auto ? open : openProp}
57
+ onOpenChange={(isOpen) => {
58
+ if (auto && isOpen && triggerRef.current && !hasTruncatedContent(triggerRef.current)) {
59
+ return;
60
+ }
61
+
62
+ setOpen(isOpen);
63
+ }}
64
+ {...props}
65
+ />
66
+ </TooltipContext.Provider>
67
+ );
68
+ };
69
+
70
+ Tooltip.displayName = 'Tooltip';
71
+
72
+ type TooltipContentProps = Omit<TooltipPrimitiveProps, 'children'> &
73
+ ExtendProps<BoxProps, NonNullable<styles.TooltipVariants>> & {
74
+ showArrow?: boolean;
75
+ children?: ReactNode;
76
+ };
77
+
78
+ const TooltipContent = ({
79
+ offset = 8,
80
+ inverse = false,
81
+ showArrow = true,
82
+ children,
83
+ className,
84
+ ...props
85
+ }: TooltipContentProps) => {
86
+ const { boxProps, restProps } = extractBoxProps(props);
87
+
88
+ return (
89
+ <Box asChild className={cn(styles.tooltip({ inverse }), className)} {...boxProps}>
90
+ <TooltipPrimitive {...restProps} offset={offset}>
91
+ {showArrow && (
92
+ <OverlayArrow>
93
+ {inverse ? (
94
+ <svg width={18} height={8} viewBox="0 0 18 8" className={styles.arrowInverse()}>
95
+ <path d="M9.00744 6.52304L1.6397 0.000488281L16.3752 0.000489658L9.00744 6.52304Z" />
96
+ <path
97
+ d="M9.00337 6.51095L16.3588 0.00158653H18.0034L9.00337 8.00049L0.00337219 0.00158653L1.6397 0.000488281L9.00337 6.51095Z"
98
+ className={styles.arrowInverseBorder}
99
+ />
100
+ </svg>
101
+ ) : (
102
+ <svg width={15} height={6} viewBox="0 0 15 6" className={styles.arrow()}>
103
+ <path d="M7.5 6L0.500001 -1.22392e-06L14.5 0L7.5 6Z" />
104
+ </svg>
105
+ )}
106
+ </OverlayArrow>
107
+ )}
108
+ {children}
109
+ </TooltipPrimitive>
110
+ </Box>
111
+ );
112
+ };
113
+
114
+ TooltipContent.displayName = 'TooltipContent';
115
+
116
+ function TooltipTrigger({ ...props }: ComponentProps<typeof Focusable>) {
117
+ const { triggerRef } = useContext(TooltipContext);
118
+
119
+ return <Focusable ref={triggerRef} data-slot="tooltip-trigger" {...props} />;
120
+ }
121
+
122
+ TooltipTrigger.displayName = 'TooltipTrigger';
123
+
124
+ const hasTruncatedContent = (element: HTMLElement) => {
125
+ let truncated = false;
126
+
127
+ const elements: Element[] = [element];
128
+ while (!truncated && elements.length) {
129
+ const element = elements.shift();
130
+ if (!(element instanceof HTMLElement)) {
131
+ continue;
132
+ }
133
+ const { offsetHeight, offsetWidth, scrollHeight, scrollWidth } = element;
134
+
135
+ if (offsetWidth < scrollWidth || offsetHeight < scrollHeight) {
136
+ truncated = true;
137
+ break;
138
+ }
139
+
140
+ elements.push(...element.children);
141
+ }
142
+
143
+ return truncated;
144
+ };
145
+
146
+ export { Tooltip, TooltipContent, TooltipTrigger };
147
+ export type { TooltipContentProps, TooltipProps };
@@ -0,0 +1 @@
1
+ export * from './Tooltip';
@@ -2,3 +2,4 @@ export * from './Box';
2
2
  export * from './Table';
3
3
  export * from './Text';
4
4
  export * from './ThemeProvider';
5
+ export * from './Tooltip';