analytica-frontend-lib 1.1.77 → 1.1.79

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.
@@ -622,9 +622,23 @@ var injectStore = (children, store) => {
622
622
  return Children.map(children, (child) => {
623
623
  if (isValidElement(child)) {
624
624
  const typedChild = child;
625
- const newProps = {
626
- store
627
- };
625
+ const displayName = typedChild.type.displayName;
626
+ const allowed = [
627
+ "DropdownMenuTrigger",
628
+ "DropdownContent",
629
+ "DropdownMenuContent",
630
+ "DropdownMenuSeparator",
631
+ "DropdownMenuItem",
632
+ "MenuLabel",
633
+ "ProfileMenuTrigger",
634
+ "ProfileMenuHeader",
635
+ "ProfileMenuFooter",
636
+ "ProfileToggleTheme"
637
+ ];
638
+ let newProps = {};
639
+ if (allowed.includes(displayName)) {
640
+ newProps.store = store;
641
+ }
628
642
  if (typedChild.props.children) {
629
643
  newProps.children = injectStore(typedChild.props.children, store);
630
644
  }
@@ -710,13 +724,22 @@ var DropdownMenuTrigger = ({
710
724
  const open = useStore(store, (s) => s.open);
711
725
  const toggleOpen = () => store.setState({ open: !open });
712
726
  return /* @__PURE__ */ jsx6(
713
- "button",
727
+ "div",
714
728
  {
715
729
  onClick: (e) => {
716
730
  e.stopPropagation();
717
731
  toggleOpen();
718
732
  if (onClick) onClick(e);
719
733
  },
734
+ role: "button",
735
+ onKeyDown: (e) => {
736
+ if (e.key === "Enter" || e.key === " ") {
737
+ e.preventDefault();
738
+ toggleOpen();
739
+ if (onClick) onClick(e);
740
+ }
741
+ },
742
+ tabIndex: 0,
720
743
  "aria-expanded": open,
721
744
  className: cn(className),
722
745
  ...props,
@@ -1362,6 +1385,10 @@ var Badge_default = Badge;
1362
1385
  import { useState as useState3, useEffect as useEffect5 } from "react";
1363
1386
  var MOBILE_WIDTH = 500;
1364
1387
  var TABLET_WIDTH = 931;
1388
+ var SMALL_MOBILE_WIDTH = 425;
1389
+ var EXTRA_SMALL_MOBILE_WIDTH = 375;
1390
+ var ULTRA_SMALL_MOBILE_WIDTH = 375;
1391
+ var TINY_MOBILE_WIDTH = 320;
1365
1392
  var DEFAULT_WIDTH = 1200;
1366
1393
  var getWindowWidth = () => {
1367
1394
  if (typeof window === "undefined") {
@@ -1376,11 +1403,19 @@ var getDeviceType = () => {
1376
1403
  var useMobile = () => {
1377
1404
  const [isMobile, setIsMobile] = useState3(false);
1378
1405
  const [isTablet, setIsTablet] = useState3(false);
1406
+ const [isSmallMobile, setIsSmallMobile] = useState3(false);
1407
+ const [isExtraSmallMobile, setIsExtraSmallMobile] = useState3(false);
1408
+ const [isUltraSmallMobile, setIsUltraSmallMobile] = useState3(false);
1409
+ const [isTinyMobile, setIsTinyMobile] = useState3(false);
1379
1410
  useEffect5(() => {
1380
1411
  const checkScreenSize = () => {
1381
1412
  const width = getWindowWidth();
1382
1413
  setIsMobile(width < MOBILE_WIDTH);
1383
1414
  setIsTablet(width < TABLET_WIDTH);
1415
+ setIsSmallMobile(width < SMALL_MOBILE_WIDTH);
1416
+ setIsExtraSmallMobile(width < EXTRA_SMALL_MOBILE_WIDTH);
1417
+ setIsUltraSmallMobile(width < ULTRA_SMALL_MOBILE_WIDTH);
1418
+ setIsTinyMobile(width < TINY_MOBILE_WIDTH);
1384
1419
  };
1385
1420
  checkScreenSize();
1386
1421
  window.addEventListener("resize", checkScreenSize);
@@ -1404,13 +1439,24 @@ var useMobile = () => {
1404
1439
  const getHeaderClasses = () => {
1405
1440
  return isMobile ? getMobileHeaderClasses() : getDesktopHeaderClasses();
1406
1441
  };
1442
+ const getVideoContainerClasses = () => {
1443
+ if (isTinyMobile) return "aspect-square";
1444
+ if (isExtraSmallMobile) return "aspect-[4/3]";
1445
+ if (isSmallMobile) return "aspect-[16/12]";
1446
+ return "aspect-video";
1447
+ };
1407
1448
  return {
1408
1449
  isMobile,
1409
1450
  isTablet,
1451
+ isSmallMobile,
1452
+ isExtraSmallMobile,
1453
+ isUltraSmallMobile,
1454
+ isTinyMobile,
1410
1455
  getFormContainerClasses,
1411
1456
  getHeaderClasses,
1412
1457
  getMobileHeaderClasses,
1413
1458
  getDesktopHeaderClasses,
1459
+ getVideoContainerClasses,
1414
1460
  getDeviceType
1415
1461
  };
1416
1462
  };