@oneplatformdev/ui 0.0.1-beta.11 → 0.0.1-beta.110
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 +5 -3
- package/Accordion/Accordion.mjs +27 -24
- package/AlertDialog/AlertDialogRoot.d.ts +2 -2
- package/AlertDialog/AlertDialogRoot.mjs +7 -7
- package/Button/Button.mjs +11 -10
- package/Button/buttonVariants.mjs +14 -8
- package/Calendar/Calendar.mjs +3 -2
- package/Card/Card.d.ts +1 -1
- package/Card/Card.mjs +24 -23
- 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 +1 -0
- package/Checkbox/index.mjs +3 -2
- package/Combobox/Combobox.d.ts +2 -2
- package/Combobox/Combobox.mjs +12 -123
- package/Combobox/Combobox.types.d.ts +36 -1
- package/Combobox/ComboboxOptionItem.d.ts +5 -0
- package/Combobox/ComboboxOptionItem.mjs +68 -0
- package/Combobox/ComboboxOptions.d.ts +4 -0
- package/Combobox/ComboboxOptions.mjs +12 -0
- package/Combobox/index.mjs +1 -1
- package/Combobox-BzFTeSHQ.js +324 -0
- package/Command/Command.d.ts +1 -1
- package/Command/Command.mjs +36 -29
- 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 +5 -3
- package/Dialog/Dialog.mjs +44 -27
- package/DropdownMenu/DropdownMenu.d.ts +2 -2
- package/DropdownMenu/DropdownMenu.mjs +30 -26
- package/Dropzone/Dropzone.d.ts +16 -10
- package/Dropzone/Dropzone.mjs +146 -2915
- package/Dropzone/Dropzone.types.d.ts +33 -10
- package/Dropzone/DropzoneFilePreview.d.ts +4 -0
- package/Dropzone/DropzoneFilePreview.mjs +9 -0
- package/Dropzone/DropzoneSinglePickPreview.d.ts +10 -0
- package/Dropzone/DropzoneSinglePickPreview.mjs +44 -0
- package/Dropzone/DropzoneUtils.d.ts +5 -0
- package/Dropzone/DropzoneUtils.mjs +24 -0
- package/Dropzone/index.mjs +1 -1
- 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.mjs +6 -6
- 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 +5 -3
- package/FormInput/FormInput.mjs +37 -16
- 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 +50 -38
- package/Input/Input.types.d.ts +6 -2
- 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/LoadedIcon/LoadedIcon.d.ts +11 -0
- package/LoadedIcon/LoadedIcon.mjs +27 -0
- package/LoadedIcon/index.d.ts +1 -0
- package/LoadedIcon/index.mjs +4 -0
- package/LoadedIcon/package.json +7 -0
- 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/Popover/Popover.d.ts +2 -2
- package/Popover/Popover.mjs +13 -9
- 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/Search/Search.d.ts +1 -2
- package/Search/Search.mjs +31 -19
- package/Search/Search.types.d.ts +1 -0
- package/Select/Select.mjs +94 -63
- package/Select/Select.types.d.ts +11 -3
- package/Select/SelectRoot.d.ts +2 -2
- package/Select/SelectRoot.mjs +29 -24
- package/Sheet/Sheet.d.ts +5 -2
- package/Sheet/Sheet.mjs +33 -33
- 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 +72 -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 +297 -286
- package/package.json +6 -6
- package/tailwind.config.mjs +13 -13
- package/Dropzone/FilePreview.d.ts +0 -15
- package/Dropzone/FilePreview.mjs +0 -7
- package/FilePreview-C6IeuOqo.js +0 -40
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DatePickerProps } from '../DatePicker';
|
|
2
2
|
import { FormRenderControlExtendProps } from '../Form';
|
|
3
|
-
import {
|
|
4
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
|
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';
|
|
4
|
+
|
|
5
|
+
export interface FormDropzoneProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, DropzoneProps {
|
|
6
|
+
}
|
package/FormInput/FormInput.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FieldValues } from 'react-hook-form
|
|
1
|
+
import { ReactElement, Ref } from 'react';
|
|
2
|
+
import { FieldValues } from 'react-hook-form';
|
|
3
3
|
import { FormInputProps } from './FormInput.types';
|
|
4
4
|
|
|
5
|
-
export declare const FormInput: <Data extends FieldValues
|
|
5
|
+
export declare const FormInput: <Data extends FieldValues>(props: FormInputProps<Data> & {
|
|
6
|
+
ref?: Ref<HTMLInputElement>;
|
|
7
|
+
}) => ReactElement;
|
package/FormInput/FormInput.mjs
CHANGED
|
@@ -1,26 +1,47 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { FormControl as
|
|
3
|
-
import { FormRenderControl as
|
|
4
|
-
import { Input as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { FormControl as F } from "../Form/Form.mjs";
|
|
3
|
+
import { FormRenderControl as I } from "../Form/FormRenderControl.mjs";
|
|
4
|
+
import { Input as y } from "../Input/Input.mjs";
|
|
5
|
+
import { forwardRef as C } from "react";
|
|
6
|
+
function b(l, e) {
|
|
7
|
+
const { form: m, label: v, name: p, onChange: u, onBlur: a, onPaste: s, style: h, ...g } = l;
|
|
8
|
+
return /* @__PURE__ */ c(
|
|
9
|
+
I,
|
|
9
10
|
{
|
|
10
|
-
form:
|
|
11
|
-
name:
|
|
12
|
-
label:
|
|
13
|
-
render: ({ field: o }) => /* @__PURE__ */
|
|
14
|
-
|
|
11
|
+
form: m,
|
|
12
|
+
name: p,
|
|
13
|
+
label: v,
|
|
14
|
+
render: ({ field: o }) => /* @__PURE__ */ c(F, { children: /* @__PURE__ */ c(
|
|
15
|
+
y,
|
|
15
16
|
{
|
|
16
17
|
...o,
|
|
18
|
+
...g,
|
|
19
|
+
ref: (t) => {
|
|
20
|
+
o.ref(t), typeof e == "function" ? e(t) : e && (e.current = t);
|
|
21
|
+
},
|
|
22
|
+
style: h,
|
|
17
23
|
value: o.value || "",
|
|
18
|
-
...
|
|
24
|
+
onChange: (...t) => {
|
|
25
|
+
var r;
|
|
26
|
+
(r = o.onChange) == null || r.call(o, ...t), u == null || u(...t);
|
|
27
|
+
},
|
|
28
|
+
onPaste: (t) => {
|
|
29
|
+
const r = t.clipboardData.getData("text"), n = t.currentTarget, x = n.selectionStart ?? n.value.length, i = n.selectionEnd ?? n.value.length, D = n.value.slice(0, x) + r + n.value.slice(i);
|
|
30
|
+
t.preventDefault(), m.setValue(p, D, {
|
|
31
|
+
shouldDirty: !0,
|
|
32
|
+
shouldTouch: !0
|
|
33
|
+
}), s == null || s(t);
|
|
34
|
+
},
|
|
35
|
+
onBlur: (...t) => {
|
|
36
|
+
var r;
|
|
37
|
+
(r = o.onBlur) == null || r.call(o), a == null || a(...t);
|
|
38
|
+
}
|
|
19
39
|
}
|
|
20
40
|
) })
|
|
21
41
|
}
|
|
22
42
|
);
|
|
23
|
-
}
|
|
43
|
+
}
|
|
44
|
+
const E = C(b);
|
|
24
45
|
export {
|
|
25
|
-
|
|
46
|
+
E as FormInput
|
|
26
47
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { InputProps } from '../Input';
|
|
2
2
|
import { FormRenderControlExtendProps } from '../Form';
|
|
3
|
-
import {
|
|
4
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
|
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
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { FormControl as t, FormItem as F } from "../Form/Form.mjs";
|
|
3
|
+
import { FormRenderControl as f } from "../Form/FormRenderControl.mjs";
|
|
4
|
+
import { Radio as i } from "../Radio/Radio.mjs";
|
|
5
|
+
const b = (n) => {
|
|
6
|
+
const {
|
|
7
|
+
form: u,
|
|
8
|
+
name: d,
|
|
9
|
+
label: c,
|
|
10
|
+
onValueChange: m,
|
|
11
|
+
value: h,
|
|
12
|
+
defaultValue: s,
|
|
13
|
+
renderOption: a,
|
|
14
|
+
...v
|
|
15
|
+
} = n;
|
|
16
|
+
return /* @__PURE__ */ e(
|
|
17
|
+
f,
|
|
18
|
+
{
|
|
19
|
+
form: u,
|
|
20
|
+
name: d,
|
|
21
|
+
label: c,
|
|
22
|
+
render: ({ field: o }) => /* @__PURE__ */ e(t, { children: /* @__PURE__ */ e(
|
|
23
|
+
i,
|
|
24
|
+
{
|
|
25
|
+
...o,
|
|
26
|
+
...v,
|
|
27
|
+
defaultValue: s || o.value,
|
|
28
|
+
value: h || o.value,
|
|
29
|
+
onValueChange: (r) => {
|
|
30
|
+
o.onChange(r), m == null || m(r);
|
|
31
|
+
},
|
|
32
|
+
renderOption: (r, l) => /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(t, { children: (a == null ? void 0 : a(r, l)) || /* @__PURE__ */ e(l, { ...r }) }) }, r.value)
|
|
33
|
+
}
|
|
34
|
+
) })
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
b as FormRadio
|
|
40
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RadioProps } from '../Radio';
|
|
2
|
+
import { FormRenderControlExtendProps } from '../Form';
|
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
|
4
|
+
|
|
5
|
+
export interface FormRadioGroupProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Partial<Omit<RadioProps, 'name'>> {
|
|
6
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
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 {
|
|
4
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
|
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 {
|
|
2
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
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 {
|
|
4
|
-
import { FieldValues } from 'react-hook-form/dist/types/fields';
|
|
3
|
+
import { FieldValues } from 'react-hook-form';
|
|
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,73 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { Eye as
|
|
4
|
-
import { inputVariants as
|
|
5
|
-
import { cn as
|
|
6
|
-
const p =
|
|
7
|
-
(t,
|
|
1
|
+
import { jsxs as N, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import d, { useState as v } from "react";
|
|
3
|
+
import { Eye as w, EyeOff as h } from "lucide-react";
|
|
4
|
+
import { inputVariants as P } from "./inputVariants.mjs";
|
|
5
|
+
import { cn as f } from "@oneplatformdev/utils";
|
|
6
|
+
const p = d.forwardRef(
|
|
7
|
+
(t, s) => {
|
|
8
8
|
const {
|
|
9
|
-
className:
|
|
10
|
-
variant:
|
|
11
|
-
type:
|
|
12
|
-
slotProps: { input: n } = {},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
className: e,
|
|
10
|
+
variant: o,
|
|
11
|
+
type: c,
|
|
12
|
+
slotProps: { input: u, wrapper: n } = {},
|
|
13
|
+
onChange: i,
|
|
14
|
+
onTransform: l,
|
|
15
|
+
...g
|
|
16
|
+
} = t, {
|
|
17
|
+
startAdornment: m,
|
|
18
|
+
className: I,
|
|
19
|
+
...b
|
|
20
|
+
} = u || {};
|
|
21
|
+
return /* @__PURE__ */ N("div", { ...n || {}, className: f("relative", n == null ? void 0 : n.className), children: [
|
|
22
|
+
!!m && /* @__PURE__ */ a("span", { className: "absolute left-[10px] top-1/2 -translate-y-1/2", children: m }),
|
|
23
|
+
/* @__PURE__ */ a(
|
|
18
24
|
"input",
|
|
19
25
|
{
|
|
20
|
-
type:
|
|
21
|
-
className:
|
|
22
|
-
|
|
23
|
-
!!
|
|
26
|
+
type: c,
|
|
27
|
+
className: f(
|
|
28
|
+
P({ variant: o, className: e }),
|
|
29
|
+
!!m && "pl-8",
|
|
30
|
+
I
|
|
24
31
|
),
|
|
25
|
-
ref:
|
|
26
|
-
...
|
|
32
|
+
ref: s,
|
|
33
|
+
...b,
|
|
34
|
+
...g,
|
|
35
|
+
onChange: (r) => {
|
|
36
|
+
typeof (l == null ? void 0 : l(r.target.value, r)) == "string" && (r.target.value = l(r.target.value, r)), i && i(r);
|
|
37
|
+
}
|
|
27
38
|
}
|
|
28
39
|
)
|
|
29
40
|
] });
|
|
30
41
|
}
|
|
31
42
|
);
|
|
32
43
|
p.displayName = "Input";
|
|
33
|
-
const
|
|
34
|
-
(t,
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
const y = d.forwardRef(
|
|
45
|
+
(t, s) => {
|
|
46
|
+
var n, i, l;
|
|
47
|
+
const [e, o] = v(!1), c = e ? "text" : "password", u = () => {
|
|
48
|
+
o(!e);
|
|
37
49
|
};
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
50
|
+
return /* @__PURE__ */ N("div", { ...((n = t == null ? void 0 : t.slotProps) == null ? void 0 : n.wrapper) || {}, className: f("relative", (l = (i = t == null ? void 0 : t.slotProps) == null ? void 0 : i.wrapper) == null ? void 0 : l.className), children: [
|
|
51
|
+
/* @__PURE__ */ a(p, { ...t, type: c, className: "pr-8", ref: s }),
|
|
52
|
+
/* @__PURE__ */ a(x, { isVisible: e, onClick: u })
|
|
41
53
|
] });
|
|
42
54
|
}
|
|
43
55
|
);
|
|
44
|
-
|
|
45
|
-
const
|
|
56
|
+
y.displayName = "PasswordInput";
|
|
57
|
+
const x = ({ isVisible: t, onClick: s }) => /* @__PURE__ */ a(
|
|
46
58
|
"button",
|
|
47
59
|
{
|
|
48
60
|
type: "button",
|
|
49
|
-
onClick:
|
|
61
|
+
onClick: s,
|
|
50
62
|
className: "absolute top-1/2 right-3 transform -translate-y-1/2",
|
|
51
|
-
children: t ? /* @__PURE__ */
|
|
63
|
+
children: t ? /* @__PURE__ */ a(w, { size: 16 }) : /* @__PURE__ */ a(h, { size: 16 })
|
|
52
64
|
}
|
|
53
|
-
),
|
|
54
|
-
({ type: t, ...
|
|
65
|
+
), V = d.forwardRef(
|
|
66
|
+
({ type: t, ...s }, e) => t === "password" ? /* @__PURE__ */ a(y, { type: t, ...s, ref: e }) : /* @__PURE__ */ a(p, { type: t, ...s, ref: e })
|
|
55
67
|
);
|
|
56
|
-
|
|
68
|
+
V.displayName = "Input";
|
|
57
69
|
export {
|
|
58
70
|
p as BaseInput,
|
|
59
|
-
|
|
60
|
-
|
|
71
|
+
V as Input,
|
|
72
|
+
y as PasswordInput
|
|
61
73
|
};
|
package/Input/Input.types.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import { BaseInput } from './Input';
|
|
1
2
|
import { inputVariants } from './inputVariants';
|
|
2
3
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
-
import { default as React, ReactNode } from 'react';
|
|
4
|
+
import { default as React, ChangeEvent, ComponentPropsWithoutRef, HTMLAttributes, ReactNode } from 'react';
|
|
4
5
|
|
|
5
|
-
export interface InputSlotInputProps {
|
|
6
|
+
export interface InputSlotInputProps extends ComponentPropsWithoutRef<typeof BaseInput> {
|
|
6
7
|
startAdornment?: ReactNode;
|
|
7
8
|
}
|
|
8
9
|
export interface InputSlotProps {
|
|
9
10
|
input?: InputSlotInputProps;
|
|
11
|
+
wrapper?: HTMLAttributes<HTMLDivElement>;
|
|
10
12
|
}
|
|
11
13
|
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {
|
|
12
14
|
slotProps?: InputSlotProps;
|
|
15
|
+
/** func transform event.target.value before onChange event call*/
|
|
16
|
+
onTransform?: (value: string, event: ChangeEvent<HTMLInputElement>) => string;
|
|
13
17
|
}
|
package/Input/inputVariants.mjs
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { cva as e } from "class-variance-authority";
|
|
2
|
-
const
|
|
3
|
-
|
|
2
|
+
const t = e(
|
|
3
|
+
[
|
|
4
|
+
"flex h-10 w-full rounded-md border border-input px-3 py-2",
|
|
5
|
+
"text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground",
|
|
6
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
7
|
+
"group-data-[state=invalid]/form-control:border-destructive",
|
|
8
|
+
"group-data-[state=valid]/form-control:border-input"
|
|
9
|
+
],
|
|
4
10
|
{
|
|
5
11
|
variants: {
|
|
6
12
|
variant: {
|
|
@@ -14,5 +20,5 @@ const r = e(
|
|
|
14
20
|
}
|
|
15
21
|
);
|
|
16
22
|
export {
|
|
17
|
-
|
|
23
|
+
t as inputVariants
|
|
18
24
|
};
|
package/Label/Label.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import * as React from
|
|
3
|
-
import * as LabelPrimitive from
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
4
4
|
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import('class-variance-authority/dist/types').ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
|
5
5
|
export { Label };
|
package/Label/labelVariants.mjs
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { cva as
|
|
2
|
-
const a =
|
|
3
|
-
"
|
|
4
|
-
|
|
1
|
+
import { cva as t } from "class-variance-authority";
|
|
2
|
+
const a = t([
|
|
3
|
+
"peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
4
|
+
"text-md font-medium leading-[150%]",
|
|
5
|
+
"group-data-[state=valid]/form-control:text-[#363B4E]",
|
|
6
|
+
"group-data-[state=invalid]/form-control:text-destructive"
|
|
7
|
+
]);
|
|
5
8
|
export {
|
|
6
9
|
a as labelVariants
|
|
7
10
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { Suspense as
|
|
3
|
-
import { LoadingMask as
|
|
4
|
-
|
|
2
|
+
import { Suspense as a } from "react";
|
|
3
|
+
import { LoadingMask as e } from "../LoadingMask/LoadingMask.mjs";
|
|
4
|
+
import "../LoadingMask/RenderLoadingMask.mjs";
|
|
5
|
+
const s = (r, m = !0) => (t) => /* @__PURE__ */ o(a, { fallback: m ? /* @__PURE__ */ o(e, {}) : null, children: /* @__PURE__ */ o(r, { ...t }) });
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
+
s as LazyLoader
|
|
7
8
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC, HTMLAttributes, PropsWithChildren } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
declare const loadedIconVariants: (props?: ({
|
|
5
|
+
size?: "sm" | "lg" | "md" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
7
|
+
interface ILoadedIconProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof loadedIconVariants> {
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const LoadedIcon: FC<PropsWithChildren<ILoadedIconProps>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { cva as n } from "class-variance-authority";
|
|
3
|
+
import { LoaderCircleIcon as t } from "lucide-react";
|
|
4
|
+
import { cn as c } from "@oneplatformdev/utils";
|
|
5
|
+
const d = n([], {
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
sm: "[&_svg]:!size-[18px]",
|
|
9
|
+
md: "[&_svg]:!size-5",
|
|
10
|
+
lg: "[&_svg]:!size-5"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: { size: "md" }
|
|
14
|
+
}), f = (a) => {
|
|
15
|
+
const { loading: e, children: i, size: o = "md", className: r, ...m } = a;
|
|
16
|
+
return /* @__PURE__ */ s(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
...m,
|
|
20
|
+
className: c(d({ size: o, className: r })),
|
|
21
|
+
children: e ? /* @__PURE__ */ s(t, { className: "animate-spin" }) : i
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
f as LoadedIcon
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LoadedIcon.tsx';
|