style: use spaces and no semicolons in JS

This commit is contained in:
Youwen Wu 2024-05-05 10:59:14 -07:00
parent 56c82574ec
commit 5e1af688ea
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
121 changed files with 3603 additions and 3603 deletions

View file

@ -28,4 +28,4 @@ module.exports = {
} }
} }
] ]
}; }

View file

@ -1,7 +1,8 @@
overrides = [{ "files" = "*.svelte", "options" = { "parser" = "svelte" } }] overrides = [{ "files" = "*.svelte", "options" = { "parser" = "svelte" } }]
useTabs = true useTabs = false
singleQuote = true singleQuote = true
trailingComma = "none" trailingComma = "none"
printWidth = 100 printWidth = 100
proseWrap = "always" proseWrap = "always"
plugins = ["prettier-plugin-svelte"] plugins = ["prettier-plugin-svelte"]
semi = false

View file

@ -1,4 +1,4 @@
import type { PlaywrightTestConfig } from '@playwright/test'; import type { PlaywrightTestConfig } from '@playwright/test'
const config: PlaywrightTestConfig = { const config: PlaywrightTestConfig = {
webServer: { webServer: {
@ -7,6 +7,6 @@ const config: PlaywrightTestConfig = {
}, },
testDir: 'tests', testDir: 'tests',
testMatch: /(.+\.)?(test|spec)\.[jt]s/ testMatch: /(.+\.)?(test|spec)\.[jt]s/
}; }
export default config; export default config

View file

@ -3,4 +3,4 @@ export default {
tailwindcss: {}, tailwindcss: {},
autoprefixer: {} autoprefixer: {}
} }
}; }

2
src/app.d.ts vendored
View file

@ -10,4 +10,4 @@ declare global {
} }
} }
export {}; export {}

52
src/globals.d.ts vendored
View file

@ -1,35 +1,35 @@
interface BlogDocument { interface BlogDocument {
date: Date; date: Date
title: string; title: string
content: string; content: string
primaryTags: string[]; primaryTags: string[]
secondaryTags: string[]; secondaryTags: string[]
blurb: string; blurb: string
image: { src: string; alt: string; caption: string }; image: { src: string; alt: string; caption: string }
description: string; description: string
slug: string; slug: string
} }
declare module 'remark-sectionize'; declare module 'remark-sectionize'
type PostMeta = { type PostMeta = {
title: string; title: string
manifest: { manifest: {
authors: string[]; authors: string[]
date: Date; date: Date
tags: { primary: string[]; secondary: string[] }; tags: { primary: string[]; secondary: string[] }
blurb: string; blurb: string
description: string; description: string
highlight: boolean; highlight: boolean
}; }
cover: { cover: {
src: string; src: string
alt: string; alt: string
caption: string; caption: string
}; }
deps?: { deps?: {
external?: { external?: {
styles?: string[]; styles?: string[]
}; }
}; }
}; }

View file

@ -1,10 +1,10 @@
<script lang="ts"> <script lang="ts">
import { fly } from 'svelte/transition'; import { fly } from 'svelte/transition'
export let height = '192'; export let height = '192'
export let width = 'auto'; export let width = 'auto'
export let href: string = '/blog'; export let href: string = '/blog'
export let transition: 'vertical' | 'horizontal' = 'horizontal'; export let transition: 'vertical' | 'horizontal' = 'horizontal'
</script> </script>
<svg <svg

View file

@ -1,9 +1,9 @@
<script lang="ts"> <script lang="ts">
import { fly } from 'svelte/transition'; import { fly } from 'svelte/transition'
export let height = '192'; export let height = '192'
export let width = 'auto'; export let width = 'auto'
export let href: string; export let href: string
</script> </script>
<svg <svg

View file

@ -1,22 +1,22 @@
<script> <script>
import { onMount } from 'svelte'; import { onMount } from 'svelte'
import { fly } from 'svelte/transition'; import { fly } from 'svelte/transition'
import Button from './ui/button/button.svelte'; import Button from './ui/button/button.svelte'
import { ChevronUp } from 'svelte-radix'; import { ChevronUp } from 'svelte-radix'
let showButton = false; let showButton = false
function handleScroll() { function handleScroll() {
const threshold = 400; const threshold = 400
showButton = window.scrollY > threshold; showButton = window.scrollY > threshold
} }
function scrollToTop() { function scrollToTop() {
window.scrollTo({ window.scrollTo({
top: 0, top: 0,
behavior: 'smooth' behavior: 'smooth'
}); })
} }
</script> </script>

View file

@ -1,9 +1,9 @@
<script lang="ts"> <script lang="ts">
import ChevronRight from 'svelte-radix/ChevronRight.svelte'; import ChevronRight from 'svelte-radix/ChevronRight.svelte'
import * as Card from '$lib/components/ui/card'; import * as Card from '$lib/components/ui/card'
import Separator from '$lib/components/ui/separator/separator.svelte'; import Separator from '$lib/components/ui/separator/separator.svelte'
export let archived: Object | undefined = undefined; export let archived: Object | undefined = undefined
</script> </script>
<!-- <!--

View file

@ -1,8 +1,8 @@
<script lang="ts"> <script lang="ts">
import PostMetadata from './PostMetadata.svelte'; import PostMetadata from './PostMetadata.svelte'
import Crumbs from './Crumbs.svelte'; import Crumbs from './Crumbs.svelte'
export let doc: BlogDocument; export let doc: BlogDocument
</script> </script>
<article> <article>

View file

@ -1,10 +1,10 @@
<script lang="ts"> <script lang="ts">
import * as Breadcrumb from '../ui/breadcrumb'; import * as Breadcrumb from '../ui/breadcrumb'
export let slug: string; export let slug: string
export let title: string; export let title: string
$: trail = slug.split('/').slice(0, slug.split('/').length - 1); $: trail = slug.split('/').slice(0, slug.split('/').length - 1)
</script> </script>
<Breadcrumb.Root class="mb-4"> <Breadcrumb.Root class="mb-4">

View file

@ -1,13 +1,13 @@
<script lang="ts"> <script lang="ts">
import * as Card from '$lib/components/ui/card'; import * as Card from '$lib/components/ui/card'
import Button from '../ui/button/button.svelte'; import Button from '../ui/button/button.svelte'
import PostMetadata from './PostMetadata.svelte'; import PostMetadata from './PostMetadata.svelte'
export let doc: { export let doc: {
metadata: PostMeta; metadata: PostMeta
content: string; content: string
slug: string; slug: string
}; }
</script> </script>
<Card.Root> <Card.Root>

View file

@ -17,19 +17,19 @@
--> -->
<script lang="ts"> <script lang="ts">
import Badge from '../ui/badge/badge.svelte'; import Badge from '../ui/badge/badge.svelte'
import dayjs from 'dayjs'; import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'; import relativeTime from 'dayjs/plugin/relativeTime'
dayjs.extend(relativeTime); dayjs.extend(relativeTime)
export let primaryTags: string[] = []; export let primaryTags: string[] = []
export let secondaryTags: string[] = []; export let secondaryTags: string[] = []
export let date: Date; export let date: Date
export let length: number; export let length: number
export let reverseDateAndRest: boolean = false; export let reverseDateAndRest: boolean = false
let dayjsDate = dayjs(date); let dayjsDate = dayjs(date)
</script> </script>
<div class="grid grid-cols-1"> <div class="grid grid-cols-1">

View file

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import Separator from './ui/separator/separator.svelte'; import Separator from './ui/separator/separator.svelte'
import Socials from './Socials.svelte'; import Socials from './Socials.svelte'
</script> </script>
<footer class="h-24 px-4 mb-12 text-sm md:text-md xl:text-lg"> <footer class="h-24 px-4 mb-12 text-sm md:text-md xl:text-lg">

View file

@ -1,5 +1,5 @@
<script> <script>
import { fly } from 'svelte/transition'; import { fly } from 'svelte/transition'
</script> </script>
<div class="w-full fixed top-0 left-0 z-50" transition:fly={{ duration: 200, y: -6 }}> <div class="w-full fixed top-0 left-0 z-50" transition:fly={{ duration: 200, y: -6 }}>

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import Name from '$lib/assets/Name.svelte'; import Name from '$lib/assets/Name.svelte'
import { HamburgerMenu } from 'svelte-radix'; import { HamburgerMenu } from 'svelte-radix'
import { Drawer } from 'vaul-svelte'; import { Drawer } from 'vaul-svelte'
import Separator from '../ui/separator/separator.svelte'; import Separator from '../ui/separator/separator.svelte'
import Button from '../ui/button/button.svelte'; import Button from '../ui/button/button.svelte'
import { Sun, Moon, Home, Person, File, Backpack } from 'svelte-radix'; import { Sun, Moon, Home, Person, File, Backpack } from 'svelte-radix'
import ThemePicker from '../ThemePicker.svelte'; import ThemePicker from '../ThemePicker.svelte'
</script> </script>
<Drawer.Root direction="top"> <Drawer.Root direction="top">

