@sb1/ffe-file-upload 11.0.14 → 11.1.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.
package/README.md CHANGED
@@ -14,6 +14,14 @@ Full documentation on file upload usage is available at https://design.sparebank
14
14
  @import 'path/to/node_modules/@sb1/ffe-file.upload/less/ffe-file-upload.less';
15
15
  ```
16
16
 
17
+ ### Importing compiled CSS
18
+
19
+ If your project does not use Less, you can import the compiled styling:
20
+
21
+ ```css
22
+ @import '~@sb1/ffe-file-upload/css/file-upload.css';
23
+ ```
24
+
17
25
  See also `@sb1/ffe-file-upload-react`.
18
26
 
19
27
  ## Theming with CSS custom properties
@@ -0,0 +1,360 @@
1
+ :root,
2
+ :host {
3
+ --ffe-v-fileupload-bgcolor: var(--ffe-farge-frost-30);
4
+ --ffe-v-fileupload-bordercolor: var(--ffe-farge-vann);
5
+ --ffe-v-fileupload-btn-delete-color: var(--ffe-g-link-color);
6
+ --ffe-v-fileupload-btn-delete-color-hover: var(--ffe-g-link-color-hover);
7
+ --ffe-v-fileupload-stencil-bg: var(--ffe-farge-frost-30);
8
+ --ffe-v-fileupload-filename-color: var(--ffe-farge-fjell);
9
+ --ffe-v-fileupload-error-icon-color: var(--ffe-farge-hvit);
10
+ }
11
+ @media (prefers-color-scheme: dark) {
12
+ :root .regard-color-scheme-preference,
13
+ :host .regard-color-scheme-preference {
14
+ --ffe-v-fileupload-bgcolor: var(--ffe-farge-svart);
15
+ --ffe-v-fileupload-bordercolor: var(--ffe-farge-vann-30);
16
+ --ffe-v-fileupload-btn-delete-color: var(--ffe-g-link-color);
17
+ --ffe-v-fileupload-btn-delete-color-hover: var(--ffe-g-link-color-hover);
18
+ --ffe-v-fileupload-stencil-bg: var(--ffe-farge-frost-70);
19
+ --ffe-v-fileupload-filename-color: var(--ffe-farge-vann-30);
20
+ --ffe-v-fileupload-error-icon-color: var(--ffe-farge-fjell);
21
+ }
22
+ }
23
+ .ffe-file-upload {
24
+ margin-top: var(--ffe-spacing-2xl);
25
+ display: grid;
26
+ max-width: 400px;
27
+ grid-template-columns: 1fr;
28
+ font-family: var(--ffe-g-font);
29
+ }
30
+ @media (min-width: 768px) {
31
+ .ffe-file-upload {
32
+ max-width: 100%;
33
+ }
34
+ }
35
+ .ffe-file-upload__title {
36
+ font-family: var(--ffe-g-font-heading-small);
37
+ font-size: var(--ffe-fontsize-h5);
38
+ color: var(--ffe-g-heading-color);
39
+ margin-bottom: 0;
40
+ }
41
+ .ffe-file-upload input[type='file'] {
42
+ display: none;
43
+ }
44
+ .ffe-file-upload__info-section {
45
+ color: var(--ffe-g-text-color);
46
+ font-family: var(--ffe-g-font);
47
+ font-variant-numeric: tabular-nums;
48
+ line-height: 1.5rem;
49
+ font-size: var(--ffe-fontsize-body-text);
50
+ overflow-wrap: anywhere;
51
+ margin-bottom: var(--ffe-spacing-md);
52
+ grid-row: 2;
53
+ }
54
+ @media (min-width: 768px) {
55
+ .ffe-file-upload__info-section {
56
+ margin-right: var(--ffe-spacing-md);
57
+ margin-bottom: 0;
58
+ grid-column: 1;
59
+ }
60
+ }
61
+ .ffe-file-upload__info-section-text {
62
+ margin-bottom: var(--ffe-spacing-sm);
63
+ }
64
+ .ffe-file-upload__file-items-section {
65
+ margin-top: var(--ffe-spacing-sm);
66
+ line-height: 2.1875rem;
67
+ grid-row: 4;
68
+ }
69
+ @media (min-width: 768px) {
70
+ .ffe-file-upload__file-items-section {
71
+ margin-top: 0;
72
+ grid-row: 2;
73
+ }
74
+ }
75
+ .ffe-file-upload__file-items-section li {
76
+ display: grid;
77
+ grid-template-columns: 1fr;
78
+ }
79
+ .ffe-file-upload__upload-section {
80
+ min-height: 150px;
81
+ background-color: var(--ffe-v-fileupload-bgcolor);
82
+ border-radius: 10px;
83
+ text-align: center;
84
+ padding: var(--ffe-spacing-2xs);
85
+ grid-row: 3;
86
+ }
87
+ @media (min-width: 768px) {
88
+ .ffe-file-upload__upload-section {
89
+ margin-top: 0;
90
+ min-height: 220px;
91
+ width: 280px;
92
+ padding: 0;
93
+ grid-row: 2;
94
+ grid-column: 2;
95
+ }
96
+ }
97
+ .ffe-file-upload__upload-section-border {
98
+ display: -webkit-box;
99
+ display: -ms-flexbox;
100
+ display: flex;
101
+ -webkit-box-orient: vertical;
102
+ -webkit-box-direction: normal;
103
+ -ms-flex-direction: column;
104
+ flex-direction: column;
105
+ -webkit-box-pack: center;
106
+ -ms-flex-pack: center;
107
+ justify-content: center;
108
+ -webkit-box-align: center;
109
+ -ms-flex-align: center;
110
+ align-items: center;
111
+ min-height: 140px;
112
+ margin: var(--ffe-spacing-2xs);
113
+ padding: var(--ffe-spacing-2xs) var(--ffe-spacing-lg);
114
+ border: 2px dashed var(--ffe-v-fileupload-bordercolor);
115
+ border-radius: 10px;
116
+ position: relative;
117
+ width: 100%;
118
+ right: 5px;
119
+ bottom: 5px;
120
+ }
121
+ @media (min-width: 768px) {
122
+ .ffe-file-upload__upload-section-border {
123
+ width: 270px;
124
+ min-height: 210px;
125
+ right: 0;
126
+ bottom: 0;
127
+ }
128
+ }
129
+ .ffe-file-upload__upload-section-border--hover {
130
+ opacity: 0.5;
131
+ border-style: solid;
132
+ }
133
+ .ffe-file-upload__upload-section-title {
134
+ font-family: var(--ffe-g-font-heading-small);
135
+ font-size: var(--ffe-fontsize-h5);
136
+ color: var(--ffe-g-heading-color);
137
+ margin-bottom: var(--ffe-spacing-xs);
138
+ display: none;
139
+ }
140
+ @media (min-width: 768px) {
141
+ .ffe-file-upload__upload-section-title {
142
+ display: block;
143
+ }
144
+ }
145
+ .ffe-file-upload__upload-section-microtext {
146
+ color: var(--ffe-g-text-color);
147
+ font-family: var(--ffe-g-font);
148
+ font-weight: normal;
149
+ font-variant-numeric: tabular-nums;
150
+ line-height: 1.25rem;
151
+ margin: 0;
152
+ font-size: var(--ffe-fontsize-micro-text);
153
+ overflow-wrap: anywhere;
154
+ display: none;
155
+ }
156
+ .ffe-file-upload__upload-section-microtext--strong {
157
+ font-family: var(--ffe-g-font-strong);
158
+ }
159
+ @media (min-width: 768px) {
160
+ .ffe-file-upload__upload-section-microtext {
161
+ display: block;
162
+ }
163
+ }
164
+ .ffe-file-upload__upload-section-subtext {
165
+ color: var(--ffe-g-text-color);
166
+ font-family: var(--ffe-g-font);
167
+ font-weight: normal;
168
+ font-variant-numeric: tabular-nums;
169
+ line-height: 1.25rem;
170
+ margin: 0;
171
+ font-size: var(--ffe-fontsize-small-text);
172
+ overflow-wrap: anywhere;
173
+ margin-top: var(--ffe-spacing-xs);
174
+ }
175
+ .ffe-file-upload__file-item-delete-icon {
176
+ display: inline-block;
177
+ }
178
+ .ffe-file-upload__file-item-delete-button {
179
+ padding-top: var(--ffe-spacing-2xs);
180
+ margin-left: auto;
181
+ background-color: transparent;
182
+ border: none;
183
+ line-height: 1.125rem;
184
+ position: relative;
185
+ color: var(--ffe-v-fileupload-btn-delete-color);
186
+ cursor: pointer;
187
+ font-size: 0.875rem;
188
+ grid-column: 3;
189
+ grid-row: 1;
190
+ display: -webkit-box;
191
+ display: -ms-flexbox;
192
+ display: flex;
193
+ -webkit-box-align: center;
194
+ -ms-flex-align: center;
195
+ align-items: center;
196
+ }
197
+ @media (min-width: 768px) {
198
+ .ffe-file-upload__file-item-delete-button {
199
+ margin-right: var(--ffe-spacing-sm);
200
+ }
201
+ }
202
+ @media (hover: hover) and (pointer: fine) {
203
+ .ffe-file-upload__file-item-delete-button:hover {
204
+ color: var(--ffe-v-fileupload-btn-delete-color-hover);
205
+ }
206
+ .ffe-file-upload__file-item-delete-button:hover ~ .ffe-file-upload__file-item-filename {
207
+ text-decoration: underline;
208
+ }
209
+ .ffe-file-upload__file-item-delete-button:hover ~ .ffe-file-upload__file-item-error-info > .ffe-file-upload__file-item-error-filename {
210
+ text-decoration: underline;
211
+ }
212
+ .ffe-file-upload__file-item-delete-button:hover ~ .ffe-file-upload__file-item-stencil-info > .ffe-file-upload__file-item-stencil-info-filename {
213
+ text-decoration: underline;
214
+ }
215
+ .ffe-file-upload__file-item-delete-button:hover .ffe-file-upload__file-item-delete-button-text {
216
+ text-decoration: underline;
217
+ }
218
+ }
219
+ .ffe-file-upload__file-item-delete-button:active,
220
+ .ffe-file-upload__file-item-delete-button:focus {
221
+ color: var(--ffe-v-fileupload-btn-delete-color-hover);
222
+ }
223
+ .ffe-file-upload__file-item-delete-button:active ~ .ffe-file-upload__file-item-filename,
224
+ .ffe-file-upload__file-item-delete-button:focus ~ .ffe-file-upload__file-item-filename {
225
+ text-decoration: underline;
226
+ }
227
+ .ffe-file-upload__file-item-delete-button:active ~ .ffe-file-upload__file-item-error-info > .ffe-file-upload__file-item-error-filename,
228
+ .ffe-file-upload__file-item-delete-button:focus ~ .ffe-file-upload__file-item-error-info > .ffe-file-upload__file-item-error-filename {
229
+ text-decoration: underline;
230
+ }
231
+ .ffe-file-upload__file-item-delete-button:active ~ .ffe-file-upload__file-item-stencil-info > .ffe-file-upload__file-item-stencil-info-filename,
232
+ .ffe-file-upload__file-item-delete-button:focus ~ .ffe-file-upload__file-item-stencil-info > .ffe-file-upload__file-item-stencil-info-filename {
233
+ text-decoration: underline;
234
+ }
235
+ .ffe-file-upload__file-item-delete-button:active .ffe-file-upload__file-item-delete-button-text,
236
+ .ffe-file-upload__file-item-delete-button:focus .ffe-file-upload__file-item-delete-button-text {
237
+ text-decoration: underline;
238
+ }
239
+ .ffe-file-upload__file-item-stencil {
240
+ display: grid;
241
+ grid-template-columns: 1fr;
242
+ }
243
+ .ffe-file-upload__file-item-stencil-info {
244
+ display: grid;
245
+ grid-column: 1;
246
+ grid-row: 1;
247
+ grid-template-columns: 1fr;
248
+ overflow: hidden;
249
+ }
250
+ .ffe-file-upload__file-item-stencil-info-background {
251
+ height: 10px;
252
+ border-radius: 5px;
253
+ background-color: var(--ffe-v-fileupload-stencil-bg);
254
+ }
255
+ .ffe-file-upload__file-item-stencil-info-filename {
256
+ color: var(--ffe-g-text-color);
257
+ font-family: var(--ffe-g-font);
258
+ font-weight: normal;
259
+ font-variant-numeric: tabular-nums;
260
+ line-height: 1.25rem;
261
+ margin: 0;
262
+ font-size: var(--ffe-fontsize-micro-text);
263
+ overflow-wrap: anywhere;
264
+ margin-top: var(--ffe-spacing-2xs);
265
+ white-space: nowrap;
266
+ overflow: hidden;
267
+ -o-text-overflow: ellipsis;
268
+ text-overflow: ellipsis;
269
+ }
270
+ .ffe-file-upload__file-item-stencil-info-filename--strong {
271
+ font-family: var(--ffe-g-font-strong);
272
+ }
273
+ .ffe-file-upload__file-item-loaded {
274
+ display: grid;
275
+ grid-template-columns: 1fr;
276
+ }
277
+ .ffe-file-upload__file-item-filename {
278
+ grid-row: 1;
279
+ grid-column: 1;
280
+ white-space: nowrap;
281
+ overflow: hidden;
282
+ -o-text-overflow: ellipsis;
283
+ text-overflow: ellipsis;
284
+ margin-top: 2px;
285
+ color: var(--ffe-v-fileupload-filename-color);
286
+ }
287
+ .ffe-file-upload__file-item-error {
288
+ display: grid;
289
+ grid-gap: 5px;
290
+ grid-template-columns: 25px 1fr;
291
+ }
292
+ .ffe-file-upload__file-item-error-icon {
293
+ background-color: var(--ffe-v-error-message-icon-color);
294
+ border-radius: 50%;
295
+ width: 18px;
296
+ height: 18px;
297
+ margin-right: var(--ffe-spacing-2xs);
298
+ padding: 3px;
299
+ font-family: arial, sans-serif;
300
+ display: -webkit-inline-box;
301
+ display: -ms-inline-flexbox;
302
+ display: inline-flex;
303
+ -webkit-box-align: center;
304
+ -ms-flex-align: center;
305
+ align-items: center;
306
+ -webkit-box-pack: center;
307
+ -ms-flex-pack: center;
308
+ justify-content: center;
309
+ -ms-flex-item-align: center;
310
+ align-self: center;
311
+ grid-column: 1;
312
+ grid-row: 1;
313
+ }
314
+ .ffe-file-upload__file-item-error-icon .ffe-icons {
315
+ color: var(--ffe-v-fileupload-error-icon-color);
316
+ }
317
+ .ffe-file-upload__file-item-error-info {
318
+ display: grid;
319
+ grid-row: 1;
320
+ grid-column: 2;
321
+ grid-template-columns: 1fr;
322
+ -ms-flex-line-pack: center;
323
+ align-content: center;
324
+ }
325
+ .ffe-file-upload__file-item-error-filename {
326
+ color: var(--ffe-g-text-color);
327
+ font-family: var(--ffe-g-font);
328
+ font-weight: normal;
329
+ font-variant-numeric: tabular-nums;
330
+ line-height: 1.25rem;
331
+ margin: 0;
332
+ font-size: var(--ffe-fontsize-micro-text);
333
+ overflow-wrap: anywhere;
334
+ grid-row: 1;
335
+ white-space: nowrap;
336
+ overflow: hidden;
337
+ -o-text-overflow: ellipsis;
338
+ text-overflow: ellipsis;
339
+ }
340
+ .ffe-file-upload__file-item-error-filename--strong {
341
+ font-family: var(--ffe-g-font-strong);
342
+ }
343
+ .ffe-file-upload__file-item-error-message {
344
+ color: var(--ffe-g-text-color);
345
+ font-family: var(--ffe-g-font);
346
+ font-weight: normal;
347
+ font-variant-numeric: tabular-nums;
348
+ line-height: 1.25rem;
349
+ margin: 0;
350
+ font-size: var(--ffe-fontsize-micro-text);
351
+ overflow-wrap: anywhere;
352
+ grid-row: 2;
353
+ white-space: nowrap;
354
+ overflow: hidden;
355
+ -o-text-overflow: ellipsis;
356
+ text-overflow: ellipsis;
357
+ }
358
+ .ffe-file-upload__file-item-error-message--strong {
359
+ font-family: var(--ffe-g-font-strong);
360
+ }
@@ -1,3 +1,6 @@
1
+ @import (reference) '@sb1/ffe-core/less/breakpoints';
2
+ @import (reference) '@sb1/ffe-core/less/typography';
3
+
1
4
  .ffe-file-upload {
2
5
  margin-top: var(--ffe-spacing-2xl);
3
6
  display: grid;
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@sb1/ffe-file-upload",
3
- "version": "11.0.14",
3
+ "version": "11.1.0",
4
4
  "description": "File upload module",
5
5
  "license": "MIT",
6
6
  "author": "SpareBank 1",
7
7
  "files": [
8
- "less"
8
+ "less",
9
+ "css"
9
10
  ],
10
11
  "repository": {
11
12
  "type": "git",
@@ -13,11 +14,12 @@
13
14
  },
14
15
  "scripts": {
15
16
  "lint": "ffe-buildtool stylelint less/*.less",
16
- "test": "npm run lint"
17
+ "test": "npm run lint",
18
+ "build": "lessc less/file-upload.less css/file-upload.css --autoprefix"
17
19
  },
18
20
  "dependencies": {
19
- "@sb1/ffe-core": "^29.1.4",
20
- "@sb1/ffe-form": "^30.0.14"
21
+ "@sb1/ffe-core": "^29.2.0",
22
+ "@sb1/ffe-form": "^30.1.0"
21
23
  },
22
24
  "devDependencies": {
23
25
  "@sb1/ffe-buildtool": "^0.9.0"
@@ -25,5 +27,5 @@
25
27
  "publishConfig": {
26
28
  "access": "public"
27
29
  },
28
- "gitHead": "d27089e01efb5feed58df9f4acd48981a8dd9e6f"
30
+ "gitHead": "55ee3d40abaef9433c55aa993889e67c3f5c5abd"
29
31
  }