Skip to content
Open
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
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.
12 changes: 12 additions & 0 deletions packages/react/src/Hidden/Hidden.examples.stories.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.Container {
padding: var(--base-size-16);
}

.DescriptionText {
font-size: var(--text-body-size-small);
color: var(--fgColor-muted);
}

.BoldLink {
font-weight: var(--base-text-weight-semibold);
}
21 changes: 11 additions & 10 deletions packages/react/src/Hidden/Hidden.examples.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type {Meta} from '@storybook/react-vite'
import {Button, Link, Text, StateLabel, BranchName, Box} from '..'
import {Button, Link, StateLabel, BranchName} from '..'
import {ArrowRightIcon} from '@primer/octicons-react'

import {PageHeader} from '../PageHeader'
import {Hidden} from '.'
import classes from './Hidden.examples.stories.module.css'

export default {
title: 'Experimental/Components/Hidden/Examples',
Expand All @@ -20,7 +21,7 @@ const setViewportParamToNarrow = {
},
}
export const Webhooks = () => (
<Box sx={{padding: 3}}>
<div className={classes.Container}>
<PageHeader role="banner" aria-label="Webhooks">
<PageHeader.ContextArea>
<PageHeader.ParentLink href="http://github.com">Repository settings</PageHeader.ParentLink>
Expand All @@ -39,7 +40,7 @@ export const Webhooks = () => (
</PageHeader.Actions>
</PageHeader.TitleArea>
</PageHeader>
</Box>
</div>
)

export const WebhooksOnNarrowViewport = () => {
Expand All @@ -49,7 +50,7 @@ export const WebhooksOnNarrowViewport = () => {
WebhooksOnNarrowViewport.parameters = setViewportParamToNarrow

export const PullRequestPage = () => (
<Box sx={{padding: 3}}>
<div className={classes.Container}>
<PageHeader role="banner" aria-label="Add Hidden utility component">
<PageHeader.ContextArea>
<PageHeader.ParentLink href="http://github.com">Pull requests</PageHeader.ParentLink>
Expand All @@ -60,8 +61,8 @@ export const PullRequestPage = () => (
<PageHeader.Description>
<StateLabel status="pullOpened">Open</StateLabel>
<Hidden when={['narrow']}>
<Text sx={{fontSize: 1, color: 'fg.muted'}}>
<Link href="#" muted sx={{fontWeight: 'bold'}}>
<span className={classes.DescriptionText}>
<Link href="#" muted className={classes.BoldLink}>
broccolinisoup
</Link>{' '}
wants to merge 3 commits into
Expand All @@ -72,18 +73,18 @@ export const PullRequestPage = () => (
<BranchName href="#" style={{textDecoration: 'underline'}}>
broccolinisoup/add-hidden-component
</BranchName>
</Text>
</span>
</Hidden>
<Hidden when={['regular', 'wide']}>
<Text sx={{fontSize: 1, color: 'fg.muted'}}>
<span className={classes.DescriptionText}>
<BranchName href="#">main</BranchName>
<ArrowRightIcon />
<BranchName href="#">page-header-initial</BranchName>
</Text>
</span>
</Hidden>
</PageHeader.Description>
</PageHeader>
</Box>
</div>
)

export const PullRequestPageOnNarrowViewport = () => {
Expand Down
Loading