View file

@ -1,29 +1,29 @@
<script lang="ts"> <script lang="ts">
import Name from '$lib/assets/Name.svelte'; import Name from '$lib/assets/Name.svelte'
import { onMount } from 'svelte'; import { onMount } from 'svelte'
import { navigating } from '$app/stores'; import { navigating } from '$app/stores'
import Coredump from '$lib/assets/Coredump.svelte'; import Coredump from '$lib/assets/Coredump.svelte'
import Separator from '../ui/separator/separator.svelte'; import Separator from '../ui/separator/separator.svelte'
import Drawer from './Drawer.svelte'; import Drawer from './Drawer.svelte'
import ThemePicker from '../ThemePicker.svelte'; import ThemePicker from '../ThemePicker.svelte'
import Button from '../ui/button/button.svelte'; import Button from '../ui/button/button.svelte'
import { Moon, Sun } from 'svelte-radix'; import { Moon, Sun } from 'svelte-radix'
let current: 'blog' | 'about' | 'home' | 'portfolio' | string; let current: 'blog' | 'about' | 'home' | 'portfolio' | string
const updateCurrent = () => { const updateCurrent = () => {
const path = window.location.pathname; const path = window.location.pathname
if (path === '/') { if (path === '/') {
current = 'home'; current = 'home'
} else { } else {
const segments = path.split('/'); const segments = path.split('/')
current = segments[1] || 'home'; current = segments[1] || 'home'
}
} }
};
onMount(() => { onMount(() => {
return navigating.subscribe(updateCurrent); return navigating.subscribe(updateCurrent)
}); })
</script> </script>
<nav <nav

View file

@ -7,23 +7,23 @@
DiscordLogo, DiscordLogo,
EnvelopeClosed, EnvelopeClosed,
ClipboardCopy ClipboardCopy
} from 'svelte-radix'; } from 'svelte-radix'
import * as Popover from '$lib/components/ui/popover'; import * as Popover from '$lib/components/ui/popover'
export let center = false; export let center = false
import Button from './ui/button/button.svelte'; import Button from './ui/button/button.svelte'
import { toast } from 'svelte-sonner'; import { toast } from 'svelte-sonner'
const copyDiscord = async () => { const copyDiscord = async () => {
try { try {
await navigator.clipboard.writeText('couscousdude'); await navigator.clipboard.writeText('couscousdude')
toast('Copied Discord username to clipboard'); toast('Copied Discord username to clipboard')
} catch (e) { } catch (e) {
console.error(e); console.error(e)
toast('Failed to copy Discord username to clipboard'); toast('Failed to copy Discord username to clipboard')
}
} }
};
</script> </script>
<div class="flex gap-2 mt-2 flex-wrap" class:justify-center={center}> <div class="flex gap-2 mt-2 flex-wrap" class:justify-center={center}>

View file

@ -1,23 +1,23 @@
<script lang="ts"> <script lang="ts">
import { onMount } from 'svelte'; import { onMount } from 'svelte'
import { fly } from 'svelte/transition'; import { fly } from 'svelte/transition'
export let items: string[]; export let items: string[]
export let interval: number = 2000; export let interval: number = 2000
export let beforeText: string = ''; export let beforeText: string = ''
let currentIndex: number = 0; let currentIndex: number = 0
let timer: number; let timer: number
let temp = true; let temp = true
onMount(() => { onMount(() => {
timer = setInterval(() => { timer = setInterval(() => {
currentIndex = (currentIndex + 1) % items.length; currentIndex = (currentIndex + 1) % items.length
temp = !temp; temp = !temp
}, interval); }, interval)
return () => clearInterval(timer); return () => clearInterval(timer)
}); })
</script> </script>
<div class="flex gap-2 text-nowrap flex-wrap"> <div class="flex gap-2 text-nowrap flex-wrap">

View file

@ -10,21 +10,21 @@
--> -->
<script lang="ts"> <script lang="ts">
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js'; import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js'
import { setMode } from 'mode-watcher'; import { setMode } from 'mode-watcher'
export let hideLabel: boolean = false; export let hideLabel: boolean = false
export let wide: boolean = false; export let wide: boolean = false
let modes = [ let modes = [
{ value: 'light', label: 'Light' }, { value: 'light', label: 'Light' },
{ value: 'dark', label: 'Dark' }, { value: 'dark', label: 'Dark' },
{ value: 'system', label: 'System' } { value: 'system', label: 'System' }
]; ]
const changeMode = (mode: string) => { const changeMode = (mode: string) => {
setMode(mode as 'light' | 'dark' | 'system'); setMode(mode as 'light' | 'dark' | 'system')
}; }
</script> </script>
<DropdownMenu.Root> <DropdownMenu.Root>

View file

@ -1,15 +1,15 @@
<script lang="ts"> <script lang="ts">
import { toclink, type TocStore } from '@svelte-put/toc'; import { toclink, type TocStore } from '@svelte-put/toc'
import * as Accordion from '$lib/components/ui/accordion'; import * as Accordion from '$lib/components/ui/accordion'
import * as Card from '$lib/components/ui/card'; import * as Card from '$lib/components/ui/card'
export let tocStore: TocStore; export let tocStore: TocStore
const calcTextClasses = (el: HTMLElement) => { const calcTextClasses = (el: HTMLElement) => {
if (el.tagName === 'H1') return 'text-lg font-medium'; if (el.tagName === 'H1') return 'text-lg font-medium'
if (el.tagName === 'H2') return 'text-lg'; if (el.tagName === 'H2') return 'text-lg'
return 'text-sm text-muted-foreground'; return 'text-sm text-muted-foreground'
}; }
</script> </script>
<Card.Root class="lg:hidden"> <Card.Root class="lg:hidden">

View file

@ -1,15 +1,15 @@
<script lang="ts"> <script lang="ts">
import { toclink, type TocStore } from '@svelte-put/toc'; import { toclink, type TocStore } from '@svelte-put/toc'
import * as Card from '$lib/components/ui/card'; import * as Card from '$lib/components/ui/card'
export let tocStore: TocStore; export let tocStore: TocStore
const calcTextClasses = (el: HTMLElement) => { const calcTextClasses = (el: HTMLElement) => {
if (el.tagName === 'H1') return 'text-md xl:text-lg font-medium'; if (el.tagName === 'H1') return 'text-md xl:text-lg font-medium'
if (el.tagName === 'H2') return 'text-md xl:text-lg'; if (el.tagName === 'H2') return 'text-md xl:text-lg'
if (el.id === 'end-marker') return 'text-lg xl:text-xl'; if (el.id === 'end-marker') return 'text-lg xl:text-xl'
return 'text-sm text-muted-foreground'; return 'text-sm text-muted-foreground'
}; }
</script> </script>
<Card.Root> <Card.Root>

View file

@ -1,26 +1,26 @@
<script lang="ts"> <script lang="ts">
import type { TocStore } from '@svelte-put/toc'; import type { TocStore } from '@svelte-put/toc'
import Separator from '../ui/separator/separator.svelte'; import Separator from '../ui/separator/separator.svelte'
import { Accordion } from 'bits-ui'; import { Accordion } from 'bits-ui'
import { toclink } from '@svelte-put/toc'; import { toclink } from '@svelte-put/toc'
import { CaretDown } from 'svelte-radix'; import { CaretDown } from 'svelte-radix'
import { slide } from 'svelte/transition'; import { slide } from 'svelte/transition'
export let tocStore: TocStore; export let tocStore: TocStore
export let placeholder: string; export let placeholder: string
const calcTextClasses = (el: HTMLElement) => { const calcTextClasses = (el: HTMLElement) => {
if (el.tagName === 'H2') return 'text-xl'; if (el.tagName === 'H2') return 'text-xl'
return 'text-md text-muted-foreground'; return 'text-md text-muted-foreground'
}; }
$: currentDisplayed = $tocStore.activeItem ? $tocStore.activeItem.text : placeholder; $: currentDisplayed = $tocStore.activeItem ? $tocStore.activeItem.text : placeholder
let value: string; let value: string
const close = () => { const close = () => {
value = ''; value = ''
}; }
</script> </script>
<nav class="fixed top-16 left-0 w-full bg-background bg-opacity-50 backdrop-blur-lg z-30 lg:hidden"> <nav class="fixed top-16 left-0 w-full bg-background bg-opacity-50 backdrop-blur-lg z-30 lg:hidden">

