@oneplatformdev/ui 0.0.1-beta.6 → 0.0.1-beta.60

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 (74) hide show
  1. package/Accordion/Accordion.d.ts +2 -2
  2. package/Accordion/Accordion.mjs +23 -20
  3. package/Button/buttonVariants.mjs +5 -5
  4. package/Calendar/Calendar.mjs +3 -2
  5. package/Combobox/Combobox.mjs +124 -86
  6. package/Combobox/Combobox.types.d.ts +13 -1
  7. package/Command/Command.d.ts +1 -1
  8. package/DataTable/DataTable.d.ts +10 -3
  9. package/DataTable/DataTable.mjs +33 -33
  10. package/DataTable/DataTableColumnFilter.d.ts +4 -0
  11. package/DataTable/DataTableColumnFilter.mjs +31 -0
  12. package/DatePicker/DatePicker.mjs +2 -2
  13. package/Dropzone/Dropzone.d.ts +22 -0
  14. package/Dropzone/Dropzone.mjs +151 -0
  15. package/Dropzone/Dropzone.types.d.ts +38 -0
  16. package/Dropzone/DropzoneFilePreview.d.ts +4 -0
  17. package/Dropzone/DropzoneFilePreview.mjs +9 -0
  18. package/Dropzone/DropzoneSinglePickPreview.d.ts +9 -0
  19. package/Dropzone/DropzoneSinglePickPreview.mjs +38 -0
  20. package/Dropzone/DropzoneUtils.d.ts +5 -0
  21. package/Dropzone/DropzoneUtils.mjs +24 -0
  22. package/Dropzone/index.d.ts +2 -0
  23. package/Dropzone/index.mjs +7 -0
  24. package/Dropzone/package.json +7 -0
  25. package/DropzoneFilePreview-Dhtv8F4u.js +67 -0
  26. package/Form/FormRenderControl.d.ts +1 -2
  27. package/Form/FormRenderControl.mjs +10 -10
  28. package/Form/FormRenderControl.types.d.ts +4 -3
  29. package/FormCheckbox/FormCheckbox.d.ts +1 -2
  30. package/FormCheckbox/FormCheckbox.types.d.ts +1 -2
  31. package/FormCombobox/FormCombobox.d.ts +2 -2
  32. package/FormCombobox/FormCombobox.types.d.ts +1 -2
  33. package/FormDatePicker/FormDatePicker.d.ts +2 -2
  34. package/FormDatePicker/FormDatePicker.mjs +20 -18
  35. package/FormDatePicker/FormDatePicker.types.d.ts +1 -2
  36. package/FormDropzone/FormDropzone.d.ts +4 -0
  37. package/FormDropzone/FormDropzone.mjs +19 -0
  38. package/FormDropzone/FormDropzone.types.d.ts +6 -0
  39. package/FormDropzone/index.d.ts +2 -0
  40. package/FormDropzone/index.mjs +4 -0
  41. package/FormDropzone/package.json +7 -0
  42. package/FormInput/FormInput.d.ts +1 -2
  43. package/FormInput/FormInput.types.d.ts +1 -2
  44. package/FormSelect/FormSelect.d.ts +1 -2
  45. package/FormSelect/FormSelect.mjs +19 -17
  46. package/FormSelect/FormSelect.types.d.ts +1 -2
  47. package/FormTextarea/FormTextarea.d.ts +1 -2
  48. package/FormTextarea/FormTextarea.mjs +13 -12
  49. package/FormTextarea/FormTextarea.types.d.ts +1 -2
  50. package/Input/Input.mjs +42 -37
  51. package/Input/Input.types.d.ts +3 -1
  52. package/Select/Select.mjs +93 -63
  53. package/Select/Select.types.d.ts +9 -2
  54. package/Select/SelectRoot.d.ts +2 -2
  55. package/Select/SelectRoot.mjs +1 -0
  56. package/TablePagination/TablePagination.d.ts +16 -0
  57. package/TablePagination/TablePagination.mjs +74 -0
  58. package/TablePagination/index.d.ts +1 -0
  59. package/TablePagination/index.mjs +4 -0
  60. package/TablePagination/package.json +7 -0
  61. package/Tabs/Tabs.d.ts +3 -2
  62. package/Tabs/Tabs.mjs +20 -6
  63. package/Tabs/Tabs.types.d.ts +5 -2
  64. package/Tabs/index.mjs +8 -7
  65. package/Textarea/Textarea.d.ts +1 -1
  66. package/Textarea/Textarea.mjs +71 -15
  67. package/Textarea/Textarea.types.d.ts +16 -2
  68. package/Textarea/useAutosizeTextArea.d.ts +3 -0
  69. package/Textarea/useAutosizeTextArea.mjs +20 -0
  70. package/Toast/toastVariants.mjs +3 -3
  71. package/index.css +1 -1
  72. package/index.d.ts +3 -0
  73. package/index.mjs +235 -225
  74. package/package.json +9 -8
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
- import * as AccordionPrimitive from "@radix-ui/react-accordion";
1
+ import * as React from 'react';
2
+ import * as AccordionPrimitive from '@radix-ui/react-accordion';
3
3
  declare const Accordion: React.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
