arkenstone-ui 0.0.17 → 0.0.19
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/arkenstone-ui.es.js +11692 -188
- package/dist/arkenstone-ui.umd.js +112 -4
- package/dist/assets/style.css +1 -0
- package/dist/types/components/access-gate.d.ts +11 -0
- package/dist/types/components/arkestone.d.ts +27 -0
- package/dist/types/components/custom/breadcrumb.d.ts +7 -0
- package/dist/types/components/custom/button.d.ts +4 -0
- package/dist/types/components/custom/index.d.ts +8 -0
- package/dist/types/components/custom/input.d.ts +3 -0
- package/dist/types/components/custom/mode-toggle.d.ts +1 -0
- package/dist/types/components/custom/search.d.ts +23 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/sidebar/app-sidebar.d.ts +3 -0
- package/dist/types/components/sidebar/nav-main.d.ts +14 -0
- package/dist/types/components/sidebar/nav-secondary.d.ts +10 -0
- package/dist/types/components/sidebar/nav-slot2.d.ts +15 -0
- package/dist/types/components/sidebar/nav-user.d.ts +21 -0
- package/dist/types/components/tables/default-table.d.ts +17 -0
- package/dist/types/components/ui/accordion.d.ts +7 -0
- package/dist/types/components/ui/alert.d.ts +9 -0
- package/dist/types/components/ui/avatar.d.ts +6 -0
- package/dist/types/components/ui/badge.d.ts +9 -0
- package/dist/types/components/ui/breadcrumb.d.ts +11 -0
- package/dist/types/components/ui/button.d.ts +10 -0
- package/dist/types/components/ui/calendar.d.ts +8 -0
- package/dist/types/components/ui/card.d.ts +8 -0
- package/dist/types/components/ui/chart.d.ts +40 -0
- package/dist/types/components/ui/checkbox.d.ts +4 -0
- package/dist/types/components/ui/collapsible.d.ts +5 -0
- package/dist/types/components/ui/dialog.d.ts +13 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/types/components/ui/form.d.ts +24 -0
- package/dist/types/components/ui/hover-card.d.ts +6 -0
- package/dist/types/components/ui/icon.d.ts +7 -0
- package/dist/types/components/ui/input.d.ts +3 -0
- package/dist/types/components/ui/label.d.ts +4 -0
- package/dist/types/components/ui/navigation-menu.d.ts +14 -0
- package/dist/types/components/ui/placeholder-pattern.d.ts +5 -0
- package/dist/types/components/ui/popover.d.ts +6 -0
- package/dist/types/components/ui/scroll-area.d.ts +5 -0
- package/dist/types/components/ui/select.d.ts +15 -0
- package/dist/types/components/ui/separator.d.ts +4 -0
- package/dist/types/components/ui/sheet.d.ts +13 -0
- package/dist/types/components/ui/sidebar.d.ts +70 -0
- package/dist/types/components/ui/skeleton.d.ts +2 -0
- package/dist/types/components/ui/sonner.d.ts +3 -0
- package/dist/types/components/ui/table.d.ts +10 -0
- package/dist/types/components/ui/tabs.d.ts +7 -0
- package/dist/types/components/ui/toggle-group.d.ts +7 -0
- package/dist/types/components/ui/toggle.d.ts +9 -0
- package/dist/types/components/ui/tooltip.d.ts +7 -0
- package/dist/types/components/workspace/workspace.d.ts +1 -0
- package/dist/types/config/config.d.ts +41 -0
- package/dist/types/e-commerce/index.d.ts +1 -0
- package/dist/types/e-commerce/product/components/catelog/components/category-filter.d.ts +14 -0
- package/dist/types/e-commerce/product/components/catelog/components/filter.d.ts +60 -0
- package/dist/types/e-commerce/product/components/catelog/components/index.d.ts +6 -0
- package/dist/types/e-commerce/product/components/catelog/components/listing-controls.d.ts +12 -0
- package/dist/types/e-commerce/product/components/catelog/components/pagination.d.ts +37 -0
- package/dist/types/e-commerce/product/components/catelog/components/sort-bar.d.ts +33 -0
- package/dist/types/e-commerce/product/components/catelog/components/view-mode.d.ts +22 -0
- package/dist/types/e-commerce/product/components/catelog/index.d.ts +3 -0
- package/dist/types/e-commerce/product/components/catelog/layouts/catelog-content-layout.d.ts +9 -0
- package/dist/types/e-commerce/product/components/catelog/layouts/index.d.ts +2 -0
- package/dist/types/e-commerce/product/components/catelog/layouts/listings-layout.d.ts +13 -0
- package/dist/types/e-commerce/product/components/catelog/pages/default-catelog.d.ts +1 -0
- package/dist/types/e-commerce/product/components/catelog/pages/index.d.ts +1 -0
- package/dist/types/e-commerce/product/components/index.d.ts +2 -0
- package/dist/types/e-commerce/product/components/product-card/components/add-to-cart-button.d.ts +19 -0
- package/dist/types/e-commerce/product/components/product-card/components/brand-title.d.ts +16 -0
- package/dist/types/e-commerce/product/components/product-card/components/categories.d.ts +19 -0
- package/dist/types/e-commerce/product/components/product-card/components/discount-badge.d.ts +13 -0
- package/dist/types/e-commerce/product/components/product-card/components/index.d.ts +8 -0
- package/dist/types/e-commerce/product/components/product-card/components/price-card.d.ts +21 -0
- package/dist/types/e-commerce/product/components/product-card/components/product-image.d.ts +15 -0
- package/dist/types/e-commerce/product/components/product-card/components/view-details-button.d.ts +8 -0
- package/dist/types/e-commerce/product/components/product-card/components/wishlist-button.d.ts +15 -0
- package/dist/types/e-commerce/product/components/product-card/index.d.ts +4 -0
- package/dist/types/e-commerce/product/components/product-card/layouts/index.d.ts +2 -0
- package/dist/types/e-commerce/product/components/product-card/layouts/product-card-image-layout.d.ts +35 -0
- package/dist/types/e-commerce/product/components/product-card/layouts/product-card-layout.d.ts +16 -0
- package/dist/types/e-commerce/product/components/product-card/page/index.d.ts +1 -0
- package/dist/types/e-commerce/product/components/product-card/page/product-card-listing.d.ts +2 -0
- package/dist/types/e-commerce/product/components/product-card/product-card.d.ts +16 -0
- package/dist/types/e-commerce/product/index.d.ts +3 -0
- package/dist/types/e-commerce/product/service/brand-service.d.ts +67 -0
- package/dist/types/e-commerce/product/service/category-service.d.ts +68 -0
- package/dist/types/e-commerce/product/service/index.d.ts +7 -0
- package/dist/types/e-commerce/product/service/product-image-service.d.ts +44 -0
- package/dist/types/e-commerce/product/service/product-service.d.ts +67 -0
- package/dist/types/e-commerce/product/service/product-taxonomy-service.d.ts +49 -0
- package/dist/types/e-commerce/product/service/taxonomy-service.d.ts +69 -0
- package/dist/types/e-commerce/product/service/taxonomy-type-service.d.ts +68 -0
- package/dist/types/e-commerce/product/types/index.d.ts +87 -0
- package/dist/types/hooks/api.d.ts +16 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/use-access.d.ts +7 -0
- package/dist/types/hooks/use-mobile.d.ts +1 -0
- package/dist/types/index.d.ts +7 -3
- package/dist/types/layouts/index.d.ts +0 -0
- package/dist/types/layouts/panels/default-panel-layout.d.ts +5 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/provider/index.d.ts +1 -0
- package/dist/types/provider/theme-provider.d.ts +13 -0
- package/dist/types/services/planet-service.d.ts +20 -0
- package/dist/types/services/service-factory.d.ts +96 -0
- package/dist/types/stores/acl.store.d.ts +8 -0
- package/dist/types/stores/config.store.d.ts +11 -0
- package/dist/types/stores/index.d.ts +4 -0
- package/dist/types/stores/store-factory.d.ts +17 -0
- package/dist/types/stores/useStore.d.ts +43 -0
- package/dist/types/types/acl.d.ts +38 -0
- package/dist/types/types/config.d.ts +17 -0
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/util/currency-code/currency-symbols.json.d.ts +17 -0
- package/dist/types/util/currency-code/index.d.ts +6 -0
- package/dist/types/util/index.d.ts +2 -0
- package/dist/types/util/text-filter.d.ts +6 -0
- package/package.json +38 -2
- package/dist/style.css +0 -1
- package/dist/types/components/button.d.ts +0 -5
- package/dist/types/components/janith-nirmal.d.ts +0 -3
- package/dist/types/pages/home.d.ts +0 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export interface Brand {
|
|
2
|
+
id: number;
|
|
3
|
+
name: string;
|
|
4
|
+
slug: string;
|
|
5
|
+
description: string | null;
|
|
6
|
+
logo: string | null;
|
|
7
|
+
is_active: boolean;
|
|
8
|
+
product_count: number;
|
|
9
|
+
created_at: string;
|
|
10
|
+
updated_at: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ProductImage {
|
|
13
|
+
id: number;
|
|
14
|
+
product_id: number;
|
|
15
|
+
image_url: string;
|
|
16
|
+
alt_text: string | null;
|
|
17
|
+
is_primary: boolean;
|
|
18
|
+
sort_order: number;
|
|
19
|
+
}
|
|
20
|
+
export interface Category {
|
|
21
|
+
id: number;
|
|
22
|
+
parent_id?: number | null;
|
|
23
|
+
name: string;
|
|
24
|
+
slug: string;
|
|
25
|
+
description: string | null;
|
|
26
|
+
children?: Category[];
|
|
27
|
+
products_count?: number;
|
|
28
|
+
created_at: string;
|
|
29
|
+
updated_at: string;
|
|
30
|
+
}
|
|
31
|
+
export interface TaxonomyType {
|
|
32
|
+
id: number;
|
|
33
|
+
name: string;
|
|
34
|
+
slug: string;
|
|
35
|
+
description: string | null;
|
|
36
|
+
is_active: boolean;
|
|
37
|
+
taxonomies_count: number;
|
|
38
|
+
taxonomies?: Taxonomy[];
|
|
39
|
+
created_at: string;
|
|
40
|
+
updated_at: string;
|
|
41
|
+
}
|
|
42
|
+
export interface Taxonomy {
|
|
43
|
+
id: number;
|
|
44
|
+
taxonomy_type_id: number;
|
|
45
|
+
parent_id: number | null;
|
|
46
|
+
name: string;
|
|
47
|
+
slug: string;
|
|
48
|
+
description: string | null;
|
|
49
|
+
sort_order: number;
|
|
50
|
+
meta: Record<string, any> | null;
|
|
51
|
+
is_active: boolean;
|
|
52
|
+
type?: TaxonomyType | null;
|
|
53
|
+
parent?: Taxonomy | null;
|
|
54
|
+
children?: Taxonomy[];
|
|
55
|
+
products_count?: number;
|
|
56
|
+
created_at: string;
|
|
57
|
+
updated_at: string;
|
|
58
|
+
}
|
|
59
|
+
export interface ProductTaxonomy {
|
|
60
|
+
product_id: number;
|
|
61
|
+
taxonomy_id: number;
|
|
62
|
+
product?: Product | null;
|
|
63
|
+
taxonomy?: Taxonomy | null;
|
|
64
|
+
created_at: string;
|
|
65
|
+
updated_at: string;
|
|
66
|
+
}
|
|
67
|
+
export interface Product {
|
|
68
|
+
id: number;
|
|
69
|
+
name: string;
|
|
70
|
+
slug: string;
|
|
71
|
+
description: string | null;
|
|
72
|
+
price: number | null;
|
|
73
|
+
discount_type: string | null;
|
|
74
|
+
discount_value: number | null;
|
|
75
|
+
sale_price: number | null;
|
|
76
|
+
has_discount: boolean;
|
|
77
|
+
sku: string | null;
|
|
78
|
+
quantity: number | null;
|
|
79
|
+
is_active: boolean;
|
|
80
|
+
brand: Brand | null;
|
|
81
|
+
categories: Category[] | null;
|
|
82
|
+
taxonomies: Taxonomy[] | null;
|
|
83
|
+
images: ProductImage[] | null;
|
|
84
|
+
primary_image: ProductImage | null;
|
|
85
|
+
created_at: string;
|
|
86
|
+
updated_at: string;
|
|
87
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ApiOptions {
|
|
2
|
+
data?: any;
|
|
3
|
+
params?: any;
|
|
4
|
+
headers?: any;
|
|
5
|
+
displayError?: boolean;
|
|
6
|
+
displaySuccess?: boolean;
|
|
7
|
+
isMultipart?: boolean;
|
|
8
|
+
isDownload?: boolean;
|
|
9
|
+
withCredentials?: boolean;
|
|
10
|
+
onSuccess?: (data: any) => void;
|
|
11
|
+
onError?: (error: any) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const apiGet: (url: string, options?: ApiOptions) => Promise<any>;
|
|
14
|
+
export declare const apiPost: (url: string, options?: ApiOptions) => Promise<any>;
|
|
15
|
+
export declare const apiPut: (url: string, options?: ApiOptions) => Promise<any>;
|
|
16
|
+
export declare const apiDelete: (url: string, options?: ApiOptions) => Promise<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './api';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Accessor, Role } from '../types/acl';
|
|
2
|
+
export declare const useAccess: (userRoles?: Role[]) => {
|
|
3
|
+
can: (accessor: Accessor | Accessor[], matchAll?: boolean) => boolean;
|
|
4
|
+
must: (accessor: Accessor | Accessor[], message?: string) => void;
|
|
5
|
+
isReady: boolean;
|
|
6
|
+
canRender: (component: React.ReactNode, accessor: Accessor | Accessor[], matchAll?: boolean) => React.ReactNode;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsMobile(): boolean;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
export * from './components
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
1
|
+
export * from './components';
|
|
2
|
+
export * from './hooks';
|
|
3
|
+
export * from './provider';
|
|
4
|
+
export * from './stores';
|
|
5
|
+
export * from './types';
|
|
6
|
+
export * from './util';
|
|
7
|
+
export * from './e-commerce';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './theme-provider';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type Theme = "dark" | "light" | "system";
|
|
2
|
+
type ThemeProviderProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
defaultTheme?: Theme;
|
|
5
|
+
storageKey?: string;
|
|
6
|
+
};
|
|
7
|
+
type ThemeProviderState = {
|
|
8
|
+
theme: Theme;
|
|
9
|
+
setTheme: (theme: Theme) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function ThemeProvider({ children, defaultTheme, storageKey, ...props }: ThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const useTheme: () => ThemeProviderState;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ServiceFactory } from './service-factory';
|
|
2
|
+
export interface Planet {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
radius: number;
|
|
6
|
+
habitable: boolean;
|
|
7
|
+
moons: number;
|
|
8
|
+
planetHash: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CreatePlanetDto {
|
|
11
|
+
name: string;
|
|
12
|
+
radius: number;
|
|
13
|
+
habitable: boolean;
|
|
14
|
+
moons: number;
|
|
15
|
+
}
|
|
16
|
+
export interface PlanetState {
|
|
17
|
+
planets: Planet[];
|
|
18
|
+
activePlanet: Planet | null;
|
|
19
|
+
}
|
|
20
|
+
export declare const PlanetService: ServiceFactory<Planet, CreatePlanetDto, Partial<Planet>, PlanetState>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { StoreApi, UseBoundStore } from 'zustand';
|
|
2
|
+
import { ApiOptions } from '../hooks/api';
|
|
3
|
+
/**
|
|
4
|
+
* Standard shape for a paginated list response.
|
|
5
|
+
* Customize 'data', 'meta', 'links' based on your backend structure.
|
|
6
|
+
*/
|
|
7
|
+
export interface ListResponse<T> {
|
|
8
|
+
data: T[];
|
|
9
|
+
meta?: any;
|
|
10
|
+
links?: any;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Configuration options passed when initializing a specific Service.
|
|
14
|
+
*/
|
|
15
|
+
export interface ServiceConfig<TState extends object> {
|
|
16
|
+
/**
|
|
17
|
+
* Base endpoint for the resource (e.g., '/users').
|
|
18
|
+
* Can be a string or a function returning a string for dynamic runtime resolution.
|
|
19
|
+
*/
|
|
20
|
+
endpoint: string | (() => string);
|
|
21
|
+
/**
|
|
22
|
+
* Name of the entity (used for logging or debugging).
|
|
23
|
+
*/
|
|
24
|
+
entityName?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Store Configuration.
|
|
27
|
+
* If provided, the service will create a singleton Zustand store.
|
|
28
|
+
*/
|
|
29
|
+
store?: {
|
|
30
|
+
initialState: TState;
|
|
31
|
+
/** Unique name for local storage persistence. If omitted, persistence is disabled. */
|
|
32
|
+
persistName?: string;
|
|
33
|
+
/** Custom actions/selectors to inject into the store */
|
|
34
|
+
methods?: (set: any, get: any) => any;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The Abstract Base Class.
|
|
39
|
+
* T = Entity Type (e.g., User)
|
|
40
|
+
* C = Create DTO (e.g., CreateUserRequest)
|
|
41
|
+
* U = Update DTO (e.g., UpdateUserRequest)
|
|
42
|
+
* TState = Structure of the Zustand Store State
|
|
43
|
+
*/
|
|
44
|
+
export declare class ServiceFactory<T extends object, C extends object = Partial<T>, U extends object = Partial<T>, TState extends object = {
|
|
45
|
+
list: T[];
|
|
46
|
+
selected: T | null;
|
|
47
|
+
loading: boolean;
|
|
48
|
+
}> {
|
|
49
|
+
protected config: ServiceConfig<TState>;
|
|
50
|
+
private _store;
|
|
51
|
+
constructor(config: ServiceConfig<TState>);
|
|
52
|
+
/**
|
|
53
|
+
* Returns the React Hook for the Zustand store.
|
|
54
|
+
* Initializes the store only once (lazy loading).
|
|
55
|
+
*/
|
|
56
|
+
get useStore(): UseBoundStore<StoreApi<any>>;
|
|
57
|
+
/**
|
|
58
|
+
* Access the vanilla store state (non-hook) for usage outside React components.
|
|
59
|
+
*/
|
|
60
|
+
get storeApi(): any;
|
|
61
|
+
/**
|
|
62
|
+
* Resolves the base URL. Supports dynamic strings based on runtime logic.
|
|
63
|
+
* @param append - Optional string to append (e.g., '/active')
|
|
64
|
+
*/
|
|
65
|
+
protected getEndpoint(append?: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* GET: Fetch all or paginated list.
|
|
68
|
+
* Defaults: Display Error = True, Display Success = False
|
|
69
|
+
*/
|
|
70
|
+
getAll(params?: any, options?: ApiOptions): Promise<ListResponse<T> | T[] | null>;
|
|
71
|
+
/**
|
|
72
|
+
* GET: Fetch single entity by ID.
|
|
73
|
+
*/
|
|
74
|
+
getById(id: string | number, options?: ApiOptions): Promise<T | null>;
|
|
75
|
+
/**
|
|
76
|
+
* POST: Create a new entity.
|
|
77
|
+
*/
|
|
78
|
+
create(data: C, options?: ApiOptions): Promise<T | null>;
|
|
79
|
+
/**
|
|
80
|
+
* PUT: Update an existing entity.
|
|
81
|
+
*/
|
|
82
|
+
update(id: string | number, data: U, options?: ApiOptions): Promise<T | null>;
|
|
83
|
+
/**
|
|
84
|
+
* DELETE: Remove an entity.
|
|
85
|
+
*/
|
|
86
|
+
delete(id: string | number, options?: ApiOptions): Promise<any>;
|
|
87
|
+
/**
|
|
88
|
+
* Helper for custom actions (e.g., /users/1/activate)
|
|
89
|
+
*/
|
|
90
|
+
customAction<Res = any>(method: 'get' | 'post' | 'put' | 'delete', actionPath: string, options?: ApiOptions): Promise<Res | null>;
|
|
91
|
+
/**
|
|
92
|
+
* Centralized place to inject default logic before any request.
|
|
93
|
+
* Can be overridden by child classes to add auth headers, logging, etc.
|
|
94
|
+
*/
|
|
95
|
+
protected applyMiddleware(options: ApiOptions): ApiOptions;
|
|
96
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ACLState, ACLActions } from '../types/acl';
|
|
2
|
+
/**
|
|
3
|
+
* ACL Store for managing the access related configrations and checks
|
|
4
|
+
*/
|
|
5
|
+
export declare const useACLStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<ACLState & import('../../lib/stores/store-factory').BaseActions<ACLState> & ACLActions>, "setState"> & {
|
|
6
|
+
setState(nextStateOrUpdater: (ACLState & import('../../lib/stores/store-factory').BaseActions<ACLState> & ACLActions) | Partial<ACLState & import('../../lib/stores/store-factory').BaseActions<ACLState> & ACLActions> | ((state: import('immer').WritableDraft<ACLState & import('../../lib/stores/store-factory').BaseActions<ACLState> & ACLActions>) => void), shouldReplace?: false): void;
|
|
7
|
+
setState(nextStateOrUpdater: (ACLState & import('../../lib/stores/store-factory').BaseActions<ACLState> & ACLActions) | ((state: import('immer').WritableDraft<ACLState & import('../../lib/stores/store-factory').BaseActions<ACLState> & ACLActions>) => void), shouldReplace: true): void;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AppConfig } from '../types/config';
|
|
2
|
+
interface ConfigActions {
|
|
3
|
+
toggleTheme: (theme?: AppConfig["theme"]) => void;
|
|
4
|
+
toggleFeature: (key: keyof AppConfig["features"]) => void;
|
|
5
|
+
setApi: (api: AppConfig["api"]) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const useConfigStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<AppConfig & import('./store-factory').BaseActions<AppConfig> & ConfigActions>, "setState"> & {
|
|
8
|
+
setState(nextStateOrUpdater: (AppConfig & import('./store-factory').BaseActions<AppConfig> & ConfigActions) | Partial<AppConfig & import('./store-factory').BaseActions<AppConfig> & ConfigActions> | ((state: import('immer').WritableDraft<AppConfig & import('./store-factory').BaseActions<AppConfig> & ConfigActions>) => void), shouldReplace?: false): void;
|
|
9
|
+
setState(nextStateOrUpdater: (AppConfig & import('./store-factory').BaseActions<AppConfig> & ConfigActions) | ((state: import('immer').WritableDraft<AppConfig & import('./store-factory').BaseActions<AppConfig> & ConfigActions>) => void), shouldReplace: true): void;
|
|
10
|
+
}>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Define Base Actions for the factory
|
|
3
|
+
*/
|
|
4
|
+
export interface BaseActions<T> {
|
|
5
|
+
update: (fn: (state: T) => void) => void;
|
|
6
|
+
reset: () => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Generic store factory that will be used to create a store.
|
|
10
|
+
*/
|
|
11
|
+
export declare const createGenericStore: <TState extends object, TCustomActions = {}>(initialState: TState, options?: {
|
|
12
|
+
name?: string;
|
|
13
|
+
methods?: (set: (fn: (state: TState) => void) => void, get: () => TState & BaseActions<TState> & TCustomActions) => TCustomActions;
|
|
14
|
+
}) => import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<TState & BaseActions<TState> & TCustomActions>, "setState"> & {
|
|
15
|
+
setState(nextStateOrUpdater: Exclude<TState & BaseActions<TState> & TCustomActions, (...args: any[]) => any> | Partial<Exclude<TState & BaseActions<TState> & TCustomActions, (...args: any[]) => any>> | ((state: import('immer').Draft<Exclude<TState & BaseActions<TState> & TCustomActions, (...args: any[]) => any>>) => void), shouldReplace?: false): void;
|
|
16
|
+
setState(nextStateOrUpdater: Exclude<TState & BaseActions<TState> & TCustomActions, (...args: any[]) => any> | ((state: import('immer').Draft<Exclude<TState & BaseActions<TState> & TCustomActions, (...args: any[]) => any>>) => void), shouldReplace: true): void;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
setSearchQuery: (query: string) => void;
|
|
14
|
+
setFilters: (filters: Record<string, any>) => void;
|
|
15
|
+
setSortOrder: (order: "asc" | "desc") => void;
|
|
16
|
+
setSortBy: (by: string) => void;
|
|
17
|
+
setViewMode: (mode: "list" | "card" | "table") => void;
|
|
18
|
+
setPage: (page: number) => void;
|
|
19
|
+
fetchProducts: () => Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
interface ProductCardState {
|
|
22
|
+
wishlist: number[];
|
|
23
|
+
activeProductId?: number | null;
|
|
24
|
+
toggleWishlist: (productId: number) => void;
|
|
25
|
+
isWishlisted: (productId: number) => boolean;
|
|
26
|
+
viewDetails: (productId: number) => void;
|
|
27
|
+
closeDetails: () => void;
|
|
28
|
+
}
|
|
29
|
+
interface CartState {
|
|
30
|
+
cart: Record<number, number>;
|
|
31
|
+
addToCart: (productId: number, qty?: number) => void;
|
|
32
|
+
removeFromCart: (productId: number) => void;
|
|
33
|
+
getCartQuantity: (productId: number) => number;
|
|
34
|
+
}
|
|
35
|
+
interface CategoryState {
|
|
36
|
+
selectedCategory: Category | null;
|
|
37
|
+
setSelectedCategory: (cat: Category | Record<string, any>) => void;
|
|
38
|
+
}
|
|
39
|
+
export declare const useCatalogStore: import('zustand').UseBoundStore<import('zustand').StoreApi<CatalogState>>;
|
|
40
|
+
export declare const useProductCardStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ProductCardState>>;
|
|
41
|
+
export declare const useCartStore: import('zustand').UseBoundStore<import('zustand').StoreApi<CartState>>;
|
|
42
|
+
export declare const useCategoryStore: import('zustand').UseBoundStore<import('zustand').StoreApi<CategoryState>>;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type Role = string;
|
|
2
|
+
export type Permission = string;
|
|
3
|
+
export type Accessor = Role | Permission | string;
|
|
4
|
+
export interface ACLConfig {
|
|
5
|
+
mode: 'local' | 'remote';
|
|
6
|
+
/**
|
|
7
|
+
* Group definitions.
|
|
8
|
+
* Example: { "staff": ["admin", "manager"], "public": ["guest"] }
|
|
9
|
+
*/
|
|
10
|
+
groups?: Record<string, Role[]>;
|
|
11
|
+
/**
|
|
12
|
+
* API Configuration for remote mode
|
|
13
|
+
*/
|
|
14
|
+
api?: {
|
|
15
|
+
url: string;
|
|
16
|
+
isSameOrigin?: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Permission definitions.
|
|
20
|
+
* Example: { "manager": ["product.create", "product.edit"] }
|
|
21
|
+
*/
|
|
22
|
+
permissions?: Record<Role, Permission[]>;
|
|
23
|
+
/**
|
|
24
|
+
* Optional fetcher for remote mode
|
|
25
|
+
*/
|
|
26
|
+
fetchRemoteConfig?: () => Promise<{
|
|
27
|
+
groups?: Record<string, Role[]>;
|
|
28
|
+
permissions?: Record<Role, Permission[]>;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
export interface ACLState {
|
|
32
|
+
config: ACLConfig;
|
|
33
|
+
isReady: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface ACLActions {
|
|
36
|
+
configure: (config: ACLConfig) => Promise<void>;
|
|
37
|
+
check: (userRoles: Role[], accessor: Accessor | Accessor[], matchAll?: boolean) => boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global configuration for the framework
|
|
3
|
+
*/
|
|
4
|
+
export interface AppConfig {
|
|
5
|
+
theme: "light" | "dark";
|
|
6
|
+
currency: "USD" | "LKR" | "EUR";
|
|
7
|
+
features: {
|
|
8
|
+
reviewsEnabled: boolean;
|
|
9
|
+
wishlistEnabled: boolean;
|
|
10
|
+
productZoom: boolean;
|
|
11
|
+
};
|
|
12
|
+
api?: {
|
|
13
|
+
url?: string;
|
|
14
|
+
isSameOrigin?: boolean;
|
|
15
|
+
withCredentials?: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"$": "USD",
|
|
3
|
+
"€": "EUR",
|
|
4
|
+
"£": "GBP",
|
|
5
|
+
"¥": "JPY",
|
|
6
|
+
"₹": "INR",
|
|
7
|
+
"₽": "RUB",
|
|
8
|
+
"₩": "KRW",
|
|
9
|
+
"₪": "ILS",
|
|
10
|
+
"฿": "THB",
|
|
11
|
+
"₫": "VND",
|
|
12
|
+
"₺": "TRY",
|
|
13
|
+
"₱": "PHP",
|
|
14
|
+
"Fr": "CHF"
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arkenstone-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/arkenstone-ui.umd.js",
|
|
6
6
|
"module": "./dist/arkenstone-ui.es.js",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"@storybook/addon-onboarding": "^10.0.7",
|
|
35
35
|
"@storybook/addon-vitest": "^10.0.7",
|
|
36
36
|
"@storybook/react-vite": "^10.0.7",
|
|
37
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
37
38
|
"@types/node": "^24.10.1",
|
|
38
39
|
"@types/react": "^19.2.2",
|
|
39
40
|
"@types/react-dom": "^19.2.2",
|
|
@@ -41,12 +42,47 @@
|
|
|
41
42
|
"@vitest/browser-playwright": "^4.0.9",
|
|
42
43
|
"@vitest/coverage-v8": "^4.0.9",
|
|
43
44
|
"eslint-plugin-storybook": "^10.0.7",
|
|
44
|
-
"@tailwindcss/vite": "^4.1.17",
|
|
45
45
|
"playwright": "^1.56.1",
|
|
46
46
|
"storybook": "^10.0.7",
|
|
47
|
+
"tw-animate-css": "^1.4.0",
|
|
47
48
|
"typescript": "^5.4.0",
|
|
48
49
|
"vite": "^5.4.10",
|
|
49
50
|
"vite-plugin-dts": "^4.5.4",
|
|
50
51
|
"vitest": "^4.0.9"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@inertiajs/react": "^2.2.18",
|
|
55
|
+
"@radix-ui/react-avatar": "^1.1.11",
|
|
56
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
57
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
58
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
59
|
+
"@radix-ui/react-hover-card": "^1.1.15",
|
|
60
|
+
"@radix-ui/react-separator": "^1.1.8",
|
|
61
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
62
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
63
|
+
"@radix-ui/react-accordion": "^1.2.8",
|
|
64
|
+
"@radix-ui/react-checkbox": "^1.1.4",
|
|
65
|
+
"@radix-ui/react-label": "^2.1.3",
|
|
66
|
+
"@radix-ui/react-navigation-menu": "^1.2.5",
|
|
67
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
68
|
+
"@radix-ui/react-scroll-area": "^1.2.3",
|
|
69
|
+
"@radix-ui/react-select": "^2.1.7",
|
|
70
|
+
"@radix-ui/react-tabs": "^1.1.3",
|
|
71
|
+
"@radix-ui/react-toggle": "^1.1.2",
|
|
72
|
+
"@radix-ui/react-toggle-group": "^1.1.2",
|
|
73
|
+
"@tanstack/react-table": "^8.21.3",
|
|
74
|
+
"axios": "^1.13.2",
|
|
75
|
+
"class-variance-authority": "^0.7.1",
|
|
76
|
+
"clsx": "^2.1.1",
|
|
77
|
+
"immer": "^11.0.0",
|
|
78
|
+
"lucide-react": "^0.553.0",
|
|
79
|
+
"sonner": "^2.0.7",
|
|
80
|
+
"tailwind-merge": "^3.4.0",
|
|
81
|
+
"tailwindcss": "^4.1.17",
|
|
82
|
+
"react-day-picker": "^9.9.0",
|
|
83
|
+
"next-themes": "^0.4.6",
|
|
84
|
+
"recharts": "^2.15.3",
|
|
85
|
+
"react-hook-form": "^7.62.0",
|
|
86
|
+
"zustand": "^5.0.8"
|
|
51
87
|
}
|
|
52
88
|
}
|
package/dist/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-green-500:oklch(72.3% .219 149.579);--color-blue-500:oklch(62.3% .214 259.815);--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.my-40{margin-block:calc(var(--spacing)*40)}.w-full{width:100%}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.rounded-full{border-radius:3.40282e38px}.bg-blue-500{background-color:var(--color-blue-500)}.bg-green-500{background-color:var(--color-green-500)}.px-10{padding-inline:calc(var(--spacing)*10)}.px-30{padding-inline:calc(var(--spacing)*30)}.py-5{padding-block:calc(var(--spacing)*5)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-blue-500{color:var(--color-blue-500)}}:root{--background:#f4f8f5;--foreground:#2c2f2a;--card:#e7edea;--card-foreground:#2c2f2a;--popover:#edf3ef;--popover-foreground:#2c2f2a;--primary:#8ca982;--primary-foreground:#fff;--secondary:#d9e1db;--secondary-foreground:#1e241f;--muted:#c4ccc7;--muted-foreground:#5a605b;--accent:#aa8745;--accent-foreground:#fff;--destructive:#b54949;--destructive-foreground:#fff;--border:#a1b0a2;--input:#90a093;--ring:#b9cbbd;--chart-1:#6b8e6d;--chart-2:#b2a56e;--chart-3:#748f99;--chart-4:#e5c67c;--chart-5:#9e7a3e;--radius:.625rem;--sidebar:#e0e8e3;--sidebar-foreground:#2c2f2a;--sidebar-primary:#8ca982;--sidebar-primary-foreground:#fff;--sidebar-accent:#aa8745;--sidebar-accent-foreground:#fff;--sidebar-border:#cdd9d3;--sidebar-ring:#b9cbbd;--color-card:#dce5de}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:var(--background);border-radius:30px}::-webkit-scrollbar-thumb{background:var(--muted-foreground);border-radius:30px}::-webkit-scrollbar-thumb:hover{background:var(--accent)}::-webkit-scrollbar-thumb:active{background:var(--accent)}.c-text{color:red}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function Home(): import("react/jsx-runtime").JSX.Element;
|