-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b860b3
commit 61fb6fb
Showing
16 changed files
with
556 additions
and
13 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
import { styled } from 'wasp/core/stitches.config'; | ||
|
||
// Note about using !important with some of the components: | ||
// This is a workaround for CSS generated by Stitches not being specific enough | ||
// and thus being overridden by Tailwind CSS. https://github.com/wasp-lang/wasp/issues/1764 | ||
// Long term we want to move away from Stitches and this is an acceptable workaround for now. | ||
|
||
// PRIVATE API | ||
export const Form = styled('form', { | ||
marginTop: '1.5rem', | ||
}); | ||
|
||
// PUBLIC API | ||
export const FormItemGroup = styled('div', { | ||
'& + div': { | ||
marginTop: '1.5rem', | ||
}, | ||
}); | ||
|
||
// PUBLIC API | ||
export const FormLabel = styled('label', { | ||
display: 'block !important', | ||
fontSize: '$sm !important', | ||
fontWeight: '500 !important', | ||
marginBottom: '0.5rem !important', | ||
}); | ||
|
||
const commonInputStyles = { | ||
display: 'block !important', | ||
lineHeight: '1.5rem !important', | ||
fontSize: '$sm !important', | ||
borderWidth: '1px !important', | ||
borderColor: '$gray600 !important', | ||
backgroundColor: '#f8f4ff !important', | ||
boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05) !important', | ||
color: '#003257 !important', | ||
'&:focus': { | ||
borderWidth: '1px !important', | ||
borderColor: '$gray700 !important', | ||
boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05) !important', | ||
}, | ||
'&:disabled': { | ||
opacity: '0.5 !important', | ||
cursor: 'not-allowed !important', | ||
backgroundColor: '$gray400 !important', | ||
borderColor: '$gray400 !important', | ||
color: '$gray500 !important', | ||
}, | ||
|
||
borderRadius: '0.375rem !important', | ||
width: '100% !important', | ||
|
||
paddingTop: '0.375rem !important', | ||
paddingBottom: '0.375rem !important', | ||
paddingLeft: '0.75rem !important', | ||
paddingRight: '0.75rem !important', | ||
margin: '0 !important', | ||
}; | ||
|
||
// PUBLIC API | ||
export const FormInput = styled('input', commonInputStyles); | ||
|
||
// PUBLIC API | ||
export const FormTextarea = styled('textarea', commonInputStyles); | ||
|
||
// PUBLIC API | ||
export const FormError = styled('div', { | ||
display: 'block', | ||
fontSize: '$sm', | ||
fontWeight: '500', | ||
color: '$formErrorText', | ||
marginTop: '0.5rem', | ||
}); | ||
|
||
// PRIVATE API | ||
export const SubmitButton = styled('button', { | ||
display: 'flex !important', | ||
justifyContent: 'center !important', | ||
|
||
width: '100% !important', | ||
borderWidth: '1px !important', | ||
borderColor: '#56b7e1 !important', | ||
backgroundColor: '#56b7e1 !important', | ||
color: '$submitButtonText !important', | ||
|
||
padding: '0.5rem 0.75rem !important', | ||
marginBottom: '1.5rem !important', | ||
boxShadow: '0 1px 2px 0 rgba(0, 0, 0, 0.05) !important', | ||
|
||
fontWeight: '300 !important', | ||
fontSize: '$sm !important', | ||
lineHeight: '1.25rem !important', | ||
borderRadius: '0.375rem !important', | ||
|
||
// TODO(matija): extract this into separate BaseButton component and then inherit it. | ||
'&:hover': { | ||
opacity: '0.85 !important', | ||
}, | ||
'&:disabled': { | ||
opacity: '0.5 !important', | ||
cursor: 'not-allowed !important', | ||
backgroundColor: '$gray400 !important', | ||
borderColor: '$gray400 !important', | ||
color: '$gray500 !important', | ||
}, | ||
transitionTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1) !important', | ||
transitionDuration: '100ms !important', | ||
}); |
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
Oops, something went wrong.