@diwauhris/ui 1.5.0 → 1.7.0
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/lib/assets/ui.css +134 -51
- package/lib/index.cjs +2847 -115
- package/lib/index.mjs +2836 -118
- package/lib/types/ui-library/gallery/charts/AreaChart.d.ts +110 -0
- package/lib/types/ui-library/gallery/charts/BarList.d.ts +65 -0
- package/lib/types/ui-library/gallery/charts/Charts.d.ts +21 -5
- package/lib/types/ui-library/gallery/combobox/Combobox.d.ts +2 -1
- package/lib/types/ui-library/gallery/org-chart/OrgChart.d.ts +77 -0
- package/lib/types/ui-library/gallery/org-unit-tree/OrgUnitTree.d.ts +84 -0
- package/lib/types/ui-library/gallery/page-sample/IsoCubeBlock.d.ts +28 -0
- package/lib/types/ui-library/gallery/status-page/StatusPage.d.ts +112 -0
- package/lib/types/ui-library/gallery/template-samples/templates/PafTemplate.d.ts +57 -0
- package/lib/types/ui-library/gallery/template-samples/templates/PayslipTemplate.d.ts +42 -0
- package/lib/types/ui-library/gallery/template-samples/templates/ReportTemplate.d.ts +18 -0
- package/lib/types/ui-library/gallery/template-samples/templates/TimekeepingTemplate.d.ts +22 -0
- package/lib/types/ui-library/index.d.ts +21 -1
- package/lib/types/ui-library/registry.d.ts +3 -9
- package/package.json +15 -2
package/lib/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, createElement, use, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
2
|
+
import React, { cloneElement, createContext, createElement, isValidElement, use, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { clsx } from "clsx";
|
|
4
4
|
import { twMerge } from "tailwind-merge";
|
|
5
|
-
import { AlertCircle, AlertTriangle, Archive, ArchiveRestore, ArrowDown, Ban, CalendarDays, Check, CheckCircle2, ChevronDown, ChevronLeft, ChevronRight, Clock, Command, File, Home, Info, Minus, Search, ShieldCheck, TrendingDown, TrendingUp, UploadCloud, X } from "lucide-react";
|
|
5
|
+
import { AlertCircle, AlertTriangle, Archive, ArchiveRestore, ArrowDown, Ban, CalendarDays, Check, CheckCircle2, ChevronDown, ChevronLeft, ChevronRight, Clock, Command, File, Home, Info, Minus, RotateCcw, Search, ShieldCheck, TrendingDown, TrendingUp, UploadCloud, X, ZoomIn, ZoomOut } from "lucide-react";
|
|
6
6
|
import Calendar$1 from "react-calendar";
|
|
7
7
|
import { format, isValid, parse } from "date-fns";
|
|
8
8
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
@@ -10,6 +10,7 @@ import { createPortal } from "react-dom";
|
|
|
10
10
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
11
11
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
12
12
|
import { Link } from "react-router-dom";
|
|
13
|
+
import * as d3 from "d3";
|
|
13
14
|
import { Toaster, toast } from "sonner";
|
|
14
15
|
export * from "lucide-react";
|
|
15
16
|
//#region \0rolldown/runtime.js
|
|
@@ -189,15 +190,15 @@ function getInitials(name) {
|
|
|
189
190
|
return ((parts[0] ?? "").charAt(0) + (parts[parts.length - 1] ?? "").charAt(0)).toUpperCase();
|
|
190
191
|
}
|
|
191
192
|
var PALETTE = [
|
|
192
|
-
"#
|
|
193
|
+
"#00377B",
|
|
194
|
+
"#034EA2",
|
|
195
|
+
"#2D8ACA",
|
|
196
|
+
"#00ADCC",
|
|
197
|
+
"#00A74C",
|
|
198
|
+
"#B61D66",
|
|
199
|
+
"#F68B1F",
|
|
193
200
|
"#0F4C81",
|
|
194
|
-
"#0369A1"
|
|
195
|
-
"#1E3A8A",
|
|
196
|
-
"#0D9488",
|
|
197
|
-
"#0F766E",
|
|
198
|
-
"#B45309",
|
|
199
|
-
"#C2410C",
|
|
200
|
-
"#BE185D"
|
|
201
|
+
"#0369A1"
|
|
201
202
|
];
|
|
202
203
|
function deriveColor(name) {
|
|
203
204
|
if (!name) return PALETTE[0];
|
|
@@ -695,6 +696,7 @@ function RadioItem({ value, label, description, disabled: itemDisabled = false,
|
|
|
695
696
|
const isDisabled = groupDisabled || itemDisabled;
|
|
696
697
|
const isChecked = activeValue === value;
|
|
697
698
|
return /* @__PURE__ */ jsxs("label", {
|
|
699
|
+
htmlFor: id,
|
|
698
700
|
className: [
|
|
699
701
|
"group flex cursor-pointer items-start gap-3",
|
|
700
702
|
isDisabled ? "cursor-not-allowed opacity-50" : "",
|
|
@@ -710,7 +712,8 @@ function RadioItem({ value, label, description, disabled: itemDisabled = false,
|
|
|
710
712
|
disabled: isDisabled,
|
|
711
713
|
required,
|
|
712
714
|
onChange: () => !isDisabled && select(value),
|
|
713
|
-
className: "peer sr-only"
|
|
715
|
+
className: "peer sr-only",
|
|
716
|
+
"aria-label": typeof label === "string" ? label : void 0
|
|
714
717
|
}),
|
|
715
718
|
/* @__PURE__ */ jsx("div", {
|
|
716
719
|
className: [
|
|
@@ -750,6 +753,7 @@ function Switch({ checked, onChange, label, description, disabled = false, loadi
|
|
|
750
753
|
role: "switch",
|
|
751
754
|
"aria-checked": checked,
|
|
752
755
|
"aria-labelledby": labelId,
|
|
756
|
+
"aria-label": !label ? "Toggle" : void 0,
|
|
753
757
|
"aria-disabled": !isInteractive || void 0,
|
|
754
758
|
disabled: !isInteractive,
|
|
755
759
|
onClick: () => isInteractive && onChange(!checked),
|
|
@@ -789,7 +793,7 @@ function Switch({ checked, onChange, label, description, disabled = false, loadi
|
|
|
789
793
|
*/
|
|
790
794
|
var fieldInputClass = "w-full rounded-xl border border-slate-200 bg-slate-50 px-4 py-2.5 text-sm font-medium text-slate-900 outline-none transition placeholder:text-slate-400 focus:border-brand-blue/40 focus:ring-2 focus:ring-brand-blue/15 disabled:cursor-not-allowed disabled:opacity-60";
|
|
791
795
|
var fieldInputErrorClass = "border-rose-300 focus:border-rose-400 focus:ring-rose-100";
|
|
792
|
-
function Combobox({ value, onChange, options, placeholder, className, disabled, loading, error }) {
|
|
796
|
+
function Combobox({ value, onChange, options, placeholder, className, disabled, loading, error, "aria-label": ariaLabel }) {
|
|
793
797
|
const [isOpen, setIsOpen] = useState(false);
|
|
794
798
|
const [search, setSearch] = useState(value);
|
|
795
799
|
const [highlightIndex, setHighlightIndex] = useState(-1);
|
|
@@ -870,6 +874,7 @@ function Combobox({ value, onChange, options, placeholder, className, disabled,
|
|
|
870
874
|
"aria-activedescendant": highlightIndex >= 0 ? optionId(highlightIndex) : void 0,
|
|
871
875
|
"aria-autocomplete": "list",
|
|
872
876
|
"aria-invalid": error ? "true" : void 0,
|
|
877
|
+
"aria-label": ariaLabel,
|
|
873
878
|
value: search,
|
|
874
879
|
onChange: handleInputChange,
|
|
875
880
|
onFocus: () => setIsOpen(true),
|
|
@@ -2371,12 +2376,6 @@ var radius = {
|
|
|
2371
2376
|
* - Use gallery Button component (Phase 11 — replaces legacy inlined btn* strings)
|
|
2372
2377
|
* - Use a simple inline ErrorBanner instead of importing from ui.tsx
|
|
2373
2378
|
*/
|
|
2374
|
-
function ErrorBanner$1({ message }) {
|
|
2375
|
-
return /* @__PURE__ */ jsx("div", {
|
|
2376
|
-
className: "rounded-lg border border-rose-100 bg-rose-50 px-4 py-3 text-sm font-medium text-rose-700",
|
|
2377
|
-
children: message
|
|
2378
|
-
});
|
|
2379
|
-
}
|
|
2380
2379
|
function ConfirmAction({ title, message, label, description, confirmLabel = "Confirm", tone = "danger", disabled = false, onConfirm, children }) {
|
|
2381
2380
|
const [open, setOpen] = useState(false);
|
|
2382
2381
|
const [pending, setPending] = useState(false);
|
|
@@ -2438,7 +2437,7 @@ function ConfirmAction({ title, message, label, description, confirmLabel = "Con
|
|
|
2438
2437
|
className: "text-sm font-medium leading-relaxed text-slate-600",
|
|
2439
2438
|
children: effectiveMessage
|
|
2440
2439
|
})]
|
|
2441
|
-
}), error && /* @__PURE__ */ jsx(ErrorBanner
|
|
2440
|
+
}), error && /* @__PURE__ */ jsx(ErrorBanner, { message: error })]
|
|
2442
2441
|
})
|
|
2443
2442
|
})] });
|
|
2444
2443
|
}
|
|
@@ -2929,8 +2928,8 @@ function StepCircle({ state, number, icon }) {
|
|
|
2929
2928
|
}
|
|
2930
2929
|
function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [], orientation = "horizontal", className = "" }) {
|
|
2931
2930
|
if (!(orientation === "horizontal")) return /* @__PURE__ */ jsx("div", {
|
|
2931
|
+
role: "group",
|
|
2932
2932
|
"aria-label": "Progress",
|
|
2933
|
-
"aria-orientation": "vertical",
|
|
2934
2933
|
className: ["flex flex-col", className].filter(Boolean).join(" "),
|
|
2935
2934
|
children: /* @__PURE__ */ jsx("ol", {
|
|
2936
2935
|
className: "flex flex-col",
|
|
@@ -2978,34 +2977,48 @@ function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [],
|
|
|
2978
2977
|
disabled: "text-slate-300"
|
|
2979
2978
|
};
|
|
2980
2979
|
return /* @__PURE__ */ jsx("div", {
|
|
2980
|
+
role: "group",
|
|
2981
2981
|
"aria-label": "Progress",
|
|
2982
|
-
"aria-orientation": "horizontal",
|
|
2983
2982
|
className: ["w-full", className].filter(Boolean).join(" "),
|
|
2984
2983
|
children: /* @__PURE__ */ jsx("ol", {
|
|
2985
|
-
className: "
|
|
2984
|
+
className: "grid w-full",
|
|
2985
|
+
style: { gridTemplateColumns: `repeat(${steps.length}, 1fr)` },
|
|
2986
2986
|
children: steps.map((step, idx) => {
|
|
2987
2987
|
const state = resolvedStates[idx];
|
|
2988
2988
|
const isCurrent = state === "current";
|
|
2989
2989
|
const isLast = idx === steps.length - 1;
|
|
2990
|
+
const prevState = idx > 0 ? resolvedStates[idx - 1] : null;
|
|
2990
2991
|
return /* @__PURE__ */ jsxs("li", {
|
|
2991
2992
|
"aria-current": isCurrent ? "step" : void 0,
|
|
2992
|
-
className:
|
|
2993
|
+
className: "flex flex-col items-center",
|
|
2993
2994
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
2994
|
-
className: "flex items-center
|
|
2995
|
-
children: [
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
2995
|
+
className: "flex w-full items-center",
|
|
2996
|
+
children: [
|
|
2997
|
+
idx > 0 ? /* @__PURE__ */ jsx("div", {
|
|
2998
|
+
className: `h-0.5 flex-1 ${prevState === "completed" || prevState === "current" ? "bg-brand-blue/50" : "bg-slate-200"}`,
|
|
2999
|
+
"aria-hidden": "true"
|
|
3000
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
3001
|
+
className: "flex-1",
|
|
3002
|
+
"aria-hidden": "true"
|
|
3003
|
+
}),
|
|
3004
|
+
/* @__PURE__ */ jsx("div", {
|
|
3005
|
+
className: "shrink-0 z-10",
|
|
3006
|
+
children: /* @__PURE__ */ jsx(StepCircle, {
|
|
3007
|
+
state,
|
|
3008
|
+
number: idx + 1,
|
|
3009
|
+
icon: step.icon
|
|
3010
|
+
})
|
|
3011
|
+
}),
|
|
3012
|
+
!isLast ? /* @__PURE__ */ jsx("div", {
|
|
3013
|
+
className: `h-0.5 flex-1 ${state === "completed" ? "bg-brand-blue/50" : "bg-slate-200"}`,
|
|
3014
|
+
"aria-hidden": "true"
|
|
3015
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
3016
|
+
className: "flex-1",
|
|
3017
|
+
"aria-hidden": "true"
|
|
3001
3018
|
})
|
|
3002
|
-
|
|
3003
|
-
className: `h-0.5 flex-1 ${state === "completed" ? "bg-brand-blue/50" : "bg-slate-200"}`,
|
|
3004
|
-
"aria-hidden": "true"
|
|
3005
|
-
})]
|
|
3019
|
+
]
|
|
3006
3020
|
}), /* @__PURE__ */ jsxs("div", {
|
|
3007
|
-
className: "mt-2 flex flex-col items-center text-center
|
|
3008
|
-
style: { transform: isLast ? "translateX(calc(50% - 1.125rem))" : idx === 0 ? "translateX(calc(-50% + 1.125rem))" : void 0 },
|
|
3021
|
+
className: "mt-2 flex flex-col items-center text-center px-1",
|
|
3009
3022
|
children: [/* @__PURE__ */ jsx("p", {
|
|
3010
3023
|
className: `text-sm leading-tight ${labelColor[state]}`,
|
|
3011
3024
|
children: step.label
|
|
@@ -3287,20 +3300,22 @@ function Menu({ trigger, items, ariaLabel = "Menu", align = "right" }) {
|
|
|
3287
3300
|
focusItem(items.length - 1);
|
|
3288
3301
|
}
|
|
3289
3302
|
};
|
|
3303
|
+
const panelAlign = align === "left" ? "left-0" : "right-0";
|
|
3290
3304
|
return /* @__PURE__ */ jsxs("div", {
|
|
3291
3305
|
className: "relative inline-block",
|
|
3292
3306
|
ref: containerRef,
|
|
3293
3307
|
children: [/* @__PURE__ */ jsx("div", {
|
|
3294
3308
|
ref: triggerRef,
|
|
3295
|
-
"aria-expanded": open,
|
|
3296
|
-
"aria-haspopup": "menu",
|
|
3297
3309
|
onClick: () => setOpen((v) => !v),
|
|
3298
3310
|
className: "cursor-pointer",
|
|
3299
|
-
children: trigger
|
|
3311
|
+
children: isValidElement(trigger) ? cloneElement(trigger, {
|
|
3312
|
+
"aria-expanded": open,
|
|
3313
|
+
"aria-haspopup": "menu"
|
|
3314
|
+
}) : trigger
|
|
3300
3315
|
}), open && /* @__PURE__ */ jsx("div", {
|
|
3301
3316
|
role: "menu",
|
|
3302
3317
|
"aria-label": ariaLabel,
|
|
3303
|
-
className: `absolute top-full ${
|
|
3318
|
+
className: `absolute top-full ${panelAlign} z-30 mt-1 min-w-[11rem] overflow-hidden rounded-xl border border-slate-200 bg-white py-1 shadow-xl`,
|
|
3304
3319
|
children: items.map((item, index) => /* @__PURE__ */ jsxs("button", {
|
|
3305
3320
|
ref: (node) => {
|
|
3306
3321
|
itemRefs.current[index] = node;
|
|
@@ -3704,6 +3719,7 @@ function TimelineValueCard({ beforeLabel = "Previous", afterLabel = "Current", b
|
|
|
3704
3719
|
})]
|
|
3705
3720
|
}), /* @__PURE__ */ jsx("div", {
|
|
3706
3721
|
className: "text-sm text-slate-500 leading-snug",
|
|
3722
|
+
role: "group",
|
|
3707
3723
|
"aria-label": `${beforeLabel} value`,
|
|
3708
3724
|
children: beforeContent
|
|
3709
3725
|
})]
|
|
@@ -3730,6 +3746,7 @@ function TimelineValueCard({ beforeLabel = "Previous", afterLabel = "Current", b
|
|
|
3730
3746
|
})]
|
|
3731
3747
|
}), /* @__PURE__ */ jsx("div", {
|
|
3732
3748
|
className: "text-sm font-semibold text-slate-800 leading-snug",
|
|
3749
|
+
role: "group",
|
|
3733
3750
|
"aria-label": `${afterLabel} value`,
|
|
3734
3751
|
children: afterContent
|
|
3735
3752
|
})]
|
|
@@ -3804,6 +3821,100 @@ function EmptyState({ title, hint, icon, action, className = "" }) {
|
|
|
3804
3821
|
});
|
|
3805
3822
|
}
|
|
3806
3823
|
//#endregion
|
|
3824
|
+
//#region src/ui-library/gallery/status-page/StatusPage.tsx
|
|
3825
|
+
/**
|
|
3826
|
+
* Named presets for the three common status states.
|
|
3827
|
+
* Each preset supplies code, eyebrow, title, and description.
|
|
3828
|
+
* Consumer always provides actions — presets never include navigation.
|
|
3829
|
+
*
|
|
3830
|
+
* Usage:
|
|
3831
|
+
* <StatusPage
|
|
3832
|
+
* {...STATUS_PAGE_PRESETS.notFound}
|
|
3833
|
+
* primaryAction={{ label: 'Go to Dashboard', onClick: () => navigate('/dashboard') }}
|
|
3834
|
+
* secondaryAction={{ label: 'Go Back', onClick: () => navigate(-1) }}
|
|
3835
|
+
* />
|
|
3836
|
+
*/
|
|
3837
|
+
var STATUS_PAGE_PRESETS = {
|
|
3838
|
+
notFound: {
|
|
3839
|
+
code: "404",
|
|
3840
|
+
eyebrow: "404 — Not Found",
|
|
3841
|
+
title: "Page Not Found",
|
|
3842
|
+
description: "The page you're looking for doesn't exist or may have been moved."
|
|
3843
|
+
},
|
|
3844
|
+
forbidden: {
|
|
3845
|
+
code: "403",
|
|
3846
|
+
eyebrow: "403 — Access Restricted",
|
|
3847
|
+
title: "Access Restricted",
|
|
3848
|
+
description: "You don't have permission to view this page. Contact your system administrator if you need access."
|
|
3849
|
+
},
|
|
3850
|
+
serverError: {
|
|
3851
|
+
code: "500",
|
|
3852
|
+
eyebrow: "500 — Server Error",
|
|
3853
|
+
title: "Something Went Wrong",
|
|
3854
|
+
description: "We encountered an unexpected problem. Please try again or return to the dashboard."
|
|
3855
|
+
}
|
|
3856
|
+
};
|
|
3857
|
+
var BASE_ANCHOR = "inline-flex items-center justify-center transition-all duration-150 ease-out active:scale-[.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 select-none h-10 gap-2 rounded-md px-4 text-sm";
|
|
3858
|
+
var ANCHOR_PRIMARY = `${BASE_ANCHOR} font-bold bg-brand-blue text-white shadow-lg shadow-brand-blue/25 hover:bg-brand-navy hover:shadow-xl hover:shadow-brand-blue/30 focus-visible:ring-brand-blue/30`;
|
|
3859
|
+
var ANCHOR_OUTLINE = `${BASE_ANCHOR} font-semibold border border-slate-300 bg-white text-slate-700 shadow-sm hover:border-brand-blue/40 hover:bg-blue-50/40 hover:text-brand-blue focus-visible:ring-brand-blue/20`;
|
|
3860
|
+
function ActionButton({ action, variant }) {
|
|
3861
|
+
if (action.href) return /* @__PURE__ */ jsx("a", {
|
|
3862
|
+
href: action.href,
|
|
3863
|
+
className: variant === "primary" ? ANCHOR_PRIMARY : ANCHOR_OUTLINE,
|
|
3864
|
+
children: action.label
|
|
3865
|
+
});
|
|
3866
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
3867
|
+
variant,
|
|
3868
|
+
onClick: action.onClick,
|
|
3869
|
+
children: action.label
|
|
3870
|
+
});
|
|
3871
|
+
}
|
|
3872
|
+
function StatusPage({ eyebrow, title, description, code, icon, primaryAction, secondaryAction, className = "" }) {
|
|
3873
|
+
const hasActions = primaryAction || secondaryAction;
|
|
3874
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
3875
|
+
className: `relative flex min-h-screen items-center justify-center bg-surface-page px-6 py-16 overflow-hidden ${className}`,
|
|
3876
|
+
children: [code ? /* @__PURE__ */ jsx("span", {
|
|
3877
|
+
"aria-hidden": "true",
|
|
3878
|
+
className: "pointer-events-none absolute select-none font-heading font-bold text-brand-navy opacity-[0.07] text-[80px] sm:text-[120px] leading-none",
|
|
3879
|
+
children: code
|
|
3880
|
+
}) : icon ? /* @__PURE__ */ jsx("span", {
|
|
3881
|
+
"aria-hidden": "true",
|
|
3882
|
+
className: "pointer-events-none absolute select-none text-brand-navy opacity-[0.12]",
|
|
3883
|
+
style: { fontSize: 0 },
|
|
3884
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
3885
|
+
className: "block [&>svg]:h-24 [&>svg]:w-24",
|
|
3886
|
+
children: icon
|
|
3887
|
+
})
|
|
3888
|
+
}) : null, /* @__PURE__ */ jsxs("div", {
|
|
3889
|
+
className: "relative z-10 max-w-sm w-full os-slide-up",
|
|
3890
|
+
children: [
|
|
3891
|
+
eyebrow && /* @__PURE__ */ jsx("p", {
|
|
3892
|
+
className: "mb-3 text-[11px] font-bold uppercase tracking-[0.18em] text-brand-sky",
|
|
3893
|
+
children: eyebrow
|
|
3894
|
+
}),
|
|
3895
|
+
/* @__PURE__ */ jsx("h1", {
|
|
3896
|
+
className: "font-heading text-3xl font-bold text-brand-navy leading-tight",
|
|
3897
|
+
children: title
|
|
3898
|
+
}),
|
|
3899
|
+
/* @__PURE__ */ jsx("p", {
|
|
3900
|
+
className: "mt-3 text-sm font-medium text-slate-500 leading-relaxed",
|
|
3901
|
+
children: description
|
|
3902
|
+
}),
|
|
3903
|
+
hasActions && /* @__PURE__ */ jsxs("div", {
|
|
3904
|
+
className: "mt-8 flex flex-wrap items-center gap-3",
|
|
3905
|
+
children: [primaryAction && /* @__PURE__ */ jsx(ActionButton, {
|
|
3906
|
+
action: primaryAction,
|
|
3907
|
+
variant: "primary"
|
|
3908
|
+
}), secondaryAction && /* @__PURE__ */ jsx(ActionButton, {
|
|
3909
|
+
action: secondaryAction,
|
|
3910
|
+
variant: "outline"
|
|
3911
|
+
})]
|
|
3912
|
+
})
|
|
3913
|
+
]
|
|
3914
|
+
})]
|
|
3915
|
+
});
|
|
3916
|
+
}
|
|
3917
|
+
//#endregion
|
|
3807
3918
|
//#region src/ui-library/gallery/employee-card/EmployeeCard.tsx
|
|
3808
3919
|
function EmployeeCard({ name, role, avatarSrc, status, meta, actions, className = "" }) {
|
|
3809
3920
|
return /* @__PURE__ */ jsxs("article", {
|
|
@@ -3895,11 +4006,11 @@ function EmployeeCard({ name, role, avatarSrc, status, meta, actions, className
|
|
|
3895
4006
|
* onSelect={setSelected}
|
|
3896
4007
|
* />
|
|
3897
4008
|
*/
|
|
3898
|
-
function flattenVisible(items, expanded) {
|
|
4009
|
+
function flattenVisible$1(items, expanded) {
|
|
3899
4010
|
const result = [];
|
|
3900
4011
|
for (const item of items) {
|
|
3901
4012
|
result.push(item);
|
|
3902
|
-
if (item.children && expanded.has(item.id)) result.push(...flattenVisible(item.children, expanded));
|
|
4013
|
+
if (item.children && expanded.has(item.id)) result.push(...flattenVisible$1(item.children, expanded));
|
|
3903
4014
|
}
|
|
3904
4015
|
return result;
|
|
3905
4016
|
}
|
|
@@ -3989,7 +4100,7 @@ function TreeView({ items, selectedId, onSelect, "aria-label": ariaLabel, classN
|
|
|
3989
4100
|
onSelect?.(id);
|
|
3990
4101
|
}, [onSelect]);
|
|
3991
4102
|
const handleKeyDown = (e) => {
|
|
3992
|
-
const visible = flattenVisible(items, expanded);
|
|
4103
|
+
const visible = flattenVisible$1(items, expanded);
|
|
3993
4104
|
if (visible.length === 0) return;
|
|
3994
4105
|
const currentId = selectedId ?? visible[0]?.id;
|
|
3995
4106
|
const currentIdx = visible.findIndex((v) => v.id === currentId);
|
|
@@ -4338,67 +4449,154 @@ function Calendar({ value, defaultValue, onChange, minDate, maxDate, className =
|
|
|
4338
4449
|
}
|
|
4339
4450
|
//#endregion
|
|
4340
4451
|
//#region src/ui-library/gallery/charts/Charts.tsx
|
|
4341
|
-
|
|
4452
|
+
/**
|
|
4453
|
+
* Charts — Design System Components
|
|
4454
|
+
*
|
|
4455
|
+
* Lightweight SVG-native chart primitives. No charting library dependency.
|
|
4456
|
+
* Suitable for simple analytics/KPI displays.
|
|
4457
|
+
*
|
|
4458
|
+
* Components:
|
|
4459
|
+
* BarChart — vertical bar chart
|
|
4460
|
+
* LineChart — line/area chart (SVG path)
|
|
4461
|
+
* CHART_PALETTE — shared default color sequence for multi-series charts
|
|
4462
|
+
*
|
|
4463
|
+
* Visual language (applied as defaults, no new props):
|
|
4464
|
+
* - BarChart: top-only rounded corners, subtle same-hue gradient fill,
|
|
4465
|
+
* baseline rule, value labels inside SVG above bars, comfortable gaps
|
|
4466
|
+
* - LineChart: gradient area fill fading to transparent, strokeWidth 2,
|
|
4467
|
+
* white-ring dots only when ≤ 12 data points, no horizontal distortion
|
|
4468
|
+
*
|
|
4469
|
+
* Accessibility:
|
|
4470
|
+
* - role="img" on every SVG with aria-label describing the chart
|
|
4471
|
+
* - Each bar/point has aria-label with label and value
|
|
4472
|
+
* - Decorative elements are aria-hidden
|
|
4473
|
+
*/
|
|
4474
|
+
/**
|
|
4475
|
+
* Default color sequence for multi-series / per-item charts.
|
|
4476
|
+
* Built on the brand's blue-sky hue family with a single warm accent.
|
|
4477
|
+
* Import this directly when constructing per-item color arrays:
|
|
4478
|
+
*
|
|
4479
|
+
* import { CHART_PALETTE } from '@diwauhris/ui';
|
|
4480
|
+
* const data = items.map((item, i) => ({ ...item, color: CHART_PALETTE[i % CHART_PALETTE.length] }));
|
|
4481
|
+
*/
|
|
4482
|
+
var CHART_PALETTE = [
|
|
4483
|
+
"#034EA2",
|
|
4484
|
+
"#2D8ACA",
|
|
4485
|
+
"#4F6FBF",
|
|
4486
|
+
"#0E7490",
|
|
4487
|
+
"#B45309"
|
|
4488
|
+
];
|
|
4489
|
+
function BarChart({ data, height = 160, barColor = "#034EA2", "aria-label": ariaLabel, className = "" }) {
|
|
4490
|
+
const uid = useId().replace(/:/g, "");
|
|
4342
4491
|
const max = Math.max(...data.map((d) => d.value), 1);
|
|
4343
|
-
const
|
|
4344
|
-
const
|
|
4492
|
+
const n = data.length;
|
|
4493
|
+
const W = Math.max(n * 50, 200);
|
|
4494
|
+
const w = W / n;
|
|
4495
|
+
const gap = w * .2;
|
|
4345
4496
|
const bw = w - gap * 2;
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4497
|
+
const bottomPad = 24;
|
|
4498
|
+
const labelGap = 4;
|
|
4499
|
+
const chartH = height - bottomPad;
|
|
4500
|
+
const baselineY = chartH;
|
|
4501
|
+
const isDefaultBarColor = barColor === "#034EA2";
|
|
4502
|
+
const fillColors = data.map((d, i) => d.color ?? (isDefaultBarColor ? CHART_PALETTE[i % CHART_PALETTE.length] ?? barColor : barColor));
|
|
4503
|
+
const distinctColors = Array.from(new Set(fillColors));
|
|
4504
|
+
return /* @__PURE__ */ jsx("div", {
|
|
4505
|
+
className,
|
|
4506
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
4349
4507
|
role: "img",
|
|
4350
4508
|
"aria-label": ariaLabel,
|
|
4351
|
-
viewBox: `0 0
|
|
4509
|
+
viewBox: `0 0 ${W} ${height}`,
|
|
4352
4510
|
preserveAspectRatio: "none",
|
|
4353
4511
|
className: "w-full",
|
|
4354
4512
|
style: { height },
|
|
4355
|
-
children: [
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
"
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4513
|
+
children: [
|
|
4514
|
+
/* @__PURE__ */ jsx("defs", { children: distinctColors.map((color) => /* @__PURE__ */ jsxs("linearGradient", {
|
|
4515
|
+
id: `${uid}-bg-${color.replace("#", "")}`,
|
|
4516
|
+
x1: "0",
|
|
4517
|
+
y1: "0",
|
|
4518
|
+
x2: "0",
|
|
4519
|
+
y2: height - bottomPad,
|
|
4520
|
+
gradientUnits: "userSpaceOnUse",
|
|
4521
|
+
children: [/* @__PURE__ */ jsx("stop", {
|
|
4522
|
+
offset: "0%",
|
|
4523
|
+
stopColor: color,
|
|
4524
|
+
stopOpacity: 1
|
|
4525
|
+
}), /* @__PURE__ */ jsx("stop", {
|
|
4526
|
+
offset: "100%",
|
|
4527
|
+
stopColor: color,
|
|
4528
|
+
stopOpacity: .7
|
|
4529
|
+
})]
|
|
4530
|
+
}, color)) }),
|
|
4531
|
+
/* @__PURE__ */ jsx("line", {
|
|
4532
|
+
x1: 0,
|
|
4533
|
+
y1: baselineY,
|
|
4534
|
+
x2: W,
|
|
4535
|
+
y2: baselineY,
|
|
4536
|
+
stroke: "#e2e8f0",
|
|
4537
|
+
strokeWidth: .5,
|
|
4538
|
+
"aria-hidden": "true"
|
|
4539
|
+
}),
|
|
4540
|
+
data.map((d, i) => {
|
|
4541
|
+
const fillColor = fillColors[i];
|
|
4542
|
+
const gradId = `${uid}-bg-${fillColor.replace("#", "")}`;
|
|
4543
|
+
const barH = d.value / max * (chartH - 16);
|
|
4544
|
+
const x = i * w + gap;
|
|
4545
|
+
const barY = chartH - barH;
|
|
4546
|
+
const rx = Math.min(3, barH * .4);
|
|
4547
|
+
const barPath = barH < 1 ? "" : [
|
|
4548
|
+
`M ${x + rx},${barY}`,
|
|
4549
|
+
`Q ${x},${barY} ${x},${barY + rx}`,
|
|
4550
|
+
`L ${x},${barY + barH}`,
|
|
4551
|
+
`L ${x + bw},${barY + barH}`,
|
|
4552
|
+
`L ${x + bw},${barY + rx}`,
|
|
4553
|
+
`Q ${x + bw},${barY} ${x + bw - rx},${barY}`,
|
|
4554
|
+
"Z"
|
|
4555
|
+
].join(" ");
|
|
4556
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
4557
|
+
"aria-label": `${d.label}: ${d.value}`,
|
|
4558
|
+
role: "img",
|
|
4559
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
4560
|
+
d: barPath,
|
|
4561
|
+
fill: `url(#${gradId})`
|
|
4562
|
+
}), /* @__PURE__ */ jsx("text", {
|
|
4563
|
+
x: x + bw / 2,
|
|
4564
|
+
y: barY - labelGap,
|
|
4565
|
+
textAnchor: "middle",
|
|
4566
|
+
fontSize: 7,
|
|
4567
|
+
fill: "#64748b",
|
|
4568
|
+
fontWeight: "600",
|
|
4569
|
+
fontFamily: "inherit",
|
|
4570
|
+
"aria-hidden": "true",
|
|
4571
|
+
children: d.value
|
|
4572
|
+
})]
|
|
4573
|
+
}, d.label);
|
|
4574
|
+
}),
|
|
4575
|
+
data.map((d, i) => /* @__PURE__ */ jsx("text", {
|
|
4576
|
+
x: i * w + w / 2,
|
|
4577
|
+
y: height - 4,
|
|
4578
|
+
textAnchor: "middle",
|
|
4579
|
+
fontSize: 7,
|
|
4580
|
+
fill: "#94a3b8",
|
|
4581
|
+
fontWeight: "600",
|
|
4582
|
+
fontFamily: "inherit",
|
|
4583
|
+
"aria-hidden": "true",
|
|
4584
|
+
children: d.label
|
|
4585
|
+
}, `lbl-${d.label}`))
|
|
4586
|
+
]
|
|
4587
|
+
})
|
|
4391
4588
|
});
|
|
4392
4589
|
}
|
|
4393
|
-
function LineChart({ data, height = 120, lineColor = "#
|
|
4590
|
+
function LineChart({ data, height = 120, lineColor = "#034EA2", filled = true, "aria-label": ariaLabel, className = "" }) {
|
|
4591
|
+
const uid = useId().replace(/:/g, "");
|
|
4394
4592
|
const max = Math.max(...data.map((d) => d.value), 1);
|
|
4395
4593
|
const n = data.length;
|
|
4396
4594
|
if (n < 2) return null;
|
|
4397
|
-
const
|
|
4398
|
-
const W = 100;
|
|
4595
|
+
const W = 300;
|
|
4399
4596
|
const H = height;
|
|
4400
|
-
const
|
|
4401
|
-
const
|
|
4597
|
+
const pad = Math.round(H * .07);
|
|
4598
|
+
const px = (i) => pad + i / (n - 1) * (W - pad * 2);
|
|
4599
|
+
const py = (v) => pad + (max - v) / max * (H - pad * 2);
|
|
4402
4600
|
const points = data.map((d, i) => ({
|
|
4403
4601
|
x: px(i),
|
|
4404
4602
|
y: py(d.value),
|
|
@@ -4407,38 +4605,314 @@ function LineChart({ data, height = 120, lineColor = "#6366f1", filled = true, "
|
|
|
4407
4605
|
}));
|
|
4408
4606
|
const linePath = points.map((p, i) => `${i === 0 ? "M" : "L"}${p.x},${p.y}`).join(" ");
|
|
4409
4607
|
const areaPath = `${linePath} L${points[n - 1].x},${H - pad} L${points[0].x},${H - pad} Z`;
|
|
4608
|
+
const showDots = n <= 12;
|
|
4410
4609
|
return /* @__PURE__ */ jsxs("svg", {
|
|
4411
4610
|
role: "img",
|
|
4412
4611
|
"aria-label": ariaLabel,
|
|
4413
4612
|
viewBox: `0 0 ${W} ${H}`,
|
|
4414
|
-
preserveAspectRatio: "none",
|
|
4415
4613
|
className: `w-full ${className}`,
|
|
4416
4614
|
style: { height },
|
|
4417
4615
|
children: [
|
|
4616
|
+
/* @__PURE__ */ jsx("defs", { children: filled && /* @__PURE__ */ jsxs("linearGradient", {
|
|
4617
|
+
id: `${uid}-lc-fill`,
|
|
4618
|
+
x1: "0",
|
|
4619
|
+
y1: "0",
|
|
4620
|
+
x2: "0",
|
|
4621
|
+
y2: "1",
|
|
4622
|
+
children: [/* @__PURE__ */ jsx("stop", {
|
|
4623
|
+
offset: "0%",
|
|
4624
|
+
stopColor: lineColor,
|
|
4625
|
+
stopOpacity: .2
|
|
4626
|
+
}), /* @__PURE__ */ jsx("stop", {
|
|
4627
|
+
offset: "100%",
|
|
4628
|
+
stopColor: lineColor,
|
|
4629
|
+
stopOpacity: 0
|
|
4630
|
+
})]
|
|
4631
|
+
}) }),
|
|
4418
4632
|
filled && /* @__PURE__ */ jsx("path", {
|
|
4419
4633
|
d: areaPath,
|
|
4420
|
-
fill:
|
|
4421
|
-
|
|
4634
|
+
fill: `url(#${uid}-lc-fill)`,
|
|
4635
|
+
"aria-hidden": "true"
|
|
4422
4636
|
}),
|
|
4423
4637
|
/* @__PURE__ */ jsx("path", {
|
|
4424
4638
|
d: linePath,
|
|
4425
4639
|
fill: "none",
|
|
4426
4640
|
stroke: lineColor,
|
|
4427
|
-
strokeWidth:
|
|
4641
|
+
strokeWidth: 2,
|
|
4428
4642
|
strokeLinejoin: "round",
|
|
4429
|
-
strokeLinecap: "round"
|
|
4643
|
+
strokeLinecap: "round",
|
|
4644
|
+
"aria-hidden": "true"
|
|
4430
4645
|
}),
|
|
4431
|
-
points.map((p) => /* @__PURE__ */ jsx("circle", {
|
|
4646
|
+
showDots && points.map((p) => /* @__PURE__ */ jsx("circle", {
|
|
4432
4647
|
cx: p.x,
|
|
4433
4648
|
cy: p.y,
|
|
4434
|
-
r: 2,
|
|
4649
|
+
r: 2.5,
|
|
4435
4650
|
fill: lineColor,
|
|
4651
|
+
stroke: "white",
|
|
4652
|
+
strokeWidth: 1.5,
|
|
4653
|
+
role: "img",
|
|
4436
4654
|
"aria-label": `${p.label}: ${p.value}`
|
|
4437
4655
|
}, p.label))
|
|
4438
4656
|
]
|
|
4439
4657
|
});
|
|
4440
4658
|
}
|
|
4441
4659
|
//#endregion
|
|
4660
|
+
//#region src/ui-library/gallery/charts/AreaChart.tsx
|
|
4661
|
+
/**
|
|
4662
|
+
* AreaChart — Design System Component
|
|
4663
|
+
*
|
|
4664
|
+
* SVG area/line chart with gradient fill, explicit Y-axis ticks, optional
|
|
4665
|
+
* threshold line, point annotations, highlight regions, and multi-series support.
|
|
4666
|
+
* No external charting library — native SVG only.
|
|
4667
|
+
*
|
|
4668
|
+
* Gradient IDs are scoped per instance via useId() to avoid SVG ID collisions
|
|
4669
|
+
* when multiple charts appear on the same page.
|
|
4670
|
+
*
|
|
4671
|
+
* Usage:
|
|
4672
|
+
* <AreaChart
|
|
4673
|
+
* data={monthlyData}
|
|
4674
|
+
* series={{ dataKey: 'value', color: '#6366f1', fillOpacity: { top: 0.22, bottom: 0.01 } }}
|
|
4675
|
+
* yTicks={[0, 25, 50, 75, 100]}
|
|
4676
|
+
* yTickFormat={(v) => `${v}%`}
|
|
4677
|
+
* annotations={[{ dataIndex: 5, label: 'Peak', radius: 5, color: '#ef4444' }]}
|
|
4678
|
+
* height={170}
|
|
4679
|
+
* />
|
|
4680
|
+
*
|
|
4681
|
+
* Accessibility:
|
|
4682
|
+
* - role="img" on the SVG with aria-label
|
|
4683
|
+
* - Each dot has aria-label with label and value
|
|
4684
|
+
* - Decorative elements are aria-hidden
|
|
4685
|
+
*/
|
|
4686
|
+
function resolveOpacity(op) {
|
|
4687
|
+
if (op === void 0) return {
|
|
4688
|
+
top: .15,
|
|
4689
|
+
bottom: 0
|
|
4690
|
+
};
|
|
4691
|
+
if (typeof op === "number") return {
|
|
4692
|
+
top: op,
|
|
4693
|
+
bottom: op
|
|
4694
|
+
};
|
|
4695
|
+
return op;
|
|
4696
|
+
}
|
|
4697
|
+
function AreaChart({ data, series, yTicks, yTickFormat, showDots = true, threshold, annotations = [], highlightRegion, height = 170, "aria-label": ariaLabel = "Area chart", className = "" }) {
|
|
4698
|
+
const uid = useId().replace(/:/g, "");
|
|
4699
|
+
const seriesArr = Array.isArray(series) ? series : [series];
|
|
4700
|
+
const primary = seriesArr[0];
|
|
4701
|
+
const W = 560;
|
|
4702
|
+
const pl = 52;
|
|
4703
|
+
const pt = 14;
|
|
4704
|
+
const pb = 30;
|
|
4705
|
+
const cW = 492;
|
|
4706
|
+
const cH = height - pt - pb;
|
|
4707
|
+
const n = data.length;
|
|
4708
|
+
const yTicksSafe = yTicks && yTicks.length > 0 ? yTicks : void 0;
|
|
4709
|
+
const minY = yTicksSafe ? Math.min(...yTicksSafe) : 0;
|
|
4710
|
+
const maxY = yTicksSafe ? Math.max(...yTicksSafe) : Math.max(...seriesArr.flatMap((s) => data.map((d) => Number(d[s.dataKey] ?? 0))), 1);
|
|
4711
|
+
const cx = (i) => pl + i / Math.max(n - 1, 1) * cW;
|
|
4712
|
+
const cy = (v) => pt + (1 - (v - minY) / (maxY - minY)) * cH;
|
|
4713
|
+
const paths = seriesArr.map((s) => {
|
|
4714
|
+
const vals = data.map((d) => Number(d[s.dataKey] ?? 0));
|
|
4715
|
+
const line = "M" + vals.map((v, i) => `${cx(i)},${cy(v)}`).join("L");
|
|
4716
|
+
return {
|
|
4717
|
+
line,
|
|
4718
|
+
area: `${line}L${cx(n - 1)},${height - pb}L${cx(0)},${height - pb}Z`,
|
|
4719
|
+
vals
|
|
4720
|
+
};
|
|
4721
|
+
});
|
|
4722
|
+
const annotatedIdx = new Set(annotations.map((a) => a.dataIndex));
|
|
4723
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
4724
|
+
role: "img",
|
|
4725
|
+
"aria-label": ariaLabel,
|
|
4726
|
+
viewBox: `0 0 ${W} ${height}`,
|
|
4727
|
+
className: `w-full ${className}`,
|
|
4728
|
+
style: { height },
|
|
4729
|
+
children: [
|
|
4730
|
+
/* @__PURE__ */ jsx("defs", { children: seriesArr.map((s, si) => {
|
|
4731
|
+
const op = resolveOpacity(s.fillOpacity);
|
|
4732
|
+
return /* @__PURE__ */ jsxs("linearGradient", {
|
|
4733
|
+
id: `${uid}-g${si}`,
|
|
4734
|
+
x1: "0",
|
|
4735
|
+
y1: "0",
|
|
4736
|
+
x2: "0",
|
|
4737
|
+
y2: "1",
|
|
4738
|
+
children: [/* @__PURE__ */ jsx("stop", {
|
|
4739
|
+
offset: "0%",
|
|
4740
|
+
stopColor: s.color,
|
|
4741
|
+
stopOpacity: op.top
|
|
4742
|
+
}), /* @__PURE__ */ jsx("stop", {
|
|
4743
|
+
offset: "100%",
|
|
4744
|
+
stopColor: s.color,
|
|
4745
|
+
stopOpacity: op.bottom
|
|
4746
|
+
})]
|
|
4747
|
+
}, si);
|
|
4748
|
+
}) }),
|
|
4749
|
+
highlightRegion && /* @__PURE__ */ jsxs("g", {
|
|
4750
|
+
"aria-hidden": "true",
|
|
4751
|
+
children: [/* @__PURE__ */ jsx("rect", {
|
|
4752
|
+
x: cx(highlightRegion.startIndex),
|
|
4753
|
+
y: pt,
|
|
4754
|
+
width: cx(highlightRegion.endIndex) - cx(highlightRegion.startIndex),
|
|
4755
|
+
height: cH,
|
|
4756
|
+
fill: highlightRegion.color ?? "#eef0ff",
|
|
4757
|
+
rx: 3,
|
|
4758
|
+
opacity: .7
|
|
4759
|
+
}), highlightRegion.label && /* @__PURE__ */ jsx("text", {
|
|
4760
|
+
x: (cx(highlightRegion.startIndex) + cx(highlightRegion.endIndex)) / 2,
|
|
4761
|
+
y: 23,
|
|
4762
|
+
textAnchor: "middle",
|
|
4763
|
+
fontSize: 7.5,
|
|
4764
|
+
fill: "#a5b4fc",
|
|
4765
|
+
children: highlightRegion.label
|
|
4766
|
+
})]
|
|
4767
|
+
}),
|
|
4768
|
+
yTicks?.map((v) => /* @__PURE__ */ jsxs("g", {
|
|
4769
|
+
"aria-hidden": "true",
|
|
4770
|
+
children: [/* @__PURE__ */ jsx("line", {
|
|
4771
|
+
x1: pl,
|
|
4772
|
+
y1: cy(v),
|
|
4773
|
+
x2: 544,
|
|
4774
|
+
y2: cy(v),
|
|
4775
|
+
stroke: "#f1f5f9",
|
|
4776
|
+
strokeWidth: 1
|
|
4777
|
+
}), /* @__PURE__ */ jsx("text", {
|
|
4778
|
+
x: 46,
|
|
4779
|
+
y: cy(v) + 4,
|
|
4780
|
+
textAnchor: "end",
|
|
4781
|
+
fontSize: 9,
|
|
4782
|
+
fill: "#94a3b8",
|
|
4783
|
+
children: yTickFormat ? yTickFormat(v) : String(v)
|
|
4784
|
+
})]
|
|
4785
|
+
}, v)),
|
|
4786
|
+
threshold && /* @__PURE__ */ jsx("line", {
|
|
4787
|
+
x1: pl,
|
|
4788
|
+
y1: cy(threshold.value),
|
|
4789
|
+
x2: 544,
|
|
4790
|
+
y2: cy(threshold.value),
|
|
4791
|
+
stroke: threshold.color ?? "#f59e0b",
|
|
4792
|
+
strokeWidth: 1,
|
|
4793
|
+
strokeDasharray: threshold.strokeStyle === "solid" ? void 0 : "4,2",
|
|
4794
|
+
"aria-hidden": "true"
|
|
4795
|
+
}),
|
|
4796
|
+
seriesArr.map((s, si) => {
|
|
4797
|
+
const op = resolveOpacity(s.fillOpacity);
|
|
4798
|
+
if (op.top === 0 && op.bottom === 0) return null;
|
|
4799
|
+
return /* @__PURE__ */ jsx("path", {
|
|
4800
|
+
d: paths[si].area,
|
|
4801
|
+
fill: `url(#${uid}-g${si})`,
|
|
4802
|
+
"aria-hidden": "true"
|
|
4803
|
+
}, `area-${si}`);
|
|
4804
|
+
}),
|
|
4805
|
+
seriesArr.map((s, si) => /* @__PURE__ */ jsx("path", {
|
|
4806
|
+
d: paths[si].line,
|
|
4807
|
+
fill: "none",
|
|
4808
|
+
stroke: s.color,
|
|
4809
|
+
strokeWidth: si === 0 ? 2.5 : 1.5,
|
|
4810
|
+
strokeLinecap: "round",
|
|
4811
|
+
strokeLinejoin: "round",
|
|
4812
|
+
strokeDasharray: s.strokeStyle === "dashed" ? "4,2" : void 0,
|
|
4813
|
+
"aria-hidden": "true"
|
|
4814
|
+
}, `line-${si}`)),
|
|
4815
|
+
showDots && paths[0].vals.map((v, i) => {
|
|
4816
|
+
if (annotatedIdx.has(i)) return null;
|
|
4817
|
+
return /* @__PURE__ */ jsx("circle", {
|
|
4818
|
+
cx: cx(i),
|
|
4819
|
+
cy: cy(v),
|
|
4820
|
+
r: 3.5,
|
|
4821
|
+
fill: primary.color,
|
|
4822
|
+
stroke: "white",
|
|
4823
|
+
strokeWidth: 2,
|
|
4824
|
+
"aria-label": `${data[i].label}: ${v}`
|
|
4825
|
+
}, `dot-${i}`);
|
|
4826
|
+
}),
|
|
4827
|
+
data.map((d, i) => /* @__PURE__ */ jsx("text", {
|
|
4828
|
+
x: cx(i),
|
|
4829
|
+
y: height - 4,
|
|
4830
|
+
textAnchor: "middle",
|
|
4831
|
+
fontSize: 9,
|
|
4832
|
+
fill: "#94a3b8",
|
|
4833
|
+
"aria-hidden": "true",
|
|
4834
|
+
children: d.label
|
|
4835
|
+
}, `x-${i}`)),
|
|
4836
|
+
annotations.map((ann) => {
|
|
4837
|
+
const v = Number(data[ann.dataIndex]?.[primary.dataKey] ?? 0);
|
|
4838
|
+
const x = cx(ann.dataIndex);
|
|
4839
|
+
const y = cy(v);
|
|
4840
|
+
const r = ann.radius ?? 4;
|
|
4841
|
+
const col = ann.color ?? primary.color;
|
|
4842
|
+
const ly = ann.labelPosition === "below" ? y + r + 10 : Math.max(22, y - r - 5);
|
|
4843
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
4844
|
+
"aria-label": `${data[ann.dataIndex].label}: ${ann.label}`,
|
|
4845
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
4846
|
+
cx: x,
|
|
4847
|
+
cy: y,
|
|
4848
|
+
r,
|
|
4849
|
+
fill: col,
|
|
4850
|
+
stroke: "white",
|
|
4851
|
+
strokeWidth: 2
|
|
4852
|
+
}), /* @__PURE__ */ jsx("text", {
|
|
4853
|
+
x,
|
|
4854
|
+
y: ly,
|
|
4855
|
+
textAnchor: "middle",
|
|
4856
|
+
fontSize: 8,
|
|
4857
|
+
fill: col,
|
|
4858
|
+
fontWeight: "bold",
|
|
4859
|
+
children: ann.label
|
|
4860
|
+
})]
|
|
4861
|
+
}, `ann-${ann.dataIndex}`);
|
|
4862
|
+
})
|
|
4863
|
+
]
|
|
4864
|
+
});
|
|
4865
|
+
}
|
|
4866
|
+
//#endregion
|
|
4867
|
+
//#region src/ui-library/gallery/charts/BarList.tsx
|
|
4868
|
+
function BarList({ items, valueFormat, totalLabel, barHeight = "h-2", staggerDelay = 70, className = "" }) {
|
|
4869
|
+
const maxValue = Math.max(...items.map((item) => item.value), 1);
|
|
4870
|
+
const total = items.reduce((sum, item) => sum + item.value, 0);
|
|
4871
|
+
const fmt = valueFormat ?? ((v) => String(v));
|
|
4872
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
4873
|
+
role: "list",
|
|
4874
|
+
"aria-label": "Bar list",
|
|
4875
|
+
className: `space-y-3 pt-1 ${className}`,
|
|
4876
|
+
children: [items.map((item, i) => {
|
|
4877
|
+
const pct = item.value / maxValue * 100;
|
|
4878
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
4879
|
+
role: "listitem",
|
|
4880
|
+
"aria-label": `${item.label}: ${fmt(item.value)}`,
|
|
4881
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
4882
|
+
className: "flex justify-between items-baseline mb-1",
|
|
4883
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
4884
|
+
className: "text-xs font-bold text-slate-700",
|
|
4885
|
+
children: item.label
|
|
4886
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
4887
|
+
className: "text-xs text-slate-400 font-medium",
|
|
4888
|
+
children: fmt(item.value)
|
|
4889
|
+
})]
|
|
4890
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
4891
|
+
className: `${barHeight} w-full bg-slate-100/60 rounded-full overflow-hidden`,
|
|
4892
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
4893
|
+
className: `${barHeight} rounded-full os-bar-in`,
|
|
4894
|
+
style: {
|
|
4895
|
+
width: `${pct}%`,
|
|
4896
|
+
backgroundColor: item.color,
|
|
4897
|
+
animationDelay: `${i * staggerDelay}ms`
|
|
4898
|
+
},
|
|
4899
|
+
"aria-hidden": "true"
|
|
4900
|
+
})
|
|
4901
|
+
})]
|
|
4902
|
+
}, item.label);
|
|
4903
|
+
}), totalLabel !== void 0 && /* @__PURE__ */ jsxs("div", {
|
|
4904
|
+
className: "pt-2 border-t border-slate-50 flex justify-between items-center",
|
|
4905
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
4906
|
+
className: "text-[10px] font-bold text-slate-400 uppercase tracking-widest",
|
|
4907
|
+
children: totalLabel
|
|
4908
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
4909
|
+
className: "text-sm font-bold text-slate-700",
|
|
4910
|
+
children: total
|
|
4911
|
+
})]
|
|
4912
|
+
})]
|
|
4913
|
+
});
|
|
4914
|
+
}
|
|
4915
|
+
//#endregion
|
|
4442
4916
|
//#region src/ui-library/gallery/heatmap/Heatmap.tsx
|
|
4443
4917
|
/**
|
|
4444
4918
|
* Heatmap — Design System Component
|
|
@@ -4457,31 +4931,31 @@ function LineChart({ data, height = 120, lineColor = "#6366f1", filled = true, "
|
|
|
4457
4931
|
var SCALES = {
|
|
4458
4932
|
blue: { cells: [
|
|
4459
4933
|
"bg-slate-100",
|
|
4460
|
-
"bg-
|
|
4461
|
-
"bg-
|
|
4462
|
-
"bg-
|
|
4463
|
-
"bg-
|
|
4934
|
+
"bg-sky-200",
|
|
4935
|
+
"bg-sky-400",
|
|
4936
|
+
"bg-blue-600",
|
|
4937
|
+
"bg-[#00377B]"
|
|
4464
4938
|
] },
|
|
4465
4939
|
navy: { cells: [
|
|
4466
4940
|
"bg-slate-100",
|
|
4467
|
-
"bg-
|
|
4468
|
-
"bg-
|
|
4469
|
-
"bg-
|
|
4470
|
-
"bg-
|
|
4941
|
+
"bg-slate-300",
|
|
4942
|
+
"bg-slate-500",
|
|
4943
|
+
"bg-slate-700",
|
|
4944
|
+
"bg-slate-900"
|
|
4471
4945
|
] },
|
|
4472
4946
|
teal: { cells: [
|
|
4473
4947
|
"bg-slate-100",
|
|
4474
|
-
"bg-cyan-
|
|
4475
|
-
"bg-cyan-
|
|
4476
|
-
"bg-cyan-
|
|
4477
|
-
"bg-cyan-
|
|
4948
|
+
"bg-cyan-200",
|
|
4949
|
+
"bg-cyan-400",
|
|
4950
|
+
"bg-cyan-600",
|
|
4951
|
+
"bg-cyan-800"
|
|
4478
4952
|
] },
|
|
4479
4953
|
orange: { cells: [
|
|
4480
4954
|
"bg-slate-100",
|
|
4481
|
-
"bg-orange-
|
|
4482
|
-
"bg-orange-300",
|
|
4955
|
+
"bg-orange-200",
|
|
4483
4956
|
"bg-orange-400",
|
|
4484
|
-
"bg-orange-
|
|
4957
|
+
"bg-orange-500",
|
|
4958
|
+
"bg-orange-700"
|
|
4485
4959
|
] }
|
|
4486
4960
|
};
|
|
4487
4961
|
var MONTHS = [
|
|
@@ -4622,6 +5096,2250 @@ function Heatmap({ data, scale = "blue", showLegend = true, showMonthLabels = tr
|
|
|
4622
5096
|
});
|
|
4623
5097
|
}
|
|
4624
5098
|
//#endregion
|
|
5099
|
+
//#region src/ui-library/gallery/org-chart/OrgChart.tsx
|
|
5100
|
+
/**
|
|
5101
|
+
* OrgChart — Design System Component
|
|
5102
|
+
*
|
|
5103
|
+
* A D3-powered SVG organization chart matching the UHRIS Company Structure
|
|
5104
|
+
* diagram mode. Renders a top-down tree with rectangular nodes and
|
|
5105
|
+
* stepped orthogonal connectors.
|
|
5106
|
+
*
|
|
5107
|
+
* Technology: D3 v7 (d3.hierarchy + d3.tree layout + d3.zoom)
|
|
5108
|
+
* Already a production dependency — no new packages introduced.
|
|
5109
|
+
*
|
|
5110
|
+
* Visual design (sourced from CompanyStructurePage diagram mode):
|
|
5111
|
+
* Nodes:
|
|
5112
|
+
* - 250 × 84 px rounded rectangles (rx=14)
|
|
5113
|
+
* - Root (depth 0): dark navy fill (#0f172a), white text
|
|
5114
|
+
* - Children: white fill (#fff), slate border (#e2e8f0)
|
|
5115
|
+
* - drop-shadow: 0 6px 12px rgba(15,23,42,0.08)
|
|
5116
|
+
* - Name: 13px, font-weight 800, centered
|
|
5117
|
+
* - Description: 11px, font-weight 600, #64748b / #cbd5e1 (root)
|
|
5118
|
+
* - Selected: indigo border overlay ring
|
|
5119
|
+
* Connectors:
|
|
5120
|
+
* - Stepped orthogonal path: M→V→H→V
|
|
5121
|
+
* - Stroke: #cbd5e1, stroke-width 1.5
|
|
5122
|
+
* Canvas:
|
|
5123
|
+
* - Viewport sized to container; fit-to-view on render
|
|
5124
|
+
* - Zoom: scaleExtent [0.05, 1.8]
|
|
5125
|
+
* - Pan: mouse/touch drag
|
|
5126
|
+
* - Layout: nodeSize [280, 185] — horizontal × vertical spacing
|
|
5127
|
+
* Controls:
|
|
5128
|
+
* - ZoomIn, Reset, ZoomOut buttons (top-right overlay panel)
|
|
5129
|
+
*
|
|
5130
|
+
* Accessibility:
|
|
5131
|
+
* - SVG has role="img" + aria-label
|
|
5132
|
+
* - Zoom controls have aria-label
|
|
5133
|
+
* - Keyboard: Tab to control buttons; diagram itself is navigated visually
|
|
5134
|
+
* - Note: full ARIA tree semantics are not possible in an SVG diagram;
|
|
5135
|
+
* use OrgUnitTree for a fully keyboard-accessible list-based alternative
|
|
5136
|
+
*
|
|
5137
|
+
* Usage:
|
|
5138
|
+
* <OrgChart
|
|
5139
|
+
* nodes={orgNodes}
|
|
5140
|
+
* selectedId={selectedId}
|
|
5141
|
+
* onSelect={setSelectedId}
|
|
5142
|
+
* aria-label="Company organization chart"
|
|
5143
|
+
* />
|
|
5144
|
+
*/
|
|
5145
|
+
function buildD3Tree(nodes) {
|
|
5146
|
+
function convert(node, depth) {
|
|
5147
|
+
return {
|
|
5148
|
+
id: node.id,
|
|
5149
|
+
name: node.label,
|
|
5150
|
+
description: node.description ?? "",
|
|
5151
|
+
isRoot: depth === 0,
|
|
5152
|
+
isSyntheticRoot: false,
|
|
5153
|
+
originalId: node.id,
|
|
5154
|
+
children: node.children?.map((c) => convert(c, depth + 1))
|
|
5155
|
+
};
|
|
5156
|
+
}
|
|
5157
|
+
if (nodes.length === 1) return convert(nodes[0], 0);
|
|
5158
|
+
return {
|
|
5159
|
+
id: "__synthetic_root__",
|
|
5160
|
+
name: "",
|
|
5161
|
+
description: "",
|
|
5162
|
+
isRoot: true,
|
|
5163
|
+
isSyntheticRoot: true,
|
|
5164
|
+
originalId: "__synthetic_root__",
|
|
5165
|
+
children: nodes.map((n) => convert(n, 0))
|
|
5166
|
+
};
|
|
5167
|
+
}
|
|
5168
|
+
function OrgChart({ nodes, selectedId, onSelect, height = "75vh", "aria-label": ariaLabel = "Organization chart", className = "" }) {
|
|
5169
|
+
const svgRef = useRef(null);
|
|
5170
|
+
const zoomRef = useRef(null);
|
|
5171
|
+
const initialTransformRef = useRef(null);
|
|
5172
|
+
const treeBoundsRef = useRef(null);
|
|
5173
|
+
const uid = useId().replace(/:/g, "");
|
|
5174
|
+
const fitToView = () => {
|
|
5175
|
+
if (!svgRef.current || !zoomRef.current || !treeBoundsRef.current) return;
|
|
5176
|
+
const { width: W, height: H } = svgRef.current.getBoundingClientRect();
|
|
5177
|
+
if (W === 0 || H === 0) return;
|
|
5178
|
+
const { minX, maxX, minY, maxY } = treeBoundsRef.current;
|
|
5179
|
+
const contentLeft = minX - 125;
|
|
5180
|
+
const contentRight = maxX + 125;
|
|
5181
|
+
const contentTop = minY - 42;
|
|
5182
|
+
const contentBottom = maxY + 42;
|
|
5183
|
+
const contentWidth = contentRight - contentLeft;
|
|
5184
|
+
const contentHeight = contentBottom - contentTop;
|
|
5185
|
+
const scaleX = (W - 80) / Math.max(1, contentWidth);
|
|
5186
|
+
const scaleY = (H - 80) / Math.max(1, contentHeight);
|
|
5187
|
+
const scale = Math.max(.05, Math.min(1.8, scaleX, scaleY));
|
|
5188
|
+
const contentCenterX = (contentLeft + contentRight) / 2;
|
|
5189
|
+
const contentCenterY = (contentTop + contentBottom) / 2;
|
|
5190
|
+
const tx = W / 2 - contentCenterX * scale;
|
|
5191
|
+
const ty = H / 2 - contentCenterY * scale;
|
|
5192
|
+
const t = d3.zoomIdentity.translate(tx, ty).scale(scale);
|
|
5193
|
+
initialTransformRef.current = t;
|
|
5194
|
+
d3.select(svgRef.current).call(zoomRef.current.transform, t);
|
|
5195
|
+
};
|
|
5196
|
+
useEffect(() => {
|
|
5197
|
+
if (!svgRef.current || nodes.length === 0) return;
|
|
5198
|
+
const svg = d3.select(svgRef.current);
|
|
5199
|
+
svg.selectAll("*").remove();
|
|
5200
|
+
const treeData = buildD3Tree(nodes);
|
|
5201
|
+
const root = d3.hierarchy(treeData);
|
|
5202
|
+
d3.tree().nodeSize([280, 185])(root);
|
|
5203
|
+
const descendants = root.descendants();
|
|
5204
|
+
treeBoundsRef.current = {
|
|
5205
|
+
minX: d3.min(descendants, (d) => d.x) ?? 0,
|
|
5206
|
+
maxX: d3.max(descendants, (d) => d.x) ?? 0,
|
|
5207
|
+
minY: d3.min(descendants, (d) => d.y) ?? 0,
|
|
5208
|
+
maxY: d3.max(descendants, (d) => d.y) ?? 0
|
|
5209
|
+
};
|
|
5210
|
+
const g = svg.append("g");
|
|
5211
|
+
const zoom = d3.zoom().scaleExtent([.05, 1.8]).on("zoom", (e) => g.attr("transform", e.transform.toString()));
|
|
5212
|
+
zoomRef.current = zoom;
|
|
5213
|
+
svg.call(zoom);
|
|
5214
|
+
g.selectAll("path").data(root.links().filter((l) => !l.source.data.isSyntheticRoot)).join("path").attr("fill", "none").attr("stroke", "#cbd5e1").attr("stroke-width", 1.5).attr("d", (link) => {
|
|
5215
|
+
const sx = link.source.x ?? 0;
|
|
5216
|
+
const sy = link.source.y ?? 0;
|
|
5217
|
+
const tx = link.target.x ?? 0;
|
|
5218
|
+
const ty = link.target.y ?? 0;
|
|
5219
|
+
return `M${sx},${sy}V${(sy + ty) / 2}H${tx}V${ty}`;
|
|
5220
|
+
});
|
|
5221
|
+
const node = g.selectAll("g.node").data(root.descendants().filter((d) => !d.data.isSyntheticRoot)).join("g").attr("class", "node").attr("transform", (d) => `translate(${d.x},${d.y})`).style("cursor", (d) => d.data.originalId !== "__synthetic_root__" ? "pointer" : "default").on("click", (_e, d) => {
|
|
5222
|
+
if (d.data.isSyntheticRoot) return;
|
|
5223
|
+
onSelect?.(d.data.originalId);
|
|
5224
|
+
});
|
|
5225
|
+
node.append("rect").attr("x", -125).attr("y", -42).attr("width", 250).attr("height", 84).attr("rx", 14).attr("fill", (d) => d.data.isRoot ? "#0f172a" : "#fff").attr("stroke", (d) => {
|
|
5226
|
+
if (selectedId && d.data.originalId === selectedId) return "#6366f1";
|
|
5227
|
+
return d.data.isRoot ? "#0f172a" : "#e2e8f0";
|
|
5228
|
+
}).attr("stroke-width", (d) => selectedId && d.data.originalId === selectedId ? 2.5 : 1).attr("filter", "drop-shadow(0 6px 12px rgba(15,23,42,0.08))");
|
|
5229
|
+
node.append("text").attr("text-anchor", "middle").attr("y", -8).attr("font-size", 13).attr("font-weight", 800).attr("fill", (d) => d.data.isRoot ? "#fff" : "#0f172a").text((d) => d.data.name);
|
|
5230
|
+
node.append("text").attr("text-anchor", "middle").attr("y", 16).attr("font-size", 11).attr("font-weight", 600).attr("fill", (d) => d.data.isRoot ? "#cbd5e1" : "#64748b").text((d) => d.data.description);
|
|
5231
|
+
if (selectedId) node.filter((d) => d.data.originalId === selectedId).append("rect").attr("x", -128).attr("y", -45).attr("width", 256).attr("height", 90).attr("rx", 16).attr("fill", "none").attr("stroke", "#6366f1").attr("stroke-width", 2.5).attr("opacity", .6);
|
|
5232
|
+
requestAnimationFrame(() => {
|
|
5233
|
+
fitToView();
|
|
5234
|
+
});
|
|
5235
|
+
}, [
|
|
5236
|
+
nodes,
|
|
5237
|
+
selectedId,
|
|
5238
|
+
onSelect
|
|
5239
|
+
]);
|
|
5240
|
+
useEffect(() => {
|
|
5241
|
+
const el = svgRef.current;
|
|
5242
|
+
if (!el) return;
|
|
5243
|
+
const ro = new ResizeObserver(() => {
|
|
5244
|
+
fitToView();
|
|
5245
|
+
});
|
|
5246
|
+
ro.observe(el);
|
|
5247
|
+
return () => ro.disconnect();
|
|
5248
|
+
}, []);
|
|
5249
|
+
const zoomBy = (factor) => {
|
|
5250
|
+
if (!svgRef.current || !zoomRef.current) return;
|
|
5251
|
+
d3.select(svgRef.current).transition().duration(250).call(zoomRef.current.scaleBy, factor);
|
|
5252
|
+
};
|
|
5253
|
+
const resetZoom = () => {
|
|
5254
|
+
fitToView();
|
|
5255
|
+
};
|
|
5256
|
+
const controlBtnClass = [
|
|
5257
|
+
"appearance-none border-0 bg-none font-[inherit]",
|
|
5258
|
+
"flex items-center justify-center rounded-lg p-2",
|
|
5259
|
+
"text-slate-400 transition hover:bg-slate-100 hover:text-slate-700",
|
|
5260
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-blue/30"
|
|
5261
|
+
].join(" ");
|
|
5262
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
5263
|
+
className: `relative w-full overflow-hidden bg-slate-50/50 ${className}`,
|
|
5264
|
+
style: { height },
|
|
5265
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
5266
|
+
className: "absolute right-4 top-4 z-10 flex flex-col gap-2 rounded-lg border border-slate-100 bg-white p-2 shadow-md",
|
|
5267
|
+
children: [
|
|
5268
|
+
/* @__PURE__ */ jsx("button", {
|
|
5269
|
+
type: "button",
|
|
5270
|
+
className: controlBtnClass,
|
|
5271
|
+
onClick: () => zoomBy(1.2),
|
|
5272
|
+
"aria-label": "Zoom in",
|
|
5273
|
+
children: /* @__PURE__ */ jsx(ZoomIn, {
|
|
5274
|
+
size: 16,
|
|
5275
|
+
"aria-hidden": "true"
|
|
5276
|
+
})
|
|
5277
|
+
}),
|
|
5278
|
+
/* @__PURE__ */ jsx("button", {
|
|
5279
|
+
type: "button",
|
|
5280
|
+
className: controlBtnClass,
|
|
5281
|
+
onClick: resetZoom,
|
|
5282
|
+
"aria-label": "Reset zoom",
|
|
5283
|
+
children: /* @__PURE__ */ jsx(RotateCcw, {
|
|
5284
|
+
size: 16,
|
|
5285
|
+
"aria-hidden": "true"
|
|
5286
|
+
})
|
|
5287
|
+
}),
|
|
5288
|
+
/* @__PURE__ */ jsx("button", {
|
|
5289
|
+
type: "button",
|
|
5290
|
+
className: controlBtnClass,
|
|
5291
|
+
onClick: () => zoomBy(.8),
|
|
5292
|
+
"aria-label": "Zoom out",
|
|
5293
|
+
children: /* @__PURE__ */ jsx(ZoomOut, {
|
|
5294
|
+
size: 16,
|
|
5295
|
+
"aria-hidden": "true"
|
|
5296
|
+
})
|
|
5297
|
+
})
|
|
5298
|
+
]
|
|
5299
|
+
}), /* @__PURE__ */ jsx("svg", {
|
|
5300
|
+
ref: svgRef,
|
|
5301
|
+
id: uid,
|
|
5302
|
+
width: "100%",
|
|
5303
|
+
height: "100%",
|
|
5304
|
+
className: "block touch-none",
|
|
5305
|
+
role: "img",
|
|
5306
|
+
"aria-label": ariaLabel
|
|
5307
|
+
})]
|
|
5308
|
+
});
|
|
5309
|
+
}
|
|
5310
|
+
//#endregion
|
|
5311
|
+
//#region src/ui-library/gallery/org-unit-tree/OrgUnitTree.tsx
|
|
5312
|
+
/**
|
|
5313
|
+
* OrgUnitTree — Design System Component
|
|
5314
|
+
*
|
|
5315
|
+
* A card-based hierarchical organization tree matching the UHRIS
|
|
5316
|
+
* Company Structure list-mode visual design. Purely presentational —
|
|
5317
|
+
* no API calls, no domain logic, no permissions.
|
|
5318
|
+
*
|
|
5319
|
+
* Visual design (sourced from CompanyStructurePage StructureDesigner):
|
|
5320
|
+
* - Root node: dark navy (bg-slate-900) card with light text
|
|
5321
|
+
* - Child nodes: white bordered cards with blue hover accent
|
|
5322
|
+
* - Connector: left border (border-l border-slate-200) + indentation
|
|
5323
|
+
* - Icon badge: rounded-xl colored square containing the icon
|
|
5324
|
+
* - Actions: hover-reveal slot (opacity-0 → group-hover:opacity-100)
|
|
5325
|
+
* - Meta: right-aligned, hidden on narrow screens
|
|
5326
|
+
*
|
|
5327
|
+
* Accessibility (WAI-ARIA Tree pattern, RFC 1.2):
|
|
5328
|
+
* - role="tree" on root list
|
|
5329
|
+
* - role="treeitem" + aria-expanded + aria-selected + aria-level + aria-disabled
|
|
5330
|
+
* - role="group" on nested lists
|
|
5331
|
+
* - Keyboard: ArrowDown/Up/Left/Right/Home/End/Enter/Space
|
|
5332
|
+
* - Roving tabIndex: only focused item has tabIndex=0
|
|
5333
|
+
*
|
|
5334
|
+
* Usage:
|
|
5335
|
+
* <OrgUnitTree
|
|
5336
|
+
* nodes={orgNodes}
|
|
5337
|
+
* onSelect={(id) => navigate(`/org/${id}`)}
|
|
5338
|
+
* aria-label="Company structure"
|
|
5339
|
+
* />
|
|
5340
|
+
*/
|
|
5341
|
+
function flattenVisible(nodes, expanded) {
|
|
5342
|
+
const result = [];
|
|
5343
|
+
for (const node of nodes) {
|
|
5344
|
+
result.push(node);
|
|
5345
|
+
if (node.children?.length && expanded.has(node.id)) result.push(...flattenVisible(node.children, expanded));
|
|
5346
|
+
}
|
|
5347
|
+
return result;
|
|
5348
|
+
}
|
|
5349
|
+
function findParentId(nodes, targetId) {
|
|
5350
|
+
for (const node of nodes) {
|
|
5351
|
+
if (node.children?.some((c) => c.id === targetId)) return node.id;
|
|
5352
|
+
if (node.children) {
|
|
5353
|
+
const found = findParentId(node.children, targetId);
|
|
5354
|
+
if (found !== null) return found;
|
|
5355
|
+
}
|
|
5356
|
+
}
|
|
5357
|
+
return null;
|
|
5358
|
+
}
|
|
5359
|
+
function OrgUnitTree({ nodes, selectedId, onSelect, defaultExpandedIds, expandedIds: controlledExpandedIds, onExpandedChange, "aria-label": ariaLabel, className = "" }) {
|
|
5360
|
+
const baseId = useId().replace(/:/g, "");
|
|
5361
|
+
const treeRef = useRef(null);
|
|
5362
|
+
const [internalExpanded, setInternalExpanded] = useState(() => {
|
|
5363
|
+
if (defaultExpandedIds) return new Set(defaultExpandedIds);
|
|
5364
|
+
return new Set(nodes.map((n) => n.id));
|
|
5365
|
+
});
|
|
5366
|
+
const expanded = controlledExpandedIds ? new Set(controlledExpandedIds) : internalExpanded;
|
|
5367
|
+
const setExpanded = useCallback((next) => {
|
|
5368
|
+
if (!controlledExpandedIds) setInternalExpanded(next);
|
|
5369
|
+
onExpandedChange?.(Array.from(next));
|
|
5370
|
+
}, [controlledExpandedIds, onExpandedChange]);
|
|
5371
|
+
const [focusedId, setFocusedId] = useState(() => {
|
|
5372
|
+
return flattenVisible(nodes, new Set(nodes.map((n) => n.id))).find((n) => !n.disabled)?.id ?? null;
|
|
5373
|
+
});
|
|
5374
|
+
const toggleExpand = useCallback((id) => {
|
|
5375
|
+
const next = new Set(expanded);
|
|
5376
|
+
if (next.has(id)) next.delete(id);
|
|
5377
|
+
else next.add(id);
|
|
5378
|
+
setExpanded(next);
|
|
5379
|
+
}, [expanded, setExpanded]);
|
|
5380
|
+
const handleSelect = useCallback((id) => {
|
|
5381
|
+
setFocusedId(id);
|
|
5382
|
+
onSelect?.(id);
|
|
5383
|
+
}, [onSelect]);
|
|
5384
|
+
const handleKeyDown = (e) => {
|
|
5385
|
+
const visible = flattenVisible(nodes, expanded).filter((n) => !n.disabled);
|
|
5386
|
+
if (visible.length === 0) return;
|
|
5387
|
+
const focusEl = (id) => {
|
|
5388
|
+
setFocusedId(id);
|
|
5389
|
+
document.getElementById(`${baseId}-${id}`)?.focus();
|
|
5390
|
+
};
|
|
5391
|
+
const currentIdx = focusedId ? visible.findIndex((n) => n.id === focusedId) : -1;
|
|
5392
|
+
const current = focusedId ? visible.find((n) => n.id === focusedId) : null;
|
|
5393
|
+
switch (e.key) {
|
|
5394
|
+
case "ArrowDown": {
|
|
5395
|
+
e.preventDefault();
|
|
5396
|
+
const next = visible[currentIdx + 1];
|
|
5397
|
+
if (next) focusEl(next.id);
|
|
5398
|
+
break;
|
|
5399
|
+
}
|
|
5400
|
+
case "ArrowUp": {
|
|
5401
|
+
e.preventDefault();
|
|
5402
|
+
const prev = visible[currentIdx - 1];
|
|
5403
|
+
if (prev) focusEl(prev.id);
|
|
5404
|
+
break;
|
|
5405
|
+
}
|
|
5406
|
+
case "ArrowRight":
|
|
5407
|
+
e.preventDefault();
|
|
5408
|
+
if (!current) break;
|
|
5409
|
+
if (current.children?.length && !expanded.has(current.id)) {
|
|
5410
|
+
const next = new Set(expanded);
|
|
5411
|
+
next.add(current.id);
|
|
5412
|
+
setExpanded(next);
|
|
5413
|
+
} else if (current.children?.length && expanded.has(current.id)) {
|
|
5414
|
+
const firstChild = visible.find((n, i) => i > currentIdx && n.id === current.children[0]?.id);
|
|
5415
|
+
if (firstChild) focusEl(firstChild.id);
|
|
5416
|
+
}
|
|
5417
|
+
break;
|
|
5418
|
+
case "ArrowLeft":
|
|
5419
|
+
e.preventDefault();
|
|
5420
|
+
if (!current) break;
|
|
5421
|
+
if (current.children?.length && expanded.has(current.id)) {
|
|
5422
|
+
const next = new Set(expanded);
|
|
5423
|
+
next.delete(current.id);
|
|
5424
|
+
setExpanded(next);
|
|
5425
|
+
} else {
|
|
5426
|
+
const parentId = findParentId(nodes, current.id);
|
|
5427
|
+
if (parentId) focusEl(parentId);
|
|
5428
|
+
}
|
|
5429
|
+
break;
|
|
5430
|
+
case "Home":
|
|
5431
|
+
e.preventDefault();
|
|
5432
|
+
if (visible[0]) focusEl(visible[0].id);
|
|
5433
|
+
break;
|
|
5434
|
+
case "End": {
|
|
5435
|
+
e.preventDefault();
|
|
5436
|
+
const last = visible[visible.length - 1];
|
|
5437
|
+
if (last) focusEl(last.id);
|
|
5438
|
+
break;
|
|
5439
|
+
}
|
|
5440
|
+
case "Enter":
|
|
5441
|
+
case " ":
|
|
5442
|
+
e.preventDefault();
|
|
5443
|
+
if (current) {
|
|
5444
|
+
handleSelect(current.id);
|
|
5445
|
+
if (current.children?.length) toggleExpand(current.id);
|
|
5446
|
+
}
|
|
5447
|
+
}
|
|
5448
|
+
};
|
|
5449
|
+
const nodeRefs = useRef(/* @__PURE__ */ new Map());
|
|
5450
|
+
function renderNodes(branch, depth) {
|
|
5451
|
+
return branch.map((node) => {
|
|
5452
|
+
const isExpanded = expanded.has(node.id);
|
|
5453
|
+
const isRoot = depth === 1;
|
|
5454
|
+
const hasChildren = Boolean(node.children?.length);
|
|
5455
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
5456
|
+
ref: (el) => {
|
|
5457
|
+
if (el) nodeRefs.current.set(node.id, el);
|
|
5458
|
+
else nodeRefs.current.delete(node.id);
|
|
5459
|
+
},
|
|
5460
|
+
id: `${baseId}-${node.id}`,
|
|
5461
|
+
role: "treeitem",
|
|
5462
|
+
"aria-expanded": hasChildren ? isExpanded : void 0,
|
|
5463
|
+
"aria-selected": selectedId === node.id,
|
|
5464
|
+
"aria-disabled": node.disabled || void 0,
|
|
5465
|
+
"aria-level": depth,
|
|
5466
|
+
tabIndex: focusedId === node.id ? 0 : -1,
|
|
5467
|
+
onFocus: () => setFocusedId(node.id),
|
|
5468
|
+
className: "outline-none",
|
|
5469
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
5470
|
+
className: ["group mb-2 flex items-center gap-3 rounded-xl border px-3 py-3 transition select-none", isRoot ? "border-slate-900 bg-slate-900 text-slate-300 shadow-md" : selectedId === node.id ? "border-brand-blue/40 bg-blue-50 shadow-sm" : node.disabled ? "border-slate-100 bg-slate-50 opacity-50 cursor-not-allowed" : "border-slate-200 bg-white hover:border-blue-300 hover:shadow-sm cursor-pointer"].filter(Boolean).join(" "),
|
|
5471
|
+
onClick: () => {
|
|
5472
|
+
if (node.disabled) return;
|
|
5473
|
+
if (hasChildren) toggleExpand(node.id);
|
|
5474
|
+
handleSelect(node.id);
|
|
5475
|
+
},
|
|
5476
|
+
children: [
|
|
5477
|
+
/* @__PURE__ */ jsx("button", {
|
|
5478
|
+
type: "button",
|
|
5479
|
+
"aria-label": isExpanded ? `Collapse ${node.label}` : `Expand ${node.label}`,
|
|
5480
|
+
tabIndex: -1,
|
|
5481
|
+
disabled: !hasChildren,
|
|
5482
|
+
onClick: (e) => {
|
|
5483
|
+
e.stopPropagation();
|
|
5484
|
+
if (hasChildren) toggleExpand(node.id);
|
|
5485
|
+
},
|
|
5486
|
+
className: [
|
|
5487
|
+
"flex items-center justify-center rounded p-1 shrink-0 transition",
|
|
5488
|
+
!hasChildren && "invisible",
|
|
5489
|
+
isRoot ? "hover:bg-slate-700" : "hover:bg-slate-100"
|
|
5490
|
+
].filter(Boolean).join(" "),
|
|
5491
|
+
children: isExpanded ? /* @__PURE__ */ jsx(ChevronDown, {
|
|
5492
|
+
size: 16,
|
|
5493
|
+
"aria-hidden": "true"
|
|
5494
|
+
}) : /* @__PURE__ */ jsx(ChevronRight, {
|
|
5495
|
+
size: 16,
|
|
5496
|
+
"aria-hidden": "true"
|
|
5497
|
+
})
|
|
5498
|
+
}),
|
|
5499
|
+
node.icon && /* @__PURE__ */ jsx("div", {
|
|
5500
|
+
className: isRoot ? "flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-slate-800 text-slate-200" : "flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-blue-50 text-blue-600",
|
|
5501
|
+
"aria-hidden": "true",
|
|
5502
|
+
children: node.icon
|
|
5503
|
+
}),
|
|
5504
|
+
/* @__PURE__ */ jsxs("div", {
|
|
5505
|
+
className: "min-w-0 flex-1",
|
|
5506
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
5507
|
+
className: ["flex flex-wrap items-center gap-2 text-sm font-bold", isRoot ? "text-white" : selectedId === node.id ? "text-brand-blue" : "text-slate-900"].filter(Boolean).join(" "),
|
|
5508
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
5509
|
+
className: "truncate",
|
|
5510
|
+
children: node.label
|
|
5511
|
+
}), node.badge && /* @__PURE__ */ jsx("span", { children: node.badge })]
|
|
5512
|
+
}), node.description && /* @__PURE__ */ jsx("div", {
|
|
5513
|
+
className: `mt-0.5 truncate text-xs font-medium ${isRoot ? "text-slate-400" : "text-slate-500"}`,
|
|
5514
|
+
children: node.description
|
|
5515
|
+
})]
|
|
5516
|
+
}),
|
|
5517
|
+
node.meta && /* @__PURE__ */ jsx("div", {
|
|
5518
|
+
className: `hidden md:flex items-center gap-3 text-xs ${isRoot ? "text-slate-300" : "text-slate-500"}`,
|
|
5519
|
+
children: node.meta
|
|
5520
|
+
}),
|
|
5521
|
+
node.actions && /* @__PURE__ */ jsx("div", {
|
|
5522
|
+
className: "flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
|
|
5523
|
+
onClick: (e) => e.stopPropagation(),
|
|
5524
|
+
children: node.actions
|
|
5525
|
+
})
|
|
5526
|
+
]
|
|
5527
|
+
}), hasChildren && isExpanded && /* @__PURE__ */ jsx("ul", {
|
|
5528
|
+
role: "group",
|
|
5529
|
+
className: "ml-6 border-l border-slate-200 pl-4",
|
|
5530
|
+
children: renderNodes(node.children, depth + 1)
|
|
5531
|
+
})]
|
|
5532
|
+
}, node.id);
|
|
5533
|
+
});
|
|
5534
|
+
}
|
|
5535
|
+
if (nodes.length === 0) return null;
|
|
5536
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
5537
|
+
ref: treeRef,
|
|
5538
|
+
role: "tree",
|
|
5539
|
+
"aria-label": ariaLabel,
|
|
5540
|
+
onKeyDown: handleKeyDown,
|
|
5541
|
+
className: `w-full outline-none ${className}`,
|
|
5542
|
+
children: renderNodes(nodes, 1)
|
|
5543
|
+
});
|
|
5544
|
+
}
|
|
5545
|
+
//#endregion
|
|
5546
|
+
//#region src/ui-library/gallery/template-samples/templates/PafTemplate.tsx
|
|
5547
|
+
var fmt = new Intl.DateTimeFormat("en-US", {
|
|
5548
|
+
month: "short",
|
|
5549
|
+
day: "2-digit",
|
|
5550
|
+
year: "numeric"
|
|
5551
|
+
});
|
|
5552
|
+
var fmtDate = (v) => {
|
|
5553
|
+
if (!v?.trim()) return "";
|
|
5554
|
+
const n = /^\d{4}-\d{2}-\d{2}$/.test(v.trim()) ? `${v.trim()}T00:00:00` : v.trim();
|
|
5555
|
+
const d = new Date(n);
|
|
5556
|
+
return isNaN(d.getTime()) ? v : fmt.format(d);
|
|
5557
|
+
};
|
|
5558
|
+
var STANDARD_LABELS = [
|
|
5559
|
+
"Basic Salary",
|
|
5560
|
+
"Cola",
|
|
5561
|
+
"Trasa",
|
|
5562
|
+
"Trarep",
|
|
5563
|
+
"Communication",
|
|
5564
|
+
"Car",
|
|
5565
|
+
"Motor",
|
|
5566
|
+
"Others"
|
|
5567
|
+
];
|
|
5568
|
+
function PafTemplate({ data }) {
|
|
5569
|
+
const allComponents = STANDARD_LABELS.map((label) => {
|
|
5570
|
+
const found = data.salaryComponents?.find((c) => c.label.toLowerCase() === label.toLowerCase());
|
|
5571
|
+
if (found) return found;
|
|
5572
|
+
if (label === "Basic Salary") return {
|
|
5573
|
+
label,
|
|
5574
|
+
from: data.from.basicSalary,
|
|
5575
|
+
to: data.to.basicSalary
|
|
5576
|
+
};
|
|
5577
|
+
return {
|
|
5578
|
+
label,
|
|
5579
|
+
from: "",
|
|
5580
|
+
to: ""
|
|
5581
|
+
};
|
|
5582
|
+
});
|
|
5583
|
+
const shownComponents = allComponents.filter((c) => {
|
|
5584
|
+
if (c.label === "Basic Salary") return true;
|
|
5585
|
+
const hasFrom = c.from && parseFloat(c.from.replace(/,/g, "")) !== 0;
|
|
5586
|
+
const hasTo = c.to && parseFloat(c.to.replace(/,/g, "")) !== 0;
|
|
5587
|
+
return hasFrom || hasTo;
|
|
5588
|
+
});
|
|
5589
|
+
const paddingRows = Array.from({ length: Math.max(0, 7 - shownComponents.length) });
|
|
5590
|
+
const calcTotal = (type) => {
|
|
5591
|
+
const t = allComponents.reduce((acc, c) => {
|
|
5592
|
+
const v = parseFloat((type === "from" ? c.from : c.to).replace(/,/g, ""));
|
|
5593
|
+
return acc + (isNaN(v) ? 0 : v);
|
|
5594
|
+
}, 0);
|
|
5595
|
+
return t === 0 ? "" : t.toLocaleString("en-US", {
|
|
5596
|
+
minimumFractionDigits: 2,
|
|
5597
|
+
maximumFractionDigits: 2
|
|
5598
|
+
});
|
|
5599
|
+
};
|
|
5600
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
5601
|
+
className: "bg-white text-black font-sans",
|
|
5602
|
+
style: {
|
|
5603
|
+
width: "816px",
|
|
5604
|
+
minHeight: "1056px",
|
|
5605
|
+
padding: "60px 50px",
|
|
5606
|
+
boxSizing: "border-box"
|
|
5607
|
+
},
|
|
5608
|
+
children: [
|
|
5609
|
+
/* @__PURE__ */ jsx("h1", {
|
|
5610
|
+
className: "text-center italic font-bold text-2xl tracking-widest mb-8 uppercase",
|
|
5611
|
+
children: "Personnel Action Form"
|
|
5612
|
+
}),
|
|
5613
|
+
/* @__PURE__ */ jsxs("div", {
|
|
5614
|
+
className: "mb-6",
|
|
5615
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
5616
|
+
className: "text-sm font-bold italic border-b border-black mb-2 uppercase tracking-tight",
|
|
5617
|
+
children: "Employee Data"
|
|
5618
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
5619
|
+
className: "grid grid-cols-12 gap-x-4",
|
|
5620
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
5621
|
+
className: "col-span-8 space-y-2",
|
|
5622
|
+
children: [{
|
|
5623
|
+
label: "Employee ID:",
|
|
5624
|
+
value: data.employee.idNo
|
|
5625
|
+
}, {
|
|
5626
|
+
label: "Employee Name:",
|
|
5627
|
+
value: data.employee.name.toUpperCase()
|
|
5628
|
+
}].map((r, i) => /* @__PURE__ */ jsxs("div", {
|
|
5629
|
+
className: "flex items-center",
|
|
5630
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
5631
|
+
className: "w-32 text-[11px] font-bold italic",
|
|
5632
|
+
children: r.label
|
|
5633
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
5634
|
+
className: "flex-1 border border-black px-2 py-0.5 text-[12px] min-h-[24px] font-semibold",
|
|
5635
|
+
children: r.value
|
|
5636
|
+
})]
|
|
5637
|
+
}, i))
|
|
5638
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
5639
|
+
className: "col-span-4 space-y-2",
|
|
5640
|
+
children: [{
|
|
5641
|
+
label: "Date Hired:",
|
|
5642
|
+
value: fmtDate(data.employee.dateHired) || "Jan 01, 2024"
|
|
5643
|
+
}, {
|
|
5644
|
+
label: "Date Prepared:",
|
|
5645
|
+
value: fmtDate(data.date)
|
|
5646
|
+
}].map((r, i) => /* @__PURE__ */ jsxs("div", {
|
|
5647
|
+
className: "flex items-center",
|
|
5648
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
5649
|
+
className: "w-24 text-[11px] font-bold italic",
|
|
5650
|
+
children: r.label
|
|
5651
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
5652
|
+
className: "flex-1 border border-black px-2 py-0.5 text-[12px] min-h-[24px] text-center",
|
|
5653
|
+
children: r.value
|
|
5654
|
+
})]
|
|
5655
|
+
}, i))
|
|
5656
|
+
})]
|
|
5657
|
+
})]
|
|
5658
|
+
}),
|
|
5659
|
+
/* @__PURE__ */ jsxs("div", {
|
|
5660
|
+
className: "mb-6",
|
|
5661
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
5662
|
+
className: "text-sm font-bold italic border-b border-black mb-2 uppercase tracking-tight",
|
|
5663
|
+
children: "Position/Salary Change Details"
|
|
5664
|
+
}), /* @__PURE__ */ jsxs("table", {
|
|
5665
|
+
className: "w-full border-collapse",
|
|
5666
|
+
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
5667
|
+
/* @__PURE__ */ jsx("th", {
|
|
5668
|
+
className: "w-[124px]",
|
|
5669
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
5670
|
+
className: "sr-only",
|
|
5671
|
+
children: "Field"
|
|
5672
|
+
})
|
|
5673
|
+
}),
|
|
5674
|
+
/* @__PURE__ */ jsx("th", {
|
|
5675
|
+
className: "text-[12px] italic font-bold text-center pb-1",
|
|
5676
|
+
children: "FROM"
|
|
5677
|
+
}),
|
|
5678
|
+
/* @__PURE__ */ jsx("th", {
|
|
5679
|
+
className: "text-[12px] italic font-bold text-center pb-1",
|
|
5680
|
+
children: "TO"
|
|
5681
|
+
})
|
|
5682
|
+
] }) }), /* @__PURE__ */ jsxs("tbody", { children: [/* @__PURE__ */ jsxs("tr", { children: [
|
|
5683
|
+
/* @__PURE__ */ jsx("td", {
|
|
5684
|
+
className: "text-[10px] italic font-bold py-1",
|
|
5685
|
+
children: "Pay Template"
|
|
5686
|
+
}),
|
|
5687
|
+
/* @__PURE__ */ jsx("td", {
|
|
5688
|
+
className: "border border-black p-1 text-[11px] font-bold w-[300px]",
|
|
5689
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
5690
|
+
className: "px-1 min-h-[16px]",
|
|
5691
|
+
children: data.fromTemplate || "—"
|
|
5692
|
+
})
|
|
5693
|
+
}),
|
|
5694
|
+
/* @__PURE__ */ jsx("td", {
|
|
5695
|
+
className: "border border-black p-1 text-[11px] font-bold w-[300px]",
|
|
5696
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
5697
|
+
className: "px-1 min-h-[16px]",
|
|
5698
|
+
children: data.toTemplate || "—"
|
|
5699
|
+
})
|
|
5700
|
+
})
|
|
5701
|
+
] }), [
|
|
5702
|
+
{
|
|
5703
|
+
label: "Rank",
|
|
5704
|
+
from: data.from.rank,
|
|
5705
|
+
to: data.to.rank
|
|
5706
|
+
},
|
|
5707
|
+
{
|
|
5708
|
+
label: "Employment Status",
|
|
5709
|
+
from: data.from.status,
|
|
5710
|
+
to: data.to.status
|
|
5711
|
+
},
|
|
5712
|
+
{
|
|
5713
|
+
label: "Position",
|
|
5714
|
+
from: data.from.position,
|
|
5715
|
+
to: data.to.position
|
|
5716
|
+
},
|
|
5717
|
+
{
|
|
5718
|
+
label: "Department",
|
|
5719
|
+
from: data.from.department,
|
|
5720
|
+
to: data.to.department
|
|
5721
|
+
},
|
|
5722
|
+
{
|
|
5723
|
+
label: "Supervisor",
|
|
5724
|
+
from: data.from.supervisor,
|
|
5725
|
+
to: data.to.supervisor
|
|
5726
|
+
},
|
|
5727
|
+
{
|
|
5728
|
+
label: "Department Head",
|
|
5729
|
+
from: data.from.departmentHead,
|
|
5730
|
+
to: data.to.departmentHead
|
|
5731
|
+
},
|
|
5732
|
+
{
|
|
5733
|
+
label: "Company",
|
|
5734
|
+
from: data.from.company,
|
|
5735
|
+
to: data.to.company
|
|
5736
|
+
}
|
|
5737
|
+
].map((row, i) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
5738
|
+
/* @__PURE__ */ jsx("td", {
|
|
5739
|
+
className: "text-[10px] italic font-bold py-1",
|
|
5740
|
+
children: row.label
|
|
5741
|
+
}),
|
|
5742
|
+
/* @__PURE__ */ jsx("td", {
|
|
5743
|
+
className: "border border-black p-1 text-[11px] w-[300px]",
|
|
5744
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
5745
|
+
className: "px-1 min-h-[16px]",
|
|
5746
|
+
children: row.from
|
|
5747
|
+
})
|
|
5748
|
+
}),
|
|
5749
|
+
/* @__PURE__ */ jsx("td", {
|
|
5750
|
+
className: "border border-black p-1 text-[11px] w-[300px]",
|
|
5751
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
5752
|
+
className: "px-1 min-h-[16px]",
|
|
5753
|
+
children: row.to
|
|
5754
|
+
})
|
|
5755
|
+
})
|
|
5756
|
+
] }, i))] })]
|
|
5757
|
+
})]
|
|
5758
|
+
}),
|
|
5759
|
+
/* @__PURE__ */ jsxs("div", {
|
|
5760
|
+
className: "mb-6",
|
|
5761
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
5762
|
+
className: "text-sm font-bold italic border-b border-black mb-2 uppercase tracking-tight",
|
|
5763
|
+
children: "Reason for Adjustment"
|
|
5764
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
5765
|
+
className: "flex mb-2",
|
|
5766
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
5767
|
+
className: "flex-1",
|
|
5768
|
+
children: [
|
|
5769
|
+
/* @__PURE__ */ jsxs("div", {
|
|
5770
|
+
className: "flex items-center mb-1",
|
|
5771
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
5772
|
+
className: "text-[10px] italic font-bold w-32",
|
|
5773
|
+
children: "Date of Effectivity:"
|
|
5774
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
5775
|
+
className: "text-[11px] font-bold",
|
|
5776
|
+
children: fmtDate(data.effectiveDate)
|
|
5777
|
+
})]
|
|
5778
|
+
}),
|
|
5779
|
+
/* @__PURE__ */ jsx("div", {
|
|
5780
|
+
className: "text-[10px] italic font-bold mb-1",
|
|
5781
|
+
children: "Reason for Adjustment:"
|
|
5782
|
+
}),
|
|
5783
|
+
/* @__PURE__ */ jsx("div", {
|
|
5784
|
+
className: "flex items-start ml-4",
|
|
5785
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
5786
|
+
className: "text-[10px] italic mt-1",
|
|
5787
|
+
children: "Others"
|
|
5788
|
+
})
|
|
5789
|
+
})
|
|
5790
|
+
]
|
|
5791
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
5792
|
+
className: "w-[450px]",
|
|
5793
|
+
children: /* @__PURE__ */ jsxs("table", {
|
|
5794
|
+
className: "w-full border-collapse",
|
|
5795
|
+
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
5796
|
+
/* @__PURE__ */ jsx("th", {
|
|
5797
|
+
className: "w-1/3",
|
|
5798
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
5799
|
+
className: "sr-only",
|
|
5800
|
+
children: "Component"
|
|
5801
|
+
})
|
|
5802
|
+
}),
|
|
5803
|
+
/* @__PURE__ */ jsx("th", {
|
|
5804
|
+
className: "text-[11px] italic font-bold text-center border-x border-t border-black py-1",
|
|
5805
|
+
children: "FROM"
|
|
5806
|
+
}),
|
|
5807
|
+
/* @__PURE__ */ jsx("th", {
|
|
5808
|
+
className: "text-[11px] italic font-bold text-center border-r border-t border-black py-1",
|
|
5809
|
+
children: "TO"
|
|
5810
|
+
})
|
|
5811
|
+
] }) }), /* @__PURE__ */ jsxs("tbody", {
|
|
5812
|
+
className: "border-b border-black",
|
|
5813
|
+
children: [
|
|
5814
|
+
/* @__PURE__ */ jsxs("tr", { children: [
|
|
5815
|
+
/* @__PURE__ */ jsx("td", {
|
|
5816
|
+
className: "text-[10px] italic pr-4 text-right font-bold uppercase",
|
|
5817
|
+
children: "Template"
|
|
5818
|
+
}),
|
|
5819
|
+
/* @__PURE__ */ jsx("td", {
|
|
5820
|
+
className: "border-x border-black px-2 py-0.5 text-[9px] text-center font-bold",
|
|
5821
|
+
children: data.fromTemplate || "—"
|
|
5822
|
+
}),
|
|
5823
|
+
/* @__PURE__ */ jsx("td", {
|
|
5824
|
+
className: "border-r border-black px-2 py-0.5 text-[9px] text-center font-bold",
|
|
5825
|
+
children: data.toTemplate || "—"
|
|
5826
|
+
})
|
|
5827
|
+
] }),
|
|
5828
|
+
shownComponents.map((c, i) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
5829
|
+
/* @__PURE__ */ jsx("td", {
|
|
5830
|
+
className: "text-[10px] italic pr-4 text-right font-bold",
|
|
5831
|
+
children: c.label
|
|
5832
|
+
}),
|
|
5833
|
+
/* @__PURE__ */ jsx("td", {
|
|
5834
|
+
className: "border-x border-black px-2 py-0.5 text-[11px] text-right min-h-[18px]",
|
|
5835
|
+
children: c.from && parseFloat(c.from.replace(/,/g, "")) !== 0 ? c.from : ""
|
|
5836
|
+
}),
|
|
5837
|
+
/* @__PURE__ */ jsx("td", {
|
|
5838
|
+
className: "border-r border-black px-2 py-0.5 text-[11px] text-right min-h-[18px]",
|
|
5839
|
+
children: c.to && parseFloat(c.to.replace(/,/g, "")) !== 0 ? c.to : ""
|
|
5840
|
+
})
|
|
5841
|
+
] }, i)),
|
|
5842
|
+
paddingRows.map((_, i) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
5843
|
+
/* @__PURE__ */ jsx("td", {
|
|
5844
|
+
className: "text-[10px] py-1",
|
|
5845
|
+
children: "\xA0"
|
|
5846
|
+
}),
|
|
5847
|
+
/* @__PURE__ */ jsx("td", {
|
|
5848
|
+
className: "border-x border-black",
|
|
5849
|
+
children: "\xA0"
|
|
5850
|
+
}),
|
|
5851
|
+
/* @__PURE__ */ jsx("td", {
|
|
5852
|
+
className: "border-r border-black",
|
|
5853
|
+
children: "\xA0"
|
|
5854
|
+
})
|
|
5855
|
+
] }, `p-${i}`)),
|
|
5856
|
+
/* @__PURE__ */ jsxs("tr", {
|
|
5857
|
+
className: "border-t border-black",
|
|
5858
|
+
children: [
|
|
5859
|
+
/* @__PURE__ */ jsx("td", {
|
|
5860
|
+
className: "text-[10px] italic pr-4 text-right font-bold uppercase py-1",
|
|
5861
|
+
children: "Total"
|
|
5862
|
+
}),
|
|
5863
|
+
/* @__PURE__ */ jsx("td", {
|
|
5864
|
+
className: "border-x border-black px-2 py-1 text-[11px] text-right font-bold",
|
|
5865
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
5866
|
+
className: "border-b-4 border-double border-black pb-0.5",
|
|
5867
|
+
children: calcTotal("from")
|
|
5868
|
+
})
|
|
5869
|
+
}),
|
|
5870
|
+
/* @__PURE__ */ jsx("td", {
|
|
5871
|
+
className: "border-r border-black px-2 py-1 text-[11px] text-right font-bold",
|
|
5872
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
5873
|
+
className: "border-b-4 border-double border-black pb-0.5",
|
|
5874
|
+
children: calcTotal("to")
|
|
5875
|
+
})
|
|
5876
|
+
})
|
|
5877
|
+
]
|
|
5878
|
+
})
|
|
5879
|
+
]
|
|
5880
|
+
})]
|
|
5881
|
+
})
|
|
5882
|
+
})]
|
|
5883
|
+
})]
|
|
5884
|
+
}),
|
|
5885
|
+
/* @__PURE__ */ jsxs("div", {
|
|
5886
|
+
className: "mb-8",
|
|
5887
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
5888
|
+
className: "text-sm font-bold italic border-b border-black mb-2 uppercase tracking-tight",
|
|
5889
|
+
children: "Reason for Change"
|
|
5890
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
5891
|
+
className: "border border-black p-2 min-h-[60px] text-[11px] break-words whitespace-pre-wrap",
|
|
5892
|
+
children: data.reason
|
|
5893
|
+
})]
|
|
5894
|
+
}),
|
|
5895
|
+
/* @__PURE__ */ jsxs("div", {
|
|
5896
|
+
className: "mt-10",
|
|
5897
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
5898
|
+
className: "text-sm font-bold italic border-b border-black mb-4 uppercase tracking-tight",
|
|
5899
|
+
children: "Authorized Signatories"
|
|
5900
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
5901
|
+
className: "grid grid-cols-3 gap-6 mb-8",
|
|
5902
|
+
children: [
|
|
5903
|
+
{
|
|
5904
|
+
heading: "Prepared By",
|
|
5905
|
+
name: data.preparedBy,
|
|
5906
|
+
title: data.preparedByTitle || "HRMD Supervisor"
|
|
5907
|
+
},
|
|
5908
|
+
{
|
|
5909
|
+
heading: "Verified By",
|
|
5910
|
+
name: data.approvedBy || "VP of HRMD",
|
|
5911
|
+
title: data.approvedByTitle || "Vice President for HRMD"
|
|
5912
|
+
},
|
|
5913
|
+
{
|
|
5914
|
+
heading: "Conforme",
|
|
5915
|
+
name: data.employee.name,
|
|
5916
|
+
title: "Employee"
|
|
5917
|
+
}
|
|
5918
|
+
].map((sig, i) => /* @__PURE__ */ jsxs("div", {
|
|
5919
|
+
className: "flex flex-col",
|
|
5920
|
+
children: [
|
|
5921
|
+
/* @__PURE__ */ jsx("h3", {
|
|
5922
|
+
className: "text-[11px] italic font-bold mb-3",
|
|
5923
|
+
children: sig.heading
|
|
5924
|
+
}),
|
|
5925
|
+
/* @__PURE__ */ jsx("div", { className: "border-b border-black min-h-[48px] mb-1" }),
|
|
5926
|
+
/* @__PURE__ */ jsxs("div", {
|
|
5927
|
+
className: "text-center",
|
|
5928
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
5929
|
+
className: "text-[10px] font-bold uppercase",
|
|
5930
|
+
children: sig.name
|
|
5931
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
5932
|
+
className: "text-[9px] font-bold text-slate-400",
|
|
5933
|
+
children: sig.title
|
|
5934
|
+
})]
|
|
5935
|
+
})
|
|
5936
|
+
]
|
|
5937
|
+
}, i))
|
|
5938
|
+
})]
|
|
5939
|
+
}),
|
|
5940
|
+
/* @__PURE__ */ jsx("div", {
|
|
5941
|
+
className: "mt-6 border-t-2 border-dashed border-black pt-2 opacity-30 text-center",
|
|
5942
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
5943
|
+
className: "text-[7px] font-black uppercase tracking-[0.2em] italic",
|
|
5944
|
+
children: "Authorized Document — DIWA HRIS"
|
|
5945
|
+
})
|
|
5946
|
+
})
|
|
5947
|
+
]
|
|
5948
|
+
});
|
|
5949
|
+
}
|
|
5950
|
+
//#endregion
|
|
5951
|
+
//#region src/ui-library/gallery/page-sample/IsoCubeBlock.tsx
|
|
5952
|
+
function IsoCubeBlock({ boxWidth = 80, className = "" }) {
|
|
5953
|
+
const BW = boxWidth;
|
|
5954
|
+
const IH = BW * .575;
|
|
5955
|
+
const SH = BW * .525;
|
|
5956
|
+
const TOP_C = "#F3F3F5";
|
|
5957
|
+
const LEFT_C = "#7D739B";
|
|
5958
|
+
const RIGHT_C = "#9B92B8";
|
|
5959
|
+
function Box({ cx, cy }) {
|
|
5960
|
+
const hw = BW / 2;
|
|
5961
|
+
const A = `${cx + hw},${cy - IH}`;
|
|
5962
|
+
const B = `${cx + BW},${cy - IH / 2}`;
|
|
5963
|
+
const C = `${cx + hw},${cy}`;
|
|
5964
|
+
const D = `${cx},${cy - IH / 2}`;
|
|
5965
|
+
const E = `${cx + hw},${cy + SH}`;
|
|
5966
|
+
const F = `${cx},${cy - IH / 2 + SH}`;
|
|
5967
|
+
const G = `${cx + BW},${cy - IH / 2 + SH}`;
|
|
5968
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
5969
|
+
/* @__PURE__ */ jsx("polygon", {
|
|
5970
|
+
points: `${A} ${B} ${C} ${D}`,
|
|
5971
|
+
fill: TOP_C
|
|
5972
|
+
}),
|
|
5973
|
+
/* @__PURE__ */ jsx("polygon", {
|
|
5974
|
+
points: `${D} ${C} ${E} ${F}`,
|
|
5975
|
+
fill: LEFT_C
|
|
5976
|
+
}),
|
|
5977
|
+
/* @__PURE__ */ jsx("polygon", {
|
|
5978
|
+
points: `${B} ${C} ${E} ${G}`,
|
|
5979
|
+
fill: RIGHT_C
|
|
5980
|
+
})
|
|
5981
|
+
] });
|
|
5982
|
+
}
|
|
5983
|
+
const COLS = 4;
|
|
5984
|
+
const ROWS = 4;
|
|
5985
|
+
const SVG_W = BW * 6;
|
|
5986
|
+
const SVG_H = BW * 4.75;
|
|
5987
|
+
const rowDY = -(IH / 2 + SH);
|
|
5988
|
+
const baseX = SVG_W - BW / 2;
|
|
5989
|
+
const baseY = SVG_H;
|
|
5990
|
+
const boxes = [];
|
|
5991
|
+
for (let row = 0; row < ROWS; row++) for (let col = 0; col < COLS; col++) {
|
|
5992
|
+
const cx = baseX - col * BW + row * (BW / 2);
|
|
5993
|
+
const cy = baseY + row * rowDY;
|
|
5994
|
+
boxes.push({
|
|
5995
|
+
cx,
|
|
5996
|
+
cy,
|
|
5997
|
+
key: `${row}-${col}`
|
|
5998
|
+
});
|
|
5999
|
+
}
|
|
6000
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
6001
|
+
"aria-hidden": "true",
|
|
6002
|
+
className: `pointer-events-none absolute bottom-0 right-0 ${className}`,
|
|
6003
|
+
width: SVG_W,
|
|
6004
|
+
height: SVG_H,
|
|
6005
|
+
viewBox: `0 0 ${SVG_W} ${SVG_H}`,
|
|
6006
|
+
style: { zIndex: 0 },
|
|
6007
|
+
overflow: "visible",
|
|
6008
|
+
children: [...boxes].sort((a, b) => {
|
|
6009
|
+
const [ar, ac] = a.key.split("-").map(Number);
|
|
6010
|
+
const [br, bc] = b.key.split("-").map(Number);
|
|
6011
|
+
if (ar !== br) return (br ?? 0) - (ar ?? 0);
|
|
6012
|
+
return (bc ?? 0) - (ac ?? 0);
|
|
6013
|
+
}).map(({ cx, cy, key }) => /* @__PURE__ */ jsx(Box, {
|
|
6014
|
+
cx,
|
|
6015
|
+
cy
|
|
6016
|
+
}, key))
|
|
6017
|
+
});
|
|
6018
|
+
}
|
|
6019
|
+
//#endregion
|
|
6020
|
+
//#region src/ui-library/gallery/template-samples/templates/PayslipTemplate.tsx
|
|
6021
|
+
var DEDUCTIONS = [
|
|
6022
|
+
{
|
|
6023
|
+
label: "W-Tax",
|
|
6024
|
+
amount: 117.59,
|
|
6025
|
+
remainingBalance: void 0,
|
|
6026
|
+
base: void 0
|
|
6027
|
+
},
|
|
6028
|
+
{
|
|
6029
|
+
label: "Pag-Ibig",
|
|
6030
|
+
amount: 100,
|
|
6031
|
+
remainingBalance: void 0,
|
|
6032
|
+
base: void 0
|
|
6033
|
+
},
|
|
6034
|
+
{
|
|
6035
|
+
label: "HMO Premium",
|
|
6036
|
+
amount: 229.99,
|
|
6037
|
+
remainingBalance: void 0,
|
|
6038
|
+
base: 5059.84
|
|
6039
|
+
},
|
|
6040
|
+
{
|
|
6041
|
+
label: "Insurance",
|
|
6042
|
+
amount: 19.44,
|
|
6043
|
+
remainingBalance: void 0,
|
|
6044
|
+
base: 427.62
|
|
6045
|
+
},
|
|
6046
|
+
{
|
|
6047
|
+
label: "COOP Share",
|
|
6048
|
+
amount: 300,
|
|
6049
|
+
remainingBalance: 4500,
|
|
6050
|
+
base: void 0
|
|
6051
|
+
},
|
|
6052
|
+
{
|
|
6053
|
+
label: "Salary Loan",
|
|
6054
|
+
amount: 1250,
|
|
6055
|
+
remainingBalance: 12500,
|
|
6056
|
+
base: void 0
|
|
6057
|
+
}
|
|
6058
|
+
];
|
|
6059
|
+
var ATTENDANCE_LOGS = [
|
|
6060
|
+
{
|
|
6061
|
+
in: "07:00",
|
|
6062
|
+
out: "16:00"
|
|
6063
|
+
},
|
|
6064
|
+
{
|
|
6065
|
+
in: "07:15",
|
|
6066
|
+
out: "16:00"
|
|
6067
|
+
},
|
|
6068
|
+
{
|
|
6069
|
+
in: "Reg. Hol",
|
|
6070
|
+
out: "Reg. Hol"
|
|
6071
|
+
},
|
|
6072
|
+
{
|
|
6073
|
+
in: "Sp. Hol",
|
|
6074
|
+
out: "Sp. Hol"
|
|
6075
|
+
},
|
|
6076
|
+
{
|
|
6077
|
+
in: "-",
|
|
6078
|
+
out: "-"
|
|
6079
|
+
},
|
|
6080
|
+
{
|
|
6081
|
+
in: "-",
|
|
6082
|
+
out: "-"
|
|
6083
|
+
},
|
|
6084
|
+
{
|
|
6085
|
+
in: "07:00",
|
|
6086
|
+
out: "16:00"
|
|
6087
|
+
},
|
|
6088
|
+
{
|
|
6089
|
+
in: "VL w/pay",
|
|
6090
|
+
out: "VL w/pay"
|
|
6091
|
+
},
|
|
6092
|
+
{
|
|
6093
|
+
in: "SL w/pay",
|
|
6094
|
+
out: "SL w/pay"
|
|
6095
|
+
},
|
|
6096
|
+
{
|
|
6097
|
+
in: "07:00",
|
|
6098
|
+
out: "12:00 (VL)"
|
|
6099
|
+
},
|
|
6100
|
+
{
|
|
6101
|
+
in: "07:00",
|
|
6102
|
+
out: "13:00 (SL)"
|
|
6103
|
+
},
|
|
6104
|
+
{
|
|
6105
|
+
in: "07:00 (RH)",
|
|
6106
|
+
out: "16:00"
|
|
6107
|
+
},
|
|
6108
|
+
{
|
|
6109
|
+
in: "-",
|
|
6110
|
+
out: "-"
|
|
6111
|
+
},
|
|
6112
|
+
{
|
|
6113
|
+
in: "07:00",
|
|
6114
|
+
out: "16:00"
|
|
6115
|
+
},
|
|
6116
|
+
{
|
|
6117
|
+
in: "07:00",
|
|
6118
|
+
out: "16:00"
|
|
6119
|
+
},
|
|
6120
|
+
{
|
|
6121
|
+
in: "07:00",
|
|
6122
|
+
out: "16:00"
|
|
6123
|
+
}
|
|
6124
|
+
];
|
|
6125
|
+
var WHOLE_DAY_TYPES = /* @__PURE__ */ new Set([
|
|
6126
|
+
"Reg. Hol",
|
|
6127
|
+
"Sp. Hol",
|
|
6128
|
+
"VL w/pay",
|
|
6129
|
+
"VL wo/pay",
|
|
6130
|
+
"SL w/pay",
|
|
6131
|
+
"SL wo/pay"
|
|
6132
|
+
]);
|
|
6133
|
+
var fc = (n) => n.toLocaleString(void 0, {
|
|
6134
|
+
minimumFractionDigits: 2,
|
|
6135
|
+
maximumFractionDigits: 2
|
|
6136
|
+
});
|
|
6137
|
+
var fr = (n) => n.toLocaleString(void 0, {
|
|
6138
|
+
minimumFractionDigits: 2,
|
|
6139
|
+
maximumFractionDigits: 6
|
|
6140
|
+
});
|
|
6141
|
+
function AttendanceTable({ logs }) {
|
|
6142
|
+
return /* @__PURE__ */ jsxs("table", {
|
|
6143
|
+
className: "flex-1 w-full text-center",
|
|
6144
|
+
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", {
|
|
6145
|
+
className: "border-b border-black",
|
|
6146
|
+
children: [
|
|
6147
|
+
/* @__PURE__ */ jsx("th", {
|
|
6148
|
+
className: "font-black text-[8px]",
|
|
6149
|
+
children: "Date"
|
|
6150
|
+
}),
|
|
6151
|
+
/* @__PURE__ */ jsx("th", {
|
|
6152
|
+
className: "font-black text-[8px]",
|
|
6153
|
+
children: "IN"
|
|
6154
|
+
}),
|
|
6155
|
+
/* @__PURE__ */ jsx("th", {
|
|
6156
|
+
className: "font-black text-[8px]",
|
|
6157
|
+
children: "OUT"
|
|
6158
|
+
})
|
|
6159
|
+
]
|
|
6160
|
+
}) }), /* @__PURE__ */ jsx("tbody", { children: logs.map((log, i) => {
|
|
6161
|
+
const isWholeDay = WHOLE_DAY_TYPES.has(log.in) && log.in === log.out;
|
|
6162
|
+
const isAbsence = log.in === "-" && log.out === "-";
|
|
6163
|
+
const isTiny = log.in.includes("(") || log.out.includes("(");
|
|
6164
|
+
return /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("td", {
|
|
6165
|
+
className: "font-bold text-[8px]",
|
|
6166
|
+
children: log.date
|
|
6167
|
+
}), isWholeDay ? /* @__PURE__ */ jsx("td", {
|
|
6168
|
+
colSpan: 2,
|
|
6169
|
+
className: "text-center font-bold text-[5px] tracking-tight uppercase border-b border-black/10",
|
|
6170
|
+
children: log.in
|
|
6171
|
+
}) : isAbsence ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("td", {
|
|
6172
|
+
className: "text-[6px]",
|
|
6173
|
+
children: "—"
|
|
6174
|
+
}), /* @__PURE__ */ jsx("td", {
|
|
6175
|
+
className: "text-[6px]",
|
|
6176
|
+
children: "—"
|
|
6177
|
+
})] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("td", {
|
|
6178
|
+
className: isTiny ? "text-[5px]" : "text-[8px]",
|
|
6179
|
+
children: log.in
|
|
6180
|
+
}), /* @__PURE__ */ jsx("td", {
|
|
6181
|
+
className: isTiny ? "text-[5px]" : "text-[8px]",
|
|
6182
|
+
children: log.out
|
|
6183
|
+
})] })] }, i);
|
|
6184
|
+
}) })]
|
|
6185
|
+
});
|
|
6186
|
+
}
|
|
6187
|
+
function PayslipTemplate({ data }) {
|
|
6188
|
+
const rates = data.rates ?? {
|
|
6189
|
+
hourly: 107.9713,
|
|
6190
|
+
daily: 863.77,
|
|
6191
|
+
monthly: 22601.9
|
|
6192
|
+
};
|
|
6193
|
+
const taxCode = data.taxCode ?? "S";
|
|
6194
|
+
const taxableGross = data.taxableGross ?? (data.netPay ? data.netPay * 1.1 : 22601.9);
|
|
6195
|
+
const nonTaxableGross = data.nonTaxableGross ?? 0;
|
|
6196
|
+
const totalGross = taxableGross + nonTaxableGross;
|
|
6197
|
+
const totalDeductions = DEDUCTIONS.reduce((s, d) => s + d.amount, 0);
|
|
6198
|
+
const finalNet = totalGross - totalDeductions;
|
|
6199
|
+
const buildLogs = () => {
|
|
6200
|
+
const period = data.payPeriod;
|
|
6201
|
+
return ATTENDANCE_LOGS.map((log, idx) => {
|
|
6202
|
+
let date = String(16 + idx).padStart(2, "0");
|
|
6203
|
+
if (period && period.includes("-")) {
|
|
6204
|
+
const monthMap = {
|
|
6205
|
+
Jan: 0,
|
|
6206
|
+
Feb: 1,
|
|
6207
|
+
Mar: 2,
|
|
6208
|
+
Apr: 3,
|
|
6209
|
+
May: 4,
|
|
6210
|
+
Jun: 5,
|
|
6211
|
+
Jul: 6,
|
|
6212
|
+
Aug: 7,
|
|
6213
|
+
Sep: 8,
|
|
6214
|
+
Oct: 9,
|
|
6215
|
+
Nov: 10,
|
|
6216
|
+
Dec: 11
|
|
6217
|
+
};
|
|
6218
|
+
const parts = period.split(" ");
|
|
6219
|
+
const startMonth = monthMap[parts[0]] ?? 0;
|
|
6220
|
+
const startDay = parseInt(parts[1]) || 1;
|
|
6221
|
+
const year = parseInt(period.match(/\d{4}$/)?.[0] ?? String((/* @__PURE__ */ new Date()).getFullYear()));
|
|
6222
|
+
const d = new Date(year, startMonth, startDay + idx);
|
|
6223
|
+
date = `${String(d.getMonth() + 1).padStart(2, "0")}/${String(d.getDate()).padStart(2, "0")}`;
|
|
6224
|
+
}
|
|
6225
|
+
return {
|
|
6226
|
+
...log,
|
|
6227
|
+
date
|
|
6228
|
+
};
|
|
6229
|
+
});
|
|
6230
|
+
};
|
|
6231
|
+
const logs = buildLogs();
|
|
6232
|
+
const leftLogs = logs.slice(0, 8);
|
|
6233
|
+
const rightLogs = logs.slice(8, 16);
|
|
6234
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6235
|
+
className: "bg-white text-[#1a1a1a] p-8 font-mono text-[10px] max-w-[900px] mx-auto leading-tight",
|
|
6236
|
+
children: [
|
|
6237
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6238
|
+
className: "grid grid-cols-12 gap-0 mb-2 items-start h-[70px]",
|
|
6239
|
+
children: [
|
|
6240
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6241
|
+
className: "col-span-4 translate-y-2",
|
|
6242
|
+
children: [
|
|
6243
|
+
/* @__PURE__ */ jsx("h1", {
|
|
6244
|
+
className: "text-lg font-black tracking-tight leading-none mb-2",
|
|
6245
|
+
children: "DIWA HRIS PAYSLIP"
|
|
6246
|
+
}),
|
|
6247
|
+
/* @__PURE__ */ jsxs("p", {
|
|
6248
|
+
className: "font-bold flex gap-1 text-[9px]",
|
|
6249
|
+
children: ["Period: ", /* @__PURE__ */ jsx("span", {
|
|
6250
|
+
className: "font-normal",
|
|
6251
|
+
children: data.payPeriod || "No Period Selected"
|
|
6252
|
+
})]
|
|
6253
|
+
}),
|
|
6254
|
+
/* @__PURE__ */ jsxs("p", {
|
|
6255
|
+
className: "font-bold flex gap-1 text-[8px]",
|
|
6256
|
+
children: ["Printed: ", /* @__PURE__ */ jsx("span", {
|
|
6257
|
+
className: "font-normal",
|
|
6258
|
+
children: (/* @__PURE__ */ new Date()).toLocaleDateString()
|
|
6259
|
+
})]
|
|
6260
|
+
})
|
|
6261
|
+
]
|
|
6262
|
+
}),
|
|
6263
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6264
|
+
className: "col-span-4 border border-black p-1.5 mt-2 mb-1 relative z-10",
|
|
6265
|
+
children: [
|
|
6266
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6267
|
+
className: "flex gap-2 mb-0.5 border-b border-black pb-0.5",
|
|
6268
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6269
|
+
className: "font-black border-r border-black pr-2",
|
|
6270
|
+
children: data.id
|
|
6271
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6272
|
+
className: "font-black tracking-tight",
|
|
6273
|
+
children: data.name.toUpperCase()
|
|
6274
|
+
})]
|
|
6275
|
+
}),
|
|
6276
|
+
/* @__PURE__ */ jsx("div", {
|
|
6277
|
+
className: "font-bold text-[9px] border-b border-black pb-0.5 mb-0.5",
|
|
6278
|
+
children: data.role
|
|
6279
|
+
}),
|
|
6280
|
+
/* @__PURE__ */ jsx("div", {
|
|
6281
|
+
className: "font-bold text-[9px]",
|
|
6282
|
+
children: data.department
|
|
6283
|
+
})
|
|
6284
|
+
]
|
|
6285
|
+
}),
|
|
6286
|
+
/* @__PURE__ */ jsx("div", {
|
|
6287
|
+
className: "col-span-4 text-[9px] pl-8 text-right pr-2 mt-4 space-y-0",
|
|
6288
|
+
children: [
|
|
6289
|
+
["Hourly :", fr(rates.hourly)],
|
|
6290
|
+
["Daily :", fr(rates.daily)],
|
|
6291
|
+
["Monthly :", fr(rates.monthly)],
|
|
6292
|
+
["Tax Code :", taxCode]
|
|
6293
|
+
].map(([k, v]) => /* @__PURE__ */ jsxs("div", {
|
|
6294
|
+
className: "grid grid-cols-2",
|
|
6295
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6296
|
+
className: "text-left font-bold",
|
|
6297
|
+
children: k
|
|
6298
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6299
|
+
className: "font-bold",
|
|
6300
|
+
children: v
|
|
6301
|
+
})]
|
|
6302
|
+
}, k))
|
|
6303
|
+
})
|
|
6304
|
+
]
|
|
6305
|
+
}),
|
|
6306
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6307
|
+
className: "grid grid-cols-12 border-t border-black min-h-[160px]",
|
|
6308
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6309
|
+
className: "col-span-8 grid grid-cols-2 border-r border-black min-h-[160px]",
|
|
6310
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6311
|
+
className: "border-r border-black p-1 flex flex-col h-full",
|
|
6312
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6313
|
+
className: "flex-1",
|
|
6314
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6315
|
+
className: "font-black border-b border-black mb-1 p-0.5 flex justify-between",
|
|
6316
|
+
children: [/* @__PURE__ */ jsx("span", { children: "EARNINGS:" }), /* @__PURE__ */ jsxs("div", {
|
|
6317
|
+
className: "flex gap-8 text-[7px] pr-2 items-center",
|
|
6318
|
+
children: [/* @__PURE__ */ jsx("span", { children: "UNIT" }), /* @__PURE__ */ jsx("span", { children: "AMOUNT" })]
|
|
6319
|
+
})]
|
|
6320
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
6321
|
+
className: "space-y-0.5",
|
|
6322
|
+
children: [
|
|
6323
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6324
|
+
className: "grid grid-cols-12 gap-1 px-1",
|
|
6325
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6326
|
+
className: "col-span-7",
|
|
6327
|
+
children: "Basic Salary"
|
|
6328
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6329
|
+
className: "col-span-5 text-right",
|
|
6330
|
+
children: fc(taxableGross)
|
|
6331
|
+
})]
|
|
6332
|
+
}),
|
|
6333
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6334
|
+
className: "grid grid-cols-12 gap-1 px-1",
|
|
6335
|
+
children: [
|
|
6336
|
+
/* @__PURE__ */ jsx("span", {
|
|
6337
|
+
className: "col-span-6",
|
|
6338
|
+
children: "Holiday Pay"
|
|
6339
|
+
}),
|
|
6340
|
+
/* @__PURE__ */ jsx("span", {
|
|
6341
|
+
className: "col-span-2 text-right",
|
|
6342
|
+
children: "1.00"
|
|
6343
|
+
}),
|
|
6344
|
+
/* @__PURE__ */ jsx("span", {
|
|
6345
|
+
className: "col-span-4 text-right",
|
|
6346
|
+
children: "863.77"
|
|
6347
|
+
})
|
|
6348
|
+
]
|
|
6349
|
+
}),
|
|
6350
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6351
|
+
className: "grid grid-cols-12 gap-1 px-1 italic",
|
|
6352
|
+
children: [
|
|
6353
|
+
/* @__PURE__ */ jsx("span", {
|
|
6354
|
+
className: "col-span-6",
|
|
6355
|
+
children: "Absences"
|
|
6356
|
+
}),
|
|
6357
|
+
/* @__PURE__ */ jsx("span", {
|
|
6358
|
+
className: "col-span-2 text-right",
|
|
6359
|
+
children: "1.00"
|
|
6360
|
+
}),
|
|
6361
|
+
/* @__PURE__ */ jsxs("span", {
|
|
6362
|
+
className: "col-span-4 text-right",
|
|
6363
|
+
children: [
|
|
6364
|
+
"(",
|
|
6365
|
+
fc(863.77),
|
|
6366
|
+
")"
|
|
6367
|
+
]
|
|
6368
|
+
})
|
|
6369
|
+
]
|
|
6370
|
+
})
|
|
6371
|
+
]
|
|
6372
|
+
})]
|
|
6373
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
6374
|
+
className: "pt-2 border-t border-dotted border-black space-y-0.5",
|
|
6375
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6376
|
+
className: "grid grid-cols-12 gap-1 px-1",
|
|
6377
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
6378
|
+
className: "col-span-8 font-bold",
|
|
6379
|
+
children: ["Gross ", /* @__PURE__ */ jsx("span", {
|
|
6380
|
+
className: "font-normal",
|
|
6381
|
+
children: "(taxable)"
|
|
6382
|
+
})]
|
|
6383
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6384
|
+
className: "col-span-4 text-right",
|
|
6385
|
+
children: fc(taxableGross)
|
|
6386
|
+
})]
|
|
6387
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
6388
|
+
className: "grid grid-cols-12 gap-1 px-1",
|
|
6389
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
6390
|
+
className: "col-span-8 font-bold",
|
|
6391
|
+
children: ["Gross ", /* @__PURE__ */ jsx("span", {
|
|
6392
|
+
className: "font-normal",
|
|
6393
|
+
children: "(nontaxable)"
|
|
6394
|
+
})]
|
|
6395
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6396
|
+
className: "col-span-4 text-right",
|
|
6397
|
+
children: fc(nonTaxableGross)
|
|
6398
|
+
})]
|
|
6399
|
+
})]
|
|
6400
|
+
})]
|
|
6401
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
6402
|
+
className: "p-1",
|
|
6403
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6404
|
+
className: "font-black border-b border-black mb-1 p-0.5 flex justify-between",
|
|
6405
|
+
children: [/* @__PURE__ */ jsx("span", { children: "DEDUCTIONS:" }), /* @__PURE__ */ jsxs("div", {
|
|
6406
|
+
className: "flex gap-4 text-[7px] pr-2 items-center",
|
|
6407
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6408
|
+
className: "w-16 text-center",
|
|
6409
|
+
children: "REM. BAL"
|
|
6410
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6411
|
+
className: "w-12 text-right",
|
|
6412
|
+
children: "AMOUNT"
|
|
6413
|
+
})]
|
|
6414
|
+
})]
|
|
6415
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
6416
|
+
className: "space-y-0.5",
|
|
6417
|
+
children: DEDUCTIONS.map((d, i) => /* @__PURE__ */ jsxs("div", {
|
|
6418
|
+
className: "grid grid-cols-12 gap-1 px-1",
|
|
6419
|
+
children: [
|
|
6420
|
+
/* @__PURE__ */ jsx("span", {
|
|
6421
|
+
className: "col-span-5",
|
|
6422
|
+
children: d.label
|
|
6423
|
+
}),
|
|
6424
|
+
/* @__PURE__ */ jsx("span", {
|
|
6425
|
+
className: "col-span-3 text-center text-[8px] text-slate-500",
|
|
6426
|
+
children: d.remainingBalance ? fc(d.remainingBalance) : d.base ? fc(d.base) : ""
|
|
6427
|
+
}),
|
|
6428
|
+
/* @__PURE__ */ jsx("span", {
|
|
6429
|
+
className: "col-span-4 text-right",
|
|
6430
|
+
children: fc(d.amount)
|
|
6431
|
+
})
|
|
6432
|
+
]
|
|
6433
|
+
}, i))
|
|
6434
|
+
})]
|
|
6435
|
+
})]
|
|
6436
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
6437
|
+
className: "col-span-4 p-1 text-[8px]",
|
|
6438
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
6439
|
+
className: "flex gap-4",
|
|
6440
|
+
children: [/* @__PURE__ */ jsx(AttendanceTable, { logs: leftLogs }), /* @__PURE__ */ jsx(AttendanceTable, { logs: rightLogs })]
|
|
6441
|
+
})
|
|
6442
|
+
})]
|
|
6443
|
+
}),
|
|
6444
|
+
/* @__PURE__ */ jsx("div", {
|
|
6445
|
+
className: "border-t border-black mb-1",
|
|
6446
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
6447
|
+
className: "grid grid-cols-12",
|
|
6448
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6449
|
+
className: "col-span-8 border-r border-black",
|
|
6450
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6451
|
+
className: "grid grid-cols-2 bg-slate-100 py-1.5 border-y border-black font-black uppercase tracking-tight",
|
|
6452
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6453
|
+
className: "grid grid-cols-12 px-2 border-r border-black",
|
|
6454
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6455
|
+
className: "col-span-7",
|
|
6456
|
+
children: "Total Gross"
|
|
6457
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6458
|
+
className: "col-span-5 text-right",
|
|
6459
|
+
children: fc(totalGross)
|
|
6460
|
+
})]
|
|
6461
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
6462
|
+
className: "grid grid-cols-12 px-2",
|
|
6463
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6464
|
+
className: "col-span-8 text-right pr-4",
|
|
6465
|
+
children: "Total Deductions:"
|
|
6466
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6467
|
+
className: "col-span-4 text-right",
|
|
6468
|
+
children: fc(totalDeductions)
|
|
6469
|
+
})]
|
|
6470
|
+
})]
|
|
6471
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
6472
|
+
className: "p-1 px-2 flex gap-4 items-center h-8",
|
|
6473
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6474
|
+
className: "text-[11px] font-black uppercase",
|
|
6475
|
+
children: "Net Pay:"
|
|
6476
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6477
|
+
className: "text-[16px] font-black pl-4",
|
|
6478
|
+
children: fc(finalNet)
|
|
6479
|
+
})]
|
|
6480
|
+
})]
|
|
6481
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
6482
|
+
className: "col-span-4 p-1 px-2",
|
|
6483
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6484
|
+
className: "grid grid-cols-2 border border-black text-center mb-2",
|
|
6485
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6486
|
+
className: "border-r border-black p-0.5",
|
|
6487
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
6488
|
+
className: "border-b border-black font-bold uppercase text-[7px] mb-0.5",
|
|
6489
|
+
children: "YTD Gross"
|
|
6490
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
6491
|
+
className: "font-black text-[12px]",
|
|
6492
|
+
children: fc(data.ytd?.gross ?? taxableGross)
|
|
6493
|
+
})]
|
|
6494
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
6495
|
+
className: "p-0.5",
|
|
6496
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
6497
|
+
className: "border-b border-black font-bold uppercase text-[7px] mb-0.5",
|
|
6498
|
+
children: "YTD Tax"
|
|
6499
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
6500
|
+
className: "font-black text-[12px]",
|
|
6501
|
+
children: fc(data.ytd?.tax ?? totalDeductions * .1)
|
|
6502
|
+
})]
|
|
6503
|
+
})]
|
|
6504
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
6505
|
+
className: "flex justify-between text-[8px] font-bold uppercase px-1 pb-0.5 pt-1",
|
|
6506
|
+
children: [
|
|
6507
|
+
["VL", data.leaveBalances?.vacation.remaining ?? 10],
|
|
6508
|
+
["SL", data.leaveBalances?.sick.remaining ?? 14],
|
|
6509
|
+
["PL", data.leaveBalances?.personal?.remaining ?? 0]
|
|
6510
|
+
].map(([k, v]) => /* @__PURE__ */ jsxs("div", {
|
|
6511
|
+
className: "flex gap-1",
|
|
6512
|
+
children: [/* @__PURE__ */ jsxs("span", { children: [k, " Bal:"] }), /* @__PURE__ */ jsx("span", {
|
|
6513
|
+
className: "font-normal",
|
|
6514
|
+
children: String(v)
|
|
6515
|
+
})]
|
|
6516
|
+
}, String(k)))
|
|
6517
|
+
})]
|
|
6518
|
+
})]
|
|
6519
|
+
})
|
|
6520
|
+
}),
|
|
6521
|
+
/* @__PURE__ */ jsx("div", {
|
|
6522
|
+
className: "mt-4 border-t-2 border-dashed border-black pt-2 opacity-30 text-center",
|
|
6523
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
6524
|
+
className: "text-[7px] font-black uppercase tracking-[0.2em] italic",
|
|
6525
|
+
children: "Authorized Document — DIWA HRIS Fin-Audit System"
|
|
6526
|
+
})
|
|
6527
|
+
})
|
|
6528
|
+
]
|
|
6529
|
+
});
|
|
6530
|
+
}
|
|
6531
|
+
//#endregion
|
|
6532
|
+
//#region src/ui-library/gallery/template-samples/templates/ReportTemplate.tsx
|
|
6533
|
+
var MOCK_ROWS = [
|
|
6534
|
+
{
|
|
6535
|
+
id: "DL-0001",
|
|
6536
|
+
name: "Maria Santos",
|
|
6537
|
+
dept: "Finance",
|
|
6538
|
+
position: "Senior Accountant",
|
|
6539
|
+
status: "Regular",
|
|
6540
|
+
dateHired: "Jan 15, 2021",
|
|
6541
|
+
rate: "25,000.00"
|
|
6542
|
+
},
|
|
6543
|
+
{
|
|
6544
|
+
id: "DL-0002",
|
|
6545
|
+
name: "Jose Reyes",
|
|
6546
|
+
dept: "IT",
|
|
6547
|
+
position: "IT Infrastructure Lead",
|
|
6548
|
+
status: "Regular",
|
|
6549
|
+
dateHired: "Mar 08, 2020",
|
|
6550
|
+
rate: "38,000.00"
|
|
6551
|
+
},
|
|
6552
|
+
{
|
|
6553
|
+
id: "DL-0003",
|
|
6554
|
+
name: "Ana Dela Cruz",
|
|
6555
|
+
dept: "HR",
|
|
6556
|
+
position: "HR Business Partner",
|
|
6557
|
+
status: "Regular",
|
|
6558
|
+
dateHired: "Jun 01, 2019",
|
|
6559
|
+
rate: "32,000.00"
|
|
6560
|
+
},
|
|
6561
|
+
{
|
|
6562
|
+
id: "DL-0004",
|
|
6563
|
+
name: "Carlo Mendoza",
|
|
6564
|
+
dept: "Operations",
|
|
6565
|
+
position: "Operations Manager",
|
|
6566
|
+
status: "Regular",
|
|
6567
|
+
dateHired: "Sep 22, 2022",
|
|
6568
|
+
rate: "45,000.00"
|
|
6569
|
+
},
|
|
6570
|
+
{
|
|
6571
|
+
id: "DL-0005",
|
|
6572
|
+
name: "Liza Bautista",
|
|
6573
|
+
dept: "Legal",
|
|
6574
|
+
position: "Legal Counsel",
|
|
6575
|
+
status: "Probationary",
|
|
6576
|
+
dateHired: "Feb 10, 2024",
|
|
6577
|
+
rate: "28,000.00"
|
|
6578
|
+
},
|
|
6579
|
+
{
|
|
6580
|
+
id: "DL-0006",
|
|
6581
|
+
name: "Mark Villanueva",
|
|
6582
|
+
dept: "Academic",
|
|
6583
|
+
position: "Academic Coordinator",
|
|
6584
|
+
status: "Regular",
|
|
6585
|
+
dateHired: "Nov 03, 2023",
|
|
6586
|
+
rate: "22,000.00"
|
|
6587
|
+
},
|
|
6588
|
+
{
|
|
6589
|
+
id: "DL-0007",
|
|
6590
|
+
name: "Rosa Castillo",
|
|
6591
|
+
dept: "Finance",
|
|
6592
|
+
position: "Bookkeeper",
|
|
6593
|
+
status: "Regular",
|
|
6594
|
+
dateHired: "Apr 14, 2018",
|
|
6595
|
+
rate: "20,000.00"
|
|
6596
|
+
},
|
|
6597
|
+
{
|
|
6598
|
+
id: "DL-0008",
|
|
6599
|
+
name: "Noel Ramos",
|
|
6600
|
+
dept: "IT",
|
|
6601
|
+
position: "Systems Analyst",
|
|
6602
|
+
status: "Regular",
|
|
6603
|
+
dateHired: "Jul 30, 2021",
|
|
6604
|
+
rate: "30,000.00"
|
|
6605
|
+
},
|
|
6606
|
+
{
|
|
6607
|
+
id: "DL-0009",
|
|
6608
|
+
name: "Cynthia Torres",
|
|
6609
|
+
dept: "HR",
|
|
6610
|
+
position: "Recruitment Officer",
|
|
6611
|
+
status: "Regular",
|
|
6612
|
+
dateHired: "Dec 05, 2022",
|
|
6613
|
+
rate: "24,000.00"
|
|
6614
|
+
},
|
|
6615
|
+
{
|
|
6616
|
+
id: "DL-0010",
|
|
6617
|
+
name: "Ramon Aquino",
|
|
6618
|
+
dept: "Operations",
|
|
6619
|
+
position: "Logistics Coordinator",
|
|
6620
|
+
status: "Probationary",
|
|
6621
|
+
dateHired: "Aug 18, 2024",
|
|
6622
|
+
rate: "19,500.00"
|
|
6623
|
+
},
|
|
6624
|
+
{
|
|
6625
|
+
id: "DL-0011",
|
|
6626
|
+
name: "Elena Fuentes",
|
|
6627
|
+
dept: "Academic",
|
|
6628
|
+
position: "Faculty Member",
|
|
6629
|
+
status: "Regular",
|
|
6630
|
+
dateHired: "Jun 12, 2017",
|
|
6631
|
+
rate: "27,000.00"
|
|
6632
|
+
},
|
|
6633
|
+
{
|
|
6634
|
+
id: "DL-0012",
|
|
6635
|
+
name: "Dennis Lacerna",
|
|
6636
|
+
dept: "Finance",
|
|
6637
|
+
position: "Payroll Officer",
|
|
6638
|
+
status: "Regular",
|
|
6639
|
+
dateHired: "Oct 01, 2020",
|
|
6640
|
+
rate: "23,500.00"
|
|
6641
|
+
}
|
|
6642
|
+
];
|
|
6643
|
+
var HEADERS = [
|
|
6644
|
+
"#",
|
|
6645
|
+
"Employee ID",
|
|
6646
|
+
"Full Name",
|
|
6647
|
+
"Department",
|
|
6648
|
+
"Position",
|
|
6649
|
+
"Status",
|
|
6650
|
+
"Date Hired",
|
|
6651
|
+
"Monthly Rate"
|
|
6652
|
+
];
|
|
6653
|
+
function ReportTemplate({ data }) {
|
|
6654
|
+
const today = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
|
|
6655
|
+
month: "long",
|
|
6656
|
+
day: "numeric",
|
|
6657
|
+
year: "numeric"
|
|
6658
|
+
});
|
|
6659
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6660
|
+
className: "bg-white text-black font-sans",
|
|
6661
|
+
style: {
|
|
6662
|
+
width: "816px",
|
|
6663
|
+
minHeight: "1056px",
|
|
6664
|
+
padding: "48px 50px",
|
|
6665
|
+
boxSizing: "border-box"
|
|
6666
|
+
},
|
|
6667
|
+
children: [
|
|
6668
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6669
|
+
className: "flex justify-between items-start mb-6 border-b-2 border-black pb-4",
|
|
6670
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [
|
|
6671
|
+
/* @__PURE__ */ jsx("div", {
|
|
6672
|
+
className: "text-[9px] text-slate-500 uppercase tracking-widest mb-1 font-bold",
|
|
6673
|
+
children: data.company || "DIWA Learning Systems, Inc."
|
|
6674
|
+
}),
|
|
6675
|
+
/* @__PURE__ */ jsx("h1", {
|
|
6676
|
+
className: "text-[20px] font-black uppercase tracking-tight leading-tight",
|
|
6677
|
+
children: data.title || "Employee Masterlist Report"
|
|
6678
|
+
}),
|
|
6679
|
+
/* @__PURE__ */ jsx("p", {
|
|
6680
|
+
className: "text-[11px] text-slate-500 mt-0.5 italic",
|
|
6681
|
+
children: data.subtitle || "All Active Employees — Direct Labor"
|
|
6682
|
+
})
|
|
6683
|
+
] }), /* @__PURE__ */ jsxs("div", {
|
|
6684
|
+
className: "text-right text-[9px] space-y-0.5",
|
|
6685
|
+
children: [
|
|
6686
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
6687
|
+
/* @__PURE__ */ jsx("span", {
|
|
6688
|
+
className: "font-bold",
|
|
6689
|
+
children: "As of:"
|
|
6690
|
+
}),
|
|
6691
|
+
" ",
|
|
6692
|
+
data.asOf || today
|
|
6693
|
+
] }),
|
|
6694
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
6695
|
+
/* @__PURE__ */ jsx("span", {
|
|
6696
|
+
className: "font-bold",
|
|
6697
|
+
children: "Date Printed:"
|
|
6698
|
+
}),
|
|
6699
|
+
" ",
|
|
6700
|
+
today
|
|
6701
|
+
] }),
|
|
6702
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("span", {
|
|
6703
|
+
className: "font-bold",
|
|
6704
|
+
children: "Page:"
|
|
6705
|
+
}), " 1 of 1"] }),
|
|
6706
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
6707
|
+
/* @__PURE__ */ jsx("span", {
|
|
6708
|
+
className: "font-bold",
|
|
6709
|
+
children: "Prepared by:"
|
|
6710
|
+
}),
|
|
6711
|
+
" ",
|
|
6712
|
+
data.preparedBy || "System"
|
|
6713
|
+
] })
|
|
6714
|
+
]
|
|
6715
|
+
})]
|
|
6716
|
+
}),
|
|
6717
|
+
/* @__PURE__ */ jsx("div", {
|
|
6718
|
+
className: "flex gap-6 mb-5 text-[10px]",
|
|
6719
|
+
children: [
|
|
6720
|
+
["Total Employees", String(MOCK_ROWS.length)],
|
|
6721
|
+
["Regular", String(MOCK_ROWS.filter((r) => r.status === "Regular").length)],
|
|
6722
|
+
["Probationary", String(MOCK_ROWS.filter((r) => r.status === "Probationary").length)],
|
|
6723
|
+
["Departments", "5"]
|
|
6724
|
+
].map(([label, value]) => /* @__PURE__ */ jsxs("div", {
|
|
6725
|
+
className: "border border-black px-3 py-1.5 text-center min-w-[80px]",
|
|
6726
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
6727
|
+
className: "font-black text-[16px]",
|
|
6728
|
+
children: value
|
|
6729
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
6730
|
+
className: "text-[8px] text-slate-500 font-bold uppercase tracking-tight",
|
|
6731
|
+
children: label
|
|
6732
|
+
})]
|
|
6733
|
+
}, label))
|
|
6734
|
+
}),
|
|
6735
|
+
/* @__PURE__ */ jsxs("table", {
|
|
6736
|
+
className: "w-full border-collapse text-[9px]",
|
|
6737
|
+
children: [
|
|
6738
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", {
|
|
6739
|
+
className: "bg-[#00377B] text-white",
|
|
6740
|
+
children: HEADERS.map((h) => /* @__PURE__ */ jsx("th", {
|
|
6741
|
+
className: "border border-[#00377B] px-2 py-1.5 text-left font-bold uppercase tracking-wide text-[8px]",
|
|
6742
|
+
children: h
|
|
6743
|
+
}, h))
|
|
6744
|
+
}) }),
|
|
6745
|
+
/* @__PURE__ */ jsx("tbody", { children: MOCK_ROWS.map((row, i) => /* @__PURE__ */ jsxs("tr", {
|
|
6746
|
+
className: i % 2 === 0 ? "bg-white" : "bg-slate-50",
|
|
6747
|
+
children: [
|
|
6748
|
+
/* @__PURE__ */ jsx("td", {
|
|
6749
|
+
className: "border border-slate-200 px-2 py-1 text-slate-400",
|
|
6750
|
+
children: i + 1
|
|
6751
|
+
}),
|
|
6752
|
+
/* @__PURE__ */ jsx("td", {
|
|
6753
|
+
className: "border border-slate-200 px-2 py-1 font-mono font-bold",
|
|
6754
|
+
children: row.id
|
|
6755
|
+
}),
|
|
6756
|
+
/* @__PURE__ */ jsx("td", {
|
|
6757
|
+
className: "border border-slate-200 px-2 py-1 font-bold uppercase",
|
|
6758
|
+
children: row.name
|
|
6759
|
+
}),
|
|
6760
|
+
/* @__PURE__ */ jsx("td", {
|
|
6761
|
+
className: "border border-slate-200 px-2 py-1",
|
|
6762
|
+
children: row.dept
|
|
6763
|
+
}),
|
|
6764
|
+
/* @__PURE__ */ jsx("td", {
|
|
6765
|
+
className: "border border-slate-200 px-2 py-1",
|
|
6766
|
+
children: row.position
|
|
6767
|
+
}),
|
|
6768
|
+
/* @__PURE__ */ jsx("td", {
|
|
6769
|
+
className: "border border-slate-200 px-2 py-1",
|
|
6770
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
6771
|
+
className: ["inline-flex items-center rounded px-1.5 py-0.5 text-[8px] font-bold uppercase tracking-tight", row.status === "Regular" ? "bg-emerald-50 text-emerald-700" : "bg-amber-50 text-amber-700"].join(" "),
|
|
6772
|
+
children: row.status
|
|
6773
|
+
})
|
|
6774
|
+
}),
|
|
6775
|
+
/* @__PURE__ */ jsx("td", {
|
|
6776
|
+
className: "border border-slate-200 px-2 py-1",
|
|
6777
|
+
children: row.dateHired
|
|
6778
|
+
}),
|
|
6779
|
+
/* @__PURE__ */ jsx("td", {
|
|
6780
|
+
className: "border border-slate-200 px-2 py-1 text-right font-mono",
|
|
6781
|
+
children: row.rate
|
|
6782
|
+
})
|
|
6783
|
+
]
|
|
6784
|
+
}, row.id)) }),
|
|
6785
|
+
/* @__PURE__ */ jsx("tfoot", { children: /* @__PURE__ */ jsxs("tr", {
|
|
6786
|
+
className: "bg-slate-100 font-black border-t-2 border-black",
|
|
6787
|
+
children: [/* @__PURE__ */ jsx("td", {
|
|
6788
|
+
colSpan: 7,
|
|
6789
|
+
className: "border border-slate-300 px-2 py-1.5 text-right uppercase text-[8px] tracking-widest",
|
|
6790
|
+
children: "Total Monthly Cost:"
|
|
6791
|
+
}), /* @__PURE__ */ jsx("td", {
|
|
6792
|
+
className: "border border-slate-300 px-2 py-1.5 text-right font-mono",
|
|
6793
|
+
children: MOCK_ROWS.reduce((s, r) => s + parseFloat(r.rate.replace(/,/g, "")), 0).toLocaleString("en-US", { minimumFractionDigits: 2 })
|
|
6794
|
+
})]
|
|
6795
|
+
}) })
|
|
6796
|
+
]
|
|
6797
|
+
}),
|
|
6798
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6799
|
+
className: "mt-8 flex justify-between items-end text-[9px]",
|
|
6800
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [
|
|
6801
|
+
/* @__PURE__ */ jsx("div", { className: "border-b border-black w-48 mb-1" }),
|
|
6802
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6803
|
+
className: "font-bold",
|
|
6804
|
+
children: ["Prepared by: ", data.preparedBy || "HRIS System"]
|
|
6805
|
+
}),
|
|
6806
|
+
/* @__PURE__ */ jsx("div", {
|
|
6807
|
+
className: "text-slate-400",
|
|
6808
|
+
children: "Human Resources Management Division"
|
|
6809
|
+
})
|
|
6810
|
+
] }), /* @__PURE__ */ jsxs("div", {
|
|
6811
|
+
className: "text-right",
|
|
6812
|
+
children: [
|
|
6813
|
+
/* @__PURE__ */ jsx("div", { className: "border-b border-black w-48 mb-1 ml-auto" }),
|
|
6814
|
+
/* @__PURE__ */ jsx("div", {
|
|
6815
|
+
className: "font-bold",
|
|
6816
|
+
children: "Noted by: ___________________________"
|
|
6817
|
+
}),
|
|
6818
|
+
/* @__PURE__ */ jsx("div", {
|
|
6819
|
+
className: "text-slate-400",
|
|
6820
|
+
children: "HR Director / VP Operations"
|
|
6821
|
+
})
|
|
6822
|
+
]
|
|
6823
|
+
})]
|
|
6824
|
+
}),
|
|
6825
|
+
/* @__PURE__ */ jsx("div", {
|
|
6826
|
+
className: "mt-6 border-t border-dashed border-black/40 pt-2 text-center opacity-40",
|
|
6827
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
6828
|
+
className: "text-[7px] font-black uppercase tracking-[0.2em] italic",
|
|
6829
|
+
children: "System-Generated Report — DIWA HRIS — Confidential"
|
|
6830
|
+
})
|
|
6831
|
+
})
|
|
6832
|
+
]
|
|
6833
|
+
});
|
|
6834
|
+
}
|
|
6835
|
+
//#endregion
|
|
6836
|
+
//#region src/ui-library/gallery/template-samples/templates/TimekeepingTemplate.tsx
|
|
6837
|
+
/**
|
|
6838
|
+
* TimekeepingTemplate — self-contained preview component
|
|
6839
|
+
*
|
|
6840
|
+
* Ported from unified-hris/components/TimekeepingFileTemplate.tsx.
|
|
6841
|
+
* No context deps. All data is mock + prop-driven.
|
|
6842
|
+
*/
|
|
6843
|
+
var RECORDS = [
|
|
6844
|
+
{
|
|
6845
|
+
dateIn: "16-Jan-25",
|
|
6846
|
+
day: "Thu",
|
|
6847
|
+
shift: 1,
|
|
6848
|
+
timeIn: "7:00 am",
|
|
6849
|
+
dateOut: "16-Jan-25",
|
|
6850
|
+
timeOut: "4:00 pm",
|
|
6851
|
+
hours: "8.00",
|
|
6852
|
+
actual: "9.00",
|
|
6853
|
+
late: "-",
|
|
6854
|
+
utime: "-",
|
|
6855
|
+
ot: "-",
|
|
6856
|
+
nd2: "-",
|
|
6857
|
+
rem: "-"
|
|
6858
|
+
},
|
|
6859
|
+
{
|
|
6860
|
+
dateIn: "17-Jan-25",
|
|
6861
|
+
day: "Fri",
|
|
6862
|
+
shift: 1,
|
|
6863
|
+
timeIn: "7:15 am",
|
|
6864
|
+
dateOut: "17-Jan-25",
|
|
6865
|
+
timeOut: "4:00 pm",
|
|
6866
|
+
hours: "8.00",
|
|
6867
|
+
actual: "9.00",
|
|
6868
|
+
late: "15",
|
|
6869
|
+
utime: "-",
|
|
6870
|
+
ot: "-",
|
|
6871
|
+
nd2: "-",
|
|
6872
|
+
rem: "-"
|
|
6873
|
+
},
|
|
6874
|
+
{
|
|
6875
|
+
dateIn: "18-Jan-25",
|
|
6876
|
+
day: "Sat",
|
|
6877
|
+
shift: 1,
|
|
6878
|
+
timeIn: "-",
|
|
6879
|
+
dateOut: "-",
|
|
6880
|
+
timeOut: "-",
|
|
6881
|
+
hours: "-",
|
|
6882
|
+
actual: "-",
|
|
6883
|
+
late: "-",
|
|
6884
|
+
utime: "-",
|
|
6885
|
+
ot: "-",
|
|
6886
|
+
nd2: "-",
|
|
6887
|
+
rem: "-"
|
|
6888
|
+
},
|
|
6889
|
+
{
|
|
6890
|
+
dateIn: "19-Jan-25",
|
|
6891
|
+
day: "Sun",
|
|
6892
|
+
shift: 1,
|
|
6893
|
+
timeIn: "-",
|
|
6894
|
+
dateOut: "-",
|
|
6895
|
+
timeOut: "-",
|
|
6896
|
+
hours: "-",
|
|
6897
|
+
actual: "-",
|
|
6898
|
+
late: "-",
|
|
6899
|
+
utime: "-",
|
|
6900
|
+
ot: "-",
|
|
6901
|
+
nd2: "-",
|
|
6902
|
+
rem: "-"
|
|
6903
|
+
},
|
|
6904
|
+
{
|
|
6905
|
+
dateIn: "20-Jan-25",
|
|
6906
|
+
day: "Mon",
|
|
6907
|
+
shift: 1,
|
|
6908
|
+
timeIn: "7:00 am",
|
|
6909
|
+
dateOut: "20-Jan-25",
|
|
6910
|
+
timeOut: "4:00 pm",
|
|
6911
|
+
hours: "8.00",
|
|
6912
|
+
actual: "9.00",
|
|
6913
|
+
late: "-",
|
|
6914
|
+
utime: "-",
|
|
6915
|
+
ot: "-",
|
|
6916
|
+
nd2: "-",
|
|
6917
|
+
rem: "-"
|
|
6918
|
+
},
|
|
6919
|
+
{
|
|
6920
|
+
dateIn: "21-Jan-25",
|
|
6921
|
+
day: "Tue",
|
|
6922
|
+
shift: 1,
|
|
6923
|
+
timeIn: "7:00 am",
|
|
6924
|
+
dateOut: "21-Jan-25",
|
|
6925
|
+
timeOut: "4:00 pm",
|
|
6926
|
+
hours: "8.00",
|
|
6927
|
+
actual: "9.00",
|
|
6928
|
+
late: "-",
|
|
6929
|
+
utime: "-",
|
|
6930
|
+
ot: "-",
|
|
6931
|
+
nd2: "-",
|
|
6932
|
+
rem: "-"
|
|
6933
|
+
},
|
|
6934
|
+
{
|
|
6935
|
+
dateIn: "22-Jan-25",
|
|
6936
|
+
day: "Wed",
|
|
6937
|
+
shift: 1,
|
|
6938
|
+
timeIn: "7:00 am",
|
|
6939
|
+
dateOut: "22-Jan-25",
|
|
6940
|
+
timeOut: "4:00 pm",
|
|
6941
|
+
hours: "8.00",
|
|
6942
|
+
actual: "9.00",
|
|
6943
|
+
late: "-",
|
|
6944
|
+
utime: "-",
|
|
6945
|
+
ot: "-",
|
|
6946
|
+
nd2: "-",
|
|
6947
|
+
rem: "-"
|
|
6948
|
+
},
|
|
6949
|
+
{
|
|
6950
|
+
dateIn: "23-Jan-25",
|
|
6951
|
+
day: "Thu",
|
|
6952
|
+
shift: 1,
|
|
6953
|
+
timeIn: "7:00 am",
|
|
6954
|
+
dateOut: "23-Jan-25",
|
|
6955
|
+
timeOut: "4:00 pm",
|
|
6956
|
+
hours: "8.00",
|
|
6957
|
+
actual: "9.00",
|
|
6958
|
+
late: "-",
|
|
6959
|
+
utime: "-",
|
|
6960
|
+
ot: "-",
|
|
6961
|
+
nd2: "-",
|
|
6962
|
+
rem: "-"
|
|
6963
|
+
},
|
|
6964
|
+
{
|
|
6965
|
+
dateIn: "24-Jan-25",
|
|
6966
|
+
day: "Fri",
|
|
6967
|
+
shift: 1,
|
|
6968
|
+
timeIn: "7:00 am",
|
|
6969
|
+
dateOut: "24-Jan-25",
|
|
6970
|
+
timeOut: "4:00 pm",
|
|
6971
|
+
hours: "8.00",
|
|
6972
|
+
actual: "9.00",
|
|
6973
|
+
late: "-",
|
|
6974
|
+
utime: "-",
|
|
6975
|
+
ot: "-",
|
|
6976
|
+
nd2: "-",
|
|
6977
|
+
rem: "-"
|
|
6978
|
+
},
|
|
6979
|
+
{
|
|
6980
|
+
dateIn: "25-Jan-25",
|
|
6981
|
+
day: "Sat",
|
|
6982
|
+
shift: 1,
|
|
6983
|
+
timeIn: "-",
|
|
6984
|
+
dateOut: "-",
|
|
6985
|
+
timeOut: "-",
|
|
6986
|
+
hours: "-",
|
|
6987
|
+
actual: "-",
|
|
6988
|
+
late: "-",
|
|
6989
|
+
utime: "-",
|
|
6990
|
+
ot: "-",
|
|
6991
|
+
nd2: "-",
|
|
6992
|
+
rem: "-"
|
|
6993
|
+
},
|
|
6994
|
+
{
|
|
6995
|
+
dateIn: "26-Jan-25",
|
|
6996
|
+
day: "Sun",
|
|
6997
|
+
shift: 1,
|
|
6998
|
+
timeIn: "-",
|
|
6999
|
+
dateOut: "-",
|
|
7000
|
+
timeOut: "-",
|
|
7001
|
+
hours: "-",
|
|
7002
|
+
actual: "-",
|
|
7003
|
+
late: "-",
|
|
7004
|
+
utime: "-",
|
|
7005
|
+
ot: "-",
|
|
7006
|
+
nd2: "-",
|
|
7007
|
+
rem: "-"
|
|
7008
|
+
},
|
|
7009
|
+
{
|
|
7010
|
+
dateIn: "27-Jan-25",
|
|
7011
|
+
day: "Mon",
|
|
7012
|
+
shift: 1,
|
|
7013
|
+
timeIn: "7:00 am",
|
|
7014
|
+
dateOut: "27-Jan-25",
|
|
7015
|
+
timeOut: "4:00 pm",
|
|
7016
|
+
hours: "8.00",
|
|
7017
|
+
actual: "9.00",
|
|
7018
|
+
late: "-",
|
|
7019
|
+
utime: "-",
|
|
7020
|
+
ot: "-",
|
|
7021
|
+
nd2: "-",
|
|
7022
|
+
rem: "-"
|
|
7023
|
+
},
|
|
7024
|
+
{
|
|
7025
|
+
dateIn: "28-Jan-25",
|
|
7026
|
+
day: "Tue",
|
|
7027
|
+
shift: 1,
|
|
7028
|
+
timeIn: "7:00 am",
|
|
7029
|
+
dateOut: "28-Jan-25",
|
|
7030
|
+
timeOut: "4:00 pm",
|
|
7031
|
+
hours: "8.00",
|
|
7032
|
+
actual: "9.00",
|
|
7033
|
+
late: "-",
|
|
7034
|
+
utime: "-",
|
|
7035
|
+
ot: "-",
|
|
7036
|
+
nd2: "-",
|
|
7037
|
+
rem: "-"
|
|
7038
|
+
},
|
|
7039
|
+
{
|
|
7040
|
+
dateIn: "29-Jan-25",
|
|
7041
|
+
day: "Wed",
|
|
7042
|
+
shift: 1,
|
|
7043
|
+
timeIn: "-",
|
|
7044
|
+
dateOut: "-",
|
|
7045
|
+
timeOut: "-",
|
|
7046
|
+
hours: "-",
|
|
7047
|
+
actual: "-",
|
|
7048
|
+
late: "-",
|
|
7049
|
+
utime: "-",
|
|
7050
|
+
ot: "-",
|
|
7051
|
+
nd2: "-",
|
|
7052
|
+
rem: "Sp. Hol"
|
|
7053
|
+
},
|
|
7054
|
+
{
|
|
7055
|
+
dateIn: "30-Jan-25",
|
|
7056
|
+
day: "Thu",
|
|
7057
|
+
shift: 1,
|
|
7058
|
+
timeIn: "7:00 am",
|
|
7059
|
+
dateOut: "30-Jan-25",
|
|
7060
|
+
timeOut: "4:00 pm",
|
|
7061
|
+
hours: "8.00",
|
|
7062
|
+
actual: "9.00",
|
|
7063
|
+
late: "-",
|
|
7064
|
+
utime: "-",
|
|
7065
|
+
ot: "-",
|
|
7066
|
+
nd2: "-",
|
|
7067
|
+
rem: "-"
|
|
7068
|
+
},
|
|
7069
|
+
{
|
|
7070
|
+
dateIn: "31-Jan-25",
|
|
7071
|
+
day: "Fri",
|
|
7072
|
+
shift: 1,
|
|
7073
|
+
timeIn: "7:00 am",
|
|
7074
|
+
dateOut: "31-Jan-25",
|
|
7075
|
+
timeOut: "4:00 pm",
|
|
7076
|
+
hours: "8.00",
|
|
7077
|
+
actual: "9.00",
|
|
7078
|
+
late: "-",
|
|
7079
|
+
utime: "-",
|
|
7080
|
+
ot: "-",
|
|
7081
|
+
nd2: "-",
|
|
7082
|
+
rem: "-"
|
|
7083
|
+
}
|
|
7084
|
+
];
|
|
7085
|
+
var OT_SUMMARY = [
|
|
7086
|
+
"OT 0.30",
|
|
7087
|
+
"OT 1.00",
|
|
7088
|
+
"OT 1.25",
|
|
7089
|
+
"OT 1.30",
|
|
7090
|
+
"OT 1.69",
|
|
7091
|
+
"OT 1.50",
|
|
7092
|
+
"OT 1.95",
|
|
7093
|
+
"OT 2.00",
|
|
7094
|
+
"OT 2.69",
|
|
7095
|
+
"OT 3.38"
|
|
7096
|
+
];
|
|
7097
|
+
function TimekeepingTemplate({ data }) {
|
|
7098
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
7099
|
+
className: "w-[297mm] min-h-[210mm] bg-white text-black font-sans text-[10px] leading-tight p-10 mx-auto",
|
|
7100
|
+
children: [
|
|
7101
|
+
/* @__PURE__ */ jsxs("div", {
|
|
7102
|
+
className: "flex justify-between items-start mb-4",
|
|
7103
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [
|
|
7104
|
+
/* @__PURE__ */ jsxs("div", {
|
|
7105
|
+
className: "mb-2 text-[10px]",
|
|
7106
|
+
children: ["DatePrinted: \xA0 ", (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
|
|
7107
|
+
month: "2-digit",
|
|
7108
|
+
day: "2-digit",
|
|
7109
|
+
year: "numeric"
|
|
7110
|
+
})]
|
|
7111
|
+
}),
|
|
7112
|
+
/* @__PURE__ */ jsx("h1", {
|
|
7113
|
+
className: "text-xl font-bold uppercase tracking-tight",
|
|
7114
|
+
children: "DIWA HRIS — TimeSheet"
|
|
7115
|
+
}),
|
|
7116
|
+
/* @__PURE__ */ jsx("div", {
|
|
7117
|
+
className: "mt-4 flex gap-8",
|
|
7118
|
+
children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
|
|
7119
|
+
className: "flex gap-2",
|
|
7120
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
7121
|
+
className: "w-16",
|
|
7122
|
+
children: "Emp. ID:"
|
|
7123
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
7124
|
+
className: "font-bold",
|
|
7125
|
+
children: data.employee.empId || "DL250814-002"
|
|
7126
|
+
})]
|
|
7127
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
7128
|
+
className: "flex gap-2",
|
|
7129
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
7130
|
+
className: "w-16",
|
|
7131
|
+
children: "Name:"
|
|
7132
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
7133
|
+
className: "font-bold uppercase",
|
|
7134
|
+
children: data.employee.name
|
|
7135
|
+
})]
|
|
7136
|
+
})] })
|
|
7137
|
+
})
|
|
7138
|
+
] }), /* @__PURE__ */ jsxs("div", {
|
|
7139
|
+
className: "text-right",
|
|
7140
|
+
children: [
|
|
7141
|
+
/* @__PURE__ */ jsx("div", {
|
|
7142
|
+
className: "mb-1",
|
|
7143
|
+
children: "Page 1 of 1"
|
|
7144
|
+
}),
|
|
7145
|
+
/* @__PURE__ */ jsx("div", {
|
|
7146
|
+
className: "font-bold text-sm mb-2",
|
|
7147
|
+
children: data.period || "01/16/2025 – 01/31/2025"
|
|
7148
|
+
}),
|
|
7149
|
+
/* @__PURE__ */ jsxs("div", {
|
|
7150
|
+
className: "grid grid-cols-[80px_1fr] gap-x-2 text-left",
|
|
7151
|
+
children: [
|
|
7152
|
+
/* @__PURE__ */ jsx("span", { children: "Shift:" }),
|
|
7153
|
+
/* @__PURE__ */ jsx("span", {
|
|
7154
|
+
className: "font-bold",
|
|
7155
|
+
children: "1"
|
|
7156
|
+
}),
|
|
7157
|
+
/* @__PURE__ */ jsx("span", { children: "Position:" }),
|
|
7158
|
+
/* @__PURE__ */ jsx("span", {
|
|
7159
|
+
className: "font-bold",
|
|
7160
|
+
children: data.employee.role
|
|
7161
|
+
}),
|
|
7162
|
+
/* @__PURE__ */ jsx("span", { children: "Department:" }),
|
|
7163
|
+
/* @__PURE__ */ jsx("span", {
|
|
7164
|
+
className: "font-bold",
|
|
7165
|
+
children: data.employee.department
|
|
7166
|
+
}),
|
|
7167
|
+
/* @__PURE__ */ jsx("span", { children: "Imm. Superior:" }),
|
|
7168
|
+
/* @__PURE__ */ jsx("span", {
|
|
7169
|
+
className: "font-bold",
|
|
7170
|
+
children: data.employee.supervisor || "ACGarcia"
|
|
7171
|
+
})
|
|
7172
|
+
]
|
|
7173
|
+
})
|
|
7174
|
+
]
|
|
7175
|
+
})]
|
|
7176
|
+
}),
|
|
7177
|
+
/* @__PURE__ */ jsx("div", {
|
|
7178
|
+
className: "border-t border-b border-black mb-1",
|
|
7179
|
+
children: /* @__PURE__ */ jsxs("table", {
|
|
7180
|
+
className: "w-full text-center border-collapse",
|
|
7181
|
+
children: [
|
|
7182
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", {
|
|
7183
|
+
className: "border-b border-black",
|
|
7184
|
+
children: [
|
|
7185
|
+
"DateIn",
|
|
7186
|
+
"Day",
|
|
7187
|
+
"Shift",
|
|
7188
|
+
"TimeIn",
|
|
7189
|
+
"DateOut",
|
|
7190
|
+
"TimeOut",
|
|
7191
|
+
"Hours",
|
|
7192
|
+
"Actual",
|
|
7193
|
+
"Late",
|
|
7194
|
+
"Utime",
|
|
7195
|
+
"OT",
|
|
7196
|
+
"ND2",
|
|
7197
|
+
"Rem."
|
|
7198
|
+
].map((h) => /* @__PURE__ */ jsx("th", {
|
|
7199
|
+
className: "py-1 text-[9px]",
|
|
7200
|
+
children: h
|
|
7201
|
+
}, h))
|
|
7202
|
+
}) }),
|
|
7203
|
+
/* @__PURE__ */ jsx("tbody", { children: RECORDS.map((r, i) => /* @__PURE__ */ jsxs("tr", {
|
|
7204
|
+
className: "h-4",
|
|
7205
|
+
children: [
|
|
7206
|
+
/* @__PURE__ */ jsx("td", { children: r.dateIn }),
|
|
7207
|
+
/* @__PURE__ */ jsx("td", { children: r.day }),
|
|
7208
|
+
/* @__PURE__ */ jsx("td", { children: r.shift }),
|
|
7209
|
+
/* @__PURE__ */ jsx("td", { children: r.timeIn }),
|
|
7210
|
+
/* @__PURE__ */ jsx("td", { children: r.dateOut }),
|
|
7211
|
+
/* @__PURE__ */ jsx("td", { children: r.timeOut }),
|
|
7212
|
+
/* @__PURE__ */ jsx("td", { children: r.hours }),
|
|
7213
|
+
/* @__PURE__ */ jsx("td", { children: r.actual }),
|
|
7214
|
+
/* @__PURE__ */ jsx("td", { children: r.late }),
|
|
7215
|
+
/* @__PURE__ */ jsx("td", { children: r.utime }),
|
|
7216
|
+
/* @__PURE__ */ jsx("td", { children: r.ot }),
|
|
7217
|
+
/* @__PURE__ */ jsx("td", { children: r.nd2 }),
|
|
7218
|
+
/* @__PURE__ */ jsx("td", { children: r.rem })
|
|
7219
|
+
]
|
|
7220
|
+
}, i)) }),
|
|
7221
|
+
/* @__PURE__ */ jsx("tfoot", { children: /* @__PURE__ */ jsxs("tr", {
|
|
7222
|
+
className: "border-t border-black font-bold",
|
|
7223
|
+
children: [
|
|
7224
|
+
/* @__PURE__ */ jsx("td", {
|
|
7225
|
+
colSpan: 6,
|
|
7226
|
+
className: "text-left py-1 pl-2",
|
|
7227
|
+
children: "Totals: ( 11 WorkDays )"
|
|
7228
|
+
}),
|
|
7229
|
+
/* @__PURE__ */ jsx("td", { children: "88.00" }),
|
|
7230
|
+
/* @__PURE__ */ jsx("td", { children: "99.00" }),
|
|
7231
|
+
/* @__PURE__ */ jsx("td", { children: "0.00" }),
|
|
7232
|
+
/* @__PURE__ */ jsx("td", { children: "0.00" }),
|
|
7233
|
+
/* @__PURE__ */ jsx("td", { children: "0.00" }),
|
|
7234
|
+
/* @__PURE__ */ jsx("td", { children: "0.00" }),
|
|
7235
|
+
/* @__PURE__ */ jsx("td", {})
|
|
7236
|
+
]
|
|
7237
|
+
}) })
|
|
7238
|
+
]
|
|
7239
|
+
})
|
|
7240
|
+
}),
|
|
7241
|
+
/* @__PURE__ */ jsx("div", {
|
|
7242
|
+
className: "flex justify-end mb-6 font-bold text-[10px]",
|
|
7243
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
7244
|
+
className: "text-right w-[120px]",
|
|
7245
|
+
children: [
|
|
7246
|
+
"Employment Status:",
|
|
7247
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
7248
|
+
"Regular",
|
|
7249
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
7250
|
+
"Monthly",
|
|
7251
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
7252
|
+
"Rest Day: Sunday"
|
|
7253
|
+
]
|
|
7254
|
+
})
|
|
7255
|
+
}),
|
|
7256
|
+
/* @__PURE__ */ jsxs("div", {
|
|
7257
|
+
className: "text-center mb-10 px-12",
|
|
7258
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
7259
|
+
className: "mb-1",
|
|
7260
|
+
children: "I hereby certify that the above records are true and correct. Any"
|
|
7261
|
+
}), /* @__PURE__ */ jsx("p", { children: "unauthorized overtime will not be paid by the management." })]
|
|
7262
|
+
}),
|
|
7263
|
+
/* @__PURE__ */ jsxs("div", {
|
|
7264
|
+
className: "flex justify-between px-16 mb-10",
|
|
7265
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
7266
|
+
className: "text-center w-48",
|
|
7267
|
+
children: [/* @__PURE__ */ jsx("div", { className: "border-b border-black mb-1" }), /* @__PURE__ */ jsx("div", { children: "Employee Signature" })]
|
|
7268
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
7269
|
+
className: "text-center w-48",
|
|
7270
|
+
children: [/* @__PURE__ */ jsx("div", { className: "border-b border-black mb-1" }), /* @__PURE__ */ jsx("div", { children: "Immediate Superior" })]
|
|
7271
|
+
})]
|
|
7272
|
+
}),
|
|
7273
|
+
/* @__PURE__ */ jsx("div", {
|
|
7274
|
+
className: "text-center mb-2",
|
|
7275
|
+
children: "For HRD use only, please do not tamper with."
|
|
7276
|
+
}),
|
|
7277
|
+
/* @__PURE__ */ jsxs("div", {
|
|
7278
|
+
className: "border-t border-black pt-2 flex justify-between items-start mb-6",
|
|
7279
|
+
children: [
|
|
7280
|
+
/* @__PURE__ */ jsx("div", {
|
|
7281
|
+
className: "grid grid-cols-[90px_60px] gap-y-0.5",
|
|
7282
|
+
children: [
|
|
7283
|
+
["Days Worked:", "11.00"],
|
|
7284
|
+
["Hours Worked:", "88.00"],
|
|
7285
|
+
["Absences:", "1.00"],
|
|
7286
|
+
["", ""],
|
|
7287
|
+
["Tardiness:", "0.00"],
|
|
7288
|
+
["Reg. ND1", "0.00"],
|
|
7289
|
+
["Reg. ND2", "0.00"],
|
|
7290
|
+
["Holiday", "1.00"],
|
|
7291
|
+
["", ""],
|
|
7292
|
+
["Undertime:", "0.00"]
|
|
7293
|
+
].map(([k, v], i) => /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx("span", { children: k }), /* @__PURE__ */ jsx("span", {
|
|
7294
|
+
className: "text-right",
|
|
7295
|
+
children: v
|
|
7296
|
+
})] }, i))
|
|
7297
|
+
}),
|
|
7298
|
+
/* @__PURE__ */ jsxs("div", {
|
|
7299
|
+
className: "w-1/3",
|
|
7300
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
7301
|
+
className: "flex border-b border-black pb-0.5 mb-1",
|
|
7302
|
+
children: [
|
|
7303
|
+
/* @__PURE__ */ jsx("span", {
|
|
7304
|
+
className: "underline mr-auto",
|
|
7305
|
+
children: "Summary:"
|
|
7306
|
+
}),
|
|
7307
|
+
/* @__PURE__ */ jsx("span", {
|
|
7308
|
+
className: "w-10 text-center underline",
|
|
7309
|
+
children: "10%"
|
|
7310
|
+
}),
|
|
7311
|
+
/* @__PURE__ */ jsx("span", {
|
|
7312
|
+
className: "w-10 text-center underline",
|
|
7313
|
+
children: "15%"
|
|
7314
|
+
})
|
|
7315
|
+
]
|
|
7316
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
7317
|
+
className: "grid grid-cols-1 gap-y-0.5 pl-2",
|
|
7318
|
+
children: OT_SUMMARY.map((ot) => /* @__PURE__ */ jsx("div", { children: ot }, ot))
|
|
7319
|
+
})]
|
|
7320
|
+
}),
|
|
7321
|
+
/* @__PURE__ */ jsx("div", {
|
|
7322
|
+
className: "grid grid-cols-[90px_30px] gap-y-0.5 text-right",
|
|
7323
|
+
children: [
|
|
7324
|
+
["VL Bal :", "10"],
|
|
7325
|
+
["SL Bal :", "14"],
|
|
7326
|
+
["VL w/ Pay :", "0"],
|
|
7327
|
+
["VL w/o Pay :", "0"],
|
|
7328
|
+
["Prev.VL w/ Pay :", "0"],
|
|
7329
|
+
["SL w/ Pay :", "0"],
|
|
7330
|
+
["SL w/o Pay :", "0"],
|
|
7331
|
+
["PL Taken :", "0"],
|
|
7332
|
+
["BL Taken :", "0"],
|
|
7333
|
+
["Meal Allow. :", "0"]
|
|
7334
|
+
].map(([k, v], i) => /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx("span", { children: k }), /* @__PURE__ */ jsx("span", { children: v })] }, i))
|
|
7335
|
+
})
|
|
7336
|
+
]
|
|
7337
|
+
}),
|
|
7338
|
+
/* @__PURE__ */ jsx("div", { className: "border-t border-black/50 border-dashed pt-2" })
|
|
7339
|
+
]
|
|
7340
|
+
});
|
|
7341
|
+
}
|
|
7342
|
+
//#endregion
|
|
4625
7343
|
//#region src/ui-library/gallery/stat-card/Statistic.tsx
|
|
4626
7344
|
/**
|
|
4627
7345
|
* Statistic — Design System Component
|
|
@@ -4750,12 +7468,12 @@ var DOT_STYLES = {
|
|
|
4750
7468
|
shadow: "0 0 0 3px rgba(239,68,68,0.18)"
|
|
4751
7469
|
},
|
|
4752
7470
|
inactive: {
|
|
4753
|
-
bg: "#
|
|
4754
|
-
shadow: "0 0 0 3px rgba(
|
|
7471
|
+
bg: "#b45309",
|
|
7472
|
+
shadow: "0 0 0 3px rgba(180,83,9,0.18)"
|
|
4755
7473
|
},
|
|
4756
7474
|
pending: {
|
|
4757
|
-
bg: "#
|
|
4758
|
-
shadow: "0 0 0 3px rgba(
|
|
7475
|
+
bg: "#0284c7",
|
|
7476
|
+
shadow: "0 0 0 3px rgba(2,132,199,0.18)"
|
|
4759
7477
|
}
|
|
4760
7478
|
};
|
|
4761
7479
|
function StatusDot({ status, label, className = "" }) {
|
|
@@ -4968,4 +7686,4 @@ var shadow = {
|
|
|
4968
7686
|
overlay: "shadow-xl"
|
|
4969
7687
|
};
|
|
4970
7688
|
//#endregion
|
|
4971
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityFeed, Alert, ApprovalTimeline, Avatar, Badge, BarChart, Breadcrumb, Button, Calendar, Card, CardContent, CardFooter, CardHeader, Checkbox, Combobox, CommandPalette, ConfirmAction, ConfirmDialog, DatePicker, DescriptionItem, DescriptionList, Dialog, DialogBody, DialogFooter, Divider, Drawer, Dropdown, EmployeeCard, EmptyState, ErrorBanner, Field, FieldContext, FieldInput, FileUpload, FilterChip, Heatmap, IconButton, Input, Kanban, LineChart, Menu, Modal, OtpInput, PageHeader, Pagination, PermissionMatrix, Popover, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioItem, Section, SegmentedControl, Select, SidebarGroup, SidebarItem, SidebarNav, SidebarSection, Skeleton, SkeletonAvatar, SkeletonCard, SkeletonTableRow, SkeletonText, Spinner, Statistic, StatusBadge, StatusDot, Stepper, Switch, Tab, TabList, TabPanel, TabPanels, Tabs, Textarea, Timeline, TimelineEmptyState, TimelineFooter, TimelineItem, TimelineValueCard, Toaster, Toolbar, Tooltip, TreeView, ValidationSummary, colors_exports as colors, dimension_exports as dimension, radius_exports as radius, shadow_exports as shadow, statusMenuItems, toast, typography_exports as typography, useFieldContext };
|
|
7689
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityFeed, Alert, ApprovalTimeline, AreaChart, Avatar, Badge, BarChart, BarList, Breadcrumb, Button, CHART_PALETTE, Calendar, Card, CardContent, CardFooter, CardHeader, Checkbox, Combobox, CommandPalette, ConfirmAction, ConfirmDialog, DatePicker, DescriptionItem, DescriptionList, Dialog, DialogBody, DialogFooter, Divider, Drawer, Dropdown, EmployeeCard, EmptyState, ErrorBanner, Field, FieldContext, FieldInput, FileUpload, FilterChip, Heatmap, IconButton, Input, IsoCubeBlock, Kanban, LineChart, Menu, Modal, OrgChart, OrgUnitTree, OtpInput, PafTemplate, PageHeader, Pagination, PayslipTemplate, PermissionMatrix, Popover, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioItem, ReportTemplate, STATUS_PAGE_PRESETS, Section, SegmentedControl, Select, SidebarGroup, SidebarItem, SidebarNav, SidebarSection, Skeleton, SkeletonAvatar, SkeletonCard, SkeletonTableRow, SkeletonText, Spinner, Statistic, StatusBadge, StatusDot, StatusPage, Stepper, Switch, Tab, TabList, TabPanel, TabPanels, Tabs, Textarea, TimekeepingTemplate, Timeline, TimelineEmptyState, TimelineFooter, TimelineItem, TimelineValueCard, Toaster, Toolbar, Tooltip, TreeView, ValidationSummary, colors_exports as colors, dimension_exports as dimension, radius_exports as radius, shadow_exports as shadow, statusMenuItems, toast, typography_exports as typography, useFieldContext };
|