How to use @arch-ui/theme - 10 common examples

To help you get started, we’ve selected a few @arch-ui/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 keystonejs / keystone / packages / arch / packages / lozenge / src / index.js View on Github external
default: colors.N05,
  primary: colors.B.L90,
  danger: colors.R.L90,
  create: colors.G.L90,
  warning: colors.Y.L90,
};
const subtleBorderColor = {
  default: colors.N10,
  primary: colors.B.L80,
  danger: colors.R.L80,
  create: colors.G.L80,
  warning: colors.Y.L80,
};
const subtleTextColor = {
  default: colors.N50,
  primary: colors.B.L30,
  danger: colors.R.L30,
  create: colors.G.L30,
  warning: colors.Y.L30,
};

export const Lozenge = styled.div(({ appearance, variant, crop }) => {
  const isClipRight = crop === 'right';
  const cropStyles = crop
    ? {
        overflow: 'hidden',
        textOverflow: 'ellipsis',
        whiteSpace: 'nowrap',

        // clip from beginning of string
        direction: isClipRight ? 'rtl' : null,
        textAlign: isClipRight ? 'left' : null,
github keystonejs / keystone / packages / app-admin-ui / client / components / Nav / index.js View on Github external
const GrabHandle = styled.div(({ isActive }) => ({
  backgroundColor: alpha(colors.text, 0.06),
  height: isActive ? '100%' : 0,
  cursor: 'col-resize',
  position: 'absolute',
  right: 0,
  top: 0,
  transition: `background-color ${TRANSITION_DURATION} linear, height ${TRANSITION_DURATION} ${TRANSITION_EASING}`,
  width: 1,

  ':hover': {
    transitionDelay: '100ms', // avoid inadvertent mouse passes
    backgroundColor: alpha(colors.text, 0.12),
  },
  ':active': {
    backgroundColor: alpha(colors.text, 0.24),
  },

  // increase hit-area
  ':before': {
    bottom: -gridSize,
    content: '" "',
    left: -gridSize,
    position: 'absolute',
    right: -gridSize,
    top: -gridSize,
  },
}));
const CollapseExpand = styled.button(({ isCollapsed, mouseIsOverNav }) => {
github keystonejs / keystone / packages / arch / packages / dialog / src / primitives.js View on Github external
export const HeadFoot = styled.div({
  lineHeight: 1,
  margin: `0 ${innerGutter}px`,
  paddingBottom: innerGutter,
  paddingTop: innerGutter,

  // ensure that box-shadow covers body content
  position: 'relative',
  zIndex: 1,
});
export const Header = styled(HeadFoot)({
  boxShadow: `0 2px 0 ${alpha(colors.text, 0.12)}`,
});
export const Footer = styled(HeadFoot)({
  boxShadow: `0 -2px 0 ${alpha(colors.text, 0.12)}`,
});
export const Title = styled.h3({
  fontSize: 18,
  fontWeight: 500,
  margin: 0,
});
export const Body = styled.div({
  lineHeight: 1.4,
  overflowY: 'auto',
  padding: innerGutter,
});
github keystonejs / keystone / packages / arch / packages / loading / src / index.js View on Github external
import React from 'react';
import styled from '@emotion/styled';
import { keyframes } from '@emotion/core';

import { colors } from '@arch-ui/theme';
import { A11yText } from '@arch-ui/typography';

// ==============================
// Dots
// ==============================

const fadeAnim = keyframes`0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; }`;
const appearanceColor = {
  default: colors.N20,
  dark: colors.text,
  primary: colors.primary,
  inverted: 'white',
};

const DotsContainer = styled.div(({ size }) => ({
  alignSelf: 'center',
  fontSize: size,
  lineHeight: 1,
  textAlign: 'center',
  verticalAlign: 'middle',
  display: 'inline-flex',
}));
const Dot = styled.span(({ appearance, delay = 0, isOffset }) => ({
  animation: `${fadeAnim} 1s infinite ${delay}ms`,
  animationTimingFunction: 'ease-in-out',
  backgroundColor: appearanceColor[appearance],
github keystonejs / keystone / packages / arch / packages / dialog / src / primitives.js View on Github external
{...props}
  />
));

export const HeadFoot = styled.div({
  lineHeight: 1,
  margin: `0 ${innerGutter}px`,
  paddingBottom: innerGutter,
  paddingTop: innerGutter,

  // ensure that box-shadow covers body content
  position: 'relative',
  zIndex: 1,
});
export const Header = styled(HeadFoot)({
  boxShadow: `0 2px 0 ${alpha(colors.text, 0.12)}`,
});
export const Footer = styled(HeadFoot)({
  boxShadow: `0 -2px 0 ${alpha(colors.text, 0.12)}`,
});
export const Title = styled.h3({
  fontSize: 18,
  fontWeight: 500,
  margin: 0,
});
export const Body = styled.div({
  lineHeight: 1.4,
  overflowY: 'auto',
  padding: innerGutter,
});
github keystonejs / keystone / packages / arch / packages / drawer / src / index.js View on Github external
const HeadFoot = styled.div({
  lineHeight: 1,
  margin: `0 ${innerGutter}px`,
  paddingBottom: innerGutter,
  paddingTop: innerGutter,

  // ensure that box-shadow covers body content
  position: 'relative',
  zIndex: 1,
});
const Header = styled(HeadFoot)({
  boxShadow: `0 2px 0 ${alpha(colors.text, 0.12)}`,
});
const Footer = styled(HeadFoot)({
  boxShadow: `0 -2px 0 ${alpha(colors.text, 0.12)}`,
});
const Body = styled.div({
  lineHeight: 1.4,
  overflowY: 'auto',
  padding: innerGutter,
});

function useKeydownHandler(handler) {
  let handlerRef = useRef(handler);
  useEffect(() => {
    handlerRef.current = handler;
  });
  useEffect(() => {
    function handle(event) {
      handlerRef.current(event);
    }
github keystonejs / keystone / packages / arch / packages / controls / src / control.js View on Github external
const Icon = styled.div(({ checked, isDisabled, isFocus, isActive, isHover }) => {
  // background
  let bg = colors.N10;
  if (isDisabled && checked) {
    bg = colors.N30;
  } else if (isActive) {
    bg = checked ? colors.B.D10 : colors.N20;
  } else if ((isFocus || isHover) && !checked) {
    bg = colors.N15;
  } else if (checked) {
    bg = colors.B.base;
  }

  // fill
  let fill = 'white';
  if (isDisabled && checked) {
    fill = colors.N70;
  } else if (!checked) {
    fill = 'transparent';
github keystonejs / keystone / packages / fields / src / types / OEmbed / views / Field.js View on Github external
const StyledPreview = ({ preview, originalUrl, fieldPath, ...props }) => (
  
);
github keystonejs / keystone / packages / arch / packages / controls / src / control.js View on Github external
const Icon = styled.div(({ checked, isDisabled, isFocus, isActive, isHover }) => {
  // background
  let bg = colors.N10;
  if (isDisabled && checked) {
    bg = colors.N30;
  } else if (isActive) {
    bg = checked ? colors.B.D10 : colors.N20;
  } else if ((isFocus || isHover) && !checked) {
    bg = colors.N15;
  } else if (checked) {
    bg = colors.B.base;
  }

  // fill
  let fill = 'white';
  if (isDisabled && checked) {
    fill = colors.N70;
  } else if (!checked) {
    fill = 'transparent';
  }

  // stroke
  let innerStroke = isFocus ? colors.B.L20 : bg;