arara 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +38 -0
- data/Rakefile +32 -0
- data/app/assets/config/arara_manifest.js +1 -0
- data/app/assets/javascripts/arara.js +603 -0
- data/app/assets/stylesheets/arara/application.css +15 -0
- data/app/components/arara.rb +2 -0
- data/app/components/arara/base_component.rb +62 -0
- data/app/components/arara/button_component.html.erb +7 -0
- data/app/components/arara/button_component.rb +50 -0
- data/app/components/arara/card_action_buttons_component.html.erb +3 -0
- data/app/components/arara/card_action_buttons_component.rb +15 -0
- data/app/components/arara/card_action_icons_component.html.erb +3 -0
- data/app/components/arara/card_action_icons_component.rb +15 -0
- data/app/components/arara/card_actions_component.html.erb +3 -0
- data/app/components/arara/card_actions_component.rb +15 -0
- data/app/components/arara/card_component.html.erb +3 -0
- data/app/components/arara/card_component.rb +15 -0
- data/app/components/arara/card_media_component.html.erb +3 -0
- data/app/components/arara/card_media_component.rb +20 -0
- data/app/components/arara/card_media_content_component.html.erb +3 -0
- data/app/components/arara/card_media_content_component.rb +15 -0
- data/app/components/arara/card_primary_content_component.html.erb +3 -0
- data/app/components/arara/card_primary_content_component.rb +18 -0
- data/app/components/arara/checkbox_component.html.erb +22 -0
- data/app/components/arara/checkbox_component.rb +25 -0
- data/app/components/arara/chip_component.html.erb +13 -0
- data/app/components/arara/chip_component.rb +22 -0
- data/app/components/arara/chipset_component.html.erb +6 -0
- data/app/components/arara/chipset_component.rb +23 -0
- data/app/components/arara/data_table_body_cell_component.html.erb +3 -0
- data/app/components/arara/data_table_body_cell_component.rb +18 -0
- data/app/components/arara/data_table_body_checkbox_component.html.erb +11 -0
- data/app/components/arara/data_table_body_checkbox_component.rb +25 -0
- data/app/components/arara/data_table_body_component.html.erb +3 -0
- data/app/components/arara/data_table_body_component.rb +15 -0
- data/app/components/arara/data_table_body_row_component.html.erb +3 -0
- data/app/components/arara/data_table_body_row_component.rb +27 -0
- data/app/components/arara/data_table_component.html.erb +5 -0
- data/app/components/arara/data_table_component.rb +36 -0
- data/app/components/arara/data_table_header_cell_component.html.erb +3 -0
- data/app/components/arara/data_table_header_cell_component.rb +24 -0
- data/app/components/arara/data_table_header_checkbox_component.html.erb +11 -0
- data/app/components/arara/data_table_header_checkbox_component.rb +25 -0
- data/app/components/arara/data_table_header_component.html.erb +3 -0
- data/app/components/arara/data_table_header_component.rb +11 -0
- data/app/components/arara/data_table_header_row_component.html.erb +3 -0
- data/app/components/arara/data_table_header_row_component.rb +15 -0
- data/app/components/arara/dialog_button_component.html.erb +4 -0
- data/app/components/arara/dialog_button_component.rb +31 -0
- data/app/components/arara/dialog_component.html.erb +8 -0
- data/app/components/arara/dialog_component.rb +34 -0
- data/app/components/arara/dialog_content_component.html.erb +3 -0
- data/app/components/arara/dialog_content_component.rb +15 -0
- data/app/components/arara/dialog_footer_component.html.erb +3 -0
- data/app/components/arara/dialog_footer_component.rb +15 -0
- data/app/components/arara/dialog_title_component.html.erb +3 -0
- data/app/components/arara/dialog_title_component.rb +16 -0
- data/app/components/arara/elevation_component.html.erb +3 -0
- data/app/components/arara/elevation_component.rb +19 -0
- data/app/components/arara/fab_component.html.erb +13 -0
- data/app/components/arara/fab_component.rb +42 -0
- data/app/components/arara/fab_icon_component.html.erb +3 -0
- data/app/components/arara/fab_icon_component.rb +15 -0
- data/app/components/arara/form_builder.rb +142 -0
- data/app/components/arara/form_field_component.html.erb +3 -0
- data/app/components/arara/form_field_component.rb +15 -0
- data/app/components/arara/google_calendar/menu_item_component.html.erb +11 -0
- data/app/components/arara/google_calendar/menu_item_component.rb +34 -0
- data/app/components/arara/google_calendar/nav_bar_component.html.erb +176 -0
- data/app/components/arara/google_calendar/nav_bar_component.rb +6 -0
- data/app/components/arara/icon_button_component.html.erb +3 -0
- data/app/components/arara/icon_button_component.rb +42 -0
- data/app/components/arara/icon_toggle_component.html.erb +3 -0
- data/app/components/arara/icon_toggle_component.rb +18 -0
- data/app/components/arara/material_icon_component.html.erb +3 -0
- data/app/components/arara/material_icon_component.rb +18 -0
- data/app/components/arara/menu_component.html.erb +5 -0
- data/app/components/arara/menu_component.rb +19 -0
- data/app/components/arara/menu_divider_component.html.erb +1 -0
- data/app/components/arara/menu_divider_component.rb +19 -0
- data/app/components/arara/menu_item_component.html.erb +3 -0
- data/app/components/arara/menu_item_component.rb +22 -0
- data/app/components/arara/nav_bar_component.html.erb +293 -0
- data/app/components/arara/nav_bar_component.rb +7 -0
- data/app/components/arara/radio_button_component.html.erb +8 -0
- data/app/components/arara/radio_button_component.rb +35 -0
- data/app/components/arara/select_component.html.erb +22 -0
- data/app/components/arara/select_component.rb +27 -0
- data/app/components/arara/select_item_component.html.erb +3 -0
- data/app/components/arara/select_item_component.rb +45 -0
- data/app/components/arara/step_component.html.erb +27 -0
- data/app/components/arara/step_component.rb +100 -0
- data/app/components/arara/step_connector_component.html.erb +4 -0
- data/app/components/arara/step_connector_component.rb +31 -0
- data/app/components/arara/stepper_component.html.erb +3 -0
- data/app/components/arara/stepper_component.rb +20 -0
- data/app/components/arara/switch_component.html.erb +8 -0
- data/app/components/arara/switch_component.rb +35 -0
- data/app/components/arara/tags.rb +2 -0
- data/app/components/arara/tags/check_box.rb +63 -0
- data/app/components/arara/tags/chip_choice.rb +81 -0
- data/app/components/arara/tags/chipset.rb +39 -0
- data/app/components/arara/tags/country_select.rb +110 -0
- data/app/components/arara/tags/label.rb +78 -0
- data/app/components/arara/tags/password_field.rb +16 -0
- data/app/components/arara/tags/radio_button.rb +31 -0
- data/app/components/arara/tags/select.rb +120 -0
- data/app/components/arara/tags/text_area.rb +25 -0
- data/app/components/arara/tags/text_field.rb +31 -0
- data/app/components/arara/text_field_component.html.erb +47 -0
- data/app/components/arara/text_field_component.rb +101 -0
- data/app/components/arara/typography_component.html.erb +1 -0
- data/app/components/arara/typography_component.rb +51 -0
- data/app/controllers/arara/application_controller.rb +5 -0
- data/app/helpers/arara/application_helper.rb +4 -0
- data/app/javascript/arara/controllers/body_class_toggler_controller.js +20 -0
- data/app/javascript/arara/controllers/counter_controller.js +22 -0
- data/app/javascript/arara/controllers/demo_dialog_controller.js +24 -0
- data/app/javascript/arara/controllers/mdc_chip_set_controller.js +18 -0
- data/app/javascript/arara/controllers/mdc_data_table_controller.js +18 -0
- data/app/javascript/arara/controllers/mdc_form_field_controller.js +40 -0
- data/app/javascript/arara/controllers/mdc_icon_toggle_controller.js +18 -0
- data/app/javascript/arara/controllers/mdc_linear_progress_controller.js +18 -0
- data/app/javascript/arara/controllers/mdc_list_controller.js +23 -0
- data/app/javascript/arara/controllers/mdc_menu_controller.js +25 -0
- data/app/javascript/arara/controllers/mdc_ripple_controller.js +18 -0
- data/app/javascript/arara/controllers/mdc_select_controller.js +27 -0
- data/app/javascript/arara/controllers/mdc_slider_controller.js +21 -0
- data/app/javascript/arara/controllers/mdc_snackbar_controller.js +38 -0
- data/app/javascript/arara/controllers/mdc_switch_controller.js +18 -0
- data/app/javascript/arara/controllers/mdc_tab_bar_controller.js +18 -0
- data/app/javascript/arara/controllers/mdc_text_field_controller.js +35 -0
- data/app/javascript/arara/controllers/mdc_top_app_bar_controller.js +18 -0
- data/app/javascript/arara/controllers/rails_chip_set_choice_controller.js +31 -0
- data/app/javascript/arara/controllers/rails_chip_set_filter_controller.js +39 -0
- data/app/javascript/arara/controllers/remote_form_controller.js +79 -0
- data/app/javascript/arara/helpers/sum.js +5 -0
- data/app/javascript/arara/index.js +65 -0
- data/app/javascript/arara/scss/_material_design.scss +34 -0
- data/app/javascript/arara/scss/_tailwind.scss +4 -0
- data/app/javascript/arara/scss/arara.scss +5 -0
- data/app/javascript/arara/scss/material_design/_custom.scss +61 -0
- data/app/javascript/arara/scss/tailwind/_ripple_workaround.scss +22 -0
- data/app/jobs/arara/application_job.rb +4 -0
- data/app/mailers/arara/application_mailer.rb +6 -0
- data/app/models/arara/application_record.rb +5 -0
- data/app/views/layouts/arara/application.html.erb +15 -0
- data/config/routes.rb +2 -0
- data/lib/arara.rb +5 -0
- data/lib/arara/engine.rb +7 -0
- data/lib/arara/version.rb +3 -0
- data/lib/tasks/arara_tasks.rake +4 -0
- metadata +238 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
module Arara
|
2
|
+
class FabIconComponent < ActionView::Component::Base
|
3
|
+
include Arara::BaseComponent
|
4
|
+
validates :content, presence: true
|
5
|
+
|
6
|
+
def initialize(icon:, **kw)
|
7
|
+
super(tag: "i", **kw)
|
8
|
+
@icon = icon
|
9
|
+
end
|
10
|
+
|
11
|
+
def default_html_class
|
12
|
+
"material-icons"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,142 @@
|
|
1
|
+
module Arara
|
2
|
+
class FormBuilder < ActionView::Helpers::FormBuilder
|
3
|
+
attr_reader :template
|
4
|
+
|
5
|
+
include ActionView::Helpers::FormTagHelper
|
6
|
+
|
7
|
+
def label(method, options = {})
|
8
|
+
options.deep_stringify_keys!
|
9
|
+
super(method, options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def chipset_choice(method, options = {}, &block)
|
13
|
+
options.deep_stringify_keys!
|
14
|
+
options["variant"] = :choice
|
15
|
+
options[:data] ||= {}
|
16
|
+
options[:data][:controller] = "rails-chip-set-choice"
|
17
|
+
|
18
|
+
Tags::Chipset.new(object_name, method, self, objectify_options(options), &block).render
|
19
|
+
end
|
20
|
+
|
21
|
+
def chip_choice(method, options = {}, &block)
|
22
|
+
options.deep_stringify_keys!
|
23
|
+
options["variant"] = :choice
|
24
|
+
|
25
|
+
checked_value = options[:value].to_s
|
26
|
+
unchecked_value = 0
|
27
|
+
options[:include_hidden] = false
|
28
|
+
|
29
|
+
Tags::ChipChoice.new(object_name, method, self, checked_value, unchecked_value, objectify_options(options), &block).render
|
30
|
+
end
|
31
|
+
|
32
|
+
def chipset_filter(method, options = {}, &block)
|
33
|
+
options.deep_stringify_keys!
|
34
|
+
options["variant"] = :filter
|
35
|
+
options[:data] ||= {}
|
36
|
+
options[:data][:controller] = "rails-chip-set-filter"
|
37
|
+
|
38
|
+
Tags::Chipset.new(object_name, method, self, objectify_options(options), &block).render
|
39
|
+
end
|
40
|
+
|
41
|
+
def chip_filter(method, options = {}, &block)
|
42
|
+
options.deep_stringify_keys!
|
43
|
+
options["variant"] = :filter
|
44
|
+
|
45
|
+
checked_value = options[:value].to_s
|
46
|
+
unchecked_value = 0
|
47
|
+
options[:include_hidden] = true
|
48
|
+
options[:multiple] = true
|
49
|
+
|
50
|
+
Tags::ChipChoice.new(object_name, method, self, checked_value, unchecked_value, objectify_options(options), &block).render
|
51
|
+
end
|
52
|
+
|
53
|
+
def check_box(method, options = {}, checked_value = "1", unchecked_value = "0")
|
54
|
+
options.deep_stringify_keys!
|
55
|
+
options["label"] = options.fetch("label") { build_label(method, options) }
|
56
|
+
# options["has_error"] = has_errors_for?(method)
|
57
|
+
# options["helper_text"] = errors_for(method).join(", ")
|
58
|
+
|
59
|
+
Tags::CheckBox.new(object_name, method, self, checked_value, unchecked_value, objectify_options(options)).render
|
60
|
+
end
|
61
|
+
|
62
|
+
def text_field(method, options = {})
|
63
|
+
options.deep_stringify_keys!
|
64
|
+
options["label"] = options.fetch("label") { build_label(method, options) }
|
65
|
+
options["has_error"] = has_errors_for?(method)
|
66
|
+
options["helper_text"] ||= errors_for(method).join(", ")
|
67
|
+
|
68
|
+
Tags::TextField.new(object_name, method, self, objectify_options(options)).render
|
69
|
+
end
|
70
|
+
|
71
|
+
def password_field(method, options = {})
|
72
|
+
options.deep_stringify_keys!
|
73
|
+
options["label"] = options.fetch("label") { build_label(method, options) }
|
74
|
+
options["has_error"] = has_errors_for?(method)
|
75
|
+
options["helper_text"] = errors_for(method).join(", ")
|
76
|
+
options["type"] = "password"
|
77
|
+
|
78
|
+
Tags::PasswordField.new(object_name, method, self, objectify_options(options)).render
|
79
|
+
end
|
80
|
+
|
81
|
+
def text_area(method, options = {})
|
82
|
+
options.deep_stringify_keys!
|
83
|
+
options["label"] = options.fetch("label") { build_label(method, options) }
|
84
|
+
options["has_error"] = has_errors_for?(method)
|
85
|
+
options["helper_text"] = errors_for(method).join(", ")
|
86
|
+
|
87
|
+
Tags::TextArea.new(object_name, method, self, objectify_options(options)).render
|
88
|
+
end
|
89
|
+
|
90
|
+
def select(method, choices = nil, options = {}, html_options = {}, &block)
|
91
|
+
options.deep_stringify_keys!
|
92
|
+
options["label"] = options.fetch("label") { build_label(method, options) }
|
93
|
+
|
94
|
+
Tags::Select.new(object_name, method, self, choices, objectify_options(options), objectify_options(html_options), &block).render
|
95
|
+
end
|
96
|
+
|
97
|
+
def radio_button(method, tag_value, options = {})
|
98
|
+
options.deep_stringify_keys!
|
99
|
+
Tags::RadioButton.new(object_name, method, self, tag_value, objectify_options(options)).render
|
100
|
+
end
|
101
|
+
|
102
|
+
def country_select(method, priority_or_options = {}, options = {}, html_options = {})
|
103
|
+
options.deep_stringify_keys!
|
104
|
+
if Hash === priority_or_options
|
105
|
+
html_options = options
|
106
|
+
options = priority_or_options
|
107
|
+
else
|
108
|
+
options[:priority_countries] = priority_or_options
|
109
|
+
end
|
110
|
+
|
111
|
+
options["label"] = options.fetch("label") { build_label(method, options) }
|
112
|
+
Tags::CountrySelect.new(object_name, method, self, objectify_options(options), @default_options.merge(html_options)).render
|
113
|
+
end
|
114
|
+
|
115
|
+
def submit(value = nil, options = {})
|
116
|
+
options.deep_stringify_keys!
|
117
|
+
value, options = nil, value if value.is_a?(Hash)
|
118
|
+
value ||= submit_default_value
|
119
|
+
|
120
|
+
options = options.deep_stringify_keys
|
121
|
+
tag_options = { "type" => "submit", "name" => "commit", "value" => value }.update(options)
|
122
|
+
set_default_disable_with value, tag_options
|
123
|
+
|
124
|
+
@template.render(ButtonComponent, tag_options.symbolize_keys)
|
125
|
+
end
|
126
|
+
|
127
|
+
private
|
128
|
+
def build_label(method, options = {})
|
129
|
+
tag_value = options.delete("value")
|
130
|
+
builder = ActionView::Helpers::Tags::Label::LabelBuilder.new(self, object_name.to_s, method.to_s, nil, tag_value)
|
131
|
+
builder.translation
|
132
|
+
end
|
133
|
+
|
134
|
+
def has_errors_for?(method)
|
135
|
+
object.errors.has_key?(method)
|
136
|
+
end
|
137
|
+
|
138
|
+
def errors_for(method)
|
139
|
+
object.errors[method]
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Arara
|
2
|
+
class FormFieldComponent < ActionView::Component::Base
|
3
|
+
include Arara::BaseComponent
|
4
|
+
|
5
|
+
validates :content, presence: true
|
6
|
+
|
7
|
+
def initialize(**kw)
|
8
|
+
super(tag: "div", **kw)
|
9
|
+
end
|
10
|
+
|
11
|
+
def default_html_class
|
12
|
+
"mdc-form-field"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="<%= html_class %>" style="width: 260px; height: 40px; background-color: <%= background_color %>; border-radius: 0 25px 25px 0;">
|
2
|
+
<div class="flex" style="padding: 10px 26px; flex: 1 1 0; overflow: hidden; text-overflow: elipsis; color: <%= text_color %>;">
|
3
|
+
<span class="" style="">
|
4
|
+
<i class="material-icons-outlined" style="margin-right: 20px; font-size: 20px; color: <%= icon_color %>"><%= icon %></i>
|
5
|
+
</span>
|
6
|
+
<span class="flex-grow" style="font-size: .875rem; letter-spacing: .01785714em;">
|
7
|
+
<%= title %>
|
8
|
+
</span>
|
9
|
+
<span dir="ltr" style="font-size: .875rem;"><%= count %></span>
|
10
|
+
</div>
|
11
|
+
</div>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
class Arara::GoogleCalendar::MenuItemComponent < ActionView::Component::Base
|
2
|
+
|
3
|
+
def initialize(icon:, title:, count: nil, active: false)
|
4
|
+
@icon = icon
|
5
|
+
@title = title
|
6
|
+
@count = count
|
7
|
+
@active = active
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
attr_reader :icon, :title, :count, :active
|
12
|
+
|
13
|
+
def background_color
|
14
|
+
return "#e8f0fe" if active
|
15
|
+
"inherit"
|
16
|
+
end
|
17
|
+
|
18
|
+
def icon_color
|
19
|
+
return "#1a73e8" if active
|
20
|
+
"#616161"
|
21
|
+
end
|
22
|
+
|
23
|
+
def text_color
|
24
|
+
return "#1a73e8" if active
|
25
|
+
"#202124"
|
26
|
+
end
|
27
|
+
|
28
|
+
def html_class
|
29
|
+
klass = "nav_bar__menu_item"
|
30
|
+
klass << " nav_bar__menu_item--active" if active
|
31
|
+
klass
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -0,0 +1,176 @@
|
|
1
|
+
<style>
|
2
|
+
.nav_bar__top {
|
3
|
+
position: -webkit-sticky; /* Safari */
|
4
|
+
position: sticky;
|
5
|
+
top: 0;
|
6
|
+
}
|
7
|
+
|
8
|
+
.nav_bar__settings {
|
9
|
+
margin-left: 0px;
|
10
|
+
}
|
11
|
+
|
12
|
+
.nav_bar__utils_avatar {
|
13
|
+
|
14
|
+
}
|
15
|
+
|
16
|
+
.nav_bar__menu {
|
17
|
+
background-color: white;
|
18
|
+
padding-top: 15px;
|
19
|
+
position: absolute;
|
20
|
+
height: calc(100vh);
|
21
|
+
overflow-y: auto;
|
22
|
+
width: 280px;
|
23
|
+
}
|
24
|
+
|
25
|
+
.nav_bar__menu_item:not(.nav_bar__menu_item--active):hover {
|
26
|
+
background-color: #f1f3f4 !important;
|
27
|
+
}
|
28
|
+
|
29
|
+
/* closed on mobile */
|
30
|
+
body.menu--toggler #nav_bar .nav_bar__menu {
|
31
|
+
visibility: hidden;
|
32
|
+
-webkit-transform: translateX(-280px);
|
33
|
+
transform: translateX(-280px);
|
34
|
+
-webkit-transition: transform .25s cubic-bezier(0.4,0.0,0.2,1),visibility 0s linear .25s;
|
35
|
+
transition: transform .25s cubic-bezier(0.4,0.0,0.2,1),visibility 0s linear .25s;
|
36
|
+
}
|
37
|
+
|
38
|
+
/* open on mobile */
|
39
|
+
body:not(.menu--toggler) #nav_bar .nav_bar__menu {
|
40
|
+
visibility: visible;
|
41
|
+
-webkit-transform: translateX(0);
|
42
|
+
transform: translateX(0);
|
43
|
+
-webkit-transition: transform .25s cubic-bezier(0.4,0.0,0.2,1),visibility 0s linear 0s;
|
44
|
+
transition: transform .25s cubic-bezier(0.4,0.0,0.2,1),visibility 0s linear 0s;
|
45
|
+
}
|
46
|
+
|
47
|
+
.nav_bar__logo {
|
48
|
+
min-width: 150px;
|
49
|
+
width: 150px;
|
50
|
+
padding-right: 14px;
|
51
|
+
}
|
52
|
+
|
53
|
+
@media (max-width: 768px) {
|
54
|
+
body #nav_bar .nav_bar__menu {
|
55
|
+
box-shadow: 0 0 16px rgba(0,0,0,.28);
|
56
|
+
top: 0;
|
57
|
+
position: absolute;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
@media (min-width: 640px) {
|
61
|
+
.nav_bar__logo {
|
62
|
+
min-width: 200px;
|
63
|
+
width: 200px;
|
64
|
+
padding-right: 14px;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
@media (min-width: 768px) {
|
69
|
+
.nav_bar__logo {
|
70
|
+
min-width: 268px;
|
71
|
+
padding-right: 30px;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
@media (min-width: 1024px) {
|
76
|
+
.nav_bar__settings {
|
77
|
+
margin-left: 50px;
|
78
|
+
}
|
79
|
+
|
80
|
+
.nav_bar__utils {
|
81
|
+
padding-left: 30px;
|
82
|
+
}
|
83
|
+
|
84
|
+
.nav_bar__menu {
|
85
|
+
padding-top: 15px;
|
86
|
+
position: absolute;
|
87
|
+
height: calc(100vh - 64px);
|
88
|
+
overflow-y: auto;
|
89
|
+
width: 280px;
|
90
|
+
}
|
91
|
+
|
92
|
+
body.menu--toggler #nav_bar .nav_bar__menu {
|
93
|
+
visibility: visible;
|
94
|
+
-webkit-transform: translateX(0);
|
95
|
+
transform: translateX(0);
|
96
|
+
-webkit-transition: transform .25s cubic-bezier(0.4,0.0,0.2,1),visibility 0s linear 0s;
|
97
|
+
transition: transform .25s cubic-bezier(0.4,0.0,0.2,1),visibility 0s linear 0s;
|
98
|
+
}
|
99
|
+
|
100
|
+
body:not(.menu--toggler) #nav_bar .nav_bar__menu {
|
101
|
+
visibility: hidden;
|
102
|
+
-webkit-transform: translateX(-280px);
|
103
|
+
transform: translateX(-280px);
|
104
|
+
-webkit-transition: transform .25s cubic-bezier(0.4,0.0,0.2,1),visibility 0s linear .25s;
|
105
|
+
transition: transform .25s cubic-bezier(0.4,0.0,0.2,1),visibility 0s linear .25s;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
|
109
|
+
@media (min-width: 1280px) {
|
110
|
+
}
|
111
|
+
</style>
|
112
|
+
<div id="nav_bar">
|
113
|
+
<div class="nav_bar__top flex items-center h-16" style="padding: 8px;">
|
114
|
+
<div class="nav_bar__logo flex" style="">
|
115
|
+
<div class="ml-1" style="color: #5f6368;" data-controller="body-class-toggler" data-action="click->body-class-toggler#toggle" data-body-class-toggler-class="menu--toggler">
|
116
|
+
<%= render(IconButtonComponent, title: "menu") %>
|
117
|
+
</div>
|
118
|
+
<div class="flex items-center">
|
119
|
+
<%= image_tag "arara_logo.png", class: "ml-1 mr-2 hidden md:block", alt: "", 'aria-hidden': "true", style: "width:40px;height:40px", 'data-iml': "11962.05000000191", 'data-atf': "true" %>
|
120
|
+
<span style="font-size: 22px; color: #5f6368;">Arara</span>
|
121
|
+
</div>
|
122
|
+
</div>
|
123
|
+
<div class="nav_bar__search flex flex-grow justify-end" style="height: 46px;">
|
124
|
+
<%# search desk %>
|
125
|
+
<div class="flex-grow hidden md:block" style="padding-left: 10px; padding-right: 30px; width: 100%; max-width: 100%;">
|
126
|
+
<div class="flex flex-grow items-center rounded-lg" style="height: 46px; max-width: 720px; background: #f1f3f4; color: #5f6368;">
|
127
|
+
<%= render(IconButtonComponent, title: "search") %>
|
128
|
+
<div>
|
129
|
+
Search
|
130
|
+
</div>
|
131
|
+
</div>
|
132
|
+
</div>
|
133
|
+
<div class="nav_bar__settings flex" style="">
|
134
|
+
<%# search mobile %>
|
135
|
+
<div class="flex-grow flex items-center block md:hidden" style="color: #5f6368;">
|
136
|
+
<%= render(IconButtonComponent, title: "search") %>
|
137
|
+
</div>
|
138
|
+
<div class="flex items-center justify-center" style="height: 48px; min-width: 48px; vertical-align: middle;">
|
139
|
+
<svg width="20" height="20" viewBox="0 0 24 24" style="color: #5f6368; fill: currentColor;"><path fill="none" d="M0 0h24v24H0V0z"></path><path d="M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"></path></svg>
|
140
|
+
</div>
|
141
|
+
<div class="flex items-center justify-center" style="height: 48px; min-width: 48px; vertical-align: middle;">
|
142
|
+
<svg width="20" height="20" viewBox="0 0 24 24" style="color: #5f6368; fill: currentColor;"><path d="M13.85 22.25h-3.7c-.74 0-1.36-.54-1.45-1.27l-.27-1.89c-.27-.14-.53-.29-.79-.46l-1.8.72c-.7.26-1.47-.03-1.81-.65L2.2 15.53c-.35-.66-.2-1.44.36-1.88l1.53-1.19c-.01-.15-.02-.3-.02-.46 0-.15.01-.31.02-.46l-1.52-1.19c-.59-.45-.74-1.26-.37-1.88l1.85-3.19c.34-.62 1.11-.9 1.79-.63l1.81.73c.26-.17.52-.32.78-.46l.27-1.91c.09-.7.71-1.25 1.44-1.25h3.7c.74 0 1.36.54 1.45 1.27l.27 1.89c.27.14.53.29.79.46l1.8-.72c.71-.26 1.48.03 1.82.65l1.84 3.18c.36.66.2 1.44-.36 1.88l-1.52 1.19c.01.15.02.3.02.46s-.01.31-.02.46l1.52 1.19c.56.45.72 1.23.37 1.86l-1.86 3.22c-.34.62-1.11.9-1.8.63l-1.8-.72c-.26.17-.52.32-.78.46l-.27 1.91c-.1.68-.72 1.22-1.46 1.22zm-3.23-2h2.76l.37-2.55.53-.22c.44-.18.88-.44 1.34-.78l.45-.34 2.38.96 1.38-2.4-2.03-1.58.07-.56c.03-.26.06-.51.06-.78s-.03-.53-.06-.78l-.07-.56 2.03-1.58-1.39-2.4-2.39.96-.45-.35c-.42-.32-.87-.58-1.33-.77l-.52-.22-.37-2.55h-2.76l-.37 2.55-.53.21c-.44.19-.88.44-1.34.79l-.45.33-2.38-.95-1.39 2.39 2.03 1.58-.07.56a7 7 0 0 0-.06.79c0 .26.02.53.06.78l.07.56-2.03 1.58 1.38 2.4 2.39-.96.45.35c.43.33.86.58 1.33.77l.53.22.38 2.55z"></path><circle cx="12" cy="12" r="3.5"></circle></svg>
|
143
|
+
</div>
|
144
|
+
</div>
|
145
|
+
</div>
|
146
|
+
<div class="nav_bar__utils flex" style="padding-right: 4px;">
|
147
|
+
<div class="flex items-center">
|
148
|
+
<div class="flex items-center justify-center hidden lg:flex" style="height: 48px; min-width: 48px; vertical-align: middle;">
|
149
|
+
<svg width="24" height="24" focusable="false" viewBox="0 0 24 24" style="color: #5f6368; fill: currentColor;"><path d="M6,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,20c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM6,20c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM6,14c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,14c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM16,6c0,1.1 0.9,2 2,2s2,-0.9 2,-2 -0.9,-2 -2,-2 -2,0.9 -2,2zM12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,14c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,20c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2z"></path></svg>
|
150
|
+
</div>
|
151
|
+
<div class="flex items-center justify-center" style="height: 40px; min-width: 40px; vertical-align: middle; padding: 4px;">
|
152
|
+
<img class="rounded-full overflow-hidden" style="height: 32px; width: 32px; vertical-align: middle;" src="https://www.gravatar.com/avatar/2df88e06bc946068934732ea24e3113e.jpg?s=32" alt="lovely avatar" class="object-cover object-center w-full h-full visible group-hover:hidden" />
|
153
|
+
</div>
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
</div>
|
157
|
+
<div class="nav_bar__menu">
|
158
|
+
<div style="width: 260px;">
|
159
|
+
<%= render(MenuItemComponent, icon: "perm_identity", title: "Contacts", count: 203, active: true) %>
|
160
|
+
<%= render(MenuItemComponent, icon: "restore", title: "Frequently contacted") %>
|
161
|
+
<%= render(MenuItemComponent, icon: "filter_none", title: "Duplicates") %>
|
162
|
+
<%= render(MenuDividerComponent) %>
|
163
|
+
<%= render(MenuItemComponent, icon: "expand_less", title: "Labels") %>
|
164
|
+
<%= render(MenuItemComponent, icon: "label", title: "Foo") %>
|
165
|
+
<%= render(MenuItemComponent, icon: "label", title: "Bar") %>
|
166
|
+
<%= render(MenuItemComponent, icon: "label", title: "Baz") %>
|
167
|
+
<%= render(MenuItemComponent, icon: "add", title: "Create Label") %>
|
168
|
+
<%= render(MenuDividerComponent) %>
|
169
|
+
<%= render(MenuItemComponent, icon: "publish", title: "Import") %>
|
170
|
+
<%= render(MenuItemComponent, icon: "cloud_download", title: "Export") %>
|
171
|
+
<%= render(MenuItemComponent, icon: "print", title: "Print") %>
|
172
|
+
<%= render(MenuDividerComponent) %>
|
173
|
+
<%= render(MenuItemComponent, icon: "archive", title: "Other Contacts") %>
|
174
|
+
</div>
|
175
|
+
</div>
|
176
|
+
</div>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Arara
|
2
|
+
class IconButtonComponent < ActionView::Component::Base
|
3
|
+
include Arara::BaseComponent
|
4
|
+
|
5
|
+
validates :content, presence: true
|
6
|
+
attr_reader :title, :pressed
|
7
|
+
|
8
|
+
def initialize(title: nil, pressed: nil, **kw)
|
9
|
+
super(tag: "button", **kw)
|
10
|
+
@title = title
|
11
|
+
@pressed = pressed
|
12
|
+
end
|
13
|
+
|
14
|
+
def default_html_class
|
15
|
+
'mdc-icon-button'
|
16
|
+
end
|
17
|
+
|
18
|
+
def aria_data
|
19
|
+
data = {}
|
20
|
+
data[:label] = title if title
|
21
|
+
data[:pressed] = pressed unless pressed.nil?
|
22
|
+
data
|
23
|
+
end
|
24
|
+
|
25
|
+
def html_options
|
26
|
+
opts = super
|
27
|
+
opts.merge!(title: title) if title
|
28
|
+
opts.merge!(aria: aria_data)
|
29
|
+
opts
|
30
|
+
end
|
31
|
+
|
32
|
+
def html_data
|
33
|
+
data = super
|
34
|
+
data.merge!('mdc-ripple-is-unbounded' => "")
|
35
|
+
data
|
36
|
+
end
|
37
|
+
|
38
|
+
def default_data_controller
|
39
|
+
"mdc-ripple"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|