primer_view_components 0.36.4 → 0.37.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/CHANGELOG.md +26 -0
- data/app/assets/javascripts/components/primer/beta/details_toggle_element.d.ts +39 -0
- data/app/assets/javascripts/components/primer/primer.d.ts +1 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/components/primer/alpha/action_menu/action_menu_element.js +13 -3
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +14 -2
- data/app/components/primer/alpha/dropdown.rb +8 -0
- data/app/components/primer/alpha/form_control.rb +47 -7
- data/app/components/primer/alpha/toggle_switch.html.erb +1 -1
- data/app/components/primer/alpha/toggle_switch.js +1 -0
- data/app/components/primer/alpha/toggle_switch.rb +14 -2
- data/app/components/primer/alpha/toggle_switch.ts +1 -0
- data/app/components/primer/beta/button.html.erb +1 -1
- data/app/components/primer/beta/button.rb +2 -1
- data/app/components/primer/beta/details.html.erb +8 -6
- data/app/components/primer/beta/details.rb +42 -0
- data/app/components/primer/beta/details_toggle_element.d.ts +39 -0
- data/app/components/primer/beta/details_toggle_element.js +60 -0
- data/app/components/primer/beta/details_toggle_element.ts +57 -0
- data/app/components/primer/beta/markdown.rb +1 -0
- data/app/components/primer/beta/nav_list.rb +1 -1
- data/app/components/primer/primer.d.ts +1 -0
- data/app/components/primer/primer.js +1 -0
- data/app/components/primer/primer.ts +1 -0
- data/app/lib/primer/forms/action_menu.html.erb +1 -1
- data/app/lib/primer/forms/action_menu.rb +5 -0
- data/lib/primer/view_components/version.rb +2 -2
- data/lib/primer/yard/component_manifest.rb +11 -10
- data/lib/primer/yard/lookbook_pages_backend.rb +8 -0
- data/previews/primer/alpha/action_menu_preview/multiple_select_form.html.erb +1 -1
- data/previews/primer/alpha/form_control_preview/playground.html.erb +14 -6
- data/previews/primer/alpha/overlay_preview.rb +0 -31
- data/previews/primer/alpha/select_preview.rb +6 -6
- data/previews/primer/alpha/text_field_preview.rb +22 -22
- data/previews/primer/alpha/toggle_switch_preview.rb +4 -0
- data/previews/primer/alpha/tooltip_preview.rb +1 -1
- data/previews/primer/beta/details_preview.rb +12 -0
- data/previews/primer/beta/markdown_preview.rb +9 -9
- data/previews/primer/beta/relative_time_preview.rb +20 -10
- data/static/arguments.json +18 -0
- data/static/constants.json +4 -0
- data/static/info_arch.json +140 -70
- data/static/previews.json +27 -52
- metadata +6 -4
- data/previews/primer/alpha/overlay_preview/in_an_action_menu.html.erb +0 -13
- data/previews/primer/alpha/overlay_preview/overlay_with_header_filter.html.erb +0 -16
@@ -165,6 +165,12 @@ module Primer
|
|
165
165
|
class LookbookPagesBackend < Backend
|
166
166
|
attr_reader :registry, :manifest
|
167
167
|
|
168
|
+
IGNORED_COMPONENTS = [
|
169
|
+
Primer::Alpha::FormControl
|
170
|
+
]
|
171
|
+
|
172
|
+
IGNORED_COMPONENTS.freeze
|
173
|
+
|
168
174
|
def initialize(registry, manifest)
|
169
175
|
@registry = registry
|
170
176
|
@manifest = manifest
|
@@ -172,6 +178,8 @@ module Primer
|
|
172
178
|
|
173
179
|
def generate
|
174
180
|
each_component do |component_ref|
|
181
|
+
next if IGNORED_COMPONENTS.include?(component_ref.klass)
|
182
|
+
|
175
183
|
page_for(component_ref).generate
|
176
184
|
end
|
177
185
|
generate_system_args_docs
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<% menu.with_show_button { "Strategy" } %>
|
4
4
|
<% menu.with_item(label: "Fast forward", data: { value: "fast_forward" }) %>
|
5
5
|
<% menu.with_item(label: "Recursive", data: { value: "recursive" }) %>
|
6
|
-
<% menu.with_item(label: "Ours", data: { value: "ours" }) %>
|
6
|
+
<% menu.with_item(label: "Ours", data: { value: "ours" }, active: true) %>
|
7
7
|
<% menu.with_item(label: "Resolve") %>
|
8
8
|
<% end %>
|
9
9
|
<hr>
|
@@ -1,9 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
<div>
|
2
|
+
<strong>NOTE: </strong>The <pre style="display: inline">FormControl </pre>component cannot automatically connect
|
3
|
+
the label to the provided input. Please take care to pass the <pre style="display: inline">for:</pre> attribute
|
4
|
+
to <pre style="display: inline">FormControl</pre>, eg:
|
5
|
+
<pre style="display: inline">Primer::Alpha::FormControl.new(label_arguments: { for: "field-name-or-id" })</pre>.
|
6
|
+
- Your friendly neighborhood accessibility team.
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<br>
|
10
|
+
|
11
|
+
<%= form_with(url: "/foo") do |f| %>
|
12
|
+
<%= render(Primer::Alpha::FormControl.new(**system_arguments, label_arguments: { for: "bar" })) do |component| %>
|
13
|
+
<% component.with_input do |input_arguments| %>
|
14
|
+
<%= f.text_field(:bar, **input_arguments) %>
|
7
15
|
<% end %>
|
8
16
|
<% end %>
|
9
17
|
<% end %>
|
@@ -164,37 +164,6 @@ module Primer
|
|
164
164
|
})
|
165
165
|
end
|
166
166
|
|
167
|
-
# @label In an ActionMenu
|
168
|
-
def in_an_action_menu
|
169
|
-
render_with_template(locals: {})
|
170
|
-
end
|
171
|
-
|
172
|
-
# @label Dialog with header and footer
|
173
|
-
#
|
174
|
-
def dialog_with_header_footer
|
175
|
-
render(Primer::Alpha::Overlay.new(title: "Dialog", role: :dialog, size: :large, padding: :condensed)) do |d|
|
176
|
-
d.with_header(title: "Large Dialog Header", divider: true)
|
177
|
-
d.with_show_button { "Show Overlay" }
|
178
|
-
d.with_footer { "Large Dialog Footer" }
|
179
|
-
d.with_body { "This is a long body for the overlay dialog. <br>".html_safe * 20 }
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
def overlay_with_header_filter
|
184
|
-
render_with_template(locals: {})
|
185
|
-
end
|
186
|
-
|
187
|
-
def overlay_with_header_subtitle
|
188
|
-
render(Primer::Alpha::Overlay.new(title: "Dialog", role: :dialog, size: :large, padding: :condensed)) do |d|
|
189
|
-
d.with_header(title: "Large Dialog Header", divider: true) do |h|
|
190
|
-
h.with_subtitle {"A subtitle"}
|
191
|
-
end
|
192
|
-
d.with_show_button { "Show Overlay" }
|
193
|
-
d.with_footer { "Large Dialog Footer" }
|
194
|
-
d.with_body { "This is a long body for the overlay dialog. <br>".html_safe * 20 }
|
195
|
-
end
|
196
|
-
end
|
197
|
-
|
198
167
|
def in_a_sticky_container
|
199
168
|
render_with_template(locals: {})
|
200
169
|
end
|
@@ -70,7 +70,7 @@ module Primer
|
|
70
70
|
# @label With caption
|
71
71
|
# @snapshot
|
72
72
|
def with_caption
|
73
|
-
render(Primer::Alpha::Select.new(caption: "With a caption", name: "my-select-list", label: "Favorite place to visit")) do |component|
|
73
|
+
render(Primer::Alpha::Select.new(caption: "With a caption", name: "my-select-list-1", label: "Favorite place to visit")) do |component|
|
74
74
|
component.option(label: "Lopez Island", value: "lopez")
|
75
75
|
component.option(label: "Shaw Island", value: "shaw")
|
76
76
|
component.option(label: "Orcas Island", value: "orcas")
|
@@ -81,7 +81,7 @@ module Primer
|
|
81
81
|
# @label Visually hidden label
|
82
82
|
# @snapshot
|
83
83
|
def visually_hide_label
|
84
|
-
render(Primer::Alpha::Select.new(visually_hide_label: true, name: "my-select-list", label: "Favorite place to visit")) do |component|
|
84
|
+
render(Primer::Alpha::Select.new(visually_hide_label: true, name: "my-select-list-2", label: "Favorite place to visit")) do |component|
|
85
85
|
component.option(label: "Lopez Island", value: "lopez")
|
86
86
|
component.option(label: "Shaw Island", value: "shaw")
|
87
87
|
component.option(label: "Orcas Island", value: "orcas")
|
@@ -92,7 +92,7 @@ module Primer
|
|
92
92
|
# @label Full width
|
93
93
|
# @snapshot
|
94
94
|
def full_width
|
95
|
-
render(Primer::Alpha::Select.new(full_width: true, name: "my-select-list", label: "Favorite place to visit")) do |component|
|
95
|
+
render(Primer::Alpha::Select.new(full_width: true, name: "my-select-list-3", label: "Favorite place to visit")) do |component|
|
96
96
|
component.option(label: "Lopez Island", value: "lopez")
|
97
97
|
component.option(label: "Shaw Island", value: "shaw")
|
98
98
|
component.option(label: "Orcas Island", value: "orcas")
|
@@ -103,7 +103,7 @@ module Primer
|
|
103
103
|
# @label Not full width
|
104
104
|
# @snapshot
|
105
105
|
def not_full_width
|
106
|
-
render(Primer::Alpha::Select.new(full_width: false, name: "my-select-list", label: "Favorite place to visit")) do |component|
|
106
|
+
render(Primer::Alpha::Select.new(full_width: false, name: "my-select-list-4", label: "Favorite place to visit")) do |component|
|
107
107
|
component.option(label: "Lopez Island", value: "lopez")
|
108
108
|
component.option(label: "Shaw Island", value: "shaw")
|
109
109
|
component.option(label: "Orcas Island", value: "orcas")
|
@@ -114,7 +114,7 @@ module Primer
|
|
114
114
|
# @label Disabled
|
115
115
|
# @snapshot
|
116
116
|
def disabled
|
117
|
-
render(Primer::Alpha::Select.new(disabled: true, name: "my-select-list", label: "Favorite place to visit")) do |component|
|
117
|
+
render(Primer::Alpha::Select.new(disabled: true, name: "my-select-list-5", label: "Favorite place to visit")) do |component|
|
118
118
|
component.option(label: "Lopez Island", value: "lopez")
|
119
119
|
component.option(label: "Shaw Island", value: "shaw")
|
120
120
|
component.option(label: "Orcas Island", value: "orcas")
|
@@ -125,7 +125,7 @@ module Primer
|
|
125
125
|
# @label Invalid
|
126
126
|
# @snapshot
|
127
127
|
def invalid
|
128
|
-
render(Primer::Alpha::Select.new(invalid: true, name: "my-select-list", label: "Favorite place to visit")) do |component|
|
128
|
+
render(Primer::Alpha::Select.new(invalid: true, name: "my-select-list-6", label: "Favorite place to visit")) do |component|
|
129
129
|
component.option(label: "Lopez Island", value: "lopez")
|
130
130
|
component.option(label: "Shaw Island", value: "shaw")
|
131
131
|
component.option(label: "Orcas Island", value: "orcas")
|
@@ -115,122 +115,122 @@ module Primer
|
|
115
115
|
# @label With caption
|
116
116
|
# @snapshot
|
117
117
|
def with_caption
|
118
|
-
render(Primer::Alpha::TextField.new(caption: "With a caption", name: "my-text-field", label: "My text field"))
|
118
|
+
render(Primer::Alpha::TextField.new(caption: "With a caption", name: "my-text-field-1", label: "My text field"))
|
119
119
|
end
|
120
120
|
|
121
121
|
# @label Visually hidden label
|
122
122
|
# @snapshot
|
123
123
|
def visually_hide_label
|
124
|
-
render(Primer::Alpha::TextField.new(visually_hide_label: true, name: "my-text-field", label: "My text field"))
|
124
|
+
render(Primer::Alpha::TextField.new(visually_hide_label: true, name: "my-text-field-2", label: "My text field"))
|
125
125
|
end
|
126
126
|
|
127
127
|
# @label Show clear button
|
128
128
|
# @snapshot
|
129
129
|
def show_clear_button
|
130
|
-
render(Primer::Alpha::TextField.new(show_clear_button: true, name: "my-text-field", label: "My text field"))
|
130
|
+
render(Primer::Alpha::TextField.new(show_clear_button: true, name: "my-text-field-3", label: "My text field"))
|
131
131
|
end
|
132
132
|
|
133
133
|
# @label Full width
|
134
134
|
# @snapshot
|
135
135
|
def full_width
|
136
|
-
render(Primer::Alpha::TextField.new(full_width: true, name: "my-text-field", label: "My text field"))
|
136
|
+
render(Primer::Alpha::TextField.new(full_width: true, name: "my-text-field-4", label: "My text field"))
|
137
137
|
end
|
138
138
|
|
139
139
|
# @label Not full width
|
140
140
|
# @snapshot
|
141
141
|
def not_full_width
|
142
|
-
render(Primer::Alpha::TextField.new(full_width: false, name: "my-text-field", label: "My text field"))
|
142
|
+
render(Primer::Alpha::TextField.new(full_width: false, name: "my-text-field-5", label: "My text field"))
|
143
143
|
end
|
144
144
|
|
145
145
|
# @label Disabled
|
146
146
|
# @snapshot
|
147
147
|
def disabled
|
148
|
-
render(Primer::Alpha::TextField.new(disabled: true, name: "my-text-field", label: "My text field"))
|
148
|
+
render(Primer::Alpha::TextField.new(disabled: true, name: "my-text-field-6", label: "My text field"))
|
149
149
|
end
|
150
150
|
|
151
151
|
# @label Invalid
|
152
152
|
# @snapshot
|
153
153
|
def invalid
|
154
|
-
render(Primer::Alpha::TextField.new(invalid: true, name: "my-text-field", label: "My text field"))
|
154
|
+
render(Primer::Alpha::TextField.new(invalid: true, name: "my-text-field-7", label: "My text field"))
|
155
155
|
end
|
156
156
|
|
157
157
|
# @label With placeholder
|
158
158
|
# @snapshot
|
159
159
|
def with_placeholder
|
160
|
-
render(Primer::Alpha::TextField.new(placeholder: "with a placeholder", name: "my-text-field", label: "My text field"))
|
160
|
+
render(Primer::Alpha::TextField.new(placeholder: "with a placeholder", name: "my-text-field-8", label: "My text field"))
|
161
161
|
end
|
162
162
|
|
163
163
|
# @label Inset
|
164
164
|
# @snapshot
|
165
165
|
def inset
|
166
|
-
render(Primer::Alpha::TextField.new(inset: true, name: "my-text-field", label: "My text field"))
|
166
|
+
render(Primer::Alpha::TextField.new(inset: true, name: "my-text-field-9", label: "My text field"))
|
167
167
|
end
|
168
168
|
|
169
169
|
# @label Monospace
|
170
170
|
# @snapshot
|
171
171
|
def monospace
|
172
|
-
render(Primer::Alpha::TextField.new(monospace: true, name: "my-text-field", label: "My text field"))
|
172
|
+
render(Primer::Alpha::TextField.new(monospace: true, name: "my-text-field-10", label: "My text field"))
|
173
173
|
end
|
174
174
|
|
175
175
|
# @label With trailing icon
|
176
176
|
# @snapshot
|
177
177
|
def with_trailing_icon
|
178
|
-
render(Primer::Alpha::TextField.new(trailing_visual: { icon: { icon: :search } }, name: "my-text-field", label: "My text field"))
|
178
|
+
render(Primer::Alpha::TextField.new(trailing_visual: { icon: { icon: :search } }, name: "my-text-field-11", label: "My text field"))
|
179
179
|
end
|
180
180
|
|
181
181
|
# @label With trailing text
|
182
182
|
# @snapshot
|
183
183
|
def with_trailing_text
|
184
|
-
render(Primer::Alpha::TextField.new(trailing_visual: { text: { text: "minute" } }, name: "my-text-field", label: "My text field"))
|
184
|
+
render(Primer::Alpha::TextField.new(trailing_visual: { text: { text: "minute" } }, name: "my-text-field-12", label: "My text field"))
|
185
185
|
end
|
186
186
|
|
187
187
|
# @label With trailing long text
|
188
188
|
# @snapshot
|
189
189
|
def with_trailing_long_text
|
190
|
-
render(Primer::Alpha::TextField.new(trailing_visual: { text: { text: "Long trailing text" } }, name: "my-text-field", label: "My text field"))
|
190
|
+
render(Primer::Alpha::TextField.new(trailing_visual: { text: { text: "Long trailing text" } }, name: "my-text-field-13", label: "My text field"))
|
191
191
|
end
|
192
192
|
|
193
193
|
# @label With trailing counter
|
194
194
|
# @snapshot
|
195
195
|
def with_trailing_counter
|
196
|
-
render(Primer::Alpha::TextField.new(trailing_visual: { counter: { count: 5 } }, name: "my-text-field", label: "My text field"))
|
196
|
+
render(Primer::Alpha::TextField.new(trailing_visual: { counter: { count: 5 } }, name: "my-text-field-14", label: "My text field"))
|
197
197
|
end
|
198
198
|
|
199
199
|
# @label With trailing label
|
200
|
-
# @snapshot
|
200
|
+
# @snapshot
|
201
201
|
def with_trailing_label
|
202
|
-
render(Primer::Alpha::TextField.new(trailing_visual: { label: { text: "Hello" } }, name: "my-text-field", label: "My text field"))
|
202
|
+
render(Primer::Alpha::TextField.new(trailing_visual: { label: { text: "Hello" } }, name: "my-text-field-15", label: "My text field"))
|
203
203
|
end
|
204
204
|
|
205
205
|
# @label With leading visual
|
206
206
|
# @snapshot
|
207
207
|
def with_leading_visual
|
208
|
-
render(Primer::Alpha::TextField.new(leading_visual: { icon: :search }, name: "my-text-field", label: "My text field"))
|
208
|
+
render(Primer::Alpha::TextField.new(leading_visual: { icon: :search, "aria-label": "Search" }, name: "my-text-field-16", label: "My text field"))
|
209
209
|
end
|
210
210
|
|
211
211
|
# @label With validation message
|
212
212
|
# @snapshot
|
213
213
|
def with_validation_message
|
214
|
-
render(Primer::Alpha::TextField.new(validation_message: "An error occurred!", name: "my-text-field", label: "My text field"))
|
214
|
+
render(Primer::Alpha::TextField.new(validation_message: "An error occurred!", name: "my-text-field-17", label: "My text field"))
|
215
215
|
end
|
216
216
|
#
|
217
217
|
# @!endgroup
|
218
218
|
|
219
|
-
# @!group Auto check
|
219
|
+
# @!group Auto check
|
220
220
|
#
|
221
221
|
# @label Auto check request ok
|
222
222
|
def with_auto_check_ok
|
223
|
-
render(Primer::Alpha::TextField.new(auto_check_src: UrlHelpers.example_check_ok_path, name: "my-text-field", label: "My text field"))
|
223
|
+
render(Primer::Alpha::TextField.new(auto_check_src: UrlHelpers.example_check_ok_path, name: "my-text-field-18", label: "My text field"))
|
224
224
|
end
|
225
225
|
|
226
226
|
# @label Auto check request accepted
|
227
227
|
def with_auto_check_accepted
|
228
|
-
render(Primer::Alpha::TextField.new(auto_check_src: UrlHelpers.example_check_accepted_path, name: "my-text-field", label: "My text field"))
|
228
|
+
render(Primer::Alpha::TextField.new(auto_check_src: UrlHelpers.example_check_accepted_path, name: "my-text-field-19", label: "My text field"))
|
229
229
|
end
|
230
230
|
|
231
231
|
# @label Auto check request error
|
232
232
|
def with_auto_check_error
|
233
|
-
render(Primer::Alpha::TextField.new(auto_check_src: UrlHelpers.example_check_error_path, name: "my-text-field", label: "My text field"))
|
233
|
+
render(Primer::Alpha::TextField.new(auto_check_src: UrlHelpers.example_check_error_path, name: "my-text-field-20", label: "My text field"))
|
234
234
|
end
|
235
235
|
#
|
236
236
|
# @!endgroup
|
@@ -62,6 +62,10 @@ module Primer
|
|
62
62
|
def with_turbo
|
63
63
|
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, turbo: true))
|
64
64
|
end
|
65
|
+
|
66
|
+
def with_autofocus
|
67
|
+
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.toggle_switch_index_path, autofocus: true))
|
68
|
+
end
|
65
69
|
end
|
66
70
|
end
|
67
71
|
end
|
@@ -65,7 +65,7 @@ module Primer
|
|
65
65
|
|
66
66
|
# @label Tooltip with Primer::Beta::Link
|
67
67
|
def tooltip_with_link(direction: :s, tooltip_text: "You can press a button")
|
68
|
-
render(Primer::Beta::Link.new(href: "#link-with-tooltip", id: "link-with-tooltip")) do |component|
|
68
|
+
render(Primer::Beta::Link.new(href: "#link-with-tooltip", id: "link-with-tooltip", underline: true)) do |component|
|
69
69
|
component.with_tooltip(text: tooltip_text, direction: direction)
|
70
70
|
"Button"
|
71
71
|
end
|
@@ -58,6 +58,18 @@ module Primer
|
|
58
58
|
component.with_body { "Body" }
|
59
59
|
end
|
60
60
|
end
|
61
|
+
|
62
|
+
# @label Open
|
63
|
+
#
|
64
|
+
# @param overlay [Symbol] select [none, default, dark]
|
65
|
+
# @param reset [Boolean] toggle
|
66
|
+
# @param disabled [Boolean] toggle
|
67
|
+
def open(reset: false, overlay: :default, disabled: false)
|
68
|
+
render Primer::Beta::Details.new(reset: reset, overlay: overlay, disabled: disabled, open: true) do |component|
|
69
|
+
component.with_summary { "Click me" }
|
70
|
+
component.with_body { "Body" }
|
71
|
+
end
|
72
|
+
end
|
61
73
|
end
|
62
74
|
end
|
63
75
|
end
|
@@ -95,17 +95,17 @@ module Primer
|
|
95
95
|
<p>And an unordered task list:</p>
|
96
96
|
|
97
97
|
<ul>
|
98
|
-
<li><input type=\"checkbox\" checked>
|
99
|
-
<li><input type=\"checkbox\">
|
100
|
-
<li><input type=\"checkbox\">
|
98
|
+
<li><input id="checkbox-1" type=\"checkbox\" checked><label for="checkbox-1">Create a sample markdown document</label></li>
|
99
|
+
<li><input id="checkbox-2" type=\"checkbox\"><label for="checkbox-2">Add task lists to it</label></li>
|
100
|
+
<li><input id="checkbox-3" type=\"checkbox\"><label for="checkbox-3">Take a vacation</label></li>
|
101
101
|
</ul>
|
102
102
|
|
103
103
|
<p>And a \"mixed\" task list:</p>
|
104
104
|
|
105
105
|
<ul>
|
106
|
-
<li><input type=\"checkbox\">
|
106
|
+
<li><input id="checkbox-4" type=\"checkbox\"><label for="checkbox-4">Steal underpants</label></li>
|
107
107
|
<li>?</li>
|
108
|
-
<li><input type=\"checkbox\"> Profit!</li>
|
108
|
+
<li><input id="checkbox-5" type=\"checkbox\"> <label for="checkbox-5">Profit!</label></li></li>
|
109
109
|
</ul>
|
110
110
|
|
111
111
|
And a nested list:
|
@@ -181,7 +181,7 @@ module Primer
|
|
181
181
|
|
182
182
|
<p>If a table is too wide, it should condense down and/or scroll horizontally.</p>
|
183
183
|
|
184
|
-
<table>
|
184
|
+
<table tabindex="0">
|
185
185
|
<thead>
|
186
186
|
<tr>
|
187
187
|
<th>Artist</th>
|
@@ -237,13 +237,13 @@ module Primer
|
|
237
237
|
|
238
238
|
<pre><code>var foo = \"bar\";</code></pre>
|
239
239
|
|
240
|
-
<pre><code>Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this.</code></pre>
|
240
|
+
<pre tabindex="0"><code>Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. They should also have a tabindex=0 to ensure keyboard accessibility. This line should be long enough to demonstrate this.</code></pre>
|
241
241
|
|
242
|
-
<pre><code>var foo = \"The same thing is true for code with syntax highlighting. A single line of code should horizontally scroll if it is really long.\";</code></pre>
|
242
|
+
<pre tabindex="0"><code>var foo = \"The same thing is true for code with syntax highlighting. A single line of code should horizontally scroll if it is really long.\";</code></pre>
|
243
243
|
|
244
244
|
<p>Inline code inside table cells should still be distinguishable.</p>
|
245
245
|
|
246
|
-
<table>
|
246
|
+
<table tabindex="0">
|
247
247
|
<thead>
|
248
248
|
<tr>
|
249
249
|
<th>Language</th>
|
@@ -41,7 +41,8 @@ module Primer
|
|
41
41
|
format_style: nil,
|
42
42
|
datetime: Time.utc(2020, 1, 1, 0, 0, 0),
|
43
43
|
lang: nil,
|
44
|
-
title: nil
|
44
|
+
title: nil,
|
45
|
+
no_title: true
|
45
46
|
)
|
46
47
|
render(Primer::Beta::RelativeTime.new(
|
47
48
|
tense: tense,
|
@@ -60,7 +61,8 @@ module Primer
|
|
60
61
|
format_style: format_style,
|
61
62
|
datetime: datetime,
|
62
63
|
lang: lang,
|
63
|
-
title: title
|
64
|
+
title: title,
|
65
|
+
no_title: no_title
|
64
66
|
))
|
65
67
|
end
|
66
68
|
|
@@ -98,7 +100,8 @@ module Primer
|
|
98
100
|
format_style: nil,
|
99
101
|
datetime: Time.now.utc,
|
100
102
|
lang: nil,
|
101
|
-
title: nil
|
103
|
+
title: nil,
|
104
|
+
no_title: true
|
102
105
|
)
|
103
106
|
render(Primer::Beta::RelativeTime.new(
|
104
107
|
tense: tense,
|
@@ -117,7 +120,8 @@ module Primer
|
|
117
120
|
format_style: format_style,
|
118
121
|
datetime: datetime,
|
119
122
|
lang: lang,
|
120
|
-
title: title
|
123
|
+
title: title,
|
124
|
+
no_title: no_title
|
121
125
|
))
|
122
126
|
end
|
123
127
|
|
@@ -153,7 +157,8 @@ module Primer
|
|
153
157
|
format_style: nil,
|
154
158
|
datetime: Time.now.iso8601,
|
155
159
|
lang: nil,
|
156
|
-
title: nil
|
160
|
+
title: nil,
|
161
|
+
no_title: true
|
157
162
|
)
|
158
163
|
render(Primer::Beta::RelativeTime.new(
|
159
164
|
tense: tense,
|
@@ -172,7 +177,8 @@ module Primer
|
|
172
177
|
format_style: format_style,
|
173
178
|
datetime: datetime,
|
174
179
|
lang: lang,
|
175
|
-
title: title
|
180
|
+
title: title,
|
181
|
+
no_title: no_title
|
176
182
|
))
|
177
183
|
end
|
178
184
|
|
@@ -210,7 +216,8 @@ module Primer
|
|
210
216
|
format_style: nil,
|
211
217
|
datetime: Time.now.iso8601,
|
212
218
|
lang: nil,
|
213
|
-
title: nil
|
219
|
+
title: nil,
|
220
|
+
no_title: true
|
214
221
|
)
|
215
222
|
render(Primer::Beta::RelativeTime.new(
|
216
223
|
tense: tense,
|
@@ -229,7 +236,8 @@ module Primer
|
|
229
236
|
format_style: format_style,
|
230
237
|
datetime: datetime,
|
231
238
|
lang: lang,
|
232
|
-
title: title
|
239
|
+
title: title,
|
240
|
+
no_title: no_title
|
233
241
|
))
|
234
242
|
end
|
235
243
|
|
@@ -261,7 +269,8 @@ module Primer
|
|
261
269
|
format_style: nil,
|
262
270
|
datetime: Time.utc(2038, 1, 19, 0o3, 14, 8),
|
263
271
|
lang: nil,
|
264
|
-
title: nil
|
272
|
+
title: nil,
|
273
|
+
no_title: true
|
265
274
|
)
|
266
275
|
render(Primer::Beta::RelativeTime.new(
|
267
276
|
tense: tense,
|
@@ -278,7 +287,8 @@ module Primer
|
|
278
287
|
format_style: format_style,
|
279
288
|
datetime: datetime,
|
280
289
|
lang: lang,
|
281
|
-
title: title
|
290
|
+
title: title,
|
291
|
+
no_title: no_title
|
282
292
|
))
|
283
293
|
end
|
284
294
|
|
data/static/arguments.json
CHANGED
@@ -1253,6 +1253,12 @@
|
|
1253
1253
|
"default": "`false`",
|
1254
1254
|
"description": "When set to `true`, the form control will take up all the horizontal space allowed by its container."
|
1255
1255
|
},
|
1256
|
+
{
|
1257
|
+
"name": "label_arguments",
|
1258
|
+
"type": "Hash",
|
1259
|
+
"default": "`{}`",
|
1260
|
+
"description": "HTML attributes to attach to the `<label>` element that labels the input."
|
1261
|
+
},
|
1256
1262
|
{
|
1257
1263
|
"name": "system_arguments",
|
1258
1264
|
"type": "Hash",
|
@@ -3074,6 +3080,12 @@
|
|
3074
3080
|
"default": "`false`",
|
3075
3081
|
"description": "Whether or not to request a turbo stream and render the response as such."
|
3076
3082
|
},
|
3083
|
+
{
|
3084
|
+
"name": "autofocus",
|
3085
|
+
"type": "Boolean",
|
3086
|
+
"default": "`nil`",
|
3087
|
+
"description": "Whether switch should be autofocused when rendered."
|
3088
|
+
},
|
3077
3089
|
{
|
3078
3090
|
"name": "system_arguments",
|
3079
3091
|
"type": "Hash",
|
@@ -3646,6 +3658,12 @@
|
|
3646
3658
|
"default": "`:button`",
|
3647
3659
|
"description": "One of `:button`, `:reset`, or `:submit`."
|
3648
3660
|
},
|
3661
|
+
{
|
3662
|
+
"name": "inactive",
|
3663
|
+
"type": "Boolean",
|
3664
|
+
"default": "N/A",
|
3665
|
+
"description": "Whether the button looks visually disabled, but can still accept all the same interactions as an enabled button."
|
3666
|
+
},
|
3649
3667
|
{
|
3650
3668
|
"name": "disabled",
|
3651
3669
|
"type": "Boolean",
|
data/static/constants.json
CHANGED
@@ -333,6 +333,8 @@
|
|
333
333
|
]
|
334
334
|
},
|
335
335
|
"Primer::Alpha::Dropdown": {
|
336
|
+
"ARIA_LABEL_CLOSED_DEFAULT": "Open",
|
337
|
+
"ARIA_LABEL_OPEN_DEFAULT": "Close",
|
336
338
|
"GeneratedSlotMethods": "Primer::Alpha::Dropdown::GeneratedSlotMethods",
|
337
339
|
"Menu": "Primer::Alpha::Dropdown::Menu"
|
338
340
|
},
|
@@ -1037,6 +1039,8 @@
|
|
1037
1039
|
]
|
1038
1040
|
},
|
1039
1041
|
"Primer::Beta::Details": {
|
1042
|
+
"ARIA_LABEL_CLOSED_DEFAULT": "Expand",
|
1043
|
+
"ARIA_LABEL_OPEN_DEFAULT": "Collapse",
|
1040
1044
|
"BODY_TAG_DEFAULT": "div",
|
1041
1045
|
"BODY_TAG_OPTIONS": [
|
1042
1046
|
"ul",
|