@oneplatformdev/ui 0.0.1-beta.7 → 0.0.1-beta.70
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 +2 -2
- package/Accordion/Accordion.mjs +23 -20
- package/AlertDialog/AlertDialogRoot.d.ts +2 -2
- package/AlertDialog/AlertDialogRoot.mjs +7 -7
- package/Button/buttonVariants.mjs +4 -4
- package/Calendar/Calendar.mjs +3 -2
- package/Checkbox/Checkbox.d.ts +5 -4
- package/Checkbox/Checkbox.mjs +48 -21
- package/Checkbox/Checkbox.types.d.ts +10 -0
- package/Checkbox/index.d.ts +2 -1
- package/Checkbox/index.mjs +3 -2
- package/Combobox/Combobox.d.ts +2 -2
- package/Combobox/Combobox.mjs +127 -87
- package/Combobox/Combobox.types.d.ts +13 -1
- package/Command/Command.d.ts +1 -1
- package/DataTable/DataTable.d.ts +10 -3
- package/DataTable/DataTable.mjs +33 -33
- package/DataTable/DataTableColumnFilter.d.ts +4 -0
- package/DataTable/DataTableColumnFilter.mjs +31 -0
- package/DatePicker/DatePicker.mjs +2 -2
- package/Dialog/Dialog.d.ts +2 -2
- package/Dialog/Dialog.mjs +14 -12
- package/Dropzone/Dropzone.d.ts +22 -0
- package/Dropzone/Dropzone.mjs +151 -0
- package/Dropzone/Dropzone.types.d.ts +38 -0
- package/Dropzone/DropzoneFilePreview.d.ts +4 -0
- package/Dropzone/DropzoneFilePreview.mjs +9 -0
- package/Dropzone/DropzoneSinglePickPreview.d.ts +9 -0
- package/Dropzone/DropzoneSinglePickPreview.mjs +38 -0
- package/Dropzone/DropzoneUtils.d.ts +5 -0
- package/Dropzone/DropzoneUtils.mjs +24 -0
- package/Dropzone/index.d.ts +2 -0
- package/Dropzone/index.mjs +7 -0
- package/Dropzone/package.json +7 -0
- package/DropzoneFilePreview-Dhtv8F4u.js +67 -0
- package/Form/Form.d.ts +2 -2
- package/Form/Form.mjs +48 -45
- package/Form/FormRenderControl.d.ts +2 -3
- package/Form/FormRenderControl.mjs +10 -10
- package/Form/FormRenderControl.types.d.ts +5 -7
- package/FormCheckbox/FormCheckbox.d.ts +2 -3
- package/FormCheckbox/FormCheckbox.mjs +23 -23
- package/FormCheckbox/FormCheckbox.types.d.ts +3 -3
- package/FormCombobox/FormCombobox.d.ts +2 -2
- package/FormCombobox/FormCombobox.types.d.ts +2 -3
- package/FormDatePicker/FormDatePicker.d.ts +2 -2
- package/FormDatePicker/FormDatePicker.mjs +20 -18
- package/FormDatePicker/FormDatePicker.types.d.ts +2 -3
- package/FormDropzone/FormDropzone.d.ts +4 -0
- package/FormDropzone/FormDropzone.mjs +19 -0
- package/FormDropzone/FormDropzone.types.d.ts +6 -0
- package/FormDropzone/index.d.ts +2 -0
- package/FormDropzone/index.mjs +4 -0
- package/FormDropzone/package.json +7 -0
- package/FormInput/FormInput.d.ts +2 -3
- package/FormInput/FormInput.types.d.ts +2 -3
- package/FormRadio/FormRadio.d.ts +4 -0
- package/FormRadio/FormRadio.mjs +40 -0
- package/FormRadio/FormRadio.types.d.ts +6 -0
- package/FormRadio/index.d.ts +2 -0
- package/FormRadio/index.mjs +4 -0
- package/FormRadio/package.json +7 -0
- package/FormSelect/FormSelect.d.ts +2 -3
- package/FormSelect/FormSelect.mjs +19 -17
- package/FormSelect/FormSelect.types.d.ts +2 -3
- package/FormTextarea/FormTextarea.d.ts +2 -3
- package/FormTextarea/FormTextarea.mjs +13 -12
- package/FormTextarea/FormTextarea.types.d.ts +2 -3
- package/Input/Input.mjs +40 -34
- package/Input/Input.types.d.ts +4 -1
- package/Input/inputVariants.mjs +9 -3
- package/Label/Label.d.ts +2 -2
- package/Label/labelVariants.mjs +7 -4
- package/LazyLoader/LazyLoader.mjs +5 -4
- package/LoadingMask/LoadingMask.d.ts +4 -1
- package/LoadingMask/LoadingMask.mjs +18 -56
- package/LoadingMask/LoadingMask.types.d.ts +5 -0
- package/LoadingMask/RenderLoadingMask.d.ts +3 -0
- package/LoadingMask/RenderLoadingMask.mjs +108 -0
- package/LoadingMask/index.d.ts +2 -0
- package/LoadingMask/index.mjs +4 -2
- package/Radio/Radio.d.ts +4 -0
- package/Radio/Radio.mjs +12 -0
- package/Radio/Radio.types.d.ts +11 -0
- package/Radio/index.d.ts +2 -0
- package/Radio/index.mjs +4 -0
- package/Radio/package.json +7 -0
- package/RadioGroup/RadioGroup.d.ts +9 -3
- package/RadioGroup/RadioGroup.mjs +37 -19
- package/RadioGroup/index.mjs +4 -3
- package/ScrollArea/ScrollArea.d.ts +2 -2
- package/ScrollArea/ScrollArea.mjs +26 -13
- package/Select/Select.mjs +93 -63
- package/Select/Select.types.d.ts +9 -2
- package/Select/SelectRoot.d.ts +2 -2
- package/Select/SelectRoot.mjs +1 -0
- package/TablePagination/TablePagination.d.ts +16 -0
- package/TablePagination/TablePagination.mjs +74 -0
- package/TablePagination/index.d.ts +1 -0
- package/TablePagination/index.mjs +4 -0
- package/TablePagination/package.json +7 -0
- package/Tabs/Tabs.d.ts +3 -2
- package/Tabs/Tabs.mjs +20 -6
- package/Tabs/Tabs.types.d.ts +5 -2
- package/Tabs/index.mjs +8 -7
- package/Textarea/Textarea.d.ts +1 -1
- package/Textarea/Textarea.mjs +71 -15
- package/Textarea/Textarea.types.d.ts +16 -2
- package/Textarea/useAutosizeTextArea.d.ts +3 -0
- package/Textarea/useAutosizeTextArea.mjs +20 -0
- package/Toast/toastVariants.mjs +3 -3
- package/index.css +1 -1
- package/index.d.ts +3 -0
- package/index.mjs +332 -318
- package/package.json +9 -8
- package/tailwind.config.mjs +13 -13
@@ -1,38 +1,51 @@
|
|
1
|
-
import { jsxs as
|
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
|
5
|
-
|
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:
|
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(
|
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
|
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:
|
28
|
+
className: s(
|
25
29
|
"flex touch-none select-none transition-colors",
|
26
|
-
|
27
|
-
l === "
|
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(
|
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
|
-
|
47
|
+
d.displayName = r.ScrollAreaScrollbar.displayName;
|
35
48
|
export {
|
36
49
|
m as ScrollArea,
|
37
|
-
|
50
|
+
d as ScrollBar
|
38
51
|
};
|
package/Select/Select.mjs
CHANGED
@@ -1,72 +1,102 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import {
|
1
|
+
import { jsxs as u, jsx as i, Fragment as x } from "react/jsx-runtime";
|
2
|
+
import { createElement as s, isValidElement as S } from "react";
|
3
|
+
import { Button as y } from "../Button/Button.mjs";
|
3
4
|
import "../Button/buttonVariants.mjs";
|
4
|
-
import { SelectRoot as
|
5
|
-
import { isValidReactElement as
|
6
|
-
const
|
7
|
-
const { placeholder:
|
8
|
-
return e && typeof e == "function" &&
|
9
|
-
},
|
10
|
-
const {
|
11
|
-
return
|
12
|
-
e,
|
13
|
-
n,
|
14
|
-
l,
|
15
|
-
{ ...c, options: l },
|
16
|
-
r
|
17
|
-
)) ? i(t(
|
18
|
-
e,
|
19
|
-
n,
|
20
|
-
l,
|
21
|
-
{ ...c, options: l },
|
22
|
-
r
|
23
|
-
), u) ? i(t(
|
24
|
-
e,
|
25
|
-
n,
|
26
|
-
l,
|
27
|
-
{ ...c, options: l },
|
28
|
-
r
|
29
|
-
)) : /* @__PURE__ */ a(u, { value: e.value, children: t(
|
30
|
-
e,
|
31
|
-
n,
|
32
|
-
l,
|
33
|
-
{ ...c, options: l },
|
34
|
-
r
|
35
|
-
) }, e.value) : r;
|
36
|
-
}, T = (o) => {
|
37
|
-
const {
|
38
|
-
value: t,
|
39
|
-
options: e,
|
40
|
-
onChange: n,
|
41
|
-
nullable: l = !1,
|
42
|
-
clearLabel: c = "Clear",
|
43
|
-
disabled: r
|
44
|
-
} = o;
|
45
|
-
return /* @__PURE__ */ d(
|
5
|
+
import { SelectRoot as R, SelectContent as b, SelectTrigger as C, SelectValue as V, SelectItem as p } from "./SelectRoot.mjs";
|
6
|
+
import { isValidReactElement as k } from "@oneplatformdev/utils";
|
7
|
+
const B = (t) => {
|
8
|
+
const { placeholder: n, renderTrigger: e, slotProps: l } = t, r = /* @__PURE__ */ i(C, { ...(l == null ? void 0 : l.triggerProps) || {}, children: /* @__PURE__ */ i(V, { placeholder: n }) });
|
9
|
+
return e && typeof e == "function" && k(e(t, r)) ? e(t, r) : r;
|
10
|
+
}, d = (t) => {
|
11
|
+
const { children: n, option: e, deep: l = 0 } = t;
|
12
|
+
return /* @__PURE__ */ u(
|
46
13
|
p,
|
47
14
|
{
|
48
|
-
value:
|
49
|
-
|
50
|
-
|
15
|
+
value: e.value,
|
16
|
+
className: "cursor-pointer",
|
17
|
+
style: { paddingLeft: `calc(8px + ${(l || 0) * 8}px)` },
|
51
18
|
children: [
|
52
|
-
|
53
|
-
/* @__PURE__ */
|
54
|
-
l && /* @__PURE__ */ a(f, { className: "w-full px-2", variant: "secondary", size: "sm", onClick: () => {
|
55
|
-
n("");
|
56
|
-
}, children: c }),
|
57
|
-
e.map((s, m) => /* @__PURE__ */ a(
|
58
|
-
C,
|
59
|
-
{
|
60
|
-
...o,
|
61
|
-
option: s,
|
62
|
-
index: m
|
63
|
-
}
|
64
|
-
))
|
65
|
-
] })
|
19
|
+
!n && e.label,
|
20
|
+
n && /* @__PURE__ */ i(x, { children: typeof n == "function" ? n({ ...t }) : n })
|
66
21
|
]
|
67
|
-
}
|
22
|
+
},
|
23
|
+
e.value
|
68
24
|
);
|
25
|
+
}, g = (t) => {
|
26
|
+
var c, o;
|
27
|
+
const { renderOption: n, option: e, index: l, options: r, deep: m = 0, ...a } = t;
|
28
|
+
return n && typeof n == "function" && S(
|
29
|
+
n(
|
30
|
+
e,
|
31
|
+
l,
|
32
|
+
r,
|
33
|
+
{ ...a, options: r },
|
34
|
+
/* @__PURE__ */ i(d, { ...t })
|
35
|
+
)
|
36
|
+
) ? /* @__PURE__ */ i(p, { value: e.value, children: n(
|
37
|
+
e,
|
38
|
+
l,
|
39
|
+
r,
|
40
|
+
{ ...a, options: r },
|
41
|
+
/* @__PURE__ */ i(d, { ...t })
|
42
|
+
) }, e.value) : (c = e.children) != null && c.length ? /* @__PURE__ */ u(
|
43
|
+
"div",
|
44
|
+
{
|
45
|
+
className: "flex flex-col gap-1 truncate line-clamp-2",
|
46
|
+
children: [
|
47
|
+
/* @__PURE__ */ i(d, { ...t }),
|
48
|
+
(o = e.children) == null ? void 0 : o.map((f, h, v) => /* @__PURE__ */ s(
|
49
|
+
g,
|
50
|
+
{
|
51
|
+
...t,
|
52
|
+
key: f.value,
|
53
|
+
option: f,
|
54
|
+
options: v,
|
55
|
+
index: h,
|
56
|
+
deep: (m || 0) + 1
|
57
|
+
}
|
58
|
+
))
|
59
|
+
]
|
60
|
+
},
|
61
|
+
e.value
|
62
|
+
) : /* @__PURE__ */ i(d, { ...t });
|
63
|
+
}, w = (t) => {
|
64
|
+
const {
|
65
|
+
value: n,
|
66
|
+
options: e,
|
67
|
+
onChange: l,
|
68
|
+
nullable: r = !1,
|
69
|
+
clearLabel: m = "Clear",
|
70
|
+
disabled: a
|
71
|
+
} = t;
|
72
|
+
return /* @__PURE__ */ u(R, { value: n, onValueChange: l, disabled: a, children: [
|
73
|
+
/* @__PURE__ */ i(B, { ...t }),
|
74
|
+
/* @__PURE__ */ u(b, { children: [
|
75
|
+
r && /* @__PURE__ */ i(
|
76
|
+
y,
|
77
|
+
{
|
78
|
+
className: "w-full px-2",
|
79
|
+
variant: "secondary",
|
80
|
+
size: "sm",
|
81
|
+
onClick: () => {
|
82
|
+
l == null || l("");
|
83
|
+
},
|
84
|
+
children: m
|
85
|
+
}
|
86
|
+
),
|
87
|
+
e.map((c, o) => /* @__PURE__ */ s(
|
88
|
+
g,
|
89
|
+
{
|
90
|
+
...t,
|
91
|
+
key: c.value,
|
92
|
+
option: c,
|
93
|
+
index: o,
|
94
|
+
deep: 0
|
95
|
+
}
|
96
|
+
))
|
97
|
+
] })
|
98
|
+
] });
|
69
99
|
};
|
70
100
|
export {
|
71
|
-
|
101
|
+
w as Select
|
72
102
|
};
|
package/Select/Select.types.d.ts
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
-
import { ReactNode } from 'react';
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
2
2
|
|
3
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
3
4
|
export interface SelectOption<ExtendOptionData> {
|
4
5
|
value: string;
|
5
6
|
label?: ReactNode;
|
6
7
|
data?: ExtendOptionData;
|
8
|
+
children?: SelectOption<ExtendOptionData>[];
|
7
9
|
}
|
8
10
|
export type SelectRenderTrigger<ExtendOptionData> = (props: Omit<SelectProps<ExtendOptionData>, 'renderTrigger'>, defaultComponent: ReactNode) => ReactNode;
|
9
11
|
export type SelectRenderOption<ExtendOptionData> = (option: SelectOption<ExtendOptionData>, index: number, options: SelectOption<ExtendOptionData>[], props: Omit<SelectProps<ExtendOptionData>, 'renderOption'>, defaultComponent: ReactNode) => ReactNode;
|
@@ -15,7 +17,7 @@ export interface SelectProps<ExtendOptionData> {
|
|
15
17
|
/** Select placeholder string. */
|
16
18
|
placeholder?: string;
|
17
19
|
/** Select Root onValueChange handler. */
|
18
|
-
onChange
|
20
|
+
onChange?: (value: SelectOption<ExtendOptionData>['value']) => void;
|
19
21
|
/** Show reset select item button. */
|
20
22
|
disabled?: boolean;
|
21
23
|
/** Show reset select item button. */
|
@@ -26,4 +28,9 @@ export interface SelectProps<ExtendOptionData> {
|
|
26
28
|
renderTrigger?: SelectRenderTrigger<ExtendOptionData>;
|
27
29
|
/** Render custom option. */
|
28
30
|
renderOption?: SelectRenderOption<ExtendOptionData>;
|
31
|
+
/** Select Slot props */
|
32
|
+
slotProps?: {
|
33
|
+
/** Select Default Trigger Props */
|
34
|
+
triggerProps?: ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>;
|
35
|
+
};
|
29
36
|
}
|
package/Select/SelectRoot.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as React from
|
2
|
-
import * as SelectPrimitive from
|
1
|
+
import * as React from 'react';
|
2
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
3
3
|
declare const SelectRoot: React.FC<SelectPrimitive.SelectProps>;
|
4
4
|
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
5
5
|
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
package/Select/SelectRoot.mjs
CHANGED
@@ -9,6 +9,7 @@ const v = e.Root, R = e.Group, C = e.Value, h = l.forwardRef(({ className: o, ch
|
|
9
9
|
ref: d,
|
10
10
|
className: s(
|
11
11
|
"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
12
|
+
"[&>svg]:disabled:hidden",
|
12
13
|
o
|
13
14
|
),
|
14
15
|
...a,
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { FC } from 'react';
|
2
|
+
|
3
|
+
interface IProps {
|
4
|
+
limit: number;
|
5
|
+
offset: number;
|
6
|
+
totalRows: number;
|
7
|
+
setLimit: (limit: number) => void;
|
8
|
+
setOffset: (offset: number) => void;
|
9
|
+
tRowsPerPage?: string;
|
10
|
+
tPrevious?: string;
|
11
|
+
tPage?: string;
|
12
|
+
tNext?: string;
|
13
|
+
tOf?: string;
|
14
|
+
}
|
15
|
+
export declare const TablePagination: FC<IProps>;
|
16
|
+
export {};
|
@@ -0,0 +1,74 @@
|
|
1
|
+
import { jsxs as c, jsx as n } from "react/jsx-runtime";
|
2
|
+
import { Button as i } from "../Button/Button.mjs";
|
3
|
+
import "../Button/buttonVariants.mjs";
|
4
|
+
import "../Select/SelectRoot.mjs";
|
5
|
+
import { Select as P } from "../Select/Select.mjs";
|
6
|
+
const y = ({
|
7
|
+
offset: l,
|
8
|
+
limit: a,
|
9
|
+
totalRows: s,
|
10
|
+
setLimit: p,
|
11
|
+
setOffset: t,
|
12
|
+
tRowsPerPage: d = "Rows per page",
|
13
|
+
tPrevious: u = "Previous",
|
14
|
+
tPage: x = "Page",
|
15
|
+
tNext: v = "Next",
|
16
|
+
tOf: h = "Of"
|
17
|
+
}) => {
|
18
|
+
const r = Math.ceil(l / a) + 1, o = Math.ceil(s / a), m = r === o, b = (e) => {
|
19
|
+
t(0), p(parseInt(e));
|
20
|
+
}, g = () => {
|
21
|
+
let e = l - a;
|
22
|
+
e < 0 && (e = 0), t(e);
|
23
|
+
}, N = () => {
|
24
|
+
let e = l + a;
|
25
|
+
e > s && (e = s - a), t(e);
|
26
|
+
};
|
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: [
|
29
|
+
/* @__PURE__ */ n("span", { className: "text-sm text-nowrap", children: d }),
|
30
|
+
/* @__PURE__ */ n(
|
31
|
+
P,
|
32
|
+
{
|
33
|
+
value: a == null ? void 0 : a.toString(),
|
34
|
+
options: [
|
35
|
+
{ value: "5", label: "5" },
|
36
|
+
{ value: "10", label: "10" },
|
37
|
+
{ value: "20", label: "20" },
|
38
|
+
{ value: "30", label: "30" },
|
39
|
+
{ value: "50", label: "50" }
|
40
|
+
],
|
41
|
+
onChange: b,
|
42
|
+
placeholder: "6",
|
43
|
+
nullable: !1
|
44
|
+
}
|
45
|
+
)
|
46
|
+
] }),
|
47
|
+
/* @__PURE__ */ c("div", { className: "space-x-2", children: [
|
48
|
+
/* @__PURE__ */ n(
|
49
|
+
i,
|
50
|
+
{
|
51
|
+
variant: "outline",
|
52
|
+
size: "sm",
|
53
|
+
disabled: !l,
|
54
|
+
onClick: g,
|
55
|
+
children: u
|
56
|
+
}
|
57
|
+
),
|
58
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: `${x} ${r} ${h} ${o}` }),
|
59
|
+
/* @__PURE__ */ n(
|
60
|
+
i,
|
61
|
+
{
|
62
|
+
variant: "outline",
|
63
|
+
size: "sm",
|
64
|
+
disabled: m,
|
65
|
+
onClick: N,
|
66
|
+
children: v
|
67
|
+
}
|
68
|
+
)
|
69
|
+
] })
|
70
|
+
] });
|
71
|
+
};
|
72
|
+
export {
|
73
|
+
y as TablePagination
|
74
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './TablePagination';
|
package/Tabs/Tabs.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { TabsProps } from './Tabs.types';
|
2
|
-
import { FC } from 'react';
|
2
|
+
import { FC, PropsWithChildren } from 'react';
|
3
3
|
|
4
|
-
export declare const
|
4
|
+
export declare const TabRender: FC<TabsProps>;
|
5
|
+
export declare const Tabs: FC<PropsWithChildren<TabsProps>>;
|
package/Tabs/Tabs.mjs
CHANGED
@@ -1,9 +1,23 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
import { jsx as o, jsxs as c } from "react/jsx-runtime";
|
2
|
+
import { Children as p } from "react";
|
3
|
+
import { TabsContent as m, TabsRoot as b, TabsList as i, TabsTrigger as h } from "./TabsRoot.mjs";
|
4
|
+
const T = (a) => {
|
5
|
+
const { tabs: s = [], contents: t } = a;
|
6
|
+
return p.map(t, (n, r) => {
|
7
|
+
var l;
|
8
|
+
if (!n || !s[r]) return null;
|
9
|
+
const e = (l = s[r]) == null ? void 0 : l.value, u = n.props || {};
|
10
|
+
return /* @__PURE__ */ o(m, { value: e, ...u, children: n }, e);
|
11
|
+
});
|
12
|
+
}, f = (a) => {
|
13
|
+
const { tab: s, tabs: t = [], onChange: n, children: r } = a;
|
14
|
+
return /* @__PURE__ */ c(b, { value: s, onValueChange: n, children: [
|
15
|
+
/* @__PURE__ */ o(i, { className: "px-2 py-6 bg-[#E0E7FF] rounded-[6px]", children: t.map((e) => /* @__PURE__ */ o(h, { value: e.value, className: "h-8", children: e.label }, e.value)) }),
|
16
|
+
r,
|
17
|
+
!r && /* @__PURE__ */ o(T, { ...a })
|
18
|
+
] });
|
6
19
|
};
|
7
20
|
export {
|
8
|
-
|
21
|
+
T as TabRender,
|
22
|
+
f as Tabs
|
9
23
|
};
|
package/Tabs/Tabs.types.d.ts
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
+
import { ReactElement } from 'react';
|
2
|
+
|
1
3
|
export interface TabItemProps {
|
2
4
|
value: string;
|
3
5
|
label: string;
|
4
6
|
}
|
5
7
|
export interface TabsProps {
|
6
8
|
tabs: TabItemProps[];
|
7
|
-
tab
|
8
|
-
onChange
|
9
|
+
tab?: string;
|
10
|
+
onChange?: (value: string) => void;
|
11
|
+
contents?: ReactElement[];
|
9
12
|
}
|
package/Tabs/index.mjs
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
import { TabsContent as
|
2
|
-
import { Tabs as
|
1
|
+
import { TabsContent as T, TabsList as a, TabsRoot as b, TabsTrigger as e } from "./TabsRoot.mjs";
|
2
|
+
import { TabRender as t, Tabs as n } from "./Tabs.mjs";
|
3
3
|
export {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
t as TabRender,
|
5
|
+
n as Tabs,
|
6
|
+
T as TabsContent,
|
7
|
+
a as TabsList,
|
8
|
+
b as TabsRoot,
|
9
|
+
e as TabsTrigger
|
9
10
|
};
|
package/Textarea/Textarea.d.ts
CHANGED
package/Textarea/Textarea.mjs
CHANGED
@@ -1,18 +1,74 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import * as
|
3
|
-
import {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
+
] });
|
13
69
|
}
|
14
|
-
)
|
15
|
-
|
70
|
+
);
|
71
|
+
T.displayName = "Textarea";
|
16
72
|
export {
|
17
|
-
|
73
|
+
T as Textarea
|
18
74
|
};
|
@@ -1,4 +1,18 @@
|
|
1
|
-
import { ComponentProps } from 'react';
|
1
|
+
import { ComponentProps, RefObject } from 'react';
|
2
2
|
|
3
|
-
export interface
|
3
|
+
export interface IUseAutosizeTextAreaProps {
|
4
|
+
textAreaRef: RefObject<HTMLTextAreaElement | null>;
|
5
|
+
triggerAutoSize: string;
|
6
|
+
/**
|
7
|
+
* The minimum height of the textarea.
|
8
|
+
*/
|
9
|
+
minHeight?: number;
|
10
|
+
/**
|
11
|
+
* The maximum height of the textarea.
|
12
|
+
*/
|
13
|
+
maxHeight?: number;
|
14
|
+
}
|
15
|
+
export interface TextareaProps extends ComponentProps<'textarea'>, Pick<IUseAutosizeTextAreaProps, 'minHeight' | 'maxHeight'> {
|
16
|
+
resizeble?: boolean;
|
17
|
+
counter?: boolean;
|
4
18
|
}
|
@@ -0,0 +1,20 @@
|
|
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
|
+
};
|
18
|
+
export {
|
19
|
+
u as useAutosizeTextArea
|
20
|
+
};
|
package/Toast/toastVariants.mjs
CHANGED
@@ -6,9 +6,9 @@ const a = t(
|
|
6
6
|
variant: {
|
7
7
|
default: "border bg-background text-foreground",
|
8
8
|
destructive: "destructive group border-destructive bg-destructive text-destructive-foreground",
|
9
|
-
success: "",
|
10
|
-
info: "",
|
11
|
-
update: ""
|
9
|
+
success: "border bg-primary text-white",
|
10
|
+
info: "border bg-blue-400 text-white",
|
11
|
+
update: "border bg-orange-400 text-white"
|
12
12
|
}
|
13
13
|
},
|
14
14
|
defaultVariants: {
|