@realtek/core-theme 0.0.232 → 0.0.234

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-lib/index.js CHANGED
@@ -253,11 +253,15 @@ function ro({ userIds: e = [], days: t = void 0, startDay: n = "Sun", renderDayC
253
253
  className: `calendar-card${c ? ` ${c}` : ""}`,
254
254
  title: /* @__PURE__ */ Z("div", {
255
255
  className: "calendar-header-title",
256
- children: [/* @__PURE__ */ X(Ur, {}), /* @__PURE__ */ X(Wa, {
257
- level: 5,
258
- style: { margin: 0 },
259
- children: re
260
- })]
256
+ children: [
257
+ /* @__PURE__ */ X(Ur, {}),
258
+ /* @__PURE__ */ X(Wa, {
259
+ level: 5,
260
+ style: { margin: 0 },
261
+ children: re
262
+ }),
263
+ a
264
+ ]
261
265
  }),
262
266
  extra: /* @__PURE__ */ Z("div", {
263
267
  className: "calendar-nav",
@@ -266,29 +270,25 @@ function ro({ userIds: e = [], days: t = void 0, startDay: n = "Sun", renderDayC
266
270
  alignItems: "center",
267
271
  gap: 6
268
272
  },
269
- children: [
270
- a,
271
- /* @__PURE__ */ X(q, {
272
- title: "Previous month",
273
- children: /* @__PURE__ */ X(z, {
274
- type: "text",
275
- icon: /* @__PURE__ */ X(Pi, {}),
276
- size: "small",
277
- onClick: M,
278
- disabled: m
279
- })
280
- }),
281
- /* @__PURE__ */ X(q, {
282
- title: "Next month",
283
- children: /* @__PURE__ */ X(z, {
284
- type: "text",
285
- icon: /* @__PURE__ */ X(ea, {}),
286
- size: "small",
287
- onClick: ee,
288
- disabled: h
289
- })
273
+ children: [/* @__PURE__ */ X(q, {
274
+ title: "Previous month",
275
+ children: /* @__PURE__ */ X(z, {
276
+ type: "text",
277
+ icon: /* @__PURE__ */ X(Pi, {}),
278
+ size: "small",
279
+ onClick: M,
280
+ disabled: m
290
281
  })
291
- ]
282
+ }), /* @__PURE__ */ X(q, {
283
+ title: "Next month",
284
+ children: /* @__PURE__ */ X(z, {
285
+ type: "text",
286
+ icon: /* @__PURE__ */ X(ea, {}),
287
+ size: "small",
288
+ onClick: ee,
289
+ disabled: h
290
+ })
291
+ })]
292
292
  }),
293
293
  children: /* @__PURE__ */ Z(Sr, {
294
294
  spinning: T,
@@ -378,7 +378,8 @@ function ro({ userIds: e = [], days: t = void 0, startDay: n = "Sun", renderDayC
378
378
  children: ne.map(({ label: e, color: t, icon: n }) => /* @__PURE__ */ Z("div", {
379
379
  className: "calendar-legend-item",
380
380
  children: [n ? /* @__PURE__ */ X("span", {
381
- className: "calendar-legend-icon",
381
+ className: "calendar-legend-badge",
382
+ style: { background: Xa(t) },
382
383
  children: n
383
384
  }) : /* @__PURE__ */ X("span", {
384
385
  className: "calendar-legend-dot",
@@ -11327,6 +11328,10 @@ var Bg = {
11327
11328
  tone: "info",
11328
11329
  pulse: !0
11329
11330
  },
11331
+ PartiallyPaid: {
11332
+ label: "Partially Paid",
11333
+ tone: "gold"
11334
+ },
11330
11335
  approved: {
11331
11336
  label: "Approved",
11332
11337
  tone: "success"
@@ -15191,10 +15196,7 @@ function sy({ configKey: e = "timesheet", month: t, year: n }) {
15191
15196
  return t && n && La(`${n}-${t}-01`).isBefore(La().subtract(r.thresholdMonths, "month"), "month") ? /* @__PURE__ */ X(K, {
15192
15197
  color: r.pastColor,
15193
15198
  children: r.pastLabel
15194
- }) : /* @__PURE__ */ X(K, {
15195
- color: r.currentColor,
15196
- children: r.currentLabel
15197
- });
15199
+ }) : null;
15198
15200
  }
15199
15201
  var cy = {
15200
15202
  working: "timesheet-day-cell--working",
@@ -15402,16 +15404,17 @@ function xy({ open: e, day: t, saving: n = !1, onCancel: r, onSubmit: i, onDelet
15402
15404
  let f = () => ({ validator(e, t) {
15403
15405
  let n = ly(t);
15404
15406
  return n < 0 ? Promise.reject(/* @__PURE__ */ Error("Standard Hours cannot be negative.")) : n > _y ? Promise.reject(/* @__PURE__ */ Error("Standard Hours cannot exceed 8 hours.")) : Promise.resolve();
15405
- } }), p = ({ getFieldValue: e }) => ({ validator(t, n) {
15406
- if (ly(n) < 0) return Promise.reject(/* @__PURE__ */ Error("Leave Hours cannot be negative."));
15407
- let r = ly(e("ST")), i = ly(e("Leave"));
15408
- return Math.abs(r + i - _y) <= yy ? Promise.resolve() : Promise.reject(/* @__PURE__ */ Error("Standard Hours and Leave Hours together must equal 8 hours."));
15409
- } }), m = ({ getFieldValue: e }) => ({ validator(t, n) {
15410
- let r = ly(n);
15411
- if (r < 0) return Promise.reject(/* @__PURE__ */ Error("Overtime cannot be negative."));
15412
- if (r === 0) return Promise.resolve();
15413
- let i = ly(e("ST"));
15414
- return i < _y ? Promise.reject(/* @__PURE__ */ Error("Overtime can only be entered after completing 8 standard working hours.")) : ly(e("Leave")) > 0 ? Promise.reject(/* @__PURE__ */ Error("Overtime is not allowed when leave hours are recorded.")) : i + r > s ? Promise.reject(/* @__PURE__ */ Error("Total working hours exceed the maximum allowed daily limit.")) : Promise.resolve();
15407
+ } }), p = ({ getFieldValue: e }) => ({ validator(n, r) {
15408
+ if (ly(r) < 0) return Promise.reject(/* @__PURE__ */ Error("Leave Hours cannot be negative."));
15409
+ if (t?.isWeekOff) return Promise.resolve();
15410
+ let i = ly(e("ST")), a = ly(e("Leave"));
15411
+ return Math.abs(i + a - _y) <= yy ? Promise.resolve() : Promise.reject(/* @__PURE__ */ Error("Standard Hours and Leave Hours together must equal 8 hours."));
15412
+ } }), m = ({ getFieldValue: e }) => ({ validator(n, r) {
15413
+ let i = ly(r);
15414
+ if (i < 0) return Promise.reject(/* @__PURE__ */ Error("Overtime cannot be negative."));
15415
+ if (i === 0) return Promise.resolve();
15416
+ let a = ly(e("ST"));
15417
+ return !t?.isWeekOff && a < _y ? Promise.reject(/* @__PURE__ */ Error("Overtime can only be entered after completing 8 standard working hours.")) : ly(e("Leave")) > 0 ? Promise.reject(/* @__PURE__ */ Error("Overtime is not allowed when leave hours are recorded.")) : a + i > s ? Promise.reject(/* @__PURE__ */ Error("Total working hours exceed the maximum allowed daily limit.")) : Promise.resolve();
15415
15418
  } }), h = ({ getFieldValue: e }) => ({ validator(t, n) {
15416
15419
  let r = ly(n), i = ly(e("OT"));
15417
15420
  return r > 0 && i > 0 ? Promise.reject(/* @__PURE__ */ Error("Overtime is not allowed when leave hours are recorded.")) : Promise.resolve();
@@ -15422,7 +15425,7 @@ function xy({ open: e, day: t, saving: n = !1, onCancel: r, onSubmit: i, onDelet
15422
15425
  "Leave"
15423
15426
  ]).catch(() => {});
15424
15427
  }, _ = (e) => {
15425
- if ("ST" in e) {
15428
+ if ("ST" in e && !t?.isWeekOff) {
15426
15429
  let t = ly(e.ST), n = { Leave: by(_y - t, 0, _y) };
15427
15430
  t < _y && (n.OT = 0), c.setFieldsValue(n);
15428
15431
  }
@@ -15444,12 +15447,12 @@ function xy({ open: e, day: t, saving: n = !1, onCancel: r, onSubmit: i, onDelet
15444
15447
  isWeekOff: !!t?.isWeekOff,
15445
15448
  notes: ""
15446
15449
  });
15447
- }, y = t?.isHoliday || t?.isWeekOff, b = t?.date ? La(t.date).format("MMM DD, YYYY") : "Log time", x = ly(l), S = ly(u), C = ly(d), w = x < _y, T = x + S, E = x + S + C;
15450
+ }, y = t?.isHoliday, b = !!t?.isWeekOff && !y, x = t?.date ? La(t.date).format("MMM DD, YYYY") : "Log time", S = ly(l), C = ly(u), w = ly(d), T = !b && S < _y, E = S + C, D = S + C + w;
15448
15451
  return /* @__PURE__ */ Z(mr, {
15449
15452
  title: /* @__PURE__ */ Z(W, { children: [
15450
15453
  /* @__PURE__ */ X(iy, {
15451
15454
  strong: !0,
15452
- children: b
15455
+ children: x
15453
15456
  }),
15454
15457
  t?.isHoliday && /* @__PURE__ */ X(K, {
15455
15458
  color: "purple",
@@ -15512,140 +15515,150 @@ function xy({ open: e, day: t, saving: n = !1, onCancel: r, onSubmit: i, onDelet
15512
15515
  }), y ? /* @__PURE__ */ X(Xn, {
15513
15516
  type: "info",
15514
15517
  showIcon: !0,
15515
- message: t?.isHoliday ? "Holiday — no manual log required." : "Week off — no log required."
15516
- }) : /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ Z(V, {
15517
- form: c,
15518
- layout: "vertical",
15519
- className: "timesheet-log-form",
15520
- validateTrigger: ["onChange", "onBlur"],
15521
- onValuesChange: _,
15522
- children: [
15523
- /* @__PURE__ */ X(V.Item, {
15524
- name: "date",
15525
- label: "Date",
15526
- children: /* @__PURE__ */ X(ir, {
15527
- disabled: !0,
15528
- style: { width: "100%" }
15529
- })
15530
- }),
15531
- /* @__PURE__ */ X(V.Item, {
15532
- name: "ST",
15533
- label: /* @__PURE__ */ Z("span", {
15534
- style: {
15535
- color: "#1d4ed8",
15536
- fontWeight: 600
15537
- },
15538
- children: ["Standard ", /* @__PURE__ */ X("span", {
15539
- style: {
15540
- fontWeight: 400,
15541
- color: "#6b7280"
15542
- },
15543
- children: "hrs"
15544
- })]
15518
+ message: "Holiday — no manual log required."
15519
+ }) : /* @__PURE__ */ Z(Y, { children: [
15520
+ b && /* @__PURE__ */ X(Xn, {
15521
+ type: "info",
15522
+ showIcon: !0,
15523
+ message: "Weekend — logged as Overtime.",
15524
+ style: { marginBottom: 12 }
15525
+ }),
15526
+ /* @__PURE__ */ Z(V, {
15527
+ form: c,
15528
+ layout: "vertical",
15529
+ className: "timesheet-log-form",
15530
+ validateTrigger: ["onChange", "onBlur"],
15531
+ onValuesChange: _,
15532
+ children: [
15533
+ /* @__PURE__ */ X(V.Item, {
15534
+ name: "date",
15535
+ label: "Date",
15536
+ children: /* @__PURE__ */ X(ir, {
15537
+ disabled: !0,
15538
+ style: { width: "100%" }
15539
+ })
15545
15540
  }),
15546
- dependencies: ["Leave"],
15547
- rules: [f, p],
15548
- children: /* @__PURE__ */ X(ur, {
15549
- min: 0,
15550
- max: _y,
15551
- step: o,
15552
- style: { width: "100%" },
15553
- addonAfter: /* @__PURE__ */ X("span", {
15541
+ /* @__PURE__ */ X(V.Item, {
15542
+ name: "ST",
15543
+ label: /* @__PURE__ */ Z("span", {
15554
15544
  style: {
15555
15545
  color: "#1d4ed8",
15556
- fontWeight: 700
15546
+ fontWeight: 600
15557
15547
  },
15558
- children: "s"
15548
+ children: ["Standard ", /* @__PURE__ */ X("span", {
15549
+ style: {
15550
+ fontWeight: 400,
15551
+ color: "#6b7280"
15552
+ },
15553
+ children: "hrs"
15554
+ })]
15555
+ }),
15556
+ dependencies: ["Leave"],
15557
+ rules: [f, p],
15558
+ hidden: b,
15559
+ children: /* @__PURE__ */ X(ur, {
15560
+ min: 0,
15561
+ max: _y,
15562
+ step: o,
15563
+ style: { width: "100%" },
15564
+ addonAfter: /* @__PURE__ */ X("span", {
15565
+ style: {
15566
+ color: "#1d4ed8",
15567
+ fontWeight: 700
15568
+ },
15569
+ children: "s"
15570
+ })
15559
15571
  })
15560
- })
15561
- }),
15562
- /* @__PURE__ */ X(V.Item, {
15563
- name: "OT",
15564
- label: /* @__PURE__ */ Z("span", {
15565
- style: {
15566
- color: "#15803d",
15567
- fontWeight: 600
15568
- },
15569
- children: ["Overtime ", /* @__PURE__ */ X("span", {
15570
- style: {
15571
- fontWeight: 400,
15572
- color: "#6b7280"
15573
- },
15574
- children: "hrs"
15575
- })]
15576
15572
  }),
15577
- dependencies: ["ST", "Leave"],
15578
- rules: [m],
15579
- extra: w ? "Complete 8 standard hours to log overtime." : void 0,
15580
- children: /* @__PURE__ */ X(ur, {
15581
- min: 0,
15582
- max: s,
15583
- step: o,
15584
- style: { width: "100%" },
15585
- disabled: w,
15586
- addonAfter: /* @__PURE__ */ X("span", {
15573
+ /* @__PURE__ */ X(V.Item, {
15574
+ name: "OT",
15575
+ label: /* @__PURE__ */ Z("span", {
15587
15576
  style: {
15588
15577
  color: "#15803d",
15589
- fontWeight: 700
15578
+ fontWeight: 600
15590
15579
  },
15591
- children: "o"
15580
+ children: ["Overtime ", /* @__PURE__ */ X("span", {
15581
+ style: {
15582
+ fontWeight: 400,
15583
+ color: "#6b7280"
15584
+ },
15585
+ children: "hrs"
15586
+ })]
15587
+ }),
15588
+ dependencies: ["ST", "Leave"],
15589
+ rules: [m],
15590
+ extra: T ? "Complete 8 standard hours to log overtime." : void 0,
15591
+ children: /* @__PURE__ */ X(ur, {
15592
+ min: 0,
15593
+ max: s,
15594
+ step: o,
15595
+ style: { width: "100%" },
15596
+ disabled: T,
15597
+ addonAfter: /* @__PURE__ */ X("span", {
15598
+ style: {
15599
+ color: "#15803d",
15600
+ fontWeight: 700
15601
+ },
15602
+ children: "o"
15603
+ })
15592
15604
  })
15593
- })
15594
- }),
15595
- /* @__PURE__ */ X(V.Item, {
15596
- name: "Leave",
15597
- label: /* @__PURE__ */ Z("span", {
15598
- style: {
15599
- color: "#b45309",
15600
- fontWeight: 600
15601
- },
15602
- children: ["Leave ", /* @__PURE__ */ X("span", {
15603
- style: {
15604
- fontWeight: 400,
15605
- color: "#6b7280"
15606
- },
15607
- children: "hrs"
15608
- })]
15609
15605
  }),
15610
- dependencies: ["ST", "OT"],
15611
- rules: [p, h],
15612
- children: /* @__PURE__ */ X(ur, {
15613
- min: 0,
15614
- max: _y,
15615
- step: o,
15616
- style: { width: "100%" },
15617
- addonAfter: /* @__PURE__ */ X("span", {
15606
+ /* @__PURE__ */ X(V.Item, {
15607
+ name: "Leave",
15608
+ label: /* @__PURE__ */ Z("span", {
15618
15609
  style: {
15619
15610
  color: "#b45309",
15620
- fontWeight: 700
15611
+ fontWeight: 600
15621
15612
  },
15622
- children: "L"
15613
+ children: ["Leave ", /* @__PURE__ */ X("span", {
15614
+ style: {
15615
+ fontWeight: 400,
15616
+ color: "#6b7280"
15617
+ },
15618
+ children: "hrs"
15619
+ })]
15620
+ }),
15621
+ dependencies: ["ST", "OT"],
15622
+ rules: [p, h],
15623
+ children: /* @__PURE__ */ X(ur, {
15624
+ min: 0,
15625
+ max: _y,
15626
+ step: o,
15627
+ style: { width: "100%" },
15628
+ addonAfter: /* @__PURE__ */ X("span", {
15629
+ style: {
15630
+ color: "#b45309",
15631
+ fontWeight: 700
15632
+ },
15633
+ children: "L"
15634
+ })
15623
15635
  })
15624
15636
  })
15625
- })
15626
- ]
15627
- }), /* @__PURE__ */ Z("div", {
15628
- className: "timesheet-log-summary",
15629
- children: [/* @__PURE__ */ Z("div", {
15630
- className: "timesheet-log-summary__row",
15631
- children: [/* @__PURE__ */ X(iy, {
15632
- type: "secondary",
15633
- children: "Worked (Standard + Overtime)"
15634
- }), /* @__PURE__ */ X(iy, {
15635
- strong: !0,
15636
- children: uy(T)
15637
- })]
15638
- }), /* @__PURE__ */ Z("div", {
15639
- className: "timesheet-log-summary__row",
15640
- children: [/* @__PURE__ */ X(iy, {
15641
- type: "secondary",
15642
- children: "Day Total"
15643
- }), /* @__PURE__ */ X(iy, {
15644
- strong: !0,
15645
- children: uy(E)
15637
+ ]
15638
+ }),
15639
+ /* @__PURE__ */ Z("div", {
15640
+ className: "timesheet-log-summary",
15641
+ children: [/* @__PURE__ */ Z("div", {
15642
+ className: "timesheet-log-summary__row",
15643
+ children: [/* @__PURE__ */ X(iy, {
15644
+ type: "secondary",
15645
+ children: "Worked (Standard + Overtime)"
15646
+ }), /* @__PURE__ */ X(iy, {
15647
+ strong: !0,
15648
+ children: uy(E)
15649
+ })]
15650
+ }), /* @__PURE__ */ Z("div", {
15651
+ className: "timesheet-log-summary__row",
15652
+ children: [/* @__PURE__ */ X(iy, {
15653
+ type: "secondary",
15654
+ children: "Day Total"
15655
+ }), /* @__PURE__ */ X(iy, {
15656
+ strong: !0,
15657
+ children: uy(D)
15658
+ })]
15646
15659
  })]
15647
- })]
15648
- })] })]
15660
+ })
15661
+ ] })]
15649
15662
  });
15650
15663
  }
15651
15664
  function Sy({ count: e = 0, total: t = 0, hours: n = 8, loading: r = !1, onConfirm: i, onCancel: a, onSelectAll: o, onSelectNone: s }) {