@fluentui/react-image 9.3.15 → 9.4.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.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,21 @@
1
1
  # Change Log - @fluentui/react-image
2
2
 
3
- This log was last generated on Wed, 25 Feb 2026 13:28:23 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 26 Mar 2026 08:10:40 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.4.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-image_v9.4.0)
8
+
9
+ Thu, 26 Mar 2026 08:10:40 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-image_v9.3.15..@fluentui/react-image_v9.4.0)
11
+
12
+ ### Minor changes
13
+
14
+ - feat: add base hooks for Image ([PR #35808](https://github.com/microsoft/fluentui/pull/35808) by dmytrokirpa@microsoft.com)
15
+
7
16
  ## [9.3.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-image_v9.3.15)
8
17
 
9
- Wed, 25 Feb 2026 13:28:23 GMT
18
+ Wed, 25 Feb 2026 13:32:28 GMT
10
19
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-image_v9.3.14..@fluentui/react-image_v9.3.15)
11
20
 
12
21
  ### Patches
package/dist/index.d.ts CHANGED
@@ -12,6 +12,17 @@ import type { SlotClassNames } from '@fluentui/react-utilities';
12
12
  declare const Image_2: ForwardRefComponent<ImageProps>;
13
13
  export { Image_2 as Image }
14
14
 
15
+ /**
16
+ * Image props without design-specific props (shape, shadow, bordered, fit).
17
+ * Use this when building a base image that is unstyled or uses a custom design system.
18
+ */
19
+ export declare type ImageBaseProps = ComponentProps<ImageSlots>;
20
+
21
+ /**
22
+ * Image state without design-specific state (shape, shadow, bordered, fit).
23
+ */
24
+ export declare type ImageBaseState = ComponentState<ImageSlots>;
25
+
15
26
  export declare const imageClassNames: SlotClassNames<ImageSlots>;
16
27
 
17
28
  export declare type ImageProps = ComponentProps<ImageSlots> & {
@@ -57,13 +68,22 @@ export declare type ImageState = ComponentState<ImageSlots> & Required<Pick<Imag
57
68
  * Define the render function.
58
69
  * Given the state of an image, renders it.
59
70
  */
60
- export declare const renderImage_unstable: (state: ImageState) => JSXElement;
71
+ export declare const renderImage_unstable: (state: ImageBaseState) => JSXElement;
61
72
 
62
73
  /**
63
74
  * Given user props, returns state and render function for an Image.
64
75
  */
65
76
  export declare const useImage_unstable: (props: ImageProps, ref: React_2.Ref<HTMLImageElement>) => ImageState;
66
77
 
78
+ /**
79
+ * Base hook for Image component, which manages state related to slot structure.
80
+ * This hook excludes design props (shape, shadow, bordered, fit).
81
+ *
82
+ * @param props - User provided props to the Image component.
83
+ * @param ref - User provided ref to be passed to the Image component.
84
+ */
85
+ export declare const useImageBase_unstable: (props: ImageBaseProps, ref: React_2.Ref<HTMLImageElement>) => ImageBaseState;
86
+
67
87
  export declare const useImageStyles_unstable: (state: ImageState) => ImageState;
68
88
 
69
89
  export { }
package/lib/Image.js CHANGED
@@ -1 +1 @@
1
- export { Image, imageClassNames, renderImage_unstable, useImageStyles_unstable, useImage_unstable } from './components/Image/index';
1
+ export { Image, imageClassNames, renderImage_unstable, useImageStyles_unstable, useImage_unstable, useImageBase_unstable } from './components/Image/index';
package/lib/Image.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Image.ts"],"sourcesContent":["export type { ImageProps, ImageSlots, ImageState } from './components/Image/index';\nexport {\n Image,\n imageClassNames,\n renderImage_unstable,\n useImageStyles_unstable,\n useImage_unstable,\n} from './components/Image/index';\n"],"names":["Image","imageClassNames","renderImage_unstable","useImageStyles_unstable","useImage_unstable"],"mappings":"AACA,SACEA,KAAK,EACLC,eAAe,EACfC,oBAAoB,EACpBC,uBAAuB,EACvBC,iBAAiB,QACZ,2BAA2B"}
1
+ {"version":3,"sources":["../src/Image.ts"],"sourcesContent":["export type { ImageProps, ImageSlots, ImageState, ImageBaseProps, ImageBaseState } from './components/Image/index';\nexport {\n Image,\n imageClassNames,\n renderImage_unstable,\n useImageStyles_unstable,\n useImage_unstable,\n useImageBase_unstable,\n} from './components/Image/index';\n"],"names":["Image","imageClassNames","renderImage_unstable","useImageStyles_unstable","useImage_unstable","useImageBase_unstable"],"mappings":"AACA,SACEA,KAAK,EACLC,eAAe,EACfC,oBAAoB,EACpBC,uBAAuB,EACvBC,iBAAiB,EACjBC,qBAAqB,QAChB,2BAA2B"}
@@ -1 +1,3 @@
1
- export { };
1
+ /**
2
+ * Image state without design-specific state (shape, shadow, bordered, fit).
3
+ */ export { };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Image/Image.types.ts"],"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"],"names":[],"mappings":"AA2CA,WACgF"}
1
+ {"version":3,"sources":["../src/components/Image/Image.types.ts"],"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\n/**\n * Image props without design-specific props (shape, shadow, bordered, fit).\n * Use this when building a base image that is unstyled or uses a custom design system.\n */\nexport type ImageBaseProps = ComponentProps<ImageSlots>;\n\nexport type ImageState = ComponentState<ImageSlots> &\n Required<Pick<ImageProps, 'block' | 'bordered' | 'fit' | 'shadow' | 'shape'>>;\n\n/**\n * Image state without design-specific state (shape, shadow, bordered, fit).\n */\nexport type ImageBaseState = ComponentState<ImageSlots>;\n"],"names":[],"mappings":"AAoDA;;CAEC,GACD,WAAwD"}
@@ -1,4 +1,4 @@
1
1
  export { Image } from './Image';
2
2
  export { renderImage_unstable } from './renderImage';
3
- export { useImage_unstable } from './useImage';
3
+ export { useImage_unstable, useImageBase_unstable } from './useImage';
4
4
  export { imageClassNames, useImageStyles_unstable } from './useImageStyles.styles';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Image/index.ts"],"sourcesContent":["export type { ImageProps, ImageSlots, ImageState } from './Image.types';\nexport { Image } from './Image';\nexport { renderImage_unstable } from './renderImage';\nexport { useImage_unstable } from './useImage';\nexport { imageClassNames, useImageStyles_unstable } from './useImageStyles.styles';\n"],"names":["Image","renderImage_unstable","useImage_unstable","imageClassNames","useImageStyles_unstable"],"mappings":"AACA,SAASA,KAAK,QAAQ,UAAU;AAChC,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,eAAe,EAAEC,uBAAuB,QAAQ,0BAA0B"}
1
+ {"version":3,"sources":["../src/components/Image/index.ts"],"sourcesContent":["export type { ImageBaseProps, ImageBaseState, ImageProps, ImageSlots, ImageState } from './Image.types';\nexport { Image } from './Image';\nexport { renderImage_unstable } from './renderImage';\nexport { useImage_unstable, useImageBase_unstable } from './useImage';\nexport { imageClassNames, useImageStyles_unstable } from './useImageStyles.styles';\n"],"names":["Image","renderImage_unstable","useImage_unstable","useImageBase_unstable","imageClassNames","useImageStyles_unstable"],"mappings":"AACA,SAASA,KAAK,QAAQ,UAAU;AAChC,SAASC,oBAAoB,QAAQ,gBAAgB;AACrD,SAASC,iBAAiB,EAAEC,qBAAqB,QAAQ,aAAa;AACtE,SAASC,eAAe,EAAEC,uBAAuB,QAAQ,0BAA0B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Image/renderImage.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { ImageSlots, ImageState } from './Image.types';\n\n/**\n * Define the render function.\n * Given the state of an image, renders it.\n */\nexport const renderImage_unstable = (state: ImageState): JSXElement => {\n assertSlots<ImageSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderImage_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;;CAGC,GACD,OAAO,MAAMC,uBAAuB,CAACC;IACnCF,YAAwBE;IAExB,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
1
+ {"version":3,"sources":["../src/components/Image/renderImage.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { ImageSlots, ImageBaseState } from './Image.types';\n\n/**\n * Define the render function.\n * Given the state of an image, renders it.\n */\nexport const renderImage_unstable = (state: ImageBaseState): JSXElement => {\n assertSlots<ImageSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderImage_unstable","state","root"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;;CAGC,GACD,OAAO,MAAMC,uBAAuB,CAACC;IACnCF,YAAwBE;IAExB,qBAAO,KAACA,MAAMC,IAAI;AACpB,EAAE"}
@@ -1,15 +1,28 @@
1
+ 'use client';
1
2
  import * as React from 'react';
2
3
  import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
3
4
  /**
4
5
  * Given user props, returns state and render function for an Image.
5
6
  */ export const useImage_unstable = (props, ref)=>{
6
- const { bordered = false, fit = 'default', block = false, shape = 'square', shadow = false } = props;
7
- const state = {
7
+ const { bordered = false, block = false, fit = 'default', shadow = false, shape = 'square', ...imageProps } = props;
8
+ const state = useImageBase_unstable(imageProps, ref);
9
+ return {
8
10
  bordered,
9
- fit,
10
11
  block,
11
- shape,
12
+ fit,
12
13
  shadow,
14
+ shape,
15
+ ...state
16
+ };
17
+ };
18
+ /**
19
+ * Base hook for Image component, which manages state related to slot structure.
20
+ * This hook excludes design props (shape, shadow, bordered, fit).
21
+ *
22
+ * @param props - User provided props to the Image component.
23
+ * @param ref - User provided ref to be passed to the Image component.
24
+ */ export const useImageBase_unstable = (props, ref)=>{
25
+ return {
13
26
  components: {
14
27
  root: 'img'
15
28
  },
@@ -20,5 +33,4 @@ import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
20
33
  elementType: 'img'
21
34
  })
22
35
  };
23
- return state;
24
36
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Image/useImage.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } 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: slot.always(\n getIntrinsicElementProps('img', {\n ref,\n ...props,\n }),\n { elementType: 'img' },\n ),\n };\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","slot","useImage_unstable","props","ref","bordered","fit","block","shape","shadow","state","components","root","always","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAG3E;;CAEC,GACD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC;IACnD,MAAM,EAAEC,WAAW,KAAK,EAAEC,MAAM,SAAS,EAAEC,QAAQ,KAAK,EAAEC,QAAQ,QAAQ,EAAEC,SAAS,KAAK,EAAE,GAAGN;IAE/F,MAAMO,QAAoB;QACxBL;QACAC;QACAC;QACAC;QACAC;QACAE,YAAY;YACVC,MAAM;QACR;QACAA,MAAMX,KAAKY,MAAM,CACfb,yBAAyB,OAAO;YAC9BI;YACA,GAAGD,KAAK;QACV,IACA;YAAEW,aAAa;QAAM;IAEzB;IAEA,OAAOJ;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/Image/useImage.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { ImageBaseProps, ImageBaseState, 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, block = false, fit = 'default', shadow = false, shape = 'square', ...imageProps } = props;\n const state = useImageBase_unstable(imageProps, ref);\n\n return {\n bordered,\n block,\n fit,\n shadow,\n shape,\n ...state,\n };\n};\n\n/**\n * Base hook for Image component, which manages state related to slot structure.\n * This hook excludes design props (shape, shadow, bordered, fit).\n *\n * @param props - User provided props to the Image component.\n * @param ref - User provided ref to be passed to the Image component.\n */\nexport const useImageBase_unstable = (props: ImageBaseProps, ref: React.Ref<HTMLImageElement>): ImageBaseState => {\n return {\n components: {\n root: 'img',\n },\n root: slot.always(\n getIntrinsicElementProps('img', {\n ref,\n ...props,\n }),\n { elementType: 'img' },\n ),\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useImage_unstable","props","ref","bordered","block","fit","shadow","shape","imageProps","state","useImageBase_unstable","components","root","always","elementType"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAG3E;;CAEC,GACD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC;IACnD,MAAM,EAAEC,WAAW,KAAK,EAAEC,QAAQ,KAAK,EAAEC,MAAM,SAAS,EAAEC,SAAS,KAAK,EAAEC,QAAQ,QAAQ,EAAE,GAAGC,YAAY,GAAGP;IAC9G,MAAMQ,QAAQC,sBAAsBF,YAAYN;IAEhD,OAAO;QACLC;QACAC;QACAC;QACAC;QACAC;QACA,GAAGE,KAAK;IACV;AACF,EAAE;AAEF;;;;;;CAMC,GACD,OAAO,MAAMC,wBAAwB,CAACT,OAAuBC;IAC3D,OAAO;QACLS,YAAY;YACVC,MAAM;QACR;QACAA,MAAMb,KAAKc,MAAM,CACff,yBAAyB,OAAO;YAC9BI;YACA,GAAGD,KAAK;QACV,IACA;YAAEa,aAAa;QAAM;IAEzB;AACF,EAAE"}
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- export { Image, imageClassNames, renderImage_unstable, useImageStyles_unstable, useImage_unstable } from './Image';
1
+ export { Image, imageClassNames, renderImage_unstable, useImageStyles_unstable, useImage_unstable, useImageBase_unstable } from './Image';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Image, imageClassNames, renderImage_unstable, useImageStyles_unstable, useImage_unstable } from './Image';\nexport type { ImageProps, ImageSlots, ImageState } from './Image';\n"],"names":["Image","imageClassNames","renderImage_unstable","useImageStyles_unstable","useImage_unstable"],"mappings":"AAAA,SAASA,KAAK,EAAEC,eAAe,EAAEC,oBAAoB,EAAEC,uBAAuB,EAAEC,iBAAiB,QAAQ,UAAU"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Image,\n imageClassNames,\n renderImage_unstable,\n useImageStyles_unstable,\n useImage_unstable,\n useImageBase_unstable,\n} from './Image';\nexport type { ImageProps, ImageSlots, ImageState, ImageBaseProps, ImageBaseState } from './Image';\n"],"names":["Image","imageClassNames","renderImage_unstable","useImageStyles_unstable","useImage_unstable","useImageBase_unstable"],"mappings":"AAAA,SACEA,KAAK,EACLC,eAAe,EACfC,oBAAoB,EACpBC,uBAAuB,EACvBC,iBAAiB,EACjBC,qBAAqB,QAChB,UAAU"}
@@ -18,6 +18,9 @@ _export(exports, {
18
18
  renderImage_unstable: function() {
19
19
  return _index.renderImage_unstable;
20
20
  },
21
+ useImageBase_unstable: function() {
22
+ return _index.useImageBase_unstable;
23
+ },
21
24
  useImageStyles_unstable: function() {
22
25
  return _index.useImageStyles_unstable;
23
26
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Image.ts"],"sourcesContent":["export type { ImageProps, ImageSlots, ImageState } from './components/Image/index';\nexport {\n Image,\n imageClassNames,\n renderImage_unstable,\n useImageStyles_unstable,\n useImage_unstable,\n} from './components/Image/index';\n"],"names":["Image","imageClassNames","renderImage_unstable","useImageStyles_unstable","useImage_unstable"],"mappings":";;;;;;;;;;;;eAEEA,YAAK;;;eACLC,sBAAe;;;eACfC,2BAAoB;;;eACpBC,8BAAuB;;;eACvBC,wBAAiB;;;uBACZ,2BAA2B"}
1
+ {"version":3,"sources":["../src/Image.ts"],"sourcesContent":["export type { ImageProps, ImageSlots, ImageState, ImageBaseProps, ImageBaseState } from './components/Image/index';\nexport {\n Image,\n imageClassNames,\n renderImage_unstable,\n useImageStyles_unstable,\n useImage_unstable,\n useImageBase_unstable,\n} from './components/Image/index';\n"],"names":["Image","imageClassNames","renderImage_unstable","useImageStyles_unstable","useImage_unstable","useImageBase_unstable"],"mappings":";;;;;;;;;;;;eAEEA,YAAK;;;eACLC,sBAAe;;;eACfC,2BAAoB;;;eAGpBG,4BAAqB;;;eAFrBF,8BAAuB;;;eACvBC,wBAAiB;;;uBAEZ,2BAA2B"}
@@ -1,4 +1,6 @@
1
- "use strict";
1
+ /**
2
+ * Image state without design-specific state (shape, shadow, bordered, fit).
3
+ */ "use strict";
2
4
  Object.defineProperty(exports, "__esModule", {
3
5
  value: true
4
6
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Image/Image.types.ts"],"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"],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../src/components/Image/Image.types.ts"],"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\n/**\n * Image props without design-specific props (shape, shadow, bordered, fit).\n * Use this when building a base image that is unstyled or uses a custom design system.\n */\nexport type ImageBaseProps = ComponentProps<ImageSlots>;\n\nexport type ImageState = ComponentState<ImageSlots> &\n Required<Pick<ImageProps, 'block' | 'bordered' | 'fit' | 'shadow' | 'shape'>>;\n\n/**\n * Image state without design-specific state (shape, shadow, bordered, fit).\n */\nexport type ImageBaseState = ComponentState<ImageSlots>;\n"],"names":[],"mappings":"AAoDA;;CAEC,GACD,WAAwD"}
@@ -18,6 +18,9 @@ _export(exports, {
18
18
  renderImage_unstable: function() {
19
19
  return _renderImage.renderImage_unstable;
20
20
  },
21
+ useImageBase_unstable: function() {
22
+ return _useImage.useImageBase_unstable;
23
+ },
21
24
  useImageStyles_unstable: function() {
22
25
  return _useImageStylesstyles.useImageStyles_unstable;
23
26
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Image/index.ts"],"sourcesContent":["export type { ImageProps, ImageSlots, ImageState } from './Image.types';\nexport { Image } from './Image';\nexport { renderImage_unstable } from './renderImage';\nexport { useImage_unstable } from './useImage';\nexport { imageClassNames, useImageStyles_unstable } from './useImageStyles.styles';\n"],"names":["Image","renderImage_unstable","useImage_unstable","imageClassNames","useImageStyles_unstable"],"mappings":";;;;;;;;;;;;eACSA,YAAK;;;eAGLG,qCAAe;;;eAFfF,iCAAoB;;;eAEHG,6CAAuB;;;eADxCF,2BAAiB;;;uBAFJ,UAAU;6BACK,gBAAgB;0BACnB,aAAa;sCACU,0BAA0B"}
1
+ {"version":3,"sources":["../src/components/Image/index.ts"],"sourcesContent":["export type { ImageBaseProps, ImageBaseState, ImageProps, ImageSlots, ImageState } from './Image.types';\nexport { Image } from './Image';\nexport { renderImage_unstable } from './renderImage';\nexport { useImage_unstable, useImageBase_unstable } from './useImage';\nexport { imageClassNames, useImageStyles_unstable } from './useImageStyles.styles';\n"],"names":["Image","renderImage_unstable","useImage_unstable","useImageBase_unstable","imageClassNames","useImageStyles_unstable"],"mappings":";;;;;;;;;;;;eACSA,YAAK;;;eAGLI,qCAAe;;;eAFfH,iCAAoB;;;eACDE,+BAAqB;;;eACvBE,6CAAuB;;;eADxCH,2BAAiB;;;uBAFJ,UAAU;6BACK,gBAAgB;0BACI,aAAa;sCACb,0BAA0B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Image/renderImage.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { ImageSlots, ImageState } from './Image.types';\n\n/**\n * Define the render function.\n * Given the state of an image, renders it.\n */\nexport const renderImage_unstable = (state: ImageState): JSXElement => {\n assertSlots<ImageSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderImage_unstable","state","root"],"mappings":";;;;;;;;;;4BACA,gDAAiD;gCAErB,4BAA4B;AAQjD,MAAMC,uBAAuB,CAACC;QACnCF,2BAAAA,EAAwBE;IAExB,OAAA,WAAA,OAAO,eAAA,EAACA,MAAMC,IAAI,EAAA,CAAA;AACpB,EAAE"}
1
+ {"version":3,"sources":["../src/components/Image/renderImage.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { ImageSlots, ImageBaseState } from './Image.types';\n\n/**\n * Define the render function.\n * Given the state of an image, renders it.\n */\nexport const renderImage_unstable = (state: ImageBaseState): JSXElement => {\n assertSlots<ImageSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","renderImage_unstable","state","root"],"mappings":";;;;;;;;;;4BACA,gDAAiD;gCAErB,4BAA4B;AAQjD,MAAMC,uBAAuB,CAACC;QACnCF,2BAAAA,EAAwBE;IAExB,OAAA,WAAA,OAAO,eAAA,EAACA,MAAMC,IAAI,EAAA,CAAA;AACpB,EAAE"}
@@ -1,10 +1,19 @@
1
+ 'use client';
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", {
3
4
  value: true
4
5
  });
5
- Object.defineProperty(exports, "useImage_unstable", {
6
- enumerable: true,
7
- get: function() {
6
+ function _export(target, all) {
7
+ for(var name in all)Object.defineProperty(target, name, {
8
+ enumerable: true,
9
+ get: all[name]
10
+ });
11
+ }
12
+ _export(exports, {
13
+ useImageBase_unstable: function() {
14
+ return useImageBase_unstable;
15
+ },
16
+ useImage_unstable: function() {
8
17
  return useImage_unstable;
9
18
  }
10
19
  });
@@ -12,13 +21,19 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
12
21
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
22
  const _reactutilities = require("@fluentui/react-utilities");
14
23
  const useImage_unstable = (props, ref)=>{
15
- const { bordered = false, fit = 'default', block = false, shape = 'square', shadow = false } = props;
16
- const state = {
24
+ const { bordered = false, block = false, fit = 'default', shadow = false, shape = 'square', ...imageProps } = props;
25
+ const state = useImageBase_unstable(imageProps, ref);
26
+ return {
17
27
  bordered,
18
- fit,
19
28
  block,
20
- shape,
29
+ fit,
21
30
  shadow,
31
+ shape,
32
+ ...state
33
+ };
34
+ };
35
+ const useImageBase_unstable = (props, ref)=>{
36
+ return {
22
37
  components: {
23
38
  root: 'img'
24
39
  },
@@ -29,5 +44,4 @@ const useImage_unstable = (props, ref)=>{
29
44
  elementType: 'img'
30
45
  })
31
46
  };
32
- return state;
33
47
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Image/useImage.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } 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: slot.always(\n getIntrinsicElementProps('img', {\n ref,\n ...props,\n }),\n { elementType: 'img' },\n ),\n };\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","slot","useImage_unstable","props","ref","bordered","fit","block","shape","shadow","state","components","root","always","elementType"],"mappings":";;;;+BAOaG;;;;;;;iEAPU,QAAQ;gCACgB,4BAA4B;AAMpE,0BAA0B,CAACC,OAAmBC;IACnD,MAAM,EAAEC,WAAW,KAAK,EAAEC,MAAM,SAAS,EAAEC,QAAQ,KAAK,EAAEC,QAAQ,QAAQ,EAAEC,SAAS,KAAK,EAAE,GAAGN;IAE/F,MAAMO,QAAoB;QACxBL;QACAC;QACAC;QACAC;QACAC;QACAE,YAAY;YACVC,MAAM;QACR;QACAA,MAAMX,oBAAAA,CAAKY,MAAM,KACfb,wCAAAA,EAAyB,OAAO;YAC9BI;YACA,GAAGD,KAAK;QACV,IACA;YAAEW,aAAa;QAAM;IAEzB;IAEA,OAAOJ;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/Image/useImage.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { ImageBaseProps, ImageBaseState, 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, block = false, fit = 'default', shadow = false, shape = 'square', ...imageProps } = props;\n const state = useImageBase_unstable(imageProps, ref);\n\n return {\n bordered,\n block,\n fit,\n shadow,\n shape,\n ...state,\n };\n};\n\n/**\n * Base hook for Image component, which manages state related to slot structure.\n * This hook excludes design props (shape, shadow, bordered, fit).\n *\n * @param props - User provided props to the Image component.\n * @param ref - User provided ref to be passed to the Image component.\n */\nexport const useImageBase_unstable = (props: ImageBaseProps, ref: React.Ref<HTMLImageElement>): ImageBaseState => {\n return {\n components: {\n root: 'img',\n },\n root: slot.always(\n getIntrinsicElementProps('img', {\n ref,\n ...props,\n }),\n { elementType: 'img' },\n ),\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useImage_unstable","props","ref","bordered","block","fit","shadow","shape","imageProps","state","useImageBase_unstable","components","root","always","elementType"],"mappings":"AAAA;;;;;;;;;;;;IA8Baa,qBAAAA;;;qBArBAV;;;;;iEAPU,QAAQ;gCACgB,4BAA4B;AAMpE,MAAMA,oBAAoB,CAACC,OAAmBC;IACnD,MAAM,EAAEC,WAAW,KAAK,EAAEC,QAAQ,KAAK,EAAEC,MAAM,SAAS,EAAEC,SAAS,KAAK,EAAEC,QAAQ,QAAQ,EAAE,GAAGC,YAAY,GAAGP;IAC9G,MAAMQ,QAAQC,sBAAsBF,YAAYN;IAEhD,OAAO;QACLC;QACAC;QACAC;QACAC;QACAC;QACA,GAAGE,KAAK;IACV;AACF,EAAE;AASK,8BAA8B,CAACR,OAAuBC;IAC3D,OAAO;QACLS,YAAY;YACVC,MAAM;QACR;QACAA,MAAMb,oBAAAA,CAAKc,MAAM,KACff,wCAAAA,EAAyB,OAAO;YAC9BI;YACA,GAAGD,KAAK;QACV,IACA;YAAEa,aAAa;QAAM;IAEzB;AACF,EAAE"}
@@ -18,6 +18,9 @@ _export(exports, {
18
18
  renderImage_unstable: function() {
19
19
  return _Image.renderImage_unstable;
20
20
  },
21
+ useImageBase_unstable: function() {
22
+ return _Image.useImageBase_unstable;
23
+ },
21
24
  useImageStyles_unstable: function() {
22
25
  return _Image.useImageStyles_unstable;
23
26
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { Image, imageClassNames, renderImage_unstable, useImageStyles_unstable, useImage_unstable } from './Image';\nexport type { ImageProps, ImageSlots, ImageState } from './Image';\n"],"names":["Image","imageClassNames","renderImage_unstable","useImageStyles_unstable","useImage_unstable"],"mappings":";;;;;;;;;;;;eAASA,YAAK;;;eAAEC,sBAAe;;;eAAEC,2BAAoB;;;eAAEC,8BAAuB;;;eAAEC,wBAAiB;;;uBAAQ,UAAU"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Image,\n imageClassNames,\n renderImage_unstable,\n useImageStyles_unstable,\n useImage_unstable,\n useImageBase_unstable,\n} from './Image';\nexport type { ImageProps, ImageSlots, ImageState, ImageBaseProps, ImageBaseState } from './Image';\n"],"names":["Image","imageClassNames","renderImage_unstable","useImageStyles_unstable","useImage_unstable","useImageBase_unstable"],"mappings":";;;;;;;;;;;;eACEA,YAAK;;;eACLC,sBAAe;;;eACfC,2BAAoB;;;eAGpBG,4BAAqB;;;eAFrBF,8BAAuB;;;eACvBC,wBAAiB;;;uBAEZ,UAAU"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-image",
3
- "version": "9.3.15",
3
+ "version": "9.4.0",
4
4
  "description": "Fluent UI React Image component.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",