@codefast/ui 0.0.54 → 0.0.56
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/{chunk-MFYACCZV.mjs → chunk-77I644ZX.mjs} +1 -1
- package/dist/{chunk-MFYACCZV.mjs.map → chunk-77I644ZX.mjs.map} +1 -1
- package/dist/{chunk-VZVI3OHH.js → chunk-BEBSUUL4.js} +2 -2
- package/dist/{chunk-VZVI3OHH.js.map → chunk-BEBSUUL4.js.map} +1 -1
- package/dist/{chunk-4JHGPRLG.js → chunk-JI2ITVUE.js} +1 -1
- package/dist/{chunk-4JHGPRLG.js.map → chunk-JI2ITVUE.js.map} +1 -1
- package/dist/{chunk-X4BEEJEW.js → chunk-P2RMYMNK.js} +2 -2
- package/dist/chunk-P2RMYMNK.js.map +1 -0
- package/dist/{chunk-K63K4LTH.mjs → chunk-QXZKUXR2.mjs} +2 -2
- package/dist/chunk-QXZKUXR2.mjs.map +1 -0
- package/dist/{chunk-7ABWX5CF.mjs → chunk-TVVOS66G.mjs} +2 -2
- package/dist/{chunk-7ABWX5CF.mjs.map → chunk-TVVOS66G.mjs.map} +1 -1
- package/dist/{chunk-SCXRD727.js → chunk-VE44YFJR.js} +1 -1
- package/dist/{chunk-SCXRD727.js.map → chunk-VE44YFJR.js.map} +1 -1
- package/dist/{chunk-5RENVAXH.mjs → chunk-W3VRLCP7.mjs} +1 -1
- package/dist/{chunk-5RENVAXH.mjs.map → chunk-W3VRLCP7.mjs.map} +1 -1
- package/dist/plugin/animate.plugin.js +1 -1
- package/dist/plugin/animate.plugin.mjs +1 -1
- package/dist/react/alert-dialog.js +1 -1
- package/dist/react/alert-dialog.mjs +1 -1
- package/dist/react/alert.d.mts +2 -2
- package/dist/react/alert.d.ts +2 -2
- package/dist/react/alert.js.map +1 -1
- package/dist/react/alert.mjs.map +1 -1
- package/dist/react/badge.d.mts +2 -2
- package/dist/react/badge.d.ts +2 -2
- package/dist/react/badge.js.map +1 -1
- package/dist/react/badge.mjs.map +1 -1
- package/dist/react/button.d.mts +2 -2
- package/dist/react/button.d.ts +2 -2
- package/dist/react/button.js +1 -1
- package/dist/react/button.mjs +1 -1
- package/dist/react/calendar.js +1 -1
- package/dist/react/calendar.js.map +1 -1
- package/dist/react/calendar.mjs +1 -1
- package/dist/react/calendar.mjs.map +1 -1
- package/dist/react/carousel.js +1 -1
- package/dist/react/carousel.js.map +1 -1
- package/dist/react/carousel.mjs +1 -1
- package/dist/react/carousel.mjs.map +1 -1
- package/dist/react/checkbox-cards.js +1 -1
- package/dist/react/checkbox-cards.mjs +1 -1
- package/dist/react/checkbox-group.js +1 -1
- package/dist/react/checkbox-group.mjs +1 -1
- package/dist/react/checkbox-group.primitive.js +1 -1
- package/dist/react/checkbox-group.primitive.mjs +1 -1
- package/dist/react/command.d.mts +46 -46
- package/dist/react/command.d.ts +46 -46
- package/dist/react/data-table.js +1 -1
- package/dist/react/data-table.js.map +1 -1
- package/dist/react/data-table.mjs +1 -1
- package/dist/react/data-table.mjs.map +1 -1
- package/dist/react/drawer.d.mts +1 -1
- package/dist/react/drawer.d.ts +1 -1
- package/dist/react/form.js.map +1 -1
- package/dist/react/form.mjs.map +1 -1
- package/dist/react/input.d.mts +2 -2
- package/dist/react/input.d.ts +2 -2
- package/dist/react/input.js.map +1 -1
- package/dist/react/input.mjs.map +1 -1
- package/dist/react/menubar.d.mts +5 -1
- package/dist/react/menubar.d.ts +5 -1
- package/dist/react/navigation-menu.d.mts +2 -2
- package/dist/react/navigation-menu.d.ts +2 -2
- package/dist/react/pagination.js +1 -1
- package/dist/react/pagination.js.map +1 -1
- package/dist/react/pagination.mjs +1 -1
- package/dist/react/pagination.mjs.map +1 -1
- package/dist/react/sheet.d.mts +2 -2
- package/dist/react/sheet.d.ts +2 -2
- package/dist/react/sheet.js +1 -1
- package/dist/react/sheet.js.map +1 -1
- package/dist/react/sheet.mjs +1 -1
- package/dist/react/sheet.mjs.map +1 -1
- package/dist/react/sonner.js +1 -1
- package/dist/react/sonner.js.map +1 -1
- package/dist/react/sonner.mjs +1 -1
- package/dist/react/sonner.mjs.map +1 -1
- package/dist/react/toggle-group.js +1 -1
- package/dist/react/toggle-group.js.map +1 -1
- package/dist/react/toggle-group.mjs +1 -1
- package/dist/react/toggle-group.mjs.map +1 -1
- package/dist/react/toggle.d.mts +2 -2
- package/dist/react/toggle.d.ts +2 -2
- package/dist/react/toggle.js +1 -1
- package/dist/react/toggle.mjs +1 -1
- package/dist/tailwind.config.js +1 -1
- package/dist/tailwind.config.js.map +1 -1
- package/dist/tailwind.config.mjs +1 -1
- package/dist/tailwind.config.mjs.map +1 -1
- package/package.json +37 -37
- package/plugin/animate.plugin.ts +1 -1
- package/src/react/alert.tsx +1 -1
- package/src/react/badge.tsx +1 -1
- package/src/react/button.tsx +1 -1
- package/src/react/calendar.tsx +1 -2
- package/src/react/carousel.tsx +2 -4
- package/src/react/checkbox-group.primitive.tsx +1 -2
- package/src/react/data-table.tsx +1 -1
- package/src/react/form.tsx +1 -1
- package/src/react/input.tsx +1 -1
- package/src/react/pagination.tsx +1 -2
- package/src/react/sheet.tsx +1 -1
- package/src/react/sonner.tsx +4 -3
- package/src/react/toggle-group.tsx +2 -4
- package/src/react/toggle.tsx +1 -1
- package/tailwind.config.ts +1 -1
- package/dist/chunk-K63K4LTH.mjs.map +0 -1
- package/dist/chunk-X4BEEJEW.js.map +0 -1
package/dist/react/command.d.ts
CHANGED
|
@@ -7,93 +7,93 @@ type CommandProps = React.ComponentPropsWithoutRef<typeof Command$1>;
|
|
|
7
7
|
declare const Command: React.ForwardRefExoticComponent<Omit<{
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
10
|
-
ref?: React.Ref<HTMLDivElement
|
|
10
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
11
11
|
} & {
|
|
12
|
-
asChild?: boolean
|
|
13
|
-
}, "key" |
|
|
14
|
-
label?: string
|
|
15
|
-
shouldFilter?: boolean
|
|
16
|
-
filter?: (
|
|
17
|
-
defaultValue?: string
|
|
18
|
-
value?: string
|
|
19
|
-
onValueChange?: (
|
|
20
|
-
loop?: boolean
|
|
21
|
-
disablePointerSelection?: boolean
|
|
22
|
-
vimBindings?: boolean
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
14
|
+
label?: string;
|
|
15
|
+
shouldFilter?: boolean;
|
|
16
|
+
filter?: (value: string, search: string, keywords?: string[]) => number;
|
|
17
|
+
defaultValue?: string;
|
|
18
|
+
value?: string;
|
|
19
|
+
onValueChange?: (value: string) => void;
|
|
20
|
+
loop?: boolean;
|
|
21
|
+
disablePointerSelection?: boolean;
|
|
22
|
+
vimBindings?: boolean;
|
|
23
23
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
24
24
|
type CommandDialogProps = React.ComponentProps<typeof Dialog>;
|
|
25
25
|
declare function CommandDialog({ children, ...props }: CommandDialogProps): React.JSX.Element;
|
|
26
26
|
type CommandInputProps = React.ComponentPropsWithoutRef<typeof Command$1.Input>;
|
|
27
27
|
declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
|
|
28
|
-
ref?: React.Ref<HTMLInputElement
|
|
28
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
29
29
|
} & {
|
|
30
|
-
asChild?: boolean
|
|
31
|
-
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "
|
|
32
|
-
value?: string
|
|
33
|
-
onValueChange?: (
|
|
30
|
+
asChild?: boolean;
|
|
31
|
+
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
|
|
32
|
+
value?: string;
|
|
33
|
+
onValueChange?: (search: string) => void;
|
|
34
34
|
} & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
35
35
|
type CommandListProps = React.ComponentPropsWithoutRef<typeof Command$1.List>;
|
|
36
36
|
declare const CommandList: React.ForwardRefExoticComponent<Omit<{
|
|
37
37
|
children?: React.ReactNode;
|
|
38
38
|
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
39
|
-
ref?: React.Ref<HTMLDivElement
|
|
39
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
40
40
|
} & {
|
|
41
|
-
asChild?: boolean
|
|
42
|
-
}, "key" |
|
|
43
|
-
label?: string
|
|
41
|
+
asChild?: boolean;
|
|
42
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
43
|
+
label?: string;
|
|
44
44
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
45
45
|
type CommandEmptyProps = React.ComponentPropsWithoutRef<typeof Command$1.Empty>;
|
|
46
46
|
declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
|
|
47
47
|
children?: React.ReactNode;
|
|
48
48
|
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
49
|
-
ref?: React.Ref<HTMLDivElement
|
|
49
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
50
50
|
} & {
|
|
51
|
-
asChild?: boolean
|
|
52
|
-
}, "key" |
|
|
51
|
+
asChild?: boolean;
|
|
52
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
53
53
|
type CommandGroupProps = React.ComponentPropsWithoutRef<typeof Command$1.Group>;
|
|
54
54
|
declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
|
|
55
55
|
children?: React.ReactNode;
|
|
56
56
|
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
57
|
-
ref?: React.Ref<HTMLDivElement
|
|
57
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
58
58
|
} & {
|
|
59
|
-
asChild?: boolean
|
|
60
|
-
}, "key" |
|
|
59
|
+
asChild?: boolean;
|
|
60
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
|
|
61
61
|
heading?: React.ReactNode;
|
|
62
|
-
value?: string
|
|
63
|
-
forceMount?: boolean
|
|
62
|
+
value?: string;
|
|
63
|
+
forceMount?: boolean;
|
|
64
64
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
65
65
|
type CommandSeparatorProps = React.ComponentPropsWithoutRef<typeof Command$1.Separator>;
|
|
66
66
|
declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
67
|
-
ref?: React.Ref<HTMLDivElement
|
|
67
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
68
68
|
} & {
|
|
69
|
-
asChild?: boolean
|
|
70
|
-
}, "key" |
|
|
71
|
-
alwaysRender?: boolean
|
|
69
|
+
asChild?: boolean;
|
|
70
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
71
|
+
alwaysRender?: boolean;
|
|
72
72
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
73
73
|
type CommandItemProps = React.ComponentPropsWithoutRef<typeof Command$1.Item>;
|
|
74
74
|
declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
|
|
75
75
|
children?: React.ReactNode;
|
|
76
76
|
} & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
77
|
-
ref?: React.Ref<HTMLDivElement
|
|
77
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
78
78
|
} & {
|
|
79
|
-
asChild?: boolean
|
|
80
|
-
}, "key" |
|
|
81
|
-
disabled?: boolean
|
|
82
|
-
onSelect?: (
|
|
83
|
-
value?: string
|
|
84
|
-
keywords?: string[]
|
|
85
|
-
forceMount?: boolean
|
|
79
|
+
asChild?: boolean;
|
|
80
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "value" | "disabled"> & {
|
|
81
|
+
disabled?: boolean;
|
|
82
|
+
onSelect?: (value: string) => void;
|
|
83
|
+
value?: string;
|
|
84
|
+
keywords?: string[];
|
|
85
|
+
forceMount?: boolean;
|
|
86
86
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
87
87
|
type CommandLoadingProps = React.ComponentPropsWithoutRef<typeof Command$1.Loading>;
|
|
88
88
|
declare const CommandLoading: React.ForwardRefExoticComponent<Omit<{
|
|
89
89
|
children?: React.ReactNode;
|
|
90
90
|
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
91
|
-
ref?: React.Ref<HTMLDivElement
|
|
91
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
92
92
|
} & {
|
|
93
|
-
asChild?: boolean
|
|
94
|
-
}, "key" |
|
|
95
|
-
progress?: number
|
|
96
|
-
label?: string
|
|
93
|
+
asChild?: boolean;
|
|
94
|
+
}, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
|
|
95
|
+
progress?: number;
|
|
96
|
+
label?: string;
|
|
97
97
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
98
98
|
type CommandShortcutProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
99
99
|
declare function CommandShortcut({ className, ...props }: CommandShortcutProps): React.JSX.Element;
|
package/dist/react/data-table.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkDCDB56BOjs = require('../chunk-DCDB56BO.js');var _chunkRHFF4JNHjs = require('../chunk-RHFF4JNH.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkDCDB56BOjs = require('../chunk-DCDB56BO.js');var _chunkRHFF4JNHjs = require('../chunk-RHFF4JNH.js');var _chunkBEBSUUL4js = require('../chunk-BEBSUUL4.js');require('../chunk-46W6RAYD.js');var _chunkHQ4AUOQMjs = require('../chunk-HQ4AUOQM.js');var _reacticons = require('@radix-ui/react-icons');var _jsxruntime = require('react/jsx-runtime');function A({table:a}){return _jsxruntime.jsxs.call(void 0, _chunkRHFF4JNHjs.a,{children:[_jsxruntime.jsx.call(void 0, _chunkRHFF4JNHjs.b,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, _chunkBEBSUUL4js.b,{variant:"outline",size:"sm",className:"ml-auto hidden h-8 lg:flex",children:[_jsxruntime.jsx.call(void 0, _reacticons.MixerHorizontalIcon,{className:"mr-2 size-4"}),"View"]})}),_jsxruntime.jsxs.call(void 0, _chunkRHFF4JNHjs.h,{align:"end",className:"w-36",children:[_jsxruntime.jsx.call(void 0, _chunkRHFF4JNHjs.l,{children:"Toggle columns"}),_jsxruntime.jsx.call(void 0, _chunkRHFF4JNHjs.m,{}),a.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>_jsxruntime.jsx.call(void 0, _chunkRHFF4JNHjs.j,{className:"capitalize",checked:n.getIsVisible(),onCheckedChange:s=>{n.toggleVisibility(!!s)},children:n.id},n.id))]})]})}function B({table:a,className:n,...s}){return _jsxruntime.jsxs.call(void 0, "div",{className:_chunkHQ4AUOQMjs.b.call(void 0, "flex items-center justify-between px-2",n),...s,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"text-muted-foreground flex-1 text-sm",children:[a.getFilteredSelectedRowModel().rows.length," of ",a.getFilteredRowModel().rows.length," row(s) selected."]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center space-x-6 lg:space-x-8",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center space-x-2",children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-sm font-medium",children:"Rows per page"}),_jsxruntime.jsxs.call(void 0, _chunkDCDB56BOjs.a,{value:String(a.getState().pagination.pageSize),onValueChange:i=>{a.setPageSize(Number(i))},children:[_jsxruntime.jsx.call(void 0, _chunkDCDB56BOjs.d,{className:"w-18 h-8",children:_jsxruntime.jsx.call(void 0, _chunkDCDB56BOjs.c,{placeholder:a.getState().pagination.pageSize})}),_jsxruntime.jsx.call(void 0, _chunkDCDB56BOjs.g,{side:"top",children:[10,20,30,40,50].map(i=>_jsxruntime.jsx.call(void 0, _chunkDCDB56BOjs.i,{value:String(i),children:i},i))})]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex w-28 items-center justify-center text-sm font-medium",children:["Page ",a.getState().pagination.pageIndex+1," of ",a.getPageCount()]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center space-x-2",children:[_jsxruntime.jsxs.call(void 0, _chunkBEBSUUL4js.b,{variant:"outline",size:"icon-xs",className:"hidden lg:flex",onClick:()=>{a.setPageIndex(0)},disabled:!a.getCanPreviousPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to first page"}),_jsxruntime.jsx.call(void 0, _reacticons.DoubleArrowLeftIcon,{className:"size-4"})]}),_jsxruntime.jsxs.call(void 0, _chunkBEBSUUL4js.b,{variant:"outline",size:"icon-xs",onClick:()=>{a.previousPage()},disabled:!a.getCanPreviousPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to previous page"}),_jsxruntime.jsx.call(void 0, _reacticons.ChevronLeftIcon,{className:"size-4"})]}),_jsxruntime.jsxs.call(void 0, _chunkBEBSUUL4js.b,{variant:"outline",size:"icon-xs",onClick:()=>{a.nextPage()},disabled:!a.getCanNextPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to next page"}),_jsxruntime.jsx.call(void 0, _reacticons.ChevronRightIcon,{className:"size-4"})]}),_jsxruntime.jsxs.call(void 0, _chunkBEBSUUL4js.b,{variant:"outline",size:"icon-xs",className:"hidden lg:flex",onClick:()=>{a.setPageIndex(a.getPageCount()-1)},disabled:!a.getCanNextPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to last page"}),_jsxruntime.jsx.call(void 0, _reacticons.DoubleArrowRightIcon,{className:"size-4"})]})]})]})]})}function L({column:a,title:n,className:s}){return a.getCanSort()?_jsxruntime.jsx.call(void 0, "div",{className:_chunkHQ4AUOQMjs.b.call(void 0, "flex items-center space-x-2",s),children:_jsxruntime.jsxs.call(void 0, _chunkRHFF4JNHjs.a,{children:[_jsxruntime.jsx.call(void 0, _chunkRHFF4JNHjs.b,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, _chunkBEBSUUL4js.b,{variant:"ghost",size:"xs",className:"data-[state=open]:bg-accent -ml-3",children:[_jsxruntime.jsx.call(void 0, "span",{children:n}),_jsxruntime.jsx.call(void 0, z,{sorted:a.getIsSorted()})]})}),_jsxruntime.jsxs.call(void 0, _chunkRHFF4JNHjs.h,{align:"start",children:[_jsxruntime.jsxs.call(void 0, _chunkRHFF4JNHjs.i,{onClick:()=>{a.toggleSorting(!1)},children:[_jsxruntime.jsx.call(void 0, _reacticons.ArrowUpIcon,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Asc"]}),_jsxruntime.jsxs.call(void 0, _chunkRHFF4JNHjs.i,{onClick:()=>{a.toggleSorting(!0)},children:[_jsxruntime.jsx.call(void 0, _reacticons.ArrowDownIcon,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Desc"]}),_jsxruntime.jsx.call(void 0, _chunkRHFF4JNHjs.m,{}),_jsxruntime.jsxs.call(void 0, _chunkRHFF4JNHjs.i,{onClick:()=>{a.toggleVisibility(!1)},children:[_jsxruntime.jsx.call(void 0, _reacticons.EyeNoneIcon,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Hide"]})]})]})}):_jsxruntime.jsx.call(void 0, "div",{className:s,children:n})}function z({sorted:a}){switch(a){case"desc":return _jsxruntime.jsx.call(void 0, _reacticons.ArrowDownIcon,{className:"ml-2 size-4"});case"asc":return _jsxruntime.jsx.call(void 0, _reacticons.ArrowUpIcon,{className:"ml-2 size-4"});default:return _jsxruntime.jsx.call(void 0, _reacticons.CaretSortIcon,{className:"ml-2 size-4"})}}exports.DataTableColumnHeader = L; exports.DataTablePagination = B; exports.DataTableViewOptions = A;
|
|
2
2
|
//# sourceMappingURL=data-table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/data-table.tsx"],"names":["ArrowDownIcon","ArrowUpIcon","CaretSortIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowLeftIcon","DoubleArrowRightIcon","EyeNoneIcon","MixerHorizontalIcon","jsx","jsxs","DataTableViewOptions","table","DropdownMenu","DropdownMenuTrigger","Button","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","column","DropdownMenuCheckboxItem","value","DataTablePagination","className","props","cn","Select","SelectTrigger","SelectValue","SelectContent","pageSize","SelectItem","DataTableColumnHeader","title","SortIcon","DropdownMenuItem","sorted"],"mappings":"oRAGA,OACE,iBAAAA,EACA,eAAAC,EACA,iBAAAC,EACA,mBAA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CAClD,CACF","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n ArrowDownIcon,\n ArrowUpIcon,\n CaretSortIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n DoubleArrowLeftIcon,\n DoubleArrowRightIcon,\n EyeNoneIcon,\n MixerHorizontalIcon,\n} from '@radix-ui/react-icons';\nimport { cn } from '../lib/utils';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from './dropdown-menu';\nimport { Button } from './button';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './select';\nimport type * as ReactTable from '@tanstack/react-table';\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"ml-auto hidden h-8 lg:flex\">\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-36\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((column) => typeof column.accessorFn !== 'undefined' && column.getCanHide())\n .map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.id}\n className=\"capitalize\"\n checked={column.getIsVisible()}\n onCheckedChange={(value) => {\n column.toggleVisibility(Boolean(value));\n }}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTablePagination\n * -------------------------------------------------------------------------- */\n\ninterface DataTablePaginationProps<TData> extends React.HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: DataTablePaginationProps<TData>): React.JSX.Element {\n return (\n <div className={cn('flex items-center justify-between px-2', className)} {...props}>\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of {table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={String(table.getState().pagination.pageSize)}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"w-18 h-8\">\n <SelectValue placeholder={table.getState().pagination.pageSize} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {[10, 20, 30, 40, 50].map((pageSize) => (\n <SelectItem key={pageSize} value={String(pageSize)}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-28 items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount()}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(0);\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.previousPage();\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.nextPage();\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(table.getPageCount() - 1);\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <DoubleArrowRightIcon className=\"size-4\" />\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableColumnHeader\n * -------------------------------------------------------------------------- */\n\ninterface DataTableColumnHeaderProps<TData, TValue> extends React.HTMLAttributes<HTMLDivElement> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}\n\nfunction DataTableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: DataTableColumnHeaderProps<TData, TValue>): React.JSX.Element {\n if (!column.getCanSort()) {\n return <div className={className}>{title}</div>;\n }\n\n return (\n <div className={cn('flex items-center space-x-2', className)}>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"xs\" className=\"data-[state=open]:bg-accent -ml-3\">\n <span>{title}</span>\n <SortIcon sorted={column.getIsSorted()} />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(false);\n }}\n >\n <ArrowUpIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Asc\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(true);\n }}\n >\n <ArrowDownIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Desc\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => {\n column.toggleVisibility(false);\n }}\n >\n <EyeNoneIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Hide\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n}\n\nfunction SortIcon({ sorted }: { sorted: false | ReactTable.SortDirection }): React.JSX.Element {\n switch (sorted) {\n case 'desc':\n return <ArrowDownIcon className=\"ml-2 size-4\" />;\n\n case 'asc':\n return <ArrowUpIcon className=\"ml-2 size-4\" />;\n\n default:\n return <CaretSortIcon className=\"ml-2 size-4\" />;\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DataTableViewOptions,\n DataTablePagination,\n DataTableColumnHeader,\n type DataTableViewOptionsProps,\n type DataTablePaginationProps,\n type DataTableColumnHeaderProps,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/react/data-table.tsx"],"names":["ArrowDownIcon","ArrowUpIcon","CaretSortIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowLeftIcon","DoubleArrowRightIcon","EyeNoneIcon","MixerHorizontalIcon","jsx","jsxs","DataTableViewOptions","table","DropdownMenu","DropdownMenuTrigger","Button","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","column","DropdownMenuCheckboxItem","value","DataTablePagination","className","props","cn","Select","SelectTrigger","SelectValue","SelectContent","pageSize","SelectItem","DataTableColumnHeader","title","SortIcon","DropdownMenuItem","sorted"],"mappings":"oRAGA,OACE,iBAAAA,EACA,eAAAC,EACA,iBAAAC,EACA,mBAAAC,EACA,oBAAAC,EACA,uBAAAC,EACA,wBAAAC,EACA,eAAAC,EACA,uBAAAC,MACK,wBA2BC,OACE,OAAAC,EADF,QAAAC,MAAA,oBAJR,SAASC,EAA4B,CAAE,MAAAC,CAAM,EAAwD,CACnG,OACEF,EAACG,EAAA,CACC,UAAAJ,EAACK,EAAA,CAAoB,QAAO,GAC1B,SAAAJ,EAACK,EAAA,CAAO,QAAQ,UAAU,KAAK,KAAK,UAAU,6BAC5C,UAAAN,EAACD,EAAA,CAAoB,UAAU,cAAc,EAAE,QAEjD,EACF,EACAE,EAACM,EAAA,CAAoB,MAAM,MAAM,UAAU,OACzC,UAAAP,EAACQ,EAAA,CAAkB,0BAAc,EACjCR,EAACS,EAAA,EAAsB,EACtBN,EACE,cAAc,EACd,OAAQO,GAAW,OAAOA,EAAO,WAAe,K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ACzB,UAAAN,EAACyB,EAAA,CACC,QAAS,IAAM,CACbhB,EAAO,cAAc,EAAK,CAC5B,EAEA,UAAAV,EAACR,EAAA,CAAY,UAAU,yCAAyC,EAAE,OAEpE,EACAS,EAACyB,EAAA,CACC,QAAS,IAAM,CACbhB,EAAO,cAAc,EAAI,CAC3B,EAEA,UAAAV,EAACT,EAAA,CAAc,UAAU,yCAAyC,EAAE,QAEtE,EACAS,EAACS,EAAA,EAAsB,EACvBR,EAACyB,EAAA,CACC,QAAS,IAAM,CACbhB,EAAO,iBAAiB,EAAK,CAC/B,EAEA,UAAAV,EAACF,EAAA,CAAY,UAAU,yCAAyC,EAAE,QAEpE,GACF,GACF,EACF,EAxCOE,EAAC,OAAI,UAAWc,EAAY,SAAAU,EAAM,CA0C7C,CAEA,SAASC,EAAS,CAAE,OAAAE,CAAO,EAAoE,CAC7F,OAAQA,EAAQ,CACd,IAAK,OACH,OAAO3B,EAACT,EAAA,CAAc,UAAU,cAAc,EAEhD,IAAK,MACH,OAAOS,EAACR,EAAA,CAAY,UAAU,cAAc,EAE9C,QACE,OAAOQ,EAACP,EAAA,CAAc,UAAU,cAAc,CAClD,CACF","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n ArrowDownIcon,\n ArrowUpIcon,\n CaretSortIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n DoubleArrowLeftIcon,\n DoubleArrowRightIcon,\n EyeNoneIcon,\n MixerHorizontalIcon,\n} from '@radix-ui/react-icons';\nimport type * as ReactTable from '@tanstack/react-table';\nimport { cn } from '../lib/utils';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from './dropdown-menu';\nimport { Button } from './button';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './select';\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"ml-auto hidden h-8 lg:flex\">\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-36\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((column) => typeof column.accessorFn !== 'undefined' && column.getCanHide())\n .map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.id}\n className=\"capitalize\"\n checked={column.getIsVisible()}\n onCheckedChange={(value) => {\n column.toggleVisibility(Boolean(value));\n }}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTablePagination\n * -------------------------------------------------------------------------- */\n\ninterface DataTablePaginationProps<TData> extends React.HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: DataTablePaginationProps<TData>): React.JSX.Element {\n return (\n <div className={cn('flex items-center justify-between px-2', className)} {...props}>\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of {table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={String(table.getState().pagination.pageSize)}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"w-18 h-8\">\n <SelectValue placeholder={table.getState().pagination.pageSize} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {[10, 20, 30, 40, 50].map((pageSize) => (\n <SelectItem key={pageSize} value={String(pageSize)}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-28 items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount()}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(0);\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.previousPage();\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.nextPage();\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(table.getPageCount() - 1);\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <DoubleArrowRightIcon className=\"size-4\" />\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableColumnHeader\n * -------------------------------------------------------------------------- */\n\ninterface DataTableColumnHeaderProps<TData, TValue> extends React.HTMLAttributes<HTMLDivElement> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}\n\nfunction DataTableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: DataTableColumnHeaderProps<TData, TValue>): React.JSX.Element {\n if (!column.getCanSort()) {\n return <div className={className}>{title}</div>;\n }\n\n return (\n <div className={cn('flex items-center space-x-2', className)}>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"xs\" className=\"data-[state=open]:bg-accent -ml-3\">\n <span>{title}</span>\n <SortIcon sorted={column.getIsSorted()} />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(false);\n }}\n >\n <ArrowUpIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Asc\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(true);\n }}\n >\n <ArrowDownIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Desc\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => {\n column.toggleVisibility(false);\n }}\n >\n <EyeNoneIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Hide\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n}\n\nfunction SortIcon({ sorted }: { sorted: false | ReactTable.SortDirection }): React.JSX.Element {\n switch (sorted) {\n case 'desc':\n return <ArrowDownIcon className=\"ml-2 size-4\" />;\n\n case 'asc':\n return <ArrowUpIcon className=\"ml-2 size-4\" />;\n\n default:\n return <CaretSortIcon className=\"ml-2 size-4\" />;\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DataTableViewOptions,\n DataTablePagination,\n DataTableColumnHeader,\n type DataTableViewOptionsProps,\n type DataTablePaginationProps,\n type DataTableColumnHeaderProps,\n};\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{a as D,c as f,d as T,g as x,i as w}from"../chunk-ZIB4ZTST.mjs";import{a as c,b as d,h as m,i as r,j as p,l as u,m as g}from"../chunk-BM5KYF6Y.mjs";import{b as o}from"../chunk-
|
|
1
|
+
"use client";import{a as D,c as f,d as T,g as x,i as w}from"../chunk-ZIB4ZTST.mjs";import{a as c,b as d,h as m,i as r,j as p,l as u,m as g}from"../chunk-BM5KYF6Y.mjs";import{b as o}from"../chunk-TVVOS66G.mjs";import"../chunk-BNKSZEF2.mjs";import{b as l}from"../chunk-LEUB3C3L.mjs";import{ArrowDownIcon as C,ArrowUpIcon as N,CaretSortIcon as v,ChevronLeftIcon as S,ChevronRightIcon as P,DoubleArrowLeftIcon as b,DoubleArrowRightIcon as M,EyeNoneIcon as I,MixerHorizontalIcon as h}from"@radix-ui/react-icons";import{jsx as e,jsxs as t}from"react/jsx-runtime";function A({table:a}){return t(c,{children:[e(d,{asChild:!0,children:t(o,{variant:"outline",size:"sm",className:"ml-auto hidden h-8 lg:flex",children:[e(h,{className:"mr-2 size-4"}),"View"]})}),t(m,{align:"end",className:"w-36",children:[e(u,{children:"Toggle columns"}),e(g,{}),a.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>e(p,{className:"capitalize",checked:n.getIsVisible(),onCheckedChange:s=>{n.toggleVisibility(!!s)},children:n.id},n.id))]})]})}function B({table:a,className:n,...s}){return t("div",{className:l("flex items-center justify-between px-2",n),...s,children:[t("div",{className:"text-muted-foreground flex-1 text-sm",children:[a.getFilteredSelectedRowModel().rows.length," of ",a.getFilteredRowModel().rows.length," row(s) selected."]}),t("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[t("div",{className:"flex items-center space-x-2",children:[e("p",{className:"text-sm font-medium",children:"Rows per page"}),t(D,{value:String(a.getState().pagination.pageSize),onValueChange:i=>{a.setPageSize(Number(i))},children:[e(T,{className:"w-18 h-8",children:e(f,{placeholder:a.getState().pagination.pageSize})}),e(x,{side:"top",children:[10,20,30,40,50].map(i=>e(w,{value:String(i),children:i},i))})]})]}),t("div",{className:"flex w-28 items-center justify-center text-sm font-medium",children:["Page ",a.getState().pagination.pageIndex+1," of ",a.getPageCount()]}),t("div",{className:"flex items-center space-x-2",children:[t(o,{variant:"outline",size:"icon-xs",className:"hidden lg:flex",onClick:()=>{a.setPageIndex(0)},disabled:!a.getCanPreviousPage(),children:[e("span",{className:"sr-only",children:"Go to first page"}),e(b,{className:"size-4"})]}),t(o,{variant:"outline",size:"icon-xs",onClick:()=>{a.previousPage()},disabled:!a.getCanPreviousPage(),children:[e("span",{className:"sr-only",children:"Go to previous page"}),e(S,{className:"size-4"})]}),t(o,{variant:"outline",size:"icon-xs",onClick:()=>{a.nextPage()},disabled:!a.getCanNextPage(),children:[e("span",{className:"sr-only",children:"Go to next page"}),e(P,{className:"size-4"})]}),t(o,{variant:"outline",size:"icon-xs",className:"hidden lg:flex",onClick:()=>{a.setPageIndex(a.getPageCount()-1)},disabled:!a.getCanNextPage(),children:[e("span",{className:"sr-only",children:"Go to last page"}),e(M,{className:"size-4"})]})]})]})]})}function L({column:a,title:n,className:s}){return a.getCanSort()?e("div",{className:l("flex items-center space-x-2",s),children:t(c,{children:[e(d,{asChild:!0,children:t(o,{variant:"ghost",size:"xs",className:"data-[state=open]:bg-accent -ml-3",children:[e("span",{children:n}),e(z,{sorted:a.getIsSorted()})]})}),t(m,{align:"start",children:[t(r,{onClick:()=>{a.toggleSorting(!1)},children:[e(N,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Asc"]}),t(r,{onClick:()=>{a.toggleSorting(!0)},children:[e(C,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Desc"]}),e(g,{}),t(r,{onClick:()=>{a.toggleVisibility(!1)},children:[e(I,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Hide"]})]})]})}):e("div",{className:s,children:n})}function z({sorted:a}){switch(a){case"desc":return e(C,{className:"ml-2 size-4"});case"asc":return e(N,{className:"ml-2 size-4"});default:return e(v,{className:"ml-2 size-4"})}}export{L as DataTableColumnHeader,B as DataTablePagination,A as DataTableViewOptions};
|
|
2
2
|
//# sourceMappingURL=data-table.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/data-table.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n ArrowDownIcon,\n ArrowUpIcon,\n CaretSortIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n DoubleArrowLeftIcon,\n DoubleArrowRightIcon,\n EyeNoneIcon,\n MixerHorizontalIcon,\n} from '@radix-ui/react-icons';\nimport { cn } from '../lib/utils';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from './dropdown-menu';\nimport { Button } from './button';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './select';\nimport type * as ReactTable from '@tanstack/react-table';\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"ml-auto hidden h-8 lg:flex\">\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-36\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((column) => typeof column.accessorFn !== 'undefined' && column.getCanHide())\n .map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.id}\n className=\"capitalize\"\n checked={column.getIsVisible()}\n onCheckedChange={(value) => {\n column.toggleVisibility(Boolean(value));\n }}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTablePagination\n * -------------------------------------------------------------------------- */\n\ninterface DataTablePaginationProps<TData> extends React.HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: DataTablePaginationProps<TData>): React.JSX.Element {\n return (\n <div className={cn('flex items-center justify-between px-2', className)} {...props}>\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of {table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={String(table.getState().pagination.pageSize)}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"w-18 h-8\">\n <SelectValue placeholder={table.getState().pagination.pageSize} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {[10, 20, 30, 40, 50].map((pageSize) => (\n <SelectItem key={pageSize} value={String(pageSize)}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-28 items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount()}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(0);\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.previousPage();\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.nextPage();\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(table.getPageCount() - 1);\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <DoubleArrowRightIcon className=\"size-4\" />\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableColumnHeader\n * -------------------------------------------------------------------------- */\n\ninterface DataTableColumnHeaderProps<TData, TValue> extends React.HTMLAttributes<HTMLDivElement> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}\n\nfunction DataTableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: DataTableColumnHeaderProps<TData, TValue>): React.JSX.Element {\n if (!column.getCanSort()) {\n return <div className={className}>{title}</div>;\n }\n\n return (\n <div className={cn('flex items-center space-x-2', className)}>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"xs\" className=\"data-[state=open]:bg-accent -ml-3\">\n <span>{title}</span>\n <SortIcon sorted={column.getIsSorted()} />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(false);\n }}\n >\n <ArrowUpIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Asc\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(true);\n }}\n >\n <ArrowDownIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Desc\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => {\n column.toggleVisibility(false);\n }}\n >\n <EyeNoneIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Hide\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n}\n\nfunction SortIcon({ sorted }: { sorted: false | ReactTable.SortDirection }): React.JSX.Element {\n switch (sorted) {\n case 'desc':\n return <ArrowDownIcon className=\"ml-2 size-4\" />;\n\n case 'asc':\n return <ArrowUpIcon className=\"ml-2 size-4\" />;\n\n default:\n return <CaretSortIcon className=\"ml-2 size-4\" />;\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DataTableViewOptions,\n DataTablePagination,\n DataTableColumnHeader,\n type DataTableViewOptionsProps,\n type DataTablePaginationProps,\n type DataTableColumnHeaderProps,\n};\n"],"mappings":"yRAGA,OACE,iBAAAA,EACA,eAAAC,EACA,iBAAAC,EACA,mBAAAC,EACA,oBAAAC,EACA,uBAAAC,EACA,wBAAAC,EACA,eAAAC,EACA,uBAAAC,MACK,wBA2BC,OACE,OAAAC,EADF,QAAAC,MAAA,oBAJR,SAASC,EAA4B,CAAE,MAAAC,CAAM,EAAwD,CACnG,OACEF,EAACG,EAAA,CACC,UAAAJ,EAACK,EAAA,CAAoB,QAAO,GAC1B,SAAAJ,EAACK,EAAA,CAAO,QAAQ,UAAU,KAAK,KAAK,UAAU,6BAC5C,UAAAN,EAACO,EAAA,CAAoB,UAAU,cAAc,EAAE,QAEjD,EACF,EACAN,EAACO,EAAA,CAAoB,MAAM,MAAM,UAAU,OACzC,UAAAR,EAACS,EAAA,CAAkB,0BAAc,EACjCT,EAACU,EAAA,EAAsB,EACtBP,EACE,cAAc,EACd,OAAQQ,GAAW,OAAOA,EAAO,WAAe,KAAeA,EAAO,WAAW,CAAC,EAClF,IAAKA,GAEFX,EAACY,EAAA,CAEC,UAAU,aACV,QAASD,EAAO,aAAa,EAC7B,gBAAkBE,GAAU,CAC1BF,EAAO,iBAAiB,EAAQE,CAAM,CACxC,EAEC,SAAAF,EAAO,IAPHA,EAAO,EAQd,CAEH,GACL,GACF,CAEJ,CAUA,SAASG,EAA2B,CAClC,MAAAX,EACA,UAAAY,EACA,GAAGC,CACL,EAAuD,CACrD,OACEf,EAAC,OAAI,UAAWgB,EAAG,yCAA0CF,CAAS,EAAI,GAAGC,EAC3E,UAAAf,EAAC,OAAI,UAAU,uCACZ,UAAAE,EAAM,4BAA4B,EAAE,KAAK,OAAO,OA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pE,GACF,GACF,EACF,EAxCOlC,EAAC,OAAI,UAAWe,EAAY,SAAAc,EAAM,CA0C7C,CAEA,SAASC,EAAS,CAAE,OAAAK,CAAO,EAAoE,CAC7F,OAAQA,EAAQ,CACd,IAAK,OACH,OAAOnC,EAACiC,EAAA,CAAc,UAAU,cAAc,EAEhD,IAAK,MACH,OAAOjC,EAACgC,EAAA,CAAY,UAAU,cAAc,EAE9C,QACE,OAAOhC,EAACoC,EAAA,CAAc,UAAU,cAAc,CAClD,CACF","names":["ArrowDownIcon","ArrowUpIcon","CaretSortIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowLeftIcon","DoubleArrowRightIcon","EyeNoneIcon","MixerHorizontalIcon","jsx","jsxs","DataTableViewOptions","table","DropdownMenu","DropdownMenuTrigger","Button","MixerHorizontalIcon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","column","DropdownMenuCheckboxItem","value","DataTablePagination","className","props","cn","Select","SelectTrigger","SelectValue","SelectContent","pageSize","SelectItem","DoubleArrowLeftIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowRightIcon","DataTableColumnHeader","title","SortIcon","DropdownMenuItem","ArrowUpIcon","ArrowDownIcon","EyeNoneIcon","sorted","CaretSortIcon"]}
|
|
1
|
+
{"version":3,"sources":["../../src/react/data-table.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n ArrowDownIcon,\n ArrowUpIcon,\n CaretSortIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n DoubleArrowLeftIcon,\n DoubleArrowRightIcon,\n EyeNoneIcon,\n MixerHorizontalIcon,\n} from '@radix-ui/react-icons';\nimport type * as ReactTable from '@tanstack/react-table';\nimport { cn } from '../lib/utils';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from './dropdown-menu';\nimport { Button } from './button';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './select';\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"ml-auto hidden h-8 lg:flex\">\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-36\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((column) => typeof column.accessorFn !== 'undefined' && column.getCanHide())\n .map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.id}\n className=\"capitalize\"\n checked={column.getIsVisible()}\n onCheckedChange={(value) => {\n column.toggleVisibility(Boolean(value));\n }}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTablePagination\n * -------------------------------------------------------------------------- */\n\ninterface DataTablePaginationProps<TData> extends React.HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: DataTablePaginationProps<TData>): React.JSX.Element {\n return (\n <div className={cn('flex items-center justify-between px-2', className)} {...props}>\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of {table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={String(table.getState().pagination.pageSize)}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"w-18 h-8\">\n <SelectValue placeholder={table.getState().pagination.pageSize} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {[10, 20, 30, 40, 50].map((pageSize) => (\n <SelectItem key={pageSize} value={String(pageSize)}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-28 items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount()}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(0);\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <DoubleArrowLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.previousPage();\n }}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n onClick={() => {\n table.nextPage();\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"icon-xs\"\n className=\"hidden lg:flex\"\n onClick={() => {\n table.setPageIndex(table.getPageCount() - 1);\n }}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <DoubleArrowRightIcon className=\"size-4\" />\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableColumnHeader\n * -------------------------------------------------------------------------- */\n\ninterface DataTableColumnHeaderProps<TData, TValue> extends React.HTMLAttributes<HTMLDivElement> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}\n\nfunction DataTableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: DataTableColumnHeaderProps<TData, TValue>): React.JSX.Element {\n if (!column.getCanSort()) {\n return <div className={className}>{title}</div>;\n }\n\n return (\n <div className={cn('flex items-center space-x-2', className)}>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"ghost\" size=\"xs\" className=\"data-[state=open]:bg-accent -ml-3\">\n <span>{title}</span>\n <SortIcon sorted={column.getIsSorted()} />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(false);\n }}\n >\n <ArrowUpIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Asc\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(true);\n }}\n >\n <ArrowDownIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Desc\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => {\n column.toggleVisibility(false);\n }}\n >\n <EyeNoneIcon className=\"text-muted-foreground/70 mr-2 size-3.5\" />\n Hide\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n}\n\nfunction SortIcon({ sorted }: { sorted: false | ReactTable.SortDirection }): React.JSX.Element {\n switch (sorted) {\n case 'desc':\n return <ArrowDownIcon className=\"ml-2 size-4\" />;\n\n case 'asc':\n return <ArrowUpIcon className=\"ml-2 size-4\" />;\n\n default:\n return <CaretSortIcon className=\"ml-2 size-4\" />;\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DataTableViewOptions,\n DataTablePagination,\n DataTableColumnHeader,\n type DataTableViewOptionsProps,\n type DataTablePaginationProps,\n type DataTableColumnHeaderProps,\n};\n"],"mappings":"yRAGA,OACE,iBAAAA,EACA,eAAAC,EACA,iBAAAC,EACA,mBAAAC,EACA,oBAAAC,EACA,uBAAAC,EACA,wBAAAC,EACA,eAAAC,EACA,uBAAAC,MACK,wBA2BC,OACE,OAAAC,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ronRightIcon","DoubleArrowLeftIcon","DoubleArrowRightIcon","EyeNoneIcon","MixerHorizontalIcon","jsx","jsxs","DataTableViewOptions","table","DropdownMenu","DropdownMenuTrigger","Button","MixerHorizontalIcon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","column","DropdownMenuCheckboxItem","value","DataTablePagination","className","props","cn","Select","SelectTrigger","SelectValue","SelectContent","pageSize","SelectItem","DoubleArrowLeftIcon","ChevronLeftIcon","ChevronRightIcon","DoubleArrowRightIcon","DataTableColumnHeader","title","SortIcon","DropdownMenuItem","ArrowUpIcon","ArrowDownIcon","EyeNoneIcon","sorted","CaretSortIcon"]}
|
package/dist/react/drawer.d.mts
CHANGED
|
@@ -10,7 +10,7 @@ type DrawerCloseProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Close>;
|
|
|
10
10
|
declare const DrawerClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
11
|
type DrawerContentProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Content>;
|
|
12
12
|
declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
13
|
-
onAnimationEnd?: (
|
|
13
|
+
onAnimationEnd?: (open: boolean) => void;
|
|
14
14
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
15
|
type DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
16
16
|
declare function DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element;
|
package/dist/react/drawer.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ type DrawerCloseProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Close>;
|
|
|
10
10
|
declare const DrawerClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
11
|
type DrawerContentProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Content>;
|
|
12
12
|
declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
13
|
-
onAnimationEnd?: (
|
|
13
|
+
onAnimationEnd?: (open: boolean) => void;
|
|
14
14
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
15
|
type DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
16
16
|
declare function DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element;
|
package/dist/react/form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/form.tsx"],"names":["React","Slot","Controller","FormProvider","useFormContext","jsx","FormFieldContext","FormItemContext","useFormField","fieldContext","itemContext","getFieldState","formState","fieldState","id","Form","FormField","props","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","FormDescription","FormMessage","children","body"],"mappings":"+FAEA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OACE,cAAAC,EAMA,gBAAAC,EAEA,kBAAAC,MACK,kBAgFD,cAAAC,MAAA,oBA5DN,IAAMC,EAAyB,gBAA4C,IAAI,EAEzEC,EAAwB,gBAA2C,IAAI,EAEvEC,EAAe,IAWhB,CACH,IAAMC,EAAqB,aAAWH,CAAgB,EAChDI,EAAoB,aAAWH,CAAe,EAC9C,CAAE,cAAAI,EAAe,UAAAC,CAAU,EAAIR,EAAe,EAEpD,GAAI,CAACK,GAAgB,CAACC,EACpB,MAAM,IAAI,MAAM,gDAAgD,EAGlE,IAAMG,EAAaF,EAAcF,EAAa,KAAMG,CAAS,EAEvD,CAAE,GAAAE,CAAG,EAAIJ,EAEf,MAAO,CACL,GAAAI,EACA,KAAML,EAAa,KACnB,WAAY,aAAaK,CAAE,GAC3B,kBAAmB,yBAAyBA,CAAE,GAC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Q,CAChC,GAAM,CAAE,kBAAAO,CAAkB,EAAInB,EAAa,EAE3C,OAAOH,EAAC,KAAE,IAAKe,EAAK,GAAIO,EAAmB,UAAWN,EAAG,gCAAiCF,CAAS,EAAI,GAAGF,EAAO,CACnH,CACF,EAEAY,EAAgB,YAAc,kBAS9B,IAAMC,EAAoB,aAAiD,CAAC,CAAE,SAAAC,EAAU,UAAAZ,EAAW,GAAGF,CAAM,EAAGG,IAAQ,CACrH,GAAM,CAAE,MAAAG,EAAO,cAAAK,CAAc,EAAIpB,EAAa,EACxCwB,EAAOT,GAAO,QAAU,OAAOA,EAAM,OAAO,EAAIQ,EAEtD,OAAKC,EAKH3B,EAAC,KAAE,IAAKe,EAAK,GAAIQ,EAAe,UAAWP,EAAG,uCAAwCF,CAAS,EAAI,GAAGF,EACnG,SAAAe,EACH,EANO,IAQX,CAAC,EAEDF,EAAY,YAAc","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n type ControllerProps,\n type FieldError,\n type FieldErrorsImpl,\n type FieldPath,\n type FieldValues,\n FormProvider,\n type Merge,\n useFormContext,\n} from 'react-hook-form';\nimport
|
|
1
|
+
{"version":3,"sources":["../../src/react/form.tsx"],"names":["React","Slot","Controller","FormProvider","useFormContext","jsx","FormFieldContext","FormItemContext","useFormField","fieldContext","itemContext","getFieldState","formState","fieldState","id","Form","FormField","props","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","FormDescription","FormMessage","children","body"],"mappings":"+FAEA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OACE,cAAAC,EAMA,gBAAAC,EAEA,kBAAAC,MACK,kBAgFD,cAAAC,MAAA,oBA5DN,IAAMC,EAAyB,gBAA4C,IAAI,EAEzEC,EAAwB,gBAA2C,IAAI,EAEvEC,EAAe,IAWhB,CACH,IAAMC,EAAqB,aAAWH,CAAgB,EAChDI,EAAoB,aAAWH,C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AY,kBAAAG,EAAmB,cAAAC,CAAc,EAAIpB,EAAa,EAE7E,OACEH,EAACJ,EAAA,CACC,IAAKmB,EACL,GAAII,EACJ,mBAAmBD,EAA4B,GAAGI,CAAiB,IAAIC,CAAa,GAAzDD,EAC3B,eAAc,EAAQJ,EACrB,GAAGN,EACN,CAEJ,CAAC,EAEDS,EAAY,YAAc,cAS1B,IAAMG,EAAwB,aAC5B,CAAC,CAAE,UAAAV,EAAW,GAAGF,CAAM,EAAGG,IAAQ,CAChC,GAAM,CAAE,kBAAAO,CAAkB,EAAInB,EAAa,EAE3C,OAAOH,EAAC,KAAE,IAAKe,EAAK,GAAIO,EAAmB,UAAWN,EAAG,gCAAiCF,CAAS,EAAI,GAAGF,EAAO,CACnH,CACF,EAEAY,EAAgB,YAAc,kBAS9B,IAAMC,EAAoB,aAAiD,CAAC,CAAE,SAAAC,EAAU,UAAAZ,EAAW,GAAGF,CAAM,EAAGG,IAAQ,CACrH,GAAM,CAAE,MAAAG,EAAO,cAAAK,CAAc,EAAIpB,EAAa,EACxCwB,EAAOT,GAAO,QAAU,OAAOA,EAAM,OAAO,EAAIQ,EAEtD,OAAKC,EAKH3B,EAAC,KAAE,IAAKe,EAAK,GAAIQ,EAAe,UAAWP,EAAG,uCAAwCF,CAAS,EAAI,GAAGF,EACnG,SAAAe,EACH,EANO,IAQX,CAAC,EAEDF,EAAY,YAAc","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n type ControllerProps,\n type FieldError,\n type FieldErrorsImpl,\n type FieldPath,\n type FieldValues,\n FormProvider,\n type Merge,\n useFormContext,\n} from 'react-hook-form';\nimport type * as LabelPrimitive from '@radix-ui/react-label';\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\n\n/* -----------------------------------------------------------------------------\n * Context: Form\n * -------------------------------------------------------------------------- */\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null);\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nconst useFormField = (): {\n error?: FieldError | Merge<FieldError, FieldErrorsImpl> | undefined;\n formDescriptionId: string;\n formItemId: string;\n formMessageId: string;\n id: string;\n invalid: boolean;\n isDirty: boolean;\n isTouched: boolean;\n isValidating: boolean;\n name: string;\n} => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n if (!fieldContext || !itemContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `form-item-${id}`,\n formDescriptionId: `form-item-description-${id}`,\n formMessageId: `form-item-message-${id}`,\n ...fieldState,\n };\n};\n\n/* -----------------------------------------------------------------------------\n * Component: Form\n * -------------------------------------------------------------------------- */\n\ntype FormProps = React.ComponentProps<typeof FormProvider>;\nconst Form = FormProvider;\n\n/* -----------------------------------------------------------------------------\n * Component: FormField\n * -------------------------------------------------------------------------- */\n\ntype FormFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = ControllerProps<TFieldValues, TName>;\n\nfunction FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({ ...props }: FormFieldProps<TFieldValues, TName>): React.JSX.Element {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: FormItem\n * -------------------------------------------------------------------------- */\n\ntype FormItemElement = HTMLDivElement;\ntype FormItemProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst FormItem = React.forwardRef<FormItemElement, FormItemProps>(({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('space-y-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n});\n\nFormItem.displayName = 'FormItem';\n\n/* -----------------------------------------------------------------------------\n * Component: FormLabel\n * -------------------------------------------------------------------------- */\n\ntype FormFieldElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype FormLabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nconst FormLabel = React.forwardRef<FormFieldElement, FormLabelProps>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return <Label ref={ref} className={cn(error && 'text-destructive', className)} htmlFor={formItemId} {...props} />;\n});\n\nFormLabel.displayName = 'FormLabel';\n\n/* -----------------------------------------------------------------------------\n * Component: FormControl\n * -------------------------------------------------------------------------- */\n\ntype FormControlElement = React.ElementRef<typeof Slot>;\ntype FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;\n\nconst FormControl = React.forwardRef<FormControlElement, FormControlProps>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={Boolean(error)}\n {...props}\n />\n );\n});\n\nFormControl.displayName = 'FormControl';\n\n/* -----------------------------------------------------------------------------\n * Component: FormDescription\n * -------------------------------------------------------------------------- */\n\ntype FormDescriptionElement = HTMLParagraphElement;\ntype FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormDescription = React.forwardRef<FormDescriptionElement, FormDescriptionProps>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return <p ref={ref} id={formDescriptionId} className={cn('text-muted-foreground text-xs', className)} {...props} />;\n },\n);\n\nFormDescription.displayName = 'FormDescription';\n\n/* -----------------------------------------------------------------------------\n * Component: FormMessage\n * -------------------------------------------------------------------------- */\n\ntype FormMessageElement = HTMLParagraphElement;\ntype FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormMessage = React.forwardRef<FormMessageElement, FormMessageProps>(({ children, className, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error?.message ? String(error.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p ref={ref} id={formMessageId} className={cn('text-destructive text-xs font-medium', className)} {...props}>\n {body}\n </p>\n );\n});\n\nFormMessage.displayName = 'FormMessage';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n type FormProps,\n type FormItemProps,\n type FormLabelProps,\n type FormControlProps,\n type FormDescriptionProps,\n type FormMessageProps,\n type FormFieldProps,\n};\n"]}
|
package/dist/react/form.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/form.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n type ControllerProps,\n type FieldError,\n type FieldErrorsImpl,\n type FieldPath,\n type FieldValues,\n FormProvider,\n type Merge,\n useFormContext,\n} from 'react-hook-form';\nimport
|
|
1
|
+
{"version":3,"sources":["../../src/react/form.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport {\n Controller,\n type ControllerProps,\n type FieldError,\n type FieldErrorsImpl,\n type FieldPath,\n type FieldValues,\n FormProvider,\n type Merge,\n useFormContext,\n} from 'react-hook-form';\nimport type * as LabelPrimitive from '@radix-ui/react-label';\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\n\n/* -----------------------------------------------------------------------------\n * Context: Form\n * -------------------------------------------------------------------------- */\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null);\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nconst useFormField = (): {\n error?: FieldError | Merge<FieldError, FieldErrorsImpl> | undefined;\n formDescriptionId: string;\n formItemId: string;\n formMessageId: string;\n id: string;\n invalid: boolean;\n isDirty: boolean;\n isTouched: boolean;\n isValidating: boolean;\n name: string;\n} => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n if (!fieldContext || !itemContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `form-item-${id}`,\n formDescriptionId: `form-item-description-${id}`,\n formMessageId: `form-item-message-${id}`,\n ...fieldState,\n };\n};\n\n/* -----------------------------------------------------------------------------\n * Component: Form\n * -------------------------------------------------------------------------- */\n\ntype FormProps = React.ComponentProps<typeof FormProvider>;\nconst Form = FormProvider;\n\n/* -----------------------------------------------------------------------------\n * Component: FormField\n * -------------------------------------------------------------------------- */\n\ntype FormFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = ControllerProps<TFieldValues, TName>;\n\nfunction FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({ ...props }: FormFieldProps<TFieldValues, TName>): React.JSX.Element {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: FormItem\n * -------------------------------------------------------------------------- */\n\ntype FormItemElement = HTMLDivElement;\ntype FormItemProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst FormItem = React.forwardRef<FormItemElement, FormItemProps>(({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn('space-y-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n});\n\nFormItem.displayName = 'FormItem';\n\n/* -----------------------------------------------------------------------------\n * Component: FormLabel\n * -------------------------------------------------------------------------- */\n\ntype FormFieldElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype FormLabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nconst FormLabel = React.forwardRef<FormFieldElement, FormLabelProps>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return <Label ref={ref} className={cn(error && 'text-destructive', className)} htmlFor={formItemId} {...props} />;\n});\n\nFormLabel.displayName = 'FormLabel';\n\n/* -----------------------------------------------------------------------------\n * Component: FormControl\n * -------------------------------------------------------------------------- */\n\ntype FormControlElement = React.ElementRef<typeof Slot>;\ntype FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;\n\nconst FormControl = React.forwardRef<FormControlElement, FormControlProps>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={Boolean(error)}\n {...props}\n />\n );\n});\n\nFormControl.displayName = 'FormControl';\n\n/* -----------------------------------------------------------------------------\n * Component: FormDescription\n * -------------------------------------------------------------------------- */\n\ntype FormDescriptionElement = HTMLParagraphElement;\ntype FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormDescription = React.forwardRef<FormDescriptionElement, FormDescriptionProps>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return <p ref={ref} id={formDescriptionId} className={cn('text-muted-foreground text-xs', className)} {...props} />;\n },\n);\n\nFormDescription.displayName = 'FormDescription';\n\n/* -----------------------------------------------------------------------------\n * Component: FormMessage\n * -------------------------------------------------------------------------- */\n\ntype FormMessageElement = HTMLParagraphElement;\ntype FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormMessage = React.forwardRef<FormMessageElement, FormMessageProps>(({ children, className, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error?.message ? String(error.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p ref={ref} id={formMessageId} className={cn('text-destructive text-xs font-medium', className)} {...props}>\n {body}\n </p>\n );\n});\n\nFormMessage.displayName = 'FormMessage';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n type FormProps,\n type FormItemProps,\n type FormLabelProps,\n type FormControlProps,\n type FormDescriptionProps,\n type FormMessageProps,\n type FormFieldProps,\n};\n"],"mappings":"iGAEA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OACE,cAAAC,EAMA,gBAAAC,EAEA,kBAAAC,MACK,kBAgFD,cAAAC,MAAA,oBA5DN,IAAMC,EAAyB,gBAA4C,IAAI,EAEzEC,EAAwB,gBAA2C,IAAI,EAEvEC,EAAe,IAWhB,CACH,IAAMC,EAAqB,aAAWH,CAAgB,EAChDI,EAAoB,aAAWH,CAAe,EAC9C,CAAE,cAAAI,EAAe,UAAAC,CAAU,EAAIC,EAAe,EAEpD,GAAI,CAACJ,GAAgB,CAACC,EACpB,MAAM,IAAI,MAAM,gDAAgD,EAGlE,IAAMI,EAAaH,EAAcF,EAAa,KAAMG,CAAS,EAEvD,CAAE,GAAAG,CAAG,EAAIL,EAEf,MAAO,CACL,GAAAK,EACA,KAAMN,EAAa,KACnB,WAAY,aAAaM,CAAE,GAC3B,kBAAmB,yBAAyBA,CAAE,GAC9C,cAAe,qBAAqBA,CAAE,GACtC,GAAGD,CACL,CACF,EAOME,EAAOC,EAWb,SAASC,EAGP,CAAE,GAAGC,CAAM,E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mB,UAAWN,EAAG,gCAAiCF,CAAS,EAAI,GAAGH,EAAO,CACnH,CACF,EAEAc,EAAgB,YAAc,kBAS9B,IAAMC,EAAoB,aAAiD,CAAC,CAAE,SAAAC,EAAU,UAAAb,EAAW,GAAGH,CAAM,EAAGI,IAAQ,CACrH,GAAM,CAAE,MAAAG,EAAO,cAAAK,CAAc,EAAIvB,EAAa,EACxC4B,EAAOV,GAAO,QAAU,OAAOA,EAAM,OAAO,EAAIS,EAEtD,OAAKC,EAKH/B,EAAC,KAAE,IAAKkB,EAAK,GAAIQ,EAAe,UAAWP,EAAG,uCAAwCF,CAAS,EAAI,GAAGH,EACnG,SAAAiB,EACH,EANO,IAQX,CAAC,EAEDF,EAAY,YAAc","names":["React","Slot","Controller","FormProvider","useFormContext","jsx","FormFieldContext","FormItemContext","useFormField","fieldContext","itemContext","getFieldState","formState","useFormContext","fieldState","id","Form","FormProvider","FormField","props","Controller","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","children","body"]}
|
package/dist/react/input.d.mts
CHANGED
|
@@ -29,9 +29,9 @@ declare const inputVariants: (props?: ({
|
|
|
29
29
|
} | null | undefined)[] | {
|
|
30
30
|
[x: string]: any;
|
|
31
31
|
} | null | undefined;
|
|
32
|
-
className?:
|
|
32
|
+
className?: never;
|
|
33
33
|
} | {
|
|
34
|
-
class?:
|
|
34
|
+
class?: never;
|
|
35
35
|
className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
|
|
36
36
|
[x: string]: any;
|
|
37
37
|
} | null | undefined)[] | {
|
package/dist/react/input.d.ts
CHANGED
|
@@ -29,9 +29,9 @@ declare const inputVariants: (props?: ({
|
|
|
29
29
|
} | null | undefined)[] | {
|
|
30
30
|
[x: string]: any;
|
|
31
31
|
} | null | undefined;
|
|
32
|
-
className?:
|
|
32
|
+
className?: never;
|
|
33
33
|
} | {
|
|
34
|
-
class?:
|
|
34
|
+
class?: never;
|
|
35
35
|
className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
|
|
36
36
|
[x: string]: any;
|
|
37
37
|
} | null | undefined)[] | {
|
package/dist/react/input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/input.tsx"],"names":["React","jsx","inputVariants","cva","Input","className","inputSize","props","ref"],"mappings":"yCAAA,UAAYA,MAAW,QAiCd,cAAAC,MAAA,oBAzBT,IAAMC,EAAgBC,EAAI,CACxB,KAAM,kUACN,SAAU,CACR,UAAW,CACT,QAAS,OACT,GAAI,MACJ,GAAI,MACJ,GAAI,MACN,CACF,EACA,gBAAiB,CACf,UAAW,SACb,CACF,CAAC,EAWKC,EAAc,aAAqC,CAAC,CAAE,UAAAC,EAAW,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACrFP,EAAC,SAAM,KAAK,OAAO,UAAWC,EAAc,CAAE,UAAAG,EAAW,UAAAC,CAAU,CAAC,EAAG,IAAKE,EAAM,GAAGD,EAAO,CACpG,EAEDH,EAAM,YAAc","sourcesContent":["import * as React from 'react';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/react/input.tsx"],"names":["React","jsx","inputVariants","cva","Input","className","inputSize","props","ref"],"mappings":"yCAAA,UAAYA,MAAW,QAiCd,cAAAC,MAAA,oBAzBT,IAAMC,EAAgBC,EAAI,CACxB,KAAM,kUACN,SAAU,CACR,UAAW,CACT,QAAS,OACT,GAAI,MACJ,GAAI,MACJ,GAAI,MACN,CACF,EACA,gBAAiB,CACf,UAAW,SACb,CACF,CAAC,EAWKC,EAAc,aAAqC,CAAC,CAAE,UAAAC,EAAW,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACrFP,EAAC,SAAM,KAAK,OAAO,UAAWC,EAAc,CAAE,UAAAG,EAAW,UAAAC,CAAU,CAAC,EAAG,IAAKE,EAAM,GAAGD,EAAO,CACpG,EAEDH,EAAM,YAAc","sourcesContent":["import * as React from 'react';\nimport { type VariantProps } from 'cva';\nimport { cva } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Variant: Input\n * -------------------------------------------------------------------------- */\n\nconst inputVariants = cva({\n base: 'border-input placeholder:text-muted-foreground flex w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm transition file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50',\n variants: {\n inputSize: {\n default: 'h-10',\n xs: 'h-8',\n sm: 'h-9',\n lg: 'h-11',\n },\n },\n defaultVariants: {\n inputSize: 'default',\n },\n});\n\ntype InputVariantsProps = VariantProps<typeof inputVariants>;\n\n/* -----------------------------------------------------------------------------\n * Component: Input\n * -------------------------------------------------------------------------- */\n\ntype InputElement = HTMLInputElement;\ntype InputProps = React.InputHTMLAttributes<HTMLInputElement> & InputVariantsProps;\n\nconst Input = React.forwardRef<InputElement, InputProps>(({ className, inputSize, ...props }, ref) => {\n return <input type=\"text\" className={inputVariants({ className, inputSize })} ref={ref} {...props} />;\n});\n\nInput.displayName = 'Input';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Input, type InputProps };\n"]}
|
package/dist/react/input.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/input.tsx"],"sourcesContent":["import * as React from 'react';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/react/input.tsx"],"sourcesContent":["import * as React from 'react';\nimport { type VariantProps } from 'cva';\nimport { cva } from '../lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Variant: Input\n * -------------------------------------------------------------------------- */\n\nconst inputVariants = cva({\n base: 'border-input placeholder:text-muted-foreground flex w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm transition file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50',\n variants: {\n inputSize: {\n default: 'h-10',\n xs: 'h-8',\n sm: 'h-9',\n lg: 'h-11',\n },\n },\n defaultVariants: {\n inputSize: 'default',\n },\n});\n\ntype InputVariantsProps = VariantProps<typeof inputVariants>;\n\n/* -----------------------------------------------------------------------------\n * Component: Input\n * -------------------------------------------------------------------------- */\n\ntype InputElement = HTMLInputElement;\ntype InputProps = React.InputHTMLAttributes<HTMLInputElement> & InputVariantsProps;\n\nconst Input = React.forwardRef<InputElement, InputProps>(({ className, inputSize, ...props }, ref) => {\n return <input type=\"text\" className={inputVariants({ className, inputSize })} ref={ref} {...props} />;\n});\n\nInput.displayName = 'Input';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Input, type InputProps };\n"],"mappings":"0CAAA,UAAYA,MAAW,QAiCd,cAAAC,MAAA,oBAzBT,IAAMC,EAAgBC,EAAI,CACxB,KAAM,kUACN,SAAU,CACR,UAAW,CACT,QAAS,OACT,GAAI,MACJ,GAAI,MACJ,GAAI,MACN,CACF,EACA,gBAAiB,CACf,UAAW,SACb,CACF,CAAC,EAWKC,EAAc,aAAqC,CAAC,CAAE,UAAAC,EAAW,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACrFP,EAAC,SAAM,KAAK,OAAO,UAAWC,EAAc,CAAE,UAAAG,EAAW,UAAAC,CAAU,CAAC,EAAG,IAAKE,EAAM,GAAGD,EAAO,CACpG,EAEDH,EAAM,YAAc","names":["React","jsx","inputVariants","cva","Input","className","inputSize","props","ref"]}
|
package/dist/react/menubar.d.mts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
|
1
3
|
import * as React from 'react';
|
|
2
4
|
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
|
3
5
|
|
|
4
6
|
type MenubarMenuProps = React.ComponentProps<typeof MenubarPrimitive.Menu>;
|
|
5
7
|
declare const MenubarMenu: {
|
|
6
|
-
(props: MenubarPrimitive.
|
|
8
|
+
(props: MenubarPrimitive.MenubarMenuProps & {
|
|
9
|
+
__scopeMenubar?: _radix_ui_react_context.Scope;
|
|
10
|
+
}): react_jsx_runtime.JSX.Element;
|
|
7
11
|
displayName: string;
|
|
8
12
|
};
|
|
9
13
|
type MenubarGroupProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Group>;
|
package/dist/react/menubar.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as _radix_ui_react_context from '@radix-ui/react-context';
|
|
1
3
|
import * as React from 'react';
|
|
2
4
|
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
|
3
5
|
|
|
4
6
|
type MenubarMenuProps = React.ComponentProps<typeof MenubarPrimitive.Menu>;
|
|
5
7
|
declare const MenubarMenu: {
|
|
6
|
-
(props: MenubarPrimitive.
|
|
8
|
+
(props: MenubarPrimitive.MenubarMenuProps & {
|
|
9
|
+
__scopeMenubar?: _radix_ui_react_context.Scope;
|
|
10
|
+
}): react_jsx_runtime.JSX.Element;
|
|
7
11
|
displayName: string;
|
|
8
12
|
};
|
|
9
13
|
type MenubarGroupProps = React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Group>;
|
|
@@ -27,9 +27,9 @@ declare const navigationMenuTriggerVariants: (props?: ({
|
|
|
27
27
|
} | null | undefined)[] | {
|
|
28
28
|
[x: string]: any;
|
|
29
29
|
} | null | undefined;
|
|
30
|
-
className?:
|
|
30
|
+
className?: never;
|
|
31
31
|
} | {
|
|
32
|
-
class?:
|
|
32
|
+
class?: never;
|
|
33
33
|
className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
|
|
34
34
|
[x: string]: any;
|
|
35
35
|
} | null | undefined)[] | {
|
|
@@ -27,9 +27,9 @@ declare const navigationMenuTriggerVariants: (props?: ({
|
|
|
27
27
|
} | null | undefined)[] | {
|
|
28
28
|
[x: string]: any;
|
|
29
29
|
} | null | undefined;
|
|
30
|
-
className?:
|
|
30
|
+
className?: never;
|
|
31
31
|
} | {
|
|
32
|
-
class?:
|
|
32
|
+
class?: never;
|
|
33
33
|
className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
|
|
34
34
|
[x: string]: any;
|
|
35
35
|
} | null | undefined)[] | {
|