-
-
Notifications
You must be signed in to change notification settings - Fork 427
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(components): add Clipboard #1413
Conversation
🦋 Changeset detectedLatest commit: bd1dc36 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Warning Rate limit exceeded@dhavalveera has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 36 minutes and 48 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. WalkthroughThis update introduces a new "Clipboard" component to the Changes
Poem
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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: 4
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (17)
- .changeset/poor-tools-hide.md (1 hunks)
- apps/web/content/docs/components/clipboard.mdx (1 hunks)
- apps/web/data/docs-sidebar.ts (1 hunks)
- apps/web/examples/clipboard/clipboard.root.tsx (1 hunks)
- apps/web/examples/clipboard/clipboard.withIcon.tsx (1 hunks)
- apps/web/examples/clipboard/clipboard.withIconText.tsx (1 hunks)
- apps/web/examples/clipboard/index.ts (1 hunks)
- apps/web/examples/index.ts (1 hunks)
- packages/ui/src/components/Clipboard/Clipboard.stories.tsx (1 hunks)
- packages/ui/src/components/Clipboard/Clipboard.tsx (1 hunks)
- packages/ui/src/components/Clipboard/ClipboardWithIcon.tsx (1 hunks)
- packages/ui/src/components/Clipboard/ClipboardWithIconText.tsx (1 hunks)
- packages/ui/src/components/Clipboard/index.ts (1 hunks)
- packages/ui/src/components/Clipboard/theme.tsx (1 hunks)
- packages/ui/src/components/Flowbite/FlowbiteTheme.ts (2 hunks)
- packages/ui/src/index.ts (1 hunks)
- packages/ui/src/theme.ts (2 hunks)
Files skipped from review due to trivial changes (4)
- apps/web/data/docs-sidebar.ts
- apps/web/examples/clipboard/index.ts
- packages/ui/src/components/Clipboard/index.ts
- packages/ui/src/index.ts
Additional comments not posted (16)
apps/web/examples/index.ts (1)
12-12
: Export statement for the Clipboard component is correctly added.packages/ui/src/components/Clipboard/theme.tsx (1)
4-28
: The theme configuration for the Clipboard component is comprehensive and well-structured.apps/web/content/docs/components/clipboard.mdx (1)
1-42
: The documentation for the Clipboard component is well-written and provides a thorough overview of its usage and configuration.apps/web/examples/clipboard/clipboard.root.tsx (1)
1-57
: The example implementation for the Clipboard component is correctly done, demonstrating its usage effectively.apps/web/examples/clipboard/clipboard.withIcon.tsx (1)
46-57
: Export statement looks good.The export of
withIcon
is correctly structured and provides necessary metadata for the example usage of theClipboard.WithIcon
component.packages/ui/src/components/Clipboard/ClipboardWithIconText.tsx (2)
8-56
: Component implementation is robust and well-structured.The
ClipboardWithIconText
component is implemented with clear state management for copy actions and theme customization. The use of conditional rendering and icons enhances UX.
28-56
: Export withforwardRef
is appropriate.Using
forwardRef
for theClipboardWithIconText
component allows for ref forwarding, which is useful in many React patterns, especially when dealing with lower-level DOM interactions or third-party libraries.apps/web/examples/clipboard/clipboard.withIconText.tsx (2)
1-25
: Imports andcode
constant are correctly defined.The imports and the
code
constant are appropriately used for setting up the example component forClipboard.WithIconText
.
46-57
: Export statement looks good.The export of
withIconText
is correctly structured and provides necessary metadata for the example usage of theClipboard.WithIconText
component.packages/ui/src/components/Clipboard/Clipboard.tsx (2)
12-56
: Component implementation is robust and well-structured.The
Clipboard
component is implemented with clear state management for copy actions and theme customization. The use ofTooltip
enhances user feedback and interaction.
53-56
: Export statement is well-structured.The export structure of the
Clipboard
component along with its variations (WithIcon
andWithIconText
) is well-organized and promotes modularity.packages/ui/src/components/Clipboard/Clipboard.stories.tsx (2)
8-72
: Story definitions are comprehensive and well-structured.The Storybook stories for the
Clipboard
component and its variations are well-defined, providing clear and interactive examples for users to understand the component's functionality.
30-72
: Export statements for stories are correctly structured.The export of Storybook stories using the
bind
method ensures that each story is reusable and can be individually configured, which is a best practice in Storybook development.packages/ui/src/theme.ts (1)
Line range hint
12-58
: Theme configuration forClipboard
is correctly integrated.The addition of
clipboardTheme
to the main theme configuration ensures that the styling and theming of theClipboard
component are consistent and customizable across the application.packages/ui/src/components/Flowbite/FlowbiteTheme.ts (2)
12-12
: The import ofFlowbiteClipboardTheme
is correctly placed and follows the existing pattern of importing component themes.
60-60
: The addition ofclipboard
to theFlowbiteTheme
interface integrates the new Clipboard component's theme correctly. Ensure that all necessary properties are defined inFlowbiteClipboardTheme
to support theming for the Clipboard component.Verification successful
The
FlowbiteClipboardTheme
interface is defined inpackages/ui/src/components/Clipboard/Clipboard.tsx
and includes the following properties:
button
: An object withbase
andlabel
properties.withIcon
: A property of typeFlowbiteClipboardWithIconTheme
.withIconText
: A property of typeFlowbiteClipboardWithIconTextTheme
.This confirms that the necessary properties for theming the Clipboard component are defined.
packages/ui/src/components/Clipboard/Clipboard.tsx:12-19
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all necessary properties are defined in `FlowbiteClipboardTheme`. # Test: Search for the definition of `FlowbiteClipboardTheme` and check for completeness. ast-grep --lang typescript --pattern $'interface FlowbiteClipboardTheme { $$$ }' ../Clipboard/index.tsLength of output: 172
Script:
#!/bin/bash # Description: Locate the definition of `FlowbiteClipboardTheme` in the repository. # Search for the definition of `FlowbiteClipboardTheme` in the repository. ast-grep --lang typescript --pattern $'interface FlowbiteClipboardTheme { $$$ }'Length of output: 81
Script:
#!/bin/bash # Description: Search for references to `FlowbiteClipboardTheme` in the repository. # Search for any occurrences of `FlowbiteClipboardTheme` in the repository. rg 'FlowbiteClipboardTheme'Length of output: 763
Script:
#!/bin/bash # Description: Extract the definition of `FlowbiteClipboardTheme` from `Clipboard.tsx`. # Extract the definition of `FlowbiteClipboardTheme` from `Clipboard.tsx`. ast-grep --lang typescript --pattern $'interface FlowbiteClipboardTheme { $$$ }' packages/ui/src/components/Clipboard/Clipboard.tsxLength of output: 758
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- apps/web/examples/clipboard/clipboard.withIcon.tsx (1 hunks)
- apps/web/examples/clipboard/clipboard.withIconText.tsx (1 hunks)
- packages/ui/src/components/Clipboard/Clipboard.tsx (1 hunks)
- packages/ui/src/components/Clipboard/ClipboardWithIcon.tsx (1 hunks)
- packages/ui/src/components/Clipboard/ClipboardWithIconText.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (5)
- apps/web/examples/clipboard/clipboard.withIcon.tsx
- apps/web/examples/clipboard/clipboard.withIconText.tsx
- packages/ui/src/components/Clipboard/Clipboard.tsx
- packages/ui/src/components/Clipboard/ClipboardWithIcon.tsx
- packages/ui/src/components/Clipboard/ClipboardWithIconText.tsx
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- apps/web/content/docs/components/clipboard.mdx (1 hunks)
- apps/web/examples/clipboard/clipboard.root.tsx (1 hunks)
- apps/web/examples/clipboard/clipboard.withIcon.tsx (1 hunks)
- apps/web/examples/clipboard/clipboard.withIconText.tsx (1 hunks)
- packages/ui/src/components/Clipboard/Clipboard.stories.tsx (1 hunks)
- packages/ui/src/components/Clipboard/Clipboard.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (6)
- apps/web/content/docs/components/clipboard.mdx
- apps/web/examples/clipboard/clipboard.root.tsx
- apps/web/examples/clipboard/clipboard.withIcon.tsx
- apps/web/examples/clipboard/clipboard.withIconText.tsx
- packages/ui/src/components/Clipboard/Clipboard.stories.tsx
- packages/ui/src/components/Clipboard/Clipboard.tsx
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- apps/web/examples/clipboard/clipboard.withIcon.tsx (1 hunks)
- apps/web/examples/clipboard/clipboard.withIconText.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- apps/web/examples/clipboard/clipboard.withIcon.tsx
- apps/web/examples/clipboard/clipboard.withIconText.tsx
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: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- .changeset/poor-tools-hide.md (1 hunks)
- packages/ui/src/components/Clipboard/Clipboard.tsx (1 hunks)
- packages/ui/src/components/Clipboard/ClipboardWithIcon.tsx (1 hunks)
- packages/ui/src/components/Clipboard/ClipboardWithIconText.tsx (1 hunks)
- packages/ui/src/components/Clipboard/helpers.ts (1 hunks)
Files skipped from review as they are similar to previous changes (4)
- .changeset/poor-tools-hide.md
- packages/ui/src/components/Clipboard/Clipboard.tsx
- packages/ui/src/components/Clipboard/ClipboardWithIcon.tsx
- packages/ui/src/components/Clipboard/ClipboardWithIconText.tsx
Changes
bring in https://flowbite.com/docs/components/clipboard/ to
flowbite-react
Summary by CodeRabbit