@oneplatformdev/ui 0.0.1-beta.144 → 0.0.1-beta.146

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.
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
 
3
3
  import * as DialogPrimitive from '@radix-ui/react-dialog';
4
- declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
4
+ declare const Dialog: (props: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>) => import("react/jsx-runtime").JSX.Element;
5
5
  declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
6
  declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
7
7
  declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
package/Dialog/Dialog.mjs CHANGED
@@ -1,26 +1,35 @@
1
1
  import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
2
  import i, { useState as y, useRef as N } from "react";
3
- import * as e from "@radix-ui/react-dialog";
3
+ import * as t from "@radix-ui/react-dialog";
4
4
  import { XIcon as D } from "lucide-react";
5
5
  import { cn as r, composeRefs as b } from "@oneplatformdev/utils";
6
6
  import { DialogOverlayScope as h } from "./DialogOverlayScope.mjs";
7
- const F = e.Root, H = e.Trigger, v = e.Portal, _ = e.Close, c = i.forwardRef(({ className: a, ...t }, l) => /* @__PURE__ */ o(
8
- e.Overlay,
7
+ const F = (e) => {
8
+ const { modal: a = !1, ...s } = e;
9
+ return /* @__PURE__ */ o(
10
+ t.Root,
11
+ {
12
+ modal: a,
13
+ ...s
14
+ }
15
+ );
16
+ }, H = t.Trigger, v = t.Portal, _ = t.Close, c = i.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ o(
17
+ t.Overlay,
9
18
  {
10
- ref: l,
19
+ ref: s,
11
20
  className: r(
12
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",
13
- a
22
+ e
14
23
  ),
15
- ...t
24
+ ...a
16
25
  }
17
26
  ));
18
- c.displayName = e.Overlay.displayName;
27
+ c.displayName = t.Overlay.displayName;
19
28
  const w = i.forwardRef(
20
29
  ({
21
- className: a,
22
- children: t,
23
- showCloseButton: l = !0,
30
+ className: e,
31
+ children: a,
32
+ showCloseButton: s = !0,
24
33
  onOpenAutoFocus: n,
25
34
  preventAutoFocus: f,
26
35
  ...m
@@ -29,24 +38,24 @@ const w = i.forwardRef(
29
38
  return /* @__PURE__ */ d(v, { children: [
30
39
  /* @__PURE__ */ o(c, {}),
31
40
  /* @__PURE__ */ o(h, { value: g, children: /* @__PURE__ */ d(
32
- e.Content,
41
+ t.Content,
33
42
  {
34
- ref: (s) => {
35
- s && b(p, x)(s);
43
+ ref: (l) => {
44
+ l && b(p, x)(l);
36
45
  },
37
46
  className: r(
38
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",
39
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",
40
49
  "max-w-[90%] max-h-[90%] overflow-hidden",
41
50
  "bg-[#FCFCFC] border border-[#E8E9EB] rounded-[16px]",
42
- a
51
+ e
43
52
  ),
44
- onOpenAutoFocus: (s) => (f && s.preventDefault(), n == null ? void 0 : n(s)),
53
+ onOpenAutoFocus: (l) => (f && l.preventDefault(), n == null ? void 0 : n(l)),
45
54
  ...m,
46
55
  children: [
47
- t,
48
- l && /* @__PURE__ */ d(
49
- e.Close,
56
+ a,
57
+ s && /* @__PURE__ */ d(
58
+ t.Close,
50
59
  {
51
60
  "aria-label": "Close",
52
61
  className: r(
@@ -72,64 +81,64 @@ const w = i.forwardRef(
72
81
  /* @__PURE__ */ o(
73
82
  "div",
74
83
  {
75
- ref: (s) => {
76
- s && u(s);
84
+ ref: (l) => {
85
+ l && u(l);
77
86
  }
78
87
  }
79
88
  )
80
89
  ] });
81
90
  }
82
91
  );
83
- w.displayName = e.Content.displayName;
92
+ w.displayName = t.Content.displayName;
84
93
  const C = ({
85
- className: a,
86
- ...t
94
+ className: e,
95
+ ...a
87
96
  }) => /* @__PURE__ */ o(
88
97
  "div",
89
98
  {
90
99
  className: r(
91
100
  "flex flex-col space-y-1.5 text-center sm:text-left",
92
- a
101
+ e
93
102
  ),
94
- ...t
103
+ ...a
95
104
  }
96
105
  );
97
106
  C.displayName = "DialogHeader";
98
107
  const R = ({
99
- className: a,
100
- ...t
108
+ className: e,
109
+ ...a
101
110
  }) => /* @__PURE__ */ o(
102
111
  "div",
103
112
  {
104
113
  className: r(
105
114
  "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
106
- a
115
+ e
107
116
  ),
108
- ...t
117
+ ...a
109
118
  }
110
119
  );
111
120
  R.displayName = "DialogFooter";
112
- const T = i.forwardRef(({ className: a, ...t }, l) => /* @__PURE__ */ o(
113
- e.Title,
121
+ const T = i.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ o(
122
+ t.Title,
114
123
  {
115
- ref: l,
124
+ ref: s,
116
125
  className: r(
117
126
  "text-lg font-semibold leading-none tracking-tight",
118
- a
127
+ e
119
128
  ),
120
- ...t
129
+ ...a
121
130
  }
122
131
  ));
123
- T.displayName = e.Title.displayName;
124
- const j = i.forwardRef(({ className: a, ...t }, l) => /* @__PURE__ */ o(
125
- e.Description,
132
+ T.displayName = t.Title.displayName;
133
+ const j = i.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ o(
134
+ t.Description,
126
135
  {
127
- ref: l,
128
- className: r("text-sm text-muted-foreground", a),
129
- ...t
136
+ ref: s,
137
+ className: r("text-sm text-muted-foreground", e),
138
+ ...a
130
139
  }
131
140
  ));
132
- j.displayName = e.Description.displayName;
141
+ j.displayName = t.Description.displayName;
133
142
  export {
134
143
  F as Dialog,
135
144
  _ as DialogClose,
@@ -1,25 +1,25 @@
1
- import { jsx as r } from "react/jsx-runtime";
1
+ import { jsx as a } from "react/jsx-runtime";
2
2
  import * as p from "react";
3
3
  import * as o from "@radix-ui/react-popover";
4
4
  import { cn as l } from "@oneplatformdev/utils";
5
5
  import { useDialogOverlayContainer as c } from "../Dialog/DialogOverlayScope.mjs";
6
6
  const P = (t) => {
7
- const { modal: e = !1, ...a } = t;
8
- return /* @__PURE__ */ r(
7
+ const { modal: e, ...r } = t;
8
+ return /* @__PURE__ */ a(
9
9
  o.Root,
10
10
  {
11
11
  modal: e,
12
- ...a
12
+ ...r
13
13
  }
14
14
  );
15
- }, h = o.Trigger, b = o.Anchor, f = p.forwardRef(({ className: t, align: e = "center", sideOffset: a = 4, style: n, avoidCollisions: i = !0, ...s }, d) => {
15
+ }, h = o.Trigger, b = o.Anchor, f = p.forwardRef(({ className: t, align: e = "center", sideOffset: r = 4, style: n, avoidCollisions: i = !0, ...d }, s) => {
16
16
  const m = c();
17
- return /* @__PURE__ */ r(o.Portal, { container: m, children: /* @__PURE__ */ r(
17
+ return /* @__PURE__ */ a(o.Portal, { container: m, children: /* @__PURE__ */ a(
18
18
  o.Content,
19
19
  {
20
- ref: d,
20
+ ref: s,
21
21
  align: e,
22
- sideOffset: a,
22
+ sideOffset: r,
23
23
  className: l(
24
24
  "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",
25
25
  t
@@ -28,7 +28,7 @@ const P = (t) => {
28
28
  pointerEvents: "auto",
29
29
  ...n
30
30
  },
31
- ...s,
31
+ ...d,
32
32
  avoidCollisions: i
33
33
  }
34
34
  ) });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneplatformdev/ui",
3
- "version": "0.0.1-beta.144",
3
+ "version": "0.0.1-beta.146",
4
4
  "description": "UI React Components.",
5
5
  "author": "One Platform Development Team",
6
6
  "keywords": [