@oneplatformdev/ui 0.0.1-beta.6 → 0.0.1-beta.60

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