* feat: remove tinymce & replace org sidebar * chore: PR Fixes * chore: move ui font into src dir * remove files in vite config * use google font import for loading font * remove custom font * more fonts update * remove font bold * more removals of font bold * fix import * checkpoint * chore: checkpoint (add course & lms shadcn sidebar) * minor css improvements and try out font sans * chore: replace carbon components with shadcn's * chore: replace carbon components with shadcn _ v3 * chore: ui fixes & storybook update * feat: UI cleanup * fix: quick ui fixes * chore: update pnpm-lock.yaml with new dependencies and versions; fix output.css formatting * chore: add isloading to button * feat: add loading state to button stories * chore: feedback fixes * fix: feedback fixes * chore: remove console * fix: PR comments * fix: PR comments --------- Co-authored-by: Rotimi Best <[email protected]>
37 lines
1.2 KiB
Svelte
37 lines
1.2 KiB
Svelte
<script lang="ts">
|
|
import { cn, type WithElementRef } from '../../tools';
|
|
import type { Snippet } from 'svelte';
|
|
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
|
|
let {
|
|
ref = $bindable(null),
|
|
class: className,
|
|
children,
|
|
child,
|
|
...restProps
|
|
}: WithElementRef<HTMLButtonAttributes> & {
|
|
child?: Snippet<[{ props: Record<string, unknown> }]>;
|
|
} = $props();
|
|
|
|
const mergedProps = $derived({
|
|
class: cn(
|
|
'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground outline-hidden absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
|
|
// Increases the hit area of the button on mobile.
|
|
'after:absolute after:-inset-2 md:after:hidden',
|
|
'group-data-[collapsible=icon]:hidden',
|
|
className
|
|
),
|
|
'data-slot': 'sidebar-group-action',
|
|
'data-sidebar': 'group-action',
|
|
...restProps
|
|
});
|
|
</script>
|
|
|
|
{#if child}
|
|
{@render child({ props: mergedProps })}
|
|
{:else}
|
|
<button bind:this={ref} {...mergedProps}>
|
|
{@render children?.()}
|
|
</button>
|
|
{/if}
|