Skip to content

Commit

Permalink
updated package json and added more things
Browse files Browse the repository at this point in the history
  • Loading branch information
day-mon committed Apr 26, 2024
1 parent 43f73b6 commit 8cc780c
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"description": "Web UI for Accuribet",
"dependencies": {
"@kobalte/core": "^0.12.1",
"@kobalte/core": "^0.12.6",
"@solidjs/router": "^0.10.9",
"axios": "^1.6.8",
"class-variance-authority": "^0.7.0",
Expand All @@ -30,6 +30,7 @@
"dev": "vite",
"build": "vite build",
"build:prod": "vite build --mode production",
"preview": "vite preview"
"preview": "vite preview",
"ui:add": "npx solidui-cli@latest add"
}
}
5 changes: 3 additions & 2 deletions ui/src/components/animated-div.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { ComponentProps, JSX } from 'solid-js';
import { Motion } from 'solid-motionone';
import { Motion, VariantDefinition } from 'solid-motionone';
import { Easing, EasingGenerator, EasingFunction } from '@motionone/types'

export interface AnimationDivProps extends ComponentProps<'div'>{
children?: JSX.Element;
easing?: EasingGenerator | Easing | Easing[] | EasingFunction
duration?: number;
animate?: VariantDefinition
}


Expand All @@ -14,7 +15,7 @@ export function AnimationDiv(
) {
return (
<Motion.div
animate={{ opacity: [0, 1] }}
animate={props.animate || { opacity: [0, 1] }}
transition={{ duration: props.duration || 1, easing: props.easing || 'ease-in-out' }}
{...props}
>
Expand Down
48 changes: 48 additions & 0 deletions ui/src/components/ui/alert.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import type { Component, ComponentProps } from "solid-js"
import { splitProps } from "solid-js"

import { Alert as AlertPrimitive } from "@kobalte/core"
import type { VariantProps } from "class-variance-authority"
import { cva } from "class-variance-authority"

import { cn } from "~/lib/utils"

const alertVariants = cva(
"relative w-full rounded-lg border p-4 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
{
variants: {
variant: {
default: "bg-background text-foreground",
destructive:
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
}
},
defaultVariants: {
variant: "default"
}
}
)

interface AlertProps extends AlertPrimitive.AlertRootProps, VariantProps<typeof alertVariants> {}

const Alert: Component<AlertProps> = (props) => {
const [, rest] = splitProps(props, ["class", "variant"])
return (
<AlertPrimitive.Root
class={cn(alertVariants({ variant: props.variant }), props.class)}
{...rest}
/>
)
}

const AlertTitle: Component<ComponentProps<"h5">> = (props) => {
const [, rest] = splitProps(props, ["class"])
return <h5 class={cn("mb-1 font-medium leading-none tracking-tight", props.class)} {...rest} />
}

const AlertDescription: Component<ComponentProps<"div">> = (props) => {
const [, rest] = splitProps(props, ["class"])
return <div class={cn("text-sm [&_p]:leading-relaxed", props.class)} {...rest} />
}

export { Alert, AlertTitle, AlertDescription }

0 comments on commit 8cc780c

Please sign in to comment.