react-align 1.1.6 → 2.0.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/README.md +33 -34
- package/dist/GridArea.d.ts +18 -0
- package/dist/GridItem.d.ts +27 -0
- package/dist/{Grid/GridSection/index.d.ts → GridSection.d.ts} +4 -3
- package/dist/GridWrapper.d.ts +17 -0
- package/dist/Icon/index.d.ts +1 -1
- package/dist/context.d.ts +11 -4
- package/dist/index.d.ts +5 -5
- package/dist/react-align.cjs.development.js +225 -317
- package/dist/react-align.cjs.development.js.map +1 -1
- package/dist/react-align.cjs.production.min.js +1 -1
- package/dist/react-align.cjs.production.min.js.map +1 -1
- package/dist/react-align.esm.js +226 -318
- package/dist/react-align.esm.js.map +1 -1
- package/package.json +7 -12
- package/src/GridArea.tsx +152 -0
- package/src/GridItem.tsx +155 -0
- package/src/GridSection.tsx +53 -0
- package/src/GridWrapper.tsx +87 -0
- package/src/Icon/index.tsx +3 -3
- package/src/context.tsx +8 -4
- package/src/grid.css +80 -0
- package/src/index.tsx +5 -5
- package/dist/Grid/GridArea/index.d.ts +0 -18
- package/dist/Grid/GridItem/index.d.ts +0 -25
- package/dist/Grid/GridWrapper/index.d.ts +0 -12
- package/src/Grid/GridArea/index.tsx +0 -180
- package/src/Grid/GridItem/index.tsx +0 -266
- package/src/Grid/GridSection/index.tsx +0 -46
- package/src/Grid/GridWrapper/index.tsx +0 -39
- package/src/Grid/grid.css +0 -78
- package/src/Grid/interfaces.ts +0 -5
- package/src/stories/GridArea.stories.tsx +0 -28
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React, { CSSProperties } from 'react';
|
|
2
|
-
import { DndProvider } from 'react-dnd';
|
|
3
|
-
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
4
|
-
import { EditorModeContext } from '../../context';
|
|
5
|
-
import '../grid.css';
|
|
6
|
-
|
|
7
|
-
export type GridWrapperProps = {
|
|
8
|
-
className?: string;
|
|
9
|
-
enabled?: boolean;
|
|
10
|
-
vertical?: boolean;
|
|
11
|
-
stretch?: boolean;
|
|
12
|
-
// Extra customizable parts only for the really picky
|
|
13
|
-
styles?: CSSProperties;
|
|
14
|
-
editorStyles?: CSSProperties;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const GridWrapper: React.FC<GridWrapperProps> = ({
|
|
18
|
-
className,
|
|
19
|
-
enabled,
|
|
20
|
-
vertical,
|
|
21
|
-
stretch,
|
|
22
|
-
styles,
|
|
23
|
-
editorStyles,
|
|
24
|
-
children,
|
|
25
|
-
}) => (
|
|
26
|
-
<div
|
|
27
|
-
className={`wrapper ${className} ${vertical && 'vertical'} ${stretch &&
|
|
28
|
-
'stretch'}`}
|
|
29
|
-
style={enabled ? editorStyles : styles}
|
|
30
|
-
>
|
|
31
|
-
<DndProvider backend={HTML5Backend}>
|
|
32
|
-
<EditorModeContext.Provider value={{ enabled }}>
|
|
33
|
-
{children}
|
|
34
|
-
</EditorModeContext.Provider>
|
|
35
|
-
</DndProvider>
|
|
36
|
-
</div>
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
export default GridWrapper;
|
package/src/Grid/grid.css
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/* Default component styles */
|
|
2
|
-
.wrapper {
|
|
3
|
-
height: 100%;
|
|
4
|
-
display: flex;
|
|
5
|
-
justify-content: space-between;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.section {
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
justify-content: space-between;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.area {
|
|
15
|
-
display: flex;
|
|
16
|
-
border: 1px solid transparent;
|
|
17
|
-
box-sizing: border-box;
|
|
18
|
-
border-radius: 8px;
|
|
19
|
-
position: relative;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.area-transition-in {
|
|
23
|
-
transition: all 0.3s ease-in-out, min-height 0.5s ease-in-out 0.2s, min-width 0.5s ease-in-out 0.2s;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.area-transition-out {
|
|
27
|
-
transition: all 0.3s ease-in-out 0.4s, min-height 0.5s ease-in-out 0.2s, min-width 0.5s ease-in-out 0.2s;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.item {
|
|
31
|
-
border: 1px solid transparent;
|
|
32
|
-
box-sizing: border-box;
|
|
33
|
-
margin: 6px;
|
|
34
|
-
border-radius: 6px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/* Variable styles */
|
|
38
|
-
|
|
39
|
-
.vertical {
|
|
40
|
-
flex-direction: column;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.vertical-r {
|
|
44
|
-
flex-direction: column-reverse;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.horizontal {
|
|
48
|
-
flex-direction: row;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.horizontal-r {
|
|
52
|
-
flex-direction: row-reverse;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.stretch {
|
|
56
|
-
flex: auto;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.middle {
|
|
60
|
-
flex-grow: 0;
|
|
61
|
-
flex: auto;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.just-centered {
|
|
65
|
-
justify-content: center;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.just-end {
|
|
69
|
-
justify-content: flex-end;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.end {
|
|
73
|
-
align-items:flex-end;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.hide {
|
|
77
|
-
display: none;
|
|
78
|
-
}
|
package/src/Grid/interfaces.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React, { ComponentProps } from 'react';
|
|
2
|
-
import { Story } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import GridWrapper from '../Grid/GridWrapper';
|
|
5
|
-
import GridSection from '../Grid/GridSection';
|
|
6
|
-
import GridArea from '../Grid/GridArea';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: 'Grid',
|
|
10
|
-
component: GridArea,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const BasicOneAreaOneItem: Story<ComponentProps<typeof GridArea>> = args => (
|
|
14
|
-
<div style={{ width: '500px', height: '600px' }}>
|
|
15
|
-
<GridWrapper>
|
|
16
|
-
<GridSection>
|
|
17
|
-
<GridArea {...args} />
|
|
18
|
-
</GridSection>
|
|
19
|
-
</GridWrapper>
|
|
20
|
-
</div>
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
export const Wrapper = BasicOneAreaOneItem.bind({});
|
|
24
|
-
Wrapper.args = {
|
|
25
|
-
styles: {
|
|
26
|
-
background: '#4770FF',
|
|
27
|
-
},
|
|
28
|
-
};
|