@akinon/ui-spin 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,15 @@
1
1
  import * as React from 'react';
2
2
  import type { SpinProps } from './types';
3
3
  export type { SpinProps } from './types';
4
+ /**
5
+ * Spin component is used to indicate loading states in the application. It can be used with or without wrapping content.
6
+ *
7
+ * - The `spinning` property controls the visibility of the spin animation.
8
+ * - The `size` property allows customization of the spinner size (`small`, `default`, or `large`).
9
+ * - A custom loading indicator can be provided using the `indicator` property.
10
+ * - When used with children, the `tip` property can display descriptive content to provide additional context about the loading state.
11
+ * - The `fullscreen` property enables a backdrop behind the spinner, making it suitable for blocking the entire screen during loading.
12
+ *
13
+ */
4
14
  export declare const Spin: (props: SpinProps) => React.JSX.Element;
5
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,IAAI,UAAW,SAAS,sBA4BpC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;;;;;GASG;AAEH,eAAO,MAAM,IAAI,UAAW,SAAS,sBA4BpC,CAAC"}
package/dist/cjs/index.js CHANGED
@@ -5,6 +5,16 @@ const ui_theme_1 = require("@akinon/ui-theme");
5
5
  const cssinjs_1 = require("@ant-design/cssinjs");
6
6
  const antd_1 = require("antd");
7
7
  const React = require("react");
