@oneplatformdev/ui 0.0.1-beta.11 → 0.0.1-beta.110

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 (143) hide show
  1. package/Accordion/Accordion.d.ts +5 -3
  2. package/Accordion/Accordion.mjs +27 -24
  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 +14 -8
  7. package/Calendar/Calendar.mjs +3 -2
  8. package/Card/Card.d.ts +1 -1
  9. package/Card/Card.mjs +24 -23
  10. package/Checkbox/Checkbox.d.ts +5 -4
  11. package/Checkbox/Checkbox.mjs +48 -21
  12. package/Checkbox/Checkbox.types.d.ts +10 -0
  13. package/Checkbox/index.d.ts +1 -0
  14. package/Checkbox/index.mjs +3 -2
  15. package/Combobox/Combobox.d.ts +2 -2
  16. package/Combobox/Combobox.mjs +12 -123
  17. package/Combobox/Combobox.types.d.ts +36 -1
  18. package/Combobox/ComboboxOptionItem.d.ts +5 -0
  19. package/Combobox/ComboboxOptionItem.mjs +68 -0
  20. package/Combobox/ComboboxOptions.d.ts +4 -0
  21. package/Combobox/ComboboxOptions.mjs +12 -0
  22. package/Combobox/index.mjs +1 -1
  23. package/Combobox-BzFTeSHQ.js +324 -0
  24. package/Command/Command.d.ts +1 -1
  25. package/Command/Command.mjs +36 -29
  26. package/DataTable/DataTable.d.ts +10 -3
  27. package/DataTable/DataTable.mjs +33 -33
  28. package/DataTable/DataTableColumnFilter.d.ts +4 -0
  29. package/DataTable/DataTableColumnFilter.mjs +31 -0
  30. package/DatePicker/DatePicker.mjs +2 -2
  31. package/Dialog/Dialog.d.ts +5 -3
  32. package/Dialog/Dialog.mjs +44 -27
  33. package/DropdownMenu/DropdownMenu.d.ts +2 -2
  34. package/DropdownMenu/DropdownMenu.mjs +30 -26
  35. package/Dropzone/Dropzone.d.ts +16 -10
  36. package/Dropzone/Dropzone.mjs +146 -2915
  37. package/Dropzone/Dropzone.types.d.ts +33 -10
  38. package/Dropzone/DropzoneFilePreview.d.ts +4 -0
  39. package/Dropzone/DropzoneFilePreview.mjs +9 -0
  40. package/Dropzone/DropzoneSinglePickPreview.d.ts +10 -0
  41. package/Dropzone/DropzoneSinglePickPreview.mjs +44 -0
  42. package/Dropzone/DropzoneUtils.d.ts +5 -0
  43. package/Dropzone/DropzoneUtils.mjs +24 -0
  44. package/Dropzone/index.mjs +1 -1
  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 +37 -16
  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 +50 -38
  82. package/Input/Input.types.d.ts +6 -2
  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/LoadedIcon/LoadedIcon.d.ts +11 -0
  88. package/LoadedIcon/LoadedIcon.mjs +27 -0
  89. package/LoadedIcon/index.d.ts +1 -0
  90. package/LoadedIcon/index.mjs +4 -0
  91. package/LoadedIcon/package.json +7 -0
  92. package/LoadingMask/LoadingMask.d.ts +4 -1
  93. package/LoadingMask/LoadingMask.mjs +18 -56
  94. package/LoadingMask/LoadingMask.types.d.ts +5 -0
  95. package/LoadingMask/RenderLoadingMask.d.ts +3 -0
  96. package/LoadingMask/RenderLoadingMask.mjs +108 -0
  97. package/LoadingMask/index.d.ts +2 -0
  98. package/LoadingMask/index.mjs +4 -2
  99. package/Popover/Popover.d.ts +2 -2
  100. package/Popover/Popover.mjs +13 -9
  101. package/Radio/Radio.d.ts +4 -0
  102. package/Radio/Radio.mjs +12 -0
  103. package/Radio/Radio.types.d.ts +11 -0
  104. package/Radio/index.d.ts +2 -0
  105. package/Radio/index.mjs +4 -0
  106. package/Radio/package.json +7 -0
  107. package/RadioGroup/RadioGroup.d.ts +9 -3
  108. package/RadioGroup/RadioGroup.mjs +37 -19
  109. package/RadioGroup/index.mjs +4 -3
  110. package/ScrollArea/ScrollArea.d.ts +2 -2
  111. package/ScrollArea/ScrollArea.mjs +26 -13
  112. package/Search/Search.d.ts +1 -2
  113. package/Search/Search.mjs +31 -19
  114. package/Search/Search.types.d.ts +1 -0
  115. package/Select/Select.mjs +94 -63
  116. package/Select/Select.types.d.ts +11 -3
  117. package/Select/SelectRoot.d.ts +2 -2
  118. package/Select/SelectRoot.mjs +29 -24
  119. package/Sheet/Sheet.d.ts +5 -2
  120. package/Sheet/Sheet.mjs +33 -33
  121. package/TablePagination/TablePagination.d.ts +16 -0
  122. package/TablePagination/TablePagination.mjs +74 -0
  123. package/TablePagination/index.d.ts +1 -0
  124. package/TablePagination/index.mjs +4 -0
  125. package/TablePagination/package.json +7 -0
  126. package/Tabs/Tabs.d.ts +3 -2
  127. package/Tabs/Tabs.mjs +20 -6
  128. package/Tabs/Tabs.types.d.ts +5 -2
  129. package/Tabs/index.mjs +8 -7
  130. package/Textarea/Textarea.d.ts +1 -1
  131. package/Textarea/Textarea.mjs +72 -15
  132. package/Textarea/Textarea.types.d.ts +16 -2
  133. package/Textarea/useAutosizeTextArea.d.ts +3 -0
  134. package/Textarea/useAutosizeTextArea.mjs +20 -0
  135. package/Toast/toastVariants.mjs +3 -3
  136. package/index.css +1 -1
  137. package/index.d.ts +3 -0
  138. package/index.mjs +297 -286
  139. package/package.json +6 -6
  140. package/tailwind.config.mjs +13 -13
  141. package/Dropzone/FilePreview.d.ts +0 -15
  142. package/Dropzone/FilePreview.mjs +0 -7
  143. package/FilePreview-C6IeuOqo.js +0 -40
