Skip to content

Commit

Permalink
pkp/pkp-lib#9626 Use svg icons for components that use Icon component
Browse files Browse the repository at this point in the history
  • Loading branch information
blesildaramirez committed Oct 30, 2024
1 parent 0d5df96 commit e0a7a77
Show file tree
Hide file tree
Showing 53 changed files with 281 additions and 350 deletions.
2 changes: 1 addition & 1 deletion src/components/Badge/Badge.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const Comments = {
},
template: `
<Badge v-bind="args" >
<Icon icon="comment-o" :inline="true" />{{args.slot}}
<Icon icon="Comment" class="h-3 w-3 me-1" :inline="true" />{{args.slot}}
</Badge>`,
}),
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/ButtonRow/ButtonRow.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const Default = {
<ButtonRow v-bind="args">
<template #end>
<PkpButton :is-link="true">
<Icon icon="long-arrow-left" :inline="true" />
<Icon icon="ArrowLeft" class="h-4 w-4" :inline="true" />
Back
</PkpButton>
</template>
Expand Down
16 changes: 4 additions & 12 deletions src/components/Composer/Composer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
class="-linkButton composer__templates__moreSearchResults"
@click="showSearchResultCount = searchResults.length"
>
<Icon icon="plus-circle" :inline="true" />
<Icon icon="Add" class="h-3 w-3" :inline="true" />
{{
moreSearchResultsLabel.replace(
'{$number}',
Expand Down Expand Up @@ -241,10 +241,10 @@
/>
{{ attachment.name }}
<button
class="composer__attachment__remove"
class="composer__attachment__remove text-negative hover:text-on-dark"
@click="removeAttachment(i)"
>
<Icon icon="times" />
<Icon icon="Cancel" class="h-3 w-3" />
<span class="-screenReader">
{{ removeItemLabel.replace('{$item}', attachment.name) }}
</span>
Expand Down Expand Up @@ -785,7 +785,7 @@ export default {
!!attachment.documentType &&
!!pkp.documentTypeIcons[attachment.documentType]
? pkp.documentTypeIcons[attachment.documentType]
: 'file-o';
: 'DefaultDocument';
},
/**
Expand Down Expand Up @@ -1157,14 +1157,6 @@ export default {
border-bottom-right-radius: 1.2em;
color: @no;
.fa {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
margin-left: -1px;
}
&:hover,
&:focus {
outline: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Container/ManageEmailsPage.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const ManageEmailsPageWithDataAndTemplate = {
<template #sidebar>
<PkpHeader>
<h2>
<Icon icon="filter" :inline="true" />
<Icon icon="Filter" class="h-4 w-4" :inline="true" />
Filters
</h2>
</PkpHeader>
Expand Down
18 changes: 8 additions & 10 deletions src/components/Container/Page.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {computed} from 'vue';
import Page from './Page.vue';
import Dropdown from '@/components/Dropdown/Dropdown.vue';
import SideNav from '@/components/SideNav/SideNav.vue';
import InitialsAvatar from '@/components/InitialsAvatar/InitialsAvatar.vue';
import PageMock from '@/mocks/page';

export default {
Expand All @@ -11,7 +12,7 @@ export default {

export const Default = {
render: (args) => ({
components: {Page, Dropdown, SideNav},
components: {Page, Dropdown, SideNav, InitialsAvatar},
setup() {
const classes = computed(() => {
let _classes = [];
Expand All @@ -35,7 +36,7 @@ export const Default = {
<header class="app__header" role="banner">
<Dropdown v-if="contexts.length" class="app__headerAction app__contexts">
<template #button>
<Icon icon="sitemap" />
<Icon icon="Sitemap" class="h-7 w-7" />
<span class="-screenReader">Journals</span>
</template>
<ul>
Expand All @@ -53,7 +54,7 @@ export const Default = {
ref="tasksButton"
@click="alert('Opens the tasks grid in a modal')"
>
<Icon icon="bell-o"></Icon>
<Icon icon="Notifications" class="h-7 w-7"></Icon>
<span class="-screenReader">Tasks</span>
<span v-if="unreadTasksCount" class="app__tasksCount">
{{ unreadTasksCount }}
Expand All @@ -62,12 +63,8 @@ export const Default = {
</div>
<Dropdown class="app__headerAction app__userNav">
<template #button>
<Icon icon="user-circle-o" />
<Icon
v-if="isLoggedInAs"
icon="user-circle"
class="app__userNav__isLoggedInAsWarning"
/>
<InitialsAvatar :is-secondary="true" given-name="Test" family-name="User"></InitialsAvatar>
<Icon v-if="isLoggedInAs" icon="User" class="absolute right-2 top-2 text-on-dark bg-negative rounded-full h-5 w-5"></Icon>
<span class="-screenReader">Options for {{ currentUsername }}</span>
</template>
<div v-if="isLoggedInAs" class="pkpDropdown__section">
Expand Down Expand Up @@ -96,7 +93,8 @@ export const Default = {
<a :href="locale.key" class="pkpDropdown__action">
<Icon
v-if="locale.key === 'en'"
icon="check"
icon="Complete"
class="h-5 w-5"
:inline="true"
/>
{{ locale.name }}
Expand Down
10 changes: 0 additions & 10 deletions src/components/Container/Page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -311,16 +311,6 @@ export default {
right: 0.25rem;
}
.app__userNav > .pkpButton > .app__userNav__isLoggedInAsWarning {
position: absolute;
right: 0.5em;
top: 0.5em;
font-size: 1rem;
color: #fff;
background: @primary;
border-radius: 50%;
}
.app__userNav .pkpDropdown__content {
min-width: 13rem;
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/Container/StatsPage.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const EditorialStatsPageWithDataAndTemplate = {
:is-active="isSidebarVisible"
@click="toggleSidebar"
>
<Icon icon="filter" :inline="true" />
<Icon icon="Filter" class="h-4 w-4" :inline="true" />
{{ t('common.filter') }}
</PkpButton>
</template>
Expand Down Expand Up @@ -400,7 +400,7 @@ const PublicationStatsPageWithDataAndTemplate = {
:is-active="isSidebarVisible"
@click="toggleSidebar"
>
<Icon icon="filter" :inline="true" />
<Icon icon="Filter" class="h-4 w-4" :inline="true" />
{{ t('common.filter') }}
</PkpButton>
</template>
Expand All @@ -418,7 +418,7 @@ const PublicationStatsPageWithDataAndTemplate = {
:tabindex="isSidebarVisible ? 0 : -1"
>
<h2>
<Icon icon="filter" :inline="true" />
<Icon icon="Filter" class="h-4 w-4" :inline="true" />
{{ t('common.filter') }}
</h2>
</PkpHeader>
Expand Down
13 changes: 7 additions & 6 deletions src/components/Container/SubmissionWizardPage.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const SubmissionWizardPageWithDataAndTemplate = {
type="warning"
class="submissionWizard__reviewEmptyWarning"
>
<Icon icon="exclamation-triangle" :inline="true"></Icon>
<Icon icon="Error" class="h-5 w-5" :inline="true"></Icon>
{{ error }}
</Notification>
<ul class="submissionWizard__reviewPanel__list">
Expand Down Expand Up @@ -176,14 +176,15 @@ const SubmissionWizardPageWithDataAndTemplate = {
type="warning"
class="submissionWizard__reviewEmptyWarning"
>
<Icon icon="exclamation-triangle" :inline="true"></Icon>
<Icon icon="Error" class="h-5 w-5" :inline="true"></Icon>
No contributors have been added to this submission.
</Notification>
<ul v-else class="submissionWizard__reviewPanel__list">
<li v-for="(error, i) in errors.contributors" :key="i">
<Notification type="warning">
<Icon
icon="exclamation-triangle"
icon="Error"
class="h-5 w-5"
:inline="true"
></Icon>
{{ error }}
Expand Down Expand Up @@ -221,7 +222,7 @@ const SubmissionWizardPageWithDataAndTemplate = {
:key="i"
type="warning"
>
<Icon icon="exclamation-triangle"></Icon>
<Icon icon="Error" class="h-5 w-5"></Icon>
{{ error }}
</Notification>
</template>
Expand All @@ -240,7 +241,7 @@ const SubmissionWizardPageWithDataAndTemplate = {
:key="i"
type="warning"
>
<Icon icon="exclamation-triangle"></Icon>
<Icon icon="Error" class="h-5 w-5"></Icon>
{{ error }}
</Notification>
</template>
Expand All @@ -262,7 +263,7 @@ const SubmissionWizardPageWithDataAndTemplate = {
:key="i"
type="warning"
>
<Icon icon="exclamation-triangle"></Icon>
<Icon icon="Error" class="h-5 w-5"></Icon>
{{ error }}
</Notification>
</template>
Expand Down
40 changes: 12 additions & 28 deletions src/components/DateRange/DateRange.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
@click="toggle"
@blur="closeOnBlur"
>
<Icon icon="calendar" />
<div
class="flex h-8 w-8 items-center justify-center border-e border-e-light border-opacity-40 text-primary"
>
<Icon icon="Calendar" class="h-5 w-5" :inline="true" />
</div>
<span class="-screenReader">
{{ changeDateRangeLabel }}
</span>
Expand Down Expand Up @@ -61,8 +65,11 @@
</label>
</fieldset>
<PkpButton @click="applyCustomRange">{{ applyLabel }}</PkpButton>
<div v-if="errorMessage" class="pkpDateRange__error">
<Icon icon="exclamation-triangle" :inline="true" />
<div
v-if="errorMessage"
class="flex items-center pt-2 text-base-normal"
>
<Icon icon="Error" class="me-1 h-5 w-5" :inline="true" />
<span v-html="errorMessage" />
</div>
</form>
Expand Down Expand Up @@ -452,25 +459,8 @@ export default {
border-color: @primary;
outline: 0;
.fa {
border-inline-end-color: @primary;
}
}
.fa {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 2rem;
border-inline-end: @bg-border-light;
color: @primary;
&:before {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
div {
@apply border-e-primary;
}
}
}
Expand Down Expand Up @@ -558,12 +548,6 @@ export default {
color: @bg-border-color;
}
.pkpDateRange__error {
padding-top: 0.5rem;
font-size: @font-tiny;
line-height: 1.5em;
}
[dir='rtl'] {
.pkpDateRange__button .fa {
left: auto;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dropdown/Dropdown.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const WithSections = {
<ul>
<li>
<a href="#" class="pkpDropdown__action">
<Icon icon="check" :inline="true" />
<Icon icon="Complete" class="h-5 w-5" :inline="true" />
English
</a>
</li>
Expand Down
5 changes: 2 additions & 3 deletions src/components/Expander/Expander.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<button class="expander" @click="$emit('toggle')">
<Icon v-if="isExpanded" icon="angle-up" />
<Icon v-else icon="angle-down" />
<Icon v-if="isExpanded" icon="ChevronUp" class="h-5 w-5" :inline="true" />
<Icon v-else icon="ChevronDown" class="h-5 w-5" :inline="true" />
<span v-if="isExpanded" class="-screenReader">
{{ t('list.viewLess', {name: itemName}) }}
</span>
Expand Down Expand Up @@ -35,7 +35,6 @@ export default {
@import '../../styles/_import';
.expander {
width: 2rem;
padding: 0 0.5em;
background: transparent;
border: @bg-border-light;
Expand Down
2 changes: 1 addition & 1 deletion src/components/FileAttacher/FileAttacherFileStage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<ButtonRow class="fileAttacher__footer">
<template #end>
<PkpButton :is-link="true" @click="$emit('cancel')">
<Icon icon="long-arrow-left" :inline="true" />
<Icon icon="ArrowLeft" class="h-4 w-4" :inline="true" />
{{ backLabel }}
</PkpButton>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/FileAttacher/FileAttacherLibrary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<ButtonRow class="fileAttacher__footer">
<template #end>
<PkpButton :is-link="true" @click="$emit('cancel')">
<Icon icon="long-arrow-left" :inline="true" />
<Icon icon="ArrowLeft" class="h-4 w-4" :inline="true" />
{{ backLabel }}
</PkpButton>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/FileAttacher/FileAttacherReviewFiles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<ButtonRow class="fileAttacher__footer">
<template #end>
<PkpButton :is-link="true" @click="$emit('cancel')">
<Icon icon="long-arrow-left" :inline="true" />
<Icon icon="ArrowLeft" class="h-4 w-4" :inline="true" />
{{ backLabel }}
</PkpButton>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/FileAttacher/FileAttacherUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<ButtonRow class="fileAttacher__footer">
<template #end>
<PkpButton :is-link="true" @click="$emit('cancel')">
<Icon icon="long-arrow-left" :inline="true" />
<Icon icon="ArrowLeft" class="h-4 w-4" :inline="true" />
{{ backLabel }}
</PkpButton>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Filter/Filter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class="pkpFilter__remove"
@click.prevent.stop="remove(param, value)"
>
<Icon icon="times-circle-o" />
<Icon icon="Cancel" class="h-4 w-4 text-negative" />
<span class="-screenReader">
{{ t('common.filterRemove', {filterTitle: title}) }}
</span>
Expand Down
7 changes: 4 additions & 3 deletions src/components/Filter/FilterSlider.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div class="pkpFilter pkpFilter--slider" :class="classes">
<button v-if="isFilterActive" class="pkpFilter__remove" @click="remove">
<Icon icon="times-circle-o" />
<Icon icon="Cancel" class="h-4 w-4 text-negative" />
<span class="-screenReader">
{{ t('common.filterRemove', {filterTitle: title}) }}
</span>
</button>
<button v-else class="pkpFilter__add" @click="enable">
<Icon icon="plus-square-o" />
<Icon icon="Add" class="h-4 w-4" />
<span class="-screenReader">
{{ t('common.filterAdd', {filterTitle: title}) }}
</span>
Expand Down Expand Up @@ -41,7 +41,8 @@
<Icon
v-for="i in 5"
:key="i"
:icon="i <= currentValue ? 'star' : 'star-o'"
:icon="i <= currentValue ? 'StarTicked' : 'Star'"
class="h-4 w-4"
/>
</span>
<template v-else>
Expand Down
Loading

0 comments on commit e0a7a77

Please sign in to comment.