11<script lang =" ts" >
22import type { IconDefinition } from ' @fortawesome/fontawesome-common-types' ;
3- import DropdownMenuItem from ' ./DropDownMenuItem.svelte' ;
43import Fa from ' svelte-fa' ;
54import { onMount } from ' svelte' ;
65
@@ -10,7 +9,6 @@ export let fontAwesomeIcon: IconDefinition | undefined = undefined;
109export let hidden = false ;
1110export let enabled: boolean = true ;
1211export let onClick: () => void = () => {};
13- export let menu = false ;
1412export let detailed = false ;
1513export let inProgress = false ;
1614export let iconOffset = ' ' ;
@@ -27,13 +25,13 @@ onMount(() => {
2725});
2826
2927const buttonDetailedClass =
30- ' text-gray-400 bg-charcoal-800 hover:text-violet-600 font-medium rounded-lg text-sm inline-flex items-center px-3 py-2 text-center' ;
28+ ' text-[var(--pd-action-button-details-text)] bg-[var(--pd-action-button-details-bg)] hover:text-[var(--pd-action-button-details-hover-text)] font-medium rounded-lg text-sm inline-flex items-center px-3 py-2 text-center' ;
3129const buttonDetailedDisabledClass =
32- ' text-gray-900 bg-charcoal-800 font-medium rounded-lg text-sm inline-flex items-center px-3 py-2 text-center' ;
30+ ' text-[var(--pd-action-button-details-disabled-text)] bg-[var(--pd-action-button-details-disabled-bg)] font-medium rounded-lg text-sm inline-flex items-center px-3 py-2 text-center' ;
3331const buttonClass =
34- ' m-0.5 text-gray-400 hover:bg-charcoal-600 hover:text-violet-600 font-medium rounded-full inline-flex items-center px-2 py-2 text-center' ;
32+ ' text-[var(--pd-action-button-text)] hover:bg-[var(--pd-action-button-hover-bg)] hover:text-[var(--pd-action-button-hover-text)] font-medium rounded-full inline-flex items-center px-2 py-2 text-center' ;
3533const buttonDisabledClass =
36- ' m-0.5 text-gray-900 font-medium rounded-full inline-flex items-center px-2 py-2 text-center' ;
34+ ' text-[var(--pd-action-button-disabled-text)] font-medium rounded-full inline-flex items-center px-2 py-2 text-center' ;
3735
3836$ : styleClass = detailed
3937 ? enabled && ! inProgress
@@ -45,27 +43,22 @@ $: styleClass = detailed
4543 </script >
4644
4745<!-- If menu = true, use the menu, otherwise implement the button -->
48- {#if menu }
49- <!-- enabled menu -->
50- <DropdownMenuItem title ={title } icon ={icon } enabled ={enabled } hidden ={hidden } onClick ={onClick } />
51- {:else }
52- <!-- enabled button -->
53- <button
54- title ={title }
55- aria-label ={title }
56- on:click ={onClick }
57- class =" {styleClass } relative"
58- class:disabled ={inProgress }
59- class:hidden ={hidden }
60- disabled ={! enabled }>
61- {#if fontAwesomeIcon }
62- <Fa class ="h-4 w-4 {iconOffset }" icon ={fontAwesomeIcon } />
63- {/if }
46+ <!-- enabled button -->
47+ <button
48+ title ={title }
49+ aria-label ={title }
50+ on:click ={onClick }
51+ class =" {styleClass } relative"
52+ class:disabled ={inProgress }
53+ class:hidden ={hidden }
54+ disabled ={! enabled }>
55+ {#if fontAwesomeIcon }
56+ <Fa class ="h-4 w-4 {iconOffset }" icon ={fontAwesomeIcon } />
57+ {/if }
6458
65- <div
66- aria-label =" spinner"
67- class ="w-6 h-6 rounded-full animate-spin border border-solid border-violet-500 border-t-transparent absolute {positionTopClass } {positionLeftClass }"
68- class:hidden ={! inProgress }>
69- </div >
70- </button >
71- {/if }
59+ <div
60+ aria-label =" spinner"
61+ class ="w-6 h-6 rounded-full animate-spin border border-solid border-[var(--pd-action-button-spinner)] border-t-transparent absolute {positionTopClass } {positionLeftClass }"
62+ class:hidden ={! inProgress }>
63+ </div >
64+ </button >
0 commit comments