refactor: unified cn utils (#29916)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { FC } from 'react'
|
||||
import classNames from '@/utils/classnames'
|
||||
import { cn } from '@/utils/classnames'
|
||||
|
||||
export type Step = {
|
||||
name: string
|
||||
@@ -16,31 +16,26 @@ export const StepperStep: FC<StepperStepProps> = (props) => {
|
||||
const isDisabled = activeIndex < index
|
||||
const label = isActive ? `STEP ${index + 1}` : `${index + 1}`
|
||||
return <div className='flex items-center gap-2'>
|
||||
<div className={classNames(
|
||||
'inline-flex h-5 flex-col items-center justify-center gap-2 rounded-3xl py-1',
|
||||
<div className={cn('inline-flex h-5 flex-col items-center justify-center gap-2 rounded-3xl py-1',
|
||||
isActive
|
||||
? 'bg-state-accent-solid px-2'
|
||||
: !isDisabled
|
||||
? 'w-5 border border-text-quaternary'
|
||||
: 'w-5 border border-divider-deep',
|
||||
)}>
|
||||
<div className={classNames(
|
||||
'system-2xs-semibold-uppercase text-center',
|
||||
: 'w-5 border border-divider-deep')}>
|
||||
<div className={cn('system-2xs-semibold-uppercase text-center',
|
||||
isActive
|
||||
? 'text-text-primary-on-surface'
|
||||
: !isDisabled
|
||||
? 'text-text-tertiary'
|
||||
: 'text-text-quaternary',
|
||||
)}>
|
||||
: 'text-text-quaternary')}>
|
||||
{label}
|
||||
</div>
|
||||
</div>
|
||||
<div className={classNames('system-xs-medium-uppercase',
|
||||
<div className={cn('system-xs-medium-uppercase',
|
||||
isActive
|
||||
? 'system-xs-semibold-uppercase text-text-accent'
|
||||
: !isDisabled
|
||||
? 'text-text-tertiary'
|
||||
: 'text-text-quaternary',
|
||||
)}>{name}</div>
|
||||
: 'text-text-quaternary')}>{name}</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user