-
Notifications
You must be signed in to change notification settings - Fork 139
feat(FwbDropdown): Add color prop to dropdown component #335
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
Changes from 1 commit
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 | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,8 +1,8 @@ | ||||||||||||||||||||||||||||||||
| <script setup> | ||||||||||||||||||||||||||||||||
| 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' | ||||||||||||||||||||||||||||||||
| 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'; | ||||||||||||||||||||||||||||||||
| </script> | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| # Vue Dropdown - Flowbite | ||||||||||||||||||||||||||||||||
|
|
@@ -199,6 +199,45 @@ import { FwbDropdown, FwbListGroup, FwbListGroupItem } from 'flowbite-vue' | |||||||||||||||||||||||||||||||
| </script> | ||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## Dropdown - Button colors | ||||||||||||||||||||||||||||||||
| <fwb-dropdown-example-colors /> | ||||||||||||||||||||||||||||||||
| ```vue | ||||||||||||||||||||||||||||||||
| <template> | ||||||||||||||||||||||||||||||||
| <fwb-dropdown text="Default" color="default"> | ||||||||||||||||||||||||||||||||
| ... | ||||||||||||||||||||||||||||||||
| </fwb-dropdown> | ||||||||||||||||||||||||||||||||
| <fwb-dropdown text="Alternative" color="alternative"> | ||||||||||||||||||||||||||||||||
| ... | ||||||||||||||||||||||||||||||||
| </fwb-dropdown> | ||||||||||||||||||||||||||||||||
| <fwb-dropdown text="Dark" color="dark"> | ||||||||||||||||||||||||||||||||
| ... | ||||||||||||||||||||||||||||||||
| </fwb-dropdown> | ||||||||||||||||||||||||||||||||
| <fwb-dropdown text="Light" color="light"> | ||||||||||||||||||||||||||||||||
| ... | ||||||||||||||||||||||||||||||||
| </fwb-dropdown> | ||||||||||||||||||||||||||||||||
| <fwb-dropdown text="Green" color="green"> | ||||||||||||||||||||||||||||||||
| ... | ||||||||||||||||||||||||||||||||
| </fwb-dropdown> | ||||||||||||||||||||||||||||||||
| <fwb-dropdown text="Red" color="red"> | ||||||||||||||||||||||||||||||||
| ... | ||||||||||||||||||||||||||||||||
| </fwb-dropdown> | ||||||||||||||||||||||||||||||||
| <fwb-dropdown text="Yellow" color="yellow"> | ||||||||||||||||||||||||||||||||
| ... | ||||||||||||||||||||||||||||||||
| </fwb-dropdown> | ||||||||||||||||||||||||||||||||
| <fwb-dropdown text="Purple" color="purple"> | ||||||||||||||||||||||||||||||||
| ... | ||||||||||||||||||||||||||||||||
| </fwb-dropdown> | ||||||||||||||||||||||||||||||||
| <fwb-dropdown text="Pink" color="pink"> | ||||||||||||||||||||||||||||||||
| ... | ||||||||||||||||||||||||||||||||
| </fwb-dropdown> | ||||||||||||||||||||||||||||||||
| </template> | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| <script setup> | ||||||||||||||||||||||||||||||||
| import { FwbDropdown } from 'flowbite-vue' | ||||||||||||||||||||||||||||||||
| </script> | ||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## Dropdown - trigger | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| <fwb-dropdown-example-trigger /> | ||||||||||||||||||||||||||||||||
|
|
@@ -261,13 +300,13 @@ import { FwbDropdown, ListGroup, ListGroupItem } from 'flowbite-vue' | |||||||||||||||||||||||||||||||
| ## API | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ### Props | ||||||||||||||||||||||||||||||||
| | Name | Values | Default | | ||||||||||||||||||||||||||||||||
| |----------|--------|---------| | ||||||||||||||||||||||||||||||||
| | placement | `DropdownPlacement` | `'bottom'` | | ||||||||||||||||||||||||||||||||
| | text | `string` | `''` | | ||||||||||||||||||||||||||||||||
| | transition | `string` | `''` | | ||||||||||||||||||||||||||||||||
| | closeInside | `boolean` | `false` | | ||||||||||||||||||||||||||||||||
| | alignToEnd | `boolean` | `false` | | ||||||||||||||||||||||||||||||||
| | Name | Values | Default | | ||||||||||||||||||||||||||||||||
| |-------------|---------------------|------------| | ||||||||||||||||||||||||||||||||
| | placement | `DropdownPlacement` | `'bottom'` | | ||||||||||||||||||||||||||||||||
| | text | `string` | `''` | | ||||||||||||||||||||||||||||||||
| | transition | `string` | `''` | | ||||||||||||||||||||||||||||||||
| | closeInside | `boolean` | `false` | | ||||||||||||||||||||||||||||||||
| | alignToEnd | `boolean` | `false` | | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
| | 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.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,179 @@ | ||
| <template> | ||
| <div class="vp-raw flex gap-2 flex-wrap"> | ||
| <fwb-dropdown | ||
| text="Default" | ||
| color="default" | ||
| > | ||
| <div class="w-52"> | ||
| <p class="p-2"> | ||
| Dropdown content line one | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line two | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line three | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line four | ||
| </p> | ||
| </div> | ||
| </fwb-dropdown> | ||
| <fwb-dropdown | ||
| text="Alternative" | ||
| color="alternative" | ||
| > | ||
| <div class="w-52"> | ||
| <p class="p-2"> | ||
| Dropdown content line one | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line two | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line three | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line four | ||
| </p> | ||
| </div> | ||
| </fwb-dropdown> | ||
| <fwb-dropdown | ||
| text="Dark" | ||
| color="dark" | ||
| > | ||
| <div class="w-52"> | ||
| <p class="p-2"> | ||
| Dropdown content line one | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line two | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line three | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line four | ||
| </p> | ||
| </div> | ||
| </fwb-dropdown> | ||
| <fwb-dropdown | ||
| text="Light" | ||
| color="light" | ||
| > | ||
| <div class="w-52"> | ||
| <p class="p-2"> | ||
| Dropdown content line one | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line two | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line three | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line four | ||
| </p> | ||
| </div> | ||
| </fwb-dropdown> | ||
| <fwb-dropdown | ||
| text="Green" | ||
| color="green" | ||
| > | ||
| <div class="w-52"> | ||
| <p class="p-2"> | ||
| Dropdown content line one | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line two | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line three | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line four | ||
| </p> | ||
| </div> | ||
| </fwb-dropdown> | ||
| <fwb-dropdown | ||
| text="Red" | ||
| color="red" | ||
| > | ||
| <div class="w-52"> | ||
| <p class="p-2"> | ||
| Dropdown content line one | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line two | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line three | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line four | ||
| </p> | ||
| </div> | ||
| </fwb-dropdown> | ||
| <fwb-dropdown | ||
| text="Yellow" | ||
| color="yellow" | ||
| > | ||
| <div class="w-52"> | ||
| <p class="p-2"> | ||
| Dropdown content line one | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line two | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line three | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line four | ||
| </p> | ||
| </div> | ||
| </fwb-dropdown> | ||
| <fwb-dropdown | ||
| text="Purple" | ||
| color="purple" | ||
| > | ||
| <div class="w-52"> | ||
| <p class="p-2"> | ||
| Dropdown content line one | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line two | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line three | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line four | ||
| </p> | ||
| </div> | ||
| </fwb-dropdown> | ||
| <fwb-dropdown | ||
| text="Pink" | ||
| color="pink" | ||
| > | ||
| <div class="w-52"> | ||
| <p class="p-2"> | ||
| Dropdown content line one | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line two | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line three | ||
| </p> | ||
| <p class="p-2"> | ||
| Dropdown content line four | ||
| </p> | ||
| </div> | ||
| </fwb-dropdown> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { FwbDropdown } from '../../../../src/index' | ||
| </script> |
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
FwbDropdownExampleColorsfor the new example to work properly.Also we're missing
FwbDropdoenExampleCloseInsideimport 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 insideexample is fixed in #333I 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)