@oneplatformdev/ui 0.0.1-beta.11 → 0.0.1-beta.111

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 +32 -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
package/Select/Select.mjs CHANGED
@@ -1,72 +1,103 @@
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 f, 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 b, SelectContent as R, 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
+ disabled: e.disabled,
17
+ className: "cursor-pointer",
18
+ style: { paddingLeft: `calc(8px + ${(l || 0) * 8}px)` },
51
19
  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
- ] })
20
+ !n && e.label,
21
+ n && /* @__PURE__ */ i(x, { children: typeof n == "function" ? n({ ...t }) : n })
66
22
  ]
67
- }
23
+ },
24
+ e.value
68
25
  );
26
+ }, g = (t) => {
27
+ var a, o;
28
+ const { renderOption: n, option: e, index: l, options: r, deep: m = 0, ...c } = t;
29
+ return n && typeof n == "function" && S(
30
+ n(
31
+ e,
32
+ l,
33
+ r,
34
+ { ...c, options: r },
35
+ /* @__PURE__ */ i(d, { ...t })
36
+ )
37
+ ) ? /* @__PURE__ */ i(p, { value: e.value, children: n(
38
+ e,
39
+ l,
40
+ r,
41
+ { ...c, options: r },
42
+ /* @__PURE__ */ i(d, { ...t })
43
+ ) }, e.value) : (a = e.children) != null && a.length ? /* @__PURE__ */ u(
44
+ "div",
45
+ {
46
+ className: "flex flex-col gap-1 truncate line-clamp-2",
47
+ children: [
48
+ /* @__PURE__ */ i(d, { ...t }),
49
+ (o = e.children) == null ? void 0 : o.map((s, h, v) => /* @__PURE__ */ f(
50
+ g,
51
+ {
52
+ ...t,
53
+ key: s.value,
54
+ option: s,
55
+ options: v,
56
+ index: h,
57
+ deep: (m || 0) + 1
58
+ }
59
+ ))
60
+ ]
61
+ },
62
+ e.value
63
+ ) : /* @__PURE__ */ i(d, { ...t });
64
+ }, w = (t) => {
65
+ const {
66
+ value: n,
67
+ options: e,
68
+ onChange: l,
69
+ nullable: r = !1,
70
+ clearLabel: m = "Clear",
71
+ disabled: c
72
+ } = t;
73
+ return /* @__PURE__ */ u(b, { value: n, onValueChange: l, disabled: c, children: [
74
+ /* @__PURE__ */ i(B, { ...t }),
75
+ /* @__PURE__ */ u(R, { children: [
76
+ r && /* @__PURE__ */ i(
77
+ y,
78
+ {
79
+ className: "w-full px-2",
80
+ variant: "secondary",
81
+ size: "sm",
82
+ onClick: () => {
83
+ l == null || l("");
84
+ },
85
+ children: m
86
+ }
87
+ ),
88
+ e.map((a, o) => /* @__PURE__ */ f(
89
+ g,
90
+ {
91
+ ...t,
92
+ key: a.value,
93
+ option: a,
94
+ index: o,
95
+ deep: 0
96
+ }
97
+ ))
98
+ ] })
99
+ ] });
69
100
  };
70
101
  export {
71
- T as Select
102
+ w as Select
72
103
  };
@@ -1,9 +1,12 @@
1
- import { ReactNode } from 'react';
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
 
