@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.
Files changed (128) hide show
  1. package/Accordion/Accordion.d.ts +2 -2
  2. package/Accordion/Accordion.mjs +23 -20
  3. package/AlertDialog/AlertDialogRoot.d.ts +2 -2
  4. package/AlertDialog/AlertDialogRoot.mjs +7 -7
  5. package/Button/Button.mjs +11 -10
  6. package/Button/buttonVariants.mjs +5 -5
  7. package/Calendar/Calendar.mjs +3 -2
  8. package/Checkbox/Checkbox.d.ts +5 -4
  9. package/Checkbox/Checkbox.mjs +48 -21
  10. package/Checkbox/Checkbox.types.d.ts +10 -0
  11. package/Checkbox/index.d.ts +1 -0
  12. package/Checkbox/index.mjs +3 -2
  13. package/Combobox/Combobox.d.ts +2 -2
  14. package/Combobox/Combobox.mjs +12 -123
  15. package/Combobox/Combobox.types.d.ts +24 -1
  16. package/Combobox/ComboboxOptionItem.d.ts +5 -0
  17. package/Combobox/ComboboxOptionItem.mjs +67 -0
  18. package/Combobox/ComboboxOptions.d.ts +4 -0
  19. package/Combobox/ComboboxOptions.mjs +12 -0
  20. package/Combobox/index.mjs +1 -1
  21. package/Combobox-DpcCpN3b.js +301 -0
  22. package/Command/Command.d.ts +1 -1
  23. package/Command/Command.mjs +36 -29
  24. package/DataTable/DataTable.d.ts +10 -3
  25. package/DataTable/DataTable.mjs +33 -33
  26. package/DataTable/DataTableColumnFilter.d.ts +4 -0
  27. package/DataTable/DataTableColumnFilter.mjs +31 -0
  28. package/DatePicker/DatePicker.mjs +2 -2
  29. package/Dialog/Dialog.d.ts +2 -2
  30. package/Dialog/Dialog.mjs +16 -13
  31. package/DropdownMenu/DropdownMenu.d.ts +2 -2
  32. package/DropdownMenu/DropdownMenu.mjs +30 -26
  33. package/Dropzone/Dropzone.d.ts +22 -0
  34. package/Dropzone/Dropzone.mjs +151 -0
  35. package/Dropzone/Dropzone.types.d.ts +38 -0
  36. package/Dropzone/DropzoneFilePreview.d.ts +4 -0
  37. package/Dropzone/DropzoneFilePreview.mjs +9 -0
  38. package/Dropzone/DropzoneSinglePickPreview.d.ts +9 -0
  39. package/Dropzone/DropzoneSinglePickPreview.mjs +38 -0
  40. package/Dropzone/DropzoneUtils.d.ts +5 -0
  41. package/Dropzone/DropzoneUtils.mjs +24 -0
  42. package/Dropzone/index.d.ts +2 -0
  43. package/Dropzone/index.mjs +7 -0
  44. package/Dropzone/package.json +7 -0
  45. package/DropzoneFilePreview-Dhtv8F4u.js +67 -0
  46. package/Form/Form.d.ts +2 -2
  47. package/Form/Form.mjs +48 -45
  48. package/Form/FormRenderControl.d.ts +2 -3
  49. package/Form/FormRenderControl.mjs +10 -10
  50. package/Form/FormRenderControl.types.d.ts +5 -7
  51. package/FormCheckbox/FormCheckbox.d.ts +2 -3
  52. package/FormCheckbox/FormCheckbox.mjs +23 -23
  53. package/FormCheckbox/FormCheckbox.types.d.ts +3 -3
  54. package/FormCombobox/FormCombobox.d.ts +2 -2
  55. package/FormCombobox/FormCombobox.mjs +6 -6
  56. package/FormCombobox/FormCombobox.types.d.ts +2 -3
  57. package/FormDatePicker/FormDatePicker.d.ts +2 -2
  58. package/FormDatePicker/FormDatePicker.mjs +20 -18
  59. package/FormDatePicker/FormDatePicker.types.d.ts +2 -3
  60. package/FormDropzone/FormDropzone.d.ts +4 -0
  61. package/FormDropzone/FormDropzone.mjs +19 -0
  62. package/FormDropzone/FormDropzone.types.d.ts +6 -0
  63. package/FormDropzone/index.d.ts +2 -0
  64. package/FormDropzone/index.mjs +4 -0
  65. package/FormDropzone/package.json +7 -0
  66. package/FormInput/FormInput.d.ts +5 -3
  67. package/FormInput/FormInput.mjs +32 -18
  68. package/FormInput/FormInput.types.d.ts +2 -3
  69. package/FormRadio/FormRadio.d.ts +4 -0
  70. package/FormRadio/FormRadio.mjs +40 -0
  71. package/FormRadio/FormRadio.types.d.ts +6 -0
  72. package/FormRadio/index.d.ts +2 -0
  73. package/FormRadio/index.mjs +4 -0
  74. package/FormRadio/package.json +7 -0
  75. package/FormSelect/FormSelect.d.ts +2 -3
  76. package/FormSelect/FormSelect.mjs +19 -17
  77. package/FormSelect/FormSelect.types.d.ts +2 -3
  78. package/FormTextarea/FormTextarea.d.ts +2 -3
  79. package/FormTextarea/FormTextarea.mjs +13 -12
  80. package/FormTextarea/FormTextarea.types.d.ts +2 -3
  81. package/Input/Input.mjs +40 -34
  82. package/Input/Input.types.d.ts +4 -1
  83. package/Input/inputVariants.mjs +9 -3
  84. package/Label/Label.d.ts +2 -2
  85. package/Label/labelVariants.mjs +7 -4
  86. package/LazyLoader/LazyLoader.mjs +5 -4
  87. package/LoadingMask/LoadingMask.d.ts +4 -1
  88. package/LoadingMask/LoadingMask.mjs +18 -56
  89. package/LoadingMask/LoadingMask.types.d.ts +5 -0
  90. package/LoadingMask/RenderLoadingMask.d.ts +3 -0
  91. package/LoadingMask/RenderLoadingMask.mjs +108 -0
  92. package/LoadingMask/index.d.ts +2 -0
  93. package/LoadingMask/index.mjs +4 -2
  94. package/Radio/Radio.d.ts +4 -0
  95. package/Radio/Radio.mjs +12 -0
  96. package/Radio/Radio.types.d.ts +11 -0
  97. package/Radio/index.d.ts +2 -0
  98. package/Radio/index.mjs +4 -0
  99. package/Radio/package.json +7 -0
  100. package/RadioGroup/RadioGroup.d.ts +9 -3
  101. package/RadioGroup/RadioGroup.mjs +37 -19
  102. package/RadioGroup/index.mjs +4 -3
  103. package/ScrollArea/ScrollArea.d.ts +2 -2
  104. package/ScrollArea/ScrollArea.mjs +26 -13
  105. package/Select/Select.mjs +93 -63
  106. package/Select/Select.types.d.ts +9 -2
  107. package/Select/SelectRoot.d.ts +2 -2
  108. package/Select/SelectRoot.mjs +1 -0
  109. package/TablePagination/TablePagination.d.ts +16 -0
  110. package/TablePagination/TablePagination.mjs +74 -0
  111. package/TablePagination/index.d.ts +1 -0
  112. package/TablePagination/index.mjs +4 -0
  113. package/TablePagination/package.json +7 -0
  114. package/Tabs/Tabs.d.ts +3 -2
  115. package/Tabs/Tabs.mjs +20 -6
  116. package/Tabs/Tabs.types.d.ts +5 -2
  117. package/Tabs/index.mjs +8 -7
  118. package/Textarea/Textarea.d.ts +1 -1
  119. package/Textarea/Textarea.mjs +71 -15
  120. package/Textarea/Textarea.types.d.ts +16 -2
  121. package/Textarea/useAutosizeTextArea.d.ts +3 -0
  122. package/Textarea/useAutosizeTextArea.mjs +20 -0
  123. package/Toast/toastVariants.mjs +3 -3
  124. package/index.css +1 -1
  125. package/index.d.ts +3 -0
  126. package/index.mjs +332 -318
  127. package/package.json +9 -8
  128. 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
