-
Notifications
You must be signed in to change notification settings - Fork 511
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
feat: Id component for ui #2697
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Warning Rate limit exceeded@MichaelUnkey has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 53 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 Walkthrough📝 Walkthrough📝 Walkthrough📝 Walkthrough📝 Walkthrough📝 Walkthrough📝 WalkthroughWalkthroughThis pull request introduces several new components and documentation related to tooltips and identifiers in the UI framework. A Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Thank you for following the naming conventions for pull request titles! 🙏 |
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (4)
apps/engineering/content/design/components/id.mdx (4)
9-30
: Add required/optional status to prop descriptions.While the props documentation is thorough, it would be helpful to indicate which props are required and which are optional.
type={{ value: { description: - 'The identifier to display.', + 'The identifier to display. Required.', type: 'string', default: undefined }, truncate: { description: - 'Number of characters to show before truncating.', + 'Number of characters to show before truncating. Optional.', type: 'number | undefined', default: undefined }, className: { description: - 'A className applied to the component to override the styling.', + 'A className applied to the component to override the styling. Optional.', type: 'string | undefined', default: undefined }, }}
34-36
: Add a code example for TooltipProvider setup.While the explanation about TooltipProvider is clear, a code example would make it easier for users to implement correctly.
Add a basic setup example:
For example: ```tsx import { TooltipProvider } from "@/components/ui/tooltip" export default function RootLayout({ children }) { return ( <TooltipProvider> {children} </TooltipProvider> ) }
38-45
: Add a basic usage example.Consider adding a simple example showing basic usage without truncation before the more complex examples.
Add a basic example:
### Basic Usage ```tsx import { Id } from "@/components/ui/id" export default function Example() { return <Id value="usr_123456789" /> }🧰 Tools
🪛 LanguageTool
[style] ~40-~40: To form a complete sentence, be sure to include a subject.
Context: ...d correctly. ## Truncate & ValueId
should be used to display a unique identifier....(MISSING_IT_THERE)
47-62
: Remove unnecessary empty lines at the end of the file.Multiple empty lines at the end of the file should be removed to maintain cleaner documentation.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
apps/engineering/content/design/components/id.mdx
(1 hunks)internal/ui/src/components/id.tsx
(1 hunks)internal/ui/src/components/tooltip.tsx
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- internal/ui/src/components/tooltip.tsx
- internal/ui/src/components/id.tsx
🧰 Additional context used
📓 Learnings (1)
apps/engineering/content/design/components/id.mdx (1)
Learnt from: MichaelUnkey
PR: unkeyed/unkey#2697
File: apps/engineering/content/design/components/id.mdx:34-40
Timestamp: 2024-12-04T17:20:37.426Z
Learning: In component documentation files (e.g., `.mdx` files in `apps/engineering/content/design/components/`), Michael prefers to include a `Props` section but prefers to exclude `Accessibility` and `Best Practices` sections.
🪛 LanguageTool
apps/engineering/content/design/components/id.mdx
[style] ~40-~40: To form a complete sentence, be sure to include a subject.
Context: ...d correctly. ## Truncate & Value Id
should be used to display a unique identifier....
(MISSING_IT_THERE)
🔇 Additional comments (1)
apps/engineering/content/design/components/id.mdx (1)
1-8
: LGTM!
The frontmatter and imports are properly structured.
apps/engineering/content/design/components/id.valueTruncate.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Andreas Thomas <[email protected]>
Co-authored-by: Andreas Thomas <[email protected]>
Co-authored-by: Andreas Thomas <[email protected]>
What does this PR do?
Fixes # (issue)
If there is not an issue for this, please create one first. This is used to tracking purposes and also helps use understand why this PR exists
Type of change
How should this be tested?
Checklist
Required
pnpm build
pnpm fmt
console.logs
git pull origin main
Appreciated
Summary by CodeRabbit
Release Notes
New Features
TooltipProvider
for enhanced tooltip functionality across the application.Id
component for displaying unique identifiers with optional truncation.ValueTruncateExample
to demonstrate the truncation feature of theId
component.OnHoverExample
component to showcase tooltip interactions.WidthExample
to illustrate the usage of theId
component with specified width.Documentation
Id
component and the Tooltip component, including usage examples.