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

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 a from "@radix-ui/react-dialog";
4
4
  import { XIcon as D } from "lucide-react";
5
- import { cn as r, composeRefs as b } from "@oneplatformdev/utils";
5
+ import { cn as l, 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: t, ...s } = e;
9
+ return /* @__PURE__ */ o(
10
+ a.Root,
11
+ {
12
+ modal: t,
13
+ ...s
14
+ }
15
+ );
16
+ }, H = a.Trigger, v = a.Portal, _ = a.Close, c = i.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ o(
17
+ a.Overlay,
9
18
  {
10
- ref: l,
11
- className: r(
19
+ ref: s,
20
+ className: l(
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
24
  ...t
16
25
  }
17
26
  ));
18
- c.displayName = e.Overlay.displayName;
27
+ c.displayName = a.Overlay.displayName;
19
28
  const w = i.forwardRef(
20
29
  ({
21
- className: a,
30
+ className: e,
22
31
  children: t,
23
- showCloseButton: l = !0,
32
+ showCloseButton: s = !0,
24
33
  onOpenAutoFocus: n,
25
34
  preventAutoFocus: f,
26
35
  ...m
@@ -29,27 +38,27 @@ 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
+ a.Content,
33
42
  {
34
- ref: (s) => {
35
- s && b(p, x)(s);
43
+ ref: (r) => {
44
+ r && b(p, x)(r);
36
45
  },
37
- className: r(
46
+ className: l(
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: (r) => (f && r.preventDefault(), n == null ? void 0 : n(r)),
45
54
  ...m,
46
55
  children: [
47
56
  t,
48
- l && /* @__PURE__ */ d(
49
- e.Close,
57
+ s && /* @__PURE__ */ d(
58
+ a.Close,
50
59
  {
51
60
  "aria-label": "Close",
52
- className: r(
61
+ className: l(
53
62
  "absolute right-4 top-4 rounded-sm ring-offset-background w-10 aspect-square",
54
63
  "flex items-center justify-center",
55
64
  "data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
@@ -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: (r) => {
85
+ r && u(r);
77
86
  }
78
87
  }
79
88
  )
80
89
  ] });
81
90
  }
82
91
  );
83
- w.displayName = e.Content.displayName;
92
+ w.displayName = a.Content.displayName;
84
93
  const C = ({
85
- className: a,
94
+ className: e,
86
95
  ...t
87
96
  }) => /* @__PURE__ */ o(
88
97
  "div",
89
98
  {
90
- className: r(
99
+ className: l(
91
100
  "flex flex-col space-y-1.5 text-center sm:text-left",
92
- a
101
+ e
93
102
  ),
94
103
  ...t
95
104
  }
96
105
  );
97
106
  C.displayName = "DialogHeader";
98
107
  const R = ({
99
- className: a,
108
+ className: e,
100
109
  ...t
101
110
  }) => /* @__PURE__ */ o(
102
111
  "div",
103
112
  {
104
- className: r(
113
+ className: l(
105
114
  "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
106
- a
115
+ e
107
116
  ),
108
117
  ...t
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, ...t }, s) => /* @__PURE__ */ o(
122
+ a.Title,
114
123
  {
115
- ref: l,
116
- className: r(
124
+ ref: s,
125
+ className: l(
117
126
  "text-lg font-semibold leading-none tracking-tight",
118
- a
127
+ e
119
128
  ),
120
129
  ...t
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 = a.Title.displayName;
133
+ const j = i.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ o(
134
+ a.Description,
126
135
  {
127
- ref: l,
128
- className: r("text-sm text-muted-foreground", a),
136
+ ref: s,
137
+ className: l("text-sm text-muted-foreground", e),
129
138
  ...t
130
139
  }
131
140
  ));
132
- j.displayName = e.Description.displayName;
141
+ j.displayName = a.Description.displayName;
133
142
  export {
134
143
  F as Dialog,
135
144
  _ as DialogClose,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneplatformdev/ui",
3
- "version": "0.0.1-beta.145",
3
+ "version": "0.0.1-beta.147",
4
4
  "description": "UI React Components.",
5
5
  "author": "One Platform Development Team",
6
6
  "keywords": [