@seygo/ui 0.3.0 → 0.3.2
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.
- package/dist/index.cjs +53 -45
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +52 -44
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -272,7 +272,9 @@ SelectCustom.displayName = "CustomSelect";
|
|
|
272
272
|
var Select_default = SelectCustom;
|
|
273
273
|
|
|
274
274
|
// src/components/Modal/Modal.tsx
|
|
275
|
-
var import_react3 = require("
|
|
275
|
+
var import_react3 = require("react");
|
|
276
|
+
var import_react_dom = require("react-dom");
|
|
277
|
+
var import_react4 = require("@phosphor-icons/react");
|
|
276
278
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
277
279
|
function ModalCustom({
|
|
278
280
|
height,
|
|
@@ -281,50 +283,56 @@ function ModalCustom({
|
|
|
281
283
|
onClose,
|
|
282
284
|
title
|
|
283
285
|
}) {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
"
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
286
|
+
const [mounted, setMounted] = (0, import_react3.useState)(false);
|
|
287
|
+
(0, import_react3.useEffect)(() => setMounted(true), []);
|
|
288
|
+
if (!mounted) return null;
|
|
289
|
+
return (0, import_react_dom.createPortal)(
|
|
290
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
291
|
+
"section",
|
|
292
|
+
{
|
|
293
|
+
style: {
|
|
294
|
+
position: "fixed",
|
|
295
|
+
inset: 0,
|
|
296
|
+
zIndex: 1e3,
|
|
297
|
+
display: "flex",
|
|
298
|
+
alignItems: "center",
|
|
299
|
+
justifyContent: "center",
|
|
300
|
+
padding: "1rem",
|
|
301
|
+
backgroundColor: "rgba(2, 6, 23, 0.7)",
|
|
302
|
+
backdropFilter: "blur(4px)",
|
|
303
|
+
WebkitBackdropFilter: "blur(4px)"
|
|
304
|
+
},
|
|
305
|
+
onClick: onClose,
|
|
306
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
307
|
+
"div",
|
|
308
|
+
{
|
|
309
|
+
className: "relative flex flex-col overflow-hidden rounded-3xl border border-gray-200 bg-white shadow-2xl",
|
|
310
|
+
style: {
|
|
311
|
+
width: `min(${width}px, calc(100vw - 2rem))`,
|
|
312
|
+
height: `min(${height}px, calc(100vh - 2rem))`,
|
|
313
|
+
maxHeight: "100%"
|
|
314
|
+
},
|
|
315
|
+
onClick: (e) => e.stopPropagation(),
|
|
316
|
+
children: [
|
|
317
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex items-center justify-between gap-3 border-b border-gray-200 px-4 py-3 pr-3", children: [
|
|
318
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "min-w-0 truncate text-xl font-medium", children: title ? title : "" }),
|
|
319
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
320
|
+
"button",
|
|
321
|
+
{
|
|
322
|
+
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700",
|
|
323
|
+
onClick: onClose,
|
|
324
|
+
"aria-label": "Fechar modal",
|
|
325
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react4.X, { size: 20, weight: "bold" })
|
|
326
|
+
}
|
|
327
|
+
)
|
|
328
|
+
] }),
|
|
329
|
+
component
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
)
|
|
333
|
+
}
|
|
334
|
+
),
|
|
335
|
+
document.body
|
|
328
336
|
);
|
|
329
337
|
}
|
|
330
338
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ButtonProps, InputProps, InputRef, SelectProps } from 'antd';
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import react__default, { ReactNode } from 'react';
|
|
5
5
|
|
|
6
6
|
type ButtonCustomProps = ButtonProps & {
|
|
7
7
|
className?: string;
|
|
@@ -23,7 +23,7 @@ interface CustomInputProps extends Omit<InputProps, "onChange"> {
|
|
|
23
23
|
containerClassName?: string;
|
|
24
24
|
labelClassName?: string;
|
|
25
25
|
}
|
|
26
|
-
declare const InputCustom:
|
|
26
|
+
declare const InputCustom: react__default.ForwardRefExoticComponent<CustomInputProps & react__default.RefAttributes<InputRef>>;
|
|
27
27
|
|
|
28
28
|
interface CustomSelectProps extends Omit<SelectProps, "onChange" | "options"> {
|
|
29
29
|
label?: string;
|
|
@@ -38,7 +38,7 @@ interface CustomSelectProps extends Omit<SelectProps, "onChange" | "options"> {
|
|
|
38
38
|
}[];
|
|
39
39
|
multiple?: boolean;
|
|
40
40
|
}
|
|
41
|
-
declare const SelectCustom:
|
|
41
|
+
declare const SelectCustom: react.ForwardRefExoticComponent<CustomSelectProps & react.RefAttributes<any>>;
|
|
42
42
|
|
|
43
43
|
declare function ModalCustom({ height, width, component, onClose, title, }: {
|
|
44
44
|
height: string;
|
|
@@ -46,6 +46,6 @@ declare function ModalCustom({ height, width, component, onClose, title, }: {
|
|
|
46
46
|
component: React.ReactNode;
|
|
47
47
|
onClose: () => void;
|
|
48
48
|
title?: string;
|
|
49
|
-
}):
|
|
49
|
+
}): react.ReactPortal | null;
|
|
50
50
|
|
|
51
51
|
export { ButtonCustom as Button, InputCustom as Input, ModalCustom as Modal, SelectCustom as Select };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ButtonProps, InputProps, InputRef, SelectProps } from 'antd';
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import react__default, { ReactNode } from 'react';
|
|
5
5
|
|
|
6
6
|
type ButtonCustomProps = ButtonProps & {
|
|
7
7
|
className?: string;
|
|
@@ -23,7 +23,7 @@ interface CustomInputProps extends Omit<InputProps, "onChange"> {
|
|
|
23
23
|
containerClassName?: string;
|
|
24
24
|
labelClassName?: string;
|
|
25
25
|
}
|
|
26
|
-
declare const InputCustom:
|
|
26
|
+
declare const InputCustom: react__default.ForwardRefExoticComponent<CustomInputProps & react__default.RefAttributes<InputRef>>;
|
|
27
27
|
|
|
28
28
|
interface CustomSelectProps extends Omit<SelectProps, "onChange" | "options"> {
|
|
29
29
|
label?: string;
|
|
@@ -38,7 +38,7 @@ interface CustomSelectProps extends Omit<SelectProps, "onChange" | "options"> {
|
|
|
38
38
|
}[];
|
|
39
39
|
multiple?: boolean;
|
|
40
40
|
}
|
|
41
|
-
declare const SelectCustom:
|
|
41
|
+
declare const SelectCustom: react.ForwardRefExoticComponent<CustomSelectProps & react.RefAttributes<any>>;
|
|
42
42
|
|
|
43
43
|
declare function ModalCustom({ height, width, component, onClose, title, }: {
|
|
44
44
|
height: string;
|
|
@@ -46,6 +46,6 @@ declare function ModalCustom({ height, width, component, onClose, title, }: {
|
|
|
46
46
|
component: React.ReactNode;
|
|
47
47
|
onClose: () => void;
|
|
48
48
|
title?: string;
|
|
49
|
-
}):
|
|
49
|
+
}): react.ReactPortal | null;
|
|
50
50
|
|
|
51
51
|
export { ButtonCustom as Button, InputCustom as Input, ModalCustom as Modal, SelectCustom as Select };
|
package/dist/index.js
CHANGED
|
@@ -243,6 +243,8 @@ SelectCustom.displayName = "CustomSelect";
|
|
|
243
243
|
var Select_default = SelectCustom;
|
|
244
244
|
|
|
245
245
|
// src/components/Modal/Modal.tsx
|
|
246
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
247
|
+
import { createPortal } from "react-dom";
|
|
246
248
|
import { X } from "@phosphor-icons/react";
|
|
247
249
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
248
250
|
function ModalCustom({
|
|
@@ -252,50 +254,56 @@ function ModalCustom({
|
|
|
252
254
|
onClose,
|
|
253
255
|
title
|
|
254
256
|
}) {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
"
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
257
|
+
const [mounted, setMounted] = useState3(false);
|
|
258
|
+
useEffect3(() => setMounted(true), []);
|
|
259
|
+
if (!mounted) return null;
|
|
260
|
+
return createPortal(
|
|
261
|
+
/* @__PURE__ */ jsx4(
|
|
262
|
+
"section",
|
|
263
|
+
{
|
|
264
|
+
style: {
|
|
265
|
+
position: "fixed",
|
|
266
|
+
inset: 0,
|
|
267
|
+
zIndex: 1e3,
|
|
268
|
+
display: "flex",
|
|
269
|
+
alignItems: "center",
|
|
270
|
+
justifyContent: "center",
|
|
271
|
+
padding: "1rem",
|
|
272
|
+
backgroundColor: "rgba(2, 6, 23, 0.7)",
|
|
273
|
+
backdropFilter: "blur(4px)",
|
|
274
|
+
WebkitBackdropFilter: "blur(4px)"
|
|
275
|
+
},
|
|
276
|
+
onClick: onClose,
|
|
277
|
+
children: /* @__PURE__ */ jsxs3(
|
|
278
|
+
"div",
|
|
279
|
+
{
|
|
280
|
+
className: "relative flex flex-col overflow-hidden rounded-3xl border border-gray-200 bg-white shadow-2xl",
|
|
281
|
+
style: {
|
|
282
|
+
width: `min(${width}px, calc(100vw - 2rem))`,
|
|
283
|
+
height: `min(${height}px, calc(100vh - 2rem))`,
|
|
284
|
+
maxHeight: "100%"
|
|
285
|
+
},
|
|
286
|
+
onClick: (e) => e.stopPropagation(),
|
|
287
|
+
children: [
|
|
288
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between gap-3 border-b border-gray-200 px-4 py-3 pr-3", children: [
|
|
289
|
+
/* @__PURE__ */ jsx4("div", { className: "min-w-0 truncate text-xl font-medium", children: title ? title : "" }),
|
|
290
|
+
/* @__PURE__ */ jsx4(
|
|
291
|
+
"button",
|
|
292
|
+
{
|
|
293
|
+
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-700",
|
|
294
|
+
onClick: onClose,
|
|
295
|
+
"aria-label": "Fechar modal",
|
|
296
|
+
children: /* @__PURE__ */ jsx4(X, { size: 20, weight: "bold" })
|
|
297
|
+
}
|
|
298
|
+
)
|
|
299
|
+
] }),
|
|
300
|
+
component
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
)
|
|
304
|
+
}
|
|
305
|
+
),
|
|
306
|
+
document.body
|
|
299
307
|
);
|
|
300
308
|
}
|
|
301
309
|
export {
|