<commit_before>import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';

import { withKnobs, select, text } from '@storybook/addon-knobs';
import { iconAddSolid, iconSearch } from 'carbon-icons';
import Icon from '../Icon';
import ContentSwitcher from '../ContentSwitcher';
import Switch from '../Switch';

const icons = {
  None: 'None',
  'Add with filled circle (iconAddSolid from `carbon-icons`)': 'iconAddSolid',
  'Search (iconSearch from `carbon-icons`)': 'iconSearch',
};

const iconMap = {
  iconAddSolid: <Icon icon={iconAddSolid} />,
  iconSearch: <Icon icon={iconSearch} />,
};

const kinds = {
  'Anchor (anchor)': 'anchor',
  'Button (button)': 'button',
};

const props = {
  contentSwitcher: () => ({
    onChange: action('onChange'),
  }),
  switch: () => ({
    onClick: action('onClick - Switch'),
    kind: select('Butto kind (kind in <Switch>)', kinds, 'anchor'),
    href: text('The link href (href in <Switch>)', ''),
    icon: iconMap[select('Icon (icon in <Switch>)', icons, 'none')],
  }),
};

storiesOf('ContentSwitcher', module)
  .addDecorator(withKnobs)
  .add(
    'Default',
    () => {
      const switchProps = props.switch();
      return (
        <ContentSwitcher {...props.contentSwitcher()}>
          <Switch name="one" text="First section" {...switchProps} />
          <Switch name="two" text="Second section" {...switchProps} />
          <Switch name="three" text="Third section" {...switchProps} />
        </ContentSwitcher><commit_msg>docs(ContentSwitcher) fix tiny typo (#1552)<commit_after>import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';

import { withKnobs, select, text } from '@storybook/addon-knobs';
import { iconAddSolid, iconSearch } from 'carbon-icons';
import Icon from '../Icon';
import ContentSwitcher from '../ContentSwitcher';
import Switch from '../Switch';

const icons = {
  None: 'None',
  'Add with filled circle (iconAddSolid from `carbon-icons`)': 'iconAddSolid',
  'Search (iconSearch from `carbon-icons`)': 'iconSearch',
};

const iconMap = {
  iconAddSolid: <Icon icon={iconAddSolid} />,
  iconSearch: <Icon icon={iconSearch} />,
};

const kinds = {
  'Anchor (anchor)': 'anchor',
  'Button (button)': 'button',
};

const props = {
  contentSwitcher: () => ({
    onChange: action('onChange'),
  }),
  switch: () => ({
    onClick: action('onClick - Switch'),
    kind: select('Button kind (kind in <Switch>)', kinds, 'anchor'),
    href: text('The link href (href in <Switch>)', ''),
    icon: iconMap[select('Icon (icon in <Switch>)', icons, 'none')],
  }),
};

storiesOf('ContentSwitcher', module)
  .addDecorator(withKnobs)
  .add(
    'Default',
    () => {
      const switchProps = props.switch();
      return (
        <ContentSwitcher {...props.contentSwitcher()}>
          <Switch name="one" text="First section" {...switchProps} />
          <Switch name="two" text="Second section" {...switchProps} />
          <Switch name="three" text="Third section" {...switchProps} />
        </ContentSwitcher>
{'fraction_non_alphanumeric': 0.18376478108021732, 'fraction_numerical': 0.001278363694471077, 'mean_word_length': 3.8079877112135176, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3830649', 'n_tokens_mistral': 991, 'n_tokens_neox': 979, 'n_words': 255}