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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -2
  3. data/assets/image_uploader.css +57 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5e62d685ad7904d5736f83bf4f93236ae58519b662485de30c647ecddd160eb
4
- data.tar.gz: caba1f7953324ccfe25086cc6914cea9761b2258e2450286e8ba9538f7ca00e0
3
+ metadata.gz: 1837ea87f06b4eecd183f9cced2635f15029152abf005d58567e34879970b324
4
+ data.tar.gz: 69a3c9d7359483ea51925ef0c61acee94bad3622b88ac5142411475d7acd239b
5
5
  SHA512:
6
- metadata.gz: c64a67e635875da3e42dfef5bb1a796e4da7695627031d866d1513d52ec68245d5025ef57aa8371498fa860e755d5fa9449990af1259b94a83c087254eed529b
7
- data.tar.gz: a98ea6fcb2f047f42b2c200d43915e2c9cce7a7aa5172ccc53c0abff83af9e849208ad588b26dc98f52cea1ec989e53fd8c3bdfaca9500ecb0466d7e8d5e0f67
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: "w-24 h-24 rounded-full object-cover",
36
- input_class: "w-full border rounded",
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
 
@@ -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;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funicular-image-uploader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - HASUMI Hitoshi