Skip to content

Commit

Permalink
Merge pull request #1474 from PrefectHQ/bugfix/pbutton-small-sizing-2…
Browse files Browse the repository at this point in the history
…024-10-17

Bugfix: PButton sizing issues
  • Loading branch information
znicholasbrown authored Oct 17, 2024
2 parents ca8bbec + 49720ce commit d912bed
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
11 changes: 8 additions & 3 deletions src/components/Button/PButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
>
<div class="p-button__content">
<template v-if="icon">
<PIcon :size="iconSize" :icon :solid class="p-button__icon" />
<PIcon :size="iconSize ?? size" :icon :solid class="p-button__icon" />
</template>
<slot />
<template v-if="iconAppend">
<PIcon :size="iconSize" :icon="iconAppend" :solid="solidAppend ?? solid" class="p-button__icon" />
<PIcon :size="iconSize ?? size" :icon="iconAppend" :solid="solidAppend ?? solid" class="p-button__icon" />
</template>
</div>
<template v-if="loading">
Expand Down Expand Up @@ -56,7 +56,7 @@
{
size: 'sm',
icon: true,
class: 'max-h-7 max-w-7',
class: 'max-h-[30px] max-w-[30px]',
},
],
defaultVariants: {
Expand Down Expand Up @@ -234,6 +234,11 @@
font-normal
}
.p-button__icon { @apply
shrink-0
grow
}
.p-button__loading-icon {
position: absolute;
left: 50%;
Expand Down
4 changes: 3 additions & 1 deletion src/components/Icon/PIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
const props = defineProps<{
icon: Icon,
solid?: boolean,
size?: 'small' | 'default' | 'large',
size?: 'small' | 'default' | 'large' | 'sm' | 'lg',
}>()
const component = computed(() => {
Expand Down Expand Up @@ -46,11 +46,13 @@
h-5
}
.p-icon--sm,
.p-icon--small { @apply
w-4
h-4
}
.p-icon--lg,
.p-icon--large { @apply
w-6
h-6
Expand Down
3 changes: 1 addition & 2 deletions src/components/Select/PSelectButton.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<PBaseInput ref="wrapperElement" class="p-select-button" :small="props.small">
<PBaseInput ref="wrapperElement" class="p-select-button" :small>
<template v-for="(index, name) in $slots" #[name]="data">
<slot :name="name" v-bind="data" />
</template>
Expand All @@ -8,7 +8,6 @@
ref="buttonElement"
type="button"
class="p-select-button__control"
aria-hidden="true"
v-bind="attrs"
>
<span class="p-select-button__value" :class="classes.value">
Expand Down

0 comments on commit d912bed

Please sign in to comment.