repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 14.3 kB
JSON
{"ast":null,"code":"import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nconst _excluded = [\"icon\", \"iconColor\", \"containerColor\", \"rippleColor\", \"size\", \"accessibilityLabel\", \"disabled\", \"onPress\", \"selected\", \"animated\", \"mode\", \"style\", \"theme\", \"testID\", \"loading\", \"contentStyle\"];\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 StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport { getIconButtonColor } from \"./utils\";\nimport { useInternalTheme } from \"../../core/theming\";\nimport { forwardRef } from \"../../utils/forwardRef\";\nimport ActivityIndicator from \"../ActivityIndicator\";\nimport CrossFadeIcon from \"../CrossFadeIcon\";\nimport Icon from \"../Icon\";\nimport Surface from \"../Surface\";\nimport TouchableRipple from \"../TouchableRipple/TouchableRipple\";\nconst PADDING = 8;\nconst IconButton = forwardRef((_ref, ref) => {\n let {\n icon,\n iconColor: customIconColor,\n containerColor: customContainerColor,\n rippleColor: customRippleColor,\n size = 24,\n accessibilityLabel,\n disabled,\n onPress,\n selected = false,\n animated = false,\n mode,\n style,\n theme: themeOverrides,\n testID = 'icon-button',\n loading = false,\n contentStyle\n } = _ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded);\n const theme = useInternalTheme(themeOverrides);\n const {\n isV3\n } = theme;\n const IconComponent = animated ? CrossFadeIcon : Icon;\n const {\n iconColor,\n rippleColor,\n backgroundColor,\n borderColor\n } = getIconButtonColor({\n theme,\n disabled,\n selected,\n mode,\n customIconColor,\n customContainerColor,\n customRippleColor\n });\n const buttonSize = isV3 ? size + 2 * PADDING : size * 1.5;\n const {\n borderWidth = isV3 && mode === 'outlined' && !selected ? 1 : 0,\n borderRadius = buttonSize / 2\n } = StyleSheet.flatten(style) || {};\n const borderStyles = {\n borderWidth,\n borderRadius,\n borderColor\n };\n return React.createElement(Surface, _extends({\n ref: ref,\n testID: `${testID}-container`,\n style: [{\n backgroundColor,\n width: buttonSize,\n height: buttonSize\n }, styles.container, borderStyles, !isV3 && disabled && styles.disabled, style],\n container: true\n }, isV3 && {\n elevation: 0\n }), React.createElement(TouchableRipple, _extends({\n borderless: true,\n centered: true,\n onPress: onPress,\n rippleColor: rippleColor,\n accessibilityLabel: accessibilityLabel,\n style: [styles.touchable, contentStyle],\n accessibilityTraits: disabled ? ['button', 'disabled'] : 'button',\n accessibilityComponentType: \"button\",\n accessibilityRole: \"button\",\n accessibilityState: {\n disabled\n },\n disabled: disabled,\n hitSlop: TouchableRipple.supported ? {\n top: 10,\n left: 10,\n bottom: 10,\n right: 10\n } : {\n top: 6,\n left: 6,\n bottom: 6,\n right: 6\n },\n testID: testID\n }, rest), loading ? React.createElement(ActivityIndicator, {\n size: size,\n color: iconColor\n }) : React.createElement(IconComponent, {\n color: iconColor,\n source: icon,\n size: size\n })));\n});\nconst styles = StyleSheet.create({\n container: {\n overflow: 'hidden',\n margin: 6,\n elevation: 0\n },\n touchable: {\n flexGrow: 1,\n justifyContent: 'center',\n alignItems: 'center'\n },\n disabled: {\n opacity: 0.32\n }\n});\nexport default IconButton;","map":{"version":3,"names":["React","StyleSheet","getIconButtonColor","useInternalTheme","forwardRef","ActivityIndicator","CrossFadeIcon","Icon","Surface","TouchableRipple","PADDING","IconButton","_ref","ref","icon","iconColor","customIconColor","containerColor","customContainerColor","rippleColor","customRippleColor","size","accessibilityLabel","disabled","onPress","selected","animated","mode","style","theme","themeOverrides","testID","loading","contentStyle","rest","_objectWithoutPropertiesLoose","_excluded","isV3","IconComponent","backgroundColor","borderColor","buttonSize","borderWidth","borderRadius","flatten","borderStyles","createElement","_extends","width","height","styles","container","elevation","borderless","centered","touchable","accessibilityTraits","accessibilityComponentType","accessibilityRole","accessibilityState","hitSlop","supported","top","left","bottom","right","color","source","create","overflow","margin","flexGrow","justifyContent","alignItems","opacity"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-paper/src/components/IconButton/IconButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n GestureResponderEvent,\n StyleProp,\n StyleSheet,\n ViewStyle,\n View,\n Animated,\n ColorValue,\n} from 'react-native';\n\nimport { getIconButtonColor } from './utils';\nimport { useInternalTheme } from '../../core/theming';\nimport type { $RemoveChildren, ThemeProp } from '../../types';\nimport { forwardRef } from '../../utils/forwardRef';\nimport ActivityIndicator from '../ActivityIndicator';\nimport CrossFadeIcon from '../CrossFadeIcon';\nimport Icon, { IconSource } from '../Icon';\nimport Surface from '../Surface';\nimport TouchableRipple from '../TouchableRipple/TouchableRipple';\n\nconst PADDING = 8;\n\ntype IconButtonMode = 'outlined' | 'contained' | 'contained-tonal';\n\nexport type Props = Omit<$RemoveChildren<typeof TouchableRipple>, 'style'> & {\n /**\n * Icon to display.\n */\n icon: IconSource;\n /**\n * @supported Available in v5.x with theme version 3\n * Mode of the icon button. By default there is no specified mode - only pressable icon will be rendered.\n */\n mode?: IconButtonMode;\n /**\n * @renamed Renamed from 'color' to 'iconColor' in v5.x\n * Color of the icon.\n */\n iconColor?: string;\n /**\n * Background color of the icon container.\n */\n containerColor?: string;\n /**\n * Color of the ripple effect.\n */\n rippleColor?: ColorValue;\n /**\n * @supported Available in v5.x with theme version 3\n * Whether icon button is selected. A selected button receives alternative combination of icon and container colors.\n */\n selected?: boolean;\n /**\n * Size of the icon.\n */\n size?: number;\n /**\n * Whether the button is disabled. A disabled button is greyed out and `onPress` is not called on touch.\n */\n disabled?: boolean;\n /**\n * Whether an icon change is animated.\n */\n animated?: boolean;\n /**\n * Accessibility label for the button. This is read by the screen reader when the user taps the button.\n */\n accessibilityLabel?: string;\n /**\n * Style of button's inner content.\n * Use this prop to apply custom height and width or to set a custom padding`.\n */\n contentStyle?: StyleProp<ViewStyle>;\n /**\n * Function to execute on press.\n */\n onPress?: (e: GestureResponderEvent) => void;\n style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n ref?: React.RefObject<View>;\n /**\n * TestID used for testing purposes\n */\n testID?: string;\n /**\n * @optional\n */\n theme?: ThemeProp;\n /**\n * Whether to show a loading indicator.\n */\n loading?: boolean;\n};\n\n/**\n * An icon button is a button which displays only an icon without a label.\n *\n * ## Usage\n * ```js\n * import * as React from 'react';\n * import { IconButton, MD3Colors } from 'react-native-paper';\n *\n * const MyComponent = () => (\n * <IconButton\n * icon=\"camera\"\n * iconColor={MD3Colors.error50}\n * size={20}\n * onPress={() => console.log('Pressed')}\n * />\n * );\n *\n * export default MyComponent;\n * ```\n *\n * @extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple\n */\nconst IconButton = forwardRef<View, Props>(\n (\n {\n icon,\n iconColor: customIconColor,\n containerColor: customContainerColor,\n rippleColor: customRippleColor,\n size = 24,\n accessibilityLabel,\n disabled,\n onPress,\n selected = false,\n animated = false,\n mode,\n style,\n theme: themeOverrides,\n testID = 'icon-button',\n loading = false,\n contentStyle,\n ...rest\n }: Props,\n ref\n ) => {\n const theme = useInternalTheme(themeOverrides);\n const { isV3 } = theme;\n\n const IconComponent = animated ? CrossFadeIcon : Icon;\n\n const { iconColor, rippleColor, backgroundColor, borderColor } =\n getIconButtonColor({\n theme,\n disabled,\n selected,\n mode,\n customIconColor,\n customContainerColor,\n customRippleColor,\n });\n\n const buttonSize = isV3 ? size + 2 * PADDING : size * 1.5;\n\n const {\n borderWidth = isV3 && mode === 'outlined' && !selected ? 1 : 0,\n borderRadius = buttonSize / 2,\n } = (StyleSheet.flatten(style) || {}) as ViewStyle;\n\n const borderStyles = {\n borderWidth,\n borderRadius,\n borderColor,\n };\n\n return (\n <Surface\n ref={ref}\n testID={`${testID}-container`}\n style={[\n {\n backgroundColor,\n width: buttonSize,\n height: buttonSize,\n },\n styles.container,\n borderStyles,\n !isV3 && disabled && styles.disabled,\n style,\n ]}\n container\n {...(isV3 && { elevation: 0 })}\n >\n <TouchableRipple\n borderless\n centered\n onPress={onPress}\n rippleColor={rippleColor}\n accessibilityLabel={accessibilityLabel}\n style={[styles.touchable, contentStyle]}\n // @ts-expect-error We keep old a11y props for backwards compat with old RN versions\n accessibilityTraits={disabled ? ['button', 'disabled'] : 'button'}\n accessibilityComponentType=\"button\"\n accessibilityRole=\"button\"\n accessibilityState={{ disabled }}\n disabled={disabled}\n hitSlop={\n TouchableRipple.supported\n ? { top: 10, left: 10, bottom: 10, right: 10 }\n : { top: 6, left: 6, bottom: 6, right: 6 }\n }\n testID={testID}\n {...rest}\n >\n {loading ? (\n <ActivityIndicator size={size} color={iconColor} />\n ) : (\n <IconComponent color={iconColor} source={icon} size={size} />\n )}\n </TouchableRipple>\n </Surface>\n );\n }\n);\n\nconst styles = StyleSheet.create({\n container: {\n overflow: 'hidden',\n margin: 6,\n elevation: 0,\n },\n touchable: {\n flexGrow: 1,\n justifyContent: 'center',\n alignItems: 'center',\n },\n disabled: {\n opacity: 0.32,\n },\n});\n\nexport default IconButton;\n"],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAA,OAAAC,UAAA;AAW9B,SAASC,kBAAkB;AAC3B,SAASC,gBAAgB;AAEzB,SAASC,UAAU;AACnB,OAAOC,iBAAiB;AACxB,OAAOC,aAAa;AACpB,OAAOC,IAAI;AACX,OAAOC,OAAO;AACd,OAAOC,eAAe;AAEtB,MAAMC,OAAO,GAAG,CAAC;AA+FjB,MAAMC,UAAU,GAAGP,UAAU,CAC3B,CAAAQ,IAAA,EAoBEC,GAAG,KACA;EAAA,IApBH;MACEC,IAAI;MACJC,SAAS,EAAEC,eAAe;MAC1BC,cAAc,EAAEC,oBAAoB;MACpCC,WAAW,EAAEC,iBAAiB;MAC9BC,IAAI,GAAG,E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