openproject-primer_view_components 0.62.0 → 0.64.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4929f92b5de2ff7680b004eda5619b18549a1205583b53e152d3ca1b53699238
4
- data.tar.gz: f41e2230548ff1bd6dfe7e1560a78b3470c082e36d295c648f993745956dfa9c
3
+ metadata.gz: c14efbdaa174fe50a4ab8910f0d4d15b7395e9cb13f10c437a733205f31a713a
4
+ data.tar.gz: '06395f1e3999aad177aed7b3312f0ce397fdc02893cca1ed55b8788d58ba915f'
5
5
  SHA512:
6
- metadata.gz: 9541c3e5adb821cb65525fd20ad425cedad0235f3aaeca2dd0ceb8fc77b1b890e10602b30aa9d7e91628376f52d5112421afc17e3ffb5b883380474e61675a8d
7
- data.tar.gz: 81d3002af641bd143d1decad9d0ca419fe5b83103102caa79d1dc407b5a5809886a29cc1bdf1ef9a05874876127645b1056611d07bd6aaa520b8ee1dad15ecdc
6
+ metadata.gz: 2c24a2a4acee0ffe10644fa9d1195b2640fac91f77159c9919359b0585e72931d4b541676f3021dcc921c0523a829f21963eda4fb62024fb72d9be700540985b
7
+ data.tar.gz: 8785b506bc36848f1251bff3d7e85631fa9a5b9dd3a4c6b21e1d2333bf79ae8dcef228b6d023b9909a7b051dfb430e1815273b4370618b81e19d7ce9a7b02989
data/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.64.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#3466](https://github.com/primer/view_components/pull/3466) [`57f6c41`](https://github.com/opf/primer_view_components/commit/57f6c41025de70dfcd6880dab7e881d182e3cbd9) Thanks [@manuelpuyol](https://github.com/manuelpuyol)! - Create Primer::CurrentAttributes allowing apps to set request specific context to components. Update IncludeFragment to add data-nonce when a current nonce is present.
8
+
9
+ ### Patch Changes
10
+
11
+ - [#3447](https://github.com/primer/view_components/pull/3447) [`c2b88cb`](https://github.com/opf/primer_view_components/commit/c2b88cb1d75e86fc0b410e3fc597e48326f471a5) Thanks [@bsatarnejad](https://github.com/bsatarnejad)! - Add a new custom label for close button in dialog header
12
+
13
+ - [#3450](https://github.com/primer/view_components/pull/3450) [`5e86bf4`](https://github.com/opf/primer_view_components/commit/5e86bf422b13a3818def5ceab464f8e362f9021b) Thanks [@francinelucca](https://github.com/francinelucca)! - Fix(SelectPanel): incorrect padding when no filter
14
+
15
+ ## 0.63.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#3428](https://github.com/primer/view_components/pull/3428) [`1ab1b06`](https://github.com/opf/primer_view_components/commit/1ab1b06509763ea60fc89770754edf06229b4f63) Thanks [@manuelpuyol](https://github.com/manuelpuyol)! - Create IncludeFragment component. Allow ConditionalWrapper to render components other than BaseComponent
20
+
21
+ ### Patch Changes
22
+
23
+ - [#3429](https://github.com/primer/view_components/pull/3429) [`6ea9fd5`](https://github.com/opf/primer_view_components/commit/6ea9fd5dc90c1964ab3882faf1733c6b49c80e21) Thanks [@manuelpuyol](https://github.com/manuelpuyol)! - Create IncludeFragment linter to migrate <include-fragment> uses
24
+
3
25
  ## 0.62.0
4
26
 
5
27
  ### Minor Changes
@@ -3,7 +3,7 @@
3
3
  <%= render(@overlay) do |overlay| %>
4
4
  <% overlay.with_body(padding: :none) do %>
5
5
  <% if @src.present? %>
6
- <include-fragment src="<%= @src %>" loading="<%= preload? ? "eager" : "lazy" %>" data-target="action-menu.includeFragment">
6
+ <%= render(Primer::Alpha::IncludeFragment.new(src: @src, loading: preload? ? :eager : :lazy, "data-target": "action-menu.includeFragment")) do %>
7
7
  <%= render(Primer::Alpha::ActionMenu::List.new(id: "#{@menu_id}-list", menu_id: @menu_id)) do |list| %>
8
8
  <% list.with_item(
9
9
  aria: { disabled: true },
@@ -18,7 +18,7 @@
18
18
  <%= render Primer::Beta::Spinner.new(aria: { label: "Loading content..." }) %>
19
19
  <% end %>
20
20
  <% end %>
21
- </include-fragment>
21
+ <% end %>
22
22
  <% else %>
23
23
  <%= render(@list) %>
24
24
  <% end %>
@@ -13,7 +13,7 @@
13
13
  <% end %>
14
14
  </div>
15
15
  <div class="Overlay-actionWrap">
16
- <%= render Primer::Beta::CloseButton.new(classes: "Overlay-closeButton", "data-close-dialog-id": @id) %>
16
+ <%= render Primer::Beta::CloseButton.new(classes: "Overlay-closeButton", "data-close-dialog-id": @id, aria: { label: @close_label }) %>
17
17
  </div>
18
18
  </div>
19
19
  <%= filter %>
@@ -16,6 +16,8 @@ module Primer
16
16
  }.freeze
17
17
  VARIANT_OPTIONS = VARIANT_MAPPINGS.keys
18
18
 
19
+ DEFAULT_CLOSE_LABEL = "Close"
20
+
19
21
  # Optional filter slot for adding a filter input to the header.
20
22
  #
21
23
  # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
@@ -48,6 +50,7 @@ module Primer
48
50
  # @param show_divider [Boolean] Show a divider between the header and body.
49
51
  # @param visually_hide_title [Boolean] Visually hide the `title` while maintaining a label for assistive technologies.
50
52
  # @param variant [Symbol] <%= one_of(Primer::Alpha::Dialog::Header::VARIANT_OPTIONS) %>
53
+ # @param close_label [String] The aria-label text of the close "x" button.
51
54
  # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
52
55
  def initialize(
53
56
  id:,
@@ -56,12 +59,14 @@ module Primer
56
59
  show_divider: false,
57
60
  visually_hide_title: false,
58
61
  variant: DEFAULT_VARIANT,
62
+ close_label: DEFAULT_CLOSE_LABEL,
59
63
  **system_arguments
60
64
  )
61
65
  @id = id
62
66
  @title = title
63
67
  @subtitle = subtitle
64
68
  @visually_hide_title = visually_hide_title
69
+ @close_label = close_label
65
70
  @system_arguments = deny_tag_argument(**system_arguments)
66
71
  @system_arguments[:tag] = :div
67
72
 
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Primer
4
+ module Alpha
5
+ # Use `IncludeFragment` to load HTML elements from the server.
6
+ # Add additional usage considerations or best practices that may aid the user to use the component correctly.
7
+ # @accessibility Add any accessibility considerations
8
+ class IncludeFragment < Primer::Component
9
+ status :alpha
10
+
11
+ ALLOWED_LOADING_VALUES = [:lazy, :eager].freeze
12
+ DEFAULT_LOADING = :eager
13
+
14
+ # @param src [String] The URL from which to retrieve an HTML element fragment.
15
+ # @param loading [Symbol] <%= one_of([:lazy, :eager]) %>
16
+ # @param accept [String] What to send as the Accept header.
17
+ # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
18
+ def initialize(src: nil, loading: nil, accept: nil, **system_arguments)
19
+ @system_arguments = system_arguments
20
+ @system_arguments[:tag] = "include-fragment"
21
+ @system_arguments[:loading] = loading
22
+ @system_arguments[:src] = src
23
+ @system_arguments[:accept] = accept if accept
24
+
25
+ if loading
26
+ @system_arguments[:loading] = fetch_or_fallback(ALLOWED_LOADING_VALUES, loading.to_sym, DEFAULT_LOADING)
27
+ end
28
+
29
+ if Primer::CurrentAttributes.nonce
30
+ @system_arguments[:"data-nonce"] = Primer::CurrentAttributes.nonce
31
+ end
32
+ end
33
+
34
+ def call
35
+ render(Primer::BaseComponent.new(**@system_arguments)) { content }
36
+ end
37
+ end
38
+ end
39
+ end
@@ -50,7 +50,7 @@
50
50
  <% end %>
51
51
  <% end %>
52
52
  <% end %>
53
- <%= render Primer::Alpha::Dialog::Body.new(mt: show_filter? ? 0 : 2, p: 0) do %>
53
+ <%= render Primer::Alpha::Dialog::Body.new(p: 0) do %>
54
54
  <focus-group direction="vertical" mnemonics retain>
55
55
  <live-region data-target="select-panel.liveRegion"></live-region>
56
56
  <%= render(Primer::BaseComponent.new(
@@ -62,7 +62,7 @@
62
62
  )) do %>
63
63
  <div id="<%= @body_id %>">
64
64
  <% if @src.present? %>
65
- <%= render(Primer::ConditionalWrapper.new(condition: @fetch_strategy == :eventually_local, tag: "include-fragment", data: { target: "select-panel.includeFragment" }, src: @src, loading: preload? ? "eager" : "lazy", accept: "text/fragment+html")) do %>
65
+ <%= render(Primer::ConditionalWrapper.new(condition: @fetch_strategy == :eventually_local, component: Primer::Alpha::IncludeFragment, data: { target: "select-panel.includeFragment" }, src: @src, loading: preload? ? "eager" : "lazy", accept: "text/fragment+html")) do %>
66
66
  <%= render(Primer::BaseComponent.new(
67
67
  tag: :div,
68
68
  id: "#{@panel_id}-list",
@@ -1,14 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Primer
4
- # Conditionally renders a `Primer::BaseComponent` around the given content. If the given condition
5
- # is true, a `Primer::BaseComponent` will render around the content. If the condition is false, only
4
+ # Conditionally renders a component around the given content. If the given condition
5
+ # is true, the component will render around the content. If the condition is false, only
6
6
  # the content is rendered.
7
7
  class ConditionalWrapper < Primer::Component
8
- # @param condition [Boolean] Whether or not to wrap the content in a `Primer::BaseComponent`.
9
- # @param base_component_arguments [Hash] The arguments to pass to `Primer::BaseComponent`.
10
- def initialize(condition:, **base_component_arguments)
8
+ # @param condition [Boolean] Whether or not to wrap the content in a component.
9
+ # @param component [Class] The component class to use as a wrapper, defaults to `Primer::BaseComponent`
10
+ # @param base_component_arguments [Hash] The arguments to pass to the component.
11
+ def initialize(condition:, component: Primer::BaseComponent, **base_component_arguments)
11
12
  @condition = condition
13
+ @component = component
12
14
  @base_component_arguments = base_component_arguments
13
15
  @trim = !!@base_component_arguments.delete(:trim)
14
16
  end
@@ -18,7 +20,7 @@ module Primer
18
20
  return @trim ? trimmed_content : content
19
21
  end
20
22
 
21
- BaseComponent.new(trim: @trim, **@base_component_arguments).render_in(self) { content }
23
+ @component.new(trim: @trim, **@base_component_arguments).render_in(self) { content }
22
24
  end
23
25
  end
24
26
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Primer
4
+ # `Primer::CurrentAttributes` can be used by controllers to set request-bound data
5
+ # that can be propagated to components.
6
+ class CurrentAttributes < ActiveSupport::CurrentAttributes
7
+ attribute :nonce
8
+ end
9
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+
5
+ module ERBLint
6
+ module Linters
7
+ module ArgumentMappers
8
+ # Maps attributes in the include-fragment element to arguments for the IncludeFragment component.
9
+ class IncludeFragment < Base
10
+ DEFAULT_TAG = "include-fragment"
11
+ ATTRIBUTES = %w[loading src accept role preload tabindex autofocus hidden].freeze
12
+
13
+ def attribute_to_args(attribute)
14
+ attr_name = attribute.name
15
+
16
+ { attr_name.to_sym => erb_helper.convert(attribute) }
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base_linter"
4
+ require_relative "autocorrectable"
5
+ require_relative "argument_mappers/include_fragment"
6
+
7
+ module ERBLint
8
+ module Linters
9
+ # Counts the number of times a HTML include-fragment is used instead of the component.
10
+ class IncludeFragmentComponentMigrationCounter < BaseLinter
11
+ include Autocorrectable
12
+
13
+ TAGS = %w[include-fragment].freeze
14
+ REQUIRED_ARGUMENTS = [].freeze
15
+ MESSAGE = "We are migrating include-fragment to use [Primer::Alpha::IncludeFragment](https://primer.style/view-components/lookbook/inspect/primer/alpha/include_fragment/default), please try to use that instead of raw HTML."
16
+ ARGUMENT_MAPPER = ArgumentMappers::IncludeFragment
17
+ COMPONENT = "Primer::Alpha::IncludeFragment"
18
+ end
19
+ end
20
+ end
@@ -5,7 +5,7 @@ module Primer
5
5
  module ViewComponents
6
6
  module VERSION
7
7
  MAJOR = 0
8
- MINOR = 62
8
+ MINOR = 64
9
9
  PATCH = 0
10
10
 
11
11
  STRING = [MAJOR, MINOR, PATCH].join(".")
@@ -0,0 +1,5 @@
1
+ <%= render(Primer::Alpha::Dialog.new(id: "my-dialog", title: title, subtitle: subtitle, visually_hide_title: false)) do |dialog| %>
2
+ <% dialog.with_header(show_divider: show_divider, close_label: close_label) %>
3
+ <% dialog.with_show_button_content(button_text) %>
4
+ <% dialog.with_body_content("Hello World") %>
5
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <%= render(Primer::Alpha::Dialog.new(id: "my-dialog", title: title, subtitle: subtitle, visually_hide_title: false)) do |dialog| %>
2
+ <% dialog.with_header(show_divider: show_divider, close_scheme: :none) %>
3
+ <% dialog.with_show_button_content(button_text) %>
4
+ <% dialog.with_body_content("Hello World") %>
5
+ <% dialog.with_footer do %>
6
+ <%= render(Primer::Beta::Button.new(data: { "close-dialog-id": "my-dialog" })) { "Close" } %>
7
+ <% end %>
8
+ <% end %>
@@ -302,6 +302,38 @@ module Primer
302
302
  def with_header_filter
303
303
  render_with_template(locals: {})
304
304
  end
305
+
306
+ # @label With custom label for close button of header
307
+ #
308
+ # @param title [String] text
309
+ # @param subtitle [String] text
310
+ # @param button_text [String] text
311
+ # @param show_divider [Boolean] toggle
312
+ # @param close_label [String] text
313
+ def with_header_close_button_label(title: "Test Dialog", subtitle: nil, button_text: "Show Dialog", show_divider: true, close_label: "Close me!")
314
+ render_with_template(locals: {
315
+ title: title,
316
+ subtitle: subtitle,
317
+ button_text: button_text,
318
+ show_divider: show_divider,
319
+ close_label: close_label
320
+ })
321
+ end
322
+
323
+ # @label Without custom label for close button of header
324
+ #
325
+ # @param title [String] text
326
+ # @param subtitle [String] text
327
+ # @param button_text [String] text
328
+ # @param show_divider [Boolean] toggle
329
+ def without_header_close_button_label(title: "Test Dialog", subtitle: nil, button_text: "Show Dialog", show_divider: true)
330
+ render_with_template(locals: {
331
+ title: title,
332
+ subtitle: subtitle,
333
+ button_text: button_text,
334
+ show_divider: show_divider
335
+ })
336
+ end
305
337
  end
306
338
  end
307
339
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Setup Playground to use all available component props
4
+ # Setup Features to use individual component props and combinations
5
+
6
+ module Primer
7
+ module Alpha
8
+ # @label IncludeFragment
9
+ class IncludeFragmentPreview < ViewComponent::Preview
10
+ # @label Playground
11
+ # @param loading select [eager, lazy]
12
+ def playground(loading: :eager)
13
+ render(Primer::Alpha::IncludeFragment.new(loading: loading, src: UrlHelpers.include_fragment_deferred_path)) { "Loading..." }
14
+ end
15
+
16
+ # @label Default options
17
+ def default
18
+ render(Primer::Alpha::IncludeFragment.new(loading: :eager, src: UrlHelpers.include_fragment_deferred_path)) { "Loading..." }
19
+ end
20
+ end
21
+ end
22
+ end
@@ -10,7 +10,7 @@
10
10
  <%= header.with_breadcrumbs(breadcrumb_items) %>
11
11
  <% if with_actions %>
12
12
  <% header.with_action_icon_button(icon: 'pencil', mobile_icon: 'pencil', label: 'Edit') %>
13
- <% header.with_action_menu(menu_arguments: { anchor_align: :end }, button_arguments: { icon: "op-kebab-vertical", "aria-label": "Menu" }) do |menu, button| %>
13
+ <% header.with_action_menu(menu_arguments: { anchor_align: :end }, button_arguments: { icon: "kebab-horizontal", "aria-label": "Menu" }) do |menu, button| %>
14
14
  <% menu.with_item(label: "Subitem 1") do |item| %>
15
15
  <% item.with_leading_visual_icon(icon: :unlock) %>
16
16
  <% end %>
@@ -3,7 +3,7 @@
3
3
 
4
4
  <% component.with_action_component do %>
5
5
  <%= render Primer::Alpha::ActionMenu.new(menu_id: "menu-1") do |menu|
6
- menu.with_show_button(icon: :"op-kebab-vertical", "aria-label": "Menu")
6
+ menu.with_show_button(icon: :"kebab-horizontal", "aria-label": "Menu")
7
7
  menu.with_item(label: "Subitem 1") do |item|
8
8
  item.with_leading_visual_icon(icon: :paste)
9
9
  end
@@ -1070,6 +1070,12 @@
1070
1070
  "default": "`:medium`",
1071
1071
  "description": "One of `:large` or `:medium`."
1072
1072
  },
1073
+ {
1074
+ "name": "close_label",
1075
+ "type": "String",
1076
+ "default": "`Close`",
1077
+ "description": "The aria-label text of the close \"x\" button."
1078
+ },
1073
1079
  {
1074
1080
  "name": "system_arguments",
1075
1081
  "type": "Hash",
@@ -1357,6 +1363,40 @@
1357
1363
  }
1358
1364
  ]
1359
1365
  },
1366
+ {
1367
+ "component": "IncludeFragment",
1368
+ "status": "alpha",
1369
+ "a11y_reviewed": false,
1370
+ "short_name": "IncludeFragment",
1371
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/include_fragment.rb",
1372
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/include_fragment/default/",
1373
+ "parameters": [
1374
+ {
1375
+ "name": "src",
1376
+ "type": "String",
1377
+ "default": "`nil`",
1378
+ "description": "The URL from which to retrieve an HTML element fragment."
1379
+ },
1380
+ {
1381
+ "name": "loading",
1382
+ "type": "Symbol",
1383
+ "default": "`nil`",
1384
+ "description": "One of `:eager` or `:lazy`."
1385
+ },
1386
+ {
1387
+ "name": "accept",
1388
+ "type": "String",
1389
+ "default": "`nil`",
1390
+ "description": "What to send as the Accept header."
1391
+ },
1392
+ {
1393
+ "name": "system_arguments",
1394
+ "type": "Hash",
1395
+ "default": "N/A",
1396
+ "description": "[System arguments](/system-arguments)"
1397
+ }
1398
+ ]
1399
+ },
1360
1400
  {
1361
1401
  "component": "Layout",
1362
1402
  "status": "alpha",
@@ -4949,13 +4989,19 @@
4949
4989
  "name": "condition",
4950
4990
  "type": "Boolean",
4951
4991
  "default": "N/A",
4952
- "description": "Whether or not to wrap the content in a `Primer::BaseComponent`."
4992
+ "description": "Whether or not to wrap the content in a component."
4993
+ },
4994
+ {
4995
+ "name": "component",
4996
+ "type": "Class",
4997
+ "default": "`Primer::BaseComponent`",
4998
+ "description": "The component class to use as a wrapper, defaults to `Primer::BaseComponent`"
4953
4999
  },
4954
5000
  {
4955
5001
  "name": "base_component_arguments",
4956
5002
  "type": "Hash",
4957
5003
  "default": "N/A",
4958
- "description": "The arguments to pass to `Primer::BaseComponent`."
5004
+ "description": "The arguments to pass to the component."
4959
5005
  }
4960
5006
  ]
4961
5007
  },
