Unverified Commit e3971428 authored by Alex Pott's avatar Alex Pott
Browse files

task: #3502993 Convert Navigation messages component to SDC

By: plopesc
By: nod_
By: finnsky
By: pdureau
By: smustgrave
By: alexpott
(cherry picked from commit 3b4e8c1c)
parent bcc06f69
Loading
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
# This is so your IDE knows about the syntax for fixes and autocomplete.
$schema: https://git.drupalcode.org/project/drupal/-/raw/HEAD/core/assets/schemas/v1/metadata.schema.json

# The human readable name.
name: Message

# Status can be: "experimental", "stable", "deprecated", "obsolete".
status: experimental

# Schema for the props. We support www.json-schema.org. Learn more about the
# syntax there.
props:
  # Props are always an object with keys. Each key is a variable in your
  # component template.
  type: object

  properties:
    type:
      type: string
      title: Message Type
      default: status
      enum:
        - error
        - status
        - warning
    url:
      type: string
      title: Message URL
      format: iri-reference
    content:
      type: string
      title: Message Content
+4 −1
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@
    z-index: 1;
    display: flex;
    align-items: start;
    cursor: pointer;
    text-align: start;
    -webkit-text-decoration: none;
    text-decoration: none;
@@ -29,6 +28,10 @@
    gap: calc(0.5 * var(--admin-toolbar-rem));
  }

  .toolbar-message[href] {
    cursor: pointer;
  }

  .toolbar-message__icon {
    flex-shrink: 0;
    inline-size: var(--admin-toolbar-space-20);
+4 −1
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@
    z-index: 1;
    display: flex;
    align-items: start;
    cursor: pointer;
    text-align: start;
    text-decoration: none;
    overflow-wrap: break-word;
@@ -21,6 +20,10 @@
    gap: calc(0.5 * var(--admin-toolbar-rem));
  }

  .toolbar-message[href] {
    cursor: pointer;
  }

  .toolbar-message__icon {
    flex-shrink: 0;
    inline-size: var(--admin-toolbar-space-20);
+2 −13
Original line number Diff line number Diff line
{#
/**
 * @file
 * Default theme implementation to display a single message in the navigation toolbar.
 *
 * Available variables:
 * - content: The message to display.
 *
 * @ingroup themeable
 */
#}
{%
  set classes = [
    'toolbar-message',
    'toolbar-message--type--' ~ type,
    'toolbar-message--' ~ type,
  ]
%}

{% if url is not empty %}
{% if url %}
  <a {{ attributes.addClass(classes).setAttribute('href', url).setAttribute('data-drupal-tooltip', content).setAttribute('data-drupal-tooltip-class', 'admin-toolbar__tooltip') }}>
    {{ icon('navigation', type, { class: 'toolbar-message__icon', size: 20 }) }}
    <div class="toolbar-message__label">
+0 −9
Original line number Diff line number Diff line
@@ -41,15 +41,6 @@ internal.navigation-workspaces:
  dependencies:
    - navigation/internal.navigation

internal.navigation-messages:
  # Internal library. Do not depend on it outside core nor add core usage
  # beyond the Navigation module.
  css:
    theme:
      css/components/toolbar-message.css: { }
  dependencies:
    - navigation/internal.navigation

admin-reset-styles:
  css:
    base:
Loading