@kenshinx/ui 1.5.0 → 1.5.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.d.ts +127 -1
- package/dist/index.js +307 -2
- package/package.json +5 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
6
6
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
8
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
9
|
+
import { DialogProps } from '@radix-ui/react-dialog';
|
|
9
10
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
10
11
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
11
12
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
@@ -19,6 +20,8 @@ import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
|
19
20
|
import * as _radix_ui_react_slot from '@radix-ui/react-slot';
|
|
20
21
|
import * as react_hook_form from 'react-hook-form';
|
|
21
22
|
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
23
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
24
|
+
import { DayPicker } from 'react-day-picker';
|
|
22
25
|
|
|
23
26
|
/**
|
|
24
27
|
* Utility function to merge Tailwind CSS classes with clsx
|
|
@@ -197,4 +200,127 @@ declare const FormControl: React.ForwardRefExoticComponent<Omit<_radix_ui_react_
|
|
|
197
200
|
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
198
201
|
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
199
202
|
|
|
200
|
-
|
|
203
|
+
declare const Collapsible: React.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & React.RefAttributes<HTMLDivElement>>;
|
|
204
|
+
declare const CollapsibleTrigger: React.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
205
|
+
declare const CollapsibleContent: React.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
206
|
+
|
|
207
|
+
declare const Breadcrumb: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
208
|
+
separator?: React.ReactNode;
|
|
209
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
210
|
+
declare const BreadcrumbList: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
|
|
211
|
+
declare const BreadcrumbItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
212
|
+
declare const BreadcrumbLink: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
213
|
+
asChild?: boolean;
|
|
214
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
215
|
+
declare const BreadcrumbPage: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
216
|
+
declare const BreadcrumbSeparator: {
|
|
217
|
+
({ children, className, ...props }: React.ComponentProps<"li">): react_jsx_runtime.JSX.Element;
|
|
218
|
+
displayName: string;
|
|
219
|
+
};
|
|
220
|
+
declare const BreadcrumbEllipsis: {
|
|
221
|
+
({ className, ...props }: React.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
|
|
222
|
+
displayName: string;
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
|
226
|
+
declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
227
|
+
declare namespace Calendar {
|
|
228
|
+
var displayName: string;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
declare const Command: React.ForwardRefExoticComponent<Omit<{
|
|
232
|
+
children?: React.ReactNode;
|
|
233
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
234
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
235
|
+
} & {
|
|
236
|
+
asChild?: boolean;
|
|
237
|
+
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
238
|
+
label?: string;
|
|
239
|
+
shouldFilter?: boolean;
|
|
240
|
+
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
241
|
+
defaultValue?: string;
|
|
242
|
+
value?: string;
|
|
243
|
+
onValueChange?: (value: string) => void;
|
|
244
|
+
loop?: boolean;
|
|
245
|
+
disablePointerSelection?: boolean;
|
|
246
|
+
vimBindings?: boolean;
|
|
247
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
248
|
+
type CommandDialogProps = DialogProps;
|
|
249
|
+
declare const CommandDialog: ({ children, ...props }: CommandDialogProps) => react_jsx_runtime.JSX.Element;
|
|
250
|
+
declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
|
|
251
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
252
|
+
} & {
|
|
253
|
+
asChild?: boolean;
|
|
254
|
+
}, "asChild" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "value" | "onChange"> & {
|
|
255
|
+
value?: string;
|
|
256
|
+
onValueChange?: (search: string) => void;
|
|
257
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
258
|
+
declare const CommandList: React.ForwardRefExoticComponent<Omit<{
|
|
259
|
+
children?: React.ReactNode;
|
|
260
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
261
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
262
|
+
} & {
|
|
263
|
+
asChild?: boolean;
|
|
264
|
+
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
265
|
+
label?: string;
|
|
266
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
267
|
+
declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
|
|
268
|
+
children?: React.ReactNode;
|
|
269
|
+
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
270
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
271
|
+
} & {
|
|
272
|
+
asChild?: boolean;
|
|
273
|
+
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
274
|
+
declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
|
|
275
|
+
children?: React.ReactNode;
|
|
276
|
+
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
277
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
278
|
+
} & {
|
|
279
|
+
asChild?: boolean;
|
|
280
|
+
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
|
|
281
|
+
heading?: React.ReactNode;
|
|
282
|
+
value?: string;
|
|
283
|
+
forceMount?: boolean;
|
|
284
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
285
|
+
declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
286
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
287
|
+
} & {
|
|
288
|
+
asChild?: boolean;
|
|
289
|
+
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
290
|
+
alwaysRender?: boolean;
|
|
291
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
292
|
+
declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
293
|
+
children?: React.ReactNode;
|
|
294
|
+
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
295
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
296
|
+
} & {
|
|
297
|
+
asChild?: boolean;
|
|
298
|
+
}, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>>, "disabled" | "value" | "onSelect"> & {
|
|
299
|
+
disabled?: boolean;
|
|
300
|
+
onSelect?: (value: string) => void;
|
|
301
|
+
value?: string;
|
|
302
|
+
keywords?: string[];
|
|
303
|
+
forceMount?: boolean;
|
|
304
|
+
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
305
|
+
declare const CommandShortcut: {
|
|
306
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
|
|
307
|
+
displayName: string;
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
interface ComboboxOption {
|
|
311
|
+
value: string;
|
|
312
|
+
label: string;
|
|
313
|
+
}
|
|
314
|
+
interface ComboboxProps {
|
|
315
|
+
options: ComboboxOption[];
|
|
316
|
+
value?: string;
|
|
317
|
+
onValueChange?: (value: string) => void;
|
|
318
|
+
placeholder?: string;
|
|
319
|
+
emptyText?: string;
|
|
320
|
+
className?: string;
|
|
321
|
+
disabled?: boolean;
|
|
322
|
+
icon?: React.ReactNode;
|
|
323
|
+
}
|
|
324
|
+
declare function Combobox({ options, value, onValueChange, placeholder, emptyText, className, disabled, icon, }: ComboboxProps): react_jsx_runtime.JSX.Element;
|
|
325
|
+
|
|
326
|
+
export { Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, type ComboboxOption, type ComboboxProps, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, type InputProps, Label, Popover, PopoverContent, PopoverTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, alertVariants, badgeVariants, buttonVariants, cn, useFormField };
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { cva } from 'class-variance-authority';
|
|
|
7
7
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
8
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
9
9
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
10
|
-
import { X, Check, ChevronDown, ChevronUp, ChevronRight, Circle } from 'lucide-react';
|
|
10
|
+
import { X, Check, ChevronDown, ChevronUp, ChevronRight, Circle, Search, MoreHorizontal, ChevronLeft, ChevronsUpDown } from 'lucide-react';
|
|
11
11
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
12
12
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
13
13
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
@@ -19,6 +19,9 @@ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
|
19
19
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
20
20
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
21
21
|
import { useFormContext, useFormState, FormProvider, Controller } from 'react-hook-form';
|
|
22
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
23
|
+
import { DayPicker } from 'react-day-picker';
|
|
24
|
+
import { Command as Command$1 } from 'cmdk';
|
|
22
25
|
|
|
23
26
|
// src/lib/utils.ts
|
|
24
27
|
function cn(...inputs) {
|
|
@@ -1021,5 +1024,307 @@ var FormMessage = React19.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
1021
1024
|
);
|
|
1022
1025
|
});
|
|
1023
1026
|
FormMessage.displayName = "FormMessage";
|
|
1027
|
+
var Collapsible = CollapsiblePrimitive.Root;
|
|
1028
|
+
var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
|
|
1029
|
+
var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
|
|
1030
|
+
var Breadcrumb = React19.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
1031
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
1032
|
+
var BreadcrumbList = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1033
|
+
"ol",
|
|
1034
|
+
{
|
|
1035
|
+
ref,
|
|
1036
|
+
className: cn(
|
|
1037
|
+
"flex flex-wrap items-center gap-1.5 break-words text-sm text-slate-500 sm:gap-2.5 dark:text-slate-400",
|
|
1038
|
+
className
|
|
1039
|
+
),
|
|
1040
|
+
...props
|
|
1041
|
+
}
|
|
1042
|
+
));
|
|
1043
|
+
BreadcrumbList.displayName = "BreadcrumbList";
|
|
1044
|
+
var BreadcrumbItem = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1045
|
+
"li",
|
|
1046
|
+
{
|
|
1047
|
+
ref,
|
|
1048
|
+
className: cn("inline-flex items-center gap-1.5", className),
|
|
1049
|
+
...props
|
|
1050
|
+
}
|
|
1051
|
+
));
|
|
1052
|
+
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
1053
|
+
var BreadcrumbLink = React19.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
1054
|
+
const Comp = asChild ? Slot : "a";
|
|
1055
|
+
return /* @__PURE__ */ jsx(
|
|
1056
|
+
Comp,
|
|
1057
|
+
{
|
|
1058
|
+
ref,
|
|
1059
|
+
className: cn(
|
|
1060
|
+
"transition-colors hover:text-slate-950 dark:hover:text-slate-50",
|
|
1061
|
+
className
|
|
1062
|
+
),
|
|
1063
|
+
...props
|
|
1064
|
+
}
|
|
1065
|
+
);
|
|
1066
|
+
});
|
|
1067
|
+
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
1068
|
+
var BreadcrumbPage = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1069
|
+
"span",
|
|
1070
|
+
{
|
|
1071
|
+
ref,
|
|
1072
|
+
role: "link",
|
|
1073
|
+
"aria-disabled": "true",
|
|
1074
|
+
"aria-current": "page",
|
|
1075
|
+
className: cn("font-normal text-slate-950 dark:text-slate-50", className),
|
|
1076
|
+
...props
|
|
1077
|
+
}
|
|
1078
|
+
));
|
|
1079
|
+
BreadcrumbPage.displayName = "BreadcrumbPage";
|
|
1080
|
+
var BreadcrumbSeparator = ({
|
|
1081
|
+
children,
|
|
1082
|
+
className,
|
|
1083
|
+
...props
|
|
1084
|
+
}) => /* @__PURE__ */ jsx(
|
|
1085
|
+
"li",
|
|
1086
|
+
{
|
|
1087
|
+
role: "presentation",
|
|
1088
|
+
"aria-hidden": "true",
|
|
1089
|
+
className: cn("[&>svg]:size-3.5", className),
|
|
1090
|
+
...props,
|
|
1091
|
+
children: children ?? /* @__PURE__ */ jsx(ChevronRight, {})
|
|
1092
|
+
}
|
|
1093
|
+
);
|
|
1094
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator";
|
|
1095
|
+
var BreadcrumbEllipsis = ({
|
|
1096
|
+
className,
|
|
1097
|
+
...props
|
|
1098
|
+
}) => /* @__PURE__ */ jsxs(
|
|
1099
|
+
"span",
|
|
1100
|
+
{
|
|
1101
|
+
role: "presentation",
|
|
1102
|
+
"aria-hidden": "true",
|
|
1103
|
+
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
1104
|
+
...props,
|
|
1105
|
+
children: [
|
|
1106
|
+
/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }),
|
|
1107
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "More" })
|
|
1108
|
+
]
|
|
1109
|
+
}
|
|
1110
|
+
);
|
|
1111
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbElipssis";
|
|
1112
|
+
function Calendar({
|
|
1113
|
+
className,
|
|
1114
|
+
classNames,
|
|
1115
|
+
showOutsideDays = true,
|
|
1116
|
+
...props
|
|
1117
|
+
}) {
|
|
1118
|
+
return /* @__PURE__ */ jsx(
|
|
1119
|
+
DayPicker,
|
|
1120
|
+
{
|
|
1121
|
+
showOutsideDays,
|
|
1122
|
+
className: cn("p-3", className),
|
|
1123
|
+
classNames: {
|
|
1124
|
+
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
1125
|
+
month: "space-y-4",
|
|
1126
|
+
caption: "flex justify-center pt-1 relative items-center",
|
|
1127
|
+
caption_label: "text-sm font-medium",
|
|
1128
|
+
nav: "space-x-1 flex items-center",
|
|
1129
|
+
nav_button: cn(
|
|
1130
|
+
buttonVariants({ variant: "outline" }),
|
|
1131
|
+
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
1132
|
+
),
|
|
1133
|
+
nav_button_previous: "absolute left-1",
|
|
1134
|
+
nav_button_next: "absolute right-1",
|
|
1135
|
+
table: "w-full border-collapse space-y-1",
|
|
1136
|
+
head_row: "flex",
|
|
1137
|
+
head_cell: "text-slate-500 rounded-md w-9 font-normal text-[0.8rem] dark:text-slate-400",
|
|
1138
|
+
row: "flex w-full mt-2",
|
|
1139
|
+
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-slate-100/50 [&:has([aria-selected])]:bg-slate-100 first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20 dark:[&:has([aria-selected].day-outside)]:bg-slate-800/50 dark:[&:has([aria-selected])]:bg-slate-800",
|
|
1140
|
+
day: cn(
|
|
1141
|
+
buttonVariants({ variant: "ghost" }),
|
|
1142
|
+
"h-9 w-9 p-0 font-normal aria-selected:opacity-100"
|
|
1143
|
+
),
|
|
1144
|
+
day_range_end: "day-range-end",
|
|
1145
|
+
day_selected: "bg-slate-900 text-slate-50 hover:bg-slate-900 hover:text-slate-50 focus:bg-slate-900 focus:text-slate-50 dark:bg-slate-50 dark:text-slate-900 dark:hover:bg-slate-50 dark:hover:text-slate-900 dark:focus:bg-slate-50 dark:focus:text-slate-900",
|
|
1146
|
+
day_today: "bg-slate-100 text-slate-900 dark:bg-slate-800 dark:text-slate-50",
|
|
1147
|
+
day_outside: "day-outside text-slate-500 aria-selected:bg-slate-100/50 aria-selected:text-slate-500 opacity-50 dark:text-slate-400 dark:aria-selected:bg-slate-800/50 dark:aria-selected:text-slate-400",
|
|
1148
|
+
day_disabled: "text-slate-500 opacity-50 dark:text-slate-400",
|
|
1149
|
+
day_range_middle: "aria-selected:bg-slate-100 aria-selected:text-slate-900 dark:aria-selected:bg-slate-800 dark:aria-selected:text-slate-50",
|
|
1150
|
+
day_hidden: "invisible",
|
|
1151
|
+
...classNames
|
|
1152
|
+
},
|
|
1153
|
+
components: {
|
|
1154
|
+
IconLeft: () => /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }),
|
|
1155
|
+
IconRight: () => /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
1156
|
+
},
|
|
1157
|
+
...props
|
|
1158
|
+
}
|
|
1159
|
+
);
|
|
1160
|
+
}
|
|
1161
|
+
Calendar.displayName = "Calendar";
|
|
1162
|
+
var Command = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1163
|
+
Command$1,
|
|
1164
|
+
{
|
|
1165
|
+
ref,
|
|
1166
|
+
className: cn(
|
|
1167
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-white text-slate-950 dark:bg-slate-950 dark:text-slate-50",
|
|
1168
|
+
className
|
|
1169
|
+
),
|
|
1170
|
+
...props
|
|
1171
|
+
}
|
|
1172
|
+
));
|
|
1173
|
+
Command.displayName = Command$1.displayName;
|
|
1174
|
+
var CommandDialog = ({ children, ...props }) => {
|
|
1175
|
+
return /* @__PURE__ */ jsx(Dialog, { ...props, children: /* @__PURE__ */ jsx(DialogContent, { className: "overflow-hidden p-0 shadow-lg", children: /* @__PURE__ */ jsx(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-slate-500 dark:[&_[cmdk-group-heading]]:text-slate-400 [&_[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", children }) }) });
|
|
1176
|
+
};
|
|
1177
|
+
var CommandInput = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
1178
|
+
/* @__PURE__ */ jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
1179
|
+
/* @__PURE__ */ jsx(
|
|
1180
|
+
Command$1.Input,
|
|
1181
|
+
{
|
|
1182
|
+
ref,
|
|
1183
|
+
className: cn(
|
|
1184
|
+
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-slate-500 disabled:cursor-not-allowed disabled:opacity-50 dark:placeholder:text-slate-400",
|
|
1185
|
+
className
|
|
1186
|
+
),
|
|
1187
|
+
...props
|
|
1188
|
+
}
|
|
1189
|
+
)
|
|
1190
|
+
] }));
|
|
1191
|
+
CommandInput.displayName = Command$1.Input.displayName;
|
|
1192
|
+
var CommandList = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1193
|
+
Command$1.List,
|
|
1194
|
+
{
|
|
1195
|
+
ref,
|
|
1196
|
+
className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
|
|
1197
|
+
...props
|
|
1198
|
+
}
|
|
1199
|
+
));
|
|
1200
|
+
CommandList.displayName = Command$1.List.displayName;
|
|
1201
|
+
var CommandEmpty = React19.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
1202
|
+
Command$1.Empty,
|
|
1203
|
+
{
|
|
1204
|
+
ref,
|
|
1205
|
+
className: "py-6 text-center text-sm",
|
|
1206
|
+
...props
|
|
1207
|
+
}
|
|
1208
|
+
));
|
|
1209
|
+
CommandEmpty.displayName = Command$1.Empty.displayName;
|
|
1210
|
+
var CommandGroup = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1211
|
+
Command$1.Group,
|
|
1212
|
+
{
|
|
1213
|
+
ref,
|
|
1214
|
+
className: cn(
|
|
1215
|
+
"overflow-hidden p-1 text-slate-950 dark:text-slate-50 [&_[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-slate-500 dark:[&_[cmdk-group-heading]]:text-slate-400",
|
|
1216
|
+
className
|
|
1217
|
+
),
|
|
1218
|
+
...props
|
|
1219
|
+
}
|
|
1220
|
+
));
|
|
1221
|
+
CommandGroup.displayName = Command$1.Group.displayName;
|
|
1222
|
+
var CommandSeparator = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1223
|
+
Command$1.Separator,
|
|
1224
|
+
{
|
|
1225
|
+
ref,
|
|
1226
|
+
className: cn("-mx-1 h-px bg-slate-200 dark:bg-slate-800", className),
|
|
1227
|
+
...props
|
|
1228
|
+
}
|
|
1229
|
+
));
|
|
1230
|
+
CommandSeparator.displayName = Command$1.Separator.displayName;
|
|
1231
|
+
var CommandItem = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1232
|
+
Command$1.Item,
|
|
1233
|
+
{
|
|
1234
|
+
ref,
|
|
1235
|
+
className: cn(
|
|
1236
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-slate-100 data-[selected=true]:text-slate-900 data-[disabled=true]:opacity-50 dark:data-[selected='true']:bg-slate-800 dark:data-[selected=true]:text-slate-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
1237
|
+
className
|
|
1238
|
+
),
|
|
1239
|
+
...props
|
|
1240
|
+
}
|
|
1241
|
+
));
|
|
1242
|
+
CommandItem.displayName = Command$1.Item.displayName;
|
|
1243
|
+
var CommandShortcut = ({
|
|
1244
|
+
className,
|
|
1245
|
+
...props
|
|
1246
|
+
}) => {
|
|
1247
|
+
return /* @__PURE__ */ jsx(
|
|
1248
|
+
"span",
|
|
1249
|
+
{
|
|
1250
|
+
className: cn(
|
|
1251
|
+
"ml-auto text-xs tracking-widest text-slate-500 dark:text-slate-400",
|
|
1252
|
+
className
|
|
1253
|
+
),
|
|
1254
|
+
...props
|
|
1255
|
+
}
|
|
1256
|
+
);
|
|
1257
|
+
};
|
|
1258
|
+
CommandShortcut.displayName = "CommandShortcut";
|
|
1259
|
+
function Combobox({
|
|
1260
|
+
options,
|
|
1261
|
+
value,
|
|
1262
|
+
onValueChange,
|
|
1263
|
+
placeholder = "Select option...",
|
|
1264
|
+
emptyText = "No option found.",
|
|
1265
|
+
className,
|
|
1266
|
+
disabled = false,
|
|
1267
|
+
icon
|
|
1268
|
+
}) {
|
|
1269
|
+
const [open, setOpen] = React19.useState(false);
|
|
1270
|
+
const selectedLabel = React19.useMemo(() => {
|
|
1271
|
+
return options.find((option) => option.value === value)?.label;
|
|
1272
|
+
}, [options, value]);
|
|
1273
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
1274
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
1275
|
+
Button,
|
|
1276
|
+
{
|
|
1277
|
+
variant: "outline",
|
|
1278
|
+
role: "combobox",
|
|
1279
|
+
"aria-expanded": open,
|
|
1280
|
+
className: cn("w-full justify-between", className),
|
|
1281
|
+
disabled,
|
|
1282
|
+
children: [
|
|
1283
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center truncate", children: [
|
|
1284
|
+
icon && /* @__PURE__ */ jsx("span", { className: "mr-2 flex h-4 w-4 shrink-0 items-center justify-center", children: icon }),
|
|
1285
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: value ? selectedLabel : placeholder })
|
|
1286
|
+
] }),
|
|
1287
|
+
/* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
|
|
1288
|
+
]
|
|
1289
|
+
}
|
|
1290
|
+
) }),
|
|
1291
|
+
/* @__PURE__ */ jsx(PopoverContent, { className: "w-full p-0", align: "start", children: /* @__PURE__ */ jsxs(Command, { children: [
|
|
1292
|
+
/* @__PURE__ */ jsx(CommandInput, { placeholder }),
|
|
1293
|
+
/* @__PURE__ */ jsxs(CommandList, { children: [
|
|
1294
|
+
/* @__PURE__ */ jsx(CommandEmpty, { children: emptyText }),
|
|
1295
|
+
/* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs(
|
|
1296
|
+
CommandItem,
|
|
1297
|
+
{
|
|
1298
|
+
value: option.label,
|
|
1299
|
+
onSelect: (currentValue) => {
|
|
1300
|
+
const selectedOption = options.find(
|
|
1301
|
+
(opt) => opt.label.toLowerCase() === currentValue.toLowerCase()
|
|
1302
|
+
);
|
|
1303
|
+
if (selectedOption) {
|
|
1304
|
+
onValueChange?.(
|
|
1305
|
+
selectedOption.value === value ? "" : selectedOption.value
|
|
1306
|
+
);
|
|
1307
|
+
}
|
|
1308
|
+
setOpen(false);
|
|
1309
|
+
},
|
|
1310
|
+
children: [
|
|
1311
|
+
/* @__PURE__ */ jsx(
|
|
1312
|
+
Check,
|
|
1313
|
+
{
|
|
1314
|
+
className: cn(
|
|
1315
|
+
"mr-2 h-4 w-4",
|
|
1316
|
+
value === option.value ? "opacity-100" : "opacity-0"
|
|
1317
|
+
)
|
|
1318
|
+
}
|
|
1319
|
+
),
|
|
1320
|
+
option.label
|
|
1321
|
+
]
|
|
1322
|
+
},
|
|
1323
|
+
option.value
|
|
1324
|
+
)) })
|
|
1325
|
+
] })
|
|
1326
|
+
] }) })
|
|
1327
|
+
] });
|
|
1328
|
+
}
|
|
1024
1329
|
|
|
1025
|
-
export { Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, Label, Popover, PopoverContent, PopoverTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, alertVariants, badgeVariants, buttonVariants, cn, useFormField };
|
|
1330
|
+
export { Alert, AlertDescription, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, Label, Popover, PopoverContent, PopoverTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, alertVariants, badgeVariants, buttonVariants, cn, useFormField };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kenshinx/ui",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Personal React UI component library based on shadcn/ui patterns",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
37
37
|
"@radix-ui/react-checkbox": "^1.1.3",
|
|
38
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
38
39
|
"@radix-ui/react-dialog": "^1.1.4",
|
|
39
40
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
40
41
|
"@radix-ui/react-label": "^2.1.1",
|
|
@@ -46,7 +47,10 @@
|
|
|
46
47
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
47
48
|
"class-variance-authority": "^0.7.1",
|
|
48
49
|
"clsx": "^2.1.1",
|
|
50
|
+
"cmdk": "^1.1.1",
|
|
51
|
+
"date-fns": "^4.1.0",
|
|
49
52
|
"lucide-react": "^0.469.0",
|
|
53
|
+
"react-day-picker": "^8.10.0",
|
|
50
54
|
"sonner": "^2.0.7",
|
|
51
55
|
"tailwind-merge": "^2.6.0",
|
|
52
56
|
"tailwindcss-animate": "^1.0.7"
|