@hichchi/ngx-ui 0.0.1-alpha.0
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/hichchi-ngx-ui.mjs +231 -0
- package/fesm2022/hichchi-ngx-ui.mjs.map +1 -0
- package/index.d.ts +1 -0
- package/lib/components/button/button.component.d.ts +93 -0
- package/lib/components/hc-card/hc-card.component.d.ts +53 -0
- package/lib/components/hc-separator/hc-separator.component.d.ts +66 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/types.d.ts +2 -0
- package/package.json +32 -0
- package/styles/_mixins.scss +34 -0
- package/styles/_variables.scss +126 -0
- package/styles/index.scss +5 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, Component } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Reusable button component for the Hichchi UI library
|
|
6
|
+
*
|
|
7
|
+
* This component provides a customizable button with consistent styling and behavior
|
|
8
|
+
* across the application. It supports different colors, types, and custom CSS classes
|
|
9
|
+
* while maintaining accessibility and user experience standards.
|
|
10
|
+
*
|
|
11
|
+
* The component uses Angular's new signal-based inputs and outputs for better
|
|
12
|
+
* performance and reactivity.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```html
|
|
16
|
+
* <!-- Basic button -->
|
|
17
|
+
* <hc-button>Click me</hc-button>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```html
|
|
22
|
+
* <!-- Button with custom color and type -->
|
|
23
|
+
* <hc-button
|
|
24
|
+
* [color]="'secondary'"
|
|
25
|
+
* [type]="'button'"
|
|
26
|
+
* (onClick)="handleClick($event)">
|
|
27
|
+
* Submit Form
|
|
28
|
+
* </hc-button>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```html
|
|
33
|
+
* <!-- Button with custom CSS classes -->
|
|
34
|
+
* <hc-button
|
|
35
|
+
* [class]="'my-custom-class another-class'"
|
|
36
|
+
* [color]="'danger'">
|
|
37
|
+
* Delete Item
|
|
38
|
+
* </hc-button>
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @see {@link HcColor} Type defining available color options
|
|
42
|
+
* @see {@link ButtonType} Type defining available button types
|
|
43
|
+
*/
|
|
44
|
+
class ButtonComponent {
|
|
45
|
+
/**
|
|
46
|
+
* The color theme of the button
|
|
47
|
+
*
|
|
48
|
+
* Determines the visual appearance of the button based on predefined color schemes.
|
|
49
|
+
* Each color represents a different semantic meaning (primary for main actions,
|
|
50
|
+
* secondary for alternative actions, danger for destructive actions, etc.).
|
|
51
|
+
*
|
|
52
|
+
* @default "primary"
|
|
53
|
+
*/
|
|
54
|
+
color = input("primary");
|
|
55
|
+
/**
|
|
56
|
+
* Additional CSS classes to apply to the button
|
|
57
|
+
*
|
|
58
|
+
* Allows for custom styling by adding extra CSS classes to the button element.
|
|
59
|
+
* Multiple classes can be specified as a space-separated string.
|
|
60
|
+
*
|
|
61
|
+
* @default ""
|
|
62
|
+
*/
|
|
63
|
+
class = input("");
|
|
64
|
+
/**
|
|
65
|
+
* The HTML button type attribute
|
|
66
|
+
*
|
|
67
|
+
* Specifies the behavior of the button when used within forms.
|
|
68
|
+
* - "submit": Submits the form (default)
|
|
69
|
+
* - "button": Regular button with no default behavior
|
|
70
|
+
* - "reset": Resets the form to its initial state
|
|
71
|
+
*
|
|
72
|
+
* @default "submit"
|
|
73
|
+
*/
|
|
74
|
+
type = input("submit");
|
|
75
|
+
/**
|
|
76
|
+
* Event emitted when the button is clicked
|
|
77
|
+
*
|
|
78
|
+
* Emits the native MouseEvent when the user clicks the button, allowing
|
|
79
|
+
* parent components to handle the click interaction. The event contains
|
|
80
|
+
* information about the click such as coordinates, modifier keys, etc.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* handleButtonClick(event: MouseEvent) {
|
|
85
|
+
* console.log('Button clicked at:', event.clientX, event.clientY);
|
|
86
|
+
* // Handle the click event
|
|
87
|
+
* }
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
// eslint-disable-next-line @angular-eslint/no-output-on-prefix
|
|
91
|
+
onClick = output();
|
|
92
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
93
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.7", type: ButtonComponent, isStandalone: true, selector: "hc-button", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onClick: "onClick" }, ngImport: i0, template: "<button [type]=\"type()\" class=\"btn hc-button hc-button-{{ color() }} {{ class() }}\" (click)=\"onClick.emit($event)\">\n <ng-content></ng-content>\n</button>\n", styles: [":root{--primary-color: #3b82f6;--primary-hover-color: #2563eb;--primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);--primary-border-color: #2563eb;--secondary-color: #8b5cf6;--secondary-hover-color: #7c3aed;--secondary-gradient: linear-gradient(135deg, #667eea 0%, #6d28d9 100%);--secondary-border-color: #7c3aed;--success-color: #10b981;--success-hover-color: #059669;--success-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);--success-border-color: #059669;--warning-color: #f59e0b;--warning-hover-color: #d97706;--warning-gradient: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);--warning-border-color: #d97706;--danger-color: #ef4444;--danger-hover-color: #dc2626;--danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);--danger-border-color: #dc2626;--info-color: #06b6d4;--info-hover-color: #0891b2;--info-gradient: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%);--info-border-color: #0891b2;--light-color: #f8fafc;--light-hover-color: #e2e8f0;--light-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);--light-border-color: #cbd5e1;--dark-color: #1e293b;--dark-hover-color: #0f172a;--dark-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);--dark-border-color: #334155;--text-color: #2d3748;--text-light: #718096;--bg-light: #ffffff;--border-color: #e2e8f0;--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06);--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04)}.hc-button{transition:all .3s ease;border:none;position:relative;overflow:hidden;box-shadow:var(--shadow-md);border-radius:12px}.hc-button.btn-lg{font-size:1rem!important;font-weight:600;padding:.75rem 1.5rem}.hc-button:before{content:\"\";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.2),transparent);transition:left .5s}.hc-button:hover{box-shadow:var(--shadow-lg)}.hc-button:hover:before{left:100%}.hc-button-primary{background:var(--primary-gradient);color:#fff}.hc-button-primary:hover,.hc-button-primary:active{color:#fff}.hc-button-secondary{background:var(--secondary-gradient);color:#fff}.hc-button-secondary:hover,.hc-button-secondary:active{color:#fff}.hc-button-success{background:var(--success-gradient);color:#fff}.hc-button-success:hover,.hc-button-success:active{color:#fff}.hc-button-warning{background:var(--warning-gradient);color:#fff}.hc-button-warning:hover,.hc-button-warning:active{color:#fff}.hc-button-danger{background:var(--danger-gradient);color:#fff}.hc-button-danger:hover,.hc-button-danger:active{color:#fff}.hc-button-info{background:var(--info-gradient);color:#fff}.hc-button-info:hover,.hc-button-info:active{color:#fff}.hc-button-light{background:var(--light-gradient);color:var(--text-color)}.hc-button-light:hover,.hc-button-light:active{color:var(--text-color)}.hc-button-dark{background:var(--dark-gradient);color:#fff}.hc-button-dark:hover,.hc-button-dark:active{color:#fff}.hc-button-white{background-color:#fff;border:1px solid var(--border-color);color:var(--text-color)}.hc-button-white:hover,.hc-button-white:active{color:var(--text-color)}\n"] });
|
|
94
|
+
}
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
96
|
+
type: Component,
|
|
97
|
+
args: [{ selector: "hc-button", imports: [], template: "<button [type]=\"type()\" class=\"btn hc-button hc-button-{{ color() }} {{ class() }}\" (click)=\"onClick.emit($event)\">\n <ng-content></ng-content>\n</button>\n", styles: [":root{--primary-color: #3b82f6;--primary-hover-color: #2563eb;--primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);--primary-border-color: #2563eb;--secondary-color: #8b5cf6;--secondary-hover-color: #7c3aed;--secondary-gradient: linear-gradient(135deg, #667eea 0%, #6d28d9 100%);--secondary-border-color: #7c3aed;--success-color: #10b981;--success-hover-color: #059669;--success-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);--success-border-color: #059669;--warning-color: #f59e0b;--warning-hover-color: #d97706;--warning-gradient: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);--warning-border-color: #d97706;--danger-color: #ef4444;--danger-hover-color: #dc2626;--danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);--danger-border-color: #dc2626;--info-color: #06b6d4;--info-hover-color: #0891b2;--info-gradient: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%);--info-border-color: #0891b2;--light-color: #f8fafc;--light-hover-color: #e2e8f0;--light-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);--light-border-color: #cbd5e1;--dark-color: #1e293b;--dark-hover-color: #0f172a;--dark-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);--dark-border-color: #334155;--text-color: #2d3748;--text-light: #718096;--bg-light: #ffffff;--border-color: #e2e8f0;--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06);--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04)}.hc-button{transition:all .3s ease;border:none;position:relative;overflow:hidden;box-shadow:var(--shadow-md);border-radius:12px}.hc-button.btn-lg{font-size:1rem!important;font-weight:600;padding:.75rem 1.5rem}.hc-button:before{content:\"\";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.2),transparent);transition:left .5s}.hc-button:hover{box-shadow:var(--shadow-lg)}.hc-button:hover:before{left:100%}.hc-button-primary{background:var(--primary-gradient);color:#fff}.hc-button-primary:hover,.hc-button-primary:active{color:#fff}.hc-button-secondary{background:var(--secondary-gradient);color:#fff}.hc-button-secondary:hover,.hc-button-secondary:active{color:#fff}.hc-button-success{background:var(--success-gradient);color:#fff}.hc-button-success:hover,.hc-button-success:active{color:#fff}.hc-button-warning{background:var(--warning-gradient);color:#fff}.hc-button-warning:hover,.hc-button-warning:active{color:#fff}.hc-button-danger{background:var(--danger-gradient);color:#fff}.hc-button-danger:hover,.hc-button-danger:active{color:#fff}.hc-button-info{background:var(--info-gradient);color:#fff}.hc-button-info:hover,.hc-button-info:active{color:#fff}.hc-button-light{background:var(--light-gradient);color:var(--text-color)}.hc-button-light:hover,.hc-button-light:active{color:var(--text-color)}.hc-button-dark{background:var(--dark-gradient);color:#fff}.hc-button-dark:hover,.hc-button-dark:active{color:#fff}.hc-button-white{background-color:#fff;border:1px solid var(--border-color);color:var(--text-color)}.hc-button-white:hover,.hc-button-white:active{color:var(--text-color)}\n"] }]
|
|
98
|
+
}] });
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Reusable card component for the Hichchi UI library
|
|
102
|
+
*
|
|
103
|
+
* This component provides a container with consistent card styling that can be used
|
|
104
|
+
* to group related content together. Cards are commonly used for displaying information
|
|
105
|
+
* in a structured, visually appealing way with proper spacing, borders, and shadows.
|
|
106
|
+
*
|
|
107
|
+
* The component acts as a content wrapper and uses Angular's content projection
|
|
108
|
+
* to display any content passed between the opening and closing tags.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```html
|
|
112
|
+
* <!-- Basic card -->
|
|
113
|
+
* <hc-card>
|
|
114
|
+
* <h3>Card Title</h3>
|
|
115
|
+
* <p>This is some card content.</p>
|
|
116
|
+
* </hc-card>
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```html
|
|
121
|
+
* <!-- Card with form content -->
|
|
122
|
+
* <hc-card>
|
|
123
|
+
* <form>
|
|
124
|
+
* <input type="text" placeholder="Enter your name">
|
|
125
|
+
* <hc-button type="submit">Submit</hc-button>
|
|
126
|
+
* </form>
|
|
127
|
+
* </hc-card>
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```html
|
|
132
|
+
* <!-- Card with mixed content -->
|
|
133
|
+
* <hc-card>
|
|
134
|
+
* <div class="card-header">
|
|
135
|
+
* <h2>User Profile</h2>
|
|
136
|
+
* </div>
|
|
137
|
+
* <div class="card-body">
|
|
138
|
+
* <p>User information goes here...</p>
|
|
139
|
+
* </div>
|
|
140
|
+
* <div class="card-footer">
|
|
141
|
+
* <hc-button>Edit Profile</hc-button>
|
|
142
|
+
* </div>
|
|
143
|
+
* </hc-card>
|
|
144
|
+
* ```
|
|
145
|
+
*
|
|
146
|
+
* @see {@link ButtonComponent} Related button component often used within cards
|
|
147
|
+
*/
|
|
148
|
+
class HcCardComponent {
|
|
149
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: HcCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
150
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.7", type: HcCardComponent, isStandalone: true, selector: "hc-card", ngImport: i0, template: "<div class=\"hc-card d-flex justify-content-center align-items-center\">\n <div class=\"hc-card-content\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":root{--primary-color: #3b82f6;--primary-hover-color: #2563eb;--primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);--primary-border-color: #2563eb;--secondary-color: #8b5cf6;--secondary-hover-color: #7c3aed;--secondary-gradient: linear-gradient(135deg, #667eea 0%, #6d28d9 100%);--secondary-border-color: #7c3aed;--success-color: #10b981;--success-hover-color: #059669;--success-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);--success-border-color: #059669;--warning-color: #f59e0b;--warning-hover-color: #d97706;--warning-gradient: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);--warning-border-color: #d97706;--danger-color: #ef4444;--danger-hover-color: #dc2626;--danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);--danger-border-color: #dc2626;--info-color: #06b6d4;--info-hover-color: #0891b2;--info-gradient: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%);--info-border-color: #0891b2;--light-color: #f8fafc;--light-hover-color: #e2e8f0;--light-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);--light-border-color: #cbd5e1;--dark-color: #1e293b;--dark-hover-color: #0f172a;--dark-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);--dark-border-color: #334155;--text-color: #2d3748;--text-light: #718096;--bg-light: #ffffff;--border-color: #e2e8f0;--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06);--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04)}:host{display:block;background:var(--secondary-gradient);border-radius:20px;box-shadow:var(--shadow-xl);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.2);position:relative;overflow:hidden;transition:all .3s ease;width:400px}:host:before{content:\"\";position:absolute;inset:0;background:linear-gradient(135deg,#ffffff1a,#ffffff0d);pointer-events:none}:host:hover{box-shadow:0 25px 50px -12px #00000040}:host .hc-card-content{background-color:var(--bg-light);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:16px;margin:8px;padding:2rem;position:relative;z-index:1;width:100%}\n"] });
|
|
151
|
+
}
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: HcCardComponent, decorators: [{
|
|
153
|
+
type: Component,
|
|
154
|
+
args: [{ selector: "hc-card", imports: [], template: "<div class=\"hc-card d-flex justify-content-center align-items-center\">\n <div class=\"hc-card-content\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":root{--primary-color: #3b82f6;--primary-hover-color: #2563eb;--primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);--primary-border-color: #2563eb;--secondary-color: #8b5cf6;--secondary-hover-color: #7c3aed;--secondary-gradient: linear-gradient(135deg, #667eea 0%, #6d28d9 100%);--secondary-border-color: #7c3aed;--success-color: #10b981;--success-hover-color: #059669;--success-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);--success-border-color: #059669;--warning-color: #f59e0b;--warning-hover-color: #d97706;--warning-gradient: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);--warning-border-color: #d97706;--danger-color: #ef4444;--danger-hover-color: #dc2626;--danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);--danger-border-color: #dc2626;--info-color: #06b6d4;--info-hover-color: #0891b2;--info-gradient: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%);--info-border-color: #0891b2;--light-color: #f8fafc;--light-hover-color: #e2e8f0;--light-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);--light-border-color: #cbd5e1;--dark-color: #1e293b;--dark-hover-color: #0f172a;--dark-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);--dark-border-color: #334155;--text-color: #2d3748;--text-light: #718096;--bg-light: #ffffff;--border-color: #e2e8f0;--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06);--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04)}:host{display:block;background:var(--secondary-gradient);border-radius:20px;box-shadow:var(--shadow-xl);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.2);position:relative;overflow:hidden;transition:all .3s ease;width:400px}:host:before{content:\"\";position:absolute;inset:0;background:linear-gradient(135deg,#ffffff1a,#ffffff0d);pointer-events:none}:host:hover{box-shadow:0 25px 50px -12px #00000040}:host .hc-card-content{background-color:var(--bg-light);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border-radius:16px;margin:8px;padding:2rem;position:relative;z-index:1;width:100%}\n"] }]
|
|
155
|
+
}] });
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Reusable separator component for the Hichchi UI library
|
|
159
|
+
*
|
|
160
|
+
* This component provides a visual separator element that can be used to divide
|
|
161
|
+
* content sections within a page or form. It supports an optional label that can
|
|
162
|
+
* be displayed within or alongside the separator line.
|
|
163
|
+
*
|
|
164
|
+
* Separators are useful for creating visual breaks between different sections of
|
|
165
|
+
* content, improving readability and organization of the user interface.
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```html
|
|
169
|
+
* <!-- Basic separator without label -->
|
|
170
|
+
* <hc-separator></hc-separator>
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```html
|
|
175
|
+
* <!-- Separator with label -->
|
|
176
|
+
* <hc-separator [label]="'Personal Information'"></hc-separator>
|
|
177
|
+
* ```
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```html
|
|
181
|
+
* <!-- Using separator in a form -->
|
|
182
|
+
* <form>
|
|
183
|
+
* <input type="text" placeholder="First Name">
|
|
184
|
+
* <input type="text" placeholder="Last Name">
|
|
185
|
+
*
|
|
186
|
+
* <hc-separator [label]="'Contact Details'"></hc-separator>
|
|
187
|
+
*
|
|
188
|
+
* <input type="email" placeholder="Email">
|
|
189
|
+
* <input type="tel" placeholder="Phone">
|
|
190
|
+
* </form>
|
|
191
|
+
* ```
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```html
|
|
195
|
+
* <!-- Using separator between content sections -->
|
|
196
|
+
* <div>
|
|
197
|
+
* <h2>Section 1</h2>
|
|
198
|
+
* <p>Content for section 1...</p>
|
|
199
|
+
*
|
|
200
|
+
* <hc-separator [label]="'OR'"></hc-separator>
|
|
201
|
+
*
|
|
202
|
+
* <h2>Section 2</h2>
|
|
203
|
+
* <p>Content for section 2...</p>
|
|
204
|
+
* </div>
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
class HcSeparatorComponent {
|
|
208
|
+
/**
|
|
209
|
+
* Optional label text to display with the separator
|
|
210
|
+
*
|
|
211
|
+
* When provided, this text will be displayed as part of the separator,
|
|
212
|
+
* typically centered within or alongside the separator line. This is useful
|
|
213
|
+
* for creating labeled dividers that help organize content sections.
|
|
214
|
+
*
|
|
215
|
+
* @default ""
|
|
216
|
+
*/
|
|
217
|
+
label = input("");
|
|
218
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: HcSeparatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
219
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.7", type: HcSeparatorComponent, isStandalone: true, selector: "hc-separator", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<span>{{ label() }}</span>\n", styles: [":root{--primary-color: #3b82f6;--primary-hover-color: #2563eb;--primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);--primary-border-color: #2563eb;--secondary-color: #8b5cf6;--secondary-hover-color: #7c3aed;--secondary-gradient: linear-gradient(135deg, #667eea 0%, #6d28d9 100%);--secondary-border-color: #7c3aed;--success-color: #10b981;--success-hover-color: #059669;--success-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);--success-border-color: #059669;--warning-color: #f59e0b;--warning-hover-color: #d97706;--warning-gradient: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);--warning-border-color: #d97706;--danger-color: #ef4444;--danger-hover-color: #dc2626;--danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);--danger-border-color: #dc2626;--info-color: #06b6d4;--info-hover-color: #0891b2;--info-gradient: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%);--info-border-color: #0891b2;--light-color: #f8fafc;--light-hover-color: #e2e8f0;--light-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);--light-border-color: #cbd5e1;--dark-color: #1e293b;--dark-hover-color: #0f172a;--dark-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);--dark-border-color: #334155;--text-color: #2d3748;--text-light: #718096;--bg-light: #ffffff;--border-color: #e2e8f0;--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06);--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04)}:host{display:block;position:relative;width:calc(100% - 40px);height:1px;background:linear-gradient(90deg,transparent,var(--border-color),transparent);margin:1.5rem auto}:host span{content:\"OR\";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:#ffffffe6;padding:0 1rem;font-size:.8rem;font-weight:600;color:var(--text-light);letter-spacing:1px}\n"] });
|
|
220
|
+
}
|
|
221
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.7", ngImport: i0, type: HcSeparatorComponent, decorators: [{
|
|
222
|
+
type: Component,
|
|
223
|
+
args: [{ selector: "hc-separator", imports: [], template: "<span>{{ label() }}</span>\n", styles: [":root{--primary-color: #3b82f6;--primary-hover-color: #2563eb;--primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);--primary-border-color: #2563eb;--secondary-color: #8b5cf6;--secondary-hover-color: #7c3aed;--secondary-gradient: linear-gradient(135deg, #667eea 0%, #6d28d9 100%);--secondary-border-color: #7c3aed;--success-color: #10b981;--success-hover-color: #059669;--success-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);--success-border-color: #059669;--warning-color: #f59e0b;--warning-hover-color: #d97706;--warning-gradient: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);--warning-border-color: #d97706;--danger-color: #ef4444;--danger-hover-color: #dc2626;--danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);--danger-border-color: #dc2626;--info-color: #06b6d4;--info-hover-color: #0891b2;--info-gradient: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%);--info-border-color: #0891b2;--light-color: #f8fafc;--light-hover-color: #e2e8f0;--light-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);--light-border-color: #cbd5e1;--dark-color: #1e293b;--dark-hover-color: #0f172a;--dark-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);--dark-border-color: #334155;--text-color: #2d3748;--text-light: #718096;--bg-light: #ffffff;--border-color: #e2e8f0;--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06);--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04)}:host{display:block;position:relative;width:calc(100% - 40px);height:1px;background:linear-gradient(90deg,transparent,var(--border-color),transparent);margin:1.5rem auto}:host span{content:\"OR\";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:#ffffffe6;padding:0 1rem;font-size:.8rem;font-weight:600;color:var(--text-light);letter-spacing:1px}\n"] }]
|
|
224
|
+
}] });
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Generated bundle index. Do not edit.
|
|
228
|
+
*/
|
|
229
|
+
|
|
230
|
+
export { ButtonComponent, HcCardComponent, HcSeparatorComponent };
|
|
231
|
+
//# sourceMappingURL=hichchi-ngx-ui.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hichchi-ngx-ui.mjs","sources":["../../../../libs/ngx-ui/src/lib/components/button/button.component.ts","../../../../libs/ngx-ui/src/lib/components/button/button.component.html","../../../../libs/ngx-ui/src/lib/components/hc-card/hc-card.component.ts","../../../../libs/ngx-ui/src/lib/components/hc-card/hc-card.component.html","../../../../libs/ngx-ui/src/lib/components/hc-separator/hc-separator.component.ts","../../../../libs/ngx-ui/src/lib/components/hc-separator/hc-separator.component.html","../../../../libs/ngx-ui/src/hichchi-ngx-ui.ts"],"sourcesContent":["import { Component, input, InputSignal, output, OutputEmitterRef } from \"@angular/core\";\r\nimport { ButtonType, HcColor } from \"../../types\";\r\n\r\n/**\r\n * Reusable button component for the Hichchi UI library\r\n *\r\n * This component provides a customizable button with consistent styling and behavior\r\n * across the application. It supports different colors, types, and custom CSS classes\r\n * while maintaining accessibility and user experience standards.\r\n *\r\n * The component uses Angular's new signal-based inputs and outputs for better\r\n * performance and reactivity.\r\n *\r\n * @example\r\n * ```html\r\n * <!-- Basic button -->\r\n * <hc-button>Click me</hc-button>\r\n * ```\r\n *\r\n * @example\r\n * ```html\r\n * <!-- Button with custom color and type -->\r\n * <hc-button\r\n * [color]=\"'secondary'\"\r\n * [type]=\"'button'\"\r\n * (onClick)=\"handleClick($event)\">\r\n * Submit Form\r\n * </hc-button>\r\n * ```\r\n *\r\n * @example\r\n * ```html\r\n * <!-- Button with custom CSS classes -->\r\n * <hc-button\r\n * [class]=\"'my-custom-class another-class'\"\r\n * [color]=\"'danger'\">\r\n * Delete Item\r\n * </hc-button>\r\n * ```\r\n *\r\n * @see {@link HcColor} Type defining available color options\r\n * @see {@link ButtonType} Type defining available button types\r\n */\r\n@Component({\r\n selector: \"hc-button\",\r\n imports: [],\r\n templateUrl: \"./button.component.html\",\r\n styleUrl: \"./button.component.scss\",\r\n})\r\nexport class ButtonComponent {\r\n /**\r\n * The color theme of the button\r\n *\r\n * Determines the visual appearance of the button based on predefined color schemes.\r\n * Each color represents a different semantic meaning (primary for main actions,\r\n * secondary for alternative actions, danger for destructive actions, etc.).\r\n *\r\n * @default \"primary\"\r\n */\r\n color: InputSignal<HcColor> = input<HcColor>(\"primary\");\r\n\r\n /**\r\n * Additional CSS classes to apply to the button\r\n *\r\n * Allows for custom styling by adding extra CSS classes to the button element.\r\n * Multiple classes can be specified as a space-separated string.\r\n *\r\n * @default \"\"\r\n */\r\n class: InputSignal<string> = input<string>(\"\");\r\n\r\n /**\r\n * The HTML button type attribute\r\n *\r\n * Specifies the behavior of the button when used within forms.\r\n * - \"submit\": Submits the form (default)\r\n * - \"button\": Regular button with no default behavior\r\n * - \"reset\": Resets the form to its initial state\r\n *\r\n * @default \"submit\"\r\n */\r\n type: InputSignal<ButtonType> = input<ButtonType>(\"submit\");\r\n\r\n /**\r\n * Event emitted when the button is clicked\r\n *\r\n * Emits the native MouseEvent when the user clicks the button, allowing\r\n * parent components to handle the click interaction. The event contains\r\n * information about the click such as coordinates, modifier keys, etc.\r\n *\r\n * @example\r\n * ```typescript\r\n * handleButtonClick(event: MouseEvent) {\r\n * console.log('Button clicked at:', event.clientX, event.clientY);\r\n * // Handle the click event\r\n * }\r\n * ```\r\n */\r\n // eslint-disable-next-line @angular-eslint/no-output-on-prefix\r\n onClick: OutputEmitterRef<MouseEvent> = output<MouseEvent>();\r\n}\r\n","<button [type]=\"type()\" class=\"btn hc-button hc-button-{{ color() }} {{ class() }}\" (click)=\"onClick.emit($event)\">\n <ng-content></ng-content>\n</button>\n","import { Component } from \"@angular/core\";\r\n\r\n/**\r\n * Reusable card component for the Hichchi UI library\r\n *\r\n * This component provides a container with consistent card styling that can be used\r\n * to group related content together. Cards are commonly used for displaying information\r\n * in a structured, visually appealing way with proper spacing, borders, and shadows.\r\n *\r\n * The component acts as a content wrapper and uses Angular's content projection\r\n * to display any content passed between the opening and closing tags.\r\n *\r\n * @example\r\n * ```html\r\n * <!-- Basic card -->\r\n * <hc-card>\r\n * <h3>Card Title</h3>\r\n * <p>This is some card content.</p>\r\n * </hc-card>\r\n * ```\r\n *\r\n * @example\r\n * ```html\r\n * <!-- Card with form content -->\r\n * <hc-card>\r\n * <form>\r\n * <input type=\"text\" placeholder=\"Enter your name\">\r\n * <hc-button type=\"submit\">Submit</hc-button>\r\n * </form>\r\n * </hc-card>\r\n * ```\r\n *\r\n * @example\r\n * ```html\r\n * <!-- Card with mixed content -->\r\n * <hc-card>\r\n * <div class=\"card-header\">\r\n * <h2>User Profile</h2>\r\n * </div>\r\n * <div class=\"card-body\">\r\n * <p>User information goes here...</p>\r\n * </div>\r\n * <div class=\"card-footer\">\r\n * <hc-button>Edit Profile</hc-button>\r\n * </div>\r\n * </hc-card>\r\n * ```\r\n *\r\n * @see {@link ButtonComponent} Related button component often used within cards\r\n */\r\n@Component({\r\n selector: \"hc-card\",\r\n imports: [],\r\n templateUrl: \"./hc-card.component.html\",\r\n styleUrl: \"./hc-card.component.scss\",\r\n})\r\nexport class HcCardComponent {}\r\n","<div class=\"hc-card d-flex justify-content-center align-items-center\">\n <div class=\"hc-card-content\">\n <ng-content></ng-content>\n </div>\n</div>\n","import { Component, input, InputSignal } from \"@angular/core\";\r\n\r\n/**\r\n * Reusable separator component for the Hichchi UI library\r\n *\r\n * This component provides a visual separator element that can be used to divide\r\n * content sections within a page or form. It supports an optional label that can\r\n * be displayed within or alongside the separator line.\r\n *\r\n * Separators are useful for creating visual breaks between different sections of\r\n * content, improving readability and organization of the user interface.\r\n *\r\n * @example\r\n * ```html\r\n * <!-- Basic separator without label -->\r\n * <hc-separator></hc-separator>\r\n * ```\r\n *\r\n * @example\r\n * ```html\r\n * <!-- Separator with label -->\r\n * <hc-separator [label]=\"'Personal Information'\"></hc-separator>\r\n * ```\r\n *\r\n * @example\r\n * ```html\r\n * <!-- Using separator in a form -->\r\n * <form>\r\n * <input type=\"text\" placeholder=\"First Name\">\r\n * <input type=\"text\" placeholder=\"Last Name\">\r\n *\r\n * <hc-separator [label]=\"'Contact Details'\"></hc-separator>\r\n *\r\n * <input type=\"email\" placeholder=\"Email\">\r\n * <input type=\"tel\" placeholder=\"Phone\">\r\n * </form>\r\n * ```\r\n *\r\n * @example\r\n * ```html\r\n * <!-- Using separator between content sections -->\r\n * <div>\r\n * <h2>Section 1</h2>\r\n * <p>Content for section 1...</p>\r\n *\r\n * <hc-separator [label]=\"'OR'\"></hc-separator>\r\n *\r\n * <h2>Section 2</h2>\r\n * <p>Content for section 2...</p>\r\n * </div>\r\n * ```\r\n */\r\n@Component({\r\n selector: \"hc-separator\",\r\n imports: [],\r\n templateUrl: \"./hc-separator.component.html\",\r\n styleUrl: \"./hc-separator.component.scss\",\r\n})\r\nexport class HcSeparatorComponent {\r\n /**\r\n * Optional label text to display with the separator\r\n *\r\n * When provided, this text will be displayed as part of the separator,\r\n * typically centered within or alongside the separator line. This is useful\r\n * for creating labeled dividers that help organize content sections.\r\n *\r\n * @default \"\"\r\n */\r\n label: InputSignal<string> = input<string>(\"\");\r\n}\r\n","<span>{{ label() }}</span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;MAOU,eAAe,CAAA;AACxB;;;;;;;;AAQG;AACH,IAAA,KAAK,GAAyB,KAAK,CAAU,SAAS,CAAC;AAEvD;;;;;;;AAOG;AACH,IAAA,KAAK,GAAwB,KAAK,CAAS,EAAE,CAAC;AAE9C;;;;;;;;;AASG;AACH,IAAA,IAAI,GAA4B,KAAK,CAAa,QAAQ,CAAC;AAE3D;;;;;;;;;;;;;;AAcG;;IAEH,OAAO,GAAiC,MAAM,EAAc;uGAlDnD,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,udCjD5B,uKAGA,EAAA,MAAA,EAAA,CAAA,uvGAAA,CAAA,EAAA,CAAA;;2FD8Ca,eAAe,EAAA,UAAA,EAAA,CAAA;kBAN3B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,WACZ,EAAE,EAAA,QAAA,EAAA,uKAAA,EAAA,MAAA,EAAA,CAAA,uvGAAA,CAAA,EAAA;;;AE3Cf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CG;MAOU,eAAe,CAAA;uGAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,mECxD5B,wKAKA,EAAA,MAAA,EAAA,CAAA,swEAAA,CAAA,EAAA,CAAA;;2FDmDa,eAAe,EAAA,UAAA,EAAA,CAAA;kBAN3B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,SAAS,WACV,EAAE,EAAA,QAAA,EAAA,wKAAA,EAAA,MAAA,EAAA,CAAA,swEAAA,CAAA,EAAA;;;AElDf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDG;MAOU,oBAAoB,CAAA;AAC7B;;;;;;;;AAQG;AACH,IAAA,KAAK,GAAwB,KAAK,CAAS,EAAE,CAAC;uGAVrC,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAApB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,oBAAoB,4MC1DjC,8BACA,EAAA,MAAA,EAAA,CAAA,++DAAA,CAAA,EAAA,CAAA;;2FDyDa,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBANhC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,cAAc,WACf,EAAE,EAAA,QAAA,EAAA,8BAAA,EAAA,MAAA,EAAA,CAAA,++DAAA,CAAA,EAAA;;;AEtDf;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./lib/components";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { InputSignal, OutputEmitterRef } from "@angular/core";
|
|
2
|
+
import { ButtonType, HcColor } from "../../types";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Reusable button component for the Hichchi UI library
|
|
6
|
+
*
|
|
7
|
+
* This component provides a customizable button with consistent styling and behavior
|
|
8
|
+
* across the application. It supports different colors, types, and custom CSS classes
|
|
9
|
+
* while maintaining accessibility and user experience standards.
|
|
10
|
+
*
|
|
11
|
+
* The component uses Angular's new signal-based inputs and outputs for better
|
|
12
|
+
* performance and reactivity.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```html
|
|
16
|
+
* <!-- Basic button -->
|
|
17
|
+
* <hc-button>Click me</hc-button>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```html
|
|
22
|
+
* <!-- Button with custom color and type -->
|
|
23
|
+
* <hc-button
|
|
24
|
+
* [color]="'secondary'"
|
|
25
|
+
* [type]="'button'"
|
|
26
|
+
* (onClick)="handleClick($event)">
|
|
27
|
+
* Submit Form
|
|
28
|
+
* </hc-button>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```html
|
|
33
|
+
* <!-- Button with custom CSS classes -->
|
|
34
|
+
* <hc-button
|
|
35
|
+
* [class]="'my-custom-class another-class'"
|
|
36
|
+
* [color]="'danger'">
|
|
37
|
+
* Delete Item
|
|
38
|
+
* </hc-button>
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @see {@link HcColor} Type defining available color options
|
|
42
|
+
* @see {@link ButtonType} Type defining available button types
|
|
43
|
+
*/
|
|
44
|
+
export declare class ButtonComponent {
|
|
45
|
+
/**
|
|
46
|
+
* The color theme of the button
|
|
47
|
+
*
|
|
48
|
+
* Determines the visual appearance of the button based on predefined color schemes.
|
|
49
|
+
* Each color represents a different semantic meaning (primary for main actions,
|
|
50
|
+
* secondary for alternative actions, danger for destructive actions, etc.).
|
|
51
|
+
*
|
|
52
|
+
* @default "primary"
|
|
53
|
+
*/
|
|
54
|
+
color: InputSignal<HcColor>;
|
|
55
|
+
/**
|
|
56
|
+
* Additional CSS classes to apply to the button
|
|
57
|
+
*
|
|
58
|
+
* Allows for custom styling by adding extra CSS classes to the button element.
|
|
59
|
+
* Multiple classes can be specified as a space-separated string.
|
|
60
|
+
*
|
|
61
|
+
* @default ""
|
|
62
|
+
*/
|
|
63
|
+
class: InputSignal<string>;
|
|
64
|
+
/**
|
|
65
|
+
* The HTML button type attribute
|
|
66
|
+
*
|
|
67
|
+
* Specifies the behavior of the button when used within forms.
|
|
68
|
+
* - "submit": Submits the form (default)
|
|
69
|
+
* - "button": Regular button with no default behavior
|
|
70
|
+
* - "reset": Resets the form to its initial state
|
|
71
|
+
*
|
|
72
|
+
* @default "submit"
|
|
73
|
+
*/
|
|
74
|
+
type: InputSignal<ButtonType>;
|
|
75
|
+
/**
|
|
76
|
+
* Event emitted when the button is clicked
|
|
77
|
+
*
|
|
78
|
+
* Emits the native MouseEvent when the user clicks the button, allowing
|
|
79
|
+
* parent components to handle the click interaction. The event contains
|
|
80
|
+
* information about the click such as coordinates, modifier keys, etc.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* handleButtonClick(event: MouseEvent) {
|
|
85
|
+
* console.log('Button clicked at:', event.clientX, event.clientY);
|
|
86
|
+
* // Handle the click event
|
|
87
|
+
* }
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
onClick: OutputEmitterRef<MouseEvent>;
|
|
91
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonComponent, never>;
|
|
92
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "hc-button", never, { "color": { "alias": "color"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, { "onClick": "onClick"; }, never, ["*"], true, never>;
|
|
93
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Reusable card component for the Hichchi UI library
|
|
4
|
+
*
|
|
5
|
+
* This component provides a container with consistent card styling that can be used
|
|
6
|
+
* to group related content together. Cards are commonly used for displaying information
|
|
7
|
+
* in a structured, visually appealing way with proper spacing, borders, and shadows.
|
|
8
|
+
*
|
|
9
|
+
* The component acts as a content wrapper and uses Angular's content projection
|
|
10
|
+
* to display any content passed between the opening and closing tags.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```html
|
|
14
|
+
* <!-- Basic card -->
|
|
15
|
+
* <hc-card>
|
|
16
|
+
* <h3>Card Title</h3>
|
|
17
|
+
* <p>This is some card content.</p>
|
|
18
|
+
* </hc-card>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```html
|
|
23
|
+
* <!-- Card with form content -->
|
|
24
|
+
* <hc-card>
|
|
25
|
+
* <form>
|
|
26
|
+
* <input type="text" placeholder="Enter your name">
|
|
27
|
+
* <hc-button type="submit">Submit</hc-button>
|
|
28
|
+
* </form>
|
|
29
|
+
* </hc-card>
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```html
|
|
34
|
+
* <!-- Card with mixed content -->
|
|
35
|
+
* <hc-card>
|
|
36
|
+
* <div class="card-header">
|
|
37
|
+
* <h2>User Profile</h2>
|
|
38
|
+
* </div>
|
|
39
|
+
* <div class="card-body">
|
|
40
|
+
* <p>User information goes here...</p>
|
|
41
|
+
* </div>
|
|
42
|
+
* <div class="card-footer">
|
|
43
|
+
* <hc-button>Edit Profile</hc-button>
|
|
44
|
+
* </div>
|
|
45
|
+
* </hc-card>
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @see {@link ButtonComponent} Related button component often used within cards
|
|
49
|
+
*/
|
|
50
|
+
export declare class HcCardComponent {
|
|
51
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HcCardComponent, never>;
|
|
52
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HcCardComponent, "hc-card", never, {}, {}, never, ["*"], true, never>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { InputSignal } from "@angular/core";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Reusable separator component for the Hichchi UI library
|
|
5
|
+
*
|
|
6
|
+
* This component provides a visual separator element that can be used to divide
|
|
7
|
+
* content sections within a page or form. It supports an optional label that can
|
|
8
|
+
* be displayed within or alongside the separator line.
|
|
9
|
+
*
|
|
10
|
+
* Separators are useful for creating visual breaks between different sections of
|
|
11
|
+
* content, improving readability and organization of the user interface.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```html
|
|
15
|
+
* <!-- Basic separator without label -->
|
|
16
|
+
* <hc-separator></hc-separator>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```html
|
|
21
|
+
* <!-- Separator with label -->
|
|
22
|
+
* <hc-separator [label]="'Personal Information'"></hc-separator>
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```html
|
|
27
|
+
* <!-- Using separator in a form -->
|
|
28
|
+
* <form>
|
|
29
|
+
* <input type="text" placeholder="First Name">
|
|
30
|
+
* <input type="text" placeholder="Last Name">
|
|
31
|
+
*
|
|
32
|
+
* <hc-separator [label]="'Contact Details'"></hc-separator>
|
|
33
|
+
*
|
|
34
|
+
* <input type="email" placeholder="Email">
|
|
35
|
+
* <input type="tel" placeholder="Phone">
|
|
36
|
+
* </form>
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```html
|
|
41
|
+
* <!-- Using separator between content sections -->
|
|
42
|
+
* <div>
|
|
43
|
+
* <h2>Section 1</h2>
|
|
44
|
+
* <p>Content for section 1...</p>
|
|
45
|
+
*
|
|
46
|
+
* <hc-separator [label]="'OR'"></hc-separator>
|
|
47
|
+
*
|
|
48
|
+
* <h2>Section 2</h2>
|
|
49
|
+
* <p>Content for section 2...</p>
|
|
50
|
+
* </div>
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare class HcSeparatorComponent {
|
|
54
|
+
/**
|
|
55
|
+
* Optional label text to display with the separator
|
|
56
|
+
*
|
|
57
|
+
* When provided, this text will be displayed as part of the separator,
|
|
58
|
+
* typically centered within or alongside the separator line. This is useful
|
|
59
|
+
* for creating labeled dividers that help organize content sections.
|
|
60
|
+
*
|
|
61
|
+
* @default ""
|
|
62
|
+
*/
|
|
63
|
+
label: InputSignal<string>;
|
|
64
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HcSeparatorComponent, never>;
|
|
65
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HcSeparatorComponent, "hc-separator", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
66
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./types";
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hichchi/ngx-ui",
|
|
3
|
+
"version": "0.0.1-alpha.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/hichchidev/hichchi.git"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [],
|
|
12
|
+
"author": "Waruna Udayanga",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@angular/core": "^19.0.0"
|
|
17
|
+
},
|
|
18
|
+
"module": "fesm2022/hichchi-ngx-ui.mjs",
|
|
19
|
+
"typings": "index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
"./package.json": {
|
|
22
|
+
"default": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./index.d.ts",
|
|
26
|
+
"default": "./fesm2022/hichchi-ngx-ui.mjs"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"tslib": "^2.3.0"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@use "variables" as vars;
|
|
2
|
+
|
|
3
|
+
@mixin hc-button-variant($color-type) {
|
|
4
|
+
$text-color: white;
|
|
5
|
+
|
|
6
|
+
@if $color-type == 'light' or $color-type == 'white' {
|
|
7
|
+
$text-color: vars.$text-color;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@if $color-type == 'white' {
|
|
11
|
+
background-color: white;
|
|
12
|
+
border: 1px solid vars.$border-color;
|
|
13
|
+
} @else {
|
|
14
|
+
background: var(--#{$color-type}-gradient);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
color: $text-color;
|
|
18
|
+
|
|
19
|
+
&:hover {
|
|
20
|
+
color: $text-color;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:active {
|
|
24
|
+
color: $text-color;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@mixin generate-button-variants {
|
|
29
|
+
@each $type in vars.$color-types {
|
|
30
|
+
.hc-button-#{$type} {
|
|
31
|
+
@include hc-button-variant($type);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--primary-color: #3b82f6;
|
|
3
|
+
--primary-hover-color: #2563eb;
|
|
4
|
+
--primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
|
|
5
|
+
--primary-border-color: #2563eb;
|
|
6
|
+
|
|
7
|
+
--secondary-color: #8b5cf6;
|
|
8
|
+
--secondary-hover-color: #7c3aed;
|
|
9
|
+
--secondary-gradient: linear-gradient(135deg, #667eea 0%, #6d28d9 100%);
|
|
10
|
+
--secondary-border-color: #7c3aed;
|
|
11
|
+
|
|
12
|
+
--success-color: #10b981;
|
|
13
|
+
--success-hover-color: #059669;
|
|
14
|
+
--success-gradient: linear-gradient(135deg, #10b981 0%, #047857 100%);
|
|
15
|
+
--success-border-color: #059669;
|
|
16
|
+
|
|
17
|
+
--warning-color: #f59e0b;
|
|
18
|
+
--warning-hover-color: #d97706;
|
|
19
|
+
--warning-gradient: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
|
|
20
|
+
--warning-border-color: #d97706;
|
|
21
|
+
|
|
22
|
+
--danger-color: #ef4444;
|
|
23
|
+
--danger-hover-color: #dc2626;
|
|
24
|
+
--danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
|
|
25
|
+
--danger-border-color: #dc2626;
|
|
26
|
+
|
|
27
|
+
--info-color: #06b6d4;
|
|
28
|
+
--info-hover-color: #0891b2;
|
|
29
|
+
--info-gradient: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%);
|
|
30
|
+
--info-border-color: #0891b2;
|
|
31
|
+
|
|
32
|
+
--light-color: #f8fafc;
|
|
33
|
+
--light-hover-color: #e2e8f0;
|
|
34
|
+
--light-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
|
|
35
|
+
--light-border-color: #cbd5e1;
|
|
36
|
+
|
|
37
|
+
--dark-color: #1e293b;
|
|
38
|
+
--dark-hover-color: #0f172a;
|
|
39
|
+
--dark-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
|
|
40
|
+
--dark-border-color: #334155;
|
|
41
|
+
|
|
42
|
+
--text-color: #2d3748;
|
|
43
|
+
--text-light: #718096;
|
|
44
|
+
--bg-light: #ffffff;
|
|
45
|
+
--border-color: #e2e8f0;
|
|
46
|
+
|
|
47
|
+
--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
|
|
48
|
+
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
49
|
+
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
50
|
+
--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
51
|
+
|
|
52
|
+
//--primary-color: #667eea;
|
|
53
|
+
//--primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
54
|
+
//--secondary-color: #f093fb;
|
|
55
|
+
//--secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
|
|
56
|
+
//--success-color: #4facfe;
|
|
57
|
+
//--success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
|
58
|
+
//--danger-color: #fa709a;
|
|
59
|
+
//--danger-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
|
|
60
|
+
//--text-color: #2d3748;
|
|
61
|
+
//--text-light: #718096;
|
|
62
|
+
//--bg-light: #f7fafc;
|
|
63
|
+
//--border-color: #e2e8f0;
|
|
64
|
+
//--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
|
|
65
|
+
//--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
66
|
+
//--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
67
|
+
//--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
$color-types: 'primary', 'secondary', 'success', 'warning', 'danger', 'info', 'light', 'dark', 'white';
|
|
71
|
+
|
|
72
|
+
$primary-color: var(--primary-color);
|
|
73
|
+
$primary-hover-color: var(--primary-hover-color);
|
|
74
|
+
$primary-gradient: var(--primary-gradient);
|
|
75
|
+
$primary-border-color: var(--primary-border-color);
|
|
76
|
+
|
|
77
|
+
$secondary-color: var(--secondary-color);
|
|
78
|
+
$secondary-hover-color: var(--secondary-hover-color);
|
|
79
|
+
$secondary-gradient: var(--secondary-gradient);
|
|
80
|
+
$secondary-border-color: var(--secondary-border-color);
|
|
81
|
+
|
|
82
|
+
$success-color: var(--success-color);
|
|
83
|
+
$success-hover-color: var(--success-hover-color);
|
|
84
|
+
$success-gradient: var(--success-gradient);
|
|
85
|
+
$success-border-color: var(--success-border-color);
|
|
86
|
+
|
|
87
|
+
$warning-color: var(--warning-color);
|
|
88
|
+
$warning-hover-color: var(--warning-hover-color);
|
|
89
|
+
$warning-gradient: var(--warning-gradient);
|
|
90
|
+
$warning-border-color: var(--warning-border-color);
|
|
91
|
+
|
|
92
|
+
$danger-color: var(--danger-color);
|
|
93
|
+
$danger-hover-color: var(--danger-hover-color);
|
|
94
|
+
$danger-gradient: var(--danger-gradient);
|
|
95
|
+
$danger-border-color: var(--danger-border-color);
|
|
96
|
+
|
|
97
|
+
$info-color: var(--info-color);
|
|
98
|
+
$info-hover-color: var(--info-hover-color);
|
|
99
|
+
$info-gradient: var(--info-gradient);
|
|
100
|
+
$info-border-color: var(--info-border-color);
|
|
101
|
+
|
|
102
|
+
$light-color: var(--light-color);
|
|
103
|
+
$light-hover-color: var(--light-hover-color);
|
|
104
|
+
$light-gradient: var(--light-gradient);
|
|
105
|
+
$light-border-color: var(--light-border-color);
|
|
106
|
+
|
|
107
|
+
$dark-color: var(--dark-color);
|
|
108
|
+
$dark-hover-color: var(--dark-hover-color);
|
|
109
|
+
$dark-gradient: var(--dark-gradient);
|
|
110
|
+
$dark-border-color: var(--dark-border-color);
|
|
111
|
+
|
|
112
|
+
$text-color: var(--text-color);
|
|
113
|
+
$text-light: var(--text-light);
|
|
114
|
+
$bg-light: var(--bg-light);
|
|
115
|
+
$border-color: var(--border-color);
|
|
116
|
+
|
|
117
|
+
$shadow-sm: var(--shadow-sm);
|
|
118
|
+
$shadow-md: var(--shadow-md);
|
|
119
|
+
$shadow-lg: var(--shadow-lg);
|
|
120
|
+
$shadow-xl: var(--shadow-xl);
|
|
121
|
+
|
|
122
|
+
$space-1 : 0.25rem;
|
|
123
|
+
$space-2 : 0.5rem;
|
|
124
|
+
$space-3 : 1rem;
|
|
125
|
+
$space-4 : 1.5rem;
|
|
126
|
+
$space-5 : 3rem;
|