primer_view_components 0.30.0 → 0.31.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -0
  3. data/app/assets/javascripts/app/components/primer/alpha/select_panel_element.d.ts +0 -1
  4. data/app/assets/javascripts/primer_view_components.js +1 -1
  5. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  6. data/app/assets/styles/primer_view_components.css +1 -1
  7. data/app/assets/styles/primer_view_components.css.map +1 -1
  8. data/app/components/primer/alpha/action_list/item.html.erb +1 -5
  9. data/app/components/primer/alpha/action_list/item.rb +10 -3
  10. data/app/components/primer/alpha/segmented_control.css +1 -1
  11. data/app/components/primer/alpha/segmented_control.css.map +1 -1
  12. data/app/components/primer/alpha/segmented_control.pcss +1 -0
  13. data/app/components/primer/alpha/select_panel.rb +2 -1
  14. data/app/components/primer/alpha/select_panel_element.d.ts +0 -1
  15. data/app/components/primer/alpha/select_panel_element.js +38 -19
  16. data/app/components/primer/alpha/select_panel_element.ts +36 -22
  17. data/app/components/primer/alpha/tool_tip.js +2 -2
  18. data/app/components/primer/alpha/tool_tip.ts +2 -2
  19. data/app/components/primer/beta/relative_time.rb +4 -4
  20. data/app/components/primer/beta/state.css +1 -1
  21. data/app/components/primer/beta/state.css.map +1 -1
  22. data/app/components/primer/beta/state.pcss +4 -0
  23. data/lib/primer/view_components/linters/details_menu_migration.rb +30 -1
  24. data/lib/primer/view_components/linters/tooltipped_migration.rb +1 -1
  25. data/lib/primer/view_components/version.rb +1 -1
  26. data/previews/primer/alpha/action_list_preview.rb +1 -1
  27. data/previews/primer/alpha/select_panel_preview/list_of_links.html.erb +16 -0
  28. data/previews/primer/alpha/select_panel_preview/playground.html.erb +2 -1
  29. data/previews/primer/alpha/select_panel_preview.rb +12 -1
  30. data/static/arguments.json +5 -5
  31. data/static/info_arch.json +57 -11
  32. data/static/previews.json +13 -0
  33. 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. There are major accessibility concerns with using this tooltip so please take action. See https://primer.style/guides/rails/migration-guides/primer-css-tooltipped."
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)
@@ -5,7 +5,7 @@ module Primer
5
5
  module ViewComponents
6
6
  module VERSION
7
7
  MAJOR = 0
8
- MINOR = 30
8
+ MINOR = 31
9
9
  PATCH = 0
10
10
 
11
11
  STRING = [MAJOR, MINOR, PATCH].join(".")
@@ -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 } %>
@@ -8,7 +8,8 @@
8
8
  src: select_panel_items_path(
9
9
  select_variant: :single,
10
10
  show_results: !simulate_no_results,
11
- fail: simulate_failure
11
+ fail: simulate_failure,
12
+ select_items: select_items
12
13
  ),
13
14
  select_variant: :single,
14
15
  fetch_strategy: :remote,
@@ -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
@@ -4336,9 +4336,9 @@
4336
4336
  },
4337
4337
  {
4338
4338
  "name": "prefix",
4339
- "type": "sring",
4339
+ "type": "String",
4340
4340
  "default": "`nil`",
4341
- "description": "What to prefix the relative ime display with."
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": "string",
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": "string",
4417
+ "type": "String",
4418
4418
  "default": "`nil`",
4419
4419
  "description": "The language to use."
4420
4420
  },
4421
4421
  {
4422
4422
  "name": "title",
4423
- "type": "string",
4423
+ "type": "String",
4424
4424
  "default": "`nil`",
4425
4425
  "description": "Provide a custom title to the element."
4426
4426
  },
@@ -989,9 +989,20 @@
989
989
  "slots": [
990
990
  {
991
991
  "name": "description",
992
- "description": "Description content that complements the item's label. See `ActionList`'s `description_scheme` argument\nfor layout options.",
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. See `ActionList`'s `description_scheme` argument\nfor layout options.",
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. See `ActionList`'s `description_scheme` argument\nfor layout options.",
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": "sring",
15398
+ "type": "String",
15353
15399
  "default": "`nil`",
15354
- "description": "What to prefix the relative ime display with."
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": "string",
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": "string",
15476
+ "type": "String",
15431
15477
  "default": "`nil`",
15432
15478
  "description": "The language to use."
15433
15479
  },
15434
15480
  {
15435
15481
  "name": "title",
15436
- "type": "string",
15482
+ "type": "String",
15437
15483
  "default": "`nil`",
15438
15484
  "description": "Provide a custom title to the element."
15439
15485
  },
data/static/previews.json CHANGED
@@ -6160,6 +6160,19 @@
6160
6160
  "color-contrast"
6161
6161
  ]
6162
6162
  }
6163
+ },
6164
+ {
6165
+ "preview_path": "primer/alpha/select_panel/list_of_links",
6166
+ "name": "list_of_links",
6167
+ "snapshot": "interactive",
6168
+ "skip_rules": {
6169
+ "wont_fix": [
6170
+ "region"
6171
+ ],
6172
+ "will_fix": [
6173
+ "color-contrast"
6174
+ ]
6175
+ }
6163
6176
  }
6164
6177
  ]
6165
6178
  },
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.30.0
4
+ version: 0.31.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: 2024-07-26 00:00:00.000000000 Z
11
+ date: 2024-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -792,6 +792,7 @@ files:
792
792
  - previews/primer/alpha/select_panel_preview/eventually_local_fetch_initial_failure.html.erb
793
793
  - previews/primer/alpha/select_panel_preview/eventually_local_fetch_no_results.html.erb
794
794
  - previews/primer/alpha/select_panel_preview/footer_buttons.html.erb
795
+ - previews/primer/alpha/select_panel_preview/list_of_links.html.erb
795
796
  - previews/primer/alpha/select_panel_preview/local_fetch.html.erb
796
797
  - previews/primer/alpha/select_panel_preview/local_fetch_no_results.html.erb
797
798
  - previews/primer/alpha/select_panel_preview/multiselect.html.erb