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:
Christian Andolf
2025-06-13 16:23:11 +02:00
parent 4a00527d1d
commit 603c7dd2bf
7 changed files with 50 additions and 46 deletions

View File

@@ -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>