feat: add new UI components including RadioGroup, Resizable, Sidebar, Spinner, Table, Toast, and ToggleGroup
- Implemented RadioGroup and RadioGroupItem for radio button functionality. - Created ResizablePanelGroup, ResizablePanel, and ResizableHandle for resizable panels. - Developed Sidebar component with context for state management and various subcomponents (SidebarTrigger, SidebarMenu, etc.). - Added Spinner component for loading indicators. - Introduced Table component with TableHeader, TableBody, TableFooter, and related subcomponents for structured data display. - Built Toast component for notifications with customizable actions and icons. - Implemented ToggleGroup and ToggleGroupItem for toggle button functionality with context support.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Slider as SliderPrimitive } from "@base-ui/react/slider";
|
||||
import { Slider as SliderPrimitive } from "@base-ui/react/slider"
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
function Slider({
|
||||
className,
|
||||
@@ -14,7 +14,7 @@ function Slider({
|
||||
? value
|
||||
: Array.isArray(defaultValue)
|
||||
? defaultValue
|
||||
: [min, max];
|
||||
: [min, max]
|
||||
|
||||
return (
|
||||
<SliderPrimitive.Root
|
||||
@@ -37,16 +37,16 @@ function Slider({
|
||||
className="bg-primary select-none data-horizontal:h-full data-vertical:w-full"
|
||||
/>
|
||||
</SliderPrimitive.Track>
|
||||
{_values.map((val, index) => (
|
||||
{Array.from({ length: _values.length }, (_, index) => (
|
||||
<SliderPrimitive.Thumb
|
||||
data-slot="slider-thumb"
|
||||
key={val ?? index}
|
||||
key={index}
|
||||
className="relative block size-3 shrink-0 rounded-full border border-ring bg-white ring-ring/50 transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50"
|
||||
/>
|
||||
))}
|
||||
</SliderPrimitive.Control>
|
||||
</SliderPrimitive.Root>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
export { Slider };
|
||||
export { Slider }
|
||||
|
||||
Reference in New Issue
Block a user