@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.
Files changed (143) hide show
  1. package/Accordion/Accordion.d.ts +5 -3
  2. package/Accordion/Accordion.mjs +27 -24
  3. package/AlertDialog/AlertDialogRoot.d.ts +2 -2
  4. package/AlertDialog/AlertDialogRoot.mjs +7 -7
  5. package/Button/Button.mjs +11 -10
  6. package/Button/buttonVariants.mjs +14 -8
  7. package/Calendar/Calendar.mjs +3 -2
  8. package/Card/Card.d.ts +1 -1
  9. package/Card/Card.mjs +24 -23
  10. package/Checkbox/Checkbox.d.ts +5 -4
  11. package/Checkbox/Checkbox.mjs +48 -21
  12. package/Checkbox/Checkbox.types.d.ts +10 -0
  13. package/Checkbox/index.d.ts +1 -0
  14. package/Checkbox/index.mjs +3 -2
  15. package/Combobox/Combobox.d.ts +2 -2
  16. package/Combobox/Combobox.mjs +12 -123
  17. package/Combobox/Combobox.types.d.ts +36 -1
  18. package/Combobox/ComboboxOptionItem.d.ts +5 -0
  19. package/Combobox/ComboboxOptionItem.mjs +68 -0
  20. package/Combobox/ComboboxOptions.d.ts +4 -0
  21. package/Combobox/ComboboxOptions.mjs +12 -0
  22. package/Combobox/index.mjs +1 -1
  23. package/Combobox-BzFTeSHQ.js +324 -0
  24. package/Command/Command.d.ts +1 -1
  25. package/Command/Command.mjs +36 -29
  26. package/DataTable/DataTable.d.ts +10 -3
  27. package/DataTable/DataTable.mjs +33 -33
  28. package/DataTable/DataTableColumnFilter.d.ts +4 -0
  29. package/DataTable/DataTableColumnFilter.mjs +31 -0
  30. package/DatePicker/DatePicker.mjs +2 -2
  31. package/Dialog/Dialog.d.ts +5 -3
  32. package/Dialog/Dialog.mjs +44 -27
  33. package/DropdownMenu/DropdownMenu.d.ts +2 -2
  34. package/DropdownMenu/DropdownMenu.mjs +30 -26
  35. package/Dropzone/Dropzone.d.ts +16 -10
  36. package/Dropzone/Dropzone.mjs +146 -2915
  37. package/Dropzone/Dropzone.types.d.ts +33 -10
  38. package/Dropzone/DropzoneFilePreview.d.ts +4 -0
  39. package/Dropzone/DropzoneFilePreview.mjs +9 -0
  40. package/Dropzone/DropzoneSinglePickPreview.d.ts +10 -0
  41. package/Dropzone/DropzoneSinglePickPreview.mjs +44 -0
  42. package/Dropzone/DropzoneUtils.d.ts +5 -0
  43. package/Dropzone/DropzoneUtils.mjs +24 -0
  44. package/Dropzone/index.mjs +1 -1
  45. package/DropzoneFilePreview-Dhtv8F4u.js +67 -0
  46. package/Form/Form.d.ts +2 -2
  47. package/Form/Form.mjs +48 -45
  48. package/Form/FormRenderControl.d.ts +2 -3
  49. package/Form/FormRenderControl.mjs +10 -10
  50. package/Form/FormRenderControl.types.d.ts +5 -7
  51. package/FormCheckbox/FormCheckbox.d.ts +2 -3
  52. package/FormCheckbox/FormCheckbox.mjs +23 -23
  53. package/FormCheckbox/FormCheckbox.types.d.ts +3 -3
  54. package/FormCombobox/FormCombobox.d.ts +2 -2
  55. package/FormCombobox/FormCombobox.mjs +6 -6
  56. package/FormCombobox/FormCombobox.types.d.ts +2 -3
  57. package/FormDatePicker/FormDatePicker.d.ts +2 -2
  58. package/FormDatePicker/FormDatePicker.mjs +20 -18
  59. package/FormDatePicker/FormDatePicker.types.d.ts +2 -3
  60. package/FormDropzone/FormDropzone.d.ts +4 -0
  61. package/FormDropzone/FormDropzone.mjs +19 -0
  62. package/FormDropzone/FormDropzone.types.d.ts +6 -0
  63. package/FormDropzone/index.d.ts +2 -0
  64. package/FormDropzone/index.mjs +4 -0
  65. package/FormDropzone/package.json +7 -0
  66. package/FormInput/FormInput.d.ts +5 -3
  67. package/FormInput/FormInput.mjs +37 -16
  68. package/FormInput/FormInput.types.d.ts +2 -3
  69. package/FormRadio/FormRadio.d.ts +4 -0
  70. package/FormRadio/FormRadio.mjs +40 -0
  71. package/FormRadio/FormRadio.types.d.ts +6 -0
  72. package/FormRadio/index.d.ts +2 -0
  73. package/FormRadio/index.mjs +4 -0
  74. package/FormRadio/package.json +7 -0
  75. package/FormSelect/FormSelect.d.ts +2 -3
  76. package/FormSelect/FormSelect.mjs +19 -17
  77. package/FormSelect/FormSelect.types.d.ts +2 -3
  78. package/FormTextarea/FormTextarea.d.ts +2 -3
  79. package/FormTextarea/FormTextarea.mjs +13 -12
  80. package/FormTextarea/FormTextarea.types.d.ts +2 -3
  81. package/Input/Input.mjs +50 -38
  82. package/Input/Input.types.d.ts +6 -2
  83. package/Input/inputVariants.mjs +9 -3
  84. package/Label/Label.d.ts +2 -2
  85. package/Label/labelVariants.mjs +7 -4
  86. package/LazyLoader/LazyLoader.mjs +5 -4
  87. package/LoadedIcon/LoadedIcon.d.ts +11 -0
  88. package/LoadedIcon/LoadedIcon.mjs +27 -0
  89. package/LoadedIcon/index.d.ts +1 -0
  90. package/LoadedIcon/index.mjs +4 -0
  91. package/LoadedIcon/package.json +7 -0
  92. package/LoadingMask/LoadingMask.d.ts +4 -1
  93. package/LoadingMask/LoadingMask.mjs +18 -56
  94. package/LoadingMask/LoadingMask.types.d.ts +5 -0
  95. package/LoadingMask/RenderLoadingMask.d.ts +3 -0
  96. package/LoadingMask/RenderLoadingMask.mjs +108 -0
  97. package/LoadingMask/index.d.ts +2 -0
  98. package/LoadingMask/index.mjs +4 -2
  99. package/Popover/Popover.d.ts +2 -2
  100. package/Popover/Popover.mjs +13 -9
  101. package/Radio/Radio.d.ts +4 -0
  102. package/Radio/Radio.mjs +12 -0
  103. package/Radio/Radio.types.d.ts +11 -0
  104. package/Radio/index.d.ts +2 -0
  105. package/Radio/index.mjs +4 -0
  106. package/Radio/package.json +7 -0
  107. package/RadioGroup/RadioGroup.d.ts +9 -3
  108. package/RadioGroup/RadioGroup.mjs +37 -19
  109. package/RadioGroup/index.mjs +4 -3
  110. package/ScrollArea/ScrollArea.d.ts +2 -2
  111. package/ScrollArea/ScrollArea.mjs +26 -13
  112. package/Search/Search.d.ts +1 -2
  113. package/Search/Search.mjs +31 -19
  114. package/Search/Search.types.d.ts +1 -0
  115. package/Select/Select.mjs +94 -63
  116. package/Select/Select.types.d.ts +11 -3
  117. package/Select/SelectRoot.d.ts +2 -2
  118. package/Select/SelectRoot.mjs +29 -24
  119. package/Sheet/Sheet.d.ts +5 -2
  120. package/Sheet/Sheet.mjs +33 -33
  121. package/TablePagination/TablePagination.d.ts +16 -0
  122. package/TablePagination/TablePagination.mjs +74 -0
  123. package/TablePagination/index.d.ts +1 -0
  124. package/TablePagination/index.mjs +4 -0
  125. package/TablePagination/package.json +7 -0
  126. package/Tabs/Tabs.d.ts +3 -2
  127. package/Tabs/Tabs.mjs +20 -6
  128. package/Tabs/Tabs.types.d.ts +5 -2
  129. package/Tabs/index.mjs +8 -7
  130. package/Textarea/Textarea.d.ts +1 -1
  131. package/Textarea/Textarea.mjs +72 -15
  132. package/Textarea/Textarea.types.d.ts +16 -2
  133. package/Textarea/useAutosizeTextArea.d.ts +3 -0
  134. package/Textarea/useAutosizeTextArea.mjs +20 -0
  135. package/Toast/toastVariants.mjs +3 -3
  136. package/index.css +1 -1
  137. package/index.d.ts +3 -0
  138. package/index.mjs +297 -286
  139. package/package.json +6 -6
  140. package/tailwind.config.mjs +13 -13
  141. package/Dropzone/FilePreview.d.ts +0 -15
  142. package/Dropzone/FilePreview.mjs +0 -7
  143. package/FilePreview-C6IeuOqo.js +0 -40
