@oneplatformdev/ui 0.0.1-beta.130 → 0.0.1-beta.131

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/Dialog/Dialog.mjs CHANGED
@@ -1,144 +1,130 @@
1
- import { jsx as o, jsxs as c } from "react/jsx-runtime";
2
- import i, { useRef as D, useMemo as h, useState as v, useEffect as b } from "react";
1
+ import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
+ import l from "react";
3
3
  import * as e from "@radix-ui/react-dialog";
4
- import { XIcon as C } from "lucide-react";
5
- import { cn as n, composeRefs as w } from "@oneplatformdev/utils";
6
- import { DialogOverlayScope as E } from "./DialogOverlayScope.mjs";
7
- const q = e.Root, B = e.Trigger, R = e.Portal, M = e.Close, g = i.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
4
+ import { XIcon as g } from "lucide-react";
5
+ import { cn as i } from "@oneplatformdev/utils";
6
+ const R = e.Root, T = e.Trigger, u = e.Portal, j = e.Close, c = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
8
7
  e.Overlay,
9
8
  {
10
9
  ref: s,
11
- className: n(
10
+ className: i(
12
11
  "fixed inset-0 z-40 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",
13
- t
12
+ a
14
13
  ),
15
- ...a
14
+ ...t
16
15
  }
17
16
  ));
