From 4cca3e63cfd03a96a7d89339cb5b12b4b54fe03d Mon Sep 17 00:00:00 2001 From: Alexandr Date: Tue, 26 Jul 2022 19:13:30 +0300 Subject: [PATCH] feat: toast component --- README.md | 16 +- docs/.vitepress/config.ts | 2 +- .../toast/examples/ToastClosableExample.vue | 19 +++ .../toast/examples/ToastDivideExample.vue | 19 +++ .../toast/examples/ToastIconExample.vue | 36 ++++ .../examples/ToastInteractiveExample.vue | 20 +++ .../toast/examples/ToastMessageExample.vue | 15 ++ ...{ToastExample.vue => ToastTypeExample.vue} | 5 +- docs/components/toast/toast.md | 159 +++++++++++++++++- src/components/Button/Button.vue | 7 +- src/components/Toast/Toast.vue | 51 ++++-- .../Toast/composables/useToastClasses.ts | 29 ++++ src/components/Toast/types.ts | 1 + .../FlowbiteThemableChild.vue | 7 +- .../useFlowbiteThemableChildClasses.ts | 4 +- .../composables/useFlowbiteThemable.ts | 30 ++-- 16 files changed, 382 insertions(+), 38 deletions(-) create mode 100644 docs/components/toast/examples/ToastClosableExample.vue create mode 100644 docs/components/toast/examples/ToastDivideExample.vue create mode 100644 docs/components/toast/examples/ToastIconExample.vue create mode 100644 docs/components/toast/examples/ToastInteractiveExample.vue create mode 100644 docs/components/toast/examples/ToastMessageExample.vue rename docs/components/toast/examples/{ToastExample.vue => ToastTypeExample.vue} (70%) diff --git a/README.md b/README.md index a195326..9736ccb 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ module.exports = { - + Tailwind CSS Alerts @@ -111,12 +111,12 @@ module.exports = { - + Tailwind CSS Buttons - + Tailwind CSS Button Group @@ -133,7 +133,7 @@ module.exports = { - + Tailwind CSS Dropdown @@ -143,7 +143,7 @@ module.exports = { - + Tailwind CSS List group @@ -165,7 +165,7 @@ module.exports = { - + Tailwind CSS Tabs @@ -195,7 +195,7 @@ module.exports = { :construction: Progress bar :construction: Tables - :construction: Toast + Toast @@ -209,7 +209,7 @@ module.exports = { - + Tailwind CSS Toast diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 8818810..d686abb 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -34,6 +34,7 @@ function getComponents() { { text: 'Spinner', link: '/components/spinner/spinner.md' }, { text: 'Tabs', link: '/components/tabs/tabs.md' }, { text: 'ListGroup', link: 'components/listGroup/listGroup.md' }, + { text: 'Toast', link: 'components/toast/toast.md' }, { text: '- Accordion', link: 'components/accordion/accordion.md' }, { text: '- Avatar', link: 'components/avatar/avatar.md' }, @@ -50,7 +51,6 @@ function getComponents() { { text: '- Sidebar', link: 'components/sidebar/sidebar.md' }, { text: '- Table', link: 'components/table/table.md' }, { text: '- Timeline', link: 'components/timeline/timeline.md' }, - { text: '- Toast', link: 'components/toast/toast.md' }, { text: '- Tooltip', link: 'components/tooltip/tooltip.md' }, ] } diff --git a/docs/components/toast/examples/ToastClosableExample.vue b/docs/components/toast/examples/ToastClosableExample.vue new file mode 100644 index 0000000..9c34729 --- /dev/null +++ b/docs/components/toast/examples/ToastClosableExample.vue @@ -0,0 +1,19 @@ + + diff --git a/docs/components/toast/examples/ToastDivideExample.vue b/docs/components/toast/examples/ToastDivideExample.vue new file mode 100644 index 0000000..18cfdd1 --- /dev/null +++ b/docs/components/toast/examples/ToastDivideExample.vue @@ -0,0 +1,19 @@ + + diff --git a/docs/components/toast/examples/ToastIconExample.vue b/docs/components/toast/examples/ToastIconExample.vue new file mode 100644 index 0000000..9ab3f81 --- /dev/null +++ b/docs/components/toast/examples/ToastIconExample.vue @@ -0,0 +1,36 @@ + + diff --git a/docs/components/toast/examples/ToastInteractiveExample.vue b/docs/components/toast/examples/ToastInteractiveExample.vue new file mode 100644 index 0000000..a26f486 --- /dev/null +++ b/docs/components/toast/examples/ToastInteractiveExample.vue @@ -0,0 +1,20 @@ + + diff --git a/docs/components/toast/examples/ToastMessageExample.vue b/docs/components/toast/examples/ToastMessageExample.vue new file mode 100644 index 0000000..52a67be --- /dev/null +++ b/docs/components/toast/examples/ToastMessageExample.vue @@ -0,0 +1,15 @@ + + diff --git a/docs/components/toast/examples/ToastExample.vue b/docs/components/toast/examples/ToastTypeExample.vue similarity index 70% rename from docs/components/toast/examples/ToastExample.vue rename to docs/components/toast/examples/ToastTypeExample.vue index 91f1323..3ff32ed 100644 --- a/docs/components/toast/examples/ToastExample.vue +++ b/docs/components/toast/examples/ToastTypeExample.vue @@ -1,5 +1,8 @@