@genspectrum/dashboard-components 0.3.2 → 0.4.1

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 (35) hide show
  1. package/custom-elements.json +45 -26
  2. package/dist/dashboard-components.js +518 -434
  3. package/dist/dashboard-components.js.map +1 -1
  4. package/dist/genspectrum-components.d.ts +21 -12
  5. package/dist/style.css +150 -229
  6. package/package.json +3 -1
  7. package/src/preact/aggregatedData/aggregate.tsx +1 -1
  8. package/src/preact/components/SegmentSelector.tsx +0 -1
  9. package/src/preact/components/checkbox-selector.tsx +7 -9
  10. package/src/preact/components/dropdown.tsx +40 -0
  11. package/src/preact/components/info.stories.tsx +8 -8
  12. package/src/preact/components/info.tsx +38 -19
  13. package/src/preact/components/mutation-type-selector.tsx +0 -1
  14. package/src/preact/components/proportion-selector-dropdown.tsx +9 -18
  15. package/src/preact/components/tabs.tsx +12 -3
  16. package/src/preact/dateRangeSelector/computeInitialValues.spec.ts +99 -0
  17. package/src/preact/dateRangeSelector/computeInitialValues.ts +73 -0
  18. package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +93 -4
  19. package/src/preact/dateRangeSelector/date-range-selector.tsx +49 -106
  20. package/src/preact/dateRangeSelector/selectableOptions.ts +79 -0
  21. package/src/preact/locationFilter/location-filter.tsx +1 -1
  22. package/src/preact/mutationComparison/mutation-comparison.tsx +3 -3
  23. package/src/preact/mutationFilter/mutation-filter.stories.tsx +3 -6
  24. package/src/preact/mutationFilter/mutation-filter.tsx +48 -54
  25. package/src/preact/mutations/mutations.tsx +3 -4
  26. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +3 -5
  27. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +3 -3
  28. package/src/preact/shared/floating-ui/hooks.ts +83 -0
  29. package/src/web-components/input/gs-date-range-selector.stories.ts +11 -5
  30. package/src/web-components/input/gs-date-range-selector.tsx +22 -5
  31. package/src/web-components/input/gs-location-filter.stories.ts +6 -7
  32. package/src/web-components/input/gs-location-filter.tsx +3 -2
  33. package/src/web-components/input/gs-mutation-filter.stories.ts +1 -8
  34. package/src/web-components/input/gs-mutation-filter.tsx +1 -9
  35. package/src/web-components/visualization/gs-prevalence-over-time.tsx +1 -1
