Merged in feat/SW-3655-input-component (pull request #3296)
feat: (SW-3655) new Input and FormInput components * First version new Input and FormInput components * Handle aria-describedby with react-aria instead of manually add it * Update breaking unit and stories tests * Merge branch 'master' into feat/SW-3655-input-component * Update example form * Merge branch 'master' into feat/SW-3655-input-component * New lock file Approved-by: Linus Flood
This commit is contained in:
@@ -14,10 +14,12 @@ import SelectChevron from './SelectChevron'
|
||||
|
||||
import styles from './select.module.css'
|
||||
import Body from '../Body'
|
||||
import { Label } from '../Label'
|
||||
import { InputLabel } from '../InputLabel'
|
||||
|
||||
interface SelectProps
|
||||
extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'onSelect'> {
|
||||
interface SelectProps extends Omit<
|
||||
React.SelectHTMLAttributes<HTMLSelectElement>,
|
||||
'onSelect'
|
||||
> {
|
||||
defaultSelectedKey?: Key
|
||||
items: { label: string; value: Key }[]
|
||||
label: string
|
||||
@@ -101,13 +103,13 @@ export default function Select({
|
||||
<SelectValue tabIndex={tabIndex}>
|
||||
{({ selectedText }) => (
|
||||
<>
|
||||
<Label
|
||||
<InputLabel
|
||||
required={required}
|
||||
size={discreet ? 'discreet' : 'regular'}
|
||||
>
|
||||
{label}
|
||||
{discreet && DELIMITER}
|
||||
</Label>
|
||||
</InputLabel>
|
||||
{selectedText && (
|
||||
<Body className={optionsIcon ? styles.iconLabel : ''}>
|
||||
{optionsIcon ? optionsIcon : null}
|
||||
|
||||
Reference in New Issue
Block a user