Skip to content

Commit

Permalink
pkp/pkp-lib#10743 Adjust styling of badge with attentive text and mak…
Browse files Browse the repository at this point in the history
…e popover for review method icons smaller
  • Loading branch information
jardakotesovec committed Feb 14, 2025
1 parent b844836 commit 0d3beae
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/Badge/Badge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default {
'border-primary text-primary bg-secondary':
colorVariant === 'primary',
// attention-border
'border-attention text-attention bg-secondary':
'border-dark text-attention bg-secondary':
colorVariant === 'attention',
// primary-bg
'bg-primary text-on-dark border-primary':
Expand Down
26 changes: 21 additions & 5 deletions src/components/Popover/Popover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
></div>

<div
class="text-sm w-screen max-w-sm flex-auto overflow-hidden rounded bg-secondary shadow"
:class="sizeClasses"
class="text-sm flex-auto overflow-hidden rounded bg-secondary shadow"
>
<div class="p-4"><slot></slot></div>
</div>
Expand All @@ -31,11 +32,26 @@
</Popover>
</template>

<script>
<script setup>
import {computed} from 'vue';
import {PopoverButton, Popover, PopoverPanel} from '@headlessui/vue';
export default {
components: {Popover, PopoverButton, PopoverPanel},
};
const props = defineProps({
sizeVariant: {
required: false,
type: String,
default: () => 'default',
validator: (prop) => ['default', 'content'].includes(prop),
},
});
const sizeClasses = computed(() => {
if (props.sizeVariant === 'content') {
return 'max-w-sm';
}
return 'w-screen max-w-sm';
});
</script>
<style>
.tooltip-arrow {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReviewMethodIcons/ReviewMethodIcons.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<span>
<PkpPopover>
<PkpPopover size-variant="content">
<template #button>
<span class="flex gap-x-1">
<Icon
Expand Down

0 comments on commit 0d3beae

Please sign in to comment.