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.
- package/dist/css/theme.css +151 -36
- package/dist/index.js +14628 -5393
- package/dist/style.css +1 -1
- package/dist/types/components/arkestone.d.ts +1 -1
- package/dist/types/components/custom/search.d.ts +11 -9
- package/dist/types/components/data-manager/data-manager.d.ts +6 -0
- package/dist/types/components/data-manager/display-engine.d.ts +22 -0
- package/dist/types/components/data-manager/index.d.ts +5 -0
- package/dist/types/components/data-manager/input-engine.d.ts +13 -0
- package/dist/types/components/data-manager/layout-manager.d.ts +12 -0
- package/dist/types/components/data-manager/types.d.ts +53 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/sidebar/app-sidebar.d.ts +54 -1
- package/dist/types/components/sidebar/index.d.ts +5 -0
- package/dist/types/components/sidebar/mock-sidebar-data.json.d.ts +152 -0
- package/dist/types/components/sidebar/nav-main.d.ts +2 -2
- package/dist/types/components/sidebar/nav-secondary.d.ts +2 -2
- package/dist/types/components/sidebar/nav-slot2.d.ts +3 -3
- package/dist/types/components/ui/date-picker.d.ts +4 -0
- package/dist/types/components/ui/textarea.d.ts +3 -0
- package/dist/types/e-commerce/product/components/catelog/components/category-filter.d.ts +3 -1
- package/dist/types/e-commerce/product/components/catelog/components/filter.d.ts +3 -2
- package/dist/types/e-commerce/product/components/catelog/components/pagination.d.ts +2 -3
- package/dist/types/e-commerce/product/components/catelog/components/sort-bar.d.ts +2 -2
- package/dist/types/e-commerce/product/components/catelog/components/view-mode.d.ts +12 -5
- package/dist/types/e-commerce/product/components/catelog/layouts/catelog-content-layout.d.ts +10 -1
- package/dist/types/e-commerce/product/components/product-card/components/brand-title.d.ts +2 -2
- package/dist/types/e-commerce/product/components/product-card/components/categories.d.ts +2 -2
- package/dist/types/e-commerce/product/components/product-card/components/price-card.d.ts +1 -2
- package/dist/types/e-commerce/product/components/product-card/components/product-image.d.ts +2 -2
- package/dist/types/e-commerce/product/components/product-card/components/wishlist-button.d.ts +2 -3
- package/dist/types/e-commerce/product/components/product-card/layouts/product-card-image-layout.d.ts +3 -4
- package/dist/types/e-commerce/product/components/product-card/layouts/product-card-layout.d.ts +2 -3
- package/dist/types/e-commerce/product/service/brand-service.d.ts +6 -66
- package/dist/types/e-commerce/product/service/category-service.d.ts +6 -67
- package/dist/types/e-commerce/product/service/product-image-service.d.ts +6 -43
- package/dist/types/e-commerce/product/service/product-service.d.ts +6 -66
- package/dist/types/index.d.ts +1 -0
- package/dist/types/layouts/index.d.ts +1 -0
- package/dist/types/layouts/panels/default-panel-layout.d.ts +3 -1
- package/dist/types/layouts/panels/index.d.ts +1 -0
- package/dist/types/stores/catelog.store.d.ts +67 -0
- package/package.json +3 -2
|
@@ -1,67 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ServiceFactory } from '../../../services';
|
|
2
2
|
import { Product } from '../types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Defines the payload for creating a new product.
|
|
11
|
-
* It omits server-generated fields like `id`, `created_at`, and `updated_at`.
|
|
12
|
-
*/
|
|
13
|
-
export type ProductCreationPayload = Omit<ServiceTypeProduct, 'id' | 'created_at' | 'updated_at'>;
|
|
14
|
-
/**
|
|
15
|
-
* Defines the payload for updating an existing product.
|
|
16
|
-
* All fields are optional to allow for partial updates.
|
|
17
|
-
*/
|
|
18
|
-
export type ProductUpdatePayload = Partial<ProductCreationPayload>;
|
|
19
|
-
/**
|
|
20
|
-
* Defines the available query parameters for fetching a list of products.
|
|
21
|
-
* This is useful for implementing features like pagination, sorting, and searching.
|
|
22
|
-
*/
|
|
23
|
-
export interface ProductListQuery {
|
|
24
|
-
page?: number;
|
|
25
|
-
per_page?: number;
|
|
26
|
-
sort_by?: keyof Product;
|
|
27
|
-
sort_order?: 'asc' | 'desc';
|
|
28
|
-
search?: string;
|
|
29
|
-
}
|
|
30
|
-
export declare const productService: {
|
|
31
|
-
/**
|
|
32
|
-
* Fetches a paginated and filterable list of products.
|
|
33
|
-
* @param {ProductListQuery} params - Query parameters for filtering and pagination.
|
|
34
|
-
* @param {ApiOptions} options - Custom options for the API request.
|
|
35
|
-
* @returns {Promise<Product[]>} A promise that resolves to an array of products.
|
|
36
|
-
*/
|
|
37
|
-
getProducts(params?: ProductListQuery, options?: ApiOptions): Promise<Product[]>;
|
|
38
|
-
/**
|
|
39
|
-
* Fetches a single product by its unique identifier.
|
|
40
|
-
* @param {string | number} id - The ID of the product.
|
|
41
|
-
* @param {ApiOptions} options - Custom options for the API request.
|
|
42
|
-
* @returns {Promise<Product>} A promise that resolves to the requested product.
|
|
43
|
-
*/
|
|
44
|
-
getProductById(id: string | number, options?: ApiOptions): Promise<Product>;
|
|
45
|
-
/**
|
|
46
|
-
* Creates a new product.
|
|
47
|
-
* @param {ProductCreationPayload} productData - The data for the new product.
|
|
48
|
-
* @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
|
|
49
|
-
* @returns {Promise<Product>} A promise that resolves to the newly created product.
|
|
50
|
-
*/
|
|
51
|
-
createProduct(productData: ProductCreationPayload, options?: ApiOptions): Promise<Product>;
|
|
52
|
-
/**
|
|
53
|
-
* Updates an existing product's information.
|
|
54
|
-
* @param {string | number} id - The ID of the product to update.
|
|
55
|
-
* @param {ProductUpdatePayload} productData - The data to update.
|
|
56
|
-
* @param {ApiOptions} options - Custom options for the API request, `displaySuccess` is enabled by default.
|
|
57
|
-
* @returns {Promise<Product>} A promise that resolves to the updated product.
|
|
58
|
-
*/
|
|
59
|
-
updateProduct(id: string | number, productData: ProductUpdatePayload, options?: ApiOptions): Promise<Product>;
|
|
60
|
-
/**
|
|
61
|
-
* Deletes a product.
|
|
62
|
-
* @param {string | number} id - The ID of the product 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
|
-
deleteProduct(id: string | number, options?: ApiOptions): Promise<void>;
|
|
67
|
-
};
|
|
3
|
+
export declare const productService: ServiceFactory<Product, Partial<Product>, Partial<Product>, {
|
|
4
|
+
list: Product[];
|
|
5
|
+
selected: Product | null;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
}>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './panels';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { NavbarProps } from '../../components/sidebar/app-sidebar';
|
|
1
2
|
import { BreadcrumbItemType } from '../../components/custom/breadcrumb';
|
|
2
|
-
export
|
|
3
|
+
export declare function DefaultPanelLayout({ children, breadcrumbs, navbarProps }: {
|
|
3
4
|
children: React.ReactNode;
|
|
4
5
|
breadcrumbs?: BreadcrumbItemType[];
|
|
6
|
+
navbarProps?: NavbarProps;
|
|
5
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './default-panel-layout';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Product, Category } from '../e-commerce/product/types';
|
|
2
|
+
interface CatalogState {
|
|
3
|
+
products: Product[];
|
|
4
|
+
total: number;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
searchQuery: string;
|
|
7
|
+
filters: Record<string, any>;
|
|
8
|
+
sortOrder: "asc" | "desc";
|
|
9
|
+
sortBy: string;
|
|
10
|
+
viewMode: "list" | "card" | "table";
|
|
11
|
+
page: number;
|
|
12
|
+
pageSize: number;
|
|
13
|
+
}
|
|
14
|
+
interface CatalogActions {
|
|
15
|
+
setSearchQuery: (query: string) => void;
|
|
16
|
+
setFilters: (filters: Record<string, any>) => void;
|
|
17
|
+
setSortOrder: (order: "asc" | "desc") => void;
|
|
18
|
+
setSortBy: (by: string) => void;
|
|
19
|
+
setViewMode: (mode: "list" | "card" | "table") => void;
|
|
20
|
+
setPage: (page: number) => void;
|
|
21
|
+
fetchProducts: () => Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export declare const useCatalogStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CatalogState & import('./store-factory').BaseActions<CatalogState> & CatalogActions>, "setState"> & {
|
|
24
|
+
setState(nextStateOrUpdater: (CatalogState & import('./store-factory').BaseActions<CatalogState> & CatalogActions) | Partial<CatalogState & import('./store-factory').BaseActions<CatalogState> & CatalogActions> | ((state: import('immer').WritableDraft<CatalogState & import('./store-factory').BaseActions<CatalogState> & CatalogActions>) => void), shouldReplace?: false): void;
|
|
25
|
+
setState(nextStateOrUpdater: (CatalogState & import('./store-factory').BaseActions<CatalogState> & CatalogActions) | ((state: import('immer').WritableDraft<CatalogState & import('./store-factory').BaseActions<CatalogState> & CatalogActions>) => void), shouldReplace: true): void;
|
|
26
|
+
}>;
|
|
27
|
+
interface ProductCardState {
|
|
28
|
+
wishlist: number[];
|
|
29
|
+
activeProductId: number | null;
|
|
30
|
+
}
|
|
31
|
+
interface ProductCardActions {
|
|
32
|
+
toggleWishlist: (productId: number) => void;
|
|
33
|
+
isWishlisted: (productId: number) => boolean;
|
|
34
|
+
viewDetails: (productId: number) => void;
|
|
35
|
+
closeDetails: () => void;
|
|
36
|
+
}
|
|
37
|
+
export declare const useProductCardStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<ProductCardState & import('./store-factory').BaseActions<ProductCardState> & ProductCardActions>, "setState"> & {
|
|
38
|
+
setState(nextStateOrUpdater: (ProductCardState & import('./store-factory').BaseActions<ProductCardState> & ProductCardActions) | Partial<ProductCardState & import('./store-factory').BaseActions<ProductCardState> & ProductCardActions> | ((state: import('immer').WritableDraft<ProductCardState & import('./store-factory').BaseActions<ProductCardState> & ProductCardActions>) => void), shouldReplace?: false): void;
|
|
39
|
+
setState(nextStateOrUpdater: (ProductCardState & import('./store-factory').BaseActions<ProductCardState> & ProductCardActions) | ((state: import('immer').WritableDraft<ProductCardState & import('./store-factory').BaseActions<ProductCardState> & ProductCardActions>) => void), shouldReplace: true): void;
|
|
40
|
+
}>;
|
|
41
|
+
interface CartState {
|
|
42
|
+
cart: Record<number, number>;
|
|
43
|
+
}
|
|
44
|
+
interface CartActions {
|
|
45
|
+
addToCart: (productId: number, qty?: number) => void;
|
|
46
|
+
removeFromCart: (productId: number) => void;
|
|
47
|
+
updateQuantity: (productId: number, qty: number) => void;
|
|
48
|
+
getCartQuantity: (productId: number) => number;
|
|
49
|
+
getTotalItems: () => number;
|
|
50
|
+
clearCart: () => void;
|
|
51
|
+
}
|
|
52
|
+
export declare const useCartStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CartState & import('./store-factory').BaseActions<CartState> & CartActions>, "setState"> & {
|
|
53
|
+
setState(nextStateOrUpdater: (CartState & import('./store-factory').BaseActions<CartState> & CartActions) | Partial<CartState & import('./store-factory').BaseActions<CartState> & CartActions> | ((state: import('immer').WritableDraft<CartState & import('./store-factory').BaseActions<CartState> & CartActions>) => void), shouldReplace?: false): void;
|
|
54
|
+
setState(nextStateOrUpdater: (CartState & import('./store-factory').BaseActions<CartState> & CartActions) | ((state: import('immer').WritableDraft<CartState & import('./store-factory').BaseActions<CartState> & CartActions>) => void), shouldReplace: true): void;
|
|
55
|
+
}>;
|
|
56
|
+
interface CategoryState {
|
|
57
|
+
selectedCategory: Category | null;
|
|
58
|
+
}
|
|
59
|
+
interface CategoryActions {
|
|
60
|
+
setSelectedCategory: (cat: Category | Record<string, any> | null) => void;
|
|
61
|
+
clearCategory: () => void;
|
|
62
|
+
}
|
|
63
|
+
export declare const useCategoryStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CategoryState & import('./store-factory').BaseActions<CategoryState> & CategoryActions>, "setState"> & {
|
|
64
|
+
setState(nextStateOrUpdater: (CategoryState & import('./store-factory').BaseActions<CategoryState> & CategoryActions) | Partial<CategoryState & import('./store-factory').BaseActions<CategoryState> & CategoryActions> | ((state: import('immer').WritableDraft<CategoryState & import('./store-factory').BaseActions<CategoryState> & CategoryActions>) => void), shouldReplace?: false): void;
|
|
65
|
+
setState(nextStateOrUpdater: (CategoryState & import('./store-factory').BaseActions<CategoryState> & CategoryActions) | ((state: import('immer').WritableDraft<CategoryState & import('./store-factory').BaseActions<CategoryState> & CategoryActions>) => void), shouldReplace: true): void;
|
|
66
|
+
}>;
|
|
67
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arkenstone-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -81,10 +81,11 @@
|
|
|
81
81
|
"axios": "^1.13.2",
|
|
82
82
|
"class-variance-authority": "^0.7.1",
|
|
83
83
|
"clsx": "^2.1.1",
|
|
84
|
+
"date-fns": "^4.1.0",
|
|
84
85
|
"immer": "^11.0.0",
|
|
85
86
|
"lucide-react": "^0.553.0",
|
|
86
87
|
"next-themes": "^0.4.6",
|
|
87
|
-
"react-day-picker": "^9.
|
|
88
|
+
"react-day-picker": "^9.11.3",
|
|
88
89
|
"react-hook-form": "^7.62.0",
|
|
89
90
|
"recharts": "^2.15.3",
|
|
90
91
|
"sonner": "^2.0.7",
|