@appcorp/fusion-storybook 0.3.49 → 0.3.51

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.
@@ -14,7 +14,7 @@ import { ADMISSION_STATUS, GENDER, } from "../../../type";
14
14
  import { ADMISSION_API_ROUTES, DISCOUNT_CODE_API_ROUTES, } from "../../../constants";
15
15
  import { admissionFormValidation } from "../validate";
16
16
  import { getCachedWorkspaceSync } from "../../workspace/cache";
17
- import { generateAdmissionReceiptPDF, } from "../../../utils/admission-pdf";
17
+ import { downloadAdmissionFormPDF, } from "../../../utils/admission-pdf";
18
18
  import { normalizeIdNumber } from "../../../utils/id-number";
19
19
  import { toE164Phone } from "../../../utils/to-e164-phone";
20
20
  import { formatPhoneDisplay } from "@react-pakistan/util-functions/general/format-phone-display";
@@ -469,7 +469,7 @@ export const useAdmissionModule = () => {
469
469
  admissionStatus: admissionDetails.admissionStatus,
470
470
  logo: logoBase64.base64,
471
471
  };
472
- await generateAdmissionReceiptPDF(pdfData);
472
+ await downloadAdmissionFormPDF(pdfData);
473
473
  }
474
474
  catch (_h) {
475
475
  showToast(t("messagesPrintFailed"), TOAST_VARIANT.ERROR);
@@ -48,7 +48,7 @@ export const AdmissionFilter = () => {
48
48
  });
49
49
  },
50
50
  });
