phase-2: add shared platform interfaces and type contracts
This commit is contained in:
13
src/app/shared/models/ui/button.model.ts
Normal file
13
src/app/shared/models/ui/button.model.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export interface ButtonConfig {
|
||||
id?: string;
|
||||
label: string;
|
||||
variant: 'primary' | 'secondary' | 'tertiary' | 'ghost' | 'danger';
|
||||
size?: 'sm' | 'md' | 'lg';
|
||||
icon?: string;
|
||||
disabled?: boolean;
|
||||
loading?: boolean;
|
||||
action?: {
|
||||
type: 'navigate' | 'submit' | 'emit' | 'custom';
|
||||
target?: string;
|
||||
};
|
||||
}
|
||||
11
src/app/shared/models/ui/category-card.model.ts
Normal file
11
src/app/shared/models/ui/category-card.model.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { ButtonConfig } from './button.model';
|
||||
|
||||
export interface CategoryCardConfig {
|
||||
id: string;
|
||||
title: string;
|
||||
description?: string;
|
||||
imageUrl?: string;
|
||||
icon?: string;
|
||||
itemsCount?: number;
|
||||
action?: ButtonConfig;
|
||||
}
|
||||
3
src/app/shared/models/ui/index.ts
Normal file
3
src/app/shared/models/ui/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './button.model';
|
||||
export * from './category-card.model';
|
||||
export * from './product-card.model';
|
||||
23
src/app/shared/models/ui/product-card.model.ts
Normal file
23
src/app/shared/models/ui/product-card.model.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { ButtonConfig } from './button.model';
|
||||
|
||||
export interface ProductCardPrice {
|
||||
amount: number;
|
||||
currency: string;
|
||||
originalAmount?: number;
|
||||
}
|
||||
|
||||
export interface ProductCardConfig {
|
||||
id: string;
|
||||
sku: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
imageUrl: string;
|
||||
badges?: string[];
|
||||
tags?: string[];
|
||||
rating?: number;
|
||||
reviewsCount?: number;
|
||||
price: ProductCardPrice;
|
||||
stockStatus?: 'in_stock' | 'low_stock' | 'out_of_stock';
|
||||
primaryAction?: ButtonConfig;
|
||||
secondaryAction?: ButtonConfig;
|
||||
}
|
||||
Reference in New Issue
Block a user