-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated: skeleton pagination play spinner tabs.
- Loading branch information
1 parent
9fcdc76
commit 843c31e
Showing
17 changed files
with
194 additions
and
200 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
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,19 +1,19 @@ | ||
'use client' | ||
import { FC, ReactNode } from 'react' | ||
import { FC, forwardRef, HTMLAttributes, ReactNode } from 'react' | ||
import { cn } from '../../helpers/cn' | ||
import { paginationTheme } from './theme' | ||
|
||
export interface GotoProps { | ||
export interface GoToProps extends HTMLAttributes<HTMLDivElement> { | ||
children?: ReactNode | ||
className?: string | ||
[key: string]: any | ||
} | ||
|
||
export const GoTo: FC<GotoProps> = ({ className, children, ...props }) => { | ||
const GoTo: FC<GoToProps> = forwardRef<HTMLDivElement, GoToProps>(({ children, ...props }, ref) => { | ||
const { goto } = paginationTheme | ||
return ( | ||
<div className={cn(goto.base, className)} {...props}> | ||
<div {...props} ref={ref} className={cn(goto.base, props.className)}> | ||
{children} | ||
</div> | ||
) | ||
} | ||
}) | ||
GoTo.displayName = 'Pagination.GoTo' | ||
export { GoTo } |
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,24 +1,28 @@ | ||
'use client' | ||
import { FC, ReactNode } from 'react' | ||
import { ButtonHTMLAttributes, FC, forwardRef } from 'react' | ||
import { cn } from '../../helpers/cn' | ||
import { usePaginationContext } from './Context' | ||
import { paginationTheme } from './theme' | ||
|
||
export interface ItemProps { | ||
children?: ReactNode | ||
className?: string | ||
export interface ItemProps extends ButtonHTMLAttributes<HTMLButtonElement> { | ||
active?: boolean | ||
[key: string]: any | ||
} | ||
|
||
export const Item: FC<ItemProps> = ({ className, children, active = false, ...props }) => { | ||
const { shape = 'rounded' } = usePaginationContext() | ||
const { item } = paginationTheme | ||
return ( | ||
<li {...props}> | ||
<button className={cn(item.base, item.active[active ? 'on' : 'off'], item.shape[shape], className)}> | ||
{children} | ||
</button> | ||
</li> | ||
) | ||
} | ||
const Item: FC<ItemProps> = forwardRef<HTMLButtonElement, ItemProps>( | ||
({ className, children, active = false, ...props }, ref) => { | ||
const { shape = 'rounded' } = usePaginationContext() | ||
const { item } = paginationTheme | ||
return ( | ||
<li> | ||
<button | ||
{...props} | ||
ref={ref} | ||
className={cn(item.base, item.active[active ? 'on' : 'off'], item.shape[shape], className)}> | ||
{children} | ||
</button> | ||
</li> | ||
) | ||
}, | ||
) | ||
Item.displayName = 'Pagination.Item' | ||
export { Item } |
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,19 +1,18 @@ | ||
'use client' | ||
import { FC, ReactNode } from 'react' | ||
import { forwardRef, HTMLAttributes } from 'react' | ||
import { cn } from '../../helpers/cn' | ||
import { paginationTheme } from './theme' | ||
|
||
export interface ListProps { | ||
children?: ReactNode | ||
className?: string | ||
[key: string]: any | ||
} | ||
interface ListProps extends HTMLAttributes<HTMLUListElement> {} | ||
|
||
export const List: FC<ListProps> = ({ className, children, ...props }) => { | ||
const List = forwardRef<HTMLUListElement, ListProps>(({ children, ...props }, ref) => { | ||
const { list } = paginationTheme | ||
return ( | ||
<ul className={cn(list.base, className)} {...props}> | ||
<ul {...props} ref={ref} className={cn(list.base, props.className)}> | ||
{children} | ||
</ul> | ||
) | ||
} | ||
}) | ||
List.displayName = 'Pagination.List' | ||
|
||
export { List } |
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,20 +1,23 @@ | ||
'use client' | ||
import { FC, ReactNode } from 'react' | ||
import { ButtonHTMLAttributes, FC, forwardRef } from 'react' | ||
import { cn } from '../../helpers/cn' | ||
import { paginationTheme } from './theme' | ||
|
||
export interface NavigatorProps { | ||
children?: ReactNode | ||
className?: string | ||
export interface NavigatorProps extends ButtonHTMLAttributes<HTMLButtonElement> { | ||
shape?: 'rounded' | 'circle' | ||
[key: string]: any | ||
} | ||
|
||
export const Navigator: FC<NavigatorProps> = ({ className, children, shape = 'rounded', ...props }) => { | ||
const { navigator } = paginationTheme | ||
return ( | ||
<button {...props} className={cn(navigator.base, navigator.shape[shape], className)}> | ||
{children} | ||
</button> | ||
) | ||
} | ||
const Navigator: FC<NavigatorProps> = forwardRef<HTMLButtonElement, NavigatorProps>( | ||
({ className, children, shape = 'rounded', ...props }, ref) => { | ||
const { navigator } = paginationTheme | ||
return ( | ||
<button {...props} ref={ref} className={cn(navigator.base, navigator.shape[shape], className)}> | ||
{children} | ||
</button> | ||
) | ||
}, | ||
) | ||
|
||
Navigator.displayName = 'Pagination.Navigator' | ||
|
||
export { Navigator } |
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,14 +1,15 @@ | ||
'use client' | ||
import { FC } from 'react' | ||
import { HTMLAttributes, forwardRef } from 'react' | ||
import { cn } from '../../helpers/cn' | ||
import { skeletonTheme } from './theme' | ||
|
||
export interface SkeletonLineProps { | ||
height?: string | ||
className?: string | ||
} | ||
interface SkeletonLineProps extends HTMLAttributes<HTMLDivElement> {} | ||
|
||
export const SkeletonLine: FC<SkeletonLineProps> = ({ height, className }) => { | ||
const SkeletonLine = forwardRef<HTMLDivElement, SkeletonLineProps>(({ className, ...props }, ref) => { | ||
const theme = skeletonTheme | ||
return <div className={cn(theme.line, height, className)}></div> | ||
} | ||
return <div {...props} ref={ref} className={cn(theme.line, className)}></div> | ||
}) | ||
|
||
SkeletonLine.displayName = 'Skeleton.Line' | ||
|
||
export { SkeletonLine } |
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
Oops, something went wrong.