Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update, cleanup and move necessary dependencies to peerDependencies #485

Merged
merged 26 commits into from
Nov 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
abe5527
fix(configs): automatically deploy Storybook and Docz from CI (#488)
connor-baer Oct 14, 2019
070f408
feat(components): add mobile styles for Messages (#489)
connor-baer Oct 14, 2019
9f1ac55
feat(components): add component context and Link component (#490)
connor-baer Oct 15, 2019
f3d0688
feat(styles): extract static style (#477)
connor-baer Oct 15, 2019
d0bad70
fix(components): pass href to NavItem link (#492)
connor-baer Oct 15, 2019
119e83e
fix(components): prevent interactions on disabled Selector (#493)
connor-baer Oct 15, 2019
fe9b44b
feat(docs): configure Storybook Docs (#495)
connor-baer Oct 25, 2019
e54ce65
fix(components): fix NavItem spacing on Safari (#499)
Oct 28, 2019
2f71e85
fix(docs): update favicon path (#500)
connor-baer Oct 28, 2019
9871c38
feat(docs): migrate to Storybook Docs (#502)
connor-baer Oct 28, 2019
7a197d1
feat(tests): configure StoryShots (#498)
connor-baer Oct 29, 2019
ffc4cef
fix(scripts): fix predeploy script (#503)
Oct 29, 2019
c203b43
fix(docs): import test decorator correctly (#504)
connor-baer Oct 29, 2019
52e29ce
fix(scripts): prevent Storybook from overwriting the static CSS (#505)
connor-baer Oct 31, 2019
ff84f71
fix(components): fix Sidebar Footer padding bug on Safari (#506)
Oct 31, 2019
facc2b5
fix(components): show border styles when CardList.Item component is s…
franzip Nov 2, 2019
ce944f4
fix: use correct license in package.json (#508)
connor-baer Nov 2, 2019
57d3a18
move dependencies, peers and devs
voronianski Oct 4, 2019
ac2f8b9
update snapshots and tests related
voronianski Oct 4, 2019
a3393f2
cleanup warnings + more deps updates
voronianski Oct 4, 2019
0944679
update transition group
voronianski Oct 5, 2019
c4b883e
update leftover dependencies
voronianski Oct 5, 2019
0905fc6
move out foundry deps, update peer deps
voronianski Oct 18, 2019
d88e4db
fix accessibility errors in CloseButton of Sidebar
voronianski Oct 18, 2019
541cd60
fix(configs): fix tests using popper.js
connor-baer Oct 25, 2019
0d54ffd
test(components): update storyshots
connor-baer Nov 9, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
32 changes: 31 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,38 @@
]
]
},
"static": {
"plugins": [
"@babel/plugin-proposal-class-properties",
"lodash",
"inline-react-svg",
"dev-expression",
"react-docgen"
],
"presets": [
[
"@babel/preset-env",
{
"loose": true
}
],
"@babel/preset-react",
[
"@emotion/babel-preset-css-prop",
{
"autoLabel": false,
"labelFormat": "[filename]--[local]"
}
]
]
},
"test": {
"plugins": ["@babel/plugin-proposal-class-properties", "lodash"],
"plugins": [
"@babel/plugin-proposal-class-properties",
"lodash",
"react-docgen",
"macros"
],
"presets": [
[
"@babel/preset-env",
Expand Down
3 changes: 2 additions & 1 deletion .cz-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ module.exports = {
{ name: 'utils' },
{ name: 'docs' },
{ name: 'theme' },
{ name: 'configs' }
{ name: 'configs' },
{ name: 'scripts' }
],

allowCustomScopes: true,
Expand Down
23 changes: 11 additions & 12 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ for bugfixes, minor versions for new features, and major versions for
breaking changes. Our [release process](#Releases) is automated using [semantic-release](https://github.com/semantic-release/semantic-release)
which adheres to the [conventional commit message format](https://www.conventionalcommits.org).

As a result, our changelog is pretty tidy. You can [read our changelog on GitHub](https://github.com/sumup/circuit-ui/releases).
As a result, our changelog is pretty tidy. You can [read our changelog on GitHub](https://github.com/sumup-oss/circuit-ui/releases).

## Bugs

We use the [GitHub issues](https://github.com/sumup/circuit-ui/issues) to track
We use the [GitHub issues](https://github.com/sumup-oss/circuit-ui/issues) to track
all our bugs and feature requests.

When [submitting a new issue](https://github.com/sumup/circuit-ui/issues/new),
When [submitting a new issue](https://github.com/sumup-oss/circuit-ui/issues/new),
please check that it hasn't already been raised by someone else. We've provided
a template for new issues which will help you structure your issue to ensure it
can be picked up and actioned easily.
Expand All @@ -31,7 +31,7 @@ experiencing and what you'd expect to experience.

## Proposing a change

![Component pattern addition](/component-addition-flowchart.png)
![Component pattern addition](https://circuit.sumup.com/images/component-addition-flowchart.png)

### Creating or changing a component

Expand Down Expand Up @@ -105,7 +105,7 @@ yarn fix

While making changes to Circuit UI, you might want to test them in your
application. You can do so by [linking the two projects](https://yarnpkg.com/lang/en/docs/cli/link/)
locally.
locally.

Inside the Circuit UI project folder, run:

Expand All @@ -132,7 +132,7 @@ no longer needed.
the component in use, and proactively communicate with the teams responsible
for those features. Give your reasoning about _why_ you believe the feature
should be deprecated, and discuss the impact on the teams that rely on
that feature today.
that feature today.
2. **Decide on a timeline.** Based on the feedback you receive, come up with
a timeline, including the people who are affected by the change. Generally
speaking, 3-6 months is ample time. Document the planned date of removal
Expand All @@ -155,12 +155,12 @@ to the new component. For example, changing the SideNav component.

## Releases

We have a couple of special branches that are automatically released whenever
We have a couple of special branches that are automatically released whenever
you merge code into them.

- `beta` — This is a branch you can use to test your changes integrated with
other branches before it is ready to be PR'd to `canary`. It is also useful
if you need to deploy the changes somewhere to test them. `beta` is a
if you need to deploy the changes somewhere to test them. `beta` is a
throw-away branch that can be recreated from `canary` at any time.
- `canary` - The step before `master`. This is where we prepare a group of
changes for the next release. Code on `canary` should be tested and stable.
Expand All @@ -185,14 +185,13 @@ To install the most recent version from a release channel, run:
yarn add @sumup/circuit-ui@<release-channel>
```


### Troubleshooting

- **The release failed.** This can happen if you merge multiple times to a
- **The release failed.** This can happen if you merge multiple times to a
release branch in short succession. The first CI job will fail because the
branch on GitHub is ahead of the branch that was checked out in CI.
branch on GitHub is ahead of the branch that was checked out in CI.
`semantic-release` will open an issue to alert you of the failure. You can
simply wait for the last CI job to finish. It should succeed and will
simply wait for the last CI job to finish. It should succeed and will
automatically close the issue.
- **My commit doesn't show in the release notes.** Make sure that your commit
message follows the [conventional commit format](https://www.conventionalcommits.org).
Expand Down
Binary file removed .github/logo.png
Binary file not shown.
19 changes: 19 additions & 0 deletions .storybook/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"plugins": [
"@babel/plugin-proposal-class-properties",
"lodash",
"inline-react-svg",
"macros"
],
"presets": [
["@babel/preset-env", { "loose": true }],
"@babel/preset-react",
[
"@emotion/babel-preset-css-prop",
{
"autoLabel": false,
"labelFormat": "[filename]--[local]"
}
]
]
}
3 changes: 2 additions & 1 deletion .storybook/addons.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import '@storybook/addon-options/register';
import '@storybook/addon-storysource/register';
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';
import '@storybook/addon-jest/register';
import '@storybook/addon-knobs/register';
import '@storybook/addon-a11y/register';
import '@storybook/addon-viewport/register';
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import React from 'react';
import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import { css } from '@emotion/core';
import Text from '../../../../src/components/Text';
import { theme as themes } from '../../../../src';

import { theme as themes, Text } from '../../src';

const Box = styled('div')`
${({ theme, size }) => css`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import { css } from '@emotion/core';
import { ThemeProvider } from 'emotion-theming';
import Text from '../../../../src/components/Text';
import { theme as themes } from '../../../../src';

import { theme as themes, Text } from '../../src';

const Box = styled('div')`
${({ theme, size }) => css`
Expand Down
38 changes: 25 additions & 13 deletions docs/utils/Statuses.js → .storybook/components/Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,37 @@
* limitations under the License.
*/

import React from 'react';
import styled from '@emotion/styled';
import { css } from '@emotion/core';
import Badge from '../../src/components/Badge';
import Text from '../../src/components/Text';

const Stable = () => <Badge color={Badge.SUCCESS}>Stable</Badge>;
import {
Grid as OriginalGrid,
Row as OriginalRow,
Col as OriginalCol
} from '../../src';

const Deprecated = () => <Badge color={Badge.DANGER}>Deprecated</Badge>;

const InReview = () => <Badge color={Badge.WARNING}>In review</Badge>;

const Experimental = () => <Badge color={Badge.NEUTRAL}>Experimental</Badge>;
export const Grid = styled(OriginalGrid)`
${({ theme }) => css`
background-color: ${theme.colors.n100};
`};
`;

const Description = styled(Text)`
export const Row = styled(OriginalRow)`
${({ theme }) => css`
margin-left: ${theme.spacings.byte};
display: inline-block;
color: ${theme.colors.white};
`};
`;

export default { Stable, InReview, Deprecated, Experimental, Description };
export const Col = styled(OriginalCol)`
${({ theme }) => css`
&:nth-of-type(n) {
background-color: ${theme.colors.b500};
}

&:nth-of-type(2n) {
background-color: ${theme.colors.b300};
}
color: ${theme.colors.white};
text-align: center;
`};
`;
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import { css } from '@emotion/core';
import { ThemeProvider } from 'emotion-theming';
import Text from '../../../../src/components/Text';
import { theme as themes } from '../../../../src';

import { theme as themes, Text } from '../../src';

const Box = styled('div')`
${({ theme, size }) => css`
Expand Down
27 changes: 27 additions & 0 deletions .storybook/components/Link.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
import LinkTo from '@storybook/addon-links/react';
import { isStoryName, splitStoryName } from '../util/story-helpers';

import { Text } from '../../src';

const Link = ({ children, href, size, ...props }) => {
const storyName = decodeURIComponent(href);

if (isStoryName(storyName)) {
const [group, component, name = 'page'] = splitStoryName(storyName);
const kind = `${group}|${component}`;
return (
<LinkTo {...props} kind={kind} story={name}>
{children}
</LinkTo>
);
}

return (
<Text as="a" href={href} target="_blank" size={size} {...props}>
{children}
</Text>
);
};

export default Link;
47 changes: 47 additions & 0 deletions .storybook/components/MediaQueriesTable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* Copyright 2019, SumUp Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import React from 'react';
import { withTheme, ThemeProvider } from 'emotion-theming';

import { theme as themes, Table } from '../../src';

const HEADERS = ['Breakpoint name', 'Query'];

const renderBreakpoint = bp => {
if (typeof bp === 'number') {
return `(min-width: ${bp.toString()}px)`;
}

return bp;
};

const TableWrapper = withTheme(({ theme }) => (
<Table
headers={HEADERS}
rows={Object.keys(theme.breakpoints).map(bp => [
bp,
renderBreakpoint(theme.breakpoints[bp])
])}
/>
));

const MediaQueriesTable = () => (
<ThemeProvider theme={themes.circuit}>
<TableWrapper />
</ThemeProvider>
);

export default MediaQueriesTable;
32 changes: 8 additions & 24 deletions docs/utils/Wrapper.js → .storybook/components/Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,16 @@
*/

import React from 'react';
import PropTypes from 'prop-types';
import { Preview as StorybookPreview } from '@storybook/addon-docs/blocks';
import { ThemeProvider } from 'emotion-theming';
import { Global, css } from '@emotion/core';
import { BaseStyles, theme as themes } from '../../src/index';

const styles = css`
div[class^='Sidebar__Footer'] {
display: none;
}
import { theme as themes } from '../../src';

b,
strong {
font-weight: 700;
}
`;

const Wrapper = props => (
<ThemeProvider theme={themes.circuit}>
<BaseStyles />
<Global styles={styles} />
{props.children}
</ThemeProvider>
// eslint-disable-next-line react/prop-types
const Preview = ({ children, ...props }) => (
<StorybookPreview {...props}>
<ThemeProvider theme={themes.circuit}>{children}</ThemeProvider>
</StorybookPreview>
);

Wrapper.propTypes = {
children: PropTypes.children
};

export default Wrapper;
export default Preview;
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import PropTypes from 'prop-types';
import styled from '@emotion/styled';
import { css } from '@emotion/core';
import { ThemeProvider } from 'emotion-theming';
import Text from '../../../../src/components/Text';
import { theme as themes } from '../../../../src';

import { theme as themes, Text } from '../../src';

const Box = styled('div')`
${({ theme, spacingName }) => css`
Expand Down
Loading