@oneplatformdev/ui 0.0.1-beta.116 → 0.0.1-beta.118

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.
@@ -9,7 +9,7 @@ import "../Command/Command.mjs";
9
9
  import "@oneplatformdev/utils";
10
10
  import "@oneplatformdev/hooks";
11
11
  import "lucide-react";
12
- import { C as c } from "../Combobox-BzFTeSHQ.js";
12
+ import { C as c } from "../Combobox-CkGEIfTD.js";
13
13
  export {
14
14
  c as Combobox
15
15
  };
@@ -20,7 +20,7 @@ import "../Card/Card.mjs";
20
20
  import "../Carousel/Carousel.mjs";
21
21
  import "../Checkbox/Checkbox.mjs";
22
22
  import "@radix-ui/react-collapsible";
23
- import { a as so } from "../Combobox-BzFTeSHQ.js";
23
+ import { a as Co } from "../Combobox-CkGEIfTD.js";
24
24
  import "../Command/Command.mjs";
25
25
  import "../DropdownMenu/DropdownMenu.mjs";
26
26
  import "../Table/Table.mjs";
@@ -28,6 +28,7 @@ import "@tanstack/react-table";
28
28
  import "lucide-react";
29
29
  import "../DatePicker/DatePicker.mjs";
30
30
  import "../Dialog/Dialog.mjs";
31
+ import "../Dialog/DialogOverlayScope.mjs";
31
32
  import "../Drawer/Drawer.mjs";
32
33
  import "../Form/Form.mjs";
33
34
  import "../FormInput/FormInput.mjs";
@@ -64,5 +65,5 @@ import "../ToggleGroup/ToggleGroup.mjs";
64
65
  import "../Tooltip/TooltipRoot.mjs";
65
66
  import "../Dropzone/Dropzone.mjs";
66
67
  export {
67
- so as ComboboxOptionItem
68
+ Co as ComboboxOptionItem
68
69
  };
@@ -3,7 +3,7 @@ import "../Button/Button.mjs";
3
3
  import "../Button/buttonVariants.mjs";
4
4
  import "react";
5
5
  import "../Collapsible/Collapsible.mjs";
6
- import { c as a, b as e } from "../Combobox-BzFTeSHQ.js";
6
+ import { c as a, b as e } from "../Combobox-CkGEIfTD.js";
7
7
  import "lucide-react";
8
8
  import "@oneplatformdev/utils";
