@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
package/Card/index.js
ADDED
|
@@ -3,10 +3,11 @@ import * as e from "react";
|
|
|
3
3
|
import k from "embla-carousel-react";
|
|
4
4
|
import { ArrowLeft as z, ArrowRight as g } from "lucide-react";
|
|
5
5
|
import { cn as m } from "@oneplatformdev/utils";
|
|
6
|
-
import { Button as
|
|
7
|
-
|
|
6
|
+
import { Button as p } from "../Button/Button.js";
|
|
7
|
+
import "../Button/buttonVariants.js";
|
|
8
|
+
const w = e.createContext(null);
|
|
8
9
|
function C() {
|
|
9
|
-
const o = e.useContext(
|
|
10
|
+
const o = e.useContext(w);
|
|
10
11
|
if (!o)
|
|
11
12
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
12
13
|
return o;
|
|
@@ -47,7 +48,7 @@ const D = e.forwardRef(
|
|
|
47
48
|
r?.off("select", d);
|
|
48
49
|
};
|
|
49
50
|
}, [r, d]), /* @__PURE__ */ s(
|
|
50
|
-
|
|
51
|
+
w.Provider,
|
|
51
52
|
{
|
|
52
53
|
value: {
|
|
53
54
|
carouselRef: v,
|
|
@@ -113,7 +114,7 @@ I.displayName = "CarouselItem";
|
|
|
113
114
|
const j = e.forwardRef(({ className: o, variant: l = "outline-solid", size: t = "icon", ...a }, c) => {
|
|
114
115
|
const { orientation: i, scrollPrev: u, canScrollPrev: f } = C();
|
|
115
116
|
return /* @__PURE__ */ x(
|
|
116
|
-
|
|
117
|
+
p,
|
|
117
118
|
{
|
|
118
119
|
ref: c,
|
|
119
120
|
variant: l,
|
|
@@ -137,7 +138,7 @@ j.displayName = "CarouselPrevious";
|
|
|
137
138
|
const A = e.forwardRef(({ className: o, variant: l = "outline-solid", size: t = "icon", ...a }, c) => {
|
|
138
139
|
const { orientation: i, scrollNext: u, canScrollNext: f } = C();
|
|
139
140
|
return /* @__PURE__ */ x(
|
|
140
|
-
|
|
141
|
+
p,
|
|
141
142
|
{
|
|
142
143
|
ref: c,
|
|
143
144
|
variant: l,
|
package/Chart/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChartContainer as o, ChartLegend as r, ChartLegendContent as C, ChartStyle as n, ChartTooltip as a, ChartTooltipContent as h } from "./Chart.js";
|
|
2
|
+
export {
|
|
3
|
+
o as ChartContainer,
|
|
4
|
+
r as ChartLegend,
|
|
5
|
+
C as ChartLegendContent,
|
|
6
|
+
n as ChartStyle,
|
|
7
|
+
a as ChartTooltip,
|
|
8
|
+
h as ChartTooltipContent
|
|
9
|
+
};
|
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
2
|
+
import * as c from "@radix-ui/react-checkbox";
|
|
3
3
|
import { MinusIcon as f, CheckIcon as p } from "lucide-react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as m from "react";
|
|
5
5
|
import { cn as i } from "@oneplatformdev/utils";
|
|
6
|
-
import { Label as h } from "
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { Label as h } from "../Label/Label.js";
|
|
7
|
+
import "../Label/labelVariants.js";
|
|
8
|
+
const n = m.forwardRef(({ className: o, checked: s, indeterminate: e, ...a }, t) => {
|
|
9
|
+
const d = e ? f : p;
|
|
9
10
|
return /* @__PURE__ */ r(
|
|
10
|
-
|
|
11
|
+
c.Root,
|
|
11
12
|
{
|
|
12
|
-
ref:
|
|
13
|
+
ref: t,
|
|
13
14
|
className: i(
|
|
14
15
|
"peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow-sm focus-visible:outline-hidden 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",
|
|
15
|
-
|
|
16
|
+
o
|
|
16
17
|
),
|
|
17
18
|
...a,
|
|
18
|
-
checked:
|
|
19
|
+
checked: s ?? e,
|
|
19
20
|
children: /* @__PURE__ */ r(
|
|
20
|
-
|
|
21
|
+
c.Indicator,
|
|
21
22
|
{
|
|
22
23
|
className: i("flex items-center justify-center text-current"),
|
|
23
|
-
children: /* @__PURE__ */ r(
|
|
24
|
+
children: /* @__PURE__ */ r(d, { className: "h-4 w-4" })
|
|
24
25
|
}
|
|
25
26
|
)
|
|
26
27
|
}
|
|
27
28
|
);
|
|
28
29
|
});
|
|
29
|
-
|
|
30
|
-
const u =
|
|
30
|
+
n.displayName = c.Root.displayName;
|
|
31
|
+
const u = m.forwardRef(({ label: o = "", children: s, labelProps: e, ...a }, t) => /* @__PURE__ */ l(
|
|
31
32
|
h,
|
|
32
33
|
{
|
|
33
|
-
ref:
|
|
34
|
+
ref: t,
|
|
34
35
|
...e,
|
|
35
36
|
className: i(
|
|
36
37
|
"flex w-full items-start gap-3 font-normal py-3 cursor-pointer",
|
|
@@ -38,16 +39,16 @@ const u = n.forwardRef(({ label: s = "", children: o, labelProps: e, ...a }, c)
|
|
|
38
39
|
),
|
|
39
40
|
style: e?.style,
|
|
40
41
|
children: [
|
|
41
|
-
/* @__PURE__ */ r(
|
|
42
|
+
/* @__PURE__ */ r(n, { ...a }),
|
|
42
43
|
/* @__PURE__ */ l("div", { className: "flex flex-col w-full gap-3", children: [
|
|
43
|
-
/* @__PURE__ */ r("span", { className: "flex flex-col justify-start leading-[16px]", children:
|
|
44
|
-
|
|
44
|
+
/* @__PURE__ */ r("span", { className: "flex flex-col justify-start leading-[16px]", children: o }),
|
|
45
|
+
s
|
|
45
46
|
] })
|
|
46
47
|
]
|
|
47
48
|
}
|
|
48
49
|
));
|
|
49
50
|
u.displayName = "CheckboxLabel";
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
+
n as Checkbox,
|
|
52
53
|
u as CheckboxLabel
|
|
53
54
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l, Fragment as j } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as W, useRef as X, useState as c, useEffect as _, useCallback as
|
|
2
|
+
import { forwardRef as W, useRef as X, useState as c, useEffect as _, useCallback as p, useMemo as O, useLayoutEffect as J } from "react";
|
|
3
|
+
import { LoadingMask as K } from "../LoadingMask/LoadingMask.js";
|
|
4
|
+
import "../LoadingMask/RenderLoadingMask.js";
|
|
5
|
+
import { Popover as Q, PopoverTrigger as Y, PopoverContent as Z } from "../Popover/Popover.js";
|
|
6
|
+
import { Button as $ } from "../Button/Button.js";
|
|
7
|
+
import "../Button/buttonVariants.js";
|
|
8
|
+
import { Command as ee, CommandInput as oe, CommandList as te, CommandGroup as ne, CommandEmpty as B, CommandItem as re } from "../Command/Command.js";
|
|
3
9
|
import { cn as L } from "@oneplatformdev/utils";
|
|
4
|
-
import { useDebounceCallback as
|
|
5
|
-
import { X as
|
|
6
|
-
import { ComboboxOptions as
|
|
7
|
-
|
|
8
|
-
import { Button as te } from "./ui15.js";
|
|
9
|
-
import { Command as ne, CommandInput as re, CommandList as ae, CommandGroup as se, CommandEmpty as B, CommandItem as le } from "./ui26.js";
|
|
10
|
-
import { LoadingMask as ie } from "./ui49.js";
|
|
11
|
-
const Ce = W(
|
|
10
|
+
import { useDebounceCallback as ae } from "@oneplatformdev/hooks";
|
|
11
|
+
import { X as se, ChevronsUpDown as le } from "lucide-react";
|
|
12
|
+
import { ComboboxOptions as ie } from "./ComboboxOptions.js";
|
|
13
|
+
const xe = W(
|
|
12
14
|
(D, T) => {
|
|
13
15
|
const {
|
|
14
|
-
value:
|
|
16
|
+
value: m,
|
|
15
17
|
onChange: A,
|
|
16
18
|
placeholder: I,
|
|
17
19
|
disabled: z,
|
|
@@ -19,7 +21,7 @@ const Ce = W(
|
|
|
19
21
|
fetchOptions: G,
|
|
20
22
|
options: u,
|
|
21
23
|
emptyLabel: S = "No options",
|
|
22
|
-
emptyAction:
|
|
24
|
+
emptyAction: d,
|
|
23
25
|
commandInputAction: f,
|
|
24
26
|
listHeadAction: h,
|
|
25
27
|
onMount: g
|
|
@@ -29,7 +31,7 @@ const Ce = W(
|
|
|
29
31
|
}, [u]);
|
|
30
32
|
const R = async () => {
|
|
31
33
|
a || (P(), C(""));
|
|
32
|
-
}, P =
|
|
34
|
+
}, P = p(async (o) => {
|
|
33
35
|
s(!0);
|
|
34
36
|
try {
|
|
35
37
|
const N = await G(o);
|
|
@@ -39,14 +41,14 @@ const Ce = W(
|
|
|
39
41
|
} finally {
|
|
40
42
|
s(!1);
|
|
41
43
|
}
|
|
42
|
-
}, []), U =
|
|
44
|
+
}, []), U = ae(P, 1e3, {
|
|
43
45
|
leading: !1,
|
|
44
46
|
trailing: !0
|
|
45
|
-
}), q =
|
|
47
|
+
}), q = p((o) => {
|
|
46
48
|
s(!0), C(o), U(o);
|
|
47
|
-
}, []), k =
|
|
49
|
+
}, []), k = p((o) => {
|
|
48
50
|
A(o.value), w(o), s(!1);
|
|
49
|
-
}, []), H =
|
|
51
|
+
}, []), H = p(() => {
|
|
50
52
|
k({ value: "", label: "" }), w(void 0), s(!1);
|
|
51
53
|
}, []), E = O(() => !!r && !t.length && !n, [n, t.length, r]), M = O(() => !t.length && !n, [n, t.length, r]), i = O(() => ({
|
|
52
54
|
options: t,
|
|
@@ -61,7 +63,7 @@ const Ce = W(
|
|
|
61
63
|
setLoading: s,
|
|
62
64
|
isEmptyList: M,
|
|
63
65
|
isSearchedEmptyList: E
|
|
64
|
-
}), [n, a, t, r, x, M, E]), V =
|
|
66
|
+
}), [n, a, t, r, x, M, E]), V = p(() => {
|
|
65
67
|
if (!g) {
|
|
66
68
|
b.current = !0;
|
|
67
69
|
return;
|
|
@@ -73,15 +75,15 @@ const Ce = W(
|
|
|
73
75
|
return J(() => (V(), () => {
|
|
74
76
|
b.current = !1;
|
|
75
77
|
}), []), /* @__PURE__ */ e("div", { className: "w-full", ref: T, children: /* @__PURE__ */ l(
|
|
76
|
-
|
|
78
|
+
Q,
|
|
77
79
|
{
|
|
78
80
|
open: a,
|
|
79
81
|
onOpenChange: (o) => {
|
|
80
82
|
y(o), o && R();
|
|
81
83
|
},
|
|
82
84
|
children: [
|
|
83
|
-
/* @__PURE__ */ e(
|
|
84
|
-
|
|
85
|
+
/* @__PURE__ */ e(Y, { asChild: !0, className: "border-input", children: /* @__PURE__ */ l(
|
|
86
|
+
$,
|
|
85
87
|
{
|
|
86
88
|
variant: "outline",
|
|
87
89
|
role: "combobox",
|
|
@@ -95,8 +97,8 @@ const Ce = W(
|
|
|
95
97
|
),
|
|
96
98
|
disabled: z,
|
|
97
99
|
children: [
|
|
98
|
-
/* @__PURE__ */ e("span", { className: "truncate max-w-[calc(100%-1.5rem)] overflow-hidden whitespace-nowrap", children:
|
|
99
|
-
|
|
100
|
+
/* @__PURE__ */ e("span", { className: "truncate max-w-[calc(100%-1.5rem)] overflow-hidden whitespace-nowrap", children: m ? t.find((o) => o.value === m)?.label || x?.label : /* @__PURE__ */ e("span", { className: "text-gray-400", children: I }) }),
|
|
101
|
+
m ? /* @__PURE__ */ e(
|
|
100
102
|
"div",
|
|
101
103
|
{
|
|
102
104
|
className: L(
|
|
@@ -108,20 +110,20 @@ const Ce = W(
|
|
|
108
110
|
onClick: (o) => {
|
|
109
111
|
o.stopPropagation(), H();
|
|
110
112
|
},
|
|
111
|
-
children: /* @__PURE__ */ e(
|
|
113
|
+
children: /* @__PURE__ */ e(se, {})
|
|
112
114
|
}
|
|
113
|
-
) : /* @__PURE__ */ e(
|
|
115
|
+
) : /* @__PURE__ */ e(le, { className: "opacity-50 w-4 h-4" })
|
|
114
116
|
]
|
|
115
117
|
}
|
|
116
118
|
) }),
|
|
117
119
|
/* @__PURE__ */ e(
|
|
118
|
-
|
|
120
|
+
Z,
|
|
119
121
|
{
|
|
120
122
|
className: "w-(--radix-popper-anchor-width) max-w-none p-0",
|
|
121
123
|
align: "start",
|
|
122
|
-
children: /* @__PURE__ */ l(
|
|
124
|
+
children: /* @__PURE__ */ l(ee, { shouldFilter: !1, children: [
|
|
123
125
|
/* @__PURE__ */ e(
|
|
124
|
-
|
|
126
|
+
oe,
|
|
125
127
|
{
|
|
126
128
|
placeholder: F,
|
|
127
129
|
value: r,
|
|
@@ -129,19 +131,19 @@ const Ce = W(
|
|
|
129
131
|
}
|
|
130
132
|
),
|
|
131
133
|
typeof f == "function" ? f(i) : f,
|
|
132
|
-
/* @__PURE__ */ e(
|
|
133
|
-
|
|
134
|
+
/* @__PURE__ */ e(te, { children: /* @__PURE__ */ l(
|
|
135
|
+
ne,
|
|
134
136
|
{
|
|
135
137
|
className: L(!t.length && "p-0 shadow-none"),
|
|
136
138
|
children: [
|
|
137
|
-
n && /* @__PURE__ */ e(
|
|
138
|
-
!n && !!r && /* @__PURE__ */ e(j, { children:
|
|
139
|
+
n && /* @__PURE__ */ e(K, { fullWidth: !0 }),
|
|
140
|
+
!n && !!r && /* @__PURE__ */ e(j, { children: d ? /* @__PURE__ */ l(B, { className: "flex flex-col gap-3 py-5 px-3 items-center", children: [
|
|
139
141
|
/* @__PURE__ */ e("span", { children: S }),
|
|
140
|
-
typeof
|
|
142
|
+
typeof d == "function" ? d(i) : d
|
|
141
143
|
] }) : /* @__PURE__ */ e(B, { children: S }) }),
|
|
142
144
|
!n && /* @__PURE__ */ l(j, { children: [
|
|
143
145
|
!!t.length && h && /* @__PURE__ */ e(
|
|
144
|
-
|
|
146
|
+
re,
|
|
145
147
|
{
|
|
146
148
|
asChild: !0,
|
|
147
149
|
className: "w-full",
|
|
@@ -150,9 +152,9 @@ const Ce = W(
|
|
|
150
152
|
"combobox-list-head-action"
|
|
151
153
|
),
|
|
152
154
|
/* @__PURE__ */ e(
|
|
153
|
-
|
|
155
|
+
ie,
|
|
154
156
|
{
|
|
155
|
-
value:
|
|
157
|
+
value: m,
|
|
156
158
|
options: t,
|
|
157
159
|
onChangeOption: k,
|
|
158
160
|
setOpen: y
|
|
@@ -171,5 +173,5 @@ const Ce = W(
|
|
|
171
173
|
}
|
|
172
174
|
);
|
|
173
175
|
export {
|
|
174
|
-
|
|
176
|
+
xe as Combobox
|
|
175
177
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IComboboxOptionsNodeProps } from '
|
|
1
|
+
import { IComboboxOptionsNodeProps } from './Combobox.types';
|
|
2
2
|
export declare const ComboboxOptionItem: import('react').ForwardRefExoticComponent<IComboboxOptionsNodeProps & {
|
|
3
3
|
children?: import('react').ReactNode | undefined;
|
|
4
4
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxOptionItem.d.ts","sourceRoot":"","sources":["../../src/Combobox/ComboboxOptionItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ComboboxOptionItem.d.ts","sourceRoot":"","sources":["../../src/Combobox/ComboboxOptionItem.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAM7D,eAAO,MAAM,kBAAkB;;kDAsC7B,CAAC"}
|
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
import { jsxs as s, jsx as
|
|
1
|
+
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as c } from "react";
|
|
3
|
-
|
|
4
|
-
import { Check as
|
|
5
|
-
import { cn as
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const { children: m, setOpen: n, option: e, onChangeOption: o, value: l = "", deep: p = 0 } = i;
|
|
3
|
+
import { CommandItem as f } from "../Command/Command.js";
|
|
4
|
+
import { Check as d } from "lucide-react";
|
|
5
|
+
import { cn as t } from "@oneplatformdev/utils";
|
|
6
|
+
const u = 8, C = c((i, n) => {
|
|
7
|
+
const { children: r, setOpen: m, option: e, onChangeOption: o, value: l = "", deep: p = 0 } = i;
|
|
9
8
|
return /* @__PURE__ */ s(
|
|
10
|
-
|
|
9
|
+
f,
|
|
11
10
|
{
|
|
12
|
-
ref:
|
|
11
|
+
ref: n,
|
|
13
12
|
value: e.value,
|
|
14
13
|
onSelect: () => {
|
|
15
|
-
l === e.value ? o?.({ value: "", label: "" }) : o?.(e),
|
|
14
|
+
l === e.value ? o?.({ value: "", label: "" }) : o?.(e), m(!1);
|
|
16
15
|
},
|
|
17
16
|
style: {
|
|
18
17
|
paddingLeft: (p + 1) * u
|
|
19
18
|
},
|
|
20
19
|
children: [
|
|
21
|
-
|
|
22
|
-
/* @__PURE__ */
|
|
20
|
+
r,
|
|
21
|
+
/* @__PURE__ */ a(
|
|
23
22
|
"span",
|
|
24
23
|
{
|
|
25
|
-
className:
|
|
24
|
+
className: t(
|
|
26
25
|
"overflow-hidden whitespace-wrap text-ellipsis line-clamp-2"
|
|
27
26
|
),
|
|
28
27
|
children: e.label
|
|
29
28
|
}
|
|
30
29
|
),
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
|
|
30
|
+
/* @__PURE__ */ a(
|
|
31
|
+
d,
|
|
33
32
|
{
|
|
34
|
-
className:
|
|
33
|
+
className: t(
|
|
35
34
|
"ml-auto",
|
|
36
35
|
l === e.value ? "opacity-100" : "opacity-0"
|
|
37
36
|
)
|
|
@@ -43,5 +42,5 @@ const u = 8, O = c((i, r) => {
|
|
|
43
42
|
);
|
|
44
43
|
});
|
|
45
44
|
export {
|
|
46
|
-
|
|
45
|
+
C as ComboboxOptionItem
|
|
47
46
|
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { Button as u } from "../Button/Button.js";
|
|
3
|
+
import "../Button/buttonVariants.js";
|
|
4
|
+
import { forwardRef as c, useState as h } from "react";
|
|
5
|
+
import { Collapsible as b, CollapsibleTrigger as g, CollapsibleContent as C } from "../Collapsible/Collapsible.js";
|
|
6
|
+
import { ComboboxOptionItem as p } from "./ComboboxOptionItem.js";
|
|
7
|
+
import { ChevronDownIcon as x } from "lucide-react";
|
|
8
|
+
import { cn as a } from "@oneplatformdev/utils";
|
|
9
|
+
const d = c((e, n) => {
|
|
10
|
+
const { option: s, deep: i = 0 } = e, [t, l] = h(!0);
|
|
11
|
+
return s?.items?.length ? /* @__PURE__ */ m(
|
|
12
|
+
b,
|
|
13
|
+
{
|
|
14
|
+
ref: n,
|
|
15
|
+
open: t,
|
|
16
|
+
onOpenChange: l,
|
|
17
|
+
"data-opened": t,
|
|
18
|
+
className: a("group/collapsible"),
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ o(p, { ...e, children: /* @__PURE__ */ o(g, { asChild: !0, children: /* @__PURE__ */ m(
|
|
21
|
+
u,
|
|
22
|
+
{
|
|
23
|
+
onClick: (r) => {
|
|
24
|
+
r?.preventDefault(), r?.stopPropagation(), l((f) => !f);
|
|
25
|
+
},
|
|
26
|
+
type: "button",
|
|
27
|
+
variant: "ghost",
|
|
28
|
+
size: "sm",
|
|
29
|
+
className: a("aspect-square size-6", "transition-transform"),
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ o(
|
|
32
|
+
x,
|
|
33
|
+
{
|
|
34
|
+
className: a(
|
|
35
|
+
"size-5!",
|
|
36
|
+
"transition-transform",
|
|
37
|
+
t && "rotate-180"
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ o("span", { className: "sr-only", children: "Toggle" })
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
) }) }),
|
|
45
|
+
/* @__PURE__ */ o(C, { children: /* @__PURE__ */ o("div", { className: "flex flex-col gap-0", children: s?.items.map((r) => /* @__PURE__ */ o(
|
|
46
|
+
d,
|
|
47
|
+
{
|
|
48
|
+
...e,
|
|
49
|
+
deep: i + 1,
|
|
50
|
+
option: r
|
|
51
|
+
},
|
|
52
|
+
r.value
|
|
53
|
+
)) }) })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
) : /* @__PURE__ */ o(p, { ...e, ref: n });
|
|
57
|
+
}), I = c((e, n) => {
|
|
58
|
+
const { options: s = [], ...i } = e;
|
|
59
|
+
return /* @__PURE__ */ o("div", { ref: n, className: "flex flex-col gap-0", children: s.map((t) => /* @__PURE__ */ o(d, { ...i, option: t }, t.value)) });
|
|
60
|
+
});
|
|
61
|
+
export {
|
|
62
|
+
I as ComboboxOptions,
|
|
63
|
+
d as ComboboxOptionsNode
|
|
64
|
+
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import * as m from "react";
|
|
3
3
|
import { Command as t } from "cmdk";
|
|
4
4
|
import { SearchIcon as p } from "lucide-react";
|
|
5
5
|
import { cn as r } from "@oneplatformdev/utils";
|
|
6
|
-
import { Dialog as i, DialogContent as l } from "
|
|
7
|
-
|
|
6
|
+
import { Dialog as i, DialogContent as l } from "../Dialog/Dialog.js";
|
|
7
|
+
import "../Dialog/DialogOverlayScope.js";
|
|
8
|
+
const n = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ o(
|
|
8
9
|
t,
|
|
9
10
|
{
|
|
10
|
-
ref:
|
|
11
|
+
ref: d,
|
|
11
12
|
className: r(
|
|
12
13
|
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
13
14
|
e
|
|
@@ -16,12 +17,12 @@ const n = m.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ d(
|
|
|
16
17
|
}
|
|
17
18
|
));
|
|
18
19
|
n.displayName = t.displayName;
|
|
19
|
-
const
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
20
|
+
const b = ({ children: e, ...a }) => /* @__PURE__ */ o(i, { ...a, children: /* @__PURE__ */ o(l, { className: "overflow-hidden p-0", children: /* @__PURE__ */ o(n, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: e }) }) }), c = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ s("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
21
|
+
/* @__PURE__ */ o(p, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
22
|
+
/* @__PURE__ */ o(
|
|
22
23
|
t.Input,
|
|
23
24
|
{
|
|
24
|
-
ref:
|
|
25
|
+
ref: d,
|
|
25
26
|
className: r(
|
|
26
27
|
"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
27
28
|
e
|
|
@@ -31,16 +32,16 @@ const C = ({ children: e, ...a }) => /* @__PURE__ */ d(i, { ...a, children: /* @
|
|
|
31
32
|
)
|
|
32
33
|
] }));
|
|
33
34
|
c.displayName = t.Input.displayName;
|
|
34
|
-
const u = m.forwardRef(({ className: e, ...a },
|
|
35
|
+
const u = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ o(
|
|
35
36
|
t.List,
|
|
36
37
|
{
|
|
37
|
-
ref:
|
|
38
|
+
ref: d,
|
|
38
39
|
className: r("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
|
|
39
40
|
...a
|
|
40
41
|
}
|
|
41
42
|
));
|
|
42
43
|
u.displayName = t.List.displayName;
|
|
43
|
-
const f = m.forwardRef((e, a) => /* @__PURE__ */
|
|
44
|
+
const f = m.forwardRef((e, a) => /* @__PURE__ */ o(
|
|
44
45
|
t.Empty,
|
|
45
46
|
{
|
|
46
47
|
ref: a,
|
|
@@ -49,10 +50,10 @@ const f = m.forwardRef((e, a) => /* @__PURE__ */ d(
|
|
|
49
50
|
}
|
|
50
51
|
));
|
|
51
52
|
f.displayName = t.Empty.displayName;
|
|
52
|
-
const g = m.forwardRef(({ className: e, ...a },
|
|
53
|
+
const g = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ o(
|
|
53
54
|
t.Group,
|
|
54
55
|
{
|
|
55
|
-
ref:
|
|
56
|
+
ref: d,
|
|
56
57
|
className: r(
|
|
57
58
|
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
58
59
|
e
|
|
@@ -61,19 +62,19 @@ const g = m.forwardRef(({ className: e, ...a }, o) => /* @__PURE__ */ d(
|
|
|
61
62
|
}
|
|
62
63
|
));
|
|
63
64
|
g.displayName = t.Group.displayName;
|
|
64
|
-
const x = m.forwardRef(({ className: e, ...a },
|
|
65
|
+
const x = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ o(
|
|
65
66
|
t.Separator,
|
|
66
67
|
{
|
|
67
|
-
ref:
|
|
68
|
+
ref: d,
|
|
68
69
|
className: r("-mx-1 h-px bg-border", e),
|
|
69
70
|
...a
|
|
70
71
|
}
|
|
71
72
|
));
|
|
72
73
|
x.displayName = t.Separator.displayName;
|
|
73
|
-
const h = m.forwardRef(({ className: e, ...a },
|
|
74
|
+
const h = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ o(
|
|
74
75
|
t.Item,
|
|
75
76
|
{
|
|
76
|
-
ref:
|
|
77
|
+
ref: d,
|
|
77
78
|
className: r(
|
|
78
79
|
"relative flex gap-2 select-none items-center rounded-sm",
|
|
79
80
|
"min-h-8 px-2 py-1",
|
|
@@ -92,7 +93,7 @@ h.displayName = t.Item.displayName;
|
|
|
92
93
|
const y = ({
|
|
93
94
|
className: e,
|
|
94
95
|
...a
|
|
95
|
-
}) => /* @__PURE__ */
|
|
96
|
+
}) => /* @__PURE__ */ o(
|
|
96
97
|
"span",
|
|
97
98
|
{
|
|
98
99
|
className: r(
|
|
@@ -105,7 +106,7 @@ const y = ({
|
|
|
105
106
|
y.displayName = "CommandShortcut";
|
|
106
107
|
export {
|
|
107
108
|
n as Command,
|
|
108
|
-
|
|
109
|
+
b as CommandDialog,
|
|
109
110
|
f as CommandEmpty,
|
|
110
111
|
g as CommandGroup,
|
|
111
112
|
c as CommandInput,
|
package/Command/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command as a, CommandDialog as n, CommandEmpty as d, CommandGroup as C, CommandInput as t, CommandItem as r, CommandList as p, CommandSeparator as e, CommandShortcut as u } from "./Command.js";
|
|
2
|
+
export {
|
|
3
|
+
a as Command,
|
|
4
|
+
n as CommandDialog,
|
|
5
|
+
d as CommandEmpty,
|
|
6
|
+
C as CommandGroup,
|
|
7
|
+
t as CommandInput,
|
|
8
|
+
r as CommandItem,
|
|
9
|
+
p as CommandList,
|
|
10
|
+
e as CommandSeparator,
|
|
11
|
+
u as CommandShortcut
|
|
12
|
+
};
|