@sonamu-kit/react-components 0.1.1 → 0.1.2

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.
@@ -1,4 +1,3 @@
1
- export { Button, buttonVariants } from './ui/button';
2
1
  export type { DateRange } from 'react-day-picker';
3
2
  export { toast, useToast } from '../hooks/use-toast';
4
3
  export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from './ui/accordion';
@@ -10,6 +9,7 @@ export { AsyncSelect } from './ui/async-select';
10
9
  export { Avatar, AvatarFallback, AvatarImage } from './ui/avatar';
11
10
  export { Badge, badgeVariants } from './ui/badge';
12
11
  export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from './ui/breadcrumb';
12
+ export { Button, type ButtonProps, buttonVariants } from './ui/button';
13
13
  export { Calendar } from './ui/calendar';
14
14
  export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from './ui/card';
15
15
  export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, } from './ui/carousel';
@@ -20,6 +20,7 @@ export { Combobox } from './ui/combobox';
20
20
  export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from './ui/command';
21
21
  export { CommonModal, commonModalAtom, useCommonModal, } from './ui/common-modal';
22
22
  export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, } from './ui/context-menu';
23
+ export { DateInput, type DateInputProps } from './ui/date-input';
23
24
  export { DatePicker, DatePickerWithDropdown } from './ui/date-picker';
24
25
  export type { DateSelectorValue } from './ui/date-selector-multiple';
25
26
  export { DateSelectorMultiple } from './ui/date-selector-multiple';
@@ -54,7 +55,7 @@ export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupActio
54
55
  export { Skeleton } from './ui/skeleton';
55
56
  export { Slider } from './ui/slider';
56
57
  export { Switch } from './ui/switch';
57
- export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, } from './ui/table';
58
+ export { Table, TableBody, TableCaption, TableCell, type TableCol, TableFooter, TableHead, TableHeader, TableRow, } from './ui/table';
58
59
  export { Tabs, TabsContent, TabsList, TabsTrigger } from './ui/tabs';
59
60
  export { Textarea } from './ui/textarea';
60
61
  export { Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, } from './ui/toast';
