button-glyph.svelte (621B)
1 <script lang="ts"> 2 import { type IGlyph, fmt_cl, GLYPH_STYLE_MAP } from "@radroots/apps-lib"; 3 4 let { basis }: { basis: IGlyph } = $props(); 5 const styles = $derived( 6 basis?.dim ? GLYPH_STYLE_MAP.get(basis.dim) : GLYPH_STYLE_MAP.get(`sm`), 7 ); 8 </script> 9 10 <!-- svelte-ignore a11y_consider_explicit_label --> 11 <button 12 class={`${fmt_cl( 13 basis.classes, 14 )} flex flex-col justify-center items-center text-[${ 15 styles?.gl_1 16 }px] el-re`} 17 onclick={async () => { 18 if (basis.callback) await basis.callback(); 19 }} 20 > 21 <i class={`ph-bold ph-${basis.key}`}></i> 22 </button>