fix: make use of design system label component in select
minor tweaks to make sure input and select behaves consistently
This commit is contained in:
@@ -16,6 +16,7 @@ import type { SelectProps, SelectFilterProps } from './types'
|
||||
|
||||
import styles from './select.module.css'
|
||||
import { useState } from 'react'
|
||||
import { Label } from '../Label'
|
||||
|
||||
export function Select({
|
||||
name,
|
||||
@@ -64,15 +65,12 @@ export function Select({
|
||||
{({ selectedText }) => {
|
||||
return (
|
||||
<>
|
||||
<Typography
|
||||
variant={
|
||||
selectedText || isOpen
|
||||
? 'Label/xsRegular'
|
||||
: 'Body/Paragraph/mdRegular'
|
||||
}
|
||||
<Label
|
||||
className={styles.label}
|
||||
selected={Boolean(selectedText || isOpen)}
|
||||
>
|
||||
<span className={styles.label}>{label}</span>
|
||||
</Typography>
|
||||
{label}
|
||||
</Label>
|
||||
<Typography variant="Body/Paragraph/mdRegular">
|
||||
<span className={styles.selectedText}>{selectedText}</span>
|
||||
</Typography>
|
||||
|
||||
Reference in New Issue
Block a user