diff --git a/public/icons/external-link.svg b/public/icons/external-link.svg new file mode 100644 index 0000000..aca4a4a --- /dev/null +++ b/public/icons/external-link.svg @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/public/models/mistral.webp b/public/models/mistral.webp new file mode 100644 index 0000000..b353391 Binary files /dev/null and b/public/models/mistral.webp differ diff --git a/src/components/Cards/ModelCard/ModelCard.mdx b/src/components/Cards/ModelCard/ModelCard.mdx new file mode 100644 index 0000000..f59af58 --- /dev/null +++ b/src/components/Cards/ModelCard/ModelCard.mdx @@ -0,0 +1,13 @@ +import { Canvas, Meta, ArgTypes } from '@storybook/blocks'; + +import * as ModelCardStories from './ModelCard.stories'; + + + +# Model Card + + + +### Props Table + + \ No newline at end of file diff --git a/src/components/Cards/ModelCard/ModelCard.stories.tsx b/src/components/Cards/ModelCard/ModelCard.stories.tsx new file mode 100644 index 0000000..db0b03e --- /dev/null +++ b/src/components/Cards/ModelCard/ModelCard.stories.tsx @@ -0,0 +1,28 @@ +import type { Meta, StoryObj } from "@storybook/react"; + +import ModelCard from "."; + +const meta: Meta = { + title: "Components/Model Card", + component: ModelCard, + decorators: [ + (Story) => ( + + + + ), + ], +}; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + args: { + icon: "/models/mistral.webp", + modelAuthor: "mistralai", + modelName: "Mistral-7B-v0.1", + externalLink: "https://huggingface.co/mistralai/Mistral-7B-v0.1", + }, +}; diff --git a/src/components/Cards/ModelCard/ModelCard.tsx b/src/components/Cards/ModelCard/ModelCard.tsx new file mode 100644 index 0000000..01fd19d --- /dev/null +++ b/src/components/Cards/ModelCard/ModelCard.tsx @@ -0,0 +1,35 @@ +import { FC } from "react"; + +interface ModelCardProps { + /** Image url for model icon */ + icon: string; + /** Model modelAuthor */ + modelAuthor: string; + /** Model name */ + modelName: string; + /** External link to model */ + externalLink?: string; +} + +const ModelCard: FC = ({ + icon, + modelAuthor, + modelName, + externalLink, +}) => ( + + + + + {modelAuthor}/{modelName} + + + {externalLink && ( + + + + )} + +); + +export default ModelCard; diff --git a/src/components/Cards/ModelCard/index.ts b/src/components/Cards/ModelCard/index.ts new file mode 100644 index 0000000..35b9014 --- /dev/null +++ b/src/components/Cards/ModelCard/index.ts @@ -0,0 +1,2 @@ +import ModelCard from "./ModelCard"; +export default ModelCard; diff --git a/src/components/Select/Select.stories.tsx b/src/components/Select/Select.stories.tsx index d7f21c3..1b94b8a 100644 --- a/src/components/Select/Select.stories.tsx +++ b/src/components/Select/Select.stories.tsx @@ -20,7 +20,7 @@ type Story = StoryObj; export const Default: Story = { args: { - listTitle: "Year", + label: "Year", listItems: [ { value: "2024", diff --git a/src/components/Select/Select.tsx b/src/components/Select/Select.tsx index d9b6c9c..46359b7 100644 --- a/src/components/Select/Select.tsx +++ b/src/components/Select/Select.tsx @@ -10,17 +10,21 @@ import { } from "react-aria-components"; interface listItem { + /** List item value (used for key) */ value: string; + /** List item label */ label: string; } interface SelectProps { - listTitle?: string; + /** Select field label */ + label?: string; + /** Select field list items */ listItems: listItem[]; } -const Select: FC = ({ listTitle, listItems }) => ( +const Select: FC = ({ label, listItems }) => ( - {listTitle && {listTitle}} + {label && {label}} diff --git a/src/styles/components/cards.css b/src/styles/components/cards.css new file mode 100644 index 0000000..42e4ac4 --- /dev/null +++ b/src/styles/components/cards.css @@ -0,0 +1,38 @@ +.card { + @apply justify-between max-w-[700px] bg-gray-50 border border-gray-300 rounded px-6 py-4 dark:bg-gray-900 dark:border-gray-600; + &, + .info { + @apply flex items-center; + } + .info { + @apply gap-3; + } + &.model-card { + .icon { + @apply h-7 w-7 rounded-full border border-gray-300 p-[3px] dark:border-gray-600; + } + p { + @apply flex; + } + p > span { + &:first-child { + @apply text-gray-600 font-medium dark:text-gray-300 mr-1; + } + &:last-child { + @apply text-black-600 font-semibold dark:text-gray-100 ml-1; + } + } + } + a { + @apply m-[-14px] p-[14px]; + img { + @apply transition-filter dark:invert-100 brightness-0 contrast-[25%]; + } + &:hover, + &:focus-visible { + img { + @apply brightness-0 contrast-100; + } + } + } +} diff --git a/src/styles/main.css b/src/styles/main.css index 8dd03e5..0417e8b 100644 --- a/src/styles/main.css +++ b/src/styles/main.css @@ -1,4 +1,5 @@ @import "./global.css"; +@import "./components/cards.css"; @import "./components/chat.css"; @import "./components/footer.css"; @import "./components/header.css"; diff --git a/tailwind.config.ts b/tailwind.config.ts index f7e87eb..5d01ac1 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -67,6 +67,7 @@ const theme: Config = { "font-size": "font-size", spacing: "margin, padding, gap", sizing: "height, width", + filter: "filter", }, invert: { "77": ".77",
+ {modelAuthor}/{modelName} +