arkenstone-ui 0.0.24 → 0.0.26

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 (43) hide show
  1. package/dist/css/theme.css +151 -36
  2. package/dist/index.js +14628 -5393
  3. package/dist/style.css +1 -1
  4. package/dist/types/components/arkestone.d.ts +1 -1
  5. package/dist/types/components/custom/search.d.ts +11 -9
  6. package/dist/types/components/data-manager/data-manager.d.ts +6 -0
  7. package/dist/types/components/data-manager/display-engine.d.ts +22 -0
  8. package/dist/types/components/data-manager/index.d.ts +5 -0
  9. package/dist/types/components/data-manager/input-engine.d.ts +13 -0
  10. package/dist/types/components/data-manager/layout-manager.d.ts +12 -0
  11. package/dist/types/components/data-manager/types.d.ts +53 -0
  12. package/dist/types/components/index.d.ts +2 -0
  13. package/dist/types/components/sidebar/app-sidebar.d.ts +54 -1
  14. package/dist/types/components/sidebar/index.d.ts +5 -0
  15. package/dist/types/components/sidebar/mock-sidebar-data.json.d.ts +152 -0
  16. package/dist/types/components/sidebar/nav-main.d.ts +2 -2
  17. package/dist/types/components/sidebar/nav-secondary.d.ts +2 -2
  18. package/dist/types/components/sidebar/nav-slot2.d.ts +3 -3
  19. package/dist/types/components/ui/date-picker.d.ts +4 -0
  20. package/dist/types/components/ui/textarea.d.ts +3 -0
  21. package/dist/types/e-commerce/product/components/catelog/components/category-filter.d.ts +3 -1
  22. package/dist/types/e-commerce/product/components/catelog/components/filter.d.ts +3 -2
  23. package/dist/types/e-commerce/product/components/catelog/components/pagination.d.ts +2 -3
  24. package/dist/types/e-commerce/product/components/catelog/components/sort-bar.d.ts +2 -2
  25. package/dist/types/e-commerce/product/components/catelog/components/view-mode.d.ts +12 -5
  26. package/dist/types/e-commerce/product/components/catelog/layouts/catelog-content-layout.d.ts +10 -1
  27. package/dist/types/e-commerce/product/components/product-card/components/brand-title.d.ts +2 -2
  28. package/dist/types/e-commerce/product/components/product-card/components/categories.d.ts +2 -2
  29. package/dist/types/e-commerce/product/components/product-card/components/price-card.d.ts +1 -2
  30. package/dist/types/e-commerce/product/components/product-card/components/product-image.d.ts +2 -2
  31. package/dist/types/e-commerce/product/components/product-card/components/wishlist-button.d.ts +2 -3
  32. package/dist/types/e-commerce/product/components/product-card/layouts/product-card-image-layout.d.ts +3 -4
  33. package/dist/types/e-commerce/product/components/product-card/layouts/product-card-layout.d.ts +2 -3
  34. package/dist/types/e-commerce/product/service/brand-service.d.ts +6 -66
  35. package/dist/types/e-commerce/product/service/category-service.d.ts +6 -67
  36. package/dist/types/e-commerce/product/service/product-image-service.d.ts +6 -43
  37. package/dist/types/e-commerce/product/service/product-service.d.ts +6 -66
  38. package/dist/types/index.d.ts +1 -0
  39. package/dist/types/layouts/index.d.ts +1 -0
  40. package/dist/types/layouts/panels/default-panel-layout.d.ts +3 -1
  41. package/dist/types/layouts/panels/index.d.ts +1 -0
  42. package/dist/types/stores/catelog.store.d.ts +67 -0
  43. package/package.json +3 -2
