@genspectrum/dashboard-components 0.6.15 → 0.6.17

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.
Files changed (28) hide show
  1. package/custom-elements.json +3 -3
  2. package/dist/dashboard-components.js +115 -117
  3. package/dist/dashboard-components.js.map +1 -1
  4. package/dist/genspectrum-components.d.ts +141 -25
  5. package/dist/style.css +107 -112
  6. package/package.json +3 -3
  7. package/src/preact/components/error-display.stories.tsx +2 -2
  8. package/src/preact/components/proportion-selector-dropdown.stories.tsx +13 -4
  9. package/src/preact/components/proportion-selector-dropdown.tsx +7 -4
  10. package/src/preact/mutationsOverTime/mutations-over-time.tsx +1 -0
  11. package/src/web-components/app.ts +10 -0
  12. package/src/web-components/input/gs-date-range-selector.tsx +10 -0
  13. package/src/web-components/input/gs-lineage-filter.stories.ts +1 -1
  14. package/src/web-components/input/gs-lineage-filter.tsx +10 -0
  15. package/src/web-components/input/gs-location-filter.stories.ts +2 -2
  16. package/src/web-components/input/gs-location-filter.tsx +10 -0
  17. package/src/web-components/input/gs-mutation-filter.tsx +10 -0
  18. package/src/web-components/input/gs-text-input.stories.ts +1 -1
  19. package/src/web-components/input/gs-text-input.tsx +10 -0
  20. package/src/web-components/visualization/gs-aggregate.tsx +10 -0
  21. package/src/web-components/visualization/gs-mutation-comparison.tsx +10 -0
  22. package/src/web-components/visualization/gs-mutations-over-time.tsx +10 -0
  23. package/src/web-components/visualization/gs-mutations.tsx +10 -0
  24. package/src/web-components/visualization/gs-number-sequences-over-time.tsx +10 -0
  25. package/src/web-components/visualization/gs-prevalence-over-time.tsx +10 -0
  26. package/src/web-components/visualization/gs-relative-growth-advantage.tsx +10 -0
  27. package/standalone-bundle/dashboard-components.js +3133 -3122
  28. package/standalone-bundle/dashboard-components.js.map +1 -1
@@ -1,6 +1,6 @@
1
1
  import { CSSResult } from 'lit';
2
2
  import { default as default_2 } from 'zod';
3
- import { JSX as JSX_2 } from 'preact';
3
+ import { JSX as JSX_2 } from 'react';
4
4
  import { JSXInternal } from 'preact/src/jsx';
5
5
  import { LitElement } from 'lit';
6
6
  import { PropertyValues } from '@lit/reactive-element';
@@ -978,102 +978,219 @@ declare global {
978
978
  }
979
979
 
980
980
 
981
+ declare global {
982
+ namespace JSX {
983
+ interface IntrinsicElements {
984
+ 'gs-app': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
985
+ }
986
+ }
987
+ }
988
+
989
+
981
990
  declare global {
982
991
  interface HTMLElementTagNameMap {
983
- 'gs-mutation-comparison-component': MutationComparisonComponent;
992
+ 'gs-date-range-selector': DateRangeSelectorComponent;
993
+ }
994
+ interface HTMLElementEventMap {
995
+ 'gs-date-range-changed': CustomEvent<Record<string, string>>;
996
+ }
997
+ }
998
+
999
+
1000
+ declare global {
1001
+ namespace JSX {
1002
+ interface IntrinsicElements {
1003
+ 'gs-date-range-selector': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1004
+ }
984
1005
  }
985
1006
  }
986
1007
 
987
1008
 
988
1009
  declare global {
989
1010
  interface HTMLElementTagNameMap {
990
- 'gs-mutations-component': MutationsComponent;
1011
+ 'gs-location-filter': LocationFilterComponent;
1012
+ }
1013
+ interface HTMLElementEventMap {
1014
+ 'gs-location-changed': CustomEvent<Record<string, string>>;
1015
+ }
1016
+ }
1017
+
1018
+
1019
+ declare global {
1020
+ namespace JSX {
1021
+ interface IntrinsicElements {
1022
+ 'gs-location-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1023
+ }
991
1024
  }
992
1025
  }
