@hobenakicoffee/libraries 1.27.0 → 1.29.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 (39) hide show
  1. package/package.json +5 -39
  2. package/src/nuqs/common.ts +12 -0
  3. package/src/nuqs/index.ts +2 -0
  4. package/src/nuqs/transactions.ts +31 -0
  5. package/src/types/supabase.ts +30 -0
  6. package/src/components/ui/alert-dialog.tsx +0 -196
  7. package/src/components/ui/alert.tsx +0 -76
  8. package/src/components/ui/avatar.tsx +0 -110
  9. package/src/components/ui/badge.tsx +0 -49
  10. package/src/components/ui/breadcrumb.tsx +0 -122
  11. package/src/components/ui/button-group.tsx +0 -82
  12. package/src/components/ui/card.tsx +0 -100
  13. package/src/components/ui/chart.tsx +0 -364
  14. package/src/components/ui/checkbox.tsx +0 -30
  15. package/src/components/ui/dialog.tsx +0 -162
  16. package/src/components/ui/drawer.tsx +0 -126
  17. package/src/components/ui/dropdown-menu.tsx +0 -267
  18. package/src/components/ui/empty-minimal.tsx +0 -20
  19. package/src/components/ui/empty.tsx +0 -101
  20. package/src/components/ui/field.tsx +0 -235
  21. package/src/components/ui/input-group.tsx +0 -170
  22. package/src/components/ui/input-otp.tsx +0 -84
  23. package/src/components/ui/input.tsx +0 -37
  24. package/src/components/ui/item.tsx +0 -196
  25. package/src/components/ui/label.tsx +0 -19
  26. package/src/components/ui/popover.tsx +0 -87
  27. package/src/components/ui/radio-group.tsx +0 -47
  28. package/src/components/ui/select.tsx +0 -205
  29. package/src/components/ui/separator.tsx +0 -26
  30. package/src/components/ui/sheet.tsx +0 -141
  31. package/src/components/ui/sidebar.tsx +0 -699
  32. package/src/components/ui/skeleton.tsx +0 -13
  33. package/src/components/ui/sonner.tsx +0 -74
  34. package/src/components/ui/table.tsx +0 -114
  35. package/src/components/ui/tabs.tsx +0 -88
  36. package/src/components/ui/textarea.tsx +0 -35
  37. package/src/components/ui/toggle-group.tsx +0 -91
  38. package/src/components/ui/toggle.tsx +0 -44
  39. package/src/components/ui/tooltip.tsx +0 -59
