Skip to content

Commit

Permalink
Organize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
OrigamingWasTaken committed Oct 5, 2024
1 parent 45b4dc2 commit 99d837f
Show file tree
Hide file tree
Showing 36 changed files with 174 additions and 266 deletions.
41 changes: 14 additions & 27 deletions frontend/src/lib/components/ui/alert-dialog/index.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,27 @@
import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';

import Title from './alert-dialog-title.svelte';
import Action from './alert-dialog-action.svelte';
import Cancel from './alert-dialog-cancel.svelte';
import Portal from './alert-dialog-portal.svelte';
import Content from './alert-dialog-content.svelte';
import Description from './alert-dialog-description.svelte';
import Footer from './alert-dialog-footer.svelte';
import Header from './alert-dialog-header.svelte';
import Overlay from './alert-dialog-overlay.svelte';
import Content from './alert-dialog-content.svelte';
import Description from './alert-dialog-description.svelte';
import Portal from './alert-dialog-portal.svelte';
import Title from './alert-dialog-title.svelte';

const Root = AlertDialogPrimitive.Root;
const Trigger = AlertDialogPrimitive.Trigger;

export {
Root,
Title,
Action,
Cancel,
Portal,
Footer,
Header,
Trigger,
Overlay,
Content,
Description,
//
Root as AlertDialog,
Title as AlertDialogTitle,
Action as AlertDialogAction,
Cancel as AlertDialogCancel,
Portal as AlertDialogPortal,
Footer as AlertDialogFooter,
Header as AlertDialogHeader,
Trigger as AlertDialogTrigger,
Overlay as AlertDialogOverlay,
Content as AlertDialogContent,
Description as AlertDialogDescription,
Action,
//
Root as AlertDialog, Action as AlertDialogAction,
Cancel as AlertDialogCancel, Content as AlertDialogContent,
Description as AlertDialogDescription, Footer as AlertDialogFooter,
Header as AlertDialogHeader, Overlay as AlertDialogOverlay, Portal as AlertDialogPortal, Title as AlertDialogTitle, Trigger as AlertDialogTrigger, Cancel, Content,
Description, Footer,
Header, Overlay, Portal, Root,
Title, Trigger
};

14 changes: 6 additions & 8 deletions frontend/src/lib/components/ui/alert/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type VariantProps, tv } from 'tailwind-variants';

import Root from './alert.svelte';
import Description from './alert-description.svelte';
import Title from './alert-title.svelte';
import Root from './alert.svelte';

