How to use the @storybook/theming.themes.normal function in @storybook/theming

To help you get started, we’ve selected a few @storybook/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 storybookjs / storybook / addons / jest / src / components / Result.tsx View on Github external
const [isOpen, setIsOpen] = useState(false);

  const onToggle = () => {
    setIsOpen(!isOpen);
  };

  const { fullName, title, failureMessages, status } = props;
  return (
    
      
        
          {status === `failed` ? (
            
          ) : null}
          <div>{capitalizeFirstLetter(fullName) || capitalizeFirstLetter(title)}</div>
        
      
      {isOpen ? (
        
          {failureMessages.map((msg: string, i: number) =&gt; (
            // eslint-disable-next-line react/no-array-index-key
            
          ))}
        
      ) : null}
github storybookjs / storybook / addons / a11y / src / components / Report / HighlightToggle.tsx View on Github external
indeterminate?: boolean;
}

enum CheckBoxStates {
  CHECKED,
  UNCHECKED,
  INDETERMINATE,
}

const Checkbox = styled.input&lt;{ disabled: boolean }&gt;(({ disabled }) =&gt; ({
  cursor: disabled ? 'not-allowed' : 'pointer',
}));

const colorsByType = [
  convert(themes.normal).color.negative, // VIOLATION,
  convert(themes.normal).color.positive, // PASS,
  convert(themes.normal).color.warning, // INCOMPLETION,
];

const getIframe = memoize(1)(() =&gt; document.getElementsByTagName(IFRAME)[0]);

function getElementBySelectorPath(elementPath: string): HTMLElement {
  const iframe = getIframe();
  if (iframe &amp;&amp; iframe.contentDocument &amp;&amp; elementPath) {
    return iframe.contentDocument.querySelector(elementPath);
  }
  return null;
}

function setElementOutlineStyle(targetElement: HTMLElement, outlineStyle: string): void {
  // eslint-disable-next-line no-param-reassign
  targetElement.style.outline = outlineStyle;
github storybookjs / storybook / addons / jest / src / components / Panel.tsx View on Github external
const getColorByType = (type: string) => {
  // using switch to allow for new types to be added
  switch (type) {
    case StatusTypes.PASSED_TYPE:
      return convert(themes.normal).color.positive;
    case StatusTypes.FAILED_TYPE:
      return convert(themes.normal).color.negative;
    case StatusTypes.PENDING_TYPE:
      return convert(themes.normal).color.warning;
    case StatusTypes.TODO_TYPE:
      return convert(themes.normal).color.purple;
    default:
      return null;
  }
};
github storybookjs / storybook / addons / jest / src / components / Panel.tsx View on Github external
const getColorByType = (type: string) => {
  // using switch to allow for new types to be added
  switch (type) {
    case StatusTypes.PASSED_TYPE:
      return convert(themes.normal).color.positive;
    case StatusTypes.FAILED_TYPE:
      return convert(themes.normal).color.negative;
    case StatusTypes.PENDING_TYPE:
      return convert(themes.normal).color.warning;
    case StatusTypes.TODO_TYPE:
      return convert(themes.normal).color.purple;
    default:
      return null;
  }
};
github storybookjs / storybook / addons / a11y / src / components / Report / HighlightToggle.tsx View on Github external
toggleId?: string;
  indeterminate?: boolean;
}

enum CheckBoxStates {
  CHECKED,
  UNCHECKED,
  INDETERMINATE,
}

const Checkbox = styled.input&lt;{ disabled: boolean }&gt;(({ disabled }) =&gt; ({
  cursor: disabled ? 'not-allowed' : 'pointer',
}));

const colorsByType = [
  convert(themes.normal).color.negative, // VIOLATION,
  convert(themes.normal).color.positive, // PASS,
  convert(themes.normal).color.warning, // INCOMPLETION,
];

const getIframe = memoize(1)(() =&gt; document.getElementsByTagName(IFRAME)[0]);

function getElementBySelectorPath(elementPath: string): HTMLElement {
  const iframe = getIframe();
  if (iframe &amp;&amp; iframe.contentDocument &amp;&amp; elementPath) {
    return iframe.contentDocument.querySelector(elementPath);
  }
  return null;
}

function setElementOutlineStyle(targetElement: HTMLElement, outlineStyle: string): void {
  // eslint-disable-next-line no-param-reassign
github 0soft / mui-form-fields / .storybook / config.tsx View on Github external
interface Window {
    _StorybookBootstrap: any;
  }
}

const req = require.context('../stories', true, /\.stories\.tsx$/);

function loadStories() {
  req.keys().forEach(req);
}

// Option defaults.
addParameters({
  options: {
    name: 'App',
    theme: themes.normal,
  },
});

configure(loadStories, module);