Skip to content
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

Closed
wants to merge 41 commits into from
Closed

System 360 master #354

wants to merge 41 commits into from

Conversation

wonilsuh
Copy link

@wonilsuh wonilsuh commented Oct 9, 2017

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:

// src/components/button/_mixins.scss
$bx--ease-in
$bx--ease-out
$bx--standard-easing
$transition--base

Added

// src/globals/scss/_vars.scss
$bx--ease-in-out

@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.

  • added as a dev dependency
  • a proxy was created under src/globals/js/misc/motion-generator.js

Button

  • Updated bezier curve according to the System 360 specs
  • Updated duration according to the System 360 specs
// src/components/button/_mixins.scss
transition-timing-function

Dropdown

Implements the full System 360 motion definitions

  • Updated bezier curve
  • Dynamic duration that changes according to the size of the menu
  • Caret motion was updated to match the System 360 motion
  • Implements cascading motion to menu items
  • Updated the demo HTML for a better demonstration of the dynamic durations

Overflow Menu / Floating Menu

Implements the full System 360 motion definition.

  • Updated bezier curve
  • Dynamic duration that changes according to the size of the menu
  • Implements cascading motion to menu items
    • Updated the demo HTML for a better demonstration of the dynamic durations

Toggle

Implements the System 360 motion definition.

  • Updated bazier curve and duration

Shixie Shi Trofimov and others added 25 commits September 26, 2017 20:35
fix(style): added button active states
@tay-aitken
Copy link
Contributor

tay-aitken commented Oct 10, 2017

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.

Copy link
Contributor

@asudoh asudoh left a 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.


// iterate through children and accumulate height
for(let childrenIterator = 0; childrenIterator < listEl.children.length; childrenIterator++){
itemHeightTotal += listEl.children[childrenIterator].offsetHeight;
Copy link
Contributor

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.

Copy link
Author

@wonilsuh wonilsuh Oct 11, 2017

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`;
Copy link
Contributor

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'){
Copy link
Contributor

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);
Copy link
Contributor

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,
Copy link
Contributor

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.

@wonilsuh wonilsuh closed this Oct 11, 2017
@wonilsuh wonilsuh reopened this Oct 11, 2017
@wonilsuh wonilsuh closed this Oct 11, 2017
@wonilsuh wonilsuh reopened this Oct 11, 2017
@wonilsuh wonilsuh closed this Oct 11, 2017
@wonilsuh wonilsuh reopened this Oct 11, 2017
@asudoh
Copy link
Contributor

asudoh commented Oct 12, 2017

@wonilsuh wonilsuh closed this Oct 12, 2017
@wonilsuh wonilsuh reopened this Oct 12, 2017
@wonilsuh wonilsuh closed this Oct 12, 2017
@wonilsuh wonilsuh reopened this Oct 12, 2017
@@ -0,0 +1,11859 @@
{
Copy link
Contributor

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.

@@ -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';
Copy link
Contributor

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.

@tw15egan
Copy link
Collaborator

@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 @ibm/motion package that will help calculate easing based on the height of an element.

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?

@asudoh
Copy link
Contributor

asudoh commented Oct 13, 2017

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 open/shown states of those need to be applied after animation ends. I wouldn’t say such added complexity is non-trivial, so would like to have your team’s thoughts on it. e.g. Whether we should make this behavior optional, etc.

@wonilsuh wonilsuh closed this Oct 13, 2017
@wonilsuh
Copy link
Author

Splitting this PR into smaller ones. Thank you guys.

joshblack pushed a commit to joshblack/carbon that referenced this pull request May 2, 2019
* update README and CONTRIBUTING to reflect a11y changes.

* lost some text
joshblack pushed a commit to joshblack/carbon that referenced this pull request May 8, 2019
this file is to replace the existing app icon template—deleted in this PR carbon-design-system/carbon-elements#353
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants