-
Notifications
You must be signed in to change notification settings - Fork 183
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
f31f1ba
commit eab6e63
Showing
73 changed files
with
7,461 additions
and
426 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
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,25 @@ | ||
import dedent from 'dedent'; | ||
|
||
export default [ | ||
{ | ||
group: 'Text', | ||
name: 'Default', | ||
code: dedent` | ||
<Text>Text</Text> | ||
` | ||
}, | ||
{ | ||
group: 'Checkbox', | ||
name: 'Unchecked', | ||
code: dedent` | ||
<Checkbox id="1" label="This is a checkbox" checked={false} message={false} onChange={() => {}} /> | ||
` | ||
}, | ||
{ | ||
group: 'Checkbox', | ||
name: 'Checked', | ||
code: dedent` | ||
<Checkbox id="1" label="This is a checkbox" checked message={false} onChange={() => {}} /> | ||
` | ||
} | ||
]; |
Large diffs are not rendered by default.
Oops, something went wrong.
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,65 @@ | ||
@import (reference) '../variables.less'; | ||
|
||
.reset { | ||
box-sizing: border-box; | ||
background: transparent; | ||
border: 0; | ||
margin: 0; | ||
padding: 0; | ||
outline: none; | ||
appearance: none; | ||
text-decoration: none; | ||
white-space: nowrap; | ||
text-overflow: ellipsis; | ||
user-select: none; | ||
position: relative; | ||
height: @interaction-height; | ||
-webkit-tap-highlight-color: transparent; | ||
cursor: pointer; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.base { | ||
border-radius: @radius-large; | ||
padding: 0 (@grid * 3); | ||
color: currentColor; | ||
border: 1px solid @gray-3; | ||
font: @text-standard; | ||
height: @grid * 9; | ||
|
||
&:after { | ||
content: ''; | ||
position: absolute; | ||
transform: translateY(-50%); | ||
min-height: @interaction-height; | ||
min-width: @interaction-height; | ||
left: -@grid * 2; | ||
right: -@grid * 2; | ||
height: 100%; | ||
top: 50%; | ||
} | ||
|
||
&:hover:not(.positive) { | ||
color: @highlight; | ||
} | ||
|
||
&:focus:not(:active):not(:hover):not(.positive) { | ||
box-shadow: @focus-outline; | ||
} | ||
|
||
&:active { | ||
transform: scale(0.98); | ||
} | ||
} | ||
|
||
.positive { | ||
color: @positive; | ||
} | ||
|
||
.iconContainer { | ||
position: relative; | ||
top: 1px; | ||
padding-left: 5px; | ||
} |
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,40 @@ | ||
import React, { ElementType, AllHTMLAttributes, ReactElement } from 'react'; | ||
import classnames from 'classnames'; | ||
|
||
// @ts-ignore | ||
import styles from './Button.less'; | ||
|
||
interface BaseProps { | ||
as?: ElementType; | ||
tone?: 'positive'; | ||
icon?: ReactElement; | ||
'data-testid'?: string; | ||
} | ||
|
||
interface ButtonProps | ||
extends Omit<AllHTMLAttributes<HTMLButtonElement>, 'as'>, | ||
BaseProps {} | ||
|
||
interface LinkProps | ||
extends Omit<AllHTMLAttributes<HTMLAnchorElement>, 'as'>, | ||
BaseProps {} | ||
|
||
type Props = ButtonProps | LinkProps; | ||
|
||
export const Button = ({ | ||
as: ButtonComponent = 'button', | ||
children, | ||
icon, | ||
tone, | ||
...props | ||
}: Props) => ( | ||
<ButtonComponent | ||
className={classnames(styles.reset, styles.base, { | ||
[styles.positive]: tone === 'positive' | ||
})} | ||
{...props} | ||
> | ||
{children} | ||
{icon ? <span className={styles.iconContainer}>{icon}</span> : null} | ||
</ButtonComponent> | ||
); |
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,11 @@ | ||
@import (reference) '../variables.less'; | ||
|
||
.root { | ||
position: relative; | ||
} | ||
|
||
.divider { | ||
position: absolute; | ||
width: 100%; | ||
border-top: 1px solid @gray-2; | ||
} |
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 React from 'react'; | ||
|
||
// @ts-ignore | ||
import styles from './Divider.less'; | ||
|
||
export const Divider = () => ( | ||
<div className={styles.root}> | ||
<div className={styles.divider} /> | ||
</div> | ||
); |
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.