96 lines
3.2 KiB
JavaScript
96 lines
3.2 KiB
JavaScript
'use client';
|
|
|
|
import { shorthands, mergeClasses, __styles } from '@griffel/react';
|
|
import { tokens } from '@fluentui/react-theme';
|
|
export const imageClassNames = {
|
|
root: 'fui-Image'
|
|
};
|
|
const useStyles = /*#__PURE__*/__styles({
|
|
base: {
|
|
g2u3we: "fj3muxo",
|
|
h3c5rm: ["f1akhkt", "f1lxtadh"],
|
|
B9xav0g: "f1aperda",
|
|
zhjwy3: ["f1lxtadh", "f1akhkt"],
|
|
Beyfa6y: 0,
|
|
Bbmb7ep: 0,
|
|
Btl43ni: 0,
|
|
B7oj6ja: 0,
|
|
Dimara: "f1fabniw",
|
|
B7ck84d: "f1ewtqcl",
|
|
mc9l5x: "f14t3ns0"
|
|
},
|
|
bordered: {
|
|
icvyot: "fzkkow9",
|
|
vrafjx: ["fcdblym", "fjik90z"],
|
|
oivjwe: "fg706s2",
|
|
wvpqe5: ["fjik90z", "fcdblym"],
|
|
B4j52fo: "f192inf7",
|
|
Bekrc4i: ["f5tn483", "f1ojsxk5"],
|
|
Bn0qgzm: "f1vxd6vx",
|
|
ibv6hh: ["f1ojsxk5", "f5tn483"]
|
|
},
|
|
circular: {
|
|
Beyfa6y: 0,
|
|
Bbmb7ep: 0,
|
|
Btl43ni: 0,
|
|
B7oj6ja: 0,
|
|
Dimara: "f44lkw9"
|
|
},
|
|
rounded: {
|
|
Beyfa6y: 0,
|
|
Bbmb7ep: 0,
|
|
Btl43ni: 0,
|
|
B7oj6ja: 0,
|
|
Dimara: "ft85np5"
|
|
},
|
|
square: {},
|
|
shadow: {
|
|
E5pizo: "f1whvlc6"
|
|
},
|
|
center: {
|
|
st4lth: "f1plgu50",
|
|
Ermj5k: "f14xojzb"
|
|
},
|
|
contain: {
|
|
st4lth: "f1kle4es",
|
|
Ermj5k: "f14xojzb"
|
|
},
|
|
"default": {},
|
|
cover: {
|
|
st4lth: "f1ps3kmd",
|
|
Ermj5k: "f14xojzb"
|
|
},
|
|
none: {
|
|
st4lth: "f1plgu50",
|
|
Ermj5k: ["f13uwng7", "fjmyj0p"]
|
|
},
|
|
fitFill: {
|
|
Bqenvij: "f1l02sjl",
|
|
a9b677: "fly5x3f"
|
|
},
|
|
block: {
|
|
a9b677: "fly5x3f"
|
|
}
|
|
}, {
|
|
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);}", [".f1fabniw{border-radius:var(--borderRadiusNone);}", {
|
|
p: -1
|
|
}], ".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);}", [".f44lkw9{border-radius:var(--borderRadiusCircular);}", {
|
|
p: -1
|
|
}], [".ft85np5{border-radius:var(--borderRadiusMedium);}", {
|
|
p: -1
|
|
}], ".f1whvlc6{box-shadow:var(--shadow4);}", ".f1plgu50{object-fit:none;}", ".f14xojzb{object-position:center;}", ".f1kle4es{object-fit:contain;}", ".f1ps3kmd{object-fit:cover;}", ".f13uwng7{object-position:left top;}", ".fjmyj0p{object-position:right top;}", ".f1l02sjl{height:100%;}", ".fly5x3f{width:100%;}"]
|
|
});
|
|
export const useImageStyles_unstable = state => {
|
|
'use no memo';
|
|
|
|
const styles = useStyles();
|
|
const {
|
|
height,
|
|
width
|
|
} = state.root;
|
|
// eslint-disable-next-line eqeqeq
|
|
const hasExplicitSize = height != null || width != null;
|
|
const shouldApplyFitFill = state.fit !== 'default' && !hasExplicitSize;
|
|
state.root.className = mergeClasses(imageClassNames.root, styles.base, state.block && styles.block, state.bordered && styles.bordered, state.shadow && styles.shadow, styles[state.fit], shouldApplyFitFill && styles.fitFill, styles[state.shape], state.root.className);
|
|
return state;
|
|
}; |