@oneplatformdev/ui 0.0.1-beta.14 → 0.0.1-beta.141
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 +5 -3
- package/Accordion/Accordion.mjs +27 -24
- package/AlertDialog/AlertDialogRoot.d.ts +2 -2
- package/AlertDialog/AlertDialogRoot.mjs +7 -7
- package/Button/Button.mjs +11 -10
- package/Button/buttonVariants.mjs +14 -8
- package/Calendar/Calendar.mjs +3 -2
- package/Card/Card.d.ts +1 -1
- package/Card/Card.mjs +24 -23
- 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 +36 -1
- package/Combobox/ComboboxOptionItem.d.ts +5 -0
- package/Combobox/ComboboxOptionItem.mjs +69 -0
- package/Combobox/ComboboxOptions.d.ts +4 -0
- package/Combobox/ComboboxOptions.mjs +12 -0
- package/Combobox/index.mjs +1 -1
- package/Combobox-CkGEIfTD.js +325 -0
- package/Command/Command.d.ts +1 -1
- package/Command/Command.mjs +15 -7
- 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 +7 -3
- package/Dialog/Dialog.mjs +95 -52
- package/Dialog/DialogOverlayScope.d.ts +9 -0
- package/Dialog/DialogOverlayScope.mjs +10 -0
- package/Dialog/index.d.ts +1 -0
- package/Dialog/index.mjs +12 -8
- package/DropdownMenu/DropdownMenu.d.ts +2 -2
- package/DropdownMenu/DropdownMenu.mjs +30 -26
- package/Dropzone/Dropzone.d.ts +2 -2
- package/Dropzone/Dropzone.mjs +111 -97
- package/Dropzone/Dropzone.types.d.ts +8 -0
- package/Dropzone/{FilePreview.mjs → DropzoneFilePreview.mjs} +1 -1
- package/Dropzone/DropzoneSinglePickPreview.d.ts +10 -0
- package/Dropzone/DropzoneSinglePickPreview.mjs +44 -0
- package/Dropzone/DropzoneUtils.d.ts +1 -0
- package/Dropzone/DropzoneUtils.mjs +17 -8
- package/Dropzone/index.mjs +1 -1
- 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 +2 -2
- package/FormDropzone/FormDropzone.mjs +8 -16
- package/FormDropzone/FormDropzone.types.d.ts +2 -3
- package/FormInput/FormInput.d.ts +5 -3
- package/FormInput/FormInput.mjs +37 -16
- 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 +50 -38
- package/Input/Input.types.d.ts +6 -2
- 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/LoadedIcon/LoadedIcon.d.ts +11 -0
- package/LoadedIcon/LoadedIcon.mjs +27 -0
- package/LoadedIcon/index.d.ts +1 -0
- package/LoadedIcon/index.mjs +4 -0
- package/LoadedIcon/package.json +7 -0
- 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/Popover/Popover.d.ts +3 -3
- package/Popover/Popover.mjs +30 -21
- 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/Search/Search.d.ts +1 -2
- package/Search/Search.mjs +36 -21
- package/Search/Search.types.d.ts +1 -0
- package/Select/Select.mjs +94 -63
- package/Select/Select.types.d.ts +11 -3
- package/Select/SelectRoot.d.ts +2 -2
- package/Select/SelectRoot.mjs +29 -24
- package/Sheet/Sheet.d.ts +5 -2
- package/Sheet/Sheet.mjs +33 -33
- 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 +72 -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 +2 -0
- package/index.mjs +305 -292
- package/package.json +6 -6
- package/tailwind.config.mjs +13 -13
- /package/Dropzone/{FilePreview.d.ts → DropzoneFilePreview.d.ts} +0 -0
- /package/{FilePreview-Dhtv8F4u.js → DropzoneFilePreview-Dhtv8F4u.js} +0 -0
package/Accordion/Accordion.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
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
|
-
declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> &
|
|
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 };
|
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
|
-
import { ChevronDown as
|
|
5
|
-
import { cn as
|
|
6
|
-
const
|
|
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:
|
|
11
|
-
...
|
|
10
|
+
className: c("border-b", t),
|
|
11
|
+
...o
|
|
12
12
|
}
|
|
13
13
|
));
|
|
14
|
-
|
|
15
|
-
const
|
|
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:
|
|
19
|
-
className:
|
|
20
|
-
"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all
|
|
21
|
-
|
|
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
|
-
|
|
23
|
+
onKeyDown: (n) => {
|
|
24
|
+
n.key === " " && n.target === n.currentTarget && n.preventDefault();
|
|
25
|
+
},
|
|
26
|
+
...i,
|
|
24
27
|
children: [
|
|
25
|
-
|
|
26
|
-
/* @__PURE__ */ a(
|
|
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
|
-
|
|
31
|
-
const
|
|
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:
|
|
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
|
+
N.displayName = e.Content.displayName;
|
|
41
44
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
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
|
};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { cva as e } from "class-variance-authority";
|
|
2
|
-
const
|
|
3
|
-
|
|
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:
|
|
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
|
|
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: "
|
|
29
|
+
size: "lg"
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
32
|
);
|
|
27
33
|
export {
|
|
28
|
-
|
|
34
|
+
r as buttonVariants
|
|
29
35
|
};
|
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/Card/Card.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from
|
|
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:
|
|
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
|
-
"
|
|
10
|
-
|
|
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
|
-
...
|
|
13
|
+
...a
|
|
13
14
|
}
|
|
14
15
|
));
|
|
15
16
|
s.displayName = "Card";
|
|
16
|
-
const i = o.forwardRef(({ className:
|
|
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",
|
|
21
|
-
...
|
|
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
|
|
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",
|
|
30
|
-
...
|
|
30
|
+
className: t("font-semibold leading-none tracking-tight", e),
|
|
31
|
+
...a
|
|
31
32
|
}
|
|
32
33
|
));
|
|
33
|
-
|
|
34
|
-
const
|
|
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",
|
|
39
|
-
...
|
|
39
|
+
className: t("text-sm text-muted-foreground", e),
|
|
40
|
+
...a
|
|
40
41
|
}
|
|
41
42
|
));
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
const f = o.forwardRef(({ className:
|
|
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",
|
|
50
|
-
...
|
|
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
|
-
|
|
57
|
-
|
|
57
|
+
c as CardContent,
|
|
58
|
+
n as CardDescription,
|
|
58
59
|
f as CardFooter,
|
|
59
60
|
i as CardHeader,
|
|
60
|
-
|
|
61
|
+
l as CardTitle
|
|
61
62
|
};
|
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-CkGEIfTD.js";
|
|
124
13
|
export {
|
|
125
|
-
|
|
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
|
-
/**
|
|
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
|
}
|