From 18b13d07859b65f33ce484ebc786288d0b385e6d Mon Sep 17 00:00:00 2001 From: Maiia Diachkovskaia Date: Tue, 14 Jan 2025 17:03:04 +0900 Subject: [PATCH 1/4] feat: update button design --- .../molecules/button/vc-button.stories.ts | 3 +- .../components/molecules/button/vc-button.vue | 64 +++++++++++-------- 2 files changed, 38 insertions(+), 29 deletions(-) diff --git a/client-app/ui-kit/components/molecules/button/vc-button.stories.ts b/client-app/ui-kit/components/molecules/button/vc-button.stories.ts index 34a1d3e057..55e1ac85a7 100644 --- a/client-app/ui-kit/components/molecules/button/vc-button.stories.ts +++ b/client-app/ui-kit/components/molecules/button/vc-button.stories.ts @@ -51,13 +51,14 @@ export default { }, }, }, + onClick: { action: "VcButton click" }, }, } as Meta; const Template: StoryFn = (args) => ({ components: { VcButton }, setup: () => ({ args }), - template: 'Button text', + template: 'Button text', }); export const Basic = Template.bind({}); diff --git a/client-app/ui-kit/components/molecules/button/vc-button.vue b/client-app/ui-kit/components/molecules/button/vc-button.vue index 25d34ce65a..8083d61106 100644 --- a/client-app/ui-kit/components/molecules/button/vc-button.vue +++ b/client-app/ui-kit/components/molecules/button/vc-button.vue @@ -64,9 +64,6 @@ export interface IEmits { interface IAttributes { to?: RouteLocationRaw | null; href?: string; - style?: { - minWidth?: string; - }; } interface IProps { @@ -87,6 +84,7 @@ interface IProps { fullWidth?: boolean; noWrap?: boolean; minWidth?: string; + tag?: string; } defineEmits(); @@ -102,6 +100,8 @@ const props = withDefaults(defineProps(), { truncate: false, fullWidth: false, noWrap: false, + minWidth: "", + tag: "", }); const enabled = eagerComputed(() => !props.disabled && !props.loading); @@ -113,6 +113,10 @@ const target = computed(() => ); const componentTag = computed(() => { + if (props.tag) { + return props.tag; + } + if (isRouterLink.value) { return "router-link"; } @@ -135,19 +139,14 @@ const attrs = computed(() => { attributes.href = props.externalLink; } - if (props.minWidth) { - attributes.style = { - minWidth: props.minWidth, - }; - } - return attributes; });