-
Notifications
You must be signed in to change notification settings - Fork 157
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
26ab2b5
commit b739cde
Showing
25 changed files
with
184 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+1.29 KB
packages/fuselage/.loki/reference/chrome_iphone7_Tags_Badges_Badges_Danger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.16 KB
...es/fuselage/.loki/reference/chrome_iphone7_Tags_Badges_Badges_Default_Story.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.14 KB
packages/fuselage/.loki/reference/chrome_iphone7_Tags_Badges_Badges_Disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.3 KB
packages/fuselage/.loki/reference/chrome_iphone7_Tags_Badges_Badges_Primary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.88 KB
packages/fuselage/.loki/reference/chrome_iphone7_Tags_Badges_Tags_Danger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.74 KB
...ages/fuselage/.loki/reference/chrome_iphone7_Tags_Badges_Tags_Default_Story.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.76 KB
packages/fuselage/.loki/reference/chrome_iphone7_Tags_Badges_Tags_Disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.74 KB
packages/fuselage/.loki/reference/chrome_iphone7_Tags_Badges_Tags_Pointer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.87 KB
packages/fuselage/.loki/reference/chrome_iphone7_Tags_Badges_Tags_Primary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+642 Bytes
packages/fuselage/.loki/reference/chrome_laptop_Tags_Badges_Badges_Danger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+580 Bytes
...ges/fuselage/.loki/reference/chrome_laptop_Tags_Badges_Badges_Default_Story.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+588 Bytes
packages/fuselage/.loki/reference/chrome_laptop_Tags_Badges_Badges_Disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+637 Bytes
packages/fuselage/.loki/reference/chrome_laptop_Tags_Badges_Badges_Primary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+815 Bytes
packages/fuselage/.loki/reference/chrome_laptop_Tags_Badges_Tags_Danger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+785 Bytes
packages/fuselage/.loki/reference/chrome_laptop_Tags_Badges_Tags_Default_Story.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+770 Bytes
packages/fuselage/.loki/reference/chrome_laptop_Tags_Badges_Tags_Disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+785 Bytes
packages/fuselage/.loki/reference/chrome_laptop_Tags_Badges_Tags_Pointer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+816 Bytes
packages/fuselage/.loki/reference/chrome_laptop_Tags_Badges_Tags_Primary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,13 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { Tag } from '../..'; | ||
|
||
export function Badge(props) { | ||
return <Tag round {...props} />; | ||
} | ||
|
||
Badge.propTypes = { | ||
variant: PropTypes.oneOf(['secondary', 'primary', 'danger']), | ||
disabled: PropTypes.bool, | ||
}; |
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,41 @@ | ||
import { Meta, Preview, Props, Story } from '@storybook/addon-docs/blocks'; | ||
|
||
import { Badge } from '../..'; | ||
|
||
<Meta title='Tags & Badges|Badges' parameters={{ jest: ['Button/spec'] }} /> | ||
|
||
# Badge | ||
|
||
Used for mentions. | ||
|
||
<Preview> | ||
<Story name='Default'> | ||
<Badge>99</Badge> | ||
</Story> | ||
</Preview> | ||
|
||
<Props of={Badge} /> | ||
|
||
### Primary | ||
|
||
<Preview> | ||
<Story name='Primary'> | ||
<Badge variant='primary'>99</Badge> | ||
</Story> | ||
</Preview> | ||
|
||
### Danger | ||
|
||
<Preview> | ||
<Story name='Danger'> | ||
<Badge variant='danger'>99</Badge> | ||
</Story> | ||
</Preview> | ||
|
||
### Disabled | ||
|
||
<Preview> | ||
<Story name='Disabled'> | ||
<Badge disabled>99</Badge> | ||
</Story> | ||
</Preview> |
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,31 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { Box } from '../..'; | ||
|
||
export function Tag({ | ||
variant = 'secondary', | ||
disabled, | ||
round, | ||
onClick, | ||
...props | ||
}) { | ||
return <Box | ||
is='div' | ||
componentClassName='rcx-tag' | ||
mod-secondary={variant === 'secondary'} | ||
mod-primary={variant === 'primary'} | ||
mod-danger={variant === 'danger'} | ||
mod-disabled={!!disabled} | ||
mod-round={!!round} | ||
mod-clickable={!!onClick} | ||
onClick={onClick} | ||
{...props} | ||
/>; | ||
} | ||
|
||
Tag.propTypes = { | ||
variant: PropTypes.oneOf(['secondary', 'primary', 'danger']), | ||
round: PropTypes.bool, | ||
disabled: PropTypes.bool, | ||
}; |
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,49 @@ | ||
import { Meta, Preview, Props, Story } from '@storybook/addon-docs/blocks'; | ||
|
||
import { Tag } from '../..'; | ||
|
||
<Meta title='Tags & Badges|Tags' parameters={{ jest: ['Button/spec'] }} /> | ||
|
||
# Tag | ||
|
||
Used for mentions. | ||
|
||
<Preview> | ||
<Story name='Default'> | ||
<Tag>john.doe</Tag> | ||
</Story> | ||
</Preview> | ||
|
||
<Props of={Tag} /> | ||
|
||
### With Pointer Cursor | ||
|
||
<Preview> | ||
<Story name='Pointer'> | ||
<Tag onClick={()=>{}}>john.doe</Tag> | ||
</Story> | ||
</Preview> | ||
|
||
### Primary | ||
|
||
<Preview> | ||
<Story name='Primary'> | ||
<Tag variant='primary'>john.doe</Tag> | ||
</Story> | ||
</Preview> | ||
|
||
### Danger | ||
|
||
<Preview> | ||
<Story name='Danger'> | ||
<Tag variant='danger'>john.doe</Tag> | ||
</Story> | ||
</Preview> | ||
|
||
### Disabled | ||
|
||
<Preview> | ||
<Story name='Disabled'> | ||
<Tag disabled>john.doe</Tag> | ||
</Story> | ||
</Preview> |
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,47 @@ | ||
.rcx-tag { | ||
display: inline-block; | ||
|
||
padding-block: $spaces-x2; | ||
|
||
padding-inline: $spaces-x4; | ||
|
||
text-decoration: none; | ||
|
||
word-break: keep-all; | ||
|
||
border-radius: $spaces-x4; | ||
|
||
@include use-text-style(micro); | ||
|
||
&--secondary { | ||
color: $colors-b500; | ||
background-color: $colors-b100; | ||
} | ||
|
||
&--primary { | ||
color: $colors-white; | ||
background-color: $colors-b500; | ||
} | ||
|
||
&--danger { | ||
color: $colors-white; | ||
background-color: $colors-r500; | ||
} | ||
|
||
&--disabled { | ||
color: $colors-n600; | ||
background-color: $colors-n400; | ||
} | ||
|
||
&--round { | ||
overflow: hidden; | ||
|
||
text-align: center; | ||
|
||
border-radius: $spaces-x20; | ||
} | ||
|
||
&--clickable { | ||
@include clickable(); | ||
} | ||
} |
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