polaris_view_helpers 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 479f0e36712d011153a8f549e60b3ee16b505d77
4
- data.tar.gz: b81840807842fae3a850814cd2ff4f4c48590657
3
+ metadata.gz: 33973c64aa10c6e08fbe3419378a0db415545b78
4
+ data.tar.gz: 37e8a110adcf35b0316282bf246d1c56e58d7db7
5
5
  SHA512:
6
- metadata.gz: 4ce3c3210a66bb30dd2200834863dbfe7c7c3f3ae1fe78a6c31d2c4b3a4de5d4176975eb4b45d3aefc9af8edf9157e5ed8743c190eda61b27693da1b9d0ed7ee
7
- data.tar.gz: bdd538837ff6d3e5529cfb5df720b45b80b69a354fede073d65bb1d59934e13c42317e8b654e859fec3851d28fdcf8fc3ef43a58c6af0e7f023e4cf34909857c
6
+ metadata.gz: dd20cefd1bfc89535314c16fd2a8aee955f251a32b53bc876304feb0440d837592c83a08228ee5cb48c7522cf8c378dd371a4691b179dc58ed6c383a565618e8
7
+ data.tar.gz: 9159a21538d0d8cfa38716d769cfd75488021b9222ca70b1645a9799641390728904f4bc6b68f76ebd9867737b2bc45854f7a692e65cccd4412c7fa337bcd82c
@@ -0,0 +1,10 @@
1
+ <div class="Polaris-Card">
2
+ <% if heading.present? %>
3
+ <div class="Polaris-Card__Header">
4
+ <h2 class="Polaris-Heading"><%= heading %></h2>
5
+ </div>
6
+ <% end %>
7
+ <div class="Polaris-Card__Section">
8
+ <%= capture(&block) %>
9
+ </div>
10
+ </div>
@@ -0,0 +1,5 @@
1
+ <dl class="Polaris-DescriptionList">
2
+ <%= capture(&block) %>
3
+ </dl>
4
+
5
+
@@ -0,0 +1,2 @@
1
+ <dt class="Polaris-DescriptionList__Term"><%= term %></dt>
2
+ <dd class="Polaris-DescriptionList__Description"><%= capture(&block) %></dd>
@@ -0,0 +1,18 @@
1
+ <div class="Polaris-FooterHelp">
2
+ <div class="Polaris-FooterHelp__Content">
3
+ <div class="Polaris-FooterHelp__Icon">
4
+ <span class="Polaris-Icon Polaris-Icon--colorTeal Polaris-Icon--hasBackdropNo">
5
+ <svg role="img" class="Polaris-Icon__Svg" aria-labelledby="next-help-f4f13b47b896c4e3dda071982d260af5-title">
6
+ <title id="next-help-f4f13b47b896c4e3dda071982d260af5-title">Help</title>
7
+ <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#<%= icon %>">
8
+ </use>
9
+ </svg>
10
+ </span>
11
+ </div>
12
+ <div class="Polaris-FooterHelp__Text">
13
+ <%= capture(&block) %>
14
+ </div>
15
+ </div>
16
+ </div>
17
+
18
+
@@ -0,0 +1,4 @@
1
+ <div class="Polaris-Layout__Section <%= extra_class %>">
2
+ <%= capture(&block) %>
3
+ </div>
4
+
@@ -0,0 +1,3 @@
1
+ <%= link_to link_destination, method: method, class: "Polaris-Link", 'data-polaris-unstyled': true do %>
2
+ <%= name || capture(&block) %>
3
+ <% end %>
@@ -1,11 +1,13 @@
1
1
  <% attribute.each do |att| %>
2
2
  <div class="Polaris-FormLayout__Item">
3
3
  <div class="">
4
- <div class="Polaris-Labelled__LabelWrapper">
5
- <div class="Polaris-Label">
6
- <%= form.label att, options[:label], class: 'Polaris-Label__Text' %>
4
+ <% unless options[:supress_label] %>
5
+ <div class="Polaris-Labelled__LabelWrapper">
6
+ <div class="Polaris-Label">
7
+ <%= form.label att, options[:label], class: 'Polaris-Label__Text' %>
8
+ </div>
7
9
  </div>
