Skip to content
This repository was archived by the owner on Mar 8, 2023. It is now read-only.

Commit 4c96411

Browse files
authored
Merge pull request #59 from strapi/new-ui
New ui
2 parents 2cd71b6 + 918c5ef commit 4c96411

File tree

17 files changed

+72
-22
lines changed

17 files changed

+72
-22
lines changed

docs/stories/customComponents/Inputs.stories.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@ function InputStory() {
135135
<form onSubmit={() => {}}>
136136
<div className="row">
137137
{Object.keys(form).map(input => (
138-
<div className={form[input].styleName} key={input}>
138+
<div
139+
className={form[input].styleName}
140+
key={input}
141+
style={{ marginBottom: 4 }}
142+
>
139143
<Inputs
140144
customInputs={{ custom: Foo }}
141145
name={input}

docs/stories/icons/icons.stories.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import React, { useState } from 'react';
1+
import React from 'react';
22
/* eslint-disable import/no-extraneous-dependencies */
33
import { storiesOf } from '@storybook/react';
44
import {
5+
Arrow,
56
Grab,
67
GrabLarge,
78
Pencil,
@@ -27,6 +28,10 @@ import Pre from '../ui/Pre';
2728

2829
const IconsStory = () => {
2930
const icons = [
31+
{
32+
name: 'arrow',
33+
Compo: Arrow,
34+
},
3035
{
3136
name: 'bool',
3237
Compo: Bool,

docs/stories/ui/Global.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ body {
1616
}
1717
section div {
1818
&.row {
19-
margin-bottom: ${sizes.margin * 1.8}px;
19+
margin-bottom: ${sizes.margin * 2}px;
2020
}
2121
&.btn-wrapper {
2222
display: inline-block;

packages/buffetjs-custom/src/components/Inputs/Wrapper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import { colors, sizes } from '@buffetjs/styles';
99

1010
const Wrapper = styled.div`
1111
position: relative;
12-
padding-bottom: ${sizes.margin * 2.7}px;
12+
padding-bottom: ${sizes.margin * 2.3}px;
1313
label {
1414
display: block;
15-
margin-bottom: 1rem;
15+
margin-bottom: 1rem;
1616
}
1717
> p {
1818
width 100%;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
4+
const Arrow = props => (
5+
<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg" {...props}>
6+
<path
7+
d="M8.70908786,0.724302898 C8.70908786,0.79993292 8.67999939,0.8668364 8.62182245,0.92501334 L4.55525437,4.99158142 C4.49707743,5.04975836 4.43017395,5.07884683 4.35454393,5.07884683 C4.27891391,5.07884683 4.21201043,5.04975836 4.15383349,4.99158142 L0.0872654094,0.92501334 C0.0290884698,0.8668364 1.15463195e-14,0.79993292 1.15463195e-14,0.724302898 C1.15463195e-14,0.648672877 0.0290884698,0.581769396 0.0872654094,0.523592457 L0.523592457,0.0872654094 C0.581769396,0.0290884698 0.648672877,6.17284002e-14 0.724302898,6.17284002e-14 C0.79993292,6.17284002e-14 0.8668364,0.0290884698 0.92501334,0.0872654094 L4.35454393,3.516796 L7.78407452,0.0872654094 C7.84225146,0.0290884698 7.90915494,6.17284002e-14 7.98478496,6.17284002e-14 C8.06041499,6.17284002e-14 8.12731847,0.0290884698 8.18549541,0.0872654094 L8.62182245,0.523592457 C8.67999939,0.581769396 8.70908786,0.648672877 8.70908786,0.724302898 Z"
8+
id="Path"
9+
fillRule="nonzero"
10+
transform="translate(4.354544, 2.539423) scale(-1, -1) translate(-4.354544, -2.539423) "
11+
></path>
12+
<rect id="Rectangle" x="3.8" y="1" width="1.2" height="8" rx="0.2"></rect>
13+
</svg>
14+
);
15+
16+
Arrow.defaultProps = {
17+
fill: '#fff',
18+
};
19+
20+
Arrow.propTypes = {
21+
fill: PropTypes.string,
22+
};
23+
24+
export default Arrow;

packages/buffetjs-icons/src/components/Remove/Icon.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/buffetjs-icons/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export { default as Arrow } from './components/Arrow';
12
export { default as Bool } from './components/Bool';
23
export { default as Calendar } from './components/Calendar';
34
export { default as ContentType } from './components/ContentType';

packages/buffetjs-styles/src/assets/styles/colors.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const colors = {
1010
brightGrey: '#9ea7b8',
1111
lightGrey: '#E3E9F3',
1212
lightGreyAlpha: 'rgba(0,0,0,0.1)',
13+
orange: '#F64D0A',
1314
darkOrange: '#F64D0A',
1415
orangeBorder: 'rgba(255, 0, 0, 0.2)',
1516
orangeBkgd: 'rgba(255, 0, 0, 0.15)',

packages/buffetjs-styles/src/assets/styles/sizes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const sizes = {
33
desktop: '1024px',
44
wide: '1280px',
55
margin: '10',
6-
radius: '3px',
6+
radius: '2px',
77
button: {
88
height: {
99
small: '26px',

packages/buffetjs-styles/src/components/Button/PrefixIcon.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import sizes from '../../assets/styles/sizes';
44
import Icon from '../Icon';
55

66
const PrefixIcon = styled(Icon)`
7-
margin-right: ${sizes.margin * 0.8}px;
7+
margin-right: ${sizes.margin}px;
88
font-size: 0.94em;
99
`;
1010

packages/buffetjs-styles/src/components/Button/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ const Button = styled.button`
3232
&:active {
3333
${mixins(colors.lightGreyAlpha).bshadow};
3434
}
35+
&:focus {
36+
outline: 0;
37+
}
3538
3639
// Specific style
3740
${props =>
@@ -73,9 +76,9 @@ const Button = styled.button`
7376
${props =>
7477
props.color === 'delete' &&
7578
`
76-
border: 1px solid ${colors.orangeBorder};
77-
background-color: ${colors.orangeBkgd};
78-
color: ${colors.darkOrange};
79+
border: 1px solid ${colors.orange};
80+
background-color: ${colors.orange};
81+
color: ${colors.white};
7982
padding: 0 ${sizes.button.padding.small};
8083
`}
8184

packages/buffetjs-styles/src/components/Button/tests/__snapshots__/index.test.js.snap

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exports[`<Button /> <Button /> icons should render a custom icon 1`] = `
77
font-weight: 500;
88
font-size: 1.3rem;
99
line-height: normal;
10-
border-radius: 3px;
10+
border-radius: 2px;
1111
cursor: pointer;
1212
outline: 0;
1313
background-color: #ffffff;
@@ -28,6 +28,10 @@ exports[`<Button /> <Button /> icons should render a custom icon 1`] = `
2828
box-shadow: inset 0 0 30px [object Object];
2929
}
3030
31+
.c0:focus {
32+
outline: 0;
33+
}
34+
3135
.c0:disabled {
3236
background-color: red;
3337
}
@@ -51,7 +55,7 @@ exports[`<Button /> <Button /> icons should render the add icon 1`] = `
5155
font-weight: 500;
5256
font-size: 1.3rem;
5357
line-height: normal;
54-
border-radius: 3px;
58+
border-radius: 2px;
5559
cursor: pointer;
5660
outline: 0;
5761
background-color: #ffffff;
@@ -72,6 +76,10 @@ exports[`<Button /> <Button /> icons should render the add icon 1`] = `
7276
box-shadow: inset 0 0 30px [object Object];
7377
}
7478
79+
.c0:focus {
80+
outline: 0;
81+
}
82+
7583
.c0:disabled {
7684
background-color: red;
7785
}
@@ -95,7 +103,7 @@ exports[`<Button /> <Button /> icons should render the add trash 1`] = `
95103
font-weight: 500;
96104
font-size: 1.3rem;
97105
line-height: normal;
98-
border-radius: 3px;
106+
border-radius: 2px;
99107
cursor: pointer;
100108
outline: 0;
101109
background-color: #ffffff;
@@ -116,6 +124,10 @@ exports[`<Button /> <Button /> icons should render the add trash 1`] = `
116124
box-shadow: inset 0 0 30px [object Object];
117125
}
118126
127+
.c0:focus {
128+
outline: 0;
129+
}
130+
119131
.c0:disabled {
120132
background-color: red;
121133
}

packages/buffetjs-styles/src/components/Button/tests/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe('<Button />', () => {
8585

8686
it('should render the delete style', () => {
8787
const tree = renderer.create(<Button color="delete" />).toJSON();
88-
expect(tree).toHaveStyleRule('color', colors.darkOrange);
88+
expect(tree).toHaveStyleRule('color', colors.white);
8989
});
9090
});
9191
});

packages/buffetjs-styles/src/components/Header/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Header = styled.div`
1010
margin-bottom: 30px;
1111
position: relative;
1212
width: 100%;
13-
height: 40px;
13+
height: 50px;
1414
.justify-content-end {
1515
display: flex;
1616
}

packages/buffetjs-styles/src/components/Header/tests/__snapshots__/index.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`<Header /> snapshot 1`] = `
55
margin-bottom: 30px;
66
position: relative;
77
width: 100%;
8-
height: 40px;
8+
height: 50px;
99
}
1010
1111
.c0 .justify-content-end {

packages/buffetjs-styles/src/components/Toggle/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const Toggle = styled.input`
2121
& + span {
2222
border-top-left-radius: 2px;
2323
border-bottom-left-radius: 2px;
24-
background-image: ${colors.orangeGradient};
24+
background-color: ${colors.darkOrange};
2525
color: ${colors.white};
2626
& + span {
2727
color: ${colors.greyToggle};
@@ -37,7 +37,7 @@ const Toggle = styled.input`
3737
& + span {
3838
border-top-right-radius: 2px;
3939
border-bottom-right-radius: 2px;
40-
background-image: ${colors.blueGradient};
40+
background-color: ${colors.blue};
4141
color: ${colors.white};
4242
font-weight: 800;
4343
}

0 commit comments

Comments
 (0)