993
1026
 
994
1027
 
995
1028
  declare global {
996
1029
  interface HTMLElementTagNameMap {
997
- 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
1030
+ 'gs-text-input': TextInputComponent;
1031
+ }
1032
+ interface HTMLElementEventMap {
1033
+ 'gs-text-input-changed': CustomEvent<Record<string, string>>;
1034
+ }
1035
+ }
1036
+
1037
+
1038
+ declare global {
1039
+ namespace JSX {
1040
+ interface IntrinsicElements {
1041
+ 'gs-text-input-changed': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1042
+ }
998
1043
  }
999
1044
  }
1000
1045
 
1001
1046
 
1002
1047
  declare global {
1003
1048
  interface HTMLElementTagNameMap {
1004
- 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
1049
+ 'gs-mutation-filter': MutationFilterComponent;
1050
+ }
1051
+ interface HTMLElementEventMap {
1052
+ 'gs-mutation-filter-changed': CustomEvent<SelectedMutationFilterStrings>;
1053
+ 'gs-mutation-filter-on-blur': CustomEvent<SelectedMutationFilterStrings>;
1054
+ }
1055
+ }
1056
+
1057
+
1058
+ declare global {
1059
+ namespace JSX {
1060
+ interface IntrinsicElements {
1061
+ 'gs-mutation-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1062
+ }
1005
1063
  }
1006
1064
  }
1007
1065
 
1008
1066
 
1009
1067
  declare global {
1010
1068
  interface HTMLElementTagNameMap {
1011
- 'gs-aggregate-component': AggregateComponent;
1069
+ 'gs-lineage-filter': LineageFilterComponent;
1070
+ }
1071
+ interface HTMLElementEventMap {
1072
+ 'gs-lineage-filter-changed': CustomEvent<Record<string, string>>;
1073
+ }
1074
+ }
1075
+
1076
+
1077
+ declare global {
1078
+ namespace JSX {
1079
+ interface IntrinsicElements {
1080
+ 'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1081
+ }
1012
1082
  }
1013
1083
  }
1014
1084
 
1015
1085
 
1016
1086
  declare global {
1017
1087
  interface HTMLElementTagNameMap {
1018
- 'gs-number-sequences-over-time': NumberSequencesOverTimeComponent;
1088
+ 'gs-mutation-comparison-component': MutationComparisonComponent;
1089
+ }
1090
+ }
1091
+
1092
+
1093
+ declare global {
1094
+ namespace JSX {
1095
+ interface IntrinsicElements {
1096
+ 'gs-mutation-comparison-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1097
+ }
1019
1098
  }
1020
1099
  }
1021
1100
 
1022
1101
 
1023
1102
  declare global {
1024
1103
  interface HTMLElementTagNameMap {
1025
- 'gs-mutations-over-time-component': MutationsOverTimeComponent;
1104
+ 'gs-mutations-component': MutationsComponent;
1105
+ }
1106
+ }
1107
+
1108
+
1109
+ declare global {
1110
+ namespace JSX {
1111
+ interface IntrinsicElements {
1112
+ 'gs-mutations-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1113
+ }
1026
1114
  }
1027
1115
  }
1028
1116
 
1029
1117
 
