@oneplatformdev/ui 0.0.1-beta.7 → 0.0.1-beta.71
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/buttonVariants.mjs +4 -4
- 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 +2 -1
- package/Checkbox/index.mjs +3 -2
- package/Combobox/Combobox.d.ts +2 -2
- package/Combobox/Combobox.mjs +127 -87
- package/Combobox/Combobox.types.d.ts +13 -1
- package/Command/Command.d.ts +1 -1
- 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 +14 -12
- 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.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 +2 -3
- package/FormInput/FormInput.mjs +25 -17
- 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,
|
@@ -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",
|
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
18
|
icon: "h-9 w-9"
|
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
@@ -1 +1,2 @@
|
|
1
|
-
export * from './Checkbox';
|
1
|
+
export * from './Checkbox.tsx';
|
2
|
+
export type * from './Checkbox.types.ts';
|
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,166 @@
|
|
1
|
-
import { jsx as a, jsxs as
|
2
|
-
import
|
3
|
-
import { LoadingMask as
|
4
|
-
import
|
5
|
-
import {
|
1
|
+
import { jsx as a, jsxs as r, Fragment as G } from "react/jsx-runtime";
|
2
|
+
import s, { forwardRef as I, useRef as U, useEffect as q, useCallback as c, useLayoutEffect as A } from "react";
|
3
|
+
import { LoadingMask as V } from "../LoadingMask/LoadingMask.mjs";
|
4
|
+
import "../LoadingMask/RenderLoadingMask.mjs";
|
5
|
+
import { Popover as X, PopoverTrigger as H, PopoverContent as J } from "../Popover/Popover.mjs";
|
6
|
+
import { Button as K } from "../Button/Button.mjs";
|
6
7
|
import "../Button/buttonVariants.mjs";
|
7
|
-
import { Command as
|
8
|
-
import { cn as
|
9
|
-
import { useDebounceCallback as
|
10
|
-
import { X as
|
11
|
-
const
|
12
|
-
var
|
8
|
+
import { Command as Q, CommandInput as W, CommandList as Y, CommandGroup as Z, CommandEmpty as j, CommandItem as $ } from "../Command/Command.mjs";
|
9
|
+
import { cn as h } from "@oneplatformdev/utils";
|
10
|
+
import { useDebounceCallback as ee } from "@oneplatformdev/hooks";
|
11
|
+
import { X as ae, ChevronsUpDown as te, Check as re } from "lucide-react";
|
12
|
+
const fe = I((k, O) => {
|
13
|
+
var L;
|
13
14
|
const {
|
14
15
|
value: o,
|
15
|
-
onChange:
|
16
|
-
placeholder:
|
17
|
-
disabled:
|
18
|
-
searchLabel:
|
19
|
-
fetchOptions:
|
20
|
-
options:
|
21
|
-
emptyLabel:
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
16
|
+
onChange: P,
|
17
|
+
placeholder: D,
|
18
|
+
disabled: T,
|
19
|
+
searchLabel: B = "Type to search...",
|
20
|
+
fetchOptions: E,
|
21
|
+
options: n,
|
22
|
+
emptyLabel: C = "No options",
|
23
|
+
emptyAction: i,
|
24
|
+
onMount: x
|
25
|
+
} = k, f = U(!1), [t, d] = s.useState(!1), [m, w] = s.useState(""), [p, u] = s.useState([]), [b, N] = s.useState(), [g, l] = s.useState(!1);
|
26
|
+
q(() => {
|
27
|
+
n != null && n.length && u(n);
|
28
|
+
}, [n]);
|
29
|
+
const M = async () => {
|
30
|
+
t || (S(), w(""));
|
31
|
+
}, S = c(async (e) => {
|
32
|
+
l(!0);
|
30
33
|
try {
|
31
|
-
const
|
32
|
-
|
33
|
-
} catch (
|
34
|
-
console.error("Unexpected error while get option:",
|
34
|
+
const y = await E(e);
|
35
|
+
u(y);
|
36
|
+
} catch (y) {
|
37
|
+
console.error("Unexpected error while get option:", y);
|
35
38
|
} finally {
|
36
|
-
|
39
|
+
l(!1);
|
37
40
|
}
|
38
|
-
},
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
41
|
+
}, []), R = ee(S, 1e3, {
|
42
|
+
leading: !1,
|
43
|
+
trailing: !0
|
44
|
+
}), _ = c((e) => {
|
45
|
+
l(!0), w(e), R(e);
|
46
|
+
}, []), v = c((e) => {
|
47
|
+
P(e.value), N(e), l(!1);
|
48
|
+
}, []), z = c(() => {
|
49
|
+
v({ value: "", label: "" }), N(void 0), l(!1);
|
50
|
+
}, []), F = c(() => {
|
51
|
+
if (!x) {
|
52
|
+
f.current = !0;
|
53
|
+
return;
|
54
|
+
}
|
55
|
+
x({ setOptions: u, search: m || "", open: t, setOpen: d }).finally(
|
56
|
+
() => {
|
57
|
+
f.current = !0;
|
58
|
+
}
|
59
|
+
);
|
60
|
+
}, []);
|
61
|
+
return A(() => (F(), () => {
|
62
|
+
f.current = !1;
|
63
|
+
}), []), /* @__PURE__ */ a("div", { className: "w-full", ref: O, children: /* @__PURE__ */ r(
|
64
|
+
X,
|
47
65
|
{
|
48
|
-
open:
|
66
|
+
open: t,
|
49
67
|
onOpenChange: (e) => {
|
50
|
-
d(e), e &&
|
68
|
+
d(e), e && M();
|
51
69
|
},
|
52
70
|
children: [
|
53
|
-
/* @__PURE__ */ a(
|
54
|
-
|
71
|
+
/* @__PURE__ */ a(H, { asChild: !0, className: "border-input", children: /* @__PURE__ */ r(
|
72
|
+
K,
|
55
73
|
{
|
56
74
|
variant: "outline",
|
57
75
|
role: "combobox",
|
58
|
-
"
|
59
|
-
|
60
|
-
|
61
|
-
|
76
|
+
size: "lg",
|
77
|
+
"aria-expanded": t,
|
78
|
+
className: h(
|
79
|
+
"w-full justify-between font-normal text-sm border bg-transparent relative p-3",
|
80
|
+
t ? "border-2 border-sidebar-accent" : "border-border"
|
62
81
|
),
|
63
|
-
disabled:
|
82
|
+
disabled: T,
|
64
83
|
children: [
|
65
|
-
/* @__PURE__ */ a("span", { className: "truncate max-w-[calc(100%-1.5rem)] overflow-hidden whitespace-nowrap", children: o ? ((
|
84
|
+
/* @__PURE__ */ a("span", { className: "truncate max-w-[calc(100%-1.5rem)] overflow-hidden whitespace-nowrap", children: o ? ((L = p.find((e) => e.value === o)) == null ? void 0 : L.label) || (b == null ? void 0 : b.label) : /* @__PURE__ */ a("span", { className: "text-gray-400", children: D }) }),
|
66
85
|
o ? /* @__PURE__ */ a(
|
67
|
-
|
86
|
+
"div",
|
68
87
|
{
|
69
|
-
className:
|
88
|
+
className: h(
|
89
|
+
"absolute top-0 right-1",
|
90
|
+
"flex items-center justify-center",
|
91
|
+
"w-9 aspect-square [&_svg]:size-5",
|
92
|
+
"opacity-50 cursor-pointer hover:opacity-100"
|
93
|
+
),
|
70
94
|
onClick: (e) => {
|
71
|
-
e.stopPropagation(),
|
72
|
-
}
|
95
|
+
e.stopPropagation(), z();
|
96
|
+
},
|
97
|
+
children: /* @__PURE__ */ a(ae, {})
|
73
98
|
}
|
74
|
-
) : /* @__PURE__ */ a(
|
99
|
+
) : /* @__PURE__ */ a(te, { className: "opacity-50 w-4 h-4" })
|
75
100
|
]
|
76
101
|
}
|
77
102
|
) }),
|
78
103
|
/* @__PURE__ */ a(
|
79
|
-
|
104
|
+
J,
|
80
105
|
{
|
81
106
|
className: "w-[var(--radix-popper-anchor-width)] max-w-none p-0",
|
82
107
|
align: "start",
|
83
|
-
children: /* @__PURE__ */
|
108
|
+
children: /* @__PURE__ */ r(Q, { shouldFilter: !1, children: [
|
84
109
|
/* @__PURE__ */ a(
|
85
|
-
|
110
|
+
W,
|
86
111
|
{
|
87
|
-
placeholder:
|
88
|
-
value:
|
89
|
-
onValueChange:
|
112
|
+
placeholder: B,
|
113
|
+
value: m,
|
114
|
+
onValueChange: _
|
90
115
|
}
|
91
116
|
),
|
92
|
-
/* @__PURE__ */
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
117
|
+
/* @__PURE__ */ a(Y, { children: /* @__PURE__ */ r(
|
118
|
+
Z,
|
119
|
+
{
|
120
|
+
className: h(!p.length && "p-0 shadow-none"),
|
121
|
+
children: [
|
122
|
+
g && /* @__PURE__ */ a("div", { className: "flex justify-center", children: /* @__PURE__ */ a(V, {}) }),
|
123
|
+
!g && !!m && /* @__PURE__ */ a(G, { children: i ? /* @__PURE__ */ r(j, { className: "flex flex-col gap-3 py-5 px-3 items-center", children: [
|
124
|
+
/* @__PURE__ */ a("span", { children: C }),
|
125
|
+
typeof i == "function" ? i({
|
126
|
+
setOptions: u,
|
127
|
+
search: m || "",
|
128
|
+
open: t,
|
129
|
+
setOpen: d
|
130
|
+
}) : i
|
131
|
+
] }) : /* @__PURE__ */ a(j, { children: C }) }),
|
132
|
+
!g && !!p.length && p.map((e) => /* @__PURE__ */ r(
|
133
|
+
$,
|
134
|
+
{
|
135
|
+
value: e.value,
|
136
|
+
onSelect: () => {
|
137
|
+
o === e.value ? v({ value: "", label: "" }) : v(e), d(!1);
|
138
|
+
},
|
139
|
+
children: [
|
140
|
+
e.label,
|
141
|
+
/* @__PURE__ */ a(
|
142
|
+
re,
|
143
|
+
{
|
144
|
+
className: h(
|
145
|
+
"ml-auto",
|
146
|
+
o === e.value ? "opacity-100" : "opacity-0"
|
147
|
+
)
|
148
|
+
}
|
109
149
|
)
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
150
|
+
]
|
151
|
+
},
|
152
|
+
e.value
|
153
|
+
))
|
154
|
+
]
|
155
|
+
}
|
156
|
+
) })
|
117
157
|
] })
|
118
158
|
}
|
119
159
|
)
|
120
160
|
]
|
121
161
|
}
|
122
162
|
) });
|
123
|
-
};
|
163
|
+
});
|
124
164
|
export {
|
125
|
-
|
165
|
+
fe as Combobox
|
126
166
|
};
|
@@ -1,7 +1,15 @@
|
|
1
|
+
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
2
|
+
|
1
3
|
export interface ComboboxOption {
|
2
4
|
value: string;
|
3
5
|
label: string;
|
4
6
|
}
|
7
|
+
export interface ComboboxPropsOnMountParams {
|
8
|
+
setOptions: Dispatch<SetStateAction<ComboboxOption[]>>;
|
9
|
+
search: string;
|
10
|
+
open: boolean;
|
11
|
+
setOpen: Dispatch<SetStateAction<boolean>>;
|
12
|
+
}
|
5
13
|
export interface ComboboxProps {
|
6
14
|
value: string;
|
7
15
|
onChange: (value: string) => void;
|
@@ -10,6 +18,10 @@ export interface ComboboxProps {
|
|
10
18
|
disabled?: boolean;
|
11
19
|
fetchOptions: (search?: string) => Promise<ComboboxOption[]>;
|
12
20
|
options?: ComboboxOption[];
|
13
|
-
/**
|
21
|
+
/** Command Empty list label*/
|
14
22
|
emptyLabel?: string;
|
23
|
+
/** Command Empty list action */
|
24
|
+
emptyAction?: ((params: ComboboxPropsOnMountParams) => ReactNode) | ReactNode;
|
25
|
+
/** Callback for load data on start component */
|
26
|
+
onMount?: (params: ComboboxPropsOnMountParams) => Promise<void>;
|
15
27
|
}
|
package/Command/Command.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { DialogProps } from '@radix-ui/react-dialog';
|
2
|
-
import * as React from
|
2
|
+
import * as React from 'react';
|
3
3
|
declare const Command: React.ForwardRefExoticComponent<Omit<{
|
4
4
|
children?: React.ReactNode;
|
5
5
|
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
package/DataTable/DataTable.d.ts
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import { default as React, FC } from 'react';
|
2
|
+
import { Table as ReactTable } from '@tanstack/react-table';
|
3
3
|
|
4
|
-
|
4
|
+
interface IProps {
|
5
|
+
table: ReactTable<any>;
|
6
|
+
ToolBar?: React.ReactNode;
|
7
|
+
tColumns?: string;
|
8
|
+
tNoResults?: string;
|
9
|
+
}
|
10
|
+
export declare const DataTable: FC<IProps>;
|
11
|
+
export {};
|