Skip to content

Commit

Permalink
get rid of unecessary types
Browse files Browse the repository at this point in the history
  • Loading branch information
talentlessguy committed Dec 5, 2024
1 parent 059b8d3 commit 0853087
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
8 changes: 3 additions & 5 deletions components/src/components/atoms/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { scale } from '@/src/css/utils/common'

import { removeNullishProps } from '@/src/utils/removeNullishProps'

import type { Color } from './utils/getValidatedColor'

import { getValueForSize } from './utils/getValueForSize'

import type { ReactNodeNoStrings } from '../../../types'
Expand All @@ -17,7 +15,7 @@ import { Box } from '../Box/Box'
import * as styles from './Button.css'
import clsx from 'clsx'
import { assignInlineVars } from '@vanilla-extract/dynamic'
import type { ColorStyles } from '@/src/tokens'
import type { ColorStyles, Hue } from '@/src/tokens'

export type Size = 'small' | 'medium' | 'flexible'

Expand Down Expand Up @@ -54,7 +52,7 @@ type BaseProps = {
onClick?: NativeButtonProps['onClick']
/** Show indicator that button has extra info via tooltip. */
shouldShowTooltipIndicator?: boolean
color?: Color
color?: Hue
colorStyle?: ColorStyles
} & Omit<BoxProps, 'size' | 'prefix'>

Expand All @@ -80,7 +78,7 @@ type ButtonBoxProps = {
$size?: BaseProps['size']
$type?: BaseProps['type']
$colorStyle: ColorStyles
$color?: Color
$color?: Hue
$hasCounter?: boolean
}
const ButtonBox = React.forwardRef<
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import type { Hue } from '@/src/tokens/color'
import { validatePrimaryColor } from '@/src/tokens/color'

export type Color = Hue

export type WithColor = { color: Color }

export const getValidatedColor = (
color?: Color,
color?: Hue,
fallback = 'textPrimary',
): string => {
if (!color) return fallback
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { CheckSVG } from '@/src/icons'
import { Typography } from '../../atoms'
import type { Colors, ColorStyles, Hue } from '@/src/tokens'
import { getColorStyleParts } from '@/src/utils/getColorStyleParts'
import clsx from 'clsx'
import { clsx } from 'clsx'
import { assignInlineVars } from '@vanilla-extract/dynamic'

export type CheckboxRowProps = {
Expand Down

0 comments on commit 0853087

Please sign in to comment.