mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-30 19:58:50 +00:00
14 lines
556 B
TypeScript
14 lines
556 B
TypeScript
/** Pure content gate shared by the component and executable unit tests. */
|
|
export function helpHasContent(text: unknown, ariaLabel: unknown): boolean {
|
|
return typeof text === 'string' && text.trim().length > 0
|
|
&& typeof ariaLabel === 'string' && ariaLabel.trim().length > 0;
|
|
}
|
|
|
|
/** Scrolling the floating help itself must not dismiss it. */
|
|
export function helpScrollShouldDismiss(
|
|
pathIsInsideFloatingSurface: boolean,
|
|
targetIsDialogOrContainsHelp: boolean,
|
|
): boolean {
|
|
return !pathIsInsideFloatingSurface && targetIsDialogOrContainsHelp;
|
|
}
|