@oneplatformdev/ui 0.0.1-beta.3 → 0.0.1-beta.30
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/AlertDialog/AlertDialog.d.ts +14 -0
- package/AlertDialog/AlertDialog.mjs +58 -60
- package/Button/buttonVariants.mjs +3 -3
- package/Combobox/Combobox.mjs +71 -60
- package/Combobox/Combobox.types.d.ts +7 -0
- package/Dropzone/Dropzone.d.ts +22 -0
- package/Dropzone/Dropzone.mjs +136 -0
- package/Dropzone/Dropzone.types.d.ts +36 -0
- package/Dropzone/DropzoneFilePreview.d.ts +4 -0
- package/Dropzone/DropzoneFilePreview.mjs +9 -0
- package/Dropzone/DropzoneUtils.d.ts +4 -0
- package/Dropzone/DropzoneUtils.mjs +15 -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/FormDropzone/FormDropzone.d.ts +4 -0
- package/FormDropzone/FormDropzone.mjs +26 -0
- package/FormDropzone/FormDropzone.types.d.ts +7 -0
- package/FormDropzone/index.d.ts +2 -0
- package/FormDropzone/index.mjs +4 -0
- package/FormDropzone/package.json +7 -0
- package/FormInput/FormInput.mjs +6 -7
- package/FormSelect/FormSelect.types.d.ts +2 -1
- package/Input/Input.mjs +42 -37
- package/Input/Input.types.d.ts +3 -1
- package/Input/index.mjs +5 -8
- package/Search/Search.mjs +10 -11
- package/Sidebar/Sidebar.mjs +13 -14
- 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/index.css +1 -1
- package/index.d.ts +2 -0
- package/index.mjs +357 -352
- package/package.json +9 -8
@@ -0,0 +1,67 @@
|
|
1
|
+
import { jsx as l, jsxs as d } from "react/jsx-runtime";
|
2
|
+
import { useState as m, useEffect as f } from "react";
|
3
|
+
import { File as s } from "lucide-react";
|
4
|
+
import { isFile as o } from "./Dropzone/DropzoneUtils.mjs";
|
5
|
+
import { cn as c } from "@oneplatformdev/utils";
|
6
|
+
const h = [
|
7
|
+
"application/msword",
|
8
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
9
|
+
"text/csv",
|
10
|
+
"text/plain",
|
11
|
+
"application/pdf"
|
12
|
+
], u = [
|
13
|
+
"image/png",
|
14
|
+
"image/jpeg",
|
15
|
+
"image/jpg",
|
16
|
+
"image/webp",
|
17
|
+
"image/gif"
|
18
|
+
], j = ({ item: e, styles: r }) => {
|
19
|
+
const [t, a] = m(null), p = o(e) && u.includes(e.type);
|
20
|
+
return f(() => {
|
21
|
+
let n = null;
|
22
|
+
if (o(e) && p) {
|
23
|
+
const i = new FileReader();
|
24
|
+
return i.onloadend = () => a(i.result), i.readAsDataURL(e), () => a(null);
|
25
|
+
} else {
|
26
|
+
if (typeof e == "string")
|
27
|
+
return n = new Image(), n.src = e, n.onload = () => a(e), n.onerror = () => a(null), () => {
|
28
|
+
n.onload = null, n.onerror = null;
|
29
|
+
};
|
30
|
+
a(null);
|
31
|
+
}
|
32
|
+
return () => a(null);
|
33
|
+
}, [e, p]), /* @__PURE__ */ l(
|
34
|
+
"div",
|
35
|
+
{
|
36
|
+
className: c(
|
37
|
+
"w-32 h-32 border border-gray-300 rounded-md overflow-hidden flex items-center justify-center",
|
38
|
+
r == null ? void 0 : r.previewWraper
|
39
|
+
),
|
40
|
+
children: t ? /* @__PURE__ */ l(
|
41
|
+
"img",
|
42
|
+
{
|
43
|
+
src: t,
|
44
|
+
alt: o(e) ? e.name : "external-image",
|
45
|
+
className: c("w-full h-full object-cover", r == null ? void 0 : r.previewImage)
|
46
|
+
}
|
47
|
+
) : /* @__PURE__ */ d(
|
48
|
+
"div",
|
49
|
+
{
|
50
|
+
className: c(
|
51
|
+
"flex flex-col items-center justify-center text-gray-500 text-sm p-2 text-center",
|
52
|
+
r == null ? void 0 : r.previewFile
|
53
|
+
),
|
54
|
+
children: [
|
55
|
+
/* @__PURE__ */ l(s, { className: "w-6 h-6" }),
|
56
|
+
o(e) ? /* @__PURE__ */ l("span", { className: "text-xs break-all", children: e.name }) : /* @__PURE__ */ l("span", { className: "text-xs break-all", children: e })
|
57
|
+
]
|
58
|
+
}
|
59
|
+
)
|
60
|
+
}
|
61
|
+
);
|
62
|
+
};
|
63
|
+
export {
|
64
|
+
h as D,
|
65
|
+
j as F,
|
66
|
+
u as a
|
67
|
+
};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { FormDropzoneProps } from './FormDropzone.types';
|
2
|
+
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
3
|
+
|
4
|
+
export declare const FormDropzone: <Data extends FieldValues, Form extends UseFormReturn<Data>>(props: FormDropzoneProps<Data, Form>) => import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
2
|
+
import { FormControl as a } from "../Form/Form.mjs";
|
3
|
+
import { FormRenderControl as l } from "../Form/FormRenderControl.mjs";
|
4
|
+
import { Dropzone as f } from "../Dropzone/Dropzone.mjs";
|
5
|
+
const h = (n) => {
|
6
|
+
const { form: e, label: m, name: t, ...p } = n;
|
7
|
+
return /* @__PURE__ */ o(
|
8
|
+
l,
|
9
|
+
{
|
10
|
+
form: e,
|
11
|
+
label: m,
|
12
|
+
name: t,
|
13
|
+
render: ({ field: r }) => /* @__PURE__ */ o(a, { children: /* @__PURE__ */ o(
|
14
|
+
f,
|
15
|
+
{
|
16
|
+
...p,
|
17
|
+
...r,
|
18
|
+
onChangeValue: r.onChange
|
19
|
+
}
|
20
|
+
) })
|
21
|
+
}
|
22
|
+
);
|
23
|
+
};
|
24
|
+
export {
|
25
|
+
h as FormDropzone
|
26
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { FormRenderControlExtendProps } from '../Form';
|
2
|
+
import { DropzoneProps } from '../Dropzone';
|
3
|
+
import { UseFormReturn } from 'react-hook-form';
|
4
|
+
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
5
|
+
|
6
|
+
export interface FormDropzoneProps<Data extends FieldValues, Form extends UseFormReturn<Data>> extends FormRenderControlExtendProps<Data, Form>, DropzoneProps {
|
7
|
+
}
|
package/FormInput/FormInput.mjs
CHANGED
@@ -1,18 +1,17 @@
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
2
2
|
import { FormControl as l } from "../Form/Form.mjs";
|
3
|
-
import { FormRenderControl as
|
4
|
-
import "../Input/
|
5
|
-
|
6
|
-
const d = (m) => {
|
3
|
+
import { FormRenderControl as u } from "../Form/FormRenderControl.mjs";
|
4
|
+
import { Input as a } from "../Input/Input.mjs";
|
5
|
+
const F = (m) => {
|
7
6
|
const { form: t, label: e, name: n, ...p } = m;
|
8
7
|
return /* @__PURE__ */ r(
|
9
|
-
|
8
|
+
u,
|
10
9
|
{
|
11
10
|
form: t,
|
12
11
|
name: n,
|
13
12
|
label: e,
|
14
13
|
render: ({ field: o }) => /* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(
|
15
|
-
|
14
|
+
a,
|
16
15
|
{
|
17
16
|
...o,
|
18
17
|
value: o.value || "",
|
@@ -23,5 +22,5 @@ const d = (m) => {
|
|
23
22
|
);
|
24
23
|
};
|
25
24
|
export {
|
26
|
-
|
25
|
+
F as FormInput
|
27
26
|
};
|
@@ -1,7 +1,8 @@
|
|
1
|
+
import { PartialOne } from '../../../utils/src';
|
1
2
|
import { SelectProps } from '../Select';
|
2
3
|
import { FormRenderControlExtendProps } from '../Form';
|
3
4
|
import { UseFormReturn } from 'react-hook-form';
|
4
5
|
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
5
6
|
|
6
|
-
export interface FormSelectProps<Data extends FieldValues, Form extends UseFormReturn<Data>, ExtendOptionData> extends FormRenderControlExtendProps<Data, Form>, SelectProps<ExtendOptionData> {
|
7
|
+
export interface FormSelectProps<Data extends FieldValues, Form extends UseFormReturn<Data>, ExtendOptionData> extends FormRenderControlExtendProps<Data, Form>, PartialOne<SelectProps<ExtendOptionData>, 'onChange'> {
|
7
8
|
}
|
package/Input/Input.mjs
CHANGED
@@ -1,61 +1,66 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import
|
3
|
-
import { Eye as
|
4
|
-
import { inputVariants as
|
5
|
-
import { cn as
|
6
|
-
const
|
7
|
-
(t,
|
1
|
+
import { jsxs as f, jsx as s } from "react/jsx-runtime";
|
2
|
+
import u, { useState as N } from "react";
|
3
|
+
import { Eye as g, EyeOff as b } from "lucide-react";
|
4
|
+
import { inputVariants as v } from "./inputVariants.mjs";
|
5
|
+
import { cn as h } from "@oneplatformdev/utils";
|
6
|
+
const c = u.forwardRef(
|
7
|
+
(t, a) => {
|
8
8
|
const {
|
9
|
-
className:
|
10
|
-
variant:
|
11
|
-
type:
|
12
|
-
slotProps: { input:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
className: e,
|
10
|
+
variant: o,
|
11
|
+
type: i,
|
12
|
+
slotProps: { input: l } = {},
|
13
|
+
onChange: m,
|
14
|
+
onTransform: n,
|
15
|
+
...y
|
16
|
+
} = t, { startAdornment: p } = l || {};
|
17
|
+
return /* @__PURE__ */ f("div", { className: "relative", children: [
|
18
|
+
!!p && /* @__PURE__ */ s("span", { className: "absolute left-[10px] top-1/2 -translate-y-1/2", children: p }),
|
17
19
|
/* @__PURE__ */ s(
|
18
20
|
"input",
|
19
21
|
{
|
20
|
-
type:
|
21
|
-
className:
|
22
|
-
|
23
|
-
!!
|
22
|
+
type: i,
|
23
|
+
className: h(
|
24
|
+
v({ variant: o, className: e }),
|
25
|
+
!!p && "pl-8"
|
24
26
|
),
|
25
|
-
ref:
|
26
|
-
...
|
27
|
+
ref: a,
|
28
|
+
...y,
|
29
|
+
onChange: (r) => {
|
30
|
+
typeof (n == null ? void 0 : n(r.target.value, r)) == "string" && (r.target.value = n(r.target.value, r)), m && m(r);
|
31
|
+
}
|
27
32
|
}
|
28
33
|
)
|
29
34
|
] });
|
30
35
|
}
|
31
36
|
);
|
32
|
-
|
33
|
-
const
|
34
|
-
(t,
|
35
|
-
const [
|
36
|
-
|
37
|
+
c.displayName = "Input";
|
38
|
+
const d = u.forwardRef(
|
39
|
+
(t, a) => {
|
40
|
+
const [e, o] = N(!1), i = e ? "text" : "password", l = () => {
|
41
|
+
o(!e);
|
37
42
|
};
|
38
|
-
return /* @__PURE__ */
|
39
|
-
/* @__PURE__ */ s(
|
40
|
-
/* @__PURE__ */ s(w, { isVisible:
|
43
|
+
return /* @__PURE__ */ f("div", { className: "relative", children: [
|
44
|
+
/* @__PURE__ */ s(c, { ...t, type: i, className: "pr-8", ref: a }),
|
45
|
+
/* @__PURE__ */ s(w, { isVisible: e, onClick: l })
|
41
46
|
] });
|
42
47
|
}
|
43
48
|
);
|
44
|
-
|
45
|
-
const w = ({ isVisible: t, onClick:
|
49
|
+
d.displayName = "PasswordInput";
|
50
|
+
const w = ({ isVisible: t, onClick: a }) => /* @__PURE__ */ s(
|
46
51
|
"button",
|
47
52
|
{
|
48
53
|
type: "button",
|
49
|
-
onClick:
|
54
|
+
onClick: a,
|
50
55
|
className: "absolute top-1/2 right-3 transform -translate-y-1/2",
|
51
|
-
children: t ? /* @__PURE__ */ s(
|
56
|
+
children: t ? /* @__PURE__ */ s(g, { size: 16 }) : /* @__PURE__ */ s(b, { size: 16 })
|
52
57
|
}
|
53
|
-
), I =
|
54
|
-
({ type: t, ...
|
58
|
+
), I = u.forwardRef(
|
59
|
+
({ type: t, ...a }, e) => t === "password" ? /* @__PURE__ */ s(d, { type: t, ...a, ref: e }) : /* @__PURE__ */ s(c, { type: t, ...a, ref: e })
|
55
60
|
);
|
56
61
|
I.displayName = "Input";
|
57
62
|
export {
|
58
|
-
|
63
|
+
c as BaseInput,
|
59
64
|
I as Input,
|
60
|
-
|
65
|
+
d as PasswordInput
|
61
66
|
};
|
package/Input/Input.types.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { inputVariants } from './inputVariants';
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
3
|
-
import { default as React, ReactNode } from 'react';
|
3
|
+
import { default as React, ChangeEvent, ReactNode } from 'react';
|
4
4
|
|
5
5
|
export interface InputSlotInputProps {
|
6
6
|
startAdornment?: ReactNode;
|
@@ -10,4 +10,6 @@ export interface InputSlotProps {
|
|
10
10
|
}
|
11
11
|
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
|
12
12
|
slotProps?: InputSlotProps;
|
13
|
+
/** func transform event.target.value before onChange event call*/
|
14
|
+
onTransform?: (value: string, event: ChangeEvent<HTMLInputElement>) => string;
|
13
15
|
}
|
package/Input/index.mjs
CHANGED
@@ -1,10 +1,7 @@
|
|
1
|
-
import { BaseInput as
|
2
|
-
import { inputVariants as s } from "./inputVariants.mjs";
|
3
|
-
e;
|
1
|
+
import { BaseInput as u, Input as a, PasswordInput as n, Input as s } from "./Input.mjs";
|
4
2
|
export {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
s as inputVariants
|
3
|
+
u as BaseInput,
|
4
|
+
a as Input,
|
5
|
+
n as PasswordInput,
|
6
|
+
s as default
|
10
7
|
};
|
package/Search/Search.mjs
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
2
2
|
import { useState as S } from "react";
|
3
|
-
import "../Input/
|
4
|
-
import { useDebounceCallback as
|
5
|
-
import { cn as
|
6
|
-
|
7
|
-
const k = (t) => {
|
3
|
+
import { Input as f } from "../Input/Input.mjs";
|
4
|
+
import { useDebounceCallback as v } from "@oneplatformdev/hooks";
|
5
|
+
import { cn as d } from "@oneplatformdev/utils";
|
6
|
+
const j = (t) => {
|
8
7
|
const {
|
9
8
|
search: a,
|
10
9
|
onChange: e,
|
@@ -12,20 +11,20 @@ const k = (t) => {
|
|
12
11
|
placeholder: s = "Search",
|
13
12
|
className: n,
|
14
13
|
...m
|
15
|
-
} = t, [i, l] = S(a),
|
14
|
+
} = t, [i, l] = S(a), h = v(c, 1e3), p = (r) => {
|
16
15
|
const u = r.target.value;
|
17
|
-
l(u), e == null || e(r),
|
16
|
+
l(u), e == null || e(r), h(r.target.value);
|
18
17
|
};
|
19
|
-
return /* @__PURE__ */ o("div", { className:
|
20
|
-
|
18
|
+
return /* @__PURE__ */ o("div", { className: d("space-y-4", n), children: /* @__PURE__ */ o(
|
19
|
+
f,
|
21
20
|
{
|
22
21
|
placeholder: s,
|
23
22
|
value: i,
|
24
|
-
onChange:
|
23
|
+
onChange: p,
|
25
24
|
...m
|
26
25
|
}
|
27
26
|
) });
|
28
27
|
};
|
29
28
|
export {
|
30
|
-
|
29
|
+
j as Search
|
31
30
|
};
|
package/Sidebar/Sidebar.mjs
CHANGED
@@ -6,13 +6,12 @@ import { PanelLeft as k } from "lucide-react";
|
|
6
6
|
import { cn as d } from "@oneplatformdev/utils";
|
7
7
|
import { Button as E } from "../Button/Button.mjs";
|
8
8
|
import "../Button/buttonVariants.mjs";
|
9
|
-
import "../Input/
|
10
|
-
import { Separator as
|
11
|
-
import { Sheet as
|
9
|
+
import { Input as z } from "../Input/Input.mjs";
|
10
|
+
import { Separator as B } from "../Separator/Separator.mjs";
|
11
|
+
import { Sheet as T, SheetContent as A } from "../Sheet/Sheet.mjs";
|
12
12
|
import { Skeleton as M } from "../Skeleton/Skeleton.mjs";
|
13
|
-
import { TooltipProvider as
|
14
|
-
import { Tooltip as
|
15
|
-
import { Input as G } from "../Input/Input.mjs";
|
13
|
+
import { TooltipProvider as D, TooltipTrigger as O, TooltipContent as L } from "../Tooltip/TooltipRoot.mjs";
|
14
|
+
import { Tooltip as G } from "../Tooltip/Tooltip.mjs";
|
16
15
|
const K = 768;
|
17
16
|
function H(a = {}) {
|
18
17
|
const {
|
@@ -67,7 +66,7 @@ const V = i.forwardRef(
|
|
67
66
|
}),
|
68
67
|
[y, g, x, c, p, u, w]
|
69
68
|
);
|
70
|
-
return /* @__PURE__ */ r(R.Provider, { value: I, children: /* @__PURE__ */ r(
|
69
|
+
return /* @__PURE__ */ r(R.Provider, { value: I, children: /* @__PURE__ */ r(D, { delayDuration: 0, children: /* @__PURE__ */ r(
|
71
70
|
"div",
|
72
71
|
{
|
73
72
|
style: {
|
@@ -108,8 +107,8 @@ const U = i.forwardRef(
|
|
108
107
|
...s,
|
109
108
|
children: n
|
110
109
|
}
|
111
|
-
) : m ? /* @__PURE__ */ r(
|
112
|
-
|
110
|
+
) : m ? /* @__PURE__ */ r(T, { open: p, onOpenChange: u, ...s, children: /* @__PURE__ */ r(
|
111
|
+
A,
|
113
112
|
{
|
114
113
|
"data-sidebar": "sidebar",
|
115
114
|
"data-mobile": "true",
|
@@ -229,7 +228,7 @@ const J = i.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ r(
|
|
229
228
|
));
|
230
229
|
J.displayName = "SidebarInset";
|
231
230
|
const Q = i.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ r(
|
232
|
-
|
231
|
+
z,
|
233
232
|
{
|
234
233
|
ref: t,
|
235
234
|
"data-sidebar": "input",
|
@@ -262,7 +261,7 @@ const ee = i.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ r(
|
|
262
261
|
));
|
263
262
|
ee.displayName = "SidebarFooter";
|
264
263
|
const ae = i.forwardRef(({ className: a, ...e }, t) => /* @__PURE__ */ r(
|
265
|
-
|
264
|
+
B,
|
266
265
|
{
|
267
266
|
ref: t,
|
268
267
|
"data-sidebar": "separator",
|
@@ -396,10 +395,10 @@ const le = C(
|
|
396
395
|
);
|
397
396
|
return n ? (typeof n == "string" && (n = {
|
398
397
|
children: n
|
399
|
-
}), /* @__PURE__ */ S(
|
400
|
-
/* @__PURE__ */ r(
|
398
|
+
}), /* @__PURE__ */ S(G, { children: [
|
399
|
+
/* @__PURE__ */ r(O, { asChild: !0, children: v }),
|
401
400
|
/* @__PURE__ */ r(
|
402
|
-
|
401
|
+
L,
|
403
402
|
{
|
404
403
|
side: "right",
|
405
404
|
align: "center",
|
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
|
};
|