@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.
- package/.turbo/turbo-build.log +18 -18
- package/CHANGELOG.md +12 -0
- package/dist/src/vanilla/Tooltip/Tooltip.css.d.ts +20 -0
- package/dist/src/vanilla/Tooltip/Tooltip.d.ts +29 -0
- package/dist/src/vanilla/Tooltip/index.d.ts +1 -0
- package/dist/src/vanilla/index.d.ts +1 -0
- package/dist/vanilla/Tooltip/Tooltip-css.js +12 -0
- package/dist/vanilla/Tooltip/Tooltip.js +91 -0
- package/dist/vanilla/assets/src/vanilla/Tooltip/Tooltip.css.ts.vanilla-nRPDcOsw.css +39 -0
- package/dist/vanilla/index.d.ts +35 -3
- package/dist/vanilla/index.js +1 -0
- package/dist/vanilla/package.json.js +1 -1
- package/package.json +2 -1
- package/src/vanilla/Tooltip/Tooltip.css.ts +93 -0
- package/src/vanilla/Tooltip/Tooltip.tsx +147 -0
- package/src/vanilla/Tooltip/index.ts +1 -0
- package/src/vanilla/index.ts +1 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @orfium/ictinus@5.41.
|
|
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.
|
|
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
|
[2mdist/[22m[36m_virtual/treeRole.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
134
134
|
[2mdist/[22m[36m_virtual/treegridRole.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
135
135
|
[2mdist/[22m[36m_virtual/treeitemRole.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
136
|
-
[2mdist/[22m[36m_virtual/graphicsDocumentRole.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
137
|
-
[2mdist/[22m[36m_virtual/graphicsObjectRole.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
138
|
-
[2mdist/[22m[36m_virtual/graphicsSymbolRole.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
139
136
|
[2mdist/[22m[36m_virtual/docAbstractRole.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
140
137
|
[2mdist/[22m[36m_virtual/docAcknowledgmentsRole.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
141
138
|
[2mdist/[22m[36m_virtual/docAfterwordRole.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
@@ -175,6 +172,9 @@ computing gzip size...
|
|
|
175
172
|
[2mdist/[22m[36m_virtual/docSubtitleRole.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
176
173
|
[2mdist/[22m[36m_virtual/docTipRole.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
177
174
|
[2mdist/[22m[36m_virtual/docTocRole.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
175
|
+
[2mdist/[22m[36m_virtual/graphicsDocumentRole.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
176
|
+
[2mdist/[22m[36m_virtual/graphicsObjectRole.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
177
|
+
[2mdist/[22m[36m_virtual/graphicsSymbolRole.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
178
178
|
[2mdist/[22m[36m_virtual/__vite-browser-external.js [39m[1m[2m 0.04 kB[22m[1m[22m[2m │ gzip: 0.06 kB[22m
|
|
179
179
|
[2mdist/[22m[36m_virtual/lz-string2.js [39m[1m[2m 0.05 kB[22m[1m[22m[2m │ gzip: 0.07 kB[22m
|
|
180
180
|
[2mdist/[22m[36m_virtual/index5.js [39m[1m[2m 0.05 kB[22m[1m[22m[2m │ gzip: 0.07 kB[22m
|
|
@@ -451,8 +451,8 @@ computing gzip size...
|
|
|
451
451
|
[2mdist/[22m[36mnode_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/alertdialogRole.js [39m[1m[2m 0.78 kB[22m[1m[22m[2m │ gzip: 0.43 kB[22m
|
|
452
452
|
[2mdist/[22m[36mcomponents/Table/components/TH/components/SortingButton/SortingButton.js [39m[1m[2m 0.79 kB[22m[1m[22m[2m │ gzip: 0.46 kB[22m
|
|
453
453
|
[2mdist/[22m[36mnode_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/switchRole.js [39m[1m[2m 0.79 kB[22m[1m[22m[2m │ gzip: 0.44 kB[22m
|
|
454
|
-
[2mdist/[22m[36mcomponents/Chart/LineChart/components/CustomTooltip/CustomTooltip.js [39m[1m[2m 0.79 kB[22m[1m[22m[2m │ gzip: 0.39 kB[22m
|
|
455
454
|
[2mdist/[22m[36mcomponents/Icon/assets/musicBusiness/license.svg.js [39m[1m[2m 0.79 kB[22m[1m[22m[2m │ gzip: 0.47 kB[22m
|
|
455
|
+
[2mdist/[22m[36mcomponents/Chart/LineChart/components/CustomTooltip/CustomTooltip.js [39m[1m[2m 0.79 kB[22m[1m[22m[2m │ gzip: 0.39 kB[22m
|
|
456
456
|
[2mdist/[22m[36mnode_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/toolbarRole.js [39m[1m[2m 0.79 kB[22m[1m[22m[2m │ gzip: 0.44 kB[22m
|
|
457
457
|
[2mdist/[22m[36mcomponents/NumberField/components/Stepper/Stepper.style.js [39m[1m[2m 0.79 kB[22m[1m[22m[2m │ gzip: 0.48 kB[22m
|
|
458
458
|
[2mdist/[22m[36mcomponents/IconButton/IconButton.js [39m[1m[2m 0.79 kB[22m[1m[22m[2m │ gzip: 0.46 kB[22m
|
|
@@ -516,8 +516,8 @@ computing gzip size...
|
|
|
516
516
|
[2mdist/[22m[36mcomponents/Search/StatefulSearch.js [39m[1m[2m 0.89 kB[22m[1m[22m[2m │ gzip: 0.48 kB[22m
|
|
517
517
|
[2mdist/[22m[36mcomponents/Chart/BarChart/components/CustomTooltip/CustomTooltip.style.js [39m[1m[2m 0.89 kB[22m[1m[22m[2m │ gzip: 0.45 kB[22m
|
|
518
518
|
[2mdist/[22m[36mnode_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/dpub/docQnaRole.js [39m[1m[2m 0.90 kB[22m[1m[22m[2m │ gzip: 0.47 kB[22m
|
|
519
|
-
[2mdist/[22m[36mnode_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/menuitemcheckboxRole.js [39m[1m[2m 0.90 kB[22m[1m[22m[2m │ gzip: 0.47 kB[22m
|
|
520
519
|
[2mdist/[22m[36mcomponents/Filter/components/FilterMenu/components/Options/Options.style.js [39m[1m[2m 0.90 kB[22m[1m[22m[2m │ gzip: 0.49 kB[22m
|
|
520
|
+
[2mdist/[22m[36mnode_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/menuitemcheckboxRole.js [39m[1m[2m 0.90 kB[22m[1m[22m[2m │ gzip: 0.47 kB[22m
|
|
521
521
|
[2mdist/[22m[36mnode_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/dpub/docCreditRole.js [39m[1m[2m 0.90 kB[22m[1m[22m[2m │ gzip: 0.47 kB[22m
|
|
522
522
|
[2mdist/[22m[36mnode_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/searchboxRole.js [39m[1m[2m 0.90 kB[22m[1m[22m[2m │ gzip: 0.47 kB[22m
|
|
523
523
|
[2mdist/[22m[36mcomponents/Icon/assets/musicBusiness/recording.svg.js [39m[1m[2m 0.90 kB[22m[1m[22m[2m │ gzip: 0.53 kB[22m
|
|
@@ -590,8 +590,8 @@ computing gzip size...
|
|
|
590
590
|
[2mdist/[22m[36mnode_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/listitemRole.js [39m[1m[2m 1.00 kB[22m[1m[22m[2m │ gzip: 0.50 kB[22m
|
|
591
591
|
[2mdist/[22m[36mnode_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/columnheaderRole.js [39m[1m[2m 1.01 kB[22m[1m[22m[2m │ gzip: 0.49 kB[22m
|
|
592
592
|
[2mdist/[22m[36mhooks/useFieldUtils.js [39m[1m[2m 1.01 kB[22m[1m[22m[2m │ gzip: 0.59 kB[22m
|
|
593
|
-
[2mdist/[22m[36mcomponents/TopAppBar/TopAppBar.style.js [39m[1m[2m 1.01 kB[22m[1m[22m[2m │ gzip: 0.47 kB[22m
|
|
594
593
|
[2mdist/[22m[36mcomponents/Icon/assets/generic/keyword.svg.js [39m[1m[2m 1.01 kB[22m[1m[22m[2m │ gzip: 0.55 kB[22m
|
|
594
|
+
[2mdist/[22m[36mcomponents/TopAppBar/TopAppBar.style.js [39m[1m[2m 1.01 kB[22m[1m[22m[2m │ gzip: 0.47 kB[22m
|
|
595
595
|
[2mdist/[22m[36mcomponents/Icon/assets/toggledActions/freeze.svg.js [39m[1m[2m 1.02 kB[22m[1m[22m[2m │ gzip: 0.52 kB[22m
|
|
596
596
|
[2mdist/[22m[36mcomponents/Notification/NotificationVisual/NotificationVisual.js [39m[1m[2m 1.03 kB[22m[1m[22m[2m │ gzip: 0.47 kB[22m
|
|
597
597
|
[2mdist/[22m[36mcomponents/Icon/assets/audioControls/resume.svg.js [39m[1m[2m 1.03 kB[22m[1m[22m[2m │ gzip: 0.53 kB[22m
|
|
@@ -609,8 +609,8 @@ computing gzip size...
|
|
|
609
609
|
[2mdist/[22m[36mcomponents/Filter/components/FilterMenu/FilterMenu.js [39m[1m[2m 1.05 kB[22m[1m[22m[2m │ gzip: 0.50 kB[22m
|
|
610
610
|
[2mdist/[22m[36mnode_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/optionRole.js [39m[1m[2m 1.06 kB[22m[1m[22m[2m │ gzip: 0.49 kB[22m
|
|
611
611
|
[2mdist/[22m[36mnode_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/graphics/graphicsDocumentRole.js [39m[1m[2m 1.07 kB[22m[1m[22m[2m │ gzip: 0.50 kB[22m
|
|
612
|
-
[2mdist/[22m[36mcomponents/Tooltip/Tooltip.style.js [39m[1m[2m 1.07 kB[22m[1m[22m[2m │ gzip: 0.57 kB[22m
|
|
613
612
|
[2mdist/[22m[36mcomponents/Icon/assets/toggledActions/flagOff.svg.js [39m[1m[2m 1.07 kB[22m[1m[22m[2m │ gzip: 0.61 kB[22m
|
|
613
|
+
[2mdist/[22m[36mcomponents/Tooltip/Tooltip.style.js [39m[1m[2m 1.07 kB[22m[1m[22m[2m │ gzip: 0.57 kB[22m
|
|
614
614
|
[2mdist/[22m[36mnode_modules/@testing-library/react/node_modules/aria-query/lib/etc/roles/literal/imgRole.js [39m[1m[2m 1.07 kB[22m[1m[22m[2m │ gzip: 0.47 kB[22m
|
|
615
615
|
[2mdist/[22m[36mcomponents/Icon/assets/navigation/arrowDown.svg.js [39m[1m[2m 1.07 kB[22m[1m[22m[2m │ gzip: 0.60 kB[22m
|
|
616
616
|
[2mdist/[22m[36mcomponents/Icon/assets/navigation/arrowRight.svg.js [39m[1m[2m 1.07 kB[22m[1m[22m[2m │ gzip: 0.60 kB[22m
|
|
@@ -674,8 +674,8 @@ computing gzip size...
|
|
|
674
674
|
[2mdist/[22m[36mcomponents/Notification/subcomponents/CompactNotification/CompactNotification.style.js [39m[1m[2m 1.32 kB[22m[1m[22m[2m │ gzip: 0.55 kB[22m
|
|
675
675
|
[2mdist/[22m[36mcomponents/Notification/Snackbar/Snackbar.style.js [39m[1m[2m 1.32 kB[22m[1m[22m[2m │ gzip: 0.62 kB[22m
|
|
676
676
|
[2mdist/[22m[36mcomponents/Icon/assets/toggledActions/pair.svg.js [39m[1m[2m 1.33 kB[22m[1m[22m[2m │ gzip: 0.68 kB[22m
|
|
677
|
-
[2mdist/[22m[36mcomponents/Notification/Notification.style.js [39m[1m[2m 1.33 kB[22m[1m[22m[2m │ gzip: 0.61 kB[22m
|
|
678
677
|
[2mdist/[22m[36mcomponents/DropdownButton/DropdownButton.style.js [39m[1m[2m 1.33 kB[22m[1m[22m[2m │ gzip: 0.60 kB[22m
|
|
678
|
+
[2mdist/[22m[36mcomponents/Notification/Notification.style.js [39m[1m[2m 1.33 kB[22m[1m[22m[2m │ gzip: 0.61 kB[22m
|
|
679
679
|
[2mdist/[22m[36mcomponents/Icon/assets/generic/mail.svg.js [39m[1m[2m 1.33 kB[22m[1m[22m[2m │ gzip: 0.71 kB[22m
|
|
680
680
|
[2mdist/[22m[36mcomponents/TextInputBase/TextInputBase.js [39m[1m[2m 1.33 kB[22m[1m[22m[2m │ gzip: 0.63 kB[22m
|
|
681
681
|
[2mdist/[22m[36mnode_modules/is-regex/index.js [39m[1m[2m 1.33 kB[22m[1m[22m[2m │ gzip: 0.57 kB[22m
|
|
@@ -904,11 +904,11 @@ computing gzip size...
|
|
|
904
904
|
[2mdist/[22m[36mnode_modules/object-inspect/index.js [39m[1m[2m12.77 kB[22m[1m[22m[2m │ gzip: 3.79 kB[22m
|
|
905
905
|
[2mdist/[22m[36mindex.js [39m[1m[2m13.21 kB[22m[1m[22m[2m │ gzip: 3.15 kB[22m
|
|
906
906
|
[2mdist/[22m[36mnode_modules/@testing-library/react/node_modules/@testing-library/dom/dist/@testing-library/dom.esm.js [39m[1m[2m55.14 kB[22m[1m[22m[2m │ gzip: 13.99 kB[22m
|
|
907
|
-
[vite:dts] Declaration files built in
|
|
907
|
+
[vite:dts] Declaration files built in 12487ms.
|
|
908
908
|
|
|
909
|
-
[32m✓ built in
|
|
909
|
+
[32m✓ built in 17.21s[39m
|
|
910
910
|
|
|
911
|
-
> @orfium/ictinus@5.41.
|
|
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
|
[36mvite v7.1.6 [32mbuilding for production...[36m[39m
|
|
@@ -941,16 +941,16 @@ computing gzip size...
|
|
|
941
941
|
[2mdist/codemods/[22m[36mdrawerCodemod.cjs [39m[1m[2m1.07 kB[22m[1m[22m[2m │ gzip: 0.42 kB[22m
|
|
942
942
|
[2mdist/codemods/[22m[36munchangedIconsCodemod.cjs [39m[1m[2m1.12 kB[22m[1m[22m[2m │ gzip: 0.56 kB[22m
|
|
943
943
|
[2mdist/codemods/[22m[36mglobalsCodemod.cjs [39m[1m[2m7.12 kB[22m[1m[22m[2m │ gzip: 1.12 kB[22m
|
|
944
|
-
[vite:dts] Declaration files built in
|
|
944
|
+
[vite:dts] Declaration files built in 967ms.
|
|
945
945
|
|
|
946
|
-
[32m✓ built in 1.
|
|
946
|
+
[32m✓ built in 1.15s[39m
|
|
947
947
|
|
|
948
|
-
> @orfium/ictinus@5.41.
|
|
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
|
[36m
|
|
952
952
|
[1m./src/vanilla/index.ts[22m → [1mdist/vanilla[22m...[39m
|
|
953
|
-
[32mcreated [1mdist/vanilla[22m in [
|
|
953
|
+
[32mcreated [1mdist/vanilla[22m in [1m1s[22m[39m
|
|
954
954
|
[36m
|
|
955
955
|
[1m./src/vanilla/index.ts[22m → [1mdist/vanilla[22m...[39m
|
|
956
|
-
[32mcreated [1mdist/vanilla[22m in [1m4.
|
|
956
|
+
[32mcreated [1mdist/vanilla[22m in [1m4.8s[22m[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -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';
|
|
@@ -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
|
+
}
|
package/dist/vanilla/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
3809
|
-
|
|
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 };
|
package/dist/vanilla/index.js
CHANGED
|
@@ -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';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orfium/ictinus",
|
|
3
|
-
"version": "5.41.
|
|
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';
|
package/src/vanilla/index.ts
CHANGED