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

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