-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refacto dialog scrollable list
- Loading branch information
Showing
7 changed files
with
94 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ | |
@use "progress"; | ||
@use "radio-card"; | ||
@use "scrollbar"; | ||
@use "scrollable-list"; | ||
@use "stepper"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
@use "../variables" as *; | ||
|
||
$e: ".scrollable-list"; | ||
|
||
#{$ua-id} { | ||
#{$e} { | ||
--#{$ua-prefix}scrollable-list-background-color: var(--#{$ua-prefix}muted-background-color); | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
padding: 1.5rem; | ||
background-color: var(--#{$ua-prefix}scrollable-list-background-color); | ||
border-radius: var(--#{$ua-prefix}border-radius); | ||
|
||
&__header { | ||
display: flex; | ||
gap: 1rem; | ||
align-items: center; | ||
} | ||
|
||
&__count { | ||
flex-shrink: 0; | ||
min-width: 1.25rem; | ||
font-size: 0.875rem; | ||
line-height: 1.125rem; | ||
} | ||
|
||
&__scroll { | ||
--#{$ua-prefix}scrollable-list-height: calc(6lh + (5 * 0.5rem)); | ||
display: flex; | ||
flex-direction: column; | ||
flex-grow: 1; | ||
gap: 0.5rem; | ||
max-height: var(--#{$ua-prefix}scrollable-list-height); | ||
overflow-y: auto; | ||
border-radius: var(--#{$ua-prefix}border-radius); | ||
font-size: 0.875rem; | ||
line-height: 1.25; | ||
} | ||
|
||
&__item { | ||
margin-block-end: 0; | ||
word-break: break-word; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<div class="scrollable-list"> | ||
{% if title is defined and title and not empty %} | ||
<div class="scrollable-list__header"> | ||
<p class="h3">{{ title }}</p> | ||
{% if status is defined and status and not empty %} | ||
<span class="scrollable-list__count badge badge-{{ status }}">{{ items|length }}</span> | ||
{% endif %} | ||
</div> | ||
{% endif %} | ||
|
||
<div class="scrollable-list__scroll"> | ||
{% for item in items %} | ||
<p class="scrollable-list__item"> | ||
{{ item }} | ||
</p> | ||
{% endfor %} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,23 @@ | ||
{% extends "@ModuleAutoUpgrade/components/dialog.html.twig" %} | ||
|
||
{% block dialog_content %} | ||
<p> | ||
{{ description }} | ||
</p> | ||
{% endblock %} | ||
{% set dialogSize = 'lg' %} | ||
|
||
{% block dialog_extra_content %} | ||
{% if missing_files is defined and missing_files|length > 0 %} | ||
{% include "@ModuleAutoUpgrade/components/scrollable-list.html.twig" with { | ||
'title': 'List of files missing'|trans({}), | ||
'items': missing_files, | ||
'status': 'warning', | ||
} %} | ||
{% endif %} | ||
|
||
{% block dialog_extra_content_inner %} | ||
{% if missing_files is defined and missing_files|length > 0 %} | ||
<div class="logs__summary"> | ||
<div class="logs__summary-top"> | ||
<p class="h3">{{ 'List of files missing'|trans({}) }}</p> | ||
<span class="badge badge-warning">{{ missing_files|length }}</span> | ||
</div> | ||
<div class="logs__summary-scroll"> | ||
{% for missing_file in missing_files %} | ||
<div> | ||
{{ missing_file }} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
{% endif %} | ||
{% if altered_files is defined and altered_files|length > 0 %} | ||
<div class="logs__summary"> | ||
<div class="logs__summary-top"> | ||
<p class="h3">{{ 'List of files changed'|trans({}) }}</p> | ||
<span class="badge badge-warning">{{ altered_files|length }}</span> | ||
</div> | ||
<div class="logs__summary-scroll"> | ||
{% for altered_file in altered_files %} | ||
<div> | ||
{{ altered_file }} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
{% endif %} | ||
{% if altered_files is defined and altered_files|length > 0 %} | ||
{% include "@ModuleAutoUpgrade/components/scrollable-list.html.twig" with { | ||
'title': 'List of files changed'|trans({}), | ||
'items': altered_files, | ||
'status': 'warning', | ||
} %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block dialog_footer %}{% endblock %} |