@akinon/ui-space 0.4.0 → 1.0.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.
@@ -1,5 +1,26 @@
1
1
  import * as React from 'react';
2
2
  import type { CompactSpaceProps, SpaceProps } from './types';
3
+ /**
4
+ * Space component for arranging elements with consistent spacing.
5
+ *
6
+ * The Space component is designed to provide uniform spacing between child elements
7
+ * in either a horizontal or vertical direction. It simplifies the creation of layouts
8
+ * with proper alignment and spacing, ensuring a clean and consistent design.
9
+ *
10
+ * Features:
11
+ * - **Customizable Size**: Supports predefined sizes (`small`, `middle`, `large`) or a custom numeric value.
12
+ * - **Direction**: Easily switch between horizontal or vertical stacking of child elements.
13
+ * - **Alignment**: Aligns items with options like `start`, `end`, `center`, or `baseline`.
14
+ * - **Wrap Support**: Automatically wraps items to the next line if they exceed the container width.
15
+ * - **Split Element**: Add a customizable separator between child elements.
16
+ * - **Block Mode**: Enables full-width layout for the space.
17
+ * - **Flexible Class Names**: Allows customization through `className` and `rootClassName` props.
18
+ *
19
+ * Additionally, the `CompactSpaceProps` interface extends functionality for compact layouts,
20
+ * providing tighter spacing and alignment options for more space-efficient designs.
21
+ *
22
+ * Ideal for consistent spacing between buttons, icons, or other grouped elements in a layout.
23
+ */
3
24
  export declare const Space: ({ children, block, ...restSpaceProps }: SpaceProps) => React.JSX.Element;
