@salutejs/sdds-cs 0.226.1-dev.0 → 0.227.0-canary.1657.12529257851.0
Sign up to get free protection for your applications and to get access to all the features.
- package/api/sdds-cs.api.md +6 -0
- package/components/Flow/Flow.config.d.ts +4 -0
- package/components/Flow/Flow.config.js +10 -0
- package/components/Flow/Flow.d.ts +4 -0
- package/components/Flow/Flow.js +10 -0
- package/components/Flow/index.d.ts +1 -0
- package/components/Flow/index.js +12 -0
- package/emotion/cjs/components/Flow/Flow.config.js +10 -0
- package/emotion/cjs/components/Flow/Flow.js +10 -0
- package/emotion/cjs/components/Flow/Flow.stories.tsx +133 -0
- package/emotion/cjs/components/Flow/index.js +12 -0
- package/emotion/cjs/index.js +11 -0
- package/emotion/es/components/Flow/Flow.config.js +4 -0
- package/emotion/es/components/Flow/Flow.js +4 -0
- package/emotion/es/components/Flow/Flow.stories.tsx +133 -0
- package/emotion/es/components/Flow/index.js +1 -0
- package/emotion/es/index.js +1 -0
- package/es/components/Flow/Flow.config.js +4 -0
- package/es/components/Flow/Flow.js +4 -0
- package/es/components/Flow/index.js +1 -0
- package/es/index.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +11 -0
- package/package.json +3 -3
package/api/sdds-cs.api.md
CHANGED
@@ -109,6 +109,7 @@ import { dsplSBold } from '@salutejs/sdds-themes/tokens';
|
|
109
109
|
import { FC } from 'react';
|
110
110
|
import { FileProcessHandler } from '@salutejs/plasma-new-hope/types/components/Dropzone/Dropzone.types';
|
111
111
|
import { Filter } from '@salutejs/plasma-new-hope/types/engines/types';
|
112
|
+
import { FlowProps } from '@salutejs/plasma-new-hope/styled-components';
|
112
113
|
import { FormTypeNumber } from '@salutejs/plasma-new-hope/types/types/FormType';
|
113
114
|
import { FormTypeString } from '@salutejs/plasma-new-hope/types/types/FormType';
|
114
115
|
import { ForwardRefExoticComponent } from 'react';
|
@@ -1613,6 +1614,11 @@ xs: PolymorphicClassName;
|
|
1613
1614
|
};
|
1614
1615
|
}> & Props_2 & RefAttributes<HTMLDivElement>>;
|
1615
1616
|
|
1617
|
+
// @public (undocumented)
|
1618
|
+
export const Flow: FunctionComponent<PropsType< {}> & FlowProps & {
|
1619
|
+
minColWidth?: string | undefined;
|
1620
|
+
} & RefAttributes<HTMLDivElement>>;
|
1621
|
+
|
1616
1622
|
// @public (undocumented)
|
1617
1623
|
export const Grid: FunctionComponent<PropsType< {
|
1618
1624
|
view: {
|
@@ -0,0 +1,4 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
export declare const Flow: import("react").FunctionComponent<import("@salutejs/plasma-new-hope/types/engines/types").PropsType<{}> & import("@salutejs/plasma-new-hope/styled-components").FlowProps & {
|
3
|
+
minColWidth?: string | undefined;
|
4
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.Flow = void 0;
|
7
|
+
var _styledComponents = /*#__PURE__*/require("@salutejs/plasma-new-hope/styled-components");
|
8
|
+
var _Flow = /*#__PURE__*/require("./Flow.config");
|
9
|
+
var mergedConfig = /*#__PURE__*/(0, _styledComponents.mergeConfig)(_styledComponents.flowConfig, _Flow.config);
|
10
|
+
var Flow = exports.Flow = /*#__PURE__*/(0, _styledComponents.component)(mergedConfig);
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Flow } from './Flow';
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.Flow = void 0;
|
7
|
+
var _emotion = /*#__PURE__*/require("@salutejs/plasma-new-hope/emotion");
|
8
|
+
var _Flow = /*#__PURE__*/require("./Flow.config");
|
9
|
+
var mergedConfig = /*#__PURE__*/(0, _emotion.mergeConfig)(_emotion.flowConfig, _Flow.config);
|
10
|
+
var Flow = exports.Flow = /*#__PURE__*/(0, _emotion.component)(mergedConfig);
|
@@ -0,0 +1,133 @@
|
|
1
|
+
import React, { ComponentProps } from 'react';
|
2
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
3
|
+
import { InSpacingDecorator, disableProps } from '@salutejs/plasma-sb-utils';
|
4
|
+
import styled from 'styled-components';
|
5
|
+
|
6
|
+
import { Flow } from './Flow';
|
7
|
+
|
8
|
+
const orientations = ['vertical', 'horizontal'];
|
9
|
+
const arrangements = ['start', 'center', 'end', 'spaceBetween', 'spaceAround'];
|
10
|
+
const alignments = ['start', 'center', 'end'];
|
11
|
+
|
12
|
+
const widths = [100, 32, 171, 74, 179, 55];
|
13
|
+
const heights = [10, 50, 45, 33, 14, 55];
|
14
|
+
|
15
|
+
const FlowCustom = styled(Flow)`
|
16
|
+
background: var(--surface-transparent-accent-hover);
|
17
|
+
border-radius: 0.5rem;
|
18
|
+
`;
|
19
|
+
|
20
|
+
const Item = styled.div`
|
21
|
+
padding: 0.5rem 1rem;
|
22
|
+
border-radius: 0.5rem;
|
23
|
+
background: #aab1e9;
|
24
|
+
display: flex;
|
25
|
+
align-items: center;
|
26
|
+
justify-content: center;
|
27
|
+
`;
|
28
|
+
|
29
|
+
const meta: Meta<typeof Flow> = {
|
30
|
+
title: 'Layout/Flow',
|
31
|
+
component: Flow,
|
32
|
+
decorators: [InSpacingDecorator],
|
33
|
+
argTypes: {
|
34
|
+
itemsCount: {
|
35
|
+
control: {
|
36
|
+
type: 'number',
|
37
|
+
},
|
38
|
+
},
|
39
|
+
containerWidth: {
|
40
|
+
control: {
|
41
|
+
type: 'text',
|
42
|
+
},
|
43
|
+
},
|
44
|
+
containerHeight: {
|
45
|
+
control: {
|
46
|
+
type: 'text',
|
47
|
+
},
|
48
|
+
},
|
49
|
+
orientation: {
|
50
|
+
options: orientations,
|
51
|
+
control: {
|
52
|
+
type: 'select',
|
53
|
+
},
|
54
|
+
},
|
55
|
+
arrangement: {
|
56
|
+
options: arrangements,
|
57
|
+
control: {
|
58
|
+
type: 'select',
|
59
|
+
},
|
60
|
+
},
|
61
|
+
alignment: {
|
62
|
+
options: alignments,
|
63
|
+
control: {
|
64
|
+
type: 'select',
|
65
|
+
},
|
66
|
+
},
|
67
|
+
mainAxisGap: {
|
68
|
+
control: {
|
69
|
+
type: 'text',
|
70
|
+
},
|
71
|
+
},
|
72
|
+
crossAxisGap: {
|
73
|
+
control: {
|
74
|
+
type: 'text',
|
75
|
+
},
|
76
|
+
},
|
77
|
+
itemsPerLine: {
|
78
|
+
control: {
|
79
|
+
type: 'text',
|
80
|
+
},
|
81
|
+
},
|
82
|
+
minColWidth: {
|
83
|
+
control: {
|
84
|
+
type: 'text',
|
85
|
+
},
|
86
|
+
},
|
87
|
+
...disableProps(['minColWidth']),
|
88
|
+
},
|
89
|
+
};
|
90
|
+
|
91
|
+
export default meta;
|
92
|
+
|
93
|
+
type Story = StoryObj<typeof Flow>;
|
94
|
+
|
95
|
+
export const Default: Story = {
|
96
|
+
args: {
|
97
|
+
containerWidth: '450px',
|
98
|
+
containerHeight: '200px',
|
99
|
+
orientation: 'horizontal',
|
100
|
+
arrangement: 'start',
|
101
|
+
alignment: 'start',
|
102
|
+
mainAxisGap: '10',
|
103
|
+
crossAxisGap: '10',
|
104
|
+
itemsPerLine: '',
|
105
|
+
itemsCount: 6,
|
106
|
+
},
|
107
|
+
render: ({ itemsCount, containerWidth, containerHeight, ...args }: ComponentProps<typeof Flow>) => {
|
108
|
+
const hasLines = Boolean(args.itemsPerLine);
|
109
|
+
|
110
|
+
return (
|
111
|
+
<FlowCustom {...args} style={{ width: containerWidth, height: containerHeight }}>
|
112
|
+
{new Array(itemsCount).fill(null).map((width, index) => (
|
113
|
+
<Item
|
114
|
+
key={index}
|
115
|
+
style={
|
116
|
+
hasLines
|
117
|
+
? {
|
118
|
+
minWidth: widths[index % widths.length],
|
119
|
+
minHeight: heights[index % heights.length],
|
120
|
+
}
|
121
|
+
: {
|
122
|
+
width: widths[index % widths.length],
|
123
|
+
height: heights[index % heights.length],
|
124
|
+
}
|
125
|
+
}
|
126
|
+
>
|
127
|
+
{index + 1}
|
128
|
+
</Item>
|
129
|
+
))}
|
130
|
+
</FlowCustom>
|
131
|
+
);
|
132
|
+
},
|
133
|
+
};
|
package/emotion/cjs/index.js
CHANGED
@@ -91,6 +91,17 @@ Object.keys(_Drawer).forEach(function (key) {
|
|
91
91
|
}
|
92
92
|
});
|
93
93
|
});
|
94
|
+
var _Flow = /*#__PURE__*/require("./components/Flow");
|
95
|
+
Object.keys(_Flow).forEach(function (key) {
|
96
|
+
if (key === "default" || key === "__esModule") return;
|
97
|
+
if (key in exports && exports[key] === _Flow[key]) return;
|
98
|
+
Object.defineProperty(exports, key, {
|
99
|
+
enumerable: true,
|
100
|
+
get: function get() {
|
101
|
+
return _Flow[key];
|
102
|
+
}
|
103
|
+
});
|
104
|
+
});
|
94
105
|
var _Grid = /*#__PURE__*/require("./components/Grid");
|
95
106
|
Object.keys(_Grid).forEach(function (key) {
|
96
107
|
if (key === "default" || key === "__esModule") return;
|
@@ -0,0 +1,133 @@
|
|
1
|
+
import React, { ComponentProps } from 'react';
|
2
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
3
|
+
import { InSpacingDecorator, disableProps } from '@salutejs/plasma-sb-utils';
|
4
|
+
import styled from 'styled-components';
|
5
|
+
|
6
|
+
import { Flow } from './Flow';
|
7
|
+
|
8
|
+
const orientations = ['vertical', 'horizontal'];
|
9
|
+
const arrangements = ['start', 'center', 'end', 'spaceBetween', 'spaceAround'];
|
10
|
+
const alignments = ['start', 'center', 'end'];
|
11
|
+
|
12
|
+
const widths = [100, 32, 171, 74, 179, 55];
|
13
|
+
const heights = [10, 50, 45, 33, 14, 55];
|
14
|
+
|
15
|
+
const FlowCustom = styled(Flow)`
|
16
|
+
background: var(--surface-transparent-accent-hover);
|
17
|
+
border-radius: 0.5rem;
|
18
|
+
`;
|
19
|
+
|
20
|
+
const Item = styled.div`
|
21
|
+
padding: 0.5rem 1rem;
|
22
|
+
border-radius: 0.5rem;
|
23
|
+
background: #aab1e9;
|
24
|
+
display: flex;
|
25
|
+
align-items: center;
|
26
|
+
justify-content: center;
|
27
|
+
`;
|
28
|
+
|
29
|
+
const meta: Meta<typeof Flow> = {
|
30
|
+
title: 'Layout/Flow',
|
31
|
+
component: Flow,
|
32
|
+
decorators: [InSpacingDecorator],
|
33
|
+
argTypes: {
|
34
|
+
itemsCount: {
|
35
|
+
control: {
|
36
|
+
type: 'number',
|
37
|
+
},
|
38
|
+
},
|
39
|
+
containerWidth: {
|
40
|
+
control: {
|
41
|
+
type: 'text',
|
42
|
+
},
|
43
|
+
},
|
44
|
+
containerHeight: {
|
45
|
+
control: {
|
46
|
+
type: 'text',
|
47
|
+
},
|
48
|
+
},
|
49
|
+
orientation: {
|
50
|
+
options: orientations,
|
51
|
+
control: {
|
52
|
+
type: 'select',
|
53
|
+
},
|
54
|
+
},
|
55
|
+
arrangement: {
|
56
|
+
options: arrangements,
|
57
|
+
control: {
|
58
|
+
type: 'select',
|
59
|
+
},
|
60
|
+
},
|
61
|
+
alignment: {
|
62
|
+
options: alignments,
|
63
|
+
control: {
|
64
|
+
type: 'select',
|
65
|
+
},
|
66
|
+
},
|
67
|
+
mainAxisGap: {
|
68
|
+
control: {
|
69
|
+
type: 'text',
|
70
|
+
},
|
71
|
+
},
|
72
|
+
crossAxisGap: {
|
73
|
+
control: {
|
74
|
+
type: 'text',
|
75
|
+
},
|
76
|
+
},
|
77
|
+
itemsPerLine: {
|
78
|
+
control: {
|
79
|
+
type: 'text',
|
80
|
+
},
|
81
|
+
},
|
82
|
+
minColWidth: {
|
83
|
+
control: {
|
84
|
+
type: 'text',
|
85
|
+
},
|
86
|
+
},
|
87
|
+
...disableProps(['minColWidth']),
|
88
|
+
},
|
89
|
+
};
|
90
|
+
|
91
|
+
export default meta;
|
92
|
+
|
93
|
+
type Story = StoryObj<typeof Flow>;
|
94
|
+
|
95
|
+
export const Default: Story = {
|
96
|
+
args: {
|
97
|
+
containerWidth: '450px',
|
98
|
+
containerHeight: '200px',
|
99
|
+
orientation: 'horizontal',
|
100
|
+
arrangement: 'start',
|
101
|
+
alignment: 'start',
|
102
|
+
mainAxisGap: '10',
|
103
|
+
crossAxisGap: '10',
|
104
|
+
itemsPerLine: '',
|
105
|
+
itemsCount: 6,
|
106
|
+
},
|
107
|
+
render: ({ itemsCount, containerWidth, containerHeight, ...args }: ComponentProps<typeof Flow>) => {
|
108
|
+
const hasLines = Boolean(args.itemsPerLine);
|
109
|
+
|
110
|
+
return (
|
111
|
+
<FlowCustom {...args} style={{ width: containerWidth, height: containerHeight }}>
|
112
|
+
{new Array(itemsCount).fill(null).map((width, index) => (
|
113
|
+
<Item
|
114
|
+
key={index}
|
115
|
+
style={
|
116
|
+
hasLines
|
117
|
+
? {
|
118
|
+
minWidth: widths[index % widths.length],
|
119
|
+
minHeight: heights[index % heights.length],
|
120
|
+
}
|
121
|
+
: {
|
122
|
+
width: widths[index % widths.length],
|
123
|
+
height: heights[index % heights.length],
|
124
|
+
}
|
125
|
+
}
|
126
|
+
>
|
127
|
+
{index + 1}
|
128
|
+
</Item>
|
129
|
+
))}
|
130
|
+
</FlowCustom>
|
131
|
+
);
|
132
|
+
},
|
133
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Flow } from './Flow';
|
package/emotion/es/index.js
CHANGED
@@ -6,6 +6,7 @@ export * from './components/Button';
|
|
6
6
|
export * from './components/ButtonGroup';
|
7
7
|
export * from './components/Divider';
|
8
8
|
export * from './components/Drawer';
|
9
|
+
export * from './components/Flow';
|
9
10
|
export * from './components/Grid';
|
10
11
|
export * from './components/Calendar';
|
11
12
|
export * from './components/Checkbox';
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Flow } from './Flow';
|
package/es/index.js
CHANGED
@@ -6,6 +6,7 @@ export * from './components/Button';
|
|
6
6
|
export * from './components/ButtonGroup';
|
7
7
|
export * from './components/Divider';
|
8
8
|
export * from './components/Drawer';
|
9
|
+
export * from './components/Flow';
|
9
10
|
export * from './components/Grid';
|
10
11
|
export * from './components/Calendar';
|
11
12
|
export * from './components/Checkbox';
|
package/index.d.ts
CHANGED
@@ -6,6 +6,7 @@ export * from './components/Button';
|
|
6
6
|
export * from './components/ButtonGroup';
|
7
7
|
export * from './components/Divider';
|
8
8
|
export * from './components/Drawer';
|
9
|
+
export * from './components/Flow';
|
9
10
|
export * from './components/Grid';
|
10
11
|
export * from './components/Calendar';
|
11
12
|
export * from './components/Checkbox';
|
package/index.js
CHANGED
@@ -91,6 +91,17 @@ Object.keys(_Drawer).forEach(function (key) {
|
|
91
91
|
}
|
92
92
|
});
|
93
93
|
});
|
94
|
+
var _Flow = /*#__PURE__*/require("./components/Flow");
|
95
|
+
Object.keys(_Flow).forEach(function (key) {
|
96
|
+
if (key === "default" || key === "__esModule") return;
|
97
|
+
if (key in exports && exports[key] === _Flow[key]) return;
|
98
|
+
Object.defineProperty(exports, key, {
|
99
|
+
enumerable: true,
|
100
|
+
get: function get() {
|
101
|
+
return _Flow[key];
|
102
|
+
}
|
103
|
+
});
|
104
|
+
});
|
94
105
|
var _Grid = /*#__PURE__*/require("./components/Grid");
|
95
106
|
Object.keys(_Grid).forEach(function (key) {
|
96
107
|
if (key === "default" || key === "__esModule") return;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@salutejs/sdds-cs",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.227.0-canary.1657.12529257851.0",
|
4
4
|
"description": "Salute Design System / React UI kit for SDDS CS web applications",
|
5
5
|
"author": "Salute Frontend Team <salute.developers@gmail.com>",
|
6
6
|
"license": "MIT",
|
@@ -52,7 +52,7 @@
|
|
52
52
|
"directory": "packages/sdds-cs"
|
53
53
|
},
|
54
54
|
"dependencies": {
|
55
|
-
"@salutejs/plasma-new-hope": "0.
|
55
|
+
"@salutejs/plasma-new-hope": "0.238.0-canary.1657.12529257851.0",
|
56
56
|
"@salutejs/sdds-themes": "0.31.0"
|
57
57
|
},
|
58
58
|
"peerDependencies": {
|
@@ -144,5 +144,5 @@
|
|
144
144
|
"Anton Vinogradov"
|
145
145
|
],
|
146
146
|
"sideEffects": false,
|
147
|
-
"gitHead": "
|
147
|
+
"gitHead": "7e6a7ce00dd6e5a247ae4486e66f4d0631c83a3a"
|
148
148
|
}
|