funicular-datepicker 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 830a8b55ec3f3f18ecfb150d04d641e1f7831c77c144d47401719d69a00a3376
4
- data.tar.gz: 652c287646d6fca55fda72a6565d8b4e9ac06ed63fb4a0148c00b33897baf386
3
+ metadata.gz: 6d95ca094c408765d950bfdbcb1af695783998e7d1a7f64a334f46dfe7fb1dae
4
+ data.tar.gz: 54c5927016a32b382ba639c3542e60da0bcd625d4aefdc02a311bb9670cb7901
5
5
  SHA512:
6
- metadata.gz: 7de6444bb5460fc04d45b42a8ecb04cf1505c70a160dc28e71b2d02b99a1e494ecd9692c95053a966dfdc9c7e2108f979f08f24cb621010da0926170df4d6cc7
7
- data.tar.gz: 8efed1ffa7f2c60890a2e1f24d484c68084521e00ba97702a05c8ce1ad127b6531b54393380bbad572c32ff0d5f7bde40877f9594a8688897309a4714c6588a0
6
+ metadata.gz: c37569a0336ec47423b204692d129537afe7f81ac4492d7ed19921899ed98440b5d1d05aea86ebc4f0d514f854d755894c1609d726cad485c67df9159490da45
7
+ data.tar.gz: 8ddb59f662b6a631fd3e5775ee4bd9a486e79116d90e01f5f4acf4e05e0ffe7dc366506f02c928d222ca2f448df623912f1dc4083c9941446aace39e67958323
data/README.md CHANGED
@@ -9,3 +9,13 @@ group :funicular do
9
9
  gem "funicular-datepicker"
10
10
  end
11
11
  ```
12
+
13
+ ```ruby
14
+ component(
15
+ Funicular::Plugins::DatePicker::Component,
16
+ value: state.birthday,
17
+ input_class: "birthday-input",
18
+ button_class: "birthday-calendar-button",
19
+ on_change: ->(value) { patch(birthday: value) }
20
+ )
21
+ ```
@@ -10,19 +10,31 @@
10
10
  .funicular-date-picker__button,
11
11
  .funicular-date-picker__nav,
12
12
  .funicular-date-picker__footer_button {
13
- border: 1px solid #d1d5db;
14
13
  border-radius: 0.375rem;
15
- background: #fff;
16
- color: #374151;
17
14
  cursor: pointer;
15
+ font: inherit;
18
16
  }
19
17
 
20
18
  .funicular-date-picker__button {
21
- padding: 0.5rem 0.75rem;
19
+ border: 0;
20
+ background: #2563eb;
21
+ color: #fff;
22
+ font-weight: 600;
23
+ padding: 0.5rem 1rem;
22
24
  white-space: nowrap;
23
25
  }
24
26
 
25
- .funicular-date-picker__button:hover,
27
+ .funicular-date-picker__button:hover {
28
+ background: #1d4ed8;
29
+ }
30
+
31
+ .funicular-date-picker__nav,
32
+ .funicular-date-picker__footer_button {
33
+ border: 1px solid #d1d5db;
34
+ background: #fff;
35
+ color: #374151;
36
+ }
37
+
26
38
  .funicular-date-picker__nav:hover,
27
39
  .funicular-date-picker__footer_button:hover,
28
40
  .funicular-date-picker__day:hover {
@@ -71,7 +71,7 @@ class DatePickerComponent < Funicular::Component
71
71
  oninput: :handle_input,
72
72
  onfocus: -> { open_calendar }
73
73
  )
74
- button(type: "button", class: "funicular-date-picker__button", onclick: -> { open_calendar }) { "Calendar" }
74
+ button(type: "button", class: button_class, onclick: -> { open_calendar }) { "Calendar" }
75
75
  end
76
76
 
77
77
  render_calendar if state.calendar_open
@@ -80,6 +80,10 @@ class DatePickerComponent < Funicular::Component
80
80
 
81
81
  private
82
82
 
83
+ def button_class
84
+ props[:button_class] || "funicular-date-picker__button"
85
+ end
86
+
83
87
  def render_calendar
84
88
  div(class: "funicular-date-picker__panel") do
85
89
  div(class: "funicular-date-picker__header") do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funicular-datepicker
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