@@ -0,0 +1,68 @@
1
+ import "react/jsx-runtime";
2
+ import "react";
3
+ import "../Accordion/Accordion.mjs";
4
+ import "../Alert/Alert.mjs";
5
+ import "../AlertDialog/AlertDialogRoot.mjs";
6
+ import "@oneplatformdev/utils";
7
+ import "recharts";
8
+ import "../Chart/Chart.mjs";
9
+ import "../Sidebar/Sidebar.mjs";
10
+ import "@radix-ui/react-aspect-ratio";
11
+ import "../Avatar/Avatar.mjs";
12
+ import "../Badge/badgeVariants.mjs";
13
+ import "../Breadcrumb/Breadcrumb.mjs";
14
+ import "../Button/Button.mjs";
15
+ import "../Button/buttonVariants.mjs";
16
+ import "../ButtonIcon/ButtonIcon.mjs";
17
+ import "../ButtonIcon/buttonIconVariants.mjs";
18
+ import "../Calendar/Calendar.mjs";
19
+ import "../Card/Card.mjs";
20
+ import "../Carousel/Carousel.mjs";
21
+ import "../Checkbox/Checkbox.mjs";
22
+ import "@radix-ui/react-collapsible";
23
+ import { a as so } from "../Combobox-BzFTeSHQ.js";
24
+ import "../Command/Command.mjs";
25
+ import "../DropdownMenu/DropdownMenu.mjs";
26
+ import "../Table/Table.mjs";
27
+ import "@tanstack/react-table";
28
+ import "lucide-react";
29
+ import "../DatePicker/DatePicker.mjs";
30
+ import "../Dialog/Dialog.mjs";
31
+ import "../Drawer/Drawer.mjs";
32
+ import "../Form/Form.mjs";
33
+ import "../FormInput/FormInput.mjs";
34
+ import "../Select/SelectRoot.mjs";
35
+ import "../Textarea/Textarea.mjs";
36
+ import "../Separator/Separator.mjs";
37
+ import "../HoverCard/HoverCard.mjs";
38
+ import "../Input/Input.mjs";
39
+ import "../InputOTP/InputOTP.mjs";
40
+ import "../Label/Label.mjs";
41
+ import "../Label/labelVariants.mjs";
42
+ import "../LoadingMask/RenderLoadingMask.mjs";
43
+ import "../LoadedIcon/LoadedIcon.mjs";
44
+ import "../LoadingProgress/loadingProgressVariants.mjs";
45
+ import "../Menubar/Menubar.mjs";
46
+ import "../NavigationMenu/NavigationMenu.mjs";
47
+ import "../NavigationMenu/navigationMenuVariants.mjs";
48
+ import "../Pagination/Pagination.mjs";
49
+ import "../Popover/Popover.mjs";
50
+ import "../Progress/Progress.mjs";
51
+ import "../RadioGroup/RadioGroup.mjs";
52
+ import "react-resizable-panels";
53
+ import "../ScrollArea/ScrollArea.mjs";
54
+ import "@oneplatformdev/hooks";
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
+ export {
67
+ so as ComboboxOptionItem
68
+ };
@@ -0,0 +1,4 @@
1
+ import { IComboboxOptionsNodeProps, IComboboxOptionsProps } from './Combobox.types';
2
+
3
+ export declare const ComboboxOptionsNode: import('react').ForwardRefExoticComponent<IComboboxOptionsNodeProps & import('react').RefAttributes<HTMLDivElement>>;
4
+ export declare const ComboboxOptions: import('react').ForwardRefExoticComponent<IComboboxOptionsProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,12 @@
1
+ import "react/jsx-runtime";
2
+ import "../Button/Button.mjs";
3
+ import "../Button/buttonVariants.mjs";
4
+ import "react";
5
+ import "../Collapsible/Collapsible.mjs";
6
+ import { c as a, b as e } from "../Combobox-BzFTeSHQ.js";
7
+ import "lucide-react";
8
+ import "@oneplatformdev/utils";
9
+ export {
10
+ a as ComboboxOptions,
11
+ e as ComboboxOptionsNode
12
+ };
@@ -1,4 +1,4 @@
1
- import { Combobox as m } from "./Combobox.mjs";
1
+ import { C as m } from "../Combobox-BzFTeSHQ.js";
2
2
  export {
3
3
  m as Combobox
4
4
  };
