Skip to content

Commit

Permalink
Merge pull request #12 from labcodes/migrate-tags
Browse files Browse the repository at this point in the history
CSYS-210: Migrate Tags
  • Loading branch information
Lucas Cavalcante authored Feb 18, 2021
2 parents 9c96d39 + 90d8431 commit c691146
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,6 @@ dist

# Visual Studio Code
.vscode

# VIM swap files
*.swp
26 changes: 26 additions & 0 deletions apps/docs/stories/Tag/DropdownTag.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";

import { ICON_TYPES, TAG_COLORS } from "../../confetti-ds/src/constants";
import { DropdownTag as Component } from "../../confetti-ds/src";

export default {
title: "Tag/Dropdown Tag",
component: Component,
argTypes: {
icon: {
control: { type: "select", options: ICON_TYPES },
},
color: {
control: { type: "select", options: TAG_COLORS },
},
skin: {
control: { type: "inline-radio" },
},
},
};

export const DropdownTag = (args) => <Component {...args} />;

DropdownTag.args = {
text: "demo tag",
};
40 changes: 40 additions & 0 deletions apps/docs/stories/Tag/RemovableTag.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from "react";

import { ICON_TYPES, TAG_COLORS } from "../../confetti-ds/src/constants";
import { Button, RemovableTag as Component } from "../../confetti-ds/src";

export default {
title: "Tag/Removable Tag",
component: Component,
argTypes: {
icon: {
control: { type: "select", options: ICON_TYPES },
},
color: {
control: { type: "select", options: TAG_COLORS },
},
skin: {
control: { type: "inline-radio" },
},
},
};

export const RemovableTag = (args) => {
const [showTag, setShowTag] = React.useState(true);

return (
<React.Fragment>
{ showTag ?
<Component {...args} onClick={() => setShowTag(false)} />
:
<div>
<Button text="Restore tag" onClick={() => setShowTag(true)} size="small"/>
</div> }

<p>Use this link for a <strong>thumbSrc</strong> example: <a>http://avatars3.githubusercontent.com/u/1887591</a></p>
</React.Fragment>
)
}
RemovableTag.args = {
text: "demo tag",
};
33 changes: 33 additions & 0 deletions apps/docs/stories/Tag/SimpleTag.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from "react";

import { ICON_TYPES, TAG_COLORS } from "../../confetti-ds/src/constants";
import { SimpleTag as Component } from "../../confetti-ds/src";

export default {
title: "Tag/Simple Tag",
component: Component,
argTypes: {
icon: {
control: { type: "select", options: ICON_TYPES },
},
color: {
control: { type: "select", options: TAG_COLORS },
},
skin: {
control: { type: "inline-radio" },
},
},
};

export const SimpleTag = (args) => {
return (
<React.Fragment>
<Component {...args} />
<p>Use this link for a <strong>thumbSrc</strong> example: <a>http://avatars3.githubusercontent.com/u/1887591</a></p>
</React.Fragment>
)
};

SimpleTag.args = {
text: "demo tag",
};
19 changes: 19 additions & 0 deletions apps/docs/stories/Tag/TogglableTag.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";

import { TAG_COLORS } from "../../confetti-ds/src/constants";
import { TogglableTag as Component } from "../../confetti-ds/src";

export default {
title: "Tag/Togglable Tag",
component: Component,
argTypes: {
color: {
control: { type: "select", options: TAG_COLORS },
},
},
};

export const TogglableTag = (args) => <Component {...args} />;
TogglableTag.args = {
text: "demo tag",
};

0 comments on commit c691146

Please sign in to comment.