@blips/ui 0.0.1 → 2.0.0

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.
Files changed (60) hide show
  1. package/dist/index.cjs +4308 -2010
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +435 -411
  4. package/dist/index.d.ts +435 -411
  5. package/dist/index.js +4244 -2008
  6. package/dist/index.js.map +1 -1
  7. package/package.json +18 -4
  8. package/src/components/accordion.tsx +58 -48
  9. package/src/components/alert-dialog.tsx +170 -112
  10. package/src/components/alert.tsx +49 -42
  11. package/src/components/aspect-ratio.tsx +9 -3
  12. package/src/components/avatar.tsx +109 -50
  13. package/src/components/badge.tsx +29 -17
  14. package/src/components/breadcrumb.tsx +81 -87
  15. package/src/components/button-group.tsx +83 -0
  16. package/src/components/button.tsx +40 -32
  17. package/src/components/calendar.tsx +49 -45
  18. package/src/components/card.tsx +77 -71
  19. package/src/components/carousel.tsx +150 -168
  20. package/src/components/chart.tsx +357 -0
  21. package/src/components/checkbox.tsx +28 -24
  22. package/src/components/collapsible.tsx +28 -6
  23. package/src/components/command.tsx +144 -110
  24. package/src/components/context-menu.tsx +220 -166
  25. package/src/components/dialog.tsx +131 -95
  26. package/src/components/drawer.tsx +105 -86
  27. package/src/components/dropdown-menu.tsx +234 -177
  28. package/src/components/form.tsx +167 -0
  29. package/src/components/hover-card.tsx +39 -22
  30. package/src/components/input-group.tsx +175 -0
  31. package/src/components/input-otp.tsx +56 -48
  32. package/src/components/input.tsx +18 -19
  33. package/src/components/kbd.tsx +28 -0
  34. package/src/components/label.tsx +20 -22
  35. package/src/components/menubar.tsx +221 -199
  36. package/src/components/navigation-menu.tsx +144 -102
  37. package/src/components/pagination.tsx +102 -91
  38. package/src/components/popover.tsx +86 -26
  39. package/src/components/progress.tsx +27 -24
  40. package/src/components/radio-group.tsx +28 -25
  41. package/src/components/resizable.tsx +42 -34
  42. package/src/components/scroll-area.tsx +54 -42
  43. package/src/components/select.tsx +165 -135
  44. package/src/components/separator.tsx +16 -17
  45. package/src/components/sheet.tsx +116 -113
  46. package/src/components/sidebar.tsx +726 -0
  47. package/src/components/skeleton.tsx +6 -8
  48. package/src/components/slider.tsx +60 -23
  49. package/src/components/sonner.tsx +25 -30
  50. package/src/components/spinner.tsx +16 -0
  51. package/src/components/switch.tsx +30 -22
  52. package/src/components/table.tsx +96 -97
  53. package/src/components/tabs.tsx +91 -53
  54. package/src/components/textarea.tsx +8 -12
  55. package/src/components/toggle-group.tsx +60 -37
  56. package/src/components/toggle.tsx +28 -24
  57. package/src/components/tooltip.tsx +50 -23
  58. package/src/globals.css +230 -68
  59. package/src/hooks/use-mobile.tsx +19 -0
  60. package/src/index.ts +105 -6
@@ -1,141 +1,175 @@
1
- import type { DialogProps } from "@radix-ui/react-dialog";
2
- import { Command as CommandPrimitive } from "cmdk";
3
- import { Search } from "lucide-react";
4
- import * as React from "react";
5
- import { Dialog, DialogContent } from "./dialog";
6
- import { cn } from "../lib/utils";
1
+ "use client"
7
2
 
8
- const Command = React.forwardRef<
9
- React.ElementRef<typeof CommandPrimitive>,
10
- React.ComponentPropsWithoutRef<typeof CommandPrimitive>
11
- >(({ className, ...props }, ref) => (
12
- <CommandPrimitive
13
- ref={ref}
14
- className={cn(
15
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
16
- className
17
- )}
18
- {...props}
19
- />
20
- ));
21
- Command.displayName = CommandPrimitive.displayName;
3
+ import * as React from "react"
4
+ import { Command as CommandPrimitive } from "cmdk"
5
+ import { MagnifyingGlass } from "@phosphor-icons/react"
22
6
 
