feat(SW-1509): enable support for more react aria props
fix invalid border corrected default border
This commit is contained in:
@@ -20,11 +20,11 @@ export function Select({
|
||||
name,
|
||||
label,
|
||||
items,
|
||||
isRequired,
|
||||
isDisabled,
|
||||
icon,
|
||||
itemIcon,
|
||||
enableFiltering,
|
||||
...props
|
||||
}: SelectProps) {
|
||||
if (enableFiltering) {
|
||||
return (
|
||||
@@ -32,10 +32,10 @@ export function Select({
|
||||
name={name}
|
||||
label={label}
|
||||
items={items}
|
||||
isRequired={isRequired}
|
||||
isDisabled={isDisabled}
|
||||
icon={icon}
|
||||
itemIcon={itemIcon}
|
||||
isDisabled={isDisabled}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
@@ -46,8 +46,8 @@ export function Select({
|
||||
className={styles.select}
|
||||
name={name}
|
||||
aria-label={label}
|
||||
isRequired={isRequired}
|
||||
isDisabled={isDisabled}
|
||||
{...props}
|
||||
>
|
||||
<Button className={cx(styles.inner, styles.button)}>
|
||||
{icon ? (
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
.select {
|
||||
position: relative;
|
||||
background-color: var(--Surface-UI-Fill-Default);
|
||||
border: 1px solid var(--Border-Default);
|
||||
border: 1px solid var(--Border-Interactive-Default);
|
||||
border-radius: var(--Corner-radius-md);
|
||||
max-width: 300px;
|
||||
|
||||
&[data-required] .label::after {
|
||||
content: '*';
|
||||
content: ' *';
|
||||
}
|
||||
&[data-open] .chevron {
|
||||
rotate: -90deg;
|
||||
}
|
||||
&[data-focused] {
|
||||
border: 1px solid var(--Border-Interactive-Focus);
|
||||
border-color: var(--Border-Interactive-Focus);
|
||||
|
||||
.button,
|
||||
.input {
|
||||
@@ -37,6 +37,9 @@
|
||||
color: var(--Text-Interactive-Disabled);
|
||||
}
|
||||
}
|
||||
&[data-invalid] {
|
||||
border-color: var(--Border-Interactive-Error);
|
||||
}
|
||||
}
|
||||
|
||||
.chevron {
|
||||
@@ -49,7 +52,7 @@
|
||||
gap: var(--Space-x1);
|
||||
width: 100%;
|
||||
height: 56px;
|
||||
padding: var(--Space-x1);
|
||||
padding: var(--Space-x15);
|
||||
box-sizing: border-box;
|
||||
|
||||
.button {
|
||||
|
||||
@@ -15,8 +15,6 @@ export interface SelectProps extends ComponentProps<typeof Select> {
|
||||
items: (Key | Item)[]
|
||||
name: string
|
||||
label: string
|
||||
isRequired?: boolean
|
||||
isDisabled?: boolean
|
||||
enableFiltering?: boolean
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user