From ba9df418ff480456bedacfc475bc1cb3dc9f53fd Mon Sep 17 00:00:00 2001 From: thiago Date: Fri, 17 Nov 2023 10:18:54 -0300 Subject: [PATCH 1/3] Adicionei arquivos avatar e card --- src/components/avatar/avatar.css | 0 src/components/avatar/avatar.stories.ts | 0 src/components/avatar/index.js | 0 src/components/card/card..stories.ts | 0 src/components/card/card.css | 0 src/components/card/card.js | 0 6 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/components/avatar/avatar.css create mode 100644 src/components/avatar/avatar.stories.ts create mode 100644 src/components/avatar/index.js create mode 100644 src/components/card/card..stories.ts create mode 100644 src/components/card/card.css create mode 100644 src/components/card/card.js diff --git a/src/components/avatar/avatar.css b/src/components/avatar/avatar.css new file mode 100644 index 0000000..e69de29 diff --git a/src/components/avatar/avatar.stories.ts b/src/components/avatar/avatar.stories.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/components/avatar/index.js b/src/components/avatar/index.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/card/card..stories.ts b/src/components/card/card..stories.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/components/card/card.css b/src/components/card/card.css new file mode 100644 index 0000000..e69de29 diff --git a/src/components/card/card.js b/src/components/card/card.js new file mode 100644 index 0000000..e69de29 From 77f4488c954c92d026cbaf95cb11afac548fe812 Mon Sep 17 00:00:00 2001 From: thiago Date: Fri, 17 Nov 2023 10:39:19 -0300 Subject: [PATCH 2/3] =?UTF-8?q?Atualiza=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/avatar/avatar.css | 4 ++++ src/components/avatar/avatar.stories.ts | 28 ++++++++++++++++++++++ src/components/avatar/index.js | 14 +++++++++++ src/components/card/card..stories.ts | 30 +++++++++++++++++++++++ src/components/card/card.js | 0 src/components/card/index.js | 32 +++++++++++++++++++++++++ 6 files changed, 108 insertions(+) delete mode 100644 src/components/card/card.js create mode 100644 src/components/card/index.js diff --git a/src/components/avatar/avatar.css b/src/components/avatar/avatar.css index e69de29..c793d8c 100644 --- a/src/components/avatar/avatar.css +++ b/src/components/avatar/avatar.css @@ -0,0 +1,4 @@ +img.avatar { + border-radius: 50px; + width: 50px; +} \ No newline at end of file diff --git a/src/components/avatar/avatar.stories.ts b/src/components/avatar/avatar.stories.ts index e69de29..ba120ea 100644 --- a/src/components/avatar/avatar.stories.ts +++ b/src/components/avatar/avatar.stories.ts @@ -0,0 +1,28 @@ +import type { StoryObj, Meta } from '@storybook/html'; + +import { avatar } from './index'; +import type {AvatarProps} from './index'; + +// More on how to set up stories at: https://storybook.js.org/docs/html/writing-stories/introduction#default-export +const meta = { + title: 'App/Avatar', + tags: ['autodocs'], + render: (args) => { + return avatar(args); + }, + argTypes: { + imgSrc: {description: 'endereço para a imgaem do logo'}, + descricao: {description: 'descrição da imagem do logo'} + } +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +// More on writing stories with args: https://storybook.js.org/docs/html/writing-stories/args +export const meuperfil: Story = { + args: { + imgSrc: 'https://avatars.githubusercontent.com/u/133207241?v=4', + descricao: 'Picture Profile ' + } +}; \ No newline at end of file diff --git a/src/components/avatar/index.js b/src/components/avatar/index.js index e69de29..27ada0d 100644 --- a/src/components/avatar/index.js +++ b/src/components/avatar/index.js @@ -0,0 +1,14 @@ +import './avatar.css' + +/** + * @typedef {Object} AvatarProps + * @property {string} AvatarProps.imgSrc - some description here + * @property {string} AvatarProps.descricao - some description here + * @param {AvatarProps} props + */ + +export function avatar({imgSrc, descricao}) { + return ` + ${descricao} + ` +} \ No newline at end of file diff --git a/src/components/card/card..stories.ts b/src/components/card/card..stories.ts index e69de29..b1adcfa 100644 --- a/src/components/card/card..stories.ts +++ b/src/components/card/card..stories.ts @@ -0,0 +1,30 @@ +import type { StoryObj, Meta } from "@storybook/html"; + +import { card } from './index.js'; +import type {CardProps} from './index.js'; + +// More on how to set up stories at: https://storybook.js.org/docs/html/writing-stories/introduction#default-export +const meta = { + title: 'App/Card', + tags: ['autodocs'], + render: (args) => { + return card(args); + }, + argTypes: { + nome: {desciption: 'nome do profile'}, + cargo: {desciption: 'cargo do profile'}, + img: {desciption: 'endereço para a imagem do logo'} + } +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +// More on writing stories with args: https://storybook.js.org/docs/html/writing-stories/args +export const Primary: Story = { + args: { + nome: 'Mansueto', + cargo: 'Back-end', + img: 'https://avatars.githubusercontent.com/u/133207241?v=4' + } +}; \ No newline at end of file diff --git a/src/components/card/card.js b/src/components/card/card.js deleted file mode 100644 index e69de29..0000000 diff --git a/src/components/card/index.js b/src/components/card/index.js new file mode 100644 index 0000000..13b7a29 --- /dev/null +++ b/src/components/card/index.js @@ -0,0 +1,32 @@ +import { avatar } from '../avatar'; +import './card.css' + + +/** + * @typedef {Object} CardProps + * @property {string} CardProps.nome - some description here + *@property {string} CardProps.cargo - some description here + *@property {string} CardProps.img - some description here + *@param {CardProps} props + */ + + +/** + * @param {*} param0 + * @returns + */ + +export function card({nome, cargo, img}) { + return` +
+
+ ${avatar({imgSrc: img, descricao: 'profile picture from' + nome})} + +
+
+

Nome: ${nome}

+

Cargo: ${cargo}

+
+ +
` ; + } \ No newline at end of file From 87443fadb937bec94ca86441ff94793cacb250ff Mon Sep 17 00:00:00 2001 From: AbraaoAlves Date: Fri, 24 Nov 2023 07:37:47 -0300 Subject: [PATCH 3/3] fix(card): duplicate story title --- src/components/cards/card.stories.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/cards/card.stories.ts b/src/components/cards/card.stories.ts index bdb4032..5538259 100644 --- a/src/components/cards/card.stories.ts +++ b/src/components/cards/card.stories.ts @@ -3,7 +3,7 @@ import type { CardProps } from './index'; import { card } from './index'; // More on how to set up stories at: https://storybook.js.org/docs/html/writing-stories/introduction#default-export const meta = { - title: 'App/card', + title: 'App/cards', tags: ['autodocs'], render: (args) => { return card(args);