@oneplatformdev/ui 0.0.1-beta.13 → 0.0.1-beta.130

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