diff --git a/apps/docs/src/Welcome.mdx b/apps/docs/src/Welcome.mdx index 90f813a..48e4421 100644 --- a/apps/docs/src/Welcome.mdx +++ b/apps/docs/src/Welcome.mdx @@ -1,4 +1,4 @@ -import { Meta } from '@storybook/addon-docs/blocks' +import { Meta, Source } from '@storybook/addon-docs/blocks' import { DocHero, DocCards } from './DocBlocks' import { documentation, totalStories } from '@tansy/brand' @@ -11,6 +11,12 @@ import { documentation, totalStories } from '@tansy/brand' Tansy UI is named after the tansy flower, also called golden buttons: many small round heads that read as one bloom. The kit works the same way. It currently has **{documentation.length} components** and **{totalStories} stories**, built on Base UI with React 19, TypeScript and Tailwind CSS v4. +## Install + + + +Then add one line of CSS, either `@import "@openkhalix/tansy-ui/tokens.css"` for Tailwind v4 apps, or `import '@openkhalix/tansy-ui/styles.css'` for apps without Tailwind. Both setups are covered in [Getting started](/docs/introduction-getting-started--documentation). + ## Start here { + if (index === 0) return part + return {part} + }) +} + function CodeSample() { const [copied, setCopied] = useState(false) @@ -147,6 +176,35 @@ function CodeSample() { ) } +/** A dark code panel with a copy button, reused by every install command. */ +function CommandPanel({ label, code }: { label: string; code: string }) { + const [copied, setCopied] = useState(false) + + async function copy() { + try { + await navigator.clipboard.writeText(code) + setCopied(true) + window.setTimeout(() => setCopied(false), 1600) + } catch { + setCopied(false) + } + } + + return ( +
+
+ {label} + +
+
+        {highlightCommand(code)}
+      
+
+ ) +} + type FormErrors = Partial> function EmployeeForm() { @@ -302,6 +360,7 @@ function App() { v{VERSION}