openproject-primer_view_components 0.41.1 → 0.42.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 +30 -0
- data/app/assets/javascripts/app/components/primer/alpha/select_panel_element.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_list/item.html.erb +1 -5
- data/app/components/primer/alpha/action_list/item.rb +10 -3
- data/app/components/primer/alpha/segmented_control.css +1 -1
- data/app/components/primer/alpha/segmented_control.css.map +1 -1
- data/app/components/primer/alpha/segmented_control.pcss +1 -0
- data/app/components/primer/alpha/select_panel.rb +2 -1
- data/app/components/primer/alpha/select_panel_element.d.ts +0 -1
- data/app/components/primer/alpha/select_panel_element.js +38 -19
- data/app/components/primer/alpha/select_panel_element.ts +36 -22
- data/app/components/primer/alpha/tool_tip.js +2 -2
- data/app/components/primer/alpha/tool_tip.ts +2 -2
- data/app/components/primer/beta/relative_time.rb +4 -4
- data/app/components/primer/beta/state.css +1 -1
- data/app/components/primer/beta/state.css.map +1 -1
- data/app/components/primer/beta/state.pcss +4 -0
- data/lib/primer/view_components/linters/details_menu_migration.rb +30 -1
- data/lib/primer/view_components/linters/tooltipped_migration.rb +1 -1
- data/lib/primer/view_components/version.rb +2 -2
- data/previews/primer/alpha/action_list_preview.rb +1 -1
- data/previews/primer/alpha/select_panel_preview/list_of_links.html.erb +16 -0
- data/previews/primer/alpha/select_panel_preview/playground.html.erb +2 -1
- data/previews/primer/alpha/select_panel_preview.rb +12 -1
- data/static/arguments.json +5 -5
- data/static/info_arch.json +57 -11
- data/static/previews.json +13 -0
- metadata +3 -2
@@ -10,7 +10,7 @@ module ERBLint
|
|
10
10
|
include LinterRegistry
|
11
11
|
include Helpers::RuleHelpers
|
12
12
|
|
13
|
-
MIGRATE_TO_NEWER_TOOLTIP = ".tooltipped has been deprecated.
|
13
|
+
MIGRATE_TO_NEWER_TOOLTIP = ".tooltipped has been deprecated. Due to major accessibility concerns with using this tooltip, please migrate to a Primer Tooltip component or rework the design to eliminate the tooltip. See https://primer.style/guides/rails/migration-guides/primer-css-tooltipped."
|
14
14
|
TOOLTIPPED_RUBY_PATTERN = /classes:.*tooltipped|class:.*tooltipped/.freeze
|
15
15
|
|
16
16
|
def run(processed_source)
|
@@ -380,7 +380,7 @@ module Primer
|
|
380
380
|
aria: { label: "List heading" }
|
381
381
|
)) do |component|
|
382
382
|
component.with_item(label: "Default item", href: "/") do |item|
|
383
|
-
item.with_description.with_content("This is a description")
|
383
|
+
item.with_description(test_selector: "some-selector").with_content("This is a description")
|
384
384
|
end
|
385
385
|
end
|
386
386
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<% subject_id = SecureRandom.hex %>
|
2
|
+
|
3
|
+
<%= render(Primer::Alpha::SelectPanel.new(
|
4
|
+
data: { interaction_subject: subject_id },
|
5
|
+
select_variant: :single,
|
6
|
+
fetch_strategy: :local,
|
7
|
+
open_on_load: open_on_load
|
8
|
+
)) do |panel| %>
|
9
|
+
<% panel.with_show_button { "Panel" } %>
|
10
|
+
<% panel.with_item(label: "GitHub", href: "https://github.com") %>
|
11
|
+
<% panel.with_item(label: "Microsoft", href: "https://microsoft.com") %>
|
12
|
+
<% panel.with_item(label: "Primer", href: "https://primer.style") %>
|
13
|
+
<% panel.with_item(label: "Catalyst", href: "https://catalyst.rocks") %>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= render partial: "primer/alpha/select_panel_preview/interaction_subject_js", locals: { subject_id: subject_id } %>
|
@@ -18,6 +18,7 @@ module Primer
|
|
18
18
|
# @param open_on_load toggle
|
19
19
|
# @param anchor_align [Symbol] select [start, center, end]
|
20
20
|
# @param anchor_side [Symbol] select [outside_bottom, outside_top, outside_left, outside_right]
|
21
|
+
# @param select_items toggle
|
21
22
|
def playground(
|
22
23
|
title: "Sci-fi equipment",
|
23
24
|
subtitle: "Various tools from your favorite shows",
|
@@ -31,10 +32,12 @@ module Primer
|
|
31
32
|
show_filter: true,
|
32
33
|
open_on_load: false,
|
33
34
|
anchor_align: :start,
|
34
|
-
anchor_side: :outside_bottom
|
35
|
+
anchor_side: :outside_bottom,
|
36
|
+
select_items: true
|
35
37
|
)
|
36
38
|
render_with_template(locals: {
|
37
39
|
subtitle: subtitle,
|
40
|
+
select_items: select_items,
|
38
41
|
system_arguments: {
|
39
42
|
title: title,
|
40
43
|
size: size,
|
@@ -234,6 +237,14 @@ module Primer
|
|
234
237
|
def multiselect_form(open_on_load: false, route_format: :html)
|
235
238
|
render_with_template(locals: { open_on_load: open_on_load, route_format: route_format })
|
236
239
|
end
|
240
|
+
|
241
|
+
# @label List of links
|
242
|
+
#
|
243
|
+
# @snapshot interactive
|
244
|
+
# @param open_on_load toggle
|
245
|
+
def list_of_links(open_on_load: false)
|
246
|
+
render_with_template(locals: { open_on_load: open_on_load })
|
247
|
+
end
|
237
248
|
end
|
238
249
|
end
|
239
250
|
end
|
data/static/arguments.json
CHANGED
@@ -4336,9 +4336,9 @@
|
|
4336
4336
|
},
|
4337
4337
|
{
|
4338
4338
|
"name": "prefix",
|
4339
|
-
"type": "
|
4339
|
+
"type": "String",
|
4340
4340
|
"default": "`nil`",
|
4341
|
-
"description": "What to prefix the relative
|
4341
|
+
"description": "What to prefix the relative time display with."
|
4342
4342
|
},
|
4343
4343
|
{
|
4344
4344
|
"name": "second",
|
@@ -4390,7 +4390,7 @@
|
|
4390
4390
|
},
|
4391
4391
|
{
|
4392
4392
|
"name": "threshold",
|
4393
|
-
"type": "
|
4393
|
+
"type": "String",
|
4394
4394
|
"default": "`nil`",
|
4395
4395
|
"description": "The threshold, in ISO-8601 'durations' format, at which relative time displays become absolute."
|
4396
4396
|
},
|
@@ -4414,13 +4414,13 @@
|
|
4414
4414
|
},
|
4415
4415
|
{
|
4416
4416
|
"name": "lang",
|
4417
|
-
"type": "
|
4417
|
+
"type": "String",
|
4418
4418
|
"default": "`nil`",
|
4419
4419
|
"description": "The language to use."
|
4420
4420
|
},
|
4421
4421
|
{
|
4422
4422
|
"name": "title",
|
4423
|
-
"type": "
|
4423
|
+
"type": "String",
|
4424
4424
|
"default": "`nil`",
|
4425
4425
|
"description": "Provide a custom title to the element."
|
4426
4426
|
},
|
data/static/info_arch.json
CHANGED
@@ -989,9 +989,20 @@
|
|
989
989
|
"slots": [
|
990
990
|
{
|
991
991
|
"name": "description",
|
992
|
-
"description": "Description content that complements the item's label
|
992
|
+
"description": "Description content that complements the item's label, with optional test_selector.\nSee `ActionList`'s `description_scheme` argument for layout options.",
|
993
993
|
"parameters": [
|
994
|
-
|
994
|
+
{
|
995
|
+
"name": "legacy_content",
|
996
|
+
"type": "String",
|
997
|
+
"default": "N/A",
|
998
|
+
"description": "Slot content, provided for backwards-compatibility. Pass a content block instead, or call `with_content`, eg. `component.with_description { \"My description\" }` or `component.with_description.with_content(\"My description\")`."
|
999
|
+
},
|
1000
|
+
{
|
1001
|
+
"name": "test_selector",
|
1002
|
+
"type": "String",
|
1003
|
+
"default": "N/A",
|
1004
|
+
"description": "The value of this argument is set as the value of a `data-test-selector` HTML attribute on the description element."
|
1005
|
+
}
|
995
1006
|
]
|
996
1007
|
},
|
997
1008
|
{
|
@@ -5547,9 +5558,20 @@
|
|
5547
5558
|
},
|
5548
5559
|
{
|
5549
5560
|
"name": "description",
|
5550
|
-
"description": "Description content that complements the item's label
|
5561
|
+
"description": "Description content that complements the item's label, with optional test_selector.\nSee `ActionList`'s `description_scheme` argument for layout options.",
|
5551
5562
|
"parameters": [
|
5552
|
-
|
5563
|
+
{
|
5564
|
+
"name": "legacy_content",
|
5565
|
+
"type": "String",
|
5566
|
+
"default": "N/A",
|
5567
|
+
"description": "Slot content, provided for backwards-compatibility. Pass a content block instead, or call `with_content`, eg. `component.with_description { \"My description\" }` or `component.with_description.with_content(\"My description\")`."
|
5568
|
+
},
|
5569
|
+
{
|
5570
|
+
"name": "test_selector",
|
5571
|
+
"type": "String",
|
5572
|
+
"default": "N/A",
|
5573
|
+
"description": "The value of this argument is set as the value of a `data-test-selector` HTML attribute on the description element."
|
5574
|
+
}
|
5553
5575
|
]
|
5554
5576
|
},
|
5555
5577
|
{
|
@@ -8083,6 +8105,19 @@
|
|
8083
8105
|
"color-contrast"
|
8084
8106
|
]
|
8085
8107
|
}
|
8108
|
+
},
|
8109
|
+
{
|
8110
|
+
"preview_path": "primer/alpha/select_panel/list_of_links",
|
8111
|
+
"name": "list_of_links",
|
8112
|
+
"snapshot": "interactive",
|
8113
|
+
"skip_rules": {
|
8114
|
+
"wont_fix": [
|
8115
|
+
"region"
|
8116
|
+
],
|
8117
|
+
"will_fix": [
|
8118
|
+
"color-contrast"
|
8119
|
+
]
|
8120
|
+
}
|
8086
8121
|
}
|
8087
8122
|
],
|
8088
8123
|
"subcomponents": [
|
@@ -14687,9 +14722,20 @@
|
|
14687
14722
|
},
|
14688
14723
|
{
|
14689
14724
|
"name": "description",
|
14690
|
-
"description": "Description content that complements the item's label
|
14725
|
+
"description": "Description content that complements the item's label, with optional test_selector.\nSee `ActionList`'s `description_scheme` argument for layout options.",
|
14691
14726
|
"parameters": [
|
14692
|
-
|
14727
|
+
{
|
14728
|
+
"name": "legacy_content",
|
14729
|
+
"type": "String",
|
14730
|
+
"default": "N/A",
|
14731
|
+
"description": "Slot content, provided for backwards-compatibility. Pass a content block instead, or call `with_content`, eg. `component.with_description { \"My description\" }` or `component.with_description.with_content(\"My description\")`."
|
14732
|
+
},
|
14733
|
+
{
|
14734
|
+
"name": "test_selector",
|
14735
|
+
"type": "String",
|
14736
|
+
"default": "N/A",
|
14737
|
+
"description": "The value of this argument is set as the value of a `data-test-selector` HTML attribute on the description element."
|
14738
|
+
}
|
14693
14739
|
]
|
14694
14740
|
},
|
14695
14741
|
{
|
@@ -15349,9 +15395,9 @@
|
|
15349
15395
|
},
|
15350
15396
|
{
|
15351
15397
|
"name": "prefix",
|
15352
|
-
"type": "
|
15398
|
+
"type": "String",
|
15353
15399
|
"default": "`nil`",
|
15354
|
-
"description": "What to prefix the relative
|
15400
|
+
"description": "What to prefix the relative time display with."
|
15355
15401
|
},
|
15356
15402
|
{
|
15357
15403
|
"name": "second",
|
@@ -15403,7 +15449,7 @@
|
|
15403
15449
|
},
|
15404
15450
|
{
|
15405
15451
|
"name": "threshold",
|
15406
|
-
"type": "
|
15452
|
+
"type": "String",
|
15407
15453
|
"default": "`nil`",
|
15408
15454
|
"description": "The threshold, in ISO-8601 'durations' format, at which relative time displays become absolute."
|
15409
15455
|
},
|
@@ -15427,13 +15473,13 @@
|
|
15427
15473
|
},
|
15428
15474
|
{
|
15429
15475
|
"name": "lang",
|
15430
|
-
"type": "
|
15476
|
+
"type": "String",
|
15431
15477
|
"default": "`nil`",
|
15432
15478
|
"description": "The language to use."
|
15433
15479
|
},
|
15434
15480
|
{
|
15435
15481
|
"name": "title",
|
15436
|
-
"type": "
|
15482
|
+
"type": "String",
|
15437
15483
|
"default": "`nil`",
|
15438
15484
|
"description": "Provide a custom title to the element."
|
15439
15485
|
},
|
data/static/previews.json
CHANGED
@@ -6624,6 +6624,19 @@
|
|
6624
6624
|
"color-contrast"
|
6625
6625
|
]
|
6626
6626
|
}
|
6627
|
+
},
|
6628
|
+
{
|
6629
|
+
"preview_path": "primer/alpha/select_panel/list_of_links",
|
6630
|
+
"name": "list_of_links",
|
6631
|
+
"snapshot": "interactive",
|
6632
|
+
"skip_rules": {
|
6633
|
+
"wont_fix": [
|
6634
|
+
"region"
|
6635
|
+
],
|
6636
|
+
"will_fix": [
|
6637
|
+
"color-contrast"
|
6638
|
+
]
|
6639
|
+
}
|
6627
6640
|
}
|
6628
6641
|
]
|
6629
6642
|
},
|
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.42.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: 2024-08-
|
12
|
+
date: 2024-08-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionview
|
@@ -855,6 +855,7 @@ files:
|
|
855
855
|
- previews/primer/alpha/select_panel_preview/eventually_local_fetch_initial_failure.html.erb
|
856
856
|
- previews/primer/alpha/select_panel_preview/eventually_local_fetch_no_results.html.erb
|
857
857
|
- previews/primer/alpha/select_panel_preview/footer_buttons.html.erb
|
858
|
+
- previews/primer/alpha/select_panel_preview/list_of_links.html.erb
|
858
859
|
- previews/primer/alpha/select_panel_preview/local_fetch.html.erb
|
859
860
|
- previews/primer/alpha/select_panel_preview/local_fetch_no_results.html.erb
|
860
861
|
- previews/primer/alpha/select_panel_preview/multiselect.html.erb
|