diff --git a/packages/docusaurus-playground/src/pages/index.mdx b/packages/docusaurus-playground/src/pages/index.mdx index e673ff0..fe88b7e 100644 --- a/packages/docusaurus-playground/src/pages/index.mdx +++ b/packages/docusaurus-playground/src/pages/index.mdx @@ -11,6 +11,7 @@ import { Showcase, HeroInfo, Box, + ProfileCards, } from '../components/mdx' @@ -81,13 +82,79 @@ import { + diff --git a/packages/logos-docusaurus-theme/src/client/components/Icon/Icon.tsx b/packages/logos-docusaurus-theme/src/client/components/Icon/Icon.tsx index 10b0aeb..a869382 100644 --- a/packages/logos-docusaurus-theme/src/client/components/Icon/Icon.tsx +++ b/packages/logos-docusaurus-theme/src/client/components/Icon/Icon.tsx @@ -30,6 +30,7 @@ import TwitterSvg from '../../static/icons/twitter.svg' import DiscordWhiteSvg from '../../static/icons/discord-white.svg' import TelegramWhiteSvg from '../../static/icons/telegram-white.svg' import XSvg from '../../static/icons/x.svg' +import Avatar from '../../static/icons/avatar.svg' type TIconProps = { size?: 's' | 'm' | 'l' @@ -220,3 +221,9 @@ export const IconX = (props: TIconProps): JSX.Element => ( ) + +export const IconAvatar = (props: TIconProps): JSX.Element => ( + + + +) diff --git a/packages/logos-docusaurus-theme/src/client/components/mdx/ProfileCards/ProfileCards.scss b/packages/logos-docusaurus-theme/src/client/components/mdx/ProfileCards/ProfileCards.scss new file mode 100644 index 0000000..108967c --- /dev/null +++ b/packages/logos-docusaurus-theme/src/client/components/mdx/ProfileCards/ProfileCards.scss @@ -0,0 +1,125 @@ +@use '../../../css/utils'; +@use '../../../css/lsd'; + +:root { + --card-height: 188px; + --mobile-width: 253px; + --mobile-height: 176px; +} + +.mdx-profile-cards { + display: grid; + grid-template-columns: repeat(4, minmax(0, 1fr)); + gap: 1rem; + margin-block: 80px; +} + +.mdx-profile-card__card { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: flex-start; + padding: 1rem; + border: 1px solid rgb(var(--lsd-border-primary)); + height: var(--card-height); +} + +.mdx-profile-card__profile { + display: flex; + flex-direction: column; + gap: 20px; +} + +.mdx-profile-card__avatar { + width: 40px !important; + height: 40px !important; + border-radius: 50%; + + svg { + width: 40px !important; + height: 40px !important; + + rect { + fill: unset !important; + } + } +} + +.mdx-profile-card__name { + @include lsd.typography('h4'); +} + +.mdx-profile-card__buttons { + display: flex; + flex-direction: row; + gap: 8px; + width: 100%; +} + +.mdx-profile-card__link { + text-decoration: none; + height: fit-content; + position: relative; + max-width: calc(50% - 4px); +} + +.mdx-profile-card__button { + padding: 4px 12px 4px 10px !important; + height: 28px !important; + max-width: 100% !important; + + > span { + display: flex; + gap: 12px; + align-items: center; + } + + svg { + width: 14px; + height: 14px; + } +} + +.mdx-profile-card__link__label { + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + overflow: hidden; +} + +.mdx-profile-card__label { + text-align: center; +} + +@include utils.responsive('lg', 'down') { + .mdx-profile-card { + grid-template-columns: 1fr; + } +} + +@include utils.responsive('md', 'down') { + .mdx-profile-cards { + display: flex; + flex-wrap: nowrap; + overflow-x: scroll; + overflow-y: hidden; + gap: 1rem; + scroll-snap-type: x mandatory; + margin-block: 40px; + } + + .mdx-profile-card__card { + flex: 0 0 var(--mobile-width); + width: var(--mobile-width); + height: var(--mobile-height); + scroll-snap-align: start !important; + } + + .mdx-profile-card__profile { + gap: 16px; + } + + .mdx-profile-card__name { + @include lsd.typography('h6'); + } +} diff --git a/packages/logos-docusaurus-theme/src/client/components/mdx/ProfileCards/ProfileCards.tsx b/packages/logos-docusaurus-theme/src/client/components/mdx/ProfileCards/ProfileCards.tsx new file mode 100644 index 0000000..41c61d1 --- /dev/null +++ b/packages/logos-docusaurus-theme/src/client/components/mdx/ProfileCards/ProfileCards.tsx @@ -0,0 +1,98 @@ +import { Button, Typography } from '@acid-info/lsd-react' +import React from 'react' +import './ProfileCards.scss' +import { IconAvatar, IconDiscordWhite, IconGithub } from '../../Icon' // '@logos-theme/components/Icon' doesn't work +import Link from '@docusaurus/Link' + +export type ProfileCardItem = { + imgSrc?: string + name?: string + githubUsername?: string + githubLink?: string + discordUsername?: string + discordLink?: string +} + +export type ProfileCardsProps = React.HTMLProps & { + items?: ProfileCardItem[] +} + +export const ProfileCards: React.FC = ({ + items = [], + ...props +}) => { + return ( +
+ {items.map((item, index) => { + return ( +
+
+ {typeof item.imgSrc === 'undefined' ? ( + + ) : ( + {typeof + )} + + {item.name} + +
+ +
+ {item?.githubUsername && item?.githubLink && ( + + + + )} + + {item?.discordUsername && item?.discordLink && ( + + + + )} +
+
+ ) + })} +
+ ) +} diff --git a/packages/logos-docusaurus-theme/src/client/components/mdx/ProfileCards/index.ts b/packages/logos-docusaurus-theme/src/client/components/mdx/ProfileCards/index.ts new file mode 100644 index 0000000..3127a93 --- /dev/null +++ b/packages/logos-docusaurus-theme/src/client/components/mdx/ProfileCards/index.ts @@ -0,0 +1 @@ +export * from './ProfileCards' diff --git a/packages/logos-docusaurus-theme/src/client/components/mdx/index.ts b/packages/logos-docusaurus-theme/src/client/components/mdx/index.ts index 5ac7fdf..0e5d815 100644 --- a/packages/logos-docusaurus-theme/src/client/components/mdx/index.ts +++ b/packages/logos-docusaurus-theme/src/client/components/mdx/index.ts @@ -16,3 +16,4 @@ export * from './ScrollToBottom' export * from './Showcase' export * from './Roadmap' export * from './HeroVideo' +export * from './ProfileCards' diff --git a/packages/logos-docusaurus-theme/src/client/static/icons/avatar.svg b/packages/logos-docusaurus-theme/src/client/static/icons/avatar.svg new file mode 100644 index 0000000..94307fb --- /dev/null +++ b/packages/logos-docusaurus-theme/src/client/static/icons/avatar.svg @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file