Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
59 changes: 59 additions & 0 deletions packages/docs/pages/core/form.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import Preview from '@/helper/preview.vue'
import PreviewFrame from '@/helper/preview-frame.vue'
import CodeHighlight from '@/helper/code-highlight.vue'
import Form from '@vue-material/core/Form'
import Input from '@vue-material/core/Input'
import Button from '@vue-material/core/Button'
import Flex from '@vue-material/core/Box/Flex'

export const meta = {
title: 'Form',
description: 'A form component that provides form values to its children.',
source: 'packages/lib/src/components/Form',
inherits: []
}

## Usage

<Preview>
<PreviewFrame height="300">
<Form :modelValue="{ name: '', email: '' }" @submit.prevent>
<Flex direction="column" gap="#sm" style="padding: 20px;">
<Input name="name" placeholder="Name" />
<Input name="email" placeholder="Email" />
<Button type="submit">Submit</Button>
</Flex>
</Form>
</PreviewFrame>

<CodeHighlight>
```vue
<script setup lang="ts">
import { Form, Input, Button, Flex } from '@vue-material/core'
import { ref } from 'vue'

const formData = ref({
name: '',
email: ''
})
</script>

<template>
<Form v-model="formData">
<Flex direction="column" gap="#sm">
<Input name="name" placeholder="Name" />
<Input name="email" placeholder="Email" />
<Button type="submit">Submit</Button>
</Flex>
</Form>
</template>
```

</CodeHighlight>
</Preview>

## Props

`modelValue?`: any

- The form data object. It provides values to child components based on their `name` prop.
120 changes: 120 additions & 0 deletions packages/docs/pages/core/frame.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import Preview from '@/helper/preview.vue'
import PreviewFrame from '@/helper/preview-frame.vue'
import CodeHighlight from '@/helper/code-highlight.vue'
import Frame from '@vue-material/core/Frame'
import Flex from '@vue-material/core/Box/Flex'

export const meta = {
title: 'Frame',
description: 'A shaped container component.',
source: 'packages/lib/src/components/Frame',
inherits: ['core/Box']
}

## Usage

<Preview>
<PreviewFrame height="200">
<Flex gap="#sm" align="center" justify="center">
<Frame size="96px">
Frame
</Frame>
</Flex>
</PreviewFrame>

<CodeHighlight>
```vue
<script setup lang="ts">
import { Frame } from '@vue-material/core'
</script>

<template>
<Frame size="96px">
Frame
</Frame>
</template>
```

</CodeHighlight>
</Preview>

## Themes

<Preview>
<PreviewFrame height="200">
<Flex gap="#sm" align="center" justify="center">
<Frame theme="primary">Primary</Frame>
<Frame theme="secondary">Secondary</Frame>
<Frame theme="tertiary">Tertiary</Frame>
<Frame theme="error">Error</Frame>
</Flex>
</PreviewFrame>

<CodeHighlight>
```vue
<script setup lang="ts">
import { Frame, Flex } from '@vue-material/core'
</script>

<template>
<Flex gap="#sm">
<Frame theme="primary">Primary</Frame>
<Frame theme="secondary">Secondary</Frame>
<Frame theme="tertiary">Tertiary</Frame>
<Frame theme="error">Error</Frame>
</Flex>
</template>
```

</CodeHighlight>
</Preview>

## Shapes

<Preview>
<PreviewFrame height="200">
<Flex gap="#sm" align="center" justify="center">
<Frame frame="circle">Circle</Frame>
<Frame frame="flower">Flower</Frame>
<Frame frame="clover">Clover</Frame>
<Frame frame="hexagon">Hexagon</Frame>
</Flex>
</PreviewFrame>

<CodeHighlight>
```vue
<script setup lang="ts">
import { Frame, Flex } from '@vue-material/core'
</script>

<template>
<Flex gap="#sm">
<Frame frame="circle">Circle</Frame>
<Frame frame="flower">Flower</Frame>
<Frame frame="clover">Clover</Frame>
<Frame frame="hexagon">Hexagon</Frame>
</Flex>
</template>
```

</CodeHighlight>
</Preview>

## Props

> #### Inherits `BoxProps`

`size?`: SizesString

- The size of the frame
- Default: `96`

`frame?`: 'circle' | 'flower' | 'clover' | 'hexagon' | 'none'

- The shape of the frame
- Default: `'none'`

`theme?`: 'primary' | 'secondary' | 'tertiary' | 'error' | 'none'

- The color theme of the frame
- Default: `'none'`
79 changes: 79 additions & 0 deletions packages/docs/pages/core/paper.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import Preview from '@/helper/preview.vue'
import PreviewFrame from '@/helper/preview-frame.vue'
import CodeHighlight from '@/helper/code-highlight.vue'
import Paper from '@vue-material/core/Paper'
import Flex from '@vue-material/core/Box/Flex'

export const meta = {
title: 'Paper',
description: 'A surface that displays content and actions on a single topic.',
source: 'packages/lib/src/components/Paper',
inherits: ['core/Box']
}

## Usage

<Preview>
<PreviewFrame height="200">
<Flex gap="#sm" wrap="wrap" justify="center">
<Paper>Neutral (Default)</Paper>
</Flex>
</PreviewFrame>

<CodeHighlight>
```vue
<script setup lang="ts">
import { Paper } from '@vue-material/core'
</script>

<template>
<Paper>Neutral (Default)</Paper>
</template>
```

</CodeHighlight>
</Preview>

## Variants

<Preview>
<PreviewFrame height="300">
<Flex gap="#sm" wrap="wrap" justify="center">
<Paper variant="primary">Primary</Paper>
<Paper variant="secondary">Secondary</Paper>
<Paper variant="tertiary">Tertiary</Paper>
<Paper variant="error">Error</Paper>
<Paper variant="neutral">Neutral</Paper>
<Paper variant="outlined">Outlined</Paper>
</Flex>
</PreviewFrame>

<CodeHighlight>
```vue
<script setup lang="ts">
import { Paper, Flex } from '@vue-material/core'
</script>

<template>
<Flex gap="#sm" wrap="wrap">
<Paper variant="primary">Primary</Paper>
<Paper variant="secondary">Secondary</Paper>
<Paper variant="tertiary">Tertiary</Paper>
<Paper variant="error">Error</Paper>
<Paper variant="neutral">Neutral</Paper>
<Paper variant="outlined">Outlined</Paper>
</Flex>
</template>
```

</CodeHighlight>
</Preview>

## Props

> #### Inherits `BoxProps`

`variant?`: 'primary' | 'secondary' | 'tertiary' | 'error' | 'neutral' | 'outlined'

- The variant of the paper
- Default: `"neutral"`
Loading
Loading