|
1 | 1 | <script lang="ts"> |
| 2 | + import clsx from "clsx"; |
2 | 3 | import { clickOutside } from "../directives/clickOutside"; |
3 | 4 | import { createEventDispatcher } from "svelte"; |
4 | 5 |
|
5 | | - export let isActive: boolean = false; |
6 | 6 | export let isPopupOpen: boolean = false; |
7 | 7 | export let extraClasses = ""; |
8 | | - export let isSquareVariant: boolean = false; |
| 8 | + export let isSquareVariant: boolean = true; |
9 | 9 | export let isTextVariant: boolean = false; |
10 | 10 | export let showPopupUnder: boolean = false; |
11 | 11 | export let rightAlignPopup: boolean = false; |
12 | 12 |
|
13 | 13 | const dispatch = createEventDispatcher(); |
14 | 14 | </script> |
15 | 15 |
|
16 | | -<div class="relative action_button {isSquareVariant ? 'h-full' : ''}"> |
| 16 | +<div class="relative action_button h-full group"> |
17 | 17 | {#if isPopupOpen} |
18 | 18 | <div |
19 | | - class="w-[256px] absolute bg-white dark:bg-transparent {showPopupUnder |
| 19 | + class="w-64 z-20 absolute bg-white dark:bg-transparent {showPopupUnder |
20 | 20 | ? 'top-8' |
21 | 21 | : 'bottom-20'} {rightAlignPopup |
22 | 22 | ? '-right-2' |
23 | | - : '-left-2'} rounded shadow-xl action_button_popup z-10" |
| 23 | + : '-left-2'} rounded shadow-xl action_button_popup z-30" |
24 | 24 | use:clickOutside |
25 | 25 | on:outclick={() => dispatch("popupDismiss")} |
26 | 26 | > |
|
29 | 29 | {/if} |
30 | 30 |
|
31 | 31 | <button |
32 | | - class="w-full green hover:text-fmd-black flex items-center p-1.5 transition transition-all duration-150 dark:text-fmd-white dark:hover:text-fmd-white dark:border-fmd-blue dark:hover:bg-fmd-blue {extraClasses} {isSquareVariant |
33 | | - ? 'h-full rounded' |
34 | | - : 'rounded-full aspect-square'} |
35 | | - {isTextVariant |
36 | | - ? 'text-black hover:bg-fmd-yellow justify-start' |
37 | | - : 'text-fmd-gray_darker border border-fmd-gray_darker hover:bg-fmd-yellow justify-center'}" |
| 32 | + class={clsx( |
| 33 | + "w-full flex items-center p-1.5 dark:border-fmd-white/20 dark:hover:bg-fmd-white-background", |
| 34 | + "hover:text-fmd-red dark:text-fmd-white dark:hover:text-fmd-white dark:hover:border-fmd-white", |
| 35 | + "transition transition-all duration-100", |
| 36 | + extraClasses, |
| 37 | + isSquareVariant ? "h-full rounded" : "rounded-full aspect-square", |
| 38 | + isTextVariant |
| 39 | + ? "text-black hover:bg-fmd-white-background justify-start dark:hover:underline" |
| 40 | + : "text-fmd-gray-600 border border-fmd-gray hover:bg-fmd-red-background justify-center" |
| 41 | + )} |
38 | 42 | on:click |
39 | 43 | > |
40 | 44 | <slot /> |
41 | 45 | </button> |
42 | 46 |
|
43 | | - {#if isActive}<div |
44 | | - class="w-1.5 h-1.5 bg-fmd-red rounded-full absolute left-0 right-0 m-auto -bottom-3" |
45 | | - />{/if} |
46 | 47 | </div> |
0 commit comments