Skip to content

Make StateLabel's 'status' prop required #2993

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 8 commits into from
Mar 15, 2023
Merged
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
5 changes: 5 additions & 0 deletions .changeset/serious-balloons-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Makes StateLabel's 'status' prop required
3 changes: 2 additions & 1 deletion generated/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -3914,7 +3914,8 @@
},
{
"name": "status",
"type": "'issueOpened' | 'issueClosed' | 'issueClosedNotPlanned' | 'pullOpened' | 'pullClosed' | 'pullMerged' | 'draft' | 'issueDraft'"
"type": "'issueOpened' | 'issueClosed' | 'issueClosedNotPlanned' | 'pullOpened' | 'pullClosed' | 'pullMerged' | 'draft' | 'issueDraft'",
"required": true
},
{
"name": "sx",
Expand Down
3 changes: 2 additions & 1 deletion src/StateLabel/StateLabel.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
},
{
"name": "status",
"type": "'issueOpened' | 'issueClosed' | 'issueClosedNotPlanned' | 'pullOpened' | 'pullClosed' | 'pullMerged' | 'draft' | 'issueDraft'"
"type": "'issueOpened' | 'issueClosed' | 'issueClosedNotPlanned' | 'pullOpened' | 'pullClosed' | 'pullMerged' | 'draft' | 'issueDraft'",
"required": true
},
{
"name": "sx",
Expand Down
2 changes: 1 addition & 1 deletion src/StateLabel/StateLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const sizeVariants = variant({

type StyledStateLabelBaseProps = {
variant?: 'small' | 'normal'
status?: keyof typeof octiconMap
status: keyof typeof octiconMap
} & SxProp

const StateLabelBase = styled.span<StyledStateLabelBaseProps>`
Expand Down
4 changes: 0 additions & 4 deletions src/StateLabel/__tests__/StateLabel.types.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import React from 'react'
import StateLabel from '../StateLabel'

export function shouldAcceptCallWithNoProps() {
return <StateLabel />
}

export function shouldNotAcceptSystemProps() {
// @ts-expect-error system props should not be accepted
return <StateLabel backgroundColor="bisque" />
Expand Down