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

HZX-47 auth buttons #544

Merged
merged 5 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Design system built with A11Y in mind. Developed as a [Lerna](https://lerna.js.o
- [Run unit tests](#run-unit-tests)
- [Run visual regression tests](#run-visual-regression-tests)
- [Approve the updated for visual regression test screenshots](#approve-the-updated-for-visual-regression-test-screenshots)
- [Generate new screenshots for the new/updated components](#generate-new-screenshots-for-the-newupdated-components)
- [Run all checks at once](#run-all-checks-at-once)
- [Releasing a new version](#releasing-a-new-version)

Expand Down Expand Up @@ -182,23 +181,6 @@ pnpm run test:visual

Now, if the test suite failed, we need to go to `packages/ui/.loki` and manually review the screenshots in the `current` folder and the diff in the `difference` folder. If we like what we see, we need to run `pnpm run test:visual:approve` in the `packages/ui` folder. It will update the reference screenshots.

### Generate new screenshots for the new/updated components

Go to `packages/ui` and run command for screenshot generation. The command builds storybook and updates screenshots.

```
cd packages/ui
pnpm run generate-screenshots
```

In case you see an error in the console `error:0308010C:digital envelope routines`

try to run first

```shell
export NODE_OPTIONS=--openssl-legacy-provider
```

### Run all checks at once

```
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions packages/ui/__stories__/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ const Template: ComponentStory<typeof Button> = ({ className, ...args }) => {
<Button {...props} color="authPrimary" />
<Button {...props} variant="outlined" color="authPrimary" />
<Button {...props} variant="text" color="authPrimary" />
<Button {...props} color="authSecondary" />
<Button {...props} color="authSecondary" disabled />
<Button {...props} variant="outlined" color="authSecondary" />
<Button {...props} variant="text" color="authSecondary" />
<Button {...props} size="medium" />
<Button {...props} variant="outlined" size="medium" />
<Button {...props} variant="text" size="medium" />
Expand All @@ -60,6 +64,10 @@ const Template: ComponentStory<typeof Button> = ({ className, ...args }) => {
<Button {...props} color="authPrimary" size="medium" />
<Button {...props} variant="outlined" color="authPrimary" size="medium" />
<Button {...props} variant="text" color="authPrimary" size="medium" />
<Button {...props} color="authSecondary" size="medium" />
<Button {...props} color="authSecondary" disabled size="medium" />
<Button {...props} variant="outlined" color="authSecondary" size="medium" />
<Button {...props} variant="text" color="authSecondary" size="medium" />
</div>
</div>
)
Expand Down
31 changes: 31 additions & 0 deletions packages/ui/src/Button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,37 @@
@include disabledButtonColor;
}
}

&AuthSecondary {
@include buttonColor(c.$authSecondary);

border-color: c.$colorNeutralWhite;

&:hover,
&.hover,
&:focus-visible,
&.focus {
@include buttonColor(lighten(c.$authSecondary, 10%));
}

&:active,
&.active {
@include buttonColor(darken(c.$authSecondary, 10%));
}

&.variantContained {
color: c.$colorNeutralWhite;
}

&.variantOutlined {
border-color: c.$authSecondary;
}

&:disabled {
color: c.$colorText;
background-color: c.$colorNeutralWhite;
}
}
}

&.variant {
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import styles from './Button.module.scss'
export type ButtonKind = 'primary' | 'secondary' | 'danger' | 'transparent'

export type ButtonVariant = 'contained' | 'outlined' | 'text'
export type ButtonColor = 'primary' | 'secondary' | 'warning' | 'brand' | 'authPrimary'
export type ButtonColor = 'primary' | 'secondary' | 'warning' | 'brand' | 'authPrimary' | 'authSecondary'

export type ButtonSize = 'medium' | 'small'

Expand Down Expand Up @@ -56,7 +56,7 @@ type ButtonNotDisabledProps = {
}

export type ButtonDisabledProps = {
disabledTooltip: string
disabledTooltip?: string
disabled: boolean
disabledTooltipVisible?: boolean
disabledTooltipPlacement?: TooltipProps['placement']
Expand Down
1 change: 1 addition & 0 deletions packages/ui/styles/constants/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ $colorBrand: #00bac6 !default;
$colorShadow: rgb(53 61 73 / 20%) !default;
$colorMenuDark: #333 !default;
$authPrimary: #c6ff3a !default;
$authSecondary: #0b2b39 !default;
Loading