@genspectrum/dashboard-components 0.4.0 → 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.
@@ -6,7 +6,7 @@ import { options, createContext as createContext$1, Fragment, render } from "pre
6
6
  import { Grid } from "gridjs";
7
7
  import { Chart, registerables, Scale } from "chart.js";
8
8
  import { VennDiagramController, ArcSlice, extractSets } from "chartjs-chart-venn";
9
- import { autoUpdate, computePosition, offset, shift, size } from "@floating-ui/dom";
9
+ import { autoUpdate, computePosition, offset, shift, flip, size } from "@floating-ui/dom";
10
10
  import { ReactiveElement } from "@lit/reactive-element";
11
11
  import { BarWithErrorBarsController, BarWithErrorBar } from "chartjs-chart-error-bars";
12
12
  import flatpickr from "flatpickr";
@@ -1172,32 +1172,98 @@ function filterMutationData(data, displayedSegments, displayedMutationTypes) {
1172
1172
  }));
1173
1173
  }
1174
1174
  const LapisUrlContext = createContext$1("");
1175
+ function useFloatingUi(referenceRef, floatingRef, middleware, placement) {
1176
+ const cleanupRef = F(null);
1177
+ _(() => {
1178
+ if (!referenceRef.current || !floatingRef.current) {
1179
+ return;
1180
+ }
1181
+ const { current: reference } = referenceRef;
1182
+ const { current: floating } = floatingRef;
1183
+ const update = () => {
1184
+ computePosition(reference, floating, {
1185
+ placement,
1186
+ middleware
1187
+ }).then(({ x, y: y2 }) => {
1188
+ floating.style.left = `${x}px`;
1189
+ floating.style.top = `${y2}px`;
1190
+ });
1191
+ };
1192
+ update();
1193
+ cleanupRef.current = autoUpdate(reference, floating, update);
1194
+ return () => {
1195
+ if (cleanupRef.current) {
1196
+ cleanupRef.current();
1197
+ }
1198
+ };
1199
+ }, [placement, middleware, referenceRef, floatingRef]);
1200
+ }
1201
+ function useCloseOnClickOutside(floatingRef, referenceRef, setShowContent) {
1202
+ _(() => {
1203
+ const handleClickOutside = (event) => {
1204
+ const path = event.composedPath();
1205
+ if (floatingRef.current && !path.includes(floatingRef.current) && referenceRef.current && !path.includes(referenceRef.current)) {
1206
+ setShowContent(false);
1207
+ }
1208
+ };
1209
+ document.addEventListener("mousedown", handleClickOutside);
1210
+ return () => {
1211
+ document.removeEventListener("mousedown", handleClickOutside);
1212
+ };
1213
+ }, [floatingRef, referenceRef, setShowContent]);
1214
+ }
1215
+ function useCloseOnEsc(setShowHelp) {
1216
+ _(() => {
1217
+ const handleKeyDown = (event) => {
1218
+ if (event.key === "Escape") {
1219
+ setShowHelp(false);
1220
+ }
1221
+ };
1222
+ document.addEventListener("keydown", handleKeyDown);
1223
+ return () => {
1224
+ document.removeEventListener("keydown", handleKeyDown);
1225
+ };
1226
+ }, [setShowHelp]);
1227
+ }
1228
+ const dropdownClass = "z-10 absolute w-max top-0 left-0 bg-white p-4 border border-gray-200 shadow-lg rounded-md";
1229
+ const Dropdown = ({ children, buttonTitle, placement }) => {
1230
+ const [showContent, setShowContent] = p(false);
1231
+ const referenceRef = F(null);
1232
+ const floatingRef = F(null);
1233
+ useFloatingUi(referenceRef, floatingRef, [offset(4), shift(), flip()], placement);
1234
+ useCloseOnClickOutside(floatingRef, referenceRef, setShowContent);
1235
+ useCloseOnEsc(setShowContent);
1236
+ const toggle = () => {
1237
+ setShowContent(!showContent);
1238
+ };
1239
+ return /* @__PURE__ */ u$1("div", { children: [
1240
+ /* @__PURE__ */ u$1("button", { type: "button", className: "btn btn-xs whitespace-nowrap", onClick: toggle, ref: referenceRef, children: buttonTitle }),
1241
+ /* @__PURE__ */ u$1("div", { ref: floatingRef, className: `${dropdownClass} ${showContent ? "" : "hidden"}`, children })
1242
+ ] });
1243
+ };
1175
1244
  const CheckboxSelector = ({
1176
- className,
1177
1245
  items,
1178
1246
  label,
1179
1247
  setItems
1180
1248
  }) => {
1181
- return /* @__PURE__ */ u$1("div", { class: `dropdown ${className}`, children: [
1182
- /* @__PURE__ */ u$1("div", { tabIndex: 0, role: "button", class: "btn btn-xs text-nowrap", children: label }),
1183
- /* @__PURE__ */ u$1("ul", { tabIndex: 0, class: "p-2 shadow menu dropdown-content z-[1] bg-base-100 rounded-box", children: items.map((item, index) => /* @__PURE__ */ u$1("li", { class: "flex flex-row items-center", children: /* @__PURE__ */ u$1("label", { children: [
1184
- /* @__PURE__ */ u$1(
1185
- "input",
1186
- {
1187
- type: "checkbox",
1188
- id: `item-${index}`,
1189
- checked: item.checked,
1190
- onChange: () => {
1191
- const newItems = items.map(
1192
- (item2, i2) => i2 === index ? { ...item2, checked: !item2.checked } : item2
1193
- );
1194
- setItems(newItems);
1195
- }
1249
+ return /* @__PURE__ */ u$1(Dropdown, { buttonTitle: label, placement: "bottom-start", children: /* @__PURE__ */ u$1("ul", { children: items.map((item, index) => /* @__PURE__ */ u$1("li", { className: "flex flex-row items-center", children: /* @__PURE__ */ u$1("label", { children: [
1250
+ /* @__PURE__ */ u$1(
1251
+ "input",
1252
+ {
1253
+ className: "mr-2",
1254
+ type: "checkbox",
1255
+ id: `item-${index}`,
1256
+ checked: item.checked,
1257
+ onChange: () => {
1258
+ const newItems = items.map(
1259
+ (item2, i2) => i2 === index ? { ...item2, checked: !item2.checked } : item2
1260
+ );
1261
+ setItems(newItems);
1196
1262
  }
1197
- ),
1198
- item.label
1199
- ] }) }, item.label)) })
1200
- ] });
1263
+ }
1264
+ ),
1265
+ item.label
1266
+ ] }) }, item.label)) }) });
1201
1267
  };
1202
1268
  const ReferenceGenomeContext = createContext$1({ nucleotideSequences: [], genes: [] });
1203
1269
  const getSegmentSelectorLabel = (displayedSegments, prefix) => {
@@ -1221,7 +1287,6 @@ const SegmentSelector = ({
1221
1287
  return /* @__PURE__ */ u$1(
1222
1288
  CheckboxSelector,
1223
1289
  {
1224
- className: "mx-1",
1225
1290
  items: displayedSegments,
1226
1291
  label: getSegmentSelectorLabel(displayedSegments, prefix || "Segments: "),
1227
1292
  setItems: (items) => setDisplayedSegments(items)
@@ -1343,20 +1408,31 @@ const Info = ({ children, height }) => {
1343
1408
  const [showHelp, setShowHelp] = p(false);
1344
1409
  const referenceRef = F(null);
1345
1410
  const floatingRef = F(null);
1346
- useFloatingUi(referenceRef, floatingRef, height, showHelp);
1411
+ useFloatingUi(referenceRef, floatingRef, [
1412
+ offset(10),
1413
+ shift(),
1414
+ size({
1415
+ apply() {
1416
+ if (!floatingRef.current) {
1417
+ return;
1418
+ }
1419
+ floatingRef.current.style.width = "100vw";
1420
+ floatingRef.current.style.height = height ? height : "50vh";
1421
+ }
1422
+ })
1423
+ ]);
1347
1424
  const toggleHelp = () => {
1348
1425
  setShowHelp(!showHelp);
1349
1426
  };
1350
1427
  useCloseOnEsc(setShowHelp);
1351
1428
  useCloseOnClickOutside(floatingRef, referenceRef, setShowHelp);
1352
- return /* @__PURE__ */ u$1("div", { className: "relative z-10", children: [
1429
+ return /* @__PURE__ */ u$1("div", { className: "relative", children: [
1353
1430
  /* @__PURE__ */ u$1("button", { type: "button", className: "btn btn-xs", onClick: toggleHelp, ref: referenceRef, children: "?" }),
1354
1431
  /* @__PURE__ */ u$1(
1355
1432
  "div",
1356
1433
  {
1357
1434
  ref: floatingRef,
1358
- className: "bg-white p-2 border border-gray-100 shadow-lg rounded overflow-y-auto opacity-90",
1359
- style: { position: "absolute", zIndex: 10, display: showHelp ? "" : "none" },
1435
+ className: `${dropdownClass} overflow-y-auto opacity-90 ${showHelp ? "" : "hidden"}`,
1360
1436
  children: [
1361
1437
  /* @__PURE__ */ u$1("div", { className: "flex flex-col", children }),
1362
1438
  /* @__PURE__ */ u$1(
@@ -1372,67 +1448,6 @@ const Info = ({ children, height }) => {
1372
1448
  )
1373
1449
  ] });
1374
1450
  };
1375
- function useFloatingUi(referenceRef, floatingRef, height, showHelp) {
1376
- const cleanupRef = F(null);
1377
- _(() => {
1378
- if (!referenceRef.current || !floatingRef.current) {
1379
- return;
1380
- }
1381
- const { current: reference } = referenceRef;
1382
- const { current: floating } = floatingRef;
1383
- const update = () => {
1384
- computePosition(reference, floating, {
1385
- middleware: [
1386
- offset(10),
1387
- shift(),
1388
- size({
1389
- apply({}) {
1390
- floating.style.width = "100vw";
1391
- floating.style.height = height ? height : "50vh";
1392
- }
1393
- })
1394
- ]
1395
- }).then(({ x, y: y2 }) => {
1396
- floating.style.left = `${x}px`;
1397
- floating.style.top = `${y2}px`;
1398
- });
1399
- };
1400
- update();
1401
- cleanupRef.current = autoUpdate(reference, floating, update);
1402
- return () => {
1403
- if (cleanupRef.current) {
1404
- cleanupRef.current();
1405
- }
1406
- };
1407
- }, [showHelp, height, referenceRef, floatingRef]);
1408
- }
1409
- function useCloseOnClickOutside(floatingRef, referenceRef, setShowHelp) {
1410
- _(() => {
1411
- const handleClickOutside = (event) => {
1412
- const path = event.composedPath();
1413
- if (floatingRef.current && !path.includes(floatingRef.current) && referenceRef.current && !path.includes(referenceRef.current)) {
1414
- setShowHelp(false);
1415
- }
1416
- };
1417
- document.addEventListener("mousedown", handleClickOutside);
1418
- return () => {
1419
- document.removeEventListener("mousedown", handleClickOutside);
1420
- };
1421
- }, [floatingRef, referenceRef, setShowHelp]);
1422
- }
1423
- function useCloseOnEsc(setShowHelp) {
1424
- _(() => {
1425
- const handleKeyDown = (event) => {
1426
- if (event.key === "Escape") {
1427
- setShowHelp(false);
1428
- }
1429
- };
1430
- document.addEventListener("keydown", handleKeyDown);
1431
- return () => {
1432
- document.removeEventListener("keydown", handleKeyDown);
1433
- };
1434
- }, [setShowHelp]);
1435
- }
1436
1451
  const InfoHeadline1 = ({ children }) => {
1437
1452
  return /* @__PURE__ */ u$1("h1", { className: "text-lg font-bold", children });
1438
1453
  };
@@ -1457,7 +1472,6 @@ const MutationTypeSelector = ({
1457
1472
  return /* @__PURE__ */ u$1(
1458
1473
  CheckboxSelector,
1459
1474
  {
1460
- className: "mx-1",
1461
1475
  items: displayedMutationTypes,
1462
1476
  label: mutationTypesSelectorLabel,
1463
1477
  setItems: (items) => setDisplayedMutationTypes(items)
@@ -1616,34 +1630,34 @@ const ProportionSelector = ({
1616
1630
  const ProportionSelectorDropdown = ({
1617
1631
  proportionInterval,
1618
1632
  setMinProportion,
1619
- setMaxProportion,
1620
- openDirection = "right"
1633
+ setMaxProportion
1621
1634
  }) => {
1622
1635
  const label = `${(proportionInterval.min * 100).toFixed(1)}% - ${(proportionInterval.max * 100).toFixed(1)}%`;
1623
- return /* @__PURE__ */ u$1("div", { class: `dropdown ${openDirection === "left" ? "dropdown-end" : ""}`, children: [
1624
- /* @__PURE__ */ u$1("div", { tabIndex: 0, role: "button", class: "btn btn-xs whitespace-nowrap", children: [
1625
- "Proportion ",
1626
- label
1627
- ] }),
1628
- /* @__PURE__ */ u$1("ul", { tabIndex: 0, class: "p-2 shadow menu dropdown-content z-[1] bg-base-100 rounded-box w-72", children: /* @__PURE__ */ u$1("div", { class: "mb-2 ml-2", children: /* @__PURE__ */ u$1(
1629
- ProportionSelector,
1630
- {
1631
- proportionInterval,
1632
- setMinProportion,
1633
- setMaxProportion
1634
- }
1635
- ) }) })
1636
- ] });
1636
+ return /* @__PURE__ */ u$1(Dropdown, { buttonTitle: `Proportion ${label}`, placement: "bottom-start", children: /* @__PURE__ */ u$1(
1637
+ ProportionSelector,
1638
+ {
1639
+ proportionInterval,
1640
+ setMinProportion,
1641
+ setMaxProportion
1642
+ }
1643
+ ) });
1637
1644
  };
1638
1645
  const Tabs = ({ tabs, toolbar }) => {
1639
1646
  const [activeTab, setActiveTab] = p(tabs[0].title);
1640
1647
  const [heightOfTabs, setHeightOfTabs] = p("3rem");
1641
1648
  const tabRef = F(null);
1642
- _(() => {
1649
+ const updateHeightOfTabs = () => {
1643
1650
  if (tabRef.current) {
1644
1651
  const heightOfTabs2 = tabRef.current.getBoundingClientRect().height;
1645
1652
  setHeightOfTabs(`${heightOfTabs2}px`);
1646
1653
  }
1654
+ };
1655
+ _(() => {
1656
+ updateHeightOfTabs();
1657
+ window.addEventListener("resize", updateHeightOfTabs);
1658
+ return () => {
1659
+ window.removeEventListener("resize", updateHeightOfTabs);
1660
+ };
1647
1661
  }, []);
1648
1662
  const tabElements = /* @__PURE__ */ u$1("div", { className: "flex flex-row", children: tabs.map((tab) => {
1649
1663
  return /* @__PURE__ */ u$1(Fragment, { children: /* @__PURE__ */ u$1(
@@ -1659,9 +1673,9 @@ const Tabs = ({ tabs, toolbar }) => {
1659
1673
  }) });
1660
1674
  const toolbarElement = typeof toolbar === "function" ? toolbar(activeTab) : toolbar;
1661
1675
  return /* @__PURE__ */ u$1("div", { className: "h-full w-full", children: [
1662
- /* @__PURE__ */ u$1("div", { ref: tabRef, className: "flex flex-row justify-between", children: [
1676
+ /* @__PURE__ */ u$1("div", { ref: tabRef, className: "flex flex-row justify-between flex-wrap", children: [
1663
1677
  tabElements,
1664
- toolbar && /* @__PURE__ */ u$1("div", { className: "py-2", children: toolbarElement })
1678
+ toolbar && /* @__PURE__ */ u$1("div", { className: "py-2 flex flex-wrap gap-y-1", children: toolbarElement })
1665
1679
  ] }),
1666
1680
  /* @__PURE__ */ u$1(
1667
1681
  "div",
@@ -1791,7 +1805,7 @@ const Toolbar$3 = ({
1791
1805
  proportionInterval,
1792
1806
  setProportionInterval
1793
1807
  }) => {
1794
- return /* @__PURE__ */ u$1("div", { class: "flex flex-row", children: [
1808
+ return /* @__PURE__ */ u$1(Fragment, { children: [
1795
1809
  /* @__PURE__ */ u$1(
1796
1810
  ProportionSelectorDropdown,
1797
1811
  {
@@ -2462,15 +2476,6 @@ html {
2462
2476
  color: var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));
2463
2477
  }
2464
2478
 
2465
- .menu li > *:not(ul, .menu-title, details, .btn):active,
2466
- .menu li > *:not(ul, .menu-title, details, .btn).active,
2467
- .menu li > details > summary:active {
2468
- --tw-bg-opacity: 1;
2469
- background-color: var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));
2470
- --tw-text-opacity: 1;
2471
- color: var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity)));
2472
- }
2473
-
2474
2479
  .tab:hover {
2475
2480
  --tw-text-opacity: 1;
2476
2481
  }
@@ -2589,39 +2594,6 @@ html {
2589
2594
  transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
2590
2595
  transition-duration: 200ms;
2591
2596
  }
2592
- .dropdown-end .dropdown-content {
2593
- inset-inline-end: 0px;
2594
- }
2595
- .dropdown-left .dropdown-content {
2596
- bottom: auto;
2597
- inset-inline-end: 100%;
2598
- top: 0px;
2599
- transform-origin: right;
2600
- }
2601
- .dropdown-right .dropdown-content {
2602
- bottom: auto;
2603
- inset-inline-start: 100%;
2604
- top: 0px;
2605
- transform-origin: left;
2606
- }
2607
- .dropdown-bottom .dropdown-content {
2608
- bottom: auto;
2609
- top: 100%;
2610
- transform-origin: top;
2611
- }
2612
- .dropdown-top .dropdown-content {
2613
- bottom: 100%;
2614
- top: auto;
2615
- transform-origin: bottom;
2616
- }
2617
- .dropdown-end.dropdown-right .dropdown-content {
2618
- bottom: 0px;
2619
- top: auto;
2620
- }
2621
- .dropdown-end.dropdown-left .dropdown-content {
2622
- bottom: 0px;
2623
- top: auto;
2624
- }
2625
2597
  .dropdown.dropdown-open .dropdown-content,
2626
2598
  .dropdown:not(.dropdown-hover):focus .dropdown-content,
2627
2599
  .dropdown:focus-within .dropdown-content {
@@ -2716,19 +2688,6 @@ html {
2716
2688
  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));
2717
2689
  }
2718
2690
 
2719
- :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 {
2720
- cursor: pointer;
2721
- outline: 2px solid transparent;
2722
- outline-offset: 2px;
2723
- }
2724
-
2725
- @supports (color: oklch(0% 0 0)) {
2726
-
2727
- :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 {
2728
- background-color: var(--fallback-bc,oklch(var(--bc)/0.1));
2729
- }
2730
- }
2731
-
2732
2691
  .tab[disabled],
2733
2692
  .tab[disabled]:hover {
2734
2693
  cursor: not-allowed;
@@ -2855,31 +2814,6 @@ html {
2855
2814
  border-radius: inherit;
2856
2815
  }
2857
2816
  }
2858
- .menu {
2859
- display: flex;
2860
- flex-direction: column;
2861
- flex-wrap: wrap;
2862
- font-size: 0.875rem;
2863
- line-height: 1.25rem;
2864
- padding: 0.5rem;
2865
- }
2866
- .menu :where(li ul) {
2867
- position: relative;
2868
- white-space: nowrap;
2869
- margin-inline-start: 1rem;
2870
- padding-inline-start: 0.5rem;
2871
- }
2872
- .menu :where(li:not(.menu-title) > *:not(ul, details, .menu-title, .btn)), .menu :where(li:not(.menu-title) > details > summary:not(.menu-title)) {
2873
- display: grid;
2874
- grid-auto-flow: column;
2875
- align-content: flex-start;
2876
- align-items: center;
2877
- gap: 0.5rem;
2878
- grid-auto-columns: minmax(auto, max-content) auto max-content;
2879
- -webkit-user-select: none;
2880
- -moz-user-select: none;
2881
- user-select: none;
2882
- }
2883
2817
  .menu li.disabled {
2884
2818
  cursor: not-allowed;
2885
2819
  -webkit-user-select: none;
@@ -2887,20 +2821,6 @@ html {
2887
2821
  user-select: none;
2888
2822
  color: var(--fallback-bc,oklch(var(--bc)/0.3));
2889
2823
  }
2890
- .menu :where(li > .menu-dropdown:not(.menu-dropdown-show)) {
2891
- display: none;
2892
- }
2893
- :where(.menu li) {
2894
- position: relative;
2895
- display: flex;
2896
- flex-shrink: 0;
2897
- flex-direction: column;
2898
- flex-wrap: wrap;
2899
- align-items: stretch;
2900
- }
2901
- :where(.menu li) .badge {
2902
- justify-self: end;
2903
- }
2904
2824
  .modal {
2905
2825
  pointer-events: none;
2906
2826
  position: fixed;
@@ -3124,6 +3044,29 @@ input.tab:checked + .tab-content,
3124
3044
  --tw-bg-opacity: 1;
3125
3045
  background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
3126
3046
  }
3047
+ .toggle {
3048
+ flex-shrink: 0;
3049
+ --tglbg: var(--fallback-b1,oklch(var(--b1)/1));
3050
+ --handleoffset: 1.5rem;
3051
+ --handleoffsetcalculator: calc(var(--handleoffset) * -1);
3052
+ --togglehandleborder: 0 0;
3053
+ height: 1.5rem;
3054
+ width: 3rem;
3055
+ cursor: pointer;
3056
+ -webkit-appearance: none;
3057
+ -moz-appearance: none;
3058
+ appearance: none;
3059
+ border-radius: var(--rounded-badge, 1.9rem);
3060
+ border-width: 1px;
3061
+ border-color: currentColor;
3062
+ background-color: currentColor;
3063
+ color: var(--fallback-bc,oklch(var(--bc)/0.5));
3064
+ transition: background,
3065
+ box-shadow var(--animation-input, 0.2s) ease-out;
3066
+ box-shadow: var(--handleoffsetcalculator) 0 0 2px var(--tglbg) inset,
3067
+ 0 0 0 2px var(--tglbg) inset,
3068
+ var(--togglehandleborder);
3069
+ }
3127
3070
  .alert-error {
3128
3071
  border-color: var(--fallback-er,oklch(var(--er)/0.2));
3129
3072
  --tw-text-opacity: 1;
@@ -3357,9 +3300,6 @@ input.tab:checked + .tab-content,
3357
3300
  margin-bottom: 0px;
3358
3301
  margin-inline-start: -1px;
3359
3302
  }
3360
- .join-item:focus {
3361
- isolation: isolate;
3362
- }
3363
3303
  .loading {
3364
3304
  pointer-events: none;
3365
3305
  display: inline-block;
@@ -3382,40 +3322,6 @@ input.tab:checked + .tab-content,
3382
3322
  .loading-md {
3383
3323
  width: 1.5rem;
3384
3324
  }
3385
- :where(.menu li:empty) {
3386
- --tw-bg-opacity: 1;
3387
- background-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));
3388
- opacity: 0.1;
3389
- margin: 0.5rem 1rem;
3390
- height: 1px;
3391
- }
3392
- .menu :where(li ul):before {
3393
- position: absolute;
3394
- bottom: 0.75rem;
3395
- inset-inline-start: 0px;
3396
- top: 0.75rem;
3397
- width: 1px;
3398
- --tw-bg-opacity: 1;
3399
- background-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-bg-opacity)));
3400
- opacity: 0.1;
3401
- content: "";
3402
- }
3403
- .menu :where(li:not(.menu-title) > *:not(ul, details, .menu-title, .btn)),
3404
- .menu :where(li:not(.menu-title) > details > summary:not(.menu-title)) {
3405
- border-radius: var(--rounded-btn, 0.5rem);
3406
- padding-left: 1rem;
3407
- padding-right: 1rem;
3408
- padding-top: 0.5rem;
3409
- padding-bottom: 0.5rem;
3410
- text-align: start;
3411
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
3412
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
3413
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
3414
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
3415
- transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
3416
- transition-duration: 200ms;
3417
- text-wrap: balance;
3418
- }
3419
3325
  :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 {
3420
3326
  cursor: pointer;
3421
3327
  background-color: var(--fallback-bc,oklch(var(--bc)/0.1));
@@ -3424,38 +3330,6 @@ input.tab:checked + .tab-content,
3424
3330
  outline: 2px solid transparent;
3425
3331
  outline-offset: 2px;
3426
3332
  }
3427
- .menu li > *:not(ul, .menu-title, details, .btn):active,
3428
- .menu li > *:not(ul, .menu-title, details, .btn).active,
3429
- .menu li > details > summary:active {
3430
- --tw-bg-opacity: 1;
3431
- background-color: var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));
3432
- --tw-text-opacity: 1;
3433
- color: var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity)));
3434
- }
3435
- .menu :where(li > details > summary)::-webkit-details-marker {
3436
- display: none;
3437
- }
3438
- .menu :where(li > details > summary):after,
3439
- .menu :where(li > .menu-dropdown-toggle):after {
3440
- justify-self: end;
3441
- display: block;
3442
- margin-top: -0.5rem;
3443
- height: 0.5rem;
3444
- width: 0.5rem;
3445
- transform: rotate(45deg);
3446
- transition-property: transform, margin-top;
3447
- transition-duration: 0.3s;
3448
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
3449
- content: "";
3450
- transform-origin: 75% 75%;
3451
- box-shadow: 2px 2px;
3452
- pointer-events: none;
3453
- }
3454
- .menu :where(li > details[open] > summary):after,
3455
- .menu :where(li > .menu-dropdown-toggle.menu-dropdown-show):after {
3456
- transform: rotate(225deg);
3457
- margin-top: 0;
3458
- }
3459
3333
  .mockup-phone .display {
3460
3334
  overflow: hidden;
3461
3335
  border-radius: 40px;
@@ -3976,6 +3850,49 @@ input.tab:checked + .tab-content,
3976
3850
  opacity: 1;
3977
3851
  }
3978
3852
  }
3853
+ [dir="rtl"] .toggle {
3854
+ --handleoffsetcalculator: calc(var(--handleoffset) * 1);
3855
+ }
3856
+ .toggle:focus-visible {
3857
+ outline-style: solid;
3858
+ outline-width: 2px;
3859
+ outline-offset: 2px;
3860
+ outline-color: var(--fallback-bc,oklch(var(--bc)/0.2));
3861
+ }
3862
+ .toggle:hover {
3863
+ background-color: currentColor;
3864
+ }
3865
+ .toggle:checked,
3866
+ .toggle[aria-checked="true"] {
3867
+ background-image: none;
3868
+ --handleoffsetcalculator: var(--handleoffset);
3869
+ --tw-text-opacity: 1;
3870
+ color: var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));
3871
+ }
3872
+ [dir="rtl"] .toggle:checked, [dir="rtl"] .toggle[aria-checked="true"] {
3873
+ --handleoffsetcalculator: calc(var(--handleoffset) * -1);
3874
+ }
3875
+ .toggle:indeterminate {
3876
+ --tw-text-opacity: 1;
3877
+ color: var(--fallback-bc,oklch(var(--bc)/var(--tw-text-opacity)));
3878
+ box-shadow: calc(var(--handleoffset) / 2) 0 0 2px var(--tglbg) inset,
3879
+ calc(var(--handleoffset) / -2) 0 0 2px var(--tglbg) inset,
3880
+ 0 0 0 2px var(--tglbg) inset;
3881
+ }
3882
+ [dir="rtl"] .toggle:indeterminate {
3883
+ box-shadow: calc(var(--handleoffset) / 2) 0 0 2px var(--tglbg) inset,
3884
+ calc(var(--handleoffset) / -2) 0 0 2px var(--tglbg) inset,
3885
+ 0 0 0 2px var(--tglbg) inset;
3886
+ }
3887
+ .toggle:disabled {
3888
+ cursor: not-allowed;
3889
+ --tw-border-opacity: 1;
3890
+ border-color: var(--fallback-bc,oklch(var(--bc)/var(--tw-border-opacity)));
3891
+ background-color: transparent;
3892
+ opacity: 0.3;
3893
+ --togglehandleborder: 0 0 0 3px var(--fallback-bc,oklch(var(--bc)/1)) inset,
3894
+ var(--handleoffsetcalculator) 0 0 3px var(--fallback-bc,oklch(var(--bc)/1)) inset;
3895
+ }
3979
3896
  .btn-xs {
3980
3897
  height: 1.5rem;
3981
3898
  min-height: 1.5rem;
@@ -4305,18 +4222,21 @@ input.tab:checked + .tab-content,
4305
4222
  .-top-3 {
4306
4223
  top: -0.75rem;
4307
4224
  }
4225
+ .left-0 {
4226
+ left: 0px;
4227
+ }
4308
4228
  .right-2 {
4309
4229
  right: 0.5rem;
4310
4230
  }
4231
+ .top-0 {
4232
+ top: 0px;
4233
+ }
4311
4234
  .top-2 {
4312
4235
  top: 0.5rem;
4313
4236
  }
4314
4237
  .z-10 {
4315
4238
  z-index: 10;
4316
4239
  }
4317
- .z-\\[1\\] {
4318
- z-index: 1;
4319
- }
4320
4240
  .float-right {
4321
4241
  float: right;
4322
4242
  }
@@ -4341,9 +4261,6 @@ input.tab:checked + .tab-content,
4341
4261
  .mb-2 {
4342
4262
  margin-bottom: 0.5rem;
4343
4263
  }
4344
- .ml-2 {
4345
- margin-left: 0.5rem;
4346
- }
4347
4264
  .mr-2 {
4348
4265
  margin-right: 0.5rem;
4349
4266
  }
@@ -4377,24 +4294,37 @@ input.tab:checked + .tab-content,
4377
4294
  .w-32 {
4378
4295
  width: 8rem;
4379
4296
  }
4297
+ .w-40 {
4298
+ width: 10rem;
4299
+ }
4380
4300
  .w-64 {
4381
4301
  width: 16rem;
4382
4302
  }
4383
- .w-72 {
4384
- width: 18rem;
4385
- }
4386
4303
  .w-full {
4387
4304
  width: 100%;
4388
4305
  }
4306
+ .w-max {
4307
+ width: -moz-max-content;
4308
+ width: max-content;
4309
+ }
4310
+ .min-w-40 {
4311
+ min-width: 10rem;
4312
+ }
4389
4313
  .max-w-screen-lg {
4390
4314
  max-width: 1024px;
4391
4315
  }
4392
4316
  .flex-1 {
4393
4317
  flex: 1 1 0%;
4394
4318
  }
4319
+ .flex-grow {
4320
+ flex-grow: 1;
4321
+ }
4395
4322
  .grow {
4396
4323
  flex-grow: 1;
4397
4324
  }
4325
+ .resize {
4326
+ resize: both;
4327
+ }
4398
4328
  .flex-row {
4399
4329
  flex-direction: row;
4400
4330
  }
@@ -4416,6 +4346,9 @@ input.tab:checked + .tab-content,
4416
4346
  .gap-2 {
4417
4347
  gap: 0.5rem;
4418
4348
  }
4349
+ .gap-y-1 {
4350
+ row-gap: 0.25rem;
4351
+ }
4419
4352
  .overflow-auto {
4420
4353
  overflow: auto;
4421
4354
  }
@@ -4425,18 +4358,9 @@ input.tab:checked + .tab-content,
4425
4358
  .whitespace-nowrap {
4426
4359
  white-space: nowrap;
4427
4360
  }
4428
- .text-nowrap {
4429
- text-wrap: nowrap;
4430
- }
4431
4361
  .break-words {
4432
4362
  overflow-wrap: break-word;
4433
4363
  }
4434
- .rounded {
4435
- border-radius: 0.25rem;
4436
- }
4437
- .rounded-box {
4438
- border-radius: var(--rounded-box, 1rem);
4439
- }
4440
4364
  .rounded-full {
4441
4365
  border-radius: 9999px;
4442
4366
  }
@@ -4479,6 +4403,10 @@ input.tab:checked + .tab-content,
4479
4403
  --tw-border-opacity: 1;
4480
4404
  border-color: rgb(243 244 246 / var(--tw-border-opacity));
4481
4405
  }
4406
+ .border-gray-200 {
4407
+ --tw-border-opacity: 1;
4408
+ border-color: rgb(229 231 235 / var(--tw-border-opacity));
4409
+ }
4482
4410
  .border-gray-300 {
4483
4411
  --tw-border-opacity: 1;
4484
4412
  border-color: rgb(209 213 219 / var(--tw-border-opacity));
@@ -4491,10 +4419,6 @@ input.tab:checked + .tab-content,
4491
4419
  --tw-border-opacity: 1;
4492
4420
  border-color: rgb(239 68 68 / var(--tw-border-opacity));
4493
4421
  }
4494
- .bg-base-100 {
4495
- --tw-bg-opacity: 1;
4496
- background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
4497
- }
4498
4422
  .bg-base-200 {
4499
4423
  --tw-bg-opacity: 1;
4500
4424
  background-color: var(--fallback-b2,oklch(var(--b2)/var(--tw-bg-opacity)));
@@ -4509,6 +4433,9 @@ input.tab:checked + .tab-content,
4509
4433
  .p-2 {
4510
4434
  padding: 0.5rem;
4511
4435
  }
4436
+ .p-4 {
4437
+ padding: 1rem;
4438
+ }
4512
4439
  .px-2 {
4513
4440
  padding-left: 0.5rem;
4514
4441
  padding-right: 0.5rem;
@@ -5083,7 +5010,7 @@ const Toolbar$2 = ({
5083
5010
  proportionInterval,
5084
5011
  setProportionInterval
5085
5012
  }) => {
5086
- return /* @__PURE__ */ u$1("div", { class: "flex flex-row", children: [
5013
+ return /* @__PURE__ */ u$1(Fragment, { children: [
5087
5014
  /* @__PURE__ */ u$1(SegmentSelector, { displayedSegments, setDisplayedSegments }),
5088
5015
  activeTab === "Table" && /* @__PURE__ */ u$1(
5089
5016
  MutationTypeSelector,
@@ -5098,8 +5025,7 @@ const Toolbar$2 = ({
5098
5025
  {
5099
5026
  proportionInterval,
5100
5027
  setMinProportion: (min) => setProportionInterval((prev) => ({ ...prev, min })),
5101
- setMaxProportion: (max) => setProportionInterval((prev) => ({ ...prev, max })),
5102
- openDirection: "left"
5028
+ setMaxProportion: (max) => setProportionInterval((prev) => ({ ...prev, max }))
5103
5029
  }
5104
5030
  ),
5105
5031
  /* @__PURE__ */ u$1(
@@ -6856,7 +6782,7 @@ const Toolbar$1 = ({
6856
6782
  data,
6857
6783
  granularity
6858
6784
  }) => {
6859
- return /* @__PURE__ */ u$1("div", { class: "flex", children: [
6785
+ return /* @__PURE__ */ u$1(Fragment, { children: [
6860
6786
  activeTab !== "Table" && /* @__PURE__ */ u$1(ScalingSelector, { yAxisScaleType, setYAxisScaleType }),
6861
6787
  (activeTab === "Bar" || activeTab === "Line") && /* @__PURE__ */ u$1(
6862
6788
  ConfidenceIntervalSelector,
@@ -6877,7 +6803,7 @@ const Toolbar$1 = ({
6877
6803
  /* @__PURE__ */ u$1(PrevalenceOverTimeInfo, {})
6878
6804
  ] });
6879
6805
  };
6880
- const PrevalenceOverTimeInfo = ({}) => {
6806
+ const PrevalenceOverTimeInfo = () => {
6881
6807
  return /* @__PURE__ */ u$1(Info, { height: "100px", children: [
6882
6808
  /* @__PURE__ */ u$1(InfoHeadline1, { children: "Prevalence over time" }),
6883
6809
  /* @__PURE__ */ u$1(InfoParagraph, { children: "Prevalence over time info." })
@@ -7243,7 +7169,7 @@ const RelativeGrowthAdvantageToolbar = ({
7243
7169
  setYAxisScaleType,
7244
7170
  generationTime
7245
7171
  }) => {
7246
- return /* @__PURE__ */ u$1("div", { class: "flex", children: [
7172
+ return /* @__PURE__ */ u$1(Fragment, { children: [
7247
7173
  /* @__PURE__ */ u$1(ScalingSelector, { yAxisScaleType, setYAxisScaleType }),
7248
7174
  /* @__PURE__ */ u$1(RelativeGrowthAdvantageInfo, { generationTime })
7249
7175
  ] });
@@ -7702,13 +7628,13 @@ const DateRangeSelectorInner = ({
7702
7628
  })
7703
7629
  );
7704
7630
  };
7705
- return /* @__PURE__ */ u$1("div", { class: "join w-full", ref: divRef, children: [
7631
+ return /* @__PURE__ */ u$1("div", { class: "flex flex-wrap", ref: divRef, children: [
7706
7632
  /* @__PURE__ */ u$1(
7707
7633
  Select,
7708
7634
  {
7709
7635
  items: getSelectableOptions(customSelectOptions),
7710
7636
  selected: selectedDateRange,
7711
- selectStyle: "select-bordered rounded-none join-item grow",
7637
+ selectStyle: "select-bordered rounded-none flex-grow w-40",
7712
7638
  onChange: (event) => {
7713
7639
  event.preventDefault();
7714
7640
  const select = event.target;
@@ -7717,28 +7643,32 @@ const DateRangeSelectorInner = ({
7717
7643
  }
7718
7644
  }
7719
7645
  ),
7720
- /* @__PURE__ */ u$1(
7721
- "input",
7722
- {
7723
- class: "input input-bordered rounded-none join-item grow",
7724
- type: "text",
7725
- placeholder: "Date from",
7726
- ref: fromDatePickerRef,
7727
- onChange: onChangeDateFrom,
7728
- onBlur: onChangeDateFrom
7729
- }
7730
- ),
7731
- /* @__PURE__ */ u$1(
7732
- "input",
7733
- {
7734
- class: "input input-bordered rounded-none join-item grow",
7735
- type: "text",
7736
- placeholder: "Date to",
7737
- ref: toDatePickerRef,
7738
- onChange: onChangeDateTo,
7739
- onBlur: onChangeDateTo
7740
- }
7741
- )
7646
+ /* @__PURE__ */ u$1("div", { className: "flex flex-wrap flex-grow", children: [
7647
+ /* @__PURE__ */ u$1(
7648
+ "input",
7649
+ {
7650
+ class: "input input-bordered rounded-none flex-grow min-w-40",
7651
+ type: "text",
7652
+ size: 10,
7653
+ placeholder: "Date from",
7654
+ ref: fromDatePickerRef,
7655
+ onChange: onChangeDateFrom,
7656
+ onBlur: onChangeDateFrom
7657
+ }
7658
+ ),
7659
+ /* @__PURE__ */ u$1(
7660
+ "input",
7661
+ {
7662
+ class: "input input-bordered rounded-none flex-grow min-w-40",
7663
+ type: "text",
7664
+ size: 10,
7665
+ placeholder: "Date to",
7666
+ ref: toDatePickerRef,
7667
+ onChange: onChangeDateTo,
7668
+ onBlur: onChangeDateTo
7669
+ }
7670
+ )
7671
+ ] })
7742
7672
  ] });
7743
7673
  };
7744
7674
  var __defProp$3 = Object.defineProperty;