-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
6 changed files
with
92 additions
and
53 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,37 +1,36 @@ | ||
import { Slider } from '@nextui-org/react'; | ||
import { Slider, SliderProps } from '@nextui-org/react'; | ||
import clsx from 'clsx'; | ||
import { FC } from 'react'; | ||
|
||
type PageSelectorProps = { | ||
range: [number, number]; | ||
}; | ||
} & SliderProps; | ||
|
||
export const PageSelector: FC<PageSelectorProps> = ({ range }) => { | ||
export const PageSelector: FC<PageSelectorProps> = ({ range, ...rest }) => { | ||
return ( | ||
<Slider | ||
size="lg" | ||
label="Page Range" | ||
maxValue={range[1]} | ||
minValue={1} | ||
step={1} | ||
defaultValue={range} | ||
classNames={{ | ||
base: 'max-w-md gap-3', | ||
filler: 'bg-gradient-to-r from-pink-300 to-cyan-300 dark:from-pink-600 dark:to-cyan-800', | ||
base: 'w-60 gap-3', | ||
filler: 'bg-gradient-to-r from-secondary to-primary h-4', | ||
track: 'border-x-4 h-4', | ||
}} | ||
renderThumb={({ index, ...props }) => ( | ||
<div | ||
{...props} | ||
className="bg-background border-small border-default-200 dark:border-default-400/50 shadow-medium group top-1/2 cursor-grab rounded-full p-1 data-[dragging=true]:cursor-grabbing"> | ||
className="bg-background border-small border-default-400/50 shadow-medium group top-1/2 cursor-grab rounded-full p-0.5 data-[dragging=true]:cursor-grabbing"> | ||
<span | ||
className={clsx( | ||
'shadow-small group-data-[dragging=true]:scale-80 block h-5 w-5 rounded-full bg-gradient-to-br transition-transform', | ||
index === 0 | ||
? 'from-pink-200 to-pink-500 dark:from-pink-400 dark:to-pink-600' | ||
: 'from-cyan-200 to-cyan-600 dark:from-cyan-600 dark:to-cyan-800' | ||
'shadow-small bg-primary block h-4 w-4 rounded-full transition-transform group-data-[dragging=true]:scale-95', | ||
index === 0 && 'bg-secondary' | ||
)} | ||
/> | ||
</div> | ||
)} | ||
{...rest} | ||
/> | ||
); | ||
}; |
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 +1,2 @@ | ||
export * from './PageSelector'; | ||
export * from './Table'; |