warqadui 0.0.88 → 0.0.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -371,6 +371,62 @@ declare const Textarea: <T extends FieldValues>(props: TextareaProps<T> & {
371
371
  ref?: React.ForwardedRef<HTMLTextAreaElement>;
372
372
  }) => React.ReactElement;
373
373
 
374
+ declare const Enums: {
375
+ roles: readonly ["admin", "staff"];
376
+ sex: readonly ["male", "female"];
377
+ accountTypes: readonly ["employee", "supplier", "customer", "amaanah"];
378
+ verificationTypes: readonly ["email_verification", "password_reset"];
379
+ auditActions: readonly ["create", "update", "delete", "login", "logout"];
380
+ walletTypes: readonly ["bank", "cash", "mobile"];
381
+ currencies: readonly ["USD", "TZS", "KES", "CNY"];
382
+ };
383
+
384
+ interface ThemeConfig {
385
+ primaryColor?: string;
386
+ inputHeight?: string;
387
+ }
388
+ interface StoreConfig {
389
+ name?: string;
390
+ address?: string;
391
+ phone?: string;
392
+ email?: string;
393
+ logo?: string;
394
+ }
395
+ type EnumsConfig = {
396
+ [K in keyof typeof Enums]: string[] | readonly string[];
397
+ };
398
+ interface WarqadConfig {
399
+ api?: string;
400
+ theme?: ThemeConfig;
401
+ store?: StoreConfig;
402
+ enums?: Partial<EnumsConfig>;
403
+ }
404
+ interface WarqadConfigContextType {
405
+ config: WarqadConfig & {
406
+ theme: Required<ThemeConfig>;
407
+ store: Required<StoreConfig>;
408
+ enums: EnumsConfig;
409
+ };
410
+ }
411
+ /**
412
+ * Hook to access the current Warqad configuration.
413
+ */
414
+ declare const useWarqadConfig: () => WarqadConfig & {
415
+ theme: Required<ThemeConfig>;
416
+ store: Required<StoreConfig>;
417
+ enums: EnumsConfig;
418
+ };
419
+ interface WarqadProviderProps {
420
+ children: ReactNode;
421
+ config?: WarqadConfig;
422
+ }
423
+ /**
424
+ * WarqadProvider
425
+ *
426
+ * Provides configuration and theme values to the entire application.
427
+ */
428
+ declare const WarqadProvider: ({ children, config }: WarqadProviderProps) => react_jsx_runtime.JSX.Element;
429
+
374
430
  interface Option {
375
431
  value: string | number | boolean;
376
432
  label: string;
@@ -388,6 +444,8 @@ interface SelectProps extends Omit<React__default.SelectHTMLAttributes<HTMLSelec
388
444
  value?: any;
389
445
  variant?: "ghost" | "default";
390
446
  children?: ReactNode;
447
+ enum?: string[] | readonly string[];
448
+ enumName?: keyof EnumsConfig;
391
449
  }
