siam-ui-utils 3.1.4 → 3.2.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 (60) hide show
  1. package/dist/CustomBootstrap.js +9 -2
  2. package/dist/CustomBootstrap.js.map +1 -1
  3. package/dist/copy-link/index.js +3 -3
  4. package/dist/copy-link/index.js.map +1 -1
  5. package/dist/custom-input/CustomInputCheckbox.js +30 -12
  6. package/dist/custom-input/CustomInputCheckbox.js.map +1 -1
  7. package/dist/custom-input/CustomInputCurrency.js +1 -1
  8. package/dist/custom-input/CustomInputCurrency.js.map +1 -1
  9. package/dist/custom-input/CustomInputFile.js +28 -19
  10. package/dist/custom-input/CustomInputFile.js.map +1 -1
  11. package/dist/custom-input/CustomInputRadio.js +31 -47
  12. package/dist/custom-input/CustomInputRadio.js.map +1 -1
  13. package/dist/custom-input/index.css +25 -167
  14. package/dist/drag-and-dropzone/config.js +52 -51
  15. package/dist/drag-and-dropzone/config.js.map +1 -1
  16. package/dist/drag-and-dropzone/index.css +271 -276
  17. package/dist/drag-and-dropzone/index.js +30 -16
  18. package/dist/drag-and-dropzone/index.js.map +1 -1
  19. package/dist/dropzone-uploader/styled/index.css +165 -348
  20. package/dist/dropzone-uploader/styled/index.js +71 -60
  21. package/dist/dropzone-uploader/styled/index.js.map +1 -1
  22. package/dist/react-notifications/NotificationManager.js +14 -0
  23. package/dist/react-notifications/NotificationManager.js.map +1 -0
  24. package/dist/react-notifications/index.js +2 -1
  25. package/dist/react-notifications/index.js.map +1 -1
  26. package/dist/select/custom-select/index.js +53 -1
  27. package/dist/select/custom-select/index.js.map +1 -1
  28. package/dist/select/multi-select/index.js +6 -3
  29. package/dist/select/multi-select/index.js.map +1 -1
  30. package/dist/select/multi-select/styled-component.js +1 -1
  31. package/dist/select/multi-select/styled-component.js.map +1 -1
  32. package/dist/tomar-foto/index.js +1 -1
  33. package/dist/tomar-foto/index.js.map +1 -1
  34. package/package.json +5 -4
  35. package/dist/_virtual/_commonjsHelpers.js +0 -7
  36. package/dist/_virtual/_commonjsHelpers.js.map +0 -1
  37. package/dist/_virtual/index.js +0 -8
  38. package/dist/_virtual/index.js.map +0 -1
  39. package/dist/_virtual/index2.js +0 -5
  40. package/dist/_virtual/index2.js.map +0 -1
  41. package/dist/node_modules/@neolution-ch/reactstrap/esm/Badge.js +0 -77
  42. package/dist/node_modules/@neolution-ch/reactstrap/esm/Badge.js.map +0 -1
  43. package/dist/node_modules/@neolution-ch/reactstrap/esm/Button.js +0 -111
  44. package/dist/node_modules/@neolution-ch/reactstrap/esm/Button.js.map +0 -1
  45. package/dist/node_modules/@neolution-ch/reactstrap/esm/CloseButton.js +0 -106
  46. package/dist/node_modules/@neolution-ch/reactstrap/esm/CloseButton.js.map +0 -1
  47. package/dist/node_modules/@neolution-ch/reactstrap/esm/Col.js +0 -125
  48. package/dist/node_modules/@neolution-ch/reactstrap/esm/Col.js.map +0 -1
  49. package/dist/node_modules/@neolution-ch/reactstrap/esm/FormGroup.js +0 -75
  50. package/dist/node_modules/@neolution-ch/reactstrap/esm/FormGroup.js.map +0 -1
  51. package/dist/node_modules/@neolution-ch/reactstrap/esm/Input.js +0 -225
  52. package/dist/node_modules/@neolution-ch/reactstrap/esm/Input.js.map +0 -1
  53. package/dist/node_modules/@neolution-ch/reactstrap/esm/Label.js +0 -122
  54. package/dist/node_modules/@neolution-ch/reactstrap/esm/Label.js.map +0 -1
  55. package/dist/node_modules/@neolution-ch/reactstrap/esm/Row.js +0 -83
  56. package/dist/node_modules/@neolution-ch/reactstrap/esm/Row.js.map +0 -1
  57. package/dist/node_modules/@neolution-ch/reactstrap/esm/utils.js +0 -68
  58. package/dist/node_modules/@neolution-ch/reactstrap/esm/utils.js.map +0 -1
  59. package/dist/node_modules/classnames/index.js +0 -62
  60. package/dist/node_modules/classnames/index.js.map +0 -1