@@ -30,6 +30,7 @@
30
30
  "Primer::Alpha::HellipButton": "",
31
31
  "Primer::Alpha::HiddenTextExpander": "",
32
32
  "Primer::Alpha::Image": "",
33
+ "Primer::Alpha::IncludeFragment": "",
33
34
  "Primer::Alpha::Layout": "",
34
35
  "Primer::Alpha::Layout::Main": "",
35
36
  "Primer::Alpha::Layout::Sidebar": "",
@@ -323,6 +323,7 @@
323
323
  "GeneratedSlotMethods": "Primer::Alpha::Dialog::Footer::GeneratedSlotMethods"
324
324
  },
325
325
  "Primer::Alpha::Dialog::Header": {
326
+ "DEFAULT_CLOSE_LABEL": "Close",
326
327
  "DEFAULT_VARIANT": "medium",
327
328
  "GeneratedSlotMethods": "Primer::Alpha::Dialog::Header::GeneratedSlotMethods",
328
329
  "VARIANT_MAPPINGS": {
@@ -391,6 +392,14 @@
391
392
  "Primer::Alpha::Image": {
392
393
  "GeneratedSlotMethods": "Primer::Alpha::Image::GeneratedSlotMethods"
393
394
  },
395
+ "Primer::Alpha::IncludeFragment": {
396
+ "ALLOWED_LOADING_VALUES": [
397
+ "lazy",
398
+ "eager"
399
+ ],
400
+ "DEFAULT_LOADING": "eager",
401
+ "GeneratedSlotMethods": "Primer::Alpha::IncludeFragment::GeneratedSlotMethods"
402
+ },
394
403
  "Primer::Alpha::Layout": {
395
404
  "FIRST_IN_SOURCE_DEFAULT": "sidebar",
396
405
  "FIRST_IN_SOURCE_OPTIONS": [
@@ -3646,6 +3646,32 @@
3646
3646
  "color-contrast"
3647
3647
  ]
3648
3648
  }
3649
+ },
3650
+ {
3651
+ "preview_path": "primer/alpha/dialog/with_header_close_button_label",
3652
+ "name": "with_header_close_button_label",
3653
+ "snapshot": "false",
3654
+ "skip_rules": {
3655
+ "wont_fix": [
3656
+ "region"
3657
+ ],
3658
+ "will_fix": [
3659
+ "color-contrast"
3660
+ ]
3661
+ }
3662
+ },
3663
+ {
3664
+ "preview_path": "primer/alpha/dialog/without_header_close_button_label",
3665
+ "name": "without_header_close_button_label",
3666
+ "snapshot": "false",
3667
+ "skip_rules": {
3668
+ "wont_fix": [
3669
+ "region"
3670
+ ],
3671
+ "will_fix": [
3672
+ "color-contrast"
3673
+ ]
3674
+ }
3649
3675
  }
3650
3676
  ],
