@box/blueprint-web 16.15.0 → 16.16.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.
@@ -14672,7 +14672,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14672
14672
  .bp_styles_module_dropdown--a3588{
14673
14673
  min-width:var(--split-button-dropdown-min-width);
14674
14674
  }
14675
- .bp_switch_module_option--a1cfd[data-modern=false]{
14675
+ .bp_switch_module_option--21edc[data-modern=false]{
14676
14676
  --switch-height:var(--size-5);
14677
14677
  --switch-margin-left:var(--space-10);
14678
14678
  --switch-margin-right:var(--space-3);
@@ -14684,7 +14684,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14684
14684
  --switch-padding-inline:0;
14685
14685
  --switch-width:var(--size-10);
14686
14686
  --switch-outline:var(--outline-focus-on-light);
14687
- --switch-disabled-opacity:.5;
14687
+ --switch-disabled-opacity:0.5;
14688
14688
  --description-margin:calc(var(--switch-margin-right) + var(--switch-width));
14689
14689
  --thumb-width:var(--size-5);
14690
14690
  --thumb-height:var(--size-5);
@@ -14692,7 +14692,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14692
14692
  --thumb-border:var(--border-1) solid var(--border-switch-border);
14693
14693
  --thumb-radius:var(--size-10);
14694
14694
  --thumb-shadow:var(--dropshadow-3);
14695
- --thumb-transform:translateX(calc(var(--switch-width) - var(--thumb-width)));
14695
+ --thumb-translate-x:calc(var(--switch-width) - var(--thumb-width));
14696
14696
  font-family:var(--body-default-font-family);
14697
14697
  font-size:var(--body-default-font-size);
14698
14698
  font-weight:var(--body-default-font-weight);
@@ -14702,7 +14702,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14702
14702
  text-transform:var(--body-default-text-case);
14703
14703
  }
14704
14704
 
14705
- .bp_switch_module_option--a1cfd[data-modern=true]{
14705
+ .bp_switch_module_option--21edc[data-modern=true]{
14706
14706
  --switch-height:var(--bp-size-060);
14707
14707
  --switch-margin-left:var(--bp-space-100);
14708
14708
  --switch-margin-right:var(--bp-space-030);
@@ -14714,7 +14714,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14714
14714
  --switch-padding-inline:var(--bp-space-005);
14715
14715
  --switch-width:var(--bp-size-110);
14716
14716
  --switch-outline:var(--bp-outline-focus-on-light);
14717
- --switch-disabled-opacity:.6;
14717
+ --switch-disabled-opacity:0.6;
14718
14718
  --description-margin:calc(var(--switch-margin-right) + var(--switch-width));
14719
14719
  --thumb-width:var(--bp-size-050);
14720
14720
  --thumb-height:var(--bp-size-050);
@@ -14722,7 +14722,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14722
14722
  --thumb-border:none;
14723
14723
  --thumb-radius:var(--bp-size-100);
14724
14724
  --thumb-shadow:var(--dropshadow-3);
14725
- --thumb-transform:translateX(calc(var(--switch-width) - var(--thumb-width) - var(--switch-padding-inline)*2));
14725
+ --thumb-translate-x:calc(var(--switch-width) - var(--thumb-width) - var(--switch-padding-inline)*2);
14726
14726
  font-family:var(--bp-font-font-family), -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
14727
14727
  font-size:var(--bp-font-size-05);
14728
14728
  font-style:normal;
@@ -14730,7 +14730,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14730
14730
  letter-spacing:var(--bp-font-letter-spacing-01);
14731
14731
  line-height:var(--bp-font-line-height-04);
14732
14732
  }
14733
- :where(body.is-inter-font) .bp_switch_module_option--a1cfd[data-modern=true]{
14733
+ :where(body.is-inter-font) .bp_switch_module_option--21edc[data-modern=true]{
14734
14734
  font-family:InterVariable, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
14735
14735
  font-size:.875rem;
14736
14736
  font-style:normal;
@@ -14741,32 +14741,32 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14741
14741
  text-transform:none;
14742
14742
  }
14743
14743
 
14744
- .bp_switch_module_option--a1cfd{
14744
+ .bp_switch_module_option--21edc{
14745
14745
  display:flex;
14746
14746
  flex-direction:column;
14747
14747
  }
14748
- .bp_switch_module_option--a1cfd .bp_switch_module_label--a1cfd{
14748
+ .bp_switch_module_option--21edc .bp_switch_module_label--21edc{
14749
14749
  cursor:pointer;
14750
14750
  display:inline-flex;
14751
14751
  flex-direction:row;
14752
14752
  width:fit-content;
14753
14753
  }
14754
- .bp_switch_module_option--a1cfd .bp_switch_module_label--a1cfd.bp_switch_module_rightAlign--a1cfd{
14754
+ .bp_switch_module_option--21edc .bp_switch_module_label--21edc.bp_switch_module_rightAlign--21edc{
14755
14755
  flex-direction:row-reverse;
14756
14756
  justify-content:space-between;
14757
14757
  width:unset;
14758
14758
  }
14759
- .bp_switch_module_option--a1cfd .bp_switch_module_label--a1cfd:has(.bp_switch_module_switch--a1cfd:disabled){
14759
+ .bp_switch_module_option--21edc .bp_switch_module_label--21edc:has(.bp_switch_module_switch--21edc:disabled){
14760
14760
  cursor:default;
14761
14761
  }
14762
- .bp_switch_module_option--a1cfd .bp_switch_module_description--a1cfd{
14762
+ .bp_switch_module_option--21edc .bp_switch_module_description--21edc{
14763
14763
  margin-left:var(--description-margin);
14764
14764
  }
14765
- .bp_switch_module_option--a1cfd .bp_switch_module_description--a1cfd.bp_switch_module_rightAlign--a1cfd{
14765
+ .bp_switch_module_option--21edc .bp_switch_module_description--21edc.bp_switch_module_rightAlign--21edc{
14766
14766
  margin-left:unset;
14767
14767
  margin-right:var(--description-margin);
14768
14768
  }
14769
- .bp_switch_module_option--a1cfd .bp_switch_module_thumb--a1cfd{
14769
+ .bp_switch_module_option--21edc .bp_switch_module_thumb--21edc{
14770
14770
  background-color:var(--thumb-bg);
14771
14771
  border:var(--thumb-border);
14772
14772
  border-radius:var(--thumb-radius);
@@ -14774,11 +14774,11 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14774
14774
  box-sizing:border-box;
14775
14775
  display:block;
14776
14776
  height:var(--thumb-height);
14777
- transition:transform .4s;
14777
+ transition:translate .4s;
14778
14778
  width:var(--thumb-width);
14779
- will-change:transform;
14779
+ will-change:translate;
14780
14780
  }
14781
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd{
14781
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc{
14782
14782
  all:unset;
14783
14783
  align-items:center;
14784
14784
  background-color:var(--switch-bg-off);
@@ -14794,34 +14794,124 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14794
14794
  width:var(--switch-width);
14795
14795
  will-change:transition;
14796
14796
  }
14797
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd:disabled{
14797
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc:disabled{
14798
14798
  opacity:var(--switch-disabled-opacity);
14799
14799
  }
14800
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd.bp_switch_module_rightAlign--a1cfd{
14800
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc.bp_switch_module_rightAlign--21edc{
14801
14801
  margin-left:var(--switch-margin-left);
14802
14802
  margin-right:unset;
14803
14803
  }
14804
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd:focus-visible{
14804
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc:focus-visible{
14805
14805
  background-color:var(--switch-bg-off-hover);
14806
14806
  box-shadow:0 0 0 var(--border-1, 1px) var(--background-background), 0 0 0 var(--border-3) var(--switch-outline);
14807
14807
  }
14808
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd:hover:not(:disabled){
14808
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc:hover:not(:disabled){
14809
14809
  background-color:var(--switch-bg-off-hover);
14810
14810
  }
14811
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd[aria-checked=true]{
14811
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc[aria-checked=true]{
14812
14812
  background-color:var(--switch-bg-on);
14813
14813
  }
14814
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd[aria-checked=true] .bp_switch_module_thumb--a1cfd{
14815
- transform:var(--thumb-transform);
14814
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc[aria-checked=true] .bp_switch_module_thumb--21edc{
14815
+ translate:var(--thumb-translate-x);
14816
14816
  }
14817
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd[aria-checked=true]:focus-visible{
14817
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc[aria-checked=true]:focus-visible{
14818
14818
  background-color:var(--switch-bg-on-hover);
14819
14819
  box-shadow:0 0 0 var(--border-1, 1px) var(--background-background), 0 0 0 var(--border-3) var(--switch-outline);
14820
14820
  }
14821
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd[aria-checked=true]:hover:not(:disabled){
14821
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc[aria-checked=true]:hover:not(:disabled){
14822
14822
  background-color:var(--switch-bg-on-hover);
14823
14823
  }
14824
14824
 
14825
+ .bp_switch_module_option--21edc[data-bp-animated=true] .bp_switch_module_switch--21edc:active .bp_switch_module_thumb--21edc{
14826
+ scale:var(--bp-scale-extra-small);
14827
+ transform-origin:left center;
14828
+ transition:translate .4s, scale var(--bp-duration-short) var(--bp-curve-small-on);
14829
+ }
14830
+ .bp_switch_module_option--21edc[data-bp-animated=true] .bp_switch_module_switch--21edc[data-bp-was-toggled=true][aria-checked=true]{
14831
+ animation-delay:var(--bp-duration-short);
14832
+ animation-duration:var(--bp-duration-short);
14833
+ animation-fill-mode:both;
14834
+ animation-name:bp_switch_module_bpSwitchToggleOnBackground--21edc;
14835
+ animation-timing-function:var(--bp-curve-extra-small-on);
14836
+ background-color:var(--switch-bg-on);
14837
+ }
14838
+ .bp_switch_module_option--21edc[data-bp-animated=true] .bp_switch_module_switch--21edc[data-bp-was-toggled=true][aria-checked=true]:not(:focus-visible):hover:not(:disabled){
14839
+ --hovered-transition-color-on:var(--switch-bg-on-hover);
14840
+ }
14841
+ .bp_switch_module_option--21edc[data-bp-animated=true] .bp_switch_module_switch--21edc[data-bp-was-toggled=true][aria-checked=true] .bp_switch_module_thumb--21edc{
14842
+ animation-delay:0s, var(--bp-duration-short);
14843
+ animation-duration:var(--bp-duration-short), var(--bp-duration-short);
14844
+ animation-name:bp_switch_module_bpSwitchToggleOnStart--21edc, bp_switch_module_bpSwitchToggleOnEnd--21edc;
14845
+ animation-timing-function:var(--bp-curve-extra-small-on), var(--bp-curve-extra-small-on);
14846
+ transform-origin:right center;
14847
+ }
14848
+ .bp_switch_module_option--21edc[data-bp-animated=true] .bp_switch_module_switch--21edc[data-bp-was-toggled=true][aria-checked=false]{
14849
+ animation-delay:var(--bp-duration-short);
14850
+ animation-duration:var(--bp-duration-short);
14851
+ animation-fill-mode:both;
14852
+ animation-name:bp_switch_module_bpSwitchToggleOffBackground--21edc;
14853
+ animation-timing-function:var(--bp-curve-extra-small-off);
14854
+ background-color:var(--switch-bg-off);
14855
+ }
14856
+ .bp_switch_module_option--21edc[data-bp-animated=true] .bp_switch_module_switch--21edc[data-bp-was-toggled=true][aria-checked=false]:not(:focus-visible):hover:not(:disabled){
14857
+ --hovered-transition-color-off:var(--switch-bg-off-hover);
14858
+ }
14859
+ .bp_switch_module_option--21edc[data-bp-animated=true] .bp_switch_module_switch--21edc[data-bp-was-toggled=true][aria-checked=false] .bp_switch_module_thumb--21edc{
14860
+ animation-delay:0s, var(--bp-duration-short);
14861
+ animation-duration:var(--bp-duration-short), var(--bp-duration-short);
14862
+ animation-name:bp_switch_module_bpSwitchToggleOffStart--21edc, bp_switch_module_bpSwitchToggleOffEnd--21edc;
14863
+ animation-timing-function:var(--bp-curve-extra-small-off), var(--bp-curve-extra-small-off);
14864
+ }
14865
+
14866
+ @keyframes bp_switch_module_bpSwitchToggleOnStart--21edc{
14867
+ 0%{
14868
+ scale:var(--bp-scale-extra-small);
14869
+ }
14870
+ 100%{
14871
+ scale:var(--bp-scale-large);
14872
+ }
14873
+ }
14874
+ @keyframes bp_switch_module_bpSwitchToggleOffStart--21edc{
14875
+ from{
14876
+ scale:var(--bp-scale-extra-small);
14877
+ }
14878
+ to{
14879
+ scale:var(--bp-scale-large);
14880
+ }
14881
+ }
14882
+ @keyframes bp_switch_module_bpSwitchToggleOnBackground--21edc{
14883
+ from{
14884
+ background-color:var(--hovered-transition-color-off, var(--switch-bg-off-hover));
14885
+ }
14886
+ to{
14887
+ background-color:var(--hovered-transition-color-on, var(--switch-bg-on));
14888
+ }
14889
+ }
14890
+ @keyframes bp_switch_module_bpSwitchToggleOffBackground--21edc{
14891
+ from{
14892
+ background-color:var(--hovered-transition-color-on, var(--switch-bg-on));
14893
+ }
14894
+ to{
14895
+ background-color:var(--hovered-transition-color-off, var(--switch-bg-off));
14896
+ }
14897
+ }
14898
+ @keyframes bp_switch_module_bpSwitchToggleOnEnd--21edc{
14899
+ from{
14900
+ scale:var(--bp-scale-large);
14901
+ }
14902
+ to{
14903
+ scale:var(--bp-scale-default);
14904
+ }
14905
+ }
14906
+ @keyframes bp_switch_module_bpSwitchToggleOffEnd--21edc{
14907
+ from{
14908
+ scale:var(--bp-scale-large);
14909
+ }
14910
+ to{
14911
+ scale:var(--bp-scale-default);
14912
+ }
14913
+ }
14914
+
14825
14915
  .bp_text_input_module_textInput--91b57.bp_text_input_module_textInput--91b57.bp_text_input_module_textInput--91b57 input:has(+ .bp_text_input_module_iconEnd--91b57){
14826
14916
  padding-inline-end:1.875rem;
14827
14917
  }
@@ -14672,7 +14672,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14672
14672
  .bp_styles_module_dropdown--a3588{
14673
14673
  min-width:var(--split-button-dropdown-min-width);
14674
14674
  }
14675
- .bp_switch_module_option--a1cfd[data-modern=false]{
14675
+ .bp_switch_module_option--21edc[data-modern=false]{
14676
14676
  --switch-height:var(--size-5);
14677
14677
  --switch-margin-left:var(--space-10);
14678
14678
  --switch-margin-right:var(--space-3);
@@ -14684,7 +14684,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14684
14684
  --switch-padding-inline:0;
14685
14685
  --switch-width:var(--size-10);
14686
14686
  --switch-outline:var(--outline-focus-on-light);
14687
- --switch-disabled-opacity:.5;
14687
+ --switch-disabled-opacity:0.5;
14688
14688
  --description-margin:calc(var(--switch-margin-right) + var(--switch-width));
14689
14689
  --thumb-width:var(--size-5);
14690
14690
  --thumb-height:var(--size-5);
@@ -14692,7 +14692,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14692
14692
  --thumb-border:var(--border-1) solid var(--border-switch-border);
14693
14693
  --thumb-radius:var(--size-10);
14694
14694
  --thumb-shadow:var(--dropshadow-3);
14695
- --thumb-transform:translateX(calc(var(--switch-width) - var(--thumb-width)));
14695
+ --thumb-translate-x:calc(var(--switch-width) - var(--thumb-width));
14696
14696
  font-family:var(--body-default-font-family);
14697
14697
  font-size:var(--body-default-font-size);
14698
14698
  font-weight:var(--body-default-font-weight);
@@ -14702,7 +14702,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14702
14702
  text-transform:var(--body-default-text-case);
14703
14703
  }
14704
14704
 
14705
- .bp_switch_module_option--a1cfd[data-modern=true]{
14705
+ .bp_switch_module_option--21edc[data-modern=true]{
14706
14706
  --switch-height:var(--bp-size-060);
14707
14707
  --switch-margin-left:var(--bp-space-100);
14708
14708
  --switch-margin-right:var(--bp-space-030);
@@ -14714,7 +14714,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14714
14714
  --switch-padding-inline:var(--bp-space-005);
14715
14715
  --switch-width:var(--bp-size-110);
14716
14716
  --switch-outline:var(--bp-outline-focus-on-light);
14717
- --switch-disabled-opacity:.6;
14717
+ --switch-disabled-opacity:0.6;
14718
14718
  --description-margin:calc(var(--switch-margin-right) + var(--switch-width));
14719
14719
  --thumb-width:var(--bp-size-050);
14720
14720
  --thumb-height:var(--bp-size-050);
@@ -14722,7 +14722,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14722
14722
  --thumb-border:none;
14723
14723
  --thumb-radius:var(--bp-size-100);
14724
14724
  --thumb-shadow:var(--dropshadow-3);
14725
- --thumb-transform:translateX(calc(var(--switch-width) - var(--thumb-width) - var(--switch-padding-inline)*2));
14725
+ --thumb-translate-x:calc(var(--switch-width) - var(--thumb-width) - var(--switch-padding-inline)*2);
14726
14726
  font-family:var(--bp-font-font-family), -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
14727
14727
  font-size:var(--bp-font-size-05);
14728
14728
  font-style:normal;
@@ -14730,7 +14730,7 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14730
14730
  letter-spacing:var(--bp-font-letter-spacing-01);
14731
14731
  line-height:var(--bp-font-line-height-04);
14732
14732
  }
14733
- :where(body.is-inter-font) .bp_switch_module_option--a1cfd[data-modern=true]{
14733
+ :where(body.is-inter-font) .bp_switch_module_option--21edc[data-modern=true]{
14734
14734
  font-family:InterVariable, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
14735
14735
  font-size:.875rem;
14736
14736
  font-style:normal;
@@ -14741,32 +14741,32 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14741
14741
  text-transform:none;
14742
14742
  }
14743
14743
 
14744
- .bp_switch_module_option--a1cfd{
14744
+ .bp_switch_module_option--21edc{
14745
14745
  display:flex;
14746
14746
  flex-direction:column;
14747
14747
  }
14748
- .bp_switch_module_option--a1cfd .bp_switch_module_label--a1cfd{
14748
+ .bp_switch_module_option--21edc .bp_switch_module_label--21edc{
14749
14749
  cursor:pointer;
14750
14750
  display:inline-flex;
14751
14751
  flex-direction:row;
14752
14752
  width:fit-content;
14753
14753
  }
14754
- .bp_switch_module_option--a1cfd .bp_switch_module_label--a1cfd.bp_switch_module_rightAlign--a1cfd{
14754
+ .bp_switch_module_option--21edc .bp_switch_module_label--21edc.bp_switch_module_rightAlign--21edc{
14755
14755
  flex-direction:row-reverse;
14756
14756
  justify-content:space-between;
14757
14757
  width:unset;
14758
14758
  }
14759
- .bp_switch_module_option--a1cfd .bp_switch_module_label--a1cfd:has(.bp_switch_module_switch--a1cfd:disabled){
14759
+ .bp_switch_module_option--21edc .bp_switch_module_label--21edc:has(.bp_switch_module_switch--21edc:disabled){
14760
14760
  cursor:default;
14761
14761
  }
14762
- .bp_switch_module_option--a1cfd .bp_switch_module_description--a1cfd{
14762
+ .bp_switch_module_option--21edc .bp_switch_module_description--21edc{
14763
14763
  margin-left:var(--description-margin);
14764
14764
  }
14765
- .bp_switch_module_option--a1cfd .bp_switch_module_description--a1cfd.bp_switch_module_rightAlign--a1cfd{
14765
+ .bp_switch_module_option--21edc .bp_switch_module_description--21edc.bp_switch_module_rightAlign--21edc{
14766
14766
  margin-left:unset;
14767
14767
  margin-right:var(--description-margin);
14768
14768
  }
14769
- .bp_switch_module_option--a1cfd .bp_switch_module_thumb--a1cfd{
14769
+ .bp_switch_module_option--21edc .bp_switch_module_thumb--21edc{
14770
14770
  background-color:var(--thumb-bg);
14771
14771
  border:var(--thumb-border);
14772
14772
  border-radius:var(--thumb-radius);
@@ -14774,11 +14774,11 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14774
14774
  box-sizing:border-box;
14775
14775
  display:block;
14776
14776
  height:var(--thumb-height);
14777
- transition:transform .4s;
14777
+ transition:translate .4s;
14778
14778
  width:var(--thumb-width);
14779
- will-change:transform;
14779
+ will-change:translate;
14780
14780
  }
14781
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd{
14781
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc{
14782
14782
  all:unset;
14783
14783
  align-items:center;
14784
14784
  background-color:var(--switch-bg-off);
@@ -14794,34 +14794,124 @@ div[data-radix-popper-content-wrapper]:has([role=menu]):has([data-state=open]):h
14794
14794
  width:var(--switch-width);
14795
14795
  will-change:transition;
14796
14796
  }
14797
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd:disabled{
14797
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc:disabled{
14798
14798
  opacity:var(--switch-disabled-opacity);
14799
14799
  }
14800
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd.bp_switch_module_rightAlign--a1cfd{
14800
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc.bp_switch_module_rightAlign--21edc{
14801
14801
  margin-left:var(--switch-margin-left);
14802
14802
  margin-right:unset;
14803
14803
  }
14804
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd:focus-visible{
14804
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc:focus-visible{
14805
14805
  background-color:var(--switch-bg-off-hover);
14806
14806
  box-shadow:0 0 0 var(--border-1, 1px) var(--background-background), 0 0 0 var(--border-3) var(--switch-outline);
14807
14807
  }
14808
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd:hover:not(:disabled){
14808
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc:hover:not(:disabled){
14809
14809
  background-color:var(--switch-bg-off-hover);
14810
14810
  }
14811
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd[aria-checked=true]{
14811
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc[aria-checked=true]{
14812
14812
  background-color:var(--switch-bg-on);
14813
14813
  }
14814
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd[aria-checked=true] .bp_switch_module_thumb--a1cfd{
14815
- transform:var(--thumb-transform);
14814
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc[aria-checked=true] .bp_switch_module_thumb--21edc{
14815
+ translate:var(--thumb-translate-x);
14816
14816
  }
14817
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd[aria-checked=true]:focus-visible{
14817
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc[aria-checked=true]:focus-visible{
14818
14818
  background-color:var(--switch-bg-on-hover);
14819
14819
  box-shadow:0 0 0 var(--border-1, 1px) var(--background-background), 0 0 0 var(--border-3) var(--switch-outline);
14820
14820
  }
14821
- .bp_switch_module_option--a1cfd .bp_switch_module_switch--a1cfd[aria-checked=true]:hover:not(:disabled){
14821
+ .bp_switch_module_option--21edc .bp_switch_module_switch--21edc[aria-checked=true]:hover:not(:disabled){
14822
14822
  background-color:var(--switch-bg-on-hover);
14823
14823
  }
14824
14824
 
14825
+ .bp_switch_module_option--21edc[data-bp-animated=true] .bp_switch_module_switch--21edc:active .bp_switch_module_thumb--21edc{
14826
+ scale:var(--bp-scale-extra-small);
14827
+ transform-origin:left center;
14828
+ transition:translate .4s, scale var(--bp-duration-short) var(--bp-curve-small-on);
14829
+ }
14830
+ .bp_switch_module_option--21edc[data-bp-animated=true] .bp_switch_module_switch--21edc[data-bp-was-toggled=true][aria-checked=true]{
14831
+ animation-delay:var(--bp-duration-short);
14832
+ animation-duration:var(--bp-duration-short);
14833
+ animation-fill-mode:both;
14834
+ animation-name:bp_switch_module_bpSwitchToggleOnBackground--21edc;
14835
+ animation-timing-function:var(--bp-curve-extra-small-on);
14836
+ background-color:var(--switch-bg-on);
14837
+ }
14838
+ .bp_switch_module_option--21edc[data-bp-animated=true] .bp_switch_module_switch--21edc[data-bp-was-toggled=true][aria-checked=true]:not(:focus-visible):hover:not(:disabled){
14839
+ --hovered-transition-color-on:var(--switch-bg-on-hover);
14840
+ }
14841
+ .bp_switch_module_option--21edc[data-bp-animated=true] .bp_switch_module_switch--21edc[data-bp-was-toggled=true][aria-checked=true] .bp_switch_module_thumb--21edc{
14842
+ animation-delay:0s, var(--bp-duration-short);
14843
+ animation-duration:var(--bp-duration-short), var(--bp-duration-short);
14844
+ animation-name:bp_switch_module_bpSwitchToggleOnStart--21edc, bp_switch_module_bpSwitchToggleOnEnd--21edc;
14845
+ animation-timing-function:var(--bp-curve-extra-small-on), var(--bp-curve-extra-small-on);
14846
+ transform-origin:right center;
14847
+ }
14848
+ .bp_switch_module_option--21edc[data-bp-animated=true] .bp_switch_module_switch--21edc[data-bp-was-toggled=true][aria-checked=false]{
14849
+ animation-delay:var(--bp-duration-short);
14850
+ animation-duration:var(--bp-duration-short);
14851
+ animation-fill-mode:both;
14852
+ animation-name:bp_switch_module_bpSwitchToggleOffBackground--21edc;
14853
+ animation-timing-function:var(--bp-curve-extra-small-off);
14854
+ background-color:var(--switch-bg-off);
14855
+ }
14856
+ .bp_switch_module_option--21edc[data-bp-animated=true] .bp_switch_module_switch--21edc[data-bp-was-toggled=true][aria-checked=false]:not(:focus-visible):hover:not(:disabled){
14857
+ --hovered-transition-color-off:var(--switch-bg-off-hover);
14858
+ }
14859
+ .bp_switch_module_option--21edc[data-bp-animated=true] .bp_switch_module_switch--21edc[data-bp-was-toggled=true][aria-checked=false] .bp_switch_module_thumb--21edc{
14860
+ animation-delay:0s, var(--bp-duration-short);
14861
+ animation-duration:var(--bp-duration-short), var(--bp-duration-short);
14862
+ animation-name:bp_switch_module_bpSwitchToggleOffStart--21edc, bp_switch_module_bpSwitchToggleOffEnd--21edc;
14863
+ animation-timing-function:var(--bp-curve-extra-small-off), var(--bp-curve-extra-small-off);
14864
+ }
14865
+
14866
+ @keyframes bp_switch_module_bpSwitchToggleOnStart--21edc{
14867
+ 0%{
14868
+ scale:var(--bp-scale-extra-small);
14869
+ }
14870
+ 100%{
14871
+ scale:var(--bp-scale-large);
14872
+ }
14873
+ }
14874
+ @keyframes bp_switch_module_bpSwitchToggleOffStart--21edc{
14875
+ from{
14876
+ scale:var(--bp-scale-extra-small);
14877
+ }
14878
+ to{
14879
+ scale:var(--bp-scale-large);
14880
+ }
14881
+ }
14882
+ @keyframes bp_switch_module_bpSwitchToggleOnBackground--21edc{
14883
+ from{
14884
+ background-color:var(--hovered-transition-color-off, var(--switch-bg-off-hover));
14885
+ }
14886
+ to{
14887
+ background-color:var(--hovered-transition-color-on, var(--switch-bg-on));
14888
+ }
14889
+ }
14890
+ @keyframes bp_switch_module_bpSwitchToggleOffBackground--21edc{
14891
+ from{
14892
+ background-color:var(--hovered-transition-color-on, var(--switch-bg-on));
14893
+ }
14894
+ to{
14895
+ background-color:var(--hovered-transition-color-off, var(--switch-bg-off));
14896
+ }
14897
+ }
14898
+ @keyframes bp_switch_module_bpSwitchToggleOnEnd--21edc{
14899
+ from{
14900
+ scale:var(--bp-scale-large);
14901
+ }
14902
+ to{
14903
+ scale:var(--bp-scale-default);
14904
+ }
14905
+ }
14906
+ @keyframes bp_switch_module_bpSwitchToggleOffEnd--21edc{
14907
+ from{
14908
+ scale:var(--bp-scale-large);
14909
+ }
14910
+ to{
14911
+ scale:var(--bp-scale-default);
14912
+ }
14913
+ }
14914
+
14825
14915
  .bp_text_input_module_textInput--91b57.bp_text_input_module_textInput--91b57.bp_text_input_module_textInput--91b57 input:has(+ .bp_text_input_module_iconEnd--91b57){
14826
14916
  padding-inline-end:1.875rem;
14827
14917
  }
@@ -1,9 +1,13 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import * as RadixSwitch from '@radix-ui/react-switch';
3
3
  import clsx from 'clsx';
4
- import { forwardRef } from 'react';
4
+ import { forwardRef, useState } from 'react';
5
+ import '../blueprint-configuration-context/blueprint-configuration-context.js';
6
+ import '../blueprint-configuration-context/consts.js';
7
+ import { useBlueprintConfiguration } from '../blueprint-configuration-context/useBlueprintConfiguration.js';
5
8
  import { useBlueprintModernization } from '../blueprint-modernization-context/useBlueprintModernization.js';
6
9
  import { TextWithInfoBadge } from '../util-components/text-with-info-badge/text-with-info-badge.js';
10
+ import { composeEventHandlers } from '../utils/composeEventHandlers.js';
7
11
  import { useUniqueId } from '../utils/useUniqueId.js';
8
12
  import styles from './switch.module.js';
9
13
 
@@ -28,11 +32,17 @@ const Switch = /*#__PURE__*/forwardRef((props, forwardedRef) => {
28
32
  const {
29
33
  enableModernizedComponents
30
34
  } = useBlueprintModernization();
35
+ const {
36
+ componentsWithAnimationEnabled
37
+ } = useBlueprintConfiguration();
38
+ const isAnimationEnabled = componentsWithAnimationEnabled.includes('Switch');
39
+ const [wasToggled, setWasToggled] = useState(false);
31
40
  return jsxs("div", {
32
41
  className: clsx([styles.option], {
33
42
  [styles.disabled]: disabled
34
43
  }, className),
35
44
  "data-modern": enableModernizedComponents ? 'true' : 'false',
45
+ "data-bp-animated": isAnimationEnabled ? 'true' : 'false',
36
46
  children: [jsxs("label", {
37
47
  className: clsx(styles.label, {
38
48
  [styles.rightAlign]: isRightAligned
@@ -46,8 +56,13 @@ const Switch = /*#__PURE__*/forwardRef((props, forwardedRef) => {
46
56
  className: clsx(styles.switch, {
47
57
  [styles.rightAlign]: isRightAligned
48
58
  }),
59
+ "data-bp-was-toggled": wasToggled ? 'true' : 'false',
49
60
  disabled: disabled,
50
- onCheckedChange: onCheckedChange,
61
+ onCheckedChange: composeEventHandlers(onCheckedChange, () => {
62
+ if (!wasToggled) {
63
+ setWasToggled(true);
64
+ }
65
+ }),
51
66
  children: jsx(RadixSwitch.Thumb, {
52
67
  className: styles.thumb
53
68
  })
@@ -1,4 +1,4 @@
1
1
  import '../index.css';
2
- var styles = {"option":"bp_switch_module_option--a1cfd","label":"bp_switch_module_label--a1cfd","rightAlign":"bp_switch_module_rightAlign--a1cfd","switch":"bp_switch_module_switch--a1cfd","description":"bp_switch_module_description--a1cfd","thumb":"bp_switch_module_thumb--a1cfd"};
2
+ var styles = {"option":"bp_switch_module_option--21edc","label":"bp_switch_module_label--21edc","rightAlign":"bp_switch_module_rightAlign--21edc","switch":"bp_switch_module_switch--21edc","description":"bp_switch_module_description--21edc","thumb":"bp_switch_module_thumb--21edc"};
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": "16.15.0",
3
+ "version": "16.16.0",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": {
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "@ariakit/react": "0.4.21",
52
52
  "@ariakit/react-core": "0.4.21",
53
- "@box/blueprint-web-assets": "^5.6.3",
53
+ "@box/blueprint-web-assets": "^5.6.4",
54
54
  "@internationalized/date": "^3.12.0",
55
55
  "@radix-ui/react-accordion": "1.1.2",
56
56
  "@radix-ui/react-checkbox": "1.0.4",
@@ -79,7 +79,7 @@
79
79
  "type-fest": "^3.2.0"
80
80
  },
81
81
  "devDependencies": {
82
- "@box/storybook-utils": "^1.2.3",
82
+ "@box/storybook-utils": "^1.2.4",
83
83
  "@figma/code-connect": "1.4.4",
84
84
  "@types/react": "^18.0.0",
85
85
  "@types/react-dom": "^18.0.0",