Skip to content

Commit

Permalink
Refactored ui folders
Browse files Browse the repository at this point in the history
  • Loading branch information
Acumen-Desktop committed Feb 10, 2025
1 parent a3b58a6 commit df0a80a
Show file tree
Hide file tree
Showing 279 changed files with 84 additions and 85 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ ui-svelte/.env.production.local

env.ts
ui-svelte/src-main/lib/env.ts

# windsurf rules
.windsurfrules
6 changes: 3 additions & 3 deletions _OLD/OLDpage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import { onMount } from "svelte";
import { page } from "$app/stores";
import { goto } from "$app/navigation";
import GooseLogo from "$lib/components/compound/GooseLogo.svelte";
import { Button } from "$lib/components/shadcn-ui/button";
import { Progress } from "$lib/components/shadcn-ui/progress";
import GooseLogo from "$lib/components/ui-compound/GooseLogo.svelte";
import { Button } from "$lib/components/ui-shadcn/button";
import { Progress } from "$lib/components/ui-shadcn/progress";
let initialQuery = $page.url.searchParams.get("initialQuery") || "";
let isLoading = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import { createEventDispatcher } from "svelte";
import { Button } from "$lib/components/shadcn-ui/button";
import { Card, CardContent } from "$lib/components/shadcn-ui/card";
import { ScrollArea } from "$lib/components/shadcn-ui/scroll-area";
import { Button } from "$lib/components/ui-shadcn/button";
import { Card, CardContent } from "$lib/components/ui-shadcn/card";
import { ScrollArea } from "$lib/components/ui-shadcn/scroll-area";
import type { HTMLButtonAttributes } from "svelte/elements";
type Provider = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ src/

```svelte
<script lang="ts">
import { Button } from "$lib/components/shadcn-ui/button";
import { Card } from "$lib/components/shadcn-ui/card";
import { Button } from "$lib/components/ui-shadcn/button";
import { Card } from "$lib/components/ui-shadcn/card";
let { variant = "default" } = $props();
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ui-svelte/
│ │ ├── basic-ui/ # Atomic components
│ │ ├── compound/ # Reusable compound components
│ │ ├── features/ # Complex feature components
│ │ └── shadcn-ui/ # Shadcn components
│ │ └── ui-shadcn/ # Shadcn components
│ ├── stores/ # Svelte stores
│ └── utils/ # Utility functions
```
Expand All @@ -41,7 +41,7 @@ ui-svelte/

1. **Route Components** (`routes/`): Full pages/features
2. **Feature Components** (`lib/components/features/`): Complex, business-logic heavy components
3. **Compound Components** (`lib/components/compound/`): Reusable combinations of basic components
3. **Compound Components** (`lib/components/ui-compound/`): Reusable combinations of basic components
4. **Basic UI Components** (`lib/components/basic-ui/`): Atomic UI components

### Migration Status
Expand All @@ -58,7 +58,7 @@ ui-svelte/
- React basic components: `ui/desktop/src/components/ui`
- React compound components: `ui/desktop/src/components`
- React Icons moved to: `ui-svelte/src-renderer/lib/assets/icons-svg` and converted to svg files.
- Svelte 5 components: `ui-svelte/src-renderer/lib/components/shadcn-ui`
- Svelte 5 components: `ui-svelte/src-renderer/lib/components/ui-shadcn`
- Raw SVG icons moved to: `ui-svelte/src-renderer/lib/assets/icons-svg`

## SVG Conversion Process
Expand Down Expand Up @@ -143,7 +143,7 @@ Status:

- Lessons:
- Using shadcn-svelte's Card component instead
- No need to recreate as it's part of shadcn-ui
- No need to recreate as it's part of ui-shadcn

