1
0
Fork 0

[react] feat: Added docs for components/KeyVal

This commit is contained in:
joostdecock 2025-05-24 12:44:05 +02:00
parent 8025dc2577
commit 30e5d37c96
4 changed files with 53 additions and 3 deletions

View file

@ -0,0 +1,21 @@
import React from 'react'
import { KeyVal } from '@freesewing/react/components/KeyVal'
const colors = ['primary', 'secondary', 'accent', 'neutral', 'success', 'warning', 'error', 'info']
export const KeyValExample = () => (
<>
<b>Default</b>
<br />
<KeyVal k="key" val="value" />
<br />
<b>Colors</b>
<div className="tw:flex tw:flex-row tw:flex-wrap tw:gap-1">
{colors.map(c => <KeyVal key={c} k="color" val={c} color={c}/>)}
</div>
<b>Small</b>
<div className="tw:flex tw:flex-row tw:flex-wrap tw:gap-1">
{colors.map(c => <KeyVal key={c} k="color" val={c} color={c} small/>)}
</div>
</>
)

View file

@ -1,7 +1,21 @@
---
title: KeyVal
---
import { DocusaurusDoc } from '@freesewing/react/components/Docusaurus'
import { ComponentDocs } from '@site/src/components/component-docs.js'
import * as jsdoc from '@site/prebuild/jsdoc/components.keyval.mjs'
import { KeyValExample } from './_examples.js'
<DocusaurusDoc>
The __KeyVal component family provides the following components:
- [KeyVal](#keyval)
## KeyVal
<ComponentDocs docs={jsdoc.jsdocKeyVal} example={KeyValExample} />
</DocusaurusDoc>
:::note
This page is yet to be created
:::