-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7baa803
commit bcc89ee
Showing
25 changed files
with
432 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Ignore | ||
**/env | ||
**/.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,36 @@ | ||
import type { Component } from 'solid-js'; | ||
import { splitProps } from 'solid-js'; | ||
import type { Component } from "solid-js"; | ||
import { splitProps } from "solid-js"; | ||
|
||
import { Image as ImagePrimitive } from '@kobalte/core'; | ||
import { Image as ImagePrimitive } from "@kobalte/core"; | ||
|
||
import { cn } from '~/lib/utils'; | ||
import { cn } from "~/lib/utils"; | ||
|
||
const Avatar: Component<ImagePrimitive.ImageRootProps> = (props) => { | ||
const [, rest] = splitProps(props, ['class']); | ||
return <ImagePrimitive.Root class={cn('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', props.class)} {...rest} />; | ||
const Avatar: Component<ImagePrimitive.ImageRootProps> = props => { | ||
const [, rest] = splitProps(props, ["class"]); | ||
return ( | ||
<ImagePrimitive.Root | ||
class={cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", props.class)} | ||
{...rest} | ||
/> | ||
); | ||
}; | ||
|
||
const AvatarImage: Component<ImagePrimitive.ImageImgProps> = (props) => { | ||
const [, rest] = splitProps(props, ['class']); | ||
return <ImagePrimitive.Img class={cn('aspect-square h-full w-full', props.class)} {...rest} />; | ||
const AvatarImage: Component<ImagePrimitive.ImageImgProps> = props => { | ||
const [, rest] = splitProps(props, ["class"]); | ||
return <ImagePrimitive.Img class={cn("aspect-square h-full w-full", props.class)} {...rest} />; | ||
}; | ||
|
||
const AvatarFallback: Component<ImagePrimitive.ImageFallbackProps> = (props) => { | ||
const [, rest] = splitProps(props, ['class']); | ||
return <ImagePrimitive.Fallback class={cn('bg-muted flex h-full w-full items-center justify-center rounded-full', props.class)} {...rest} />; | ||
const AvatarFallback: Component<ImagePrimitive.ImageFallbackProps> = props => { | ||
const [, rest] = splitProps(props, ["class"]); | ||
return ( | ||
<ImagePrimitive.Fallback | ||
class={cn( | ||
"bg-muted flex h-full w-full items-center justify-center rounded-full", | ||
props.class | ||
)} | ||
{...rest} | ||
/> | ||
); | ||
}; | ||
|
||
export { Avatar, AvatarFallback, AvatarImage }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,49 @@ | ||
import type { Component, ComponentProps } from 'solid-js'; | ||
import { splitProps } from 'solid-js'; | ||
import type { Component, ComponentProps } from "solid-js"; | ||
import { splitProps } from "solid-js"; | ||
|
||
import type { VariantProps } from 'class-variance-authority'; | ||
import { cva } from 'class-variance-authority'; | ||
import type { VariantProps } from "class-variance-authority"; | ||
import { cva } from "class-variance-authority"; | ||
|
||
import { cn } from '~/lib/utils'; | ||
import { cn } from "~/lib/utils"; | ||
|
||
const buttonVariants = cva('ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center 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', { | ||
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 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', | ||
const buttonVariants = cva( | ||
"ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center 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", | ||
{ | ||
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 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" | ||
} | ||
}, | ||
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', | ||
}, | ||
}); | ||
defaultVariants: { | ||
variant: "default", | ||
size: "default" | ||
} | ||
} | ||
); | ||
|
||
export interface ButtonProps extends ComponentProps<'button'>, VariantProps<typeof buttonVariants> {} | ||
export interface ButtonProps | ||
extends ComponentProps<"button">, | ||
VariantProps<typeof buttonVariants> {} | ||
|
||
const Button: Component<ButtonProps> = (props) => { | ||
const [, rest] = splitProps(props, ['variant', 'size', 'class']); | ||
return <button class={cn(buttonVariants({ variant: props.variant, size: props.size }), props.class)} {...rest} />; | ||
const Button: Component<ButtonProps> = props => { | ||
const [, rest] = splitProps(props, ["variant", "size", "class"]); | ||
return ( | ||
<button | ||
class={cn(buttonVariants({ variant: props.variant, size: props.size }), props.class)} | ||
{...rest} | ||
/> | ||
); | ||
}; | ||
|
||
export { Button, buttonVariants }; |
Oops, something went wrong.