How to use the bpk-tokens.setOpacity function in bpk-tokens

To help you get started, we’ve selected a few bpk-tokens examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Skyscanner / backpack / native / packages / react-native-bpk-component-navigation-bar / src / BpkNavigationBarButtonAndroid.android.js View on Github external
: tintColor || colorWhite;
  const iconStyle = [styles.icon, { color: tintColorFinal }];
  const accessibilityTraits = ['button'];

  if (disabled) {
    accessibilityTraits.push('disabled');
  }

  return (
    
  );
};
github Skyscanner / backpack / native / packages / react-native-bpk-component-badge / src / BpkBadge.js View on Github external
},
  viewSuccess: {
    backgroundColor: colorGreen500,
  },
  viewDestructive: {
    backgroundColor: colorRed500,
  },
  viewLight: {
    backgroundColor: colorGray50,
  },
  viewInverse: {
    backgroundColor: colorWhite,
  },
  viewOutline: {
    paddingHorizontal: spacingMd - borderSizeSm,
    backgroundColor: setOpacity(colorWhite, 0.2),
  },
  textBase: {
    color: colorGray700,
    includeFontPadding: false,
  },
  textDestructive: {
    color: colorWhite,
  },
  textOutline: {
    color: colorWhite,
  },
  borderBase: {
    borderTopLeftRadius: borderRadiusSm,
    borderBottomLeftRadius: borderRadiusSm,
    borderTopRightRadius: borderRadiusSm,
    borderBottomRightRadius: borderRadiusSm,
github Skyscanner / backpack / native / packages / react-native-bpk-component-carousel-indicator / src / BpkCarouselIndicator.js View on Github external
colorGray900,
  spacingSm,
  spacingMd,
  spacingLg,
} from 'bpk-tokens/tokens/base.react.native';
import TransitionGroup from '@skyscanner/react-native-transitiongroup';
import { StyleSheet, ViewPropTypes, type StyleObj } from 'react-native';

import BpkCarouselIndicatorDot, {
  INDICATOR_SIZES,
} from './BpkCarouselIndicatorDot';

const styles = StyleSheet.create({
  wrapper: {
    alignItems: 'center',
    backgroundColor: setOpacity(colorGray900, 0.3),
    borderRadius: borderRadiusSm,
    flexDirection: 'row',
    height: spacingLg,
    justifyContent: 'center',
    paddingHorizontal: spacingSm + spacingMd,
    paddingVertical: spacingMd,
    width: spacingLg * 3,
  },
});

const getIndicatorSlice = (pageCount, selectedIndex) => {
  if (pageCount <= 5) {
    return {
      begin: 0,
      end: pageCount,
    };
github Skyscanner / backpack / native / packages / react-native-bpk-component-picker / src / BpkPickerMenu.android.js View on Github external
import {
  PICKER_MENU_PROP_TYPE,
  PICKER_MENU_DEFAULT_PROPS,
  type PickerMenuProps,
} from './common-types';

const MAX_ROWS_TO_DISPLAY = 6;

const styles = StyleSheet.create({
  overlay: {
    left: 0,
    height: '100%',
    position: 'absolute',
    top: 0,
    width: '100%',
    backgroundColor: setOpacity(colorGray900, 0.8),
  },
  listWrapper: {
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center',
    padding: spacingBase,
    width: '100%',
    height: '100%',
  },
  list: {
    backgroundColor: colorWhite,
    borderRadius: borderRadiusSm,
    elevation: 5,
  },
});