UNPKG

repoweaver

Version:

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

1 lines 6.49 kB
{"ast":null,"code":"import _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"icon\", \"size\", \"style\", \"theme\"],\n _excluded2 = [\"backgroundColor\"];\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 View from \"react-native-web/dist/exports/View\";\nimport { useInternalTheme } from \"../../core/theming\";\nimport { white } from \"../../styles/themes/v2/colors\";\nimport getContrastingColor from \"../../utils/getContrastingColor\";\nimport Icon from \"../Icon\";\nvar defaultSize = 64;\nvar Avatar = function Avatar(_ref) {\n var _rest$color;\n var icon = _ref.icon,\n _ref$size = _ref.size,\n size = _ref$size === void 0 ? defaultSize : _ref$size,\n style = _ref.style,\n themeOverrides = _ref.theme,\n rest = _objectWithoutProperties(_ref, _excluded);\n var _theme$colors;\n var theme = useInternalTheme(themeOverrides);\n var _ref2 = StyleSheet.flatten(style) || {},\n _ref2$backgroundColor = _ref2.backgroundColor,\n backgroundColor = _ref2$backgroundColor === void 0 ? (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.primary : _ref2$backgroundColor,\n restStyle = _objectWithoutProperties(_ref2, _excluded2);\n var textColor = (_rest$color = rest.color) != null ? _rest$color : getContrastingColor(backgroundColor, white, 'rgba(0, 0, 0, .54)');\n return React.createElement(View, _extends({\n style: [{\n width: size,\n height: size,\n borderRadius: size / 2,\n backgroundColor: backgroundColor\n }, styles.container, restStyle]\n }, rest), React.createElement(Icon, {\n source: icon,\n color: textColor,\n size: size * 0.6\n }));\n};\nAvatar.displayName = 'Avatar.Icon';\nvar styles = StyleSheet.create({\n container: {\n justifyContent: 'center',\n alignItems: 'center'\n }\n});\nexport default Avatar;","map":{"version":3,"names":["React","StyleSheet","View","useInternalTheme","white","getContrastingColor","Icon","defaultSize","Avatar","_ref","_rest$color","icon","_ref$size","size","style","themeOverrides","theme","rest","_objectWithoutProperties","_excluded","_theme$colors","_ref2","flatten","_ref2$backgroundColor","backgroundColor","colors","primary","restStyle","_excluded2","textColor","color","createElement","_extends","width","height","borderRadius","styles","container","source","displayName","create","justifyContent","alignItems"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-paper/src/components/Avatar/AvatarIcon.tsx"],"sourcesContent":["import * as React from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { useInternalTheme } from '../../core/theming';\nimport { white } from '../../styles/themes/v2/colors';\nimport type { ThemeProp } from '../../types';\nimport getContrastingColor from '../../utils/getContrastingColor';\nimport Icon, { IconSource } from '../Icon';\n\nconst defaultSize = 64;\n\nexport type Props = React.ComponentPropsWithRef<typeof View> & {\n /**\n * Icon to display for the `Avatar`.\n */\n icon: IconSource;\n /**\n * Size of the avatar.\n */\n size?: number;\n /**\n * Custom color for the icon.\n */\n color?: string;\n style?: StyleProp<ViewStyle>;\n /**\n * @optional\n */\n theme?: ThemeProp;\n};\n\n/**\n * Avatars can be used to represent people in a graphical way.\n *\n * ## Usage\n * ```js\n * import * as React from 'react';\n * import { Avatar } from 'react-native-paper';\n *\n * const MyComponent = () => (\n * <Avatar.Icon size={24} icon=\"folder\" />\n * );\n * ```\n */\nconst Avatar = ({\n icon,\n size = defaultSize,\n style,\n theme: themeOverrides,\n ...rest\n}: Props) => {\n const theme = useInternalTheme(themeOverrides);\n const { backgroundColor = theme.colors?.primary, ...restStyle } =\n StyleSheet.flatten(style) || {};\n const textColor =\n rest.color ??\n getContrastingColor(backgroundColor, white, 'rgba(0, 0, 0, .54)');\n\n return (\n <View\n style={[\n {\n width: size,\n height: size,\n borderRadius: size / 2,\n backgroundColor,\n },\n styles.container,\n restStyle,\n ]}\n {...rest}\n >\n <Icon source={icon} color={textColor} size={size * 0.6} />\n </View>\n );\n};\n\nAvatar.displayName = 'Avatar.Icon';\n\nconst styles = StyleSheet.create({\n container: {\n justifyContent: 'center',\n alignItems: 'center',\n },\n});\n\nexport default Avatar;\n"],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAA,OAAAC,UAAA;AAAA,OAAAC,IAAA;AAG9B,SAASC,gBAAgB;AACzB,SAASC,KAAK;AAEd,OAAOC,mBAAmB;AAC1B,OAAOC,IAAI;AAEX,IAAMC,WAAW,GAAG,EAAE;AAmCtB,IAAMC,MAAM,GAAG,SAATA,MAAMA,CAAAC,IAAA,EAMC;EAAA,IAAAC,WAAA;EAAA,IALXC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAAC,SAAA,GAAAH,IAAA,CACJI,IAAI;IAAJA,IAAI,GAAAD,SAAA,cAAGL,WAAW,GAAAK,SAAA;IAClBE,KAAK,GAAAL,IAAA,CAALK,KAAK;IACEC,cAAc,GAAAN,IAAA,CAArBO,KAAK;IACFC,IAAA,GAAAC,wBAAA,CAAAT,IAAA,EAAAU,SAAA;EACQ,IAAAC,aAAA;EACX,IAAMJ,KAAK,GAAGb,gBAAgB,CAACY,cAAc,CAAC;EAC9C,IAAAM,KAAA,GACEpB,UAAU,CAACqB,OAAO,CAACR,KAAK,CAAC,IAAI,CAAC,CAAC;IAAAS,qBAAA,GAAAF,KAAA,CADzBG,eAAe;IAAfA,eAAe,GAAAD,qBAAA,eAAAH,aAAA,GAAGJ,KAAK,CAACS,MAAM,cAAAL,aAAA,uBAAZA,aAAA,CAAcM,OAAO,GAAAH,qBAAA;IAAKI,SAAA,GAAAT,wBAAA,CAAAG,KAAA,EAAAO,UAAA;EAEpD,IAAMC,SAAS,IAAAnB,WAAA,GACbO,IAAI,CAACa,KAAK,YAAApB,WAAA,GACVL,mBAAmB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