Align props with figma

This commit is contained in:
adilallo
2026-02-04 16:52:03 -07:00
parent ee9784271f
commit af7e2d3e51
53 changed files with 1287 additions and 108 deletions
+4 -1
View File
@@ -3,9 +3,12 @@
import { memo, useState } from "react";
import { TooltipView } from "./Tooltip.view";
import type { TooltipProps } from "./Tooltip.types";
import { normalizeTooltipPosition } from "../../../lib/propNormalization";
const TooltipContainer = memo<TooltipProps>(
({ children, text, position = "top", className = "", disabled = false }) => {
({ children, text, position: positionProp = "top", className = "", disabled = false }) => {
// Normalize props to handle both PascalCase (Figma) and lowercase (codebase)
const position = normalizeTooltipPosition(positionProp);
const [isVisible, setIsVisible] = useState(false);
if (disabled) {
+7 -1
View File
@@ -1,7 +1,13 @@
export type TooltipPositionValue = "top" | "bottom" | "Top" | "Bottom";
export interface TooltipProps {
children: React.ReactNode;
text: string;
position?: "top" | "bottom";
/**
* Tooltip position. Accepts both lowercase and PascalCase (case-insensitive).
* Figma uses PascalCase, codebase uses lowercase - both are supported.
*/
position?: TooltipPositionValue;
className?: string;
disabled?: boolean;
}