How to use the @commercetools-uikit/design-system.customProperties.spacingM function in @commercetools-uikit/design-system

To help you get started, we’ve selected a few @commercetools-uikit/design-system 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 commercetools / merchant-center-application-kit / packages / react-notifications / src / components / notification / notification.styles.ts View on Github external
`;

  switch (props.domain) {
    case NOTIFICATION_DOMAINS.GLOBAL:
      return css`
        ${pageStyles};
        background-color: ${getColorByType(props.type)};
      `;
    case NOTIFICATION_DOMAINS.PAGE:
      return pageStyles;
    case NOTIFICATION_DOMAINS.SIDE: {
      const sideStyles = css`
        ${baseStyles};
        animation: ${showNotificationAnimation} 0.3s forwards;
        padding: ${customProperties.spacingM} ${customProperties.spacingM}
          ${customProperties.spacingM} 50px !important;
        text-align: left;
        background: ${customProperties.colorSurface};
        border: 1px solid ${getColorByType(props.type)};
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
        border-radius: ${customProperties.borderRadius6};
        word-break: break-word;
        hyphens: auto; /* still not supported on Chrome */
      `;

      if (props.fixed) return sideStyles;
      return css`
        ${sideStyles};
        animation: ${showNotificationSideAnimation} 0.3s forwards;
        position: relative;
        z-index: 10000;
        margin-top: ${customProperties.spacingL} !important;
github commercetools / ui-kit / src / components / panels / collapsible-panel / collapsible-panel.styles.js View on Github external
Two resource that explain why we need the min-width: 0; here
      By default, min-width is set to 'auto'. That means that this flex-child is not
      allowed to grow any smaller than the longest text inside. So it will stretch
      no matter how you set the flex-grow property
      To fix this you need to set min-width to 0. This tells the flex-child that
      it is ok to be narrower than the longest word inside
      https://hackernoon.com/11-things-i-learned-reading-the-flexbox-spec-5f0c799c776b
      https://css-tricks.com/flexbox-truncated-text/
    */

    min-width: 0;

    > * + * {
      /* would have loved to use Spacings.Inline here but that would require a
    complete overhaul of this components' structure */
      margin: 0 0 0 ${vars.spacingM};
    }
  `;
  if (isDisabled) {
    return [
      baseStyles,
      css`
        cursor: default;
      `,
      !isCondensed &&
        css`
          /**
           We set a min-height of 32px to anticipate use-cases where SecondaryButton or PrimaryButton
           are rendered in the headerControl */
          min-height: ${vars.spacingXl};
        `,
    ];
github commercetools / ui-kit / src / components / grid / grid.example.story.js View on Github external
import { customProperties } from '@commercetools-uikit/design-system';
import Section from '../../../.storybook/decorators/section';
import Spacings from '../spacings';
import Text from '../typography/text';
import Readme from './README.md';
import Grid from './grid';

const createList = size =>
  Array.from({ length: size }).map((_, index) => index + 1);

const Placeholder = styled.div`
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: pink;
  padding: ${customProperties.spacingM};
`;

const renderGridElements = () => {
  const elems = select('Num. of grid elements', createList(20), 6);
  return createList(elems).map((el, index) => (
    
      {el}
    
  ));
};

storiesOf('Examples|Components/Grid', module)
  .addDecorator(withKnobs)
  .addParameters({
    readme: {
      // Show readme at the addons panel
github commercetools / merchant-center-application-kit / packages / application-shell / src / components / quick-access / butler / butler.js View on Github external
// If we don't do this, then the overlay will close when e.g.
            // the search input is clicked.
            event.stopPropagation();
            event.preventDefault();
          }}
        >
          <div>
            <label>
              
            </label>
            </div>
github commercetools / ui-kit / src / components / spacings / stack / stack.styles.js View on Github external
const getMargin = scale => {
  switch (scale) {
    case 'xs':
      return vars.spacingXs;
    case 's':
      return vars.spacingS;
    case 'm':
      return vars.spacingM;
    case 'l':
      return vars.spacingL;
    case 'xl':
      return vars.spacingXl;
    default:
      return 0;
  }
};
github commercetools / merchant-center-application-kit / packages / application-components / src / components / modal-pages / tabular-modal-page / tabular-modal-page.tsx View on Github external
level={props.level}
    title={props.title}
    isOpen={props.isOpen}
    zIndex={props.zIndex}
    onClose={props.onClose}
    baseZIndex={props.baseZIndex}
    topBarColor="neutral"
    currentPathLabel={props.topBarCurrentPathLabel || props.title}
    previousPathLabel={props.topBarPreviousPathLabel}
    getParentSelector={props.getParentSelector}
    shouldDelayOnClose={props.shouldDelayOnClose}
  &gt;
    <div>
      
        {props.customTitleRow || (
          
        )}
        <div>
          </div></div>
github commercetools / ui-kit / src / components / spacings / inset-squish / inset-squish.js View on Github external
const getPadding = scale => {
  switch (scale) {
    case 's':
      return `${vars.spacingXs} ${vars.spacingS}`;
    case 'm':
      return `${vars.spacingS} ${vars.spacingM}`;
    case 'l':
      return `${vars.spacingM} ${vars.spacingXl}`;
    default:
      return 0;
  }
};
github commercetools / ui-kit / src / components / card / card.js View on Github external
css={css`
      display: flex;
      font-size: 1rem;
      flex-direction: column;
      width: 100%;
      box-shadow: ${props.type === 'raised' ? vars.shadow1 : 'none'};
      border-radius: ${vars.borderRadius6};
      background: ${props.theme === 'dark'
        ? vars.colorNeutral95
        : vars.colorSurface};
    `}
    className={props.className}
  &gt;
    <div>
      {props.children}
    </div>
  
);
github commercetools / merchant-center-application-kit / packages / application-shell / src / components / loading-placeholder / loading-placeholder.js View on Github external
const getWidthBySize = props => {
  switch (props.shape) {
    case 'dot':
      switch (props.size) {
        case 's':
          return customProperties.spacingS;
        case 'm':
          return customProperties.spacingM;
        case 'l':
          return customProperties.spacingL;
        case 'xl':
          return customProperties.spacingXl;
        default:
          return 'auto';
      }
    case 'rect':
      switch (props.size) {
        case 's':
          return '150px';
        case 'm':
          return '300px';
        case 'l':
          return '450px';
        case 'xl':
github commercetools / ui-kit / src / components / buttons / primary-button / primary-button.styles.js View on Github external
const getSizeStyles = size => {
  switch (size) {
    case 'small':
      return css`
        border-radius: ${vars.borderRadius4};
        padding: 0 ${vars.spacingS} 0 ${vars.spacingS};
        height: ${vars.smallButtonHeight};
      `;

    case 'big':
      return css`
        padding: 0 ${vars.spacingM} 0 ${vars.spacingM};
        height: ${vars.bigButtonHeight};
        border-radius: ${vars.borderRadius6};
      `;

    default:
      return css``;
  }
};

@commercetools-uikit/design-system

Core package of the commercetools design system.

MIT
Latest version published 10 days ago

Package Health Score

90 / 100
Full package analysis