Skip to content

Commit

Permalink
feat(icons): adds new icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Firsov committed Nov 6, 2018
1 parent 7272830 commit f8fc7e3
Show file tree
Hide file tree
Showing 15 changed files with 263 additions and 53 deletions.
7 changes: 7 additions & 0 deletions src/atoms/Card/CardSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ type CardSectionProps = {|
children: React$Node,
padding?: PropSizes,
stretch?: boolean,
hoverable?: boolean,
|};

const name = 'cardSection';

const cardSectionTheme = createTheme(name, {
modifiers: {
hoverable: {
cursor: 'pointer',
'&:hover': {
boxShadow: '0 0.2rem 1rem 0 rgba(208, 215, 221, 0.6)',
},
},
stretch: {
display: 'flex',
flex: 1,
Expand Down
5 changes: 4 additions & 1 deletion src/atoms/Grid/GridLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type GridLayoutProps = {|
/** when true then stretch to full width */
stretch?: boolean,
/** possbile spaces between grid items */
gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'none',
gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'none',
/** when true then set inline-grid */
inline?: boolean,
/** possible offsets of the grid layout */
Expand Down Expand Up @@ -43,6 +43,9 @@ const theme = createTheme(name, {
xl: {
gridGap: '3rem',
},
xxl: {
gridGap: '4rem',
},
none: {},
},
padding: {
Expand Down
19 changes: 14 additions & 5 deletions src/atoms/typography/Icon/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from 'react';
import fp from 'lodash/fp';

import { PALETTE } from '../../../theme';
import { SECONDARY_COLORS, MAIN_BRAND_COLORS } from '../../../theme/dsmColors';
import { createStyledTag, createTheme } from '../../../utils';
import type { Theme } from '../../../types';
import * as glyphs from './glyphs';
Expand All @@ -12,7 +13,9 @@ type IconProps = {
/** icon name */
name: string,
/** icon color */
color?: $Keys<typeof PALETTE>,
color?: $Keys<typeof PALETTE>
| $Keys<typeof SECONDARY_COLORS>
| $Keys<typeof MAIN_BRAND_COLORS>,
/** icon size */
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'stretch',
};
Expand All @@ -21,10 +24,16 @@ const name = 'icon';

const theme : Theme<IconProps> = createTheme(name, () => ({
modifiers: {
color: fp.mapValues(
(color) => ({ color }),
PALETTE,
),
color: {
...fp.mapValues(
(color) => ({ color }),
{
...PALETTE,
...SECONDARY_COLORS,
...MAIN_BRAND_COLORS,
},
),
},
size: {
xs: {
width: '1rem',
Expand Down
36 changes: 24 additions & 12 deletions src/atoms/typography/Icon/glyphs/Cloud-Database.svg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions src/atoms/typography/Icon/glyphs/DataBuilder.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 25 additions & 13 deletions src/atoms/typography/Icon/glyphs/Diagram.svg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f8fc7e3

Please sign in to comment.