@oneplatformdev/ui 0.0.1-beta.44 → 0.0.1-beta.46

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.
@@ -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,27 +1,29 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { DatePicker as c } from "../DatePicker/DatePicker.mjs";
3
- import { FormControl as i } from "../Form/Form.mjs";
4
- import { FormRenderControl as l } from "../Form/FormRenderControl.mjs";
5
- const f = (e) => {
6
- const { form: t, name: m, label: n, ...a } = e;
7
- return /* @__PURE__ */ o(
8
- l,
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { DatePicker as l } from "../DatePicker/DatePicker.mjs";
3
+ import { FormControl as p } from "../Form/Form.mjs";
4
+ import { FormRenderControl as s } from "../Form/FormRenderControl.mjs";
5
+ const h = (m) => {
6
+ const { form: n, name: a, label: c, onDateChange: r, ...i } = m;
7
+ return /* @__PURE__ */ e(
8
+ s,
9
9
  {
10
- form: t,
11
- name: m,
12
- label: n,
13
- render: ({ field: r }) => /* @__PURE__ */ o(i, { children: /* @__PURE__ */ o(
14
- c,
10
+ form: n,
11
+ name: a,
12
+ label: c,
13
+ render: ({ field: o }) => /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(
14
+ l,
15
15
  {
16
- ...r,
17
- ...a,
18
- selectedDate: r.value,
19
- onDateChange: r.onChange
16
+ ...o,
17
+ ...i,
18
+ selectedDate: o.value,
19
+ onDateChange: (t) => {
20
+ o.onChange(t), r == null || r(t);
21
+ }
20
22
  }
21
23
  ) })
22
24
  }
23
25
  );
24
26
  };
25
27
  export {
26
- f as FormDatePicker
28
+ h as FormDatePicker
27
29
  };
@@ -2,5 +2,5 @@ import { DatePickerProps } from '../DatePicker';
2
2
  import { FormRenderControlExtendProps } from '../Form';
3
3
  import { FieldValues } from 'react-hook-form/dist/types/fields';
4
4
 
5
- export interface FormDatePickerProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, DatePickerProps {
5
+ export interface FormDatePickerProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Omit<DatePickerProps, 'onDateChange'>, Partial<Pick<DatePickerProps, 'onDateChange'>> {
6
6
  }
package/Select/Select.mjs CHANGED
@@ -1,65 +1,67 @@
1
- import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
- import { Button as f } from "../Button/Button.mjs";
1
+ import { jsxs as d, jsx as c } from "react/jsx-runtime";
2
+ import { createElement as f } from "react";
3
+ import { Button as g } from "../Button/Button.mjs";
3
4
  import "../Button/buttonVariants.mjs";
4
- import { SelectRoot as g, SelectContent as p, SelectTrigger as h, SelectValue as v, SelectItem as u } from "./SelectRoot.mjs";
5
- import { isValidReactElement as c } from "@oneplatformdev/utils";
6
- const S = (o) => {
7
- const { placeholder: l, renderTrigger: e, slotProps: t } = o, n = /* @__PURE__ */ a(h, { ...(t == null ? void 0 : t.triggerProps) || {}, children: /* @__PURE__ */ a(v, { placeholder: l }) });
8
- return e && typeof e == "function" && c(e(o, n)) ? e(o, n) : n;
9
- }, C = (o) => {
10
- const { renderOption: l, option: e, index: t, options: n, ...i } = o, r = /* @__PURE__ */ a(u, { value: e.value, children: e.label }, e.value);
11
- return l && typeof l == "function" && c(l(
5
+ import { SelectRoot as p, SelectContent as h, SelectTrigger as v, SelectValue as S, SelectItem as u } from "./SelectRoot.mjs";
6
+ import { isValidReactElement as i } from "@oneplatformdev/utils";
7
+ const C = (r) => {
8
+ const { placeholder: l, renderTrigger: e, slotProps: n } = r, t = /* @__PURE__ */ c(v, { ...(n == null ? void 0 : n.triggerProps) || {}, children: /* @__PURE__ */ c(S, { placeholder: l }) });
9
+ return e && typeof e == "function" && i(e(r, t)) ? e(r, t) : t;
10
+ }, x = (r) => {
11
+ const { renderOption: l, option: e, index: n, options: t, ...a } = r, o = /* @__PURE__ */ c(u, { value: e.value, children: e.label }, e.value);
12
+ return l && typeof l == "function" && i(l(
12
13
  e,
13
- t,
14
14
  n,
15
- { ...i, options: n },
16
- r
17
- )) ? c(l(
18
- e,
19
15
  t,
20
- n,
21
- { ...i, options: n },
22
- r
23
- ), u) ? c(l(
16
+ { ...a, options: t },
17
+ o
18
+ )) ? i(l(
24
19
  e,
25
- t,
26
20
  n,
27
- { ...i, options: n },
28
- r
29
- )) : /* @__PURE__ */ a(u, { value: e.value, children: l(
21
+ t,
22
+ { ...a, options: t },
23
+ o
24
+ ), u) ? i(l(
30
25
  e,
26
+ n,
31
27
  t,
28
+ { ...a, options: t },
29
+ o
30
+ )) : /* @__PURE__ */ c(u, { value: e.value, children: l(
31
+ e,
32
32
  n,
33
- { ...i, options: n },
34
- r
35
- ) }, e.value) : r;
36
- }, T = (o) => {
33
+ t,
34
+ { ...a, options: t },
35
+ o
36
+ ) }, e.value) : o;
37
+ }, j = (r) => {
37
38
  const {
38
39
  value: l,
39
40
  options: e,
40
- onChange: t,
41
- nullable: n = !1,
42
- clearLabel: i = "Clear",
43
- disabled: r
44
- } = o;
41
+ onChange: n,
42
+ nullable: t = !1,
43
+ clearLabel: a = "Clear",
44
+ disabled: o
45
+ } = r;
45
46
  return /* @__PURE__ */ d(
46
- g,
47
+ p,
47
48
  {
48
49
  value: l,
49
- onValueChange: t,
50
- disabled: r,
50
+ onValueChange: n,
51
+ disabled: o,
51
52
  children: [
52
- /* @__PURE__ */ a(S, { ...o }),
53
- /* @__PURE__ */ d(p, { children: [
54
- n && /* @__PURE__ */ a(f, { className: "w-full px-2", variant: "secondary", size: "sm", onClick: () => {
55
- t("");
56
- }, children: i }),
57
- e.map((s, m) => /* @__PURE__ */ a(
58
- C,
53
+ /* @__PURE__ */ c(C, { ...r }),
54
+ /* @__PURE__ */ d(h, { children: [
55
+ t && /* @__PURE__ */ c(g, { className: "w-full px-2", variant: "secondary", size: "sm", onClick: () => {
56
+ n("");
57
+ }, children: a }),
58
+ e.map((m, s) => /* @__PURE__ */ f(
59
+ x,
59
60
  {
60
- ...o,
61
- option: s,
62
- index: m
61
+ ...r,
62
+ key: m.value,
63
+ option: m,
64
+ index: s
63
65
  }
64
66
  ))
65
67
  ] })
@@ -68,5 +70,5 @@ const S = (o) => {
68
70
  );
69
71
  };
70
72
  export {
71
- T as Select
73
+ j as Select
72
74
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneplatformdev/ui",
3
- "version": "0.0.1-beta.44",
3
+ "version": "0.0.1-beta.46",
4
4
  "description": "UI React Components.",
5
5
  "author": "One Platform Development Team",
6
6
  "keywords": [
@@ -95,6 +95,7 @@
95
95
  "react-dropzone": "^14.3.5",
96
96
  "react-hook-form": "^7.54.2",
97
97
  "react-resizable-panels": "^2.1.7",
98
+ "react-textarea-autosize": "^8.5.7",
98
99
  "recharts": "^2.15.0",
99
100
  "sonner": "^1.7.1",
100
101
  "vaul": "^1.1.2",