@oneplatformdev/ui 0.0.1-beta.8 → 0.0.1-beta.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion/Accordion.d.ts +2 -2
- package/Accordion/Accordion.mjs +23 -20
- package/AlertDialog/AlertDialogRoot.d.ts +2 -2
- package/AlertDialog/AlertDialogRoot.mjs +7 -7
- package/Button/Button.mjs +11 -10
- package/Button/buttonVariants.mjs +5 -5
- package/Calendar/Calendar.mjs +3 -2
- package/Checkbox/Checkbox.d.ts +5 -4
- package/Checkbox/Checkbox.mjs +48 -21
- package/Checkbox/Checkbox.types.d.ts +10 -0
- package/Checkbox/index.d.ts +1 -0
- package/Checkbox/index.mjs +3 -2
- package/Combobox/Combobox.d.ts +2 -2
- package/Combobox/Combobox.mjs +12 -123
- package/Combobox/Combobox.types.d.ts +24 -1
- package/Combobox/ComboboxOptionItem.d.ts +5 -0
- package/Combobox/ComboboxOptionItem.mjs +67 -0
- package/Combobox/ComboboxOptions.d.ts +4 -0
- package/Combobox/ComboboxOptions.mjs +12 -0
- package/Combobox/index.mjs +1 -1
- package/Combobox-DpcCpN3b.js +301 -0
- package/Command/Command.d.ts +1 -1
- package/Command/Command.mjs +36 -29
- package/DataTable/DataTable.d.ts +10 -3
- package/DataTable/DataTable.mjs +33 -33
- package/DataTable/DataTableColumnFilter.d.ts +4 -0
- package/DataTable/DataTableColumnFilter.mjs +31 -0
- package/DatePicker/DatePicker.mjs +2 -2
- package/Dialog/Dialog.d.ts +2 -2
- package/Dialog/Dialog.mjs +16 -13
- package/DropdownMenu/DropdownMenu.d.ts +2 -2
- package/DropdownMenu/DropdownMenu.mjs +30 -26
- package/Dropzone/Dropzone.d.ts +22 -0
- package/Dropzone/Dropzone.mjs +151 -0
- package/Dropzone/Dropzone.types.d.ts +38 -0
- package/Dropzone/DropzoneFilePreview.d.ts +4 -0
- package/Dropzone/DropzoneFilePreview.mjs +9 -0
- package/Dropzone/DropzoneSinglePickPreview.d.ts +9 -0
- package/Dropzone/DropzoneSinglePickPreview.mjs +38 -0
- package/Dropzone/DropzoneUtils.d.ts +5 -0
- package/Dropzone/DropzoneUtils.mjs +24 -0
- package/Dropzone/index.d.ts +2 -0
- package/Dropzone/index.mjs +7 -0
- package/Dropzone/package.json +7 -0
- package/DropzoneFilePreview-Dhtv8F4u.js +67 -0
- package/Form/Form.d.ts +2 -2
- package/Form/Form.mjs +48 -45
- package/Form/FormRenderControl.d.ts +2 -3
- package/Form/FormRenderControl.mjs +10 -10
- package/Form/FormRenderControl.types.d.ts +5 -7
- package/FormCheckbox/FormCheckbox.d.ts +2 -3
- package/FormCheckbox/FormCheckbox.mjs +23 -23
- package/FormCheckbox/FormCheckbox.types.d.ts +3 -3
- package/FormCombobox/FormCombobox.d.ts +2 -2
- package/FormCombobox/FormCombobox.mjs +6 -6
- package/FormCombobox/FormCombobox.types.d.ts +2 -3
- package/FormDatePicker/FormDatePicker.d.ts +2 -2
- package/FormDatePicker/FormDatePicker.mjs +20 -18
- package/FormDatePicker/FormDatePicker.types.d.ts +2 -3
- package/FormDropzone/FormDropzone.d.ts +4 -0
- package/FormDropzone/FormDropzone.mjs +19 -0
- package/FormDropzone/FormDropzone.types.d.ts +6 -0
- package/FormDropzone/index.d.ts +2 -0
- package/FormDropzone/index.mjs +4 -0
- package/FormDropzone/package.json +7 -0
- package/FormInput/FormInput.d.ts +5 -3
- package/FormInput/FormInput.mjs +32 -18
- package/FormInput/FormInput.types.d.ts +2 -3
- package/FormRadio/FormRadio.d.ts +4 -0
- package/FormRadio/FormRadio.mjs +40 -0
- package/FormRadio/FormRadio.types.d.ts +6 -0
- package/FormRadio/index.d.ts +2 -0
- package/FormRadio/index.mjs +4 -0
- package/FormRadio/package.json +7 -0
- package/FormSelect/FormSelect.d.ts +2 -3
- package/FormSelect/FormSelect.mjs +19 -17
- package/FormSelect/FormSelect.types.d.ts +2 -3
- package/FormTextarea/FormTextarea.d.ts +2 -3
- package/FormTextarea/FormTextarea.mjs +13 -12
- package/FormTextarea/FormTextarea.types.d.ts +2 -3
- package/Input/Input.mjs +40 -34
- package/Input/Input.types.d.ts +4 -1
- package/Input/inputVariants.mjs +9 -3
- package/Label/Label.d.ts +2 -2
- package/Label/labelVariants.mjs +7 -4
- package/LazyLoader/LazyLoader.mjs +5 -4
- package/LoadingMask/LoadingMask.d.ts +4 -1
- package/LoadingMask/LoadingMask.mjs +18 -56
- package/LoadingMask/LoadingMask.types.d.ts +5 -0
- package/LoadingMask/RenderLoadingMask.d.ts +3 -0
- package/LoadingMask/RenderLoadingMask.mjs +108 -0
- package/LoadingMask/index.d.ts +2 -0
- package/LoadingMask/index.mjs +4 -2
- package/Radio/Radio.d.ts +4 -0
- package/Radio/Radio.mjs +12 -0
- package/Radio/Radio.types.d.ts +11 -0
- package/Radio/index.d.ts +2 -0
- package/Radio/index.mjs +4 -0
- package/Radio/package.json +7 -0
- package/RadioGroup/RadioGroup.d.ts +9 -3
- package/RadioGroup/RadioGroup.mjs +37 -19
- package/RadioGroup/index.mjs +4 -3
- package/ScrollArea/ScrollArea.d.ts +2 -2
- package/ScrollArea/ScrollArea.mjs +26 -13
- package/Select/Select.mjs +93 -63
- package/Select/Select.types.d.ts +9 -2
- package/Select/SelectRoot.d.ts +2 -2
- package/Select/SelectRoot.mjs +1 -0
- package/TablePagination/TablePagination.d.ts +16 -0
- package/TablePagination/TablePagination.mjs +74 -0
- package/TablePagination/index.d.ts +1 -0
- package/TablePagination/index.mjs +4 -0
- package/TablePagination/package.json +7 -0
- package/Tabs/Tabs.d.ts +3 -2
- package/Tabs/Tabs.mjs +20 -6
- package/Tabs/Tabs.types.d.ts +5 -2
- package/Tabs/index.mjs +8 -7
- package/Textarea/Textarea.d.ts +1 -1
- package/Textarea/Textarea.mjs +71 -15
- package/Textarea/Textarea.types.d.ts +16 -2
- package/Textarea/useAutosizeTextArea.d.ts +3 -0
- package/Textarea/useAutosizeTextArea.mjs +20 -0
- package/Toast/toastVariants.mjs +3 -3
- package/index.css +1 -1
- package/index.d.ts +3 -0
- package/index.mjs +332 -318
- package/package.json +9 -8
- package/tailwind.config.mjs +13 -13
package/Accordion/Accordion.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as React from
|
2
|
-
import * as AccordionPrimitive from
|
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
5
|
declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
package/Accordion/Accordion.mjs
CHANGED
@@ -1,46 +1,49 @@
|
|
1
1
|
import { jsx as a, jsxs as d } from "react/jsx-runtime";
|
2
|
-
import * as
|
2
|
+
import * as s from "react";
|
3
3
|
import * as e from "@radix-ui/react-accordion";
|
4
4
|
import { ChevronDown as m } from "lucide-react";
|
5
|
-
import { cn as
|
6
|
-
const
|
5
|
+
import { cn as c } from "@oneplatformdev/utils";
|
6
|
+
const u = e.Root, l = s.forwardRef(({ className: t, ...o }, r) => /* @__PURE__ */ a(
|
7
7
|
e.Item,
|
8
8
|
{
|
9
9
|
ref: r,
|
10
|
-
className:
|
11
|
-
...
|
10
|
+
className: c("border-b", t),
|
11
|
+
...o
|
12
12
|
}
|
13
13
|
));
|
14
|
-
|
15
|
-
const
|
14
|
+
l.displayName = "AccordionItem";
|
15
|
+
const f = s.forwardRef(({ className: t, children: o, ...r }, i) => /* @__PURE__ */ a(e.Header, { className: "flex", children: /* @__PURE__ */ d(
|
16
16
|
e.Trigger,
|
17
17
|
{
|
18
|
-
ref:
|
19
|
-
className:
|
18
|
+
ref: i,
|
19
|
+
className: c(
|
20
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
|
-
|
21
|
+
t
|
22
22
|
),
|
23
|
+
onKeyDown: (n) => {
|
24
|
+
n.key === " " && n.target === n.currentTarget && n.preventDefault();
|
25
|
+
},
|
23
26
|
...r,
|
24
27
|
children: [
|
25
|
-
|
28
|
+
o,
|
26
29
|
/* @__PURE__ */ a(m, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" })
|
27
30
|
]
|
28
31
|
}
|
29
32
|
) }));
|
30
|
-
|
31
|
-
const
|
33
|
+
f.displayName = e.Trigger.displayName;
|
34
|
+
const p = s.forwardRef(({ className: t, children: o, ...r }, i) => /* @__PURE__ */ a(
|
32
35
|
e.Content,
|
33
36
|
{
|
34
|
-
ref:
|
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:
|
40
|
+
children: /* @__PURE__ */ a("div", { className: c("pb-4 pt-0", t), children: o })
|
38
41
|
}
|
39
42
|
));
|
40
|
-
|
43
|
+
p.displayName = e.Content.displayName;
|
41
44
|
export {
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
45
|
+
u as Accordion,
|
46
|
+
p as AccordionContent,
|
47
|
+
l as AccordionItem,
|
48
|
+
f as AccordionTrigger
|
46
49
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ButtonProps } from '../Button';
|
2
|
-
import * as React from
|
3
|
-
import * as AlertDialogPrimitive from
|
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
|
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
|
-
|
89
|
-
const
|
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
|
-
|
101
|
+
A.displayName = e.Cancel.displayName;
|
102
102
|
export {
|
103
|
-
|
104
|
-
|
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
|
9
|
-
({ disabled: o, className:
|
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 || !
|
13
|
-
message:
|
12
|
+
open: o || !t && !r ? !1 : void 0,
|
13
|
+
message: r || t,
|
14
14
|
delay: 300,
|
15
15
|
children: /* @__PURE__ */ m(
|
16
|
-
|
16
|
+
p ? u : "button",
|
17
17
|
{
|
18
|
-
|
18
|
+
type: "button",
|
19
19
|
ref: s,
|
20
20
|
disabled: o,
|
21
|
-
|
21
|
+
className: c(l({ variant: a, size: n, className: e })),
|
22
|
+
...f
|
22
23
|
}
|
23
24
|
)
|
24
25
|
}
|
25
26
|
)
|
26
27
|
);
|
27
|
-
|
28
|
+
y.displayName = "Button";
|
28
29
|
export {
|
29
|
-
|
30
|
-
|
30
|
+
y as Button,
|
31
|
+
y as default
|
31
32
|
};
|
@@ -4,7 +4,7 @@ const t = e(
|
|
4
4
|
{
|
5
5
|
variants: {
|
6
6
|
variant: {
|
7
|
-
default: "bg-primary text-primary-foreground shadow hover:
|
7
|
+
default: "bg-primary text-primary-foreground shadow hover:opacity-[.8]",
|
8
8
|
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
9
9
|
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
10
10
|
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
@@ -13,14 +13,14 @@ const t = e(
|
|
13
13
|
},
|
14
14
|
size: {
|
15
15
|
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"
|
16
|
+
sm: "h-8 rounded-md px-3 text-xs [&_svg]:size-4",
|
17
|
+
lg: "h-10 rounded-md px-8 [&_svg]:size-5 px-3 py-2",
|
18
|
+
icon: "h-9 w-9 [&_svg]:!size-5"
|
19
19
|
}
|
20
20
|
},
|
21
21
|
defaultVariants: {
|
22
22
|
variant: "default",
|
23
|
-
size: "
|
23
|
+
size: "lg"
|
24
24
|
}
|
25
25
|
}
|
26
26
|
);
|
package/Calendar/Calendar.mjs
CHANGED
@@ -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/Checkbox/Checkbox.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
import
|
2
|
-
import * as
|
3
|
-
declare const Checkbox: React.ForwardRefExoticComponent<
|
4
|
-
|
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 };
|
package/Checkbox/Checkbox.mjs
CHANGED
@@ -1,27 +1,54 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import * as s from "react";
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import { cn as
|
6
|
-
|
7
|
-
|
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:
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
-
|
15
|
-
children:
|
16
|
-
r
|
17
|
-
{
|
18
|
-
className:
|
19
|
-
|
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
|
-
|
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
|
+
}
|
package/Checkbox/index.d.ts
CHANGED
package/Checkbox/index.mjs
CHANGED
package/Combobox/Combobox.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
import { ComboboxProps } from './Combobox.types';
|
2
|
-
import {
|
2
|
+
import { default as React } from 'react';
|
3
3
|
|
4
|
-
export declare const Combobox:
|
4
|
+
export declare const Combobox: React.ForwardRefExoticComponent<ComboboxProps & React.RefAttributes<HTMLDivElement>>;
|
package/Combobox/Combobox.mjs
CHANGED
@@ -1,126 +1,15 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
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
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
11
|
-
|
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-DpcCpN3b.js";
|
124
13
|
export {
|
125
|
-
|
14
|
+
c as Combobox
|
126
15
|
};
|
@@ -1,6 +1,25 @@
|
|
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 ComboboxPropsOnMountParams {
|
9
|
+
setOptions: Dispatch<SetStateAction<ComboboxOption[]>>;
|
10
|
+
search: string;
|
11
|
+
open: boolean;
|
12
|
+
setOpen: Dispatch<SetStateAction<boolean>>;
|
13
|
+
}
|
14
|
+
export interface IComboboxOptionsNodeProps {
|
15
|
+
value?: string;
|
16
|
+
option: ComboboxOption;
|
17
|
+
onChangeOption?: (option: ComboboxOption) => void;
|
18
|
+
deep?: number;
|
19
|
+
setOpen: Dispatch<SetStateAction<boolean>>;
|
20
|
+
}
|
21
|
+
export interface IComboboxOptionsProps extends Omit<IComboboxOptionsNodeProps, 'option'> {
|
22
|
+
options?: ComboboxOption[];
|
4
23
|
}
|
5
24
|
export interface ComboboxProps {
|
6
25
|
value: string;
|
@@ -10,6 +29,10 @@ export interface ComboboxProps {
|
|
10
29
|
disabled?: boolean;
|
11
30
|
fetchOptions: (search?: string) => Promise<ComboboxOption[]>;
|
12
31
|
options?: ComboboxOption[];
|
13
|
-
/**
|
32
|
+
/** Command Empty list label*/
|
14
33
|
emptyLabel?: string;
|
34
|
+
/** Command Empty list action */
|
35
|
+
emptyAction?: ((params: ComboboxPropsOnMountParams) => ReactNode) | ReactNode;
|
36
|
+
/** Callback for load data on start component */
|
37
|
+
onMount?: (params: ComboboxPropsOnMountParams) => Promise<void>;
|
15
38
|
}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import "react/jsx-runtime";
|
2
|
+
import "react";
|
3
|
+
import "../Accordion/Accordion.mjs";
|
4
|
+
import "../Alert/Alert.mjs";
|
5
|
+
import "../AlertDialog/AlertDialogRoot.mjs";
|
6
|
+
import "@oneplatformdev/utils";
|
7
|
+
import "recharts";
|
8
|
+
import "../Chart/Chart.mjs";
|
9
|
+
import "../Sidebar/Sidebar.mjs";
|
10
|
+
import "@radix-ui/react-aspect-ratio";
|
11
|
+
import "../Avatar/Avatar.mjs";
|
12
|
+
import "../Badge/badgeVariants.mjs";
|
13
|
+
import "../Breadcrumb/Breadcrumb.mjs";
|
14
|
+
import "../Button/Button.mjs";
|
15
|
+
import "../Button/buttonVariants.mjs";
|
16
|
+
import "../ButtonIcon/ButtonIcon.mjs";
|
17
|
+
import "../ButtonIcon/buttonIconVariants.mjs";
|
18
|
+
import "../Calendar/Calendar.mjs";
|
19
|
+
import "../Card/Card.mjs";
|
20
|
+
import "../Carousel/Carousel.mjs";
|
21
|
+
import "../Checkbox/Checkbox.mjs";
|
22
|
+
import "@radix-ui/react-collapsible";
|
23
|
+
import { a as no } from "../Combobox-DpcCpN3b.js";
|
24
|
+
import "../Command/Command.mjs";
|
25
|
+
import "../DropdownMenu/DropdownMenu.mjs";
|
26
|
+
import "../Table/Table.mjs";
|
27
|
+
import "@tanstack/react-table";
|
28
|
+
import "lucide-react";
|
29
|
+
import "../DatePicker/DatePicker.mjs";
|
30
|
+
import "../Dialog/Dialog.mjs";
|
31
|
+
import "../Drawer/Drawer.mjs";
|
32
|
+
import "../Form/Form.mjs";
|
33
|
+
import "../FormInput/FormInput.mjs";
|
34
|
+
import "../Select/SelectRoot.mjs";
|
35
|
+
import "../Textarea/Textarea.mjs";
|
36
|
+
import "../Separator/Separator.mjs";
|
37
|
+
import "../HoverCard/HoverCard.mjs";
|
38
|
+
import "../Input/Input.mjs";
|
39
|
+
import "../InputOTP/InputOTP.mjs";
|
40
|
+
import "../Label/Label.mjs";
|
41
|
+
import "../Label/labelVariants.mjs";
|
42
|
+
import "../LoadingMask/RenderLoadingMask.mjs";
|
43
|
+
import "../LoadingProgress/loadingProgressVariants.mjs";
|
44
|
+
import "../Menubar/Menubar.mjs";
|
45
|
+
import "../NavigationMenu/NavigationMenu.mjs";
|
46
|
+
import "../NavigationMenu/navigationMenuVariants.mjs";
|
47
|
+
import "../Pagination/Pagination.mjs";
|
48
|
+
import "../Popover/Popover.mjs";
|
49
|
+
import "../Progress/Progress.mjs";
|
50
|
+
import "../RadioGroup/RadioGroup.mjs";
|
51
|
+
import "react-resizable-panels";
|
52
|
+
import "../ScrollArea/ScrollArea.mjs";
|
53
|
+
import "@oneplatformdev/hooks";
|
54
|
+
import "../Sheet/Sheet.mjs";
|
55
|
+
import "../Slider/Slider.mjs";
|
56
|
+
import "next-themes";
|
57
|
+
import "sonner";
|
58
|
+
import "../Switch/Switch.mjs";
|
59
|
+
import "../Tabs/TabsRoot.mjs";
|
60
|
+
import "../Toast/Toast.mjs";
|
61
|
+
import "../Toggle/Toggle.mjs";
|
62
|
+
import "../ToggleGroup/ToggleGroup.mjs";
|
63
|
+
import "../Tooltip/TooltipRoot.mjs";
|
64
|
+
import "../Dropzone/Dropzone.mjs";
|
65
|
+
export {
|
66
|
+
no as ComboboxOptionItem
|
67
|
+
};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { IComboboxOptionsNodeProps, IComboboxOptionsProps } from './Combobox.types';
|
2
|
+
|
3
|
+
export declare const ComboboxOptionsNode: import('react').ForwardRefExoticComponent<IComboboxOptionsNodeProps & import('react').RefAttributes<HTMLDivElement>>;
|
4
|
+
export declare const ComboboxOptions: import('react').ForwardRefExoticComponent<IComboboxOptionsProps & import('react').RefAttributes<HTMLDivElement>>;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import "react/jsx-runtime";
|
2
|
+
import "../Button/Button.mjs";
|
3
|
+
import "../Button/buttonVariants.mjs";
|
4
|
+
import "react";
|
5
|
+
import "../Collapsible/Collapsible.mjs";
|
6
|
+
import { c as a, b as e } from "../Combobox-DpcCpN3b.js";
|
7
|
+
import "lucide-react";
|
8
|
+
import "@oneplatformdev/utils";
|
9
|
+
export {
|
10
|
+
a as ComboboxOptions,
|
11
|
+
e as ComboboxOptionsNode
|
12
|
+
};
|
package/Combobox/index.mjs
CHANGED