-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PBNTR-389](Dropdown work - States & Variant Prop [ 1 of 5]) (#3828)
[PBNTR-389](https://runway.powerhrg.com/backlog_items/PBNTR-389) This PR adds new state styles and a variant prop with a subtle doc example! <img width="754" alt="Screenshot 2024-09-30 at 2 04 45 PM" src="https://github.com/user-attachments/assets/1a732f3b-ab25-4fd4-ba6f-547ff26bf05a"> **How to test?** Steps to confirm the desired behavior: 1. Go to the dropdown kit and confirm styles! #### Checklist: - [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new kit`, `deprecated`, or `breaking`. See [Changelog & Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels) for details. - [x] **DEPLOY** I have added the `milano` label to show I'm ready for a review. - [ ] **TESTS** I have added test coverage to my code.
- Loading branch information
1 parent
693a86c
commit f4c5e2f
Showing
10 changed files
with
195 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
playbook/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<% | ||
options = [ | ||
{ label: 'United States', value: 'United States', id: 'us' }, | ||
{ label: 'Canada', value: 'Canada', id: 'ca' }, | ||
{ label: 'Pakistan', value: 'Pakistan', id: 'pk' }, | ||
] | ||
|
||
%> | ||
<%= pb_rails("dropdown", props: {options: options, separators: false}) %> |
33 changes: 33 additions & 0 deletions
33
playbook/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react' | ||
import { Dropdown } from 'playbook-ui' | ||
|
||
const DropdownSeparatorsHidden = (props) => { | ||
|
||
const options = [ | ||
{ | ||
label: "United States", | ||
value: "United States", | ||
}, | ||
{ | ||
label: "Canada", | ||
value: "Canada", | ||
}, | ||
{ | ||
label: "Pakistan", | ||
value: "Pakistan", | ||
} | ||
]; | ||
|
||
|
||
return ( | ||
<div> | ||
<Dropdown | ||
options={options} | ||
separators={false} | ||
{...props} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default DropdownSeparatorsHidden |
10 changes: 10 additions & 0 deletions
10
playbook/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<% | ||
options = [ | ||
{ label: 'United States', value: 'United States', id: 'us' }, | ||
{ label: 'Canada', value: 'Canada', id: 'ca' }, | ||
{ label: 'Pakistan', value: 'Pakistan', id: 'pk' }, | ||
] | ||
|
||
%> | ||
|
||
<%= pb_rails("dropdown", props: { options: options, variant: "subtle", separators: false }) %> |
34 changes: 34 additions & 0 deletions
34
playbook/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react' | ||
import { Dropdown } from 'playbook-ui' | ||
|
||
const DropdownSubtleVariant = (props) => { | ||
|
||
const options = [ | ||
{ | ||
label: "United States", | ||
value: "United States", | ||
}, | ||
{ | ||
label: "Canada", | ||
value: "Canada", | ||
}, | ||
{ | ||
label: "Pakistan", | ||
value: "Pakistan", | ||
} | ||
]; | ||
|
||
|
||
return ( | ||
<> | ||
<Dropdown | ||
options={options} | ||
separators={false} | ||
variant="subtle" | ||
{...props} | ||
/> | ||
</> | ||
) | ||
} | ||
|
||
export default DropdownSubtleVariant |
1 change: 1 addition & 0 deletions
1
playbook/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
For the `subtle` variant, it is recommended that you set the `Separators` prop to `false` to remove the separator lines between the options for a more cleaner look. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters