@vector-crystal-web/atoms 1.25.2 → 1.26.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/fesm2022/vector-crystal-web-atoms-accordion.mjs +3 -3
  3. package/fesm2022/vector-crystal-web-atoms-avatar.mjs +3 -3
  4. package/fesm2022/vector-crystal-web-atoms-badge.mjs +3 -3
  5. package/fesm2022/vector-crystal-web-atoms-button.mjs +3 -3
  6. package/fesm2022/vector-crystal-web-atoms-checkbox.mjs +3 -3
  7. package/fesm2022/vector-crystal-web-atoms-chip.mjs +3 -3
  8. package/fesm2022/vector-crystal-web-atoms-datepicker.mjs +3 -3
  9. package/fesm2022/vector-crystal-web-atoms-divider.mjs +3 -3
  10. package/fesm2022/vector-crystal-web-atoms-dropdown.mjs +3 -3
  11. package/fesm2022/vector-crystal-web-atoms-hint.mjs +3 -3
  12. package/fesm2022/vector-crystal-web-atoms-label.mjs +6 -6
  13. package/fesm2022/vector-crystal-web-atoms-message.mjs +3 -3
  14. package/fesm2022/vector-crystal-web-atoms-multiselect.mjs +3 -3
  15. package/fesm2022/vector-crystal-web-atoms-paginator.mjs +3 -3
  16. package/fesm2022/vector-crystal-web-atoms-panel.mjs +3 -3
  17. package/fesm2022/vector-crystal-web-atoms-popover.mjs +3 -3
  18. package/fesm2022/vector-crystal-web-atoms-radio.mjs +3 -3
  19. package/fesm2022/vector-crystal-web-atoms-segment-control.mjs +3 -3
  20. package/fesm2022/vector-crystal-web-atoms-snackbar.mjs +3 -3
  21. package/fesm2022/vector-crystal-web-atoms-stepper.mjs +3 -3
  22. package/fesm2022/vector-crystal-web-atoms-switch.mjs +3 -3
  23. package/fesm2022/vector-crystal-web-atoms-tabs.mjs +3 -3
  24. package/fesm2022/vector-crystal-web-atoms-tag.mjs +3 -3
  25. package/fesm2022/vector-crystal-web-atoms-text-field.mjs +23 -11
  26. package/fesm2022/vector-crystal-web-atoms-textarea.mjs +3 -3
  27. package/fesm2022/vector-crystal-web-atoms-toast.mjs +3 -3
  28. package/label/index.d.ts +9 -8
  29. package/label/src/label.scss +3 -1
  30. package/package.json +24 -24
  31. package/text-field/index.d.ts +17 -5
  32. package/text-field/src/text-field.scss +83 -84
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vector-crystal-web/atoms",
3
- "version": "1.25.2",
3
+ "version": "1.26.0",
4
4
  "description": "Atomic components for the Crystal Design System (Angular, PrimeNG)",
5
5
  "keywords": [
6
6
  "angular",
@@ -19,7 +19,7 @@
19
19
  "primeflex": "^3.3.1",
20
20
  "@phosphor-icons/web": "^2.1.2",
21
21
  "@vector-crystal-web/tokens": "^1.8.2",
22
- "@vector-crystal-web/shared": "^1.1.1"
22
+ "@vector-crystal-web/shared": "^1.1.2"
23
23
  },
24
24
  "sideEffects": false,
25
25
  "publishConfig": {
@@ -39,14 +39,14 @@
39
39
  "types": "./accordion/index.d.ts",
40
40
  "default": "./fesm2022/vector-crystal-web-atoms-accordion.mjs"
41
41
  },
42
- "./button": {
43
- "types": "./button/index.d.ts",
44
- "default": "./fesm2022/vector-crystal-web-atoms-button.mjs"
45
- },
46
42
  "./avatar": {
47
43
  "types": "./avatar/index.d.ts",
48
44
  "default": "./fesm2022/vector-crystal-web-atoms-avatar.mjs"
49
45
  },
46
+ "./button": {
47
+ "types": "./button/index.d.ts",
48
+ "default": "./fesm2022/vector-crystal-web-atoms-button.mjs"
49
+ },
50
50
  "./badge": {
51
51
  "types": "./badge/index.d.ts",
52
52
  "default": "./fesm2022/vector-crystal-web-atoms-badge.mjs"
@@ -75,14 +75,14 @@
75
75
  "types": "./label/index.d.ts",
76
76
  "default": "./fesm2022/vector-crystal-web-atoms-label.mjs"
77
77
  },