- [] select-styles.ts
- Status: Not a component, just styles
Expand Down
2 changes: 1 addition & 1 deletion ui-svelte/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils",
"ui": "$lib/components/shadcn-ui",
"ui": "$lib/components/ui-shadcn",
"hooks": "$lib/hooks"
},
"typescript": true,
Expand Down
2 changes: 1 addition & 1 deletion ui-svelte/src-renderer/+error.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { page } from "$app/state";
import { Button } from "$lib/components/shadcn-ui/button";
import { Button } from "$lib/components/ui-shadcn/button";
import { goto } from "$app/navigation";
</script>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { Button } from "$lib/components/shadcn-ui/button";
import { Button } from "$lib/components/ui-shadcn/button";
import { createEventDispatcher } from "svelte";
import type { ChatInputProps } from "$lib/types/components";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { Card } from "$lib/components/shadcn-ui/card";
import { Card } from "$lib/components/ui-shadcn/card";
import { cn } from "$lib/utils";
import ToolInvocations from "./ToolInvocations.svelte";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { Card } from "$lib/components/shadcn-ui/card";
import { Card } from "$lib/components/ui-shadcn/card";
interface ToolInvocation {
toolCallId: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { Button } from "$lib/components/shadcn-ui/button";
import { Card } from "$lib/components/shadcn-ui/card";
import { Button } from "$lib/components/ui-shadcn/button";
import { Card } from "$lib/components/ui-shadcn/card";
interface Provider {
id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
DialogTitle,
DialogDescription,
DialogFooter,
} from "$lib/components/shadcn-ui/dialog";
import { Button } from "$lib/components/shadcn-ui/button";
import { Input } from "$lib/components/shadcn-ui/input";
import { Label } from "$lib/components/shadcn-ui/label";
} from "$lib/components/ui-shadcn/dialog";
import { Button } from "$lib/components/ui-shadcn/button";
import { Input } from "$lib/components/ui-shadcn/input";
import { Label } from "$lib/components/ui-shadcn/label";
import { required_keys, type Provider } from "$lib/config/providers";
let {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { cn } from "$lib/utils";
import Card from "$lib/components/shadcn-ui/card/card.svelte";
import Card from "$lib/components/ui-shadcn/card/card.svelte";
let {
isOpen = $bindable(false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
const sizes: Sizes = {
default: {
frame: "w-16 h-16",
rain: "w-32 h-32",
rain: "w-[275px] h-[275px]",
goose: "w-16 h-16",
},
small: {
frame: "w-8 h-8",
rain: "w-16 h-16",
rain: "w-[150px] h-[150px]",
goose: "w-8 h-8",
},
};
</script>

<div class="{className} {sizes[size].frame} relative overflow-visible">
<div class="{className} {sizes[size].frame} relative overflow-hidden">
<img
src={goose}
alt="Goose"
class="{sizes[size]
.goose} absolute left-0 bottom-0 z-10 dark:invert dark:brightness-90"
/>
<div class="absolute inset-0 overflow-visible">
<div class="absolute inset-0 overflow-visible z-20">
<svg
class="{sizes[size]
.rain} absolute left-1/2 -translate-x-1/2 animate-[wind_2s_linear_infinite] dark:invert dark:brightness-90"
class="{sizes[size].rain} absolute left-0 bottom-0 animate-wind dark:invert dark:brightness-90"
style="transform: translate(100%, -100%);"
viewBox="0 0 103 103"
fill="none"
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -397,16 +397,11 @@
}
@keyframes wind {
0% {
opacity: 0;
transform: translate(100%, -100%);
}
50% {
opacity: 1;
}
100% {
opacity: 0;
transform: translate(-100%, 100%);
}
0% { transform: translate(100%, -100%); }
100% { transform: translate(-100%, 100%); }
}
.animate-wind {
animation: wind 3s linear infinite;
}
</style>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
import { buttonVariants } from "$lib/components/shadcn-ui/button/index.js";
import { buttonVariants } from "$lib/components/ui-shadcn/button/index.js";
import { cn } from "$lib/utils.js";
let {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
import { buttonVariants } from "$lib/components/shadcn-ui/button/index.js";
import { buttonVariants } from "$lib/components/ui-shadcn/button/index.js";
import { cn } from "$lib/utils.js";
let {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { buttonVariants } from "$lib/components/shadcn-ui/button/index.js";
import { buttonVariants } from "$lib/components/ui-shadcn/button/index.js";
import { cn } from "$lib/utils.js";
import { Calendar as CalendarPrimitive } from "bits-ui";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { Calendar as CalendarPrimitive } from "bits-ui";
import ChevronRight from "lucide-svelte/icons/chevron-right";
import { buttonVariants } from "$lib/components/shadcn-ui/button/index.js";
import { buttonVariants } from "$lib/components/ui-shadcn/button/index.js";
import { cn } from "$lib/utils.js";
let {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { Calendar as CalendarPrimitive } from "bits-ui";
import ChevronLeft from "lucide-svelte/icons/chevron-left";
import { buttonVariants } from "$lib/components/shadcn-ui/button/index.js";
import { buttonVariants } from "$lib/components/ui-shadcn/button/index.js";
import { cn } from "$lib/utils.js";
let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import {
Button,
type Props,
} from "$lib/components/shadcn-ui/button/index.js";
} from "$lib/components/ui-shadcn/button/index.js";
let {
ref = $bindable(null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import {
Button,
type Props,
} from "$lib/components/shadcn-ui/button/index.js";
} from "$lib/components/ui-shadcn/button/index.js";
let {
ref = $bindable(null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
} from "bits-ui";
import type { Snippet } from "svelte";
import Command from "./command.svelte";
import * as Dialog from "$lib/components/shadcn-ui/dialog/index.js";
import * as Dialog from "$lib/components/ui-shadcn/dialog/index.js";
let {
open = $bindable(false),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import * as Button from "$lib/components/shadcn-ui/button/index.js";
import * as Button from "$lib/components/ui-shadcn/button/index.js";
let { ref = $bindable(null), ...restProps }: Button.Props = $props();
</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import type { WithoutChild } from "bits-ui";
import * as FormPrimitive from "formsnap";
import { Label } from "$lib/components/shadcn-ui/label/index.js";
import { Label } from "$lib/components/ui-shadcn/label/index.js";
import { cn } from "$lib/utils.js";
let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import {
type Props,
buttonVariants,
} from "$lib/components/shadcn-ui/button/index.js";
} from "$lib/components/ui-shadcn/button/index.js";
let {
ref = $bindable(null),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { Pagination as PaginationPrimitive } from "bits-ui";
import ChevronRight from "lucide-svelte/icons/chevron-right";
import { buttonVariants } from "$lib/components/shadcn-ui/button/index.js";
import { buttonVariants } from "$lib/components/ui-shadcn/button/index.js";
import { cn } from "$lib/utils.js";
let {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { Pagination as PaginationPrimitive } from "bits-ui";
import ChevronLeft from "lucide-svelte/icons/chevron-left";
import { buttonVariants } from "$lib/components/shadcn-ui/button/index.js";
import { buttonVariants } from "$lib/components/ui-shadcn/button/index.js";
import { cn } from "$lib/utils.js";
let {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
import { buttonVariants } from "$lib/components/shadcn-ui/button/index.js";
import { buttonVariants } from "$lib/components/ui-shadcn/button/index.js";
import { cn } from "$lib/utils.js";
let {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
import ChevronRight from "lucide-svelte/icons/chevron-right";
import { buttonVariants } from "$lib/components/shadcn-ui/button/index.js";
import { buttonVariants } from "$lib/components/ui-shadcn/button/index.js";
import { cn } from "$lib/utils.js";
let {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
import ChevronLeft from "lucide-svelte/icons/chevron-left";
import { buttonVariants } from "$lib/components/shadcn-ui/button/index.js";
import { buttonVariants } from "$lib/components/ui-shadcn/button/index.js";
import { cn } from "$lib/utils.js";
let {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import type { Separator as SeparatorPrimitive } from "bits-ui";
import { Separator } from "$lib/components/shadcn-ui/separator/index.js";
import { Separator } from "$lib/components/ui-shadcn/separator/index.js";
import { cn } from "$lib/utils.js";
let {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import type { ComponentProps } from "svelte";
import { Input } from "$lib/components/shadcn-ui/input/index.js";
import { Input } from "$lib/components/ui-shadcn/input/index.js";
import { cn } from "$lib/utils.js";
let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</script>

<script lang="ts">
import * as Tooltip from "$lib/components/shadcn-ui/tooltip/index.js";
import * as Tooltip from "$lib/components/ui-shadcn/tooltip/index.js";
import { cn } from "$lib/utils.js";
import {
mergeProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { Skeleton } from "$lib/components/shadcn-ui/skeleton/index.js";
import { Skeleton } from "$lib/components/ui-shadcn/skeleton/index.js";
import { cn } from "$lib/utils.js";
import type { WithElementRef } from "bits-ui";
import type { HTMLAttributes } from "svelte/elements";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import * as Tooltip from "$lib/components/shadcn-ui/tooltip/index.js";
import * as Tooltip from "$lib/components/ui-shadcn/tooltip/index.js";
import { cn } from "$lib/utils.js";
import type { WithElementRef } from "bits-ui";
import type { HTMLAttributes } from "svelte/elements";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { Separator } from "$lib/components/shadcn-ui/separator/index.js";
import { Separator } from "$lib/components/ui-shadcn/separator/index.js";
import { cn } from "$lib/utils.js";
import type { ComponentProps } from "svelte";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { Button } from "$lib/components/shadcn-ui/button/index.js";
import { Button } from "$lib/components/ui-shadcn/button/index.js";
import { cn } from "$lib/utils.js";
import PanelLeft from "lucide-svelte/icons/panel-left";
import type { ComponentProps } from "svelte";
Expand Down
Loading

0 comments on commit df0a80a

Please sign in to comment.