primer_view_components 0.49.0 → 0.51.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 +54 -0
- data/README.md +20 -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_bar_element.js +1 -1
- data/app/components/primer/alpha/action_bar_element.ts +1 -1
- data/app/components/primer/alpha/action_list/item.rb +2 -1
- data/app/components/primer/alpha/action_list.js +1 -1
- data/app/components/primer/alpha/action_list.ts +1 -1
- data/app/components/primer/alpha/action_menu/action_menu_element.js +1 -1
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +1 -1
- data/app/components/primer/alpha/layout.rb +6 -2
- data/app/components/primer/alpha/segmented_control.js +1 -1
- data/app/components/primer/alpha/segmented_control.ts +1 -1
- data/app/components/primer/alpha/select_panel.rb +1 -1
- data/app/components/primer/alpha/select_panel_element.js +4 -2
- data/app/components/primer/alpha/select_panel_element.ts +5 -2
- data/app/components/primer/alpha/stack.rb +1 -0
- data/app/components/primer/alpha/tab_nav.css +1 -1
- data/app/components/primer/alpha/tab_nav.css.json +1 -0
- data/app/components/primer/alpha/tab_nav.css.map +1 -1
- data/app/components/primer/alpha/tab_nav.pcss +7 -1
- data/app/components/primer/alpha/toggle_switch.js +1 -1
- data/app/components/primer/alpha/toggle_switch.rb +3 -0
- data/app/components/primer/alpha/toggle_switch.ts +1 -1
- data/app/components/primer/alpha/tree_view/tree_view.js +1 -1
- data/app/components/primer/alpha/tree_view/tree_view.ts +1 -1
- data/app/components/primer/alpha/tree_view/tree_view_icon_pair_element.js +1 -1
- data/app/components/primer/alpha/tree_view/tree_view_icon_pair_element.ts +1 -1
- data/app/components/primer/alpha/tree_view/tree_view_include_fragment_element.js +1 -1
- data/app/components/primer/alpha/tree_view/tree_view_include_fragment_element.ts +1 -1
- data/app/components/primer/alpha/tree_view/tree_view_sub_tree_node_element.js +25 -2
- data/app/components/primer/alpha/tree_view/tree_view_sub_tree_node_element.ts +27 -1
- data/app/components/primer/alpha/x_banner.js +1 -1
- data/app/components/primer/alpha/x_banner.ts +1 -1
- data/app/components/primer/beta/blankslate.css +1 -1
- data/app/components/primer/beta/blankslate.css.json +1 -0
- data/app/components/primer/beta/blankslate.css.map +1 -1
- data/app/components/primer/beta/blankslate.pcss +5 -0
- data/app/components/primer/beta/blankslate.rb +1 -0
- data/app/components/primer/beta/details_toggle_element.js +1 -1
- data/app/components/primer/beta/details_toggle_element.ts +1 -1
- data/app/components/primer/beta/nav_list.js +1 -1
- data/app/components/primer/beta/nav_list.ts +1 -1
- data/app/components/primer/beta/nav_list_group_element.js +1 -1
- data/app/components/primer/beta/nav_list_group_element.ts +1 -1
- data/app/components/primer/dialog_helper.js +17 -8
- data/app/components/primer/dialog_helper.ts +17 -8
- data/app/components/primer/scrollable_region.js +1 -1
- data/app/components/primer/scrollable_region.ts +1 -1
- data/app/controllers/primer/view_components/toggle_switch_controller.rb +2 -2
- data/app/forms/check_box_with_nested_form.rb +9 -5
- data/app/lib/primer/forms/check_box.rb +28 -0
- data/app/lib/primer/forms/dsl/multi_input.rb +3 -1
- data/app/lib/primer/forms/dsl/text_field_input.rb +2 -1
- data/app/lib/primer/forms/form_control.html.erb +2 -1
- data/app/lib/primer/forms/primer_multi_input.js +1 -1
- data/app/lib/primer/forms/primer_multi_input.ts +1 -1
- data/app/lib/primer/forms/primer_text_area.js +1 -1
- data/app/lib/primer/forms/primer_text_area.ts +1 -1
- data/app/lib/primer/forms/primer_text_field.js +1 -1
- data/app/lib/primer/forms/primer_text_field.ts +1 -1
- data/app/lib/primer/forms/text_field.html.erb +1 -1
- data/app/lib/primer/forms/toggle_switch_input.js +1 -1
- data/app/lib/primer/forms/toggle_switch_input.ts +1 -1
- data/lib/primer/accessibility.rb +9 -3
- data/lib/primer/view_components/engine.rb +1 -4
- data/lib/primer/view_components/version.rb +1 -1
- data/previews/primer/alpha/form_control_preview/playground.html.erb +4 -2
- data/previews/primer/alpha/octicon_symbols_preview/playground.html.erb +1 -1
- data/previews/primer/alpha/overlay_preview.rb +0 -25
- data/previews/primer/alpha/text_area_preview.rb +11 -11
- data/previews/primer/alpha/text_field_preview.rb +9 -0
- data/previews/primer/alpha/toggle_switch_preview.rb +14 -14
- data/previews/primer/beta/button_preview/all_schemes.html.erb +1 -1
- data/previews/primer/beta/button_preview/invisible_all_visuals.html.erb +1 -1
- data/previews/primer/beta/button_preview/summary_as_button.html.erb +9 -1
- data/static/arguments.json +7 -1
- data/static/info_arch.json +24 -17
- data/static/previews.json +15 -14
- metadata +2 -2
|
@@ -9,67 +9,67 @@ module Primer
|
|
|
9
9
|
include ActionView::Helpers::FormTagHelper
|
|
10
10
|
|
|
11
11
|
def playground
|
|
12
|
-
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path))
|
|
12
|
+
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, "aria-label": "Toggle Switch"))
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
# @snapshot
|
|
16
16
|
def default
|
|
17
|
-
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path))
|
|
17
|
+
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, "aria-label": "Default Toggle Switch"))
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
# @snapshot
|
|
21
21
|
def checked
|
|
22
|
-
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, checked: true))
|
|
22
|
+
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, checked: true, "aria-label": "Checked Toggle Switch"))
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
# @snapshot
|
|
26
26
|
def disabled
|
|
27
|
-
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, enabled: false))
|
|
27
|
+
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, enabled: false, "aria-label": "Disabled Toggle Switch"))
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
# @snapshot
|
|
31
31
|
def checked_disabled
|
|
32
|
-
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, checked: true, enabled: false))
|
|
32
|
+
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, checked: true, enabled: false, "aria-label": "Checked Disabled Toggle Switch"))
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
# @snapshot
|
|
36
36
|
def small
|
|
37
|
-
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, size: :small))
|
|
37
|
+
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, size: :small, "aria-label": "Small Toggle Switch"))
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
# @snapshot
|
|
41
41
|
def with_status_label_position_end
|
|
42
|
-
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, status_label_position: :end))
|
|
42
|
+
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, status_label_position: :end, "aria-label": "Toggle Switch with Status"))
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
# @snapshot
|
|
46
46
|
def with_a_bad_src
|
|
47
|
-
render(Primer::Alpha::ToggleSwitch.new(src: "/foo"))
|
|
47
|
+
render(Primer::Alpha::ToggleSwitch.new(src: "/foo", "aria-label": "Toggle Switch"))
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
def with_no_src
|
|
51
|
-
render(Primer::Alpha::ToggleSwitch.new)
|
|
51
|
+
render(Primer::Alpha::ToggleSwitch.new("aria-label": "Toggle Switch"))
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def with_csrf_token
|
|
55
|
-
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path))
|
|
55
|
+
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, "aria-label": "Toggle Switch"))
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
def with_bad_csrf_token
|
|
59
|
-
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, csrf_token: "i_am_a_criminal"))
|
|
59
|
+
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, csrf_token: "i_am_a_criminal", "aria-label": "Toggle Switch"))
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
def with_turbo
|
|
63
|
-
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, turbo: true))
|
|
63
|
+
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, turbo: true, "aria-label": "Toggle Switch"))
|
|
64
64
|
end
|
|
65
65
|
|
|
66
66
|
def with_autofocus
|
|
67
|
-
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, autofocus: true))
|
|
67
|
+
render(Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, autofocus: true, "aria-label": "Toggle Switch"))
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
def with_custom_status_label
|
|
72
|
-
render Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, on_label: "Enabled", off_label: "Disabled")
|
|
72
|
+
render Primer::Alpha::ToggleSwitch.new(src: UrlHelpers.primer_view_components.toggle_switch_index_path, on_label: "Enabled", off_label: "Disabled", "aria-label": "Toggle Switch")
|
|
73
73
|
end
|
|
74
74
|
end
|
|
75
75
|
end
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
<
|
|
1
|
+
<span
|
|
2
|
+
id="button-summary-live"
|
|
3
|
+
class="sr-only"
|
|
4
|
+
role="status"
|
|
5
|
+
aria-live="polite"
|
|
6
|
+
aria-atomic="true"></span>
|
|
7
|
+
|
|
8
|
+
<details
|
|
9
|
+
ontoggle="document.getElementById('button-summary-live').textContent = this.open ? 'A wrapping `details` tag is required when using the button with the `:summary` tag' : ''">
|
|
2
10
|
<%= render(Primer::Beta::Button.new(
|
|
3
11
|
scheme: scheme,
|
|
4
12
|
size: size,
|
data/static/arguments.json
CHANGED
|
@@ -2616,7 +2616,7 @@
|
|
|
2616
2616
|
"name": "gap",
|
|
2617
2617
|
"type": "Symbol",
|
|
2618
2618
|
"default": "`GapArg::DEFAULT`",
|
|
2619
|
-
"description": "Specify the gap between children elements in the stack. One of `nil`, `:condensed`, `:normal`, or `:spacious`."
|
|
2619
|
+
"description": "Specify the gap between children elements in the stack. One of `nil`, `:condensed`, `:none`, `:normal`, or `:spacious`."
|
|
2620
2620
|
},
|
|
2621
2621
|
{
|
|
2622
2622
|
"name": "direction",
|
|
@@ -3219,6 +3219,12 @@
|
|
|
3219
3219
|
"type": "String",
|
|
3220
3220
|
"default": "`nil`",
|
|
3221
3221
|
"description": "Custom label to show when the switch is OFF. Defaults to (\"Off\"). Only customize this label if it makes the toggle’s state more meaningful in its specific context. For example, for a \"Show images\" setting, you might use \"Show\" when the switch is OFF."
|
|
3222
|
+
},
|
|
3223
|
+
{
|
|
3224
|
+
"name": "button_type",
|
|
3225
|
+
"type": "Symbol",
|
|
3226
|
+
"default": "`nil`",
|
|
3227
|
+
"description": "The type attribute for the underlying button element. If `nil`, the button will not have a type attribute, which means it will default to \"submit\" if it's inside a form and \"button\" otherwise."
|
|
3222
3228
|
}
|
|
3223
3229
|
]
|
|
3224
3230
|
},
|
data/static/info_arch.json
CHANGED
|
@@ -4629,7 +4629,7 @@
|
|
|
4629
4629
|
{
|
|
4630
4630
|
"fully_qualified_name": "Primer::Alpha::Layout",
|
|
4631
4631
|
"description": "`Layout` provides foundational patterns for responsive pages.\n`Layout` can be used for simple two-column pages, or it can be nested to provide flexible 3-column experiences.\n On smaller screens, `Layout` uses vertically stacked rows to display content.\n\n`Layout` flows as both column, when there's enough horizontal space to render both `Main` and `Sidebar`side-by-side (on a desktop of tablet device, per instance);\nor it flows as a row, when `Main` and `Sidebar` are stacked vertically (e.g. on a mobile device).\n`Layout` should always work in any screen size.",
|
|
4632
|
-
"accessibility_docs": "Keyboard navigation follows the markup order. Decide carefully how the focus order should be be by deciding whether\n`main` or `sidebar` comes first in code. The code order won
|
|
4632
|
+
"accessibility_docs": "Keyboard navigation follows the markup order. Decide carefully how the focus order should be be by deciding whether\n`main` or `sidebar` comes first in code. The code order won't affect the visual position.\n\nWhen using `row_placement: :none` on the sidebar, the sidebar content will be hidden at narrow viewports.\nThis may cause WCAG 1.4.10 Reflow failures if the sidebar contains essential content. Only use `:none`\nwhen the sidebar content is non-essential or available elsewhere on the page.",
|
|
4633
4633
|
"is_form_component": false,
|
|
4634
4634
|
"is_published": true,
|
|
4635
4635
|
"requires_js": false,
|
|
@@ -4704,7 +4704,7 @@
|
|
|
4704
4704
|
"name": "row_placement",
|
|
4705
4705
|
"type": "Symbol",
|
|
4706
4706
|
"default": "N/A",
|
|
4707
|
-
"description": "Sidebar placement when `Layout` is in row mode. One of `:end`, `:none`, or `:start`."
|
|
4707
|
+
"description": "Sidebar placement when `Layout` is in row mode. One of `:end`, `:none`, or `:start`. **Note:** Using `:none` hides the sidebar at narrow viewports, which may cause WCAG 1.4.10 Reflow issues if the sidebar contains essential content."
|
|
4708
4708
|
},
|
|
4709
4709
|
{
|
|
4710
4710
|
"name": "system_arguments",
|
|
@@ -5312,7 +5312,8 @@
|
|
|
5312
5312
|
"snapshot": "true",
|
|
5313
5313
|
"skip_rules": {
|
|
5314
5314
|
"wont_fix": [
|
|
5315
|
-
"region"
|
|
5315
|
+
"region",
|
|
5316
|
+
"label-title-only"
|
|
5316
5317
|
],
|
|
5317
5318
|
"will_fix": [
|
|
5318
5319
|
"color-contrast"
|
|
@@ -6059,19 +6060,6 @@
|
|
|
6059
6060
|
]
|
|
6060
6061
|
}
|
|
6061
6062
|
},
|
|
6062
|
-
{
|
|
6063
|
-
"preview_path": "primer/alpha/overlay/menu_no_header",
|
|
6064
|
-
"name": "menu_no_header",
|
|
6065
|
-
"snapshot": "false",
|
|
6066
|
-
"skip_rules": {
|
|
6067
|
-
"wont_fix": [
|
|
6068
|
-
"region"
|
|
6069
|
-
],
|
|
6070
|
-
"will_fix": [
|
|
6071
|
-
"color-contrast"
|
|
6072
|
-
]
|
|
6073
|
-
}
|
|
6074
|
-
},
|
|
6075
6063
|
{
|
|
6076
6064
|
"preview_path": "primer/alpha/overlay/middle_of_page",
|
|
6077
6065
|
"name": "middle_of_page",
|
|
@@ -8079,7 +8067,7 @@
|
|
|
8079
8067
|
"name": "gap",
|
|
8080
8068
|
"type": "Symbol",
|
|
8081
8069
|
"default": "`GapArg::DEFAULT`",
|
|
8082
|
-
"description": "Specify the gap between children elements in the stack. One of `nil`, `:condensed`, `:normal`, or `:spacious`."
|
|
8070
|
+
"description": "Specify the gap between children elements in the stack. One of `nil`, `:condensed`, `:none`, `:normal`, or `:spacious`."
|
|
8083
8071
|
},
|
|
8084
8072
|
{
|
|
8085
8073
|
"name": "direction",
|
|
@@ -9157,6 +9145,19 @@
|
|
|
9157
9145
|
]
|
|
9158
9146
|
}
|
|
9159
9147
|
},
|
|
9148
|
+
{
|
|
9149
|
+
"preview_path": "primer/alpha/text_field/show_clear_button_with_custom_label",
|
|
9150
|
+
"name": "show_clear_button_with_custom_label",
|
|
9151
|
+
"snapshot": "true",
|
|
9152
|
+
"skip_rules": {
|
|
9153
|
+
"wont_fix": [
|
|
9154
|
+
"region"
|
|
9155
|
+
],
|
|
9156
|
+
"will_fix": [
|
|
9157
|
+
"color-contrast"
|
|
9158
|
+
]
|
|
9159
|
+
}
|
|
9160
|
+
},
|
|
9160
9161
|
{
|
|
9161
9162
|
"preview_path": "primer/alpha/text_field/full_width",
|
|
9162
9163
|
"name": "full_width",
|
|
@@ -9551,6 +9552,12 @@
|
|
|
9551
9552
|
"type": "String",
|
|
9552
9553
|
"default": "`nil`",
|
|
9553
9554
|
"description": "Custom label to show when the switch is OFF. Defaults to (\"Off\"). Only customize this label if it makes the toggle’s state more meaningful in its specific context. For example, for a \"Show images\" setting, you might use \"Show\" when the switch is OFF."
|
|
9555
|
+
},
|
|
9556
|
+
{
|
|
9557
|
+
"name": "button_type",
|
|
9558
|
+
"type": "Symbol",
|
|
9559
|
+
"default": "`nil`",
|
|
9560
|
+
"description": "The type attribute for the underlying button element. If `nil`, the button will not have a type attribute, which means it will default to \"submit\" if it's inside a form and \"button\" otherwise."
|
|
9554
9561
|
}
|
|
9555
9562
|
],
|
|
9556
9563
|
"slots": [],
|
data/static/previews.json
CHANGED
|
@@ -4883,7 +4883,8 @@
|
|
|
4883
4883
|
"snapshot": "true",
|
|
4884
4884
|
"skip_rules": {
|
|
4885
4885
|
"wont_fix": [
|
|
4886
|
-
"region"
|
|
4886
|
+
"region",
|
|
4887
|
+
"label-title-only"
|
|
4887
4888
|
],
|
|
4888
4889
|
"will_fix": [
|
|
4889
4890
|
"color-contrast"
|
|
@@ -5130,19 +5131,6 @@
|
|
|
5130
5131
|
]
|
|
5131
5132
|
}
|
|
5132
5133
|
},
|
|
5133
|
-
{
|
|
5134
|
-
"preview_path": "primer/alpha/overlay/menu_no_header",
|
|
5135
|
-
"name": "menu_no_header",
|
|
5136
|
-
"snapshot": "false",
|
|
5137
|
-
"skip_rules": {
|
|
5138
|
-
"wont_fix": [
|
|
5139
|
-
"region"
|
|
5140
|
-
],
|
|
5141
|
-
"will_fix": [
|
|
5142
|
-
"color-contrast"
|
|
5143
|
-
]
|
|
5144
|
-
}
|
|
5145
|
-
},
|
|
5146
5134
|
{
|
|
5147
5135
|
"preview_path": "primer/alpha/overlay/middle_of_page",
|
|
5148
5136
|
"name": "middle_of_page",
|
|
@@ -7141,6 +7129,19 @@
|
|
|
7141
7129
|
]
|
|
7142
7130
|
}
|
|
7143
7131
|
},
|
|
7132
|
+
{
|
|
7133
|
+
"preview_path": "primer/alpha/text_field/show_clear_button_with_custom_label",
|
|
7134
|
+
"name": "show_clear_button_with_custom_label",
|
|
7135
|
+
"snapshot": "true",
|
|
7136
|
+
"skip_rules": {
|
|
7137
|
+
"wont_fix": [
|
|
7138
|
+
"region"
|
|
7139
|
+
],
|
|
7140
|
+
"will_fix": [
|
|
7141
|
+
"color-contrast"
|
|
7142
|
+
]
|
|
7143
|
+
}
|
|
7144
|
+
},
|
|
7144
7145
|
{
|
|
7145
7146
|
"preview_path": "primer/alpha/text_field/full_width",
|
|
7146
7147
|
"name": "full_width",
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: primer_view_components
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.51.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GitHub Open Source
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-02-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionview
|