UNPKG

@base-ui-components/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

24 lines 406 B
const PANEL_OPEN_HOOK = { 'data-open': '' }; const PANEL_CLOSED_HOOK = { 'data-closed': '' }; export const triggerOpenStateMapping = { open(value) { if (value) { return { 'data-panel-open': '' }; } return null; } }; export const collapsibleOpenStateMapping = { open(value) { if (value) { return PANEL_OPEN_HOOK; } return PANEL_CLOSED_HOOK; } };