51
- return (_jsx("div", { className: "space-y-4", children: _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [filterAdmissionStatusCombo, _jsxs("div", { children: [_jsx("label", { htmlFor: "startDate", className: "text-foreground mb-1 block text-sm font-medium", children: t("drawerFilterStartDateLabel") }), _jsx("input", { id: "startDate", type: "date", value: filterStartDate || "", onChange: (e) => handleSetStartDate(e.target.value), className: "border-input bg-background text-foreground focus:ring-ring w-full rounded-md border px-3 py-2 focus:border-transparent focus:ring-2 focus:outline-none" })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "endDate", className: "text-foreground mb-1 block text-sm font-medium", children: t("drawerFilterEndDateLabel") }), _jsx("input", { id: "endDate", type: "date", value: filterEndDate || "", onChange: (e) => handleSetEndDate(e.target.value), className: "border-input bg-background text-foreground focus:ring-ring w-full rounded-md border px-3 py-2 focus:border-transparent focus:ring-2 focus:outline-none" })] }), _jsx(EnhancedRadio, { label: t("filterOptionEnabled"), name: "filterEnabled", value: filterEnabledValue, options: [
51
+ return (_jsx("div", { className: "space-y-4", children: _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [filterAdmissionStatusCombo, _jsxs("div", { children: [_jsx("label", { htmlFor: "startDate", className: "text-foreground mb-1 block text-sm font-medium", children: t("drawerFilterStartDateLabel") }), _jsx("input", { id: "startDate", type: "date", value: filterStartDate || "", onChange: (e) => handleSetStartDate(e.target.value), onClick: (e) => { var _a, _b; return (_b = (_a = e.currentTarget).showPicker) === null || _b === void 0 ? void 0 : _b.call(_a); }, className: "border-input bg-background text-foreground focus:ring-ring w-full rounded-md border px-3 py-2 focus:border-transparent focus:ring-2 focus:outline-none" })] }), _jsxs("div", { children: [_jsx("label", { htmlFor: "endDate", className: "text-foreground mb-1 block text-sm font-medium", children: t("drawerFilterEndDateLabel") }), _jsx("input", { id: "endDate", type: "date", value: filterEndDate || "", onChange: (e) => handleSetEndDate(e.target.value), onClick: (e) => { var _a, _b; return (_b = (_a = e.currentTarget).showPicker) === null || _b === void 0 ? void 0 : _b.call(_a); }, className: "border-input bg-background text-foreground focus:ring-ring w-full rounded-md border px-3 py-2 focus:border-transparent focus:ring-2 focus:outline-none" })] }), _jsx(EnhancedRadio, { label: t("filterOptionEnabled"), name: "filterEnabled", value: filterEnabledValue, options: [
52
52
  { label: t("filterOptionAll"), value: "undefined" },
53
53
  { label: t("filterOptionEnabled"), value: "true" },
54
54
  { label: t("filterOptionDisabled"), value: "false" },
@@ -131,5 +131,5 @@ export const AdmissionForm = () => {
131
131
  }
132
132
  // eslint-disable-next-line react-hooks/exhaustive-deps
133
133
  }, [id, dispatch]);
134
- return (_jsxs("div", { className: "grid grid-cols-1 gap-2 space-y-2", children: [_jsx("h4", { className: "m-0 p-0", children: t("formSectionStudentInformation") }), _jsxs("div", { className: "grid grid-cols-5 gap-4", children: [_jsx(EnhancedInput, { error: errors.firstName, id: "firstName", info: t("formFirstNameInfo"), label: t("formFirstNameLabel"), onChange: (e) => handleChange("firstName", e.target.value), placeholder: t("formFirstNamePlaceholder"), required: true, type: "text", value: firstName || "" }), _jsx(EnhancedInput, { error: errors.lastName, id: "lastName", info: t("formLastNameInfo"), label: t("formLastNameLabel"), onChange: (e) => handleChange("lastName", e.target.value), placeholder: t("formLastNamePlaceholder"), required: true, type: "text", value: lastName || "" }), _jsx(EnhancedInput, { error: errors.studentIdNumber, id: "studentIdNumber", info: t("formStudentIdNumberInfo"), label: t("formStudentIdNumberLabel"), onChange: (e) => handleChange("studentIdNumber", e.target.value), placeholder: t("formStudentIdNumberPlaceholder"), required: true, type: "text", value: studentIdNumber || "" }), genderCombo, _jsx(EnhancedInput, { error: errors.dob, id: "dob", info: t("formDobInfo"), label: t("formDobLabel"), onChange: (e) => handleChange("dob", e.target.value), placeholder: t("formDobPlaceholder"), required: true, type: "date", value: dob || "" }), _jsx(EnhancedInput, { error: errors.registrationCode, id: "registrationCode", info: t("formRegistrationCodeInfo"), label: t("formRegistrationCodeLabel"), onChange: (e) => handleChange("registrationCode", e.target.value), placeholder: t("formRegistrationCodePlaceholder"), required: true, type: "text", value: registrationCode || "", disabled: true }), discountCodeCombo, _jsx(EnhancedCheckbox, { label: t("formHafizLabel"), id: "hafiz", info: t("formHafizInfo"), onCheckedChange: (checked) => handleChange("hafiz", checked) }), _jsx(EnhancedCheckbox, { label: t("formOrphanLabel"), id: "orphan", info: t("formOrphanInfo"), onCheckedChange: (checked) => handleChange("orphan", checked) })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("formSectionFatherInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedInput, { error: errors.fatherFirstName, id: "fatherFirstName", info: t("formFatherFirstNameInfo"), label: t("formFirstNameLabel"), onChange: (e) => handleChange("fatherFirstName", e.target.value), placeholder: t("formFirstNamePlaceholder"), required: true, type: "text", value: fatherFirstName || "" }), _jsx(EnhancedInput, { error: errors.fatherLastName, id: "fatherLastName", info: t("formFatherLastNameInfo"), label: t("formLastNameLabel"), onChange: (e) => handleChange("fatherLastName", e.target.value), placeholder: t("formLastNamePlaceholder"), required: true, type: "text", value: fatherLastName || "" }), _jsx(EnhancedInput, { error: errors.fatherIdNumber, id: "fatherIdNumber", info: t("formFatherIdNumberInfo"), label: t("formIdNumberLabel"), onChange: (e) => handleChange("fatherIdNumber", e.target.value), placeholder: t("formIdNumberPlaceholder"), required: true, type: "text", value: fatherIdNumber || "" }), _jsx(EnhancedInput, { error: errors.fatherMobile, id: "fatherMobile", info: t("formFatherMobileInfo"), label: t("formMobileLabel"), onChange: (e) => handleChange("fatherMobile", e.target.value), placeholder: "+923001234567", required: true, type: "text", value: fatherMobile || "" }), _jsx(EnhancedInput, { error: errors.fatherOccupation, id: "fatherOccupation", info: t("formFatherOccupationInfo"), label: t("formOccupationLabel"), onChange: (e) => handleChange("fatherOccupation", e.target.value), placeholder: t("formOccupationPlaceholder"), required: false, type: "text", value: fatherOccupation || "" }), _jsx(EnhancedInput, { error: errors.fatherOrganization, id: "fatherOrganization", info: t("formFatherOrganizationInfo"), label: t("formOrganizationLabel"), onChange: (e) => handleChange("fatherOrganization", e.target.value), placeholder: t("formOrganizationPlaceholder"), required: false, type: "text", value: fatherOrganization || "" }), _jsx(EnhancedCheckbox, { label: t("formEmergencyContactLabel"), id: "emergencyContactFather", info: t("formFatherEmergencyContactInfo"), checked: emergencyContact === "Father", onCheckedChange: (checked) => handleChange("emergencyContact", checked ? "Father" : "") })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("formSectionMotherInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedInput, { error: errors.motherFirstName, id: "motherFirstName", info: t("formMotherFirstNameInfo"), label: t("formFirstNameLabel"), onChange: (e) => handleChange("motherFirstName", e.target.value), placeholder: t("formFirstNamePlaceholder"), required: true, type: "text", value: motherFirstName || "" }), _jsx(EnhancedInput, { error: errors.motherLastName, id: "motherLastName", info: t("formMotherLastNameInfo"), label: t("formLastNameLabel"), onChange: (e) => handleChange("motherLastName", e.target.value), placeholder: t("formLastNamePlaceholder"), required: true, type: "text", value: motherLastName || "" }), _jsx(EnhancedInput, { error: errors.motherIdNumber, id: "motherIdNumber", info: t("formMotherIdNumberInfo"), label: t("formIdNumberLabel"), onChange: (e) => handleChange("motherIdNumber", e.target.value), placeholder: t("formIdNumberPlaceholder"), required: true, type: "text", value: motherIdNumber || "" }), _jsx(EnhancedInput, { error: errors.motherMobile, id: "motherMobile", info: t("formMotherMobileInfo"), label: t("formMobileLabel"), onChange: (e) => handleChange("motherMobile", e.target.value), placeholder: "+923001234567", required: true, type: "text", value: motherMobile || "" }), _jsx(EnhancedCheckbox, { label: t("formEmergencyContactLabel"), id: "emergencyContactMother", info: t("formMotherEmergencyContactInfo"), checked: emergencyContact === "Mother", onCheckedChange: (checked) => handleChange("emergencyContact", checked ? "Mother" : "") })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("formSectionHomeInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedTextarea, { error: errors.address, id: "homeAddress", info: t("formHomeAddressInfo"), label: t("formHomeAddressLabel"), onChange: (e) => handleChange("address", e.target.value), placeholder: t("formHomeAddressPlaceholder"), required: true, rows: 2, value: address || "" }), _jsx(EnhancedInput, { error: errors.city, id: "city", info: t("formCityInfo"), label: t("formCityLabel"), onChange: (e) => handleChange("city", e.target.value), placeholder: t("formCityPlaceholder"), required: true, type: "text", value: city || "" }), _jsx(EnhancedInput, { error: errors.state, id: "state", info: t("formStateInfo"), label: t("formStateLabel"), onChange: (e) => handleChange("state", e.target.value), placeholder: t("formStatePlaceholder"), required: true, type: "text", value: provinceState || "" }), _jsx(EnhancedInput, { error: errors.country, id: "country", info: t("formCountryInfo"), label: t("formCountryLabel"), onChange: (e) => handleChange("country", e.target.value), placeholder: t("formCountryPlaceholder"), required: true, type: "text", value: country || "" })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("formSectionAdmissionInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedInput, { error: errors.classForAdmission, id: "classForAdmission", info: t("formClassForAdmissionInfo"), label: t("formClassForAdmissionLabel"), onChange: (e) => handleChange("classForAdmission", e.target.value), placeholder: t("formClassForAdmissionPlaceholder"), required: true, type: "text", value: classForAdmission || "" }), _jsx(EnhancedInput, { error: errors.previousSchool, id: "previousSchool", info: t("formPreviousSchoolInfo"), label: t("formPreviousSchoolLabel"), onChange: (e) => handleChange("previousSchool", e.target.value), placeholder: t("formPreviousSchoolPlaceholder"), type: "text", value: previousSchool || "" }), _jsx(EnhancedTextarea, { error: errors.siblings, id: "siblings", info: t("formSiblingsInfo"), label: t("formSiblingsLabel"), onChange: (e) => handleChange("siblings", e.target.value), placeholder: t("formSiblingsPlaceholder"), rows: 3, value: siblings || "" })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("formSectionOfficeUse") }), _jsxs("div", { className: "grid grid-cols-4 gap-4", children: [_jsx(EnhancedTextarea, { error: errors.notes, id: "notes", info: t("formNotesInfo"), label: t("formNotesLabel"), onChange: (e) => handleChange("notes", e.target.value), placeholder: t("formNotesPlaceholder"), rows: 3, value: notes || "" }), _jsx(EnhancedTextarea, { error: errors.admissionNotes, id: "admissionNotes", info: t("formAdmissionNotesInfo"), label: t("formAdmissionNotesLabel"), onChange: (e) => handleChange("admissionNotes", e.target.value), placeholder: t("formAdmissionNotesPlaceholder"), rows: 3, value: admissionNotes || "" })] })] }));
134
+ return (_jsxs("div", { className: "grid grid-cols-1 gap-2 space-y-2", children: [_jsx("h4", { className: "m-0 p-0", children: t("formSectionStudentInformation") }), _jsxs("div", { className: "grid grid-cols-5 gap-4", children: [_jsx(EnhancedInput, { error: errors.firstName, id: "firstName", info: t("formFirstNameInfo"), label: t("formFirstNameLabel"), onChange: (e) => handleChange("firstName", e.target.value), placeholder: t("formFirstNamePlaceholder"), required: true, type: "text", value: firstName || "" }), _jsx(EnhancedInput, { error: errors.lastName, id: "lastName", info: t("formLastNameInfo"), label: t("formLastNameLabel"), onChange: (e) => handleChange("lastName", e.target.value), placeholder: t("formLastNamePlaceholder"), required: true, type: "text", value: lastName || "" }), _jsx(EnhancedInput, { error: errors.studentIdNumber, id: "studentIdNumber", info: t("formStudentIdNumberInfo"), label: t("formStudentIdNumberLabel"), onChange: (e) => handleChange("studentIdNumber", e.target.value), placeholder: t("formStudentIdNumberPlaceholder"), required: true, type: "text", value: studentIdNumber || "" }), genderCombo, _jsx(EnhancedInput, { error: errors.dob, id: "dob", info: t("formDobInfo"), label: t("formDobLabel"), onChange: (e) => handleChange("dob", e.target.value), onClick: (e) => { var _a, _b; return (_b = (_a = e.currentTarget).showPicker) === null || _b === void 0 ? void 0 : _b.call(_a); }, placeholder: t("formDobPlaceholder"), required: true, type: "date", value: dob || "" }), _jsx(EnhancedInput, { error: errors.registrationCode, id: "registrationCode", info: t("formRegistrationCodeInfo"), label: t("formRegistrationCodeLabel"), onChange: (e) => handleChange("registrationCode", e.target.value), placeholder: t("formRegistrationCodePlaceholder"), required: true, type: "text", value: registrationCode || "", disabled: true }), discountCodeCombo, _jsx(EnhancedCheckbox, { label: t("formHafizLabel"), id: "hafiz", info: t("formHafizInfo"), onCheckedChange: (checked) => handleChange("hafiz", checked) }), _jsx(EnhancedCheckbox, { label: t("formOrphanLabel"), id: "orphan", info: t("formOrphanInfo"), onCheckedChange: (checked) => handleChange("orphan", checked) })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("formSectionFatherInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedInput, { error: errors.fatherFirstName, id: "fatherFirstName", info: t("formFatherFirstNameInfo"), label: t("formFirstNameLabel"), onChange: (e) => handleChange("fatherFirstName", e.target.value), placeholder: t("formFirstNamePlaceholder"), required: true, type: "text", value: fatherFirstName || "" }), _jsx(EnhancedInput, { error: errors.fatherLastName, id: "fatherLastName", info: t("formFatherLastNameInfo"), label: t("formLastNameLabel"), onChange: (e) => handleChange("fatherLastName", e.target.value), placeholder: t("formLastNamePlaceholder"), required: true, type: "text", value: fatherLastName || "" }), _jsx(EnhancedInput, { error: errors.fatherIdNumber, id: "fatherIdNumber", info: t("formFatherIdNumberInfo"), label: t("formIdNumberLabel"), onChange: (e) => handleChange("fatherIdNumber", e.target.value), placeholder: t("formIdNumberPlaceholder"), required: true, type: "text", value: fatherIdNumber || "" }), _jsx(EnhancedInput, { error: errors.fatherMobile, id: "fatherMobile", info: t("formFatherMobileInfo"), label: t("formMobileLabel"), onChange: (e) => handleChange("fatherMobile", e.target.value), placeholder: "+923001234567", required: true, type: "text", value: fatherMobile || "" }), _jsx(EnhancedInput, { error: errors.fatherOccupation, id: "fatherOccupation", info: t("formFatherOccupationInfo"), label: t("formOccupationLabel"), onChange: (e) => handleChange("fatherOccupation", e.target.value), placeholder: t("formOccupationPlaceholder"), required: false, type: "text", value: fatherOccupation || "" }), _jsx(EnhancedInput, { error: errors.fatherOrganization, id: "fatherOrganization", info: t("formFatherOrganizationInfo"), label: t("formOrganizationLabel"), onChange: (e) => handleChange("fatherOrganization", e.target.value), placeholder: t("formOrganizationPlaceholder"), required: false, type: "text", value: fatherOrganization || "" }), _jsx(EnhancedCheckbox, { label: t("formEmergencyContactLabel"), id: "emergencyContactFather", info: t("formFatherEmergencyContactInfo"), checked: emergencyContact === "Father", onCheckedChange: (checked) => handleChange("emergencyContact", checked ? "Father" : "") })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("formSectionMotherInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedInput, { error: errors.motherFirstName, id: "motherFirstName", info: t("formMotherFirstNameInfo"), label: t("formFirstNameLabel"), onChange: (e) => handleChange("motherFirstName", e.target.value), placeholder: t("formFirstNamePlaceholder"), required: true, type: "text", value: motherFirstName || "" }), _jsx(EnhancedInput, { error: errors.motherLastName, id: "motherLastName", info: t("formMotherLastNameInfo"), label: t("formLastNameLabel"), onChange: (e) => handleChange("motherLastName", e.target.value), placeholder: t("formLastNamePlaceholder"), required: true, type: "text", value: motherLastName || "" }), _jsx(EnhancedInput, { error: errors.motherIdNumber, id: "motherIdNumber", info: t("formMotherIdNumberInfo"), label: t("formIdNumberLabel"), onChange: (e) => handleChange("motherIdNumber", e.target.value), placeholder: t("formIdNumberPlaceholder"), required: true, type: "text", value: motherIdNumber || "" }), _jsx(EnhancedInput, { error: errors.motherMobile, id: "motherMobile", info: t("formMotherMobileInfo"), label: t("formMobileLabel"), onChange: (e) => handleChange("motherMobile", e.target.value), placeholder: "+923001234567", required: true, type: "text", value: motherMobile || "" }), _jsx(EnhancedCheckbox, { label: t("formEmergencyContactLabel"), id: "emergencyContactMother", info: t("formMotherEmergencyContactInfo"), checked: emergencyContact === "Mother", onCheckedChange: (checked) => handleChange("emergencyContact", checked ? "Mother" : "") })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("formSectionHomeInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedTextarea, { error: errors.address, id: "homeAddress", info: t("formHomeAddressInfo"), label: t("formHomeAddressLabel"), onChange: (e) => handleChange("address", e.target.value), placeholder: t("formHomeAddressPlaceholder"), required: true, rows: 2, value: address || "" }), _jsx(EnhancedInput, { error: errors.city, id: "city", info: t("formCityInfo"), label: t("formCityLabel"), onChange: (e) => handleChange("city", e.target.value), placeholder: t("formCityPlaceholder"), required: true, type: "text", value: city || "" }), _jsx(EnhancedInput, { error: errors.state, id: "state", info: t("formStateInfo"), label: t("formStateLabel"), onChange: (e) => handleChange("state", e.target.value), placeholder: t("formStatePlaceholder"), required: true, type: "text", value: provinceState || "" }), _jsx(EnhancedInput, { error: errors.country, id: "country", info: t("formCountryInfo"), label: t("formCountryLabel"), onChange: (e) => handleChange("country", e.target.value), placeholder: t("formCountryPlaceholder"), required: true, type: "text", value: country || "" })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("formSectionAdmissionInformation") }), _jsxs("div", { className: "grid grid-cols-6 gap-4", children: [_jsx(EnhancedInput, { error: errors.classForAdmission, id: "classForAdmission", info: t("formClassForAdmissionInfo"), label: t("formClassForAdmissionLabel"), onChange: (e) => handleChange("classForAdmission", e.target.value), placeholder: t("formClassForAdmissionPlaceholder"), required: true, type: "text", value: classForAdmission || "" }), _jsx(EnhancedInput, { error: errors.previousSchool, id: "previousSchool", info: t("formPreviousSchoolInfo"), label: t("formPreviousSchoolLabel"), onChange: (e) => handleChange("previousSchool", e.target.value), placeholder: t("formPreviousSchoolPlaceholder"), type: "text", value: previousSchool || "" }), _jsx(EnhancedTextarea, { error: errors.siblings, id: "siblings", info: t("formSiblingsInfo"), label: t("formSiblingsLabel"), onChange: (e) => handleChange("siblings", e.target.value), placeholder: t("formSiblingsPlaceholder"), rows: 3, value: siblings || "" })] }), _jsx(Separator, {}), _jsx("h4", { className: "m-0 p-0", children: t("formSectionOfficeUse") }), _jsxs("div", { className: "grid grid-cols-4 gap-4", children: [_jsx(EnhancedTextarea, { error: errors.notes, id: "notes", info: t("formNotesInfo"), label: t("formNotesLabel"), onChange: (e) => handleChange("notes", e.target.value), placeholder: t("formNotesPlaceholder"), rows: 3, value: notes || "" }), _jsx(EnhancedTextarea, { error: errors.admissionNotes, id: "admissionNotes", info: t("formAdmissionNotesInfo"), label: t("formAdmissionNotesLabel"), onChange: (e) => handleChange("admissionNotes", e.target.value), placeholder: t("formAdmissionNotesPlaceholder"), rows: 3, value: admissionNotes || "" })] })] }));
135
135
  };
@@ -85,5 +85,5 @@ export const AttendanceForm = () => {
85
85
  },
86
86
  value: status,
87
87
  });
88
- return (_jsxs("div", { className: "space-y-4", children: [_jsx(EnhancedInput, { error: errors.date, id: "date", info: t("formDateInfo"), label: t("formDateLabel"), onChange: (e) => handleChange("date", e.target.value), placeholder: t("formDatePlaceholder"), required: true, type: "date", value: date }), statusCombo, studentProfile, _jsx(EnhancedTextarea, { error: errors.remarks, id: "remarks", info: t("formRemarksInfo"), label: t("formRemarksLabel"), onChange: (e) => handleChange("remarks", e.target.value), placeholder: t("formRemarksPlaceholder"), rows: 3, value: remarks !== null && remarks !== void 0 ? remarks : "" }), _jsx(EnhancedCheckbox, { defaultChecked: enabled, label: t("formActiveRecordLabel"), onCheckedChange: (checked) => handleChange("enabled", checked) })] }));
88
+ return (_jsxs("div", { className: "space-y-4", children: [_jsx(EnhancedInput, { error: errors.date, id: "date", info: t("formDateInfo"), label: t("formDateLabel"), onChange: (e) => handleChange("date", e.target.value), onClick: (e) => { var _a, _b; return (_b = (_a = e.currentTarget).showPicker) === null || _b === void 0 ? void 0 : _b.call(_a); }, placeholder: t("formDatePlaceholder"), required: true, type: "date", value: date }), statusCombo, studentProfile, _jsx(EnhancedTextarea, { error: errors.remarks, id: "remarks", info: t("formRemarksInfo"), label: t("formRemarksLabel"), onChange: (e) => handleChange("remarks", e.target.value), placeholder: t("formRemarksPlaceholder"), rows: 3, value: remarks !== null && remarks !== void 0 ? remarks : "" }), _jsx(EnhancedCheckbox, { defaultChecked: enabled, label: t("formActiveRecordLabel"), onCheckedChange: (checked) => handleChange("enabled", checked) })] }));
89
89
  };
@@ -122,7 +122,7 @@ export const EnrollmentForm = () => {
122
122
  },
123
123
  value: sectionId || "",
124
124
  });
125
- return (_jsxs("div", { className: "space-y-4", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "enrollmentDate", t }), id: "enrollmentDate", info: t("formEnrollmentDateInfo"), label: t("formEnrollmentDateLabel"), onChange: (e) => handleChange("enrollmentDate", e.target.value), placeholder: t("formEnrollmentDatePlaceholder"), required: true, type: "date", value: enrollmentDate
125
+ return (_jsxs("div", { className: "space-y-4", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "enrollmentDate", t }), id: "enrollmentDate", info: t("formEnrollmentDateInfo"), label: t("formEnrollmentDateLabel"), onChange: (e) => handleChange("enrollmentDate", e.target.value), onClick: (e) => { var _a, _b; return (_b = (_a = e.currentTarget).showPicker) === null || _b === void 0 ? void 0 : _b.call(_a); }, placeholder: t("formEnrollmentDatePlaceholder"), required: true, type: "date", value: enrollmentDate
126
126
  ? formatDate(enrollmentDate, DATE_FORMATS.YYYY_MM_DD)
127
127
  : "" }), _jsx(Separator, {}), studentProfileIdCombo, classIdCombo, sectionIdCombo, _jsx(EnhancedCheckbox, { checked: enabled, id: "enabled", info: t("formActiveEnrollmentInfo"), label: t("formActiveEnrollmentLabel"), onCheckedChange: (checked) => handleChange("enabled", checked) })] }));
128
128
  };
@@ -122,7 +122,7 @@ export const ExpenseForm = () => {
122
122
  },
123
123
  value: paymentMethod || "",
124
124
  });
125
- return (_jsxs("div", { className: "space-y-4", children: [_jsx(EnhancedInput, { error: errors.title ? t(errors.title) : undefined, id: "title", info: t("formTitleInfo"), label: t("formTitleLabel"), onChange: (e) => handleChange("title", e.target.value), placeholder: t("formTitlePlaceholder"), required: true, type: "text", value: title || "" }), categoryCombo, statusCombo, _jsx(EnhancedInput, { error: errors.amount ? t(errors.amount) : undefined, id: "amount", info: `${t("formAmountInfo")} ${currency}`, label: t("formAmountLabel"), min: "0", onChange: (e) => handleChange("amount", Number(e.target.value)), placeholder: "0.00", required: true, step: "0.01", type: "number", value: amount }), _jsx(EnhancedInput, { error: errors.expenseDate ? t(errors.expenseDate) : undefined, id: "expenseDate", info: t("formExpenseDateInfo"), label: t("formExpenseDateLabel"), onChange: (e) => handleChange("expenseDate", e.target.value), required: true, type: "date", value: expenseDate || "" }), _jsx(EnhancedTextarea, { error: errors.description, id: "description", label: t("formDescriptionLabel"), onChange: (e) => handleChange("description", e.target.value), placeholder: t("formDescriptionPlaceholder"), rows: 3, value: description || "" }), _jsx(EnhancedInput, { error: errors.vendorName ? t(errors.vendorName) : undefined, id: "vendorName", info: t("formVendorNameInfo"), label: t("formVendorNameLabel"), onChange: (e) => handleChange("vendorName", e.target.value), placeholder: t("formVendorNamePlaceholder"), type: "text", value: vendorName || "" }), _jsx(EnhancedInput, { error: errors.vendorContact ? t(errors.vendorContact) : undefined, id: "vendorContact", info: t("formVendorContactInfo"), label: t("formVendorContactLabel"), onChange: (e) => handleChange("vendorContact", e.target.value), placeholder: t("formVendorContactPlaceholder"), type: "text", value: vendorContact || "" }), _jsx(EnhancedInput, { error: errors.invoiceNumber ? t(errors.invoiceNumber) : undefined, id: "invoiceNumber", info: t("formInvoiceNumberInfo"), label: t("formInvoiceNumberLabel"), onChange: (e) => handleChange("invoiceNumber", e.target.value), placeholder: t("formInvoiceNumberPlaceholder"), type: "text", value: invoiceNumber || "" }), paymentMethodCombo, _jsx(EnhancedInput, { error: errors.paymentDate ? t(errors.paymentDate) : undefined, id: "paymentDate", info: t("formPaymentDateInfo"), label: t("formPaymentDateLabel"), onChange: (e) => handleChange("paymentDate", e.target.value), type: "date", value: paymentDate || "" }), _jsx(EnhancedInput, { error: errors.receiptNumber ? t(errors.receiptNumber) : undefined, id: "receiptNumber", info: t("formReceiptNumberInfo"), label: t("formReceiptNumberLabel"), onChange: (e) => handleChange("receiptNumber", e.target.value), placeholder: t("formReceiptNumberPlaceholder"), type: "text", value: receiptNumber || "" }), _jsx(EnhancedInput, { error: errors.transactionId ? t(errors.transactionId) : undefined, id: "transactionId", info: t("formTransactionIdInfo"), label: t("formTransactionIdLabel"), onChange: (e) => handleChange("transactionId", e.target.value), placeholder: t("formTransactionIdPlaceholder"), type: "text", value: transactionId || "" }), _jsx(EnhancedTextarea, { error: errors.remarks, id: "remarks", label: t("formRemarksLabel"), onChange: (e) => handleChange("remarks", e.target.value), placeholder: t("formRemarksPlaceholder"), rows: 3, value: remarks || "" }), _jsx(EnhancedDropzone, { accept: ["image/*", "application/pdf"], error: errors.attachments ? t(errors.attachments) : undefined, id: "attachments", info: t("formAttachmentsInfo"), label: t("formAttachmentsLabel"), maxFiles: 10, onChange: (files) => {
125
+ return (_jsxs("div", { className: "space-y-4", children: [_jsx(EnhancedInput, { error: errors.title ? t(errors.title) : undefined, id: "title", info: t("formTitleInfo"), label: t("formTitleLabel"), onChange: (e) => handleChange("title", e.target.value), placeholder: t("formTitlePlaceholder"), required: true, type: "text", value: title || "" }), categoryCombo, statusCombo, _jsx(EnhancedInput, { error: errors.amount ? t(errors.amount) : undefined, id: "amount", info: `${t("formAmountInfo")} ${currency}`, label: t("formAmountLabel"), min: "0", onChange: (e) => handleChange("amount", Number(e.target.value)), placeholder: "0.00", required: true, step: "0.01", type: "number", value: amount }), _jsx(EnhancedInput, { error: errors.expenseDate ? t(errors.expenseDate) : undefined, id: "expenseDate", info: t("formExpenseDateInfo"), label: t("formExpenseDateLabel"), onChange: (e) => handleChange("expenseDate", e.target.value), onClick: (e) => { var _a, _b; return (_b = (_a = e.currentTarget).showPicker) === null || _b === void 0 ? void 0 : _b.call(_a); }, required: true, type: "date", value: expenseDate || "" }), _jsx(EnhancedTextarea, { error: errors.description, id: "description", label: t("formDescriptionLabel"), onChange: (e) => handleChange("description", e.target.value), placeholder: t("formDescriptionPlaceholder"), rows: 3, value: description || "" }), _jsx(EnhancedInput, { error: errors.vendorName ? t(errors.vendorName) : undefined, id: "vendorName", info: t("formVendorNameInfo"), label: t("formVendorNameLabel"), onChange: (e) => handleChange("vendorName", e.target.value), placeholder: t("formVendorNamePlaceholder"), type: "text", value: vendorName || "" }), _jsx(EnhancedInput, { error: errors.vendorContact ? t(errors.vendorContact) : undefined, id: "vendorContact", info: t("formVendorContactInfo"), label: t("formVendorContactLabel"), onChange: (e) => handleChange("vendorContact", e.target.value), placeholder: t("formVendorContactPlaceholder"), type: "text", value: vendorContact || "" }), _jsx(EnhancedInput, { error: errors.invoiceNumber ? t(errors.invoiceNumber) : undefined, id: "invoiceNumber", info: t("formInvoiceNumberInfo"), label: t("formInvoiceNumberLabel"), onChange: (e) => handleChange("invoiceNumber", e.target.value), placeholder: t("formInvoiceNumberPlaceholder"), type: "text", value: invoiceNumber || "" }), paymentMethodCombo, _jsx(EnhancedInput, { error: errors.paymentDate ? t(errors.paymentDate) : undefined, id: "paymentDate", info: t("formPaymentDateInfo"), label: t("formPaymentDateLabel"), onChange: (e) => handleChange("paymentDate", e.target.value), onClick: (e) => { var _a, _b; return (_b = (_a = e.currentTarget).showPicker) === null || _b === void 0 ? void 0 : _b.call(_a); }, type: "date", value: paymentDate || "" }), _jsx(EnhancedInput, { error: errors.receiptNumber ? t(errors.receiptNumber) : undefined, id: "receiptNumber", info: t("formReceiptNumberInfo"), label: t("formReceiptNumberLabel"), onChange: (e) => handleChange("receiptNumber", e.target.value), placeholder: t("formReceiptNumberPlaceholder"), type: "text", value: receiptNumber || "" }), _jsx(EnhancedInput, { error: errors.transactionId ? t(errors.transactionId) : undefined, id: "transactionId", info: t("formTransactionIdInfo"), label: t("formTransactionIdLabel"), onChange: (e) => handleChange("transactionId", e.target.value), placeholder: t("formTransactionIdPlaceholder"), type: "text", value: transactionId || "" }), _jsx(EnhancedTextarea, { error: errors.remarks, id: "remarks", label: t("formRemarksLabel"), onChange: (e) => handleChange("remarks", e.target.value), placeholder: t("formRemarksPlaceholder"), rows: 3, value: remarks || "" }), _jsx(EnhancedDropzone, { accept: ["image/*", "application/pdf"], error: errors.attachments ? t(errors.attachments) : undefined, id: "attachments", info: t("formAttachmentsInfo"), label: t("formAttachmentsLabel"), maxFiles: 10, onChange: (files) => {
126
126
  const urls = files.map((f) => URL.createObjectURL(f));
127
127
  handleChange("attachments", urls);
128
128
  }, onRemoveRemote: (url) => {
@@ -15,7 +15,7 @@ export const FamilyMemberForm = () => {
15
15
  const { handleChange, state } = useFamilyMemberModule();
16
16
  const { bloodGroup, dateOfBirth, email, emergencyPhone, enabled, errors, firstName, gender, idNumber, isPrimary, lastName, occupation, phone, relationship, role, } = state;
17
17
  const t = useTranslations("familyMember");
18
- return (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionPersonalInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "firstName", t }), id: "firstName", info: t("formFirstNameInfo"), label: t("formFirstNameLabel"), onChange: (e) => handleChange("firstName", e.target.value), placeholder: t("formFirstNamePlaceholder"), required: true, value: firstName }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "lastName", t }), id: "lastName", info: t("formLastNameInfo"), label: t("formLastNameLabel"), onChange: (e) => handleChange("lastName", e.target.value), placeholder: t("formLastNamePlaceholder"), required: true, value: lastName })] }), _jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "role", t }), id: "role", info: t("formRoleInfo"), label: t("formRoleLabel"), onChange: (e) => handleChange("role", e.target.value), placeholder: t("formRolePlaceholder"), required: true, value: role }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "dateOfBirth", t }), id: "dateOfBirth", info: t("formDateOfBirthInfo"), label: t("formDateOfBirthLabel"), onChange: (e) => handleChange("dateOfBirth", e.target.value), placeholder: "YYYY-MM-DD", type: "date", value: dateOfBirth })] }), _jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "gender", t }), id: "gender", info: t("formGenderInfo"), label: t("formGenderLabel"), onChange: (e) => handleChange("gender", e.target.value), placeholder: t("formGenderPlaceholder"), value: gender }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "bloodGroup", t }), id: "bloodGroup", info: t("formBloodGroupInfo"), label: t("formBloodGroupLabel"), onChange: (e) => handleChange("bloodGroup", e.target.value), placeholder: t("formBloodGroupPlaceholder"), value: bloodGroup })] }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "idNumber", t }), id: "idNumber", info: t("formIdNumberInfo"), label: t("formIdNumberLabel"), onChange: (e) => handleChange("idNumber", e.target.value), placeholder: t("formIdNumberPlaceholder"), value: idNumber })] }), _jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionContactInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "phone", t }), id: "phone", info: t("formPhoneInfo"), label: t("formPhoneLabel"), onChange: (e) => {
18
+ return (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionPersonalInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "firstName", t }), id: "firstName", info: t("formFirstNameInfo"), label: t("formFirstNameLabel"), onChange: (e) => handleChange("firstName", e.target.value), placeholder: t("formFirstNamePlaceholder"), required: true, value: firstName }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "lastName", t }), id: "lastName", info: t("formLastNameInfo"), label: t("formLastNameLabel"), onChange: (e) => handleChange("lastName", e.target.value), placeholder: t("formLastNamePlaceholder"), required: true, value: lastName })] }), _jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "role", t }), id: "role", info: t("formRoleInfo"), label: t("formRoleLabel"), onChange: (e) => handleChange("role", e.target.value), placeholder: t("formRolePlaceholder"), required: true, value: role }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "dateOfBirth", t }), id: "dateOfBirth", info: t("formDateOfBirthInfo"), label: t("formDateOfBirthLabel"), onChange: (e) => handleChange("dateOfBirth", e.target.value), onClick: (e) => { var _a, _b; return (_b = (_a = e.currentTarget).showPicker) === null || _b === void 0 ? void 0 : _b.call(_a); }, placeholder: "YYYY-MM-DD", type: "date", value: dateOfBirth })] }), _jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "gender", t }), id: "gender", info: t("formGenderInfo"), label: t("formGenderLabel"), onChange: (e) => handleChange("gender", e.target.value), placeholder: t("formGenderPlaceholder"), value: gender }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "bloodGroup", t }), id: "bloodGroup", info: t("formBloodGroupInfo"), label: t("formBloodGroupLabel"), onChange: (e) => handleChange("bloodGroup", e.target.value), placeholder: t("formBloodGroupPlaceholder"), value: bloodGroup })] }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "idNumber", t }), id: "idNumber", info: t("formIdNumberInfo"), label: t("formIdNumberLabel"), onChange: (e) => handleChange("idNumber", e.target.value), placeholder: t("formIdNumberPlaceholder"), value: idNumber })] }), _jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionContactInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "phone", t }), id: "phone", info: t("formPhoneInfo"), label: t("formPhoneLabel"), onChange: (e) => {
19
19
  var _a;
20
20
  return handleChange("phone", ((_a = formatPhone(e.target.value)) === null || _a === void 0 ? void 0 : _a.international) || e.target.value);
21
21
  }, placeholder: t("formPhonePlaceholder"), type: "tel", value: phone }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "email", t }), id: "email", info: t("formEmailInfo"), label: t("formEmailLabel"), onChange: (e) => handleChange("email", e.target.value), placeholder: t("formEmailPlaceholder"), type: "email", value: email })] }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "emergencyPhone", t }), id: "emergencyPhone", info: t("formEmergencyPhoneInfo"), label: t("formEmergencyPhoneLabel"), onChange: (e) => {
@@ -152,5 +152,5 @@ export const StudentFeeForm = () => {
152
152
  },
153
153
  value: status,
154
154
  });
