@ng-zen/cli 20.2.0 → 20.2.1
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/CHANGELOG.md +45 -0
- package/README.md +295 -103
- package/package.json +1 -1
- package/schematics/components/files/avatar/avatar.stories.ts +39 -19
- package/schematics/components/files/avatar/avatar.ts +2 -7
- package/schematics/components/files/button/button.scss +2 -1
- package/schematics/components/files/button/button.stories.ts +38 -11
- package/schematics/components/files/checkbox/checkbox.stories.ts +43 -16
- package/schematics/components/files/checkbox/checkbox.ts +0 -2
- package/schematics/components/files/divider/divider.stories.ts +26 -6
- package/schematics/components/files/divider/divider.ts +3 -5
- package/schematics/components/files/form-control/form-control.stories.ts +62 -11
- package/schematics/components/files/form-control/form-control.ts +3 -19
- package/schematics/components/files/icon/icon.stories.ts +30 -12
- package/schematics/components/files/icon/icon.ts +14 -12
- package/schematics/components/files/input/input.stories.ts +47 -19
- package/schematics/components/files/input/input.ts +6 -3
- package/schematics/components/files/skeleton/skeleton.stories.ts +32 -11
- package/schematics/components/files/switch/switch.stories.ts +49 -26
- package/schematics/components/files/switch/switch.ts +1 -0
- package/schematics/components/files/textarea/textarea.stories.ts +55 -22
- package/schematics/components/files/textarea/textarea.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,48 @@
|
|
|
1
|
+
## [20.2.1](https://github.com/kstepien3/ng-zen/compare/v20.2.0...v20.2.1) (2025-09-01)
|
|
2
|
+
|
|
3
|
+
### 🐛 Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **button:** improve styles to detect disabled states ([#283](https://github.com/kstepien3/ng-zen/issues/283)) ([757108f](https://github.com/kstepien3/ng-zen/commit/757108f9b455d699f416d893c027209d3fa9cbc0))
|
|
6
|
+
* **form-control:** move placeholder into the input component ([#277](https://github.com/kstepien3/ng-zen/issues/277)) ([aec69b4](https://github.com/kstepien3/ng-zen/commit/aec69b43575556b29d6256f1b3fbd61ae7eae515))
|
|
7
|
+
|
|
8
|
+
### 🛠️ Code Refactor
|
|
9
|
+
|
|
10
|
+
* remove unnecessary standalone property ([#290](https://github.com/kstepien3/ng-zen/issues/290)) ([d984f17](https://github.com/kstepien3/ng-zen/commit/d984f174ed7e25febaf3c908cb14573f3eaf7dee))
|
|
11
|
+
|
|
12
|
+
### 📚 Documentation
|
|
13
|
+
|
|
14
|
+
* **readme:** add logo and improve the file ([#289](https://github.com/kstepien3/ng-zen/issues/289)) ([2e8da82](https://github.com/kstepien3/ng-zen/commit/2e8da82c42817eb251a5957a2bd9862e07f2390b))
|
|
15
|
+
* **storybook:** add docs about the suggested storybook configuration ([#288](https://github.com/kstepien3/ng-zen/issues/288)) ([f9e0bc5](https://github.com/kstepien3/ng-zen/commit/f9e0bc555e3d1349dfa9f532ba883fe03baf0dec))
|
|
16
|
+
* **storybook:** improve documentations and stories code ([#287](https://github.com/kstepien3/ng-zen/issues/287)) ([c0312e9](https://github.com/kstepien3/ng-zen/commit/c0312e9de51e949527ec81abf70bb968ee2a84c4))
|
|
17
|
+
|
|
18
|
+
## [20.2.1-next.1](https://github.com/kstepien3/ng-zen/compare/v20.2.0...v20.2.1-next.1) (2025-09-01)
|
|
19
|
+
|
|
20
|
+
### 🐛 Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **button:** improve styles to detect disabled states ([#283](https://github.com/kstepien3/ng-zen/issues/283)) ([757108f](https://github.com/kstepien3/ng-zen/commit/757108f9b455d699f416d893c027209d3fa9cbc0))
|
|
23
|
+
* **form-control:** move placeholder into the input component ([#277](https://github.com/kstepien3/ng-zen/issues/277)) ([aec69b4](https://github.com/kstepien3/ng-zen/commit/aec69b43575556b29d6256f1b3fbd61ae7eae515))
|
|
24
|
+
|
|
25
|
+
### 🛠️ Code Refactor
|
|
26
|
+
|
|
27
|
+
* remove unnecessary standalone property ([#290](https://github.com/kstepien3/ng-zen/issues/290)) ([d984f17](https://github.com/kstepien3/ng-zen/commit/d984f174ed7e25febaf3c908cb14573f3eaf7dee))
|
|
28
|
+
|
|
29
|
+
### 📚 Documentation
|
|
30
|
+
|
|
31
|
+
* **readme:** add logo and improve the file ([#289](https://github.com/kstepien3/ng-zen/issues/289)) ([2e8da82](https://github.com/kstepien3/ng-zen/commit/2e8da82c42817eb251a5957a2bd9862e07f2390b))
|
|
32
|
+
* **storybook:** add docs about the suggested storybook configuration ([#288](https://github.com/kstepien3/ng-zen/issues/288)) ([f9e0bc5](https://github.com/kstepien3/ng-zen/commit/f9e0bc555e3d1349dfa9f532ba883fe03baf0dec))
|
|
33
|
+
* **storybook:** improve documentations and stories code ([#287](https://github.com/kstepien3/ng-zen/issues/287)) ([c0312e9](https://github.com/kstepien3/ng-zen/commit/c0312e9de51e949527ec81abf70bb968ee2a84c4))
|
|
34
|
+
|
|
35
|
+
## [20.2.1-next.1](https://github.com/kstepien3/ng-zen/compare/v20.2.0...v20.2.1-next.1) (2025-08-29)
|
|
36
|
+
|
|
37
|
+
### 🐛 Bug Fixes
|
|
38
|
+
|
|
39
|
+
* **button:** improve styles to detect disabled states ([#283](https://github.com/kstepien3/ng-zen/issues/283)) ([757108f](https://github.com/kstepien3/ng-zen/commit/757108f9b455d699f416d893c027209d3fa9cbc0))
|
|
40
|
+
* **form-control:** move placeholder into the input component ([#277](https://github.com/kstepien3/ng-zen/issues/277)) ([aec69b4](https://github.com/kstepien3/ng-zen/commit/aec69b43575556b29d6256f1b3fbd61ae7eae515))
|
|
41
|
+
|
|
42
|
+
### 🛠️ Code Refactor
|
|
43
|
+
|
|
44
|
+
* remove unnecessary standalone property ([#290](https://github.com/kstepien3/ng-zen/issues/290)) ([d984f17](https://github.com/kstepien3/ng-zen/commit/d984f174ed7e25febaf3c908cb14573f3eaf7dee))
|
|
45
|
+
|
|
1
46
|
## [20.2.0](https://github.com/kstepien3/ng-zen/compare/v20.1.0...v20.2.0) (2025-08-18)
|
|
2
47
|
|
|
3
48
|
### 🚀 New Features
|
package/README.md
CHANGED
|
@@ -1,168 +1,360 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://kstepien3.github.io/ng-zen/">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/kstepien3/ng-zen/master/images/logo.png" alt="@ng-zen/cli Logo" width="256" />
|
|
4
|
+
</a>
|
|
5
|
+
|
|
6
|
+
<h1>@ng-zen/cli</h1>
|
|
2
7
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
8
|
+
<p style="display: flex; gap: 1rem; justify-content: center;">
|
|
9
|
+
<a href="https://github.com/kstepien3/ng-zen/actions/workflows/ci.yml">
|
|
10
|
+
<img src="https://img.shields.io/github/actions/workflow/status/kstepien3/ng-zen/ci.yml?branch=master&label=build" alt="Build Status" />
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://www.npmjs.com/package/@ng-zen/cli">
|
|
13
|
+
<img src="https://img.shields.io/npm/v/@ng-zen/cli/latest?label=npm%40latest" alt="NPM Version" />
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://github.com/kstepien3/ng-zen/blob/master/LICENSE">
|
|
16
|
+
<img src="https://img.shields.io/github/license/kstepien3/ng-zen" alt="License" />
|
|
17
|
+
</a>
|
|
18
|
+
</p>
|
|
6
19
|
|
|
7
|
-
|
|
8
|
-
|
|
20
|
+
<p style="display: flex; gap: 1rem; justify-content: center;">
|
|
21
|
+
<a href="https://github.com/kstepien3/ng-zen">
|
|
22
|
+
<img src="https://img.shields.io/badge/-Repository-181818?style=flat&logo=github&logoColor=white" alt="Repository" />
|
|
23
|
+
</a>
|
|
24
|
+
<a href="https://kstepien3.github.io/ng-zen/">
|
|
25
|
+
<img src="https://img.shields.io/badge/-Storybook%20Demo-FF4785?style=flat&logo=storybook&logoColor=white" alt="Storybook Demo" />
|
|
26
|
+
</a>
|
|
27
|
+
</p>
|
|
9
28
|
|
|
10
|
-
Generate
|
|
29
|
+
<p><strong>Generate production-ready, customizable Angular UI components directly into your project 🚀</strong></p>
|
|
11
30
|
|
|
12
|
-
|
|
31
|
+
<p>Stop wrestling with rigid UI libraries. @ng-zen/cli generates beautiful, modern Angular components <strong>as source code</strong> in your project, giving you complete control and ownership.</p>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
## 🎯 Why Choose @ng-zen/cli?
|
|
35
|
+
|
|
36
|
+
### ✨ **Own Your Components**
|
|
37
|
+
|
|
38
|
+
Unlike traditional UI libraries that give you `<library-button>` black boxes, @ng-zen generates **actual TypeScript, HTML, and SCSS files** directly into your project. You own the code, you control the future.
|
|
39
|
+
|
|
40
|
+
### 🏎️ **Instant Productivity**
|
|
41
|
+
|
|
42
|
+
- **Production-Ready Components:** Avatar, Button, Checkbox, Divider, Form Control, Icon, Input, Skeleton, Switch, Textarea
|
|
43
|
+
- **Zero Configuration:** Works with Angular 20+ out of the box
|
|
44
|
+
- **Complete Setup:** Each component includes unit tests, Storybook stories, and documentation
|
|
45
|
+
|
|
46
|
+
### 🎨 **Built for Customization**
|
|
47
|
+
|
|
48
|
+
- **CSS Variables:** Easy theming without touching component internals
|
|
49
|
+
- **Editable SCSS:** Modify styles directly when you need deeper customization
|
|
50
|
+
- **Modern Architecture:** Standalone components, OnPush change detection, Angular signals
|
|
51
|
+
|
|
52
|
+
### 📚 **Developer Experience First**
|
|
53
|
+
|
|
54
|
+
- **Interactive Documentation:** Live Storybook examples for every component
|
|
55
|
+
- **TypeScript Ready:** Full type safety and IntelliSense support
|
|
56
|
+
- **Test Coverage:** Generated components include comprehensive unit tests
|
|
57
|
+
- **JSDoc Annotations:** Detailed inline documentation
|
|
13
58
|
|
|
14
59
|
## Table of Contents
|
|
15
60
|
|
|
16
|
-
1. [
|
|
17
|
-
2. [
|
|
18
|
-
3. [
|
|
19
|
-
4. [
|
|
20
|
-
5. [
|
|
21
|
-
6. [
|
|
22
|
-
7. [
|
|
23
|
-
8. [
|
|
24
|
-
9. [
|
|
25
|
-
10. [
|
|
26
|
-
11. [
|
|
27
|
-
12. [
|
|
28
|
-
13. [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- 🧩 **Component Schematics:** Generates ready-to-use UI component code (`.ts`, `.html`, `.scss`).
|
|
34
|
-
- 🎨 **Fully Customizable:** Easily theme and modify components via CSS variables and editable SCSS.
|
|
35
|
-
- 📱 **Responsive Design:** Components designed to adapt across various screen sizes.
|
|
36
|
-
- 📚 **Comprehensive Documentation:** Includes Storybook examples, JSDoc annotations, and `README.md` per component.
|
|
37
|
-
- ✅ **Test Coverage:** Generated components include unit tests (`.spec.ts`).
|
|
38
|
-
- 🚀 **Modern Angular:** Leverages standalone components, `OnPush` change detection, signals, and current best practices.
|
|
39
|
-
- 🛠 **Extensible:** Planned support for generating directives, pipes, services, and more.
|
|
40
|
-
|
|
41
|
-
## Ideal for
|
|
42
|
-
|
|
43
|
-
- 🏢 **Enterprise UI Kits:** A great starting point for building consistent, internal component libraries.
|
|
44
|
-
- 📈 **Custom Projects:** Accelerates development when custom UI elements are needed, avoiding vendor lock-in.
|
|
45
|
-
- 👩💻 **Developers:** Speeds up UI creation and ensures adherence to modern Angular patterns.
|
|
46
|
-
|
|
47
|
-
## Quick Start
|
|
48
|
-
|
|
49
|
-
The easiest way to add `@ng-zen/cli` and its schematics to your project:
|
|
61
|
+
1. [Quick Start](#-quick-start)
|
|
62
|
+
2. [Installation](#-installation)
|
|
63
|
+
3. [Available Components](#-available-components)
|
|
64
|
+
4. [Usage Examples](#-usage-examples)
|
|
65
|
+
5. [Perfect For](#-perfect-for)
|
|
66
|
+
6. [Advanced Features](#-advanced-features)
|
|
67
|
+
7. [Documentation](#-documentation)
|
|
68
|
+
8. [Project Status](#-project-status)
|
|
69
|
+
9. [Contributing](#-contributing)
|
|
70
|
+
10. [License](#license)
|
|
71
|
+
11. [Author](#author)
|
|
72
|
+
12. [See Also](#see-also)
|
|
73
|
+
13. [FAQ](#faq)
|
|
74
|
+
|
|
75
|
+
## 🚀 Quick Start
|
|
76
|
+
|
|
77
|
+
The fastest way to get started:
|
|
50
78
|
|
|
51
79
|
```bash
|
|
52
80
|
ng add @ng-zen/cli
|
|
53
81
|
```
|
|
54
82
|
|
|
55
|
-
This command
|
|
83
|
+
This command:
|
|
84
|
+
|
|
85
|
+
- ✅ Installs the package
|
|
86
|
+
- ✅ Sets up your project configuration
|
|
87
|
+
- ✅ Ready to generate components
|
|
88
|
+
|
|
89
|
+
Then generate your first component:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
ng generate @ng-zen/cli:component
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Select components from an interactive menu and they'll be generated directly into your current directory! 🎉
|
|
96
|
+
|
|
97
|
+
## 📦 Installation
|
|
98
|
+
|
|
99
|
+
### Recommended: Using ng add
|
|
56
100
|
|
|
57
|
-
|
|
101
|
+
```bash
|
|
102
|
+
ng add @ng-zen/cli
|
|
103
|
+
```
|
|
58
104
|
|
|
59
|
-
|
|
105
|
+
### Manual Installation
|
|
60
106
|
|
|
61
107
|
```bash
|
|
62
|
-
#
|
|
108
|
+
# Stable version
|
|
63
109
|
pnpm add -D @ng-zen/cli
|
|
64
110
|
|
|
65
|
-
#
|
|
111
|
+
# Latest features and fixes
|
|
66
112
|
pnpm add -D @ng-zen/cli@next
|
|
67
113
|
```
|
|
68
114
|
|
|
69
|
-
##
|
|
115
|
+
## 🧩 Available Components
|
|
116
|
+
|
|
117
|
+
| Component | Description | Features |
|
|
118
|
+
| ---------------- | -------------------------------- | -------------------------------------------------- |
|
|
119
|
+
| **Avatar** | User profile images and initials | Image fallback, size variants, rounded styles |
|
|
120
|
+
| **Button** | Interactive buttons | Primary/secondary variants, loading states, icons |
|
|
121
|
+
| **Checkbox** | Form checkboxes | Indeterminate state, custom styling, validation |
|
|
122
|
+
| **Divider** | Visual separators | Horizontal/vertical, with labels, custom thickness |
|
|
123
|
+
| **Form Control** | Form field wrapper | Labels, validation messages, required indicators |
|
|
124
|
+
| **Icon** | SVG icon system | Huge Icons integration, size variants, colors |
|
|
125
|
+
| **Input** | Text input fields | Validation states, prefixes/suffixes, types |
|
|
126
|
+
| **Skeleton** | Loading placeholders | Multiple shapes, animation, responsive |
|
|
127
|
+
| **Switch** | Toggle controls | On/off states, disabled state, custom labels |
|
|
128
|
+
| **Textarea** | Multi-line text input | Auto-resize, character counts, validation |
|
|
70
129
|
|
|
71
|
-
|
|
130
|
+
> 💡 **More components coming soon!** Planned: Directives, Pipes, Services, and additional UI elements.
|
|
72
131
|
|
|
73
|
-
|
|
132
|
+
## 💡 Usage Examples
|
|
133
|
+
|
|
134
|
+
### Basic Component Generation
|
|
74
135
|
|
|
75
136
|
```bash
|
|
137
|
+
# Interactive mode - choose components from a menu
|
|
76
138
|
ng generate @ng-zen/cli:component
|
|
139
|
+
|
|
140
|
+
# Generate specific components
|
|
141
|
+
ng generate @ng-zen/cli:component --components avatar button
|
|
142
|
+
|
|
143
|
+
# Custom location
|
|
144
|
+
ng generate @ng-zen/cli:component ./src/app/ui --components input checkbox
|
|
145
|
+
|
|
146
|
+
# Include Storybook stories
|
|
147
|
+
ng generate @ng-zen/cli:component --components button --stories
|
|
77
148
|
```
|
|
78
149
|
|
|
79
|
-
|
|
150
|
+
### What Gets Generated
|
|
80
151
|
|
|
81
|
-
|
|
152
|
+
Each component set includes:
|
|
82
153
|
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
154
|
+
```
|
|
155
|
+
src/app/ui/
|
|
156
|
+
├── button/
|
|
157
|
+
│ ├── button.ts # Component logic
|
|
158
|
+
│ ├── button.scss # Customizable styles
|
|
159
|
+
│ ├── button.spec.ts # Unit tests
|
|
160
|
+
│ ├── button.stories.ts # Storybook documentation
|
|
161
|
+
│ ├── index.ts # Barrel exports
|
|
162
|
+
│ └── README.md # Component-specific docs
|
|
163
|
+
└── input/
|
|
164
|
+
├── input.ts
|
|
165
|
+
├── input.scss
|
|
166
|
+
├── input.spec.ts
|
|
167
|
+
├── input.stories.ts
|
|
168
|
+
├── index.ts
|
|
169
|
+
└── README.md
|
|
87
170
|
```
|
|
88
171
|
|
|
89
|
-
|
|
172
|
+
### Real-World Usage
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
// After generation, import and use like any Angular component
|
|
176
|
+
import { ZenButton } from './ui/button';
|
|
177
|
+
import { ZenInput } from './ui/input';
|
|
178
|
+
|
|
179
|
+
@Component({
|
|
180
|
+
selector: 'app-login',
|
|
181
|
+
imports: [ZenButton, ZenInput],
|
|
182
|
+
template: `
|
|
183
|
+
<form>
|
|
184
|
+
<zen-input placeholder="Enter email" type="email" />
|
|
185
|
+
<button variant="primary" zen-button>Sign In</button>
|
|
186
|
+
</form>
|
|
187
|
+
`,
|
|
188
|
+
})
|
|
189
|
+
export class LoginComponent {}
|
|
190
|
+
```
|
|
90
191
|
|
|
91
|
-
|
|
192
|
+
## 🎯 Perfect For
|
|
92
193
|
|
|
93
|
-
|
|
94
|
-
|
|
194
|
+
### 🏢 **Enterprise Teams**
|
|
195
|
+
|
|
196
|
+
- Build consistent internal component libraries
|
|
197
|
+
- Maintain design system compliance across projects
|
|
198
|
+
- Avoid vendor lock-in with owned source code
|
|
199
|
+
|
|
200
|
+
### 🚀 **Startup Projects**
|
|
201
|
+
|
|
202
|
+
- Rapid prototyping with production-ready components
|
|
203
|
+
- Easy customization as requirements evolve
|
|
204
|
+
- No licensing concerns or bundle size bloat
|
|
205
|
+
|
|
206
|
+
### 👩💻 **Angular Developers**
|
|
207
|
+
|
|
208
|
+
- Learn modern Angular patterns (signals, standalone components)
|
|
209
|
+
- Speed up UI development workflow
|
|
210
|
+
- Maintain full control over component behavior
|
|
211
|
+
|
|
212
|
+
### 🎨 **Design Systems**
|
|
213
|
+
|
|
214
|
+
- Use as foundation for custom component libraries
|
|
215
|
+
- Extend and modify components to match brand guidelines
|
|
216
|
+
- Generate consistent documentation automatically
|
|
217
|
+
|
|
218
|
+
## ⚡ Advanced Features
|
|
219
|
+
|
|
220
|
+
### **Modern Angular Architecture**
|
|
221
|
+
|
|
222
|
+
- **Standalone Components:** No NgModule dependencies
|
|
223
|
+
- **OnPush Change Detection:** Optimized performance
|
|
224
|
+
- **Angular Signals:** Reactive state management
|
|
225
|
+
- **TypeScript 5.8+:** Latest language features
|
|
226
|
+
|
|
227
|
+
### **Customization System**
|
|
228
|
+
|
|
229
|
+
```scss
|
|
230
|
+
// Easy theming with CSS variables
|
|
231
|
+
:root {
|
|
232
|
+
--zen-button-primary-bg: #your-brand-color;
|
|
233
|
+
--zen-button-border-radius: 8px;
|
|
234
|
+
--zen-button-font-weight: 600;
|
|
235
|
+
}
|
|
95
236
|
```
|
|
96
237
|
|
|
97
|
-
###
|
|
238
|
+
### **Testing Integration**
|
|
98
239
|
|
|
99
|
-
|
|
240
|
+
- **Jest Ready:** All tests use Jest framework
|
|
241
|
+
- **Component Testing:** Isolated unit tests for each component
|
|
242
|
+
- **Storybook Testing:** Visual testing and documentation
|
|
100
243
|
|
|
101
|
-
|
|
102
|
-
- 💧 Pipes
|
|
103
|
-
- 🛠 Services
|
|
104
|
-
- ... and more!
|
|
244
|
+
### **Development Tools**
|
|
105
245
|
|
|
106
|
-
|
|
246
|
+
- **ESLint Integration:** Code quality enforcement
|
|
247
|
+
- **Prettier Support:** Consistent code formatting
|
|
248
|
+
- **Husky Hooks:** Pre-commit validation
|
|
107
249
|
|
|
108
|
-
|
|
250
|
+
## 📚 Documentation
|
|
109
251
|
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
- **
|
|
114
|
-
-
|
|
252
|
+
- **📖 [Live Storybook Demo](https://kstepien3.github.io/ng-zen/)** - Interactive component examples
|
|
253
|
+
- **🔧 [Development Guide](DEVELOPMENT.md)** - Setup and contribution workflow
|
|
254
|
+
- **🤝 [Contributing Guide](CONTRIBUTING.md)** - How to contribute to the project
|
|
255
|
+
- **📝 [Changelog](CHANGELOG.md)** - Version history and breaking changes
|
|
256
|
+
- **💬 Component READMEs** - Detailed docs generated with each component
|
|
115
257
|
|
|
116
|
-
##
|
|
258
|
+
## 🚧 Project Status
|
|
117
259
|
|
|
118
|
-
|
|
260
|
+
**🟢 Actively Developed & Production Ready**
|
|
119
261
|
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
- A component-specific `README.md` (generated from a template).
|
|
262
|
+
- ✅ **Core Features:** Component generation is stable and tested
|
|
263
|
+
- ✅ **Angular 20+ Support:** Compatible with latest Angular versions
|
|
264
|
+
- 🔄 **Continuous Improvement:** Regular updates and new components
|
|
265
|
+
- 📋 **Roadmap:** Directives, pipes, services, and more UI components planned
|
|
125
266
|
|
|
126
|
-
|
|
267
|
+
### Release Channels
|
|
127
268
|
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
- **READMEs:** Project-level (`README.md`, `DEVELOPMENT.md`, `CONTRIBUTING.md`) and component-level READMEs.
|
|
131
|
-
- **Changelog:** Automatically generated history of changes: [CHANGELOG.md](https://github.com/kstepien3/ng-zen/blob/master/CHANGELOG.md)
|
|
269
|
+
- **`@ng-zen/cli`** - Stable releases from `master` branch
|
|
270
|
+
- **`@ng-zen/cli@next`** - Pre-releases from `next` branch with latest features
|
|
132
271
|
|
|
133
|
-
|
|
272
|
+
> **Important:** Since @ng-zen/cli generates code into your project, you own that code completely. Updates to the CLI primarily add new features and components - they won't break your existing generated components.
|
|
134
273
|
|
|
135
|
-
|
|
274
|
+
## 🤝 Contributing
|
|
136
275
|
|
|
137
|
-
|
|
138
|
-
- New generators (directives, pipes, etc.) are planned.
|
|
139
|
-
- The `master` branch represents the latest **stable** release.
|
|
140
|
-
- The `next` branch contains **pre-release** versions with the newest features and fixes – use `@ng-zen/cli@next` to try them out.
|
|
276
|
+
We welcome contributions! Whether it's:
|
|
141
277
|
|
|
142
|
-
|
|
278
|
+
- 🐛 **Bug Reports** - Help us improve reliability
|
|
279
|
+
- 💡 **Feature Requests** - Suggest new components or capabilities
|
|
280
|
+
- 🔧 **Code Contributions** - Add features or fix issues
|
|
281
|
+
- 📚 **Documentation** - Improve guides and examples
|
|
143
282
|
|
|
144
|
-
|
|
283
|
+
> 🚀 **Do you urgently need some new features? Report them in the [`issues`](https://github.com/kstepien3/ng-zen/issues) section! They will be scheduled for the next deployments.**
|
|
145
284
|
|
|
146
|
-
|
|
285
|
+
**Getting Started:**
|
|
286
|
+
|
|
287
|
+
1. Read our [Contributing Guidelines](CONTRIBUTING.md)
|
|
288
|
+
2. Check the [Development Setup](DEVELOPMENT.md)
|
|
289
|
+
3. Browse [open issues](https://github.com/kstepien3/ng-zen/issues)
|
|
290
|
+
4. Join the discussion!
|
|
147
291
|
|
|
148
292
|
## License
|
|
149
293
|
|
|
150
|
-
This project is licensed under the [BSD 2-Clause License](
|
|
294
|
+
This project is licensed under the [BSD 2-Clause License](LICENSE) 📜.
|
|
151
295
|
|
|
152
296
|
## Author
|
|
153
297
|
|
|
154
|
-
|
|
298
|
+
**Konrad Stępień** - Creator & Maintainer
|
|
155
299
|
|
|
156
|
-
- GitHub: [@kstepien3](https://github.com/kstepien3)
|
|
157
|
-
- LinkedIn: [Konrad Stępień](https://www.linkedin.com/in/konradstepien/)
|
|
158
|
-
- Email: [kord.stp@gmail.com](mailto:kord.stp@gmail.com?subject=%5BNG-ZEN%5D%
|
|
300
|
+
- 🐙 GitHub: [@kstepien3](https://github.com/kstepien3)
|
|
301
|
+
- 💼 LinkedIn: [Konrad Stępień](https://www.linkedin.com/in/konradstepien/)
|
|
302
|
+
- 📧 Email: [kord.stp@gmail.com](mailto:kord.stp@gmail.com?subject=%5BNG-ZEN%5D%20Question)
|
|
159
303
|
|
|
160
|
-
## See
|
|
304
|
+
## See Also
|
|
161
305
|
|
|
162
|
-
- [ngx-schematic-builder](https://github.com/kstepien3/ngx-schematic-builder) -
|
|
306
|
+
- **[ngx-schematic-builder](https://github.com/kstepien3/ngx-schematic-builder)** - Custom Angular builder for compiling schematics (used by this project)
|
|
163
307
|
|
|
164
308
|
## FAQ
|
|
165
309
|
|
|
166
|
-
### How
|
|
310
|
+
### ❓ **How is this different from Angular Material or PrimeNG?**
|
|
311
|
+
|
|
312
|
+
Traditional UI libraries give you pre-compiled components that you can't modify. @ng-zen/cli generates the actual source code into your project, so you have complete control. You can modify the TypeScript, HTML, and SCSS files however you need.
|
|
313
|
+
|
|
314
|
+
### ❓ **Can I customize the generated components?**
|
|
315
|
+
|
|
316
|
+
Absolutely! That's the whole point. Every component is generated as editable source code in your project. You can:
|
|
317
|
+
|
|
318
|
+
- Modify the TypeScript logic
|
|
319
|
+
- Change the HTML templates
|
|
320
|
+
- Customize the SCSS styles
|
|
321
|
+
- Extend functionality as needed
|
|
322
|
+
|
|
323
|
+
### ❓ **What happens when I update @ng-zen/cli?**
|
|
324
|
+
|
|
325
|
+
Updates to the CLI add new features and components but don't affect your already-generated code. Your components belong to you and won't be overwritten. You can always generate new components with the latest features.
|
|
326
|
+
|
|
327
|
+
### ❓ **Does this work with existing Angular projects?**
|
|
328
|
+
|
|
329
|
+
Yes! @ng-zen/cli works with any Angular 20+ project. Just run `ng add @ng-zen/cli` in your existing project and start generating components.
|
|
330
|
+
|
|
331
|
+
### ❓ **Can I use this in production?**
|
|
332
|
+
|
|
333
|
+
Definitely! The generated components are production-ready with:
|
|
334
|
+
|
|
335
|
+
- Full TypeScript type safety
|
|
336
|
+
- Comprehensive unit tests
|
|
337
|
+
- Optimized performance (OnPush change detection)
|
|
338
|
+
- Accessibility considerations
|
|
339
|
+
- Modern Angular best practices
|
|
340
|
+
|
|
341
|
+
### ❓ **How do I theme the components?**
|
|
342
|
+
|
|
343
|
+
Components use CSS variables for easy theming:
|
|
344
|
+
|
|
345
|
+
```scss
|
|
346
|
+
:root {
|
|
347
|
+
--zen-primary-color: #your-brand-color;
|
|
348
|
+
--zen-border-radius: 8px;
|
|
349
|
+
}
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
For deeper customization, edit the generated SCSS files directly.
|
|
353
|
+
|
|
354
|
+
### ❓ **Why no Tailwind CSS?**
|
|
355
|
+
|
|
356
|
+
You can tweak the code to use Tailwind if you want, but avoid adding extra libraries. Our goal is to create base components that are easy to improve later, work without any CSS libraries, and are fully customizable right out of the box.
|
|
357
|
+
|
|
358
|
+
---
|
|
167
359
|
|
|
168
|
-
|
|
360
|
+
**Ready to take control of your Angular UI components?** [Get started now!](#-quick-start) 🚀
|
package/package.json
CHANGED
|
@@ -2,37 +2,57 @@ import type { Meta, StoryObj } from '@storybook/angular';
|
|
|
2
2
|
|
|
3
3
|
import { ZenAvatar } from './avatar';
|
|
4
4
|
|
|
5
|
+
type Options = ZenAvatar;
|
|
6
|
+
|
|
5
7
|
export default {
|
|
6
8
|
title: 'Components/Avatar',
|
|
7
9
|
component: ZenAvatar,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
argTypes: {
|
|
11
|
+
src: {
|
|
12
|
+
table: {
|
|
13
|
+
category: 'Inputs',
|
|
14
|
+
type: {
|
|
15
|
+
summary: 'string',
|
|
16
|
+
},
|
|
17
|
+
defaultValue: {
|
|
18
|
+
summary: '',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
control: 'text',
|
|
22
|
+
},
|
|
23
|
+
alt: {
|
|
24
|
+
table: {
|
|
25
|
+
category: 'Inputs',
|
|
26
|
+
type: {
|
|
27
|
+
summary: 'string',
|
|
28
|
+
},
|
|
29
|
+
defaultValue: {
|
|
30
|
+
summary: '',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
control: 'text',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
} satisfies Meta<Options>;
|
|
11
37
|
|
|
12
|
-
type Story = StoryObj<
|
|
38
|
+
type Story = StoryObj<Options>;
|
|
13
39
|
|
|
14
|
-
export const
|
|
40
|
+
export const Default: Story = {
|
|
15
41
|
args: {
|
|
16
|
-
src: 'https://
|
|
42
|
+
src: 'https://github.com/kstepien3.png',
|
|
43
|
+
alt: 'Author',
|
|
17
44
|
},
|
|
18
45
|
};
|
|
19
46
|
|
|
20
|
-
export const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}),
|
|
47
|
+
export const Image: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
src: 'https://picsum.photos/32',
|
|
50
|
+
alt: 'Random User',
|
|
51
|
+
},
|
|
26
52
|
};
|
|
27
53
|
|
|
28
54
|
export const Text: Story = {
|
|
29
55
|
render: () => ({
|
|
30
|
-
template:
|
|
31
|
-
<div style="display: flex; gap: 1rem;">
|
|
32
|
-
<zen-avatar>MI</zen-avatar>
|
|
33
|
-
<zen-avatar>IB</zen-avatar>
|
|
34
|
-
<zen-avatar>WP</zen-avatar>
|
|
35
|
-
<zen-avatar>AI</zen-avatar>
|
|
36
|
-
</div> `,
|
|
56
|
+
template: `<zen-avatar>KS</zen-avatar>`,
|
|
37
57
|
}),
|
|
38
58
|
};
|
|
@@ -49,13 +49,8 @@ import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
|
49
49
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
50
50
|
})
|
|
51
51
|
export class ZenAvatar {
|
|
52
|
-
/**
|
|
53
|
-
* Name of the source image. Image name will be processed by the image loader,
|
|
54
|
-
* and the final URL will be applied as the src property of the image.
|
|
55
|
-
*/
|
|
52
|
+
/** Source path for the image which will be processed by Angular's image loader. */
|
|
56
53
|
readonly src = input<string>('');
|
|
57
|
-
/**
|
|
58
|
-
* Sets or retrieves a text alternative to the graphic.
|
|
59
|
-
*/
|
|
54
|
+
/** Sets or retrieves a text alternative to the graphic. */
|
|
60
55
|
readonly alt = input<string>('');
|
|
61
56
|
}
|
|
@@ -37,7 +37,8 @@ $outline: var(--zen-outline, 2px solid hsl(200deg 100% 50% / 50%));
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/* Disabled state */
|
|
40
|
-
:host[aria-disabled='
|
|
40
|
+
:host[aria-disabled]:not([aria-disabled='false']),
|
|
41
|
+
:host[disabled]:not([disabled='false']) {
|
|
41
42
|
cursor: not-allowed;
|
|
42
43
|
opacity: 0.6;
|
|
43
44
|
}
|