@oneplatformdev/ui 0.0.1-beta.149 → 0.0.1-beta.150

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