@splpi/estore-shared-components 0.0.1

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.
@@ -0,0 +1,208 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import { IconType } from 'react-icons';
4
+ import { InputProps } from '@chakra-ui/react';
5
+
6
+ interface IPersonalInfo {
7
+ firstName?: string;
8
+ middleName?: string;
9
+ lastName?: string;
10
+ suffix?: string;
11
+ birthDate?: string;
12
+ idType?: string;
13
+ idNumber?: string;
14
+ height?: number;
15
+ weight?: number;
16
+ gender?: string;
17
+ civilStatus?: string;
18
+ nationality?: string;
19
+ mobileNumber?: string;
20
+ emailAddress?: string;
21
+ mailingAddress?: string;
22
+ landLineNumber?: string;
23
+ }
24
+ interface IAddress {
25
+ lot?: string;
26
+ street?: string;
27
+ barangay?: string;
28
+ city?: string;
29
+ province?: string;
30
+ district?: string;
31
+ }
32
+ interface IEmployment {
33
+ occupation?: string;
34
+ employerName?: string;
35
+ employmentStatus?: string;
36
+ officeAddress?: string;
37
+ TIN?: string;
38
+ SSS?: string;
39
+ sourceOfIncome?: string;
40
+ }
41
+ type BeneficiaryClass = "principal" | "contingent";
42
+ interface IBeneficiary {
43
+ firstName: string;
44
+ middleInitial: string;
45
+ lastName: string;
46
+ birthDate: string;
47
+ address: string;
48
+ relationship: string;
49
+ beneficiaryClass: string;
50
+ }
51
+ interface IHealthDeclaration {
52
+ healthDeclaration1: boolean;
53
+ healthDeclaration2: boolean;
54
+ healthDeclaration3: boolean;
55
+ healthDeclaration4: boolean;
56
+ }
57
+ interface IApplicationData {
58
+ personalInfo: IPersonalInfo;
59
+ address: IAddress;
60
+ employment: IEmployment;
61
+ beneficiaries: IBeneficiary[];
62
+ principalBeneficiary?: IBeneficiary;
63
+ contingentBeneficiary?: IBeneficiary;
64
+ healthDeclaration: IHealthDeclaration;
65
+ }
66
+ type ITransactionData = IApplicationData;
67
+
68
+ interface LifePlanApplication1Props {
69
+ initialData?: IPersonalInfo;
70
+ onUpdate?: (personalInfo: IPersonalInfo, address?: any) => void;
71
+ }
72
+ declare const LifePlanApplication1: ({ initialData, onUpdate, }: LifePlanApplication1Props) => react_jsx_runtime.JSX.Element;
73
+
74
+ interface LifePlanApplication2Props {
75
+ onAddressUpdate?: (address: IAddress) => void;
76
+ }
77
+ declare const LifePlanApplication2: ({ onAddressUpdate, }: LifePlanApplication2Props) => react_jsx_runtime.JSX.Element;
78
+
79
+ interface LifePlanApplication3Props {
80
+ initialData?: IEmployment;
81
+ onUpdate?: (employment: IEmployment) => void;
82
+ }
83
+ declare const LifePlanApplication3: ({ initialData, onUpdate, }: LifePlanApplication3Props) => react_jsx_runtime.JSX.Element;
84
+
85
+ interface BeneficiaryProps {
86
+ onUpdate?: (principal: IBeneficiary | undefined, contingent: IBeneficiary | undefined, all: IBeneficiary[]) => void;
87
+ }
88
+ declare const Beneficiary: ({ onUpdate }: BeneficiaryProps) => react_jsx_runtime.JSX.Element;
89
+
90
+ declare const HealthDeclaration: () => react_jsx_runtime.JSX.Element;
91
+
92
+ declare const LifePlanApplicationFormWrapper: ({ openSection, openSectionKey, onValidChange, }: {
93
+ openSection?: string;
94
+ openSectionKey?: number;
95
+ onValidChange?: (valid: boolean) => void;
96
+ }) => react_jsx_runtime.JSX.Element;
97
+
98
+ declare const LifePlanApplicationStepWrapper: () => react_jsx_runtime.JSX.Element;
99
+
100
+ type SharedLifePlanApplicationProps = {
101
+ title?: string;
102
+ description?: string;
103
+ onPaymentError?: (error: unknown) => void;
104
+ };
105
+ declare const SharedLifePlanApplication: ({ title, description, onPaymentError, }: SharedLifePlanApplicationProps) => react_jsx_runtime.JSX.Element;
106
+
107
+ type QuickAction = {
108
+ /** React Icons icon component */
109
+ icon: IconType;
110
+ /** Primary action label */
111
+ label: string;
112
+ /** Optional supporting text below the label */
113
+ description?: string;
114
+ /** Called when the item is tapped (can be combined with href) */
115
+ onClick?: () => void;
116
+ /** Wrap the item in a Next.js Link */
117
+ href?: string;
118
+ /** Icon bubble background — defaults to brand muted gray */
119
+ iconBg?: string;
120
+ /** Icon fill color — defaults to brand neutral text */
121
+ iconColor?: string;
122
+ };
123
+ type BottomQuickActionsProps = {
124
+ /** Controls open state */
125
+ open: boolean;
126
+ /** Called on close or backdrop tap */
127
+ onOpenChange: (open: boolean) => void;
128
+ /** Sheet heading — defaults to "Quick actions" */
129
+ title?: string;
130
+ /** Muted subtext below the title */
131
+ subtitle?: string;
132
+ /**
133
+ * Optional context card rendered between the title bar and the action list.
134
+ * Use `QuickActionsHeaderCard` for the standard "acting on which record" pattern,
135
+ * or pass any ReactNode.
136
+ */
137
+ headerSlot?: React.ReactNode;
138
+ /** The ordered list of actions */
139
+ actions: QuickAction[];
140
+ };
141
+ declare const BottomQuickActions: ({ open, onOpenChange, title, subtitle, headerSlot, actions, }: BottomQuickActionsProps) => react_jsx_runtime.JSX.Element;
142
+
143
+ type ColorModeValue = "light" | "dark";
144
+ type ToastType = "success" | "error";
145
+ interface ProfileUser {
146
+ displayName: string;
147
+ email?: string;
148
+ mobileNumber?: string;
149
+ role?: string;
150
+ avatarSrc?: string;
151
+ }
152
+ interface NavOptionDef {
153
+ key: string;
154
+ title: string;
155
+ href: string;
156
+ Icon: IconType;
157
+ activeIcon: IconType;
158
+ match: (pathname: string) => boolean;
159
+ roles: string[];
160
+ }
161
+ interface ReusableProfileProps {
162
+ user?: ProfileUser;
163
+ colorMode?: ColorModeValue;
164
+ onColorModeChange?: (mode: ColorModeValue) => void;
165
+ initialTwoFactorEnabled?: boolean;
166
+ initialQuickNavHrefs?: string[];
167
+ availableNavOptions?: NavOptionDef[];
168
+ maxQuickNavItems?: number;
169
+ enableLocalStorage?: boolean;
170
+ storageKey?: string;
171
+ onSaveAccount?: (payload: {
172
+ displayName: string;
173
+ }) => void | Promise<void>;
174
+ onChangePassword?: (payload: {
175
+ currentPassword: string;
176
+ newPassword: string;
177
+ }) => void | Promise<void>;
178
+ onSignOut?: () => void | Promise<void>;
179
+ onTwoFactorChange?: (enabled: boolean) => void | Promise<void>;
180
+ onToast?: (type: ToastType, message: string) => void;
181
+ }
182
+ declare function ReusableProfile({ user, colorMode: controlledColorMode, onColorModeChange, initialTwoFactorEnabled, initialQuickNavHrefs, availableNavOptions, maxQuickNavItems, enableLocalStorage, storageKey, onSaveAccount, onChangePassword, onSignOut, onTwoFactorChange, onToast, }: ReusableProfileProps): react_jsx_runtime.JSX.Element;
183
+
184
+ interface FloatingLabelInputProps extends InputProps {
185
+ label: React.ReactNode;
186
+ value?: string;
187
+ defaultValue?: string;
188
+ onValueChange?: (value: string) => void;
189
+ }
190
+ declare const FloatingLabelInput: (props: FloatingLabelInputProps) => react_jsx_runtime.JSX.Element;
191
+
192
+ interface CartItem {
193
+ planDesc: string;
194
+ mode: string;
195
+ planTerm: string;
196
+ quantity: number;
197
+ price: number;
198
+ total: number;
199
+ contractPrice: number;
200
+ ipInstAmt?: number;
201
+ balance?: number;
202
+ }
203
+
204
+ declare const createEmptyApplicationData: () => IApplicationData;
205
+ declare const loadApplicationDataFromLocalStorage: (storageKey?: string) => IApplicationData | null;
206
+ declare const saveApplicationDataToLocalStorage: (data: IApplicationData, storageKey?: string) => void;
207
+
208
+ export { Beneficiary, type BeneficiaryClass, BottomQuickActions, type CartItem, FloatingLabelInput, HealthDeclaration, type IAddress, type IApplicationData, type IBeneficiary, type IEmployment, type IHealthDeclaration, type IPersonalInfo, type ITransactionData, LifePlanApplication1, LifePlanApplication2, LifePlanApplication3, LifePlanApplicationFormWrapper, LifePlanApplicationStepWrapper, type NavOptionDef, type ProfileUser, type ReusableProfileProps, SharedLifePlanApplication, ReusableProfile as UserProfile, createEmptyApplicationData, loadApplicationDataFromLocalStorage, saveApplicationDataToLocalStorage };
@@ -0,0 +1,208 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import { IconType } from 'react-icons';
4
+ import { InputProps } from '@chakra-ui/react';
5
+
6
+ interface IPersonalInfo {
7
+ firstName?: string;
8
+ middleName?: string;
9
+ lastName?: string;
10
+ suffix?: string;
11
+ birthDate?: string;
12
+ idType?: string;
13
+ idNumber?: string;
14
+ height?: number;
15
+ weight?: number;
16
+ gender?: string;
17
+ civilStatus?: string;
18
+ nationality?: string;
19
+ mobileNumber?: string;
20
+ emailAddress?: string;
21
+ mailingAddress?: string;
22
+ landLineNumber?: string;
23
+ }
24
+ interface IAddress {
25
+ lot?: string;
26
+ street?: string;
27
+ barangay?: string;
28
+ city?: string;
29
+ province?: string;
30
+ district?: string;
31
+ }
32
+ interface IEmployment {
33
+ occupation?: string;
34
+ employerName?: string;
35
+ employmentStatus?: string;
36
+ officeAddress?: string;
37
+ TIN?: string;
38
+ SSS?: string;
39
+ sourceOfIncome?: string;
40
+ }
41
+ type BeneficiaryClass = "principal" | "contingent";
42
+ interface IBeneficiary {
43
+ firstName: string;
44
+ middleInitial: string;
45
+ lastName: string;
46
+ birthDate: string;
47
+ address: string;
48
+ relationship: string;
49
+ beneficiaryClass: string;
50
+ }
51
+ interface IHealthDeclaration {
52
+ healthDeclaration1: boolean;
53
+ healthDeclaration2: boolean;
54
+ healthDeclaration3: boolean;
55
+ healthDeclaration4: boolean;
56
+ }
57
+ interface IApplicationData {
58
+ personalInfo: IPersonalInfo;
59
+ address: IAddress;
60
+ employment: IEmployment;
61
+ beneficiaries: IBeneficiary[];
62
+ principalBeneficiary?: IBeneficiary;
63
+ contingentBeneficiary?: IBeneficiary;
64
+ healthDeclaration: IHealthDeclaration;
65
+ }
66
+ type ITransactionData = IApplicationData;
67
+
68
+ interface LifePlanApplication1Props {
69
+ initialData?: IPersonalInfo;
70
+ onUpdate?: (personalInfo: IPersonalInfo, address?: any) => void;
71
+ }
72
+ declare const LifePlanApplication1: ({ initialData, onUpdate, }: LifePlanApplication1Props) => react_jsx_runtime.JSX.Element;
73
+
74
+ interface LifePlanApplication2Props {
75
+ onAddressUpdate?: (address: IAddress) => void;
76
+ }
77
+ declare const LifePlanApplication2: ({ onAddressUpdate, }: LifePlanApplication2Props) => react_jsx_runtime.JSX.Element;
78
+
79
+ interface LifePlanApplication3Props {
80
+ initialData?: IEmployment;
81
+ onUpdate?: (employment: IEmployment) => void;
82
+ }
83
+ declare const LifePlanApplication3: ({ initialData, onUpdate, }: LifePlanApplication3Props) => react_jsx_runtime.JSX.Element;
84
+
85
+ interface BeneficiaryProps {
86
+ onUpdate?: (principal: IBeneficiary | undefined, contingent: IBeneficiary | undefined, all: IBeneficiary[]) => void;
87
+ }
88
+ declare const Beneficiary: ({ onUpdate }: BeneficiaryProps) => react_jsx_runtime.JSX.Element;
89
+
90
+ declare const HealthDeclaration: () => react_jsx_runtime.JSX.Element;
91
+
92
+ declare const LifePlanApplicationFormWrapper: ({ openSection, openSectionKey, onValidChange, }: {
93
+ openSection?: string;
94
+ openSectionKey?: number;
95
+ onValidChange?: (valid: boolean) => void;
96
+ }) => react_jsx_runtime.JSX.Element;
97
+
98
+ declare const LifePlanApplicationStepWrapper: () => react_jsx_runtime.JSX.Element;
99
+
100
+ type SharedLifePlanApplicationProps = {
101
+ title?: string;
102
+ description?: string;
103
+ onPaymentError?: (error: unknown) => void;
104
+ };
105
+ declare const SharedLifePlanApplication: ({ title, description, onPaymentError, }: SharedLifePlanApplicationProps) => react_jsx_runtime.JSX.Element;
106
+
107
+ type QuickAction = {
108
+ /** React Icons icon component */
109
+ icon: IconType;
110
+ /** Primary action label */
111
+ label: string;
112
+ /** Optional supporting text below the label */
113
+ description?: string;
114
+ /** Called when the item is tapped (can be combined with href) */
115
+ onClick?: () => void;
116
+ /** Wrap the item in a Next.js Link */
117
+ href?: string;
118
+ /** Icon bubble background — defaults to brand muted gray */
119
+ iconBg?: string;
120
+ /** Icon fill color — defaults to brand neutral text */
121
+ iconColor?: string;
122
+ };
123
+ type BottomQuickActionsProps = {
124
+ /** Controls open state */
125
+ open: boolean;
126
+ /** Called on close or backdrop tap */
127
+ onOpenChange: (open: boolean) => void;
128
+ /** Sheet heading — defaults to "Quick actions" */
129
+ title?: string;
130
+ /** Muted subtext below the title */
131
+ subtitle?: string;
132
+ /**
133
+ * Optional context card rendered between the title bar and the action list.
134
+ * Use `QuickActionsHeaderCard` for the standard "acting on which record" pattern,
135
+ * or pass any ReactNode.
136
+ */
137
+ headerSlot?: React.ReactNode;
138
+ /** The ordered list of actions */
139
+ actions: QuickAction[];
140
+ };
141
+ declare const BottomQuickActions: ({ open, onOpenChange, title, subtitle, headerSlot, actions, }: BottomQuickActionsProps) => react_jsx_runtime.JSX.Element;
142
+
143
+ type ColorModeValue = "light" | "dark";
144
+ type ToastType = "success" | "error";
145
+ interface ProfileUser {
146
+ displayName: string;
147
+ email?: string;
148
+ mobileNumber?: string;
149
+ role?: string;
150
+ avatarSrc?: string;
151
+ }
152
+ interface NavOptionDef {
153
+ key: string;
154
+ title: string;
155
+ href: string;
156
+ Icon: IconType;
157
+ activeIcon: IconType;
158
+ match: (pathname: string) => boolean;
159
+ roles: string[];
160
+ }
161
+ interface ReusableProfileProps {
162
+ user?: ProfileUser;
163
+ colorMode?: ColorModeValue;
164
+ onColorModeChange?: (mode: ColorModeValue) => void;
165
+ initialTwoFactorEnabled?: boolean;
166
+ initialQuickNavHrefs?: string[];
167
+ availableNavOptions?: NavOptionDef[];
168
+ maxQuickNavItems?: number;
169
+ enableLocalStorage?: boolean;
170
+ storageKey?: string;
171
+ onSaveAccount?: (payload: {
172
+ displayName: string;
173
+ }) => void | Promise<void>;
174
+ onChangePassword?: (payload: {
175
+ currentPassword: string;
176
+ newPassword: string;
177
+ }) => void | Promise<void>;
178
+ onSignOut?: () => void | Promise<void>;
179
+ onTwoFactorChange?: (enabled: boolean) => void | Promise<void>;
180
+ onToast?: (type: ToastType, message: string) => void;
181
+ }
182
+ declare function ReusableProfile({ user, colorMode: controlledColorMode, onColorModeChange, initialTwoFactorEnabled, initialQuickNavHrefs, availableNavOptions, maxQuickNavItems, enableLocalStorage, storageKey, onSaveAccount, onChangePassword, onSignOut, onTwoFactorChange, onToast, }: ReusableProfileProps): react_jsx_runtime.JSX.Element;
183
+
184
+ interface FloatingLabelInputProps extends InputProps {
185
+ label: React.ReactNode;
186
+ value?: string;
187
+ defaultValue?: string;
188
+ onValueChange?: (value: string) => void;
189
+ }
190
+ declare const FloatingLabelInput: (props: FloatingLabelInputProps) => react_jsx_runtime.JSX.Element;
191
+
192
+ interface CartItem {
193
+ planDesc: string;
194
+ mode: string;
195
+ planTerm: string;
196
+ quantity: number;
197
+ price: number;
198
+ total: number;
199
+ contractPrice: number;
200
+ ipInstAmt?: number;
201
+ balance?: number;
202
+ }
203
+
204
+ declare const createEmptyApplicationData: () => IApplicationData;
205
+ declare const loadApplicationDataFromLocalStorage: (storageKey?: string) => IApplicationData | null;
206
+ declare const saveApplicationDataToLocalStorage: (data: IApplicationData, storageKey?: string) => void;
207
+
208
+ export { Beneficiary, type BeneficiaryClass, BottomQuickActions, type CartItem, FloatingLabelInput, HealthDeclaration, type IAddress, type IApplicationData, type IBeneficiary, type IEmployment, type IHealthDeclaration, type IPersonalInfo, type ITransactionData, LifePlanApplication1, LifePlanApplication2, LifePlanApplication3, LifePlanApplicationFormWrapper, LifePlanApplicationStepWrapper, type NavOptionDef, type ProfileUser, type ReusableProfileProps, SharedLifePlanApplication, ReusableProfile as UserProfile, createEmptyApplicationData, loadApplicationDataFromLocalStorage, saveApplicationDataToLocalStorage };