@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.
@@ -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 ImageCommons = {
21
+ export declare type ImageProps = ComponentProps<ImageSlots> & {
22
22
  /**
23
- * An image can appear with rectangular border.
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 take up the width of its container.
41
+ * An image can appear elevated with shadow.
42
+ *
43
+ * @default false
32
44
  */
33
- block?: boolean;
45
+ shadow?: boolean;
34
46
  /**
35
47
  * An image can appear square, circular, or rounded.
36
- * @defaultvalue square
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> & ImageCommons;
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\ntype ImageCommons = {\n /**\n * An image can appear with rectangular border.\n */\n bordered?: boolean;\n\n /**\n * An image can set how it should be resized to fit its container.\n */\n fit?: 'none' | 'center' | 'contain' | 'cover';\n\n /**\n * An image can take up the width of its container.\n */\n block?: boolean;\n\n /**\n * An image can appear square, circular, or rounded.\n * @defaultvalue square\n */\n shape?: 'square' | 'circular' | 'rounded';\n\n /**\n * An image can appear elevated with shadow.\n */\n shadow?: boolean;\n};\n\nexport type ImageProps = ComponentProps<ImageSlots> & Partial<ImageCommons>;\n\nexport type ImageState = ComponentState<ImageSlots> & ImageCommons;\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,QAAF;AAAY,IAAA,GAAZ;AAAiB,IAAA,KAAjB;AAAwB,IAAA,KAAK,GAAG,QAAhC;AAA0C,IAAA;AAA1C,MAAqD,KAA3D;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, fit, block, shape = 'square', shadow } = 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/"}
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,QAAF;AAAY,IAAA,GAAZ;AAAiB,IAAA,KAAjB;AAAwB,IAAA,KAAK,GAAG,QAAhC;AAA0C,IAAA;AAA1C,MAAqD,KAA3D;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, fit, block, shape = 'square', shadow } = 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/"}
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.6",
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": "lib/index.d.ts",
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 ../../scripts/typescript/normalize-import --output ./dist/packages/react-image/src && yarn docs",
25
- "storybook": "node ../../scripts/storybook/runner",
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.4",
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.3",
36
- "@fluentui/react-utilities": "9.0.0-rc.6",
37
- "@fluentui/react-theme": "9.0.0-rc.5",
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,6 +0,0 @@
1
- import type { ImageProps } from './Image.types';
2
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
- /**
4
- * The Image component ensures the consistent styling of images.
5
- */
6
- export declare const Image: ForwardRefComponent<ImageProps>;
@@ -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,5 +0,0 @@
1
- export * from './Image.types';
2
- export * from './Image';
3
- export * from './renderImage';
4
- export * from './useImage';
5
- export * from './useImageStyles';
@@ -1,6 +0,0 @@
1
- import { ImageState } from './Image.types';
2
- /**
3
- * Define the render function.
4
- * Given the state of an image, renders it.
5
- */
6
- export declare const renderImage_unstable: (state: ImageState) => JSX.Element;
@@ -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
@@ -1,2 +0,0 @@
1
- export { Image, imageClassName, imageClassNames, renderImage_unstable, useImageStyles_unstable, useImage_unstable, } from './Image';
2
- export type { ImageProps, ImageSlots, ImageState } from './Image';
@@ -1 +0,0 @@
1
- export * from './components/Image/index';
@@ -1,6 +0,0 @@
1
- import type { ImageProps } from './Image.types';
2
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
- /**
4
- * The Image component ensures the consistent styling of images.
5
- */
6
- export declare const Image: ForwardRefComponent<ImageProps>;
@@ -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,5 +0,0 @@
1
- export * from './Image.types';
2
- export * from './Image';
3
- export * from './renderImage';
4
- export * from './useImage';
5
- export * from './useImageStyles';
@@ -1,6 +0,0 @@
1
- import { ImageState } from './Image.types';
2
- /**
3
- * Define the render function.
4
- * Given the state of an image, renders it.
5
- */
6
- export declare const renderImage_unstable: (state: ImageState) => JSX.Element;
@@ -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;
@@ -1,2 +0,0 @@
1
- export { Image, imageClassName, imageClassNames, renderImage_unstable, useImageStyles_unstable, useImage_unstable, } from './Image';
2
- export type { ImageProps, ImageSlots, ImageState } from './Image';