@@ -139,8 +139,22 @@ export declare class DateRangeSelectorComponent extends PreactLitAdapter {
139
139
  * Must be a valid label from the preset labels or a `label` given in the `customSelectOptions`.
140
140
  *
141
141
  * If the value is invalid, the component will default to `'last6Months'`.
142
+ *
143
+ * It will be overwritten if `initialDateFrom` or `initialDateTo` is set.
142
144
  */
143
145
  initialValue: 'custom' | 'allTimes' | 'last2Weeks' | 'lastMonth' | 'last2Months' | 'last3Months' | 'last6Months' | string;
146
+ /**
147
+ * A date string in the format `YYYY-MM-DD`.
148
+ * If set, the date range selector will be initialized with the given date (overwriting `initialValue` to `custom`).
149
+ * If `initialDateTo` is set, but this is unset, it will default to `earliestDate`.
150
+ */
151
+ initialDateFrom: string;
152
+ /**
153
+ * A date string in the format `YYYY-MM-DD`.
154
+ * If set, the date range selector will be initialized with the given date (overwriting `initialValue` to `custom`).
155
+ * If `initialDateFrom` is set, but this is unset, it will default to the current date.
156
+ */
157
+ initialDateTo: string;
144
158
  /**
145
159
  * The width of the component.
146
160
  *
@@ -173,13 +187,14 @@ declare type LapisFilter = Record<string, string | number | null | boolean>;
173
187
  * @fires {CustomEvent<Record<string, string>>} gs-location-changed
174
188
  * Fired when a value from the datalist is selected or when a valid value is typed into the field.
175
189
  * The `details` of this event contain an object with all `fields` as keys
176
- * and the corresponding values as values, if they are not `undefined`.
190
+ * and the corresponding values as values, even if they are `undefined`.
177
191
  * Example:
178
192
  * ```
179
193
  * {
180
194
  * continent: "Asia",
181
195
  * country: "China",
182
- * city: "Beijing"
196
+ * city: "Beijing",
197
+ * district: undefined,
183
198
  * }
184
199
  * ```
185
200
  */
@@ -347,12 +362,6 @@ export declare class MutationFilterComponent extends PreactLitAdapter {
347
362
  * Visit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.
348
363
  */
349
364
  width: string;
350
- /**
351
- * The height of the component.
352
- *
353
- * Visit https://genspectrum.github.io/dashboards/?path=/docs/components-size-of-components--docs for more information.
354
- */
355
- height: string;
356
365
  render(): JSX_2.Element;
357
366
  }
358
367
 
@@ -758,20 +767,20 @@ declare global {
758
767
 
759
768
  declare global {
760
769
  interface HTMLElementTagNameMap {
761
- 'gs-location-filter': LocationFilterComponent;
770
+ 'gs-text-input': TextInputComponent;
762
771
  }
763
772
  interface HTMLElementEventMap {
764
- 'gs-location-changed': CustomEvent<Record<string, string>>;
773
+ 'gs-text-input-changed': CustomEvent<Record<string, string>>;
765
774
  }
766
775
  }
767
776
 
768
777
 
769
778
  declare global {
770
779
  interface HTMLElementTagNameMap {
771
- 'gs-text-input': TextInputComponent;
780
+ 'gs-location-filter': LocationFilterComponent;
772
781
  }
773
782
  interface HTMLElementEventMap {
774
- 'gs-text-input-changed': CustomEvent<Record<string, string>>;
783
+ 'gs-location-changed': CustomEvent<Record<string, string>>;
775
784
  }
776
785
  }
777
786
 
package/dist/style.css CHANGED
@@ -1016,15 +1016,6 @@ html {
1016
1016
  color: var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));
1017
1017
  }
1018
1018
 
1019
- .menu li > *:not(ul, .menu-title, details, .btn):active,
1020
- .menu li > *:not(ul, .menu-title, details, .btn).active,
1021
- .menu li > details > summary:active {
1022
- --tw-bg-opacity: 1;
1023
- background-color: var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));
1024
- --tw-text-opacity: 1;
1025
- color: var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity)));
1026
- }
1027
-
1028
1019
  .tab:hover {
1029
1020
  --tw-text-opacity: 1;
1030
1021
  }
@@ -1143,39 +1134,6 @@ html {
1143
1134
  transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
1144
1135
  transition-duration: 200ms;
1145
1136
  }
1146
- .dropdown-end .dropdown-content {
1147
- inset-inline-end: 0px;
1148
- }
1149
- .dropdown-left .dropdown-content {
1150
- bottom: auto;
1151
- inset-inline-end: 100%;
1152
- top: 0px;
1153
- transform-origin: right;
1154
- }
1155
- .dropdown-right .dropdown-content {
1156
- bottom: auto;
1157
- inset-inline-start: 100%;
1158
- top: 0px;
1159
- transform-origin: left;
1160
- }
1161
- .dropdown-bottom .dropdown-content {
1162
- bottom: auto;
1163
- top: 100%;
1164
- transform-origin: top;
1165
- }
1166
- .dropdown-top .dropdown-content {
1167
- bottom: 100%;
1168
- top: auto;
1169
- transform-origin: bottom;
1170
- }
1171
- .dropdown-end.dropdown-right .dropdown-content {
1172
- bottom: 0px;
1173
- top: auto;
1174
- }
1175
- .dropdown-end.dropdown-left .dropdown-content {
1176
- bottom: 0px;
1177
- top: auto;
1178
- }
1179
1137
  .dropdown.dropdown-open .dropdown-content,
1180
1138
  .dropdown:not(.dropdown-hover):focus .dropdown-content,
