@oneplatformdev/ui 0.1.10-3 → 0.1.10-4
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/index.js +7 -0
- package/{ui4.js → Alert/Alert.js} +1 -1
- package/Alert/index.js +6 -0
- package/{ui6.js → AlertDialog/AlertDialog.js} +1 -1
- package/AlertDialog/AlertDialog.stories.js +121 -0
- package/AlertDialog/AlertDialog.types.js +1 -0
- package/{ui5.js → AlertDialog/AlertDialogRoot.js} +33 -32
- package/AlertDialog/index.js +16 -0
- package/{ui7.js → AreaChart/AreaChart.js} +1 -1
- package/AreaChart/AreaChart.types.js +1 -0
- package/AreaChart/index.js +4 -0
- package/{ui8.js → Aside/Aside.js} +1 -1
- package/Aside/Aside.types.js +1 -0
- package/{ui9.js → Aside/AsideSidebar.js} +1 -1
- package/Aside/index.js +7 -0
- package/AspectRatio/index.js +5 -0
- package/Avatar/index.js +6 -0
- package/{ui12.js → Badge/Badge.js} +1 -1
- package/Badge/Badge.types.js +1 -0
- package/Badge/index.js +6 -0
- package/Breadcrumb/index.js +10 -0
- package/{ui15.js → Button/Button.js} +6 -5
- package/Button/Button.stories.js +20 -0
- package/Button/Button.types.js +1 -0
- package/Button/index.js +7 -0
- package/{ui17.js → ButtonIcon/ButtonIcon.js} +5 -4
- package/ButtonIcon/ButtonIcon.stories.js +126 -0
- package/ButtonIcon/ButtonIcon.types.js +1 -0
- package/ButtonIcon/index.js +7 -0
- package/CHANGELOG.md +8 -0
- package/{ui19.js → Calendar/Calendar.js} +2 -1
- package/Calendar/index.js +4 -0
- package/Card/index.js +9 -0
- package/{ui21.js → Carousel/Carousel.js} +7 -6
- package/Carousel/index.js +8 -0
- package/Chart/index.js +9 -0
- package/{ui23.js → Checkbox/Checkbox.js} +19 -18
- package/Checkbox/Checkbox.types.js +1 -0
- package/Checkbox/index.js +5 -0
- package/Collapsible/index.js +6 -0
- package/{ui25.js → Combobox/Combobox.js} +38 -36
- package/Combobox/Combobox.types.js +1 -0
- package/Combobox/ComboboxOptionItem.d.ts +1 -1
- package/Combobox/ComboboxOptionItem.d.ts.map +1 -1
- package/{ui98.js → Combobox/ComboboxOptionItem.js} +16 -17
- package/Combobox/ComboboxOptions.js +64 -0
- package/Combobox/index.js +4 -0
- package/{ui26.js → Command/Command.js} +20 -19
- package/Command/index.js +12 -0
- package/{ui27.js → DataTable/DataTable.js} +13 -12
- package/DataTable/DataTable.types.js +1 -0
- package/DataTable/DataTableColumnFilter.js +31 -0
- package/DataTable/index.js +4 -0
- package/DataTable/useDataTable.js +30 -0
- package/{ui28.js → DatePicker/DatePicker.js} +15 -14
- package/DatePicker/DatePicker.types.js +1 -0
- package/DatePicker/index.js +5 -0
- package/{ui29.js → Dialog/Dialog.js} +1 -1
- package/Dialog/index.js +17 -0
- package/Drawer/index.js +13 -0
- package/{ui32.js → DropdownMenu/DropdownMenu.js} +5 -5
- package/DropdownMenu/index.js +18 -0
- package/{ui85.js → Dropzone/Dropzone.js} +5 -5
- package/{ui93.js → Dropzone/DropzoneFilePreview.js} +2 -2
- package/{ui94.js → Dropzone/DropzoneSinglePickPreview.js} +1 -1
- package/Dropzone/index.js +7 -0
- package/{ui33.js → Form/Form.js} +9 -8
- package/{ui34.js → Form/FormRenderControl.js} +1 -1
- package/Form/FormRenderControl.types.js +1 -0
- package/Form/index.js +13 -0
- package/{ui35.js → FormCheckbox/FormCheckbox.js} +5 -5
- package/FormCheckbox/FormCheckbox.types.js +1 -0
- package/FormCheckbox/index.js +4 -0
- package/{ui36.js → FormCombobox/FormCombobox.js} +5 -5
- package/FormCombobox/FormCombobox.types.js +1 -0
- package/FormCombobox/index.js +4 -0
- package/{ui37.js → FormDatePicker/FormDatePicker.js} +5 -5
- package/FormDatePicker/FormDatePicker.types.js +1 -0
- package/FormDatePicker/index.js +5 -0
- package/FormDropzone/FormDropzone.js +19 -0
- package/FormDropzone/FormDropzone.types.js +1 -0
- package/FormDropzone/index.js +4 -0
- package/{ui38.js → FormInput/FormInput.js} +7 -7
- package/FormInput/FormInput.types.js +1 -0
- package/FormInput/index.js +4 -0
- package/FormRadio/FormRadio.js +40 -0
- package/FormRadio/FormRadio.types.d.ts +1 -1
- package/FormRadio/FormRadio.types.js +1 -0
- package/FormRadio/index.js +4 -0
- package/FormSelect/FormSelect.js +40 -0
- package/FormSelect/FormSelect.types.js +1 -0
- package/FormSelect/index.js +4 -0
- package/{ui40.js → FormTextarea/FormTextarea.js} +5 -5
- package/FormTextarea/FormTextarea.types.js +1 -0
- package/FormTextarea/index.js +4 -0
- package/{ui41.js → Header/Header.js} +2 -2
- package/Header/Header.types.js +1 -0
- package/Header/index.js +5 -0
- package/HoverCard/index.js +6 -0
- package/{ui43.js → Input/Input.js} +1 -1
- package/Input/Input.types.js +1 -0
- package/Input/index.js +7 -0
- package/InputOTP/index.js +7 -0
- package/{ui45.js → Label/Label.js} +1 -1
- package/Label/index.js +6 -0
- package/LazyLoader/LazyLoader.js +8 -0
- package/LazyLoader/index.js +5 -0
- package/LoadedIcon/index.js +4 -0
- package/{ui49.js → LoadingMask/LoadingMask.js} +1 -1
- package/LoadingMask/LoadingMask.types.js +1 -0
- package/LoadingMask/index.js +6 -0
- package/{ui51.js → LoadingProgress/LoadingProgress.js} +1 -1
- package/LoadingProgress/LoadingProgress.types.js +1 -0
- package/LoadingProgress/index.js +6 -0
- package/{ui53.js → Menubar/Menubar.js} +4 -4
- package/Menubar/index.js +19 -0
- package/{ui54.js → NavigationMenu/NavigationMenu.js} +1 -1
- package/NavigationMenu/index.js +13 -0
- package/{ui56.js → Pagination/Pagination.js} +2 -1
- package/Pagination/index.js +10 -0
- package/{ui57.js → Popover/Popover.js} +1 -1
- package/Popover/index.js +7 -0
- package/Progress/index.js +4 -0
- package/Radio/Radio.js +12 -0
- package/Radio/Radio.types.js +1 -0
- package/Radio/index.js +4 -0
- package/{ui59.js → RadioGroup/RadioGroup.js} +1 -1
- package/RadioGroup/index.js +6 -0
- package/Resizable/index.js +6 -0
- package/ScrollArea/index.js +5 -0
- package/{ui62.js → Search/Search.js} +9 -9
- package/Search/Search.types.js +1 -0
- package/Search/index.js +5 -0
- package/{ui64.js → Select/Select.js} +25 -24
- package/Select/Select.stories.js +41 -0
- package/Select/Select.types.js +1 -0
- package/{ui63.js → Select/SelectRoot.js} +3 -3
- package/Select/index.js +15 -0
- package/Separator/index.js +4 -0
- package/Sheet/index.js +13 -0
- package/{ui67.js → Sidebar/Sidebar.js} +16 -15
- package/Sidebar/index.js +27 -0
- package/Skeleton/index.js +4 -0
- package/Slider/index.js +4 -0
- package/Sonner/index.js +4 -0
- package/Switch/index.js +4 -0
- package/Table/index.js +11 -0
- package/{ui88.js → TablePagination/TablePagination.js} +16 -14
- package/TablePagination/index.js +4 -0
- package/{ui74.js → Tabs/Tabs.js} +1 -1
- package/Tabs/Tabs.types.js +1 -0
- package/Tabs/index.js +10 -0
- package/{ui75.js → Textarea/Textarea.js} +1 -1
- package/Textarea/Textarea.types.js +1 -0
- package/Textarea/index.js +4 -0
- package/Textarea/useAutosizeTextArea.d.ts +1 -1
- package/{ui77.js → Theme/ThemeModeToggle.js} +6 -5
- package/Theme/index.js +6 -0
- package/{ui78.js → Toast/Toast.js} +1 -1
- package/Toast/Toast.types.js +1 -0
- package/Toast/index.js +15 -0
- package/Toast/toast.constants.js +9 -0
- package/{ui80.js → Toaster/Toaster.js} +2 -2
- package/Toaster/index.js +4 -0
- package/Toggle/index.js +5 -0
- package/{ui82.js → ToggleGroup/ToggleGroup.js} +1 -1
- package/ToggleGroup/index.js +5 -0
- package/{ui84.js → Tooltip/Tooltip.js} +1 -1
- package/Tooltip/Tooltip.types.js +1 -0
- package/Tooltip/index.js +9 -0
- package/{ui97.js → hooks/dist/useIsMobile/useIsMobile.js} +5 -5
- package/{ui.js → index.js} +87 -87
- package/package.json +6 -16
- package/ui39.js +0 -39
- package/ui47.js +0 -7
- package/ui87.js +0 -19
- package/ui91.js +0 -63
- /package/{ui3.js → Accordion/Accordion.js} +0 -0
- /package/{ui89.js → Alert/alertVariants.js} +0 -0
- /package/{ui10.js → AspectRatio/AspectRatio.js} +0 -0
- /package/{ui11.js → Avatar/Avatar.js} +0 -0
- /package/{ui13.js → Badge/badgeVariants.js} +0 -0
- /package/{ui14.js → Breadcrumb/Breadcrumb.js} +0 -0
- /package/{ui16.js → Button/buttonVariants.js} +0 -0
- /package/{ui18.js → ButtonIcon/buttonIconVariants.js} +0 -0
- /package/{ui20.js → Card/Card.js} +0 -0
- /package/{ui22.js → Chart/Chart.js} +0 -0
- /package/{ui24.js → Collapsible/Collapsible.js} +0 -0
- /package/{ui30.js → Dialog/DialogOverlayScope.js} +0 -0
- /package/{ui31.js → Drawer/Drawer.js} +0 -0
- /package/{ui86.js → Dropzone/Dropzone.types.js} +0 -0
- /package/{ui95.js → Dropzone/DropzoneUtils.js} +0 -0
- /package/{ui42.js → HoverCard/HoverCard.js} +0 -0
- /package/{ui90.js → Input/inputVariants.js} +0 -0
- /package/{ui44.js → InputOTP/InputOTP.js} +0 -0
- /package/{ui46.js → Label/labelVariants.js} +0 -0
- /package/{ui48.js → LoadedIcon/LoadedIcon.js} +0 -0
- /package/{ui50.js → LoadingMask/RenderLoadingMask.js} +0 -0
- /package/{ui52.js → LoadingProgress/loadingProgressVariants.js} +0 -0
- /package/{ui55.js → NavigationMenu/navigationMenuVariants.js} +0 -0
- /package/{ui58.js → Progress/Progress.js} +0 -0
- /package/{ui60.js → Resizable/Resizable.js} +0 -0
- /package/{ui61.js → ScrollArea/ScrollArea.js} +0 -0
- /package/{ui65.js → Separator/Separator.js} +0 -0
- /package/{ui66.js → Sheet/Sheet.js} +0 -0
- /package/{ui68.js → Skeleton/Skeleton.js} +0 -0
- /package/{ui69.js → Slider/Slider.js} +0 -0
- /package/{ui70.js → Sonner/Sonner.js} +0 -0
- /package/{ui71.js → Switch/Switch.js} +0 -0
- /package/{ui72.js → Table/Table.js} +0 -0
- /package/{ui73.js → Tabs/TabsRoot.js} +0 -0
- /package/{ui96.js → Textarea/useAutosizeTextArea.js} +0 -0
- /package/{ui76.js → Theme/ThemeProvider.js} +0 -0
- /package/{ui92.js → Toast/toastVariants.js} +0 -0
- /package/{ui79.js → Toast/useToast.js} +0 -0
- /package/{ui81.js → Toggle/Toggle.js} +0 -0
- /package/{ui83.js → Tooltip/TooltipRoot.js} +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsxs as i, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { Button as m } from "../Button/Button.js";
|
|
3
|
+
import "../Button/buttonVariants.js";
|
|
4
|
+
import { DropdownMenu as h, DropdownMenuTrigger as p, DropdownMenuContent as g, DropdownMenuCheckboxItem as u } from "../DropdownMenu/DropdownMenu.js";
|
|
5
|
+
import { Table as C, TableHeader as f, TableRow as t, TableHead as w, TableBody as x, TableCell as o } from "../Table/Table.js";
|
|
2
6
|
import { flexRender as d } from "@tanstack/react-table";
|
|
3
|
-
import { ChevronDown as
|
|
4
|
-
|
|
5
|
-
import { Button as C } from "./ui15.js";
|
|
6
|
-
import { Table as f, TableHeader as w, TableRow as t, TableHead as x, TableBody as b, TableCell as o } from "./ui72.js";
|
|
7
|
-
const R = ({
|
|
7
|
+
import { ChevronDown as b } from "lucide-react";
|
|
8
|
+
const k = ({
|
|
8
9
|
table: r,
|
|
9
10
|
ToolBar: a,
|
|
10
11
|
tColumns: s = "Columns",
|
|
@@ -13,12 +14,12 @@ const R = ({
|
|
|
13
14
|
/* @__PURE__ */ i("div", { className: "flex items-center py-4", children: [
|
|
14
15
|
a,
|
|
15
16
|
/* @__PURE__ */ i(h, { children: [
|
|
16
|
-
/* @__PURE__ */ l(
|
|
17
|
+
/* @__PURE__ */ l(p, { asChild: !0, children: /* @__PURE__ */ i(m, { variant: "outline", className: "ml-auto", children: [
|
|
17
18
|
s,
|
|
18
19
|
" ",
|
|
19
|
-
/* @__PURE__ */ l(
|
|
20
|
+
/* @__PURE__ */ l(b, { className: "ml-2 h-4 w-4" })
|
|
20
21
|
] }) }),
|
|
21
|
-
/* @__PURE__ */ l(
|
|
22
|
+
/* @__PURE__ */ l(g, { align: "end", children: r.getAllColumns().filter((e) => e.getCanHide()).map((e) => /* @__PURE__ */ l(
|
|
22
23
|
u,
|
|
23
24
|
{
|
|
24
25
|
className: "capitalize",
|
|
@@ -30,12 +31,12 @@ const R = ({
|
|
|
30
31
|
)) })
|
|
31
32
|
] })
|
|
32
33
|
] }),
|
|
33
|
-
/* @__PURE__ */ l("div", { className: "rounded-md border", children: /* @__PURE__ */ i(
|
|
34
|
-
/* @__PURE__ */ l(
|
|
34
|
+
/* @__PURE__ */ l("div", { className: "rounded-md border", children: /* @__PURE__ */ i(C, { children: [
|
|
35
|
+
/* @__PURE__ */ l(f, { children: r.getHeaderGroups().map((e) => /* @__PURE__ */ l(t, { children: e.headers.map((n) => /* @__PURE__ */ l(w, { children: n.isPlaceholder ? null : d(
|
|
35
36
|
n.column.columnDef.header,
|
|
36
37
|
n.getContext()
|
|
37
38
|
) }, n.id)) }, e.id)) }),
|
|
38
|
-
/* @__PURE__ */ l(
|
|
39
|
+
/* @__PURE__ */ l(x, { children: r.getRowModel().rows?.length ? r.getRowModel().rows.map((e) => /* @__PURE__ */ l(
|
|
39
40
|
t,
|
|
40
41
|
{
|
|
41
42
|
"data-state": e.getIsSelected() && "selected",
|
|
@@ -56,5 +57,5 @@ const R = ({
|
|
|
56
57
|
] }) })
|
|
57
58
|
] });
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
+
k as DataTable
|
|
60
61
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as n, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDown as m } from "lucide-react";
|
|
3
|
+
import { useMemo as s } from "react";
|
|
4
|
+
import { Button as d } from "../Button/Button.js";
|
|
5
|
+
import "../Button/buttonVariants.js";
|
|
6
|
+
import { DropdownMenuCheckboxItem as c, DropdownMenu as u, DropdownMenuTrigger as h, DropdownMenuContent as p } from "../DropdownMenu/DropdownMenu.js";
|
|
7
|
+
const x = (i) => {
|
|
8
|
+
const {
|
|
9
|
+
table: r,
|
|
10
|
+
columnsLabel: l = "Columns"
|
|
11
|
+
} = i, o = s(() => r.getAllColumns().filter((e) => e.getCanHide()).map((e) => /* @__PURE__ */ n(
|
|
12
|
+
c,
|
|
13
|
+
{
|
|
14
|
+
className: "capitalize",
|
|
15
|
+
checked: e.getIsVisible(),
|
|
16
|
+
onCheckedChange: (a) => e.toggleVisibility(!!a),
|
|
17
|
+
children: e.id
|
|
18
|
+
},
|
|
19
|
+
e.id
|
|
20
|
+
)), [r]);
|
|
21
|
+
return o.length ? /* @__PURE__ */ t(u, { children: [
|
|
22
|
+
/* @__PURE__ */ n(h, { asChild: !0, children: /* @__PURE__ */ t(d, { variant: "outline", className: "ml-auto", children: [
|
|
23
|
+
l,
|
|
24
|
+
/* @__PURE__ */ n(m, { className: "ml-2 h-4 w-4" })
|
|
25
|
+
] }) }),
|
|
26
|
+
/* @__PURE__ */ n(p, { align: "end", children: o })
|
|
27
|
+
] }) : null;
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
x as DataTableColumnFilter
|
|
31
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import e from "react";
|
|
2
|
+
import { useReactTable as u, getFilteredRowModel as g, getSortedRowModel as d, getPaginationRowModel as m, getCoreRowModel as R } from "@tanstack/react-table";
|
|
3
|
+
const S = (t, o) => {
|
|
4
|
+
const [n, l] = e.useState([]), [i, a] = e.useState(
|
|
5
|
+
[]
|
|
6
|
+
), [r, s] = e.useState({});
|
|
7
|
+
return { table: u({
|
|
8
|
+
data: t,
|
|
9
|
+
columns: o,
|
|
10
|
+
onSortingChange: l,
|
|
11
|
+
onColumnFiltersChange: a,
|
|
12
|
+
getCoreRowModel: R(),
|
|
13
|
+
getPaginationRowModel: m(),
|
|
14
|
+
getSortedRowModel: d(),
|
|
15
|
+
getFilteredRowModel: g(),
|
|
16
|
+
onColumnVisibilityChange: s,
|
|
17
|
+
enableRowSelection: !0,
|
|
18
|
+
manualPagination: !0,
|
|
19
|
+
manualSorting: !0,
|
|
20
|
+
manualFiltering: !0,
|
|
21
|
+
state: {
|
|
22
|
+
sorting: n,
|
|
23
|
+
columnFilters: i,
|
|
24
|
+
columnVisibility: r
|
|
25
|
+
}
|
|
26
|
+
}) };
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
S as useDataTable
|
|
30
|
+
};
|
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as e, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "react";
|
|
3
3
|
import { format as d } from "date-fns";
|
|
4
4
|
import { Calendar as s } from "lucide-react";
|
|
5
5
|
import { cn as c } from "@oneplatformdev/utils";
|
|
6
|
+
import { Button as f } from "../Button/Button.js";
|
|
7
|
+
import "../Button/buttonVariants.js";
|
|
8
|
+
import { Calendar as p } from "../Calendar/Calendar.js";
|
|
9
|
+
import { Popover as u, PopoverTrigger as h, PopoverContent as y } from "../Popover/Popover.js";
|
|
6
10
|
import { uk as t } from "date-fns/locale";
|
|
7
|
-
import { Button as f } from "./ui15.js";
|
|
8
|
-
import { Calendar as p } from "./ui19.js";
|
|
9
|
-
import { Popover as u, PopoverTrigger as h, PopoverContent as y } from "./ui57.js";
|
|
10
11
|
const g = i.forwardRef(
|
|
11
|
-
(a,
|
|
12
|
+
(a, m) => {
|
|
12
13
|
const {
|
|
13
|
-
selectedDate:
|
|
14
|
-
onDateChange:
|
|
14
|
+
selectedDate: o,
|
|
15
|
+
onDateChange: l,
|
|
15
16
|
disabled: n = !1
|
|
16
17
|
} = a;
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */ r(h, { asChild: !0, children: /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ e(u, { children: [
|
|
19
|
+
/* @__PURE__ */ r(h, { asChild: !0, children: /* @__PURE__ */ e(
|
|
19
20
|
f,
|
|
20
21
|
{
|
|
21
|
-
ref:
|
|
22
|
+
ref: m,
|
|
22
23
|
disabled: n,
|
|
23
24
|
variant: "outline-solid",
|
|
24
25
|
className: c(
|
|
25
26
|
"w-full justify-start text-left font-normal border h-10",
|
|
26
|
-
!
|
|
27
|
+
!o && "text-muted-foreground"
|
|
27
28
|
),
|
|
28
29
|
children: [
|
|
29
|
-
|
|
30
|
+
o ? d(o, "LLL dd, y", { locale: t }) : /* @__PURE__ */ r("span", { children: "dd/mm/yyyy" }),
|
|
30
31
|
/* @__PURE__ */ r(s, { className: "mr-2 h-4 w-4 ml-auto" })
|
|
31
32
|
]
|
|
32
33
|
}
|
|
@@ -36,8 +37,8 @@ const g = i.forwardRef(
|
|
|
36
37
|
{
|
|
37
38
|
mode: "single",
|
|
38
39
|
captionLayout: "dropdown-buttons",
|
|
39
|
-
selected:
|
|
40
|
-
onSelect:
|
|
40
|
+
selected: o,
|
|
41
|
+
onSelect: l,
|
|
41
42
|
fromYear: 1960,
|
|
42
43
|
toYear: 2030,
|
|
43
44
|
locale: t
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -3,7 +3,7 @@ import i, { useState as y, useRef as N } from "react";
|
|
|
3
3
|
import * as a from "@radix-ui/react-dialog";
|
|
4
4
|
import { XIcon as D } from "lucide-react";
|
|
5
5
|
import { cn as l, composeRefs as h } from "@oneplatformdev/utils";
|
|
6
|
-
import { DialogOverlayScope as b } from "./
|
|
6
|
+
import { DialogOverlayScope as b } from "./DialogOverlayScope.js";
|
|
7
7
|
const P = (e) => {
|
|
8
8
|
const { modal: t, ...s } = e;
|
|
9
9
|
return /* @__PURE__ */ o(a.Root, { modal: t, ...s });
|
package/Dialog/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Dialog as l, DialogClose as e, DialogContent as i, DialogDescription as r, DialogFooter as g, DialogHeader as D, DialogOverlay as t, DialogPortal as n, DialogTitle as C, DialogTrigger as p } from "./Dialog.js";
|
|
2
|
+
import { DialogOverlayContainerContext as y, DialogOverlayScope as O, useDialogOverlayContainer as s } from "./DialogOverlayScope.js";
|
|
3
|
+
export {
|
|
4
|
+
l as Dialog,
|
|
5
|
+
e as DialogClose,
|
|
6
|
+
i as DialogContent,
|
|
7
|
+
r as DialogDescription,
|
|
8
|
+
g as DialogFooter,
|
|
9
|
+
D as DialogHeader,
|
|
10
|
+
t as DialogOverlay,
|
|
11
|
+
y as DialogOverlayContainerContext,
|
|
12
|
+
O as DialogOverlayScope,
|
|
13
|
+
n as DialogPortal,
|
|
14
|
+
C as DialogTitle,
|
|
15
|
+
p as DialogTrigger,
|
|
16
|
+
s as useDialogOverlayContainer
|
|
17
|
+
};
|
package/Drawer/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Drawer as a, DrawerClose as D, DrawerContent as w, DrawerDescription as o, DrawerFooter as t, DrawerHeader as i, DrawerOverlay as l, DrawerPortal as n, DrawerTitle as g, DrawerTrigger as p } from "./Drawer.js";
|
|
2
|
+
export {
|
|
3
|
+
a as Drawer,
|
|
4
|
+
D as DrawerClose,
|
|
5
|
+
w as DrawerContent,
|
|
6
|
+
o as DrawerDescription,
|
|
7
|
+
t as DrawerFooter,
|
|
8
|
+
i as DrawerHeader,
|
|
9
|
+
l as DrawerOverlay,
|
|
10
|
+
n as DrawerPortal,
|
|
11
|
+
g as DrawerTitle,
|
|
12
|
+
p as DrawerTrigger
|
|
13
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs as l, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import * as d from "react";
|
|
3
3
|
import * as e from "@radix-ui/react-dropdown-menu";
|
|
4
|
-
import {
|
|
4
|
+
import { ChevronRight as m, Check as c, Circle as p } from "lucide-react";
|
|
5
5
|
import { cn as s } from "@oneplatformdev/utils";
|
|
6
6
|
const R = e.Root, I = e.Trigger, S = e.Group, C = e.Portal, z = e.Sub, k = e.RadioGroup, u = d.forwardRef(({ className: o, inset: t, children: a, ...r }, i) => /* @__PURE__ */ l(
|
|
7
7
|
e.SubTrigger,
|
|
@@ -15,7 +15,7 @@ const R = e.Root, I = e.Trigger, S = e.Group, C = e.Portal, z = e.Sub, k = e.Rad
|
|
|
15
15
|
...r,
|
|
16
16
|
children: [
|
|
17
17
|
a,
|
|
18
|
-
/* @__PURE__ */ n(
|
|
18
|
+
/* @__PURE__ */ n(m, { className: "ml-auto" })
|
|
19
19
|
]
|
|
20
20
|
}
|
|
21
21
|
));
|
|
@@ -70,7 +70,7 @@ const b = d.forwardRef(({ className: o, children: t, checked: a, ...r }, i) => /
|
|
|
70
70
|
checked: a,
|
|
71
71
|
...r,
|
|
72
72
|
children: [
|
|
73
|
-
/* @__PURE__ */ n("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n(e.ItemIndicator, { children: /* @__PURE__ */ n(
|
|
73
|
+
/* @__PURE__ */ n("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n(e.ItemIndicator, { children: /* @__PURE__ */ n(c, { className: "h-4 w-4" }) }) }),
|
|
74
74
|
t
|
|
75
75
|
]
|
|
76
76
|
}
|
|
@@ -86,7 +86,7 @@ const h = d.forwardRef(({ className: o, children: t, ...a }, r) => /* @__PURE__
|
|
|
86
86
|
),
|
|
87
87
|
...a,
|
|
88
88
|
children: [
|
|
89
|
-
/* @__PURE__ */ n("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n(e.ItemIndicator, { children: /* @__PURE__ */ n(
|
|
89
|
+
/* @__PURE__ */ n("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ n(e.ItemIndicator, { children: /* @__PURE__ */ n(p, { className: "h-2 w-2 fill-current" }) }) }),
|
|
90
90
|
t
|
|
91
91
|
]
|
|
92
92
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DropdownMenu as r, DropdownMenuCheckboxItem as e, DropdownMenuContent as u, DropdownMenuGroup as p, DropdownMenuItem as d, DropdownMenuLabel as w, DropdownMenuPortal as D, DropdownMenuRadioGroup as M, DropdownMenuRadioItem as t, DropdownMenuSeparator as a, DropdownMenuShortcut as b, DropdownMenuSub as S, DropdownMenuSubContent as g, DropdownMenuSubTrigger as i, DropdownMenuTrigger as m } from "./DropdownMenu.js";
|
|
2
|
+
export {
|
|
3
|
+
r as DropdownMenu,
|
|
4
|
+
e as DropdownMenuCheckboxItem,
|
|
5
|
+
u as DropdownMenuContent,
|
|
6
|
+
p as DropdownMenuGroup,
|
|
7
|
+
d as DropdownMenuItem,
|
|
8
|
+
w as DropdownMenuLabel,
|
|
9
|
+
D as DropdownMenuPortal,
|
|
10
|
+
M as DropdownMenuRadioGroup,
|
|
11
|
+
t as DropdownMenuRadioItem,
|
|
12
|
+
a as DropdownMenuSeparator,
|
|
13
|
+
b as DropdownMenuShortcut,
|
|
14
|
+
S as DropdownMenuSub,
|
|
15
|
+
g as DropdownMenuSubContent,
|
|
16
|
+
i as DropdownMenuSubTrigger,
|
|
17
|
+
m as DropdownMenuTrigger
|
|
18
|
+
};
|
|
@@ -3,11 +3,11 @@ import { X as H } from "lucide-react";
|
|
|
3
3
|
import { forwardRef as O, useState as g, useImperativeHandle as X } from "react";
|
|
4
4
|
import { useDropzone as Y } from "react-dropzone";
|
|
5
5
|
import { cn as n } from "@oneplatformdev/utils";
|
|
6
|
-
import { Card as q } from "
|
|
7
|
-
import { DEFAULT_FILE_TYPES as G } from "./
|
|
8
|
-
import { FilePreview as J } from "./
|
|
9
|
-
import { DropzoneSinglePickPreview as K } from "./
|
|
10
|
-
import { DefaultFileIcon as Q, isFile as v, extractName as R } from "./
|
|
6
|
+
import { Card as q } from "../Card/Card.js";
|
|
7
|
+
import { DEFAULT_FILE_TYPES as G } from "./Dropzone.types.js";
|
|
8
|
+
import { FilePreview as J } from "./DropzoneFilePreview.js";
|
|
9
|
+
import { DropzoneSinglePickPreview as K } from "./DropzoneSinglePickPreview.js";
|
|
10
|
+
import { DefaultFileIcon as Q, isFile as v, extractName as R } from "./DropzoneUtils.js";
|
|
11
11
|
const Z = O(
|
|
12
12
|
({
|
|
13
13
|
acceptTypes: w = G,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as n, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u, useEffect as f } from "react";
|
|
3
3
|
import { File as m } from "lucide-react";
|
|
4
|
-
import { DEFAULT_IMAGES_TYPES as p } from "./
|
|
5
|
-
import { isFile as a } from "./
|
|
4
|
+
import { DEFAULT_IMAGES_TYPES as p } from "./Dropzone.types.js";
|
|
5
|
+
import { isFile as a } from "./DropzoneUtils.js";
|
|
6
6
|
import { cn as t } from "@oneplatformdev/utils";
|
|
7
7
|
const N = ({ item: e, styles: s }) => {
|
|
8
8
|
const [c, r] = u(null), i = a(e) && p.includes(e.type);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as c } from "react";
|
|
3
|
-
import { isFile as u } from "./
|
|
3
|
+
import { isFile as u } from "./DropzoneUtils.js";
|
|
4
4
|
import { X as f, FileIcon as d } from "lucide-react";
|
|
5
5
|
const m = (e) => {
|
|
6
6
|
if (!e) return "";
|
package/{ui33.js → Form/Form.js}
RENAMED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import * as m from "react";
|
|
3
3
|
import { Slot as F } from "@radix-ui/react-slot";
|
|
4
|
-
import {
|
|
4
|
+
import { useFormContext as u, Controller as p, FormProvider as x } from "react-hook-form";
|
|
5
5
|
import { cn as a } from "@oneplatformdev/utils";
|
|
6
|
-
import { Label as I } from "
|
|
7
|
-
|
|
6
|
+
import { Label as I } from "../Label/Label.js";
|
|
7
|
+
import "../Label/labelVariants.js";
|
|
8
|
+
const M = x, l = m.createContext(
|
|
8
9
|
{}
|
|
9
|
-
),
|
|
10
|
+
), S = ({
|
|
10
11
|
...e
|
|
11
|
-
}) => /* @__PURE__ */ n(l.Provider, { value: { name: e.name }, children: /* @__PURE__ */ n(
|
|
12
|
-
const e = m.useContext(l), t = m.useContext(f), { getFieldState: o, formState: r } =
|
|
12
|
+
}) => /* @__PURE__ */ n(l.Provider, { value: { name: e.name }, children: /* @__PURE__ */ n(p, { ...e }) }), c = () => {
|
|
13
|
+
const e = m.useContext(l), t = m.useContext(f), { getFieldState: o, formState: r } = u(), i = o(e.name, r);
|
|
13
14
|
if (!e)
|
|
14
15
|
throw new Error("useFormField should be used within <FormField>");
|
|
15
16
|
const { id: s } = t;
|
|
@@ -86,10 +87,10 @@ const w = m.forwardRef(({ className: e, children: t, ...o }, r) => {
|
|
|
86
87
|
});
|
|
87
88
|
w.displayName = "FormMessage";
|
|
88
89
|
export {
|
|
89
|
-
|
|
90
|
+
M as Form,
|
|
90
91
|
g as FormControl,
|
|
91
92
|
N as FormDescription,
|
|
92
|
-
|
|
93
|
+
S as FormField,
|
|
93
94
|
v as FormItem,
|
|
94
95
|
C as FormLabel,
|
|
95
96
|
w as FormMessage,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import { FormField as d, FormItem as i, FormLabel as F, FormMessage as p } from "./
|
|
2
|
+
import { FormField as d, FormItem as i, FormLabel as F, FormMessage as p } from "./Form.js";
|
|
3
3
|
const b = (e) => {
|
|
4
4
|
const { form: n, name: m, label: o, render: t, containerProps: l = {}, ...s } = e;
|
|
5
5
|
return /* @__PURE__ */ r(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/Form/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Form as e, FormControl as m, FormDescription as F, FormField as t, FormItem as l, FormLabel as i, FormMessage as n, useFormField as s } from "./Form.js";
|
|
2
|
+
import { FormRenderControl as p } from "./FormRenderControl.js";
|
|
3
|
+
export {
|
|
4
|
+
e as Form,
|
|
5
|
+
m as FormControl,
|
|
6
|
+
F as FormDescription,
|
|
7
|
+
t as FormField,
|
|
8
|
+
l as FormItem,
|
|
9
|
+
i as FormLabel,
|
|
10
|
+
n as FormMessage,
|
|
11
|
+
p as FormRenderControl,
|
|
12
|
+
s as useFormField
|
|
13
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { CheckboxLabel as k } from "
|
|
2
|
+
import { FormControl as a } from "../Form/Form.js";
|
|
3
|
+
import { FormRenderControl as l } from "../Form/FormRenderControl.js";
|
|
4
|
+
import { CheckboxLabel as k } from "../Checkbox/Checkbox.js";
|
|
5
5
|
const f = (m) => {
|
|
6
6
|
const { form: t, label: c, name: h, onCheckedChange: C, ...r } = m;
|
|
7
7
|
return /* @__PURE__ */ e(
|
|
8
|
-
|
|
8
|
+
l,
|
|
9
9
|
{
|
|
10
10
|
form: t,
|
|
11
11
|
name: h,
|
|
12
|
-
render: ({ field: o }) => /* @__PURE__ */ e(
|
|
12
|
+
render: ({ field: o }) => /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(
|
|
13
13
|
k,
|
|
14
14
|
{
|
|
15
15
|
...o,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { FormRenderControl as p } from "
|
|
4
|
-
import {
|
|
2
|
+
import { FormControl as b } from "../Form/Form.js";
|
|
3
|
+
import { FormRenderControl as p } from "../Form/FormRenderControl.js";
|
|
4
|
+
import { Combobox as a } from "../Combobox/Combobox.js";
|
|
5
5
|
const x = (m) => {
|
|
6
6
|
const { form: n, label: e, name: t, ...C } = m;
|
|
7
7
|
return /* @__PURE__ */ o(
|
|
@@ -10,8 +10,8 @@ const x = (m) => {
|
|
|
10
10
|
form: n,
|
|
11
11
|
label: e,
|
|
12
12
|
name: t,
|
|
13
|
-
render: ({ field: r }) => /* @__PURE__ */ o(
|
|
14
|
-
|
|
13
|
+
render: ({ field: r }) => /* @__PURE__ */ o(b, { children: /* @__PURE__ */ o(
|
|
14
|
+
a,
|
|
15
15
|
{
|
|
16
16
|
...C,
|
|
17
17
|
...r,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { DatePicker as l } from "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { DatePicker as l } from "../DatePicker/DatePicker.js";
|
|
3
|
+
import { FormControl as p } from "../Form/Form.js";
|
|
4
|
+
import { FormRenderControl as s } from "../Form/FormRenderControl.js";
|
|
5
5
|
const g = (t) => {
|
|
6
6
|
const { form: n, name: m, label: a, onDateChange: c, ...i } = t;
|
|
7
7
|
return /* @__PURE__ */ o(
|
|
8
|
-
|
|
8
|
+
s,
|
|
9
9
|
{
|
|
10
10
|
form: n,
|
|
11
11
|
name: m,
|
|
12
12
|
label: a,
|
|
13
|
-
render: ({ field: r }) => /* @__PURE__ */ o(
|
|
13
|
+
render: ({ field: r }) => /* @__PURE__ */ o(p, { children: /* @__PURE__ */ o(
|
|
14
14
|
l,
|
|
15
15
|
{
|
|
16
16
|
...r,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { FormControl as a } from "../Form/Form.js";
|
|
3
|
+
import { FormRenderControl as l } from "../Form/FormRenderControl.js";
|
|
4
|
+
import { Dropzone as f } from "../Dropzone/Dropzone.js";
|
|
5
|
+
const h = (n) => {
|
|
6
|
+
const { form: e, label: m, name: t, ...p } = n;
|
|
7
|
+
return /* @__PURE__ */ o(
|
|
8
|
+
l,
|
|
9
|
+
{
|
|
10
|
+
form: e,
|
|
11
|
+
label: m,
|
|
12
|
+
name: t,
|
|
13
|
+
render: ({ field: r }) => /* @__PURE__ */ o(a, { children: /* @__PURE__ */ o(f, { ...p, ...r, onChangeValue: r.onChange }) })
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
h as FormDropzone
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { FormRenderControl as C } from "
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { FormControl as x } from "../Form/Form.js";
|
|
3
|
+
import { FormRenderControl as C } from "../Form/FormRenderControl.js";
|
|
4
|
+
import { Input as D } from "../Input/Input.js";
|
|
5
|
+
import { forwardRef as F } from "react";
|
|
6
6
|
function I(l, e) {
|
|
7
7
|
const { form: a, label: s, name: u, onChange: c, onBlur: m, onPaste: p, style: i, ...f } = l;
|
|
8
8
|
return /* @__PURE__ */ r(
|
|
@@ -11,8 +11,8 @@ function I(l, e) {
|
|
|
11
11
|
form: a,
|
|
12
12
|
name: u,
|
|
13
13
|
label: s,
|
|
14
|
-
render: ({ field: o }) => /* @__PURE__ */ r(
|
|
15
|
-
|
|
14
|
+
render: ({ field: o }) => /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(
|
|
15
|
+
D,
|
|
16
16
|
{
|
|
17
17
|
...o,
|
|
18
18
|
...f,
|
|
@@ -39,7 +39,7 @@ function I(l, e) {
|
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
|
-
const j =
|
|
42
|
+
const j = F(I);
|
|
43
43
|
export {
|
|
44
44
|
j as FormInput
|
|
45
45
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { FormControl as a, FormItem as v } from "../Form/Form.js";
|
|
3
|
+
import { FormRenderControl as C } from "../Form/FormRenderControl.js";
|
|
4
|
+
import { Radio as F } from "../Radio/Radio.js";
|
|
5
|
+
const R = (m) => {
|
|
6
|
+
const {
|
|
7
|
+
form: l,
|
|
8
|
+
name: t,
|
|
9
|
+
label: u,
|
|
10
|
+
onValueChange: d,
|
|
11
|
+
value: h,
|
|
12
|
+
defaultValue: c,
|
|
13
|
+
renderOption: i,
|
|
14
|
+
...s
|
|
15
|
+
} = m;
|
|
16
|
+
return /* @__PURE__ */ e(
|
|
17
|
+
C,
|
|
18
|
+
{
|
|
19
|
+
form: l,
|
|
20
|
+
name: t,
|
|
21
|
+
label: u,
|
|
22
|
+
render: ({ field: o }) => /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(
|
|
23
|
+
F,
|
|
24
|
+
{
|
|
25
|
+
...o,
|
|
26
|
+
...s,
|
|
27
|
+
defaultValue: c || o.value,
|
|
28
|
+
value: h || o.value,
|
|
29
|
+
onValueChange: (r) => {
|
|
30
|
+
o.onChange(r), d?.(r);
|
|
31
|
+
},
|
|
32
|
+
renderOption: (r, n) => /* @__PURE__ */ e(v, { children: /* @__PURE__ */ e(a, { children: i?.(r, n) || /* @__PURE__ */ e(n, { ...r }) }) }, r.value)
|
|
33
|
+
}
|
|
34
|
+
) })
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
R as FormRadio
|
|
40
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
|
-
import { FormRenderControlExtendProps } from '
|
|
2
|
+
import { FormRenderControlExtendProps } from '@oneplatformdev/ui/Form';
|
|
3
3
|
import { RadioProps } from '../Radio';
|
|
4
4
|
export interface FormRadioGroupProps<Data extends FieldValues> extends FormRenderControlExtendProps<Data>, Partial<Omit<RadioProps, 'name'>> {
|
|
5
5
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|