@fluentui/react-image 9.0.0-nightly.f81b28ceb3.1 → 9.0.0-rc.11
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 +547 -16
- package/CHANGELOG.md +274 -120
- package/MIGRATION.md +235 -0
- package/README.md +4 -0
- package/dist/{react-image.d.ts → index.d.ts} +28 -20
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/Image.js.map +1 -1
- package/lib/components/Image/Image.js +7 -7
- package/lib/components/Image/Image.js.map +1 -1
- package/lib/components/Image/Image.types.js.map +1 -1
- package/lib/components/Image/index.js.map +1 -1
- package/lib/components/Image/renderImage.js +7 -8
- package/lib/components/Image/renderImage.js.map +1 -1
- package/lib/components/Image/useImage.js +18 -18
- package/lib/components/Image/useImage.js.map +1 -1
- package/lib/components/Image/useImageStyles.js +39 -24
- package/lib/components/Image/useImageStyles.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Image.js +1 -1
- package/lib-commonjs/Image.js.map +1 -1
- package/lib-commonjs/components/Image/Image.js +8 -8
- package/lib-commonjs/components/Image/Image.js.map +1 -1
- package/lib-commonjs/components/Image/Image.types.js.map +1 -1
- package/lib-commonjs/components/Image/index.js +1 -1
- package/lib-commonjs/components/Image/index.js.map +1 -1
- package/lib-commonjs/components/Image/renderImage.js +11 -14
- package/lib-commonjs/components/Image/renderImage.js.map +1 -1
- package/lib-commonjs/components/Image/useImage.js +22 -23
- package/lib-commonjs/components/Image/useImage.js.map +1 -1
- package/lib-commonjs/components/Image/useImageStyles.js +43 -26
- package/lib-commonjs/components/Image/useImageStyles.js.map +1 -1
- package/lib-commonjs/index.js +32 -2
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +18 -23
- package/lib/Image.d.ts +0 -1
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -13
- package/lib/common/isConformant.js.map +0 -1
- package/lib/components/Image/Image.d.ts +0 -6
- package/lib/components/Image/Image.types.d.ts +0 -29
- 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 -7
- package/lib/components/Image/useImageStyles.d.ts +0 -2
- package/lib/index.d.ts +0 -1
- package/lib-commonjs/Image.d.ts +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -24
- package/lib-commonjs/common/isConformant.js.map +0 -1
- package/lib-commonjs/components/Image/Image.d.ts +0 -6
- package/lib-commonjs/components/Image/Image.types.d.ts +0 -29
- 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 -7
- package/lib-commonjs/components/Image/useImageStyles.d.ts +0 -2
- package/lib-commonjs/index.d.ts +0 -1
|
@@ -5,22 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Image = void 0;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const renderImage_1 = /*#__PURE__*/require("./renderImage");
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const useImage_1 = /*#__PURE__*/require("./useImage");
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const useImageStyles_1 = /*#__PURE__*/require("./useImageStyles");
|
|
15
15
|
/**
|
|
16
16
|
* The Image component ensures the consistent styling of images.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
exports.Image = /*#__PURE__*/React.forwardRef(
|
|
21
|
-
|
|
22
|
-
useImageStyles_1.
|
|
23
|
-
return renderImage_1.
|
|
20
|
+
exports.Image = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
21
|
+
const state = useImage_1.useImage_unstable(props, ref);
|
|
22
|
+
useImageStyles_1.useImageStyles_unstable(state);
|
|
23
|
+
return renderImage_1.renderImage_unstable(state);
|
|
24
24
|
});
|
|
25
25
|
exports.Image.displayName = 'Image';
|
|
26
26
|
//# sourceMappingURL=Image.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["components/Image/Image.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AACA,MAAA,UAAA,gBAAA,OAAA,CAAA,YAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,KAAA,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACpF,QAAM,KAAK,GAAG,UAAA,CAAA,iBAAA,CAAkB,KAAlB,EAAyB,GAAzB,CAAd;AACA,EAAA,gBAAA,CAAA,uBAAA,CAAwB,KAAxB;AAEA,SAAO,aAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP;AACD,CALqD,CAAzC;AAOb,OAAA,CAAA,KAAA,CAAM,WAAN,GAAoB,OAApB","sourcesContent":["import * as React from 'react';\nimport { renderImage_unstable } from './renderImage';\nimport { useImage_unstable } from './useImage';\nimport { useImageStyles_unstable } from './useImageStyles';\nimport type { ImageProps } from './Image.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * The Image component ensures the consistent styling of images.\n */\nexport const Image: ForwardRefComponent<ImageProps> = React.forwardRef((props, ref) => {\n const state = useImage_unstable(props, ref);\n useImageStyles_unstable(state);\n\n return renderImage_unstable(state);\n});\n\nImage.displayName = 'Image';\n"],"sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["components/Image/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,YAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Image.types';\nexport * from './Image';\nexport * from './renderImage';\nexport * from './useImage';\nexport * from './useImageStyles';\n"],"sourceRoot":"../src/"}
|
|
@@ -3,28 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.renderImage_unstable = void 0;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
13
|
-
|
|
14
|
-
var useImage_1 = /*#__PURE__*/require("./useImage");
|
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
15
11
|
/**
|
|
16
12
|
* Define the render function.
|
|
17
13
|
* Given the state of an image, renders it.
|
|
18
14
|
*/
|
|
19
15
|
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return React.createElement(slots.root,
|
|
17
|
+
const renderImage_unstable = state => {
|
|
18
|
+
const {
|
|
19
|
+
slots,
|
|
20
|
+
slotProps
|
|
21
|
+
} = react_utilities_1.getSlots(state);
|
|
22
|
+
return React.createElement(slots.root, { ...slotProps.root
|
|
23
|
+
});
|
|
27
24
|
};
|
|
28
25
|
|
|
29
|
-
exports.
|
|
26
|
+
exports.renderImage_unstable = renderImage_unstable;
|
|
30
27
|
//# sourceMappingURL=renderImage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["components/Image/renderImage.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;;AAGG;;;AACI,MAAM,oBAAoB,GAAI,KAAD,IAAsB;AACxD,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAqB,KAArB,CAA7B;AAEA,SAAO,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourcesContent":["import * as React from 'react';\nimport { getSlots } 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) => {\n const { slots, slotProps } = getSlots<ImageSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -3,39 +3,38 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.useImage_unstable = void 0;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
11
|
-
|
|
12
|
-
exports.imageShorthandProps = ['root'];
|
|
8
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
13
9
|
/**
|
|
14
10
|
* Given user props, returns state and render function for an Image.
|
|
15
11
|
*/
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
|
|
14
|
+
const useImage_unstable = (props, ref) => {
|
|
15
|
+
const {
|
|
16
|
+
bordered = false,
|
|
17
|
+
fit = 'default',
|
|
18
|
+
block = false,
|
|
19
|
+
shape = 'square',
|
|
20
|
+
shadow = false
|
|
21
|
+
} = props;
|
|
22
|
+
const state = {
|
|
23
|
+
bordered,
|
|
24
|
+
fit,
|
|
25
|
+
block,
|
|
26
|
+
shape,
|
|
27
|
+
shadow,
|
|
30
28
|
components: {
|
|
31
29
|
root: 'img'
|
|
32
30
|
},
|
|
33
|
-
root: react_utilities_1.getNativeElementProps('img',
|
|
34
|
-
ref
|
|
35
|
-
|
|
31
|
+
root: react_utilities_1.getNativeElementProps('img', {
|
|
32
|
+
ref,
|
|
33
|
+
...props
|
|
34
|
+
})
|
|
36
35
|
};
|
|
37
36
|
return state;
|
|
38
37
|
};
|
|
39
38
|
|
|
40
|
-
exports.
|
|
39
|
+
exports.useImage_unstable = useImage_unstable;
|
|
41
40
|
//# sourceMappingURL=useImage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
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/"}
|
|
@@ -3,21 +3,30 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.useImageStyles_unstable = exports.imageClassNames = void 0;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
|
11
|
+
|
|
12
|
+
exports.imageClassNames = {
|
|
13
|
+
root: 'fui-Image'
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
|
17
|
+
"base": {
|
|
12
18
|
"g2u3we": "fj3muxo",
|
|
13
19
|
"h3c5rm": ["f1akhkt", "f1lxtadh"],
|
|
14
20
|
"B9xav0g": "f1aperda",
|
|
15
21
|
"zhjwy3": ["f1lxtadh", "f1akhkt"],
|
|
16
|
-
"
|
|
22
|
+
"Bbmb7ep": ["fzi6hpg", "fyowgf4"],
|
|
23
|
+
"Beyfa6y": ["fyowgf4", "fzi6hpg"],
|
|
24
|
+
"B7oj6ja": ["f3fg2lr", "f13av6d4"],
|
|
25
|
+
"Btl43ni": ["f13av6d4", "f3fg2lr"],
|
|
17
26
|
"B7ck84d": "f1ewtqcl",
|
|
18
27
|
"mc9l5x": "f14t3ns0"
|
|
19
28
|
},
|
|
20
|
-
"
|
|
29
|
+
"bordered": {
|
|
21
30
|
"icvyot": "fzkkow9",
|
|
22
31
|
"vrafjx": ["fcdblym", "fjik90z"],
|
|
23
32
|
"oivjwe": "fg706s2",
|
|
@@ -27,50 +36,58 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
|
27
36
|
"Bn0qgzm": "f1vxd6vx",
|
|
28
37
|
"ibv6hh": ["f1ojsxk5", "f5tn483"]
|
|
29
38
|
},
|
|
30
|
-
"
|
|
31
|
-
"
|
|
39
|
+
"circular": {
|
|
40
|
+
"Bbmb7ep": ["f8fbkgy", "f1nfllo7"],
|
|
41
|
+
"Beyfa6y": ["f1nfllo7", "f8fbkgy"],
|
|
42
|
+
"B7oj6ja": ["f1djnp8u", "f1s8kh49"],
|
|
43
|
+
"Btl43ni": ["f1s8kh49", "f1djnp8u"]
|
|
32
44
|
},
|
|
33
|
-
"
|
|
34
|
-
"
|
|
45
|
+
"rounded": {
|
|
46
|
+
"Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
|
|
47
|
+
"Beyfa6y": ["f16jpd5f", "f1aa9q02"],
|
|
48
|
+
"B7oj6ja": ["f1jar5jt", "fyu767a"],
|
|
49
|
+
"Btl43ni": ["fyu767a", "f1jar5jt"]
|
|
35
50
|
},
|
|
36
|
-
"
|
|
37
|
-
|
|
51
|
+
"square": {},
|
|
52
|
+
"shadow": {
|
|
53
|
+
"E5pizo": "f1whvlc6"
|
|
38
54
|
},
|
|
39
|
-
"
|
|
55
|
+
"center": {
|
|
40
56
|
"st4lth": "f1plgu50",
|
|
41
|
-
"Ermj5k":
|
|
57
|
+
"Ermj5k": "f14xojzb",
|
|
42
58
|
"Bqenvij": "f1l02sjl",
|
|
43
59
|
"a9b677": "fly5x3f"
|
|
44
60
|
},
|
|
45
|
-
"
|
|
46
|
-
"st4lth": "
|
|
61
|
+
"contain": {
|
|
62
|
+
"st4lth": "f1kle4es",
|
|
47
63
|
"Ermj5k": "f14xojzb",
|
|
48
64
|
"Bqenvij": "f1l02sjl",
|
|
49
65
|
"a9b677": "fly5x3f"
|
|
50
66
|
},
|
|
51
|
-
"
|
|
67
|
+
"default": {},
|
|
68
|
+
"cover": {
|
|
52
69
|
"st4lth": "f1ps3kmd",
|
|
53
70
|
"Ermj5k": "f14xojzb",
|
|
54
71
|
"Bqenvij": "f1l02sjl",
|
|
55
72
|
"a9b677": "fly5x3f"
|
|
56
73
|
},
|
|
57
|
-
"
|
|
58
|
-
"st4lth": "
|
|
59
|
-
"Ermj5k": "
|
|
74
|
+
"none": {
|
|
75
|
+
"st4lth": "f1plgu50",
|
|
76
|
+
"Ermj5k": ["f13uwng7", "fjmyj0p"],
|
|
60
77
|
"Bqenvij": "f1l02sjl",
|
|
61
78
|
"a9b677": "fly5x3f"
|
|
62
79
|
},
|
|
63
|
-
"
|
|
80
|
+
"block": {
|
|
64
81
|
"a9b677": "fly5x3f"
|
|
65
82
|
}
|
|
66
83
|
}, {
|
|
67
|
-
"d": [".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1aperda{border-bottom-color:var(--colorNeutralStroke1);}", ".
|
|
84
|
+
"d": [".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1aperda{border-bottom-color:var(--colorNeutralStroke1);}", ".fzi6hpg{border-bottom-right-radius:var(--borderRadiusNone);}", ".fyowgf4{border-bottom-left-radius:var(--borderRadiusNone);}", ".f3fg2lr{border-top-right-radius:var(--borderRadiusNone);}", ".f13av6d4{border-top-left-radius:var(--borderRadiusNone);}", ".f1ewtqcl{box-sizing:border-box;}", ".f14t3ns0{display:inline-block;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".f8fbkgy{border-bottom-right-radius:var(--borderRadiusCircular);}", ".f1nfllo7{border-bottom-left-radius:var(--borderRadiusCircular);}", ".f1djnp8u{border-top-right-radius:var(--borderRadiusCircular);}", ".f1s8kh49{border-top-left-radius:var(--borderRadiusCircular);}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f1whvlc6{box-shadow:var(--shadow4);}", ".f1plgu50{object-fit:none;}", ".f14xojzb{object-position:center;}", ".f1l02sjl{height:100%;}", ".fly5x3f{width:100%;}", ".f1kle4es{object-fit:contain;}", ".f1ps3kmd{object-fit:cover;}", ".f13uwng7{object-position:left top;}", ".fjmyj0p{object-position:right top;}"]
|
|
68
85
|
});
|
|
69
86
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
state.root.className =
|
|
87
|
+
const useImageStyles_unstable = state => {
|
|
88
|
+
const styles = useStyles();
|
|
89
|
+
state.root.className = react_1.mergeClasses(exports.imageClassNames.root, styles.base, state.block && styles.block, state.bordered && styles.bordered, state.shadow && styles.shadow, styles[state.fit], styles[state.shape], state.root.className);
|
|
73
90
|
};
|
|
74
91
|
|
|
75
|
-
exports.
|
|
92
|
+
exports.useImageStyles_unstable = useImageStyles_unstable;
|
|
76
93
|
//# sourceMappingURL=useImageStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["components/Image/useImageStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIa,OAAA,CAAA,eAAA,GAA8C;AACzD,EAAA,IAAI,EAAE;AADmD,CAA9C;;AAIb,MAAM,SAAS,gBAAG,OAAA,SAAA;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;AAAA;AAAA,EAAlB;;AAmEO,MAAM,uBAAuB,GAAI,KAAD,IAAsB;AAC3D,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,eAAA,CAAgB,IADK,EAErB,MAAM,CAAC,IAFc,EAGrB,KAAK,CAAC,KAAN,IAAe,MAAM,CAAC,KAHD,EAIrB,KAAK,CAAC,QAAN,IAAkB,MAAM,CAAC,QAJJ,EAKrB,KAAK,CAAC,MAAN,IAAgB,MAAM,CAAC,MALF,EAMrB,MAAM,CAAC,KAAK,CAAC,GAAP,CANe,EAOrB,MAAM,CAAC,KAAK,CAAC,KAAP,CAPe,EAQrB,KAAK,CAAC,IAAN,CAAW,SARU,CAAvB;AAUD,CAZM;;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\nexport const imageClassNames: SlotClassNames<ImageSlots> = {\n root: 'fui-Image',\n};\n\nconst useStyles = makeStyles({\n // Base styles\n base: {\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderRadius(tokens.borderRadiusNone),\n\n boxSizing: 'border-box',\n display: 'inline-block',\n },\n\n // Bordered styles\n bordered: {\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n },\n\n // Shape variations\n circular: {\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n },\n rounded: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n square: {\n /* The square styles are exactly the same as the base styles. */\n },\n\n // Shadow styles\n shadow: {\n boxShadow: tokens.shadow4,\n },\n\n // Fit variations\n center: {\n objectFit: 'none',\n objectPosition: 'center',\n height: '100%',\n width: '100%',\n },\n contain: {\n objectFit: 'contain',\n objectPosition: 'center',\n height: '100%',\n width: '100%',\n },\n default: {\n /* The default styles are exactly the same as the base styles. */\n },\n cover: {\n objectFit: 'cover',\n objectPosition: 'center',\n height: '100%',\n width: '100%',\n },\n none: {\n objectFit: 'none',\n objectPosition: 'left top',\n height: '100%',\n width: '100%',\n },\n\n // Block styles\n block: {\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.base,\n state.block && styles.block,\n state.bordered && styles.bordered,\n state.shadow && styles.shadow,\n styles[state.fit],\n styles[state.shape],\n state.root.className,\n );\n};\n"],"sourceRoot":"../src/"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -3,8 +3,38 @@
|
|
|
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.Image = void 0;
|
|
6
7
|
|
|
7
|
-
var
|
|
8
|
+
var Image_1 = /*#__PURE__*/require("./Image");
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
Object.defineProperty(exports, "Image", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return Image_1.Image;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "imageClassNames", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return Image_1.imageClassNames;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports, "renderImage_unstable", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () {
|
|
25
|
+
return Image_1.renderImage_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "useImageStyles_unstable", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () {
|
|
31
|
+
return Image_1.useImageStyles_unstable;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "useImage_unstable", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () {
|
|
37
|
+
return Image_1.useImage_unstable;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
10
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,OAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AAAS,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;AAAO,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;AAAiB,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;AAAsB,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;AAAyB,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 { Image, imageClassNames, renderImage_unstable, useImageStyles_unstable, useImage_unstable } 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-
|
|
3
|
+
"version": "9.0.0-rc.11",
|
|
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",
|
|
@@ -19,33 +19,22 @@
|
|
|
19
19
|
"just": "just-scripts",
|
|
20
20
|
"lint": "just-scripts lint",
|
|
21
21
|
"start": "yarn storybook",
|
|
22
|
-
"test": "jest",
|
|
22
|
+
"test": "jest --passWithNoTests",
|
|
23
23
|
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
|
24
|
-
"build:local": "tsc -p . --module esnext --emitDeclarationOnly && node
|
|
25
|
-
"storybook": "
|
|
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
|
+
"type-check": "tsc -b tsconfig.json"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|
|
28
|
-
"@fluentui/babel-make-styles": "9.0.0-nightly.f81b28ceb3.1",
|
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
|
30
|
-
"@fluentui/jest-serializer-make-styles": "9.0.0-nightly.f81b28ceb3.1",
|
|
31
30
|
"@fluentui/react-conformance": "*",
|
|
32
|
-
"@fluentui/react-conformance-
|
|
33
|
-
"@fluentui/scripts": "^1.0.0"
|
|
34
|
-
"@types/enzyme": "3.10.3",
|
|
35
|
-
"@types/enzyme-adapter-react-16": "1.0.3",
|
|
36
|
-
"@types/object-fit-images": "^3.2.0",
|
|
37
|
-
"@types/react": "16.9.42",
|
|
38
|
-
"@types/react-dom": "16.9.10",
|
|
39
|
-
"@types/react-test-renderer": "^16.0.0",
|
|
40
|
-
"enzyme": "~3.10.0",
|
|
41
|
-
"enzyme-adapter-react-16": "^1.15.0",
|
|
42
|
-
"react": "16.8.6",
|
|
43
|
-
"react-dom": "16.8.6",
|
|
44
|
-
"react-test-renderer": "^16.3.0"
|
|
31
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.8",
|
|
32
|
+
"@fluentui/scripts": "^1.0.0"
|
|
45
33
|
},
|
|
46
34
|
"dependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@fluentui/react-utilities": "9.0.0-
|
|
35
|
+
"@griffel/react": "1.1.0",
|
|
36
|
+
"@fluentui/react-utilities": "9.0.0-rc.10",
|
|
37
|
+
"@fluentui/react-theme": "9.0.0-rc.9",
|
|
49
38
|
"tslib": "^2.1.0"
|
|
50
39
|
},
|
|
51
40
|
"peerDependencies": {
|
|
@@ -55,11 +44,17 @@
|
|
|
55
44
|
"react-dom": ">=16.8.0 <18.0.0"
|
|
56
45
|
},
|
|
57
46
|
"beachball": {
|
|
58
|
-
"tag": "beta",
|
|
59
47
|
"disallowedChangeTypes": [
|
|
60
48
|
"major",
|
|
61
49
|
"minor",
|
|
62
50
|
"patch"
|
|
63
51
|
]
|
|
52
|
+
},
|
|
53
|
+
"exports": {
|
|
54
|
+
".": {
|
|
55
|
+
"types": "./lib/index.d.ts",
|
|
56
|
+
"import": "./lib/index.js",
|
|
57
|
+
"require": "./lib-commonjs/index.js"
|
|
58
|
+
}
|
|
64
59
|
}
|
|
65
60
|
}
|
package/lib/Image.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Image/index';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
|
|
2
|
-
import makeStylesTests from '@fluentui/react-conformance-make-styles';
|
|
3
|
-
export function isConformant(testInfo) {
|
|
4
|
-
var defaultOptions = {
|
|
5
|
-
asPropHandlesRef: true,
|
|
6
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
|
7
|
-
disabledTests: ['has-docblock'],
|
|
8
|
-
extraTests: makeStylesTests,
|
|
9
|
-
skipAsPropTests: true
|
|
10
|
-
};
|
|
11
|
-
baseIsConformant(defaultOptions, testInfo);
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=isConformant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AAEA,OAAO,eAAP,MAA4B,yCAA5B;AAEA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D,IAAA,aAAa,EAAE,CAAC,cAAD,CAH4C;AAI3D,IAAA,UAAU,EAAE,eAJ+C;AAK3D,IAAA,eAAe,EAAE;AAL0C,GAA7D;AAQA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ComponentState, ComponentProps, IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
|
2
|
-
export declare type ImageSlots = {
|
|
3
|
-
root: IntrinsicShorthandProps<'img'>;
|
|
4
|
-
};
|
|
5
|
-
export 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;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { ImageProps, ImageSlots, ImageState } from './Image.types';
|
|
3
|
-
export declare const imageShorthandProps: Array<keyof ImageSlots>;
|
|
4
|
-
/**
|
|
5
|
-
* Given user props, returns state and render function for an Image.
|
|
6
|
-
*/
|
|
7
|
-
export declare const useImage: (props: ImageProps, ref: React.Ref<HTMLImageElement>) => ImageState;
|
package/lib/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Image';
|
package/lib-commonjs/Image.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Image/index';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.isConformant = void 0;
|
|
7
|
-
|
|
8
|
-
var react_conformance_1 = /*#__PURE__*/require("@fluentui/react-conformance");
|
|
9
|
-
|
|
10
|
-
var react_conformance_make_styles_1 = /*#__PURE__*/require("@fluentui/react-conformance-make-styles");
|
|
11
|
-
|
|
12
|
-
function isConformant(testInfo) {
|
|
13
|
-
var defaultOptions = {
|
|
14
|
-
asPropHandlesRef: true,
|
|
15
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
|
16
|
-
disabledTests: ['has-docblock'],
|
|
17
|
-
extraTests: react_conformance_make_styles_1.default,
|
|
18
|
-
skipAsPropTests: true
|
|
19
|
-
};
|
|
20
|
-
react_conformance_1.isConformant(defaultOptions, testInfo);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
exports.isConformant = isConformant;
|
|
24
|
-
//# sourceMappingURL=isConformant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAEA,IAAA,+BAAA,gBAAA,OAAA,CAAA,yCAAA,CAAA;;AAEA,SAAgB,YAAhB,CACE,QADF,EAC2F;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D,IAAA,aAAa,EAAE,CAAC,cAAD,CAH4C;AAI3D,IAAA,UAAU,EAAE,+BAAA,CAAA,OAJ+C;AAK3D,IAAA,eAAe,EAAE;AAL0C,GAA7D;AAQA,EAAA,mBAAA,CAAA,YAAA,CAAiB,cAAjB,EAAiC,QAAjC;AACD;;AAZD,OAAA,CAAA,YAAA,GAAA,YAAA","sourceRoot":""}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ComponentState, ComponentProps, IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
|
2
|
-
export declare type ImageSlots = {
|
|
3
|
-
root: IntrinsicShorthandProps<'img'>;
|
|
4
|
-
};
|
|
5
|
-
export 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;
|