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

Add callout button components #9063

Closed
2 tasks
techanvil opened this issue Jul 23, 2024 · 2 comments
Closed
2 tasks

Add callout button components #9063

techanvil opened this issue Jul 23, 2024 · 2 comments
Labels
P1 Medium priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature

Comments

@techanvil
Copy link
Collaborator

techanvil commented Jul 23, 2024

Feature Description

As mentioned on Figma, we have a new set of button designs that will be used for CTAs in callouts:

image

These will be used in callout notifications, for example:

Success notifications:
image

image

Warning notifications:
image

Error notifications:
image

The requirement for this issue is to create the buttons. Existing notifications will be updated to use the new components in a followup issue or issues.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The buttons in the button-1 callouts Figma design should be available to use as a component. This should be as part of the Button component with a callout prop and another prop(s) to set the button style for each specified in Figma.
    • For now, only the versions without the "+" icon should be created.
  • These buttons should appear in a Storybook story and in Visual Regression tests.

Implementation Brief

  • Update assets/js/googlesitekit/components-gm2/Button.js
    • Include a new props callout - null by default, and calloutStyle - string enum, should accept one of the following primary|warning|error (include it in the propTypes)
    • Add additional OR check for raised class
      'mdc-button--raised': ! text && ! tertiary,
      so if callout prop is passed, it does not render this class. This will make it for easier usage, otherwise we would need to pass text prop for every callout button
    • Conditionally include three more classes based on the value of calloutStyle prop, and one for the callout prop. So for the callout, you can use mdc-button--callout and for the style, mdc-button--warning, etc
  • Add base .mdc-button--callout styles in assets/sass/vendor/_mdc-button.scss and nest the 3 style variation classes under it to apply different color variations, specific to that class
    • You can borrow some basic styling from .mdc-button--tertiary - but note vertical padding is slightly smaller on callout button then current one for tertiary button, and height is smaller by 8px on callout button, etc.
    • Ensure basic style and interactive ones for all 3 variations match the figma design, referenced in the AC
  • Skip the variations with plus icon as mentioned in the AC

Test Coverage

  • Add the new button variations to the buttons story assets/js/googlesitekit/components-gm2/Button.stories.js and into the VRT.

QA Brief

  • Check the global button component stories file
  • Verify that they match the design

Changelog entry

  • Add callout buttons.
@techanvil techanvil added P1 Medium priority Type: Enhancement Improvement of an existing feature labels Jul 23, 2024
@techanvil techanvil changed the title Add callout button components Add callout button components. Jul 23, 2024
@techanvil techanvil changed the title Add callout button components. Add callout button components Jul 23, 2024
@tofumatt tofumatt assigned tofumatt and unassigned tofumatt Jul 23, 2024
@zutigrm zutigrm assigned zutigrm and unassigned zutigrm Jul 24, 2024
@eugene-manuilov eugene-manuilov self-assigned this Jul 24, 2024
@eugene-manuilov
Copy link
Collaborator

IB ✔️

@eugene-manuilov eugene-manuilov removed their assignment Jul 24, 2024
@binnieshah binnieshah added the Team S Issues for Squad 1 label Jul 24, 2024
@zutigrm zutigrm self-assigned this Jul 31, 2024
@zutigrm zutigrm mentioned this issue Aug 1, 2024
18 tasks
@zutigrm zutigrm removed their assignment Aug 1, 2024
@mohitwp
Copy link
Collaborator

mohitwp commented Aug 4, 2024

QA Update ✅

  • Tested on dev environment.
  • Verified the the global button component stories file.
  • Tested and compared with Figma design.
  • Verified all callout button versions are implemented same as Figma design.

Callout button

image

image

image

image

Callout Warning

image

image

image

image

Callout Error Button

image

image

image

image

Disabled callout

image

image

Disabled Warning Callout Button

image

image

Disabled Error Callout Button

image

image

@mohitwp mohitwp removed their assignment Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Medium priority Team S Issues for Squad 1 Type: Enhancement Improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

7 participants