23
- const CommandDialog = ({ children, ...props }: DialogProps) => {
7
+ import { cn } from "../lib/utils"
8
+ import {
9
+ Dialog,
10
+ DialogContent,
11
+ DialogDescription,
12
+ DialogHeader,
13
+ DialogTitle,
14
+ } from "./dialog"
15
+
16
+ function Command({
17
+ className,
18
+ ...props
19
+ }: React.ComponentProps<typeof CommandPrimitive>) {
20
+ return (
21
+ <CommandPrimitive
22
+ data-slot="command"
23
+ className={cn(
24
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
25
+ className
26
+ )}
27
+ {...props}
28
+ />
29
+ )
30
+ }
31
+
32
+ function CommandDialog({
33
+ title = "Command Palette",
34
+ description = "Search for a command to run...",
35
+ children,
36
+ className,
37
+ showCloseButton = true,
38
+ ...props
39
+ }: React.ComponentProps<typeof Dialog> & {
40
+ title?: string
41
+ description?: string
42
+ className?: string
43
+ showCloseButton?: boolean
44
+ }) {
24
45
  return (
25
46
  <Dialog {...props}>
26
- <DialogContent className="overflow-hidden p-0 shadow-lg">
27
- <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
47
+ <DialogHeader className="sr-only">
48
+ <DialogTitle>{title}</DialogTitle>
49
+ <DialogDescription>{description}</DialogDescription>
50
+ </DialogHeader>
51
+ <DialogContent
52
+ className={cn("overflow-hidden p-0", className)}
53
+ showCloseButton={showCloseButton}
54
+ >
55
+ <Command className="**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
28
56
  {children}
29
57
  </Command>
30
58
  </DialogContent>
31
59
  </Dialog>
32
- );
33
- };
60
+ )
61
+ }
34
62
 
35
- const CommandInput = React.forwardRef<
36
- React.ElementRef<typeof CommandPrimitive.Input>,
37
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
38
- >(({ className, ...props }, ref) => (
39
- <div className="flex items-center border-b px-3" cmdk-input-wrapper="">
40
- <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
41
- <CommandPrimitive.Input
42
- ref={ref}
63
+ function CommandInput({
64
+ className,
65
+ ...props
66
+ }: React.ComponentProps<typeof CommandPrimitive.Input>) {
67
+ return (
68
+ <div
69
+ data-slot="command-input-wrapper"
70
+ className="flex h-9 items-center gap-2 border-b px-3"
71
+ >
72
+ <MagnifyingGlass className="size-4 shrink-0 opacity-50" />
73
+ <CommandPrimitive.Input
74
+ data-slot="command-input"
75
+ className={cn(
76
+ "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
77
+ className
78
+ )}
79
+ {...props}
80
+ />
81
+ </div>
82
+ )
83
+ }
84
+
85
+ function CommandList({
86
+ className,
87
+ ...props
88
+ }: React.ComponentProps<typeof CommandPrimitive.List>) {
89
+ return (
90
+ <CommandPrimitive.List
91
+ data-slot="command-list"
43
92
  className={cn(
44
- "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
93
+ "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
45
94
  className
46
95
  )}
47
96
  {...props}
48
97
  />
49
- </div>
50
- ));
51
-
52
- CommandInput.displayName = CommandPrimitive.Input.displayName;
53
-
54
- const CommandList = React.forwardRef<
55
- React.ElementRef<typeof CommandPrimitive.List>,
56
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
57
- >(({ className, ...props }, ref) => (
58
- <CommandPrimitive.List
59
- ref={ref}
60
- className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
61
- {...props}
62
- />
63
- ));
64
-
65
- CommandList.displayName = CommandPrimitive.List.displayName;
66
-
67
- const CommandEmpty = React.forwardRef<
68
- React.ElementRef<typeof CommandPrimitive.Empty>,
69
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
70
- >((props, ref) => (
71
- <CommandPrimitive.Empty
72
- ref={ref}
73
- className="py-6 text-center text-sm"
74
- {...props}
75
- />
76
- ));
77
-
78
- CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
79
-
80
- const CommandGroup = React.forwardRef<
81
- React.ElementRef<typeof CommandPrimitive.Group>,
82
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
83
- >(({ className, ...props }, ref) => (
84
- <CommandPrimitive.Group
85
- ref={ref}
86
- className={cn(
87
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
88
- className
89
- )}
90
- {...props}
91
- />
92
- ));
98
+ )
99
+ }
93
100
 
