@vector-crystal-web/atoms 1.25.1 → 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 (57) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/accordion/src/accordion.scss +1 -1
  3. package/avatar/src/avatar.scss +1 -1
  4. package/badge/src/badge.scss +1 -1
  5. package/button/index.d.ts +1 -1
  6. package/button/src/button.scss +1 -1
  7. package/checkbox/src/checkbox.scss +1 -1
  8. package/chip/src/chip.scss +1 -1
  9. package/datepicker/src/datepicker.scss +1 -1
  10. package/divider/index.d.ts +2 -2
  11. package/divider/src/divider.scss +1 -1
  12. package/dropdown/src/dropdown.scss +1 -1
  13. package/fesm2022/vector-crystal-web-atoms-accordion.mjs +3 -3
  14. package/fesm2022/vector-crystal-web-atoms-avatar.mjs +3 -3
  15. package/fesm2022/vector-crystal-web-atoms-badge.mjs +3 -3
  16. package/fesm2022/vector-crystal-web-atoms-button.mjs +3 -3
  17. package/fesm2022/vector-crystal-web-atoms-checkbox.mjs +3 -3
  18. package/fesm2022/vector-crystal-web-atoms-chip.mjs +3 -3
  19. package/fesm2022/vector-crystal-web-atoms-datepicker.mjs +3 -3
  20. package/fesm2022/vector-crystal-web-atoms-divider.mjs +3 -3
  21. package/fesm2022/vector-crystal-web-atoms-dropdown.mjs +3 -3
  22. package/fesm2022/vector-crystal-web-atoms-hint.mjs +3 -3
  23. package/fesm2022/vector-crystal-web-atoms-label.mjs +6 -6
  24. package/fesm2022/vector-crystal-web-atoms-message.mjs +3 -3
  25. package/fesm2022/vector-crystal-web-atoms-multiselect.mjs +3 -3
  26. package/fesm2022/vector-crystal-web-atoms-paginator.mjs +3 -3
  27. package/fesm2022/vector-crystal-web-atoms-panel.mjs +3 -3
  28. package/fesm2022/vector-crystal-web-atoms-popover.mjs +3 -3
  29. package/fesm2022/vector-crystal-web-atoms-radio.mjs +3 -3
  30. package/fesm2022/vector-crystal-web-atoms-segment-control.mjs +3 -3
  31. package/fesm2022/vector-crystal-web-atoms-snackbar.mjs +3 -3
  32. package/fesm2022/vector-crystal-web-atoms-stepper.mjs +3 -3
  33. package/fesm2022/vector-crystal-web-atoms-switch.mjs +3 -3
  34. package/fesm2022/vector-crystal-web-atoms-tabs.mjs +3 -3
  35. package/fesm2022/vector-crystal-web-atoms-tag.mjs +3 -3
  36. package/fesm2022/vector-crystal-web-atoms-text-field.mjs +23 -11
  37. package/fesm2022/vector-crystal-web-atoms-textarea.mjs +3 -3
  38. package/fesm2022/vector-crystal-web-atoms-toast.mjs +3 -3
  39. package/hint/src/hint.scss +1 -1
  40. package/label/index.d.ts +9 -8
  41. package/label/src/label.scss +4 -2
  42. package/message/src/message.scss +1 -1
  43. package/multiselect/src/multiselect.scss +1 -1
  44. package/package.json +23 -23
  45. package/paginator/src/paginator.scss +1 -1
  46. package/panel/src/panel.scss +1 -1
  47. package/popover/src/popover.scss +1 -1
  48. package/radio/src/radio.scss +1 -1
  49. package/segment-control/src/segment-control.scss +1 -1
  50. package/snackbar/src/snackbar.scss +1 -1
  51. package/stepper/src/stepper.scss +1 -1
  52. package/tabs/src/tabs.scss +1 -1
  53. package/tag/src/tag.scss +1 -1
  54. package/text-field/index.d.ts +17 -5
  55. package/text-field/src/text-field.scss +84 -85
  56. package/textarea/src/textarea.scss +1 -1
  57. package/toast/src/toast.scss +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vector-crystal-web/atoms",
