-
Notifications
You must be signed in to change notification settings - Fork 13
feat: migrate Tooltip to Base UI #587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
632a587
ac925a7
0232244
e46d9cc
eccbe8f
876a228
1d4b6d1
8b1773e
d3e9138
70f325c
0b5e20f
59b2465
6b02682
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ description: A popup that displays information related to an element when it rec | |
| source: packages/raystack/components/tooltip | ||
| --- | ||
|
|
||
| import { playground, sideDemo, customDemo,followCursorDemo, providerDemo } from "./demo.ts"; | ||
| import { playground, sideDemo, alignDemo, customDemo, providerDemo, trackCursorDemo, noArrowDemo, arrowDemo } from "./demo.ts"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for noArrowDemo usage in the tooltip directory
rg -n 'noArrowDemo' apps/www/src/content/docs/components/tooltip/Repository: raystack/apsara Length of output: 243 🏁 Script executed: #!/bin/bash
# Read the entire file to see what demos are actually used in the content
cat -n apps/www/src/content/docs/components/tooltip/index.mdx | head -100Repository: raystack/apsara Length of output: 2673 🏁 Script executed: #!/bin/bash
# Check if there's more content in the file after line 100
wc -l apps/www/src/content/docs/components/tooltip/index.mdx
tail -20 apps/www/src/content/docs/components/tooltip/index.mdxRepository: raystack/apsara Length of output: 563 Remove unused import The 🤖 Prompt for AI Agents |
||
|
|
||
| <Demo data={playground} /> | ||
|
|
||
|
|
@@ -20,20 +20,38 @@ The Tooltip component accepts various props to customize its behavior and appear | |
|
|
||
| <auto-type-table path="./props.ts" name="TooltipProps" /> | ||
|
|
||
| ## Tooltip.Trigger Props | ||
|
|
||
| The Trigger component wraps the element that activates the tooltip. | ||
|
|
||
| <auto-type-table path="./props.ts" name="TooltipTriggerProps" /> | ||
|
|
||
| ## Tooltip.Content Props | ||
|
|
||
| The Content component displays the tooltip content and controls positioning. | ||
|
|
||
| <auto-type-table path="./props.ts" name="TooltipContentProps" /> | ||
|
|
||
| ## Tooltip.Provider Props | ||
|
|
||
| The TooltipProvider component serves as a context wrapper that provides global configuration and functionality to all tooltip instances within your application. | ||
| The Provider component serves as a context wrapper that provides global configuration and functionality to all tooltip instances within your application. | ||
|
|
||
| <auto-type-table path="./props.ts" name="TooltipProviderProps" /> | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Side | ||
|
|
||
| The Tooltip component can be positioned in different directions using the `side` prop: | ||
| The Tooltip Content component can be positioned in different directions using the `side` prop: | ||
|
|
||
| <Demo data={sideDemo} /> | ||
|
|
||
| ### Align | ||
|
|
||
| The Tooltip Content component can be aligned in different directions using the `align` prop: | ||
|
|
||
| <Demo data={alignDemo} /> | ||
|
|
||
| ### Custom Content | ||
|
|
||
| Tooltips can contain custom content using ReactNode: | ||
|
|
@@ -46,18 +64,14 @@ The TooltipProvider component can be used to provide a global configuration for | |
|
|
||
| <Demo data={providerDemo} /> | ||
|
|
||
| ### Follow Cursor | ||
| ### Track Cursor | ||
|
|
||
| When `followCursor` is true, the tooltip will follow the cursor and will be positioned relative to the cursor. | ||
| Use `trackCursorAxis` prop on the Root component to make the tooltip follow the cursor: | ||
|
|
||
| <Demo data={followCursorDemo} /> | ||
| <Demo data={trackCursorDemo} /> | ||
|
|
||
| ## Accessibility | ||
| ### With Arrow | ||
|
|
||
| The Tooltip component follows WAI-ARIA guidelines for tooltips: | ||
| Show the arrow by setting `showArrow={true}` on the Content component: | ||
|
|
||
| - Uses `role="tooltip"` for proper semantic meaning | ||
| - Automatically manages focus and hover interactions | ||
| - Supports keyboard navigation | ||
| - Provides appropriate ARIA attributes for accessibility | ||
| - Manages enter/exit animations for smooth user experience | ||
| <Demo data={arrowDemo} /> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid CSS
fontWeightvalue."medium"is not a valid CSSfont-weightvalue. Valid values are numeric (100-900) or keywords like"normal"(400),"bold"(700). This will be ignored by the browser.🐛 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents