@up_si_vale/sivale-componentes-angular 1.0.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 (40) hide show
  1. package/README.md +81 -0
  2. package/ng-package.json +9 -0
  3. package/package.json +40 -0
  4. package/src/lib/atoms/button/button.component.html +21 -0
  5. package/src/lib/atoms/button/button.component.scss +242 -0
  6. package/src/lib/atoms/button/button.component.ts +43 -0
  7. package/src/lib/atoms/checkbox/checkbox.component.scss +131 -0
  8. package/src/lib/atoms/checkbox/checkbox.component.ts +130 -0
  9. package/src/lib/atoms/date-picker/date-picker.component.html +295 -0
  10. package/src/lib/atoms/date-picker/date-picker.component.scss +1002 -0
  11. package/src/lib/atoms/date-picker/date-picker.component.ts +942 -0
  12. package/src/lib/atoms/input/input.component.ts +239 -0
  13. package/src/lib/atoms/loader/loader.component.scss +144 -0
  14. package/src/lib/atoms/loader/loader.component.ts +44 -0
  15. package/src/lib/atoms/radio/radio.component.scss +115 -0
  16. package/src/lib/atoms/radio/radio.component.ts +103 -0
  17. package/src/lib/atoms/textarea/textarea.component.ts +155 -0
  18. package/src/lib/directives/asset-source.directive.ts +64 -0
  19. package/src/lib/directives/icon-source.directive.ts +74 -0
  20. package/src/lib/directives/no-leading-space.directive.ts +18 -0
  21. package/src/lib/directives/only-letters.directive.ts +21 -0
  22. package/src/lib/directives/only-number.directive.ts +15 -0
  23. package/src/lib/directives/rfc.directive.ts +60 -0
  24. package/src/lib/directives/tooltip.directive.ts +211 -0
  25. package/src/lib/models/snackbar.models.ts +16 -0
  26. package/src/lib/molecules/copy-input/copy-input.component.html +29 -0
  27. package/src/lib/molecules/copy-input/copy-input.component.scss +101 -0
  28. package/src/lib/molecules/copy-input/copy-input.component.ts +41 -0
  29. package/src/lib/molecules/multiselect/multiselect.component.scss +298 -0
  30. package/src/lib/molecules/multiselect/multiselect.component.ts +487 -0
  31. package/src/lib/molecules/option/option.component.ts +45 -0
  32. package/src/lib/molecules/phone-input/phone-input.component.scss +78 -0
  33. package/src/lib/molecules/phone-input/phone-input.component.ts +43 -0
  34. package/src/lib/molecules/select/select.component.ts +482 -0
  35. package/src/lib/molecules/snackbar/snackbar.component.scss +201 -0
  36. package/src/lib/molecules/snackbar/snackbar.component.ts +321 -0
  37. package/src/lib/services/snackbar.service.ts +103 -0
  38. package/src/lib/tokens/asset-base-url.token.ts +10 -0
  39. package/src/public-api.ts +38 -0
  40. package/tsconfig.json +31 -0
