(props: InputLabelProps)
| 13 | import type { InputLabelProps } from '../types'; |
| 14 | |
| 15 | const InputLabel = (props: InputLabelProps) => { |
| 16 | const { |
| 17 | labeled, |
| 18 | wiggle, |
| 19 | error, |
| 20 | focused, |
| 21 | opacity, |
| 22 | labelLayoutWidth, |
| 23 | labelLayoutHeight, |
| 24 | labelBackground, |
| 25 | label, |
| 26 | labelError, |
| 27 | onLayoutAnimatedText, |
| 28 | onLabelTextLayout, |
| 29 | hasActiveOutline, |
| 30 | activeColor, |
| 31 | placeholderStyle, |
| 32 | baseLabelTranslateX, |
| 33 | baseLabelTranslateY, |
| 34 | font, |
| 35 | fontSize, |
| 36 | lineHeight, |
| 37 | fontWeight, |
| 38 | placeholderOpacity, |
| 39 | wiggleOffsetX, |
| 40 | labelScale, |
| 41 | topPosition, |
| 42 | paddingLeft, |
| 43 | paddingRight, |
| 44 | backgroundColor, |
| 45 | roundness, |
| 46 | placeholderColor, |
| 47 | errorColor, |
| 48 | labelTranslationXOffset, |
| 49 | maxFontSizeMultiplier, |
| 50 | testID, |
| 51 | isV3, |
| 52 | inputContainerLayout, |
| 53 | scaledLabel, |
| 54 | } = props; |
| 55 | |
| 56 | const { INPUT_PADDING_HORIZONTAL } = getConstants(isV3); |
| 57 | const { width } = useWindowDimensions(); |
| 58 | |
| 59 | const isWeb = Platform.OS === 'web'; |
| 60 | |
| 61 | const paddingOffset = |
| 62 | paddingLeft && paddingRight ? { paddingLeft, paddingRight } : {}; |
| 63 | |
| 64 | const labelTranslationX = { |
| 65 | transform: [ |
| 66 | { |
| 67 | // Offset label scale since RN doesn't support transform origin |
| 68 | translateX: labeled.interpolate({ |
| 69 | inputRange: [0, 1], |
| 70 | outputRange: [baseLabelTranslateX, labelTranslationXOffset || 0], |
| 71 | }), |
| 72 | }, |
nothing calls this directly
no test coverage detected
searching dependent graphs…