@tecsinapse/react-core 2.2.0 → 2.2.1

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.
@@ -24,6 +24,7 @@ export interface InputContainerProps {
24
24
  variant?: InputVariantType;
25
25
  hint?: string;
26
26
  hintComponent?: JSX.Element;
27
+ testID?: string;
27
28
  }
28
29
  declare const InputContainer: FC<InputContainerProps & Partial<InputElementProps>>;
29
30
  export default InputContainer;
@@ -1 +1 @@
1
- {"version":3,"file":"InputContainer.js","sources":["../../../../../../src/components/atoms/Input/InputContainer/InputContainer.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleProp, ViewStyle } from 'react-native';\nimport { InputElementProps } from '..';\nimport {\n ColorGradationType,\n ColorType,\n FontColorType,\n FontStackType,\n FontWeightType,\n TypographyVariationType,\n} from '@tecsinapse/react-core';\nimport { Text, TextProps } from '../../Text';\nimport {\n StyledBorderKeeper,\n StyledIconContent,\n StyledInputContainer,\n StyledLabelContainer,\n} from '../styled';\n\nexport type InputVariantType = 'default' | 'error' | 'success';\n\nexport interface InputContainerProps {\n label?: string;\n labelColor?: FontColorType;\n labelColorVariant?: ColorType;\n labelColorTone?: ColorGradationType;\n labelTypography?: TypographyVariationType;\n labelStack?: FontStackType;\n LabelComponent?: FC<TextProps>;\n labelWeight?: FontWeightType;\n leftComponent?: JSX.Element;\n rightComponent?: JSX.Element;\n borderColor?: ColorType;\n borderColorGradation?: ColorGradationType;\n style?: StyleProp<ViewStyle>;\n inputContainerStyle?: StyleProp<ViewStyle>;\n focused?: boolean;\n disabled?: boolean;\n variant?: InputVariantType;\n hint?: string;\n hintComponent?: JSX.Element;\n}\n\nconst InputContainer: FC<InputContainerProps & Partial<InputElementProps>> = ({\n label,\n labelColor = 'medium',\n labelColorTone,\n labelColorVariant,\n labelTypography = 'label',\n labelStack = 'default',\n labelWeight = 'bold',\n LabelComponent = Text,\n leftComponent,\n rightComponent,\n inputContainerStyle,\n disabled,\n focused,\n variant,\n children,\n ...rest\n}): JSX.Element => {\n let _defaultLabelColor = labelColorVariant;\n if (variant === 'error') _defaultLabelColor = 'error';\n if (variant === 'success') _defaultLabelColor = 'success';\n const _labelColorVariant = disabled ? 'secondary' : _defaultLabelColor;\n const _labelColorTone = disabled ? 'light' : labelColorTone;\n\n return (\n <StyledInputContainer\n {...rest}\n style={inputContainerStyle}\n focused={focused}\n disabled={disabled}\n >\n <StyledBorderKeeper\n focused={focused}\n disabled={disabled}\n borderColor={_defaultLabelColor}\n />\n\n {leftComponent && <StyledIconContent>{leftComponent}</StyledIconContent>}\n\n <StyledLabelContainer\n leftComponent={leftComponent}\n rightComponent={rightComponent}\n >\n {label && (\n <LabelComponent\n fontColor={labelColor}\n colorTone={_labelColorTone}\n colorVariant={_labelColorVariant}\n typography={labelTypography}\n fontWeight={labelWeight}\n fontStack={labelStack}\n >\n {label}\n </LabelComponent>\n )}\n {children}\n </StyledLabelContainer>\n\n {rightComponent && (\n <StyledIconContent>{rightComponent}</StyledIconContent>\n )}\n </StyledInputContainer>\n );\n};\n\nexport default InputContainer;\n"],"names":["StyledInputContainer","StyledBorderKeeper","StyledIconContent","StyledLabelContainer"],"mappings":";;;;;;AA2CA,MAAM,iBAAuE,CAAC;AAAA,EAC5E,KAAA;AAAA,EACA,UAAa,GAAA,QAAA;AAAA,EACb,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAkB,GAAA,OAAA;AAAA,EAClB,UAAa,GAAA,SAAA;AAAA,EACb,WAAc,GAAA,MAAA;AAAA,EACd,cAAiB,GAAA,IAAA;AAAA,EACjB,aAAA;AAAA,EACA,cAAA;AAAA,EACA,mBAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG,IAAA;AACL,CAAmB,KAAA;AACjB,EAAA,IAAI,kBAAqB,GAAA,iBAAA,CAAA;AACzB,EAAA,IAAI,OAAY,KAAA,OAAA;AAAS,IAAqB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Input/InputContainer/InputContainer.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleProp, ViewStyle } from 'react-native';\nimport { InputElementProps } from '..';\nimport {\n ColorGradationType,\n ColorType,\n FontColorType,\n FontStackType,\n FontWeightType,\n TypographyVariationType,\n} from '@tecsinapse/react-core';\nimport { Text, TextProps } from '../../Text';\nimport {\n StyledBorderKeeper,\n StyledIconContent,\n StyledInputContainer,\n StyledLabelContainer,\n} from '../styled';\n\nexport type InputVariantType = 'default' | 'error' | 'success';\n\nexport interface InputContainerProps {\n label?: string;\n labelColor?: FontColorType;\n labelColorVariant?: ColorType;\n labelColorTone?: ColorGradationType;\n labelTypography?: TypographyVariationType;\n labelStack?: FontStackType;\n LabelComponent?: FC<TextProps>;\n labelWeight?: FontWeightType;\n leftComponent?: JSX.Element;\n rightComponent?: JSX.Element;\n borderColor?: ColorType;\n borderColorGradation?: ColorGradationType;\n style?: StyleProp<ViewStyle>;\n inputContainerStyle?: StyleProp<ViewStyle>;\n focused?: boolean;\n disabled?: boolean;\n variant?: InputVariantType;\n hint?: string;\n hintComponent?: JSX.Element;\n testID?: string;\n}\n\nconst InputContainer: FC<InputContainerProps & Partial<InputElementProps>> = ({\n label,\n labelColor = 'medium',\n labelColorTone,\n labelColorVariant,\n labelTypography = 'label',\n labelStack = 'default',\n labelWeight = 'bold',\n LabelComponent = Text,\n leftComponent,\n rightComponent,\n inputContainerStyle,\n disabled,\n focused,\n variant,\n children,\n ...rest\n}): JSX.Element => {\n let _defaultLabelColor = labelColorVariant;\n if (variant === 'error') _defaultLabelColor = 'error';\n if (variant === 'success') _defaultLabelColor = 'success';\n const _labelColorVariant = disabled ? 'secondary' : _defaultLabelColor;\n const _labelColorTone = disabled ? 'light' : labelColorTone;\n\n return (\n <StyledInputContainer\n {...rest}\n style={inputContainerStyle}\n focused={focused}\n disabled={disabled}\n >\n <StyledBorderKeeper\n focused={focused}\n disabled={disabled}\n borderColor={_defaultLabelColor}\n />\n\n {leftComponent && <StyledIconContent>{leftComponent}</StyledIconContent>}\n\n <StyledLabelContainer\n leftComponent={leftComponent}\n rightComponent={rightComponent}\n >\n {label && (\n <LabelComponent\n fontColor={labelColor}\n colorTone={_labelColorTone}\n colorVariant={_labelColorVariant}\n typography={labelTypography}\n fontWeight={labelWeight}\n fontStack={labelStack}\n >\n {label}\n </LabelComponent>\n )}\n {children}\n </StyledLabelContainer>\n\n {rightComponent && (\n <StyledIconContent>{rightComponent}</StyledIconContent>\n )}\n </StyledInputContainer>\n );\n};\n\nexport default InputContainer;\n"],"names":["StyledInputContainer","StyledBorderKeeper","StyledIconContent","StyledLabelContainer"],"mappings":";;;;;;AA4CA,MAAM,iBAAuE,CAAC;AAAA,EAC5E,KAAA;AAAA,EACA,UAAa,GAAA,QAAA;AAAA,EACb,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAkB,GAAA,OAAA;AAAA,EAClB,UAAa,GAAA,SAAA;AAAA,EACb,WAAc,GAAA,MAAA;AAAA,EACd,cAAiB,GAAA,IAAA;AAAA,EACjB,aAAA;AAAA,EACA,cAAA;AAAA,EACA,mBAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG,IAAA;AACL,CAAmB,KAAA;AACjB,EAAA,IAAI,kBAAqB,GAAA,iBAAA,CAAA;AACzB,EAAA,IAAI,OAAY,KAAA,OAAA;AAAS,IAAqB,kBAAA,GAAA,OAAA,CAAA;AAC9C,EAAA,IAAI,OAAY,KAAA,SAAA;AAAW,IAAqB,kBAAA,GAAA,SAAA,CAAA;AAChD,EAAM,MAAA,kBAAA,GAAqB,WAAW,WAAc,GAAA,kBAAA,CAAA;AACpD,EAAM,MAAA,eAAA,GAAkB,WAAW,OAAU,GAAA,cAAA,CAAA;AAE7C,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAACA,2BAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,KAAO,EAAA,mBAAA;AAAA,MACP,OAAA;AAAA,MACA,QAAA;AAAA,KAAA;AAAA,oBAEA,KAAA,CAAA,aAAA;AAAA,MAACC,yBAAA;AAAA,MAAA;AAAA,QACC,OAAA;AAAA,QACA,QAAA;AAAA,QACA,WAAa,EAAA,kBAAA;AAAA,OAAA;AAAA,KACf;AAAA,IAEC,aAAA,oBAAkB,KAAA,CAAA,aAAA,CAAAC,wBAAA,EAAA,IAAA,EAAmB,aAAc,CAAA;AAAA,oBAEpD,KAAA,CAAA,aAAA;AAAA,MAACC,2BAAA;AAAA,MAAA;AAAA,QACC,aAAA;AAAA,QACA,cAAA;AAAA,OAAA;AAAA,MAEC,KACC,oBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,cAAA;AAAA,QAAA;AAAA,UACC,SAAW,EAAA,UAAA;AAAA,UACX,SAAW,EAAA,eAAA;AAAA,UACX,YAAc,EAAA,kBAAA;AAAA,UACd,UAAY,EAAA,eAAA;AAAA,UACZ,UAAY,EAAA,WAAA;AAAA,UACZ,SAAW,EAAA,UAAA;AAAA,SAAA;AAAA,QAEV,KAAA;AAAA,OACH;AAAA,MAED,QAAA;AAAA,KACH;AAAA,IAEC,cAAA,oBACE,KAAA,CAAA,aAAA,CAAAD,wBAAA,EAAA,IAAA,EAAmB,cAAe,CAAA;AAAA,GAEvC,CAAA;AAEJ;;;;"}
@@ -14,6 +14,7 @@ export interface TextProps {
14
14
  capitalFirst?: boolean;
15
15
  style?: StyleProp<TextStyle>;
16
16
  children?: React.ReactNode;
17
+ testID?: string;
17
18
  }
