-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Colorpicker] Add hex/alpha text fields #8294
Conversation
size-limit report 📦
|
@alex-page I recreated this from #2186 following this discussion: #2186 (comment) Apologies for the delay in returning to this work. Hopefully it will still be of use, if not it was still a good learning experience returning to it. |
@ruairiphackett this component is challenging and might be better suited as a pattern. The missing UX that you are building is not essential for every use case of the color picker. It's definitely useful but it's a composition of parts to create a solution. Take a look at patterns, we plan to add these as component code alongside our components. https://polaris.shopify.com/patterns If you do still want to ship this we would have to rewrite the layout using our new layout primitive components. https://polaris.shopify.com/components/layout-and-structure |
/snapit |
🫰✨ Thanks @acmertz! Your snapshots have been published to npm. Test the snapshots by updating your yarn add @shopify/[email protected] yarn add @shopify/[email protected] |
Hi! We noticed there hasn’t been activity on this PR in a while. After 30 days, it will close automatically. If it’s still relevant, or you have updates, comment and let us know. And don’t worry, you can always re-open later if needed. |
this needs to be merged asap :) 👍🏽 +1 |
@pama1999 no it doesn't. |
Okey then how about updating the docs of polaris and replacing the deprecated components with the new ones ;) |
@@ -36,6 +36,10 @@ | |||
"spinnerAccessibilityLabel": "Loading", | |||
"connectedDisclosureAccessibilityLabel": "Related actions" | |||
}, | |||
"ColorPicker": { | |||
"textPickerAccessibilityLabel": "HEX color", |
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.
Localization quality issue found
The following issues may affect the quality of localized translations if they are not addressed:
- The value
HEX color
for keyPolaris.ColorPicker.textPickerAccessibilityLabel
is very short. Short strings are more likely to be misunderstood by translators without context. Please provide additional context for the translators if possible.
Please look out for other instances of this issue in your PR and fix them as well if possible.
Questions about these messages? Hop in the #help-localization Slack channel.
@@ -36,6 +36,10 @@ | |||
"spinnerAccessibilityLabel": "Loading", | |||
"connectedDisclosureAccessibilityLabel": "Related actions" | |||
}, | |||
"ColorPicker": { | |||
"textPickerAccessibilityLabel": "HEX color", | |||
"alphaFieldAccessibilityLabel": "Alpha" |
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.
Localization quality issue found
The following issues may affect the quality of localized translations if they are not addressed:
- The value
Alpha
for keyPolaris.ColorPicker.alphaFieldAccessibilityLabel
is very short. Short strings are more likely to be misunderstood by translators without context. Please provide additional context for the translators if possible.
Please look out for other instances of this issue in your PR and fix them as well if possible.
Questions about these messages? Hop in the #help-localization Slack channel.
Hi! We noticed there hasn’t been activity on this PR in a while. After 30 days, it will close automatically. If it’s still relevant, or you have updates, comment and let us know. And don’t worry, you can always re-open later if needed. |
WHY are these changes introduced?
Fixes https://github.com/Shopify/polaris-ux-archive/issues/276 [archived issue].
Replacement for #2186
There was some interest by @alex-page in having this work revisited & I had been meaning to rework #2186 when I got a chance.
Some of the work in #2186 was already added in #4152.
This PR adds hex and transparency text fields to the
ColorPicker
to make colour picking functionality more accessible.The specific a11y issues it tries to solve are:
WHAT is this pull request doing?
Before:
After:
Adds a new optional prop
textEditor
toColorPicker
.When
textEditor
istrue
2 new text fields are added to theColorPicker
that allow the user to adjust the colour and alpha values by entering text values for each.There are also some new examples added to the
ColorPicker
storybook.Below is a description of allowed values for both fields:
TextPicker
Accepted values:
Text field that allows user to enter
hex
orrgb
values for the colour. The value will be entered when focus moves from the field or the user presses the enter key. The value is then converted and displayed as a 6 digithex
code.3 & 6 digit hex codes:
rgb colours:
Recording
AlphaField
Text field that allows user to enter a value between 0 and 100 for the colour's alpha value.
Pressing the up and down arrows while this field is in focus will increase and decrease the value by 1 respectively.
Holding the shift key and pressing the up and down arrows while this field is in focus will increase and decrease the value by 5 respectively.
Recording
How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
Copy-paste this code in
playground/Playground.tsx
:🎩 checklist
README.md
with documentation changes