zidan-select 2.1.2 → 2.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.
@@ -0,0 +1,464 @@
1
+ /*!
2
+ * ZidanForm File-only v2.2.0 — plugin-file-core.css
3
+ * Structure for the file upload control only.
4
+ * Pairs with zidan-file.js and plugin-file-theme.css.
5
+ *
6
+ * Generated by scripts/build.mjs — edit the shared stylesheets instead.
7
+ * https://github.com/akhtar1985/zidan-select
8
+ * MIT License © akhtar1985
9
+ */
10
+
11
+ /* ==================================================================
12
+ 1. Scope reset
13
+ ================================================================== */
14
+
15
+ .zs-root,
16
+ .zs-field,
17
+ .zs-radio-group {
18
+ position: relative;
19
+ display: block;
20
+ width: 100%;
21
+ box-sizing: border-box;
22
+ font-family: var(--zs-font-family, inherit);
23
+ font-size: var(--zs-font-size, 0.9375rem);
24
+ line-height: var(--zs-line-height, 1.4);
25
+ -webkit-tap-highlight-color: transparent;
26
+ }
27
+
28
+ .zs-root *,
29
+ .zs-root *::before,
30
+ .zs-root *::after,
31
+ .zs-field *,
32
+ .zs-field *::before,
33
+ .zs-field *::after,
34
+ .zs-radio-group *,
35
+ .zs-radio-group *::before,
36
+ .zs-radio-group *::after {
37
+ box-sizing: border-box;
38
+ }
39
+
40
+ /* ==================================================================
41
+ 6. Fields — shared shell
42
+ ================================================================== */
43
+
44
+ .zs-field {
45
+ display: flex;
46
+ flex-direction: column;
47
+ gap: var(--zs-field-gap, 6px);
48
+ }
49
+
50
+ .zs-field[data-zs-layout="inline"] {
51
+ flex-direction: row;
52
+ align-items: center;
53
+ flex-wrap: wrap;
54
+ gap: 10px;
55
+ }
56
+
57
+ .zs-field__label {
58
+ display: block;
59
+ font-size: var(--zs-label-size, 0.8125rem);
60
+ font-weight: 600;
61
+ letter-spacing: 0.01em;
62
+ }
63
+
64
+ .zs-field__hint {
65
+ margin: 0;
66
+ font-size: 0.75rem;
67
+ }
68
+
69
+ .zs-field__meta {
70
+ display: flex;
71
+ align-items: baseline;
72
+ justify-content: space-between;
73
+ gap: 10px;
74
+ }
75
+
76
+ .zs-field__error {
77
+ margin: 0;
78
+ font-size: 0.75rem;
79
+ line-height: 1.35;
80
+ }
81
+
82
+ .zs-field__error[hidden] {
83
+ display: none;
84
+ }
85
+
86
+ .zs-counter {
87
+ margin-left: auto;
88
+ font-size: 0.75rem;
89
+ font-variant-numeric: tabular-nums;
90
+ white-space: nowrap;
91
+ }
92
+
93
+ /* the real control: 1×1px and transparent, never display:none — jQuery
94
+ Validation's ":hidden" ignore and native validation must still see it */
95
+ .zs-native-input {
96
+ position: absolute;
97
+ width: 1px;
98
+ height: 1px;
99
+ margin: 0;
100
+ padding: 0;
101
+ border: 0;
102
+ opacity: 0;
103
+ overflow: hidden;
104
+ clip-path: inset(50%);
105
+ white-space: nowrap;
106
+ }
107
+
108
+ .zs-field--inline .zs-check,
109
+ .zs-field--inline .zs-radio {
110
+ margin: 0;
111
+ }
112
+
113
+ /* ==================================================================
114
+ 9. File upload
115
+ ================================================================== */
116
+
117
+ .zs-field--file .zs-file-drop {
118
+ position: relative;
119
+ display: flex;
120
+ flex-direction: column;
121
+ align-items: center;
122
+ justify-content: center;
123
+ gap: 4px;
124
+ padding: 22px 16px;
125
+ min-height: 128px;
126
+ text-align: center;
127
+ border-width: 1.5px;
128
+ border-style: dashed;
129
+ border-radius: var(--zs-radius, 10px);
130
+ cursor: pointer;
131
+ transition: border-color 150ms ease, background-color 150ms ease;
132
+ }
133
+
134
+ .zs-file-icon {
135
+ display: inline-flex;
136
+ align-items: center;
137
+ justify-content: center;
138
+ width: 34px;
139
+ height: 34px;
140
+ margin-bottom: 4px;
141
+ border-radius: 50%;
142
+ }
143
+
144
+ .zs-file-drop-title {
145
+ font-weight: 600;
146
+ }
147
+
148
+ .zs-file-drop-hint {
149
+ font-size: 0.75rem;
150
+ }
151
+
152
+ .zs-file-list {
153
+ display: flex;
154
+ flex-direction: column;
155
+ gap: 6px;
156
+ margin: 0;
157
+ padding: 0;
158
+ list-style: none;
159
+ }
160
+
161
+ .zs-file-list[hidden] {
162
+ display: none;
163
+ }
164
+
165
+ .zs-file-item {
166
+ display: flex;
167
+ align-items: center;
168
+ gap: 10px;
169
+ padding: 8px 10px;
170
+ border-width: var(--zs-border-width, 1px);
171
+ border-style: solid;
172
+ border-radius: var(--zs-radius, 10px);
173
+ }
174
+
175
+ .zs-file-thumb {
176
+ flex: 0 0 auto;
177
+ display: inline-flex;
178
+ align-items: center;
179
+ justify-content: center;
180
+ width: 38px;
181
+ height: 38px;
182
+ overflow: hidden;
183
+ border-radius: 8px;
184
+ font-size: 0.625rem;
185
+ font-weight: 700;
186
+ letter-spacing: 0.02em;
187
+ }
188
+
189
+ .zs-file-thumb img {
190
+ width: 100%;
191
+ height: 100%;
192
+ object-fit: cover;
193
+ display: block;
194
+ }
195
+
196
+ .zs-file-info {
197
+ display: flex;
198
+ flex-direction: column;
199
+ min-width: 0;
200
+ flex: 1 1 auto;
201
+ }
202
+
203
+ .zs-file-name {
204
+ overflow: hidden;
205
+ text-overflow: ellipsis;
206
+ white-space: nowrap;
207
+ font-size: 0.8125rem;
208
+ font-weight: 600;
209
+ }
210
+
211
+ .zs-file-size {
212
+ font-size: 0.6875rem;
213
+ }
214
+
215
+ .zs-file-remove {
216
+ flex: 0 0 auto;
217
+ width: 26px;
218
+ height: 26px;
219
+ padding: 0;
220
+ border: 0;
221
+ border-radius: 50%;
222
+ font-size: 1rem;
223
+ line-height: 1;
224
+ cursor: pointer;
225
+ transition: background-color 150ms ease;
226
+ }
227
+
228
+ .zs-file-meta-row {
229
+ display: flex;
230
+ align-items: center;
231
+ justify-content: space-between;
232
+ gap: 10px;
233
+ min-height: 20px;
234
+ }
235
+
236
+ .zs-file-status {
237
+ font-size: 0.75rem;
238
+ }
239
+
240
+ .zs-file-clear {
241
+ margin-left: auto;
242
+ padding: 2px 8px;
243
+ border-width: 1px;
244
+ border-style: solid;
245
+ border-radius: 999px;
246
+ font-size: 0.6875rem;
247
+ font-weight: 600;
248
+ cursor: pointer;
249
+ }
250
+
251
+ .zs-file-clear[hidden] {
252
+ display: none;
253
+ }
254
+
255
+ /* upload variants (scoped to beat the base .zs-field--file .zs-file-drop rules) */
256
+ .zs-field--file .zs-file-drop--button,
257
+ .zs-field--file .zs-file-drop--compact {
258
+ flex-direction: row;
259
+ align-items: center;
260
+ justify-content: flex-start;
261
+ gap: 8px;
262
+ min-height: 0;
263
+ padding: 10px 14px;
264
+ text-align: left;
265
+ border-style: solid;
266
+ }
267
+
268
+ .zs-field--file .zs-file-drop--compact {
269
+ padding: 6px 10px;
270
+ }
271
+
272
+ .zs-field--file .zs-file-drop--button .zs-file-icon,
273
+ .zs-field--file .zs-file-drop--compact .zs-file-icon {
274
+ margin: 0;
275
+ width: 24px;
276
+ height: 24px;
277
+ }
278
+
279
+ .zs-field--file .zs-file-drop--button .zs-file-drop-hint,
280
+ .zs-field--file .zs-file-drop--compact .zs-file-drop-hint {
281
+ margin-left: auto;
282
+ }
283
+
284
+ .zs-field--file .zs-file-drop--avatar {
285
+ flex: 0 0 auto;
286
+ width: var(--zs-avatar-size, 96px);
287
+ height: var(--zs-avatar-size, 96px);
288
+ min-height: 0;
289
+ padding: 0;
290
+ overflow: hidden;
291
+ border-style: solid;
292
+ border-radius: 50%;
293
+ }
294
+
295
+ .zs-field--file .zs-file-drop--avatar .zs-file-drop-title,
296
+ .zs-field--file .zs-file-drop--avatar .zs-file-drop-hint {
297
+ position: absolute;
298
+ width: 1px;
299
+ height: 1px;
300
+ padding: 0;
301
+ margin: -1px;
302
+ overflow: hidden;
303
+ clip: rect(0 0 0 0);
304
+ white-space: nowrap;
305
+ border: 0;
306
+ }
307
+
308
+ .zs-field--file .zs-file-drop--avatar .zs-file-icon {
309
+ margin: 0;
310
+ }
311
+
312
+ .zs-file-avatar {
313
+ position: absolute;
314
+ inset: 0;
315
+ display: block;
316
+ }
317
+
318
+ .zs-file-avatar[hidden] {
319
+ display: none;
320
+ }
321
+
322
+ .zs-file-avatar img {
323
+ width: 100%;
324
+ height: 100%;
325
+ object-fit: cover;
326
+ display: block;
327
+ }
328
+
329
+ .zs-file-drop--has-preview .zs-file-icon {
330
+ display: none;
331
+ }
332
+
333
+ .zs-field--file .zs-file-drop--gallery {
334
+ flex-direction: row;
335
+ flex-wrap: wrap;
336
+ justify-content: center;
337
+ gap: 6px;
338
+ min-height: 88px;
339
+ padding: 14px;
340
+ }
341
+
342
+ .zs-field[data-zs-file-variant="gallery"] .zs-file-list {
343
+ display: grid;
344
+ grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
345
+ gap: 8px;
346
+ }
347
+
348
+ .zs-field[data-zs-file-variant="gallery"] .zs-file-item {
349
+ flex-direction: column;
350
+ align-items: stretch;
351
+ gap: 6px;
352
+ padding: 6px;
353
+ }
354
+
355
+ .zs-field[data-zs-file-variant="gallery"] .zs-file-thumb {
356
+ width: 100%;
357
+ height: 86px;
358
+ border-radius: 6px;
359
+ }
360
+
361
+ .zs-field[data-zs-file-variant="gallery"] .zs-file-actions {
362
+ justify-content: flex-end;
363
+ }
364
+
365
+ .zs-field[data-zs-file-variant="gallery"] .zs-file-upload-state {
366
+ flex-wrap: wrap;
367
+ }
368
+
369
+ .zs-file-upload-state {
370
+ display: flex;
371
+ align-items: center;
372
+ gap: 6px;
373
+ font-size: 0.6875rem;
374
+ }
375
+
376
+ .zs-file-progress {
377
+ position: relative;
378
+ display: inline-block;
379
+ flex: 1 1 58px;
380
+ height: 4px;
381
+ min-width: 44px;
382
+ overflow: hidden;
383
+ border-radius: 999px;
384
+ }
385
+
386
+ .zs-file-progress-bar {
387
+ display: block;
388
+ height: 100%;
389
+ width: 0;
390
+ border-radius: inherit;
391
+ transition: width 120ms linear;
392
+ }
393
+
394
+ .zs-file-actions {
395
+ flex: 0 0 auto;
396
+ display: inline-flex;
397
+ align-items: center;
398
+ gap: 4px;
399
+ }
400
+
401
+ .zs-file-cancel,
402
+ .zs-file-retry {
403
+ padding: 2px 6px;
404
+ border: 0;
405
+ border-radius: 5px;
406
+ font: inherit;
407
+ font-size: 0.6875rem;
408
+ font-weight: 600;
409
+ cursor: pointer;
410
+ }
411
+
412
+ /* ==================================================================
413
+ 11. Form layout helper
414
+ ================================================================== */
415
+
416
+ .zs-form-grid {
417
+ display: grid;
418
+ grid-template-columns: repeat(auto-fit, minmax(var(--zs-grid-min, 230px), 1fr));
419
+ gap: var(--zs-grid-gap, 16px);
420
+ align-items: start;
421
+ }
422
+
423
+ .zs-form-grid > .zs-full {
424
+ grid-column: 1 / -1;
425
+ }
426
+
427
+ /* ==================================================================
428
+ 12. Focus & motion
429
+ ================================================================== */
430
+
431
+ .zs-check input:focus-visible + .zs-check-box,
432
+ .zs-check input:focus-visible + .zs-switch-track,
433
+ .zs-radio input:focus-visible + .zs-radio-dot {
434
+ outline: 2px solid transparent;
435
+ outline-offset: 2px;
436
+ }
437
+
438
+ .zs-input-native:focus-visible,
439
+ .zs-file-input:focus-visible {
440
+ outline: none;
441
+ }
442
+
443
+ @media (prefers-reduced-motion: reduce) {
444
+ .zs-root,
445
+ .zs-root *,
446
+ .zs-root *::before,
447
+ .zs-root *::after,
448
+ .zs-field,
449
+ .zs-field *,
450
+ .zs-field *::before,
451
+ .zs-field *::after,
452
+ .zs-radio-group,
453
+ .zs-radio-group * {
454
+ animation-duration: 0.001ms !important;
455
+ animation-iteration-count: 1 !important;
456
+ transition-duration: 0.001ms !important;
457
+ scroll-behavior: auto !important;
458
+ }
459
+
460
+ .zs-root .zs-spinner {
461
+ animation-duration: 1.2s !important;
462
+ animation-iteration-count: infinite !important;
463
+ }
464
+ }