@appcorp/fusion-storybook 0.2.89 → 0.2.91

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.
@@ -426,15 +426,15 @@ export const useFamilyModule = () => {
426
426
  // ==========================================================================
427
427
  // 1.4.9 EFFECTS
428
428
  // ==========================================================================
429
+ useEffect(() => {
430
+ listFetchNowRef.current = listFetchNow;
431
+ }, [listFetchNow]);
429
432
  useEffect(() => {
430
433
  var _a, _b;
431
434
  if (!((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id))
432
435
  return;
433
436
  (_b = listFetchNowRef.current) === null || _b === void 0 ? void 0 : _b.call(listFetchNowRef);
434
437
  }, [listParams, (_b = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _b === void 0 ? void 0 : _b.id]);
435
- useEffect(() => {
436
- listFetchNowRef.current = listFetchNow;
437
- }, [listFetchNow]);
438
438
  // ==========================================================================
439
439
  // 1.4.10 RETURN
440
440
  // ==========================================================================
@@ -468,15 +468,15 @@ export const useFamilyMemberModule = () => {
468
468
  // ============================================================================
469
469
  // 1.4.9 EFFECTS
470
470
  // ============================================================================
471
+ useEffect(() => {
472
+ listFetchNowRef.current = listFetchNow;
473
+ }, [listFetchNow]);
471
474
  useEffect(() => {
472
475
  var _a, _b;
473
476
  if (!((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id))
474
477
  return;
475
478
  (_b = listFetchNowRef.current) === null || _b === void 0 ? void 0 : _b.call(listFetchNowRef);
476
479
  }, [listParams, (_b = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _b === void 0 ? void 0 : _b.id]);
477
- useEffect(() => {
478
- listFetchNowRef.current = listFetchNow;
479
- }, [listFetchNow]);
480
480
  // ============================================================================
481
481
  // 1.4.10 RETURN
482
482
  // ============================================================================
@@ -9,10 +9,10 @@ import { EnhancedCheckbox } from "@appcorp/shadcn/components/enhanced-checkbox";
9
9
  import { EnhancedInput } from "@appcorp/shadcn/components/enhanced-input";
10
10
  import { useFamilyMemberModule } from "./context";
11
11
  import { useTranslations } from "next-intl";
12
- import { getTranslatedError } from "@/utils/get-translated-error";
12
+ import { getTranslatedError } from "../../utils/get-translated-error";
13
13
  export const FamilyMemberForm = () => {
14
14
  const { handleChange, state } = useFamilyMemberModule();
15
15
  const { bloodGroup, dateOfBirth, email, emergencyPhone, enabled, errors, firstName, gender, idNumber, isPrimary, lastName, occupation, phone, relationship, role, } = state;
16
16
  const t = useTranslations("familyMember");
17
- 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 md:grid-cols-2 gap-4", 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 md:grid-cols-2 gap-4", 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 md:grid-cols-2 gap-4", 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 md:grid-cols-2 gap-4", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "phone", t }), id: "phone", info: t("formPhoneInfo"), label: t("formPhoneLabel"), onChange: (e) => handleChange("phone", e.target.value), 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) => handleChange("emergencyPhone", e.target.value), placeholder: t("formEmergencyPhonePlaceholder"), type: "tel", value: emergencyPhone })] }), _jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionAdditionalInformation") }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "relationship", t }), id: "relationship", info: t("formRelationshipInfo"), label: t("formRelationshipLabel"), onChange: (e) => handleChange("relationship", e.target.value), placeholder: t("formRelationshipPlaceholder"), value: relationship }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "occupation", t }), id: "occupation", info: t("formOccupationInfo"), label: t("formOccupationLabel"), onChange: (e) => handleChange("occupation", e.target.value), placeholder: t("formOccupationPlaceholder"), value: occupation })] }), _jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionStatus") }), _jsxs("div", { className: "flex items-center gap-4", children: [_jsx(EnhancedCheckbox, { checked: isPrimary, id: "isPrimary", label: t("formPrimaryContactLabel"), onCheckedChange: (checked) => handleChange("isPrimary", checked === true) }), _jsx(EnhancedCheckbox, { checked: enabled, id: "enabled", label: t("badgeActive"), onCheckedChange: (checked) => handleChange("enabled", checked === true) })] })] })] }));
17
+ 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) => handleChange("phone", e.target.value), 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) => handleChange("emergencyPhone", e.target.value), placeholder: t("formEmergencyPhonePlaceholder"), type: "tel", value: emergencyPhone })] }), _jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionAdditionalInformation") }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "relationship", t }), id: "relationship", info: t("formRelationshipInfo"), label: t("formRelationshipLabel"), onChange: (e) => handleChange("relationship", e.target.value), placeholder: t("formRelationshipPlaceholder"), value: relationship }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "occupation", t }), id: "occupation", info: t("formOccupationInfo"), label: t("formOccupationLabel"), onChange: (e) => handleChange("occupation", e.target.value), placeholder: t("formOccupationPlaceholder"), value: occupation })] }), _jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionStatus") }), _jsxs("div", { className: "flex items-center gap-4", children: [_jsx(EnhancedCheckbox, { checked: isPrimary, id: "isPrimary", label: t("formPrimaryContactLabel"), onCheckedChange: (checked) => handleChange("isPrimary", checked === true) }), _jsx(EnhancedCheckbox, { checked: enabled, id: "enabled", label: t("badgeActive"), onCheckedChange: (checked) => handleChange("enabled", checked === true) })] })] })] }));
18
18
  };
