Skip to content

Commit

Permalink
Merge 3a81b51 into 954170b
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthkp authored Sep 25, 2024
2 parents 954170b + 3a81b51 commit a2532c3
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/flat-weeks-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Banner: Fix alignment of secondary action without primary action
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.
5 changes: 5 additions & 0 deletions e2e/components/Banner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ const stories: Array<{title: string; id: string; viewports?: Array<keyof typeof
id: 'experimental-components-banner-features--dismissible-with-hidden-title-and-actions',
viewports: ['primer.breakpoint.xs', 'primer.breakpoint.sm'],
},
{
title: 'DismissibleWithHiddenTitleAndSecondaryAction',
id: 'experimental-components-banner-features--dismissible-with-hidden-title-and-secondary-action',
viewports: ['primer.breakpoint.xs', 'primer.breakpoint.sm'],
},
{
title: 'InSidebar',
id: 'experimental-components-banner-examples--in-sidebar',
Expand Down
23 changes: 22 additions & 1 deletion packages/react/src/Banner/Banner.features.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import {CopilotIcon} from '@primer/octicons-react'
import {CopilotIcon, GitPullRequestIcon} from '@primer/octicons-react'
import {action} from '@storybook/addon-actions'
import type {Meta} from '@storybook/react'
import {Banner} from '../Banner'
Expand Down Expand Up @@ -206,6 +206,27 @@ export const DismissibleWithHiddenTitleAndActions = () => {
)
}

export const DismissibleWithHiddenTitleAndSecondaryAction = () => {
return (
<Banner
title="Warning"
hideTitle
description={
<>
GitHub users are{' '}
<Link inline underline href="#">
now required
</Link>{' '}
to enable two-factor authentication as an additional security measure.
</>
}
onDismiss={action('onDismiss')}
variant="warning"
secondaryAction={<Banner.SecondaryAction leadingVisual={GitPullRequestIcon}>Button</Banner.SecondaryAction>}
/>
)
}

export const WithActions = () => {
return (
<Banner
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/Banner/Banner.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@

.BannerActions [data-primary-action='trailing'] {
display: flex;
min-height: var(--base-size-32, 2rem);
}

.BannerActions [data-primary-action='leading'] {
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/Banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ const BannerContainerQuery = `
.BannerActions [data-primary-action="trailing"] {
display: flex;
min-height: var(--base-size-32, 2rem);
}
.BannerActions [data-primary-action="leading"] {
Expand Down

0 comments on commit a2532c3

Please sign in to comment.