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

[React Native]: Create ButtonSecondary component in shared UI component library #178

Open
brianacnguyen opened this issue Nov 27, 2024 · 0 comments
Assignees

Comments

@brianacnguyen
Copy link
Contributor

brianacnguyen commented Nov 27, 2024

Description

Create a ButtonSecondary variant for the Button component in React Native. This component will serve as the secondary button variant, adhering to the design specifications outlined in the Button Audit and Insight Report Figma Board. It should integrate seamlessly with the shared UI component library and follow best practices for accessibility and responsiveness.

Technical Details

  • Component Implementation:

    • Extend or compose the ButtonBase component to create the ButtonSecondary variant.
    • Default props for this variant:
      • variant: "secondary"
      • Styles specific to the secondary button, such as border, background, and typography, based on design tokens.
    • Props to support:
      • size?: ButtonSize.Xs | ButtonSize.Sm | ButtonSize.Md | ButtonSize.Lg | ButtonSize.Xl
      • disabled?: boolean
      • onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void
      • iconLeft?: ReactNode
      • iconRight?: ReactNode
      • className?: string
  • Styling:

    • Apply twrnc classes to implement the secondary button's unique appearance.
    • Include styles for hover, focus, active, and disabled states.
    • The ButtonSecondary styling should clearly differentiate from ButtonPrimary while maintaining harmony with the design system.
  • Integration:

    • Ensure compatibility with design tokens for colors, typography, and spacing.
    • Confirm alignment with global design standards and spacing rules.
  • Testing:

    • Add unit tests using Jest and React Testing Library.
    • Include interaction tests for hover, focus, active, and disabled states.
    • Validate keyboard and screen reader accessibility.
  • Documentation:

    • Add stories for the ButtonSecondary variant in Storybook, including:
      • Default appearance.
      • Usage with icons.
      • Different sizes and states.
    • Provide usage examples in the component library documentation.

Acceptance Criteria

  • The ButtonSecondary variant matches the design specs in the Button Audit and Insight Report Figma Board.
  • Component implementation includes:
    • Styling for secondary appearance and all interactive states.
    • Support for all required props and their variations.
  • Unit tests cover at least 80% of the component’s functionality.
  • Component is reviewed and approved by both engineering and design teams.
  • Documentation includes examples, prop descriptions, and integration details.
  • Meets all aspects of the Definition of Done.

References

@brianacnguyen brianacnguyen changed the title Copy of [React]: Create ButtonSecondary component in shared UI component library [React Native]: Create ButtonSecondary component in shared UI component library Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants