repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 10.5 kB
JSON
{"ast":null,"code":"import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nconst _excluded = [\"statusBarHeight\", \"style\", \"dark\", \"mode\", \"elevated\", \"theme\", \"testID\"],\n _excluded2 = [\"height\", \"elevation\", \"backgroundColor\", \"zIndex\"];\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 Platform from \"react-native-web/dist/exports/Platform\";\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport View from \"react-native-web/dist/exports/View\";\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { Appbar } from \"./Appbar\";\nimport { DEFAULT_APPBAR_HEIGHT, getAppbarBackgroundColor, modeAppbarHeight, getAppbarBorders } from \"./utils\";\nimport { useInternalTheme } from \"../../core/theming\";\nimport shadow from \"../../styles/shadow\";\nconst AppbarHeader = _ref => {\n let {\n statusBarHeight,\n style,\n dark,\n mode = Platform.OS === 'ios' ? 'center-aligned' : 'small',\n elevated = false,\n theme: themeOverrides,\n testID = 'appbar-header'\n } = _ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded);\n const theme = useInternalTheme(themeOverrides);\n const {\n isV3\n } = theme;\n const flattenedStyle = StyleSheet.flatten(style);\n const _ref2 = flattenedStyle || {},\n {\n height = isV3 ? modeAppbarHeight[mode] : DEFAULT_APPBAR_HEIGHT,\n elevation = isV3 ? elevated ? 2 : 0 : 4,\n backgroundColor: customBackground,\n zIndex = isV3 && elevated ? 1 : 0\n } = _ref2,\n restStyle = _objectWithoutPropertiesLoose(_ref2, _excluded2);\n const borderRadius = getAppbarBorders(restStyle);\n const backgroundColor = getAppbarBackgroundColor(theme, elevation, customBackground, elevated);\n const {\n top,\n left,\n right\n } = useSafeAreaInsets();\n return React.createElement(View, {\n testID: `${testID}-root-layer`,\n style: [{\n backgroundColor,\n zIndex,\n elevation,\n paddingTop: statusBarHeight ?? top,\n paddingHorizontal: Math.max(left, right)\n }, borderRadius, shadow(elevation)]\n }, React.createElement(Appbar, _extends({\n testID: testID,\n style: [{\n height,\n backgroundColor\n }, styles.appbar, restStyle],\n dark: dark\n }, isV3 && {\n mode\n }, rest, {\n theme: theme\n })));\n};\nAppbarHeader.displayName = 'Appbar.Header';\nconst styles = StyleSheet.create({\n appbar: {\n elevation: 0\n }\n});\nexport default AppbarHeader;\nexport { AppbarHeader };","map":{"version":3,"names":["React","Platform","StyleSheet","View","useSafeAreaInsets","Appbar","DEFAULT_APPBAR_HEIGHT","getAppbarBackgroundColor","modeAppbarHeight","getAppbarBorders","useInternalTheme","shadow","AppbarHeader","_ref","statusBarHeight","style","dark","mode","OS","elevated","theme","themeOverrides","testID","rest","_objectWithoutPropertiesLoose","_excluded","isV3","flattenedStyle","flatten","_ref2","height","elevation","backgroundColor","customBackground","zIndex","restStyle","_excluded2","borderRadius","top","left","right","createElement","paddingTop","paddingHorizontal","Math","max","_extends","styles","appbar","displayName","create"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-paper/src/components/Appbar/AppbarHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Animated,\n ColorValue,\n Platform,\n StyleProp,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { Appbar } from './Appbar';\nimport {\n DEFAULT_APPBAR_HEIGHT,\n getAppbarBackgroundColor,\n modeAppbarHeight,\n getAppbarBorders,\n} from './utils';\nimport { useInternalTheme } from '../../core/theming';\nimport shadow from '../../styles/shadow';\nimport type { ThemeProp } from '../../types';\n\nexport type Props = Omit<\n React.ComponentProps<typeof Appbar>,\n 'safeAreaInsets'\n> & {\n /**\n * Whether the background color is a dark color. A dark header will render light text and vice-versa.\n */\n dark?: boolean;\n /**\n * Extra padding to add at the top of header to account for translucent status bar.\n * This is automatically handled on iOS >= 11 including iPhone X using `SafeAreaView`.\n * If you are using Expo, we assume translucent status bar and set a height for status bar automatically.\n * Pass `0` or a custom value to disable the default behaviour, and customize the height.\n */\n statusBarHeight?: number;\n /**\n * Content of the header.\n */\n children: React.ReactNode;\n /**\n * @supported Available in v5.x with theme version 3\n *\n * Mode of the Appbar.\n * - `small` - Appbar with default height (64).\n * - `medium` - Appbar with medium height (112).\n * - `large` - Appbar with large height (152).\n * - `center-aligned` - Appbar with default height and center-aligned title.\n */\n mode?: 'small' | 'medium' | 'large' | 'center-aligned';\n /**\n * @supported Available in v5.x with theme version 3\n * Whether Appbar background should have the elevation along with primary color pigment.\n */\n elevated?: boolean;\n /**\n * @optional\n */\n theme?: ThemeProp;\n style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n};\n\n/**\n * A component to use as a header at the top of the screen.\n * It can contain the screen title, controls such as navigation buttons, menu button etc.\n *\n * ## Usage\n * ```js\n * import * as React from 'react';\n * import { Appbar } from 'react-native-paper';\n *\n * const MyComponent = () => {\n * const _goBack = () => console.log('Went back');\n *\n * const _handleSearch = () => console.log('Searching');\n *\n * const _handleMore = () => console.log('Shown more');\n *\n * return (\n * <Appbar.Header>\n * <Appbar.BackAction onPress={_goBack} />\n * <Appbar.Content title=\"Title\" />\n * <Appbar.Action icon=\"magnify\" onPress={_handleSearch} />\n * <Appbar.Action icon=\"dots-vertical\" onPress={_handleMore} />\n * </Appbar.Header>\n * );\n * };\n *\n * export default MyComponent;\n * ```\n */\nconst AppbarHeader = ({\n // Don't use default props since we check it to know whether we should use SafeAreaView\n statusBarHeight,\n style,\n dark,\n mode = Platform.OS === 'ios' ? 'center-aligned' : 'small',\n elevated = false,\n theme: themeOverrides,\n testID = 'appbar-header',\n ...rest\n}: Props) => {\n const theme = useInternalTheme(themeOverrides);\n const { isV3 } = theme;\n\n const flattenedStyle = StyleSheet.flatten(style);\n const {\n height = isV3 ? modeAppbarHeight[mode] : DEFAULT_APPBAR_HEIGHT,\n elevation = isV3 ? (elevated ? 2 : 0) : 4,\n backgroundColor: customBackground,\n zIndex = isV3 && elevated ? 1 : 0,\n ...restStyle\n } = (flattenedStyle || {}) as Exclude<typeof flattenedStyle, number> & {\n height?: number;\n elevation?: number;\n backgroundColor?: ColorValue;\n zIndex?: number;\n };\n\n const borderRadius = getAppbarBorders(restStyle);\n\n const backgroundColor = getAppbarBackgroundColor(\n theme,\n elevation,\n customBackground,\n elevated\n );\n\n const { top, left, right } = useSafeAreaInsets();\n\n return (\n <View\n testID={`${testID}-root-layer`}\n style={[\n {\n backgroundColor,\n zIndex,\n elevation,\n paddingTop: statusBarHeight ?? top,\n paddingHorizontal: Math.max(left, right),\n },\n borderRadius,\n shadow(elevation) as ViewStyle,\n ]}\n >\n <Appbar\n testID={testID}\n style={[{ height, backgroundColor }, styles.appbar, restStyle]}\n dark={dark}\n {...(isV3 && {\n mode,\n })}\n {...rest}\n theme={theme}\n />\n </View>\n );\n};\n\nAppbarHeader.displayName = 'Appbar.Header';\n\nconst styles = StyleSheet.create({\n appbar: {\n elevation: 0,\n },\n});\n\nexport default AppbarHeader;\n\n// @component-docs ignore-next-line\nexport { AppbarHeader };\n"],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAA,OAAAC,QAAA;AAAA,OAAAC,UAAA;AAAA,OAAAC,IAAA;AAW9B,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,MAAM;AACf,SACEC,qBAAqB,EACrBC,wBAAwB,EACxBC,gBAAgB,EAChBC,gBAAgB;AAElB,SAASC,gBAAgB;AACzB,OAAOC,MAAM;AAyEb,MAAMC,YAAY,GAAGC,IAAA,IAUR;EAAA,IAVS;MAEpBC,eAAe;MACfC,KAAK;MACLC,IAAI;MACJC,I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