@box/blueprint-web 14.22.0 → 14.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10536,7 +10536,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
10536
10536
  fill:currentcolor;
10537
10537
  }
10538
10538
 
10539
- .bp_popover_module_popoverContentContainer--a0d71 .bp_popover_module_popoverCard--a0d71 .bp_popover_module_popoverMainContent--a0d71,.bp_popover_module_popoverContentContainer--a0d71.bp_popover_module_accessibilitySmallBreakpoint--a0d71 .bp_popover_module_popoverCard--a0d71 .bp_popover_module_popoverScrollContainer--a0d71{
10539
+ .bp_popover_module_popoverContentContainer--5379f .bp_popover_module_popoverCard--5379f .bp_popover_module_popoverMainContent--5379f,.bp_popover_module_popoverContentContainer--5379f.bp_popover_module_accessibilitySmallBreakpoint--5379f .bp_popover_module_popoverCard--5379f .bp_popover_module_popoverScrollContainer--5379f{
10540
10540
  margin-inline-end:var(--scroll-mask-margin-inline-end);
10541
10541
  mask-image:var(--scroll-mask-mask-image);
10542
10542
  mask-position:var(--scroll-mask-mask-position);
@@ -10546,7 +10546,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
10546
10546
  transition:var(--scroll-mask-transition);
10547
10547
  }
10548
10548
 
10549
- .bp_popover_module_popoverContentContainer--a0d71[data-modern=false]{
10549
+ .bp_popover_module_popoverContentContainer--5379f[data-modern=false]{
10550
10550
  --scroll-mask-padding-right:var(--space-4);
10551
10551
  --scroll-mask-overflow:auto;
10552
10552
  --scroll-mask-transition:mask-position var(--animation-duration-3), -webkit-mask-position var(--animation-duration-3);
@@ -10559,12 +10559,12 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
10559
10559
  --popover-content-text-color:var(--text-text-on-light);
10560
10560
  --popover-main-content-inner-container-padding:var(--space-3);
10561
10561
  --popover-scroll-container-small-breakpoint-max-height:min(
10562
- var(
10563
- --blueprint-web-popover-content-max-height,
10564
- calc(var(--radix-popover-content-available-height) - var(--space-12))
10565
- ),
10562
+ var(
10563
+ --blueprint-web-popover-content-max-height,
10566
10564
  calc(var(--radix-popover-content-available-height) - var(--space-12))
10567
- );
10565
+ ),
10566
+ calc(var(--radix-popover-content-available-height) - var(--space-12))
10567
+ );
10568
10568
  --popover-scroll-container-small-breakpoint-padding-block:var(--space-1);
10569
10569
  --popover-footer-padding-block-start:var(--space-4);
10570
10570
  --popover-footer-margin-inline:calc(var(--space-4)*-1);
@@ -10572,7 +10572,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
10572
10572
  --popover-footer-border-top:var(--border-1) solid var(--border-card-border);
10573
10573
  }
10574
10574
 
10575
- .bp_popover_module_popoverContentContainer--a0d71[data-modern=true]{
10575
+ .bp_popover_module_popoverContentContainer--5379f[data-modern=true]{
10576
10576
  --bp-dropshadow-3:var(--dropshadow-3);
10577
10577
  --bp-animation-duration-3:var(--animation-duration-3);
10578
10578
  --scroll-mask-padding-right:var(--bp-space-040);
@@ -10587,12 +10587,12 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
10587
10587
  --popover-content-text-color:var(--bp-text-text-on-light);
10588
10588
  --popover-main-content-inner-container-padding:var(--bp-space-030);
10589
10589
  --popover-scroll-container-small-breakpoint-max-height:min(
10590
- var(
10591
- --blueprint-web-popover-content-max-height,
10592
- calc(var(--radix-popover-content-available-height) - var(--bp-space-120))
10593
- ),
10590
+ var(
10591
+ --blueprint-web-popover-content-max-height,
10594
10592
  calc(var(--radix-popover-content-available-height) - var(--bp-space-120))
10595
- );
10593
+ ),
10594
+ calc(var(--radix-popover-content-available-height) - var(--bp-space-120))
10595
+ );
10596
10596
  --popover-scroll-container-small-breakpoint-padding-block:var(--bp-space-010);
10597
10597
  --popover-footer-padding-block-start:var(--bp-space-040);
10598
10598
  --popover-footer-margin-inline:calc(var(--bp-space-040)*-1);
@@ -10600,48 +10600,258 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
10600
10600
  --popover-footer-border-top:var(--bp-border-01) solid var(--bp-border-card-border);
10601
10601
  }
10602
10602
 
10603
- .bp_popover_module_popoverContentContainer--a0d71{
10603
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true]:not([data-large=true])[data-state=open]{
10604
+ animation-duration:var(--bp-duration-medium);
10605
+ animation-timing-function:var(--bp-curve-medium-on);
10606
+ }
10607
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true]:not([data-large=true])[data-state=open][data-side=top]{
10608
+ animation-name:bp_popover_module_bpPopoverMediumTopSlideEnter--5379f, bp_popover_module_bpPopoverFadeIn--5379f;
10609
+ }
10610
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true]:not([data-large=true])[data-state=open][data-side=bottom]{
10611
+ animation-name:bp_popover_module_bpPopoverMediumBottomSlideEnter--5379f, bp_popover_module_bpPopoverFadeIn--5379f;
10612
+ }
10613
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true]:not([data-large=true])[data-state=open][data-side=left]{
10614
+ animation-name:bp_popover_module_bpPopoverMediumLeftSlideEnter--5379f, bp_popover_module_bpPopoverFadeIn--5379f;
10615
+ }
10616
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true]:not([data-large=true])[data-state=open][data-side=right]{
10617
+ animation-name:bp_popover_module_bpPopoverMediumRightSlideEnter--5379f, bp_popover_module_bpPopoverFadeIn--5379f;
10618
+ }
10619
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true]:not([data-large=true])[data-state=closed]{
10620
+ animation-duration:var(--bp-duration-short);
10621
+ animation-timing-function:var(--bp-curve-medium-off);
10622
+ }
10623
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true]:not([data-large=true])[data-state=closed][data-side=top]{
10624
+ animation-name:bp_popover_module_bpPopoverMediumTopSlideExit--5379f, bp_popover_module_bpPopoverFadeOut--5379f;
10625
+ }
10626
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true]:not([data-large=true])[data-state=closed][data-side=bottom]{
10627
+ animation-name:bp_popover_module_bpPopoverMediumBottomSlideExit--5379f, bp_popover_module_bpPopoverFadeOut--5379f;
10628
+ }
10629
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true]:not([data-large=true])[data-state=closed][data-side=left]{
10630
+ animation-name:bp_popover_module_bpPopoverMediumLeftSlideExit--5379f, bp_popover_module_bpPopoverFadeOut--5379f;
10631
+ }
10632
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true]:not([data-large=true])[data-state=closed][data-side=right]{
10633
+ animation-name:bp_popover_module_bpPopoverMediumRightSlideExit--5379f, bp_popover_module_bpPopoverFadeOut--5379f;
10634
+ }
10635
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true][data-large=true][data-state=open]{
10636
+ animation-duration:var(--bp-duration-long);
10637
+ animation-timing-function:var(--bp-curve-large-on);
10638
+ }
10639
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true][data-large=true][data-state=open][data-side=top]{
10640
+ animation-name:bp_popover_module_bpPopoverLargeTopSlideEnter--5379f, bp_popover_module_bpPopoverFadeIn--5379f;
10641
+ }
10642
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true][data-large=true][data-state=open][data-side=bottom]{
10643
+ animation-name:bp_popover_module_bpPopoverLargeBottomSlideEnter--5379f, bp_popover_module_bpPopoverFadeIn--5379f;
10644
+ }
10645
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true][data-large=true][data-state=open][data-side=left]{
10646
+ animation-name:bp_popover_module_bpPopoverLargeLeftSlideEnter--5379f, bp_popover_module_bpPopoverFadeIn--5379f;
10647
+ }
10648
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true][data-large=true][data-state=open][data-side=right]{
10649
+ animation-name:bp_popover_module_bpPopoverLargeRightSlideEnter--5379f, bp_popover_module_bpPopoverFadeIn--5379f;
10650
+ }
10651
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true][data-large=true][data-state=closed]{
10652
+ animation-duration:var(--bp-duration-medium);
10653
+ animation-timing-function:var(--bp-curve-large-off);
10654
+ }
10655
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true][data-large=true][data-state=closed][data-side=top]{
10656
+ animation-name:bp_popover_module_bpPopoverLargeTopSlideExit--5379f, bp_popover_module_bpPopoverFadeOut--5379f;
10657
+ }
10658
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true][data-large=true][data-state=closed][data-side=bottom]{
10659
+ animation-name:bp_popover_module_bpPopoverLargeBottomSlideExit--5379f, bp_popover_module_bpPopoverFadeOut--5379f;
10660
+ }
10661
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true][data-large=true][data-state=closed][data-side=left]{
10662
+ animation-name:bp_popover_module_bpPopoverLargeLeftSlideExit--5379f, bp_popover_module_bpPopoverFadeOut--5379f;
10663
+ }
10664
+ .bp_popover_module_popoverContentContainer--5379f[data-bp-animated=true][data-large=true][data-state=closed][data-side=right]{
10665
+ animation-name:bp_popover_module_bpPopoverLargeRightSlideExit--5379f, bp_popover_module_bpPopoverFadeOut--5379f;
10666
+ }
10667
+
10668
+ .bp_popover_module_popoverContentContainer--5379f{
10604
10669
  max-width:320px;
10605
10670
  z-index:var(--z-index-popover);
10606
10671
  }
