-
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
12 changed files
with
554 additions
and
48 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"use client"; | ||
|
||
import * as React from "react"; | ||
|
||
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"; | ||
import { CheckIcon } from "@radix-ui/react-icons"; | ||
|
||
import { cn } from "@/lib/utils"; | ||
|
||
const Checkbox = React.forwardRef< | ||
React.ElementRef<typeof CheckboxPrimitive.Root>, | ||
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> | ||
>(({ className, ...props }, ref) => ( | ||
<CheckboxPrimitive.Root | ||
ref={ref} | ||
className={cn( | ||
"peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", | ||
className, | ||
)} | ||
{...props} | ||
> | ||
<CheckboxPrimitive.Indicator | ||
className={cn("flex items-center justify-center text-current")} | ||
> | ||
<CheckIcon className="h-4 w-4" /> | ||
</CheckboxPrimitive.Indicator> | ||
</CheckboxPrimitive.Root> | ||
)); | ||
Checkbox.displayName = CheckboxPrimitive.Root.displayName; | ||
|
||
export { Checkbox }; |
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,68 @@ | ||
"use client"; | ||
|
||
import * as React from "react"; | ||
|
||
import * as SliderPrimitive from "@radix-ui/react-slider"; | ||
|
||
import { cn } from "@/lib/utils"; | ||
|
||
const Thumb = React.forwardRef< | ||
React.ElementRef<typeof SliderPrimitive.Thumb>, | ||
React.ComponentPropsWithoutRef<typeof SliderPrimitive.Thumb> | ||
>(({ className, ...props }, ref) => ( | ||
<SliderPrimitive.Thumb | ||
ref={ref} | ||
className={cn( | ||
"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", | ||
className, | ||
)} | ||
{...props} | ||
/> | ||
)); | ||
|
||
Thumb.displayName = SliderPrimitive.Thumb.displayName; | ||
|
||
const Slider = React.forwardRef< | ||
React.ElementRef<typeof SliderPrimitive.Root>, | ||
React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> | ||
>(({ className, ...props }, ref) => ( | ||
<SliderPrimitive.Root | ||
ref={ref} | ||
className={cn( | ||
"relative flex w-full touch-none select-none items-center", | ||
className, | ||
)} | ||
{...props} | ||
> | ||
<SliderPrimitive.Track className="relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20"> | ||
<SliderPrimitive.Range className="absolute h-full bg-primary" /> | ||
</SliderPrimitive.Track> | ||
<Thumb /> | ||
</SliderPrimitive.Root> | ||
)); | ||
|
||
Slider.displayName = SliderPrimitive.Root.displayName; | ||
|
||
const RangeSlider = React.forwardRef< | ||
React.ElementRef<typeof SliderPrimitive.Root>, | ||
React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root> | ||
>(({ className, ...props }, ref) => ( | ||
<SliderPrimitive.Root | ||
ref={ref} | ||
className={cn( | ||
"relative flex w-full touch-none select-none items-center", | ||
className, | ||
)} | ||
{...props} | ||
> | ||
<SliderPrimitive.Track className="relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20"> | ||
<SliderPrimitive.Range className="absolute h-full bg-primary" /> | ||
</SliderPrimitive.Track> | ||
<Thumb /> | ||
<Thumb /> | ||
</SliderPrimitive.Root> | ||
)); | ||
|
||
RangeSlider.displayName = SliderPrimitive.Root.displayName; | ||
|
||
export { Slider, RangeSlider }; |
Oops, something went wrong.