-
Notifications
You must be signed in to change notification settings - Fork 9
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 #97 from Giveth/fix-sc-props
Fix Styled component props
- Loading branch information
Showing
37 changed files
with
130 additions
and
88 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@giveth/ui-design-system", | ||
"version": "1.11.21", | ||
"version": "1.11.22", | ||
"files": [ | ||
"/lib" | ||
], | ||
|
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 |
---|---|---|
@@ -1,22 +1,27 @@ | ||
import type { ReactNode, ComponentPropsWithoutRef } from 'react'; | ||
|
||
export type ButtonStyleType = | ||
| 'primary' | ||
| 'secondary' | ||
| 'texty' | ||
| 'texty-gray' | ||
| 'texty-primary' | ||
| 'texty-secondary'; | ||
|
||
export type ButtonSize = 'small' | 'medium' | 'large'; | ||
|
||
export interface IButtonLinkContainerProps { | ||
linkType?: | ||
| 'primary' | ||
| 'secondary' | ||
| 'texty' | ||
| 'texty-gray' | ||
| 'texty-primary' | ||
| 'texty-secondary'; | ||
size?: 'small' | 'medium' | 'large'; | ||
$linkType?: ButtonStyleType; | ||
size?: ButtonSize; | ||
disabled?: boolean; | ||
isExternal?: boolean; | ||
} | ||
|
||
export interface IButtonLinkProps | ||
extends ComponentPropsWithoutRef<'a'>, | ||
IButtonLinkContainerProps { | ||
export interface IButtonLinkProps extends ComponentPropsWithoutRef<'a'> { | ||
icon?: ReactNode; | ||
leftIcon?: ReactNode; | ||
label: string; | ||
linkType?: ButtonStyleType; | ||
isExternal?: boolean; | ||
size?: ButtonSize; | ||
disabled?: boolean; | ||
} |
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 |
---|---|---|
@@ -1,22 +1,18 @@ | ||
import type { ReactNode, ComponentPropsWithoutRef } from 'react'; | ||
import { ButtonSize, ButtonStyleType } from '../buttonLinks/type'; | ||
|
||
export interface IButtonContainerProps { | ||
buttonType?: | ||
| 'primary' | ||
| 'secondary' | ||
| 'texty' | ||
| 'texty-gray' | ||
| 'texty-primary' | ||
| 'texty-secondary'; | ||
$buttonType?: ButtonStyleType; | ||
disabled?: boolean; | ||
size?: 'small' | 'medium' | 'large'; | ||
size?: ButtonSize; | ||
} | ||
|
||
export interface IButtonProps | ||
extends ComponentPropsWithoutRef<'button'>, | ||
IButtonContainerProps { | ||
export interface IButtonProps extends ComponentPropsWithoutRef<'button'> { | ||
loading?: boolean; | ||
label: string; | ||
icon?: ReactNode; | ||
leftIcon?: ReactNode; | ||
buttonType?: ButtonStyleType; | ||
disabled?: boolean; | ||
size?: ButtonSize; | ||
} |
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,39 @@ | ||
import { type CSSProperties } from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
interface IFlexProps { | ||
$flexWrap?: boolean; | ||
$alignItems?: CSSProperties['alignItems']; | ||
$justifyContent?: CSSProperties['justifyContent']; | ||
$flexDirection?: CSSProperties['flexDirection']; | ||
gap?: string; | ||
} | ||
|
||
export const Flex = styled.div<IFlexProps>` | ||
display: flex; | ||
flex-direction: ${props => | ||
props.$flexDirection ? props.$flexDirection : 'initial'}; | ||
flex-wrap: ${props => (props.$flexWrap ? 'wrap' : 'nowrap')}; | ||
align-items: ${props => | ||
props.$alignItems ? props.$alignItems : 'initial'}; | ||
justify-content: ${props => | ||
props.$justifyContent ? props.$justifyContent : 'initial'}; | ||
gap: ${props => props.gap}; | ||
`; | ||
|
||
interface IFlexCenter { | ||
gap?: string; | ||
direction?: CSSProperties['flexDirection']; | ||
} | ||
|
||
export const FlexCenter = styled.div<IFlexCenter>` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
gap: ${props => props.gap}; | ||
flex-direction: ${props => props.direction}; | ||
`; | ||
|
||
export const FlexSpacer = styled.div` | ||
flex: 1; | ||
`; |
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,10 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const D = styled.div` | ||
/* Display/D1 */ | ||
font-family: TeX Gyre Adventor, sans-serif; | ||
font-style: normal; | ||
font-weight: 700; | ||
letter-spacing: -0.04em; | ||
color: ${props => (props.color ? props.color : 'inherit')}; | ||
`; |
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
Oops, something went wrong.