From 34d2f57801d08d26262fdff4398ec3d3329b4bb0 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Wed, 20 Sep 2023 18:07:51 +0200 Subject: [PATCH] feat(module)!: use `tailwind-merge` for `app.config` & move config to components & type props (#692) Co-authored-by: Pooya Parsa --- .github/workflows/ci-dev.yml | 6 +- .github/workflows/ci.yml | 6 +- .nuxtrc | 3 + docs/.nuxtrc | 1 + docs/components/Footer.vue | 12 +- docs/components/Header.vue | 2 +- .../VerticalNavigationExampleAvatarSlot.vue | 6 +- docs/content/1.getting-started/3.theming.md | 48 +++++-- .../5.navigation/1.vertical-navigation.md | 6 +- docs/nuxt.config.ts | 4 - docs/package.json | 2 +- package.json | 13 +- pnpm-lock.yaml | 20 +-- src/module.ts | 39 +++--- src/runtime/components/data/Table.vue | 46 +++---- src/runtime/components/elements/Accordion.vue | 38 +++--- src/runtime/components/elements/Alert.vue | 46 +++---- src/runtime/components/elements/Avatar.vue | 46 +++---- .../components/elements/AvatarGroup.ts | 35 +++-- src/runtime/components/elements/Badge.vue | 46 ++++--- src/runtime/components/elements/Button.vue | 47 ++++--- .../components/elements/ButtonGroup.ts | 42 +++--- src/runtime/components/elements/Dropdown.vue | 31 ++--- src/runtime/components/elements/Kbd.vue | 31 ++--- src/runtime/components/forms/Checkbox.vue | 33 ++--- src/runtime/components/forms/FormGroup.vue | 42 +++--- src/runtime/components/forms/Input.vue | 58 ++++----- src/runtime/components/forms/Radio.vue | 33 ++--- src/runtime/components/forms/Range.vue | 43 ++++--- src/runtime/components/forms/Select.vue | 61 ++++----- src/runtime/components/forms/SelectMenu.vue | 72 +++++------ src/runtime/components/forms/Textarea.vue | 62 +++++---- src/runtime/components/forms/Toggle.vue | 41 +++--- src/runtime/components/layout/Card.vue | 25 ++-- src/runtime/components/layout/Container.vue | 25 ++-- src/runtime/components/layout/Skeleton.vue | 25 ++-- .../components/navigation/CommandPalette.vue | 44 +++---- .../navigation/CommandPaletteGroup.vue | 12 +- .../components/navigation/Pagination.vue | 46 +++---- src/runtime/components/navigation/Tabs.vue | 32 ++--- .../navigation/VerticalNavigation.vue | 32 ++--- .../components/overlays/ContextMenu.vue | 26 ++-- src/runtime/components/overlays/Modal.vue | 29 ++--- .../components/overlays/Notification.vue | 36 +++--- .../components/overlays/Notifications.vue | 27 ++-- src/runtime/components/overlays/Popover.vue | 30 ++--- src/runtime/components/overlays/Slideover.vue | 29 ++--- src/runtime/components/overlays/Tooltip.vue | 30 ++--- src/runtime/composables/useUI.ts | 24 ++++ src/runtime/types/avatar.d.ts | 14 +- src/runtime/types/button.d.ts | 13 +- src/runtime/types/form.d.ts | 2 +- src/runtime/types/index.d.ts | 1 + src/runtime/types/notification.d.ts | 8 +- src/runtime/types/utils.d.ts | 11 ++ src/runtime/{app.config.ts => ui.config.ts} | 120 +++++++----------- src/runtime/utils/index.ts | 31 ++++- src/templates.ts | 21 +++ tsconfig.json | 3 +- 59 files changed, 835 insertions(+), 882 deletions(-) create mode 100644 .nuxtrc create mode 100644 docs/.nuxtrc create mode 100644 src/runtime/composables/useUI.ts create mode 100644 src/runtime/types/utils.d.ts rename src/runtime/{app.config.ts => ui.config.ts} (96%) create mode 100644 src/templates.ts diff --git a/.github/workflows/ci-dev.yml b/.github/workflows/ci-dev.yml index d3884791..29f70cda 100644 --- a/.github/workflows/ci-dev.yml +++ b/.github/workflows/ci-dev.yml @@ -52,12 +52,12 @@ jobs: - name: Lint run: pnpm run lint - - name: Build - run: pnpm run build - - name: Typecheck run: pnpm run typecheck + - name: Build + run: pnpm run build + - name: Release Edge if: github.event_name == 'push' run: ./scripts/release-edge.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2724ddc..8c1cd78d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,12 +52,12 @@ jobs: - name: Lint run: pnpm run lint - - name: Build - run: pnpm run build - - name: Typecheck run: pnpm run typecheck + - name: Build + run: pnpm run build + - name: Version Check id: check uses: EndBug/version-check@v2 diff --git a/.nuxtrc b/.nuxtrc new file mode 100644 index 00000000..87857b2a --- /dev/null +++ b/.nuxtrc @@ -0,0 +1,3 @@ +imports.autoImport=false +typescript.includeWorkspace=true +typescript.strict=false diff --git a/docs/.nuxtrc b/docs/.nuxtrc new file mode 100644 index 00000000..109361b8 --- /dev/null +++ b/docs/.nuxtrc @@ -0,0 +1 @@ +imports.autoImport=true diff --git a/docs/components/Footer.vue b/docs/components/Footer.vue index 3a19b92d..d899d5df 100644 --- a/docs/components/Footer.vue +++ b/docs/components/Footer.vue @@ -24,10 +24,14 @@ + + diff --git a/docs/components/Header.vue b/docs/components/Header.vue index ed1369a5..708e816e 100644 --- a/docs/components/Header.vue +++ b/docs/components/Header.vue @@ -27,7 +27,7 @@ icon="i-simple-icons-github" aria-label="GitHub" class="hidden lg:inline-flex" - v-bind="$elements.button.secondary" + v-bind="($elements.button.secondary as any)" /> diff --git a/docs/components/content/examples/VerticalNavigationExampleAvatarSlot.vue b/docs/components/content/examples/VerticalNavigationExampleAvatarSlot.vue index 32f4585e..02ded2cf 100644 --- a/docs/components/content/examples/VerticalNavigationExampleAvatarSlot.vue +++ b/docs/components/content/examples/VerticalNavigationExampleAvatarSlot.vue @@ -27,8 +27,6 @@ const links = [{ to: 'https://github.com/smarroufin', target: '_blank' }] - -const { ui } = useAppConfig()