How to use the @edtr-io/editor-ui.styled.div function in @edtr-io/editor-ui

To help you get started, we’ve selected a few @edtr-io/editor-ui 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 edtr-io / edtr-io / packages / plugin-highlight / src / editor.tsx View on Github external
outline: 'none',
  boxShadow: '0 1px 1px 0 rgba(0,0,0,0.50)',
  '&::-webkit-input-placeholder': {
    color: 'rgba(0,0,0,0.5)'
  }
})

const QuestionIcon = styled(Icon)({
  color: 'black',
  margin: '0 10px -3px 5px',
  '&:hover': {
    color: 'rgba(0,0,0,0.5)'
  }
})

const CheckboxContainer = styled.div({
  float: 'right'
})

// TODO: type and theming. maybe put in editor-ui?
const HelpIcon: React.FunctionComponent = () => (
  <a title="Available Languages" rel="noopener noreferrer" href="https://github.com/conorhastings/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_HLJS.MD">
    
  </a>
)

export const createHighlightEditor = (config: HighlightPluginConfig) =&gt;
github edtr-io / edtr-io / packages / plugin-rows / src / editor / controls / move-controls.tsx View on Github external
import { EdtrIcon, edtrRowsControls, styled } from '@edtr-io/editor-ui'
import { StateTypeReturnType } from '@edtr-io/plugin'
import * as React from 'react'

import { MoveControlsProps } from '.'
import { createRowPluginTheme, rowsState, rowState } from '../..'

const StyledControls = styled.div({
  display: 'flex'
})

const IconContainer = styled.div&lt;{ disabled?: boolean; name: string }&gt;(
  ({ disabled, name, ...props }) =&gt; {
    const theme = createRowPluginTheme(name, props.theme)
    return {
      height: '24px',
      marginBottom: '15px',
      cursor: disabled ? 'not-allowed' : 'pointer',
      color: disabled ? theme.menu.secondary.color : theme.menu.primary.color,
      pointerEvents: disabled ? 'none' : undefined,
      '&amp;:hover': {
        color: disabled ? theme.menu.secondary.color : theme.menu.highlightColor
      }
    }
github edtr-io / edtr-io / packages / plugin-rows / src / editor / controls / settings.tsx View on Github external
'&amp;::before': {
      position: 'absolute',
      pointerEvents: 'none',
      top: 0,
      right: 0,
      content: '""',
      opacity: 1,
      height: '100%',
      width: '2px',
      backgroundColor: theme.backgroundColor,
      zIndex: 15
    }
  }
})

const StyledIconContainer = styled.div(
  ({ name, ...props }: ThemeProps &amp; { name: string }) =&gt; {
    const theme = createRowPluginTheme(name, props.theme)
    return {
      height: '24px',
      opacity: 0.8,
      cursor: 'pointer',
      color: theme.menu.primary.color,

      '&amp;:hover': {
        color: theme.menu.highlightColor
      }
    }
  }
)

const Content = styled.div(
github edtr-io / edtr-io / packages / plugin-rows / src / row / menu / index.tsx View on Github external
backgroundColor: theme.menu.primary.backgroundColor,
      position: 'fixed',
      top: 0,
      left: 0,
      width: '100%',
      height: '100vh',
      zIndex: 9999,

      '@media (max-width: 1000px)': {
        padding: '25px 20px 155px'
      }
    }
  }
)

const CloseButtonContainer = styled.div({
  position: 'absolute',
  top: '15px',
  right: '15px',
  width: '30px',
  cursor: 'pointer'
})

const PluginList = styled.div({
  display: 'flex',
  justifyContent: 'space-around',
  flexWrap: 'wrap',
  overflowY: 'auto',
  alignItems: 'stretch'
})