@@ -0,0 +1,152 @@
1
+ declare const _default: {
2
+ "app": {
3
+ "name": "Example App",
4
+ "textSlot1": "Enterprise",
5
+ "url": "https://picsum.photos/200",
6
+ "logo": "https://picsum.photos/200",
7
+ "icon": "Command"
8
+ },
9
+ "user": {
10
+ "name": "Example User",
11
+ "email": "m@example.com",
12
+ "avatar": "/avatars/shadcn.jpg",
13
+ "url": "#",
14
+ "menuItems": [
15
+ {
16
+ "name": "Profile",
17
+ "url": "#",
18
+ "icon": "User"
19
+ },
20
+ {
21
+ "name": "Settings",
22
+ "url": "#",
23
+ "icon": "Settings2"
24
+ },
25
+ {
26
+ "name": "Logout",
27
+ "url": "#",
28
+ "icon": "LogOut"
29
+ }
30
+ ]
31
+ },
32
+ "navMain": [
33
+ {
34
+ "title": "Playground",
35
+ "url": "#",
36
+ "icon": "SquareTerminal",
37
+ "isActive": true,
38
+ "items": [
39
+ {
40
+ "title": "History",
41
+ "url": "#"
42
+ },
43
+ {
44
+ "title": "Starred",
45
+ "url": "#"
46
+ },
47
+ {
48
+ "title": "Settings",
49
+ "url": "#"
50
+ }
51
+ ]
52
+ },
53
+ {
54
+ "title": "Models",
55
+ "url": "#",
56
+ "icon": "Bot",
57
+ "items": [
58
+ {
59
+ "title": "Genesis",
60
+ "url": "#"
61
+ },
62
+ {
63
+ "title": "Explorer",
64
+ "url": "#"
65
+ },
66
+ {
67
+ "title": "Quantum",
68
+ "url": "#"
69
+ }
70
+ ]
71
+ },
72
+ {
73
+ "title": "Documentation",
74
+ "url": "#",
75
+ "icon": "BookOpen",
76
+ "items": [
77
+ {
78
+ "title": "Introduction",
79
+ "url": "#"
80
+ },
81
+ {
82
+ "title": "Get Started",
83
+ "url": "#"
84
+ },
85
+ {
86
+ "title": "Tutorials",
87
+ "url": "#"
88
+ },
89
+ {
90
+ "title": "Changelog",
91
+ "url": "#"
92
+ }
93
+ ]
94
+ },
95
+ {
96
+ "title": "Settings",
97
+ "url": "#",
98
+ "icon": "Settings2",
99
+ "items": [
100
+ {
101
+ "title": "General",
102
+ "url": "#"
103
+ },
104
+ {
105
+ "title": "Team",
106
+ "url": "#"
107
+ },
108
+ {
109
+ "title": "Billing",
110
+ "url": "#"
111
+ },
112
+ {
113
+ "title": "Limits",
114
+ "url": "#"
115
+ }
116
+ ]
117
+ }
118
+ ],
119
+ "navSecondary": [
120
+ {
121
+ "title": "Support",
122
+ "url": "#",
123
+ "icon": "LifeBuoy"
124
+ },
125
+ {
126
+ "title": "Feedback",
127
+ "url": "#",
128
+ "icon": "Send"
129
+ }
130
+ ],
131
+ "slot2": [
132
+ {
133
+ "name": "Design Engineering",
134
+ "url": "#",
135
+ "icon": "Frame"
136
+ },
137
+ {
138
+ "name": "Sales & Marketing",
139
+ "url": "#",
140
+ "icon": "PieChart"
141
+ },
142
+ {
143
+ "name": "Travel",
144
+ "url": "#",
145
+ "icon": "Map"
146
+ }
147
+ ],
148
+ "logout": { "name": "Logout", "url": "#", "icon": "LogOut" }
149
+ }
150
+ ;
151
+
152
+ export default _default;
@@ -1,9 +1,9 @@
1
1
  import { LucideIcon } from 'lucide-react';
