Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(form-pill-group): add error variant, disabled pills, and update …
…styles (#2526) Co-authored-by: shleewhite <leewhite128@gmail.com>
- Loading branch information
1 parent
5199871
commit 95b65bd
Showing
27 changed files
with
1,592 additions
and
725 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@twilio-paste/design-tokens': minor | ||
'@twilio-paste/core': minor | ||
--- | ||
|
||
[Design Tokens] add color-background-error-strongest and color-text-error-stronger tokens |
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,6 @@ | ||
--- | ||
'@twilio-paste/box': patch | ||
'@twilio-paste/core': patch | ||
--- | ||
|
||
[Box] add missing disabled prop and \_focus_hover pseudoSelector prop |
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,6 @@ | ||
--- | ||
'@twilio-paste/form-pill-group': minor | ||
'@twilio-paste/core': minor | ||
--- | ||
|
||
[Form Pill Group] add error variant, disabled pills, and update styles |
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
160 changes: 160 additions & 0 deletions
160
packages/paste-core/components/form-pill-group/src/FormPill.styles.ts
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,160 @@ | ||
import type {VariantStyles} from './types'; | ||
|
||
/** | ||
* Wrapper styles | ||
*/ | ||
|
||
export const wrapperStyles: VariantStyles = { | ||
default: { | ||
color: 'colorTextIcon', | ||
_hover: { | ||
color: 'colorTextLinkStronger', | ||
}, | ||
}, | ||
error: { | ||
color: 'colorTextIcon', | ||
_hover: { | ||
color: 'colorTextErrorStronger', | ||
}, | ||
}, | ||
}; | ||
|
||
export const selectedWrapperStyles: VariantStyles = { | ||
default: { | ||
color: 'colorTextWeakest', | ||
_hover: { | ||
color: 'colorTextInverse', | ||
}, | ||
}, | ||
error: { | ||
color: 'colorTextInverse', | ||
_hover: { | ||
color: 'colorTextWeakest', | ||
}, | ||
}, | ||
}; | ||
|
||
/* | ||
* Pill styles | ||
*/ | ||
|
||
export const pillStyles: VariantStyles = { | ||
default: { | ||
color: 'colorText', | ||
backgroundColor: 'colorBackgroundPrimaryWeakest', | ||
|
||
_focus: { | ||
boxShadow: 'shadowFocus', | ||
color: 'colorText', | ||
}, | ||
_selected: { | ||
backgroundColor: 'colorBackgroundPrimaryStronger', | ||
color: 'colorTextWeakest', | ||
}, | ||
_selected_focus: { | ||
boxShadow: 'shadowFocus', | ||
color: 'colorTextWeakest', | ||
}, | ||
_disabled: { | ||
backgroundColor: 'colorBackgroundStrong', | ||
cursor: 'not-allowed', | ||
color: 'colorText', | ||
}, | ||
}, | ||
error: { | ||
backgroundColor: 'colorBackgroundErrorWeakest', | ||
color: 'colorTextErrorStrong', | ||
|
||
_focus: { | ||
boxShadow: 'shadowFocus', | ||
color: 'colorTextErrorStrong', | ||
}, | ||
_selected: { | ||
backgroundColor: 'colorBackgroundError', | ||
color: 'colorTextInverse', | ||
}, | ||
_selected_focus: { | ||
boxShadow: 'shadowFocus', | ||
color: 'colorTextInverse', | ||
}, | ||
_disabled: { | ||
backgroundColor: 'colorBackgroundStrong', | ||
cursor: 'not-allowed', | ||
color: 'colorText', | ||
}, | ||
}, | ||
}; | ||
|
||
export const hoverPillStyles: VariantStyles = { | ||
default: { | ||
cursor: 'pointer', | ||
color: 'colorText', | ||
|
||
_hover: { | ||
borderColor: 'colorBorderPrimaryStronger', | ||
color: 'colorTextLinkStronger', | ||
}, | ||
_selected_hover: { | ||
backgroundColor: 'colorBackgroundPrimary', | ||
borderColor: 'transparent', | ||
color: 'inherit', | ||
}, | ||
_focus_hover: { | ||
borderColor: 'transparent', | ||
}, | ||
}, | ||
error: { | ||
cursor: 'pointer', | ||
color: 'colorTextErrorStrong', | ||
|
||
_hover: { | ||
borderColor: 'colorBorderErrorStronger', | ||
color: 'inherit', | ||
}, | ||
_selected_hover: { | ||
backgroundColor: 'colorBackgroundErrorStrongest', | ||
borderColor: 'transparent', | ||
}, | ||
_focus_hover: { | ||
borderColor: 'transparent', | ||
}, | ||
}, | ||
}; | ||
|
||
/** | ||
* Close icon styles | ||
*/ | ||
|
||
export const closeStyles: VariantStyles = { | ||
default: { | ||
color: 'inherit', | ||
_hover: { | ||
cursor: 'pointer', | ||
borderColor: 'colorBorderPrimaryStronger', | ||
}, | ||
}, | ||
error: { | ||
color: 'inherit', | ||
_hover: { | ||
cursor: 'pointer', | ||
borderColor: 'colorBorderErrorStronger', | ||
}, | ||
}, | ||
}; | ||
|
||
export const selectedCloseStyles: VariantStyles = { | ||
default: { | ||
_hover: { | ||
cursor: 'pointer', | ||
borderColor: 'transparent', | ||
backgroundColor: 'colorBackgroundPrimary', | ||
}, | ||
}, | ||
error: { | ||
_hover: { | ||
cursor: 'pointer', | ||
borderColor: 'transparent', | ||
backgroundColor: 'colorBackgroundErrorStrongest', | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.