How to use the @edtr-io/editor-ui.styled 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
const Textarea = styled.textarea({
  height: '250px',
  width: '100%',
  margin: 'auto',
  padding: '10px',
  resize: 'none',
  fontFamily: 'Menlo, Monaco, "Courier New", monospace',
  border: 'none',
  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 = () => (
github edtr-io / edtr-io / packages / plugin-rows / src / editor / menu / dropzone.tsx View on Github external
import { styled, faCloudUploadAlt, Icon } from '@edtr-io/editor-ui'
import { ThemeProps } from '@edtr-io/ui'
import * as React from 'react'

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

const StyledIcon = styled(Icon)({
  height: '48px',
  marginBottom: '15px',
  transition: '250ms all ease-in-out'
})

const StyledDropzone = styled.div(
  ({ name, ...props }) => {
    const theme = createRowPluginTheme(name, props.theme)
    return {
      width: '100%',
      marginTop: '50px',
      backgroundColor: theme.menu.dropzone.backgroundColor,
      color: theme.menu.dropzone.color,
      border: `3px dashed ${theme.color}`,
      transition: '250ms all ease-in-out',
      borderRadius: '5px',
github edtr-io / edtr-io / packages / plugin-anchor / src / editor.tsx View on Github external
import { StatefulPluginEditorProps } from '@edtr-io/core'
import { Icon, faLink, EditorInput, styled } from '@edtr-io/editor-ui'
import * as React from 'react'

import { AnchorRenderer } from './renderer'
import { anchorState } from '.'

const StyledIcon = styled(Icon)({ marginRight: '5px' })
export const AnchorEditor = (
  props: StatefulPluginEditorProps
) => {
  const { editable, focused, state } = props
  return (
    
      {editable ?  : null}
      
      {focused ? (
         {
            state.set(e.target.value)
          }}
        />
github edtr-io / edtr-io / packages / plugins / text / src / controls / index.tsx View on Github external
switchControls={setVisibleControls}
          onChange={onChange}
        />
      )
    case VisibleControls.Colors:
      return (
        
      )
  }
}

const TimeoutBottomToolbar = styled(BottomToolbar)<{
  visible: boolean
  isTouch: boolean
}>(props => {
  const touchStyles = props.isTouch
    ? { bottom: 'unset', top: 0, transform: 'translate(-50%, 50%)' }
    : {}

  return {
    opacity: props.visible ? 1 : 0,
    transition: '500ms opacity ease-in-out',
    ...touchStyles
  }
})

let debounceTimeout: number
export function Controls(props: ControlProps) {
github edtr-io / edtr-io / packages / plugin-solution / src / editor.tsx View on Github external
import { StatefulPluginEditorProps } from '@edtr-io/core'
import { ThemeProvider } from '@edtr-io/ui'
import { ExpandableBox } from '@edtr-io/renderer-ui'
import * as React from 'react'

import { solutionState } from '.'
import { EditorInput, styled } from '@edtr-io/editor-ui'

const EditorInputWithMarginLeft = styled(EditorInput)({
  marginLeft: '5px',
  paddingLeft: '3px',
  '&:focus': {
    borderColor: 'black'
  }
})
export function SolutionEditor({
  state,
  editable,
  focused
}: StatefulPluginEditorProps) {
  const title = (
    
      Lösung
      {editable && focused ? (
github edtr-io / edtr-io / packages / plugin-hint / src / editor.tsx View on Github external
import { StatefulPluginEditorProps } from '@edtr-io/core'
import { ThemeProvider } from '@edtr-io/ui'
import { ExpandableBox } from '@edtr-io/renderer-ui'
import * as React from 'react'

import { hintState } from '.'
import { EditorInput, styled } from '@edtr-io/editor-ui'

const EditorInputWithMarginLeft = styled(EditorInput)({
  marginLeft: '5px',
  paddingLeft: '3px',
  '&:focus': {
    borderColor: 'black'
  }
})

export function HintEditor({
  state,
  editable,
  focused
}: StatefulPluginEditorProps) {
  const title = (
    
      Hinweis
      {editable && focused ? (
github edtr-io / edtr-io / packages / plugin-rows / src / editor / controls / move-controls.tsx View on Github external
({ disabled, name, ...props }) => {
    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,
      '&:hover': {
        color: disabled ? theme.menu.secondary.color : theme.menu.highlightColor
      }
    }
  }
)

const DragIcon = styled(IconContainer)({
  marginBottom: '5px',
  marginTop: '-3px',
  cursor: 'grab',
  userSelect: 'none',
  '&:active': {
    cursor: 'grabbing'
  }
})

const Drag: React.FunctionComponent<
  IconProps & { connectDragSource: Function }
> = ({ rows, connectDragSource, name }) => {
  return connectDragSource(
    <div>
      </div>