155
- return (_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [studentProfileIdCombo, feeStructureIdCombo, discountCodeIdCombo, _jsx(EnhancedInput, { error: errors.discountAmount, id: "discountAmount", info: t("formDiscountAmountInfo"), label: t("formDiscountAmountLabel"), min: "0", onChange: (e) => handleChange("discountAmount", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: discountAmount || 0 }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "amount", t }), id: "amount", info: t("formTotalAmountInfo"), label: t("formTotalAmountLabel"), min: "0", onChange: (e) => handleChange("amount", Number(e.target.value)), placeholder: "0.00", required: true, step: "0.01", type: "number", value: amount }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "amountPaid", t }), id: "amountPaid", info: t("formAmountPaidInfo"), label: t("formAmountPaidLabel"), min: "0", required: true, onChange: (e) => handleChange("amountPaid", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: amountPaid }), _jsx(EnhancedInput, { disabled: true, error: getTranslatedError({ errors, key: "amountDue", t }), id: "amountDue", info: t("formAmountDueInfo"), label: t("formAmountDueLabel"), min: "0", required: true, onChange: (e) => handleChange("amountDue", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: amountDue }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "dueDate", t }), id: "dueDate", info: t("formDueDateInfo"), label: t("formDueDateLabel"), onChange: (e) => handleChange("dueDate", e.target.value), required: true, type: "date", value: dueDate || "" }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "paidAt", t }), id: "paidAt", info: t("formPaidAtInfo"), label: t("formPaidAtLabel"), onChange: (e) => handleChange("paidAt", e.target.value), type: "date", value: paidAt || "" }), statusCombo, _jsx(EnhancedTextarea, { error: getTranslatedError({ errors, key: "remarks", t }), id: "remarks", label: t("formRemarksLabel"), onChange: (e) => handleChange("remarks", e.target.value), placeholder: t("formRemarksPlaceholder"), value: remarks || "" }), _jsx(EnhancedCheckbox, { checked: enabled, error: getTranslatedError({ errors, key: "enabled", t }), id: "enabled", info: t("formEnabledInfo"), label: t("formEnabledLabel"), onCheckedChange: (checked) => handleChange("enabled", !!checked) })] }));
155
+ return (_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [studentProfileIdCombo, feeStructureIdCombo, discountCodeIdCombo, _jsx(EnhancedInput, { error: errors.discountAmount, id: "discountAmount", info: t("formDiscountAmountInfo"), label: t("formDiscountAmountLabel"), min: "0", onChange: (e) => handleChange("discountAmount", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: discountAmount || 0 }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "amount", t }), id: "amount", info: t("formTotalAmountInfo"), label: t("formTotalAmountLabel"), min: "0", onChange: (e) => handleChange("amount", Number(e.target.value)), placeholder: "0.00", required: true, step: "0.01", type: "number", value: amount }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "amountPaid", t }), id: "amountPaid", info: t("formAmountPaidInfo"), label: t("formAmountPaidLabel"), min: "0", required: true, onChange: (e) => handleChange("amountPaid", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: amountPaid }), _jsx(EnhancedInput, { disabled: true, error: getTranslatedError({ errors, key: "amountDue", t }), id: "amountDue", info: t("formAmountDueInfo"), label: t("formAmountDueLabel"), min: "0", required: true, onChange: (e) => handleChange("amountDue", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: amountDue }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "dueDate", t }), id: "dueDate", info: t("formDueDateInfo"), label: t("formDueDateLabel"), onChange: (e) => handleChange("dueDate", e.target.value), onClick: (e) => { var _a, _b; return (_b = (_a = e.currentTarget).showPicker) === null || _b === void 0 ? void 0 : _b.call(_a); }, required: true, type: "date", value: dueDate || "" }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "paidAt", t }), id: "paidAt", info: t("formPaidAtInfo"), label: t("formPaidAtLabel"), onChange: (e) => handleChange("paidAt", e.target.value), onClick: (e) => { var _a, _b; return (_b = (_a = e.currentTarget).showPicker) === null || _b === void 0 ? void 0 : _b.call(_a); }, type: "date", value: paidAt || "" }), statusCombo, _jsx(EnhancedTextarea, { error: getTranslatedError({ errors, key: "remarks", t }), id: "remarks", label: t("formRemarksLabel"), onChange: (e) => handleChange("remarks", e.target.value), placeholder: t("formRemarksPlaceholder"), value: remarks || "" }), _jsx(EnhancedCheckbox, { checked: enabled, error: getTranslatedError({ errors, key: "enabled", t }), id: "enabled", info: t("formEnabledInfo"), label: t("formEnabledLabel"), onCheckedChange: (checked) => handleChange("enabled", !!checked) })] }));
156
156
  };
@@ -99,5 +99,5 @@ export const SingleEntryStudentFeeForm = ({ amountPaid, feeByComputerNumber, fet
99
99
  }, [fee, accumulatedFine, accumulatedAmount, setAmountPaid]);
100
100
  return (_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { id: "computerNumber", info: t("formComputerNumberInfo"), label: t("formComputerNumberLabel"), onChange: (e) => setComputerNumber(e.target.value), placeholder: t("formComputerNumberPlaceholder"), type: "number", required: true, value: computerNumber }), fetchingByCN && debouncedComputerNumber ? (_jsx("div", { className: "flex items-center justify-center py-4", children: _jsx(Loader2, { className: "text-muted-foreground h-5 w-5 animate-spin" }) })) : null, fee && profile ? (_jsxs(_Fragment, { children: [_jsx(EnhancedInput, { readOnly: true, id: "studentProfileId-readonly", label: t("formStudentLabel"), value: studentName }), _jsx(EnhancedInput, { readOnly: true, id: "feeStructureId-readonly", label: t("formFeeStructureLabel"), value: feeStructureName }), _jsx(EnhancedInput, { readOnly: true, id: "discountCodeId-readonly", label: t("formDiscountCodeLabel"), value: discountCodeLabel }), _jsx(EnhancedInput, { readOnly: true, id: "discountAmount-readonly", label: t("formDiscountAmountLabel"), value: (_h = fee === null || fee === void 0 ? void 0 : fee.discountAmount) !== null && _h !== void 0 ? _h : 0, type: "number", step: "0.01" }), _jsx(EnhancedInput, { readOnly: true, id: "accumulatedFine-readonly", info: t("formAccumulatedFineInfo"), label: t("formAccumulatedFineLabel"), value: accumulatedFine, type: "number", step: "0.01" }), _jsx(EnhancedInput, { readOnly: true, id: "amount-readonly", info: t("formTotalAmountInfo"), label: t("formTotalAmountLabel"), value: accumulatedAmount + (accumulatedFine !== null && accumulatedFine !== void 0 ? accumulatedFine : 0), type: "number", step: "0.01" }), _jsx(EnhancedInput, { id: "amountPaid", info: t("formAmountPaidInfo"), label: t("formAmountPaidLabel"), value: accumulatedAmount + (accumulatedFine !== null && accumulatedFine !== void 0 ? accumulatedFine : 0) - fee.amountPaid || "0", onChange: (e) => handleUpdateAmountPaid(e.target.value), type: "number", step: "0.01" }), _jsx(EnhancedInput, { readOnly: true, id: "amountDue-readonly", info: t("formAmountDueInfo"), label: t("formAmountDueLabel"), value: (accumulatedAmount !== null && accumulatedAmount !== void 0 ? accumulatedAmount : 0) +
101
101
  (accumulatedFine !== null && accumulatedFine !== void 0 ? accumulatedFine : 0) -
102
- parseFloat(amountPaid || "0"), type: "number", step: "0.01" }), _jsx(EnhancedInput, { readOnly: true, id: "dueDate-readonly", label: t("formDueDateLabel"), value: formatDisplayDate(fee === null || fee === void 0 ? void 0 : fee.dueDate), type: "date" }), _jsx(EnhancedInput, { id: "paidAt", info: t("formPaidAtInfo"), label: t("formPaidAtLabel"), onChange: (e) => setPaidAt(e.target.value), type: "date", value: paidAt || "" }), _jsx(EnhancedInput, { readOnly: true, id: "status-readonly", label: t("formStatusLabel"), value: statusDisplay }), _jsx(EnhancedTextarea, { id: "remarks-readonly", label: t("formRemarksLabel"), value: remarks || "", onChange: (e) => setRemarks(e.target.value) })] })) : null] }));
102
+ parseFloat(amountPaid || "0"), type: "number", step: "0.01" }), _jsx(EnhancedInput, { readOnly: true, id: "dueDate-readonly", label: t("formDueDateLabel"), value: formatDisplayDate(fee === null || fee === void 0 ? void 0 : fee.dueDate), type: "date" }), _jsx(EnhancedInput, { id: "paidAt", info: t("formPaidAtInfo"), label: t("formPaidAtLabel"), onChange: (e) => setPaidAt(e.target.value), onClick: (e) => { var _a, _b; return (_b = (_a = e.currentTarget).showPicker) === null || _b === void 0 ? void 0 : _b.call(_a); }, type: "date", value: paidAt || "" }), _jsx(EnhancedInput, { readOnly: true, id: "status-readonly", label: t("formStatusLabel"), value: statusDisplay }), _jsx(EnhancedTextarea, { id: "remarks-readonly", label: t("formRemarksLabel"), value: remarks || "", onChange: (e) => setRemarks(e.target.value) })] })) : null] }));
103
103
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.3.49",
3
+ "version": "0.3.51",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",
@@ -37,14 +37,10 @@
37
37
  ]
