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..8c754b3 --- /dev/null +++ b/src/components/avatar/avatar.css @@ -0,0 +1,4 @@ +img { + width: 50px; + height: 50px; +} \ 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..695ca68 --- /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 ` + ${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..fcc855c --- /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 imagem 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 ' + } +}; diff --git a/src/components/card/card.css b/src/components/card/card.css new file mode 100644 index 0000000..f208476 --- /dev/null +++ b/src/components/card/card.css @@ -0,0 +1,43 @@ + +.container { + width: 200px; + border: 1px solid #ccc; + border-radius: 8px; + overflow: hidden; + margin: 20px; + background-color: #363636; + } + + .container:hover{ + transform: scale(1.02); + } + + .header { + background-color: #00BFFF; + padding: 10px; + text-align: center; + } + + .header img { + width: 100px; + height: 100px; + border-radius: 50%; + object-fit: cover; + } + + .body { + padding: 20px; + } + + .nome { + font-size: 18px; + font-weight: bold; + text-align: center; + color: #4169E1; + } + + .cargo { + font-size: 14px; + color: #777; + text-align: center; + } \ 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..d843bd4 --- /dev/null +++ b/src/components/card/card.js @@ -0,0 +1,27 @@ + +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}

+

${cargo}

+
+
` +} + diff --git a/src/components/card/card.stories.ts b/src/components/card/card.stories.ts new file mode 100644 index 0000000..817318e --- /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 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: 'João Pedro', + cargo: 'Estudante Full Stack', + img: 'https://avatars.githubusercontent.com/u/132667649?v=4', + } +}; \ No newline at end of file diff --git a/src/components/logo/logo.css b/src/components/logo/logo.css index c7a5316..283201c 100644 --- a/src/components/logo/logo.css +++ b/src/components/logo/logo.css @@ -1,4 +1,8 @@ a.logo > img { width: 50px; +} + +img { + border-radius: 50px; } \ No newline at end of file diff --git a/src/components/logo/logo.stories.ts b/src/components/logo/logo.stories.ts index c18868d..f9b9176 100644 --- a/src/components/logo/logo.stories.ts +++ b/src/components/logo/logo.stories.ts @@ -24,7 +24,7 @@ type Story = StoryObj; export const Primary: Story = { args: { link: 'github.com', - imgSrc: 'https://github.githubassets.com/assets/mona-loading-dark-7701a7b97370.gif', + imgSrc: 'https://avatars.githubusercontent.com/u/132667649?v=4', descricao: 'Octocat from Github ' } };