Skip to content

Commit

Permalink
feat: skeleton animation, animation typo rename
Browse files Browse the repository at this point in the history
  • Loading branch information
lovrozagar committed Jun 28, 2024
1 parent 50d2850 commit 9036bd8
Show file tree
Hide file tree
Showing 20 changed files with 113 additions and 1,774 deletions.
42 changes: 36 additions & 6 deletions app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ import {
SelectContent,
SelectItem,
SelectTrigger,
Skeleton,
Toaster,
toastError,
} from '@/components'
import React from 'react'

const App = () => {
return (
<div className='h-screen w-full flex items-center justify-center gap-8'>
<Button
<div className='h-screen w-full flex flex-col justify-center items-center gap-8'>
{/* <Button
onClick={() =>
toastError({
title: 'Uspjeh',
Expand All @@ -41,15 +42,44 @@ const App = () => {
<SelectItem value='item-2'>Item 2</SelectItem>
<SelectItem value='item-3'>Item 3</SelectItem>
</SelectContent>
</Select>
<NavigationMenu>
</Select> */}
<NavigationMenu className='z-30' viewportProps={{ className: 'bg-mode-accent' }}>
<NavigationMenuItem value='AEF'>
<NavigationMenuTrigger>Trigger</NavigationMenuTrigger>
<NavigationMenuTrigger>Trigger 1</NavigationMenuTrigger>
<NavigationMenuContent className='bg-mode-accent'>
<div className='w-[300px]'>
Content that is displayed Some othe content that is displayed eaf ae faef eaaef aefk
peaf piajef pieaj pifjpiaejf pieaj piaej paei jpaeijeaip jeapij p Some othe content
that is displayed eaf ae faef eaaef aefk peaf piajef pieaj pifjpiaejf pieaj piaej paei
jpaeijeaip jeapij p Some othe content that is displayed eaf ae faef eaaef aefk peaf
piajef pieaj pifjpiaejf pieaj piaej paei jpaeijeaip jeapij p
</div>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem value='aef'>
<NavigationMenuTrigger>Trigger 2</NavigationMenuTrigger>
<NavigationMenuContent>
<div className='min-w-[200px]'>Content je najbolji jel tak</div>
<div className='min-w-[400px]'>
Some othe content that is displayed eaf ae faef eaaef aefk peaf piajef pieaj
pifjpiaejf pieaj piaej paei jpaeijeaip jeapij p displayed eaf ae faef eaaef aefk peaf
piajef pieaj pifjpiaejf pieaj piaej paei jpaeijeaip jeapij p Some othe content that is
displayed
</div>
</NavigationMenuContent>
</NavigationMenuItem>
</NavigationMenu>
<div className='relative z-20'>Text bellow popover</div>
<Select>
<SelectTrigger className='w-[200px]'>Select</SelectTrigger>
<SelectContent hasScroll>
{Array.from({ length: 20 }).map((_, index) => (
<SelectItem value={index}>{index}</SelectItem>
))}
</SelectContent>
</Select>
<div className='grid gap-4'>
<Skeleton className='h-[40px] w-[200px]' />
</div>
<Toaster />
</div>
)
Expand Down
6 changes: 3 additions & 3 deletions src/components/_shared/utils/get-animation-style-variables.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

type AnimationStyleVariaiables = {
type AnimationStyleVariables = {
animationDuration?: number | undefined
animationInDuration?: number | undefined
animationOutDuration?: number | undefined
Expand All @@ -27,7 +27,7 @@ type AnimationStyleDefaultTimingFunctions = {
defaultAnimationOutTimingFunction: React.CSSProperties['animationTimingFunction']
}

type GetAnimationStyleVariablesProps = AnimationStyleVariaiables &
type GetAnimationStyleVariablesProps = AnimationStyleVariables &
(AnimationStyleDefaultDuration | AnimationStyleDefaultDurations) &
(AnimationStyleDefaultTimingFunction | AnimationStyleDefaultTimingFunctions) &
Record<string, unknown>
Expand Down Expand Up @@ -76,4 +76,4 @@ function getAnimationStyleVariables(props: GetAnimationStyleVariablesProps) {

export { getAnimationStyleVariables }

export type { AnimationStyleVariaiables }
export type { AnimationStyleVariables }
4 changes: 2 additions & 2 deletions src/components/accordion/types/accordion-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Simplify } from '@renderui/types'
import React from 'react'

import { AsChildProp } from '@/components/_shared/types/as-child'
import { AnimationStyleVariaiables } from '@/components/_shared/utils/get-animation-style-variables'
import { AnimationStyleVariables } from '@/components/_shared/utils/get-animation-style-variables'

type AccordionContentPrimitiveType = typeof AccordionContentPrimitive

Expand All @@ -14,7 +14,7 @@ type AccordionContentPrimitiveProps = React.ComponentPropsWithoutRef<AccordionCo
type AccordionContentChildrenContainerProps = {
childrenContainerProps?: Simplify<React.ComponentPropsWithoutRef<'div'> & AsChildProp>
animationDuration?: number
} & AnimationStyleVariaiables
} & AnimationStyleVariables

type AccordionContentProps = Simplify<
AccordionContentPrimitiveProps & AccordionContentChildrenContainerProps
Expand Down
Loading

0 comments on commit 9036bd8

Please sign in to comment.