38
38
  },
39
39
  "devDependencies": {
40
- "@appcorp/app-corp-vista": "^1.0.0",
41
- "@appcorp/shadcn": "^1.1.99",
40
+ "@appcorp/shadcn": "^2.0.2",
42
41
  "@chromatic-com/storybook": "^5.1.2",
43
42
  "@commitlint/cli": "^20.5.0",
44
43
  "@commitlint/config-conventional": "^20.5.0",
45
- "@pdfme/common": "^6",
46
- "@pdfme/generator": "^6",
47
- "@pdfme/schemas": "^6",
48
44
  "@playwright/test": "^1.59.1",
49
45
  "@radix-ui/react-avatar": "^1.1.11",
50
46
  "@radix-ui/react-checkbox": "^1.3.3",
@@ -59,7 +55,7 @@
59
55
  "@radix-ui/react-slider": "^1.3.6",
60
56
  "@radix-ui/react-slot": "^1.2.4",
61
57
  "@radix-ui/react-toast": "^1.2.15",
62
- "@react-pakistan/util-functions": "^2.0.2",
58
+ "@react-pakistan/util-functions": "^3.0.0",
63
59
  "@storybook/addon-a11y": "^10.3.4",
64
60
  "@storybook/addon-docs": "^10.3.4",
65
61
  "@storybook/addon-onboarding": "^10.3.4",
@@ -0,0 +1,37 @@
1
+ export interface AdmissionPDFData {
2
+ firstName: string;
3
+ lastName: string;
4
+ studentIdNumber: string;
5
+ gender: string;
6
+ dob: string;
7
+ registrationCode: string;
8
+ discountCode?: string;
9
+ fatherFirstName: string;
10
+ fatherLastName: string;
11
+ fatherIdNumber: string;
12
+ fatherMobile: string;
13
+ fatherOccupation?: string;
14
+ fatherOrganization?: string;
15
+ motherFirstName: string;
16
+ motherLastName: string;
17
+ motherIdNumber: string;
18
+ motherMobile: string;
19
+ address: string;
20
+ city: string;
21
+ state: string;
22
+ country: string;
23
+ classForAdmission: string;
24
+ previousSchool?: string;
25
+ siblings?: string;
26
+ notes?: string;
27
+ admissionNotes?: string;
28
+ schoolName?: string;
29
+ schoolAddress?: string;
30
+ schoolPhone?: string;
31
+ schoolEmail?: string;
32
+ submissionDate?: string;
33
+ admissionStatus?: string;
34
+ logo?: string;
35
+ emergencyContact?: string;
36
+ }
37
+ export declare function buildAdmissionFormHtml(data: AdmissionPDFData): string;
@@ -0,0 +1,321 @@
1
+ function escapeHtml(str) {
2
+ if (str == null)
3
+ return "";
4
+ return String(str)
5
+ .replace(/&/g, "&")
6
+ .replace(/</g, "&lt;")
7
+ .replace(/>/g, "&gt;")
8
+ .replace(/"/g, "&quot;");
9
+ }
10
+ function fmt(val) {
11
+ if (val == null || val === "")
12
+ return "—";
13
+ return escapeHtml(val);
14
+ }
15
+ function section(title, content) {
16
+ return `
17
+ <div class="section">
18
+ <div class="section-title">${escapeHtml(title)}</div>
19
+ <div class="section-body">${content}</div>
20
+ </div>`;
21
+ }
22
+ function row(label, value) {
23
+ return `
24
+ <div class="field-row">
25
+ <span class="field-label">${escapeHtml(label)}:</span>
26
+ <span class="field-value">${value}</span>
27
+ </div>`;
28
+ }
29
+ export function buildAdmissionFormHtml(data) {
30
+ const studentName = `${escapeHtml(data.firstName)} ${escapeHtml(data.lastName)}`;
31
+ const fatherName = `${escapeHtml(data.fatherFirstName)} ${escapeHtml(data.fatherLastName)}`;
32
+ const motherName = `${escapeHtml(data.motherFirstName)} ${escapeHtml(data.motherLastName)}`;
33
+ const homeAddress = `${fmt(data.address)}, ${fmt(data.city)}, ${fmt(data.state)}, ${fmt(data.country)}`;
34
+ const date = data.submissionDate || new Date().toLocaleDateString();
35
+ const emergencyContact = data.emergencyContact === "Mother" ? "Mother" : "Father";
36
+ const logoHtml = data.logo
37
+ ? `<img src="${data.logo.startsWith("data:") ? escapeHtml(data.logo) : `data:image/png;base64,${escapeHtml(data.logo)}`}" alt="School Logo" class="logo" />`
38
+ : "";
39
+ const html = `<!DOCTYPE html>
40
+ <html>
41
+ <head>
42
+ <meta charset="utf-8">
43
+ <title>Admission Form - ${escapeHtml(data.registrationCode)}</title>
44
+ <style>
45
+ @import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap");
46
+
47
+ @page { margin: 12mm 15mm; size: A4 portrait; }
48
+
49
+ *, *::before, *::after {
50
+ font-family: "Roboto", system-ui, -apple-system, sans-serif;
51
+ box-sizing: border-box;
52
+ }
53
+
54
+ body {
55
+ margin: 0;
56
+ padding: 0;
57
+ font-size: 10pt;
58
+ color: #1f2937;
59
+ line-height: 1.5;
60
+ }
61
+
62
+ .header {
63
+ display: flex;
64
+ align-items: center;
65
+ gap: 14px;
66
+ padding-bottom: 12px;
67
+ margin-bottom: 16px;
68
+ border-bottom: 2px solid #2563eb;
69
+ }
70
+
71
+ .logo {
72
+ width: 64px;
73
+ height: 64px;
74
+ object-fit: contain;
75
+ }
76
+
77
+ .school-info h1 {
78
+ margin: 0;
79
+ font-size: 14pt;
80
+ font-weight: 700;
81
+ color: #1e3a5f;
82
+ }
83
+
84
+ .school-info p {
85
+ margin: 2px 0 0;
86
+ font-size: 8.5pt;
87
+ color: #6b7280;
88
+ }
89
+
90
+ .form-title {
91
+ text-align: center;
92
+ font-size: 16pt;
93
+ font-weight: 700;
94
+ color: #1e3a5f;
95
+ margin: 0 0 16px;
96
+ text-transform: uppercase;
97
+ letter-spacing: 1px;
98
+ }
99
+
100
+ .reg-row {
101
+ display: flex;
102
+ justify-content: space-between;
103
+ font-size: 9pt;
104
+ color: #374151;
105
+ margin-bottom: 14px;
106
+ padding: 6px 10px;
107
+ background: #f9fafb;
108
+ border: 1px solid #e5e7eb;
109
+ border-radius: 4px;
110
+ }
111
+
112
+ .section {
113
+ margin-bottom: 12px;
114
+ }
115
+
116
+ .section-title {
117
+ font-size: 10pt;
118
+ font-weight: 700;
119
+ color: #1e3a5f;
120
+ border-bottom: 2px solid #d1d5db;
121
+ padding-bottom: 3px;
122
+ margin-bottom: 6px;
123
+ text-transform: uppercase;
124
+ letter-spacing: 0.5px;
125
+ }
126
+
127
+ .section-body {
128
+ padding: 2px 0;
129
+ }
130
+
131
+ .field-row {
132
+ display: flex;
133
+ padding: 2px 0;
134
+ font-size: 9.5pt;
135
+ }
136
+
137
+ .field-label {
138
+ font-weight: 600;
139
+ min-width: 140px;
140
+ color: #374151;
141
+ flex-shrink: 0;
142
+ }
143
+
144
+ .field-value {
145
+ color: #111827;
146
+ }
147
+
148
+ .two-col {
149
+ display: grid;
150
+ grid-template-columns: 1fr 1fr;
151
+ gap: 0 16px;
152
+ }
153
+
154
+ .three-col {
155
+ display: grid;
156
+ grid-template-columns: 1fr 1fr 1fr;
157
+ gap: 0 16px;
158
+ }
159
+
160
+ .parent-subsection {
161
+ margin-bottom: 4px;
162
+ }
163
+
164
+ .parent-subsection h4 {
165
+ margin: 4px 0 2px;
166
+ font-size: 9.5pt;
167
+ font-weight: 600;
168
+ color: #4b5563;
169
+ }
170
+
171
+ .terms {
172
+ margin-top: 18px;
173
+ padding: 10px 12px;
174
+ background: #f9fafb;
175
+ border: 1px solid #e5e7eb;
176
+ border-radius: 4px;
177
+ font-size: 8.5pt;
178
+ color: #4b5563;
179
+ line-height: 1.6;
180
+ }
181
+
182
+ .terms p {
183
+ margin: 0;
184
+ }
185
+ .terms p + p {
186
+ margin-top: 4px;
187
+ }
188
+
189
+ .signature-area {
190
+ display: flex;
191
+ justify-content: space-between;
192
+ margin-top: 28px;
193
+ padding-top: 8px;
194
+ border-top: 1px solid #d1d5db;
195
+ }
196
+
197
+ .signature-block {
198
+ text-align: center;
199
+ min-width: 120px;
200
+ }
201
+
202
+ .signature-block .label {
203
+ font-size: 9pt;
204
+ font-weight: 700;
205
+ color: #374151;
206
+ text-transform: uppercase;
207
+ letter-spacing: 0.5px;
208
+ }
209
+
210
+ .signature-line {
211
+ margin-top: 32px;
212
+ border-top: 1px solid #9ca3af;
213
+ width: 160px;
214
+ }
215
+
216
+ .signature-block .hint {
217
+ font-size: 7.5pt;
218
+ color: #9ca3af;
219
+ margin-top: 2px;
220
+ }
221
+
222
+ .no-break {
223
+ break-inside: avoid;
224
+ }
225
+ </style>
226
+ </head>
227
+ <body>
228
+ <div class="header">
229
+ ${logoHtml}
230
+ <div class="school-info">
231
+ <h1>${fmt(data.schoolName || "School Name")}</h1>
232
+ <p>${fmt(data.schoolAddress)}${data.schoolPhone ? ` &bull; ${fmt(data.schoolPhone)}` : ""}${data.schoolEmail ? ` &bull; ${fmt(data.schoolEmail)}` : ""}</p>
233
+ </div>
234
+ </div>
235
+
236
+ <h2 class="form-title">Admission Form</h2>
237
+
238
+ <div class="reg-row">
239
+ <span><strong>Registration Code:</strong> ${fmt(data.registrationCode)}</span>
240
+ <span><strong>Date:</strong> ${fmt(date)}</span>
241
+ </div>
242
+
243
+ ${section("Student Details", `
244
+ <div class="two-col">
245
+ ${row("Student Name", studentName)}
246
+ ${row("Class for Admission", fmt(data.classForAdmission))}
247
+ ${row("Government ID", fmt(data.studentIdNumber))}
248
+ <div class="field-row">
249
+ <span class="field-label">Gender:</span>
250
+ <span class="field-value">${fmt(data.gender)}</span>
251
+ </div>
252
+ </div>
253
+ <div class="two-col">
254
+ ${row("Date of Birth", fmt(data.dob))}
255
+ ${data.discountCode ? row("Discount Code", fmt(data.discountCode)) : ""}
256
+ </div>
257
+ `)}
258
+
259
+ ${section("Parent Details", `
260
+ <div class="parent-subsection">
261
+ <h4>Father</h4>
262
+ <div class="two-col">
263
+ ${row("Name", fatherName)}
264
+ ${row("ID / CNIC", fmt(data.fatherIdNumber))}
265
+ ${row("Occupation", fmt(data.fatherOccupation))}
266
+ ${row("Organization", fmt(data.fatherOrganization))}
267
+ </div>
268
+ ${row("Mobile", fmt(data.fatherMobile))}
269
+ </div>
270
+ <div class="parent-subsection">
271
+ <h4>Mother</h4>
272
+ <div class="two-col">
273
+ ${row("Name", motherName)}
274
+ ${row("ID / CNIC", fmt(data.motherIdNumber))}
275
+ ${row("Mobile", fmt(data.motherMobile))}
276
+ </div>
277
+ </div>
278
+ `)}
279
+
280
+ ${section("Home Address", `
281
+ <div class="field-row">
282
+ <span class="field-value">${homeAddress}</span>
283
+ </div>
284
+ `)}
285
+
286
+ ${section("Emergency Details", `
287
+ <div class="two-col">
288
+ ${row("Emergency Contact", emergencyContact)}
289
+ ${data.notes ? row("Notes", fmt(data.notes)) : ""}
290
+ </div>
291
+ `)}
292
+
293
+ ${section("Admission Details", `
294
+ <div class="two-col">
295
+ ${row("Student Name", studentName)}
296
+ ${row("Start Date", fmt(date))}
297
+ ${row("Section", "—")}
298
+ </div>
299
+ `)}
300
+
301
+ <div class="terms">
302
+ <p><strong>Terms &amp; Conditions:</strong></p>
303
+ <p>I confirm that the information provided above is true and correct to the best of my knowledge. I agree to abide by the rules and regulations of the institution. The management reserves the right to cancel admission if any information is found to be incorrect or incomplete.</p>
304
+ </div>
305
+
306
+ <div class="signature-area">
307
+ <div class="signature-block">
308
+ <div class="label">Principal</div>
309
+ <div class="signature-line"></div>
310
+ <div class="hint">Signature</div>
311
+ </div>
312
+ <div class="signature-block">
313
+ <div class="label">Parent / Guardian</div>
314
+ <div class="signature-line"></div>
315
+ <div class="hint">Signature</div>
316
+ </div>
317
+ </div>
318
+ </body>
319
+ </html>`;
320
+ return html;
321
+ }