@akinon/ui-breadcrumb 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,94 @@
1
+ export type BreadcrumbProps = Omit<
2
+ AntBreadcrumbProps,
3
+ 'prefixCls' | 'style' | 'styles' | 'separator'
4
+ > & {
5
+ /**
6
+ * This is a custom event that is triggered when any breadcrumb item is clicked. It takes href of the clicked item as parameter.
7
+ */
8
+ onAnyItemClick?: ({ href }: { href: string }) => void;
9
+ };
10
+
11
+ type PropertyKey = string | number | symbol;
12
+
13
+ export interface SeparatorType {
14
+ separator?: React.ReactNode;
15
+ key?: React.Key;
16
+ }
17
+
18
+ interface MenuItem {
19
+ key?: React.Key;
20
+ title?: React.ReactNode;
21
+ label?: React.ReactNode;
22
+ path?: string;
23
+ href?: string;
24
+ }
25
+
26
+ export interface BreadcrumbItemProps extends SeparatorType {
27
+ prefixCls?: string;
28
+ href?: string;
29
+ onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLSpanElement>;
30
+ className?: string;
31
+ children?: React.ReactNode;
32
+ }
33
+
34
+ export interface BreadcrumbItemType {
35
+ key?: React.Key;
36
+ /**
37
+ * Different with `path`. Directly set the link of this item.
38
+ */
39
+ href?: string;
40
+ /**
41
+ * Different with `href`. It will concat all prev `path` to the current one.
42
+ */
43
+ path?: string;
44
+ title?: React.ReactNode;
45
+ breadcrumbName?: string;
46
+ className?: string;
47
+ onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLSpanElement>;
48
+ }
49
+
50
+ export interface BreadcrumbSeparatorType {
51
+ type: 'separator';
52
+ separator?: React.ReactNode;
53
+ }
54
+
55
+ export type ItemType = Partial<BreadcrumbItemType & BreadcrumbSeparatorType>;
56
+
57
+ export type InternalRouteType = Partial<
58
+ BreadcrumbItemType & BreadcrumbSeparatorType
59
+ >;
60
+
61
+ export interface AntBreadcrumbProps<
62
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
63
+ T extends Record<PropertyKey, any> = Record<PropertyKey, any>
64
+ > {
65
+ prefixCls?: string;
66
+ /**
67
+ * Routing parameters. <code>object</code><br /><br />
68
+ */
69
+ params?: T;
70
+ separator?: React.ReactNode;
71
+ style?: React.CSSProperties;
72
+ /**
73
+ * The additional css class
74
+ */
75
+ className?: string;
76
+ /**
77
+ * ClassName on the root element
78
+ */
79
+ rootClassName?: string;
80
+ children?: React.ReactNode;
81
+ /**
82
+ * The routing stack information of router
83
+ */
84
+ items?: ItemType[];
85
+ /**
86
+ * Custom item renderer. <code>(route, params, routes, paths) => ReactNode</code><br /><br />
87
+ */
88
+ itemRender?: (
89
+ route: ItemType,
90
+ params: T,
91
+ routes: ItemType[],
92
+ paths: string[]
93
+ ) => React.ReactNode;
94
+ }
@@ -0,0 +1,94 @@
1
+ export type BreadcrumbProps = Omit<
2
+ AntBreadcrumbProps,
3
+ 'prefixCls' | 'style' | 'styles' | 'separator'
4
+ > & {
5
+ /**
6
+ * This is a custom event that is triggered when any breadcrumb item is clicked. It takes href of the clicked item as parameter.
7
+ */
8
+ onAnyItemClick?: ({ href }: { href: string }) => void;
9
+ };
10
+
11
+ type PropertyKey = string | number | symbol;
12
+
13
+ export interface SeparatorType {
14
+ separator?: React.ReactNode;
15
+ key?: React.Key;
16
+ }
17
+
18
+ interface MenuItem {
19
+ key?: React.Key;
20
+ title?: React.ReactNode;
21
+ label?: React.ReactNode;
22
+ path?: string;
23
+ href?: string;
24
+ }
25
+
26
+ export interface BreadcrumbItemProps extends SeparatorType {
27
+ prefixCls?: string;
28
+ href?: string;
29
+ onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLSpanElement>;
30
+ className?: string;
31
+ children?: React.ReactNode;
32
+ }
33
+
34
+ export interface BreadcrumbItemType {
35
+ key?: React.Key;
36
+ /**
37
+ * Different with `path`. Directly set the link of this item.
38
+ */
39
+ href?: string;
40
+ /**
41
+ * Different with `href`. It will concat all prev `path` to the current one.
42
+ */
43
+ path?: string;
44
+ title?: React.ReactNode;
45
+ breadcrumbName?: string;
46
+ className?: string;
47
+ onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLSpanElement>;
48
+ }
49
+
50
+ export interface BreadcrumbSeparatorType {
51
+ type: 'separator';
52
+ separator?: React.ReactNode;
53
+ }
54
+
55
+ export type ItemType = Partial<BreadcrumbItemType & BreadcrumbSeparatorType>;
56
+
57
+ export type InternalRouteType = Partial<
58
+ BreadcrumbItemType & BreadcrumbSeparatorType
59
+ >;
60
+
61
+ export interface AntBreadcrumbProps<
62
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
63
+ T extends Record<PropertyKey, any> = Record<PropertyKey, any>
64
+ > {
65
+ prefixCls?: string;
66
+ /**
67
+ * Routing parameters. <code>object</code><br /><br />
68
+ */
69
+ params?: T;
70
+ separator?: React.ReactNode;
71
+ style?: React.CSSProperties;
72
+ /**
73
+ * The additional css class
74
+ */
75
+ className?: string;
76
+ /**
77
+ * ClassName on the root element
78
+ */
79
+ rootClassName?: string;
80
+ children?: React.ReactNode;
81
+ /**
82
+ * The routing stack information of router
83
+ */
84
+ items?: ItemType[];
85
+ /**
86
+ * Custom item renderer. <code>(route, params, routes, paths) => ReactNode</code><br /><br />
87
+ */
88
+ itemRender?: (
89
+ route: ItemType,
90
+ params: T,
91
+ routes: ItemType[],
92
+ paths: string[]
93
+ ) => React.ReactNode;
94
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/ui-breadcrumb",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "private": false,
5
5
  "description": "A basic button react component.",
6
6
  "type": "module",
@@ -11,14 +11,14 @@
11
11
  ],
12
12
  "dependencies": {
13
13
  "antd": "5.17.0",
14
- "@akinon/ui-theme": "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
  }