@fountain-ui/core 2.0.0-beta.50 → 2.0.0-beta.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87,7 +87,6 @@ const InputLabel = props => {
87
87
  selector: typo => typo.caption2
88
88
  });
89
89
  const labelStyle = {
90
- labelTextFontStyle,
91
90
  fontSize,
92
91
  transform: [{
93
92
  translateX: animatedError.interpolate({
@@ -125,7 +124,7 @@ const InputLabel = props => {
125
124
  }]
126
125
  }), /*#__PURE__*/_react.default.createElement(_reactNative.Animated.Text, {
127
126
  key: 'labelBackground-text',
128
- style: [styles.placeholder, styles.backgroundText, backgroundStyle, labelStyle, {
127
+ style: [labelTextFontStyle, styles.placeholder, styles.backgroundText, backgroundStyle, labelStyle, {
129
128
  top: topPosition + 1,
130
129
  opacity,
131
130
  transform: [...labelStyle.transform, {
@@ -138,7 +137,7 @@ const InputLabel = props => {
138
137
  numberOfLines: 1
139
138
  }, label)], /*#__PURE__*/_react.default.createElement(_reactNative.Animated.Text, {
140
139
  onLayout: onLayoutAnimatedText,
141
- style: [styles.placeholder, labelStyle, paddingOffset, {
140
+ style: [styles.placeholder, labelTextFontStyle, labelStyle, paddingOffset, {
142
141
  textAlign: 'left',
143
142
  top: topPosition,
144
143
  color: error && errorColor ? errorColor : activeColor,
@@ -149,7 +148,7 @@ const InputLabel = props => {
149
148
  }],
150
149
  numberOfLines: 1
151
150
  }, label), /*#__PURE__*/_react.default.createElement(_reactNative.Animated.Text, {
152
- style: [styles.placeholder, labelStyle, paddingOffset, {
151
+ style: [styles.placeholder, labelTextFontStyle, labelStyle, paddingOffset, {
153
152
  textAlign: 'left',
154
153
  top: topPosition,
155
154
  color: error && errorColor ? errorColor : placeholderColor,
@@ -1 +1 @@
1
- {"version":3,"names":["useStyles","background","position","top","left","bottom","right","width","height","backgroundText","paddingHorizontal","color","placeholder","inputPaddingHorizontal","InputLabel","props","activeColor","animatedError","animatedLabel","error","errorColor","focused","fontSize","hasActiveOutline","label","labelLayout","labelScale","labelTranslateX","labelTranslateY","onLayoutAnimatedText","paddingOffset","placeholderColor","placeholderOpacity","topPosition","value","theme","useTheme","styles","paperStyles","usePaperStyles","backgroundStyle","backgroundColor","palette","default","hasFocus","opacity","interpolate","inputRange","outputRange","labelTranslationX","transform","translateX","labelTextFontStyle","createFontStyle","selector","typo","caption2","labelStyle","translateY","scale","StyleSheet","absoluteFill","measured","scaleY","textAlign"],"sources":["InputLabel.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, LayoutChangeEvent, StyleSheet } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport usePaperStyles from '../Paper/usePaperStyles';\nimport { inputPaddingHorizontal } from './utils';\n\ninterface LabelProps {\n activeColor: string;\n animatedError: Animated.Value;\n animatedLabel: Animated.Value;\n error?: boolean;\n errorColor?: string;\n focused?: boolean;\n fontSize?: number;\n hasActiveOutline?: boolean;\n label?: string;\n labelLayout: { measured: boolean; width: number; height: number };\n labelScale: number;\n labelTranslateX: number;\n labelTranslateY: number;\n onLayoutAnimatedText: (event: LayoutChangeEvent) => void;\n paddingOffset?: { paddingLeft: number; paddingRight: number };\n placeholder?: string;\n placeholderColor?: string;\n placeholderOpacity: number | Animated.AnimatedInterpolation;\n topPosition: number;\n value?: string;\n}\n\ntype InputLabelStyles = NamedStylesStringUnion<'background' | 'backgroundText' | 'placeholder'>;\n\nconst useStyles: UseStyles<InputLabelStyles> = function (): InputLabelStyles {\n return {\n background: {\n position: 'absolute',\n top: 6,\n left: 10,\n bottom: 0,\n right: 0,\n width: 8,\n height: 4,\n },\n backgroundText: {\n position: 'absolute',\n left: 18,\n paddingHorizontal: 0,\n color: 'transparent',\n },\n placeholder: {\n position: 'absolute',\n left: 0,\n paddingHorizontal: inputPaddingHorizontal,\n },\n };\n};\n\nconst InputLabel = (props: LabelProps) => {\n const {\n activeColor,\n animatedError,\n animatedLabel,\n error = false,\n errorColor,\n focused,\n fontSize,\n hasActiveOutline,\n label,\n labelLayout,\n labelScale,\n labelTranslateX,\n labelTranslateY,\n onLayoutAnimatedText,\n paddingOffset,\n placeholderColor,\n placeholderOpacity,\n topPosition,\n value,\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const paperStyles = usePaperStyles();\n\n const backgroundStyle = {\n backgroundColor: paperStyles?.backgroundColor ?? theme.palette.background.default,\n };\n\n const hasFocus = hasActiveOutline || value;\n const opacity = animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasFocus ? 1 : 0, 0],\n });\n\n const labelTranslationX = {\n transform: [\n {\n translateX: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [labelTranslateX, 0 || 0],\n }),\n },\n ],\n };\n\n const labelTextFontStyle = createFontStyle(theme, { selector: (typo) => typo.caption2 });\n\n const labelStyle = {\n labelTextFontStyle,\n fontSize,\n transform: [\n {\n translateX: animatedError.interpolate({\n inputRange: [0, 0.5, 1],\n outputRange: [0, value && error ? 4 : 0, 0],\n }),\n },\n {\n translateY: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [labelTranslateY, 0],\n }),\n },\n {\n scale: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [labelScale, 1],\n }),\n },\n ],\n };\n\n return (label ? (\n <Animated.View\n pointerEvents={'none'}\n style={[\n StyleSheet.absoluteFill,\n {\n opacity: value || focused ? (labelLayout.measured ? 1 : 0) : 1,\n },\n labelTranslationX,\n ]}\n >\n {[\n <Animated.View\n key={'labelBackground-view'}\n pointerEvents={'none'}\n style={[\n styles.background,\n backgroundStyle,\n {\n opacity,\n transform: [\n {\n translateX: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [-labelTranslateX, 0],\n }),\n },\n ],\n },\n ]}\n />,\n <Animated.Text\n key={'labelBackground-text'}\n style={[\n styles.placeholder,\n styles.backgroundText,\n backgroundStyle,\n labelStyle,\n {\n top: topPosition + 1,\n opacity,\n transform: [\n ...labelStyle.transform,\n {\n scaleY: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [0.2, 1],\n }),\n },\n ],\n },\n ]}\n numberOfLines={1}\n >\n {label}\n </Animated.Text>,\n ]}\n <Animated.Text\n onLayout={onLayoutAnimatedText}\n style={[\n styles.placeholder,\n labelStyle,\n paddingOffset,\n {\n textAlign: 'left',\n top: topPosition,\n color: error && errorColor ? errorColor : activeColor,\n opacity: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasActiveOutline ? 1 : 0, 0],\n }),\n },\n ]}\n numberOfLines={1}\n >\n {label}\n </Animated.Text>\n <Animated.Text\n style={[\n styles.placeholder,\n labelStyle,\n paddingOffset,\n {\n textAlign: 'left',\n top: topPosition,\n color: error && errorColor ? errorColor : placeholderColor,\n opacity: placeholderOpacity,\n },\n ]}\n numberOfLines={1}\n >\n {label}\n </Animated.Text>\n </Animated.View>\n ) : null);\n};\n\nexport default InputLabel;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;AA2BA,MAAMA,SAAsC,GAAG,YAA8B;EACzE,OAAO;IACHC,UAAU,EAAE;MACRC,QAAQ,EAAE,UADF;MAERC,GAAG,EAAE,CAFG;MAGRC,IAAI,EAAE,EAHE;MAIRC,MAAM,EAAE,CAJA;MAKRC,KAAK,EAAE,CALC;MAMRC,KAAK,EAAE,CANC;MAORC,MAAM,EAAE;IAPA,CADT;IAUHC,cAAc,EAAE;MACZP,QAAQ,EAAE,UADE;MAEZE,IAAI,EAAE,EAFM;MAGZM,iBAAiB,EAAE,CAHP;MAIZC,KAAK,EAAE;IAJK,CAVb;IAgBHC,WAAW,EAAE;MACTV,QAAQ,EAAE,UADD;MAETE,IAAI,EAAE,CAFG;MAGTM,iBAAiB,EAAEG;IAHV;EAhBV,CAAP;AAsBH,CAvBD;;AAyBA,MAAMC,UAAU,GAAIC,KAAD,IAAuB;EACtC,MAAM;IACFC,WADE;IAEFC,aAFE;IAG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,MADf;MAEI7D,GAAG,EAAE8B,WAFT;MAGItB,KAAK,EAAEQ,KAAK,IAAIC,UAAT,GAAsBA,UAAtB,GAAmCW,gBAH9C;MAIIc,OAAO,EAAEb;IAJb,CAJG,CADX;IAYI,aAAa,EAAE;EAZnB,GAcKR,KAdL,CA5EJ,CADS,GA8FT,IA9FJ;AA+FH,CA5KD;;eA8KeV,U"}
1
+ {"version":3,"names":["useStyles","background","position","top","left","bottom","right","width","height","backgroundText","paddingHorizontal","color","placeholder","inputPaddingHorizontal","InputLabel","props","activeColor","animatedError","animatedLabel","error","errorColor","focused","fontSize","hasActiveOutline","label","labelLayout","labelScale","labelTranslateX","labelTranslateY","onLayoutAnimatedText","paddingOffset","placeholderColor","placeholderOpacity","topPosition","value","theme","useTheme","styles","paperStyles","usePaperStyles","backgroundStyle","backgroundColor","palette","default","hasFocus","opacity","interpolate","inputRange","outputRange","labelTranslationX","transform","translateX","labelTextFontStyle","createFontStyle","selector","typo","caption2","labelStyle","translateY","scale","StyleSheet","absoluteFill","measured","scaleY","textAlign"],"sources":["InputLabel.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, LayoutChangeEvent, StyleSheet } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport usePaperStyles from '../Paper/usePaperStyles';\nimport { inputPaddingHorizontal } from './utils';\n\ninterface LabelProps {\n activeColor: string;\n animatedError: Animated.Value;\n animatedLabel: Animated.Value;\n error?: boolean;\n errorColor?: string;\n focused?: boolean;\n fontSize?: number;\n hasActiveOutline?: boolean;\n label?: string;\n labelLayout: { measured: boolean; width: number; height: number };\n labelScale: number;\n labelTranslateX: number;\n labelTranslateY: number;\n onLayoutAnimatedText: (event: LayoutChangeEvent) => void;\n paddingOffset?: { paddingLeft: number; paddingRight: number };\n placeholder?: string;\n placeholderColor?: string;\n placeholderOpacity: number | Animated.AnimatedInterpolation;\n topPosition: number;\n value?: string;\n}\n\ntype InputLabelStyles = NamedStylesStringUnion<'background' | 'backgroundText' | 'placeholder'>;\n\nconst useStyles: UseStyles<InputLabelStyles> = function (): InputLabelStyles {\n return {\n background: {\n position: 'absolute',\n top: 6,\n left: 10,\n bottom: 0,\n right: 0,\n width: 8,\n height: 4,\n },\n backgroundText: {\n position: 'absolute',\n left: 18,\n paddingHorizontal: 0,\n color: 'transparent',\n },\n placeholder: {\n position: 'absolute',\n left: 0,\n paddingHorizontal: inputPaddingHorizontal,\n },\n };\n};\n\nconst InputLabel = (props: LabelProps) => {\n const {\n activeColor,\n animatedError,\n animatedLabel,\n error = false,\n errorColor,\n focused,\n fontSize,\n hasActiveOutline,\n label,\n labelLayout,\n labelScale,\n labelTranslateX,\n labelTranslateY,\n onLayoutAnimatedText,\n paddingOffset,\n placeholderColor,\n placeholderOpacity,\n topPosition,\n value,\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const paperStyles = usePaperStyles();\n\n const backgroundStyle = {\n backgroundColor: paperStyles?.backgroundColor ?? theme.palette.background.default,\n };\n\n const hasFocus = hasActiveOutline || value;\n const opacity = animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasFocus ? 1 : 0, 0],\n });\n\n const labelTranslationX = {\n transform: [\n {\n translateX: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [labelTranslateX, 0 || 0],\n }),\n },\n ],\n };\n\n const labelTextFontStyle = createFontStyle(theme, { selector: (typo) => typo.caption2 });\n\n const labelStyle = {\n fontSize,\n transform: [\n {\n translateX: animatedError.interpolate({\n inputRange: [0, 0.5, 1],\n outputRange: [0, value && error ? 4 : 0, 0],\n }),\n },\n {\n translateY: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [labelTranslateY, 0],\n }),\n },\n {\n scale: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [labelScale, 1],\n }),\n },\n ],\n };\n\n return (label ? (\n <Animated.View\n pointerEvents={'none'}\n style={[\n StyleSheet.absoluteFill,\n {\n opacity: value || focused ? (labelLayout.measured ? 1 : 0) : 1,\n },\n labelTranslationX,\n ]}\n >\n {[\n <Animated.View\n key={'labelBackground-view'}\n pointerEvents={'none'}\n style={[\n styles.background,\n backgroundStyle,\n {\n opacity,\n transform: [\n {\n translateX: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [-labelTranslateX, 0],\n }),\n },\n ],\n },\n ]}\n />,\n <Animated.Text\n key={'labelBackground-text'}\n style={[\n labelTextFontStyle,\n styles.placeholder,\n styles.backgroundText,\n backgroundStyle,\n labelStyle,\n {\n top: topPosition + 1,\n opacity,\n transform: [\n ...labelStyle.transform,\n {\n scaleY: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [0.2, 1],\n }),\n },\n ],\n },\n ]}\n numberOfLines={1}\n >\n {label}\n </Animated.Text>,\n ]}\n <Animated.Text\n onLayout={onLayoutAnimatedText}\n style={[\n styles.placeholder,\n labelTextFontStyle,\n labelStyle,\n paddingOffset,\n {\n textAlign: 'left',\n top: topPosition,\n color: error && errorColor ? errorColor : activeColor,\n opacity: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasActiveOutline ? 1 : 0, 0],\n }),\n },\n ]}\n numberOfLines={1}\n >\n {label}\n </Animated.Text>\n <Animated.Text\n style={[\n styles.placeholder,\n labelTextFontStyle,\n labelStyle,\n paddingOffset,\n {\n textAlign: 'left',\n top: topPosition,\n color: error && errorColor ? errorColor : placeholderColor,\n opacity: placeholderOpacity,\n },\n ]}\n numberOfLines={1}\n >\n {label}\n </Animated.Text>\n </Animated.View>\n ) : null);\n};\n\nexport default InputLabel;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;AA2BA,MAAMA,SAAsC,GAAG,YAA8B;EACzE,OAAO;IACHC,UAAU,EAAE;MACRC,QAAQ,EAAE,UADF;MAERC,GAAG,EAAE,CAFG;MAGRC,IAAI,EAAE,EAHE;MAIRC,MAAM,EAAE,CAJA;MAKRC,KAA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A,UAAtB,GAAmCJ,WAH9C;MAII6B,OAAO,EAAE3B,aAAa,CAAC4B,WAAd,CAA0B;QAC/BC,UAAU,EAAE,CAAC,CAAD,EAAI,CAAJ,CADmB;QAE/BC,WAAW,EAAE,CAACzB,gBAAgB,GAAG,CAAH,GAAO,CAAxB,EAA2B,CAA3B;MAFkB,CAA1B;IAJb,CALG,CAFX;IAiBI,aAAa,EAAE;EAjBnB,GAmBKC,KAnBL,CAzDJ,eA8EI,6BAAC,qBAAD,CAAU,IAAV;IACI,KAAK,EAAE,CACHa,MAAM,CAACzB,WADJ,EAEHwC,kBAFG,EAGHK,UAHG,EAIH3B,aAJG,EAKH;MACIkC,SAAS,EAAE,MADf;MAEI7D,GAAG,EAAE8B,WAFT;MAGItB,KAAK,EAAEQ,KAAK,IAAIC,UAAT,GAAsBA,UAAtB,GAAmCW,gBAH9C;MAIIc,OAAO,EAAEb;IAJb,CALG,CADX;IAaI,aAAa,EAAE;EAbnB,GAeKR,KAfL,CA9EJ,CADS,GAiGT,IAjGJ;AAkGH,CA9KD;;eAgLeV,U"}
@@ -113,7 +113,7 @@ const OutlinedTextField = /*#__PURE__*/_react.default.forwardRef(function Outlin
113
113
  topPosition
114
114
  };
115
115
  const inputTextFontStyle = (0, _styles.createFontStyle)(theme, {
116
- selector: typo => typo.body1,
116
+ selector: typo => typo.caption2,
117
117
  color: inputTextColor
118
118
  });
119
119
  const outlineStyle = (0, _styles.css)([styles.outline, {
@@ -1 +1 @@
1
- {"version":3,"names":["useStyles","theme","useTheme","outline","position","left","right","bottom","borderRadius","shape","roundness","input","flexGrow","paddingHorizontal","inputPaddingHorizontal","textAlignVertical","textAlign","zIndex","textField","iconContainer","width","height","justifyContent","alignItems","OutlinedTextField","React","forwardRef","props","ref","animatedError","animatedLabel","disabled","error","focused","forceFocus","icon","keyboardType","label","labelLayout","onBlur","onChangeText","onFocus","onIconPress","onLayoutAnimatedText","onSubmitEditing","placeholder","secureTextEntry","style","value","styles","hasActiveOutline","inputTextColor","palette","tertiary","main","primary","activeColor","warning","accent","placeholderColor","text","hint","outlineColor","border","errorColor","typography","body2","fontSize","unitless","labelScale","labelFontSize","labelWidth","labelHeight","labelHalfWidth","labelHalfHeight","labelTranslateX","minInputHeight","defaultHeight","labelPaddingTop","inputHeight","topPosition","Math","floor","iconTopPosition","iconSize","labelYOffset","labelTranslateY","placeholderOpacity","interpolate","inputRange","outputRange","measured","labelProps","inputTextFontStyle","createFontStyle","selector","typo","body1","color","outlineStyle","css","borderWidth","borderColor","top","textInputStyle","marginRight","paddingRight","Platform","OS","outlineWidth","containerStyle","paddingTop","minHeight","iconContainerStyle","onIconButtonPress"],"sources":["OutlinedTextField.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, LayoutChangeEvent, Platform, TextInput, View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport IconButton from '../IconButton';\nimport TextFieldProps from './TextFieldProps';\nimport InputLabel from './InputLabel';\nimport {\n defaultHeight,\n iconSize,\n inputPaddingHorizontal,\n labelFontSize,\n labelPaddingTop,\n labelYOffset,\n} from './utils';\n\ninterface OutlinedTextFieldProps extends TextFieldProps {\n animatedError: Animated.Value;\n animatedLabel: Animated.Value;\n focused: boolean;\n forceFocus: () => void;\n labelLayout: { measured: boolean; width: number; height: number };\n onLayoutAnimatedText: (event: LayoutChangeEvent) => void;\n}\n\ntype OutlinedTextFieldStyles = NamedStylesStringUnion<'outline' | 'input' | 'iconContainer'>;\n\nconst useStyles: UseStyles<OutlinedTextFieldStyles> = function (): OutlinedTextFieldStyles {\n const theme = useTheme();\n\n return {\n outline: {\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: 0,\n borderRadius: theme.shape.roundness,\n },\n input: {\n flexGrow: 1,\n paddingHorizontal: inputPaddingHorizontal,\n textAlignVertical: 'center',\n textAlign: 'left',\n zIndex: theme.zIndex.textField,\n },\n iconContainer: {\n position: 'absolute',\n width: 24,\n height: 24,\n justifyContent: 'center',\n alignItems: 'center',\n right: 12,\n },\n };\n};\n\nconst OutlinedTextField = React.forwardRef<TextInput, OutlinedTextFieldProps>(function OutlinedTextField(props, ref) {\n const {\n animatedError,\n animatedLabel,\n disabled,\n error,\n focused,\n forceFocus,\n icon,\n keyboardType,\n label,\n labelLayout,\n onBlur,\n onChangeText,\n onFocus,\n onIconPress,\n onLayoutAnimatedText,\n onSubmitEditing,\n placeholder,\n secureTextEntry,\n style,\n value,\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const hasActiveOutline = focused || error;\n const inputTextColor = disabled ? theme.palette.tertiary.main : theme.palette.primary.main;\n const activeColor = error\n ? theme.palette.warning.main\n : disabled\n ? theme.palette.tertiary.main\n : theme.palette.accent.main;\n const placeholderColor = disabled ? theme.palette.tertiary.main : theme.palette.text.hint;\n const outlineColor = disabled ? theme.palette.border : theme.palette.border;\n const errorColor = disabled ? theme.palette.tertiary.main : theme.palette.warning.main;\n\n const typography = theme.typography.body2;\n const fontSize = typography.fontSize.unitless;\n\n const labelScale = labelFontSize / fontSize;\n const labelWidth = labelLayout.width;\n const labelHeight = labelLayout.height;\n const labelHalfWidth = labelWidth / 2;\n const labelHalfHeight = labelHeight / 2;\n\n const labelTranslateX = -1 * (labelHalfWidth - (labelScale * labelWidth) / 2 - (fontSize - labelFontSize) * labelScale);\n const minInputHeight = defaultHeight - labelPaddingTop;\n const inputHeight = labelHeight < minInputHeight ? minInputHeight : labelHeight;\n const topPosition = Math.floor(((inputHeight > 0 ? inputHeight : 0) - labelHeight) / 2 + labelPaddingTop);\n const iconTopPosition = (defaultHeight - (label ? 0 : labelPaddingTop) - iconSize - (label ? labelYOffset : 0)) / 2;\n const labelTranslateY = -labelHalfHeight - (topPosition + labelYOffset);\n\n const placeholderOpacity = hasActiveOutline\n ? animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasActiveOutline ? 0 : 1, 1],\n })\n : labelLayout.measured ? 1 : 0;\n\n const labelProps = {\n activeColor,\n error,\n errorColor,\n fontSize,\n hasActiveOutline,\n label,\n labelScale,\n labelTranslateX,\n labelTranslateY,\n onLayoutAnimatedText,\n placeholderColor,\n placeholderOpacity,\n topPosition,\n };\n\n const inputTextFontStyle = createFontStyle(theme, {\n selector: (typo) => typo.body1,\n color: inputTextColor,\n });\n\n const outlineStyle = css([\n styles.outline,\n {\n borderWidth: hasActiveOutline ? 2 : 1,\n borderColor: error ? errorColor : (hasActiveOutline ? activeColor : outlineColor),\n top: label ? 6 : 0,\n },\n ]);\n\n const textInputStyle = css([\n inputTextFontStyle,\n styles.input,\n {\n fontSize,\n color: inputTextColor,\n height: inputHeight,\n },\n icon && {\n marginRight: iconSize + 20,\n paddingRight: 0,\n },\n Platform.OS === 'web' && {\n //@ts-ignore\n outlineWidth: 0,\n },\n ]);\n\n const containerStyle = css([\n {\n paddingTop: label ? labelPaddingTop : 0,\n minHeight: label ? defaultHeight : defaultHeight + labelYOffset,\n },\n ]);\n\n const iconContainerStyle = css([\n styles.iconContainer,\n { top: iconTopPosition },\n ]);\n\n const onIconButtonPress = () => {\n forceFocus();\n onIconPress?.();\n };\n\n return (\n <View style={style}>\n <View\n pointerEvents={'none'}\n style={outlineStyle}\n />\n <View style={containerStyle}>\n {label ? (\n <InputLabel\n animatedLabel={animatedLabel}\n animatedError={animatedError}\n focused={focused}\n labelLayout={labelLayout}\n placeholder={placeholder}\n value={value}\n {...labelProps}\n />\n ) : null}\n <TextInput\n autoCapitalize={'none'}\n autoCorrect={false}\n disableFullscreenUI={true}\n ref={ref}\n onChangeText={onChangeText}\n placeholder={placeholder}\n placeholderTextColor={placeholderColor}\n editable={!disabled}\n selectionColor={activeColor}\n onFocus={onFocus}\n onBlur={onBlur}\n onSubmitEditing={onSubmitEditing}\n keyboardType={keyboardType}\n secureTextEntry={secureTextEntry}\n underlineColorAndroid={'transparent'}\n style={textInputStyle}\n value={value}\n />\n </View>\n {icon ? (\n <View style={iconContainerStyle}>\n <IconButton\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AKA,oBACI,6BAAC,iBAAD;IAAM,KAAK,EAAEK;EAAb,gBACI,6BAAC,iBAAD;IACI,aAAa,EAAE,MADnB;IAEI,KAAK,EAAEoD;EAFX,EADJ,eAKI,6BAAC,iBAAD;IAAM,KAAK,EAAEW;EAAb,GACKzE,KAAK,gBACF,6BAAC,mBAAD;IACI,aAAa,EAAEP,aADnB;IAEI,aAAa,EAAED,aAFnB;IAGI,OAAO,EAAEI,OAHb;IAII,WAAW,EAAEK,WAJjB;IAKI,WAAW,EAAEO,WALjB;IAMI,KAAK,EAAEG;EANX,GAOQ4C,UAPR,EADE,GAUF,IAXR,eAYI,6BAAC,sBAAD;IACI,cAAc,EAAE,MADpB;IAEI,WAAW,EAAE,KAFjB;IAGI,mBAAmB,EAAE,IAHzB;IAII,GAAG,EAAEhE,GAJT;IAKI,YAAY,EAAEY,YALlB;IAMI,WAAW,EAAEK,WANjB;IAOI,oBAAoB,EAAEc,gBAP1B;IAQI,QAAQ,EAAE,CAAC5B,QARf;IASI,cAAc,EAAEyB,WATpB;IAUI,OAAO,EAAEf,OAVb;IAWI,MAAM,EAAEF,MAXZ;IAYI,eAAe,EAAEK,eAZrB;IAaI,YAAY,EAAER,YAblB;IAcI,eAAe,EAAEU,eAdrB;IAeI,qBAAqB,EAAE,aAf3B;IAgBI,KAAK,EAAE0D,cAhBX;IAiBI,KAAK,EAAExD;EAjBX,EAZJ,CALJ,EAqCKb,IAAI,gBACD,6BAAC,iBAAD;IAAM,KAAK,EAAE8E;EAAb,gBACI,6BAAC,mBAAD;IACI,QAAQ,EAAE9E,IADd;IAEI,OAAO,EAAE+E;EAFb,EADJ,CADC,GAOD,IA5CR,CADJ;AAgDH,CA/KyB,CAA1B;;eAiLe1F,iB"}
1
+ {"version":3,"names":["useStyles","theme","useTheme","outline","position","left","right","bottom","borderRadius","shape","roundness","input","flexGrow","paddingHorizontal","inputPaddingHorizontal","textAlignVertical","textAlign","zIndex","textField","iconContainer","width","height","justifyContent","alignItems","OutlinedTextField","React","forwardRef","props","ref","animatedError","animatedLabel","disabled","error","focused","forceFocus","icon","keyboardType","label","labelLayout","onBlur","onChangeText","onFocus","onIconPress","onLayoutAnimatedText","onSubmitEditing","placeholder","secureTextEntry","style","value","styles","hasActiveOutline","inputTextColor","palette","tertiary","main","primary","activeColor","warning","accent","placeholderColor","text","hint","outlineColor","border","errorColor","typography","body2","fontSize","unitless","labelScale","labelFontSize","labelWidth","labelHeight","labelHalfWidth","labelHalfHeight","labelTranslateX","minInputHeight","defaultHeight","labelPaddingTop","inputHeight","topPosition","Math","floor","iconTopPosition","iconSize","labelYOffset","labelTranslateY","placeholderOpacity","interpolate","inputRange","outputRange","measured","labelProps","inputTextFontStyle","createFontStyle","selector","typo","caption2","color","outlineStyle","css","borderWidth","borderColor","top","textInputStyle","marginRight","paddingRight","Platform","OS","outlineWidth","containerStyle","paddingTop","minHeight","iconContainerStyle","onIconButtonPress"],"sources":["OutlinedTextField.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, LayoutChangeEvent, Platform, TextInput, View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport IconButton from '../IconButton';\nimport TextFieldProps from './TextFieldProps';\nimport InputLabel from './InputLabel';\nimport {\n defaultHeight,\n iconSize,\n inputPaddingHorizontal,\n labelFontSize,\n labelPaddingTop,\n labelYOffset,\n} from './utils';\n\ninterface OutlinedTextFieldProps extends TextFieldProps {\n animatedError: Animated.Value;\n animatedLabel: Animated.Value;\n focused: boolean;\n forceFocus: () => void;\n labelLayout: { measured: boolean; width: number; height: number };\n onLayoutAnimatedText: (event: LayoutChangeEvent) => void;\n}\n\ntype OutlinedTextFieldStyles = NamedStylesStringUnion<'outline' | 'input' | 'iconContainer'>;\n\nconst useStyles: UseStyles<OutlinedTextFieldStyles> = function (): OutlinedTextFieldStyles {\n const theme = useTheme();\n\n return {\n outline: {\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: 0,\n borderRadius: theme.shape.roundness,\n },\n input: {\n flexGrow: 1,\n paddingHorizontal: inputPaddingHorizontal,\n textAlignVertical: 'center',\n textAlign: 'left',\n zIndex: theme.zIndex.textField,\n },\n iconContainer: {\n position: 'absolute',\n width: 24,\n height: 24,\n justifyContent: 'center',\n alignItems: 'center',\n right: 12,\n },\n };\n};\n\nconst OutlinedTextField = React.forwardRef<TextInput, OutlinedTextFieldProps>(function OutlinedTextField(props, ref) {\n const {\n animatedError,\n animatedLabel,\n disabled,\n error,\n focused,\n forceFocus,\n icon,\n keyboardType,\n label,\n labelLayout,\n onBlur,\n onChangeText,\n onFocus,\n onIconPress,\n onLayoutAnimatedText,\n onSubmitEditing,\n placeholder,\n secureTextEntry,\n style,\n value,\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const hasActiveOutline = focused || error;\n const inputTextColor = disabled ? theme.palette.tertiary.main : theme.palette.primary.main;\n const activeColor = error\n ? theme.palette.warning.main\n : disabled\n ? theme.palette.tertiary.main\n : theme.palette.accent.main;\n const placeholderColor = disabled ? theme.palette.tertiary.main : theme.palette.text.hint;\n const outlineColor = disabled ? theme.palette.border : theme.palette.border;\n const errorColor = disabled ? theme.palette.tertiary.main : theme.palette.warning.main;\n\n const typography = theme.typography.body2;\n const fontSize = typography.fontSize.unitless;\n\n const labelScale = labelFontSize / fontSize;\n const labelWidth = labelLayout.width;\n const labelHeight = labelLayout.height;\n const labelHalfWidth = labelWidth / 2;\n const labelHalfHeight = labelHeight / 2;\n\n const labelTranslateX = -1 * (labelHalfWidth - (labelScale * labelWidth) / 2 - (fontSize - labelFontSize) * labelScale);\n const minInputHeight = defaultHeight - labelPaddingTop;\n const inputHeight = labelHeight < minInputHeight ? minInputHeight : labelHeight;\n const topPosition = Math.floor(((inputHeight > 0 ? inputHeight : 0) - labelHeight) / 2 + labelPaddingTop);\n const iconTopPosition = (defaultHeight - (label ? 0 : labelPaddingTop) - iconSize - (label ? labelYOffset : 0)) / 2;\n const labelTranslateY = -labelHalfHeight - (topPosition + labelYOffset);\n\n const placeholderOpacity = hasActiveOutline\n ? animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasActiveOutline ? 0 : 1, 1],\n })\n : labelLayout.measured ? 1 : 0;\n\n const labelProps = {\n activeColor,\n error,\n errorColor,\n fontSize,\n hasActiveOutline,\n label,\n labelScale,\n labelTranslateX,\n labelTranslateY,\n onLayoutAnimatedText,\n placeholderColor,\n placeholderOpacity,\n topPosition,\n };\n\n const inputTextFontStyle = createFontStyle(theme, {\n selector: (typo) => typo.caption2,\n color: inputTextColor,\n });\n\n const outlineStyle = css([\n styles.outline,\n {\n borderWidth: hasActiveOutline ? 2 : 1,\n borderColor: error ? errorColor : (hasActiveOutline ? activeColor : outlineColor),\n top: label ? 6 : 0,\n },\n ]);\n\n const textInputStyle = css([\n inputTextFontStyle,\n styles.input,\n {\n fontSize,\n color: inputTextColor,\n height: inputHeight,\n },\n icon && {\n marginRight: iconSize + 20,\n paddingRight: 0,\n },\n Platform.OS === 'web' && {\n //@ts-ignore\n outlineWidth: 0,\n },\n ]);\n\n const containerStyle = css([\n {\n paddingTop: label ? labelPaddingTop : 0,\n minHeight: label ? defaultHeight : defaultHeight + labelYOffset,\n },\n ]);\n\n const iconContainerStyle = css([\n styles.iconContainer,\n { top: iconTopPosition },\n ]);\n\n const onIconButtonPress = () => {\n forceFocus();\n onIconPress?.();\n };\n\n return (\n <View style={style}>\n <View\n pointerEvents={'none'}\n style={outlineStyle}\n />\n <View style={containerStyle}>\n {label ? (\n <InputLabel\n animatedLabel={animatedLabel}\n animatedError={animatedError}\n focused={focused}\n labelLayout={labelLayout}\n placeholder={placeholder}\n value={value}\n {...labelProps}\n />\n ) : null}\n <TextInput\n autoCapitalize={'none'}\n autoCorrect={false}\n disableFullscreenUI={true}\n ref={ref}\n onChangeText={onChangeText}\n placeholder={placeholder}\n placeholderTextColor={placeholderColor}\n editable={!disabled}\n selectionColor={activeColor}\n onFocus={onFocus}\n onBlur={onBlur}\n onSubmitEditing={onSubmitEditing}\n keyboardType={keyboardType}\n secureTextEntry={secureTextEntry}\n underlineColorAndroid={'transparent'}\n style={textInputStyle}\n value={value}\n />\n </View>\n {icon ? (\n <View style={iconContainerStyle}>\n <IconButton\n children={icon}\n onPress={onIconButtonPress}\n />\n </View>\n ) : null}\n </View>\n );\n});\n\nexport default OutlinedTextField;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;;;;;AAoBA,MAAMA,SAA6C,GAAG,YAAqC;EACvF,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,OAAO,EAAE;MACLC,QAAQ,EAAE,UADL;MAELC,IAAI,EAAE,CAFD;MAGLC,KAAK,EAAE,CAHF;MAILC,MAAM,EAAE,CAJH;MAKLC,YAAY,EAAEP,KAAK,CAACQ,KAAN,CAAYC;IALrB,CADN;IAQHC,KAAK,EAAE;MACHC,QAAQ,EAAE,CADP;MAEHC,iBAAiB,EAAEC,6BAFhB;MAGHC,iBAAiB,EAAE,QAHhB;MAIHC,SAAS,EAAE,MAJR;MAKHC,MAAM,EAAEhB,KAAK,CAACgB,MAAN,CAAaC;IALlB,CARJ;IAeHC,aAAa,EAAE;MACXf,QAAQ,EAAE,UADC;MAEXgB,KAAK,EAAE,EAFI;MAGXC,MAAM,EAAE,EAHG;MAIXC,cAAc,EAAE,QAJL;MAKXC,UAAU,EAAE,QALD;MAMXjB,KAAK,EAAE;IANI;EAfZ,CAAP;AAwBH,CA3BD;;AA6BA,MAAMkB,iBAAiB,gBAAGC,cAAA,CAAMC,UAAN,CAAoD,SAASF,iBAAT,CAA2BG,KAA3B,EAAkCC,GAAlC,EAAuC;EACjH,MAAM;IACFC,aADE;IAEFC,aAFE;IAGFC,QAHE;IAIFC,KAJE;IAKFC,OALE;IAMFC,UANE;IAOFC,IAPE;IAQFC,YARE;IASFC,KATE;IAUFC,WAVE;IAWFC,MAXE;IAYFC,YAZE;I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1F,iB"}
@@ -74,7 +74,6 @@ const InputLabel = props => {
74
74
  selector: typo => typo.caption2
75
75
  });
76
76
  const labelStyle = {
77
- labelTextFontStyle,
78
77
  fontSize,
79
78
  transform: [{
80
79
  translateX: animatedError.interpolate({
@@ -112,7 +111,7 @@ const InputLabel = props => {
112
111
  }]
113
112
  }), /*#__PURE__*/React.createElement(Animated.Text, {
114
113
  key: 'labelBackground-text',
115
- style: [styles.placeholder, styles.backgroundText, backgroundStyle, labelStyle, {
114
+ style: [labelTextFontStyle, styles.placeholder, styles.backgroundText, backgroundStyle, labelStyle, {
116
115
  top: topPosition + 1,
117
116
  opacity,
118
117
  transform: [...labelStyle.transform, {
@@ -125,7 +124,7 @@ const InputLabel = props => {
125
124
  numberOfLines: 1
126
125
  }, label)], /*#__PURE__*/React.createElement(Animated.Text, {
127
126
  onLayout: onLayoutAnimatedText,
128
- style: [styles.placeholder, labelStyle, paddingOffset, {
127
+ style: [styles.placeholder, labelTextFontStyle, labelStyle, paddingOffset, {
129
128
  textAlign: 'left',
130
129
  top: topPosition,
131
130
  color: error && errorColor ? errorColor : activeColor,
@@ -136,7 +135,7 @@ const InputLabel = props => {
136
135
  }],
137
136
  numberOfLines: 1
138
137
  }, label), /*#__PURE__*/React.createElement(Animated.Text, {
139
- style: [styles.placeholder, labelStyle, paddingOffset, {
138
+ style: [styles.placeholder, labelTextFontStyle, labelStyle, paddingOffset, {
140
139
  textAlign: 'left',
141
140
  top: topPosition,
142
141
  color: error && errorColor ? errorColor : placeholderColor,
@@ -1 +1 @@
1
- {"version":3,"names":["React","Animated","StyleSheet","createFontStyle","useTheme","usePaperStyles","inputPaddingHorizontal","useStyles","background","position","top","left","bottom","right","width","height","backgroundText","paddingHorizontal","color","placeholder","InputLabel","props","activeColor","animatedError","animatedLabel","error","errorColor","focused","fontSize","hasActiveOutline","label","labelLayout","labelScale","labelTranslateX","labelTranslateY","onLayoutAnimatedText","paddingOffset","placeholderColor","placeholderOpacity","topPosition","value","theme","styles","paperStyles","backgroundStyle","backgroundColor","palette","default","hasFocus","opacity","interpolate","inputRange","outputRange","labelTranslationX","transform","translateX","labelTextFontStyle","selector","typo","caption2","labelStyle","translateY","scale","absoluteFill","measured","scaleY","textAlign"],"sources":["InputLabel.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, LayoutChangeEvent, StyleSheet } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport usePaperStyles from '../Paper/usePaperStyles';\nimport { inputPaddingHorizontal } from './utils';\n\ninterface LabelProps {\n activeColor: string;\n animatedError: Animated.Value;\n animatedLabel: Animated.Value;\n error?: boolean;\n errorColor?: string;\n focused?: boolean;\n fontSize?: number;\n hasActiveOutline?: boolean;\n label?: string;\n labelLayout: { measured: boolean; width: number; height: number };\n labelScale: number;\n labelTranslateX: number;\n labelTranslateY: number;\n onLayoutAnimatedText: (event: LayoutChangeEvent) => void;\n paddingOffset?: { paddingLeft: number; paddingRight: number };\n placeholder?: string;\n placeholderColor?: string;\n placeholderOpacity: number | Animated.AnimatedInterpolation;\n topPosition: number;\n value?: string;\n}\n\ntype InputLabelStyles = NamedStylesStringUnion<'background' | 'backgroundText' | 'placeholder'>;\n\nconst useStyles: UseStyles<InputLabelStyles> = function (): InputLabelStyles {\n return {\n background: {\n position: 'absolute',\n top: 6,\n left: 10,\n bottom: 0,\n right: 0,\n width: 8,\n height: 4,\n },\n backgroundText: {\n position: 'absolute',\n left: 18,\n paddingHorizontal: 0,\n color: 'transparent',\n },\n placeholder: {\n position: 'absolute',\n left: 0,\n paddingHorizontal: inputPaddingHorizontal,\n },\n };\n};\n\nconst InputLabel = (props: LabelProps) => {\n const {\n activeColor,\n animatedError,\n animatedLabel,\n error = false,\n errorColor,\n focused,\n fontSize,\n hasActiveOutline,\n label,\n labelLayout,\n labelScale,\n labelTranslateX,\n labelTranslateY,\n onLayoutAnimatedText,\n paddingOffset,\n placeholderColor,\n placeholderOpacity,\n topPosition,\n value,\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const paperStyles = usePaperStyles();\n\n const backgroundStyle = {\n backgroundColor: paperStyles?.backgroundColor ?? theme.palette.background.default,\n };\n\n const hasFocus = hasActiveOutline || value;\n const opacity = animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasFocus ? 1 : 0, 0],\n });\n\n const labelTranslationX = {\n transform: [\n {\n translateX: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [labelTranslateX, 0 || 0],\n }),\n },\n ],\n };\n\n const labelTextFontStyle = createFontStyle(theme, { selector: (typo) => typo.caption2 });\n\n const labelStyle = {\n labelTextFontStyle,\n fontSize,\n transform: [\n {\n translateX: animatedError.interpolate({\n inputRange: [0, 0.5, 1],\n outputRange: [0, value && error ? 4 : 0, 0],\n }),\n },\n {\n translateY: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [labelTranslateY, 0],\n }),\n },\n {\n scale: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [labelScale, 1],\n }),\n },\n ],\n };\n\n return (label ? (\n <Animated.View\n pointerEvents={'none'}\n style={[\n StyleSheet.absoluteFill,\n {\n opacity: value || focused ? (labelLayout.measured ? 1 : 0) : 1,\n },\n labelTranslationX,\n ]}\n >\n {[\n <Animated.View\n key={'labelBackground-view'}\n pointerEvents={'none'}\n style={[\n styles.background,\n backgroundStyle,\n {\n opacity,\n transform: [\n {\n translateX: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [-labelTranslateX, 0],\n }),\n },\n ],\n },\n ]}\n />,\n <Animated.Text\n key={'labelBackground-text'}\n style={[\n styles.placeholder,\n styles.backgroundText,\n backgroundStyle,\n labelStyle,\n {\n top: topPosition + 1,\n opacity,\n transform: [\n ...labelStyle.transform,\n {\n scaleY: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [0.2, 1],\n }),\n },\n ],\n },\n ]}\n numberOfLines={1}\n >\n {label}\n </Animated.Text>,\n ]}\n <Animated.Text\n onLayout={onLayoutAnimatedText}\n style={[\n styles.placeholder,\n labelStyle,\n paddingOffset,\n {\n textAlign: 'left',\n top: topPosition,\n color: error && errorColor ? errorColor : activeColor,\n opacity: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasActiveOutline ? 1 : 0, 0],\n }),\n },\n ]}\n numberOfLines={1}\n >\n {label}\n </Animated.Text>\n <Animated.Text\n style={[\n styles.placeholder,\n labelStyle,\n paddingOffset,\n {\n textAlign: 'left',\n top: topPosition,\n color: error && errorColor ? errorColor : placeholderColor,\n opacity: placeholderOpacity,\n },\n ]}\n numberOfLines={1}\n >\n {label}\n </Animated.Text>\n </Animated.View>\n ) : null);\n};\n\nexport default InputLabel;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,QAAT,EAAsCC,UAAtC,QAAwD,cAAxD;AAEA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;AACA,OAAOC,cAAP,MAA2B,yBAA3B;AACA,SAASC,sBAAT,QAAuC,SAAvC;;AA2BA,MAAMC,SAAsC,GAAG,YAA8B;EACzE,OAAO;IACHC,UAAU,EAAE;MACRC,QAAQ,EAAE,UADF;MAERC,GAAG,EAAE,CAFG;MAGRC,IAAI,EAAE,EAHE;MAIRC,MAAM,EAAE,CAJA;MAKRC,KAAK,EAAE,CALC;MAMRC,KAAK,EAAE,CANC;MAORC,MAAM,EAAE;IAPA,CADT;IAUHC,cAAc,EAAE;MACZP,QAAQ,EAAE,UADE;MAEZE,IAAI,EAAE,EAFM;MAGZM,iBAAiB,EAAE,CAHP;MAIZC,KAAK,EAAE;IAJK,CAVb;IAgBHC,WAAW,EAAE;MACTV,QAAQ,EAAE,UADD;MAETE,IAAI,EAAE,CAFG;MAGTM,iBAAiB,EAAEX;IAHV;EAhBV,CAAP;AAsBH,CAvBD;;AAyBA,MAAMc,UAAU,GAAIC,KAAD,IAAuB;EACtC,MAAM;IACFC,WADE;IA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EIxD,GAAG,EAAE6B,WAFT;MAGIrB,KAAK,EAAEO,KAAK,IAAIC,UAAT,GAAsBA,UAAtB,GAAmCW,gBAH9C;MAIIY,OAAO,EAAEX;IAJb,CAJG,CADX;IAYI,aAAa,EAAE;EAZnB,GAcKR,KAdL,CA5EJ,CADS,GA8FT,IA9FJ;AA+FH,CA5KD;;AA8KA,eAAeV,UAAf"}
1
+ {"version":3,"names":["React","Animated","StyleSheet","createFontStyle","useTheme","usePaperStyles","inputPaddingHorizontal","useStyles","background","position","top","left","bottom","right","width","height","backgroundText","paddingHorizontal","color","placeholder","InputLabel","props","activeColor","animatedError","animatedLabel","error","errorColor","focused","fontSize","hasActiveOutline","label","labelLayout","labelScale","labelTranslateX","labelTranslateY","onLayoutAnimatedText","paddingOffset","placeholderColor","placeholderOpacity","topPosition","value","theme","styles","paperStyles","backgroundStyle","backgroundColor","palette","default","hasFocus","opacity","interpolate","inputRange","outputRange","labelTranslationX","transform","translateX","labelTextFontStyle","selector","typo","caption2","labelStyle","translateY","scale","absoluteFill","measured","scaleY","textAlign"],"sources":["InputLabel.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, LayoutChangeEvent, StyleSheet } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport usePaperStyles from '../Paper/usePaperStyles';\nimport { inputPaddingHorizontal } from './utils';\n\ninterface LabelProps {\n activeColor: string;\n animatedError: Animated.Value;\n animatedLabel: Animated.Value;\n error?: boolean;\n errorColor?: string;\n focused?: boolean;\n fontSize?: number;\n hasActiveOutline?: boolean;\n label?: string;\n labelLayout: { measured: boolean; width: number; height: number };\n labelScale: number;\n labelTranslateX: number;\n labelTranslateY: number;\n onLayoutAnimatedText: (event: LayoutChangeEvent) => void;\n paddingOffset?: { paddingLeft: number; paddingRight: number };\n placeholder?: string;\n placeholderColor?: string;\n placeholderOpacity: number | Animated.AnimatedInterpolation;\n topPosition: number;\n value?: string;\n}\n\ntype InputLabelStyles = NamedStylesStringUnion<'background' | 'backgroundText' | 'placeholder'>;\n\nconst useStyles: UseStyles<InputLabelStyles> = function (): InputLabelStyles {\n return {\n background: {\n position: 'absolute',\n top: 6,\n left: 10,\n bottom: 0,\n right: 0,\n width: 8,\n height: 4,\n },\n backgroundText: {\n position: 'absolute',\n left: 18,\n paddingHorizontal: 0,\n color: 'transparent',\n },\n placeholder: {\n position: 'absolute',\n left: 0,\n paddingHorizontal: inputPaddingHorizontal,\n },\n };\n};\n\nconst InputLabel = (props: LabelProps) => {\n const {\n activeColor,\n animatedError,\n animatedLabel,\n error = false,\n errorColor,\n focused,\n fontSize,\n hasActiveOutline,\n label,\n labelLayout,\n labelScale,\n labelTranslateX,\n labelTranslateY,\n onLayoutAnimatedText,\n paddingOffset,\n placeholderColor,\n placeholderOpacity,\n topPosition,\n value,\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const paperStyles = usePaperStyles();\n\n const backgroundStyle = {\n backgroundColor: paperStyles?.backgroundColor ?? theme.palette.background.default,\n };\n\n const hasFocus = hasActiveOutline || value;\n const opacity = animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasFocus ? 1 : 0, 0],\n });\n\n const labelTranslationX = {\n transform: [\n {\n translateX: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [labelTranslateX, 0 || 0],\n }),\n },\n ],\n };\n\n const labelTextFontStyle = createFontStyle(theme, { selector: (typo) => typo.caption2 });\n\n const labelStyle = {\n fontSize,\n transform: [\n {\n translateX: animatedError.interpolate({\n inputRange: [0, 0.5, 1],\n outputRange: [0, value && error ? 4 : 0, 0],\n }),\n },\n {\n translateY: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [labelTranslateY, 0],\n }),\n },\n {\n scale: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [labelScale, 1],\n }),\n },\n ],\n };\n\n return (label ? (\n <Animated.View\n pointerEvents={'none'}\n style={[\n StyleSheet.absoluteFill,\n {\n opacity: value || focused ? (labelLayout.measured ? 1 : 0) : 1,\n },\n labelTranslationX,\n ]}\n >\n {[\n <Animated.View\n key={'labelBackground-view'}\n pointerEvents={'none'}\n style={[\n styles.background,\n backgroundStyle,\n {\n opacity,\n transform: [\n {\n translateX: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [-labelTranslateX, 0],\n }),\n },\n ],\n },\n ]}\n />,\n <Animated.Text\n key={'labelBackground-text'}\n style={[\n labelTextFontStyle,\n styles.placeholder,\n styles.backgroundText,\n backgroundStyle,\n labelStyle,\n {\n top: topPosition + 1,\n opacity,\n transform: [\n ...labelStyle.transform,\n {\n scaleY: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [0.2, 1],\n }),\n },\n ],\n },\n ]}\n numberOfLines={1}\n >\n {label}\n </Animated.Text>,\n ]}\n <Animated.Text\n onLayout={onLayoutAnimatedText}\n style={[\n styles.placeholder,\n labelTextFontStyle,\n labelStyle,\n paddingOffset,\n {\n textAlign: 'left',\n top: topPosition,\n color: error && errorColor ? errorColor : activeColor,\n opacity: animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasActiveOutline ? 1 : 0, 0],\n }),\n },\n ]}\n numberOfLines={1}\n >\n {label}\n </Animated.Text>\n <Animated.Text\n style={[\n styles.placeholder,\n labelTextFontStyle,\n labelStyle,\n paddingOffset,\n {\n textAlign: 'left',\n top: topPosition,\n color: error && errorColor ? errorColor : placeholderColor,\n opacity: placeholderOpacity,\n },\n ]}\n numberOfLines={1}\n >\n {label}\n </Animated.Text>\n </Animated.View>\n ) : null);\n};\n\nexport default InputLabel;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,QAAT,EAAsCC,UAAtC,QAAwD,cAAxD;AAEA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;AACA,OAAOC,cAAP,MAA2B,yBAA3B;AACA,SAASC,sBAAT,QAAuC,SAAvC;;AA2BA,MAAM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BAFG,EAGHI,UAHG,EAIHxB,aAJG,EAKH;MACI8B,SAAS,EAAE,MADf;MAEIxD,GAAG,EAAE6B,WAFT;MAGIrB,KAAK,EAAEO,KAAK,IAAIC,UAAT,GAAsBA,UAAtB,GAAmCJ,WAH9C;MAII2B,OAAO,EAAEzB,aAAa,CAAC0B,WAAd,CAA0B;QAC/BC,UAAU,EAAE,CAAC,CAAD,EAAI,CAAJ,CADmB;QAE/BC,WAAW,EAAE,CAACvB,gBAAgB,GAAG,CAAH,GAAO,CAAxB,EAA2B,CAA3B;MAFkB,CAA1B;IAJb,CALG,CAFX;IAiBI,aAAa,EAAE;EAjBnB,GAmBKC,KAnBL,CAzDJ,eA8EI,oBAAC,QAAD,CAAU,IAAV;IACI,KAAK,EAAE,CACHY,MAAM,CAACvB,WADJ,EAEHqC,kBAFG,EAGHI,UAHG,EAIHxB,aAJG,EAKH;MACI8B,SAAS,EAAE,MADf;MAEIxD,GAAG,EAAE6B,WAFT;MAGIrB,KAAK,EAAEO,KAAK,IAAIC,UAAT,GAAsBA,UAAtB,GAAmCW,gBAH9C;MAIIY,OAAO,EAAEX;IAJb,CALG,CADX;IAaI,aAAa,EAAE;EAbnB,GAeKR,KAfL,CA9EJ,CADS,GAiGT,IAjGJ;AAkGH,CA9KD;;AAgLA,eAAeV,UAAf"}
@@ -99,7 +99,7 @@ const OutlinedTextField = /*#__PURE__*/React.forwardRef(function OutlinedTextFie
99
99
  topPosition
100
100
  };
101
101
  const inputTextFontStyle = createFontStyle(theme, {
102
- selector: typo => typo.body1,
102
+ selector: typo => typo.caption2,
103
103
  color: inputTextColor
104
104
  });
105
105
  const outlineStyle = css([styles.outline, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","TextInput","View","createFontStyle","css","useTheme","IconButton","InputLabel","defaultHeight","iconSize","inputPaddingHorizontal","labelFontSize","labelPaddingTop","labelYOffset","useStyles","theme","outline","position","left","right","bottom","borderRadius","shape","roundness","input","flexGrow","paddingHorizontal","textAlignVertical","textAlign","zIndex","textField","iconContainer","width","height","justifyContent","alignItems","OutlinedTextField","forwardRef","props","ref","animatedError","animatedLabel","disabled","error","focused","forceFocus","icon","keyboardType","label","labelLayout","onBlur","onChangeText","onFocus","onIconPress","onLayoutAnimatedText","onSubmitEditing","placeholder","secureTextEntry","style","value","styles","hasActiveOutline","inputTextColor","palette","tertiary","main","primary","activeColor","warning","accent","placeholderColor","text","hint","outlineColor","border","errorColor","typography","body2","fontSize","unitless","labelScale","labelWidth","labelHeight","labelHalfWidth","labelHalfHeight","labelTranslateX","minInputHeight","inputHeight","topPosition","Math","floor","iconTopPosition","labelTranslateY","placeholderOpacity","interpolate","inputRange","outputRange","measured","labelProps","inputTextFontStyle","selector","typo","body1","color","outlineStyle","borderWidth","borderColor","top","textInputStyle","marginRight","paddingRight","OS","outlineWidth","containerStyle","paddingTop","minHeight","iconContainerStyle","onIconButtonPress"],"sources":["OutlinedTextField.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, LayoutChangeEvent, Platform, TextInput, View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport IconButton from '../IconButton';\nimport TextFieldProps from './TextFieldProps';\nimport InputLabel from './InputLabel';\nimport {\n defaultHeight,\n iconSize,\n inputPaddingHorizontal,\n labelFontSize,\n labelPaddingTop,\n labelYOffset,\n} from './utils';\n\ninterface OutlinedTextFieldProps extends TextFieldProps {\n animatedError: Animated.Value;\n animatedLabel: Animated.Value;\n focused: boolean;\n forceFocus: () => void;\n labelLayout: { measured: boolean; width: number; height: number };\n onLayoutAnimatedText: (event: LayoutChangeEvent) => void;\n}\n\ntype OutlinedTextFieldStyles = NamedStylesStringUnion<'outline' | 'input' | 'iconContainer'>;\n\nconst useStyles: UseStyles<OutlinedTextFieldStyles> = function (): OutlinedTextFieldStyles {\n const theme = useTheme();\n\n return {\n outline: {\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: 0,\n borderRadius: theme.shape.roundness,\n },\n input: {\n flexGrow: 1,\n paddingHorizontal: inputPaddingHorizontal,\n textAlignVertical: 'center',\n textAlign: 'left',\n zIndex: theme.zIndex.textField,\n },\n iconContainer: {\n position: 'absolute',\n width: 24,\n height: 24,\n justifyContent: 'center',\n alignItems: 'center',\n right: 12,\n },\n };\n};\n\nconst OutlinedTextField = React.forwardRef<TextInput, OutlinedTextFieldProps>(function OutlinedTextField(props, ref) {\n const {\n animatedError,\n animatedLabel,\n disabled,\n error,\n focused,\n forceFocus,\n icon,\n keyboardType,\n label,\n labelLayout,\n onBlur,\n onChangeText,\n onFocus,\n onIconPress,\n onLayoutAnimatedText,\n onSubmitEditing,\n placeholder,\n secureTextEntry,\n style,\n value,\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const hasActiveOutline = focused || error;\n const inputTextColor = disabled ? theme.palette.tertiary.main : theme.palette.primary.main;\n const activeColor = error\n ? theme.palette.warning.main\n : disabled\n ? theme.palette.tertiary.main\n : theme.palette.accent.main;\n const placeholderColor = disabled ? theme.palette.tertiary.main : theme.palette.text.hint;\n const outlineColor = disabled ? theme.palette.border : theme.palette.border;\n const errorColor = disabled ? theme.palette.tertiary.main : theme.palette.warning.main;\n\n const typography = theme.typography.body2;\n const fontSize = typography.fontSize.unitless;\n\n const labelScale = labelFontSize / fontSize;\n const labelWidth = labelLayout.width;\n const labelHeight = labelLayout.height;\n const labelHalfWidth = labelWidth / 2;\n const labelHalfHeight = labelHeight / 2;\n\n const labelTranslateX = -1 * (labelHalfWidth - (labelScale * labelWidth) / 2 - (fontSize - labelFontSize) * labelScale);\n const minInputHeight = defaultHeight - labelPaddingTop;\n const inputHeight = labelHeight < minInputHeight ? minInputHeight : labelHeight;\n const topPosition = Math.floor(((inputHeight > 0 ? inputHeight : 0) - labelHeight) / 2 + labelPaddingTop);\n const iconTopPosition = (defaultHeight - (label ? 0 : labelPaddingTop) - iconSize - (label ? labelYOffset : 0)) / 2;\n const labelTranslateY = -labelHalfHeight - (topPosition + labelYOffset);\n\n const placeholderOpacity = hasActiveOutline\n ? animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasActiveOutline ? 0 : 1, 1],\n })\n : labelLayout.measured ? 1 : 0;\n\n const labelProps = {\n activeColor,\n error,\n errorColor,\n fontSize,\n hasActiveOutline,\n label,\n labelScale,\n labelTranslateX,\n labelTranslateY,\n onLayoutAnimatedText,\n placeholderColor,\n placeholderOpacity,\n topPosition,\n };\n\n const inputTextFontStyle = createFontStyle(theme, {\n selector: (typo) => typo.body1,\n color: inputTextColor,\n });\n\n const outlineStyle = css([\n styles.outline,\n {\n borderWidth: hasActiveOutline ? 2 : 1,\n borderColor: error ? errorColor : (hasActiveOutline ? activeColor : outlineColor),\n top: label ? 6 : 0,\n },\n ]);\n\n const textInputStyle = css([\n inputTextFontStyle,\n styles.input,\n {\n fontSize,\n color: inputTextColor,\n height: inputHeight,\n },\n icon && {\n marginRight: iconSize + 20,\n paddingRight: 0,\n },\n Platform.OS === 'web' && {\n //@ts-ignore\n outlineWidth: 0,\n },\n ]);\n\n const containerStyle = css([\n {\n paddingTop: label ? labelPaddingTop : 0,\n minHeight: label ? defaultHeight : defaultHeight + labelYOffset,\n },\n ]);\n\n const iconContainerStyle = css([\n styles.iconContainer,\n { top: iconTopPosition },\n ]);\n\n const onIconButtonPress = () => {\n forceFocus();\n onIconPress?.();\n };\n\n return (\n <View style={style}>\n <View\n pointerEvents={'none'}\n style={outlineStyle}\n />\n <View style={containerStyle}>\n {label ? (\n <InputLabel\n animatedLabel={animatedLabel}\n animatedError={animatedError}\n focused={focused}\n labelLayout={labelLayout}\n placeholder={placeholder}\n value={value}\n {...labelProps}\n />\n ) : null}\n <TextInput\n autoCapitalize={'none'}\n autoCorrect={false}\n disableFullscreenUI={true}\n ref={ref}\n onChangeText={onChangeText}\n placeholder={placeholder}\n placeholderTextColor={placeholderColor}\n editable={!disabled}\n selectionColor={activeColor}\n onFocus={onFocus}\n onBlur={onBlur}\n onSubmitEditing={onSubmitEditing}\n keyboardType={keyboardType}\n secureTextEntry={secureTextEntry}\n underlineColorAndroid={'transparent'}\n style={textInputStyle}\n value={value}\n />\n </View>\n {icon ? (\n <View style={iconContainerStyle}>\n <IconButton\n children={icon}\n onPress={onIconButtonPress}\n />\n </View>\n ) : null}\n </View>\n );\n});\n\nexport default OutlinedTextField;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAsCC,QAAtC,EAAgDC,SAAhD,EAA2DC,IAA3D,QAAuE,cAAvE;AAEA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,QAA/B,QAA+C,WAA/C;AACA,OAAOC,UAAP,MAAuB,eAAvB;AAEA,OAAOC,UAAP,MAAuB,cAAvB;AACA,SACIC,aADJ,EAEIC,QAFJ,EAGIC,sBAHJ,EAIIC,aAJJ,EAKIC,eALJ,EAMIC,YANJ,QAOO,SAPP;;AAoBA,MAAMC,SAA6C,GAAG,YAAqC;EACvF,MAAMC,KAAK,GAAGV,QAAQ,EAAtB;EAEA,OAAO;IACHW,OAAO,EAAE;MACLC,QAAQ,EAAE,UADL;MAELC,IAAI,EAAE,CAFD;MAGLC,KAAK,EAAE,CAHF;MAILC,MAAM,EAAE,CAJH;MAKLC,YAAY,EAAEN,KAAK,CAACO,KAAN,CAAYC;IALrB,CADN;IAQHC,KAAK,EAAE;MACHC,QAAQ,EAAE,CADP;MAEHC,iBAAiB,EAAEhB,sBAFhB;MAGHiB,iBAAiB,EAAE,QAHhB;MAIHC,SAAS,EAAE,MAJR;MAKHC,MAAM,EAAEd,KAAK,CAACc,MAAN,CAAaC;IALlB,CARJ;IAeHC,aAAa,EAAE;MACXd,QAAQ,EAAE,UADC;MAEXe,KAAK,EAAE,EAFI;MAGXC,MAAM,EAAE,EAHG;MAIXC,cAAc,EAAE,QAJL;MAKXC,UAAU,EAAE,QALD;MAMXhB,KAAK,EAAE;IANI;EAfZ,CAAP;AAwBH,CA3BD;;AA6BA,MAAMi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;EAjBX,EAZJ,CALJ,EAqCKb,IAAI,gBACD,oBAAC,IAAD;IAAM,KAAK,EAAEsE;EAAb,gBACI,oBAAC,UAAD;IACI,QAAQ,EAAEtE,IADd;IAEI,OAAO,EAAEuE;EAFb,EADJ,CADC,GAOD,IA5CR,CADJ;AAgDH,CA/KyB,CAA1B;AAiLA,eAAejF,iBAAf"}
1
+ {"version":3,"names":["React","Platform","TextInput","View","createFontStyle","css","useTheme","IconButton","InputLabel","defaultHeight","iconSize","inputPaddingHorizontal","labelFontSize","labelPaddingTop","labelYOffset","useStyles","theme","outline","position","left","right","bottom","borderRadius","shape","roundness","input","flexGrow","paddingHorizontal","textAlignVertical","textAlign","zIndex","textField","iconContainer","width","height","justifyContent","alignItems","OutlinedTextField","forwardRef","props","ref","animatedError","animatedLabel","disabled","error","focused","forceFocus","icon","keyboardType","label","labelLayout","onBlur","onChangeText","onFocus","onIconPress","onLayoutAnimatedText","onSubmitEditing","placeholder","secureTextEntry","style","value","styles","hasActiveOutline","inputTextColor","palette","tertiary","main","primary","activeColor","warning","accent","placeholderColor","text","hint","outlineColor","border","errorColor","typography","body2","fontSize","unitless","labelScale","labelWidth","labelHeight","labelHalfWidth","labelHalfHeight","labelTranslateX","minInputHeight","inputHeight","topPosition","Math","floor","iconTopPosition","labelTranslateY","placeholderOpacity","interpolate","inputRange","outputRange","measured","labelProps","inputTextFontStyle","selector","typo","caption2","color","outlineStyle","borderWidth","borderColor","top","textInputStyle","marginRight","paddingRight","OS","outlineWidth","containerStyle","paddingTop","minHeight","iconContainerStyle","onIconButtonPress"],"sources":["OutlinedTextField.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, LayoutChangeEvent, Platform, TextInput, View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport IconButton from '../IconButton';\nimport TextFieldProps from './TextFieldProps';\nimport InputLabel from './InputLabel';\nimport {\n defaultHeight,\n iconSize,\n inputPaddingHorizontal,\n labelFontSize,\n labelPaddingTop,\n labelYOffset,\n} from './utils';\n\ninterface OutlinedTextFieldProps extends TextFieldProps {\n animatedError: Animated.Value;\n animatedLabel: Animated.Value;\n focused: boolean;\n forceFocus: () => void;\n labelLayout: { measured: boolean; width: number; height: number };\n onLayoutAnimatedText: (event: LayoutChangeEvent) => void;\n}\n\ntype OutlinedTextFieldStyles = NamedStylesStringUnion<'outline' | 'input' | 'iconContainer'>;\n\nconst useStyles: UseStyles<OutlinedTextFieldStyles> = function (): OutlinedTextFieldStyles {\n const theme = useTheme();\n\n return {\n outline: {\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: 0,\n borderRadius: theme.shape.roundness,\n },\n input: {\n flexGrow: 1,\n paddingHorizontal: inputPaddingHorizontal,\n textAlignVertical: 'center',\n textAlign: 'left',\n zIndex: theme.zIndex.textField,\n },\n iconContainer: {\n position: 'absolute',\n width: 24,\n height: 24,\n justifyContent: 'center',\n alignItems: 'center',\n right: 12,\n },\n };\n};\n\nconst OutlinedTextField = React.forwardRef<TextInput, OutlinedTextFieldProps>(function OutlinedTextField(props, ref) {\n const {\n animatedError,\n animatedLabel,\n disabled,\n error,\n focused,\n forceFocus,\n icon,\n keyboardType,\n label,\n labelLayout,\n onBlur,\n onChangeText,\n onFocus,\n onIconPress,\n onLayoutAnimatedText,\n onSubmitEditing,\n placeholder,\n secureTextEntry,\n style,\n value,\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const hasActiveOutline = focused || error;\n const inputTextColor = disabled ? theme.palette.tertiary.main : theme.palette.primary.main;\n const activeColor = error\n ? theme.palette.warning.main\n : disabled\n ? theme.palette.tertiary.main\n : theme.palette.accent.main;\n const placeholderColor = disabled ? theme.palette.tertiary.main : theme.palette.text.hint;\n const outlineColor = disabled ? theme.palette.border : theme.palette.border;\n const errorColor = disabled ? theme.palette.tertiary.main : theme.palette.warning.main;\n\n const typography = theme.typography.body2;\n const fontSize = typography.fontSize.unitless;\n\n const labelScale = labelFontSize / fontSize;\n const labelWidth = labelLayout.width;\n const labelHeight = labelLayout.height;\n const labelHalfWidth = labelWidth / 2;\n const labelHalfHeight = labelHeight / 2;\n\n const labelTranslateX = -1 * (labelHalfWidth - (labelScale * labelWidth) / 2 - (fontSize - labelFontSize) * labelScale);\n const minInputHeight = defaultHeight - labelPaddingTop;\n const inputHeight = labelHeight < minInputHeight ? minInputHeight : labelHeight;\n const topPosition = Math.floor(((inputHeight > 0 ? inputHeight : 0) - labelHeight) / 2 + labelPaddingTop);\n const iconTopPosition = (defaultHeight - (label ? 0 : labelPaddingTop) - iconSize - (label ? labelYOffset : 0)) / 2;\n const labelTranslateY = -labelHalfHeight - (topPosition + labelYOffset);\n\n const placeholderOpacity = hasActiveOutline\n ? animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasActiveOutline ? 0 : 1, 1],\n })\n : labelLayout.measured ? 1 : 0;\n\n const labelProps = {\n activeColor,\n error,\n errorColor,\n fontSize,\n hasActiveOutline,\n label,\n labelScale,\n labelTranslateX,\n labelTranslateY,\n onLayoutAnimatedText,\n placeholderColor,\n placeholderOpacity,\n topPosition,\n };\n\n const inputTextFontStyle = createFontStyle(theme, {\n selector: (typo) => typo.caption2,\n color: inputTextColor,\n });\n\n const outlineStyle = css([\n styles.outline,\n {\n borderWidth: hasActiveOutline ? 2 : 1,\n borderColor: error ? errorColor : (hasActiveOutline ? activeColor : outlineColor),\n top: label ? 6 : 0,\n },\n ]);\n\n const textInputStyle = css([\n inputTextFontStyle,\n styles.input,\n {\n fontSize,\n color: inputTextColor,\n height: inputHeight,\n },\n icon && {\n marginRight: iconSize + 20,\n paddingRight: 0,\n },\n Platform.OS === 'web' && {\n //@ts-ignore\n outlineWidth: 0,\n },\n ]);\n\n const containerStyle = css([\n {\n paddingTop: label ? labelPaddingTop : 0,\n minHeight: label ? defaultHeight : defaultHeight + labelYOffset,\n },\n ]);\n\n const iconContainerStyle = css([\n styles.iconContainer,\n { top: iconTopPosition },\n ]);\n\n const onIconButtonPress = () => {\n forceFocus();\n onIconPress?.();\n };\n\n return (\n <View style={style}>\n <View\n pointerEvents={'none'}\n style={outlineStyle}\n />\n <View style={containerStyle}>\n {label ? (\n <InputLabel\n animatedLabel={animatedLabel}\n animatedError={animatedError}\n focused={focused}\n labelLayout={labelLayout}\n placeholder={placeholder}\n value={value}\n {...labelProps}\n />\n ) : null}\n <TextInput\n autoCapitalize={'none'}\n autoCorrect={false}\n disableFullscreenUI={true}\n ref={ref}\n onChangeText={onChangeText}\n placeholder={placeholder}\n placeholderTextColor={placeholderColor}\n editable={!disabled}\n selectionColor={activeColor}\n onFocus={onFocus}\n onBlur={onBlur}\n onSubmitEditing={onSubmitEditing}\n keyboardType={keyboardType}\n secureTextEntry={secureTextEntry}\n underlineColorAndroid={'transparent'}\n style={textInputStyle}\n value={value}\n />\n </View>\n {icon ? (\n <View style={iconContainerStyle}>\n <IconButton\n children={icon}\n onPress={onIconButtonPress}\n />\n </View>\n ) : null}\n </View>\n );\n});\n\nexport default OutlinedTextField;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAsCC,QAAtC,EAAgDC,SAAhD,EAA2DC,IAA3D,QAAuE,cAAvE;AAEA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,QAA/B,QAA+C,WAA/C;AACA,OAAOC,UAAP,MAAuB,eAAvB;AAEA,OAAOC,UAAP,MAAuB,cAAvB;AACA,SACIC,aADJ,EAEIC,QAFJ,EAGIC,sBAHJ,EAIIC,aAJJ,EAKIC,eALJ,EAMIC,YANJ,QAOO,SAPP;;AAoBA,MAAMC,SAA6C,GAAG,YAAqC;EACvF,MAAMC,KAAK,GAAGV,QAAQ,EAAtB;EAEA,OAAO;IACHW,OAAO,EAAE;MACLC,QAAQ,EAAE,UADL;MAELC,IAAI,EAAE,CAFD;MAGLC,KAAK,EAAE,CAHF;MAILC,MAAM,EAAE,CAJH;MAKLC,YAAY,EAAEN,KAAK,CAACO,KAAN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I,WAAW,EAAE,KAFjB;IAGI,mBAAmB,EAAE,IAHzB;IAII,GAAG,EAAE3D,GAJT;IAKI,YAAY,EAAEY,YALlB;IAMI,WAAW,EAAEK,WANjB;IAOI,oBAAoB,EAAEc,gBAP1B;IAQI,QAAQ,EAAE,CAAC5B,QARf;IASI,cAAc,EAAEyB,WATpB;IAUI,OAAO,EAAEf,OAVb;IAWI,MAAM,EAAEF,MAXZ;IAYI,eAAe,EAAEK,eAZrB;IAaI,YAAY,EAAER,YAblB;IAcI,eAAe,EAAEU,eAdrB;IAeI,qBAAqB,EAAE,aAf3B;IAgBI,KAAK,EAAEmD,cAhBX;IAiBI,KAAK,EAAEjD;EAjBX,EAZJ,CALJ,EAqCKb,IAAI,gBACD,oBAAC,IAAD;IAAM,KAAK,EAAEsE;EAAb,gBACI,oBAAC,UAAD;IACI,QAAQ,EAAEtE,IADd;IAEI,OAAO,EAAEuE;EAFb,EADJ,CADC,GAOD,IA5CR,CADJ;AAgDH,CA/KyB,CAA1B;AAiLA,eAAejF,iBAAf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fountain-ui/core",
3
- "version": "2.0.0-beta.50",
3
+ "version": "2.0.0-beta.51",
4
4
  "author": "Fountain-UI Team",
5
5
  "description": "React components that implement Tappytoon's Fountain Design.",
6
6
  "license": "MIT",
@@ -67,5 +67,5 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "ba0faed7f492a6b00b7614c06f23f2fab290e01e"
70
+ "gitHead": "78bd9fddae469bd73088b4be5ae1290d43bd6e3d"
71
71
  }
@@ -108,7 +108,6 @@ const InputLabel = (props: LabelProps) => {
108
108
  const labelTextFontStyle = createFontStyle(theme, { selector: (typo) => typo.caption2 });
109
109
 
110
110
  const labelStyle = {
111
- labelTextFontStyle,
112
111
  fontSize,
113
112
  transform: [
114
113
  {
@@ -166,6 +165,7 @@ const InputLabel = (props: LabelProps) => {
166
165
  <Animated.Text
167
166
  key={'labelBackground-text'}
168
167
  style={[
168
+ labelTextFontStyle,
169
169
  styles.placeholder,
170
170
  styles.backgroundText,
171
171
  backgroundStyle,
@@ -193,6 +193,7 @@ const InputLabel = (props: LabelProps) => {
193
193
  onLayout={onLayoutAnimatedText}
194
194
  style={[
195
195
  styles.placeholder,
196
+ labelTextFontStyle,
196
197
  labelStyle,
197
198
  paddingOffset,
198
199
  {
@@ -212,6 +213,7 @@ const InputLabel = (props: LabelProps) => {
212
213
  <Animated.Text
213
214
  style={[
214
215
  styles.placeholder,
216
+ labelTextFontStyle,
215
217
  labelStyle,
216
218
  paddingOffset,
217
219
  {
@@ -133,7 +133,7 @@ const OutlinedTextField = React.forwardRef<TextInput, OutlinedTextFieldProps>(fu
133
133
  };
134
134
 
135
135
  const inputTextFontStyle = createFontStyle(theme, {
136
- selector: (typo) => typo.body1,
136
+ selector: (typo) => typo.caption2,
137
137
  color: inputTextColor,
138
138
  });
139
139