-
Notifications
You must be signed in to change notification settings - Fork 616
feat: add support for size to Blankslate #5899
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
8d8a676
feat: add support for HTML attributes to blankslate components
joshblack f8cb205
feat: add support for variant to Blankslate
joshblack 71b61f2
chore: add changeset
joshblack f32c348
update code connect file for BlankSlate
lukasoppermann a642bf0
refactor(Blankslate): update variant to size
joshblack 70caaa6
chore: update changeset
joshblack e842def
chore: fix eslint errors
joshblack f87c244
Merge branch 'main' into feat/update-blankslate
joshblack 074679d
fix: update border color, e2e test
joshblack 54a30c3
Merge branch 'feat/update-blankslate' of github.com:primer/react into…
joshblack 4dc6e32
test(vrt): update snapshots
joshblack a99df82
Merge branch 'main' into feat/update-blankslate
francinelucca 1dcce51
fix: update padding when size is small and not spacious
joshblack b15f6d5
test(vrt): update snapshots
joshblack 4e45afa
Merge branch 'main' of github.com:primer/react into feat/update-blank…
joshblack 799c636
fix: update stories, add size=small support for actions
joshblack 6705fe8
docs: add specific toggles for primary/secondary actions
joshblack da8cd14
test(vrt): update snapshots
joshblack f607bfd
Merge branch 'main' into feat/update-blankslate
joshblack 2ad940d
Merge branch 'main' of github.com:primer/react into feat/update-blank…
joshblack 62bb259
test: update tests for new style of attributes
joshblack File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@primer/react': minor | ||
--- | ||
|
||
Add support for different variants for sizing to Blankslate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@primer/react': minor | ||
--- | ||
|
||
Add support for HTML attributes being passed to Blankslate components |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1,75 @@ | ||
import React from 'react' | ||
import {Blankslate} from '../Blankslate' | ||
import figma from '@figma/code-connect' | ||
import type {Primary} from '../Button/IconButton.features.stories' | ||
|
||
const props = { | ||
leadingVisual: figma.nestedProps('_BlankslateVisual', { | ||
item: figma.children('leadingVisual'), | ||
}), | ||
size: figma.enum('size', { | ||
small: 'small', | ||
medium: 'medium', | ||
large: 'large', | ||
}), | ||
spacious: figma.boolean('spacious'), | ||
border: figma.boolean('border'), | ||
heading: figma.textContent('Text: Heading'), | ||
description: figma.textContent('Text: Description'), | ||
PrimaryAction: figma.children('_BlankSlate.PrimaryAction'), | ||
SecondaryActionText: figma.boolean('SecondaryAction?', { | ||
true: figma.textContent('Secondary action link'), | ||
false: undefined, | ||
}), | ||
} | ||
|
||
figma.connect(Blankslate, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=4398-2383&m=dev', { | ||
props: { | ||
leadingVisual: figma.nestedProps('_BlankslateVisual', { | ||
item: figma.children('leadingVisual'), | ||
}), | ||
narrow: figma.boolean('narrow?'), | ||
spacious: figma.boolean('spacious?'), | ||
border: figma.boolean('border?'), | ||
heading: figma.textContent('Text: Heading'), | ||
description: figma.textContent('Text: Description'), | ||
}, | ||
variant: {primaryAction: 'false', secondaryAction: 'false'}, | ||
example: ({leadingVisual, border, spacious, narrow, description, heading}) => ( | ||
<Blankslate border={border} spacious={spacious} narrow={narrow}> | ||
props, | ||
variant: {'SecondaryAction?': 'true'}, | ||
example: ({leadingVisual, border, spacious, size, description, heading, SecondaryActionText, PrimaryAction}) => ( | ||
<Blankslate border={border} spacious={spacious} variant={size}> | ||
<Blankslate.Visual>{leadingVisual.item}</Blankslate.Visual> | ||
<Blankslate.Heading>{heading}</Blankslate.Heading> | ||
<Blankslate.Description>{description}</Blankslate.Description> | ||
<Blankslate.SecondaryAction href="">{SecondaryActionText}</Blankslate.SecondaryAction> | ||
{PrimaryAction} | ||
</Blankslate> | ||
), | ||
}) | ||
figma.connect(Blankslate, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=4398-2383&m=dev', { | ||
props: { | ||
leadingVisual: figma.nestedProps('_BlankslateVisual', { | ||
item: figma.children('leadingVisual'), | ||
}), | ||
narrow: figma.boolean('narrow?'), | ||
spacious: figma.boolean('spacious?'), | ||
border: figma.boolean('border?'), | ||
heading: figma.textContent('Text: Heading'), | ||
description: figma.textContent('Text: Description'), | ||
primaryAction: figma.nestedProps('Primary action', { | ||
text: figma.textContent('Button'), | ||
}), | ||
}, | ||
variant: {primaryAction: 'true', secondaryAction: 'false'}, | ||
example: ({leadingVisual, border, spacious, narrow, description, heading, primaryAction}) => ( | ||
<Blankslate border={border} spacious={spacious} narrow={narrow}> | ||
props, | ||
variant: {'SecondaryAction?': 'false'}, | ||
example: ({leadingVisual, border, spacious, description, heading, PrimaryAction}) => ( | ||
<Blankslate border={border} spacious={spacious} variant={size}> | ||
<Blankslate.Visual>{leadingVisual.item}</Blankslate.Visual> | ||
<Blankslate.Heading>{heading}</Blankslate.Heading> | ||
<Blankslate.Description>{description}</Blankslate.Description> | ||
<Blankslate.PrimaryAction href="">{primaryAction.text}</Blankslate.PrimaryAction> | ||
{PrimaryAction} | ||
</Blankslate> | ||
), | ||
}) | ||
figma.connect(Blankslate, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=4398-2383&m=dev', { | ||
props: { | ||
leadingVisual: figma.nestedProps('_BlankslateVisual', { | ||
item: figma.children('leadingVisual'), | ||
}), | ||
narrow: figma.boolean('narrow?'), | ||
spacious: figma.boolean('spacious?'), | ||
border: figma.boolean('border?'), | ||
heading: figma.textContent('Text: Heading'), | ||
description: figma.textContent('Text: Description'), | ||
primaryAction: figma.nestedProps('Primary action', { | ||
text: figma.textContent('Button'), | ||
}), | ||
secondaryAction: figma.textContent('Secondary action link'), | ||
}, | ||
variant: {primaryAction: 'true', secondaryAction: 'true'}, | ||
example: ({leadingVisual, border, spacious, narrow, description, heading, primaryAction, secondaryAction}) => ( | ||
<Blankslate border={border} spacious={spacious} narrow={narrow}> | ||
<Blankslate.Visual>{leadingVisual.item}</Blankslate.Visual> | ||
<Blankslate.Heading>{heading}</Blankslate.Heading> | ||
<Blankslate.Description>{description}</Blankslate.Description> | ||
<Blankslate.PrimaryAction href="">{primaryAction.text}</Blankslate.PrimaryAction> | ||
<Blankslate.SecondaryAction href="">{secondaryAction}</Blankslate.SecondaryAction> | ||
</Blankslate> | ||
), | ||
}) | ||
figma.connect(Blankslate, 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=4398-2383&m=dev', { | ||
props: { | ||
leadingVisual: figma.nestedProps('_BlankslateVisual', { | ||
item: figma.children('leadingVisual'), | ||
}), | ||
narrow: figma.boolean('narrow?'), | ||
spacious: figma.boolean('spacious?'), | ||
border: figma.boolean('border?'), | ||
heading: figma.textContent('Text: Heading'), | ||
description: figma.textContent('Text: Description'), | ||
secondaryAction: figma.textContent('Secondary action link'), | ||
|
||
figma.connect( | ||
Blankslate, | ||
'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=40491-3841&t=5mMfBZbhHgyouYtk-4', | ||
{ | ||
props: { | ||
PrimaryAction: figma.nestedProps('Primary action', { | ||
text: figma.textContent('Button'), | ||
icon: figma.children('icon'), | ||
variant: figma.enum('variant', { | ||
primary: 'primary', | ||
secondary: 'secondary', | ||
danger: 'danger', | ||
invisible: 'invisible', | ||
}), | ||
}), | ||
}, | ||
example: ({PrimaryAction}) => ( | ||
<Blankslate.PrimaryAction href=""> | ||
{PrimaryAction.icon} | ||
{PrimaryAction.text} | ||
</Blankslate.PrimaryAction> | ||
), | ||
}, | ||
variant: {primaryAction: 'false', secondaryAction: 'true'}, | ||
example: ({leadingVisual, border, spacious, narrow, description, heading, secondaryAction}) => ( | ||
<Blankslate border={border} spacious={spacious} narrow={narrow}> | ||
<Blankslate.Visual>{leadingVisual.item}</Blankslate.Visual> | ||
<Blankslate.Heading>{heading}</Blankslate.Heading> | ||
<Blankslate.Description>{description}</Blankslate.Description> | ||
<Blankslate.SecondaryAction href="">{secondaryAction}</Blankslate.SecondaryAction> | ||
</Blankslate> | ||
), | ||
}) | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.