78
- "./message": {
79
- "types": "./message/index.d.ts",
80
- "default": "./fesm2022/vector-crystal-web-atoms-message.mjs"
81
- },
82
78
  "./hint": {
83
79
  "types": "./hint/index.d.ts",
84
80
  "default": "./fesm2022/vector-crystal-web-atoms-hint.mjs"
85
81
  },
82
+ "./message": {
83
+ "types": "./message/index.d.ts",
84
+ "default": "./fesm2022/vector-crystal-web-atoms-message.mjs"
85
+ },
86
86
  "./multiselect": {
87
87
  "types": "./multiselect/index.d.ts",
88
88
  "default": "./fesm2022/vector-crystal-web-atoms-multiselect.mjs"
@@ -95,14 +95,14 @@
95
95
  "types": "./popover/index.d.ts",
96
96
  "default": "./fesm2022/vector-crystal-web-atoms-popover.mjs"
97
97
  },
98
- "./radio": {
99
- "types": "./radio/index.d.ts",
100
- "default": "./fesm2022/vector-crystal-web-atoms-radio.mjs"
101
- },
102
98
  "./panel": {
103
99
  "types": "./panel/index.d.ts",
104
100
  "default": "./fesm2022/vector-crystal-web-atoms-panel.mjs"
105
101
  },
102
+ "./radio": {
103
+ "types": "./radio/index.d.ts",
104
+ "default": "./fesm2022/vector-crystal-web-atoms-radio.mjs"
105
+ },
106
106
  "./segment-control": {
107
107
  "types": "./segment-control/index.d.ts",
108
108
  "default": "./fesm2022/vector-crystal-web-atoms-segment-control.mjs"
@@ -111,29 +111,29 @@
111
111
  "types": "./snackbar/index.d.ts",
112
112
  "default": "./fesm2022/vector-crystal-web-atoms-snackbar.mjs"
113
113
  },
114
- "./stepper": {
115
- "types": "./stepper/index.d.ts",
116
- "default": "./fesm2022/vector-crystal-web-atoms-stepper.mjs"
117
- },
118
114
  "./switch": {
119
115
  "types": "./switch/index.d.ts",
120
116
  "default": "./fesm2022/vector-crystal-web-atoms-switch.mjs"
121
117
  },
