UNPKG

@audira/carbon-react-native

Version:

Build React Native apps with component and shared patterns using Carbon

82 lines (81 loc) 2.99 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GhostIcon = void 0; var _react = require("react"); var _reactNative = require("react-native"); var _carbonReactNativeElements = require("@audira/carbon-react-native-elements"); var _index = require("../../../carbon-style-sheet/index.js"); var _index2 = require("../../../contexts/index.js"); var _index3 = require("../base-color/index.js"); var _jsxRuntime = require("react/jsx-runtime"); const GhostIcon = exports.GhostIcon = /*#__PURE__*/(0, _react.forwardRef)(function GhostIcon(props, ref) { const themeContext = (0, _react.useContext)(_index2.ThemeContext); return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index3.BaseColor, { ...props, ref: ref, android_rippleEffectColor: mapAndroidRippleEffectColor[themeContext.colorScheme], colorStateStyle: { background: { default: backgroundStyleSheet.default, focused: backgroundStyleSheet.focused, hovered: backgroundStyleSheet.hovered, pressed: backgroundStyleSheet.pressed, disabled: backgroundStyleSheet.disabled }, text: { default: style.text, focused: style.text, hovered: style.text, pressed: style.text, disabled: style.text }, icon: mapIconColor[themeContext.colorScheme] } }); }); const backgroundStyleSheet = _index.CarbonStyleSheet.create({ default: { backgroundColor: 'transparent' }, focused: { borderWidth: 1, borderColor: _index.CarbonStyleSheet.color.focus }, hovered: { backgroundColor: _index.CarbonStyleSheet.color.background_hover }, pressed: { backgroundColor: _index.CarbonStyleSheet.color.background_active }, disabled: { backgroundColor: 'transparent' } }), style = _reactNative.StyleSheet.create({ text: { color: 'transparent' } }), mapIconColor = { gray_10: { default: _carbonReactNativeElements.Color.Token.gray_10.icon_primary, focused: _carbonReactNativeElements.Color.Token.gray_10.icon_primary, hovered: _carbonReactNativeElements.Color.Token.gray_10.icon_primary, pressed: _carbonReactNativeElements.Color.Token.gray_10.icon_primary, disabled: _carbonReactNativeElements.Color.Token.gray_10.icon_disabled }, gray_100: { default: _carbonReactNativeElements.Color.Token.gray_100.icon_primary, focused: _carbonReactNativeElements.Color.Token.gray_100.icon_primary, hovered: _carbonReactNativeElements.Color.Token.gray_100.icon_primary, pressed: _carbonReactNativeElements.Color.Token.gray_100.icon_primary, disabled: _carbonReactNativeElements.Color.Token.gray_100.icon_disabled } }, mapAndroidRippleEffectColor = { gray_10: _carbonReactNativeElements.Color.Token.gray_10.background_active, gray_100: _carbonReactNativeElements.Color.Token.gray_100.background_active }; //# sourceMappingURL=GhostIcon.js.map