18
- g.displayName = e.Overlay.displayName;
19
- const z = i.forwardRef(
17
+ c.displayName = e.Overlay.displayName;
18
+ const x = l.forwardRef(
20
19
  ({
21
- className: t,
22
- children: a,
20
+ className: a,
21
+ children: t,
23
22
  showCloseButton: s = !0,
24
- onOpenAutoFocus: d,
25
- preventAutoFocus: u,
26
- ...y
27
- }, m) => {
28
- const f = D(null), x = h(
29
- () => w(m, f),
30
- [m]
31
- ), [N, p] = v(null);
32
- return b(() => {
33
- const r = f.current;
34
- if (!r || !r.parentElement) return;
35
- const l = document.createElement("div");
36
- return l.dataset.overlayHost = "", l.style.position = "fixed", l.style.inset = "0", l.style.zIndex = "80", r.parentElement.appendChild(l), p(l), () => {
37
- l.remove(), p(null);
38
- };
39
- }, []), /* @__PURE__ */ c(R, { children: [
40
- /* @__PURE__ */ o(g, {}),
41
- /* @__PURE__ */ c(
42
- e.Content,
43
- {
44
- ref: x,
45
- className: n(
46
- "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",
47
- "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",
48
- "max-w-[90%] max-h-[90%] overflow-hidden",
49
- "bg-[#FCFCFC] border border-[#E8E9EB] rounded-[16px]",
50
- t
51
- ),
52
- onOpenAutoFocus: (r) => (u && r.preventDefault(), d == null ? void 0 : d(r)),
53
- ...y,
54
- children: [
55
- /* @__PURE__ */ o(E, { value: N, children: a }),
56
- s && /* @__PURE__ */ c(
57
- e.Close,
58
- {
59
- "aria-label": "Close",
60
- className: n(
61
- "absolute right-4 top-4 rounded-sm ring-offset-background w-10 aspect-square",
62
- "flex items-center justify-center",
63
- "data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
64
- "opacity-70 hover:opacity-100",
65
- // 'focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
66
- "focus:outline-none focus:ring-0 focus:ring-ring focus:ring-offset-2",
67
- "hover:bg-accent",
68
- "disabled:pointer-events-none",
69
- "transition-opacity"
70
- ),
71
- children: [
72
- /* @__PURE__ */ o(C, { className: "h-4 w-4" }),
73
- /* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
74
- ]
75
- }
76
- )
77
- ]
78
- }
79
- )
80
- ] });
81
- }
23
+ onOpenAutoFocus: r,
24
+ preventAutoFocus: m,
25
+ ...f
26
+ }, p) => /* @__PURE__ */ d(u, { children: [
27
+ /* @__PURE__ */ o(c, {}),
28
+ /* @__PURE__ */ d(
29
+ e.Content,
30
+ {
31
+ ref: p,
32
+ className: i(
33
+ "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",
34
+ "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",
35
+ "max-w-[90%] max-h-[90%] overflow-hidden",
36
+ "bg-[#FCFCFC] border border-[#E8E9EB] rounded-[16px]",
37
+ a
38
+ ),
39
+ onOpenAutoFocus: (n) => (m && n.preventDefault(), r == null ? void 0 : r(n)),
40
+ ...f,
41
+ children: [
42
+ t,
43
+ s && /* @__PURE__ */ d(
44
+ e.Close,
45
+ {
46
+ "aria-label": "Close",
47
+ className: i(
48
+ "absolute right-4 top-4 rounded-sm ring-offset-background w-10 aspect-square",
49
+ "flex items-center justify-center",
50
+ "data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
51
+ "opacity-70 hover:opacity-100",
52
+ // 'focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
53
+ "focus:outline-none focus:ring-0 focus:ring-ring focus:ring-offset-2",
54
+ "hover:bg-accent",
55
+ "disabled:pointer-events-none",
56
+ "transition-opacity"
57
+ ),
58
+ children: [
59
+ /* @__PURE__ */ o(g, { className: "h-4 w-4" }),
60
+ /* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
61
+ ]
62
+ }
63
+ )
64
+ ]
65
+ }
66
+ )
67
+ ] })
82
68
  );
83
- z.displayName = e.Content.displayName;
84
- const T = ({
85
- className: t,
86
- ...a
69
+ x.displayName = e.Content.displayName;
70
+ const y = ({
71
+ className: a,
72
+ ...t
87
73
  }) => /* @__PURE__ */ o(
88
74
  "div",
89
75
  {
90
- className: n(
76
+ className: i(
91
77
  "flex flex-col space-y-1.5 text-center sm:text-left",
92
- t
78
+ a
93
79
  ),
94
- ...a
80
+ ...t
95
81
  }
96
82
  );
97
- T.displayName = "DialogHeader";
98
- const j = ({
99
- className: t,
100
- ...a
83
+ y.displayName = "DialogHeader";
84
+ const N = ({
85
+ className: a,
86
+ ...t
101
87
  }) => /* @__PURE__ */ o(
102
88
  "div",
103
89
  {
104
- className: n(
90
+ className: i(
105
91
  "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
106
- t
92
+ a
107
93
  ),
108
- ...a
94
+ ...t
109
95
  }
110
96
  );
111
- j.displayName = "DialogFooter";
112
- const k = i.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
97
+ N.displayName = "DialogFooter";
98
+ const D = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
113
99
  e.Title,
114
100
  {
115
101
  ref: s,
116
- className: n(
102
+ className: i(
117
103
  "text-lg font-semibold leading-none tracking-tight",
118
- t
104
+ a
119
105
  ),
120
- ...a
106
+ ...t
121
107
  }
122
108
  ));
123
- k.displayName = e.Title.displayName;
124
- const H = i.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ o(
109
+ D.displayName = e.Title.displayName;
110
+ const b = l.forwardRef(({ className: a, ...t }, s) => /* @__PURE__ */ o(
125
111
  e.Description,
126
112
  {
127
113
  ref: s,
128
- className: n("text-sm text-muted-foreground", t),
129
- ...a
114
+ className: i("text-sm text-muted-foreground", a),
115
+ ...t
130
116
  }
131
117
  ));
132
- H.displayName = e.Description.displayName;
118
+ b.displayName = e.Description.displayName;
133
119
  export {
134
- q as Dialog,
135
- M as DialogClose,
136
- z as DialogContent,
137
- H as DialogDescription,
138
- j as DialogFooter,
139
- T as DialogHeader,
140
- g as DialogOverlay,
141
- R as DialogPortal,
142
- k as DialogTitle,
143
- B as DialogTrigger
120
+ R as Dialog,
121
+ j as DialogClose,
122
+ x as DialogContent,
123
+ b as DialogDescription,
124
+ N as DialogFooter,
125
+ y as DialogHeader,
126
+ c as DialogOverlay,
127
+ u as DialogPortal,
128
+ D as DialogTitle,
129
+ T as DialogTrigger
144
130
  };
@@ -1,33 +1,28 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import * as m from "react";
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import * as s from "react";
3
3
  import * as o from "@radix-ui/react-popover";
4
- import { cn as l } from "@oneplatformdev/utils";
5
- import { useDialogOverlayContainer as c } from "../Dialog/DialogOverlayScope.mjs";
6
- const P = o.Root, h = o.Trigger, b = o.Anchor, f = m.forwardRef(({ className: r, align: n = "center", sideOffset: i = 4, style: s, ...d }, p) => {
7
- const t = c(), e = t ? { container: t } : {};
8
- return console.log("container", t), console.log("portalProps", e), /* @__PURE__ */ a(o.Portal, { ...e, children: /* @__PURE__ */ a(
9
- o.Content,
10
- {
11
- ref: p,
12
- align: n,
13
- sideOffset: i,
14
- className: l(
15
- // "z-90 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",
16
- "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
- r
18
- ),
19
- style: {
20
- pointerEvents: "auto",
21
- ...s
22
- },
23
- ...d
24
- }
25
- ) });
26
- });
27
- f.displayName = o.Content.displayName;
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: n, ...d }, 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
+ ...n
18
+ },
19
+ ...d
20
+ }
21
+ ) }));
22
+ p.displayName = o.Content.displayName;
28
23
  export {
29
- P as Popover,
30
- b as PopoverAnchor,
31
- f as PopoverContent,
32
- h as PopoverTrigger
24
+ c as Popover,
25
+ g as PopoverAnchor,
26
+ p as PopoverContent,
27
+ v as PopoverTrigger
33
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneplatformdev/ui",
3
- "version": "0.0.1-beta.130",
3
+ "version": "0.0.1-beta.131",
4
4
  "description": "UI React Components.",
5
5
  "author": "One Platform Development Team",
6
6
  "keywords": [