@akinon/ui-result 0.1.0 → 0.3.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,6 +1,9 @@
1
- import type { ResultProps as AntResultProps } from 'antd';
2
1
  import * as React from 'react';
3
- type ResultProps = AntResultProps;
4
- export declare const Result: ({ children, ...props }: ResultProps) => React.JSX.Element;
5
- export {};
2
+ import { IResultProps } from './types';
3
+ /**
4
+ * Result component for Akinon UI.
5
+ * This component provides a pre-baked result element with various types, icons, and states.
6
+ * It also supports custom icons and extra content to fit a wide range of use cases within the Akinon design system.
7
+ */
8
+ export declare const Result: ({ children, icon, ...props }: IResultProps) => React.JSX.Element;
6
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,KAAK,WAAW,GAAG,cAAc,CAAC;AAElC,eAAO,MAAM,MAAM,2BAA4B,WAAW,sBAEzD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,MAAM,iCAAkC,YAAY,sBAShE,CAAC"}
package/dist/cjs/index.js CHANGED
@@ -12,10 +12,16 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.Result = void 0;
15
+ const icons_1 = require("@akinon/icons");
15
16
  const antd_1 = require("antd");
16
17
  const React = require("react");
18
+ /**
19
+ * Result component for Akinon UI.
20
+ * This component provides a pre-baked result element with various types, icons, and states.
21
+ * It also supports custom icons and extra content to fit a wide range of use cases within the Akinon design system.
22
+ */
17
23
  const Result = (_a) => {
18
- var { children } = _a, props = __rest(_a, ["children"]);
19
- return React.createElement(antd_1.Result, Object.assign({}, props), children);
24
+ var { children, icon } = _a, props = __rest(_a, ["children", "icon"]);
25
+ return (React.createElement(antd_1.Result, Object.assign({}, props, { icon: icon ? React.createElement(icons_1.Icon, { icon: icon, size: 64 }) : undefined }), children));
20
26
  };
21
27
  exports.Result = Result;
@@ -0,0 +1,39 @@
1
+ import type { IconName } from '@akinon/icons';
2
+ import { ResultStatusType } from 'antd/es/result';
3
+
4
+ /**
5
+ * Interface representing the properties for the Result component.
6
+ */
7
+ export interface IResultProps {
8
+ /**
9
+ * The status of the result.
10
+ * @default 'info'
11
+ */
12
+ status?: ResultStatusType;
13
+
14
+ /**
15
+ * The title of the result. `string` is strongly recommended due to the Akinon design system.
16
+ */
17
+ title?: React.ReactNode;
18
+
19
+ /**
20
+ * The subtitle of the result. `string` is strongly recommended due to the Akinon design system.
21
+ */
22
+ subTitle?: React.ReactNode;
23
+
24
+ /**
25
+ * The icon name of the icon. Only icons from `akinon/icons` are supported.
26
+ */
27
+ icon?: IconName;
28
+
29
+ /**
30
+ * The extra content of the result. `string` is strongly recommended due to the Akinon design system.
31
+ */
32
+ extra?: React.ReactNode;
33
+
34
+ /**
35
+ * The children of the result.
36
+ * @type {React.ReactNode}
37
+ */
38
+ children?: React.ReactNode;
39
+ }
@@ -1,6 +1,9 @@
1
- import type { ResultProps as AntResultProps } from 'antd';
2
1
  import * as React from 'react';
3
- type ResultProps = AntResultProps;
4
- export declare const Result: ({ children, ...props }: ResultProps) => React.JSX.Element;
5
- export {};
2
+ import { IResultProps } from './types';
3
+ /**
4
+ * Result component for Akinon UI.
5
+ * This component provides a pre-baked result element with various types, icons, and states.
6
+ * It also supports custom icons and extra content to fit a wide range of use cases within the Akinon design system.
7
+ */
8
+ export declare const Result: ({ children, icon, ...props }: IResultProps) => React.JSX.Element;
6
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,MAAM,CAAC;AAE1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,KAAK,WAAW,GAAG,cAAc,CAAC;AAElC,eAAO,MAAM,MAAM,2BAA4B,WAAW,sBAEzD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,MAAM,iCAAkC,YAAY,sBAShE,CAAC"}
package/dist/esm/index.js CHANGED
@@ -9,9 +9,15 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
+ import { Icon } from '@akinon/icons';
12
13
  import { Result as AntResult } from 'antd';
13
14
  import * as React from 'react';
15
+ /**
16
+ * Result component for Akinon UI.
17
+ * This component provides a pre-baked result element with various types, icons, and states.
18
+ * It also supports custom icons and extra content to fit a wide range of use cases within the Akinon design system.
19
+ */
14
20
  export const Result = (_a) => {
15
- var { children } = _a, props = __rest(_a, ["children"]);
16
- return React.createElement(AntResult, Object.assign({}, props), children);
21
+ var { children, icon } = _a, props = __rest(_a, ["children", "icon"]);
22
+ return (React.createElement(AntResult, Object.assign({}, props, { icon: icon ? React.createElement(Icon, { icon: icon, size: 64 }) : undefined }), children));
17
23
  };
@@ -0,0 +1,39 @@
1
+ import type { IconName } from '@akinon/icons';
2
+ import { ResultStatusType } from 'antd/es/result';
3
+
4
+ /**
5
+ * Interface representing the properties for the Result component.
6
+ */
7
+ export interface IResultProps {
8
+ /**
9
+ * The status of the result.
10
+ * @default 'info'
11
+ */
12
+ status?: ResultStatusType;
13
+
14
+ /**
15
+ * The title of the result. `string` is strongly recommended due to the Akinon design system.
16
+ */
17
+ title?: React.ReactNode;
18
+
19
+ /**
20
+ * The subtitle of the result. `string` is strongly recommended due to the Akinon design system.
21
+ */
22
+ subTitle?: React.ReactNode;
23
+
24
+ /**
25
+ * The icon name of the icon. Only icons from `akinon/icons` are supported.
26
+ */
27
+ icon?: IconName;
28
+
29
+ /**
30
+ * The extra content of the result. `string` is strongly recommended due to the Akinon design system.
31
+ */
32
+ extra?: React.ReactNode;
33
+
34
+ /**
35
+ * The children of the result.
36
+ * @type {React.ReactNode}
37
+ */
38
+ children?: React.ReactNode;
39
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/ui-result",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/esm/index.js",
@@ -9,16 +9,15 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "antd": "5.17.0"
12
+ "antd": "5.17.0",
13
+ "@akinon/icons": "0.6.0"
13
14
  },
14
15
  "devDependencies": {
15
16
  "clean-package": "2.2.0",
16
17
  "copyfiles": "^2.4.1",
17
18
  "rimraf": "^5.0.5",
18
19
  "typescript": "^5.2.2",
19
- "@akinon/typescript-config": "0.2.0",
20
- "@akinon/eslint-config": "0.1.0",
21
- "@akinon/vite-config": "0.4.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/**/*.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",
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
  }