@@ -1,276 +1,271 @@
1
- @keyframes passing-through {
2
- 0% {
3
- opacity: 0;
4
- transform: translateY(40px);
5
- }
6
- 30%,
7
- 70% {
8
- opacity: 1;
9
- transform: translateY(0px);
10
- }
11
- 100% {
12
- opacity: 0;
13
- transform: translateY(-40px);
14
- }
15
- }
16
- @keyframes slide-in {
17
- 0% {
18
- opacity: 0;
19
- transform: translateY(40px);
20
- }
21
- 30% {
22
- opacity: 1;
23
- transform: translateY(0px);
24
- }
25
- }
26
- @keyframes pulse {
27
- 0% {
28
- transform: scale(1);
29
- }
30
- 10% {
31
- transform: scale(1.1);
32
- }
33
- 20% {
34
- transform: scale(1);
35
- }
36
- }
37
- .dropzone,
38
- .dropzone * {
39
- box-sizing: border-box;
40
- }
41
- .dropzone {
42
- min-height: 150px;
43
- border: 1px solid rgba(0, 0, 0, 0.8);
44
- border-radius: 5px;
45
- padding: 20px 20px;
46
- }
47
- .dropzone.dz-clickable {
48
- cursor: pointer;
49
- }
50
- .dropzone.dz-clickable * {
51
- cursor: default;
52
- }
53
- .dropzone.dz-clickable .dz-message,
54
- .dropzone.dz-clickable .dz-message * {
55
- cursor: pointer;
56
- }
57
- .dropzone.dz-started .dz-message {
58
- display: none;
59
- }
60
- .dropzone.dz-drag-hover {
61
- border-style: solid;
62
- }
63
- .dropzone.dz-drag-hover .dz-message {
64
- opacity: 0.5;
65
- }
66
- .dropzone .dz-message {
67
- text-align: center;
68
- margin: 3em 0;
69
- }
70
- .dropzone .dz-message .dz-button {
71
- background: none;
72
- color: inherit;
73
- border: none;
74
- padding: 0;
75
- font: inherit;
76
- cursor: pointer;
77
- outline: inherit;
78
- }
79
- .dropzone .dz-preview {
80
- position: relative;
81
- display: inline-block;
82
- vertical-align: top;
83
- margin: 16px;
84
- min-height: 100px;
85
- }
86
- .dropzone .dz-preview:hover {
87
- z-index: 1000;
88
- }
89
- .dropzone .dz-preview:hover .dz-details {
90
- opacity: 1;
91
- }
92
- .dropzone .dz-preview.dz-file-preview .dz-image {
93
- border-radius: 20px;
94
- background: #999;
95
- background: linear-gradient(to bottom, #eee, #ddd);
96
- }
97
- .dropzone .dz-preview.dz-file-preview .dz-details {
98
- opacity: 1;
99
- }
100
- .dropzone .dz-preview.dz-image-preview {
101
- background: #fff;
102
- }
103
- .dropzone .dz-preview.dz-image-preview .dz-details {
104
- transition: opacity 0.2s linear;
105
- }
106
- .dropzone .dz-preview .dz-remove {
107
- font-size: 14px;
108
- text-align: center;
109
- display: block;
110
- cursor: pointer;
111
- border: none;
112
- }
113
-
114
- .dropzone .dz-preview:hover .dz-details {
115
- opacity: 1;
116
- }
117
- .dropzone .dz-preview .dz-details {
118
- z-index: 20;
119
- position: absolute;
120
- top: 0;
121
- left: 0;
122
- opacity: 0;
123
- font-size: 13px;
124
- min-width: 100%;
125
- max-width: 100%;
126
- padding: 2em 1em;
127
- text-align: center;
128
- color: rgba(0, 0, 0, 0.9);
129
- line-height: 150%;
130
- }
131
- .dropzone .dz-preview .dz-details .dz-size {
132
- margin-bottom: 1em;
133
- font-size: 16px;
134
- }
135
- .dropzone .dz-preview .dz-details .dz-filename {
136
- white-space: nowrap;
137
- }
138
- .dropzone .dz-preview .dz-details .dz-filename:hover span {
139
- border: 1px solid rgba(200, 200, 200, 0.8);
140
- background-color: rgba(255, 255, 255, 0.8);
141
- }
142
- .dropzone .dz-preview .dz-details .dz-filename:not(:hover) {
143
- overflow: hidden;
144
- text-overflow: ellipsis;
145
- }
146
- .dropzone .dz-preview .dz-details .dz-filename:not(:hover) span {
147
- border: 1px solid transparent;
148
- }
149
- .dropzone .dz-preview .dz-details .dz-filename span,
150
- .dropzone .dz-preview .dz-details .dz-size span {
151
- background-color: rgba(255, 255, 255, 0.4);
152
- padding: 0 0.4em;
153
- border-radius: 3px;
154
- }
155
- .dropzone .dz-preview:hover .dz-image img {
156
- transform: scale(1.05, 1.05);
157
- filter: blur(8px);
158
- }
159
- .dropzone .dz-preview .dz-image {
160
- border-radius: 20px;
161
- overflow: hidden;
162
- width: 120px;
163
- height: 120px;
164
- position: relative;
165
- display: block;
166
- z-index: 10;
167
- }
168
- .dropzone .dz-preview .dz-image img {
169
- display: block;
170
- }
171
- .dropzone .dz-preview.dz-success .dz-success-mark {
172
- animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
173
- }
174
- .dropzone .dz-preview.dz-error .dz-error-mark {
175
- opacity: 1;
176
- animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
177
- }
178
- .dropzone .dz-preview .dz-success-mark,
179
- .dropzone .dz-preview .dz-error-mark {
180
- pointer-events: none;
181
- opacity: 0;
182
- z-index: 500;
183
- position: absolute;
184
- display: block;
185
- top: 50%;
186
- left: 50%;
187
- margin-left: -27px;
188
- margin-top: -27px;
189
- background: rgba(0, 0, 0, 0.8);
190
- border-radius: 50%;
191
- }
192
- .dropzone .dz-preview .dz-success-mark svg,
193
- .dropzone .dz-preview .dz-error-mark svg {
194
- display: block;
195
- width: 54px;
196
- height: 54px;
197
- fill: #fff;
198
- }
199
- .dropzone .dz-preview.dz-processing .dz-progress {
200
- opacity: 1;
201
- transition: all 0.2s linear;
202
- }
203
- .dropzone .dz-preview.dz-complete .dz-progress {
204
- opacity: 0;
205
- transition: opacity 0.4s ease-in;
206
- }
207
- .dropzone .dz-preview:not(.dz-processing) .dz-progress {
208
- animation: pulse 6s ease infinite;
209
- }
210
- .dropzone .dz-preview .dz-progress {
211
- opacity: 1;
212
- z-index: 1000;
213
- pointer-events: none;
214
- position: absolute;
215
- height: 20px;
216
- top: 50%;
217
- margin-top: -10px;
218
- left: 15%;
219
- right: 15%;
220
- border: 3px solid rgba(0, 0, 0, 0.8);
221
- background: rgba(0, 0, 0, 0.8);
222
- border-radius: 10px;
223
- overflow: hidden;
224
- }
225
- .dropzone .dz-preview .dz-progress .dz-upload {
226
- background: #fff;
227
- display: block;
228
- position: relative;
229
- height: 100%;
230
- width: 0;
231
- transition: width 300ms ease-in-out;
232
- border-radius: 17px;
233
- }
234
- .dropzone .dz-preview.dz-error .dz-error-message {
235
- display: block;
236
- }
237
- .dropzone .dz-preview.dz-error:hover .dz-error-message {
238
- opacity: 1;
239
- pointer-events: auto;
240
- }
241
- .dropzone .dz-preview .dz-error-message {
242
- pointer-events: none;
243
- z-index: 1000;
244
- position: absolute;
245
- display: block;
246
- display: none;
247
- opacity: 0;
248
- transition: opacity 0.3s ease;
249
- border-radius: 8px;
250
- font-size: 13px;
251
- top: 130px;
252
- left: -10px;
253
- width: 140px;
254
- background: #b10606;
255
- padding: 0.5em 1em;
256
- color: #fff;
257
- }
258
- .dropzone .dz-preview .dz-error-message:after {
259
- content: '';
260
- position: absolute;
261
- top: -6px;
262
- left: 64px;
263
- width: 0;
264
- height: 0;
265
- border-left: 6px solid transparent;
266
- border-right: 6px solid transparent;
267
- border-bottom: 6px solid #b10606;
268
- }
269
-
270
- .dz-progress {
271
- display: none;
272
- }
273
-
274
- .dropzone .dz-preview {
275
- margin: 0;
276
- }
1
+ /* ── Drop zone container ─────────────────────────────────────────── */
2
+ .filepicker.dropzone {
3
+ display: flex;
4
+ flex-direction: column;
5
+ align-items: stretch;
6
+ min-height: 120px;
7
+ padding: 12px;
8
+ border: 1px solid var(--dz-border, #D6D6D6);
9
+ border-radius: 12px;
10
+ background-color: #fff;
11
+ cursor: pointer;
12
+ transition: border-color 0.2s ease, background-color 0.2s ease,
13
+ box-shadow 0.2s ease;
14
+ box-sizing: border-box;
15
+ position: relative;
16
+ overflow: hidden;
17
+ }
18
+
19
+ .filepicker.dropzone.dz-clickable:hover {
20
+ border-color: var(--dz-primary, #016E6C);
21
+ }
22
+
23
+ .filepicker.dropzone.dz-drag-hover {
24
+ border-color: var(--dz-primary, #016E6C);
25
+ border-style: dashed;
26
+ background-color: var(--dz-active-bg, #E6F1F1);
27
+ }
28
+
29
+ .filepicker.dropzone.dz-disabled-zone {
30
+ opacity: 0.5;
31
+ pointer-events: none;
32
+ cursor: not-allowed;
33
+ }
34
+
35
+ /* ── Default message (empty state) ──────────────────────────────── */
36
+ .filepicker.dropzone .dz-message {
37
+ flex: 1;
38
+ display: flex;
39
+ flex-direction: column;
40
+ align-items: center;
41
+ justify-content: center;
42
+ gap: 8px;
43
+ min-height: 96px;
44
+ color: var(--dz-primary, #016E6C);
45
+ pointer-events: none;
46
+ }
47
+
48
+ /* Upload icon — circle bubble with upload arrow centered */
49
+ .filepicker.dropzone .dz-message::before {
50
+ content: '';
51
+ display: block;
52
+ width: 40px;
53
+ height: 40px;
54
+ flex-shrink: 0;
55
+ border-radius: 50%;
56
+ background-color: var(--dz-active-bg, #E6F1F1);
57
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23016E6C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E");
58
+ background-repeat: no-repeat;
59
+ background-position: center;
60
+ background-size: 20px 20px;
61
+ }
62
+
63
+ .filepicker.dropzone .dz-message .dz-button {
64
+ background: none;
65
+ border: none;
66
+ padding: 0;
67
+ font-size: 12px;
68
+ font-weight: 600;
69
+ color: var(--dz-primary, #016E6C);
70
+ cursor: pointer;
71
+ }
72
+
73
+ .filepicker.dropzone .dz-message .dz-button::after {
74
+ content: 'Arrastrá archivos aquí o hacé clic para seleccionar';
75
+ }
76
+
77
+ .filepicker.dropzone.dz-started .dz-message {
78
+ display: none;
79
+ }
80
+
81
+ /* ── Preview list ────────────────────────────────────────────────── */
82
+ .filepicker.dropzone .dz-preview {
83
+ width: 100%;
84
+ animation: dz-slide-in 0.18s ease;
85
+ }
86
+
87
+ .filepicker.dropzone .dz-preview + .dz-preview {
88
+ margin-top: 6px;
89
+ }
90
+
91
+ @keyframes dz-slide-in {
92
+ from { opacity: 0; transform: translateY(6px); }
93
+ to { opacity: 1; transform: translateY(0); }
94
+ }
95
+
96
+ /* ── Preview row ─────────────────────────────────────────────────── */
97
+ .dz-preview-inner {
98
+ display: flex;
99
+ align-items: center;
100
+ gap: 10px;
101
+ padding: 8px 10px;
102
+ border: 1px solid var(--dz-border, #D6D6D6);
103
+ border-radius: 8px;
104
+ background: #fff;
105
+ position: relative;
106
+ transition: border-color 0.15s ease;
107
+ }
108
+
109
+ .dz-preview.dz-error .dz-preview-inner {
110
+ border-color: var(--dz-error, #FE4727);
111
+ }
112
+
113
+ /* ── Thumbnail ───────────────────────────────────────────────────── */
114
+ .dz-preview-thumb {
115
+ flex-shrink: 0;
116
+ width: 44px;
117
+ height: 44px;
118
+ border-radius: 8px;
119
+ overflow: hidden;
120
+ background-color: var(--dz-active-bg, #E6F1F1);
121
+ display: flex;
122
+ align-items: center;
123
+ justify-content: center;
124
+ position: relative;
125
+ }
126
+
127
+ .dz-preview-thumb img[data-dz-thumbnail] {
128
+ width: 44px;
129
+ height: 44px;
130
+ object-fit: cover;
131
+ display: none;
132
+ border-radius: 8px;
133
+ }
134
+
135
+ .dz-image-preview .dz-preview-thumb img[data-dz-thumbnail] {
136
+ display: block;
137
+ }
138
+
139
+ .dz-image-preview .dz-preview-thumb .dz-file-icon {
140
+ display: none;
141
+ }
142
+
143
+ /* File icon via mask so it respects --dz-primary */
144
+ .dz-file-icon {
145
+ width: 44px;
146
+ height: 44px;
147
+ background-color: var(--dz-primary, #016E6C);
148
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E");
149
+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E");
150
+ -webkit-mask-size: 18px 18px;
151
+ mask-size: 18px 18px;
152
+ -webkit-mask-repeat: no-repeat;
153
+ mask-repeat: no-repeat;
154
+ -webkit-mask-position: center;
155
+ mask-position: center;
156
+ }
157
+
158
+ /* ── Success / error mark overlays ──────────────────────────────── */
159
+ .dz-success-mark,
160
+ .dz-error-mark {
161
+ position: absolute;
162
+ inset: 0;
163
+ display: flex;
164
+ align-items: center;
165
+ justify-content: center;
166
+ border-radius: 8px;
167
+ opacity: 0;
168
+ pointer-events: none;
169
+ }
170
+
171
+ .dz-success-mark { background: rgba(1, 110, 108, 0.80); }
172
+ .dz-error-mark { background: rgba(254, 71, 39, 0.80); }
173
+
174
+ .dz-success-mark svg,
175
+ .dz-error-mark svg {
176
+ width: 18px;
177
+ height: 18px;
178
+ color: #fff;
179
+ }
180
+
181
+ .dz-preview.dz-success .dz-success-mark {
182
+ opacity: 1;
183
+ animation: dz-fade-out 2s ease 0.5s forwards;
184
+ }
185
+ .dz-preview.dz-error .dz-error-mark {
186
+ opacity: 1;
187
+ }
188
+
189
+ @keyframes dz-fade-out {
190
+ to { opacity: 0; }
191
+ }
192
+
193
+ /* ── File info ───────────────────────────────────────────────────── */
194
+ .dz-preview-info {
195
+ flex: 1;
196
+ min-width: 0;
197
+ display: flex;
198
+ flex-direction: column;
199
+ gap: 1px;
200
+ }
201
+
202
+ .dz-filename {
203
+ font-size: 12px;
204
+ font-weight: 500;
205
+ color: #545454;
206
+ white-space: nowrap;
207
+ overflow: hidden;
208
+ text-overflow: ellipsis;
209
+ }
210
+
211
+ .dz-filesize {
212
+ font-size: 11px;
213
+ color: #A9A9A9;
214
+ }
215
+
216
+ /* ── Progress bar ────────────────────────────────────────────────── */
217
+ .dz-progress {
218
+ height: 3px;
219
+ border-radius: 2px;
220
+ background: var(--dz-border, #D6D6D6);
221
+ overflow: hidden;
222
+ margin-top: 4px;
223
+ display: none;
224
+ }
225
+
226
+ .dz-preview.dz-processing .dz-progress { display: block; }
227
+
228
+ .dz-upload {
229
+ display: block;
230
+ height: 100%;
231
+ background: var(--dz-primary, #016E6C);
232
+ border-radius: 2px;
233
+ width: 0;
234
+ transition: width 300ms ease;
235
+ }
236
+
237
+ /* ── Error message ───────────────────────────────────────────────── */
238
+ .dz-error-message {
239
+ display: none;
240
+ font-size: 11px;
241
+ color: var(--dz-error, #FE4727);
242
+ margin-top: 2px;
243
+ }
244
+
245
+ .dz-preview.dz-error .dz-error-message { display: block; }
246
+
247
+ /* ── Remove button ───────────────────────────────────────────────── */
248
+ .dz-remove-btn {
249
+ flex-shrink: 0;
250
+ display: flex;
251
+ align-items: center;
252
+ justify-content: center;
253
+ width: 28px;
254
+ height: 28px;
255
+ border: none;
256
+ border-radius: 8px;
257
+ background: transparent;
258
+ color: var(--dz-error, #FE4727);
259
+ cursor: pointer;
260
+ transition: background-color 0.15s ease;
261
+ padding: 0;
262
+ }
263
+
264
+ .dz-remove-btn:hover {
265
+ background-color: rgba(254, 71, 39, 0.08);
266
+ }
267
+
268
+ .dz-remove-btn svg {
269
+ width: 13px;
270
+ height: 13px;
271
+ }
@@ -1,6 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { useTheme } from "styled-components";
2
3
  import DropzoneComponent from "./DropzoneComponent.js";
3
- import { dropzoneConfig, dropzoneComponentConfig } from "./config.js";
4
+ import { dropzoneComponentConfig, buildDropzoneConfig } from "./config.js";
4
5
  import "./index.css";
5
6
  const DragAndDropZone = ({
6
7
  files = [],
@@ -12,24 +13,37 @@ const DragAndDropZone = ({
12
13
  },
13
14
  className = ""
14
15
  }) => {
15
- const _className = className + disableUpload === true ? "dz-disable" : "dz-eneable";
16
+ const theme = useTheme();
17
+ const primaryColor = theme?.colors?.primary?.base ?? "#016E6C";
18
+ const borderColor = theme?.colors?.neutral?.borderLight ?? "#D6D6D6";
19
+ const surfaceHover = theme?.colors?.primary?.surfaceHover ?? "#E6F1F1";
20
+ const errorColor = theme?.colors?.error?.base ?? "#FE4727";
21
+ const stateClass = disableUpload ? "dz-disabled-zone" : "";
22
+ const combinedClass = [className, stateClass].filter(Boolean).join(" ");
16
23
  return /* @__PURE__ */ jsx(
17
- DropzoneComponent,
24
+ "div",
18
25
  {
19
- config: dropzoneComponentConfig,
20
- initialFiles: [files],
21
- className: _className,
22
- djsConfig: dropzoneConfig,
23
- eventHandlers: {
24
- removedfile: (file) => {
25
- onDeleteFile(file);
26
+ style: {
27
+ "--dz-primary": primaryColor,
28
+ "--dz-border": borderColor,
29
+ "--dz-active-bg": surfaceHover,
30
+ "--dz-error": errorColor
31
+ },
32
+ children: /* @__PURE__ */ jsx(
33
+ DropzoneComponent,
34
+ {
35
+ config: dropzoneComponentConfig,
36
+ initialFiles: [files],
37
+ className: combinedClass,
38
+ djsConfig: buildDropzoneConfig({ disabled: disableUpload }),
39
+ eventHandlers: {
40
+ removedfile: (file) => onDeleteFile(file),
41
+ addedfile: (file) => onInsertFile(file)
42
+ }
26
43
  },
27
- addedfile: (file) => {
28
- onInsertFile(file);
29
- }
30
- }
31
- },
32
- keyDc
44
+ keyDc
45
+ )
46
+ }
33
47
  );
34
48
  };
35
49
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/drag-and-dropzone/index.jsx"],"sourcesContent":["import DropzoneComponent from './DropzoneComponent';\r\nimport { dropzoneComponentConfig, dropzoneConfig } from './config';\r\nimport './index.css';\r\n\r\nexport const DragAndDropZone = ({\r\n files = [],\r\n keyDc = null,\r\n disableUpload = false,\r\n onDeleteFile = () => {},\r\n onInsertFile = () => {},\r\n className = '',\r\n}) => {\r\n const _className =\r\n className + disableUpload === true ? 'dz-disable' : 'dz-eneable';\r\n return (\r\n <DropzoneComponent\r\n key={keyDc}\r\n config={dropzoneComponentConfig}\r\n initialFiles={[files]}\r\n className={_className}\r\n djsConfig={dropzoneConfig}\r\n eventHandlers={{\r\n removedfile: (file) => {\r\n onDeleteFile(file);\r\n },\r\n addedfile: (file) => {\r\n onInsertFile(file);\r\n },\r\n }}\r\n />\r\n );\r\n};\r\n\r\nexport default DragAndDropZone;\r\n"],"names":[],"mappings":";;;;AAIO,MAAM,kBAAkB,CAAC;AAAA,EAC9B,QAAQ,CAAA;AAAA,EACR,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,YAAY;AACd,MAAM;AACJ,QAAM,aACJ,YAAY,kBAAkB,OAAO,eAAe;AACtD,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MAEC,QAAQ;AAAA,MACR,cAAc,CAAC,KAAK;AAAA,MACpB,WAAW;AAAA,MACX,WAAW;AAAA,MACX,eAAe;AAAA,QACb,aAAa,CAAC,SAAS;AACrB,uBAAa,IAAI;AAAA,QACnB;AAAA,QACA,WAAW,CAAC,SAAS;AACnB,uBAAa,IAAI;AAAA,QACnB;AAAA,MAAA;AAAA,IACF;AAAA,IAZK;AAAA,EAAA;AAeX;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/drag-and-dropzone/index.jsx"],"sourcesContent":["import { useTheme } from 'styled-components';\nimport DropzoneComponent from './DropzoneComponent';\nimport { dropzoneComponentConfig, buildDropzoneConfig } from './config';\nimport './index.css';\n\nexport const DragAndDropZone = ({\n files = [],\n keyDc = null,\n disableUpload = false,\n onDeleteFile = () => {},\n onInsertFile = () => {},\n className = '',\n}) => {\n const theme = useTheme();\n const primaryColor = theme?.colors?.primary?.base ?? '#016E6C';\n const borderColor = theme?.colors?.neutral?.borderLight ?? '#D6D6D6';\n const surfaceHover = theme?.colors?.primary?.surfaceHover ?? '#E6F1F1';\n const errorColor = theme?.colors?.error?.base ?? '#FE4727';\n\n const stateClass = disableUpload ? 'dz-disabled-zone' : '';\n const combinedClass = [className, stateClass].filter(Boolean).join(' ');\n\n return (\n <div\n style={{\n '--dz-primary': primaryColor,\n '--dz-border': borderColor,\n '--dz-active-bg': surfaceHover,\n '--dz-error': errorColor,\n }}\n >\n <DropzoneComponent\n key={keyDc}\n config={dropzoneComponentConfig}\n initialFiles={[files]}\n className={combinedClass}\n djsConfig={buildDropzoneConfig({ disabled: disableUpload })}\n eventHandlers={{\n removedfile: (file) => onDeleteFile(file),\n addedfile: (file) => onInsertFile(file),\n }}\n />\n </div>\n );\n};\n\nexport default DragAndDropZone;\n"],"names":[],"mappings":";;;;;AAKO,MAAM,kBAAkB,CAAC;AAAA,EAC9B,QAAQ,CAAA;AAAA,EACR,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,YAAY;AACd,MAAM;AACJ,QAAM,QAAQ,SAAA;AACd,QAAM,eAAe,OAAO,QAAQ,SAAS,QAAQ;AACrD,QAAM,cAAc,OAAO,QAAQ,SAAS,eAAe;AAC3D,QAAM,eAAe,OAAO,QAAQ,SAAS,gBAAgB;AAC7D,QAAM,aAAa,OAAO,QAAQ,OAAO,QAAQ;AAEjD,QAAM,aAAa,gBAAgB,qBAAqB;AACxD,QAAM,gBAAgB,CAAC,WAAW,UAAU,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAEtE,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,gBAAgB;AAAA,QAChB,eAAe;AAAA,QACf,kBAAkB;AAAA,QAClB,cAAc;AAAA,MAAA;AAAA,MAGhB,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UAEC,QAAQ;AAAA,UACR,cAAc,CAAC,KAAK;AAAA,UACpB,WAAW;AAAA,UACX,WAAW,oBAAoB,EAAE,UAAU,eAAe;AAAA,UAC1D,eAAe;AAAA,YACb,aAAa,CAAC,SAAS,aAAa,IAAI;AAAA,YACxC,WAAW,CAAC,SAAS,aAAa,IAAI;AAAA,UAAA;AAAA,QACxC;AAAA,QARK;AAAA,MAAA;AAAA,IASP;AAAA,EAAA;AAGN;"}