Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

feat(docsite): add View Figma button to components gallery hero (#4805)

rubyycheung9753e3979f05
diff --git a/apps/docsite/src/app/(docs)/components/page.tsx b/apps/docsite/src/app/(docs)/components/page.tsx
index ea991d1608..043a2cd44b 100644
--- a/apps/docsite/src/app/(docs)/components/page.tsx
+++ b/apps/docsite/src/app/(docs)/components/page.tsx
@@ -10,7 +10,7 @@ import {Fragment, useMemo} from 'react';
import * as stylex from '@stylexjs/stylex';
import {Text} from '@astryxdesign/core/Text';
import {Heading} from '@astryxdesign/core/Text';
-import {VStack} from '@astryxdesign/core/Layout';
+import {VStack, HStack} from '@astryxdesign/core/Layout';
import {Section} from '@astryxdesign/core/Section';
import {Grid} from '@astryxdesign/core/Grid';
import {ClickableCard} from '@astryxdesign/core/ClickableCard';
@@ -24,6 +24,9 @@ import {blocks} from '../../../generated/blockRegistry';
import {ShowcaseThumbnail} from '../../../components/ShowcaseThumbnail';
import {layout} from '../../../layout.stylex';
+const FIGMA_LIBRARY_URL =
+ 'https://www.figma.com/design/q2r7MbL4JJKE0VBfxto919/Astryx-Library';
+
/**
* Category display order for the overview page.
* Sourced from component .doc.mjs `category` fields.
@@ -146,38 +149,52 @@ export default function ComponentsGalleryPage() {
state, and pattern.
</Text>
</VStack>
- <Popover
- width={360}
- content={
- <VStack gap={3}>
- <VStack gap={1}>
- <Text type="body" weight="bold">
- 1. Install the package
- </Text>
- <Card padding={0}>
- <CodeExampleBlock
- code="npm install @astryxdesign/core"
- language="bash"
- hasCopyButton
- />
- </Card>
- </VStack>
- <VStack gap={1}>
- <Text type="body" weight="bold">
- 2. Import a component
- </Text>
- <Card padding={0}>
- <CodeExampleBlock
- code="import {...} from '@astryxdesign/core/ComponentName';"
- language="typescript"
- hasCopyButton
- />
- </Card>
+ <HStack gap={3} vAlign="center">
+ <Popover
+ width={360}
+ content={
+ <VStack gap={3}>
+ <VStack gap={1}>
+ <Text type="body" weight="bold">
+ 1. Install the package
+ </Text>
+ <Card padding={0}>
+ <CodeExampleBlock
+ code="npm install @astryxdesign/core"
+ language="bash"
+ hasCopyButton
+ />
+ </Card>
+ </VStack>
+ <VStack gap={1}>
+ <Text type="body" weight="bold">
+ 2. Import a component
+ </Text>
+ <Card padding={0}>
+ <CodeExampleBlock
+ code="import {...} from '@astryxdesign/core/ComponentName';"
+ language="typescript"
+ hasCopyButton
+ />
+ </Card>
+ </VStack>
</VStack>
- </VStack>
- }>
- <Button variant="primary" size="lg" label="Install core library" />
- </Popover>
+ }>
+ <Button
+ variant="primary"
+ size="lg"
+ label="Install core library"
+ />
+ </Popover>
+ <Button
+ variant="secondary"
+ size="lg"
+ label="View Figma"
+ href={FIGMA_LIBRARY_URL}
+ target="_blank"
+ rel="noopener noreferrer"
+ />
+ </HStack>
</VStack>
{CATEGORIES.map(cat => {