10607
- .bp_popover_module_popoverContentContainer--a0d71 .bp_popover_module_popoverCard--a0d71{
10672
+ .bp_popover_module_popoverContentContainer--5379f .bp_popover_module_popoverCard--5379f{
10608
10673
  box-shadow:var(--popover-card-box-shadow);
10609
10674
  margin-block:var(--popover-card-margin-block);
10610
10675
  }
10611
- .bp_popover_module_popoverContentContainer--a0d71 .bp_popover_module_popoverCard--a0d71 .bp_popover_module_popoverMainContent--a0d71{
10676
+ .bp_popover_module_popoverContentContainer--5379f .bp_popover_module_popoverCard--5379f .bp_popover_module_popoverMainContent--5379f{
10612
10677
  color:var(--popover-content-text-color);
10613
10678
  }
10614
- .bp_popover_module_popoverContentContainer--a0d71 .bp_popover_module_popoverCard--a0d71 .bp_popover_module_popoverMainContent--a0d71:hover{
10679
+ .bp_popover_module_popoverContentContainer--5379f .bp_popover_module_popoverCard--5379f .bp_popover_module_popoverMainContent--5379f:hover{
10615
10680
  mask-position:left top;
10616
10681
  }
10617
- .bp_popover_module_popoverContentContainer--a0d71 .bp_popover_module_popoverCard--a0d71 .bp_popover_module_popoverMainContent--a0d71 .bp_popover_module_popoverMainContentOuterContainer--a0d71{
10682
+ .bp_popover_module_popoverContentContainer--5379f .bp_popover_module_popoverCard--5379f .bp_popover_module_popoverMainContent--5379f .bp_popover_module_popoverMainContentOuterContainer--5379f{
10618
10683
  max-height:inherit;
10619
10684
  }
10620
- .bp_popover_module_popoverContentContainer--a0d71 .bp_popover_module_popoverCard--a0d71 .bp_popover_module_popoverMainContent--a0d71 .bp_popover_module_popoverMainContentOuterContainer--a0d71 .bp_popover_module_popoverMainContentInnerContainerPadding--a0d71{
10685
+ .bp_popover_module_popoverContentContainer--5379f .bp_popover_module_popoverCard--5379f .bp_popover_module_popoverMainContent--5379f .bp_popover_module_popoverMainContentOuterContainer--5379f .bp_popover_module_popoverMainContentInnerContainerPadding--5379f{
10621
10686
  padding-block-end:var(--popover-main-content-inner-container-padding);
10622
10687
  }
10623
- .bp_popover_module_popoverContentContainer--a0d71.bp_popover_module_accessibilitySmallBreakpoint--a0d71{
10688
+ .bp_popover_module_popoverContentContainer--5379f.bp_popover_module_accessibilitySmallBreakpoint--5379f{
10624
10689
  max-height:var(--radix-popover-content-available-height);
10625
10690
  }
10626
- .bp_popover_module_popoverContentContainer--a0d71.bp_popover_module_accessibilitySmallBreakpoint--a0d71 .bp_popover_module_popoverCard--a0d71 .bp_popover_module_popoverScrollContainer--a0d71{
10691
+ .bp_popover_module_popoverContentContainer--5379f.bp_popover_module_accessibilitySmallBreakpoint--5379f .bp_popover_module_popoverCard--5379f .bp_popover_module_popoverScrollContainer--5379f{
10627
10692
  color:var(--popover-content-text-color);
10628
10693
  max-height:var(--popover-scroll-container-small-breakpoint-max-height);
10629
10694
  padding-block:var(--popover-scroll-container-small-breakpoint-padding-block);
10630
10695
  }
10631
- .bp_popover_module_popoverContentContainer--a0d71.bp_popover_module_accessibilitySmallBreakpoint--a0d71 .bp_popover_module_popoverCard--a0d71 .bp_popover_module_popoverScrollContainer--a0d71:hover{
10696
+ .bp_popover_module_popoverContentContainer--5379f.bp_popover_module_accessibilitySmallBreakpoint--5379f .bp_popover_module_popoverCard--5379f .bp_popover_module_popoverScrollContainer--5379f:hover{
10632
10697
  mask-position:left top;
10633
10698
  }
10634
- .bp_popover_module_popoverContentContainer--a0d71.bp_popover_module_accessibilitySmallBreakpoint--a0d71 .bp_popover_module_popoverCard--a0d71 .bp_popover_module_popoverScrollContainer--a0d71 .bp_popover_module_popoverMainContent--a0d71{
10699
+ .bp_popover_module_popoverContentContainer--5379f.bp_popover_module_accessibilitySmallBreakpoint--5379f .bp_popover_module_popoverCard--5379f .bp_popover_module_popoverScrollContainer--5379f .bp_popover_module_popoverMainContent--5379f{
10635
10700
  max-height:fit-content;
10636
10701
  }
10637
- .bp_popover_module_popoverContentContainer--a0d71 .bp_popover_module_popoverFooter--a0d71{
10702
+ .bp_popover_module_popoverContentContainer--5379f .bp_popover_module_popoverFooter--5379f{
10638
10703
  margin-inline:var(--popover-footer-margin-inline);
10639
10704
  padding-block-start:var(--popover-footer-padding-block-start);
10640
10705
  padding-inline:var(--popover-footer-padding-inline);
10641
10706
  }
10642
- .bp_popover_module_popoverContentContainer--a0d71 .bp_popover_module_popoverFooter--a0d71.bp_popover_module_popoverFooterTopBorder--a0d71{
10707
+ .bp_popover_module_popoverContentContainer--5379f .bp_popover_module_popoverFooter--5379f.bp_popover_module_popoverFooterTopBorder--5379f{
10643
10708
  border-top:var(--popover-footer-border-top);
10644
10709
  }
10710
+
10711
+ @keyframes bp_popover_module_bpPopoverFadeIn--5379f{
10712
+ from{
10713
+ opacity:var(--bp-opacity-hidden);
10714
+ }
10715
+ to{
10716
+ opacity:var(--bp-opacity-visible);
10717
+ }
10718
+ }
10719
+ @keyframes bp_popover_module_bpPopoverFadeOut--5379f{
10720
+ from{
10721
+ opacity:var(--bp-opacity-visible);
10722
+ }
10723
+ to{
10724
+ opacity:var(--bp-opacity-hidden);
10725
+ }
10726
+ }
10727
+ @keyframes bp_popover_module_bpPopoverMediumTopSlideEnter--5379f{
10728
+ from{
10729
+ transform:translateY(var(--bp-space-020));
10730
+ }
10731
+ to{
10732
+ transform:translateY(0);
10733
+ }
10734
+ }
10735
+ @keyframes bp_popover_module_bpPopoverMediumTopSlideExit--5379f{
10736
+ from{
10737
+ transform:translateY(0);
10738
+ }
10739
+ to{
10740
+ transform:translateY(var(--bp-space-020));
10741
+ }
10742
+ }
10743
+ @keyframes bp_popover_module_bpPopoverMediumBottomSlideEnter--5379f{
10744
+ from{
10745
+ transform:translateY(calc(var(--bp-space-020)*-1));
10746
+ }
10747
+ to{
10748
+ transform:translateY(0);
10749
+ }
10750
+ }
10751
+ @keyframes bp_popover_module_bpPopoverMediumBottomSlideExit--5379f{
10752
+ from{
10753
+ transform:translateY(0);
10754
+ }
10755
+ to{
10756
+ transform:translateY(calc(var(--bp-space-020)*-1));
10757
+ }
10758
+ }
10759
+ @keyframes bp_popover_module_bpPopoverMediumLeftSlideEnter--5379f{
10760
+ from{
10761
+ transform:translateX(calc(var(--bp-space-020)*-1));
10762
+ }
10763
+ to{
10764
+ transform:translateX(0);
10765
+ }
10766
+ }
10767
+ @keyframes bp_popover_module_bpPopoverMediumLeftSlideExit--5379f{
10768
+ from{
10769
+ transform:translateX(0);
10770
+ }
10771
+ to{
10772
+ transform:translateX(calc(var(--bp-space-020)*-1));
10773
+ }
10774
+ }
10775
+ @keyframes bp_popover_module_bpPopoverMediumRightSlideEnter--5379f{
10776
+ from{
10777
+ transform:translateX(var(--bp-space-020));
10778
+ }
10779
+ to{
10780
+ transform:translateX(0);
10781
+ }
10782
+ }
10783
+ @keyframes bp_popover_module_bpPopoverMediumRightSlideExit--5379f{
10784
+ from{
10785
+ transform:translateX(0);
10786
+ }
10787
+ to{
10788
+ transform:translateX(var(--bp-space-020));
10789
+ }
10790
+ }
10791
+ @keyframes bp_popover_module_bpPopoverLargeTopSlideEnter--5379f{
10792
+ from{
10793
+ transform:translateY(var(--bp-space-040)) var(--bp-scale-small);
10794
+ }
10795
+ to{
10796
+ transform:translateY(0) var(--bp-scale-default);
10797
+ }
10798
+ }
10799
+ @keyframes bp_popover_module_bpPopoverLargeTopSlideExit--5379f{
10800
+ from{
10801
+ transform:translateY(0) var(--bp-scale-default);
10802
+ }
10803
+ to{
10804
+ transform:translateY(var(--bp-space-040)) var(--bp-scale-small);
10805
+ }
10806
+ }
10807
+ @keyframes bp_popover_module_bpPopoverLargeBottomSlideEnter--5379f{
10808
+ from{
10809
+ transform:translateY(calc(var(--bp-space-040)*-1)) var(--bp-scale-small);
10810
+ }
10811
+ to{
10812
+ transform:translateY(0) var(--bp-scale-default);
10813
+ }
10814
+ }
10815
+ @keyframes bp_popover_module_bpPopoverLargeBottomSlideExit--5379f{
10816
+ from{
10817
+ transform:translateY(0) var(--bp-scale-default);
10818
+ }
10819
+ to{
10820
+ transform:translateY(calc(var(--bp-space-040)*-1)) var(--bp-scale-small);
10821
+ }
10822
+ }
10823
+ @keyframes bp_popover_module_bpPopoverLargeLeftSlideEnter--5379f{
10824
+ from{
10825
+ transform:translateX(calc(var(--bp-space-040)*-1)) var(--bp-scale-small);
10826
+ }
10827
+ to{
10828
+ transform:translateX(0) var(--bp-scale-default);
10829
+ }
10830
+ }
10831
+ @keyframes bp_popover_module_bpPopoverLargeLeftSlideExit--5379f{
10832
+ from{
10833
+ transform:translateX(0) var(--bp-scale-default);
10834
+ }
10835
+ to{
10836
+ transform:translateX(calc(var(--bp-space-040)*-1)) var(--bp-scale-small);
10837
+ }
10838
+ }
10839
+ @keyframes bp_popover_module_bpPopoverLargeRightSlideEnter--5379f{
10840
+ from{
10841
+ transform:translateX(var(--bp-space-040)) var(--bp-scale-small);
10842
+ }
10843
+ to{
10844
+ transform:translateX(0) var(--bp-scale-default);
10845
+ }
10846
+ }
10847
+ @keyframes bp_popover_module_bpPopoverLargeRightSlideExit--5379f{
10848
+ from{
10849
+ transform:translateX(0) var(--bp-scale-default);
10850
+ }
10851
+ to{
10852
+ transform:translateX(var(--bp-space-040)) var(--bp-scale-small);
10853
+ }
10854
+ }
10645
10855
  .bp_select_menu_grid_module_grid--6e766{
10646
10856
  display:flex;
10647
10857
  flex-direction:column;
@@ -3,15 +3,20 @@ import { Space4 } from '@box/blueprint-web-assets/tokens/tokens';
3
3
  import * as RadixPopover from '@radix-ui/react-popover';
4
4
  import clsx from 'clsx';
5
5
  import { forwardRef, useContext, useState, useMemo, useCallback } from 'react';
6
+ import { useBlueprintConfiguration } from '../../blueprint-configuration-context/useBlueprintConfiguration.js';
6
7
  import { useBlueprintModernization } from '../../blueprint-modernization-context/useBlueprintModernization.js';
7
8
  import { Card } from '../../card/card.js';
8
9
  import { useBreakpoint, Breakpoint } from '../../utils/useBreakpoint.js';
10
+ import { useContentSizeObserver } from '../../utils/useContentSizeObserver.js';
11
+ import { useForkRef } from '../../utils/useForkRef.js';
9
12
  import { focusRadioGroupFirstIfExists } from './popover-focus-utils.js';
10
13
  import styles from './popover.module.js';
11
14
  import { PopoverModalityContext } from './utils/popover-modality-context.js';
12
15
  import { PopoverOverflowContext } from './utils/popover-overflow-context.js';
13
16
 
14
17
  const DEFAULT_COLLISION_PADDING = parseInt(Space4, 10);
18
+ // defined by the figma design specs
19
+ const LARGE_CONTENT_ANIMATION_THRESHOLD = 360;
15
20
  /**
16
21
  * Based on Radix-UI Popover Content
17
22
  * @see https://www.radix-ui.com/primitives/docs/components/popover#content
@@ -33,6 +38,11 @@ const PopoverContentContainer = /*#__PURE__*/forwardRef((props, forwardedRef) =>
33
38
  const {
34
39
  enableModernizedComponents
35
40
  } = useBlueprintModernization();
41
+ const {
42
+ componentsWithAnimationEnabled
43
+ } = useBlueprintConfiguration();
44
+ const isAnimationEnabled = componentsWithAnimationEnabled.includes('Popover');
45
+ const sizeObserverRef = useContentSizeObserver(LARGE_CONTENT_ANIMATION_THRESHOLD, LARGE_CONTENT_ANIMATION_THRESHOLD);
36
46
  const accessibilitySmallBreakpoint = smallBreakpoint && isInteractionDisabled;
37
47
  const [isContentOverflowing, setIsContentOverflowing] = useState(false);
38
48
  const providerValue = useMemo(() => ({
@@ -51,17 +61,18 @@ const PopoverContentContainer = /*#__PURE__*/forwardRef((props, forwardedRef) =>
51
61
  // TODO(DSYS-440): Unify all Portals (Tooltip, Select, Popover, etc...), Expose a Provider which would tell where to mount (body? other elem?)
52
62
  jsx(RadixPopover.Portal, {
53
63
  container: container,
54
- children: jsx(PopoverOverflowContext.Provider, {
55
- value: providerValue,
56
- children: jsx(RadixPopover.Content, {
57
- ...rest,
58
- ref: forwardedRef,
59
- className: clsx(styles.popoverContentContainer, {
60
- [styles.accessibilitySmallBreakpoint]: accessibilitySmallBreakpoint
61
- }, className),
62
- collisionPadding: collisionPadding,
63
- "data-modern": enableModernizedComponents ? 'true' : 'false',
64
- onOpenAutoFocus: handleOpenAutoFocus,
64
+ children: jsx(RadixPopover.Content, {
65
+ ...rest,
66
+ ref: useForkRef(forwardedRef, sizeObserverRef),
67
+ className: clsx(styles.popoverContentContainer, {
68
+ [styles.accessibilitySmallBreakpoint]: accessibilitySmallBreakpoint
69
+ }, className),
70
+ collisionPadding: collisionPadding,
71
+ "data-modern": enableModernizedComponents ? 'true' : 'false',
72
+ "data-bp-animated": isAnimationEnabled ? 'true' : 'false',
73
+ onOpenAutoFocus: handleOpenAutoFocus,
74
+ children: jsx(PopoverOverflowContext.Provider, {
75
+ value: providerValue,
65
76
  children: jsx(Card, {
66
77
  className: styles.popoverCard,
67
78
  children: jsx("div", {
@@ -1,4 +1,4 @@
1
1
  import '../../index.css';
2
- var styles = {"popoverContentContainer":"bp_popover_module_popoverContentContainer--a0d71","accessibilitySmallBreakpoint":"bp_popover_module_accessibilitySmallBreakpoint--a0d71","popoverCard":"bp_popover_module_popoverCard--a0d71","popoverScrollContainer":"bp_popover_module_popoverScrollContainer--a0d71","popoverMainContent":"bp_popover_module_popoverMainContent--a0d71","popoverMainContentOuterContainer":"bp_popover_module_popoverMainContentOuterContainer--a0d71","popoverMainContentInnerContainerPadding":"bp_popover_module_popoverMainContentInnerContainerPadding--a0d71","popoverFooter":"bp_popover_module_popoverFooter--a0d71","popoverFooterTopBorder":"bp_popover_module_popoverFooterTopBorder--a0d71"};
2
+ var styles = {"popoverContentContainer":"bp_popover_module_popoverContentContainer--5379f","accessibilitySmallBreakpoint":"bp_popover_module_accessibilitySmallBreakpoint--5379f","popoverCard":"bp_popover_module_popoverCard--5379f","popoverScrollContainer":"bp_popover_module_popoverScrollContainer--5379f","popoverMainContent":"bp_popover_module_popoverMainContent--5379f","popoverMainContentOuterContainer":"bp_popover_module_popoverMainContentOuterContainer--5379f","popoverMainContentInnerContainerPadding":"bp_popover_module_popoverMainContentInnerContainerPadding--5379f","popoverFooter":"bp_popover_module_popoverFooter--5379f","popoverFooterTopBorder":"bp_popover_module_popoverFooterTopBorder--5379f"};
3
3
 
4
4
  export { styles as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/blueprint-web",
3
- "version": "14.22.0",
3
+ "version": "14.23.0",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": {
@@ -47,7 +47,7 @@
47
47
  "dependencies": {
48
48
  "@ariakit/react": "0.4.21",
49
49
  "@ariakit/react-core": "0.4.21",
50
- "@box/blueprint-web-assets": "^4.115.9",
50
+ "@box/blueprint-web-assets": "^4.115.10",
51
51
  "@internationalized/date": "^3.12.0",
52
52
  "@radix-ui/react-accordion": "1.1.2",
53
53
  "@radix-ui/react-checkbox": "1.0.4",
@@ -77,7 +77,7 @@
77
77
  "type-fest": "^3.2.0"
78
78
  },
79
79
  "devDependencies": {
80
- "@box/storybook-utils": "^0.18.9",
80
+ "@box/storybook-utils": "^0.18.10",
81
81
  "@figma/code-connect": "1.4.4",
82
82
  "@types/react": "^18.0.0",
83
83
  "@types/react-dom": "^18.0.0",