@cerca/design-system 1.0.2 → 1.0.4
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/fesm2022/cerca-design-system.mjs +337 -201
- package/fesm2022/cerca-design-system.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/styles/_index.scss +7 -0
- package/src/lib/styles/_overrides.scss +4 -0
- package/src/lib/styles/_theme.scss +87 -0
- package/types/cerca-design-system.d.ts +32 -10
package/package.json
CHANGED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* =========================================
|
|
2
|
+
DESIGN SYSTEM THEME
|
|
3
|
+
Mapeo de Design System Tokens
|
|
4
|
+
========================================= */
|
|
5
|
+
|
|
6
|
+
@use '../tokens/colors' as *;
|
|
7
|
+
@use '../tokens/typography' as *;
|
|
8
|
+
@use '../tokens/spacing' as *;
|
|
9
|
+
@use '../tokens/radius' as *;
|
|
10
|
+
@use '../tokens/elevations' as *;
|
|
11
|
+
|
|
12
|
+
/* --- Primary Theme Colors (Cerca Brand) --- */
|
|
13
|
+
$primary-color: var(--color-primary); // Sky-600 (#0284C7)
|
|
14
|
+
$success-color: var(--color-success); // Emerald-500 (#10B981)
|
|
15
|
+
$error-color: var(--color-alert); // Rose-500 (#F43F5E)
|
|
16
|
+
$warning-color: var(--color-warning); // Amber-500 (#F59E0B)
|
|
17
|
+
$info-color: var(--color-primary); // Blue-500 (#3B82F6)
|
|
18
|
+
|
|
19
|
+
/* --- Text Colors --- */
|
|
20
|
+
$text-color: var(--color-slate-900); // Stone-900
|
|
21
|
+
$text-color-secondary: var(--color-secondary); // Stone-600
|
|
22
|
+
$heading-color: var(--color-slate-900);
|
|
23
|
+
$disabled-color: var(--color-slate-400);
|
|
24
|
+
|
|
25
|
+
/* --- Background Colors --- */
|
|
26
|
+
$body-background: var(--color-background); // Stone-50
|
|
27
|
+
$component-background: var(--color-surface); // White
|
|
28
|
+
$background-color-light: var(--color-background);
|
|
29
|
+
$background-color-base: var(--color-slate-100);
|
|
30
|
+
|
|
31
|
+
/* --- Border Colors --- */
|
|
32
|
+
$border-color-base: var(--color-border);
|
|
33
|
+
$border-color-split: var(--color-border);
|
|
34
|
+
|
|
35
|
+
/* --- Border Radius (from Design System) --- */
|
|
36
|
+
$border-radius-base: var(--radius-cerca); // 8px
|
|
37
|
+
$border-radius-sm: var(--radius-cerca-sm); // 4px
|
|
38
|
+
|
|
39
|
+
/* --- Shadows (from Design System) --- */
|
|
40
|
+
$box-shadow-base: var(--shadow-premium);
|
|
41
|
+
$shadow-1-up: var(--shadow-premium);
|
|
42
|
+
$shadow-1-down: var(--shadow-premium);
|
|
43
|
+
$shadow-2: var(--shadow-premium-hover);
|
|
44
|
+
|
|
45
|
+
/* --- Typography --- */
|
|
46
|
+
$font-family: $font-family-base;
|
|
47
|
+
$font-size-base: $font-size-md; // 16px
|
|
48
|
+
$font-size-lg: $font-size-lg; // 18px
|
|
49
|
+
$font-size-sm: $font-size-sm; // 14px
|
|
50
|
+
|
|
51
|
+
/* --- Layout --- */
|
|
52
|
+
$layout-header-background: var(--color-surface);
|
|
53
|
+
$layout-body-background: var(--color-background);
|
|
54
|
+
$layout-sider-background: var(--color-slate-900);
|
|
55
|
+
|
|
56
|
+
/* --- Animation --- */
|
|
57
|
+
$animation-duration-slow: 0.3s;
|
|
58
|
+
$animation-duration-base: 0.2s;
|
|
59
|
+
$animation-duration-fast: 0.1s;
|
|
60
|
+
|
|
61
|
+
/* --- Utilities --- */
|
|
62
|
+
.accent-text {
|
|
63
|
+
background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-accent, #00d2ff) 100%);
|
|
64
|
+
-webkit-background-clip: text;
|
|
65
|
+
background-clip: text;
|
|
66
|
+
-webkit-text-fill-color: transparent;
|
|
67
|
+
margin-left: 0.3rem;
|
|
68
|
+
|
|
69
|
+
// Auto-apply dark mode styles
|
|
70
|
+
:host-context(.dark) &,
|
|
71
|
+
.dark & {
|
|
72
|
+
background: linear-gradient(135deg, #38BDF8 0%, #22D3EE 100%);
|
|
73
|
+
/* Sky-400 to Cyan-400 */
|
|
74
|
+
-webkit-background-clip: text;
|
|
75
|
+
background-clip: text;
|
|
76
|
+
-webkit-text-fill-color: transparent;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.accent-text-dark {
|
|
81
|
+
background: linear-gradient(135deg, #38BDF8 0%, #22D3EE 100%);
|
|
82
|
+
/* Sky-400 to Cyan-400 */
|
|
83
|
+
-webkit-background-clip: text;
|
|
84
|
+
background-clip: text;
|
|
85
|
+
-webkit-text-fill-color: transparent;
|
|
86
|
+
margin-left: 0.3rem;
|
|
87
|
+
}
|
|
@@ -12,7 +12,7 @@ declare class DesignSystem {
|
|
|
12
12
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DesignSystem, "ad-design-system", never, {}, {}, never, never, true, never>;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
type FieldType = 'input' | 'select' | 'checkbox' | 'switch' | 'datepicker' | 'textarea' | 'number-input' | 'text-input' | 'select-input' | 'custom';
|
|
15
|
+
type FieldType = 'input' | 'select' | 'checkbox' | 'switch' | 'datepicker' | 'textarea' | 'number-input' | 'text-input' | 'select-input' | 'currency' | 'custom';
|
|
16
16
|
type LayoutType = 'row' | 'col' | 'card' | 'stack';
|
|
17
17
|
interface FieldOption {
|
|
18
18
|
label: string;
|
|
@@ -57,6 +57,8 @@ interface FormSchema {
|
|
|
57
57
|
fields?: (FieldSchema | LayoutSchema)[];
|
|
58
58
|
submitLabel?: string;
|
|
59
59
|
cancelLabel?: string;
|
|
60
|
+
transparentContainer?: boolean;
|
|
61
|
+
footerAlign?: 'left' | 'right' | 'center';
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
type ColumnType = 'text' | 'number' | 'date' | 'currency' | 'status' | 'actions' | 'custom';
|
|
@@ -74,6 +76,7 @@ interface TableColumn {
|
|
|
74
76
|
filterable?: boolean;
|
|
75
77
|
width?: string;
|
|
76
78
|
templateRef?: string;
|
|
79
|
+
sticky?: 'left' | 'right';
|
|
77
80
|
}
|
|
78
81
|
interface TableSchema {
|
|
79
82
|
columns: TableColumn[];
|
|
@@ -81,6 +84,7 @@ interface TableSchema {
|
|
|
81
84
|
selectable?: boolean;
|
|
82
85
|
actions?: TableAction[];
|
|
83
86
|
globalActions?: TableAction[];
|
|
87
|
+
stickyActions?: boolean;
|
|
84
88
|
}
|
|
85
89
|
|
|
86
90
|
type ResourceType = 'form' | 'table' | 'dashboard' | 'custom';
|
|
@@ -143,7 +147,7 @@ declare class AdModalService {
|
|
|
143
147
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<AdModalService>;
|
|
144
148
|
}
|
|
145
149
|
|
|
146
|
-
declare class
|
|
150
|
+
declare class AdFormEngineComponent implements OnInit {
|
|
147
151
|
schema: _angular_core.InputSignal<FormSchema>;
|
|
148
152
|
model: _angular_core.InputSignal<any>;
|
|
149
153
|
showCancel: _angular_core.InputSignal<boolean>;
|
|
@@ -156,8 +160,8 @@ declare class FormEngineComponent implements OnInit {
|
|
|
156
160
|
ngOnInit(): void;
|
|
157
161
|
submit(): void;
|
|
158
162
|
onCancel(): void;
|
|
159
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
160
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<
|
|
163
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AdFormEngineComponent, never>;
|
|
164
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AdFormEngineComponent, "ad-form-engine", never, { "schema": { "alias": "schema"; "required": true; "isSignal": true; }; "model": { "alias": "model"; "required": false; "isSignal": true; }; "showCancel": { "alias": "showCancel"; "required": false; "isSignal": true; }; "showSubmit": { "alias": "showSubmit"; "required": false; "isSignal": true; }; }, { "formSubmit": "formSubmit"; "formCancel": "formCancel"; }, never, never, true, never>;
|
|
161
165
|
}
|
|
162
166
|
|
|
163
167
|
declare class FormEngineService {
|
|
@@ -188,7 +192,12 @@ declare class TableEngineComponent {
|
|
|
188
192
|
protected Math: Math;
|
|
189
193
|
displayColumns: _angular_core.Signal<TableColumn[]>;
|
|
190
194
|
hasActions: _angular_core.Signal<boolean>;
|
|
195
|
+
stickyActions: _angular_core.Signal<boolean>;
|
|
191
196
|
getActions: _angular_core.Signal<TableAction[]>;
|
|
197
|
+
/**
|
|
198
|
+
* Returns the box-shadow for a sticky column to create a visual separator
|
|
199
|
+
*/
|
|
200
|
+
getStickyColumnShadow(sticky?: 'left' | 'right'): string | null;
|
|
192
201
|
mapVariant(color?: string): 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
193
202
|
onPageChange(newPageIndex: number): void;
|
|
194
203
|
onActionClick(action: string, data: any): void;
|
|
@@ -223,19 +232,22 @@ declare class AdInputComponent implements ControlValueAccessor {
|
|
|
223
232
|
size: _angular_core.InputSignal<"default" | "large" | "small">;
|
|
224
233
|
prefix: _angular_core.InputSignal<string | undefined>;
|
|
225
234
|
suffix: _angular_core.InputSignal<string | undefined>;
|
|
235
|
+
mask: _angular_core.InputSignal<"currency" | undefined>;
|
|
226
236
|
value: string;
|
|
227
237
|
passwordVisible: _angular_core.WritableSignal<boolean>;
|
|
228
238
|
onChange: any;
|
|
229
239
|
onTouched: any;
|
|
230
240
|
inputType: _angular_core.Signal<string>;
|
|
241
|
+
isIcon(name: string | undefined): boolean;
|
|
231
242
|
onInputChange(event: Event): void;
|
|
243
|
+
private formatCurrencyDisplay;
|
|
232
244
|
togglePasswordVisibility(): void;
|
|
233
245
|
writeValue(value: any): void;
|
|
234
246
|
registerOnChange(fn: any): void;
|
|
235
247
|
registerOnTouched(fn: any): void;
|
|
236
248
|
setDisabledState(isDisabled: boolean): void;
|
|
237
249
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AdInputComponent, never>;
|
|
238
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AdInputComponent, "ad-input", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "prefix": { "alias": "prefix"; "required": false; "isSignal": true; }; "suffix": { "alias": "suffix"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
250
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<AdInputComponent, "ad-input", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "prefix": { "alias": "prefix"; "required": false; "isSignal": true; }; "suffix": { "alias": "suffix"; "required": false; "isSignal": true; }; "mask": { "alias": "mask"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
239
251
|
}
|
|
240
252
|
|
|
241
253
|
interface SelectOption {
|
|
@@ -452,6 +464,8 @@ declare const DescriptionHeaderResourceSchema: z.ZodObject<{
|
|
|
452
464
|
onModalCancel: z.ZodOptional<z.ZodCustom<() => void, () => void>>;
|
|
453
465
|
}, z.core.$strip>>>;
|
|
454
466
|
showDivider: z.ZodOptional<z.ZodBoolean>;
|
|
467
|
+
backButton: z.ZodOptional<z.ZodBoolean>;
|
|
468
|
+
onBack: z.ZodOptional<z.ZodCustom<() => void, () => void>>;
|
|
455
469
|
}, z.core.$strip>;
|
|
456
470
|
type DescriptionHeaderButton = z.infer<typeof DescriptionHeaderButtonSchema>;
|
|
457
471
|
type DescriptionHeaderResource = z.infer<typeof DescriptionHeaderResourceSchema>;
|
|
@@ -505,6 +519,8 @@ declare class AdDescriptionHeaderComponent {
|
|
|
505
519
|
onModalCancel?: (() => void) | undefined;
|
|
506
520
|
}[] | undefined;
|
|
507
521
|
showDivider?: boolean | undefined;
|
|
522
|
+
backButton?: boolean | undefined;
|
|
523
|
+
onBack?: (() => void) | undefined;
|
|
508
524
|
}>;
|
|
509
525
|
title: _angular_core.Signal<string>;
|
|
510
526
|
accentedTitle: _angular_core.Signal<string | undefined>;
|
|
@@ -523,12 +539,18 @@ declare class AdDescriptionHeaderComponent {
|
|
|
523
539
|
onModalCancel?: (() => void) | undefined;
|
|
524
540
|
}[] | undefined>;
|
|
525
541
|
showDivider: _angular_core.Signal<boolean | undefined>;
|
|
542
|
+
backButton: _angular_core.Signal<boolean | undefined>;
|
|
543
|
+
onBack: _angular_core.Signal<(() => void) | undefined>;
|
|
526
544
|
getModalTriggerResource(button: DescriptionHeaderButton): ModalTriggerResource;
|
|
527
545
|
/**
|
|
528
546
|
* Maneja el clic en un botón
|
|
529
547
|
* @param onClick Callback del botón
|
|
530
548
|
*/
|
|
531
549
|
handleButtonClick(onClick: (() => void) | undefined): void;
|
|
550
|
+
/**
|
|
551
|
+
* Maneja el clic en el botón de regresar
|
|
552
|
+
*/
|
|
553
|
+
handleBack(): void;
|
|
532
554
|
/**
|
|
533
555
|
* Maneja la confirmación de un modal
|
|
534
556
|
* @param onConfirm Callback de confirmación
|
|
@@ -924,8 +946,8 @@ declare const AdTableColumnSchema: z.ZodObject<{
|
|
|
924
946
|
width: z.ZodOptional<z.ZodString>;
|
|
925
947
|
align: z.ZodOptional<z.ZodEnum<{
|
|
926
948
|
left: "left";
|
|
927
|
-
center: "center";
|
|
928
949
|
right: "right";
|
|
950
|
+
center: "center";
|
|
929
951
|
}>>;
|
|
930
952
|
pipe_to_apply: z.ZodOptional<z.ZodString>;
|
|
931
953
|
function_to_exec: z.ZodOptional<z.ZodString>;
|
|
@@ -939,8 +961,8 @@ declare const TableResourceSchema: z.ZodObject<{
|
|
|
939
961
|
width: z.ZodOptional<z.ZodString>;
|
|
940
962
|
align: z.ZodOptional<z.ZodEnum<{
|
|
941
963
|
left: "left";
|
|
942
|
-
center: "center";
|
|
943
964
|
right: "right";
|
|
965
|
+
center: "center";
|
|
944
966
|
}>>;
|
|
945
967
|
pipe_to_apply: z.ZodOptional<z.ZodString>;
|
|
946
968
|
function_to_exec: z.ZodOptional<z.ZodString>;
|
|
@@ -961,7 +983,7 @@ declare class AdTableComponent implements OnInit, OnDestroy {
|
|
|
961
983
|
key: string;
|
|
962
984
|
label: string;
|
|
963
985
|
width?: string | undefined;
|
|
964
|
-
align?: "left" | "
|
|
986
|
+
align?: "left" | "right" | "center" | undefined;
|
|
965
987
|
pipe_to_apply?: string | undefined;
|
|
966
988
|
function_to_exec?: string | undefined;
|
|
967
989
|
}[];
|
|
@@ -977,7 +999,7 @@ declare class AdTableComponent implements OnInit, OnDestroy {
|
|
|
977
999
|
key: string;
|
|
978
1000
|
label: string;
|
|
979
1001
|
width?: string | undefined;
|
|
980
|
-
align?: "left" | "
|
|
1002
|
+
align?: "left" | "right" | "center" | undefined;
|
|
981
1003
|
pipe_to_apply?: string | undefined;
|
|
982
1004
|
function_to_exec?: string | undefined;
|
|
983
1005
|
}[]>;
|
|
@@ -1344,5 +1366,5 @@ declare const ListPageTemplateResourceSchema: z.ZodObject<{
|
|
|
1344
1366
|
}, z.core.$strip>;
|
|
1345
1367
|
type ListPageTemplateResource = z.infer<typeof ListPageTemplateResourceSchema>;
|
|
1346
1368
|
|
|
1347
|
-
export { AdAdminLayoutComponent, AdAuthLayoutComponent, AdBadgeComponent, AdButtonComponent, AdCardComponent, AdDashboardTemplateComponent, AdDataTableComponent, AdDescriptionHeaderComponent, AdDocViewerComponent, AdDocumentationWrapperComponent, AdFormFieldComponent, AdFormLayoutComponent, AdFormPageTemplateComponent, AdFormSectionComponent, AdHeaderComponent, AdIconComponent, AdInputComponent, AdLabelComponent, AdListPageTemplateComponent, AdLoadingComponent, AdLoginComponent, AdModalComponent, AdModalService, AdModalTriggerComponent, AdModalWrapperComponent, AdSearchBarComponent, AdSelectComponent, AdSidebarComponent, AdStatCardComponent, AdSwitchComponent, AdTableColumnSchema, AdTableComponent, AdminLayoutResourceSchema, AdminSectionCardActionSchema, AdminSectionCardComponent, AdminSectionCardResourceSchema, AuthLayoutResourceSchema, CardResourceSchema, ComponentApiInputSchema, ComponentApiOutputSchema, ComponentVariantSchema, DashboardTemplateResourceSchema, DataTableColumnSchema, DataTableResourceSchema, DescriptionHeaderButtonSchema, DescriptionHeaderResourceSchema, DesignSystem, DocStatusSchema, DocViewerResourceSchema, DocumentationWrapperResourceSchema, FieldRendererRegistry,
|
|
1369
|
+
export { AdAdminLayoutComponent, AdAuthLayoutComponent, AdBadgeComponent, AdButtonComponent, AdCardComponent, AdDashboardTemplateComponent, AdDataTableComponent, AdDescriptionHeaderComponent, AdDocViewerComponent, AdDocumentationWrapperComponent, AdFormEngineComponent, AdFormFieldComponent, AdFormLayoutComponent, AdFormPageTemplateComponent, AdFormSectionComponent, AdHeaderComponent, AdIconComponent, AdInputComponent, AdLabelComponent, AdListPageTemplateComponent, AdLoadingComponent, AdLoginComponent, AdModalComponent, AdModalService, AdModalTriggerComponent, AdModalWrapperComponent, AdSearchBarComponent, AdSelectComponent, AdSidebarComponent, AdStatCardComponent, AdSwitchComponent, AdTableColumnSchema, AdTableComponent, AdminLayoutResourceSchema, AdminSectionCardActionSchema, AdminSectionCardComponent, AdminSectionCardResourceSchema, AuthLayoutResourceSchema, CardResourceSchema, ComponentApiInputSchema, ComponentApiOutputSchema, ComponentVariantSchema, DashboardTemplateResourceSchema, DataTableColumnSchema, DataTableResourceSchema, DescriptionHeaderButtonSchema, DescriptionHeaderResourceSchema, DesignSystem, DocStatusSchema, DocViewerResourceSchema, DocumentationWrapperResourceSchema, FieldRendererRegistry, FormEngineService, FormFieldResourceSchema, FormLayoutResourceSchema, FormPageTemplateResourceSchema, FormSectionResourceSchema, HeaderResourceSchema, ListPageTemplateResourceSchema, LoginResourceSchema, ModalResourceSchema, ModalTriggerResourceSchema, NavItemSchema, STAT_CARD_COLOR_MAP, SearchBarResourceSchema, SidebarResourceSchema, StatCardColorSchema, StatCardResourceSchema, TableEngineComponent, TableResourceSchema, UserSchema, ValidatorRegistry };
|
|
1348
1370
|
export type { AdTableColumn, AdminLayoutResource, AdminSectionCardAction, AdminSectionCardResource, AuthLayoutResource, BadgeType, BadgeVariant, BaseSchema, CardResource, ColumnType, ComponentApiInput, ComponentApiOutput, ComponentVariant, DashboardTemplateResource, DataTableColumn, DataTableResource, DescriptionHeaderButton, DescriptionHeaderResource, DocStatus, DocTab, DocViewerResource, DocumentationWrapperResource, FieldOption, FieldSchema, FieldType, FormFieldResource, FormLayoutResource, FormPageTemplateResource, FormSchema, FormSectionResource, HeaderResource, LayoutSchema, LayoutType, ListPageTemplateResource, LoginResource, ModalResource, ModalTriggerResource, NavItem, ResourceType, ScreenResource, SearchBarResource, SectionSchema, SelectOption, SidebarResource, StatCardColor, StatCardResource, SwitchOption, TableAction, TableColumn, TableResource, TableSchema, User };
|