@ng-zen/cli 22.1.0 → 22.2.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/CHANGELOG.md +13 -2
- package/README.md +18 -17
- package/package.json +3 -3
- package/schematics/ui/files/alert/alert.scss +1 -1
- package/schematics/ui/files/card/card.scss +57 -0
- package/schematics/ui/files/card/card.spec.ts +20 -0
- package/schematics/ui/files/card/card.stories.ts +157 -0
- package/schematics/ui/files/card/card.ts +64 -0
- package/schematics/ui/files/card/index.ts +1 -0
- package/schematics/ui/files/textarea/textarea.ts +0 -1
- package/schematics/ui/schema.js.map +1 -1
- package/schematics/ui/schema.json +1 -0
- package/schematics/ui/schema.ts +9 -1
- package/utils/apply-file-template.util.js.map +1 -1
- package/utils/apply-file-template.util.ts +2 -2
- package/types/files-config.js +0 -3
- package/types/files-config.js.map +0 -1
- package/types/files-config.ts +0 -7
- package/types/generator-schema-base.js +0 -3
- package/types/generator-schema-base.js.map +0 -1
- package/types/generator-schema-base.ts +0 -8
- package/types/index.js +0 -7
- package/types/index.js.map +0 -1
- package/types/index.ts +0 -3
- package/types/schematics-folder.js +0 -3
- package/types/schematics-folder.js.map +0 -1
- package/types/schematics-folder.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
## [22.
|
|
1
|
+
## [22.2.0](https://github.com/kstepien3/ng-zen/compare/v22.1.0...v22.2.0) (2026-07-06)
|
|
2
2
|
|
|
3
3
|
### 🚀 New Features
|
|
4
4
|
|
|
5
|
-
* **
|
|
5
|
+
* **textarea:** remove outdated autoresize TODO comment ([#435](https://github.com/kstepien3/ng-zen/issues/435)) ([73575c7](https://github.com/kstepien3/ng-zen/commit/73575c74e803d816612f74c5794ca97800bddb1c))
|
|
6
|
+
* trigger 22.2.0-next.1 release ([803e0fa](https://github.com/kstepien3/ng-zen/commit/803e0faccbd41c77b8996227f034dbbda0fa2852))
|
|
7
|
+
* **ui:** add reusable card component ([#428](https://github.com/kstepien3/ng-zen/issues/428)) ([f7acac6](https://github.com/kstepien3/ng-zen/commit/f7acac6b443b23c2710deaf3a763feb7f9269fbb))
|
|
8
|
+
* **ui:** migrate controls for signals and clean up ([#417](https://github.com/kstepien3/ng-zen/issues/417)) ([08824f8](https://github.com/kstepien3/ng-zen/commit/08824f85096745bcf001700dc415afe1a6cdb52e))
|
|
9
|
+
|
|
10
|
+
### 🐛 Bug Fixes
|
|
11
|
+
|
|
12
|
+
* force release after failed npm publish for 22.1.0-next.1 ([3e4d4db](https://github.com/kstepien3/ng-zen/commit/3e4d4db2a602f05b13ca2a989abc923ccebf7207))
|
|
13
|
+
|
|
14
|
+
### 📚 Documentation
|
|
15
|
+
|
|
16
|
+
* **storybook:** add Geist font and update base typography styles ([#429](https://github.com/kstepien3/ng-zen/issues/429)) ([296b2f2](https://github.com/kstepien3/ng-zen/commit/296b2f29197dacd491c4791a29d1026a17136201))
|
|
6
17
|
|
|
7
18
|
Development mode - changelog will be generated during build.
|
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ Unlike traditional UI libraries that give you `<library-button>` black boxes, @n
|
|
|
45
45
|
|
|
46
46
|
### 🏎️ **Instant Productivity**
|
|
47
47
|
|
|
48
|
-
- **Production-Ready UI Elements:** Alert, Avatar, Button, Checkbox, Dialog, Divider, Form Control, Icon, Input, Popover, Radio, Skeleton, Switch, Textarea
|
|
48
|
+
- **Production-Ready UI Elements:** Alert, Avatar, Button, Card, Checkbox, Dialog, Divider, Form Control, Icon, Input, Popover, Radio, Skeleton, Switch, Textarea
|
|
49
49
|
- **Zero Configuration:** Works with Angular 20+ out of the box
|
|
50
50
|
- **Complete Setup:** Each component includes unit tests, Storybook stories, and documentation
|
|
51
51
|
|
|
@@ -146,22 +146,23 @@ export class MyComponent {}
|
|
|
146
146
|
|
|
147
147
|
## 🧩 Available UIs
|
|
148
148
|
|
|
149
|
-
| Component | Description | Features
|
|
150
|
-
| ---------------- | -------------------------------- |
|
|
151
|
-
| **Avatar** | User profile images and initials | Image fallback, size variants, rounded styles
|
|
152
|
-
| **Alert** | Informational messages | Customizable styles, dismissible options
|
|
153
|
-
| **Button** | Interactive buttons | Primary/secondary variants, loading states, icons
|
|
154
|
-
| **
|
|
155
|
-
| **
|
|
156
|
-
| **
|
|
157
|
-
| **
|
|
158
|
-
| **
|
|
159
|
-
| **
|
|
160
|
-
| **
|
|
161
|
-
| **
|
|
162
|
-
| **
|
|
163
|
-
| **
|
|
164
|
-
| **
|
|
149
|
+
| Component | Description | Features |
|
|
150
|
+
| ---------------- | -------------------------------- | ------------------------------------------------------------------------------ |
|
|
151
|
+
| **Avatar** | User profile images and initials | Image fallback, size variants, rounded styles |
|
|
152
|
+
| **Alert** | Informational messages | Customizable styles, dismissible options |
|
|
153
|
+
| **Button** | Interactive buttons | Primary/secondary variants, loading states, icons |
|
|
154
|
+
| **Card** | Content container | Multi-slot projection (header, title, subtitle, footer), CSS custom properties |
|
|
155
|
+
| **Checkbox** | Form checkboxes | Indeterminate state, custom styling, validation |
|
|
156
|
+
| **Dialog** | Native modal dialogs | Native dialog element, service API, size variants, backdrop config |
|
|
157
|
+
| **Divider** | Visual separators | Horizontal/vertical, with labels, custom thickness |
|
|
158
|
+
| **Form Control** | Form field wrapper | Labels, validation messages, required indicators |
|
|
159
|
+
| **Icon** | SVG icon system | Huge Icons integration, size variants, colors |
|
|
160
|
+
| **Input** | Text input fields | Validation states, prefixes/suffixes, types |
|
|
161
|
+
| **Popover** | Native Popover API directive | Template/string content, placements, click toggle, CSS anchor positioning |
|
|
162
|
+
| **Radio** | Form radio buttons | Group selection, two-way binding, custom styling, disabled state |
|
|
163
|
+
| **Skeleton** | Loading placeholders | Multiple shapes, animation, responsive |
|
|
164
|
+
| **Switch** | Toggle controls | On/off states, disabled state, custom labels |
|
|
165
|
+
| **Textarea** | Multi-line text input | Auto-resize, character counts, validation |
|
|
165
166
|
|
|
166
167
|
> 💡 **More components coming soon!** Planned: Directives, Pipes, Services, and additional UI elements.
|
|
167
168
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-zen/cli",
|
|
3
|
-
"version": "22.
|
|
4
|
-
"description": "Angular UI components generator – Zen UI Kit CLI for schematics-based creation of customizable components like avatar, button, checkbox, divider, form-control, icon, input, skeleton, switch, textarea with Storybook demos.",
|
|
3
|
+
"version": "22.2.0",
|
|
4
|
+
"description": "Angular UI components generator – Zen UI Kit CLI for schematics-based creation of customizable components like alert, avatar, button, card, checkbox, dialog, divider, form-control, icon, input, popover, radio, skeleton, switch, textarea with Storybook demos.",
|
|
5
5
|
"license": "BSD-2-Clause",
|
|
6
6
|
"private": false,
|
|
7
7
|
"repository": {
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"alert",
|
|
49
49
|
"avatar",
|
|
50
50
|
"button",
|
|
51
|
+
"card",
|
|
51
52
|
"checkbox",
|
|
52
53
|
"dialog",
|
|
53
54
|
"divider",
|
|
@@ -69,7 +70,6 @@
|
|
|
69
70
|
"dependencies": {
|
|
70
71
|
"@angular-devkit/core": "^22.0.1",
|
|
71
72
|
"@angular-devkit/schematics": "^22.0.1",
|
|
72
|
-
"@angular/build": "22.0.1",
|
|
73
73
|
"tslib": "^2.8.1"
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--zen-card-border-radius: 0.75rem;
|
|
3
|
+
--zen-card-ring: 0 0 0 1px hsl(0deg 0% 0% / 10%);
|
|
4
|
+
--zen-card-shadow: 0 1px 3px 0 rgb(0 0 0 / 10%);
|
|
5
|
+
--zen-card-bg: hsl(0deg 0% 100%);
|
|
6
|
+
--zen-card-color: hsl(0deg 0% 10%);
|
|
7
|
+
--zen-card-padding: 1.5rem;
|
|
8
|
+
--zen-card-gap: 1rem;
|
|
9
|
+
--zen-card-header-gap: 0.25rem;
|
|
10
|
+
--zen-card-title-font-size: 1.125rem;
|
|
11
|
+
--zen-card-title-font-weight: 600;
|
|
12
|
+
--zen-card-subtitle-font-size: 0.875rem;
|
|
13
|
+
--zen-card-subtitle-color: hsl(0deg 0% 40%);
|
|
14
|
+
--zen-card-border: 1px solid hsl(0deg 0% 0% / 10%);
|
|
15
|
+
--zen-card-footer-bg: hsl(0deg 0% 95%);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* stylelint-disable-next-line no-duplicate-selectors -- separate variables and styles */
|
|
19
|
+
:host {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
font-size: 0.875rem;
|
|
23
|
+
border-radius: var(--zen-card-border-radius);
|
|
24
|
+
box-shadow: var(--zen-card-ring), var(--zen-card-shadow);
|
|
25
|
+
background: var(--zen-card-bg);
|
|
26
|
+
color: var(--zen-card-color);
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.zen-card-body {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
gap: var(--zen-card-gap);
|
|
34
|
+
padding: var(--zen-card-padding);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.zen-card-footer {
|
|
38
|
+
&:not(:empty) {
|
|
39
|
+
padding: var(--zen-card-padding);
|
|
40
|
+
border-top: var(--zen-card-border);
|
|
41
|
+
background: var(--zen-card-footer-bg);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host ::ng-deep [card-title] {
|
|
46
|
+
margin: 0;
|
|
47
|
+
font-size: var(--zen-card-title-font-size);
|
|
48
|
+
font-weight: var(--zen-card-title-font-weight);
|
|
49
|
+
line-height: 1.4;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:host ::ng-deep [card-subtitle] {
|
|
53
|
+
margin: 0;
|
|
54
|
+
font-size: var(--zen-card-subtitle-font-size);
|
|
55
|
+
color: var(--zen-card-subtitle-color);
|
|
56
|
+
line-height: 1.5;
|
|
57
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { provideZonelessChangeDetection } from '@angular/core';
|
|
2
|
+
import { TestBed } from '@angular/core/testing';
|
|
3
|
+
import { beforeEach, describe, expect, it } from 'vitest';
|
|
4
|
+
|
|
5
|
+
import { ZenCard } from './card';
|
|
6
|
+
|
|
7
|
+
describe('ZenCard', () => {
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
imports: [ZenCard],
|
|
11
|
+
providers: [provideZonelessChangeDetection()],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('should create', () => {
|
|
16
|
+
const fixture = TestBed.createComponent(ZenCard);
|
|
17
|
+
const component = fixture.componentInstance;
|
|
18
|
+
expect(component).toBeTruthy();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { Meta, moduleMetadata, StoryObj } from '@storybook/angular';
|
|
2
|
+
|
|
3
|
+
import { ZenButton } from '../button';
|
|
4
|
+
import { ZenCard } from './card';
|
|
5
|
+
|
|
6
|
+
interface StoryParams {
|
|
7
|
+
content: string;
|
|
8
|
+
title: string;
|
|
9
|
+
subtitle: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type Options = ZenCard & StoryParams;
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: 'Ui/Card',
|
|
16
|
+
component: ZenCard,
|
|
17
|
+
decorators: [moduleMetadata({ imports: [ZenButton] })],
|
|
18
|
+
args: {
|
|
19
|
+
content: 'This is the card content.',
|
|
20
|
+
title: 'Card Title',
|
|
21
|
+
subtitle: 'Card subtitle',
|
|
22
|
+
},
|
|
23
|
+
argTypes: {
|
|
24
|
+
content: {
|
|
25
|
+
control: 'text',
|
|
26
|
+
table: { category: 'story parameters', type: { summary: 'ng-content' } },
|
|
27
|
+
},
|
|
28
|
+
title: {
|
|
29
|
+
control: 'text',
|
|
30
|
+
table: { category: 'story parameters', type: { summary: 'string' } },
|
|
31
|
+
},
|
|
32
|
+
subtitle: {
|
|
33
|
+
control: 'text',
|
|
34
|
+
table: { category: 'story parameters', type: { summary: 'string' } },
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
render: ({ content, title, subtitle }) => ({
|
|
38
|
+
props: {},
|
|
39
|
+
template: `
|
|
40
|
+
<zen-card>
|
|
41
|
+
<h3 card-title>${title}</h3>
|
|
42
|
+
<p card-subtitle>${subtitle}</p>
|
|
43
|
+
${content}
|
|
44
|
+
</zen-card>
|
|
45
|
+
`,
|
|
46
|
+
}),
|
|
47
|
+
} satisfies Meta<Options>;
|
|
48
|
+
|
|
49
|
+
type Story = StoryObj<Options>;
|
|
50
|
+
|
|
51
|
+
export const Default: Story = {};
|
|
52
|
+
|
|
53
|
+
export const Basic: Story = {
|
|
54
|
+
args: {
|
|
55
|
+
content: 'This is a simple card with only default content.',
|
|
56
|
+
},
|
|
57
|
+
render: ({ content }) => ({
|
|
58
|
+
props: {},
|
|
59
|
+
template: `
|
|
60
|
+
<zen-card>
|
|
61
|
+
${content}
|
|
62
|
+
</zen-card>
|
|
63
|
+
`,
|
|
64
|
+
}),
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const WithFooter: Story = {
|
|
68
|
+
args: {
|
|
69
|
+
content: 'Card content with a footer action.',
|
|
70
|
+
},
|
|
71
|
+
render: ({ content, title, subtitle }) => ({
|
|
72
|
+
props: {},
|
|
73
|
+
template: `
|
|
74
|
+
<zen-card>
|
|
75
|
+
<h3 card-title>${title}</h3>
|
|
76
|
+
<p card-subtitle>${subtitle}</p>
|
|
77
|
+
${content}
|
|
78
|
+
<div card-footer>
|
|
79
|
+
<button zen-button>Save changes</button>
|
|
80
|
+
</div>
|
|
81
|
+
</zen-card>
|
|
82
|
+
`,
|
|
83
|
+
}),
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const Size: Story = {
|
|
87
|
+
args: {
|
|
88
|
+
content: '',
|
|
89
|
+
title: '',
|
|
90
|
+
subtitle: '',
|
|
91
|
+
},
|
|
92
|
+
render: () => ({
|
|
93
|
+
props: {},
|
|
94
|
+
template: `
|
|
95
|
+
<zen-card style="--zen-card-padding: 1rem; --zen-card-gap: 0.75rem; --zen-card-header-gap: 0.125rem;">
|
|
96
|
+
<h3 card-title>Scheduled reports</h3>
|
|
97
|
+
<p card-subtitle>Weekly snapshots. No more manual exports.</p>
|
|
98
|
+
<ul style="margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.25rem;">
|
|
99
|
+
<li>Choose a schedule (daily, or weekly).</li>
|
|
100
|
+
<li>Send to channels or specific teammates.</li>
|
|
101
|
+
<li>Include charts, tables, and key metrics.</li>
|
|
102
|
+
</ul>
|
|
103
|
+
<div card-footer style="display: flex; gap: 0.5rem;">
|
|
104
|
+
<button zen-button>Set up scheduled reports</button>
|
|
105
|
+
<button zen-button variant="outline">See what's new</button>
|
|
106
|
+
</div>
|
|
107
|
+
</zen-card>
|
|
108
|
+
`,
|
|
109
|
+
}),
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export const LoginForm: Story = {
|
|
113
|
+
args: {
|
|
114
|
+
content: '',
|
|
115
|
+
title: '',
|
|
116
|
+
subtitle: '',
|
|
117
|
+
},
|
|
118
|
+
render: () => ({
|
|
119
|
+
props: {},
|
|
120
|
+
template: `
|
|
121
|
+
<zen-card>
|
|
122
|
+
<h3 card-title>Login to your account</h3>
|
|
123
|
+
<p card-subtitle>Enter your email below to login to your account</p>
|
|
124
|
+
<div style="display: grid; gap: 0.75rem;">
|
|
125
|
+
<input type="email" placeholder="Email" style="border: 1px solid hsl(0deg 0% 80%); border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.875rem;">
|
|
126
|
+
<input type="password" placeholder="Password" style="border: 1px solid hsl(0deg 0% 80%); border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.875rem;">
|
|
127
|
+
<a href="#" style="font-size: 0.75rem; color: hsl(0deg 0% 40%); text-align: right;">Forgot your password?</a>
|
|
128
|
+
</div>
|
|
129
|
+
<div card-footer style="display: flex; flex-direction: column; gap: 0.5rem;">
|
|
130
|
+
<button zen-button>Login</button>
|
|
131
|
+
<button zen-button variant="filled">Login with Google</button>
|
|
132
|
+
</div>
|
|
133
|
+
</zen-card>
|
|
134
|
+
`,
|
|
135
|
+
}),
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export const ImageCard: Story = {
|
|
139
|
+
args: {
|
|
140
|
+
content: '',
|
|
141
|
+
title: '',
|
|
142
|
+
subtitle: '',
|
|
143
|
+
},
|
|
144
|
+
render: () => ({
|
|
145
|
+
props: {},
|
|
146
|
+
template: `
|
|
147
|
+
<zen-card>
|
|
148
|
+
<img card-header src="https://picsum.photos/seed/ng-zen/600/400" alt="Event cover" style="display: block; width: 100%; height: 300px; object-fit: cover;">
|
|
149
|
+
|
|
150
|
+
<h3 card-title style="margin: 0;">Design systems meetup</h3>
|
|
151
|
+
<p style="margin: 0;">A practical talk on component APIs, accessibility, and shipping faster.</p>
|
|
152
|
+
|
|
153
|
+
<button card-footer zen-button variant="ghost" style="width: 100%;">View Event</button>
|
|
154
|
+
</zen-card>
|
|
155
|
+
`,
|
|
156
|
+
}),
|
|
157
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ZenCard is a reusable card component that provides a consistent container
|
|
5
|
+
* for grouping related content. It supports multi-slot content projection
|
|
6
|
+
* through attribute selectors.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
*
|
|
10
|
+
* ```html
|
|
11
|
+
* <zen-card>
|
|
12
|
+
* <div card-header>
|
|
13
|
+
* <app-badge variant="secondary">Featured</app-badge>
|
|
14
|
+
* </div>
|
|
15
|
+
* <h3 card-title>Design systems meetup</h3>
|
|
16
|
+
* <p card-subtitle>
|
|
17
|
+
* A practical talk on component APIs, accessibility, and shipping faster.
|
|
18
|
+
* </p>
|
|
19
|
+
* <img src="..." alt="Event cover" />
|
|
20
|
+
* <div card-footer>
|
|
21
|
+
* <app-button>View Event</app-button>
|
|
22
|
+
* </div>
|
|
23
|
+
* </zen-card>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* ### CSS Custom Properties
|
|
27
|
+
*
|
|
28
|
+
* You can customize the component using CSS custom properties:
|
|
29
|
+
*
|
|
30
|
+
* ```css
|
|
31
|
+
* :root {
|
|
32
|
+
* --zen-card-border-radius: 0.75rem;
|
|
33
|
+
* --zen-card-ring: 0 0 0 1px hsl(0deg 0% 0% / 0.1);
|
|
34
|
+
* --zen-card-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
|
|
35
|
+
* --zen-card-bg: hsl(0deg 0% 100%);
|
|
36
|
+
* --zen-card-color: hsl(0deg 0% 10%);
|
|
37
|
+
* --zen-card-padding: 1.5rem;
|
|
38
|
+
* --zen-card-gap: 1rem;
|
|
39
|
+
* --zen-card-title-font-size: 1.125rem;
|
|
40
|
+
* --zen-card-subtitle-font-size: 0.875rem;
|
|
41
|
+
* --zen-card-footer-bg: hsl(0deg 0% 95%);
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @author Konrad Stępień
|
|
46
|
+
* @license {@link https://github.com/kstepien3/ng-zen/blob/master/LICENSE|BSD-2-Clause}
|
|
47
|
+
* @see [GitHub](https://github.com/kstepien3/ng-zen)
|
|
48
|
+
*/
|
|
49
|
+
@Component({
|
|
50
|
+
selector: 'zen-card',
|
|
51
|
+
template: `
|
|
52
|
+
<ng-content select="[card-header]" />
|
|
53
|
+
<div class="zen-card-body">
|
|
54
|
+
<ng-content select="[card-title]" />
|
|
55
|
+
<ng-content select="[card-subtitle]" />
|
|
56
|
+
<ng-content />
|
|
57
|
+
</div>
|
|
58
|
+
<div class="zen-card-footer">
|
|
59
|
+
<ng-content select="[card-footer]" />
|
|
60
|
+
</div>
|
|
61
|
+
`,
|
|
62
|
+
styleUrl: './card.scss',
|
|
63
|
+
})
|
|
64
|
+
export class ZenCard {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './card';
|
|
@@ -25,7 +25,6 @@ import { Component } from '@angular/core';
|
|
|
25
25
|
* @see [GitHub](https://github.com/kstepien3/ng-zen)
|
|
26
26
|
*/
|
|
27
27
|
@Component({
|
|
28
|
-
// @TODO: add support for autoresize for mozilla browsers https://developer.mozilla.org/en-US/docs/Web/CSS/field-sizing
|
|
29
28
|
// eslint-disable-next-line @angular-eslint/component-selector
|
|
30
29
|
selector: 'textarea[zen-textarea], textarea[zen-textarea][autoresize]',
|
|
31
30
|
template: `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../src/schematics/ui/schema.ts"],"names":[],"mappings":"","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../src/schematics/ui/schema.ts"],"names":[],"mappings":"","sourcesContent":["import { Path } from '@angular-devkit/core';\n\nexport interface GeneratorSchemaBase {\n currentDirectory: Path;\n path?: Path;\n stories: boolean;\n project?: string;\n}\n\nexport type UiType =\n | 'alert'\n | 'avatar'\n | 'button'\n | 'card'\n | 'checkbox'\n | 'dialog'\n | 'divider'\n | 'form-control'\n | 'icon'\n | 'input'\n | 'popover'\n | 'radio'\n | 'skeleton'\n | 'switch'\n | 'textarea';\n\nexport interface Schema extends GeneratorSchemaBase {\n ui: UiType[];\n}\n"]}
|
package/schematics/ui/schema.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Path } from '@angular-devkit/core';
|
|
2
|
+
|
|
3
|
+
export interface GeneratorSchemaBase {
|
|
4
|
+
currentDirectory: Path;
|
|
5
|
+
path?: Path;
|
|
6
|
+
stories: boolean;
|
|
7
|
+
project?: string;
|
|
8
|
+
}
|
|
2
9
|
|
|
3
10
|
export type UiType =
|
|
4
11
|
| 'alert'
|
|
5
12
|
| 'avatar'
|
|
6
13
|
| 'button'
|
|
14
|
+
| 'card'
|
|
7
15
|
| 'checkbox'
|
|
8
16
|
| 'dialog'
|
|
9
17
|
| 'divider'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-file-template.util.js","sourceRoot":"","sources":["../../../../src/utils/apply-file-template.util.ts"],"names":[],"mappings":";;AAkBA,sDASC;AA3BD,+CAA0D;AAC1D,2DAA8G;
|
|
1
|
+
{"version":3,"file":"apply-file-template.util.js","sourceRoot":"","sources":["../../../../src/utils/apply-file-template.util.ts"],"names":[],"mappings":";;AAkBA,sDASC;AA3BD,+CAA0D;AAC1D,2DAA8G;AAG9G,qEAAiE;AAEjE,MAAM,mBAAmB,GAAG,CAAC,MAAc,EAAE,IAAY,EAAU,EAAE,CAAC;IACpE,IAAA,2BAAc,EAAC;QACb,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,cAAc,EAAE;QACvC,GAAG,cAAO;KACX,CAAC;IACF,IAAA,iBAAI,EAAC,IAAA,gBAAS,EAAC,GAAG,IAAI,IAAI,MAAM,EAAE,CAAC,CAAC;CACrC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,aAAa,CAAC,EAAE,KAAK,CAAC,CAAC;AACzE,MAAM,cAAc,GAAG,CAAC,OAAgB,EAAE,EAAE,CAAC,IAAA,mBAAM,EAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AAE9G,SAAgB,qBAAqB,CAAC,OAAiB,EAAE,MAA2B;IAClF,oCAAgB,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC;IAClC,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QAC1B,MAAM,KAAK,GAAG,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,IAAc,CAAC,CAAC;QAEjE,MAAM,YAAY,GAAG,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,WAAW,MAAM,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC;QAEjG,OAAO,IAAA,kBAAK,EAAC,CAAC,YAAY,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,sBAAS,CAAC,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { normalize, strings } from '@angular-devkit/core';\nimport { apply, applyTemplates, chain, filter, mergeWith, move, Rule, url } from '@angular-devkit/schematics';\n\nimport { GeneratorSchemaBase, UiType } from '../schematics/ui/schema';\nimport { selectedElements } from '../services/selected-elements';\n\nconst createTemplateRules = (folder: string, path: string): Rule[] => [\n applyTemplates({\n name: folder,\n localeDate: new Date().toLocaleString(),\n ...strings,\n }),\n move(normalize(`${path}/${folder}`)),\n];\n\nconst getTemplates = (rules: Rule[]) => apply(url(`./templates`), rules);\nconst includeStories = (include: boolean) => filter(filePath => include || !filePath.endsWith('.stories.ts'));\n\nexport function applyFileTemplateUtil(folders: UiType[], config: GeneratorSchemaBase): Rule[] {\n selectedElements.push(...folders);\n return folders.map(folder => {\n const RULES = createTemplateRules(folder, config.path as string);\n\n const folderSource = apply(url(`./files/${folder}`), [includeStories(config.stories), ...RULES]);\n\n return chain([folderSource, getTemplates(RULES)].map(mergeWith));\n });\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { normalize, strings } from '@angular-devkit/core';
|
|
2
2
|
import { apply, applyTemplates, chain, filter, mergeWith, move, Rule, url } from '@angular-devkit/schematics';
|
|
3
3
|
|
|
4
|
+
import { GeneratorSchemaBase, UiType } from '../schematics/ui/schema';
|
|
4
5
|
import { selectedElements } from '../services/selected-elements';
|
|
5
|
-
import { GeneratorSchemaBase, SchematicsFolder } from '../types';
|
|
6
6
|
|
|
7
7
|
const createTemplateRules = (folder: string, path: string): Rule[] => [
|
|
8
8
|
applyTemplates({
|
|
@@ -16,7 +16,7 @@ const createTemplateRules = (folder: string, path: string): Rule[] => [
|
|
|
16
16
|
const getTemplates = (rules: Rule[]) => apply(url(`./templates`), rules);
|
|
17
17
|
const includeStories = (include: boolean) => filter(filePath => include || !filePath.endsWith('.stories.ts'));
|
|
18
18
|
|
|
19
|
-
export function applyFileTemplateUtil(folders:
|
|
19
|
+
export function applyFileTemplateUtil(folders: UiType[], config: GeneratorSchemaBase): Rule[] {
|
|
20
20
|
selectedElements.push(...folders);
|
|
21
21
|
return folders.map(folder => {
|
|
22
22
|
const RULES = createTemplateRules(folder, config.path as string);
|
package/types/files-config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"files-config.js","sourceRoot":"","sources":["../../../../src/types/files-config.ts"],"names":[],"mappings":"","sourcesContent":["import { NodeDependencyType } from '@schematics/angular/utility/dependencies';\n\nimport { UiType } from '../schematics/ui/schema';\n\ntype Kind = Record<NodeDependencyType, Record<string, string>>;\n\nexport type FilesConfig = Record<UiType, Partial<Kind>>;\n"]}
|
package/types/files-config.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generator-schema-base.js","sourceRoot":"","sources":["../../../../src/types/generator-schema-base.ts"],"names":[],"mappings":"","sourcesContent":["import { Path } from '@angular-devkit/core';\n\nexport interface GeneratorSchemaBase {\n currentDirectory: Path;\n path?: Path;\n stories: boolean;\n project?: string;\n}\n"]}
|
package/types/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./files-config"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./generator-schema-base"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./schematics-folder"), exports);
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
package/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,kEAAwC;AACxC,8DAAoC","sourcesContent":["export * from './files-config';\nexport * from './generator-schema-base';\nexport * from './schematics-folder';\n"]}
|
package/types/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schematics-folder.js","sourceRoot":"","sources":["../../../../src/types/schematics-folder.ts"],"names":[],"mappings":"","sourcesContent":["import { UiType } from '../schematics/ui/schema';\n\nexport type SchematicsFolder = UiType;\n"]}
|