1181
1139
  .dropdown:focus-within .dropdown-content {
@@ -1270,19 +1228,6 @@ html {
1270
1228
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1271
1229
  }
1272
1230
 
1273
- :where(.menu li:not(.menu-title, .disabled) > *:not(ul, details, .menu-title)):not(.active, .btn):hover, :where(.menu li:not(.menu-title, .disabled) > details > summary:not(.menu-title)):not(.active, .btn):hover {
1274
- cursor: pointer;
1275
- outline: 2px solid transparent;
1276
- outline-offset: 2px;
1277
- }
1278
-
1279
- @supports (color: oklch(0% 0 0)) {
1280
-
1281
- :where(.menu li:not(.menu-title, .disabled) > *:not(ul, details, .menu-title)):not(.active, .btn):hover, :where(.menu li:not(.menu-title, .disabled) > details > summary:not(.menu-title)):not(.active, .btn):hover {
1282
- background-color: var(--fallback-bc,oklch(var(--bc)/0.1));
1283
- }
1284
- }
1285
-
1286
1231
  .tab[disabled],
1287
1232
  .tab[disabled]:hover {
1288
1233
  cursor: not-allowed;
@@ -1409,31 +1354,6 @@ html {
1409
1354
  border-radius: inherit;
1410
1355
  }
1411
1356
  }
1412
- .menu {
1413
- display: flex;
1414
- flex-direction: column;
1415
- flex-wrap: wrap;
1416
- font-size: 0.875rem;
1417
- line-height: 1.25rem;
1418
- padding: 0.5rem;
1419
- }
1420
- .menu :where(li ul) {
1421
- position: relative;
1422
- white-space: nowrap;
1423
- margin-inline-start: 1rem;
1424
- padding-inline-start: 0.5rem;
1425
- }
1426
- .menu :where(li:not(.menu-title) > *:not(ul, details, .menu-title, .btn)), .menu :where(li:not(.menu-title) > details > summary:not(.menu-title)) {
1427
- display: grid;
1428
- grid-auto-flow: column;
1429
- align-content: flex-start;
1430
- align-items: center;
1431
- gap: 0.5rem;
1432
- grid-auto-columns: minmax(auto, max-content) auto max-content;
1433
- -webkit-user-select: none;
1434
- -moz-user-select: none;
1435
- user-select: none;
1436
- }
1437
1357
  .menu li.disabled {
1438
1358
  cursor: not-allowed;
1439
1359
  -webkit-user-select: none;
@@ -1441,20 +1361,6 @@ html {
1441
1361
  user-select: none;
1442
1362
  color: var(--fallback-bc,oklch(var(--bc)/0.3));
1443
1363
  }
1444
- .menu :where(li > .menu-dropdown:not(.menu-dropdown-show)) {
1445
- display: none;
1446
- }
1447
- :where(.menu li) {
1448
- position: relative;
1449
- display: flex;
1450
- flex-shrink: 0;
1451
- flex-direction: column;
1452
- flex-wrap: wrap;
1453
- align-items: stretch;
1454
- }
1455
- :where(.menu li) .badge {
1456
- justify-self: end;
1457
- }
1458
1364
  .modal {
1459
1365
  pointer-events: none;
1460
1366
  position: fixed;
@@ -1678,6 +1584,29 @@ input.tab:checked + .tab-content,
1678
1584
  --tw-bg-opacity: 1;
1679
1585
  background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
1680
1586
  }
1587
+ .toggle {
1588
+ flex-shrink: 0;
1589
+ --tglbg: var(--fallback-b1,oklch(var(--b1)/1));
1590
+ --handleoffset: 1.5rem;
1591
+ --handleoffsetcalculator: calc(var(--handleoffset) * -1);
1592
+ --togglehandleborder: 0 0;
1593
+ height: 1.5rem;
1594
+ width: 3rem;
1595
+ cursor: pointer;
1596
+ -webkit-appearance: none;
1597
+ -moz-appearance: none;
1598
+ appearance: none;
1599
+ border-radius: var(--rounded-badge, 1.9rem);
1600
+ border-width: 1px;
1601
+ border-color: currentColor;
1602
+ background-color: currentColor;
1603
+ color: var(--fallback-bc,oklch(var(--bc)/0.5));
1604
+ transition: background,
1605
+ box-shadow var(--animation-input, 0.2s) ease-out;
1606
+ box-shadow: var(--handleoffsetcalculator) 0 0 2px var(--tglbg) inset,
1607
+ 0 0 0 2px var(--tglbg) inset,
1608
+ var(--togglehandleborder);
1609
+ }
1681
1610
  .alert-error {
1682
1611
  border-color: var(--fallback-er,oklch(var(--er)/0.2));
1683
1612
  --tw-text-opacity: 1;
@@ -1911,9 +1840,6 @@ input.tab:checked + .tab-content,
1911
1840
  margin-bottom: 0px;
1912
1841
  margin-inline-start: -1px;
1913
1842
  }
1914
- .join-item:focus {
1915
- isolation: isolate;
1916
- }
1917
1843
  .loading {
1918
1844
  pointer-events: none;
1919
1845
  display: inline-block;
@@ -1936,40 +1862,6 @@ input.tab:checked + .tab-content,
1936
1862
  .loading-md {
1937
1863
  width: 1.5rem;
1938
1864
  }
1939
- :where(.menu li:empty) {
1940
- --tw-bg-opacity: 1;
1941
- background-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));
1942
- opacity: 0.1;
1943
- margin: 0.5rem 1rem;
1944
- height: 1px;
1945
- }
1946
- .menu :where(li ul):before {
1947
- position: absolute;
1948
- bottom: 0.75rem;
1949
- inset-inline-start: 0px;
1950
- top: 0.75rem;
1951
- width: 1px;
1952
- --tw-bg-opacity: 1;
1953
- background-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));
1954
- opacity: 0.1;
1955
- content: "";
1956
- }
1957
- .menu :where(li:not(.menu-title) > *:not(ul, details, .menu-title, .btn)),
1958
- .menu :where(li:not(.menu-title) > details > summary:not(.menu-title)) {
1959
- border-radius: var(--rounded-btn, 0.5rem);
1960
- padding-left: 1rem;
1961
- padding-right: 1rem;
1962
- padding-top: 0.5rem;
1963
- padding-bottom: 0.5rem;
1964
- text-align: start;
1965
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
1966
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
1967
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
1968
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
1969
- transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
1970
- transition-duration: 200ms;
1971
- text-wrap: balance;
1972
- }
1973
1865
  :where(.menu li:not(.menu-title, .disabled) > *:not(ul, details, .menu-title)):not(summary, .active, .btn).focus, :where(.menu li:not(.menu-title, .disabled) > *:not(ul, details, .menu-title)):not(summary, .active, .btn):focus, :where(.menu li:not(.menu-title, .disabled) > *:not(ul, details, .menu-title)):is(summary):not(.active, .btn):focus-visible, :where(.menu li:not(.menu-title, .disabled) > details > summary:not(.menu-title)):not(summary, .active, .btn).focus, :where(.menu li:not(.menu-title, .disabled) > details > summary:not(.menu-title)):not(summary, .active, .btn):focus, :where(.menu li:not(.menu-title, .disabled) > details > summary:not(.menu-title)):is(summary):not(.active, .btn):focus-visible {
1974
1866
  cursor: pointer;
1975
1867
  background-color: var(--fallback-bc,oklch(var(--bc)/0.1));
@@ -1978,38 +1870,6 @@ input.tab:checked + .tab-content,
1978
1870
  outline: 2px solid transparent;
1979
1871
  outline-offset: 2px;
1980
1872
  }