4
4
  declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
5
  declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -1,46 +1,49 @@
1
1
  import { jsx as a, jsxs as d } from "react/jsx-runtime";
2
- import * as i from "react";
2
+ import * as s from "react";
3
3
  import * as e from "@radix-ui/react-accordion";
4
4
  import { ChevronDown as m } from "lucide-react";
5
- import { cn as s } from "@oneplatformdev/utils";
6
- const g = e.Root, c = i.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a(
5
+ import { cn as c } from "@oneplatformdev/utils";
6
+ const u = e.Root, l = s.forwardRef(({ className: t, ...o }, r) => /* @__PURE__ */ a(
7
7
  e.Item,
8
8
  {
9
9
  ref: r,
10
- className: s("border-b", o),
11
- ...t
10
+ className: c("border-b", t),
11
+ ...o
12
12
  }
13
13
  ));
14
- c.displayName = "AccordionItem";
15
- const l = i.forwardRef(({ className: o, children: t, ...r }, n) => /* @__PURE__ */ a(e.Header, { className: "flex", children: /* @__PURE__ */ d(
14
+ l.displayName = "AccordionItem";
15
+ const f = s.forwardRef(({ className: t, children: o, ...r }, i) => /* @__PURE__ */ a(e.Header, { className: "flex", children: /* @__PURE__ */ d(
16
16
  e.Trigger,
17
17
  {
18
- ref: n,
19
- className: s(
18
+ ref: i,
19
+ className: c(
20
20
  "flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",
21
- o
21
+ t
22
22
  ),
23
+ onKeyDown: (n) => {
24
+ n.key === " " && n.target === n.currentTarget && n.preventDefault();
25
+ },
23
26
  ...r,
24
27
  children: [
25
- t,
28
+ o,
26
29
  /* @__PURE__ */ a(m, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" })
27
30
  ]
28
31
  }
29
32
  ) }));
30
- l.displayName = e.Trigger.displayName;
31
- const f = i.forwardRef(({ className: o, children: t, ...r }, n) => /* @__PURE__ */ a(
33
+ f.displayName = e.Trigger.displayName;
34
+ const p = s.forwardRef(({ className: t, children: o, ...r }, i) => /* @__PURE__ */ a(
32
35
  e.Content,
33
36
  {
34
- ref: n,
37
+ ref: i,
35
38
  className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
36
39
  ...r,
37
- children: /* @__PURE__ */ a("div", { className: s("pb-4 pt-0", o), children: t })
40
+ children: /* @__PURE__ */ a("div", { className: c("pb-4 pt-0", t), children: o })
38
41
  }
39
42
  ));
40
- f.displayName = e.Content.displayName;
43
+ p.displayName = e.Content.displayName;
41
44
  export {
42
- g as Accordion,
43
- f as AccordionContent,
44
- c as AccordionItem,
45
- l as AccordionTrigger
45
+ u as Accordion,
46
+ p as AccordionContent,
47
+ l as AccordionItem,
48
+ f as AccordionTrigger
46
49
  };
@@ -1,10 +1,10 @@
1
1
  import { cva as e } from "class-variance-authority";
2
- const t = e(
2
+ const r = e(
3
3
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
4
4
  {
5
5
  variants: {
6
6
  variant: {
7
- default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
7
+ default: "bg-primary text-primary-foreground shadow hover:opacity-[.8]",
8
8
  destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
9
9
  outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
10
10
  secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
@@ -13,8 +13,8 @@ const t = e(
13
13
  },
14
14
  size: {
15
15
  default: "h-9 px-4 py-2",
16
- sm: "h-8 rounded-md px-3 text-xs",
17
- lg: "h-10 rounded-md px-8",
16
+ sm: "h-8 rounded-md px-3 text-xs [&_svg]:size-4",
17
+ lg: "h-10 rounded-md px-8 [&_svg]:size-5 px-3 py-2",
18
18
  icon: "h-9 w-9"
19
19
  }
20
20
  },
@@ -25,5 +25,5 @@ const t = e(
25
25
  }
26
26
  );
27
27
  export {
28
- t as buttonVariants
28
+ r as buttonVariants
29
29
  };
@@ -16,10 +16,11 @@ function u({
16
16
  showOutsideDays: c,
17
17
  className: e("p-3", n),
18
18
  classNames: {
19
+ caption_dropdowns: "flex flex-col gap-1",
19
20
  months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
20
21
  month: "space-y-4",
21
- caption: "flex justify-center pt-1 relative items-center",
22
- caption_label: "text-sm font-medium",
22
+ caption: "flex justify-center pt-1 relative items-center gap-4",
23
+ caption_label: "text-sm font-medium hidden",
23
24
  nav: "space-x-1 flex items-center",
24
25
  nav_button: e(
25
26
  o({ variant: "outline" }),
@@ -1,119 +1,157 @@
1
- import { jsx as a, jsxs as t } from "react/jsx-runtime";
2
- import n, { useEffect as E } from "react";
3
- import { LoadingMask as I } from "../LoadingMask/LoadingMask.mjs";
4
- import { Popover as U, PopoverTrigger as _, PopoverContent as B } from "../Popover/Popover.mjs";
5
- import { Button as F } from "../Button/Button.mjs";
1
+ import { jsx as a, jsxs as o, Fragment as I } from "react/jsx-runtime";
2
+ import s, { useRef as R, useEffect as U, useCallback as c, useLayoutEffect as q } from "react";
3
+ import { LoadingMask as z } from "../LoadingMask/LoadingMask.mjs";
4
+ import { Popover as A, PopoverTrigger as V, PopoverContent as X } from "../Popover/Popover.mjs";
5
+ import { Button as H } from "../Button/Button.mjs";
6
6
  import "../Button/buttonVariants.mjs";
7
- import { Command as G, CommandInput as M, CommandList as R, CommandEmpty as V, CommandGroup as W, CommandItem as X } from "../Command/Command.mjs";
8
- import { cn as g } from "@oneplatformdev/utils";
9
- import { useDebounceCallback as q } from "@oneplatformdev/hooks";
10
- import { X as z, ChevronsUpDown as A, Check as H } from "lucide-react";
11
- const te = (w) => {
12
- var C;
7
+ import { Command as J, CommandInput as K, CommandList as Q, CommandGroup as W, CommandEmpty as k, CommandItem as Y } from "../Command/Command.mjs";
8
+ import { cn as h } from "@oneplatformdev/utils";
9
+ import { useDebounceCallback as Z } from "@oneplatformdev/hooks";
10
+ import { X as $, ChevronsUpDown as ee, Check as ae } from "lucide-react";
11
+ const ue = (O) => {
12
+ var j;
13
13
  const {
14
- value: o,
15
- onChange: y,
16
- placeholder: x,
17
- disabled: N,
18
- searchLabel: S,
19
- fetchOptions: L,
14
+ value: n,
15
+ onChange: P,
16
+ placeholder: D,
17
+ disabled: T,
18
+ searchLabel: B = "Type to search...",
19
+ fetchOptions: E,
20
20
  options: r,
21
- emptyLabel: O = "No options"
22
- } = w, [l, d] = n.useState(!1), [P, m] = n.useState(""), [p, h] = n.useState([]), [s, u] = n.useState(), [f, b] = n.useState(!1);
23
- E(() => {
24
- r != null && r.length && h(r);
21
+ emptyLabel: C = "No options",
22
+ emptyAction: i,
23
+ onMount: x
24
+ } = O, f = R(!1), [t, d] = s.useState(!1), [m, w] = s.useState(""), [u, p] = s.useState([]), [b, N] = s.useState(), [g, l] = s.useState(!1);
25
+ U(() => {
26
+ r != null && r.length && p(r);
25
27
  }, [r]);
26
- const j = async () => {
27
- l || (v(), m(""));
28
- }, v = async (e) => {
29
- b(!0);
28
+ const M = async () => {
29
+ t || (S(), w(""));
30
+ }, S = c(async (e) => {
31
+ l(!0);
30
32
  try {
31
- const i = await L(e);
32
- h(i);
33
- } catch (i) {
34
- console.error("Unexpected error while get option:", i);
33
+ const y = await E(e);
34
+ p(y);
35
+ } catch (y) {
36
+ console.error("Unexpected error while get option:", y);
35
37
  } finally {
36
- b(!1);
38
+ l(!1);
37
39
  }
38
- }, k = q(v, 1e3), D = (e) => {
39
- m(e), k(e);
40
- }, c = (e) => {
41
- y(e.value), u(e);
42
- }, T = () => {
43
- c({ value: "", label: "" }), u(void 0);
44
- };
45
- return /* @__PURE__ */ a("div", { className: "w-full", children: /* @__PURE__ */ t(
46
- U,
40
+ }, []), _ = Z(S, 1e3, {
41
+ leading: !1,
42
+ trailing: !0
43
+ }), F = c((e) => {
44
+ l(!0), w(e), _(e);
45
+ }, []), v = c((e) => {
46
+ P(e.value), N(e), l(!1);
47
+ }, []), L = c(() => {
48
+ console.log("handleClearSelection", L), v({ value: "", label: "" }), N(void 0), l(!1);
49
+ }, []), G = c(() => {
50
+ if (!x) {
51
+ f.current = !0;
52
+ return;
53
+ }
54
+ x({ setOptions: p, search: m || "", open: t, setOpen: d }).finally(
55
+ () => {
56
+ f.current = !0;
57
+ }
58
+ );
59
+ }, []);
60
+ return q(() => (G(), () => {
61
+ f.current = !1;
62
+ }), []), /* @__PURE__ */ a("div", { className: "w-full", children: /* @__PURE__ */ o(
63
+ A,
47
64
  {
48
- open: l,
65
+ open: t,
49
66
  onOpenChange: (e) => {
50
- d(e), e && j();
67
+ d(e), e && M();
51
68
  },
52
69
  children: [
53
- /* @__PURE__ */ a(_, { asChild: !0, className: "border-border", children: /* @__PURE__ */ t(
54
- F,
70
+ /* @__PURE__ */ a(V, { asChild: !0, className: "border-input", children: /* @__PURE__ */ o(
71
+ H,
55
72
  {
56
73
  variant: "outline",
57
74
  role: "combobox",
58
- "aria-expanded": l,
59
- className: g(
60
- "w-full justify-between font-normal text-sm border bg-input",
61
- l ? "border-2 border-sidebar-accent" : "border-border"
75
+ "aria-expanded": t,
76
+ className: h(
77
+ "w-full justify-between font-normal text-sm border bg-transparent relative",
78
+ t ? "border-2 border-sidebar-accent" : "border-border"
62
79
  ),
63
- disabled: N,
80
+ disabled: T,
64
81
  children: [
65
- /* @__PURE__ */ a("span", { className: "truncate max-w-[calc(100%-1.5rem)] overflow-hidden whitespace-nowrap", children: o ? ((C = p.find((e) => e.value === o)) == null ? void 0 : C.label) || (s == null ? void 0 : s.label) : /* @__PURE__ */ a("span", { className: "text-gray-400", children: x }) }),
66
- o ? /* @__PURE__ */ a(
67
- z,
82
+ /* @__PURE__ */ a("span", { className: "truncate max-w-[calc(100%-1.5rem)] overflow-hidden whitespace-nowrap", children: n ? ((j = u.find((e) => e.value === n)) == null ? void 0 : j.label) || (b == null ? void 0 : b.label) : /* @__PURE__ */ a("span", { className: "text-gray-400", children: D }) }),
83
+ n ? /* @__PURE__ */ a(
84
+ "div",
68
85
  {
69
- className: "opacity-50 w-4 h-4 cursor-pointer hover:opacity-100",
86
+ className: h(
87
+ "absolute top-0 right-1",
88
+ "flex items-center justify-center",
89
+ "w-9 aspect-square [&_svg]:size-5",
90
+ "opacity-50 cursor-pointer hover:opacity-100"
91
+ ),
70
92
  onClick: (e) => {
71
- e.stopPropagation(), T();
72
- }
93
+ e.stopPropagation(), L();
94
+ },
95
+ children: /* @__PURE__ */ a($, {})
73
96
  }
74
- ) : /* @__PURE__ */ a(A, { className: "opacity-50 w-4 h-4" })
97
+ ) : /* @__PURE__ */ a(ee, { className: "opacity-50 w-4 h-4" })
75
98
  ]
76
99
  }
77
100
  ) }),
78
101
  /* @__PURE__ */ a(
79
- B,
102
+ X,
80
103
  {
81
104
  className: "w-[var(--radix-popper-anchor-width)] max-w-none p-0",
82
105
  align: "start",
83
- children: /* @__PURE__ */ t(G, { shouldFilter: !1, children: [
106
+ children: /* @__PURE__ */ o(J, { shouldFilter: !1, children: [
84
107
  /* @__PURE__ */ a(
85
- M,
108
+ K,
86
109
  {
87
- placeholder: S,
88
- value: P,
89
- onValueChange: D
110
+ placeholder: B,
111
+ value: m,
112
+ onValueChange: F
90
113
  }
91
114
  ),
92
- /* @__PURE__ */ t(R, { children: [
93
- !f && /* @__PURE__ */ a(V, { children: O }),
94
- /* @__PURE__ */ a(W, { children: f ? /* @__PURE__ */ a("div", { className: "flex justify-center", children: /* @__PURE__ */ a(I, {}) }) : p.map((e) => /* @__PURE__ */ t(
95
- X,
96
- {
97
- value: e.value,
98
- onSelect: () => {
99
- o === e.value ? c({ value: "", label: "" }) : c(e), d(!1);
100
- },
101
- children: [
102
- e.label,
103
- /* @__PURE__ */ a(
104
- H,
105
- {
106
- className: g(
107
- "ml-auto",
108
- o === e.value ? "opacity-100" : "opacity-0"
115
+ /* @__PURE__ */ a(Q, { children: /* @__PURE__ */ o(
116
+ W,
117
+ {
118
+ className: h(!u.length && "p-0 shadow-none"),
119
+ children: [
120
+ g && /* @__PURE__ */ a("div", { className: "flex justify-center", children: /* @__PURE__ */ a(z, {}) }),
121
+ !g && !!m && /* @__PURE__ */ a(I, { children: i ? /* @__PURE__ */ o(k, { className: "flex flex-col gap-3 py-5 px-3 items-center", children: [
122
+ /* @__PURE__ */ a("span", { children: C }),
123
+ typeof i == "function" ? i({
124
+ setOptions: p,
125
+ search: m || "",
126
+ open: t,
127
+ setOpen: d
128
+ }) : i
129
+ ] }) : /* @__PURE__ */ a(k, { children: C }) }),
130
+ !g && !!u.length && u.map((e) => /* @__PURE__ */ o(
131
+ Y,
132
+ {
133
+ value: e.value,
134
+ onSelect: () => {
135
+ n === e.value ? v({ value: "", label: "" }) : v(e), d(!1);
136
+ },
137
+ children: [
138
+ e.label,
139
+ /* @__PURE__ */ a(
140
+ ae,
141
+ {
142
+ className: h(
143
+ "ml-auto",
144
+ n === e.value ? "opacity-100" : "opacity-0"
145
+ )
146
+ }
109
147
  )
110
- }
111
- )
112
- ]
113
- },
114
- e.value
115
- )) })
116
- ] })
148
+ ]
149
+ },
150
+ e.value
151
+ ))
152
+ ]
153
+ }
154
+ ) })
117
155
  ] })
118
156
  }
119
157
  )
@@ -122,5 +160,5 @@ const te = (w) => {
122
160
  ) });
123
161
  };
124
162
  export {
125
- te as Combobox
163
+ ue as Combobox
126
164
  };
@@ -1,7 +1,15 @@
1
+ import { Dispatch, ReactNode, SetStateAction } from 'react';
2
+
1
3
  export interface ComboboxOption {
2
4
  value: string;
3
5
  label: string;
4
6
  }
7
+ export interface ComboboxPropsOnMountParams {
8
+ setOptions: Dispatch<SetStateAction<ComboboxOption[]>>;
9
+ search: string;
10
+ open: boolean;
11
+ setOpen: Dispatch<SetStateAction<boolean>>;
12
+ }
5
13
  export interface ComboboxProps {
6
14
  value: string;
7
15
  onChange: (value: string) => void;
@@ -10,6 +18,10 @@ export interface ComboboxProps {
10
18
  disabled?: boolean;
11
19
  fetchOptions: (search?: string) => Promise<ComboboxOption[]>;
12
20
  options?: ComboboxOption[];
13
- /** CommandEmpty label*/
21
+ /** Command Empty list label*/
14
22
  emptyLabel?: string;
23
+ /** Command Empty list action */
24
+ emptyAction?: ((params: ComboboxPropsOnMountParams) => ReactNode) | ReactNode;
25
+ /** Callback for load data on start component */
26
+ onMount?: (params: ComboboxPropsOnMountParams) => Promise<void>;
15
27
  }
@@ -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,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",
@@ -0,0 +1,22 @@
1
+ import { DropzoneProps } from './Dropzone.types';
2
+
3
+ /**
4
+ * Dropzone component - A drag-and-drop file upload area with image previews, error handling, and localization.
5
+ *
6
+ * @component
7
+ * @param {DropzoneProps} props - The props for the Dropzone component.
8
+ * @param {string[]} [props.acceptTypes=DEFAULT_FILE_TYPES] - Allowed file MIME types.
9
+ * @param {number} props.maxSizeMB - Maximum allowed file size in megabytes.
10
+ * @param {number} [props.maxFiles=1] - Maximum number of files that can be uploaded.
11
+ * @param {DropzoneTranslations} props.translations - Translations for text labels.
12
+ * @param {(errors: FileRejection[]) => void} [props.onErrors] - Callback triggered when file errors occur.
13
+ * @param {boolean} [props.hideErrors=false] - Whether to hide error messages.
14
+ * @param {boolean} [props.disabled=false] - Whether the dropzone is disabled.
15
+ * @param {DropzoneStyles} [props.classNames] - Custom classNames for different dropzone states.
16
+ * @param {DropzoneValueItem[]} [props.value=[]] - Current selected files or URLs.
17
+ * @param {(items: DropzoneValueItem[]) => void} [props.onChangeValue] - Callback triggered when file selection changes.
18
+ * @param {string} [props.className] - Additional class names for styling.
19
+ * @param {React.Ref<HTMLDivElement>} ref - Ref for the root dropzone container.
20
+ * @returns {JSX.Element} The rendered Dropzone component.
21
+ */
22
+ export declare const Dropzone: import('react').ForwardRefExoticComponent<DropzoneProps & import('react').RefAttributes<HTMLDivElement>>;