Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #42 from contra/juls/id-631-icons-refactor-ui-kit-…
Browse files Browse the repository at this point in the history
…updates
  • Loading branch information
erictaylor committed Dec 17, 2021
2 parents df1f9dc + b392f59 commit 1b7f9d9
Show file tree
Hide file tree
Showing 7 changed files with 7,338 additions and 251 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.13
4 changes: 4 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
};
9 changes: 9 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
};
2 changes: 1 addition & 1 deletion bin/build-cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const sharedConfig = {
platform: 'node',
sourcemap: true,
bundle: true,
external: ['react', 'react-dom'],
external: ['react', 'react-dom', '@stitches/react'],
target: ['node12'],
inject: ['./bin/util/react-shim.js'],
};
Expand Down
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,26 @@
"build": "yarn build:esm && yarn build:cjs",
"build:cjs": "node ./bin/build-cjs.js",
"build:esm": "yarn tsc --project tsconfig.build.json",
"build:storybook": "build-storybook",
"check:package": "yarn package-check",
"check:tsc": "yarn tsc --noEmit",
"generate:colors": "node ./scripts/dist/generateColors",
"generate:icons": "node ./scripts/dist/generateIcons",
"generate:textStyles": "node ./scripts/dist/generateTextStyles",
"lint": "eslint src",
"prepare": "husky install",
"storybook": "start-storybook -p 6007",
"test": "yarn jest"
},
"devDependencies": {
"@babel/core": "^7.16.0",
"@commitlint/cli": "^14.1.0",
"@commitlint/config-conventional": "^14.1.0",
"@skypack/package-check": "^0.2.2",
"@storybook/addon-actions": "^6.3.12",
"@storybook/addon-essentials": "^6.3.12",
"@storybook/addon-links": "^6.3.12",
"@storybook/react": "^6.3.12",
"@svgr/core": "^5.5.0",
"@svgr/plugin-jsx": "^5.5.0",
"@svgr/plugin-prettier": "^5.5.0",
Expand All @@ -53,6 +60,7 @@
"@types/prettier": "^2.4.2",
"@types/react": "^17.0.34",
"@types/react-dom": "^17.0.11",
"babel-loader": "^8.2.3",
"camelcase": "^6.2.0",
"esbuild": "^0.13.13",
"eslint": "^7.32.0",
Expand All @@ -76,5 +84,7 @@
"peerDependencies": {
"react": "^16.14.0 || ^17.0.0"
},
"dependencies": {}
"dependencies": {
"@stitches/react": "^1.2.5"
}
}
42 changes: 42 additions & 0 deletions src/icons/stories/Icons.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import * as Icons from '../.';
import { styled } from '@stitches/react';

const IconsWrapper = styled('div', {
display: 'flex',
width: '100%',
flexFlow: 'row wrap',
});

const IconContainer = styled('div', {
display: 'flex',
flexFlow: 'column',
alignItems: 'center',
fontSize: '1rem',
color: 'Black',
backgroundColor: 'White',
borderRadius: '20px',
padding: '16px',
margin: '24px',
boxShadow: '0px 0px 20px rgba(0, 0, 0, 0.16)',
'& > *': {
marginBottom: '8px',
},
});

export const AllIcons = () => (
<IconsWrapper>
{Object.entries(Icons)
.sort(([a], [b]) => a.localeCompare(b))
.map(([iconName, Icon]) => (
<IconContainer key={iconName}>
<Icon height="32px" width="32px" />
{iconName}
</IconContainer>
))}
</IconsWrapper>
);

export default {
title: 'Icons',
component: AllIcons,
};
Loading

0 comments on commit 1b7f9d9

Please sign in to comment.