Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MS] Criteria inline #190

Merged
merged 2 commits into from
Feb 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 26 additions & 13 deletions lib/components/ms-input/MsChoosePasswordInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,20 @@
</div>
</div>
<div class="password-criteria">
<h3 class="password-criteria__title title-h5">{{ $msTranslate('lib.components.msChoosePasswordInput.criteria.title') }}</h3>
<p
v-for="[criterionName, criterion] in CRITERIA.entries()"
:key="criterion"
class="password-criteria__item body"
:class="{ matches: PasswordValidation.matchCriteria(password, criterion) }"
>
<ion-icon :icon="PasswordValidation.matchCriteria(password, criterion) ? checkmarkCircle : close" />
{{ $msTranslate(`lib.components.msChoosePasswordInput.criteria.${criterionName}`) }}
</p>
<ion-text class="password-criteria__title title-h5">
{{ $msTranslate('lib.components.msChoosePasswordInput.criteria.title') }}
</ion-text>
<div class="password-criteria-list">
<p
v-for="[criterionName, criterion] in CRITERIA.entries()"
:key="criterion"
class="password-criteria__item body"
:class="{ matches: PasswordValidation.matchCriteria(password, criterion) }"
>
<ion-icon :icon="PasswordValidation.matchCriteria(password, criterion) ? checkmarkCircle : close" />
{{ $msTranslate(`lib.components.msChoosePasswordInput.criteria.${criterionName}`) }}
</p>
</div>
</div>
</div>
</template>
Expand Down Expand Up @@ -169,22 +173,31 @@ function clear(): void {
.password-criteria {
display: flex;
flex-direction: column;
gap: 0.125em;
gap: 1rem;

&__title {
margin-bottom: 0.5em;
color: var(--parsec-color-light-secondary-grey);
}

&-list {
display: flex;
flex-wrap: wrap;
gap: 0.5em;
}

&__item {
display: flex;
align-items: center;
padding: 0 0.5rem;
gap: 0.5em;
background: var(--parsec-color-light-secondary-premiere);
color: var(--parsec-color-light-secondary-hard-grey);
margin: 0.2rem;
margin: 0;
border-radius: var(--parsec-radius-12);

&.matches {
color: var(--parsec-color-light-success-700);
background: var(--parsec-color-light-success-50);
font-weight: 500;
}
}
Expand Down