3
- "version": "1.25.1",
3
+ "version": "1.26.0",
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.1",
22
- "@vector-crystal-web/shared": "^1.1.1"
21
+ "@vector-crystal-web/tokens": "^1.8.2",
22
+ "@vector-crystal-web/shared": "^1.1.2"
23
23
  },
24
24
  "sideEffects": false,
25
25
  "publishConfig": {
@@ -43,14 +43,14 @@
43
43
  "types": "./avatar/index.d.ts",
44
44
  "default": "./fesm2022/vector-crystal-web-atoms-avatar.mjs"
45
45
  },
46
- "./badge": {
47
- "types": "./badge/index.d.ts",
48
- "default": "./fesm2022/vector-crystal-web-atoms-badge.mjs"
49
- },
50
46
  "./button": {
51
47
  "types": "./button/index.d.ts",
52
48
  "default": "./fesm2022/vector-crystal-web-atoms-button.mjs"
53
49
  },
50
+ "./badge": {
51
+ "types": "./badge/index.d.ts",
52
+ "default": "./fesm2022/vector-crystal-web-atoms-badge.mjs"
53
+ },
54
54
  "./checkbox": {
55
55
  "types": "./checkbox/index.d.ts",
56
56
  "default": "./fesm2022/vector-crystal-web-atoms-checkbox.mjs"
@@ -71,14 +71,14 @@
71
71
  "types": "./dropdown/index.d.ts",
72
72
  "default": "./fesm2022/vector-crystal-web-atoms-dropdown.mjs"
73
73
  },
74
- "./hint": {
75
- "types": "./hint/index.d.ts",
76
- "default": "./fesm2022/vector-crystal-web-atoms-hint.mjs"
77
- },
78
74
  "./label": {
79
75
  "types": "./label/index.d.ts",
80
76
  "default": "./fesm2022/vector-crystal-web-atoms-label.mjs"
81
77
  },
78
+ "./hint": {
79
+ "types": "./hint/index.d.ts",
80
+ "default": "./fesm2022/vector-crystal-web-atoms-hint.mjs"
81
+ },
82
82
  "./message": {
83
83
  "types": "./message/index.d.ts",
84
84
  "default": "./fesm2022/vector-crystal-web-atoms-message.mjs"
@@ -91,14 +91,14 @@
91
91
  "types": "./paginator/index.d.ts",
92
92
  "default": "./fesm2022/vector-crystal-web-atoms-paginator.mjs"
93
93
  },
94
- "./panel": {
95
- "types": "./panel/index.d.ts",
96
- "default": "./fesm2022/vector-crystal-web-atoms-panel.mjs"
97
- },
98
94
  "./popover": {
99
95
  "types": "./popover/index.d.ts",
100
96
  "default": "./fesm2022/vector-crystal-web-atoms-popover.mjs"
101
97
  },
98
+ "./panel": {
99
+ "types": "./panel/index.d.ts",
100
+ "default": "./fesm2022/vector-crystal-web-atoms-panel.mjs"
101
+ },
102
102
  "./radio": {
103
103
  "types": "./radio/index.d.ts",
104
104
  "default": "./fesm2022/vector-crystal-web-atoms-radio.mjs"
@@ -111,22 +111,18 @@
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
  },
118
+ "./stepper": {
119
+ "types": "./stepper/index.d.ts",
120
+ "default": "./fesm2022/vector-crystal-web-atoms-stepper.mjs"
121
+ },
122
122
  "./tabs": {
123
123
  "types": "./tabs/index.d.ts",
124
124
  "default": "./fesm2022/vector-crystal-web-atoms-tabs.mjs"
125
125
  },
