@gridui/tooltip 1.0.7 → 1.1.0
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/README.md
CHANGED
|
@@ -53,3 +53,8 @@ localization, and business state.
|
|
|
53
53
|
Surface motion uses `@gridui/overlay`; load `@gridui/overlay/styles.css` after Theme and before this family.
|
|
54
54
|
|
|
55
55
|
[Component reference](docs/reference/README.md) contains focused API pages for each public component.
|
|
56
|
+
|
|
57
|
+
Shared animation policy and tempo come from `MotionConfig` in `@gridui/motion`.
|
|
58
|
+
Disabled or reduced-motion policy settles decoration without disabling interaction.
|
|
59
|
+
See the [motion guide](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-core/motion)
|
|
60
|
+
for CSS scopes, portal behavior, and specialized timing contracts.
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,9 @@ var Tooltip = (props) => {
|
|
|
19
19
|
);
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
+
// src/tooltip-content/tooltip-content.tsx
|
|
23
|
+
import { useMotionStyle } from "@gridui/motion/policy";
|
|
24
|
+
|
|
22
25
|
// src/tooltip-content/style.ts
|
|
23
26
|
import { overlaySurfaceStyles } from "@gridui/overlay";
|
|
24
27
|
import { cn } from "@gridui/style-utils";
|
|
@@ -35,6 +38,7 @@ import { cn as cn2 } from "@gridui/style-utils";
|
|
|
35
38
|
import * as Primitive2 from "@radix-ui/react-tooltip";
|
|
36
39
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
37
40
|
var TooltipContent = (props) => {
|
|
41
|
+
const motionStyle = useMotionStyle();
|
|
38
42
|
const {
|
|
39
43
|
container,
|
|
40
44
|
forceMount,
|
|
@@ -51,7 +55,8 @@ var TooltipContent = (props) => {
|
|
|
51
55
|
...restProps,
|
|
52
56
|
sideOffset,
|
|
53
57
|
collisionPadding,
|
|
54
|
-
className: cn2(tooltipContentStyles(), className)
|
|
58
|
+
className: cn2(tooltipContentStyles(), className),
|
|
59
|
+
style: { ...props.style, ...motionStyle }
|
|
55
60
|
}
|
|
56
61
|
);
|
|
57
62
|
return /* @__PURE__ */ jsx2(
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/tooltip/tooltip.tsx", "../src/tooltip-content/
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package Tooltip\n * @namespace Tooltip\n * @description Tooltip\n */\n\nimport { OverlayOpen, useOverlayState } from \"@gridui/overlay\";\nimport * as Primitive from \"@radix-ui/react-tooltip\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type TooltipProps = ComponentPropsWithRef<typeof Primitive.Root>;\n\nexport const Tooltip: FC<TooltipProps> = (props: TooltipProps) => {\n const state = useOverlayState(props);\n return (<OverlayOpen.Provider\n value={state.open}\n >\n <Primitive.Root\n {...props}\n {...state}\n />\n </OverlayOpen.Provider>);\n};\n", "
|
|
5
|
-
"mappings": ";AAOA,SAAS,aAAa,uBAAuB;AAC7C,YAAY,eAAe;AAUnB;AALD,IAAM,UAA4B,CAAC,UAAwB;AAC9D,QAAM,QAAQ,gBAAgB,KAAK;AACnC,SAAQ;AAAA,IAAC,YAAY;AAAA,IAAZ;AAAA,MACL,OAAO,MAAM;AAAA,MAEb;AAAA,QAAW;AAAA,QAAV;AAAA,UACI,GAAG;AAAA,UACH,GAAG;AAAA;AAAA,MACR;AAAA;AAAA,EACJ;AACJ;;;
|
|
3
|
+
"sources": ["../src/tooltip/tooltip.tsx", "../src/tooltip-content/tooltip-content.tsx", "../src/tooltip-content/style.ts", "../src/tooltip-provider/tooltip-provider.tsx", "../src/tooltip-trigger/tooltip-trigger.tsx"],
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Tooltip\n * @namespace Tooltip\n * @description Tooltip\n */\n\nimport { OverlayOpen, useOverlayState } from \"@gridui/overlay\";\nimport * as Primitive from \"@radix-ui/react-tooltip\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type TooltipProps = ComponentPropsWithRef<typeof Primitive.Root>;\n\nexport const Tooltip: FC<TooltipProps> = (props: TooltipProps) => {\n const state = useOverlayState(props);\n return (<OverlayOpen.Provider\n value={state.open}\n >\n <Primitive.Root\n {...props}\n {...state}\n />\n </OverlayOpen.Provider>);\n};\n", "import { useMotionStyle } from \"@gridui/motion/policy\";\n/**\n * @author WMXPY\n * @package Tooltip\n * @namespace TooltipContent\n * @description Tooltip Content\n */\n\nimport { tooltipContentStyles } from \"./style\";\nimport { RetainedLayer } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport * as Primitive from \"@radix-ui/react-tooltip\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type TooltipContentProps = ComponentPropsWithRef<typeof Primitive.Content> & {\n readonly container?: ComponentPropsWithRef<typeof Primitive.Portal>[\"container\"];\n};\n\nexport const TooltipContent: FC<TooltipContentProps> = (props: TooltipContentProps) => {\n const motionStyle = useMotionStyle();\n const {\n container,\n forceMount,\n className,\n sideOffset = 8,\n collisionPadding = 16,\n ...restProps\n } = props;\n const mountProps = forceMount ? { forceMount } : {};\n const content = (<Primitive.Content\n {...mountProps}\n {...restProps}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(tooltipContentStyles(), className)}\n style={{ ...(props.style), ...motionStyle }}\n />);\n return (<Primitive.Portal\n {...mountProps}\n container={container}\n >\n {forceMount ? (<RetainedLayer>\n {content}\n </RetainedLayer>) : content}\n </Primitive.Portal>);\n};\n", "/**\n * @author WMXPY\n * @package Tooltip\n * @namespace TooltipContent\n * @description Style\n */\n\nimport { overlaySurfaceStyles } from \"@gridui/overlay\";\nimport { cn } from \"@gridui/style-utils\";\nimport { cva } from \"class-variance-authority\";\n\nexport const tooltipContentStyles = cva(cn(\n overlaySurfaceStyles({ kind: \"tooltip\" }),\n \"gridui-tooltip-content gridui-u-tooltip--z-(--gridui-z-tooltip) gridui-u-tooltip--box-border gridui-u-tooltip--w-max gridui-u-tooltip--max-w-[min(20rem,var(--radix-tooltip-content-available-width))]\",\n \"gridui-u-tooltip--p-gridui-8 gridui-u-tooltip--type-supporting gridui-u-tooltip--wrap-anywhere\",\n));\n", "/**\n * @author WMXPY\n * @package Tooltip\n * @namespace TooltipProvider\n * @description Tooltip Provider\n */\n\nimport * as Primitive from \"@radix-ui/react-tooltip\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type TooltipProviderProps = ComponentPropsWithRef<typeof Primitive.Provider>;\n\nexport const TooltipProvider: FC<TooltipProviderProps> = (props: TooltipProviderProps) => {\n const { delayDuration = 300, ...restProps } = props;\n return (<Primitive.Provider\n {...restProps}\n delayDuration={delayDuration}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Tooltip\n * @namespace TooltipTrigger\n * @description Tooltip Trigger\n */\n\nimport * as Primitive from \"@radix-ui/react-tooltip\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type TooltipTriggerProps = ComponentPropsWithRef<typeof Primitive.Trigger>;\n\nexport const TooltipTrigger: FC<TooltipTriggerProps> = (props: TooltipTriggerProps) => {\n const { asChild = true, ...restProps } = props;\n return (<Primitive.Trigger\n {...restProps}\n asChild={asChild}\n />);\n};\n"],
|
|
5
|
+
"mappings": ";AAOA,SAAS,aAAa,uBAAuB;AAC7C,YAAY,eAAe;AAUnB;AALD,IAAM,UAA4B,CAAC,UAAwB;AAC9D,QAAM,QAAQ,gBAAgB,KAAK;AACnC,SAAQ;AAAA,IAAC,YAAY;AAAA,IAAZ;AAAA,MACL,OAAO,MAAM;AAAA,MAEb;AAAA,QAAW;AAAA,QAAV;AAAA,UACI,GAAG;AAAA,UACH,GAAG;AAAA;AAAA,MACR;AAAA;AAAA,EACJ;AACJ;;;ACvBA,SAAS,sBAAsB;;;ACO/B,SAAS,4BAA4B;AACrC,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,uBAAuB,IAA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|
6
6
|
"names": ["cn", "Primitive", "jsx", "Primitive", "jsx", "Primitive", "jsx"]
|
|
7
7
|
}
|
package/dist/styles.css
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author WMXPY
|
|
3
|
-
* @package Tooltip
|
|
4
|
-
* @namespace TooltipContent
|
|
5
|
-
* @description Tooltip Content
|
|
6
|
-
*/
|
|
7
1
|
import * as Primitive from "@radix-ui/react-tooltip";
|
|
8
2
|
import type { ComponentPropsWithRef, FC } from "react";
|
|
9
3
|
export type TooltipContentProps = ComponentPropsWithRef<typeof Primitive.Content> & {
|
package/docs/catalog.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/tooltip",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"category": "core",
|
|
6
6
|
"description": "GridUI React tooltip",
|
|
7
7
|
"usage": "The Tooltip family owns composable primitives for supplemental button and link hints. This family owns timing, controlled state, native trigger composition, portal styling, positioning, accessibility, and content limits. Applications own clipboard state and localized labels.",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"@gridui/tooltip/styles.css"
|
|
62
62
|
],
|
|
63
63
|
"examples": [
|
|
64
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/tooltip/stories/getting-started.mdx",
|
|
64
65
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/tooltip/stories/hints.mdx",
|
|
65
66
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/tooltip/stories/tooltip.stories.tsx"
|
|
66
67
|
]
|
|
@@ -88,7 +88,7 @@ Called when the corresponding interaction occurs; inspect the arguments in Actio
|
|
|
88
88
|
|
|
89
89
|
### side
|
|
90
90
|
|
|
91
|
-
``"
|
|
91
|
+
``"bottom" | "top" | "right" | "left" | undefined`` · Optional
|
|
92
92
|
|
|
93
93
|
### sideOffset
|
|
94
94
|
|
|
@@ -98,7 +98,7 @@ Default: ``8``
|
|
|
98
98
|
|
|
99
99
|
### align
|
|
100
100
|
|
|
101
|
-
``"center" | "
|
|
101
|
+
``"center" | "end" | "start" | undefined`` · Optional
|
|
102
102
|
|
|
103
103
|
### alignOffset
|
|
104
104
|
|
|
@@ -118,7 +118,7 @@ Default: ``8``
|
|
|
118
118
|
|
|
119
119
|
### collisionPadding
|
|
120
120
|
|
|
121
|
-
``number | Partial<Record<"
|
|
121
|
+
``number | Partial<Record<"bottom" | "top" | "right" | "left", number>> | undefined`` · Optional
|
|
122
122
|
|
|
123
123
|
Default: ``16``
|
|
124
124
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/tooltip",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "GridUI React tooltip",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -27,17 +27,18 @@
|
|
|
27
27
|
"react-dom": "^19.2.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@gridui/overlay": "^2.
|
|
30
|
+
"@gridui/overlay": "^2.3.0",
|
|
31
31
|
"@gridui/style-utils": "^4.0.0",
|
|
32
|
-
"@gridui/theme": "^
|
|
32
|
+
"@gridui/theme": "^3.0.0",
|
|
33
33
|
"@radix-ui/react-tooltip": "1.4.1",
|
|
34
|
-
"class-variance-authority": "0.7.1"
|
|
34
|
+
"class-variance-authority": "0.7.1",
|
|
35
|
+
"@gridui/motion": "^1.0.1"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
38
|
"@gridui-internal/configuration": "0.0.0-internal",
|
|
38
|
-
"@gridui/button": "
|
|
39
|
+
"@gridui/button": "5.1.0",
|
|
39
40
|
"@jest/globals": "30.5.2",
|
|
40
|
-
"@storybook/react-vite": "10.6.
|
|
41
|
+
"@storybook/react-vite": "10.6.7",
|
|
41
42
|
"@types/jest": "30.0.0",
|
|
42
43
|
"@types/node": "26.6.6",
|
|
43
44
|
"@types/react": "19.3.0",
|