@blips/ui 0.0.1 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1347 -146
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +185 -6
- package/dist/index.d.ts +185 -6
- package/dist/index.js +1295 -148
- package/dist/index.js.map +1 -1
- package/package.json +25 -13
- package/src/components/accordion.tsx +12 -12
- package/src/components/alert-dialog.tsx +25 -24
- package/src/components/alert.tsx +11 -11
- package/src/components/aspect-ratio.tsx +3 -3
- package/src/components/avatar.tsx +11 -11
- package/src/components/badge.tsx +6 -6
- package/src/components/breadcrumb.tsx +23 -23
- package/src/components/button-group.tsx +83 -0
- package/src/components/button.tsx +11 -11
- package/src/components/calendar.tsx +21 -24
- package/src/components/card.tsx +15 -22
- package/src/components/carousel.tsx +72 -71
- package/src/components/chart.tsx +368 -0
- package/src/components/checkbox.tsx +7 -7
- package/src/components/collapsible.tsx +6 -6
- package/src/components/command.tsx +27 -26
- package/src/components/context-menu.tsx +33 -33
- package/src/components/dialog.tsx +22 -22
- package/src/components/drawer.tsx +21 -21
- package/src/components/dropdown-menu.tsx +34 -34
- package/src/components/form.tsx +178 -0
- package/src/components/hover-card.tsx +8 -8
- package/src/components/input-group.tsx +175 -0
- package/src/components/input-otp.tsx +16 -16
- package/src/components/input.tsx +6 -6
- package/src/components/kbd.tsx +28 -0
- package/src/components/label.tsx +9 -9
- package/src/components/menubar.tsx +36 -36
- package/src/components/navigation-menu.tsx +21 -21
- package/src/components/pagination.tsx +22 -21
- package/src/components/popover.tsx +8 -8
- package/src/components/progress.tsx +7 -7
- package/src/components/radio-group.tsx +11 -11
- package/src/components/resizable.tsx +14 -14
- package/src/components/scroll-area.tsx +8 -8
- package/src/components/select.tsx +23 -23
- package/src/components/separator.tsx +6 -6
- package/src/components/sheet.tsx +24 -24
- package/src/components/sidebar.tsx +774 -0
- package/src/components/skeleton.tsx +3 -3
- package/src/components/slider.tsx +6 -6
- package/src/components/sonner.tsx +9 -9
- package/src/components/spinner.tsx +16 -0
- package/src/components/switch.tsx +6 -6
- package/src/components/table.tsx +19 -19
- package/src/components/tabs.tsx +11 -11
- package/src/components/textarea.tsx +6 -6
- package/src/components/toggle-group.tsx +15 -14
- package/src/components/toggle.tsx +8 -8
- package/src/components/tooltip.tsx +10 -10
- package/src/globals.css +45 -0
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/index.ts +78 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn } from "
|
|
1
|
+
import { cn } from "@/lib/utils"
|
|
2
2
|
|
|
3
3
|
function Skeleton({
|
|
4
4
|
className,
|
|
@@ -9,7 +9,7 @@ function Skeleton({
|
|
|
9
9
|
className={cn("animate-pulse rounded-md bg-muted", className)}
|
|
10
10
|
{...props}
|
|
11
11
|
/>
|
|
12
|
-
)
|
|
12
|
+
)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export { Skeleton }
|
|
15
|
+
export { Skeleton }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as SliderPrimitive from "@radix-ui/react-slider"
|
|
3
3
|
|
|
4
|
-
import { cn } from "
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
5
|
|
|
6
6
|
const Slider = React.forwardRef<
|
|
7
7
|
React.ElementRef<typeof SliderPrimitive.Root>,
|
|
@@ -20,7 +20,7 @@ const Slider = React.forwardRef<
|
|
|
20
20
|
</SliderPrimitive.Track>
|
|
21
21
|
<SliderPrimitive.Thumb className="block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" />
|
|
22
22
|
</SliderPrimitive.Root>
|
|
23
|
-
))
|
|
24
|
-
Slider.displayName = SliderPrimitive.Root.displayName
|
|
23
|
+
))
|
|
24
|
+
Slider.displayName = SliderPrimitive.Root.displayName
|
|
25
25
|
|
|
26
|
-
export { Slider }
|
|
26
|
+
export { Slider }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
CircleCheck,
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
LoaderCircle,
|
|
7
7
|
OctagonX,
|
|
8
8
|
TriangleAlert,
|
|
9
|
-
} from "lucide-react"
|
|
10
|
-
import { useTheme } from "next-themes"
|
|
11
|
-
import { Toaster as Sonner } from "sonner"
|
|
9
|
+
} from "lucide-react"
|
|
10
|
+
import { useTheme } from "next-themes"
|
|
11
|
+
import { Toaster as Sonner } from "sonner"
|
|
12
12
|
|
|
13
|
-
type ToasterProps = React.ComponentProps<typeof Sonner
|
|
13
|
+
type ToasterProps = React.ComponentProps<typeof Sonner>
|
|
14
14
|
|
|
15
15
|
const Toaster = ({ ...props }: ToasterProps) => {
|
|
16
|
-
const { theme = "system" } = useTheme()
|
|
16
|
+
const { theme = "system" } = useTheme()
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
19
|
<Sonner
|
|
@@ -39,7 +39,7 @@ const Toaster = ({ ...props }: ToasterProps) => {
|
|
|
39
39
|
}}
|
|
40
40
|
{...props}
|
|
41
41
|
/>
|
|
42
|
-
)
|
|
43
|
-
}
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
44
|
|
|
45
|
-
export { Toaster }
|
|
45
|
+
export { Toaster }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Loader2Icon } from "lucide-react"
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
|
|
6
|
+
return (
|
|
7
|
+
<Loader2Icon
|
|
8
|
+
role="status"
|
|
9
|
+
aria-label="Loading"
|
|
10
|
+
className={cn("size-4 animate-spin", className)}
|
|
11
|
+
{...props}
|
|
12
|
+
/>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { Spinner }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as SwitchPrimitives from "@radix-ui/react-switch"
|
|
3
3
|
|
|
4
|
-
import { cn } from "
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
5
|
|
|
6
6
|
const Switch = React.forwardRef<
|
|
7
7
|
React.ElementRef<typeof SwitchPrimitives.Root>,
|
|
@@ -21,7 +21,7 @@ const Switch = React.forwardRef<
|
|
|
21
21
|
)}
|
|
22
22
|
/>
|
|
23
23
|
</SwitchPrimitives.Root>
|
|
24
|
-
))
|
|
25
|
-
Switch.displayName = SwitchPrimitives.Root.displayName
|
|
24
|
+
))
|
|
25
|
+
Switch.displayName = SwitchPrimitives.Root.displayName
|
|
26
26
|
|
|
27
|
-
export { Switch }
|
|
27
|
+
export { Switch }
|
package/src/components/table.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React from "react"
|
|
1
|
+
import * as React from "react"
|
|
2
2
|
|
|
3
|
-
import { cn } from "
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
4
|
|
|
5
5
|
const Table = React.forwardRef<
|
|
6
6
|
HTMLTableElement,
|
|
@@ -13,16 +13,16 @@ const Table = React.forwardRef<
|
|
|
13
13
|
{...props}
|
|
14
14
|
/>
|
|
15
15
|
</div>
|
|
16
|
-
))
|
|
17
|
-
Table.displayName = "Table"
|
|
16
|
+
))
|
|
17
|
+
Table.displayName = "Table"
|
|
18
18
|
|
|
19
19
|
const TableHeader = React.forwardRef<
|
|
20
20
|
HTMLTableSectionElement,
|
|
21
21
|
React.HTMLAttributes<HTMLTableSectionElement>
|
|
22
22
|
>(({ className, ...props }, ref) => (
|
|
23
23
|
<thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
|
|
24
|
-
))
|
|
25
|
-
TableHeader.displayName = "TableHeader"
|
|
24
|
+
))
|
|
25
|
+
TableHeader.displayName = "TableHeader"
|
|
26
26
|
|
|
27
27
|
const TableBody = React.forwardRef<
|
|
28
28
|
HTMLTableSectionElement,
|
|
@@ -33,8 +33,8 @@ const TableBody = React.forwardRef<
|
|
|
33
33
|
className={cn("[&_tr:last-child]:border-0", className)}
|
|
34
34
|
{...props}
|
|
35
35
|
/>
|
|
36
|
-
))
|
|
37
|
-
TableBody.displayName = "TableBody"
|
|
36
|
+
))
|
|
37
|
+
TableBody.displayName = "TableBody"
|
|
38
38
|
|
|
39
39
|
const TableFooter = React.forwardRef<
|
|
40
40
|
HTMLTableSectionElement,
|
|
@@ -48,8 +48,8 @@ const TableFooter = React.forwardRef<
|
|
|
48
48
|
)}
|
|
49
49
|
{...props}
|
|
50
50
|
/>
|
|
51
|
-
))
|
|
52
|
-
TableFooter.displayName = "TableFooter"
|
|
51
|
+
))
|
|
52
|
+
TableFooter.displayName = "TableFooter"
|
|
53
53
|
|
|
54
54
|
const TableRow = React.forwardRef<
|
|
55
55
|
HTMLTableRowElement,
|
|
@@ -63,8 +63,8 @@ const TableRow = React.forwardRef<
|
|
|
63
63
|
)}
|
|
64
64
|
{...props}
|
|
65
65
|
/>
|
|
66
|
-
))
|
|
67
|
-
TableRow.displayName = "TableRow"
|
|
66
|
+
))
|
|
67
|
+
TableRow.displayName = "TableRow"
|
|
68
68
|
|
|
69
69
|
const TableHead = React.forwardRef<
|
|
70
70
|
HTMLTableCellElement,
|
|
@@ -78,8 +78,8 @@ const TableHead = React.forwardRef<
|
|
|
78
78
|
)}
|
|
79
79
|
{...props}
|
|
80
80
|
/>
|
|
81
|
-
))
|
|
82
|
-
TableHead.displayName = "TableHead"
|
|
81
|
+
))
|
|
82
|
+
TableHead.displayName = "TableHead"
|
|
83
83
|
|
|
84
84
|
const TableCell = React.forwardRef<
|
|
85
85
|
HTMLTableCellElement,
|
|
@@ -90,8 +90,8 @@ const TableCell = React.forwardRef<
|
|
|
90
90
|
className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
|
|
91
91
|
{...props}
|
|
92
92
|
/>
|
|
93
|
-
))
|
|
94
|
-
TableCell.displayName = "TableCell"
|
|
93
|
+
))
|
|
94
|
+
TableCell.displayName = "TableCell"
|
|
95
95
|
|
|
96
96
|
const TableCaption = React.forwardRef<
|
|
97
97
|
HTMLTableCaptionElement,
|
|
@@ -102,8 +102,8 @@ const TableCaption = React.forwardRef<
|
|
|
102
102
|
className={cn("mt-4 text-sm text-muted-foreground", className)}
|
|
103
103
|
{...props}
|
|
104
104
|
/>
|
|
105
|
-
))
|
|
106
|
-
TableCaption.displayName = "TableCaption"
|
|
105
|
+
))
|
|
106
|
+
TableCaption.displayName = "TableCaption"
|
|
107
107
|
|
|
108
108
|
export {
|
|
109
109
|
Table,
|
|
@@ -114,4 +114,4 @@ export {
|
|
|
114
114
|
TableRow,
|
|
115
115
|
TableCell,
|
|
116
116
|
TableCaption,
|
|
117
|
-
}
|
|
117
|
+
}
|
package/src/components/tabs.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs"
|
|
3
3
|
|
|
4
|
-
import { cn } from "
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
5
|
|
|
6
|
-
const Tabs = TabsPrimitive.Root
|
|
6
|
+
const Tabs = TabsPrimitive.Root
|
|
7
7
|
|
|
8
8
|
const TabsList = React.forwardRef<
|
|
9
9
|
React.ElementRef<typeof TabsPrimitive.List>,
|
|
@@ -17,8 +17,8 @@ const TabsList = React.forwardRef<
|
|
|
17
17
|
)}
|
|
18
18
|
{...props}
|
|
19
19
|
/>
|
|
20
|
-
))
|
|
21
|
-
TabsList.displayName = TabsPrimitive.List.displayName
|
|
20
|
+
))
|
|
21
|
+
TabsList.displayName = TabsPrimitive.List.displayName
|
|
22
22
|
|
|
23
23
|
const TabsTrigger = React.forwardRef<
|
|
24
24
|
React.ElementRef<typeof TabsPrimitive.Trigger>,
|
|
@@ -32,8 +32,8 @@ const TabsTrigger = React.forwardRef<
|
|
|
32
32
|
)}
|
|
33
33
|
{...props}
|
|
34
34
|
/>
|
|
35
|
-
))
|
|
36
|
-
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
|
|
35
|
+
))
|
|
36
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
|
|
37
37
|
|
|
38
38
|
const TabsContent = React.forwardRef<
|
|
39
39
|
React.ElementRef<typeof TabsPrimitive.Content>,
|
|
@@ -47,7 +47,7 @@ const TabsContent = React.forwardRef<
|
|
|
47
47
|
)}
|
|
48
48
|
{...props}
|
|
49
49
|
/>
|
|
50
|
-
))
|
|
51
|
-
TabsContent.displayName = TabsPrimitive.Content.displayName
|
|
50
|
+
))
|
|
51
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName
|
|
52
52
|
|
|
53
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent }
|
|
53
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React from "react"
|
|
1
|
+
import * as React from "react"
|
|
2
2
|
|
|
3
|
-
import { cn } from "
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
4
|
|
|
5
5
|
const Textarea = React.forwardRef<
|
|
6
6
|
HTMLTextAreaElement,
|
|
@@ -15,8 +15,8 @@ const Textarea = React.forwardRef<
|
|
|
15
15
|
ref={ref}
|
|
16
16
|
{...props}
|
|
17
17
|
/>
|
|
18
|
-
)
|
|
19
|
-
})
|
|
20
|
-
Textarea.displayName = "Textarea"
|
|
18
|
+
)
|
|
19
|
+
})
|
|
20
|
+
Textarea.displayName = "Textarea"
|
|
21
21
|
|
|
22
|
-
export { Textarea }
|
|
22
|
+
export { Textarea }
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import { cn } from "
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
|
|
5
|
+
import type { VariantProps } from "class-variance-authority"
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
import { toggleVariants } from "@/components/toggle"
|
|
8
9
|
|
|
9
10
|
const ToggleGroupContext = React.createContext<
|
|
10
11
|
VariantProps<typeof toggleVariants>
|
|
11
12
|
>({
|
|
12
13
|
size: "default",
|
|
13
14
|
variant: "default",
|
|
14
|
-
})
|
|
15
|
+
})
|
|
15
16
|
|
|
16
17
|
const ToggleGroup = React.forwardRef<
|
|
17
18
|
React.ElementRef<typeof ToggleGroupPrimitive.Root>,
|
|
@@ -27,16 +28,16 @@ const ToggleGroup = React.forwardRef<
|
|
|
27
28
|
{children}
|
|
28
29
|
</ToggleGroupContext.Provider>
|
|
29
30
|
</ToggleGroupPrimitive.Root>
|
|
30
|
-
))
|
|
31
|
+
))
|
|
31
32
|
|
|
32
|
-
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName
|
|
33
|
+
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName
|
|
33
34
|
|
|
34
35
|
const ToggleGroupItem = React.forwardRef<
|
|
35
36
|
React.ElementRef<typeof ToggleGroupPrimitive.Item>,
|
|
36
37
|
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
|
|
37
38
|
VariantProps<typeof toggleVariants>
|
|
38
39
|
>(({ className, children, variant, size, ...props }, ref) => {
|
|
39
|
-
const context = React.useContext(ToggleGroupContext)
|
|
40
|
+
const context = React.useContext(ToggleGroupContext)
|
|
40
41
|
|
|
41
42
|
return (
|
|
42
43
|
<ToggleGroupPrimitive.Item
|
|
@@ -52,9 +53,9 @@ const ToggleGroupItem = React.forwardRef<
|
|
|
52
53
|
>
|
|
53
54
|
{children}
|
|
54
55
|
</ToggleGroupPrimitive.Item>
|
|
55
|
-
)
|
|
56
|
-
})
|
|
56
|
+
)
|
|
57
|
+
})
|
|
57
58
|
|
|
58
|
-
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName
|
|
59
|
+
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName
|
|
59
60
|
|
|
60
|
-
export { ToggleGroup, ToggleGroupItem }
|
|
61
|
+
export { ToggleGroup, ToggleGroupItem }
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle"
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
4
|
|
|
5
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
6
|
|
|
7
7
|
const toggleVariants = cva(
|
|
8
8
|
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2",
|
|
@@ -24,7 +24,7 @@ const toggleVariants = cva(
|
|
|
24
24
|
size: "default",
|
|
25
25
|
},
|
|
26
26
|
}
|
|
27
|
-
)
|
|
27
|
+
)
|
|
28
28
|
|
|
29
29
|
const Toggle = React.forwardRef<
|
|
30
30
|
React.ElementRef<typeof TogglePrimitive.Root>,
|
|
@@ -36,8 +36,8 @@ const Toggle = React.forwardRef<
|
|
|
36
36
|
className={cn(toggleVariants({ variant, size, className }))}
|
|
37
37
|
{...props}
|
|
38
38
|
/>
|
|
39
|
-
))
|
|
39
|
+
))
|
|
40
40
|
|
|
41
|
-
Toggle.displayName = TogglePrimitive.Root.displayName
|
|
41
|
+
Toggle.displayName = TogglePrimitive.Root.displayName
|
|
42
42
|
|
|
43
|
-
export { Toggle, toggleVariants }
|
|
43
|
+
export { Toggle, toggleVariants }
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
|
|
5
5
|
|
|
6
|
-
import { cn } from "
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
7
|
|
|
8
|
-
const TooltipProvider = TooltipPrimitive.Provider
|
|
8
|
+
const TooltipProvider = TooltipPrimitive.Provider
|
|
9
9
|
|
|
10
|
-
const Tooltip = TooltipPrimitive.Root
|
|
10
|
+
const Tooltip = TooltipPrimitive.Root
|
|
11
11
|
|
|
12
|
-
const TooltipTrigger = TooltipPrimitive.Trigger
|
|
12
|
+
const TooltipTrigger = TooltipPrimitive.Trigger
|
|
13
13
|
|
|
14
14
|
const TooltipContent = React.forwardRef<
|
|
15
15
|
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
@@ -24,7 +24,7 @@ const TooltipContent = React.forwardRef<
|
|
|
24
24
|
)}
|
|
25
25
|
{...props}
|
|
26
26
|
/>
|
|
27
|
-
))
|
|
28
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName
|
|
27
|
+
))
|
|
28
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName
|
|
29
29
|
|
|
30
|
-
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
|
30
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
package/src/globals.css
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
@import "tailwindcss";
|
|
2
|
+
@import "tw-animate-css";
|
|
3
|
+
|
|
4
|
+
@custom-variant dark (&:is(.dark *));
|
|
2
5
|
|
|
3
6
|
@theme {
|
|
4
7
|
--color-background: hsl(0 0% 100%);
|
|
@@ -75,3 +78,45 @@ body {
|
|
|
75
78
|
background-color: var(--color-background);
|
|
76
79
|
color: var(--color-foreground);
|
|
77
80
|
}
|
|
81
|
+
|
|
82
|
+
:root {
|
|
83
|
+
--sidebar: hsl(0 0% 98%);
|
|
84
|
+
--sidebar-foreground: hsl(240 5.3% 26.1%);
|
|
85
|
+
--sidebar-primary: hsl(240 5.9% 10%);
|
|
86
|
+
--sidebar-primary-foreground: hsl(0 0% 98%);
|
|
87
|
+
--sidebar-accent: hsl(240 4.8% 95.9%);
|
|
88
|
+
--sidebar-accent-foreground: hsl(240 5.9% 10%);
|
|
89
|
+
--sidebar-border: hsl(220 13% 91%);
|
|
90
|
+
--sidebar-ring: hsl(217.2 91.2% 59.8%);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.dark {
|
|
94
|
+
--sidebar: hsl(240 5.9% 10%);
|
|
95
|
+
--sidebar-foreground: hsl(240 4.8% 95.9%);
|
|
96
|
+
--sidebar-primary: hsl(224.3 76.3% 48%);
|
|
97
|
+
--sidebar-primary-foreground: hsl(0 0% 100%);
|
|
98
|
+
--sidebar-accent: hsl(240 3.7% 15.9%);
|
|
99
|
+
--sidebar-accent-foreground: hsl(240 4.8% 95.9%);
|
|
100
|
+
--sidebar-border: hsl(240 3.7% 15.9%);
|
|
101
|
+
--sidebar-ring: hsl(217.2 91.2% 59.8%);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@theme inline {
|
|
105
|
+
--color-sidebar: var(--sidebar);
|
|
106
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
107
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
108
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
109
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
110
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
111
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
112
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@layer base {
|
|
116
|
+
* {
|
|
117
|
+
@apply border-border outline-ring/50;
|
|
118
|
+
}
|
|
119
|
+
body {
|
|
120
|
+
@apply bg-background text-foreground;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
const MOBILE_BREAKPOINT = 768
|
|
4
|
+
|
|
5
|
+
export function useIsMobile() {
|
|
6
|
+
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
|
|
7
|
+
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
|
|
10
|
+
const onChange = () => {
|
|
11
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
|
12
|
+
}
|
|
13
|
+
mql.addEventListener("change", onChange)
|
|
14
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
|
|
15
|
+
return () => mql.removeEventListener("change", onChange)
|
|
16
|
+
}, [])
|
|
17
|
+
|
|
18
|
+
return !!isMobile
|
|
19
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -318,5 +318,83 @@ export {
|
|
|
318
318
|
TooltipTrigger,
|
|
319
319
|
} from "./components/tooltip";
|
|
320
320
|
|
|
321
|
+
// Button Group
|
|
322
|
+
export {
|
|
323
|
+
ButtonGroup,
|
|
324
|
+
ButtonGroupSeparator,
|
|
325
|
+
ButtonGroupText,
|
|
326
|
+
buttonGroupVariants,
|
|
327
|
+
} from "./components/button-group";
|
|
328
|
+
|
|
329
|
+
// Chart
|
|
330
|
+
export {
|
|
331
|
+
ChartContainer,
|
|
332
|
+
ChartLegend,
|
|
333
|
+
ChartLegendContent,
|
|
334
|
+
ChartStyle,
|
|
335
|
+
ChartTooltip,
|
|
336
|
+
ChartTooltipContent,
|
|
337
|
+
type ChartConfig,
|
|
338
|
+
} from "./components/chart";
|
|
339
|
+
|
|
340
|
+
// Form
|
|
341
|
+
export {
|
|
342
|
+
Form,
|
|
343
|
+
FormControl,
|
|
344
|
+
FormDescription,
|
|
345
|
+
FormField,
|
|
346
|
+
FormItem,
|
|
347
|
+
FormLabel,
|
|
348
|
+
FormMessage,
|
|
349
|
+
useFormField,
|
|
350
|
+
} from "./components/form";
|
|
351
|
+
|
|
352
|
+
// Input Group
|
|
353
|
+
export {
|
|
354
|
+
InputGroup,
|
|
355
|
+
InputGroupAddon,
|
|
356
|
+
InputGroupButton,
|
|
357
|
+
InputGroupInput,
|
|
358
|
+
InputGroupText,
|
|
359
|
+
InputGroupTextarea,
|
|
360
|
+
} from "./components/input-group";
|
|
361
|
+
|
|
362
|
+
// Kbd
|
|
363
|
+
export { Kbd, KbdGroup } from "./components/kbd";
|
|
364
|
+
|
|
365
|
+
// Sidebar
|
|
366
|
+
export {
|
|
367
|
+
Sidebar,
|
|
368
|
+
SidebarContent,
|
|
369
|
+
SidebarFooter,
|
|
370
|
+
SidebarGroup,
|
|
371
|
+
SidebarGroupAction,
|
|
372
|
+
SidebarGroupContent,
|
|
373
|
+
SidebarGroupLabel,
|
|
374
|
+
SidebarHeader,
|
|
375
|
+
SidebarInput,
|
|
376
|
+
SidebarInset,
|
|
377
|
+
SidebarMenu,
|
|
378
|
+
SidebarMenuAction,
|
|
379
|
+
SidebarMenuBadge,
|
|
380
|
+
SidebarMenuButton,
|
|
381
|
+
SidebarMenuItem,
|
|
382
|
+
SidebarMenuSkeleton,
|
|
383
|
+
SidebarMenuSub,
|
|
384
|
+
SidebarMenuSubButton,
|
|
385
|
+
SidebarMenuSubItem,
|
|
386
|
+
SidebarProvider,
|
|
387
|
+
SidebarRail,
|
|
388
|
+
SidebarSeparator,
|
|
389
|
+
SidebarTrigger,
|
|
390
|
+
useSidebar,
|
|
391
|
+
} from "./components/sidebar";
|
|
392
|
+
|
|
393
|
+
// Spinner
|
|
394
|
+
export { Spinner } from "./components/spinner";
|
|
395
|
+
|
|
396
|
+
// Hooks
|
|
397
|
+
export { useIsMobile } from "./hooks/use-mobile";
|
|
398
|
+
|
|
321
399
|
// Utilities
|
|
322
400
|
export { cn } from "./lib/utils";
|