Skip to content

Commit 36fb9f4

Browse files
committed
Add support for unlisted to StateLabel
github/pull-requests#19319
1 parent 7fb450a commit 36fb9f4

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

packages/react/src/StateLabel/StateLabel.docs.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
{
3535
"id": "components-statelabel-features--draft"
3636
},
37+
{
38+
"id": "components-statelabel-features--unlisted"
39+
},
3740
{
3841
"id": "components-statelabel-features--unavailable"
3942
},
@@ -56,7 +59,7 @@
5659
},
5760
{
5861
"name": "status",
59-
"type": "'issueOpened' | 'issueClosed' | 'issueClosedNotPlanned' | 'pullOpened' | 'pullClosed' | 'pullMerged' | 'draft' | 'issueDraft' | 'unavailable' | 'open' | 'closed'",
62+
"type": "'issueOpened' | 'issueClosed' | 'issueClosedNotPlanned' | 'pullOpened' | 'pullClosed' | 'pullMerged' | 'draft' | 'pullUnlisted' | 'issueDraft' | 'unavailable' | 'open' | 'closed'",
6063
"required": true
6164
},
6265
{

packages/react/src/StateLabel/StateLabel.features.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const Open = () => (
2727
</StateLabel>
2828
)
2929
export const Closed = () => <StateLabel status="closed">Closed</StateLabel>
30+
export const Unlisted = () => <StateLabel status="pullUnlisted">Unlisted</StateLabel>
3031

3132
export const Small = () => (
3233
<StateLabel status="issueOpened" variant="small">

packages/react/src/StateLabel/StateLabel.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const octiconMap = {
2727
pullClosed: GitPullRequestClosedIcon,
2828
pullMerged: GitMergeIcon,
2929
draft: GitPullRequestDraftIcon,
30+
pullUnlisted: GitPullRequestDraftIcon, // TODO: update with GitPullRequestUnlistedIcon once Octicon is updated
3031
issueDraft: IssueDraftIcon,
3132
pullQueued: GitMergeQueueIcon,
3233
unavailable: AlertIcon,
@@ -42,6 +43,7 @@ const labelMap: Record<keyof typeof octiconMap, 'Issue' | 'Issue, not planned' |
4243
pullClosed: 'Pull request',
4344
pullMerged: 'Pull request',
4445
draft: 'Pull request',
46+
pullUnlisted: 'Pull request',
4547
issueDraft: 'Issue',
4648
pullQueued: 'Pull request',
4749
unavailable: '',
@@ -92,6 +94,11 @@ const colorVariants = variant({
9294
color: 'fg.onEmphasis',
9395
boxShadow: 'var(--boxShadow-thin, inset 0 0 0 1px) var(--borderColor-neutral-emphasis, transparent)',
9496
},
97+
pullUnlisted: {
98+
backgroundColor: 'neutral.muted', // --bgColor-muted not available here?
99+
color: 'fg.muted',
100+
boxShadow: 'var(--boxShadow-thin, inset 0 0 0 1px) var(--borderColor-default, transparent)',
101+
},
95102
issueDraft: {
96103
backgroundColor: 'neutral.emphasis',
97104
color: 'fg.onEmphasis',

0 commit comments

Comments
 (0)