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

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 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(
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(
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 D = g(
38
38
  isOpen: !1
39
39
  }
40
40
  }
41
- ), F = g(
41
+ ), I = x(
42
42
  "fixed inset-0 z-[1000000] bg-black/50 transition-opacity duration-300",
43
43
  {
44
44
  variants: {
@@ -51,120 +51,119 @@ const D = g(
51
51
  isOpen: !1
52
52
  }
53
53
  }
54
- ), K = i.forwardRef(
54
+ ), K = m.forwardRef(
55
55
  ({
56
- className: y,
57
- side: s = "right",
58
- title: l,
59
- description: o,
60
- open: a,
61
- onClose: n,
56
+ className: b,
57
+ side: t = "right",
58
+ title: i,
59
+ description: l,
60
+ open: s,
61
+ onClose: o,
62
62
  buttons: c = [],
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) {
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)
77
77
  f(!0);
78
- const t = setTimeout(() => h(!0), 10);
79
- return () => clearTimeout(t);
80
- } else {
81
- h(!1);
82
- const t = setTimeout(() => f(!1), 300);
83
- return () => clearTimeout(t);
78
+ else {
79
+ const a = setTimeout(() => {
80
+ f(!1);
81
+ }, 300);
82
+ return () => clearTimeout(a);
84
83
  }
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: [
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: [
90
89
  /* @__PURE__ */ e.jsx(
91
90
  "div",
92
91
  {
93
- className: F({ isOpen: u }),
94
- onClick: n,
92
+ className: I({ isOpen: s }),
93
+ onClick: o,
95
94
  "aria-hidden": "true"
96
95
  }
97
96
  ),
98
97
  /* @__PURE__ */ e.jsx(
99
98
  "div",
100
99
  {
101
- ref: E,
102
- className: r(D({ side: s, isOpen: u }), y),
103
- style: A,
100
+ ref: V,
101
+ className: r(F({ side: t, isOpen: s }), b),
102
+ style: E,
104
103
  role: "dialog",
105
104
  "aria-modal": "true",
106
- "aria-labelledby": l ? "sheet-title" : void 0,
107
- "aria-describedby": o ? "sheet-description" : void 0,
108
- ...V,
105
+ "aria-labelledby": i ? "sheet-title" : void 0,
106
+ "aria-describedby": l ? "sheet-description" : void 0,
107
+ ...z,
109
108
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex h-full flex-col", children: [
110
- O && /* @__PURE__ */ e.jsxs(
109
+ j && /* @__PURE__ */ e.jsxs(
111
110
  "div",
112
111
  {
113
112
  className: r(
114
113
  "flex items-center justify-between border-b border-border p-6",
115
- S
114
+ N
116
115
  ),
117
116
  children: [
118
117
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
119
- l && /* @__PURE__ */ e.jsx(
120
- b,
118
+ i && /* @__PURE__ */ e.jsx(
119
+ p,
121
120
  {
122
121
  id: "sheet-title",
123
122
  as: "h2",
124
123
  variant: "h3",
125
124
  className: "font-semibold",
126
- children: l
125
+ children: i
127
126
  }
128
127
  ),
129
- o && /* @__PURE__ */ e.jsx(
130
- b,
128
+ l && /* @__PURE__ */ e.jsx(
129
+ p,
131
130
  {
132
131
  id: "sheet-description",
133
132
  variant: "muted",
134
133
  className: "text-sm",
135
- children: o
134
+ children: l
136
135
  }
137
136
  )
138
137
  ] }),
139
138
  /* @__PURE__ */ e.jsx(
140
- x,
139
+ u,
141
140
  {
142
141
  variant: "ghost",
143
142
  size: "icon",
144
- onClick: n,
143
+ onClick: o,
145
144
  "aria-label": "Close",
146
145
  className: "h-6 w-6",
147
- children: /* @__PURE__ */ e.jsx(W, { name: "X", size: "md" })
146
+ children: /* @__PURE__ */ e.jsx(D, { name: "X", size: "md" })
148
147
  }
149
148
  )
150
149
  ]
151
150
  }
152
151
  ),
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(
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(
155
154
  "div",
156
155
  {
157
156
  className: r(
158
157
  "flex items-center justify-end gap-3 border-t border-border p-6",
159
- z
158
+ S
160
159
  ),
161
- children: c.map((t, C) => /* @__PURE__ */ e.jsx(
162
- x,
160
+ children: c.map((a, B) => /* @__PURE__ */ e.jsx(
161
+ u,
163
162
  {
164
- disabled: T || t.disabled,
165
- ...t
163
+ disabled: k || a.disabled,
164
+ ...a
166
165
  },
167
- C
166
+ B
168
167
  ))
169
168
  }
170
169
  )
@@ -172,7 +171,7 @@ const D = g(
172
171
  }
173
172
  )
174
173
  ] });
175
- return H(B, document.body);
174
+ return C(T, document.body);
176
175
  }
177
176
  );
178
177
  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.120",
3
+ "version": "0.0.121",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",