@mlw-packages/react-components 1.10.18 → 1.10.19
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 +64 -7
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +45 -32
- package/dist/index.mjs +45 -32
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -516,6 +516,9 @@ body {
|
|
|
516
516
|
.left-\[50\%\] {
|
|
517
517
|
left: 50%;
|
|
518
518
|
}
|
|
519
|
+
.left-\[calc\(100\%\+8px\)\] {
|
|
520
|
+
left: calc(100% + 8px);
|
|
521
|
+
}
|
|
519
522
|
.left-full {
|
|
520
523
|
left: 100%;
|
|
521
524
|
}
|
|
@@ -543,6 +546,9 @@ body {
|
|
|
543
546
|
.right-6 {
|
|
544
547
|
right: 1.5rem;
|
|
545
548
|
}
|
|
549
|
+
.right-\[calc\(100\%\+8px\)\] {
|
|
550
|
+
right: calc(100% + 8px);
|
|
551
|
+
}
|
|
546
552
|
.top-0 {
|
|
547
553
|
top: 0px;
|
|
548
554
|
}
|
|
@@ -2295,6 +2301,10 @@ body {
|
|
|
2295
2301
|
.border-amber-200\/70 {
|
|
2296
2302
|
border-color: rgb(253 230 138 / 0.7);
|
|
2297
2303
|
}
|
|
2304
|
+
.border-amber-300 {
|
|
2305
|
+
--tw-border-opacity: 1;
|
|
2306
|
+
border-color: rgb(252 211 77 / var(--tw-border-opacity, 1));
|
|
2307
|
+
}
|
|
2298
2308
|
.border-amber-400 {
|
|
2299
2309
|
--tw-border-opacity: 1;
|
|
2300
2310
|
border-color: rgb(251 191 36 / var(--tw-border-opacity, 1));
|
|
@@ -2538,10 +2548,6 @@ body {
|
|
|
2538
2548
|
--tw-border-opacity: 1;
|
|
2539
2549
|
border-color: rgb(254 240 138 / var(--tw-border-opacity, 1));
|
|
2540
2550
|
}
|
|
2541
|
-
.border-yellow-300 {
|
|
2542
|
-
--tw-border-opacity: 1;
|
|
2543
|
-
border-color: rgb(253 224 71 / var(--tw-border-opacity, 1));
|
|
2544
|
-
}
|
|
2545
2551
|
.border-zinc-300 {
|
|
2546
2552
|
--tw-border-opacity: 1;
|
|
2547
2553
|
border-color: rgb(212 212 216 / var(--tw-border-opacity, 1));
|
|
@@ -3743,6 +3749,9 @@ body {
|
|
|
3743
3749
|
.pt-1 {
|
|
3744
3750
|
padding-top: 0.25rem;
|
|
3745
3751
|
}
|
|
3752
|
+
.pt-1\.5 {
|
|
3753
|
+
padding-top: 0.375rem;
|
|
3754
|
+
}
|
|
3746
3755
|
.pt-14 {
|
|
3747
3756
|
padding-top: 3.5rem;
|
|
3748
3757
|
}
|
|
@@ -4035,9 +4044,6 @@ body {
|
|
|
4035
4044
|
.text-foreground {
|
|
4036
4045
|
color: hsl(var(--foreground));
|
|
4037
4046
|
}
|
|
4038
|
-
.text-foreground\/30 {
|
|
4039
|
-
color: hsl(var(--foreground) / 0.3);
|
|
4040
|
-
}
|
|
4041
4047
|
.text-foreground\/40 {
|
|
4042
4048
|
color: hsl(var(--foreground) / 0.4);
|
|
4043
4049
|
}
|
|
@@ -6823,12 +6829,20 @@ body {
|
|
|
6823
6829
|
.dark\:border-amber-400\/30:is(.dark *) {
|
|
6824
6830
|
border-color: rgb(251 191 36 / 0.3);
|
|
6825
6831
|
}
|
|
6832
|
+
.dark\:border-amber-600:is(.dark *) {
|
|
6833
|
+
--tw-border-opacity: 1;
|
|
6834
|
+
border-color: rgb(217 119 6 / var(--tw-border-opacity, 1));
|
|
6835
|
+
}
|
|
6826
6836
|
.dark\:border-blue-400\/30:is(.dark *) {
|
|
6827
6837
|
border-color: rgb(96 165 250 / 0.3);
|
|
6828
6838
|
}
|
|
6829
6839
|
.dark\:border-cyan-400\/30:is(.dark *) {
|
|
6830
6840
|
border-color: rgb(34 211 238 / 0.3);
|
|
6831
6841
|
}
|
|
6842
|
+
.dark\:border-cyan-800:is(.dark *) {
|
|
6843
|
+
--tw-border-opacity: 1;
|
|
6844
|
+
border-color: rgb(21 94 117 / var(--tw-border-opacity, 1));
|
|
6845
|
+
}
|
|
6832
6846
|
.dark\:border-emerald-400\/30:is(.dark *) {
|
|
6833
6847
|
border-color: rgb(52 211 153 / 0.3);
|
|
6834
6848
|
}
|
|
@@ -6843,6 +6857,10 @@ body {
|
|
|
6843
6857
|
--tw-border-opacity: 1;
|
|
6844
6858
|
border-color: rgb(55 65 81 / var(--tw-border-opacity, 1));
|
|
6845
6859
|
}
|
|
6860
|
+
.dark\:border-gray-800:is(.dark *) {
|
|
6861
|
+
--tw-border-opacity: 1;
|
|
6862
|
+
border-color: rgb(31 41 55 / var(--tw-border-opacity, 1));
|
|
6863
|
+
}
|
|
6846
6864
|
.dark\:border-gray-900:is(.dark *) {
|
|
6847
6865
|
--tw-border-opacity: 1;
|
|
6848
6866
|
border-color: rgb(17 24 39 / var(--tw-border-opacity, 1));
|
|
@@ -6874,6 +6892,10 @@ body {
|
|
|
6874
6892
|
.dark\:border-orange-400\/30:is(.dark *) {
|
|
6875
6893
|
border-color: rgb(251 146 60 / 0.3);
|
|
6876
6894
|
}
|
|
6895
|
+
.dark\:border-orange-800:is(.dark *) {
|
|
6896
|
+
--tw-border-opacity: 1;
|
|
6897
|
+
border-color: rgb(154 52 18 / var(--tw-border-opacity, 1));
|
|
6898
|
+
}
|
|
6877
6899
|
.dark\:border-pink-400\/30:is(.dark *) {
|
|
6878
6900
|
border-color: rgb(244 114 182 / 0.3);
|
|
6879
6901
|
}
|
|
@@ -6926,6 +6948,10 @@ body {
|
|
|
6926
6948
|
.dark\:bg-amber-400\/25:is(.dark *) {
|
|
6927
6949
|
background-color: rgb(251 191 36 / 0.25);
|
|
6928
6950
|
}
|
|
6951
|
+
.dark\:bg-amber-50:is(.dark *) {
|
|
6952
|
+
--tw-bg-opacity: 1;
|
|
6953
|
+
background-color: rgb(255 251 235 / var(--tw-bg-opacity, 1));
|
|
6954
|
+
}
|
|
6929
6955
|
.dark\:bg-amber-500\/25:is(.dark *) {
|
|
6930
6956
|
background-color: rgb(245 158 11 / 0.25);
|
|
6931
6957
|
}
|
|
@@ -7125,6 +7151,10 @@ body {
|
|
|
7125
7151
|
--tw-text-opacity: 1;
|
|
7126
7152
|
color: rgb(255 251 235 / var(--tw-text-opacity, 1));
|
|
7127
7153
|
}
|
|
7154
|
+
.dark\:text-amber-600:is(.dark *) {
|
|
7155
|
+
--tw-text-opacity: 1;
|
|
7156
|
+
color: rgb(217 119 6 / var(--tw-text-opacity, 1));
|
|
7157
|
+
}
|
|
7128
7158
|
.dark\:text-black:is(.dark *) {
|
|
7129
7159
|
--tw-text-opacity: 1;
|
|
7130
7160
|
color: rgb(0 0 0 / var(--tw-text-opacity, 1));
|
|
@@ -7141,6 +7171,10 @@ body {
|
|
|
7141
7171
|
--tw-text-opacity: 1;
|
|
7142
7172
|
color: rgb(236 254 255 / var(--tw-text-opacity, 1));
|
|
7143
7173
|
}
|
|
7174
|
+
.dark\:text-cyan-800:is(.dark *) {
|
|
7175
|
+
--tw-text-opacity: 1;
|
|
7176
|
+
color: rgb(21 94 117 / var(--tw-text-opacity, 1));
|
|
7177
|
+
}
|
|
7144
7178
|
.dark\:text-emerald-200:is(.dark *) {
|
|
7145
7179
|
--tw-text-opacity: 1;
|
|
7146
7180
|
color: rgb(167 243 208 / var(--tw-text-opacity, 1));
|
|
@@ -7164,6 +7198,10 @@ body {
|
|
|
7164
7198
|
--tw-text-opacity: 1;
|
|
7165
7199
|
color: rgb(209 213 219 / var(--tw-text-opacity, 1));
|
|
7166
7200
|
}
|
|
7201
|
+
.dark\:text-gray-800:is(.dark *) {
|
|
7202
|
+
--tw-text-opacity: 1;
|
|
7203
|
+
color: rgb(31 41 55 / var(--tw-text-opacity, 1));
|
|
7204
|
+
}
|
|
7167
7205
|
.dark\:text-green-50:is(.dark *) {
|
|
7168
7206
|
--tw-text-opacity: 1;
|
|
7169
7207
|
color: rgb(240 253 244 / var(--tw-text-opacity, 1));
|
|
@@ -7196,6 +7234,10 @@ body {
|
|
|
7196
7234
|
--tw-text-opacity: 1;
|
|
7197
7235
|
color: rgb(255 247 237 / var(--tw-text-opacity, 1));
|
|
7198
7236
|
}
|
|
7237
|
+
.dark\:text-orange-800:is(.dark *) {
|
|
7238
|
+
--tw-text-opacity: 1;
|
|
7239
|
+
color: rgb(154 52 18 / var(--tw-text-opacity, 1));
|
|
7240
|
+
}
|
|
7199
7241
|
.dark\:text-pink-50:is(.dark *) {
|
|
7200
7242
|
--tw-text-opacity: 1;
|
|
7201
7243
|
color: rgb(253 242 248 / var(--tw-text-opacity, 1));
|
|
@@ -8171,6 +8213,15 @@ body {
|
|
|
8171
8213
|
.\[\&_a\]\:underline a {
|
|
8172
8214
|
text-decoration-line: underline;
|
|
8173
8215
|
}
|
|
8216
|
+
.\[\&_li\]\:pl-1 li {
|
|
8217
|
+
padding-left: 0.25rem;
|
|
8218
|
+
}
|
|
8219
|
+
.\[\&_ol\]\:ml-4 ol {
|
|
8220
|
+
margin-left: 1rem;
|
|
8221
|
+
}
|
|
8222
|
+
.\[\&_ol\]\:list-decimal ol {
|
|
8223
|
+
list-style-type: decimal;
|
|
8224
|
+
}
|
|
8174
8225
|
.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-3 svg:not([class*=size-]) {
|
|
8175
8226
|
width: 0.75rem;
|
|
8176
8227
|
height: 0.75rem;
|
|
@@ -8198,6 +8249,12 @@ body {
|
|
|
8198
8249
|
.\[\&_tr\]\:border-b tr {
|
|
8199
8250
|
border-bottom-width: 1px;
|
|
8200
8251
|
}
|
|
8252
|
+
.\[\&_ul\]\:ml-4 ul {
|
|
8253
|
+
margin-left: 1rem;
|
|
8254
|
+
}
|
|
8255
|
+
.\[\&_ul\]\:list-disc ul {
|
|
8256
|
+
list-style-type: disc;
|
|
8257
|
+
}
|
|
8201
8258
|
[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2 {
|
|
8202
8259
|
right: -0.5rem;
|
|
8203
8260
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1010,13 +1010,18 @@ interface EventCalendarProps$1 {
|
|
|
1010
1010
|
onClick?: ((event: CalendarEventAgenda, e?: React__default.MouseEvent) => void) | React__default.ReactElement<ModalLikeProps>;
|
|
1011
1011
|
showYearView?: boolean;
|
|
1012
1012
|
noTime?: boolean;
|
|
1013
|
+
onlyDay?: boolean;
|
|
1014
|
+
onlyMonth?: boolean;
|
|
1015
|
+
onlyWeek?: boolean;
|
|
1016
|
+
onlyAgenda?: boolean;
|
|
1017
|
+
onlyYear?: boolean;
|
|
1013
1018
|
}
|
|
1014
1019
|
interface ModalLikeProps {
|
|
1015
1020
|
event?: CalendarEventAgenda;
|
|
1016
1021
|
onClose?: () => void;
|
|
1017
1022
|
[key: string]: unknown;
|
|
1018
1023
|
}
|
|
1019
|
-
declare function EventAgenda({ events, onEventUpdate, className, initialView, initialDate, onClick, showYearView, noTime, }: EventCalendarProps$1): react_jsx_runtime.JSX.Element;
|
|
1024
|
+
declare function EventAgenda({ events, onEventUpdate, className, initialView, initialDate, onClick, showYearView, noTime, onlyDay, onlyMonth, onlyWeek, onlyAgenda, onlyYear, }: EventCalendarProps$1): react_jsx_runtime.JSX.Element;
|
|
1020
1025
|
|
|
1021
1026
|
interface EventItemProps$1 {
|
|
1022
1027
|
event: CalendarEventAgenda;
|
package/dist/index.d.ts
CHANGED
|
@@ -1010,13 +1010,18 @@ interface EventCalendarProps$1 {
|
|
|
1010
1010
|
onClick?: ((event: CalendarEventAgenda, e?: React__default.MouseEvent) => void) | React__default.ReactElement<ModalLikeProps>;
|
|
1011
1011
|
showYearView?: boolean;
|
|
1012
1012
|
noTime?: boolean;
|
|
1013
|
+
onlyDay?: boolean;
|
|
1014
|
+
onlyMonth?: boolean;
|
|
1015
|
+
onlyWeek?: boolean;
|
|
1016
|
+
onlyAgenda?: boolean;
|
|
1017
|
+
onlyYear?: boolean;
|
|
1013
1018
|
}
|
|
1014
1019
|
interface ModalLikeProps {
|
|
1015
1020
|
event?: CalendarEventAgenda;
|
|
1016
1021
|
onClose?: () => void;
|
|
1017
1022
|
[key: string]: unknown;
|
|
1018
1023
|
}
|
|
1019
|
-
declare function EventAgenda({ events, onEventUpdate, className, initialView, initialDate, onClick, showYearView, noTime, }: EventCalendarProps$1): react_jsx_runtime.JSX.Element;
|
|
1024
|
+
declare function EventAgenda({ events, onEventUpdate, className, initialView, initialDate, onClick, showYearView, noTime, onlyDay, onlyMonth, onlyWeek, onlyAgenda, onlyYear, }: EventCalendarProps$1): react_jsx_runtime.JSX.Element;
|
|
1020
1025
|
|
|
1021
1026
|
interface EventItemProps$1 {
|
|
1022
1027
|
event: CalendarEventAgenda;
|
package/dist/index.js
CHANGED
|
@@ -2590,10 +2590,10 @@ function Badge({
|
|
|
2590
2590
|
purple: "bg-purple-50 text-purple-500 border-purple-200"
|
|
2591
2591
|
};
|
|
2592
2592
|
const rankClasses = {
|
|
2593
|
-
diamond: "bg-cyan-100 text-cyan-600 border-cyan-300",
|
|
2594
|
-
gold: "bg-
|
|
2595
|
-
silver: "bg-gray-100 text-gray-500 border-gray-300",
|
|
2596
|
-
bronze: "bg-orange-100 text-orange-700 border-orange-300"
|
|
2593
|
+
diamond: "bg-cyan-100 text-cyan-600 border-cyan-300 dark:text-cyan-800 dark:border-cyan-800",
|
|
2594
|
+
gold: "bg-amber-50 text-amber-500 border-amber-300 dark:text-amber-600 dark:border-amber-600 dark:bg-amber-50",
|
|
2595
|
+
silver: "bg-gray-100 text-gray-500 border-gray-300 dark:text-gray-800 dark:border-gray-800",
|
|
2596
|
+
bronze: "bg-orange-100 text-orange-700 border-orange-300 dark:text-orange-800 dark:border-orange-800"
|
|
2597
2597
|
};
|
|
2598
2598
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2599
2599
|
Comp,
|
|
@@ -10176,28 +10176,37 @@ function EventAgenda({
|
|
|
10176
10176
|
initialDate,
|
|
10177
10177
|
onClick,
|
|
10178
10178
|
showYearView = false,
|
|
10179
|
-
noTime = false
|
|
10179
|
+
noTime = false,
|
|
10180
|
+
onlyDay,
|
|
10181
|
+
onlyMonth,
|
|
10182
|
+
onlyWeek,
|
|
10183
|
+
onlyAgenda,
|
|
10184
|
+
onlyYear
|
|
10180
10185
|
}) {
|
|
10186
|
+
const lockedView = onlyDay ? "day" : onlyMonth ? "month" : onlyWeek ? "week" : onlyAgenda ? "agenda" : onlyYear ? "year" : void 0;
|
|
10181
10187
|
const [currentDate, setCurrentDate] = React32.useState(
|
|
10182
10188
|
initialDate && new Date(initialDate) || /* @__PURE__ */ new Date()
|
|
10183
10189
|
);
|
|
10184
|
-
const [view, setView] = React32.useState(
|
|
10190
|
+
const [view, setView] = React32.useState(
|
|
10191
|
+
lockedView || initialView
|
|
10192
|
+
);
|
|
10185
10193
|
const [selectedEvent, setSelectedEvent] = React32.useState(null);
|
|
10194
|
+
const activeView = lockedView || view;
|
|
10186
10195
|
const goPrevious = () => {
|
|
10187
|
-
if (
|
|
10188
|
-
else if (
|
|
10189
|
-
else if (
|
|
10190
|
-
else if (
|
|
10196
|
+
if (activeView === "month") setCurrentDate((d) => dateFns.subMonths(d, 1));
|
|
10197
|
+
else if (activeView === "week") setCurrentDate((d) => dateFns.subWeeks(d, 1));
|
|
10198
|
+
else if (activeView === "day") setCurrentDate((d) => dateFns.addDays(d, -1));
|
|
10199
|
+
else if (activeView === "agenda")
|
|
10191
10200
|
setCurrentDate((d) => dateFns.addDays(d, -AgendaDaysToShowAgenda));
|
|
10192
|
-
else if (
|
|
10201
|
+
else if (activeView === "year") setCurrentDate((d) => dateFns.subYears(d, 1));
|
|
10193
10202
|
};
|
|
10194
10203
|
const goNext = () => {
|
|
10195
|
-
if (
|
|
10196
|
-
else if (
|
|
10197
|
-
else if (
|
|
10198
|
-
else if (
|
|
10204
|
+
if (activeView === "month") setCurrentDate((d) => dateFns.addMonths(d, 1));
|
|
10205
|
+
else if (activeView === "week") setCurrentDate((d) => dateFns.addWeeks(d, 1));
|
|
10206
|
+
else if (activeView === "day") setCurrentDate((d) => dateFns.addDays(d, 1));
|
|
10207
|
+
else if (activeView === "agenda")
|
|
10199
10208
|
setCurrentDate((d) => dateFns.addDays(d, AgendaDaysToShowAgenda));
|
|
10200
|
-
else if (
|
|
10209
|
+
else if (activeView === "year") setCurrentDate((d) => dateFns.addYears(d, 1));
|
|
10201
10210
|
};
|
|
10202
10211
|
const handleEventSelect = (event, e) => {
|
|
10203
10212
|
try {
|
|
@@ -10243,9 +10252,9 @@ function EventAgenda({
|
|
|
10243
10252
|
};
|
|
10244
10253
|
const viewTitle = React32.useMemo(() => {
|
|
10245
10254
|
const capitalize2 = (s) => s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
|
|
10246
|
-
if (
|
|
10255
|
+
if (activeView === "month")
|
|
10247
10256
|
return capitalize2(dateFns.format(currentDate, "MMMM yyyy", { locale: locale.ptBR }));
|
|
10248
|
-
if (
|
|
10257
|
+
if (activeView === "week") {
|
|
10249
10258
|
const start = dateFns.startOfWeek(currentDate, { weekStartsOn: 1 });
|
|
10250
10259
|
const end = dateFns.endOfWeek(currentDate, { weekStartsOn: 1 });
|
|
10251
10260
|
if (dateFns.isSameMonth(start, end))
|
|
@@ -10254,17 +10263,19 @@ function EventAgenda({
|
|
|
10254
10263
|
const s2 = capitalize2(dateFns.format(end, "MMM yyyy", { locale: locale.ptBR }));
|
|
10255
10264
|
return `${s1} - ${s2}`;
|
|
10256
10265
|
}
|
|
10257
|
-
if (
|
|
10258
|
-
return
|
|
10259
|
-
|
|
10266
|
+
if (activeView === "day")
|
|
10267
|
+
return capitalize2(
|
|
10268
|
+
dateFns.format(currentDate, "EEEE, d 'de' MMMM", { locale: locale.ptBR })
|
|
10269
|
+
);
|
|
10270
|
+
if (activeView === "agenda") {
|
|
10260
10271
|
const start = currentDate;
|
|
10261
10272
|
return capitalize2(dateFns.format(start, "MMMM yyyy", { locale: locale.ptBR }));
|
|
10262
10273
|
}
|
|
10263
|
-
if (
|
|
10274
|
+
if (activeView === "year") {
|
|
10264
10275
|
return dateFns.format(currentDate, "yyyy");
|
|
10265
10276
|
}
|
|
10266
10277
|
return capitalize2(dateFns.format(currentDate, "MMMM yyyy", { locale: locale.ptBR }));
|
|
10267
|
-
}, [currentDate,
|
|
10278
|
+
}, [currentDate, activeView]);
|
|
10268
10279
|
const availableViews = showYearView ? ["year", "month", "week", "day", "agenda"] : ["month", "week", "day", "agenda"];
|
|
10269
10280
|
const selectItems = availableViews.map(
|
|
10270
10281
|
(v) => ({
|
|
@@ -10312,22 +10323,22 @@ function EventAgenda({
|
|
|
10312
10323
|
] }),
|
|
10313
10324
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-semibold text-sm sm:text-base md:text-lg lg:text-xl xl:text-2xl min-w-0 truncate sm:whitespace-normal", children: viewTitle })
|
|
10314
10325
|
] }),
|
|
10315
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10326
|
+
!lockedView && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10316
10327
|
Select,
|
|
10317
10328
|
{
|
|
10318
|
-
selected:
|
|
10329
|
+
selected: activeView,
|
|
10319
10330
|
onChange: (v) => {
|
|
10320
10331
|
setView(v);
|
|
10321
10332
|
},
|
|
10322
10333
|
items: selectItems,
|
|
10323
|
-
placeholder: viewLabel(
|
|
10334
|
+
placeholder: viewLabel(activeView),
|
|
10324
10335
|
className: "min-w-24",
|
|
10325
10336
|
hideClear: true
|
|
10326
10337
|
}
|
|
10327
10338
|
) })
|
|
10328
10339
|
] }),
|
|
10329
10340
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col transition-all duration-200 ease-in-out", children: [
|
|
10330
|
-
|
|
10341
|
+
activeView === "month" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10331
10342
|
MonthViewAgenda,
|
|
10332
10343
|
{
|
|
10333
10344
|
currentDate,
|
|
@@ -10336,7 +10347,7 @@ function EventAgenda({
|
|
|
10336
10347
|
noTime
|
|
10337
10348
|
}
|
|
10338
10349
|
),
|
|
10339
|
-
|
|
10350
|
+
activeView === "week" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10340
10351
|
WeekViewAgenda,
|
|
10341
10352
|
{
|
|
10342
10353
|
currentDate,
|
|
@@ -10345,7 +10356,7 @@ function EventAgenda({
|
|
|
10345
10356
|
noTime
|
|
10346
10357
|
}
|
|
10347
10358
|
),
|
|
10348
|
-
|
|
10359
|
+
activeView === "day" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10349
10360
|
DayViewAgenda,
|
|
10350
10361
|
{
|
|
10351
10362
|
currentDate,
|
|
@@ -10354,7 +10365,7 @@ function EventAgenda({
|
|
|
10354
10365
|
noTime
|
|
10355
10366
|
}
|
|
10356
10367
|
),
|
|
10357
|
-
|
|
10368
|
+
activeView === "agenda" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10358
10369
|
Agenda,
|
|
10359
10370
|
{
|
|
10360
10371
|
currentDate,
|
|
@@ -10363,14 +10374,16 @@ function EventAgenda({
|
|
|
10363
10374
|
noTime
|
|
10364
10375
|
}
|
|
10365
10376
|
),
|
|
10366
|
-
|
|
10377
|
+
activeView === "year" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10367
10378
|
YearViewAgenda,
|
|
10368
10379
|
{
|
|
10369
10380
|
currentDate,
|
|
10370
10381
|
events,
|
|
10371
10382
|
onMonthSelect: (monthDate) => {
|
|
10372
10383
|
setCurrentDate(monthDate);
|
|
10373
|
-
|
|
10384
|
+
if (!lockedView) {
|
|
10385
|
+
setView("month");
|
|
10386
|
+
}
|
|
10374
10387
|
}
|
|
10375
10388
|
}
|
|
10376
10389
|
)
|
package/dist/index.mjs
CHANGED
|
@@ -2548,10 +2548,10 @@ function Badge({
|
|
|
2548
2548
|
purple: "bg-purple-50 text-purple-500 border-purple-200"
|
|
2549
2549
|
};
|
|
2550
2550
|
const rankClasses = {
|
|
2551
|
-
diamond: "bg-cyan-100 text-cyan-600 border-cyan-300",
|
|
2552
|
-
gold: "bg-
|
|
2553
|
-
silver: "bg-gray-100 text-gray-500 border-gray-300",
|
|
2554
|
-
bronze: "bg-orange-100 text-orange-700 border-orange-300"
|
|
2551
|
+
diamond: "bg-cyan-100 text-cyan-600 border-cyan-300 dark:text-cyan-800 dark:border-cyan-800",
|
|
2552
|
+
gold: "bg-amber-50 text-amber-500 border-amber-300 dark:text-amber-600 dark:border-amber-600 dark:bg-amber-50",
|
|
2553
|
+
silver: "bg-gray-100 text-gray-500 border-gray-300 dark:text-gray-800 dark:border-gray-800",
|
|
2554
|
+
bronze: "bg-orange-100 text-orange-700 border-orange-300 dark:text-orange-800 dark:border-orange-800"
|
|
2555
2555
|
};
|
|
2556
2556
|
return /* @__PURE__ */ jsx(
|
|
2557
2557
|
Comp,
|
|
@@ -10134,28 +10134,37 @@ function EventAgenda({
|
|
|
10134
10134
|
initialDate,
|
|
10135
10135
|
onClick,
|
|
10136
10136
|
showYearView = false,
|
|
10137
|
-
noTime = false
|
|
10137
|
+
noTime = false,
|
|
10138
|
+
onlyDay,
|
|
10139
|
+
onlyMonth,
|
|
10140
|
+
onlyWeek,
|
|
10141
|
+
onlyAgenda,
|
|
10142
|
+
onlyYear
|
|
10138
10143
|
}) {
|
|
10144
|
+
const lockedView = onlyDay ? "day" : onlyMonth ? "month" : onlyWeek ? "week" : onlyAgenda ? "agenda" : onlyYear ? "year" : void 0;
|
|
10139
10145
|
const [currentDate, setCurrentDate] = useState(
|
|
10140
10146
|
initialDate && new Date(initialDate) || /* @__PURE__ */ new Date()
|
|
10141
10147
|
);
|
|
10142
|
-
const [view, setView] = useState(
|
|
10148
|
+
const [view, setView] = useState(
|
|
10149
|
+
lockedView || initialView
|
|
10150
|
+
);
|
|
10143
10151
|
const [selectedEvent, setSelectedEvent] = useState(null);
|
|
10152
|
+
const activeView = lockedView || view;
|
|
10144
10153
|
const goPrevious = () => {
|
|
10145
|
-
if (
|
|
10146
|
-
else if (
|
|
10147
|
-
else if (
|
|
10148
|
-
else if (
|
|
10154
|
+
if (activeView === "month") setCurrentDate((d) => subMonths(d, 1));
|
|
10155
|
+
else if (activeView === "week") setCurrentDate((d) => subWeeks(d, 1));
|
|
10156
|
+
else if (activeView === "day") setCurrentDate((d) => addDays(d, -1));
|
|
10157
|
+
else if (activeView === "agenda")
|
|
10149
10158
|
setCurrentDate((d) => addDays(d, -AgendaDaysToShowAgenda));
|
|
10150
|
-
else if (
|
|
10159
|
+
else if (activeView === "year") setCurrentDate((d) => subYears(d, 1));
|
|
10151
10160
|
};
|
|
10152
10161
|
const goNext = () => {
|
|
10153
|
-
if (
|
|
10154
|
-
else if (
|
|
10155
|
-
else if (
|
|
10156
|
-
else if (
|
|
10162
|
+
if (activeView === "month") setCurrentDate((d) => addMonths(d, 1));
|
|
10163
|
+
else if (activeView === "week") setCurrentDate((d) => addWeeks(d, 1));
|
|
10164
|
+
else if (activeView === "day") setCurrentDate((d) => addDays(d, 1));
|
|
10165
|
+
else if (activeView === "agenda")
|
|
10157
10166
|
setCurrentDate((d) => addDays(d, AgendaDaysToShowAgenda));
|
|
10158
|
-
else if (
|
|
10167
|
+
else if (activeView === "year") setCurrentDate((d) => addYears(d, 1));
|
|
10159
10168
|
};
|
|
10160
10169
|
const handleEventSelect = (event, e) => {
|
|
10161
10170
|
try {
|
|
@@ -10201,9 +10210,9 @@ function EventAgenda({
|
|
|
10201
10210
|
};
|
|
10202
10211
|
const viewTitle = useMemo(() => {
|
|
10203
10212
|
const capitalize2 = (s) => s ? s.charAt(0).toUpperCase() + s.slice(1) : s;
|
|
10204
|
-
if (
|
|
10213
|
+
if (activeView === "month")
|
|
10205
10214
|
return capitalize2(format(currentDate, "MMMM yyyy", { locale: ptBR }));
|
|
10206
|
-
if (
|
|
10215
|
+
if (activeView === "week") {
|
|
10207
10216
|
const start = startOfWeek(currentDate, { weekStartsOn: 1 });
|
|
10208
10217
|
const end = endOfWeek(currentDate, { weekStartsOn: 1 });
|
|
10209
10218
|
if (isSameMonth(start, end))
|
|
@@ -10212,17 +10221,19 @@ function EventAgenda({
|
|
|
10212
10221
|
const s2 = capitalize2(format(end, "MMM yyyy", { locale: ptBR }));
|
|
10213
10222
|
return `${s1} - ${s2}`;
|
|
10214
10223
|
}
|
|
10215
|
-
if (
|
|
10216
|
-
return
|
|
10217
|
-
|
|
10224
|
+
if (activeView === "day")
|
|
10225
|
+
return capitalize2(
|
|
10226
|
+
format(currentDate, "EEEE, d 'de' MMMM", { locale: ptBR })
|
|
10227
|
+
);
|
|
10228
|
+
if (activeView === "agenda") {
|
|
10218
10229
|
const start = currentDate;
|
|
10219
10230
|
return capitalize2(format(start, "MMMM yyyy", { locale: ptBR }));
|
|
10220
10231
|
}
|
|
10221
|
-
if (
|
|
10232
|
+
if (activeView === "year") {
|
|
10222
10233
|
return format(currentDate, "yyyy");
|
|
10223
10234
|
}
|
|
10224
10235
|
return capitalize2(format(currentDate, "MMMM yyyy", { locale: ptBR }));
|
|
10225
|
-
}, [currentDate,
|
|
10236
|
+
}, [currentDate, activeView]);
|
|
10226
10237
|
const availableViews = showYearView ? ["year", "month", "week", "day", "agenda"] : ["month", "week", "day", "agenda"];
|
|
10227
10238
|
const selectItems = availableViews.map(
|
|
10228
10239
|
(v) => ({
|
|
@@ -10270,22 +10281,22 @@ function EventAgenda({
|
|
|
10270
10281
|
] }),
|
|
10271
10282
|
/* @__PURE__ */ jsx("h2", { className: "font-semibold text-sm sm:text-base md:text-lg lg:text-xl xl:text-2xl min-w-0 truncate sm:whitespace-normal", children: viewTitle })
|
|
10272
10283
|
] }),
|
|
10273
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(
|
|
10284
|
+
!lockedView && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(
|
|
10274
10285
|
Select,
|
|
10275
10286
|
{
|
|
10276
|
-
selected:
|
|
10287
|
+
selected: activeView,
|
|
10277
10288
|
onChange: (v) => {
|
|
10278
10289
|
setView(v);
|
|
10279
10290
|
},
|
|
10280
10291
|
items: selectItems,
|
|
10281
|
-
placeholder: viewLabel(
|
|
10292
|
+
placeholder: viewLabel(activeView),
|
|
10282
10293
|
className: "min-w-24",
|
|
10283
10294
|
hideClear: true
|
|
10284
10295
|
}
|
|
10285
10296
|
) })
|
|
10286
10297
|
] }),
|
|
10287
10298
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col transition-all duration-200 ease-in-out", children: [
|
|
10288
|
-
|
|
10299
|
+
activeView === "month" && /* @__PURE__ */ jsx(
|
|
10289
10300
|
MonthViewAgenda,
|
|
10290
10301
|
{
|
|
10291
10302
|
currentDate,
|
|
@@ -10294,7 +10305,7 @@ function EventAgenda({
|
|
|
10294
10305
|
noTime
|
|
10295
10306
|
}
|
|
10296
10307
|
),
|
|
10297
|
-
|
|
10308
|
+
activeView === "week" && /* @__PURE__ */ jsx(
|
|
10298
10309
|
WeekViewAgenda,
|
|
10299
10310
|
{
|
|
10300
10311
|
currentDate,
|
|
@@ -10303,7 +10314,7 @@ function EventAgenda({
|
|
|
10303
10314
|
noTime
|
|
10304
10315
|
}
|
|
10305
10316
|
),
|
|
10306
|
-
|
|
10317
|
+
activeView === "day" && /* @__PURE__ */ jsx(
|
|
10307
10318
|
DayViewAgenda,
|
|
10308
10319
|
{
|
|
10309
10320
|
currentDate,
|
|
@@ -10312,7 +10323,7 @@ function EventAgenda({
|
|
|
10312
10323
|
noTime
|
|
10313
10324
|
}
|
|
10314
10325
|
),
|
|
10315
|
-
|
|
10326
|
+
activeView === "agenda" && /* @__PURE__ */ jsx(
|
|
10316
10327
|
Agenda,
|
|
10317
10328
|
{
|
|
10318
10329
|
currentDate,
|
|
@@ -10321,14 +10332,16 @@ function EventAgenda({
|
|
|
10321
10332
|
noTime
|
|
10322
10333
|
}
|
|
10323
10334
|
),
|
|
10324
|
-
|
|
10335
|
+
activeView === "year" && /* @__PURE__ */ jsx(
|
|
10325
10336
|
YearViewAgenda,
|
|
10326
10337
|
{
|
|
10327
10338
|
currentDate,
|
|
10328
10339
|
events,
|
|
10329
10340
|
onMonthSelect: (monthDate) => {
|
|
10330
10341
|
setCurrentDate(monthDate);
|
|
10331
|
-
|
|
10342
|
+
if (!lockedView) {
|
|
10343
|
+
setView("month");
|
|
10344
|
+
}
|
|
10332
10345
|
}
|
|
10333
10346
|
}
|
|
10334
10347
|
)
|