@yuno-payments/dashboard-design-system 0.0.101 → 0.0.102

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,13 +1,14 @@
1
1
  import { j as e } from "../../../_virtual/jsx-runtime.js";
2
2
  import * as i from "react";
3
+ import { createPortal as H } from "react-dom";
3
4
  import { cva as g } from "../../../node_modules/class-variance-authority/dist/index.js";
4
5
  import { normalizeDimension as p, cn as r } from "../../../lib/utils.js";
5
- import { useBodyScrollLock as H } from "../../../hooks/use-body-scroll-lock.js";
6
- import { useEscapeKey as M } from "../../../hooks/use-escape-key.js";
6
+ import { useBodyScrollLock as M } from "../../../hooks/use-body-scroll-lock.js";
7
+ import { useEscapeKey as R } from "../../../hooks/use-escape-key.js";
7
8
  import { Typography as x } from "../../atoms/typography/typography.js";
8
9
  import { Button as b } from "../../atoms/button/button.js";
9
- import { Icon as R } from "../../atoms/icon/icon.js";
10
- const W = g(
10
+ import { Icon as W } from "../../atoms/icon/icon.js";
11
+ const D = g(
11
12
  "fixed z-50 bg-background shadow-lg transition-transform duration-300 ease-in-out",
12
13
  {
13
14
  variants: {
@@ -37,7 +38,7 @@ const W = g(
37
38
  isOpen: !1
38
39
  }
39
40
  }
40
- ), C = g(
41
+ ), F = g(
41
42
  "fixed inset-0 z-50 bg-black/50 transition-opacity duration-300",
42
43
  {
43
44
  variants: {
@@ -50,10 +51,10 @@ const W = g(
50
51
  isOpen: !1
51
52
  }
52
53
  }
53
- ), D = i.forwardRef(
54
+ ), K = i.forwardRef(
54
55
  ({
55
56
  className: y,
56
- side: t = "right",
57
+ side: s = "right",
57
58
  title: l,
58
59
  description: o,
59
60
  open: a,
@@ -71,26 +72,25 @@ const W = g(
71
72
  ...V
72
73
  }, E) => {
73
74
  const [I, f] = i.useState(!1), [u, h] = i.useState(!1);
74
- if (H(a), M(a, n), i.useEffect(() => {
75
+ if (M(a), R(a, n), i.useEffect(() => {
75
76
  if (a) {
76
77
  f(!0);
77
- const s = setTimeout(() => h(!0), 10);
78
- return () => clearTimeout(s);
78
+ const t = setTimeout(() => h(!0), 10);
79
+ return () => clearTimeout(t);
79
80
  } else {
80
81
  h(!1);
81
- const s = setTimeout(() => f(!1), 300);
82
- return () => clearTimeout(s);
82
+ const t = setTimeout(() => f(!1), 300);
83
+ return () => clearTimeout(t);
83
84
  }
84
85
  }, [a]), !I) return null;
85
86
  const d = p(j), m = p(v), A = {
86
- ...d && (t === "left" || t === "right") ? { width: d, maxWidth: d } : {},
87
- ...m && (t === "top" || t === "bottom") ? { height: m, maxHeight: m } : {}
88
- };
89
- return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
87
+ ...d && (s === "left" || s === "right") ? { width: d, maxWidth: d } : {},
88
+ ...m && (s === "top" || s === "bottom") ? { height: m, maxHeight: m } : {}
89
+ }, B = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
90
90
  /* @__PURE__ */ e.jsx(
91
91
  "div",
92
92
  {
93
- className: C({ isOpen: u }),
93
+ className: F({ isOpen: u }),
94
94
  onClick: n,
95
95
  "aria-hidden": "true"
96
96
  }
@@ -99,7 +99,7 @@ const W = g(
99
99
  "div",
100
100
  {
101
101
  ref: E,
102
- className: r(W({ side: t, isOpen: u }), y),
102
+ className: r(D({ side: s, isOpen: u }), y),
103
103
  style: A,
104
104
  role: "dialog",
105
105
  "aria-modal": "true",
@@ -144,7 +144,7 @@ const W = g(
144
144
  onClick: n,
145
145
  "aria-label": "Close",
146
146
  className: "h-6 w-6",
147
- children: /* @__PURE__ */ e.jsx(R, { name: "X", size: "md" })
147
+ children: /* @__PURE__ */ e.jsx(W, { name: "X", size: "md" })
148
148
  }
149
149
  )
150
150
  ]
@@ -158,13 +158,13 @@ const W = g(
158
158
  "flex items-center justify-end gap-3 border-t border-border p-6",
159
159
  z
160
160
  ),
161
- children: c.map((s, B) => /* @__PURE__ */ e.jsx(
161
+ children: c.map((t, C) => /* @__PURE__ */ e.jsx(
162
162
  b,
163
163
  {
164
- disabled: T || s.disabled,
165
- ...s
164
+ disabled: T || t.disabled,
165
+ ...t
166
166
  },
167
- B
167
+ C
168
168
  ))
169
169
  }
170
170
  )
@@ -172,9 +172,10 @@ const W = g(
172
172
  }
173
173
  )
174
174
  ] });
175
+ return H(B, document.body);
175
176
  }
176
177
  );
177
- D.displayName = "Sheet";
178
+ K.displayName = "Sheet";
178
179
  export {
179
- D as Sheet
180
+ K as Sheet
180
181
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuno-payments/dashboard-design-system",
3
- "version": "0.0.101",
3
+ "version": "0.0.102",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",