diff --git a/.changeset/serious-balloons-teach.md b/.changeset/serious-balloons-teach.md new file mode 100644 index 00000000000..9560dc1c752 --- /dev/null +++ b/.changeset/serious-balloons-teach.md @@ -0,0 +1,5 @@ +--- +'@primer/react': patch +--- + +Makes StateLabel's 'status' prop required diff --git a/generated/components.json b/generated/components.json index ee0fc090345..11ce9edb1b2 100644 --- a/generated/components.json +++ b/generated/components.json @@ -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", diff --git a/src/StateLabel/StateLabel.docs.json b/src/StateLabel/StateLabel.docs.json index 31395c0eb25..9a989a9e737 100644 --- a/src/StateLabel/StateLabel.docs.json +++ b/src/StateLabel/StateLabel.docs.json @@ -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", diff --git a/src/StateLabel/StateLabel.tsx b/src/StateLabel/StateLabel.tsx index 2c04fb489c7..cf063c9e65d 100644 --- a/src/StateLabel/StateLabel.tsx +++ b/src/StateLabel/StateLabel.tsx @@ -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` diff --git a/src/StateLabel/__tests__/StateLabel.types.test.tsx b/src/StateLabel/__tests__/StateLabel.types.test.tsx index 6fe880fff19..c10417956ab 100644 --- a/src/StateLabel/__tests__/StateLabel.types.test.tsx +++ b/src/StateLabel/__tests__/StateLabel.types.test.tsx @@ -1,10 +1,6 @@ import React from 'react' import StateLabel from '../StateLabel' -export function shouldAcceptCallWithNoProps() { - return -} - export function shouldNotAcceptSystemProps() { // @ts-expect-error system props should not be accepted return