openproject-primer_view_components 0.13.1 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/app/assets/javascripts/app/components/primer/primer.d.ts +0 -1
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_menu/action_menu_element.js +8 -6
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +9 -6
- data/app/components/primer/alpha/overlay.css +1 -1
- data/app/components/primer/alpha/overlay.css.json +0 -1
- data/app/components/primer/alpha/overlay.css.map +1 -1
- data/app/components/primer/alpha/overlay.pcss +0 -12
- data/app/components/primer/alpha/text_field.css +1 -1
- data/app/components/primer/alpha/text_field.css.json +12 -0
- data/app/components/primer/alpha/text_field.css.map +1 -1
- data/app/components/primer/alpha/text_field.pcss +31 -0
- data/app/components/primer/open_project/page_header.css +1 -1
- data/app/components/primer/open_project/page_header.css.json +4 -1
- data/app/components/primer/open_project/page_header.css.map +1 -1
- data/app/components/primer/open_project/page_header.html.erb +6 -2
- data/app/components/primer/open_project/page_header.pcss +19 -6
- data/app/components/primer/open_project/page_header.rb +70 -0
- data/app/components/primer/primer.d.ts +0 -1
- data/app/components/primer/primer.js +0 -1
- data/app/components/primer/primer.pcss +0 -2
- data/app/components/primer/primer.ts +0 -1
- data/app/forms/custom_width_fields_form.rb +26 -0
- data/lib/primer/forms/dsl/input.rb +19 -0
- data/lib/primer/forms/select.rb +4 -1
- data/lib/primer/forms/text_field.rb +9 -7
- data/lib/primer/static/generate_info_arch.rb +6 -1
- data/lib/primer/view_components/version.rb +2 -2
- data/previews/primer/alpha/select_preview.rb +5 -2
- data/previews/primer/alpha/text_field_preview.rb +5 -2
- data/previews/primer/forms_preview/custom_width_fields_form.html.erb +3 -0
- data/previews/primer/forms_preview.rb +2 -0
- data/previews/primer/open_project/page_header_preview.rb +39 -1
- data/static/classes.json +9 -0
- data/static/constants.json +12 -0
- data/static/info_arch.json +87 -6
- data/static/previews.json +26 -0
- metadata +4 -2
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# :nodoc:
|
4
|
+
class CustomWidthFieldsForm < ApplicationForm
|
5
|
+
form do |f|
|
6
|
+
f.text_field(
|
7
|
+
name: :ultimate_answer,
|
8
|
+
label: "Ultimate answer",
|
9
|
+
required: true,
|
10
|
+
caption: "The answer to life, the universe, and everything",
|
11
|
+
input_width: :medium
|
12
|
+
)
|
13
|
+
|
14
|
+
f.select_list(
|
15
|
+
name: "cities",
|
16
|
+
label: "Cool cities",
|
17
|
+
caption: "Select your favorite!",
|
18
|
+
include_blank: true,
|
19
|
+
input_width: :small
|
20
|
+
) do |city_list|
|
21
|
+
city_list.option(label: "Lopez Island", value: "lopez_island")
|
22
|
+
city_list.option(label: "Bellevue", value: "bellevue")
|
23
|
+
city_list.option(label: "Seattle", value: "seattle")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -45,6 +45,17 @@ module Primer
|
|
45
45
|
}.freeze
|
46
46
|
SIZE_OPTIONS = SIZE_MAPPINGS.keys
|
47
47
|
|
48
|
+
DEFAULT_INPUT_WIDTH = :auto
|
49
|
+
INPUT_WIDTH_MAPPINGS = {
|
50
|
+
DEFAULT_INPUT_WIDTH => "FormControl-input-width--auto",
|
51
|
+
:small => "FormControl-input-width--small",
|
52
|
+
:medium => "FormControl-input-width--medium",
|
53
|
+
:large => "FormControl-input-width--large",
|
54
|
+
:xlarge => "FormControl-input-width--xlarge",
|
55
|
+
:xxlarge => "FormControl-input-width--xxlarge"
|
56
|
+
}.freeze
|
57
|
+
INPUT_WIDTH_OPTIONS = INPUT_WIDTH_MAPPINGS.keys
|
58
|
+
|
48
59
|
include Primer::ClassNameHelper
|
49
60
|
|
50
61
|
attr_reader :builder, :form, :input_arguments, :label_arguments, :caption, :validation_message, :ids, :form_control, :base_id
|
@@ -73,6 +84,7 @@ module Primer
|
|
73
84
|
@invalid = @input_arguments.delete(:invalid)
|
74
85
|
@full_width = @input_arguments.delete(:full_width)
|
75
86
|
@size = @input_arguments.delete(:size)
|
87
|
+
@input_width = @input_arguments.delete(:input_width)
|
76
88
|
|
77
89
|
# If scope_name_to_model is false, the name of the input for eg. `my_field`
|
78
90
|
# will be `my_field` instead of the Rails default of `model[my_field]`.
|
@@ -152,6 +164,7 @@ module Primer
|
|
152
164
|
def remove_input_data(key)
|
153
165
|
input_data.delete(key)
|
154
166
|
end
|
167
|
+
|
155
168
|
# :nocov:
|
156
169
|
|
157
170
|
def merge_input_arguments!(arguments)
|
@@ -226,6 +239,10 @@ module Primer
|
|
226
239
|
@size ||= SIZE_MAPPINGS.include?(@size) ? @size : DEFAULT_SIZE
|
227
240
|
end
|
228
241
|
|
242
|
+
def input_width
|
243
|
+
@input_width ||= INPUT_WIDTH_MAPPINGS.include?(@input_width) ? @input_width : DEFAULT_INPUT_WIDTH
|
244
|
+
end
|
245
|
+
|
229
246
|
def validation_messages
|
230
247
|
@validation_messages ||=
|
231
248
|
if validation_message
|
@@ -257,6 +274,7 @@ module Primer
|
|
257
274
|
def to_component
|
258
275
|
raise_for_abstract_method!(__method__)
|
259
276
|
end
|
277
|
+
|
260
278
|
# :nocov:
|
261
279
|
|
262
280
|
def focusable?
|
@@ -309,6 +327,7 @@ module Primer
|
|
309
327
|
def raise_for_abstract_method!(method_name)
|
310
328
|
raise NotImplementedError, "subclasses must implement ##{method_name}."
|
311
329
|
end
|
330
|
+
|
312
331
|
# :nocov:
|
313
332
|
end
|
314
333
|
end
|
data/lib/primer/forms/select.rb
CHANGED
@@ -13,8 +13,11 @@ module Primer
|
|
13
13
|
Primer::Forms::Dsl::Input::SIZE_MAPPINGS[@input.size]
|
14
14
|
)
|
15
15
|
|
16
|
+
wrap_classes = ["FormControl-select-wrap"]
|
17
|
+
wrap_classes << Primer::Forms::Dsl::Input::INPUT_WIDTH_MAPPINGS[@input.input_width] if @input.input_width
|
18
|
+
|
16
19
|
@field_wrap_arguments = {
|
17
|
-
class:
|
20
|
+
class: class_names(wrap_classes),
|
18
21
|
hidden: @input.hidden?
|
19
22
|
}
|
20
23
|
end
|
@@ -19,14 +19,16 @@ module Primer
|
|
19
19
|
Primer::Forms::Dsl::Input::SIZE_MAPPINGS[@input.size]
|
20
20
|
)
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
wrap_classes = [
|
23
|
+
"FormControl-input-wrap",
|
24
|
+
INPUT_WRAP_SIZE[input.size],
|
25
|
+
{ "FormControl-input-wrap--trailingAction": @input.show_clear_button? },
|
26
|
+
{ "FormControl-input-wrap--leadingVisual": @input.leading_visual? }
|
27
|
+
]
|
28
|
+
wrap_classes << Primer::Forms::Dsl::Input::INPUT_WIDTH_MAPPINGS[@input.input_width] if @input.input_width
|
29
29
|
|
30
|
+
@field_wrap_arguments = {
|
31
|
+
class: class_names(wrap_classes),
|
30
32
|
hidden: @input.hidden?
|
31
33
|
}
|
32
34
|
end
|
@@ -70,10 +70,15 @@ module Primer
|
|
70
70
|
render_erb_ignoring_markdown_code_fences(docs.base_docstring)
|
71
71
|
end
|
72
72
|
|
73
|
+
accessibility_docs =
|
74
|
+
if (accessibility_tag_text = docs.tags(:accessibility)&.first&.text)
|
75
|
+
render_erb_ignoring_markdown_code_fences(accessibility_tag_text)
|
76
|
+
end
|
77
|
+
|
73
78
|
memo[component] = {
|
74
79
|
"fully_qualified_name" => component.name,
|
75
80
|
"description" => description,
|
76
|
-
"accessibility_docs" =>
|
81
|
+
"accessibility_docs" => accessibility_docs,
|
77
82
|
"is_form_component" => docs.manifest_entry.form_component?,
|
78
83
|
"is_published" => docs.manifest_entry.published?,
|
79
84
|
"requires_js" => docs.manifest_entry.requires_js?,
|
@@ -17,6 +17,7 @@ module Primer
|
|
17
17
|
# @param disabled toggle
|
18
18
|
# @param invalid toggle
|
19
19
|
# @param validation_message text
|
20
|
+
# @param input_width [Symbol] select [auto, small, medium, large, xlarge, xxlarge]
|
20
21
|
def playground(
|
21
22
|
name: "my-select-list",
|
22
23
|
id: "my-select-list",
|
@@ -28,7 +29,8 @@ module Primer
|
|
28
29
|
full_width: false,
|
29
30
|
disabled: false,
|
30
31
|
invalid: false,
|
31
|
-
validation_message: nil
|
32
|
+
validation_message: nil,
|
33
|
+
input_width: nil
|
32
34
|
)
|
33
35
|
system_arguments = {
|
34
36
|
name: name,
|
@@ -41,7 +43,8 @@ module Primer
|
|
41
43
|
full_width: full_width,
|
42
44
|
disabled: disabled,
|
43
45
|
invalid: invalid,
|
44
|
-
validation_message: validation_message
|
46
|
+
validation_message: validation_message,
|
47
|
+
input_width: input_width
|
45
48
|
}
|
46
49
|
|
47
50
|
render(Primer::Alpha::Select.new(**system_arguments)) do |component|
|
@@ -23,6 +23,7 @@ module Primer
|
|
23
23
|
# @param inset toggle
|
24
24
|
# @param monospace toggle
|
25
25
|
# @param leading_visual_icon octicon
|
26
|
+
# @param input_width [Symbol] select [auto, small, medium, large, xlarge, xxlarge]
|
26
27
|
def playground(
|
27
28
|
name: "my-text-field",
|
28
29
|
id: "my-text-field",
|
@@ -40,7 +41,8 @@ module Primer
|
|
40
41
|
placeholder: nil,
|
41
42
|
inset: false,
|
42
43
|
monospace: false,
|
43
|
-
leading_visual_icon: nil
|
44
|
+
leading_visual_icon: nil,
|
45
|
+
input_width: nil
|
44
46
|
)
|
45
47
|
system_arguments = {
|
46
48
|
name: name,
|
@@ -58,7 +60,8 @@ module Primer
|
|
58
60
|
validation_message: validation_message,
|
59
61
|
placeholder: placeholder,
|
60
62
|
inset: inset,
|
61
|
-
monospace: monospace
|
63
|
+
monospace: monospace,
|
64
|
+
input_width: input_width
|
62
65
|
}
|
63
66
|
|
64
67
|
if leading_visual_icon
|
@@ -18,10 +18,24 @@ module Primer
|
|
18
18
|
# @param variant [Symbol] select [medium, large]
|
19
19
|
# @param title [String] text
|
20
20
|
# @param description [String] text
|
21
|
-
|
21
|
+
# @param with_back_button [Boolean]
|
22
|
+
# @param back_button_size [Symbol] select [small, medium, large]
|
23
|
+
# @param with_breadcrumbs [Boolean]
|
24
|
+
def playground(
|
25
|
+
variant: :medium,
|
26
|
+
title: "Hello",
|
27
|
+
description: "Last updated 5 minutes ago by XYZ.",
|
28
|
+
with_back_button: false,
|
29
|
+
back_button_size: :medium,
|
30
|
+
with_breadcrumbs: false
|
31
|
+
)
|
32
|
+
breadcrumb_items = [{ href: "/foo", text: "Foo" }, { href: "/bar", text: "Bar" }, "Baz"]
|
33
|
+
|
22
34
|
render(Primer::OpenProject::PageHeader.new) do |header|
|
23
35
|
header.with_title(variant: variant) { title }
|
24
36
|
header.with_description { description }
|
37
|
+
header.with_back_button(href: "#", size: back_button_size, 'aria-label': "Back") if with_back_button
|
38
|
+
header.with_breadcrumbs(breadcrumb_items) if with_breadcrumbs
|
25
39
|
end
|
26
40
|
end
|
27
41
|
|
@@ -37,6 +51,30 @@ module Primer
|
|
37
51
|
def actions
|
38
52
|
render_with_template(locals: {})
|
39
53
|
end
|
54
|
+
|
55
|
+
# @label With back button
|
56
|
+
# @param href [String] text
|
57
|
+
# @param size [Symbol] select [small, medium, large]
|
58
|
+
# @param icon [String] select ["arrow-left", "chevron-left", "triangle-left"]
|
59
|
+
def back_button(href: "#", size: :medium, icon: "arrow-left")
|
60
|
+
render(Primer::OpenProject::PageHeader.new) do |header|
|
61
|
+
header.with_title { "Hello" }
|
62
|
+
header.with_back_button(href: href, size: size, icon: icon, 'aria-label': "Back")
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# @label With breadcrumbs
|
67
|
+
def breadcrumbs
|
68
|
+
breadcrumb_items = [
|
69
|
+
{ href: "/foo", text: "Foo" },
|
70
|
+
"\u003ca href=\"/foo/bar\"\u003eBar\u003c/a\u003e",
|
71
|
+
"Baz"
|
72
|
+
]
|
73
|
+
render(Primer::OpenProject::PageHeader.new) do |header|
|
74
|
+
header.with_title { "A title" }
|
75
|
+
header.with_breadcrumbs(breadcrumb_items)
|
76
|
+
end
|
77
|
+
end
|
40
78
|
end
|
41
79
|
end
|
42
80
|
end
|
data/static/classes.json
CHANGED
@@ -435,6 +435,12 @@
|
|
435
435
|
"PageHeader-actions": [
|
436
436
|
"Primer::OpenProject::PageHeader"
|
437
437
|
],
|
438
|
+
"PageHeader-backButton": [
|
439
|
+
"Primer::OpenProject::PageHeader"
|
440
|
+
],
|
441
|
+
"PageHeader-breadcrumbs": [
|
442
|
+
"Primer::OpenProject::PageHeader"
|
443
|
+
],
|
438
444
|
"PageHeader-description": [
|
439
445
|
"Primer::OpenProject::PageHeader"
|
440
446
|
],
|
@@ -444,6 +450,9 @@
|
|
444
450
|
"PageHeader-title--large": [
|
445
451
|
"Primer::OpenProject::PageHeader"
|
446
452
|
],
|
453
|
+
"PageHeader-titleBar": [
|
454
|
+
"Primer::OpenProject::PageHeader"
|
455
|
+
],
|
447
456
|
"Popover": [
|
448
457
|
"Primer::Beta::Popover"
|
449
458
|
],
|
data/static/constants.json
CHANGED
@@ -1360,6 +1360,18 @@
|
|
1360
1360
|
]
|
1361
1361
|
},
|
1362
1362
|
"Primer::OpenProject::PageHeader": {
|
1363
|
+
"BACK_BUTTON_ICON_OPTIONS": [
|
1364
|
+
"arrow-left",
|
1365
|
+
"chevron-left",
|
1366
|
+
"triangle-left"
|
1367
|
+
],
|
1368
|
+
"BACK_BUTTON_SIZE_OPTIONS": [
|
1369
|
+
"small",
|
1370
|
+
"medium",
|
1371
|
+
"large"
|
1372
|
+
],
|
1373
|
+
"DEFAULT_BACK_BUTTON_ICON": "arrow-left",
|
1374
|
+
"DEFAULT_BACK_BUTTON_SIZE": "medium",
|
1363
1375
|
"DEFAULT_HEADER_VARIANT": "medium",
|
1364
1376
|
"HEADER_VARIANT_OPTIONS": [
|
1365
1377
|
"large",
|
data/static/info_arch.json
CHANGED
@@ -7062,7 +7062,7 @@
|
|
7062
7062
|
{
|
7063
7063
|
"fully_qualified_name": "Primer::Alpha::TabNav",
|
7064
7064
|
"description": "Use `TabNav` to style navigation with a tab-based selected state, typically used for navigation placed at the top of the page.\nFor panel navigation, use {{#link_to_component}}Primer::Alpha::TabPanels{{/link_to_component}} instead.",
|
7065
|
-
"accessibility_docs": "- By default, `TabNav` renders links within a `<nav>` element. `<nav>` has an\n implicit landmark role of `navigation` which should be reserved for main links.\n For all other set of links, set tag to `:div`.\n- See
|
7065
|
+
"accessibility_docs": "- By default, `TabNav` renders links within a `<nav>` element. `<nav>` has an\n implicit landmark role of `navigation` which should be reserved for main links.\n For all other set of links, set tag to `:div`.\n- See {{#link_to_component}}Primer::Alpha::Navigation::Tab{{/link_to_component}} for additional\n accessibility considerations.",
|
7066
7066
|
"is_form_component": false,
|
7067
7067
|
"is_published": true,
|
7068
7068
|
"requires_js": false,
|
@@ -8461,7 +8461,7 @@
|
|
8461
8461
|
{
|
8462
8462
|
"fully_qualified_name": "Primer::Alpha::UnderlineNav",
|
8463
8463
|
"description": "Use `UnderlineNav` to style navigation links with a minimal\nunderlined selected state, typically placed at the top\nof the page.\n\nFor panel navigation, use {{#link_to_component}}Primer::Alpha::UnderlinePanels{{/link_to_component}} instead.",
|
8464
|
-
"accessibility_docs": "- By default, `UnderlineNav` renders links within a `<nav>` element. `<nav>` has an\n implicit landmark role of `navigation` which should be reserved for main links.\n For all other set of links, set tag to `:div`.\n- See
|
8464
|
+
"accessibility_docs": "- By default, `UnderlineNav` renders links within a `<nav>` element. `<nav>` has an\n implicit landmark role of `navigation` which should be reserved for main links.\n For all other set of links, set tag to `:div`.\n- See {{#link_to_component}}Primer::Alpha::Navigation::Tab{{/link_to_component}} for additional\n accessibility considerations.",
|
8465
8465
|
"is_form_component": false,
|
8466
8466
|
"is_published": true,
|
8467
8467
|
"requires_js": false,
|
@@ -10189,7 +10189,7 @@
|
|
10189
10189
|
{
|
10190
10190
|
"fully_qualified_name": "Primer::Beta::BorderBox::Header",
|
10191
10191
|
"description": "`BorderBox::Header` is used inside `BorderBox` to render its header slot.",
|
10192
|
-
"accessibility_docs": "When using `header.with_title`, set `tag` to one of `h1`, `h2`, `h3`, etc. based on what is appropriate for the page context.
|
10192
|
+
"accessibility_docs": "When using `header.with_title`, set `tag` to one of `h1`, `h2`, `h3`, etc. based on what is appropriate for the page context. [Learn more about best heading practices (WAI Headings)](https://www.w3.org/WAI/tutorials/page-structure/headings/)",
|
10193
10193
|
"is_form_component": false,
|
10194
10194
|
"is_published": true,
|
10195
10195
|
"requires_js": false,
|
@@ -11589,7 +11589,7 @@
|
|
11589
11589
|
{
|
11590
11590
|
"fully_qualified_name": "Primer::Beta::Heading",
|
11591
11591
|
"description": "`Heading` should be used to communicate page organization and hierarchy.\n\n- Set tag to one of `:h1`, `:h2`, `:h3`, `:h4`, `:h5`, `:h6` based on what is appropriate for the page context.\n- Use `Heading` as the title of a section or sub section.\n- Do not use `Heading` for styling alone. For simply styling text, consider using {{#link_to_component}}Primer::Beta::Text{{/link_to_component}} with relevant {{link_to_typography_docs}}\n such as `font_size` and `font_weight`.\n- Do not jump heading levels. For instance, do not follow a `<h1>` with an `<h3>`. Heading levels should increase by one in ascending order.",
|
11592
|
-
"accessibility_docs": "While sighted users rely on visual cues such as font size changes to determine what the heading is, assistive technology users rely on programatic cues that can be read out.\nWhen text on a page is visually implied to be a heading, ensure that it is coded as a heading. Additionally, visually implied heading level and coded heading level should be\nconsistent. [See WCAG success criteria: 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships.html)\n\nHeadings allow assistive technology users to quickly navigate around a page. Navigation to text that is not meant to be a heading can be a confusing experience.\n
|
11592
|
+
"accessibility_docs": "While sighted users rely on visual cues such as font size changes to determine what the heading is, assistive technology users rely on programatic cues that can be read out.\nWhen text on a page is visually implied to be a heading, ensure that it is coded as a heading. Additionally, visually implied heading level and coded heading level should be\nconsistent. [See WCAG success criteria: 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships.html)\n\nHeadings allow assistive technology users to quickly navigate around a page. Navigation to text that is not meant to be a heading can be a confusing experience.\n[Learn more about best heading practices (WAI Headings)](https://www.w3.org/WAI/tutorials/page-structure/headings/)",
|
11593
11593
|
"is_form_component": false,
|
11594
11594
|
"is_published": true,
|
11595
11595
|
"requires_js": false,
|
@@ -13751,7 +13751,7 @@
|
|
13751
13751
|
{
|
13752
13752
|
"fully_qualified_name": "Primer::Beta::Subhead",
|
13753
13753
|
"description": "Use `Subhead` as the start of a section. The `:heading` slot will render an `<h2>` font-sized text.\n\n- Optionally set the `:description` slot to render a short description and the `:actions` slot for a related action.\n- Use a succinct, one-line description for the `:description` slot. For longer descriptions, omit the description slot and render a paragraph below the `Subhead`.\n- Use the actions slot to render a related action to the right of the heading. Use {{#link_to_component}}Primer::ButtonComponent{{/link_to_component}} or {{#link_to_component}}Primer::Beta::Link{{/link_to_component}}.",
|
13754
|
-
"accessibility_docs": "The `:heading` slot defaults to rendering a `<div>`. Update the tag to a heading element with the appropriate level to improve page navigation for assistive technologies.\n
|
13754
|
+
"accessibility_docs": "The `:heading` slot defaults to rendering a `<div>`. Update the tag to a heading element with the appropriate level to improve page navigation for assistive technologies.\n[Learn more about best heading practices (WAI Headings)](https://www.w3.org/WAI/tutorials/page-structure/headings/)",
|
13755
13755
|
"is_form_component": false,
|
13756
13756
|
"is_published": true,
|
13757
13757
|
"requires_js": false,
|
@@ -14288,7 +14288,7 @@
|
|
14288
14288
|
{
|
14289
14289
|
"fully_qualified_name": "Primer::BlankslateComponent",
|
14290
14290
|
"description": "Use `Blankslate` when there is a lack of content within a page or section. Use as placeholder to tell users why something isn't there.",
|
14291
|
-
"accessibility_docs": "`Blankslate` renders an `<h3>` element for the title by default. Update the heading level based on what is appropriate for your page hierarchy by setting `title_tag`.\n
|
14291
|
+
"accessibility_docs": "`Blankslate` renders an `<h3>` element for the title by default. Update the heading level based on what is appropriate for your page hierarchy by setting `title_tag`.\n[Learn more about best heading practices (WAI Headings)](https://www.w3.org/WAI/tutorials/page-structure/headings/)",
|
14292
14292
|
"is_form_component": false,
|
14293
14293
|
"is_published": true,
|
14294
14294
|
"requires_js": false,
|
@@ -15472,10 +15472,65 @@
|
|
15472
15472
|
"description": "{{link_to_system_arguments_docs}}"
|
15473
15473
|
}
|
15474
15474
|
]
|
15475
|
+
},
|
15476
|
+
{
|
15477
|
+
"name": "back_button",
|
15478
|
+
"description": "Optional back button prepend the title",
|
15479
|
+
"parameters": [
|
15480
|
+
{
|
15481
|
+
"name": "size",
|
15482
|
+
"type": "Symbol",
|
15483
|
+
"default": "N/A",
|
15484
|
+
"description": "One of `:large`, `:medium`, or `:small`."
|
15485
|
+
},
|
15486
|
+
{
|
15487
|
+
"name": "icon",
|
15488
|
+
"type": "String",
|
15489
|
+
"default": "N/A",
|
15490
|
+
"description": "One of `arrow-left`, `chevron-left`, or `triangle-left`."
|
15491
|
+
},
|
15492
|
+
{
|
15493
|
+
"name": "system_arguments",
|
15494
|
+
"type": "Hash",
|
15495
|
+
"default": "N/A",
|
15496
|
+
"description": "{{link_to_system_arguments_docs}}"
|
15497
|
+
}
|
15498
|
+
]
|
15499
|
+
},
|
15500
|
+
{
|
15501
|
+
"name": "breadcrumbs",
|
15502
|
+
"description": "Optional breadcrumbs above the title row",
|
15503
|
+
"parameters": [
|
15504
|
+
{
|
15505
|
+
"name": "items",
|
15506
|
+
"type": "Array<String, Hash>",
|
15507
|
+
"default": "N/A",
|
15508
|
+
"description": "Items is an array of strings, hash {href, text} or an anchor tag string"
|
15509
|
+
},
|
15510
|
+
{
|
15511
|
+
"name": "system_arguments",
|
15512
|
+
"type": "Hash",
|
15513
|
+
"default": "N/A",
|
15514
|
+
"description": "{{link_to_system_arguments_docs}}"
|
15515
|
+
}
|
15516
|
+
]
|
15475
15517
|
}
|
15476
15518
|
],
|
15477
15519
|
"methods": [
|
15520
|
+
{
|
15521
|
+
"name": "anchor_string_to_object",
|
15522
|
+
"description": "transform anchor tag strings to {href, text} objects\ne.g \"\\u003ca href=\\\"/admin\\\"\\u003eAdministration\\u003c/a\\u003e\"",
|
15523
|
+
"parameters": [
|
15524
|
+
|
15525
|
+
]
|
15526
|
+
},
|
15527
|
+
{
|
15528
|
+
"name": "anchor_tag_string?",
|
15529
|
+
"description": "Check if the item is an anchor tag string e.g \"\\u003ca href=\\\"/admin\\\"\\u003eAdministration\\u003c/a\\u003e\"",
|
15530
|
+
"parameters": [
|
15478
15531
|
|
15532
|
+
]
|
15533
|
+
}
|
15479
15534
|
],
|
15480
15535
|
"previews": [
|
15481
15536
|
{
|
@@ -15529,6 +15584,32 @@
|
|
15529
15584
|
"color-contrast"
|
15530
15585
|
]
|
15531
15586
|
}
|
15587
|
+
},
|
15588
|
+
{
|
15589
|
+
"preview_path": "primer/open_project/page_header/back_button",
|
15590
|
+
"name": "back_button",
|
15591
|
+
"snapshot": "false",
|
15592
|
+
"skip_rules": {
|
15593
|
+
"wont_fix": [
|
15594
|
+
"region"
|
15595
|
+
],
|
15596
|
+
"will_fix": [
|
15597
|
+
"color-contrast"
|
15598
|
+
]
|
15599
|
+
}
|
15600
|
+
},
|
15601
|
+
{
|
15602
|
+
"preview_path": "primer/open_project/page_header/breadcrumbs",
|
15603
|
+
"name": "breadcrumbs",
|
15604
|
+
"snapshot": "false",
|
15605
|
+
"skip_rules": {
|
15606
|
+
"wont_fix": [
|
15607
|
+
"region"
|
15608
|
+
],
|
15609
|
+
"will_fix": [
|
15610
|
+
"color-contrast"
|
15611
|
+
]
|
15612
|
+
}
|
15532
15613
|
}
|
15533
15614
|
],
|
15534
15615
|
"subcomponents": [
|
data/static/previews.json
CHANGED
@@ -4755,6 +4755,32 @@
|
|
4755
4755
|
"color-contrast"
|
4756
4756
|
]
|
4757
4757
|
}
|
4758
|
+
},
|
4759
|
+
{
|
4760
|
+
"preview_path": "primer/open_project/page_header/back_button",
|
4761
|
+
"name": "back_button",
|
4762
|
+
"snapshot": "false",
|
4763
|
+
"skip_rules": {
|
4764
|
+
"wont_fix": [
|
4765
|
+
"region"
|
4766
|
+
],
|
4767
|
+
"will_fix": [
|
4768
|
+
"color-contrast"
|
4769
|
+
]
|
4770
|
+
}
|
4771
|
+
},
|
4772
|
+
{
|
4773
|
+
"preview_path": "primer/open_project/page_header/breadcrumbs",
|
4774
|
+
"name": "breadcrumbs",
|
4775
|
+
"snapshot": "false",
|
4776
|
+
"skip_rules": {
|
4777
|
+
"wont_fix": [
|
4778
|
+
"region"
|
4779
|
+
],
|
4780
|
+
"will_fix": [
|
4781
|
+
"color-contrast"
|
4782
|
+
]
|
4783
|
+
}
|
4758
4784
|
}
|
4759
4785
|
]
|
4760
4786
|
},
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openproject-primer_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-11-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionview
|
@@ -493,6 +493,7 @@ files:
|
|
493
493
|
- app/forms/check_box_group_form.rb
|
494
494
|
- app/forms/check_box_with_nested_form.rb
|
495
495
|
- app/forms/composed_form.rb
|
496
|
+
- app/forms/custom_width_fields_form.rb
|
496
497
|
- app/forms/example_toggle_switch_form.rb
|
497
498
|
- app/forms/example_toggle_switch_form/example_field_caption.html.erb
|
498
499
|
- app/forms/first_name_form.rb
|
@@ -831,6 +832,7 @@ files:
|
|
831
832
|
- previews/primer/forms_preview/check_box_group_form.html.erb
|
832
833
|
- previews/primer/forms_preview/check_box_with_nested_form.html.erb
|
833
834
|
- previews/primer/forms_preview/composed_form.html.erb
|
835
|
+
- previews/primer/forms_preview/custom_width_fields_form.html.erb
|
834
836
|
- previews/primer/forms_preview/example_toggle_switch_form.html.erb
|
835
837
|
- previews/primer/forms_preview/horizontal_form.html.erb
|
836
838
|
- previews/primer/forms_preview/immediate_validation_form.html.erb
|