@vector-crystal-web/atoms 1.25.2 → 1.26.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/button/index.d.ts +1 -1
  3. package/button/src/button.scss +29 -10
  4. package/chip/src/chip.scss +30 -20
  5. package/divider/index.d.ts +2 -2
  6. package/fesm2022/vector-crystal-web-atoms-accordion.mjs +3 -3
  7. package/fesm2022/vector-crystal-web-atoms-avatar.mjs +3 -3
  8. package/fesm2022/vector-crystal-web-atoms-badge.mjs +3 -3
  9. package/fesm2022/vector-crystal-web-atoms-button.mjs +4 -4
  10. package/fesm2022/vector-crystal-web-atoms-checkbox.mjs +3 -3
  11. package/fesm2022/vector-crystal-web-atoms-chip.mjs +5 -5
  12. package/fesm2022/vector-crystal-web-atoms-datepicker.mjs +3 -3
  13. package/fesm2022/vector-crystal-web-atoms-divider.mjs +3 -3
  14. package/fesm2022/vector-crystal-web-atoms-dropdown.mjs +3 -3
  15. package/fesm2022/vector-crystal-web-atoms-hint.mjs +7 -7
  16. package/fesm2022/vector-crystal-web-atoms-label.mjs +6 -6
  17. package/fesm2022/vector-crystal-web-atoms-message.mjs +3 -3
  18. package/fesm2022/vector-crystal-web-atoms-multiselect.mjs +3 -3
  19. package/fesm2022/vector-crystal-web-atoms-paginator.mjs +3 -3
  20. package/fesm2022/vector-crystal-web-atoms-panel.mjs +3 -3
  21. package/fesm2022/vector-crystal-web-atoms-popover.mjs +3 -3
  22. package/fesm2022/vector-crystal-web-atoms-radio.mjs +3 -3
  23. package/fesm2022/vector-crystal-web-atoms-segment-control.mjs +3 -3
  24. package/fesm2022/vector-crystal-web-atoms-snackbar.mjs +3 -3
  25. package/fesm2022/vector-crystal-web-atoms-stepper.mjs +3 -3
  26. package/fesm2022/vector-crystal-web-atoms-switch.mjs +3 -3
  27. package/fesm2022/vector-crystal-web-atoms-tabs.mjs +3 -3
  28. package/fesm2022/vector-crystal-web-atoms-tag.mjs +3 -3
  29. package/fesm2022/vector-crystal-web-atoms-text-field.mjs +23 -11
  30. package/fesm2022/vector-crystal-web-atoms-textarea.mjs +3 -3
  31. package/fesm2022/vector-crystal-web-atoms-toast.mjs +7 -7
  32. package/label/index.d.ts +9 -8
  33. package/label/src/label.scss +3 -1
  34. package/package.json +31 -31
  35. package/text-field/index.d.ts +17 -5
  36. 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.1",
4
4
  "description": "Atomic components for the Crystal Design System (Angular, PrimeNG)",
5
5
  "keywords": [
6
6
  "angular",
@@ -18,8 +18,8 @@
18
18
  "primeng": "^20.0.0",
19
19
  "primeflex": "^3.3.1",
20
20
  "@phosphor-icons/web": "^2.1.2",
21
- "@vector-crystal-web/tokens": "^1.8.2",
22
- "@vector-crystal-web/shared": "^1.1.1"
21
+ "@vector-crystal-web/tokens": "^1.9.0",
22
+ "@vector-crystal-web/shared": "^1.1.2"
23
23
  },
24
24
  "sideEffects": false,
25
25
  "publishConfig": {
@@ -39,10 +39,6 @@
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"
@@ -51,6 +47,10 @@
51
47
  "types": "./badge/index.d.ts",
52
48
  "default": "./fesm2022/vector-crystal-web-atoms-badge.mjs"
53
49
  },
50
+ "./button": {
51
+ "types": "./button/index.d.ts",
52
+ "default": "./fesm2022/vector-crystal-web-atoms-button.mjs"
53
+ },
54
54
  "./checkbox": {
55
55
  "types": "./checkbox/index.d.ts",
56
56
  "default": "./fesm2022/vector-crystal-web-atoms-checkbox.mjs"
@@ -59,17 +59,17 @@
59
59
  "types": "./chip/index.d.ts",
60
60
  "default": "./fesm2022/vector-crystal-web-atoms-chip.mjs"
61
61
  },