4
25
  /**
5
26
  * Supported child components:
@@ -1 +1 @@
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"}
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;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,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
@@ -15,6 +15,27 @@ exports.CompactSpace = exports.Space = void 0;
15
15
  const antd_1 = require("antd");
16
16
  const React = require("react");
17
17
  const AntdCompact = antd_1.Space.Compact;
18
+ /**
19
+ * Space component for arranging elements with consistent spacing.
20
+ *
21
+ * The Space component is designed to provide uniform spacing between child elements
22
+ * in either a horizontal or vertical direction. It simplifies the creation of layouts
23
+ * with proper alignment and spacing, ensuring a clean and consistent design.
24
+ *
25
+ * Features:
26
+ * - **Customizable Size**: Supports predefined sizes (`small`, `middle`, `large`) or a custom numeric value.
27
+ * - **Direction**: Easily switch between horizontal or vertical stacking of child elements.
28
+ * - **Alignment**: Aligns items with options like `start`, `end`, `center`, or `baseline`.
29
+ * - **Wrap Support**: Automatically wraps items to the next line if they exceed the container width.
30
+ * - **Split Element**: Add a customizable separator between child elements.
31
+ * - **Block Mode**: Enables full-width layout for the space.
32
+ * - **Flexible Class Names**: Allows customization through `className` and `rootClassName` props.
33
+ *
34
+ * Additionally, the `CompactSpaceProps` interface extends functionality for compact layouts,
35
+ * providing tighter spacing and alignment options for more space-efficient designs.
36
+ *
37
+ * Ideal for consistent spacing between buttons, icons, or other grouped elements in a layout.
38
+ */
18
39
  const Space = (_a) => {
19
40
  var { children, block } = _a, restSpaceProps = __rest(_a, ["children", "block"]);
20
41
  return (React.createElement(antd_1.Space, Object.assign({}, restSpaceProps, (block && { style: { width: '100%' } })), children));
@@ -0,0 +1,83 @@
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
+
6
+ export type SpaceDirection = 'horizontal' | 'vertical';
7
+
8
+ export interface SpaceProps extends React.HTMLAttributes<HTMLDivElement> {
9
+ /**
10
+ * Space's class name
11
+ */
12
+ className?: string;
13
+
14
+ /**
15
+ * Space's root class name
16
+ */
17
+ rootClassName?: string;
18
+
19
+ /**
20
+ * Space's size
21
+ */
22
+ size?: SpaceSize | [SpaceSize, SpaceSize];
23
+
24
+ /**
25
+ * Whether to make the space block (full width)
26
+ */
27
+ block?: boolean;
28
+
29
+ /**
30
+ * Space's direction
31
+ */
32
+ direction?: SpaceDirection;
33
+
34
+ /**
35
+ * Space's alignment
36
+ */
37
+ align?: 'start' | 'end' | 'center' | 'baseline';
38
+
39
+ /**
40
+ * Space's split element
41
+ */
42
+ split?: React.ReactNode;
43
+
44
+ /**
45
+ * Whether to wrap the space items
46
+ */
47
+ wrap?: boolean;
48
+
49
+ /**
50
+ * Space's item class names
51
+ */
52
+ classNames?: {
53
+ item: string;
54
+ };
55
+
56
+ /**
57
+ * @ignore
58
+ */
59
+ styles?: DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE;
60
+ }
61
+
62
+ export interface CompactSpaceProps
63
+ extends React.HTMLAttributes<HTMLDivElement> {
64
+ /**
65
+ * Compact space's size
66
+ */
67
+ size?: Exclude<SpaceSize, number>;
68
+
69
+ /**
70
+ * Compact space's direction
71
+ */
72
+ direction?: SpaceDirection;
73
+
74
+ /**
75
+ * Whether to make the compact space block
76
+ */
77
+ block?: boolean;
78
+
79
+ /**
80
+ * Compact space's root class name
81
+ */
82
+ rootClassName?: string;
83
+ }
@@ -1,5 +1,26 @@
1
1
  import * as React from 'react';
2
2
  import type { CompactSpaceProps, SpaceProps } from './types';
3
+ /**
4
+ * Space component for arranging elements with consistent spacing.
5
+ *
6
+ * The Space component is designed to provide uniform spacing between child elements
7
+ * in either a horizontal or vertical direction. It simplifies the creation of layouts
8
+ * with proper alignment and spacing, ensuring a clean and consistent design.
9
+ *
10
+ * Features:
11
+ * - **Customizable Size**: Supports predefined sizes (`small`, `middle`, `large`) or a custom numeric value.
12
+ * - **Direction**: Easily switch between horizontal or vertical stacking of child elements.
13
+ * - **Alignment**: Aligns items with options like `start`, `end`, `center`, or `baseline`.
14
+ * - **Wrap Support**: Automatically wraps items to the next line if they exceed the container width.
15
+ * - **Split Element**: Add a customizable separator between child elements.
16
+ * - **Block Mode**: Enables full-width layout for the space.
17
+ * - **Flexible Class Names**: Allows customization through `className` and `rootClassName` props.
18
+ *
19
+ * Additionally, the `CompactSpaceProps` interface extends functionality for compact layouts,
20
+ * providing tighter spacing and alignment options for more space-efficient designs.
21
+ *
22
+ * Ideal for consistent spacing between buttons, icons, or other grouped elements in a layout.
23
+ */
3
24
  export declare const Space: ({ children, block, ...restSpaceProps }: SpaceProps) => React.JSX.Element;
4
25
  /**
5
26
  * Supported child components:
@@ -1 +1 @@
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"}
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;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,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
@@ -12,6 +12,27 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { Space as AntSpace } from 'antd';
13
13
  import * as React from 'react';
14
14
  const AntdCompact = AntSpace.Compact;
15
+ /**
16
+ * Space component for arranging elements with consistent spacing.
17
+ *
18
+ * The Space component is designed to provide uniform spacing between child elements
19
+ * in either a horizontal or vertical direction. It simplifies the creation of layouts
20
+ * with proper alignment and spacing, ensuring a clean and consistent design.
21
+ *
22
+ * Features:
23
+ * - **Customizable Size**: Supports predefined sizes (`small`, `middle`, `large`) or a custom numeric value.
24
+ * - **Direction**: Easily switch between horizontal or vertical stacking of child elements.
25
+ * - **Alignment**: Aligns items with options like `start`, `end`, `center`, or `baseline`.
26
+ * - **Wrap Support**: Automatically wraps items to the next line if they exceed the container width.
27
+ * - **Split Element**: Add a customizable separator between child elements.
28
+ * - **Block Mode**: Enables full-width layout for the space.
29
+ * - **Flexible Class Names**: Allows customization through `className` and `rootClassName` props.
30
+ *
31
+ * Additionally, the `CompactSpaceProps` interface extends functionality for compact layouts,
32
+ * providing tighter spacing and alignment options for more space-efficient designs.
33
+ *
34
+ * Ideal for consistent spacing between buttons, icons, or other grouped elements in a layout.
35
+ */
15
36
  export const Space = (_a) => {
16
37
  var { children, block } = _a, restSpaceProps = __rest(_a, ["children", "block"]);
17
38
  return (React.createElement(AntSpace, Object.assign({}, restSpaceProps, (block && { style: { width: '100%' } })), children));
@@ -0,0 +1,83 @@
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
+
6
+ export type SpaceDirection = 'horizontal' | 'vertical';
7
+
8
+ export interface SpaceProps extends React.HTMLAttributes<HTMLDivElement> {
9
+ /**
10
+ * Space's class name
11
+ */
12
+ className?: string;
13
+
14
+ /**
15
+ * Space's root class name
16
+ */
17
+ rootClassName?: string;
18
+
19
+ /**
20
+ * Space's size
21
+ */
22
+ size?: SpaceSize | [SpaceSize, SpaceSize];
23
+
24
+ /**
25
+ * Whether to make the space block (full width)
26
+ */
27
+ block?: boolean;
28
+
29
+ /**
30
+ * Space's direction
31
+ */
32
+ direction?: SpaceDirection;
33
+
34
+ /**
35
+ * Space's alignment
36
+ */
37
+ align?: 'start' | 'end' | 'center' | 'baseline';
38
+
39
+ /**
40
+ * Space's split element
41
+ */
42
+ split?: React.ReactNode;
43
+
44
+ /**
45
+ * Whether to wrap the space items
46
+ */
47
+ wrap?: boolean;
48
+
49
+ /**
50
+ * Space's item class names
51
+ */
52
+ classNames?: {
53
+ item: string;
54
+ };
55
+
56
+ /**
57
+ * @ignore
58
+ */
59
+ styles?: DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE;
60
+ }
61
+
62
+ export interface CompactSpaceProps
63
+ extends React.HTMLAttributes<HTMLDivElement> {
64
+ /**
65
+ * Compact space's size
66
+ */
67
+ size?: Exclude<SpaceSize, number>;
68
+
69
+ /**
70
+ * Compact space's direction
71
+ */
72
+ direction?: SpaceDirection;
73
+
74
+ /**
75
+ * Whether to make the compact space block
76
+ */
77
+ block?: boolean;
78
+
79
+ /**
80
+ * Compact space's root class name
81
+ */
82
+ rootClassName?: string;
83
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/ui-space",
3
- "version": "0.4.0",
3
+ "version": "1.0.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/esm/index.js",
@@ -9,15 +9,15 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "antd": "5.17.0"
12
+ "antd": "5.22.6"
13
13
  },
14
14
  "devDependencies": {
15
15
  "clean-package": "2.2.0",
16
16
  "copyfiles": "^2.4.1",
17
17
  "rimraf": "^5.0.5",
18
- "typescript": "^5.2.2",
19
- "@akinon/typescript-config": "0.3.0",
20
- "@akinon/ui-theme": "0.6.0"
18
+ "typescript": "*",
19
+ "@akinon/ui-theme": "1.0.0",
20
+ "@akinon/typescript-config": "1.0.0"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "react": ">=18",
@@ -37,7 +37,7 @@
37
37
  "build": "pnpm run build:esm && pnpm run build:commonjs && pnpm run copy:files",
38
38
  "build:esm": "tsc --outDir dist/esm",
39
39
  "build:commonjs": "tsc --module commonjs --outDir dist/cjs",
40
- "copy:files": "copyfiles -u 1 src/**/*.css dist/esm && copyfiles -u 1 src/**/*.css dist/cjs",
40
+ "copy:files": "copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/esm && copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/cjs",
41
41
  "clean": "rimraf dist/",
42
42
  "typecheck": "tsc --noEmit"
43
43
  }