@codefast/ui 0.0.7 → 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 +4 -4
- package/dist/badge.js.map +1 -1
- package/dist/badge.mjs +4 -4
- package/dist/badge.mjs.map +1 -1
- package/dist/blockquote.d.mts +8 -0
- package/dist/blockquote.d.ts +8 -0
- package/dist/blockquote.js +15 -0
- package/dist/blockquote.js.map +1 -0
- package/dist/blockquote.mjs +15 -0
- package/dist/blockquote.mjs.map +1 -0
- package/dist/box.d.mts +14 -0
- package/dist/box.d.ts +14 -0
- package/dist/box.js +15 -0
- package/dist/box.js.map +1 -0
- package/dist/box.mjs +15 -0
- package/dist/box.mjs.map +1 -0
- 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 +4 -3
- package/dist/button.d.ts +4 -3
- 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 +8 -0
- package/dist/code.d.ts +8 -0
- package/dist/code.js +15 -0
- package/dist/code.js.map +1 -0
- package/dist/code.mjs +15 -0
- package/dist/code.mjs.map +1 -0
- 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 +29 -18
- package/dist/command.d.ts +29 -18
- 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 +8 -0
- package/dist/container.d.ts +8 -0
- package/dist/container.js +19 -0
- package/dist/container.js.map +1 -0
- package/dist/container.mjs +19 -0
- package/dist/container.mjs.map +1 -0
- 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 +8 -0
- package/dist/em.d.ts +8 -0
- package/dist/em.js +15 -0
- package/dist/em.js.map +1 -0
- package/dist/em.mjs +15 -0
- package/dist/em.mjs.map +1 -0
- 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 +9 -0
- package/dist/heading.d.ts +9 -0
- package/dist/heading.js +15 -0
- package/dist/heading.js.map +1 -0
- package/dist/heading.mjs +15 -0
- package/dist/heading.mjs.map +1 -0
- 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 +8 -0
- package/dist/kbd.d.ts +8 -0
- package/dist/kbd.js +29 -0
- package/dist/kbd.js.map +1 -0
- package/dist/kbd.mjs +29 -0
- package/dist/kbd.mjs.map +1 -0
- 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 +8 -0
- package/dist/pre.d.ts +8 -0
- package/dist/pre.js +15 -0
- package/dist/pre.js.map +1 -0
- package/dist/pre.mjs +15 -0
- package/dist/pre.mjs.map +1 -0
- 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 +8 -0
- package/dist/quote.d.ts +8 -0
- package/dist/quote.js +15 -0
- package/dist/quote.js.map +1 -0
- package/dist/quote.mjs +15 -0
- package/dist/quote.mjs.map +1 -0
- 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 +8 -0
- package/dist/section.d.ts +8 -0
- package/dist/section.js +15 -0
- package/dist/section.js.map +1 -0
- package/dist/section.mjs +15 -0
- package/dist/section.mjs.map +1 -0
- 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 +8 -0
- package/dist/strong.d.ts +8 -0
- package/dist/strong.js +15 -0
- package/dist/strong.js.map +1 -0
- package/dist/strong.mjs +15 -0
- package/dist/strong.mjs.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/styles.css.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 +14 -0
- package/dist/text.d.ts +14 -0
- package/dist/text.js +15 -0
- package/dist/text.js.map +1 -0
- package/dist/text.mjs +15 -0
- package/dist/text.mjs.map +1 -0
- 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 +67 -7
- 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 +10 -9
- package/src/blockquote.tsx +25 -0
- package/src/box.tsx +33 -0
- 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 +24 -0
- package/src/collapsible.tsx +11 -1
- package/src/command.tsx +47 -10
- package/src/container.tsx +25 -0
- 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 +24 -0
- package/src/form.tsx +55 -38
- package/src/heading.tsx +25 -0
- package/src/hover-card.tsx +12 -2
- package/src/input-otp.tsx +45 -33
- package/src/input.tsx +17 -15
- package/src/kbd.tsx +34 -0
- 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 +24 -0
- package/src/progress.tsx +4 -3
- package/src/quote.tsx +24 -0
- package/src/radio-group.tsx +10 -3
- package/src/resizable.tsx +2 -1
- package/src/scroll-area.tsx +18 -11
- package/src/section.tsx +24 -0
- 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 +24 -0
- package/src/switch.tsx +3 -2
- package/src/table.tsx +90 -78
- package/src/tabs.tsx +17 -4
- package/src/text.tsx +34 -0
- 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/dist/data-table.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk43YGVOCOjs = require('./chunk-43YGVOCO.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -14,10 +14,10 @@ var _chunk2D7SRYKNjs = require('./chunk-2D7SRYKN.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunk3BDLWZ3Wjs = require('./chunk-3BDLWZ3W.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkJOJW7BBYjs = require('./chunk-JOJW7BBY.js');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
var _chunkG3NP7M2Njs = require('./chunk-G3NP7M2N.js');
|
|
@@ -39,9 +39,9 @@ var _jsxruntime = require('react/jsx-runtime');
|
|
|
39
39
|
function DataTableViewOptions({
|
|
40
40
|
table
|
|
41
41
|
}) {
|
|
42
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
43
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
44
|
-
|
|
42
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3BDLWZ3Wjs.DropdownMenu, { children: [
|
|
43
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3BDLWZ3Wjs.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
44
|
+
_chunkJOJW7BBYjs.Button,
|
|
45
45
|
{
|
|
46
46
|
variant: "outline",
|
|
47
47
|
size: "sm",
|
|
@@ -52,14 +52,14 @@ function DataTableViewOptions({
|
|
|
52
52
|
]
|
|
53
53
|
}
|
|
54
54
|
) }),
|
|
55
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
56
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
57
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
55
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3BDLWZ3Wjs.DropdownMenuContent, { align: "end", className: "w-[150px]", children: [
|
|
56
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3BDLWZ3Wjs.DropdownMenuLabel, { children: "Toggle columns" }),
|
|
57
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3BDLWZ3Wjs.DropdownMenuSeparator, {}),
|
|
58
58
|
table.getAllColumns().filter(
|
|
59
59
|
(column) => typeof column.accessorFn !== "undefined" && column.getCanHide()
|
|
60
60
|
).map((column) => {
|
|
61
61
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
62
|
-
|
|
62
|
+
_chunk3BDLWZ3Wjs.DropdownMenuCheckboxItem,
|
|
63
63
|
{
|
|
64
64
|
className: "capitalize",
|
|
65
65
|
checked: column.getIsVisible(),
|
|
@@ -96,15 +96,15 @@ function DataTablePagination({
|
|
|
96
96
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center space-x-2", children: [
|
|
97
97
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm font-medium", children: "Rows per page" }),
|
|
98
98
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
99
|
-
|
|
99
|
+
_chunk43YGVOCOjs.Select,
|
|
100
100
|
{
|
|
101
101
|
value: `${table.getState().pagination.pageSize}`,
|
|
102
102
|
onValueChange: (value) => {
|
|
103
103
|
table.setPageSize(Number(value));
|
|
104
104
|
},
|
|
105
105
|
children: [
|
|
106
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
107
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
106
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk43YGVOCOjs.SelectTrigger, { className: "h-8 w-[70px]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk43YGVOCOjs.SelectValue, { placeholder: table.getState().pagination.pageSize }) }),
|
|
107
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk43YGVOCOjs.SelectContent, { side: "top", children: [10, 20, 30, 40, 50].map((pageSize) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk43YGVOCOjs.SelectItem, { value: `${pageSize}`, children: pageSize }, pageSize)) })
|
|
108
108
|
]
|
|
109
109
|
}
|
|
110
110
|
)
|
|
@@ -118,7 +118,7 @@ function DataTablePagination({
|
|
|
118
118
|
] }),
|
|
119
119
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center space-x-2", children: [
|
|
120
120
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
121
|
-
|
|
121
|
+
_chunkJOJW7BBYjs.Button,
|
|
122
122
|
{
|
|
123
123
|
variant: "outline",
|
|
124
124
|
size: "icon-xs",
|
|
@@ -134,7 +134,7 @@ function DataTablePagination({
|
|
|
134
134
|
}
|
|
135
135
|
),
|
|
136
136
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
137
|
-
|
|
137
|
+
_chunkJOJW7BBYjs.Button,
|
|
138
138
|
{
|
|
139
139
|
variant: "outline",
|
|
140
140
|
size: "icon-xs",
|
|
@@ -149,7 +149,7 @@ function DataTablePagination({
|
|
|
149
149
|
}
|
|
150
150
|
),
|
|
151
151
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
152
|
-
|
|
152
|
+
_chunkJOJW7BBYjs.Button,
|
|
153
153
|
{
|
|
154
154
|
variant: "outline",
|
|
155
155
|
size: "icon-xs",
|
|
@@ -164,7 +164,7 @@ function DataTablePagination({
|
|
|
164
164
|
}
|
|
165
165
|
),
|
|
166
166
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
167
|
-
|
|
167
|
+
_chunkJOJW7BBYjs.Button,
|
|
168
168
|
{
|
|
169
169
|
variant: "outline",
|
|
170
170
|
size: "icon-xs",
|
|
@@ -193,9 +193,9 @@ function DataTableColumnHeader({
|
|
|
193
193
|
if (!column.getCanSort()) {
|
|
194
194
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkG3NP7M2Njs.cn.call(void 0, className), children: title });
|
|
195
195
|
}
|
|
196
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkG3NP7M2Njs.cn.call(void 0, "flex items-center space-x-2", className), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
197
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
198
|
-
|
|
196
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkG3NP7M2Njs.cn.call(void 0, "flex items-center space-x-2", className), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3BDLWZ3Wjs.DropdownMenu, { children: [
|
|
197
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3BDLWZ3Wjs.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
198
|
+
_chunkJOJW7BBYjs.Button,
|
|
199
199
|
{
|
|
200
200
|
variant: "ghost",
|
|
201
201
|
size: "xs",
|
|
@@ -206,9 +206,9 @@ function DataTableColumnHeader({
|
|
|
206
206
|
]
|
|
207
207
|
}
|
|
208
208
|
) }),
|
|
209
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
209
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3BDLWZ3Wjs.DropdownMenuContent, { align: "start", children: [
|
|
210
210
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
211
|
-
|
|
211
|
+
_chunk3BDLWZ3Wjs.DropdownMenuItem,
|
|
212
212
|
{
|
|
213
213
|
onClick: () => {
|
|
214
214
|
column.toggleSorting(false);
|
|
@@ -220,7 +220,7 @@ function DataTableColumnHeader({
|
|
|
220
220
|
}
|
|
221
221
|
),
|
|
222
222
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
223
|
-
|
|
223
|
+
_chunk3BDLWZ3Wjs.DropdownMenuItem,
|
|
224
224
|
{
|
|
225
225
|
onClick: () => {
|
|
226
226
|
column.toggleSorting(true);
|
|
@@ -231,9 +231,9 @@ function DataTableColumnHeader({
|
|
|
231
231
|
]
|
|
232
232
|
}
|
|
233
233
|
),
|
|
234
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
234
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3BDLWZ3Wjs.DropdownMenuSeparator, {}),
|
|
235
235
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
236
|
-
|
|
236
|
+
_chunk3BDLWZ3Wjs.DropdownMenuItem,
|
|
237
237
|
{
|
|
238
238
|
onClick: () => {
|
|
239
239
|
column.toggleVisibility(false);
|
package/dist/data-table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/data-table.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAgPP,cAAc;AAhNN,SAKE,KALF;AARR,SAAS,qBAA4B;AAAA,EACnC;AACF,GAEsB;AACpB,SACE,qBAAC,gBACC;AAAA,wBAAC,uBAAoB,SAAO,MAC1B;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,WAAU;AAAA,QAEV;AAAA,8BAAC,uBAAoB,WAAU,eAAc;AAAA,UAAE;AAAA;AAAA;AAAA,IAEjD,GACF;AAAA,IACA,qBAAC,uBAAoB,OAAM,OAAM,WAAU,aACzC;AAAA,0BAAC,qBAAkB,4BAAc;AAAA,MACjC,oBAAC,yBAAsB;AAAA,MACtB,MACE,cAAc,EACd;AAAA,QACC,CAAC,WACC,OAAO,OAAO,eAAe,eAAe,OAAO,WAAW;AAAA,MAClE,EACC,IAAI,CAAC,WAAW;AACf,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,WAAU;AAAA,YACV,SAAS,OAAO,aAAa;AAAA,YAC7B,iBA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\"react\";\nimport type * as ReactTable from \"@tanstack/react-table\";\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 {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"./dropdown-menu\";\nimport { Button } from \"./button\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"./select\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\nfunction DataTableViewOptions<TData>({\n table,\n}: {\n table: ReactTable.Table<TData>;\n}): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"ml-auto hidden h-8 lg:flex\"\n >\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-[150px]\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter(\n (column) =>\n typeof column.accessorFn !== \"undefined\" && column.getCanHide(),\n )\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\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement> & {\n table: ReactTable.Table<TData>;\n}): React.JSX.Element {\n return (\n <div\n className={cn(\"flex items-center justify-between px-2\", className)}\n {...props}\n >\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of{\" \"}\n {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={`${table.getState().pagination.pageSize}`}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"h-8 w-[70px]\">\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={`${pageSize}`}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-[100px] items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of{\" \"}\n {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\nfunction DataTableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: React.HTMLAttributes<HTMLDivElement> & {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}): React.JSX.Element {\n if (!column.getCanSort()) {\n return <div className={cn(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\n variant=\"ghost\"\n size=\"xs\"\n className=\"data-[state=open]:bg-accent -ml-3\"\n >\n <span>{title}</span>\n {column.getIsSorted() === \"desc\" ? (\n <ArrowDownIcon className=\"ml-2 size-4\" />\n ) : column.getIsSorted() === \"asc\" ? (\n <ArrowUpIcon className=\"ml-2 size-4\" />\n ) : (\n <CaretSortIcon className=\"ml-2 size-4\" />\n )}\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\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { DataTableViewOptions, DataTablePagination, DataTableColumnHeader };\n\nexport * from \"@tanstack/react-table\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/data-table.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA4PP,cAAc;AA3NN,SAKE,KALF;AANR,SAAS,qBAA4B;AAAA,EACnC;AACF,GAAwD;AACtD,SACE,qBAAC,gBACC;AAAA,wBAAC,uBAAoB,SAAO,MAC1B;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,WAAU;AAAA,QAEV;AAAA,8BAAC,uBAAoB,WAAU,eAAc;AAAA,UAAE;AAAA;AAAA;AAAA,IAEjD,GACF;AAAA,IACA,qBAAC,uBAAoB,OAAM,OAAM,WAAU,aACzC;AAAA,0BAAC,qBAAkB,4BAAc;AAAA,MACjC,oBAAC,yBAAsB;AAAA,MACtB,MACE,cAAc,EACd;AAAA,QACC,CAAC,WACC,OAAO,OAAO,eAAe,eAAe,OAAO,WAAW;AAAA,MAClE,EACC,IAAI,CAAC,WAAW;AACf,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,WAAU;AAAA,YACV,SAAS,OAAO,aAAa;AAAA,YAC7B,iBAAiB,CAAC,UAAU;AAC1B,qBAAO,iBAAiB,QAAQ,KAAK,CAAC;AAAA,YACxC;AAAA,YAEC,iBAAO;AAAA;AAAA,UAPH,OAAO;AAAA,QAQd;AAAA,MAEJ,CAAC;AAAA,OACL;AAAA,KACF;AAEJ;AAUA,SAAS,oBAA2B;AAAA,EAClC;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAuD;AACrD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,0CAA0C,SAAS;AAAA,MAChE,GAAG;AAAA,MA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A,QACR,MAAK;AAAA,QACL,WAAU;AAAA,QAEV;AAAA,8BAAC,UAAM,iBAAM;AAAA,UACZ,OAAO,YAAY,MAAM,SACxB,oBAAC,iBAAc,WAAU,eAAc,IACrC,OAAO,YAAY,MAAM,QAC3B,oBAAC,eAAY,WAAU,eAAc,IAErC,oBAAC,iBAAc,WAAU,eAAc;AAAA;AAAA;AAAA,IAE3C,GACF;AAAA,IACA,qBAAC,uBAAoB,OAAM,SACzB;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,MAAM;AACb,mBAAO,cAAc,KAAK;AAAA,UAC5B;AAAA,UAEA;AAAA,gCAAC,eAAY,WAAU,0CAAyC;AAAA,YAAE;AAAA;AAAA;AAAA,MAEpE;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,MAAM;AACb,mBAAO,cAAc,IAAI;AAAA,UAC3B;AAAA,UAEA;AAAA,gCAAC,iBAAc,WAAU,0CAAyC;AAAA,YAAE;AAAA;AAAA;AAAA,MAEtE;AAAA,MACA,oBAAC,yBAAsB;AAAA,MACvB;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,MAAM;AACb,mBAAO,iBAAiB,KAAK;AAAA,UAC/B;AAAA,UAEA;AAAA,gCAAC,eAAY,WAAU,0CAAyC;AAAA,YAAE;AAAA;AAAA;AAAA,MAEpE;AAAA,OACF;AAAA,KACF,GACF;AAEJ","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type * as ReactTable from \"@tanstack/react-table\";\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 {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"./dropdown-menu\";\nimport { Button } from \"./button\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"./select\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\nfunction DataTableViewOptions<TData>({\n table,\n}: DataTableViewOptionsProps<TData>): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"ml-auto hidden h-8 lg:flex\"\n >\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-[150px]\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter(\n (column) =>\n typeof column.accessorFn !== \"undefined\" && column.getCanHide(),\n )\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>\n extends React.HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: DataTablePaginationProps<TData>): React.JSX.Element {\n return (\n <div\n className={cn(\"flex items-center justify-between px-2\", className)}\n {...props}\n >\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of{\" \"}\n {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={`${table.getState().pagination.pageSize}`}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"h-8 w-[70px]\">\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={`${pageSize}`}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-[100px] items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of{\" \"}\n {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>\n extends React.HTMLAttributes<HTMLDivElement> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\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={cn(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\n variant=\"ghost\"\n size=\"xs\"\n className=\"data-[state=open]:bg-accent -ml-3\"\n >\n <span>{title}</span>\n {column.getIsSorted() === \"desc\" ? (\n <ArrowDownIcon className=\"ml-2 size-4\" />\n ) : column.getIsSorted() === \"asc\" ? (\n <ArrowUpIcon className=\"ml-2 size-4\" />\n ) : (\n <CaretSortIcon className=\"ml-2 size-4\" />\n )}\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\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DataTableViewOptions,\n DataTablePagination,\n DataTableColumnHeader,\n type DataTableViewOptionsProps,\n type DataTablePaginationProps,\n type DataTableColumnHeaderProps,\n};\n\nexport * from \"@tanstack/react-table\";\n"]}
|
package/dist/data-table.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
SelectItem,
|
|
6
6
|
SelectTrigger,
|
|
7
7
|
SelectValue
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KV4VL2ZF.mjs";
|
|
9
9
|
import {
|
|
10
10
|
DropdownMenu,
|
|
11
11
|
DropdownMenuCheckboxItem,
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
DropdownMenuLabel,
|
|
15
15
|
DropdownMenuSeparator,
|
|
16
16
|
DropdownMenuTrigger
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NCEN3XBK.mjs";
|
|
18
18
|
import {
|
|
19
19
|
Button
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-FATZHRHR.mjs";
|
|
21
21
|
import {
|
|
22
22
|
cn
|
|
23
23
|
} from "./chunk-UG3URV2Z.mjs";
|
package/dist/data-table.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/data-table.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type * as ReactTable from \"@tanstack/react-table\";\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 {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"./dropdown-menu\";\nimport { Button } from \"./button\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"./select\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\nfunction DataTableViewOptions<TData>({\n table,\n}: {\n table: ReactTable.Table<TData>;\n}): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"ml-auto hidden h-8 lg:flex\"\n >\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-[150px]\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter(\n (column) =>\n typeof column.accessorFn !== \"undefined\" && column.getCanHide(),\n )\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\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement> & {\n table: ReactTable.Table<TData>;\n}): React.JSX.Element {\n return (\n <div\n className={cn(\"flex items-center justify-between px-2\", className)}\n {...props}\n >\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of{\" \"}\n {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={`${table.getState().pagination.pageSize}`}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"h-8 w-[70px]\">\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={`${pageSize}`}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-[100px] items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of{\" \"}\n {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\nfunction DataTableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: React.HTMLAttributes<HTMLDivElement> & {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}): React.JSX.Element {\n if (!column.getCanSort()) {\n return <div className={cn(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\n variant=\"ghost\"\n size=\"xs\"\n className=\"data-[state=open]:bg-accent -ml-3\"\n >\n <span>{title}</span>\n {column.getIsSorted() === \"desc\" ? (\n <ArrowDownIcon className=\"ml-2 size-4\" />\n ) : column.getIsSorted() === \"asc\" ? (\n <ArrowUpIcon className=\"ml-2 size-4\" />\n ) : (\n <CaretSortIcon className=\"ml-2 size-4\" />\n )}\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\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { DataTableViewOptions, DataTablePagination, DataTableColumnHeader };\n\nexport * from \"@tanstack/react-table\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAgPP,cAAc;AAhNN,SAKE,KALF;AARR,SAAS,qBAA4B;AAAA,EACnC;AACF,GAEsB;AACpB,SACE,qBAAC,gBACC;AAAA,wBAAC,uBAAoB,SAAO,MAC1B;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,WAAU;AAAA,QAEV;AAAA,8BAAC,uBAAoB,WAAU,eAAc;AAAA,UAAE;AAAA;AAAA;AAAA,IAEjD,GACF;AAAA,IACA,qBAAC,uBAAoB,OAAM,OAAM,WAAU,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A,MAEtE;AAAA,MACA,oBAAC,yBAAsB;AAAA,MACvB;AAAA,QAAC;AAAA;AAAA,UACC,SAAS,MAAM;AACb,mBAAO,iBAAiB,KAAK;AAAA,UAC/B;AAAA,UAEA;AAAA,gCAAC,eAAY,WAAU,0CAAyC;AAAA,YAAE;AAAA;AAAA;AAAA,MAEpE;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/data-table.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type * as ReactTable from \"@tanstack/react-table\";\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 {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"./dropdown-menu\";\nimport { Button } from \"./button\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"./select\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\nfunction DataTableViewOptions<TData>({\n table,\n}: DataTableViewOptionsProps<TData>): React.JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"ml-auto hidden h-8 lg:flex\"\n >\n <MixerHorizontalIcon className=\"mr-2 size-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-[150px]\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter(\n (column) =>\n typeof column.accessorFn !== \"undefined\" && column.getCanHide(),\n )\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>\n extends React.HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\nfunction DataTablePagination<TData>({\n table,\n className,\n ...props\n}: DataTablePaginationProps<TData>): React.JSX.Element {\n return (\n <div\n className={cn(\"flex items-center justify-between px-2\", className)}\n {...props}\n >\n <div className=\"text-muted-foreground flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of{\" \"}\n {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={`${table.getState().pagination.pageSize}`}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"h-8 w-[70px]\">\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={`${pageSize}`}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-[100px] items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of{\" \"}\n {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>\n extends React.HTMLAttributes<HTMLDivElement> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\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={cn(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\n variant=\"ghost\"\n size=\"xs\"\n className=\"data-[state=open]:bg-accent -ml-3\"\n >\n <span>{title}</span>\n {column.getIsSorted() === \"desc\" ? (\n <ArrowDownIcon className=\"ml-2 size-4\" />\n ) : column.getIsSorted() === \"asc\" ? (\n <ArrowUpIcon className=\"ml-2 size-4\" />\n ) : (\n <CaretSortIcon className=\"ml-2 size-4\" />\n )}\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\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DataTableViewOptions,\n DataTablePagination,\n DataTableColumnHeader,\n type DataTableViewOptionsProps,\n type DataTablePaginationProps,\n type DataTableColumnHeaderProps,\n};\n\nexport * from \"@tanstack/react-table\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA4PP,cAAc;AA3NN,SAKE,KALF;AANR,SAAS,qBAA4B;AAAA,EACnC;AACF,GAAwD;AACtD,SACE,qBAAC,gBACC;AAAA,wBAAC,uBAAoB,SAAO,MAC1B;AAAA,MAAC;AAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,WAAU;AAAA,QAEV;AAAA,8BAAC,uBAAoB,WAAU,eAAc;AAAA,UAAE;AAAA;AAAA;AAAA,IAEjD,GACF;AAAA,IACA,qBAAC,uBAAoB,OAAM,OAAM,WAAU,aACzC;AAAA,0BAAC,qBAAkB,4BAAc;AAAA,MACjC,oBAAC,yBAAsB;AAAA,MACtB,MACE,cAAc,EACd;AAAA,QACC,CAAC,WACC,OAAO,OAAO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UAC/B;AAAA,UAEA;AAAA,gCAAC,eAAY,WAAU,0CAAyC;AAAA,YAAE;AAAA;AAAA;AAAA,MAEpE;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
|
package/dist/dialog.d.mts
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
3
|
|
|
4
|
+
type DialogProps = DialogPrimitive.DialogProps;
|
|
4
5
|
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
6
|
+
type DialogTriggerProps = DialogPrimitive.DialogTriggerProps;
|
|
5
7
|
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
type DialogCloseProps = DialogPrimitive.DialogCloseProps;
|
|
6
9
|
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
type DialogContentProps = DialogPrimitive.DialogContentProps;
|
|
7
11
|
declare const DialogContent: React.ForwardRefExoticComponent<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
|
|
9
|
-
declare function
|
|
12
|
+
type DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
13
|
+
declare function DialogHeader({ className, ...props }: DialogHeaderProps): React.JSX.Element;
|
|
14
|
+
type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
15
|
+
declare function DialogFooter({ className, ...props }: DialogFooterProps): React.JSX.Element;
|
|
16
|
+
type DialogTitleProps = DialogPrimitive.DialogTitleProps;
|
|
10
17
|
declare const DialogTitle: React.ForwardRefExoticComponent<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
18
|
+
type DialogDescriptionProps = DialogPrimitive.DialogDescriptionProps;
|
|
11
19
|
declare const DialogDescription: React.ForwardRefExoticComponent<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
12
20
|
|
|
13
|
-
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
|
|
21
|
+
export { Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps };
|
package/dist/dialog.d.ts
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
3
|
|
|
4
|
+
type DialogProps = DialogPrimitive.DialogProps;
|
|
4
5
|
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
6
|
+
type DialogTriggerProps = DialogPrimitive.DialogTriggerProps;
|
|
5
7
|
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
type DialogCloseProps = DialogPrimitive.DialogCloseProps;
|
|
6
9
|
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
type DialogContentProps = DialogPrimitive.DialogContentProps;
|
|
7
11
|
declare const DialogContent: React.ForwardRefExoticComponent<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
|
|
9
|
-
declare function
|
|
12
|
+
type DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
13
|
+
declare function DialogHeader({ className, ...props }: DialogHeaderProps): React.JSX.Element;
|
|
14
|
+
type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
15
|
+
declare function DialogFooter({ className, ...props }: DialogFooterProps): React.JSX.Element;
|
|
16
|
+
type DialogTitleProps = DialogPrimitive.DialogTitleProps;
|
|
10
17
|
declare const DialogTitle: React.ForwardRefExoticComponent<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
18
|
+
type DialogDescriptionProps = DialogPrimitive.DialogDescriptionProps;
|
|
11
19
|
declare const DialogDescription: React.ForwardRefExoticComponent<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
12
20
|
|
|
13
|
-
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
|
|
21
|
+
export { Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps };
|
package/dist/dialog.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkD6NQEMTJjs = require('./chunk-D6NQEMTJ.js');
|
|
12
12
|
require('./chunk-G3NP7M2N.js');
|
|
13
13
|
|
|
14
14
|
|
|
@@ -19,5 +19,5 @@ require('./chunk-G3NP7M2N.js');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
exports.Dialog =
|
|
22
|
+
exports.Dialog = _chunkD6NQEMTJjs.Dialog; exports.DialogClose = _chunkD6NQEMTJjs.DialogClose; exports.DialogContent = _chunkD6NQEMTJjs.DialogContent; exports.DialogDescription = _chunkD6NQEMTJjs.DialogDescription; exports.DialogFooter = _chunkD6NQEMTJjs.DialogFooter; exports.DialogHeader = _chunkD6NQEMTJjs.DialogHeader; exports.DialogTitle = _chunkD6NQEMTJjs.DialogTitle; exports.DialogTrigger = _chunkD6NQEMTJjs.DialogTrigger;
|
|
23
23
|
//# sourceMappingURL=dialog.js.map
|
package/dist/dialog.mjs
CHANGED
package/dist/drawer.d.mts
CHANGED
|
@@ -2,15 +2,23 @@ import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Drawer as Drawer$1 } from 'vaul';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
type DrawerProps = React.ComponentProps<typeof Drawer$1.Root>;
|
|
6
|
+
declare function Drawer({ shouldScaleBackground, ...props }: DrawerProps): React.JSX.Element;
|
|
7
|
+
type DrawerTriggerProps = React.ComponentProps<typeof Drawer$1.Trigger>;
|
|
6
8
|
declare const DrawerTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
type DrawerCloseProps = React.ComponentProps<typeof Drawer$1.Close>;
|
|
7
10
|
declare const DrawerClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
type DrawerContentProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Content>;
|
|
8
12
|
declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
9
13
|
onAnimationEnd?: ((open: boolean) => void) | undefined;
|
|
10
14
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
|
|
12
|
-
declare function
|
|
15
|
+
type DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
16
|
+
declare function DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element;
|
|
17
|
+
type DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
18
|
+
declare function DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element;
|
|
19
|
+
type DrawerTitleProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Title>;
|
|
13
20
|
declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
21
|
+
type DrawerDescriptionProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Description>;
|
|
14
22
|
declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
15
23
|
|
|
16
|
-
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger };
|
|
24
|
+
export { Drawer, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, type DrawerProps, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps };
|
package/dist/drawer.d.ts
CHANGED
|
@@ -2,15 +2,23 @@ import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Drawer as Drawer$1 } from 'vaul';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
type DrawerProps = React.ComponentProps<typeof Drawer$1.Root>;
|
|
6
|
+
declare function Drawer({ shouldScaleBackground, ...props }: DrawerProps): React.JSX.Element;
|
|
7
|
+
type DrawerTriggerProps = React.ComponentProps<typeof Drawer$1.Trigger>;
|
|
6
8
|
declare const DrawerTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
type DrawerCloseProps = React.ComponentProps<typeof Drawer$1.Close>;
|
|
7
10
|
declare const DrawerClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
type DrawerContentProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Content>;
|
|
8
12
|
declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
9
13
|
onAnimationEnd?: ((open: boolean) => void) | undefined;
|
|
10
14
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
|
|
12
|
-
declare function
|
|
15
|
+
type DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
16
|
+
declare function DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element;
|
|
17
|
+
type DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
18
|
+
declare function DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element;
|
|
19
|
+
type DrawerTitleProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Title>;
|
|
13
20
|
declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
21
|
+
type DrawerDescriptionProps = React.ComponentPropsWithoutRef<typeof Drawer$1.Description>;
|
|
14
22
|
declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
15
23
|
|
|
16
|
-
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger };
|
|
24
|
+
export { Drawer, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, type DrawerProps, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps };
|
package/dist/drawer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/drawer.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,S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T;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,YAAY,cAAc,gBAAgB,MAAM;AAShD,IAAM,oBAA0B,iBAG9B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,kBAAkB,cAAc,gBAAgB,YAAY","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\nfunction Drawer({\n shouldScaleBackground = true,\n ...props\n}: DrawerProps): React.JSX.Element {\n return (\n <DrawerPrimitive.Root\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\ntype DrawerTriggerProps = React.ComponentProps<typeof DrawerPrimitive.Trigger>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentProps<typeof DrawerPrimitive.Close>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Content\n>;\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n DrawerContentProps\n>(({ className, children, ...props }, ref) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-[100px] rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n));\nDrawerContent.displayName = \"DrawerContent\";\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\nfunction DrawerHeader({\n className,\n ...props\n}: DrawerHeaderProps): React.JSX.Element {\n return (\n <div\n className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\ntype DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\nfunction DrawerFooter({\n className,\n ...props\n}: DrawerFooterProps): React.JSX.Element {\n return (\n <div\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Title\n>;\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Title>,\n DrawerTitleProps\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Description\n>;\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Description>,\n DrawerDescriptionProps\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"]}
|
package/dist/drawer.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\nfunction Drawer({\n shouldScaleBackground = true,\n ...props\n}:
|
|
1
|
+
{"version":3,"sources":["../src/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\nfunction Drawer({\n shouldScaleBackground = true,\n ...props\n}: DrawerProps): React.JSX.Element {\n return (\n <DrawerPrimitive.Root\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\ntype DrawerTriggerProps = React.ComponentProps<typeof DrawerPrimitive.Trigger>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentProps<typeof DrawerPrimitive.Close>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Content\n>;\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n DrawerContentProps\n>(({ className, children, ...props }, ref) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-[100px] rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n));\nDrawerContent.displayName = \"DrawerContent\";\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\nfunction DrawerHeader({\n className,\n ...props\n}: DrawerHeaderProps): React.JSX.Element {\n return (\n <div\n className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\ntype DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\nfunction DrawerFooter({\n className,\n ...props\n}: DrawerFooterProps): React.JSX.Element {\n return (\n <div\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Title\n>;\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Title>,\n DrawerTitleProps\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<\n typeof DrawerPrimitive.Description\n>;\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Description>,\n DrawerDescriptionProps\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAatC,cAkCA,YAlCA;AALJ,SAAS,OAAO;AAAA,EACd,wBAAwB;AAAA,EACxB,GAAG;AACL,GAAmC;AACjC,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAOA,IAAM,gBAAgB,gBAAgB;AAOtC,IAAM,cAAc,gBAAgB;AASpC,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QACpC,qBAAC,gBAAgB,QAAhB,EACC;AAAA,sBAAC,gBAAgB,SAAhB,EAAwB,WAAU,kCAAiC;AAAA,EACpE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,4BAAC,SAAI,WAAU,oDAAmD;AAAA,QACjE;AAAA;AAAA;AAAA,EACH;AAAA,GACF,CACD;AACD,cAAc,cAAc;AAO5B,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,GAAG;AACL,GAAyC;AACvC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,6CAA6C,SAAS;AAAA,MACnE,GAAG;AAAA;AAAA,EACN;AAEJ;AAOA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,GAAG;AACL,GAAyC;AACvC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,mCAAmC,SAAS;AAAA,MACzD,GAAG;AAAA;AAAA,EACN;AAEJ;AASA,IAAM,cAAoB,iBAGxB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,YAAY,cAAc,gBAAgB,MAAM;AAShD,IAAM,oBAA0B,iBAG9B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,kBAAkB,cAAc,gBAAgB,YAAY;","names":[]}
|
package/dist/dropdown-menu.d.mts
CHANGED
|
@@ -1,25 +1,39 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
3
|
|
|
4
|
+
type DropdownMenuProps = DropdownMenuPrimitive.DropdownMenuProps;
|
|
4
5
|
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
6
|
+
type DropdownMenuTriggerProps = DropdownMenuPrimitive.DropdownMenuTriggerProps;
|
|
5
7
|
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
type DropdownMenuGroupProps = DropdownMenuPrimitive.DropdownMenuGroupProps;
|
|
6
9
|
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
type DropdownMenuSubProps = DropdownMenuPrimitive.DropdownMenuSubProps;
|
|
7
11
|
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
12
|
+
type DropdownMenuRadioGroupProps = DropdownMenuPrimitive.DropdownMenuRadioGroupProps;
|
|
8
13
|
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
|
|
10
|
-
inset?: boolean
|
|
11
|
-
}
|
|
14
|
+
interface DropdownMenuSubTriggerProps extends DropdownMenuPrimitive.DropdownMenuSubTriggerProps {
|
|
15
|
+
inset?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
type DropdownMenuSubContentProps = DropdownMenuPrimitive.DropdownMenuSubContentProps;
|
|
12
19
|
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
type DropdownMenuContentProps = DropdownMenuPrimitive.DropdownMenuContentProps;
|
|
13
21
|
declare const DropdownMenuContent: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
-
|
|
15
|
-
inset?: boolean
|
|
16
|
-
}
|
|
22
|
+
interface DropdownMenuItemProps extends DropdownMenuPrimitive.DropdownMenuItemProps {
|
|
23
|
+
inset?: boolean;
|
|
24
|
+
}
|
|
25
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
type DropdownMenuCheckboxItemProps = DropdownMenuPrimitive.DropdownMenuCheckboxItemProps;
|
|
17
27
|
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
type DropdownMenuRadioItemProps = DropdownMenuPrimitive.DropdownMenuRadioItemProps;
|
|
18
29
|
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
-
|
|
20
|
-
inset?: boolean
|
|
21
|
-
}
|
|
30
|
+
interface DropdownMenuLabelProps extends DropdownMenuPrimitive.DropdownMenuLabelProps {
|
|
31
|
+
inset?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
type DropdownMenuSeparatorProps = DropdownMenuPrimitive.DropdownMenuSeparatorProps;
|
|
22
35
|
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
-
|
|
36
|
+
type DropdownMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
37
|
+
declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): React.JSX.Element;
|
|
24
38
|
|
|
25
|
-
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
39
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
|