@oneplatformdev/ui 0.0.1-beta.147 → 0.0.1-beta.148

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