{ "type": "composition", "npmDependencies": [], "fileDependencies": [ "compositions/ui/toggle-tip" ], "id": "stat", "file": { "name": "stat.tsx", "content": "import {\n Badge,\n type BadgeProps,\n Stat as ChakraStat,\n FormatNumber,\n} from \"@chakra-ui/react\"\nimport { InfoTip } from \"./toggle-tip\"\nimport * as React from \"react\"\n\ninterface StatLabelProps extends ChakraStat.LabelProps {\n info?: React.ReactNode\n}\n\nexport const StatLabel = React.forwardRef(\n function StatLabel(props, ref) {\n const { info, children, ...rest } = props\n return (\n \n {children}\n {info && {info}}\n \n )\n },\n)\n\ninterface StatValueTextProps extends ChakraStat.ValueTextProps {\n value?: number\n formatOptions?: Intl.NumberFormatOptions\n}\n\nexport const StatValueText = React.forwardRef<\n HTMLDivElement,\n StatValueTextProps\n>(function StatValueText(props, ref) {\n const { value, formatOptions, children, ...rest } = props\n return (\n \n {children ||\n (value != null && )}\n \n )\n})\n\nexport const StatUpTrend = React.forwardRef(\n function StatUpTrend(props, ref) {\n return (\n \n \n {props.children}\n \n )\n },\n)\n\nexport const StatDownTrend = React.forwardRef(\n function StatDownTrend(props, ref) {\n return (\n \n \n {props.children}\n \n )\n },\n)\n\nexport const StatRoot = ChakraStat.Root\nexport const StatHelpText = ChakraStat.HelpText\nexport const StatValueUnit = ChakraStat.ValueUnit\n" }, "component": "Stat" }