18
19
  declare const Text: FC<TextProps>;
19
20
  export default Text;
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sources":["../../../../../src/components/atoms/Text/Text.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport {\n ColorGradationType,\n ColorType,\n FontColorType,\n FontStackType,\n FontWeightType,\n TypographyVariationType,\n} from '@tecsinapse/react-core';\nimport { StyleProp, TextStyle } from 'react-native';\nimport { StyledColoredText } from './styled';\nimport { getLabel } from './functions';\n\nexport interface TextProps {\n /** Font theme text color */\n fontColor?: FontColorType;\n /** Font theme weight */\n fontWeight?: FontWeightType;\n /** Font theme sizes */\n typography?: TypographyVariationType;\n /** Font theme stack */\n fontStack?: FontStackType;\n /** Palette theme colors. You can specify this prop to override theme fontColor */\n colorVariant?: ColorType;\n /** Palette theme colors gradation */\n colorTone?: ColorGradationType;\n numberOfLines?: number;\n ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';\n textTransform?: 'none' | 'uppercase' | 'lowercase' | 'capitalize';\n capitalFirst?: boolean;\n style?: StyleProp<TextStyle>;\n children?: React.ReactNode;\n}\n\n/** NOTE: When using colors, be careful to not override fontColor by using colorVariant and colorTone, referent to theme colors and not text colors. */\nconst Text: FC<TextProps> = ({\n children,\n style,\n fontColor = 'dark',\n colorTone = 'medium',\n colorVariant,\n fontWeight = 'regular',\n typography = 'base',\n numberOfLines,\n ellipsizeMode,\n textTransform = 'none',\n capitalFirst = false,\n ...rest\n}): JSX.Element => {\n return (\n <StyledColoredText\n {...rest}\n style={style}\n fontColor={fontColor}\n colorTone={colorTone}\n colorVariant={colorVariant}\n fontWeight={fontWeight}\n typography={typography}\n numberOfLines={numberOfLines}\n ellipsizeMode={ellipsizeMode}\n textTransform={textTransform}\n >\n {getLabel(children, capitalFirst)}\n </StyledColoredText>\n );\n};\n\nexport default Text;\n"],"names":["StyledColoredText","getLabel"],"mappings":";;;;;;AAmCA,MAAM,OAAsB,CAAC;AAAA,EAC3B,QAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAY,GAAA,MAAA;AAAA,EACZ,SAAY,GAAA,QAAA;AAAA,EACZ,YAAA;AAAA,EACA,UAAa,GAAA,SAAA;AAAA,EACb,UAAa,GAAA,MAAA;AAAA,EACb,aAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAgB,GAAA,MAAA;AAAA,EAChB,YAAe,GAAA,KAAA;AAAA,EACf,GAAG,IAAA;AACL,CAAmB,KAAA;AACjB,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAACA,wBAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,KAAA;AAAA,MACA,SAAA;AAAA,MACA,SAAA;AAAA,MACA,YAAA;AAAA,MACA,UAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,MACA,aAAA;AAAA,MACA,aAAA;AAAA,KAAA;AAAA,IAECC,kBAAA,CAAS,UAAU,YAAY,CAAA;AAAA,GAClC,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"Text.js","sources":["../../../../../src/components/atoms/Text/Text.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport {\n ColorGradationType,\n ColorType,\n FontColorType,\n FontStackType,\n FontWeightType,\n TypographyVariationType,\n} from '@tecsinapse/react-core';\nimport { StyleProp, TextStyle } from 'react-native';\nimport { StyledColoredText } from './styled';\nimport { getLabel } from './functions';\n\nexport interface TextProps {\n /** Font theme text color */\n fontColor?: FontColorType;\n /** Font theme weight */\n fontWeight?: FontWeightType;\n /** Font theme sizes */\n typography?: TypographyVariationType;\n /** Font theme stack */\n fontStack?: FontStackType;\n /** Palette theme colors. You can specify this prop to override theme fontColor */\n colorVariant?: ColorType;\n /** Palette theme colors gradation */\n colorTone?: ColorGradationType;\n numberOfLines?: number;\n ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';\n textTransform?: 'none' | 'uppercase' | 'lowercase' | 'capitalize';\n capitalFirst?: boolean;\n style?: StyleProp<TextStyle>;\n children?: React.ReactNode;\n testID?: string;\n}\n\n/** NOTE: When using colors, be careful to not override fontColor by using colorVariant and colorTone, referent to theme colors and not text colors. */\nconst Text: FC<TextProps> = ({\n children,\n style,\n fontColor = 'dark',\n colorTone = 'medium',\n colorVariant,\n fontWeight = 'regular',\n typography = 'base',\n numberOfLines,\n ellipsizeMode,\n textTransform = 'none',\n capitalFirst = false,\n ...rest\n}): JSX.Element => {\n return (\n <StyledColoredText\n {...rest}\n style={style}\n fontColor={fontColor}\n colorTone={colorTone}\n colorVariant={colorVariant}\n fontWeight={fontWeight}\n typography={typography}\n numberOfLines={numberOfLines}\n ellipsizeMode={ellipsizeMode}\n textTransform={textTransform}\n >\n {getLabel(children, capitalFirst)}\n </StyledColoredText>\n );\n};\n\nexport default Text;\n"],"names":["StyledColoredText","getLabel"],"mappings":";;;;;;AAoCA,MAAM,OAAsB,CAAC;AAAA,EAC3B,QAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAY,GAAA,MAAA;AAAA,EACZ,SAAY,GAAA,QAAA;AAAA,EACZ,YAAA;AAAA,EACA,UAAa,GAAA,SAAA;AAAA,EACb,UAAa,GAAA,MAAA;AAAA,EACb,aAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAgB,GAAA,MAAA;AAAA,EAChB,YAAe,GAAA,KAAA;AAAA,EACf,GAAG,IAAA;AACL,CAAmB,KAAA;AACjB,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAACA,wBAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,KAAA;AAAA,MACA,SAAA;AAAA,MACA,SAAA;AAAA,MACA,YAAA;AAAA,MACA,UAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,MACA,aAAA;AAAA,MACA,aAAA;AAAA,KAAA;AAAA,IAECC,kBAAA,CAAS,UAAU,YAAY,CAAA;AAAA,GAClC,CAAA;AAEJ;;;;"}
@@ -24,6 +24,7 @@ export interface InputContainerProps {
24
24
  variant?: InputVariantType;
25
25
  hint?: string;
26
26
  hintComponent?: JSX.Element;
27
+ testID?: string;
27
28
  }
