When I select a layer in the Contents and then click on the "New Web Layer" button in the Share As category in the Share ribbon, Analyze says I have warnings because of the basemap. The errors are spurious because I only want to share the layer, not the basemap.
When I right-click on the layer and click on the "Share As Web Layer" menu item, I get a different panel named "Sharing selected layer as a web layer" that correctly populates the Name and does not complain about the basemap.
There is no way to get to the correctly-working user interface from the ribbon.
Please add this hidden feature to the main ribbon to make it more discoverable. Menus (Design basics) - Win32 apps | Microsoft Docs says that items in the context menu should be redundant with the main UI.