How to use the @adeira/js.warning function in @adeira/js

To help you get started, we’ve selected a few @adeira/js 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 kiwicom / orbit-components / src / Slider / index.js View on Github external
render() {
    const {
      minValue = DEFAULT_VALUES.MIN,
      maxValue = DEFAULT_VALUES.MAX,
      histogramData,
      histogramLoading = false,
      histogramLoadingText,
      dataTest,
      step = DEFAULT_VALUES.STEP,
    } = this.props;
    if (histogramData) {
      const properHistogramLength = (maxValue - minValue + step) / step;
      warning(
        histogramData.length === properHistogramLength,
        `Warning: Length of histogramData array is ${
          histogramData.length
        }, but should be ${properHistogramLength}. This will cause broken visuals of the whole Histogram.`,
      );
    }
    const { value, focused } = this.state;
    const sortedValue = this.sortArray(value);
    const hasHistogram = histogramLoading || !!histogramData;
    return (
      
        {this.renderHeading(hasHistogram)}
        {hasHistogram && (
          
            {this.renderSliderTexts(false)}
github kiwicom / orbit-components / src / ButtonLink / index.js View on Github external
ariaExpanded,
    ariaControls,
    spaceAfter,
    dataTest,
    tabIndex,
    title,
    block,
    className,
  } = props;

  const iconLeft = props.iconLeft || icon;
  const sizeIcon = size === ICON_SIZES.SMALL ? ICON_SIZES.SMALL : ICON_SIZES.MEDIUM;

  const onlyIcon = iconLeft && !children;

  warning(
    !(!children && !title),
    "Warning: children or title property is missing on ButtonLink. Use title property to add aria-label to be accessible for screen readers. More information https://orbit.kiwi/components/buttonlink/#accessibility",
  );

  return (
github kiwicom / monorepo-shipit / src / ShipitConfig.js View on Github external
getSourceRoots(): Set {
    const roots = new Set();
    for (const root of this.directoryMapping.keys()) {
      warning(fs.existsSync(root) === true, `Directory mapping uses non-existent root: ${root}`);
      roots.add(root);
    }
    return roots;
  }
github kiwicom / orbit-components / src / NavigationList / NavigationListItem / index.js View on Github external
const NavigationListItem = ({
  icon,
  children,
  ariaLabel,
  selectable = false,
  selected,
  href,
  external,
  onClick,
  asComponent = DefaultComponent,
  dataTest,
  tabIndex,
}: Props) => {
  warning(
    !(!children && !ariaLabel),
    "Warning: children or ariaLabel property is missing on NavigationListItem. Use ariaLabel property to add aria-label to be accessible for screen readers. More information https://orbit.kiwi/components/NavigationListItem/",
  );
  return (
github kiwicom / orbit-components / src / Button / index.js View on Github external
circled,
    submit,
    tabIndex,
    ariaExpanded,
    className,
    ariaControls,
    spaceAfter,
    dataTest,
    title,
  } = props;
  const iconLeft = props.iconLeft || icon;
  const sizeIcon = size === ICON_SIZES.SMALL ? ICON_SIZES.SMALL : ICON_SIZES.MEDIUM;
  const onlyIcon = iconLeft && !children;
  const isDisabled = loading || disabled;

  warning(
    !(!children && !title),
    "Warning: children or title property is missing on Button. Use title property to add aria-label to be accessible for screen readers. More information https://orbit.kiwi/components/button/api/#accessibility",
  );

  return (
github kiwicom / orbit-components / src / CountryFlag / index.js View on Github external
export function getCountryProps(code: ?string, name: ?string): { code: string, name: ?string } {
  const codeNormalized = code ? code.toUpperCase().replace("-", "_") : "ANYWHERE";
  const countryCodeExists = codeNormalized in CODES;

  warning(countryCodeExists, "Country code not supported: %s", code);
  const countryCode = countryCodeExists ? CODES[codeNormalized] : CODES.ANYWHERE;
  const countryName = countryCode === CODES.ANYWHERE && !name ? "Anywhere" : name;
  return { code: countryCode, name: countryName };
}

@adeira/js

Useful JS functions used in Adeira ecosystem

MIT
Latest version published 3 years ago

Package Health Score

46 / 100
Full package analysis

Similar packages