Skip to content

Commit

Permalink
pkp/pkp-lib#10447 Adjust button size in ButtonIcon component (pkp#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
blesildaramirez authored Sep 26, 2024
1 parent 1bdd39c commit 3ef7800
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
26 changes: 26 additions & 0 deletions src/components/ButtonIcon/ButtonIcon.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,29 @@ export const Active = {
isActive: true,
},
};

export const Order = {
render: (args) => ({
components: {ButtonIcon},
setup() {
return {args};
},
template: `
<div class="flex inline-flex items-center items-justify gap-2">
<ButtonIcon v-for="icon in args.icons" v-bind="icon" />
</div>
`,
}),
args: {
icons: [
{
icon: 'ChevronUp',
ariaLabel: 'Move up',
},
{
icon: 'ChevronDown',
ariaLabel: 'Move down',
},
],
},
};
6 changes: 3 additions & 3 deletions src/components/ButtonIcon/ButtonIcon.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<button :class="styles" :aria-label="ariaLabel" :disabled="isDisabled">
<Icon class="h-5 w-5" :icon="icon" aria-hidden="true" />
<Icon class="h-6 w-6" :icon="icon" aria-hidden="true" />
</button>
</template>

Expand Down Expand Up @@ -33,9 +33,9 @@ const props = defineProps({
const styles = computed(() => ({
// Base
'inline-flex relative items-center justify-center text-lg-semibold rounded w-9 h-9': true,
'inline-flex relative items-center justify-center text-lg-semibold rounded w-6 h-6': true,
// Default
'text-primary bg-secondary': !props.isActive,
'text-primary': !props.isActive,
// Hover
'hover:text-on-dark hover:bg-hover': !props.isDisabled,
// Active
Expand Down

0 comments on commit 3ef7800

Please sign in to comment.