How to use the @lskjs/utils/createDynamicTag function in @lskjs/utils

To help you get started, we’ve selected a few @lskjs/utils 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 lskjs / ux / packages / list / src / List.styles.js View on Github external
width: 100%;
  /* overflow: hidden; */
  border-radius: ${p => getTheme(p.theme, 'borderRadius')};
  border: 1px solid ${p => getTheme(p.theme, 'colors.border')};
  background-color: ${p => getTheme(p.theme, 'colors.white')};

  > *:first-child {
    border-radius: ${p => getTheme(p.theme, 'borderRadius')} ${p => getTheme(p.theme, 'borderRadius')} 0 0;
  }

  > *:last-child {
    border-radius: 0 0 ${p => getTheme(p.theme, 'borderRadius')} ${p => getTheme(p.theme, 'borderRadius')};
  }
`;

const dynamicListTableItemTag = createDynamicTag('div');
export const ListTableItem = styled(dynamicListTableItemTag)`
  display: block;
  height: ${p => p.height}px;
  padding: 0 ${p => getTheme(p.theme, 'tablePadding')}px;
  background-color: ${p => getTheme(p.theme, 'colors.white')};

  ${p => (p.clickable && css`
    cursor: pointer;
    transition: background-color .2s ease;
    will-change: background-color;
    &:hover {
      background-color: ${getTheme(p.theme, 'colors.lighterPrimary')};
    }
  `)}

  &:not(:last-child) {
github lskjs / ux / packages / dashboard / UI / molecules / BlogCardList / BlogCardList.styles.js View on Github external
import styled from 'react-emotion';
import createDynamicTag from '@lskjs/utils/createDynamicTag';

const dynamicTag = createDynamicTag('article');

export const ImageContainer = styled(dynamicTag)`
  padding: 0;
  flex: 0 0 100%;
  max-width: 100%;
  height: 100%;
  padding: 0;
  max-height: 235px;
  overflow: hidden;
  /* background-color: ${p => p.theme.colors.lighterPrimary}; */
  @media screen and (min-width: 768px) {
    flex: 0 0 30%;
    max-width: 30%;
    height: inherit;
    padding: 0;
  }
github lskjs / ux / packages / ui / src / AnimatedLink / AnimatedLink.styles.js View on Github external
import styled from '@emotion/styled';
import { css } from '@emotion/core';
import Icon from 'antd/lib/icon';
import getTheme from '@lskjs/theme/getTheme';
import createDynamicTag from '@lskjs/utils/createDynamicTag';
import removeProps from '@lskjs/utils/removeProps';


const dynamicTag = createDynamicTag('a');
const filteredTag = removeProps(dynamicTag, [
  'paint',
]);

const paintColors = (p) => {
  switch (p.paint) {
    case 'primary':
      return getTheme(p.theme, 'colors.primary');
    default:
      return getTheme(p.theme, 'colors.default');
  }
};

export const ALink = styled(filteredTag)`
  position: relative;
  display: inline-block;
github lskjs / ux / packages / dashboard / src / molecules / ProfileCardBig / ProfileCardBig.styles.js View on Github external
import styled from 'react-emotion';
import Avatar from '@lskjs/ui/Avatar';
import createdynamicTag from '@lskjs/utils/createDynamicTag';
import removeProps from '@lskjs/utils/removeProps';
import getTheme from '@lskjs/theme/getTheme';

const dynamicTag = createdynamicTag('article');
const filteredTag = removeProps(dynamicTag, ['fixHeight']);

export const ProfileCardItem = styled(filteredTag)`
  border: 1px solid rgba(0,0,0,.1);
  color: rgba(0,0,0,.65);
  display: block;
  padding: 1rem;
  border-radius: ${p => getTheme(p.theme, 'borderRadius')};
  background-color: ${p => getTheme(p.theme, 'colors.white')};
  text-align: center;
  height: ${p => (p.fixHeight ? `${p.fixHeight}px` : 'auto')};
  overflow: hidden;
  font-family: ${p => getTheme(p.theme, 'fontFamily')};
  transition: border-color .2s ease-out;

  &:hover {
github lskjs / ux / packages / dashboard / src / molecules / Box / Box.styles.js View on Github external
import styled, { css } from 'react-emotion';
import creacteDynamicTag from '@lskjs/utils/createDynamicTag';
import removeProps from '@lskjs/utils/removeProps';
import getTheme from '@lskjs/theme/getTheme';

const dynamicTag = creacteDynamicTag('div');
const filteredTag = removeProps(dynamicTag, ['padded', 'paint']);

const paintColors = (p) => {
  switch (p.paint) {
    case 'light':
      return css`
        background-color: ${getTheme(p.theme, 'colors.lightGray')};
        color: ${getTheme(p.theme, 'colors.main')};`;
    case 'dark':
      return css`
        background-color: ${getTheme(p.theme, 'colors.black')};
        color: ${getTheme(p.theme, 'colors.white')};`;
    case 'primary':
      return css`
        background-color: ${getTheme(p.theme, 'colors.primary')};
        color: ${getTheme(p.theme, 'colors.white')};`;
github lskjs / ux / packages / dashboard / src / atoms / LayoutSidenavBrand / LayoutSidenavBrand.js View on Github external
import styled from 'react-emotion';
import createDynamicTag from '@lskjs/utils/createDynamicTag';
import getTheme from '@lskjs/theme/getTheme';

const dynamicTag = createDynamicTag('a');

export default styled(dynamicTag)`
  font-size: 20px;
  margin-left: 13px;
  font-family: ${p => getTheme(p.theme, 'fontFamily')};
`;
github lskjs / ux / packages / list / src / List.styles.js View on Github external
vertical-align: middle;
  outline: none;
  list-style: none;
  border: 1px solid #d9d9d9;
  cursor: pointer;
`;

export const ArrowBlock = styled('div')`
  display: flex;
  justify-content: flex-end;
  > button:not(:last-child) {
    margin-right: 8px;
  }
`;

const hoverTag = createDynamicTag('div');
const filteredHoverTag = removeProps(hoverTag, ['bordered']);
export const HoverRowWrapper = styled(filteredHoverTag)`
  cursor: pointer;
  display: block;
  > .table-gird-row {
    background-color: ${p => getTheme(p.theme, 'colors.white')};
    transition: background-color .2s ease-out;
    will-change: background-color;
  }
  ${p => (p.bordered && css`
    &:not(:last-child) {
      border-bottom: 1px solid ${getTheme(p.theme, 'colors.border')};
    }
    `)}
  &:hover {
    > .table-gird-row {
github lskjs / ux / packages / form / src / controls / ArrayOf / Horizontal / Horizontal.js View on Github external
import styled from 'react-emotion';
import createDynamicTag from '@lskjs/utils/createDynamicTag';
import removeProps from '@lskjs/utils/removeProps';

const dynamicTag = createDynamicTag('div');
const filteredTag = removeProps(dynamicTag, ['verticalAlign', 'align']);
export default styled(filteredTag)`
  display: flex;
  color: inherit;
  text-decoration: none;
  align-items: ${p => (p.verticalAlign || 'flex-start')};
  justify-content: ${p => (p.align || 'flex-start')};
`;
github lskjs / ux / packages / dashboard / UI / molecules / AnimatedLink / AnimatedLink.styles.js View on Github external
import styled, { css } from 'react-emotion';
import Icon from 'antd/lib/icon';
import createDynamicTag from '@lskjs/utils/createDynamicTag';
import removeProps from '@lskjs/utils/removeProps';


const dynamicTag = createDynamicTag('a');
const filteredTag = removeProps(dynamicTag, [
  'paint',
]);

const paintColors = (p) => {
  const { colors } = p.theme;
  switch (p.paint) {
    case 'primary':
      return colors.primary;
    default:
      return colors.default;
  }
};

export const ALink = styled(filteredTag)`
  position: relative;
github lskjs / ux / packages / dashboard / src / molecules / Product / Product.styles.js View on Github external
import styled, { css } from 'react-emotion';
import createDynamicTag from '@lskjs/utils/createDynamicTag';
import getTheme from '@lskjs/theme/getTheme';

const dynamicTag = createDynamicTag('a');

export const CardImage = styled(dynamicTag)`
  display: block;
  text-decoration: none;
  padding: 30px 15px;
  height: 300px;
  border-radius: ${p => getTheme(p.theme, 'borderRadius')} ${p => getTheme(p.theme, 'borderRadius')} 0 0;
  background-color: rgba(0,0,0, .035);
  text-align: center;
`;

export const ItemCard = styled('div')`
  position: relative;
  transition: 0.2s linear;
  border-radius: ${p => getTheme(p.theme, 'borderRadius')};
  &:hover {