Skip to content

Commit

Permalink
Merge pull request #369 from braden-w/braden-w/whi-147-chore-upgrade-…
Browse files Browse the repository at this point in the history
…svelte-5
  • Loading branch information
braden-w authored Dec 17, 2024
2 parents ab788e9 + d0b1dc8 commit 78e4894
Show file tree
Hide file tree
Showing 87 changed files with 1,755 additions and 1,500 deletions.
19 changes: 16 additions & 3 deletions apps/app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
.DS_Store
node_modules
/build

# Output
.output
.vercel
.netlify
.wrangler
/.svelte-kit
/package
/build

# OS
.DS_Store
Thumbs.db

# Env
.env
.env.*
!.env.example
!.env.test

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
11 changes: 7 additions & 4 deletions apps/app/components.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
{
"$schema": "https://shadcn-svelte.com/schema.json",
"$schema": "https://next.shadcn-svelte.com/schema.json",
"style": "default",
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app.pcss",
"css": "src/app.css",
"baseColor": "slate"
},
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils"
"utils": "$lib/utils",
"ui": "$lib/components/ui",
"hooks": "$lib/hooks"
},
"typescript": true
"typescript": true,
"registry": "https://next.shadcn-svelte.com/registry"
}
32 changes: 16 additions & 16 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,24 @@
},
"devDependencies": {
"@sveltejs/adapter-static": "3.0.2",
"@sveltejs/adapter-vercel": "^5.4.1",
"@sveltejs/kit": "^2.5.20",
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"@tauri-apps/cli": "2.0.0-rc.3",
"@sveltejs/adapter-vercel": "^5.5.2",
"@sveltejs/kit": "^2.12.1",
"@sveltejs/vite-plugin-svelte": "^5.0.2",
"@tauri-apps/cli": "^2.1.0",
"@types/chrome": "^0.0.269",
"autoprefixer": "^10.4.20",
"bits-ui": "1.0.0-next.72",
"clsx": "^2.1.1",
"lucide-svelte": "^0.424.0",
"postcss": "^8.4.47",
"svelte": "5.0.0-next.262",
"svelte-check": "^4.0.4",
"tailwindcss": "^3.4.13",
"tslib": "^2.6.3",
"typescript": "^5.6.2",
"vite": "^5.4.8"
"svelte": "^5.14.2",
"svelte-check": "^4.1.1",
"tailwind-merge": "^2.4.0",
"tailwind-variants": "^0.2.1",
"tailwindcss": "^3.4.16",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.7.2",
"vite": "^6.0.3"
},
"type": "module",
"dependencies": {
Expand All @@ -45,17 +50,12 @@
"@tauri-apps/plugin-sql": "2.0.0-rc.0",
"@tauri-apps/plugin-window-state": "2.0.0-rc.0",
"audio-recorder-polyfill": "^0.4.1",
"bits-ui": "^0.21.13",
"clsx": "^2.1.1",
"cross-env": "^7.0.3",
"effect": "^3.8.4",
"hotkeys-js": "^3.13.7",
"idb": "^8.0.0",
"lucide-svelte": "^0.424.0",
"mode-watcher": "^0.4.1",
"nanoid": "^5.0.7",
"svelte-sonner": "^0.3.27",
"tailwind-merge": "^2.4.0",
"tailwind-variants": "^0.2.1"
"svelte-sonner": "^0.3.27"
}
}
1 change: 0 additions & 1 deletion apps/app/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// export * from '@repo/ui/postcss.config';
export default {
plugins: {
tailwindcss: {},
Expand Down
37 changes: 17 additions & 20 deletions apps/app/src/app.pcss → apps/app/src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,65 +6,62 @@
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;

--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;

--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;

--card: 0 0% 100%;
--card-foreground: 222.2 84% 4.9%;

--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;

--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;

--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;

--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;

--destructive: 0 72.2% 50.6%;
--destructive-foreground: 210 40% 98%;

--ring: 222.2 84% 4.9%;

--radius: 0.5rem;
--sidebar-background: 0 0% 98%;
--sidebar-foreground: 240 5.3% 26.1%;
--sidebar-primary: 240 5.9% 10%;
--sidebar-primary-foreground: 0 0% 98%;
--sidebar-accent: 240 4.8% 95.9%;
--sidebar-accent-foreground: 240 5.9% 10%;
--sidebar-border: 220 13% 91%;
--sidebar-ring: 217.2 91.2% 59.8%;
}

.dark {
--background: 222.2 84% 4.9%;
--foreground: 210 40% 98%;

--muted: 217.2 32.6% 17.5%;
--muted-foreground: 215 20.2% 65.1%;

--popover: 222.2 84% 4.9%;
--popover-foreground: 210 40% 98%;

--card: 222.2 84% 4.9%;
--card-foreground: 210 40% 98%;

--border: 217.2 32.6% 17.5%;
--input: 217.2 32.6% 17.5%;

--primary: 210 40% 98%;
--primary-foreground: 222.2 47.4% 11.2%;

--secondary: 217.2 32.6% 17.5%;
--secondary-foreground: 210 40% 98%;

--accent: 217.2 32.6% 17.5%;
--accent-foreground: 210 40% 98%;

--destructive: 0 62.8% 30.6%;
--destructive-foreground: 210 40% 98%;

--ring: hsl(212.7, 26.8%, 83.9);
--ring: 212.7 26.8% 83.9%;
--sidebar-background: 240 5.9% 10%;
--sidebar-foreground: 240 4.8% 95.9%;
--sidebar-primary: 224.3 76.3% 48%;
--sidebar-primary-foreground: 0 0% 100%;
--sidebar-accent: 240 3.7% 15.9%;
--sidebar-accent-foreground: 240 4.8% 95.9%;
--sidebar-border: 240 3.7% 15.9%;
--sidebar-ring: 217.2 91.2% 59.8%;
}
}

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '@tanstack/svelte-table';

