How to use the @pluralsight/ps-design-system-theme.names function in @pluralsight/ps-design-system-theme

To help you get started, we’ve selected a few @pluralsight/ps-design-system-theme 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 pluralsight / design-system / packages / site / pages / components / card.js View on Github external
const decorateCards = (sizes, props, state) => {
  const cardMaxWidths = {
    small: '140px',
    medium: '320px',
    large: '540px'
  }
  // NOTE: jsx-style classes evaluated in the context of Example.React
  let decorated = `<div>`

  state.codes.forEach((code, i) =&gt; {
    decorated += `<div style="{{">${code}</div>`
  })

  decorated += '</div>'

  return decorated
}
const decorateCardsSML = decorateCards.bind(null, Object.keys(Card.sizes))
github pluralsight / design-system / packages / site / src / ui / theme-toggle.js View on Github external
const handleSelect = (evt, index) => {
    const nextTheme = Theme.names[Object.keys(Theme.names)[index]]
    setThemeName(nextTheme)
  }
github pluralsight / design-system / packages / button / src / react / __stories__ / index.story.js View on Github external
storiesOf('Button / theme', module).add('nested', _ =&gt; (
  
    <button>{Theme.names.dark}</button>
    
      <button>{Theme.names.light}</button>
      
        <button>{Theme.names.dark}</button>
      
    
  
))
github pluralsight / design-system / packages / site / pages / components / table.js View on Github external
{row.courses}
                
                
                  {row.viewTime}m
                
              
            ))}
          
        
        <style>{`
          .example {
            padding: ${core.layout.spacingLarge};
            background: ${props.themeName === Theme.names.light
              ? core.colors.bone
              : core.colors.gray06};
          }
        `}</style>
      
    )
  }
}
github pluralsight / design-system / packages / site / pages / components / theme.js View on Github external
const ContrastingExample = _ =&gt; (
  <div>
    <div>
      
        <button size="{Button.sizes.large}">
          Light
        </button>
      
    </div>
    <div>
      
        <button size="{Button.sizes.large}">
          Dark
        </button>
      
    </div>
    <style>{`
      .contrast {
        display: flex;
        margin: ${core.layout.spacingLarge} 0;</style></div>
github pluralsight / design-system / packages / site / src / ui / theme-toggle.js View on Github external
function ThemeToggle(props) {
  return (
    &lt;&gt;
      <style>{`
        .toggle {
          position: absolute;
          top: ${core.layout.spacingXSmall};
          right: ${core.layout.spacingXSmall};
          z-index: 1;
        }
      `}</style>

      <div>
        
          {Object.keys(Theme.names).map(themeName =&gt; (
            
              {capitalize(themeName)}
            
          ))}
        
      </div>
    
  )
}
github pluralsight / design-system / packages / site / pages / components / drawer.js View on Github external
const DrawerExamples = () =&gt; (
  <div>
    
      <div>
        }&gt;
          
        
        }&gt;
          
        
      </div>
    
    <style>{`
      .drawer-example {
        padding: ${core.layout.spacingXLarge};
        background: ${core.colors.gray06};
        color: ${core.colors.bone};
      }
    `}</style></div>
github pluralsight / design-system / packages / datepicker / src / react / calendar.js View on Github external
setDisplayed(nextDisplayed)
  }

  function handleDayClick(evt, dd) {
    evt.preventDefault()

    const nextSelected = { ...displayed, dd }
    setSelected(nextSelected)

    if (isFunction(props.onSelect)) {
      props.onSelect(formatDate(nextSelected), nextSelected)
    }
  }

  return (
    
      <div tabindex="{-1}">
        <div>
          <button>}
            size={Button.sizes.small}
            appearance={Button.appearances.flat}
          /&gt;

          <div>
            {getMonthName(displayed.mm)} {displayed.yyyy}
          </div>

          </button><button>}</button></div></div>
github pluralsight / design-system / packages / site / pages / components / theme.js View on Github external
<p>Install the component dependency:</p>
      <code>
        npm install @pluralsight/ps-design-system-theme
      </code>

      <p>Include a React component in your project:</p>
      <code>
        import Theme from '@pluralsight/ps-design-system-theme'
      </code>

      Theme.defaultName,
            <span>controls which theme is used in child components</span>
          ])
        ]}
      /&gt;

      Usage pattern
      <p>
        To theme a component or part of the page, surround it in the{' '}
        Theme component. If you're on React &lt; 16,
        you'll need to wrap a single child, so a child{' '}
        div may be required.
      </p>
      <code>
        {`</code>
github pluralsight / design-system / packages / site / pages / components / tooltip.js View on Github external
function TooltipGuideline(props) {
  return (
    
      <button>}
      /&gt;
      <div>
        
          {props.children}
        
      </div>
      <style>{`
        .tooltipWrapper {
          position: relative;</style></button>