[all components] Consolidate the `data-open` and `data-presssed `states
Feature request
Summary
We should use data-open states across different components, and we could use data-pressed vs different state for triggers (tooltip may be a special case)
@mnajdova Wouldn't this cause problems when composing different components, especially triggers?
i think it would cause some issues,
https://github.com/mui/base-ui/blob/master/packages/react/src/toggle/Toggle.tsx already uses data-pressed to indicate that the button is active. A toggle that opens a menu would be ambiguous - does data-pressed mean button is active or menu is open?
https://github.com/mui/base-ui/blob/master/packages/react/src/tooltip/trigger/TooltipTrigger.tsx opens on hover (not press), so it can't use data-pressed. Without data-popup-open, it has no way to indicate state.
https://github.com/mui/base-ui/blob/master/docs/src/app/(public)/(content)/react/components/menu/demos/submenu/css-modules/index.module.css#L31 use &[data-popup-open]
We intentionally had two attributes to separate click vs. hover triggered popups attached to the same element. A common use case is a Tooltip and a Menu attached to the same button. This way you can style each state (hovering into the tooltip) and clicking the Menu differently. e.g. [data-pressed] is darker, while [data-popup-open] matches :hover