@oneplatformdev/ui 0.0.1-beta.8 → 0.0.1-beta.81
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/Accordion/Accordion.d.ts +2 -2
- package/Accordion/Accordion.mjs +23 -20
- package/AlertDialog/AlertDialogRoot.d.ts +2 -2
- package/AlertDialog/AlertDialogRoot.mjs +7 -7
- package/Button/Button.mjs +11 -10
- package/Button/buttonVariants.mjs +5 -5
- package/Calendar/Calendar.mjs +3 -2
- package/Checkbox/Checkbox.d.ts +5 -4
- package/Checkbox/Checkbox.mjs +48 -21
- package/Checkbox/Checkbox.types.d.ts +10 -0
- package/Checkbox/index.d.ts +1 -0
- package/Checkbox/index.mjs +3 -2
- package/Combobox/Combobox.d.ts +2 -2
- package/Combobox/Combobox.mjs +12 -123
- package/Combobox/Combobox.types.d.ts +24 -1
- package/Combobox/ComboboxOptionItem.d.ts +5 -0
- package/Combobox/ComboboxOptionItem.mjs +67 -0
- package/Combobox/ComboboxOptions.d.ts +4 -0
- package/Combobox/ComboboxOptions.mjs +12 -0
- package/Combobox/index.mjs +1 -1
- package/Combobox-DpcCpN3b.js +301 -0
- package/Command/Command.d.ts +1 -1
- package/Command/Command.mjs +36 -29
- package/DataTable/DataTable.d.ts +10 -3
- package/DataTable/DataTable.mjs +33 -33
- package/DataTable/DataTableColumnFilter.d.ts +4 -0
- package/DataTable/DataTableColumnFilter.mjs +31 -0
- package/DatePicker/DatePicker.mjs +2 -2
- package/Dialog/Dialog.d.ts +2 -2
- package/Dialog/Dialog.mjs +16 -13
- package/DropdownMenu/DropdownMenu.d.ts +2 -2
- package/DropdownMenu/DropdownMenu.mjs +30 -26
- package/Dropzone/Dropzone.d.ts +22 -0
- package/Dropzone/Dropzone.mjs +151 -0
- package/Dropzone/Dropzone.types.d.ts +38 -0
- package/Dropzone/DropzoneFilePreview.d.ts +4 -0
- package/Dropzone/DropzoneFilePreview.mjs +9 -0
- package/Dropzone/DropzoneSinglePickPreview.d.ts +9 -0
- package/Dropzone/DropzoneSinglePickPreview.mjs +38 -0
- package/Dropzone/DropzoneUtils.d.ts +5 -0
- package/Dropzone/DropzoneUtils.mjs +24 -0
- package/Dropzone/index.d.ts +2 -0
- package/Dropzone/index.mjs +7 -0
- package/Dropzone/package.json +7 -0
- package/DropzoneFilePreview-Dhtv8F4u.js +67 -0
- package/Form/Form.d.ts +2 -2
- package/Form/Form.mjs +48 -45
- package/Form/FormRenderControl.d.ts +2 -3
- package/Form/FormRenderControl.mjs +10 -10
- package/Form/FormRenderControl.types.d.ts +5 -7
- package/FormCheckbox/FormCheckbox.d.ts +2 -3
- package/FormCheckbox/FormCheckbox.mjs +23 -23
- package/FormCheckbox/FormCheckbox.types.d.ts +3 -3
- package/FormCombobox/FormCombobox.d.ts +2 -2
- package/FormCombobox/FormCombobox.mjs +6 -6
- package/FormCombobox/FormCombobox.types.d.ts +2 -3
- package/FormDatePicker/FormDatePicker.d.ts +2 -2
- package/FormDatePicker/FormDatePicker.mjs +20 -18
- package/FormDatePicker/FormDatePicker.types.d.ts +2 -3
- package/FormDropzone/FormDropzone.d.ts +4 -0
- package/FormDropzone/FormDropzone.mjs +19 -0
- package/FormDropzone/FormDropzone.types.d.ts +6 -0
- package/FormDropzone/index.d.ts +2 -0
- package/FormDropzone/index.mjs +4 -0
- package/FormDropzone/package.json +7 -0
- package/FormInput/FormInput.d.ts +5 -3
- package/FormInput/FormInput.mjs +32 -18
- package/FormInput/FormInput.types.d.ts +2 -3
- package/FormRadio/FormRadio.d.ts +4 -0
- package/FormRadio/FormRadio.mjs +40 -0
- package/FormRadio/FormRadio.types.d.ts +6 -0
- package/FormRadio/index.d.ts +2 -0
- package/FormRadio/index.mjs +4 -0
- package/FormRadio/package.json +7 -0
- package/FormSelect/FormSelect.d.ts +2 -3
- package/FormSelect/FormSelect.mjs +19 -17
- package/FormSelect/FormSelect.types.d.ts +2 -3
- package/FormTextarea/FormTextarea.d.ts +2 -3
- package/FormTextarea/FormTextarea.mjs +13 -12
- package/FormTextarea/FormTextarea.types.d.ts +2 -3
- package/Input/Input.mjs +40 -34
- package/Input/Input.types.d.ts +4 -1
- package/Input/inputVariants.mjs +9 -3
- package/Label/Label.d.ts +2 -2
- package/Label/labelVariants.mjs +7 -4
- package/LazyLoader/LazyLoader.mjs +5 -4
- package/LoadingMask/LoadingMask.d.ts +4 -1
- package/LoadingMask/LoadingMask.mjs +18 -56
- package/LoadingMask/LoadingMask.types.d.ts +5 -0
- package/LoadingMask/RenderLoadingMask.d.ts +3 -0
- package/LoadingMask/RenderLoadingMask.mjs +108 -0
- package/LoadingMask/index.d.ts +2 -0
- package/LoadingMask/index.mjs +4 -2
- package/Radio/Radio.d.ts +4 -0
- package/Radio/Radio.mjs +12 -0
- package/Radio/Radio.types.d.ts +11 -0
- package/Radio/index.d.ts +2 -0
- package/Radio/index.mjs +4 -0
- package/Radio/package.json +7 -0
- package/RadioGroup/RadioGroup.d.ts +9 -3
- package/RadioGroup/RadioGroup.mjs +37 -19
- package/RadioGroup/index.mjs +4 -3
- package/ScrollArea/ScrollArea.d.ts +2 -2
- package/ScrollArea/ScrollArea.mjs +26 -13
- package/Select/Select.mjs +93 -63
- package/Select/Select.types.d.ts +9 -2
- package/Select/SelectRoot.d.ts +2 -2
- package/Select/SelectRoot.mjs +1 -0
- package/TablePagination/TablePagination.d.ts +16 -0
- package/TablePagination/TablePagination.mjs +74 -0
- package/TablePagination/index.d.ts +1 -0
- package/TablePagination/index.mjs +4 -0
- package/TablePagination/package.json +7 -0
- package/Tabs/Tabs.d.ts +3 -2
- package/Tabs/Tabs.mjs +20 -6
- package/Tabs/Tabs.types.d.ts +5 -2
- package/Tabs/index.mjs +8 -7
- package/Textarea/Textarea.d.ts +1 -1
- package/Textarea/Textarea.mjs +71 -15
- package/Textarea/Textarea.types.d.ts +16 -2
- package/Textarea/useAutosizeTextArea.d.ts +3 -0
- package/Textarea/useAutosizeTextArea.mjs +20 -0
- package/Toast/toastVariants.mjs +3 -3
- package/index.css +1 -1
- package/index.d.ts +3 -0
- package/index.mjs +332 -318
- package/package.json +9 -8
- package/tailwind.config.mjs +13 -13
@@ -0,0 +1,301 @@
|
|
1
|
+
import { jsxs as m, jsx as e, Fragment as A } from "react/jsx-runtime";
|
2
|
+
import g, { forwardRef as w, useState as V, useRef as W, useEffect as X, useCallback as v, useLayoutEffect as H } from "react";
|
3
|
+
import { LoadingMask as J } from "./LoadingMask/LoadingMask.mjs";
|
4
|
+
import "./LoadingMask/RenderLoadingMask.mjs";
|
5
|
+
import { Popover as K, PopoverTrigger as Q, PopoverContent as Y } from "./Popover/Popover.mjs";
|
6
|
+
import { Button as _ } from "./Button/Button.mjs";
|
7
|
+
import "./Button/buttonVariants.mjs";
|
8
|
+
import { CommandItem as Z, Command as $, CommandInput as ee, CommandList as te, CommandGroup as oe, CommandEmpty as F } from "./Command/Command.mjs";
|
9
|
+
import { cn as c } from "@oneplatformdev/utils";
|
10
|
+
import { useDebounceCallback as re } from "@oneplatformdev/hooks";
|
11
|
+
import { Check as ae, ChevronDownIcon as ie, X as ne, ChevronsUpDown as le } from "lucide-react";
|
12
|
+
import { Collapsible as se, CollapsibleTrigger as pe, CollapsibleContent as me } from "./Collapsible/Collapsible.mjs";
|
13
|
+
import "./Accordion/Accordion.mjs";
|
14
|
+
import "./Alert/Alert.mjs";
|
15
|
+
import "./AlertDialog/AlertDialogRoot.mjs";
|
16
|
+
import "recharts";
|
17
|
+
import "./Chart/Chart.mjs";
|
18
|
+
import "./Sidebar/Sidebar.mjs";
|
19
|
+
import "@radix-ui/react-aspect-ratio";
|
20
|
+
import "./Avatar/Avatar.mjs";
|
21
|
+
import "./Badge/badgeVariants.mjs";
|
22
|
+
import "./Breadcrumb/Breadcrumb.mjs";
|
23
|
+
import "./ButtonIcon/ButtonIcon.mjs";
|
24
|
+
import "./ButtonIcon/buttonIconVariants.mjs";
|
25
|
+
import "./Calendar/Calendar.mjs";
|
26
|
+
import "./Card/Card.mjs";
|
27
|
+
import "./Carousel/Carousel.mjs";
|
28
|
+
import "./Checkbox/Checkbox.mjs";
|
29
|
+
import "@radix-ui/react-collapsible";
|
30
|
+
import "./DropdownMenu/DropdownMenu.mjs";
|
31
|
+
import "./Table/Table.mjs";
|
32
|
+
import "@tanstack/react-table";
|
33
|
+
import "./DatePicker/DatePicker.mjs";
|
34
|
+
import "./Dialog/Dialog.mjs";
|
35
|
+
import "./Drawer/Drawer.mjs";
|
36
|
+
import "./Form/Form.mjs";
|
37
|
+
import "./FormInput/FormInput.mjs";
|
38
|
+
import "./Select/SelectRoot.mjs";
|
39
|
+
import "./Textarea/Textarea.mjs";
|
40
|
+
import "./Separator/Separator.mjs";
|
41
|
+
import "./HoverCard/HoverCard.mjs";
|
42
|
+
import "./Input/Input.mjs";
|
43
|
+
import "./InputOTP/InputOTP.mjs";
|
44
|
+
import "./Label/Label.mjs";
|
45
|
+
import "./Label/labelVariants.mjs";
|
46
|
+
import "./LoadingProgress/loadingProgressVariants.mjs";
|
47
|
+
import "./Menubar/Menubar.mjs";
|
48
|
+
import "./NavigationMenu/NavigationMenu.mjs";
|
49
|
+
import "./NavigationMenu/navigationMenuVariants.mjs";
|
50
|
+
import "./Pagination/Pagination.mjs";
|
51
|
+
import "./Progress/Progress.mjs";
|
52
|
+
import "./RadioGroup/RadioGroup.mjs";
|
53
|
+
import "react-resizable-panels";
|
54
|
+
import "./ScrollArea/ScrollArea.mjs";
|
55
|
+
import "./Sheet/Sheet.mjs";
|
56
|
+
import "./Slider/Slider.mjs";
|
57
|
+
import "next-themes";
|
58
|
+
import "sonner";
|
59
|
+
import "./Switch/Switch.mjs";
|
60
|
+
import "./Tabs/TabsRoot.mjs";
|
61
|
+
import "./Toast/Toast.mjs";
|
62
|
+
import "./Toggle/Toggle.mjs";
|
63
|
+
import "./ToggleGroup/ToggleGroup.mjs";
|
64
|
+
import "./Tooltip/TooltipRoot.mjs";
|
65
|
+
import "./Dropzone/Dropzone.mjs";
|
66
|
+
const ce = 8, I = w((i, l) => {
|
67
|
+
const { children: t, setOpen: d, option: r, onChangeOption: n, value: s = "", deep: u = 0 } = i;
|
68
|
+
return /* @__PURE__ */ m(
|
69
|
+
Z,
|
70
|
+
{
|
71
|
+
ref: l,
|
72
|
+
value: r.value,
|
73
|
+
onSelect: () => {
|
74
|
+
s === r.value ? n == null || n({ value: "", label: "" }) : n == null || n(r), d(!1);
|
75
|
+
},
|
76
|
+
style: {
|
77
|
+
paddingLeft: (u + 1) * ce
|
78
|
+
},
|
79
|
+
children: [
|
80
|
+
t,
|
81
|
+
/* @__PURE__ */ e(
|
82
|
+
"span",
|
83
|
+
{
|
84
|
+
className: c(
|
85
|
+
"overflow-hidden whitespace-wrap text-ellipsis line-clamp-2"
|
86
|
+
),
|
87
|
+
children: r.label
|
88
|
+
}
|
89
|
+
),
|
90
|
+
/* @__PURE__ */ e(
|
91
|
+
ae,
|
92
|
+
{
|
93
|
+
className: c(
|
94
|
+
"ml-auto",
|
95
|
+
s === r.value ? "opacity-100" : "opacity-0"
|
96
|
+
)
|
97
|
+
}
|
98
|
+
)
|
99
|
+
]
|
100
|
+
},
|
101
|
+
r.value
|
102
|
+
);
|
103
|
+
}), M = w((i, l) => {
|
104
|
+
var p;
|
105
|
+
const { option: t, onChangeOption: d, value: r = "", deep: n = 0 } = i, [s, u] = V(!0);
|
106
|
+
return (p = t == null ? void 0 : t.items) != null && p.length ? /* @__PURE__ */ m(
|
107
|
+
se,
|
108
|
+
{
|
109
|
+
ref: l,
|
110
|
+
open: s,
|
111
|
+
onOpenChange: u,
|
112
|
+
"data-opened": s,
|
113
|
+
className: c("group/collapsible"),
|
114
|
+
children: [
|
115
|
+
/* @__PURE__ */ e(I, { ...i, children: /* @__PURE__ */ e(pe, { asChild: !0, children: /* @__PURE__ */ m(
|
116
|
+
_,
|
117
|
+
{
|
118
|
+
onClick: (a) => {
|
119
|
+
a == null || a.preventDefault(), a == null || a.stopPropagation(), u((h) => !h);
|
120
|
+
},
|
121
|
+
type: "button",
|
122
|
+
variant: "ghost",
|
123
|
+
size: "sm",
|
124
|
+
className: c("aspect-square size-6", "transition-transform"),
|
125
|
+
children: [
|
126
|
+
/* @__PURE__ */ e(
|
127
|
+
ie,
|
128
|
+
{
|
129
|
+
className: c(
|
130
|
+
"!size-5",
|
131
|
+
"transition-transform",
|
132
|
+
s && "rotate-180"
|
133
|
+
)
|
134
|
+
}
|
135
|
+
),
|
136
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle" })
|
137
|
+
]
|
138
|
+
}
|
139
|
+
) }) }),
|
140
|
+
/* @__PURE__ */ e(me, { children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-0", children: t == null ? void 0 : t.items.map((a) => /* @__PURE__ */ e(
|
141
|
+
M,
|
142
|
+
{
|
143
|
+
...i,
|
144
|
+
deep: n + 1,
|
145
|
+
option: a
|
146
|
+
},
|
147
|
+
a.value
|
148
|
+
)) }) })
|
149
|
+
]
|
150
|
+
}
|
151
|
+
) : /* @__PURE__ */ e(I, { ...i, ref: l });
|
152
|
+
}), de = w((i, l) => {
|
153
|
+
const { options: t = [], ...d } = i;
|
154
|
+
return /* @__PURE__ */ e("div", { ref: l, className: "flex flex-col gap-0", children: t.map((r) => /* @__PURE__ */ e(M, { ...d, option: r }, r.value)) });
|
155
|
+
}), St = w(
|
156
|
+
(i, l) => {
|
157
|
+
var j;
|
158
|
+
const {
|
159
|
+
value: t,
|
160
|
+
onChange: d,
|
161
|
+
placeholder: r,
|
162
|
+
disabled: n,
|
163
|
+
searchLabel: s = "Type to search...",
|
164
|
+
fetchOptions: u,
|
165
|
+
options: p,
|
166
|
+
emptyLabel: a = "No options",
|
167
|
+
emptyAction: h,
|
168
|
+
onMount: P
|
169
|
+
} = i, N = W(!1), [f, C] = g.useState(!1), [x, T] = g.useState(""), [S, y] = g.useState([]), [O, k] = g.useState(), [D, b] = g.useState(!1);
|
170
|
+
X(() => {
|
171
|
+
p != null && p.length && y(p);
|
172
|
+
}, [p]);
|
173
|
+
const R = async () => {
|
174
|
+
f || (E(), T(""));
|
175
|
+
}, E = v(async (o) => {
|
176
|
+
b(!0);
|
177
|
+
try {
|
178
|
+
const L = await u(o);
|
179
|
+
y(L);
|
180
|
+
} catch (L) {
|
181
|
+
console.error("Unexpected error while get option:", L);
|
182
|
+
} finally {
|
183
|
+
b(!1);
|
184
|
+
}
|
185
|
+
}, []), q = re(E, 1e3, {
|
186
|
+
leading: !1,
|
187
|
+
trailing: !0
|
188
|
+
}), B = v((o) => {
|
189
|
+
b(!0), T(o), q(o);
|
190
|
+
}, []), z = v((o) => {
|
191
|
+
d(o.value), k(o), b(!1);
|
192
|
+
}, []), G = v(() => {
|
193
|
+
z({ value: "", label: "" }), k(void 0), b(!1);
|
194
|
+
}, []), U = v(() => {
|
195
|
+
if (!P) {
|
196
|
+
N.current = !0;
|
197
|
+
return;
|
198
|
+
}
|
199
|
+
P({ setOptions: y, search: x || "", open: f, setOpen: C }).finally(
|
200
|
+
() => {
|
201
|
+
N.current = !0;
|
202
|
+
}
|
203
|
+
);
|
204
|
+
}, []);
|
205
|
+
return H(() => (U(), () => {
|
206
|
+
N.current = !1;
|
207
|
+
}), []), /* @__PURE__ */ e("div", { className: "w-full", ref: l, children: /* @__PURE__ */ m(
|
208
|
+
K,
|
209
|
+
{
|
210
|
+
open: f,
|
211
|
+
onOpenChange: (o) => {
|
212
|
+
C(o), o && R();
|
213
|
+
},
|
214
|
+
children: [
|
215
|
+
/* @__PURE__ */ e(Q, { asChild: !0, className: "border-input", children: /* @__PURE__ */ m(
|
216
|
+
_,
|
217
|
+
{
|
218
|
+
variant: "outline",
|
219
|
+
role: "combobox",
|
220
|
+
size: "lg",
|
221
|
+
"aria-expanded": f,
|
222
|
+
className: c(
|
223
|
+
"w-full justify-between font-normal text-sm border bg-transparent relative p-3",
|
224
|
+
f ? "border-2 border-sidebar-accent" : "border-border"
|
225
|
+
),
|
226
|
+
disabled: n,
|
227
|
+
children: [
|
228
|
+
/* @__PURE__ */ e("span", { className: "truncate max-w-[calc(100%-1.5rem)] overflow-hidden whitespace-nowrap", children: t ? ((j = S.find((o) => o.value === t)) == null ? void 0 : j.label) || (O == null ? void 0 : O.label) : /* @__PURE__ */ e("span", { className: "text-gray-400", children: r }) }),
|
229
|
+
t ? /* @__PURE__ */ e(
|
230
|
+
"div",
|
231
|
+
{
|
232
|
+
className: c(
|
233
|
+
"absolute top-0 right-1",
|
234
|
+
"flex items-center justify-center",
|
235
|
+
"w-9 aspect-square [&_svg]:size-5",
|
236
|
+
"opacity-50 cursor-pointer hover:opacity-100"
|
237
|
+
),
|
238
|
+
onClick: (o) => {
|
239
|
+
o.stopPropagation(), G();
|
240
|
+
},
|
241
|
+
children: /* @__PURE__ */ e(ne, {})
|
242
|
+
}
|
243
|
+
) : /* @__PURE__ */ e(le, { className: "opacity-50 w-4 h-4" })
|
244
|
+
]
|
245
|
+
}
|
246
|
+
) }),
|
247
|
+
/* @__PURE__ */ e(
|
248
|
+
Y,
|
249
|
+
{
|
250
|
+
className: "w-[var(--radix-popper-anchor-width)] max-w-none p-0",
|
251
|
+
align: "start",
|
252
|
+
children: /* @__PURE__ */ m($, { shouldFilter: !1, children: [
|
253
|
+
/* @__PURE__ */ e(
|
254
|
+
ee,
|
255
|
+
{
|
256
|
+
placeholder: s,
|
257
|
+
value: x,
|
258
|
+
onValueChange: B
|
259
|
+
}
|
260
|
+
),
|
261
|
+
/* @__PURE__ */ e(te, { children: /* @__PURE__ */ m(
|
262
|
+
oe,
|
263
|
+
{
|
264
|
+
className: c(!S.length && "p-0 shadow-none"),
|
265
|
+
children: [
|
266
|
+
D && /* @__PURE__ */ e(J, { fullWidth: !0 }),
|
267
|
+
!D && !!x && /* @__PURE__ */ e(A, { children: h ? /* @__PURE__ */ m(F, { className: "flex flex-col gap-3 py-5 px-3 items-center", children: [
|
268
|
+
/* @__PURE__ */ e("span", { children: a }),
|
269
|
+
typeof h == "function" ? h({
|
270
|
+
setOptions: y,
|
271
|
+
search: x || "",
|
272
|
+
open: f,
|
273
|
+
setOpen: C
|
274
|
+
}) : h
|
275
|
+
] }) : /* @__PURE__ */ e(F, { children: a }) }),
|
276
|
+
!D && /* @__PURE__ */ e(
|
277
|
+
de,
|
278
|
+
{
|
279
|
+
value: t,
|
280
|
+
options: S,
|
281
|
+
onChangeOption: z,
|
282
|
+
setOpen: C
|
283
|
+
}
|
284
|
+
)
|
285
|
+
]
|
286
|
+
}
|
287
|
+
) })
|
288
|
+
] })
|
289
|
+
}
|
290
|
+
)
|
291
|
+
]
|
292
|
+
}
|
293
|
+
) });
|
294
|
+
}
|
295
|
+
);
|
296
|
+
export {
|
297
|
+
St as C,
|
298
|
+
I as a,
|
299
|
+
M as b,
|
300
|
+
de as c
|
301
|
+
};
|
package/Command/Command.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { DialogProps } from '@radix-ui/react-dialog';
|
2
|
-
import * as React from
|
2
|
+
import * as React from 'react';
|
3
3
|
declare const Command: React.ForwardRefExoticComponent<Omit<{
|
4
4
|
children?: React.ReactNode;
|
5
5
|
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
package/Command/Command.mjs
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
import { jsx as
|
1
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
2
2
|
import * as m from "react";
|
3
|
-
import { Command as
|
3
|
+
import { Command as t } from "cmdk";
|
4
4
|
import { Search as p } from "lucide-react";
|
5
5
|
import { cn as r } from "@oneplatformdev/utils";
|
6
|
-
import { Dialog as i, DialogContent as
|
7
|
-
const n = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */
|
8
|
-
|
6
|
+
import { Dialog as i, DialogContent as l } from "../Dialog/Dialog.mjs";
|
7
|
+
const n = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ o(
|
8
|
+
t,
|
9
9
|
{
|
10
10
|
ref: d,
|
11
11
|
className: r(
|
@@ -15,11 +15,11 @@ const n = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ t(
|
|
15
15
|
...a
|
16
16
|
}
|
17
17
|
));
|
18
|
-
n.displayName =
|
19
|
-
const C = ({ children: e, ...a }) => /* @__PURE__ */
|
20
|
-
/* @__PURE__ */
|
21
|
-
/* @__PURE__ */
|
22
|
-
|
18
|
+
n.displayName = t.displayName;
|
19
|
+
const C = ({ children: e, ...a }) => /* @__PURE__ */ o(i, { ...a, children: /* @__PURE__ */ o(l, { className: "overflow-hidden p-0", children: /* @__PURE__ */ o(n, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: e }) }) }), c = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ s("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
20
|
+
/* @__PURE__ */ o(p, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
21
|
+
/* @__PURE__ */ o(
|
22
|
+
t.Input,
|
23
23
|
{
|
24
24
|
ref: d,
|
25
25
|
className: r(
|
@@ -30,27 +30,27 @@ const C = ({ children: e, ...a }) => /* @__PURE__ */ t(i, { ...a, children: /* @
|
|
30
30
|
}
|
31
31
|
)
|
32
32
|
] }));
|
33
|
-
|
34
|
-
const u = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */
|
35
|
-
|
33
|
+
c.displayName = t.Input.displayName;
|
34
|
+
const u = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ o(
|
35
|
+
t.List,
|
36
36
|
{
|
37
37
|
ref: d,
|
38
38
|
className: r("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
|
39
39
|
...a
|
40
40
|
}
|
41
41
|
));
|
42
|
-
u.displayName =
|
43
|
-
const f = m.forwardRef((e, a) => /* @__PURE__ */
|
44
|
-
|
42
|
+
u.displayName = t.List.displayName;
|
43
|
+
const f = m.forwardRef((e, a) => /* @__PURE__ */ o(
|
44
|
+
t.Empty,
|
45
45
|
{
|
46
46
|
ref: a,
|
47
47
|
className: "py-6 text-center text-sm",
|
48
48
|
...e
|
49
49
|
}
|
50
50
|
));
|
51
|
-
f.displayName =
|
52
|
-
const g = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */
|
53
|
-
|
51
|
+
f.displayName = t.Empty.displayName;
|
52
|
+
const g = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ o(
|
53
|
+
t.Group,
|
54
54
|
{
|
55
55
|
ref: d,
|
56
56
|
className: r(
|
@@ -60,32 +60,39 @@ const g = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ t(
|
|
60
60
|
...a
|
61
61
|
}
|
62
62
|
));
|
63
|
-
g.displayName =
|
64
|
-
const x = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */
|
65
|
-
|
63
|
+
g.displayName = t.Group.displayName;
|
64
|
+
const x = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ o(
|
65
|
+
t.Separator,
|
66
66
|
{
|
67
67
|
ref: d,
|
68
68
|
className: r("-mx-1 h-px bg-border", e),
|
69
69
|
...a
|
70
70
|
}
|
71
71
|
));
|
72
|
-
x.displayName =
|
73
|
-
const h = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */
|
74
|
-
|
72
|
+
x.displayName = t.Separator.displayName;
|
73
|
+
const h = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ o(
|
74
|
+
t.Item,
|
75
75
|
{
|
76
76
|
ref: d,
|
77
77
|
className: r(
|
78
|
-
"relative flex
|
78
|
+
"relative flex gap-2 select-none items-center rounded-sm",
|
79
|
+
"min-h-8 px-2 py-1",
|
80
|
+
"[&>span]:py-1",
|
81
|
+
"text-sm text-[#666A78] font-medium leading-[1.12]",
|
82
|
+
"data-[selected=true]:bg-accent",
|
83
|
+
"data-[selected=true]:text-[#191F35] hover:text-[#191F35]",
|
84
|
+
"outline-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
85
|
+
"cursor-pointer",
|
79
86
|
e
|
80
87
|
),
|
81
88
|
...a
|
82
89
|
}
|
83
90
|
));
|
84
|
-
h.displayName =
|
91
|
+
h.displayName = t.Item.displayName;
|
85
92
|
const y = ({
|
86
93
|
className: e,
|
87
94
|
...a
|
88
|
-
}) => /* @__PURE__ */
|
95
|
+
}) => /* @__PURE__ */ o(
|
89
96
|
"span",
|
90
97
|
{
|
91
98
|
className: r(
|
@@ -101,7 +108,7 @@ export {
|
|
101
108
|
C as CommandDialog,
|
102
109
|
f as CommandEmpty,
|
103
110
|
g as CommandGroup,
|
104
|
-
|
111
|
+
c as CommandInput,
|
105
112
|
h as CommandItem,
|
106
113
|
u as CommandList,
|
107
114
|
x as CommandSeparator,
|
package/DataTable/DataTable.d.ts
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import { default as React, FC } from 'react';
|
2
|
+
import { Table as ReactTable } from '@tanstack/react-table';
|
3
3
|
|
4
|
-
|
4
|
+
interface IProps {
|
5
|
+
table: ReactTable<any>;
|
6
|
+
ToolBar?: React.ReactNode;
|
7
|
+
tColumns?: string;
|
8
|
+
tNoResults?: string;
|
9
|
+
}
|
10
|
+
export declare const DataTable: FC<IProps>;
|
11
|
+
export {};
|
package/DataTable/DataTable.mjs
CHANGED
@@ -1,28 +1,28 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import {
|
3
|
-
import { ChevronDown as u } from "lucide-react";
|
4
|
-
import { Button as p } from "../Button/Button.mjs";
|
1
|
+
import { jsxs as i, jsx as l } from "react/jsx-runtime";
|
2
|
+
import { Button as h } from "../Button/Button.mjs";
|
5
3
|
import "../Button/buttonVariants.mjs";
|
6
|
-
import { DropdownMenu as
|
7
|
-
import { Table as
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
4
|
+
import { DropdownMenu as p, DropdownMenuTrigger as g, DropdownMenuContent as u, DropdownMenuCheckboxItem as C } from "../DropdownMenu/DropdownMenu.mjs";
|
5
|
+
import { Table as f, TableHeader as w, TableRow as t, TableHead as x, TableBody as b, TableCell as d } from "../Table/Table.mjs";
|
6
|
+
import { flexRender as a } from "@tanstack/react-table";
|
7
|
+
import { ChevronDown as D } from "lucide-react";
|
8
|
+
const y = ({
|
9
|
+
table: r,
|
10
|
+
ToolBar: s,
|
11
|
+
tColumns: c = "Columns",
|
12
|
+
tNoResults: m = "No results"
|
13
|
+
}) => {
|
14
|
+
var o;
|
15
|
+
return /* @__PURE__ */ i("div", { className: "w-full", children: [
|
16
|
+
/* @__PURE__ */ i("div", { className: "flex items-center py-4", children: [
|
17
|
+
s,
|
18
|
+
/* @__PURE__ */ i(p, { children: [
|
19
|
+
/* @__PURE__ */ l(g, { asChild: !0, children: /* @__PURE__ */ i(h, { variant: "outline", className: "ml-auto", children: [
|
20
|
+
c,
|
21
|
+
" ",
|
22
|
+
/* @__PURE__ */ l(D, { className: "ml-2 h-4 w-4" })
|
23
23
|
] }) }),
|
24
|
-
/* @__PURE__ */ l(
|
25
|
-
|
24
|
+
/* @__PURE__ */ l(u, { align: "end", children: r.getAllColumns().filter((e) => e.getCanHide()).map((e) => /* @__PURE__ */ l(
|
25
|
+
C,
|
26
26
|
{
|
27
27
|
className: "capitalize",
|
28
28
|
checked: e.getIsVisible(),
|
@@ -33,32 +33,32 @@ const B = (s) => {
|
|
33
33
|
)) })
|
34
34
|
] })
|
35
35
|
] }),
|
36
|
-
/* @__PURE__ */ l("div", { className: "rounded-md border", children: /* @__PURE__ */
|
37
|
-
/* @__PURE__ */ l(
|
36
|
+
/* @__PURE__ */ l("div", { className: "rounded-md border", children: /* @__PURE__ */ i(f, { children: [
|
37
|
+
/* @__PURE__ */ l(w, { children: r.getHeaderGroups().map((e) => /* @__PURE__ */ l(t, { children: e.headers.map((n) => /* @__PURE__ */ l(x, { children: n.isPlaceholder ? null : a(
|
38
38
|
n.column.columnDef.header,
|
39
39
|
n.getContext()
|
40
40
|
) }, n.id)) }, e.id)) }),
|
41
|
-
/* @__PURE__ */ l(
|
42
|
-
|
41
|
+
/* @__PURE__ */ l(b, { children: (o = r.getRowModel().rows) != null && o.length ? r.getRowModel().rows.map((e) => /* @__PURE__ */ l(
|
42
|
+
t,
|
43
43
|
{
|
44
44
|
"data-state": e.getIsSelected() && "selected",
|
45
|
-
children: e.getVisibleCells().map((n) => /* @__PURE__ */ l(
|
45
|
+
children: e.getVisibleCells().map((n) => /* @__PURE__ */ l(d, { children: a(
|
46
46
|
n.column.columnDef.cell,
|
47
47
|
n.getContext()
|
48
48
|
) }, n.id))
|
49
49
|
},
|
50
50
|
e.id
|
51
|
-
)) : /* @__PURE__ */ l(
|
52
|
-
|
51
|
+
)) : /* @__PURE__ */ l(t, { children: /* @__PURE__ */ l(
|
52
|
+
d,
|
53
53
|
{
|
54
|
-
colSpan:
|
54
|
+
colSpan: r.getAllColumns().length,
|
55
55
|
className: "h-24 text-center",
|
56
|
-
children:
|
56
|
+
children: m
|
57
57
|
}
|
58
58
|
) }) })
|
59
59
|
] }) })
|
60
60
|
] });
|
61
61
|
};
|
62
62
|
export {
|
63
|
-
|
63
|
+
y as DataTable
|
64
64
|
};
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { jsx as n, jsxs as t } from "react/jsx-runtime";
|
2
|
+
import { ChevronDown as m } from "lucide-react";
|
3
|
+
import { useMemo as s } from "react";
|
4
|
+
import { Button as d } from "../Button/Button.mjs";
|
5
|
+
import "../Button/buttonVariants.mjs";
|
6
|
+
import { DropdownMenuCheckboxItem as c, DropdownMenu as u, DropdownMenuTrigger as h, DropdownMenuContent as p } from "../DropdownMenu/DropdownMenu.mjs";
|
7
|
+
const x = (i) => {
|
8
|
+
const {
|
9
|
+
table: r,
|
10
|
+
columnsLabel: l = "Columns"
|
11
|
+
} = i, o = s(() => r.getAllColumns().filter((e) => e.getCanHide()).map((e) => /* @__PURE__ */ n(
|
12
|
+
c,
|
13
|
+
{
|
14
|
+
className: "capitalize",
|
15
|
+
checked: e.getIsVisible(),
|
16
|
+
onCheckedChange: (a) => e.toggleVisibility(!!a),
|
17
|
+
children: e.id
|
18
|
+
},
|
19
|
+
e.id
|
20
|
+
)), [r]);
|
21
|
+
return o.length ? /* @__PURE__ */ t(u, { children: [
|
22
|
+
/* @__PURE__ */ n(h, { asChild: !0, children: /* @__PURE__ */ t(d, { variant: "outline", className: "ml-auto", children: [
|
23
|
+
l,
|
24
|
+
/* @__PURE__ */ n(m, { className: "ml-2 h-4 w-4" })
|
25
|
+
] }) }),
|
26
|
+
/* @__PURE__ */ n(p, { align: "end", children: o })
|
27
|
+
] }) : null;
|
28
|
+
};
|
29
|
+
export {
|
30
|
+
x as DataTableColumnFilter
|
31
|
+
};
|
@@ -669,7 +669,7 @@ const J = (t, e, n) => {
|
|
669
669
|
disabled: i,
|
670
670
|
variant: "outline",
|
671
671
|
className: C(
|
672
|
-
"w-full justify-start text-left font-normal border-
|
672
|
+
"w-full justify-start text-left font-normal border h-10",
|
673
673
|
!n && "text-muted-foreground"
|
674
674
|
),
|
675
675
|
children: [
|
@@ -678,7 +678,7 @@ const J = (t, e, n) => {
|
|
678
678
|
]
|
679
679
|
}
|
680
680
|
) }),
|
681
|
-
/* @__PURE__ */ d(L, { align: "start", className: "
|
681
|
+
/* @__PURE__ */ d(L, { align: "start", className: "w-auto p-0", children: /* @__PURE__ */ d(
|
682
682
|
O,
|
683
683
|
{
|
684
684
|
mode: "single",
|
package/Dialog/Dialog.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as React from
|
2
|
-
import * as DialogPrimitive from
|
1
|
+
import * as React from 'react';
|
2
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
3
3
|
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
4
4
|
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
5
5
|
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|