interface MenuConnectorProps {
github edtr-io / edtr-io / packages / plugin-equations / src / editor.tsx View on Github external
import { StatefulPluginEditorProps } from '@edtr-io/core'
import { Icon, faPlus, faTimes, styled } from '@edtr-io/editor-ui'
import * as React from 'react'
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd'

import { EquationsRenderer } from './renderer'
import { equationsState } from '.'

const DraggableContainer = styled.div({
  border: '1px solid #000',
  margin: '10px',
  background: 'lightgrey',
  padding: '10px'
})

const RemoveButton = styled.button({
  borderRadius: '50%',
  outline: 'none',
  width: '35px',
  height: '35px',
  border: 'none',
  float: 'right',
  background: 'transparent',
  position: 'relative',
  top: '-15px',
github edtr-io / edtr-io / packages / plugin-rows / src / editor / controls / globals.tsx View on Github external
import { styled, Icon, faCopy, faTrashAlt } from '@edtr-io/editor-ui'
import { StateTypeReturnType } from '@edtr-io/plugin'
import * as React from 'react'

import { createRowPluginTheme, rowsState } from '../..'

const StyledGlobals = styled.div({
  display: 'flex',
  alignItems: 'center'
})

const IconContainer = styled.div&lt;{ disabled?: boolean; name: string }&gt;(
  ({ disabled, name, ...props }) =&gt; {
    const theme = createRowPluginTheme(name, props.theme)
    return {
      margin: '0 5px 0 15px',
      padding: '5px',

      cursor: disabled ? 'not-allowed' : 'pointer',
      color: disabled ? theme.menu.secondary.color : theme.menu.primary.color,
      '&amp;:hover': {
        color: disabled ? theme.menu.secondary.color : theme.highlightColor
      }
github edtr-io / edtr-io / packages / plugin-rows / src / editor / controls / extended-settings.tsx View on Github external
})

const CloseBtnContainer = styled.div&lt;{ name: string }&gt;(({ name, ...props }) =&gt; {
  const theme = createRowPluginTheme(name, props.theme)
  return {
    width: '24px',
    height: '24px',
    cursor: 'pointer',
    color: theme.menu.primary.color,
    '&amp;:hover': {
      color: theme.menu.highlightColor
    }
  }
})

const Footer = styled.div&lt;{ name: string }&gt;(({ name, ...props }) =&gt; {
  const theme = createRowPluginTheme(name, props.theme)
  return {
    paddingTop: '10px',
    marginTop: '25px',
    borderTop: `1px solid ${theme.lightBackgroundColor}`, //rgba(182,182,182,1)
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'space-between'
  }
})

const CloseCaption = styled.div&lt;{ name: string }&gt;(({ name, ...props }) =&gt; {
  const theme = createRowPluginTheme(name, props.theme)
  return {
    color: theme.menu.highlightColor,
    cursor: 'pointer'
github edtr-io / edtr-io / packages / plugin-equations / src / editor.tsx View on Github external
const ColWrapper = styled.div({
  cursor: 'auto',
  background: '#fff'
})

const AddButton = styled.button({
  borderRadius: '50%',
  outline: 'none',
  width: '35px',
  height: '35px',
  border: 'none',
  margin: 'auto'
})

const AddButtonWrapper = styled.div({
  textAlign: 'center'
})

export class EquationsEditor extends React.Component&lt;
  StatefulPluginEditorProps
&gt; {
  private addButton = () =&gt; {
    const { state } = this.props
    state.steps.insert()
  }
  private removeButton = (index: number) =&gt; () =&gt; {
    const { state } = this.props
    state.steps.remove(index)
  }
  public render() {
    const { editable, state } = this.props
github edtr-io / edtr-io / packages / plugins / solution-steps / src / helper / styled-elements.tsx View on Github external
} from '@edtr-io/ui'

export const Buttoncontainer = styled.div({
  display: 'flex',
  flexDirection: 'row',
  width: '100%'
})

export const Container = styled.div({
  display: 'flex',
  flexDirection: 'row',
  flexWrap: 'wrap',
  position: 'relative'
})

export const ContentComponent = styled.div&lt;{ isHalf?: boolean }&gt;(
  ({ isHalf }: { isHalf?: boolean }) =&gt; {
    return {
      //marginTop: '10px',
      boxShadow: '0 1px 3px 0 rgba(0,0,0,0.2)',
      padding: '20px 20px 10px 10px',
      width: isHalf ? '50%' : '100%',
      position: 'relative'
    }
  }
)

const BackgroundSymbol = styled.div({
  position: 'absolute',
  top: '0',
  right: '0',
  color: 'rgba(0,0,0,0.1)',
github edtr-io / edtr-io / packages / plugin-video / src / renderer.tsx View on Github external
import { StatefulPluginEditorProps } from '@edtr-io/core'
import * as React from 'react'

import { videoState } from '.'
import { Icon, styled, faFilm } from '@edtr-io/editor-ui'

const VideoPlaceholderWrapper = styled.div({
  position: 'relative',
  width: '100%',
  textAlign: 'center'
})

enum VideoType {
  YouTube = 'youtube',
  Vimeo = 'vimeo',
  Wikimedia = 'wikimedia',
  BR = 'br'
}

const VideoWrapper = styled.div(
  ({ disableCursorEvents }: { disableCursorEvents: boolean }) => ({
    position: 'relative',
    padding: '0',