UNPKG

repoweaver

Version:

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

1 lines 12.5 kB
{"ast":null,"code":"import color from 'color';\nvar getAndroidCheckedColor = function getAndroidCheckedColor(_ref) {\n var theme = _ref.theme,\n customColor = _ref.customColor;\n if (customColor) {\n return customColor;\n }\n if (theme.isV3) {\n return theme.colors.primary;\n }\n return theme.colors.accent;\n};\nvar getAndroidUncheckedColor = function getAndroidUncheckedColor(_ref2) {\n var theme = _ref2.theme,\n customUncheckedColor = _ref2.customUncheckedColor;\n if (customUncheckedColor) {\n return customUncheckedColor;\n }\n if (theme.isV3) {\n return theme.colors.onSurfaceVariant;\n }\n if (theme.dark) {\n return color(theme.colors.text).alpha(0.7).rgb().string();\n }\n return color(theme.colors.text).alpha(0.54).rgb().string();\n};\nvar getAndroidRippleColor = function getAndroidRippleColor(_ref3) {\n var theme = _ref3.theme,\n checkedColor = _ref3.checkedColor,\n disabled = _ref3.disabled;\n if (disabled) {\n if (theme.isV3) {\n return color(theme.colors.onSurface).alpha(0.16).rgb().string();\n }\n return color(theme.colors.text).alpha(0.16).rgb().string();\n }\n return color(checkedColor).fade(0.32).rgb().string();\n};\nvar getAndroidControlColor = function getAndroidControlColor(_ref4) {\n var theme = _ref4.theme,\n checked = _ref4.checked,\n disabled = _ref4.disabled,\n checkedColor = _ref4.checkedColor,\n uncheckedColor = _ref4.uncheckedColor;\n if (disabled) {\n if (theme.isV3) {\n return theme.colors.onSurfaceDisabled;\n }\n return theme.colors.disabled;\n }\n if (checked) {\n return checkedColor;\n }\n return uncheckedColor;\n};\nexport var getAndroidSelectionControlColor = function getAndroidSelectionControlColor(_ref5) {\n var theme = _ref5.theme,\n disabled = _ref5.disabled,\n checked = _ref5.checked,\n customColor = _ref5.customColor,\n customUncheckedColor = _ref5.customUncheckedColor;\n var checkedColor = getAndroidCheckedColor({\n theme: theme,\n customColor: customColor\n });\n var uncheckedColor = getAndroidUncheckedColor({\n theme: theme,\n customUncheckedColor: customUncheckedColor\n });\n return {\n rippleColor: getAndroidRippleColor({\n theme: theme,\n checkedColor: checkedColor,\n disabled: disabled\n }),\n selectionControlColor: getAndroidControlColor({\n theme: theme,\n disabled: disabled,\n checked: checked,\n checkedColor: checkedColor,\n uncheckedColor: uncheckedColor\n })\n };\n};\nvar getIOSCheckedColor = function getIOSCheckedColor(_ref6) {\n var theme = _ref6.theme,\n disabled = _ref6.disabled,\n customColor = _ref6.customColor;\n if (disabled) {\n if (theme.isV3) {\n return theme.colors.onSurfaceDisabled;\n }\n return theme.colors.disabled;\n }\n if (customColor) {\n return customColor;\n }\n if (theme.isV3) {\n return theme.colors.primary;\n }\n return theme.colors.accent;\n};\nvar getIOSRippleColor = function getIOSRippleColor(_ref7) {\n var theme = _ref7.theme,\n checkedColor = _ref7.checkedColor,\n disabled = _ref7.disabled;\n if (disabled) {\n if (theme.isV3) {\n return color(theme.colors.onSurface).alpha(0.16).rgb().string();\n }\n return color(theme.colors.text).alpha(0.16).rgb().string();\n }\n return color(checkedColor).fade(0.32).rgb().string();\n};\nexport var getSelectionControlIOSColor = function getSelectionControlIOSColor(_ref8) {\n var theme = _ref8.theme,\n disabled = _ref8.disabled,\n customColor = _ref8.customColor;\n var checkedColor = getIOSCheckedColor({\n theme: theme,\n disabled: disabled,\n customColor: customColor\n });\n return {\n checkedColor: checkedColor,\n rippleColor: getIOSRippleColor({\n theme: theme,\n checkedColor: checkedColor,\n disabled: disabled\n })\n };\n};","map":{"version":3,"names":["color","getAndroidCheckedColor","_ref","theme","customColor","isV3","colors","primary","accent","getAndroidUncheckedColor","_ref2","customUncheckedColor","onSurfaceVariant","dark","text","alpha","rgb","string","getAndroidRippleColor","_ref3","checkedColor","disabled","onSurface","fade","getAndroidControlColor","_ref4","checked","uncheckedColor","onSurfaceDisabled","getAndroidSelectionControlColor","_ref5","rippleColor","selectionControlColor","getIOSCheckedColor","_ref6","getIOSRippleColor","_ref7","getSelectionControlIOSColor","_ref8"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-paper/src/components/Checkbox/utils.ts"],"sourcesContent":["import color from 'color';\n\nimport type { InternalTheme } from '../../types';\n\nconst getAndroidCheckedColor = ({\n theme,\n customColor,\n}: {\n theme: InternalTheme;\n customColor?: string;\n}) => {\n if (customColor) {\n return customColor;\n }\n\n if (theme.isV3) {\n return theme.colors.primary;\n }\n\n return theme.colors.accent;\n};\n\nconst getAndroidUncheckedColor = ({\n theme,\n customUncheckedColor,\n}: {\n theme: InternalTheme;\n customUncheckedColor?: string;\n}) => {\n if (customUncheckedColor) {\n return customUncheckedColor;\n }\n\n if (theme.isV3) {\n return theme.colors.onSurfaceVariant;\n }\n\n if (theme.dark) {\n return color(theme.colors.text).alpha(0.7).rgb().string();\n }\n\n return color(theme.colors.text).alpha(0.54).rgb().string();\n};\n\nconst getAndroidRippleColor = ({\n theme,\n checkedColor,\n disabled,\n}: {\n theme: InternalTheme;\n checkedColor: string;\n disabled?: boolean;\n}) => {\n if (disabled) {\n if (theme.isV3) {\n return color(theme.colors.onSurface).alpha(0.16).rgb().string();\n }\n return color(theme.colors.text).alpha(0.16).rgb().string();\n }\n\n return color(checkedColor).fade(0.32).rgb().string();\n};\n\nconst getAndroidControlColor = ({\n theme,\n checked,\n disabled,\n checkedColor,\n uncheckedColor,\n}: {\n theme: InternalTheme;\n checked: boolean;\n checkedColor: string;\n uncheckedColor: string;\n disabled?: boolean;\n}) => {\n if (disabled) {\n if (theme.isV3) {\n return theme.colors.onSurfaceDisabled;\n }\n return theme.colors.disabled;\n }\n\n if (checked) {\n return checkedColor;\n }\n return uncheckedColor;\n};\n\nexport const getAndroidSelectionControlColor = ({\n theme,\n disabled,\n checked,\n customColor,\n customUncheckedColor,\n}: {\n theme: InternalTheme;\n checked: boolean;\n disabled?: boolean;\n customColor?: string;\n customUncheckedColor?: string;\n}) => {\n const checkedColor = getAndroidCheckedColor({ theme, customColor });\n const uncheckedColor = getAndroidUncheckedColor({\n theme,\n customUncheckedColor,\n });\n return {\n rippleColor: getAndroidRippleColor({ theme, checkedColor, disabled }),\n selectionControlColor: getAndroidControlColor({\n theme,\n disabled,\n checked,\n checkedColor,\n uncheckedColor,\n }),\n };\n};\n\nconst getIOSCheckedColor = ({\n theme,\n disabled,\n customColor,\n}: {\n theme: InternalTheme;\n customColor?: string;\n disabled?: boolean;\n}) => {\n if (disabled) {\n if (theme.isV3) {\n return theme.colors.onSurfaceDisabled;\n }\n return theme.colors.disabled;\n }\n\n if (customColor) {\n return customColor;\n }\n\n if (theme.isV3) {\n return theme.colors.primary;\n }\n\n return theme.colors.accent;\n};\n\nconst getIOSRippleColor = ({\n theme,\n checkedColor,\n disabled,\n}: {\n theme: InternalTheme;\n checkedColor: string;\n disabled?: boolean;\n}) => {\n if (disabled) {\n if (theme.isV3) {\n return color(theme.colors.onSurface).alpha(0.16).rgb().string();\n }\n return color(theme.colors.text).alpha(0.16).rgb().string();\n }\n return color(checkedColor).fade(0.32).rgb().string();\n};\n\nexport const getSelectionControlIOSColor = ({\n theme,\n disabled,\n customColor,\n}: {\n theme: InternalTheme;\n disabled?: boolean;\n customColor?: string;\n}) => {\n const checkedColor = getIOSCheckedColor({ theme, disabled, customColor });\n return {\n checkedColor,\n rippleColor: getIOSRippleColor({\n theme,\n checkedColor,\n disabled,\n }),\n };\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAIzB,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAAAC,IAAA,EAMtB;EAAA,IALJC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,WAAA,GAAAF,IAAA,CAAAE,WAAA;EAKA,IAAIA,WAAW,EAAE;IACf,OAAOA,WAAW;EACpB;EAEA,IAAID,KAAK,CAACE,IAAI,EAAE;IACd,OAAOF,KAAK,CAACG,MAAM,CAACC,OAAO;EAC7B;EAEA,OAAOJ,KAAK,CAACG,MAAM,CAACE,MAAM;AAC5B,CAAC;AAED,IAAMC,wBAAwB,GAAG,SA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