@ng-zen/cli 20.2.1 → 20.3.0-next.2

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 CHANGED
@@ -1,3 +1,29 @@
1
+ ## [20.3.0-next.2](https://github.com/kstepien3/ng-zen/compare/v20.3.0-next.1...v20.3.0-next.2) (2025-09-11)
2
+
3
+ ### 🛠️ Code Refactor
4
+
5
+ * **input:** improve css variables ([#314](https://github.com/kstepien3/ng-zen/issues/314)) ([58cdbb3](https://github.com/kstepien3/ng-zen/commit/58cdbb3bafb9c10057b75d73c7234247e519c97e))
6
+ * **skeleton:** improve css variables ([#313](https://github.com/kstepien3/ng-zen/issues/313)) ([9f0c8fd](https://github.com/kstepien3/ng-zen/commit/9f0c8fd1b23172fa5bb9bf9f42b6739c7b232876))
7
+
8
+ ### 📚 Documentation
9
+
10
+ * **textarea:** update jsdoc about css variables ([#311](https://github.com/kstepien3/ng-zen/issues/311)) ([6ceabb5](https://github.com/kstepien3/ng-zen/commit/6ceabb58e6549e87bdbbe3b3b2f6e2e0928ab49b))
11
+
12
+ ## [20.3.0-next.1](https://github.com/kstepien3/ng-zen/compare/v20.2.1...v20.3.0-next.1) (2025-09-09)
13
+
14
+ ### 🚀 New Features
15
+
16
+ * **switch:** add animations ([#303](https://github.com/kstepien3/ng-zen/issues/303)) ([6b48d4f](https://github.com/kstepien3/ng-zen/commit/6b48d4f39db1e5bfe22920fa749b652ac65e4432))
17
+
18
+ ### 🛠️ Code Refactor
19
+
20
+ * **switch:** improve styles, css variables ([#304](https://github.com/kstepien3/ng-zen/issues/304)) ([3c04b87](https://github.com/kstepien3/ng-zen/commit/3c04b8754cd25af8cfc0c0ffa89ac8633de33145))
21
+ * **textarea:** improve css variables ([#305](https://github.com/kstepien3/ng-zen/issues/305)) ([a9b412c](https://github.com/kstepien3/ng-zen/commit/a9b412c8ab1f77ba3d602384c963aade62308e6b))
22
+
23
+ ### 📚 Documentation
24
+
25
+ * **README.md:** fix links ([#302](https://github.com/kstepien3/ng-zen/issues/302)) ([089587c](https://github.com/kstepien3/ng-zen/commit/089587c2ecbb8c27492bc34abd4896e7842e7d04))
26
+
1
27
  ## [20.2.1](https://github.com/kstepien3/ng-zen/compare/v20.2.0...v20.2.1) (2025-09-01)
2
28
 
3
29
  ### 🐛 Bug Fixes
package/README.md CHANGED
@@ -250,9 +250,9 @@ export class LoginComponent {}
250
250
  ## 📚 Documentation
251
251
 
252
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
253
+ - **🔧 [Development Guide](https://github.com/kstepien3/ng-zen/blob/master/DEVELOPMENT.md)** - Setup and contribution workflow
254
+ - **🤝 [Contributing Guide](https://github.com/kstepien3/ng-zen/blob/master/CONTRIBUTING.md)** - How to contribute to the project
255
+ - **📝 [Changelog](https://github.com/kstepien3/ng-zen/blob/master/CHANGELOG.md)** - Version history and breaking changes
256
256
  - **💬 Component READMEs** - Detailed docs generated with each component
257
257
 
258
258
  ## 🚧 Project Status
@@ -284,14 +284,14 @@ We welcome contributions! Whether it's:
284
284
 
285
285
  **Getting Started:**
286
286
 
287
- 1. Read our [Contributing Guidelines](CONTRIBUTING.md)
288
- 2. Check the [Development Setup](DEVELOPMENT.md)
287
+ 1. Read our [Contributing Guidelines](https://github.com/kstepien3/ng-zen/blob/master/CONTRIBUTING.md)
288
+ 2. Check the [Development Setup](https://github.com/kstepien3/ng-zen/blob/master/DEVELOPMENT.md)
289
289
  3. Browse [open issues](https://github.com/kstepien3/ng-zen/issues)
290
290
  4. Join the discussion!
291
291
 
292
292
  ## License
293
293
 
294
- This project is licensed under the [BSD 2-Clause License](LICENSE) 📜.
294
+ This project is licensed under the [BSD 2-Clause License](https://github.com/kstepien3/ng-zen/blob/master/LICENSE) 📜.
295
295
 
296
296
  ## Author
297
297
 
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@ng-zen/cli",
3
- "version": "20.2.1",
3
+ "version": "20.3.0-next.2",
4
4
  "description": "A CLI tool for generating customizable, modern Angular UI components using schematics.",
5
5
  "license": "BSD-2-Clause",
6
6
  "private": false,
7
7
  "repository": {
8
- "url": "https://github.com/kstepien3/ng-zen"
8
+ "url": "git+https://github.com/kstepien3/ng-zen.git"
9
9
  },
10
10
  "bugs": {
11
11
  "url": "https://github.com/kstepien3/ng-zen/issues"
@@ -1,33 +1,34 @@
1
- // Component Variables
2
- $border: var(--zen-input-border, 1px solid hsl(0deg 0% 80%));
3
- $border-radius: var(--zen-input-border-radius, 8px);
4
- $padding: var(--zen-input-padding, 0.5rem 1rem);
5
- $focus-shadow: var(--zen-input-focus-shadow, 0 1px 4px hsl(0deg 0% 60% / 20%) inset);
6
- $placeholder-color: var(--zen-input-placeholder-color, hsl(0deg 0% 60%));
7
-
8
- // Color Palette
1
+ // Globals
9
2
  $outline: var(--zen-outline, 2px solid hsl(200deg 100% 50% / 50%));
10
3
  $error: var(--zen-error, hsl(0deg 70% 50%));
11
4
 
5
+ :host {
6
+ --zen-input-border: 1px solid hsl(0deg 0% 80%);
7
+ --zen-input-border-radius: 8px;
8
+ --zen-input-padding: 0.5rem 1rem;
9
+ --zen-input-focus-shadow: 0 1px 4px hsl(0deg 0% 60% / 20%) inset;
10
+ --zen-input-placeholder-color: hsl(0deg 0% 60%);
11
+ }
12
+
12
13
  input {
13
- border: $border;
14
- border-radius: $border-radius;
15
- padding: $padding;
14
+ border: var(--zen-input-border);
15
+ border-radius: var(--zen-input-border-radius);
16
+ padding: var(--zen-input-padding);
16
17
 
17
18
  &:disabled {
18
19
  opacity: 0.6;
19
20
  }
20
21
 
21
22
  &:focus-visible {
22
- outline: $outline;
23
- box-shadow: $focus-shadow;
23
+ outline: var(--zen-outline);
24
+ box-shadow: var(--zen-input-focus-shadow);
24
25
  }
25
26
 
26
27
  &:user-invalid {
27
- border-color: $error;
28
+ border-color: var(--zen-error);
28
29
  }
29
30
 
30
31
  &::placeholder {
31
- color: $placeholder-color;
32
+ color: var(--zen-input-placeholder-color);
32
33
  }
33
34
  }
@@ -1,13 +1,16 @@
1
- $background: var(--zen-skeleton-background, hsl(0deg 0% 80%));
2
- $radius: var(--zen-skeleton-border-radius, 0.5rem);
3
- $animation-duration: var(--zen-skeleton-animation-duration, 1.6s);
1
+ :host {
2
+ --zen-skeleton-background: hsl(0deg 0% 80%);
3
+ --zen-skeleton-border-radius: 0.5rem;
4
+ --zen-skeleton-animation-duration: 1.6s;
5
+ }
4
6
 
7
+ /* stylelint-disable-next-line no-duplicate-selectors -- separate variables and styles */
5
8
  :host {
6
- background: $background;
9
+ background: var(--zen-skeleton-background);
10
+ border-radius: var(--zen-skeleton-border-radius);
7
11
  display: inline-block;
8
12
  min-height: 1rem;
9
13
  min-width: 1rem;
10
- border-radius: $radius;
11
14
  position: relative;
12
15
  overflow: hidden;
13
16
 
@@ -29,7 +32,7 @@ $animation-duration: var(--zen-skeleton-animation-duration, 1.6s);
29
32
  transparent 100%
30
33
  );
31
34
  transform: translateX(-100%);
32
- animation: shimmer $animation-duration ease-in-out infinite;
35
+ animation: shimmer var(--zen-skeleton-animation-duration) ease-in-out infinite;
33
36
  }
34
37
 
35
38
  &[rounded] {
@@ -46,7 +49,7 @@ $animation-duration: var(--zen-skeleton-animation-duration, 1.6s);
46
49
  }
47
50
 
48
51
  // Subtle pulse animation as fallback
49
- animation: pulse $animation-duration ease-in-out infinite alternate;
52
+ animation: pulse var(--zen-skeleton-animation-duration) ease-in-out infinite alternate;
50
53
  }
51
54
  }
52
55
 
@@ -1,63 +1,82 @@
1
+ // Globals
1
2
  $outline: var(--zen-outline, 2px solid hsl(200deg 100% 50% / 50%));
2
- $transition-duration: 0.15s;
3
- $placeholder-color: var(--zen-input-placeholder-color, hsl(0deg 0% 60%));
4
- $size: var(--zen-switch-size, 16px);
5
- $margin: var(--zen-switch-margin, 2px);
6
- $width: var(--zen-switch-width, 30px);
7
- $right-end: calc(#{$width} - #{$size} - #{$margin} * 2);
8
- $height: calc(#{$size} + #{$margin} * 2);
3
+ $transition-duration: var(--zen-transition-duration-quick, 0.1s);
4
+ $placeholder-color: var(--zen-placeholder-color, hsl(0deg 0% 60%));
5
+ $focus-shadow: var(--zen-focus-shadow, 0 1px 4px hsl(0deg 0% 60% / 20%) inset);
6
+ $appearance: var(--zen-appearance, hsl(0deg 0% 10%));
9
7
 
10
8
  :host {
9
+ --zen-switch-thumb-size: 1rem;
10
+ --zen-switch-height: 1.25rem;
11
+ --zen-switch-width: 2rem;
12
+ --zen-switch-apperance: #{$appearance};
13
+ --zen-switch-background: hsl(0deg 0% 80%);
14
+ }
15
+
16
+ /* stylelint-disable-next-line no-duplicate-selectors -- separate variables and styles */
17
+ :host {
18
+ $thumb-x-center-position: calc(var(--zen-switch-height) / 2 - var(--zen-switch-thumb-size) / 2);
19
+
20
+ background: var(--zen-switch-background);
21
+ height: var(--zen-switch-height);
22
+ width: var(--zen-switch-width);
11
23
  cursor: pointer;
12
- background: hsl(0deg 0% 80%);
13
24
  border-radius: 9999px;
14
- width: $width;
15
- height: $height;
16
25
  position: relative;
17
- display: block;
18
- transition:
19
- background-color ease,
20
- border-color ease;
21
- transition-duration: $transition-duration;
22
- vertical-align: middle;
26
+ display: flex;
27
+ place-items: center;
23
28
  user-select: none;
24
29
 
25
- .switch-handle {
26
- display: grid;
30
+ // Animation
31
+ transition-property: background-color, border-color;
32
+ transition-duration: $transition-duration;
33
+ transition-timing-function: ease;
34
+
35
+ .thumb {
36
+ height: var(--zen-switch-thumb-size);
37
+ width: var(--zen-switch-thumb-size);
27
38
  position: absolute;
28
- height: $size;
29
- width: $size;
30
39
  background-color: white;
31
40
  border-radius: 9999px;
32
- font-size: 12px;
33
- justify-content: center;
34
- place-items: center;
35
- color: $placeholder-color;
36
- margin: 2px;
37
- animation-fill-mode: revert;
38
- transition: width ease;
41
+
42
+ // Animation
43
+ transition-property: left, transform, width;
44
+ transition-timing-function: ease;
39
45
  transition-duration: $transition-duration;
40
- }
46
+ left: $thumb-x-center-position;
47
+ transform: translateX(0);
41
48
 
42
- &:active .switch-handle {
43
- width: calc(#{$size} + 2px);
49
+ &:not(:empty) {
50
+ // Handle content
51
+ display: grid;
52
+ font-size: small;
53
+ justify-content: center;
54
+ place-items: center;
55
+ color: $placeholder-color;
56
+ }
44
57
  }
45
58
 
46
59
  &:focus-visible {
47
60
  outline: $outline;
61
+ box-shadow: $focus-shadow;
48
62
  }
49
63
 
50
64
  &[data-checked='true'] {
51
- background-color: hsl(0deg 0% 10%);
65
+ background-color: var(--zen-switch-apperance);
52
66
 
53
- .switch-handle {
54
- color: hsl(0deg 0% 10%);
55
- right: 0;
67
+ .thumb {
68
+ left: 100%;
69
+ color: var(--zen-switch-apperance);
70
+ transform: translateX(calc(-100% - #{$thumb-x-center-position}));
56
71
  }
57
72
  }
58
73
 
59
74
  &[data-disabled='true'] {
60
- pointer-events: none;
75
+ cursor: not-allowed;
61
76
  opacity: 0.6;
62
77
  }
78
+
79
+ &:active:not([data-disabled='true']) .thumb {
80
+ width: calc(var(--zen-switch-thumb-size) + 2px);
81
+ }
63
82
  }
@@ -35,7 +35,7 @@ import { ZenFormControl, ZenFormControlProvider } from '../form-control';
35
35
  @Component({
36
36
  selector: 'zen-switch',
37
37
  template: `
38
- <span class="switch-handle">
38
+ <span class="thumb">
39
39
  <!-- @if (value()) { ✓ } -->
40
40
  <!-- @if (!value()) { ─ } -->
41
41
  </span>
@@ -45,6 +45,7 @@ import { ZenFormControl, ZenFormControlProvider } from '../form-control';
45
45
  providers: [ZenFormControlProvider(ZenSwitch)],
46
46
  host: {
47
47
  tabindex: '0',
48
+ role: 'switch',
48
49
  '[attr.data-disabled]': 'disabled()',
49
50
  '[attr.data-checked]': 'value()',
50
51
  '(blur)': 'onTouched()',
@@ -1,18 +1,20 @@
1
- // Component Variables
2
- $border: var(--zen-input-border, 1px solid hsl(0deg 0% 80%));
3
- $border-radius: var(--zen-input-border-radius, 8px);
4
- $padding: var(--zen-input-padding, 0.5rem 1rem);
5
- $focus-shadow: var(--zen-input-focus-shadow, 0 1px 4px hsl(0deg 0% 60% / 20%) inset);
6
- $placeholder-color: var(--zen-input-placeholder-color, hsl(0deg 0% 60%));
7
-
8
- // Color Palette
1
+ // Globals
2
+ $focus-shadow: var(--zen-focus-shadow, 0 1px 4px hsl(0deg 0% 60% / 20%) inset);
9
3
  $outline: var(--zen-outline, 2px solid hsl(200deg 100% 50% / 50%));
10
4
  $error: var(--zen-error, hsl(0deg 70% 50%));
11
5
 
12
6
  :host {
13
- border: $border;
14
- border-radius: $border-radius;
15
- padding: $padding;
7
+ --zen-textarea-border: var(--zen-input-border, 1px solid hsl(0deg 0% 80%));
8
+ --zen-textarea-border-radius: var(--zen-input-border-radius, 8px);
9
+ --zen-textarea-padding: var(--zen-input-padding, 0.5rem 1rem);
10
+ --zen-textarea-placeholder-color: var(--zen-input-placeholder-color, hsl(0deg 0% 60%));
11
+ }
12
+
13
+ /* stylelint-disable-next-line no-duplicate-selectors -- separate variables and styles */
14
+ :host {
15
+ border: var(--zen-textarea-border);
16
+ border-radius: var(--zen-textarea-border-radius);
17
+ padding: var(--zen-textarea-padding);
16
18
 
17
19
  &[autoresize] {
18
20
  field-sizing: content;
@@ -33,6 +35,6 @@ $error: var(--zen-error, hsl(0deg 70% 50%));
33
35
  }
34
36
 
35
37
  &::placeholder {
36
- color: $placeholder-color;
38
+ color: var(--zen-textarea-placeholder-color);
37
39
  }
38
40
  }
@@ -13,11 +13,10 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
13
13
  *
14
14
  * ```css
15
15
  * :root {
16
- * --zen-input-border: 1px solid hsl(0deg 0% 80%);
17
- * --zen-input-border-radius: 8px;
18
- * --zen-input-padding: 0.5rem 1rem;
19
- * --zen-input-focus-shadow: 0 1px 4px hsl(0deg 0% 60% / 20%) inset;
20
- * --zen-input-placeholder-color: hsl(0deg 0% 60%);
16
+ * --zen-textarea-border: var(--zen-input-border, 1px solid hsl(0deg 0% 80%));
17
+ * --zen-textarea-border-radius: var(--zen-input-border-radius, 8px);
18
+ * --zen-textarea-padding: var(--zen-input-padding, 0.5rem 1rem);
19
+ * --zen-textarea-placeholder-color: var(--zen-input-placeholder-color, hsl(0deg 0% 60%));
21
20
  * }
22
21
  * ```
23
22
  *