How to use the @storybook/theming.convert 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 / knobs / src / components / __tests__ / Panel.js View on Github external
it('should have one tab per groupId and an empty Other tab when all are defined', () => {
      const root = mount(
        
          
        
      );

      testChannel.on.mock.calls[0][1]({
        knobs: {
          foo: {
            name: 'foo',
            defaultValue: 'test',
            used: true,
            groupId: 'foo',
          },
          bar: {
            name: 'bar',
            defaultValue: 'test2',
            used: true,
github storybookjs / storybook / lib / ui / src / components / sidebar / SidebarHeading.stories.tsx View on Github external
import React from 'react';
import { themes, ThemeProvider, convert } from '@storybook/theming';
import { action } from '@storybook/addon-actions';

import SidebarHeading from './SidebarHeading';

const { light } = themes;
const theme = convert(light);

export default {
  component: SidebarHeading,
  title: 'UI|Sidebar/SidebarHeading',
  decorators: [
    (storyFn: any) => (
      <div style="{{">
        {storyFn()}
      </div>
    ),
  ],
github storybookjs / storybook / addons / jest / src / components / Panel.tsx View on Github external
key={`progress-portion-${entry[0]}`}
                            color={getColorByType(entry[0])}
                            progressPercent={
                              entry[1]
                                ? (entry[1].length / result.assertionResults.length) * 100
                                : 0
                            }
                          /&gt;
                        );
                      })}
                    
                  ) : null}
                
                
                  <div color="{getColorByType(StatusTypes.FAILED_TYPE)}" title="{`${" id="failing-tests">
                    
                      {testsByType.get(StatusTypes.FAILED_TYPE) ? (
                        testsByType.get(StatusTypes.FAILED_TYPE).map((res: any) =&gt; (
                          
                            
                          </div>
github storybookjs / storybook / docs / src / components / Docs / Content / index.js View on Github external
const DocsContent = ({ title, content, editUrl, ...rest }) =&gt; (
  <div id="docs-content">
    <div>
      <h2>{title}</h2>
      <p>
        <a rel="noopener noreferrer" href="{editUrl}">
          Edit this page
        </a>
      </p>
      <div>
        
          {parse(content, {
            replace: domNode =&gt; {
              if (
                domNode.name === 'pre' &amp;&amp;
                domNode.children.find(
                  n =&gt; n.name === 'code' &amp;&amp; n.attribs.class &amp;&amp; n.attribs.class.match(/^language-/)
                )
              ) {
                const language = domNode.children[0].attribs.class.replace('language-', '');
                const code = domNode.children[0].children[0].data;
                return (
                  
                    {code}
                  
                );
              }</div></div></div>