@oneplatformdev/ui 0.0.1-beta.64 → 0.0.1-beta.68

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 (61) hide show
  1. package/Alert/Alert.mjs +7 -6
  2. package/AreaChart/AreaChart.mjs +5 -4
  3. package/Badge/Badge.mjs +7 -6
  4. package/Button/buttonVariants.mjs +3 -3
  5. package/Calendar/Calendar.mjs +1 -0
  6. package/Checkbox/Checkbox.d.ts +5 -4
  7. package/Checkbox/Checkbox.mjs +48 -21
  8. package/Checkbox/Checkbox.types.d.ts +10 -0
  9. package/Checkbox/index.d.ts +2 -1
  10. package/Checkbox/index.mjs +3 -2
  11. package/Combobox/Combobox.d.ts +2 -2
  12. package/Combobox/Combobox.mjs +55 -53
  13. package/Command/Command.mjs +3 -2
  14. package/DataTable/DataTable.mjs +16 -15
  15. package/Dialog/Dialog.d.ts +2 -2
  16. package/Dialog/Dialog.mjs +14 -12
  17. package/Dropzone/Dropzone.mjs +1 -1
  18. package/Dropzone/DropzoneFilePreview.mjs +1 -1
  19. package/Dropzone/index.mjs +1 -1
  20. package/{DropzoneFilePreview-Dhtv8F4u.js → DropzoneFilePreview-C-SoCoO0.js} +16 -15
  21. package/Form/Form.mjs +5 -4
  22. package/Form/FormRenderControl.mjs +7 -6
  23. package/FormCheckbox/FormCheckbox.d.ts +1 -1
  24. package/FormCheckbox/FormCheckbox.mjs +24 -23
  25. package/FormCheckbox/FormCheckbox.types.d.ts +3 -2
  26. package/FormCombobox/FormCombobox.mjs +13 -12
  27. package/FormDatePicker/FormDatePicker.mjs +7 -6
  28. package/FormDropzone/FormDropzone.mjs +7 -6
  29. package/FormInput/FormInput.mjs +7 -6
  30. package/FormRadio/FormRadio.mjs +11 -10
  31. package/FormSelect/FormSelect.mjs +6 -5
  32. package/FormTextarea/FormTextarea.mjs +10 -9
  33. package/Header/Header.mjs +7 -6
  34. package/Label/Label.d.ts +2 -2
  35. package/Label/Label.mjs +7 -6
  36. package/Label/labelVariants.mjs +1 -1
  37. package/LazyLoader/LazyLoader.mjs +5 -4
  38. package/LoadingMask/LoadingMask.d.ts +4 -1
  39. package/LoadingMask/LoadingMask.mjs +19 -56
  40. package/LoadingMask/LoadingMask.types.d.ts +5 -0
  41. package/LoadingMask/RenderLoadingMask.d.ts +3 -0
  42. package/LoadingMask/RenderLoadingMask.mjs +108 -0
  43. package/LoadingMask/index.d.ts +2 -0
  44. package/LoadingMask/index.mjs +4 -2
  45. package/LoadingProgress/LoadingProgress.mjs +3 -2
  46. package/Radio/Radio.mjs +8 -7
  47. package/ScrollArea/ScrollArea.d.ts +2 -2
  48. package/ScrollArea/ScrollArea.mjs +26 -13
  49. package/Skeleton/Skeleton.mjs +9 -8
  50. package/TablePagination/TablePagination.mjs +9 -8
  51. package/Textarea/Textarea.mjs +5 -72
  52. package/Textarea/index.mjs +2 -2
  53. package/Textarea/useAutosizeTextArea.mjs +65 -18
  54. package/Textarea-D1CCXy7E.js +149 -0
  55. package/Theme/ThemeProvider.mjs +14 -13
  56. package/Toast/Toast.mjs +3 -2
  57. package/ToggleGroup/ToggleGroup.mjs +7 -6
  58. package/Tooltip/Tooltip.mjs +3 -2
  59. package/index.css +1 -1
  60. package/index.mjs +287 -284
  61. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ import { HTMLAttributes } from 'react';
