@mlw-packages/react-components 1.10.22 → 1.10.24
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.css +23 -0
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +18 -11
- package/dist/index.mjs +18 -11
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1203,6 +1203,9 @@ body {
|
|
|
1203
1203
|
.max-h-\[300px\] {
|
|
1204
1204
|
max-height: 300px;
|
|
1205
1205
|
}
|
|
1206
|
+
.max-h-\[85vh\] {
|
|
1207
|
+
max-height: 85vh;
|
|
1208
|
+
}
|
|
1206
1209
|
.max-h-\[95vh\] {
|
|
1207
1210
|
max-height: 95vh;
|
|
1208
1211
|
}
|
|
@@ -1499,6 +1502,9 @@ body {
|
|
|
1499
1502
|
.min-w-\[1\.5rem\] {
|
|
1500
1503
|
min-width: 1.5rem;
|
|
1501
1504
|
}
|
|
1505
|
+
.min-w-\[100px\] {
|
|
1506
|
+
min-width: 100px;
|
|
1507
|
+
}
|
|
1502
1508
|
.min-w-\[10rem\] {
|
|
1503
1509
|
min-width: 10rem;
|
|
1504
1510
|
}
|
|
@@ -1514,6 +1520,9 @@ body {
|
|
|
1514
1520
|
.min-w-\[200px\] {
|
|
1515
1521
|
min-width: 200px;
|
|
1516
1522
|
}
|
|
1523
|
+
.min-w-\[20px\] {
|
|
1524
|
+
min-width: 20px;
|
|
1525
|
+
}
|
|
1517
1526
|
.min-w-\[250px\] {
|
|
1518
1527
|
min-width: 250px;
|
|
1519
1528
|
}
|
|
@@ -3704,6 +3713,9 @@ body {
|
|
|
3704
3713
|
.pb-4 {
|
|
3705
3714
|
padding-bottom: 1rem;
|
|
3706
3715
|
}
|
|
3716
|
+
.pb-6 {
|
|
3717
|
+
padding-bottom: 1.5rem;
|
|
3718
|
+
}
|
|
3707
3719
|
.pb-7 {
|
|
3708
3720
|
padding-bottom: 1.75rem;
|
|
3709
3721
|
}
|
|
@@ -3776,6 +3788,9 @@ body {
|
|
|
3776
3788
|
.pt-4 {
|
|
3777
3789
|
padding-top: 1rem;
|
|
3778
3790
|
}
|
|
3791
|
+
.pt-6 {
|
|
3792
|
+
padding-top: 1.5rem;
|
|
3793
|
+
}
|
|
3779
3794
|
.text-left {
|
|
3780
3795
|
text-align: left;
|
|
3781
3796
|
}
|
|
@@ -5543,6 +5558,10 @@ body {
|
|
|
5543
5558
|
--tw-bg-opacity: 1;
|
|
5544
5559
|
background-color: rgb(241 245 249 / var(--tw-bg-opacity, 1));
|
|
5545
5560
|
}
|
|
5561
|
+
.hover\:bg-slate-50:hover {
|
|
5562
|
+
--tw-bg-opacity: 1;
|
|
5563
|
+
background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));
|
|
5564
|
+
}
|
|
5546
5565
|
.hover\:bg-teal-200\/80:hover {
|
|
5547
5566
|
background-color: rgb(153 246 228 / 0.8);
|
|
5548
5567
|
}
|
|
@@ -5614,6 +5633,10 @@ body {
|
|
|
5614
5633
|
--tw-text-opacity: 1;
|
|
5615
5634
|
color: rgb(248 250 252 / var(--tw-text-opacity, 1));
|
|
5616
5635
|
}
|
|
5636
|
+
.hover\:text-slate-600:hover {
|
|
5637
|
+
--tw-text-opacity: 1;
|
|
5638
|
+
color: rgb(71 85 105 / var(--tw-text-opacity, 1));
|
|
5639
|
+
}
|
|
5617
5640
|
.hover\:text-white:hover {
|
|
5618
5641
|
--tw-text-opacity: 1;
|
|
5619
5642
|
color: rgb(255 255 255 / var(--tw-text-opacity, 1));
|
package/dist/index.d.mts
CHANGED
|
@@ -225,11 +225,12 @@ declare const ModalTriggerBase: React$1.ForwardRefExoticComponent<DialogPrimitiv
|
|
|
225
225
|
declare const ModalPortalBase: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
226
226
|
declare const ModalCloseBase: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
227
227
|
declare const ModalOverlayBase: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & TestIdProps$1 & React$1.RefAttributes<HTMLDivElement>>;
|
|
228
|
-
type ModalSize = "sm" | "md" | "lg" | "full";
|
|
228
|
+
type ModalSize = "sm" | "md" | "lg" | "xl" | "full";
|
|
229
229
|
declare const ModalContentBase: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & TestIdProps$1 & {
|
|
230
230
|
size?: ModalSize;
|
|
231
231
|
centered?: boolean;
|
|
232
232
|
backdropBlur?: boolean;
|
|
233
|
+
noPadding?: boolean;
|
|
233
234
|
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
234
235
|
declare const ModalHeaderBase: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & TestIdProps$1 & React$1.RefAttributes<HTMLDivElement>>;
|
|
235
236
|
declare const ModalFooterBase: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & TestIdProps$1 & React$1.RefAttributes<HTMLDivElement>>;
|
|
@@ -1017,6 +1018,7 @@ interface EventCalendarProps$1 {
|
|
|
1017
1018
|
className?: string;
|
|
1018
1019
|
initialView?: CalendarViewAgenda;
|
|
1019
1020
|
initialDate?: Date;
|
|
1021
|
+
optionsViewEvents?: CalendarViewAgenda[];
|
|
1020
1022
|
onClick?: ((event: CalendarEventAgenda, e?: React__default.MouseEvent) => void) | React__default.ReactElement<ModalLikeProps>;
|
|
1021
1023
|
showYearView?: boolean;
|
|
1022
1024
|
noTime?: boolean;
|
|
@@ -1032,7 +1034,7 @@ interface ModalLikeProps {
|
|
|
1032
1034
|
onClose?: () => void;
|
|
1033
1035
|
[key: string]: unknown;
|
|
1034
1036
|
}
|
|
1035
|
-
declare function EventAgenda({ events, onEventUpdate, className, initialView, initialDate, onClick, showYearView, noTime, onlyDay, onlyMonth, onlyWeek, onlyAgenda, onlyYear, allowCellClick, }: EventCalendarProps$1): react_jsx_runtime.JSX.Element;
|
|
1037
|
+
declare function EventAgenda({ events, optionsViewEvents, onEventUpdate, className, initialView, initialDate, onClick, showYearView, noTime, onlyDay, onlyMonth, onlyWeek, onlyAgenda, onlyYear, allowCellClick, }: EventCalendarProps$1): react_jsx_runtime.JSX.Element;
|
|
1036
1038
|
|
|
1037
1039
|
interface EventItemProps$1 {
|
|
1038
1040
|
event: CalendarEventAgenda;
|
package/dist/index.d.ts
CHANGED
|
@@ -225,11 +225,12 @@ declare const ModalTriggerBase: React$1.ForwardRefExoticComponent<DialogPrimitiv
|
|
|
225
225
|
declare const ModalPortalBase: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
226
226
|
declare const ModalCloseBase: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
227
227
|
declare const ModalOverlayBase: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & TestIdProps$1 & React$1.RefAttributes<HTMLDivElement>>;
|
|
228
|
-
type ModalSize = "sm" | "md" | "lg" | "full";
|
|
228
|
+
type ModalSize = "sm" | "md" | "lg" | "xl" | "full";
|
|
229
229
|
declare const ModalContentBase: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & TestIdProps$1 & {
|
|
230
230
|
size?: ModalSize;
|
|
231
231
|
centered?: boolean;
|
|
232
232
|
backdropBlur?: boolean;
|
|
233
|
+
noPadding?: boolean;
|
|
233
234
|
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
234
235
|
declare const ModalHeaderBase: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & TestIdProps$1 & React$1.RefAttributes<HTMLDivElement>>;
|
|
235
236
|
declare const ModalFooterBase: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & TestIdProps$1 & React$1.RefAttributes<HTMLDivElement>>;
|
|
@@ -1017,6 +1018,7 @@ interface EventCalendarProps$1 {
|
|
|
1017
1018
|
className?: string;
|
|
1018
1019
|
initialView?: CalendarViewAgenda;
|
|
1019
1020
|
initialDate?: Date;
|
|
1021
|
+
optionsViewEvents?: CalendarViewAgenda[];
|
|
1020
1022
|
onClick?: ((event: CalendarEventAgenda, e?: React__default.MouseEvent) => void) | React__default.ReactElement<ModalLikeProps>;
|
|
1021
1023
|
showYearView?: boolean;
|
|
1022
1024
|
noTime?: boolean;
|
|
@@ -1032,7 +1034,7 @@ interface ModalLikeProps {
|
|
|
1032
1034
|
onClose?: () => void;
|
|
1033
1035
|
[key: string]: unknown;
|
|
1034
1036
|
}
|
|
1035
|
-
declare function EventAgenda({ events, onEventUpdate, className, initialView, initialDate, onClick, showYearView, noTime, onlyDay, onlyMonth, onlyWeek, onlyAgenda, onlyYear, allowCellClick, }: EventCalendarProps$1): react_jsx_runtime.JSX.Element;
|
|
1037
|
+
declare function EventAgenda({ events, optionsViewEvents, onEventUpdate, className, initialView, initialDate, onClick, showYearView, noTime, onlyDay, onlyMonth, onlyWeek, onlyAgenda, onlyYear, allowCellClick, }: EventCalendarProps$1): react_jsx_runtime.JSX.Element;
|
|
1036
1038
|
|
|
1037
1039
|
interface EventItemProps$1 {
|
|
1038
1040
|
event: CalendarEventAgenda;
|
package/dist/index.js
CHANGED
|
@@ -1664,9 +1664,16 @@ var ModalContentBase = React32__namespace.forwardRef(
|
|
|
1664
1664
|
size = "md",
|
|
1665
1665
|
centered = true,
|
|
1666
1666
|
backdropBlur = true,
|
|
1667
|
+
noPadding = false,
|
|
1667
1668
|
...props
|
|
1668
1669
|
}, ref) => {
|
|
1669
|
-
const sizeClass =
|
|
1670
|
+
const sizeClass = {
|
|
1671
|
+
sm: "max-w-md",
|
|
1672
|
+
md: "max-w-2xl",
|
|
1673
|
+
lg: "max-w-4xl",
|
|
1674
|
+
xl: "max-w-6xl",
|
|
1675
|
+
full: "w-full max-w-[calc(100%-2rem)]"
|
|
1676
|
+
}[size];
|
|
1670
1677
|
const positionClass = centered ? "left-[50%] top-[50%] translate-x-[-50%] translate-y-[-50%]" : "left-[50%] top-20 translate-x-[-50%] translate-y-0 sm:translate-y-0";
|
|
1671
1678
|
return /* @__PURE__ */ jsxRuntime.jsxs(ModalPortalBase, { children: [
|
|
1672
1679
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1699,8 +1706,9 @@ var ModalContentBase = React32__namespace.forwardRef(
|
|
|
1699
1706
|
{
|
|
1700
1707
|
ref,
|
|
1701
1708
|
className: cn(
|
|
1702
|
-
"fixed z-50 grid w-[calc(100%-2rem)]
|
|
1709
|
+
"fixed z-50 grid w-[calc(100%-2rem)] border bg-background shadow-lg rounded-md sm:rounded-lg max-h-[calc(100dvh-2rem)] sm:max-h-[90dvh] overflow-auto",
|
|
1703
1710
|
"data-[state=open]:animate-modal-in data-[state=closed]:animate-modal-out border-border",
|
|
1711
|
+
!noPadding && "p-4 sm:p-6 gap-3 sm:gap-4",
|
|
1704
1712
|
positionClass,
|
|
1705
1713
|
sizeClass,
|
|
1706
1714
|
className
|
|
@@ -10219,6 +10227,7 @@ function Select({
|
|
|
10219
10227
|
}
|
|
10220
10228
|
function EventAgenda({
|
|
10221
10229
|
events = [],
|
|
10230
|
+
optionsViewEvents,
|
|
10222
10231
|
onEventUpdate,
|
|
10223
10232
|
className,
|
|
10224
10233
|
initialView = "month",
|
|
@@ -10231,7 +10240,7 @@ function EventAgenda({
|
|
|
10231
10240
|
onlyWeek,
|
|
10232
10241
|
onlyAgenda,
|
|
10233
10242
|
onlyYear,
|
|
10234
|
-
allowCellClick =
|
|
10243
|
+
allowCellClick = true
|
|
10235
10244
|
}) {
|
|
10236
10245
|
const lockedView = onlyDay ? "day" : onlyMonth ? "month" : onlyWeek ? "week" : onlyAgenda ? "agenda" : onlyYear ? "year" : void 0;
|
|
10237
10246
|
const [currentDate, setCurrentDate] = React32.useState(
|
|
@@ -10326,7 +10335,10 @@ function EventAgenda({
|
|
|
10326
10335
|
}
|
|
10327
10336
|
return capitalize2(dateFns.format(currentDate, "MMMM yyyy", { locale: locale.ptBR }));
|
|
10328
10337
|
}, [currentDate, activeView]);
|
|
10329
|
-
|
|
10338
|
+
let availableViews;
|
|
10339
|
+
if (optionsViewEvents?.length == 0 || !optionsViewEvents)
|
|
10340
|
+
availableViews = showYearView ? ["year", "month", "week", "day", "agenda"] : ["month", "week", "day", "agenda"];
|
|
10341
|
+
else availableViews = [...new Set(optionsViewEvents.map((options) => options))];
|
|
10330
10342
|
const selectItems = availableViews.map(
|
|
10331
10343
|
(v) => ({
|
|
10332
10344
|
label: viewLabel(v),
|
|
@@ -10425,12 +10437,7 @@ function EventAgenda({
|
|
|
10425
10437
|
events,
|
|
10426
10438
|
onEventSelect: handleEventSelect,
|
|
10427
10439
|
noTime,
|
|
10428
|
-
onEventCreate: allowCellClick ? (d) =>
|
|
10429
|
-
start: d,
|
|
10430
|
-
end: d,
|
|
10431
|
-
title: "Novo Evento",
|
|
10432
|
-
id: crypto.randomUUID()
|
|
10433
|
-
}) : void 0
|
|
10440
|
+
onEventCreate: allowCellClick ? (d) => console.log(d) : void 0
|
|
10434
10441
|
}
|
|
10435
10442
|
),
|
|
10436
10443
|
activeView === "agenda" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -21411,7 +21418,7 @@ function CarouselBase({
|
|
|
21411
21418
|
setDownloadSuccess(true);
|
|
21412
21419
|
setTimeout(() => setDownloadSuccess(false), 2e3);
|
|
21413
21420
|
} catch (error) {
|
|
21414
|
-
|
|
21421
|
+
sonner.toast.error(
|
|
21415
21422
|
"Erro ao baixar imagem. Verifique a URL ou permiss\xF5es do servidor."
|
|
21416
21423
|
);
|
|
21417
21424
|
console.error("Error downloading image:", error);
|
package/dist/index.mjs
CHANGED
|
@@ -1622,9 +1622,16 @@ var ModalContentBase = React32.forwardRef(
|
|
|
1622
1622
|
size = "md",
|
|
1623
1623
|
centered = true,
|
|
1624
1624
|
backdropBlur = true,
|
|
1625
|
+
noPadding = false,
|
|
1625
1626
|
...props
|
|
1626
1627
|
}, ref) => {
|
|
1627
|
-
const sizeClass =
|
|
1628
|
+
const sizeClass = {
|
|
1629
|
+
sm: "max-w-md",
|
|
1630
|
+
md: "max-w-2xl",
|
|
1631
|
+
lg: "max-w-4xl",
|
|
1632
|
+
xl: "max-w-6xl",
|
|
1633
|
+
full: "w-full max-w-[calc(100%-2rem)]"
|
|
1634
|
+
}[size];
|
|
1628
1635
|
const positionClass = centered ? "left-[50%] top-[50%] translate-x-[-50%] translate-y-[-50%]" : "left-[50%] top-20 translate-x-[-50%] translate-y-0 sm:translate-y-0";
|
|
1629
1636
|
return /* @__PURE__ */ jsxs(ModalPortalBase, { children: [
|
|
1630
1637
|
/* @__PURE__ */ jsx(
|
|
@@ -1657,8 +1664,9 @@ var ModalContentBase = React32.forwardRef(
|
|
|
1657
1664
|
{
|
|
1658
1665
|
ref,
|
|
1659
1666
|
className: cn(
|
|
1660
|
-
"fixed z-50 grid w-[calc(100%-2rem)]
|
|
1667
|
+
"fixed z-50 grid w-[calc(100%-2rem)] border bg-background shadow-lg rounded-md sm:rounded-lg max-h-[calc(100dvh-2rem)] sm:max-h-[90dvh] overflow-auto",
|
|
1661
1668
|
"data-[state=open]:animate-modal-in data-[state=closed]:animate-modal-out border-border",
|
|
1669
|
+
!noPadding && "p-4 sm:p-6 gap-3 sm:gap-4",
|
|
1662
1670
|
positionClass,
|
|
1663
1671
|
sizeClass,
|
|
1664
1672
|
className
|
|
@@ -10177,6 +10185,7 @@ function Select({
|
|
|
10177
10185
|
}
|
|
10178
10186
|
function EventAgenda({
|
|
10179
10187
|
events = [],
|
|
10188
|
+
optionsViewEvents,
|
|
10180
10189
|
onEventUpdate,
|
|
10181
10190
|
className,
|
|
10182
10191
|
initialView = "month",
|
|
@@ -10189,7 +10198,7 @@ function EventAgenda({
|
|
|
10189
10198
|
onlyWeek,
|
|
10190
10199
|
onlyAgenda,
|
|
10191
10200
|
onlyYear,
|
|
10192
|
-
allowCellClick =
|
|
10201
|
+
allowCellClick = true
|
|
10193
10202
|
}) {
|
|
10194
10203
|
const lockedView = onlyDay ? "day" : onlyMonth ? "month" : onlyWeek ? "week" : onlyAgenda ? "agenda" : onlyYear ? "year" : void 0;
|
|
10195
10204
|
const [currentDate, setCurrentDate] = useState(
|
|
@@ -10284,7 +10293,10 @@ function EventAgenda({
|
|
|
10284
10293
|
}
|
|
10285
10294
|
return capitalize2(format(currentDate, "MMMM yyyy", { locale: ptBR }));
|
|
10286
10295
|
}, [currentDate, activeView]);
|
|
10287
|
-
|
|
10296
|
+
let availableViews;
|
|
10297
|
+
if (optionsViewEvents?.length == 0 || !optionsViewEvents)
|
|
10298
|
+
availableViews = showYearView ? ["year", "month", "week", "day", "agenda"] : ["month", "week", "day", "agenda"];
|
|
10299
|
+
else availableViews = [...new Set(optionsViewEvents.map((options) => options))];
|
|
10288
10300
|
const selectItems = availableViews.map(
|
|
10289
10301
|
(v) => ({
|
|
10290
10302
|
label: viewLabel(v),
|
|
@@ -10383,12 +10395,7 @@ function EventAgenda({
|
|
|
10383
10395
|
events,
|
|
10384
10396
|
onEventSelect: handleEventSelect,
|
|
10385
10397
|
noTime,
|
|
10386
|
-
onEventCreate: allowCellClick ? (d) =>
|
|
10387
|
-
start: d,
|
|
10388
|
-
end: d,
|
|
10389
|
-
title: "Novo Evento",
|
|
10390
|
-
id: crypto.randomUUID()
|
|
10391
|
-
}) : void 0
|
|
10398
|
+
onEventCreate: allowCellClick ? (d) => console.log(d) : void 0
|
|
10392
10399
|
}
|
|
10393
10400
|
),
|
|
10394
10401
|
activeView === "agenda" && /* @__PURE__ */ jsx(
|
|
@@ -21369,7 +21376,7 @@ function CarouselBase({
|
|
|
21369
21376
|
setDownloadSuccess(true);
|
|
21370
21377
|
setTimeout(() => setDownloadSuccess(false), 2e3);
|
|
21371
21378
|
} catch (error) {
|
|
21372
|
-
|
|
21379
|
+
toast$1.error(
|
|
21373
21380
|
"Erro ao baixar imagem. Verifique a URL ou permiss\xF5es do servidor."
|
|
21374
21381
|
);
|
|
21375
21382
|
console.error("Error downloading image:", error);
|