1030
1118
  declare global {
1031
1119
  interface HTMLElementTagNameMap {
1032
- 'gs-date-range-selector': DateRangeSelectorComponent;
1120
+ 'gs-prevalence-over-time': PrevalenceOverTimeComponent;
1033
1121
  }
1034
- interface HTMLElementEventMap {
1035
- 'gs-date-range-changed': CustomEvent<Record<string, string>>;
1122
+ }
1123
+
1124
+
1125
+ declare global {
1126
+ namespace JSX {
1127
+ interface IntrinsicElements {
1128
+ 'gs-prevalence-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1129
+ }
1036
1130
  }
1037
1131
  }
1038
1132
 
1039
1133
 
1040
1134
  declare global {
1041
1135
  interface HTMLElementTagNameMap {
1042
- 'gs-location-filter': LocationFilterComponent;
1136
+ 'gs-relative-growth-advantage': RelativeGrowthAdvantageComponent;
1043
1137
  }
1044
- interface HTMLElementEventMap {
1045
- 'gs-location-changed': CustomEvent<Record<string, string>>;
1138
+ }
1139
+
1140
+
1141
+ declare global {
1142
+ namespace JSX {
1143
+ interface IntrinsicElements {
1144
+ 'gs-relative-growth-advantage': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1145
+ }
1046
1146
  }
1047
1147
  }
1048
1148
 
1049
1149
 
1050
1150
  declare global {
1051
1151
  interface HTMLElementTagNameMap {
1052
- 'gs-text-input': TextInputComponent;
1152
+ 'gs-aggregate-component': AggregateComponent;
1053
1153
  }
1054
- interface HTMLElementEventMap {
1055
- 'gs-text-input-changed': CustomEvent<Record<string, string>>;
1154
+ }
1155
+
1156
+
1157
+ declare global {
1158
+ namespace JSX {
1159
+ interface IntrinsicElements {
1160
+ 'gs-aggregate-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1161
+ }
1056
1162
  }
1057
1163
  }
1058
1164
 
1059
1165
 
1060
1166
  declare global {
1061
1167
  interface HTMLElementTagNameMap {
1062
- 'gs-lineage-filter': LineageFilterComponent;
1168
+ 'gs-number-sequences-over-time': NumberSequencesOverTimeComponent;
1063
1169
  }
1064
- interface HTMLElementEventMap {
1065
- 'gs-lineage-filter-changed': CustomEvent<Record<string, string>>;
1170
+ }
1171
+
1172
+
1173
+ declare global {
1174
+ namespace JSX {
1175
+ interface IntrinsicElements {
1176
+ 'gs-number-sequences-over-time': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1177
+ }
1066
1178
  }
1067
1179
  }
1068
1180
 
1069
1181
 
1070
1182
  declare global {
1071
1183
  interface HTMLElementTagNameMap {
1072
- 'gs-mutation-filter': MutationFilterComponent;
1184
+ 'gs-mutations-over-time-component': MutationsOverTimeComponent;
1073
1185
  }
1074
- interface HTMLElementEventMap {
1075
- 'gs-mutation-filter-changed': CustomEvent<SelectedMutationFilterStrings>;
1076
- 'gs-mutation-filter-on-blur': CustomEvent<SelectedMutationFilterStrings>;
1186
+ }
1187
+
1188
+
1189
+ declare global {
1190
+ namespace JSX {
1191
+ interface IntrinsicElements {
1192
+ 'gs-mutations-over-time-component': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
1193
+ }
1077
1194
  }
1078
1195
  }
1079
1196
 
@@ -1085,4 +1202,3 @@ declare module 'chart.js' {
1085
1202
  };
1086
1203
  }
1087
1204
  }
1088
-
package/dist/style.css CHANGED
@@ -375,8 +375,114 @@ input[type="range"] {
375
375
  position: absolute;
376
376
  background-color: #C6C6C6;
377
377
  pointer-events: none;
378
+ }*, ::before, ::after {
379
+ --tw-border-spacing-x: 0;
380
+ --tw-border-spacing-y: 0;
381
+ --tw-translate-x: 0;
382
+ --tw-translate-y: 0;
383
+ --tw-rotate: 0;
384
+ --tw-skew-x: 0;
385
+ --tw-skew-y: 0;
386
+ --tw-scale-x: 1;
387
+ --tw-scale-y: 1;
388
+ --tw-pan-x: ;
389
+ --tw-pan-y: ;
390
+ --tw-pinch-zoom: ;
391
+ --tw-scroll-snap-strictness: proximity;
392
+ --tw-gradient-from-position: ;
393
+ --tw-gradient-via-position: ;
394
+ --tw-gradient-to-position: ;
395
+ --tw-ordinal: ;
396
+ --tw-slashed-zero: ;
397
+ --tw-numeric-figure: ;
398
+ --tw-numeric-spacing: ;
399
+ --tw-numeric-fraction: ;
400
+ --tw-ring-inset: ;
401
+ --tw-ring-offset-width: 0px;
402
+ --tw-ring-offset-color: #fff;
403
+ --tw-ring-color: rgb(59 130 246 / 0.5);
404
+ --tw-ring-offset-shadow: 0 0 #0000;
405
+ --tw-ring-shadow: 0 0 #0000;
406
+ --tw-shadow: 0 0 #0000;
407
+ --tw-shadow-colored: 0 0 #0000;
408
+ --tw-blur: ;
409
+ --tw-brightness: ;
410
+ --tw-contrast: ;
411
+ --tw-grayscale: ;
412
+ --tw-hue-rotate: ;
413
+ --tw-invert: ;
414
+ --tw-saturate: ;
415
+ --tw-sepia: ;
416
+ --tw-drop-shadow: ;
417
+ --tw-backdrop-blur: ;
418
+ --tw-backdrop-brightness: ;
419
+ --tw-backdrop-contrast: ;
420
+ --tw-backdrop-grayscale: ;
421
+ --tw-backdrop-hue-rotate: ;
422
+ --tw-backdrop-invert: ;
423
+ --tw-backdrop-opacity: ;
424
+ --tw-backdrop-saturate: ;
425
+ --tw-backdrop-sepia: ;
426
+ --tw-contain-size: ;
427
+ --tw-contain-layout: ;
428
+ --tw-contain-paint: ;
429
+ --tw-contain-style: ;
430
+ }
431
+
432
+ ::backdrop {
433
+ --tw-border-spacing-x: 0;
434
+ --tw-border-spacing-y: 0;
435
+ --tw-translate-x: 0;
436
+ --tw-translate-y: 0;
437
+ --tw-rotate: 0;
438
+ --tw-skew-x: 0;
439
+ --tw-skew-y: 0;
440
+ --tw-scale-x: 1;
441
+ --tw-scale-y: 1;
442
+ --tw-pan-x: ;
443
+ --tw-pan-y: ;
444
+ --tw-pinch-zoom: ;
445
+ --tw-scroll-snap-strictness: proximity;
446
+ --tw-gradient-from-position: ;
447
+ --tw-gradient-via-position: ;
448
+ --tw-gradient-to-position: ;
449
+ --tw-ordinal: ;
450
+ --tw-slashed-zero: ;
451
+ --tw-numeric-figure: ;
452
+ --tw-numeric-spacing: ;
453
+ --tw-numeric-fraction: ;
454
+ --tw-ring-inset: ;
455
+ --tw-ring-offset-width: 0px;
456
+ --tw-ring-offset-color: #fff;
457
+ --tw-ring-color: rgb(59 130 246 / 0.5);
458
+ --tw-ring-offset-shadow: 0 0 #0000;
459
+ --tw-ring-shadow: 0 0 #0000;
460
+ --tw-shadow: 0 0 #0000;
461
+ --tw-shadow-colored: 0 0 #0000;
462
+ --tw-blur: ;
463
+ --tw-brightness: ;
464
+ --tw-contrast: ;
465
+ --tw-grayscale: ;
466
+ --tw-hue-rotate: ;
467
+ --tw-invert: ;
468
+ --tw-saturate: ;
469
+ --tw-sepia: ;
470
+ --tw-drop-shadow: ;
471
+ --tw-backdrop-blur: ;
472
+ --tw-backdrop-brightness: ;
473
+ --tw-backdrop-contrast: ;
474
+ --tw-backdrop-grayscale: ;
475
+ --tw-backdrop-hue-rotate: ;
476
+ --tw-backdrop-invert: ;
477
+ --tw-backdrop-opacity: ;
478
+ --tw-backdrop-saturate: ;
479
+ --tw-backdrop-sepia: ;
480
+ --tw-contain-size: ;
481
+ --tw-contain-layout: ;
482
+ --tw-contain-paint: ;
483
+ --tw-contain-style: ;
378
484
  }/*
379
- ! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com
485
+ ! tailwindcss v3.4.13 | MIT License | https://tailwindcss.com
380
486
  *//*
381
487
  1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
382
488
  2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
@@ -875,114 +981,6 @@ html {
875
981
  --b3: 92.4169% 0.00108 197.137559;
876
982
  --bc: 27.8078% 0.029596 256.847952;
877
983
  }
878
-
879
- *, ::before, ::after {
880
- --tw-border-spacing-x: 0;
881
- --tw-border-spacing-y: 0;
882
- --tw-translate-x: 0;
883
- --tw-translate-y: 0;
884
- --tw-rotate: 0;
885
- --tw-skew-x: 0;
886
- --tw-skew-y: 0;
887
- --tw-scale-x: 1;
888
- --tw-scale-y: 1;
889
- --tw-pan-x: ;
890
- --tw-pan-y: ;
891
- --tw-pinch-zoom: ;
892
- --tw-scroll-snap-strictness: proximity;
893
- --tw-gradient-from-position: ;
894
- --tw-gradient-via-position: ;
895
- --tw-gradient-to-position: ;
896
- --tw-ordinal: ;
897
- --tw-slashed-zero: ;
898
- --tw-numeric-figure: ;
899
- --tw-numeric-spacing: ;
900
- --tw-numeric-fraction: ;
901
- --tw-ring-inset: ;
902
- --tw-ring-offset-width: 0px;
903
- --tw-ring-offset-color: #fff;
904
- --tw-ring-color: rgb(59 130 246 / 0.5);
905
- --tw-ring-offset-shadow: 0 0 #0000;
906
- --tw-ring-shadow: 0 0 #0000;
907
- --tw-shadow: 0 0 #0000;
908
- --tw-shadow-colored: 0 0 #0000;
909
- --tw-blur: ;
910
- --tw-brightness: ;
911
- --tw-contrast: ;
912
- --tw-grayscale: ;
913
- --tw-hue-rotate: ;
914
- --tw-invert: ;
915
- --tw-saturate: ;
916
- --tw-sepia: ;
917
- --tw-drop-shadow: ;
918
- --tw-backdrop-blur: ;
919
- --tw-backdrop-brightness: ;
920
- --tw-backdrop-contrast: ;
921
- --tw-backdrop-grayscale: ;
922
- --tw-backdrop-hue-rotate: ;
923
- --tw-backdrop-invert: ;
924
- --tw-backdrop-opacity: ;
925
- --tw-backdrop-saturate: ;
926
- --tw-backdrop-sepia: ;
927
- --tw-contain-size: ;
928
- --tw-contain-layout: ;
929
- --tw-contain-paint: ;
930
- --tw-contain-style: ;
931
- }
932
-
933
- ::backdrop {
934
- --tw-border-spacing-x: 0;
935
- --tw-border-spacing-y: 0;
936
- --tw-translate-x: 0;
937
- --tw-translate-y: 0;
938
- --tw-rotate: 0;
939
- --tw-skew-x: 0;
940
- --tw-skew-y: 0;
941
- --tw-scale-x: 1;
942
- --tw-scale-y: 1;
943
- --tw-pan-x: ;
944
- --tw-pan-y: ;
945
- --tw-pinch-zoom: ;
946
- --tw-scroll-snap-strictness: proximity;
947
- --tw-gradient-from-position: ;
948
- --tw-gradient-via-position: ;
949
- --tw-gradient-to-position: ;
950
- --tw-ordinal: ;
951
- --tw-slashed-zero: ;
952
- --tw-numeric-figure: ;
953
- --tw-numeric-spacing: ;
954
- --tw-numeric-fraction: ;
955
- --tw-ring-inset: ;
956
- --tw-ring-offset-width: 0px;
957
- --tw-ring-offset-color: #fff;
958
- --tw-ring-color: rgb(59 130 246 / 0.5);
959
- --tw-ring-offset-shadow: 0 0 #0000;
960
- --tw-ring-shadow: 0 0 #0000;
961
- --tw-shadow: 0 0 #0000;
962
- --tw-shadow-colored: 0 0 #0000;
963
- --tw-blur: ;
964
- --tw-brightness: ;
965
- --tw-contrast: ;
966
- --tw-grayscale: ;
967
- --tw-hue-rotate: ;
968
- --tw-invert: ;
969
- --tw-saturate: ;
970
- --tw-sepia: ;
971
- --tw-drop-shadow: ;
972
- --tw-backdrop-blur: ;
973
- --tw-backdrop-brightness: ;
974
- --tw-backdrop-contrast: ;
975
- --tw-backdrop-grayscale: ;
976
- --tw-backdrop-hue-rotate: ;
977
- --tw-backdrop-invert: ;
978
- --tw-backdrop-opacity: ;
979
- --tw-backdrop-saturate: ;
980
- --tw-backdrop-sepia: ;
981
- --tw-contain-size: ;
982
- --tw-contain-layout: ;
983
- --tw-contain-paint: ;
984
- --tw-contain-style: ;
985
- }
986
984
  .container {
987
985
  width: 100%;
988
986
  }
@@ -3036,9 +3034,6 @@ input.tab:checked + .tab-content,
3036
3034
  .w-32 {
3037
3035
  width: 8rem;
3038
3036
  }
3039
- .w-44 {
3040
- width: 11rem;
3041
- }
3042
3037
  .w-64 {
3043
3038
  width: 16rem;
3044
3039
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genspectrum/dashboard-components",
3
- "version": "0.6.15",
3
+ "version": "0.6.17",
4
4
  "description": "GenSpectrum web components for building dashboards",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-only",
@@ -112,9 +112,9 @@
112
112
  "storybook": "^8.0.9",
113
113
  "storybook-addon-fetch-mock": "^2.0.0",
114
114
  "tailwindcss": "^3.4.3",
115
- "typescript": "~5.5.2",
115
+ "typescript": "~5.6.2",
116
116
  "vite": "^5.2.10",
117
- "vite-plugin-dts": "^3.8.3",
117
+ "vite-plugin-dts": "^4.0.3",
118
118
  "vitest": "^2.0.1"
119
119
  }
120
120
  }
@@ -61,8 +61,8 @@ export const FiresEvent: StoryObj = {
61
61
  canvasElement.addEventListener('gs-error', listenerMock);
62
62
 
63
63
  await waitFor(() => {
64
- expect(listenerMock.mock.calls.at(-1)[0].error.name).toStrictEqual('UserFacingError');
65
- expect(listenerMock.mock.calls.at(-1)[0].error.message).toStrictEqual('some message');
64
+ expect(listenerMock.mock.calls.at(-1)![0].error.name).toStrictEqual('UserFacingError');
65
+ expect(listenerMock.mock.calls.at(-1)![0].error.message).toStrictEqual('some message');
66
66
  });
67
67
  },
68
68
  };
@@ -17,7 +17,8 @@ export default meta;
17
17
  const WrapperWithState: FunctionComponent<{
18
18
  setMinProportion: (value: number) => void;
19
19
  setMaxProportion: (value: number) => void;
20
- }> = ({ setMinProportion, setMaxProportion }) => {
20
+ labelPrefix?: string;
21
+ }> = ({ setMinProportion, setMaxProportion, labelPrefix }) => {
21
22
  const [proportionInterval, setProportionInterval] = useState({ min: 0.05, max: 1 });
22
23
 
23
24
  return (
@@ -31,24 +32,32 @@ const WrapperWithState: FunctionComponent<{
31
32
  setProportionInterval({ ...proportionInterval, max: value });
32
33
  setMaxProportion(value);
33
34
  }}
35
+ labelPrefix={labelPrefix}
34
36
  />
35
37
  );
36
38
  };
37
39
 
38
40
  export const ProportionSelectorStory: StoryObj<ProportionSelectorDropdownProps> = {
39
41
  render: (args) => {
40
- return <WrapperWithState setMinProportion={args.setMinProportion} setMaxProportion={args.setMaxProportion} />;
42
+ return (
43
+ <WrapperWithState
44
+ setMinProportion={args.setMinProportion}
45
+ setMaxProportion={args.setMaxProportion}
46
+ labelPrefix={args.labelPrefix}
47
+ />
48
+ );
41
49
  },
42
50
  args: {
43
51
  setMinProportion: fn(),
44
52
  setMaxProportion: fn(),
53
+ labelPrefix: 'TestPrefix',
45
54
  },
46
55
  play: async ({ canvasElement, step, args }) => {
47
56
  const canvas = within(canvasElement);
48
57
 
49
58
  await step('Expect initial proportion to show on the button', async () => {
50
59
  const button = canvas.getByRole('button');
51
- await expect(button).toHaveTextContent('Proportion 5.0% - 100.0%');
60
+ await expect(button).toHaveTextContent('TestPrefix 5.0% - 100.0%');
52
61
  });
53
62
 
54
63
  await step('Change min proportion and expect it to show on the button', async () => {
@@ -59,7 +68,7 @@ export const ProportionSelectorStory: StoryObj<ProportionSelectorDropdownProps>
59
68
  await userEvent.clear(minInput);
60
69
  await userEvent.type(minInput, '10');
61
70
 
62
- await waitFor(() => expect(button).toHaveTextContent('Proportion 10.0% - 100.0%'));
71
+ await waitFor(() => expect(button).toHaveTextContent('TestPrefix 10.0% - 100.0%'));
63
72
  await expect(args.setMinProportion).toHaveBeenCalledWith(0.1);
64
73
  });
65
74
  },
@@ -3,18 +3,21 @@ import { type FunctionComponent } from 'preact';
3
3
  import { Dropdown } from './dropdown';
4
4
  import { ProportionSelector, type ProportionSelectorProps } from './proportion-selector';
5
5
 
6
- export type ProportionSelectorDropdownProps = ProportionSelectorProps;
6
+ export type ProportionSelectorDropdownProps = ProportionSelectorProps & { labelPrefix?: string };
7
7
 
8
8
  export const ProportionSelectorDropdown: FunctionComponent<ProportionSelectorDropdownProps> = ({
9
9
  proportionInterval,
10
10
  setMinProportion,
11
11
  setMaxProportion,
12
+ labelPrefix = 'Proportion',
12
13
  }) => {
13
- const label = `${(proportionInterval.min * 100).toFixed(1)}% - ${(proportionInterval.max * 100).toFixed(1)}%`;
14
+ const percentLabel = `${(proportionInterval.min * 100).toFixed(1)}% - ${(proportionInterval.max * 100).toFixed(1)}%`;
15
+
16
+ const width = 'w-[calc(1.5 * var(--tw-space-x-reverse) + 1.5 * var(--tw-space-x))]';
14
17
 
15
18
  return (
16
- <div className='w-44'>
17
- <Dropdown buttonTitle={`Proportion ${label}`} placement={'bottom-start'}>
19
+ <div className={width}>
20
+ <Dropdown buttonTitle={`${labelPrefix} ${percentLabel}`} placement={'bottom-start'}>
18
21
  <ProportionSelector
19
22
  proportionInterval={proportionInterval}
20
23
  setMinProportion={setMinProportion}
@@ -204,6 +204,7 @@ const Toolbar: FunctionComponent<ToolbarProps> = ({
204
204
  proportionInterval={proportionInterval}
205
205
  setMinProportion={(min) => setProportionInterval((prev) => ({ ...prev, min }))}
206
206
  setMaxProportion={(max) => setProportionInterval((prev) => ({ ...prev, max }))}
207
+ labelPrefix='Mean proportion'
207
208
  />
208
209
  <CsvDownloadButton
209
210
  className='mx-1 btn btn-xs'
@@ -2,6 +2,7 @@ import { provide } from '@lit/context';
2
2
  import { Task } from '@lit/task';
3
3
  import { html, LitElement } from 'lit';
4
4
  import { customElement, property } from 'lit/decorators.js';
5
+ import { type DetailedHTMLProps, type HTMLAttributes } from 'react';
5
6
 
6
7
  import { lapisContext } from './lapis-context';
7
8
  import { referenceGenomeContext } from './reference-genome-context';
@@ -74,3 +75,12 @@ declare global {
74
75
  'gs-app': App;
75
76
  }
76
77
  }
78
+
79
+ declare global {
80
+ // eslint-disable-next-line @typescript-eslint/no-namespace
81
+ namespace JSX {
82
+ interface IntrinsicElements {
83
+ 'gs-app': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
84
+ }
85
+ }
86
+ }
@@ -1,4 +1,5 @@
1
1
  import { customElement, property } from 'lit/decorators.js';
2
+ import { type DetailedHTMLProps, type HTMLAttributes } from 'react';
2
3
 
3
4
  import { DateRangeSelector, type DateRangeSelectorProps } from '../../preact/dateRangeSelector/date-range-selector';
4
5
  import { type Equals, type Expect } from '../../utils/typeAssertions';
@@ -126,6 +127,15 @@ declare global {
126
127
  }
127
128
  }
128
129
 
130
+ declare global {
131
+ // eslint-disable-next-line @typescript-eslint/no-namespace
132
+ namespace JSX {
133
+ interface IntrinsicElements {
134
+ 'gs-date-range-selector': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
135
+ }
136
+ }
137
+ }
138
+
129
139
  /* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
130
140
  type CustomSelectOptionsMatches = Expect<
131
141
  Equals<
@@ -99,7 +99,7 @@ export const FiresEvent: StoryObj<Required<LineageFilterProps>> = {
99
99
 
100
100
  await step('Empty input', async () => {
101
101
  await userEvent.type(inputField(), '{backspace>9/}');
102
- await expect(listenerMock.mock.calls.at(-1)[0].detail).toStrictEqual({
102
+ await expect(listenerMock.mock.calls.at(-1)![0].detail).toStrictEqual({
103
103
  pangoLineage: undefined,
104
104
  });
105
105
  });
@@ -1,4 +1,5 @@
1
1
  import { customElement, property } from 'lit/decorators.js';
2
+ import { type DetailedHTMLProps, type HTMLAttributes } from 'react';
2
3
 
3
4
  import { LineageFilter, type LineageFilterProps } from '../../preact/lineageFilter/lineage-filter';
4
5
  import type { Equals, Expect } from '../../utils/typeAssertions';
@@ -79,6 +80,15 @@ declare global {
79
80
  }
80
81
  }
81
82
 
83
+ declare global {
84
+ // eslint-disable-next-line @typescript-eslint/no-namespace
85
+ namespace JSX {
86
+ interface IntrinsicElements {
87
+ 'gs-lineage-filter': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>;
88
+ }
89
+ }
90
+ }
91
+
82
92
  /* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */
83
93
  type InitialValueMatches = Expect<
84
94
  Equals<typeof LineageFilterComponent.prototype.initialValue, LineageFilterProps['initialValue']>