Skip to content

Commit

Permalink
Merge branch 'main' into toggle-size-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sqrcz committed Aug 6, 2024
2 parents 1851aee + bce8477 commit 2b7576c
Show file tree
Hide file tree
Showing 24 changed files with 393 additions and 29 deletions.
1 change: 1 addition & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function getUtils() {

function getTypography() {
return [
{ text: "Blockquote", link: '/components/blockquote' },
{ text: 'Heading', link: '/components/heading' },
{ text: 'Paragraph', link: '/components/paragraph' },
{ text: 'Image', link: '/components/image' },
Expand Down
73 changes: 73 additions & 0 deletions docs/components/blockquote.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<script setup>
import FwbBlockquoteExample from './typography/blockquote/FwbBlockquoteExample.vue'
import FwbBlockquoteSolidExample from './typography/blockquote/FwbBlockquoteSolidExample.vue'
import FwbBlockquoteAlignExample from './typography/blockquote/FwbBlockquoteAlignExample.vue'
import FwbBlockquoteSizeExample from './typography/blockquote/FwbBlockquoteSizeExample.vue'
</script>

# Vue Blockquote - Flowbite
---

:::tip
Original reference: [https://flowbite.com/docs/typography/blockquote/](https://flowbite.com/docs/typography/blockquote/)
:::

## Get started with a collection of blockquote components when quoting external sources such as quotes inside an article, user reviews, and testimonials based on multiple examples of layouts, styles, and contexts.

## Default blockquote

Use this example to quote an external source inside a `<fwb-blockquote>` component.

<fwb-blockquote-example/>

```vue
<fwb-blockquote>
"Flowbite is just awesome. It contains tons of predesigned components and pages starting from login screen to complex dashboard.
Perfect choice for your next SaaS application."
</fwb-blockquote>
```

## Solid background
This example can be used as an alternative style to the default style by applying a solid background color with `type="solid"`.

<fwb-blockquote-solid-example />

```vue
<fwb-blockquote type="solid">
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
</fwb-blockquote>
```

## Alignment

Choose from the following examples the blockquote text alignment from starting from left, center to right based on the utility classes from Tailwind CSS.

<fwb-blockquote-align-example />
```vue
<fwb-blockquote class="text-left">
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
</fwb-blockquote>
<fwb-blockquote class="text-center">
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
</fwb-blockquote>
<fwb-blockquote class="text-right">
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
</fwb-blockquote>
```

## Size

Choose from one of the multiple sizes for the default blockquote component based on the surrounding elements and sizes.

<fwb-blockquote-size-example />
```vue
<fwb-blockquote class="text-lg">
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
</fwb-blockquote>
<fwb-blockquote class="text-xl">
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
</fwb-blockquote>
<fwb-blockquote class="text-2xl">
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
</fwb-blockquote>
```
35 changes: 29 additions & 6 deletions docs/components/dropdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The dropdown component can be used to show a list of menu items when clicking on
<fwb-dropdown-example-placement />
```vue
<template>
<fwb-dropdown text="Bottom">
<fwb-dropdown placement="top" text="Top">
<div class="w-52">
<p class="p-2">
Dropdown content line one
Expand All @@ -38,7 +38,7 @@ The dropdown component can be used to show a list of menu items when clicking on
</p>
</div>
</fwb-dropdown>
<fwb-dropdown placement="top" text="Top">
<fwb-dropdown placement="right" text="Right">
<div class="w-52">
<p class="p-2">
Dropdown content line one
Expand All @@ -54,7 +54,7 @@ The dropdown component can be used to show a list of menu items when clicking on
</p>
</div>
</fwb-dropdown>
<fwb-dropdown placement="right" text="Right">
<fwb-dropdown text="Bottom">
<div class="w-52">
<p class="p-2">
Dropdown content line one
Expand Down Expand Up @@ -100,7 +100,7 @@ The property controls how the dropdown is aligned with the trigger
<fwb-dropdown-example-alignment />
```vue
<template>
<fwb-dropdown text="Bottom" align-to-end>
<fwb-dropdown placement="top" text="Top" align-to-end>
<div class="w-52">
<p class="p-2">
Dropdown content line one
Expand All @@ -116,7 +116,7 @@ The property controls how the dropdown is aligned with the trigger
</p>
</div>
</fwb-dropdown>
<fwb-dropdown placement="top" text="Top" align-to-end>
<fwb-dropdown placement="right" text="Right" align-to-end>
<div class="w-52">
<p class="p-2">
Dropdown content line one
Expand All @@ -132,7 +132,7 @@ The property controls how the dropdown is aligned with the trigger
</p>
</div>
</fwb-dropdown>
<fwb-dropdown placement="right" text="Right" align-to-end>
<fwb-dropdown text="Bottom" align-to-end>
<div class="w-52">
<p class="p-2">
Dropdown content line one
Expand Down Expand Up @@ -257,3 +257,26 @@ import { FwbDropdown, FwbListGroup, FwbListGroupItem } from 'flowbite-vue'
import { FwbDropdown, ListGroup, ListGroupItem } from 'flowbite-vue'
</script>
```

## API

### Props
| Name | Values | Default |
|----------|--------|---------|
| placement | `DropdownPlacement` | `'bottom'` |
| text | `string` | `''` |
| transition | `string` | `''` |
| closeInside | `boolean` | `false` |
| alignToEnd | `boolean` | `false` |

### Events
| Name | Description |
|------|------------------------|
| show | the dropdown is opened |
| hide | the dropdown is closed |

### Slots
| Name | Description |
|------------|-------------------|
| default | dropdown content |
| suffix | button suffix |
28 changes: 28 additions & 0 deletions docs/components/modal.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import FwbModalExample from './modal/examples/FwbModalExample.vue'
import FwbModalExampleSize from './modal/examples/FwbModalExampleSize.vue'
import FwbModalExampleEscapable from './modal/examples/FwbModalExampleEscapable.vue'
import FwbModalExamplePersistent from './modal/examples/FwbModalExamplePersistent.vue'
import FwbModalExamplePosition from './modal/examples/FwbModalExamplePosition.vue'
</script>
# Vue Modal - Flowbite

Expand Down Expand Up @@ -91,6 +92,33 @@ import { FwbModal } from 'flowbite-vue'
</script>
```

## Position

The `position` prop allows you to control the placement of the modal on the screen, taking into account RTL (Right-to-Left) mode. You can choose from the following options:

`top-start`, `top-center`, `top-end`, `center-start`, `center`, `center-end`, `bottom-start`, `bottom-center`, `bottom-end`

The default value is: `center`

<fwb-modal-example-position />
```vue
<template>
<fwb-modal position="top-start" />
<fwb-modal position="top-center" />
<fwb-modal position="top-end" />
<fwb-modal position="center-start" />
<fwb-modal position="center" />
<fwb-modal position="center-end" />
<fwb-modal position="bottom-start" />
<fwb-modal position="bottom-center" />
<fwb-modal position="bottom-end" />
</template>
<script setup>
import { FwbModal } from 'flowbite-vue'
</script>
```

## Escapable

The escapable property is true by default to improve user experience and accessibility.
Expand Down
5 changes: 4 additions & 1 deletion docs/components/modal/examples/FwbModalExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:not-escapable="notEscapable"
:persistent="persistent"
:size="size"
:position="position"
@close="closeModal"
>
<template #header>
Expand Down Expand Up @@ -45,20 +46,22 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { FwbButton, FwbModal } from '../../../../src/index'
import { type ModalSize } from '../../../../src/components/FwbModal/types'
import { type ModalPosition, type ModalSize } from '../../../../src/components/FwbModal/types'
interface ModalProps {
size?: ModalSize,
notEscapable?: boolean,
persistent?: boolean,
triggerText?: string
position?: ModalPosition
}
withDefaults(defineProps<ModalProps>(), {
size: '2xl',
notEscapable: false,
persistent: false,
triggerText: 'Open Modal',
position: 'center',
})
const isShowModal = ref(false)
Expand Down
62 changes: 62 additions & 0 deletions docs/components/modal/examples/FwbModalExamplePosition.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<template>
<div class="flex flex-wrap justify-start gap-2 vp-raw">
<span>
<fwb-modal-example
position="top-start"
trigger-text="Top Start"
/>
</span>
<span>
<fwb-modal-example
position="top-center"
trigger-text="Top Center"
/>
</span>
<span>
<fwb-modal-example
position="top-end"
trigger-text="Top End"
/>
</span>
<span>
<fwb-modal-example
position="center-start"
trigger-text="Center Start"
/>
</span>
<span>
<fwb-modal-example
position="center"
trigger-text="Center"
/>
</span>
<span>
<fwb-modal-example
position="center-end"
trigger-text="Center End"
/>
</span>
<span>
<fwb-modal-example
position="bottom-start"
trigger-text="Bottom Start"
/>
</span>
<span>
<fwb-modal-example
position="bottom-center"
trigger-text="Bottom Center"
/>
</span>
<span>
<fwb-modal-example
position="bottom-end"
trigger-text="Bottom End"
/>
</span>
</div>
</template>

<script setup>
import FwbModalExample from './FwbModalExample.vue'
</script>
9 changes: 8 additions & 1 deletion docs/components/textarea.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,19 @@ const message = ref('')
</script>
```

## Disabled / Readonly Textarea
## Disabled / Readonly Textarea / Max-Min Length

<fwb-textarea-example-disabled />
```vue
<template>
<div>
<fwb-textarea
v-model="message"
label="Textarea with minlength 10 and maxlength 20"
minlength="10"
maxlength="20"
required
/>
<fwb-textarea
v-model="message"
label="Your message"
Expand Down
15 changes: 15 additions & 0 deletions docs/components/toggle.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import FwbToggleExampleColors from './toggle/examples/FwbToggleExampleColors.vue'
import FwbToggleExampleDisabled from './toggle/examples/FwbToggleExampleDisabled.vue'
import FwbToggleExampleSize from './toggle/examples/FwbToggleExampleSize.vue'
import FwbToggleExampleOrder from './toggle/examples/FwbToggleExampleOrder.vue'
</script>

# Vue Toggle - Flowbite
Expand Down Expand Up @@ -94,3 +95,17 @@ const toggle = ref(false)
import { FwbToggle } from 'flowbite-vue'
</script>
```

## Label position

<fwb-toggle-example-order />
```vue
<template>
<fwb-toggle label="Toggle me" />
<fwb-toggle label="Toggle me" reverse />
</template>
<script setup>
import { FwbToggle } from 'flowbite-vue'
</script>
```
13 changes: 13 additions & 0 deletions docs/components/toggle/examples/FwbToggleExampleOrder.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<template>
<div class="vp-raw grid gap-3">
<fwb-toggle label="Toggle me" />
<fwb-toggle
label="Toggle me"
reverse
/>
</div>
</template>

<script setup>
import { FwbToggle } from '../../../../src/index'
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<template>
<div class="vp-raw flex flex-col gap-6">

Check warning on line 2 in docs/components/typography/blockquote/FwbBlockquoteAlignExample.vue

View workflow job for this annotation

GitHub Actions / lint (18.x)

Expected indentation of 2 spaces but found 0 spaces
<fwb-blockquote class="text-left">
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS

Check warning on line 4 in docs/components/typography/blockquote/FwbBlockquoteAlignExample.vue

View workflow job for this annotation

GitHub Actions / lint (18.x)

Expected indentation of 6 spaces but found 8 spaces
application."

Check warning on line 5 in docs/components/typography/blockquote/FwbBlockquoteAlignExample.vue

View workflow job for this annotation

GitHub Actions / lint (18.x)

Expected indentation of 6 spaces but found 8 spaces
</fwb-blockquote>
<fwb-blockquote class="text-center">
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS

Check warning on line 8 in docs/components/typography/blockquote/FwbBlockquoteAlignExample.vue

View workflow job for this annotation

GitHub Actions / lint (18.x)

Expected indentation of 6 spaces but found 8 spaces
application."

Check warning on line 9 in docs/components/typography/blockquote/FwbBlockquoteAlignExample.vue

View workflow job for this annotation

GitHub Actions / lint (18.x)

Expected indentation of 6 spaces but found 8 spaces
</fwb-blockquote>
<fwb-blockquote class="text-right">
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS

Check warning on line 12 in docs/components/typography/blockquote/FwbBlockquoteAlignExample.vue

View workflow job for this annotation

GitHub Actions / lint (18.x)

Expected indentation of 6 spaces but found 8 spaces
application."

Check warning on line 13 in docs/components/typography/blockquote/FwbBlockquoteAlignExample.vue

View workflow job for this annotation

GitHub Actions / lint (18.x)

Expected indentation of 6 spaces but found 8 spaces
</fwb-blockquote>
</div>

Check warning on line 15 in docs/components/typography/blockquote/FwbBlockquoteAlignExample.vue

View workflow job for this annotation

GitHub Actions / lint (18.x)

Expected indentation of 2 spaces but found 0 spaces
</template>

<script setup>
import { FwbBlockquote } from '../../../../src/index'
</script>
12 changes: 12 additions & 0 deletions docs/components/typography/blockquote/FwbBlockquoteExample.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<template>
<div class="vp-raw">

Check warning on line 2 in docs/components/typography/blockquote/FwbBlockquoteExample.vue

View workflow job for this annotation

GitHub Actions / lint (18.x)

Expected indentation of 2 spaces but found 0 spaces
<fwb-blockquote>
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."

Check warning on line 4 in docs/components/typography/blockquote/FwbBlockquoteExample.vue

View workflow job for this annotation

GitHub Actions / lint (18.x)

Expected indentation of 6 spaces but found 8 spaces
</fwb-blockquote>
</div>
</template>

<script setup>
import { FwbBlockquote } from '../../../../src/index'
</script>
Loading

0 comments on commit 2b7576c

Please sign in to comment.