@oneplatformdev/ui 0.0.1-beta.5 → 0.0.1-beta.51
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/AlertDialog.mjs +58 -60
- package/Button/buttonVariants.mjs +5 -5
- package/Calendar/Calendar.mjs +3 -2
- package/Combobox/Combobox.mjs +108 -84
- package/Combobox/Combobox.types.d.ts +10 -1
- package/Command/Command.d.ts +1 -1
- package/DataTable/DataTable.mjs +32 -51
- package/DataTable/DataTableColumnFilter.d.ts +4 -0
- package/DataTable/DataTableColumnFilter.mjs +31 -0
- package/DatePicker/DatePicker.mjs +2 -2
- 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/FormRenderControl.d.ts +1 -2
- package/Form/FormRenderControl.mjs +10 -10
- package/Form/FormRenderControl.types.d.ts +4 -3
- package/FormCheckbox/FormCheckbox.d.ts +1 -2
- package/FormCheckbox/FormCheckbox.types.d.ts +1 -2
- package/FormCombobox/FormCombobox.d.ts +2 -2
- package/FormCombobox/FormCombobox.types.d.ts +1 -2
- package/FormDatePicker/FormDatePicker.d.ts +2 -2
- package/FormDatePicker/FormDatePicker.mjs +20 -18
- package/FormDatePicker/FormDatePicker.types.d.ts +1 -2
- 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 +1 -2
- package/FormInput/FormInput.types.d.ts +1 -2
- package/FormSelect/FormSelect.d.ts +1 -2
- package/FormSelect/FormSelect.mjs +19 -17
- package/FormSelect/FormSelect.types.d.ts +1 -2
- package/FormTextarea/FormTextarea.d.ts +1 -2
- package/FormTextarea/FormTextarea.mjs +13 -12
- package/FormTextarea/FormTextarea.types.d.ts +1 -2
- package/Input/Input.mjs +42 -37
- package/Input/Input.types.d.ts +3 -1
- package/Select/Select.mjs +44 -42
- package/Select/Select.types.d.ts +7 -1
- package/Select/SelectRoot.d.ts +2 -2
- package/Select/SelectRoot.mjs +1 -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 +2 -0
- package/index.mjs +233 -225
- package/package.json +9 -8
@@ -1,7 +1,6 @@
|
|
1
1
|
import { FormRenderControlExtendProps } from '../Form';
|
2
2
|
import { ComboboxProps } from '../Combobox';
|
3
|
-
import { UseFormReturn } from 'react-hook-form';
|
4
3
|
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
5
4
|
|
6
|
-
export interface FormComboboxProps<Data extends FieldValues
|
5
|
+
export interface FormComboboxProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Omit<ComboboxProps, 'value' | 'onChange'> {
|
7
6
|
}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { FormDatePickerProps } from './FormDatePicker.types';
|
2
|
-
import { FieldValues
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
3
3
|
|
4
|
-
export declare const FormDatePicker: <Data extends FieldValues
|
4
|
+
export declare const FormDatePicker: <Data extends FieldValues>(props: FormDatePickerProps<Data>) => import("react/jsx-runtime").JSX.Element;
|
@@ -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
|
};
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { DatePickerProps } from '../DatePicker';
|
2
2
|
import { FormRenderControlExtendProps } from '../Form';
|
3
|
-
import { UseFormReturn } from 'react-hook-form';
|
4
3
|
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
5
4
|
|
6
|
-
export interface FormDatePickerProps<Data extends FieldValues
|
5
|
+
export interface FormDatePickerProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Omit<DatePickerProps, 'onDateChange'>, Partial<Pick<DatePickerProps, 'onDateChange'>> {
|
7
6
|
}
|
@@ -0,0 +1,19 @@
|
|
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(f, { ...p, ...r, onChangeValue: r.onChange }) })
|
14
|
+
}
|
15
|
+
);
|
16
|
+
};
|
17
|
+
export {
|
18
|
+
h as FormDropzone
|
19
|
+
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { FormRenderControlExtendProps } from '../Form';
|
2
|
+
import { DropzoneProps } from '../Dropzone';
|
3
|
+
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
4
|
+
|
5
|
+
export interface FormDropzoneProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, DropzoneProps {
|
6
|
+
}
|
package/FormInput/FormInput.d.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
import { UseFormReturn } from 'react-hook-form';
|
2
1
|
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
3
2
|
import { FormInputProps } from './FormInput.types';
|
4
3
|
|
5
|
-
export declare const FormInput: <Data extends FieldValues
|
4
|
+
export declare const FormInput: <Data extends FieldValues>(props: FormInputProps<Data>) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { InputProps } from '../Input';
|
2
2
|
import { FormRenderControlExtendProps } from '../Form';
|
3
|
-
import { UseFormReturn } from 'react-hook-form';
|
4
3
|
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
5
4
|
|
6
|
-
export interface FormInputProps<Data extends FieldValues
|
5
|
+
export interface FormInputProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Omit<InputProps, 'form' | 'name'> {
|
7
6
|
}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import { UseFormReturn } from 'react-hook-form';
|
2
1
|
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
3
2
|
import { FormSelectProps } from './FormSelect.types';
|
4
3
|
|
5
|
-
export declare const FormSelect: <Data extends FieldValues,
|
4
|
+
export declare const FormSelect: <Data extends FieldValues, ExtendOptionData>(props: FormSelectProps<Data, ExtendOptionData>) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,38 +1,40 @@
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
2
|
-
import { FormControl as
|
3
|
-
import { FormRenderControl as
|
2
|
+
import { FormControl as f } from "../Form/Form.mjs";
|
3
|
+
import { FormRenderControl as d } from "../Form/FormRenderControl.mjs";
|
4
4
|
import "../Select/SelectRoot.mjs";
|
5
|
-
import { Select as
|
6
|
-
const
|
5
|
+
import { Select as g } from "../Select/Select.mjs";
|
6
|
+
const S = (n) => {
|
7
7
|
const {
|
8
|
-
form:
|
8
|
+
form: m,
|
9
9
|
label: i,
|
10
|
-
name:
|
11
|
-
options:
|
10
|
+
name: p,
|
11
|
+
options: l = [],
|
12
12
|
onChange: r,
|
13
|
-
|
14
|
-
|
13
|
+
containerProps: c,
|
14
|
+
...s
|
15
|
+
} = n;
|
15
16
|
return /* @__PURE__ */ e(
|
16
|
-
|
17
|
+
d,
|
17
18
|
{
|
18
|
-
form:
|
19
|
-
name:
|
19
|
+
form: m,
|
20
|
+
name: p,
|
20
21
|
label: i,
|
22
|
+
containerProps: c,
|
21
23
|
render: ({ field: t }) => /* @__PURE__ */ e(
|
22
|
-
|
24
|
+
g,
|
23
25
|
{
|
24
26
|
value: t.value,
|
25
|
-
options:
|
27
|
+
options: l,
|
26
28
|
onChange: (o) => {
|
27
29
|
t.onChange(o), r == null || r(o);
|
28
30
|
},
|
29
|
-
renderTrigger: (o,
|
30
|
-
...
|
31
|
+
renderTrigger: (o, a) => /* @__PURE__ */ e(f, { children: a }),
|
32
|
+
...s
|
31
33
|
}
|
32
34
|
)
|
33
35
|
}
|
34
36
|
);
|
35
37
|
};
|
36
38
|
export {
|
37
|
-
|
39
|
+
S as FormSelect
|
38
40
|
};
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { SelectProps } from '../Select';
|
2
2
|
import { FormRenderControlExtendProps } from '../Form';
|
3
|
-
import { UseFormReturn } from 'react-hook-form';
|
4
3
|
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
5
4
|
|
6
|
-
export interface FormSelectProps<Data extends FieldValues,
|
5
|
+
export interface FormSelectProps<Data extends FieldValues, ExtendOptionData> extends FormRenderControlExtendProps<Data>, Omit<SelectProps<ExtendOptionData>, 'onChange'>, Partial<Pick<SelectProps<ExtendOptionData>, 'onChange'>> {
|
7
6
|
}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import { UseFormReturn } from 'react-hook-form';
|
2
1
|
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
3
2
|
import { FormTextareaProps } from './FormTextarea.types';
|
4
3
|
|
5
|
-
export declare const FormTextarea: <Data extends FieldValues
|
4
|
+
export declare const FormTextarea: <Data extends FieldValues>(props: FormTextareaProps<Data>) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,26 +1,27 @@
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
2
|
-
import { FormControl as
|
3
|
-
import { FormRenderControl as
|
4
|
-
import { Textarea as
|
5
|
-
const
|
6
|
-
const { form:
|
2
|
+
import { FormControl as p } from "../Form/Form.mjs";
|
3
|
+
import { FormRenderControl as i } from "../Form/FormRenderControl.mjs";
|
4
|
+
import { Textarea as s } from "../Textarea/Textarea.mjs";
|
5
|
+
const F = (e) => {
|
6
|
+
const { form: t, label: m, name: n, containerProps: a, ...l } = e;
|
7
7
|
return /* @__PURE__ */ r(
|
8
|
-
|
8
|
+
i,
|
9
9
|
{
|
10
|
-
form:
|
10
|
+
form: t,
|
11
11
|
name: n,
|
12
|
-
label:
|
13
|
-
|
14
|
-
|
12
|
+
label: m,
|
13
|
+
containerProps: a,
|
14
|
+
render: ({ field: o }) => /* @__PURE__ */ r(p, { children: /* @__PURE__ */ r(
|
15
|
+
s,
|
15
16
|
{
|
16
17
|
...o,
|
17
18
|
value: o.value || "",
|
18
|
-
...
|
19
|
+
...l
|
19
20
|
}
|
20
21
|
) })
|
21
22
|
}
|
22
23
|
);
|
23
24
|
};
|
24
25
|
export {
|
25
|
-
|
26
|
+
F as FormTextarea
|
26
27
|
};
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { TextareaProps } from '../Textarea';
|
2
2
|
import { FormRenderControlExtendProps } from '../Form';
|
3
|
-
import { UseFormReturn } from 'react-hook-form';
|
4
3
|
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
5
4
|
|
6
|
-
export interface FormTextareaProps<Data extends FieldValues
|
5
|
+
export interface FormTextareaProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Omit<TextareaProps, 'form' | 'name'> {
|
7
6
|
}
|
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/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 p, SelectContent as h,
|
5
|
+
import { SelectRoot as p, SelectContent as h, SelectTrigger as v, SelectValue as S, SelectItem as u } from "./SelectRoot.mjs";
|
5
6
|
import { isValidReactElement as i } from "@oneplatformdev/utils";
|
6
|
-
const
|
7
|
-
const { placeholder:
|
8
|
-
return e && typeof e == "function" && i(e(
|
9
|
-
},
|
10
|
-
const { renderOption:
|
11
|
-
return
|
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
14
|
n,
|
14
|
-
|
15
|
-
{ ...
|
16
|
-
|
17
|
-
)) ? i(
|
15
|
+
t,
|
16
|
+
{ ...a, options: t },
|
17
|
+
o
|
18
|
+
)) ? i(l(
|
18
19
|
e,
|
19
20
|
n,
|
20
|
-
|
21
|
-
{ ...
|
22
|
-
|
23
|
-
), u) ? i(
|
21
|
+
t,
|
22
|
+
{ ...a, options: t },
|
23
|
+
o
|
24
|
+
), u) ? i(l(
|
24
25
|
e,
|
25
26
|
n,
|
26
|
-
|
27
|
-
{ ...
|
28
|
-
|
29
|
-
)) : /* @__PURE__ */
|
27
|
+
t,
|
28
|
+
{ ...a, options: t },
|
29
|
+
o
|
30
|
+
)) : /* @__PURE__ */ c(u, { value: e.value, children: l(
|
30
31
|
e,
|
31
32
|
n,
|
32
|
-
|
33
|
-
{ ...
|
34
|
-
|
35
|
-
) }, e.value) :
|
36
|
-
},
|
33
|
+
t,
|
34
|
+
{ ...a, options: t },
|
35
|
+
o
|
36
|
+
) }, e.value) : o;
|
37
|
+
}, j = (r) => {
|
37
38
|
const {
|
38
|
-
value:
|
39
|
+
value: l,
|
39
40
|
options: e,
|
40
41
|
onChange: n,
|
41
|
-
nullable:
|
42
|
-
clearLabel:
|
43
|
-
disabled:
|
44
|
-
} =
|
42
|
+
nullable: t = !1,
|
43
|
+
clearLabel: a = "Clear",
|
44
|
+
disabled: o
|
45
|
+
} = r;
|
45
46
|
return /* @__PURE__ */ d(
|
46
47
|
p,
|
47
48
|
{
|
48
|
-
value:
|
49
|
+
value: l,
|
49
50
|
onValueChange: n,
|
50
|
-
disabled:
|
51
|
+
disabled: o,
|
51
52
|
children: [
|
52
|
-
/* @__PURE__ */
|
53
|
+
/* @__PURE__ */ c(C, { ...r }),
|
53
54
|
/* @__PURE__ */ d(h, { children: [
|
54
|
-
|
55
|
+
t && /* @__PURE__ */ c(g, { className: "w-full px-2", variant: "secondary", size: "sm", onClick: () => {
|
55
56
|
n("");
|
56
|
-
}, children:
|
57
|
-
e.map((
|
58
|
-
|
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/Select/Select.types.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
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;
|
@@ -26,4 +27,9 @@ export interface SelectProps<ExtendOptionData> {
|
|
26
27
|
renderTrigger?: SelectRenderTrigger<ExtendOptionData>;
|
27
28
|
/** Render custom option. */
|
28
29
|
renderOption?: SelectRenderOption<ExtendOptionData>;
|
30
|
+
/** Select Slot props */
|
31
|
+
slotProps?: {
|
32
|
+
/** Select Default Trigger Props */
|
33
|
+
triggerProps?: ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>;
|
34
|
+
};
|
29
35
|
}
|
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,
|
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
|
};
|