@@ -1,196 +0,0 @@
1
- import { cva, type VariantProps } from "class-variance-authority";
2
- import { Slot } from "radix-ui";
3
- import type * as React from "react";
4
- import { Separator } from "@/components/ui/separator";
5
- import { cn } from "@/lib/utils";
6
-
7
- function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
8
- return (
9
- <div
10
- className={cn(
11
- "group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2",
12
- className
13
- )}
14
- data-slot="item-group"
15
- role="list"
16
- {...props}
17
- />
18
- );
19
- }
20
-
21
- function ItemSeparator({
22
- className,
23
- ...props
24
- }: React.ComponentProps<typeof Separator>) {
25
- return (
26
- <Separator
27
- className={cn("my-2", className)}
28
- data-slot="item-separator"
29
- orientation="horizontal"
30
- {...props}
31
- />
32
- );
33
- }
34
-
35
- const itemVariants = cva(
36
- "group/item flex w-full flex-wrap items-center rounded-xl border text-sm outline-none transition-colors duration-100 focus-visible:border-ring focus-visible:ring focus-visible:ring-ring [a]:transition-colors [a]:hover:bg-muted",
37
- {
38
- variants: {
39
- variant: {
40
- default: "border-transparent",
41
- outline: "border-border",
42
- muted: "border-transparent bg-muted/50",
43
- },
44
- size: {
45
- default: "gap-3.5 px-4 py-3.5",
46
- lg: "gap-3.5 px-4 py-3.5 md:px-6 md:py-6",
47
- sm: "gap-2.5 px-3 py-2.5",
48
- xs: "gap-2 px-2.5 py-2 [[data-slot=dropdown-menu-content]_&]:p-0",
49
- },
50
- },
51
- defaultVariants: {
52
- variant: "default",
53
- size: "default",
54
- },
55
- }
56
- );
57
-
58
- function Item({
59
- className,
60
- variant = "default",
61
- size = "default",
62
- asChild = false,
63
- ...props
64
- }: React.ComponentProps<"div"> &
65
- VariantProps<typeof itemVariants> & { asChild?: boolean }) {
66
- const Comp = asChild ? Slot.Root : "div";
67
- return (
68
- <Comp
69
- className={cn(itemVariants({ variant, size, className }))}
70
- data-size={size}
71
- data-slot="item"
72
- data-variant={variant}
73
- {...props}
74
- />
75
- );
76
- }
77
-
78
- const itemMediaVariants = cva(
79
- "flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:translate-y-0.5 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none",
80
- {
81
- variants: {
82
- variant: {
83
- default: "bg-transparent",
84
- icon: "[&_svg:not([class*='size-'])]:size-4",
85
- image:
86
- "size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover",
87
- },
88
- },
89
- defaultVariants: {
90
- variant: "default",
91
- },
92
- }
93
- );
94
-
95
- function ItemMedia({
96
- className,
97
- variant = "default",
98
- ...props
99
- }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>) {
100
- return (
101
- <div
102
- className={cn(itemMediaVariants({ variant, className }))}
103
- data-slot="item-media"
104
- data-variant={variant}
105
- {...props}
106
- />
107
- );
108
- }
109
-
110
- function ItemContent({ className, ...props }: React.ComponentProps<"div">) {
111
- return (
112
- <div
113
- className={cn(
114
- "flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none",
115
- className
116
- )}
117
- data-slot="item-content"
118
- {...props}
119
- />
120
- );
121
- }
122
-
123
- function ItemTitle({ className, ...props }: React.ComponentProps<"div">) {
124
- return (
125
- <div
126
- className={cn(
127
- "line-clamp-1 flex w-fit items-center gap-2 font-medium text-sm leading-snug underline-offset-4",
128
- className
129
- )}
130
- data-slot="item-title"
131
- {...props}
132
- />
133
- );
134
- }
135
-
136
- function ItemDescription({ className, ...props }: React.ComponentProps<"p">) {
137
- return (
138
- <p
139
- className={cn(
140
- "line-clamp-2 text-left font-normal text-muted-foreground text-sm leading-normal group-data-[size=xs]/item:text-xs [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
141
- className
142
- )}
143
- data-slot="item-description"
144
- {...props}
145
- />
146
- );
147
- }
148
-
149
- function ItemActions({ className, ...props }: React.ComponentProps<"div">) {
150
- return (
151
- <div
152
- className={cn("flex items-center gap-2", className)}
153
- data-slot="item-actions"
154
- {...props}
155
- />
156
- );
157
- }
158
-
159
- function ItemHeader({ className, ...props }: React.ComponentProps<"div">) {
160
- return (
161
- <div
162
- className={cn(
163
- "flex basis-full items-center justify-between gap-2",
164
- className
165
- )}
166
- data-slot="item-header"
167
- {...props}
168
- />
169
- );
170
- }
171
-
172
- function ItemFooter({ className, ...props }: React.ComponentProps<"div">) {
173
- return (
174
- <div
175
- className={cn(
176
- "flex basis-full items-center justify-between gap-2",
177
- className
178
- )}
179
- data-slot="item-footer"
180
- {...props}
181
- />
182
- );
183
- }
184
-
185
- export {
186
- Item,
187
- ItemMedia,
188
- ItemContent,
189
- ItemActions,
190
- ItemGroup,
191
- ItemSeparator,
192
- ItemTitle,
193
- ItemDescription,
194
- ItemHeader,
195
- ItemFooter,
196
- };
@@ -1,19 +0,0 @@
1
- import type * as React from "react";
2
-
3
- import { cn } from "@/lib/utils";
4
-
5
- function Label({ className, ...props }: React.ComponentProps<"label">) {
6
- return (
7
- // biome-ignore lint/a11y/noLabelWithoutControl: <shadcn components />
8
- <label
9
- className={cn(
10
- "flex select-none items-center gap-2 font-medium text-muted-foreground text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50 group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50",
11
- className
12
- )}
13
- data-slot="label"
14
- {...props}
15
- />
16
- );
17
- }
18
-
19
- export { Label };
@@ -1,87 +0,0 @@
1
- import { Popover as PopoverPrimitive } from "radix-ui";
2
- import type * as React from "react";
3
-
4
- import { cn } from "@/lib/utils";
5
-
6
- function Popover({
7
- ...props
8
- }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
9
- return <PopoverPrimitive.Root data-slot="popover" {...props} />;
10
- }
11
-
12
- function PopoverTrigger({
13
- ...props
14
- }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
15
- return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
16
- }
17
-
18
- function PopoverContent({
19
- className,
20
- align = "center",
21
- sideOffset = 4,
22
- ...props
23
- }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
24
- return (
25
- <PopoverPrimitive.Portal>
26
- <PopoverPrimitive.Content
27
- align={align}
28
- className={cn(
29
- "data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-popover-foreground text-sm shadow-md outline-hidden ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in",
30
- className
31
- )}
32
- data-slot="popover-content"
33
- sideOffset={sideOffset}
34
- {...props}
35
- />
36
- </PopoverPrimitive.Portal>
37
- );
38
- }
39
-
40
- function PopoverAnchor({
41
- ...props
42
- }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
43
- return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
44
- }
45
-
46
- function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
47
- return (
48
- <div
49
- className={cn("flex flex-col gap-1 text-sm", className)}
50
- data-slot="popover-header"
51
- {...props}
52
- />
53
- );
54
- }
55
-
56
- function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
57
- return (
58
- <div
59
- className={cn("font-medium", className)}
60
- data-slot="popover-title"
61
- {...props}
62
- />
63
- );
64
- }
65
-
66
- function PopoverDescription({
67
- className,
68
- ...props
69
- }: React.ComponentProps<"p">) {
70
- return (
71
- <p
72
- className={cn("text-muted-foreground", className)}
73
- data-slot="popover-description"
74
- {...props}
75
- />
76
- );
77
- }
78
-
79
- export {
80
- Popover,
81
- PopoverAnchor,
82
- PopoverContent,
83
- PopoverDescription,
84
- PopoverHeader,
85
- PopoverTitle,
86
- PopoverTrigger,
87
- };
@@ -1,47 +0,0 @@
1
- import { CircleIcon } from "@hugeicons/core-free-icons";
2
- import { HugeiconsIcon } from "@hugeicons/react";
3
- import { RadioGroup as RadioGroupPrimitive } from "radix-ui";
4
- import type * as React from "react";
5
- import { cn } from "@/lib/utils";
6
-
7
- function RadioGroup({
8
- className,
9
- ...props
10
- }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
11
- return (
12
- <RadioGroupPrimitive.Root
13
- className={cn("grid w-full gap-3", className)}
14
- data-slot="radio-group"
15
- {...props}
16
- />
17
- );
18
- }
19
-
20
- function RadioGroupItem({
21
- className,
22
- ...props
23
- }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
24
- return (
25
- <RadioGroupPrimitive.Item
26
- className={cn(
27
- "group/radio-group-item peer relative flex aspect-square size-5 shrink-0 rounded-full border-2 border-input text-primary shadow-xs outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[state=checked]:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
28
- className
29
- )}
30
- data-slot="radio-group-item"
31
- {...props}
32
- >
33
- <RadioGroupPrimitive.Indicator
34
- className="flex size-5 items-center justify-center text-primary group-aria-invalid/radio-group-item:text-destructive"
35
- data-slot="radio-group-indicator"
36
- >
37
- <HugeiconsIcon
38
- className="absolute top-1/2 left-1/2 size-2.5 -translate-x-1/2 -translate-y-1/2 fill-current"
39
- icon={CircleIcon}
40
- strokeWidth={2}
41
- />
42
- </RadioGroupPrimitive.Indicator>
43
- </RadioGroupPrimitive.Item>
44
- );
45
- }
46
-
47
- export { RadioGroup, RadioGroupItem };
@@ -1,205 +0,0 @@
1
- import {
2
- ArrowDown01Icon,
3
- ArrowUp01Icon,
4
- Tick02Icon,
5
- UnfoldMoreIcon,
6
- } from "@hugeicons/core-free-icons";
7
- import { HugeiconsIcon } from "@hugeicons/react";
8
- import { Select as SelectPrimitive } from "radix-ui";
9
- import type * as React from "react";
10
- import { cn } from "@/lib/utils";
11
-
12
- function Select({
13
- ...props
14
- }: React.ComponentProps<typeof SelectPrimitive.Root>) {
15
- return <SelectPrimitive.Root data-slot="select" {...props} />;
16
- }
17
-
18
- function SelectGroup({
19
- className,
20
- ...props
21
- }: React.ComponentProps<typeof SelectPrimitive.Group>) {
22
- return (
23
- <SelectPrimitive.Group
24
- className={cn("scroll-my-1 p-1", className)}
25
- data-slot="select-group"
26
- {...props}
27
- />
28
- );
29
- }
30
-
31
- function SelectValue({
32
- ...props
33
- }: React.ComponentProps<typeof SelectPrimitive.Value>) {
34
- return <SelectPrimitive.Value data-slot="select-value" {...props} />;
35
- }
36
-
37
- function SelectTrigger({
38
- className,
39
- size = "default",
40
- children,
41
- ...props
42
- }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
43
- size?: "sm" | "default";
44
- }) {
45
- return (
46
- <SelectPrimitive.Trigger
47
- className={cn(
48
- "flex w-fit items-center justify-between gap-1.5 whitespace-nowrap rounded-xl border border-input bg-transparent py-2 pr-2 pl-3 text-sm outline-none transition-[color] focus-visible:border-ring focus-visible:ring focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 data-[size=default]:h-12 data-[size=sm]:h-8 data-placeholder:text-muted-foregroun *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:hover:bg-input/50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
49
- className
50
- )}
51
- data-size={size}
52
- data-slot="select-trigger"
53
- {...props}
54
- >
55
- {children}
56
- <SelectPrimitive.Icon asChild>
57
- <HugeiconsIcon
58
- className="pointer-events-none size-4 text-muted-foreground"
59
- icon={UnfoldMoreIcon}
60
- strokeWidth={2}
61
- />
62
- </SelectPrimitive.Icon>
63
- </SelectPrimitive.Trigger>
64
- );
65
- }
66
-
67
- function SelectContent({
68
- className,
69
- children,
70
- position = "item-aligned",
71
- align = "center",
72
- ...props
73
- }: React.ComponentProps<typeof SelectPrimitive.Content>) {
74
- return (
75
- <SelectPrimitive.Portal>
76
- <SelectPrimitive.Content
77
- align={align}
78
- className={cn(
79
- "data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-xl bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in",
80
- position === "popper" &&
81
- "data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",
82
- className
83
- )}
84
- data-slot="select-content"
85
- position={position}
86
- {...props}
87
- >
88
- <SelectScrollUpButton />
89
- <SelectPrimitive.Viewport
90
- className={cn(
91
- "data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",
92
- position === "popper" && ""
93
- )}
94
- data-position={position}
95
- >
96
- {children}
97
- </SelectPrimitive.Viewport>
98
- <SelectScrollDownButton />
99
- </SelectPrimitive.Content>
100
- </SelectPrimitive.Portal>
101
- );
102
- }
103
-
104
- function SelectLabel({
105
- className,
106
- ...props
107
- }: React.ComponentProps<typeof SelectPrimitive.Label>) {
108
- return (
109
- <SelectPrimitive.Label
110
- className={cn("px-2 py-1.5 text-muted-foreground text-xs", className)}
111
- data-slot="select-label"
112
- {...props}
113
- />
114
- );
115
- }
116
-
117
- function SelectItem({
118
- className,
119
- children,
120
- ...props
121
- }: React.ComponentProps<typeof SelectPrimitive.Item>) {
122
- return (
123
- <SelectPrimitive.Item
124
- className={cn(
125
- "relative flex w-full cursor-default select-none items-center gap-2 rounded-lg py-3 pr-8 pl-4 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
126
- className
127
- )}
128
- data-slot="select-item"
129
- {...props}
130
- >
131
- <span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center">
132
- <SelectPrimitive.ItemIndicator>
133
- <HugeiconsIcon
134
- className="pointer-events-none"
135
- icon={Tick02Icon}
136
- strokeWidth={2}
137
- />
138
- </SelectPrimitive.ItemIndicator>
139
- </span>
140
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
141
- </SelectPrimitive.Item>
142
- );
143
- }
144
-
145
- function SelectSeparator({
146
- className,
147
- ...props
148
- }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
149
- return (
150
- <SelectPrimitive.Separator
151
- className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
152
- data-slot="select-separator"
153
- {...props}
154
- />
155
- );
156
- }
157
-
158
- function SelectScrollUpButton({
159
- className,
160
- ...props
161
- }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
162
- return (
163
- <SelectPrimitive.ScrollUpButton
164
- className={cn(
165
- "z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
166
- className
167
- )}
168
- data-slot="select-scroll-up-button"
169
- {...props}
170
- >
171
- <HugeiconsIcon icon={ArrowUp01Icon} strokeWidth={2} />
172
- </SelectPrimitive.ScrollUpButton>
173
- );
174
- }
175
-
176
- function SelectScrollDownButton({
177
- className,
178
- ...props
179
- }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
180
- return (
181
- <SelectPrimitive.ScrollDownButton
182
- className={cn(
183
- "z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
184
- className
185
- )}
186
- data-slot="select-scroll-down-button"
187
- {...props}
188
- >
189
- <HugeiconsIcon icon={ArrowDown01Icon} strokeWidth={2} />
190
- </SelectPrimitive.ScrollDownButton>
191
- );
192
- }
193
-
194
- export {
195
- Select,
196
- SelectContent,
197
- SelectGroup,
198
- SelectItem,
199
- SelectLabel,
200
- SelectScrollDownButton,
201
- SelectScrollUpButton,
202
- SelectSeparator,
203
- SelectTrigger,
204
- SelectValue,
205
- };
@@ -1,26 +0,0 @@
1
- import { Separator as SeparatorPrimitive } from "radix-ui";
2
- import type * as React from "react";
3
-
4
- import { cn } from "@/lib/utils";
5
-
6
- function Separator({
7
- className,
8
- orientation = "horizontal",
9
- decorative = true,
10
- ...props
11
- }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
12
- return (
13
- <SeparatorPrimitive.Root
14
- className={cn(
15
- "shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch",
16
- className
17
- )}
18
- data-slot="separator"
19
- decorative={decorative}
20
- orientation={orientation}
21
- {...props}
22
- />
23
- );
24
- }
25
-
26
- export { Separator };