Skip to content

Commit

Permalink
Merge branch 'master' into radioitem-disable
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltaranto authored May 13, 2022
2 parents 157df4b + cfc4f2a commit 68435de
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# braid-design-system

## 31.11.1

### Patch Changes

- **Button, ButtonLink:** Ensure `bleedY` is backwards compatibile for `transparent` variant ([#1106](https://github.com/seek-oss/braid-design-system/pull/1106))

Ensure that `bleedY` applies bleed only vertically on `transparent` variant, isolating the new horizontal bleed to the new `bleed` prop exclusively.

## 31.11.0

### Minor Changes
Expand Down
16 changes: 16 additions & 0 deletions lib/components/Button/Button.screenshots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,22 @@ export const screenshots: ComponentScreenshot = {
</Box>
),
},
{
label: 'With legacy bleedY (transparent)',
background: 'surface',
Example: () => (
<Box background="neutralLight" borderRadius="standard" padding="gutter">
<Box background="surface">
<Heading level="2">Heading</Heading>
<Inline space="none">
<Button bleedY variant="transparent">
Button
</Button>
</Inline>
</Box>
</Box>
),
},
{
label: 'With full bleed (transparent)',
background: 'surface',
Expand Down
6 changes: 2 additions & 4 deletions lib/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
tone,
icon,
bleedY,
bleed: bleedProp,
bleed,
variant,
loading,
type = 'button',
Expand All @@ -461,8 +461,6 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
},
ref,
) => {
const bleed = bleedProp || bleedY;

if (process.env.NODE_ENV !== 'production') {
if (typeof bleedY !== 'undefined') {
// eslint-disable-next-line no-console
Expand Down Expand Up @@ -502,7 +500,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
variant,
tone,
size,
bleed,
bleed: bleed || bleedY,
loading,
})}
>
Expand Down
12 changes: 8 additions & 4 deletions lib/components/ButtonLink/ButtonLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const ButtonLink = forwardRef<HTMLAnchorElement, ButtonLinkProps>(
tone,
variant,
bleedY,
bleed: bleedProp,
bleed,
icon,
loading,
data,
Expand All @@ -43,8 +43,6 @@ export const ButtonLink = forwardRef<HTMLAnchorElement, ButtonLinkProps>(
) => {
const LinkComponent = useLinkComponent(ref);

const bleed = bleedProp || bleedY;

if (process.env.NODE_ENV !== 'production') {
if (typeof bleedY !== 'undefined') {
// eslint-disable-next-line no-console
Expand All @@ -70,7 +68,13 @@ export const ButtonLink = forwardRef<HTMLAnchorElement, ButtonLinkProps>(
ref={ref}
{...restProps}
{...(data ? buildDataAttributes(data) : undefined)}
{...useButtonStyles({ variant, tone, size, bleed, loading })}
{...useButtonStyles({
variant,
tone,
size,
bleed: bleed || bleedY,
loading,
})}
>
<ButtonOverlays variant={variant} tone={tone} />

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "braid-design-system",
"version": "31.11.0",
"version": "31.11.1",
"description": "Themeable design system for the SEEK Group",
"main": "lib/components/index.ts",
"sideEffects": [
Expand Down
12 changes: 12 additions & 0 deletions site/src/componentUpdates.json
Original file line number Diff line number Diff line change
Expand Up @@ -2503,5 +2503,17 @@
"summary": "**Button, ButtonLink:** Improve Button `bleed`\n\nPreviously the `bleedY` prop allowed the background of `Button` to bleed vertically into the surrounding layout. This worked well for all variants except `transparent`, which needed to bleed horizontally as well.\n\nTo support this we have introduced the `bleed` prop which will apply the bleed based on the `variant`. We have also deprecated `bleedY` which will be removed in a future release.\n\n\n**EXAMPLE USAGE:**\n```diff\n <Button\n- bleedY\n+ bleed\n {...}\n >\n Button\n </Button>\n```\n\n**MIGRATION GUIDE**\n\nMigration from `bleedY` to `bleed` can be automated by running the Braid upgrade command, passing the `v31.11` version. You must provide a glob to target your project’s source files. For example:\n\n```\nyarn braid-upgrade v31.11 \"**/*.{ts,tsx}\"\n```\n\nIt is recommended to visually review the any `Button` usage with the `transparent` variant, to ensure the layout is as expected."
}
]
},
{
"version": "31.11.1",
"updates": [
{
"updated": [
"Button",
"ButtonLink"
],
"summary": "**Button, ButtonLink:** Ensure `bleedY` is backwards compatibile for `transparent` variant\n\nEnsure that `bleedY` applies bleed only vertically on `transparent` variant, isolating the new horizontal bleed to the new `bleed` prop exclusively."
}
]
}
]

0 comments on commit 68435de

Please sign in to comment.