To add a contextual background color belonging the same family as the transaction state's text color, add the -hasBg class to the element.
Add disabled states to the element with the -isDisabled class. Combined the -isDisabled class to the -hasBg class to have a disabled background variant.
<!-- Paid -->
<div class="sds-transactionState -paid">
<div class="sds-icon sds-icon-checkcircleborder" aria-hidden="true"></div>
<div class="sds-transactionState__text">Comptabilisé</div>
</div>
<!-- Paid Small -->
<div class="sds-transactionState -paid -textHelper">
<div class="sds-icon sds-icon-checkcircleborder" aria-hidden="true"></div>
<div class="sds-transactionState__text">Comptabilisé</div>
</div>
<!-- Processing -->
<div class="sds-transactionState -processing">
<div class="sds-icon sds-icon-inprogress" aria-hidden="true"></div>
<div class="sds-transactionState__text">En cours</div>
</div>
<!-- Processing Small -->
<div class="sds-transactionState -processing -textHelper">
<div class="sds-icon sds-icon-inprogress" aria-hidden="true"></div>
<div class="sds-transactionState__text">En cours</div>
</div>
<!-- Cross Validation -->
<div class="sds-transactionState -crossValidation">
<div class="sds-icon sds-icon-doublesignature" aria-hidden="true"></div>
<div class="sds-transactionState__text">À contre-valider</div>
</div>
<!-- Cross Validation Small -->
<div class="sds-transactionState -crossValidation -textHelper">
<div class="sds-icon sds-icon-doublesignature" aria-hidden="true"></div>
<div class="sds-transactionState__text">À contre-valider</div>
</div>
<!-- Closed -->
<div class="sds-transactionState -closed">
<div class="sds-icon sds-icon-hourglass" aria-hidden="true"></div>
<div class="sds-transactionState__text">Clôturé</div>
</div>
<!-- Closed Small -->
<div class="sds-transactionState -closed -textHelper">
<div class="sds-icon sds-icon-hourglass" aria-hidden="true"></div>
<div class="sds-transactionState__text">Clôturé</div>
</div>
<!-- Actif -->
<div class="sds-transactionState -active">
<div class="sds-icon sds-icon-check" aria-hidden="true"></div>
<div class="sds-transactionState__text">Actif</div>
</div>
<!-- Actif Small -->
<div class="sds-transactionState -active -textHelper">
<div class="sds-icon sds-icon-check" aria-hidden="true"></div>
<div class="sds-transactionState__text">Actif</div>
</div>
<!-- Rejected -->
<div class="sds-transactionState -rejected">
<div class="sds-icon sds-icon-crosscircleborder" aria-hidden="true"></div>
<div class="sds-transactionState__text">Rejeté</div>
</div>
<!-- Rejected Small -->
<div class="sds-transactionState -rejected -textHelper">
<div class="sds-icon sds-icon-crosscircleborder" aria-hidden="true"></div>
<div class="sds-transactionState__text">Rejeté</div>
</div>
<!-- Cancelled -->
<div class="sds-transactionState -cancelled">
<div class="sds-icon sds-icon-minuscircleborder" aria-hidden="true"></div>
<div class="sds-transactionState__text">Annulé</div>
</div>
<!-- Cancelled Small -->
<div class="sds-transactionState -cancelled -textHelper">
<div class="sds-icon sds-icon-minuscircleborder" aria-hidden="true"></div>
<div class="sds-transactionState__text">Annulé</div>
</div>
<!-- Highlight -->
<div class="sds-transactionState -highlight">
<div class="sds-icon sds-icon-turnright" aria-hidden="true"></div>
<div class="sds-transactionState__text">A venir</div>
</div>
<!-- Highlight Small -->
<div class="sds-transactionState -highlight -textHelper">
<div class="sds-icon sds-icon-turnright" aria-hidden="true"></div>
<div class="sds-transactionState__text">A venir</div>
</div>
<!-- Disabled Info Dot -->
<div class="sds-transactionState -isDisabled -hasBg -textHelper">
<div class="sds-icon sds-icon-sign" aria-hidden="true"></div>
<div class="sds-transactionState__text">À valider</div>
<button type="button" class="sds-infoDot -small" data-trigger="focus" data-container="body" data-placement="right" data-toggle="popover" data-content="Vous n’avez pas les droits de signature pour cette transactions à cause de {raison}">
<span class="sds-icon sds-icon-infocirclefill"></span>
<span class="sr-only">Show more info</span>
</button>
</div>
<div class="{{ namespace }}transactionState{% for mod in modifiers %} {{ mod }}{% endfor %}{% for mod in classes %} {{ mod }}{% endfor %}">
<div class="{{ namespace }}icon {{ namespace }}{{ icon }}" aria-hidden="true"></div>
<div class="{{ namespace }}transactionState__text">{{ text }}</div>
{% if infoDot %}
{% render "@info-dot--small",{
"data-placement": "auto",
"title": false,
"text": "Vous n’avez pas les droits de signature pour cette transactions à cause de {raison}"
},true %}
{% endif %}
</div>
/* variables specific to current element */
$element-specific-variables: "";
.#{$namespace}transactionState {
/* Save root element context for easy access if nesting is needed */
$self: &;
/* properties of current element + media queries */
@include spacer-component-inline("sm");
display: inline-flex;
align-items: center;
white-space: nowrap;
/* Pseudo Elements */
&::before {
}
&::after {
}
/*
Include elements that are linked to the current element but have to reside at the root level of the stylesheet
(e.g: keyframes)
*/
@at-root {
}
/* children - write selector in full in comments in order to facilitate search */
// transactionState__text
&__text {
// follows same logic as parent
font-weight: map-deep-get($token-font-weight-map, "semi-bold");
}
/* modifiers */
// transactionState -processing
&.-processing {
// follows same logic as base element
@include custom-prop-fallback("color", "sys-color-text-status-warning-vivid");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-status-warning-10");
}
}
// transactionState -closed
&.-closed {
// follows same logic as base element
@include custom-prop-fallback("color", "sys-color-text-primary-vivid");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-primary-10");
}
}
// transactionState -paid
&.-paid {
// follows same logic as base element
@include custom-prop-fallback("color", "sys-color-text-status-success-contrast");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-status-success-10");
}
}
// transactionState -rejected
&.-rejected {
// follows same logic as base element
@include custom-prop-fallback("color", "sys-color-text-status-danger-vivid");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-status-danger-10");
}
}
// transactionState -cancelled
&.-cancelled {
// follows same logic as base element
@include custom-prop-fallback("color", "sys-color-text-status-danger-vivid");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-status-danger-10");
}
}
&.-crossValidation {
@include custom-prop-fallback("color", "sys-color-text-status-warning-contrast");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-status-warning-10");
}
}
&.-active {
@include custom-prop-fallback("color", "sys-color-text-status-success-vivid");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-status-success-10");
}
}
&.-highlight {
@include custom-prop-fallback("color", "sys-color-text-highlight-vivid");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-highlight-10");
}
}
&.-textHelper {
@extend %textHelper;
.#{$namespace}icon {
&::before {
font-size: 1.25em;
}
}
}
&.-hasBg {
@include spacer-component-inset-horiz-greater("xs", "sm");
border-radius: map-deep-get($token-radius-map, "8");
}
&.-isDisabled {
@include custom-prop-fallback("color", "sys-color-background-neutral-120");
&.-hasBg {
@include custom-prop-fallback("background-color", "sys-color-background-neutral-10");
}
}
/* random parent element */
/*
*
* Syntax : .randomParentElt & {}
*
*/
/* Pseudo Classes */
&:hover {
@media (hover: hover) {
}
}
&:focus {
}
&:active {
}
&:focus,
&:active {
}
}