@@ -17,7 +17,7 @@ import { useTranslations } from "next-intl";
17
17
  import { useFetch } from "@react-pakistan/util-functions/hooks/use-fetch";
18
18
  import { API_METHODS } from "@react-pakistan/util-functions";
19
19
  import { useEffect } from "react";
20
- import { getTranslatedError } from "@/utils/get-translated-error";
20
+ import { getTranslatedError } from "../../utils/get-translated-error";
21
21
  export const FeeStructureForm = () => {
22
22
  var _a, _b, _c;
23
23
  const { state, handleChange } = useFeeStructureModule();
@@ -11,7 +11,7 @@ import { useTranslations } from "next-intl";
11
11
  import { EnhancedInput } from "@appcorp/shadcn/components/enhanced-input";
12
12
  import { EnhancedTextarea } from "@appcorp/shadcn/components/enhanced-textarea";
13
13
  import { useEnhancedCombobox } from "@appcorp/shadcn/hooks/use-enhanced-combobox";
14
- import { getTranslatedError } from "@/utils/get-translated-error";
14
+ import { getTranslatedError } from "../../utils/get-translated-error";
15
15
  import { Shield, Eye, EyeOff } from "lucide-react";
16
16
  import { secretKeys } from "./constants";
17
17
  import { PLAN_API_ROUTES } from "../../constants";
@@ -55,5 +55,9 @@ export const WorkspaceForm = () => {
55
55
  });
56
56
  },
57
57
  });