62
- "./datepicker": {
63
- "types": "./datepicker/index.d.ts",
64
- "default": "./fesm2022/vector-crystal-web-atoms-datepicker.mjs"
65
- },
66
62
  "./divider": {
67
63
  "types": "./divider/index.d.ts",
68
64
  "default": "./fesm2022/vector-crystal-web-atoms-divider.mjs"
69
65
  },
70
- "./dropdown": {
71
- "types": "./dropdown/index.d.ts",
72
- "default": "./fesm2022/vector-crystal-web-atoms-dropdown.mjs"
66
+ "./datepicker": {
67
+ "types": "./datepicker/index.d.ts",
68
+ "default": "./fesm2022/vector-crystal-web-atoms-datepicker.mjs"
69
+ },
70
+ "./hint": {
71
+ "types": "./hint/index.d.ts",
72
+ "default": "./fesm2022/vector-crystal-web-atoms-hint.mjs"
73
73
  },
74
74
  "./label": {
75
75
  "types": "./label/index.d.ts",
@@ -79,9 +79,9 @@
79
79
  "types": "./message/index.d.ts",
80
80
  "default": "./fesm2022/vector-crystal-web-atoms-message.mjs"
81
81
  },
82
- "./hint": {
83
- "types": "./hint/index.d.ts",
84
- "default": "./fesm2022/vector-crystal-web-atoms-hint.mjs"
82
+ "./dropdown": {
83
+ "types": "./dropdown/index.d.ts",
84
+ "default": "./fesm2022/vector-crystal-web-atoms-dropdown.mjs"
85
85
  },
86
86
  "./multiselect": {
87
87
  "types": "./multiselect/index.d.ts",
@@ -91,17 +91,17 @@
91
91
  "types": "./paginator/index.d.ts",
92
92
  "default": "./fesm2022/vector-crystal-web-atoms-paginator.mjs"
93
93
  },
94
- "./popover": {
95
- "types": "./popover/index.d.ts",
96
- "default": "./fesm2022/vector-crystal-web-atoms-popover.mjs"
94
+ "./panel": {
95
+ "types": "./panel/index.d.ts",
96
+ "default": "./fesm2022/vector-crystal-web-atoms-panel.mjs"
97
97
  },
98
98
  "./radio": {
99
99
  "types": "./radio/index.d.ts",
100
100
  "default": "./fesm2022/vector-crystal-web-atoms-radio.mjs"
101
101
  },
102
- "./panel": {
103
- "types": "./panel/index.d.ts",
104
- "default": "./fesm2022/vector-crystal-web-atoms-panel.mjs"
102
+ "./popover": {
103
+ "types": "./popover/index.d.ts",
104
+ "default": "./fesm2022/vector-crystal-web-atoms-popover.mjs"
105
105
  },
106
106
  "./segment-control": {
107
107
  "types": "./segment-control/index.d.ts",
@@ -119,25 +119,25 @@
119
119
  "types": "./switch/index.d.ts",
120
120
  "default": "./fesm2022/vector-crystal-web-atoms-switch.mjs"
121
121
  },
122
- "./tag": {
123
- "types": "./tag/index.d.ts",
124
- "default": "./fesm2022/vector-crystal-web-atoms-tag.mjs"
125
- },
126
122
  "./tabs": {
127
123
  "types": "./tabs/index.d.ts",
128
124
  "default": "./fesm2022/vector-crystal-web-atoms-tabs.mjs"
129
125
  },
126
+ "./tag": {
127
+ "types": "./tag/index.d.ts",
128
+ "default": "./fesm2022/vector-crystal-web-atoms-tag.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"
137
- },
138
134
  "./toast": {
139
135
  "types": "./toast/index.d.ts",
140
136
  "default": "./fesm2022/vector-crystal-web-atoms-toast.mjs"
137
+ },
138
+ "./textarea": {
139
+ "types": "./textarea/index.d.ts",
140
+ "default": "./fesm2022/vector-crystal-web-atoms-textarea.mjs"
141
141
  }
142
142
  },
143
143
  "dependencies": {
@@ -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
  }