@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
@@ -1,7 +1,9 @@
1
- import * as React from "react";
2
- import * as AccordionPrimitive from "@radix-ui/react-accordion";
1
+ import * as React from 'react';
2
+ import * as AccordionPrimitive from '@radix-ui/react-accordion';
3
3
  declare const Accordion: React.ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & React.RefAttributes<HTMLDivElement>>;
4
4
  declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
- declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
6
+ showChevron?: boolean;
7
+ } & React.RefAttributes<HTMLButtonElement>>;
6
8
  declare const AccordionContent: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
9
  export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
@@ -1,46 +1,49 @@
1
1
  import { jsx as a, jsxs as d } from "react/jsx-runtime";
2
- import * as i from "react";
2
+ import * as s from "react";
3
3
  import * as e from "@radix-ui/react-accordion";
4
- import { ChevronDown as m } from "lucide-react";
5
- import { cn as s } from "@oneplatformdev/utils";
6
- const g = e.Root, c = i.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ a(
4
+ import { ChevronDown as l } from "lucide-react";
5
+ import { cn as c } from "@oneplatformdev/utils";
6
+ const w = e.Root, f = s.forwardRef(({ className: t, ...o }, r) => /* @__PURE__ */ a(
7
7
  e.Item,
8
8
  {
9
9
  ref: r,
10
- className: s("border-b", o),
11
- ...t
10
+ className: c("border-b", t),
11
+ ...o
12
12
  }
13
13
  ));
14
- c.displayName = "AccordionItem";
15
- const l = i.forwardRef(({ className: o, children: t, ...r }, n) => /* @__PURE__ */ a(e.Header, { className: "flex", children: /* @__PURE__ */ d(
14
+ f.displayName = "AccordionItem";
15
+ const p = s.forwardRef(({ className: t, children: o, showChevron: r = !0, ...i }, m) => /* @__PURE__ */ a(e.Header, { className: "flex", children: /* @__PURE__ */ d(
16
16
  e.Trigger,
17
17
  {
18
- ref: n,
19
- className: s(
20
- "flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",
21
- o
18
+ ref: m,
19
+ className: c(
20
+ "flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all text-left [&[data-state=open]>svg]:rotate-180",
21
+ t
22
22
  ),
23
- ...r,
23
+ onKeyDown: (n) => {
24
+ n.key === " " && n.target === n.currentTarget && n.preventDefault();
25
+ },
26
+ ...i,
24
27
  children: [
25
- t,
26
- /* @__PURE__ */ a(m, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" })
28
+ o,
29
+ r && /* @__PURE__ */ a(l, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" })
27
30
  ]
28
31
  }
29
32
  ) }));
30
- l.displayName = e.Trigger.displayName;
31
- const f = i.forwardRef(({ className: o, children: t, ...r }, n) => /* @__PURE__ */ a(
33
+ p.displayName = e.Trigger.displayName;
34
+ const N = s.forwardRef(({ className: t, children: o, ...r }, i) => /* @__PURE__ */ a(
32
35
  e.Content,
33
36
  {
34
- ref: n,
37
+ ref: i,
35
38
  className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
36
39
  ...r,
37
- children: /* @__PURE__ */ a("div", { className: s("pb-4 pt-0", o), children: t })
40
+ children: /* @__PURE__ */ a("div", { className: c("pb-4 pt-0", t), children: o })
38
41
  }
39
42
  ));
40
- f.displayName = e.Content.displayName;
43
+ N.displayName = e.Content.displayName;
41
44
  export {
42
- g as Accordion,
43
- f as AccordionContent,
44
- c as AccordionItem,
45
- l as AccordionTrigger
45
+ w as Accordion,
46
+ N as AccordionContent,
47
+ f as AccordionItem,
48
+ p as AccordionTrigger
46
49
  };
@@ -1,6 +1,6 @@
1
1
  import { ButtonProps } from '../Button';
2
- import * as React from "react";
3
- import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
2
+ import * as React from 'react';
3
+ import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
4
4
  declare const AlertDialogRoot: React.FC<AlertDialogPrimitive.AlertDialogProps>;
5
5
  declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
6
  declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
@@ -38,7 +38,7 @@ const g = ({
38
38
  "div",
39
39
  {
40
40
  className: s(
41
- "flex flex-col space-y-2 text-center sm:text-left",
41
+ "w-full min-w-0 flex flex-col space-y-2 text-center sm:text-left",
42
42
  a
43
43
  ),
44
44
  ...t
@@ -77,7 +77,7 @@ const x = i.forwardRef(({ className: a, ...t }, o) => /* @__PURE__ */ l(
77
77
  }
78
78
  ));
79
79
  x.displayName = e.Description.displayName;
80
- const A = i.forwardRef(({ className: a, variant: t, size: o, ...r }, d) => /* @__PURE__ */ l(
80
+ const u = i.forwardRef(({ className: a, variant: t, size: o, ...r }, d) => /* @__PURE__ */ l(
81
81
  e.Action,
82
82
  {
83
83
  ref: d,
@@ -85,8 +85,8 @@ const A = i.forwardRef(({ className: a, variant: t, size: o, ...r }, d) => /* @_
85
85
  ...r
86
86
  }
87
87
  ));
88
- A.displayName = e.Action.displayName;
89
- const D = i.forwardRef(({ className: a, variant: t = "outline", size: o, ...r }, d) => /* @__PURE__ */ l(
88
+ u.displayName = e.Action.displayName;
89
+ const A = i.forwardRef(({ className: a, variant: t = "outline", size: o, ...r }, d) => /* @__PURE__ */ l(
90
90
  e.Cancel,
91
91
  {
92
92
  ref: d,
@@ -98,10 +98,10 @@ const D = i.forwardRef(({ className: a, variant: t = "outline", size: o, ...r },
98
98
  ...r
99
99
  }
100
100
  ));
101
- D.displayName = e.Cancel.displayName;
101
+ A.displayName = e.Cancel.displayName;
102
102
  export {
103
- A as AlertDialogAction,
104
- D as AlertDialogCancel,
103
+ u as AlertDialogAction,
104
+ A as AlertDialogCancel,
105
105
  p as AlertDialogContent,
106
106
  x as AlertDialogDescription,
107
107
  N as AlertDialogFooter,
package/Button/Button.mjs CHANGED
@@ -5,27 +5,28 @@ import { cn as c } from "@oneplatformdev/utils";
5
5
  import { buttonVariants as l } from "./buttonVariants.mjs";
6
6
  import "../Tooltip/TooltipRoot.mjs";
7
7
  import { Tooltip as d } from "../Tooltip/Tooltip.mjs";
8
- const x = i.forwardRef(
9
- ({ disabled: o, className: a, variant: e, size: n, asChild: f = !1, title: r = "", tooltip: t, ...p }, s) => /* @__PURE__ */ m(
8
+ const y = i.forwardRef(
9
+ ({ disabled: o, className: e, variant: a, size: n, asChild: p = !1, title: t = "", tooltip: r, ...f }, s) => /* @__PURE__ */ m(
10
10
  d,
11
11
  {
12
- open: o || !r && !t ? !1 : void 0,
13
- message: t || r,
12
+ open: o || !t && !r ? !1 : void 0,
13
+ message: r || t,
14
14
  delay: 300,
15
15
  children: /* @__PURE__ */ m(
16
- f ? u : "button",
16
+ p ? u : "button",
17
17
  {
18
- className: c(l({ variant: e, size: n, className: a })),
18
+ type: "button",
19
19
  ref: s,
20
20
  disabled: o,
21
- ...p
21
+ className: c(l({ variant: a, size: n, className: e })),
22
+ ...f
22
23
  }
23
24
  )
24
25
  }
25
26
  )
26
27
  );
27
- x.displayName = "Button";
28
+ y.displayName = "Button";
28
29
  export {
29
- x as Button,
30
- x as default
30
+ y as Button,
31
+ y as default
31
32
  };
@@ -1,10 +1,16 @@
1
1
  import { cva as e } from "class-variance-authority";
2
- const t = e(
3
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
2
+ const r = e(
3
+ [
4
+ "inline-flex items-center justify-center gap-2",
5
+ "whitespace-nowrap rounded-lg text-sm font-medium",
6
+ "transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
7
+ "disabled:pointer-events-none disabled:opacity-50",
8
+ "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0"
9
+ ],
4
10
  {
5
11
  variants: {
6
12
  variant: {
7
- default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
13
+ default: "bg-primary text-primary-foreground shadow hover:opacity-[.8]",
8
14
  destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
9
15
  outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
10
16
  secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
@@ -13,17 +19,17 @@ const t = e(
13
19
  },
14
20
  size: {
15
21
  default: "h-9 px-4 py-2",
16
- sm: "h-8 rounded-md px-3 text-xs",
17
- lg: "h-10 rounded-md px-8",
18
- icon: "h-9 w-9"
22
+ sm: "h-8 rounded-md px-3 text-xs [&_svg]:size-4",
23
+ lg: "h-10 px-8 [&_svg]:size-5 px-3 py-2",
24
+ icon: "h-9 w-9 [&_svg]:!size-5"
19
25
  }
20
26
  },
21
27
  defaultVariants: {
22
28
  variant: "default",
23
- size: "default"
29
+ size: "lg"
24
30
  }
25
31
  }
26
32
  );
27
33
  export {
28
- t as buttonVariants
34
+ r as buttonVariants
29
35
  };
@@ -16,10 +16,11 @@ function u({
16
16
  showOutsideDays: c,
17
17
  className: e("p-3", n),
18
18
  classNames: {
19
+ caption_dropdowns: "flex flex-col gap-1",
19
20
  months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
20
21
  month: "space-y-4",
21
- caption: "flex justify-center pt-1 relative items-center",
22
- caption_label: "text-sm font-medium",
22
+ caption: "flex justify-center pt-1 relative items-center gap-4",
23
+ caption_label: "text-sm font-medium hidden",
23
24
  nav: "space-x-1 flex items-center",
24
25
  nav_button: e(
25
26
  o({ variant: "outline" }),
package/Card/Card.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as React from "react";
1
+ import * as React from 'react';
2
2
  declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
3
3
  declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
4
4
  declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
package/Card/Card.mjs CHANGED
@@ -1,61 +1,62 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
2
  import * as o from "react";
3
3
  import { cn as t } from "@oneplatformdev/utils";
4
- const s = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
4
+ const s = o.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ d(
5
5
  "div",
6
6
  {
7
7
  ref: r,
8
8
  className: t(
9
- "rounded-xl border bg-card text-card-foreground shadow",
10
- a
9
+ "flex flex-col gap-1 p-2",
10
+ "rounded-2xl border border-border bg-card text-card-foreground shadow-none",
11
+ e
11
12
  ),
12
- ...e
13
+ ...a
13
14
  }
14
15
  ));
15
16
  s.displayName = "Card";
16
- const i = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
17
+ const i = o.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ d(
17
18
  "div",
18
19
  {
19
20
  ref: r,
20
- className: t("flex flex-col space-y-1.5 p-6", a),
21
- ...e
21
+ className: t("flex flex-col space-y-1.5 p-6", e),
22
+ ...a
22
23
  }
23
24
  ));
24
25
  i.displayName = "CardHeader";
25
- const c = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
26
+ const l = o.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ d(
26
27
  "div",
27
28
  {
28
29
  ref: r,
29
- className: t("font-semibold leading-none tracking-tight", a),
30
- ...e
30
+ className: t("font-semibold leading-none tracking-tight", e),
31
+ ...a
31
32
  }
32
33
  ));
33
- c.displayName = "CardTitle";
34
- const m = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
34
+ l.displayName = "CardTitle";
35
+ const n = o.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ d(
35
36
  "div",
36
37
  {
37
38
  ref: r,
38
- className: t("text-sm text-muted-foreground", a),
39
- ...e
39
+ className: t("text-sm text-muted-foreground", e),
40
+ ...a
40
41
  }
41
42
  ));
42
- m.displayName = "CardDescription";
43
- const n = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d("div", { ref: r, className: t("p-6 pt-0", a), ...e }));
44
- n.displayName = "CardContent";
45
- const f = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
43
+ n.displayName = "CardDescription";
44
+ const c = o.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ d("div", { ref: r, className: t("p-6 pt-0", e), ...a }));
45
+ c.displayName = "CardContent";
46
+ const f = o.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ d(
46
47
  "div",
47
48
  {
48
49
  ref: r,
49
- className: t("flex items-center p-6 pt-0", a),
50
- ...e
50
+ className: t("flex items-center p-6 pt-0", e),
51
+ ...a
51
52
  }
52
53
  ));
53
54
  f.displayName = "CardFooter";
54
55
  export {
55
56
  s as Card,
56
- n as CardContent,
57
- m as CardDescription,
57
+ c as CardContent,
58
+ n as CardDescription,
58
59
  f as CardFooter,
59
60
  i as CardHeader,
60
- c as CardTitle
61
+ l as CardTitle
61
62
  };
@@ -1,4 +1,5 @@
1
- import * as React from "react";
2
- import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
3
- declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
4
- export { Checkbox };
1
+ import { CheckboxLabelProps, CheckboxProps } from './Checkbox.types';
2
+ import * as React from 'react';
3
+ declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
4
+ declare const CheckboxLabel: React.ForwardRefExoticComponent<CheckboxLabelProps & React.RefAttributes<HTMLLabelElement>>;
5
+ export { Checkbox, CheckboxLabel };
@@ -1,27 +1,54 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import * as s from "react";
3
- import * as r from "@radix-ui/react-checkbox";
4
- import { Check as c } from "lucide-react";
5
- import { cn as o } from "@oneplatformdev/utils";
6
- const d = s.forwardRef(({ className: i, ...t }, a) => /* @__PURE__ */ e(
7
- r.Root,
1
+ import { jsx as r, jsxs as n } from "react/jsx-runtime";
2
+ import * as s from "@radix-ui/react-checkbox";
3
+ import { MinusIcon as l, CheckIcon as h } from "lucide-react";
4
+ import * as m from "react";
5
+ import { cn as a } from "@oneplatformdev/utils";
6
+ import { Label as u } from "../Label/Label.mjs";
7
+ import "../Label/labelVariants.mjs";
8
+ const d = m.forwardRef(({ className: t, checked: c, indeterminate: e, ...i }, o) => {
9
+ const f = e ? l : h;
10
+ return /* @__PURE__ */ r(
11
+ s.Root,
12
+ {
13
+ ref: o,
14
+ className: a(
15
+ "peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
16
+ t
17
+ ),
18
+ ...i,
19
+ checked: c ?? e,
20
+ children: /* @__PURE__ */ r(
21
+ s.Indicator,
22
+ {
23
+ className: a("flex items-center justify-center text-current"),
24
+ children: /* @__PURE__ */ r(f, { className: "h-4 w-4" })
25
+ }
26
+ )
27
+ }
28
+ );
29
+ });
30
+ d.displayName = s.Root.displayName;
31
+ const x = m.forwardRef(({ label: t = "", children: c, labelProps: e, ...i }, o) => /* @__PURE__ */ n(
32
+ u,
8
33
  {
9
- ref: a,
10
- className: o(
11
- "peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
12
- i
34
+ ref: o,
35
+ ...e,
36
+ className: a(
37
+ "flex w-full items-start gap-3 font-normal py-3 cursor-pointer",
38
+ e == null ? void 0 : e.className
13
39
  ),
14
- ...t,
15
- children: /* @__PURE__ */ e(
16
- r.Indicator,
17
- {
18
- className: o("flex items-center justify-center text-current"),
19
- children: /* @__PURE__ */ e(c, { className: "h-4 w-4" })
20
- }
21
- )
40
+ style: e == null ? void 0 : e.style,
41
+ children: [
42
+ /* @__PURE__ */ r(d, { ...i }),
43
+ /* @__PURE__ */ n("div", { className: "flex flex-col w-full gap-3", children: [
44
+ /* @__PURE__ */ r("span", { className: "flex flex-col justify-start leading-[16px]", children: t }),
45
+ c
46
+ ] })
47
+ ]
22
48
  }
23
49
  ));
24
- d.displayName = r.Root.displayName;
50
+ x.displayName = "CheckboxLabel";
25
51
  export {
26
- d as Checkbox
52
+ d as Checkbox,
53
+ x as CheckboxLabel
27
54
  };
@@ -0,0 +1,10 @@
1
+ import { Label } from '../Label';
2
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
3
+ import * as React from 'react';
4
+ export interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
5
+ indeterminate?: boolean;
6
+ }
7
+ export interface CheckboxLabelProps extends CheckboxProps {
8
+ label?: string;
9
+ labelProps?: React.ComponentPropsWithoutRef<typeof Label>;
10
+ }
@@ -1 +1,2 @@
1
1
  export * from './Checkbox';
2
+ export type * from './Checkbox.types';
@@ -1,4 +1,5 @@
1
- import { Checkbox as r } from "./Checkbox.mjs";
1
+ import { Checkbox as b, CheckboxLabel as x } from "./Checkbox.mjs";
2
2
  export {
3
- r as Checkbox
3
+ b as Checkbox,
4
+ x as CheckboxLabel
4
5
  };
@@ -1,4 +1,4 @@
1
1
  import { ComboboxProps } from './Combobox.types';
2
- import { FC } from 'react';
2
+ import { default as React } from 'react';
3
3
 
4
- export declare const Combobox: FC<ComboboxProps>;
4
+ export declare const Combobox: React.ForwardRefExoticComponent<ComboboxProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,126 +1,15 @@
1
- import { jsx as a, jsxs as t } from "react/jsx-runtime";
2
- import n, { useEffect as E } from "react";
3
- import { LoadingMask as I } from "../LoadingMask/LoadingMask.mjs";
4
- import { Popover as U, PopoverTrigger as _, PopoverContent as B } from "../Popover/Popover.mjs";
5
- import { Button as F } from "../Button/Button.mjs";
1
+ import "react/jsx-runtime";
2
+ import "react";
3
+ import "../LoadingMask/LoadingMask.mjs";
4
+ import "../LoadingMask/RenderLoadingMask.mjs";
5
+ import "../Popover/Popover.mjs";
6
+ import "../Button/Button.mjs";
6
7
  import "../Button/buttonVariants.mjs";
7
- import { Command as G, CommandInput as M, CommandList as R, CommandEmpty as V, CommandGroup as W, CommandItem as X } from "../Command/Command.mjs";
8
- import { cn as g } from "@oneplatformdev/utils";
9
- import { useDebounceCallback as q } from "@oneplatformdev/hooks";
10
- import { X as z, ChevronsUpDown as A, Check as H } from "lucide-react";
11
- const te = (w) => {
12
- var C;
13
- const {
14
- value: o,
15
- onChange: y,
16
- placeholder: x,
17
- disabled: N,
18
- searchLabel: S,
19
- fetchOptions: L,
20
- options: r,
21
- emptyLabel: O = "No options"
22
- } = w, [l, d] = n.useState(!1), [P, m] = n.useState(""), [p, h] = n.useState([]), [s, u] = n.useState(), [f, b] = n.useState(!1);
23
- E(() => {
24
- r != null && r.length && h(r);
25
- }, [r]);
26
- const j = async () => {
27
- l || (v(), m(""));
28
- }, v = async (e) => {
29
- b(!0);
30
- try {
31
- const i = await L(e);
32
- h(i);
33
- } catch (i) {
34
- console.error("Unexpected error while get option:", i);
35
- } finally {
36
- b(!1);
37
- }
38
- }, k = q(v, 1e3), D = (e) => {
39
- m(e), k(e);
40
- }, c = (e) => {
41
- y(e.value), u(e);
42
- }, T = () => {
43
- c({ value: "", label: "" }), u(void 0);
44
- };
45
- return /* @__PURE__ */ a("div", { className: "w-full", children: /* @__PURE__ */ t(
46
- U,
47
- {
48
- open: l,
49
- onOpenChange: (e) => {
50
- d(e), e && j();
51
- },
52
- children: [
53
- /* @__PURE__ */ a(_, { asChild: !0, className: "border-border", children: /* @__PURE__ */ t(
54
- F,
55
- {
56
- variant: "outline",
57
- role: "combobox",
58
- "aria-expanded": l,
59
- className: g(
60
- "w-full justify-between font-normal text-sm border bg-input",
61
- l ? "border-2 border-sidebar-accent" : "border-border"
62
- ),
63
- disabled: N,
64
- children: [
65
- /* @__PURE__ */ a("span", { className: "truncate max-w-[calc(100%-1.5rem)] overflow-hidden whitespace-nowrap", children: o ? ((C = p.find((e) => e.value === o)) == null ? void 0 : C.label) || (s == null ? void 0 : s.label) : /* @__PURE__ */ a("span", { className: "text-gray-400", children: x }) }),
66
- o ? /* @__PURE__ */ a(
67
- z,
68
- {
69
- className: "opacity-50 w-4 h-4 cursor-pointer hover:opacity-100",
70
- onClick: (e) => {
71
- e.stopPropagation(), T();
72
- }
73
- }
74
- ) : /* @__PURE__ */ a(A, { className: "opacity-50 w-4 h-4" })
75
- ]
76
- }
77
- ) }),
78
- /* @__PURE__ */ a(
79
- B,
80
- {
81
- className: "w-[var(--radix-popper-anchor-width)] max-w-none p-0",
82
- align: "start",
83
- children: /* @__PURE__ */ t(G, { shouldFilter: !1, children: [
84
- /* @__PURE__ */ a(
85
- M,
86
- {
87
- placeholder: S,
88
- value: P,
89
- onValueChange: D
90
- }
91
- ),
92
- /* @__PURE__ */ t(R, { children: [
93
- !f && /* @__PURE__ */ a(V, { children: O }),
94
- /* @__PURE__ */ a(W, { children: f ? /* @__PURE__ */ a("div", { className: "flex justify-center", children: /* @__PURE__ */ a(I, {}) }) : p.map((e) => /* @__PURE__ */ t(
95
- X,
96
- {
97
- value: e.value,
98
- onSelect: () => {
99
- o === e.value ? c({ value: "", label: "" }) : c(e), d(!1);
100
- },
101
- children: [
102
- e.label,
103
- /* @__PURE__ */ a(
104
- H,
105
- {
106
- className: g(
107
- "ml-auto",
108
- o === e.value ? "opacity-100" : "opacity-0"
109
- )
110
- }
111
- )
112
- ]
113
- },
114
- e.value
115
- )) })
116
- ] })
117
- ] })
118
- }
119
- )
120
- ]
121
- }
122
- ) });
123
- };
8
+ import "../Command/Command.mjs";
9
+ import "@oneplatformdev/utils";
10
+ import "@oneplatformdev/hooks";
11
+ import "lucide-react";
12
+ import { C as c } from "../Combobox-BzFTeSHQ.js";
124
13
  export {
125
- te as Combobox
14
+ c as Combobox
126
15
  };
@@ -1,6 +1,33 @@
1
+ import { Dispatch, ReactNode, SetStateAction } from 'react';
2
+
1
3
  export interface ComboboxOption {
2
4
  value: string;
3
5
  label: string;
6
+ items?: ComboboxOption[];
7
+ }
8
+ export interface ComboboxCallbackStateParams {
9
+ options: ComboboxOption[];
10
+ setOptions: Dispatch<SetStateAction<ComboboxOption[]>>;
11
+ selectedOption?: ComboboxOption;
12
+ setSelectedOption: Dispatch<SetStateAction<ComboboxOption | undefined>>;
13
+ search: string;
14
+ setSearch: Dispatch<SetStateAction<string>>;
15
+ open: boolean;
16
+ setOpen: Dispatch<SetStateAction<boolean>>;
17
+ loading: boolean;
18
+ setLoading: Dispatch<SetStateAction<boolean>>;
19
+ isEmptyList: boolean;
20
+ isSearchedEmptyList: boolean;
21
+ }
22
+ export interface IComboboxOptionsNodeProps {
23
+ value?: string;
24
+ option: ComboboxOption;
25
+ onChangeOption?: (option: ComboboxOption) => void;
26
+ deep?: number;
27
+ setOpen: Dispatch<SetStateAction<boolean>>;
28
+ }
29
+ export interface IComboboxOptionsProps extends Omit<IComboboxOptionsNodeProps, 'option'> {
30
+ options?: ComboboxOption[];
4
31
  }
5
32
  export interface ComboboxProps {
6
33
  value: string;
@@ -10,6 +37,14 @@ export interface ComboboxProps {
10
37
  disabled?: boolean;
11
38
  fetchOptions: (search?: string) => Promise<ComboboxOption[]>;
12
39
  options?: ComboboxOption[];
13
- /** CommandEmpty label*/
40
+ /** Command Empty list label*/
14
41
  emptyLabel?: string;
42
+ /** Command Empty list action */
43
+ emptyAction?: ((params: ComboboxCallbackStateParams) => ReactNode) | ReactNode;
44
+ /** Command Input footer action */
45
+ commandInputAction?: ((params: ComboboxCallbackStateParams) => ReactNode) | ReactNode;
46
+ /** Command List first element action */
47
+ listHeadAction?: ((params: ComboboxCallbackStateParams) => ReactNode) | ReactNode;
48
+ /** Callback for load data on start component */
49
+ onMount?: (params: ComboboxCallbackStateParams) => Promise<void>;
15
50
  }
@@ -0,0 +1,5 @@
1
+ import { IComboboxOptionsNodeProps } from '..';
2
+
3
+ export declare const ComboboxOptionItem: import('react').ForwardRefExoticComponent<IComboboxOptionsNodeProps & {
4
+ children?: import('react').ReactNode | undefined;
5
+ } & import('react').RefAttributes<HTMLDivElement>>;