Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Automatic docs from UI #1070

Merged
merged 7 commits into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions docs/docs/reference/ui/atoms/Badge.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropsComponent from "@site/src/components/PropsComponent/PropsComponent";
import PropsSection from "@site/src/components/PropsSection/PropsSection";

# Badge

Expand All @@ -18,12 +18,7 @@ import { Badge } from '@faststore/ui'

## Props

<PropsComponent
name="testId"
type= "string"
description="ID to find this component in testing tools (e.g.: cypress, testing library, and jest)."
defaultValue="store-badge"
/>
<PropsSection name="Badge" />

## Customization

Expand Down
9 changes: 2 additions & 7 deletions docs/docs/reference/ui/atoms/Button.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropsComponent from "@site/src/components/PropsComponent/PropsComponent";
import PropsSection from "@site/src/components/PropsSection/PropsSection";

# Button

Expand All @@ -18,12 +18,7 @@ import { Button } from '@faststore/ui'

## Props

<PropsComponent
name="testId"
type= "string"
description="ID to find this component in testing tools (e.g.: cypress, testing library, and jest)."
defaultValue="store-button"
/>
<PropsSection name="Button" />

## Customization

Expand Down
11 changes: 3 additions & 8 deletions docs/docs/reference/ui/atoms/Checkbox.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropsComponent from "@site/src/components/PropsComponent/PropsComponent";
import PropsSection from "@site/src/components/PropsSection/PropsSection";

# Checkbox

Expand All @@ -21,13 +21,8 @@ import { Checkbox } from '@faststore/ui'

## Props

<PropsComponent
name="testId"
type= "string"
description="ID to find this component in testing tools (e.g.: cypress, testing library, and jest)."
defaultValue="store-checkbox"
/>
<PropsSection name="Checkbox" />

## Customization

`data-store-checkbox`
`data-store-checkbox`
18 changes: 3 additions & 15 deletions docs/docs/reference/ui/atoms/Icon.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropsComponent from "@site/src/components/PropsComponent/PropsComponent";
import PropsSection from "@site/src/components/PropsSection/PropsSection";

# Icon

Expand All @@ -18,20 +18,8 @@ import { Icon } from '@faststore/ui'

## Props

<PropsComponent
name="component"
type= "ReactNode"
description="A React component that will be rendered as an icon."
required="true"
/>

<PropsComponent
name="testId"
type= "string"
description="ID to find this component in testing tools (e.g.: cypress, testing library, and jest)."
defaultValue="store-icon"
/>
<PropsSection name="Icon" />

## Customization

`data-store-icon`
`data-store-icon`
16 changes: 2 additions & 14 deletions docs/docs/reference/ui/atoms/Input.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropsComponent from "@site/src/components/PropsComponent/PropsComponent";
import PropsSection from "@site/src/components/PropsSection/PropsSection";

# Input

Expand Down Expand Up @@ -30,19 +30,7 @@ import { Input } from '@faststore/ui'

## Props

<PropsComponent
name="variant"
type= "string"
description="Current variant of the input."
possibleValues="success | error"
/>

<PropsComponent
name="testId"
type= "string"
description="ID to find this component in testing tools (e.g.: cypress, testing library, and jest)."
defaultValue="store-input"
/>
<PropsSection name="Input" />

## Customization

Expand Down
9 changes: 2 additions & 7 deletions docs/docs/reference/ui/atoms/Label.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropsComponent from "@site/src/components/PropsComponent/PropsComponent";
import PropsSection from "@site/src/components/PropsSection/PropsSection";

# Label

Expand All @@ -18,12 +18,7 @@ import { Label } from '@faststore/ui'

## Props

<PropsComponent
name="testId"
type= "string"
description="ID to find this component in testing tools (e.g.: cypress, testing library, and jest)."
defaultValue="store-label"
/>
<PropsSection name="Label" />

## Customization

Expand Down
17 changes: 3 additions & 14 deletions docs/docs/reference/ui/atoms/List.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropsComponent from "@site/src/components/PropsComponent/PropsComponent";
import PropsSection from "@site/src/components/PropsSection/PropsSection";

# List

Expand Down Expand Up @@ -71,18 +71,7 @@ import { List } from '@faststore/ui'

## Props

<PropsComponent
name="variant"
type= "string"
possibleValues="description | ordered | unordered | unordered"
/>

<PropsComponent
name="testId"
type= "string"
description="ID to find this component in testing tools (e.g.: cypress, testing library, and jest)."
defaultValue="store-list"
/>
<PropsSection name="List" />

## Customization

Expand All @@ -92,4 +81,4 @@ import { List } from '@faststore/ui'

`data-ordered`

`data-description`
`data-description`
9 changes: 2 additions & 7 deletions docs/docs/reference/ui/atoms/Overlay.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropsComponent from "@site/src/components/PropsComponent/PropsComponent";
import PropsSection from "@site/src/components/PropsSection/PropsSection";

# Overlay

