@georapbox/files-dropzone-element 2.2.0 → 3.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 (49) hide show
  1. package/.editorconfig +15 -0
  2. package/.nvmrc +1 -0
  3. package/.prettierignore +6 -0
  4. package/.prettierrc +11 -0
  5. package/.vscode/extensions.json +8 -0
  6. package/.vscode/settings.json +8 -0
  7. package/.zed/settings.json +9 -0
  8. package/CHANGELOG.md +144 -0
  9. package/README.md +119 -103
  10. package/custom-elements-manifest.config.mjs +48 -0
  11. package/dist/custom-elements.json +35 -61
  12. package/dist/files-dropzone-defined.d.ts +1 -1
  13. package/dist/files-dropzone-defined.d.ts.map +1 -1
  14. package/dist/files-dropzone-defined.js +5 -5
  15. package/dist/files-dropzone-defined.js.map +4 -4
  16. package/dist/files-dropzone.d.ts +38 -52
  17. package/dist/files-dropzone.d.ts.map +1 -1
  18. package/dist/files-dropzone.js +5 -5
  19. package/dist/files-dropzone.js.map +4 -4
  20. package/dist/files-selector.d.ts +9 -0
  21. package/dist/files-selector.d.ts.map +1 -0
  22. package/dist/{utils/is-valid-file.d.ts → is-valid-file.d.ts} +1 -1
  23. package/dist/is-valid-file.d.ts.map +1 -0
  24. package/docs/css/main.css +190 -0
  25. package/docs/css/water.css +674 -0
  26. package/docs/favicon-32x32.png +0 -0
  27. package/docs/index.html +144 -0
  28. package/docs/js/main.js +154 -0
  29. package/docs/lib/files-dropzone.js +93 -0
  30. package/docs/lib/highlight/highlight-github.css +160 -0
  31. package/docs/lib/highlight/highlight.min.js +1160 -0
  32. package/eslint.config.mjs +42 -0
  33. package/package.json +48 -29
  34. package/scripts/build.mjs +32 -0
  35. package/scripts/copy-build-to-docs.mjs +17 -0
  36. package/scripts/dev.mjs +24 -0
  37. package/src/files-dropzone-defined.js +1 -1
  38. package/src/files-dropzone.js +53 -73
  39. package/test/files-dropzone-upgrade.test.js +39 -0
  40. package/test/files-dropzone.test.js +397 -0
  41. package/test/files-selector.test.js +96 -0
  42. package/test/is-valid-file.test.js +78 -0
  43. package/tsconfig.json +15 -0
  44. package/web-test-runner.config.js +13 -0
  45. package/dist/utils/files-selector.d.ts +0 -2
  46. package/dist/utils/files-selector.d.ts.map +0 -1
  47. package/dist/utils/is-valid-file.d.ts.map +0 -1
  48. /package/src/{utils/files-selector.js → files-selector.js} +0 -0
  49. /package/src/{utils/is-valid-file.js → is-valid-file.js} +0 -0
