@akinon/ui-steps 0.4.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.
@@ -0,0 +1,77 @@
1
+ import type { IconName } from '@akinon/icons';
2
+ import { DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE } from '@akinon/ui-theme';
3
+ import { ReactNode } from 'react';
4
+
5
+ export type TStepDirectionAndPlacement = 'horizontal' | 'vertical';
6
+ export type TSize = 'default' | 'small';
7
+ export type TStepStatus = 'wait' | 'process' | 'finish' | 'error';
8
+ export type TStepType = 'default' | 'navigation' | 'inline';
9
+ export type TStepProgressDot = (
10
+ iconDot,
11
+ { index, status, title, description }
12
+ ) => ReactNode;
13
+
14
+ type TMergedHTMLAttributes = React.HTMLAttributes<HTMLElement> &
15
+ React.ButtonHTMLAttributes<HTMLButtonElement> &
16
+ React.AnchorHTMLAttributes<HTMLAnchorElement>;
17
+
18
+ export interface IStepProps extends TMergedHTMLAttributes {
19
+ /**
20
+ * The current step index.
21
+ * @default 0
22
+ */
23
+ current?: number;
24
+ /**
25
+ * The initial step index.
26
+ * @default 0
27
+ */
28
+ initial?: number;
29
+ /**
30
+ * Whether the steps are responsive.
31
+ * @default true
32
+ */
33
+ responsive?: boolean;
34
+ /**
35
+ * The status of the steps.
36
+ */
37
+ status?: TStepStatus;
38
+ onChange?: (current) => void;
39
+ /**
40
+ * The steps items.
41
+ */
42
+ items?: {
43
+ /**
44
+ * The description of the step.
45
+ */
46
+ description?: ReactNode;
47
+ /**
48
+ * Whether the step is disabled.
49
+ */
50
+ disabled?: boolean;
51
+ /**
52
+ * The status of the step.
53
+ */
54
+ status?: TStepStatus;
55
+ /**
56
+ * The subtitle of the step.
57
+ */
58
+ subTitle?: ReactNode;
59
+ /**
60
+ * The title of the step.
61
+ */
62
+ title: ReactNode;
63
+ /**
64
+ * The icon of the step.
65
+ */
66
+ icon?: IconName;
67
+ }[];
68
+ /**
69
+ * Convert to multiple views.
70
+ */
71
+ manyItems?: boolean;
72
+ /**
73
+ * Never use this prop. Akinon design system does not allow custom styles.
74
+ * @ignore
75
+ */
76
+ style?: DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE;
77
+ }
@@ -0,0 +1,77 @@
1
+ import type { IconName } from '@akinon/icons';
2
+ import { DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE } from '@akinon/ui-theme';
3
+ import { ReactNode } from 'react';
4
+
5
+ export type TStepDirectionAndPlacement = 'horizontal' | 'vertical';
6
+ export type TSize = 'default' | 'small';
7
+ export type TStepStatus = 'wait' | 'process' | 'finish' | 'error';
8
+ export type TStepType = 'default' | 'navigation' | 'inline';
9
+ export type TStepProgressDot = (
10
+ iconDot,
11
+ { index, status, title, description }
12
+ ) => ReactNode;
13
+
14
+ type TMergedHTMLAttributes = React.HTMLAttributes<HTMLElement> &
15
+ React.ButtonHTMLAttributes<HTMLButtonElement> &
16
+ React.AnchorHTMLAttributes<HTMLAnchorElement>;
17
+
18
+ export interface IStepProps extends TMergedHTMLAttributes {
19
+ /**
20
+ * The current step index.
21
+ * @default 0
22
+ */
23
+ current?: number;
24
+ /**
25
+ * The initial step index.
26
+ * @default 0
27
+ */
28
+ initial?: number;
29
+ /**
30
+ * Whether the steps are responsive.
31
+ * @default true
32
+ */
33
+ responsive?: boolean;
34
+ /**
35
+ * The status of the steps.
36
+ */
37
+ status?: TStepStatus;
38
+ onChange?: (current) => void;
39
+ /**
40
+ * The steps items.
41
+ */
42
+ items?: {
43
+ /**
44
+ * The description of the step.
45
+ */
46
+ description?: ReactNode;
47
+ /**
48
+ * Whether the step is disabled.
49
+ */
50
+ disabled?: boolean;
51
+ /**
52
+ * The status of the step.
53
+ */
54
+ status?: TStepStatus;
55
+ /**
56
+ * The subtitle of the step.
57
+ */
58
+ subTitle?: ReactNode;
59
+ /**
60
+ * The title of the step.
61
+ */
62
+ title: ReactNode;
63
+ /**
64
+ * The icon of the step.
65
+ */
66
+ icon?: IconName;
67
+ }[];
68
+ /**
69
+ * Convert to multiple views.
70
+ */
71
+ manyItems?: boolean;
72
+ /**
73
+ * Never use this prop. Akinon design system does not allow custom styles.
74
+ * @ignore
75
+ */
76
+ style?: DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE;
77
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/ui-steps",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/esm/index.js",
@@ -10,15 +10,15 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "antd": "5.17.0",
13
- "@akinon/icons": "0.5.0",
14
- "@akinon/ui-theme": "0.6.0"
13
+ "@akinon/icons": "0.6.0",
14
+ "@akinon/ui-theme": "0.7.0"
15
15
  },
16
16
  "devDependencies": {
17
17
  "clean-package": "2.2.0",
18
18
  "copyfiles": "^2.4.1",
19
19
  "rimraf": "^5.0.5",
20
20
  "typescript": "^5.2.2",
21
- "@akinon/typescript-config": "0.3.0"
21
+ "@akinon/typescript-config": "0.4.0"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">=18",
@@ -38,7 +38,7 @@
38
38
  "build": "pnpm run build:esm && pnpm run build:commonjs && pnpm run copy:files",
39
39
  "build:esm": "tsc --outDir dist/esm",
40
40
  "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",
41
+ "copy:files": "copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/esm && copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/cjs",
42
42
  "clean": "rimraf dist/",
43
43
  "typecheck": "tsc --noEmit"
44
44
  }