8
- </div>
10
+ <% end %>
9
11
  <div class="Polaris-TextField">
10
12
  <%= form.send element_type, att, id: "#{form.object.class.name.tableize.singularize}_#{att}", class: "Polaris-TextField__Input", placeholder: options[:placeholder] %>
11
13
  <div class="Polaris-TextField__Backdrop"></div>
@@ -40,6 +40,14 @@ module PolarisViewHelpers
40
40
  )
41
41
  end
42
42
 
43
+ def polaris_layout_section(secondary: false, &block)
44
+ extra_class = secondary ? "Polaris-Layout__Section--secondary" : ""
45
+ render(
46
+ partial: 'polaris/layout_section',
47
+ locals: { block: block, extra_class: extra_class }
48
+ )
49
+ end
50
+
43
51
  def polaris_form_layout(&block)
44
52
  render(
45
53
  partial: 'polaris/form_layout',
@@ -104,6 +112,28 @@ module PolarisViewHelpers
104
112
  )
105
113
  end
106
114
 
115
+ def polaris_link_to(name = nil, link_destination = nil, button_options = nil, &block)
116
+ if block_given?
117
+ button_options, link_destination, name = link_destination, name, nil
118
+ end
119
+ button_options ||= {}
120
+
121
+ additional_classes = ""
122
+ (button_options[:modifiers] || []).each do |modifier|
123
+ additional_classes += "Polaris-Button--#{modifier} "
124
+ end
125
+ render(
126
+ partial: 'polaris/link_to',
127
+ locals: {
128
+ name: name,
129
+ block: block,
130
+ additional_classes: additional_classes,
131
+ link_destination: link_destination,
132
+ method: button_options[:method]
133
+ }
134
+ )
135
+ end
136
+
107
137
  def polaris_model_errors model
108
138
  render(
109
139
  partial: 'polaris/model_errors',
@@ -264,5 +294,33 @@ module PolarisViewHelpers
264
294
  )
265
295
  end
266
296
 
297
+ def polaris_description_list(&block)
298
+ render(
299
+ partial: 'polaris/description_list',
300
+ locals: { block: block }
301
+ )
302
+ end
303
+
304
+ def polaris_description_list_item(term, &block)
305
+ render(
306
+ partial: 'polaris/description_list_item',
307
+ locals: { block: block, term: term }
308
+ )
309
+ end
310
+
311
+ def polaris_card(heading = nil, &block)
312
+ render(
313
+ partial: 'polaris/card',
314
+ locals: { block: block, heading: heading }
315
+ )
316
+ end
317
+
318
+ def polaris_footer_help(icon: 'next-help-circle', &block)
319
+ render(
320
+ partial: 'polaris/footer_help',
321
+ locals: { block: block, icon: icon }
322
+ )
323
+ end
324
+
267
325
  end
268
326
  end
@@ -1,3 +1,3 @@
1
1
  module PolarisViewHelpers
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polaris_view_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Green
@@ -56,11 +56,17 @@ files:
56
56
  - app/views/polaris/_banner_actions.html.erb
57
57
  - app/views/polaris/_button_link_to.html.erb
58
58
  - app/views/polaris/_button_tag.html.erb
59
+ - app/views/polaris/_card.html.erb
60
+ - app/views/polaris/_description_list.html.erb
61
+ - app/views/polaris/_description_list_item.html.erb
62
+ - app/views/polaris/_footer_help.html.erb
59
63
  - app/views/polaris/_form_layout.html.erb
60
64
  - app/views/polaris/_form_layout_item.html.erb
61
65
  - app/views/polaris/_form_layout_item_select.html.erb
62
66
  - app/views/polaris/_heading.html.erb
63
67
  - app/views/polaris/_layout.html.erb
68
+ - app/views/polaris/_layout_section.html.erb
69
+ - app/views/polaris/_link_to.html.erb
64
70
  - app/views/polaris/_model_errors.html.erb
65
71
  - app/views/polaris/_page.html.erb
66
72
  - app/views/polaris/_page_actions.html.erb