Expand Down Expand Up @@ -36,12 +36,7 @@ function Component () {

## Props

<PropsComponent
name="testId"
type= "string"
description="ID to find this component in testing tools (e.g.: cypress, testing library, and jest)."
defaultValue="store-overlay"
/>
<PropsSection name="Overlay" />

## Customization

Expand Down
17 changes: 2 additions & 15 deletions docs/docs/reference/ui/atoms/Popover.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropsComponent from "@site/src/components/PropsComponent/PropsComponent";
import PropsSection from "@site/src/components/PropsSection/PropsSection";

# Popover

Expand Down Expand Up @@ -36,20 +36,7 @@ function() {

## Props

<PropsComponent
name="targetRef"
type= "string"
description="Ref for the component initial position."
possibleValues="RefObject<PossibleNode>"
required="true"
/>

<PropsComponent
name="testId"
type= "string"
description="ID to find this component in testing tools (e.g.: cypress, testing library, and jest)."
defaultValue="store-popover"
/>
<PropsSection name="Popover" />

## Customization

Expand Down
40 changes: 5 additions & 35 deletions docs/docs/reference/ui/atoms/Price.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropsComponent from "@site/src/components/PropsComponent/PropsComponent";
import PropsSection from "@site/src/components/PropsSection/PropsSection";

# Price

Expand All @@ -13,8 +13,8 @@ import { Price } from '@faststore/ui'
## Usage

```tsx live
<Price
value={62.5}
<Price
value={62.5}
/>
```

Expand Down Expand Up @@ -89,37 +89,7 @@ import { Price } from '@faststore/ui'

## Props

<PropsComponent
name="value"
type= "number"
description="The raw price value."
required="true"
/>
<PropsComponent
name="as"
type= "string"
description="Set the HTML element tag of this component."
possibleValues="ElementType<any>"
/>
<PropsComponent
name="formatter"
type= "PriceFormatter"
description="Formatter function that transforms the raw price value and render the result."
defaultValue="price => price"
/>
<PropsComponent
name="variant"
type= "string"
description="The current use case variant for prices."
defaultValue="selling"
possibleValues="selling | listing | spot | savings | installment"
/>
<PropsComponent
name="testId"
type= "string"
description="ID to find this component in testing tools (e.g.: cypress, testing library, and jest)."
defaultValue="store-price"
/>
<PropsSection name="Price" />

## Customization

Expand All @@ -136,4 +106,4 @@ function customFormatter(price: number) {

return formattedPrice
},
```
```
9 changes: 2 additions & 7 deletions docs/docs/reference/ui/atoms/Radio.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropsComponent from "@site/src/components/PropsComponent/PropsComponent";
import PropsSection from "@site/src/components/PropsSection/PropsSection";

# Radio

Expand All @@ -18,12 +18,7 @@ import { Radio } from '@faststore/ui'

## Props

<PropsComponent
name="testId"
type= "string"
description="ID to find this component in testing tools (e.g.: cypress, testing library, and jest)."
defaultValue="store-radio"
/>
<PropsSection name="Radio" />

## Customization

Expand Down
9 changes: 2 additions & 7 deletions docs/docs/reference/ui/atoms/Select.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropsComponent from "@site/src/components/PropsComponent/PropsComponent";
import PropsSection from "@site/src/components/PropsSection/PropsSection";

# Select

Expand Down Expand Up @@ -78,12 +78,7 @@ import { Select } from '@faststore/ui'

## Props

<PropsComponent
name="testId"
type= "string"
description="ID to find this component in testing tools (e.g.: cypress, testing library, and jest)."
defaultValue="store-select"
/>
<PropsSection name="Select" />

## Customization

Expand Down
9 changes: 2 additions & 7 deletions docs/docs/reference/ui/atoms/Skeleton.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropsComponent from "@site/src/components/PropsComponent/PropsComponent";
import PropsSection from "@site/src/components/PropsSection/PropsSection";

# Skeleton

Expand All @@ -18,12 +18,7 @@ import { Skeleton } from '@faststore/ui'

## Props

<PropsComponent
name="testId"
type= "string"
description="ID to find this component in testing tools (e.g.: cypress, testing library, and jest)."
defaultValue="store-skeleton"
/>
<PropsSection name="Skeleton" />

## Customization

Expand Down
11 changes: 3 additions & 8 deletions docs/docs/reference/ui/atoms/Slider.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropsComponent from "@site/src/components/PropsComponent/PropsComponent";
import PropsSection from "@site/src/components/PropsSection/PropsSection";

# Slider

Expand All @@ -21,17 +21,12 @@ import { Slider } from '@faststore/ui'

## Props

<PropsComponent
name="testId"
type= "string"
description="ID to find this component in testing tools (e.g.: cypress, testing library, and jest)."
defaultValue="store-slider"
/>
<PropsSection name="Slider" />

## Customization

`data-store-slider`

`data-store-slider-range`

`data-store-slider-thumb='(left|right)'`
`data-store-slider-thumb='(left|right)'`
9 changes: 2 additions & 7 deletions docs/docs/reference/ui/atoms/Spinner.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropsComponent from "@site/src/components/PropsComponent/PropsComponent";
import PropsSection from "@site/src/components/PropsSection/PropsSection";

# Spinner

Expand All @@ -18,12 +18,7 @@ import { Spinner } from '@faststore/ui'

## Props

<PropsComponent
name="testId"
type= "string"
description="ID to find this component in testing tools (e.g.: cypress, testing library, and jest)."
defaultValue="store-spinner"
/>
<PropsSection name="Spinner" />

## Customization

Expand Down
Loading