@@ -0,0 +1,101 @@
1
+ .copy-input-wrapper {
2
+ position: relative;
3
+ display: inline-block;
4
+ max-width: 100%;
5
+ }
6
+
7
+ /* Tooltip */
8
+ .copy-tooltip {
9
+ position: absolute;
10
+ top: -2rem; /* espacio superior */
11
+ left: 50%;
12
+ transform: translateX(-50%);
13
+ padding: 0.375rem 0.625rem;
14
+ background: #2f2f2f;
15
+ color: #fff;
16
+ font-size: 0.75rem;
17
+ border-radius: 0.375rem;
18
+ white-space: nowrap;
19
+ opacity: 0;
20
+ animation: fadeSlide 0.25s forwards;
21
+
22
+ /* Flecha */
23
+ &::after {
24
+ content: "";
25
+ position: absolute;
26
+ bottom: -0.375rem;
27
+ left: 50%;
28
+ transform: translateX(-50%);
29
+ border-width: 0.375rem;
30
+ border-style: solid;
31
+ border-color: #2f2f2f transparent transparent transparent;
32
+ }
33
+ }
34
+
35
+ @keyframes fadeSlide {
36
+ from {
37
+ opacity: 0;
38
+ transform: translate(-50%, -5px);
39
+ }
40
+ to {
41
+ opacity: 1;
42
+ transform: translate(-50%, 0);
43
+ }
44
+ }
45
+
46
+
47
+ /* INPUT BASE */
48
+ .copy-input {
49
+ display: flex;
50
+ align-items: center;
51
+ gap: 0.5rem;
52
+ width: 100%;
53
+ box-sizing: border-box;
54
+ padding: 0.625rem 1.125rem;
55
+ border: 2px solid #6D7275;
56
+ border-radius: 0.5rem;
57
+
58
+ // background: #fff;
59
+ cursor: pointer;
60
+ user-select: none;
61
+ transition: background 0.2s ease, border-color 0.2s ease;
62
+
63
+ &:hover {
64
+ background: #f9f9f9;
65
+ border-color: #d8d8d8;
66
+ }
67
+
68
+ &:active {
69
+ background: #f0f0f0;
70
+ }
71
+
72
+ &:focus {
73
+ // outline: 1px solid #cfd9ff;
74
+ outline-offset: 2px;
75
+ }
76
+
77
+ &__icon {
78
+ font-size: 1.1rem;
79
+ color: #444;
80
+ transition: transform 0.2s ease, color 0.2s ease;
81
+
82
+ /* animación al copiar */
83
+ &.icon-done {
84
+ transform: scale(1.2);
85
+ color: #27ae60;
86
+ }
87
+ }
88
+
89
+ &__text {
90
+ flex: 1;
91
+ min-width: 0;
92
+ white-space: nowrap;
93
+ overflow: hidden;
94
+ text-overflow: ellipsis;
95
+ font-family: 'Quicksand', sans-serif;
96
+ font-weight: 600;
97
+ font-size: 1rem;
98
+ line-height: 1.5rem;
99
+ color: #2E353A;
100
+ }
101
+ }
@@ -0,0 +1,41 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { Component, EventEmitter, Input, Output } from '@angular/core';
3
+
4
+ @Component({
5
+ selector: 'copy-input',
6
+ standalone: true,
7
+ imports: [
8
+ CommonModule
9
+ ],
10
+ templateUrl: './copy-input.component.html',
11
+ styleUrl: './copy-input.component.scss'
12
+ })
13
+ export class CopyInputComponent {
14
+ @Input() value: string = '';
15
+ @Input() icon: string = 'icon-copy-clipboard';
16
+ @Input() copiedIcon: string = 'icon-done';
17
+ @Input() ariaLabel: string = 'Copiar';
18
+
19
+ @Output() copied = new EventEmitter<void>();
20
+
21
+ isCopied = false;
22
+ timeoutRef: any;
23
+
24
+ async copyToClipboard() {
25
+ try {
26
+ await navigator.clipboard.writeText(this.value);
27
+
28
+ this.isCopied = true;
29
+ this.copied.emit();
30
+
31
+ clearTimeout(this.timeoutRef);
32
+
33
+ this.timeoutRef = setTimeout(() => {
34
+ this.isCopied = false;
35
+ }, 1200);
36
+
37
+ } catch (err) {
38
+ console.error('Error copiando:', err);
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,298 @@
1
+ .multiselect-wrapper {
2
+ width: 100%;
3
+ margin-bottom: 6px;
4
+ padding: 0 4px;
5
+
6
+ label {
7
+ display: block;
8
+ margin-bottom: 0.5rem;
9
+ font-family: 'Quicksand', sans-serif;
10
+ font-weight: 500;
11
+ font-size: 14px;
12
+ color: #585D61;
13
+ }
14
+ }
15
+
16
+ .multiselect-container {
17
+ position: relative;
18
+ width: 100%;
19
+ }
20
+
21
+ .multiselect-header {
22
+ display: flex;
23
+ align-items: center;
24
+ justify-content: space-between;
25
+ padding: 0.75rem 1rem;
26
+ border: 1px solid #EAECF5;
27
+ box-shadow: 0 1px 2px 0 #A1AFEC66;
28
+ border-radius: 8px;
29
+ background: white;
30
+ cursor: pointer;
31
+ transition: all 0.2s;
32
+ min-height: 44px;
33
+ height: 44px;
34
+
35
+ &:hover:not(.disabled) {
36
+ border-color: #FBD399;
37
+ }
38
+
39
+ &:focus-within {
40
+ border-color: #FBD399;
41
+ box-shadow: 0 0 0 4px #FFE8C8, 0 1px 2px 0 #0A0D120D;
42
+ }
43
+
44
+ &.disabled {
45
+ background: #f5f5f5;
46
+ cursor: not-allowed;
47
+ opacity: 0.6;
48
+ }
49
+
50
+ &.error {
51
+ border-color: #DC3545 !important;
52
+
53
+ &.open {
54
+ box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
55
+ }
56
+ }
57
+
58
+ .multiselect-placeholder {
59
+ font-family: 'Quicksand', sans-serif;
60
+ font-size: 14px;
61
+ color: #969A9C;
62
+ }
63
+
64
+ .multiselect-selected {
65
+ font-family: 'Quicksand', sans-serif;
66
+ font-size: 14px;
67
+ color: #1A1D20;
68
+ font-weight: 500;
69
+ flex: 1;
70
+ overflow: hidden;
71
+ text-overflow: ellipsis;
72
+ white-space: nowrap;
73
+ }
74
+
75
+ .multiselect-arrow {
76
+ color: #969A9C;
77
+ transition: transform 0.3s ease;
78
+ margin-left: 0.5rem;
79
+ flex-shrink: 0;
80
+ display: flex;
81
+ align-items: center;
82
+
83
+ &.open {
84
+ transform: rotate(180deg);
85
+ }
86
+ }
87
+ }
88
+
89
+ .multiselect-dropdown {
90
+ margin-top: 8px;
91
+ background: white;
92
+ border: 1px solid #EAECF5;
93
+ border-radius: 8px;
94
+ box-shadow: 0 10px 16px -4px #EDEFFB;
95
+ max-height: 290px !important;
96
+ width: 100%;
97
+ overflow-x: hidden;
98
+ overflow-y: auto;
99
+ animation: dropdownSlide 0.25s cubic-bezier(0.4, 0, 0.2, 1);
100
+
101
+ // Custom scrollbar
102
+ &::-webkit-scrollbar {
103
+ width: 8px;
104
+ }
105
+
106
+ &::-webkit-scrollbar-track {
107
+ background: #f1f1f1;
108
+ border-radius: 0 12px 12px 0;
109
+ }
110
+
111
+ &::-webkit-scrollbar-thumb {
112
+ background: #D5D7D8;
113
+ border-radius: 4px;
114
+
115
+ &:hover {
116
+ background: #969A9C;
117
+ }
118
+ }
119
+ }
120
+
121
+ @keyframes dropdownSlide {
122
+ from {
123
+ opacity: 0;
124
+ transform: translateY(-8px) scale(0.98);
125
+ }
126
+ to {
127
+ opacity: 1;
128
+ transform: translateY(0) scale(1);
129
+ }
130
+ }
131
+
132
+ .multiselect-option {
133
+ display: flex !important;
134
+ align-items: center;
135
+ padding: 0.6rem 1.25rem;
136
+ cursor: pointer;
137
+ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
138
+ border-bottom: 1px solid #F1F2F4;
139
+ gap: 1rem;
140
+ margin: 0 !important;
141
+ position: relative;
142
+
143
+ &:first-child {
144
+ border-radius: 12px 12px 0 0;
145
+ }
146
+
147
+ &:last-child {
148
+ border-bottom: none;
149
+ border-radius: 0 0 12px 12px;
150
+ }
151
+
152
+ &:hover:not(.disabled) {
153
+ background: linear-gradient(90deg, #FFF9F0 0%, #FFFEF9 100%);
154
+
155
+ &::before {
156
+ opacity: 0.5;
157
+ }
158
+ }
159
+
160
+ &.disabled {
161
+ opacity: 0.5;
162
+ cursor: not-allowed;
163
+ background: #F8F9FC;
164
+
165
+ &:hover {
166
+ transform: none;
167
+ background: #F8F9FC;
168
+ }
169
+ }
170
+
171
+ .option-checkbox {
172
+ position: relative;
173
+ display: flex;
174
+ align-items: center;
175
+ flex-shrink: 0;
176
+
177
+ input[type="checkbox"] {
178
+ position: absolute;
179
+ opacity: 0;
180
+ cursor: pointer;
181
+ width: 22px;
182
+ height: 22px;
183
+ margin: 0;
184
+ }
185
+
186
+ .checkbox-custom {
187
+ width: 22px;
188
+ height: 22px;
189
+ border: 2.5px solid #D5D7D8;
190
+ border-radius: 6px;
191
+ display: flex;
192
+ align-items: center;
193
+ justify-content: center;
194
+ transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
195
+ background: white;
196
+ position: relative;
197
+
198
+ &::after {
199
+ content: '';
200
+ position: absolute;
201
+ width: 100%;
202
+ height: 100%;
203
+ border-radius: 4px;
204
+ background: #F59100;
205
+ opacity: 0;
206
+ transform: scale(0.5);
207
+ transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
208
+ }
209
+
210
+ &.checked {
211
+ background: white;
212
+ border-color: #F59100;
213
+ border-width: 2.5px;
214
+ transform: scale(1.05);
215
+
216
+ &::after {
217
+ opacity: 0;
218
+ }
219
+ }
220
+
221
+ .check-icon {
222
+ position: relative;
223
+ z-index: 1;
224
+ display: flex;
225
+ align-items: center;
226
+ justify-content: center;
227
+ animation: checkPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
228
+ }
229
+ }
230
+
231
+ // Hover effect on checkbox
232
+ input[type="checkbox"]:hover ~ .checkbox-custom:not(.checked) {
233
+ border-color: #F26D00;
234
+ transform: scale(1.05);
235
+ }
236
+ }
237
+
238
+ .option-text {
239
+ flex: 1;
240
+ font-family: 'Quicksand', sans-serif;
241
+ font-weight: 500;
242
+ font-size: 14px;
243
+ color: #1A1D20;
244
+ line-height: 1.5;
245
+ transition: color 0.2s ease, font-weight 0.2s ease;
246
+ }
247
+ }
248
+
249
+ @keyframes checkPop {
250
+ 0% {
251
+ transform: scale(0);
252
+ opacity: 0;
253
+ }
254
+ 50% {
255
+ transform: scale(1.2);
256
+ }
257
+ 100% {
258
+ transform: scale(1);
259
+ opacity: 1;
260
+ }
261
+ }
262
+
263
+ .field-error {
264
+ color: #F04438;
265
+ font-size: 0.875rem;
266
+ margin-top: 0.25rem;
267
+ font-family: 'Quicksand', sans-serif;
268
+ }
269
+
270
+ // Custom backdrop for dynamic dropdown
271
+ ::ng-deep .multiselect-custom-backdrop {
272
+ position: fixed;
273
+ top: 0;
274
+ left: 0;
275
+ width: 100%;
276
+ height: 100%;
277
+ background: transparent;
278
+ z-index: 99999;
279
+ pointer-events: auto;
280
+ }
281
+
282
+ // Custom dropdown container
283
+ ::ng-deep .multiselect-custom-dropdown {
284
+ position: fixed;
285
+ background: white;
286
+ border-radius: 8px;
287
+ overflow: hidden;
288
+ z-index: 1000;
289
+ opacity: 0;
290
+ transform: translateY(-8px) scale(0.98);
291
+ transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
292
+ transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
293
+
294
+ &.multiselect-dropdown-open {
295
+ opacity: 1;
296
+ transform: translateY(0) scale(1);
297
+ }
298
+ }