3651
3677
  "subcomponents": [
@@ -3699,6 +3725,12 @@
3699
3725
  "default": "`:medium`",
3700
3726
  "description": "One of `:large` or `:medium`."
3701
3727
  },
3728
+ {
3729
+ "name": "close_label",
3730
+ "type": "String",
3731
+ "default": "`Close`",
3732
+ "description": "The aria-label text of the close \"x\" button."
3733
+ },
3702
3734
  {
3703
3735
  "name": "system_arguments",
3704
3736
  "type": "Hash",
@@ -4679,6 +4711,83 @@
4679
4711
 
4680
4712
  ]
4681
4713
  },
4714
+ {
4715
+ "fully_qualified_name": "Primer::Alpha::IncludeFragment",
4716
+ "description": "Use `IncludeFragment` to load HTML elements from the server.\nAdd additional usage considerations or best practices that may aid the user to use the component correctly.",
4717
+ "accessibility_docs": "Add any accessibility considerations",
4718
+ "is_form_component": false,
4719
+ "is_published": true,
4720
+ "requires_js": false,
4721
+ "component": "IncludeFragment",
4722
+ "status": "alpha",
4723
+ "a11y_reviewed": false,
4724
+ "short_name": "IncludeFragment",
4725
+ "source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/include_fragment.rb",
4726
+ "lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/include_fragment/default/",
4727
+ "parameters": [
4728
+ {
4729
+ "name": "src",
4730
+ "type": "String",
4731
+ "default": "`nil`",
4732
+ "description": "The URL from which to retrieve an HTML element fragment."
4733
+ },
4734
+ {
4735
+ "name": "loading",
4736
+ "type": "Symbol",
4737
+ "default": "`nil`",
4738
+ "description": "One of `:eager` or `:lazy`."
4739
+ },
4740
+ {
4741
+ "name": "accept",
4742
+ "type": "String",
4743
+ "default": "`nil`",
4744
+ "description": "What to send as the Accept header."
4745
+ },
4746
+ {
4747
+ "name": "system_arguments",
4748
+ "type": "Hash",
4749
+ "default": "N/A",
4750
+ "description": "{{link_to_system_arguments_docs}}"
4751
+ }
4752
+ ],
4753
+ "slots": [
4754
+
4755
+ ],
4756
+ "methods": [
4757
+
4758
+ ],
4759
+ "previews": [
4760
+ {
4761
+ "preview_path": "primer/alpha/include_fragment/playground",
4762
+ "name": "playground",
4763
+ "snapshot": "false",
4764
+ "skip_rules": {
4765
+ "wont_fix": [
4766
+ "region"
4767
+ ],
4768
+ "will_fix": [
4769
+ "color-contrast"
4770
+ ]
4771
+ }
4772
+ },
4773
+ {
4774
+ "preview_path": "primer/alpha/include_fragment/default",
4775
+ "name": "default",
4776
+ "snapshot": "false",
4777
+ "skip_rules": {
4778
+ "wont_fix": [
4779
+ "region"
4780
+ ],
4781
+ "will_fix": [
4782
+ "color-contrast"
4783
+ ]
4784
+ }
4785
+ }
4786
+ ],
4787
+ "subcomponents": [
4788
+
4789
+ ]
4790
+ },
4682
4791
  {
4683
4792
  "fully_qualified_name": "Primer::Alpha::Layout",
4684
4793
  "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.",
@@ -17220,7 +17329,7 @@
17220
17329
  },