2
+
3
+ export declare const RenderLoadingMask: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,108 @@
1
+ import { jsx as r, jsxs as s } from "react/jsx-runtime";
2
+ import { forwardRef as i } from "react";
3
+ import { cn as d } from "@oneplatformdev/utils";
4
+ const u = i((o, e) => {
5
+ const { className: t, ...n } = o;
6
+ return /* @__PURE__ */ r(
7
+ "div",
8
+ {
9
+ ...n,
10
+ ref: e,
11
+ className: d("flex flex-1 items-center justify-center", t),
12
+ children: /* @__PURE__ */ s(
13
+ "svg",
14
+ {
15
+ className: "h-8 w-8 animate-spin text-gray-900 dark:text-gray-50",
16
+ viewBox: "0 0 24 24",
17
+ fill: "none",
18
+ xmlns: "http://www.w3.org/2000/svg",
19
+ children: [
20
+ /* @__PURE__ */ r(
21
+ "path",
22
+ {
23
+ d: "M12 4.75V6.25",
24
+ stroke: "currentColor",
25
+ strokeWidth: "2",
26
+ strokeLinecap: "round",
27
+ strokeLinejoin: "round"
28
+ }
29
+ ),
30
+ /* @__PURE__ */ r(
31
+ "path",
32
+ {
33
+ d: "M17.1475 6.8525L16.0625 7.9375",
34
+ stroke: "currentColor",
35
+ strokeWidth: "2",
36
+ strokeLinecap: "round",
37
+ strokeLinejoin: "round"
38
+ }
39
+ ),
40
+ /* @__PURE__ */ r(
41
+ "path",
42
+ {
43
+ d: "M19.25 12H17.75",
44
+ stroke: "currentColor",
45
+ strokeWidth: "2",
46
+ strokeLinecap: "round",
47
+ strokeLinejoin: "round"
48
+ }
49
+ ),
50
+ /* @__PURE__ */ r(
51
+ "path",
52
+ {
53
+ d: "M17.1475 17.1475L16.0625 16.0625",
54
+ stroke: "currentColor",
55
+ strokeWidth: "2",
56
+ strokeLinecap: "round",
57
+ strokeLinejoin: "round"
58
+ }
59
+ ),
60
+ /* @__PURE__ */ r(
61
+ "path",
62
+ {
63
+ d: "M12 17.75V19.25",
64
+ stroke: "currentColor",
65
+ strokeWidth: "2",
66
+ strokeLinecap: "round",
67
+ strokeLinejoin: "round"
68
+ }
69
+ ),
70
+ /* @__PURE__ */ r(
71
+ "path",
72
+ {
73
+ d: "M6.8525 17.1475L7.9375 16.0625",
74
+ stroke: "currentColor",
75
+ strokeWidth: "2",
76
+ strokeLinecap: "round",
77
+ strokeLinejoin: "round"
78
+ }
79
+ ),
80
+ /* @__PURE__ */ r(
81
+ "path",
82
+ {
83
+ d: "M4.75 12H6.25",
84
+ stroke: "currentColor",
85
+ strokeWidth: "2",
86
+ strokeLinecap: "round",
87
+ strokeLinejoin: "round"
88
+ }
89
+ ),
90
+ /* @__PURE__ */ r(
91
+ "path",
92
+ {
93
+ d: "M6.8525 6.8525L7.9375 7.9375",
94
+ stroke: "currentColor",
95
+ strokeWidth: "2",
96
+ strokeLinecap: "round",
97
+ strokeLinejoin: "round"
98
+ }
99
+ )
100
+ ]
101
+ }
102
+ )
103
+ }
104
+ );
105
+ });
106
+ export {
107
+ u as RenderLoadingMask
108
+ };
@@ -1 +1,3 @@
1
1
  export { LoadingMask } from './LoadingMask';
2
+ export { RenderLoadingMask } from './RenderLoadingMask';
3
+ export type * from './LoadingMask.types';
@@ -1,4 +1,6 @@
1
- import { LoadingMask as r } from "./LoadingMask.mjs";
1
+ import { LoadingMask as a } from "./LoadingMask.mjs";
2
+ import { RenderLoadingMask as d } from "./RenderLoadingMask.mjs";
2
3
  export {
3
- r as LoadingMask
4
+ a as LoadingMask,
5
+ d as RenderLoadingMask
4
6
  };
