+
{{ heading }}
@@ -147,7 +144,7 @@ export default {
:work-item-type="issue.type"
event-namespace="relatedIssue"
data-testid="related_issuable_content"
- class="gl-mx-n2"
+ class="gl-mx-n3"
@relatedIssueRemoveRequest="$emit('relatedIssueRemoveRequest', $event)"
/>
diff --git a/app/assets/stylesheets/framework/lists.scss b/app/assets/stylesheets/framework/lists.scss
index e9a507ebb6bf65556d88c666ef7df39ab070b182..e84638e969c725d0d665db9e872389e082546837 100644
--- a/app/assets/stylesheets/framework/lists.scss
+++ b/app/assets/stylesheets/framework/lists.scss
@@ -104,7 +104,7 @@ ul.content-list {
padding: 0;
li {
- border-color: $white-normal;
+ border-color: $gray-100;
font-size: $gl-font-size;
color: $gl-text-color;
word-break: break-word;
diff --git a/app/components/pajamas/card_component.html.haml b/app/components/pajamas/card_component.html.haml
index 007229cc69fe9d90005ae0d3269eaacac0ce8863..c5667f72a99e42e6525e96fce6efa570f3dca1c2 100644
--- a/app/components/pajamas/card_component.html.haml
+++ b/app/components/pajamas/card_component.html.haml
@@ -1,9 +1,30 @@
-.gl-card{ @card_options }
- - if header?
+.gl-card{ @card_options, class: variant_class }
+ - if header? || title? || count? || description? || actions?
.gl-card-header{ @header_options }
- = header
+ - if header?
+ = header
+ - if title? || count? || description?
+ .gl-card-title-wrapper
+ - if title?
+ %h3.gl-card-title
+ = title
+ - if count?
+ .gl-card-count
+ = count
+ - if description?
+ .gl-card-description
+ = description
+ - if actions?
+ .gl-card-actions{ @actions_options }
+ = actions
+ - if form?
+ .gl-card-add-form{ @form_options }
+ = form
.gl-card-body{ @body_options }
= body
+ - if empty?
+ .gl-card-empty{ @empty_options }
+ = empty
- if footer?
.gl-card-footer{ @footer_options }
= footer
diff --git a/app/components/pajamas/card_component.rb b/app/components/pajamas/card_component.rb
index bcc71db1c342cf404d1422f27a8d745e18e75aeb..247adac10bd155a4e8eee18db152b58f42dfa937 100644
--- a/app/components/pajamas/card_component.rb
+++ b/app/components/pajamas/card_component.rb
@@ -3,19 +3,69 @@
# Renders a GlCard root element
module Pajamas
class CardComponent < Pajamas::Component
+ # @param [Symbol] variant
# @param [Hash] card_options
# @param [Hash] header_options
+ # @param [Hash] actions_options
# @param [Hash] body_options
+ # @param [Hash] form_options
# @param [Hash] footer_options
- def initialize(card_options: {}, header_options: {}, body_options: {}, footer_options: {})
+ def initialize(
+ variant: :legacy,
+ card_options: {},
+ header_options: {},
+ actions_options: {},
+ body_options: {},
+ form_options: {},
+ footer_options: {}
+ )
+ @variant = @variant = filter_attribute(variant.to_sym, VARIANT_OPTIONS, default: :legacy)
@card_options = card_options
@header_options = header_options
+ @actions_options = actions_options
@body_options = body_options
+ @form_options = form_options
@footer_options = footer_options
end
+ VARIANT_OPTIONS = [:legacy, :default, :list, :simple].freeze
+
+ def variant_class
+ if legacy?
+ 'gl-card--legacy'
+ elsif default?
+ 'gl-card--default'
+ elsif list?
+ 'gl-card--list'
+ elsif simple?
+ 'gl-card--simple'
+ end
+ end
+
renders_one :header
+ renders_one :title
+ renders_one :count
+ renders_one :description
+ renders_one :actions
+ renders_one :form
renders_one :body
+ renders_one :empty
renders_one :footer
+
+ def legacy?
+ @variant == :legacy
+ end
+
+ def default?
+ @variant == :default
+ end
+
+ def list?
+ @variant == :list
+ end
+
+ def simple?
+ @variant == :simple
+ end
end
end
diff --git a/app/views/projects/branches/_panel.html.haml b/app/views/projects/branches/_panel.html.haml
index 8ef7d4354207e1caba2712b9b69b1c2bfa171965..52370d8f86dfa59c8d8adfc7b578f76c184a71ce 100644
--- a/app/views/projects/branches/_panel.html.haml
+++ b/app/views/projects/branches/_panel.html.haml
@@ -7,9 +7,9 @@
- return unless branches.any?
-= render Pajamas::CardComponent.new(card_options: { class: 'gl-new-card' }, header_options: { class: 'gl-new-card-header' }, body_options: { class: 'gl-new-card-body gl-px-0' }, footer_options: { class: 'gl-new-card-footer' }) do |c|
+= render Pajamas::CardComponent.new(variant: :list) do |c|
- c.with_header do
- %h3.gl-new-card-title.h5
+ %h3.gl-new-card-title
= panel_title
- c.with_body do
%ul.content-list.branches-list.all-branches{ data: { qa_selector: 'all_branches_container' } }
diff --git a/app/views/projects/protected_tags/shared/_index.html.haml b/app/views/projects/protected_tags/shared/_index.html.haml
index f71ecc3a7c535a8a0cb54762d2c9476f1eb63487..08e10061076115283d254f1437d03bb73f8f3c39 100644
--- a/app/views/projects/protected_tags/shared/_index.html.haml
+++ b/app/views/projects/protected_tags/shared/_index.html.haml
@@ -14,22 +14,24 @@
= s_("ProtectedTag|By default, protected tags restrict who can modify the tag.")
= link_to s_("ProtectedTag|Learn more."), help_page_path("user/project/protected_tags", anchor: "who-can-modify-a-protected-tag")
- = render Pajamas::CardComponent.new(card_options: { class: 'gl-new-card js-toggle-container' }, header_options: { class: 'gl-new-card-header' }, body_options: { class: 'gl-new-card-body gl-px-0' }) do |c|
- - c.with_header do
- .gl-new-card-title-wrapper
- %h3.gl-new-card-title
- = _('Protected tags')
- .gl-new-card-count
- = sprite_icon('tag', css_class: 'gl-mr-2')
- = @protected_tags_count
- - if can? current_user, :admin_project, @project
- .gl-new-card-actions
- = render Pajamas::ButtonComponent.new(size: :small, button_options: { class: "js-toggle-button js-toggle-content" }) do
- = _('Add tag')
+ = render Pajamas::CardComponent.new(variant: :list, card_options: { class: 'js-toggle-container' }, form_options: { class: 'gl-display-none js-toggle-content' }) do |c|
+ - c.with_title do
+ = _('Protected tags')
+
+ - c.with_count do
+ = sprite_icon('tag', css_class: 'gl-mr-2')
+ = @protected_tags_count
+
+ - if can? current_user, :admin_project, @project
+ - c.with_actions do
+ = render Pajamas::ButtonComponent.new(size: :small, button_options: { class: "js-toggle-button js-toggle-content" }) do
+ = _('Add tag')
+
+ - if can? current_user, :admin_project, @project
+ - c.with_form do
+ %h4.gl-mt-0
+ = _('Protect a tag')
+ = yield :create_protected_tag
+
- c.with_body do
- - if can? current_user, :admin_project, @project
- .gl-new-card-add-form.gl-m-3.gl-mb-4.gl-display-none.js-toggle-content
- %h4.gl-mt-0
- = _('Protect a tag')
- = yield :create_protected_tag
= yield :tag_list
diff --git a/package.json b/package.json
index 5ded636a3ce59e1bc5583c7a73166b5cf771a6e7..bb649e0ff5df3fb5c7b61bc5bb075d05aa369453 100644
--- a/package.json
+++ b/package.json
@@ -59,7 +59,7 @@
"@gitlab/favicon-overlay": "2.0.0",
"@gitlab/fonts": "^1.3.0",
"@gitlab/svgs": "3.59.0",
- "@gitlab/ui": "65.3.1",
+ "@gitlab/ui": "https://gitlab.com/gitlab-org/gitlab-ui/-/jobs/4913807219/artifacts/raw/gitlab-ui.new-card.tgz",
"@gitlab/visual-review-tools": "1.7.3",
"@gitlab/web-ide": "0.0.1-dev-20230807045127",
"@mattiasbuelens/web-streams-adapter": "^0.1.0",
diff --git a/yarn.lock b/yarn.lock
index 4d536a079258f37ab6be02c9bdf8330f2f534e19..d57125b368f86f3654817a8be3a20efff4351d3a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1147,10 +1147,9 @@
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-3.59.0.tgz#21090154aa7987e059264e13182c4c60e6d0d4b3"
integrity sha512-5+FZ0Clwtf2X6oHEEVCwbhqhmnxT8Ds1CGFxHzzWsvQ5Hkdt658BVAicsbvQSU+TuEIhnKOK3BfooyleMUwLlQ==
-"@gitlab/ui@65.3.1":
+"@gitlab/ui@https://gitlab.com/gitlab-org/gitlab-ui/-/jobs/4913807219/artifacts/raw/gitlab-ui.new-card.tgz":
version "65.3.1"
- resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-65.3.1.tgz#5dd995549f32e67f6d286d29cff7445884a351bb"
- integrity sha512-3mGY76IfS7RiAeb9U/j8/7c35lJ3AX0utFQDEWV39ttwylArpNCRuNsjgFaWI7o2RgRhohM0ZBoNKmIm3haJaA==
+ resolved "https://gitlab.com/gitlab-org/gitlab-ui/-/jobs/4913807219/artifacts/raw/gitlab-ui.new-card.tgz#841776c257453f8057e15db0a585a86ebe981ad7"
dependencies:
"@floating-ui/dom" "1.2.9"
bootstrap-vue "2.23.1"