@simplybusiness/mobius 3.5.0 → 3.5.1
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/CHANGELOG.md +7 -0
- package/dist/cjs/components/Flex/Flex.d.ts +1 -32
- package/dist/cjs/components/Flex/Flex.js +3 -36
- package/dist/cjs/components/Flex/Flex.js.map +1 -1
- package/dist/cjs/components/Flex/index.d.ts +1 -0
- package/dist/cjs/components/Flex/index.js +1 -0
- package/dist/cjs/components/Flex/index.js.map +1 -1
- package/dist/cjs/components/Flex/propUtils.d.ts +8 -0
- package/dist/cjs/components/Flex/propUtils.js +54 -0
- package/dist/cjs/components/Flex/propUtils.js.map +1 -0
- package/dist/cjs/components/Flex/propUtils.test.d.ts +1 -0
- package/dist/cjs/components/Flex/propUtils.test.js +99 -0
- package/dist/cjs/components/Flex/propUtils.test.js.map +1 -0
- package/dist/cjs/components/Flex/types.d.ts +32 -0
- package/dist/cjs/components/Flex/types.js +3 -0
- package/dist/cjs/components/Flex/types.js.map +1 -0
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/components/Flex/Flex.js +1 -34
- package/dist/esm/components/Flex/Flex.js.map +1 -1
- package/dist/esm/components/Flex/index.js +1 -0
- package/dist/esm/components/Flex/index.js.map +1 -1
- package/dist/esm/components/Flex/propUtils.js +48 -0
- package/dist/esm/components/Flex/propUtils.js.map +1 -0
- package/dist/esm/components/Flex/propUtils.test.js +97 -0
- package/dist/esm/components/Flex/propUtils.test.js.map +1 -0
- package/dist/esm/components/Flex/types.js +2 -0
- package/dist/esm/components/Flex/types.js.map +1 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/Flex/Flex.tsx +9 -100
- package/src/components/Flex/index.tsx +1 -0
- package/src/components/Flex/propUtils.test.ts +124 -0
- package/src/components/Flex/propUtils.ts +69 -0
- package/src/components/Flex/types.ts +38 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file, or link in
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.5.1] - 2023-07-07
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Fix an issue where `gap` prop is ignored in `<Flex>`
|
|
13
|
+
|
|
8
14
|
## [3.5.0] - 2023-04-28
|
|
9
15
|
|
|
10
16
|
### Added
|
|
@@ -238,6 +244,7 @@ Additionally, mobius and themes are available on the public NPM registry and can
|
|
|
238
244
|
|
|
239
245
|
## Github Links
|
|
240
246
|
|
|
247
|
+
[3.5.1]: https://github.com/simplybusiness/mobius/releases/tag/v3.5.1
|
|
241
248
|
[3.5.0]: https://github.com/simplybusiness/mobius/releases/tag/v3.5.0
|
|
242
249
|
[3.4.5]: https://github.com/simplybusiness/mobius/releases/tag/v3.4.5
|
|
243
250
|
[3.4.4]: https://github.com/simplybusiness/mobius/releases/tag/v3.4.4
|
|
@@ -1,35 +1,4 @@
|
|
|
1
|
-
import { Ref, ReactNode, RefAttributes } from "react";
|
|
2
|
-
import type { Property } from "csstype";
|
|
3
|
-
import { DOMProps } from "@react-types/shared";
|
|
4
1
|
import { ForwardedRefComponent } from "../../types/components";
|
|
5
|
-
|
|
6
|
-
export interface FlexStyleProps {
|
|
7
|
-
elementType?: string | React.ElementType;
|
|
8
|
-
flexDirection?: Property.FlexDirection;
|
|
9
|
-
flexWrap?: Property.FlexWrap;
|
|
10
|
-
flexGrow?: Property.FlexGrow;
|
|
11
|
-
flex?: Property.Flex;
|
|
12
|
-
/** Aligns grid items along the block (column) axis */
|
|
13
|
-
alignItems?: Property.AlignItems;
|
|
14
|
-
/** Aligns the grid along the inline (row) axis */
|
|
15
|
-
alignContent?: Property.AlignContent;
|
|
16
|
-
/** Aligns the grid along the inline (row) axis */
|
|
17
|
-
justifyContent?: Property.JustifyContent;
|
|
18
|
-
/** How big a gap between the columns and rows */
|
|
19
|
-
gap?: Property.Gap;
|
|
20
|
-
/** How big a gap between the rows */
|
|
21
|
-
rowGap?: Property.RowGap;
|
|
22
|
-
/** How big a gap between the columns */
|
|
23
|
-
columnGap?: Property.ColumnGap;
|
|
24
|
-
style?: React.CSSProperties;
|
|
25
|
-
}
|
|
26
|
-
export interface FlexNonStyleProps extends DOMProps, RefAttributes<FlexElementType> {
|
|
27
|
-
children?: ReactNode;
|
|
28
|
-
/** Custom class name for setting specific CSS */
|
|
29
|
-
className?: string;
|
|
30
|
-
}
|
|
31
|
-
export interface FlexProps extends FlexStyleProps, FlexNonStyleProps {
|
|
32
|
-
}
|
|
33
|
-
export type FlexRef = Ref<FlexElementType>;
|
|
2
|
+
import { FlexElementType, FlexProps } from "./types";
|
|
34
3
|
declare const Flex: ForwardedRefComponent<FlexProps, FlexElementType>;
|
|
35
4
|
export { Flex };
|
|
@@ -18,45 +18,12 @@ exports.Flex = void 0;
|
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const react_1 = require("react");
|
|
20
20
|
const clsx_1 = __importDefault(require("clsx"));
|
|
21
|
-
const
|
|
22
|
-
const { flexDirection, flexWrap, flexGrow, flex, justifyContent, alignItems, alignContent, gap, rowGap, columnGap, } = props;
|
|
23
|
-
return {
|
|
24
|
-
display: "flex",
|
|
25
|
-
flexDirection,
|
|
26
|
-
flexWrap,
|
|
27
|
-
flexGrow,
|
|
28
|
-
flex,
|
|
29
|
-
justifyContent,
|
|
30
|
-
alignItems,
|
|
31
|
-
alignContent,
|
|
32
|
-
gap,
|
|
33
|
-
rowGap,
|
|
34
|
-
columnGap,
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
const splitProps = (props) => {
|
|
38
|
-
const { flexDirection, flexWrap, flexGrow, flex, justifyContent, alignItems, alignContent, gap, rowGap, columnGap } = props, otherProps = __rest(props, ["flexDirection", "flexWrap", "flexGrow", "flex", "justifyContent", "alignItems", "alignContent", "gap", "rowGap", "columnGap"]);
|
|
39
|
-
return [
|
|
40
|
-
{
|
|
41
|
-
flexDirection,
|
|
42
|
-
flexWrap,
|
|
43
|
-
flexGrow,
|
|
44
|
-
flex,
|
|
45
|
-
justifyContent,
|
|
46
|
-
alignItems,
|
|
47
|
-
alignContent,
|
|
48
|
-
gap,
|
|
49
|
-
rowGap,
|
|
50
|
-
columnGap,
|
|
51
|
-
},
|
|
52
|
-
otherProps,
|
|
53
|
-
];
|
|
54
|
-
};
|
|
21
|
+
const propUtils_1 = require("./propUtils");
|
|
55
22
|
const Flex = (0, react_1.forwardRef)((props, ref) => {
|
|
56
23
|
const { elementType: Element = "div" } = props, otherProps = __rest(props, ["elementType"]);
|
|
57
24
|
const classes = (0, clsx_1.default)("mobius", "mobius/Flex", props.className);
|
|
58
|
-
const [styleProps, restProps] = splitProps(otherProps);
|
|
59
|
-
const flexStyles = buildFlexStyles(styleProps);
|
|
25
|
+
const [styleProps, restProps] = (0, propUtils_1.splitProps)(otherProps);
|
|
26
|
+
const flexStyles = (0, propUtils_1.buildFlexStyles)(styleProps);
|
|
60
27
|
return ((0, jsx_runtime_1.jsx)(Element, Object.assign({ ref: ref, style: flexStyles }, restProps, { className: classes })));
|
|
61
28
|
});
|
|
62
29
|
exports.Flex = Flex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.js","sourceRoot":"","sources":["../../../../src/components/Flex/Flex.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Flex.js","sourceRoot":"","sources":["../../../../src/components/Flex/Flex.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,iCAAmC;AACnC,gDAAwB;AAGxB,2CAA0D;AAE1D,MAAM,IAAI,GAAsD,IAAA,kBAAU,EACxE,CAAC,KAAgB,EAAE,GAAY,EAAE,EAAE;IACjC,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,KAAK,KAAoB,KAAK,EAApB,UAAU,UAAK,KAAK,EAAvD,eAA+C,CAAQ,CAAC;IAC9D,MAAM,OAAO,GAAG,IAAA,cAAI,EAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAE/D,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,GAAG,IAAA,sBAAU,EAAC,UAAU,CAAC,CAAC;IACvD,MAAM,UAAU,GAAG,IAAA,2BAAe,EAAC,UAAU,CAAC,CAAC;IAE/C,OAAO,CACL,uBAAC,OAAO,kBACN,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,UAAU,IACb,SAAS,IACb,SAAS,EAAE,OAAO,IAClB,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAGO,oBAAI;AADb,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC"}
|
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./Flex"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Flex/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Flex/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,0CAAwB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FlexNonStyleProps, FlexProps, FlexStyleProps } from "./types";
|
|
2
|
+
export declare const withoutUndefinedValues: (obj: Record<string, unknown>) => {
|
|
3
|
+
[k: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
export declare const buildFlexStyles: (props: FlexStyleProps) => {
|
|
6
|
+
[k: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
export declare const splitProps: (props: FlexProps) => [FlexStyleProps, FlexNonStyleProps];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.splitProps = exports.buildFlexStyles = exports.withoutUndefinedValues = void 0;
|
|
15
|
+
const withoutUndefinedValues = (obj) => Object.fromEntries(Object.entries(obj).filter(([_, value]) => value));
|
|
16
|
+
exports.withoutUndefinedValues = withoutUndefinedValues;
|
|
17
|
+
const buildFlexStyles = (props) => {
|
|
18
|
+
const { flexDirection, flexWrap, flexGrow, flex, justifyContent, alignItems, alignContent, gap, rowGap, columnGap, } = props;
|
|
19
|
+
const styleProps = {
|
|
20
|
+
display: "flex",
|
|
21
|
+
flexDirection,
|
|
22
|
+
flexWrap,
|
|
23
|
+
flexGrow,
|
|
24
|
+
flex,
|
|
25
|
+
justifyContent,
|
|
26
|
+
alignItems,
|
|
27
|
+
alignContent,
|
|
28
|
+
gap,
|
|
29
|
+
rowGap,
|
|
30
|
+
columnGap,
|
|
31
|
+
};
|
|
32
|
+
return (0, exports.withoutUndefinedValues)(styleProps);
|
|
33
|
+
};
|
|
34
|
+
exports.buildFlexStyles = buildFlexStyles;
|
|
35
|
+
const splitProps = (props) => {
|
|
36
|
+
const { flexDirection, flexWrap, flexGrow, flex, justifyContent, alignItems, alignContent, gap, rowGap, columnGap } = props, otherProps = __rest(props, ["flexDirection", "flexWrap", "flexGrow", "flex", "justifyContent", "alignItems", "alignContent", "gap", "rowGap", "columnGap"]);
|
|
37
|
+
return [
|
|
38
|
+
{
|
|
39
|
+
flexDirection,
|
|
40
|
+
flexWrap,
|
|
41
|
+
flexGrow,
|
|
42
|
+
flex,
|
|
43
|
+
justifyContent,
|
|
44
|
+
alignItems,
|
|
45
|
+
alignContent,
|
|
46
|
+
gap,
|
|
47
|
+
rowGap,
|
|
48
|
+
columnGap,
|
|
49
|
+
},
|
|
50
|
+
otherProps,
|
|
51
|
+
];
|
|
52
|
+
};
|
|
53
|
+
exports.splitProps = splitProps;
|
|
54
|
+
//# sourceMappingURL=propUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propUtils.js","sourceRoot":"","sources":["../../../../src/components/Flex/propUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEO,MAAM,sBAAsB,GAAG,CAAC,GAA4B,EAAE,EAAE,CACrE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AAD3D,QAAA,sBAAsB,0BACqC;AAEjE,MAAM,eAAe,GAAG,CAAC,KAAqB,EAAE,EAAE;IACvD,MAAM,EACJ,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,cAAc,EACd,UAAU,EACV,YAAY,EACZ,GAAG,EACH,MAAM,EACN,SAAS,GACV,GAAG,KAAK,CAAC;IAEV,MAAM,UAAU,GAAG;QACjB,OAAO,EAAE,MAAM;QACf,aAAa;QACb,QAAQ;QACR,QAAQ;QACR,IAAI;QACJ,cAAc;QACd,UAAU;QACV,YAAY;QACZ,GAAG;QACH,MAAM;QACN,SAAS;KACV,CAAC;IAEF,OAAO,IAAA,8BAAsB,EAAC,UAAU,CAAC,CAAC;AAC5C,CAAC,CAAC;AA7BW,QAAA,eAAe,mBA6B1B;AAEK,MAAM,UAAU,GAAG,CACxB,KAAgB,EACqB,EAAE;IACvC,MAAM,EACJ,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,cAAc,EACd,UAAU,EACV,YAAY,EACZ,GAAG,EACH,MAAM,EACN,SAAS,KAEP,KAAK,EADJ,UAAU,UACX,KAAK,EAZH,+HAYL,CAAQ,CAAC;IAEV,OAAO;QACL;YACE,aAAa;YACb,QAAQ;YACR,QAAQ;YACR,IAAI;YACJ,cAAc;YACd,UAAU;YACV,YAAY;YACZ,GAAG;YACH,MAAM;YACN,SAAS;SACV;QACD,UAAU;KACX,CAAC;AACJ,CAAC,CAAC;AAhCW,QAAA,UAAU,cAgCrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const propUtils_1 = require("./propUtils");
|
|
4
|
+
describe("withoutUndefinedValues", () => {
|
|
5
|
+
it("returns object without undefined values", () => {
|
|
6
|
+
const props = {
|
|
7
|
+
a: 1,
|
|
8
|
+
b: "Two",
|
|
9
|
+
c: [],
|
|
10
|
+
d: {},
|
|
11
|
+
e: undefined,
|
|
12
|
+
f: undefined,
|
|
13
|
+
};
|
|
14
|
+
const actual = (0, propUtils_1.withoutUndefinedValues)(props);
|
|
15
|
+
const expected = {
|
|
16
|
+
a: 1,
|
|
17
|
+
b: "Two",
|
|
18
|
+
c: [],
|
|
19
|
+
d: {},
|
|
20
|
+
};
|
|
21
|
+
expect(actual).toStrictEqual(expected);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
describe("buildFlexStyles", () => {
|
|
25
|
+
describe("given a list of props", () => {
|
|
26
|
+
it("returns a specified list of flex props", () => {
|
|
27
|
+
const props = {
|
|
28
|
+
flexDirection: "row",
|
|
29
|
+
flexWrap: "wrap",
|
|
30
|
+
flexGrow: "1",
|
|
31
|
+
flex: "1 1 0px",
|
|
32
|
+
justifyContent: "start",
|
|
33
|
+
alignItems: "stretch",
|
|
34
|
+
alignContent: "center",
|
|
35
|
+
gap: "10px",
|
|
36
|
+
rowGap: "20px",
|
|
37
|
+
columnGap: "30px",
|
|
38
|
+
};
|
|
39
|
+
const expectedProps = Object.assign(Object.assign({}, props), { display: "flex" });
|
|
40
|
+
const actual = (0, propUtils_1.buildFlexStyles)(props);
|
|
41
|
+
expect(actual).toStrictEqual(expectedProps);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
describe("given a list of partially defined props", () => {
|
|
45
|
+
it("returns flex props that are defined", () => {
|
|
46
|
+
const props = {
|
|
47
|
+
flexDirection: "row",
|
|
48
|
+
flexWrap: undefined,
|
|
49
|
+
flexGrow: "1",
|
|
50
|
+
flex: undefined,
|
|
51
|
+
justifyContent: "start",
|
|
52
|
+
alignItems: undefined,
|
|
53
|
+
alignContent: "center",
|
|
54
|
+
gap: undefined,
|
|
55
|
+
rowGap: "20px",
|
|
56
|
+
columnGap: undefined,
|
|
57
|
+
};
|
|
58
|
+
const expectedProps = {
|
|
59
|
+
flexDirection: "row",
|
|
60
|
+
flexGrow: "1",
|
|
61
|
+
justifyContent: "start",
|
|
62
|
+
alignContent: "center",
|
|
63
|
+
rowGap: "20px",
|
|
64
|
+
display: "flex",
|
|
65
|
+
};
|
|
66
|
+
const actual = (0, propUtils_1.buildFlexStyles)(props);
|
|
67
|
+
expect(actual).toStrictEqual(expectedProps);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
describe("splitProps", () => {
|
|
72
|
+
describe("given a list of props", () => {
|
|
73
|
+
it("returns an array with two items: 1) specified flex props; 2) all other props", () => {
|
|
74
|
+
const flexProps = {
|
|
75
|
+
flexDirection: "row",
|
|
76
|
+
flexWrap: "wrap",
|
|
77
|
+
flexGrow: "1",
|
|
78
|
+
flex: "1 1 0px",
|
|
79
|
+
justifyContent: "start",
|
|
80
|
+
alignItems: "stretch",
|
|
81
|
+
alignContent: "center",
|
|
82
|
+
gap: "10px",
|
|
83
|
+
rowGap: "20px",
|
|
84
|
+
columnGap: "30px",
|
|
85
|
+
};
|
|
86
|
+
const otherProps = {
|
|
87
|
+
a: 1,
|
|
88
|
+
b: "Two",
|
|
89
|
+
c: [],
|
|
90
|
+
d: {},
|
|
91
|
+
};
|
|
92
|
+
const props = Object.assign(Object.assign({}, flexProps), otherProps);
|
|
93
|
+
const actual = (0, propUtils_1.splitProps)(props);
|
|
94
|
+
const expected = [flexProps, otherProps];
|
|
95
|
+
expect(actual).toStrictEqual(expected);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
//# sourceMappingURL=propUtils.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propUtils.test.js","sourceRoot":"","sources":["../../../../src/components/Flex/propUtils.test.ts"],"names":[],"mappings":";;AAAA,2CAIqB;AAErB,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,MAAM,KAAK,GAAG;YACZ,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,KAAK;YACR,CAAC,EAAE,EAAE;YACL,CAAC,EAAE,EAAE;YACL,CAAC,EAAE,SAAS;YACZ,CAAC,EAAE,SAAS;SACb,CAAC;QAEF,MAAM,MAAM,GAAG,IAAA,kCAAsB,EAAC,KAAK,CAAC,CAAC;QAE7C,MAAM,QAAQ,GAAG;YACf,CAAC,EAAE,CAAC;YACJ,CAAC,EAAE,KAAK;YACR,CAAC,EAAE,EAAE;YACL,CAAC,EAAE,EAAE;SACN,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,CAAC,a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property } from "csstype";
|
|
3
|
+
import { DOMProps } from "@react-types/shared";
|
|
4
|
+
export type FlexElementType = HTMLDivElement;
|
|
5
|
+
export interface FlexStyleProps {
|
|
6
|
+
elementType?: string | React.ElementType;
|
|
7
|
+
flexDirection?: Property.FlexDirection;
|
|
8
|
+
flexWrap?: Property.FlexWrap;
|
|
9
|
+
flexGrow?: Property.FlexGrow;
|
|
10
|
+
flex?: Property.Flex;
|
|
11
|
+
/** Aligns grid items along the block (column) axis */
|
|
12
|
+
alignItems?: Property.AlignItems;
|
|
13
|
+
/** Aligns the grid along the inline (row) axis */
|
|
14
|
+
alignContent?: Property.AlignContent;
|
|
15
|
+
/** Aligns the grid along the inline (row) axis */
|
|
16
|
+
justifyContent?: Property.JustifyContent;
|
|
17
|
+
/** How big a gap between the columns and rows */
|
|
18
|
+
gap?: Property.Gap;
|
|
19
|
+
/** How big a gap between the rows */
|
|
20
|
+
rowGap?: Property.RowGap;
|
|
21
|
+
/** How big a gap between the columns */
|
|
22
|
+
columnGap?: Property.ColumnGap;
|
|
23
|
+
style?: React.CSSProperties;
|
|
24
|
+
}
|
|
25
|
+
export interface FlexNonStyleProps extends DOMProps, RefAttributes<FlexElementType> {
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
/** Custom class name for setting specific CSS */
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface FlexProps extends FlexStyleProps, FlexNonStyleProps {
|
|
31
|
+
}
|
|
32
|
+
export type FlexRef = Ref<FlexElementType>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/Flex/types.ts"],"names":[],"mappings":""}
|