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