ingeniuscliq-core 0.0.11 → 0.0.13

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.
Files changed (143) hide show
  1. package/dist/assets/index.d.ts +4 -0
  2. package/dist/classes/CoreBuilder.d.ts +3 -0
  3. package/dist/components/config.d.ts +22 -0
  4. package/dist/components/customs/carousel/CustomCarousel.d.ts +7 -0
  5. package/dist/components/customs/carousel/CustomCarouselSection.d.ts +11 -0
  6. package/dist/components/customs/carousel/index.d.ts +2 -0
  7. package/dist/components/customs/form/CustomFormField.d.ts +12 -0
  8. package/dist/components/customs/form/FormInput.d.ts +16 -0
  9. package/dist/components/customs/form/FormTextArea.d.ts +9 -0
  10. package/dist/components/customs/form/FormWrapper.d.ts +8 -0
  11. package/dist/components/customs/index.d.ts +1 -0
  12. package/dist/components/customs/logo/Logo.d.ts +6 -0
  13. package/dist/components/customs/pagination/CustomPagination.d.ts +7 -0
  14. package/dist/components/customs/select/CustomSelect.d.ts +10 -0
  15. package/dist/components/customs/spinner/Spinner.d.ts +7 -0
  16. package/dist/components/layouts/CoreBaseLayout.d.ts +9 -0
  17. package/dist/components/templates/CoreHomeLayout.d.ts +5 -0
  18. package/dist/components/templates/CorePreviewLayout.d.ts +2 -0
  19. package/dist/components/templates/partials/CoreFooter.d.ts +1 -0
  20. package/dist/components/templates/partials/CoreHeader.d.ts +6 -0
  21. package/dist/components/templates/partials/CoreMainSearch.d.ts +8 -0
  22. package/dist/components/templates/partials/CoreNavbar.d.ts +8 -0
  23. package/dist/components/templates/partials/CoreSubMenu.d.ts +6 -0
  24. package/dist/components/templates/partials/CoreSubMenuHeader.d.ts +7 -0
  25. package/dist/components/templates/partials/DynamicHeader.d.ts +7 -0
  26. package/dist/components/templates/partials/DynamicMain.d.ts +5 -0
  27. package/dist/components/ui/accordion.d.ts +7 -0
  28. package/dist/components/ui/alert-dialog.d.ts +14 -0
  29. package/dist/components/ui/alert.d.ts +9 -0
  30. package/dist/components/ui/avatar.d.ts +6 -0
  31. package/dist/components/ui/badge.d.ts +9 -0
  32. package/dist/components/ui/breadcrumb.d.ts +11 -0
  33. package/dist/components/ui/button.d.ts +10 -0
  34. package/dist/components/ui/calendar.d.ts +4 -0
  35. package/dist/components/ui/card.d.ts +9 -0
  36. package/dist/components/ui/carousel.d.ts +19 -0
  37. package/dist/components/ui/checkbox.d.ts +4 -0
  38. package/dist/components/ui/dialog.d.ts +15 -0
  39. package/dist/components/ui/drawer.d.ts +13 -0
  40. package/dist/components/ui/dropdown-menu.d.ts +25 -0
  41. package/dist/components/ui/form.d.ts +24 -0
  42. package/dist/components/ui/input.d.ts +5 -0
  43. package/dist/components/ui/label.d.ts +4 -0
  44. package/dist/components/ui/navigation-menu.d.ts +14 -0
  45. package/dist/components/ui/pagination.d.ts +13 -0
  46. package/dist/components/ui/popover.d.ts +7 -0
  47. package/dist/components/ui/radio-group.d.ts +5 -0
  48. package/dist/components/ui/select.d.ts +15 -0
  49. package/dist/components/ui/separator.d.ts +4 -0
  50. package/dist/components/ui/sheet.d.ts +13 -0
  51. package/dist/components/ui/sidebar.d.ts +69 -0
  52. package/dist/components/ui/skeleton.d.ts +2 -0
  53. package/dist/components/ui/slider.d.ts +4 -0
  54. package/dist/components/ui/sonner.d.ts +3 -0
  55. package/dist/components/ui/stepper.d.ts +18 -0
  56. package/dist/components/ui/switch.d.ts +4 -0
  57. package/dist/components/ui/table.d.ts +10 -0
  58. package/dist/components/ui/tabs.d.ts +7 -0
  59. package/dist/components/ui/textarea.d.ts +3 -0
  60. package/dist/components/ui/tooltip.d.ts +7 -0
  61. package/dist/constants/menu.d.ts +2 -0
  62. package/dist/helpers/axiosGlobal.d.ts +7 -0
  63. package/dist/helpers/strings.d.ts +1 -0
  64. package/dist/helpers/template.d.ts +4 -0
  65. package/dist/helpers/tenant.d.ts +3 -0
  66. package/dist/hooks/use-mobile.d.ts +1 -0
  67. package/dist/hooks/useI18n.d.ts +5 -0
  68. package/dist/hooks/useNotification.d.ts +6 -0
  69. package/dist/i18n/config.d.ts +130 -0
  70. package/dist/i18n/utils/loadModuleTranslations.d.ts +8 -0
  71. package/dist/index.d.ts +1 -1
  72. package/dist/lib/utils.d.ts +2 -0
  73. package/dist/modules/CoreAuth/components/layouts/partials/AuthDecorator.d.ts +1 -0
  74. package/dist/modules/CoreAuth/components/layouts/partials/AuthProfileDeleteAccountForm.d.ts +1 -0
  75. package/dist/modules/CoreAuth/components/layouts/partials/AuthProfileForm.d.ts +1 -0
  76. package/dist/modules/CoreAuth/components/layouts/partials/AuthProfileUpdatePassForm.d.ts +1 -0
  77. package/dist/modules/CoreAuth/components/layouts/partials/AuthUserMenu.d.ts +1 -0
  78. package/dist/modules/CoreAuth/constants/auth.d.ts +5 -0
  79. package/dist/modules/CoreAuth/hooks/useAuth.d.ts +18 -0
  80. package/dist/modules/CoreAuth/index.d.ts +1 -0
  81. package/dist/modules/CoreAuth/services/base.d.ts +23 -0
  82. package/dist/modules/CoreAuth/stores/authStore.d.ts +22 -0
  83. package/dist/modules/CoreAuth/types/CoreAuth.d.ts +25 -0
  84. package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.d.ts +30 -0
  85. package/dist/modules/CoreCustomization/index.d.ts +1 -0
  86. package/dist/modules/CoreCustomization/services/base.d.ts +10 -0
  87. package/dist/modules/CoreCustomization/types/CoreCustomization.d.ts +22 -0
  88. package/dist/modules/CoreOrder/classes/CoreOrderBuilder.d.ts +23 -0
  89. package/dist/modules/CoreOrder/index.d.ts +1 -0
  90. package/dist/modules/CoreOrder/services/base.d.ts +7 -0
  91. package/dist/modules/CoreOrder/types/CoreOrder.d.ts +41 -0
  92. package/dist/modules/CoreOrder/types/interfaces/OrderActions.d.ts +14 -0
  93. package/dist/modules/CorePayForm/classes/CorePayFormBuilder.d.ts +23 -0
  94. package/dist/modules/CorePayForm/index.d.ts +1 -0
  95. package/dist/modules/CorePayForm/services/base.d.ts +7 -0
  96. package/dist/modules/CorePayForm/types/CorePayForm.d.ts +19 -0
  97. package/dist/modules/CoreProduct/classes/CoreProductBuilder.d.ts +25 -0
  98. package/dist/modules/CoreProduct/components/layouts/partials/TabHead.d.ts +6 -0
  99. package/dist/modules/CoreProduct/components/ui/cards/CoreProductCard.d.ts +15 -0
  100. package/dist/modules/CoreProduct/components/ui/cards/CoreProductCardActions.d.ts +18 -0
  101. package/dist/modules/CoreProduct/components/ui/cards/CoreProductCartItemAsideCard.d.ts +7 -0
  102. package/dist/modules/CoreProduct/components/ui/cards/CoreProductCartItemCard.d.ts +8 -0
  103. package/dist/modules/CoreProduct/components/ui/cards/CoreProductCartSummaryCard.d.ts +7 -0
  104. package/dist/modules/CoreProduct/components/ui/cards/addons/WarrantyLabel.d.ts +10 -0
  105. package/dist/modules/CoreProduct/components/ui/cards/skeletons/CoreProductCardSkeleton.d.ts +5 -0
  106. package/dist/modules/CoreProduct/components/ui/cards/skeletons/CoreProductCartItemCardSkeleton.d.ts +1 -0
  107. package/dist/modules/CoreProduct/components/ui/carousels/CoreProductImageCarousel.d.ts +8 -0
  108. package/dist/modules/CoreProduct/components/ui/containers/CoreProductGrid.d.ts +19 -0
  109. package/dist/modules/CoreProduct/index.d.ts +1 -0
  110. package/dist/modules/CoreProduct/services/base.d.ts +7 -0
  111. package/dist/modules/CoreProduct/types/CoreProduct.d.ts +33 -0
  112. package/dist/modules/CoreProduct/types/CoreProductCategory.d.ts +10 -0
  113. package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.d.ts +25 -0
  114. package/dist/modules/CoreShopCart/components/layouts/partials/CoreShopCartAside.d.ts +12 -0
  115. package/dist/modules/CoreShopCart/components/layouts/partials/CoreShopCartIcon.d.ts +7 -0
  116. package/dist/modules/CoreShopCart/components/ui/cards/CoreCartItemAsideCard.d.ts +9 -0
  117. package/dist/modules/CoreShopCart/components/ui/cards/skeletons/CoreCartItemAsideCardSkeleton.d.ts +4 -0
  118. package/dist/modules/CoreShopCart/components/ui/empty/EmptyCartItems.d.ts +1 -0
  119. package/dist/modules/CoreShopCart/components/ui/texts/CoreCartHintTitle.d.ts +8 -0
  120. package/dist/modules/CoreShopCart/components/ui/texts/CoreCartSubtotalText.d.ts +7 -0
  121. package/dist/modules/CoreShopCart/components/ui/texts/CoreCartSummaryHead.d.ts +6 -0
  122. package/dist/modules/CoreShopCart/components/ui/texts/CoreCartSummaryText.d.ts +7 -0
  123. package/dist/modules/CoreShopCart/constants/shopCart.d.ts +6 -0
  124. package/dist/modules/CoreShopCart/index.d.ts +1 -0
  125. package/dist/modules/CoreShopCart/services/base.d.ts +16 -0
  126. package/dist/modules/CoreShopCart/types/CoreShopCart.d.ts +32 -0
  127. package/dist/modules/CoreShopCart/types/interfaces/CartActions.d.ts +23 -0
  128. package/dist/modules/index.d.ts +0 -0
  129. package/dist/services/base.d.ts +38 -0
  130. package/dist/stores/customizationStore.d.ts +21 -0
  131. package/dist/types/BaseStore.d.ts +7 -0
  132. package/dist/types/BaseType.d.ts +5 -0
  133. package/dist/types/CoreImage.d.ts +5 -0
  134. package/dist/types/CoreMenu.d.ts +6 -0
  135. package/dist/types/contracts/BaseApiResponse.d.ts +7 -0
  136. package/dist/types/contracts/BasePagination.d.ts +9 -0
  137. package/dist/types/interfaces/BaseImageType.d.ts +7 -0
  138. package/dist/types/interfaces/BaseSlugType.d.ts +3 -0
  139. package/dist/types/interfaces/BaseVisibleType.d.ts +3 -0
  140. package/dist/types/ui/carousel.d.ts +5 -0
  141. package/dist/types/ui/index.d.ts +8 -0
  142. package/dist/types/ui/template.d.ts +19 -0
  143. package/package.json +1 -1
