-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
System 360 master #354
System 360 master #354
Conversation
Button motion
Easing curves
…into wonil-master
fix(style): added button active states
Hi @wonilsuh can you please add a staging link so we can do visual reviews of this too? All component PRs need too design reviews and two code reviews. |
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.
@wonilsuh Thank you for trying to contribute! Quickly reviewed the JavaScript code and put comments.
Besides the comment I made to the specific lines - My bigger question is if this added motion is something that should be applied to all Carbon users (e.g. Bluemix), or specific apps like the PR title seems to imply. I believe core Carbon team would have better ideas on this topic and interested in what they think.
src/components/dropdown/dropdown.js
Outdated
|
||
// iterate through children and accumulate height | ||
for(let childrenIterator = 0; childrenIterator < listEl.children.length; childrenIterator++){ | ||
itemHeightTotal += listEl.children[childrenIterator].offsetHeight; |
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 line causes forced synchronous layout. It’d be great if we don’t have to get the dimension via JavaScript. Otherwise the code should run asynchronously e.g. in rAF callback.
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 Asudo, I understand your concern regarding forced synchronous layout. The main reason for using this approach is to use duration that changes depending on the size of the element, which ensures smoother and consistent motion across experiences and products. I'll be committing slightly revised code shortly, but please let me know your thoughts on this.
) | ||
; | ||
this.element.style.transitionDuration = `${duration}ms`; | ||
this.element.style.height = `${0}px`; |
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 line does not seem to require a template string.
this.optionMenu.changeState(state, Object.assign(detail, { delegatorNode: this.element }), callback); | ||
this.optionMenu.changeState(state, Object.assign(detail, { delegatorNode: this.element }), () => { | ||
|
||
// if(state === 'shown'){ |
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.
Please remove those commented-out lines.
@@ -83,6 +105,8 @@ class OverflowMenu extends mixin(createComponent, initComponentBySearch, evented | |||
const state = shouldBeOpen ? 'shown' : 'hidden'; | |||
|
|||
if (isOfSelf) { | |||
console.log(`OverflowMenu._handleDocumentClick...shouldBeOpen===${shouldBeOpen}, isOfSelf===${isOfSelf}, classList===${element.classList}`, this.element); |
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.
Please remove this debugging code.
this.element.style.visibility = 'hidden'; | ||
this.element.style.height = 'auto'; | ||
let | ||
targetHeight = this.element.offsetHeight, |
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 line causes forced synchronous layout. It’d be great if we don’t have to get the dimension via JavaScript. Otherwise the code should run asynchronously e.g. in rAF callback.
package-lock.json
Outdated
@@ -0,0 +1,11859 @@ | |||
{ |
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 believe we are not putting package-lock.json in the repo.
src/components/dropdown/dropdown.js
Outdated
@@ -4,6 +4,8 @@ import initComponentBySearch from '../../globals/js/mixins/init-component-by-sea | |||
import trackBlur from '../../globals/js/mixins/track-blur'; | |||
import eventMatches from '../../globals/js/misc/event-matches'; | |||
import on from '../../globals/js/misc/on'; | |||
// import ibmMotion from '../../globals/js/misc/motion-generator'; |
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.
Please clean-up commented-out code.
@asudoh for now, we've decided we're going to adapt the static, css motion changes to the library. Animations that require dynamic motion will eventually be added. @wonilsuh has created the I was thinking that we could eventually just import this package as a dependency, and have the updated, dynamic motion bind to specific components via a data-attribute. What are your thoughts? |
Hi @tw15egan incorporating CSS-only motion changes totally makes sense as our short-term strategy. For long-term, we need to see if we can come up with a simple solution that doesn’t affect the codebase much, especially wrt its complexity that I think it’s your concern, too. I’m actually working with @wonilsuh on this (not to force squeezing it in but to see if we can come up with a solution our team can agree on), and what I have got so far is https://github.com/carbon-design-system/carbon-components/compare/master...asudoh:collapse?w=1 - Which introduces collapsible-element.js that does the most of expand/collapse animation and minimizing the impact to dropdown.js and floating-menu.js. It still impacts both JS files, though, because the |
Splitting this PR into smaller ones. Thank you guys. |
* update README and CONTRIBUTING to reflect a11y changes. * lost some text
this file is to replace the existing app icon template—deleted in this PR carbon-design-system/carbon-elements#353
Overview
This request includes updates to the following areas and components with the System 360 motion specs:
Global motion variables
The following variables in the following files were changes to the System 360 specs:
Added
@ibm/motion
package@ibm/motion NPM package was imported as a dev dependency to ensure that the motion definitions are up to date and in sync with other codebases that use the System 360 motion.
src/globals/js/misc/motion-generator.js
Button
Dropdown
Implements the full System 360 motion definitions
Overflow Menu / Floating Menu
Implements the full System 360 motion definition.
Toggle
Implements the System 360 motion definition.