chore: update comments and documentation for clarity and consistency across various files
- Translated comments from Spanish to English in vite.config.ts, docker-compose.yml, attendance-risk.ts, analytics.ts, attendance.ts, attendees.ts, enums.ts, groups.ts, and onboarding.ts. - Improved descriptions for better understanding of code functionality and purpose. - Ensured uniformity in terminology and phrasing throughout the codebase.
This commit is contained in:
@@ -2,19 +2,20 @@ import { type ReactNode, useId, useState } from 'react'
|
||||
import { cn } from '../../lib/utils'
|
||||
|
||||
export type TooltipProps = {
|
||||
/** Texto explicativo que se muestra al hacer hover, foco de teclado o tap. */
|
||||
/** Explanatory text shown on hover, keyboard focus or tap. */
|
||||
content: ReactNode
|
||||
/** Contenido del disparador. Queda dentro de un <button> para ser accesible. */
|
||||
/** Trigger content. It sits inside a <button> to stay accessible. */
|
||||
children: ReactNode
|
||||
className?: string
|
||||
/** Posicionamiento alternativo del globo (por defecto: abajo, anclado a la derecha en sm+). */
|
||||
/** Alternate positioning for the bubble (default: below, anchored right on sm+). */
|
||||
tooltipClassName?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Tooltip accesible sin dependencias: hover (ratón), foco (teclado) y tap
|
||||
* (táctil, vía focus). Se cierra con Escape, al salir el puntero o al perder
|
||||
* el foco. El globo se ancla abajo del disparador para no tapar el contenido.
|
||||
* Accessible tooltip with no dependencies: hover (mouse), focus (keyboard) and
|
||||
* tap (touch, via focus). It closes on Escape, when the pointer leaves or when
|
||||
* it loses focus. The bubble is anchored below the trigger so it doesn't cover
|
||||
* the content.
|
||||
*/
|
||||
export function Tooltip({ content, children, className, tooltipClassName }: TooltipProps) {
|
||||
const [open, setOpen] = useState(false)
|
||||
@@ -28,8 +29,8 @@ export function Tooltip({ content, children, className, tooltipClassName }: Tool
|
||||
<button
|
||||
type="button"
|
||||
aria-describedby={open ? id : undefined}
|
||||
// El hover solo aplica a punteros de ratón: en táctil no hay "hover
|
||||
// persistente" y el tap se resuelve con focus + click.
|
||||
// Hover only applies to mouse pointers: on touch there is no
|
||||
// "persistent hover" and tap is handled with focus + click.
|
||||
onPointerEnter={(e) => {
|
||||
if (e.pointerType === 'mouse') show()
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user