392
450
  interface SelectContextValue {
393
451
  isOpen: boolean;
@@ -850,40 +908,6 @@ declare const useTransaction: ({ url, v, delay, params, dateFilter, }: {
850
908
  date: String | null | undefined;
851
909
  };
852
910
 
853
- interface ThemeConfig {
854
- primaryColor?: string;
855
- inputHeight?: string;
856
- }
857
- interface StoreConfig {
858
- name?: string;
859
- address?: string;
860
- phone?: string;
861
- email?: string;
862
- logo?: string;
863
- }
864
- interface WarqadConfig {
865
- api?: string;
866
- theme?: ThemeConfig;
867
- store?: StoreConfig;
868
- }
869
- interface WarqadConfigContextType {
870
- config: WarqadConfig;
871
- }
872
- /**
873
- * Hook to access the current Warqad configuration.
874
- */
875
- declare const useWarqadConfig: () => WarqadConfig;
876
- interface WarqadProviderProps {
877
- children: ReactNode;
878
- config?: WarqadConfig;
879
- }
880
- /**
881
- * WarqadProvider
882
- *
883
- * Provides configuration and theme values to the entire application.
884
- */
885
- declare const WarqadProvider: ({ children, config }: WarqadProviderProps) => react_jsx_runtime.JSX.Element;
886
-
887
911
  interface PdfOptions {
888
912
  orientation?: "portrait" | "landscape";
889
913
  unit?: "mm" | "cm" | "in" | "px";
@@ -1381,13 +1405,13 @@ declare const createWalletSchema: z$1.ZodObject<{
1381
1405
  branch: z$1.ZodOptional<z$1.ZodString>;
1382
1406
  }, "strip", z$1.ZodTypeAny, {
1383
1407
  name: string;
1384
- type: "mobile" | "bank" | "cash";
1408
+ type: "bank" | "cash" | "mobile";
1385
1409
  currency: "USD" | "TZS" | "KES" | "CNY";
1386
1410
  branch?: string | undefined;
1387
1411
  accountNo?: string | undefined;
1388
1412
  }, {
1389
1413
  name: string;
1390
- type: "mobile" | "bank" | "cash";
1414
+ type: "bank" | "cash" | "mobile";
1391
1415
  currency: "USD" | "TZS" | "KES" | "CNY";
1392
1416
  branch?: string | undefined;
1393
1417
  accountNo?: string | undefined;
@@ -1414,4 +1438,4 @@ declare const ErrorPage: (({ title, message, statusCode, action, className, }: E
1414
1438
  400: (props: ErrorPageProps) => react_jsx_runtime.JSX.Element;
1415
1439
  };
1416
1440
 
1417
- export { AccountFields, AccountForm, type AccountType, Accounts, AdminProtectedRoute, Badge, type BadgeProps, type BranchesContext, Branding, type BrandingProps, Breadcrumbs, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryCard, type CategoryItem, ClassicSpin, CodeBlock, ConfirmModal, type ConfirmModalProps, type CreateAccountSchemaType, type CreateWalletSchemaType, DashboardLayout, DataTable, type DataTableColumn, DateInput, type DateInputProps, type DeleteFunction, Dropdown, type DropdownItem, type DropdownProps, ErrorPage, type ErrorPageProps, type FetchFunction, type FetchProps, Fields, Guard, InfoGrid, Input, type InputProps, LinkUser, LoadingBox, LoadingSpin, type LoginSchema, type LoginTheme, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, type PostFunction, PostTable, type PostTableActions, type PostTableChangeParams, ProfileCard, type ProfileCardProps, ProfileDropdown, type ProfileDropdownItem, type ProfileDropdownProps, ProfilePage, ProfileView, type ProfileViewInfoItem, type ProfileViewProps, ProtectedRoute, type PutFunction, ResetPasswordPage, type Role, SearchApi, SearchApiContent, SearchApiInput, SearchApiItem, type SearchApiProps, SearchApiTrigger, Select, SelectContent, SelectItem, type SelectProps, SelectTrigger, SimpleTable, type SimpleTableColumn, type StorageManager, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, ThemedLogin, UnProtectedRoute, type UseModalReturn, UserForm, UserProfile, Users, Views, WalletField, WalletForm, Wallets, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, createAccountSchema, createUserSchema, type createUserSchemaType, createWalletSchema, generatePdf, linkUserSchema, type linkUserSchemaType, resetPasswordSchema, type resetPasswordSchemaType, storage, updateUserEmailSchema, type updateUserEmailSchemaType, useA4CategoryView, useA4StatementView, useAntdImageUpload, useApi, useApp, useAuth, useAuthStore, useLogin, useModal, useSearchApiContext, useSelectContext, useTheme, useTransaction, useWarqadConfig, verifyUserEmailSchema, type verifyUserEmailSchemaType };
1441
+ export { AccountFields, AccountForm, type AccountType, Accounts, AdminProtectedRoute, Badge, type BadgeProps, type BranchesContext, Branding, type BrandingProps, Breadcrumbs, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryCard, type CategoryItem, ClassicSpin, CodeBlock, ConfirmModal, type ConfirmModalProps, type CreateAccountSchemaType, type CreateWalletSchemaType, DashboardLayout, DataTable, type DataTableColumn, DateInput, type DateInputProps, type DeleteFunction, Dropdown, type DropdownItem, type DropdownProps, type EnumsConfig, ErrorPage, type ErrorPageProps, type FetchFunction, type FetchProps, Fields, Guard, InfoGrid, Input, type InputProps, LinkUser, LoadingBox, LoadingSpin, type LoginSchema, type LoginTheme, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, type PostFunction, PostTable, type PostTableActions, type PostTableChangeParams, ProfileCard, type ProfileCardProps, ProfileDropdown, type ProfileDropdownItem, type ProfileDropdownProps, ProfilePage, ProfileView, type ProfileViewInfoItem, type ProfileViewProps, ProtectedRoute, type PutFunction, ResetPasswordPage, type Role, SearchApi, SearchApiContent, SearchApiInput, SearchApiItem, type SearchApiProps, SearchApiTrigger, Select, SelectContent, SelectItem, type SelectProps, SelectTrigger, SimpleTable, type SimpleTableColumn, type StorageManager, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, ThemedLogin, UnProtectedRoute, type UseModalReturn, UserForm, UserProfile, Users, Views, WalletField, WalletForm, Wallets, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, createAccountSchema, createUserSchema, type createUserSchemaType, createWalletSchema, generatePdf, linkUserSchema, type linkUserSchemaType, resetPasswordSchema, type resetPasswordSchemaType, storage, updateUserEmailSchema, type updateUserEmailSchemaType, useA4CategoryView, useA4StatementView, useAntdImageUpload, useApi, useApp, useAuth, useAuthStore, useLogin, useModal, useSearchApiContext, useSelectContext, useTheme, useTransaction, useWarqadConfig, verifyUserEmailSchema, type verifyUserEmailSchemaType };
package/dist/index.d.ts CHANGED
@@ -371,6 +371,62 @@ declare const Textarea: <T extends FieldValues>(props: TextareaProps<T> & {
371
371
  ref?: React.ForwardedRef<HTMLTextAreaElement>;
372
372
  }) => React.ReactElement;
373
373
 
374
+ declare const Enums: {
375
+ roles: readonly ["admin", "staff"];
376
+ sex: readonly ["male", "female"];
377
+ accountTypes: readonly ["employee", "supplier", "customer", "amaanah"];
378
+ verificationTypes: readonly ["email_verification", "password_reset"];
379
+ auditActions: readonly ["create", "update", "delete", "login", "logout"];
380
+ walletTypes: readonly ["bank", "cash", "mobile"];
381
+ currencies: readonly ["USD", "TZS", "KES", "CNY"];
382
+ };
383
+
384
+ interface ThemeConfig {
385
+ primaryColor?: string;
386
+ inputHeight?: string;
387
+ }
388
+ interface StoreConfig {
389
+ name?: string;
390
+ address?: string;
391
+ phone?: string;
392
+ email?: string;
393
+ logo?: string;
394
+ }
395
+ type EnumsConfig = {
396
+ [K in keyof typeof Enums]: string[] | readonly string[];
397
+ };
398
+ interface WarqadConfig {
399
+ api?: string;
400
+ theme?: ThemeConfig;
401
+ store?: StoreConfig;
402
+ enums?: Partial<EnumsConfig>;
403
+ }
404
+ interface WarqadConfigContextType {
405
+ config: WarqadConfig & {
406
+ theme: Required<ThemeConfig>;
407
+ store: Required<StoreConfig>;
408
+ enums: EnumsConfig;
409
+ };
410
+ }
411
+ /**
412
+ * Hook to access the current Warqad configuration.
413
+ */
414
+ declare const useWarqadConfig: () => WarqadConfig & {
415
+ theme: Required<ThemeConfig>;
416
+ store: Required<StoreConfig>;
417
+ enums: EnumsConfig;
418
+ };
419
+ interface WarqadProviderProps {
420
+ children: ReactNode;
421
+ config?: WarqadConfig;
422
+ }
423
+ /**
424
+ * WarqadProvider
425
+ *
426
+ * Provides configuration and theme values to the entire application.
427
+ */
428
+ declare const WarqadProvider: ({ children, config }: WarqadProviderProps) => react_jsx_runtime.JSX.Element;
429
+
374
430
  interface Option {
375
431
  value: string | number | boolean;
376
432
  label: string;
@@ -388,6 +444,8 @@ interface SelectProps extends Omit<React__default.SelectHTMLAttributes<HTMLSelec
388
444
  value?: any;
389
445
  variant?: "ghost" | "default";
390
446
  children?: ReactNode;
447
+ enum?: string[] | readonly string[];
448
+ enumName?: keyof EnumsConfig;
391
449
  }
392
450
  interface SelectContextValue {
393
451
  isOpen: boolean;
@@ -850,40 +908,6 @@ declare const useTransaction: ({ url, v, delay, params, dateFilter, }: {
850
908
  date: String | null | undefined;
851
909
  };
852
910
 
853
- interface ThemeConfig {
854
- primaryColor?: string;
855
- inputHeight?: string;
856
- }
857
- interface StoreConfig {
858
- name?: string;
859
- address?: string;
860
- phone?: string;
861
- email?: string;
862
- logo?: string;
863
- }
864
- interface WarqadConfig {
865
- api?: string;
866
- theme?: ThemeConfig;
867
- store?: StoreConfig;
868
- }
869
- interface WarqadConfigContextType {
870
- config: WarqadConfig;
871
- }
872
- /**
873
- * Hook to access the current Warqad configuration.
874
- */
875
- declare const useWarqadConfig: () => WarqadConfig;
876
- interface WarqadProviderProps {
877
- children: ReactNode;
878
- config?: WarqadConfig;
879
- }
880
- /**
881
- * WarqadProvider
882
- *
883
- * Provides configuration and theme values to the entire application.
884
- */
885
- declare const WarqadProvider: ({ children, config }: WarqadProviderProps) => react_jsx_runtime.JSX.Element;
886
-
887
911
  interface PdfOptions {
888
912
  orientation?: "portrait" | "landscape";
889
913
  unit?: "mm" | "cm" | "in" | "px";
@@ -1381,13 +1405,13 @@ declare const createWalletSchema: z$1.ZodObject<{
1381
1405
  branch: z$1.ZodOptional<z$1.ZodString>;
1382
1406
  }, "strip", z$1.ZodTypeAny, {
1383
1407
  name: string;
1384
- type: "mobile" | "bank" | "cash";
1408
+ type: "bank" | "cash" | "mobile";
1385
1409
  currency: "USD" | "TZS" | "KES" | "CNY";
1386
1410
  branch?: string | undefined;
1387
1411
  accountNo?: string | undefined;
1388
1412
  }, {
1389
1413
  name: string;
1390
- type: "mobile" | "bank" | "cash";
1414
+ type: "bank" | "cash" | "mobile";
1391
1415
  currency: "USD" | "TZS" | "KES" | "CNY";
1392
1416
  branch?: string | undefined;
1393
1417
  accountNo?: string | undefined;
@@ -1414,4 +1438,4 @@ declare const ErrorPage: (({ title, message, statusCode, action, className, }: E
1414
1438
  400: (props: ErrorPageProps) => react_jsx_runtime.JSX.Element;
1415
1439
  };
1416
1440
 
1417
- export { AccountFields, AccountForm, type AccountType, Accounts, AdminProtectedRoute, Badge, type BadgeProps, type BranchesContext, Branding, type BrandingProps, Breadcrumbs, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryCard, type CategoryItem, ClassicSpin, CodeBlock, ConfirmModal, type ConfirmModalProps, type CreateAccountSchemaType, type CreateWalletSchemaType, DashboardLayout, DataTable, type DataTableColumn, DateInput, type DateInputProps, type DeleteFunction, Dropdown, type DropdownItem, type DropdownProps, ErrorPage, type ErrorPageProps, type FetchFunction, type FetchProps, Fields, Guard, InfoGrid, Input, type InputProps, LinkUser, LoadingBox, LoadingSpin, type LoginSchema, type LoginTheme, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, type PostFunction, PostTable, type PostTableActions, type PostTableChangeParams, ProfileCard, type ProfileCardProps, ProfileDropdown, type ProfileDropdownItem, type ProfileDropdownProps, ProfilePage, ProfileView, type ProfileViewInfoItem, type ProfileViewProps, ProtectedRoute, type PutFunction, ResetPasswordPage, type Role, SearchApi, SearchApiContent, SearchApiInput, SearchApiItem, type SearchApiProps, SearchApiTrigger, Select, SelectContent, SelectItem, type SelectProps, SelectTrigger, SimpleTable, type SimpleTableColumn, type StorageManager, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, ThemedLogin, UnProtectedRoute, type UseModalReturn, UserForm, UserProfile, Users, Views, WalletField, WalletForm, Wallets, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, createAccountSchema, createUserSchema, type createUserSchemaType, createWalletSchema, generatePdf, linkUserSchema, type linkUserSchemaType, resetPasswordSchema, type resetPasswordSchemaType, storage, updateUserEmailSchema, type updateUserEmailSchemaType, useA4CategoryView, useA4StatementView, useAntdImageUpload, useApi, useApp, useAuth, useAuthStore, useLogin, useModal, useSearchApiContext, useSelectContext, useTheme, useTransaction, useWarqadConfig, verifyUserEmailSchema, type verifyUserEmailSchemaType };
1441
+ export { AccountFields, AccountForm, type AccountType, Accounts, AdminProtectedRoute, Badge, type BadgeProps, type BranchesContext, Branding, type BrandingProps, Breadcrumbs, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryCard, type CategoryItem, ClassicSpin, CodeBlock, ConfirmModal, type ConfirmModalProps, type CreateAccountSchemaType, type CreateWalletSchemaType, DashboardLayout, DataTable, type DataTableColumn, DateInput, type DateInputProps, type DeleteFunction, Dropdown, type DropdownItem, type DropdownProps, type EnumsConfig, ErrorPage, type ErrorPageProps, type FetchFunction, type FetchProps, Fields, Guard, InfoGrid, Input, type InputProps, LinkUser, LoadingBox, LoadingSpin, type LoginSchema, type LoginTheme, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, type PostFunction, PostTable, type PostTableActions, type PostTableChangeParams, ProfileCard, type ProfileCardProps, ProfileDropdown, type ProfileDropdownItem, type ProfileDropdownProps, ProfilePage, ProfileView, type ProfileViewInfoItem, type ProfileViewProps, ProtectedRoute, type PutFunction, ResetPasswordPage, type Role, SearchApi, SearchApiContent, SearchApiInput, SearchApiItem, type SearchApiProps, SearchApiTrigger, Select, SelectContent, SelectItem, type SelectProps, SelectTrigger, SimpleTable, type SimpleTableColumn, type StorageManager, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, ThemedLogin, UnProtectedRoute, type UseModalReturn, UserForm, UserProfile, Users, Views, WalletField, WalletForm, Wallets, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, createAccountSchema, createUserSchema, type createUserSchemaType, createWalletSchema, generatePdf, linkUserSchema, type linkUserSchemaType, resetPasswordSchema, type resetPasswordSchemaType, storage, updateUserEmailSchema, type updateUserEmailSchemaType, useA4CategoryView, useA4StatementView, useAntdImageUpload, useApi, useApp, useAuth, useAuthStore, useLogin, useModal, useSearchApiContext, useSelectContext, useTheme, useTransaction, useWarqadConfig, verifyUserEmailSchema, type verifyUserEmailSchemaType };