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.
@@ -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
- }
@@ -1,5 +0,0 @@
1
- export type DragItem = {
2
- type: string;
3
- index: number;
4
- id: string;
5
- };
@@ -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
- };