From 9bdc5c70097db763dbcd657f09db1d14095bc97f Mon Sep 17 00:00:00 2001 From: Vu Luong Date: Thu, 25 May 2023 10:16:01 -0700 Subject: [PATCH 1/3] fix(compactSelect): Fix scrolling issue due to live-announcer --- package.json | 2 +- yarn.lock | 292 +++++++++++++++++++++++++++++---------------------- 2 files changed, 165 insertions(+), 129 deletions(-) diff --git a/package.json b/package.json index 9dce7ec7b4d6..a5fea99edc68 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@popperjs/core": "^2.11.5", "@react-aria/button": "^3.3.4", "@react-aria/focus": "^3.5.0", - "@react-aria/gridlist": "^3.1.2", + "@react-aria/gridlist": "^3.4.0", "@react-aria/interactions": "^3.7.0", "@react-aria/listbox": "^3.5.1", "@react-aria/menu": "^3.3.0", diff --git a/yarn.lock b/yarn.lock index 5b7878dbbb8a..60ab60d548f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1428,32 +1428,32 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== -"@internationalized/date@^3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@internationalized/date/-/date-3.0.2.tgz#1566a0bcbd82dce4dd54a5b26456bb701068cb89" - integrity sha512-9V1IxesP6ASZj/hYyOXOC4yPJvidbbStyWQKLCQSqhhKACMOXoo+BddXZJy47ju9mqOMpWdrJ2rTx4yTxK9oag== +"@internationalized/date@^3.0.2", "@internationalized/date@^3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@internationalized/date/-/date-3.2.0.tgz#1d266e5e5543a059cf8cca9b954fa033c3e58a75" + integrity sha512-VDMHN1m33L4eqPs5BaihzgQJXyaORbMoHOtrapFxx179J8ucY5CRIHYsq5RRLKPHZWgjNfa5v6amWWDkkMFywA== dependencies: "@swc/helpers" "^0.4.14" -"@internationalized/message@^3.0.10": - version "3.0.10" - resolved "https://registry.yarnpkg.com/@internationalized/message/-/message-3.0.10.tgz#340dcfd14ace37234e09419427c991a0c466b96e" - integrity sha512-vfLqEop/NH68IgqMcXJNSDqZ5Leg3EEgCxhuuSefU7vvdbptD3pwpUWXaK9igYPa+aZfUU0eqv86yqm76obtsw== +"@internationalized/message@^3.0.10", "@internationalized/message@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@internationalized/message/-/message-3.1.0.tgz#b284014cd8bbb430a648b76c87c62bdca968b04c" + integrity sha512-Oo5m70FcBdADf7G8NkUffVSfuCdeAYVfsvNjZDi9ELpjvkc4YNJVTHt/NyTI9K7FgAVoELxiP9YmN0sJ+HNHYQ== dependencies: "@swc/helpers" "^0.4.14" intl-messageformat "^10.1.0" -"@internationalized/number@^3.1.1", "@internationalized/number@^3.1.2": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@internationalized/number/-/number-3.1.2.tgz#4482a6ac573acfb18efd354a42008af20da6c89c" - integrity sha512-Mbys8SGsn0ApXz3hJLNU+d95B8luoUbwnmCpBwl7d63UmYAlcT6TRDyvaS/vwdbElXLcsQJjQCu0gox2cv/Tig== +"@internationalized/number@^3.1.1", "@internationalized/number@^3.1.2", "@internationalized/number@^3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@internationalized/number/-/number-3.2.0.tgz#dffb661cacd61a87b814c47b7d5240a286249066" + integrity sha512-GUXkhXSX1Ee2RURnzl+47uvbOxnlMnvP9Er+QePTjDjOPWuunmLKlEkYkEcLiiJp7y4l9QxGDLOlVr8m69LS5w== dependencies: "@swc/helpers" "^0.4.14" -"@internationalized/string@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@internationalized/string/-/string-3.0.1.tgz#2c70a81ae5eb84f156f40330369c2469bad6d504" - integrity sha512-2+rHfXZ56YgsC6i3fKvBue/xatnSm0Jv+C/x4+n3wg5xAcLh4LPW3GvZ/9ifxNAz9+IWplgZHa1FRIbSuUvNWg== +"@internationalized/string@^3.0.1", "@internationalized/string@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@internationalized/string/-/string-3.1.0.tgz#0b365906a8c3f44800b0db52c2e990cff345abce" + integrity sha512-TJQKiyUb+wyAfKF59UNeZ/kELMnkxyecnyPCnBI1ma4NaXReJW+7Cc2mObXAqraIBJUVv7rgI46RLKrLgi35ng== dependencies: "@swc/helpers" "^0.4.14" @@ -1821,62 +1821,75 @@ "@swc/helpers" "^0.4.14" clsx "^1.1.1" -"@react-aria/grid@^3.5.2": - version "3.5.2" - resolved "https://registry.yarnpkg.com/@react-aria/grid/-/grid-3.5.2.tgz#17454be19d4f53bde27fc4b676fa02dae4f3a85d" - integrity sha512-+cDtTvTT0YF4jgy1pv0omcweub6z1N+GdkpHC6L6/jtH2gFRVns3IC6pf5ihLDIpLloylthaMMR8C3lus7035g== +"@react-aria/focus@^3.12.1": + version "3.12.1" + resolved "https://registry.yarnpkg.com/@react-aria/focus/-/focus-3.12.1.tgz#5976fa41f36d09a0271f736d7c01414704ea1ca2" + integrity sha512-i1bRz27mRFnrDpYpRvm/6Zm+FbGo0WygNQiLVgTce7WY+39oLERIGRrE8Ovy6rY9Hr4MGBAXz2Q+o9oTOgeBgA== dependencies: - "@react-aria/focus" "^3.10.1" - "@react-aria/i18n" "^3.6.3" - "@react-aria/interactions" "^3.13.1" - "@react-aria/live-announcer" "^3.1.2" - "@react-aria/selection" "^3.12.1" - "@react-aria/utils" "^3.14.2" - "@react-stately/grid" "^3.4.2" - "@react-stately/selection" "^3.11.2" - "@react-stately/virtualizer" "^3.4.1" - "@react-types/checkbox" "^3.4.1" - "@react-types/grid" "^3.1.5" - "@react-types/shared" "^3.16.0" + "@react-aria/interactions" "^3.15.1" + "@react-aria/utils" "^3.17.0" + "@react-types/shared" "^3.18.1" "@swc/helpers" "^0.4.14" + clsx "^1.1.1" -"@react-aria/gridlist@^3.1.2": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@react-aria/gridlist/-/gridlist-3.1.2.tgz#ffb7bc5e4e15e3bacdf036e4762f1eea0e6292f7" - integrity sha512-3HI/e8HzyBRWdEbDH+3Hvj9U5fD/1TYaqA0f4XnBdSEDd7LHPOzZyNzbZMdlMmaq2W0Dmm1YRCMELacFVUehUA== - dependencies: - "@react-aria/focus" "^3.10.1" - "@react-aria/grid" "^3.5.2" - "@react-aria/i18n" "^3.6.3" - "@react-aria/interactions" "^3.13.1" - "@react-aria/selection" "^3.12.1" - "@react-aria/utils" "^3.14.2" - "@react-stately/list" "^3.6.1" - "@react-types/checkbox" "^3.4.1" - "@react-types/shared" "^3.16.0" +"@react-aria/grid@^3.7.1": + version "3.7.1" + resolved "https://registry.yarnpkg.com/@react-aria/grid/-/grid-3.7.1.tgz#8d68f0bb2c617773c9a640f1a98303542c2dccfc" + integrity sha512-CwrRbX1GuLJnQugB3fkujMPjFEJNyzcy+niuAwRMn768Y9MD8swDMwGrKL362NddF2jSCCwIxqA0qjCPeD4S2w== + dependencies: + "@react-aria/focus" "^3.12.1" + "@react-aria/i18n" "^3.7.2" + "@react-aria/interactions" "^3.15.1" + "@react-aria/live-announcer" "^3.3.0" + "@react-aria/selection" "^3.15.0" + "@react-aria/utils" "^3.17.0" + "@react-stately/collections" "^3.8.0" + "@react-stately/grid" "^3.6.1" + "@react-stately/selection" "^3.13.1" + "@react-stately/virtualizer" "^3.5.2" + "@react-types/checkbox" "^3.4.4" + "@react-types/grid" "^3.1.8" + "@react-types/shared" "^3.18.1" "@swc/helpers" "^0.4.14" -"@react-aria/i18n@^3.3.2", "@react-aria/i18n@^3.3.3", "@react-aria/i18n@^3.6.2", "@react-aria/i18n@^3.6.3": - version "3.6.3" - resolved "https://registry.yarnpkg.com/@react-aria/i18n/-/i18n-3.6.3.tgz#2b4d72d0baf07b514d2c35eb6ac356d0247ea84a" - integrity sha512-cDWl8FXJIXsw/raWcThywBueCJ5ncoogq81wYVS6hfZVmSyncONIB3bwUL12cojmjX1VEP31sN0ujT/83QP95Q== - dependencies: - "@internationalized/date" "^3.0.2" - "@internationalized/message" "^3.0.10" - "@internationalized/number" "^3.1.2" - "@internationalized/string" "^3.0.1" - "@react-aria/ssr" "^3.4.1" - "@react-aria/utils" "^3.14.2" - "@react-types/shared" "^3.16.0" +"@react-aria/gridlist@^3.4.0": + version "3.4.0" + resolved "https://registry.yarnpkg.com/@react-aria/gridlist/-/gridlist-3.4.0.tgz#7273a0e29f610ba8dfa73b4a85a271d7b5aabdfd" + integrity sha512-qV0XIdUrAJMlj+H4d5kL8cH5AFq8m9oNzcDfiA9ku1zsJ9yd3l1waSOyIWlrFZkaIIdkgFUDM4RzgvNHm+WA0Q== + dependencies: + "@react-aria/focus" "^3.12.1" + "@react-aria/grid" "^3.7.1" + "@react-aria/i18n" "^3.7.2" + "@react-aria/interactions" "^3.15.1" + "@react-aria/selection" "^3.15.0" + "@react-aria/utils" "^3.17.0" + "@react-stately/list" "^3.8.1" + "@react-types/checkbox" "^3.4.4" + "@react-types/shared" "^3.18.1" "@swc/helpers" "^0.4.14" -"@react-aria/interactions@^3.13.0", "@react-aria/interactions@^3.13.1", "@react-aria/interactions@^3.5.1", "@react-aria/interactions@^3.6.0", "@react-aria/interactions@^3.7.0": - version "3.13.1" - resolved "https://registry.yarnpkg.com/@react-aria/interactions/-/interactions-3.13.1.tgz#75e102c50a5c1d002cad4ee8d59677aee226186b" - integrity sha512-WCvfZOi1hhussVTHxVq76OR48ry13Zvp9U5hmuQufyxIUlf4hOvDk4/cbK4o4JiCs8X7C7SRzcwFM34M4NHzmg== +"@react-aria/i18n@^3.3.2", "@react-aria/i18n@^3.3.3", "@react-aria/i18n@^3.6.2", "@react-aria/i18n@^3.6.3", "@react-aria/i18n@^3.7.2": + version "3.7.2" + resolved "https://registry.yarnpkg.com/@react-aria/i18n/-/i18n-3.7.2.tgz#7e42943a5e0584dca60c72830175edbae4d9be9f" + integrity sha512-GsVioW8RGOmwebTruEBAmGYJunY0WS7Ljfn5n7Mec3eoMKdQjH2M70fHwCOWqJo8Ufq7A7p0ypBVCv4d4sbSdw== + dependencies: + "@internationalized/date" "^3.2.0" + "@internationalized/message" "^3.1.0" + "@internationalized/number" "^3.2.0" + "@internationalized/string" "^3.1.0" + "@react-aria/ssr" "^3.6.0" + "@react-aria/utils" "^3.17.0" + "@react-types/shared" "^3.18.1" + "@swc/helpers" "^0.4.14" + +"@react-aria/interactions@^3.13.0", "@react-aria/interactions@^3.13.1", "@react-aria/interactions@^3.15.1", "@react-aria/interactions@^3.5.1", "@react-aria/interactions@^3.6.0", "@react-aria/interactions@^3.7.0": + version "3.15.1" + resolved "https://registry.yarnpkg.com/@react-aria/interactions/-/interactions-3.15.1.tgz#10d82fd2ce7a3088713c59cb10b63613c8344052" + integrity sha512-khtpxSvos885rxMep6DRe8RGZjtD16ZuLxhFBtL1dXqSv5XZxaXKOmI8Yx1F8AkVIPdB72MmjG8dz3PpM3PPYg== dependencies: - "@react-aria/utils" "^3.14.2" - "@react-types/shared" "^3.16.0" + "@react-aria/ssr" "^3.6.0" + "@react-aria/utils" "^3.17.0" + "@react-types/shared" "^3.18.1" "@swc/helpers" "^0.4.14" "@react-aria/label@^3.4.3", "@react-aria/label@^3.4.4": @@ -1905,10 +1918,10 @@ "@react-types/shared" "^3.16.0" "@swc/helpers" "^0.4.14" -"@react-aria/live-announcer@^3.0.1", "@react-aria/live-announcer@^3.1.1", "@react-aria/live-announcer@^3.1.2": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@react-aria/live-announcer/-/live-announcer-3.1.2.tgz#a492c7ec1e664c8f41a572368cdbc53e22241a0c" - integrity sha512-BqtVLPWU10sZssoOJF1lJiRvZe5zqZ5BM39PsFyO7dWhVkR/9O9bZviqvKXnC1oXCnypfa+85gUshbK9unFcWA== +"@react-aria/live-announcer@^3.0.1", "@react-aria/live-announcer@^3.1.1", "@react-aria/live-announcer@^3.3.0": + version "3.3.0" + resolved "https://registry.yarnpkg.com/@react-aria/live-announcer/-/live-announcer-3.3.0.tgz#04a2a233c2f48c53994f83cafdc4336ec1ea3700" + integrity sha512-6diTS6mIf70KdxfGqiDxHV+9Qv8a9A88EqBllzXGF6HWPdcwde/GIEmfpTwj8g1ImNGZYUwDkv4Hd9lFj0MXEg== dependencies: "@swc/helpers" "^0.4.14" @@ -1977,18 +1990,18 @@ "@react-types/shared" "^3.16.0" "@swc/helpers" "^0.4.14" -"@react-aria/selection@^3.12.0", "@react-aria/selection@^3.12.1", "@react-aria/selection@^3.7.0": - version "3.12.1" - resolved "https://registry.yarnpkg.com/@react-aria/selection/-/selection-3.12.1.tgz#a21ea85952c55b5a7ce8c846478226fe3d03f1f8" - integrity sha512-UX1vSY+iUdHe0itFZIOizX1BCI8SAeFnEh5VIQ1bYRt93+kAxeC914fsxFPPgrodJyqWRCX1dblPyRUIWAzQiw== - dependencies: - "@react-aria/focus" "^3.10.1" - "@react-aria/i18n" "^3.6.3" - "@react-aria/interactions" "^3.13.1" - "@react-aria/utils" "^3.14.2" - "@react-stately/collections" "^3.5.1" - "@react-stately/selection" "^3.11.2" - "@react-types/shared" "^3.16.0" +"@react-aria/selection@^3.12.0", "@react-aria/selection@^3.12.1", "@react-aria/selection@^3.15.0", "@react-aria/selection@^3.7.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@react-aria/selection/-/selection-3.15.0.tgz#928acf8adffea1afe64a152b6fe425a5424e52f5" + integrity sha512-v3AXsau6BobbM5Fu7X+HhX5K/Ey3drVBaoevGDiYX8kGS9jlFNDXENKYPtnMpcTCvSX0yuxTITukOEBokzkb6Q== + dependencies: + "@react-aria/focus" "^3.12.1" + "@react-aria/i18n" "^3.7.2" + "@react-aria/interactions" "^3.15.1" + "@react-aria/utils" "^3.17.0" + "@react-stately/collections" "^3.8.0" + "@react-stately/selection" "^3.13.1" + "@react-types/shared" "^3.18.1" "@swc/helpers" "^0.4.14" "@react-aria/separator@^3.1.3": @@ -2012,10 +2025,10 @@ "@react-types/button" "^3.7.0" "@react-types/shared" "^3.16.0" -"@react-aria/ssr@^3.4.1": - version "3.4.1" - resolved "https://registry.yarnpkg.com/@react-aria/ssr/-/ssr-3.4.1.tgz#79e8bb621487e8f52890c917d3c734f448ba95e7" - integrity sha512-NmhoilMDyIfQiOSdQgxpVH2tC2u85Y0mVijtBNbI9kcDYLEiW/r6vKYVKtkyU+C4qobXhGMPfZ70PTc0lysSVA== +"@react-aria/ssr@^3.4.1", "@react-aria/ssr@^3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@react-aria/ssr/-/ssr-3.6.0.tgz#e5d52bd1686ff229f68f806cf94ee29dd9f54fb7" + integrity sha512-OFiYQdv+Yk7AO7IsQu/fAEPijbeTwrrEYvdNoJ3sblBBedD5j5fBTNWrUPNVlwC4XWWnWTCMaRIVsJujsFiWXg== dependencies: "@swc/helpers" "^0.4.14" @@ -2047,14 +2060,14 @@ "@react-types/shared" "^3.16.0" "@react-types/textfield" "^3.6.1" -"@react-aria/utils@^3.10.0", "@react-aria/utils@^3.11.0", "@react-aria/utils@^3.14.1", "@react-aria/utils@^3.14.2", "@react-aria/utils@^3.8.2", "@react-aria/utils@^3.9.0": - version "3.14.2" - resolved "https://registry.yarnpkg.com/@react-aria/utils/-/utils-3.14.2.tgz#3a8d0d14abab4bb1095e101ee44dc5e3e43e6217" - integrity sha512-3nr5gsAf/J/W+6Tu4NF3Q7m+1mXjfpXESh7TPa6UR6v3tVDTsJVMrITg2BkHN1jM8xELcl2ZxyUffOWqOXzWuA== +"@react-aria/utils@^3.10.0", "@react-aria/utils@^3.11.0", "@react-aria/utils@^3.14.1", "@react-aria/utils@^3.14.2", "@react-aria/utils@^3.17.0", "@react-aria/utils@^3.8.2", "@react-aria/utils@^3.9.0": + version "3.17.0" + resolved "https://registry.yarnpkg.com/@react-aria/utils/-/utils-3.17.0.tgz#b462afad9a25505394a714a69b9f238c24dd15a7" + integrity sha512-NEul0cQ6tQPdNSHYzNYD+EfFabeYNvDwEiHB82kK/Tsfhfm84SM+baben/at2N51K7iRrJPr5hC5fi4+P88lNg== dependencies: - "@react-aria/ssr" "^3.4.1" - "@react-stately/utils" "^3.5.2" - "@react-types/shared" "^3.16.0" + "@react-aria/ssr" "^3.6.0" + "@react-stately/utils" "^3.6.0" + "@react-types/shared" "^3.18.1" "@swc/helpers" "^0.4.14" clsx "^1.1.1" @@ -2076,25 +2089,34 @@ "@react-types/shared" "^3.16.0" "@swc/helpers" "^0.4.14" -"@react-stately/grid@^3.4.2": - version "3.4.2" - resolved "https://registry.yarnpkg.com/@react-stately/grid/-/grid-3.4.2.tgz#d7d1a4ed4b5bb431b5e5429f8f557cf7d88a7ae8" - integrity sha512-NeIUykQeA7Hen+dV4771ARW5SRrHYNn5VTOsQwn3KBUd2Z2gZ01OwUl3gETl5u0e3/tzMUdJ1LUoSPhDMwcmKw== +"@react-stately/collections@^3.8.0": + version "3.8.0" + resolved "https://registry.yarnpkg.com/@react-stately/collections/-/collections-3.8.0.tgz#4b2b71866d12fd6b4f4aea495e2d4ecb2954d4e6" + integrity sha512-NIRE8Gha0XZTnbvh9JRZM7oI/6uLf6ozjB7myja29IX7hDvsZxITe0RFXBapcujlpXLU2uufssJPKpiwJm3vZQ== dependencies: - "@react-stately/selection" "^3.11.2" - "@react-types/grid" "^3.1.5" - "@react-types/shared" "^3.16.0" + "@react-types/shared" "^3.18.1" "@swc/helpers" "^0.4.14" -"@react-stately/list@^3.6.0", "@react-stately/list@^3.6.1": +"@react-stately/grid@^3.6.1": version "3.6.1" - resolved "https://registry.yarnpkg.com/@react-stately/list/-/list-3.6.1.tgz#75d07a4e04111b804fb13c975df5a0c1265f3aa1" - integrity sha512-+/fVkK3UO+N2NoUGpe57k9gcnfIsyEgWP8SD6CXZUkJho7BTp6mwrH0Wm8tcOclT3uBk+fZaQrk8mR3uWsPZGw== + resolved "https://registry.yarnpkg.com/@react-stately/grid/-/grid-3.6.1.tgz#968fde7289ec97e40171586b53cfc69e70d00718" + integrity sha512-54B3OztU99ixMhcZsDdfeMemEcqibK9KgaOZVuPmewee35nXAOGTqNjjeN64Vz6ui8q3j86eIyjGChAxqU0KpA== dependencies: - "@react-stately/collections" "^3.5.1" - "@react-stately/selection" "^3.11.2" - "@react-stately/utils" "^3.5.2" - "@react-types/shared" "^3.16.0" + "@react-stately/collections" "^3.8.0" + "@react-stately/selection" "^3.13.1" + "@react-types/grid" "^3.1.8" + "@react-types/shared" "^3.18.1" + "@swc/helpers" "^0.4.14" + +"@react-stately/list@^3.6.0", "@react-stately/list@^3.6.1", "@react-stately/list@^3.8.1": + version "3.8.1" + resolved "https://registry.yarnpkg.com/@react-stately/list/-/list-3.8.1.tgz#19ed21dc2929e6a5a1e05a1858dbc7ee1f55f761" + integrity sha512-QO2hKRnXaz2L1v/KYPmDKeD+PfEScp4KiJMFzU/T9vvjxIratSTg314B25Xj4LJq+JhyxlguylxBF9r/R6qUjQ== + dependencies: + "@react-stately/collections" "^3.8.0" + "@react-stately/selection" "^3.13.1" + "@react-stately/utils" "^3.6.0" + "@react-types/shared" "^3.18.1" "@swc/helpers" "^0.4.14" "@react-stately/menu@^3.2.3", "@react-stately/menu@^3.4.2": @@ -2138,14 +2160,14 @@ "@react-types/shared" "^3.16.0" "@swc/helpers" "^0.4.14" -"@react-stately/selection@^3.11.0", "@react-stately/selection@^3.11.2": - version "3.11.2" - resolved "https://registry.yarnpkg.com/@react-stately/selection/-/selection-3.11.2.tgz#15c35dfb386e5218b8106070137a8b3ecded5a8b" - integrity sha512-g21Y36xhYkXO3yzz0BYSBqnD38olvEwsJUqBXGZfx//bshMC2FNmI5sRYMAi36stxWbwzBvB01OytxfLLxCXCA== +"@react-stately/selection@^3.11.0", "@react-stately/selection@^3.11.2", "@react-stately/selection@^3.13.1": + version "3.13.1" + resolved "https://registry.yarnpkg.com/@react-stately/selection/-/selection-3.13.1.tgz#17752ed81bf0f3246cd010818c460fa0d749d3a1" + integrity sha512-0B+gT6hyei/pzUSmrNliphoztOPZJ7v/xVT9b4HViRTwuOUQlmwi5BQai84EbVtgQaQghc07sJ/Y/Ec8WXCRHA== dependencies: - "@react-stately/collections" "^3.5.1" - "@react-stately/utils" "^3.5.2" - "@react-types/shared" "^3.16.0" + "@react-stately/collections" "^3.8.0" + "@react-stately/utils" "^3.6.0" + "@react-types/shared" "^3.18.1" "@swc/helpers" "^0.4.14" "@react-stately/tabs@^3.2.2", "@react-stately/tabs@^3.2.3": @@ -2186,13 +2208,20 @@ dependencies: "@swc/helpers" "^0.4.14" -"@react-stately/virtualizer@^3.4.1": - version "3.4.1" - resolved "https://registry.yarnpkg.com/@react-stately/virtualizer/-/virtualizer-3.4.1.tgz#00c7b36b989244cf985b9ad5fb13dc1ecbb81a0f" - integrity sha512-2S7GARkZl41X7fN0Xa94TkN8ELAUbA89zn1xH59d02NOvAKLAFXHkCe69AivvVvbhXo8/nONzO8NXqqgBS/XQw== +"@react-stately/utils@^3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@react-stately/utils/-/utils-3.6.0.tgz#f273e7fcb348254347d2e88c8f0c45571060c207" + integrity sha512-rptF7iUWDrquaYvBAS4QQhOBQyLBncDeHF03WnHXAxnuPJXNcr9cXJtjJPGCs036ZB8Q2hc9BGG5wNyMkF5v+Q== dependencies: - "@react-aria/utils" "^3.14.2" - "@react-types/shared" "^3.16.0" + "@swc/helpers" "^0.4.14" + +"@react-stately/virtualizer@^3.5.2": + version "3.5.2" + resolved "https://registry.yarnpkg.com/@react-stately/virtualizer/-/virtualizer-3.5.2.tgz#f646a114662c18d34afbf3b1cba81636afadb231" + integrity sha512-OmG9lPcbfnyuPhbSDVcDXDfPU0rc2E/V8VLGGd/yMOxSy4S90nWDSEoR8qAN6g9rY6xoLjPJ671nyxOu41EtyA== + dependencies: + "@react-aria/utils" "^3.17.0" + "@react-types/shared" "^3.18.1" "@swc/helpers" "^0.4.14" "@react-types/button@^3.4.1", "@react-types/button@^3.7.0": @@ -2202,19 +2231,26 @@ dependencies: "@react-types/shared" "^3.16.0" -"@react-types/checkbox@^3.2.3", "@react-types/checkbox@^3.4.1": +"@react-types/checkbox@^3.2.3": version "3.4.1" resolved "https://registry.yarnpkg.com/@react-types/checkbox/-/checkbox-3.4.1.tgz#75a78b3f21f4cc72d2382761ba4c326aefd699db" integrity sha512-kDMpy9SntjGQ7x00m5zmW8GENPouOtyiDgiEDKsPXUr2iYqHsNtricqVyG9S9+6hqpzuu8BzTcvZamc/xYjzlg== dependencies: "@react-types/shared" "^3.16.0" -"@react-types/grid@^3.1.5": - version "3.1.5" - resolved "https://registry.yarnpkg.com/@react-types/grid/-/grid-3.1.5.tgz#b0efef48202b40aa05913f1fe5b05d80e7d26c15" - integrity sha512-KiEywsOJ+wdzLmJerAKEMADdvdItaLfhdo3bFfn1lgNUaKiNDJctDYWlhOYsRePf7MIrzoZuXEFnJj45jfpiOQ== +"@react-types/checkbox@^3.4.4": + version "3.4.4" + resolved "https://registry.yarnpkg.com/@react-types/checkbox/-/checkbox-3.4.4.tgz#cf55e9fd0cabef6e4408d03b308c754e1add3bc1" + integrity sha512-rJNhbW4R9HTvdbF2oTZmqGiZ/WVP3/XsU4gae7tfdhSYjG+5T5h9zau1vRhz++zwKn57wfcyNn6a83GDhhgkVw== dependencies: - "@react-types/shared" "^3.16.0" + "@react-types/shared" "^3.18.1" + +"@react-types/grid@^3.1.8": + version "3.1.8" + resolved "https://registry.yarnpkg.com/@react-types/grid/-/grid-3.1.8.tgz#2d8cf3ccbb2bba161917b9e242f920fed5f34026" + integrity sha512-NKk4pDbW2QXJOYnDSAYhta81CGwXOc/9tVw2WFs+1wacvxeKmh1Q+n36uAFcIdQOvVRqeGTJaYiqLFmF3fC3tA== + dependencies: + "@react-types/shared" "^3.18.1" "@react-types/label@^3.7.1": version "3.7.1" @@ -2259,10 +2295,10 @@ dependencies: "@react-types/shared" "^3.16.0" -"@react-types/shared@^3.10.0", "@react-types/shared@^3.15.0", "@react-types/shared@^3.16.0", "@react-types/shared@^3.8.0", "@react-types/shared@^3.9.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@react-types/shared/-/shared-3.16.0.tgz#cab7bf0376969d1773480ecb2d6da5aa91391db5" - integrity sha512-IQgU4oAEvMwylEvaTsr2XB1G/mAoMe1JFYLD6G78v++oAR9l8o9MQxZ0YSeANDkqTamb2gKezGoT1RxvSKjVxw== +"@react-types/shared@^3.10.0", "@react-types/shared@^3.15.0", "@react-types/shared@^3.16.0", "@react-types/shared@^3.18.1", "@react-types/shared@^3.8.0", "@react-types/shared@^3.9.0": + version "3.18.1" + resolved "https://registry.yarnpkg.com/@react-types/shared/-/shared-3.18.1.tgz#45bac7a1a433916d16535ea583d86a2b4c72ff8c" + integrity sha512-OpTYRFS607Ctfd6Tmhyk6t6cbFyDhO5K+etU35X50pMzpypo1b7vF0mkngEeTc0Xwl0e749ONZNPZskMyu5k8w== "@react-types/tabs@^3.1.5": version "3.1.5" From 0ac2e01776541cb724dabd73483a64039af50f21 Mon Sep 17 00:00:00 2001 From: Vu Luong Date: Thu, 25 May 2023 11:38:46 -0700 Subject: [PATCH 2/3] Clean up yarn.lock --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index 60ab60d548f7..c11737113c01 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1428,14 +1428,14 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== -"@internationalized/date@^3.0.2", "@internationalized/date@^3.2.0": +"@internationalized/date@^3.2.0": version "3.2.0" resolved "https://registry.yarnpkg.com/@internationalized/date/-/date-3.2.0.tgz#1d266e5e5543a059cf8cca9b954fa033c3e58a75" integrity sha512-VDMHN1m33L4eqPs5BaihzgQJXyaORbMoHOtrapFxx179J8ucY5CRIHYsq5RRLKPHZWgjNfa5v6amWWDkkMFywA== dependencies: "@swc/helpers" "^0.4.14" -"@internationalized/message@^3.0.10", "@internationalized/message@^3.1.0": +"@internationalized/message@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@internationalized/message/-/message-3.1.0.tgz#b284014cd8bbb430a648b76c87c62bdca968b04c" integrity sha512-Oo5m70FcBdADf7G8NkUffVSfuCdeAYVfsvNjZDi9ELpjvkc4YNJVTHt/NyTI9K7FgAVoELxiP9YmN0sJ+HNHYQ== @@ -1443,14 +1443,14 @@ "@swc/helpers" "^0.4.14" intl-messageformat "^10.1.0" -"@internationalized/number@^3.1.1", "@internationalized/number@^3.1.2", "@internationalized/number@^3.2.0": +"@internationalized/number@^3.1.1", "@internationalized/number@^3.2.0": version "3.2.0" resolved "https://registry.yarnpkg.com/@internationalized/number/-/number-3.2.0.tgz#dffb661cacd61a87b814c47b7d5240a286249066" integrity sha512-GUXkhXSX1Ee2RURnzl+47uvbOxnlMnvP9Er+QePTjDjOPWuunmLKlEkYkEcLiiJp7y4l9QxGDLOlVr8m69LS5w== dependencies: "@swc/helpers" "^0.4.14" -"@internationalized/string@^3.0.1", "@internationalized/string@^3.1.0": +"@internationalized/string@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@internationalized/string/-/string-3.1.0.tgz#0b365906a8c3f44800b0db52c2e990cff345abce" integrity sha512-TJQKiyUb+wyAfKF59UNeZ/kELMnkxyecnyPCnBI1ma4NaXReJW+7Cc2mObXAqraIBJUVv7rgI46RLKrLgi35ng== @@ -2025,7 +2025,7 @@ "@react-types/button" "^3.7.0" "@react-types/shared" "^3.16.0" -"@react-aria/ssr@^3.4.1", "@react-aria/ssr@^3.6.0": +"@react-aria/ssr@^3.6.0": version "3.6.0" resolved "https://registry.yarnpkg.com/@react-aria/ssr/-/ssr-3.6.0.tgz#e5d52bd1686ff229f68f806cf94ee29dd9f54fb7" integrity sha512-OFiYQdv+Yk7AO7IsQu/fAEPijbeTwrrEYvdNoJ3sblBBedD5j5fBTNWrUPNVlwC4XWWnWTCMaRIVsJujsFiWXg== @@ -2160,7 +2160,7 @@ "@react-types/shared" "^3.16.0" "@swc/helpers" "^0.4.14" -"@react-stately/selection@^3.11.0", "@react-stately/selection@^3.11.2", "@react-stately/selection@^3.13.1": +"@react-stately/selection@^3.11.0", "@react-stately/selection@^3.13.1": version "3.13.1" resolved "https://registry.yarnpkg.com/@react-stately/selection/-/selection-3.13.1.tgz#17752ed81bf0f3246cd010818c460fa0d749d3a1" integrity sha512-0B+gT6hyei/pzUSmrNliphoztOPZJ7v/xVT9b4HViRTwuOUQlmwi5BQai84EbVtgQaQghc07sJ/Y/Ec8WXCRHA== From 370c4c1ab41ee9f2e706d58f44d11db01ca98ad5 Mon Sep 17 00:00:00 2001 From: Vu Luong Date: Thu, 25 May 2023 11:58:23 -0700 Subject: [PATCH 3/3] Fix TS issues --- static/app/components/compactSelect/list.tsx | 4 +-- static/app/components/dropdownMenu/item.tsx | 23 +++++++++-------- static/app/components/dropdownMenu/list.tsx | 6 ++--- static/app/components/tabs/tabList.tsx | 27 +++++++++++--------- 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/static/app/components/compactSelect/list.tsx b/static/app/components/compactSelect/list.tsx index 2c647092a5b4..dcfe82cbbda6 100644 --- a/static/app/components/compactSelect/list.tsx +++ b/static/app/components/compactSelect/list.tsx @@ -232,7 +232,7 @@ function List({ while ( firstKey && - (listState.collection.getItem(firstKey).type === 'section' || + (listState.collection.getItem(firstKey)?.type === 'section' || listState.selectionManager.isDisabled(firstKey)) ) { firstKey = listState.collection.getKeyAfter(firstKey); @@ -245,7 +245,7 @@ function List({ while ( lastKey && - (listState.collection.getItem(lastKey).type === 'section' || + (listState.collection.getItem(lastKey)?.type === 'section' || listState.selectionManager.isDisabled(lastKey)) ) { lastKey = listState.collection.getKeyBefore(lastKey); diff --git a/static/app/components/dropdownMenu/item.tsx b/static/app/components/dropdownMenu/item.tsx index 7581a196d65a..a7d4009f93e9 100644 --- a/static/app/components/dropdownMenu/item.tsx +++ b/static/app/components/dropdownMenu/item.tsx @@ -105,7 +105,8 @@ function BaseDropdownMenuItem( const ref = useRef(null); const isDisabled = state.disabledKeys.has(node.key); const isFocused = state.selectionManager.focusedKey === node.key; - const {key, onAction, to, label, isSubmenu, ...itemProps} = node.value; + const {key, onAction, to, label, isSubmenu, trailingItems, ...itemProps} = + node.value ?? {}; const {size} = node.props; const actionHandler = () => { @@ -116,7 +117,7 @@ function BaseDropdownMenuItem( state.selectionManager.toggleSelection(node.key); return; } - onAction?.(key); + key && onAction?.(key); }; // Open submenu on hover @@ -211,17 +212,19 @@ function BaseDropdownMenuItem( innerWrapProps={innerWrapProps} labelProps={labelProps} detailsProps={descriptionProps} - size={size} - {...mergedProps} - {...itemProps} - {...(isSubmenu && { - trailingItems: ( + trailingItems={ + isSubmenu ? ( - {itemProps.trailingItems} + {trailingItems} - ), - })} + ) : ( + trailingItems + ) + } + size={size} + {...mergedProps} + {...itemProps} /> ); } diff --git a/static/app/components/dropdownMenu/list.tsx b/static/app/components/dropdownMenu/list.tsx index 98f45fe91b32..1d17a7251851 100644 --- a/static/app/components/dropdownMenu/list.tsx +++ b/static/app/components/dropdownMenu/list.tsx @@ -105,7 +105,7 @@ function DropdownMenuList({ // logically follows from the tree-like structure and single-selection // nature of menus. const isLeafSubmenu = !stateCollection.some(node => { - const isSection = node.hasChildNodes && !node.value.isSubmenu; + const isSection = node.hasChildNodes && !node.value?.isSubmenu; // A submenu with key [key] is expanded if // state.selectionManager.isSelected([key]) = true return isSection @@ -148,7 +148,7 @@ function DropdownMenuList({ // Render a submenu whose trigger button is a menu item const renderItemWithSubmenu = (node: Node, isLastNode: boolean) => { - if (!node.value.children) { + if (!node.value?.children) { return null; } @@ -208,7 +208,7 @@ function DropdownMenuList({ ); } else { - itemToRender = node.value.isSubmenu + itemToRender = node.value?.isSubmenu ? renderItemWithSubmenu(node, isLastNode) : renderItem(node, isLastNode); } diff --git a/static/app/components/tabs/tabList.tsx b/static/app/components/tabs/tabList.tsx index 8b1f4375405d..a4f179d570b7 100644 --- a/static/app/components/tabs/tabList.tsx +++ b/static/app/components/tabs/tabList.tsx @@ -7,7 +7,7 @@ import {ListCollection} from '@react-stately/list'; import {useTabListState} from '@react-stately/tabs'; import {Node, Orientation} from '@react-types/shared'; -import {CompactSelect} from 'sentry/components/compactSelect'; +import {CompactSelect, SelectOption} from 'sentry/components/compactSelect'; import DropdownButton from 'sentry/components/dropdownButton'; import {IconEllipsis} from 'sentry/icons'; import {t} from 'sentry/locale'; @@ -151,17 +151,20 @@ function BaseTabList({ (a, b) => sortedKeys.indexOf(a) - sortedKeys.indexOf(b) ); - return sortedOverflowTabs - .filter(key => state.collection.getItem(key)) - .map(key => { - const item = state.collection.getItem(key); - return { - value: key, - label: item.props.children, - disabled: item.props.disabled, - textValue: item.textValue, - }; - }); + return sortedOverflowTabs.flatMap>(key => { + const item = state.collection.getItem(key); + + if (!item) { + return []; + } + + return { + value: key, + label: item.props.children, + disabled: item.props.disabled, + textValue: item.textValue, + }; + }); }, [state.collection, overflowTabs]); return (