@lamenna/lxp-angular 0.1.0 → 0.3.0

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.
@@ -2,7 +2,7 @@ import * as i1 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
4
  import { EventEmitter, HostBinding, Output, Input, Component, Injectable } from '@angular/core';
5
- import { buttonConfig, tableThemeConfig, tableConfig, defaultTheme } from '@lamenna/lxp-shared-components';
5
+ import { buttonConfig, tableThemeConfig, tableConfig, defaultTheme, badgeConfig, textFieldConfig, chipConfig, toggleConfig, radioConfig, avatarConfig, cardConfig, segmentedControlConfig, quantityStepperConfig } from '@lamenna/lxp-shared-components';
6
6
  import * as i2 from '@angular/forms';
7
7
  import { FormsModule } from '@angular/forms';
8
8
  import { BehaviorSubject } from 'rxjs';
@@ -759,9 +759,883 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
759
759
  type: Input
760
760
  }] } });
761
761
 
762
+ class BadgeComponent {
763
+ content;
764
+ label;
765
+ variant = "neutral";
766
+ dot = false;
767
+ id;
768
+ className;
769
+ testID;
770
+ get text() {
771
+ return this.content ?? this.label;
772
+ }
773
+ get v() {
774
+ return badgeConfig.variants[this.variant];
775
+ }
776
+ get containerStyles() {
777
+ const c = badgeConfig.common;
778
+ return {
779
+ display: "inline-flex",
780
+ "align-items": "center",
781
+ gap: `${c.gap}px`,
782
+ "background-color": this.v.backgroundColor,
783
+ color: this.v.color,
784
+ "border-radius": c.borderRadius,
785
+ "font-size": c.fontSize,
786
+ "font-weight": `${c.fontWeight}`,
787
+ padding: `${c.paddingVertical} ${c.paddingHorizontal}`,
788
+ "line-height": "1",
789
+ };
790
+ }
791
+ get dotStyles() {
792
+ const c = badgeConfig.common;
793
+ return {
794
+ width: `${c.dotSize}px`,
795
+ height: `${c.dotSize}px`,
796
+ "border-radius": "50%",
797
+ "background-color": this.v.color,
798
+ display: "inline-block",
799
+ };
800
+ }
801
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
802
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: BadgeComponent, isStandalone: true, selector: "lxp-badge", inputs: { content: "content", label: "label", variant: "variant", dot: "dot", id: "id", className: "className", testID: "testID" }, ngImport: i0, template: `
803
+ <span
804
+ [attr.id]="id"
805
+ [attr.data-testid]="testID"
806
+ [ngStyle]="containerStyles"
807
+ >
808
+ <span *ngIf="dot" [ngStyle]="dotStyles"></span>
809
+ {{ text }}
810
+ </span>
811
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
812
+ }
813
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BadgeComponent, decorators: [{
814
+ type: Component,
815
+ args: [{
816
+ selector: "lxp-badge",
817
+ standalone: true,
818
+ imports: [CommonModule],
819
+ template: `
820
+ <span
821
+ [attr.id]="id"
822
+ [attr.data-testid]="testID"
823
+ [ngStyle]="containerStyles"
824
+ >
825
+ <span *ngIf="dot" [ngStyle]="dotStyles"></span>
826
+ {{ text }}
827
+ </span>
828
+ `,
829
+ }]
830
+ }], propDecorators: { content: [{
831
+ type: Input
832
+ }], label: [{
833
+ type: Input
834
+ }], variant: [{
835
+ type: Input
836
+ }], dot: [{
837
+ type: Input
838
+ }], id: [{
839
+ type: Input
840
+ }], className: [{
841
+ type: Input
842
+ }], testID: [{
843
+ type: Input
844
+ }] } });
845
+
846
+ class TextFieldComponent {
847
+ label;
848
+ value;
849
+ placeholder;
850
+ helperText;
851
+ error;
852
+ disabled = false;
853
+ id;
854
+ className;
855
+ testID;
856
+ type = "text";
857
+ valueChange = new EventEmitter();
858
+ focused = false;
859
+ onInput(e) {
860
+ const val = e.target.value;
861
+ this.value = val;
862
+ this.valueChange.emit(val);
863
+ }
864
+ get state() {
865
+ return this.disabled
866
+ ? "disabled"
867
+ : this.error
868
+ ? "error"
869
+ : this.focused
870
+ ? "focused"
871
+ : "default";
872
+ }
873
+ get s() {
874
+ return textFieldConfig.states[this.state];
875
+ }
876
+ get c() {
877
+ return textFieldConfig.common;
878
+ }
879
+ get wrapperStyles() {
880
+ return { display: "flex", "flex-direction": "column", gap: this.c.gap };
881
+ }
882
+ get labelStyles() {
883
+ return {
884
+ "font-size": "13px",
885
+ "font-weight": "500",
886
+ color: this.c.labelColor,
887
+ };
888
+ }
889
+ get inputStyles() {
890
+ const s = this.s;
891
+ const c = this.c;
892
+ return {
893
+ "box-sizing": "border-box",
894
+ width: "100%",
895
+ border: `${s.borderWidth}px solid ${s.borderColor}`,
896
+ "background-color": s.backgroundColor,
897
+ "border-radius": c.borderRadius,
898
+ padding: `${c.paddingVertical} ${c.paddingHorizontal}`,
899
+ "font-size": c.fontSize,
900
+ color: c.textColor,
901
+ outline: "none",
902
+ };
903
+ }
904
+ get helperStyles() {
905
+ return {
906
+ "font-size": "12px",
907
+ color: this.error ? this.c.errorColor : this.c.helperColor,
908
+ };
909
+ }
910
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TextFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
911
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: TextFieldComponent, isStandalone: true, selector: "lxp-text-field", inputs: { label: "label", value: "value", placeholder: "placeholder", helperText: "helperText", error: "error", disabled: "disabled", id: "id", className: "className", testID: "testID", type: "type" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
912
+ <div [ngStyle]="wrapperStyles">
913
+ <label *ngIf="label" [attr.for]="id" [ngStyle]="labelStyles">{{
914
+ label
915
+ }}</label>
916
+ <input
917
+ [attr.id]="id"
918
+ [attr.data-testid]="testID"
919
+ [type]="type"
920
+ [value]="value || ''"
921
+ [attr.placeholder]="placeholder"
922
+ [disabled]="disabled"
923
+ (input)="onInput($event)"
924
+ (focus)="focused = true"
925
+ (blur)="focused = false"
926
+ [ngStyle]="inputStyles"
927
+ />
928
+ <span *ngIf="error || helperText" [ngStyle]="helperStyles">{{
929
+ error || helperText
930
+ }}</span>
931
+ </div>
932
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
933
+ }
934
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TextFieldComponent, decorators: [{
935
+ type: Component,
936
+ args: [{
937
+ selector: "lxp-text-field",
938
+ standalone: true,
939
+ imports: [CommonModule],
940
+ template: `
941
+ <div [ngStyle]="wrapperStyles">
942
+ <label *ngIf="label" [attr.for]="id" [ngStyle]="labelStyles">{{
943
+ label
944
+ }}</label>
945
+ <input
946
+ [attr.id]="id"
947
+ [attr.data-testid]="testID"
948
+ [type]="type"
949
+ [value]="value || ''"
950
+ [attr.placeholder]="placeholder"
951
+ [disabled]="disabled"
952
+ (input)="onInput($event)"
953
+ (focus)="focused = true"
954
+ (blur)="focused = false"
955
+ [ngStyle]="inputStyles"
956
+ />
957
+ <span *ngIf="error || helperText" [ngStyle]="helperStyles">{{
958
+ error || helperText
959
+ }}</span>
960
+ </div>
961
+ `,
962
+ }]
963
+ }], propDecorators: { label: [{
964
+ type: Input
965
+ }], value: [{
966
+ type: Input
967
+ }], placeholder: [{
968
+ type: Input
969
+ }], helperText: [{
970
+ type: Input
971
+ }], error: [{
972
+ type: Input
973
+ }], disabled: [{
974
+ type: Input
975
+ }], id: [{
976
+ type: Input
977
+ }], className: [{
978
+ type: Input
979
+ }], testID: [{
980
+ type: Input
981
+ }], type: [{
982
+ type: Input
983
+ }], valueChange: [{
984
+ type: Output
985
+ }] } });
986
+
987
+ class ChipComponent {
988
+ content;
989
+ label;
990
+ selected = false;
991
+ disabled = false;
992
+ id;
993
+ className;
994
+ testID;
995
+ onClick = new EventEmitter();
996
+ get text() {
997
+ return this.content ?? this.label;
998
+ }
999
+ get st() {
1000
+ return this.selected ? chipConfig.states.active : chipConfig.states.default;
1001
+ }
1002
+ get styles() {
1003
+ const c = chipConfig.common;
1004
+ const st = this.st;
1005
+ return {
1006
+ "background-color": st.backgroundColor,
1007
+ color: st.color,
1008
+ border: st.borderWidth
1009
+ ? `${st.borderWidth}px solid ${st.borderColor}`
1010
+ : "none",
1011
+ "border-radius": c.borderRadius,
1012
+ "font-size": c.fontSize,
1013
+ "font-weight": `${c.fontWeight}`,
1014
+ padding: `${c.paddingVertical} ${c.paddingHorizontal}`,
1015
+ cursor: this.disabled ? "not-allowed" : "pointer",
1016
+ opacity: this.disabled ? "0.6" : "1",
1017
+ };
1018
+ }
1019
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1020
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: ChipComponent, isStandalone: true, selector: "lxp-chip", inputs: { content: "content", label: "label", selected: "selected", disabled: "disabled", id: "id", className: "className", testID: "testID" }, outputs: { onClick: "onClick" }, ngImport: i0, template: `
1021
+ <button
1022
+ type="button"
1023
+ [attr.id]="id"
1024
+ [attr.data-testid]="testID"
1025
+ [disabled]="disabled"
1026
+ (click)="onClick.emit($event)"
1027
+ [ngStyle]="styles"
1028
+ >
1029
+ {{ text }}
1030
+ </button>
1031
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1032
+ }
1033
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ChipComponent, decorators: [{
1034
+ type: Component,
1035
+ args: [{
1036
+ selector: "lxp-chip",
1037
+ standalone: true,
1038
+ imports: [CommonModule],
1039
+ template: `
1040
+ <button
1041
+ type="button"
1042
+ [attr.id]="id"
1043
+ [attr.data-testid]="testID"
1044
+ [disabled]="disabled"
1045
+ (click)="onClick.emit($event)"
1046
+ [ngStyle]="styles"
1047
+ >
1048
+ {{ text }}
1049
+ </button>
1050
+ `,
1051
+ }]
1052
+ }], propDecorators: { content: [{
1053
+ type: Input
1054
+ }], label: [{
1055
+ type: Input
1056
+ }], selected: [{
1057
+ type: Input
1058
+ }], disabled: [{
1059
+ type: Input
1060
+ }], id: [{
1061
+ type: Input
1062
+ }], className: [{
1063
+ type: Input
1064
+ }], testID: [{
1065
+ type: Input
1066
+ }], onClick: [{
1067
+ type: Output
1068
+ }] } });
1069
+
1070
+ class ToggleComponent {
1071
+ checked = false;
1072
+ disabled = false;
1073
+ id;
1074
+ className;
1075
+ ariaLabel;
1076
+ testID;
1077
+ checkedChange = new EventEmitter();
1078
+ toggle() {
1079
+ this.checked = !this.checked;
1080
+ this.checkedChange.emit(this.checked);
1081
+ }
1082
+ get trackStyles() {
1083
+ const t = toggleConfig.track;
1084
+ return {
1085
+ width: `${t.width}px`,
1086
+ height: `${t.height}px`,
1087
+ "border-radius": t.borderRadius,
1088
+ "background-color": this.checked ? t.onColor : t.offColor,
1089
+ border: "none",
1090
+ padding: `${t.padding}px`,
1091
+ display: "inline-flex",
1092
+ "align-items": "center",
1093
+ "justify-content": this.checked ? "flex-end" : "flex-start",
1094
+ cursor: this.disabled ? "not-allowed" : "pointer",
1095
+ opacity: this.disabled ? `${toggleConfig.common.disabledOpacity}` : "1",
1096
+ transition: "background-color 0.2s",
1097
+ };
1098
+ }
1099
+ get knobStyles() {
1100
+ const k = toggleConfig.knob;
1101
+ return {
1102
+ width: `${k.size}px`,
1103
+ height: `${k.size}px`,
1104
+ "border-radius": k.borderRadius,
1105
+ "background-color": k.color,
1106
+ "box-shadow": "0 1px 2px rgba(0,0,0,0.2)",
1107
+ };
1108
+ }
1109
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1110
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: ToggleComponent, isStandalone: true, selector: "lxp-toggle", inputs: { checked: "checked", disabled: "disabled", id: "id", className: "className", ariaLabel: "ariaLabel", testID: "testID" }, outputs: { checkedChange: "checkedChange" }, ngImport: i0, template: `
1111
+ <button
1112
+ type="button"
1113
+ role="switch"
1114
+ [attr.aria-checked]="checked"
1115
+ [attr.aria-label]="ariaLabel"
1116
+ [attr.id]="id"
1117
+ [attr.data-testid]="testID"
1118
+ [disabled]="disabled"
1119
+ (click)="toggle()"
1120
+ [ngStyle]="trackStyles"
1121
+ >
1122
+ <span [ngStyle]="knobStyles"></span>
1123
+ </button>
1124
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1125
+ }
1126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ToggleComponent, decorators: [{
1127
+ type: Component,
1128
+ args: [{
1129
+ selector: "lxp-toggle",
1130
+ standalone: true,
1131
+ imports: [CommonModule],
1132
+ template: `
1133
+ <button
1134
+ type="button"
1135
+ role="switch"
1136
+ [attr.aria-checked]="checked"
1137
+ [attr.aria-label]="ariaLabel"
1138
+ [attr.id]="id"
1139
+ [attr.data-testid]="testID"
1140
+ [disabled]="disabled"
1141
+ (click)="toggle()"
1142
+ [ngStyle]="trackStyles"
1143
+ >
1144
+ <span [ngStyle]="knobStyles"></span>
1145
+ </button>
1146
+ `,
1147
+ }]
1148
+ }], propDecorators: { checked: [{
1149
+ type: Input
1150
+ }], disabled: [{
1151
+ type: Input
1152
+ }], id: [{
1153
+ type: Input
1154
+ }], className: [{
1155
+ type: Input
1156
+ }], ariaLabel: [{
1157
+ type: Input
1158
+ }], testID: [{
1159
+ type: Input
1160
+ }], checkedChange: [{
1161
+ type: Output
1162
+ }] } });
1163
+
1164
+ class RadioComponent {
1165
+ checked = false;
1166
+ disabled = false;
1167
+ label;
1168
+ value;
1169
+ id;
1170
+ className;
1171
+ testID;
1172
+ onSelect = new EventEmitter();
1173
+ get st() {
1174
+ return this.checked
1175
+ ? radioConfig.states.selected
1176
+ : radioConfig.states.unselected;
1177
+ }
1178
+ get c() {
1179
+ return radioConfig.common;
1180
+ }
1181
+ get rootStyles() {
1182
+ return {
1183
+ display: "inline-flex",
1184
+ "align-items": "center",
1185
+ gap: `${this.c.gap}`,
1186
+ background: "none",
1187
+ border: "none",
1188
+ padding: "0",
1189
+ cursor: this.disabled ? "not-allowed" : "pointer",
1190
+ opacity: this.disabled ? `${this.c.disabledOpacity}` : "1",
1191
+ };
1192
+ }
1193
+ get circleStyles() {
1194
+ const c = this.c;
1195
+ return {
1196
+ width: `${c.size}px`,
1197
+ height: `${c.size}px`,
1198
+ "border-radius": "50%",
1199
+ border: `${c.borderWidth}px solid ${this.st.borderColor}`,
1200
+ display: "inline-flex",
1201
+ "align-items": "center",
1202
+ "justify-content": "center",
1203
+ "box-sizing": "border-box",
1204
+ };
1205
+ }
1206
+ get dotStyles() {
1207
+ const c = this.c;
1208
+ return {
1209
+ width: `${c.dotSize}px`,
1210
+ height: `${c.dotSize}px`,
1211
+ "border-radius": "50%",
1212
+ "background-color": this.st.dotColor,
1213
+ };
1214
+ }
1215
+ get labelStyles() {
1216
+ return { "font-size": this.c.fontSize, color: this.c.labelColor };
1217
+ }
1218
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: RadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1219
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: RadioComponent, isStandalone: true, selector: "lxp-radio", inputs: { checked: "checked", disabled: "disabled", label: "label", value: "value", id: "id", className: "className", testID: "testID" }, outputs: { onSelect: "onSelect" }, ngImport: i0, template: `
1220
+ <button
1221
+ type="button"
1222
+ role="radio"
1223
+ [attr.aria-checked]="checked"
1224
+ [attr.id]="id"
1225
+ [attr.data-testid]="testID"
1226
+ [disabled]="disabled"
1227
+ (click)="onSelect.emit(value)"
1228
+ [ngStyle]="rootStyles"
1229
+ >
1230
+ <span [ngStyle]="circleStyles">
1231
+ <span *ngIf="checked" [ngStyle]="dotStyles"></span>
1232
+ </span>
1233
+ <span *ngIf="label" [ngStyle]="labelStyles">{{ label }}</span>
1234
+ </button>
1235
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1236
+ }
1237
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: RadioComponent, decorators: [{
1238
+ type: Component,
1239
+ args: [{
1240
+ selector: "lxp-radio",
1241
+ standalone: true,
1242
+ imports: [CommonModule],
1243
+ template: `
1244
+ <button
1245
+ type="button"
1246
+ role="radio"
1247
+ [attr.aria-checked]="checked"
1248
+ [attr.id]="id"
1249
+ [attr.data-testid]="testID"
1250
+ [disabled]="disabled"
1251
+ (click)="onSelect.emit(value)"
1252
+ [ngStyle]="rootStyles"
1253
+ >
1254
+ <span [ngStyle]="circleStyles">
1255
+ <span *ngIf="checked" [ngStyle]="dotStyles"></span>
1256
+ </span>
1257
+ <span *ngIf="label" [ngStyle]="labelStyles">{{ label }}</span>
1258
+ </button>
1259
+ `,
1260
+ }]
1261
+ }], propDecorators: { checked: [{
1262
+ type: Input
1263
+ }], disabled: [{
1264
+ type: Input
1265
+ }], label: [{
1266
+ type: Input
1267
+ }], value: [{
1268
+ type: Input
1269
+ }], id: [{
1270
+ type: Input
1271
+ }], className: [{
1272
+ type: Input
1273
+ }], testID: [{
1274
+ type: Input
1275
+ }], onSelect: [{
1276
+ type: Output
1277
+ }] } });
1278
+
1279
+ class AvatarComponent {
1280
+ initials;
1281
+ src;
1282
+ size = "md";
1283
+ id;
1284
+ className;
1285
+ testID;
1286
+ get s() {
1287
+ return avatarConfig.sizes[this.size];
1288
+ }
1289
+ get rootStyles() {
1290
+ const c = avatarConfig.common;
1291
+ const s = this.s;
1292
+ return {
1293
+ width: `${s.size}px`,
1294
+ height: `${s.size}px`,
1295
+ "border-radius": c.borderRadius,
1296
+ "background-color": c.backgroundColor,
1297
+ color: c.color,
1298
+ display: "inline-flex",
1299
+ "align-items": "center",
1300
+ "justify-content": "center",
1301
+ "font-size": s.fontSize,
1302
+ "font-weight": `${c.fontWeight}`,
1303
+ overflow: "hidden",
1304
+ };
1305
+ }
1306
+ get imgStyles() {
1307
+ return { width: "100%", height: "100%", "object-fit": "cover" };
1308
+ }
1309
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1310
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: AvatarComponent, isStandalone: true, selector: "lxp-avatar", inputs: { initials: "initials", src: "src", size: "size", id: "id", className: "className", testID: "testID" }, ngImport: i0, template: `
1311
+ <span [attr.id]="id" [attr.data-testid]="testID" [ngStyle]="rootStyles">
1312
+ <img
1313
+ *ngIf="src; else initialsTpl"
1314
+ [src]="src"
1315
+ [attr.alt]="initials || ''"
1316
+ [ngStyle]="imgStyles"
1317
+ />
1318
+ <ng-template #initialsTpl>{{ initials }}</ng-template>
1319
+ </span>
1320
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1321
+ }
1322
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: AvatarComponent, decorators: [{
1323
+ type: Component,
1324
+ args: [{
1325
+ selector: "lxp-avatar",
1326
+ standalone: true,
1327
+ imports: [CommonModule],
1328
+ template: `
1329
+ <span [attr.id]="id" [attr.data-testid]="testID" [ngStyle]="rootStyles">
1330
+ <img
1331
+ *ngIf="src; else initialsTpl"
1332
+ [src]="src"
1333
+ [attr.alt]="initials || ''"
1334
+ [ngStyle]="imgStyles"
1335
+ />
1336
+ <ng-template #initialsTpl>{{ initials }}</ng-template>
1337
+ </span>
1338
+ `,
1339
+ }]
1340
+ }], propDecorators: { initials: [{
1341
+ type: Input
1342
+ }], src: [{
1343
+ type: Input
1344
+ }], size: [{
1345
+ type: Input
1346
+ }], id: [{
1347
+ type: Input
1348
+ }], className: [{
1349
+ type: Input
1350
+ }], testID: [{
1351
+ type: Input
1352
+ }] } });
1353
+
1354
+ class CardComponent {
1355
+ padding = "md";
1356
+ elevation = "sm";
1357
+ bordered = true;
1358
+ id;
1359
+ className;
1360
+ testID;
1361
+ get styles() {
1362
+ const c = cardConfig.common;
1363
+ return {
1364
+ "background-color": c.backgroundColor,
1365
+ border: this.bordered
1366
+ ? `${c.borderWidth}px solid ${c.borderColor}`
1367
+ : "none",
1368
+ "border-radius": c.borderRadius,
1369
+ padding: cardConfig.paddings[this.padding],
1370
+ "box-shadow": cardConfig.elevations[this.elevation],
1371
+ };
1372
+ }
1373
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1374
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: CardComponent, isStandalone: true, selector: "lxp-card", inputs: { padding: "padding", elevation: "elevation", bordered: "bordered", id: "id", className: "className", testID: "testID" }, ngImport: i0, template: `
1375
+ <div [attr.id]="id" [attr.data-testid]="testID" [ngStyle]="styles">
1376
+ <ng-content></ng-content>
1377
+ </div>
1378
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1379
+ }
1380
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: CardComponent, decorators: [{
1381
+ type: Component,
1382
+ args: [{
1383
+ selector: "lxp-card",
1384
+ standalone: true,
1385
+ imports: [CommonModule],
1386
+ template: `
1387
+ <div [attr.id]="id" [attr.data-testid]="testID" [ngStyle]="styles">
1388
+ <ng-content></ng-content>
1389
+ </div>
1390
+ `,
1391
+ }]
1392
+ }], propDecorators: { padding: [{
1393
+ type: Input
1394
+ }], elevation: [{
1395
+ type: Input
1396
+ }], bordered: [{
1397
+ type: Input
1398
+ }], id: [{
1399
+ type: Input
1400
+ }], className: [{
1401
+ type: Input
1402
+ }], testID: [{
1403
+ type: Input
1404
+ }] } });
1405
+
1406
+ class SegmentedControlComponent {
1407
+ options = [];
1408
+ value;
1409
+ disabled = false;
1410
+ id;
1411
+ className;
1412
+ testID;
1413
+ valueChange = new EventEmitter();
1414
+ get normalized() {
1415
+ return (this.options || []).map((o) => typeof o === "string" ? { label: o, value: o } : o);
1416
+ }
1417
+ get c() {
1418
+ return segmentedControlConfig.common;
1419
+ }
1420
+ get containerStyles() {
1421
+ const c = this.c;
1422
+ return {
1423
+ display: "inline-flex",
1424
+ "background-color": c.backgroundColor,
1425
+ "border-radius": c.borderRadius,
1426
+ padding: `${c.padding}px`,
1427
+ };
1428
+ }
1429
+ segmentStyles(active) {
1430
+ const c = this.c;
1431
+ return {
1432
+ border: "none",
1433
+ cursor: this.disabled ? "not-allowed" : "pointer",
1434
+ "background-color": active ? c.activeBackground : "transparent",
1435
+ color: active ? c.activeColor : c.inactiveColor,
1436
+ "border-radius": c.segmentRadius,
1437
+ "font-size": c.fontSize,
1438
+ "font-weight": `${c.fontWeight}`,
1439
+ padding: `${c.segmentPaddingVertical} ${c.segmentPaddingHorizontal}`,
1440
+ "box-shadow": active ? c.activeShadow : "none",
1441
+ transition: "all 0.15s",
1442
+ };
1443
+ }
1444
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1445
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: SegmentedControlComponent, isStandalone: true, selector: "lxp-segmented-control", inputs: { options: "options", value: "value", disabled: "disabled", id: "id", className: "className", testID: "testID" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
1446
+ <div
1447
+ [attr.id]="id"
1448
+ [attr.data-testid]="testID"
1449
+ role="tablist"
1450
+ [ngStyle]="containerStyles"
1451
+ >
1452
+ <button
1453
+ *ngFor="let o of normalized"
1454
+ type="button"
1455
+ role="tab"
1456
+ [attr.aria-selected]="o.value === value"
1457
+ [disabled]="disabled"
1458
+ (click)="valueChange.emit(o.value)"
1459
+ [ngStyle]="segmentStyles(o.value === value)"
1460
+ >
1461
+ {{ o.label }}
1462
+ </button>
1463
+ </div>
1464
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1465
+ }
1466
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SegmentedControlComponent, decorators: [{
1467
+ type: Component,
1468
+ args: [{
1469
+ selector: "lxp-segmented-control",
1470
+ standalone: true,
1471
+ imports: [CommonModule],
1472
+ template: `
1473
+ <div
1474
+ [attr.id]="id"
1475
+ [attr.data-testid]="testID"
1476
+ role="tablist"
1477
+ [ngStyle]="containerStyles"
1478
+ >
1479
+ <button
1480
+ *ngFor="let o of normalized"
1481
+ type="button"
1482
+ role="tab"
1483
+ [attr.aria-selected]="o.value === value"
1484
+ [disabled]="disabled"
1485
+ (click)="valueChange.emit(o.value)"
1486
+ [ngStyle]="segmentStyles(o.value === value)"
1487
+ >
1488
+ {{ o.label }}
1489
+ </button>
1490
+ </div>
1491
+ `,
1492
+ }]
1493
+ }], propDecorators: { options: [{
1494
+ type: Input
1495
+ }], value: [{
1496
+ type: Input
1497
+ }], disabled: [{
1498
+ type: Input
1499
+ }], id: [{
1500
+ type: Input
1501
+ }], className: [{
1502
+ type: Input
1503
+ }], testID: [{
1504
+ type: Input
1505
+ }], valueChange: [{
1506
+ type: Output
1507
+ }] } });
1508
+
1509
+ class QuantityStepperComponent {
1510
+ value = 0;
1511
+ min = 0;
1512
+ max = Number.POSITIVE_INFINITY;
1513
+ step = 1;
1514
+ disabled = false;
1515
+ id;
1516
+ className;
1517
+ testID;
1518
+ valueChange = new EventEmitter();
1519
+ set(v) {
1520
+ const nv = Math.max(this.min, Math.min(this.max, v));
1521
+ this.value = nv;
1522
+ this.valueChange.emit(nv);
1523
+ }
1524
+ get c() {
1525
+ return quantityStepperConfig.common;
1526
+ }
1527
+ get containerStyles() {
1528
+ const c = this.c;
1529
+ return {
1530
+ display: "inline-flex",
1531
+ "align-items": "stretch",
1532
+ border: `1px solid ${c.borderColor}`,
1533
+ "border-radius": c.borderRadius,
1534
+ overflow: "hidden",
1535
+ opacity: this.disabled ? `${c.disabledOpacity}` : "1",
1536
+ };
1537
+ }
1538
+ get buttonStyles() {
1539
+ const c = this.c;
1540
+ return {
1541
+ width: `${c.buttonWidth}px`,
1542
+ height: `${c.height}px`,
1543
+ border: "none",
1544
+ "background-color": c.buttonBackground,
1545
+ color: c.buttonColor,
1546
+ "font-size": c.fontSize,
1547
+ "font-weight": `${c.fontWeight}`,
1548
+ cursor: "pointer",
1549
+ };
1550
+ }
1551
+ get valueStyles() {
1552
+ const c = this.c;
1553
+ return {
1554
+ "min-width": `${c.valueWidth}px`,
1555
+ height: `${c.height}px`,
1556
+ display: "inline-flex",
1557
+ "align-items": "center",
1558
+ "justify-content": "center",
1559
+ "background-color": c.valueBackground,
1560
+ color: c.valueColor,
1561
+ "font-size": c.fontSize,
1562
+ "font-weight": `${c.fontWeight}`,
1563
+ };
1564
+ }
1565
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: QuantityStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1566
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: QuantityStepperComponent, isStandalone: true, selector: "lxp-quantity-stepper", inputs: { value: "value", min: "min", max: "max", step: "step", disabled: "disabled", id: "id", className: "className", testID: "testID" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
1567
+ <div [attr.id]="id" [attr.data-testid]="testID" [ngStyle]="containerStyles">
1568
+ <button
1569
+ type="button"
1570
+ [disabled]="disabled || value <= min"
1571
+ (click)="set(value - step)"
1572
+ [ngStyle]="buttonStyles"
1573
+ >
1574
+
1575
+ </button>
1576
+ <span [ngStyle]="valueStyles">{{ value }}</span>
1577
+ <button
1578
+ type="button"
1579
+ [disabled]="disabled || value >= max"
1580
+ (click)="set(value + step)"
1581
+ [ngStyle]="buttonStyles"
1582
+ >
1583
+ +
1584
+ </button>
1585
+ </div>
1586
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1587
+ }
1588
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: QuantityStepperComponent, decorators: [{
1589
+ type: Component,
1590
+ args: [{
1591
+ selector: "lxp-quantity-stepper",
1592
+ standalone: true,
1593
+ imports: [CommonModule],
1594
+ template: `
1595
+ <div [attr.id]="id" [attr.data-testid]="testID" [ngStyle]="containerStyles">
1596
+ <button
1597
+ type="button"
1598
+ [disabled]="disabled || value <= min"
1599
+ (click)="set(value - step)"
1600
+ [ngStyle]="buttonStyles"
1601
+ >
1602
+
1603
+ </button>
1604
+ <span [ngStyle]="valueStyles">{{ value }}</span>
1605
+ <button
1606
+ type="button"
1607
+ [disabled]="disabled || value >= max"
1608
+ (click)="set(value + step)"
1609
+ [ngStyle]="buttonStyles"
1610
+ >
1611
+ +
1612
+ </button>
1613
+ </div>
1614
+ `,
1615
+ }]
1616
+ }], propDecorators: { value: [{
1617
+ type: Input
1618
+ }], min: [{
1619
+ type: Input
1620
+ }], max: [{
1621
+ type: Input
1622
+ }], step: [{
1623
+ type: Input
1624
+ }], disabled: [{
1625
+ type: Input
1626
+ }], id: [{
1627
+ type: Input
1628
+ }], className: [{
1629
+ type: Input
1630
+ }], testID: [{
1631
+ type: Input
1632
+ }], valueChange: [{
1633
+ type: Output
1634
+ }] } });
1635
+
762
1636
  /**
763
1637
  * Generated bundle index. Do not edit.
764
1638
  */
765
1639
 
766
- export { ButtonComponent, TableComponent, ThemeService, ThemeSwitcherComponent };
1640
+ export { AvatarComponent, BadgeComponent, ButtonComponent, CardComponent, ChipComponent, QuantityStepperComponent, RadioComponent, SegmentedControlComponent, TableComponent, TextFieldComponent, ThemeService, ThemeSwitcherComponent, ToggleComponent };
767
1641
  //# sourceMappingURL=lamenna-lxp-angular.mjs.map