-
Notifications
You must be signed in to change notification settings - Fork 46
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
#1646 Panel accordions are not using the carbon standards #1648
#1646 Panel accordions are not using the carbon standards #1648
Conversation
Signed-off-by: srikant <[email protected]>
…cases by including tabContent Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
|
|
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
4a99a2b
to
f3e7f9c
Compare
Hi @matthoward366 Accordion Inside Accordion Issue is resolved. |
Did you make the change for |
padding: $spacing-06 $spacing-05 $spacing-05; | ||
|
||
|
||
.bx--accordion__item { |
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.
Can you give some details as to why we need to set each of these? I took out most of these a didn't notice an issue.
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 spacing is to keep it consistent with Accordions included in twisty panel and also with previous layout
canvas/canvas_modules/common-canvas/src/common-properties/panels/twisty/twisty.scss
Line 27 in 59dc2d5
padding: $spacing-06 $spacing-05 $spacing-05; |
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 fine but does this need to use the carbon class? Also, can you add a comment to why each of these carbon overrides are needed? For example why do we need to set transform: rotate(90deg);
?
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.
Since Accordion inside Accordions are not supported in Carbon Components carbon-design-system/carbon#4768 (comment) I am handling collapsed and expanded state to hide/unhide the inner accordion content and rotate accordion arrow present beside the header using these carbon classes.
border-bottom: 0; | ||
.properties-categories { | ||
.bx--accordion__item { | ||
margin: 3 -1rem; // Remove 16px outer padding for accordion title and content |
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.
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.
Thanks for the feedback, I have removed this in my latest commit.
…lerts when clicked Signed-off-by: srikant <[email protected]>
HI @matthoward366 Now multiple panels can be opened at the same time and also can navigate to panels with alerts. Please review. |
// Open Tab with Alert Message when from Alerts Tab or a open Default Tab | ||
open={ this.defaultOpenTab === tab.group || this.alertOpenTab === tab.group } | ||
onHeadingClick={this._showCategoryPanel.bind(this, tab.group)} | ||
className={`bx--accordion__item-${i} ${classNames("properties-category-content", |
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 are we using bx--accordion__item-${i}
for a classname? This seems odd.
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 have removed this classname now for the content.
padding: $spacing-06 $spacing-05 $spacing-05; | ||
|
||
|
||
.bx--accordion__item { |
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 fine but does this need to use the carbon class? Also, can you add a comment to why each of these carbon overrides are needed? For example why do we need to set transform: rotate(90deg);
?
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Hi @nmgokhale @matthoward366 I have included Carbon 11 Accordions in this PR, please review and let me know in case of any changes. Thanks. |
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
package-lock.json
Outdated
@@ -0,0 +1,1199 @@ | |||
{ | |||
"name": "canvas", |
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.
Delete package-lock.json file
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.
Hi @nmgokhale I have deleted package-lock.json file and updated the PR.
Signed-off-by: srikant <[email protected]>
|
Signed-off-by: srikant <[email protected]>
Signed-off-by: srikant <[email protected]>
Hi @nmgokhale
|
canvas_modules/common-canvas/src/common-properties/components/editor-form/editor-form.scss
Show resolved
Hide resolved
} | ||
|
||
// Remove Default borders for Accordions | ||
.cds--accordion__item { |
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.
Replace cds--accordion__item
with properties-category-content
.
.cds--tabs__nav { | ||
overflow-x: auto; // override carbon so scrollbar doesn't always show | ||
.properties-categories { | ||
.cds--accordion__item--active .cds--accordion__content { |
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 should be .properties-category-content .cds--accordion__content
Adding .cds--accordion__item--active
removes the CSS when multiple accordions are open.
} | ||
} | ||
} | ||
|
||
.properties-category-title { |
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 class no longer exists in the code.
} | ||
|
||
//Override default accordionitem height to match with previous panels | ||
.cds--accordion__heading { |
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.
You don't need this css. You can specify <Accordion size="lg">
in editor-form.jsx
file and it will add height 48px.
|
||
// Remove default accordion padding | ||
.cds--accordion__item--active .cds--accordion__wrapper { | ||
padding-block-end: 0px; |
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 still adding some top padding. Change this to -
// Remove default accordion padding
.properties-category-content .cds--accordion__wrapper {
padding: 0;
}
.properties-categories { | ||
.cds--accordion__item--active .cds--accordion__content { | ||
// 24px padding between accordion title and content (issue #3106) | ||
padding: $spacing-02 $spacing-05 $spacing-05; |
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.
Signed-off-by: srikant <[email protected]>
…l work Signed-off-by: srikant <[email protected]>
Hi @matthoward366 Could you please review Carbon 11 Accordion changes in this PR ? |
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.
Looks good
…yra-ai#1648) Signed-off-by: Matt Howard <[email protected]>
Fixes #1646
Developer's Certificate of Origin 1.1