Skip to content

Commit

Permalink
Sort props
Browse files Browse the repository at this point in the history
  • Loading branch information
narin committed Nov 12, 2024
1 parent b006a8f commit b6e8940
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions packages/components/src/components/Text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ type BaseTones = 'default' | 'subtle' | 'inverse'
type BodyTones = BaseTones | 'error'

type BodyProps = {
/** Variant: body, heading, display, or navigation */
variant?: 'body'
/** Text color: default, subtle, inverse, error. Defaults to vadsColorForegroundDefault. */
tone?: BodyTones
/** Size: xs, sm, md, or lg. Defaults to 'md' for body and heading */
size?: TextSizes
/** Text color: default, subtle, inverse, error. Defaults to vadsColorForegroundDefault. */
tone?: BodyTones
/** Variant: body, heading, display, or navigation */
variant?: 'body'
}

type HeadingProps = {
/** Variant: body, heading, display, or navigation */
variant?: 'heading'
/** Text color: default, subtle, inverse. Defaults to vadsColorForegroundDefault. */
tone?: BaseTones
/** Size: xs, sm, md, or lg. Defaults to 'md' for body and heading */
size?: TextSizes
/** Text color: default, subtle, inverse. Defaults to vadsColorForegroundDefault. */
tone?: BaseTones
/** Variant: body, heading, display, or navigation */
variant?: 'heading'
}

type DisplayProps = {
/** Variant: body, heading, display, or navigation */
variant?: 'display'
size?: never
/** Text color: default, subtle, inverse. Defaults to vadsColorForegroundDefault. */
tone?: BaseTones
size?: never
/** Variant: body, heading, display, or navigation */
variant?: 'display'
}

export type TextProps = {
Expand All @@ -51,11 +51,11 @@ export type TextProps = {
} & (BodyProps | HeadingProps | DisplayProps)

export const Text: FC<TextProps> = ({
children,
a11yLabel,
bottomSpacing,
tone = 'default',
children,
size = 'md',
tone = 'default',
variant = 'body',
}) => {
const defaultColor = BaseColor()

Check warning on line 61 in packages/components/src/components/Text/Text.tsx

View workflow job for this annotation

GitHub Actions / Lint

'defaultColor' is assigned a value but never used
Expand Down

0 comments on commit b6e8940

Please sign in to comment.