@codefast/ui 0.0.8 → 0.0.9
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/accordion.d.mts +5 -1
- package/dist/accordion.d.ts +5 -1
- package/dist/accordion.js.map +1 -1
- package/dist/accordion.mjs.map +1 -1
- package/dist/alert-dialog.d.mts +12 -3
- package/dist/alert-dialog.d.ts +12 -3
- package/dist/alert-dialog.js +3 -3
- package/dist/alert-dialog.js.map +1 -1
- package/dist/alert-dialog.mjs +1 -1
- package/dist/alert-dialog.mjs.map +1 -1
- package/dist/alert.d.mts +10 -5
- package/dist/alert.d.ts +10 -5
- package/dist/alert.js +22 -18
- package/dist/alert.js.map +1 -1
- package/dist/alert.mjs +22 -18
- package/dist/alert.mjs.map +1 -1
- package/dist/aspect-ratio.d.mts +2 -1
- package/dist/aspect-ratio.d.ts +2 -1
- package/dist/aspect-ratio.js.map +1 -1
- package/dist/aspect-ratio.mjs.map +1 -1
- package/dist/avatar.d.mts +4 -1
- package/dist/avatar.d.ts +4 -1
- package/dist/avatar.js.map +1 -1
- package/dist/avatar.mjs.map +1 -1
- package/dist/badge.d.mts +5 -2
- package/dist/badge.d.ts +5 -2
- package/dist/badge.js.map +1 -1
- package/dist/badge.mjs.map +1 -1
- package/dist/blockquote.d.mts +5 -4
- package/dist/blockquote.d.ts +5 -4
- package/dist/blockquote.js +6 -4
- package/dist/blockquote.js.map +1 -1
- package/dist/blockquote.mjs +6 -4
- package/dist/blockquote.mjs.map +1 -1
- package/dist/box.d.mts +1 -1
- package/dist/box.d.ts +1 -1
- package/dist/box.js.map +1 -1
- package/dist/box.mjs.map +1 -1
- package/dist/breadcrumb.d.mts +18 -11
- package/dist/breadcrumb.d.ts +18 -11
- package/dist/breadcrumb.js +49 -39
- package/dist/breadcrumb.js.map +1 -1
- package/dist/breadcrumb.mjs +49 -39
- package/dist/breadcrumb.mjs.map +1 -1
- package/dist/button.d.mts +3 -2
- package/dist/button.d.ts +3 -2
- package/dist/button.js +2 -2
- package/dist/button.mjs +1 -1
- package/dist/calendar.d.mts +3 -2
- package/dist/calendar.d.ts +3 -2
- package/dist/calendar.js +3 -3
- package/dist/calendar.js.map +1 -1
- package/dist/calendar.mjs +1 -1
- package/dist/calendar.mjs.map +1 -1
- package/dist/card.d.mts +13 -7
- package/dist/card.d.ts +13 -7
- package/dist/card.js +47 -37
- package/dist/card.js.map +1 -1
- package/dist/card.mjs +47 -37
- package/dist/card.mjs.map +1 -1
- package/dist/carousel.d.mts +13 -8
- package/dist/carousel.d.ts +13 -8
- package/dist/carousel.js +63 -57
- package/dist/carousel.js.map +1 -1
- package/dist/carousel.mjs +62 -56
- package/dist/carousel.mjs.map +1 -1
- package/dist/checkbox.d.mts +2 -1
- package/dist/checkbox.d.ts +2 -1
- package/dist/checkbox.js.map +1 -1
- package/dist/checkbox.mjs.map +1 -1
- package/dist/{chunk-OCLLX7EY.js → chunk-3BDLWZ3W.js} +1 -1
- package/dist/chunk-3BDLWZ3W.js.map +1 -0
- package/dist/{chunk-2D7SRYKN.js → chunk-43YGVOCO.js} +1 -1
- package/dist/chunk-43YGVOCO.js.map +1 -0
- package/dist/{chunk-EIHWTXQ4.mjs → chunk-AJLEALVP.mjs} +1 -1
- package/dist/chunk-AJLEALVP.mjs.map +1 -0
- package/dist/{chunk-LDYBRDAY.js → chunk-D6NQEMTJ.js} +1 -1
- package/dist/chunk-D6NQEMTJ.js.map +1 -0
- package/dist/{chunk-KW5FJ62U.mjs → chunk-FATZHRHR.mjs} +1 -1
- package/dist/chunk-FATZHRHR.mjs.map +1 -0
- package/dist/{chunk-RTKEO347.js → chunk-GRKABVK4.js} +1 -1
- package/dist/chunk-GRKABVK4.js.map +1 -0
- package/dist/{chunk-U2WDUCW3.js → chunk-JOJW7BBY.js} +1 -1
- package/dist/{chunk-U2WDUCW3.js.map → chunk-JOJW7BBY.js.map} +1 -1
- package/dist/{chunk-ESWGFN3R.mjs → chunk-KV4VL2ZF.mjs} +1 -1
- package/dist/chunk-KV4VL2ZF.mjs.map +1 -0
- package/dist/{chunk-T52N6ZBP.mjs → chunk-MJDKD2K4.mjs} +1 -1
- package/dist/{chunk-T52N6ZBP.mjs.map → chunk-MJDKD2K4.mjs.map} +1 -1
- package/dist/{chunk-EDVCMWDT.mjs → chunk-NCEN3XBK.mjs} +1 -1
- package/dist/chunk-NCEN3XBK.mjs.map +1 -0
- package/dist/{chunk-PTD4AMHI.mjs → chunk-PIU627A3.mjs} +1 -1
- package/dist/chunk-PIU627A3.mjs.map +1 -0
- package/dist/{chunk-5GHZ6EXI.js → chunk-PKB2G726.js} +1 -1
- package/dist/{chunk-5GHZ6EXI.js.map → chunk-PKB2G726.js.map} +1 -1
- package/dist/code.d.mts +5 -4
- package/dist/code.d.ts +5 -4
- package/dist/code.js +6 -4
- package/dist/code.js.map +1 -1
- package/dist/code.mjs +6 -4
- package/dist/code.mjs.map +1 -1
- package/dist/collapsible.d.mts +4 -1
- package/dist/collapsible.d.ts +4 -1
- package/dist/collapsible.js.map +1 -1
- package/dist/collapsible.mjs.map +1 -1
- package/dist/command.d.mts +14 -3
- package/dist/command.d.ts +14 -3
- package/dist/command.js +6 -3
- package/dist/command.js.map +1 -1
- package/dist/command.mjs +5 -2
- package/dist/command.mjs.map +1 -1
- package/dist/container.d.mts +5 -4
- package/dist/container.d.ts +5 -4
- package/dist/container.js +6 -4
- package/dist/container.js.map +1 -1
- package/dist/container.mjs +6 -4
- package/dist/container.mjs.map +1 -1
- package/dist/context-menu.d.mts +26 -11
- package/dist/context-menu.d.ts +26 -11
- package/dist/context-menu.js.map +1 -1
- package/dist/context-menu.mjs.map +1 -1
- package/dist/data-table.d.mts +10 -7
- package/dist/data-table.d.ts +10 -7
- package/dist/data-table.js +25 -25
- package/dist/data-table.js.map +1 -1
- package/dist/data-table.mjs +3 -3
- package/dist/data-table.mjs.map +1 -1
- package/dist/dialog.d.mts +11 -3
- package/dist/dialog.d.ts +11 -3
- package/dist/dialog.js +2 -2
- package/dist/dialog.mjs +1 -1
- package/dist/drawer.d.mts +12 -4
- package/dist/drawer.d.ts +12 -4
- package/dist/drawer.js.map +1 -1
- package/dist/drawer.mjs.map +1 -1
- package/dist/dropdown-menu.d.mts +25 -11
- package/dist/dropdown-menu.d.ts +25 -11
- package/dist/dropdown-menu.js +2 -2
- package/dist/dropdown-menu.mjs +1 -1
- package/dist/em.d.mts +5 -4
- package/dist/em.d.ts +5 -4
- package/dist/em.js +6 -4
- package/dist/em.js.map +1 -1
- package/dist/em.mjs +6 -4
- package/dist/em.mjs.map +1 -1
- package/dist/form.d.mts +14 -6
- package/dist/form.d.ts +14 -6
- package/dist/form.js +26 -22
- package/dist/form.js.map +1 -1
- package/dist/form.mjs +25 -21
- package/dist/form.mjs.map +1 -1
- package/dist/heading.d.mts +6 -5
- package/dist/heading.d.ts +6 -5
- package/dist/heading.js +6 -4
- package/dist/heading.js.map +1 -1
- package/dist/heading.mjs +6 -4
- package/dist/heading.mjs.map +1 -1
- package/dist/hover-card.d.mts +4 -1
- package/dist/hover-card.d.ts +4 -1
- package/dist/hover-card.js.map +1 -1
- package/dist/hover-card.mjs.map +1 -1
- package/dist/input-otp.d.mts +12 -32
- package/dist/input-otp.d.ts +12 -32
- package/dist/input-otp.js +30 -22
- package/dist/input-otp.js.map +1 -1
- package/dist/input-otp.mjs +29 -21
- package/dist/input-otp.mjs.map +1 -1
- package/dist/input.d.mts +6 -3
- package/dist/input.d.ts +6 -3
- package/dist/input.js +13 -11
- package/dist/input.js.map +1 -1
- package/dist/input.mjs +13 -11
- package/dist/input.mjs.map +1 -1
- package/dist/kbd.d.mts +5 -4
- package/dist/kbd.d.ts +5 -4
- package/dist/kbd.js +16 -14
- package/dist/kbd.js.map +1 -1
- package/dist/kbd.mjs +16 -14
- package/dist/kbd.mjs.map +1 -1
- package/dist/label.d.mts +2 -1
- package/dist/label.d.ts +2 -1
- package/dist/label.js +2 -2
- package/dist/label.mjs +1 -1
- package/dist/menubar.d.mts +27 -12
- package/dist/menubar.d.ts +27 -12
- package/dist/menubar.js.map +1 -1
- package/dist/menubar.mjs.map +1 -1
- package/dist/navigation-menu.d.mts +9 -1
- package/dist/navigation-menu.d.ts +9 -1
- package/dist/navigation-menu.js.map +1 -1
- package/dist/navigation-menu.mjs.map +1 -1
- package/dist/pagination.d.mts +13 -7
- package/dist/pagination.d.ts +13 -7
- package/dist/pagination.js +5 -3
- package/dist/pagination.js.map +1 -1
- package/dist/pagination.mjs +4 -2
- package/dist/pagination.mjs.map +1 -1
- package/dist/popover.d.mts +6 -1
- package/dist/popover.d.ts +6 -1
- package/dist/popover.js.map +1 -1
- package/dist/popover.mjs.map +1 -1
- package/dist/pre.d.mts +5 -4
- package/dist/pre.d.ts +5 -4
- package/dist/pre.js +6 -4
- package/dist/pre.js.map +1 -1
- package/dist/pre.mjs +6 -4
- package/dist/pre.mjs.map +1 -1
- package/dist/progress.d.mts +2 -1
- package/dist/progress.d.ts +2 -1
- package/dist/progress.js +1 -1
- package/dist/progress.js.map +1 -1
- package/dist/progress.mjs +1 -1
- package/dist/progress.mjs.map +1 -1
- package/dist/quote.d.mts +5 -4
- package/dist/quote.d.ts +5 -4
- package/dist/quote.js +6 -4
- package/dist/quote.js.map +1 -1
- package/dist/quote.mjs +6 -4
- package/dist/quote.mjs.map +1 -1
- package/dist/radio-group.d.mts +3 -1
- package/dist/radio-group.d.ts +3 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/radio-group.mjs.map +1 -1
- package/dist/resizable.d.mts +4 -4
- package/dist/resizable.d.ts +4 -4
- package/dist/resizable.js +1 -1
- package/dist/resizable.js.map +1 -1
- package/dist/resizable.mjs +1 -1
- package/dist/resizable.mjs.map +1 -1
- package/dist/scroll-area.d.mts +4 -2
- package/dist/scroll-area.d.ts +4 -2
- package/dist/scroll-area.js +6 -6
- package/dist/scroll-area.js.map +1 -1
- package/dist/scroll-area.mjs +6 -6
- package/dist/scroll-area.mjs.map +1 -1
- package/dist/section.d.mts +5 -4
- package/dist/section.d.ts +5 -4
- package/dist/section.js +6 -4
- package/dist/section.js.map +1 -1
- package/dist/section.mjs +6 -4
- package/dist/section.mjs.map +1 -1
- package/dist/select.d.mts +11 -1
- package/dist/select.d.ts +11 -1
- package/dist/select.js +2 -2
- package/dist/select.mjs +1 -1
- package/dist/separator.d.mts +2 -1
- package/dist/separator.d.ts +2 -1
- package/dist/separator.js.map +1 -1
- package/dist/separator.mjs.map +1 -1
- package/dist/sheet.d.mts +18 -8
- package/dist/sheet.d.ts +18 -8
- package/dist/sheet.js.map +1 -1
- package/dist/sheet.mjs.map +1 -1
- package/dist/skeleton.d.mts +3 -2
- package/dist/skeleton.d.ts +3 -2
- package/dist/skeleton.js +1 -4
- package/dist/skeleton.js.map +1 -1
- package/dist/skeleton.mjs +1 -4
- package/dist/skeleton.mjs.map +1 -1
- package/dist/slider.d.mts +2 -1
- package/dist/slider.d.ts +2 -1
- package/dist/slider.js.map +1 -1
- package/dist/slider.mjs.map +1 -1
- package/dist/sonner.d.mts +1 -1
- package/dist/sonner.d.ts +1 -1
- package/dist/sonner.js.map +1 -1
- package/dist/sonner.mjs.map +1 -1
- package/dist/strong.d.mts +5 -4
- package/dist/strong.d.ts +5 -4
- package/dist/strong.js +6 -4
- package/dist/strong.js.map +1 -1
- package/dist/strong.mjs +6 -4
- package/dist/strong.mjs.map +1 -1
- package/dist/switch.d.mts +2 -1
- package/dist/switch.d.ts +2 -1
- package/dist/switch.js.map +1 -1
- package/dist/switch.mjs.map +1 -1
- package/dist/table.d.mts +17 -9
- package/dist/table.d.ts +17 -9
- package/dist/table.js +75 -58
- package/dist/table.js.map +1 -1
- package/dist/table.mjs +75 -58
- package/dist/table.mjs.map +1 -1
- package/dist/tabs.d.mts +5 -1
- package/dist/tabs.d.ts +5 -1
- package/dist/tabs.js.map +1 -1
- package/dist/tabs.mjs.map +1 -1
- package/dist/text.d.mts +1 -1
- package/dist/text.d.ts +1 -1
- package/dist/text.js.map +1 -1
- package/dist/text.mjs.map +1 -1
- package/dist/textarea.d.mts +3 -2
- package/dist/textarea.d.ts +3 -2
- package/dist/textarea.js +15 -13
- package/dist/textarea.js.map +1 -1
- package/dist/textarea.mjs +15 -13
- package/dist/textarea.mjs.map +1 -1
- package/dist/toggle-group.d.mts +4 -2
- package/dist/toggle-group.d.ts +4 -2
- package/dist/toggle-group.js +2 -2
- package/dist/toggle-group.js.map +1 -1
- package/dist/toggle-group.mjs +1 -1
- package/dist/toggle-group.mjs.map +1 -1
- package/dist/toggle.d.mts +2 -1
- package/dist/toggle.d.ts +2 -1
- package/dist/toggle.js +2 -2
- package/dist/toggle.mjs +1 -1
- package/dist/tooltip.d.mts +6 -1
- package/dist/tooltip.d.ts +6 -1
- package/dist/tooltip.js.map +1 -1
- package/dist/tooltip.mjs.map +1 -1
- package/package.json +6 -6
- package/src/accordion.tsx +17 -4
- package/src/alert-dialog.tsx +26 -7
- package/src/alert.tsx +35 -25
- package/src/aspect-ratio.tsx +2 -1
- package/src/avatar.tsx +13 -3
- package/src/badge.tsx +6 -3
- package/src/blockquote.tsx +11 -10
- package/src/box.tsx +1 -1
- package/src/breadcrumb.tsx +70 -60
- package/src/button.tsx +4 -2
- package/src/calendar.tsx +3 -2
- package/src/card.tsx +59 -52
- package/src/carousel.tsx +76 -72
- package/src/checkbox.tsx +3 -2
- package/src/code.tsx +10 -8
- package/src/collapsible.tsx +11 -1
- package/src/command.tsx +47 -10
- package/src/container.tsx +10 -10
- package/src/context-menu.tsx +52 -16
- package/src/data-table.tsx +23 -11
- package/src/dialog.tsx +21 -5
- package/src/drawer.tsx +28 -6
- package/src/dropdown-menu.tsx +51 -15
- package/src/em.tsx +10 -8
- package/src/form.tsx +55 -38
- package/src/heading.tsx +11 -11
- package/src/hover-card.tsx +12 -2
- package/src/input-otp.tsx +45 -33
- package/src/input.tsx +17 -15
- package/src/kbd.tsx +19 -17
- package/src/label.tsx +3 -2
- package/src/menubar.tsx +48 -17
- package/src/navigation-menu.tsx +25 -5
- package/src/pagination.tsx +21 -9
- package/src/popover.tsx +18 -2
- package/src/pre.tsx +10 -8
- package/src/progress.tsx +4 -3
- package/src/quote.tsx +10 -8
- package/src/radio-group.tsx +10 -3
- package/src/resizable.tsx +2 -1
- package/src/scroll-area.tsx +18 -11
- package/src/section.tsx +10 -10
- package/src/select.tsx +27 -7
- package/src/separator.tsx +3 -2
- package/src/sheet.tsx +23 -5
- package/src/skeleton.tsx +3 -5
- package/src/slider.tsx +3 -2
- package/src/sonner.tsx +1 -1
- package/src/strong.tsx +10 -8
- package/src/switch.tsx +3 -2
- package/src/table.tsx +90 -78
- package/src/tabs.tsx +17 -4
- package/src/text.tsx +1 -1
- package/src/textarea.tsx +16 -16
- package/src/toggle-group.tsx +14 -4
- package/src/toggle.tsx +3 -2
- package/src/tooltip.tsx +12 -2
- package/dist/chunk-2D7SRYKN.js.map +0 -1
- package/dist/chunk-EDVCMWDT.mjs.map +0 -1
- package/dist/chunk-EIHWTXQ4.mjs.map +0 -1
- package/dist/chunk-ESWGFN3R.mjs.map +0 -1
- package/dist/chunk-KW5FJ62U.mjs.map +0 -1
- package/dist/chunk-LDYBRDAY.js.map +0 -1
- package/dist/chunk-OCLLX7EY.js.map +0 -1
- package/dist/chunk-PTD4AMHI.mjs.map +0 -1
- package/dist/chunk-RTKEO347.js.map +0 -1
package/src/collapsible.tsx
CHANGED
|
@@ -6,22 +6,32 @@ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
|
6
6
|
* Component: Collapsible
|
|
7
7
|
* -------------------------------------------------------------------------- */
|
|
8
8
|
|
|
9
|
+
type CollapsibleProps = CollapsiblePrimitive.CollapsibleProps;
|
|
9
10
|
const Collapsible = CollapsiblePrimitive.Root;
|
|
10
11
|
|
|
11
12
|
/* -----------------------------------------------------------------------------
|
|
12
13
|
* Component: CollapsibleTrigger
|
|
13
14
|
* -------------------------------------------------------------------------- */
|
|
14
15
|
|
|
16
|
+
type CollapsibleTriggerProps = CollapsiblePrimitive.CollapsibleTriggerProps;
|
|
15
17
|
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
16
18
|
|
|
17
19
|
/* -----------------------------------------------------------------------------
|
|
18
20
|
* Component: CollapsibleContent
|
|
19
21
|
* -------------------------------------------------------------------------- */
|
|
20
22
|
|
|
23
|
+
type CollapsibleContentProps = CollapsiblePrimitive.CollapsibleContentProps;
|
|
21
24
|
const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;
|
|
22
25
|
|
|
23
26
|
/* -----------------------------------------------------------------------------
|
|
24
27
|
* Exports
|
|
25
28
|
* -------------------------------------------------------------------------- */
|
|
26
29
|
|
|
27
|
-
export {
|
|
30
|
+
export {
|
|
31
|
+
Collapsible,
|
|
32
|
+
CollapsibleTrigger,
|
|
33
|
+
CollapsibleContent,
|
|
34
|
+
type CollapsibleProps,
|
|
35
|
+
type CollapsibleTriggerProps,
|
|
36
|
+
type CollapsibleContentProps,
|
|
37
|
+
};
|
package/src/command.tsx
CHANGED
|
@@ -11,9 +11,10 @@ import { Dialog, DialogContent } from "./dialog";
|
|
|
11
11
|
* Component: Command
|
|
12
12
|
* -------------------------------------------------------------------------- */
|
|
13
13
|
|
|
14
|
+
type CommandProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive>;
|
|
14
15
|
const Command = React.forwardRef<
|
|
15
16
|
React.ElementRef<typeof CommandPrimitive>,
|
|
16
|
-
|
|
17
|
+
CommandProps
|
|
17
18
|
>(({ className, ...props }, ref) => (
|
|
18
19
|
<CommandPrimitive
|
|
19
20
|
ref={ref}
|
|
@@ -30,7 +31,11 @@ Command.displayName = CommandPrimitive.displayName;
|
|
|
30
31
|
* Component: CommandDialog
|
|
31
32
|
* -------------------------------------------------------------------------- */
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
type CommandDialogProps = DialogProps;
|
|
35
|
+
function CommandDialog({
|
|
36
|
+
children,
|
|
37
|
+
...props
|
|
38
|
+
}: CommandDialogProps): React.JSX.Element {
|
|
34
39
|
return (
|
|
35
40
|
<Dialog {...props}>
|
|
36
41
|
<DialogContent className="overflow-hidden p-0">
|
|
@@ -46,9 +51,12 @@ function CommandDialog({ children, ...props }: DialogProps): React.JSX.Element {
|
|
|
46
51
|
* Component: CommandInput
|
|
47
52
|
* -------------------------------------------------------------------------- */
|
|
48
53
|
|
|
54
|
+
type CommandInputProps = React.ComponentPropsWithoutRef<
|
|
55
|
+
typeof CommandPrimitive.Input
|
|
56
|
+
>;
|
|
49
57
|
const CommandInput = React.forwardRef<
|
|
50
58
|
React.ElementRef<typeof CommandPrimitive.Input>,
|
|
51
|
-
|
|
59
|
+
CommandInputProps
|
|
52
60
|
>(({ className, ...props }, ref) => (
|
|
53
61
|
<div className="flex items-center gap-2 border-b px-3" cmdk-input-wrapper="">
|
|
54
62
|
<MagnifyingGlassIcon className="size-4 shrink-0 opacity-50" />
|
|
@@ -68,9 +76,12 @@ CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
|
68
76
|
* Component: CommandList
|
|
69
77
|
* -------------------------------------------------------------------------- */
|
|
70
78
|
|
|
79
|
+
type CommandListProps = React.ComponentPropsWithoutRef<
|
|
80
|
+
typeof CommandPrimitive.List
|
|
81
|
+
>;
|
|
71
82
|
const CommandList = React.forwardRef<
|
|
72
83
|
React.ElementRef<typeof CommandPrimitive.List>,
|
|
73
|
-
|
|
84
|
+
CommandListProps
|
|
74
85
|
>(({ className, ...props }, ref) => (
|
|
75
86
|
<CommandPrimitive.List
|
|
76
87
|
ref={ref}
|
|
@@ -84,9 +95,12 @@ CommandList.displayName = CommandPrimitive.List.displayName;
|
|
|
84
95
|
* Component: CommandEmpty
|
|
85
96
|
* -------------------------------------------------------------------------- */
|
|
86
97
|
|
|
98
|
+
type CommandEmptyProps = React.ComponentPropsWithoutRef<
|
|
99
|
+
typeof CommandPrimitive.Empty
|
|
100
|
+
>;
|
|
87
101
|
const CommandEmpty = React.forwardRef<
|
|
88
102
|
React.ElementRef<typeof CommandPrimitive.Empty>,
|
|
89
|
-
|
|
103
|
+
CommandEmptyProps
|
|
90
104
|
>((props, ref) => (
|
|
91
105
|
<CommandPrimitive.Empty
|
|
92
106
|
ref={ref}
|
|
@@ -100,9 +114,12 @@ CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
|
100
114
|
* Component: CommandGroup
|
|
101
115
|
* -------------------------------------------------------------------------- */
|
|
102
116
|
|
|
117
|
+
type CommandGroupProps = React.ComponentPropsWithoutRef<
|
|
118
|
+
typeof CommandPrimitive.Group
|
|
119
|
+
>;
|
|
103
120
|
const CommandGroup = React.forwardRef<
|
|
104
121
|
React.ElementRef<typeof CommandPrimitive.Group>,
|
|
105
|
-
|
|
122
|
+
CommandGroupProps
|
|
106
123
|
>(({ className, ...props }, ref) => (
|
|
107
124
|
<CommandPrimitive.Group
|
|
108
125
|
ref={ref}
|
|
@@ -119,9 +136,12 @@ CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
|
119
136
|
* Component: CommandSeparator
|
|
120
137
|
* -------------------------------------------------------------------------- */
|
|
121
138
|
|
|
139
|
+
type CommandSeparatorProps = React.ComponentPropsWithoutRef<
|
|
140
|
+
typeof CommandPrimitive.Separator
|
|
141
|
+
>;
|
|
122
142
|
const CommandSeparator = React.forwardRef<
|
|
123
143
|
React.ElementRef<typeof CommandPrimitive.Separator>,
|
|
124
|
-
|
|
144
|
+
CommandSeparatorProps
|
|
125
145
|
>(({ className, ...props }, ref) => (
|
|
126
146
|
<CommandPrimitive.Separator
|
|
127
147
|
ref={ref}
|
|
@@ -135,9 +155,12 @@ CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
|
135
155
|
* Component: CommandItem
|
|
136
156
|
* -------------------------------------------------------------------------- */
|
|
137
157
|
|
|
158
|
+
type CommandItemProps = React.ComponentPropsWithoutRef<
|
|
159
|
+
typeof CommandPrimitive.Item
|
|
160
|
+
>;
|
|
138
161
|
const CommandItem = React.forwardRef<
|
|
139
162
|
React.ElementRef<typeof CommandPrimitive.Item>,
|
|
140
|
-
|
|
163
|
+
CommandItemProps
|
|
141
164
|
>(({ className, ...props }, ref) => (
|
|
142
165
|
<CommandPrimitive.Item
|
|
143
166
|
ref={ref}
|
|
@@ -154,9 +177,12 @@ CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
|
154
177
|
* Component: CommandLoading
|
|
155
178
|
* -------------------------------------------------------------------------- */
|
|
156
179
|
|
|
180
|
+
type CommandLoadingProps = React.ComponentPropsWithoutRef<
|
|
181
|
+
typeof CommandPrimitive.Loading
|
|
182
|
+
>;
|
|
157
183
|
const CommandLoading = React.forwardRef<
|
|
158
184
|
React.ElementRef<typeof CommandPrimitive.Loading>,
|
|
159
|
-
|
|
185
|
+
CommandLoadingProps
|
|
160
186
|
>(({ className, ...props }, ref) => (
|
|
161
187
|
<CommandPrimitive.Loading
|
|
162
188
|
ref={ref}
|
|
@@ -170,10 +196,11 @@ CommandLoading.displayName = CommandPrimitive.Loading.displayName;
|
|
|
170
196
|
* Component: CommandShortcut
|
|
171
197
|
* -------------------------------------------------------------------------- */
|
|
172
198
|
|
|
199
|
+
type CommandShortcutProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
173
200
|
function CommandShortcut({
|
|
174
201
|
className,
|
|
175
202
|
...props
|
|
176
|
-
}:
|
|
203
|
+
}: CommandShortcutProps): React.JSX.Element {
|
|
177
204
|
return (
|
|
178
205
|
<span
|
|
179
206
|
className={cn(
|
|
@@ -200,4 +227,14 @@ export {
|
|
|
200
227
|
CommandLoading,
|
|
201
228
|
CommandShortcut,
|
|
202
229
|
CommandSeparator,
|
|
230
|
+
type CommandProps,
|
|
231
|
+
type CommandDialogProps,
|
|
232
|
+
type CommandInputProps,
|
|
233
|
+
type CommandListProps,
|
|
234
|
+
type CommandEmptyProps,
|
|
235
|
+
type CommandGroupProps,
|
|
236
|
+
type CommandItemProps,
|
|
237
|
+
type CommandLoadingProps,
|
|
238
|
+
type CommandShortcutProps,
|
|
239
|
+
type CommandSeparatorProps,
|
|
203
240
|
};
|
package/src/container.tsx
CHANGED
|
@@ -6,20 +6,20 @@ import { cn } from "./utils";
|
|
|
6
6
|
* Component: Container
|
|
7
7
|
* -------------------------------------------------------------------------- */
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const Comp = asChild ? Slot : "div";
|
|
9
|
+
interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
}
|
|
12
|
+
const Container = React.forwardRef<HTMLDivElement, ContainerProps>(
|
|
13
|
+
({ className, asChild, ...props }, ref) => {
|
|
14
|
+
const Comp = asChild ? Slot : "div";
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
}
|
|
16
|
+
return <Comp ref={ref} className={cn("container", className)} {...props} />;
|
|
17
|
+
},
|
|
18
|
+
);
|
|
19
19
|
Container.displayName = "Container";
|
|
20
20
|
|
|
21
21
|
/* -----------------------------------------------------------------------------
|
|
22
22
|
* Exports
|
|
23
23
|
* -------------------------------------------------------------------------- */
|
|
24
24
|
|
|
25
|
-
export { Container };
|
|
25
|
+
export { Container, type ContainerProps };
|
package/src/context-menu.tsx
CHANGED
|
@@ -13,41 +13,49 @@ import { cn } from "./utils";
|
|
|
13
13
|
* Component: ContextMenu
|
|
14
14
|
* -------------------------------------------------------------------------- */
|
|
15
15
|
|
|
16
|
+
type ContextMenuProps = ContextMenuPrimitive.ContextMenuProps;
|
|
16
17
|
const ContextMenu = ContextMenuPrimitive.Root;
|
|
17
18
|
|
|
18
19
|
/* -----------------------------------------------------------------------------
|
|
19
20
|
* Component: ContextMenuTrigger
|
|
20
21
|
* -------------------------------------------------------------------------- */
|
|
21
22
|
|
|
23
|
+
type ContextMenuTriggerProps = ContextMenuPrimitive.ContextMenuTriggerProps;
|
|
22
24
|
const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
23
25
|
|
|
24
26
|
/* -----------------------------------------------------------------------------
|
|
25
27
|
* Component: ContextMenuGroup
|
|
26
28
|
* -------------------------------------------------------------------------- */
|
|
27
29
|
|
|
30
|
+
type ContextMenuGroupProps = ContextMenuPrimitive.ContextMenuGroupProps;
|
|
28
31
|
const ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
29
32
|
|
|
30
33
|
/* -----------------------------------------------------------------------------
|
|
31
34
|
* Component: ContextMenuSub
|
|
32
35
|
* -------------------------------------------------------------------------- */
|
|
33
36
|
|
|
37
|
+
type ContextMenuSubProps = ContextMenuPrimitive.ContextMenuSubProps;
|
|
34
38
|
const ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
35
39
|
|
|
36
40
|
/* -----------------------------------------------------------------------------
|
|
37
41
|
* Component: ContextMenuRadioGroup
|
|
38
42
|
* -------------------------------------------------------------------------- */
|
|
39
43
|
|
|
44
|
+
type ContextMenuRadioGroupProps =
|
|
45
|
+
ContextMenuPrimitive.ContextMenuRadioGroupProps;
|
|
40
46
|
const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
41
47
|
|
|
42
48
|
/* -----------------------------------------------------------------------------
|
|
43
49
|
* Component: ContextMenuSubTrigger
|
|
44
50
|
* -------------------------------------------------------------------------- */
|
|
45
51
|
|
|
52
|
+
interface ContextMenuSubTriggerProps
|
|
53
|
+
extends ContextMenuPrimitive.ContextMenuSubTriggerProps {
|
|
54
|
+
inset?: boolean;
|
|
55
|
+
}
|
|
46
56
|
const ContextMenuSubTrigger = React.forwardRef<
|
|
47
57
|
React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
|
|
48
|
-
|
|
49
|
-
inset?: boolean;
|
|
50
|
-
}
|
|
58
|
+
ContextMenuSubTriggerProps
|
|
51
59
|
>(({ className, inset, children, ...props }, ref) => (
|
|
52
60
|
<ContextMenuPrimitive.SubTrigger
|
|
53
61
|
ref={ref}
|
|
@@ -68,9 +76,11 @@ ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
|
68
76
|
* Component: ContextMenuSubContent
|
|
69
77
|
* -------------------------------------------------------------------------- */
|
|
70
78
|
|
|
79
|
+
type ContextMenuSubContentProps =
|
|
80
|
+
ContextMenuPrimitive.ContextMenuSubContentProps;
|
|
71
81
|
const ContextMenuSubContent = React.forwardRef<
|
|
72
82
|
React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
|
|
73
|
-
|
|
83
|
+
ContextMenuSubContentProps
|
|
74
84
|
>(({ className, ...props }, ref) => (
|
|
75
85
|
<ContextMenuPrimitive.Portal>
|
|
76
86
|
<ContextMenuPrimitive.SubContent
|
|
@@ -89,9 +99,10 @@ ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
|
89
99
|
* Component: ContextMenuContent
|
|
90
100
|
* -------------------------------------------------------------------------- */
|
|
91
101
|
|
|
102
|
+
type ContextMenuContentProps = ContextMenuPrimitive.ContextMenuContentProps;
|
|
92
103
|
const ContextMenuContent = React.forwardRef<
|
|
93
104
|
React.ElementRef<typeof ContextMenuPrimitive.Content>,
|
|
94
|
-
|
|
105
|
+
ContextMenuContentProps
|
|
95
106
|
>(({ className, ...props }, ref) => (
|
|
96
107
|
<ContextMenuPrimitive.Portal>
|
|
97
108
|
<ContextMenuPrimitive.Content
|
|
@@ -110,11 +121,13 @@ ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
|
110
121
|
* Component: ContextMenuItem
|
|
111
122
|
* -------------------------------------------------------------------------- */
|
|
112
123
|
|
|
124
|
+
interface ContextMenuItemProps
|
|
125
|
+
extends ContextMenuPrimitive.ContextMenuItemProps {
|
|
126
|
+
inset?: boolean;
|
|
127
|
+
}
|
|
113
128
|
const ContextMenuItem = React.forwardRef<
|
|
114
129
|
React.ElementRef<typeof ContextMenuPrimitive.Item>,
|
|
115
|
-
|
|
116
|
-
inset?: boolean;
|
|
117
|
-
}
|
|
130
|
+
ContextMenuItemProps
|
|
118
131
|
>(({ className, inset, ...props }, ref) => (
|
|
119
132
|
<ContextMenuPrimitive.Item
|
|
120
133
|
ref={ref}
|
|
@@ -132,9 +145,11 @@ ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
|
132
145
|
* Component: ContextMenuCheckboxItem
|
|
133
146
|
* -------------------------------------------------------------------------- */
|
|
134
147
|
|
|
148
|
+
type ContextMenuCheckboxItemProps =
|
|
149
|
+
ContextMenuPrimitive.ContextMenuCheckboxItemProps;
|
|
135
150
|
const ContextMenuCheckboxItem = React.forwardRef<
|
|
136
151
|
React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,
|
|
137
|
-
|
|
152
|
+
ContextMenuCheckboxItemProps
|
|
138
153
|
>(({ className, children, checked, ...props }, ref) => (
|
|
139
154
|
<ContextMenuPrimitive.CheckboxItem
|
|
140
155
|
ref={ref}
|
|
@@ -160,9 +175,10 @@ ContextMenuCheckboxItem.displayName =
|
|
|
160
175
|
* Component: ContextMenuRadioItem
|
|
161
176
|
* -------------------------------------------------------------------------- */
|
|
162
177
|
|
|
178
|
+
type ContextMenuRadioItemProps = ContextMenuPrimitive.ContextMenuRadioItemProps;
|
|
163
179
|
const ContextMenuRadioItem = React.forwardRef<
|
|
164
180
|
React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
|
|
165
|
-
|
|
181
|
+
ContextMenuRadioItemProps
|
|
166
182
|
>(({ className, children, ...props }, ref) => (
|
|
167
183
|
<ContextMenuPrimitive.RadioItem
|
|
168
184
|
ref={ref}
|
|
@@ -186,11 +202,13 @@ ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
|
186
202
|
* Component: ContextMenuLabel
|
|
187
203
|
* -------------------------------------------------------------------------- */
|
|
188
204
|
|
|
205
|
+
interface ContextMenuLabelProps
|
|
206
|
+
extends ContextMenuPrimitive.ContextMenuLabelProps {
|
|
207
|
+
inset?: boolean;
|
|
208
|
+
}
|
|
189
209
|
const ContextMenuLabel = React.forwardRef<
|
|
190
210
|
React.ElementRef<typeof ContextMenuPrimitive.Label>,
|
|
191
|
-
|
|
192
|
-
inset?: boolean;
|
|
193
|
-
}
|
|
211
|
+
ContextMenuLabelProps
|
|
194
212
|
>(({ className, inset, ...props }, ref) => (
|
|
195
213
|
<ContextMenuPrimitive.Label
|
|
196
214
|
ref={ref}
|
|
@@ -208,9 +226,10 @@ ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
|
208
226
|
* Component: ContextMenuSeparator
|
|
209
227
|
* -------------------------------------------------------------------------- */
|
|
210
228
|
|
|
229
|
+
type ContextMenuSeparatorProps = ContextMenuPrimitive.ContextMenuSeparatorProps;
|
|
211
230
|
const ContextMenuSeparator = React.forwardRef<
|
|
212
231
|
React.ElementRef<typeof ContextMenuPrimitive.Separator>,
|
|
213
|
-
|
|
232
|
+
ContextMenuSeparatorProps
|
|
214
233
|
>(({ className, ...props }, ref) => (
|
|
215
234
|
<ContextMenuPrimitive.Separator
|
|
216
235
|
ref={ref}
|
|
@@ -224,10 +243,11 @@ ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
|
224
243
|
* Component: ContextMenuShortcut
|
|
225
244
|
* -------------------------------------------------------------------------- */
|
|
226
245
|
|
|
246
|
+
type ContextMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
227
247
|
function ContextMenuShortcut({
|
|
228
248
|
className,
|
|
229
249
|
...props
|
|
230
|
-
}:
|
|
250
|
+
}: ContextMenuShortcutProps): React.JSX.Element {
|
|
231
251
|
return (
|
|
232
252
|
<span
|
|
233
253
|
className={cn(
|
|
@@ -243,9 +263,10 @@ function ContextMenuShortcut({
|
|
|
243
263
|
* Component: ContextMenuArrow
|
|
244
264
|
* -------------------------------------------------------------------------- */
|
|
245
265
|
|
|
266
|
+
type ContextMenuArrowProps = ContextMenuPrimitive.ContextMenuArrowProps;
|
|
246
267
|
const ContextMenuArrow = React.forwardRef<
|
|
247
268
|
React.ElementRef<typeof ContextMenuPrimitive.Arrow>,
|
|
248
|
-
|
|
269
|
+
ContextMenuArrowProps
|
|
249
270
|
>(({ className, ...props }, ref) => (
|
|
250
271
|
<ContextMenuPrimitive.Arrow
|
|
251
272
|
ref={ref}
|
|
@@ -275,4 +296,19 @@ export {
|
|
|
275
296
|
ContextMenuSubTrigger,
|
|
276
297
|
ContextMenuRadioGroup,
|
|
277
298
|
ContextMenuArrow,
|
|
299
|
+
type ContextMenuProps,
|
|
300
|
+
type ContextMenuTriggerProps,
|
|
301
|
+
type ContextMenuContentProps,
|
|
302
|
+
type ContextMenuItemProps,
|
|
303
|
+
type ContextMenuCheckboxItemProps,
|
|
304
|
+
type ContextMenuRadioItemProps,
|
|
305
|
+
type ContextMenuLabelProps,
|
|
306
|
+
type ContextMenuSeparatorProps,
|
|
307
|
+
type ContextMenuShortcutProps,
|
|
308
|
+
type ContextMenuGroupProps,
|
|
309
|
+
type ContextMenuSubProps,
|
|
310
|
+
type ContextMenuSubContentProps,
|
|
311
|
+
type ContextMenuSubTriggerProps,
|
|
312
|
+
type ContextMenuRadioGroupProps,
|
|
313
|
+
type ContextMenuArrowProps,
|
|
278
314
|
};
|
package/src/data-table.tsx
CHANGED
|
@@ -36,11 +36,12 @@ import { cn } from "./utils";
|
|
|
36
36
|
* Component: DataTableViewOptions
|
|
37
37
|
* -------------------------------------------------------------------------- */
|
|
38
38
|
|
|
39
|
+
interface DataTableViewOptionsProps<TData> {
|
|
40
|
+
table: ReactTable.Table<TData>;
|
|
41
|
+
}
|
|
39
42
|
function DataTableViewOptions<TData>({
|
|
40
43
|
table,
|
|
41
|
-
}: {
|
|
42
|
-
table: ReactTable.Table<TData>;
|
|
43
|
-
}): React.JSX.Element {
|
|
44
|
+
}: DataTableViewOptionsProps<TData>): React.JSX.Element {
|
|
44
45
|
return (
|
|
45
46
|
<DropdownMenu>
|
|
46
47
|
<DropdownMenuTrigger asChild>
|
|
@@ -85,13 +86,15 @@ function DataTableViewOptions<TData>({
|
|
|
85
86
|
* Component: DataTablePagination
|
|
86
87
|
* -------------------------------------------------------------------------- */
|
|
87
88
|
|
|
89
|
+
interface DataTablePaginationProps<TData>
|
|
90
|
+
extends React.HTMLAttributes<HTMLDivElement> {
|
|
91
|
+
table: ReactTable.Table<TData>;
|
|
92
|
+
}
|
|
88
93
|
function DataTablePagination<TData>({
|
|
89
94
|
table,
|
|
90
95
|
className,
|
|
91
96
|
...props
|
|
92
|
-
}:
|
|
93
|
-
table: ReactTable.Table<TData>;
|
|
94
|
-
}): React.JSX.Element {
|
|
97
|
+
}: DataTablePaginationProps<TData>): React.JSX.Element {
|
|
95
98
|
return (
|
|
96
99
|
<div
|
|
97
100
|
className={cn("flex items-center justify-between px-2", className)}
|
|
@@ -183,14 +186,16 @@ function DataTablePagination<TData>({
|
|
|
183
186
|
* Component: DataTableColumnHeader
|
|
184
187
|
* -------------------------------------------------------------------------- */
|
|
185
188
|
|
|
189
|
+
interface DataTableColumnHeaderProps<TData, TValue>
|
|
190
|
+
extends React.HTMLAttributes<HTMLDivElement> {
|
|
191
|
+
column: ReactTable.Column<TData, TValue>;
|
|
192
|
+
title: string;
|
|
193
|
+
}
|
|
186
194
|
function DataTableColumnHeader<TData, TValue>({
|
|
187
195
|
column,
|
|
188
196
|
title,
|
|
189
197
|
className,
|
|
190
|
-
}:
|
|
191
|
-
column: ReactTable.Column<TData, TValue>;
|
|
192
|
-
title: string;
|
|
193
|
-
}): React.JSX.Element {
|
|
198
|
+
}: DataTableColumnHeaderProps<TData, TValue>): React.JSX.Element {
|
|
194
199
|
if (!column.getCanSort()) {
|
|
195
200
|
return <div className={cn(className)}>{title}</div>;
|
|
196
201
|
}
|
|
@@ -250,6 +255,13 @@ function DataTableColumnHeader<TData, TValue>({
|
|
|
250
255
|
* Exports
|
|
251
256
|
* -------------------------------------------------------------------------- */
|
|
252
257
|
|
|
253
|
-
export {
|
|
258
|
+
export {
|
|
259
|
+
DataTableViewOptions,
|
|
260
|
+
DataTablePagination,
|
|
261
|
+
DataTableColumnHeader,
|
|
262
|
+
type DataTableViewOptionsProps,
|
|
263
|
+
type DataTablePaginationProps,
|
|
264
|
+
type DataTableColumnHeaderProps,
|
|
265
|
+
};
|
|
254
266
|
|
|
255
267
|
export * from "@tanstack/react-table";
|
package/src/dialog.tsx
CHANGED
|
@@ -9,27 +9,31 @@ import { cn } from "./utils";
|
|
|
9
9
|
* Component: Dialog
|
|
10
10
|
* -------------------------------------------------------------------------- */
|
|
11
11
|
|
|
12
|
+
type DialogProps = DialogPrimitive.DialogProps;
|
|
12
13
|
const Dialog = DialogPrimitive.Root;
|
|
13
14
|
|
|
14
15
|
/* -----------------------------------------------------------------------------
|
|
15
16
|
* Component: DialogTrigger
|
|
16
17
|
* -------------------------------------------------------------------------- */
|
|
17
18
|
|
|
19
|
+
type DialogTriggerProps = DialogPrimitive.DialogTriggerProps;
|
|
18
20
|
const DialogTrigger = DialogPrimitive.Trigger;
|
|
19
21
|
|
|
20
22
|
/* -----------------------------------------------------------------------------
|
|
21
23
|
* Component: DialogClose
|
|
22
24
|
* -------------------------------------------------------------------------- */
|
|
23
25
|
|
|
26
|
+
type DialogCloseProps = DialogPrimitive.DialogCloseProps;
|
|
24
27
|
const DialogClose = DialogPrimitive.Close;
|
|
25
28
|
|
|
26
29
|
/* -----------------------------------------------------------------------------
|
|
27
30
|
* Component: DialogContent
|
|
28
31
|
* -------------------------------------------------------------------------- */
|
|
29
32
|
|
|
33
|
+
type DialogContentProps = DialogPrimitive.DialogContentProps;
|
|
30
34
|
const DialogContent = React.forwardRef<
|
|
31
35
|
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
32
|
-
|
|
36
|
+
DialogContentProps
|
|
33
37
|
>(({ className, children, ...props }, ref) => (
|
|
34
38
|
<DialogPrimitive.Portal>
|
|
35
39
|
<DialogPrimitive.Overlay
|
|
@@ -63,10 +67,11 @@ DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
|
63
67
|
* Component: DialogHeader
|
|
64
68
|
* -------------------------------------------------------------------------- */
|
|
65
69
|
|
|
70
|
+
type DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
66
71
|
function DialogHeader({
|
|
67
72
|
className,
|
|
68
73
|
...props
|
|
69
|
-
}:
|
|
74
|
+
}: DialogHeaderProps): React.JSX.Element {
|
|
70
75
|
return (
|
|
71
76
|
<div
|
|
72
77
|
className={cn(
|
|
@@ -82,10 +87,11 @@ function DialogHeader({
|
|
|
82
87
|
* Component: DialogFooter
|
|
83
88
|
* -------------------------------------------------------------------------- */
|
|
84
89
|
|
|
90
|
+
type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
85
91
|
function DialogFooter({
|
|
86
92
|
className,
|
|
87
93
|
...props
|
|
88
|
-
}:
|
|
94
|
+
}: DialogFooterProps): React.JSX.Element {
|
|
89
95
|
return (
|
|
90
96
|
<div
|
|
91
97
|
className={cn(
|
|
@@ -101,9 +107,10 @@ function DialogFooter({
|
|
|
101
107
|
* Component: DialogTitle
|
|
102
108
|
* -------------------------------------------------------------------------- */
|
|
103
109
|
|
|
110
|
+
type DialogTitleProps = DialogPrimitive.DialogTitleProps;
|
|
104
111
|
const DialogTitle = React.forwardRef<
|
|
105
112
|
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
106
|
-
|
|
113
|
+
DialogTitleProps
|
|
107
114
|
>(({ className, ...props }, ref) => (
|
|
108
115
|
<DialogPrimitive.Title
|
|
109
116
|
ref={ref}
|
|
@@ -120,9 +127,10 @@ DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
|
120
127
|
* Component: DialogDescription
|
|
121
128
|
* -------------------------------------------------------------------------- */
|
|
122
129
|
|
|
130
|
+
type DialogDescriptionProps = DialogPrimitive.DialogDescriptionProps;
|
|
123
131
|
const DialogDescription = React.forwardRef<
|
|
124
132
|
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
125
|
-
|
|
133
|
+
DialogDescriptionProps
|
|
126
134
|
>(({ className, ...props }, ref) => (
|
|
127
135
|
<DialogPrimitive.Description
|
|
128
136
|
ref={ref}
|
|
@@ -145,4 +153,12 @@ export {
|
|
|
145
153
|
DialogFooter,
|
|
146
154
|
DialogTitle,
|
|
147
155
|
DialogDescription,
|
|
156
|
+
type DialogProps,
|
|
157
|
+
type DialogTriggerProps,
|
|
158
|
+
type DialogCloseProps,
|
|
159
|
+
type DialogContentProps,
|
|
160
|
+
type DialogHeaderProps,
|
|
161
|
+
type DialogFooterProps,
|
|
162
|
+
type DialogTitleProps,
|
|
163
|
+
type DialogDescriptionProps,
|
|
148
164
|
};
|
package/src/drawer.tsx
CHANGED
|
@@ -8,10 +8,11 @@ import { cn } from "./utils";
|
|
|
8
8
|
* Component: Drawer
|
|
9
9
|
* -------------------------------------------------------------------------- */
|
|
10
10
|
|
|
11
|
+
type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;
|
|
11
12
|
function Drawer({
|
|
12
13
|
shouldScaleBackground = true,
|
|
13
14
|
...props
|
|
14
|
-
}:
|
|
15
|
+
}: DrawerProps): React.JSX.Element {
|
|
15
16
|
return (
|
|
16
17
|
<DrawerPrimitive.Root
|
|
17
18
|
shouldScaleBackground={shouldScaleBackground}
|
|
@@ -24,21 +25,26 @@ function Drawer({
|
|
|
24
25
|
* Component: DrawerTrigger
|
|
25
26
|
* -------------------------------------------------------------------------- */
|
|
26
27
|
|
|
28
|
+
type DrawerTriggerProps = React.ComponentProps<typeof DrawerPrimitive.Trigger>;
|
|
27
29
|
const DrawerTrigger = DrawerPrimitive.Trigger;
|
|
28
30
|
|
|
29
31
|
/* -----------------------------------------------------------------------------
|
|
30
32
|
* Component: DrawerClose
|
|
31
33
|
* -------------------------------------------------------------------------- */
|
|
32
34
|
|
|
35
|
+
type DrawerCloseProps = React.ComponentProps<typeof DrawerPrimitive.Close>;
|
|
33
36
|
const DrawerClose = DrawerPrimitive.Close;
|
|
34
37
|
|
|
35
38
|
/* -----------------------------------------------------------------------------
|
|
36
39
|
* Component: DrawerContent
|
|
37
40
|
* -------------------------------------------------------------------------- */
|
|
38
41
|
|
|
42
|
+
type DrawerContentProps = React.ComponentPropsWithoutRef<
|
|
43
|
+
typeof DrawerPrimitive.Content
|
|
44
|
+
>;
|
|
39
45
|
const DrawerContent = React.forwardRef<
|
|
40
46
|
React.ElementRef<typeof DrawerPrimitive.Content>,
|
|
41
|
-
|
|
47
|
+
DrawerContentProps
|
|
42
48
|
>(({ className, children, ...props }, ref) => (
|
|
43
49
|
<DrawerPrimitive.Portal>
|
|
44
50
|
<DrawerPrimitive.Overlay className="fixed inset-0 z-50 bg-black/80" />
|
|
@@ -61,10 +67,11 @@ DrawerContent.displayName = "DrawerContent";
|
|
|
61
67
|
* Component: DrawerHeader
|
|
62
68
|
* -------------------------------------------------------------------------- */
|
|
63
69
|
|
|
70
|
+
type DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
64
71
|
function DrawerHeader({
|
|
65
72
|
className,
|
|
66
73
|
...props
|
|
67
|
-
}:
|
|
74
|
+
}: DrawerHeaderProps): React.JSX.Element {
|
|
68
75
|
return (
|
|
69
76
|
<div
|
|
70
77
|
className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)}
|
|
@@ -77,10 +84,11 @@ function DrawerHeader({
|
|
|
77
84
|
* Component: DrawerFooter
|
|
78
85
|
* -------------------------------------------------------------------------- */
|
|
79
86
|
|
|
87
|
+
type DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
80
88
|
function DrawerFooter({
|
|
81
89
|
className,
|
|
82
90
|
...props
|
|
83
|
-
}:
|
|
91
|
+
}: DrawerFooterProps): React.JSX.Element {
|
|
84
92
|
return (
|
|
85
93
|
<div
|
|
86
94
|
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
@@ -93,9 +101,12 @@ function DrawerFooter({
|
|
|
93
101
|
* Component: DrawerTitle
|
|
94
102
|
* -------------------------------------------------------------------------- */
|
|
95
103
|
|
|
104
|
+
type DrawerTitleProps = React.ComponentPropsWithoutRef<
|
|
105
|
+
typeof DrawerPrimitive.Title
|
|
106
|
+
>;
|
|
96
107
|
const DrawerTitle = React.forwardRef<
|
|
97
108
|
React.ElementRef<typeof DrawerPrimitive.Title>,
|
|
98
|
-
|
|
109
|
+
DrawerTitleProps
|
|
99
110
|
>(({ className, ...props }, ref) => (
|
|
100
111
|
<DrawerPrimitive.Title
|
|
101
112
|
ref={ref}
|
|
@@ -112,9 +123,12 @@ DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
|
|
|
112
123
|
* Component: DrawerDescription
|
|
113
124
|
* -------------------------------------------------------------------------- */
|
|
114
125
|
|
|
126
|
+
type DrawerDescriptionProps = React.ComponentPropsWithoutRef<
|
|
127
|
+
typeof DrawerPrimitive.Description
|
|
128
|
+
>;
|
|
115
129
|
const DrawerDescription = React.forwardRef<
|
|
116
130
|
React.ElementRef<typeof DrawerPrimitive.Description>,
|
|
117
|
-
|
|
131
|
+
DrawerDescriptionProps
|
|
118
132
|
>(({ className, ...props }, ref) => (
|
|
119
133
|
<DrawerPrimitive.Description
|
|
120
134
|
ref={ref}
|
|
@@ -137,4 +151,12 @@ export {
|
|
|
137
151
|
DrawerFooter,
|
|
138
152
|
DrawerTitle,
|
|
139
153
|
DrawerDescription,
|
|
154
|
+
type DrawerProps,
|
|
155
|
+
type DrawerTriggerProps,
|
|
156
|
+
type DrawerCloseProps,
|
|
157
|
+
type DrawerContentProps,
|
|
158
|
+
type DrawerHeaderProps,
|
|
159
|
+
type DrawerFooterProps,
|
|
160
|
+
type DrawerTitleProps,
|
|
161
|
+
type DrawerDescriptionProps,
|
|
140
162
|
};
|