122
- "./tag": {
123
- "types": "./tag/index.d.ts",
124
- "default": "./fesm2022/vector-crystal-web-atoms-tag.mjs"
118
+ "./stepper": {
119
+ "types": "./stepper/index.d.ts",
120
+ "default": "./fesm2022/vector-crystal-web-atoms-stepper.mjs"
125
121
  },
126
122
  "./tabs": {
127
123
  "types": "./tabs/index.d.ts",
128
124
  "default": "./fesm2022/vector-crystal-web-atoms-tabs.mjs"
129
125
  },
126
+ "./textarea": {
127
+ "types": "./textarea/index.d.ts",
128
+ "default": "./fesm2022/vector-crystal-web-atoms-textarea.mjs"
129
+ },
130
130
  "./text-field": {
131
131
  "types": "./text-field/index.d.ts",
132
132
  "default": "./fesm2022/vector-crystal-web-atoms-text-field.mjs"
133
133
  },
134
- "./textarea": {
135
- "types": "./textarea/index.d.ts",
136
- "default": "./fesm2022/vector-crystal-web-atoms-textarea.mjs"
134
+ "./tag": {
135
+ "types": "./tag/index.d.ts",
136
+ "default": "./fesm2022/vector-crystal-web-atoms-tag.mjs"
137
137
  },
138
138
  "./toast": {
139
139
  "types": "./toast/index.d.ts",
@@ -1,22 +1,34 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { FormControl } from '@angular/forms';
3
+ import { HintSeverity } from '@vector-crystal-web/atoms/hint';
3
4
 
4
5
  type sizeType = 'x-small' | 'small' | 'medium' | 'large';
5
- type type = 'outlined' | 'filled';
6
+ type styleType = 'outlined' | 'filled';
7
+ type fieldType = 'text' | 'password';
8
+ interface HintConfig {
9
+ display?: boolean;
10
+ text?: string;
11
+ severity?: HintSeverity;
12
+ showIcon?: boolean;
13
+ }
6
14
  declare class CrystalTextField {
7
- label: _angular_core.InputSignal<string | null>;
8
- icon: _angular_core.InputSignal<string | null>;
15
+ fieldtype: _angular_core.InputSignal<fieldType>;
16
+ placeholder: _angular_core.InputSignal<string>;
9
17
  disabled: _angular_core.InputSignal<boolean>;
18
+ invalid: _angular_core.InputSignal<boolean>;
10
19
  required: _angular_core.InputSignal<boolean>;
11
20
  class: _angular_core.InputSignal<string | null>;
12
21
  size: _angular_core.InputSignal<sizeType | null>;
13
- type: _angular_core.InputSignal<type | null>;
22
+ type: _angular_core.InputSignal<styleType | null>;
14
23
  control: _angular_core.InputSignal<FormControl<any> | null>;
24
+ hint: _angular_core.InputSignal<HintConfig>;
25
+ get hintConfig(): Required<HintConfig>;
15
26
  private _internalControl;
16
27
  formControl: _angular_core.Signal<FormControl<any>>;
17
28
  get customClass(): string;
18
29
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CrystalTextField, never>;
19
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<CrystalTextField, "cw-text-field", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
30
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CrystalTextField, "cw-text-field", never, { "fieldtype": { "alias": "fieldtype"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
20
31
  }
21
32
 
22
33
  export { CrystalTextField };
34
+ export type { HintConfig };
@@ -1,96 +1,98 @@
1
1
  @use '@vector-crystal-web/tokens/variables' as tokens;
2
2
 
3
- :host ::ng-deep {
4
- .container-block {
5
- gap: tokens.$spacing-spacing-3;
6
- display: flex;
7
- margin-bottom: tokens.$spacing-spacing-2;
8
- label {
9
- font-family: tokens.$primitive-font-family-body;
10
- font-weight: var(--primitive-font-weight-6);
11
- font-size: var(--primitive-font-size-body-4);
12
- color: tokens.$color-text-primary;
13
- }
14
- i {
15
- color: tokens.$color-text-primary;
16
- font-weight: var(--primitive-font-weight-6);
17
- }
18
- }
3
+ @mixin input-text-default {
4
+ padding: tokens.$padding-padding-4 tokens.$padding-padding-5;
5
+ width: 100%;
6
+ font-family: tokens.$primitive-font-family-body;
7
+ font-size: var(--primitive-font-size-body-3);
8
+ font-weight: var(--primitive-font-weight-4);
9
+ color: tokens.$color-text-primary;
10
+ border: 1px solid tokens.$color-stroke-secondary;
11
+ border-radius: tokens.$radius-radius-2;
12
+ background: #{tokens.$color-fill-primary} !important;
19
13
 
20
- .p-inputtext {
21
- padding: tokens.$padding-padding-4 tokens.$padding-padding-5;
22
- width: 320px;
23
- font-family: tokens.$primitive-font-family-body;
24
- font-size: var(--primitive-font-size-body-3);
25
- font-weight: var(--primitive-font-weight-4);
14
+ &::placeholder {
26
15
  color: tokens.$color-text-tertiary;
27
- border: 1px solid tokens.$color-stroke-secondary;
28
- border-radius: tokens.$radius-radius-2;
16
+ opacity: tokens.$opacity-opacity-6;
29
17
  }
30
18
 
31
- .cw-text-field--outlined {
32
- .p-inputtext {
33
- background-color: tokens.$color-fill-primary;
34
- &:hover {
35
- border-color: tokens.$color-stroke-quaternary;
36
- }
37
- &:focus {
38
- border-color: tokens.$color-stroke-brand-default;
39
- // box-shadow: 0 0 0 3px tokens.$color-stroke-interactive-brand-focused; // verificar
40
- }
19
+ &:focus {
20
+ border: 1px solid #{tokens.$color-stroke-feedback-danger-default};
21
+ background: #{tokens.$white};
22
+ outline: none;
23
+ }
24
+
25
+ &:focus-visible,
26
+ &:focus-within {
27
+ background-color: tokens.$white;
28
+ border: 1px solid #{tokens.$color-stroke-brand-default} !important;
29
+ outline: 3px solid #{tokens.$color-stroke-interactive-brand-focused} !important;
30
+ outline-offset: 0;
31
+ }
32
+
33
+ &.p-invalid {
34
+ border: 1px solid #{tokens.$color-stroke-feedback-danger-default};
35
+ background: tokens.$color-fill-primary !important;
36
+ }
37
+
38
+ &.p-variant-filled {
39
+ border: none;
40
+ background: #{tokens.$color-fill-secondary} !important;
41
+
42
+ &:hover:not(:disabled) {
43
+ background-color: tokens.$color-fill-tertiary !important;
41
44
  }
42
45
 
43
- &__disabled {
44
- label {
45
- color: tokens.$color-text-interactive-disabled;
46
- }
47
- i {
48
- color: tokens.$color-text-interactive-disabled;
49
- }
50
- .p-inputtext {
51
- background-color: tokens.$color-fill-primary;
52
- &:hover {
53
- border: 1px solid tokens.$color-stroke-secondary;
54
- }
55
- }
46
+ &:disabled {
47
+ color: tokens.$color-text-tertiary !important;
48
+ background-color: tokens.$color-fill-interactive-disabled !important;
49
+ cursor: not-allowed;
56
50
  }
57
- }
58
- .cw-text-field--filled {
59
- .p-inputtext {
60
- background-color: tokens.$color-fill-secondary;
61
- &:hover {
62
- background-color: tokens.$color-fill-tertiary;
63
- border-color: tokens.$color-fill-tertiary;
64
- }
65
- &:focus {
66
- background-color: tokens.$color-fill-primary;
67
-
68
- border-color: tokens.$color-stroke-brand-default;
69
- box-shadow: 0 0 0 3px tokens.$color-stroke-interactive-brand-focused;
70
- }
51
+
52
+ &.p-invalid {
53
+ border: 1px solid #{tokens.$color-stroke-feedback-danger-default};
54
+ background: #{tokens.$color-fill-secondary} !important;
71
55
  }
72
- &__disabled {
73
- label {
74
- color: tokens.$color-text-interactive-disabled;
75
- }
76
- i {
77
- color: tokens.$color-text-interactive-disabled;
78
- }
79
- .p-inputtext {
80
- background-color: tokens.$color-fill-secondary;
81
- &:hover {
82
- border: 1px solid tokens.$color-stroke-secondary;
83
- background-color: tokens.$color-fill-secondary;
84
- }
85
- }
56
+ }
57
+ }
58
+
59
+ :host ::ng-deep {
60
+ .p-inputtext {
61
+ @include input-text-default;
62
+
63
+ &:disabled {
64
+ color: tokens.$color-text-tertiary !important;
65
+ border: 1px solid #{tokens.$color-stroke-primary} !important;
66
+ background-color: #{tokens.$color-fill-primary} !important;
67
+ cursor: not-allowed;
86
68
  }
87
69
  }
88
70
 
89
- .cw-text-field--error {
71
+ .p-password {
72
+ width: 100%;
73
+ align-items: center;
74
+
90
75
  .p-inputtext {
91
- background-color: tokens.$color-fill-primary;
76
+ @include input-text-default;
77
+ }
92
78
 
93
- border-color: tokens.$color-stroke-feedback-danger-default;
79
+ // hides the key icon of browsers (autofill/keychain)
80
+ .p-inputtext[type='password']::-webkit-credentials-auto-fill-button {
81
+ display: none !important;
82
+ visibility: hidden;
83
+ pointer-events: none;
84
+ position: absolute;
85
+ right: 0;
86
+ }
87
+
88
+ svg {
89
+ margin: 0 0 0 -32px;
90
+ width: var(--primitive-dimension-7);
91
+ height: var(--primitive-dimension-7);
92
+ color: tokens.$color-icon-primary;
93
+ position: relative;
94
+ object-fit: cover;
95
+ cursor: pointer;
94
96
  }
95
97
  }
96
98
 
@@ -99,25 +101,22 @@
99
101
  height: var(--primitive-dimension-10);
100
102
  }
101
103
  }
104
+
102
105
  .cw-text-field--small {
103
106
  .p-inputtext {
104
107
  height: var(--primitive-dimension-11);
105
108
  }
106
109
  }
110
+
107
111
  .cw-text-field--medium {
108
112
  .p-inputtext {
109
113
  height: 42px;
110
114
  }
111
115
  }
116
+
112
117
  .cw-text-field--large {
113
118
  .p-inputtext {
114
119
  height: 48px;
115
120
  }
116
121
  }
117
-
118
- .cw-button--disabled {
119
- opacity: tokens.$opacity-opacity-5;
120
- color: tokens.$color-text-interactive-disabled-dark;
121
- background-color: tokens.$color-text-interactive-disabled;
122
- }
123
122
  }