Skip to content

Commit 0109606

Browse files
Andrey Okonetchnikovsapegin
Andrey Okonetchnikov
authored andcommitted
Revert prettier config changes
1 parent 39ebaf2 commit 0109606

File tree

17 files changed

+147
-274
lines changed

17 files changed

+147
-274
lines changed

.prettierrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
{
77
"files": "*.md",
88
"options": {
9-
"printWidth": 80,
9+
"printWidth": 70,
1010
"useTabs": false,
1111
"trailingComma": "none",
12-
"proseWrap": "always"
12+
"proseWrap": "never"
1313
}
1414
}
1515
]

docs/Foundation.md

+4-13
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
Colors, spacing, and typography are the building blocks of the design system and
2-
are often referred to as design tokens. Design tokens are named entities that
3-
store visual design attributes.
1+
Colors, spacing, and typography are the building blocks of the design system and are often referred to as design tokens. Design tokens are named entities that store visual design attributes.
42

5-
Those values are accessible in the app via
6-
[ThemeProvider](https://github.com/component-driven/component-driven-development/blob/master/src/ThemeProvider.js)
7-
and the `theme` object. To ensure consistency, always use values from the
8-
`theme` object, instead of hardcoded values.
3+
Those values are accessible in the app via [ThemeProvider](https://github.com/component-driven/component-driven-development/blob/master/src/ThemeProvider.js) and the `theme` object. To ensure consistency, always use values from the `theme` object, instead of hardcoded values.
94

105
For example:
116

@@ -20,9 +15,7 @@ const Message = styled.p`
2015
`;
2116
```
2217

23-
_Prefer_ the [Text](/#/Primitives?id=text) and
24-
[Heading](/#/Primitives?id=heading) components to render any text inside the
25-
app:
18+
_Prefer_ the [Text](/#/Primitives?id=text) and [Heading](/#/Primitives?id=heading) components to render any text inside the app:
2619

2720
```diff
2821
- const Small = styled.p`
@@ -33,6 +26,4 @@ app:
3326
+ <Text variant="secondary">Oh dear! Oh dear! I shall be late!</Text>
3427
```
3528

36-
Check out the
37-
[theme.js](https://github.com/component-driven/component-driven-development/blob/master/src/theme.js)
38-
file for all available design tokens.
29+
Check out the [theme.js](https://github.com/component-driven/component-driven-development/blob/master/src/theme.js) file for all available design tokens.

src/components/patterns/Hero/Hero.md

+18-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import Heading from '../../primitives/Heading';
66
backgroundImage="url(https://source.unsplash.com/TBw3iQGdwbg/1000x600)"
77
py={6}
88
>
9-
<Heading level={2}>The quick brown fox jumps over the lazy dog</Heading>
9+
<Heading level={2}>
10+
The quick brown fox jumps over the lazy dog
11+
</Heading>
1012
</Hero>;
1113
```
1214

@@ -60,13 +62,21 @@ import Text from '../../primitives/Text';
6062
import { Inverted } from '../../../ThemeProvider';
6163
<Inverted>
6264
<Hero backgroundImage="url(https://source.unsplash.com/cGlac7MEyiE/1000x600)">
63-
<Flex justifyContent={['center', 'space-between']} flexWrap="wrap">
65+
<Flex
66+
justifyContent={['center', 'space-between']}
67+
flexWrap="wrap"
68+
>
6469
<Box width={[1, 'auto']} mb={2}>
6570
<Text as="h1">
6671
<Link href="/">Rent-o-dog</Link>
6772
</Text>
6873
</Box>
69-
<Stack justifyContent="center" gridAutoFlow="column" gridGap={4} mb={2}>
74+
<Stack
75+
justifyContent="center"
76+
gridAutoFlow="column"
77+
gridGap={4}
78+
mb={2}
79+
>
7080
<Text>
7181
<Link href="/">Our dogs</Link>
7282
</Text>
@@ -82,7 +92,11 @@ import { Inverted } from '../../../ThemeProvider';
8292
<Heading level={2} size="xl" mb={5}>
8393
The quick black fox jumps over the lazy dog
8494
</Heading>
85-
<Stack justifyContent="center" gridAutoFlow="column" girdGap={4}>
95+
<Stack
96+
justifyContent="center"
97+
gridAutoFlow="column"
98+
girdGap={4}
99+
>
86100
<Button variant="primary">Try now</Button>
87101
<Button variant="secondary">Try later</Button>
88102
</Stack>

src/components/patterns/Rating/Rating.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Rating should be used when we want to promote a specific piece of content in
2-
order to democratically help decide what content is of higher quality.
1+
Rating should be used when we want to promote a specific piece of content in order to democratically help decide what content is of higher quality.
32

43
```js
54
<Rating value={1} />

src/components/patterns/Readme.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
User Interface Design patterns are recurring solutions that solve common design
2-
problems. Design patterns are standard reference points for the experienced user
3-
interface designer.
1+
User Interface Design patterns are recurring solutions that solve common design problems. Design patterns are standard reference points for the experienced user interface designer.
42

5-
With the component-driven approach now we can also encapsulate design solutions
6-
into code and to deliver consistent user experience much faster!
3+
With the component-driven approach now we can also encapsulate design solutions into code and to deliver consistent user experience much faster!
74

8-
UI patterns oftentime have a structure that defined the problem, shows examples
9-
of the solution, and provides guidance on the usage.
5+
UI patterns oftentime have a structure that defined the problem, shows examples of the solution, and provides guidance on the usage.
106

117
For the simplcity, in this demo app we have just a few UI patterns.

src/components/patterns/SubscriptionForm/SubscriptionForm.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
Subscription form should be used to gather emails of users who are interested in
2-
the newlestter.
1+
Subscription form should be used to gather emails of users who are interested in the newlestter.
32

4-
The component implements different states that can be activated during the
5-
process.
3+
The component implements different states that can be activated during the process.
64

75
### Normal
86

src/components/primitives/Box/Box.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
Box is the simplest _layout primitive_. By default it renders a `div` element
2-
but you can specify the HTML tag using `as` prop.
1+
Box is the simplest _layout primitive_. By default it renders a `div` element but you can specify the HTML tag using `as` prop.
32

43
Box allows controlling its whitespace, layout, colors, etc. using design tokens.
54

6-
Following example should render a `div` that has `width: 25%`, `padding`,
7-
`margin`, and `background-color` values set.
5+
Following example should render a `div` that has `width: 25%`, `padding`, `margin`, and `background-color` values set.
86

97
```jsx harmony
108
<Box p={4} m={3} width={1 / 4} bg="muted">

src/components/primitives/Card/Card.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
Card component is a component that renders an image, a body and a footer with a
2-
specific layout.
1+
Card component is a component that renders an image, a body and a footer with a specific layout.
32

4-
By using subcomponents `Card.Cover`, `Card.Body` and `Card.Footer` users can
5-
create different kinds of card for different use cases, because all
6-
subcomponents are optional and the card look good with any combination of them.
3+
By using subcomponents `Card.Cover`, `Card.Body` and `Card.Footer` users can create different kinds of card for different use cases, because all subcomponents are optional and the card look good with any combination of them.
74

85
```jsx harmony
96
import Box from '../Box';

src/components/primitives/Readme.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Primitives are building blocks of your application. Since primitives can be used
2-
anywhere in the UI they should be agnostic of their environment.
1+
Primitives are building blocks of your application. Since primitives can be used anywhere in the UI they should be agnostic of their environment.
32

43
This means primitives:
54

src/components/primitives/Stack/Stack.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import Button from '../Button';
1010
</Stack>;
1111
```
1212

13-
Since Stack is based on [Grid](/#/Primitives?id=grid), all of `Grid` props are
14-
available:
13+
Since Stack is based on [Grid](/#/Primitives?id=grid), all of `Grid` props are available:
1514

1615
```javascript
1716
import Button from '../Button';

src/exercises/1-Introduction/Readme.md

+6-15
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,19 @@ In this exercise we’ll learn basics of React Styleguidist.
22

33
## 1.1. Exploring React Styleguidist
44

5-
[React Styleguidist](https://react-styleguidist.js.org/) is a tool we’re using
6-
as a workbench to develop components, and to generate a style guide.
5+
[React Styleguidist](https://react-styleguidist.js.org/) is a tool we’re using as a workbench to develop components, and to generate a style guide.
76

87
### The task
98

10-
1. Explore React Styleguidist interface, try to switch to isolated mode (a
11-
button in the top right corner), try to edit code of the examples in the
12-
browser.
9+
1. Explore React Styleguidist interface, try to switch to isolated mode (a button in the top right corner), try to edit code of the examples in the browser.
1310

14-
2. Edit examples in the `Button.md` file, add a new example. See how examples in
15-
the browser update.
11+
2. Edit examples in the `Button.md` file, add a new example. See how examples in the browser update.
1612

17-
3. Edit a component source in the `Button.js` file. See how all examples update
18-
every time you save a file.
13+
3. Edit a component source in the `Button.js` file. See how all examples update every time you save a file.
1914

20-
4. Edit component’s `PropTypes` definition. See how “Props & methods” section
21-
reacts to the updates.
15+
4. Edit component’s `PropTypes` definition. See how “Props & methods” section reacts to the updates.
2216

23-
5. Add a new component and an example Markdown file in the
24-
`src/exercises/1-Introduction` folder (both, `.js` and `.md`, files should
25-
have the same name) and see how it’s automatically added to the style guide
26-
(restart the style guide if the new component doesn’t appear).
17+
5. Add a new component and an example Markdown file in the `src/exercises/1-Introduction` folder (both, `.js` and `.md`, files should have the same name) and see how it’s automatically added to the style guide (restart the style guide if the new component doesn’t appear).
2718

2819
<details>
2920
<summary>Solution</summary>

src/exercises/2-Design_Tokens/Readme.md

+7-17
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,17 @@ In this exercise we’ll learn basics of React Styleguidist.
22

33
## 2.1. What are design tokens?
44

5-
Design tokens are the single source of truth for project’s colors, whitespace,
6-
font styles and other design decisions.
5+
Design tokens are the single source of truth for project’s colors, whitespace, font styles and other design decisions.
76

8-
We’ve prepared the basic structure for the design tokens file. Open the
9-
`theme.js` in the exercise directory (`src/exercises/2-Design_Tokens/theme.js`).
7+
We’ve prepared the basic structure for the design tokens file. Open the `theme.js` in the exercise directory (`src/exercises/2-Design_Tokens/theme.js`).
108

119
### The task
1210

13-
1. Add a few colors to the `theme.js` and see how the style guide going to
14-
render them.
15-
1. Add a palette of grey colors to the `colors` object (_hint_: Use `Array` for
16-
that).
17-
1. Change spacing scale to see how swatches react to this change. Continue with
18-
other values.
19-
1. Update design tokens to fit our design
20-
(https://www.figma.com/file/cALZfCbmthI9VQz9MJR6JdPk/CDD-Workshop?node-id=1%3A2
21-
&
22-
https://www.figma.com/file/cALZfCbmthI9VQz9MJR6JdPk/CDD-Workshop?node-id=1%3A40)
23-
1. Check out
24-
[design tokens](https://cdds.netlify.com/styleguide/#/Foundation?id=colors)
25-
from the final style guide.
11+
1. Add a few colors to the `theme.js` and see how the style guide going to render them.
12+
1. Add a palette of grey colors to the `colors` object (_hint_: Use `Array` for that).
13+
1. Change spacing scale to see how swatches react to this change. Continue with other values.
14+
1. Update design tokens to fit our design (https://www.figma.com/file/cALZfCbmthI9VQz9MJR6JdPk/CDD-Workshop?node-id=1%3A2 & https://www.figma.com/file/cALZfCbmthI9VQz9MJR6JdPk/CDD-Workshop?node-id=1%3A40)
15+
1. Check out [design tokens](https://cdds.netlify.com/styleguide/#/Foundation?id=colors) from the final style guide.
2616

2717
## Colors
2818

0 commit comments

Comments
 (0)