repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 13.5 kB
JSON
{"ast":null,"code":"import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nconst _excluded = [\"icon\", \"label\", \"active\", \"disabled\", \"theme\", \"rippleColor\", \"style\", \"onPress\", \"background\", \"accessibilityLabel\", \"right\", \"labelMaxFontSizeMultiplier\", \"hitSlop\"];\nimport * as React from 'react';\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport View from \"react-native-web/dist/exports/View\";\nimport color from 'color';\nimport { useInternalTheme } from \"../../core/theming\";\nimport Icon from \"../Icon\";\nimport TouchableRipple from \"../TouchableRipple/TouchableRipple\";\nimport Text from \"../Typography/Text\";\nconst DrawerItem = _ref => {\n let {\n icon,\n label,\n active,\n disabled,\n theme: themeOverrides,\n rippleColor: customRippleColor,\n style,\n onPress,\n background,\n accessibilityLabel,\n right,\n labelMaxFontSizeMultiplier,\n hitSlop\n } = _ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded);\n const theme = useInternalTheme(themeOverrides);\n const {\n roundness,\n isV3\n } = theme;\n const backgroundColor = active ? isV3 ? theme.colors.secondaryContainer : color(theme.colors.primary).alpha(0.12).rgb().string() : undefined;\n const contentColor = active ? isV3 ? theme.colors.onSecondaryContainer : theme.colors.primary : isV3 ? theme.colors.onSurfaceVariant : color(theme.colors.text).alpha(0.68).rgb().string();\n const labelMargin = icon ? isV3 ? 12 : 32 : 0;\n const borderRadius = (isV3 ? 7 : 1) * roundness;\n const rippleColor = isV3 ? color(contentColor).alpha(0.12).rgb().string() : undefined;\n const font = isV3 ? theme.fonts.labelLarge : theme.fonts.medium;\n return React.createElement(View, rest, React.createElement(TouchableRipple, {\n borderless: true,\n disabled: disabled,\n background: background,\n onPress: onPress,\n style: [styles.container, {\n backgroundColor,\n borderRadius\n }, isV3 && styles.v3Container, style],\n accessibilityRole: \"button\",\n accessibilityState: {\n selected: active\n },\n accessibilityLabel: accessibilityLabel,\n rippleColor: customRippleColor || rippleColor,\n theme: theme,\n hitSlop: hitSlop\n }, React.createElement(View, {\n style: [styles.wrapper, isV3 && styles.v3Wrapper]\n }, React.createElement(View, {\n style: styles.content\n }, icon ? React.createElement(Icon, {\n source: icon,\n size: 24,\n color: contentColor\n }) : null, React.createElement(Text, {\n variant: \"labelLarge\",\n selectable: false,\n numberOfLines: 1,\n style: [styles.label, Object.assign({\n color: contentColor,\n marginLeft: labelMargin\n }, font)],\n maxFontSizeMultiplier: labelMaxFontSizeMultiplier\n }, label)), right === null || right === void 0 ? void 0 : right({\n color: contentColor\n }))));\n};\nDrawerItem.displayName = 'Drawer.Item';\nconst styles = StyleSheet.create({\n container: {\n marginHorizontal: 10,\n marginVertical: 4\n },\n v3Container: {\n justifyContent: 'center',\n height: 56,\n marginLeft: 12,\n marginRight: 12,\n marginVertical: 0\n },\n wrapper: {\n flexDirection: 'row',\n alignItems: 'center',\n padding: 8\n },\n v3Wrapper: {\n marginLeft: 16,\n marginRight: 24,\n padding: 0\n },\n content: {\n flex: 1,\n flexDirection: 'row',\n alignItems: 'center'\n },\n label: {\n marginRight: 32\n }\n});\nexport default DrawerItem;","map":{"version":3,"names":["React","StyleSheet","View","color","useInternalTheme","Icon","TouchableRipple","Text","DrawerItem","_ref","icon","label","active","disabled","theme","themeOverrides","rippleColor","customRippleColor","style","onPress","background","accessibilityLabel","right","labelMaxFontSizeMultiplier","hitSlop","rest","_objectWithoutPropertiesLoose","_excluded","roundness","isV3","backgroundColor","colors","secondaryContainer","primary","alpha","rgb","string","undefined","contentColor","onSecondaryContainer","onSurfaceVariant","text","labelMargin","borderRadius","font","fonts","labelLarge","medium","createElement","borderless","styles","container","v3Container","accessibilityRole","accessibilityState","selected","wrapper","v3Wrapper","content","source","size","variant","selectable","numberOfLines","Object","assign","marginLeft","maxFontSizeMultiplier","displayName","create","marginHorizontal","marginVertical","justifyContent","height","marginRight","flexDirection","alignItems","padding","flex"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-paper/src/components/Drawer/DrawerItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n ColorValue,\n GestureResponderEvent,\n PressableAndroidRippleConfig,\n StyleProp,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native';\n\nimport color from 'color';\n\nimport { useInternalTheme } from '../../core/theming';\nimport type { ThemeProp } from '../../types';\nimport Icon, { IconSource } from '../Icon';\nimport TouchableRipple, {\n Props as TouchableRippleProps,\n} from '../TouchableRipple/TouchableRipple';\nimport Text from '../Typography/Text';\n\nexport type Props = React.ComponentPropsWithRef<typeof View> & {\n /**\n * The label text of the item.\n */\n label: string;\n /**\n * Icon to display for the `DrawerItem`.\n */\n icon?: IconSource;\n /**\n * Whether to highlight the drawer item as active.\n */\n active?: boolean;\n /**\n * Whether the item is disabled.\n */\n disabled?: boolean;\n /**\n * Function to execute on press.\n */\n onPress?: (e: GestureResponderEvent) => void;\n /**\n * Type of background drawabale to display the feedback (Android).\n * https://reactnative.dev/docs/pressable#rippleconfig\n */\n background?: PressableAndroidRippleConfig;\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 * Callback which returns a React element to display on the right side. For instance a Badge.\n */\n right?: (props: { color: string }) => React.ReactNode;\n /**\n * Specifies the largest possible scale a label font can reach.\n */\n labelMaxFontSizeMultiplier?: number;\n /**\n * Color of the ripple effect.\n */\n rippleColor?: ColorValue;\n /**\n * Sets additional distance outside of element in which a press can be detected.\n */\n hitSlop?: TouchableRippleProps['hitSlop'];\n style?: StyleProp<ViewStyle>;\n /**\n * @optional\n */\n theme?: ThemeProp;\n};\n\n/**\n * A component used to show an action item with an icon and a label in a navigation drawer.\n *\n * ## Usage\n * ```js\n * import * as React from 'react';\n * import { Drawer } from 'react-native-paper';\n *\n * const MyComponent = () => (\n * <Drawer.Item\n * style={{ backgroundColor: '#64ffda' }}\n * icon=\"star\"\n * label=\"First Item\"\n * />\n * );\n *\n * export default MyComponent;\n * ```\n */\nconst DrawerItem = ({\n icon,\n label,\n active,\n disabled,\n theme: themeOverrides,\n rippleColor: customRippleColor,\n style,\n onPress,\n background,\n accessibilityLabel,\n right,\n labelMaxFontSizeMultiplier,\n hitSlop,\n ...rest\n}: Props) => {\n const theme = useInternalTheme(themeOverrides);\n const { roundness, isV3 } = theme;\n\n const backgroundColor = active\n ? isV3\n ? theme.colors.secondaryContainer\n : color(theme.colors.primary).alpha(0.12).rgb().string()\n : undefined;\n const contentColor = active\n ? isV3\n ? theme.colors.onSecondaryContainer\n : theme.colors.primary\n : isV3\n ? theme.colors.onSurfaceVariant\n : color(theme.colors.text).alpha(0.68).rgb().string();\n\n const labelMargin = icon ? (isV3 ? 12 : 32) : 0;\n const borderRadius = (isV3 ? 7 : 1) * roundness;\n const rippleColor = isV3\n ? color(contentColor).alpha(0.12).rgb().string()\n : undefined;\n const font = isV3 ? theme.fonts.labelLarge : theme.fonts.medium;\n\n return (\n <View {...rest}>\n <TouchableRipple\n borderless\n disabled={disabled}\n background={background}\n onPress={onPress}\n style={[\n styles.container,\n { backgroundColor, borderRadius },\n isV3 && styles.v3Container,\n style,\n ]}\n accessibilityRole=\"button\"\n accessibilityState={{ selected: active }}\n accessibilityLabel={accessibilityLabel}\n rippleColor={customRippleColor || rippleColor}\n theme={theme}\n hitSlop={hitSlop}\n >\n <View style={[styles.wrapper, isV3 && styles.v3Wrapper]}>\n <View style={styles.content}>\n {icon ? (\n <Icon source={icon} size={24} color={contentColor} />\n ) : null}\n <Text\n variant=\"labelLarge\"\n selectable={false}\n numberOfLines={1}\n style={[\n styles.label,\n {\n color: contentColor,\n marginLeft: labelMargin,\n ...font,\n },\n ]}\n maxFontSizeMultiplier={labelMaxFontSizeMultiplier}\n >\n {label}\n </Text>\n </View>\n\n {right?.({ color: contentColor })}\n </View>\n </TouchableRipple>\n </View>\n );\n};\n\nDrawerItem.displayName = 'Drawer.Item';\n\nconst styles = StyleSheet.create({\n container: {\n marginHorizontal: 10,\n marginVertical: 4,\n },\n v3Container: {\n justifyContent: 'center',\n height: 56,\n marginLeft: 12,\n marginRight: 12,\n marginVertical: 0,\n },\n wrapper: {\n flexDirection: 'row',\n alignItems: 'center',\n padding: 8,\n },\n v3Wrapper: {\n marginLeft: 16,\n marginRight: 24,\n padding: 0,\n },\n content: {\n flex: 1,\n flexDirection: 'row',\n alignItems: 'center',\n },\n label: {\n marginRight: 32,\n },\n});\n\nexport default DrawerItem;\n"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAA,OAAAC,UAAA;AAAA,OAAAC,IAAA;AAW9B,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,gBAAgB;AAEzB,OAAOC,IAAI;AACX,OAAOC,eAAe;AAGtB,OAAOC,IAAI;AA0EX,MAAMC,UAAU,GAAGC,IAAA,IAeN;EAAA,IAfO;MAClBC,IAAI;MACJC,KAAK;MACLC,MAAM;MACNC,QAAQ;MACRC,KAAK,EAAEC,cAAc;MACrBC,WAAW,EAAEC,iBAAiB;MAC9BC,KAAK;MACLC,OAAO;MACPC,UAAU;MACVC,kBAAkB;MAClBC,KAAK;MACLC,0BAA0B;MAC1BC;IAEK,CAAC,GAAAf,IAAA;IADHgB,IAAA,GAAAC,6BAAA,CAAAjB,IAAA,EAAAkB,SAAA;EAEH,MAAMb,KAAK,GAAGV,gBAAgB,CAACW,cAAc,CAAC;EAC9C,MAAM;IAAEa,SAAS;IAAEC;EAAK,CAAC,GAAGf,KAAK;EAEjC,MAAMgB,eAAe,GAAGlB,MAAM,GAC1BiB,IAAI,GACFf,KAAK,CAACiB,MAAM,CAACC,kBAAkB,GAC/B7B,KAAK,CAACW,KAAK,CAACiB,MAAM,CAACE,OAAO,CAAC,CAACC,KAAK,CAAC,IAAI,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC,GACxDC,SAAS;EACb,MAAMC,YAAY,GAAG1B,MAAM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;IACpBC,UAAU,EAAE,QAAQ;IACpBC,OAAO,EAAE;EACX,CAAC;EACDpB,SAAS,EAAE;IACTS,UAAU,EAAE,EAAE;IACdQ,WAAW,EAAE,EAAE;IACfG,OAAO,EAAE;EACX,CAAC;EACDnB,OAAO,EAAE;IACPoB,IAAI,EAAE,CAAC;IACPH,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd,CAAC;EACDjE,KAAK,EAAE;IACL+D,WAAW,EAAE;EACf;AACF,CAAC,CAAC;AAEF,eAAelE,UAAU","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}