format files

This commit is contained in:
maxDorninger
2025-06-28 22:49:23 +02:00
parent a1c7b9b941
commit e44fb29852
44 changed files with 481 additions and 515 deletions

View File

@@ -1,37 +1,36 @@
<script lang="ts" module>
import {type VariantProps, tv} from "tailwind-variants";
import {type VariantProps, tv} from 'tailwind-variants';
export const badgeVariants = tv({
base: "focus:ring-ring inline-flex select-none items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2",
base: 'focus:ring-ring inline-flex select-none items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2',
variants: {
variant: {
default:
"bg-primary text-primary-foreground hover:bg-primary/80 border-transparent shadow",
default: 'bg-primary text-primary-foreground hover:bg-primary/80 border-transparent shadow',
secondary:
"bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent",
'bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent',
destructive:
"bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent shadow",
outline: "text-foreground",
},
'bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent shadow',
outline: 'text-foreground'
}
},
defaultVariants: {
variant: "default",
},
variant: 'default'
}
});
export type BadgeVariant = VariantProps<typeof badgeVariants>["variant"];
export type BadgeVariant = VariantProps<typeof badgeVariants>['variant'];
</script>
<script lang="ts">
import type {WithElementRef} from "bits-ui";
import type {HTMLAnchorAttributes} from "svelte/elements";
import {cn} from "$lib/utils.js";
import type {WithElementRef} from 'bits-ui';
import type {HTMLAnchorAttributes} from 'svelte/elements';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
href,
class: className,
variant = "default",
variant = 'default',
children,
...restProps
}: WithElementRef<HTMLAnchorAttributes> & {
@@ -40,11 +39,11 @@
</script>
<svelte:element
this={href ? 'a' : 'span'}
{...restProps}
bind:this={ref}
class={cn(badgeVariants({ variant }), className)}
{href}
this={href ? "a" : "span"}
>
{@render children?.()}
</svelte:element>

View File

@@ -1,2 +1,2 @@
export {default as Badge} from "./badge.svelte";
export {badgeVariants, type BadgeVariant} from "./badge.svelte";
export {default as Badge} from './badge.svelte';
export {badgeVariants, type BadgeVariant} from './badge.svelte';

View File

@@ -1,8 +1,8 @@
<script lang="ts">
import {Checkbox as CheckboxPrimitive, type WithoutChildrenOrChild} from 'bits-ui';
import {Checkbox as CheckboxPrimitive, type WithoutChildrenOrChild} from 'bits-ui';
import Check from '@lucide/svelte/icons/check';
import Minus from '@lucide/svelte/icons/minus';
import {cn} from '$lib/utils.js';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -14,16 +14,16 @@
</script>
<CheckboxPrimitive.Root
{...restProps}
bind:checked
bind:indeterminate
bind:ref
class={cn(
{...restProps}
bind:checked
bind:indeterminate
bind:ref
class={cn(
'peer box-content size-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[disabled=true]:cursor-not-allowed data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[disabled=true]:opacity-50',
className
)}
>
{#snippet children({checked, indeterminate})}
{#snippet children({checked, indeterminate})}
<span class="flex items-center justify-center text-current">
{#if indeterminate}
<Minus class="size-4"/>

View File

@@ -1,15 +1,15 @@
import {Menubar as MenubarPrimitive} from "bits-ui";
import Root from "./menubar.svelte";
import CheckboxItem from "./menubar-checkbox-item.svelte";
import Content from "./menubar-content.svelte";
import Item from "./menubar-item.svelte";
import GroupHeading from "./menubar-group-heading.svelte";
import RadioItem from "./menubar-radio-item.svelte";
import Separator from "./menubar-separator.svelte";
import Shortcut from "./menubar-shortcut.svelte";
import SubContent from "./menubar-sub-content.svelte";
import SubTrigger from "./menubar-sub-trigger.svelte";
import Trigger from "./menubar-trigger.svelte";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import Root from './menubar.svelte';
import CheckboxItem from './menubar-checkbox-item.svelte';
import Content from './menubar-content.svelte';
import Item from './menubar-item.svelte';
import GroupHeading from './menubar-group-heading.svelte';
import RadioItem from './menubar-radio-item.svelte';
import Separator from './menubar-separator.svelte';
import Shortcut from './menubar-shortcut.svelte';
import SubContent from './menubar-sub-content.svelte';
import SubTrigger from './menubar-sub-trigger.svelte';
import Trigger from './menubar-trigger.svelte';
const Menu = MenubarPrimitive.Menu;
const Group = MenubarPrimitive.Group;
@@ -47,5 +47,5 @@ export {
Menu as MenubarMenu,
Group as MenubarGroup,
Sub as MenubarSub,
RadioGroup as MenubarRadioGroup,
RadioGroup as MenubarRadioGroup
};

View File

@@ -1,9 +1,9 @@
<script lang="ts">
import {Menubar as MenubarPrimitive, type WithoutChildrenOrChild} from "bits-ui";
import Check from "@lucide/svelte/icons/check";
import Minus from "@lucide/svelte/icons/minus";
import {cn} from "$lib/utils.js";
import type {Snippet} from "svelte";
import {Menubar as MenubarPrimitive, type WithoutChildrenOrChild} from 'bits-ui';
import Check from '@lucide/svelte/icons/check';
import Minus from '@lucide/svelte/icons/minus';
import {cn} from '$lib/utils.js';
import type {Snippet} from 'svelte';
let {
ref = $bindable(null),
@@ -23,7 +23,7 @@
bind:indeterminate
bind:ref
class={cn(
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50',
className
)}
>
@@ -32,7 +32,7 @@
{#if indeterminate}
<Minus class="size-4"/>
{:else}
<Check class={cn("size-4", !checked && "text-transparent")}/>
<Check class={cn('size-4', !checked && 'text-transparent')}/>
{/if}
</span>
{@render childrenProp?.()}

View File

@@ -1,14 +1,14 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
class: className,
sideOffset = 8,
alignOffset = -4,
align = "start",
side = "bottom",
align = 'start',
side = 'bottom',
portalProps,
...restProps
}: MenubarPrimitive.ContentProps & {
@@ -23,7 +23,7 @@
{alignOffset}
bind:ref
class={cn(
"bg-popover text-popover-foreground z-50 min-w-[12rem] rounded-md border p-1 shadow-md focus:outline-none",
'z-50 min-w-[12rem] rounded-md border bg-popover p-1 text-popover-foreground shadow-md focus:outline-none',
className
)}
{side}

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -15,5 +15,5 @@
<MenubarPrimitive.GroupHeading
{...restProps}
bind:ref
class={cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)}
class={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}
/>

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -16,8 +16,8 @@
{...restProps}
bind:ref
class={cn(
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
inset && "pl-8",
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50',
inset && 'pl-8',
className
)}
/>

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import {Menubar as MenubarPrimitive, type WithoutChild} from "bits-ui";
import Circle from "@lucide/svelte/icons/circle";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive, type WithoutChild} from 'bits-ui';
import Circle from '@lucide/svelte/icons/circle';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -15,7 +15,7 @@
{...restProps}
bind:ref
class={cn(
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50',
className
)}
>

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -12,5 +12,5 @@
<MenubarPrimitive.Separator
{...restProps}
bind:ref
class={cn("bg-muted -mx-1 my-1 h-px", className)}
class={cn('-mx-1 my-1 h-px bg-muted', className)}
/>

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import type {HTMLAttributes} from "svelte/elements";
import type {WithElementRef} from "bits-ui";
import {cn} from "$lib/utils.js";
import type {HTMLAttributes} from 'svelte/elements';
import type {WithElementRef} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -14,7 +14,7 @@
<span
{...restProps}
bind:this={ref}
class={cn("text-muted-foreground ml-auto text-xs tracking-widest", className)}
class={cn('ml-auto text-xs tracking-widest text-muted-foreground', className)}
>
{@render children?.()}
</span>

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -13,7 +13,7 @@
{...restProps}
bind:ref
class={cn(
"bg-popover text-popover-foreground z-50 min-w-max rounded-md border p-1 shadow-lg focus:outline-none",
'z-50 min-w-max rounded-md border bg-popover p-1 text-popover-foreground shadow-lg focus:outline-none',
className
)}
/>

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import ChevronRight from "@lucide/svelte/icons/chevron-right";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import ChevronRight from '@lucide/svelte/icons/chevron-right';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -18,8 +18,8 @@
{...restProps}
bind:ref
class={cn(
"data-[highlighted]:bg-accent data-[state=open]:bg-accent data-[highlighted]:text-accent-foreground data-[state=open]:text-accent-foreground flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
inset && "pl-8",
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[state=open]:bg-accent data-[highlighted]:text-accent-foreground data-[state=open]:text-accent-foreground data-[disabled]:opacity-50',
inset && 'pl-8',
className
)}
>

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -13,7 +13,7 @@
{...restProps}
bind:ref
class={cn(
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none",
'flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
className
)}
/>

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import {Menubar as MenubarPrimitive} from "bits-ui";
import {cn} from "$lib/utils.js";
import {Menubar as MenubarPrimitive} from 'bits-ui';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -13,7 +13,7 @@
{...restProps}
bind:ref
class={cn(
"bg-background flex h-9 items-center space-x-1 rounded-md border p-1 shadow-sm",
'flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm',
className
)}
/>

View File

@@ -1,7 +1,7 @@
import Root from "./skeleton.svelte";
import Root from './skeleton.svelte';
export {
Root,
//
Root as Skeleton,
Root as Skeleton
};

View File

@@ -1,7 +1,7 @@
<script lang="ts">
import type {WithElementRef, WithoutChildren} from "bits-ui";
import type {HTMLAttributes} from "svelte/elements";
import {cn} from "$lib/utils.js";
import type {WithElementRef, WithoutChildren} from 'bits-ui';
import type {HTMLAttributes} from 'svelte/elements';
import {cn} from '$lib/utils.js';
let {
ref = $bindable(null),
@@ -12,6 +12,6 @@
<div
bind:this={ref}
class={cn("bg-primary/10 animate-pulse rounded-md", className)}
class={cn('animate-pulse rounded-md bg-primary/10', className)}
{...restProps}
></div>