126
- "./tag": {
127
- "types": "./tag/index.d.ts",
128
- "default": "./fesm2022/vector-crystal-web-atoms-tag.mjs"
129
- },
130
126
  "./textarea": {
131
127
  "types": "./textarea/index.d.ts",
132
128
  "default": "./fesm2022/vector-crystal-web-atoms-textarea.mjs"
@@ -135,6 +131,10 @@
135
131
  "types": "./text-field/index.d.ts",
136
132
  "default": "./fesm2022/vector-crystal-web-atoms-text-field.mjs"
137
133
  },
134
+ "./tag": {
135
+ "types": "./tag/index.d.ts",
136
+ "default": "./fesm2022/vector-crystal-web-atoms-tag.mjs"
137
+ },
138
138
  "./toast": {
139
139
  "types": "./toast/index.d.ts",
140
140
  "default": "./fesm2022/vector-crystal-web-atoms-toast.mjs"
@@ -1,4 +1,4 @@
1
- @use '@vector-crystal-web/tokens/src/lib/tokens' as tokens;
1
+ @use '@vector-crystal-web/tokens/variables' as tokens;
2
2
 
3
3
  :host {
4
4
  .cw-paginator {
@@ -1,4 +1,4 @@
1
- @use '@vector-crystal-web/tokens/src/lib/tokens' as tokens;
1
+ @use '@vector-crystal-web/tokens/variables' as tokens;
2
2
 
3
3
  :host ::ng-deep {
4
4
  .p-panel {
@@ -1 +1 @@
1
- @use '@vector-crystal-web/tokens/src/lib/tokens' as tokens;
1
+ @use '@vector-crystal-web/tokens/variables' as tokens;
@@ -1,4 +1,4 @@
1
- @use '@vector-crystal-web/tokens/src/lib/tokens' as tokens;
1
+ @use '@vector-crystal-web/tokens/variables' as tokens;
2
2
 
3
3
  :host ::ng-deep {
4
4
  .cw-radio-container {
@@ -1,4 +1,4 @@
1
- @use '@vector-crystal-web/tokens/src/lib/tokens' as tokens;
1
+ @use '@vector-crystal-web/tokens/variables' as tokens;
2
2
 
3
3
  :host ::ng-deep {
4
4
  .p-selectbutton {
@@ -1,4 +1,4 @@
1
- @use '@vector-crystal-web/tokens/src/lib/tokens' as tokens;
1
+ @use '@vector-crystal-web/tokens/variables' as tokens;
2
2
 
3
3
  .cw-snackbar-container {
4
4
  position: fixed;
@@ -1,4 +1,4 @@
1
- @use '@vector-crystal-web/tokens/src/lib/tokens' as tokens;
1
+ @use '@vector-crystal-web/tokens/variables' as tokens;
2
2
 
3
3
  :host ::ng-deep {
4
4
  .p-step-number {
@@ -1,4 +1,4 @@
1
- @use '@vector-crystal-web/tokens/src/lib/tokens' as tokens;
1
+ @use '@vector-crystal-web/tokens/variables' as tokens;
2
2
 
3
3
  :host ::ng-deep {
4
4
  .p-tablist-tab-list {
package/tag/src/tag.scss CHANGED
@@ -1,4 +1,4 @@
1
- @use '@vector-crystal-web/tokens/src/lib/tokens' as tokens;
1
+ @use '@vector-crystal-web/tokens/variables' as tokens;
2
2
 
3
3
  :host ::ng-deep {
4
4
  .p-tag {
@@ -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
- @use '@vector-crystal-web/tokens/src/lib/tokens' as tokens;
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
  }
@@ -1,4 +1,4 @@
1
- @use '@vector-crystal-web/tokens/src/lib/tokens' as tokens;
1
+ @use '@vector-crystal-web/tokens/variables' as tokens;
2
2
 
3
3
  @mixin textarea-focused {
4
4
  &:focus,
@@ -1,4 +1,4 @@
1
- @use '@vector-crystal-web/tokens/src/lib/tokens' as tokens;
1
+ @use '@vector-crystal-web/tokens/variables' as tokens;
2
2
 
3
3
  :host {
4
4
  .cw-toast-container {