openproject-primer_view_components 0.54.1 → 0.56.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/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/open_project/side_panel/section.rb +12 -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/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/previews/primer/open_project/side_panel_preview/with_action_menu.html.erb +37 -0
- data/previews/primer/open_project/side_panel_preview.rb +4 -0
- data/static/arguments.json +12 -0
- data/static/constants.json +4 -0
- data/static/info_arch.json +147 -70
- data/static/previews.json +40 -52
- metadata +7 -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
|
@@ -73,7 +73,7 @@ module Primer
|
|
73
73
|
# @label With caption
|
74
74
|
# @snapshot
|
75
75
|
def with_caption
|
76
|
-
render(Primer::Alpha::Select.new(caption: "With a caption", name: "my-select-list", label: "Favorite place to visit")) do |component|
|
76
|
+
render(Primer::Alpha::Select.new(caption: "With a caption", name: "my-select-list-1", label: "Favorite place to visit")) do |component|
|
77
77
|
component.option(label: "Lopez Island", value: "lopez")
|
78
78
|
component.option(label: "Shaw Island", value: "shaw")
|
79
79
|
component.option(label: "Orcas Island", value: "orcas")
|
@@ -84,7 +84,7 @@ module Primer
|
|
84
84
|
# @label Visually hidden label
|
85
85
|
# @snapshot
|
86
86
|
def visually_hide_label
|
87
|
-
render(Primer::Alpha::Select.new(visually_hide_label: true, name: "my-select-list", label: "Favorite place to visit")) do |component|
|
87
|
+
render(Primer::Alpha::Select.new(visually_hide_label: true, name: "my-select-list-2", label: "Favorite place to visit")) do |component|
|
88
88
|
component.option(label: "Lopez Island", value: "lopez")
|
89
89
|
component.option(label: "Shaw Island", value: "shaw")
|
90
90
|
component.option(label: "Orcas Island", value: "orcas")
|
@@ -95,7 +95,7 @@ module Primer
|
|
95
95
|
# @label Full width
|
96
96
|
# @snapshot
|
97
97
|
def full_width
|
98
|
-
render(Primer::Alpha::Select.new(full_width: true, name: "my-select-list", label: "Favorite place to visit")) do |component|
|
98
|
+
render(Primer::Alpha::Select.new(full_width: true, name: "my-select-list-3", label: "Favorite place to visit")) do |component|
|
99
99
|
component.option(label: "Lopez Island", value: "lopez")
|
100
100
|
component.option(label: "Shaw Island", value: "shaw")
|
101
101
|
component.option(label: "Orcas Island", value: "orcas")
|
@@ -106,7 +106,7 @@ module Primer
|
|
106
106
|
# @label Not full width
|
107
107
|
# @snapshot
|
108
108
|
def not_full_width
|
109
|
-
render(Primer::Alpha::Select.new(full_width: false, name: "my-select-list", label: "Favorite place to visit")) do |component|
|
109
|
+
render(Primer::Alpha::Select.new(full_width: false, name: "my-select-list-4", label: "Favorite place to visit")) do |component|
|
110
110
|
component.option(label: "Lopez Island", value: "lopez")
|
111
111
|
component.option(label: "Shaw Island", value: "shaw")
|
112
112
|
component.option(label: "Orcas Island", value: "orcas")
|
@@ -117,7 +117,7 @@ module Primer
|
|
117
117
|
# @label Disabled
|
118
118
|
# @snapshot
|
119
119
|
def disabled
|
120
|
-
render(Primer::Alpha::Select.new(disabled: true, name: "my-select-list", label: "Favorite place to visit")) do |component|
|
120
|
+
render(Primer::Alpha::Select.new(disabled: true, name: "my-select-list-5", label: "Favorite place to visit")) do |component|
|
121
121
|
component.option(label: "Lopez Island", value: "lopez")
|
122
122
|
component.option(label: "Shaw Island", value: "shaw")
|
123
123
|
component.option(label: "Orcas Island", value: "orcas")
|
@@ -128,7 +128,7 @@ module Primer
|
|
128
128
|
# @label Invalid
|
129
129
|
# @snapshot
|
130
130
|
def invalid
|
131
|
-
render(Primer::Alpha::Select.new(invalid: true, name: "my-select-list", label: "Favorite place to visit")) do |component|
|
131
|
+
render(Primer::Alpha::Select.new(invalid: true, name: "my-select-list-6", label: "Favorite place to visit")) do |component|
|
132
132
|
component.option(label: "Lopez Island", value: "lopez")
|
133
133
|
component.option(label: "Shaw Island", value: "shaw")
|
134
134
|
component.option(label: "Orcas Island", value: "orcas")
|
@@ -118,122 +118,122 @@ module Primer
|
|
118
118
|
# @label With caption
|
119
119
|
# @snapshot
|
120
120
|
def with_caption
|
121
|
-
render(Primer::Alpha::TextField.new(caption: "With a caption", name: "my-text-field", label: "My text field"))
|
121
|
+
render(Primer::Alpha::TextField.new(caption: "With a caption", name: "my-text-field-1", label: "My text field"))
|
122
122
|
end
|
123
123
|
|
124
124
|
# @label Visually hidden label
|
125
125
|
# @snapshot
|
126
126
|
def visually_hide_label
|
127
|
-
render(Primer::Alpha::TextField.new(visually_hide_label: true, name: "my-text-field", label: "My text field"))
|
127
|
+
render(Primer::Alpha::TextField.new(visually_hide_label: true, name: "my-text-field-2", label: "My text field"))
|
128
128
|
end
|
129
129
|
|
130
130
|
# @label Show clear button
|
131
131
|
# @snapshot
|
132
132
|
def show_clear_button
|
133
|
-
render(Primer::Alpha::TextField.new(show_clear_button: true, name: "my-text-field", label: "My text field"))
|
133
|
+
render(Primer::Alpha::TextField.new(show_clear_button: true, name: "my-text-field-3", label: "My text field"))
|
134
134
|
end
|
135
135
|
|
136
136
|
# @label Full width
|
137
137
|
# @snapshot
|
138
138
|
def full_width
|
139
|
-
render(Primer::Alpha::TextField.new(full_width: true, name: "my-text-field", label: "My text field"))
|
139
|
+
render(Primer::Alpha::TextField.new(full_width: true, name: "my-text-field-4", label: "My text field"))
|
140
140
|
end
|
141
141
|
|
142
142
|
# @label Not full width
|
143
143
|
# @snapshot
|
144
144
|
def not_full_width
|
145
|
-
render(Primer::Alpha::TextField.new(full_width: false, name: "my-text-field", label: "My text field"))
|
145
|
+
render(Primer::Alpha::TextField.new(full_width: false, name: "my-text-field-5", label: "My text field"))
|
146
146
|
end
|
147
147
|
|
148
148
|
# @label Disabled
|
149
149
|
# @snapshot
|
150
150
|
def disabled
|
151
|
-
render(Primer::Alpha::TextField.new(disabled: true, name: "my-text-field", label: "My text field"))
|
151
|
+
render(Primer::Alpha::TextField.new(disabled: true, name: "my-text-field-6", label: "My text field"))
|
152
152
|
end
|
153
153
|
|
154
154
|
# @label Invalid
|
155
155
|
# @snapshot
|
156
156
|
def invalid
|
157
|
-
render(Primer::Alpha::TextField.new(invalid: true, name: "my-text-field", label: "My text field"))
|
157
|
+
render(Primer::Alpha::TextField.new(invalid: true, name: "my-text-field-7", label: "My text field"))
|
158
158
|
end
|
159
159
|
|
160
160
|
# @label With placeholder
|
161
161
|
# @snapshot
|
162
162
|
def with_placeholder
|
163
|
-
render(Primer::Alpha::TextField.new(placeholder: "with a placeholder", name: "my-text-field", label: "My text field"))
|
163
|
+
render(Primer::Alpha::TextField.new(placeholder: "with a placeholder", name: "my-text-field-8", label: "My text field"))
|
164
164
|
end
|
165
165
|
|
166
166
|
# @label Inset
|
167
167
|
# @snapshot
|
168
168
|
def inset
|
169
|
-
render(Primer::Alpha::TextField.new(inset: true, name: "my-text-field", label: "My text field"))
|
169
|
+
render(Primer::Alpha::TextField.new(inset: true, name: "my-text-field-9", label: "My text field"))
|
170
170
|
end
|
171
171
|
|
172
172
|
# @label Monospace
|
173
173
|
# @snapshot
|
174
174
|
def monospace
|
175
|
-
render(Primer::Alpha::TextField.new(monospace: true, name: "my-text-field", label: "My text field"))
|
175
|
+
render(Primer::Alpha::TextField.new(monospace: true, name: "my-text-field-10", label: "My text field"))
|
176
176
|
end
|
177
177
|
|
178
178
|
# @label With trailing icon
|
179
179
|
# @snapshot
|
180
180
|
def with_trailing_icon
|
181
|
-
render(Primer::Alpha::TextField.new(trailing_visual: { icon: { icon: :search } }, name: "my-text-field", label: "My text field"))
|
181
|
+
render(Primer::Alpha::TextField.new(trailing_visual: { icon: { icon: :search } }, name: "my-text-field-11", label: "My text field"))
|
182
182
|
end
|
183
183
|
|
184
184
|
# @label With trailing text
|
185
185
|
# @snapshot
|
186
186
|
def with_trailing_text
|
187
|
-
render(Primer::Alpha::TextField.new(trailing_visual: { text: { text: "minute" } }, name: "my-text-field", label: "My text field"))
|
187
|
+
render(Primer::Alpha::TextField.new(trailing_visual: { text: { text: "minute" } }, name: "my-text-field-12", label: "My text field"))
|
188
188
|
end
|
189
189
|
|
190
190
|
# @label With trailing long text
|
191
191
|
# @snapshot
|
192
192
|
def with_trailing_long_text
|
193
|
-
render(Primer::Alpha::TextField.new(trailing_visual: { text: { text: "Long trailing text" } }, name: "my-text-field", label: "My text field"))
|
193
|
+
render(Primer::Alpha::TextField.new(trailing_visual: { text: { text: "Long trailing text" } }, name: "my-text-field-13", label: "My text field"))
|
194
194
|
end
|
195
195
|
|
196
196
|
# @label With trailing counter
|
197
197
|
# @snapshot
|
198
198
|
def with_trailing_counter
|
199
|
-
render(Primer::Alpha::TextField.new(trailing_visual: { counter: { count: 5 } }, name: "my-text-field", label: "My text field"))
|
199
|
+
render(Primer::Alpha::TextField.new(trailing_visual: { counter: { count: 5 } }, name: "my-text-field-14", label: "My text field"))
|
200
200
|
end
|
201
201
|
|
202
202
|
# @label With trailing label
|
203
|
-
# @snapshot
|
203
|
+
# @snapshot
|
204
204
|
def with_trailing_label
|
205
|
-
render(Primer::Alpha::TextField.new(trailing_visual: { label: { text: "Hello" } }, name: "my-text-field", label: "My text field"))
|
205
|
+
render(Primer::Alpha::TextField.new(trailing_visual: { label: { text: "Hello" } }, name: "my-text-field-15", label: "My text field"))
|
206
206
|
end
|
207
207
|
|
208
208
|
# @label With leading visual
|
209
209
|
# @snapshot
|
210
210
|
def with_leading_visual
|
211
|
-
render(Primer::Alpha::TextField.new(leading_visual: { icon: :search }, name: "my-text-field", label: "My text field"))
|
211
|
+
render(Primer::Alpha::TextField.new(leading_visual: { icon: :search, "aria-label": "Search" }, name: "my-text-field-16", label: "My text field"))
|
212
212
|
end
|
213
213
|
|
214
214
|
# @label With validation message
|
215
215
|
# @snapshot
|
216
216
|
def with_validation_message
|
217
|
-
render(Primer::Alpha::TextField.new(validation_message: "An error occurred!", name: "my-text-field", label: "My text field"))
|
217
|
+
render(Primer::Alpha::TextField.new(validation_message: "An error occurred!", name: "my-text-field-17", label: "My text field"))
|
218
218
|
end
|
219
219
|
#
|
220
220
|
# @!endgroup
|
221
221
|
|
222
|
-
# @!group Auto check
|
222
|
+
# @!group Auto check
|
223
223
|
#
|
224
224
|
# @label Auto check request ok
|
225
225
|
def with_auto_check_ok
|
226
|
-
render(Primer::Alpha::TextField.new(auto_check_src: UrlHelpers.example_check_ok_path, name: "my-text-field", label: "My text field"))
|
226
|
+
render(Primer::Alpha::TextField.new(auto_check_src: UrlHelpers.example_check_ok_path, name: "my-text-field-18", label: "My text field"))
|
227
227
|
end
|
228
228
|
|
229
229
|
# @label Auto check request accepted
|
230
230
|
def with_auto_check_accepted
|
231
|
-
render(Primer::Alpha::TextField.new(auto_check_src: UrlHelpers.example_check_accepted_path, name: "my-text-field", label: "My text field"))
|
231
|
+
render(Primer::Alpha::TextField.new(auto_check_src: UrlHelpers.example_check_accepted_path, name: "my-text-field-19", label: "My text field"))
|
232
232
|
end
|
233
233
|
|
234
234
|
# @label Auto check request error
|
235
235
|
def with_auto_check_error
|
236
|
-
render(Primer::Alpha::TextField.new(auto_check_src: UrlHelpers.example_check_error_path, name: "my-text-field", label: "My text field"))
|
236
|
+
render(Primer::Alpha::TextField.new(auto_check_src: UrlHelpers.example_check_error_path, name: "my-text-field-20", label: "My text field"))
|
237
237
|
end
|
238
238
|
#
|
239
239
|
# @!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
|
@@ -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
|
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<%=
|
2
|
+
clazz = Class.new(ViewComponent::Base) do
|
3
|
+
def self.name
|
4
|
+
"CustomComponent"
|
5
|
+
end
|
6
|
+
|
7
|
+
def call
|
8
|
+
render(Primer::OpenProject::SidePanel::Section.new) do |section|
|
9
|
+
section.with_title { "My custom component" }
|
10
|
+
section.with_action_menu(
|
11
|
+
anchor_align: :end,
|
12
|
+
button_arguments: { icon: :gear, 'aria-label': 'Edit' }
|
13
|
+
) do |menu|
|
14
|
+
menu.with_item(label: "Subitem 1") do |item|
|
15
|
+
item.with_leading_visual_icon(icon: :paste)
|
16
|
+
end
|
17
|
+
menu.with_item(label: "Subitem 2") do |item|
|
18
|
+
item.with_leading_visual_icon(icon: :log)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
"Section content"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
render(Primer::Alpha::Layout.new) do |component|
|
28
|
+
component.with_main do
|
29
|
+
"Main content"
|
30
|
+
end
|
31
|
+
component.with_sidebar(row_placement: :start, col_placement: :end) do
|
32
|
+
render(Primer::OpenProject::SidePanel.new) do |panel|
|
33
|
+
panel.with_section(clazz.new)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
%>
|
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",
|
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",
|