-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1784 from adevinta/dropdown-disabled-state
feat(dropdown): disabled and readOnly modes
- Loading branch information
Showing
5 changed files
with
178 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/components/dropdown/src/DropdownTrigger.styles.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { cva } from 'class-variance-authority' | ||
|
||
export const styles = cva( | ||
[ | ||
'flex w-full items-center justify-between', | ||
'min-h-sz-44 rounded-lg bg-surface text-on-surface px-lg', | ||
// outline styles | ||
'ring-1 outline-none ring-inset focus:ring-2', | ||
], | ||
{ | ||
variants: { | ||
state: { | ||
undefined: 'ring-outline focus:ring-outline-high', | ||
error: 'ring-error', | ||
alert: 'ring-alert', | ||
success: 'ring-success', | ||
}, | ||
disabled: { | ||
true: 'disabled:bg-on-surface/dim-5 cursor-not-allowed text-on-surface/dim-3', | ||
}, | ||
readOnly: { | ||
true: 'disabled:bg-on-surface/dim-5 cursor-not-allowed text-on-surface/dim-3', | ||
}, | ||
}, | ||
compoundVariants: [ | ||
{ | ||
disabled: false, | ||
state: undefined, | ||
class: 'hover:ring-outline-high', | ||
}, | ||
], | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters