@ng-zen/cli 22.2.0 → 22.3.0-next.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 +4 -10
- package/README.md +11 -3
- package/package.json +6 -3
- package/schematics/ui/files/badge/badge.scss +106 -0
- package/schematics/ui/files/badge/badge.spec.ts +58 -0
- package/schematics/ui/files/badge/badge.stories.ts +138 -0
- package/schematics/ui/files/badge/badge.ts +15 -0
- package/schematics/ui/files/badge/index.ts +1 -0
- package/schematics/ui/files/card/card.stories.ts +4 -3
- package/schematics/ui/files/input/input.scss +5 -0
- package/schematics/ui/schema.js.map +1 -1
- package/schematics/ui/schema.json +1 -0
- package/schematics/ui/schema.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
## [22.
|
|
1
|
+
## [22.3.0-next.1](https://github.com/kstepien3/ng-zen/compare/v22.2.0...v22.3.0-next.1) (2026-07-10)
|
|
2
2
|
|
|
3
3
|
### 🚀 New Features
|
|
4
4
|
|
|
5
|
-
* **
|
|
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))
|
|
5
|
+
* **ui/badge:** add component ([#439](https://github.com/kstepien3/ng-zen/issues/439)) ([ed1ccbc](https://github.com/kstepien3/ng-zen/commit/ed1ccbc3e29655d3c6f98ace327803e3fa4c7beb))
|
|
13
6
|
|
|
14
7
|
### 📚 Documentation
|
|
15
8
|
|
|
16
|
-
*
|
|
9
|
+
* project information, descriptions, and SEO ([#450](https://github.com/kstepien3/ng-zen/issues/450)) ([162ca7e](https://github.com/kstepien3/ng-zen/commit/162ca7e525e0f1b967ef91e1e63fd89b04c57a3e))
|
|
10
|
+
* **ui/card:** integrate zen-input in card stories ([#453](https://github.com/kstepien3/ng-zen/issues/453)) ([42d03b8](https://github.com/kstepien3/ng-zen/commit/42d03b842415eaa57ca3f199474820f6cc9756bd))
|
|
17
11
|
|
|
18
12
|
Development mode - changelog will be generated during build.
|
package/README.md
CHANGED
|
@@ -32,20 +32,25 @@
|
|
|
32
32
|
</a>
|
|
33
33
|
</p>
|
|
34
34
|
|
|
35
|
-
<p><strong>
|
|
35
|
+
<p><strong>Standalone Angular UI Kit Generator — not a utility suite, not a rigid library.</strong>
|
|
36
|
+
<br/> Generate production-ready, customizable Angular UI components directly into your project 🚀</p>
|
|
36
37
|
|
|
37
|
-
<p>Stop wrestling with rigid UI libraries.
|
|
38
|
+
<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>
|
|
38
39
|
</div>
|
|
39
40
|
|
|
41
|
+
<!-- TODO: Insert terminal recording GIF/WebM here showing the CLI in action -->
|
|
42
|
+
|
|
40
43
|
## 🎯 Why Choose @ng-zen/cli?
|
|
41
44
|
|
|
45
|
+
Inspired by the philosophy of **shadcn/ui**, **@ng-zen/cli** brings the "own your components" approach natively to the modern Angular ecosystem.
|
|
46
|
+
|
|
42
47
|
### ✨ **Own Your Components**
|
|
43
48
|
|
|
44
49
|
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.
|
|
45
50
|
|
|
46
51
|
### 🏎️ **Instant Productivity**
|
|
47
52
|
|
|
48
|
-
- **Production-Ready UI Elements:** Alert, Avatar, Button, Card, Checkbox, Dialog, Divider, Form Control, Icon, Input, Popover, Radio, Skeleton, Switch, Textarea
|
|
53
|
+
- **Production-Ready UI Elements:** Alert, Avatar, Badge, Button, Card, Checkbox, Dialog, Divider, Form Control, Icon, Input, Popover, Radio, Skeleton, Switch, Textarea
|
|
49
54
|
- **Zero Configuration:** Works with Angular 20+ out of the box
|
|
50
55
|
- **Complete Setup:** Each component includes unit tests, Storybook stories, and documentation
|
|
51
56
|
|
|
@@ -80,6 +85,8 @@ Unlike traditional UI libraries that give you `<library-button>` black boxes, @n
|
|
|
80
85
|
|
|
81
86
|
## 🚀 Quick Start
|
|
82
87
|
|
|
88
|
+
> 👀 **See it in action before installing:** [Live Storybook Demo](https://kstepien3.github.io/ng-zen/)
|
|
89
|
+
|
|
83
90
|
The fastest way to get started:
|
|
84
91
|
|
|
85
92
|
```bash
|
|
@@ -150,6 +157,7 @@ export class MyComponent {}
|
|
|
150
157
|
| ---------------- | -------------------------------- | ------------------------------------------------------------------------------ |
|
|
151
158
|
| **Avatar** | User profile images and initials | Image fallback, size variants, rounded styles |
|
|
152
159
|
| **Alert** | Informational messages | Customizable styles, dismissible options |
|
|
160
|
+
| **Badge** | Status indicators and labels | 6 variants, icons support, focus-visible ring |
|
|
153
161
|
| **Button** | Interactive buttons | Primary/secondary variants, loading states, icons |
|
|
154
162
|
| **Card** | Content container | Multi-slot projection (header, title, subtitle, footer), CSS custom properties |
|
|
155
163
|
| **Checkbox** | Form checkboxes | Indeterminate state, custom styling, validation |
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-zen/cli",
|
|
3
|
-
"version": "22.
|
|
4
|
-
"description": "Angular
|
|
3
|
+
"version": "22.3.0-next.1",
|
|
4
|
+
"description": "Angular CLI generator for creating fully customizable UI components.",
|
|
5
5
|
"license": "BSD-2-Clause",
|
|
6
6
|
"private": false,
|
|
7
7
|
"repository": {
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://kstepien3.github.io/ng-zen/",
|
|
20
20
|
"keywords": [
|
|
21
|
+
"shadcn",
|
|
22
|
+
"shadcn-ui",
|
|
23
|
+
"shadcn-angular",
|
|
21
24
|
"angular",
|
|
22
25
|
"angular-ui",
|
|
23
26
|
"ui-kit",
|
|
@@ -47,6 +50,7 @@
|
|
|
47
50
|
"ui components cli",
|
|
48
51
|
"alert",
|
|
49
52
|
"avatar",
|
|
53
|
+
"badge",
|
|
50
54
|
"button",
|
|
51
55
|
"card",
|
|
52
56
|
"checkbox",
|
|
@@ -66,7 +70,6 @@
|
|
|
66
70
|
},
|
|
67
71
|
"schematics": "./schematics/collection.json",
|
|
68
72
|
"packageManager": "pnpm@10.24.0",
|
|
69
|
-
"peerDependencies": {},
|
|
70
73
|
"dependencies": {
|
|
71
74
|
"@angular-devkit/core": "^22.0.1",
|
|
72
75
|
"@angular-devkit/schematics": "^22.0.1",
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
|
|
3
|
+
$transition-duration: var(--zen-transition-duration, 0.2s);
|
|
4
|
+
$outline: var(--zen-outline, 2px solid hsl(200deg 100% 50% / 50%));
|
|
5
|
+
|
|
6
|
+
:host {
|
|
7
|
+
--zen-badge-shadow: 0 1px 2px hsl(0deg 0% 0% / 8%);
|
|
8
|
+
--zen-badge-neutral: var(--zen-neutral, hsl(30deg 5% 10%));
|
|
9
|
+
--zen-badge-primary: var(--zen-primary, hsl(193deg 58% 34%));
|
|
10
|
+
--zen-badge-success: var(--zen-success, hsl(142deg 38% 36%));
|
|
11
|
+
--zen-badge-warning: var(--zen-warning, hsl(36deg 72% 46%));
|
|
12
|
+
--zen-badge-danger: var(--zen-danger, hsl(348deg 52% 42%));
|
|
13
|
+
--zen-badge-info: var(--zen-info, hsl(214deg 34% 46%));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
$colors: (
|
|
17
|
+
primary: var(--zen-badge-primary),
|
|
18
|
+
success: var(--zen-badge-success),
|
|
19
|
+
warning: var(--zen-badge-warning),
|
|
20
|
+
danger: var(--zen-badge-danger),
|
|
21
|
+
info: var(--zen-badge-info),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
// Ghost variant opacity levels
|
|
25
|
+
$ghost-hover-opacity: 10%;
|
|
26
|
+
$ghost-active-opacity: 20%;
|
|
27
|
+
|
|
28
|
+
:host {
|
|
29
|
+
--zen-badge-bg-color: var(--zen-badge-neutral);
|
|
30
|
+
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
height: 1rem;
|
|
35
|
+
width: fit-content;
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
gap: 0.25rem;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
border-radius: 625rem;
|
|
40
|
+
border: 1px solid transparent;
|
|
41
|
+
padding: 0.0625rem 0.5rem;
|
|
42
|
+
font-size: 0.75rem;
|
|
43
|
+
font-weight: 500;
|
|
44
|
+
line-height: 1;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
transition:
|
|
47
|
+
background-color $transition-duration ease,
|
|
48
|
+
color $transition-duration ease,
|
|
49
|
+
border-color $transition-duration ease;
|
|
50
|
+
user-select: none;
|
|
51
|
+
background-color: var(--zen-badge-bg-color);
|
|
52
|
+
color: var(--zen-badge-color, contrast-color(var(--zen-badge-bg-color)));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:host:focus-visible {
|
|
56
|
+
outline: $outline;
|
|
57
|
+
outline-offset: 2px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:host > ::ng-deep svg {
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
width: 0.75rem;
|
|
63
|
+
height: 0.75rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host([disabled]) {
|
|
67
|
+
opacity: 0.6;
|
|
68
|
+
pointer-events: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// --- COLORS ---
|
|
72
|
+
@each $name, $bg-color in $colors {
|
|
73
|
+
:host([data-color='#{$name}']) {
|
|
74
|
+
--zen-badge-bg-color: #{$bg-color};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// --- VARIANTS ---
|
|
79
|
+
|
|
80
|
+
/* Outline variant */
|
|
81
|
+
:host([data-variant='outline']) {
|
|
82
|
+
background-color: transparent;
|
|
83
|
+
color: var(--zen-badge-bg-color);
|
|
84
|
+
border-color: var(--zen-badge-bg-color);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Filled variant */
|
|
88
|
+
:host([data-variant='filled']) {
|
|
89
|
+
background-color: color-mix(in oklch, var(--zen-badge-bg-color) 8%, transparent);
|
|
90
|
+
color: var(--zen-badge-bg-color);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Ghost variant */
|
|
94
|
+
:host([data-variant='ghost']) {
|
|
95
|
+
background-color: transparent;
|
|
96
|
+
color: var(--zen-badge-bg-color);
|
|
97
|
+
box-shadow: none;
|
|
98
|
+
|
|
99
|
+
&:hover {
|
|
100
|
+
background-color: color-mix(in oklch, var(--zen-badge-bg-color) $ghost-hover-opacity, transparent);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&:active {
|
|
104
|
+
background-color: color-mix(in oklch, var(--zen-badge-bg-color) $ghost-active-opacity, transparent);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { provideZonelessChangeDetection } from '@angular/core';
|
|
2
|
+
import { TestBed } from '@angular/core/testing';
|
|
3
|
+
import { beforeEach, describe, expect, it } from 'vitest';
|
|
4
|
+
|
|
5
|
+
import { ZenBadge } from './badge';
|
|
6
|
+
|
|
7
|
+
describe('ZenBadge', () => {
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
imports: [ZenBadge],
|
|
11
|
+
providers: [provideZonelessChangeDetection()],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('should create', () => {
|
|
16
|
+
const fixture = TestBed.createComponent(ZenBadge);
|
|
17
|
+
const component = fixture.componentInstance;
|
|
18
|
+
expect(component).toBeTruthy();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should have default color neutral', () => {
|
|
22
|
+
const fixture = TestBed.createComponent(ZenBadge);
|
|
23
|
+
fixture.detectChanges();
|
|
24
|
+
const badge = fixture.nativeElement as HTMLElement;
|
|
25
|
+
expect(badge.getAttribute('data-color')).toBe('neutral');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('should have default variant solid', () => {
|
|
29
|
+
const fixture = TestBed.createComponent(ZenBadge);
|
|
30
|
+
fixture.detectChanges();
|
|
31
|
+
const badge = fixture.nativeElement as HTMLElement;
|
|
32
|
+
expect(badge.getAttribute('data-variant')).toBe('solid');
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const colors = ['neutral', 'primary', 'success', 'warning', 'danger', 'info'] as const;
|
|
36
|
+
|
|
37
|
+
for (const color of colors) {
|
|
38
|
+
it(`should apply color ${color}`, () => {
|
|
39
|
+
const fixture = TestBed.createComponent(ZenBadge);
|
|
40
|
+
fixture.componentRef.setInput('color', color);
|
|
41
|
+
fixture.detectChanges();
|
|
42
|
+
const badge = fixture.nativeElement as HTMLElement;
|
|
43
|
+
expect(badge.getAttribute('data-color')).toBe(color);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const variants = ['solid', 'outline', 'filled', 'ghost'] as const;
|
|
48
|
+
|
|
49
|
+
for (const variant of variants) {
|
|
50
|
+
it(`should apply variant ${variant}`, () => {
|
|
51
|
+
const fixture = TestBed.createComponent(ZenBadge);
|
|
52
|
+
fixture.componentRef.setInput('variant', variant);
|
|
53
|
+
fixture.detectChanges();
|
|
54
|
+
const badge = fixture.nativeElement as HTMLElement;
|
|
55
|
+
expect(badge.getAttribute('data-variant')).toBe(variant);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
});
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { FavouriteIcon } from '@hugeicons/core-free-icons';
|
|
2
|
+
import { argsToTemplate, Meta, moduleMetadata, StoryObj } from '@storybook/angular';
|
|
3
|
+
|
|
4
|
+
import { ZenIcon } from '../icon';
|
|
5
|
+
import { ZenBadge } from './badge';
|
|
6
|
+
|
|
7
|
+
interface StoryParams {
|
|
8
|
+
color: 'neutral' | 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
|
9
|
+
variant: 'solid' | 'filled' | 'outline' | 'ghost';
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type Options = ZenBadge & StoryParams;
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
title: 'Ui/Badge',
|
|
17
|
+
component: ZenBadge,
|
|
18
|
+
args: {
|
|
19
|
+
label: 'Badge',
|
|
20
|
+
color: 'neutral',
|
|
21
|
+
variant: 'solid',
|
|
22
|
+
},
|
|
23
|
+
argTypes: {
|
|
24
|
+
label: {
|
|
25
|
+
control: 'text',
|
|
26
|
+
table: {
|
|
27
|
+
category: 'story parameters',
|
|
28
|
+
type: {
|
|
29
|
+
summary: 'ng-content',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
color: {
|
|
34
|
+
control: 'select',
|
|
35
|
+
options: ['neutral', 'primary', 'success', 'warning', 'danger', 'info'],
|
|
36
|
+
},
|
|
37
|
+
variant: {
|
|
38
|
+
control: 'select',
|
|
39
|
+
options: ['solid', 'filled', 'outline', 'ghost'],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
render: ({ label, ...args }) => ({
|
|
43
|
+
props: args,
|
|
44
|
+
template: `<zen-badge ${argsToTemplate(args)}>${label}</zen-badge>`,
|
|
45
|
+
}),
|
|
46
|
+
} satisfies Meta<Options>;
|
|
47
|
+
|
|
48
|
+
type Story = StoryObj<Options>;
|
|
49
|
+
|
|
50
|
+
export const Default: Story = {};
|
|
51
|
+
|
|
52
|
+
export const WithIcon: Story = {
|
|
53
|
+
decorators: [moduleMetadata({ imports: [ZenIcon] })],
|
|
54
|
+
render: () => ({
|
|
55
|
+
props: { FavouriteIcon },
|
|
56
|
+
template: `
|
|
57
|
+
<div style="display: flex; gap: 0.5rem; flex-wrap: wrap">
|
|
58
|
+
<zen-badge color="primary">
|
|
59
|
+
<zen-icon [icon]="FavouriteIcon" [size]="12" [strokeWidth]="3" />
|
|
60
|
+
With Icon
|
|
61
|
+
</zen-badge>
|
|
62
|
+
<zen-badge variant="outline" color="primary">
|
|
63
|
+
<zen-icon [icon]="FavouriteIcon" [size]="12" [strokeWidth]="3" />
|
|
64
|
+
Outline
|
|
65
|
+
</zen-badge>
|
|
66
|
+
</div>
|
|
67
|
+
`,
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const AllVariants: Story = {
|
|
72
|
+
render: () => ({
|
|
73
|
+
template: `
|
|
74
|
+
<div style="display: flex; gap: 0.5rem">
|
|
75
|
+
<zen-badge variant="solid">Solid</zen-badge>
|
|
76
|
+
<zen-badge variant="filled">Filled</zen-badge>
|
|
77
|
+
<zen-badge variant="outline">Outline</zen-badge>
|
|
78
|
+
<zen-badge variant="ghost">Ghost</zen-badge>
|
|
79
|
+
</div>
|
|
80
|
+
`,
|
|
81
|
+
}),
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const AllColorVariants: Story = {
|
|
85
|
+
render: () => ({
|
|
86
|
+
template: `
|
|
87
|
+
<div style="display: flex; flex-direction: column; gap: 1rem;">
|
|
88
|
+
<!-- Default (No color attribute) -->
|
|
89
|
+
<div style="display: flex; gap: 0.5rem;">
|
|
90
|
+
<zen-badge variant="solid">Solid</zen-badge>
|
|
91
|
+
<zen-badge variant="filled">Filled</zen-badge>
|
|
92
|
+
<zen-badge variant="outline">Outline</zen-badge>
|
|
93
|
+
<zen-badge variant="ghost">Ghost</zen-badge>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<!-- Primary -->
|
|
97
|
+
<div style="display: flex; gap: 0.5rem;">
|
|
98
|
+
<zen-badge color="primary" variant="solid">Solid</zen-badge>
|
|
99
|
+
<zen-badge color="primary" variant="filled">Filled</zen-badge>
|
|
100
|
+
<zen-badge color="primary" variant="outline">Outline</zen-badge>
|
|
101
|
+
<zen-badge color="primary" variant="ghost">Ghost</zen-badge>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<!-- Success -->
|
|
105
|
+
<div style="display: flex; gap: 0.5rem;">
|
|
106
|
+
<zen-badge color="success" variant="solid">Solid</zen-badge>
|
|
107
|
+
<zen-badge color="success" variant="filled">Filled</zen-badge>
|
|
108
|
+
<zen-badge color="success" variant="outline">Outline</zen-badge>
|
|
109
|
+
<zen-badge color="success" variant="ghost">Ghost</zen-badge>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<!-- Warning -->
|
|
113
|
+
<div style="display: flex; gap: 0.5rem;">
|
|
114
|
+
<zen-badge color="warning" variant="solid">Solid</zen-badge>
|
|
115
|
+
<zen-badge color="warning" variant="filled">Filled</zen-badge>
|
|
116
|
+
<zen-badge color="warning" variant="outline">Outline</zen-badge>
|
|
117
|
+
<zen-badge color="warning" variant="ghost">Ghost</zen-badge>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
<!-- Danger -->
|
|
121
|
+
<div style="display: flex; gap: 0.5rem;">
|
|
122
|
+
<zen-badge color="danger" variant="solid">Solid</zen-badge>
|
|
123
|
+
<zen-badge color="danger" variant="filled">Filled</zen-badge>
|
|
124
|
+
<zen-badge color="danger" variant="outline">Outline</zen-badge>
|
|
125
|
+
<zen-badge color="danger" variant="ghost">Ghost</zen-badge>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
<!-- Info -->
|
|
129
|
+
<div style="display: flex; gap: 0.5rem;">
|
|
130
|
+
<zen-badge color="info" variant="solid">Solid</zen-badge>
|
|
131
|
+
<zen-badge color="info" variant="filled">Filled</zen-badge>
|
|
132
|
+
<zen-badge color="info" variant="outline">Outline</zen-badge>
|
|
133
|
+
<zen-badge color="info" variant="ghost">Ghost</zen-badge>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
`,
|
|
137
|
+
}),
|
|
138
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Component, input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'zen-badge',
|
|
5
|
+
template: '<ng-content />',
|
|
6
|
+
styleUrl: './badge.scss',
|
|
7
|
+
host: {
|
|
8
|
+
'[attr.data-color]': 'color()',
|
|
9
|
+
'[attr.data-variant]': 'variant()',
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
export class ZenBadge {
|
|
13
|
+
readonly color = input<'neutral' | 'primary' | 'success' | 'warning' | 'danger' | 'info'>('neutral');
|
|
14
|
+
readonly variant = input<'solid' | 'outline' | 'filled' | 'ghost'>('solid');
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './badge';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Meta, moduleMetadata, StoryObj } from '@storybook/angular';
|
|
2
2
|
|
|
3
3
|
import { ZenButton } from '../button';
|
|
4
|
+
import { ZenInput } from '../input';
|
|
4
5
|
import { ZenCard } from './card';
|
|
5
6
|
|
|
6
7
|
interface StoryParams {
|
|
@@ -14,7 +15,7 @@ type Options = ZenCard & StoryParams;
|
|
|
14
15
|
export default {
|
|
15
16
|
title: 'Ui/Card',
|
|
16
17
|
component: ZenCard,
|
|
17
|
-
decorators: [moduleMetadata({ imports: [ZenButton] })],
|
|
18
|
+
decorators: [moduleMetadata({ imports: [ZenButton, ZenInput] })],
|
|
18
19
|
args: {
|
|
19
20
|
content: 'This is the card content.',
|
|
20
21
|
title: 'Card Title',
|
|
@@ -122,8 +123,8 @@ export const LoginForm: Story = {
|
|
|
122
123
|
<h3 card-title>Login to your account</h3>
|
|
123
124
|
<p card-subtitle>Enter your email below to login to your account</p>
|
|
124
125
|
<div style="display: grid; gap: 0.75rem;">
|
|
125
|
-
<input type="email" placeholder="Email"
|
|
126
|
-
<input type="password" placeholder="Password"
|
|
126
|
+
<zen-input type="email" placeholder="Email" />
|
|
127
|
+
<zen-input type="password" placeholder="Password" />
|
|
127
128
|
<a href="#" style="font-size: 0.75rem; color: hsl(0deg 0% 40%); text-align: right;">Forgot your password?</a>
|
|
128
129
|
</div>
|
|
129
130
|
<div card-footer style="display: flex; flex-direction: column; gap: 0.5rem;">
|
|
@@ -10,6 +10,11 @@ $error: var(--zen-error, hsl(0deg 70% 50%));
|
|
|
10
10
|
--zen-input-placeholder-color: hsl(0deg 0% 60%);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/* stylelint-disable-next-line no-duplicate-selectors -- separate variables and styles */
|
|
14
|
+
:host {
|
|
15
|
+
display: contents;
|
|
16
|
+
}
|
|
17
|
+
|
|
13
18
|
input {
|
|
14
19
|
border: var(--zen-input-border);
|
|
15
20
|
border-radius: var(--zen-input-border-radius);
|
|
@@ -1 +1 @@
|
|
|
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"]}
|
|
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 | 'badge'\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"]}
|