17221
17330
  {
17222
17331
  "fully_qualified_name": "Primer::ConditionalWrapper",
17223
- "description": "Conditionally renders a `Primer::BaseComponent` around the given content. If the given condition\nis true, a `Primer::BaseComponent` will render around the content. If the condition is false, only\nthe content is rendered.",
17332
+ "description": "Conditionally renders a component around the given content. If the given condition\nis true, the component will render around the content. If the condition is false, only\nthe content is rendered.",
17224
17333
  "accessibility_docs": null,
17225
17334
  "is_form_component": false,
17226
17335
  "is_published": true,
@@ -17236,13 +17345,19 @@
17236
17345
  "name": "condition",
17237
17346
  "type": "Boolean",
17238
17347
  "default": "N/A",
17239
- "description": "Whether or not to wrap the content in a `Primer::BaseComponent`."
17348
+ "description": "Whether or not to wrap the content in a component."
17349
+ },
17350
+ {
17351
+ "name": "component",
17352
+ "type": "Class",
17353
+ "default": "`Primer::BaseComponent`",
17354
+ "description": "The component class to use as a wrapper, defaults to `Primer::BaseComponent`"
17240
17355
  },
17241
17356
  {
17242
17357
  "name": "base_component_arguments",
17243
17358
  "type": "Hash",
17244
17359
  "default": "N/A",
17245
- "description": "The arguments to pass to `Primer::BaseComponent`."
17360
+ "description": "The arguments to pass to the component."
17246
17361
  }
