-
Notifications
You must be signed in to change notification settings - Fork 71
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: vertical oriented button group #755
feat: vertical oriented button group #755
Conversation
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.
@ruanyl Nice! just a few questions
@@ -123,20 +123,43 @@ | |||
.ouiButtonGroup--small { | |||
.ouiButtonGroupButton { | |||
border: $ouiBorderThin; | |||
} |
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.
Why dont we want border thin for vertical?
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.
both vertical and horizontal has $ouiBorderThin
which set on line 125.
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.
Oops yeah my bad
@@ -123,20 +123,43 @@ | |||
.ouiButtonGroup--small { | |||
.ouiButtonGroupButton { | |||
border: $ouiBorderThin; | |||
} |
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.
} | |
&:not(:first-child) { | |
margin-left: -1px; | |
} | |
} |
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.
This is set on line 133 under &:not(.ouiButtonGroup--vertical)
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.
I should not review PR's when im sleepy. yes you are right. I did not notice that the margin properties changed are different even though the values are the same.
@ruanyl great question re: compressed. I'm not entirely familiar with the implementation details so apologies if this is a bit naïve - Is there an approach where we can expand compressed beyond just a boolean? So if orientation = vertical and compressed = true then fixed width and if orientation = horizontal and compressed = true then fixed height ? I'm wondering if the way this was structured is why some of the other components have orientation split into different components all together. |
Technically it is doable, but if orientation = vertical with fixed width could potentially problematic as the button text might overflow.
Do you have an example of this? |
|
@@ -166,13 +171,24 @@ export const OuiButtonGroup: FunctionComponent<Props> = ({ | |||
); | |||
} | |||
|
|||
// Compressed style can't support `vertical` orientation because compressed button group has a fixed height |
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.
I don't get why this would be a blocker. A variation of height: auto
with a fixed-width would be enough to bypass this. no?
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.
@KrooshalUX what's your opinion of a vertical compressed button group should look like?
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.
@KrooshalUX It would be nice to have UX suggestion on a vertical
+ compressed
button
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.
Docs on compressed
: https://oui.opensearch.org/1.2/#/forms/compressed-forms
I think the idea is to have any sort of spacing smaller than uncompressed
@ruanyl @KrooshalUX Is this a requirement for any 2.10 features? |
@joshuarrrr No, this is just an improvement |
@joshuarrrr nope, just something we want eventually. @ruanyl can you outline where we are blocked ? |
@KrooshalUX This is not a blocker. |
@ruanyl oh, no , to clarify - understood its not a blocker for 2.10, but where are we blocked on finishing the issue? I am not sure if there is any outstanding decisions / need from UX ? |
I'm going to mark this as a draft for now, but @ruanyl feel free to take it out of draft status when you're able to make the updates. |
This commit added a new prop(orientation) to the current OuiButtonGroup, the possible values are `horizontal` and `vertical`. The default value is `horizontal` which match the current UI behavior. With `vertical` prop, the button group will be oriented vertically. related issue: opensearch-project#659 Signed-off-by: Yulong Ruan <[email protected]>
0f0536a
to
5c00252
Compare
@virajsanghvi @AMoo-Miki @ashwin-pc Finally get the PR updated, could you take another look please? |
Can you add a changelog entry? Curious, where would this be used in OSD? Is this part of any designs? |
Signed-off-by: Yulong Ruan <[email protected]>
Signed-off-by: Yulong Ruan <[email protected]>
Signed-off-by: Yulong Ruan <[email protected]>
@virajsanghvi PR updated, could you take another look please? |
Signed-off-by: Yulong Ruan <[email protected]>
* feat: vertical oriented button group This commit added a new prop(orientation) to the current OuiButtonGroup, the possible values are `horizontal` and `vertical`. The default value is `horizontal` which match the current UI behavior. With `vertical` prop, the button group will be oriented vertically. related issue: #659 Signed-off-by: Yulong Ruan <[email protected]> * doc(changelog): add changelog for vertical button group Signed-off-by: Yulong Ruan <[email protected]> * fix(lint): fix sass lint Signed-off-by: Yulong Ruan <[email protected]> --------- Signed-off-by: Yulong Ruan <[email protected]> (cherry picked from commit 3c191a5) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
Description
This commit added a new prop(orientation) to the current OuiButtonGroup, the possible values are
horizontal
andvertical
. The default value ishorizontal
which match the current UI behavior. Withvertical
prop, the button group will be oriented vertically.Example:
Issues Resolved
#659
Check List
yarn lint
yarn test-unit
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.