UNPKG

@audira/carbon-react-native

Version:

Build React Native apps with component and shared patterns using Carbon

83 lines (82 loc) 3.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useInformational = useInformational; var _react = require("react"); var _carbonReactNativeElements = require("@audira/carbon-react-native-elements"); var _informationFilled = _interopRequireDefault(require("@carbon/icons/svg/32/information--filled.svg")); var _index = require("../../../../carbon-style-sheet/index.js"); var _index2 = require("../../../../contexts/index.js"); var _index3 = require("../_base/index.js"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } function useInformational({ color, transparentBorderColor }) { const themeContext = (0, _react.useContext)(_index2.ThemeContext), data = (0, _index3.useBase)({ color, transparentBorderColor, style: statusStyle, titleStyle, leftBarStyle, iconColor: mapIconColor[themeContext.colorScheme], iconCloseColor: mapIconCloseColor[themeContext.colorScheme] }); return { ...data, Icon: _informationFilled.default }; } const statusStyle = _index.CarbonStyleSheet.create({ low_contrast: { backgroundColor: _index.CarbonStyleSheet.color.notification_info_background, borderTopColor: _index.CarbonStyleSheet.color.notification_info_border, borderRightColor: _index.CarbonStyleSheet.color.notification_info_border, borderBottomColor: _index.CarbonStyleSheet.color.notification_info_border }, high_contrast: { backgroundColor: _index.CarbonStyleSheet.color.background_inverse, borderTopColor: _index.CarbonStyleSheet.color.background_inverse, borderRightColor: _index.CarbonStyleSheet.color.background_inverse, borderBottomColor: _index.CarbonStyleSheet.color.background_inverse } }), titleStyle = _index.CarbonStyleSheet.create({ low_contrast: { color: _index.CarbonStyleSheet.color.text_primary }, high_contrast: { color: _index.CarbonStyleSheet.color.text_inverse } }), leftBarStyle = _index.CarbonStyleSheet.create({ low_contrast: { backgroundColor: _index.CarbonStyleSheet.color.support_info }, high_contrast: { backgroundColor: _index.CarbonStyleSheet.color.support_info_inverse } }), mapIconColor = { gray_10: { low_contrast: _carbonReactNativeElements.Color.Token.gray_10.support_info, high_contrast: _carbonReactNativeElements.Color.Token.gray_10.support_info_inverse }, gray_100: { low_contrast: _carbonReactNativeElements.Color.Token.gray_100.support_info, high_contrast: _carbonReactNativeElements.Color.Token.gray_100.support_info_inverse } }, mapIconCloseColor = { gray_10: { low_contrast: _carbonReactNativeElements.Color.Token.gray_10.icon_primary, high_contrast: _carbonReactNativeElements.Color.Token.gray_10.icon_inverse }, gray_100: { low_contrast: _carbonReactNativeElements.Color.Token.gray_100.icon_primary, high_contrast: _carbonReactNativeElements.Color.Token.gray_100.icon_inverse } }; //# sourceMappingURL=useInformational.js.map