UNPKG

repoweaver

Version:

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

1 lines 14 kB
{"ast":null,"code":"import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nconst _excluded = [\"disabled\", \"onPress\", \"theme\", \"value\", \"status\", \"testID\"];\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 StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport View from \"react-native-web/dist/exports/View\";\nimport { RadioButtonContext } from \"./RadioButtonGroup\";\nimport { handlePress, isChecked } from \"./utils\";\nimport { useInternalTheme } from \"../../core/theming\";\nimport { getAndroidSelectionControlColor } from \"../Checkbox/utils\";\nimport TouchableRipple from \"../TouchableRipple/TouchableRipple\";\nconst BORDER_WIDTH = 2;\nconst RadioButtonAndroid = _ref => {\n let {\n disabled,\n onPress,\n theme: themeOverrides,\n value,\n status,\n testID\n } = _ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded);\n const theme = useInternalTheme(themeOverrides);\n const {\n current: borderAnim\n } = React.useRef(new Animated.Value(BORDER_WIDTH));\n const {\n current: radioAnim\n } = React.useRef(new Animated.Value(1));\n const isFirstRendering = React.useRef(true);\n const {\n scale\n } = theme.animation;\n React.useEffect(() => {\n if (isFirstRendering.current) {\n isFirstRendering.current = false;\n return;\n }\n if (status === 'checked') {\n radioAnim.setValue(1.2);\n Animated.timing(radioAnim, {\n toValue: 1,\n duration: 150 * scale,\n useNativeDriver: true\n }).start();\n } else {\n borderAnim.setValue(10);\n Animated.timing(borderAnim, {\n toValue: BORDER_WIDTH,\n duration: 150 * scale,\n useNativeDriver: false\n }).start();\n }\n }, [status, borderAnim, radioAnim, scale]);\n return React.createElement(RadioButtonContext.Consumer, null, context => {\n const checked = isChecked({\n contextValue: context === null || context === void 0 ? void 0 : context.value,\n status,\n value\n }) === 'checked';\n const {\n rippleColor,\n selectionControlColor\n } = getAndroidSelectionControlColor({\n theme,\n disabled,\n checked,\n customColor: rest.color,\n customUncheckedColor: rest.uncheckedColor\n });\n return React.createElement(TouchableRipple, _extends({}, rest, {\n borderless: true,\n rippleColor: rippleColor,\n onPress: disabled ? undefined : event => {\n handlePress({\n onPress,\n onValueChange: context === null || context === void 0 ? void 0 : context.onValueChange,\n value,\n event\n });\n },\n accessibilityRole: \"radio\",\n accessibilityState: {\n disabled,\n checked\n },\n accessibilityLiveRegion: \"polite\",\n style: styles.container,\n testID: testID,\n theme: theme\n }), React.createElement(Animated.View, {\n style: [styles.radio, {\n borderColor: selectionControlColor,\n borderWidth: borderAnim\n }]\n }, checked ? React.createElement(View, {\n style: [StyleSheet.absoluteFill, styles.radioContainer]\n }, React.createElement(Animated.View, {\n style: [styles.dot, {\n backgroundColor: selectionControlColor,\n transform: [{\n scale: radioAnim\n }]\n }]\n })) : null));\n });\n};\nRadioButtonAndroid.displayName = 'RadioButton.Android';\nconst styles = StyleSheet.create({\n container: {\n borderRadius: 18\n },\n radioContainer: {\n alignItems: 'center',\n justifyContent: 'center'\n },\n radio: {\n height: 20,\n width: 20,\n borderRadius: 10,\n margin: 8\n },\n dot: {\n height: 10,\n width: 10,\n borderRadius: 5\n }\n});\nexport default RadioButtonAndroid;\nexport { RadioButtonAndroid };","map":{"version":3,"names":["React","Animated","StyleSheet","View","RadioButtonContext","handlePress","isChecked","useInternalTheme","getAndroidSelectionControlColor","TouchableRipple","BORDER_WIDTH","RadioButtonAndroid","_ref","disabled","onPress","theme","themeOverrides","value","status","testID","rest","_objectWithoutPropertiesLoose","_excluded","current","borderAnim","useRef","Value","radioAnim","isFirstRendering","scale","animation","useEffect","setValue","timing","toValue","duration","useNativeDriver","start","createElement","Consumer","context","checked","contextValue","rippleColor","selectionControlColor","customColor","color","customUncheckedColor","uncheckedColor","_extends","borderless","undefined","event","onValueChange","accessibilityRole","accessibilityState","accessibilityLiveRegion","style","styles","container","radio","borderColor","borderWidth","absoluteFill","radioContainer","dot","backgroundColor","transform","displayName","create","borderRadius","alignItems","justifyContent","height","width","margin"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-paper/src/components/RadioButton/RadioButtonAndroid.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Animated, StyleSheet, View } from 'react-native';\n\nimport { RadioButtonContext, RadioButtonContextType } from './RadioButtonGroup';\nimport { handlePress, isChecked } from './utils';\nimport { useInternalTheme } from '../../core/theming';\nimport type { $RemoveChildren, ThemeProp } from '../../types';\nimport { getAndroidSelectionControlColor } from '../Checkbox/utils';\nimport TouchableRipple from '../TouchableRipple/TouchableRipple';\n\nexport type Props = $RemoveChildren<typeof TouchableRipple> & {\n /**\n * Value of the radio button\n */\n value: string;\n /**\n * Status of radio button.\n */\n status?: 'checked' | 'unchecked';\n /**\n * Whether radio is disabled.\n */\n disabled?: boolean;\n /**\n * Function to execute on press.\n */\n onPress?: (param?: any) => void;\n /**\n * Custom color for unchecked radio.\n */\n uncheckedColor?: string;\n /**\n * Custom color for radio.\n */\n color?: string;\n /**\n * @optional\n */\n theme?: ThemeProp;\n /**\n * testID to be used on tests.\n */\n testID?: string;\n};\n\nconst BORDER_WIDTH = 2;\n\n/**\n * Radio buttons allow the selection a single option from a set.\n * This component follows platform guidelines for Android, but can be used\n * on any platform.\n *\n * @extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple\n */\nconst RadioButtonAndroid = ({\n disabled,\n onPress,\n theme: themeOverrides,\n value,\n status,\n testID,\n ...rest\n}: Props) => {\n const theme = useInternalTheme(themeOverrides);\n const { current: borderAnim } = React.useRef<Animated.Value>(\n new Animated.Value(BORDER_WIDTH)\n );\n\n const { current: radioAnim } = React.useRef<Animated.Value>(\n new Animated.Value(1)\n );\n\n const isFirstRendering = React.useRef<boolean>(true);\n\n const { scale } = theme.animation;\n\n React.useEffect(() => {\n // Do not run animation on very first rendering\n if (isFirstRendering.current) {\n isFirstRendering.current = false;\n return;\n }\n\n if (status === 'checked') {\n radioAnim.setValue(1.2);\n\n Animated.timing(radioAnim, {\n toValue: 1,\n duration: 150 * scale,\n useNativeDriver: true,\n }).start();\n } else {\n borderAnim.setValue(10);\n\n Animated.timing(borderAnim, {\n toValue: BORDER_WIDTH,\n duration: 150 * scale,\n useNativeDriver: false,\n }).start();\n }\n }, [status, borderAnim, radioAnim, scale]);\n\n return (\n <RadioButtonContext.Consumer>\n {(context?: RadioButtonContextType) => {\n const checked =\n isChecked({\n contextValue: context?.value,\n status,\n value,\n }) === 'checked';\n\n const { rippleColor, selectionControlColor } =\n getAndroidSelectionControlColor({\n theme,\n disabled,\n checked,\n customColor: rest.color,\n customUncheckedColor: rest.uncheckedColor,\n });\n\n return (\n <TouchableRipple\n {...rest}\n borderless\n rippleColor={rippleColor}\n onPress={\n disabled\n ? undefined\n : (event) => {\n handlePress({\n onPress,\n onValueChange: context?.onValueChange,\n value,\n event,\n });\n }\n }\n accessibilityRole=\"radio\"\n accessibilityState={{ disabled, checked }}\n accessibilityLiveRegion=\"polite\"\n style={styles.container}\n testID={testID}\n theme={theme}\n >\n <Animated.View\n style={[\n styles.radio,\n {\n borderColor: selectionControlColor,\n borderWidth: borderAnim,\n },\n ]}\n >\n {checked ? (\n <View style={[StyleSheet.absoluteFill, styles.radioContainer]}>\n <Animated.View\n style={[\n styles.dot,\n {\n backgroundColor: selectionControlColor,\n transform: [{ scale: radioAnim }],\n },\n ]}\n />\n </View>\n ) : null}\n </Animated.View>\n </TouchableRipple>\n );\n }}\n </RadioButtonContext.Consumer>\n );\n};\n\nRadioButtonAndroid.displayName = 'RadioButton.Android';\n\nconst styles = StyleSheet.create({\n container: {\n borderRadius: 18,\n },\n radioContainer: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n radio: {\n height: 20,\n width: 20,\n borderRadius: 10,\n margin: 8,\n },\n dot: {\n height: 10,\n width: 10,\n borderRadius: 5,\n },\n});\n\nexport default RadioButtonAndroid;\n\n// @component-docs ignore-next-line\nexport { RadioButtonAndroid };\n"],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAA,OAAAC,QAAA;AAAA,OAAAC,UAAA;AAAA,OAAAC,IAAA;AAG9B,SAASC,kBAAkB;AAC3B,SAASC,WAAW,EAAEC,SAAS;AAC/B,SAASC,gBAAgB;AAEzB,SAASC,+BAA+B;AACxC,OAAOC,eAAe;AAqCtB,MAAMC,YAAY,GAAG,CAAC;AAStB,MAAMC,kBAAkB,GAAGC,IAAA,IAQd;EAAA,IARe;MAC1BC,QAAQ;MACRC,OAAO;MACPC,KAAK,EAAEC,cAAc;MACrBC,KAAK;MACLC,MAAM;MACNC;IAEK,CAAC,GAAAP,IAAA;IADHQ,IAAA,GAAAC,6BAAA,CAAAT,IAAA,EAAAU,SAAA;EAEH,MAAMP,KAAK,GAAGR,gBAAgB,CAACS,cAAc,CAAC;EAC9C,MAAM;IAAEO,OAAO,EAAEC;EAAW,CAAC,GAAGxB,KAAK,CAACyB,MAAM,CAC1C,IAAIxB,QAAQ,CAACyB,KAAK,CAAChB,YAAY,CACjC,CAAC;EAED,MAAM;IAAEa,OAAO,EAAEI;EAAU,CAAC,GAAG3B,KAAK,CAACyB,MAAM,CACzC,IAAIxB,QAAQ,CAACyB,KAAK,CAAC,CAAC,CACtB,CAAC;EAED,MAAME,gBAAgB,GAAG5B,KAAK,CAACyB,MAAM,CAAU,IAAI,CAAC;EAEpD,MAAM;IAAEI;EAAM,CAAC,GAAGd,KAAK,CAACe,SAAS;EAEjC9B,KAAK,CAAC+B,SAAS,CAAC,MAAM;IAEpB,IAAIH,gBAAgB,CAACL,OAAO,EAAE;MAC5BK,gBAAgB,CAACL,OAAO,GAAG,KAAK;MAChC;IACF;IAEA,IAAIL,MAAM,KAA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V,CAAC;EACDV,GAAG,EAAE;IACHQ,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE,EAAE;IACTJ,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,eAAe3D,kBAAkB;AAGjC,SAASA,kBAAkB","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}