View file

@ -1,17 +1,17 @@
<script lang="ts"> <script lang="ts">
import { Accordion as AccordionPrimitive } from 'bits-ui'; import { Accordion as AccordionPrimitive } from 'bits-ui'
import { slide } from 'svelte/transition'; import { slide } from 'svelte/transition'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = AccordionPrimitive.ContentProps; type $$Props = AccordionPrimitive.ContentProps
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let transition: $$Props['transition'] = slide; export let transition: $$Props['transition'] = slide
export let transitionConfig: $$Props['transitionConfig'] = { export let transitionConfig: $$Props['transitionConfig'] = {
duration: 200 duration: 200
}; }
export { className as class }; export { className as class }
</script> </script>
<AccordionPrimitive.Content <AccordionPrimitive.Content

View file

@ -1,12 +1,12 @@
<script lang="ts"> <script lang="ts">
import { Accordion as AccordionPrimitive } from 'bits-ui'; import { Accordion as AccordionPrimitive } from 'bits-ui'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = AccordionPrimitive.ItemProps; type $$Props = AccordionPrimitive.ItemProps
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
export let value: $$Props['value']; export let value: $$Props['value']
</script> </script>
<AccordionPrimitive.Item {value} class={cn('border-b', className)} {...$$restProps}> <AccordionPrimitive.Item {value} class={cn('border-b', className)} {...$$restProps}>

View file

@ -1,14 +1,14 @@
<script lang="ts"> <script lang="ts">
import { Accordion as AccordionPrimitive } from 'bits-ui'; import { Accordion as AccordionPrimitive } from 'bits-ui'
import ChevronDown from 'svelte-radix/ChevronDown.svelte'; import ChevronDown from 'svelte-radix/ChevronDown.svelte'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = AccordionPrimitive.TriggerProps; type $$Props = AccordionPrimitive.TriggerProps
type $$Events = AccordionPrimitive.TriggerEvents; type $$Events = AccordionPrimitive.TriggerEvents
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let level: AccordionPrimitive.HeaderProps['level'] = 3; export let level: AccordionPrimitive.HeaderProps['level'] = 3
export { className as class }; export { className as class }
</script> </script>
<AccordionPrimitive.Header {level} class="flex"> <AccordionPrimitive.Header {level} class="flex">

View file

