sdr_view_components 0.2.1 → 0.3.0
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/Rakefile +31 -5
- data/app/assets/sdr_view_components.css +9 -1
- data/app/components/sdr_view_components/elements/toast_component.html.erb +4 -8
- data/app/components/sdr_view_components/forms/basic_select_field_component.rb +24 -0
- data/app/components/sdr_view_components/forms/select_field_component.rb +20 -0
- data/app/components/sdr_view_components/forms/toggle_component.html.erb +1 -1
- data/app/components/sdr_view_components/forms/toggle_option_component.html.erb +1 -1
- data/app/components/sdr_view_components/tables/row_component.html.erb +1 -1
- data/app/views/layouts/lookbook.html.erb +1 -2
- data/lib/sdr_view_components/version.rb +1 -1
- data/spec/components/previews/sdr_view_components/elements/tooltip_component_preview/default.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/basic/basic_checkbox_component_preview/checked.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/basic/basic_checkbox_component_preview/default.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/basic/basic_checkbox_component_preview/disabled.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/basic/basic_file_component_preview/default.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/basic/basic_file_component_preview/with_accept.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/basic/basic_file_component_preview/with_multiple.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/basic/basic_file_component_preview/with_required.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/basic/basic_radio_button_component_preview/checked.html.erb +5 -5
- data/spec/components/previews/sdr_view_components/forms/basic/basic_radio_button_component_preview/default.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/basic/basic_radio_button_component_preview/disabled.html.erb +5 -5
- data/spec/components/previews/sdr_view_components/forms/basic/basic_select_field_component_preview/default.html.erb +11 -0
- data/spec/components/previews/sdr_view_components/forms/basic/basic_select_field_component_preview/with_prompt.html.erb +12 -0
- data/spec/components/previews/sdr_view_components/forms/basic/basic_select_field_component_preview.rb +13 -0
- data/spec/components/previews/sdr_view_components/forms/basic/basic_text_area_component_preview/default.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/basic/basic_text_area_component_preview/with_placeholder.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/basic/basic_text_area_component_preview/with_required.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/basic/basic_text_area_component_preview/with_rows.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/basic/basic_text_field_component_preview/default.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/basic/basic_text_field_component_preview/disabled.html.erb +5 -5
- data/spec/components/previews/sdr_view_components/forms/basic/basic_text_field_component_preview/required.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/basic/basic_text_field_component_preview/with_placeholder.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/checkbox_component_preview/checked.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/checkbox_component_preview/default.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/checkbox_component_preview/disabled.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/checkbox_component_preview/with_additional_container_content.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/checkbox_component_preview/with_help_text.html.erb +5 -5
- data/spec/components/previews/sdr_view_components/forms/checkbox_component_preview/with_label.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/checkbox_component_preview/with_validation_error.html.erb +3 -4
- data/spec/components/previews/sdr_view_components/forms/file_component_preview/default.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/file_component_preview/with_additional_container_content.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/file_component_preview/with_help_text.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/file_component_preview/with_help_text_below.html.erb +5 -5
- data/spec/components/previews/sdr_view_components/forms/file_component_preview/with_label.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/file_component_preview/with_multiple.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/file_component_preview/with_validation_error.html.erb +3 -4
- data/spec/components/previews/sdr_view_components/forms/help_text_component_preview/with_text.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/label_component_preview/default.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/label_component_preview/hidden_label.html.erb +5 -5
- data/spec/components/previews/sdr_view_components/forms/label_component_preview/with_caption.html.erb +5 -5
- data/spec/components/previews/sdr_view_components/forms/label_component_preview/with_tooltip.html.erb +5 -5
- data/spec/components/previews/sdr_view_components/forms/radio_button_component_preview/default.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/radio_button_component_preview/with_additional_container_content.html.erb +5 -5
- data/spec/components/previews/sdr_view_components/forms/radio_button_component_preview/with_disabled_label.html.erb +11 -0
- data/spec/components/previews/sdr_view_components/forms/radio_button_component_preview/with_help_text.html.erb +5 -5
- data/spec/components/previews/sdr_view_components/forms/radio_button_component_preview/with_help_text_below.html.erb +6 -6
- data/spec/components/previews/sdr_view_components/forms/radio_button_component_preview/with_label.html.erb +5 -5
- data/spec/components/previews/sdr_view_components/forms/radio_button_component_preview/with_validation_error.html.erb +5 -6
- data/spec/components/previews/sdr_view_components/forms/radio_button_component_preview.rb +4 -0
- data/spec/components/previews/sdr_view_components/forms/select_field_component_preview/default.html.erb +13 -0
- data/spec/components/previews/sdr_view_components/forms/select_field_component_preview/with_additional_container_content.html.erb +19 -0
- data/spec/components/previews/sdr_view_components/forms/select_field_component_preview/with_help_text.html.erb +14 -0
- data/spec/components/previews/sdr_view_components/forms/select_field_component_preview/with_help_text_below.html.erb +15 -0
- data/spec/components/previews/sdr_view_components/forms/select_field_component_preview/with_prompt.html.erb +14 -0
- data/spec/components/previews/sdr_view_components/forms/select_field_component_preview/with_validation_error.html.erb +15 -0
- data/spec/components/previews/sdr_view_components/forms/select_field_component_preview.rb +30 -0
- data/spec/components/previews/sdr_view_components/forms/submit_component_preview/danger.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/submit_component_preview/default.html.erb +2 -2
- data/spec/components/previews/sdr_view_components/forms/submit_component_preview/info.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/submit_component_preview/primary.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/submit_component_preview/secondary.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/submit_component_preview/success.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/submit_component_preview/warning.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/submit_component_preview/with_block_content_and_value.html.erb +2 -2
- data/spec/components/previews/sdr_view_components/forms/submit_component_preview/with_form_id.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/text_area_component_preview/default.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/text_area_component_preview/with_additional_container_content.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/text_area_component_preview/with_help_text.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/text_area_component_preview/with_help_text_below.html.erb +5 -5
- data/spec/components/previews/sdr_view_components/forms/text_area_component_preview/with_hidden_label.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/text_area_component_preview/with_mark_required.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/text_area_component_preview/with_validation_error.html.erb +3 -4
- data/spec/components/previews/sdr_view_components/forms/text_field_component_preview/default.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/text_field_component_preview/disabled.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/text_field_component_preview/label_hidden.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/text_field_component_preview/marked_required.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/text_field_component_preview/required.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/text_field_component_preview/with_additional_container_content.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/text_field_component_preview/with_help_text.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/text_field_component_preview/with_help_text_below.html.erb +5 -5
- data/spec/components/previews/sdr_view_components/forms/text_field_component_preview/with_placeholder.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/forms/text_field_component_preview/with_validation_error.html.erb +3 -4
- data/spec/components/previews/sdr_view_components/forms/toggle_component_preview/default.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/forms/toggle_component_preview/with_validation_error.html.erb +3 -4
- data/spec/components/previews/sdr_view_components/tables/row_component_preview/with_first_value_and_values.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/tables/row_component_preview/with_tooltip.html.erb +4 -4
- data/spec/components/previews/sdr_view_components/tables/row_component_preview/with_value.html.erb +3 -3
- data/spec/components/previews/sdr_view_components/tables/row_component_preview/with_values.html.erb +3 -3
- metadata +14 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
<%= form_with(model: model, url: '/example') do |form| %>
|
|
4
4
|
<%= render SdrViewComponents::Forms::TextFieldComponent.new(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
form: form,
|
|
6
|
+
field_name: :title,
|
|
7
|
+
input_required: true
|
|
8
|
+
) %>
|
|
9
9
|
<% end %>
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
<%= form_with(model: model, url: '/example') do |form| %>
|
|
4
4
|
<%= render SdrViewComponents::Forms::TextFieldComponent.new(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
form: form,
|
|
6
|
+
field_name: :title
|
|
7
|
+
) do |component| %>
|
|
8
8
|
<% component.with_additional_container_content do %>
|
|
9
9
|
<span class="text-info">Suggested: keep titles under 80 characters.</span>
|
|
10
10
|
<% end %>
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
<%= form_with(model: model, url: '/example') do |form| %>
|
|
4
4
|
<%= render SdrViewComponents::Forms::TextFieldComponent.new(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
form: form,
|
|
6
|
+
field_name: :title,
|
|
7
|
+
help_text: 'Use a concise title that will make sense to end users.'
|
|
8
|
+
) %>
|
|
9
9
|
<% end %>
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
<%= form_with(model: model, url: '/example') do |form| %>
|
|
4
4
|
<%= render SdrViewComponents::Forms::TextFieldComponent.new(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
form: form,
|
|
6
|
+
field_name: :title,
|
|
7
|
+
variant: :help_text_below,
|
|
8
|
+
help_text: 'Help text appears below the field when using the help_text_below variant.'
|
|
9
|
+
) %>
|
|
10
10
|
<% end %>
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
<%= form_with(model: model, url: '/example') do |form| %>
|
|
4
4
|
<%= render SdrViewComponents::Forms::TextFieldComponent.new(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
form: form,
|
|
6
|
+
field_name: :title,
|
|
7
|
+
input_placeholder: 'Enter a descriptive title'
|
|
8
|
+
) %>
|
|
9
9
|
<% end %>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
<% model = SdrViewComponents::Forms::TextFieldComponentPreview::TextFieldPreviewModel.new(title: nil) %>
|
|
2
|
-
<% model.valid? %>
|
|
3
2
|
|
|
4
3
|
<%= form_with(model: model, url: '/example') do |form| %>
|
|
5
4
|
<%= render SdrViewComponents::Forms::TextFieldComponent.new(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
form: form,
|
|
6
|
+
field_name: :title
|
|
7
|
+
) %>
|
|
9
8
|
<% end %>
|
data/spec/components/previews/sdr_view_components/forms/toggle_component_preview/default.html.erb
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
<%= form_with(model: model, url: '/example') do |form| %>
|
|
4
4
|
<%= render SdrViewComponents::Forms::ToggleComponent.new(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
form: form,
|
|
6
|
+
field_name: :audience
|
|
7
|
+
) do |component| %>
|
|
8
8
|
<% component.with_left_toggle_option(form:, field_name: :audience, label: 'Collections', value: 'collections') %>
|
|
9
9
|
<% component.with_right_toggle_option(form:, field_name: :audience, label: 'Items', value: 'items') %>
|
|
10
10
|
<% end %>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<% model = SdrViewComponents::Forms::ToggleComponentPreview::TogglePreviewModel.new(audience: nil) %>
|
|
2
|
-
<% model.valid? %>
|
|
3
2
|
|
|
4
3
|
<%= form_with(model: model, url: '/example') do |form| %>
|
|
5
4
|
<%= render SdrViewComponents::Forms::ToggleComponent.new(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
form: form,
|
|
6
|
+
field_name: :audience
|
|
7
|
+
) do |component| %>
|
|
9
8
|
<% component.with_left_toggle_option(form:, field_name: :audience, label: 'Collections', value: 'collections') %>
|
|
10
9
|
<% component.with_right_toggle_option(form:, field_name: :audience, label: 'Items', value: 'items') %>
|
|
11
10
|
<% end %>
|
data/spec/components/previews/sdr_view_components/tables/row_component_preview/with_tooltip.html.erb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<table class="table">
|
|
2
2
|
<tbody>
|
|
3
3
|
<%= render SdrViewComponents::Tables::RowComponent.new(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
label: 'Embargo',
|
|
5
|
+
value: 'Ends 2027-01-15',
|
|
6
|
+
tooltip: 'Date when the item becomes visible to the public.'
|
|
7
|
+
) %>
|
|
8
8
|
</tbody>
|
|
9
9
|
</table>
|
|
10
10
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sdr_view_components
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Aaron Collier
|
|
@@ -111,6 +111,7 @@ files:
|
|
|
111
111
|
- app/components/sdr_view_components/forms/basic_component.rb
|
|
112
112
|
- app/components/sdr_view_components/forms/basic_file_component.rb
|
|
113
113
|
- app/components/sdr_view_components/forms/basic_radio_button_component.rb
|
|
114
|
+
- app/components/sdr_view_components/forms/basic_select_field_component.rb
|
|
114
115
|
- app/components/sdr_view_components/forms/basic_text_area_component.rb
|
|
115
116
|
- app/components/sdr_view_components/forms/basic_text_field_component.rb
|
|
116
117
|
- app/components/sdr_view_components/forms/checkbox_component.rb
|
|
@@ -124,6 +125,7 @@ files:
|
|
|
124
125
|
- app/components/sdr_view_components/forms/label_component.html.erb
|
|
125
126
|
- app/components/sdr_view_components/forms/label_component.rb
|
|
126
127
|
- app/components/sdr_view_components/forms/radio_button_component.rb
|
|
128
|
+
- app/components/sdr_view_components/forms/select_field_component.rb
|
|
127
129
|
- app/components/sdr_view_components/forms/submit_component.html.erb
|
|
128
130
|
- app/components/sdr_view_components/forms/submit_component.rb
|
|
129
131
|
- app/components/sdr_view_components/forms/text_area_component.rb
|
|
@@ -203,6 +205,9 @@ files:
|
|
|
203
205
|
- spec/components/previews/sdr_view_components/forms/basic/basic_radio_button_component_preview/checked.html.erb
|
|
204
206
|
- spec/components/previews/sdr_view_components/forms/basic/basic_radio_button_component_preview/default.html.erb
|
|
205
207
|
- spec/components/previews/sdr_view_components/forms/basic/basic_radio_button_component_preview/disabled.html.erb
|
|
208
|
+
- spec/components/previews/sdr_view_components/forms/basic/basic_select_field_component_preview.rb
|
|
209
|
+
- spec/components/previews/sdr_view_components/forms/basic/basic_select_field_component_preview/default.html.erb
|
|
210
|
+
- spec/components/previews/sdr_view_components/forms/basic/basic_select_field_component_preview/with_prompt.html.erb
|
|
206
211
|
- spec/components/previews/sdr_view_components/forms/basic/basic_text_area_component_preview.rb
|
|
207
212
|
- spec/components/previews/sdr_view_components/forms/basic/basic_text_area_component_preview/default.html.erb
|
|
208
213
|
- spec/components/previews/sdr_view_components/forms/basic/basic_text_area_component_preview/with_placeholder.html.erb
|
|
@@ -240,10 +245,18 @@ files:
|
|
|
240
245
|
- spec/components/previews/sdr_view_components/forms/radio_button_component_preview.rb
|
|
241
246
|
- spec/components/previews/sdr_view_components/forms/radio_button_component_preview/default.html.erb
|
|
242
247
|
- spec/components/previews/sdr_view_components/forms/radio_button_component_preview/with_additional_container_content.html.erb
|
|
248
|
+
- spec/components/previews/sdr_view_components/forms/radio_button_component_preview/with_disabled_label.html.erb
|
|
243
249
|
- spec/components/previews/sdr_view_components/forms/radio_button_component_preview/with_help_text.html.erb
|
|
244
250
|
- spec/components/previews/sdr_view_components/forms/radio_button_component_preview/with_help_text_below.html.erb
|
|
245
251
|
- spec/components/previews/sdr_view_components/forms/radio_button_component_preview/with_label.html.erb
|
|
246
252
|
- spec/components/previews/sdr_view_components/forms/radio_button_component_preview/with_validation_error.html.erb
|
|
253
|
+
- spec/components/previews/sdr_view_components/forms/select_field_component_preview.rb
|
|
254
|
+
- spec/components/previews/sdr_view_components/forms/select_field_component_preview/default.html.erb
|
|
255
|
+
- spec/components/previews/sdr_view_components/forms/select_field_component_preview/with_additional_container_content.html.erb
|
|
256
|
+
- spec/components/previews/sdr_view_components/forms/select_field_component_preview/with_help_text.html.erb
|
|
257
|
+
- spec/components/previews/sdr_view_components/forms/select_field_component_preview/with_help_text_below.html.erb
|
|
258
|
+
- spec/components/previews/sdr_view_components/forms/select_field_component_preview/with_prompt.html.erb
|
|
259
|
+
- spec/components/previews/sdr_view_components/forms/select_field_component_preview/with_validation_error.html.erb
|
|
247
260
|
- spec/components/previews/sdr_view_components/forms/submit_component_preview.rb
|
|
248
261
|
- spec/components/previews/sdr_view_components/forms/submit_component_preview/danger.html.erb
|
|
249
262
|
- spec/components/previews/sdr_view_components/forms/submit_component_preview/default.html.erb
|