How to use the @zendeskgarden/react-theming.DEFAULT_THEME.shadows function in @zendeskgarden/react-theming

To help you get started, we’ve selected a few @zendeskgarden/react-theming 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 zendeskgarden / react-components / packages / avatars / src / elements / Avatar.spec.tsx View on Github external
/**
 * Copyright Zendesk, Inc.
 *
 * Use of this source code is governed under the Apache License, Version 2.0
 * found at http://www.apache.org/licenses/LICENSE-2.0.
 */

import React from 'react';
import { render } from 'garden-test-utils';
import { getColor, DEFAULT_THEME } from '@zendeskgarden/react-theming';
import Avatar from './Avatar';

const activeBoxShadow = DEFAULT_THEME.shadows.sm(getColor('crimson', 400)!);

describe('Avatar', () => {
  it('passes ref to underlying DOM element', () => {
    const ref = React.createRef();
    const { container } = render(
      
        <img alt="">
      
    );

    expect(container.firstChild).toBe(ref.current);
  });

  it('renders badge if provided', () =&gt; {
    const { container } = render(
github zendeskgarden / react-components / packages / avatars / src / styled / StyledAvatar.spec.tsx View on Github external
it('renders away', () =&gt; {
      const { container } = render();
      const color = getColor('yellow', 400);

      expect(container.firstChild).toHaveStyleRule('box-shadow', DEFAULT_THEME.shadows.sm(color!));
    });
github zendeskgarden / react-components / packages / avatars / src / styled / StyledAvatar.spec.tsx View on Github external
it('renders active', () =&gt; {
      const { container } = render();
      const color = getColor('crimson', 400);

      expect(container.firstChild).toHaveStyleRule('box-shadow', DEFAULT_THEME.shadows.sm(color!));
    });
  });