UNPKG

repoweaver

Version:

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

1 lines 3.24 kB
{"ast":null,"code":"import color from 'color';\nexport function getTextColor({\n theme,\n disabled\n}) {\n var _theme$colors;\n if (theme.isV3) {\n if (disabled) {\n return theme.colors.onSurfaceDisabled;\n }\n return theme.colors.onSurfaceVariant;\n }\n return color((_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.text).alpha(theme.dark ? 0.7 : 0.54).rgb().string();\n}\nexport function getIconColor({\n theme,\n isTextInputFocused,\n disabled,\n customColor\n}) {\n if (typeof customColor === 'function') {\n return customColor(isTextInputFocused);\n }\n if (customColor) {\n return customColor;\n }\n if (!theme.isV3) {\n return theme.colors.text;\n }\n if (disabled) {\n return theme.colors.onSurfaceDisabled;\n }\n return theme.colors.onSurfaceVariant;\n}","map":{"version":3,"names":["color","getTextColor","theme","disabled","_theme$colors","isV3","colors","onSurfaceDisabled","onSurfaceVariant","text","alpha","dark","rgb","string","getIconColor","isTextInputFocused","customColor"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-paper/src/components/TextInput/Adornment/utils.ts"],"sourcesContent":["import color from 'color';\n\nimport type { InternalTheme } from '../../../types';\n\ntype BaseProps = {\n theme: InternalTheme;\n disabled?: boolean;\n};\n\nexport function getTextColor({ theme, disabled }: BaseProps) {\n if (theme.isV3) {\n if (disabled) {\n return theme.colors.onSurfaceDisabled;\n }\n return theme.colors.onSurfaceVariant;\n }\n return color(theme.colors?.text)\n .alpha(theme.dark ? 0.7 : 0.54)\n .rgb()\n .string();\n}\n\nexport function getIconColor({\n theme,\n isTextInputFocused,\n disabled,\n customColor,\n}: BaseProps & {\n isTextInputFocused: boolean;\n customColor?: ((isTextInputFocused: boolean) => string | undefined) | string;\n}) {\n if (typeof customColor === 'function') {\n return customColor(isTextInputFocused);\n }\n if (customColor) {\n return customColor;\n }\n\n if (!theme.isV3) {\n return theme.colors.text;\n }\n\n if (disabled) {\n return theme.colors.onSurfaceDisabled;\n }\n\n return theme.colors.onSurfaceVariant;\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AASzB,OAAO,SAASC,YAAYA,CAAC;EAAEC,KAAK;EAAEC;AAAoB,CAAC,EAAE;EAAA,IAAAC,aAAA;EAC3D,IAAIF,KAAK,CAACG,IAAI,EAAE;IACd,IAAIF,QAAQ,EAAE;MACZ,OAAOD,KAAK,CAACI,MAAM,CAACC,iBAAiB;IACvC;IACA,OAAOL,KAAK,CAACI,MAAM,CAACE,gBAAgB;EACtC;EACA,OAAOR,KAAK,EAAAI,aAAA,GAACF,KAAK,CAACI,MAAM,cAAAF,aAAA,uBAAZA,aAAA,CAAcK,IAAI,CAAC,CAC7BC,KAAK,CAACR,KAAK,CAACS,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,CAC9BC,GAAG,CAAC,CAAC,CACLC,MAAM,CAAC,CAAC;AACb;AAEA,OAAO,SAASC,YAAYA,CAAC;EAC3BZ,KAAK;EACLa,kBAAkB;EAClBZ,QAAQ;EACRa;AAIF,CAAC,EAAE;EACD,IAAI,OAAOA,WAAW,KAAK,UAAU,EAAE;IACrC,OAAOA,WAAW,CAACD,kBAAkB,CAAC;EACxC;EACA,IAAIC,WAAW,EAAE;IACf,OAAOA,WAAW;EACpB;EAEA,IAAI,CAACd,KAAK,CAACG,IAAI,EAAE;IACf,OAAOH,KAAK,CAACI,MAAM,CAACG,IAAI;EAC1B;EAEA,IAAIN,QAAQ,EAAE;IACZ,OAAOD,KAAK,CAACI,MAAM,CAACC,iBAAiB;EACvC;EAEA,OAAOL,KAAK,CAACI,MAAM,CAACE,gBAAgB;AACtC","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}