1981
- .menu li > *:not(ul, .menu-title, details, .btn):active,
1982
- .menu li > *:not(ul, .menu-title, details, .btn).active,
1983
- .menu li > details > summary:active {
1984
- --tw-bg-opacity: 1;
1985
- background-color: var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));
1986
- --tw-text-opacity: 1;
1987
- color: var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity)));
1988
- }
1989
- .menu :where(li > details > summary)::-webkit-details-marker {
1990
- display: none;
1991
- }
1992
- .menu :where(li > details > summary):after,
1993
- .menu :where(li > .menu-dropdown-toggle):after {
1994
- justify-self: end;
1995
- display: block;
1996
- margin-top: -0.5rem;
1997
- height: 0.5rem;
1998
- width: 0.5rem;
1999
- transform: rotate(45deg);
2000
- transition-property: transform, margin-top;
2001
- transition-duration: 0.3s;
2002
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
2003
- content: "";
2004
- transform-origin: 75% 75%;
2005
- box-shadow: 2px 2px;
2006
- pointer-events: none;
2007
- }
2008
- .menu :where(li > details[open] > summary):after,
2009
- .menu :where(li > .menu-dropdown-toggle.menu-dropdown-show):after {
2010
- transform: rotate(225deg);
2011
- margin-top: 0;
2012
- }
2013
1873
  .mockup-phone .display {
2014
1874
  overflow: hidden;
2015
1875
  border-radius: 40px;
@@ -2530,6 +2390,49 @@ input.tab:checked + .tab-content,
2530
2390
  opacity: 1;
2531
2391
  }
