@akinon/ui-image 0.5.0 → 1.0.1

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,6 @@
1
- import type { ImageProps as AntImageProps } from 'antd';
2
1
  import * as React from 'react';
3
- export type ImageProps = Omit<AntImageProps, 'wrapperClassName' | 'wrapperStyle' | 'prefixCls' | 'previewPrefixCls' | 'rootClassName' | 'onPreviewClose'>;
2
+ import type { IImageProps } from './types';
3
+ export type * from './types';
4
4
  /**
5
5
  * Image component for Akinon UI.
6
6
  *
@@ -8,5 +8,9 @@ export type ImageProps = Omit<AntImageProps, 'wrapperClassName' | 'wrapperStyle'
8
8
  * It supports previewing the image in a modal.
9
9
  *
10
10
  */
11
- export declare const Image: ({ ...restImageProps }: ImageProps) => React.JSX.Element;
11
+ export declare const Image: {
12
+ ({ ...restImageProps }: IImageProps): React.JSX.Element;
13
+ PreviewGroup: React.FC<import("rc-image/lib/PreviewGroup").GroupConsumerProps>;
14
+ };
15
+ export type * from './types';
12
16
  //# 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,UAAU,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAExD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,UAAU,GAAG,IAAI,CAC3B,aAAa,EACX,kBAAkB,GAClB,cAAc,GACd,WAAW,GACX,kBAAkB,GAClB,eAAe,GACf,gBAAgB,CACnB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,0BAA2B,UAAU,sBAEtD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,mBAAmB,SAAS,CAAC;AAE7B;;;;;;GAMG;AAEH,eAAO,MAAM,KAAK;4BAA2B,WAAW;;CAEvD,CAAC;AAIF,mBAAmB,SAAS,CAAC"}
package/dist/cjs/index.js CHANGED
@@ -26,3 +26,4 @@ const Image = (_a) => {
26
26
  return React.createElement(antd_1.Image, Object.assign({}, restImageProps));
27
27
  };
28
28
  exports.Image = Image;
29
+ exports.Image.PreviewGroup = antd_1.Image.PreviewGroup;
@@ -0,0 +1,49 @@
1
+ export interface IImageProps {
2
+ /**
3
+ * The alt attribute of the image
4
+ */
5
+ alt?: string;
6
+
7
+ /**
8
+ * Load failure fault-tolerant src
9
+ */
10
+ fallback?: string;
11
+
12
+ /**
13
+ * The height of the image
14
+ */
15
+ height?: string | number;
16
+
17
+ /**
18
+ * Load placeholder, use default placeholder when set true
19
+ */
20
+ placeholder?: React.ReactNode;
21
+
22
+ /**
23
+ * Whether to show the preview
24
+ * preview config, disabled when false
25
+ * @default true
26
+ */
27
+ preview?: boolean;
28
+
29
+ /**
30
+ * The src attribute of the image, Image path
31
+ */
32
+ src: string;
33
+
34
+ /**
35
+ * The width of the image
36
+ */
37
+ width?: string | number;
38
+
39
+ /**
40
+ * Load failed callback
41
+ */
42
+ onError?: (event: Event) => void;
43
+
44
+ /**
45
+ * Never use this prop. Akinon design system does not allow custom styles.
46
+ * @ignore
47
+ */
48
+ style?: DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE;
49
+ }
@@ -1,6 +1,6 @@
1
- import type { ImageProps as AntImageProps } from 'antd';
2
1
  import * as React from 'react';
3
- export type ImageProps = Omit<AntImageProps, 'wrapperClassName' | 'wrapperStyle' | 'prefixCls' | 'previewPrefixCls' | 'rootClassName' | 'onPreviewClose'>;
2
+ import type { IImageProps } from './types';
3
+ export type * from './types';
4
4
  /**
5
5
  * Image component for Akinon UI.
6
6
  *
@@ -8,5 +8,9 @@ export type ImageProps = Omit<AntImageProps, 'wrapperClassName' | 'wrapperStyle'
8
8
  * It supports previewing the image in a modal.
9
9
  *
10
10
  */
11
- export declare const Image: ({ ...restImageProps }: ImageProps) => React.JSX.Element;
11
+ export declare const Image: {
12
+ ({ ...restImageProps }: IImageProps): React.JSX.Element;
13
+ PreviewGroup: React.FC<import("rc-image/lib/PreviewGroup").GroupConsumerProps>;
14
+ };
15
+ export type * from './types';
12
16
  //# 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,UAAU,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAExD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,UAAU,GAAG,IAAI,CAC3B,aAAa,EACX,kBAAkB,GAClB,cAAc,GACd,WAAW,GACX,kBAAkB,GAClB,eAAe,GACf,gBAAgB,CACnB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,0BAA2B,UAAU,sBAEtD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,mBAAmB,SAAS,CAAC;AAE7B;;;;;;GAMG;AAEH,eAAO,MAAM,KAAK;4BAA2B,WAAW;;CAEvD,CAAC;AAIF,mBAAmB,SAAS,CAAC"}
package/dist/esm/index.js CHANGED
@@ -22,3 +22,4 @@ export const Image = (_a) => {
22
22
  var restImageProps = __rest(_a, []);
23
23
  return React.createElement(AntImage, Object.assign({}, restImageProps));
24
24
  };
25
+ Image.PreviewGroup = AntImage.PreviewGroup;
@@ -0,0 +1,49 @@
1
+ export interface IImageProps {
2
+ /**
3
+ * The alt attribute of the image
4
+ */
5
+ alt?: string;
6
+
7
+ /**
8
+ * Load failure fault-tolerant src
9
+ */
10
+ fallback?: string;
11
+
12
+ /**
13
+ * The height of the image
14
+ */
15
+ height?: string | number;
16
+
17
+ /**
18
+ * Load placeholder, use default placeholder when set true
19
+ */
20
+ placeholder?: React.ReactNode;
21
+
22
+ /**
23
+ * Whether to show the preview
24
+ * preview config, disabled when false
25
+ * @default true
26
+ */
27
+ preview?: boolean;
28
+
29
+ /**
30
+ * The src attribute of the image, Image path
31
+ */
32
+ src: string;
33
+
34
+ /**
35
+ * The width of the image
36
+ */
37
+ width?: string | number;
38
+
39
+ /**
40
+ * Load failed callback
41
+ */
42
+ onError?: (event: Event) => void;
43
+
44
+ /**
45
+ * Never use this prop. Akinon design system does not allow custom styles.
46
+ * @ignore
47
+ */
48
+ style?: DO_NOT_USE_OR_YOU_WILL_BE_FIRED_INTERNAL_STYLE;
49
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/ui-image",
3
- "version": "0.5.0",
3
+ "version": "1.0.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/esm/index.js",
@@ -9,14 +9,14 @@
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.4.0"
18
+ "typescript": "*",
19
+ "@akinon/typescript-config": "1.0.1"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "react": ">=18",