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

chore(ui-react-native): Migrate Checkbox primitive #2621

Merged

Conversation

ioanabrooks
Copy link
Contributor

@ioanabrooks ioanabrooks commented Sep 20, 2022

Description of changes

This change:

  • migrates the checkbox primitive from react-native example package;
  • adds a global storybook decorator and removes all occurences from primitives;
  • refactors accessibilityRole for checkbox, heading and label primitives to allow users to specify it, while still providing defaults.

Kapture 2022-09-22 at 11 17 25

Issue #, if available

Description of how you validated changes

Ran storybook and example app in iOS and android.

Checklist

  • PR description included
  • yarn test passes
  • Tests are updated
  • No side effects or sideEffects field updated
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ioanabrooks ioanabrooks requested a review from a team as a code owner September 20, 2022 22:46
@changeset-bot
Copy link

changeset-bot bot commented Sep 20, 2022

⚠️ No Changeset found

Latest commit: 42073f2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@lgtm-com
Copy link

lgtm-com bot commented Sep 20, 2022

This pull request introduces 2 alerts when merging e5fa956 into 3848ca8 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

@ioanabrooks ioanabrooks temporarily deployed to ci September 20, 2022 23:03 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 20, 2022 23:03 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 20, 2022 23:03 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 20, 2022 23:03 Inactive
Copy link
Contributor

@joebuono joebuono left a comment

Choose a reason for hiding this comment

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

Nice job! Two global comments:

  1. Should this component be named Checkbox or CheckboxField? In the RWA, it's named CheckboxField, but there's also a Checkbox component under the hood.

  2. Should we add visual touch feedback based on platform expectations (e.g., material design touch feedback for Android, and iOS human interface guidelines). This could also include hitSlop handling for platform-specific touch target sizes

@ioanabrooks
Copy link
Contributor Author

Nice job! Two global comments:

  1. Should this component be named Checkbox or CheckboxField? In the RWA, it's named CheckboxField, but there's also a Checkbox component under the hood.
  2. Should we add visual touch feedback based on platform expectations (e.g., material design touch feedback for Android, and iOS human interface guidelines). This could also include hitSlop handling for platform-specific touch target sizes
  1. It should be named Checkbox bc it's not a form component. CheckboxField has validations for form purposes.
  2. Yeah I can look into that now, honestly was thinking to defer styling for the theming work, since will have to take a second pass on this anyways.

Copy link
Member

@calebpollman calebpollman left a comment

Choose a reason for hiding this comment

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

Great work! Let's sync offline about the handling of selected and value, not sure if my initial POC was well thought through in that terms of how those props should interact and the event cycle around them

@lgtm-com
Copy link

lgtm-com bot commented Sep 21, 2022

This pull request introduces 2 alerts when merging 5e7c98e into 3848ca8 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

@calebpollman calebpollman temporarily deployed to ci September 21, 2022 22:17 Inactive
@calebpollman calebpollman temporarily deployed to ci September 21, 2022 22:17 Inactive
@calebpollman calebpollman temporarily deployed to ci September 21, 2022 22:17 Inactive
@calebpollman calebpollman temporarily deployed to ci September 21, 2022 22:17 Inactive
@ioanabrooks
Copy link
Contributor Author

As per offline sync, to have parity with our react web component, th elabel should respond to press events as well as the icon. As follow-up PR, after the Icon primitive is implemented, the Checkbox primitive will be refactored to use a Pressable with Icon and Label.

@lgtm-com
Copy link

lgtm-com bot commented Sep 22, 2022

This pull request introduces 2 alerts when merging 151692d into 3848ca8 - view on LGTM.com

new alerts:

  • 2 for Unused variable, import, function or class

@ioanabrooks ioanabrooks temporarily deployed to ci September 22, 2022 18:56 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 22, 2022 18:56 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 22, 2022 18:56 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 22, 2022 18:56 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 22, 2022 21:59 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 22, 2022 21:59 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 22, 2022 21:59 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 22, 2022 21:59 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 23, 2022 00:51 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 23, 2022 00:51 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 23, 2022 00:51 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 23, 2022 00:51 Inactive
Co-authored-by: Caleb Pollman <cpollman@amazon.com>
onPress={handleOnChange}
source={selected ? icons.checkboxFilled : icons.checkboxOutline}
disabled
source={checked ? icons.checkboxFilled : icons.checkboxOutline}
size={size}
style={iconButtonStyle}
Copy link
Member

Choose a reason for hiding this comment

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

Let's make sure we clean up the buttonStyle prop and iconButtonStyle when we replace the IconButton

Co-authored-by: Caleb Pollman <cpollman@amazon.com>
Copy link
Member

@calebpollman calebpollman left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this @ioanabrooks!

Copy link
Contributor

@joebuono joebuono left a comment

Choose a reason for hiding this comment

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

Great job!

@ioanabrooks ioanabrooks temporarily deployed to ci September 23, 2022 17:55 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 23, 2022 17:55 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 23, 2022 17:55 Inactive
@ioanabrooks ioanabrooks temporarily deployed to ci September 23, 2022 17:55 Inactive
@ioanabrooks ioanabrooks merged commit 537f40d into in-app-messaging/main Sep 23, 2022
@ioanabrooks ioanabrooks deleted the in-app-messaging/checkbox-primitive branch September 23, 2022 18:16
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.

3 participants