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

Star Rating #887

Merged
merged 17 commits into from
Jan 11, 2022
Merged

Star Rating #887

merged 17 commits into from
Jan 11, 2022

Conversation

louismaximepiton
Copy link
Member

@louismaximepiton louismaximepiton commented Nov 8, 2021

Adding feature #61 to Boosted v5.

Preview: https://deploy-preview-887--boosted.netlify.app/docs/5.1/forms/checks-radios/#star-rating

Didn't know where to put disabled state of this component.

Dark version of this component may be removed with the resolution of #917

DoD

Development

  • Should match specs (eg. either the Web UI Kit or any pattern from the WAI — or both…)
  • Docs added:
    • including the "Sass" part using scss-docs shortcode
    • in /about/overview/#custom-components if it is a new Orange custom component
    • in /gettings-started/introduction/#components if it is a new Orange custom component that requires JavaScript (and Popper)
    • in /customize/overview#csps-and-embedded-svgs if it is a new Orange custom component that includes embedded SVGs in our CSS
    • in /forms/validation/?#supported-elements if it is a new Orange custom component that is a form control
    • in /forms/overview/ if it is a new Orange custom component that is a form control
  • Check (and fix) RTL version
  • Run linters
  • Run compilers
  • Tests added for JS-side
  • Run tests
  • Cross-browser test:
    • Firefox ESR
    • Latest Edge, Chrome, Firefox, Safari
    • iOS Safari
    • Chrome & Firefox on Android
  • Clean up the branch using rebase -i
  • Commited with feat(…): … message
  • Mention it in Migration Guide (if back-from-v4): renamed variables, changes in markup requirement, etc.

Reviews

  • Code review
  • A11y review
  • Design review

In order to import everything in forms but star rating system, please comment the last line.

@import "../../Orange-Boosted-Bootstrap/scss/functions";

@import "../../Orange-Boosted-Bootstrap/scss/variables";
@import "../../Orange-Boosted-Bootstrap/scss/maps";
@import "../../Orange-Boosted-Bootstrap/scss/mixins";
@import "../../Orange-Boosted-Bootstrap/scss/root";

@import "../../Orange-Boosted-Bootstrap/scss/helpers/visually-hidden";
@import "../../Orange-Boosted-Bootstrap/scss/forms/form-check";
@import "../../Orange-Boosted-Bootstrap/scss/forms/form-control";
@import "../../Orange-Boosted-Bootstrap/scss/forms/form-range";
@import "../../Orange-Boosted-Bootstrap/scss/forms/form-select";
@import "../../Orange-Boosted-Bootstrap/scss/forms/form-text";
@import "../../Orange-Boosted-Bootstrap/scss/forms/input-group";
@import "../../Orange-Boosted-Bootstrap/scss/forms/labels";
@import "../../Orange-Boosted-Bootstrap/scss/forms/validation";
@import "../../Orange-Boosted-Bootstrap/scss/forms/star-rating";

@louismaximepiton louismaximepiton linked an issue Nov 8, 2021 that may be closed by this pull request
@louismaximepiton louismaximepiton marked this pull request as ready for review November 22, 2021 13:44
Signed-off-by: louismaximepiton <louismaxime.piton@orange.com>
Signed-off-by: louismaximepiton <louismaxime.piton@orange.com>
Signed-off-by: louismaximepiton <louismaxime.piton@orange.com>
Copy link
Member

@julien-deramond julien-deramond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if it is placed in the documentation in "Forms", I'm wondering if we shouldn't be able to load it on demand. Not every projects would want to have this "component".

site/content/docs/5.1/forms/checks-radios.md Show resolved Hide resolved
site/content/docs/5.1/forms/checks-radios.md Show resolved Hide resolved
site/content/docs/5.1/forms/checks-radios.md Outdated Show resolved Hide resolved
site/content/docs/5.1/forms/checks-radios.md Outdated Show resolved Hide resolved
site/content/docs/5.1/forms/checks-radios.md Outdated Show resolved Hide resolved
site/content/docs/5.1/forms/checks-radios.md Outdated Show resolved Hide resolved
@julien-deramond julien-deramond changed the title feat(starRating): Added star Rating form component Star Rating Dec 30, 2021
Signed-off-by: louismaximepiton <louismaxime.piton@orange.com>
Signed-off-by: louismaximepiton <louismaxime.piton@orange.com>
@Franco-Riccitelli
Copy link

Hi, Here are my design comments.

  • For the large version, reduce the spacing between the stars by 2px.
  • For the small version, reduce the spacing between the stars by 1px.

Regarding the behaviour, now I've seen it working with the state changes, I think it would be better if the pressed state changes to orange. I appreciate this is different to what is specified in the Sketch artboards. Thanks

Signed-off-by: louismaximepiton <louismaxime.piton@orange.com>
.
Signed-off-by: louismaximepiton <louismaxime.piton@orange.com>
@louismaximepiton
Copy link
Member Author

louismaximepiton commented Jan 7, 2022

Hi, I modified some things to fit your comment @Franco-Riccitelli.

However, the orange star on focus will be hard to implement with the actual version. I think that it'll be easier for each project to implement it if they want so.

The orange star is possible with the following code. However, it won't be implemented because it adds too much css only for a little change + the overrride of browsers native behavior isn't wanted here.

.star-rating {
  ...
  &:active {
      & input + label{
        @include form-star-rating($accessible-orange);
      }
  
      > input:checked ~ label {
        @include form-star-rating($gray-500);
      }
  
      > input:checked + label {
        @include form-star-rating($accessible-orange);
      }
  
      > input:active ~ label {
        @include form-star-rating($gray-500);
      }
  
      > input:active + label {
        @include form-star-rating($accessible-orange);
      }
    }
  }

Signed-off-by: louismaximepiton <louismaxime.piton@orange.com>
Signed-off-by: louismaximepiton <louismaxime.piton@orange.com>
Copy link
Member

@julien-deramond julien-deramond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me after the latest modifications, the a11y and design reviews 🚀

@julien-deramond julien-deramond merged commit 1b6a61e into main Jan 11, 2022
@julien-deramond julien-deramond deleted the main-lmp-star-rating branch January 11, 2022 15:00
@julien-deramond julien-deramond mentioned this pull request Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rating stars
3 participants