Skip to content

Commit

Permalink
Standardize Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejoYarce committed Jan 6, 2025
1 parent 517f051 commit fe40855
Show file tree
Hide file tree
Showing 44 changed files with 497 additions and 603 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ function App() {

### General

- [Banner](https://github.com/wri/wri-design-systems/tree/main/src/components/Banner)
- [NavigationRail](https://github.com/wri/wri-design-systems/tree/main/src/components/NavigationRail)
- [Slider](https://github.com/wri/wri-design-systems/tree/main/src/components/Slider)
- [TabBar](https://github.com/wri/wri-design-systems/tree/main/src/components/TabBar)
- [Tag](https://github.com/wri/wri-design-systems/tree/main/src/components/Tag)
- [InlineMessage](https://github.com/wri/wri-design-systems/tree/main/src/components/InlineMessage)

### Buttons

Expand All @@ -111,7 +111,7 @@ function App() {

### Inputs

- [Input](https://github.com/wri/wri-design-systems/tree/main/src/components/Input)
- [TextInput](https://github.com/wri/wri-design-systems/tree/main/src/components/TextInput)
- [Textarea](https://github.com/wri/wri-design-systems/tree/main/src/components/Textarea)

### Layers
Expand Down
129 changes: 0 additions & 129 deletions src/components/Banner/README.md

This file was deleted.

49 changes: 9 additions & 40 deletions src/components/Buttons/Button/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import { Button } from 'wri-design-systems'
## Usage

```html
<Button
label='Save and Download'
variant='primary'
/>
<button label="Save and Download" variant="primary" />
```

## Props
Expand All @@ -41,59 +38,39 @@ type ButtonProps = Omit<
### Primary
```html
<Button
label='Primary'
variant='primary'
/>
<button label="Primary" variant="primary" />
```
### Secondary
```html
<Button
label='Secondary'
variant='secondary'
/>
<button label="Secondary" variant="secondary" />
```
### Borderless
```html
<Button
label='Borderless'
variant='borderless'
/>
<button label="Borderless" variant="borderless" />
```
### Outline
```html
<Button
label='Outline'
variant='outline'
/>
<button label="Outline" variant="outline" />
```
## Button Sizes
### Default
```html
<Button
label="Primary"
size="default"
variant="primary"
/>
<button label="Primary" size="default" variant="primary" />
```
### Small
```html
<Button
label="Primary"
size="small"
variant="primary"
/>
<button label="Primary" size="small" variant="primary" />
```
## Button with Icon
Expand Down Expand Up @@ -123,19 +100,11 @@ type ButtonProps = Omit<
### Disabled
```html
<Button
label="Primary"
variant="primary"
disabled
/>
<button label="Primary" variant="primary" disabled />
```
### Loading state
```html
<Button
label="Primary"
variant="primary"
loading
/>
<button label="Primary" variant="primary" loading />
```
45 changes: 13 additions & 32 deletions src/components/Checkbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ import { Checkbox } from 'wri-design-systems'
## Usage

```html
<Checkbox
name='Checkbox'
value='1'
>
Checkbox
</Checkbox>
<Checkbox name="Checkbox" value="1"> Checkbox </Checkbox>
```

## Props
Expand Down Expand Up @@ -47,17 +42,13 @@ type CheckboxProps = Omit<
## Default Checked
```html
<Checkbox name='Checkbox' value='1' defaultChecked>
Checkbox
</Checkbox>
<Checkbox name="Checkbox" value="1" defaultChecked> Checkbox </Checkbox>
```
## Disabled
```html
<Checkbox name='Checkbox' value='1' disabled>
Checkbox
</Checkbox>
<Checkbox name="Checkbox" value="1" disabled> Checkbox </Checkbox>
```
## Indeterminate
Expand All @@ -74,31 +65,21 @@ const indeterminate = values.some((value) => value.checked) && !allChecked
```

```html
<Checkbox
ms="6"
checked={checked}
onCheckedChange={(e) => {
setValues((current) => {
const newValues = [...current]
newValues[index] = { ...newValues[index], checked: !!e.checked }
return newValues
})
}}
>
Item Checkbox
<Checkbox ms="6" checked="{checked}" onCheckedChange="{(e)" ="">
{ setValues((current) => { const newValues = [...current] newValues[index] = {
...newValues[index], checked: !!e.checked } return newValues }) }} > Item
Checkbox
</Checkbox>
```

```html
<Checkbox
checked={allChecked}
indeterminate={indeterminate}
onCheckedChange={(e) => {
setValues((current) =>
current.map((value) => ({ ...value, checked: !!e.checked })),
)
}}
checked="{allChecked}"
indeterminate="{indeterminate}"
onCheckedChange="{(e)"
=""
>
Main Checkbox
{ setValues((current) => current.map((value) => ({ ...value, checked:
!!e.checked })), ) }} > Main Checkbox
</Checkbox>
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import React from 'react'

import type { Meta, StoryObj } from '@storybook/react'
import { fn } from '@storybook/test'
import Banner from '.'
import InlineMessage from '.'

const meta = {
title: 'Banner',
component: Banner,
title: 'Inline Message',
component: InlineMessage,
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
args: { onActionClick: fn() },
} satisfies Meta<typeof Banner>
} satisfies Meta<typeof InlineMessage>

export default meta
type Story = StoryObj<typeof meta>
Expand Down
Loading

0 comments on commit fe40855

Please sign in to comment.