diff --git a/.eslintrc.js b/.eslintrc.js index 9655d93..6e93d4a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -19,5 +19,6 @@ module.exports = { 'vue/multi-word-component-names': 'off', 'comma-dangle': ['error', 'always-multiline'], 'no-multiple-empty-lines': 'error', + 'object-curly-spacing': ['error', 'always'], }, } diff --git a/docs/.postcssrc.js b/docs/.postcssrc.js new file mode 100644 index 0000000..f87139c --- /dev/null +++ b/docs/.postcssrc.js @@ -0,0 +1,18 @@ +// https://github.com/vuejs/vitepress/issues/199#issuecomment-1168325262 +// by default vitepress adds .vp-doc h1|h2|h3...p and others tags inside vitepress document. +// here we add :not(:where(.vp-raw *)) selector to use it inside component examples +// to prevent component style pollution from .vp-doc styles + +module.exports = { + plugins: { + 'tailwindcss': {}, + 'postcss-prefix-selector': { + prefix: ':not(:where(.vp-raw *))', + includeFiles: [/vp-doc\.css/], + transform(prefix, _selector) { + const [selector, pseudo = ''] = _selector.split(/(:\S*)$/) + return selector + prefix + pseudo + } + }, + } +} \ No newline at end of file diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 31a9ea5..db1b1a5 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -16,9 +16,11 @@ function buildSidebar() { function getComponents() { return [ + { text: 'Alert', link: '/guide/alert/alert.md' }, { text: 'Button', link: '/guide/button/button.md' }, { text: 'Button Group', link: '/guide/buttonGroup/buttonGroup.md' }, { text: 'Spinner', link: '/guide/spinner/spinner.md' }, + { text: 'Tabs', link: '/guide/tabs/tabs.md' }, ] } @@ -27,7 +29,7 @@ function getComponents() { * https://github.com/vuejs/vitepress/blob/master/docs/.vitepress/config.js */ export default { - title: 'flowbite-vue vitepress', + title: 'Flowbite Vue 3 Components', themeConfig: { docsDir: 'docs', sidebar: buildSidebar(), diff --git a/docs/guide/alert/alert.md b/docs/guide/alert/alert.md new file mode 100644 index 0000000..18a3ca8 --- /dev/null +++ b/docs/guide/alert/alert.md @@ -0,0 +1,208 @@ + + +# Alert + +reference: [https://flowbite.com/docs/components/alert/](https://flowbite.com/docs/components/alert/) + +## Prop - type + +```typescript +export type AlertType = 'info' | 'danger' | 'success' | 'warning' | 'dark' +defineProps({ + type: { + type: String as PropType, + default: 'info', + }, +}) +``` + + + + +```vue + + +``` + +## Prop - title + +```typescript +defineProps({ + title: { + type: String, + default: '', + }, +}) +``` + + + + +```vue + + +``` + +## Prop - closable + +```typescript +defineProps({ + closable: { + type: Boolean, + default: false, + }, +}) +``` + + + + +```vue + + +``` + +## Prop - border + +```typescript +defineProps({ + border: { + type: Boolean, + default: false, + }, +}) +``` + + + + +```vue + + +``` + +## Prop - icon + +```typescript +defineProps({ + icon: { + type: Boolean, + default: true, + }, +}) +``` + + + + +```vue + + +``` + +## Prop - inline + +```typescript +defineProps({ + inline: { + type: Boolean, + default: true, + }, +}) +``` + + + + +```vue + + +``` \ No newline at end of file diff --git a/docs/guide/alert/examples/AlertBorderExample.vue b/docs/guide/alert/examples/AlertBorderExample.vue new file mode 100644 index 0000000..a5b5fa2 --- /dev/null +++ b/docs/guide/alert/examples/AlertBorderExample.vue @@ -0,0 +1,12 @@ + + diff --git a/docs/guide/alert/examples/AlertClosableExample.vue b/docs/guide/alert/examples/AlertClosableExample.vue new file mode 100644 index 0000000..df8aa11 --- /dev/null +++ b/docs/guide/alert/examples/AlertClosableExample.vue @@ -0,0 +1,12 @@ + + diff --git a/docs/guide/alert/examples/AlertIconExample.vue b/docs/guide/alert/examples/AlertIconExample.vue new file mode 100644 index 0000000..85444cc --- /dev/null +++ b/docs/guide/alert/examples/AlertIconExample.vue @@ -0,0 +1,12 @@ + + diff --git a/docs/guide/alert/examples/AlertInlineExample.vue b/docs/guide/alert/examples/AlertInlineExample.vue new file mode 100644 index 0000000..49dc4d3 --- /dev/null +++ b/docs/guide/alert/examples/AlertInlineExample.vue @@ -0,0 +1,33 @@ + + diff --git a/docs/guide/alert/examples/AlertTitleExample.vue b/docs/guide/alert/examples/AlertTitleExample.vue new file mode 100644 index 0000000..00ab33b --- /dev/null +++ b/docs/guide/alert/examples/AlertTitleExample.vue @@ -0,0 +1,12 @@ + + diff --git a/docs/guide/alert/examples/AlertTypeExample.vue b/docs/guide/alert/examples/AlertTypeExample.vue new file mode 100644 index 0000000..dd2c2cb --- /dev/null +++ b/docs/guide/alert/examples/AlertTypeExample.vue @@ -0,0 +1,12 @@ + + diff --git a/docs/guide/button/examples/ButtonColorExample.vue b/docs/guide/button/examples/ButtonColorExample.vue index 779be8e..3e63035 100644 --- a/docs/guide/button/examples/ButtonColorExample.vue +++ b/docs/guide/button/examples/ButtonColorExample.vue @@ -1,5 +1,5 @@