28
29
  declare const InputContainer: FC<InputContainerProps & Partial<InputElementProps>>;
29
30
  export default InputContainer;
@@ -1 +1 @@
1
- {"version":3,"file":"InputContainer.js","sources":["../../../../../../src/components/atoms/Input/InputContainer/InputContainer.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleProp, ViewStyle } from 'react-native';\nimport { InputElementProps } from '..';\nimport {\n ColorGradationType,\n ColorType,\n FontColorType,\n FontStackType,\n FontWeightType,\n TypographyVariationType,\n} from '@tecsinapse/react-core';\nimport { Text, TextProps } from '../../Text';\nimport {\n StyledBorderKeeper,\n StyledIconContent,\n StyledInputContainer,\n StyledLabelContainer,\n} from '../styled';\n\nexport type InputVariantType = 'default' | 'error' | 'success';\n\nexport interface InputContainerProps {\n label?: string;\n labelColor?: FontColorType;\n labelColorVariant?: ColorType;\n labelColorTone?: ColorGradationType;\n labelTypography?: TypographyVariationType;\n labelStack?: FontStackType;\n LabelComponent?: FC<TextProps>;\n labelWeight?: FontWeightType;\n leftComponent?: JSX.Element;\n rightComponent?: JSX.Element;\n borderColor?: ColorType;\n borderColorGradation?: ColorGradationType;\n style?: StyleProp<ViewStyle>;\n inputContainerStyle?: StyleProp<ViewStyle>;\n focused?: boolean;\n disabled?: boolean;\n variant?: InputVariantType;\n hint?: string;\n hintComponent?: JSX.Element;\n}\n\nconst InputContainer: FC<InputContainerProps & Partial<InputElementProps>> = ({\n label,\n labelColor = 'medium',\n labelColorTone,\n labelColorVariant,\n labelTypography = 'label',\n labelStack = 'default',\n labelWeight = 'bold',\n LabelComponent = Text,\n leftComponent,\n rightComponent,\n inputContainerStyle,\n disabled,\n focused,\n variant,\n children,\n ...rest\n}): JSX.Element => {\n let _defaultLabelColor = labelColorVariant;\n if (variant === 'error') _defaultLabelColor = 'error';\n if (variant === 'success') _defaultLabelColor = 'success';\n const _labelColorVariant = disabled ? 'secondary' : _defaultLabelColor;\n const _labelColorTone = disabled ? 'light' : labelColorTone;\n\n return (\n <StyledInputContainer\n {...rest}\n style={inputContainerStyle}\n focused={focused}\n disabled={disabled}\n >\n <StyledBorderKeeper\n focused={focused}\n disabled={disabled}\n borderColor={_defaultLabelColor}\n />\n\n {leftComponent && <StyledIconContent>{leftComponent}</StyledIconContent>}\n\n <StyledLabelContainer\n leftComponent={leftComponent}\n rightComponent={rightComponent}\n >\n {label && (\n <LabelComponent\n fontColor={labelColor}\n colorTone={_labelColorTone}\n colorVariant={_labelColorVariant}\n typography={labelTypography}\n fontWeight={labelWeight}\n fontStack={labelStack}\n >\n {label}\n </LabelComponent>\n )}\n {children}\n </StyledLabelContainer>\n\n {rightComponent && (\n <StyledIconContent>{rightComponent}</StyledIconContent>\n )}\n </StyledInputContainer>\n );\n};\n\nexport default InputContainer;\n"],"names":["React"],"mappings":";;;;AA2CA,MAAM,iBAAuE,CAAC;AAAA,EAC5E,KAAA;AAAA,EACA,UAAa,GAAA,QAAA;AAAA,EACb,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAkB,GAAA,OAAA;AAAA,EAClB,UAAa,GAAA,SAAA;AAAA,EACb,WAAc,GAAA,MAAA;AAAA,EACd,cAAiB,GAAA,IAAA;AAAA,EACjB,aAAA;AAAA,EACA,cAAA;AAAA,EACA,mBAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG,IAAA;AACL,CAAmB,KAAA;AACjB,EAAA,IAAI,kBAAqB,GAAA,iBAAA,CAAA;AACzB,EAAA,IAAI,OAAY,KAAA,OAAA;AAAS,IAAqB,kBAAA,GAAA,OAAA,CAAA;AAC9C,EAAA,IAAI,OAAY,KAAA,SAAA;AAAW,IAAqB,kBAAA,GAAA,SAAA,CAAA;AAChD,EAAM,MAAA,kBAAA,GAAqB,WAAW,WAAc,GAAA,kBAAA,CAAA;AACpD,EAAM,MAAA,eAAA,GAAkB,WAAW,OAAU,GAAA,cAAA,CAAA;AAE7C,EACE,uBAAAA,cAAA,CAAA,aAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,KAAO,EAAA,mBAAA;AAAA,MACP,OAAA;AAAA,MACA,QAAA;AAAA,KAAA;AAAA,oBAEAA,cAAA,CAAA,aAAA;AAAA,MAAC,kBAAA;AAAA,MAAA;AAAA,QACC,OAAA;AAAA,QACA,QAAA;AAAA,QACA,WAAa,EAAA,kBAAA;AAAA,OAAA;AAAA,KACf;AAAA,IAEC,aAAA,oBAAkBA,cAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,IAAA,EAAmB,aAAc,CAAA;AAAA,oBAEpDA,cAAA,CAAA,aAAA;AAAA,MAAC,oBAAA;AAAA,MAAA;AAAA,QACC,aAAA;AAAA,QACA,cAAA;AAAA,OAAA;AAAA,MAEC,KACC,oBAAAA,cAAA,CAAA,aAAA;AAAA,QAAC,cAAA;AAAA,QAAA;AAAA,UACC,SAAW,EAAA,UAAA;AAAA,UACX,SAAW,EAAA,eAAA;AAAA,UACX,YAAc,EAAA,kBAAA;AAAA,UACd,UAAY,EAAA,eAAA;AAAA,UACZ,UAAY,EAAA,WAAA;AAAA,UACZ,SAAW,EAAA,UAAA;AAAA,SAAA;AAAA,QAEV,KAAA;AAAA,OACH;AAAA,MAED,QAAA;AAAA,KACH;AAAA,IAEC,cAAA,oBACEA,cAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,IAAA,EAAmB,cAAe,CAAA;AAAA,GAEvC,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"InputContainer.js","sources":["../../../../../../src/components/atoms/Input/InputContainer/InputContainer.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleProp, ViewStyle } from 'react-native';\nimport { InputElementProps } from '..';\nimport {\n ColorGradationType,\n ColorType,\n FontColorType,\n FontStackType,\n FontWeightType,\n TypographyVariationType,\n} from '@tecsinapse/react-core';\nimport { Text, TextProps } from '../../Text';\nimport {\n StyledBorderKeeper,\n StyledIconContent,\n StyledInputContainer,\n StyledLabelContainer,\n} from '../styled';\n\nexport type InputVariantType = 'default' | 'error' | 'success';\n\nexport interface InputContainerProps {\n label?: string;\n labelColor?: FontColorType;\n labelColorVariant?: ColorType;\n labelColorTone?: ColorGradationType;\n labelTypography?: TypographyVariationType;\n labelStack?: FontStackType;\n LabelComponent?: FC<TextProps>;\n labelWeight?: FontWeightType;\n leftComponent?: JSX.Element;\n rightComponent?: JSX.Element;\n borderColor?: ColorType;\n borderColorGradation?: ColorGradationType;\n style?: StyleProp<ViewStyle>;\n inputContainerStyle?: StyleProp<ViewStyle>;\n focused?: boolean;\n disabled?: boolean;\n variant?: InputVariantType;\n hint?: string;\n hintComponent?: JSX.Element;\n testID?: string;\n}\n\nconst InputContainer: FC<InputContainerProps & Partial<InputElementProps>> = ({\n label,\n labelColor = 'medium',\n labelColorTone,\n labelColorVariant,\n labelTypography = 'label',\n labelStack = 'default',\n labelWeight = 'bold',\n LabelComponent = Text,\n leftComponent,\n rightComponent,\n inputContainerStyle,\n disabled,\n focused,\n variant,\n children,\n ...rest\n}): JSX.Element => {\n let _defaultLabelColor = labelColorVariant;\n if (variant === 'error') _defaultLabelColor = 'error';\n if (variant === 'success') _defaultLabelColor = 'success';\n const _labelColorVariant = disabled ? 'secondary' : _defaultLabelColor;\n const _labelColorTone = disabled ? 'light' : labelColorTone;\n\n return (\n <StyledInputContainer\n {...rest}\n style={inputContainerStyle}\n focused={focused}\n disabled={disabled}\n >\n <StyledBorderKeeper\n focused={focused}\n disabled={disabled}\n borderColor={_defaultLabelColor}\n />\n\n {leftComponent && <StyledIconContent>{leftComponent}</StyledIconContent>}\n\n <StyledLabelContainer\n leftComponent={leftComponent}\n rightComponent={rightComponent}\n >\n {label && (\n <LabelComponent\n fontColor={labelColor}\n colorTone={_labelColorTone}\n colorVariant={_labelColorVariant}\n typography={labelTypography}\n fontWeight={labelWeight}\n fontStack={labelStack}\n >\n {label}\n </LabelComponent>\n )}\n {children}\n </StyledLabelContainer>\n\n {rightComponent && (\n <StyledIconContent>{rightComponent}</StyledIconContent>\n )}\n </StyledInputContainer>\n );\n};\n\nexport default InputContainer;\n"],"names":["React"],"mappings":";;;;AA4CA,MAAM,iBAAuE,CAAC;AAAA,EAC5E,KAAA;AAAA,EACA,UAAa,GAAA,QAAA;AAAA,EACb,cAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAkB,GAAA,OAAA;AA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YAAc,EAAA,kBAAA;AAAA,UACd,UAAY,EAAA,eAAA;AAAA,UACZ,UAAY,EAAA,WAAA;AAAA,UACZ,SAAW,EAAA,UAAA;AAAA,SAAA;AAAA,QAEV,KAAA;AAAA,OACH;AAAA,MAED,QAAA;AAAA,KACH;AAAA,IAEC,cAAA,oBACEA,cAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,IAAA,EAAmB,cAAe,CAAA;AAAA,GAEvC,CAAA;AAEJ;;;;"}
@@ -14,6 +14,7 @@ export interface TextProps {
14
14
  capitalFirst?: boolean;
15
15
  style?: StyleProp<TextStyle>;
16
16
  children?: React.ReactNode;
17
+ testID?: string;
17
18
  }
