@herca/r-kit 0.0.20 → 0.0.21
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/clients.cjs +153 -120
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.js +196 -163
- package/dist/clients.js.map +1 -1
- package/package.json +1 -1
package/dist/clients.cjs
CHANGED
|
@@ -10206,7 +10206,7 @@ function createDateStyleHelpers({
|
|
|
10206
10206
|
// src/components/calendar/partials/calendar-day-item.tsx
|
|
10207
10207
|
var import_jsx_runtime308 = require("react/jsx-runtime");
|
|
10208
10208
|
var date_size_map = {
|
|
10209
|
-
md: "size-
|
|
10209
|
+
md: "size-7.5",
|
|
10210
10210
|
sm: "size-6",
|
|
10211
10211
|
lg: "size-9"
|
|
10212
10212
|
};
|
|
@@ -10418,70 +10418,80 @@ function CalendarGrid({
|
|
|
10418
10418
|
{ length: Math.ceil(days2.length / 7) },
|
|
10419
10419
|
(_, i) => days2.slice(i * 7, i * 7 + 7)
|
|
10420
10420
|
);
|
|
10421
|
-
return /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
const
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
}
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
|
|
10439
|
-
"relative",
|
|
10440
|
-
variant === "default" && "border-b border-gray-300 last:border-b-0!",
|
|
10441
|
-
//prettier-ignore
|
|
10442
|
-
className
|
|
10443
|
-
),
|
|
10444
|
-
children: [
|
|
10445
|
-
/* @__PURE__ */ (0, import_jsx_runtime310.jsx)(
|
|
10446
|
-
"div",
|
|
10447
|
-
{
|
|
10448
|
-
className: (0, import_clsx5.default)(
|
|
10449
|
-
"grid w-full grid-cols-7",
|
|
10450
|
-
variant === "default" && "*:border-r *:border-gray-300 [&>*:nth-last-child(1)]:border-r-0"
|
|
10451
|
-
//prettier-ignore
|
|
10452
|
-
),
|
|
10453
|
-
children: week.map((day, dayIndex) => /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(
|
|
10454
|
-
CalendarDayItem,
|
|
10455
|
-
{
|
|
10456
|
-
day,
|
|
10457
|
-
helpers,
|
|
10458
|
-
size,
|
|
10459
|
-
mode,
|
|
10460
|
-
styleConfig,
|
|
10461
|
-
onClick,
|
|
10462
|
-
variant,
|
|
10463
|
-
events
|
|
10464
|
-
},
|
|
10465
|
-
dayIndex
|
|
10466
|
-
))
|
|
10421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(
|
|
10422
|
+
"div",
|
|
10423
|
+
{
|
|
10424
|
+
className: (0, import_clsx5.default)(
|
|
10425
|
+
"relative",
|
|
10426
|
+
variant === "compact" && size === "sm" && "space-y-1"
|
|
10427
|
+
),
|
|
10428
|
+
children: weeks.map((week, weekIndex) => {
|
|
10429
|
+
const segments = getWeekEventSegments({
|
|
10430
|
+
week,
|
|
10431
|
+
events
|
|
10432
|
+
});
|
|
10433
|
+
const columnEventCount = Array(7).fill(0);
|
|
10434
|
+
segments.forEach((seg) => {
|
|
10435
|
+
for (let i = 0; i < seg.span; i++) {
|
|
10436
|
+
const colIndex = seg.startCol + i;
|
|
10437
|
+
if (colIndex >= 0 && colIndex < 7) {
|
|
10438
|
+
columnEventCount[colIndex]++;
|
|
10467
10439
|
}
|
|
10468
|
-
|
|
10469
|
-
|
|
10470
|
-
|
|
10471
|
-
|
|
10472
|
-
|
|
10473
|
-
|
|
10474
|
-
|
|
10475
|
-
|
|
10476
|
-
|
|
10477
|
-
|
|
10478
|
-
|
|
10479
|
-
|
|
10480
|
-
|
|
10481
|
-
|
|
10482
|
-
|
|
10483
|
-
|
|
10484
|
-
|
|
10440
|
+
}
|
|
10441
|
+
});
|
|
10442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime310.jsxs)(
|
|
10443
|
+
"div",
|
|
10444
|
+
{
|
|
10445
|
+
className: (0, import_clsx5.default)(
|
|
10446
|
+
"relative",
|
|
10447
|
+
variant === "default" && "border-b border-gray-300 last:border-b-0!",
|
|
10448
|
+
//prettier-ignore
|
|
10449
|
+
className
|
|
10450
|
+
),
|
|
10451
|
+
children: [
|
|
10452
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsx)(
|
|
10453
|
+
"div",
|
|
10454
|
+
{
|
|
10455
|
+
className: (0, import_clsx5.default)(
|
|
10456
|
+
"grid w-full grid-cols-7",
|
|
10457
|
+
variant === "default" && "*:border-r *:border-gray-300 [&>*:nth-last-child(1)]:border-r-0",
|
|
10458
|
+
//prettier-ignore
|
|
10459
|
+
variant === "compact" && "place-items-center"
|
|
10460
|
+
),
|
|
10461
|
+
children: week.map((day, dayIndex) => /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(
|
|
10462
|
+
CalendarDayItem,
|
|
10463
|
+
{
|
|
10464
|
+
day,
|
|
10465
|
+
helpers,
|
|
10466
|
+
size,
|
|
10467
|
+
mode,
|
|
10468
|
+
styleConfig,
|
|
10469
|
+
onClick,
|
|
10470
|
+
variant,
|
|
10471
|
+
events
|
|
10472
|
+
},
|
|
10473
|
+
dayIndex
|
|
10474
|
+
))
|
|
10475
|
+
}
|
|
10476
|
+
),
|
|
10477
|
+
segments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime310.jsxs)("div", { className: "absolute inset-x-0 bottom-2 grid grid-cols-7 gap-0.5", children: [
|
|
10478
|
+
segments.slice(0, isMobile ? 1 : 2).map((seg, index) => /* @__PURE__ */ (0, import_jsx_runtime310.jsx)(
|
|
10479
|
+
EventBar,
|
|
10480
|
+
{
|
|
10481
|
+
segment: seg,
|
|
10482
|
+
showTooltip: showCalendarTooltip
|
|
10483
|
+
},
|
|
10484
|
+
index
|
|
10485
|
+
)),
|
|
10486
|
+
/* @__PURE__ */ (0, import_jsx_runtime310.jsx)(ButtonMore, { segments })
|
|
10487
|
+
] })
|
|
10488
|
+
]
|
|
10489
|
+
},
|
|
10490
|
+
weekIndex
|
|
10491
|
+
);
|
|
10492
|
+
})
|
|
10493
|
+
}
|
|
10494
|
+
);
|
|
10485
10495
|
}
|
|
10486
10496
|
|
|
10487
10497
|
// src/components/calendar/partials/calendar-header.tsx
|
|
@@ -10679,7 +10689,7 @@ function NavigatorButton({
|
|
|
10679
10689
|
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
10680
10690
|
var import_jsx_runtime313 = require("react/jsx-runtime");
|
|
10681
10691
|
var day_of_week_size = {
|
|
10682
|
-
sm: "
|
|
10692
|
+
sm: "t2",
|
|
10683
10693
|
md: "t2",
|
|
10684
10694
|
lg: "t1"
|
|
10685
10695
|
};
|
|
@@ -10687,38 +10697,74 @@ function DaysOfWeek({
|
|
|
10687
10697
|
daysOfWeek,
|
|
10688
10698
|
size = "md",
|
|
10689
10699
|
wrapperClassName,
|
|
10690
|
-
variant = "default"
|
|
10700
|
+
variant = "default",
|
|
10701
|
+
type = "month"
|
|
10691
10702
|
}) {
|
|
10692
|
-
return /* @__PURE__ */ (0, import_jsx_runtime313.
|
|
10703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)(
|
|
10693
10704
|
"div",
|
|
10694
10705
|
{
|
|
10695
10706
|
className: (0, import_clsx6.default)(
|
|
10696
10707
|
"grid justify-items-center",
|
|
10697
10708
|
variant === "compact" && "calendar-cols mb-3 gap-x-1 *:text-center!",
|
|
10698
|
-
variant === "default" && "w-full
|
|
10709
|
+
variant === "default" && "w-full bg-gray-100 *:p-3 *:w-full *:text-start! *:border-r *:border-gray-300 *:last:border-r-0",
|
|
10710
|
+
//prettier-ignore
|
|
10711
|
+
variant === "default" && type === "month" && "grid-cols-7",
|
|
10712
|
+
variant === "default" && type === "week" && "grid-cols-[60px_1fr_1fr_1fr_1fr_1fr_1fr_1fr]",
|
|
10699
10713
|
//prettier-ignore
|
|
10700
10714
|
wrapperClassName
|
|
10701
10715
|
),
|
|
10702
|
-
children:
|
|
10703
|
-
|
|
10704
|
-
|
|
10705
|
-
as: "h5",
|
|
10706
|
-
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
+
children: [
|
|
10717
|
+
type === "week" && variant === "default" && /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)(import_jsx_runtime313.Fragment, { children: [
|
|
10718
|
+
/* @__PURE__ */ (0, import_jsx_runtime313.jsx)("div", {}),
|
|
10719
|
+
daysOfWeek.map((day) => /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(Text, { as: "h5", value: day, variant: "t1" }, day))
|
|
10720
|
+
] }),
|
|
10721
|
+
type === "month" && daysOfWeek.map((day) => /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(
|
|
10722
|
+
Text,
|
|
10723
|
+
{
|
|
10724
|
+
as: "h5",
|
|
10725
|
+
weight: variant === "compact" ? "medium" : "semibold",
|
|
10726
|
+
value: day,
|
|
10727
|
+
className: (0, import_clsx6.default)(
|
|
10728
|
+
variant === "compact" && "text-gray-600!",
|
|
10729
|
+
variant === "default" && "text-gray-900! uppercase"
|
|
10730
|
+
),
|
|
10731
|
+
variant: variant === "compact" ? day_of_week_size[size] : "t1"
|
|
10732
|
+
},
|
|
10733
|
+
day
|
|
10734
|
+
))
|
|
10735
|
+
]
|
|
10716
10736
|
}
|
|
10717
10737
|
);
|
|
10718
10738
|
}
|
|
10719
10739
|
|
|
10720
10740
|
// src/components/calendar/calendar.tsx
|
|
10721
10741
|
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
10742
|
+
|
|
10743
|
+
// src/components/calendar/constants.tsx
|
|
10744
|
+
var typeOptions = [
|
|
10745
|
+
{
|
|
10746
|
+
label: "Year",
|
|
10747
|
+
value: "year"
|
|
10748
|
+
},
|
|
10749
|
+
{
|
|
10750
|
+
label: "Month",
|
|
10751
|
+
value: "month"
|
|
10752
|
+
},
|
|
10753
|
+
{
|
|
10754
|
+
label: "Week",
|
|
10755
|
+
value: "week"
|
|
10756
|
+
},
|
|
10757
|
+
{
|
|
10758
|
+
label: "Day",
|
|
10759
|
+
value: "day"
|
|
10760
|
+
},
|
|
10761
|
+
{
|
|
10762
|
+
label: "Agenda",
|
|
10763
|
+
value: "agenda"
|
|
10764
|
+
}
|
|
10765
|
+
];
|
|
10766
|
+
|
|
10767
|
+
// src/components/calendar/calendar.tsx
|
|
10722
10768
|
var import_jsx_runtime314 = require("react/jsx-runtime");
|
|
10723
10769
|
var days = ["Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"];
|
|
10724
10770
|
var month = [
|
|
@@ -10811,28 +10857,6 @@ var Calendar2 = ({
|
|
|
10811
10857
|
setCurrentMonth(newMonth);
|
|
10812
10858
|
setCurrentYear(newYear);
|
|
10813
10859
|
};
|
|
10814
|
-
const typeOptions = [
|
|
10815
|
-
{
|
|
10816
|
-
label: "Year",
|
|
10817
|
-
value: "year"
|
|
10818
|
-
},
|
|
10819
|
-
{
|
|
10820
|
-
label: "Month",
|
|
10821
|
-
value: "month"
|
|
10822
|
-
},
|
|
10823
|
-
{
|
|
10824
|
-
label: "Week",
|
|
10825
|
-
value: "week"
|
|
10826
|
-
},
|
|
10827
|
-
{
|
|
10828
|
-
label: "Day",
|
|
10829
|
-
value: "day"
|
|
10830
|
-
},
|
|
10831
|
-
{
|
|
10832
|
-
label: "Agenda",
|
|
10833
|
-
value: "agenda"
|
|
10834
|
-
}
|
|
10835
|
-
];
|
|
10836
10860
|
(0, import_react295.useEffect)(() => {
|
|
10837
10861
|
if (value !== void 0) {
|
|
10838
10862
|
setCurrentMonth(
|
|
@@ -10852,22 +10876,8 @@ var Calendar2 = ({
|
|
|
10852
10876
|
variant === "default" && /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
10853
10877
|
/* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "flex items-center gap-6", children: [
|
|
10854
10878
|
/* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "*:cursor-pointer", children: [
|
|
10855
|
-
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
10856
|
-
|
|
10857
|
-
{
|
|
10858
|
-
name: "angle-left-small",
|
|
10859
|
-
size: 30,
|
|
10860
|
-
className: "text-gray-900"
|
|
10861
|
-
}
|
|
10862
|
-
) }),
|
|
10863
|
-
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)("button", { onClick: () => changeMonth(1), children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
10864
|
-
Icon_default,
|
|
10865
|
-
{
|
|
10866
|
-
name: "angle-right-small",
|
|
10867
|
-
size: 30,
|
|
10868
|
-
className: "text-gray-900"
|
|
10869
|
-
}
|
|
10870
|
-
) })
|
|
10879
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)(ButtonNavigation, { onClick: () => changeMonth(-1), type: "prev" }),
|
|
10880
|
+
/* @__PURE__ */ (0, import_jsx_runtime314.jsx)(ButtonNavigation, { onClick: () => changeMonth(1), type: "next" })
|
|
10871
10881
|
] }),
|
|
10872
10882
|
/* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(
|
|
10873
10883
|
Text,
|
|
@@ -10946,6 +10956,16 @@ var Calendar2 = ({
|
|
|
10946
10956
|
wrapperClassname
|
|
10947
10957
|
),
|
|
10948
10958
|
children: [
|
|
10959
|
+
selectedType === "week" && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
10960
|
+
DaysOfWeek,
|
|
10961
|
+
{
|
|
10962
|
+
type: "week",
|
|
10963
|
+
size,
|
|
10964
|
+
variant,
|
|
10965
|
+
daysOfWeek,
|
|
10966
|
+
wrapperClassName: weekWrapperClassname
|
|
10967
|
+
}
|
|
10968
|
+
) }),
|
|
10949
10969
|
type === "year" && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "grid w-full grid-cols-3", children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
10950
10970
|
CalendarGrid,
|
|
10951
10971
|
{
|
|
@@ -11006,6 +11026,19 @@ var Calendar2 = ({
|
|
|
11006
11026
|
)
|
|
11007
11027
|
] });
|
|
11008
11028
|
};
|
|
11029
|
+
var ButtonNavigation = ({
|
|
11030
|
+
onClick,
|
|
11031
|
+
type
|
|
11032
|
+
}) => {
|
|
11033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("button", { onClick, children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
|
|
11034
|
+
Icon_default,
|
|
11035
|
+
{
|
|
11036
|
+
name: type === "next" ? "angle-right-small" : "angle-left-small",
|
|
11037
|
+
size: 30,
|
|
11038
|
+
className: "text-gray-900"
|
|
11039
|
+
}
|
|
11040
|
+
) });
|
|
11041
|
+
};
|
|
11009
11042
|
|
|
11010
11043
|
// src/components/date-picker/helpers.ts
|
|
11011
11044
|
var monthsShort = [
|