3
- export interface SelectOption<ExtendOptionData> {
3
+ import * as SelectPrimitive from '@radix-ui/react-select';
4
+ export interface SelectOption<ExtendOptionData = unknown> {
4
5
  value: string;
5
6
  label?: ReactNode;
7
+ disabled?: boolean;
6
8
  data?: ExtendOptionData;
9
+ children?: SelectOption<ExtendOptionData>[];
7
10
  }
8
11
  export type SelectRenderTrigger<ExtendOptionData> = (props: Omit<SelectProps<ExtendOptionData>, 'renderTrigger'>, defaultComponent: ReactNode) => ReactNode;
9
12
  export type SelectRenderOption<ExtendOptionData> = (option: SelectOption<ExtendOptionData>, index: number, options: SelectOption<ExtendOptionData>[], props: Omit<SelectProps<ExtendOptionData>, 'renderOption'>, defaultComponent: ReactNode) => ReactNode;
@@ -15,7 +18,7 @@ export interface SelectProps<ExtendOptionData> {
15
18
  /** Select placeholder string. */
16
19
  placeholder?: string;
17
20
  /** Select Root onValueChange handler. */
18
- onChange: (value: SelectOption<ExtendOptionData>['value']) => void;
21
+ onChange?: (value: SelectOption<ExtendOptionData>['value']) => void;
19
22
  /** Show reset select item button. */
20
23
  disabled?: boolean;
21
24
  /** Show reset select item button. */
@@ -26,4 +29,9 @@ export interface SelectProps<ExtendOptionData> {
26
29
  renderTrigger?: SelectRenderTrigger<ExtendOptionData>;
27
30
  /** Render custom option. */
28
31
  renderOption?: SelectRenderOption<ExtendOptionData>;
32
+ /** Select Slot props */
33
+ slotProps?: {
34
+ /** Select Default Trigger Props */
35
+ triggerProps?: ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>;
36
+ };
29
37
  }
@@ -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>>;
@@ -1,14 +1,15 @@
1
1
  import { jsxs as n, jsx as t } from "react/jsx-runtime";
2
2
  import * as l from "react";
3
3
  import * as e from "@radix-ui/react-select";
4
- import { ChevronDown as i, ChevronUp as f, Check as u } from "lucide-react";
4
+ import { ChevronDown as i, ChevronUp as u, Check as h } from "lucide-react";
5
5
  import { cn as s } from "@oneplatformdev/utils";
6
- const v = e.Root, R = e.Group, C = e.Value, h = l.forwardRef(({ className: o, children: r, ...a }, d) => /* @__PURE__ */ n(
6
+ const R = e.Root, C = e.Group, I = e.Value, w = l.forwardRef(({ className: o, children: r, ...a }, d) => /* @__PURE__ */ n(
7
7
  e.Trigger,
8
8
  {
9
9
  ref: d,
10
10
  className: s(
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",
11
+ "flex h-10 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,
@@ -18,7 +19,7 @@ const v = e.Root, R = e.Group, C = e.Value, h = l.forwardRef(({ className: o, ch
18
19
  ]
19
20
  }
20
21
  ));
21
- h.displayName = e.Trigger.displayName;
22
+ w.displayName = e.Trigger.displayName;
22
23
  const c = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
23
24
  e.ScrollUpButton,
24
25
  {
@@ -28,7 +29,7 @@ const c = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
28
29
  o
29
30
  ),
30
31
  ...r,
31
- children: /* @__PURE__ */ t(f, { className: "h-4 w-4" })
32
+ children: /* @__PURE__ */ t(u, { className: "h-4 w-4" })
32
33
  }
33
34
  ));
34
35
  c.displayName = e.ScrollUpButton.displayName;
@@ -45,17 +46,21 @@ const m = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
45
46
  }
46
47
  ));
47
48
  m.displayName = e.ScrollDownButton.displayName;
48
- const w = l.forwardRef(({ className: o, children: r, position: a = "popper", ...d }, p) => /* @__PURE__ */ t(e.Portal, { children: /* @__PURE__ */ n(
49
+ const y = l.forwardRef(({ className: o, children: r, position: a = "popper", style: d, ...p }, f) => /* @__PURE__ */ t(e.Portal, { children: /* @__PURE__ */ n(
49
50
  e.Content,
50
51
  {
51
- ref: p,
52
+ ref: f,
52
53
  className: s(
53
54
  "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
54
55
  a === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
55
56
  o
56
57
  ),
57
58
  position: a,
58
- ...d,
59
+ style: {
60
+ pointerEvents: "auto",
61
+ ...d
62
+ },
63
+ ...p,
59
64
  children: [
60
65
  /* @__PURE__ */ t(c, {}),
61
66
  /* @__PURE__ */ t(
@@ -72,8 +77,8 @@ const w = l.forwardRef(({ className: o, children: r, position: a = "popper", ...
72
77
  ]
73
78
  }
74
79
  ) }));
75
- w.displayName = e.Content.displayName;
76
- const y = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
80
+ y.displayName = e.Content.displayName;
81
+ const g = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
77
82
  e.Label,
78
83
  {
79
84
  ref: a,
@@ -81,8 +86,8 @@ const y = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
81
86
  ...r
82
87
  }
83
88
  ));
84
- y.displayName = e.Label.displayName;
85
- const g = l.forwardRef(({ className: o, children: r, ...a }, d) => /* @__PURE__ */ n(
89
+ g.displayName = e.Label.displayName;
90
+ const N = l.forwardRef(({ className: o, children: r, ...a }, d) => /* @__PURE__ */ n(
86
91
  e.Item,
87
92
  {
88
93
  ref: d,
@@ -92,13 +97,13 @@ const g = l.forwardRef(({ className: o, children: r, ...a }, d) => /* @__PURE__
92
97
  ),
93
98
  ...a,
94
99
  children: [
95
- /* @__PURE__ */ t("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ t(e.ItemIndicator, { children: /* @__PURE__ */ t(u, { className: "h-4 w-4" }) }) }),
100
+ /* @__PURE__ */ t("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ t(e.ItemIndicator, { children: /* @__PURE__ */ t(h, { className: "h-4 w-4" }) }) }),
96
101
  /* @__PURE__ */ t(e.ItemText, { children: r })
97
102
  ]
98
103
  }
99
104
  ));
100
- g.displayName = e.Item.displayName;
101
- const N = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
105
+ N.displayName = e.Item.displayName;
106
+ const x = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
102
107
  e.Separator,
103
108
  {
104
109
  ref: a,
@@ -106,16 +111,16 @@ const N = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
106
111
  ...r
107
112
  }
108
113
  ));
109
- N.displayName = e.Separator.displayName;
114
+ x.displayName = e.Separator.displayName;
110
115
  export {
111
- w as SelectContent,
112
- R as SelectGroup,
113
- g as SelectItem,
114
- y as SelectLabel,
115
- v as SelectRoot,
116
+ y as SelectContent,
117
+ C as SelectGroup,
118
+ N as SelectItem,
119
+ g as SelectLabel,
120
+ R as SelectRoot,
116
121
  m as SelectScrollDownButton,
117
122
  c as SelectScrollUpButton,
118
- N as SelectSeparator,
119
- h as SelectTrigger,
120
- C as SelectValue
123
+ x as SelectSeparator,
124
+ w as SelectTrigger,
125
+ I as SelectValue
121
126
  };
package/Sheet/Sheet.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
- import * as React from "react";
3
- import * as SheetPrimitive from "@radix-ui/react-dialog";
2
+ import * as React from 'react';
3
+ import * as SheetPrimitive from '@radix-ui/react-dialog';
4
4
  declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
5
5
  declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
6
  declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
@@ -10,6 +10,9 @@ declare const sheetVariants: (props?: ({
10
10
  side?: "top" | "right" | "bottom" | "left" | null | undefined;
11
11
  } & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
12
12
  interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
13
+ slotProps?: {
14
+ overlay?: React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>;
15
+ };
13
16
  }
14
17
  declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
15
18
  declare const SheetHeader: {
package/Sheet/Sheet.mjs CHANGED
@@ -1,10 +1,10 @@
1
- import { jsx as o, jsxs as n } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
2
  import * as r from "react";
3
3
  import * as e from "@radix-ui/react-dialog";
4
- import { cva as c } from "class-variance-authority";
5
- import { X as f } from "lucide-react";
4
+ import { cva as f } from "class-variance-authority";
5
+ import { X as p } from "lucide-react";
6
6
  import { cn as i } from "@oneplatformdev/utils";
7
- const C = e.Root, R = e.Trigger, T = e.Close, p = e.Portal, d = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
7
+ const R = e.Root, T = e.Trigger, j = e.Close, h = e.Portal, l = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
8
8
  e.Overlay,
9
9
  {
10
10
  className: i(
@@ -15,8 +15,8 @@ const C = e.Root, R = e.Trigger, T = e.Close, p = e.Portal, d = r.forwardRef(({
15
15
  ref: s
16
16
  }
17
17
  ));
18
- d.displayName = e.Overlay.displayName;
19
- const h = c(
18
+ l.displayName = e.Overlay.displayName;
19
+ const g = f(
20
20
  "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
21
21
  {
22
22
  variants: {
@@ -31,17 +31,17 @@ const h = c(
31
31
  side: "right"
32
32
  }
33
33
  }
34
- ), g = r.forwardRef(({ side: t = "right", className: a, children: s, ...l }, m) => /* @__PURE__ */ n(p, { children: [
35
- /* @__PURE__ */ o(d, {}),
36
- /* @__PURE__ */ n(
34
+ ), u = r.forwardRef(({ side: t = "right", className: a, children: s, slotProps: n, ...m }, c) => /* @__PURE__ */ d(h, { children: [
35
+ /* @__PURE__ */ o(l, { ...(n == null ? void 0 : n.overlay) || {} }),
36
+ /* @__PURE__ */ d(
37
37
  e.Content,
38
38
  {
39
- ref: m,
40
- className: i(h({ side: t }), a),
41
- ...l,
39
+ ref: c,
40
+ className: i(g({ side: t }), a),
41
+ ...m,
42
42
  children: [
43
- /* @__PURE__ */ n(e.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
44
- /* @__PURE__ */ o(f, { className: "h-4 w-4" }),
43
+ /* @__PURE__ */ d(e.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
44
+ /* @__PURE__ */ o(p, { className: "h-4 w-4" }),
45
45
  /* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
46
46
  ] }),
47
47
  s
@@ -49,8 +49,8 @@ const h = c(
49
49
  }
50
50
  )
51
51
  ] }));
52
- g.displayName = e.Content.displayName;
53
- const u = ({
52
+ u.displayName = e.Content.displayName;
53
+ const y = ({
54
54
  className: t,
55
55
  ...a
56
56
  }) => /* @__PURE__ */ o(
@@ -63,8 +63,8 @@ const u = ({
63
63
  ...a
64
64
  }
65
65
  );
66
- u.displayName = "SheetHeader";
67
- const y = ({
66
+ y.displayName = "SheetHeader";
67
+ const x = ({
68
68
  className: t,
69
69
  ...a
70
70
  }) => /* @__PURE__ */ o(
@@ -77,8 +77,8 @@ const y = ({
77
77
  ...a
78
78
  }
79
79
  );
80
- y.displayName = "SheetFooter";
81
- const x = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
80
+ x.displayName = "SheetFooter";
81
+ const N = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
82
82
  e.Title,
83
83
  {
84
84
  ref: s,
@@ -86,8 +86,8 @@ const x = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
86
86
  ...a
87
87
  }
88
88
  ));
89
- x.displayName = e.Title.displayName;
90
- const N = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
89
+ N.displayName = e.Title.displayName;
90
+ const b = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
91
91
  e.Description,
92
92
  {
93
93
  ref: s,
@@ -95,16 +95,16 @@ const N = r.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
95
95
  ...a
96
96
  }
97
97
  ));
98
- N.displayName = e.Description.displayName;
98
+ b.displayName = e.Description.displayName;
99
99
  export {
100
- C as Sheet,
101
- T as SheetClose,
102
- g as SheetContent,
103
- N as SheetDescription,
104
- y as SheetFooter,
105
- u as SheetHeader,
106
- d as SheetOverlay,
107
- p as SheetPortal,
108
- x as SheetTitle,
109
- R as SheetTrigger
100
+ R as Sheet,
101
+ j as SheetClose,
102
+ u as SheetContent,
103
+ b as SheetDescription,
104
+ x as SheetFooter,
105
+ y as SheetHeader,
106
+ l as SheetOverlay,
107
+ h as SheetPortal,
108
+ N as SheetTitle,
109
+ T as SheetTrigger
110
110
  };
@@ -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
  };