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

To help you get started, we’ve selected a few @edtr-io/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 / plugins / serlo-injection / src / renderer.tsx View on Github external
import { styled } from '@edtr-io/ui'
// @ts-ignore
import IframeResizer from 'iframe-resizer-react'
import * as React from 'react'

const Iframe = styled(IframeResizer)({
  width: '100%',
  border: '1px solid #ddd',
  borderRadius: '2px'
})

export const SerloInjectionRenderer = (props: { src: string }) => {
  return (
    <div>
      </div>
github edtr-io / edtr-io / packages / ui-renderer / src / components / textarea.tsx View on Github external
const Textarea = styled(TextareaAutosize)({
  minHeight: '100px',
  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)',
  '&amp;::-webkit-input-placeholder': {
    color: 'rgba(0,0,0,0.5)'
  }
})

const StyledIgnoreKeys = styled(IgnoreKeys)({
  width: '100%'
})

const EditorTextareaRefForward: React.RefForwardingComponent&lt;
  HTMLTextAreaElement,
  Omit
&gt; = (props, ref) =&gt; {
  return (
    
      <textarea> {
          if (e.key !== 'ArrowUp' &amp;&amp; e.key !== 'ArrowDown') {
            return
          }</textarea>
github edtr-io / edtr-io / packages / plugins / rows / src / editor / menu / plugin.tsx View on Github external
justifyContent: 'flex-start',
    margin: '15px',
    width: '175px',
    borderRadius: '5px',
    padding: '15px',
    cursor: 'pointer',
    transition: '250ms all ease-in-out',
    color: theme.menu.primary.color,

    '&:hover': {
      backgroundColor: theme.menu.secondary.backgroundColor
    }
  }
})

const DefaultIcon = styled(EdtrIcon)({
  height: '100%',
  width: '100%'
})

const IconWrapper = styled.div({
  height: '50px'
})

const Title = styled.h3({
  marginTop: '15px',
  fontSize: '24px',
  marginBottom: '10px',
  fontWeight: 'bold',
  textAlign: 'center'
})
github edtr-io / edtr-io / packages / plugin-rows / src / row.tsx View on Github external
icon: IconProp
  disabled?: boolean
}&gt; = props =&gt; (
  
    
  
)

export const Add: React.FunctionComponent&lt;{
  onClick: () =&gt; void
}&gt; = props =&gt; 

export const TopFloatingButtonContainer = styled(FloatingButtonContainer)({
  top: '-12px',
  width: '20px',
  left: '50%'
})

const BottomFloatingButtonContainer = styled(FloatingButtonContainer)({
  bottom: '10px',
  width: '20px',
  left: '50%',
  zIndex: 90
})

const RightFloatingButtonContainer = styled(FloatingButtonContainer)({
  top: '-12px',
  right: 0,
  width: 'auto',
github edtr-io / edtr-io / packages / plugins / rows / src / editor / separator.tsx View on Github external
}
  }
)

const TriggerArea = styled.div({
  width: '100%',
  padding: '2px 0 4px',
  display: 'flex',
  justifyContent: 'center',

  '&amp;:hover .add-trigger': {
    opacity: 0.6
  }
})

const Icon = styled(EdtrIcon)({
  width: '26px'
})

export function Add(props: {
  config: RowsConfig
  focused: boolean
  onClick: () =&gt; void
}) {
  return (
github edtr-io / edtr-io / packages / plugins / rows / src / editor / render.tsx View on Github external
cursor: 'grab',
  userSelect: 'none',
  '&amp;:active': {
    cursor: 'grabbing'
  }
})

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

const Left = styled.div({
  flex: 1
})

const BorderlessOverlayButton = styled(OverlayButton)({
  border: 'none !important',
  padding: '0 !important',
  minWidth: '0 !important'
})

export function RowRenderer({
  insert,
  moveRow,
  row,
  rows,
  index,
  plugins
}: {
  insert(index: number, options?: { plugin: string; state?: unknown }): void
  moveRow(from: number, to: number): void
  row: StateTypeReturnType[0]
github edtr-io / edtr-io / packages / plugins / rows / src / editor / render.tsx View on Github external
DragObjectWithType,
  DropTargetMonitor,
  useDrag,
  useDrop
} from 'react-dnd'
import { NativeTypes } from 'react-dnd-html5-backend'

import { RowsState } from '..'

interface RowDragObject extends DragObjectWithType {
  type: 'row'
  id: string
  index: number
}

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

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

const Left = styled.div({
  flex: 1
})
github edtr-io / edtr-io / packages / public / renderer-ui / src / components / textarea.tsx View on Github external
const Textarea = styled(TextareaAutosize)({
  minHeight: '100px',
  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)',
  '&amp;::-webkit-input-placeholder': {
    color: 'rgba(0,0,0,0.5)'
  }
})

const StyledIgnoreKeys = styled(IgnoreKeys)({
  width: '100%'
})

const EditorTextareaRefForward: React.RefForwardingComponent&lt;
  HTMLTextAreaElement,
  Omit
&gt; = (props, ref) =&gt; {
  return (
    
      <textarea> {
          if (e.key !== 'ArrowUp' &amp;&amp; e.key !== 'ArrowDown') {
            return
          }</textarea>
github edtr-io / edtr-io / packages / plugins / table / src / renderer.tsx View on Github external
borderTop: '1px solid #c6cbd1'
  },
  '&amp; th, &amp; td': {
    padding: '6px 13px',
    border: '1px 1px solid #dfe2e5'
  },
  '&amp; table tr:nth-child(2n)': {
    background: '#f6f8fa'
  },
  '&amp; table': {
    width: '100%',
    maxWidth: '100%'
  }
})

const StyledIcon = styled(Icon)({ marginRight: '5px' })

export function createTableRenderer(config: TablePluginConfig) {
  return function TableRenderer(props: PluginEditorProps) {
    const { editable, state } = props

    const renderedMarkdown = config.renderMarkdown(state.value)

    return (
      
        {editable &amp;&amp; state.value.trim() === '' ? (
          
        ) : null}
        {typeof renderedMarkdown === 'string' ? (
github edtr-io / edtr-io / packages / plugin-rows / src / editor.tsx View on Github external
borderRadius: 0,
  opacity: 0.15,
  '&:hover': {
    cursor: 'pointer',
    opacity: 1
  },
  display: 'inline-block'
})

const FloatingButtonContainer = styled.div({
  position: 'absolute',
  height: '0',
  textAlign: 'center'
})

const TopFloatingButtonContainer = styled(FloatingButtonContainer)({
  top: '0',
  width: '20px',
  left: '50%'
})

const BottomFloatingButtonContainer = styled(FloatingButtonContainer)({
  bottom: '10px',
  width: '20px',
  left: '50%',
  zIndex: 90
})

const RightFloatingButtonContainer = styled(FloatingButtonContainer)({
  top: '-10px',
  right: 0,
  width: 'auto',