@salutejs/plasma-new-hope 0.237.1-dev.0 → 0.238.0-canary.1657.12529257851.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/cjs/components/Flow/Flow.css +2 -0
- package/cjs/components/Flow/Flow.js +84 -0
- package/cjs/components/Flow/Flow.js.map +1 -0
- package/cjs/components/Flow/Flow.styles.js +17 -0
- package/cjs/components/Flow/Flow.styles.js.map +1 -0
- package/cjs/components/Flow/Flow.styles_q8k0on.css +2 -0
- package/cjs/index.css +3 -0
- package/cjs/index.js +3 -0
- package/cjs/index.js.map +1 -1
- package/emotion/cjs/components/Flow/Flow.js +92 -0
- package/emotion/cjs/components/Flow/Flow.styles.js +31 -0
- package/emotion/cjs/components/Flow/Flow.template-doc.mdx +127 -0
- package/emotion/cjs/components/Flow/Flow.types.js +5 -0
- package/emotion/cjs/components/Flow/index.js +18 -0
- package/emotion/cjs/examples/plasma_b2c/components/Flow/Flow.config.js +10 -0
- package/emotion/cjs/examples/plasma_b2c/components/Flow/Flow.js +11 -0
- package/emotion/cjs/examples/plasma_b2c/components/Flow/Flow.stories.tsx +135 -0
- package/emotion/cjs/examples/plasma_web/components/Flow/Flow.config.js +10 -0
- package/emotion/cjs/examples/plasma_web/components/Flow/Flow.js +11 -0
- package/emotion/cjs/examples/plasma_web/components/Flow/Flow.stories.tsx +135 -0
- package/emotion/cjs/index.js +11 -0
- package/emotion/es/components/Flow/Flow.js +83 -0
- package/emotion/es/components/Flow/Flow.styles.js +24 -0
- package/emotion/es/components/Flow/Flow.template-doc.mdx +127 -0
- package/emotion/es/components/Flow/Flow.types.js +1 -0
- package/emotion/es/components/Flow/index.js +1 -0
- package/emotion/es/examples/plasma_b2c/components/Flow/Flow.config.js +4 -0
- package/emotion/es/examples/plasma_b2c/components/Flow/Flow.js +5 -0
- package/emotion/es/examples/plasma_b2c/components/Flow/Flow.stories.tsx +135 -0
- package/emotion/es/examples/plasma_web/components/Flow/Flow.config.js +4 -0
- package/emotion/es/examples/plasma_web/components/Flow/Flow.js +5 -0
- package/emotion/es/examples/plasma_web/components/Flow/Flow.stories.tsx +135 -0
- package/emotion/es/index.js +2 -0
- package/es/components/Flow/Flow.css +2 -0
- package/es/components/Flow/Flow.js +79 -0
- package/es/components/Flow/Flow.js.map +1 -0
- package/es/components/Flow/Flow.styles.js +12 -0
- package/es/components/Flow/Flow.styles.js.map +1 -0
- package/es/components/Flow/Flow.styles_q8k0on.css +2 -0
- package/es/index.css +3 -0
- package/es/index.js +1 -0
- package/es/index.js.map +1 -1
- package/package.json +4 -2
- package/styled-components/cjs/components/Flow/Flow.js +92 -0
- package/styled-components/cjs/components/Flow/Flow.styles.js +16 -0
- package/styled-components/cjs/components/Flow/Flow.template-doc.mdx +127 -0
- package/styled-components/cjs/components/Flow/Flow.types.js +5 -0
- package/styled-components/cjs/components/Flow/index.js +18 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Flow/Flow.config.js +10 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Flow/Flow.js +11 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Flow/Flow.stories.tsx +135 -0
- package/styled-components/cjs/examples/plasma_web/components/Flow/Flow.config.js +10 -0
- package/styled-components/cjs/examples/plasma_web/components/Flow/Flow.js +11 -0
- package/styled-components/cjs/examples/plasma_web/components/Flow/Flow.stories.tsx +135 -0
- package/styled-components/cjs/index.js +11 -0
- package/styled-components/es/components/Flow/Flow.js +83 -0
- package/styled-components/es/components/Flow/Flow.styles.js +8 -0
- package/styled-components/es/components/Flow/Flow.template-doc.mdx +127 -0
- package/styled-components/es/components/Flow/Flow.types.js +1 -0
- package/styled-components/es/components/Flow/index.js +1 -0
- package/styled-components/es/examples/plasma_b2c/components/Flow/Flow.config.js +4 -0
- package/styled-components/es/examples/plasma_b2c/components/Flow/Flow.js +5 -0
- package/styled-components/es/examples/plasma_b2c/components/Flow/Flow.stories.tsx +135 -0
- package/styled-components/es/examples/plasma_web/components/Flow/Flow.config.js +4 -0
- package/styled-components/es/examples/plasma_web/components/Flow/Flow.js +5 -0
- package/styled-components/es/examples/plasma_web/components/Flow/Flow.stories.tsx +135 -0
- package/styled-components/es/index.js +2 -0
- package/types/components/Flow/Flow.d.ts +33 -0
- package/types/components/Flow/Flow.d.ts.map +1 -0
- package/types/components/Flow/Flow.styles.d.ts +4 -0
- package/types/components/Flow/Flow.styles.d.ts.map +1 -0
- package/types/components/Flow/Flow.types.d.ts +34 -0
- package/types/components/Flow/Flow.types.d.ts.map +1 -0
- package/types/components/Flow/index.d.ts +3 -0
- package/types/components/Flow/index.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Flow/Flow.config.d.ts +5 -0
- package/types/examples/plasma_b2c/components/Flow/Flow.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Flow/Flow.d.ts +5 -0
- package/types/examples/plasma_b2c/components/Flow/Flow.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Flow/Flow.config.d.ts +5 -0
- package/types/examples/plasma_web/components/Flow/Flow.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Flow/Flow.d.ts +5 -0
- package/types/examples/plasma_web/components/Flow/Flow.d.ts.map +1 -0
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -1
@@ -0,0 +1,135 @@
|
|
1
|
+
import React, { ComponentProps } from 'react';
|
2
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
3
|
+
import styled from 'styled-components';
|
4
|
+
import { disableProps } from '@salutejs/plasma-sb-utils';
|
5
|
+
|
6
|
+
import { WithTheme } from '../../../_helpers';
|
7
|
+
|
8
|
+
import { Flow } from './Flow';
|
9
|
+
|
10
|
+
const orientations = ['vertical', 'horizontal'];
|
11
|
+
const arrangements = ['start', 'center', 'end', 'spaceBetween', 'spaceAround'];
|
12
|
+
const alignments = ['start', 'center', 'end'];
|
13
|
+
|
14
|
+
const widths = [100, 32, 171, 74, 179, 55];
|
15
|
+
const heights = [10, 50, 45, 33, 14, 55];
|
16
|
+
|
17
|
+
const FlowCustom = styled(Flow)`
|
18
|
+
background: var(--surface-transparent-primary);
|
19
|
+
border-radius: 0.5rem;
|
20
|
+
`;
|
21
|
+
|
22
|
+
const Item = styled.div`
|
23
|
+
padding: 0.5rem 1rem;
|
24
|
+
border-radius: 0.5rem;
|
25
|
+
background: #aab1e9;
|
26
|
+
display: flex;
|
27
|
+
align-items: center;
|
28
|
+
justify-content: center;
|
29
|
+
`;
|
30
|
+
|
31
|
+
const meta: Meta<typeof Flow> = {
|
32
|
+
title: 'b2c/Layout/Flow',
|
33
|
+
component: Flow,
|
34
|
+
decorators: [WithTheme],
|
35
|
+
argTypes: {
|
36
|
+
itemsCount: {
|
37
|
+
control: {
|
38
|
+
type: 'number',
|
39
|
+
},
|
40
|
+
},
|
41
|
+
containerWidth: {
|
42
|
+
control: {
|
43
|
+
type: 'text',
|
44
|
+
},
|
45
|
+
},
|
46
|
+
containerHeight: {
|
47
|
+
control: {
|
48
|
+
type: 'text',
|
49
|
+
},
|
50
|
+
},
|
51
|
+
orientation: {
|
52
|
+
options: orientations,
|
53
|
+
control: {
|
54
|
+
type: 'select',
|
55
|
+
},
|
56
|
+
},
|
57
|
+
arrangement: {
|
58
|
+
options: arrangements,
|
59
|
+
control: {
|
60
|
+
type: 'select',
|
61
|
+
},
|
62
|
+
},
|
63
|
+
alignment: {
|
64
|
+
options: alignments,
|
65
|
+
control: {
|
66
|
+
type: 'select',
|
67
|
+
},
|
68
|
+
},
|
69
|
+
mainAxisGap: {
|
70
|
+
control: {
|
71
|
+
type: 'text',
|
72
|
+
},
|
73
|
+
},
|
74
|
+
crossAxisGap: {
|
75
|
+
control: {
|
76
|
+
type: 'text',
|
77
|
+
},
|
78
|
+
},
|
79
|
+
itemsPerLine: {
|
80
|
+
control: {
|
81
|
+
type: 'text',
|
82
|
+
},
|
83
|
+
},
|
84
|
+
minColWidth: {
|
85
|
+
control: {
|
86
|
+
type: 'text',
|
87
|
+
},
|
88
|
+
},
|
89
|
+
...disableProps(['minColWidth']),
|
90
|
+
},
|
91
|
+
};
|
92
|
+
|
93
|
+
export default meta;
|
94
|
+
|
95
|
+
type Story = StoryObj<typeof Flow>;
|
96
|
+
|
97
|
+
export const Default: Story = {
|
98
|
+
args: {
|
99
|
+
containerWidth: '450px',
|
100
|
+
containerHeight: '200px',
|
101
|
+
orientation: 'horizontal',
|
102
|
+
arrangement: 'start',
|
103
|
+
alignment: 'start',
|
104
|
+
mainAxisGap: '10',
|
105
|
+
crossAxisGap: '10',
|
106
|
+
itemsPerLine: '',
|
107
|
+
itemsCount: 6,
|
108
|
+
},
|
109
|
+
render: ({ itemsCount, containerWidth, containerHeight, ...args }: ComponentProps<typeof Flow>) => {
|
110
|
+
const hasLines = Boolean(args.itemsPerLine);
|
111
|
+
|
112
|
+
return (
|
113
|
+
<FlowCustom {...args} style={{ width: containerWidth, height: containerHeight }}>
|
114
|
+
{new Array(itemsCount).fill(null).map((width, index) => (
|
115
|
+
<Item
|
116
|
+
key={index}
|
117
|
+
style={
|
118
|
+
hasLines
|
119
|
+
? {
|
120
|
+
minWidth: widths[index % widths.length],
|
121
|
+
minHeight: heights[index % heights.length],
|
122
|
+
}
|
123
|
+
: {
|
124
|
+
width: widths[index % widths.length],
|
125
|
+
height: heights[index % heights.length],
|
126
|
+
}
|
127
|
+
}
|
128
|
+
>
|
129
|
+
{index + 1}
|
130
|
+
</Item>
|
131
|
+
))}
|
132
|
+
</FlowCustom>
|
133
|
+
);
|
134
|
+
},
|
135
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.Flow = void 0;
|
7
|
+
var _Flow = /*#__PURE__*/require("../../../../components/Flow");
|
8
|
+
var _engines = /*#__PURE__*/require("../../../../engines");
|
9
|
+
var _Flow2 = /*#__PURE__*/require("./Flow.config");
|
10
|
+
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_Flow.flowConfig, _Flow2.config);
|
11
|
+
var Flow = exports.Flow = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
@@ -0,0 +1,135 @@
|
|
1
|
+
import React, { ComponentProps } from 'react';
|
2
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
3
|
+
import styled from 'styled-components';
|
4
|
+
import { disableProps } from '@salutejs/plasma-sb-utils';
|
5
|
+
|
6
|
+
import { WithTheme } from '../../../_helpers';
|
7
|
+
|
8
|
+
import { Flow } from './Flow';
|
9
|
+
|
10
|
+
const orientations = ['vertical', 'horizontal'];
|
11
|
+
const arrangements = ['start', 'center', 'end', 'spaceBetween', 'spaceAround'];
|
12
|
+
const alignments = ['start', 'center', 'end'];
|
13
|
+
|
14
|
+
const widths = [100, 32, 171, 74, 179, 55];
|
15
|
+
const heights = [10, 50, 45, 33, 14, 55];
|
16
|
+
|
17
|
+
const FlowCustom = styled(Flow)`
|
18
|
+
background: var(--surface-transparent-primary);
|
19
|
+
border-radius: 0.5rem;
|
20
|
+
`;
|
21
|
+
|
22
|
+
const Item = styled.div`
|
23
|
+
padding: 0.5rem 1rem;
|
24
|
+
border-radius: 0.5rem;
|
25
|
+
background: #aab1e9;
|
26
|
+
display: flex;
|
27
|
+
align-items: center;
|
28
|
+
justify-content: center;
|
29
|
+
`;
|
30
|
+
|
31
|
+
const meta: Meta<typeof Flow> = {
|
32
|
+
title: 'web/Layout/Flow',
|
33
|
+
component: Flow,
|
34
|
+
decorators: [WithTheme],
|
35
|
+
argTypes: {
|
36
|
+
itemsCount: {
|
37
|
+
control: {
|
38
|
+
type: 'number',
|
39
|
+
},
|
40
|
+
},
|
41
|
+
containerWidth: {
|
42
|
+
control: {
|
43
|
+
type: 'text',
|
44
|
+
},
|
45
|
+
},
|
46
|
+
containerHeight: {
|
47
|
+
control: {
|
48
|
+
type: 'text',
|
49
|
+
},
|
50
|
+
},
|
51
|
+
orientation: {
|
52
|
+
options: orientations,
|
53
|
+
control: {
|
54
|
+
type: 'select',
|
55
|
+
},
|
56
|
+
},
|
57
|
+
arrangement: {
|
58
|
+
options: arrangements,
|
59
|
+
control: {
|
60
|
+
type: 'select',
|
61
|
+
},
|
62
|
+
},
|
63
|
+
alignment: {
|
64
|
+
options: alignments,
|
65
|
+
control: {
|
66
|
+
type: 'select',
|
67
|
+
},
|
68
|
+
},
|
69
|
+
mainAxisGap: {
|
70
|
+
control: {
|
71
|
+
type: 'text',
|
72
|
+
},
|
73
|
+
},
|
74
|
+
crossAxisGap: {
|
75
|
+
control: {
|
76
|
+
type: 'text',
|
77
|
+
},
|
78
|
+
},
|
79
|
+
itemsPerLine: {
|
80
|
+
control: {
|
81
|
+
type: 'text',
|
82
|
+
},
|
83
|
+
},
|
84
|
+
minColWidth: {
|
85
|
+
control: {
|
86
|
+
type: 'text',
|
87
|
+
},
|
88
|
+
},
|
89
|
+
...disableProps(['minColWidth']),
|
90
|
+
},
|
91
|
+
};
|
92
|
+
|
93
|
+
export default meta;
|
94
|
+
|
95
|
+
type Story = StoryObj<typeof Flow>;
|
96
|
+
|
97
|
+
export const Default: Story = {
|
98
|
+
args: {
|
99
|
+
containerWidth: '450px',
|
100
|
+
containerHeight: '200px',
|
101
|
+
orientation: 'horizontal',
|
102
|
+
arrangement: 'start',
|
103
|
+
alignment: 'start',
|
104
|
+
mainAxisGap: '10',
|
105
|
+
crossAxisGap: '10',
|
106
|
+
itemsPerLine: '',
|
107
|
+
itemsCount: 6,
|
108
|
+
},
|
109
|
+
render: ({ itemsCount, containerWidth, containerHeight, ...args }: ComponentProps<typeof Flow>) => {
|
110
|
+
const hasLines = Boolean(args.itemsPerLine);
|
111
|
+
|
112
|
+
return (
|
113
|
+
<FlowCustom {...args} style={{ width: containerWidth, height: containerHeight }}>
|
114
|
+
{new Array(itemsCount).fill(null).map((width, index) => (
|
115
|
+
<Item
|
116
|
+
key={index}
|
117
|
+
style={
|
118
|
+
hasLines
|
119
|
+
? {
|
120
|
+
minWidth: widths[index % widths.length],
|
121
|
+
minHeight: heights[index % heights.length],
|
122
|
+
}
|
123
|
+
: {
|
124
|
+
width: widths[index % widths.length],
|
125
|
+
height: heights[index % heights.length],
|
126
|
+
}
|
127
|
+
}
|
128
|
+
>
|
129
|
+
{index + 1}
|
130
|
+
</Item>
|
131
|
+
))}
|
132
|
+
</FlowCustom>
|
133
|
+
);
|
134
|
+
},
|
135
|
+
};
|
package/emotion/cjs/index.js
CHANGED
@@ -135,6 +135,17 @@ Object.keys(_Cell).forEach(function (key) {
|
|
135
135
|
}
|
136
136
|
});
|
137
137
|
});
|
138
|
+
var _Flow = /*#__PURE__*/require("./components/Flow");
|
139
|
+
Object.keys(_Flow).forEach(function (key) {
|
140
|
+
if (key === "default" || key === "__esModule") return;
|
141
|
+
if (key in exports && exports[key] === _Flow[key]) return;
|
142
|
+
Object.defineProperty(exports, key, {
|
143
|
+
enumerable: true,
|
144
|
+
get: function get() {
|
145
|
+
return _Flow[key];
|
146
|
+
}
|
147
|
+
});
|
148
|
+
});
|
138
149
|
var _Link = /*#__PURE__*/require("./components/Link");
|
139
150
|
Object.keys(_Link).forEach(function (key) {
|
140
151
|
if (key === "default" || key === "__esModule") return;
|
@@ -0,0 +1,83 @@
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
+
var _excluded = ["children", "className", "style", "orientation", "arrangement", "alignment", "mainAxisGap", "crossAxisGap", "minColWidth", "itemsPerLine"];
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
11
|
+
import React, { forwardRef } from 'react';
|
12
|
+
import cls from 'classnames';
|
13
|
+
import chunk from 'lodash.chunk';
|
14
|
+
import { base, Line } from './Flow.styles';
|
15
|
+
export var flowRoot = function flowRoot(Root) {
|
16
|
+
return /*#__PURE__*/forwardRef(function (_ref, ref) {
|
17
|
+
var children = _ref.children,
|
18
|
+
className = _ref.className,
|
19
|
+
style = _ref.style,
|
20
|
+
_ref$orientation = _ref.orientation,
|
21
|
+
orientation = _ref$orientation === void 0 ? 'horizontal' : _ref$orientation,
|
22
|
+
arrangement = _ref.arrangement,
|
23
|
+
alignment = _ref.alignment,
|
24
|
+
_ref$mainAxisGap = _ref.mainAxisGap,
|
25
|
+
mainAxisGap = _ref$mainAxisGap === void 0 ? '0' : _ref$mainAxisGap,
|
26
|
+
_ref$crossAxisGap = _ref.crossAxisGap,
|
27
|
+
crossAxisGap = _ref$crossAxisGap === void 0 ? '0' : _ref$crossAxisGap,
|
28
|
+
_ref$minColWidth = _ref.minColWidth,
|
29
|
+
minColWidth = _ref$minColWidth === void 0 ? 'auto' : _ref$minColWidth,
|
30
|
+
itemsPerLine = _ref.itemsPerLine,
|
31
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
32
|
+
var isVertical = orientation === 'vertical';
|
33
|
+
var hasMinWidth = Boolean(minColWidth && minColWidth !== 'auto');
|
34
|
+
var needGrid = Boolean(Number(itemsPerLine) > 0 || hasMinWidth);
|
35
|
+
var innerMainAxisGap = typeof mainAxisGap === 'number' || !Number.isNaN(+mainAxisGap) ? "".concat(mainAxisGap || 0, "px") : mainAxisGap;
|
36
|
+
var innerCrossAxisGap = typeof crossAxisGap === 'number' || !Number.isNaN(+crossAxisGap) ? "".concat(crossAxisGap || 0, "px") : crossAxisGap;
|
37
|
+
if (arrangement === 'spaceBetween' || arrangement === 'spaceAround') {
|
38
|
+
innerMainAxisGap = '0';
|
39
|
+
}
|
40
|
+
var hasChunks = Number(itemsPerLine) > 0;
|
41
|
+
var chunks = hasChunks ? chunk(React.Children.toArray(children), itemsPerLine) : [];
|
42
|
+
var gap = isVertical ? "".concat(innerMainAxisGap, " ").concat(innerCrossAxisGap) : "".concat(innerCrossAxisGap, " ").concat(innerMainAxisGap);
|
43
|
+
var wrapperGap = isVertical ? "0 ".concat(innerCrossAxisGap) : "".concat(innerCrossAxisGap, " 0");
|
44
|
+
var lineGap = isVertical ? "".concat(innerMainAxisGap, " 0") : "0 ".concat(innerMainAxisGap);
|
45
|
+
return /*#__PURE__*/React.createElement(Root, _extends({
|
46
|
+
ref: ref,
|
47
|
+
className: cls(className, {
|
48
|
+
vertical: isVertical,
|
49
|
+
grid: hasMinWidth,
|
50
|
+
elastic: hasMinWidth,
|
51
|
+
hasChunks: hasChunks
|
52
|
+
}),
|
53
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
54
|
+
'--plasma-private-gap': hasChunks ? wrapperGap : gap,
|
55
|
+
'--plasma-private-items': String(itemsPerLine),
|
56
|
+
'--plasma-private-min-width': String(minColWidth)
|
57
|
+
}),
|
58
|
+
"data-arrangement": arrangement,
|
59
|
+
"data-alignment": alignment
|
60
|
+
}, rest), hasChunks && chunks.map(function (chunkNode) {
|
61
|
+
return /*#__PURE__*/React.createElement(Line, {
|
62
|
+
className: cls({
|
63
|
+
vertical: isVertical,
|
64
|
+
grid: needGrid,
|
65
|
+
elastic: hasMinWidth
|
66
|
+
}),
|
67
|
+
style: {
|
68
|
+
'--plasma-private-gap': lineGap
|
69
|
+
},
|
70
|
+
"data-arrangement": arrangement,
|
71
|
+
"data-alignment": alignment
|
72
|
+
}, chunkNode);
|
73
|
+
}), !hasChunks && children);
|
74
|
+
});
|
75
|
+
};
|
76
|
+
export var flowConfig = {
|
77
|
+
name: 'Flow',
|
78
|
+
tag: 'div',
|
79
|
+
layout: flowRoot,
|
80
|
+
base: base,
|
81
|
+
defaults: {},
|
82
|
+
variations: {}
|
83
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
2
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
3
|
+
import { css } from '@emotion/react';
|
4
|
+
export var base = process.env.NODE_ENV === "production" ? {
|
5
|
+
name: "gv4nrl-plasma-new-hope__base",
|
6
|
+
styles: "display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--plasma-private-gap);&.hasChunks{flex-wrap:nowrap;flex-direction:column;&.vertical{flex-direction:row;}}&.vertical{flex-direction:column;}&.grid{display:grid;grid-template-columns:repeat(var(--plasma-private-items), auto);grid-auto-flow:row;&.elastic{grid-template-columns:repeat(auto-fill, minmax(var(--plasma-private-min-width), auto));grid-auto-flow:row;}&:not(.vertical){&[data-arrangement='start']{justify-items:start;}&[data-arrangement='center']{justify-items:center;}&[data-arrangement='end']{justify-items:end;}&[data-arrangement='spaceBetween']{justify-content:space-between;}&[data-arrangement='spaceAround']{justify-content:space-around;}&[data-alignment='start']{align-items:start;}&[data-alignment='center']{align-items:center;}&[data-alignment='end']{align-items:end;}}&.vertical{grid-template-columns:auto;grid-template-rows:repeat(var(--plasma-private-items), auto);grid-auto-flow:column;&[data-arrangement='start']{align-items:start;}&[data-arrangement='center']{align-items:center;}&[data-arrangement='end']{align-items:end;}&[data-arrangement='spaceBetween']{align-content:space-between;align-items:normal;}&[data-arrangement='spaceAround']{align-content:space-around;align-items:normal;}&[data-alignment='start']{justify-items:start;}&[data-alignment='center']{justify-items:center;}&[data-alignment='end']{justify-items:end;}}}&:not(&.grid):not(&.hasChunks){align-content:start;&[data-arrangement='start']{justify-content:start;}&[data-arrangement='center']{justify-content:center;}&[data-arrangement='end']{justify-content:end;}&[data-arrangement='spaceBetween']{justify-content:space-between;}&[data-arrangement='spaceAround']{justify-content:space-around;}&[data-alignment='start']{align-items:start;}&[data-alignment='center']{align-items:center;}&[data-alignment='end']{align-items:end;}};label:plasma-new-hope__base;"
|
7
|
+
} : {
|
8
|
+
name: "gv4nrl-plasma-new-hope__base",
|
9
|
+
styles: "display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--plasma-private-gap);&.hasChunks{flex-wrap:nowrap;flex-direction:column;&.vertical{flex-direction:row;}}&.vertical{flex-direction:column;}&.grid{display:grid;grid-template-columns:repeat(var(--plasma-private-items), auto);grid-auto-flow:row;&.elastic{grid-template-columns:repeat(auto-fill, minmax(var(--plasma-private-min-width), auto));grid-auto-flow:row;}&:not(.vertical){&[data-arrangement='start']{justify-items:start;}&[data-arrangement='center']{justify-items:center;}&[data-arrangement='end']{justify-items:end;}&[data-arrangement='spaceBetween']{justify-content:space-between;}&[data-arrangement='spaceAround']{justify-content:space-around;}&[data-alignment='start']{align-items:start;}&[data-alignment='center']{align-items:center;}&[data-alignment='end']{align-items:end;}}&.vertical{grid-template-columns:auto;grid-template-rows:repeat(var(--plasma-private-items), auto);grid-auto-flow:column;&[data-arrangement='start']{align-items:start;}&[data-arrangement='center']{align-items:center;}&[data-arrangement='end']{align-items:end;}&[data-arrangement='spaceBetween']{align-content:space-between;align-items:normal;}&[data-arrangement='spaceAround']{align-content:space-around;align-items:normal;}&[data-alignment='start']{justify-items:start;}&[data-alignment='center']{justify-items:center;}&[data-alignment='end']{justify-items:end;}}}&:not(&.grid):not(&.hasChunks){align-content:start;&[data-arrangement='start']{justify-content:start;}&[data-arrangement='center']{justify-content:center;}&[data-arrangement='end']{justify-content:end;}&[data-arrangement='spaceBetween']{justify-content:space-between;}&[data-arrangement='spaceAround']{justify-content:space-around;}&[data-alignment='start']{align-items:start;}&[data-alignment='center']{align-items:center;}&[data-alignment='end']{align-items:end;}};label:plasma-new-hope__base;",
|
10
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvRmxvdy9GbG93LnN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1h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bG93OiByb3c7XG4gICAgICAgIH1cblxuICAgICAgICAmOm5vdCgudmVydGljYWwpIHtcbiAgICAgICAgICAgICZbZGF0YS1hcnJhbmdlbWVudD0nc3RhcnQnXSB7XG4gICAgICAgICAgICAgICAganVzdGlmeS1pdGVtczogc3RhcnQ7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICZbZGF0YS1hcnJhbmdlbWVudD0nY2VudGVyJ10ge1xuICAgICAgICAgICAgICAgIGp1c3RpZnktaXRlbXM6IGNlbnRlcjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgJltkYXRhLWFycmFuZ2VtZW50PSdlbmQnXSB7XG4gICAgICAgICAgICAgICAganVzdGlmeS1pdGVtczogZW5kO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAmW2RhdGEtYXJyYW5nZW1lbnQ9J3NwYWNlQmV0d2VlbiddIHtcbiAgICAgICAgICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICZbZGF0YS1hcnJhbmdlbWVudD0nc3BhY2VBcm91bmQnXSB7XG4gICAgICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1hcm91bmQ7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICZbZGF0YS1hbGlnbm1lbnQ9J3N0YXJ0J10ge1xuICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBzdGFydDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgJltkYXRhLWFsaWdubWVudD0nY2VudGVyJ10ge1xuICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICZbZGF0YS1hbGlnbm1lbnQ9J2VuZCddIHtcbiAgICAgICAgICAgICAgICBhbGlnbi1pdGVtczogZW5kO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgJi52ZXJ0aWNhbCB7XG4gICAgICAgICAgICBncmlkLXRlbXBsYXRlLWNvbHVtbnM6IGF1dG87XG4gICAgICAgICAgICBncmlkLXRlbXBsYXRlLXJvd3M6IHJlcGVhdCh2YXIoLS1wbGFzbWEtcHJpdmF0ZS1pdGVtcyksIGF1dG8pO1xuICAgICAgICAgICAgZ3JpZC1hdXRvLWZsb3c6IGNvbHVtbjtcblxuICAgICAgICAgICAgJltkYXRhLWFycmFuZ2VtZW50PSdzdGFydCddIHtcbiAgICAgICAgICAgICAgICBhbGlnbi1pdGVtczogc3RhcnQ7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICZbZGF0YS1hcnJhbmdlbWVudD0nY2VudGVyJ10ge1xuICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICZbZGF0YS1hcnJhbmdlbWVudD0nZW5kJ10ge1xuICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBlbmQ7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICZbZGF0YS1hcnJhbmdlbWVudD0nc3BhY2VCZXR3ZWVuJ10ge1xuICAgICAgICAgICAgICAgIGFsaWduLWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47XG4gICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6IG5vcm1hbDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgJltkYXRhLWFycmFuZ2VtZW50PSdzcGFjZUFyb3VuZCddIHtcbiAgICAgICAgICAgICAgICBhbGlnbi1jb250ZW50OiBzcGFjZS1hcm91bmQ7XG4gICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6IG5vcm1hbDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgJltkYXRhLWFsaWdubWVudD0nc3RhcnQnXSB7XG4gICAgICAgICAgICAgICAganVzdGlmeS1pdGVtczogc3RhcnQ7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICZbZGF0YS1hbGlnbm1lbnQ9J2NlbnRlciddIHtcbiAgICAgICAgICAgICAgICBqdXN0aWZ5LWl0ZW1zOiBjZW50ZXI7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICZbZGF0YS1hbGlnbm1lbnQ9J2VuZCddIHtcbiAgICAgICAgICAgICAgICBqdXN0aWZ5LWl0ZW1zOiBlbmQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAmOm5vdCgmLmdyaWQpOm5vdCgmLmhhc0NodW5rcykge1xuICAgICAgICBhbGlnbi1jb250ZW50OiBzdGFydDtcblxuICAgICAgICAmW2RhdGEtYXJyYW5nZW1lbnQ9J3N0YXJ0J10ge1xuICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBzdGFydDtcbiAgICAgICAgfVxuXG4gICAgICAgICZbZGF0YS1hcnJhbmdlbWVudD0nY2VudGVyJ10ge1xuICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG4gICAgICAgIH1cblxuICAgICAgICAmW2RhdGEtYXJyYW5nZW1lbnQ9J2VuZCddIHtcbiAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogZW5kO1xuICAgICAgICB9XG5cbiAgICAgICAgJltkYXRhLWFycmFuZ2VtZW50PSdzcGFjZUJldHdlZW4nXSB7XG4gICAgICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47XG4gICAgICAgIH1cblxuICAgICAgICAmW2RhdGEtYXJyYW5nZW1lbnQ9J3NwYWNlQXJvdW5kJ10ge1xuICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1hcm91bmQ7XG4gICAgICAgIH1cblxuICAgICAgICAmW2RhdGEtYWxpZ25tZW50PSdzdGFydCddIHtcbiAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBzdGFydDtcbiAgICAgICAgfVxuXG4gICAgICAgICZbZGF0YS1hbGlnbm1l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J10ge1xuICAgICAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgIH1cblxuICAgICZbZGF0YS1hbGlnbm1lbnQ9J2VuZCddIHtcbiAgICAgICAgYWxpZ24taXRlbXM6IGVuZDtcbiAgICB9XG5gO1xuIl19 */",
|
11
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
12
|
+
};
|
13
|
+
export var Line = /*#__PURE__*/_styled("div", {
|
14
|
+
target: "ebyd3vf0",
|
15
|
+
label: "plasma-new-hope__Line"
|
16
|
+
})(process.env.NODE_ENV === "production" ? {
|
17
|
+
name: "132lcva",
|
18
|
+
styles: "display:flex;gap:var(--plasma-private-gap);&.vertical{flex-direction:column;height:100%;}&[data-arrangement='start']{justify-content:start;}&[data-arrangement='center']{justify-content:center;}&[data-arrangement='end']{justify-content:end;}&[data-arrangement='spaceBetween']{justify-content:space-between;}&[data-arrangement='spaceAround']{justify-content:space-around;}&[data-alignment='start']{align-items:start;}&[data-alignment='center']{align-items:center;}&[data-alignment='end']{align-items:end;}"
|
19
|
+
} : {
|
20
|
+
name: "132lcva",
|
21
|
+
styles: "display:flex;gap:var(--plasma-private-gap);&.vertical{flex-direction:column;height:100%;}&[data-arrangement='start']{justify-content:start;}&[data-arrangement='center']{justify-content:center;}&[data-arrangement='end']{justify-content:end;}&[data-arrangement='spaceBetween']{justify-content:space-between;}&[data-arrangement='spaceAround']{justify-content:space-around;}&[data-alignment='start']{align-items:start;}&[data-alignment='center']{align-items:center;}&[data-alignment='end']{align-items:end;}",
|
22
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvRmxvdy9GbG93LnN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFrSjhCIiwiZmlsZSI6Ii4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmV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GEtYXJyYW5nZW1lbnQ9J3N0YXJ0J10ge1xuICAgICAgICAgICAgICAgIGp1c3RpZnktaXRlbXM6IHN0YXJ0O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAmW2RhdGEtYXJyYW5nZW1lbnQ9J2NlbnRlciddIHtcbiAgICAgICAgICAgICAgICBqdXN0aWZ5LWl0ZW1zOiBjZW50ZXI7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICZbZGF0YS1hcnJhbmdlbWVudD0nZW5kJ10ge1xuICAgICAgICAgICAgICAgIGp1c3RpZnktaXRlbXM6IGVuZDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgJltkYXRhLWFycmFuZ2VtZW50PSdzcGFjZUJldHdlZW4nXSB7XG4gICAgICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAmW2RhdGEtYXJyYW5nZW1lbnQ9J3NwYWNlQXJvdW5kJ10ge1xuICAgICAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYXJvdW5kO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAmW2RhdGEtYWxpZ25tZW50PSdzdGFydCddIHtcbiAgICAgICAgICAgICAgICBhbGlnbi1pdGVtczogc3RhcnQ7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICZbZGF0YS1hbGlnbm1lbnQ9J2NlbnRlciddIHtcbiAgICAgICAgICAgICAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAmW2RhdGEtYWxpZ25tZW50PSdlbmQnXSB7XG4gICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6IGVuZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgICYudmVydGljYWwge1xuICAgICAgICAgICAgZ3JpZC10ZW1wbGF0ZS1jb2x1bW5zOiBhdXRvO1xuICAgICAgICAgICAgZ3JpZC10ZW1wbGF0ZS1yb3dzOiByZXBlYXQodmFyKC0tcGxhc21hLXByaXZhdGUtaXRlbXMpLCBhdXRvKTtcbiAgICAgICAgICAgIGdyaWQtYXV0by1mbG93OiBjb2x1bW47XG5cbiAgICAgICAgICAgICZbZGF0YS1hcnJhbmdlbWVudD0nc3RhcnQnXSB7XG4gICAgICAgICAgICAgICAgYWxpZ24taXRlbXM6IHN0YXJ0O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAmW2RhdGEtYXJyYW5nZW1lbnQ9J2NlbnRlciddIHtcbiAgICAgICAgICAgICAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAmW2RhdGEtYXJyYW5nZW1lbnQ9J2VuZCddIHtcbiAgICAgICAgICAgICAgICBhbGlnbi1pdGVtczogZW5kO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAmW2RhdGEtYXJyYW5nZW1lbnQ9J3NwYWNlQmV0d2VlbiddIHtcbiAgICAgICAgICAgICAgICBhbGlnbi1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO1xuICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBub3JtYWw7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICZbZGF0YS1hcnJhbmdlbWVudD0nc3BhY2VBcm91bmQnXSB7XG4gICAgICAgICAgICAgICAgYWxpZ24tY29udGVudDogc3BhY2UtYXJvdW5kO1xuICAgICAgICAgICAgICAgIGFsaWduLWl0ZW1zOiBub3JtYWw7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICZbZGF0YS1hbGlnbm1lbnQ9J3N0YXJ0J10ge1xuICAgICAgICAgICAgICAgIGp1c3RpZnktaXRlbXM6IHN0YXJ0O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAmW2RhdGEtYWxpZ25tZW50PSdjZW50ZXInXSB7XG4gICAgICAgICAgICAgICAganVzdGlmeS1pdGVtczogY2VudGVyO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAmW2RhdGEtYWxpZ25tZW50PSdlbmQnXSB7XG4gICAgICAgICAgICAgICAganVzdGlmeS1pdGVtczogZW5kO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgJjpub3QoJi5ncmlkKTpub3QoJi5oYXNDaHVua3MpIHtcbiAgICAgICAgYWxpZ24tY29udGVudDogc3RhcnQ7XG5cbiAgICAgICAgJltkYXRhLWFycmFuZ2VtZW50PSdzdGFydCddIHtcbiAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogc3RhcnQ7XG4gICAgICAgIH1cblxuICAgICAgICAmW2RhdGEtYXJyYW5nZW1lbnQ9J2NlbnRlciddIHtcbiAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICAgICAgICB9XG5cbiAgICAgICAgJltkYXRhLWFycmFuZ2VtZW50PSdlbmQnXSB7XG4gICAgICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IGVuZDtcbiAgICAgICAgfVxuXG4gICAgICAgICZbZGF0YS1hcnJhbmdlbWVudD0nc3BhY2VCZXR3ZWVuJ10ge1xuICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBzcGFjZS1iZXR3ZWVuO1xuICAgICAgICB9XG5cbiAgICAgICAgJltkYXRhLWFycmFuZ2VtZW50PSdzcGFjZUFyb3VuZCddIHtcbiAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYXJvdW5kO1xuICAgICAgICB9XG5cbiAgICAgICAgJltkYXRhLWFsaWdubWVudD0nc3RhcnQnXSB7XG4gICAgICAgICAgICBhbGlnbi1pdGVtczogc3RhcnQ7XG4gICAgICAgIH1cblxuICAgICAgICAmW2RhdGEtYWxpZ25tZW50PSdjZW50ZXInXSB7XG4gICAgICAgICAgICBhbGlnbi1pdGVtczogY2VudGVyO1xuICAgICAgICB9XG5cbiAgICAgICAgJltkY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hdGEtYWxpZ25tZW50PSdlbmQnXSB7XG4gICAgICAgIGFsaWduLWl0ZW1zOiBlbmQ7XG4gICAgfVxuYDtcbiJdfQ== */",
|
23
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
24
|
+
});
|
@@ -0,0 +1,127 @@
|
|
1
|
+
---
|
2
|
+
id: flow
|
3
|
+
title: Flow
|
4
|
+
---
|
5
|
+
|
6
|
+
import { PropsTable, Description } from '@site/src/components';
|
7
|
+
|
8
|
+
# Flow
|
9
|
+
Универсальный контейнер для упорядоченного размещения вложенных компонентов (например, медиафайлы, карточки или блоки текста).
|
10
|
+
|
11
|
+
|
12
|
+
## Flow
|
13
|
+
<Description name="Flow" />
|
14
|
+
<PropsTable name="Flow" exclude={['css', 'focused', 'minColWidth']} />
|
15
|
+
|
16
|
+
## Использование
|
17
|
+
По умолчанию компонент `Flow` отображается на основе `display: flex; flex-wrap: wrap`,
|
18
|
+
при указании `itemsPerLine` компонент переходит на `display: flex; flex-wrap: nowrap` с превентивным разбиением на колонки/столбцы.
|
19
|
+
|
20
|
+
|
21
|
+
## Примеры
|
22
|
+
|
23
|
+
### Горизонтальное отображение с переполнением
|
24
|
+
|
25
|
+
```tsx live
|
26
|
+
import React from 'react';
|
27
|
+
import { Flow } from '@salutejs/{{ package }}';
|
28
|
+
|
29
|
+
export function App() {
|
30
|
+
const numbers = ['one', 'two', 'three', 'four', 'five', 'six'];
|
31
|
+
|
32
|
+
const style = (index) => ({
|
33
|
+
display: 'flex',
|
34
|
+
alignItems: 'center',
|
35
|
+
justifyContent: 'center',
|
36
|
+
width: `${2 + numbers[index].length}ch`,
|
37
|
+
height: '25px',
|
38
|
+
backgroundColor: '#999',
|
39
|
+
borderRadius: '10px',
|
40
|
+
});
|
41
|
+
|
42
|
+
return (
|
43
|
+
<div>
|
44
|
+
<Flow mainAxisGap="0.5ch" crossAxisGap="1ch" style={{ width: '15ch' }} >
|
45
|
+
{Array(6)
|
46
|
+
.fill(0)
|
47
|
+
.map((_, i) => (<div key={i} style={style(i)}>{numbers[i]}</div>))}
|
48
|
+
</Flow>
|
49
|
+
</div>
|
50
|
+
);
|
51
|
+
}
|
52
|
+
```
|
53
|
+
|
54
|
+
### Вертикальное отображение с переполнением
|
55
|
+
|
56
|
+
```tsx live
|
57
|
+
import React from 'react';
|
58
|
+
import { Flow } from '@salutejs/{{ package }}';
|
59
|
+
|
60
|
+
export function App() {
|
61
|
+
const numbers = ['one', 'two', 'three', 'four', 'five', 'six'];
|
62
|
+
|
63
|
+
const style = (index) => ({
|
64
|
+
display: 'flex',
|
65
|
+
alignItems: 'center',
|
66
|
+
justifyContent: 'center',
|
67
|
+
width: `${2 + numbers[index].length}ch`,
|
68
|
+
height: '25px',
|
69
|
+
backgroundColor: '#999',
|
70
|
+
borderRadius: '10px',
|
71
|
+
});
|
72
|
+
|
73
|
+
return (
|
74
|
+
<div>
|
75
|
+
<Flow
|
76
|
+
alignment="center"
|
77
|
+
orientation="vertical"
|
78
|
+
mainAxisGap="0.5ch"
|
79
|
+
crossAxisGap="1ch"
|
80
|
+
style={{ height: '90px' }}
|
81
|
+
>
|
82
|
+
{Array(6)
|
83
|
+
.fill(0)
|
84
|
+
.map((_, i) => (<div key={i} style={style(i)}>{numbers[i]}</div>))}
|
85
|
+
</Flow>
|
86
|
+
</div>
|
87
|
+
);
|
88
|
+
}
|
89
|
+
```
|
90
|
+
|
91
|
+
### Отображение с разбиением на строки
|
92
|
+
С ограничением количества элементов в строке.
|
93
|
+
|
94
|
+
```tsx live
|
95
|
+
import React from 'react';
|
96
|
+
import { Flow } from '@salutejs/{{ package }}';
|
97
|
+
|
98
|
+
export function App() {
|
99
|
+
const numbers = ['one', 'two', 'three', 'four', 'five', 'six'];
|
100
|
+
|
101
|
+
const style = (index) => ({
|
102
|
+
display: 'flex',
|
103
|
+
alignItems: 'center',
|
104
|
+
justifyContent: 'center',
|
105
|
+
width: `${2 + numbers[index].length}ch`,
|
106
|
+
height: '25px',
|
107
|
+
backgroundColor: '#999',
|
108
|
+
borderRadius: '10px',
|
109
|
+
});
|
110
|
+
|
111
|
+
return (
|
112
|
+
<div>
|
113
|
+
<Flow
|
114
|
+
arrangement="end"
|
115
|
+
itemsPerLine={2}
|
116
|
+
mainAxisGap="0.5ch"
|
117
|
+
crossAxisGap="1ch"
|
118
|
+
>
|
119
|
+
{Array(6)
|
120
|
+
.fill(0)
|
121
|
+
.map((_, i) => (<div key={i} style={style(i)}>{numbers[i]}</div>))}
|
122
|
+
</Flow>
|
123
|
+
</div>
|
124
|
+
);
|
125
|
+
}
|
126
|
+
```
|
127
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { flowRoot, flowConfig } from './Flow';
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { flowConfig } from '../../../../components/Flow';
|
2
|
+
import { component, mergeConfig } from '../../../../engines';
|
3
|
+
import { config } from './Flow.config';
|
4
|
+
var mergedConfig = /*#__PURE__*/mergeConfig(flowConfig, config);
|
5
|
+
export var Flow = /*#__PURE__*/component(mergedConfig);
|