@@ -1,7 +1,8 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
+ import "react";
2
3
  import { cn as r } from "@oneplatformdev/utils";
3
4
  import { loadingProgressVariants as a } from "./loadingProgressVariants.mjs";
4
- const f = (e) => {
5
+ const h = (e) => {
5
6
  const { className: s, fullWidth: t = !1, size: i, color: l, wrapClassName: n } = e;
6
7
  return /* @__PURE__ */ o(
7
8
  "div",
@@ -33,5 +34,5 @@ const f = (e) => {
33
34
  );
34
35
  };
35
36
  export {
36
- f as LoadingProgress
37
+ h as LoadingProgress
37
38
  };
package/Radio/Radio.mjs CHANGED
@@ -1,12 +1,13 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import { RadioGroup as c, RadioGroupLabel as u } from "../RadioGroup/RadioGroup.mjs";
3
- const l = (e) => {
4
- const { options: f = [], renderOption: r, ...s } = e;
5
- return /* @__PURE__ */ a(c, { ...s, children: f.map((t) => {
6
- const o = /* @__PURE__ */ a(u, { ...t }, t.value);
7
- return !r || typeof r != "function" || !(r != null && r(t, u)) ? o : r == null ? void 0 : r(t, u);
2
+ import "react";
3
+ import { RadioGroup as s, RadioGroupLabel as o } from "../RadioGroup/RadioGroup.mjs";
4
+ const R = (e) => {
5
+ const { options: f = [], renderOption: r, ...m } = e;
6
+ return /* @__PURE__ */ a(s, { ...m, children: f.map((t) => {
7
+ const u = /* @__PURE__ */ a(o, { ...t }, t.value);
8
+ return !r || typeof r != "function" || !(r != null && r(t, o)) ? u : r == null ? void 0 : r(t, o);
8
9
  }) });
9
10
  };
10
11
  export {
11
- l as Radio
12
+ R as Radio
12
13
  };
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
- import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
1
+ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
2
+ import * as React from 'react';
3
3
  declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
4
  declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
5
  export { ScrollArea, ScrollBar };
@@ -1,38 +1,51 @@
1
- import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import * as s from "react";
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
3
2
  import * as r from "@radix-ui/react-scroll-area";
4
- import { cn as t } from "@oneplatformdev/utils";
5
- const m = s.forwardRef(({ className: o, children: l, ...a }, c) => /* @__PURE__ */ d(
3
+ import * as t from "react";
4
+ import { cn as s } from "@oneplatformdev/utils";
5
+ const m = t.forwardRef(({ className: o, children: l, ...a }, c) => /* @__PURE__ */ i(
6
6
  r.Root,
7
7
  {
8
8
  ref: c,
9
- className: t("relative overflow-hidden", o),
9
+ className: s(
10
+ "relative overflow-hidden pr-2",
11
+ // '[&:has([data-orientation=vertical])]:pr-2',
12
+ o
13
+ ),
10
14
  ...a,
11
15
  children: [
12
16
  /* @__PURE__ */ e(r.Viewport, { className: "h-full w-full rounded-[inherit]", children: l }),
13
- /* @__PURE__ */ e(i, {}),
17
+ /* @__PURE__ */ e(d, {}),
14
18
  /* @__PURE__ */ e(r.Corner, {})
15
19
  ]
16
20
  }
17
21
  ));
18
22
  m.displayName = r.Root.displayName;
19
- const i = s.forwardRef(({ className: o, orientation: l = "vertical", ...a }, c) => /* @__PURE__ */ e(
23
+ const d = t.forwardRef(({ className: o, orientation: l = "vertical", ...a }, c) => /* @__PURE__ */ e(
20
24
  r.ScrollAreaScrollbar,
21
25
  {
22
26
  ref: c,
23
27
  orientation: l,
24
- className: t(
28
+ className: s(
25
29
  "flex touch-none select-none transition-colors",
26
- l === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
27
- l === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
30
+ "p-[1px] bg-[#DCDDE1] rounded-full",
31
+ l === "vertical" && "h-full w-1.5 border-l border-l-transparent",
32
+ l === "horizontal" && "h-1.5 flex-col border-t border-t-transparent",
28
33
  o
29
34
  ),
30
35
  ...a,
31
- children: /* @__PURE__ */ e(r.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
36
+ children: /* @__PURE__ */ e(
37
+ r.ScrollAreaThumb,
38
+ {
39
+ className: s(
40
+ "relative flex-1 rounded-full bg-border",
41
+ "bg-[#FCFCFC]"
42
+ )
43
+ }
44
+ )
32
45
  }
33
46
  ));
34
- i.displayName = r.ScrollAreaScrollbar.displayName;
47
+ d.displayName = r.ScrollAreaScrollbar.displayName;
35
48
  export {
36
49
  m as ScrollArea,
37
- i as ScrollBar
50
+ d as ScrollBar
38
51
  };
@@ -1,17 +1,18 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { cn as o } from "@oneplatformdev/utils";
3
- function i({
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { cn as e } from "@oneplatformdev/utils";
3
+ import "react";
4
+ function p({
4
5
  className: r,
5
- ...e
6
+ ...m
6
7
  }) {
7
- return /* @__PURE__ */ m(
8
+ return /* @__PURE__ */ o(
8
9
  "div",
9
10
  {
10
- className: o("animate-pulse rounded-md bg-primary/10", r),
11
- ...e
11
+ className: e("animate-pulse rounded-md bg-primary/10", r),
12
+ ...m
12
13
  }
13
14
  );
14
15
  }
15
16
  export {
16
- i as Skeleton
17
+ p as Skeleton
17
18
  };
@@ -1,9 +1,10 @@
1
- import { jsxs as c, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as r, jsx as n } from "react/jsx-runtime";
2
2
  import { Button as i } from "../Button/Button.mjs";
3
3
  import "../Button/buttonVariants.mjs";
4
4
  import "../Select/SelectRoot.mjs";
5
5
  import { Select as P } from "../Select/Select.mjs";
6
- const y = ({
6
+ import "react";
7
+ const z = ({
7
8
  offset: l,
8
9
  limit: a,
9
10
  totalRows: s,
@@ -15,7 +16,7 @@ const y = ({
15
16
  tNext: v = "Next",
16
17
  tOf: h = "Of"
17
18
  }) => {
18
- const r = Math.ceil(l / a) + 1, o = Math.ceil(s / a), m = r === o, b = (e) => {
19
+ const c = Math.ceil(l / a) + 1, o = Math.ceil(s / a), m = c === o, b = (e) => {
19
20
  t(0), p(parseInt(e));
20
21
  }, g = () => {
21
22
  let e = l - a;
@@ -24,8 +25,8 @@ const y = ({
24
25
  let e = l + a;
25
26
  e > s && (e = s - a), t(e);
26
27
  };
27
- return /* @__PURE__ */ c("div", { className: "flex items-center justify-end space-x-2 py-4", children: [
28
- /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
28
+ return /* @__PURE__ */ r("div", { className: "flex items-center justify-end space-x-2 py-4", children: [
29
+ /* @__PURE__ */ r("div", { className: "flex items-center space-x-2", children: [
29
30
  /* @__PURE__ */ n("span", { className: "text-sm text-nowrap", children: d }),
30
31
  /* @__PURE__ */ n(
31
32
  P,
@@ -44,7 +45,7 @@ const y = ({
44
45
  }
45
46
  )
46
47
  ] }),
47
- /* @__PURE__ */ c("div", { className: "space-x-2", children: [
48
+ /* @__PURE__ */ r("div", { className: "space-x-2", children: [
48
49
  /* @__PURE__ */ n(
49
50
  i,
50
51
  {
@@ -55,7 +56,7 @@ const y = ({
55
56
  children: u
56
57
  }
57
58
  ),
58
- /* @__PURE__ */ n("span", { className: "text-sm", children: `${x} ${r} ${h} ${o}` }),
59
+ /* @__PURE__ */ n("span", { className: "text-sm", children: `${x} ${c} ${h} ${o}` }),
59
60
  /* @__PURE__ */ n(
60
61
  i,
61
62
  {
@@ -70,5 +71,5 @@ const y = ({
70
71
  ] });
71
72
  };
72
73
  export {
73
- y as TablePagination
74
+ z as TablePagination
74
75
  };
@@ -1,74 +1,7 @@
1
- import { jsxs as u, Fragment as h, jsx as p } from "react/jsx-runtime";
2
- import * as v from "react";
3
- import { useId as w, useRef as z, useState as A, useImperativeHandle as N, useEffect as y } from "react";
4
- import { cn as d } from "@oneplatformdev/utils";
5
- import { useAutosizeTextArea as S } from "./useAutosizeTextArea.mjs";
6
- const T = v.forwardRef(
7
- (m, c) => {
8
- const {
9
- className: f,
10
- value: r = "",
11
- maxHeight: i = Number.MAX_SAFE_INTEGER,
12
- minHeight: o = 0,
13
- resizeble: g = !0,
14
- counter: s = !1,
15
- id: n = "",
16
- ...e
17
- } = m, a = w(), t = z(null), [x, b] = A("");
18
- return S({
19
- textAreaRef: t,
20
- triggerAutoSize: x,
21
- maxHeight: i,
22
- minHeight: o
23
- }), N(c, () => ({
24
- ...t.current ?? {},
25
- textArea: t.current,
26
- focus: () => {
27
- var l;
28
- return (l = t == null ? void 0 : t.current) == null ? void 0 : l.focus();
29
- },
30
- maxHeight: i,
31
- minHeight: o
32
- })), y(() => {
33
- b(r);
34
- }, [e == null ? void 0 : e.defaultValue, r]), /* @__PURE__ */ u(h, { children: [
35
- /* @__PURE__ */ p(
36
- "textarea",
37
- {
38
- id: n || a,
39
- ...e,
40
- ref: t,
41
- value: r,
42
- className: d(
43
- "flex min-h-10 w-full px-3 py-2 text-base relative",
44
- "rounded-md border border-input bg-transparent shadow-sm",
45
- "placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
46
- g ? "resize" : "resize-none !overflow-hidden",
47
- s && "pb-2",
48
- f
49
- )
50
- }
51
- ),
52
- s && /* @__PURE__ */ u(
53
- "label",
54
- {
55
- htmlFor: n || a,
56
- className: d(
57
- "w-full text-right inline-flex items-center justify-end",
58
- "text-sm font-normal text-muted-foreground",
59
- "leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
60
- ),
61
- children: [
62
- String(r || "").length,
63
- " / ",
64
- e == null ? void 0 : e.maxLength
65
- ]
66
- }
67
- )
68
- ] });
69
- }
70
- );
71
- T.displayName = "Textarea";
1
+ import "react/jsx-runtime";
2
+ import "react";
3
+ import "@oneplatformdev/utils";
4
+ import { T as a } from "../Textarea-D1CCXy7E.js";
72
5
  export {
73
- T as Textarea
6
+ a as Textarea
74
7
  };
@@ -1,4 +1,4 @@
1
- import { Textarea as a } from "./Textarea.mjs";
1
+ import { T as r } from "../Textarea-D1CCXy7E.js";
2
2
  export {
3
- a as Textarea
3
+ r as Textarea
4
4
  };
@@ -1,20 +1,67 @@
1
- import * as f from "react";
2
- const u = ({
3
- textAreaRef: r,
4
- triggerAutoSize: l,
5
- maxHeight: t = Number.MAX_SAFE_INTEGER,
6
- minHeight: s = 0
7
- }) => {
8
- const [c, i] = f.useState(!0);
9
- f.useEffect(() => {
10
- const e = r.current;
11
- if (e) {
12
- c && (e.style.minHeight = `${s + 0}px`, t > s && (e.style.maxHeight = `${t}px`), i(!1)), e.style.height = `${s + 0}px`;
13
- const o = e.scrollHeight;
14
- o > t ? e.style.height = `${t}px` : e.style.height = `${o + 0}px`;
15
- }
16
- }, [r.current, l]);
17
- };
1
+ import "react";
2
+ import "../Accordion/Accordion.mjs";
3
+ import "../Alert/Alert.mjs";
4
+ import "../AlertDialog/AlertDialogRoot.mjs";
5
+ import "react/jsx-runtime";
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 "../Combobox/Combobox.mjs";
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 "react-hook-form";
34
+ import "../Input/Input.mjs";
35
+ import "../Select/SelectRoot.mjs";
36
+ import { u as Ao } from "../Textarea-D1CCXy7E.js";
37
+ import "../Separator/Separator.mjs";
38
+ import "../HoverCard/HoverCard.mjs";
39
+ import "../InputOTP/InputOTP.mjs";
40
+ import "../Label/Label.mjs";
41
+ import "../Label/labelVariants.mjs";
42
+ import "../LoadingMask/RenderLoadingMask.mjs";
43
+ import "../LoadingProgress/loadingProgressVariants.mjs";
44
+ import "../Menubar/Menubar.mjs";
45
+ import "../NavigationMenu/NavigationMenu.mjs";
46
+ import "../NavigationMenu/navigationMenuVariants.mjs";
47
+ import "../Pagination/Pagination.mjs";
48
+ import "../Popover/Popover.mjs";
49
+ import "../Progress/Progress.mjs";
50
+ import "../RadioGroup/RadioGroup.mjs";
51
+ import "react-resizable-panels";
52
+ import "../ScrollArea/ScrollArea.mjs";
53
+ import "@oneplatformdev/hooks";
54
+ import "../Sheet/Sheet.mjs";
55
+ import "../Slider/Slider.mjs";
56
+ import "next-themes";
57
+ import "sonner";
58
+ import "../Switch/Switch.mjs";
59
+ import "../Tabs/TabsRoot.mjs";
60
+ import "../Toast/Toast.mjs";
61
+ import "../Toggle/Toggle.mjs";
62
+ import "../ToggleGroup/ToggleGroup.mjs";
63
+ import "../Tooltip/TooltipRoot.mjs";
64
+ import "../Dropzone/Dropzone.mjs";
18
65
  export {
19
- u as useAutosizeTextArea
66
+ Ao as useAutosizeTextArea
20
67
  };
@@ -0,0 +1,149 @@
1
+ import { jsxs as f, Fragment as b, jsx as y } from "react/jsx-runtime";
2
+ import * as a from "react";
3
+ import { useId as E, useRef as A, useState as N, useImperativeHandle as v, useEffect as w } from "react";
4
+ import { cn as x } from "@oneplatformdev/utils";
5
+ import "./Accordion/Accordion.mjs";
6
+ import "./Alert/Alert.mjs";
7
+ import "./AlertDialog/AlertDialogRoot.mjs";
8
+ import "recharts";
9
+ import "./Chart/Chart.mjs";
10
+ import "./Sidebar/Sidebar.mjs";
11
+ import "@radix-ui/react-aspect-ratio";
12
+ import "./Avatar/Avatar.mjs";
13
+ import "./Badge/badgeVariants.mjs";
14
+ import "./Breadcrumb/Breadcrumb.mjs";
15
+ import "./Button/Button.mjs";
16
+ import "./Button/buttonVariants.mjs";
17
+ import "./ButtonIcon/ButtonIcon.mjs";
18
+ import "./ButtonIcon/buttonIconVariants.mjs";
19
+ import "./Calendar/Calendar.mjs";
20
+ import "./Card/Card.mjs";
21
+ import "./Carousel/Carousel.mjs";
22
+ import "./Checkbox/Checkbox.mjs";
23
+ import "@radix-ui/react-collapsible";
24
+ import "./Combobox/Combobox.mjs";
25
+ import "./Command/Command.mjs";
26
+ import "./DropdownMenu/DropdownMenu.mjs";
27
+ import "./Table/Table.mjs";
28
+ import "@tanstack/react-table";
29
+ import "lucide-react";
30
+ import "./DatePicker/DatePicker.mjs";
31
+ import "./Dialog/Dialog.mjs";
32
+ import "./Drawer/Drawer.mjs";
33
+ import "./Form/Form.mjs";
34
+ import "react-hook-form";
35
+ import "./Input/Input.mjs";
36
+ import "./Select/SelectRoot.mjs";
37
+ import "./Separator/Separator.mjs";
38
+ import "./HoverCard/HoverCard.mjs";
39
+ import "./InputOTP/InputOTP.mjs";
40
+ import "./Label/Label.mjs";
41
+ import "./Label/labelVariants.mjs";
42
+ import "./LoadingMask/RenderLoadingMask.mjs";
43
+ import "./LoadingProgress/loadingProgressVariants.mjs";
44
+ import "./Menubar/Menubar.mjs";
45
+ import "./NavigationMenu/NavigationMenu.mjs";
46
+ import "./NavigationMenu/navigationMenuVariants.mjs";
47
+ import "./Pagination/Pagination.mjs";
48
+ import "./Popover/Popover.mjs";
49
+ import "./Progress/Progress.mjs";
50
+ import "./RadioGroup/RadioGroup.mjs";
51
+ import "react-resizable-panels";
52
+ import "./ScrollArea/ScrollArea.mjs";
53
+ import "@oneplatformdev/hooks";
54
+ import "./Sheet/Sheet.mjs";
55
+ import "./Slider/Slider.mjs";
56
+ import "next-themes";
57
+ import "sonner";
58
+ import "./Switch/Switch.mjs";
59
+ import "./Tabs/TabsRoot.mjs";
60
+ import "./Toast/Toast.mjs";
61
+ import "./Toggle/Toggle.mjs";
62
+ import "./ToggleGroup/ToggleGroup.mjs";
63
+ import "./Tooltip/TooltipRoot.mjs";
64
+ import "./Dropzone/Dropzone.mjs";
65
+ const S = ({
66
+ textAreaRef: p,
67
+ triggerAutoSize: l,
68
+ maxHeight: i = Number.MAX_SAFE_INTEGER,
69
+ minHeight: r = 0
70
+ }) => {
71
+ const [s, n] = a.useState(!0);
72
+ a.useEffect(() => {
73
+ const t = p.current;
74
+ if (t) {
75
+ s && (t.style.minHeight = `${r + 0}px`, i > r && (t.style.maxHeight = `${i}px`), n(!1)), t.style.height = `${r + 0}px`;
76
+ const m = t.scrollHeight;
77
+ m > i ? t.style.height = `${i}px` : t.style.height = `${m + 0}px`;
78
+ }
79
+ }, [p.current, l]);
80
+ }, T = a.forwardRef(
81
+ (p, l) => {
82
+ const {
83
+ className: i,
84
+ value: r = "",
85
+ maxHeight: s = Number.MAX_SAFE_INTEGER,
86
+ minHeight: n = 0,
87
+ resizeble: u = !0,
88
+ counter: t = !1,
89
+ id: m = "",
90
+ ...e
91
+ } = p, d = E(), o = A(null), [g, h] = N("");
92
+ return S({
93
+ textAreaRef: o,
94
+ triggerAutoSize: g,
95
+ maxHeight: s,
96
+ minHeight: n
97
+ }), v(l, () => ({
98
+ ...o.current ?? {},
99
+ textArea: o.current,
100
+ focus: () => {
101
+ var c;
102
+ return (c = o == null ? void 0 : o.current) == null ? void 0 : c.focus();
103
+ },
104
+ maxHeight: s,
105
+ minHeight: n
106
+ })), w(() => {
107
+ h(r);
108
+ }, [e == null ? void 0 : e.defaultValue, r]), /* @__PURE__ */ f(b, { children: [
109
+ /* @__PURE__ */ y(
110
+ "textarea",
111
+ {
112
+ id: m || d,
113
+ ...e,
114
+ ref: o,
115
+ value: r,
116
+ className: x(
117
+ "flex min-h-10 w-full px-3 py-2 text-base relative",
118
+ "rounded-md border border-input bg-transparent shadow-sm",
119
+ "placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
120
+ u ? "resize" : "resize-none !overflow-hidden",
121
+ t && "pb-2",
122
+ i
123
+ )
124
+ }
125
+ ),
126
+ t && /* @__PURE__ */ f(
127
+ "label",
128
+ {
129
+ htmlFor: m || d,
130
+ className: x(
131
+ "w-full text-right inline-flex items-center justify-end",
132
+ "text-sm font-normal text-muted-foreground",
133
+ "leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
134
+ ),
135
+ children: [
136
+ String(r || "").length,
137
+ " / ",
138
+ e == null ? void 0 : e.maxLength
139
+ ]
140
+ }
141
+ )
142
+ ] });
143
+ }
144
+ );
145
+ T.displayName = "Textarea";
146
+ export {
147
+ T,
148
+ S as u
149
+ };