-
Notifications
You must be signed in to change notification settings - Fork 125
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(FwbDropdown): Add color prop to dropdown component #335
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request introduces modifications to the dropdown component's documentation and implementation. Key changes include the addition of a new Vue component demonstrating dropdowns with various color options, updates to the dropdown documentation for improved clarity, and enhancements to the Changes
Possibly related PRs
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for sensational-seahorse-8635f8 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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
🧹 Outside diff range and nitpick comments (1)
docs/components/dropdown.md (1)
202-238
: Consider expanding the code examplesWhile the new button colors section is comprehensive, the use of ellipsis (...) in the code examples might not be clear enough for users. Consider showing at least one complete dropdown content example.
Example improvement:
<fwb-dropdown text="Default" color="default"> - ... + <div class="w-52"> + <p class="p-2">Example content</p> + </div> </fwb-dropdown>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
docs/components/dropdown.md
(3 hunks)docs/components/dropdown/examples/FwbDropdownExampleColors.vue
(1 hunks)src/components/FwbDropdown/FwbDropdown.vue
(4 hunks)
✅ Files skipped from review due to trivial changes (1)
- docs/components/dropdown/examples/FwbDropdownExampleColors.vue
🧰 Additional context used
🪛 Markdownlint (0.35.0)
docs/components/dropdown.md
303-303: null
Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
🔇 Additional comments (5)
src/components/FwbDropdown/FwbDropdown.vue (4)
9-9
: LGTM: Color prop binding is correctly implemented
The color prop is properly bound to the FwbButton component, enabling button color customization as intended.
53-53
: LGTM: Color prop is well-defined
The color prop is properly typed using ButtonVariant and has a sensible default value of 'default'.
Also applies to: 65-65, 73-73
81-91
: LGTM: Event handling improvements
The event emission syntax is more explicit and the watch function's formatting enhances readability.
135-142
: LGTM: CSS transition formatting improvements
The transition classes have been reformatted for better readability while maintaining the same functionality.
Also applies to: 148-155, 161-168, 174-181
docs/components/dropdown.md (1)
2-5
: LGTM: Import statement formatting is consistent
Added semicolons to import statements for better consistency with JavaScript/TypeScript conventions.
docs/components/dropdown.md
Outdated
| Name | Values | Default | | ||
|-------------|---------------------|------------| | ||
| placement | `DropdownPlacement` | `'bottom'` | | ||
| text | `string` | `''` | | ||
| transition | `string` | `''` | | ||
| closeInside | `boolean` | `false` | | ||
| alignToEnd | `boolean` | `false` | |
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.
Add missing color prop documentation
The color prop is missing from the props table in the API section. Please add it to maintain complete documentation.
Add this row to the props table:
| Name | Values | Default |
|-------------|---------------------|------------|
+| color | `ButtonVariant` | `'default'`|
| placement | `DropdownPlacement` | `'bottom'` |
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Name | Values | Default | | |
|-------------|---------------------|------------| | |
| placement | `DropdownPlacement` | `'bottom'` | | |
| text | `string` | `''` | | |
| transition | `string` | `''` | | |
| closeInside | `boolean` | `false` | | |
| alignToEnd | `boolean` | `false` | | |
| Name | Values | Default | | |
|-------------|---------------------|------------| | |
| color | `ButtonVariant` | `'default'`| | |
| placement | `DropdownPlacement` | `'bottom'` | | |
| text | `string` | `''` | | |
| transition | `string` | `''` | | |
| closeInside | `boolean` | `false` | | |
| alignToEnd | `boolean` | `false` | |
🧰 Tools
🪛 Markdownlint (0.35.0)
303-303: null
Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
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.
as CodeRabbitAI said... let's add color
prop to this table.
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.
@Sqrcz, here's the updated props table with the color
prop added:
| Name | Values | Default |
|-------------|---------------------|------------|
| color | `ButtonVariant` | `'default'` |
| placement | `DropdownPlacement` | `'bottom'` |
| text | `string` | `''` |
| transition | `string` | `''` |
| closeInside | `boolean` | `false` |
| alignToEnd | `boolean` | `false` |
This addition will ensure the color
prop is properly documented in the API section.
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.
Thank you for your input.
Please fix those few small issues and it'll be ready to merge.
docs/components/dropdown.md
Outdated
import FwbDropdownExamplePlacement from './dropdown/examples/FwbDropdownExamplePlacement.vue'; | ||
import FwbDropdownExampleAlignment from './dropdown/examples/FwbDropdownExampleAlignment.vue'; | ||
import FwbDropdownExampleListGroup from './dropdown/examples/FwbDropdownExampleListGroup.vue'; | ||
import FwbDropdownExampleTrigger from './dropdown/examples/FwbDropdownExampleTrigger.vue'; |
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.
Hey,
We're missing here import of FwbDropdownExampleColors
for the new example to work properly.
Also we're missing FwbDropdoenExampleCloseInside
import here... and please remove semicolons as we're not using them in the project.
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.
The close inside
example is fixed in #333
I corrected the other suggestions - thanks for pointing them out! I'll make sure I got the right code style in the future (my IDE suggested these changes, but I'll take extra care that it will be consistent from now on)
docs/components/dropdown.md
Outdated
| Name | Values | Default | | ||
|-------------|---------------------|------------| | ||
| placement | `DropdownPlacement` | `'bottom'` | | ||
| text | `string` | `''` | | ||
| transition | `string` | `''` | | ||
| closeInside | `boolean` | `false` | | ||
| alignToEnd | `boolean` | `false` | |
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.
as CodeRabbitAI said... let's add color
prop to this table.
@coderabbitai review |
✅ Actions performedReview triggered.
|
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 (2)
docs/components/dropdown.md (2)
203-239
: Consider showing complete dropdown content in the exampleWhile the example effectively demonstrates the color variants, using ellipsis (...) might make it harder for users to copy and adapt the code. Consider showing at least one complete dropdown content example.
<template> <fwb-dropdown text="Default" color="default"> - ... + <div class="w-52"> + <p class="p-2">Dropdown content</p> + </div> </fwb-dropdown> <fwb-dropdown text="Alternative" color="alternative"> ... </fwb-dropdown> <!-- remaining dropdowns --> </template>
304-311
: Add blank lines around the props tableTo improve readability and comply with markdown best practices, add blank lines before and after the table.
### Props + | Name | Values | Default | |-------------|---------------------|-------------| | placement | `DropdownPlacement` | `'bottom'` | | text | `string` | `''` | | color | `ButtonVariant` | `'default'` | | transition | `string` | `''` | | closeInside | `boolean` | `false` | | alignToEnd | `boolean` | `false` | + ### Events🧰 Tools
🪛 Markdownlint (0.35.0)
304-304: null
Tables should be surrounded by blank lines(MD058, blanks-around-tables)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
docs/components/dropdown.md
(3 hunks)
🧰 Additional context used
🪛 Markdownlint (0.35.0)
docs/components/dropdown.md
304-304: null
Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
🔇 Additional comments (1)
docs/components/dropdown.md (1)
5-5
: LGTM: Import statement follows existing pattern
The new import for FwbDropdownExampleColors
is correctly placed and follows the established pattern.
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.
Thank you for the changes. 👍
Summary by CodeRabbit
Release Notes
New Features
color
prop for the dropdown component, allowing users to customize button colors.Documentation
Bug Fixes