a homebrewed DnD campaign based in the Honkai: Star Rail universe
hsr honkaistarrail dnd

refactor: remove duplicate `cn()` function, remove duplicate types

Changed files
+19 -31
app
+4 -4
app/src/lib/components/Button/Button.svelte
··· 1 1 <script lang="ts"> 2 2 import type { WithElementRef } from 'bits-ui' 3 3 import type { HTMLButtonAttributes } from 'svelte/elements' 4 - import { cn } from '$lib/types' 4 + import { cn } from '$lib/utils' 5 5 import { buttonTv, type ButtonIntent, type ButtonIsIconOnly } from './styles' 6 6 7 7 type ButtonRootProps = WithElementRef<HTMLButtonAttributes> 8 8 type ButtonProps = ButtonRootProps & { 9 - isIconOnly?: ButtonIsIconOnly, 10 - intent?: ButtonIntent, 11 - } 9 + isIconOnly?: ButtonIsIconOnly, 10 + intent?: ButtonIntent, 11 + } 12 12 13 13 let { 14 14 intent = 'primary',
+1 -1
app/src/lib/components/Button/LinkButton.svelte
··· 1 1 <script lang="ts"> 2 2 import type { WithElementRef } from 'bits-ui' 3 3 import type { HTMLAnchorAttributes } from 'svelte/elements' 4 - import { cn } from '$lib/types' 4 + import { cn } from '$lib/utils' 5 5 import { buttonTv, type ButtonIntent, type ButtonIsIconOnly } from './styles' 6 6 7 7 type LinkButtonRootProps = WithElementRef<HTMLAnchorAttributes>
+1 -1
app/src/lib/components/Card/Card.svelte
··· 1 1 <script lang="ts"> 2 2 import { tv } from 'tailwind-variants' 3 - import { cn } from '$lib/types' 3 + import { cn } from '$lib/utils' 4 4 import type { CardProps } from './types' 5 5 6 6 const card = tv({
+1 -1
app/src/lib/components/Card/CardFooter.svelte
··· 2 2 import type { WithChildren } from 'bits-ui' 3 3 import type { SvelteHTMLElements } from 'svelte/elements' 4 4 import { tv } from 'tailwind-variants' 5 - import { cn } from '$lib/types' 5 + import { cn } from '$lib/utils' 6 6 import { Separator } from '$ui/Separator' 7 7 8 8 export type CardFooterRootElement = SvelteHTMLElements['footer']
+2 -2
app/src/lib/components/Chip/ChipDot.svelte
··· 1 1 <script lang="ts"> 2 - import { tv, type VariantProps } from 'tailwind-variants' 3 2 import type { SvelteHTMLElements } from 'svelte/elements' 4 - import { cn } from '$lib/types' 3 + import { tv, type VariantProps } from 'tailwind-variants' 4 + import { cn } from '$lib/utils' 5 5 6 6 const chipDot = tv({ 7 7 base: 'rounded-full',
+2 -2
app/src/lib/components/Heading/HeadingGroup.svelte
··· 1 1 <script lang="ts"> 2 2 import type { WithChildren } from 'bits-ui' 3 - import { tv } from 'tailwind-variants' 4 3 import type { SvelteHTMLElements } from 'svelte/elements' 5 - import { cn } from '$lib/types' 4 + import { tv } from 'tailwind-variants' 5 + import { cn } from '$lib/utils' 6 6 7 7 type HeadingGroupRootElement = SvelteHTMLElements['group'] 8 8 type HeadingGroupProps = WithChildren<HeadingGroupRootElement>
+1 -1
app/src/lib/components/Profile/ProfilePicture.svelte
··· 1 1 <script lang="ts"> 2 2 import { Avatar, type WithoutChildrenOrChild } from 'bits-ui' 3 3 import { tv, type VariantProps } from 'tailwind-variants' 4 - import { cn } from '$lib/types' 4 + import { cn } from '$lib/utils' 5 5 6 6 const pfp = tv({ 7 7 base: [
+1 -1
app/src/lib/components/Separator/Separator.svelte
··· 1 1 <script lang="ts"> 2 2 import { Separator } from 'bits-ui' 3 3 import { tv } from 'tailwind-variants' 4 - import { cn } from '$lib/types' 4 + import { cn } from '$lib/utils' 5 5 6 6 const separator = tv({ 7 7 slots: {
+1 -1
app/src/lib/components/Site/PageLayout.svelte
··· 2 2 import type { WithChildren } from 'bits-ui' 3 3 import type { SvelteHTMLElements } from 'svelte/elements' 4 4 import { tv, type VariantProps } from 'tailwind-variants' 5 - import { cn } from '$lib/types' 5 + import { cn } from '$lib/utils' 6 6 7 7 const pageLayout = tv({ 8 8 base: 'py-4 px-32 font-sans',
+1 -1
app/src/lib/components/Text/Text.svelte
··· 1 1 <script lang="ts"> 2 2 import { text, type TextProps } from './Text' 3 - import { cn } from '$lib/types' 3 + import { cn } from '$lib/utils' 4 4 5 5 let { 6 6 children,
-6
app/src/lib/types.ts
··· 1 - import { clsx, type ClassValue } from 'clsx' 2 - import { twMerge } from 'tailwind-merge' 3 - 4 - export function cn(...inputs: ClassValue[]): string { 5 - return twMerge(clsx(inputs)) 6 - }
-6
app/src/lib/utils.ts
··· 30 30 * a postgreSQL table with a strongly typed database schema 31 31 */ 32 32 export type DbClient = SupabaseClient<Database> 33 - 34 - // eslint-disable-next-line @typescript-eslint/no-explicit-any 35 - export type WithoutChild<T> = T extends { child?: any } ? Omit<T, 'child'> : T 36 - // eslint-disable-next-line @typescript-eslint/no-explicit-any 37 - export type WithoutChildren<T> = T extends { children?: any } ? Omit<T, 'children'> : T 38 - export type WithoutChildrenOrChild<T> = WithoutChildren<WithoutChild<T>>
+4 -4
app/src/routes/(auth)/reset-password/+page.svelte
··· 5 5 import { Field, FieldLabel } from '$form/Field' 6 6 import { FormHeader } from '$form/Form' 7 7 import { TextInput } from '$form/TextInput' 8 - import { Button } from '$ui/Button' 8 + import { Button, LinkButton } from '$ui/Button' 9 9 import type { PageProps } from './$types' 10 - import AuthPageLayout from '../AuthPageLayout.svelte' 10 + import { AuthPageLayout } from '../components' 11 11 12 12 type ResetPasswordProps = WithChildren<PageProps> 13 13 let { data }: ResetPasswordProps = $props() ··· 50 50 <Button intent="primary"> 51 51 Send and continue 52 52 </Button> 53 - <Button intent="secondary" href="/signin"> 53 + <LinkButton intent="secondary" href="/signin"> 54 54 Return to sign in 55 - </Button> 55 + </LinkButton> 56 56 </div> 57 57 </form> 58 58 </AuthPageLayout>