From ba8df900e3092d5a57c52613f302c9507c7e96ae Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Thu, 6 Nov 2025 16:24:05 +0530 Subject: [PATCH] feat: Enhance button interactions (#12738) --- .../Conversation/SidepanelSwitch.vue | 20 ++++---- .../ArticleEditorPage/ArticleEditorHeader.vue | 7 ++- .../components-next/button/Button.vue | 16 ++++++- .../buttonGroup/ButtonGroup.vue | 20 ++++++++ .../components-next/combobox/ComboBox.vue | 1 + .../copilot/CopilotLauncher.vue | 10 ++-- .../sidebar/MobileSidebarLauncher.vue | 10 ++-- .../components-next/tabbar/TabBar.vue | 48 +++++++++++++++++-- .../components/buttons/ResolveAction.vue | 9 +++- .../widgets/WootWriter/EditorModeToggle.vue | 2 +- 10 files changed, 117 insertions(+), 26 deletions(-) create mode 100644 app/javascript/dashboard/components-next/buttonGroup/ButtonGroup.vue diff --git a/app/javascript/dashboard/components-next/Conversation/SidepanelSwitch.vue b/app/javascript/dashboard/components-next/Conversation/SidepanelSwitch.vue index 1ee969275..5e96df3c6 100644 --- a/app/javascript/dashboard/components-next/Conversation/SidepanelSwitch.vue +++ b/app/javascript/dashboard/components-next/Conversation/SidepanelSwitch.vue @@ -1,5 +1,6 @@ diff --git a/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditorHeader.vue b/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditorHeader.vue index 2d8b219f7..bec54593f 100644 --- a/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditorHeader.vue +++ b/app/javascript/dashboard/components-next/HelpCenter/Pages/ArticleEditorPage/ArticleEditorHeader.vue @@ -14,6 +14,7 @@ import { } from 'dashboard/helper/portalHelper'; import wootConstants from 'dashboard/constants/globals'; +import ButtonGroup from 'dashboard/components-next/buttonGroup/ButtonGroup.vue'; import Button from 'dashboard/components-next/button/Button.vue'; import DropdownMenu from 'dashboard/components-next/dropdown-menu/DropdownMenu.vue'; @@ -140,11 +141,12 @@ const updateArticleStatus = async ({ value }) => { :disabled="!articleId" @click="previewArticle" /> -
+
- + diff --git a/app/javascript/dashboard/components-next/button/Button.vue b/app/javascript/dashboard/components-next/button/Button.vue index dde1d3d9a..1dfe488e9 100644 --- a/app/javascript/dashboard/components-next/button/Button.vue +++ b/app/javascript/dashboard/components-next/button/Button.vue @@ -36,6 +36,7 @@ const props = defineProps({ icon: { type: [String, Object, Function], default: '' }, trailingIcon: { type: Boolean, default: false }, isLoading: { type: Boolean, default: false }, + noAnimation: { type: Boolean, default: false }, }); const slots = useSlots(); @@ -179,12 +180,18 @@ const STYLE_CONFIG = { md: 'text-sm font-medium', lg: 'text-base', }, + clickAnimation: { + xs: 'active:enabled:scale-[0.97]', + sm: 'active:enabled:scale-[0.97]', + md: 'active:enabled:scale-[0.98]', + lg: 'active:enabled:scale-[0.98]', + }, justify: { start: 'justify-start', center: 'justify-center', end: 'justify-end', }, - base: 'inline-flex items-center min-w-0 gap-2 transition-all duration-200 ease-in-out border-0 rounded-lg outline-1 outline disabled:opacity-50', + base: 'inline-flex items-center min-w-0 gap-2 transition-all duration-100 ease-out border-0 rounded-lg outline-1 outline disabled:opacity-50', }; const variantClasses = computed(() => { @@ -221,6 +228,12 @@ const linkButtonClasses = computed(() => { return classes.join(' '); }); + +const animationClasses = computed(() => { + return props.noAnimation + ? '' + : STYLE_CONFIG.clickAnimation[computedSize.value]; +});