Skip to content

Migration: Svelte 5 #509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 176 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
a434826
[WIP]: migrate completely to svelte 4
BeeMargarida Nov 12, 2024
7faf712
[WIP]: migrate to sveltekit 2
BeeMargarida Nov 12, 2024
9d77c5d
[WIP]: rename all .d.ts files to .ts
BeeMargarida Nov 12, 2024
1f982b1
WIP: ran migration to svelte5 script
BeeMargarida Nov 24, 2024
11d8936
wip: comment pre-commit while it's broken
BeeMargarida Nov 26, 2024
5033f6d
wip: migrate Affix and Anchor componnets
BeeMargarida Nov 26, 2024
ae35e0f
wip: small updates to prettier
BeeMargarida Nov 26, 2024
bd87782
wip: start working on migrating Accordion
BeeMargarida Nov 26, 2024
70f660d
WIP: migrated Accordion, Button and UnstyledButton
BeeMargarida Dec 8, 2024
fcc7410
WIP: migrate ActionIcon
BeeMargarida Dec 8, 2024
53f2c41
WIP: migrate Alert
BeeMargarida Dec 8, 2024
7c28ad4
WIP: migrate AppShell
BeeMargarida Dec 8, 2024
9ced63d
fix: organize inputs for Button
BeeMargarida Dec 8, 2024
b0cc345
fix: migrate AspectRatio
BeeMargarida Dec 8, 2024
94fe0c7
fix: migrate Badge
BeeMargarida Dec 8, 2024
f5d6ce4
fix: migrate Blockquote
BeeMargarida Dec 8, 2024
098e40e
fix: migrate Box
BeeMargarida Dec 8, 2024
dfa9810
fix: migrate Breadcrumbs
BeeMargarida Dec 8, 2024
75bb2dc
fix: migrate UnstyledButton
BeeMargarida Dec 8, 2024
65d4aca
fix: migrate Ripple
BeeMargarida Dec 8, 2024
345e0a8
fix: migrate Burger
BeeMargarida Dec 8, 2024
49fe17e
fix: migrate SvelteUIProvider
BeeMargarida Dec 8, 2024
1bb4099
WIP: delete forward-events
BeeMargarida Dec 8, 2024
00d739c
fix: migrate Flex
BeeMargarida Dec 8, 2024
11ed5f7
fix: migrate Grid
BeeMargarida Dec 8, 2024
63e99bd
fix: migrate Group
BeeMargarida Dec 8, 2024
428bef6
fix: migrate SimpleGrid
BeeMargarida Dec 8, 2024
48c89b5
fix: migrate Space
BeeMargarida Dec 8, 2024
7f9cfdd
fix: migrate Stack
BeeMargarida Dec 8, 2024
4a28efa
fix: small fix to alert typings
BeeMargarida Dec 8, 2024
b8c5cda
fix: migrate IconRenderer
BeeMargarida Dec 8, 2024
6e3c2e7
fix: migrate Inoput
BeeMargarida Dec 8, 2024
bffa2ea
fix: migrate Text
BeeMargarida Dec 8, 2024
3279602
fix: migrate Center
BeeMargarida Dec 8, 2024
13e1184
fix: migrate Checkbox
BeeMargarida Dec 8, 2024
6db01f2
fix: migrate Chip
BeeMargarida Dec 8, 2024
7c89b2e
fix: migrate Code
BeeMargarida Dec 8, 2024
c166279
fix: migrate Collapse
BeeMargarida Dec 8, 2024
e10bdc4
fix: migrate Container
BeeMargarida Dec 8, 2024
0369923
fix: migrate Divider
BeeMargarida Dec 8, 2024
7690b66
fix: migrate Card
BeeMargarida Dec 8, 2024
7ba1f4d
fix: migrate BacgroundImage
BeeMargarida Dec 8, 2024
fcf6008
fix: migrate InputWrapper
BeeMargarida Dec 8, 2024
1ba7dcd
fix: migrate Textarea
BeeMargarida Dec 9, 2024
f0722c2
fix: migrate JsonInput
BeeMargarida Dec 9, 2024
5dc74cc
fix: migrate Kbd
BeeMargarida Dec 9, 2024
b4b097d
wip: migrate Loader
BeeMargarida Dec 27, 2024
a99109a
wip: migrate Mark
BeeMargarida Dec 27, 2024
7f414fe
wip: migrate MediaQuery
BeeMargarida Dec 27, 2024
a8bb529
fix: small updates
BeeMargarida Dec 27, 2024
8d779c1
wip: migrate Menu
BeeMargarida Dec 27, 2024
ad6be7c
fix: update icon renderer stories
BeeMargarida Dec 27, 2024
55a089e
wip: migrate Modal
BeeMargarida Dec 28, 2024
d2d4623
wip: migrate Modal stories
BeeMargarida Dec 28, 2024
6aed3e6
wip: migrate NativeSelect
BeeMargarida Dec 28, 2024
938d2f2
wip: migrate Notification
BeeMargarida Dec 28, 2024
d3b390b
wip: migrate TextInput
BeeMargarida Dec 28, 2024
e179060
wip: migrate NumberInput (still some TODOs to tackle)
BeeMargarida Dec 28, 2024
1fa21c0
wip: migrate ObserverRender (might be deleted in the future, kinda us…
BeeMargarida Dec 28, 2024
4a7b690
wip: migrate Overlay
BeeMargarida Dec 28, 2024
5b22327
wip: migrate Paper
BeeMargarida Dec 28, 2024
025a918
wip: migrate PasswordInput
BeeMargarida Dec 28, 2024
497ad07
wip: migrate Popper
BeeMargarida Dec 28, 2024
5311dc3
wip: migrate Portal
BeeMargarida Dec 28, 2024
9f99094
wip: migrate Progress
BeeMargarida Dec 28, 2024
1201c9e
wip: add missing fix to Progress
BeeMargarida Dec 28, 2024
81f67ea
wip: migrate RadioGroup
BeeMargarida Dec 28, 2024
7422250
wip: migrate Skeleton
BeeMargarida Dec 28, 2024
889fdd1
wip: migrate Switch
BeeMargarida Dec 28, 2024
d86f507
wip: migrate Tabs
BeeMargarida Dec 28, 2024
ac8a482
wip: migrate ThemeIcon
BeeMargarida Dec 28, 2024
56a070b
wip: migrate TimelineIcon
BeeMargarida Dec 28, 2024
0e7e1c1
wip: migrate Title
BeeMargarida Dec 28, 2024
7f458dc
wip: migrate Tooltip
BeeMargarida Dec 28, 2024
3a55fdc
wip: migrate TypographyProvider
BeeMargarida Dec 28, 2024
64b73db
wip: migrate FileUpload
BeeMargarida Dec 28, 2024
8eb89a5
fix: small cleanup
BeeMargarida Dec 28, 2024
e523820
wip: bumped composables to svelte-4
BeeMargarida Dec 28, 2024
b1c2c4e
wip: bumped composables to svelte 5
BeeMargarida Dec 28, 2024
14a6c3a
wip: ran svelte4 migration in svelteui-demos
BeeMargarida Dec 28, 2024
d5758e8
wip: ran sk2 migration in svelteui-demos
BeeMargarida Dec 28, 2024
7921279
wip: ran svelte5 migration in svelteui-demos ( a bunch of @migration-…
BeeMargarida Dec 28, 2024
769f291
wip: ran svelte5 migration script in svelteui-composables
BeeMargarida Dec 28, 2024
cf1c9b4
wip: ran svelte5 migration script in svelteui-tests
BeeMargarida Dec 28, 2024
89eff45
wip: ran svelte4 migration script in svelteui-dates
BeeMargarida Dec 28, 2024
5e2649e
wip: ran sk2 migration script in svelteui-dates
BeeMargarida Dec 28, 2024
5dfc73b
wip: ran svelte5 migration script in svelteui-dates
BeeMargarida Dec 28, 2024
00db0cb
wip: ran svelte4 migration script in svelteui-motion
BeeMargarida Dec 28, 2024
a49d564
wip: ran sk2 migration script in svelteui-motion
BeeMargarida Dec 28, 2024
90db792
wip: ran svelte5 migration script in svelteui-motion
BeeMargarida Dec 28, 2024
e2b5a09
wip: ran svelte4 migration script in svelteui-preprocessors
BeeMargarida Dec 28, 2024
c504273
wip: ran sk2 migration script in svelteui-preprocessors
BeeMargarida Dec 28, 2024
0b5c407
wip: ran svelte5 migration script in svelteui-preprocessors
BeeMargarida Dec 28, 2024
4fb8edf
wip: ran svelte4 migration script in svelteui-prism
BeeMargarida Dec 28, 2024
ad73355
wip: ran sk2 migration script in svelteui-prism
BeeMargarida Dec 28, 2024
21e9f6c
wip: ran svelte5 migration script in svelteui-prism
BeeMargarida Dec 28, 2024
f95bf72
wip: ran svelte4 migration script in docs
BeeMargarida Dec 28, 2024
5ce5448
wip: ran sk2 migration script in docs
BeeMargarida Dec 28, 2024
420faa0
wip: ran svelte5 migration script in docs (NOT TESTED)
BeeMargarida Dec 28, 2024
0e70209
wip: fixes to docs TopBar
BeeMargarida Dec 30, 2024
54997aa
wip: migrate TopBar
BeeMargarida Dec 30, 2024
3f89ac4
wip: reinstall dependencies and set peer dep svelte to >= 5
BeeMargarida Dec 30, 2024
1e1e1c3
fix: small fixes
BeeMargarida Dec 30, 2024
675d71d
wip: cleanup some comments
BeeMargarida Dec 30, 2024
605ba9f
wip: finish migrating NumberInput
BeeMargarida Dec 30, 2024
773279b
wip: some updates to tsconfigs
BeeMargarida Dec 30, 2024
b7d6f36
wip: some updates to tsconfigs
BeeMargarida Dec 30, 2024
69b4294
wip: add missing props in alert props type
BeeMargarida Dec 30, 2024
2a30a81
wip: started migrating demos
BeeMargarida Dec 30, 2024
148d3ec
wip: finished migrating all the demos
BeeMargarida Dec 30, 2024
1e90e4d
wip: cleanup demos components
BeeMargarida Dec 30, 2024
f2abfc2
wip: migrate package date components
BeeMargarida Dec 30, 2024
1c2d126
wip: remove event dispatcher from Configurator controls (configurator…
BeeMargarida Dec 30, 2024
9f5721c
fix: motion types
BeeMargarida Dec 30, 2024
e5da3d7
wip: tweaks to Prism package
BeeMargarida Dec 30, 2024
e2820ab
wip: comment out preprocessor code, is fully broken
BeeMargarida Dec 30, 2024
b1abeb8
fix: tsconfig for dates
BeeMargarida Dec 30, 2024
12c5521
fix: test type
BeeMargarida Dec 30, 2024
02dec85
fix: remove dead code
Jan 1, 2025
eaf5e3c
wip: Small fixes to the docs components
Jan 2, 2025
1cf6169
fix: stitches patch to fix typescript error
BeeMargarida Jan 2, 2025
a82edef
wip: fix demos content
BeeMargarida Jan 2, 2025
0c9058d
wip: small fixes to the components
BeeMargarida Jan 2, 2025
e2146a7
wip: small fixes to the components
BeeMargarida Jan 2, 2025
72c1f66
wip: small fixes to the demos
BeeMargarida Jan 2, 2025
d8fb153
wip: fixes to docs components
BeeMargarida Jan 2, 2025
87a4f3f
wip: small fixes
BeeMargarida Jan 2, 2025
fb93ccc
wip: updates and fixes to docs
BeeMargarida Jan 2, 2025
4157584
fix: fix to context usage in Accordion
BeeMargarida Jan 2, 2025
598dd06
wip: rename CodeDemo prop from toggle to codeVisible
BeeMargarida Jan 2, 2025
8b083b6
fix: Textarea bindable default value
BeeMargarida Jan 2, 2025
848c25a
wip: rename CodeDemo prop from codeVisible to canShowCode
BeeMargarida Jan 2, 2025
c91a6ae
fix: small fix to Switch missing props
BeeMargarida Jan 2, 2025
8a51211
fix: Configurator type errors and missing reactivity
BeeMargarida Jan 2, 2025
0e87531
fix: Fix to Group docs
BeeMargarida Jan 2, 2025
91cda6b
fix: small fixes to several components
BeeMargarida Jan 2, 2025
a01f88c
docs: small fixes to several docs
BeeMargarida Jan 2, 2025
d3e98d0
fix: typo
BeeMargarida Jan 2, 2025
1424384
wip: ran format command
BeeMargarida Jan 2, 2025
a7a9f96
feat: update eslint to 9 and update the config
BeeMargarida Jan 2, 2025
3e33d3e
fix: some eslint errors
BeeMargarida Jan 2, 2025
2960fe1
fix: formatting
BeeMargarida Jan 2, 2025
41da722
fix: format code
BeeMargarida Jan 2, 2025
bde1328
wip: apply reactive context approach using in Accordion
Jan 6, 2025
136a2c4
feat: upgrade composables return type and events
Jan 6, 2025
36a7f19
fix: solve lint errors
Jan 6, 2025
8c19c35
fix: ignore svelte compilation error to allow Prism functionality
Jan 6, 2025
827730d
wip: fix linting errors
Jan 6, 2025
e2846f9
fix: change action types
Jan 6, 2025
8d789a0
fix: update forward actions types
Jan 6, 2025
8adb129
fix: solve linting errors in demos package
Jan 6, 2025
30fdbf8
wip: solve some linting errors
Jan 7, 2025
e544132
fix: lint errors
Jan 8, 2025
3cfe083
chore: enable pre commit hook again
Jan 8, 2025
f45cb7e
fix: fix unit/intg test setup and fix tests
Jan 8, 2025
88aa6a3
wip: composables tests still not working
Jan 8, 2025
06ff48f
fix: remove errors related to deprecated tsconfig - now moved to svel…
BeeMargarida Jan 11, 2025
7dd4e06
wip: small fixes to ChipGroup component + demos
BeeMargarida Jan 11, 2025
46cb598
fix: small demos fixes
BeeMargarida Jan 26, 2025
8692475
fix: small errors on components
BeeMargarida Jan 26, 2025
74774c9
docs: update to docs
BeeMargarida Jan 26, 2025
8effcd9
fix: copy working in Prism
BeeMargarida Jan 26, 2025
7eae226
fix: popper and tooltip problems
Feb 12, 2025
cfeeebb
fix: Menu
Feb 12, 2025
e58a96b
fix: delete vitest setup for composables
Feb 12, 2025
4b92950
fix: configurator forcing children
Mar 2, 2025
8df52df
fix: TextArea missing prop
Mar 2, 2025
ac8522a
fix: event handlers
Mar 11, 2025
4da9d02
fix: default value for element bindable must be null
Mar 11, 2025
0f58f19
chore: bump node version in CI
Mar 11, 2025
9653ef8
fix: icons
BeeMargarida Apr 22, 2025
c3bf3ef
fix: small bindable errors
BeeMargarida Apr 22, 2025
1f913a8
fix: JsonInput icon and docs
BeeMargarida Apr 22, 2025
dfaad27
fix: accordion default value and code snippets
BeeMargarida Apr 22, 2025
fb1f226
fix: notification icon
BeeMargarida Apr 22, 2025
7924b30
fix: modal opened by default
BeeMargarida Apr 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

1 change: 0 additions & 1 deletion .eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: npm

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: Actions
strategy:
matrix:
node-version: [18]
node-version: [20]
runs-on: ubuntu-latest
container:
image: node:${{ matrix.node-version }}
Expand Down
15 changes: 8 additions & 7 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
"radix-icons-svelte": "1.2.1"
},
"devDependencies": {
"@sveltejs/adapter-static": "2.0.2",
"@sveltejs/kit": "1.16.3",
"mdsvex": "0.10.6",
"svelte": "3.59.1",
"svelte-check": "3.3.2",
"@sveltejs/adapter-static": "^3.0.0",
"@sveltejs/kit": "^2.5.27",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"mdsvex": "0.12.3",
"svelte": "^5.0.0",
"svelte-check": "^4.0.0",
"tslib": "2.5.0",
"typescript": "5.0.4",
"vite": "4.3.5"
"typescript": "^5.5.0",
"vite": "^5.4.4"
}
}
2 changes: 1 addition & 1 deletion apps/docs/src/app.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
103 changes: 64 additions & 39 deletions apps/docs/src/lib/components/Banner.svelte
Original file line number Diff line number Diff line change
@@ -1,70 +1,95 @@
<script lang="ts">
import { run } from 'svelte/legacy';

// @ts-nocheck
import { createStyles, Paper, Text } from '@svelteuidev/core';
import { createStyles, Paper, Text, type SvelteUITheme } from '@svelteuidev/core';
import { onMount } from 'svelte';
import { ArrowRight } from 'radix-icons-svelte';

export let href = undefined;
export let color = 'white';
export let align = 'center';
export let icon = ArrowRight;
export let iconProps = {};
export let themeColors = true;
interface Props {
href?: any;
color?: string;
align?: string;
icon?: any;
iconProps?: any;
themeColors?: boolean;
children?: import('svelte').Snippet;
}

type BannerStyleParams = {
align: string;
themeColors: boolean;
};

let {
href = undefined,
color = 'white',
align = 'center',
icon = ArrowRight,
iconProps = {},
themeColors = true,
children
}: Props = $props();

let element;
let element: HTMLDivElement | undefined = $state(undefined);
const override = { bc: '$dark700' };

$: onMount(() => {
const container = document.querySelector('.container .title');
onMount(() => {
const container = document.querySelector('.container .title') as HTMLElement;
if (!container) return;
container.style.paddingTop = '4rem';
});

const useStyles = createStyles((_, { align, themeColors }) => ({
root: {
position: 'absolute',
top: 60,
left: 0,
right: 0,
width: '100vw',
textAlign: align
},
wrapper: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
gap: '$5',
color: themeColors ? `$${color}` : color
},
title: {
color: themeColors ? `$${color}` : color
},
icon: {
width: '$10',
height: '$10'
}
}));
const useStyles = createStyles(
(_theme: SvelteUITheme, { align, themeColors }: BannerStyleParams) => ({
root: {
position: 'absolute',
top: 60,
left: 0,
right: 0,
width: '100vw',
textAlign: align
},
wrapper: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
gap: '$5',
color: themeColors ? `$${color}` : color
},
title: {
color: themeColors ? `$${color}` : color
},
icon: {
width: '$10',
height: '$10'
}
})
);

$: ({ classes } = useStyles({ align, themeColors }));
let { classes } = $derived(useStyles({ align, themeColors }));
</script>

{#if href}
<a {href}>
<Paper bind:element class={classes.root} {override} radius="xs">
{@const IconHref = icon}
<div class={classes.wrapper}>
<Text class={classes.title} weight="bold" tracking="tight" size="lg">
<slot />
{@render children?.()}
</Text>
<svelte:component this={icon} class={classes.icon} {...iconProps} />
<IconHref class={classes.icon} {...iconProps} />
</div>
</Paper>
</a>
{:else}
<Paper bind:element class={classes.root} {override} radius="xs">
{@const Icon = icon}
<div class={classes.wrapper}>
<Text class={classes.title} weight="bold" tracking="tight" size="lg">
<slot />
{@render children?.()}
</Text>
<svelte:component this={icon} class={classes.icon} {...iconProps} />
<Icon class={classes.icon} {...iconProps} />
</div>
</Paper>
{/if}
35 changes: 23 additions & 12 deletions apps/docs/src/lib/components/BottomNav.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script lang="ts">
import { run } from 'svelte/legacy';

import { Sibling } from '@ui';
import { Group, Divider, Stack } from '@svelteuidev/core';
import { useViewportSize } from '@svelteuidev/composables';
Expand All @@ -8,23 +10,32 @@
next: string;
};

export let slug: DataType,
title: DataType,
group: DataType,
both = false,
type = 'next';
interface Props {
slug: DataType;
title: DataType;
group: DataType;
both?: boolean;
type?: string;
}

let { slug, title, group, both = false, type = 'next' }: Props = $props();

const data = { slug, title, package: group };
const viewport = useViewportSize();
let dataLeft, dataRight;
let dataLeft = $state(),
dataRight = $state();

$: isObj = typeof slug === 'object' && typeof title === 'object' && typeof group === 'object';
let isObj = $derived(
typeof slug === 'object' && typeof title === 'object' && typeof group === 'object'
);

$: if (isObj && both) {
dataLeft = { slug: slug.prev, title: title.prev, package: group.prev };
dataRight = { slug: slug.next, title: title.next, package: group.next };
}
$: ({ width } = $viewport);
run(() => {
if (isObj && both) {
dataLeft = { slug: slug.prev, title: title.prev, package: group.prev };
dataRight = { slug: slug.next, title: title.next, package: group.next };
}
});
let { width } = $derived($viewport);
</script>

<Divider size="lg" override={{ mt: '$20 !important' }} />
Expand Down
19 changes: 15 additions & 4 deletions apps/docs/src/lib/components/CodeBlock.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
import { Box, Button } from '@svelteuidev/core';
import { clipboard } from '@svelteuidev/composables';

export let message = '';
export let copy = false;
interface Props {
message?: string;
copy?: boolean;
children?: import('svelte').Snippet;
}

let { message = '', copy = false, children }: Props = $props();

let copied = false;
let copied = $state(false);

function isCopied() {
copied = true;
Expand All @@ -16,7 +21,13 @@
</script>

<Box css={{ position: 'relative', mx: 0, my: '25px' }} root="pre">
<code><slot>Code</slot></code>
<code>
{#if children}
{@render children()}
{:else}
Code
{/if}
</code>
{#if copy}
<Button
variant="default"
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/src/lib/components/Device.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script context="module" lang="ts">
<script module lang="ts">
import { writable, derived } from 'svelte/store';

/**
Expand Down Expand Up @@ -36,13 +36,13 @@
*/
export const mouse = writable({ x: 0, y: 0 });

const mouseMove = (e) => {
const mouseMove = (e: MouseEvent) => {
mouse.update(() => ({ x: e.clientX, y: e.clientY }));
};
</script>

<svelte:window
on:mousemove={(e) => mouseMove(e)}
onmousemove={(e) => mouseMove(e)}
bind:innerHeight={$screenH}
bind:innerWidth={$screenW}
bind:scrollY={$scrollY}
Expand Down
21 changes: 16 additions & 5 deletions apps/docs/src/lib/components/Heading.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,23 @@
import { GithubLogo, Pencil1, Cube } from 'radix-icons-svelte';
import { screenW } from '$lib/components';

export let title: string,
interface Props {
title: string;
description?: boolean;
docs?: boolean;
importCode?: string;
source?: boolean;
packageGroup?: boolean;
}

let {
title,
description = false,
docs = false,
importCode = '',
source = false,
packageGroup = false;
packageGroup = false
}: Props = $props();
const links = {
github: 'https://github.com/svelteuidev/svelteui/blob/main/packages/',
docs: 'https://github.com/svelteuidev/svelteui/blob/main/apps/docs/src/routes/',
Expand All @@ -26,7 +37,7 @@
'@md': { code: { fontSize: '$md' } }
};

let copied = false;
let copied = $state(false);
function onCopy() {
copied = true;
setTimeout(() => (copied = false), 1000);
Expand Down Expand Up @@ -55,11 +66,11 @@
closeDelay={200}
withArrow
position={$screenW < 500 ? 'top' : 'right'}
label={copied ? 'Copied' : 'Copy'}
labelComponent={copied ? 'Copied' : 'Copy'}
color={copied ? 'green' : 'gray'}
>
<Box css={importStyles}>
<code use:clipboard={importCode} on:copy={onCopy}>
<code use:clipboard={importCode} oncopy={onCopy}>
{importCode}
</code>
</Box>
Expand Down
8 changes: 6 additions & 2 deletions apps/docs/src/lib/components/MinorHeading.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<script lang="ts">
export let title = 'Title';
export let date: string;
import { colorScheme, Stack, Text, Group, Center } from '@svelteuidev/core';
import { Calendar } from 'radix-icons-svelte';
interface Props {
title?: string;
date: string;
}

let { title = 'Title', date }: Props = $props();
</script>

<Stack
Expand Down
15 changes: 12 additions & 3 deletions apps/docs/src/lib/components/NavigationTitle.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<script>
<script lang="ts">
import { UnstyledButton, createStyles } from '@svelteuidev/core';
interface Props {
children?: import('svelte').Snippet;
}

let { children }: Props = $props();

const useStyles = createStyles(() => ({
root: {
Expand All @@ -14,11 +19,15 @@
}
}));

$: ({ classes } = useStyles());
let { classes } = $derived(useStyles());
</script>

<UnstyledButton class={classes.root} on:click>
<span class={classes.title}>
<slot>Title Here</slot>
{#if children}
{@render children()}
{:else}
Title Here
{/if}
</span>
</UnstyledButton>
Loading
Loading