2
2
  export declare function NavMain({ items, label }: {
3
- items: {
3
+ items?: {
4
4
  title: string;
5
5
  url: string;
6
- icon: LucideIcon;
6
+ icon: LucideIcon | any;
7
7
  isActive?: boolean;
8
8
  items?: {
9
9
  title: string;
@@ -2,9 +2,9 @@ import { LucideIcon } from 'lucide-react';
2
2
  import { SidebarGroup } from '../ui/sidebar';
3
3
  import * as React from "react";
4
4
  export declare function NavSecondary({ items, ...props }: {
5
- items: {
5
+ items?: {
6
6
  title: string;
7
7
  url: string;
8
- icon: LucideIcon;
8
+ icon: LucideIcon | any;
9
9
  }[];
10
10
  } & React.ComponentPropsWithoutRef<typeof SidebarGroup>): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,14 @@
1
1
  import { LucideIcon } from 'lucide-react';
2
2
  export declare function NavSlot2({ slot2, dropdownItems, label, viewMoreButton, }: {
3
- slot2: {
3
+ slot2?: {
4
4
  name: string;
5
5
  url: string;
6
- icon: LucideIcon;
6
+ icon: LucideIcon | any;
7
7
  }[];
8
8
  dropdownItems?: {
9
9
  name: string;
10
10
  url: string;
11
- icon: LucideIcon;
11
+ icon: LucideIcon | any;
12
12
  }[];
13
13
  label?: string;
14
14
  viewMoreButton?: React.ReactNode;
@@ -0,0 +1,4 @@
1
+ export declare function DatePicker({ value, onChange }: {
2
+ value?: Date;
3
+ onChange?: (date: Date | undefined) => void;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">): import("react/jsx-runtime").JSX.Element;
3
+ export { Textarea };
@@ -10,5 +10,7 @@ export interface CategoryFilterProps {
10
10
  onToggle: (values: (string | number | boolean)[]) => void;
11
11
  level?: number;
12
12
  classNames?: ClassNamesMap;
13
+ collapsibleIconUp?: React.ReactNode;
14
+ collapsibleIconDown?: React.ReactNode;
13
15
  }
14
- export default function CategoryFilter({ options, selected, onToggle, level, classNames, }: CategoryFilterProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function CategoryFilter({ options, selected, onToggle, level, classNames, collapsibleIconUp, collapsibleIconDown, }: CategoryFilterProps): import("react/jsx-runtime").JSX.Element;
@@ -14,7 +14,7 @@ export interface FilterOption {
14
14
  className?: string;
15
15
  }
16
16
  export interface FilterOptionItemProps extends FilterOption {
17
- type: "checkbox" | "radio" | "chip" | "toggle" | "switch" | "color" | "image" | "rating" | "tag" | "icon" | "range" | string;
17
+ type: "checkbox" | "checkbox-list" | "radio" | "chip" | "toggle" | "switch" | "color" | "image" | "rating" | "tag" | "icon" | "range" | string;
18
18
  selected: any;
19
19
  onCheckboxToggle: (value: string) => void;
20
20
  onRadioSelect: (value: any) => void;
@@ -38,6 +38,7 @@ export interface FilterItemProps {
38
38
  defaultCollapsed?: boolean;
39
39
  collapsibleIconUp?: React.ReactNode;
40
40
  collapsibleIconDown?: React.ReactNode;
41
+ itemsShown?: number;
41
42
  type?: string;
42
43
  classNames?: ClassNamesMap;
43
44
  component?: React.ComponentType<FilterRenderProps>;
@@ -57,4 +58,4 @@ export interface FilterRenderProps {
57
58
  update: (id: string, value: any) => void;
58
59
  classNames?: ClassNamesMap;
59
60
  }
60
- export default function Filters({ filters, direction, value, onChange, verticalFilterClassName, horizontalFilterClassName, customRenderers, globalClassNames, }: FiltersProps): import("react/jsx-runtime").JSX.Element;
61
+ export declare function Filters({ filters, direction, value, onChange, verticalFilterClassName, horizontalFilterClassName, customRenderers, globalClassNames, }: FiltersProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  export interface PaginationProps {
3
2
  /** Current page number (1-indexed) */
4
3
  page: number;
@@ -23,7 +22,7 @@ export interface PaginationProps {
23
22
  renderPageSize?: React.ReactNode;
24
23
  };
25
24
  /** Styling */
26
- className?: {
25
+ classNames?: {
27
26
  container?: string;
28
27
  summary?: string;
29
28
  page?: string;
@@ -34,4 +33,4 @@ export interface PaginationProps {
34
33
  disabled?: string;
35
34
  };
36
35
  }
37
- export declare function Pagination({ page, total, pageSize, onChange, show, customRender, className }: PaginationProps): import("react/jsx-runtime").JSX.Element;
36
+ export declare function Pagination({ page, total, pageSize, onChange, show, customRender, classNames, }: PaginationProps): import("react/jsx-runtime").JSX.Element;
@@ -18,7 +18,7 @@ export interface SortBarProps {
18
18
  sortByTitle?: string;
19
19
  };
20
20
  /** Styling */
21
- className?: {
21
+ classNames?: {
22
22
  order?: string;
23
23
  orderDropdown?: string;
24
24
  orderButton?: string;
@@ -30,4 +30,4 @@ export interface SortBarProps {
30
30
  orderOption?: string;
31
31
  };
32
32
  }
33
- export declare function SortBar({ sortOrder, sortBy, sortOptions, onSortChange, onSortByChange, labels, className, }: SortBarProps): import("react/jsx-runtime").JSX.Element;
33
+ export declare function SortBar({ sortOrder, sortBy, sortOptions, onSortChange, onSortByChange, labels, classNames, }: SortBarProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,11 @@
1
- export type ViewMode = "card" | "list" | "table";
1
+ /**
2
+ * Possible view modes
3
+ *
4
+ * "list" - Detailed list
5
+ * "grid" - Compact grid
6
+ * "gallery" - Large images
7
+ */
8
+ export type ViewMode = "list" | "grid" | "gallery";
2
9
  export interface ViewModeSwitcherProps {
3
10
  /** Current selected view mode */
4
11
  mode: ViewMode;
@@ -7,16 +14,16 @@ export interface ViewModeSwitcherProps {
7
14
  /** Optional: allow developer to pass custom modes or hide some */
8
15
  availableModes?: ViewMode[];
9
16
  /** Styles */
10
- className?: {
17
+ classNames?: {
11
18
  container?: string;
12
19
  button?: string;
13
20
  selectedButton?: string;
14
21
  unselectedButton?: string;
15
- cardButton?: string;
22
+ gridButton?: string;
16
23
  listButton?: string;
17
- tableButton?: string;
24
+ galleryButton?: string;
18
25
  /** Icon size */
19
26
  iconSize?: number;
20
27
  };
21
28
  }
22
- export declare function ViewModeSwitcher({ mode, onChange, availableModes, className }: ViewModeSwitcherProps): import("react/jsx-runtime").JSX.Element;
29
+ export declare function ViewModeSwitcher({ mode, onChange, availableModes, classNames }: ViewModeSwitcherProps): import("react/jsx-runtime").JSX.Element;
@@ -5,5 +5,14 @@ export type CatalogLayoutProps = {
5
5
  left?: ReactNode | false;
6
6
  right?: ReactNode | false;
7
7
  listings?: ReactNode | false;
8
+ classNames?: {
9
+ container?: string;
10
+ top?: string;
11
+ center?: string;
12
+ bottom?: string;
13
+ left?: string;
14
+ right?: string;
15
+ listings?: string;
16
+ };
8
17
  };
9
- export default function CatalogContentLayout({ top, left, listings, right, bottom, }: CatalogLayoutProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function CatalogContentLayout({ top, left, listings, right, bottom, classNames, }: CatalogLayoutProps): import("react/jsx-runtime").JSX.Element;
@@ -6,11 +6,11 @@ export interface BrandTitleProps {
6
6
  title?: boolean;
7
7
  };
8
8
  brandPlacement?: "before" | "after" | "hidden" | "top" | "bottom";
9
- className?: {
9
+ classNames?: {
10
10
  brand?: string;
11
11
  title?: string;
12
12
  wrapper?: string;
13
13
  separator?: string;
14
14
  };
15
15
  }
16
- export declare function BrandTitle({ brand, title, show, brandPlacement, className, }: BrandTitleProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function BrandTitle({ brand, title, show, brandPlacement, classNames, }: BrandTitleProps): import("react/jsx-runtime").JSX.Element;
@@ -8,7 +8,7 @@ export interface CategoriesBadgeListProps {
8
8
  maxCategories?: number;
9
9
  /** Show +X badge */
10
10
  showRemainingCount?: boolean;
11
- className?: {
11
+ classNames?: {
12
12
  position?: string;
13
13
  category?: string;
14
14
  remaining?: string;
@@ -16,4 +16,4 @@ export interface CategoriesBadgeListProps {
16
16
  };
17
17
  onCategoryClick?: (category: CategoryItem) => void;
18
18
  }
19
- export declare function CategoriesBadgeList({ categories, maxCategories, showRemainingCount, className, onCategoryClick, }: CategoriesBadgeListProps): import("react/jsx-runtime").JSX.Element | null;
19
+ export declare function CategoriesBadgeList({ categories, maxCategories, showRemainingCount, classNames, onCategoryClick, }: CategoriesBadgeListProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  export interface PriceCardProps {
3
2
  price: number | null;
4
3
  salePrice: number | null;
@@ -11,7 +10,7 @@ export interface PriceCardProps {
11
10
  currency?: string;
12
11
  fractionDigits?: number;
13
12
  /** Styles */
14
- className?: {
13
+ classNames?: {
15
14
  wrapper?: string;
16
15
  price?: string;
17
16
  originalPrice?: string;
@@ -6,10 +6,10 @@ export interface ProductImageProps {
6
6
  height?: number | string;
7
7
  children?: React.ReactNode;
8
8
  onClick?: React.MouseEventHandler;
9
- className?: {
9
+ classNames?: {
10
10
  wrapper?: string;
11
11
  image?: string;
12
12
  overlay?: string;
13
13
  };
14
14
  }
15
- export default function ProductImage({ imageUrl, alt, mode, height, className, children, onClick, }: ProductImageProps): import("react/jsx-runtime").JSX.Element;
15
+ export default function ProductImage({ imageUrl, alt, mode, height, classNames, children, onClick, }: ProductImageProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- import { default as React } from 'react';
2
1
  export interface WishlistButtonProps {
3
2
  isWishlisted?: boolean;
4
3
  onToggle?: (value: boolean) => void;
@@ -6,10 +5,10 @@ export interface WishlistButtonProps {
6
5
  activeIcon?: React.ReactNode;
7
6
  ariaLabel?: string;
8
7
  size?: number;
9
- className?: {
8
+ classNames?: {
10
9
  button?: string;
11
10
  icon?: string;
12
11
  };
13
12
  animationDuration?: number;
14
13
  }
15
- export declare function WishlistButton({ isWishlisted, onToggle, icon, activeIcon, ariaLabel, size, className, animationDuration, }: WishlistButtonProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function WishlistButton({ isWishlisted, onToggle, icon, activeIcon, ariaLabel, size, classNames, animationDuration, }: WishlistButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,10 @@
1
- import { default as React } from 'react';
2
1
  export interface ProductImageLayoutProps {
3
2
  imageUrl?: string;
4
3
  imageAlt?: string;
5
4
  width?: string | number;
6
5
  height?: string | number;
7
6
  background?: React.ReactNode;
8
- className?: {
7
+ classNames?: {
9
8
  container?: string;
10
9
  image?: string;
11
10
  overlay?: string;
@@ -21,7 +20,7 @@ export interface ProductImageLayoutProps {
21
20
  center?: React.ReactNode;
22
21
  topPlaceholder?: React.ReactNode;
23
22
  bottomPlaceholder?: React.ReactNode;
24
- placeholderClassName?: {
23
+ placeholderClassNames?: {
25
24
  top?: string;
26
25
  bottom?: string;
27
26
  };
@@ -32,4 +31,4 @@ export interface ProductImageLayoutProps {
32
31
  * - Provides 4 corner slots + center slot where you can place components (wishlist, discount badge, brand, price, view details)
33
32
  * - Fully customizable via className props and by passing custom nodes
34
33
  */
35
- export declare function ProductImageLayout({ imageUrl, imageAlt, width, height, background, className, topLeft, topRight, bottomLeft, bottomRight, center, topPlaceholder, bottomPlaceholder, placeholderClassName, }: ProductImageLayoutProps): import("react/jsx-runtime").JSX.Element;
34
+ export declare function ProductImageLayout({ imageUrl, imageAlt, width, height, background, classNames, topLeft, topRight, bottomLeft, bottomRight, center, topPlaceholder, bottomPlaceholder, placeholderClassNames, }: ProductImageLayoutProps): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,10 @@
1
- import { default as React } from 'react';
2
1
  export type ProductLayoutType = "compact" | "detailed";
3
2
  export interface ProductCardLayoutProps {
4
3
  layout?: ProductLayoutType;
5
4
  ImageComponent: React.ReactNode;
6
5
  DetailsComponent: React.ReactNode;
7
6
  /** granular class overrides */
8
- className?: {
7
+ classNames?: {
9
8
  container?: string;
10
9
  compactWrapper?: string;
11
10
  detailedWrapper?: string;
@@ -13,4 +12,4 @@ export interface ProductCardLayoutProps {
13
12
  detailsContainer?: string;
14
13
  };
15
14
  }
16
- export declare function ProductCardLayout({ layout, ImageComponent, DetailsComponent, className, }: ProductCardLayoutProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function ProductCardLayout({ layout, ImageComponent, DetailsComponent, classNames, }: ProductCardLayoutProps): import("react/jsx-runtime").JSX.Element;
@@ -1,67 +1,7 @@
1
- import { ApiOptions } from '../../../hooks/api';
1
+ import { ServiceFactory } from '../../../services';
2
2
  import { Brand } from '../types';
3
- /**
4
- * Defines the structure of a Brand object.
5
- * Customize these properties to match your application's data model.
6
- */
7
- export interface ServiceTypeBrand extends Brand {
8
- }
9
- /**
10
- * Defines the payload for creating a new brand.
11
- * It omits server-generated fields like `id`.
12
- */
13
- export type BrandCreationPayload = Omit<ServiceTypeBrand, 'id'>;
14
- /**
15
- * Defines the payload for updating an existing brand.
16
- * All fields are optional to allow for partial updates.
17
- */
18
- export type BrandUpdatePayload = Partial<BrandCreationPayload>;
19
- /**
20
- * Defines the available query parameters for fetching a list of brands.
21
- * This is useful for implementing features like pagination, sorting, and searching.
22
- */
23
- export type BrandListQuery = {
24
- page?: number;
25
- per_page?: number;
26
- sort_by?: keyof Brand;
27
- sort_order?: 'asc' | 'desc';
28
- search?: string;
29
- };
30
- export declare const brandService: {
31
- /**
32
- * Fetches a paginated and filterable list of brands.
33
- * @param {BrandListQuery} params - Query parameters for filtering and pagination.
34
- * @param {ApiOptions} options - Custom options for the API request.
35
- * @returns {Promise<Brand[]>} A promise that resolves to an array of brands.
36
- */
37
- getBrands(params?: BrandListQuery, options?: ApiOptions): Promise<Brand[]>;
38
- /**
39
- * Fetches a single brand by its unique identifier.
40
- * @param {string | number} id - The ID of the brand.
41
- * @param {ApiOptions} options - Custom options for the API request.
42
- * @returns {Promise<Brand>} A promise that resolves to the requested brand.
43
- */
44
- getBrandById(id: string | number, options?: ApiOptions): Promise<Brand>;
45
- /**
46
- * Creates a new brand.
47
- * @param {BrandCreationPayload} brandData - The data for the new brand.
48
- * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
49
- * @returns {Promise<Brand>} A promise that resolves to the newly created brand.
50
- */
51
- createBrand(brandData: BrandCreationPayload, options?: ApiOptions): Promise<Brand>;
52
- /**
53
- * Updates an existing brand's information.
54
- * @param {string | number} id - The ID of the brand to update.
55
- * @param {BrandUpdatePayload} brandData - The data to update.
56
- * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
57
- * @returns {Promise<Brand>} A promise that resolves to the updated brand.
58
- */
59
- updateBrand(id: string | number, brandData: BrandUpdatePayload, options?: ApiOptions): Promise<Brand>;
60
- /**
61
- * Deletes a brand.
62
- * @param {string | number} id - The ID of the brand to delete.
63
- * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
64
- * @returns {Promise<void>} A promise that resolves when the deletion is successful.
65
- */
66
- deleteBrand(id: string | number, options?: ApiOptions): Promise<void>;
67
- };
3
+ export declare const brandService: ServiceFactory<Brand, Partial<Brand>, Partial<Brand>, {
4
+ list: Brand[];
5
+ selected: Brand | null;
6
+ loading: boolean;
7
+ }>;
@@ -1,68 +1,7 @@
1
- import { ApiOptions } from '../../../hooks/api';
2
1
  import { Category } from '../types';
3
- /**
4
- * Defines the structure of a Category object.
5
- * Customize these properties to match your application's data model.
6
- */
7
- export interface ServiceTypeCategory extends Category {
8
- }
9
- /**
10
- * Defines the payload for creating a new category.
11
- * It omits server-generated fields like `id` and `children`.
12
- */
13
- export type CategoryCreationPayload = Omit<ServiceTypeCategory, 'id' | 'children'>;
14
- /**
15
- * Defines the payload for updating an existing category.
16
- * All fields are optional to allow for partial updates.
17
- */
18
- export type CategoryUpdatePayload = Partial<CategoryCreationPayload>;
19
- /**
20
- * Defines the available query parameters for fetching a list of categories.
21
- * This is useful for implementing features like pagination, sorting, and searching.
22
- */
23
- export type CategoryListQuery = {
24
- page?: number;
25
- per_page?: number;
26
- sort_by?: keyof Category;
27
- sort_order?: 'asc' | 'desc';
28
- search?: string;
29
- parent_id?: number | null;
30
- };
31
- export declare const categoryService: {
32
- /**
33
- * Fetches a hierarchical list of categories.
34
- * @param {CategoryListQuery} params - Query parameters for filtering and pagination.
35
- * @param {ApiOptions} options - Custom options for the API request.
36
- * @returns {Promise<Category[]>} A promise that resolves to an array of categories with nested children.
37
- */
38
- getCategories(params?: CategoryListQuery, options?: ApiOptions): Promise<Category[]>;
39
- /**
40
- * Fetches a single category by its unique identifier.
41
- * @param {string | number} id - The ID of the category.
42
- * @param {ApiOptions} options - Custom options for the API request.
43
- * @returns {Promise<Category>} A promise that resolves to the requested category.
44
- */
45
- getCategoryById(id: string | number, options?: ApiOptions): Promise<Category>;
46
- /**
47
- * Creates a new category.
48
- * @param {CategoryCreationPayload} categoryData - The data for the new category.
49
- * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
50
- * @returns {Promise<Category>} A promise that resolves to the newly created category.
51
- */
52
- createCategory(categoryData: CategoryCreationPayload, options?: ApiOptions): Promise<Category>;
53
- /**
54
- * Updates an existing category's information.
55
- * @param {string | number} id - The ID of the category to update.
56
- * @param {CategoryUpdatePayload} categoryData - The data to update.
57
- * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
58
- * @returns {Promise<Category>} A promise that resolves to the updated category.
59
- */
60
- updateCategory(id: string | number, categoryData: CategoryUpdatePayload, options?: ApiOptions): Promise<Category>;
61
- /**
62
- * Deletes a category.
63
- * @param {string | number} id - The ID of the category to delete.
64
- * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
65
- * @returns {Promise<void>} A promise that resolves when the deletion is successful.
66
- */
67
- deleteCategory(id: string | number, options?: ApiOptions): Promise<void>;
68
- };
2
+ import { ServiceFactory } from '../../../services';
3
+ export declare const categoryService: ServiceFactory<Category, Partial<Category>, Partial<Category>, {
4
+ list: Category[];
5
+ selected: Category | null;
6
+ loading: boolean;
7
+ }>;
@@ -1,44 +1,7 @@
1
- import { ApiOptions } from '../../../hooks/api';
2
1
  import { ProductImage } from '../types';
3
- /**
4
- * Defines the structure of a ProductImage object.
5
- * Customize these properties to match your application's data model.
6
- */
7
- export interface ServiceTypeProductImage extends ProductImage {
8
- }
9
- /**
10
- * Defines the payload for creating a new product image.
11
- * It omits server-generated fields.
12
- */
13
- export type ProductImageCreationPayload = Omit<ServiceTypeProductImage, 'product_id' | 'url' | 'order'> & {
14
- image: File;
15
- };
16
- /**
17
- * Defines the payload for updating an existing product image.
18
- * All fields are optional to allow for partial updates.
19
- */
20
- export type ProductImageUpdatePayload = Partial<Omit<ServiceTypeProductImage, 'product_id' | 'url'>>;
21
- /**
22
- * Defines the available query parameters for fetching a list of product images.
23
- * This is useful for implementing features like filtering and searching.
24
- */
25
- export type ProductImageListQuery = {
26
- product_id?: number;
27
- is_primary?: boolean;
28
- };
29
- export declare const productImageService: {
30
- /**
31
- * Uploads a new product image.
32
- * @param {File} image - The image file to upload.
33
- * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
34
- * @returns {Promise<ProductImage>} A promise that resolves to the newly uploaded product image.
35
- */
36
- uploadImage(image: File, options?: ApiOptions): Promise<ProductImage>;
37
- /**
38
- * Deletes a product image.
39
- * @param {number} imageId - The ID of the product image to delete.
40
- * @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
41
- * @returns {Promise<void>} A promise that resolves when the deletion is successful.
42
- */
43
- deleteImage(imageId: number, options?: ApiOptions): Promise<void>;
44
- };
2
+ import { ServiceFactory } from '../../../services';
3
+ export declare const productImageService: ServiceFactory<ProductImage, Partial<ProductImage>, Partial<ProductImage>, {
4
+ list: ProductImage[];
5
+ selected: ProductImage | null;
6
+ loading: boolean;
7
+ }>;