{ | |
"type": "composition", | |
"npmDependencies": [], | |
"fileDependencies": [ | |
"compositions/ui/tooltip" | |
], | |
"id": "scrubber-input", | |
"file": { | |
"name": "scrubber-input.tsx", | |
"content": "import { Group, Icon, InputElement, NumberInput } from \"@chakra-ui/react\"\nimport { Tooltip } from \"./tooltip\"\nimport { forwardRef } from \"react\"\n\nexport interface ScrubberInputProps extends NumberInput.InputProps {\n label: React.ReactNode\n icon: React.ReactNode\n rootProps?: NumberInput.RootProps\n}\n\nexport const ScrubberInput = forwardRef<HTMLInputElement, ScrubberInputProps>(\n function ScrubberInput(props, ref) {\n const { label, icon, rootProps, ...rest } = props\n return (\n <NumberInput.Root variant=\"outline\" maxW=\"120px\" {...rootProps}>\n <Tooltip content={label}>\n <Group width=\"full\">\n <InputElement>\n <NumberInput.Scrubber>\n <Icon asChild color=\"fg.subtle\">\n {icon}\n </Icon>\n </NumberInput.Scrubber>\n </InputElement>\n <NumberInput.Input cursor=\"default\" ps=\"10\" ref={ref} {...rest} />\n </Group>\n </Tooltip>\n </NumberInput.Root>\n )\n },\n)\n" | |
}, | |
"component": "ScrubberInput" | |
} |