@fluentui/react-image 9.0.0-rc.6 → 9.0.0-rc.9
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.
- package/CHANGELOG.json +111 -4
- package/CHANGELOG.md +159 -123
- package/dist/{react-image.d.ts → index.d.ts} +20 -13
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/components/Image/Image.types.js.map +1 -1
- package/lib/components/Image/useImage.js +4 -4
- package/lib/components/Image/useImage.js.map +1 -1
- package/lib-commonjs/components/Image/useImage.js +4 -4
- package/lib-commonjs/components/Image/useImage.js.map +1 -1
- package/package.json +8 -8
- package/lib/Image.d.ts +0 -1
- package/lib/components/Image/Image.d.ts +0 -6
- package/lib/components/Image/Image.types.d.ts +0 -30
- package/lib/components/Image/index.d.ts +0 -5
- package/lib/components/Image/renderImage.d.ts +0 -6
- package/lib/components/Image/useImage.d.ts +0 -6
- package/lib/components/Image/useImageStyles.d.ts +0 -8
- package/lib/index.d.ts +0 -2
- package/lib-commonjs/Image.d.ts +0 -1
- package/lib-commonjs/components/Image/Image.d.ts +0 -6
- package/lib-commonjs/components/Image/Image.types.d.ts +0 -30
- package/lib-commonjs/components/Image/index.d.ts +0 -5
- package/lib-commonjs/components/Image/renderImage.d.ts +0 -6
- package/lib-commonjs/components/Image/useImage.d.ts +0 -6
- package/lib-commonjs/components/Image/useImageStyles.d.ts +0 -8
- package/lib-commonjs/index.d.ts +0 -2
|
@@ -18,37 +18,44 @@ export declare const imageClassName = "fui-Image";
|
|
|
18
18
|
|
|
19
19
|
export declare const imageClassNames: SlotClassNames<ImageSlots>;
|
|
20
20
|
|
|
21
|
-
declare type
|
|
21
|
+
export declare type ImageProps = ComponentProps<ImageSlots> & {
|
|
22
22
|
/**
|
|
23
|
-
* An image can
|
|
23
|
+
* An image can take up the width of its container.
|
|
24
|
+
*
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
block?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* An image can appear with a rectangular border.
|
|
30
|
+
*
|
|
31
|
+
* @default false
|
|
24
32
|
*/
|
|
25
33
|
bordered?: boolean;
|
|
26
34
|
/**
|
|
27
35
|
* An image can set how it should be resized to fit its container.
|
|
36
|
+
*
|
|
37
|
+
* @default 'default'
|
|
28
38
|
*/
|
|
29
|
-
fit?: 'none' | 'center' | 'contain' | 'cover';
|
|
39
|
+
fit?: 'none' | 'center' | 'contain' | 'cover' | 'default';
|
|
30
40
|
/**
|
|
31
|
-
* An image can
|
|
41
|
+
* An image can appear elevated with shadow.
|
|
42
|
+
*
|
|
43
|
+
* @default false
|
|
32
44
|
*/
|
|
33
|
-
|
|
45
|
+
shadow?: boolean;
|
|
34
46
|
/**
|
|
35
47
|
* An image can appear square, circular, or rounded.
|
|
36
|
-
*
|
|
48
|
+
*
|
|
49
|
+
* @default 'square'
|
|
37
50
|
*/
|
|
38
51
|
shape?: 'square' | 'circular' | 'rounded';
|
|
39
|
-
/**
|
|
40
|
-
* An image can appear elevated with shadow.
|
|
41
|
-
*/
|
|
42
|
-
shadow?: boolean;
|
|
43
52
|
};
|
|
44
53
|
|
|
45
|
-
export declare type ImageProps = ComponentProps<ImageSlots> & Partial<ImageCommons>;
|
|
46
|
-
|
|
47
54
|
export declare type ImageSlots = {
|
|
48
55
|
root: Slot<'img'>;
|
|
49
56
|
};
|
|
50
57
|
|
|
51
|
-
export declare type ImageState = ComponentState<ImageSlots> &
|
|
58
|
+
export declare type ImageState = ComponentState<ImageSlots> & Required<Pick<ImageProps, 'block' | 'bordered' | 'fit' | 'shadow' | 'shape'>>;
|
|
52
59
|
|
|
53
60
|
/**
|
|
54
61
|
* Define the render function.
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.types.js","sourceRoot":"../src/","sources":["components/Image/Image.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentState, ComponentProps, Slot } from '@fluentui/react-utilities';\n\nexport type ImageSlots = {\n root: Slot<'img'>;\n};\n\
|
|
1
|
+
{"version":3,"file":"Image.types.js","sourceRoot":"../src/","sources":["components/Image/Image.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentState, ComponentProps, Slot } from '@fluentui/react-utilities';\n\nexport type ImageSlots = {\n root: Slot<'img'>;\n};\n\nexport type ImageProps = ComponentProps<ImageSlots> & {\n /**\n * An image can take up the width of its container.\n *\n * @default false\n */\n block?: boolean;\n\n /**\n * An image can appear with a rectangular border.\n *\n * @default false\n */\n bordered?: boolean;\n\n /**\n * An image can set how it should be resized to fit its container.\n *\n * @default 'default'\n */\n fit?: 'none' | 'center' | 'contain' | 'cover' | 'default';\n\n /**\n * An image can appear elevated with shadow.\n *\n * @default false\n */\n shadow?: boolean;\n\n /**\n * An image can appear square, circular, or rounded.\n *\n * @default 'square'\n */\n shape?: 'square' | 'circular' | 'rounded';\n};\n\nexport type ImageState = ComponentState<ImageSlots> &\n Required<Pick<ImageProps, 'block' | 'bordered' | 'fit' | 'shadow' | 'shape'>>;\n"]}
|
|
@@ -5,11 +5,11 @@ import { getNativeElementProps } from '@fluentui/react-utilities';
|
|
|
5
5
|
|
|
6
6
|
export const useImage_unstable = (props, ref) => {
|
|
7
7
|
const {
|
|
8
|
-
bordered,
|
|
9
|
-
fit,
|
|
10
|
-
block,
|
|
8
|
+
bordered = false,
|
|
9
|
+
fit = 'default',
|
|
10
|
+
block = false,
|
|
11
11
|
shape = 'square',
|
|
12
|
-
shadow
|
|
12
|
+
shadow = false
|
|
13
13
|
} = props;
|
|
14
14
|
const state = {
|
|
15
15
|
bordered,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Image/useImage.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAGA;;AAEG;;AACH,OAAO,MAAM,iBAAiB,GAAG,CAAC,KAAD,EAAoB,GAApB,KAAoE;AACnG,QAAM;AAAE,IAAA,
|
|
1
|
+
{"version":3,"sources":["components/Image/useImage.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAGA;;AAEG;;AACH,OAAO,MAAM,iBAAiB,GAAG,CAAC,KAAD,EAAoB,GAApB,KAAoE;AACnG,QAAM;AAAE,IAAA,QAAQ,GAAG,KAAb;AAAoB,IAAA,GAAG,GAAG,SAA1B;AAAqC,IAAA,KAAK,GAAG,KAA7C;AAAoD,IAAA,KAAK,GAAG,QAA5D;AAAsE,IAAA,MAAM,GAAG;AAA/E,MAAyF,KAA/F;AAEA,QAAM,KAAK,GAAe;AACxB,IAAA,QADwB;AAExB,IAAA,GAFwB;AAGxB,IAAA,KAHwB;AAIxB,IAAA,KAJwB;AAKxB,IAAA,MALwB;AAMxB,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE;AADI,KANY;AASxB,IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAQ;AACjC,MAAA,GADiC;AAEjC,SAAG;AAF8B,KAAR;AATH,GAA1B;AAeA,SAAO,KAAP;AACD,CAnBM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { ImageProps, ImageState } from './Image.types';\n\n/**\n * Given user props, returns state and render function for an Image.\n */\nexport const useImage_unstable = (props: ImageProps, ref: React.Ref<HTMLImageElement>): ImageState => {\n const { bordered = false, fit = 'default', block = false, shape = 'square', shadow = false } = props;\n\n const state: ImageState = {\n bordered,\n fit,\n block,\n shape,\n shadow,\n components: {\n root: 'img',\n },\n root: getNativeElementProps('img', {\n ref,\n ...props,\n }),\n };\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -13,11 +13,11 @@ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
|
13
13
|
|
|
14
14
|
const useImage_unstable = (props, ref) => {
|
|
15
15
|
const {
|
|
16
|
-
bordered,
|
|
17
|
-
fit,
|
|
18
|
-
block,
|
|
16
|
+
bordered = false,
|
|
17
|
+
fit = 'default',
|
|
18
|
+
block = false,
|
|
19
19
|
shape = 'square',
|
|
20
|
-
shadow
|
|
20
|
+
shadow = false
|
|
21
21
|
} = props;
|
|
22
22
|
const state = {
|
|
23
23
|
bordered,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["components/Image/useImage.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,iBAAiB,GAAG,CAAC,KAAD,EAAoB,GAApB,KAAoE;AACnG,QAAM;AAAE,IAAA,
|
|
1
|
+
{"version":3,"sources":["components/Image/useImage.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,iBAAiB,GAAG,CAAC,KAAD,EAAoB,GAApB,KAAoE;AACnG,QAAM;AAAE,IAAA,QAAQ,GAAG,KAAb;AAAoB,IAAA,GAAG,GAAG,SAA1B;AAAqC,IAAA,KAAK,GAAG,KAA7C;AAAoD,IAAA,KAAK,GAAG,QAA5D;AAAsE,IAAA,MAAM,GAAG;AAA/E,MAAyF,KAA/F;AAEA,QAAM,KAAK,GAAe;AACxB,IAAA,QADwB;AAExB,IAAA,GAFwB;AAGxB,IAAA,KAHwB;AAIxB,IAAA,KAJwB;AAKxB,IAAA,MALwB;AAMxB,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE;AADI,KANY;AASxB,IAAA,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;AACjC,MAAA,GADiC;AAEjC,SAAG;AAF8B,KAA7B;AATkB,GAA1B;AAeA,SAAO,KAAP;AACD,CAnBM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { ImageProps, ImageState } from './Image.types';\n\n/**\n * Given user props, returns state and render function for an Image.\n */\nexport const useImage_unstable = (props: ImageProps, ref: React.Ref<HTMLImageElement>): ImageState => {\n const { bordered = false, fit = 'default', block = false, shape = 'square', shadow = false } = props;\n\n const state: ImageState = {\n bordered,\n fit,\n block,\n shape,\n shadow,\n components: {\n root: 'img',\n },\n root: getNativeElementProps('img', {\n ref,\n ...props,\n }),\n };\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-image",
|
|
3
|
-
"version": "9.0.0-rc.
|
|
3
|
+
"version": "9.0.0-rc.9",
|
|
4
4
|
"description": "Fluent UI React Image component.",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
7
|
-
"typings": "
|
|
7
|
+
"typings": "dist/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -21,20 +21,20 @@
|
|
|
21
21
|
"start": "yarn storybook",
|
|
22
22
|
"test": "jest --passWithNoTests",
|
|
23
23
|
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
|
24
|
-
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node
|
|
25
|
-
"storybook": "node
|
|
24
|
+
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/packages/react-components/react-image/src && yarn docs",
|
|
25
|
+
"storybook": "node ../../../scripts/storybook/runner",
|
|
26
26
|
"type-check": "tsc -b tsconfig.json"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
|
30
30
|
"@fluentui/react-conformance": "*",
|
|
31
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
|
31
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.6",
|
|
32
32
|
"@fluentui/scripts": "^1.0.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@griffel/react": "1.0.
|
|
36
|
-
"@fluentui/react-utilities": "9.0.0-rc.
|
|
37
|
-
"@fluentui/react-theme": "9.0.0-rc.
|
|
35
|
+
"@griffel/react": "1.0.5",
|
|
36
|
+
"@fluentui/react-utilities": "9.0.0-rc.9",
|
|
37
|
+
"@fluentui/react-theme": "9.0.0-rc.8",
|
|
38
38
|
"tslib": "^2.1.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
package/lib/Image.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Image/index';
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ComponentState, ComponentProps, Slot } from '@fluentui/react-utilities';
|
|
2
|
-
export declare type ImageSlots = {
|
|
3
|
-
root: Slot<'img'>;
|
|
4
|
-
};
|
|
5
|
-
declare type ImageCommons = {
|
|
6
|
-
/**
|
|
7
|
-
* An image can appear with rectangular border.
|
|
8
|
-
*/
|
|
9
|
-
bordered?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* An image can set how it should be resized to fit its container.
|
|
12
|
-
*/
|
|
13
|
-
fit?: 'none' | 'center' | 'contain' | 'cover';
|
|
14
|
-
/**
|
|
15
|
-
* An image can take up the width of its container.
|
|
16
|
-
*/
|
|
17
|
-
block?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* An image can appear square, circular, or rounded.
|
|
20
|
-
* @defaultvalue square
|
|
21
|
-
*/
|
|
22
|
-
shape?: 'square' | 'circular' | 'rounded';
|
|
23
|
-
/**
|
|
24
|
-
* An image can appear elevated with shadow.
|
|
25
|
-
*/
|
|
26
|
-
shadow?: boolean;
|
|
27
|
-
};
|
|
28
|
-
export declare type ImageProps = ComponentProps<ImageSlots> & Partial<ImageCommons>;
|
|
29
|
-
export declare type ImageState = ComponentState<ImageSlots> & ImageCommons;
|
|
30
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { ImageProps, ImageState } from './Image.types';
|
|
3
|
-
/**
|
|
4
|
-
* Given user props, returns state and render function for an Image.
|
|
5
|
-
*/
|
|
6
|
-
export declare const useImage_unstable: (props: ImageProps, ref: React.Ref<HTMLImageElement>) => ImageState;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ImageSlots, ImageState } from './Image.types';
|
|
2
|
-
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Use `imageClassNames.root` instead.
|
|
5
|
-
*/
|
|
6
|
-
export declare const imageClassName = "fui-Image";
|
|
7
|
-
export declare const imageClassNames: SlotClassNames<ImageSlots>;
|
|
8
|
-
export declare const useImageStyles_unstable: (state: ImageState) => void;
|
package/lib/index.d.ts
DELETED
package/lib-commonjs/Image.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Image/index';
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ComponentState, ComponentProps, Slot } from '@fluentui/react-utilities';
|
|
2
|
-
export declare type ImageSlots = {
|
|
3
|
-
root: Slot<'img'>;
|
|
4
|
-
};
|
|
5
|
-
declare type ImageCommons = {
|
|
6
|
-
/**
|
|
7
|
-
* An image can appear with rectangular border.
|
|
8
|
-
*/
|
|
9
|
-
bordered?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* An image can set how it should be resized to fit its container.
|
|
12
|
-
*/
|
|
13
|
-
fit?: 'none' | 'center' | 'contain' | 'cover';
|
|
14
|
-
/**
|
|
15
|
-
* An image can take up the width of its container.
|
|
16
|
-
*/
|
|
17
|
-
block?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* An image can appear square, circular, or rounded.
|
|
20
|
-
* @defaultvalue square
|
|
21
|
-
*/
|
|
22
|
-
shape?: 'square' | 'circular' | 'rounded';
|
|
23
|
-
/**
|
|
24
|
-
* An image can appear elevated with shadow.
|
|
25
|
-
*/
|
|
26
|
-
shadow?: boolean;
|
|
27
|
-
};
|
|
28
|
-
export declare type ImageProps = ComponentProps<ImageSlots> & Partial<ImageCommons>;
|
|
29
|
-
export declare type ImageState = ComponentState<ImageSlots> & ImageCommons;
|
|
30
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { ImageProps, ImageState } from './Image.types';
|
|
3
|
-
/**
|
|
4
|
-
* Given user props, returns state and render function for an Image.
|
|
5
|
-
*/
|
|
6
|
-
export declare const useImage_unstable: (props: ImageProps, ref: React.Ref<HTMLImageElement>) => ImageState;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ImageSlots, ImageState } from './Image.types';
|
|
2
|
-
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Use `imageClassNames.root` instead.
|
|
5
|
-
*/
|
|
6
|
-
export declare const imageClassName = "fui-Image";
|
|
7
|
-
export declare const imageClassNames: SlotClassNames<ImageSlots>;
|
|
8
|
-
export declare const useImageStyles_unstable: (state: ImageState) => void;
|
package/lib-commonjs/index.d.ts
DELETED