94
- CommandGroup.displayName = CommandPrimitive.Group.displayName;
101
+ function CommandEmpty({
102
+ ...props
103
+ }: React.ComponentProps<typeof CommandPrimitive.Empty>) {
104
+ return (
105
+ <CommandPrimitive.Empty
106
+ data-slot="command-empty"
107
+ className="py-6 text-center text-sm"
108
+ {...props}
109
+ />
110
+ )
111
+ }
95
112
 
96
- const CommandSeparator = React.forwardRef<
97
- React.ElementRef<typeof CommandPrimitive.Separator>,
98
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
99
- >(({ className, ...props }, ref) => (
100
- <CommandPrimitive.Separator
101
- ref={ref}
102
- className={cn("-mx-1 h-px bg-border", className)}
103
- {...props}
104
- />
105
- ));
106
- CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
113
+ function CommandGroup({
114
+ className,
115
+ ...props
116
+ }: React.ComponentProps<typeof CommandPrimitive.Group>) {
117
+ return (
118
+ <CommandPrimitive.Group
119
+ data-slot="command-group"
120
+ className={cn(
121
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
122
+ className
123
+ )}
124
+ {...props}
125
+ />
126
+ )
127
+ }
107
128
 
108
- const CommandItem = React.forwardRef<
109
- React.ElementRef<typeof CommandPrimitive.Item>,
110
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
111
- >(({ className, ...props }, ref) => (
112
- <CommandPrimitive.Item
113
- ref={ref}
114
- className={cn(
115
- "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
116
- className
117
- )}
118
- {...props}
119
- />
120
- ));
129
+ function CommandSeparator({
130
+ className,
131
+ ...props
132
+ }: React.ComponentProps<typeof CommandPrimitive.Separator>) {
133
+ return (
134
+ <CommandPrimitive.Separator
135
+ data-slot="command-separator"
136
+ className={cn("-mx-1 h-px bg-border", className)}
137
+ {...props}
138
+ />
139
+ )
140
+ }
121
141
 
122
- CommandItem.displayName = CommandPrimitive.Item.displayName;
142
+ function CommandItem({
143
+ className,
144
+ ...props
145
+ }: React.ComponentProps<typeof CommandPrimitive.Item>) {
146
+ return (
147
+ <CommandPrimitive.Item
148
+ data-slot="command-item"
149
+ className={cn(
150
+ "relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
151
+ className
152
+ )}
153
+ {...props}
154
+ />
155
+ )
156
+ }
123
157
 
124
- const CommandShortcut = ({
158
+ function CommandShortcut({
125
159
  className,
126
160
  ...props
127
- }: React.HTMLAttributes<HTMLSpanElement>) => {
161
+ }: React.ComponentProps<"span">) {
128
162
  return (
129
163
  <span
164
+ data-slot="command-shortcut"
130
165
  className={cn(
131
166
  "ml-auto text-xs tracking-widest text-muted-foreground",
132
167
  className
133
168
  )}
134
169
  {...props}
135
170
  />
136
- );
137
- };
138
- CommandShortcut.displayName = "CommandShortcut";
171
+ )
172
+ }
139
173
 
140
174
  export {
141
175
  Command,
@@ -147,4 +181,4 @@ export {
147
181
  CommandItem,
148
182
  CommandShortcut,
149
183
  CommandSeparator,
150
- };
184
+ }