2532
2392
  }
2393
+ [dir="rtl"] .toggle {
2394
+ --handleoffsetcalculator: calc(var(--handleoffset) * 1);
2395
+ }
2396
+ .toggle:focus-visible {
2397
+ outline-style: solid;
2398
+ outline-width: 2px;
2399
+ outline-offset: 2px;
2400
+ outline-color: var(--fallback-bc,oklch(var(--bc)/0.2));
2401
+ }
2402
+ .toggle:hover {
2403
+ background-color: currentColor;
2404
+ }
2405
+ .toggle:checked,
2406
+ .toggle[aria-checked="true"] {
2407
+ background-image: none;
2408
+ --handleoffsetcalculator: var(--handleoffset);
2409
+ --tw-text-opacity: 1;
2410
+ color: var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));
2411
+ }
2412
+ [dir="rtl"] .toggle:checked, [dir="rtl"] .toggle[aria-checked="true"] {
2413
+ --handleoffsetcalculator: calc(var(--handleoffset) * -1);
2414
+ }
2415
+ .toggle:indeterminate {
2416
+ --tw-text-opacity: 1;
2417
+ color: var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));
2418
+ box-shadow: calc(var(--handleoffset) / 2) 0 0 2px var(--tglbg) inset,
2419
+ calc(var(--handleoffset) / -2) 0 0 2px var(--tglbg) inset,
2420
+ 0 0 0 2px var(--tglbg) inset;
2421
+ }
2422
+ [dir="rtl"] .toggle:indeterminate {
2423
+ box-shadow: calc(var(--handleoffset) / 2) 0 0 2px var(--tglbg) inset,
2424
+ calc(var(--handleoffset) / -2) 0 0 2px var(--tglbg) inset,
2425
+ 0 0 0 2px var(--tglbg) inset;
2426
+ }
2427
+ .toggle:disabled {
2428
+ cursor: not-allowed;
2429
+ --tw-border-opacity: 1;
2430
+ border-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-border-opacity)));
2431
+ background-color: transparent;
2432
+ opacity: 0.3;
2433
+ --togglehandleborder: 0 0 0 3px var(--fallback-bc,oklch(var(--bc)/1)) inset,
2434
+ var(--handleoffsetcalculator) 0 0 3px var(--fallback-bc,oklch(var(--bc)/1)) inset;
2435
+ }
2533
2436
  .btn-xs {
2534
2437
  height: 1.5rem;
2535
2438
  min-height: 1.5rem;
@@ -2853,23 +2756,32 @@ input.tab:checked + .tab-content,
2853
2756
  .relative {
2854
2757
  position: relative;
2855
2758
  }
2759
+ .-right-3 {
2760
+ right: -0.75rem;
2761
+ }
2762
+ .-top-3 {
2763
+ top: -0.75rem;
2764
+ }
2765
+ .left-0 {
2766
+ left: 0px;
2767
+ }
2856
2768
  .right-2 {
2857
2769
  right: 0.5rem;
2858
2770
  }
2859
- .right-6 {
2860
- right: 1.5rem;
2771
+ .top-0 {
2772
+ top: 0px;
2861
2773
  }
2862
2774
  .top-2 {
2863
2775
  top: 0.5rem;
2864
2776
  }
2865
- .top-8 {
2866
- top: 2rem;
2777
+ .z-10 {
2778
+ z-index: 10;
2867
2779
  }
2868
- .z-50 {
2869
- z-index: 50;
2780
+ .float-right {
2781
+ float: right;
2870
2782
  }
2871
- .z-\[1\] {
2872
- z-index: 1;
2783
+ .m-1 {
2784
+ margin: 0.25rem;
2873
2785
  }
2874
2786
  .m-2 {
2875
2787
  margin: 0.5rem;
@@ -2886,24 +2798,18 @@ input.tab:checked + .tab-content,
2886
2798
  margin-top: 1rem;
2887
2799
  margin-bottom: 1rem;
2888
2800
  }
2889
- .mb-1 {
2890
- margin-bottom: 0.25rem;
2891
- }
2892
2801
  .mb-2 {
2893
2802
  margin-bottom: 0.5rem;
2894
2803
  }
2895
- .me-1 {
2896
- margin-inline-end: 0.25rem;
2897
- }
2898
- .ml-2 {
2899
- margin-left: 0.5rem;
2900
- }
2901
- .mt-2 {
2902
- margin-top: 0.5rem;
2804
+ .mr-2 {
2805
+ margin-right: 0.5rem;
2903
2806
  }
2904
2807
  .mt-4 {
2905
2808
  margin-top: 1rem;
2906
2809
  }
2810
+ .inline-block {
2811
+ display: inline-block;
2812
+ }
2907
2813
  .inline {
2908
2814
  display: inline;
2909
2815
  }
@@ -2928,21 +2834,21 @@ input.tab:checked + .tab-content,
2928
2834
  .w-32 {
2929
2835
  width: 8rem;
2930
2836
  }
2837
+ .w-40 {
2838
+ width: 10rem;
2839
+ }
2931
2840
  .w-64 {
2932
2841
  width: 16rem;
2933
2842
  }
2934
- .w-72 {
2935
- width: 18rem;
2936
- }
2937
2843
  .w-full {
2938
2844
  width: 100%;
2939
2845
  }
2940
- .min-w-0 {
2941
- min-width: 0px;
2846
+ .w-max {
2847
+ width: -moz-max-content;
2848
+ width: max-content;
2942
2849
  }
2943
- .min-w-max {
2944
- min-width: -moz-max-content;
2945
- min-width: max-content;
2850
+ .min-w-40 {
2851
+ min-width: 10rem;
2946
2852
  }
2947
2853
  .max-w-screen-lg {
2948
2854
  max-width: 1024px;
@@ -2950,9 +2856,15 @@ input.tab:checked + .tab-content,
2950
2856
  .flex-1 {
2951
2857
  flex: 1 1 0%;
2952
2858
  }
2859
+ .flex-grow {
2860
+ flex-grow: 1;
2861
+ }
2953
2862
  .grow {
2954
2863
  flex-grow: 1;
2955
2864
  }
2865
+ .resize {
2866
+ resize: both;
2867
+ }
2956
2868
  .flex-row {
2957
2869
  flex-direction: row;
2958
2870
  }
@@ -2962,50 +2874,35 @@ input.tab:checked + .tab-content,
2962
2874
  .flex-wrap {
2963
2875
  flex-wrap: wrap;
2964
2876
  }
2965
- .flex-nowrap {
2966
- flex-wrap: nowrap;
2967
- }
2968
2877
  .items-center {
2969
2878
  align-items: center;
2970
2879
  }
2971
- .justify-end {
2972
- justify-content: flex-end;
2973
- }
2974
2880
  .justify-center {
2975
2881
  justify-content: center;
2976
2882
  }
2977
2883
  .justify-between {
2978
2884
  justify-content: space-between;
2979
2885
  }
2980
- .gap-1 {
2981
- gap: 0.25rem;
2982
- }
2983
2886
  .gap-2 {
2984
2887
  gap: 0.5rem;
2985
2888
  }
2889
+ .gap-y-1 {
2890
+ row-gap: 0.25rem;
2891
+ }
2986
2892
  .overflow-auto {
2987
2893
  overflow: auto;
2988
2894
  }
2989
- .overflow-scroll {
2990
- overflow: scroll;
2895
+ .overflow-y-auto {
2896
+ overflow-y: auto;
2991
2897
  }
2992
2898
  .whitespace-nowrap {
2993
2899
  white-space: nowrap;
2994
2900
  }
2995
- .text-nowrap {
2996
- text-wrap: nowrap;
2997
- }
2998
2901
  .break-words {
2999
2902
  overflow-wrap: break-word;
3000
2903
  }
3001
- .rounded {
3002
- border-radius: 0.25rem;
3003
- }
3004
- .rounded-box {
3005
- border-radius: var(--rounded-box, 1rem);
3006
- }
3007
- .rounded-lg {
3008
- border-radius: 0.5rem;
2904
+ .rounded-full {
2905
+ border-radius: 9999px;
3009
2906
  }
3010
2907
  .rounded-md {
3011
2908
  border-radius: 0.375rem;
@@ -3032,9 +2929,11 @@ input.tab:checked + .tab-content,
3032
2929
  .border-b-2 {
3033
2930
  border-bottom-width: 2px;
3034
2931
  }
3035
- .border-black {
3036
- --tw-border-opacity: 1;
3037
- border-color: rgb(0 0 0 / var(--tw-border-opacity));
2932
+ .border-solid {
2933
+ border-style: solid;
2934
+ }
2935
+ .border-none {
2936
+ border-style: none;
3038
2937
  }
3039
2938
  .border-error {
3040
2939
  --tw-border-opacity: 1;
@@ -3044,6 +2943,10 @@ input.tab:checked + .tab-content,
3044
2943
  --tw-border-opacity: 1;
3045
2944
  border-color: rgb(243 244 246 / var(--tw-border-opacity));
3046
2945
  }
2946
+ .border-gray-200 {
2947
+ --tw-border-opacity: 1;
2948
+ border-color: rgb(229 231 235 / var(--tw-border-opacity));
2949
+ }
3047
2950
  .border-gray-300 {
3048
2951
  --tw-border-opacity: 1;
3049
2952
  border-color: rgb(209 213 219 / var(--tw-border-opacity));
@@ -3052,9 +2955,9 @@ input.tab:checked + .tab-content,
3052
2955
  --tw-border-opacity: 1;
3053
2956
  border-color: rgb(156 163 175 / var(--tw-border-opacity));
3054
2957
  }
3055
- .bg-base-100 {
3056
- --tw-bg-opacity: 1;
3057
- background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
2958
+ .border-red-500 {
2959
+ --tw-border-opacity: 1;
2960
+ border-color: rgb(239 68 68 / var(--tw-border-opacity));
3058
2961
  }
3059
2962
  .bg-base-200 {
3060
2963
  --tw-bg-opacity: 1;
@@ -3064,28 +2967,26 @@ input.tab:checked + .tab-content,
3064
2967
  --tw-bg-opacity: 1;
3065
2968
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
3066
2969
  }
2970
+ .p-1 {
2971
+ padding: 0.25rem;
2972
+ }
3067
2973
  .p-2 {
3068
2974
  padding: 0.5rem;
3069
2975
  }
2976
+ .p-4 {
2977
+ padding: 1rem;
2978
+ }
3070
2979
  .px-2 {
3071
2980
  padding-left: 0.5rem;
3072
2981
  padding-right: 0.5rem;
3073
2982
  }
3074
- .px-2\.5 {
3075
- padding-left: 0.625rem;
3076
- padding-right: 0.625rem;
3077
- }
3078
2983
  .px-4 {
3079
2984
  padding-left: 1rem;
3080
2985
  padding-right: 1rem;
3081
2986
  }
3082
- .py-0 {
3083
- padding-top: 0px;
3084
- padding-bottom: 0px;
3085
- }
3086
- .py-0\.5 {
3087
- padding-top: 0.125rem;
3088
- padding-bottom: 0.125rem;
2987
+ .py-1 {
2988
+ padding-top: 0.25rem;
2989
+ padding-bottom: 0.25rem;
3089
2990
  }
3090
2991
  .py-16 {
3091
2992
  padding-top: 4rem;
@@ -3146,6 +3047,9 @@ input.tab:checked + .tab-content,
3146
3047
  .underline {
3147
3048
  text-decoration-line: underline;
3148
3049
  }
3050
+ .opacity-90 {
3051
+ opacity: 0.9;
3052
+ }
3149
3053
  .shadow {
3150
3054
  --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
3151
3055
  --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
@@ -3171,10 +3075,18 @@ input.tab:checked + .tab-content,
3171
3075
  .duration-150 {
3172
3076
  transition-duration: 150ms;
3173
3077
  }
3078
+ .focus-within\:border-gray-400:focus-within {
3079
+ --tw-border-opacity: 1;
3080
+ border-color: rgb(156 163 175 / var(--tw-border-opacity));
3081
+ }
3174
3082
  .hover\:bg-gray-100:hover {
3175
3083
  --tw-bg-opacity: 1;
3176
3084
  background-color: rgb(243 244 246 / var(--tw-bg-opacity));
3177
3085
  }
3086
+ .hover\:text-blue-700:hover {
3087
+ --tw-text-opacity: 1;
3088
+ color: rgb(29 78 216 / var(--tw-text-opacity));
3089
+ }
3178
3090
  .hover\:text-blue-800:hover {
3179
3091
  --tw-text-opacity: 1;
3180
3092
  color: rgb(30 64 175 / var(--tw-text-opacity));
@@ -3186,6 +3098,15 @@ input.tab:checked + .tab-content,
3186
3098
  .hover\:text-gray-700:hover {
3187
3099
  --tw-text-opacity: 1;
3188
3100
  color: rgb(55 65 81 / var(--tw-text-opacity));
3101
+ }
3102
+ .focus\:outline-none:focus {
3103
+ outline: 2px solid transparent;
3104
+ outline-offset: 2px;
3105
+ }
3106
+ .focus\:ring-0:focus {
3107
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
3108
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
3109
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
3189
3110
  }.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08)}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1);animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none !important;box-shadow:none !important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:'';height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9)}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{/*
3190
3111
  /*rtl:begin:ignore*/left:0/*
3191
3112
  /*rtl:end:ignore*/}/*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genspectrum/dashboard-components",
3
- "version": "0.3.2",
3
+ "version": "0.4.1",
4
4
  "description": "GenSpectrum web components for building dashboards",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-only",
@@ -56,6 +56,8 @@
56
56
  "lit"
57
57
  ],
58
58
  "dependencies": {
59
+ "@floating-ui/dom": "^1.6.5",
60
+ "@floating-ui/utils": "^0.2.2",
59
61
  "@lit/context": "^1.1.1",
60
62
  "@lit/reactive-element": "^2.0.4",
61
63
  "@lit/task": "^1.0.0",
@@ -103,7 +103,7 @@ const Toolbar: FunctionComponent<ToolbarProps> = ({ data }) => {
103
103
  return (
104
104
  <div class='flex flex-row'>
105
105
  <CsvDownloadButton className='mx-1 btn btn-xs' getData={() => data} filename='aggregate.csv' />
106
- <Info>Info for aggregate</Info>
106
+ <Info height={'100px'}>Info for aggregate</Info>
107
107
  </div>
108
108
  );
109
109
  };
@@ -41,7 +41,6 @@ export const SegmentSelector: FunctionComponent<SegmentSelectorProps> = ({
41
41
 
42
42
  return (
43
43
  <CheckboxSelector
44
- className='mx-1'
45
44
  items={displayedSegments}
46
45
  label={getSegmentSelectorLabel(displayedSegments, prefix || 'Segments: ')}
47
46
  setItems={(items) => setDisplayedSegments(items)}