From 8f09d0c5ef81c2d7d5fc608fe6c5d7c2fa1a2267 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Fri, 26 Nov 2021 14:22:43 +0100 Subject: [PATCH] feat: support presets (#14) --- build.config.ts | 1 + docs/app.vue | 2 +- docs/pages/components/[component].vue | 13 +- docs/pages/index.vue | 4 + docs/pages/migration.vue | 33 +++-- package.json | 6 +- src/components/forms/Input.vue | 146 ++++++------------- src/components/forms/Select.vue | 193 +++++++++++++------------- src/components/forms/Textarea.vue | 51 +++---- src/index.ts | 75 +++++++--- src/presets/tailwindui.ts | 96 +++++++++++++ 11 files changed, 351 insertions(+), 269 deletions(-) create mode 100644 src/presets/tailwindui.ts diff --git a/build.config.ts b/build.config.ts index bd31e71f..7f9fdd9b 100644 --- a/build.config.ts +++ b/build.config.ts @@ -2,6 +2,7 @@ export default { entries: [ './src/index', { input: './src/components/', outDir: 'dist/components', ext: 'js' }, + { input: './src/presets/', outDir: 'dist/presets', ext: 'js' }, { input: './src/utils/', outDir: 'dist/utils', ext: 'js' } ], declaration: true, diff --git a/docs/app.vue b/docs/app.vue index 114d07f4..cd56f28a 100644 --- a/docs/app.vue +++ b/docs/app.vue @@ -55,7 +55,7 @@ import { UseDark } from '@vueuse/components' const sections = [ - { label: 'Getting Started', links: [{ label: 'Installation', to: '/' }, { label: 'Examples', to: '/examples' }, { label: 'Migration', to: '/migration' }, { label: 'Dark mode', to: '/dark' }] }, + { label: 'Getting Started', links: [{ label: 'Usage', to: '/' }, { label: 'Examples', to: '/examples' }, { label: 'Migration', to: '/migration' }, { label: 'Dark mode', to: '/dark' }] }, { label: 'Elements', links: [{ label: 'Avatar', to: '/components/Avatar' }, { label: 'AvatarGroup', to: '/components/AvatarGroup' }, { label: 'Badge', to: '/components/Badge' }, { label: 'Button', to: '/components/Button' }, { label: 'Dropdown', to: '/components/Dropdown' }, { label: 'Icon', to: '/components/Icon' }, { label: 'Link', to: '/components/Link' }, { label: 'Toggle', to: '/components/Toggle' }] }, { label: 'Feedback', links: [{ label: 'Alert', to: '/components/Alert' }] }, { label: 'Forms', links: [{ label: 'Checkbox', to: '/components/Checkbox' }, { label: 'Input', to: '/components/Input' }, { label: 'InputGroup', to: '/components/InputGroup' }, { label: 'Radio', to: '/components/Radio' }, { label: 'RadioGroup', to: '/components/RadioGroup' }, { label: 'Select', to: '/components/Select' }, { label: 'SelectCustom', to: '/components/SelectCustom' }, { label: 'Textarea', to: '/components/Textarea' }] }, diff --git a/docs/pages/components/[component].vue b/docs/pages/components/[component].vue index 99c099ec..26cd7584 100644 --- a/docs/pages/components/[component].vue +++ b/docs/pages/components/[component].vue @@ -54,6 +54,8 @@