// See https://kit.svelte.dev/docs/types#app
// See https://svelte.dev/docs/kit/types#app.d.ts
// for information about these interfaces
declare global {
namespace App {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import WhisperingButton from '$lib/components/WhisperingButton.svelte';
import { Button } from '$lib/components/ui/button';
import * as Tooltip from '$lib/components/ui/tooltip';
import { Button } from '$lib/components/ui/button/index.js';
import * as Tooltip from '$lib/components/ui/tooltip/index.js';
import { mediaStreamManager } from '$lib/services/MediaRecorderService.svelte';
import { recorder } from '$lib/stores/recorder.svelte';
import { fasterRerecordExplainedDialog } from './FasterRerecordExplainedDialog.svelte';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const fasterRerecordExplainedDialog = (() => {
</script>

<script lang="ts">
import * as Dialog from '$lib/components/ui/dialog';
import * as Dialog from '$lib/components/ui/dialog/index.js';
</script>

<Dialog.Root bind:open={fasterRerecordExplainedDialog.isOpen}>
Expand Down
32 changes: 17 additions & 15 deletions apps/app/src/lib/components/WhisperingButton.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { Button, type Props } from '$lib/components/ui/button';
import * as Tooltip from '$lib/components/ui/tooltip';
import { Button, type Props } from '$lib/components/ui/button/index.js';
import * as Tooltip from '$lib/components/ui/tooltip/index.js';
let {
children,
Expand All @@ -11,16 +11,18 @@ let {
} & Props = $props();
</script>

<Tooltip.Root>
<Tooltip.Trigger asChild let:builder>
<Button builders={[builder]} {...restProps}>
{#if children}
{@render children()}
{/if}
<span class="sr-only">{tooltipText}</span>
</Button>
</Tooltip.Trigger>
<Tooltip.Content>
<p>{tooltipText}</p>
</Tooltip.Content>
</Tooltip.Root>
<Tooltip.Provider>
<Tooltip.Root>
<Tooltip.Trigger>
{#snippet child()}
<Button {...restProps}>
{@render children?.()}
<span class="sr-only">{tooltipText}</span>
</Button>
{/snippet}
</Tooltip.Trigger>
<Tooltip.Content>
<p>{tooltipText}</p>
</Tooltip.Content>
</Tooltip.Root>
</Tooltip.Provider>
95 changes: 74 additions & 21 deletions apps/app/src/lib/components/ui/button/button.svelte
Original file line number Diff line number Diff line change
@@ -1,25 +1,78 @@
<script lang="ts">
import { cn } from '$lib/utils.js';
import { Button as ButtonPrimitive } from 'bits-ui';
import { type Events, type Props, buttonVariants } from './index.js';
<script lang="ts" module>
import type { WithElementRef } from 'bits-ui';
import type {
HTMLAnchorAttributes,
HTMLButtonAttributes,
} from 'svelte/elements';
import { type VariantProps, tv } from 'tailwind-variants';
export const buttonVariants = tv({
base: 'ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
variants: {
variant: {
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
destructive:
'bg-destructive text-destructive-foreground hover:bg-destructive/90',
outline:
'border-input bg-background hover:bg-accent hover:text-accent-foreground border',
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
ghost: 'hover:bg-accent hover:text-accent-foreground',
link: 'text-primary underline-offset-4 hover:underline',
},
size: {
default: 'h-10 px-4 py-2',
sm: 'h-9 rounded-md px-3',
lg: 'h-11 rounded-md px-8',
icon: 'h-10 w-10',
},
},
defaultVariants: {
variant: 'default',
size: 'default',
},
});
export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
type $$Props = Props;
type $$Events = Events;
export type ButtonProps = WithElementRef<HTMLButtonAttributes> &
WithElementRef<HTMLAnchorAttributes> & {
variant?: ButtonVariant;
size?: ButtonSize;
};
</script>

<script lang="ts">
import { cn } from "$lib/utils.js";
let className: $$Props['class'] = undefined;
export let variant: $$Props['variant'] = 'default';
export let size: $$Props['size'] = 'default';
export let builders: $$Props['builders'] = [];
export { className as class };
let {
class: className,
variant = "default",
size = "default",
ref = $bindable(null),
href = undefined,
type = "button",
children,
...restProps
}: ButtonProps = $props();
</script>

<ButtonPrimitive.Root
{builders}
class={cn(buttonVariants({ variant, size, className }))}
type="button"
{...$$restProps}
on:click
on:keydown
>
<slot />
</ButtonPrimitive.Root>
{#if href}
<a
bind:this={ref}
class={cn(buttonVariants({ variant, size, className }))}
{href}
{...restProps}
>
{@render children?.()}
</a>
{:else}
<button
bind:this={ref}
class={cn(buttonVariants({ variant, size, className }))}
{type}
{...restProps}
>
{@render children?.()}
</button>
{/if}
Loading

0 comments on commit 78e4894

Please sign in to comment.