@classytic/fluid 0.4.2 → 0.5.0
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/README.md +21 -1
- package/dist/client/calendar.d.mts +1 -2
- package/dist/client/calendar.mjs +4 -4
- package/dist/client/color-picker.d.mts +41 -25
- package/dist/client/color-picker.mjs +121 -73
- package/dist/client/core.d.mts +243 -557
- package/dist/client/core.mjs +351 -1462
- package/dist/client/error.d.mts +41 -41
- package/dist/client/error.mjs +35 -35
- package/dist/client/gallery.d.mts +33 -33
- package/dist/client/gallery.mjs +128 -127
- package/dist/client/hooks.d.mts +57 -39
- package/dist/client/hooks.mjs +29 -7
- package/dist/client/spreadsheet.d.mts +28 -28
- package/dist/client/spreadsheet.mjs +77 -77
- package/dist/client/table.d.mts +66 -33
- package/dist/client/table.mjs +87 -54
- package/dist/client/theme.mjs +1 -1
- package/dist/command.d.mts +6 -4
- package/dist/command.mjs +3 -3
- package/dist/compact.d.mts +97 -95
- package/dist/compact.mjs +336 -322
- package/dist/dashboard.d.mts +614 -422
- package/dist/dashboard.mjs +1051 -762
- package/dist/{dropdown-wrapper-B86u9Fri.mjs → dropdown-wrapper-B9nRDUlz.mjs} +25 -35
- package/dist/forms.d.mts +1037 -972
- package/dist/forms.mjs +2849 -2721
- package/dist/index.d.mts +218 -152
- package/dist/index.mjs +357 -264
- package/dist/layouts.d.mts +94 -94
- package/dist/layouts.mjs +115 -110
- package/dist/phone-input-B9_XPNvv.mjs +429 -0
- package/dist/phone-input-CLH_UjQZ.d.mts +31 -0
- package/dist/{search-context-DR7DBs7S.mjs → search-context-1g3ZmOvx.mjs} +1 -1
- package/dist/search.d.mts +168 -164
- package/dist/search.mjs +305 -301
- package/dist/{sheet-wrapper-C13Y-Q6w.mjs → sheet-wrapper-B2uxookb.mjs} +1 -1
- package/dist/timeline-Bgu1mIe9.d.mts +373 -0
- package/dist/timeline-HJtWf4Op.mjs +804 -0
- package/dist/{use-base-search-BGgWnWaF.d.mts → use-base-search-DFC4QKYU.d.mts} +1 -1
- package/dist/{use-media-query-BnVNIKT4.mjs → use-media-query-ChLfFChU.mjs} +6 -7
- package/package.json +2 -2
- /package/dist/{api-pagination-CJ0vR_w6.d.mts → api-pagination-C30ser2L.d.mts} +0 -0
- /package/dist/{filter-utils-DqMmy_v-.mjs → filter-utils-BGIvtq1R.mjs} +0 -0
- /package/dist/{filter-utils-IZ0GtuPo.d.mts → filter-utils-DOFTBWm1.d.mts} +0 -0
- /package/dist/{use-debounce-xmZucz5e.mjs → use-debounce-BNoNiEon.mjs} +0 -0
- /package/dist/{use-keyboard-shortcut-Bl6YM5Q7.mjs → use-keyboard-shortcut-C_Vk-36P.mjs} +0 -0
- /package/dist/{use-keyboard-shortcut-_mRCh3QO.d.mts → use-keyboard-shortcut-Q4CSPzSI.d.mts} +0 -0
- /package/dist/{use-mobile-BX3SQVo2.mjs → use-mobile-CnEmFiQx.mjs} +0 -0
- /package/dist/{use-scroll-detection-CsgsQYvy.mjs → use-scroll-detection-BKfqkmEC.mjs} +0 -0
- /package/dist/{utils-CDue7cEt.d.mts → utils-rqvYP1by.d.mts} +0 -0
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
import { t as cn } from "./utils-DQ5SCVoW.mjs";
|
|
2
|
+
import { t as useMediaQuery } from "./use-media-query-ChLfFChU.mjs";
|
|
2
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
4
|
import { ChevronDown, MoreHorizontal } from "lucide-react";
|
|
5
|
-
import { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from "@/components/ui/pagination";
|
|
6
5
|
import { Button } from "@/components/ui/button";
|
|
6
|
+
import { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from "@/components/ui/pagination";
|
|
7
7
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
|
|
8
8
|
|
|
9
9
|
//#region src/components/custom-pagination.tsx
|
|
10
|
-
function CustomPagination({ page, onPageChange, pages, hasPrev, hasNext }) {
|
|
11
|
-
const
|
|
10
|
+
function CustomPagination({ page, className, onPageChange, pages, hasPrev, hasNext }) {
|
|
11
|
+
const isMobile = useMediaQuery("(max-width: 639px)");
|
|
12
12
|
const currentPageNum = Number(page);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
const checkMobile = () => {
|
|
15
|
-
setIsMobile(window.innerWidth < 640);
|
|
16
|
-
};
|
|
17
|
-
checkMobile();
|
|
18
|
-
window.addEventListener("resize", checkMobile);
|
|
19
|
-
return () => window.removeEventListener("resize", checkMobile);
|
|
20
|
-
}, []);
|
|
21
13
|
if (pages <= 1) return null;
|
|
22
14
|
const getPageNumbers = () => {
|
|
23
15
|
const delta = isMobile ? 1 : 2;
|
|
@@ -34,7 +26,7 @@ function CustomPagination({ page, onPageChange, pages, hasPrev, hasNext }) {
|
|
|
34
26
|
return [...new Set(rangeWithDots)];
|
|
35
27
|
};
|
|
36
28
|
if (isMobile && pages > 5) return /* @__PURE__ */ jsx(Pagination, {
|
|
37
|
-
className: "mx-0 w-auto",
|
|
29
|
+
className: cn("mx-0 w-auto", className),
|
|
38
30
|
children: /* @__PURE__ */ jsxs(PaginationContent, {
|
|
39
31
|
className: "gap-1",
|
|
40
32
|
children: [
|
|
@@ -60,7 +52,7 @@ function CustomPagination({ page, onPageChange, pages, hasPrev, hasNext }) {
|
|
|
60
52
|
})
|
|
61
53
|
});
|
|
62
54
|
return /* @__PURE__ */ jsx(Pagination, {
|
|
63
|
-
className: "mx-0 w-auto",
|
|
55
|
+
className: cn("mx-0 w-auto", className),
|
|
64
56
|
children: /* @__PURE__ */ jsxs(PaginationContent, {
|
|
65
57
|
className: "gap-1 flex-wrap",
|
|
66
58
|
children: [
|
|
@@ -89,32 +81,23 @@ function CustomPagination({ page, onPageChange, pages, hasPrev, hasNext }) {
|
|
|
89
81
|
})
|
|
90
82
|
});
|
|
91
83
|
}
|
|
92
|
-
function PaginationInfo({ page, total, limit = 10 }) {
|
|
93
|
-
const
|
|
94
|
-
useEffect(() => {
|
|
95
|
-
const checkMobile = () => {
|
|
96
|
-
setIsMobile(window.innerWidth < 640);
|
|
97
|
-
};
|
|
98
|
-
checkMobile();
|
|
99
|
-
window.addEventListener("resize", checkMobile);
|
|
100
|
-
return () => window.removeEventListener("resize", checkMobile);
|
|
101
|
-
}, []);
|
|
84
|
+
function PaginationInfo({ page, total, limit = 10, className }) {
|
|
85
|
+
const isMobile = useMediaQuery("(max-width: 639px)");
|
|
102
86
|
if (total === 0) return /* @__PURE__ */ jsx("div", {
|
|
103
|
-
className: "flex-1 text-sm text-muted-foreground",
|
|
87
|
+
className: cn("flex-1 text-sm text-muted-foreground", className),
|
|
104
88
|
children: /* @__PURE__ */ jsx("p", { children: "No entries found" })
|
|
105
89
|
});
|
|
106
90
|
const startEntry = (page - 1) * limit + 1;
|
|
107
91
|
const endEntry = Math.min(page * limit, total);
|
|
108
92
|
return /* @__PURE__ */ jsx("div", {
|
|
109
|
-
className: "flex-1 text-sm text-muted-foreground",
|
|
93
|
+
className: cn("flex-1 text-sm text-muted-foreground", className),
|
|
110
94
|
children: /* @__PURE__ */ jsx("p", {
|
|
111
95
|
className: cn("whitespace-nowrap", isMobile && "text-xs"),
|
|
112
96
|
children: isMobile ? /* @__PURE__ */ jsxs("span", { children: [
|
|
113
97
|
startEntry.toLocaleString(),
|
|
114
98
|
"-",
|
|
115
99
|
endEntry.toLocaleString(),
|
|
116
|
-
" of",
|
|
117
|
-
" ",
|
|
100
|
+
" of ",
|
|
118
101
|
total.toLocaleString()
|
|
119
102
|
] }) : /* @__PURE__ */ jsxs("span", { children: [
|
|
120
103
|
"Showing",
|
|
@@ -123,15 +106,13 @@ function PaginationInfo({ page, total, limit = 10 }) {
|
|
|
123
106
|
className: "font-medium text-foreground",
|
|
124
107
|
children: startEntry.toLocaleString()
|
|
125
108
|
}),
|
|
126
|
-
" ",
|
|
127
|
-
"to",
|
|
109
|
+
" to",
|
|
128
110
|
" ",
|
|
129
111
|
/* @__PURE__ */ jsx("span", {
|
|
130
112
|
className: "font-medium text-foreground",
|
|
131
113
|
children: endEntry.toLocaleString()
|
|
132
114
|
}),
|
|
133
|
-
" ",
|
|
134
|
-
"of",
|
|
115
|
+
" of",
|
|
135
116
|
" ",
|
|
136
117
|
/* @__PURE__ */ jsx("span", {
|
|
137
118
|
className: "font-medium text-foreground",
|
|
@@ -191,15 +172,24 @@ function ApiPagination({ total = 0, limit = 10, pages = 1, page = 1, hasNext = f
|
|
|
191
172
|
|
|
192
173
|
//#endregion
|
|
193
174
|
//#region src/components/dropdown-wrapper.tsx
|
|
194
|
-
function DropdownWrapper({ trigger, children, align = "end", side = "bottom", sideOffset = 4, className, contentClassName, ...props }) {
|
|
175
|
+
function DropdownWrapper({ trigger, children, header, footer, align = "end", side = "bottom", sideOffset = 4, className, contentClassName, open, onOpenChange, ...props }) {
|
|
195
176
|
return /* @__PURE__ */ jsxs(DropdownMenu, {
|
|
177
|
+
open,
|
|
178
|
+
onOpenChange,
|
|
196
179
|
...props,
|
|
197
|
-
children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, { render: trigger }), /* @__PURE__ */
|
|
180
|
+
children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, { render: trigger }), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
198
181
|
align,
|
|
199
182
|
side,
|
|
200
183
|
sideOffset,
|
|
201
184
|
className: cn("min-w-[160px]", contentClassName),
|
|
202
|
-
children
|
|
185
|
+
children: [
|
|
186
|
+
header && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
187
|
+
className: "px-2 py-1.5",
|
|
188
|
+
children: header
|
|
189
|
+
}), /* @__PURE__ */ jsx(DropdownMenuSeparator, {})] }),
|
|
190
|
+
children,
|
|
191
|
+
footer && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DropdownMenuSeparator, {}), /* @__PURE__ */ jsx(DropdownMenuGroup, { children: footer })] })
|
|
192
|
+
]
|
|
203
193
|
})]
|
|
204
194
|
});
|
|
205
195
|
}
|