How to use the @workday/canvas-kit-react-button.IconButton.Variant function in @workday/canvas-kit-react-button

To help you get started, we’ve selected a few @workday/canvas-kit-react-button 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 Workday / canvas-kit / modules / side-panel / react / stories / stories.tsx View on Github external
)}
        openWidth={number(openWidthLabel, openWidthDefaultValue)}
        openDirection={select(label, options, defaultValue)}
        open={open}
        onToggleClick={this.onClick}
        breakpoint={number(breakpointLabel, breakpointDefaultValue)}
        onBreakpointChange={this.handleBreakpoint}
        header={'Side Panel Header'}
      >
        {open ? (
          <button>Add New</button>
        ) : (
          
            
          
        )}
        {/* TODO replace this with our list component */}
        
          
            <span>
              
            </span>
            {open &amp;&amp; Home}
          
          
            <span>
              </span>
github Workday / canvas-kit / modules / popup / react / lib / Popup.tsx View on Github external
return (
      
        {handleClose &amp;&amp; (
          
            
          
        )}
        
          {this.props.children}
github Workday / canvas-kit / modules / _labs / header / react / lib / Header.tsx View on Github external
return React.cloneElement(child as React.ReactElement, {
          children: this.renderChildren(propsChildren),
        });
      }

      // Convert old method of SystemIcon into IconButton
      if (child.type === SystemIcon) {
        const icon = (child.props as SystemIconProps).icon;

        return ;
      }

      // Plain icon buttons have negative margin that we need to negate.
      if (
        child.type === IconButton &amp;&amp;
        (child.props as IconButtonProps).variant === IconButton.Variant.Plain
      ) {
        return React.cloneElement(child as React.ReactElement, {
          style: {margin: `0 0 0 ${childrenSpacing}`},
        });
      }

      return child;
    });
  }
github Workday / canvas-kit / modules / _labs / header / react / spec / GlobalHeader.snapshot.tsx View on Github external
test('renders a header with SystemIcon and IconButton children', () =&gt; {
    const tree = renderer
      .create(
        
          
          
          
        
      )
      .toJSON();
    expect(tree).toMatchSnapshot();
  });
github Workday / canvas-kit / modules / _labs / header / react / spec / Header.spec.tsx View on Github external
test('Converts SystemIcons into IconButtons matching theme', () =&gt; {
      const theme = Header.Theme.Blue;

      const wrapper = mount<header>(
        <header>
          <a href="#">
            
          </a>
        </header>
      );
      const renderedIcon = wrapper.find(IconButton).first();

      expect(wrapper.find(IconButton)).toHaveLength(1);
      expect(renderedIcon.props().icon).toBe(activityStreamIcon);
      expect(renderedIcon.props().variant).toBe(IconButton.Variant.Inverse);
      expect(renderedIcon.props().onClick).toBeTruthy();
    });
</header>
github Workday / canvas-kit / modules / _labs / header / react / spec / Header.snapshot.tsx View on Github external
test('renders a header with SystemIcon and IconButton children', () =&gt; {
    const tree = renderer
      .create(
        <header>
          
          
          
        </header>
      )
      .toJSON();
    expect(tree).toMatchSnapshot();
  });
github Workday / canvas-kit / modules / _labs / header / react / lib / Header.tsx View on Github external
if (menuToggle) {
      const menuToggleElement = menuToggle as React.ReactElement;
      const onClick = menuToggleElement.props.onClick
        ? menuToggleElement.props.onClick
        : onMenuClick;

      return React.cloneElement(menuToggleElement, {
        onClick,
        className: 'canvas-header--menu-icon',
      });
    }

    return (
      
    );
  }
}
github Workday / canvas-kit / modules / _labs / header / react / lib / parts / Search.tsx View on Github external
const iconButtonVariant = (inverse: boolean) =>
  inverse ? IconButton.Variant.Inverse : IconButton.Variant.Plain;