@akinon/ui-space 0.3.0 → 0.5.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/dist/cjs/index.d.ts +15 -4
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +20 -3
- package/dist/cjs/types.d.ts +74 -0
- package/dist/esm/index.d.ts +15 -4
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +17 -1
- package/dist/esm/types.d.ts +74 -0
- package/package.json +4 -9
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import type { SpaceProps as AntSpaceProps } from 'antd';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
type SpaceProps
|
|
4
|
-
export declare const Space: ({ children, ...restSpaceProps }: SpaceProps) => React.JSX.Element;
|
|
5
|
-
|
|
2
|
+
import type { CompactSpaceProps, SpaceProps } from './types';
|
|
3
|
+
export declare const Space: ({ children, block, ...restSpaceProps }: SpaceProps) => React.JSX.Element;
|
|
4
|
+
/**
|
|
5
|
+
* Supported child components:
|
|
6
|
+
* - Button
|
|
7
|
+
* - AutoComplete
|
|
8
|
+
* - DatePicker
|
|
9
|
+
* - Input
|
|
10
|
+
* - InputSearch
|
|
11
|
+
* - InputNumber
|
|
12
|
+
* - Select
|
|
13
|
+
* - TimePicker
|
|
14
|
+
*/
|
|
15
|
+
export declare const CompactSpace: React.FC<CompactSpaceProps>;
|
|
16
|
+
export type { CompactSpaceProps };
|
|
6
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAI7D,eAAO,MAAM,KAAK,2CAA4C,UAAU,sBASvE,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAKpD,CAAC;AAEF,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -11,11 +11,28 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.Space = void 0;
|
|
14
|
+
exports.CompactSpace = exports.Space = void 0;
|
|
15
15
|
const antd_1 = require("antd");
|
|
16
16
|
const React = require("react");
|
|
17
|
+
const AntdCompact = antd_1.Space.Compact;
|
|
17
18
|
const Space = (_a) => {
|
|
18
|
-
var { children } = _a, restSpaceProps = __rest(_a, ["children"]);
|
|
19
|
-
return React.createElement(antd_1.Space, Object.assign({}, restSpaceProps), children);
|
|
19
|
+
var { children, block } = _a, restSpaceProps = __rest(_a, ["children", "block"]);
|
|
20
|
+
return (React.createElement(antd_1.Space, Object.assign({}, restSpaceProps, (block && { style: { width: '100%' } })), children));
|
|
20
21
|
};
|
|
21
22
|
exports.Space = Space;
|
|
23
|
+
/**
|
|
24
|
+
* Supported child components:
|
|
25
|
+
* - Button
|
|
26
|
+
* - AutoComplete
|
|
27
|
+
* - DatePicker
|
|
28
|
+
* - Input
|
|
29
|
+
* - InputSearch
|
|
30
|
+
* - InputNumber
|
|
31
|
+
* - Select
|
|
32
|
+
* - TimePicker
|
|
33
|
+
*/
|
|
34
|
+
const CompactSpace = (_a) => {
|
|
35
|
+
var { children } = _a, restSpaceProps = __rest(_a, ["children"]);
|
|
36
|
+
return React.createElement(AntdCompact, Object.assign({}, restSpaceProps), children);
|
|
37
|
+
};
|
|
38
|
+
exports.CompactSpace = CompactSpace;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE } from '@akinon/ui-theme';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
|
|
4
|
+
export type SpaceSize = 'small' | 'middle' | 'large' | number;
|
|
5
|
+
export type SpaceDirection = 'horizontal' | 'vertical';
|
|
6
|
+
|
|
7
|
+
export interface SpaceProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/**
|
|
9
|
+
* Space's class name
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Space's root class name
|
|
14
|
+
*/
|
|
15
|
+
rootClassName?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Space's size
|
|
18
|
+
*/
|
|
19
|
+
size?: SpaceSize | [SpaceSize, SpaceSize];
|
|
20
|
+
/**
|
|
21
|
+
* Whether to make the space block (full width)
|
|
22
|
+
*/
|
|
23
|
+
block?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Space's direction
|
|
26
|
+
*/
|
|
27
|
+
direction?: SpaceDirection;
|
|
28
|
+
/**
|
|
29
|
+
* Space's alignment
|
|
30
|
+
*/
|
|
31
|
+
align?: 'start' | 'end' | 'center' | 'baseline';
|
|
32
|
+
/**
|
|
33
|
+
* Space's split element
|
|
34
|
+
*/
|
|
35
|
+
split?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Whether to wrap the space items
|
|
38
|
+
*/
|
|
39
|
+
wrap?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Space's item class names
|
|
42
|
+
*/
|
|
43
|
+
classNames?: {
|
|
44
|
+
item: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* @ignore
|
|
48
|
+
*/
|
|
49
|
+
styles?: DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE;
|
|
50
|
+
/**
|
|
51
|
+
* @ignore
|
|
52
|
+
*/
|
|
53
|
+
style?: DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface CompactSpaceProps
|
|
57
|
+
extends React.HTMLAttributes<HTMLDivElement> {
|
|
58
|
+
/**
|
|
59
|
+
* Compact space's size
|
|
60
|
+
*/
|
|
61
|
+
size?: Exclude<SpaceSize, number>;
|
|
62
|
+
/**
|
|
63
|
+
* Compact space's direction
|
|
64
|
+
*/
|
|
65
|
+
direction?: SpaceDirection;
|
|
66
|
+
/**
|
|
67
|
+
* Whether to make the compact space block
|
|
68
|
+
*/
|
|
69
|
+
block?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Compact space's root class name
|
|
72
|
+
*/
|
|
73
|
+
rootClassName?: string;
|
|
74
|
+
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import type { SpaceProps as AntSpaceProps } from 'antd';
|
|
2
1
|
import * as React from 'react';
|
|
3
|
-
type SpaceProps
|
|
4
|
-
export declare const Space: ({ children, ...restSpaceProps }: SpaceProps) => React.JSX.Element;
|
|
5
|
-
|
|
2
|
+
import type { CompactSpaceProps, SpaceProps } from './types';
|
|
3
|
+
export declare const Space: ({ children, block, ...restSpaceProps }: SpaceProps) => React.JSX.Element;
|
|
4
|
+
/**
|
|
5
|
+
* Supported child components:
|
|
6
|
+
* - Button
|
|
7
|
+
* - AutoComplete
|
|
8
|
+
* - DatePicker
|
|
9
|
+
* - Input
|
|
10
|
+
* - InputSearch
|
|
11
|
+
* - InputNumber
|
|
12
|
+
* - Select
|
|
13
|
+
* - TimePicker
|
|
14
|
+
*/
|
|
15
|
+
export declare const CompactSpace: React.FC<CompactSpaceProps>;
|
|
16
|
+
export type { CompactSpaceProps };
|
|
6
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAI7D,eAAO,MAAM,KAAK,2CAA4C,UAAU,sBASvE,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAKpD,CAAC;AAEF,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -11,7 +11,23 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { Space as AntSpace } from 'antd';
|
|
13
13
|
import * as React from 'react';
|
|
14
|
+
const AntdCompact = AntSpace.Compact;
|
|
14
15
|
export const Space = (_a) => {
|
|
16
|
+
var { children, block } = _a, restSpaceProps = __rest(_a, ["children", "block"]);
|
|
17
|
+
return (React.createElement(AntSpace, Object.assign({}, restSpaceProps, (block && { style: { width: '100%' } })), children));
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Supported child components:
|
|
21
|
+
* - Button
|
|
22
|
+
* - AutoComplete
|
|
23
|
+
* - DatePicker
|
|
24
|
+
* - Input
|
|
25
|
+
* - InputSearch
|
|
26
|
+
* - InputNumber
|
|
27
|
+
* - Select
|
|
28
|
+
* - TimePicker
|
|
29
|
+
*/
|
|
30
|
+
export const CompactSpace = (_a) => {
|
|
15
31
|
var { children } = _a, restSpaceProps = __rest(_a, ["children"]);
|
|
16
|
-
return React.createElement(
|
|
32
|
+
return React.createElement(AntdCompact, Object.assign({}, restSpaceProps), children);
|
|
17
33
|
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE } from '@akinon/ui-theme';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
|
|
4
|
+
export type SpaceSize = 'small' | 'middle' | 'large' | number;
|
|
5
|
+
export type SpaceDirection = 'horizontal' | 'vertical';
|
|
6
|
+
|
|
7
|
+
export interface SpaceProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
/**
|
|
9
|
+
* Space's class name
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Space's root class name
|
|
14
|
+
*/
|
|
15
|
+
rootClassName?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Space's size
|
|
18
|
+
*/
|
|
19
|
+
size?: SpaceSize | [SpaceSize, SpaceSize];
|
|
20
|
+
/**
|
|
21
|
+
* Whether to make the space block (full width)
|
|
22
|
+
*/
|
|
23
|
+
block?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Space's direction
|
|
26
|
+
*/
|
|
27
|
+
direction?: SpaceDirection;
|
|
28
|
+
/**
|
|
29
|
+
* Space's alignment
|
|
30
|
+
*/
|
|
31
|
+
align?: 'start' | 'end' | 'center' | 'baseline';
|
|
32
|
+
/**
|
|
33
|
+
* Space's split element
|
|
34
|
+
*/
|
|
35
|
+
split?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Whether to wrap the space items
|
|
38
|
+
*/
|
|
39
|
+
wrap?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Space's item class names
|
|
42
|
+
*/
|
|
43
|
+
classNames?: {
|
|
44
|
+
item: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* @ignore
|
|
48
|
+
*/
|
|
49
|
+
styles?: DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE;
|
|
50
|
+
/**
|
|
51
|
+
* @ignore
|
|
52
|
+
*/
|
|
53
|
+
style?: DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface CompactSpaceProps
|
|
57
|
+
extends React.HTMLAttributes<HTMLDivElement> {
|
|
58
|
+
/**
|
|
59
|
+
* Compact space's size
|
|
60
|
+
*/
|
|
61
|
+
size?: Exclude<SpaceSize, number>;
|
|
62
|
+
/**
|
|
63
|
+
* Compact space's direction
|
|
64
|
+
*/
|
|
65
|
+
direction?: SpaceDirection;
|
|
66
|
+
/**
|
|
67
|
+
* Whether to make the compact space block
|
|
68
|
+
*/
|
|
69
|
+
block?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Compact space's root class name
|
|
72
|
+
*/
|
|
73
|
+
rootClassName?: string;
|
|
74
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/ui-space",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
"copyfiles": "^2.4.1",
|
|
17
17
|
"rimraf": "^5.0.5",
|
|
18
18
|
"typescript": "^5.2.2",
|
|
19
|
-
"@akinon/
|
|
20
|
-
"@akinon/
|
|
21
|
-
"@akinon/typescript-config": "0.2.0"
|
|
19
|
+
"@akinon/ui-theme": "0.7.0",
|
|
20
|
+
"@akinon/typescript-config": "0.4.0"
|
|
22
21
|
},
|
|
23
22
|
"peerDependencies": {
|
|
24
23
|
"react": ">=18",
|
|
@@ -38,12 +37,8 @@
|
|
|
38
37
|
"build": "pnpm run build:esm && pnpm run build:commonjs && pnpm run copy:files",
|
|
39
38
|
"build:esm": "tsc --outDir dist/esm",
|
|
40
39
|
"build:commonjs": "tsc --module commonjs --outDir dist/cjs",
|
|
41
|
-
"copy:files": "copyfiles -u 1 src
|
|
40
|
+
"copy:files": "copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/esm && copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/cjs",
|
|
42
41
|
"clean": "rimraf dist/",
|
|
43
|
-
"lint": "eslint *.ts*",
|
|
44
|
-
"test": "vitest run",
|
|
45
|
-
"test:ui": "vitest --ui",
|
|
46
|
-
"test:watch": "vitest watch",
|
|
47
42
|
"typecheck": "tsc --noEmit"
|
|
48
43
|
}
|
|
49
44
|
}
|