@inc2734/unitone-css 0.46.5 → 0.47.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.css +1 -1
- package/dist/app.js +1 -1
- package/dist/index.js +1 -0
- package/dist/library.js +1 -0
- package/dist/storybook.css +1 -1
- package/package.json +27 -17
- package/src/app.js +5 -132
- package/src/foundation/_foundation.scss +7 -1
- package/src/index.js +1 -0
- package/src/layout-primitives/both-sides/README.md +96 -7
- package/src/layout-primitives/both-sides/stories/index.stories.jsx +2 -5
- package/src/layout-primitives/center/README.md +85 -21
- package/src/layout-primitives/center/stories/index.stories.jsx +2 -2
- package/src/layout-primitives/cluster/README.md +87 -4
- package/src/layout-primitives/cluster/stories/index.stories.jsx +1 -1
- package/src/layout-primitives/container/README.md +73 -19
- package/src/layout-primitives/container/stories/index.stories.jsx +2 -2
- package/src/layout-primitives/cover/README.md +144 -18
- package/src/layout-primitives/cover/_cover.scss +24 -24
- package/src/layout-primitives/cover/index.jsx +63 -0
- package/src/layout-primitives/cover/stories/index.stories.jsx +20 -19
- package/src/layout-primitives/decorator/README.md +134 -12
- package/src/layout-primitives/decorator/stories/index.stories.jsx +2 -2
- package/src/layout-primitives/float/README.md +93 -2
- package/src/layout-primitives/float/stories/index.stories.jsx +3 -3
- package/src/layout-primitives/frame/README.md +53 -1
- package/src/layout-primitives/frame/stories/index.stories.jsx +1 -1
- package/src/layout-primitives/gutters/README.md +35 -11
- package/src/layout-primitives/gutters/stories/index.stories.jsx +4 -4
- package/src/layout-primitives/index.js +17 -0
- package/src/layout-primitives/layers/README.md +240 -4
- package/src/layout-primitives/layers/{Layers.jsx → index.jsx} +16 -1
- package/src/layout-primitives/layers/stories/index.stories.jsx +32 -2
- package/src/layout-primitives/reel/README.md +81 -28
- package/src/layout-primitives/reel/stories/index.stories.jsx +3 -3
- package/src/layout-primitives/responsive-grid/README.md +103 -8
- package/src/layout-primitives/responsive-grid/{ResponsiveGrid.jsx → index.jsx} +2 -1
- package/src/layout-primitives/responsive-grid/stories/index.stories.jsx +187 -26
- package/src/layout-primitives/stack/README.md +61 -2
- package/src/layout-primitives/stack/_stack.scss +2 -0
- package/src/layout-primitives/stack/stories/index.stories.jsx +3 -3
- package/src/layout-primitives/switcher/README.md +60 -4
- package/src/layout-primitives/switcher/stories/index.stories.jsx +2 -2
- package/src/layout-primitives/text/README.md +117 -2
- package/src/layout-primitives/text/stories/index.stories.jsx +13 -3
- package/src/layout-primitives/vertical-writing/README.md +96 -3
- package/src/layout-primitives/vertical-writing/stories/index.stories.jsx +2 -2
- package/src/layout-primitives/with-sidebar/README.md +136 -3
- package/src/layout-primitives/with-sidebar/stories/index.stories.jsx +4 -7
- package/src/library.js +132 -0
- package/src/patterns/features/features-1/Features1.jsx +9 -7
- package/src/patterns/features/features-2/Features2.jsx +1 -6
- package/src/patterns/header/header-1/Header1.jsx +10 -7
- package/src/patterns/header/header-2/Header2.jsx +1 -6
- package/src/patterns/header/header-3/Header3.jsx +1 -6
- package/src/patterns/header/header-4/Header4.jsx +9 -6
- package/src/patterns/header/header-5/Header5.jsx +9 -6
- package/src/patterns/header/header-6/Header6.jsx +10 -7
- package/src/patterns/media-text/media-text-1/MediaText1.jsx +9 -6
- package/src/patterns/media-text/media-text-2/MediaText2.jsx +8 -5
- package/src/settings/_root.scss +8 -8
- package/src/stories/1.introduction.stories.mdx +37 -4
- package/src/stories/2.get-started.stories.mdx +28 -2
- package/src/stories/3.global-api.stories.mdx +26 -22
- package/src/stories/4.global-css-variables.stories.mdx +198 -0
- package/src/variables/_variables.scss +2 -0
- package/src/layout-primitives/cover/Cover.jsx +0 -41
- /package/src/layout-primitives/both-sides/{BothSides.jsx → index.jsx} +0 -0
- /package/src/layout-primitives/center/{Center.jsx → index.jsx} +0 -0
- /package/src/layout-primitives/cluster/{Cluster.jsx → index.jsx} +0 -0
- /package/src/layout-primitives/container/{Container.jsx → index.jsx} +0 -0
- /package/src/layout-primitives/decorator/{Decorator.jsx → index.jsx} +0 -0
- /package/src/layout-primitives/float/{Float.jsx → index.jsx} +0 -0
- /package/src/layout-primitives/frame/{Frame.jsx → index.jsx} +0 -0
- /package/src/layout-primitives/gutters/{Gutters.jsx → index.jsx} +0 -0
- /package/src/layout-primitives/reel/{Reel.jsx → index.jsx} +0 -0
- /package/src/layout-primitives/stack/{Stack.jsx → index.jsx} +0 -0
- /package/src/layout-primitives/switcher/{Switcher.jsx → index.jsx} +0 -0
- /package/src/layout-primitives/text/{Text.jsx → index.jsx} +0 -0
- /package/src/layout-primitives/vertical-writing/{VerticalWriting.jsx → index.jsx} +0 -0
- /package/src/layout-primitives/with-sidebar/{WithSidebar.jsx → index.jsx} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import readme from '../README.md';
|
|
3
3
|
|
|
4
|
-
import { ResponsiveGrid } from '../
|
|
5
|
-
import { Stack } from '../../stack
|
|
4
|
+
import { ResponsiveGrid } from '../';
|
|
5
|
+
import { Stack } from '../../stack';
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
title: 'Layout Primitives/ResponsiveGrid',
|
|
@@ -31,11 +31,19 @@ export default {
|
|
|
31
31
|
table: { defaultValue: { summary: 'auto-fill' } },
|
|
32
32
|
type: { name: 'string', required: false },
|
|
33
33
|
},
|
|
34
|
+
divider: {
|
|
35
|
+
control: { type: 'inline-radio' },
|
|
36
|
+
description: 'Divider. Set by `data-unitone-layout` attribute `-divider:x`.',
|
|
37
|
+
options: [undefined, 'stripe', 'underline', 'bordered'],
|
|
38
|
+
table: { defaultValue: { summary: false } },
|
|
39
|
+
type: { name: 'boolean', required: false },
|
|
40
|
+
},
|
|
34
41
|
},
|
|
35
42
|
args: {
|
|
36
43
|
columnMinWidth: '240px',
|
|
37
44
|
gap: 2,
|
|
38
45
|
autoRepeat: 'auto-fill',
|
|
46
|
+
divider: undefined,
|
|
39
47
|
},
|
|
40
48
|
};
|
|
41
49
|
|
|
@@ -44,30 +52,183 @@ const content = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit';
|
|
|
44
52
|
export const Default = (args) => {
|
|
45
53
|
return (
|
|
46
54
|
<ResponsiveGrid {...args}>
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
</
|
|
59
|
-
<
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</
|
|
55
|
+
<div>
|
|
56
|
+
<Stack gap={-2}>
|
|
57
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
58
|
+
<p>{content}</p>
|
|
59
|
+
</Stack>
|
|
60
|
+
</div>
|
|
61
|
+
<div>
|
|
62
|
+
<Stack gap={-2}>
|
|
63
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
64
|
+
<p>{content}</p>
|
|
65
|
+
</Stack>
|
|
66
|
+
</div>
|
|
67
|
+
<div>
|
|
68
|
+
<Stack gap={-2}>
|
|
69
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
70
|
+
<p>{content}</p>
|
|
71
|
+
</Stack>
|
|
72
|
+
</div>
|
|
73
|
+
<div>
|
|
74
|
+
<Stack gap={-2}>
|
|
75
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
76
|
+
<p>{content}</p>
|
|
77
|
+
</Stack>
|
|
78
|
+
</div>
|
|
79
|
+
<div>
|
|
80
|
+
<Stack gap={-2}>
|
|
81
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
82
|
+
<p>{content}</p>
|
|
83
|
+
</Stack>
|
|
84
|
+
</div>
|
|
85
|
+
<div>
|
|
86
|
+
<Stack gap={-2}>
|
|
87
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
88
|
+
<p>{content}</p>
|
|
89
|
+
</Stack>
|
|
90
|
+
</div>
|
|
91
|
+
</ResponsiveGrid>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const ExampleStripe = (args) => {
|
|
96
|
+
return (
|
|
97
|
+
<ResponsiveGrid {...args}>
|
|
98
|
+
<div>
|
|
99
|
+
<Stack gap={-2}>
|
|
100
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
101
|
+
<p>{content}</p>
|
|
102
|
+
</Stack>
|
|
103
|
+
</div>
|
|
104
|
+
<div>
|
|
105
|
+
<Stack gap={-2}>
|
|
106
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
107
|
+
<p>{content}</p>
|
|
108
|
+
</Stack>
|
|
109
|
+
</div>
|
|
110
|
+
<div>
|
|
111
|
+
<Stack gap={-2}>
|
|
112
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
113
|
+
<p>{content}</p>
|
|
114
|
+
</Stack>
|
|
115
|
+
</div>
|
|
116
|
+
<div>
|
|
117
|
+
<Stack gap={-2}>
|
|
118
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
119
|
+
<p>{content}</p>
|
|
120
|
+
</Stack>
|
|
121
|
+
</div>
|
|
122
|
+
<div>
|
|
123
|
+
<Stack gap={-2}>
|
|
124
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
125
|
+
<p>{content}</p>
|
|
126
|
+
</Stack>
|
|
127
|
+
</div>
|
|
128
|
+
<div>
|
|
129
|
+
<Stack gap={-2}>
|
|
130
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
131
|
+
<p>{content}</p>
|
|
132
|
+
</Stack>
|
|
133
|
+
</div>
|
|
71
134
|
</ResponsiveGrid>
|
|
72
135
|
);
|
|
73
136
|
};
|
|
137
|
+
ExampleStripe.args = {
|
|
138
|
+
divider: 'stripe',
|
|
139
|
+
};
|
|
140
|
+
ExampleStripe.storyName = 'Example : Stripe';
|
|
141
|
+
|
|
142
|
+
export const ExampleUnderline = (args) => {
|
|
143
|
+
return (
|
|
144
|
+
<ResponsiveGrid {...args}>
|
|
145
|
+
<div>
|
|
146
|
+
<Stack gap={-2}>
|
|
147
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
148
|
+
<p>{content}</p>
|
|
149
|
+
</Stack>
|
|
150
|
+
</div>
|
|
151
|
+
<div>
|
|
152
|
+
<Stack gap={-2}>
|
|
153
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
154
|
+
<p>{content}</p>
|
|
155
|
+
</Stack>
|
|
156
|
+
</div>
|
|
157
|
+
<div>
|
|
158
|
+
<Stack gap={-2}>
|
|
159
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
160
|
+
<p>{content}</p>
|
|
161
|
+
</Stack>
|
|
162
|
+
</div>
|
|
163
|
+
<div>
|
|
164
|
+
<Stack gap={-2}>
|
|
165
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
166
|
+
<p>{content}</p>
|
|
167
|
+
</Stack>
|
|
168
|
+
</div>
|
|
169
|
+
<div>
|
|
170
|
+
<Stack gap={-2}>
|
|
171
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
172
|
+
<p>{content}</p>
|
|
173
|
+
</Stack>
|
|
174
|
+
</div>
|
|
175
|
+
<div>
|
|
176
|
+
<Stack gap={-2}>
|
|
177
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
178
|
+
<p>{content}</p>
|
|
179
|
+
</Stack>
|
|
180
|
+
</div>
|
|
181
|
+
</ResponsiveGrid>
|
|
182
|
+
);
|
|
183
|
+
};
|
|
184
|
+
ExampleUnderline.args = {
|
|
185
|
+
divider: 'underline',
|
|
186
|
+
};
|
|
187
|
+
ExampleUnderline.storyName = 'Example : Underline';
|
|
188
|
+
|
|
189
|
+
export const ExampleBordered = (args) => {
|
|
190
|
+
return (
|
|
191
|
+
<ResponsiveGrid {...args}>
|
|
192
|
+
<div>
|
|
193
|
+
<Stack gap={-2}>
|
|
194
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
195
|
+
<p>{content}</p>
|
|
196
|
+
</Stack>
|
|
197
|
+
</div>
|
|
198
|
+
<div>
|
|
199
|
+
<Stack gap={-2}>
|
|
200
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
201
|
+
<p>{content}</p>
|
|
202
|
+
</Stack>
|
|
203
|
+
</div>
|
|
204
|
+
<div>
|
|
205
|
+
<Stack gap={-2}>
|
|
206
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
207
|
+
<p>{content}</p>
|
|
208
|
+
</Stack>
|
|
209
|
+
</div>
|
|
210
|
+
<div>
|
|
211
|
+
<Stack gap={-2}>
|
|
212
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
213
|
+
<p>{content}</p>
|
|
214
|
+
</Stack>
|
|
215
|
+
</div>
|
|
216
|
+
<div>
|
|
217
|
+
<Stack gap={-2}>
|
|
218
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
219
|
+
<p>{content}</p>
|
|
220
|
+
</Stack>
|
|
221
|
+
</div>
|
|
222
|
+
<div>
|
|
223
|
+
<Stack gap={-2}>
|
|
224
|
+
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
225
|
+
<p>{content}</p>
|
|
226
|
+
</Stack>
|
|
227
|
+
</div>
|
|
228
|
+
</ResponsiveGrid>
|
|
229
|
+
);
|
|
230
|
+
};
|
|
231
|
+
ExampleBordered.args = {
|
|
232
|
+
divider: 'bordered',
|
|
233
|
+
};
|
|
234
|
+
ExampleBordered.storyName = 'Example : Bordered';
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
# Stack
|
|
2
|
+
|
|
3
|
+
Arranges child elements vertically at regular intervals.
|
|
4
|
+
|
|
1
5
|
## Usage
|
|
2
6
|
|
|
7
|
+
### HTML
|
|
8
|
+
|
|
3
9
|
```html
|
|
4
10
|
<div data-unitone-layout="stack">
|
|
5
11
|
<p>Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cill</p>
|
|
@@ -7,7 +13,24 @@
|
|
|
7
13
|
</div>
|
|
8
14
|
```
|
|
9
15
|
|
|
10
|
-
###
|
|
16
|
+
### JSX
|
|
17
|
+
|
|
18
|
+
```jsx
|
|
19
|
+
import { Stack } from '@inc2734/unitone-css';
|
|
20
|
+
|
|
21
|
+
<Stack>
|
|
22
|
+
<p>Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cill</p>
|
|
23
|
+
<p>Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cill</p>
|
|
24
|
+
</Stack>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Props
|
|
28
|
+
|
|
29
|
+
### Gap
|
|
30
|
+
|
|
31
|
+
Gap.
|
|
32
|
+
|
|
33
|
+
#### HTML
|
|
11
34
|
|
|
12
35
|
```html
|
|
13
36
|
<div data-unitone-layout="stack -gap:1">
|
|
@@ -15,7 +38,21 @@
|
|
|
15
38
|
</div>
|
|
16
39
|
```
|
|
17
40
|
|
|
18
|
-
|
|
41
|
+
#### JSX
|
|
42
|
+
|
|
43
|
+
```jsx
|
|
44
|
+
import { Stack } from '@inc2734/unitone-css';
|
|
45
|
+
|
|
46
|
+
<Stack gap={1}>
|
|
47
|
+
...
|
|
48
|
+
</Stack>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Negative gap
|
|
52
|
+
|
|
53
|
+
Add a netative value gap.
|
|
54
|
+
|
|
55
|
+
#### HTML
|
|
19
56
|
|
|
20
57
|
```html
|
|
21
58
|
<div data-unitone-layout="stack -gap:1 -negative">
|
|
@@ -23,10 +60,22 @@
|
|
|
23
60
|
</div>
|
|
24
61
|
```
|
|
25
62
|
|
|
63
|
+
#### JSX
|
|
64
|
+
|
|
65
|
+
```jsx
|
|
66
|
+
import { Stack } from '@inc2734/unitone-css';
|
|
67
|
+
|
|
68
|
+
<Stack gap={1} negative>
|
|
69
|
+
...
|
|
70
|
+
</Stack>
|
|
71
|
+
```
|
|
72
|
+
|
|
26
73
|
### Using divider
|
|
27
74
|
|
|
28
75
|
stripe / underline / bordered
|
|
29
76
|
|
|
77
|
+
#### HTML
|
|
78
|
+
|
|
30
79
|
```html
|
|
31
80
|
<div data-unitone-layout="stack -divider:stripe">
|
|
32
81
|
<div>
|
|
@@ -37,3 +86,13 @@ stripe / underline / bordered
|
|
|
37
86
|
</div>
|
|
38
87
|
</div>
|
|
39
88
|
```
|
|
89
|
+
|
|
90
|
+
#### JSX
|
|
91
|
+
|
|
92
|
+
```jsx
|
|
93
|
+
import { Stack } from '@inc2734/unitone-css';
|
|
94
|
+
|
|
95
|
+
<Stack gap={1} divider="stripe">
|
|
96
|
+
...
|
|
97
|
+
</Stack>
|
|
98
|
+
```
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import readme from '../README.md';
|
|
3
3
|
|
|
4
|
-
import { Stack } from '../
|
|
5
|
-
import { Decorator } from '../../decorator
|
|
6
|
-
import { Cluster } from '../../cluster
|
|
4
|
+
import { Stack } from '../';
|
|
5
|
+
import { Decorator } from '../../decorator';
|
|
6
|
+
import { Cluster } from '../../cluster';
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
9
|
title: 'Layout Primitives/Stack',
|
|
@@ -1,17 +1,73 @@
|
|
|
1
|
+
# Switcher
|
|
2
|
+
|
|
3
|
+
The direction of content flow switches depending on the content. If the width of the switcher block is smaller than the "threshold", it becomes one column.
|
|
4
|
+
|
|
1
5
|
## Usage
|
|
2
6
|
|
|
7
|
+
### HTML
|
|
8
|
+
|
|
3
9
|
```html
|
|
4
10
|
<div data-unitone-layout="switcher">
|
|
5
|
-
<div data-unitone-layout="
|
|
6
|
-
<div data-unitone-layout="
|
|
7
|
-
<div data-unitone-layout="
|
|
11
|
+
<div data-unitone-layout="decorator" style="--unitone--background-color: #decc00">Lorem ipsum</div>
|
|
12
|
+
<div data-unitone-layout="decorator" style="--unitone--background-color: #bfb6a8">dolor sit</div>
|
|
13
|
+
<div data-unitone-layout="decorator" style="--unitone--background-color: #edede6">amet consectetur</div>
|
|
8
14
|
</div>
|
|
9
15
|
```
|
|
10
16
|
|
|
11
|
-
###
|
|
17
|
+
### JSX
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
import { Switcher, Decorator } from '@inc2734/unitone-css';
|
|
21
|
+
|
|
22
|
+
<Switcher>
|
|
23
|
+
<Decorator backgroundColor="#decc00">Lorem ipsum</Decorator>
|
|
24
|
+
<Decorator backgroundColor="#bfb6a8">dolor sit</Decorator>
|
|
25
|
+
<Decorator backgroundColor="#edede6">amet consectetur</Decorator>
|
|
26
|
+
</Switcher>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Props
|
|
30
|
+
|
|
31
|
+
### Gap
|
|
32
|
+
|
|
33
|
+
Gap.
|
|
34
|
+
|
|
35
|
+
#### HTML
|
|
12
36
|
|
|
13
37
|
```html
|
|
14
38
|
<div data-unitone-layout="switcher -gap:1">
|
|
15
39
|
...
|
|
16
40
|
</div>
|
|
17
41
|
```
|
|
42
|
+
|
|
43
|
+
#### JSX
|
|
44
|
+
|
|
45
|
+
```jsx
|
|
46
|
+
import { Switcher } from '@inc2734/unitone-css';
|
|
47
|
+
|
|
48
|
+
<Switcher gap={1}>
|
|
49
|
+
...
|
|
50
|
+
</Switcher>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Threshold
|
|
54
|
+
|
|
55
|
+
If the box size is smaller than this value, it switches to one column.
|
|
56
|
+
|
|
57
|
+
#### HTML
|
|
58
|
+
|
|
59
|
+
```html
|
|
60
|
+
<div data-unitone-layout="switcher" style="--unitone--thureshold: 500px">
|
|
61
|
+
...
|
|
62
|
+
</div>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### JSX
|
|
66
|
+
|
|
67
|
+
```jsx
|
|
68
|
+
import { Switcher } from '@inc2734/unitone-css';
|
|
69
|
+
|
|
70
|
+
<Switcher threshold="500px">
|
|
71
|
+
...
|
|
72
|
+
</Switcher>
|
|
73
|
+
```
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import readme from '../README.md';
|
|
3
3
|
|
|
4
|
-
import { Switcher } from '../
|
|
5
|
-
import { Decorator } from '../../decorator
|
|
4
|
+
import { Switcher } from '../';
|
|
5
|
+
import { Decorator } from '../../decorator';
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
title: 'Layout Primitives/Switcher',
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
# Text
|
|
2
|
+
|
|
3
|
+
Designed to display legible text.
|
|
4
|
+
|
|
1
5
|
## Usage
|
|
2
6
|
|
|
7
|
+
### HTML
|
|
8
|
+
|
|
3
9
|
```html
|
|
4
10
|
<div data-unitone-layout="text">
|
|
5
11
|
<p>Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cill</p>
|
|
@@ -7,18 +13,127 @@
|
|
|
7
13
|
</div>
|
|
8
14
|
```
|
|
9
15
|
|
|
10
|
-
###
|
|
16
|
+
### JSX
|
|
17
|
+
|
|
18
|
+
```jsx
|
|
19
|
+
import { Text } from '@inc2734/unitone-css';
|
|
20
|
+
|
|
21
|
+
<Text>
|
|
22
|
+
<p>Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cill</p>
|
|
23
|
+
<p>Lorem Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cill</p>
|
|
24
|
+
</Text>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Props
|
|
28
|
+
|
|
29
|
+
### Apply gap
|
|
30
|
+
|
|
31
|
+
Automatically apply appropriate gap.
|
|
32
|
+
|
|
33
|
+
#### HTML
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<div data-unitone-layout="text -gap -gap:1">
|
|
37
|
+
...
|
|
38
|
+
</div>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
#### JSX
|
|
42
|
+
|
|
43
|
+
```jsx
|
|
44
|
+
import { Text } from '@inc2734/unitone-css';
|
|
45
|
+
|
|
46
|
+
<Text applyGap gap={1}>
|
|
47
|
+
...
|
|
48
|
+
</Text>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Gutters
|
|
52
|
+
|
|
53
|
+
Gutters.
|
|
54
|
+
|
|
55
|
+
#### HTML
|
|
56
|
+
|
|
57
|
+
```html
|
|
58
|
+
<div data-unitone-layout="text -gutters:1">
|
|
59
|
+
...
|
|
60
|
+
</div>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
#### JSX
|
|
64
|
+
|
|
65
|
+
```jsx
|
|
66
|
+
import { Text } from '@inc2734/unitone-css';
|
|
67
|
+
|
|
68
|
+
<Text gutters={1}>
|
|
69
|
+
...
|
|
70
|
+
</Text>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Max width
|
|
74
|
+
|
|
75
|
+
Sets the maximum width of the child element.
|
|
76
|
+
|
|
77
|
+
#### HTML
|
|
11
78
|
|
|
12
79
|
```html
|
|
13
|
-
<div data-unitone-layout="text -
|
|
80
|
+
<div data-unitone-layout="text" style="--unitone--max-width: 500px">
|
|
14
81
|
...
|
|
15
82
|
</div>
|
|
16
83
|
```
|
|
17
84
|
|
|
85
|
+
#### JSX
|
|
86
|
+
|
|
87
|
+
```jsx
|
|
88
|
+
import { Text } from '@inc2734/unitone-css';
|
|
89
|
+
|
|
90
|
+
<Text maxWidth="500px">
|
|
91
|
+
...
|
|
92
|
+
</Text>
|
|
93
|
+
```
|
|
94
|
+
|
|
18
95
|
### Centering children
|
|
19
96
|
|
|
97
|
+
Intrinsic centering of child elements.
|
|
98
|
+
|
|
99
|
+
#### HTML
|
|
100
|
+
|
|
20
101
|
```html
|
|
21
102
|
<div data-unitone-layout="text -center">
|
|
22
103
|
...
|
|
23
104
|
</div>
|
|
24
105
|
```
|
|
106
|
+
|
|
107
|
+
#### JSX
|
|
108
|
+
|
|
109
|
+
```jsx
|
|
110
|
+
import { Text } from '@inc2734/unitone-css';
|
|
111
|
+
|
|
112
|
+
<Text center>
|
|
113
|
+
...
|
|
114
|
+
</Text>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### Columns
|
|
118
|
+
|
|
119
|
+
Correctly columnarize the child elements.
|
|
120
|
+
|
|
121
|
+
`--unitone--max-width` specifies the ideal width of the column.
|
|
122
|
+
|
|
123
|
+
#### HTML
|
|
124
|
+
|
|
125
|
+
```html
|
|
126
|
+
<div data-unitone-layout="text -columns" --unitone--max-width="300px">
|
|
127
|
+
...
|
|
128
|
+
</div>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### JSX
|
|
132
|
+
|
|
133
|
+
```jsx
|
|
134
|
+
import { Text } from '@inc2734/unitone-css';
|
|
135
|
+
|
|
136
|
+
<Text columns maxWidth="300px">
|
|
137
|
+
...
|
|
138
|
+
</Text>
|
|
139
|
+
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import readme from '../README.md';
|
|
3
3
|
|
|
4
|
-
import { Text } from '../
|
|
4
|
+
import { Text } from '../';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Layout Primitives/Text',
|
|
@@ -12,14 +12,15 @@ export default {
|
|
|
12
12
|
argTypes: {
|
|
13
13
|
center: {
|
|
14
14
|
control: { type: 'inline-radio' },
|
|
15
|
-
description: 'Centering child
|
|
15
|
+
description: 'Centering child elements. Set by `data-unitone-layout` attribute `-center`.',
|
|
16
16
|
options: [false, true],
|
|
17
17
|
table: { defaultValue: { summary: false } },
|
|
18
18
|
type: { name: 'boolean', required: false },
|
|
19
19
|
},
|
|
20
20
|
column: {
|
|
21
21
|
control: { type: 'inline-radio' },
|
|
22
|
-
description:
|
|
22
|
+
description:
|
|
23
|
+
'Correctly columnarize the child elements. Set by `data-unitone-layout` attribute `-column`.',
|
|
23
24
|
options: [false, true],
|
|
24
25
|
table: { defaultValue: { summary: false } },
|
|
25
26
|
type: { name: 'boolean', required: false },
|
|
@@ -40,6 +41,14 @@ export default {
|
|
|
40
41
|
table: { defaultValue: { summary: 'var(--unitone--global--text-gap)' } },
|
|
41
42
|
type: { name: 'number', required: false },
|
|
42
43
|
},
|
|
44
|
+
gutters: {
|
|
45
|
+
control: { type: 'inline-radio' },
|
|
46
|
+
description:
|
|
47
|
+
'Gutters. Set by CSS var `--unitone--gutters` or `data-unitone-layout` attribute `-gutters:x`.',
|
|
48
|
+
options: [undefined, 0, 1, 2, 3, 4, 5, 6, 7, 'root'],
|
|
49
|
+
table: { defaultValue: { summary: '0' } },
|
|
50
|
+
type: { name: 'number', required: false },
|
|
51
|
+
},
|
|
43
52
|
maxWidth: {
|
|
44
53
|
control: { type: 'text' },
|
|
45
54
|
description: 'Max width. Set by CSS var `--unitone--max-width`.',
|
|
@@ -52,6 +61,7 @@ export default {
|
|
|
52
61
|
column: false,
|
|
53
62
|
applyGap: false,
|
|
54
63
|
gap: 1,
|
|
64
|
+
gutters: 0,
|
|
55
65
|
maxWidth: 'var(--unitone--measure)',
|
|
56
66
|
},
|
|
57
67
|
};
|