@@ -0,0 +1,190 @@
1
+ :root {
2
+ --success-text: #146c43;
3
+ --danger-text: #b02a37;
4
+ }
5
+
6
+ @media (prefers-color-scheme: dark) {
7
+ :root {
8
+ --success-text: #75b798;
9
+ --danger-text: #ea868f;
10
+ }
11
+
12
+ files-dropzone:not([no-style]) {
13
+ --dropzone-border-color: var(--border);
14
+ --dropzone-border-color-dragover: var(--focus);
15
+ --dropzone-background-color: var(--background);
16
+ --dropzone-background-color-dragover: #10161b;
17
+ --dropzone-body-color: var(--text-main);
18
+ --dropzone-body-color-dragover: var(--text-main);
19
+ }
20
+ }
21
+
22
+ *,
23
+ *::before,
24
+ *::after {
25
+ box-sizing: border-box;
26
+ }
27
+
28
+ [hidden] {
29
+ display: none !important;
30
+ }
31
+
32
+ .noscript-banner {
33
+ width: 100%;
34
+ padding: 0.5rem 0.75rem;
35
+ border-radius: var(--border-radius);
36
+ background-color: #f8d7da;
37
+ text-align: center;
38
+ color: #000000;
39
+ }
40
+
41
+ .no-js [data-hide="no-js"] {
42
+ display: none !important;
43
+ }
44
+
45
+ .component-description p {
46
+ margin: 0 0 0.5rem 0;
47
+ }
48
+
49
+ .component-description p:last-child {
50
+ margin-bottom: 0;
51
+ }
52
+
53
+ .form-row {
54
+ display: flex;
55
+ flex-wrap: wrap;
56
+ gap: 0.5rem;
57
+ margin-bottom: 0.5rem;
58
+ }
59
+
60
+ .form-col {
61
+ flex: 1;
62
+ display: flex;
63
+ flex-direction: column;
64
+ }
65
+
66
+ form {
67
+ display: flex;
68
+ flex-wrap: wrap;
69
+ column-gap: 12px;
70
+ }
71
+
72
+ @media screen and (max-width: 768px) {
73
+ form {
74
+ flex-direction: column;
75
+ }
76
+ }
77
+
78
+ form fieldset {
79
+ flex: 1;
80
+ }
81
+
82
+ form input[type="text"],
83
+ form input[type="number"],
84
+ form textarea {
85
+ width: 100%;
86
+ min-width: 150px;
87
+ margin-right: 0;
88
+ }
89
+
90
+ form input[type="checkbox"] {
91
+ margin-right: 0.1rem;
92
+ }
93
+
94
+ .code-preview {
95
+ white-space: pre-wrap;
96
+ }
97
+
98
+ .console-info {
99
+ display: flex;
100
+ align-items: center;
101
+ gap: 0.5rem;
102
+ margin: 0;
103
+ font-size: 0.9rem;
104
+ }
105
+
106
+ .console-info svg {
107
+ min-width: 20px;
108
+ color: var(--links);
109
+ }
110
+
111
+ .dropped-files:empty {
112
+ display: none;
113
+ }
114
+
115
+ .dropped-files__title {
116
+ margin: 1rem 0 0.75rem 0;
117
+ font-size: 1rem;
118
+ }
119
+
120
+ .dropped-files__list {
121
+ margin: 0;
122
+ padding: 0;
123
+ animation: fade 0.5s ease-in-out;
124
+ }
125
+
126
+ .dropped-files__list-item {
127
+ font-family: monospace;
128
+ font-size: 0.9rem;
129
+ color: var(--success-text);
130
+ padding: 0.3rem 0.75rem;
131
+ list-style: none;
132
+ }
133
+
134
+ .dropped-files__list-item--rejected {
135
+ color: var(--danger-text);
136
+ }
137
+
138
+ .dropped-files__file-size {
139
+ color: var(--text-main);
140
+ }
141
+
142
+ .dropped-files__list-item::marker {
143
+ color: var(--text-main);
144
+ }
145
+
146
+ .dropped-files__list-item:nth-child(odd) {
147
+ background-color: var(--background);
148
+ }
149
+
150
+ .dropped-files__errors {
151
+ list-style-type: disc;
152
+ margin: 0.25rem 0 0;
153
+ padding-left: 1.25rem;
154
+ color: var(--text-main);
155
+ font-size: 0.8rem;
156
+ opacity: 0.9;
157
+ }
158
+
159
+ .dropped-files__errors li {
160
+ padding-block: 0.1rem;
161
+ }
162
+
163
+ .dropped-files__show-all {
164
+ display: block;
165
+ margin: 0.5rem 0 0 0;
166
+ font-size: 0.9rem;
167
+ }
168
+
169
+ .open-file-dialog-btn {
170
+ width: 100%;
171
+ margin: 0;
172
+ line-height: 1.5;
173
+ }
174
+
175
+ .dropzone-container {
176
+ min-height: 154.4px;
177
+ }
178
+
179
+ files-dropzone::not(:defined) {
180
+ display: none;
181
+ }
182
+
183
+ files-dropzone::part(dropzone) {
184
+ padding-block: 4rem;
185
+ }
186
+
187
+ @keyframes fade {
188
+ 0% { opacity: 0.6; }
189
+ 100% { opacity: 1; }
190
+ }