@oneplatformdev/ui 0.0.1-beta.115 → 0.0.1-beta.117

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,9 +1,10 @@
1
1
  import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
2
  import * as l from "react";
3
3
  import * as e from "@radix-ui/react-dialog";
4
- import { XIcon as p } from "lucide-react";
4
+ import { XIcon as g } from "lucide-react";
5
5
  import { cn as i } from "@oneplatformdev/utils";
6
- const v = e.Root, C = e.Trigger, g = e.Portal, R = e.Close, c = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
6
+ import { DialogOverlayScope as u } from "./DialogOverlayScope.mjs";
7
+ const T = e.Root, j = e.Trigger, x = e.Portal, k = e.Close, c = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
7
8
  e.Overlay,
8
9
  {
9
10
  ref: s,
@@ -15,12 +16,12 @@ const v = e.Root, C = e.Trigger, g = e.Portal, R = e.Close, c = l.forwardRef(({
15
16
  }
16
17
  ));
17
18
  c.displayName = e.Overlay.displayName;
18
- const u = l.forwardRef(({ className: a, children: t, showCloseButton: s = !0, onOpenAutoFocus: r, ...m }, f) => /* @__PURE__ */ d(g, { children: [
19
+ const y = l.forwardRef(({ className: a, children: t, showCloseButton: s = !0, onOpenAutoFocus: r, preventAutoFocus: m, ...f }, p) => /* @__PURE__ */ d(x, { children: [
19
20
  /* @__PURE__ */ o(c, {}),
20
21
  /* @__PURE__ */ d(
21
22
  e.Content,
22
23
  {
23
- ref: f,
24
+ ref: p,
24
25
  className: i(
25
26
  "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
27
  "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",
@@ -28,10 +29,10 @@ const u = l.forwardRef(({ className: a, children: t, showCloseButton: s = !0, on
28
29
  "bg-[#FCFCFC] border border-[#E8E9EB] rounded-[16px]",
29
30
  a
30
31
  ),
31
- onOpenAutoFocus: (n) => (n.preventDefault(), r == null ? void 0 : r(n)),
32
- ...m,
32
+ onOpenAutoFocus: (n) => (m && n.preventDefault(), r == null ? void 0 : r(n)),
33
+ ...f,
33
34
  children: [
34
- t,
35
+ /* @__PURE__ */ o(u, { children: t }),
35
36
  s && /* @__PURE__ */ d(
36
37
  e.Close,
37
38
  {
@@ -41,13 +42,14 @@ const u = l.forwardRef(({ className: a, children: t, showCloseButton: s = !0, on
41
42
  "flex items-center justify-center",
42
43
  "data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
43
44
  "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-2 focus:ring-ring focus:ring-offset-2',
46
+ "focus:outline-none focus:ring-0 focus:ring-ring focus:ring-offset-2",
45
47
  "hover:bg-accent",
46
48
  "disabled:pointer-events-none",
47
49
  "transition-opacity"
48
50
  ),
49
51
  children: [
50
- /* @__PURE__ */ o(p, { className: "h-4 w-4" }),
52
+ /* @__PURE__ */ o(g, { className: "h-4 w-4" }),
51
53
  /* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
52
54
  ]
53
55
  }
@@ -56,8 +58,8 @@ const u = l.forwardRef(({ className: a, children: t, showCloseButton: s = !0, on
56
58
  }
57
59
  )
58
60
  ] }));
59
- u.displayName = e.Content.displayName;
60
- const x = ({
61
+ y.displayName = e.Content.displayName;
62
+ const N = ({
61
63
  className: a,
62
64
  ...t
63
65
  }) => /* @__PURE__ */ o(
@@ -70,8 +72,8 @@ const x = ({
70
72
  ...t
71
73
  }
72
74
  );
73
- x.displayName = "DialogHeader";
74
- const y = ({
75
+ N.displayName = "DialogHeader";
76
+ const D = ({
75
77
  className: a,
76
78
  ...t
77
79
  }) => /* @__PURE__ */ o(
@@ -84,8 +86,8 @@ const y = ({
84
86
  ...t
85
87
  }
86
88
  );
87
- y.displayName = "DialogFooter";
88
- const N = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
89
+ D.displayName = "DialogFooter";
90
+ const b = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
89
91
  e.Title,
90
92
  {
91
93
  ref: s,
@@ -96,8 +98,8 @@ const N = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
96
98
  ...t
97
99
  }
98
100
  ));
99
- N.displayName = e.Title.displayName;
100
- const D = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
101
+ b.displayName = e.Title.displayName;
102
+ const h = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
101
103
  e.Description,
102
104
  {
103
105
  ref: s,
@@ -105,16 +107,16 @@ const D = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
105
107
  ...t
106
108
  }
107
109
  ));
108
- D.displayName = e.Description.displayName;
110
+ h.displayName = e.Description.displayName;
109
111
  export {
110
- v as Dialog,
111
- R as DialogClose,
112
- u as DialogContent,
113
- D as DialogDescription,
114
- y as DialogFooter,
115
- x as DialogHeader,
112
+ T as Dialog,
113
+ k as DialogClose,
114
+ y as DialogContent,
115
+ h as DialogDescription,
116
+ D as DialogFooter,
117
+ N as DialogHeader,
116
118
  c as DialogOverlay,
117
- g as DialogPortal,
118
- N as DialogTitle,
119
- C as DialogTrigger
119
+ x as DialogPortal,
120
+ b as DialogTitle,
121
+ j as DialogTrigger
120
122
  };
@@ -0,0 +1,4 @@
1
+ import { PropsWithChildren } from 'react';
2
+
3
+ export declare const DialogOverlayScope: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const useDialogOverlayContainer: () => HTMLElement | null;
@@ -0,0 +1,10 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { createContext as a, useRef as s, useState as c, useLayoutEffect as u, useContext as i } from "react";
3
+ const o = a(null), m = ({ children: r }) => {
4
+ const e = s(null), [n, l] = c(null);
5
+ return u(() => l(e.current), []), /* @__PURE__ */ t("div", { ref: e, "data-overlay-scope": !0, className: "contents", children: /* @__PURE__ */ t(o.Provider, { value: n, children: r }) });
6
+ }, p = () => i(o);
7
+ export {
8
+ m as DialogOverlayScope,
9
+ p as useDialogOverlayContainer
10
+ };
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
  };