UNPKG

repoweaver

Version:

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

1 lines 3.72 kB
{"ast":null,"code":"import color from 'color';\nexport const getActiveTintColor = ({\n activeColor,\n defaultColor,\n theme\n}) => {\n if (typeof activeColor === 'string') {\n return activeColor;\n }\n if (theme.isV3) {\n return theme.colors.onSecondaryContainer;\n }\n return defaultColor;\n};\nexport const getInactiveTintColor = ({\n inactiveColor,\n defaultColor,\n theme\n}) => {\n if (typeof inactiveColor === 'string') {\n return inactiveColor;\n }\n if (theme.isV3) {\n return theme.colors.onSurfaceVariant;\n }\n return color(defaultColor).alpha(0.5).rgb().string();\n};\nexport const getLabelColor = ({\n tintColor,\n hasColor,\n focused,\n defaultColor,\n theme\n}) => {\n if (hasColor) {\n return tintColor;\n }\n if (theme.isV3) {\n if (focused) {\n return theme.colors.onSurface;\n }\n return theme.colors.onSurfaceVariant;\n }\n return defaultColor;\n};","map":{"version":3,"names":["color","getActiveTintColor","activeColor","defaultColor","theme","isV3","colors","onSecondaryContainer","getInactiveTintColor","inactiveColor","onSurfaceVariant","alpha","rgb","string","getLabelColor","tintColor","hasColor","focused","onSurface"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-paper/src/components/BottomNavigation/utils.ts"],"sourcesContent":["import color from 'color';\nimport type { InternalTheme } from 'src/types';\n\nimport type { black, white } from '../../styles/themes/v2/colors';\n\ntype BaseProps = {\n defaultColor: typeof black | typeof white;\n theme: InternalTheme;\n};\n\nexport const getActiveTintColor = ({\n activeColor,\n defaultColor,\n theme,\n}: BaseProps & {\n activeColor: string | undefined;\n}) => {\n if (typeof activeColor === 'string') {\n return activeColor;\n }\n\n if (theme.isV3) {\n return theme.colors.onSecondaryContainer;\n }\n\n return defaultColor;\n};\n\nexport const getInactiveTintColor = ({\n inactiveColor,\n defaultColor,\n theme,\n}: BaseProps & {\n inactiveColor: string | undefined;\n}) => {\n if (typeof inactiveColor === 'string') {\n return inactiveColor;\n }\n\n if (theme.isV3) {\n return theme.colors.onSurfaceVariant;\n }\n\n return color(defaultColor).alpha(0.5).rgb().string();\n};\n\nexport const getLabelColor = ({\n tintColor,\n hasColor,\n focused,\n defaultColor,\n theme,\n}: BaseProps & {\n tintColor: string;\n hasColor: boolean;\n focused: boolean;\n}) => {\n if (hasColor) {\n return tintColor;\n }\n\n if (theme.isV3) {\n if (focused) {\n return theme.colors.onSurface;\n }\n return theme.colors.onSurfaceVariant;\n }\n\n return defaultColor;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAUzB,OAAO,MAAMC,kBAAkB,GAAGA,CAAC;EACjCC,WAAW;EACXC,YAAY;EACZC;AAGF,CAAC,KAAK;EACJ,IAAI,OAAOF,WAAW,KAAK,QAAQ,EAAE;IACnC,OAAOA,WAAW;EACpB;EAEA,IAAIE,KAAK,CAACC,IAAI,EAAE;IACd,OAAOD,KAAK,CAACE,MAAM,CAACC,oBAAoB;EAC1C;EAEA,OAAOJ,YAAY;AACrB,CAAC;AAED,OAAO,MAAMK,oBAAoB,GAAGA,CAAC;EACnCC,aAAa;EACbN,YAAY;EACZC;AAGF,CAAC,KAAK;EACJ,IAAI,OAAOK,aAAa,KAAK,QAAQ,EAAE;IACrC,OAAOA,aAAa;EACtB;EAEA,IAAIL,KAAK,CAACC,IAAI,EAAE;IACd,OAAOD,KAAK,CAACE,MAAM,CAACI,gBAAgB;EACtC;EAEA,OAAOV,KAAK,CAACG,YAAY,CAAC,CAACQ,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;AACtD,CAAC;AAED,OAAO,MAAMC,aAAa,GAAGA,CAAC;EAC5BC,SAAS;EACTC,QAAQ;EACRC,OAAO;EACPd,YAAY;EACZC;AAKF,CAAC,KAAK;EACJ,IAAIY,QAAQ,EAAE;IACZ,OAAOD,SAAS;EAClB;EAEA,IAAIX,KAAK,CAACC,IAAI,EAAE;IACd,IAAIY,OAAO,EAAE;MACX,OAAOb,KAAK,CAACE,MAAM,CAACY,SAAS;IAC/B;IACA,OAAOd,KAAK,CAACE,MAAM,CAACI,gBAAgB;EACtC;EAEA,OAAOP,YAAY;AACrB,CAAC","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}