How to use @zendeskgarden/react-theming - 10 common examples

To help you get started, we’ve selected a few @zendeskgarden/react-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 zendeskgarden / react-components / packages / checkboxes / src / views / Message.js View on Github external
const Message = styled.div.attrs(props => ({
  'data-garden-id': COMPONENT_ID,
  'data-garden-version': PACKAGE_VERSION,
  className: classNames(CheckboxStyles['c-chk__message'], {
    [CheckboxStyles['c-chk__message--success']]: props.validation === VALIDATION.SUCCESS,
    [CheckboxStyles['c-chk__message--warning']]: props.validation === VALIDATION.WARNING,
    [CheckboxStyles['c-chk__message--error']]: props.validation === VALIDATION.ERROR,

    // RTL
    [CheckboxStyles['is-rtl']]: isRtl(props)
  })
}))`
  ${props => retrieveTheme(COMPONENT_ID, props)};
github zendeskgarden / react-components / packages / radios / src / views / Message.js View on Github external
const Message = styled.div.attrs(props => ({
  'data-garden-id': COMPONENT_ID,
  'data-garden-version': PACKAGE_VERSION,
  className: classNames(CheckboxStyles['c-chk__message'], CheckboxStyles['c-chk__message--radio'], {
    [CheckboxStyles['c-chk__message--success']]: props.validation === VALIDATION.SUCCESS,
    [CheckboxStyles['c-chk__message--warning']]: props.validation === VALIDATION.WARNING,
    [CheckboxStyles['c-chk__message--error']]: props.validation === VALIDATION.ERROR,

    // RTL
    [CheckboxStyles['is-rtl']]: isRtl(props)
  })
}))`
  ${props => retrieveTheme(COMPONENT_ID, props)};
github zendeskgarden / react-components / packages / forms / src / styled / checkboxes / StyledCheckMessage.js View on Github external
const StyledCheckMessage = styled.div.attrs(props => ({
  className: classNames(CheckboxStyles['c-chk__message'], {
    [CheckboxStyles['c-chk__message--success']]: props.validation === VALIDATION.SUCCESS,
    [CheckboxStyles['c-chk__message--warning']]: props.validation === VALIDATION.WARNING,
    [CheckboxStyles['c-chk__message--error']]: props.validation === VALIDATION.ERROR,

    // RTL
    [CheckboxStyles['is-rtl']]: isRtl(props)
  })
}))`
  ${props => retrieveTheme('forms.check_message', props)};
github zendeskgarden / react-components / packages / notifications / src / Notification.js View on Github external
const Notification = styled.div.attrs(props => ({
  'data-garden-id': COMPONENT_ID,
  'data-garden-version': PACKAGE_VERSION,
  className: classNames(CalloutStyles['c-callout'], CalloutStyles['c-callout--dialog'], {
    // RTL
    [CalloutStyles['is-rtl']]: isRtl(props),

    // Validation types
    [CalloutStyles['c-callout--success']]: props.type === VALIDATION.SUCCESS,
    [CalloutStyles['c-callout--warning']]: props.type === VALIDATION.WARNING,
    [CalloutStyles['c-callout--error']]: props.type === VALIDATION.ERROR,
    [CalloutStyles['c-callout--info']]: props.type === VALIDATION.INFO
  })
}))`
  ${props => retrieveTheme(COMPONENT_ID, props)};
github zendeskgarden / react-components / packages / checkboxes / src / views / Hint.js View on Github external
const Hint = styled.div.attrs(props => ({
  'data-garden-id': COMPONENT_ID,
  'data-garden-version': PACKAGE_VERSION,
  className: classNames(CheckboxStyles['c-chk__hint'], {
    // RTL
    [CheckboxStyles['is-rtl']]: isRtl(props)
  })
}))`
  ${props => retrieveTheme(COMPONENT_ID, props)};
github zendeskgarden / react-components / packages / forms / src / styled / text / StyledTextarea.js View on Github external
const StyledTextarea = styled(StyledTextInput.withComponent('textarea')).attrs(props => ({
  className: classNames(props.className, TextStyles['c-txt__input--area'], {
    [TextStyles['is-resizable']]: props.resizable,

    // RTL
    [TextStyles['is-rtl']]: isRtl(props)
  })
}))`
  ${props => retrieveTheme('forms.text_area', props)};
github zendeskgarden / react-components / packages / toggles / src / views / Message.js View on Github external
const Message = styled.div.attrs(props => ({
  'data-garden-id': COMPONENT_ID,
  'data-garden-version': PACKAGE_VERSION,
  className: classNames(
    CheckboxStyles['c-chk__message'],
    CheckboxStyles['c-chk__message--toggle'],
    {
      [CheckboxStyles['c-chk__message--success']]: props.validation === VALIDATION.SUCCESS,
      [CheckboxStyles['c-chk__message--warning']]: props.validation === VALIDATION.WARNING,
      [CheckboxStyles['c-chk__message--error']]: props.validation === VALIDATION.ERROR,

      // RTL
      [CheckboxStyles['is-rtl']]: isRtl(props)
    }
  )
}))`
  ${props => retrieveTheme(COMPONENT_ID, props)};
github zendeskgarden / react-components / packages / dropdowns / src / Multiselect / Multiselect.tsx View on Github external
/** Applies inset `box-shadow` styling on focus */
  focusInset: PropTypes.bool,
  hovered: PropTypes.bool,
  /** Displays select open state */
  open: PropTypes.bool,
  renderItem: PropTypes.func.isRequired,
  maxItems: PropTypes.number,
  validation: PropTypes.oneOf([VALIDATION.SUCCESS, VALIDATION.WARNING, VALIDATION.ERROR])
};

Multiselect.defaultProps = {
  maxItems: 4
};

/* @component */
export default withTheme(Multiselect) as React.FunctionComponent;
github zendeskgarden / react-components / packages / buttons / src / views / Anchor.js View on Github external
);
});

Anchor.propTypes = {
  /** Apply danger styling */
  danger: PropTypes.bool,
  focused: PropTypes.bool,
  hovered: PropTypes.bool,
  active: PropTypes.bool,
  /* Used when the anchor navigates to an external resource */
  external: PropTypes.bool,
  children: PropTypes.node
};

/** @component */
export default withTheme(Anchor);
github zendeskgarden / react-components / packages / selection / src / containers / SelectionContainer.js View on Github external
componentDidUpdate(prevProps, prevState) {
    const current = this.props.focusedKey === undefined ? this.state : this.props;
    const prev = prevProps.focusedKey === undefined ? prevState : prevProps;
    const doc = getDocument ? getDocument(this.props) : document;

    /**
     * We must programatically scroll the newly focused element into view.
     * Side-effect of the `aria-activedescendant` accessibility strategy.
     */
    if (typeof current.focusedKey !== 'undefined' && current.focusedKey !== prev.focusedKey) {
      const itemNode = doc.getElementById(this.getItemId(current.focusedKey));

      /* istanbul ignore if */
      if (itemNode) {
        scrollTo(itemNode);
      }
    }
  }