@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.
package/Accordion/Accordion.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as React from
|
2
|
-
import * as AccordionPrimitive from
|
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>>;
|
package/Accordion/Accordion.mjs
CHANGED
@@ -1,46 +1,49 @@
|
|
1
1
|
import { jsx as a, jsxs as d } from "react/jsx-runtime";
|
2
|
-
import * as
|
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
|
6
|
-
const
|
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:
|
11
|
-
...
|
10
|
+
className: c("border-b", t),
|
11
|
+
...o
|
12
12
|
}
|
13
13
|
));
|
14
|
-
|
15
|
-
const
|
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:
|
19
|
-
className:
|
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
|
-
|
21
|
+
t
|
22
22
|
),
|
23
|
+
onKeyDown: (n) => {
|
24
|
+
n.key === " " && n.target === n.currentTarget && n.preventDefault();
|
25
|
+
},
|
23
26
|
...r,
|
24
27
|
children: [
|
25
|
-
|
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
|
-
|
31
|
-
const
|
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:
|
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:
|
40
|
+
children: /* @__PURE__ */ a("div", { className: c("pb-4 pt-0", t), children: o })
|
38
41
|
}
|
39
42
|
));
|
40
|
-
|
43
|
+
p.displayName = e.Content.displayName;
|
41
44
|
export {
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
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
|
2
|
-
import { DatePicker as
|
3
|
-
import { FormControl as
|
4
|
-
import { FormRenderControl as
|
5
|
-
const
|
6
|
-
const { form:
|
7
|
-
return /* @__PURE__ */
|
8
|
-
|
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:
|
11
|
-
name:
|
12
|
-
label:
|
13
|
-
render: ({ field:
|
14
|
-
|
10
|
+
form: n,
|
11
|
+
name: a,
|
12
|
+
label: c,
|
13
|
+
render: ({ field: o }) => /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(
|
14
|
+
l,
|
15
15
|
{
|
16
|
-
...
|
17
|
-
...
|
18
|
-
selectedDate:
|
19
|
-
onDateChange:
|
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
|
-
|
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
|
2
|
-
import {
|
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
|
5
|
-
import { isValidReactElement as
|
6
|
-
const
|
7
|
-
const { placeholder: l, renderTrigger: e, slotProps:
|
8
|
-
return e && typeof e == "function" &&
|
9
|
-
},
|
10
|
-
const { renderOption: l, option: e, index:
|
11
|
-
return l && typeof l == "function" &&
|
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
|
-
|
21
|
-
|
22
|
-
|
23
|
-
), u) ? c(l(
|
16
|
+
{ ...a, options: t },
|
17
|
+
o
|
18
|
+
)) ? i(l(
|
24
19
|
e,
|
25
|
-
t,
|
26
20
|
n,
|
27
|
-
|
28
|
-
|
29
|
-
|
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
|
-
|
34
|
-
|
35
|
-
|
36
|
-
},
|
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:
|
41
|
-
nullable:
|
42
|
-
clearLabel:
|
43
|
-
disabled:
|
44
|
-
} =
|
41
|
+
onChange: n,
|
42
|
+
nullable: t = !1,
|
43
|
+
clearLabel: a = "Clear",
|
44
|
+
disabled: o
|
45
|
+
} = r;
|
45
46
|
return /* @__PURE__ */ d(
|
46
|
-
|
47
|
+
p,
|
47
48
|
{
|
48
49
|
value: l,
|
49
|
-
onValueChange:
|
50
|
-
disabled:
|
50
|
+
onValueChange: n,
|
51
|
+
disabled: o,
|
51
52
|
children: [
|
52
|
-
/* @__PURE__ */
|
53
|
-
/* @__PURE__ */ d(
|
54
|
-
|
55
|
-
|
56
|
-
}, children:
|
57
|
-
e.map((
|
58
|
-
|
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
|
-
...
|
61
|
-
|
62
|
-
|
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
|
-
|
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.
|
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",
|