UNPKG

repoweaver

Version:

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

1 lines 7.47 kB
{"ast":null,"code":"import * as React from 'react';\nimport Animated from \"react-native-web/dist/exports/Animated\";\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport AnimatedText from \"../../Typography/AnimatedText\";\nconst LabelBackground = ({\n labeled,\n labelLayoutWidth,\n labelLayoutHeight,\n placeholderStyle,\n baseLabelTranslateX,\n topPosition,\n backgroundColor,\n roundness,\n labelStyle,\n maxFontSizeMultiplier,\n testID\n}) => {\n const opacity = labeled.interpolate({\n inputRange: [0, 0.6],\n outputRange: [1, 0]\n });\n const labelTranslationX = {\n translateX: labeled.interpolate({\n inputRange: [0, 1],\n outputRange: [-baseLabelTranslateX, 0]\n })\n };\n const labelTextScaleY = {\n scaleY: labeled.interpolate({\n inputRange: [0, 1],\n outputRange: [0.2, 1]\n })\n };\n const labelTextTransform = [...labelStyle.transform, labelTextScaleY];\n const isRounded = roundness > 6;\n const roundedEdgeCover = isRounded ? React.createElement(Animated.View, {\n key: \"labelBackground-view\",\n pointerEvents: \"none\",\n style: [StyleSheet.absoluteFill, styles.view, {\n backgroundColor,\n maxHeight: Math.max(roundness / 3, 2),\n bottom: Math.max(roundness, 2),\n transform: [labelTranslationX],\n opacity\n }]\n }) : null;\n return [roundedEdgeCover, React.createElement(AnimatedText, {\n key: \"labelBackground-text\",\n testID: `${testID}-label-background`,\n style: [placeholderStyle, labelStyle, styles.outlinedLabel, {\n top: topPosition + 1,\n width: labelLayoutWidth - placeholderStyle.paddingHorizontal,\n height: labelLayoutHeight,\n backgroundColor,\n opacity,\n transform: labelTextTransform\n }],\n numberOfLines: 1,\n maxFontSizeMultiplier: maxFontSizeMultiplier\n })];\n};\nexport default LabelBackground;\nconst styles = StyleSheet.create({\n view: {\n position: 'absolute',\n top: 6,\n left: 10,\n width: 12\n },\n outlinedLabel: {\n position: 'absolute',\n left: 8,\n paddingHorizontal: 0,\n color: 'transparent'\n }\n});","map":{"version":3,"names":["React","Animated","StyleSheet","AnimatedText","LabelBackground","labeled","labelLayoutWidth","labelLayoutHeight","placeholderStyle","baseLabelTranslateX","topPosition","backgroundColor","roundness","labelStyle","maxFontSizeMultiplier","testID","opacity","interpolate","inputRange","outputRange","labelTranslationX","translateX","labelTextScaleY","scaleY","labelTextTransform","transform","isRounded","roundedEdgeCover","createElement","View","key","pointerEvents","style","absoluteFill","styles","view","maxHeight","Math","max","bottom","outlinedLabel","top","width","paddingHorizontal","height","numberOfLines","create","position","left","color"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-paper/src/components/TextInput/Label/LabelBackground.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Animated, StyleSheet } from 'react-native';\n\nimport AnimatedText from '../../Typography/AnimatedText';\nimport type { LabelBackgroundProps } from '../types';\n\nconst LabelBackground = ({\n labeled,\n labelLayoutWidth,\n labelLayoutHeight,\n placeholderStyle,\n baseLabelTranslateX,\n topPosition,\n backgroundColor,\n roundness,\n labelStyle,\n maxFontSizeMultiplier,\n testID,\n}: LabelBackgroundProps) => {\n const opacity = labeled.interpolate({\n inputRange: [0, 0.6],\n outputRange: [1, 0],\n });\n\n const labelTranslationX = {\n translateX: labeled.interpolate({\n inputRange: [0, 1],\n outputRange: [-baseLabelTranslateX, 0],\n }),\n };\n\n const labelTextScaleY = {\n scaleY: labeled.interpolate({\n inputRange: [0, 1],\n outputRange: [0.2, 1],\n }),\n };\n\n const labelTextTransform = [...labelStyle.transform, labelTextScaleY];\n\n const isRounded = roundness > 6;\n const roundedEdgeCover = isRounded ? (\n <Animated.View\n key=\"labelBackground-view\"\n pointerEvents=\"none\"\n style={[\n StyleSheet.absoluteFill,\n styles.view,\n {\n backgroundColor,\n maxHeight: Math.max(roundness / 3, 2),\n bottom: Math.max(roundness, 2),\n transform: [labelTranslationX],\n opacity,\n },\n ]}\n />\n ) : null;\n\n return [\n roundedEdgeCover,\n <AnimatedText\n key=\"labelBackground-text\"\n testID={`${testID}-label-background`}\n style={[\n placeholderStyle,\n labelStyle,\n styles.outlinedLabel,\n {\n top: topPosition + 1,\n width: labelLayoutWidth - placeholderStyle.paddingHorizontal,\n height: labelLayoutHeight,\n backgroundColor,\n opacity,\n transform: labelTextTransform,\n },\n ]}\n numberOfLines={1}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n />,\n ];\n};\n\nexport default LabelBackground;\n\nconst styles = StyleSheet.create({\n view: {\n position: 'absolute',\n top: 6,\n left: 10,\n width: 12,\n },\n // eslint-disable-next-line react-native/no-color-literals\n outlinedLabel: {\n position: 'absolute',\n left: 8,\n paddingHorizontal: 0,\n color: 'transparent',\n },\n});\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAA,OAAAC,QAAA;AAAA,OAAAC,UAAA;AAG9B,OAAOC,YAAY;AAGnB,MAAMC,eAAe,GAAGA,CAAC;EACvBC,OAAO;EACPC,gBAAgB;EAChBC,iBAAiB;EACjBC,gBAAgB;EAChBC,mBAAmB;EACnBC,WAAW;EACXC,eAAe;EACfC,SAAS;EACTC,UAAU;EACVC,qBAAqB;EACrBC;AACoB,CAAC,KAAK;EAC1B,MAAMC,OAAO,GAAGX,OAAO,CAACY,WAAW,CAAC;IAClCC,UAAU,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC;IACpBC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC;EACpB,CAAC,CAAC;EAEF,MAAMC,iBAAiB,GAAG;IACxBC,UAAU,EAAEhB,OAAO,CAACY,WAAW,CAAC;MAC9BC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;MAClBC,WAAW,EAAE,CAAC,CAACV,mBAAmB,EAAE,CAAC;IACvC,CAAC;EACH,CAAC;EAED,MAAMa,eAAe,GAAG;IACtBC,MAAM,EAAElB,OAAO,CAACY,WAAW,CAAC;MAC1BC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;MAClBC,WAA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BX,IAAI,EAAE;IACJY,QAAQ,EAAE,UAAU;IACpBN,GAAG,EAAE,CAAC;IACNO,IAAI,EAAE,EAAE;IACRN,KAAK,EAAE;EACT,CAAC;EAEDF,aAAa,EAAE;IACbO,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPL,iBAAiB,EAAE,CAAC;IACpBM,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}