export const alertVariants = tv({
base: 'relative w-full rounded-lg border p-4 [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground',
Expand All @@ -24,11 +24,9 @@ export type Variant = VariantProps<typeof alertVariants>['variant'];
export type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';

export {
Root,
Description,
Title,
//
Root as Alert,
Description as AlertDescription,
Title as AlertTitle,
//
Root as Alert,
Description as AlertDescription,
Title as AlertTitle, Description, Root, Title
};

29 changes: 12 additions & 17 deletions frontend/src/lib/components/ui/breadcrumb/index.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
import Root from './breadcrumb.svelte';
import Ellipsis from './breadcrumb-ellipsis.svelte';
import Item from './breadcrumb-item.svelte';
import Separator from './breadcrumb-separator.svelte';
import Link from './breadcrumb-link.svelte';
import List from './breadcrumb-list.svelte';
import Page from './breadcrumb-page.svelte';
import Separator from './breadcrumb-separator.svelte';
import Root from './breadcrumb.svelte';

export {
Root,
Ellipsis,
Item,
Separator,
Link,
List,
Page,
//
Root as Breadcrumb,
Ellipsis as BreadcrumbEllipsis,
Item as BreadcrumbItem,
Separator as BreadcrumbSeparator,
Link as BreadcrumbLink,
List as BreadcrumbList,
Page as BreadcrumbPage,
//
Root as Breadcrumb,
Ellipsis as BreadcrumbEllipsis,
Item as BreadcrumbItem, Link as BreadcrumbLink,
List as BreadcrumbList,
Page as BreadcrumbPage, Separator as BreadcrumbSeparator, Ellipsis,
Item, Link,
List,
Page, Root, Separator
};

13 changes: 4 additions & 9 deletions frontend/src/lib/components/ui/button/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type VariantProps, tv } from 'tailwind-variants';
import type { Button as ButtonPrimitive } from 'bits-ui';
import { type VariantProps, tv } from 'tailwind-variants';
import Root from './button.svelte';

const buttonVariants = tv({
Expand Down Expand Up @@ -37,12 +37,7 @@ type Props = ButtonPrimitive.Props & {
type Events = ButtonPrimitive.Events;

export {
Root,
type Props,
type Events,
//
Root as Button,
type Props as ButtonProps,
type Events as ButtonEvents,
buttonVariants,
//
Root as Button, Root, buttonVariants, type Events as ButtonEvents, type Props as ButtonProps, type Events, type Props
};

25 changes: 11 additions & 14 deletions frontend/src/lib/components/ui/card/index.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
import Root from './card.svelte';
import Content from './card-content.svelte';
import Description from './card-description.svelte';
import Footer from './card-footer.svelte';
import Header from './card-header.svelte';
import Title from './card-title.svelte';
import Root from './card.svelte';

export {
Root,
Content,
Description,
Footer,
Header,
Title,
//
Root as Card,
Content as CardContent,
Description as CardDescription,
Footer as CardFooter,
Header as CardHeader,
Title as CardTitle,
//
Root as Card,
Content as CardContent,
Description as CardDescription,
Footer as CardFooter,
Header as CardHeader,
Title as CardTitle, Content,
Description,
Footer,
Header, Root, Title
};

export type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
6 changes: 3 additions & 3 deletions frontend/src/lib/components/ui/checkbox/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Root from './checkbox.svelte';
export {
Root,
//
Root as Checkbox,
//
Root as Checkbox, Root
};

35 changes: 12 additions & 23 deletions frontend/src/lib/components/ui/command/index.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,26 @@
import { Command as CommandPrimitive } from 'cmdk-sv';

import Root from './command.svelte';
import Dialog from './command-dialog.svelte';
import Empty from './command-empty.svelte';
import Group from './command-group.svelte';
import Item from './command-item.svelte';
import Input from './command-input.svelte';
import Item from './command-item.svelte';
import List from './command-list.svelte';
import Separator from './command-separator.svelte';
import Shortcut from './command-shortcut.svelte';
import Root from './command.svelte';

const Loading = CommandPrimitive.Loading;

export {
Root,
Dialog,
Empty,
Group,
Item,
Input,
List,
Separator,
Shortcut,
Loading,
//
Root as Command,
Dialog as CommandDialog,
Empty as CommandEmpty,
Group as CommandGroup,
Item as CommandItem,
Input as CommandInput,
List as CommandList,
Separator as CommandSeparator,
Shortcut as CommandShortcut,
Loading as CommandLoading,
//
Root as Command,
Dialog as CommandDialog,
Empty as CommandEmpty,
Group as CommandGroup, Input as CommandInput, Item as CommandItem, List as CommandList, Loading as CommandLoading, Separator as CommandSeparator,
Shortcut as CommandShortcut, Dialog,
Empty,
Group, Input, Item, List, Loading, Root, Separator,
Shortcut
};

38 changes: 13 additions & 25 deletions frontend/src/lib/components/ui/dialog/index.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,25 @@
import { Dialog as DialogPrimitive } from 'bits-ui';

import Title from './dialog-title.svelte';
import Portal from './dialog-portal.svelte';
import Content from './dialog-content.svelte';
import Description from './dialog-description.svelte';
import Footer from './dialog-footer.svelte';
import Header from './dialog-header.svelte';
import Overlay from './dialog-overlay.svelte';
import Content from './dialog-content.svelte';
import Description from './dialog-description.svelte';
import Portal from './dialog-portal.svelte';
import Title from './dialog-title.svelte';

const Root = DialogPrimitive.Root;
const Trigger = DialogPrimitive.Trigger;
const Close = DialogPrimitive.Close;

export {
Root,
Title,
Portal,
Footer,
Header,
Trigger,
Overlay,
Content,
Description,
Close,
//
Root as Dialog,
Title as DialogTitle,
Portal as DialogPortal,
Footer as DialogFooter,
Header as DialogHeader,
Trigger as DialogTrigger,
Overlay as DialogOverlay,
Content as DialogContent,
Description as DialogDescription,
Close as DialogClose,
Close, Content,
Description,
//
Root as Dialog, Close as DialogClose, Content as DialogContent,
Description as DialogDescription, Footer as DialogFooter,
Header as DialogHeader, Overlay as DialogOverlay, Portal as DialogPortal, Title as DialogTitle, Trigger as DialogTrigger, Footer,
Header, Overlay, Portal, Root,
Title, Trigger
};

46 changes: 13 additions & 33 deletions frontend/src/lib/components/ui/dropdown-menu/index.ts
Original file line number Diff line number Diff line change
@@ -1,48 +1,28 @@
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
import CheckboxItem from './dropdown-menu-checkbox-item.svelte';
import Content from './dropdown-menu-content.svelte';
import Item from './dropdown-menu-item.svelte';
import Label from './dropdown-menu-label.svelte';
import Content from './dropdown-menu-content.svelte';
import Shortcut from './dropdown-menu-shortcut.svelte';
import RadioGroup from './dropdown-menu-radio-group.svelte';
import RadioItem from './dropdown-menu-radio-item.svelte';
import Separator from './dropdown-menu-separator.svelte';
import RadioGroup from './dropdown-menu-radio-group.svelte';
import Shortcut from './dropdown-menu-shortcut.svelte';
import SubContent from './dropdown-menu-sub-content.svelte';
import SubTrigger from './dropdown-menu-sub-trigger.svelte';
import CheckboxItem from './dropdown-menu-checkbox-item.svelte';

const Sub = DropdownMenuPrimitive.Sub;
const Root = DropdownMenuPrimitive.Root;
const Trigger = DropdownMenuPrimitive.Trigger;
const Group = DropdownMenuPrimitive.Group;

export {
Sub,
Root,
Item,
Label,
Group,
Trigger,
Content,
Shortcut,
Separator,
RadioItem,
SubContent,
SubTrigger,
RadioGroup,
CheckboxItem,
//
Root as DropdownMenu,
Sub as DropdownMenuSub,
Item as DropdownMenuItem,
Label as DropdownMenuLabel,
Group as DropdownMenuGroup,
Content as DropdownMenuContent,
Trigger as DropdownMenuTrigger,
Shortcut as DropdownMenuShortcut,
RadioItem as DropdownMenuRadioItem,
Separator as DropdownMenuSeparator,
RadioGroup as DropdownMenuRadioGroup,
SubContent as DropdownMenuSubContent,
SubTrigger as DropdownMenuSubTrigger,
CheckboxItem as DropdownMenuCheckboxItem,
CheckboxItem, Content,
//
Root as DropdownMenu, CheckboxItem as DropdownMenuCheckboxItem, Content as DropdownMenuContent, Group as DropdownMenuGroup, Item as DropdownMenuItem,
Label as DropdownMenuLabel, RadioGroup as DropdownMenuRadioGroup, RadioItem as DropdownMenuRadioItem,
Separator as DropdownMenuSeparator, Shortcut as DropdownMenuShortcut, Sub as DropdownMenuSub, SubContent as DropdownMenuSubContent,
SubTrigger as DropdownMenuSubTrigger, Trigger as DropdownMenuTrigger, Group, Item,
Label, RadioGroup, RadioItem, Root, Separator, Shortcut, Sub, SubContent,
SubTrigger, Trigger
};

6 changes: 3 additions & 3 deletions frontend/src/lib/components/ui/input/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type InputEvents = {
};

export {
Root,
//
Root as Input,
//
Root as Input, Root
};

6 changes: 3 additions & 3 deletions frontend/src/lib/components/ui/label/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Root from './label.svelte';

export {
Root,
//
Root as Label,
//
Root as Label, Root
};

14 changes: 5 additions & 9 deletions frontend/src/lib/components/ui/popover/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ const Trigger = PopoverPrimitive.Trigger;
const Close = PopoverPrimitive.Close;

export {
Root,
Content,
Trigger,
Close,
//
Root as Popover,
Content as PopoverContent,
Trigger as PopoverTrigger,
Close as PopoverClose,
Close, Content,
//
Root as Popover, Close as PopoverClose, Content as PopoverContent,
Trigger as PopoverTrigger, Root, Trigger
};

Loading

0 comments on commit 99d837f

Please sign in to comment.