@italia/avatar 0.1.0-alpha.2 → 1.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/custom-elements.json +28 -28
- package/dist/src/it-avatar.d.ts +2 -0
- package/dist/src/it-avatar.d.ts.map +1 -1
- package/dist/src/it-avatar.js +183 -118
- package/dist/src/it-avatar.js.map +1 -1
- package/package.json +8 -6
- package/styles/globals.scss +18 -18
package/dist/src/it-avatar.js
CHANGED
|
@@ -115,7 +115,9 @@ function registerTranslation(...translation) {
|
|
|
115
115
|
});
|
|
116
116
|
update();
|
|
117
117
|
}
|
|
118
|
-
window
|
|
118
|
+
if (typeof window !== 'undefined') {
|
|
119
|
+
window.registerTranslation = registerTranslation;
|
|
120
|
+
}
|
|
119
121
|
/**
|
|
120
122
|
* Localize Reactive Controller for components built with Lit
|
|
121
123
|
*
|
|
@@ -438,6 +440,7 @@ const interactions = new WeakMap();
|
|
|
438
440
|
/** A reactive controller to allow form controls to participate in form submission, validation, etc. */
|
|
439
441
|
class FormControlController {
|
|
440
442
|
constructor(host, options) {
|
|
443
|
+
this.submittedOnce = false;
|
|
441
444
|
this.handleFormData = (event) => {
|
|
442
445
|
// console.log('handleFormData');
|
|
443
446
|
const disabled = this.options.disabled(this.host);
|
|
@@ -459,6 +462,27 @@ class FormControlController {
|
|
|
459
462
|
event.formData.append(name, value);
|
|
460
463
|
}
|
|
461
464
|
break;
|
|
465
|
+
case 'it-checkbox':
|
|
466
|
+
case 'it-toggle':
|
|
467
|
+
if (this.host.checked) {
|
|
468
|
+
if (event.formData.getAll(name).indexOf(value) < 0) {
|
|
469
|
+
// handle group checkbox
|
|
470
|
+
event.formData.append(name, value);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
break;
|
|
474
|
+
case 'it-checkbox-group':
|
|
475
|
+
case 'it-toggle-group':
|
|
476
|
+
// non settare valori in formData, perchè ogni singola checkbox setta il suo valore
|
|
477
|
+
break;
|
|
478
|
+
case 'it-upload':
|
|
479
|
+
// value is File[] — append each File object directly (not as string)
|
|
480
|
+
if (Array.isArray(value)) {
|
|
481
|
+
value.forEach((file) => {
|
|
482
|
+
event.formData.append(name, file);
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
break;
|
|
462
486
|
default:
|
|
463
487
|
if (Array.isArray(value)) {
|
|
464
488
|
value.forEach((val) => {
|
|
@@ -480,13 +504,30 @@ class FormControlController {
|
|
|
480
504
|
this.setUserInteracted(control, true);
|
|
481
505
|
});
|
|
482
506
|
}
|
|
483
|
-
|
|
507
|
+
const resReportValidity = reportValidity(this.host);
|
|
508
|
+
if (this.form && !this.form.noValidate && !disabled && !resReportValidity) {
|
|
484
509
|
event.preventDefault();
|
|
485
510
|
// event.stopImmediatePropagation(); // se lo attiviamo, valida un campo alla volta
|
|
511
|
+
// Scroll al primo controllo non valido
|
|
512
|
+
const formControls = formCollections.get(this.form);
|
|
513
|
+
if (formControls) {
|
|
514
|
+
for (const control of formControls) {
|
|
515
|
+
if (!control.validity?.valid) {
|
|
516
|
+
// Scroll smooth verso il controllo non valido
|
|
517
|
+
control.scrollIntoView({
|
|
518
|
+
behavior: 'smooth',
|
|
519
|
+
block: 'center',
|
|
520
|
+
});
|
|
521
|
+
break;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
486
525
|
}
|
|
526
|
+
this.submittedOnce = true;
|
|
487
527
|
};
|
|
488
528
|
this.handleFormReset = () => {
|
|
489
529
|
this.options.setValue(this.host, '');
|
|
530
|
+
this.submittedOnce = false;
|
|
490
531
|
this.setUserInteracted(this.host, false);
|
|
491
532
|
interactions.set(this.host, []);
|
|
492
533
|
};
|
|
@@ -651,6 +692,7 @@ class FormControlController {
|
|
|
651
692
|
if (!formCollection) {
|
|
652
693
|
return;
|
|
653
694
|
}
|
|
695
|
+
this.submittedOnce = false;
|
|
654
696
|
// Remove this host from the form's collection
|
|
655
697
|
formCollection.delete(this.host);
|
|
656
698
|
// Check to make sure there's no other form controls in the collection. If we do this
|
|
@@ -747,6 +789,10 @@ class FormControlController {
|
|
|
747
789
|
host.toggleAttribute('data-user-invalid', !isValid && hasInteracted);
|
|
748
790
|
host.toggleAttribute('data-user-valid', isValid && hasInteracted);
|
|
749
791
|
}
|
|
792
|
+
userInteracted() {
|
|
793
|
+
const hasInteracted = Boolean(userInteractedControls.has(this.host));
|
|
794
|
+
return hasInteracted;
|
|
795
|
+
}
|
|
750
796
|
/**
|
|
751
797
|
* Updates the form control's validity based on the current value of `host.validity.valid`. Call this when anything
|
|
752
798
|
* that affects constraint validation changes so the component receives the correct validity states.
|
|
@@ -783,6 +829,7 @@ const translation$2 = {
|
|
|
783
829
|
$name: 'Italiano',
|
|
784
830
|
$dir: 'ltr',
|
|
785
831
|
validityRequired: 'Questo campo è obbligatorio.',
|
|
832
|
+
validityGroupRequired: "Scegli almeno un'opzione",
|
|
786
833
|
validityPattern: 'Il valore non corrisponde al formato richiesto.',
|
|
787
834
|
validityMinlength: 'Il valore deve essere lungo almeno {minlength} caratteri.',
|
|
788
835
|
validityMaxlength: 'Il valore deve essere lungo al massimo {maxlength} caratteri.',
|
|
@@ -827,24 +874,27 @@ class FormControl extends BaseLocalizedComponent {
|
|
|
827
874
|
this.maxlength = -1;
|
|
828
875
|
/** If the input is required. */
|
|
829
876
|
this.required = false;
|
|
877
|
+
/* For grouped input, like checkbox-group */
|
|
878
|
+
this.isInGroup = false;
|
|
830
879
|
this.validationMessage = '';
|
|
831
880
|
}
|
|
832
881
|
/** Gets the validity state object */
|
|
833
882
|
get validity() {
|
|
834
883
|
return this.inputElement?.validity;
|
|
835
884
|
}
|
|
885
|
+
/** Gets the associated form, if one exists. */
|
|
886
|
+
getForm() {
|
|
887
|
+
return this.formControlController.getForm();
|
|
888
|
+
}
|
|
836
889
|
// Form validation methods
|
|
837
890
|
checkValidity() {
|
|
838
891
|
const inputValid = this.inputElement?.checkValidity() ?? true; // this.inputElement.checkValidity() è la validazione del browser
|
|
839
892
|
return inputValid;
|
|
840
893
|
}
|
|
841
|
-
/** Gets the associated form, if one exists. */
|
|
842
|
-
getForm() {
|
|
843
|
-
return this.formControlController.getForm();
|
|
844
|
-
}
|
|
845
894
|
/** Checks for validity and shows the browser's validation message if the control is invalid. */
|
|
846
895
|
reportValidity() {
|
|
847
|
-
const ret = this.inputElement.checkValidity();
|
|
896
|
+
// const ret = this.inputElement.checkValidity();
|
|
897
|
+
const ret = this.checkValidity(); // chiama la checkValidity, che se è stata overridata chiama quella
|
|
848
898
|
this.handleValidationMessages();
|
|
849
899
|
return ret; // this.inputElement.reportValidity();
|
|
850
900
|
}
|
|
@@ -889,7 +939,8 @@ class FormControl extends BaseLocalizedComponent {
|
|
|
889
939
|
handleValidationMessages() {
|
|
890
940
|
if (!this.customValidation) {
|
|
891
941
|
const _v = this.inputElement.validity;
|
|
892
|
-
|
|
942
|
+
const isRequiredHandledByGroup = this.isInGroup === true;
|
|
943
|
+
if (_v.valueMissing && !isRequiredHandledByGroup) {
|
|
893
944
|
this.setCustomValidity(this.$t('validityRequired'));
|
|
894
945
|
}
|
|
895
946
|
else if (_v.patternMismatch) {
|
|
@@ -960,7 +1011,7 @@ class FormControl extends BaseLocalizedComponent {
|
|
|
960
1011
|
if (this.customValidation) {
|
|
961
1012
|
this.setCustomValidity(this.validationText ?? '');
|
|
962
1013
|
}
|
|
963
|
-
else {
|
|
1014
|
+
else if (this.formControlController.userInteracted()) {
|
|
964
1015
|
this.formControlController.updateValidity();
|
|
965
1016
|
}
|
|
966
1017
|
}
|
|
@@ -1028,11 +1079,23 @@ __decorate([
|
|
|
1028
1079
|
,
|
|
1029
1080
|
__metadata("design:type", Object)
|
|
1030
1081
|
], FormControl.prototype, "required", void 0);
|
|
1082
|
+
__decorate([
|
|
1083
|
+
property({ type: Boolean }),
|
|
1084
|
+
__metadata("design:type", Object)
|
|
1085
|
+
], FormControl.prototype, "isInGroup", void 0);
|
|
1031
1086
|
__decorate([
|
|
1032
1087
|
state(),
|
|
1033
1088
|
__metadata("design:type", Object)
|
|
1034
1089
|
], FormControl.prototype, "validationMessage", void 0);
|
|
1035
1090
|
|
|
1091
|
+
if (typeof window !== 'undefined') {
|
|
1092
|
+
window._itAnalytics = window._itAnalytics || {};
|
|
1093
|
+
window._itAnalytics = {
|
|
1094
|
+
...window._itAnalytics,
|
|
1095
|
+
version: '1.0.0-alpha.11',
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1036
1099
|
var styles = css`/***************************** 1 ****************************************/
|
|
1037
1100
|
/***************************** 2 ****************************************/
|
|
1038
1101
|
/***************************** 1 ****************************************/
|
|
@@ -1060,80 +1123,83 @@ var styles = css`/***************************** 1 ******************************
|
|
|
1060
1123
|
}
|
|
1061
1124
|
|
|
1062
1125
|
.avatar {
|
|
1063
|
-
--
|
|
1064
|
-
--
|
|
1065
|
-
--
|
|
1066
|
-
--
|
|
1067
|
-
--
|
|
1068
|
-
--
|
|
1069
|
-
--
|
|
1070
|
-
--
|
|
1071
|
-
--
|
|
1072
|
-
--
|
|
1073
|
-
--
|
|
1074
|
-
--
|
|
1075
|
-
--
|
|
1076
|
-
--
|
|
1126
|
+
--bsi-avatar-background: var(--bsi-color-background-secondary-lighter);
|
|
1127
|
+
--bsi-avatar-dot-border-color: var(--bsi-color-border-inverse);
|
|
1128
|
+
--bsi-avatar-dot-border-size: 2px;
|
|
1129
|
+
--bsi-avatar-dot-offset-bottom: 0;
|
|
1130
|
+
--bsi-avatar-dot-offset-right: 0;
|
|
1131
|
+
--bsi-avatar-dot-offset-top: 4px;
|
|
1132
|
+
--bsi-avatar-dot-size: 12px;
|
|
1133
|
+
--bsi-avatar-font-size: var(--bsi-font-size-3);
|
|
1134
|
+
--bsi-avatar-font-weight: var(--bsi-font-weight-solid);
|
|
1135
|
+
--bsi-avatar-icon-size: var(--bsi-icon-size-s);
|
|
1136
|
+
--bsi-avatar-overlay-background: var(--bsi-color-background-emphasis);
|
|
1137
|
+
--bsi-avatar-radius: var(--bsi-radius-circle);
|
|
1138
|
+
--bsi-avatar-size: 2.5rem;
|
|
1139
|
+
--bsi-avatar-text-color: var(--bsi-color-text-secondary);
|
|
1140
|
+
--bsi-avatar-dropdown-margin-left: -24px;
|
|
1141
|
+
--bsi-avatar-dropdown-margin-top: 24px;
|
|
1077
1142
|
}
|
|
1078
1143
|
|
|
1144
|
+
/* stylelint-disable-next-line no-duplicate-selectors */
|
|
1079
1145
|
.avatar {
|
|
1080
1146
|
position: relative;
|
|
1081
1147
|
z-index: 1;
|
|
1082
1148
|
display: inline-flex;
|
|
1083
1149
|
align-items: center;
|
|
1084
1150
|
justify-content: center;
|
|
1085
|
-
width: var(--
|
|
1086
|
-
height: var(--
|
|
1087
|
-
border-radius: var(--
|
|
1088
|
-
background: var(--
|
|
1089
|
-
color: var(--
|
|
1090
|
-
transition: background-color var(--
|
|
1151
|
+
width: var(--bsi-avatar-size);
|
|
1152
|
+
height: var(--bsi-avatar-size);
|
|
1153
|
+
border-radius: var(--bsi-avatar-radius);
|
|
1154
|
+
background: var(--bsi-avatar-background);
|
|
1155
|
+
color: var(--bsi-avatar-text-color);
|
|
1156
|
+
transition: background-color var(--bsi-transition-instant);
|
|
1091
1157
|
}
|
|
1092
1158
|
.avatar.avatar-primary {
|
|
1093
|
-
--
|
|
1094
|
-
--
|
|
1159
|
+
--bsi-avatar-background: var(--bsi-theme-primary);
|
|
1160
|
+
--bsi-avatar-text-color: var(--bsi-color-text-inverse);
|
|
1095
1161
|
}
|
|
1096
1162
|
.avatar.avatar-secondary {
|
|
1097
|
-
--
|
|
1098
|
-
--
|
|
1163
|
+
--bsi-avatar-background: var(--bsi-color-background-secondary);
|
|
1164
|
+
--bsi-avatar-text-color: var(--bsi-color-text-inverse);
|
|
1099
1165
|
}
|
|
1100
1166
|
.avatar.size-xs {
|
|
1101
|
-
--
|
|
1102
|
-
--
|
|
1103
|
-
--
|
|
1104
|
-
--
|
|
1167
|
+
--bsi-avatar-dot-border-size: 1px;
|
|
1168
|
+
--bsi-avatar-font-size: 0.625rem;
|
|
1169
|
+
--bsi-avatar-size: 1rem;
|
|
1170
|
+
--bsi-avatar-icon-size: 0.625rem;
|
|
1105
1171
|
}
|
|
1106
1172
|
.avatar.size-sm {
|
|
1107
|
-
--
|
|
1108
|
-
--
|
|
1109
|
-
--
|
|
1110
|
-
--
|
|
1173
|
+
--bsi-avatar-dot-border-size: 1px;
|
|
1174
|
+
--bsi-avatar-font-size: var(--bsi-font-size-1);
|
|
1175
|
+
--bsi-avatar-size: 1.5rem;
|
|
1176
|
+
--bsi-avatar-icon-size: var(--bsi-icon-size-xs);
|
|
1111
1177
|
}
|
|
1112
1178
|
.avatar.size-md {
|
|
1113
|
-
--
|
|
1114
|
-
--
|
|
1115
|
-
--
|
|
1116
|
-
--
|
|
1179
|
+
--bsi-avatar-font-size: var(--bsi-font-size-4);
|
|
1180
|
+
--bsi-avatar-size: 2.5rem;
|
|
1181
|
+
--bsi-avatar-icon-size: var(--bsi-icon-size-s);
|
|
1182
|
+
--bsi-avatar-dot-offset-right: -2px;
|
|
1117
1183
|
}
|
|
1118
1184
|
.avatar.size-lg {
|
|
1119
|
-
--
|
|
1120
|
-
--
|
|
1121
|
-
--
|
|
1122
|
-
--
|
|
1123
|
-
--
|
|
1185
|
+
--bsi-avatar-font-size: var(--bsi-font-size-6);
|
|
1186
|
+
--bsi-avatar-size: 3.5rem;
|
|
1187
|
+
--bsi-avatar-icon-size: var(--bsi-icon-size-m);
|
|
1188
|
+
--bsi-avatar-dot-offset-right: -2px;
|
|
1189
|
+
--bsi-avatar-dot-size: 14px;
|
|
1124
1190
|
}
|
|
1125
1191
|
.avatar.size-xl {
|
|
1126
|
-
--
|
|
1127
|
-
--
|
|
1128
|
-
--
|
|
1129
|
-
--
|
|
1192
|
+
--bsi-avatar-font-size: var(--bsi-font-size-9);
|
|
1193
|
+
--bsi-avatar-size: 5rem;
|
|
1194
|
+
--bsi-avatar-icon-size: var(--bsi-icon-size-l);
|
|
1195
|
+
--bsi-avatar-dot-size: 16px;
|
|
1130
1196
|
}
|
|
1131
1197
|
.avatar.size-xxl {
|
|
1132
|
-
--
|
|
1133
|
-
--
|
|
1134
|
-
--
|
|
1135
|
-
--
|
|
1136
|
-
--
|
|
1198
|
+
--bsi-avatar-font-size: var(--bsi-font-size-11);
|
|
1199
|
+
--bsi-avatar-size: 7rem;
|
|
1200
|
+
--bsi-avatar-icon-size: var(--bsi-icon-size-xl);
|
|
1201
|
+
--bsi-avatar-dot-size: 20px;
|
|
1202
|
+
--bsi-avatar-dot-offset-right: 4px;
|
|
1137
1203
|
}
|
|
1138
1204
|
.avatar-wrapper {
|
|
1139
1205
|
position: relative;
|
|
@@ -1141,24 +1207,24 @@ var styles = css`/***************************** 1 ******************************
|
|
|
1141
1207
|
}
|
|
1142
1208
|
.avatar-presence, .avatar-status {
|
|
1143
1209
|
position: absolute;
|
|
1144
|
-
right: var(--
|
|
1210
|
+
right: var(--bsi-avatar-dot-offset-right);
|
|
1145
1211
|
z-index: 10;
|
|
1146
1212
|
display: flex;
|
|
1147
1213
|
align-items: center;
|
|
1148
1214
|
justify-content: center;
|
|
1149
|
-
width: var(--
|
|
1150
|
-
height: var(--
|
|
1151
|
-
border: var(--
|
|
1152
|
-
border-radius: var(--
|
|
1215
|
+
width: var(--bsi-avatar-dot-size);
|
|
1216
|
+
height: var(--bsi-avatar-dot-size);
|
|
1217
|
+
border: var(--bsi-avatar-dot-border-size) solid var(--bsi-avatar-dot-border-color);
|
|
1218
|
+
border-radius: var(--bsi-avatar-radius);
|
|
1153
1219
|
background: hsl(210, 3%, 85%);
|
|
1154
|
-
color: var(--
|
|
1220
|
+
color: var(--bsi-color-text-inverse);
|
|
1155
1221
|
}
|
|
1156
1222
|
.avatar-presence .icon, .avatar-status .icon {
|
|
1157
1223
|
stroke-width: 2px;
|
|
1158
|
-
stroke: var(--
|
|
1224
|
+
stroke: var(--bsi-icon-inverse);
|
|
1159
1225
|
}
|
|
1160
1226
|
.avatar-presence.active, .avatar-status.approved {
|
|
1161
|
-
background: var(--
|
|
1227
|
+
background: var(--bsi-color-background-success);
|
|
1162
1228
|
}
|
|
1163
1229
|
.avatar-presence.busy, .avatar-status.declined {
|
|
1164
1230
|
background: hsl(350, 60%, 50%);
|
|
@@ -1174,35 +1240,35 @@ var styles = css`/***************************** 1 ******************************
|
|
|
1174
1240
|
width: calc(100% - 4px);
|
|
1175
1241
|
height: calc(100% - 4px);
|
|
1176
1242
|
border-radius: 50%;
|
|
1177
|
-
background: var(--
|
|
1243
|
+
background: var(--bsi-color-background-inverse);
|
|
1178
1244
|
transform: translateX(-50%) translateY(-50%);
|
|
1179
1245
|
}
|
|
1180
1246
|
.avatar-status {
|
|
1181
|
-
top: var(--
|
|
1247
|
+
top: var(--bsi-avatar-dot-offset-top);
|
|
1182
1248
|
}
|
|
1183
1249
|
.avatar-status.notify {
|
|
1184
|
-
background: var(--
|
|
1250
|
+
background: var(--bsi-theme-primary);
|
|
1185
1251
|
}
|
|
1186
1252
|
.avatar img {
|
|
1187
1253
|
width: 100%;
|
|
1188
1254
|
height: 100%;
|
|
1189
|
-
border-radius: var(--
|
|
1255
|
+
border-radius: var(--bsi-avatar-radius);
|
|
1190
1256
|
object-fit: cover;
|
|
1191
1257
|
object-position: center;
|
|
1192
1258
|
}
|
|
1193
1259
|
.avatar p {
|
|
1194
1260
|
margin: 0;
|
|
1195
|
-
color: var(--
|
|
1196
|
-
font-size: var(--
|
|
1197
|
-
font-weight: var(--
|
|
1261
|
+
color: var(--bsi-avatar-text-color);
|
|
1262
|
+
font-size: var(--bsi-avatar-font-size);
|
|
1263
|
+
font-weight: var(--bsi-avatar-font-weight);
|
|
1198
1264
|
line-height: 1;
|
|
1199
1265
|
}
|
|
1200
1266
|
.avatar .icon {
|
|
1201
|
-
width: var(--
|
|
1202
|
-
height: var(--
|
|
1267
|
+
width: var(--bsi-avatar-icon-size);
|
|
1268
|
+
height: var(--bsi-avatar-icon-size);
|
|
1203
1269
|
}
|
|
1204
1270
|
.avatar ~ span {
|
|
1205
|
-
margin-left: var(--
|
|
1271
|
+
margin-left: var(--bsi-spacing-xxs);
|
|
1206
1272
|
}
|
|
1207
1273
|
|
|
1208
1274
|
a.avatar::after,
|
|
@@ -1215,9 +1281,9 @@ a .avatar::after {
|
|
|
1215
1281
|
display: block;
|
|
1216
1282
|
width: 100%;
|
|
1217
1283
|
height: 100%;
|
|
1218
|
-
border-radius: var(--
|
|
1284
|
+
border-radius: var(--bsi-avatar-radius);
|
|
1219
1285
|
opacity: 0;
|
|
1220
|
-
background: var(--
|
|
1286
|
+
background: var(--bsi-color-background-emphasis);
|
|
1221
1287
|
transition: opacity 0.2s;
|
|
1222
1288
|
}
|
|
1223
1289
|
a.avatar:hover::after,
|
|
@@ -1249,21 +1315,18 @@ a .avatar:hover p {
|
|
|
1249
1315
|
border: 0;
|
|
1250
1316
|
}
|
|
1251
1317
|
.avatar-dropdown .dropdown-menu {
|
|
1252
|
-
margin-left: -
|
|
1318
|
+
margin-left: var(--bsi-avatar-dropdown-margin-left) !important;
|
|
1319
|
+
margin-top: var(--bsi-avatar-dropdown-margin-top) !important;
|
|
1253
1320
|
}
|
|
1254
1321
|
.avatar-dropdown .btn-dropdown {
|
|
1255
1322
|
padding: 0;
|
|
1256
1323
|
color: inherit;
|
|
1257
|
-
font-size: var(--
|
|
1324
|
+
font-size: var(--bsi-avatar-font-size);
|
|
1258
1325
|
line-height: 0;
|
|
1259
1326
|
}
|
|
1260
1327
|
.avatar-dropdown .btn-dropdown:focus {
|
|
1261
1328
|
box-shadow: none;
|
|
1262
1329
|
}
|
|
1263
|
-
.avatar-dropdown .list-item {
|
|
1264
|
-
display: flex;
|
|
1265
|
-
align-items: center;
|
|
1266
|
-
}
|
|
1267
1330
|
.avatar-dropdown .link-list {
|
|
1268
1331
|
white-space: nowrap;
|
|
1269
1332
|
}
|
|
@@ -1278,13 +1341,13 @@ a .avatar:hover p {
|
|
|
1278
1341
|
flex-shrink: 0;
|
|
1279
1342
|
}
|
|
1280
1343
|
.avatar-extra-text .extra-text, .avatar-extra-text slot[name=extra-text]::slotted(*) {
|
|
1281
|
-
margin-left: var(--
|
|
1344
|
+
margin-left: var(--bsi-spacing-s);
|
|
1282
1345
|
}
|
|
1283
1346
|
.avatar-extra-text .extra-text h3, .avatar-extra-text slot[name=extra-text]::slotted(*) h3,
|
|
1284
1347
|
.avatar-extra-text .extra-text h4,
|
|
1285
1348
|
.avatar-extra-text slot[name=extra-text]::slotted(*) h4 {
|
|
1286
1349
|
margin: 0;
|
|
1287
|
-
font-size: var(--
|
|
1350
|
+
font-size: var(--bsi-heading-6-font-size);
|
|
1288
1351
|
}
|
|
1289
1352
|
.avatar-extra-text .extra-text h3 a, .avatar-extra-text slot[name=extra-text]::slotted(*) h3 a,
|
|
1290
1353
|
.avatar-extra-text .extra-text h4 a,
|
|
@@ -1295,21 +1358,19 @@ a .avatar:hover p {
|
|
|
1295
1358
|
.avatar-extra-text .extra-text time,
|
|
1296
1359
|
.avatar-extra-text slot[name=extra-text]::slotted(*) time {
|
|
1297
1360
|
margin: 0;
|
|
1298
|
-
color: var(--
|
|
1299
|
-
font-size: var(--
|
|
1361
|
+
color: var(--bsi-color-text-secondary);
|
|
1362
|
+
font-size: var(--bsi-caption-font-size);
|
|
1300
1363
|
text-transform: uppercase;
|
|
1301
1364
|
}
|
|
1302
1365
|
|
|
1303
1366
|
.avatar-group > li {
|
|
1304
|
-
margin-bottom: var(--
|
|
1305
|
-
|
|
1367
|
+
margin-bottom: var(--bsi-spacing-s);
|
|
1368
|
+
display: flex;
|
|
1306
1369
|
}
|
|
1307
1370
|
.avatar-group > li:last-child {
|
|
1308
1371
|
margin-bottom: 0;
|
|
1309
1372
|
}
|
|
1310
1373
|
.avatar-group > li .list-item {
|
|
1311
|
-
display: inline-flex;
|
|
1312
|
-
align-items: center;
|
|
1313
1374
|
padding: 0;
|
|
1314
1375
|
}
|
|
1315
1376
|
|
|
@@ -1327,24 +1388,24 @@ a .avatar:hover p {
|
|
|
1327
1388
|
}
|
|
1328
1389
|
.avatar-group-stacked li > .avatar {
|
|
1329
1390
|
margin-left: -6px;
|
|
1330
|
-
border: 2px solid var(--
|
|
1391
|
+
border: 2px solid var(--bsi-color-border-inverse);
|
|
1331
1392
|
}
|
|
1332
1393
|
|
|
1333
1394
|
:host {
|
|
1334
1395
|
display: inline-flex;
|
|
1335
|
-
--
|
|
1336
|
-
--
|
|
1337
|
-
--
|
|
1338
|
-
--
|
|
1339
|
-
--
|
|
1340
|
-
--
|
|
1341
|
-
--
|
|
1342
|
-
--
|
|
1343
|
-
--
|
|
1344
|
-
--
|
|
1345
|
-
--
|
|
1346
|
-
--
|
|
1347
|
-
--
|
|
1396
|
+
--bsi-avatar-background: var(--bsi-color-background-secondary-lighter);
|
|
1397
|
+
--bsi-avatar-text-color: var(--bsi-color-text-secondary);
|
|
1398
|
+
--bsi-avatar-font-size: var(--bsi-font-size-3);
|
|
1399
|
+
--bsi-avatar-font-weight: var(--bsi-font-weight-solid);
|
|
1400
|
+
--bsi-avatar-icon-size: var(--bsi-icon-size-s);
|
|
1401
|
+
--bsi-avatar-radius: var(--bsi-radius-circle);
|
|
1402
|
+
--bsi-avatar-size: 2.5rem;
|
|
1403
|
+
--bsi-avatar-dot-size: 12px;
|
|
1404
|
+
--bsi-avatar-dot-border-size: 2px;
|
|
1405
|
+
--bsi-avatar-dot-border-color: var(--bsi-color-border-inverse);
|
|
1406
|
+
--bsi-avatar-dot-offset-right: 0;
|
|
1407
|
+
--bsi-avatar-dot-offset-top: 4px;
|
|
1408
|
+
--bsi-avatar-dot-offset-bottom: 0;
|
|
1348
1409
|
}
|
|
1349
1410
|
:host a.avatar,
|
|
1350
1411
|
:host a .avatar {
|
|
@@ -1355,9 +1416,14 @@ a .avatar:hover p {
|
|
|
1355
1416
|
text-decoration: none;
|
|
1356
1417
|
}
|
|
1357
1418
|
|
|
1419
|
+
:host([type=text]) {
|
|
1420
|
+
cursor: default;
|
|
1421
|
+
pointer-events: none;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1358
1424
|
it-icon::part(icon) {
|
|
1359
|
-
width: var(--
|
|
1360
|
-
height: var(--
|
|
1425
|
+
width: var(--bsi-avatar-icon-size);
|
|
1426
|
+
height: var(--bsi-avatar-icon-size);
|
|
1361
1427
|
}
|
|
1362
1428
|
|
|
1363
1429
|
it-icon {
|
|
@@ -1368,18 +1434,18 @@ it-icon.presence-icon::part(icon),
|
|
|
1368
1434
|
it-icon.status-icon::part(icon) {
|
|
1369
1435
|
width: 12px;
|
|
1370
1436
|
height: 12px;
|
|
1371
|
-
stroke: var(--
|
|
1437
|
+
stroke: var(--bsi-icon-inverse);
|
|
1372
1438
|
stroke-width: 2px;
|
|
1373
1439
|
}
|
|
1374
1440
|
|
|
1375
1441
|
.extra-text, slot[name=extra-text]::slotted(*) {
|
|
1376
|
-
margin-left: var(--
|
|
1442
|
+
margin-left: var(--bsi-spacing-s);
|
|
1377
1443
|
}
|
|
1378
1444
|
.extra-text h3, slot[name=extra-text]::slotted(*) h3,
|
|
1379
1445
|
.extra-text h4,
|
|
1380
1446
|
slot[name=extra-text]::slotted(*) h4 {
|
|
1381
1447
|
margin: 0;
|
|
1382
|
-
font-size: var(--
|
|
1448
|
+
font-size: var(--bsi-heading-6-font-size) !important;
|
|
1383
1449
|
}
|
|
1384
1450
|
.extra-text h3 a, slot[name=extra-text]::slotted(*) h3 a,
|
|
1385
1451
|
.extra-text h4 a,
|
|
@@ -1390,8 +1456,8 @@ slot[name=extra-text]::slotted(*) h4 a {
|
|
|
1390
1456
|
.extra-text time,
|
|
1391
1457
|
slot[name=extra-text]::slotted(*) time {
|
|
1392
1458
|
margin: 0;
|
|
1393
|
-
color: var(--
|
|
1394
|
-
font-size: var(--
|
|
1459
|
+
color: var(--bsi-color-text-secondary);
|
|
1460
|
+
font-size: var(--bsi-caption-font-size);
|
|
1395
1461
|
text-transform: uppercase;
|
|
1396
1462
|
}
|
|
1397
1463
|
|
|
@@ -1634,16 +1700,15 @@ let ItAvatar = class ItAvatar extends BaseLocalizedComponent {
|
|
|
1634
1700
|
return nothing;
|
|
1635
1701
|
return html `
|
|
1636
1702
|
<p aria-hidden="true">${initials}</p>
|
|
1637
|
-
${this.
|
|
1703
|
+
${this.avatarTitle ? html `<span class="visually-hidden">${this.avatarTitle}</span>` : nothing}
|
|
1638
1704
|
`;
|
|
1639
1705
|
}
|
|
1640
1706
|
renderIcon() {
|
|
1641
1707
|
if (!this.icon)
|
|
1642
1708
|
return nothing;
|
|
1643
|
-
const accessibleText = this.avatarTitle || this.text || this.alt || 'Icona';
|
|
1644
1709
|
return html `
|
|
1645
|
-
<it-icon name="${this.icon}"
|
|
1646
|
-
|
|
1710
|
+
<it-icon name="${this.icon}"></it-icon>
|
|
1711
|
+
${this.avatarTitle ? html `<span class="visually-hidden">${this.avatarTitle}</span>` : nothing}
|
|
1647
1712
|
`;
|
|
1648
1713
|
}
|
|
1649
1714
|
renderAvatarContent() {
|