funicular-image-uploader 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/assets/image_uploader.css +57 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1837ea87f06b4eecd183f9cced2635f15029152abf005d58567e34879970b324
|
|
4
|
+
data.tar.gz: 69a3c9d7359483ea51925ef0c61acee94bad3622b88ac5142411475d7acd239b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '048c1bf51a5e1b625546d324bf1a008a0abc046571bd09d66b6f186c89496527ed792c70bc7eab38a8e21000839eb59352fab387fc78b5c46932aa1fa5903cff'
|
|
7
|
+
data.tar.gz: 69d65bce24b70fcc6f5ae3220122d1671f762c7efe8272bf3f18bdc29da456884531a6024a0b567d7b5c8aa8eba4ab990ddd339f11e9b924752bd786caba9892
|
data/README.md
CHANGED
|
@@ -32,12 +32,16 @@ component(
|
|
|
32
32
|
src: current_user.has_avatar ? "/users/#{current_user.id}/avatar" : nil,
|
|
33
33
|
input_id: "avatar-input",
|
|
34
34
|
file_field: "avatar",
|
|
35
|
-
image_class: "
|
|
36
|
-
input_class: "
|
|
35
|
+
image_class: "profile-avatar-image",
|
|
36
|
+
input_class: "profile-avatar-input",
|
|
37
37
|
on_select: ->(file, preview_url) { @selected_avatar_file = file }
|
|
38
38
|
)
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
If no classes are supplied, the plugin's default CSS styles the file selector,
|
|
42
|
+
clear button, and upload button. Applications can pass class props when they
|
|
43
|
+
need to align the component with their own design system.
|
|
44
|
+
|
|
41
45
|
The parent component can then send its form data with
|
|
42
46
|
`Funicular::FileUpload.upload_with_formdata`.
|
|
43
47
|
|
data/assets/image_uploader.css
CHANGED
|
@@ -20,6 +20,63 @@
|
|
|
20
20
|
gap: 0.5rem;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
.funicular-image-uploader__input {
|
|
24
|
+
color: #374151;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
font: inherit;
|
|
27
|
+
font-size: 0.875rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.funicular-image-uploader__input::file-selector-button {
|
|
31
|
+
border: 0;
|
|
32
|
+
border-radius: 0.375rem;
|
|
33
|
+
background: #2563eb;
|
|
34
|
+
color: #fff;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
font: inherit;
|
|
37
|
+
font-weight: 600;
|
|
38
|
+
margin-right: 1rem;
|
|
39
|
+
padding: 0.5rem 1rem;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.funicular-image-uploader__input:hover::file-selector-button {
|
|
43
|
+
background: #1d4ed8;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.funicular-image-uploader__clear,
|
|
47
|
+
.funicular-image-uploader__upload {
|
|
48
|
+
border-radius: 0.375rem;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
font: inherit;
|
|
51
|
+
padding: 0.5rem 1rem;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.funicular-image-uploader__clear {
|
|
55
|
+
border: 1px solid #d1d5db;
|
|
56
|
+
background: #fff;
|
|
57
|
+
color: #374151;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.funicular-image-uploader__clear:hover {
|
|
61
|
+
background: #f3f4f6;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.funicular-image-uploader__upload {
|
|
65
|
+
border: 0;
|
|
66
|
+
background: #2563eb;
|
|
67
|
+
color: #fff;
|
|
68
|
+
font-weight: 600;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.funicular-image-uploader__upload:hover:not(:disabled) {
|
|
72
|
+
background: #1d4ed8;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.funicular-image-uploader__upload:disabled {
|
|
76
|
+
cursor: not-allowed;
|
|
77
|
+
opacity: 0.5;
|
|
78
|
+
}
|
|
79
|
+
|
|
23
80
|
.funicular-image-uploader__placeholder {
|
|
24
81
|
width: 6rem;
|
|
25
82
|
height: 6rem;
|