Skip to content

Color area #2483

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

Merged
merged 35 commits into from
Feb 25, 2022
Merged

Color area #2483

merged 35 commits into from
Feb 25, 2022

Conversation

snowystinger
Copy link
Member

@snowystinger snowystinger commented Oct 22, 2021

Closes #1732 Closes #1118

This splits out the basic color area from the linked PR to make it a more manageable PR to review. The other two aspects that will come in followups will be Color conversions and Color names/translations.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

# Conflicts:
#	packages/@react-aria/color/package.json
#	packages/@react-stately/color/package.json
@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@LFDanLu
Copy link
Member

LFDanLu commented Feb 17, 2022

@snowystinger @majornista remind me, what was the decision regarding HSL/HSB support? I seem to remember that we decided that we didn't want to be in the business of supporting those ourselves and that users of ColorArea would need to do that themselves (maybe I'm misremembering entirely)? I ask because it would be nice to get the changes @majornista has in #2570 for translations and other fixes, but not sure about the HSL/HSB stuff included in that PR

@majornista
Copy link
Collaborator

majornista commented Feb 17, 2022

@snowystinger @majornista remind me, what was the decision regarding HSL/HSB support? I seem to remember that we decided that we didn't want to be in the business of supporting those ourselves and that users of ColorArea would need to do that themselves (maybe I'm misremembering entirely)? I ask because it would be nice to get the changes @majornista has in #2570 for translations and other fixes, but not sure about the HSL/HSB stuff included in that PR

@LFDanLu and @snowystinger We already support HSLA and HSBA in ColorSlider, and ColorWheel serves no purpose unless used in tandem with a Saturation/Brightness or Saturation/Lightness ColorArea. The conversion functions between RGB, HSL and HSB are already there. If you look at the Color class in #2570, very little has changed: https://github.com/adobe/react-spectrum/pull/2570/files#diff-2737484a486e2634802c43f60406fc1231698480673f4268bd1e8f029448bccc. To support HSL and HSB in ColorArea, I pretty much just added support for the different gradients in https://github.com/adobe/react-spectrum/pull/2570/files#diff-08d263feb9e1ca2c72c139d45f8b86c7288be44893f75e5cf202894ad6e46150. Most of the other changes are updating stories, tests and localizations.

@snowystinger
Copy link
Member Author

alpha isn't supporting hsl/hsb yet

@majornista
Copy link
Collaborator

majornista commented Feb 17, 2022

Why have a beta release of ColorWheel, that only changes to Hue value, without support for HSL/HSB in ColorArea?

I understand the desire to handle color conversions differently, but we are already doing all the conversions we need within @react-stately/color/src/Color.ts

@adobe-bot
Copy link

Build successful! 🎉

@snowystinger
Copy link
Member Author

Ah, that's a good point, hmmm

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

LGTM, confirmed the RTL behavior and new translations work as expected.

Copy link
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

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

LGTM. Tested Chrome, FF, Safari, iOS Safari

@adobe-bot
Copy link

Build successful! 🎉

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.

Implement ColorArea component
7 participants