@@ -0,0 +1,324 @@
1
+ import { jsxs as c, jsx as e, Fragment as G } from "react/jsx-runtime";
2
+ import { forwardRef as S, useState as v, useRef as Y, useEffect as Z, useCallback as x, useMemo as I, useLayoutEffect as $ } from "react";
3
+ import { LoadingMask as ee } from "./LoadingMask/LoadingMask.mjs";
4
+ import "./LoadingMask/RenderLoadingMask.mjs";
5
+ import { Popover as te, PopoverTrigger as oe, PopoverContent as re } from "./Popover/Popover.mjs";
6
+ import { Button as _ } from "./Button/Button.mjs";
7
+ import "./Button/buttonVariants.mjs";
8
+ import { CommandItem as H, Command as ne, CommandInput as ie, CommandList as ae, CommandGroup as le, CommandEmpty as R } from "./Command/Command.mjs";
9
+ import { cn as p } from "@oneplatformdev/utils";
10
+ import { useDebounceCallback as se } from "@oneplatformdev/hooks";
11
+ import { Check as ce, ChevronDownIcon as me, X as pe, ChevronsUpDown as de } from "lucide-react";
12
+ import { Collapsible as ue, CollapsibleTrigger as he, CollapsibleContent as fe } 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 "./LoadedIcon/LoadedIcon.mjs";
47
+ import "./LoadingProgress/loadingProgressVariants.mjs";
48
+ import "./Menubar/Menubar.mjs";
49
+ import "./NavigationMenu/NavigationMenu.mjs";
50
+ import "./NavigationMenu/navigationMenuVariants.mjs";
51
+ import "./Pagination/Pagination.mjs";
52
+ import "./Progress/Progress.mjs";
53
+ import "./RadioGroup/RadioGroup.mjs";
54
+ import "react-resizable-panels";
55
+ import "./ScrollArea/ScrollArea.mjs";
56
+ import "./Sheet/Sheet.mjs";
57
+ import "./Slider/Slider.mjs";
58
+ import "next-themes";
59
+ import "sonner";
60
+ import "./Switch/Switch.mjs";
61
+ import "./Tabs/TabsRoot.mjs";
62
+ import "./Toast/Toast.mjs";
63
+ import "./Toggle/Toggle.mjs";
64
+ import "./ToggleGroup/ToggleGroup.mjs";
65
+ import "./Tooltip/TooltipRoot.mjs";
66
+ import "./Dropzone/Dropzone.mjs";
67
+ const ge = 8, U = S((a, m) => {
68
+ const { children: t, setOpen: d, option: o, onChangeOption: i, value: u = "", deep: n = 0 } = a;
69
+ return /* @__PURE__ */ c(
70
+ H,
71
+ {
72
+ ref: m,
73
+ value: o.value,
74
+ onSelect: () => {
75
+ u === o.value ? i == null || i({ value: "", label: "" }) : i == null || i(o), d(!1);
76
+ },
77
+ style: {
78
+ paddingLeft: (n + 1) * ge
79
+ },
80
+ children: [
81
+ t,
82
+ /* @__PURE__ */ e(
83
+ "span",
84
+ {
85
+ className: p(
86
+ "overflow-hidden whitespace-wrap text-ellipsis line-clamp-2"
87
+ ),
88
+ children: o.label
89
+ }
90
+ ),
91
+ /* @__PURE__ */ e(
92
+ ce,
93
+ {
94
+ className: p(
95
+ "ml-auto",
96
+ u === o.value ? "opacity-100" : "opacity-0"
97
+ )
98
+ }
99
+ )
100
+ ]
101
+ },
102
+ o.value
103
+ );
104
+ }), V = S((a, m) => {
105
+ var u;
106
+ const { option: t, deep: d = 0 } = a, [o, i] = v(!0);
107
+ return (u = t == null ? void 0 : t.items) != null && u.length ? /* @__PURE__ */ c(
108
+ ue,
109
+ {
110
+ ref: m,
111
+ open: o,
112
+ onOpenChange: i,
113
+ "data-opened": o,
114
+ className: p("group/collapsible"),
115
+ children: [
116
+ /* @__PURE__ */ e(U, { ...a, children: /* @__PURE__ */ e(he, { asChild: !0, children: /* @__PURE__ */ c(
117
+ _,
118
+ {
119
+ onClick: (n) => {
120
+ n == null || n.preventDefault(), n == null || n.stopPropagation(), i((h) => !h);
121
+ },
122
+ type: "button",
123
+ variant: "ghost",
124
+ size: "sm",
125
+ className: p("aspect-square size-6", "transition-transform"),
126
+ children: [
127
+ /* @__PURE__ */ e(
128
+ me,
129
+ {
130
+ className: p(
131
+ "!size-5",
132
+ "transition-transform",
133
+ o && "rotate-180"
134
+ )
135
+ }
136
+ ),
137
+ /* @__PURE__ */ e("span", { className: "sr-only", children: "Toggle" })
138
+ ]
139
+ }
140
+ ) }) }),
141
+ /* @__PURE__ */ e(fe, { children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-0", children: t == null ? void 0 : t.items.map((n) => /* @__PURE__ */ e(
142
+ V,
143
+ {
144
+ ...a,
145
+ deep: d + 1,
146
+ option: n
147
+ },
148
+ n.value
149
+ )) }) })
150
+ ]
151
+ }
152
+ ) : /* @__PURE__ */ e(U, { ...a, ref: m });
153
+ }), be = S((a, m) => {
154
+ const { options: t = [], ...d } = a;
155
+ return /* @__PURE__ */ e("div", { ref: m, className: "flex flex-col gap-0", children: t.map((o) => /* @__PURE__ */ e(V, { ...d, option: o }, o.value)) });
156
+ }), Dt = S(
157
+ (a, m) => {
158
+ var q;
159
+ const {
160
+ value: t,
161
+ onChange: d,
162
+ placeholder: o,
163
+ disabled: i,
164
+ searchLabel: u = "Type to search...",
165
+ fetchOptions: n,
166
+ options: h,
167
+ emptyLabel: M = "No options",
168
+ emptyAction: w,
169
+ commandInputAction: L,
170
+ listHeadAction: N,
171
+ onMount: O
172
+ } = a, E = Y(!1), [g, P] = v(!1), [f, k] = v(""), [l, D] = v([]), [C, T] = v(), [s, b] = v(!1);
173
+ Z(() => {
174
+ h != null && h.length && D(h);
175
+ }, [h]);
176
+ const W = async () => {
177
+ g || (j(), k(""));
178
+ }, j = x(async (r) => {
179
+ b(!0);
180
+ try {
181
+ const z = await n(r);
182
+ D(z);
183
+ } catch (z) {
184
+ console.error("Unexpected error while get option:", z);
185
+ } finally {
186
+ b(!1);
187
+ }
188
+ }, []), X = se(j, 1e3, {
189
+ leading: !1,
190
+ trailing: !0
191
+ }), J = x((r) => {
192
+ b(!0), k(r), X(r);
193
+ }, []), B = x((r) => {
194
+ d(r.value), T(r), b(!1);
195
+ }, []), K = x(() => {
196
+ B({ value: "", label: "" }), T(void 0), b(!1);
197
+ }, []), F = I(() => !!f && !l.length && !s, [s, l.length, f]), A = I(() => !l.length && !s, [s, l.length, f]), y = I(() => ({
198
+ options: l,
199
+ setOptions: D,
200
+ selectedOption: C,
201
+ setSelectedOption: T,
202
+ search: f || "",
203
+ setSearch: k,
204
+ open: g,
205
+ setOpen: P,
206
+ loading: s,
207
+ setLoading: b,
208
+ isEmptyList: A,
209
+ isSearchedEmptyList: F
210
+ }), [s, g, l, f, C, A, F]), Q = x(() => {
211
+ if (!O) {
212
+ E.current = !0;
213
+ return;
214
+ }
215
+ O(y).finally(() => {
216
+ E.current = !0;
217
+ });
218
+ }, [y, O]);
219
+ return $(() => (Q(), () => {
220
+ E.current = !1;
221
+ }), []), /* @__PURE__ */ e("div", { className: "w-full", ref: m, children: /* @__PURE__ */ c(
222
+ te,
223
+ {
224
+ open: g,
225
+ onOpenChange: (r) => {
226
+ P(r), r && W();
227
+ },
228
+ children: [
229
+ /* @__PURE__ */ e(oe, { asChild: !0, className: "border-input", children: /* @__PURE__ */ c(
230
+ _,
231
+ {
232
+ variant: "outline",
233
+ role: "combobox",
234
+ size: "lg",
235
+ "aria-expanded": g,
236
+ className: p(
237
+ "w-full justify-between font-normal text-sm bg-transparent relative p-3",
238
+ "border border-border",
239
+ g && "border-2 outline-none ring-1 ring-ring",
240
+ "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
241
+ ),
242
+ disabled: i,
243
+ children: [
244
+ /* @__PURE__ */ e("span", { className: "truncate max-w-[calc(100%-1.5rem)] overflow-hidden whitespace-nowrap", children: t ? ((q = l.find((r) => r.value === t)) == null ? void 0 : q.label) || (C == null ? void 0 : C.label) : /* @__PURE__ */ e("span", { className: "text-gray-400", children: o }) }),
245
+ t ? /* @__PURE__ */ e(
246
+ "div",
247
+ {
248
+ className: p(
249
+ "absolute top-0 right-1",
250
+ "flex items-center justify-center",
251
+ "w-9 aspect-square [&_svg]:size-5",
252
+ "opacity-50 cursor-pointer hover:opacity-100"
253
+ ),
254
+ onClick: (r) => {
255
+ r.stopPropagation(), K();
256
+ },
257
+ children: /* @__PURE__ */ e(pe, {})
258
+ }
259
+ ) : /* @__PURE__ */ e(de, { className: "opacity-50 w-4 h-4" })
260
+ ]
261
+ }
262
+ ) }),
263
+ /* @__PURE__ */ e(
264
+ re,
265
+ {
266
+ className: "w-[var(--radix-popper-anchor-width)] max-w-none p-0",
267
+ align: "start",
268
+ children: /* @__PURE__ */ c(ne, { shouldFilter: !1, children: [
269
+ /* @__PURE__ */ e(
270
+ ie,
271
+ {
272
+ placeholder: u,
273
+ value: f,
274
+ onValueChange: J
275
+ }
276
+ ),
277
+ typeof L == "function" ? L(y) : L,
278
+ /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ c(
279
+ le,
280
+ {
281
+ className: p(!l.length && "p-0 shadow-none"),
282
+ children: [
283
+ s && /* @__PURE__ */ e(ee, { fullWidth: !0 }),
284
+ !s && !!f && /* @__PURE__ */ e(G, { children: w ? /* @__PURE__ */ c(R, { className: "flex flex-col gap-3 py-5 px-3 items-center", children: [
285
+ /* @__PURE__ */ e("span", { children: M }),
286
+ typeof w == "function" ? w(y) : w
287
+ ] }) : /* @__PURE__ */ e(R, { children: M }) }),
288
+ !s && /* @__PURE__ */ c(G, { children: [
289
+ !!l.length && N && /* @__PURE__ */ e(
290
+ H,
291
+ {
292
+ asChild: !0,
293
+ className: "w-full",
294
+ children: typeof N == "function" ? N(y) : N
295
+ },
296
+ "combobox-list-head-action"
297
+ ),
298
+ /* @__PURE__ */ e(
299
+ be,
300
+ {
301
+ value: t,
302
+ options: l,
303
+ onChangeOption: B,
304
+ setOpen: P
305
+ }
306
+ )
307
+ ] })
308
+ ]
309
+ }
310
+ ) })
311
+ ] })
312
+ }
313
+ )
314
+ ]
315
+ }
316
+ ) });
317
+ }
318
+ );
319
+ export {
320
+ Dt as C,
321
+ U as a,
322
+ V as b,
323
+ be as c
324
+ };
@@ -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
  };