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

Blockquote component #311

Merged
merged 9 commits into from
Aug 2, 2024
Merged
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
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>
```
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>
18 changes: 18 additions & 0 deletions docs/components/typography/blockquote/FwbBlockquoteSizeExample.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<template>
<div class="vp-raw flex flex-col gap-6">
<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>
</div>
</template>

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

</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<template>
<div class="vp-raw flex">
<fwb-blockquote type="solid">
"Flowbite is just awesome. Perfect choice for your next SaaS application.Perfect choice for your next SaaS application."
</fwb-blockquote>
</div>
</template>

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

</script>
34 changes: 34 additions & 0 deletions src/components/Typography/FwbBlockquote.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<template>
<blockquote :class="blockquoteClasses" :cite="cite">
<slot></slot>
</blockquote>
</template>

<script lang="ts" setup>
import { computed } from 'vue'
import { useMergeClasses } from '@/composables/useMergeClasses'

type BlockquoteType = 'default' | 'solid'

interface BlockquoteProps {
type?: BlockquoteType;
cite?: string;
class?: string;
}

const props = withDefaults(defineProps<BlockquoteProps>(), {
type: 'default',
cite: '',
class: '',
})

const defaultBlockquoteClasses = 'font-semibold text-lg italic text-gray-900 dark:text-white'
const solidBlockquoteClasses = 'bg-gray-100 dark:bg-gray-800 border-l-4 border-gray-300 p-4 dark:border-gray-500'

const blockquoteClasses = computed(() => useMergeClasses([
defaultBlockquoteClasses,
props.type === 'solid' ? solidBlockquoteClasses : '',
props.class,
]))

</script>
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export { default as FwbA } from './components/Typography/FwbA.vue'
export { default as FwbHeading } from './components/Typography/FwbHeading.vue'
export { default as FwbImg } from './components/Typography/FwbImg.vue'
export { default as FwbP } from './components/Typography/FwbP.vue'
export { default as FwbBlockquote } from './components/Typography/FwbBlockquote.vue'

// utilities
export { default as FlowbiteThemable } from './components/utils/FlowbiteThemable/FlowbiteThemable.vue'
Expand Down
Loading