@@ -1,7 +1,6 @@
1
1
  import { DatePickerProps } from '../DatePicker';
2
2
  import { FormRenderControlExtendProps } from '../Form';
3
- import { UseFormReturn } from 'react-hook-form';
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, Form extends UseFormReturn<Data>> extends FormRenderControlExtendProps<Data, Form>, DatePickerProps {
5
+ export interface FormDatePickerProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Omit<DatePickerProps, 'onDateChange'>, Partial<Pick<DatePickerProps, 'onDateChange'>> {
7
6
  }
@@ -0,0 +1,4 @@
1
+ import { FormDropzoneProps } from './FormDropzone.types';
2
+ import { FieldValues } from 'react-hook-form';
3
+
4
+ export declare const FormDropzone: <Data extends FieldValues>(props: FormDropzoneProps<Data>) => import("react/jsx-runtime").JSX.Element;
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ export * from './FormDropzone';
2
+ export * from './FormDropzone.types';
@@ -0,0 +1,4 @@
1
+ import { FormDropzone as e } from "./FormDropzone.mjs";
2
+ export {
3
+ e as FormDropzone
4
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "sideEffects": false,
3
+ "main": "./index.mjs",
4
+ "module": "./index.mjs",
5
+ "default": "./index.mjs",
6
+ "types": "./index.d.ts"
7
+ }
@@ -1,5 +1,7 @@
1
- import { UseFormReturn } from 'react-hook-form';
2
- import { FieldValues } from 'react-hook-form/dist/types/fields';
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, Form extends UseFormReturn<Data>>(props: FormInputProps<Data, Form>) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const FormInput: <Data extends FieldValues>(props: FormInputProps<Data> & {
6
+ ref?: Ref<HTMLInputElement>;
7
+ }) => ReactElement;
@@ -1,26 +1,47 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { FormControl as l } from "../Form/Form.mjs";
3
- import { FormRenderControl as u } from "../Form/FormRenderControl.mjs";
4
- import { Input as a } from "../Input/Input.mjs";
5
- const F = (m) => {
6
- const { form: t, label: e, name: n, ...p } = m;
7
- return /* @__PURE__ */ r(
8
- u,
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: t,
11
- name: n,
12
- label: e,
13
- render: ({ field: o }) => /* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(
14
- a,
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
- ...p
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
- F as FormInput
46
+ E as FormInput
26
47
  };
@@ -1,7 +1,6 @@
1
1
  import { InputProps } from '../Input';
2
2
  import { FormRenderControlExtendProps } from '../Form';
3
- import { UseFormReturn } from 'react-hook-form';
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, Form extends UseFormReturn<Data>> extends FormRenderControlExtendProps<Data, Form>, Omit<InputProps, 'form' | 'name'> {
5
+ export interface FormInputProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Omit<InputProps, 'form' | 'name'> {
7
6
  }
@@ -0,0 +1,4 @@
1
+ import { FormRadioGroupProps } from './FormRadio.types.ts';
2
+ import { FieldValues } from 'react-hook-form';
3
+
4
+ export declare const FormRadio: <Data extends FieldValues>(props: FormRadioGroupProps<Data>) => import("react/jsx-runtime").JSX.Element;
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ export * from './FormRadio';
2
+ export type * from './FormRadio.types.ts';
@@ -0,0 +1,4 @@
1
+ import { FormRadio as m } from "./FormRadio.mjs";
2
+ export {
3
+ m as FormRadio
4
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "sideEffects": false,
3
+ "main": "./index.mjs",
4
+ "module": "./index.mjs",
5
+ "default": "./index.mjs",
6
+ "types": "./index.d.ts"
7
+ }
@@ -1,5 +1,4 @@
1
- import { UseFormReturn } from 'react-hook-form';
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, Form extends UseFormReturn<Data>, ExtendOptionData>(props: FormSelectProps<Data, Form, ExtendOptionData>) => import("react/jsx-runtime").JSX.Element;
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 a } from "../Form/Form.mjs";
3
- import { FormRenderControl as f } from "../Form/FormRenderControl.mjs";
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 d } from "../Select/Select.mjs";
6
- const x = (m) => {
5
+ import { Select as g } from "../Select/Select.mjs";
6
+ const S = (n) => {
7
7
  const {
8
- form: n,
8
+ form: m,
9
9
  label: i,
10
- name: l,
11
- options: p = [],
10
+ name: p,
11
+ options: l = [],
12
12
  onChange: r,
13
- ...c
14
- } = m;
13
+ containerProps: c,
14
+ ...s
15
+ } = n;
15
16
  return /* @__PURE__ */ e(
16
- f,
17
+ d,
17
18
  {
18
- form: n,
19
- name: l,
19
+ form: m,
20
+ name: p,
20
21
  label: i,
22
+ containerProps: c,
21
23
  render: ({ field: t }) => /* @__PURE__ */ e(
22
- d,
24
+ g,
23
25
  {
24
26
  value: t.value,
25
- options: p,
27
+ options: l,
26
28
  onChange: (o) => {
27
29
  t.onChange(o), r == null || r(o);
28
30
  },
29
- renderTrigger: (o, s) => /* @__PURE__ */ e(a, { children: s }),
30
- ...c
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
- x as FormSelect
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
- 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, Form extends UseFormReturn<Data>, ExtendOptionData> extends FormRenderControlExtendProps<Data, Form>, SelectProps<ExtendOptionData> {
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
- 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, Form extends UseFormReturn<Data>>(props: FormTextareaProps<Data, Form>) => import("react/jsx-runtime").JSX.Element;
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 l } from "../Form/Form.mjs";
3
- import { FormRenderControl as p } from "../Form/FormRenderControl.mjs";
4
- import { Textarea as f } from "../Textarea/Textarea.mjs";
5
- const u = (e) => {
6
- const { form: m, label: t, name: n, ...a } = e;
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
- p,
8
+ i,
9
9
  {
10
- form: m,
10
+ form: t,
11
11
  name: n,
12
- label: t,
13
- render: ({ field: o }) => /* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(
14
- f,
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
- ...a
19
+ ...l
19
20
  }
20
21
  ) })
21
22
  }
22
23
  );
23
24
  };
24
25
  export {
25
- u as FormTextarea
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
- 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, Form extends UseFormReturn<Data>> extends FormRenderControlExtendProps<Data, Form>, Omit<TextareaProps, 'form' | 'name'> {
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 c, jsx as s } from "react/jsx-runtime";
2
- import l, { useState as d } from "react";
3
- import { Eye as f, EyeOff as y } from "lucide-react";
4
- import { inputVariants as N } from "./inputVariants.mjs";
5
- import { cn as b } from "@oneplatformdev/utils";
6
- const p = l.forwardRef(
7
- (t, e) => {
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: a,
10
- variant: r,
11
- type: o,
12
- slotProps: { input: n } = {},
13
- ...u
14
- } = t, { startAdornment: i } = n || {};
15
- return /* @__PURE__ */ c("div", { className: "relative", children: [
16
- !!i && /* @__PURE__ */ s("span", { className: "absolute left-[10px] top-1/2 -translate-y-1/2", children: i }),
17
- /* @__PURE__ */ s(
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: o,
21
- className: b(
22
- N({ variant: r, className: a }),
23
- !!i && "pl-8"
26
+ type: c,
27
+ className: f(
28
+ P({ variant: o, className: e }),
29
+ !!m && "pl-8",
30
+ I
24
31
  ),
25
- ref: e,
26
- ...u
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 m = l.forwardRef(
34
- (t, e) => {
35
- const [a, r] = d(!1), o = a ? "text" : "password", n = () => {
36
- r(!a);
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__ */ c("div", { className: "relative", children: [
39
- /* @__PURE__ */ s(p, { ...t, type: o, className: "pr-8", ref: e }),
40
- /* @__PURE__ */ s(w, { isVisible: a, onClick: n })
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
- m.displayName = "PasswordInput";
45
- const w = ({ isVisible: t, onClick: e }) => /* @__PURE__ */ s(
56
+ y.displayName = "PasswordInput";
57
+ const x = ({ isVisible: t, onClick: s }) => /* @__PURE__ */ a(
46
58
  "button",
47
59
  {
48
60
  type: "button",
49
- onClick: e,
61
+ onClick: s,
50
62
  className: "absolute top-1/2 right-3 transform -translate-y-1/2",
51
- children: t ? /* @__PURE__ */ s(f, { size: 16 }) : /* @__PURE__ */ s(y, { size: 16 })
63
+ children: t ? /* @__PURE__ */ a(w, { size: 16 }) : /* @__PURE__ */ a(h, { size: 16 })
52
64
  }
53
- ), I = l.forwardRef(
54
- ({ type: t, ...e }, a) => t === "password" ? /* @__PURE__ */ s(m, { type: t, ...e, ref: a }) : /* @__PURE__ */ s(p, { type: t, ...e, ref: a })
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
- I.displayName = "Input";
68
+ V.displayName = "Input";
57
69
  export {
58
70
  p as BaseInput,
59
- I as Input,
60
- m as PasswordInput
71
+ V as Input,
72
+ y as PasswordInput
61
73
  };
@@ -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
  }
@@ -1,6 +1,12 @@
1
1
  import { cva as e } from "class-variance-authority";
2
- const r = e(
3
- "flex h-10 w-full rounded-md border border-input px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
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
- r as inputVariants
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 "react";
3
- import * as LabelPrimitive from "@radix-ui/react-label";
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 };
@@ -1,7 +1,10 @@
1
- import { cva as e } from "class-variance-authority";
2
- const a = e(
3
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
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 m } from "react";
3
- import { LoadingMask as t } from "../LoadingMask/LoadingMask.mjs";
4
- const p = (r, a = !0) => (e) => /* @__PURE__ */ o(m, { fallback: a ? /* @__PURE__ */ o(t, {}) : null, children: /* @__PURE__ */ o(r, { ...e }) });
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
- p as LazyLoader
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';
@@ -0,0 +1,4 @@
1
+ import { LoadedIcon as e } from "./LoadedIcon.mjs";
2
+ export {
3
+ e as LoadedIcon
4
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "sideEffects": false,
3
+ "main": "./index.mjs",
4
+ "module": "./index.mjs",
5
+ "default": "./index.mjs",
6
+ "types": "./index.d.ts"
7
+ }
@@ -1 +1,4 @@
1
- export declare const LoadingMask: () => import("react/jsx-runtime").JSX.Element;
1
+ import { ILoadingMaskProps } from './LoadingMask.types';
2
+ import { FC } from 'react';
3
+
4
+ export declare const LoadingMask: FC<ILoadingMaskProps>;