-
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.
Merge pull request #48 from academic-relations/47-impl-semester-doc-s…
…elect-component Impl Semester component And DocType component
- Loading branch information
Showing
16 changed files
with
1,204 additions
and
28 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,24 @@ | ||
// FormError.tsx | ||
import React from "react"; | ||
|
||
import styled from "styled-components"; | ||
|
||
const StyledErrorMessage = styled.span` | ||
display: block; | ||
padding: 0px 0px 0px 2px; | ||
color: ${({ theme }) => theme.colors.RED[700]}; | ||
font-family: ${({ theme }) => theme.fonts.FAMILY.PRETENDARD}; | ||
font-weight: ${({ theme }) => theme.fonts.WEIGHT.MEDIUM}; | ||
font-size: 12px; | ||
line-height: 16px; | ||
`; | ||
|
||
interface FormErrorProps { | ||
children: React.ReactNode; | ||
} | ||
|
||
const FormError: React.FC<FormErrorProps> = ({ children }) => ( | ||
<StyledErrorMessage>{children}</StyledErrorMessage> | ||
); | ||
|
||
export default FormError; |
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,26 @@ | ||
// Label.tsx | ||
import React from "react"; | ||
|
||
import styled from "styled-components"; | ||
|
||
const StyledLabel = styled.label` | ||
display: block; | ||
margin: 0px 2px 0px 2px; | ||
gap: 10px; | ||
font-family: ${({ theme }) => theme.fonts.FAMILY.PRETENDARD}; | ||
font-size: 16px; | ||
font-weight: ${({ theme }) => theme.fonts.WEIGHT.MEDIUM}; | ||
color: ${({ theme }) => theme.colors.BLACK}; | ||
line-height: 20px; | ||
text-align: left; | ||
`; | ||
|
||
interface LabelProps { | ||
children: React.ReactNode; | ||
} | ||
|
||
const Label: React.FC<LabelProps> = ({ children }) => ( | ||
<StyledLabel>{children}</StyledLabel> | ||
); | ||
|
||
export default Label; |
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
34 changes: 34 additions & 0 deletions
34
packages/web/src/common/components/Select/SelectOption.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,34 @@ | ||
import isPropValid from "@emotion/is-prop-valid"; | ||
import styled, { css } from "styled-components"; | ||
|
||
const SelectOption = styled.div.withConfig({ | ||
shouldForwardProp: prop => isPropValid(prop), | ||
})<{ selectable?: boolean; selected?: boolean }>` | ||
display: flex; | ||
align-items: center; | ||
align-self: stretch; | ||
width: 100%; | ||
gap: 10px; | ||
border-radius: 4px; | ||
padding: 4px 8px; | ||
font-family: ${({ theme }) => theme.fonts.FAMILY.PRETENDARD}; | ||
font-size: 16px; | ||
line-height: 20px; | ||
font-weight: ${({ theme }) => theme.fonts.WEIGHT.REGULAR}; | ||
color: ${({ theme, selectable }) => | ||
selectable ? theme.colors.BLACK : theme.colors.GRAY[400]}; | ||
background-color: ${({ theme, selected }) => | ||
selected !== undefined && selected | ||
? theme.colors.GREEN[100] | ||
: theme.colors.WHITE}; | ||
${({ selectable }) => | ||
selectable && | ||
css` | ||
&:hover { | ||
background-color: ${({ theme }) => theme.colors.GRAY[100]}; | ||
} | ||
`} | ||
cursor: ${({ selectable }) => (selectable ? `pointer` : null)}; | ||
`; | ||
|
||
export default SelectOption; |
15 changes: 15 additions & 0 deletions
15
packages/web/src/common/components/Select/_atomic/NoOption.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,15 @@ | ||
import styled from "styled-components"; | ||
|
||
const NoOption = styled.div` | ||
padding: 4px 12px; | ||
gap: 10px; | ||
font-family: ${({ theme }) => theme.fonts.FAMILY.PRETENDARD}; | ||
font-size: 16px; | ||
line-height: 20px; | ||
font-weight: ${({ theme }) => theme.fonts.WEIGHT.REGULAR}; | ||
text-align: center; | ||
pointer-events: none; | ||
color: ${({ theme }) => theme.colors.GRAY[400]}; | ||
`; | ||
|
||
export default NoOption; |
Oops, something went wrong.