@yuno-payments/dashboard-design-system 0.0.121 → 0.0.122

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,14 +1,14 @@
1
1
  import { j as e } from "../../../_virtual/jsx-runtime.js";
2
- import * as m from "react";
3
- import { createPortal as C } from "react-dom";
4
- import { cva as x } from "../../../node_modules/class-variance-authority/dist/index.js";
5
- import { normalizeDimension as h, cn as r } from "../../../lib/utils.js";
6
- import { useBodyScrollLock as H } from "../../../hooks/use-body-scroll-lock.js";
7
- import { useEscapeKey as W } from "../../../hooks/use-escape-key.js";
8
- import { Icon as D } from "../../atoms/icon/icon.js";
9
- import { Button as u } from "../../atoms/button/button.js";
10
- import { Typography as p } from "../../atoms/typography/typography.js";
11
- const F = x(
2
+ import * as i from "react";
3
+ import { createPortal as H } from "react-dom";
4
+ import { cva as g } from "../../../node_modules/class-variance-authority/dist/index.js";
5
+ import { normalizeDimension as p, cn as r } from "../../../lib/utils.js";
6
+ import { useBodyScrollLock as M } from "../../../hooks/use-body-scroll-lock.js";
7
+ import { useEscapeKey as R } from "../../../hooks/use-escape-key.js";
8
+ import { Icon as W } from "../../atoms/icon/icon.js";
9
+ import { Button as x } from "../../atoms/button/button.js";
10
+ import { Typography as b } from "../../atoms/typography/typography.js";
11
+ const D = g(
12
12
  "fixed z-[1000000] bg-background shadow-lg transition-transform duration-300 ease-in-out",
13
13
  {
14
14
  variants: {
@@ -38,7 +38,7 @@ const F = x(
38
38
  isOpen: !1
39
39
  }
40
40
  }
41
- ), I = x(
41
+ ), F = g(
42
42
  "fixed inset-0 z-[1000000] bg-black/50 transition-opacity duration-300",
43
43
  {
44
44
  variants: {
@@ -51,119 +51,120 @@ const F = x(
51
51
  isOpen: !1
52
52
  }
53
53
  }
54
- ), K = m.forwardRef(
54
+ ), K = i.forwardRef(
55
55
  ({
56
- className: b,
57
- side: t = "right",
58
- title: i,
59
- description: l,
60
- open: s,
61
- onClose: o,
56
+ className: y,
57
+ side: s = "right",
58
+ title: l,
59
+ description: o,
60
+ open: a,
61
+ onClose: n,
62
62
  buttons: c = [],
63
- width: y,
64
- height: g,
65
- showHeader: j = !0,
66
- showFooter: v = !0,
67
- children: O,
68
- headerClassName: N,
69
- contentClassName: w,
70
- footerClassName: S,
71
- loading: k = !1,
72
- ...z
73
- }, V) => {
74
- const [R, f] = m.useState(s);
75
- if (H(s), W(s, o), m.useEffect(() => {
76
- if (s)
63
+ width: j,
64
+ height: v,
65
+ showHeader: O = !0,
66
+ showFooter: N = !0,
67
+ children: w,
68
+ headerClassName: S,
69
+ contentClassName: k,
70
+ footerClassName: z,
71
+ loading: T = !1,
72
+ ...V
73
+ }, E) => {
74
+ const [I, f] = i.useState(!1), [u, h] = i.useState(!1);
75
+ if (M(a), R(a, n), i.useEffect(() => {
76
+ if (a) {
77
77
  f(!0);
78
- else {
79
- const a = setTimeout(() => {
80
- f(!1);
81
- }, 300);
82
- return () => clearTimeout(a);
78
+ const t = setTimeout(() => h(!0), 10);
79
+ return () => clearTimeout(t);
80
+ } else {
81
+ h(!1);
82
+ const t = setTimeout(() => f(!1), 310);
83
+ return () => clearTimeout(t);
83
84
  }
84
- }, [s]), !R) return null;
85
- const n = h(y), d = h(g), E = {
86
- ...n && (t === "left" || t === "right") ? { width: n, maxWidth: n } : {},
87
- ...d && (t === "top" || t === "bottom") ? { height: d, maxHeight: d } : {}
88
- }, T = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
85
+ }, [a]), !I) return null;
86
+ const d = p(j), m = p(v), A = {
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: [
89
90
  /* @__PURE__ */ e.jsx(
90
91
  "div",
91
92
  {
92
- className: I({ isOpen: s }),
93
- onClick: o,
93
+ className: F({ isOpen: u }),
94
+ onClick: n,
94
95
  "aria-hidden": "true"
95
96
  }
96
97
  ),
97
98
  /* @__PURE__ */ e.jsx(
98
99
  "div",
99
100
  {
100
- ref: V,
101
- className: r(F({ side: t, isOpen: s }), b),
102
- style: E,
101
+ ref: E,
102
+ className: r(D({ side: s, isOpen: u }), y),
103
+ style: A,
103
104
  role: "dialog",
104
105
  "aria-modal": "true",
105
- "aria-labelledby": i ? "sheet-title" : void 0,
106
- "aria-describedby": l ? "sheet-description" : void 0,
107
- ...z,
106
+ "aria-labelledby": l ? "sheet-title" : void 0,
107
+ "aria-describedby": o ? "sheet-description" : void 0,
108
+ ...V,
108
109
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
109
- j && /* @__PURE__ */ e.jsxs(
110
+ O && /* @__PURE__ */ e.jsxs(
110
111
  "div",
111
112
  {
112
113
  className: r(
113
114
  "flex items-center justify-between border-b border-border p-6",
114
- N
115
+ S
115
116
  ),
116
117
  children: [
117
118
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
118
- i && /* @__PURE__ */ e.jsx(
119
- p,
119
+ l && /* @__PURE__ */ e.jsx(
120
+ b,
120
121
  {
121
122
  id: "sheet-title",
122
123
  as: "h2",
123
124
  variant: "h3",
124
125
  className: "font-semibold",
125
- children: i
126
+ children: l
126
127
  }
127
128
  ),
128
- l && /* @__PURE__ */ e.jsx(
129
- p,
129
+ o && /* @__PURE__ */ e.jsx(
130
+ b,
130
131
  {
131
132
  id: "sheet-description",
132
133
  variant: "muted",
133
134
  className: "text-sm",
134
- children: l
135
+ children: o
135
136
  }
136
137
  )
137
138
  ] }),
138
139
  /* @__PURE__ */ e.jsx(
139
- u,
140
+ x,
140
141
  {
141
142
  variant: "ghost",
142
143
  size: "icon",
143
- onClick: o,
144
+ onClick: n,
144
145
  "aria-label": "Close",
145
146
  className: "h-6 w-6",
146
- children: /* @__PURE__ */ e.jsx(D, { name: "X", size: "md" })
147
+ children: /* @__PURE__ */ e.jsx(W, { name: "X", size: "md" })
147
148
  }
148
149
  )
149
150
  ]
150
151
  }
151
152
  ),
152
- /* @__PURE__ */ e.jsx("div", { className: r("flex-1 overflow-y-auto p-6", w), children: O }),
153
- v && c.length > 0 && /* @__PURE__ */ e.jsx(
153
+ /* @__PURE__ */ e.jsx("div", { className: r("flex-1 overflow-y-auto p-6", k), children: w }),
154
+ N && c.length > 0 && /* @__PURE__ */ e.jsx(
154
155
  "div",
155
156
  {
156
157
  className: r(
157
158
  "flex items-center justify-end gap-3 border-t border-border p-6",
158
- S
159
+ z
159
160
  ),
160
- children: c.map((a, B) => /* @__PURE__ */ e.jsx(
161
- u,
161
+ children: c.map((t, C) => /* @__PURE__ */ e.jsx(
162
+ x,
162
163
  {
163
- disabled: k || a.disabled,
164
- ...a
164
+ disabled: T || t.disabled,
165
+ ...t
165
166
  },
166
- B
167
+ C
167
168
  ))
168
169
  }
169
170
  )
@@ -171,7 +172,7 @@ const F = x(
171
172
  }
172
173
  )
173
174
  ] });
174
- return C(T, document.body);
175
+ return H(B, document.body);
175
176
  }
176
177
  );
177
178
  K.displayName = "Sheet";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuno-payments/dashboard-design-system",
3
- "version": "0.0.121",
3
+ "version": "0.0.122",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",