calendarkit-prov2 2.0.10 → 2.0.11

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/README.md CHANGED
@@ -175,6 +175,7 @@ import type {
175
175
  | `language` | `LanguageCode` | `'tr'` | UI language (15+ locales) |
176
176
  | `onLanguageChange` | `(lang) => void` | — | Language change handler |
177
177
  | `hideLanguageSwitcher` | `boolean` | `false` | Hide the language dropdown from the header. The `language` prop still sets the active locale. |
178
+ | `hourCount` | `number` | — | Optional hour total shown as a clock badge next to the event count. Hidden when omitted. |
178
179
  | `locale` | `Locale` | — | date-fns locale for date formatting |
179
180
  | `isDarkMode` | `boolean` | — | Dark mode state |
180
181
  | `onThemeToggle` | `() => void` | — | Theme toggle handler |
@@ -208,6 +209,19 @@ The header automatically displays a **live event count badge** next to the view
208
209
 
209
210
  The badge updates automatically when you navigate or filter calendars.
210
211
 
212
+ ### Hour count badge
213
+
214
+ Pass `hourCount` to show a **clock badge** next to the event count. The library does not calculate this number — you decide what it means (booked hours, remaining hours, billable hours, etc.).
215
+
216
+ ```tsx
217
+ <ProScheduler
218
+ hourCount={12.5}
219
+ ...
220
+ />
221
+ ```
222
+
223
+ Omit the prop to hide the badge. Decimal values are supported.
224
+
211
225
  ### Create Event button
212
226
 
213
227
  The **Create Event** button in the header displays only the `+` icon. Hovering over it reveals a tooltip with the label. On mobile, a floating action button (FAB) is shown instead.
package/dist/index.d.mts CHANGED
@@ -221,6 +221,8 @@ interface CalendarTranslations {
221
221
  tomorrow: string;
222
222
  eventCount: string;
223
223
  eventsCount: string;
224
+ hourCount: string;
225
+ hoursCount: string;
224
226
  timezone: string;
225
227
  localTime: string;
226
228
  operations: string;
@@ -294,6 +296,13 @@ interface CalendarProps {
294
296
  * The `language` prop still sets the active locale; it just won't be user-changeable.
295
297
  */
296
298
  hideLanguageSwitcher?: boolean;
299
+ /**
300
+ * Optional hour total shown as a clock badge next to the event-count badge
301
+ * in the header. The library does not compute this — pass whatever number
302
+ * your app wants to display (e.g. booked hours in the current view).
303
+ * Hidden when omitted.
304
+ */
305
+ hourCount?: number;
297
306
  /**
298
307
  * Replace the default event form/modal with a fully custom component.
299
308
  * Receives open state, the event being edited, and save/delete handlers.
package/dist/index.d.ts CHANGED
@@ -221,6 +221,8 @@ interface CalendarTranslations {
221
221
  tomorrow: string;
222
222
  eventCount: string;
223
223
  eventsCount: string;
224
+ hourCount: string;
225
+ hoursCount: string;
224
226
  timezone: string;
225
227
  localTime: string;
226
228
  operations: string;
@@ -294,6 +296,13 @@ interface CalendarProps {
294
296
  * The `language` prop still sets the active locale; it just won't be user-changeable.
295
297
  */
296
298
  hideLanguageSwitcher?: boolean;
299
+ /**
300
+ * Optional hour total shown as a clock badge next to the event-count badge
301
+ * in the header. The library does not compute this — pass whatever number
302
+ * your app wants to display (e.g. booked hours in the current view).
303
+ * Hidden when omitted.
304
+ */
305
+ hourCount?: number;
297
306
  /**
298
307
  * Replace the default event form/modal with a fully custom component.
299
308
  * Receives open state, the event being edited, and save/delete handlers.
package/dist/index.js CHANGED
@@ -179,6 +179,8 @@ var tr = {
179
179
  tomorrow: "Yar\u0131n",
180
180
  eventCount: "etkinlik",
181
181
  eventsCount: "etkinlik",
182
+ hourCount: "saat",
183
+ hoursCount: "saat",
182
184
  timezone: "Zaman Dilimi",
183
185
  localTime: "Yerel Saat",
184
186
  operations: "\u0130\u015Flemler",
@@ -272,6 +274,8 @@ var en = {
272
274
  tomorrow: "Tomorrow",
273
275
  eventCount: "event",
274
276
  eventsCount: "events",
277
+ hourCount: "hour",
278
+ hoursCount: "hours",
275
279
  timezone: "Time zone",
276
280
  localTime: "Local Time",
277
281
  operations: "Operations",
@@ -365,6 +369,8 @@ var fr = {
365
369
  tomorrow: "Demain",
366
370
  eventCount: "\xE9v\xE9nement",
367
371
  eventsCount: "\xE9v\xE9nements",
372
+ hourCount: "heure",
373
+ hoursCount: "heures",
368
374
  timezone: "Fuseau horaire",
369
375
  localTime: "Heure locale",
370
376
  operations: "Op\xE9rations",
@@ -458,6 +464,8 @@ var de = {
458
464
  tomorrow: "Morgen",
459
465
  eventCount: "Termin",
460
466
  eventsCount: "Termine",
467
+ hourCount: "Stunde",
468
+ hoursCount: "Stunden",
461
469
  timezone: "Zeitzone",
462
470
  localTime: "Ortszeit",
463
471
  operations: "Aktionen",
@@ -551,6 +559,8 @@ var es = {
551
559
  tomorrow: "Ma\xF1ana",
552
560
  eventCount: "evento",
553
561
  eventsCount: "eventos",
562
+ hourCount: "hora",
563
+ hoursCount: "horas",
554
564
  timezone: "Zona horaria",
555
565
  localTime: "Hora local",
556
566
  operations: "Operaciones",
@@ -644,6 +654,8 @@ var it = {
644
654
  tomorrow: "Domani",
645
655
  eventCount: "evento",
646
656
  eventsCount: "eventi",
657
+ hourCount: "ora",
658
+ hoursCount: "ore",
647
659
  timezone: "Fuso orario",
648
660
  localTime: "Ora locale",
649
661
  operations: "Operazioni",
@@ -737,6 +749,8 @@ var pt = {
737
749
  tomorrow: "Amanh\xE3",
738
750
  eventCount: "evento",
739
751
  eventsCount: "eventos",
752
+ hourCount: "hora",
753
+ hoursCount: "horas",
740
754
  timezone: "Fuso hor\xE1rio",
741
755
  localTime: "Hora local",
742
756
  operations: "Opera\xE7\xF5es",
@@ -830,6 +844,8 @@ var ar = {
830
844
  tomorrow: "\u063A\u062F\u064B\u0627",
831
845
  eventCount: "\u062D\u062F\u062B",
832
846
  eventsCount: "\u0623\u062D\u062F\u0627\u062B",
847
+ hourCount: "\u0633\u0627\u0639\u0629",
848
+ hoursCount: "\u0633\u0627\u0639\u0627\u062A",
833
849
  timezone: "\u0627\u0644\u0645\u0646\u0637\u0642\u0629 \u0627\u0644\u0632\u0645\u0646\u064A\u0629",
834
850
  localTime: "\u0627\u0644\u062A\u0648\u0642\u064A\u062A \u0627\u0644\u0645\u062D\u0644\u064A",
835
851
  operations: "\u0627\u0644\u0639\u0645\u0644\u064A\u0627\u062A",
@@ -923,6 +939,8 @@ var zh = {
923
939
  tomorrow: "\u660E\u5929",
924
940
  eventCount: "\u4E2A\u6D3B\u52A8",
925
941
  eventsCount: "\u4E2A\u6D3B\u52A8",
942
+ hourCount: "\u5C0F\u65F6",
943
+ hoursCount: "\u5C0F\u65F6",
926
944
  timezone: "\u65F6\u533A",
927
945
  localTime: "\u672C\u5730\u65F6\u95F4",
928
946
  operations: "\u64CD\u4F5C",
@@ -1016,6 +1034,8 @@ var ja = {
1016
1034
  tomorrow: "\u660E\u65E5",
1017
1035
  eventCount: "\u4EF6\u306E\u30A4\u30D9\u30F3\u30C8",
1018
1036
  eventsCount: "\u4EF6\u306E\u30A4\u30D9\u30F3\u30C8",
1037
+ hourCount: "\u6642\u9593",
1038
+ hoursCount: "\u6642\u9593",
1019
1039
  timezone: "\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3",
1020
1040
  localTime: "\u30ED\u30FC\u30AB\u30EB\u6642\u9593",
1021
1041
  operations: "\u64CD\u4F5C",
@@ -1109,6 +1129,8 @@ var ko = {
1109
1129
  tomorrow: "\uB0B4\uC77C",
1110
1130
  eventCount: "\uAC1C \uC77C\uC815",
1111
1131
  eventsCount: "\uAC1C \uC77C\uC815",
1132
+ hourCount: "\uC2DC\uAC04",
1133
+ hoursCount: "\uC2DC\uAC04",
1112
1134
  timezone: "\uC2DC\uAC04\uB300",
1113
1135
  localTime: "\uB85C\uCEEC \uC2DC\uAC04",
1114
1136
  operations: "\uC791\uC5C5",
@@ -1202,6 +1224,8 @@ var ru = {
1202
1224
  tomorrow: "\u0417\u0430\u0432\u0442\u0440\u0430",
1203
1225
  eventCount: "\u0441\u043E\u0431\u044B\u0442\u0438\u0435",
1204
1226
  eventsCount: "\u0441\u043E\u0431\u044B\u0442\u0438\u0439",
1227
+ hourCount: "\u0447\u0430\u0441",
1228
+ hoursCount: "\u0447\u0430\u0441\u043E\u0432",
1205
1229
  timezone: "\u0427\u0430\u0441\u043E\u0432\u043E\u0439 \u043F\u043E\u044F\u0441",
1206
1230
  localTime: "\u041C\u0435\u0441\u0442\u043D\u043E\u0435 \u0432\u0440\u0435\u043C\u044F",
1207
1231
  operations: "\u041E\u043F\u0435\u0440\u0430\u0446\u0438\u0438",
@@ -1295,6 +1319,8 @@ var nl = {
1295
1319
  tomorrow: "Morgen",
1296
1320
  eventCount: "evenement",
1297
1321
  eventsCount: "evenementen",
1322
+ hourCount: "uur",
1323
+ hoursCount: "uur",
1298
1324
  timezone: "Tijdzone",
1299
1325
  localTime: "Lokale tijd",
1300
1326
  operations: "Bewerkingen",
@@ -1388,6 +1414,8 @@ var pl = {
1388
1414
  tomorrow: "Jutro",
1389
1415
  eventCount: "wydarzenie",
1390
1416
  eventsCount: "wydarze\u0144",
1417
+ hourCount: "godzina",
1418
+ hoursCount: "godzin",
1391
1419
  timezone: "Strefa czasowa",
1392
1420
  localTime: "Czas lokalny",
1393
1421
  operations: "Operacje",
@@ -1481,6 +1509,8 @@ var sv = {
1481
1509
  tomorrow: "Imorgon",
1482
1510
  eventCount: "h\xE4ndelse",
1483
1511
  eventsCount: "h\xE4ndelser",
1512
+ hourCount: "timme",
1513
+ hoursCount: "timmar",
1484
1514
  timezone: "Tidszon",
1485
1515
  localTime: "Lokal tid",
1486
1516
  operations: "\xC5tg\xE4rder",
@@ -1563,6 +1593,7 @@ var CalendarHeader = ({
1563
1593
  activeCustomViewId,
1564
1594
  onCustomViewChange,
1565
1595
  eventCount,
1596
+ hourCount,
1566
1597
  hideLanguageSwitcher = false
1567
1598
  }) => {
1568
1599
  const [isLangOpen, setIsLangOpen] = React18.useState(false);
@@ -1735,15 +1766,23 @@ var CalendarHeader = ({
1735
1766
  onClick: onThemeToggle
1736
1767
  },
1737
1768
  isDarkMode ? /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Sun, { className: "h-4 w-4 text-amber-500" }) : /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Moon, { className: "h-4 w-4 text-muted-foreground" })
1738
- ), typeof eventCount === "number" && !hideViewSwitcher && /* @__PURE__ */ React18__namespace.default.createElement(
1769
+ ), !hideViewSwitcher && (typeof eventCount === "number" || typeof hourCount === "number") && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center gap-1.5" }, typeof eventCount === "number" && /* @__PURE__ */ React18__namespace.default.createElement(
1739
1770
  "div",
1740
1771
  {
1741
1772
  className: "flex items-center gap-1.5 h-8 px-3 rounded-xl bg-primary/10 text-primary text-xs font-semibold tabular-nums select-none border border-primary/20 shadow-sm shadow-primary/10",
1742
- title: `${eventCount} event${eventCount !== 1 ? "s" : ""}`
1773
+ title: `${eventCount} ${eventCount === 1 ? translations.eventCount ?? "event" : translations.eventsCount ?? "events"}`
1743
1774
  },
1744
1775
  /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.CalendarCheck2, { className: "w-3.5 h-3.5 shrink-0" }),
1745
1776
  /* @__PURE__ */ React18__namespace.default.createElement("span", null, eventCount)
1746
- ), !hideViewSwitcher && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center bg-muted/50 backdrop-blur-sm rounded-xl p-1 gap-0.5" }, viewConfig.map(({ key, icon: Icon }) => /* @__PURE__ */ React18__namespace.default.createElement(
1777
+ ), typeof hourCount === "number" && /* @__PURE__ */ React18__namespace.default.createElement(
1778
+ "div",
1779
+ {
1780
+ className: "flex items-center gap-1.5 h-8 px-3 rounded-xl bg-amber-500/10 text-amber-600 dark:text-amber-400 text-xs font-semibold tabular-nums select-none border border-amber-500/20 shadow-sm shadow-amber-500/10",
1781
+ title: `${hourCount} ${hourCount === 1 ? translations.hourCount ?? "hour" : translations.hoursCount ?? "hours"}`
1782
+ },
1783
+ /* @__PURE__ */ React18__namespace.default.createElement(lucideReact.Clock, { className: "w-3.5 h-3.5 shrink-0" }),
1784
+ /* @__PURE__ */ React18__namespace.default.createElement("span", null, hourCount)
1785
+ )), !hideViewSwitcher && /* @__PURE__ */ React18__namespace.default.createElement("div", { className: "flex items-center bg-muted/50 backdrop-blur-sm rounded-xl p-1 gap-0.5" }, viewConfig.map(({ key, icon: Icon }) => /* @__PURE__ */ React18__namespace.default.createElement(
1747
1786
  Button,
1748
1787
  {
1749
1788
  key,
@@ -4439,6 +4478,7 @@ var Scheduler = ({
4439
4478
  translations,
4440
4479
  hideViewSwitcher,
4441
4480
  hideLanguageSwitcher,
4481
+ hourCount,
4442
4482
  hideFab = false,
4443
4483
  compactShortEvents = true,
4444
4484
  initialScrollHour = 8,
@@ -4689,6 +4729,7 @@ var Scheduler = ({
4689
4729
  setActiveCustomMenu(null);
4690
4730
  },
4691
4731
  eventCount: viewEventCount,
4732
+ hourCount,
4692
4733
  hideLanguageSwitcher
4693
4734
  }
4694
4735
  ),