@oneplatformdev/ui 0.0.1-beta.13 → 0.0.1-beta.130
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 +109 -65
- 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 +3 -3
- package/Dropzone/Dropzone.mjs +136 -104
- package/Dropzone/Dropzone.types.d.ts +16 -9
- 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 +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 +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 +2 -2
- 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 +3 -0
- package/index.mjs +305 -290
- 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
|
@@ -1,31 +1,49 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "@radix-ui/react-radio-group";
|
|
3
|
+
import { Circle as c } from "lucide-react";
|
|
2
4
|
import * as s from "react";
|
|
3
|
-
import * as r from "@radix-ui/react-radio-group";
|
|
4
|
-
import { Circle as m } from "lucide-react";
|
|
5
5
|
import { cn as t } from "@oneplatformdev/utils";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { Label as p } from "../Label/Label.mjs";
|
|
7
|
+
const f = s.forwardRef(({ className: r, ...a }, o) => /* @__PURE__ */ e(
|
|
8
|
+
i.Root,
|
|
8
9
|
{
|
|
9
|
-
className: t("grid gap-
|
|
10
|
-
...
|
|
11
|
-
ref:
|
|
10
|
+
className: t("grid gap-0", r),
|
|
11
|
+
...a,
|
|
12
|
+
ref: o
|
|
12
13
|
}
|
|
13
14
|
));
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
f.displayName = i.Root.displayName;
|
|
16
|
+
const m = s.forwardRef(({ className: r, ...a }, o) => /* @__PURE__ */ e(
|
|
17
|
+
i.Item,
|
|
17
18
|
{
|
|
18
|
-
ref:
|
|
19
|
+
ref: o,
|
|
19
20
|
className: t(
|
|
20
|
-
"aspect-square
|
|
21
|
-
|
|
21
|
+
"aspect-square size-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
22
|
+
r
|
|
22
23
|
),
|
|
23
|
-
...
|
|
24
|
-
children: /* @__PURE__ */ e(
|
|
24
|
+
...a,
|
|
25
|
+
children: /* @__PURE__ */ e(i.Indicator, { className: "flex items-center justify-center ", children: /* @__PURE__ */ e(c, { className: "size-2.5 fill-primary" }) })
|
|
25
26
|
}
|
|
26
27
|
));
|
|
27
|
-
|
|
28
|
+
m.displayName = i.Item.displayName;
|
|
29
|
+
const n = s.forwardRef(({ value: r, label: a, children: o }, d) => /* @__PURE__ */ l(
|
|
30
|
+
p,
|
|
31
|
+
{
|
|
32
|
+
ref: d,
|
|
33
|
+
htmlFor: r,
|
|
34
|
+
className: "flex w-full items-start gap-3 font-normal py-3 cursor-pointer",
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ e(m, { value: r, id: r }),
|
|
37
|
+
/* @__PURE__ */ l("div", { className: "flex flex-col w-full gap-3", children: [
|
|
38
|
+
/* @__PURE__ */ e("span", { className: "flex flex-col justify-start leading-[16px]", children: a }),
|
|
39
|
+
o
|
|
40
|
+
] })
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
));
|
|
44
|
+
n.displayName = "RadioGroupLabel";
|
|
28
45
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
46
|
+
f as RadioGroup,
|
|
47
|
+
m as RadioGroupItem,
|
|
48
|
+
n as RadioGroupLabel
|
|
31
49
|
};
|
package/RadioGroup/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { RadioGroup as
|
|
1
|
+
import { RadioGroup as a, RadioGroupItem as p, RadioGroupLabel as d } from "./RadioGroup.mjs";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
a as RadioGroup,
|
|
4
|
+
p as RadioGroupItem,
|
|
5
|
+
d as RadioGroupLabel
|
|
5
6
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
4
|
declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export { ScrollArea, ScrollBar };
|
|
@@ -1,38 +1,51 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as s from "react";
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
3
2
|
import * as r from "@radix-ui/react-scroll-area";
|
|
4
|
-
import
|
|
5
|
-
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { cn as s } from "@oneplatformdev/utils";
|
|
5
|
+
const m = t.forwardRef(({ className: o, children: l, ...a }, c) => /* @__PURE__ */ i(
|
|
6
6
|
r.Root,
|
|
7
7
|
{
|
|
8
8
|
ref: c,
|
|
9
|
-
className:
|
|
9
|
+
className: s(
|
|
10
|
+
"relative overflow-hidden pr-2",
|
|
11
|
+
// '[&:has([data-orientation=vertical])]:pr-2',
|
|
12
|
+
o
|
|
13
|
+
),
|
|
10
14
|
...a,
|
|
11
15
|
children: [
|
|
12
16
|
/* @__PURE__ */ e(r.Viewport, { className: "h-full w-full rounded-[inherit]", children: l }),
|
|
13
|
-
/* @__PURE__ */ e(
|
|
17
|
+
/* @__PURE__ */ e(d, {}),
|
|
14
18
|
/* @__PURE__ */ e(r.Corner, {})
|
|
15
19
|
]
|
|
16
20
|
}
|
|
17
21
|
));
|
|
18
22
|
m.displayName = r.Root.displayName;
|
|
19
|
-
const
|
|
23
|
+
const d = t.forwardRef(({ className: o, orientation: l = "vertical", ...a }, c) => /* @__PURE__ */ e(
|
|
20
24
|
r.ScrollAreaScrollbar,
|
|
21
25
|
{
|
|
22
26
|
ref: c,
|
|
23
27
|
orientation: l,
|
|
24
|
-
className:
|
|
28
|
+
className: s(
|
|
25
29
|
"flex touch-none select-none transition-colors",
|
|
26
|
-
|
|
27
|
-
l === "
|
|
30
|
+
"p-[1px] bg-[#DCDDE1] rounded-full",
|
|
31
|
+
l === "vertical" && "h-full w-1.5 border-l border-l-transparent",
|
|
32
|
+
l === "horizontal" && "h-1.5 flex-col border-t border-t-transparent",
|
|
28
33
|
o
|
|
29
34
|
),
|
|
30
35
|
...a,
|
|
31
|
-
children: /* @__PURE__ */ e(
|
|
36
|
+
children: /* @__PURE__ */ e(
|
|
37
|
+
r.ScrollAreaThumb,
|
|
38
|
+
{
|
|
39
|
+
className: s(
|
|
40
|
+
"relative flex-1 rounded-full bg-border",
|
|
41
|
+
"bg-[#FCFCFC]"
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
)
|
|
32
45
|
}
|
|
33
46
|
));
|
|
34
|
-
|
|
47
|
+
d.displayName = r.ScrollAreaScrollbar.displayName;
|
|
35
48
|
export {
|
|
36
49
|
m as ScrollArea,
|
|
37
|
-
|
|
50
|
+
d as ScrollBar
|
|
38
51
|
};
|
package/Search/Search.d.ts
CHANGED
package/Search/Search.mjs
CHANGED
|
@@ -1,30 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Input as
|
|
4
|
-
import { useDebounceCallback as
|
|
5
|
-
import { cn as
|
|
6
|
-
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g } from "react";
|
|
3
|
+
import { Input as v } from "../Input/Input.mjs";
|
|
4
|
+
import { useDebounceCallback as b } from "@oneplatformdev/hooks";
|
|
5
|
+
import { cn as x } from "@oneplatformdev/utils";
|
|
6
|
+
import { SearchIcon as I } from "lucide-react";
|
|
7
|
+
import { LoadedIcon as C } from "../LoadedIcon/LoadedIcon.mjs";
|
|
8
|
+
const L = (a) => {
|
|
7
9
|
const {
|
|
8
|
-
search:
|
|
9
|
-
onChange:
|
|
10
|
-
onSearch:
|
|
10
|
+
search: c,
|
|
11
|
+
onChange: r,
|
|
12
|
+
onSearch: n,
|
|
11
13
|
placeholder: s = "Search",
|
|
12
|
-
className:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
l
|
|
14
|
+
className: m,
|
|
15
|
+
loading: i = !1,
|
|
16
|
+
slotProps: e,
|
|
17
|
+
name: p = "search",
|
|
18
|
+
...l
|
|
19
|
+
} = a, [h, u] = g(c), f = b(n, 1e3), d = (o) => {
|
|
20
|
+
const S = o.target.value;
|
|
21
|
+
u(S), r == null || r(o), f(o.target.value);
|
|
17
22
|
};
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
|
|
23
|
+
return /* @__PURE__ */ t(
|
|
24
|
+
v,
|
|
20
25
|
{
|
|
26
|
+
name: p,
|
|
21
27
|
placeholder: s,
|
|
22
|
-
value:
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
value: h,
|
|
29
|
+
className: x("min-w-[340px]", m),
|
|
30
|
+
onChange: d,
|
|
31
|
+
...l,
|
|
32
|
+
...e || {},
|
|
33
|
+
slotProps: {
|
|
34
|
+
...e || {},
|
|
35
|
+
input: {
|
|
36
|
+
startAdornment: /* @__PURE__ */ t(C, { loading: i, size: "sm", children: /* @__PURE__ */ t(I, {}) }),
|
|
37
|
+
...(e == null ? void 0 : e.input) || {}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
25
40
|
}
|
|
26
|
-
)
|
|
41
|
+
);
|
|
27
42
|
};
|
|
28
43
|
export {
|
|
29
|
-
|
|
44
|
+
L as Search
|
|
30
45
|
};
|
package/Search/Search.types.d.ts
CHANGED
package/Select/Select.mjs
CHANGED
|
@@ -1,72 +1,103 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs as u, jsx as i, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as f, isValidElement as S } from "react";
|
|
3
|
+
import { Button as y } from "../Button/Button.mjs";
|
|
3
4
|
import "../Button/buttonVariants.mjs";
|
|
4
|
-
import { SelectRoot as
|
|
5
|
-
import { isValidReactElement as
|
|
6
|
-
const
|
|
7
|
-
const { placeholder:
|
|
8
|
-
return e && typeof e == "function" &&
|
|
9
|
-
},
|
|
10
|
-
const {
|
|
11
|
-
return
|
|
12
|
-
e,
|
|
13
|
-
n,
|
|
14
|
-
l,
|
|
15
|
-
{ ...c, options: l },
|
|
16
|
-
r
|
|
17
|
-
)) ? i(t(
|
|
18
|
-
e,
|
|
19
|
-
n,
|
|
20
|
-
l,
|
|
21
|
-
{ ...c, options: l },
|
|
22
|
-
r
|
|
23
|
-
), u) ? i(t(
|
|
24
|
-
e,
|
|
25
|
-
n,
|
|
26
|
-
l,
|
|
27
|
-
{ ...c, options: l },
|
|
28
|
-
r
|
|
29
|
-
)) : /* @__PURE__ */ a(u, { value: e.value, children: t(
|
|
30
|
-
e,
|
|
31
|
-
n,
|
|
32
|
-
l,
|
|
33
|
-
{ ...c, options: l },
|
|
34
|
-
r
|
|
35
|
-
) }, e.value) : r;
|
|
36
|
-
}, T = (o) => {
|
|
37
|
-
const {
|
|
38
|
-
value: t,
|
|
39
|
-
options: e,
|
|
40
|
-
onChange: n,
|
|
41
|
-
nullable: l = !1,
|
|
42
|
-
clearLabel: c = "Clear",
|
|
43
|
-
disabled: r
|
|
44
|
-
} = o;
|
|
45
|
-
return /* @__PURE__ */ d(
|
|
5
|
+
import { SelectRoot as b, SelectContent as R, SelectTrigger as C, SelectValue as V, SelectItem as p } from "./SelectRoot.mjs";
|
|
6
|
+
import { isValidReactElement as k } from "@oneplatformdev/utils";
|
|
7
|
+
const B = (t) => {
|
|
8
|
+
const { placeholder: n, renderTrigger: e, slotProps: l } = t, r = /* @__PURE__ */ i(C, { ...(l == null ? void 0 : l.triggerProps) || {}, children: /* @__PURE__ */ i(V, { placeholder: n }) });
|
|
9
|
+
return e && typeof e == "function" && k(e(t, r)) ? e(t, r) : r;
|
|
10
|
+
}, d = (t) => {
|
|
11
|
+
const { children: n, option: e, deep: l = 0 } = t;
|
|
12
|
+
return /* @__PURE__ */ u(
|
|
46
13
|
p,
|
|
47
14
|
{
|
|
48
|
-
value:
|
|
49
|
-
|
|
50
|
-
|
|
15
|
+
value: e.value,
|
|
16
|
+
disabled: e.disabled,
|
|
17
|
+
className: "cursor-pointer",
|
|
18
|
+
style: { paddingLeft: `calc(8px + ${(l || 0) * 8}px)` },
|
|
51
19
|
children: [
|
|
52
|
-
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
l && /* @__PURE__ */ a(f, { className: "w-full px-2", variant: "secondary", size: "sm", onClick: () => {
|
|
55
|
-
n("");
|
|
56
|
-
}, children: c }),
|
|
57
|
-
e.map((s, m) => /* @__PURE__ */ a(
|
|
58
|
-
C,
|
|
59
|
-
{
|
|
60
|
-
...o,
|
|
61
|
-
option: s,
|
|
62
|
-
index: m
|
|
63
|
-
}
|
|
64
|
-
))
|
|
65
|
-
] })
|
|
20
|
+
!n && e.label,
|
|
21
|
+
n && /* @__PURE__ */ i(x, { children: typeof n == "function" ? n({ ...t }) : n })
|
|
66
22
|
]
|
|
67
|
-
}
|
|
23
|
+
},
|
|
24
|
+
e.value
|
|
68
25
|
);
|
|
26
|
+
}, g = (t) => {
|
|
27
|
+
var a, o;
|
|
28
|
+
const { renderOption: n, option: e, index: l, options: r, deep: m = 0, ...c } = t;
|
|
29
|
+
return n && typeof n == "function" && S(
|
|
30
|
+
n(
|
|
31
|
+
e,
|
|
32
|
+
l,
|
|
33
|
+
r,
|
|
34
|
+
{ ...c, options: r },
|
|
35
|
+
/* @__PURE__ */ i(d, { ...t })
|
|
36
|
+
)
|
|
37
|
+
) ? /* @__PURE__ */ i(p, { value: e.value, children: n(
|
|
38
|
+
e,
|
|
39
|
+
l,
|
|
40
|
+
r,
|
|
41
|
+
{ ...c, options: r },
|
|
42
|
+
/* @__PURE__ */ i(d, { ...t })
|
|
43
|
+
) }, e.value) : (a = e.children) != null && a.length ? /* @__PURE__ */ u(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
className: "flex flex-col gap-1 truncate line-clamp-2",
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ i(d, { ...t }),
|
|
49
|
+
(o = e.children) == null ? void 0 : o.map((s, h, v) => /* @__PURE__ */ f(
|
|
50
|
+
g,
|
|
51
|
+
{
|
|
52
|
+
...t,
|
|
53
|
+
key: s.value,
|
|
54
|
+
option: s,
|
|
55
|
+
options: v,
|
|
56
|
+
index: h,
|
|
57
|
+
deep: (m || 0) + 1
|
|
58
|
+
}
|
|
59
|
+
))
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
e.value
|
|
63
|
+
) : /* @__PURE__ */ i(d, { ...t });
|
|
64
|
+
}, w = (t) => {
|
|
65
|
+
const {
|
|
66
|
+
value: n,
|
|
67
|
+
options: e,
|
|
68
|
+
onChange: l,
|
|
69
|
+
nullable: r = !1,
|
|
70
|
+
clearLabel: m = "Clear",
|
|
71
|
+
disabled: c
|
|
72
|
+
} = t;
|
|
73
|
+
return /* @__PURE__ */ u(b, { value: n, onValueChange: l, disabled: c, children: [
|
|
74
|
+
/* @__PURE__ */ i(B, { ...t }),
|
|
75
|
+
/* @__PURE__ */ u(R, { children: [
|
|
76
|
+
r && /* @__PURE__ */ i(
|
|
77
|
+
y,
|
|
78
|
+
{
|
|
79
|
+
className: "w-full px-2",
|
|
80
|
+
variant: "secondary",
|
|
81
|
+
size: "sm",
|
|
82
|
+
onClick: () => {
|
|
83
|
+
l == null || l("");
|
|
84
|
+
},
|
|
85
|
+
children: m
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
e.map((a, o) => /* @__PURE__ */ f(
|
|
89
|
+
g,
|
|
90
|
+
{
|
|
91
|
+
...t,
|
|
92
|
+
key: a.value,
|
|
93
|
+
option: a,
|
|
94
|
+
index: o,
|
|
95
|
+
deep: 0
|
|
96
|
+
}
|
|
97
|
+
))
|
|
98
|
+
] })
|
|
99
|
+
] });
|
|
69
100
|
};
|
|
70
101
|
export {
|
|
71
|
-
|
|
102
|
+
w as Select
|
|
72
103
|
};
|
package/Select/Select.types.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
4
|
+
export interface SelectOption<ExtendOptionData = unknown> {
|
|
4
5
|
value: string;
|
|
5
6
|
label?: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
6
8
|
data?: ExtendOptionData;
|
|
9
|
+
children?: SelectOption<ExtendOptionData>[];
|
|
7
10
|
}
|
|
8
11
|
export type SelectRenderTrigger<ExtendOptionData> = (props: Omit<SelectProps<ExtendOptionData>, 'renderTrigger'>, defaultComponent: ReactNode) => ReactNode;
|
|
9
12
|
export type SelectRenderOption<ExtendOptionData> = (option: SelectOption<ExtendOptionData>, index: number, options: SelectOption<ExtendOptionData>[], props: Omit<SelectProps<ExtendOptionData>, 'renderOption'>, defaultComponent: ReactNode) => ReactNode;
|
|
@@ -15,7 +18,7 @@ export interface SelectProps<ExtendOptionData> {
|
|
|
15
18
|
/** Select placeholder string. */
|
|
16
19
|
placeholder?: string;
|
|
17
20
|
/** Select Root onValueChange handler. */
|
|
18
|
-
onChange
|
|
21
|
+
onChange?: (value: SelectOption<ExtendOptionData>['value']) => void;
|
|
19
22
|
/** Show reset select item button. */
|
|
20
23
|
disabled?: boolean;
|
|
21
24
|
/** Show reset select item button. */
|
|
@@ -26,4 +29,9 @@ export interface SelectProps<ExtendOptionData> {
|
|
|
26
29
|
renderTrigger?: SelectRenderTrigger<ExtendOptionData>;
|
|
27
30
|
/** Render custom option. */
|
|
28
31
|
renderOption?: SelectRenderOption<ExtendOptionData>;
|
|
32
|
+
/** Select Slot props */
|
|
33
|
+
slotProps?: {
|
|
34
|
+
/** Select Default Trigger Props */
|
|
35
|
+
triggerProps?: ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>;
|
|
36
|
+
};
|
|
29
37
|
}
|
package/Select/SelectRoot.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as SelectPrimitive from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
3
3
|
declare const SelectRoot: React.FC<SelectPrimitive.SelectProps>;
|
|
4
4
|
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
package/Select/SelectRoot.mjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as l from "react";
|
|
3
3
|
import * as e from "@radix-ui/react-select";
|
|
4
|
-
import { ChevronDown as i, ChevronUp as
|
|
4
|
+
import { ChevronDown as i, ChevronUp as u, Check as h } from "lucide-react";
|
|
5
5
|
import { cn as s } from "@oneplatformdev/utils";
|
|
6
|
-
const
|
|
6
|
+
const R = e.Root, C = e.Group, I = e.Value, w = l.forwardRef(({ className: o, children: r, ...a }, d) => /* @__PURE__ */ n(
|
|
7
7
|
e.Trigger,
|
|
8
8
|
{
|
|
9
9
|
ref: d,
|
|
10
10
|
className: s(
|
|
11
|
-
"flex h-
|
|
11
|
+
"flex h-10 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
12
|
+
"[&>svg]:disabled:hidden",
|
|
12
13
|
o
|
|
13
14
|
),
|
|
14
15
|
...a,
|
|
@@ -18,7 +19,7 @@ const v = e.Root, R = e.Group, C = e.Value, h = l.forwardRef(({ className: o, ch
|
|
|
18
19
|
]
|
|
19
20
|
}
|
|
20
21
|
));
|
|
21
|
-
|
|
22
|
+
w.displayName = e.Trigger.displayName;
|
|
22
23
|
const c = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
|
23
24
|
e.ScrollUpButton,
|
|
24
25
|
{
|
|
@@ -28,7 +29,7 @@ const c = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
|
|
28
29
|
o
|
|
29
30
|
),
|
|
30
31
|
...r,
|
|
31
|
-
children: /* @__PURE__ */ t(
|
|
32
|
+
children: /* @__PURE__ */ t(u, { className: "h-4 w-4" })
|
|
32
33
|
}
|
|
33
34
|
));
|
|
34
35
|
c.displayName = e.ScrollUpButton.displayName;
|
|
@@ -45,17 +46,21 @@ const m = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
|
|
45
46
|
}
|
|
46
47
|
));
|
|
47
48
|
m.displayName = e.ScrollDownButton.displayName;
|
|
48
|
-
const
|
|
49
|
+
const y = l.forwardRef(({ className: o, children: r, position: a = "popper", style: d, ...p }, f) => /* @__PURE__ */ t(e.Portal, { children: /* @__PURE__ */ n(
|
|
49
50
|
e.Content,
|
|
50
51
|
{
|
|
51
|
-
ref:
|
|
52
|
+
ref: f,
|
|
52
53
|
className: s(
|
|
53
54
|
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
54
55
|
a === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
55
56
|
o
|
|
56
57
|
),
|
|
57
58
|
position: a,
|
|
58
|
-
|
|
59
|
+
style: {
|
|
60
|
+
pointerEvents: "auto",
|
|
61
|
+
...d
|
|
62
|
+
},
|
|
63
|
+
...p,
|
|
59
64
|
children: [
|
|
60
65
|
/* @__PURE__ */ t(c, {}),
|
|
61
66
|
/* @__PURE__ */ t(
|
|
@@ -72,8 +77,8 @@ const w = l.forwardRef(({ className: o, children: r, position: a = "popper", ...
|
|
|
72
77
|
]
|
|
73
78
|
}
|
|
74
79
|
) }));
|
|
75
|
-
|
|
76
|
-
const
|
|
80
|
+
y.displayName = e.Content.displayName;
|
|
81
|
+
const g = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
|
77
82
|
e.Label,
|
|
78
83
|
{
|
|
79
84
|
ref: a,
|
|
@@ -81,8 +86,8 @@ const y = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
|
|
81
86
|
...r
|
|
82
87
|
}
|
|
83
88
|
));
|
|
84
|
-
|
|
85
|
-
const
|
|
89
|
+
g.displayName = e.Label.displayName;
|
|
90
|
+
const N = l.forwardRef(({ className: o, children: r, ...a }, d) => /* @__PURE__ */ n(
|
|
86
91
|
e.Item,
|
|
87
92
|
{
|
|
88
93
|
ref: d,
|
|
@@ -92,13 +97,13 @@ const g = l.forwardRef(({ className: o, children: r, ...a }, d) => /* @__PURE__
|
|
|
92
97
|
),
|
|
93
98
|
...a,
|
|
94
99
|
children: [
|
|
95
|
-
/* @__PURE__ */ t("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ t(e.ItemIndicator, { children: /* @__PURE__ */ t(
|
|
100
|
+
/* @__PURE__ */ t("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ t(e.ItemIndicator, { children: /* @__PURE__ */ t(h, { className: "h-4 w-4" }) }) }),
|
|
96
101
|
/* @__PURE__ */ t(e.ItemText, { children: r })
|
|
97
102
|
]
|
|
98
103
|
}
|
|
99
104
|
));
|
|
100
|
-
|
|
101
|
-
const
|
|
105
|
+
N.displayName = e.Item.displayName;
|
|
106
|
+
const x = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
|
102
107
|
e.Separator,
|
|
103
108
|
{
|
|
104
109
|
ref: a,
|
|
@@ -106,16 +111,16 @@ const N = l.forwardRef(({ className: o, ...r }, a) => /* @__PURE__ */ t(
|
|
|
106
111
|
...r
|
|
107
112
|
}
|
|
108
113
|
));
|
|
109
|
-
|
|
114
|
+
x.displayName = e.Separator.displayName;
|
|
110
115
|
export {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
y as SelectContent,
|
|
117
|
+
C as SelectGroup,
|
|
118
|
+
N as SelectItem,
|
|
119
|
+
g as SelectLabel,
|
|
120
|
+
R as SelectRoot,
|
|
116
121
|
m as SelectScrollDownButton,
|
|
117
122
|
c as SelectScrollUpButton,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
123
|
+
x as SelectSeparator,
|
|
124
|
+
w as SelectTrigger,
|
|
125
|
+
I as SelectValue
|
|
121
126
|
};
|
package/Sheet/Sheet.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
-
import * as React from
|
|
3
|
-
import * as SheetPrimitive from
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
4
4
|
declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
|
|
5
5
|
declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -10,6 +10,9 @@ declare const sheetVariants: (props?: ({
|
|
|
10
10
|
side?: "top" | "right" | "bottom" | "left" | null | undefined;
|
|
11
11
|
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
12
12
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
13
|
+
slotProps?: {
|
|
14
|
+
overlay?: React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>;
|
|
15
|
+
};
|
|
13
16
|
}
|
|
14
17
|
declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
18
|
declare const SheetHeader: {
|