@inc2734/unitone-css 0.46.4 → 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 +6 -4
- 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
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
# Vertical writing
|
|
2
|
+
|
|
3
|
+
Make the text vertically written.
|
|
4
|
+
|
|
1
5
|
## Usage
|
|
2
6
|
|
|
7
|
+
### HTML
|
|
8
|
+
|
|
3
9
|
```html
|
|
4
10
|
<div>
|
|
5
11
|
<div data-unitone-layout="vertical-writing">
|
|
@@ -9,7 +15,26 @@
|
|
|
9
15
|
</div>
|
|
10
16
|
```
|
|
11
17
|
|
|
12
|
-
###
|
|
18
|
+
### JSX
|
|
19
|
+
|
|
20
|
+
```jsx
|
|
21
|
+
import { VerticalWriting } from '@inc2734/unitone-css';
|
|
22
|
+
|
|
23
|
+
<div>
|
|
24
|
+
<VerticalWriting>
|
|
25
|
+
<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>
|
|
26
|
+
<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>
|
|
27
|
+
</VerticalWriting>
|
|
28
|
+
<div>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Props
|
|
32
|
+
|
|
33
|
+
### Rows height
|
|
34
|
+
|
|
35
|
+
Height of each rows.
|
|
36
|
+
|
|
37
|
+
#### HTML
|
|
13
38
|
|
|
14
39
|
```html
|
|
15
40
|
<div>
|
|
@@ -19,7 +44,47 @@
|
|
|
19
44
|
</div>
|
|
20
45
|
```
|
|
21
46
|
|
|
22
|
-
|
|
47
|
+
#### JSX
|
|
48
|
+
|
|
49
|
+
```jsx
|
|
50
|
+
import { VerticalWriting } from '@inc2734/unitone-css';
|
|
51
|
+
|
|
52
|
+
<div>
|
|
53
|
+
<VerticalWriting maxHeight="20rem">
|
|
54
|
+
...
|
|
55
|
+
</VerticalWriting>
|
|
56
|
+
<div>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Gap
|
|
60
|
+
|
|
61
|
+
Gap.
|
|
62
|
+
|
|
63
|
+
#### HTML
|
|
64
|
+
|
|
65
|
+
```html
|
|
66
|
+
<div>
|
|
67
|
+
<div data-unitone-layout="vertical-writing gap:1">
|
|
68
|
+
...
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
#### JSX
|
|
74
|
+
|
|
75
|
+
```jsx
|
|
76
|
+
import { VerticalWriting } from '@inc2734/unitone-css';
|
|
77
|
+
|
|
78
|
+
<div>
|
|
79
|
+
<VerticalWriting gap={1}>
|
|
80
|
+
...
|
|
81
|
+
</VerticalWriting>
|
|
82
|
+
<div>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Text orientation
|
|
86
|
+
|
|
87
|
+
#### HTML
|
|
23
88
|
|
|
24
89
|
```html
|
|
25
90
|
<div>
|
|
@@ -29,7 +94,23 @@
|
|
|
29
94
|
</div>
|
|
30
95
|
```
|
|
31
96
|
|
|
32
|
-
|
|
97
|
+
#### JSX
|
|
98
|
+
|
|
99
|
+
```jsx
|
|
100
|
+
import { VerticalWriting } from '@inc2734/unitone-css';
|
|
101
|
+
|
|
102
|
+
<div>
|
|
103
|
+
<VerticalWriting textOrientation="mixed">
|
|
104
|
+
...
|
|
105
|
+
</VerticalWriting>
|
|
106
|
+
<div>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Switch
|
|
110
|
+
|
|
111
|
+
Switch writing mode when portrait.
|
|
112
|
+
|
|
113
|
+
#### HTML
|
|
33
114
|
|
|
34
115
|
```html
|
|
35
116
|
<div>
|
|
@@ -38,3 +119,15 @@
|
|
|
38
119
|
</div>
|
|
39
120
|
</div>
|
|
40
121
|
```
|
|
122
|
+
|
|
123
|
+
#### JSX
|
|
124
|
+
|
|
125
|
+
```jsx
|
|
126
|
+
import { VerticalWriting } from '@inc2734/unitone-css';
|
|
127
|
+
|
|
128
|
+
<div>
|
|
129
|
+
<VerticalWriting switch>
|
|
130
|
+
...
|
|
131
|
+
</VerticalWriting>
|
|
132
|
+
<div>
|
|
133
|
+
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import readme from '../README.md';
|
|
3
3
|
|
|
4
|
-
import { VerticalWriting } from '../
|
|
4
|
+
import { VerticalWriting } from '../';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Layout Primitives/VerticalWriting',
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
},
|
|
21
21
|
maxHeight: {
|
|
22
22
|
control: { type: 'text' },
|
|
23
|
-
description: 'Max height of each
|
|
23
|
+
description: 'Max height of each rows. Set by CSS var `--unitone--max-height`.',
|
|
24
24
|
table: { defaultValue: { summary: 'calc(9 * var(--unitone--measure) / 16)' } },
|
|
25
25
|
type: { name: 'string', required: false },
|
|
26
26
|
},
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
# With sidebar
|
|
2
|
+
|
|
3
|
+
Assemble the component with sidebars. If the configured width can no longer be maintained, a single column display will be used.
|
|
4
|
+
|
|
1
5
|
## Usage
|
|
2
6
|
|
|
7
|
+
### HTML
|
|
8
|
+
|
|
3
9
|
```html
|
|
4
10
|
<div data-unitone-layout="with-sidebar">
|
|
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,30 @@
|
|
|
11
17
|
</div>
|
|
12
18
|
```
|
|
13
19
|
|
|
14
|
-
###
|
|
20
|
+
### JSX
|
|
21
|
+
|
|
22
|
+
```jsx
|
|
23
|
+
import { WithSidebar } from '@inc2734/unitone-css';
|
|
24
|
+
|
|
25
|
+
<WithSidebar>
|
|
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
|
+
</WithSidebar>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Props
|
|
36
|
+
|
|
37
|
+
### Sidebar
|
|
38
|
+
|
|
39
|
+
Sets sidebar position. Default is `right`.
|
|
40
|
+
|
|
41
|
+
left / right
|
|
42
|
+
|
|
43
|
+
#### HTML
|
|
15
44
|
|
|
16
45
|
```html
|
|
17
46
|
<div data-unitone-layout="with-sidebar -sidebar:left">
|
|
@@ -19,18 +48,122 @@
|
|
|
19
48
|
</div>
|
|
20
49
|
```
|
|
21
50
|
|
|
51
|
+
#### JSX
|
|
52
|
+
|
|
53
|
+
```jsx
|
|
54
|
+
import { WithSidebar } from '@inc2734/unitone-css';
|
|
55
|
+
|
|
56
|
+
<WithSidebar sidebar="left">
|
|
57
|
+
...
|
|
58
|
+
</WithSidebar>
|
|
59
|
+
```
|
|
60
|
+
|
|
22
61
|
### Revert
|
|
23
62
|
|
|
63
|
+
The way child elements are displayed is reversed.
|
|
64
|
+
|
|
65
|
+
#### HTML
|
|
66
|
+
|
|
24
67
|
```html
|
|
25
68
|
<div data-unitone-layout="with-sidebar -revert">
|
|
26
69
|
...
|
|
27
70
|
</div>
|
|
28
71
|
```
|
|
29
72
|
|
|
30
|
-
|
|
73
|
+
#### JSX
|
|
74
|
+
|
|
75
|
+
```jsx
|
|
76
|
+
import { WithSidebar } from '@inc2734/unitone-css';
|
|
77
|
+
|
|
78
|
+
<WithSidebar revert>
|
|
79
|
+
...
|
|
80
|
+
</WithSidebar>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Content min width
|
|
84
|
+
|
|
85
|
+
Min width of the content.
|
|
86
|
+
|
|
87
|
+
#### HTML
|
|
88
|
+
|
|
89
|
+
```html
|
|
90
|
+
<div data-unitone-layout="with-sidebar" style="--unitone--content-min-width: 500px">
|
|
91
|
+
...
|
|
92
|
+
</div>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### JSX
|
|
96
|
+
|
|
97
|
+
```jsx
|
|
98
|
+
import { WithSidebar } from '@inc2734/unitone-css';
|
|
99
|
+
|
|
100
|
+
<WithSidebar contentMinWidth="500px">
|
|
101
|
+
...
|
|
102
|
+
</WithSidebar>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Sidebar width
|
|
106
|
+
|
|
107
|
+
Sidebar width.
|
|
108
|
+
|
|
109
|
+
#### HTML
|
|
110
|
+
|
|
111
|
+
```html
|
|
112
|
+
<div data-unitone-layout="with-sidebar" style="--unitone--sidebar-width: 300px">
|
|
113
|
+
...
|
|
114
|
+
</div>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### JSX
|
|
118
|
+
|
|
119
|
+
```jsx
|
|
120
|
+
import { WithSidebar } from '@inc2734/unitone-css';
|
|
121
|
+
|
|
122
|
+
<WithSidebar sidebarWidth="300px">
|
|
123
|
+
...
|
|
124
|
+
</WithSidebar>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Gap
|
|
128
|
+
|
|
129
|
+
Gap.
|
|
130
|
+
|
|
131
|
+
#### HTML
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<ul data-unitone-layout="with-slider -gap:1">
|
|
135
|
+
...
|
|
136
|
+
</ul>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
#### JSX
|
|
140
|
+
|
|
141
|
+
```jsx
|
|
142
|
+
import { WithSidebar } from '@inc2734/unitone-css';
|
|
143
|
+
|
|
144
|
+
<WithSidebar gap={1}>
|
|
145
|
+
...
|
|
146
|
+
</WithSidebar>
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Align items
|
|
150
|
+
|
|
151
|
+
Alignment of the row direction.
|
|
152
|
+
|
|
153
|
+
#### HTML
|
|
31
154
|
|
|
32
155
|
```html
|
|
33
156
|
<ul data-unitone-layout="with-slider -align-items:center">
|
|
34
157
|
...
|
|
35
158
|
</ul>
|
|
36
159
|
```
|
|
160
|
+
|
|
161
|
+
#### JSX
|
|
162
|
+
|
|
163
|
+
```jsx
|
|
164
|
+
import { WithSidebar } from '@inc2734/unitone-css';
|
|
165
|
+
|
|
166
|
+
<WithSidebar alignItems="center">
|
|
167
|
+
...
|
|
168
|
+
</WithSidebar>
|
|
169
|
+
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import readme from '../README.md';
|
|
3
3
|
|
|
4
|
-
import { WithSidebar } from '../
|
|
4
|
+
import { WithSidebar } from '../';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Layout Primitives/WithSidebar',
|
|
@@ -66,13 +66,10 @@ export default {
|
|
|
66
66
|
},
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
const content =
|
|
70
|
-
'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';
|
|
71
|
-
|
|
72
69
|
export const Default = (args) => {
|
|
73
70
|
return (
|
|
74
71
|
<WithSidebar {...args}>
|
|
75
|
-
<p>
|
|
72
|
+
<p>Lorem ipsum dolor sit amet</p>
|
|
76
73
|
<ul>
|
|
77
74
|
<li>Lorem</li>
|
|
78
75
|
<li>ipsum</li>
|
|
@@ -85,7 +82,7 @@ export const Default = (args) => {
|
|
|
85
82
|
export const Revert = (args) => {
|
|
86
83
|
return (
|
|
87
84
|
<WithSidebar {...args}>
|
|
88
|
-
<p>
|
|
85
|
+
<p>Lorem ipsum dolor sit amet</p>
|
|
89
86
|
<ul>
|
|
90
87
|
<li>Lorem</li>
|
|
91
88
|
<li>ipsum</li>
|
|
@@ -116,7 +113,7 @@ export const MediaText = (args) => {
|
|
|
116
113
|
return (
|
|
117
114
|
<WithSidebar {...args}>
|
|
118
115
|
<img src="https://placehold.jp/400x300.jpg" alt="" />
|
|
119
|
-
<p>
|
|
116
|
+
<p>Lorem ipsum dolor sit amet</p>
|
|
120
117
|
</WithSidebar>
|
|
121
118
|
);
|
|
122
119
|
};
|
package/src/library.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
const setFluidFontSizeMagnification = (target) => {
|
|
2
|
+
const baseFontSize = parseFloat(
|
|
3
|
+
window.getComputedStyle(document.documentElement).getPropertyValue('font-size'),
|
|
4
|
+
);
|
|
5
|
+
const fontSize = parseFloat(window.getComputedStyle(target).getPropertyValue('font-size'));
|
|
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
|
+
});
|
|
14
|
+
|
|
15
|
+
const setDividerLinewrap = (target) => {
|
|
16
|
+
const firstChild = [].slice.call(target.children)?.[0];
|
|
17
|
+
if (!!firstChild) {
|
|
18
|
+
let prevChild;
|
|
19
|
+
|
|
20
|
+
[].slice.call(target.children).forEach((child) => {
|
|
21
|
+
const baseRect = firstChild.getBoundingClientRect();
|
|
22
|
+
const prevRect = prevChild?.getBoundingClientRect();
|
|
23
|
+
const targetRect = child.getBoundingClientRect();
|
|
24
|
+
|
|
25
|
+
let layout = (child.getAttribute('data-unitone-layout') || '').split(' ');
|
|
26
|
+
if (baseRect.top < targetRect.top) {
|
|
27
|
+
if (!layout.includes('-linewrap')) {
|
|
28
|
+
layout.push('-linewrap');
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
layout = layout.filter((value) => value !== '-linewrap');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (firstChild === child || (!!prevRect?.top && prevRect.top < targetRect.top)) {
|
|
35
|
+
if (!layout.includes('-bol')) {
|
|
36
|
+
layout.push('-bol');
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
layout = layout.filter((value) => value !== '-bol');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
child.setAttribute('data-unitone-layout', layout.join(' '));
|
|
43
|
+
prevChild = child;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const dividersResizeObserver = new ResizeObserver((entries) => {
|
|
49
|
+
for (const entry of entries) {
|
|
50
|
+
setDividerLinewrap(entry.target);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const setColumnCountForVertical = (target) => {
|
|
55
|
+
target.parentNode.style.height = '';
|
|
56
|
+
target.parentNode.style.width = '';
|
|
57
|
+
target.style.columnCount = '';
|
|
58
|
+
|
|
59
|
+
let lastChild;
|
|
60
|
+
[].slice
|
|
61
|
+
.call(target.children)
|
|
62
|
+
.reverse()
|
|
63
|
+
.some((child) => {
|
|
64
|
+
if (!['absolute', 'fixed'].includes(getComputedStyle(child).position)) {
|
|
65
|
+
lastChild = child;
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
if (!lastChild) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// For Firefox
|
|
75
|
+
if (target.getBoundingClientRect().left > lastChild.getBoundingClientRect().left) {
|
|
76
|
+
target.style.columnCount = 'auto';
|
|
77
|
+
target.parentNode.style.width = `${Math.ceil(
|
|
78
|
+
target.getBoundingClientRect().width +
|
|
79
|
+
target.getBoundingClientRect().left -
|
|
80
|
+
lastChild.getBoundingClientRect().left,
|
|
81
|
+
)}px`;
|
|
82
|
+
|
|
83
|
+
if (target.getBoundingClientRect().width >= target.parentNode.getBoundingClientRect().width) {
|
|
84
|
+
target.style.columnCount = '';
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// For Safari
|
|
89
|
+
if (target.getBoundingClientRect().left > lastChild.getBoundingClientRect().left) {
|
|
90
|
+
target.style.columnCount = 2;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const targetY = target.getBoundingClientRect().top + target.getBoundingClientRect().height;
|
|
94
|
+
const lastChildY =
|
|
95
|
+
lastChild.getBoundingClientRect().top + lastChild.getBoundingClientRect().height;
|
|
96
|
+
if (targetY < lastChildY) {
|
|
97
|
+
target.parentNode.style.height = `${Math.ceil(
|
|
98
|
+
lastChildY - target.getBoundingClientRect().top,
|
|
99
|
+
)}px`;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const verticalsResizeObserve = (target) => {
|
|
104
|
+
let prevWidth = 0;
|
|
105
|
+
|
|
106
|
+
const mutationObserver = new MutationObserver((entries) => {
|
|
107
|
+
for (const entry of entries) {
|
|
108
|
+
setColumnCountForVertical(target);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
mutationObserver.observe(target, {
|
|
113
|
+
// attributes: true,
|
|
114
|
+
characterData: true,
|
|
115
|
+
childList: true,
|
|
116
|
+
subtree: true,
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
const resizeObserver = new ResizeObserver((entries, observer) => {
|
|
120
|
+
for (const entry of entries) {
|
|
121
|
+
const width = entry.borderBoxSize?.[0].blockSize;
|
|
122
|
+
if (width !== prevWidth) {
|
|
123
|
+
prevWidth = width;
|
|
124
|
+
observer.unobserve(entry.target);
|
|
125
|
+
setColumnCountForVertical(entry.target);
|
|
126
|
+
observer.observe(entry.target);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
resizeObserver.observe(target);
|
|
132
|
+
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import {
|
|
4
|
+
Decorator,
|
|
5
|
+
Center,
|
|
6
|
+
Container,
|
|
7
|
+
ResponsiveGrid,
|
|
8
|
+
Gutters,
|
|
9
|
+
Stack,
|
|
10
|
+
Text,
|
|
11
|
+
} from '@inc2734/unitone-css';
|
|
10
12
|
|
|
11
13
|
export const Feature1 = ({ items = [], ...props }) => (
|
|
12
14
|
<Decorator backgroundColor={props.backgroundColor} color={props.color}>
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { Decorator } from '
|
|
4
|
-
import { Container } from '../../../layout-primitives/container/Container';
|
|
5
|
-
import { Frame } from '../../../layout-primitives/frame/Frame';
|
|
6
|
-
import { Layers } from '../../../layout-primitives/layers/Layers';
|
|
7
|
-
import { ResponsiveGrid } from '../../../layout-primitives/responsive-grid/ResponsiveGrid';
|
|
8
|
-
import { Gutters } from '../../../layout-primitives/gutters/Gutters';
|
|
3
|
+
import { Decorator, Container, Frame, Layers, ResponsiveGrid, Gutters } from '@inc2734/unitone-css';
|
|
9
4
|
|
|
10
5
|
export const Feature2 = ({ items = [], ...props }) => (
|
|
11
6
|
<Decorator backgroundColor={props.backgroundColor} color={props.color}>
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import {
|
|
4
|
+
Decorator,
|
|
5
|
+
Center,
|
|
6
|
+
Container,
|
|
7
|
+
Cover,
|
|
8
|
+
CoverContent,
|
|
9
|
+
Layers,
|
|
10
|
+
Stack,
|
|
11
|
+
Text,
|
|
12
|
+
} from '@inc2734/unitone-css';
|
|
10
13
|
|
|
11
14
|
export const Header1 = (props) => (
|
|
12
15
|
<Decorator backgroundColor={props.backgroundColor} color={props.color}>
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { Decorator } from '
|
|
4
|
-
import { Center } from '../../../layout-primitives/center/Center';
|
|
5
|
-
import { Container } from '../../../layout-primitives/container/Container';
|
|
6
|
-
import { Gutters } from '../../../layout-primitives/gutters/Gutters';
|
|
7
|
-
import { Stack } from '../../../layout-primitives/stack/Stack';
|
|
8
|
-
import { Text } from '../../../layout-primitives/text/Text';
|
|
3
|
+
import { Decorator, Center, Container, Gutters, Stack, Text } from '@inc2734/unitone-css';
|
|
9
4
|
|
|
10
5
|
export const Header2 = (props) => (
|
|
11
6
|
<Decorator backgroundColor={props.backgroundColor} color={props.color}>
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { Decorator } from '
|
|
4
|
-
import { Center } from '../../../layout-primitives/center/Center';
|
|
5
|
-
import { Container } from '../../../layout-primitives/container/Container';
|
|
6
|
-
import { Gutters } from '../../../layout-primitives/gutters/Gutters';
|
|
7
|
-
import { Stack } from '../../../layout-primitives/stack/Stack';
|
|
8
|
-
import { Text } from '../../../layout-primitives/text/Text';
|
|
3
|
+
import { Decorator, Center, Container, Gutters, Stack, Text } from '@inc2734/unitone-css';
|
|
9
4
|
|
|
10
5
|
export const Header3 = (props) => (
|
|
11
6
|
<Decorator backgroundColor={props.backgroundColor} color={props.color}>
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import {
|
|
4
|
+
Decorator,
|
|
5
|
+
Container,
|
|
6
|
+
Cover,
|
|
7
|
+
CoverContent,
|
|
8
|
+
Layers,
|
|
9
|
+
Stack,
|
|
10
|
+
Text,
|
|
11
|
+
} from '@inc2734/unitone-css';
|
|
9
12
|
|
|
10
13
|
export const Header4 = (props) => (
|
|
11
14
|
<Decorator backgroundColor={props.backgroundColor} color={props.color}>
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import {
|
|
4
|
+
Decorator,
|
|
5
|
+
Container,
|
|
6
|
+
Cover,
|
|
7
|
+
CoverContent,
|
|
8
|
+
Layers,
|
|
9
|
+
Stack,
|
|
10
|
+
Text,
|
|
11
|
+
} from '@inc2734/unitone-css';
|
|
9
12
|
|
|
10
13
|
export const Header5 = (props) => (
|
|
11
14
|
<Decorator backgroundColor={props.backgroundColor} color={props.color}>
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import {
|
|
4
|
+
Decorator,
|
|
5
|
+
Center,
|
|
6
|
+
Container,
|
|
7
|
+
Cover,
|
|
8
|
+
CoverContent,
|
|
9
|
+
Layers,
|
|
10
|
+
Stack,
|
|
11
|
+
Text,
|
|
12
|
+
} from '@inc2734/unitone-css';
|
|
10
13
|
|
|
11
14
|
export const Header6 = (props) => (
|
|
12
15
|
<Decorator backgroundColor={props.backgroundColor} color={props.color}>
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import {
|
|
4
|
+
Decorator,
|
|
5
|
+
Container,
|
|
6
|
+
Cover,
|
|
7
|
+
CoverContent,
|
|
8
|
+
Stack,
|
|
9
|
+
Text,
|
|
10
|
+
WithSidebar,
|
|
11
|
+
} from '@inc2734/unitone-css';
|
|
9
12
|
|
|
10
13
|
export const MediaText1 = (props) => (
|
|
11
14
|
<Decorator color={props.color}>
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import {
|
|
4
|
+
Decorator,
|
|
5
|
+
Container,
|
|
6
|
+
Cover,
|
|
7
|
+
CoverContent,
|
|
8
|
+
Stack,
|
|
9
|
+
WithSidebar,
|
|
10
|
+
} from '@inc2734/unitone-css';
|
|
8
11
|
|
|
9
12
|
export const MediaText2 = (props) => (
|
|
10
13
|
<Decorator color={props.color}>
|