18
19
  declare const Text: FC<TextProps>;
19
20
  export default Text;
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sources":["../../../../../src/components/atoms/Text/Text.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport {\n ColorGradationType,\n ColorType,\n FontColorType,\n FontStackType,\n FontWeightType,\n TypographyVariationType,\n} from '@tecsinapse/react-core';\nimport { StyleProp, TextStyle } from 'react-native';\nimport { StyledColoredText } from './styled';\nimport { getLabel } from './functions';\n\nexport interface TextProps {\n /** Font theme text color */\n fontColor?: FontColorType;\n /** Font theme weight */\n fontWeight?: FontWeightType;\n /** Font theme sizes */\n typography?: TypographyVariationType;\n /** Font theme stack */\n fontStack?: FontStackType;\n /** Palette theme colors. You can specify this prop to override theme fontColor */\n colorVariant?: ColorType;\n /** Palette theme colors gradation */\n colorTone?: ColorGradationType;\n numberOfLines?: number;\n ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';\n textTransform?: 'none' | 'uppercase' | 'lowercase' | 'capitalize';\n capitalFirst?: boolean;\n style?: StyleProp<TextStyle>;\n children?: React.ReactNode;\n}\n\n/** NOTE: When using colors, be careful to not override fontColor by using colorVariant and colorTone, referent to theme colors and not text colors. */\nconst Text: FC<TextProps> = ({\n children,\n style,\n fontColor = 'dark',\n colorTone = 'medium',\n colorVariant,\n fontWeight = 'regular',\n typography = 'base',\n numberOfLines,\n ellipsizeMode,\n textTransform = 'none',\n capitalFirst = false,\n ...rest\n}): JSX.Element => {\n return (\n <StyledColoredText\n {...rest}\n style={style}\n fontColor={fontColor}\n colorTone={colorTone}\n colorVariant={colorVariant}\n fontWeight={fontWeight}\n typography={typography}\n numberOfLines={numberOfLines}\n ellipsizeMode={ellipsizeMode}\n textTransform={textTransform}\n >\n {getLabel(children, capitalFirst)}\n </StyledColoredText>\n );\n};\n\nexport default Text;\n"],"names":["React"],"mappings":";;;;AAmCA,MAAM,OAAsB,CAAC;AAAA,EAC3B,QAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAY,GAAA,MAAA;AAAA,EACZ,SAAY,GAAA,QAAA;AAAA,EACZ,YAAA;AAAA,EACA,UAAa,GAAA,SAAA;AAAA,EACb,UAAa,GAAA,MAAA;AAAA,EACb,aAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAgB,GAAA,MAAA;AAAA,EAChB,YAAe,GAAA,KAAA;AAAA,EACf,GAAG,IAAA;AACL,CAAmB,KAAA;AACjB,EACE,uBAAAA,cAAA,CAAA,aAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,KAAA;AAAA,MACA,SAAA;AAAA,MACA,SAAA;AAAA,MACA,YAAA;AAAA,MACA,UAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,MACA,aAAA;AAAA,MACA,aAAA;AAAA,KAAA;AAAA,IAEC,QAAA,CAAS,UAAU,YAAY,CAAA;AAAA,GAClC,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"Text.js","sources":["../../../../../src/components/atoms/Text/Text.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport {\n ColorGradationType,\n ColorType,\n FontColorType,\n FontStackType,\n FontWeightType,\n TypographyVariationType,\n} from '@tecsinapse/react-core';\nimport { StyleProp, TextStyle } from 'react-native';\nimport { StyledColoredText } from './styled';\nimport { getLabel } from './functions';\n\nexport interface TextProps {\n /** Font theme text color */\n fontColor?: FontColorType;\n /** Font theme weight */\n fontWeight?: FontWeightType;\n /** Font theme sizes */\n typography?: TypographyVariationType;\n /** Font theme stack */\n fontStack?: FontStackType;\n /** Palette theme colors. You can specify this prop to override theme fontColor */\n colorVariant?: ColorType;\n /** Palette theme colors gradation */\n colorTone?: ColorGradationType;\n numberOfLines?: number;\n ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';\n textTransform?: 'none' | 'uppercase' | 'lowercase' | 'capitalize';\n capitalFirst?: boolean;\n style?: StyleProp<TextStyle>;\n children?: React.ReactNode;\n testID?: string;\n}\n\n/** NOTE: When using colors, be careful to not override fontColor by using colorVariant and colorTone, referent to theme colors and not text colors. */\nconst Text: FC<TextProps> = ({\n children,\n style,\n fontColor = 'dark',\n colorTone = 'medium',\n colorVariant,\n fontWeight = 'regular',\n typography = 'base',\n numberOfLines,\n ellipsizeMode,\n textTransform = 'none',\n capitalFirst = false,\n ...rest\n}): JSX.Element => {\n return (\n <StyledColoredText\n {...rest}\n style={style}\n fontColor={fontColor}\n colorTone={colorTone}\n colorVariant={colorVariant}\n fontWeight={fontWeight}\n typography={typography}\n numberOfLines={numberOfLines}\n ellipsizeMode={ellipsizeMode}\n textTransform={textTransform}\n >\n {getLabel(children, capitalFirst)}\n </StyledColoredText>\n );\n};\n\nexport default Text;\n"],"names":["React"],"mappings":";;;;AAoCA,MAAM,OAAsB,CAAC;AAAA,EAC3B,QAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAY,GAAA,MAAA;AAAA,EACZ,SAAY,GAAA,QAAA;AAAA,EACZ,YAAA;AAAA,EACA,UAAa,GAAA,SAAA;AAAA,EACb,UAAa,GAAA,MAAA;AAAA,EACb,aAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAgB,GAAA,MAAA;AAAA,EAChB,YAAe,GAAA,KAAA;AAAA,EACf,GAAG,IAAA;AACL,CAAmB,KAAA;AACjB,EACE,uBAAAA,cAAA,CAAA,aAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,KAAA;AAAA,MACA,SAAA;AAAA,MACA,SAAA;AAAA,MACA,YAAA;AAAA,MACA,UAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,MACA,aAAA;AAAA,MACA,aAAA;AAAA,KAAA;AAAA,IAEC,QAAA,CAAS,UAAU,YAAY,CAAA;AAAA,GAClC,CAAA;AAEJ;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tecsinapse/react-core",
3
3
  "description": "TecSinapse hybrid React components",
4
- "version": "2.2.0",
4
+ "version": "2.2.1",
5
5
  "license": "MIT",
6
6
  "main": "dist/esm/index.js",
7
7
  "module": "dist/esm/index.js",
@@ -39,5 +39,5 @@
39
39
  "react-native": "^0.71.0",
40
40
  "react-native-vector-icons": "^9.2.0"
41
41
  },
42
- "gitHead": "1964ad151f85196e3bc7e1975291a2f04d6d65dd"
42
+ "gitHead": "4af0ef115178c49c0df0c8166bf554342c689a01"
43
43
  }