nexaas-ui-components 1.0.41 → 1.0.43
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 +63 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +63 -34
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -108,7 +108,7 @@ var variants = {
|
|
|
108
108
|
text: "shadow-button bg-surface border-[0.5px] border-rose-500 text-rose-500 hover:bg-rose-50 hover:text-rose-600 active:bg-rose-100 active:text-rose-600 disabled:bg-surface disabled:border-[0.5px] disabled:border-rose-700 disabled:opacity-50 active:shadow-none"
|
|
109
109
|
},
|
|
110
110
|
link: {
|
|
111
|
-
text: "shadow-button text-left text-blue-500 hover:text-blue-
|
|
111
|
+
text: "shadow-button text-left text-blue-500 hover:text-blue-600 hover:underline active:text-blue-600 disabled:text-blue-400 disabled:no-underline outline-none focus:outline-none shadow-none font-normal"
|
|
112
112
|
},
|
|
113
113
|
dangerOutline: {
|
|
114
114
|
text: "shadow-button text-dangerous-500 bg-surface border-[0.5px] border-dangerous-500 hover:bg-dangerous-100 hover:text-dangerous-600 active:bg-dangerous-500 active:text-white disabled:opacity-50 disabled:bg-white disabled:text-dangerous-500 active:shadow-none"
|
|
@@ -287,7 +287,10 @@ var variants2 = {
|
|
|
287
287
|
text: "shadow-button bg-white border-[0.5px] border-paragraph text-blue-500 hover:text-blue-600 hover:bg-[#f5f5f5] active:text-blue-600 active:bg-light-gray-100 disabled:text-dark-blue-400 disabled:bg-white disabled:border-[0.5px] disabled:border-dark-blue-400"
|
|
288
288
|
},
|
|
289
289
|
link: {
|
|
290
|
-
text: "text-blue-500 hover:text-blue-600 hover:underline active:text-blue-600 active:underline disabled:text-blue-500 disabled:no-underline shadow-none font-normal"
|
|
290
|
+
text: "text-blue-500 hover:text-blue-600 hover:underline border-none active:text-blue-600 active:underline disabled:text-blue-500 disabled:no-underline shadow-none font-normal"
|
|
291
|
+
},
|
|
292
|
+
linkDanger: {
|
|
293
|
+
text: "text-dangerous-500 hover:text-dangerous-600 hover:underline border-none active:text-dangerous-600 active:underline disabled:text-dangerous-500 disabled:no-underline shadow-none font-normal"
|
|
291
294
|
},
|
|
292
295
|
icon: {
|
|
293
296
|
text: "bg-white border-[0.5px] border-dark-blue-300 text-blue-500 hover:text-blue-600 hover:bg-[#f5f5f5] active:text-blue-600 active:bg-light-gray-100 disabled:text-dark-blue-400 disabled:border-[0.5px] disabled:border-disabled disabled:bg-white disabled:opacity-50"
|
|
@@ -337,6 +340,7 @@ var ButtonLink = React5.forwardRef(
|
|
|
337
340
|
as: LinkComponent = "a",
|
|
338
341
|
hotkey,
|
|
339
342
|
hotkeyPosition = "bottom",
|
|
343
|
+
iconPosition = "left",
|
|
340
344
|
...props
|
|
341
345
|
}, ref) => {
|
|
342
346
|
var _a;
|
|
@@ -359,7 +363,9 @@ var ButtonLink = React5.forwardRef(
|
|
|
359
363
|
if (props.onClick) {
|
|
360
364
|
(_a2 = props.onClick) == null ? void 0 : _a2.call(props, event);
|
|
361
365
|
} else {
|
|
362
|
-
const linkElement = document.querySelector(
|
|
366
|
+
const linkElement = document.querySelector(
|
|
367
|
+
`a[href="${props.href}"]`
|
|
368
|
+
);
|
|
363
369
|
linkElement == null ? void 0 : linkElement.click();
|
|
364
370
|
}
|
|
365
371
|
}
|
|
@@ -373,7 +379,7 @@ var ButtonLink = React5.forwardRef(
|
|
|
373
379
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
374
380
|
"div",
|
|
375
381
|
{
|
|
376
|
-
className: clsx9__default.default("inline-flex gap-[
|
|
382
|
+
className: clsx9__default.default("inline-flex gap-[4px]", {
|
|
377
383
|
"flex-col items-center justify-center": hotkeyPosition === "top" || hotkeyPosition === "bottom",
|
|
378
384
|
"flex-row items-center justify-center": hotkeyPosition === "left" || hotkeyPosition === "right"
|
|
379
385
|
}),
|
|
@@ -395,9 +401,10 @@ var ButtonLink = React5.forwardRef(
|
|
|
395
401
|
[(_a = variants2[variant]) == null ? void 0 : _a.text]: true,
|
|
396
402
|
[sizes2[size].text]: true,
|
|
397
403
|
["pointer-events-none shadow-none text-label"]: disabled,
|
|
398
|
-
["px-2"]: variant !== "link"
|
|
404
|
+
["px-2"]: variant !== "link" && variant !== "linkDanger",
|
|
405
|
+
["flex-row-reverse"]: iconPosition === "right"
|
|
399
406
|
},
|
|
400
|
-
`group rounded-lg font-bold active:shadow-none font-title flex items-center justify-start cursor-pointer
|
|
407
|
+
`group rounded-lg font-bold active:shadow-none font-title flex items-center justify-start cursor-pointer outline-none focus:outline-none
|
|
401
408
|
${applyGap ? "gap-2" : "gap-0"} ${className}
|
|
402
409
|
`
|
|
403
410
|
),
|
|
@@ -405,8 +412,26 @@ var ButtonLink = React5.forwardRef(
|
|
|
405
412
|
...props,
|
|
406
413
|
download: name,
|
|
407
414
|
children: [
|
|
408
|
-
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
409
|
-
|
|
415
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
416
|
+
"div",
|
|
417
|
+
{
|
|
418
|
+
className: clsx9__default.default("flex items-center justify-center", {
|
|
419
|
+
"text-[12px]": size === "sm",
|
|
420
|
+
"text-[14px]": size === "md"
|
|
421
|
+
}),
|
|
422
|
+
children: icon
|
|
423
|
+
}
|
|
424
|
+
),
|
|
425
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
426
|
+
"span",
|
|
427
|
+
{
|
|
428
|
+
className: clsx9__default.default("cursor-pointer line-clamp-2", {
|
|
429
|
+
"text-[12px]": size === "sm",
|
|
430
|
+
"text-[14px]": size === "md"
|
|
431
|
+
}),
|
|
432
|
+
children: label
|
|
433
|
+
}
|
|
434
|
+
)
|
|
410
435
|
]
|
|
411
436
|
}
|
|
412
437
|
),
|
|
@@ -451,7 +476,7 @@ var Input = ({
|
|
|
451
476
|
const hasError = fieldValidationMessages.some((item) => item !== void 0);
|
|
452
477
|
const [showPassword, setShowPassword] = React5__namespace.default.useState(false);
|
|
453
478
|
const styles = {
|
|
454
|
-
input: `text-p-md pl-2 peer shadow-input border rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border-1 focus-visible:border-blue-500 ${label ? "pt-[22px]" : "pt-[10px]"}
|
|
479
|
+
input: `text-p-md pl-2 peer shadow-input border border-[0.5px] rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border-1 focus-visible:border-blue-500 ${label ? "pt-[22px]" : "pt-[10px]"}
|
|
455
480
|
${!hasError ? "border-neutral-300" : ""}`,
|
|
456
481
|
icon: `absolute bg-neutral-100 h-[44px] top-[1px] left-[1.5px] w-[38px] rounded-l-lg text-[20px] ${hasError ? "text-dangerous-500" : "text-label peer-focus:text-blue-500"} peer-focus:border-blue-500`,
|
|
457
482
|
rightIcon: "absolute h-[44px] top-[1px] right-[1.5px] w-[38px] text-[22px]",
|
|
@@ -1171,7 +1196,7 @@ var FilterCalendar = ({
|
|
|
1171
1196
|
maxDate = void 0
|
|
1172
1197
|
}) => {
|
|
1173
1198
|
const style = {
|
|
1174
|
-
filter: "rounded-3xl shadow-input bg-white hover:bg-neutral-100 border border-neutral-300 active:text-blue-500 active:bg-blue-100 active:border-blue-500",
|
|
1199
|
+
filter: "rounded-3xl shadow-input bg-white hover:bg-neutral-100 border border-[0.5px] border-neutral-300 active:text-blue-500 active:bg-blue-100 active:border-blue-500",
|
|
1175
1200
|
filterOpen: "rounded-3xl shadow-input border border-blue-500 bg-blue-100 text-blue-500",
|
|
1176
1201
|
filterActive: "rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-white active:text-white active:bg-blue-600 active:border-blue-600"
|
|
1177
1202
|
};
|
|
@@ -1628,10 +1653,11 @@ var FilterOptions = ({
|
|
|
1628
1653
|
emptyMessage,
|
|
1629
1654
|
initialMessage,
|
|
1630
1655
|
applyOnClick = false,
|
|
1631
|
-
showFilter = false
|
|
1656
|
+
showFilter = false,
|
|
1657
|
+
renderOption
|
|
1632
1658
|
}) => {
|
|
1633
1659
|
const style = {
|
|
1634
|
-
filter: "rounded-3xl shadow-input bg-white hover:bg-neutral-100 border border-neutral-300 active:text-blue-500 active:bg-blue-100 active:border-blue-500",
|
|
1660
|
+
filter: "rounded-3xl shadow-input bg-white hover:bg-neutral-100 border border-[0.5px] border-neutral-300 active:text-blue-500 active:bg-blue-100 active:border-blue-500",
|
|
1635
1661
|
filterOpen: "rounded-3xl shadow-input border border-blue-500 bg-blue-100 text-blue-500",
|
|
1636
1662
|
filterActive: "rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-white active:text-white active:bg-blue-600 active:border-blue-600"
|
|
1637
1663
|
};
|
|
@@ -1678,7 +1704,20 @@ var FilterOptions = ({
|
|
|
1678
1704
|
disabled: option.disabled,
|
|
1679
1705
|
value: option,
|
|
1680
1706
|
as: React5.Fragment,
|
|
1681
|
-
children: /* @__PURE__ */ jsxRuntime.
|
|
1707
|
+
children: renderOption ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1708
|
+
"div",
|
|
1709
|
+
{
|
|
1710
|
+
className: clsx9__default.default(
|
|
1711
|
+
"relative cursor-pointer outline-none select-none p-3 rounded-lg pr-9 text-paragraph mt-1 first:mt-0 overflow-hidden w-full",
|
|
1712
|
+
{
|
|
1713
|
+
["hover:bg-neutral-200"]: !option.disabled && !isSelected,
|
|
1714
|
+
["text-gray-200"]: option.disabled,
|
|
1715
|
+
["bg-blue-500 hover:bg-blue-500"]: isSelected
|
|
1716
|
+
}
|
|
1717
|
+
),
|
|
1718
|
+
children: renderOption(option, isSelected)
|
|
1719
|
+
}
|
|
1720
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1682
1721
|
"div",
|
|
1683
1722
|
{
|
|
1684
1723
|
className: clsx9__default.default(
|
|
@@ -1758,7 +1797,7 @@ var FilterOptions = ({
|
|
|
1758
1797
|
className: clsx9__default.default({
|
|
1759
1798
|
["text-label group-active:text-blue-500"]: !field.value && !open,
|
|
1760
1799
|
["text-blue-500"]: open && !field.value,
|
|
1761
|
-
["text-blue-500 group-hover:text-
|
|
1800
|
+
["text-blue-500 group-hover:text-blue-500 "]: open && field.value
|
|
1762
1801
|
}),
|
|
1763
1802
|
children: icon
|
|
1764
1803
|
}
|
|
@@ -1770,7 +1809,7 @@ var FilterOptions = ({
|
|
|
1770
1809
|
{
|
|
1771
1810
|
["text-paragraph group-active:text-blue-500"]: !field.value && !open,
|
|
1772
1811
|
["text-blue-500"]: open && !field.value,
|
|
1773
|
-
["text-blue-500 group-hover:text-
|
|
1812
|
+
["text-blue-500 group-hover:text-blue-500 "]: open && field.value
|
|
1774
1813
|
},
|
|
1775
1814
|
"truncate cursor-pointer"
|
|
1776
1815
|
),
|
|
@@ -1785,7 +1824,7 @@ var FilterOptions = ({
|
|
|
1785
1824
|
{
|
|
1786
1825
|
["text-label group-active:text-blue-500"]: !field.value && !open,
|
|
1787
1826
|
["text-blue-500"]: open && !field.value,
|
|
1788
|
-
["text-blue-500 group-hover:text-
|
|
1827
|
+
["text-blue-500 group-hover:text-blue-500 "]: open && field.value
|
|
1789
1828
|
},
|
|
1790
1829
|
"uil uil-angle-down text-[18px]"
|
|
1791
1830
|
)
|
|
@@ -1864,16 +1903,7 @@ var FilterOptions = ({
|
|
|
1864
1903
|
}) })
|
|
1865
1904
|
] }),
|
|
1866
1905
|
loading && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-2 w-full my-4", children: [
|
|
1867
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1868
|
-
"img",
|
|
1869
|
-
{
|
|
1870
|
-
className: "animate-spin",
|
|
1871
|
-
src: "/spinner-gray.svg",
|
|
1872
|
-
alt: "circle",
|
|
1873
|
-
width: 13,
|
|
1874
|
-
height: 13
|
|
1875
|
-
}
|
|
1876
|
-
),
|
|
1906
|
+
/* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon, { className: "animate-spin w-[16px] h-[16px]" }),
|
|
1877
1907
|
"Carregando"
|
|
1878
1908
|
] }),
|
|
1879
1909
|
(data == null ? void 0 : data.length) === 0 && (filter == null ? void 0 : filter.length) > 0 && !loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-4", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-label text-p-md", children: emptyMessage }) }),
|
|
@@ -2009,7 +2039,7 @@ function InputMoney({
|
|
|
2009
2039
|
const fieldValidationMessages = [error == null ? void 0 : error.message];
|
|
2010
2040
|
const hasError = fieldValidationMessages.some((item) => item !== void 0);
|
|
2011
2041
|
const styles = {
|
|
2012
|
-
input: `text-p-md pl-2 peer text-paragraph shadow-input border
|
|
2042
|
+
input: `text-p-md pl-2 peer text-paragraph shadow-input border border-[0.5px] rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border ${label ? "pt-[22px]" : "pt-[10px]"} ${hasError ? "border-dangerous-500 text-dangerous-500" : "border-neutral-300 focus-visible:border-blue-500"}`,
|
|
2013
2043
|
icon: `absolute bg-neutral-100 h-[44px] top-[1px] left-[1px] w-[38px] rounded-l-lg ${hasError ? "text-dangerous-500" : "text-label"}
|
|
2014
2044
|
`,
|
|
2015
2045
|
label: "absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0"};
|
|
@@ -2027,8 +2057,7 @@ function InputMoney({
|
|
|
2027
2057
|
onChangeValue(value2);
|
|
2028
2058
|
}
|
|
2029
2059
|
};
|
|
2030
|
-
if (typeof field.value === "string")
|
|
2031
|
-
field.value = Number(field.value);
|
|
2060
|
+
if (typeof field.value === "string") field.value = Number(field.value);
|
|
2032
2061
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2033
2062
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative outline-none", children: [
|
|
2034
2063
|
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2132,7 +2161,7 @@ function InputNumber({
|
|
|
2132
2161
|
const fieldValidationMessages = [error == null ? void 0 : error.message];
|
|
2133
2162
|
const hasError = fieldValidationMessages.some((item) => item !== void 0);
|
|
2134
2163
|
const styles = {
|
|
2135
|
-
input: `text-p-md pl-2 peer shadow-input border
|
|
2164
|
+
input: `text-p-md pl-2 peer shadow-input border border-[0.5px] rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border-1 ${label ? "pt-[22px]" : "pt-[10px]"} ${hasError ? "border-dangerous-500 text-dangerous-500" : "border-neutral-300 focus-visible:border-blue-500"}`,
|
|
2136
2165
|
icon: `absolute bg-neutral-100 h-[44px] top-[2px] left-[1.5px] w-[38px] rounded-l-lg ${hasError ? "text-dangerous-500" : "text-label"}
|
|
2137
2166
|
`,
|
|
2138
2167
|
label: "absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0",
|
|
@@ -2345,7 +2374,7 @@ function InputPercentage({
|
|
|
2345
2374
|
const fieldValidationMessages = [error == null ? void 0 : error.message];
|
|
2346
2375
|
const hasError = fieldValidationMessages.some((item) => item !== void 0);
|
|
2347
2376
|
const styles = {
|
|
2348
|
-
input: `text-p-md pl-2 peer shadow-input border
|
|
2377
|
+
input: `text-p-md pl-2 peer shadow-input border border-[0.5px] rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border-1 ${label ? "pt-[22px]" : "pt-[10px]"} ${hasError ? "border-dangerous-500 text-dangerous-500" : "border-neutral-300 focus-visible:border-blue-500"}`,
|
|
2349
2378
|
icon: `absolute bg-neutral-100 h-[44px] top-[1px] left-[1.5px] w-[38px] text-[22px] rounded-lg ${hasError ? "text-dangerous-500" : "text-label"}
|
|
2350
2379
|
`,
|
|
2351
2380
|
label: "absolute text-label top-[0.80rem] z-10 origin-[0] transform -translate-y-3 scale-75 duration-300 text-sm peer-focus:text-blue-500 peer-focus:scale-75 peer-focus:-translate-y-3 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0"};
|
|
@@ -2556,7 +2585,7 @@ var ModalDialog = ({
|
|
|
2556
2585
|
marginRight: "-50%",
|
|
2557
2586
|
transform: "translate(-50%, -50%)",
|
|
2558
2587
|
border: "1px solid #E8E8E9",
|
|
2559
|
-
padding: "24px",
|
|
2588
|
+
padding: "20px 24px 24px 24px",
|
|
2560
2589
|
borderRadius: "8px",
|
|
2561
2590
|
overflow: "initial"
|
|
2562
2591
|
},
|
|
@@ -2598,7 +2627,7 @@ var ModalDialog = ({
|
|
|
2598
2627
|
)
|
|
2599
2628
|
] }),
|
|
2600
2629
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children }),
|
|
2601
|
-
showFooter && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-6
|
|
2630
|
+
showFooter && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-6 flex w-full items-center justify-between", children: [
|
|
2602
2631
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2603
2632
|
"div",
|
|
2604
2633
|
{
|
|
@@ -6768,7 +6797,7 @@ function ControlledInput({
|
|
|
6768
6797
|
const fieldValidationMessages = [error == null ? void 0 : error.message];
|
|
6769
6798
|
const hasError = fieldValidationMessages.some((item) => item !== void 0);
|
|
6770
6799
|
const styles = {
|
|
6771
|
-
input: `text-p-md pl-2 peer shadow-input border rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border-1 focus-visible:border-blue-500 ${label ? "pt-[22px]" : "pt-[10px]"}
|
|
6800
|
+
input: `text-p-md pl-2 peer shadow-input border border-[0.5px] rounded-lg outline-none block pb-[10px] h-[46px] w-full disabled:bg-neutral-100 focus-visible:border-1 focus-visible:border-blue-500 ${label ? "pt-[22px]" : "pt-[10px]"}
|
|
6772
6801
|
${!hasError ? "border-neutral-300" : ""}`,
|
|
6773
6802
|
icon: `absolute bg-neutral-100 h-[44px] top-[1px] left-[1.5px] w-[38px] rounded-l-lg text-[20px] ${hasError ? "text-dangerous-500" : "text-label"}`,
|
|
6774
6803
|
rightIcon: "absolute h-[44px] top-[1px] right-[1.5px] w-[38px] text-[22px]",
|