UNPKG

repoweaver

Version:

A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies

1 lines 7.36 kB
{"ast":null,"code":"import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nconst _excluded = [\"style\", \"theme\", \"variant\"];\nfunction _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nimport * as React from 'react';\nimport Animated from \"react-native-web/dist/exports/Animated\";\nimport I18nManager from \"react-native-web/dist/exports/I18nManager\";\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport { useInternalTheme } from \"../../core/theming\";\nimport { forwardRef } from \"../../utils/forwardRef\";\nconst AnimatedText = forwardRef(function AnimatedText(_ref, ref) {\n let {\n style,\n theme: themeOverrides,\n variant\n } = _ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded);\n const theme = useInternalTheme(themeOverrides);\n const writingDirection = I18nManager.getConstants().isRTL ? 'rtl' : 'ltr';\n if (theme.isV3 && variant) {\n const font = theme.fonts[variant];\n if (typeof font !== 'object') {\n throw new Error(`Variant ${variant} was not provided properly. Valid variants are ${Object.keys(theme.fonts).join(', ')}.`);\n }\n return React.createElement(Animated.Text, _extends({\n ref: ref\n }, rest, {\n style: [font, styles.text, {\n writingDirection,\n color: theme.colors.onSurface\n }, style]\n }));\n } else {\n const font = !theme.isV3 ? theme.fonts.regular : theme.fonts.bodyMedium;\n const textStyle = Object.assign({}, font, {\n color: theme.isV3 ? theme.colors.onSurface : theme.colors.text\n });\n return React.createElement(Animated.Text, _extends({\n ref: ref\n }, rest, {\n style: [styles.text, textStyle, {\n writingDirection\n }, style]\n }));\n }\n});\nconst styles = StyleSheet.create({\n text: {\n textAlign: 'left'\n }\n});\nexport const customAnimatedText = () => AnimatedText;\nexport default AnimatedText;","map":{"version":3,"names":["React","Animated","I18nManager","StyleSheet","useInternalTheme","forwardRef","AnimatedText","_ref","ref","style","theme","themeOverrides","variant","rest","_objectWithoutPropertiesLoose","_excluded","writingDirection","getConstants","isRTL","isV3","font","fonts","Error","Object","keys","join","createElement","Text","_extends","styles","text","color","colors","onSurface","regular","bodyMedium","textStyle","assign","create","textAlign","customAnimatedText"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-paper/src/components/Typography/AnimatedText.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Animated,\n I18nManager,\n StyleProp,\n StyleSheet,\n TextStyle,\n Text,\n} from 'react-native';\n\nimport type { VariantProp } from './types';\nimport { useInternalTheme } from '../../core/theming';\nimport type { ThemeProp } from '../../types';\nimport { forwardRef } from '../../utils/forwardRef';\n\ntype Props<T> = React.ComponentPropsWithRef<typeof Animated.Text> & {\n /**\n * Variant defines appropriate text styles for type role and its size.\n * Available variants:\n *\n * Display: `displayLarge`, `displayMedium`, `displaySmall`\n *\n * Headline: `headlineLarge`, `headlineMedium`, `headlineSmall`\n *\n * Title: `titleLarge`, `titleMedium`, `titleSmall`\n *\n * Label: `labelLarge`, `labelMedium`, `labelSmall`\n *\n * Body: `bodyLarge`, `bodyMedium`, `bodySmall`\n */\n variant?: VariantProp<T>;\n style?: StyleProp<TextStyle>;\n /**\n * @optional\n */\n theme?: ThemeProp;\n};\n\n/**\n * Animated text component which follows styles from the theme.\n *\n * @extends Text props https://reactnative.dev/docs/text#props\n */\nconst AnimatedText = forwardRef<Text & HTMLElement, Props<never>>(\n function AnimatedText(\n { style, theme: themeOverrides, variant, ...rest },\n ref\n ) {\n const theme = useInternalTheme(themeOverrides);\n const writingDirection = I18nManager.getConstants().isRTL ? 'rtl' : 'ltr';\n\n if (theme.isV3 && variant) {\n const font = theme.fonts[variant];\n if (typeof font !== 'object') {\n throw new Error(\n `Variant ${variant} was not provided properly. Valid variants are ${Object.keys(\n theme.fonts\n ).join(', ')}.`\n );\n }\n\n return (\n <Animated.Text\n ref={ref}\n {...rest}\n style={[\n font,\n styles.text,\n { writingDirection, color: theme.colors.onSurface },\n style,\n ]}\n />\n );\n } else {\n const font = !theme.isV3 ? theme.fonts.regular : theme.fonts.bodyMedium;\n const textStyle = {\n ...font,\n color: theme.isV3 ? theme.colors.onSurface : theme.colors.text,\n };\n return (\n <Animated.Text\n ref={ref}\n {...rest}\n style={[\n styles.text,\n textStyle,\n {\n writingDirection,\n },\n style,\n ]}\n />\n );\n }\n }\n);\n\nconst styles = StyleSheet.create({\n text: {\n textAlign: 'left',\n },\n});\n\nexport const customAnimatedText = <T,>() =>\n AnimatedText as (props: Props<T>) => JSX.Element;\n\nexport default AnimatedText;\n"],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAA,OAAAC,QAAA;AAAA,OAAAC,WAAA;AAAA,OAAAC,UAAA;AAW9B,SAASC,gBAAgB;AAEzB,SAASC,UAAU;AA8BnB,MAAMC,YAAY,GAAGD,UAAU,CAC7B,SAASC,YAAYA,CAAAC,IAAA,EAEnBC,GAAG,EACH;EAAA,IAFA;MAAEC,KAAK;MAAEC,KAAK,EAAEC,cAAc;MAAEC;IAAiB,CAAC,GAAAL,IAAA;IAANM,IAAA,GAAAC,6BAAA,CAAAP,IAAA,EAAAQ,SAAA;EAG5C,MAAML,KAAK,GAAGN,gBAAgB,CAACO,cAAc,CAAC;EAC9C,MAAMK,gBAAgB,GAAGd,WAAW,CAACe,YAAY,CAAC,CAAC,CAACC,KAAK,GAAG,KAAK,GAAG,KAAK;EAEzE,IAAIR,KAAK,CAACS,IAAI,IAAIP,OAAO,EAAE;IACzB,MAAMQ,IAAI,GAAGV,KAAK,CAACW,KAAK,CAACT,OAAO,CAAC;IACjC,IAAI,OAAOQ,IAAI,KAAK,QAAQ,EAAE;MAC5B,MAAM,IAAIE,KAAK,CACb,WAAWV,OAAO,kDAAkDW,MAAM,CAACC,IAAI,CAC7Ed,KAAK,CAACW,KACR,CAAC,CAACI,IAAI,CAAC,IAAI,CAAC,GACd,CAAC;IACH;IAEA,OACEzB,KAAA,CAAA0B,aAAA,CAACzB,QAAQ,CAAC0B,IAAI,EAAAC,QAAA;MACZpB,GAAG,EAAEA;IAAI,GACLK,IAAI;MACRJ,KAAK,EAAE,CACLW,IAAI,EACJS,MAAM,CAACC,IAAI,EACX;QAAEd,gBAAgB;QAAEe,KAAK,EAAErB,KAAK,CAACsB,MAAM,CAACC;MAAU,CAAC,EACnDxB,KAAK;IACL,EACH,CAAC;EAEN,CAAC,MAAM;IACL,MAAMW,IAAI,GAAG,CAACV,KAAK,CAACS,IAAI,GAAGT,KAAK,CAACW,KAAK,CAACa,OAAO,GAAGxB,KAAK,CAACW,KAAK,CAACc,UAAU;IACvE,MAAMC,SAAS,GAAAb,MAAA,CAAAc,MAAA,KACVjB,IAAI;MACPW,KAAK,EAAErB,KAAK,CAACS,IAAI,GAAGT,KAAK,CAACsB,MAAM,CAACC,SAAS,GAAGvB,KAAK,CAACsB,MAAM,CAACF;IAAA,EAC3D;IACD,OACE9B,KAAA,CAAA0B,aAAA,CAACzB,QAAQ,CAAC0B,IAAI,EAAAC,QAAA;MACZpB,GAAG,EAAEA;IAAI,GACLK,IAAI;MACRJ,KAAK,EAAE,CACLoB,MAAM,CAACC,IAAI,EACXM,SAAS,EACT;QACEpB;MACF,CAAC,EACDP,KAAK;IACL,EACH,CAAC;EAEN;AACF,CACF,CAAC;AAED,MAAMoB,MAAM,GAAG1B,UAAU,CAACmC,MAAM,CAAC;EAC/BR,IAAI,EAAE;IACJS,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAEF,OAAO,MAAMC,kBAAkB,GAAGA,CAAA,KAChClC,YAAgD;AAElD,eAAeA,YAAY","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}