-
Notifications
You must be signed in to change notification settings - Fork 67
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
Button Group: Add new component #2110
Conversation
Modify Button Add Button Group
✅ Deploy Preview for moduswebcomponents 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.
Good tests here - and thanks.
Jim
@ElishaSamPeterPrabhu I found this example of a button group i think we can mimic how they handle the rounded borders. Also, we need to talk to Ewa about the style. The guidelines currently only show outline and thats all she wants us to implement... but it makes things interesting as the button group could accept any buttons naturally as they are configured if we wanted to.. mixing and matching styles would be odd but doable. The alternative being that we can have a different child component... For now, see if you can manage handling the border radius using css variables like my example. As for as the I'd almost want to just have it be <modus-button-group>
<modus-button type="button"></modus-button>
<modus-button type="toggle"></modus-button>
<modus-button type="button"></modus-button>
</modus-button-group> but this leads to people being able to set random sizes, colors, and styles... which would be stupid to do but they could do it... With your current method or remapping, it could solve that, but it also adds complexity where we could simply just have a slot and throw the buttons in there and let the user deal with each buttons events individually. Just putting all my current thoughts down as I haven't updated this PR with any of them yet. |
I tried the slotting method from the above github link am unable to modify the css properties of the modus button from the button group. In my opinion user's mismatching the button style should be forbidden, as I consider the button group a separate component and shouldn't have different buttons present on a list of buttons inside the button group .Hence showing the outline alone is fine. Regarding the toggleable functionality , since we are toggling between one button and another shouldn't all the buttons of a button group carry the same type either toggle or button? |
Update test cases Update css of group update modus-button css
@ElishaSamPeterPrabhu We will still need the |
@@ -0,0 +1,9 @@ | |||
export const OUTLINE_STYLE = 'outline'; |
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.
Some of these aren't used anymore
@@ -0,0 +1,19 @@ | |||
import { |
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.
Cleanup unused. Those we should keep Selection Type as we should have that property.
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.
Cleaned up
buttons.forEach((button: HTMLModusButtonElement) => { | ||
button.disabled = this.disabled; | ||
button.buttonStyle = 'outline'; | ||
button.type = 'toggle'; |
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.
Should only be type toggle when selection type is single, and we would need to add an event listener to make sure only one button is clicked at a time. So you can keep track of selectedButtons and set isActive to false on any in that array (multiple select coming later would probably need this to be an array).
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.
isActive is a state in modus-button,
so are you saying to modify it from button groups?
I removed the selection-type previously because I thought we didn't finalize on the selection methods . |
Update with selectedButtons Prop
…oss/modus-web-components into issue-1558/Button-Group # Conflicts: # stencil-workspace/src/components/modus-icons/readme.md # stencil-workspace/src/components/modus-text-input/readme.md
…nents into issue-1558/Button-Group # Conflicts: # angular-workspace/ng14/projects/trimble-oss/modus-angular-components/src/lib/stencil-generated/components.ts # angular-workspace/ng14/projects/trimble-oss/modus-angular-components/src/lib/stencil-generated/index.ts # angular-workspace/ng15/projects/trimble-oss/modus-angular-components/src/lib/stencil-generated/components.ts # angular-workspace/ng15/projects/trimble-oss/modus-angular-components/src/lib/stencil-generated/index.ts # angular-workspace/ng16/projects/trimble-oss/modus-angular-components/src/lib/stencil-generated/components.ts # angular-workspace/ng16/projects/trimble-oss/modus-angular-components/src/lib/stencil-generated/index.ts # angular-workspace/ng17/projects/trimble-oss/modus-angular-components/src/lib/stencil-generated/components.ts # angular-workspace/ng17/projects/trimble-oss/modus-angular-components/src/lib/stencil-generated/index.ts # react-workspace/react-17/src/components/stencil-generated/index.ts # react-workspace/react-18/src/components/stencil-generated/index.ts
Description
References: #1558
Type of change
How Has This Been Tested?
https://deploy-preview-2110--moduswebcomponents.netlify.app/?path=/docs/components-buttongroup--default-selection-button-group
Checklist