@fluentui/react-image 9.0.0-rc.5 → 9.0.0-rc.8

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.
@@ -3,6 +3,7 @@ import type { ComponentState } from '@fluentui/react-utilities';
3
3
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
4
4
  import * as React_2 from 'react';
5
5
  import type { Slot } from '@fluentui/react-utilities';
6
+ import type { SlotClassNames } from '@fluentui/react-utilities';
6
7
 
7
8
  /**
8
9
  * The Image component ensures the consistent styling of images.
@@ -10,8 +11,13 @@ import type { Slot } from '@fluentui/react-utilities';
10
11
  declare const Image_2: ForwardRefComponent<ImageProps>;
11
12
  export { Image_2 as Image }
12
13
 
14
+ /**
15
+ * @deprecated Use `imageClassNames.root` instead.
16
+ */
13
17
  export declare const imageClassName = "fui-Image";
14
18
 
19
+ export declare const imageClassNames: SlotClassNames<ImageSlots>;
20
+
15
21
  declare type ImageCommons = {
16
22
  /**
17
23
  * An image can appear with rectangular border.
File without changes
@@ -1,6 +1,13 @@
1
1
  import { shorthands, mergeClasses, __styles } from '@griffel/react';
2
2
  import { tokens } from '@fluentui/react-theme';
3
+ /**
4
+ * @deprecated Use `imageClassNames.root` instead.
5
+ */
6
+
3
7
  export const imageClassName = 'fui-Image';
8
+ export const imageClassNames = {
9
+ root: 'fui-Image'
10
+ };
4
11
 
5
12
  const useStyles = /*#__PURE__*/__styles({
6
13
  "root": {
@@ -73,6 +80,6 @@ const useStyles = /*#__PURE__*/__styles({
73
80
 
74
81
  export const useImageStyles_unstable = state => {
75
82
  const styles = useStyles();
76
- state.root.className = mergeClasses(imageClassName, styles.root, state.bordered && styles.rootBordered, state.shape === 'circular' && styles.rootCircular, state.shape === 'rounded' && styles.rootRounded, state.shadow && styles.rootShadow, state.fit === 'none' && styles.rootFitNone, state.fit === 'center' && styles.rootFitCenter, state.fit === 'cover' && styles.rootFitCover, state.fit === 'contain' && styles.rootFitContain, state.block && styles.rootBlock, state.root.className);
83
+ state.root.className = mergeClasses(imageClassNames.root, styles.root, state.bordered && styles.rootBordered, state.shape === 'circular' && styles.rootCircular, state.shape === 'rounded' && styles.rootRounded, state.shadow && styles.rootShadow, state.fit === 'none' && styles.rootFitNone, state.fit === 'center' && styles.rootFitCenter, state.fit === 'cover' && styles.rootFitCover, state.fit === 'contain' && styles.rootFitContain, state.block && styles.rootBlock, state.root.className);
77
84
  };
78
85
  //# sourceMappingURL=useImageStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["components/Image/useImageStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,EAAqB,YAArB,kBAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAGA,OAAO,MAAM,cAAc,GAAG,WAAvB;;AAEP,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;;AAkDA,OAAO,MAAM,uBAAuB,GAAI,KAAD,IAAsB;AAC3D,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,cADiC,EAEjC,MAAM,CAAC,IAF0B,EAGjC,KAAK,CAAC,QAAN,IAAkB,MAAM,CAAC,YAHQ,EAIjC,KAAK,CAAC,KAAN,KAAgB,UAAhB,IAA8B,MAAM,CAAC,YAJJ,EAKjC,KAAK,CAAC,KAAN,KAAgB,SAAhB,IAA6B,MAAM,CAAC,WALH,EAMjC,KAAK,CAAC,MAAN,IAAgB,MAAM,CAAC,UANU,EAOjC,KAAK,CAAC,GAAN,KAAc,MAAd,IAAwB,MAAM,CAAC,WAPE,EAQjC,KAAK,CAAC,GAAN,KAAc,QAAd,IAA0B,MAAM,CAAC,aARA,EASjC,KAAK,CAAC,GAAN,KAAc,OAAd,IAAyB,MAAM,CAAC,YATC,EAUjC,KAAK,CAAC,GAAN,KAAc,SAAd,IAA2B,MAAM,CAAC,cAVD,EAWjC,KAAK,CAAC,KAAN,IAAe,MAAM,CAAC,SAXW,EAYjC,KAAK,CAAC,IAAN,CAAW,SAZsB,CAAnC;AAcD,CAhBM","sourcesContent":["import { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { ImageState } from './Image.types';\n\nexport const imageClassName = 'fui-Image';\n\nconst useStyles = makeStyles({\n root: {\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderRadius(tokens.borderRadiusNone),\n\n boxSizing: 'border-box',\n display: 'inline-block',\n },\n rootBordered: {\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n },\n rootCircular: {\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n },\n rootRounded: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n rootShadow: {\n boxShadow: tokens.shadow4,\n },\n rootFitNone: {\n objectFit: 'none',\n objectPosition: 'left top',\n height: '100%',\n width: '100%',\n },\n rootFitCenter: {\n objectFit: 'none',\n objectPosition: 'center',\n height: '100%',\n width: '100%',\n },\n rootFitCover: {\n objectFit: 'cover',\n objectPosition: 'center',\n height: '100%',\n width: '100%',\n },\n rootFitContain: {\n objectFit: 'contain',\n objectPosition: 'center',\n height: '100%',\n width: '100%',\n },\n rootBlock: {\n width: '100%',\n },\n});\n\nexport const useImageStyles_unstable = (state: ImageState) => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n imageClassName,\n styles.root,\n state.bordered && styles.rootBordered,\n state.shape === 'circular' && styles.rootCircular,\n state.shape === 'rounded' && styles.rootRounded,\n state.shadow && styles.rootShadow,\n state.fit === 'none' && styles.rootFitNone,\n state.fit === 'center' && styles.rootFitCenter,\n state.fit === 'cover' && styles.rootFitCover,\n state.fit === 'contain' && styles.rootFitContain,\n state.block && styles.rootBlock,\n state.root.className,\n );\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/Image/useImageStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,EAAqB,YAArB,kBAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAIA;;AAEG;;AACH,OAAO,MAAM,cAAc,GAAG,WAAvB;AACP,OAAO,MAAM,eAAe,GAA+B;AACzD,EAAA,IAAI,EAAE;AADmD,CAApD;;AAIP,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;;AAkDA,OAAO,MAAM,uBAAuB,GAAI,KAAD,IAAsB;AAC3D,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,eAAe,CAAC,IADiB,EAEjC,MAAM,CAAC,IAF0B,EAGjC,KAAK,CAAC,QAAN,IAAkB,MAAM,CAAC,YAHQ,EAIjC,KAAK,CAAC,KAAN,KAAgB,UAAhB,IAA8B,MAAM,CAAC,YAJJ,EAKjC,KAAK,CAAC,KAAN,KAAgB,SAAhB,IAA6B,MAAM,CAAC,WALH,EAMjC,KAAK,CAAC,MAAN,IAAgB,MAAM,CAAC,UANU,EAOjC,KAAK,CAAC,GAAN,KAAc,MAAd,IAAwB,MAAM,CAAC,WAPE,EAQjC,KAAK,CAAC,GAAN,KAAc,QAAd,IAA0B,MAAM,CAAC,aARA,EASjC,KAAK,CAAC,GAAN,KAAc,OAAd,IAAyB,MAAM,CAAC,YATC,EAUjC,KAAK,CAAC,GAAN,KAAc,SAAd,IAA2B,MAAM,CAAC,cAVD,EAWjC,KAAK,CAAC,KAAN,IAAe,MAAM,CAAC,SAXW,EAYjC,KAAK,CAAC,IAAN,CAAW,SAZsB,CAAnC;AAcD,CAhBM","sourcesContent":["import { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { ImageSlots, ImageState } from './Image.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * @deprecated Use `imageClassNames.root` instead.\n */\nexport const imageClassName = 'fui-Image';\nexport const imageClassNames: SlotClassNames<ImageSlots> = {\n root: 'fui-Image',\n};\n\nconst useStyles = makeStyles({\n root: {\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderRadius(tokens.borderRadiusNone),\n\n boxSizing: 'border-box',\n display: 'inline-block',\n },\n rootBordered: {\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n },\n rootCircular: {\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n },\n rootRounded: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n rootShadow: {\n boxShadow: tokens.shadow4,\n },\n rootFitNone: {\n objectFit: 'none',\n objectPosition: 'left top',\n height: '100%',\n width: '100%',\n },\n rootFitCenter: {\n objectFit: 'none',\n objectPosition: 'center',\n height: '100%',\n width: '100%',\n },\n rootFitCover: {\n objectFit: 'cover',\n objectPosition: 'center',\n height: '100%',\n width: '100%',\n },\n rootFitContain: {\n objectFit: 'contain',\n objectPosition: 'center',\n height: '100%',\n width: '100%',\n },\n rootBlock: {\n width: '100%',\n },\n});\n\nexport const useImageStyles_unstable = (state: ImageState) => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n imageClassNames.root,\n styles.root,\n state.bordered && styles.rootBordered,\n state.shape === 'circular' && styles.rootCircular,\n state.shape === 'rounded' && styles.rootRounded,\n state.shadow && styles.rootShadow,\n state.fit === 'none' && styles.rootFitNone,\n state.fit === 'center' && styles.rootFitCenter,\n state.fit === 'cover' && styles.rootFitCover,\n state.fit === 'contain' && styles.rootFitContain,\n state.block && styles.rootBlock,\n state.root.className,\n );\n};\n"],"sourceRoot":"../src/"}
package/lib/index.js CHANGED
@@ -1,2 +1,3 @@
1
- export * from './Image';
1
+ export { Image, // eslint-disable-next-line deprecation/deprecation -- https://github.com/microsoft/fluentui/pull/21960#issuecomment-1068991851
2
+ imageClassName, imageClassNames, renderImage_unstable, useImageStyles_unstable, useImage_unstable } from './Image';
2
3
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC","sourcesContent":["export * from './Image';\n"]}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,SACE,KADF,EAEE;AACA,cAHF,EAIE,eAJF,EAKE,oBALF,EAME,uBANF,EAOE,iBAPF,QAQO,SARP","sourcesContent":["export {\n Image,\n // eslint-disable-next-line deprecation/deprecation -- https://github.com/microsoft/fluentui/pull/21960#issuecomment-1068991851\n imageClassName,\n imageClassNames,\n renderImage_unstable,\n useImageStyles_unstable,\n useImage_unstable,\n} from './Image';\nexport type { ImageProps, ImageSlots, ImageState } from './Image';\n"],"sourceRoot":"../src/"}
@@ -3,13 +3,20 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useImageStyles_unstable = exports.imageClassName = void 0;
6
+ exports.useImageStyles_unstable = exports.imageClassNames = exports.imageClassName = void 0;
7
7
 
8
8
  const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
10
10
  const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
11
+ /**
12
+ * @deprecated Use `imageClassNames.root` instead.
13
+ */
14
+
11
15
 
12
16
  exports.imageClassName = 'fui-Image';
17
+ exports.imageClassNames = {
18
+ root: 'fui-Image'
19
+ };
13
20
 
14
21
  const useStyles = /*#__PURE__*/react_1.__styles({
15
22
  "root": {
@@ -82,7 +89,7 @@ const useStyles = /*#__PURE__*/react_1.__styles({
82
89
 
83
90
  const useImageStyles_unstable = state => {
84
91
  const styles = useStyles();
85
- state.root.className = react_1.mergeClasses(exports.imageClassName, styles.root, state.bordered && styles.rootBordered, state.shape === 'circular' && styles.rootCircular, state.shape === 'rounded' && styles.rootRounded, state.shadow && styles.rootShadow, state.fit === 'none' && styles.rootFitNone, state.fit === 'center' && styles.rootFitCenter, state.fit === 'cover' && styles.rootFitCover, state.fit === 'contain' && styles.rootFitContain, state.block && styles.rootBlock, state.root.className);
92
+ state.root.className = react_1.mergeClasses(exports.imageClassNames.root, styles.root, state.bordered && styles.rootBordered, state.shape === 'circular' && styles.rootCircular, state.shape === 'rounded' && styles.rootRounded, state.shadow && styles.rootShadow, state.fit === 'none' && styles.rootFitNone, state.fit === 'center' && styles.rootFitCenter, state.fit === 'cover' && styles.rootFitCover, state.fit === 'contain' && styles.rootFitContain, state.block && styles.rootBlock, state.root.className);
86
93
  };
87
94
 
88
95
  exports.useImageStyles_unstable = useImageStyles_unstable;
@@ -1 +1 @@
1
- {"version":3,"sources":["components/Image/useImageStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CA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rB,KAAK,CAAC,IAAN,CAAW,SAZU,CAAvB;AAcD,CAhBM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { ImageState } from './Image.types';\n\nexport const imageClassName = 'fui-Image';\n\nconst useStyles = makeStyles({\n root: {\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderRadius(tokens.borderRadiusNone),\n\n boxSizing: 'border-box',\n display: 'inline-block',\n },\n rootBordered: {\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n },\n rootCircular: {\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n },\n rootRounded: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n rootShadow: {\n boxShadow: tokens.shadow4,\n },\n rootFitNone: {\n objectFit: 'none',\n objectPosition: 'left top',\n height: '100%',\n width: '100%',\n },\n rootFitCenter: {\n objectFit: 'none',\n objectPosition: 'center',\n height: '100%',\n width: '100%',\n },\n rootFitCover: {\n objectFit: 'cover',\n objectPosition: 'center',\n height: '100%',\n width: '100%',\n },\n rootFitContain: {\n objectFit: 'contain',\n objectPosition: 'center',\n height: '100%',\n width: '100%',\n },\n rootBlock: {\n width: '100%',\n },\n});\n\nexport const useImageStyles_unstable = (state: ImageState) => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n imageClassName,\n styles.root,\n state.bordered && styles.rootBordered,\n state.shape === 'circular' && styles.rootCircular,\n state.shape === 'rounded' && styles.rootRounded,\n state.shadow && styles.rootShadow,\n state.fit === 'none' && styles.rootFitNone,\n state.fit === 'center' && styles.rootFitCenter,\n state.fit === 'cover' && styles.rootFitCover,\n state.fit === 'contain' && styles.rootFitContain,\n state.block && styles.rootBlock,\n state.root.className,\n );\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/Image/useImageStyles.ts"],"names":[],"mappings":";;;;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ARZ,EASrB,KAAK,CAAC,GAAN,KAAc,OAAd,IAAyB,MAAM,CAAC,YATX,EAUrB,KAAK,CAAC,GAAN,KAAc,SAAd,IAA2B,MAAM,CAAC,cAVb,EAWrB,KAAK,CAAC,KAAN,IAAe,MAAM,CAAC,SAXD,EAYrB,KAAK,CAAC,IAAN,CAAW,SAZU,CAAvB;AAcD,CAhBM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { ImageSlots, ImageState } from './Image.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\n/**\n * @deprecated Use `imageClassNames.root` instead.\n */\nexport const imageClassName = 'fui-Image';\nexport const imageClassNames: SlotClassNames<ImageSlots> = {\n root: 'fui-Image',\n};\n\nconst useStyles = makeStyles({\n root: {\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderRadius(tokens.borderRadiusNone),\n\n boxSizing: 'border-box',\n display: 'inline-block',\n },\n rootBordered: {\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n },\n rootCircular: {\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n },\n rootRounded: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n rootShadow: {\n boxShadow: tokens.shadow4,\n },\n rootFitNone: {\n objectFit: 'none',\n objectPosition: 'left top',\n height: '100%',\n width: '100%',\n },\n rootFitCenter: {\n objectFit: 'none',\n objectPosition: 'center',\n height: '100%',\n width: '100%',\n },\n rootFitCover: {\n objectFit: 'cover',\n objectPosition: 'center',\n height: '100%',\n width: '100%',\n },\n rootFitContain: {\n objectFit: 'contain',\n objectPosition: 'center',\n height: '100%',\n width: '100%',\n },\n rootBlock: {\n width: '100%',\n },\n});\n\nexport const useImageStyles_unstable = (state: ImageState) => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n imageClassNames.root,\n styles.root,\n state.bordered && styles.rootBordered,\n state.shape === 'circular' && styles.rootCircular,\n state.shape === 'rounded' && styles.rootRounded,\n state.shadow && styles.rootShadow,\n state.fit === 'none' && styles.rootFitNone,\n state.fit === 'center' && styles.rootFitCenter,\n state.fit === 'cover' && styles.rootFitCover,\n state.fit === 'contain' && styles.rootFitContain,\n state.block && styles.rootBlock,\n state.root.className,\n );\n};\n"],"sourceRoot":"../src/"}
@@ -3,8 +3,45 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.useImage_unstable = exports.useImageStyles_unstable = exports.renderImage_unstable = exports.imageClassNames = exports.imageClassName = exports.Image = void 0;
6
7
 
7
- const tslib_1 = /*#__PURE__*/require("tslib");
8
+ var Image_1 = /*#__PURE__*/require("./Image");
8
9
 
9
- tslib_1.__exportStar(require("./Image"), exports);
10
+ Object.defineProperty(exports, "Image", {
11
+ enumerable: true,
12
+ get: function () {
13
+ return Image_1.Image;
14
+ }
15
+ }); // eslint-disable-next-line deprecation/deprecation -- https://github.com/microsoft/fluentui/pull/21960#issuecomment-1068991851
16
+
17
+ Object.defineProperty(exports, "imageClassName", {
18
+ enumerable: true,
19
+ get: function () {
20
+ return Image_1.imageClassName;
21
+ }
22
+ });
23
+ Object.defineProperty(exports, "imageClassNames", {
24
+ enumerable: true,
25
+ get: function () {
26
+ return Image_1.imageClassNames;
27
+ }
28
+ });
29
+ Object.defineProperty(exports, "renderImage_unstable", {
30
+ enumerable: true,
31
+ get: function () {
32
+ return Image_1.renderImage_unstable;
33
+ }
34
+ });
35
+ Object.defineProperty(exports, "useImageStyles_unstable", {
36
+ enumerable: true,
37
+ get: function () {
38
+ return Image_1.useImageStyles_unstable;
39
+ }
40
+ });
41
+ Object.defineProperty(exports, "useImage_unstable", {
42
+ enumerable: true,
43
+ get: function () {
44
+ return Image_1.useImage_unstable;
45
+ }
46
+ });
10
47
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Image';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,OAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,OAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,KAAA;AAAK;AAAL,CAAA,E,CACA;;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,cAAA;AAAc;AAAd,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,eAAA;AAAe;AAAf,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,sBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,oBAAA;AAAoB;AAApB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,uBAAA;AAAuB;AAAvB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,iBAAA;AAAiB;AAAjB,CAAA","sourcesContent":["export {\n Image,\n // eslint-disable-next-line deprecation/deprecation -- https://github.com/microsoft/fluentui/pull/21960#issuecomment-1068991851\n imageClassName,\n imageClassNames,\n renderImage_unstable,\n useImageStyles_unstable,\n useImage_unstable,\n} from './Image';\nexport type { ImageProps, ImageSlots, ImageState } from './Image';\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.5",
3
+ "version": "9.0.0-rc.8",
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,31 +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.3",
32
- "@fluentui/scripts": "^1.0.0",
33
- "@types/enzyme": "3.10.3",
34
- "@types/enzyme-adapter-react-16": "1.0.3",
35
- "@types/object-fit-images": "^3.2.0",
36
- "@types/react": "16.9.42",
37
- "@types/react-dom": "16.9.10",
38
- "@types/react-test-renderer": "^16.0.0",
39
- "enzyme": "~3.10.0",
40
- "enzyme-adapter-react-16": "^1.15.0",
41
- "react": "16.8.6",
42
- "react-dom": "16.8.6",
43
- "react-test-renderer": "^16.3.0"
31
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.5",
32
+ "@fluentui/scripts": "^1.0.0"
44
33
  },
45
34
  "dependencies": {
46
- "@griffel/react": "1.0.0",
47
- "@fluentui/react-utilities": "9.0.0-rc.5",
48
- "@fluentui/react-theme": "9.0.0-rc.4",
35
+ "@griffel/react": "1.0.3",
36
+ "@fluentui/react-utilities": "9.0.0-rc.8",
37
+ "@fluentui/react-theme": "9.0.0-rc.7",
49
38
  "tslib": "^2.1.0"
50
39
  },
51
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,3 +0,0 @@
1
- import type { ImageState } from './Image.types';
2
- export declare const imageClassName = "fui-Image";
3
- export declare const useImageStyles_unstable: (state: ImageState) => void;
package/lib/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * 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,3 +0,0 @@
1
- import type { ImageState } from './Image.types';
2
- export declare const imageClassName = "fui-Image";
3
- export declare const useImageStyles_unstable: (state: ImageState) => void;
@@ -1 +0,0 @@
1
- export * from './Image';