Skip to content

Commit

Permalink
refa(docs): update mdx pages with name d-p (#1966)
Browse files Browse the repository at this point in the history
* feat(docs): update mdx pages with name d-p

* Create wicked-chefs-guess.md
  • Loading branch information
ti10le authored Apr 4, 2022
1 parent 872c741 commit ff1d083
Show file tree
Hide file tree
Showing 10 changed files with 181 additions and 247 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-chefs-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@marigold/docs": patch
---

refa(docs): update mdx pages with name d-p
46 changes: 7 additions & 39 deletions docs/content/components/dialog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ import { FigmaLink } from '../../src/components/FigmaLink';

# Dialog

## Description

Component to display a Dialog as a reaction to an event. The Dialog could be styled via theme and should be filled with content.
You can also add a title via title prop.

```tsx onlyCode
import { Dialog } from '@marigold/components';
```

<FigmaLink
to={
'https://www.figma.com/file/DFKyTGHAoDxOsUBPszLLxP/%F0%9F%8F%B5%EF%B8%8FMarigold?node-id=845%3A1095'
}
/>

## Properties
## Props

| Property | Type | Default |
| :--------------------------- | :----------------------------------------- | :---------- |
Expand All @@ -27,15 +29,9 @@ You can also add a title via title prop.
| `variant (optional)` | `string` | `__default` |
| `backdropVariant (optional)` | `string` | `backdrop` |

## Import

```tsx onlyCode
import { Dialog } from '@marigold/components';
```

## Live-Code Example
## Example

```tsx expandCode
```tsx
() => {
const { state, openButtonProps, openButtonRef } = useDialogButtonProps();
return (
Expand Down Expand Up @@ -63,31 +59,3 @@ import { Dialog } from '@marigold/components';
);
};
```

## Usage

```tsx
() => {
const { state, openButtonProps, openButtonRef } = useDialogButtonProps();
return (
<>
<Button
variant="secondary"
size="small"
{...openButtonProps}
ref={openButtonRef}
>
Open Dialog
</Button>
{state.isOpen && (
<Dialog title="Dialog Title" isOpen={state.isOpen} close={state.close}>
<Text>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum
dolor sit amet, consectetur adipiscing elit.
</Text>
</Dialog>
)}
</>
);
};
```
50 changes: 24 additions & 26 deletions docs/content/components/divider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,51 @@
title: Divider
---

# Divider
import { DoAndDont } from '../../src/components/DoAndDont';

## Description
# Divider

A divider is a visual separator between two groups of content,
e.g. groups of menu items or sections of a page.

## Properties
<Divider />

```tsx onlyCode
import { Divider } from '@marigold/components';
```

## Props

| Property | Type | Default |
| :------------------- | :------- | :---------- |
| `variant` (optional) | `string` | `__default` |

## Import
## Examples

```tsx onlyCode
import { Divider } from '@marigold/components';
Standard Divider

```tsx
<Divider />
```

## Live-Code Example
Bold Divider

```tsx expandCode
<>
<Text>Brightside</Text>
<Divider />
<Text>Darkside</Text>
</>
```tsx
<Divider variant="bold" />
```

## Usage

### Standard Divider
## Divider between Text

```tsx
<>
<Text>Some text</Text>
<Text>Dark Side</Text>
<Divider />
<Text>Some other text to show regular divider</Text>
<Text>Bright Side</Text>
</>
```

### Bold Divider
## Divider in Do & Don't component

```tsx
<>
<Text>Some text</Text>
<Divider variant="bold" />
<Text>Some other text to show strong divider</Text>
</>
```
<DoAndDont preview={<Text>Look at the greend bold Divider below</Text>}>
Example to show how Divider is used in Do & Don't component
</DoAndDont>
45 changes: 20 additions & 25 deletions docs/content/components/icon.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@ title: Icon

# Icon

## Installation
With the Icon component you can render one of the [Marigold Icons](../../foundation/icons).
By adding the `size` prop you can change to another size. `24` is the default size.
The `fill` prop is the second attribute and per default `currentcolor`.

### 1. React Icon component:
<Inline space="small">
<DesignTicket />
<Ticket />
<TicketInsurance />
<Resale />
</Inline>

### React Icon component

Marigold Icons have a separate package to install.
The first option is to install the package and use the Icons like other React components and as in the code example below.
Expand All @@ -20,44 +29,30 @@ npm install @marigold/icons --save
yarn add @marigold/icons
```

### 2. HTML SVG Element

The second option is to go to [Marigold Icons](../../foundation/icons) and click on an Icon in the list to copy them as `<svg>` Element
```tsx onlyCode
import { DesignTicket } from '@marigold/icons';
```

## Description
### HTML SVG Element

With the Icon component you can render one of the [Marigold Icons](../../foundation/icons).
By adding the `size` prop you can change to another size. `24` is the default size.
The `fill` prop is the second attribute and per default `currentcolor`.
The second option is to go to [Marigold Icons](../../foundation/icons) and click on an Icon in the list to copy them as `<svg>` Element

## Properties
## Props

| Property | Type | Default |
| :------- | :------- | :--------------- |
| `size` | `number` | `24` |
| `fill` | `string` | `'currentcolor'` |

## Import

```tsx onlyCode
import { DesignTicket } from '@marigold/icons';
```

## Live-Code Example

```tsx expandCode
<DesignTicket />
```

## Usage
## Examples

### size prop
Icon size

```tsx
<DesignTicket size={40} />
```

### fill prop
Icon color fill

```tsx
<DesignTicket fill="red" />
Expand Down
16 changes: 6 additions & 10 deletions docs/content/components/image.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,19 @@ title: Image

# Image

## Description
With the Image component you can render an image element.
The variant can be added with the variant prop. The default variant is `fullWidth`. You can also put the standard html image props like `alt` and `src`.

With the Image component you can render an image.
The variant can be added with the variant prop. The default variant is `fullWidth`.
```tsx onlyCode
import { Image } from '@marigold/components';
```

## Properties
## Props

| Property | Type | Default |
| :------------------- | :------- | :---------- |
| `variant` (optional) | `string` | `fullWidth` |

## Import

```tsx onlyCode
import { Image } from '@marigold/components';
```

## Usage

```tsx expandCode
Expand Down
39 changes: 25 additions & 14 deletions docs/content/components/inline.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,40 @@ title: Inline

# Inline

## Description
Layout component to inline elements with space. This component uses the spaces from the given theme or a responsive string.

Layout component to inline elements with space. This component uses the spaces from the given theme.
<MarigoldTheme>
<Inline space="small">
<Check />
<Text>Check</Text>
</Inline>
</MarigoldTheme>

```tsx onlyCode
import { Inline } from '@marigold/components';
```

## Properties
## Props

| Property | Type | Default |
| :------- | :----------------------------- | :------- |
| `space` | `ResponsiveStyleValue<string>` | `none` |
| `align` | `center, top, bottom` | `center` |

## Import

```tsx onlyCode
import { Inline } from '@marigold/components';
```
## Examples

## Live-Code Example
More than two elements

```tsx expandCode
<Inline space="small">
<Check />
<Text>Check</Text>
<Text>this</Text>
<Text>out</Text>
</Inline>
```

## Usage

### Spacing
Spacing

```tsx
<Inline space="large">
Expand All @@ -51,7 +56,7 @@ import { Inline } from '@marigold/components';
</Inline>
```

### Nested
Nested Inline

```tsx
<Inline space="large">
Expand All @@ -70,7 +75,7 @@ import { Inline } from '@marigold/components';
</Inline>
```

### Alignment
Different alignment

```tsx
<Inline space="medium" align="top">
Expand Down Expand Up @@ -98,3 +103,9 @@ import { Inline } from '@marigold/components';
<Text>Lorem ipsum dolor sit amet.</Text>
</Inline>
```

## Use cases

- [ActionGroup](../action-group)
- [Badge](../badge)
- [Button](../button)
Loading

0 comments on commit ff1d083

Please sign in to comment.