@@ -0,0 +1,23 @@
1
+ import { CoreBuilder } from '../../../classes/CoreBuilder';
2
+ import { CorePayFormBaseService } from '../services/base';
3
+ import { CorePayForm, CorePayFormStore } from '../types/CorePayForm';
4
+ export declare class CorePayFormBuilder implements CoreBuilder {
5
+ protected payFormService: CorePayFormBaseService;
6
+ protected initialState: Pick<CorePayFormStore<CorePayForm>, "payForms" | "loading" | "error">;
7
+ constructor(service?: CorePayFormBaseService, initialState?: any);
8
+ build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CorePayFormStore<CorePayForm>>, "persist"> & {
9
+ persist: {
10
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CorePayFormStore<CorePayForm>, {
11
+ payForms: import('../../../types/contracts/BasePagination').BasePagination<CorePayForm> | null;
12
+ }>>) => void;
13
+ clearStorage: () => void;
14
+ rehydrate: () => Promise<void> | void;
15
+ hasHydrated: () => boolean;
16
+ onHydrate: (fn: (state: CorePayFormStore<CorePayForm>) => void) => () => void;
17
+ onFinishHydration: (fn: (state: CorePayFormStore<CorePayForm>) => void) => () => void;
18
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<CorePayFormStore<CorePayForm>, {
19
+ payForms: import('../../../types/contracts/BasePagination').BasePagination<CorePayForm> | null;
20
+ }>>;
21
+ };
22
+ }>;
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { BaseService } from '../../../services/base';
2
+ /**
3
+ * Base class that can be extended by concrete services
4
+ */
5
+ export declare class CorePayFormBaseService extends BaseService {
6
+ constructor();
7
+ }
@@ -0,0 +1,19 @@
1
+ import { BaseStore } from '../../../types/BaseStore';
2
+ import { BaseType } from '../../../types/BaseType';
3
+ import { BaseApiResponsePagination } from '../../../types/contracts/BaseApiResponse';
4
+ import { BasePagination } from '../../../types/contracts/BasePagination';
5
+ /**
6
+ * CorePayForm base type
7
+ */
8
+ export interface CorePayForm extends BaseType {
9
+ name: string;
10
+ icon: string;
11
+ description: string;
12
+ currencies: string[];
13
+ }
14
+ export interface CorePayFormStore<T extends CorePayForm> extends BaseStore {
15
+ payForms: BasePagination<T> | null;
16
+ setPayForms: (payForms: BasePagination<T> | null) => void;
17
+ getPayForms: () => BasePagination<T> | null;
18
+ fetchPayForms: (params?: Record<string, any>) => Promise<BaseApiResponsePagination<T>>;
19
+ }
@@ -0,0 +1,25 @@
1
+ import { CoreBuilder } from '../../../classes/CoreBuilder';
2
+ import { CoreProductBaseService } from '../services/base';
3
+ import { CoreProduct, CoreProductStore } from '../types/CoreProduct';
4
+ export declare class CoreProductBuilder implements CoreBuilder {
5
+ protected productService: CoreProductBaseService;
6
+ protected initialState: Pick<CoreProductStore<CoreProduct>, "productDetails" | "products" | "loading" | "error">;
7
+ constructor(service?: CoreProductBaseService, initialState?: any);
8
+ build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CoreProductStore<CoreProduct>>, "persist"> & {
9
+ persist: {
10
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CoreProductStore<CoreProduct>, {
11
+ productDetails: CoreProduct | null;
12
+ products: import('../../../types/contracts/BasePagination').BasePagination<CoreProduct> | null;
13
+ }>>) => void;
14
+ clearStorage: () => void;
15
+ rehydrate: () => Promise<void> | void;
16
+ hasHydrated: () => boolean;
17
+ onHydrate: (fn: (state: CoreProductStore<CoreProduct>) => void) => () => void;
18
+ onFinishHydration: (fn: (state: CoreProductStore<CoreProduct>) => void) => () => void;
19
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<CoreProductStore<CoreProduct>, {
20
+ productDetails: CoreProduct | null;
21
+ products: import('../../../types/contracts/BasePagination').BasePagination<CoreProduct> | null;
22
+ }>>;
23
+ };
24
+ }>;
25
+ }
@@ -0,0 +1,6 @@
1
+ import { BaseStyleProps } from '../../../../../types/ui';
2
+ interface TabHeadProps extends BaseStyleProps {
3
+ readonly title: string;
4
+ }
5
+ export default function TabHead({ title, className }: TabHeadProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,15 @@
1
+ import { CoreProduct } from '../../../types/CoreProduct';
2
+ import { BaseStyleProps } from '../../../../../types/ui';
3
+ import { CoreProductCardActionsEvents } from './CoreProductCardActions';
4
+ interface CoreProductCardProps extends BaseStyleProps, Omit<CoreProductCardActionsEvents, 'onAddToCart'>, CoreProductCardEvents {
5
+ readonly product: CoreProduct;
6
+ readonly renderActions?: React.ReactNode;
7
+ readonly loadingAddToCart?: boolean;
8
+ readonly renderAddons?: React.ReactNode;
9
+ }
10
+ interface CoreProductCardEvents {
11
+ onClick: (product: CoreProduct) => void;
12
+ onAddToCart: (product: CoreProduct, quantity: number) => void;
13
+ }
14
+ export default function CoreProductCard({ product, className, renderAddons, renderActions, loadingAddToCart, onUpdateQuantity, onAddToCart, onClick }: CoreProductCardProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,18 @@
1
+ import { BaseStyleProps, BaseVariantProps } from '../../../../../types/ui';
2
+ export interface CoreProductCardActionsProps extends BaseStyleProps, CoreProductCardActionsEvents, BaseVariantProps {
3
+ readonly disabledColor?: boolean;
4
+ readonly productQuantity?: number;
5
+ readonly minValue?: number;
6
+ readonly maxValue?: number;
7
+ readonly colorLoading?: string;
8
+ readonly loading?: boolean;
9
+ }
10
+ export interface CoreProductCardActionsEvents {
11
+ onUpdateQuantity?: (quantity: number) => void;
12
+ onAddToCart?: (quantity: number) => void;
13
+ onValidateUpdateQuantity?: () => boolean;
14
+ onValidateAddToCart?: () => boolean;
15
+ onErrorUpdateQuantity?: () => void;
16
+ onErrorAddToCart?: () => void;
17
+ }
18
+ export default function CoreProductCardActions({ disabledColor, variant, productQuantity, minValue, maxValue, colorLoading, loading, className, onUpdateQuantity, onAddToCart, onValidateUpdateQuantity, onValidateAddToCart, onErrorAddToCart, onErrorUpdateQuantity }: CoreProductCardActionsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { CoreProduct } from '../../../types/CoreProduct';
2
+ interface CoreProductCartItemAsideCardProps<T extends CoreProduct> {
3
+ product: T;
4
+ quantity: number;
5
+ }
6
+ export default function CoreProductCartItemAsideCard<T extends CoreProduct>({ product, quantity }: CoreProductCartItemAsideCardProps<T>): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { CoreProduct } from '../../../types/CoreProduct';
2
+ interface CoreProductCartItemCardProps<T extends CoreProduct> {
3
+ product: T;
4
+ quantity: number;
5
+ actions: React.ReactNode;
6
+ }
7
+ export default function CoreProductCartItemCard<T extends CoreProduct>({ product, actions, quantity }: CoreProductCartItemCardProps<T>): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import { CoreProduct } from '../../../types/CoreProduct';
2
+ import { BaseProps } from '../../../../../types/ui';
3
+ interface CoreProductCartSummaryCardProps<T extends CoreProduct> extends BaseProps {
4
+ product: T;
5
+ }
6
+ export default function CoreProductCartSummaryCard<T extends CoreProduct>({ product, children, className }: CoreProductCartSummaryCardProps<T>): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ export declare enum SUPPORTED_WARRANTY_VARIANTS_ENUM {
2
+ primary = "primary",
3
+ secondary = "secondary"
4
+ }
5
+ export type SUPPORTED_WARRANTY_VARIANTS = keyof typeof SUPPORTED_WARRANTY_VARIANTS_ENUM;
6
+ export interface WarrantyLabelProps {
7
+ readonly warrantyText?: string;
8
+ readonly variant: SUPPORTED_WARRANTY_VARIANTS_ENUM;
9
+ }
10
+ export default function WarrantyLabel({ warrantyText, variant }: WarrantyLabelProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { BaseStyleProps } from '../../../../../../types/ui';
2
+ interface CoreProductCardSkeletonProps extends BaseStyleProps {
3
+ }
4
+ export default function CoreProductCardSkeleton({ className }: CoreProductCardSkeletonProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1 @@
1
+ export default function CoreProductCartItemCardSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { BaseProps } from '../../../../../types/ui';
2
+ import { CoreImage } from '../../../../../types/CoreImage';
3
+ interface CoreProductImageCarouselProps<T extends CoreImage> extends BaseProps {
4
+ readonly renderAddons?: React.ReactNode;
5
+ readonly images: T[];
6
+ }
7
+ export default function CoreProductImageCarousel<T extends CoreImage>({ className, renderAddons, images }: CoreProductImageCarouselProps<T>): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,19 @@
1
+ import { BaseStyleProps } from '../../../../../types/ui';
2
+ import { BasePagination } from '../../../../../types/contracts/BasePagination';
3
+ import { CoreProduct } from '../../../types/CoreProduct';
4
+ interface CoreProductGridProps<T extends CoreProduct> extends BaseStyleProps, CoreProductGridEvents<T> {
5
+ readonly products: BasePagination<T>;
6
+ readonly component?: React.ComponentType<any>;
7
+ readonly classNameItems?: string;
8
+ readonly loading?: boolean;
9
+ readonly skeleton?: React.ComponentType<any>;
10
+ readonly skeletonItems?: number;
11
+ readonly skeletonClassName?: string;
12
+ [key: string]: any;
13
+ }
14
+ interface CoreProductGridEvents<T extends CoreProduct> {
15
+ onItemClick?: (product: T) => void;
16
+ onPageChange?: (page: number) => void;
17
+ }
18
+ export default function CoreProductGrid<T extends CoreProduct>({ products, onPageChange, component: Component, className, classNameItems, loading, skeleton: Skeleton, skeletonItems, skeletonClassName, onItemClick, ...props }: CoreProductGridProps<T>): import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { BaseService } from '../../../services/base';
2
+ /**
3
+ * Base class that can be extended by concrete services
4
+ */
5
+ export declare class CoreProductBaseService extends BaseService {
6
+ constructor();
7
+ }
@@ -0,0 +1,33 @@
1
+ import { BasePagination } from '../../../types/contracts/BasePagination';
2
+ import { BaseStore } from '../../../types/BaseStore';
3
+ import { BaseType } from '../../../types/BaseType';
4
+ import { BaseImagesType } from '../../../types/interfaces/BaseImageType';
5
+ import { BaseSlugType } from '../../../types/interfaces/BaseSlugType';
6
+ import { BaseVisibleType } from '../../../types/interfaces/BaseVisibleType';
7
+ import { HasProductCategories } from './CoreProductCategory';
8
+ import { BaseApiResponse, BaseApiResponsePagination } from '../../../types/contracts/BaseApiResponse';
9
+ /**
10
+ * CoreProduct base type
11
+ */
12
+ export interface CoreProduct extends BaseType, BaseSlugType, BaseImagesType, BaseVisibleType, HasProductCategories {
13
+ name: string;
14
+ sku: string;
15
+ description: string;
16
+ regular_price: number;
17
+ sale_price: number;
18
+ handle_stock: boolean;
19
+ stock: number;
20
+ stock_for_sale: number;
21
+ unit_of_measurement: string;
22
+ short_description: string;
23
+ }
24
+ export interface CoreProductStore<T extends CoreProduct> extends BaseStore {
25
+ productDetails: T | null;
26
+ products: BasePagination<T> | null;
27
+ setProducts: (products: BasePagination<T> | null) => void;
28
+ setProductDetails: (product: T | null) => void;
29
+ fetchProducts: (params?: Record<string, any>) => Promise<BaseApiResponsePagination<T>>;
30
+ getProducts: () => BasePagination<T> | null;
31
+ getProductDetails: () => T | null;
32
+ fetchProductDetails: (id: string | number) => Promise<BaseApiResponse<T>>;
33
+ }
@@ -0,0 +1,10 @@
1
+ import { BaseType } from '../../../types/BaseType';
2
+ export interface CoreProductCategory extends BaseType {
3
+ name: string;
4
+ }
5
+ export interface HasProductCategories {
6
+ categories?: CoreProductCategory[];
7
+ }
8
+ export interface HasProbablyProductCategories {
9
+ categories?: CoreProductCategory[];
10
+ }
@@ -0,0 +1,25 @@
1
+ import { CoreShopCartBaseService } from '../services/base';
2
+ import { CoreShopCartStore } from '../types/CoreShopCart';
3
+ import { CoreBuilder } from '../../../classes/CoreBuilder';
4
+ export declare class CoreShopCartBuilder<T> implements CoreBuilder {
5
+ protected shopCartService: CoreShopCartBaseService<T>;
6
+ protected initialState: Pick<CoreShopCartStore<T>, 'cart' | 'cartItems'>;
7
+ constructor(service?: CoreShopCartBaseService<T>, initialState?: Pick<CoreShopCartStore<T>, 'cart' | 'cartItems'>);
8
+ build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CoreShopCartStore<T>>, "persist"> & {
9
+ persist: {
10
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CoreShopCartStore<T>, {
11
+ cart: import('../types/CoreShopCart').CoreShopCart<T>;
12
+ cartItems: import('../types/CoreShopCart').CoreCartItem<T>[];
13
+ }>>) => void;
14
+ clearStorage: () => void;
15
+ rehydrate: () => Promise<void> | void;
16
+ hasHydrated: () => boolean;
17
+ onHydrate: (fn: (state: CoreShopCartStore<T>) => void) => () => void;
18
+ onFinishHydration: (fn: (state: CoreShopCartStore<T>) => void) => () => void;
19
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<CoreShopCartStore<T>, {
20
+ cart: import('../types/CoreShopCart').CoreShopCart<T>;
21
+ cartItems: import('../types/CoreShopCart').CoreCartItem<T>[];
22
+ }>>;
23
+ };
24
+ }>;
25
+ }
@@ -0,0 +1,12 @@
1
+ import { BaseProps } from '../../../../../types/ui';
2
+ interface CoreShopCartAsideProps extends CoreShopCartAsideEvents, BaseProps {
3
+ title: string;
4
+ containerClassName?: string;
5
+ renderTriggerAction?: React.ReactNode;
6
+ }
7
+ interface CoreShopCartAsideEvents {
8
+ onClose?: () => void;
9
+ onGoToCart?: () => void;
10
+ }
11
+ export default function CoreShopCartAside({ title, className, containerClassName, children, onClose, onGoToCart, renderTriggerAction }: CoreShopCartAsideProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,7 @@
1
+ import { BaseStyleProps } from '../../../../../types/ui';
2
+ interface CoreShopCartIconProps extends BaseStyleProps {
3
+ totalItems: number;
4
+ totalPrice: string;
5
+ }
6
+ export default function CoreShopCartIcon({ totalItems, totalPrice, className }: CoreShopCartIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,9 @@
1
+ import { BaseProps } from '../../../../../types/ui';
2
+ import { CoreCartItem } from '../../../types/CoreShopCart';
3
+ interface CoreCartItemAsideCartProps<T extends CoreCartItem<K>, K> extends BaseProps {
4
+ cartItem: T;
5
+ onAddToCart: (product_id: string | number, quantity: number) => void;
6
+ onRemoveFromCart: (product_id: string | number) => void;
7
+ }
8
+ export default function CoreCartItemAsideCard<T extends CoreCartItem<K>, K>({ className, cartItem, children, onAddToCart, onRemoveFromCart }: CoreCartItemAsideCartProps<T, K>): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,4 @@
1
+ interface CoreCartItemAsideCardSkeletonProps extends React.PropsWithChildren {
2
+ }
3
+ export default function CoreCartItemAsideCardSkeleton({ children }: CoreCartItemAsideCardSkeletonProps): import("react/jsx-runtime").JSX.Element;
4
+ export {};
@@ -0,0 +1 @@
1
+ export default function EmptyCartItems(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { BaseStyleProps } from '../../../../../types/ui';
2
+ interface CoreCartHintTitleProps extends BaseStyleProps {
3
+ num: string;
4
+ title: string;
5
+ description?: string;
6
+ }
7
+ export default function CoreCartHintTitle({ num, title, description, className }: CoreCartHintTitleProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import { BaseStyleProps } from '../../../../../types/ui';
2
+ interface CoreCartSubtotalTextProps extends BaseStyleProps {
3
+ property: string;
4
+ value: string;
5
+ }
6
+ export default function CoreCartSubtotalText({ property, value, className }: CoreCartSubtotalTextProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import { BaseStyleProps } from '../../../../../types/ui';
2
+ interface CoreCartSummaryHeadProps extends BaseStyleProps {
3
+ title: string;
4
+ }
5
+ export default function CoreCartSummaryHead({ title, className }: CoreCartSummaryHeadProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ import { BaseStyleProps } from '../../../../../types/ui';
2
+ interface CoreCartSummaryTextProps extends BaseStyleProps {
3
+ property: string;
4
+ value: string;
5
+ }
6
+ export default function CoreCartSummaryText({ property, value, className }: CoreCartSummaryTextProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare const SHOP_CART_ADD_TO_CART = "/api/cart/product/add";
2
+ export declare const SHOP_CART_REMOVE_FROM_CART = "/api/cart/product/remove";
3
+ export declare const SHOP_CART_REMOVE_ITEM_FROM_CART = "/api/cart/product/delete";
4
+ export declare const SHOP_CART_CLEAR_CART = "/api/cart/clear";
5
+ export declare const SHOP_CART_GET_CART_ITEMS = "/api/cart/items";
6
+ export declare const SHOP_CART_GET_CART = "/api/cart";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import { BaseService } from '../../../services/base';
2
+ import { ICartActionsService } from '../types/interfaces/CartActions';
3
+ import { CoreShopCart, CoreCartItem } from '../types/CoreShopCart';
4
+ import { BaseApiResponse } from '../../../types/contracts/BaseApiResponse';
5
+ /**
6
+ * Base class that can be extended by concrete services
7
+ */
8
+ export declare class CoreShopCartBaseService<T> extends BaseService implements ICartActionsService<T> {
9
+ constructor();
10
+ addToCart(product_id: string | number, quantity: number): Promise<import('axios').AxiosResponse<BaseApiResponse<CoreCartItem<T>>, any>>;
11
+ removeFromCart(product_id: string | number): void;
12
+ removeItemFromCart(product_id: string | number): void;
13
+ clearCart(): void;
14
+ getCartItems(): Promise<import('axios').AxiosResponse<BaseApiResponse<CoreCartItem<T>[]>, any>>;
15
+ getCart(): Promise<import('axios').AxiosResponse<BaseApiResponse<CoreShopCart<T>>, any>>;
16
+ }
@@ -0,0 +1,32 @@
1
+ import { BaseType } from '../../../types/BaseType';
2
+ import { ICartActions } from './interfaces/CartActions';
3
+ /**
4
+ * CoreShopCart base type
5
+ */
6
+ export interface CoreShopCart<T> {
7
+ items: CoreCartItem<T>[];
8
+ subtotal: number;
9
+ total: number;
10
+ itemized_subtotals: CoreCartItemSummary[];
11
+ }
12
+ export interface CoreShopCartStore<T> extends ICartActions<T> {
13
+ cart: CoreShopCart<T>;
14
+ cartItems: CoreCartItem<T>[];
15
+ }
16
+ export interface CoreCartItem<T> extends BaseType {
17
+ owner_type: string;
18
+ owner_id: string | number;
19
+ session_id: string;
20
+ productible_type: string;
21
+ productible_id: string | number;
22
+ quantity: number;
23
+ productible: T;
24
+ }
25
+ export interface CoreCartItemSummary {
26
+ item_id: string | number;
27
+ product_id: string | number;
28
+ product_name: string;
29
+ quantity: number;
30
+ unit_price: number;
31
+ subtotal: number;
32
+ }
@@ -0,0 +1,23 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { CoreShopCart, CoreCartItem } from '../CoreShopCart';
3
+ import { BaseApiResponse } from '../../../../types/contracts/BaseApiResponse';
4
+ export interface ICartActions<T> {
5
+ addToCart: (product_id: string | number, quantity: number) => void;
6
+ removeFromCart: (product_id: string | number) => void;
7
+ removeItemFromCart: (product_id: string | number) => void;
8
+ clearCart: () => void;
9
+ getCart: () => CoreShopCart<T>;
10
+ setCart: (cart: CoreShopCart<T>) => void;
11
+ getCartItems: () => CoreCartItem<T>[];
12
+ setCartItems: (cartItems: CoreCartItem<T>[]) => void;
13
+ fetchCart: () => Promise<BaseApiResponse<CoreShopCart<T>>>;
14
+ fetchCartItems: () => Promise<BaseApiResponse<CoreCartItem<T>[]>>;
15
+ }
16
+ export interface ICartActionsService<T> {
17
+ addToCart: (product_id: string | number, quantity: number) => Promise<AxiosResponse<BaseApiResponse<CoreCartItem<T>>>>;
18
+ removeFromCart: (product_id: string | number) => void;
19
+ removeItemFromCart: (product_id: string | number) => void;
20
+ clearCart: () => void;
21
+ getCart: () => Promise<AxiosResponse<BaseApiResponse<CoreShopCart<T>>>>;
22
+ getCartItems: () => Promise<AxiosResponse<BaseApiResponse<CoreCartItem<T>[]>>>;
23
+ }
File without changes
@@ -0,0 +1,38 @@
1
+ import { AxiosInstance, AxiosResponse } from 'axios';
2
+ import { BaseApiResponse } from '../types/contracts/BaseApiResponse';
3
+ export interface ICrudService {
4
+ getAll: <T>(params?: Record<string, any>) => Promise<AxiosResponse<T>>;
5
+ getById: <T>(idOrSlug: number | string) => Promise<AxiosResponse<T>>;
6
+ create: <T, TData>(data: TData) => Promise<AxiosResponse<BaseApiResponse<T>>>;
7
+ update: <T, TData>(idOrSlug: number | string, data: TData) => Promise<AxiosResponse<T>>;
8
+ deleteById: <T>(idOrSlug: number | string) => Promise<AxiosResponse<T>>;
9
+ }
10
+ interface CrudResource {
11
+ getAll: string;
12
+ get: string;
13
+ create: string;
14
+ update: string;
15
+ delete: string;
16
+ }
17
+ type CrudResourceProperty = keyof CrudResource;
18
+ export declare class BaseService implements ICrudService {
19
+ protected resource: string;
20
+ protected api: AxiosInstance;
21
+ protected apiPrefix: string;
22
+ protected crudResource: CrudResource;
23
+ constructor(resource: string, api?: AxiosInstance);
24
+ setCrudResourceProperty: (property: CrudResourceProperty, value: string) => void;
25
+ protected buildCrudResource: () => {
26
+ getAll: string;
27
+ get: string;
28
+ create: string;
29
+ update: string;
30
+ delete: string;
31
+ };
32
+ getAll: <T>(params?: Record<string, any>) => Promise<AxiosResponse<T>>;
33
+ getById: <T>(idOrSlug: number | string) => Promise<AxiosResponse<T>>;
34
+ create: <T, TData>(data: TData) => Promise<AxiosResponse<BaseApiResponse<T>>>;
35
+ update: <T, TData>(idOrSlug: number | string, data: TData) => Promise<AxiosResponse<T>>;
36
+ deleteById: <T>(idOrSlug: number | string) => Promise<AxiosResponse<T>>;
37
+ }
38
+ export {};
@@ -0,0 +1,21 @@
1
+ export declare const useCustomizationStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<import('../modules/CoreCustomization/types/CoreCustomization').CoreCustomizationStore>, "persist"> & {
2
+ persist: {
3
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<import('../modules/CoreCustomization/types/CoreCustomization').CoreCustomizationStore, {
4
+ template: string | null;
5
+ components: string[] | null;
6
+ styles: import('../types/ui/template').CoreDesignTemplateStyles[] | null;
7
+ settings: import('../types/ui/template').CoreDesignTemplateSettings | null;
8
+ }>>) => void;
9
+ clearStorage: () => void;
10
+ rehydrate: () => Promise<void> | void;
11
+ hasHydrated: () => boolean;
12
+ onHydrate: (fn: (state: import('../modules/CoreCustomization/types/CoreCustomization').CoreCustomizationStore) => void) => () => void;
13
+ onFinishHydration: (fn: (state: import('../modules/CoreCustomization/types/CoreCustomization').CoreCustomizationStore) => void) => () => void;
14
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<import('../modules/CoreCustomization/types/CoreCustomization').CoreCustomizationStore, {
15
+ template: string | null;
16
+ components: string[] | null;
17
+ styles: import('../types/ui/template').CoreDesignTemplateStyles[] | null;
18
+ settings: import('../types/ui/template').CoreDesignTemplateSettings | null;
19
+ }>>;
20
+ };
21
+ }>;
@@ -0,0 +1,7 @@
1
+ export interface BaseStore {
2
+ loading: boolean;
3
+ error: string | null;
4
+ setLoading: (loading: boolean) => void;
5
+ setError: (error: string | null) => void;
6
+ reset: () => void;
7
+ }
@@ -0,0 +1,5 @@
1
+ export interface BaseType {
2
+ id: string | number;
3
+ created_at?: Date | string;
4
+ updated_at?: Date | string;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { BaseType } from './BaseType';
2
+ export interface CoreImage extends BaseType {
3
+ src: string;
4
+ alt: string;
5
+ }
@@ -0,0 +1,6 @@
1
+ export interface CoreMenuItem {
2
+ id: number;
3
+ name: string;
4
+ route?: string;
5
+ isMainAction?: boolean;
6
+ }
@@ -0,0 +1,7 @@
1
+ import { BasePagination } from './BasePagination';
2
+ export interface BaseApiResponse<T> {
3
+ data: T;
4
+ message: string;
5
+ }
6
+ export interface BaseApiResponsePagination<T> extends BaseApiResponse<BasePagination<T>> {
7
+ }
@@ -0,0 +1,9 @@
1
+ export interface BasePagination<T> {
2
+ data: T[];
3
+ current_page: number;
4
+ per_page: number;
5
+ last_page: number;
6
+ from: number;
7
+ to: number;
8
+ total: number;
9
+ }
@@ -0,0 +1,7 @@
1
+ import { CoreImage } from '../CoreImage';
2
+ export interface BaseImageType {
3
+ image: CoreImage;
4
+ }
5
+ export interface BaseImagesType {
6
+ images: CoreImage[];
7
+ }
@@ -0,0 +1,3 @@
1
+ export interface BaseSlugType {
2
+ slug: string;
3
+ }
@@ -0,0 +1,3 @@
1
+ export interface BaseVisibleType {
2
+ visible: boolean;
3
+ }
@@ -0,0 +1,5 @@
1
+ import { BaseType } from '../BaseType';
2
+ export interface BaseCarousel<T extends Record<string, any> & BaseType> {
3
+ withoutControls?: boolean;
4
+ items: T[];
5
+ }
@@ -0,0 +1,8 @@
1
+ export interface BaseProps extends React.PropsWithChildren {
2
+ className?: string;
3
+ }
4
+ export interface BaseStyleProps extends Pick<BaseProps, 'className'> {
5
+ }
6
+ export interface BaseVariantProps {
7
+ variant?: 'primary' | 'secondary';
8
+ }