58
- return (_jsxs("div", { className: "space-y-6", children: [_jsx(EnhancedInput, { id: "name", label: t("formNameLabel"), value: state.name, onChange: (e) => handleChange("name", e.target.value), error: getTranslatedError({ errors: state.errors, key: "name", t }), placeholder: t("formNamePlaceholder"), required: true, readOnly: true }), _jsx(EnhancedInput, { id: "subdomain", label: t("formSubdomainLabel"), value: state.subdomain, onChange: (e) => handleChange("subdomain", e.target.value), error: getTranslatedError({ errors: state.errors, key: "subdomain", t }), placeholder: t("formSubdomainPlaceholder"), required: true, info: t("formSubdomainUrlInfo", { subdomain: state.subdomain }), readOnly: true }), _jsx(EnhancedTextarea, { id: "description", label: t("formDescriptionLabel"), value: state.description || "", onChange: (e) => handleChange("description", e.target.value), error: state.errors.description, placeholder: t("formDescriptionPlaceholder"), rows: 3 }), _jsx(EnhancedInput, { id: "logo", label: t("formLogoLabel"), value: state.logo || "", onChange: (e) => handleChange("logo", e.target.value), error: state.errors.logo, placeholder: t("formLogoPlaceholder"), type: "url", readOnly: true }), planIdCombo, _jsxs("div", { className: "mt-6 border-t pt-6", children: [_jsxs("div", { className: "mb-4 flex items-center gap-2", children: [_jsx(Shield, { className: "text-primary h-5 w-5" }), _jsx("h3", { className: "text-lg font-semibold", children: t("formSectionSecrets") })] }), _jsx("p", { className: "text-muted-foreground mb-4 text-sm", children: t("formSecretsDescription") }), _jsx(SecretsEditor, { secrets: secrets, errors: state.errors, onChange: handleSecretChange, secretPlaceholder: t("formSecretPlaceholder") })] })] }));
58
+ return (_jsxs("div", { className: "space-y-6", children: [_jsx(EnhancedInput, { id: "name", label: t("formNameLabel"), value: state.name, onChange: (e) => handleChange("name", e.target.value), error: getTranslatedError({ errors: state.errors, key: "name", t }), placeholder: t("formNamePlaceholder"), required: true, readOnly: true }), _jsx(EnhancedInput, { id: "subdomain", label: t("formSubdomainLabel"), value: state.subdomain, onChange: (e) => handleChange("subdomain", e.target.value), error: getTranslatedError({
59
+ errors: state.errors,
60
+ key: "subdomain",
61
+ t,
62
+ }), placeholder: t("formSubdomainPlaceholder"), required: true, info: t("formSubdomainUrlInfo", { subdomain: state.subdomain }), readOnly: true }), _jsx(EnhancedTextarea, { id: "description", label: t("formDescriptionLabel"), value: state.description || "", onChange: (e) => handleChange("description", e.target.value), error: state.errors.description, placeholder: t("formDescriptionPlaceholder"), rows: 3 }), _jsx(EnhancedInput, { id: "logo", label: t("formLogoLabel"), value: state.logo || "", onChange: (e) => handleChange("logo", e.target.value), error: state.errors.logo, placeholder: t("formLogoPlaceholder"), type: "url", readOnly: true }), planIdCombo, _jsxs("div", { className: "mt-6 border-t pt-6", children: [_jsxs("div", { className: "mb-4 flex items-center gap-2", children: [_jsx(Shield, { className: "text-primary h-5 w-5" }), _jsx("h3", { className: "text-lg font-semibold", children: t("formSectionSecrets") })] }), _jsx("p", { className: "text-muted-foreground mb-4 text-sm", children: t("formSecretsDescription") }), _jsx(SecretsEditor, { secrets: secrets, errors: state.errors, onChange: handleSecretChange, secretPlaceholder: t("formSecretPlaceholder") })] })] }));
59
63
  };
@@ -4,7 +4,7 @@ import { EnhancedInput } from "@appcorp/shadcn/components/enhanced-input";
4
4
  import { EnhancedCheckbox } from "@appcorp/shadcn/components/enhanced-checkbox";
5
5
  import { useWorkspaceUserModule } from "./context";
6
6
  import { useTranslations } from "next-intl";
7
- import { getTranslatedError } from "@/utils/get-translated-error";
7
+ import { getTranslatedError } from "../../utils/get-translated-error";
8
8
  export const WorkspaceUserForm = () => {
9
9
  const { state, handleChange } = useWorkspaceUserModule();
10
10
  const { enabled, errors, roleId, userId, workspaceId } = state;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.2.89",
3
+ "version": "0.2.91",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",