9
9
  export {
@@ -1,4 +1,4 @@
1
- import { C as m } from "../Combobox-BzFTeSHQ.js";
1
+ import { C as m } from "../Combobox-CkGEIfTD.js";
2
2
  export {
3
3
  m as Combobox
4
4
  };
@@ -32,6 +32,7 @@ import "./Table/Table.mjs";
32
32
  import "@tanstack/react-table";
33
33
  import "./DatePicker/DatePicker.mjs";
34
34
  import "./Dialog/Dialog.mjs";
35
+ import "./Dialog/DialogOverlayScope.mjs";
35
36
  import "./Drawer/Drawer.mjs";
36
37
  import "./Form/Form.mjs";
37
38
  import "./FormInput/FormInput.mjs";
@@ -153,7 +154,7 @@ const ge = 8, U = S((a, m) => {
153
154
  }), be = S((a, m) => {
154
155
  const { options: t = [], ...d } = a;
155
156
  return /* @__PURE__ */ e("div", { ref: m, className: "flex flex-col gap-0", children: t.map((o) => /* @__PURE__ */ e(V, { ...d, option: o }, o.value)) });
156
- }), Dt = S(
157
+ }), Tt = S(
157
158
  (a, m) => {
158
159
  var q;
159
160
  const {
@@ -317,7 +318,7 @@ const ge = 8, U = S((a, m) => {
317
318
  }
318
319
  );
319
320
  export {
320
- Dt as C,
321
+ Tt as C,
321
322
  U as a,
322
323
  V as b,
323
324
  be as c
@@ -4,6 +4,7 @@ import { Command as o } from "cmdk";
4
4
  import { SearchIcon as p } from "lucide-react";
5
5
  import { cn as r } from "@oneplatformdev/utils";
6
6
  import { Dialog as i, DialogContent as l } from "../Dialog/Dialog.mjs";
7
+ import "../Dialog/DialogOverlayScope.mjs";
7
8
  const n = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ t(
8
9
  o,
9
10
  {
@@ -16,7 +17,7 @@ const n = m.forwardRef(({ className: e, ...a }, d) => /* @__PURE__ */ t(
16
17
  }
17
18
  ));
18
19
  n.displayName = o.displayName;
19
- const C = ({ children: e, ...a }) => /* @__PURE__ */ t(i, { ...a, children: /* @__PURE__ */ t(l, { className: "overflow-hidden p-0", children: /* @__PURE__ */ t(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: [
20
+ const b = ({ children: e, ...a }) => /* @__PURE__ */ t(i, { ...a, children: /* @__PURE__ */ t(l, { className: "overflow-hidden p-0", children: /* @__PURE__ */ t(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: [
20
21
  /* @__PURE__ */ t(p, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
21
22
  /* @__PURE__ */ t(
22
23
  o.Input,
@@ -105,7 +106,7 @@ const y = ({
105
106
  y.displayName = "CommandShortcut";
106
107
  export {
107
108
  n as Command,
108
- C as CommandDialog,
109
+ b as CommandDialog,
109
110
  f as CommandEmpty,
110
111
  g as CommandGroup,
111
112
  c as CommandInput,
@@ -7,6 +7,7 @@ declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.Dialo
7
7
  declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
8
  declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
9
9
  showCloseButton?: boolean;
10
+ preventAutoFocus?: boolean;
10
11
  } & React.RefAttributes<HTMLDivElement>>;
11
12
  declare const DialogHeader: {
12
13
  ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
package/Dialog/Dialog.mjs CHANGED
@@ -1,121 +1,136 @@
1
- import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
- import * as l from "react";
1
+ import { jsx as o, jsxs as n } from "react/jsx-runtime";
2
+ import * as i from "react";
3
+ import { useRef as y, useState as N, useLayoutEffect as D } from "react";
3
4
  import * as e from "@radix-ui/react-dialog";
4
- import { XIcon as g } from "lucide-react";
5
- import { cn as i } from "@oneplatformdev/utils";
6
- const v = e.Root, C = e.Trigger, p = e.Portal, R = e.Close, n = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
5
+ import { XIcon as h } from "lucide-react";
6
+ import { cn as l } from "@oneplatformdev/utils";
7
+ import { DialogOverlayScope as b } from "./DialogOverlayScope.mjs";
8
+ const S = e.Root, F = e.Trigger, v = e.Portal, q = e.Close, m = i.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
7
9
  e.Overlay,
8
10
  {
9
11
  ref: s,
10
- className: i(
12
+ className: l(
11
13
  "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
12
- a
14
+ t
13
15
  ),
14
- ...t
16
+ ...a
15
17
  }
16
18
  ));
17
- n.displayName = e.Overlay.displayName;
18
- const u = l.forwardRef(({ className: a, children: t, showCloseButton: s = !0, onOpenAutoFocus: r, ...c }, m) => /* @__PURE__ */ d(p, { children: [
19
- /* @__PURE__ */ o(n, {}),
20
- /* @__PURE__ */ d(
21
- e.Content,
22
- {
23
- ref: m,
24
- className: i(
25
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg",
26
- "duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
27
- "max-w-[90%] max-h-[90%] overflow-hidden",
28
- "bg-[#FCFCFC] border border-[#E8E9EB] rounded-[16px]",
29
- a
30
- ),
31
- onOpenAutoFocus: (f) => r == null ? void 0 : r(f),
32
- ...c,
33
- children: [
34
- t,
35
- s && /* @__PURE__ */ d(
36
- e.Close,
37
- {
38
- "aria-label": "Close",
39
- className: i(
40
- "absolute right-4 top-4 rounded-sm ring-offset-background w-10 aspect-square",
41
- "flex items-center justify-center",
42
- "data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
43
- "opacity-70 hover:opacity-100",
44
- // 'focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
45
- "focus:outline-none focus:ring-0 focus:ring-ring focus:ring-offset-2",
46
- "hover:bg-accent",
47
- "disabled:pointer-events-none",
48
- "transition-opacity"
49
- ),
50
- children: [
51
- /* @__PURE__ */ o(g, { className: "h-4 w-4" }),
52
- /* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
53
- ]
54
- }
55
- )
56
- ]
57
- }
58
- )
59
- ] }));
60
- u.displayName = e.Content.displayName;
61
- const x = ({
62
- className: a,
63
- ...t
19
+ m.displayName = e.Overlay.displayName;
20
+ const w = i.forwardRef(
21
+ ({
22
+ className: t,
23
+ children: a,
24
+ showCloseButton: s = !0,
25
+ onOpenAutoFocus: r,
26
+ preventAutoFocus: f,
27
+ ...p
28
+ }, g) => {
29
+ const d = y(null), [u, x] = N(null);
30
+ return D(() => x(d.current), []), /* @__PURE__ */ n(v, { children: [
31
+ /* @__PURE__ */ o(m, {}),
32
+ /* @__PURE__ */ o("div", { ref: d, className: "fixed inset-0 z-40" }),
33
+ /* @__PURE__ */ o(b, { value: u, children: /* @__PURE__ */ n(
34
+ e.Content,
35
+ {
36
+ ref: g,
37
+ className: l(
38
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg",
39
+ "duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
40
+ "max-w-[90%] max-h-[90%] overflow-hidden",
41
+ "bg-[#FCFCFC] border border-[#E8E9EB] rounded-[16px]",
42
+ t
43
+ ),
44
+ onOpenAutoFocus: (c) => (f && c.preventDefault(), r == null ? void 0 : r(c)),
45
+ ...p,
46
+ children: [
47
+ a,
48
+ s && /* @__PURE__ */ n(
49
+ e.Close,
50
+ {
51
+ "aria-label": "Close",
52
+ className: l(
53
+ "absolute right-4 top-4 rounded-sm ring-offset-background w-10 aspect-square",
54
+ "flex items-center justify-center",
55
+ "data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
56
+ "opacity-70 hover:opacity-100",
57
+ // 'focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
58
+ "focus:outline-none focus:ring-0 focus:ring-ring focus:ring-offset-2",
59
+ "hover:bg-accent",
60
+ "disabled:pointer-events-none",
61
+ "transition-opacity"
62
+ ),
63
+ children: [
64
+ /* @__PURE__ */ o(h, { className: "h-4 w-4" }),
65
+ /* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
66
+ ]
67
+ }
68
+ )
69
+ ]
70
+ }
71
+ ) })
72
+ ] });
73
+ }
74
+ );
75
+ w.displayName = e.Content.displayName;
76
+ const C = ({
77
+ className: t,
78
+ ...a
64
79
  }) => /* @__PURE__ */ o(
65
80
  "div",
66
81
  {
67
- className: i(
82
+ className: l(
68
83
  "flex flex-col space-y-1.5 text-center sm:text-left",
69
- a
84
+ t
70
85
  ),
71
- ...t
86
+ ...a
72
87
  }
73
88
  );
74
- x.displayName = "DialogHeader";
75
- const y = ({
76
- className: a,
77
- ...t
89
+ C.displayName = "DialogHeader";
90
+ const R = ({
91
+ className: t,
92
+ ...a
78
93
  }) => /* @__PURE__ */ o(
79
94
  "div",
80
95
  {
81
- className: i(
96
+ className: l(
82
97
  "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
83
- a
98
+ t
84
99
  ),
85
- ...t
100
+ ...a
86
101
  }
87
102
  );
88
- y.displayName = "DialogFooter";
89
- const N = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
103
+ R.displayName = "DialogFooter";
104
+ const E = i.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
90
105
  e.Title,
91
106
  {
92
107
  ref: s,
93
- className: i(
108
+ className: l(
94
109
  "text-lg font-semibold leading-none tracking-tight",
95
- a
110
+ t
96
111
  ),
97
- ...t
112
+ ...a
98
113
  }
99
114
  ));
100
- N.displayName = e.Title.displayName;
101
- const b = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
115
+ E.displayName = e.Title.displayName;
116
+ const z = i.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
102
117
  e.Description,
103
118
  {
104
119
  ref: s,
105
- className: i("text-sm text-muted-foreground", a),
106
- ...t
120
+ className: l("text-sm text-muted-foreground", t),
121
+ ...a
107
122
  }
108
123
  ));
109
- b.displayName = e.Description.displayName;
124
+ z.displayName = e.Description.displayName;
110
125
  export {
111
- v as Dialog,
112
- R as DialogClose,
113
- u as DialogContent,
114
- b as DialogDescription,
115
- y as DialogFooter,
116
- x as DialogHeader,
117
- n as DialogOverlay,
118
- p as DialogPortal,
119
- N as DialogTitle,
120
- C as DialogTrigger
126
+ S as Dialog,
127
+ q as DialogClose,
128
+ w as DialogContent,
129
+ z as DialogDescription,
130
+ R as DialogFooter,
131
+ C as DialogHeader,
132
+ m as DialogOverlay,
133
+ v as DialogPortal,
134
+ E as DialogTitle,
135
+ F as DialogTrigger
121
136
  };
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren } from 'react';
2
+
3
+ interface IDialogOverlayScopeProps extends PropsWithChildren {
4
+ value: HTMLElement | null;
5
+ }
6
+ export declare const DialogOverlayScope: ({ value, children }: IDialogOverlayScopeProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const useDialogOverlayContainer: () => HTMLElement | null;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { createContext as n, useContext as a } from "react";
3
+ const o = n(null), s = ({ value: e, children: r }) => /* @__PURE__ */ t(o.Provider, { value: e, children: r }), c = () => a(o);
4
+ export {
5
+ s as DialogOverlayScope,
6
+ c as useDialogOverlayContainer
7
+ };
package/Dialog/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './Dialog';
2
+ export { useDialogOverlayContainer } from './DialogOverlayScope';
package/Dialog/index.mjs CHANGED
@@ -1,13 +1,15 @@
1
- import { Dialog as l, DialogClose as a, DialogContent as g, DialogDescription as D, DialogFooter as e, DialogHeader as r, DialogOverlay as t, DialogPortal as n, DialogTitle as p, DialogTrigger as s } from "./Dialog.mjs";
1
+ import { Dialog as i, DialogClose as l, DialogContent as e, DialogDescription as g, DialogFooter as r, DialogHeader as D, DialogOverlay as t, DialogPortal as n, DialogTitle as p, DialogTrigger as s } from "./Dialog.mjs";
2
+ import { useDialogOverlayContainer as f } from "./DialogOverlayScope.mjs";
2
3
  export {
3
- l as Dialog,
4
- a as DialogClose,
5
- g as DialogContent,
6
- D as DialogDescription,
7
- e as DialogFooter,
8
- r as DialogHeader,
4
+ i as Dialog,
5
+ l as DialogClose,
6
+ e as DialogContent,
7
+ g as DialogDescription,
8
+ r as DialogFooter,
9
+ D as DialogHeader,
9
10
  t as DialogOverlay,
10
11
  n as DialogPortal,
11
12
  p as DialogTitle,
12
- s as DialogTrigger
13
+ s as DialogTrigger,
14
+ f as useDialogOverlayContainer
13
15
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { FormControl as a } from "../Form/Form.mjs";
3
3
  import { FormRenderControl as b } from "../Form/FormRenderControl.mjs";
4
- import { C as p } from "../Combobox-BzFTeSHQ.js";
4
+ import { C as p } from "../Combobox-CkGEIfTD.js";
5
5
  const x = (m) => {
6
6
  const { form: n, label: e, name: t, ...C } = m;
7
7
  return /* @__PURE__ */ o(
@@ -1,28 +1,33 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import * as s from "react";
2
+ import * as m from "react";
3
3
  import * as o from "@radix-ui/react-popover";
4
- import { cn as m } from "@oneplatformdev/utils";
5
- const c = o.Root, v = o.Trigger, g = o.Anchor, p = s.forwardRef(({ className: e, align: a = "center", sideOffset: r = 4, style: d, ...n }, i) => /* @__PURE__ */ t(o.Portal, { children: /* @__PURE__ */ t(
6
- o.Content,
7
- {
8
- ref: i,
9
- align: a,
10
- sideOffset: r,
11
- className: m(
12
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",
13
- e
14
- ),
15
- style: {
16
- pointerEvents: "auto",
17
- ...d
18
- },
19
- ...n
20
- }
21
- ) }));
22
- p.displayName = o.Content.displayName;
4
+ import { cn as p } from "@oneplatformdev/utils";
5
+ import "../Dialog/Dialog.mjs";
6
+ import { useDialogOverlayContainer as l } from "../Dialog/DialogOverlayScope.mjs";
7
+ const P = o.Root, h = o.Trigger, b = o.Anchor, c = m.forwardRef(({ className: e, align: a = "center", sideOffset: r = 4, style: n, ...i }, d) => {
8
+ const s = l();
9
+ return /* @__PURE__ */ t(o.Portal, { container: s ?? void 0, children: /* @__PURE__ */ t(
10
+ o.Content,
11
+ {
12
+ ref: d,
13
+ align: a,
14
+ sideOffset: r,
15
+ className: p(
16
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",
17
+ e
18
+ ),
19
+ style: {
20
+ pointerEvents: "auto",
21
+ ...n
22
+ },
23
+ ...i
24
+ }
25
+ ) });
26
+ });
27
+ c.displayName = o.Content.displayName;
23
28
  export {
24
- c as Popover,
25
- g as PopoverAnchor,
26
- p as PopoverContent,
27
- v as PopoverTrigger
29
+ P as Popover,
30
+ b as PopoverAnchor,
31
+ c as PopoverContent,
32
+ h as PopoverTrigger
28
33
  };