@ng-zen/cli 20.2.1 → 20.3.0-next.3
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 +39 -0
- package/README.md +6 -6
- package/package.json +2 -2
- package/schematics/components/files/avatar/avatar.scss +12 -9
- package/schematics/components/files/button/button.scss +15 -10
- package/schematics/components/files/checkbox/checkbox.scss +33 -33
- package/schematics/components/files/checkbox/checkbox.ts +2 -3
- package/schematics/components/files/divider/divider.scss +17 -14
- package/schematics/components/files/divider/divider.ts +1 -12
- package/schematics/components/files/input/input.scss +14 -13
- package/schematics/components/files/skeleton/skeleton.scss +10 -7
- package/schematics/components/files/switch/switch.scss +54 -35
- package/schematics/components/files/switch/switch.ts +2 -1
- package/schematics/components/files/textarea/textarea.scss +14 -12
- package/schematics/components/files/textarea/textarea.ts +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
|
+
## [20.3.0-next.3](https://github.com/kstepien3/ng-zen/compare/v20.3.0-next.2...v20.3.0-next.3) (2025-09-15)
|
|
2
|
+
|
|
3
|
+
### 🐛 Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **avatar:** improve css variables ([#323](https://github.com/kstepien3/ng-zen/issues/323)) ([eef614a](https://github.com/kstepien3/ng-zen/commit/eef614a0e2060fe32f72e00809b66009ae24832f))
|
|
6
|
+
* **input:** resolve problem with wrong variables ([#322](https://github.com/kstepien3/ng-zen/issues/322)) ([30f5d10](https://github.com/kstepien3/ng-zen/commit/30f5d10c4c559f01ed3445b77e174340b4f2fb6f))
|
|
7
|
+
|
|
8
|
+
### 🛠️ Code Refactor
|
|
9
|
+
|
|
10
|
+
* **button:** improve css variables ([#321](https://github.com/kstepien3/ng-zen/issues/321)) ([4ed1310](https://github.com/kstepien3/ng-zen/commit/4ed1310450dde749164c419ec6b5da0a4fbb98bc))
|
|
11
|
+
* **checkbox:** improve css variables ([#317](https://github.com/kstepien3/ng-zen/issues/317)) ([bbe1437](https://github.com/kstepien3/ng-zen/commit/bbe143704163394a9c9ce446aa9d749a57f9c62c))
|
|
12
|
+
* **divider:** improve css variables ([#316](https://github.com/kstepien3/ng-zen/issues/316)) ([7a19ce7](https://github.com/kstepien3/ng-zen/commit/7a19ce72db58e8d23a4786aae2787db6bcfdbf6d))
|
|
13
|
+
|
|
14
|
+
## [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)
|
|
15
|
+
|
|
16
|
+
### 🛠️ Code Refactor
|
|
17
|
+
|
|
18
|
+
* **input:** improve css variables ([#314](https://github.com/kstepien3/ng-zen/issues/314)) ([58cdbb3](https://github.com/kstepien3/ng-zen/commit/58cdbb3bafb9c10057b75d73c7234247e519c97e))
|
|
19
|
+
* **skeleton:** improve css variables ([#313](https://github.com/kstepien3/ng-zen/issues/313)) ([9f0c8fd](https://github.com/kstepien3/ng-zen/commit/9f0c8fd1b23172fa5bb9bf9f42b6739c7b232876))
|
|
20
|
+
|
|
21
|
+
### 📚 Documentation
|
|
22
|
+
|
|
23
|
+
* **textarea:** update jsdoc about css variables ([#311](https://github.com/kstepien3/ng-zen/issues/311)) ([6ceabb5](https://github.com/kstepien3/ng-zen/commit/6ceabb58e6549e87bdbbe3b3b2f6e2e0928ab49b))
|
|
24
|
+
|
|
25
|
+
## [20.3.0-next.1](https://github.com/kstepien3/ng-zen/compare/v20.2.1...v20.3.0-next.1) (2025-09-09)
|
|
26
|
+
|
|
27
|
+
### 🚀 New Features
|
|
28
|
+
|
|
29
|
+
* **switch:** add animations ([#303](https://github.com/kstepien3/ng-zen/issues/303)) ([6b48d4f](https://github.com/kstepien3/ng-zen/commit/6b48d4f39db1e5bfe22920fa749b652ac65e4432))
|
|
30
|
+
|
|
31
|
+
### 🛠️ Code Refactor
|
|
32
|
+
|
|
33
|
+
* **switch:** improve styles, css variables ([#304](https://github.com/kstepien3/ng-zen/issues/304)) ([3c04b87](https://github.com/kstepien3/ng-zen/commit/3c04b8754cd25af8cfc0c0ffa89ac8633de33145))
|
|
34
|
+
* **textarea:** improve css variables ([#305](https://github.com/kstepien3/ng-zen/issues/305)) ([a9b412c](https://github.com/kstepien3/ng-zen/commit/a9b412c8ab1f77ba3d602384c963aade62308e6b))
|
|
35
|
+
|
|
36
|
+
### 📚 Documentation
|
|
37
|
+
|
|
38
|
+
* **README.md:** fix links ([#302](https://github.com/kstepien3/ng-zen/issues/302)) ([089587c](https://github.com/kstepien3/ng-zen/commit/089587c2ecbb8c27492bc34abd4896e7842e7d04))
|
|
39
|
+
|
|
1
40
|
## [20.2.1](https://github.com/kstepien3/ng-zen/compare/v20.2.0...v20.2.1) (2025-09-01)
|
|
2
41
|
|
|
3
42
|
### 🐛 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.
|
|
3
|
+
"version": "20.3.0-next.3",
|
|
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,20 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
:host {
|
|
2
|
+
--zen-avatar-size: 2rem;
|
|
3
|
+
--zen-avatar-bg-color: hsl(0deg 0% 80%);
|
|
4
|
+
--zen-avatar-color: hsl(0deg 0% 20%);
|
|
5
|
+
--zen-avatar-font-size: small;
|
|
6
|
+
}
|
|
5
7
|
|
|
8
|
+
/* stylelint-disable-next-line no-duplicate-selectors -- separate variables and styles */
|
|
6
9
|
:host {
|
|
10
|
+
height: var(--zen-avatar-size);
|
|
11
|
+
width: var(--zen-avatar-size);
|
|
7
12
|
display: flex;
|
|
8
|
-
height: $size;
|
|
9
|
-
width: $size;
|
|
10
13
|
border-radius: 50%;
|
|
11
14
|
overflow: hidden;
|
|
12
15
|
position: relative;
|
|
13
16
|
|
|
14
17
|
// Content styles
|
|
15
|
-
background-color:
|
|
16
|
-
color:
|
|
17
|
-
font-size:
|
|
18
|
+
background-color: var(--zen-avatar-bg-color);
|
|
19
|
+
color: var(--zen-avatar-color);
|
|
20
|
+
font-size: var(--zen-avatar-font-size);
|
|
18
21
|
justify-content: center;
|
|
19
22
|
align-items: center;
|
|
20
23
|
font-weight: bold;
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
$bg-color: var(--zen-button-bg-color, hsl(0deg 0% 0%));
|
|
3
|
-
$color: var(--zen-button-color, hsl(0deg 0% 100%));
|
|
4
|
-
$padding: var(--zen-button-padding, 0.5rem 1rem);
|
|
5
|
-
$shadow: var(--zen-button-shadow, 0 2px 4px hsl(0deg 0% 0% / 10%));
|
|
1
|
+
// Globals
|
|
6
2
|
$transition-duration: var(--zen-transition-duration, 0.4s);
|
|
7
3
|
$outline: var(--zen-outline, 2px solid hsl(200deg 100% 50% / 50%));
|
|
8
4
|
|
|
9
5
|
:host {
|
|
6
|
+
--zen-button-padding: 0.5rem 1rem;
|
|
7
|
+
--zen-button-bg-color: hsl(0deg 0% 0%);
|
|
8
|
+
--zen-button-bg-color-hover: hsl(0deg 0% 20%);
|
|
9
|
+
--zen-button-color: hsl(0deg 0% 100%);
|
|
10
|
+
--zen-button-shadow: 0 2px 4px hsl(0deg 0% 0% / 10%);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* stylelint-disable-next-line no-duplicate-selectors -- separate variables and styles */
|
|
14
|
+
:host {
|
|
15
|
+
padding: var(--zen-button-padding);
|
|
16
|
+
background-color: var(--zen-button-bg-color);
|
|
17
|
+
color: var(--zen-button-color);
|
|
18
|
+
box-shadow: var(--zen-button-shadow);
|
|
10
19
|
display: inline-block;
|
|
11
20
|
font-size: 14px;
|
|
12
21
|
font-weight: bold;
|
|
13
22
|
text-align: center;
|
|
14
23
|
cursor: pointer;
|
|
15
24
|
border: none;
|
|
16
|
-
padding: $padding;
|
|
17
25
|
border-radius: 99999px;
|
|
18
26
|
transition-property: background-color, opacity;
|
|
19
27
|
transition-duration: $transition-duration;
|
|
20
28
|
transition-timing-function: ease;
|
|
21
|
-
background-color: $bg-color;
|
|
22
|
-
color: $color;
|
|
23
|
-
box-shadow: $shadow;
|
|
24
29
|
text-decoration: none;
|
|
25
30
|
overflow: hidden;
|
|
26
31
|
position: relative;
|
|
@@ -28,7 +33,7 @@ $outline: var(--zen-outline, 2px solid hsl(200deg 100% 50% / 50%));
|
|
|
28
33
|
|
|
29
34
|
/* Hover state */
|
|
30
35
|
:host:hover {
|
|
31
|
-
background-color:
|
|
36
|
+
background-color: var(--zen-button-bg-color-hover);
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
/* Focus state */
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
//
|
|
2
|
-
$size: var(--zen-checkbox-size, 16px);
|
|
3
|
-
$border-radius: var(--zen-checkbox-border-radius, 6px);
|
|
4
|
-
$focus-shadow: var(--zen-checkbox-focus-shadow, 0 1px 4px hsl(0deg 0% 60% / 20%) inset);
|
|
5
|
-
|
|
6
|
-
// Color Palette
|
|
7
|
-
$appearance: var(--zen-checkbox-appearance, hsl(0deg 0% 10%));
|
|
8
|
-
$disabled-opacity: var(--zen-checkbox-disabled-opacity, 0.6);
|
|
9
|
-
$border: var(--zen-checkbox-border, 1px solid hsl(0deg 0% 80%));
|
|
1
|
+
// Globals
|
|
10
2
|
$error: var(--zen-error, hsl(0deg 70% 50%));
|
|
3
|
+
$focus-shadow: var(--zen-focus-shadow, 0 1px 4px hsl(0deg 0% 60% / 20%) inset);
|
|
11
4
|
$outline: var(--zen-outline, 2px solid hsl(200deg 100% 50% / 50%));
|
|
12
|
-
|
|
13
|
-
// Animations
|
|
14
5
|
$transition-duration: var(--zen-transition-duration, 0.2s);
|
|
15
6
|
|
|
7
|
+
:host {
|
|
8
|
+
--zen-checkbox-size: 1rem;
|
|
9
|
+
--zen-checkbox-border-radius: 0.375rem; // 6px
|
|
10
|
+
--zen-checkbox-appearance: hsl(0deg 0% 10%);
|
|
11
|
+
--zen-checkbox-disabled-opacity: 0.6;
|
|
12
|
+
--zen-checkbox-border: 1px solid hsl(0deg 0% 80%);
|
|
13
|
+
}
|
|
14
|
+
|
|
16
15
|
input {
|
|
17
16
|
position: absolute;
|
|
18
17
|
cursor: pointer;
|
|
@@ -25,13 +24,14 @@ input {
|
|
|
25
24
|
left: 0;
|
|
26
25
|
}
|
|
27
26
|
|
|
27
|
+
/* stylelint-disable-next-line no-duplicate-selectors -- separate variables and styles */
|
|
28
28
|
:host {
|
|
29
|
+
border: var(--zen-checkbox-border);
|
|
30
|
+
border-radius: var(--zen-checkbox-border-radius);
|
|
31
|
+
height: var(--zen-checkbox-size);
|
|
32
|
+
width: var(--zen-checkbox-size);
|
|
29
33
|
background-color: white;
|
|
30
34
|
cursor: pointer;
|
|
31
|
-
border: $border;
|
|
32
|
-
border-radius: $border-radius;
|
|
33
|
-
height: $size;
|
|
34
|
-
width: $size;
|
|
35
35
|
position: relative;
|
|
36
36
|
transition:
|
|
37
37
|
background-color ease,
|
|
@@ -42,28 +42,28 @@ input {
|
|
|
42
42
|
display: grid;
|
|
43
43
|
place-items: center;
|
|
44
44
|
font-size: small;
|
|
45
|
-
}
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
46
|
+
&:has(input:checked) {
|
|
47
|
+
color: white;
|
|
48
|
+
background-color: var(--zen-checkbox-appearance);
|
|
49
|
+
border-color: var(--zen-checkbox-appearance);
|
|
50
|
+
}
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
&:has(input[type='checkbox']:disabled) {
|
|
53
|
+
opacity: var(--zen-checkbox-disabled-opacity);
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
&,
|
|
56
|
+
input {
|
|
57
|
+
cursor: not-allowed;
|
|
58
|
+
}
|
|
59
59
|
}
|
|
60
|
-
}
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
61
|
+
&:has(input:focus-visible) {
|
|
62
|
+
outline: $outline;
|
|
63
|
+
box-shadow: $focus-shadow;
|
|
64
|
+
}
|
|
66
65
|
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
&:has(input:user-invalid) {
|
|
67
|
+
border-color: $error;
|
|
68
|
+
}
|
|
69
69
|
}
|
|
@@ -20,9 +20,8 @@ import { ZenFormControl, ZenFormControlProvider } from '../form-control';
|
|
|
20
20
|
*
|
|
21
21
|
* ```css
|
|
22
22
|
* :root {
|
|
23
|
-
* --zen-checkbox-size:
|
|
24
|
-
* --zen-checkbox-border-radius:
|
|
25
|
-
* --zen-checkbox-focus-shadow: 0 1px 4px hsl(0deg 0% 60% / 20%) inset;
|
|
23
|
+
* --zen-checkbox-size: 1rem;
|
|
24
|
+
* --zen-checkbox-border-radius: 0.375rem;
|
|
26
25
|
* --zen-checkbox-appearance: hsl(0deg 0% 10%);
|
|
27
26
|
* --zen-checkbox-disabled-opacity: 0.6;
|
|
28
27
|
* --zen-checkbox-border: 1px solid hsl(0deg 0% 80%);
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
:host {
|
|
2
|
+
--zen-divider-appearance: hsl(0deg 0% 60%);
|
|
3
|
+
--zen-divider-type: solid;
|
|
4
|
+
--zen-divider-align-offset: 25%;
|
|
5
|
+
--zen-divider-gap: 0.25rem;
|
|
6
|
+
--zen-divider-thickness: 1px;
|
|
7
|
+
}
|
|
6
8
|
|
|
9
|
+
/* stylelint-disable-next-line no-duplicate-selectors -- separate variables and styles */
|
|
7
10
|
:host {
|
|
11
|
+
color: var(--zen-divider-appearance);
|
|
12
|
+
gap: var(--zen-divider-gap);
|
|
8
13
|
width: 100%;
|
|
9
14
|
display: flex;
|
|
10
15
|
align-items: center;
|
|
11
|
-
gap: $gap;
|
|
12
|
-
color: $appearance;
|
|
13
16
|
|
|
14
17
|
&::before,
|
|
15
18
|
&::after {
|
|
@@ -17,12 +20,12 @@ $thickness: var(--zen-divider-thickness, 1px);
|
|
|
17
20
|
display: block;
|
|
18
21
|
width: 100%;
|
|
19
22
|
height: 0;
|
|
20
|
-
border-color:
|
|
21
|
-
border-style:
|
|
22
|
-
border-width:
|
|
23
|
+
border-color: var(--zen-divider-appearance);
|
|
24
|
+
border-style: var(--zen-divider-type);
|
|
25
|
+
border-width: var(--zen-divider-thickness) 0 0;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
|
-
&:
|
|
28
|
+
&:empty {
|
|
26
29
|
gap: 0;
|
|
27
30
|
|
|
28
31
|
&::after {
|
|
@@ -32,7 +35,7 @@ $thickness: var(--zen-divider-thickness, 1px);
|
|
|
32
35
|
|
|
33
36
|
&.zen-align-start::before,
|
|
34
37
|
&.zen-align-end::after {
|
|
35
|
-
width:
|
|
38
|
+
width: var(--zen-divider-align-offset);
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
|
|
@@ -47,11 +50,11 @@ $thickness: var(--zen-divider-thickness, 1px);
|
|
|
47
50
|
display: block;
|
|
48
51
|
width: unset;
|
|
49
52
|
height: 100%;
|
|
50
|
-
border-width: 0
|
|
53
|
+
border-width: 0 var(--zen-divider-thickness) 0 0;
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
&.zen-align-start::before,
|
|
54
57
|
&.zen-align-end::after {
|
|
55
|
-
height:
|
|
58
|
+
height: var(--zen-divider-align-offset);
|
|
56
59
|
}
|
|
57
60
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component,
|
|
1
|
+
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* ZenDivider is a reusable divider component that provides a simple way to
|
|
@@ -38,21 +38,10 @@ import { ChangeDetectionStrategy, Component, computed, ElementRef, inject, input
|
|
|
38
38
|
styleUrl: './divider.scss',
|
|
39
39
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
40
40
|
host: {
|
|
41
|
-
'[class.has-content]': 'hasContent()',
|
|
42
41
|
'[class]': '"zen-align-"+align()',
|
|
43
42
|
},
|
|
44
43
|
})
|
|
45
44
|
export class ZenDivider {
|
|
46
45
|
/** Controls the alignment of content within the divider. */
|
|
47
46
|
readonly align = input<'start' | 'end' | 'center'>('center');
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Computed property that determines if the divider contains any content.
|
|
51
|
-
* Used to apply appropriate styling when content is present.
|
|
52
|
-
*/
|
|
53
|
-
protected readonly hasContent = computed(() => {
|
|
54
|
-
return this.elementRef.nativeElement.childNodes.length > 0;
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
private readonly elementRef = inject(ElementRef);
|
|
58
47
|
}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
//
|
|
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:
|
|
14
|
-
border-radius:
|
|
15
|
-
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;
|
|
@@ -20,7 +21,7 @@ input {
|
|
|
20
21
|
|
|
21
22
|
&:focus-visible {
|
|
22
23
|
outline: $outline;
|
|
23
|
-
box-shadow:
|
|
24
|
+
box-shadow: var(--zen-input-focus-shadow);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
&:user-invalid {
|
|
@@ -28,6 +29,6 @@ input {
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
&::placeholder {
|
|
31
|
-
color:
|
|
32
|
+
color: var(--zen-input-placeholder-color);
|
|
32
33
|
}
|
|
33
34
|
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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:
|
|
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
|
|
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
|
|
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.
|
|
3
|
-
$placeholder-color: var(--zen-
|
|
4
|
-
$
|
|
5
|
-
$
|
|
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:
|
|
18
|
-
|
|
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
|
-
|
|
26
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
43
|
-
|
|
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:
|
|
65
|
+
background-color: var(--zen-switch-apperance);
|
|
52
66
|
|
|
53
|
-
.
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
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="
|
|
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
|
-
//
|
|
2
|
-
$
|
|
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:
|
|
14
|
-
border-radius:
|
|
15
|
-
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:
|
|
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
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
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
|
*
|