@@ -1,13 +1,13 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const buttonVariants: (props?: ({
4
- variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
5
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
4
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "red" | "yellow" | "green" | "blue" | "cyan" | "purple" | "pink" | "orange" | null | undefined;
5
+ size?: "default" | "xs" | "sm" | "lg" | "xl" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
- declare const Button: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<(props?: ({
8
- variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
9
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
10
- } & import('class-variance-authority/types').ClassProp) | undefined) => string> & {
7
+ type ButtonProps = React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
11
8
  asChild?: boolean;
12
- }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
13
- export { Button, buttonVariants };
9
+ icon?: React.ReactElement;
10
+ loading?: boolean;
11
+ };
12
+ declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
13
+ export { Button, buttonVariants, type ButtonProps };
@@ -13,16 +13,6 @@ type CarouselProps = {
13
13
  declare const Carousel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & CarouselProps & React.RefAttributes<HTMLDivElement>>;
14
14
  declare const CarouselContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
15
15
  declare const CarouselItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
16
- declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & import('class-variance-authority').VariantProps<(props?: ({
17
- variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
18
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
19
- } & import('class-variance-authority/types').ClassProp) | undefined) => string> & {
20
- asChild?: boolean;
21
- }, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
22
- declare const CarouselNext: React.ForwardRefExoticComponent<Omit<Omit<React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement> & import('class-variance-authority').VariantProps<(props?: ({
23
- variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
24
- size?: "default" | "sm" | "lg" | "icon" | null | undefined;
25
- } & import('class-variance-authority/types').ClassProp) | undefined) => string> & {
26
- asChild?: boolean;
27
- }, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
16
+ declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<Omit<import('./button').ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
17
+ declare const CarouselNext: React.ForwardRefExoticComponent<Omit<Omit<import('./button').ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
28
18
  export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
@@ -1,6 +1,6 @@
1
1
  import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
2
2
  import * as React from "react";
3
- declare const Checkbox: React.ForwardRefExoticComponent<Omit<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref">, "name" | "onBlur" | "onValueChange"> & {
3
+ declare const Checkbox: React.ForwardRefExoticComponent<Omit<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref">, "onBlur" | "name" | "onValueChange"> & {
4
4
  name?: string;
5
5
  onValueChange?: (checked: boolean) => void;
6
6
  onBlur?: React.FocusEventHandler<HTMLInputElement>;
@@ -22,7 +22,7 @@ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<
22
22
  ref?: React.Ref<HTMLInputElement>;
23
23
  } & {
24
24
  asChild?: boolean;
25
- }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "value" | "onChange"> & {
25
+ }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "onChange" | "value"> & {
26
26
  value?: string;
27
27
  onValueChange?: (search: string) => void;
28
28
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -48,7 +48,7 @@ declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
48
48
  ref?: React.Ref<HTMLDivElement>;
49
49
  } & {
50
50
  asChild?: boolean;
51
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
51
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "heading" | "value"> & {
52
52
  heading?: React.ReactNode;
53
53
  value?: string;
54
54
  forceMount?: boolean;
@@ -66,7 +66,7 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
66
66
  ref?: React.Ref<HTMLDivElement>;
67
67
  } & {
68
68
  asChild?: boolean;
69
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "disabled" | "value" | "onSelect"> & {
69
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "onSelect" | "value" | "disabled"> & {
70
70
  disabled?: boolean;
71
71
  onSelect?: (value: string) => void;
72
72
  value?: string;
@@ -0,0 +1,7 @@
1
+ import { Override } from '../../lib/helpers';
2
+ type DateInputProps = Override<React.ComponentProps<"input">, {
3
+ value: Date | null;
4
+ onValueChange: (value: Date | null) => void;
5
+ }>;
6
+ declare function DateInput({ value, onValueChange, ...props }: DateInputProps): import("react/jsx-runtime").JSX.Element;
7
+ export { DateInput, type DateInputProps };
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
2
+ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
3
3
  value?: string;
4
4
  onChange?: (newValue: string) => unknown;
5
5
  maxLength: number;
@@ -12,7 +12,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
12
12
  } & {
13
13
  render: (props: import('input-otp').RenderProps) => React.ReactNode;
14
14
  children?: never;
15
- } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
15
+ } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
16
16
  value?: string;
17
17
  onChange?: (newValue: string) => unknown;
18
18
  maxLength: number;
@@ -1,6 +1,6 @@
1
1
  import * as ResizablePrimitive from "react-resizable-panels";
2
2
  declare const ResizablePanelGroup: ({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => import("react/jsx-runtime").JSX.Element;
3
- declare const ResizablePanel: import('react').ForwardRefExoticComponent<Omit<import('react').HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLOListElement | HTMLObjectElement | HTMLLinkElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDivElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLMapElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLParagraphElement | HTMLPreElement | HTMLProgressElement | HTMLSlotElement | HTMLScriptElement | HTMLSelectElement | HTMLSourceElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
3
+ declare const ResizablePanel: import('react').ForwardRefExoticComponent<Omit<import('react').HTMLAttributes<HTMLOListElement | HTMLElement | HTMLObjectElement | HTMLMapElement | HTMLAnchorElement | HTMLButtonElement | HTMLDivElement | HTMLFormElement | HTMLHeadingElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLIElement | HTMLParagraphElement | HTMLSelectElement | HTMLSpanElement | HTMLUListElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLLegendElement | HTMLLinkElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPreElement | HTMLProgressElement | HTMLSlotElement | HTMLScriptElement | HTMLSourceElement | HTMLStyleElement | HTMLTableElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
4
4
  className?: string;
5
5
  collapsedSize?: number | undefined;
6
6
  collapsible?: boolean | undefined;
@@ -1,6 +1,6 @@
1
1
  import * as SliderPrimitive from "@radix-ui/react-slider";
2
2
  import * as React from "react";
3
- declare const Slider: React.ForwardRefExoticComponent<Omit<Omit<SliderPrimitive.SliderProps & React.RefAttributes<HTMLSpanElement>, "ref">, "name" | "onBlur" | "onValueChange"> & {
3
+ declare const Slider: React.ForwardRefExoticComponent<Omit<Omit<SliderPrimitive.SliderProps & React.RefAttributes<HTMLSpanElement>, "ref">, "onBlur" | "name" | "onValueChange"> & {
4
4
  name?: string;
5
5
  onValueChange?: (value: number) => void;
6
6
  onBlur?: React.FocusEventHandler<HTMLInputElement>;
@@ -1,6 +1,6 @@
1
1
  import * as SwitchPrimitives from "@radix-ui/react-switch";
2
2
  import * as React from "react";
3
- declare const Switch: React.ForwardRefExoticComponent<Omit<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref">, "name" | "onBlur" | "onValueChange"> & {
3
+ declare const Switch: React.ForwardRefExoticComponent<Omit<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref">, "onBlur" | "name" | "onValueChange"> & {
4
4
  name?: string;
5
5
  onValueChange?: (checked: boolean) => void;
6
6
  onBlur?: React.FocusEventHandler<HTMLInputElement>;
@@ -1,10 +1,24 @@
1
1
  import type * as React from "react";
2
+ type TableAlign = "left" | "center" | "right";
3
+ type TableCol<T> = {
4
+ label: string | React.ReactNode;
5
+ tc: (row: T, rowIndex?: number) => React.ReactNode;
6
+ fit?: boolean;
7
+ className?: string;
8
+ align?: TableAlign;
9
+ };
2
10
  declare function Table({ className, ...props }: React.ComponentProps<"table">): import("react/jsx-runtime").JSX.Element;
3
11
  declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): import("react/jsx-runtime").JSX.Element;
4
12
  declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): import("react/jsx-runtime").JSX.Element;
5
13
  declare function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">): import("react/jsx-runtime").JSX.Element;
6
14
  declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): import("react/jsx-runtime").JSX.Element;
7
- declare function TableHead({ className, ...props }: React.ComponentProps<"th">): import("react/jsx-runtime").JSX.Element;
8
- declare function TableCell({ className, ...props }: React.ComponentProps<"td">): import("react/jsx-runtime").JSX.Element;
15
+ declare function TableHead({ className, fit, align, ...props }: React.ComponentProps<"th"> & {
16
+ fit?: boolean;
17
+ align?: TableAlign;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ declare function TableCell({ className, fit, align, ...props }: React.ComponentProps<"td"> & {
20
+ fit?: boolean;
21
+ align?: TableAlign;
22
+ }): import("react/jsx-runtime").JSX.Element;
9
23
  declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): import("react/jsx-runtime").JSX.Element;
10
- export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
24
+ export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, type TableCol, };
@@ -29,19 +29,7 @@ export declare function useListParams<U extends z.ZodType<any>, T extends Partia
29
29
  }): {
30
30
  listParams: T;
31
31
  setListParams: (newParams: T) => void;
32
- register: {
33
- (name: "page"): {
34
- value: number;
35
- onValueChange: (page: number) => void;
36
- };
37
- (name: Exclude<ZodKeys<U>, "page">): {
38
- value: string;
39
- onValueChange: (value: any) => void;
40
- };
41
- };
42
- };
43
- export declare function useGoBack(): {
44
- goBack: () => void;
32
+ register: (name: ZodKeys<U>) => any;
45
33
  };
46
34
  export declare function useSelection<T>(allKeys: T[], defaultSelectedKeys?: T[]): {
47
35
  getSelected: (key: T) => boolean;
@@ -1,6 +1,6 @@
1
1
  export { Pagination } from '../components/ui/pagination';
2
2
  export { caster, fastifyCaster } from './caster';
3
- export { arrayableToArray, type ControlledModalProps, caller, type DistributiveOmit, dateF, datetimeF, type ErrorObj, hidden, numF, type Override, type PaginationProps, paramsToSearchParams, type SonamuCol, searchParamsToParams, sqlDateToDateString, type TableColumnWidth, useGoBack, useListParams, useModal, useSelection, useTypeForm, } from './helpers';
3
+ export { arrayableToArray, type ControlledModalProps, caller, type DistributiveOmit, dateF, datetimeF, type ErrorObj, hidden, numF, type Override, type PaginationProps, paramsToSearchParams, type SonamuCol, searchParamsToParams, sqlDateToDateString, type TableColumnWidth, useListParams, useModal, useSelection, useTypeForm, } from './helpers';
4
4
  export { lazyUpload } from './lazy-upload';
5
5
  export { useIsMobile } from './use-mobile';
6
6
  export { cn } from './utils';