+ };
@@ -1,5 +1,5 @@
1
1
  import { DialogProps } from '@radix-ui/react-dialog';
2
- import * as React from "react";
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>> & {
@@ -1,11 +1,11 @@
1
- import { jsx as t, jsxs as s } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
2
2
  import * as m from "react";
3
- import { Command as o } from "cmdk";
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 c } from "../Dialog/Dialog.mjs";
7
- const n = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ t(
8
- o,
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 = o.displayName;
19
- const C = ({ children: e, ...a }) => /* @__PURE__ */ t(i, { ...a, children: /* @__PURE__ */ t(c, { className: "overflow-hidden p-0", children: /* @__PURE__ */ t(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 }) }) }), l = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ s("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
20
- /* @__PURE__ */ t(p, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
21
- /* @__PURE__ */ t(
22
- o.Input,
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
- l.displayName = o.Input.displayName;
34
- const u = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ t(
35
- o.List,
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 = o.List.displayName;
43
- const f = m.forwardRef((e, a) => /* @__PURE__ */ t(
44
- o.Empty,
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 = o.Empty.displayName;
52
- const g = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ t(
53
- o.Group,
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 = o.Group.displayName;
64
- const x = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ t(
65
- o.Separator,
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 = o.Separator.displayName;
73
- const h = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ t(
74
- o.Item,
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 cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
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 = o.Item.displayName;
91
+ h.displayName = t.Item.displayName;
85
92
  const y = ({
86
93
  className: e,
87
94
  ...a
88
- }) => /* @__PURE__ */ t(
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
- l as CommandInput,
111
+ c as CommandInput,
105
112
  h as CommandItem,
106
113
  u as CommandList,
107
114
  x as CommandSeparator,
@@ -1,4 +1,11 @@
1
- import { DataTableProps } from './DataTable.types';
2
- import { FC } from 'react';
1
+ import { default as React, FC } from 'react';
2
+ import { Table as ReactTable } from '@tanstack/react-table';
3
3
 
4
- export declare const DataTable: FC<DataTableProps>;
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 {};
@@ -1,28 +1,28 @@
1
- import { jsxs as r, jsx as l } from "react/jsx-runtime";
2
- import { flexRender as d } from "@tanstack/react-table";
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 g, DropdownMenuTrigger as b, DropdownMenuContent as C, DropdownMenuCheckboxItem as f } from "../DropdownMenu/DropdownMenu.mjs";
7
- import { Table as w, TableHeader as x, TableRow as o, TableHead as T, TableBody as D, TableCell as a } from "../Table/Table.mjs";
8
- const B = (s) => {
9
- var i;
10
- const {
11
- table: t,
12
- ToolBar: c,
13
- columnsLabel: m = "Columns",
14
- noResultLabel: h = "No results"
15
- } = s;
16
- return /* @__PURE__ */ r("div", { className: "w-full", children: [
17
- /* @__PURE__ */ r("div", { className: "flex items-center py-4", children: [
18
- c,
19
- /* @__PURE__ */ r(g, { children: [
20
- /* @__PURE__ */ l(b, { asChild: !0, children: /* @__PURE__ */ r(p, { variant: "outline", className: "ml-auto", children: [
21
- m,
22
- /* @__PURE__ */ l(u, { className: "ml-2 h-4 w-4" })
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(C, { align: "end", children: t.getAllColumns().filter((e) => e.getCanHide()).map((e) => /* @__PURE__ */ l(
25
- f,
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__ */ r(w, { children: [
37
- /* @__PURE__ */ l(x, { children: t.getHeaderGroups().map((e) => /* @__PURE__ */ l(o, { children: e.headers.map((n) => /* @__PURE__ */ l(T, { children: n.isPlaceholder ? null : d(
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(D, { children: (i = t.getRowModel().rows) != null && i.length ? t.getRowModel().rows.map((e) => /* @__PURE__ */ l(
42
- o,
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(a, { children: d(
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(o, { children: /* @__PURE__ */ l(
52
- a,
51
+ )) : /* @__PURE__ */ l(t, { children: /* @__PURE__ */ l(
52
+ d,
53
53
  {
54
- colSpan: t.getAllColumns().length,
54
+ colSpan: r.getAllColumns().length,
55
55
  className: "h-24 text-center",
56
- children: h
56
+ children: m
57
57
  }
58
58
  ) }) })
59
59
  ] }) })
60
60
  ] });
61
61
  };
62
62
  export {
63
- B as DataTable
63
+ y as DataTable
64
64
  };
@@ -0,0 +1,4 @@
1
+ import { DataTableProps } from './DataTable.types';
2
+ import { FC } from 'react';
3
+
4
+ export declare const DataTableColumnFilter: FC<DataTableProps>;
@@ -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-blue-300",
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: " w-auto p-0", children: /* @__PURE__ */ d(
681
+ /* @__PURE__ */ d(L, { align: "start", className: "w-auto p-0", children: /* @__PURE__ */ d(
682
682
  O,
683
683
  {
684
684
  mode: "single",
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
- import * as DialogPrimitive from "@radix-ui/react-dialog";
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>;