17247
17362
  ],
17248
17363
  "slots": [
data/static/previews.json CHANGED
@@ -3717,6 +3717,32 @@
3717
3717
  "color-contrast"
3718
3718
  ]
3719
3719
  }
3720
+ },
3721
+ {
3722
+ "preview_path": "primer/alpha/dialog/with_header_close_button_label",
3723
+ "name": "with_header_close_button_label",
3724
+ "snapshot": "false",
3725
+ "skip_rules": {
3726
+ "wont_fix": [
3727
+ "region"
3728
+ ],
3729
+ "will_fix": [
3730
+ "color-contrast"
3731
+ ]
3732
+ }
3733
+ },
3734
+ {
3735
+ "preview_path": "primer/alpha/dialog/without_header_close_button_label",
3736
+ "name": "without_header_close_button_label",
3737
+ "snapshot": "false",
3738
+ "skip_rules": {
3739
+ "wont_fix": [
3740
+ "region"
3741
+ ],
3742
+ "will_fix": [
3743
+ "color-contrast"
3744
+ ]
3745
+ }
3720
3746
  }
3721
3747
  ]
3722
3748
  },
@@ -4682,6 +4708,40 @@
4682
4708
  }
4683
4709
  ]
4684
4710
  },
4711
+ {
4712
+ "name": "include_fragment",
4713
+ "component": "IncludeFragment",
4714
+ "status": "alpha",
4715
+ "lookup_path": "primer/alpha/include_fragment",
4716
+ "examples": [
4717
+ {
4718
+ "preview_path": "primer/alpha/include_fragment/playground",
4719
+ "name": "playground",
4720
+ "snapshot": "false",
4721
+ "skip_rules": {
4722
+ "wont_fix": [
4723
+ "region"
4724
+ ],
4725
+ "will_fix": [
4726
+ "color-contrast"
4727
+ ]
4728
+ }
4729
+ },
4730
+ {
4731
+ "preview_path": "primer/alpha/include_fragment/default",
4732
+ "name": "default",
4733
+ "snapshot": "false",
4734
+ "skip_rules": {
4735
+ "wont_fix": [
4736
+ "region"
4737
+ ],
4738
+ "will_fix": [
4739
+ "color-contrast"
4740
+ ]
4741
+ }
4742
+ }
4743
+ ]
4744
+ },
4685
4745
  {
4686
4746
  "name": "input_group",
4687
4747
  "component": "OpenProject::InputGroup",
data/static/statuses.json CHANGED
@@ -30,6 +30,7 @@
30
30
  "Primer::Alpha::HellipButton": "alpha",
31
31
  "Primer::Alpha::HiddenTextExpander": "alpha",
32
32
  "Primer::Alpha::Image": "alpha",
33
+ "Primer::Alpha::IncludeFragment": "alpha",
33
34
  "Primer::Alpha::Layout": "alpha",
34
35
  "Primer::Alpha::Layout::Main": "alpha",
35
36
  "Primer::Alpha::Layout::Sidebar": "alpha",
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.62.0
4
+ version: 0.64.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: 2025-04-17 00:00:00.000000000 Z
12
+ date: 2025-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionview
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: 19.23.0
48
+ version: 19.25.0
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 19.23.0
55
+ version: 19.25.0
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: view_component
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -209,6 +209,7 @@ files:
209
209
  - app/components/primer/alpha/hellip_button.rb
210
210
  - app/components/primer/alpha/hidden_text_expander.rb
211
211
  - app/components/primer/alpha/image.rb
212
+ - app/components/primer/alpha/include_fragment.rb
212
213
  - app/components/primer/alpha/layout.css
213
214
  - app/components/primer/alpha/layout.css.json
214
215
  - app/components/primer/alpha/layout.css.map
@@ -652,6 +653,7 @@ files:
652
653
  - app/lib/primer/css/layout.css.json
653
654
  - app/lib/primer/css/utilities.css
654
655
  - app/lib/primer/css/utilities.css.json
656
+ - app/lib/primer/current_attributes.rb
655
657
  - app/lib/primer/experimental_render_helpers.rb
656
658
  - app/lib/primer/experimental_slot_helpers.rb
657
659
  - app/lib/primer/fetch_or_fallback_helper.rb
@@ -789,6 +791,7 @@ files:
789
791
  - lib/primer/view_components/linters/argument_mappers/conversion_error.rb
790
792
  - lib/primer/view_components/linters/argument_mappers/flash.rb
791
793
  - lib/primer/view_components/linters/argument_mappers/helpers/erb_block.rb
794
+ - lib/primer/view_components/linters/argument_mappers/include_fragment.rb
792
795
  - lib/primer/view_components/linters/argument_mappers/label.rb
793
796
  - lib/primer/view_components/linters/argument_mappers/system_arguments.rb
794
797
  - lib/primer/view_components/linters/autocorrectable.rb
@@ -807,6 +810,7 @@ files:
807
810
  - lib/primer/view_components/linters/helpers/deprecated_components_helpers.rb
808
811
  - lib/primer/view_components/linters/helpers/rubocop_helpers.rb
809
812
  - lib/primer/view_components/linters/helpers/rule_helpers.rb
813
+ - lib/primer/view_components/linters/include_fragment_component_migration_counter.rb
810
814
  - lib/primer/view_components/linters/label_component_migration_counter.rb
811
815
  - lib/primer/view_components/linters/migrate_deprecated_flash_arguments.rb
812
816
  - lib/primer/view_components/linters/migrations/iconbutton_component.rb
@@ -887,13 +891,16 @@ files:
887
891
  - previews/primer/alpha/dialog_preview/with_footer.html.erb
888
892
  - previews/primer/alpha/dialog_preview/with_form.html.erb
889
893
  - previews/primer/alpha/dialog_preview/with_header.html.erb
894
+ - previews/primer/alpha/dialog_preview/with_header_close_button_label.html.erb
890
895
  - previews/primer/alpha/dialog_preview/with_header_filter.html.erb
891
896
  - previews/primer/alpha/dialog_preview/with_text_input.html.erb
897
+ - previews/primer/alpha/dialog_preview/without_header_close_button_label.html.erb
892
898
  - previews/primer/alpha/dropdown_preview.rb
893
899
  - previews/primer/alpha/form_control_preview.rb
894
900
  - previews/primer/alpha/form_control_preview/playground.html.erb
895
901
  - previews/primer/alpha/hellip_button_preview.rb
896
902
  - previews/primer/alpha/hidden_text_expander_preview.rb
903
+ - previews/primer/alpha/include_fragment_preview.rb
897
904
  - previews/primer/alpha/layout_preview.rb
898
905
  - previews/primer/alpha/menu_preview.rb
899
906
  - previews/primer/alpha/menu_preview/default.html.erb