@ -1,9 +1,9 @@
import { Accordion as AccordionPrimitive } from 'bits-ui'; import { Accordion as AccordionPrimitive } from 'bits-ui'
import Content from './accordion-content.svelte'; import Content from './accordion-content.svelte'
import Item from './accordion-item.svelte'; import Item from './accordion-item.svelte'
import Trigger from './accordion-trigger.svelte'; import Trigger from './accordion-trigger.svelte'
const Root = AccordionPrimitive.Root; const Root = AccordionPrimitive.Root
export { export {
Root, Root,
Content, Content,
@ -14,4 +14,4 @@ export {
Content as AccordionContent, Content as AccordionContent,
Item as AccordionItem, Item as AccordionItem,
Trigger as AccordionTrigger Trigger as AccordionTrigger
}; }

View file

@ -1,13 +1,13 @@
<script lang="ts"> <script lang="ts">
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'; import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'
import { buttonVariants } from '$lib/components/ui/button/index.js'; import { buttonVariants } from '$lib/components/ui/button/index.js'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = AlertDialogPrimitive.ActionProps; type $$Props = AlertDialogPrimitive.ActionProps
type $$Events = AlertDialogPrimitive.ActionEvents; type $$Events = AlertDialogPrimitive.ActionEvents
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<AlertDialogPrimitive.Action <AlertDialogPrimitive.Action

View file

@ -1,13 +1,13 @@
<script lang="ts"> <script lang="ts">
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'; import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'
import { buttonVariants } from '$lib/components/ui/button/index.js'; import { buttonVariants } from '$lib/components/ui/button/index.js'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = AlertDialogPrimitive.CancelProps; type $$Props = AlertDialogPrimitive.CancelProps
type $$Events = AlertDialogPrimitive.CancelEvents; type $$Events = AlertDialogPrimitive.CancelEvents
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<AlertDialogPrimitive.Cancel <AlertDialogPrimitive.Cancel

View file

@ -1,14 +1,14 @@
<script lang="ts"> <script lang="ts">
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'; import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'
import * as AlertDialog from './index.js'; import * as AlertDialog from './index.js'
import { cn, flyAndScale } from '$lib/utils.js'; import { cn, flyAndScale } from '$lib/utils.js'
type $$Props = AlertDialogPrimitive.ContentProps; type $$Props = AlertDialogPrimitive.ContentProps
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let transition: $$Props['transition'] = flyAndScale; export let transition: $$Props['transition'] = flyAndScale
export let transitionConfig: $$Props['transitionConfig'] = undefined; export let transitionConfig: $$Props['transitionConfig'] = undefined
export { className as class }; export { className as class }
</script> </script>
<AlertDialog.Portal> <AlertDialog.Portal>

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'; import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = AlertDialogPrimitive.DescriptionProps; type $$Props = AlertDialogPrimitive.DescriptionProps
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<AlertDialogPrimitive.Description <AlertDialogPrimitive.Description

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLAttributes<HTMLDivElement>; type $$Props = HTMLAttributes<HTMLDivElement>
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<div <div

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLAttributes<HTMLDivElement>; type $$Props = HTMLAttributes<HTMLDivElement>
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<div class={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...$$restProps}> <div class={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...$$restProps}>

View file

@ -1,16 +1,16 @@
<script lang="ts"> <script lang="ts">
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'; import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'
import { fade } from 'svelte/transition'; import { fade } from 'svelte/transition'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = AlertDialogPrimitive.OverlayProps; type $$Props = AlertDialogPrimitive.OverlayProps
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let transition: $$Props['transition'] = fade; export let transition: $$Props['transition'] = fade
export let transitionConfig: $$Props['transitionConfig'] = { export let transitionConfig: $$Props['transitionConfig'] = {
duration: 150 duration: 150
}; }
export { className as class }; export { className as class }
</script> </script>
<AlertDialogPrimitive.Overlay <AlertDialogPrimitive.Overlay

View file

@ -1,7 +1,7 @@
<script lang="ts"> <script lang="ts">
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'; import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'
type $$Props = AlertDialogPrimitive.PortalProps; type $$Props = AlertDialogPrimitive.PortalProps
</script> </script>
<AlertDialogPrimitive.Portal {...$$restProps}> <AlertDialogPrimitive.Portal {...$$restProps}>

View file

@ -1,12 +1,12 @@
<script lang="ts"> <script lang="ts">
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'; import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = AlertDialogPrimitive.TitleProps; type $$Props = AlertDialogPrimitive.TitleProps
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let level: $$Props['level'] = 'h3'; export let level: $$Props['level'] = 'h3'
export { className as class }; export { className as class }
</script> </script>
<AlertDialogPrimitive.Title class={cn('text-lg font-semibold', className)} {level} {...$$restProps}> <AlertDialogPrimitive.Title class={cn('text-lg font-semibold', className)} {level} {...$$restProps}>

View file

@ -1,17 +1,17 @@
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'; import { AlertDialog as AlertDialogPrimitive } from 'bits-ui'
import Title from './alert-dialog-title.svelte'; import Title from './alert-dialog-title.svelte'
import Action from './alert-dialog-action.svelte'; import Action from './alert-dialog-action.svelte'
import Cancel from './alert-dialog-cancel.svelte'; import Cancel from './alert-dialog-cancel.svelte'
import Portal from './alert-dialog-portal.svelte'; import Portal from './alert-dialog-portal.svelte'
import Footer from './alert-dialog-footer.svelte'; import Footer from './alert-dialog-footer.svelte'
import Header from './alert-dialog-header.svelte'; import Header from './alert-dialog-header.svelte'
import Overlay from './alert-dialog-overlay.svelte'; import Overlay from './alert-dialog-overlay.svelte'
import Content from './alert-dialog-content.svelte'; import Content from './alert-dialog-content.svelte'
import Description from './alert-dialog-description.svelte'; import Description from './alert-dialog-description.svelte'
const Root = AlertDialogPrimitive.Root; const Root = AlertDialogPrimitive.Root
const Trigger = AlertDialogPrimitive.Trigger; const Trigger = AlertDialogPrimitive.Trigger
export { export {
Root, Root,
@ -37,4 +37,4 @@ export {
Overlay as AlertDialogOverlay, Overlay as AlertDialogOverlay,
Content as AlertDialogContent, Content as AlertDialogContent,
Description as AlertDialogDescription Description as AlertDialogDescription
}; }

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import { type Variant, badgeVariants } from './index.js'; import { type Variant, badgeVariants } from './index.js'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
let className: string | undefined | null = undefined; let className: string | undefined | null = undefined
export let href: string | undefined = undefined; export let href: string | undefined = undefined
export let variant: Variant = 'default'; export let variant: Variant = 'default'
export { className as class }; export { className as class }
</script> </script>
<svelte:element <svelte:element

View file

@ -1,6 +1,6 @@
import { type VariantProps, tv } from 'tailwind-variants'; import { type VariantProps, tv } from 'tailwind-variants'
export { default as Badge } from './badge.svelte'; export { default as Badge } from './badge.svelte'
export const badgeVariants = tv({ export const badgeVariants = tv({
base: '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-ring focus:ring-offset-2', base: '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-ring focus:ring-offset-2',
variants: { variants: {
@ -15,6 +15,6 @@ export const badgeVariants = tv({
defaultVariants: { defaultVariants: {
variant: 'default' variant: 'default'
} }
}); })
export type Variant = VariantProps<typeof badgeVariants>['variant']; export type Variant = VariantProps<typeof badgeVariants>['variant']

View file

@ -1,15 +1,15 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements'
import DotsHorizontal from 'svelte-radix/DotsHorizontal.svelte'; import DotsHorizontal from 'svelte-radix/DotsHorizontal.svelte'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLAttributes<HTMLSpanElement> & { type $$Props = HTMLAttributes<HTMLSpanElement> & {
el?: HTMLSpanElement; el?: HTMLSpanElement
}; }
export let el: $$Props['el'] = undefined; export let el: $$Props['el'] = undefined
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<span <span

View file

@ -1,14 +1,14 @@
<script lang="ts"> <script lang="ts">
import type { HTMLLiAttributes } from 'svelte/elements'; import type { HTMLLiAttributes } from 'svelte/elements'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLLiAttributes & { type $$Props = HTMLLiAttributes & {
el?: HTMLLIElement; el?: HTMLLIElement
}; }
export let el: $$Props['el'] = undefined; export let el: $$Props['el'] = undefined
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<li bind:this={el} class={cn('inline-flex items-center gap-1.5', className)}> <li bind:this={el} class={cn('inline-flex items-center gap-1.5', className)}>

View file

@ -1,25 +1,25 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAnchorAttributes } from 'svelte/elements'; import type { HTMLAnchorAttributes } from 'svelte/elements'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLAnchorAttributes & { type $$Props = HTMLAnchorAttributes & {
el?: HTMLAnchorElement; el?: HTMLAnchorElement
asChild?: boolean; asChild?: boolean
}; }
export let href: $$Props['href'] = undefined; export let href: $$Props['href'] = undefined
export let el: $$Props['el'] = undefined; export let el: $$Props['el'] = undefined
export let asChild: $$Props['asChild'] = false; export let asChild: $$Props['asChild'] = false
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
let attrs: Record<string, unknown>; let attrs: Record<string, unknown>
$: attrs = { $: attrs = {
class: cn('transition-colors hover:text-foreground', className), class: cn('transition-colors hover:text-foreground', className),
href, href,
...$$restProps ...$$restProps
}; }
</script> </script>
{#if asChild} {#if asChild}

View file

@ -1,14 +1,14 @@
<script lang="ts"> <script lang="ts">
import type { HTMLOlAttributes } from 'svelte/elements'; import type { HTMLOlAttributes } from 'svelte/elements'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLOlAttributes & { type $$Props = HTMLOlAttributes & {
el?: HTMLOListElement; el?: HTMLOListElement
}; }
export let el: $$Props['el'] = undefined; export let el: $$Props['el'] = undefined
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<ol <ol

View file

@ -1,14 +1,14 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLAttributes<HTMLSpanElement> & { type $$Props = HTMLAttributes<HTMLSpanElement> & {
el?: HTMLSpanElement; el?: HTMLSpanElement
}; }
export let el: $$Props['el'] = undefined; export let el: $$Props['el'] = undefined
export let className: $$Props['class'] = undefined; export let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<span <span

View file

@ -1,15 +1,15 @@
<script lang="ts"> <script lang="ts">
import type { HTMLLiAttributes } from 'svelte/elements'; import type { HTMLLiAttributes } from 'svelte/elements'
import ChevronRight from 'svelte-radix/ChevronRight.svelte'; import ChevronRight from 'svelte-radix/ChevronRight.svelte'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLLiAttributes & { type $$Props = HTMLLiAttributes & {
el?: HTMLLIElement; el?: HTMLLIElement
}; }
export let el: $$Props['el'] = undefined; export let el: $$Props['el'] = undefined
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<li <li

View file

@ -1,13 +1,13 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements'
type $$Props = HTMLAttributes<HTMLElement> & { type $$Props = HTMLAttributes<HTMLElement> & {
el?: HTMLElement; el?: HTMLElement
}; }
export let el: $$Props['el'] = undefined; export let el: $$Props['el'] = undefined
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<nav class={className} bind:this={el} aria-label="breadcrumb" {...$$restProps}> <nav class={className} bind:this={el} aria-label="breadcrumb" {...$$restProps}>

View file

@ -1,10 +1,10 @@
import Root from './breadcrumb.svelte'; import Root from './breadcrumb.svelte'
import Ellipsis from './breadcrumb-ellipsis.svelte'; import Ellipsis from './breadcrumb-ellipsis.svelte'
import Item from './breadcrumb-item.svelte'; import Item from './breadcrumb-item.svelte'
import Separator from './breadcrumb-separator.svelte'; import Separator from './breadcrumb-separator.svelte'
import Link from './breadcrumb-link.svelte'; import Link from './breadcrumb-link.svelte'
import List from './breadcrumb-list.svelte'; import List from './breadcrumb-list.svelte'
import Page from './breadcrumb-page.svelte'; import Page from './breadcrumb-page.svelte'
export { export {
Root, Root,
@ -22,4 +22,4 @@ export {
Link as BreadcrumbLink, Link as BreadcrumbLink,
List as BreadcrumbList, List as BreadcrumbList,
Page as BreadcrumbPage Page as BreadcrumbPage
}; }

View file

@ -1,16 +1,16 @@
<script lang="ts"> <script lang="ts">
import { Button as ButtonPrimitive } from 'bits-ui'; import { Button as ButtonPrimitive } from 'bits-ui'
import { type Events, type Props, buttonVariants } from './index.js'; import { type Events, type Props, buttonVariants } from './index.js'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = Props; type $$Props = Props
type $$Events = Events; type $$Events = Events
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let variant: $$Props['variant'] = 'default'; export let variant: $$Props['variant'] = 'default'
export let size: $$Props['size'] = 'default'; export let size: $$Props['size'] = 'default'
export let builders: $$Props['builders'] = []; export let builders: $$Props['builders'] = []
export { className as class }; export { className as class }
</script> </script>
<ButtonPrimitive.Root <ButtonPrimitive.Root

View file

@ -1,6 +1,6 @@
import type { Button as ButtonPrimitive } from 'bits-ui'; import type { Button as ButtonPrimitive } from 'bits-ui'
import { type VariantProps, tv } from 'tailwind-variants'; import { type VariantProps, tv } from 'tailwind-variants'
import Root from './button.svelte'; import Root from './button.svelte'
const buttonVariants = tv({ const buttonVariants = tv({
base: 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50', base: 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',
@ -25,17 +25,17 @@ const buttonVariants = tv({
variant: 'default', variant: 'default',
size: 'default' size: 'default'
} }
}); })
type Variant = VariantProps<typeof buttonVariants>['variant']; type Variant = VariantProps<typeof buttonVariants>['variant']
type Size = VariantProps<typeof buttonVariants>['size']; type Size = VariantProps<typeof buttonVariants>['size']
type Props = ButtonPrimitive.Props & { type Props = ButtonPrimitive.Props & {
variant?: Variant; variant?: Variant
size?: Size; size?: Size
}; }
type Events = ButtonPrimitive.Events; type Events = ButtonPrimitive.Events
export { export {
Root, Root,
@ -46,4 +46,4 @@ export {
type Props as ButtonProps, type Props as ButtonProps,
type Events as ButtonEvents, type Events as ButtonEvents,
buttonVariants buttonVariants
}; }

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLAttributes<HTMLDivElement>; type $$Props = HTMLAttributes<HTMLDivElement>
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<div class={cn('p-6 pt-0', className)} {...$$restProps}> <div class={cn('p-6 pt-0', className)} {...$$restProps}>

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLAttributes<HTMLParagraphElement>; type $$Props = HTMLAttributes<HTMLParagraphElement>
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<p class={cn('text-sm text-muted-foreground', className)} {...$$restProps}> <p class={cn('text-sm text-muted-foreground', className)} {...$$restProps}>

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLAttributes<HTMLDivElement>; type $$Props = HTMLAttributes<HTMLDivElement>
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<div class={cn('flex items-center p-6 pt-0', className)} {...$$restProps}> <div class={cn('flex items-center p-6 pt-0', className)} {...$$restProps}>

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLAttributes<HTMLDivElement>; type $$Props = HTMLAttributes<HTMLDivElement>
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<div class={cn('flex flex-col space-y-1.5 p-6', className)} {...$$restProps}> <div class={cn('flex flex-col space-y-1.5 p-6', className)} {...$$restProps}>

View file

@ -1,15 +1,15 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements'
import type { HeadingLevel } from './index.js'; import type { HeadingLevel } from './index.js'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLAttributes<HTMLHeadingElement> & { type $$Props = HTMLAttributes<HTMLHeadingElement> & {
tag?: HeadingLevel; tag?: HeadingLevel
}; }
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let tag: $$Props['tag'] = 'h3'; export let tag: $$Props['tag'] = 'h3'
export { className as class }; export { className as class }
</script> </script>
<svelte:element <svelte:element

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLAttributes<HTMLDivElement>; type $$Props = HTMLAttributes<HTMLDivElement>
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<!-- svelte-ignore a11y-no-static-element-interactions --> <!-- svelte-ignore a11y-no-static-element-interactions -->

View file

@ -1,9 +1,9 @@
import Root from './card.svelte'; import Root from './card.svelte'
import Content from './card-content.svelte'; import Content from './card-content.svelte'
import Description from './card-description.svelte'; import Description from './card-description.svelte'
import Footer from './card-footer.svelte'; import Footer from './card-footer.svelte'
import Header from './card-header.svelte'; import Header from './card-header.svelte'
import Title from './card-title.svelte'; import Title from './card-title.svelte'
export { export {
Root, Root,
@ -19,6 +19,6 @@ export {
Footer as CardFooter, Footer as CardFooter,
Header as CardHeader, Header as CardHeader,
Title as CardTitle Title as CardTitle
}; }
export type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; export type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'

View file

@ -1,12 +1,12 @@
<script lang="ts"> <script lang="ts">
import { Drawer as DrawerPrimitive } from 'vaul-svelte'; import { Drawer as DrawerPrimitive } from 'vaul-svelte'
import DrawerOverlay from './drawer-overlay.svelte'; import DrawerOverlay from './drawer-overlay.svelte'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = DrawerPrimitive.ContentProps; type $$Props = DrawerPrimitive.ContentProps
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<DrawerPrimitive.Portal> <DrawerPrimitive.Portal>

View file

@ -1,12 +1,12 @@
<script lang="ts"> <script lang="ts">
import { Drawer as DrawerPrimitive } from 'vaul-svelte'; import { Drawer as DrawerPrimitive } from 'vaul-svelte'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = DrawerPrimitive.DescriptionProps; type $$Props = DrawerPrimitive.DescriptionProps
export let el: $$Props['el'] = undefined; export let el: $$Props['el'] = undefined
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<DrawerPrimitive.Description <DrawerPrimitive.Description

View file

@ -1,14 +1,14 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLAttributes<HTMLDivElement> & { type $$Props = HTMLAttributes<HTMLDivElement> & {
el?: HTMLDivElement; el?: HTMLDivElement
}; }
export let el: $$Props['el'] = undefined; export let el: $$Props['el'] = undefined
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<div bind:this={el} class={cn('mt-auto flex flex-col gap-2 p-4', className)} {...$$restProps}> <div bind:this={el} class={cn('mt-auto flex flex-col gap-2 p-4', className)} {...$$restProps}>

View file

@ -1,13 +1,13 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLAttributes<HTMLDivElement> & { type $$Props = HTMLAttributes<HTMLDivElement> & {
el?: HTMLDivElement; el?: HTMLDivElement
}; }
export let el: $$Props['el'] = undefined; export let el: $$Props['el'] = undefined
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<div <div

View file

@ -1,10 +1,10 @@
<script lang="ts"> <script lang="ts">
import { Drawer as DrawerPrimitive } from 'vaul-svelte'; import { Drawer as DrawerPrimitive } from 'vaul-svelte'
type $$Props = DrawerPrimitive.Props; type $$Props = DrawerPrimitive.Props
export let shouldScaleBackground: $$Props['shouldScaleBackground'] = true; export let shouldScaleBackground: $$Props['shouldScaleBackground'] = true
export let open: $$Props['open'] = false; export let open: $$Props['open'] = false
export let activeSnapPoint: $$Props['activeSnapPoint'] = undefined; export let activeSnapPoint: $$Props['activeSnapPoint'] = undefined
</script> </script>
<DrawerPrimitive.NestedRoot {shouldScaleBackground} bind:open bind:activeSnapPoint {...$$restProps}> <DrawerPrimitive.NestedRoot {shouldScaleBackground} bind:open bind:activeSnapPoint {...$$restProps}>

View file

@ -1,12 +1,12 @@
<script lang="ts"> <script lang="ts">
import { Drawer as DrawerPrimitive } from 'vaul-svelte'; import { Drawer as DrawerPrimitive } from 'vaul-svelte'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = DrawerPrimitive.OverlayProps; type $$Props = DrawerPrimitive.OverlayProps
export let el: $$Props['el'] = undefined; export let el: $$Props['el'] = undefined
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<DrawerPrimitive.Overlay <DrawerPrimitive.Overlay

View file

@ -1,12 +1,12 @@
<script lang="ts"> <script lang="ts">
import { Drawer as DrawerPrimitive } from 'vaul-svelte'; import { Drawer as DrawerPrimitive } from 'vaul-svelte'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = DrawerPrimitive.TitleProps; type $$Props = DrawerPrimitive.TitleProps
export let el: $$Props['el'] = undefined; export let el: $$Props['el'] = undefined
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<DrawerPrimitive.Title <DrawerPrimitive.Title

View file

@ -1,10 +1,10 @@
<script lang="ts"> <script lang="ts">
import { Drawer as DrawerPrimitive } from 'vaul-svelte'; import { Drawer as DrawerPrimitive } from 'vaul-svelte'
type $$Props = DrawerPrimitive.Props; type $$Props = DrawerPrimitive.Props
export let shouldScaleBackground: $$Props['shouldScaleBackground'] = true; export let shouldScaleBackground: $$Props['shouldScaleBackground'] = true
export let open: $$Props['open'] = false; export let open: $$Props['open'] = false
export let activeSnapPoint: $$Props['activeSnapPoint'] = undefined; export let activeSnapPoint: $$Props['activeSnapPoint'] = undefined
</script> </script>
<DrawerPrimitive.Root {shouldScaleBackground} bind:open bind:activeSnapPoint {...$$restProps}> <DrawerPrimitive.Root {shouldScaleBackground} bind:open bind:activeSnapPoint {...$$restProps}>

View file

@ -1,17 +1,17 @@
import { Drawer as DrawerPrimitive } from 'vaul-svelte'; import { Drawer as DrawerPrimitive } from 'vaul-svelte'
import Root from './drawer.svelte'; import Root from './drawer.svelte'
import Content from './drawer-content.svelte'; import Content from './drawer-content.svelte'
import Description from './drawer-description.svelte'; import Description from './drawer-description.svelte'
import Overlay from './drawer-overlay.svelte'; import Overlay from './drawer-overlay.svelte'
import Footer from './drawer-footer.svelte'; import Footer from './drawer-footer.svelte'
import Header from './drawer-header.svelte'; import Header from './drawer-header.svelte'
import Title from './drawer-title.svelte'; import Title from './drawer-title.svelte'
import NestedRoot from './drawer-nested.svelte'; import NestedRoot from './drawer-nested.svelte'
const Trigger = DrawerPrimitive.Trigger; const Trigger = DrawerPrimitive.Trigger
const Portal = DrawerPrimitive.Portal; const Portal = DrawerPrimitive.Portal
const Close = DrawerPrimitive.Close; const Close = DrawerPrimitive.Close
export { export {
Root, Root,
@ -37,4 +37,4 @@ export {
Trigger as DrawerTrigger, Trigger as DrawerTrigger,
Portal as DrawerPortal, Portal as DrawerPortal,
Close as DrawerClose Close as DrawerClose
}; }

View file

@ -1,14 +1,14 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'
import Check from 'svelte-radix/Check.svelte'; import Check from 'svelte-radix/Check.svelte'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = DropdownMenuPrimitive.CheckboxItemProps; type $$Props = DropdownMenuPrimitive.CheckboxItemProps
type $$Events = DropdownMenuPrimitive.CheckboxItemEvents; type $$Events = DropdownMenuPrimitive.CheckboxItemEvents
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let checked: $$Props['checked'] = undefined; export let checked: $$Props['checked'] = undefined
export { className as class }; export { className as class }
</script> </script>
<DropdownMenuPrimitive.CheckboxItem <DropdownMenuPrimitive.CheckboxItem

View file

@ -1,14 +1,14 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'
import { cn, flyAndScale } from '$lib/utils.js'; import { cn, flyAndScale } from '$lib/utils.js'
type $$Props = DropdownMenuPrimitive.ContentProps; type $$Props = DropdownMenuPrimitive.ContentProps
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let sideOffset: $$Props['sideOffset'] = 4; export let sideOffset: $$Props['sideOffset'] = 4
export let transition: $$Props['transition'] = flyAndScale; export let transition: $$Props['transition'] = flyAndScale
export let transitionConfig: $$Props['transitionConfig'] = undefined; export let transitionConfig: $$Props['transitionConfig'] = undefined
export { className as class }; export { className as class }
</script> </script>
<DropdownMenuPrimitive.Content <DropdownMenuPrimitive.Content

View file

@ -1,15 +1,15 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = DropdownMenuPrimitive.ItemProps & { type $$Props = DropdownMenuPrimitive.ItemProps & {
inset?: boolean; inset?: boolean
}; }
type $$Events = DropdownMenuPrimitive.ItemEvents; type $$Events = DropdownMenuPrimitive.ItemEvents
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let inset: $$Props['inset'] = undefined; export let inset: $$Props['inset'] = undefined
export { className as class }; export { className as class }
</script> </script>
<DropdownMenuPrimitive.Item <DropdownMenuPrimitive.Item

View file

@ -1,14 +1,14 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = DropdownMenuPrimitive.LabelProps & { type $$Props = DropdownMenuPrimitive.LabelProps & {
inset?: boolean; inset?: boolean
}; }
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let inset: $$Props['inset'] = undefined; export let inset: $$Props['inset'] = undefined
export { className as class }; export { className as class }
</script> </script>
<DropdownMenuPrimitive.Label <DropdownMenuPrimitive.Label

View file

@ -1,9 +1,9 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'
type $$Props = DropdownMenuPrimitive.RadioGroupProps; type $$Props = DropdownMenuPrimitive.RadioGroupProps
export let value: $$Props['value'] = undefined; export let value: $$Props['value'] = undefined
</script> </script>
<DropdownMenuPrimitive.RadioGroup {...$$restProps} bind:value> <DropdownMenuPrimitive.RadioGroup {...$$restProps} bind:value>

View file

@ -1,14 +1,14 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'
import DotFilled from 'svelte-radix/DotFilled.svelte'; import DotFilled from 'svelte-radix/DotFilled.svelte'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = DropdownMenuPrimitive.RadioItemProps; type $$Props = DropdownMenuPrimitive.RadioItemProps
type $$Events = DropdownMenuPrimitive.RadioItemEvents; type $$Events = DropdownMenuPrimitive.RadioItemEvents
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let value: DropdownMenuPrimitive.RadioItemProps['value']; export let value: DropdownMenuPrimitive.RadioItemProps['value']
export { className as class }; export { className as class }
</script> </script>
<DropdownMenuPrimitive.RadioItem <DropdownMenuPrimitive.RadioItem

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = DropdownMenuPrimitive.SeparatorProps; type $$Props = DropdownMenuPrimitive.SeparatorProps
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<DropdownMenuPrimitive.Separator <DropdownMenuPrimitive.Separator

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import type { HTMLAttributes } from 'svelte/elements'; import type { HTMLAttributes } from 'svelte/elements'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = HTMLAttributes<HTMLSpanElement>; type $$Props = HTMLAttributes<HTMLSpanElement>
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
</script> </script>
<span class={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...$$restProps}> <span class={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...$$restProps}>

View file

@ -1,16 +1,16 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'
import { cn, flyAndScale } from '$lib/utils.js'; import { cn, flyAndScale } from '$lib/utils.js'
type $$Props = DropdownMenuPrimitive.SubContentProps; type $$Props = DropdownMenuPrimitive.SubContentProps
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let transition: $$Props['transition'] = flyAndScale; export let transition: $$Props['transition'] = flyAndScale
export let transitionConfig: $$Props['transitionConfig'] = { export let transitionConfig: $$Props['transitionConfig'] = {
x: -10, x: -10,
y: 0 y: 0
}; }
export { className as class }; export { className as class }
</script> </script>
<DropdownMenuPrimitive.SubContent <DropdownMenuPrimitive.SubContent

View file

@ -1,16 +1,16 @@
<script lang="ts"> <script lang="ts">
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'
import ChevronRight from 'svelte-radix/ChevronRight.svelte'; import ChevronRight from 'svelte-radix/ChevronRight.svelte'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = DropdownMenuPrimitive.SubTriggerProps & { type $$Props = DropdownMenuPrimitive.SubTriggerProps & {
inset?: boolean; inset?: boolean
}; }
type $$Events = DropdownMenuPrimitive.SubTriggerEvents; type $$Events = DropdownMenuPrimitive.SubTriggerEvents
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let inset: $$Props['inset'] = undefined; export let inset: $$Props['inset'] = undefined
export { className as class }; export { className as class }
</script> </script>
<DropdownMenuPrimitive.SubTrigger <DropdownMenuPrimitive.SubTrigger

View file

@ -1,19 +1,19 @@
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'; import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui'
import Item from './dropdown-menu-item.svelte'; import Item from './dropdown-menu-item.svelte'
import Label from './dropdown-menu-label.svelte'; import Label from './dropdown-menu-label.svelte'
import Content from './dropdown-menu-content.svelte'; import Content from './dropdown-menu-content.svelte'
import Shortcut from './dropdown-menu-shortcut.svelte'; import Shortcut from './dropdown-menu-shortcut.svelte'
import RadioItem from './dropdown-menu-radio-item.svelte'; import RadioItem from './dropdown-menu-radio-item.svelte'
import Separator from './dropdown-menu-separator.svelte'; import Separator from './dropdown-menu-separator.svelte'
import RadioGroup from './dropdown-menu-radio-group.svelte'; import RadioGroup from './dropdown-menu-radio-group.svelte'
import SubContent from './dropdown-menu-sub-content.svelte'; import SubContent from './dropdown-menu-sub-content.svelte'
import SubTrigger from './dropdown-menu-sub-trigger.svelte'; import SubTrigger from './dropdown-menu-sub-trigger.svelte'
import CheckboxItem from './dropdown-menu-checkbox-item.svelte'; import CheckboxItem from './dropdown-menu-checkbox-item.svelte'
const Sub = DropdownMenuPrimitive.Sub; const Sub = DropdownMenuPrimitive.Sub
const Root = DropdownMenuPrimitive.Root; const Root = DropdownMenuPrimitive.Root
const Trigger = DropdownMenuPrimitive.Trigger; const Trigger = DropdownMenuPrimitive.Trigger
const Group = DropdownMenuPrimitive.Group; const Group = DropdownMenuPrimitive.Group
export { export {
Sub, Sub,
@ -45,4 +45,4 @@ export {
SubContent as DropdownMenuSubContent, SubContent as DropdownMenuSubContent,
SubTrigger as DropdownMenuSubTrigger, SubTrigger as DropdownMenuSubTrigger,
CheckboxItem as DropdownMenuCheckboxItem CheckboxItem as DropdownMenuCheckboxItem
}; }

View file

@ -1,8 +1,8 @@
import { Popover as PopoverPrimitive } from 'bits-ui'; import { Popover as PopoverPrimitive } from 'bits-ui'
import Content from './popover-content.svelte'; import Content from './popover-content.svelte'
const Root = PopoverPrimitive.Root; const Root = PopoverPrimitive.Root
const Trigger = PopoverPrimitive.Trigger; const Trigger = PopoverPrimitive.Trigger
const Close = PopoverPrimitive.Close; const Close = PopoverPrimitive.Close
export { export {
Root, Root,
@ -14,4 +14,4 @@ export {
Content as PopoverContent, Content as PopoverContent,
Trigger as PopoverTrigger, Trigger as PopoverTrigger,
Close as PopoverClose Close as PopoverClose
}; }

View file

@ -1,15 +1,15 @@
<script lang="ts"> <script lang="ts">
import { Popover as PopoverPrimitive } from 'bits-ui'; import { Popover as PopoverPrimitive } from 'bits-ui'
import { cn, flyAndScale } from '$lib/utils.js'; import { cn, flyAndScale } from '$lib/utils.js'
type $$Props = PopoverPrimitive.ContentProps; type $$Props = PopoverPrimitive.ContentProps
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let transition: $$Props['transition'] = flyAndScale; export let transition: $$Props['transition'] = flyAndScale
export let transitionConfig: $$Props['transitionConfig'] = undefined; export let transitionConfig: $$Props['transitionConfig'] = undefined
export let align: $$Props['align'] = 'center'; export let align: $$Props['align'] = 'center'
export let sideOffset: $$Props['sideOffset'] = 4; export let sideOffset: $$Props['sideOffset'] = 4
export { className as class }; export { className as class }
</script> </script>
<PopoverPrimitive.Content <PopoverPrimitive.Content

View file

@ -1,5 +1,5 @@
import Scrollbar from './scroll-area-scrollbar.svelte'; import Scrollbar from './scroll-area-scrollbar.svelte'
import Root from './scroll-area.svelte'; import Root from './scroll-area.svelte'
export { export {
Root, Root,
@ -7,4 +7,4 @@ export {
//, //,
Root as ScrollArea, Root as ScrollArea,
Scrollbar as ScrollAreaScrollbar Scrollbar as ScrollAreaScrollbar
}; }

View file

@ -1,14 +1,14 @@
<script lang="ts"> <script lang="ts">
import { ScrollArea as ScrollAreaPrimitive } from 'bits-ui'; import { ScrollArea as ScrollAreaPrimitive } from 'bits-ui'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = ScrollAreaPrimitive.ScrollbarProps & { type $$Props = ScrollAreaPrimitive.ScrollbarProps & {
orientation?: 'vertical' | 'horizontal'; orientation?: 'vertical' | 'horizontal'
}; }
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let orientation: $$Props['orientation'] = 'vertical'; export let orientation: $$Props['orientation'] = 'vertical'
export { className as class }; export { className as class }
</script> </script>
<ScrollAreaPrimitive.Scrollbar <ScrollAreaPrimitive.Scrollbar

View file

@ -1,19 +1,19 @@
<script lang="ts"> <script lang="ts">
import { ScrollArea as ScrollAreaPrimitive } from 'bits-ui'; import { ScrollArea as ScrollAreaPrimitive } from 'bits-ui'
import { Scrollbar } from './index.js'; import { Scrollbar } from './index.js'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = ScrollAreaPrimitive.Props & { type $$Props = ScrollAreaPrimitive.Props & {
orientation?: 'vertical' | 'horizontal' | 'both'; orientation?: 'vertical' | 'horizontal' | 'both'
scrollbarXClasses?: string; scrollbarXClasses?: string
scrollbarYClasses?: string; scrollbarYClasses?: string
}; }
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export { className as class }; export { className as class }
export let orientation = 'vertical'; export let orientation = 'vertical'
export let scrollbarXClasses: string = ''; export let scrollbarXClasses: string = ''
export let scrollbarYClasses: string = ''; export let scrollbarYClasses: string = ''
</script> </script>
<ScrollAreaPrimitive.Root {...$$restProps} class={cn('relative overflow-hidden', className)}> <ScrollAreaPrimitive.Root {...$$restProps} class={cn('relative overflow-hidden', className)}>

View file

@ -1,7 +1,7 @@
import Root from './separator.svelte'; import Root from './separator.svelte'
export { export {
Root, Root,
// //
Root as Separator Root as Separator
}; }

View file

@ -1,13 +1,13 @@
<script lang="ts"> <script lang="ts">
import { Separator as SeparatorPrimitive } from 'bits-ui'; import { Separator as SeparatorPrimitive } from 'bits-ui'
import { cn } from '$lib/utils.js'; import { cn } from '$lib/utils.js'
type $$Props = SeparatorPrimitive.Props; type $$Props = SeparatorPrimitive.Props
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let orientation: $$Props['orientation'] = 'horizontal'; export let orientation: $$Props['orientation'] = 'horizontal'
export let decorative: $$Props['decorative'] = undefined; export let decorative: $$Props['decorative'] = undefined
export { className as class }; export { className as class }
</script> </script>
<SeparatorPrimitive.Root <SeparatorPrimitive.Root

View file

@ -1 +1 @@
export { default as Toaster } from './sonner.svelte'; export { default as Toaster } from './sonner.svelte'

View file

@ -1,8 +1,8 @@
<script lang="ts"> <script lang="ts">
import { Toaster as Sonner, type ToasterProps as SonnerProps } from 'svelte-sonner'; import { Toaster as Sonner, type ToasterProps as SonnerProps } from 'svelte-sonner'
import { mode } from 'mode-watcher'; import { mode } from 'mode-watcher'
type $$Props = SonnerProps; type $$Props = SonnerProps
</script> </script>
<Sonner <Sonner

View file

@ -1,8 +1,8 @@
import { Tooltip as TooltipPrimitive } from 'bits-ui'; import { Tooltip as TooltipPrimitive } from 'bits-ui'
import Content from './tooltip-content.svelte'; import Content from './tooltip-content.svelte'
const Root = TooltipPrimitive.Root; const Root = TooltipPrimitive.Root
const Trigger = TooltipPrimitive.Trigger; const Trigger = TooltipPrimitive.Trigger
export { export {
Root, Root,
@ -12,4 +12,4 @@ export {
Root as Tooltip, Root as Tooltip,
Content as TooltipContent, Content as TooltipContent,
Trigger as TooltipTrigger Trigger as TooltipTrigger
}; }

View file

@ -1,17 +1,17 @@
<script lang="ts"> <script lang="ts">
import { Tooltip as TooltipPrimitive } from 'bits-ui'; import { Tooltip as TooltipPrimitive } from 'bits-ui'
import { cn, flyAndScale } from '$lib/utils.js'; import { cn, flyAndScale } from '$lib/utils.js'
type $$Props = TooltipPrimitive.ContentProps; type $$Props = TooltipPrimitive.ContentProps
let className: $$Props['class'] = undefined; let className: $$Props['class'] = undefined
export let sideOffset: $$Props['sideOffset'] = 4; export let sideOffset: $$Props['sideOffset'] = 4
export let transition: $$Props['transition'] = flyAndScale; export let transition: $$Props['transition'] = flyAndScale
export let transitionConfig: $$Props['transitionConfig'] = { export let transitionConfig: $$Props['transitionConfig'] = {
y: 8, y: 8,
duration: 150 duration: 150
}; }
export { className as class }; export { className as class }
</script> </script>
<TooltipPrimitive.Content <TooltipPrimitive.Content

View file

@ -1,56 +1,56 @@
import { type ClassValue, clsx } from 'clsx'; import { type ClassValue, clsx } from 'clsx'
import { twMerge } from 'tailwind-merge'; import { twMerge } from 'tailwind-merge'
import { cubicOut } from 'svelte/easing'; import { cubicOut } from 'svelte/easing'
import type { TransitionConfig } from 'svelte/transition'; import type { TransitionConfig } from 'svelte/transition'
export function cn(...inputs: ClassValue[]) { export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs)); return twMerge(clsx(inputs))
} }
type FlyAndScaleParams = { type FlyAndScaleParams = {
y?: number; y?: number
x?: number; x?: number
start?: number; start?: number
duration?: number; duration?: number
}; }
export const flyAndScale = ( export const flyAndScale = (
node: Element, node: Element,
params: FlyAndScaleParams = { y: -8, x: 0, start: 0.95, duration: 150 } params: FlyAndScaleParams = { y: -8, x: 0, start: 0.95, duration: 150 }
): TransitionConfig => { ): TransitionConfig => {
const style = getComputedStyle(node); const style = getComputedStyle(node)
const transform = style.transform === 'none' ? '' : style.transform; const transform = style.transform === 'none' ? '' : style.transform
const scaleConversion = (valueA: number, scaleA: [number, number], scaleB: [number, number]) => { const scaleConversion = (valueA: number, scaleA: [number, number], scaleB: [number, number]) => {
const [minA, maxA] = scaleA; const [minA, maxA] = scaleA
const [minB, maxB] = scaleB; const [minB, maxB] = scaleB
const percentage = (valueA - minA) / (maxA - minA); const percentage = (valueA - minA) / (maxA - minA)
const valueB = percentage * (maxB - minB) + minB; const valueB = percentage * (maxB - minB) + minB
return valueB; return valueB
}; }
const styleToString = (style: Record<string, number | string | undefined>): string => { const styleToString = (style: Record<string, number | string | undefined>): string => {
return Object.keys(style).reduce((str, key) => { return Object.keys(style).reduce((str, key) => {
if (style[key] === undefined) return str; if (style[key] === undefined) return str
return str + `${key}:${style[key]};`; return str + `${key}:${style[key]};`
}, ''); }, '')
}; }
return { return {
duration: params.duration ?? 200, duration: params.duration ?? 200,
delay: 0, delay: 0,
css: (t) => { css: (t) => {
const y = scaleConversion(t, [0, 1], [params.y ?? 5, 0]); const y = scaleConversion(t, [0, 1], [params.y ?? 5, 0])
const x = scaleConversion(t, [0, 1], [params.x ?? 0, 0]); const x = scaleConversion(t, [0, 1], [params.x ?? 0, 0])
const scale = scaleConversion(t, [0, 1], [params.start ?? 0.95, 1]); const scale = scaleConversion(t, [0, 1], [params.start ?? 0.95, 1])
return styleToString({ return styleToString({
transform: `${transform} translate3d(${x}px, ${y}px, 0) scale(${scale})`, transform: `${transform} translate3d(${x}px, ${y}px, 0) scale(${scale})`,
opacity: t opacity: t
}); })
}, },
easing: cubicOut easing: cubicOut
}; }
}; }

View file

@ -1,52 +1,52 @@
import { readdir, readFile } from 'fs/promises'; import { readdir, readFile } from 'fs/promises'
import { join } from 'path'; import { join } from 'path'
import toml from 'toml'; import toml from 'toml'
const crawl = async () => { const crawl = async () => {
const blogPath = join(process.cwd(), 'blog'); const blogPath = join(process.cwd(), 'blog')
const years = await readdir(blogPath); const years = await readdir(blogPath)
const posts: { const posts: {
[key: string]: { [key: string]: {
metadata: PostMeta; metadata: PostMeta
content: string; content: string
}; }
} = {}; } = {}
for (const year of years) { for (const year of years) {
const yearPath = join(blogPath, year); const yearPath = join(blogPath, year)
const directories = await readdir(yearPath); const directories = await readdir(yearPath)
for (const directory of directories) { for (const directory of directories) {
const postPath = join(yearPath, directory); const postPath = join(yearPath, directory)
try { try {
await readFile(join(postPath, '.blogignore'), 'utf-8'); await readFile(join(postPath, '.blogignore'), 'utf-8')
continue; continue
} catch (error) { } catch (error) {
// If the file doesn't exist, continue with the rest of the code // If the file doesn't exist, continue with the rest of the code
} }
const postTomlPath = join(postPath, 'post.toml'); const postTomlPath = join(postPath, 'post.toml')
const contentPath = join(postPath, 'content.md'); const contentPath = join(postPath, 'content.md')
try { try {
const postToml = await readFile(postTomlPath, 'utf-8'); const postToml = await readFile(postTomlPath, 'utf-8')
const content = await readFile(contentPath, 'utf-8'); const content = await readFile(contentPath, 'utf-8')
const metadata = toml.parse(postToml); const metadata = toml.parse(postToml)
posts[`${year}/${directory}`] = { posts[`${year}/${directory}`] = {
metadata, metadata,
content content
}; }
} catch (error) { } catch (error) {
throw new Error(`Error reading post: ${error}`); throw new Error(`Error reading post: ${error}`)
} }
} }
return posts; return posts
}
} }
};
const postsResult = await crawl(); const postsResult = await crawl()
if (!postsResult) throw new Error('No posts found!'); if (!postsResult) throw new Error('No posts found!')
export const posts = postsResult; export const posts = postsResult

View file

@ -1,13 +1,13 @@
import { unified } from 'unified'; import { unified } from 'unified'
import rehypeKatex from 'rehype-katex'; import rehypeKatex from 'rehype-katex'
import rehypeStringify from 'rehype-stringify'; import rehypeStringify from 'rehype-stringify'
import remarkMath from 'remark-math'; import remarkMath from 'remark-math'
import remarkParse from 'remark-parse'; import remarkParse from 'remark-parse'
import remarkRehype from 'remark-rehype'; import remarkRehype from 'remark-rehype'
import remarkGfm from 'remark-gfm'; import remarkGfm from 'remark-gfm'
import remarkGhAlerts from 'remark-gh-alerts'; import remarkGhAlerts from 'remark-gh-alerts'
import remarkSectionize from 'remark-sectionize'; import remarkSectionize from 'remark-sectionize'
import rehypeHighlight from 'rehype-highlight'; import rehypeHighlight from 'rehype-highlight'
export default async (markdown: string) => { export default async (markdown: string) => {
try { try {
@ -23,12 +23,12 @@ export default async (markdown: string) => {
.use(rehypeHighlight) .use(rehypeHighlight)
.use(rehypeStringify) .use(rehypeStringify)
.process(markdown) .process(markdown)
); )
if (typeof html === 'undefined') throw new Error('No content'); if (typeof html === 'undefined') throw new Error('No content')
return html; return html
} catch (e) { } catch (e) {
throw new Error(`Failed to parse markdown: ${e}`); throw new Error(`Failed to parse markdown: ${e}`)
}
} }
};

View file

@ -1,9 +1,9 @@
<script> <script>
import { page } from '$app/stores'; import { page } from '$app/stores'
import Button from '$lib/components/ui/button/button.svelte'; import Button from '$lib/components/ui/button/button.svelte'
import { Home } from 'svelte-radix'; import { Home } from 'svelte-radix'
const error = $page.error ?? { message: 'unknown' }; const error = $page.error ?? { message: 'unknown' }
</script> </script>
<svelte:head> <svelte:head>

View file

@ -47,4 +47,3 @@
</div> </div>
<Footer /> <Footer />
<Footer />

View file

@ -1,9 +1,9 @@
<script lang="ts"> <script lang="ts">
import Socials from '$lib/components/Socials.svelte'; import Socials from '$lib/components/Socials.svelte'
import Button from '$lib/components/ui/button/button.svelte'; import Button from '$lib/components/ui/button/button.svelte'
import * as Card from '$lib/components/ui/card'; import * as Card from '$lib/components/ui/card'
import { ArrowRight, GithubLogo } from 'svelte-radix'; import { ArrowRight, GithubLogo } from 'svelte-radix'
import Typewriter from 'svelte-typewriter'; import Typewriter from 'svelte-typewriter'
</script> </script>
<svelte:head> <svelte:head>

View file

@ -1 +1 @@
export const prerender = true; export const prerender = true

View file

@ -1,5 +1,5 @@
<script> <script>
import UnderConstruction from '$lib/components/UnderConstruction.svelte'; import UnderConstruction from '$lib/components/UnderConstruction.svelte'
</script> </script>
<svelte:head> <svelte:head>

View file

@ -1 +1 @@
export const prerender = true; export const prerender = true

View file

@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import BackToTop from '$lib/components/BackToTop.svelte'; import BackToTop from '$lib/components/BackToTop.svelte'
</script> </script>
<BackToTop /> <BackToTop />

View file

@ -1,8 +1,8 @@
import { posts } from '$lib/utils/crawl'; import { posts } from '$lib/utils/crawl'
import type { PageServerLoad } from './$types'; import type { PageServerLoad } from './$types'
export const load: PageServerLoad = async () => { export const load: PageServerLoad = async () => {
return { return {
posts posts
}; }
}; }

View file

@ -1,26 +1,26 @@
<script lang="ts"> <script lang="ts">
import Archive from '$lib/components/Blog/Archive.svelte'; import Archive from '$lib/components/Blog/Archive.svelte'
import ChevronRight from 'svelte-radix/ChevronRight.svelte'; import ChevronRight from 'svelte-radix/ChevronRight.svelte'
import type { PageData } from './$types.js'; import type { PageData } from './$types.js'
import Coredump from '$lib/assets/Coredump.svelte'; import Coredump from '$lib/assets/Coredump.svelte'
import { fly } from 'svelte/transition'; import { fly } from 'svelte/transition'
import { onMount } from 'svelte'; import { onMount } from 'svelte'
import PostCard from '$lib/components/Blog/PostCard.svelte'; import PostCard from '$lib/components/Blog/PostCard.svelte'
export let data: PageData; export let data: PageData
$: posts = data.posts; $: posts = data.posts
let loaded = false; let loaded = false
onMount(() => { onMount(() => {
loaded = true; loaded = true
}); })
$: postArray = Object.entries(posts).map(([key, value]) => { $: postArray = Object.entries(posts).map(([key, value]) => {
return { slug: key, ...value }; return { slug: key, ...value }
}); })
</script> </script>
<svelte:head> <svelte:head>

Some files were not shown because too many files have changed in this diff Show more