@inc2734/unitone-css 0.46.5 → 0.47.0
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 +26 -17
- package/src/app.js +5 -132
- 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/stories/2.get-started.stories.mdx +28 -2
- 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
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inc2734/unitone-css",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./dist/index.js",
|
|
8
|
+
"./app": "./dist/app.js",
|
|
9
|
+
"./library": "./dist/library.js"
|
|
10
|
+
},
|
|
6
11
|
"license": "MIT",
|
|
7
12
|
"repository": {
|
|
8
13
|
"type": "git",
|
|
@@ -26,8 +31,7 @@
|
|
|
26
31
|
"css:app": "sass --no-source-map src/app.scss:dist/app.css && postcss dist/app.css -r",
|
|
27
32
|
"css:storybook": "sass --no-source-map src/storybook.scss:dist/storybook.css && postcss dist/storybook.css -r",
|
|
28
33
|
"css": "run-p css:*",
|
|
29
|
-
"js
|
|
30
|
-
"js": "run-p js:*",
|
|
34
|
+
"js": "rollup -c --bundleConfigAsCjs",
|
|
31
35
|
"build": "run-s clean format css js",
|
|
32
36
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
33
37
|
"format:js": "prettier --write './src/**/*.{js,jsx}'",
|
|
@@ -36,27 +40,32 @@
|
|
|
36
40
|
"public": "npm run build && storybook build -c ./.storybook -o ./public"
|
|
37
41
|
},
|
|
38
42
|
"devDependencies": {
|
|
39
|
-
"@babel/core": "^7.
|
|
40
|
-
"@babel/
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
43
|
+
"@babel/core": "^7.23.2",
|
|
44
|
+
"@babel/plugin-transform-runtime": "^7.23.2",
|
|
45
|
+
"@babel/preset-env": "^7.23.2",
|
|
46
|
+
"@babel/preset-react": "^7.22.15",
|
|
47
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
48
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
49
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
50
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
51
|
+
"@storybook/addon-actions": "^7.5.2",
|
|
52
|
+
"@storybook/addon-essentials": "^7.5.2",
|
|
53
|
+
"@storybook/addon-links": "^7.5.2",
|
|
54
|
+
"@storybook/react-webpack5": "^7.5.2",
|
|
45
55
|
"@whitespace/storybook-addon-html": "^5.1.6",
|
|
46
|
-
"autoprefixer": "^10.4.
|
|
56
|
+
"autoprefixer": "^10.4.16",
|
|
47
57
|
"babel-loader": "^9.1.3",
|
|
48
58
|
"cssnano": "^6.0.1",
|
|
49
59
|
"npm-run-all": "^4.1.5",
|
|
50
|
-
"postcss": "^8.4.
|
|
60
|
+
"postcss": "^8.4.31",
|
|
51
61
|
"postcss-cli": "^10.1.0",
|
|
52
62
|
"postcss-import": "^15.1.0",
|
|
53
63
|
"react": "^18.2.0",
|
|
54
64
|
"react-dom": "^18.2.0",
|
|
55
65
|
"react-syntax-highlighter": "^15.5.0",
|
|
56
|
-
"rimraf": "^5.0.
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"webpack-cli": "^5.1.4"
|
|
66
|
+
"rimraf": "^5.0.5",
|
|
67
|
+
"rollup": "^4.3.0",
|
|
68
|
+
"sass": "^1.69.5",
|
|
69
|
+
"storybook": "^7.5.2"
|
|
61
70
|
}
|
|
62
71
|
}
|
package/src/app.js
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
target.style.setProperty('--unitone--fluid-font-size-magnification', fontSize / baseFontSize);
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const fluidFontSizeResizeObserver = new ResizeObserver((entries) => {
|
|
10
|
-
for (const entry of entries) {
|
|
11
|
-
setFluidFontSizeMagnification(entry.target);
|
|
12
|
-
}
|
|
13
|
-
});
|
|
1
|
+
import {
|
|
2
|
+
fluidFontSizeResizeObserver,
|
|
3
|
+
dividersResizeObserver,
|
|
4
|
+
verticalsResizeObserve,
|
|
5
|
+
} from '@inc2734/unitone-css/library';
|
|
14
6
|
|
|
15
7
|
document.addEventListener('DOMContentLoaded', () => {
|
|
16
8
|
const fluidFontSizeElements = document.querySelectorAll(
|
|
@@ -21,45 +13,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
21
13
|
});
|
|
22
14
|
});
|
|
23
15
|
|
|
24
|
-
const setDividerLinewrap = (target) => {
|
|
25
|
-
const firstChild = [].slice.call(target.children)?.[0];
|
|
26
|
-
if (!!firstChild) {
|
|
27
|
-
let prevChild;
|
|
28
|
-
|
|
29
|
-
[].slice.call(target.children).forEach((child) => {
|
|
30
|
-
const baseRect = firstChild.getBoundingClientRect();
|
|
31
|
-
const prevRect = prevChild?.getBoundingClientRect();
|
|
32
|
-
const targetRect = child.getBoundingClientRect();
|
|
33
|
-
|
|
34
|
-
let layout = (child.getAttribute('data-unitone-layout') || '').split(' ');
|
|
35
|
-
if (baseRect.top < targetRect.top) {
|
|
36
|
-
if (!layout.includes('-linewrap')) {
|
|
37
|
-
layout.push('-linewrap');
|
|
38
|
-
}
|
|
39
|
-
} else {
|
|
40
|
-
layout = layout.filter((value) => value !== '-linewrap');
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (firstChild === child || (!!prevRect?.top && prevRect.top < targetRect.top)) {
|
|
44
|
-
if (!layout.includes('-bol')) {
|
|
45
|
-
layout.push('-bol');
|
|
46
|
-
}
|
|
47
|
-
} else {
|
|
48
|
-
layout = layout.filter((value) => value !== '-bol');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
child.setAttribute('data-unitone-layout', layout.join(' '));
|
|
52
|
-
prevChild = child;
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const dividersResizeObserver = new ResizeObserver((entries) => {
|
|
58
|
-
for (const entry of entries) {
|
|
59
|
-
setDividerLinewrap(entry.target);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
|
|
63
16
|
document.addEventListener('DOMContentLoaded', () => {
|
|
64
17
|
const dividers = document.querySelectorAll('[data-unitone-layout*="-divider:"]');
|
|
65
18
|
dividers.forEach((target) => {
|
|
@@ -67,86 +20,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
67
20
|
});
|
|
68
21
|
});
|
|
69
22
|
|
|
70
|
-
const setColumnCountForVertical = (target) => {
|
|
71
|
-
target.parentNode.style.height = '';
|
|
72
|
-
target.parentNode.style.width = '';
|
|
73
|
-
target.style.columnCount = '';
|
|
74
|
-
|
|
75
|
-
let lastChild;
|
|
76
|
-
[].slice
|
|
77
|
-
.call(target.children)
|
|
78
|
-
.reverse()
|
|
79
|
-
.some((child) => {
|
|
80
|
-
if (!['absolute', 'fixed'].includes(getComputedStyle(child).position)) {
|
|
81
|
-
lastChild = child;
|
|
82
|
-
return true;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
if (!lastChild) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// For Firefox
|
|
91
|
-
if (target.getBoundingClientRect().left > lastChild.getBoundingClientRect().left) {
|
|
92
|
-
target.style.columnCount = 'auto';
|
|
93
|
-
target.parentNode.style.width = `${Math.ceil(
|
|
94
|
-
target.getBoundingClientRect().width +
|
|
95
|
-
target.getBoundingClientRect().left -
|
|
96
|
-
lastChild.getBoundingClientRect().left,
|
|
97
|
-
)}px`;
|
|
98
|
-
|
|
99
|
-
if (target.getBoundingClientRect().width >= target.parentNode.getBoundingClientRect().width) {
|
|
100
|
-
target.style.columnCount = '';
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// For Safari
|
|
105
|
-
if (target.getBoundingClientRect().left > lastChild.getBoundingClientRect().left) {
|
|
106
|
-
target.style.columnCount = 2;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const targetY = target.getBoundingClientRect().top + target.getBoundingClientRect().height;
|
|
110
|
-
const lastChildY =
|
|
111
|
-
lastChild.getBoundingClientRect().top + lastChild.getBoundingClientRect().height;
|
|
112
|
-
if (targetY < lastChildY) {
|
|
113
|
-
target.parentNode.style.height = `${Math.ceil(
|
|
114
|
-
lastChildY - target.getBoundingClientRect().top,
|
|
115
|
-
)}px`;
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export const verticalsResizeObserve = (target) => {
|
|
120
|
-
let prevWidth = 0;
|
|
121
|
-
|
|
122
|
-
const mutationObserver = new MutationObserver((entries) => {
|
|
123
|
-
for (const entry of entries) {
|
|
124
|
-
setColumnCountForVertical(target);
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
mutationObserver.observe(target, {
|
|
129
|
-
// attributes: true,
|
|
130
|
-
characterData: true,
|
|
131
|
-
childList: true,
|
|
132
|
-
subtree: true,
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
const resizeObserver = new ResizeObserver((entries, observer) => {
|
|
136
|
-
for (const entry of entries) {
|
|
137
|
-
const width = entry.borderBoxSize?.[0].blockSize;
|
|
138
|
-
if (width !== prevWidth) {
|
|
139
|
-
prevWidth = width;
|
|
140
|
-
observer.unobserve(entry.target);
|
|
141
|
-
setColumnCountForVertical(entry.target);
|
|
142
|
-
observer.observe(entry.target);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
resizeObserver.observe(target);
|
|
148
|
-
};
|
|
149
|
-
|
|
150
23
|
document.addEventListener('DOMContentLoaded', () => {
|
|
151
24
|
const verticals = document.querySelectorAll('[data-unitone-layout~="vertical-writing"]');
|
|
152
25
|
verticals.forEach((target) => {
|
package/src/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './layout-primitives/index';
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
# Both Sides
|
|
2
|
+
|
|
3
|
+
Child elements are aligned at both ends. If the width of a child element becomes too large to maintain justification, it will be placed in a single column.
|
|
4
|
+
|
|
1
5
|
## Usage
|
|
2
6
|
|
|
7
|
+
### HTML
|
|
8
|
+
|
|
3
9
|
```html
|
|
4
10
|
<div data-unitone-layout="both-sides">
|
|
5
|
-
<p>Lorem ipsum dolor sit amet
|
|
11
|
+
<p>Lorem ipsum dolor sit amet</p>
|
|
6
12
|
<ul>
|
|
7
13
|
<li>Lorem</li>
|
|
8
14
|
<li>ipsum</li>
|
|
@@ -11,7 +17,28 @@
|
|
|
11
17
|
</div>
|
|
12
18
|
```
|
|
13
19
|
|
|
14
|
-
###
|
|
20
|
+
### JSX
|
|
21
|
+
|
|
22
|
+
```jsx
|
|
23
|
+
import { BothSides } from '@inc2734/unitone-css';
|
|
24
|
+
|
|
25
|
+
<BothSides>
|
|
26
|
+
<p>Lorem ipsum dolor sit amet</p>
|
|
27
|
+
<ul>
|
|
28
|
+
<li>Lorem</li>
|
|
29
|
+
<li>ipsum</li>
|
|
30
|
+
<li>dolor</li>
|
|
31
|
+
</ul>
|
|
32
|
+
</BothSides>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
### Gap
|
|
38
|
+
|
|
39
|
+
Gap.
|
|
40
|
+
|
|
41
|
+
#### HTML
|
|
15
42
|
|
|
16
43
|
```html
|
|
17
44
|
<div data-unitone-layout="both-sides -gap:1">
|
|
@@ -19,7 +46,21 @@
|
|
|
19
46
|
</div>
|
|
20
47
|
```
|
|
21
48
|
|
|
22
|
-
|
|
49
|
+
#### JSX
|
|
50
|
+
|
|
51
|
+
```jsx
|
|
52
|
+
import { BothSides } from '@inc2734/unitone-css';
|
|
53
|
+
|
|
54
|
+
<BothSides gap={1}>
|
|
55
|
+
...
|
|
56
|
+
</BothSides>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Align items
|
|
60
|
+
|
|
61
|
+
Alignment of the row direction.
|
|
62
|
+
|
|
63
|
+
#### HTML
|
|
23
64
|
|
|
24
65
|
```html
|
|
25
66
|
<ul data-unitone-layout="both-sides -align-items:center">
|
|
@@ -27,11 +68,25 @@
|
|
|
27
68
|
</ul>
|
|
28
69
|
```
|
|
29
70
|
|
|
30
|
-
|
|
71
|
+
#### JSX
|
|
72
|
+
|
|
73
|
+
```jsx
|
|
74
|
+
import { BothSides } from '@inc2734/unitone-css';
|
|
75
|
+
|
|
76
|
+
<BothSides alignItems="center">
|
|
77
|
+
...
|
|
78
|
+
</BothSides>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Items max width
|
|
82
|
+
|
|
83
|
+
Set max-width of the item.
|
|
84
|
+
|
|
85
|
+
#### HTML
|
|
31
86
|
|
|
32
87
|
```html
|
|
33
88
|
<div data-unitone-layout="both-sides">
|
|
34
|
-
<p style="--unitone--content-max-width: 400px">Lorem ipsum dolor sit amet
|
|
89
|
+
<p style="--unitone--content-max-width: 400px">Lorem ipsum dolor sit amet</p>
|
|
35
90
|
<ul>
|
|
36
91
|
<li>Lorem</li>
|
|
37
92
|
<li>ipsum</li>
|
|
@@ -40,11 +95,30 @@
|
|
|
40
95
|
</div>
|
|
41
96
|
```
|
|
42
97
|
|
|
43
|
-
|
|
98
|
+
#### JSX
|
|
99
|
+
|
|
100
|
+
```jsx
|
|
101
|
+
import { BothSides } from '@inc2734/unitone-css';
|
|
102
|
+
|
|
103
|
+
<BothSides>
|
|
104
|
+
<p style={{ '--unitone--content-max-width': '400px' }}>Lorem ipsum dolor sit amet</p>
|
|
105
|
+
<ul>
|
|
106
|
+
<li>Lorem</li>
|
|
107
|
+
<li>ipsum</li>
|
|
108
|
+
<li>dolor</li>
|
|
109
|
+
</ul>
|
|
110
|
+
</BothSides>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Items width
|
|
114
|
+
|
|
115
|
+
Set width of the item.
|
|
116
|
+
|
|
117
|
+
### HTML
|
|
44
118
|
|
|
45
119
|
```html
|
|
46
120
|
<div data-unitone-layout="both-sides">
|
|
47
|
-
<p style="--unitone--content-width: 400px">Lorem ipsum dolor sit amet
|
|
121
|
+
<p style="--unitone--content-width: 400px">Lorem ipsum dolor sit amet</p>
|
|
48
122
|
<ul>
|
|
49
123
|
<li>Lorem</li>
|
|
50
124
|
<li>ipsum</li>
|
|
@@ -52,3 +126,18 @@
|
|
|
52
126
|
</ul>
|
|
53
127
|
</div>
|
|
54
128
|
```
|
|
129
|
+
|
|
130
|
+
#### JSX
|
|
131
|
+
|
|
132
|
+
```jsx
|
|
133
|
+
import { BothSides } from '@inc2734/unitone-css';
|
|
134
|
+
|
|
135
|
+
<BothSides>
|
|
136
|
+
<p style={{ '--unitone--content-width': '400px' }}>Lorem ipsum dolor sit amet</p>
|
|
137
|
+
<ul>
|
|
138
|
+
<li>Lorem</li>
|
|
139
|
+
<li>ipsum</li>
|
|
140
|
+
<li>dolor</li>
|
|
141
|
+
</ul>
|
|
142
|
+
</BothSides>
|
|
143
|
+
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import readme from '../README.md';
|
|
3
3
|
|
|
4
|
-
import { BothSides } from '../
|
|
4
|
+
import { BothSides } from '../';
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
7
|
title: 'Layout Primitives/BothSides',
|
|
@@ -35,13 +35,10 @@ const meta = {
|
|
|
35
35
|
};
|
|
36
36
|
export default meta;
|
|
37
37
|
|
|
38
|
-
const content =
|
|
39
|
-
'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.';
|
|
40
|
-
|
|
41
38
|
export const Default = (args) => {
|
|
42
39
|
return (
|
|
43
40
|
<BothSides {...args}>
|
|
44
|
-
<p>
|
|
41
|
+
<p>Lorem ipsum dolor sit amet</p>
|
|
45
42
|
<ul>
|
|
46
43
|
<li>Lorem</li>
|
|
47
44
|
<li>ipsum</li>
|
|
@@ -1,49 +1,113 @@
|
|
|
1
|
+
# Center
|
|
2
|
+
|
|
3
|
+
Center the box. Settings also allow for centering of child elements and centering of text.
|
|
4
|
+
|
|
1
5
|
## Usage
|
|
2
6
|
|
|
7
|
+
### HTML
|
|
8
|
+
|
|
3
9
|
```html
|
|
4
|
-
<div data-unitone-layout="
|
|
5
|
-
|
|
6
|
-
<p>
|
|
7
|
-
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
|
|
8
|
-
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
|
|
9
|
-
ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
10
|
-
reprehenderit in voluptate velit esse cill
|
|
11
|
-
</p>
|
|
12
|
-
|
|
13
|
-
<div data-unitone-layout="center">
|
|
14
|
-
Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<h3>Lorem ipsum dolor sit amet, consectetur adipisicing elit</h3>
|
|
18
|
-
<p>
|
|
19
|
-
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
|
|
20
|
-
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
|
|
21
|
-
ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
22
|
-
reprehenderit in voluptate velit esse cill
|
|
23
|
-
</p>
|
|
10
|
+
<div data-unitone-layout="center">
|
|
11
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
|
24
12
|
</div>
|
|
25
13
|
```
|
|
26
14
|
|
|
15
|
+
### JSX
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
import { Center } from '@inc2734/unitone-css';
|
|
19
|
+
|
|
20
|
+
<Center>
|
|
21
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
|
22
|
+
</Center>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
27
|
### Intrinsic centering
|
|
28
28
|
|
|
29
|
+
Child elements are also centered.
|
|
30
|
+
|
|
31
|
+
#### HTML
|
|
32
|
+
|
|
29
33
|
```html
|
|
30
34
|
<div data-unitone-layout="center -intrinsic">
|
|
31
35
|
...
|
|
32
36
|
</div>
|
|
33
37
|
```
|
|
34
38
|
|
|
39
|
+
#### JSX
|
|
40
|
+
|
|
41
|
+
```jsx
|
|
42
|
+
import { Center } from '@inc2734/unitone-css';
|
|
43
|
+
|
|
44
|
+
<Center intrinsic>
|
|
45
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
|
46
|
+
</Center>
|
|
47
|
+
```
|
|
48
|
+
|
|
35
49
|
### Centering with text
|
|
36
50
|
|
|
51
|
+
Text is also centered.
|
|
52
|
+
|
|
53
|
+
#### HTML
|
|
54
|
+
|
|
37
55
|
```html
|
|
38
56
|
<div data-unitone-layout="center -with-text">
|
|
39
57
|
...
|
|
40
58
|
</div>
|
|
41
59
|
```
|
|
42
60
|
|
|
43
|
-
|
|
61
|
+
#### JSX
|
|
62
|
+
|
|
63
|
+
```jsx
|
|
64
|
+
import { Center } from '@inc2734/unitone-css';
|
|
65
|
+
|
|
66
|
+
<Center withText>
|
|
67
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
|
68
|
+
</Center>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Gutters
|
|
72
|
+
|
|
73
|
+
Gutters.
|
|
74
|
+
|
|
75
|
+
#### HTML
|
|
44
76
|
|
|
45
77
|
```html
|
|
46
78
|
<div data-unitone-layout="center -gutters:1">
|
|
47
79
|
...
|
|
48
80
|
</div>
|
|
49
81
|
```
|
|
82
|
+
|
|
83
|
+
#### JSX
|
|
84
|
+
|
|
85
|
+
```jsx
|
|
86
|
+
import { Center } from '@inc2734/unitone-css';
|
|
87
|
+
|
|
88
|
+
<Center gutters={1}>
|
|
89
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
|
90
|
+
</Center>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Max width
|
|
94
|
+
|
|
95
|
+
Max width.
|
|
96
|
+
|
|
97
|
+
#### HTML
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<div data-unitone-layout="center" style="--unitone--max-width: 1280px">
|
|
101
|
+
...
|
|
102
|
+
</div>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
#### JSX
|
|
106
|
+
|
|
107
|
+
```jsx
|
|
108
|
+
import { Center } from '@inc2734/unitone-css';
|
|
109
|
+
|
|
110
|
+
<Center maxWidth="1280px">
|
|
111
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit
|
|
112
|
+
</Center>
|
|
113
|
+
```
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import readme from '../README.md';
|
|
3
3
|
|
|
4
|
-
import { Center } from '../
|
|
5
|
-
import { Stack } from '../../stack
|
|
4
|
+
import { Center } from '../';
|
|
5
|
+
import { Stack } from '../../stack';
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
title: 'Layout Primitives/Center',
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
# Cluster
|
|
2
|
+
|
|
3
|
+
Arranges child elements horizontally.
|
|
4
|
+
|
|
1
5
|
## Usage
|
|
2
6
|
|
|
7
|
+
### HTML
|
|
8
|
+
|
|
3
9
|
```html
|
|
4
10
|
<ul data-unitone-layout="cluster">
|
|
5
11
|
<li>Lorem ipsum</li>
|
|
@@ -10,7 +16,27 @@
|
|
|
10
16
|
</ul>
|
|
11
17
|
```
|
|
12
18
|
|
|
13
|
-
###
|
|
19
|
+
### JSX
|
|
20
|
+
|
|
21
|
+
```jsx
|
|
22
|
+
import { Cluster } from '@inc2734/unitone-css';
|
|
23
|
+
|
|
24
|
+
<Cluster tagName="ul">
|
|
25
|
+
<li>Lorem ipsum</li>
|
|
26
|
+
<li>dolor sit</li>
|
|
27
|
+
<li>amet consectetur</li>
|
|
28
|
+
<li>adipisicing elit</li>
|
|
29
|
+
<li>sed do</li>
|
|
30
|
+
</Cluster>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
### Align items
|
|
36
|
+
|
|
37
|
+
Alignment of the row direction.
|
|
38
|
+
|
|
39
|
+
#### HTML
|
|
14
40
|
|
|
15
41
|
```html
|
|
16
42
|
<ul data-unitone-layout="cluster -align-items:center">
|
|
@@ -18,7 +44,21 @@
|
|
|
18
44
|
</ul>
|
|
19
45
|
```
|
|
20
46
|
|
|
21
|
-
|
|
47
|
+
#### JSX
|
|
48
|
+
|
|
49
|
+
```jsx
|
|
50
|
+
import { Cluster } from '@inc2734/unitone-css';
|
|
51
|
+
|
|
52
|
+
<Cluster tagName="ul" alignItems="center">
|
|
53
|
+
...
|
|
54
|
+
</Cluster>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Justify content
|
|
58
|
+
|
|
59
|
+
#### HTML
|
|
60
|
+
|
|
61
|
+
Alignment of the column direction.
|
|
22
62
|
|
|
23
63
|
```html
|
|
24
64
|
<ul data-unitone-layout="cluster -justify-content:space-between">
|
|
@@ -26,7 +66,21 @@
|
|
|
26
66
|
</ul>
|
|
27
67
|
```
|
|
28
68
|
|
|
29
|
-
|
|
69
|
+
#### JSX
|
|
70
|
+
|
|
71
|
+
```jsx
|
|
72
|
+
import { Cluster } from '@inc2734/unitone-css';
|
|
73
|
+
|
|
74
|
+
<Cluster tagName="ul" justifyContent="space-between">
|
|
75
|
+
...
|
|
76
|
+
</Cluster>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Gap
|
|
80
|
+
|
|
81
|
+
Gap.
|
|
82
|
+
|
|
83
|
+
#### HTML
|
|
30
84
|
|
|
31
85
|
```html
|
|
32
86
|
<ul data-unitone-layout="cluster -gap:1">
|
|
@@ -34,10 +88,24 @@
|
|
|
34
88
|
</ul>
|
|
35
89
|
```
|
|
36
90
|
|
|
37
|
-
|
|
91
|
+
#### JSX
|
|
92
|
+
|
|
93
|
+
```jsx
|
|
94
|
+
import { Cluster } from '@inc2734/unitone-css';
|
|
95
|
+
|
|
96
|
+
<Cluster tagName="ul" gap={1}>
|
|
97
|
+
...
|
|
98
|
+
</Cluster>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Divider
|
|
102
|
+
|
|
103
|
+
Using divider.
|
|
38
104
|
|
|
39
105
|
stripe / slash / bordered
|
|
40
106
|
|
|
107
|
+
#### HTML
|
|
108
|
+
|
|
41
109
|
```html
|
|
42
110
|
<div data-unitone-layout="cluster -divider:stripe">
|
|
43
111
|
<div>
|
|
@@ -48,3 +116,18 @@ stripe / slash / bordered
|
|
|
48
116
|
</div>
|
|
49
117
|
</div>
|
|
50
118
|
```
|
|
119
|
+
|
|
120
|
+
#### JSX
|
|
121
|
+
|
|
122
|
+
```jsx
|
|
123
|
+
import { Cluster } from '@inc2734/unitone-css';
|
|
124
|
+
|
|
125
|
+
<Cluster divider="stripe">
|
|
126
|
+
<div>
|
|
127
|
+
...
|
|
128
|
+
</div>
|
|
129
|
+
<div>
|
|
130
|
+
...
|
|
131
|
+
</div>
|
|
132
|
+
</Cluster>
|
|
133
|
+
```
|