@gridui/tooltip 1.0.7 → 1.2.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 +17 -2
- package/dist/index.js +6 -1
- package/dist/index.js.map +3 -3
- package/dist/styled.js +3 -0
- package/dist/styles.css +193 -0
- package/dist/styles.local.css +32 -0
- package/docs/catalog.json +3 -1
- package/docs/reference/tooltip-content.md +3 -3
- package/package.json +13 -7
package/README.md
CHANGED
|
@@ -3,10 +3,20 @@
|
|
|
3
3
|
Core family. Public API: `Tooltip`, `TooltipContent`, `TooltipContentProps`, `TooltipProps`, `TooltipProvider`, `TooltipProviderProps`, `TooltipTrigger`, `TooltipTriggerProps`.
|
|
4
4
|
|
|
5
5
|
Import components from `@gridui/tooltip` and load `@gridui/tooltip/styles.css` after Theme.
|
|
6
|
-
|
|
6
|
+
Applications own routes, labels, state persistence, and branding.
|
|
7
7
|
|
|
8
8
|
See [component ownership](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md) and [release history](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-core/tooltip/.changeset/history).
|
|
9
9
|
|
|
10
|
+
## Styles
|
|
11
|
+
|
|
12
|
+
Load Theme once. Use `@gridui/tooltip/styled` for automatic component CSS in
|
|
13
|
+
CSS-aware bundlers, or keep the CSS-free root import and load `@gridui/tooltip/styles.css`.
|
|
14
|
+
Both entries expose the same root API. The standalone stylesheet includes component
|
|
15
|
+
dependency styles; Theme/reset remain separate. See the
|
|
16
|
+
[integration guide](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/integration.md)
|
|
17
|
+
for static HTML loading, SSR limits, and avoiding duplicate CSS.
|
|
18
|
+
|
|
19
|
+
|
|
10
20
|
## Tooltips
|
|
11
21
|
|
|
12
22
|
The Tooltip family owns composable primitives for supplemental button and link
|
|
@@ -50,6 +60,11 @@ localization, and business state.
|
|
|
50
60
|
```
|
|
51
61
|
|
|
52
62
|
|
|
53
|
-
Surface motion uses `@gridui/overlay`;
|
|
63
|
+
Surface motion uses `@gridui/overlay`; its styles are included.
|
|
54
64
|
|
|
55
65
|
[Component reference](docs/reference/README.md) contains focused API pages for each public component.
|
|
66
|
+
|
|
67
|
+
Shared animation policy and tempo come from `MotionConfig` in `@gridui/motion`.
|
|
68
|
+
Disabled or reduced-motion policy settles decoration without disabling interaction.
|
|
69
|
+
See the [motion guide](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-core/motion)
|
|
70
|
+
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", "/**\n * @author WMXPY\n * @package Tooltip\n * @namespace TooltipContent\n * @description
|
|
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;;;AChBA,SAAS,4BAA4B;AACrC,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,uBAAuB,IAAI;AAAA,EACpC,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAAA,EACxC;AAAA,EACA;AACJ,CAAC;;;
|
|
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", "/**\n * @author WMXPY\n * @package Tooltip\n * @namespace TooltipContent\n * @description Tooltip Content\n */\n\nimport { 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;;;AChBA,SAAS,sBAAsB;;;ACA/B,SAAS,4BAA4B;AACrC,SAAS,UAAU;AACnB,SAAS,WAAW;AAEb,IAAM,uBAAuB,IAAI;AAAA,EACpC,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAAA,EACxC;AAAA,EACA;AACJ,CAAC;;;ADCD,SAAS,qBAAqB;AAC9B,SAAS,MAAAA,WAAU;AACnB,YAAYC,gBAAe;AAkBN,gBAAAC,YAAA;AAXd,IAAM,iBAA0C,CAAC,UAA+B;AACnF,QAAM,cAAc,eAAe;AACnC,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb,mBAAmB;AAAA,IACnB,GAAG;AAAA,EACP,IAAI;AACJ,QAAM,aAAa,aAAa,EAAE,WAAW,IAAI,CAAC;AAClD,QAAM,UAAW,gBAAAA;AAAA,IAAW;AAAA,IAAV;AAAA,MACb,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA,WAAWF,IAAG,qBAAqB,GAAG,SAAS;AAAA,MAC/C,OAAO,EAAE,GAAI,MAAM,OAAQ,GAAG,YAAY;AAAA;AAAA,EAC9C;AACA,SAAQ,gBAAAE;AAAA,IAAW;AAAA,IAAV;AAAA,MACJ,GAAG;AAAA,MACJ;AAAA,MAEC,uBAAc,gBAAAA,KAAC,iBACX,mBACL,IAAoB;AAAA;AAAA,EACxB;AACJ;;;AE7CA,YAAYC,gBAAe;AAOf,gBAAAC,YAAA;AAFL,IAAM,kBAA4C,CAAC,UAAgC;AACtF,QAAM,EAAE,gBAAgB,KAAK,GAAG,UAAU,IAAI;AAC9C,SAAQ,gBAAAA;AAAA,IAAW;AAAA,IAAV;AAAA,MACJ,GAAG;AAAA,MACJ;AAAA;AAAA,EACJ;AACJ;;;ACXA,YAAYC,gBAAe;AAOf,gBAAAC,YAAA;AAFL,IAAM,iBAA0C,CAAC,UAA+B;AACnF,QAAM,EAAE,UAAU,MAAM,GAAG,UAAU,IAAI;AACzC,SAAQ,gBAAAA;AAAA,IAAW;AAAA,IAAV;AAAA,MACJ,GAAG;AAAA,MACJ;AAAA;AAAA,EACJ;AACJ;",
|
|
6
6
|
"names": ["cn", "Primitive", "jsx", "Primitive", "jsx", "Primitive", "jsx"]
|
|
7
7
|
}
|
package/dist/styled.js
ADDED
package/dist/styles.css
CHANGED
|
@@ -1,3 +1,195 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties;
|
|
3
|
+
@layer theme, base, components, utilities;
|
|
4
|
+
@layer theme {
|
|
5
|
+
:root, :host {
|
|
6
|
+
--spacing: 0.25rem;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
@layer utilities {
|
|
10
|
+
.gridui-u-overlay--z-\(--gridui-z-popover\) {
|
|
11
|
+
z-index: var(--gridui-z-popover);
|
|
12
|
+
}
|
|
13
|
+
.gridui-u-overlay--flex {
|
|
14
|
+
display: flex;
|
|
15
|
+
}
|
|
16
|
+
.gridui-u-overlay--inline-flex {
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
}
|
|
19
|
+
.gridui-u-overlay--size-gridui-16 {
|
|
20
|
+
width: var(--gridui-space-16);
|
|
21
|
+
height: var(--gridui-space-16);
|
|
22
|
+
}
|
|
23
|
+
.gridui-u-overlay--min-h-10 {
|
|
24
|
+
min-height: calc(var(--spacing) * 10);
|
|
25
|
+
}
|
|
26
|
+
.gridui-u-overlay--min-w-0 {
|
|
27
|
+
min-width: 0px;
|
|
28
|
+
}
|
|
29
|
+
.gridui-u-overlay--shrink-0 {
|
|
30
|
+
flex-shrink: 0;
|
|
31
|
+
}
|
|
32
|
+
.gridui-u-overlay--cursor-pointer {
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
}
|
|
35
|
+
.gridui-u-overlay--items-center {
|
|
36
|
+
align-items: center;
|
|
37
|
+
}
|
|
38
|
+
.gridui-u-overlay--justify-center {
|
|
39
|
+
justify-content: center;
|
|
40
|
+
}
|
|
41
|
+
.gridui-u-overlay--gap-gridui-8 {
|
|
42
|
+
gap: var(--gridui-space-8);
|
|
43
|
+
}
|
|
44
|
+
.gridui-u-overlay--rounded-control {
|
|
45
|
+
border-radius: var(--gridui-control-radius);
|
|
46
|
+
}
|
|
47
|
+
.gridui-u-overlay--border {
|
|
48
|
+
border-style: var(--tw-border-style);
|
|
49
|
+
border-width: 1px;
|
|
50
|
+
}
|
|
51
|
+
.gridui-u-overlay--border-solid {
|
|
52
|
+
--tw-border-style: solid;
|
|
53
|
+
border-style: solid;
|
|
54
|
+
}
|
|
55
|
+
.gridui-u-overlay--border-border {
|
|
56
|
+
border-color: var(--gridui-border);
|
|
57
|
+
}
|
|
58
|
+
.gridui-u-overlay--bg-background {
|
|
59
|
+
background-color: var(--gridui-background);
|
|
60
|
+
}
|
|
61
|
+
.gridui-u-overlay--p-0 {
|
|
62
|
+
padding: 0px;
|
|
63
|
+
}
|
|
64
|
+
.gridui-u-overlay--p-gridui-8 {
|
|
65
|
+
padding: var(--gridui-space-8);
|
|
66
|
+
}
|
|
67
|
+
.gridui-u-overlay--px-gridui-8 {
|
|
68
|
+
padding-inline: var(--gridui-space-8);
|
|
69
|
+
}
|
|
70
|
+
.gridui-u-overlay--py-gridui-8 {
|
|
71
|
+
padding-block: var(--gridui-space-8);
|
|
72
|
+
}
|
|
73
|
+
.gridui-u-overlay--type-data {
|
|
74
|
+
font: var(--gridui-type-data);
|
|
75
|
+
font-family: var(--gridui-font-body);
|
|
76
|
+
letter-spacing: normal;
|
|
77
|
+
font-variant-numeric: tabular-nums;
|
|
78
|
+
}
|
|
79
|
+
.gridui-u-overlay--type-caption {
|
|
80
|
+
font: var(--gridui-type-caption);
|
|
81
|
+
font-family: var(--gridui-font-body);
|
|
82
|
+
letter-spacing: normal;
|
|
83
|
+
}
|
|
84
|
+
.gridui-u-overlay--wrap-anywhere {
|
|
85
|
+
overflow-wrap: anywhere;
|
|
86
|
+
}
|
|
87
|
+
.gridui-u-overlay--whitespace-normal {
|
|
88
|
+
white-space: normal;
|
|
89
|
+
}
|
|
90
|
+
.gridui-u-overlay--text-foreground {
|
|
91
|
+
color: var(--gridui-foreground);
|
|
92
|
+
}
|
|
93
|
+
.gridui-u-overlay--text-inherit {
|
|
94
|
+
color: inherit;
|
|
95
|
+
}
|
|
96
|
+
.gridui-u-overlay--text-muted {
|
|
97
|
+
color: var(--gridui-muted);
|
|
98
|
+
}
|
|
99
|
+
.gridui-u-overlay--no-underline {
|
|
100
|
+
text-decoration-line: none;
|
|
101
|
+
}
|
|
102
|
+
.gridui-u-overlay--aria-selected\:bg-selection-background[aria-selected="true"] {
|
|
103
|
+
background-color: var(--gridui-selection-background);
|
|
104
|
+
}
|
|
105
|
+
.gridui-u-overlay--aria-\[current\=page\]\:bg-selection-background[aria-current="page"] {
|
|
106
|
+
background-color: var(--gridui-selection-background);
|
|
107
|
+
}
|
|
108
|
+
.gridui-u-overlay--data-disabled\:pointer-events-none[data-disabled] {
|
|
109
|
+
pointer-events: none;
|
|
110
|
+
}
|
|
111
|
+
.gridui-u-overlay--data-disabled\:opacity-50[data-disabled] {
|
|
112
|
+
opacity: 50%;
|
|
113
|
+
}
|
|
114
|
+
.gridui-u-overlay--data-\[state\=checked\]\:bg-selection-background[data-state="checked"] {
|
|
115
|
+
background-color: var(--gridui-selection-background);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
@layer components {
|
|
119
|
+
.gridui-overlay-surface {
|
|
120
|
+
--gridui-surface-offset-x: 0px;
|
|
121
|
+
--gridui-surface-offset-y: 0px;
|
|
122
|
+
--gridui-overlay-enter-duration: var(--gridui-motion-duration-normal);
|
|
123
|
+
--gridui-overlay-fill-mode: both;
|
|
124
|
+
transform-origin: var(--gridui-overlay-origin, center);
|
|
125
|
+
}
|
|
126
|
+
.gridui-overlay-dialog {
|
|
127
|
+
--gridui-overlay-fill-mode: none;
|
|
128
|
+
transform-origin: center;
|
|
129
|
+
}
|
|
130
|
+
.gridui-overlay-tooltip {
|
|
131
|
+
--gridui-overlay-enter-duration: var(--gridui-motion-duration-quick);
|
|
132
|
+
}
|
|
133
|
+
.gridui-overlay-floating[data-side="bottom"] {
|
|
134
|
+
--gridui-surface-offset-y: calc(-1 * var(--gridui-motion-distance));
|
|
135
|
+
}
|
|
136
|
+
.gridui-overlay-floating[data-side="top"] {
|
|
137
|
+
--gridui-surface-offset-y: var(--gridui-motion-distance);
|
|
138
|
+
}
|
|
139
|
+
.gridui-overlay-floating[data-side="left"] {
|
|
140
|
+
--gridui-surface-offset-x: var(--gridui-motion-distance);
|
|
141
|
+
}
|
|
142
|
+
.gridui-overlay-floating[data-side="right"] {
|
|
143
|
+
--gridui-surface-offset-x: calc(-1 * var(--gridui-motion-distance));
|
|
144
|
+
}
|
|
145
|
+
.gridui-overlay-surface[data-state="closed"] {
|
|
146
|
+
pointer-events: none;
|
|
147
|
+
}
|
|
148
|
+
.gridui-overlay-surface:not([data-side="none"]):is([data-state="open"], [data-state="delayed-open"], [data-state="instant-open"]) {
|
|
149
|
+
animation: var(--gridui-motion-animation, gridui-surface-enter calc(var(--gridui-overlay-enter-duration) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out) var(--gridui-overlay-fill-mode));
|
|
150
|
+
}
|
|
151
|
+
.gridui-overlay-surface:not([data-side="none"])[data-state="closed"] {
|
|
152
|
+
animation: var(--gridui-motion-animation, gridui-surface-exit calc(var(--gridui-motion-duration-quick) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-in) var(--gridui-overlay-fill-mode));
|
|
153
|
+
}
|
|
154
|
+
.gridui-overlay-backdrop {
|
|
155
|
+
background: var(--gridui-backdrop);
|
|
156
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
157
|
+
background: color-mix(in srgb, var(--gridui-backdrop) var(--gridui-backdrop-opacity), transparent);
|
|
158
|
+
}
|
|
159
|
+
--gridui-overlay-enter-duration: var(--gridui-motion-duration-normal);
|
|
160
|
+
--gridui-overlay-exit-duration: var(--gridui-motion-duration-quick);
|
|
161
|
+
--gridui-overlay-fill-mode: none;
|
|
162
|
+
}
|
|
163
|
+
.gridui-overlay-backdrop-deliberate {
|
|
164
|
+
--gridui-overlay-enter-duration: var(--gridui-motion-duration-deliberate);
|
|
165
|
+
--gridui-overlay-exit-duration: var(--gridui-motion-duration-normal);
|
|
166
|
+
--gridui-overlay-fill-mode: both;
|
|
167
|
+
}
|
|
168
|
+
.gridui-overlay-backdrop[data-state="open"] {
|
|
169
|
+
animation: var(--gridui-motion-animation, gridui-fade-enter calc(var(--gridui-overlay-enter-duration) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-out) var(--gridui-overlay-fill-mode));
|
|
170
|
+
}
|
|
171
|
+
.gridui-overlay-backdrop[data-state="closed"] {
|
|
172
|
+
animation: var(--gridui-motion-animation, gridui-fade-exit calc(var(--gridui-overlay-exit-duration) * var(--gridui-motion-factor, 1)) var(--gridui-motion-ease-in) var(--gridui-overlay-fill-mode));
|
|
173
|
+
}
|
|
174
|
+
@media (prefers-reduced-motion: reduce) {
|
|
175
|
+
.gridui-overlay-surface:not([data-side="none"])[data-state], .gridui-overlay-backdrop[data-state] {
|
|
176
|
+
animation: none;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
@property --tw-border-style {
|
|
181
|
+
syntax: "*";
|
|
182
|
+
inherits: false;
|
|
183
|
+
initial-value: solid;
|
|
184
|
+
}
|
|
185
|
+
@layer properties {
|
|
186
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
187
|
+
*, ::before, ::after, ::backdrop {
|
|
188
|
+
--tw-border-style: solid;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
1
193
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
194
|
@layer theme, base, components, utilities;
|
|
3
195
|
@layer utilities {
|
|
@@ -18,6 +210,7 @@
|
|
|
18
210
|
}
|
|
19
211
|
.gridui-u-tooltip--type-supporting {
|
|
20
212
|
font: var(--gridui-type-supporting);
|
|
213
|
+
font-family: var(--gridui-font-body);
|
|
21
214
|
letter-spacing: normal;
|
|
22
215
|
}
|
|
23
216
|
.gridui-u-tooltip--wrap-anywhere {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer theme, base, components, utilities;
|
|
3
|
+
@layer utilities {
|
|
4
|
+
.gridui-u-tooltip--z-\(--gridui-z-tooltip\) {
|
|
5
|
+
z-index: var(--gridui-z-tooltip);
|
|
6
|
+
}
|
|
7
|
+
.gridui-u-tooltip--box-border {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
.gridui-u-tooltip--w-max {
|
|
11
|
+
width: max-content;
|
|
12
|
+
}
|
|
13
|
+
.gridui-u-tooltip--max-w-\[min\(20rem\,var\(--radix-tooltip-content-available-width\)\)\] {
|
|
14
|
+
max-width: min(20rem, var(--radix-tooltip-content-available-width));
|
|
15
|
+
}
|
|
16
|
+
.gridui-u-tooltip--p-gridui-8 {
|
|
17
|
+
padding: var(--gridui-space-8);
|
|
18
|
+
}
|
|
19
|
+
.gridui-u-tooltip--type-supporting {
|
|
20
|
+
font: var(--gridui-type-supporting);
|
|
21
|
+
font-family: var(--gridui-font-body);
|
|
22
|
+
letter-spacing: normal;
|
|
23
|
+
}
|
|
24
|
+
.gridui-u-tooltip--wrap-anywhere {
|
|
25
|
+
overflow-wrap: anywhere;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
@layer components {
|
|
29
|
+
.gridui-tooltip-content {
|
|
30
|
+
--gridui-overlay-origin: var(--radix-tooltip-content-transform-origin);
|
|
31
|
+
}
|
|
32
|
+
}
|
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.2.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.",
|
|
@@ -60,7 +60,9 @@
|
|
|
60
60
|
"@gridui/overlay/styles.css",
|
|
61
61
|
"@gridui/tooltip/styles.css"
|
|
62
62
|
],
|
|
63
|
+
"styledImport": "@gridui/tooltip/styled",
|
|
63
64
|
"examples": [
|
|
65
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/tooltip/stories/getting-started.mdx",
|
|
64
66
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/tooltip/stories/hints.mdx",
|
|
65
67
|
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-core/tooltip/stories/tooltip.stories.tsx"
|
|
66
68
|
]
|
|
@@ -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.2.0",
|
|
4
4
|
"description": "GridUI React tooltip",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -10,14 +10,19 @@
|
|
|
10
10
|
"docs"
|
|
11
11
|
],
|
|
12
12
|
"sideEffects": [
|
|
13
|
-
"**/*.css"
|
|
13
|
+
"**/*.css",
|
|
14
|
+
"./dist/styled.js"
|
|
14
15
|
],
|
|
15
16
|
"exports": {
|
|
16
17
|
".": {
|
|
17
18
|
"types": "./dist/index.d.ts",
|
|
18
19
|
"import": "./dist/index.js"
|
|
19
20
|
},
|
|
20
|
-
"./styles.css": "./dist/styles.css"
|
|
21
|
+
"./styles.css": "./dist/styles.css",
|
|
22
|
+
"./styled": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/styled.js"
|
|
25
|
+
}
|
|
21
26
|
},
|
|
22
27
|
"publishConfig": {
|
|
23
28
|
"access": "public"
|
|
@@ -27,17 +32,18 @@
|
|
|
27
32
|
"react-dom": "^19.2.0"
|
|
28
33
|
},
|
|
29
34
|
"dependencies": {
|
|
30
|
-
"@gridui/
|
|
35
|
+
"@gridui/motion": "^1.0.2",
|
|
36
|
+
"@gridui/overlay": "^2.4.0",
|
|
31
37
|
"@gridui/style-utils": "^4.0.0",
|
|
32
|
-
"@gridui/theme": "^
|
|
38
|
+
"@gridui/theme": "^4.0.0",
|
|
33
39
|
"@radix-ui/react-tooltip": "1.4.1",
|
|
34
40
|
"class-variance-authority": "0.7.1"
|
|
35
41
|
},
|
|
36
42
|
"devDependencies": {
|
|
37
43
|
"@gridui-internal/configuration": "0.0.0-internal",
|
|
38
|
-
"@gridui/button": "
|
|
44
|
+
"@gridui/button": "5.2.0",
|
|
39
45
|
"@jest/globals": "30.5.2",
|
|
40
|
-
"@storybook/react-vite": "10.6.
|
|
46
|
+
"@storybook/react-vite": "10.6.7",
|
|
41
47
|
"@types/jest": "30.0.0",
|
|
42
48
|
"@types/node": "26.6.6",
|
|
43
49
|
"@types/react": "19.3.0",
|