{"version":3,"sources":["../../../../src/components/Rating/RatingItem/useRatingItem.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useRatingItemBase_unstable } from '@fluentui/react-rating';\n\nimport type { RatingItemProps, RatingItemState } from './RatingItem.types';\n\n/**\n * Returns the state for a RatingItem component, given its props and ref.\n * The returned state can be modified with hooks before being passed to `renderRatingItem`.\n */\nexport const useRatingItem = (props: RatingItemProps, ref: React.Ref<HTMLSpanElement>): RatingItemState => {\n  const state: RatingItemState = useRatingItemBase_unstable(props, ref);\n\n  let appearance: RatingItemState['root']['data-appearance'];\n  if (state.iconFillWidth === 1) {\n    appearance = 'filled';\n  } else if (state.iconFillWidth > 0) {\n    appearance = 'filled-half';\n  } else {\n    appearance = 'outline';\n  }\n\n  // eslint-disable-next-line react-hooks/immutability\n  state.root['data-appearance'] = appearance;\n\n  return state;\n};\n"],"names":["useRatingItem","props","ref","state","useRatingItemBase_unstable","appearance","iconFillWidth","root"],"mappings":"AAAA;;;;;+BAWaA;;;eAAAA;;;6BAR8B;AAQpC,MAAMA,gBAAgB,CAACC,OAAwBC;IACpD,MAAMC,QAAyBC,IAAAA,uCAA0B,EAACH,OAAOC;IAEjE,IAAIG;IACJ,IAAIF,MAAMG,aAAa,KAAK,GAAG;QAC7BD,aAAa;IACf,OAAO,IAAIF,MAAMG,aAAa,GAAG,GAAG;QAClCD,aAAa;IACf,OAAO;QACLA,aAAa;IACf;IAEA,oDAAoD;IACpDF,MAAMI,IAAI,CAAC,kBAAkB,GAAGF;IAEhC,OAAOF;AACT"}