fix: special requests

This commit is contained in:
Christel Westerberg
2024-12-10 14:40:26 +01:00
parent 854563d099
commit 241e354fc5
16 changed files with 393 additions and 18 deletions

View File

@@ -25,6 +25,7 @@ import type {
} from "./select"
export default function Select({
className = "",
"aria-label": ariaLabel,
defaultSelectedKey,
items,
@@ -54,7 +55,7 @@ export default function Select({
}
return (
<div className={styles.container} ref={setRef}>
<div className={`${styles.container} ${className}`} ref={setRef}>
<ReactAriaSelect
aria-label={ariaLabel}
className={`${styles.select} ${discreet && styles.discreet}`}
@@ -68,11 +69,26 @@ export default function Select({
<Body asChild fontOnly>
<Button className={styles.input} data-testid={name}>
<span className={styles.inputContentWrapper} tabIndex={tabIndex}>
<Label required={required} size={discreet ? "discreet" : "small"}>
{label}
{discreet && `:`}
</Label>
<SelectValue />
<SelectValue>
{({ isPlaceholder, selectedText }) => (
<>
<Label
required={required}
size={discreet ? "discreet" : "small"}
>
{label}
{discreet && `:`}
</Label>
{isPlaceholder ? (
placeholder ? (
<Body color="uiTextPlaceholder"> {placeholder}</Body>
) : null
) : (
selectedText
)}
</>
)}
</SelectValue>
</span>
<SelectChevron
{...(discreet ? { color: "baseButtonTextOnFillNormal" } : {})}