8
+ /**
9
+ * Spin component is used to indicate loading states in the application. It can be used with or without wrapping content.
10
+ *
11
+ * - The `spinning` property controls the visibility of the spin animation.
12
+ * - The `size` property allows customization of the spinner size (`small`, `default`, or `large`).
13
+ * - A custom loading indicator can be provided using the `indicator` property.
14
+ * - When used with children, the `tip` property can display descriptive content to provide additional context about the loading state.
15
+ * - The `fullscreen` property enables a backdrop behind the spinner, making it suitable for blocking the entire screen during loading.
16
+ *
17
+ */
8
18
  const Spin = (props) => {
9
19
  const { getPrefixCls, theme } = React.useContext(antd_1.ConfigProvider.ConfigContext);
10
20
  const { token, hashId } = (0, ui_theme_1.useToken)();
@@ -0,0 +1,73 @@
1
+ export type SpinProps = Omit<AntSpinProps, 'prefixCls' | 'style' | 'styles'>;
2
+
3
+ declare const SpinSizes: readonly ['small', 'default', 'large'];
4
+
5
+ export type SpinSize = (typeof SpinSizes)[number];
6
+
7
+ export type SpinIndicator = React.ReactElement<HTMLElement>;
8
+
9
+ export interface AntSpinProps {
10
+ /**
11
+ * The prefixCls of the component
12
+ */
13
+ prefixCls?: string;
14
+
15
+ /**
16
+ * The additional css class
17
+ */
18
+ className?: string;
19
+
20
+ /**
21
+ * ClassName on the root element
22
+ */
23
+ rootClassName?: string;
24
+
25
+ /**
26
+ * Whether Spin is visible
27
+ */
28
+ spinning?: boolean;
29
+
30
+ /**
31
+ * Inline styles for the spin component.
32
+ */
33
+ style?: React.CSSProperties;
34
+
35
+ /**
36
+ * The size of Spin
37
+ */
38
+ size?: SpinSize;
39
+
40
+ /**
41
+ * Customize description content when Spin has children
42
+ */
43
+ tip?: React.ReactNode;
44
+
45
+ /**
46
+ * Specifies a delay in milliseconds for loading state (prevent flush)
47
+ */
48
+ delay?: number;
49
+
50
+ /**
51
+ * The className of wrapper when Spin has children
52
+ */
53
+ wrapperClassName?: string;
54
+
55
+ /**
56
+ * React node of the spinning indicator
57
+ */
58
+ indicator?: SpinIndicator;
59
+
60
+ /**
61
+ * The children of the spin.
62
+ */
63
+ children?: React.ReactNode;
64
+
65
+ /**
66
+ * Display a backdrop with the Spin component
67
+ */
68
+ fullscreen?: boolean;
69
+ }
70
+
71
+ export type SpinType = React.FC<SpinProps> & {
72
+ setDefaultIndicator: (indicator: React.ReactNode) => void;
73
+ };
@@ -1,5 +1,15 @@
1
1
  import * as React from 'react';
2
2
  import type { SpinProps } from './types';
3
3
  export type { SpinProps } from './types';
4
+ /**
5
+ * Spin component is used to indicate loading states in the application. It can be used with or without wrapping content.
6
+ *
7
+ * - The `spinning` property controls the visibility of the spin animation.
8
+ * - The `size` property allows customization of the spinner size (`small`, `default`, or `large`).
9
+ * - A custom loading indicator can be provided using the `indicator` property.
10
+ * - When used with children, the `tip` property can display descriptive content to provide additional context about the loading state.
11
+ * - The `fullscreen` property enables a backdrop behind the spinner, making it suitable for blocking the entire screen during loading.
12
+ *
13
+ */
4
14
  export declare const Spin: (props: SpinProps) => React.JSX.Element;
5
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,IAAI,UAAW,SAAS,sBA4BpC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;;;;;GASG;AAEH,eAAO,MAAM,IAAI,UAAW,SAAS,sBA4BpC,CAAC"}
package/dist/esm/index.js CHANGED
@@ -2,6 +2,16 @@ import { useToken } from '@akinon/ui-theme';
2
2
  import { useStyleRegister } from '@ant-design/cssinjs';
3
3
  import { ConfigProvider, Spin as AntSpin } from 'antd';
4
4
  import * as React from 'react';
5
+ /**
6
+ * Spin component is used to indicate loading states in the application. It can be used with or without wrapping content.
7
+ *
8
+ * - The `spinning` property controls the visibility of the spin animation.
9
+ * - The `size` property allows customization of the spinner size (`small`, `default`, or `large`).
10
+ * - A custom loading indicator can be provided using the `indicator` property.
11
+ * - When used with children, the `tip` property can display descriptive content to provide additional context about the loading state.
12
+ * - The `fullscreen` property enables a backdrop behind the spinner, making it suitable for blocking the entire screen during loading.
13
+ *
14
+ */
5
15
  export const Spin = (props) => {
6
16
  const { getPrefixCls, theme } = React.useContext(ConfigProvider.ConfigContext);
7
17
  const { token, hashId } = useToken();
@@ -0,0 +1,73 @@
1
+ export type SpinProps = Omit<AntSpinProps, 'prefixCls' | 'style' | 'styles'>;
2
+
3
+ declare const SpinSizes: readonly ['small', 'default', 'large'];
4
+
5
+ export type SpinSize = (typeof SpinSizes)[number];
6
+
7
+ export type SpinIndicator = React.ReactElement<HTMLElement>;
8
+
9
+ export interface AntSpinProps {
10
+ /**
11
+ * The prefixCls of the component
12
+ */
13
+ prefixCls?: string;
14
+
15
+ /**
16
+ * The additional css class
17
+ */
18
+ className?: string;
19
+
20
+ /**
21
+ * ClassName on the root element
22
+ */
23
+ rootClassName?: string;
24
+
25
+ /**
26
+ * Whether Spin is visible
27
+ */
28
+ spinning?: boolean;
29
+
30
+ /**
31
+ * Inline styles for the spin component.
32
+ */
33
+ style?: React.CSSProperties;
34
+
35
+ /**
36
+ * The size of Spin
37
+ */
38
+ size?: SpinSize;
39
+
40
+ /**
41
+ * Customize description content when Spin has children
42
+ */
43
+ tip?: React.ReactNode;
44
+
45
+ /**
46
+ * Specifies a delay in milliseconds for loading state (prevent flush)
47
+ */
48
+ delay?: number;
49
+
50
+ /**
51
+ * The className of wrapper when Spin has children
52
+ */
53
+ wrapperClassName?: string;
54
+
55
+ /**
56
+ * React node of the spinning indicator
57
+ */
58
+ indicator?: SpinIndicator;
59
+
60
+ /**
61
+ * The children of the spin.
62
+ */
63
+ children?: React.ReactNode;
64
+
65
+ /**
66
+ * Display a backdrop with the Spin component
67
+ */
68
+ fullscreen?: boolean;
69
+ }
70
+
71
+ export type SpinType = React.FC<SpinProps> & {
72
+ setDefaultIndicator: (indicator: React.ReactNode) => void;
73
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/ui-spin",
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",
13
- "@akinon/ui-theme": "0.6.0"
12
+ "antd": "5.22.6",
13
+ "@akinon/ui-theme": "1.0.0"
14
14
  },
15
15
  "devDependencies": {
16
16
  "clean-package": "2.2.0",
17
17
  "copyfiles": "^2.4.1",
18
18
  "rimraf": "^5.0.5",
19
- "typescript": "^5.2.2",
20
- "@akinon/typescript-config": "0.3.0"
19
+ "typescript": "*",
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
  }