From bb0b09e10f6f802cd5ee83e348e16e7a830ad07c Mon Sep 17 00:00:00 2001 From: Paulo Luan Date: Fri, 17 Nov 2023 13:40:45 +0000 Subject: [PATCH] teste --- .gitpod.yml | 11 +++++++++ src/components/avatar/avatar.css | 4 ++++ src/components/avatar/avatar.js | 15 +++++++++++++ src/components/avatar/avatar.stories.ts | 29 ++++++++++++++++++++++++ src/components/card/card.css | 9 ++++++++ src/components/card/card.js | 26 +++++++++++++++++++++ src/components/card/card.stories.ts | 30 +++++++++++++++++++++++++ 7 files changed, 124 insertions(+) create mode 100644 .gitpod.yml create mode 100644 src/components/avatar/avatar.css create mode 100644 src/components/avatar/avatar.js create mode 100644 src/components/avatar/avatar.stories.ts create mode 100644 src/components/card/card.css create mode 100644 src/components/card/card.js create mode 100644 src/components/card/card.stories.ts diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..9e083d8 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,11 @@ +# This configuration file was automatically generated by Gitpod. +# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) +# and commit this file to your remote git repository to share the goodness with others. + +# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart + +tasks: + - init: npm install && npm run build + command: npm run dev + + diff --git a/src/components/avatar/avatar.css b/src/components/avatar/avatar.css new file mode 100644 index 0000000..b874cfc --- /dev/null +++ b/src/components/avatar/avatar.css @@ -0,0 +1,4 @@ +img { + width: 50px; + height: 20px; +} \ No newline at end of file diff --git a/src/components/avatar/avatar.js b/src/components/avatar/avatar.js new file mode 100644 index 0000000..fbed0f1 --- /dev/null +++ b/src/components/avatar/avatar.js @@ -0,0 +1,15 @@ +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 ` href + ${descricao} + ` +} \ No newline at end of file diff --git a/src/components/avatar/avatar.stories.ts b/src/components/avatar/avatar.stories.ts new file mode 100644 index 0000000..fd82c3b --- /dev/null +++ b/src/components/avatar/avatar.stories.ts @@ -0,0 +1,29 @@ +import type { StoryObj, Meta } from '@storybook/html'; +import {avatar} from './avatar'; +import type {AvatarProps} from './avatar'; + + +// 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 Primary: Story = { + args: { + link: 'github.com', + imgSrc: 'https://avatars.githubusercontent.com/u/132667649?v=4', + descricao: 'Octocat from Github ' + } +}; \ No newline at end of file diff --git a/src/components/card/card.css b/src/components/card/card.css new file mode 100644 index 0000000..9d0b4b7 --- /dev/null +++ b/src/components/card/card.css @@ -0,0 +1,9 @@ + +.card img { + width: 50px; + +} + +.card body { + width: 50px; +} \ No newline at end of file diff --git a/src/components/card/card.js b/src/components/card/card.js new file mode 100644 index 0000000..80d3182 --- /dev/null +++ b/src/components/card/card.js @@ -0,0 +1,26 @@ +import { avatar } from "../avatar/avatar" +import "./card.css" + + +/** + * @typedef {object} CardProps + * @property {string} CardProps.nome + * @property {string} CardProps.cargo + * @property {string} CardProps.img + * + * @param {CardProps} props + */ +export function card({nome, cargo, img}) { + + return `
+
+ ${avatar({imgSrc: img, descricao: 'profile picture from ' + nome})} +
+ +
+

Nome: ${nome}

+

Nome: ${cargo}

+
+
` +} + \ No newline at end of file diff --git a/src/components/card/card.stories.ts b/src/components/card/card.stories.ts new file mode 100644 index 0000000..5001389 --- /dev/null +++ b/src/components/card/card.stories.ts @@ -0,0 +1,30 @@ +import type { StoryObj, Meta } from '@storybook/html'; + +import { CardProps, card } from './card'; + +// 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: {description: 'nome do profile'}, + cargo: {description: 'cargo do profile'}, + img: {description: 'endereço para a imgaem 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: 'Paulo Luan', + cargo: 'Student Full Stack Developer', + img: 'https://avatars.githubusercontent.com/u/116959774?v=4', + } +}; \ No newline at end of file