@fluentui/react-rating 9.4.0 → 9.4.2

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +25 -2
  2. package/dist/index.d.ts +10 -0
  3. package/lib/components/Rating/Rating.types.js +1 -1
  4. package/lib/components/Rating/Rating.types.js.map +1 -1
  5. package/lib/components/Rating/useRating.js +14 -12
  6. package/lib/components/Rating/useRating.js.map +1 -1
  7. package/lib/components/Rating/useRatingContextValues.js.map +1 -1
  8. package/lib/components/Rating/useRatingStyles.styles.js +1 -0
  9. package/lib/components/Rating/useRatingStyles.styles.js.map +1 -1
  10. package/lib/components/Rating/useRatingStyles.styles.raw.js +1 -0
  11. package/lib/components/Rating/useRatingStyles.styles.raw.js.map +1 -1
  12. package/lib/components/RatingDisplay/RatingDisplay.types.js +1 -1
  13. package/lib/components/RatingDisplay/RatingDisplay.types.js.map +1 -1
  14. package/lib/components/RatingDisplay/useRatingDisplay.js +19 -16
  15. package/lib/components/RatingDisplay/useRatingDisplay.js.map +1 -1
  16. package/lib/components/RatingDisplay/useRatingDisplayContextValues.js.map +1 -1
  17. package/lib/components/RatingDisplay/useRatingDisplayStyles.styles.js +3 -0
  18. package/lib/components/RatingDisplay/useRatingDisplayStyles.styles.js.map +1 -1
  19. package/lib/components/RatingDisplay/useRatingDisplayStyles.styles.raw.js +3 -0
  20. package/lib/components/RatingDisplay/useRatingDisplayStyles.styles.raw.js.map +1 -1
  21. package/lib/components/RatingItem/RatingItem.types.js.map +1 -1
  22. package/lib/components/RatingItem/useRatingItemStyles.styles.js +5 -0
  23. package/lib/components/RatingItem/useRatingItemStyles.styles.js.map +1 -1
  24. package/lib/components/RatingItem/useRatingItemStyles.styles.raw.js +5 -0
  25. package/lib/components/RatingItem/useRatingItemStyles.styles.raw.js.map +1 -1
  26. package/lib/contexts/RatingItemContext.js +2 -3
  27. package/lib/contexts/RatingItemContext.js.map +1 -1
  28. package/lib/index.js +1 -1
  29. package/lib/index.js.map +1 -1
  30. package/lib-commonjs/components/Rating/Rating.types.js +0 -2
  31. package/lib-commonjs/components/Rating/Rating.types.js.map +1 -1
  32. package/lib-commonjs/components/Rating/useRating.js +14 -12
  33. package/lib-commonjs/components/Rating/useRating.js.map +1 -1
  34. package/lib-commonjs/components/Rating/useRatingContextValues.js.map +1 -1
  35. package/lib-commonjs/components/Rating/useRatingStyles.styles.js +1 -0
  36. package/lib-commonjs/components/Rating/useRatingStyles.styles.js.map +1 -1
  37. package/lib-commonjs/components/Rating/useRatingStyles.styles.raw.js +1 -0
  38. package/lib-commonjs/components/Rating/useRatingStyles.styles.raw.js.map +1 -1
  39. package/lib-commonjs/components/RatingDisplay/RatingDisplay.types.js +0 -2
  40. package/lib-commonjs/components/RatingDisplay/RatingDisplay.types.js.map +1 -1
  41. package/lib-commonjs/components/RatingDisplay/useRatingDisplay.js +16 -13
  42. package/lib-commonjs/components/RatingDisplay/useRatingDisplay.js.map +1 -1
  43. package/lib-commonjs/components/RatingDisplay/useRatingDisplayContextValues.js.map +1 -1
  44. package/lib-commonjs/components/RatingDisplay/useRatingDisplayStyles.styles.js +3 -0
  45. package/lib-commonjs/components/RatingDisplay/useRatingDisplayStyles.styles.js.map +1 -1
  46. package/lib-commonjs/components/RatingDisplay/useRatingDisplayStyles.styles.raw.js +3 -0
  47. package/lib-commonjs/components/RatingDisplay/useRatingDisplayStyles.styles.raw.js.map +1 -1
  48. package/lib-commonjs/components/RatingItem/RatingItem.types.js.map +1 -1
  49. package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.js +5 -0
  50. package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.js.map +1 -1
  51. package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.raw.js +5 -0
  52. package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.raw.js.map +1 -1
  53. package/lib-commonjs/contexts/RatingItemContext.js +2 -3
  54. package/lib-commonjs/contexts/RatingItemContext.js.map +1 -1
  55. package/lib-commonjs/index.js +3 -0
  56. package/lib-commonjs/index.js.map +1 -1
  57. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,12 +1,35 @@
1
1
  # Change Log - @fluentui/react-rating
2
2
 
3
- This log was last generated on Thu, 26 Mar 2026 08:10:41 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 26 May 2026 09:33:57 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.4.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.4.2)
8
+
9
+ Tue, 26 May 2026 09:33:57 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.4.1..@fluentui/react-rating_v9.4.2)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-jsx-runtime to v9.4.3 ([PR #36246](https://github.com/microsoft/fluentui/pull/36246) by beachball)
15
+ - Bump @fluentui/react-tabster to v9.26.15 ([PR #36246](https://github.com/microsoft/fluentui/pull/36246) by beachball)
16
+ - Bump @fluentui/react-utilities to v9.26.4 ([PR #36246](https://github.com/microsoft/fluentui/pull/36246) by beachball)
17
+
18
+ ## [9.4.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.4.1)
19
+
20
+ Thu, 23 Apr 2026 14:21:11 GMT
21
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.4.0..@fluentui/react-rating_v9.4.1)
22
+
23
+ ### Patches
24
+
25
+ - fix: add mising base hook export ([PR #35972](https://github.com/microsoft/fluentui/pull/35972) by dmytrokirpa@microsoft.com)
26
+ - Bump @fluentui/react-jsx-runtime to v9.4.2 ([PR #36035](https://github.com/microsoft/fluentui/pull/36035) by beachball)
27
+ - Bump @fluentui/react-tabster to v9.26.14 ([PR #36035](https://github.com/microsoft/fluentui/pull/36035) by beachball)
28
+ - Bump @fluentui/react-utilities to v9.26.3 ([PR #36035](https://github.com/microsoft/fluentui/pull/36035) by beachball)
29
+
7
30
  ## [9.4.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.4.0)
8
31
 
9
- Thu, 26 Mar 2026 08:10:41 GMT
32
+ Thu, 26 Mar 2026 08:12:51 GMT
10
33
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.3.15..@fluentui/react-rating_v9.4.0)
11
34
 
12
35
  ### Minor changes
package/dist/index.d.ts CHANGED
@@ -322,6 +322,16 @@ export declare const useRatingDisplayStyles_unstable: (state: RatingDisplayState
322
322
  */
323
323
  export declare const useRatingItem_unstable: (props: RatingItemProps, ref: React_2.Ref<HTMLSpanElement>) => RatingItemState;
324
324
 
325
+ /**
326
+ * Base hook for RatingItem component. Manages state related to fill width calculation,
327
+ * radio input slots (for ARIA rating interaction), icon slots, and interactive mode —
328
+ * without design props (color, size from context).
329
+ *
330
+ * @param props - props from this instance of RatingItem
331
+ * @param ref - reference to root HTMLElement of RatingItem
332
+ */
333
+ export declare const useRatingItemBase_unstable: (props: RatingItemBaseProps, ref: React_2.Ref<HTMLSpanElement>) => RatingItemBaseState;
334
+
325
335
  /**
326
336
  * Get the value of the RatingContext.
327
337
  */
@@ -1 +1 @@
1
- import * as React from 'react';
1
+ export { };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Rating/Rating.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, EventData, EventHandler, Slot } from '@fluentui/react-utilities';\nimport { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport type RatingSlots = {\n root: NonNullable<Slot<'div'>>;\n};\n\n/**\n * Rating Props\n */\nexport type RatingProps = Omit<ComponentProps<Partial<RatingSlots>>, 'onChange'> & {\n /**\n * Controls the color of the Rating.\n * @default neutral\n */\n color?: 'brand' | 'marigold' | 'neutral';\n /**\n * Default value of the Rating\n */\n defaultValue?: number;\n /**\n * The icon to display when the rating value is greater than or equal to the item's value.\n */\n iconFilled?: React.ElementType;\n /**\n * The icon to display when the rating value is less than the item's value.\n */\n iconOutline?: React.ElementType;\n /**\n * Prop to generate the aria-label for the rating inputs.\n * @default (rating) =\\> `${rating}`\n */\n itemLabel?: (rating: number) => string;\n /**\n * The max value of the rating. This controls the number of rating items displayed.\n * Must be a whole number greater than 1.\n * @default 5\n */\n max?: number;\n /**\n * Name for the Radio inputs. If not provided, one will be automatically generated\n */\n name?: string;\n /**\n * Callback when the rating value is changed by the user.\n */\n onChange?: EventHandler<RatingOnChangeEventData>;\n /**\n * Sets the precision to allow half-filled shapes in Rating\n * @default 1\n */\n step?: 0.5 | 1;\n /**\n * Sets the size of the Rating items.\n * @default extra-large\n */\n size?: 'small' | 'medium' | 'large' | 'extra-large';\n /**\n * The value of the rating\n */\n value?: number;\n};\n\n/**\n * Data for the onChange event for Rating.\n */\nexport type RatingOnChangeEventData = EventData<'change', React.FormEvent<HTMLDivElement>> & {\n /**\n * The new value of the rating.\n */\n value: number;\n};\n\n/**\n * Rating base props — excludes design props (color, size).\n */\nexport type RatingBaseProps = Omit<RatingProps, 'color' | 'size'>;\n\n/**\n * State used in rendering Rating\n */\nexport type RatingState = ComponentState<RatingSlots> &\n Required<Pick<RatingProps, 'color' | 'iconFilled' | 'iconOutline' | 'name' | 'step' | 'size' | 'value'>> &\n Pick<RatingProps, 'itemLabel'> & {\n hoveredValue?: number | undefined;\n };\n\n/**\n * Rating base state — excludes design props (color, size).\n */\nexport type RatingBaseState = Omit<RatingState, 'color' | 'size'>;\n\nexport type RatingContextValues = {\n ratingItem: RatingItemContextValue;\n};\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["../src/components/Rating/Rating.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { ComponentProps, ComponentState, EventData, EventHandler, Slot } from '@fluentui/react-utilities';\nimport type { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport type RatingSlots = {\n root: NonNullable<Slot<'div'>>;\n};\n\n/**\n * Rating Props\n */\nexport type RatingProps = Omit<ComponentProps<Partial<RatingSlots>>, 'onChange'> & {\n /**\n * Controls the color of the Rating.\n * @default neutral\n */\n color?: 'brand' | 'marigold' | 'neutral';\n /**\n * Default value of the Rating\n */\n defaultValue?: number;\n /**\n * The icon to display when the rating value is greater than or equal to the item's value.\n */\n iconFilled?: React.ElementType;\n /**\n * The icon to display when the rating value is less than the item's value.\n */\n iconOutline?: React.ElementType;\n /**\n * Prop to generate the aria-label for the rating inputs.\n * @default (rating) =\\> `${rating}`\n */\n itemLabel?: (rating: number) => string;\n /**\n * The max value of the rating. This controls the number of rating items displayed.\n * Must be a whole number greater than 1.\n * @default 5\n */\n max?: number;\n /**\n * Name for the Radio inputs. If not provided, one will be automatically generated\n */\n name?: string;\n /**\n * Callback when the rating value is changed by the user.\n */\n onChange?: EventHandler<RatingOnChangeEventData>;\n /**\n * Sets the precision to allow half-filled shapes in Rating\n * @default 1\n */\n step?: 0.5 | 1;\n /**\n * Sets the size of the Rating items.\n * @default extra-large\n */\n size?: 'small' | 'medium' | 'large' | 'extra-large';\n /**\n * The value of the rating\n */\n value?: number;\n};\n\n/**\n * Data for the onChange event for Rating.\n */\nexport type RatingOnChangeEventData = EventData<'change', React.FormEvent<HTMLDivElement>> & {\n /**\n * The new value of the rating.\n */\n value: number;\n};\n\n/**\n * Rating base props — excludes design props (color, size).\n */\nexport type RatingBaseProps = Omit<RatingProps, 'color' | 'size'>;\n\n/**\n * State used in rendering Rating\n */\nexport type RatingState = ComponentState<RatingSlots> &\n Required<Pick<RatingProps, 'color' | 'iconFilled' | 'iconOutline' | 'name' | 'step' | 'size' | 'value'>> &\n Pick<RatingProps, 'itemLabel'> & {\n hoveredValue?: number | undefined;\n };\n\n/**\n * Rating base state — excludes design props (color, size).\n */\nexport type RatingBaseState = Omit<RatingState, 'color' | 'size'>;\n\nexport type RatingContextValues = {\n ratingItem: RatingItemContextValue;\n};\n"],"names":[],"mappings":"AA6FA,WAEE"}
@@ -12,12 +12,24 @@ import { StarFilled, StarRegular } from '@fluentui/react-icons';
12
12
  * @param props - props from this instance of Rating
13
13
  * @param ref - reference to root HTMLElement of Rating
14
14
  */ export const useRating_unstable = (props, ref)=>{
15
- const { color = 'neutral', size = 'extra-large', iconFilled = StarFilled, iconOutline = StarRegular, ...baseProps } = props;
15
+ var _state_root;
16
+ const { color = 'neutral', size = 'extra-large', iconFilled = StarFilled, iconOutline = StarRegular, max = 5, ...baseProps } = props;
16
17
  const state = useRatingBase_unstable({
17
18
  iconFilled,
18
19
  iconOutline,
19
20
  ...baseProps
20
21
  }, ref);
22
+ // Generate the child RatingItems and memoize them to prevent unnecessary re-rendering
23
+ const rootChildren = React.useMemo(()=>{
24
+ return Array.from(Array(max), (_, i)=>/*#__PURE__*/ React.createElement(RatingItem, {
25
+ value: i + 1,
26
+ key: i + 1
27
+ }));
28
+ }, [
29
+ max
30
+ ]);
31
+ var _children;
32
+ (_children = (_state_root = state.root).children) !== null && _children !== void 0 ? _children : _state_root.children = rootChildren;
21
33
  return {
22
34
  ...state,
23
35
  color,
@@ -33,7 +45,7 @@ import { StarFilled, StarRegular } from '@fluentui/react-icons';
33
45
  * @param ref - reference to root HTMLElement of Rating
34
46
  */ export const useRatingBase_unstable = (props, ref)=>{
35
47
  const generatedName = useId('rating-');
36
- const { iconFilled = 'span', iconOutline = 'span', max = 5, name = generatedName, onChange, step = 1, itemLabel } = props;
48
+ const { iconFilled = 'span', iconOutline = 'span', name = generatedName, onChange, step = 1, itemLabel } = props;
37
49
  const [value, setValue] = useControllableState({
38
50
  state: props.value,
39
51
  defaultState: props.defaultValue,
@@ -43,15 +55,6 @@ import { StarFilled, StarRegular } from '@fluentui/react-icons';
43
55
  constructorName: 'HTMLInputElement'
44
56
  }) && target.type === 'radio' && target.name === name;
45
57
  const [hoveredValue, setHoveredValue] = React.useState(undefined);
46
- // Generate the child RatingItems and memoize them to prevent unnecessary re-rendering
47
- const rootChildren = React.useMemo(()=>{
48
- return Array.from(Array(max), (_, i)=>/*#__PURE__*/ React.createElement(RatingItem, {
49
- value: i + 1,
50
- key: i + 1
51
- }));
52
- }, [
53
- max
54
- ]);
55
58
  const state = {
56
59
  iconFilled,
57
60
  iconOutline,
@@ -65,7 +68,6 @@ import { StarFilled, StarRegular } from '@fluentui/react-icons';
65
68
  },
66
69
  root: slot.always(getIntrinsicElementProps('div', {
67
70
  ref,
68
- children: rootChildren,
69
71
  role: 'radiogroup',
70
72
  ...props
71
73
  }, [
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Rating/useRating.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n getIntrinsicElementProps,\n isHTMLElement,\n mergeCallbacks,\n slot,\n useControllableState,\n useId,\n} from '@fluentui/react-utilities';\nimport type { RatingBaseProps, RatingBaseState, RatingProps, RatingState } from './Rating.types';\nimport { RatingItem } from '../../RatingItem';\nimport { StarFilled, StarRegular } from '@fluentui/react-icons';\n\n/**\n * Create the state required to render Rating.\n *\n * The returned state can be modified with hooks such as useRatingStyles_unstable,\n * before being passed to renderRating_unstable.\n *\n * @param props - props from this instance of Rating\n * @param ref - reference to root HTMLElement of Rating\n */\nexport const useRating_unstable = (props: RatingProps, ref: React.Ref<HTMLDivElement>): RatingState => {\n const {\n color = 'neutral',\n size = 'extra-large',\n iconFilled = StarFilled,\n iconOutline = StarRegular,\n ...baseProps\n } = props;\n const state = useRatingBase_unstable(\n {\n iconFilled,\n iconOutline,\n ...baseProps,\n },\n ref,\n );\n\n return {\n ...state,\n color,\n size,\n };\n};\n\n/**\n * Base hook for Rating component. Manages state related to controlled/uncontrolled\n * rating value, hover state, radiogroup ARIA role, and keyboard/mouse interaction —\n * without design props (color, size).\n *\n * @param props - props from this instance of Rating (without color, size)\n * @param ref - reference to root HTMLElement of Rating\n */\nexport const useRatingBase_unstable = (props: RatingBaseProps, ref: React.Ref<HTMLDivElement>): RatingBaseState => {\n const generatedName = useId('rating-');\n const {\n iconFilled = 'span',\n iconOutline = 'span',\n max = 5,\n name = generatedName,\n onChange,\n step = 1,\n itemLabel,\n } = props;\n\n const [value, setValue] = useControllableState({\n state: props.value,\n defaultState: props.defaultValue,\n initialState: 0,\n });\n\n const isRatingRadioItem = (target: EventTarget): target is HTMLInputElement =>\n isHTMLElement(target, { constructorName: 'HTMLInputElement' }) && target.type === 'radio' && target.name === name;\n\n const [hoveredValue, setHoveredValue] = React.useState<number | undefined>(undefined);\n\n // Generate the child RatingItems and memoize them to prevent unnecessary re-rendering\n const rootChildren = React.useMemo(() => {\n return Array.from(Array(max), (_, i) => <RatingItem value={i + 1} key={i + 1} />);\n }, [max]);\n\n const state: RatingBaseState = {\n iconFilled,\n iconOutline,\n name,\n step,\n itemLabel,\n value,\n hoveredValue,\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps(\n 'div',\n {\n ref,\n children: rootChildren,\n role: 'radiogroup',\n ...props,\n },\n ['onChange'],\n ),\n { elementType: 'div' },\n ),\n };\n\n state.root.onChange = ev => {\n if (isRatingRadioItem(ev.target)) {\n const newValue = parseFloat(ev.target.value);\n if (!isNaN(newValue)) {\n setValue(newValue);\n onChange?.(ev, { type: 'change', event: ev, value: newValue });\n }\n }\n };\n state.root.onMouseOver = mergeCallbacks(props.onMouseOver, ev => {\n if (isRatingRadioItem(ev.target)) {\n const newValue = parseFloat(ev.target.value);\n if (!isNaN(newValue)) {\n setHoveredValue(newValue);\n }\n }\n });\n state.root.onMouseLeave = mergeCallbacks(props.onMouseLeave, ev => {\n setHoveredValue(undefined);\n });\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","isHTMLElement","mergeCallbacks","slot","useControllableState","useId","RatingItem","StarFilled","StarRegular","useRating_unstable","props","ref","color","size","iconFilled","iconOutline","baseProps","state","useRatingBase_unstable","generatedName","max","name","onChange","step","itemLabel","value","setValue","defaultState","defaultValue","initialState","isRatingRadioItem","target","constructorName","type","hoveredValue","setHoveredValue","useState","undefined","rootChildren","useMemo","Array","from","_","i","key","components","root","always","children","role","elementType","ev","newValue","parseFloat","is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GAAGC,kBAAM,oBAACrC;gBAAWmB,OAAOkB,IAAI;gBAAGC,KAAKD,IAAI;;IAC7E,GAAG;QAACvB;KAAI;IAER,MAAMH,QAAyB;QAC7BH;QACAC;QACAM;QACAE;QACAC;QACAC;QACAS;QACAW,YAAY;YACVC,MAAM;QACR;QACAA,MAAM3C,KAAK4C,MAAM,CACf/C,yBACE,OACA;YACEW;YACAqC,UAAUV;YACVW,MAAM;YACN,GAAGvC,KAAK;QACV,GACA;YAAC;SAAW,GAEd;YAAEwC,aAAa;QAAM;IAEzB;IAEAjC,MAAM6B,IAAI,CAACxB,QAAQ,GAAG6B,CAAAA;QACpB,IAAIrB,kBAAkBqB,GAAGpB,MAAM,GAAG;YAChC,MAAMqB,WAAWC,WAAWF,GAAGpB,MAAM,CAACN,KAAK;YAC3C,IAAI,CAAC6B,MAAMF,WAAW;gBACpB1B,SAAS0B;gBACT9B,qBAAAA,+BAAAA,SAAW6B,IAAI;oBAAElB,MAAM;oBAAUsB,OAAOJ;oBAAI1B,OAAO2B;gBAAS;YAC9D;QACF;IACF;IACAnC,MAAM6B,IAAI,CAACU,WAAW,GAAGtD,eAAeQ,MAAM8C,WAAW,EAAEL,CAAAA;QACzD,IAAIrB,kBAAkBqB,GAAGpB,MAAM,GAAG;YAChC,MAAMqB,WAAWC,WAAWF,GAAGpB,MAAM,CAACN,KAAK;YAC3C,IAAI,CAAC6B,MAAMF,WAAW;gBACpBjB,gBAAgBiB;YAClB;QACF;IACF;IACAnC,MAAM6B,IAAI,CAACW,YAAY,GAAGvD,eAAeQ,MAAM+C,YAAY,EAAEN,CAAAA;QAC3DhB,gBAAgBE;IAClB;IAEA,OAAOpB;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/Rating/useRating.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n getIntrinsicElementProps,\n isHTMLElement,\n mergeCallbacks,\n slot,\n useControllableState,\n useId,\n} from '@fluentui/react-utilities';\nimport type { RatingBaseProps, RatingBaseState, RatingProps, RatingState } from './Rating.types';\nimport { RatingItem } from '../../RatingItem';\nimport { StarFilled, StarRegular } from '@fluentui/react-icons';\n\n/**\n * Create the state required to render Rating.\n *\n * The returned state can be modified with hooks such as useRatingStyles_unstable,\n * before being passed to renderRating_unstable.\n *\n * @param props - props from this instance of Rating\n * @param ref - reference to root HTMLElement of Rating\n */\nexport const useRating_unstable = (props: RatingProps, ref: React.Ref<HTMLDivElement>): RatingState => {\n const {\n color = 'neutral',\n size = 'extra-large',\n iconFilled = StarFilled,\n iconOutline = StarRegular,\n max = 5,\n ...baseProps\n } = props;\n const state = useRatingBase_unstable({ iconFilled, iconOutline, ...baseProps }, ref);\n\n // Generate the child RatingItems and memoize them to prevent unnecessary re-rendering\n const rootChildren = React.useMemo(() => {\n return Array.from(Array(max), (_, i) => <RatingItem value={i + 1} key={i + 1} />);\n }, [max]);\n\n state.root.children ??= rootChildren;\n\n return {\n ...state,\n color,\n size,\n };\n};\n\n/**\n * Base hook for Rating component. Manages state related to controlled/uncontrolled\n * rating value, hover state, radiogroup ARIA role, and keyboard/mouse interaction —\n * without design props (color, size).\n *\n * @param props - props from this instance of Rating (without color, size)\n * @param ref - reference to root HTMLElement of Rating\n */\nexport const useRatingBase_unstable = (props: RatingBaseProps, ref: React.Ref<HTMLDivElement>): RatingBaseState => {\n const generatedName = useId('rating-');\n const { iconFilled = 'span', iconOutline = 'span', name = generatedName, onChange, step = 1, itemLabel } = props;\n\n const [value, setValue] = useControllableState({\n state: props.value,\n defaultState: props.defaultValue,\n initialState: 0,\n });\n\n const isRatingRadioItem = (target: EventTarget): target is HTMLInputElement =>\n isHTMLElement(target, { constructorName: 'HTMLInputElement' }) && target.type === 'radio' && target.name === name;\n\n const [hoveredValue, setHoveredValue] = React.useState<number | undefined>(undefined);\n const state: RatingBaseState = {\n iconFilled,\n iconOutline,\n name,\n step,\n itemLabel,\n value,\n hoveredValue,\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps(\n 'div',\n {\n ref,\n role: 'radiogroup',\n ...props,\n },\n ['onChange'],\n ),\n { elementType: 'div' },\n ),\n };\n\n state.root.onChange = ev => {\n if (isRatingRadioItem(ev.target)) {\n const newValue = parseFloat(ev.target.value);\n if (!isNaN(newValue)) {\n setValue(newValue);\n onChange?.(ev, { type: 'change', event: ev, value: newValue });\n }\n }\n };\n state.root.onMouseOver = mergeCallbacks(props.onMouseOver, ev => {\n if (isRatingRadioItem(ev.target)) {\n const newValue = parseFloat(ev.target.value);\n if (!isNaN(newValue)) {\n setHoveredValue(newValue);\n }\n }\n });\n state.root.onMouseLeave = mergeCallbacks(props.onMouseLeave, ev => {\n setHoveredValue(undefined);\n });\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","isHTMLElement","mergeCallbacks","slot","useControllableState","useId","RatingItem","StarFilled","StarRegular","useRating_unstable","props","ref","state","color","size","iconFilled","iconOutline","max","baseProps","useRatingBase_unstable","rootChildren","useMemo","Array","from","_","i","value","key","root","children","generatedName","name","onChange","step","itemLabel","setValue","defaultState","defaultValue","initialState","isRatingRadioItem","target","constructorName","type","hoveredValue","setHoveredValue","useState","undefined","components","always","role","elementType","ev","newValue","parseFloat","isNaN","event","onMouseOver","onMouseLeave"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,wBAAwB,EACxBC,aAAa,EACbC,cAAc,EACdC,IAAI,EACJC,oBAAoB,EACpBC,KAAK,QACA,4BAA4B;AAEnC,SAASC,UAAU,QAAQ,mBAAmB;AAC9C,SAASC,UAAU,EAAEC,WAAW,QAAQ,wBAAwB;AAEhE;;;;;;;;CAQC,GACD,OAAO,MAAMC,qBAAqB,CAACC,OAAoBC;QAgBrDC;IAfA,MAAM,EACJC,QAAQ,SAAS,EACjBC,OAAO,aAAa,EACpBC,aAAaR,UAAU,EACvBS,cAAcR,WAAW,EACzBS,MAAM,CAAC,EACP,GAAGC,WACJ,GAAGR;IACJ,MAAME,QAAQO,uBAAuB;QAAEJ;QA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GAAGX,MAAM,GAAG;YAChC,MAAMY,WAAWC,WAAWF,GAAGX,MAAM,CAACd,KAAK;YAC3C,IAAI,CAAC4B,MAAMF,WAAW;gBACpBjB,SAASiB;gBACTpB,qBAAAA,+BAAAA,SAAWmB,IAAI;oBAAET,MAAM;oBAAUa,OAAOJ;oBAAIzB,OAAO0B;gBAAS;YAC9D;QACF;IACF;IACAxC,MAAMgB,IAAI,CAAC4B,WAAW,GAAGtD,eAAeQ,MAAM8C,WAAW,EAAEL,CAAAA;QACzD,IAAIZ,kBAAkBY,GAAGX,MAAM,GAAG;YAChC,MAAMY,WAAWC,WAAWF,GAAGX,MAAM,CAACd,KAAK;YAC3C,IAAI,CAAC4B,MAAMF,WAAW;gBACpBR,gBAAgBQ;YAClB;QACF;IACF;IACAxC,MAAMgB,IAAI,CAAC6B,YAAY,GAAGvD,eAAeQ,MAAM+C,YAAY,EAAEN,CAAAA;QAC3DP,gBAAgBE;IAClB;IAEA,OAAOlC;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Rating/useRatingContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { RatingContextValues, RatingState } from './Rating.types';\nimport { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport const useRatingContextValues = (ratingState: RatingState): RatingContextValues => {\n const { color, hoveredValue, iconFilled, iconOutline, itemLabel, name, step, size, value } = ratingState;\n\n const ratingItem = React.useMemo<RatingItemContextValue>(\n () => ({\n color,\n hoveredValue,\n iconFilled,\n iconOutline,\n interactive: true,\n itemLabel,\n name,\n step,\n size,\n value,\n }),\n [color, hoveredValue, iconFilled, iconOutline, itemLabel, name, step, size, value],\n );\n\n return { ratingItem };\n};\n"],"names":["React","useRatingContextValues","ratingState","color","hoveredValue","iconFilled","iconOutline","itemLabel","name","step","size","value","ratingItem","useMemo","interactive"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAI/B,OAAO,MAAMC,yBAAyB,CAACC;IACrC,MAAM,EAAEC,KAAK,EAAEC,YAAY,EAAEC,UAAU,EAAEC,WAAW,EAAEC,SAAS,EAAEC,IAAI,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGT;IAE7F,MAAMU,aAAaZ,MAAMa,OAAO,CAC9B,IAAO,CAAA;YACLV;YACAC;YACAC;YACAC;YACAQ,aAAa;YACbP;YACAC;YACAC;YACAC;YACAC;QACF,CAAA,GACA;QAACR;QAAOC;QAAcC;QAAYC;QAAaC;QAAWC;QAAMC;QAAMC;QAAMC;KAAM;IAGpF,OAAO;QAAEC;IAAW;AACtB,EAAE"}
1
+ {"version":3,"sources":["../src/components/Rating/useRatingContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { RatingContextValues, RatingState } from './Rating.types';\nimport type { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport const useRatingContextValues = (ratingState: RatingState): RatingContextValues => {\n const { color, hoveredValue, iconFilled, iconOutline, itemLabel, name, step, size, value } = ratingState;\n\n const ratingItem = React.useMemo<RatingItemContextValue>(\n () => ({\n color,\n hoveredValue,\n iconFilled,\n iconOutline,\n interactive: true,\n itemLabel,\n name,\n step,\n size,\n value,\n }),\n [color, hoveredValue, iconFilled, iconOutline, itemLabel, name, step, size, value],\n );\n\n return { ratingItem };\n};\n"],"names":["React","useRatingContextValues","ratingState","color","hoveredValue","iconFilled","iconOutline","itemLabel","name","step","size","value","ratingItem","useMemo","interactive"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAI/B,OAAO,MAAMC,yBAAyB,CAACC;IACrC,MAAM,EAAEC,KAAK,EAAEC,YAAY,EAAEC,UAAU,EAAEC,WAAW,EAAEC,SAAS,EAAEC,IAAI,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGT;IAE7F,MAAMU,aAAaZ,MAAMa,OAAO,CAC9B,IAAO,CAAA;YACLV;YACAC;YACAC;YACAC;YACAQ,aAAa;YACbP;YACAC;YACAC;YACAC;YACAC;QACF,CAAA,GACA;QAACR;QAAOC;QAAcC;QAAYC;QAAaC;QAAWC;QAAMC;QAAMC;QAAMC;KAAM;IAGpF,OAAO;QAAEC;IAAW;AACtB,EAAE"}
@@ -15,6 +15,7 @@ export const useRatingStyles_unstable = state => {
15
15
  'use no memo';
16
16
 
17
17
  const rootClassName = useRootClassName();
18
+ // eslint-disable-next-line react-hooks/immutability
18
19
  state.root.className = mergeClasses(ratingClassNames.root, rootClassName, state.root.className);
19
20
  return state;
20
21
  };
@@ -1 +1 @@
1
- {"version":3,"names":["__resetStyles","mergeClasses","ratingClassNames","root","useRootClassName","useRatingStyles_unstable","state","rootClassName","className"],"sources":["useRatingStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, mergeClasses } from '@griffel/react';\nexport const ratingClassNames = {\n root: 'fui-Rating'\n};\n/**\n * Styles for the root slot\n */ const useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap'\n});\n/**\n * Apply styling to the Rating slots based on the state\n */ export const useRatingStyles_unstable = (state)=>{\n 'use no memo';\n const rootClassName = useRootClassName();\n state.root.className = mergeClasses(ratingClassNames.root, rootClassName, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAA0BC,YAAY,QAAQ,gBAAgB;AAC9D,OAAO,MAAMC,gBAAgB,GAAG;EAC5BC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,gBAAgB,gBAAGJ,aAAA,4DAG5B,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMK,wBAAwB,GAAIC,KAAK,IAAG;EACjD,aAAa;;EACb,MAAMC,aAAa,GAAGH,gBAAgB,CAAC,CAAC;EACxCE,KAAK,CAACH,IAAI,CAACK,SAAS,GAAGP,YAAY,CAACC,gBAAgB,CAACC,IAAI,EAAEI,aAAa,EAAED,KAAK,CAACH,IAAI,CAACK,SAAS,CAAC;EAC/F,OAAOF,KAAK;AAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__resetStyles","mergeClasses","ratingClassNames","root","useRootClassName","useRatingStyles_unstable","state","rootClassName","className"],"sources":["useRatingStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, mergeClasses } from '@griffel/react';\nexport const ratingClassNames = {\n root: 'fui-Rating'\n};\n/**\n * Styles for the root slot\n */ const useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap'\n});\n/**\n * Apply styling to the Rating slots based on the state\n */ export const useRatingStyles_unstable = (state)=>{\n 'use no memo';\n const rootClassName = useRootClassName();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(ratingClassNames.root, rootClassName, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAA0BC,YAAY,QAAQ,gBAAgB;AAC9D,OAAO,MAAMC,gBAAgB,GAAG;EAC5BC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,gBAAgB,gBAAGJ,aAAA,4DAG5B,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMK,wBAAwB,GAAIC,KAAK,IAAG;EACjD,aAAa;;EACb,MAAMC,aAAa,GAAGH,gBAAgB,CAAC,CAAC;EACxC;EACAE,KAAK,CAACH,IAAI,CAACK,SAAS,GAAGP,YAAY,CAACC,gBAAgB,CAACC,IAAI,EAAEI,aAAa,EAAED,KAAK,CAACH,IAAI,CAACK,SAAS,CAAC;EAC/F,OAAOF,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -14,6 +14,7 @@ export const ratingClassNames = {
14
14
  */ export const useRatingStyles_unstable = (state)=>{
15
15
  'use no memo';
16
16
  const rootClassName = useRootClassName();
17
+ // eslint-disable-next-line react-hooks/immutability
17
18
  state.root.className = mergeClasses(ratingClassNames.root, rootClassName, state.root.className);
18
19
  return state;
19
20
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Rating/useRatingStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { RatingSlots, RatingState } from './Rating.types';\n\nexport const ratingClassNames: SlotClassNames<RatingSlots> = {\n root: 'fui-Rating',\n};\n\n/**\n * Styles for the root slot\n */\n\nconst useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap',\n});\n\n/**\n * Apply styling to the Rating slots based on the state\n */\nexport const useRatingStyles_unstable = (state: RatingState): RatingState => {\n 'use no memo';\n\n const rootClassName = useRootClassName();\n state.root.className = mergeClasses(ratingClassNames.root, rootClassName, state.root.className);\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","ratingClassNames","root","useRootClassName","display","flexWrap","useRatingStyles_unstable","state","rootClassName","className"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,YAAY,QAAQ,iBAAiB;AAI/D,OAAO,MAAMC,mBAAgD;IAC3DC,MAAM;AACR,EAAE;AAEF;;CAEC,GAED,MAAMC,mBAAmBJ,gBAAgB;IACvCK,SAAS;IACTC,UAAU;AACZ;AAEA;;CAEC,GACD,OAAO,MAAMC,2BAA2B,CAACC;IACvC;IAEA,MAAMC,gBAAgBL;IACtBI,MAAML,IAAI,CAACO,SAAS,GAAGT,aAAaC,iBAAiBC,IAAI,EAAEM,eAAeD,MAAML,IAAI,CAACO,SAAS;IAC9F,OAAOF;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/Rating/useRatingStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { RatingSlots, RatingState } from './Rating.types';\n\nexport const ratingClassNames: SlotClassNames<RatingSlots> = {\n root: 'fui-Rating',\n};\n\n/**\n * Styles for the root slot\n */\n\nconst useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap',\n});\n\n/**\n * Apply styling to the Rating slots based on the state\n */\nexport const useRatingStyles_unstable = (state: RatingState): RatingState => {\n 'use no memo';\n\n const rootClassName = useRootClassName();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(ratingClassNames.root, rootClassName, state.root.className);\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","ratingClassNames","root","useRootClassName","display","flexWrap","useRatingStyles_unstable","state","rootClassName","className"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,YAAY,QAAQ,iBAAiB;AAI/D,OAAO,MAAMC,mBAAgD;IAC3DC,MAAM;AACR,EAAE;AAEF;;CAEC,GAED,MAAMC,mBAAmBJ,gBAAgB;IACvCK,SAAS;IACTC,UAAU;AACZ;AAEA;;CAEC,GACD,OAAO,MAAMC,2BAA2B,CAACC;IACvC;IAEA,MAAMC,gBAAgBL;IACtB,oDAAoD;IACpDI,MAAML,IAAI,CAACO,SAAS,GAAGT,aAAaC,iBAAiBC,IAAI,EAAEM,eAAeD,MAAML,IAAI,CAACO,SAAS;IAC9F,OAAOF;AACT,EAAE"}
@@ -1 +1 @@
1
- import * as React from 'react';
1
+ export { };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/RatingDisplay/RatingDisplay.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport type RatingDisplaySlots = {\n root: NonNullable<Slot<'div'>>;\n valueText?: Slot<'span'>;\n countText?: Slot<'span'>;\n};\n\n/**\n * RatingDisplay Props\n */\nexport type RatingDisplayProps = ComponentProps<RatingDisplaySlots> & {\n /**\n * Color of the rating items (stars).\n * @default neutral\n */\n color?: 'brand' | 'marigold' | 'neutral';\n /**\n * Renders a single filled star, with the value written next to it.\n * @default false\n */\n compact?: boolean;\n /**\n * The number of ratings represented by the rating value.\n * This will be formatted with a thousands separator (if applicable) and displayed next to the value.\n */\n count?: number;\n /**\n * The icon used for rating items.\n * @default StarFilled\n */\n icon?: React.ElementType;\n /**\n * The max value of the rating. This controls the number of rating items displayed.\n * Must be a whole number greater than 1.\n * @default 5\n */\n max?: number;\n /**\n * Sets the size of the RatingDisplay items.\n * @default medium\n */\n size?: 'small' | 'medium' | 'large' | 'extra-large';\n /**\n * The value of the rating\n */\n value?: number;\n};\n\n/**\n * RatingDisplay base props — excludes design props (color, size).\n */\nexport type RatingDisplayBaseProps = Omit<RatingDisplayProps, 'color' | 'size'>;\n\n/**\n * State used in rendering RatingDisplay\n */\nexport type RatingDisplayState = ComponentState<RatingDisplaySlots> &\n Required<Pick<RatingDisplayProps, 'color' | 'compact' | 'icon' | 'max' | 'size'>> &\n Pick<RatingDisplayProps, 'value'>;\n\n/**\n * RatingDisplay base state — excludes design props (color, size).\n */\nexport type RatingDisplayBaseState = Omit<RatingDisplayState, 'color' | 'size' | 'icon'> &\n Pick<RatingDisplayProps, 'icon'>;\n\nexport type RatingDisplayContextValues = { ratingItem: RatingItemContextValue };\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["../src/components/RatingDisplay/RatingDisplay.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport type RatingDisplaySlots = {\n root: NonNullable<Slot<'div'>>;\n valueText?: Slot<'span'>;\n countText?: Slot<'span'>;\n};\n\n/**\n * RatingDisplay Props\n */\nexport type RatingDisplayProps = ComponentProps<RatingDisplaySlots> & {\n /**\n * Color of the rating items (stars).\n * @default neutral\n */\n color?: 'brand' | 'marigold' | 'neutral';\n /**\n * Renders a single filled star, with the value written next to it.\n * @default false\n */\n compact?: boolean;\n /**\n * The number of ratings represented by the rating value.\n * This will be formatted with a thousands separator (if applicable) and displayed next to the value.\n */\n count?: number;\n /**\n * The icon used for rating items.\n * @default StarFilled\n */\n icon?: React.ElementType;\n /**\n * The max value of the rating. This controls the number of rating items displayed.\n * Must be a whole number greater than 1.\n * @default 5\n */\n max?: number;\n /**\n * Sets the size of the RatingDisplay items.\n * @default medium\n */\n size?: 'small' | 'medium' | 'large' | 'extra-large';\n /**\n * The value of the rating\n */\n value?: number;\n};\n\n/**\n * RatingDisplay base props — excludes design props (color, size).\n */\nexport type RatingDisplayBaseProps = Omit<RatingDisplayProps, 'color' | 'size'>;\n\n/**\n * State used in rendering RatingDisplay\n */\nexport type RatingDisplayState = ComponentState<RatingDisplaySlots> &\n Required<Pick<RatingDisplayProps, 'color' | 'compact' | 'icon' | 'max' | 'size'>> &\n Pick<RatingDisplayProps, 'value'>;\n\n/**\n * RatingDisplay base state — excludes design props (color, size).\n */\nexport type RatingDisplayBaseState = Omit<RatingDisplayState, 'color' | 'size' | 'icon'> &\n Pick<RatingDisplayProps, 'icon'>;\n\nexport type RatingDisplayContextValues = { ratingItem: RatingItemContextValue };\n"],"names":[],"mappings":"AAqEA,WAAgF"}
@@ -17,8 +17,27 @@ import { RatingItem } from '../RatingItem/RatingItem';
17
17
  icon,
18
18
  ...baseProps
19
19
  }, ref);
20
+ const { compact, max } = state;
21
+ const rootChildren = React.useMemo(()=>{
22
+ return compact ? /*#__PURE__*/ React.createElement(RatingItem, {
23
+ value: 1,
24
+ key: 1,
25
+ "aria-hidden": true
26
+ }) : Array.from(Array(max), (_, i)=>/*#__PURE__*/ React.createElement(RatingItem, {
27
+ value: i + 1,
28
+ key: i + 1,
29
+ "aria-hidden": true
30
+ }));
31
+ }, [
32
+ compact,
33
+ max
34
+ ]);
20
35
  return {
21
36
  ...state,
37
+ root: {
38
+ children: rootChildren,
39
+ ...state.root
40
+ },
22
41
  icon,
23
42
  color,
24
43
  size
@@ -35,21 +54,6 @@ import { RatingItem } from '../RatingItem/RatingItem';
35
54
  const { count, compact = false, icon, max = 5, value } = props;
36
55
  const valueTextId = useId('rating-value-');
37
56
  const countTextId = useId('rating-count-');
38
- // Generate the child RatingItems and memoize them to prevent unnecessary re-rendering
39
- const rootChildren = React.useMemo(()=>{
40
- return compact ? /*#__PURE__*/ React.createElement(RatingItem, {
41
- value: 1,
42
- key: 1,
43
- "aria-hidden": true
44
- }) : Array.from(Array(max), (_, i)=>/*#__PURE__*/ React.createElement(RatingItem, {
45
- value: i + 1,
46
- key: i + 1,
47
- "aria-hidden": true
48
- }));
49
- }, [
50
- compact,
51
- max
52
- ]);
53
57
  const state = {
54
58
  compact,
55
59
  icon,
@@ -62,7 +66,6 @@ import { RatingItem } from '../RatingItem/RatingItem';
62
66
  },
63
67
  root: slot.always(getIntrinsicElementProps('div', {
64
68
  ref,
65
- children: rootChildren,
66
69
  role: 'img',
67
70
  ...props
68
71
  }), {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/RatingDisplay/useRatingDisplay.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, slot, useId } from '@fluentui/react-utilities';\nimport type {\n RatingDisplayBaseProps,\n RatingDisplayBaseState,\n RatingDisplayProps,\n RatingDisplayState,\n} from './RatingDisplay.types';\nimport { StarFilled } from '@fluentui/react-icons';\nimport { RatingItem } from '../RatingItem/RatingItem';\n\n/**\n * Create the state required to render RatingDisplay.\n *\n * The returned state can be modified with hooks such as useRatingDisplayStyles_unstable,\n * before being passed to renderRatingDisplay_unstable.\n *\n * @param props - props from this instance of RatingDisplay\n * @param ref - reference to root HTMLDivElement of RatingDisplay\n */\nexport const useRatingDisplay_unstable = (\n props: RatingDisplayProps,\n ref: React.Ref<HTMLDivElement>,\n): RatingDisplayState => {\n const { color = 'neutral', size = 'medium', icon = StarFilled, ...baseProps } = props;\n const state = useRatingDisplayBase_unstable({ icon, ...baseProps }, ref);\n\n return {\n ...state,\n icon,\n color,\n size,\n };\n};\n\n/**\n * Base hook for RatingDisplay component. Manages state related to ARIA img role,\n * aria-labelledby composition from valueText/countText IDs, slot structure, and\n * compact/full display modes — without design props (color, size).\n *\n * @param props - props from this instance of RatingDisplay (without color, size)\n * @param ref - reference to root HTMLDivElement of RatingDisplay\n */\nexport const useRatingDisplayBase_unstable = (\n props: RatingDisplayBaseProps,\n ref: React.Ref<HTMLDivElement>,\n): RatingDisplayBaseState => {\n const { count, compact = false, icon, max = 5, value } = props;\n\n const valueTextId = useId('rating-value-');\n const countTextId = useId('rating-count-');\n\n // Generate the child RatingItems and memoize them to prevent unnecessary re-rendering\n const rootChildren = React.useMemo(() => {\n return compact ? (\n <RatingItem value={1} key={1} aria-hidden={true} />\n ) : (\n Array.from(Array(max), (_, i) => <RatingItem value={i + 1} key={i + 1} aria-hidden={true} />)\n );\n }, [compact, max]);\n\n const state: RatingDisplayBaseState = {\n compact,\n icon,\n max,\n value,\n components: {\n root: 'div',\n valueText: 'span',\n countText: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n children: rootChildren,\n role: 'img',\n ...props,\n }),\n { elementType: 'div' },\n ),\n valueText: slot.optional(props.valueText, {\n renderByDefault: value !== undefined,\n defaultProps: { children: value, id: valueTextId, 'aria-hidden': true },\n elementType: 'span',\n }),\n countText: slot.optional(props.countText, {\n renderByDefault: count !== undefined,\n defaultProps: { children: count?.toLocaleString(), id: countTextId, 'aria-hidden': true },\n elementType: 'span',\n }),\n };\n if (!state.root['aria-label'] && !state.root['aria-labelledby']) {\n state.root['aria-labelledby'] = [state.valueText?.id, state.countText?.id].filter(Boolean).join(' ');\n }\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","slot","useId","StarFilled","RatingItem","useRatingDisplay_unstable","props","ref","color","size","icon","baseProps","state","useRatingDisplayBase_unstable","count","compact","max","value","valueTextId","countTextId","rootChildren","useMemo","key","aria-hidden","Array","from","_","i","components","root","valueText","countText","always","children","role","elementType","optional","renderByDefault","undefined","defaultProps","id","toLocaleString","filter","Boolean","join"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,EAAEC,KAAK,QAAQ,4BAA4B;AAOlF,SAASC,UAAU,QAAQ,wBAAw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EiB,aAAa;QACf;QACAJ,WAAW9B,KAAKmC,QAAQ,CAAC9B,MAAMyB,SAAS,EAAE;YACxCM,iBAAiBvB,UAAUwB;YAC3BC,cAAc;gBAAEN,QAAQ,EAAEnB,kBAAAA,4BAAAA,MAAO2B,cAAc;gBAAID,IAAIrB;gBAAa,eAAe;YAAK;YACxFgB,aAAa;QACf;IACF;IACA,IAAI,CAACvB,MAAMiB,IAAI,CAAC,aAAa,IAAI,CAACjB,MAAMiB,IAAI,CAAC,kBAAkB,EAAE;YAC9BjB,kBAAqBA;QAAtDA,MAAMiB,IAAI,CAAC,kBAAkB,GAAG;aAACjB,mBAAAA,MAAMkB,SAAS,cAAflB,uCAAAA,iBAAiB4B,EAAE;aAAE5B,mBAAAA,MAAMmB,SAAS,cAAfnB,uCAAAA,iBAAiB4B,EAAE;SAAC,CAACE,MAAM,CAACC,SAASC,IAAI,CAAC;IAClG;IACA,OAAOhC;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/RatingDisplay/useRatingDisplay.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, slot, useId } from '@fluentui/react-utilities';\nimport type {\n RatingDisplayBaseProps,\n RatingDisplayBaseState,\n RatingDisplayProps,\n RatingDisplayState,\n} from './RatingDisplay.types';\nimport { StarFilled } from '@fluentui/react-icons';\nimport { RatingItem } from '../RatingItem/RatingItem';\n\n/**\n * Create the state required to render RatingDisplay.\n *\n * The returned state can be modified with hooks such as useRatingDisplayStyles_unstable,\n * before being passed to renderRatingDisplay_unstable.\n *\n * @param props - props from this instance of RatingDisplay\n * @param ref - reference to root HTMLDivElement of RatingDisplay\n */\nexport const useRatingDisplay_unstable = (\n props: RatingDisplayProps,\n ref: React.Ref<HTMLDivElement>,\n): RatingDisplayState => {\n const { color = 'neutral', size = 'medium', icon = StarFilled, ...baseProps } = props;\n const state = useRatingDisplayBase_unstable({ icon, ...baseProps }, ref);\n\n const { compact, max } = state;\n\n const rootChildren = React.useMemo(() => {\n return compact ? (\n <RatingItem value={1} key={1} aria-hidden={true} />\n ) : (\n Array.from(Array(max), (_, i) => <RatingItem value={i + 1} key={i + 1} aria-hidden={true} />)\n );\n }, [compact, max]);\n\n return {\n ...state,\n root: {\n children: rootChildren,\n ...state.root,\n },\n icon,\n color,\n size,\n };\n};\n\n/**\n * Base hook for RatingDisplay component. Manages state related to ARIA img role,\n * aria-labelledby composition from valueText/countText IDs, slot structure, and\n * compact/full display modes — without design props (color, size).\n *\n * @param props - props from this instance of RatingDisplay (without color, size)\n * @param ref - reference to root HTMLDivElement of RatingDisplay\n */\nexport const useRatingDisplayBase_unstable = (\n props: RatingDisplayBaseProps,\n ref: React.Ref<HTMLDivElement>,\n): RatingDisplayBaseState => {\n const { count, compact = false, icon, max = 5, value } = props;\n\n const valueTextId = useId('rating-value-');\n const countTextId = useId('rating-count-');\n\n const state: RatingDisplayBaseState = {\n compact,\n icon,\n max,\n value,\n components: {\n root: 'div',\n valueText: 'span',\n countText: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n role: 'img',\n ...props,\n }),\n { elementType: 'div' },\n ),\n valueText: slot.optional(props.valueText, {\n renderByDefault: value !== undefined,\n defaultProps: { children: value, id: valueTextId, 'aria-hidden': true },\n elementType: 'span',\n }),\n countText: slot.optional(props.countText, {\n renderByDefault: count !== undefined,\n defaultProps: { children: count?.toLocaleString(), id: countTextId, 'aria-hidden': true },\n elementType: 'span',\n }),\n };\n if (!state.root['aria-label'] && !state.root['aria-labelledby']) {\n state.root['aria-labelledby'] = [state.valueText?.id, state.countText?.id].filter(Boolean).join(' ');\n }\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","slot","useId","StarFilled","RatingItem","useRatingDisplay_unstable","props","ref","color","size","icon","baseProps","state","useRatingDisplayBase_unstable","compact","max","rootChildren","useMemo","value","key","aria-hidden","Array","from","_","i","root","children","count","valueTextId","countTextId","components","valueText","countText","always","role","elementType","optional","renderByDefault","undefined","defaultProps","id","toL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yBAAyB,OAAO;YAC9BO;YACA2B,MAAM;YACN,GAAG5B,KAAK;QACV,IACA;YAAE6B,aAAa;QAAM;QAEvBJ,WAAW9B,KAAKmC,QAAQ,CAAC9B,MAAMyB,SAAS,EAAE;YACxCM,iBAAiBnB,UAAUoB;YAC3BC,cAAc;gBAAEb,UAAUR;gBAAOsB,IAAIZ;gBAAa,eAAe;YAAK;YACtEO,aAAa;QACf;QACAH,WAAW/B,KAAKmC,QAAQ,CAAC9B,MAAM0B,SAAS,EAAE;YACxCK,iBAAiBV,UAAUW;YAC3BC,cAAc;gBAAEb,QAAQ,EAAEC,kBAAAA,4BAAAA,MAAOc,cAAc;gBAAID,IAAIX;gBAAa,eAAe;YAAK;YACxFM,aAAa;QACf;IACF;IACA,IAAI,CAACvB,MAAMa,IAAI,CAAC,aAAa,IAAI,CAACb,MAAMa,IAAI,CAAC,kBAAkB,EAAE;YAC9Bb,kBAAqBA;QAAtDA,MAAMa,IAAI,CAAC,kBAAkB,GAAG;aAACb,mBAAAA,MAAMmB,SAAS,cAAfnB,uCAAAA,iBAAiB4B,EAAE;aAAE5B,mBAAAA,MAAMoB,SAAS,cAAfpB,uCAAAA,iBAAiB4B,EAAE;SAAC,CAACE,MAAM,CAACC,SAASC,IAAI,CAAC;IAClG;IACA,OAAOhC;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/RatingDisplay/useRatingDisplayContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { RatingDisplayContextValues, RatingDisplayState } from './RatingDisplay.types';\nimport { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport const useRatingDisplayContextValues = (state: RatingDisplayState): RatingDisplayContextValues => {\n const { color, compact, icon, size, value } = state;\n\n const ratingItem = React.useMemo<RatingItemContextValue>(\n () => ({\n color,\n compact,\n iconFilled: icon,\n iconOutline: icon,\n interactive: false,\n step: 0.5,\n size,\n value,\n }),\n [color, compact, icon, size, value],\n );\n\n return { ratingItem };\n};\n"],"names":["React","useRatingDisplayContextValues","state","color","compact","icon","size","value","ratingItem","useMemo","iconFilled","iconOutline","interactive","step"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAI/B,OAAO,MAAMC,gCAAgC,CAACC;IAC5C,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGL;IAE9C,MAAMM,aAAaR,MAAMS,OAAO,CAC9B,IAAO,CAAA;YACLN;YACAC;YACAM,YAAYL;YACZM,aAAaN;YACbO,aAAa;YACbC,MAAM;YACNP;YACAC;QACF,CAAA,GACA;QAACJ;QAAOC;QAASC;QAAMC;QAAMC;KAAM;IAGrC,OAAO;QAAEC;IAAW;AACtB,EAAE"}
1
+ {"version":3,"sources":["../src/components/RatingDisplay/useRatingDisplayContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { RatingDisplayContextValues, RatingDisplayState } from './RatingDisplay.types';\nimport type { RatingItemContextValue } from '../RatingItem/RatingItem.types';\n\nexport const useRatingDisplayContextValues = (state: RatingDisplayState): RatingDisplayContextValues => {\n const { color, compact, icon, size, value } = state;\n\n const ratingItem = React.useMemo<RatingItemContextValue>(\n () => ({\n color,\n compact,\n iconFilled: icon,\n iconOutline: icon,\n interactive: false,\n step: 0.5,\n size,\n value,\n }),\n [color, compact, icon, size, value],\n );\n\n return { ratingItem };\n};\n"],"names":["React","useRatingDisplayContextValues","state","color","compact","icon","size","value","ratingItem","useMemo","iconFilled","iconOutline","interactive","step"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAI/B,OAAO,MAAMC,gCAAgC,CAACC;IAC5C,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGL;IAE9C,MAAMM,aAAaR,MAAMS,OAAO,CAC9B,IAAO,CAAA;YACLN;YACAC;YACAM,YAAYL;YACZM,aAAaN;YACbO,aAAa;YACbC,MAAM;YACNP;YACAC;QACF,CAAA,GACA;QAACJ;QAAOC;QAASC;QAAMC;QAAMC;KAAM;IAGrC,OAAO;QAAEC;IAAW;AACtB,EAAE"}
@@ -42,13 +42,16 @@ export const useRatingDisplayStyles_unstable = state => {
42
42
  size
43
43
  } = state;
44
44
  const rootClassName = useRootClassName();
45
+ // eslint-disable-next-line react-hooks/immutability
45
46
  state.root.className = mergeClasses(ratingDisplayClassNames.root, rootClassName, state.root.className);
46
47
  const labelClassName = useLabelClassName();
47
48
  const labelStyles = useLabelStyles();
48
49
  if (state.valueText) {
50
+ // eslint-disable-next-line react-hooks/immutability
49
51
  state.valueText.className = mergeClasses(ratingDisplayClassNames.valueText, labelClassName, labelStyles.strong, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText.className);
50
52
  }
51
53
  if (state.countText) {
54
+ // eslint-disable-next-line react-hooks/immutability
52
55
  state.countText.className = mergeClasses(ratingDisplayClassNames.countText, labelClassName, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText && labelStyles.divider, state.countText.className);
53
56
  }
54
57
  return state;
@@ -1 +1 @@
1
- {"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","typographyStyles","ratingDisplayClassNames","root","valueText","countText","useRootClassName","useLabelClassName","useLabelStyles","large","Be2twd7","Bg96gwp","Frg6f3","extraLarge","strong","Bhrd7zp","divider","Ftih45","d","useRatingDisplayStyles_unstable","state","size","rootClassName","className","labelClassName","labelStyles"],"sources":["useRatingDisplayStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const ratingDisplayClassNames = {\n root: 'fui-RatingDisplay',\n valueText: 'fui-RatingDisplay__valueText',\n countText: 'fui-RatingDisplay__countText'\n};\n/**\n * Styles for the root slot\n */ const useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center'\n});\nconst useLabelClassName = makeResetStyles({\n color: tokens.colorNeutralForeground1,\n marginLeft: tokens.spacingHorizontalXS,\n ...typographyStyles.caption1\n});\nconst useLabelStyles = makeStyles({\n large: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n marginLeft: tokens.spacingHorizontalSNudge\n },\n extraLarge: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n marginLeft: tokens.spacingHorizontalS\n },\n strong: {\n fontWeight: tokens.fontWeightSemibold\n },\n divider: {\n '::before': {\n content: '\"· \"'\n }\n }\n});\n/**\n * Apply styling to the RatingDisplay slots based on the state\n */ export const useRatingDisplayStyles_unstable = (state)=>{\n 'use no memo';\n const { size } = state;\n const rootClassName = useRootClassName();\n state.root.className = mergeClasses(ratingDisplayClassNames.root, rootClassName, state.root.className);\n const labelClassName = useLabelClassName();\n const labelStyles = useLabelStyles();\n if (state.valueText) {\n state.valueText.className = mergeClasses(ratingDisplayClassNames.valueText, labelClassName, labelStyles.strong, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText.className);\n }\n if (state.countText) {\n state.countText.className = mergeClasses(ratingDisplayClassNames.countText, labelClassName, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText && labelStyles.divider, state.countText.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,OAAO,MAAMC,uBAAuB,GAAG;EACnCC,IAAI,EAAE,mBAAmB;EACzBC,SAAS,EAAE,8BAA8B;EACzCC,SAAS,EAAE;AACf,CAAC;AACD;AACA;AACA;AAAI,MAAMC,gBAAgB,gBAAGT,aAAA,+EAI5B,CAAC;AACF,MAAMU,iBAAiB,gBAAGV,aAAA,seAIzB,CAAC;AACF,MAAMW,c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T,OAAO,EAAEI,KAAK,CAACf,SAAS,CAACkB,SAAS,CAAC;EAC3P;EACA,OAAOH,KAAK;AAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","typographyStyles","ratingDisplayClassNames","root","valueText","countText","useRootClassName","useLabelClassName","useLabelStyles","large","Be2twd7","Bg96gwp","Frg6f3","extraLarge","strong","Bhrd7zp","divider","Ftih45","d","useRatingDisplayStyles_unstable","state","size","rootClassName","className","labelClassName","labelStyles"],"sources":["useRatingDisplayStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const ratingDisplayClassNames = {\n root: 'fui-RatingDisplay',\n valueText: 'fui-RatingDisplay__valueText',\n countText: 'fui-RatingDisplay__countText'\n};\n/**\n * Styles for the root slot\n */ const useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center'\n});\nconst useLabelClassName = makeResetStyles({\n color: tokens.colorNeutralForeground1,\n marginLeft: tokens.spacingHorizontalXS,\n ...typographyStyles.caption1\n});\nconst useLabelStyles = makeStyles({\n large: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n marginLeft: tokens.spacingHorizontalSNudge\n },\n extraLarge: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n marginLeft: tokens.spacingHorizontalS\n },\n strong: {\n fontWeight: tokens.fontWeightSemibold\n },\n divider: {\n '::before': {\n content: '\"· \"'\n }\n }\n});\n/**\n * Apply styling to the RatingDisplay slots based on the state\n */ export const useRatingDisplayStyles_unstable = (state)=>{\n 'use no memo';\n const { size } = state;\n const rootClassName = useRootClassName();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(ratingDisplayClassNames.root, rootClassName, state.root.className);\n const labelClassName = useLabelClassName();\n const labelStyles = useLabelStyles();\n if (state.valueText) {\n // eslint-disable-next-line react-hooks/immutability\n state.valueText.className = mergeClasses(ratingDisplayClassNames.valueText, labelClassName, labelStyles.strong, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText.className);\n }\n if (state.countText) {\n // eslint-disable-next-line react-hooks/immutability\n state.countText.className = mergeClasses(ratingDisplayClassNames.countText, labelClassName, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText && labelStyles.divider, state.countText.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,OAAO,MAAMC,uBAAuB,GAAG;EACnCC,IAAI,EAAE,mBAAmB;EACzBC,SAAS,EAAE,8BAA8B;EACzCC,SAAS,EAAE;AACf,CAAC;AACD;AACA;AACA;AAAI,MAAMC,gBAAgB,gBAAGT,aAAA,+EAI5B,CAAC;AACF,MAAMU,iBAAiB,gBAAGV,aAAA,seAIzB,CAAC;AACF,MAAMW,cAAc,gBAAGV,QAAA;EAAAW,KAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,UAAA;IAAAH,OAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAE,MAAA;IAAAC,OAAA;EAAA;EAAAC,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAmBtB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,+BAA+B,GAAIC,KAAK,IAAG;EACxD,aAAa;;EACb,MAAM;IAAEC;EAAK,CAAC,GAAGD,KAAK;EACtB,MAAME,aAAa,GAAGhB,gBAAgB,CAAC,CAAC;EACxC;EACAc,KAAK,CAACjB,IAAI,CAACoB,SAAS,GAAGxB,YAAY,CAACG,uBAAuB,CAACC,IAAI,EAAEmB,aAAa,EAAEF,KAAK,CAACjB,IAAI,CAACoB,SAAS,CAAC;EACtG,MAAMC,cAAc,GAAGjB,iBAAiB,CAAC,CAAC;EAC1C,MAAMkB,WAAW,GAAGjB,cAAc,CAAC,CAAC;EACpC,IAAIY,KAAK,CAAChB,SAAS,EAAE;IACjB;IACAgB,KAAK,CAAChB,SAAS,CAACmB,SAAS,GAAGxB,YAAY,CAACG,uBAAuB,CAACE,SAAS,EAAEoB,cAAc,EAAEC,WAAW,CAACX,MAAM,EAAEO,IAAI,KAAK,OAAO,IAAII,WAAW,CAAChB,KAAK,EAAEY,IAAI,KAAK,aAAa,IAAII,WAAW,CAACZ,UAAU,EAAEO,KAAK,CAAChB,SAAS,CAACmB,SAAS,CAAC;EACvO;EACA,IAAIH,KAAK,CAACf,SAAS,EAAE;IACjB;IACAe,KAAK,CAACf,SAAS,CAACkB,SAAS,GAAGxB,YAAY,CAACG,uBAAuB,CAACG,SAAS,EAAEmB,cAAc,EAAEH,IAAI,KAAK,OAAO,IAAII,WAAW,CAAChB,KAAK,EAAEY,IAAI,KAAK,aAAa,IAAII,WAAW,CAACZ,UAAU,EAAEO,KAAK,CAAChB,SAAS,IAAIqB,WAAW,CAACT,OAAO,EAAEI,KAAK,CAACf,SAAS,CAACkB,SAAS,CAAC;EAC3P;EACA,OAAOH,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -44,13 +44,16 @@ const useLabelStyles = makeStyles({
44
44
  'use no memo';
45
45
  const { size } = state;
46
46
  const rootClassName = useRootClassName();
47
+ // eslint-disable-next-line react-hooks/immutability
47
48
  state.root.className = mergeClasses(ratingDisplayClassNames.root, rootClassName, state.root.className);
48
49
  const labelClassName = useLabelClassName();
49
50
  const labelStyles = useLabelStyles();
50
51
  if (state.valueText) {
52
+ // eslint-disable-next-line react-hooks/immutability
51
53
  state.valueText.className = mergeClasses(ratingDisplayClassNames.valueText, labelClassName, labelStyles.strong, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText.className);
52
54
  }
53
55
  if (state.countText) {
56
+ // eslint-disable-next-line react-hooks/immutability
54
57
  state.countText.className = mergeClasses(ratingDisplayClassNames.countText, labelClassName, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText && labelStyles.divider, state.countText.className);
55
58
  }
56
59
  return state;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/RatingDisplay/useRatingDisplayStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { RatingDisplaySlots, RatingDisplayState } from './RatingDisplay.types';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n\nexport const ratingDisplayClassNames: SlotClassNames<RatingDisplaySlots> = {\n root: 'fui-RatingDisplay',\n valueText: 'fui-RatingDisplay__valueText',\n countText: 'fui-RatingDisplay__countText',\n};\n\n/**\n * Styles for the root slot\n */\n\nconst useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n});\n\nconst useLabelClassName = makeResetStyles({\n color: tokens.colorNeutralForeground1,\n marginLeft: tokens.spacingHorizontalXS,\n ...typographyStyles.caption1,\n});\n\nconst useLabelStyles = makeStyles({\n large: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n marginLeft: tokens.spacingHorizontalSNudge,\n },\n extraLarge: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n marginLeft: tokens.spacingHorizontalS,\n },\n strong: {\n fontWeight: tokens.fontWeightSemibold,\n },\n divider: {\n '::before': {\n content: '\"· \"',\n },\n },\n});\n\n/**\n * Apply styling to the RatingDisplay slots based on the state\n */\nexport const useRatingDisplayStyles_unstable = (state: RatingDisplayState): RatingDisplayState => {\n 'use no memo';\n\n const { size } = state;\n const rootClassName = useRootClassName();\n state.root.className = mergeClasses(ratingDisplayClassNames.root, rootClassName, state.root.className);\n const labelClassName = useLabelClassName();\n const labelStyles = useLabelStyles();\n\n if (state.valueText) {\n state.valueText.className = mergeClasses(\n ratingDisplayClassNames.valueText,\n labelClassName,\n labelStyles.strong,\n size === 'large' && labelStyles.large,\n size === 'extra-large' && labelStyles.extraLarge,\n state.valueText.className,\n );\n }\n if (state.countText) {\n state.countText.className = mergeClasses(\n ratingDisplayClassNames.countText,\n labelClassName,\n size === 'large' && labelStyles.large,\n size === 'extra-large' && labelStyles.extraLarge,\n state.valueText && labelStyles.divider,\n state.countText.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","typographyStyles","ratingDisplayClassNames","root","valueText","countText","useRootClassName","display","flexWrap","alignItems","useLabelClassName","color","colorNeutralForeground1","marginLeft","spacingHorizontalXS","caption1","useLabelStyles","large","fontSize","fontSizeBase300","lineHeight","lineHeightBase300","spacingHorizontalSNudge","extraLarge","fontSizeBase400","lineHeightBase400","spacingHorizontalS","strong","fontWeight","fontWeightSemibold","divider","content","useRatingDisplayStyles_unstable","state","size","rootClassName","className","labelClassName","labelStyles"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG3E,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAEjE,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;IACNC,WAAW;IACXC,WAAW;AACb,EAAE;AAEF;;CAEC,GAED,MAAMC,mBAAmBT,gBAAgB;IACvCU,SAAS;IACTC,UAAU;IACVC,YAAY;AACd;AAEA,MAAMC,oBAAoBb,gBAAgB;IACxCc,OAAOX,OAAOY,uBAAuB;IACrCC,YAAYb,OAAOc,mBAAmB;IACtC,GAAGb,iBAAiBc,QAAQ;AAC9B;AAEA,MAAMC,iBAAiBlB,WAAW;IAChCmB,OAAO;QACLC,UAAUlB,OAAOmB,eAAe;QAChCC,YAAYpB,OAAOqB,iBAAiB;QACpCR,YAAYb,OAAOsB,uBAAuB;IAC5C;IACAC,YAAY;QACVL,UAAUlB,OAAOwB,eAAe;QAChCJ,YAAYpB,OAAOyB,iBAAiB;QACpCZ,YAAYb,OAAO0B,kBAAkB;IACvC;IACAC,QAAQ;QACNC,YAAY5B,OAAO6B,kBAAkB;IACvC;IACAC,SAAS;QACP,YAAY;YACVC,SAAS;QACX;IACF;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,kCAAkC,CAACC;IAC9C;IAEA,MAAM,EAAEC,IAAI,EAAE,GAAGD;IACjB,MAAME,gBAAgB7B;IACtB2B,MAAM9B,IAAI,CAACiC,SAAS,GAAGrC,aAAaG,wBAAwBC,IAAI,EAAEgC,eAAeF,MAAM9B,IAAI,CAACiC,SAAS;IACrG,MAAMC,iBAAiB3B;IACvB,MAAM4B,cAActB;IAEpB,IAAIiB,MAAM7B,SAAS,EAAE;QACnB6B,MAAM7B,SAAS,CAACgC,SAAS,GAAGrC,aAC1BG,wBAAwBE,SAAS,EACjCiC,gBACAC,YAAYX,MAAM,EAClBO,SAAS,WAAWI,YAAYrB,KAAK,EACrCiB,SAAS,iBAAiBI,YAAYf,UAAU,EAChDU,MAAM7B,SAAS,CAACgC,SAAS;IAE7B;IACA,IAAIH,MAAM5B,SAAS,EAAE;QACnB4B,MAAM5B,SAAS,CAAC+B,SAAS,GAAGrC,aAC1BG,wBAAwBG,SAAS,EACjCgC,gBACAH,SAAS,WAAWI,YAAYrB,KAAK,EACrCiB,SAAS,iBAAiBI,YAAYf,UAAU,EAChDU,MAAM7B,SAAS,IAAIkC,YAAYR,OAAO,EACtCG,MAAM5B,SAAS,CAAC+B,SAAS;IAE7B;IAEA,OAAOH;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/RatingDisplay/useRatingDisplayStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { RatingDisplaySlots, RatingDisplayState } from './RatingDisplay.types';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n\nexport const ratingDisplayClassNames: SlotClassNames<RatingDisplaySlots> = {\n root: 'fui-RatingDisplay',\n valueText: 'fui-RatingDisplay__valueText',\n countText: 'fui-RatingDisplay__countText',\n};\n\n/**\n * Styles for the root slot\n */\n\nconst useRootClassName = makeResetStyles({\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n});\n\nconst useLabelClassName = makeResetStyles({\n color: tokens.colorNeutralForeground1,\n marginLeft: tokens.spacingHorizontalXS,\n ...typographyStyles.caption1,\n});\n\nconst useLabelStyles = makeStyles({\n large: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n marginLeft: tokens.spacingHorizontalSNudge,\n },\n extraLarge: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n marginLeft: tokens.spacingHorizontalS,\n },\n strong: {\n fontWeight: tokens.fontWeightSemibold,\n },\n divider: {\n '::before': {\n content: '\"· \"',\n },\n },\n});\n\n/**\n * Apply styling to the RatingDisplay slots based on the state\n */\nexport const useRatingDisplayStyles_unstable = (state: RatingDisplayState): RatingDisplayState => {\n 'use no memo';\n\n const { size } = state;\n const rootClassName = useRootClassName();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(ratingDisplayClassNames.root, rootClassName, state.root.className);\n const labelClassName = useLabelClassName();\n const labelStyles = useLabelStyles();\n\n if (state.valueText) {\n // eslint-disable-next-line react-hooks/immutability\n state.valueText.className = mergeClasses(\n ratingDisplayClassNames.valueText,\n labelClassName,\n labelStyles.strong,\n size === 'large' && labelStyles.large,\n size === 'extra-large' && labelStyles.extraLarge,\n state.valueText.className,\n );\n }\n if (state.countText) {\n // eslint-disable-next-line react-hooks/immutability\n state.countText.className = mergeClasses(\n ratingDisplayClassNames.countText,\n labelClassName,\n size === 'large' && labelStyles.large,\n size === 'extra-large' && labelStyles.extraLarge,\n state.valueText && labelStyles.divider,\n state.countText.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","typographyStyles","ratingDisplayClassNames","root","valueText","countText","useRootClassName","display","flexWrap","alignItems","useLabelClassName","color","colorNeutralForeground1","marginLeft","spacingHorizontalXS","caption1","useLabelStyles","large","fontSize","fontSizeBase300","lineHeight","lineHeightBase300","spacingHorizontalSNudge","extraLarge","fontSizeBase400","lineHeightBase400","spacingHorizontalS","strong","fontWeight","fontWeightSemibold","divider","content","useRatingDisplayStyles_unstable","state","size","rootClassName","className","labelClassName","labelStyles"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG3E,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAEjE,OAAO,MAAMC,0BAA8D;IACzEC,MAAM;IACNC,WAAW;IACXC,WAAW;AACb,EAAE;AAEF;;CAEC,GAED,MAAMC,mBAAmBT,gBAAgB;IACvCU,SAAS;IACTC,UAAU;IACVC,YAAY;AACd;AAEA,MAAMC,oBAAoBb,gBAAgB;IACxCc,OAAOX,OAAOY,uBAAuB;IACrCC,YAAYb,OAAOc,mBAAmB;IACtC,GAAGb,iBAAiBc,QAAQ;AAC9B;AAEA,MAAMC,iBAAiBlB,WAAW;IAChCmB,OAAO;QACLC,UAAUlB,OAAOmB,eAAe;QAChCC,YAAYpB,OAAOqB,iBAAiB;QACpCR,YAAYb,OAAOsB,uBAAuB;IAC5C;IACAC,YAAY;QACVL,UAAUlB,OAAOwB,eAAe;QAChCJ,YAAYpB,OAAOyB,iBAAiB;QACpCZ,YAAYb,OAAO0B,kBAAkB;IACvC;IACAC,QAAQ;QACNC,YAAY5B,OAAO6B,kBAAkB;IACvC;IACAC,SAAS;QACP,YAAY;YACVC,SAAS;QACX;IACF;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,kCAAkC,CAACC;IAC9C;IAEA,MAAM,EAAEC,IAAI,EAAE,GAAGD;IACjB,MAAME,gBAAgB7B;IACtB,oDAAoD;IACpD2B,MAAM9B,IAAI,CAACiC,SAAS,GAAGrC,aAAaG,wBAAwBC,IAAI,EAAEgC,eAAeF,MAAM9B,IAAI,CAACiC,SAAS;IACrG,MAAMC,iBAAiB3B;IACvB,MAAM4B,cAActB;IAEpB,IAAIiB,MAAM7B,SAAS,EAAE;QACnB,oDAAoD;QACpD6B,MAAM7B,SAAS,CAACgC,SAAS,GAAGrC,aAC1BG,wBAAwBE,SAAS,EACjCiC,gBACAC,YAAYX,MAAM,EAClBO,SAAS,WAAWI,YAAYrB,KAAK,EACrCiB,SAAS,iBAAiBI,YAAYf,UAAU,EAChDU,MAAM7B,SAAS,CAACgC,SAAS;IAE7B;IACA,IAAIH,MAAM5B,SAAS,EAAE;QACnB,oDAAoD;QACpD4B,MAAM5B,SAAS,CAAC+B,SAAS,GAAGrC,aAC1BG,wBAAwBG,SAAS,EACjCgC,gBACAH,SAAS,WAAWI,YAAYrB,KAAK,EACrCiB,SAAS,iBAAiBI,YAAYf,UAAU,EAChDU,MAAM7B,SAAS,IAAIkC,YAAYR,OAAO,EACtCG,MAAM5B,SAAS,CAAC+B,SAAS;IAE7B;IAEA,OAAOH;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/RatingItem/RatingItem.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { RatingState } from '../Rating/Rating.types';\nimport { RatingDisplayState } from '../RatingDisplay/RatingDisplay.types';\n\nexport type RatingItemSlots = {\n /**\n * The root slot of the RatingItem.\n * Default html element is span\n */\n root: NonNullable<Slot<'span'>>;\n /**\n * Icon displayed when the rating value is greater than or equal to the item's value.\n */\n selectedIcon?: NonNullable<Slot<'div'>>;\n /**\n * Icon displayed when the rating value is less than the item's value.\n */\n unselectedIcon?: NonNullable<Slot<'div'>>;\n /**\n * Radio input slot used for half star precision\n */\n halfValueInput?: NonNullable<Slot<'input'>>;\n /**\n * Radio input slot used for full star precision\n */\n fullValueInput?: NonNullable<Slot<'input'>>;\n};\n\n/**\n * RatingItem Props\n */\nexport type RatingItemProps = ComponentProps<Partial<RatingItemSlots>> & {\n /**\n * The positive whole number value that is displayed by this RatingItem\n */\n value?: number;\n};\n\n/**\n * RatingItem base props — same as RatingItemProps (no design-only props at this level).\n */\nexport type RatingItemBaseProps = RatingItemProps;\n\n/**\n * State used in rendering RatingItem\n */\nexport type RatingItemState = ComponentState<RatingItemSlots> &\n Required<Pick<RatingItemProps, 'value'>> &\n Pick<RatingState, 'color' | 'step' | 'size'> & {\n iconFillWidth: number;\n appearance: 'outline' | 'filled';\n };\n\n/**\n * RatingItem base state — excludes design props (color, size) from context.\n */\nexport type RatingItemBaseState = Omit<RatingItemState, 'color' | 'size'>;\n\nexport type RatingItemContextValue = Partial<Pick<RatingState, 'name' | 'hoveredValue' | 'value'>> &\n Pick<RatingState, 'color' | 'iconFilled' | 'iconOutline' | 'itemLabel' | 'step' | 'size'> &\n Partial<Pick<RatingDisplayState, 'compact'>> & {\n interactive?: boolean;\n };\n"],"names":[],"mappings":"AA0DA,WAII"}
1
+ {"version":3,"sources":["../src/components/RatingItem/RatingItem.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { RatingState } from '../Rating/Rating.types';\nimport type { RatingDisplayState } from '../RatingDisplay/RatingDisplay.types';\n\nexport type RatingItemSlots = {\n /**\n * The root slot of the RatingItem.\n * Default html element is span\n */\n root: NonNullable<Slot<'span'>>;\n /**\n * Icon displayed when the rating value is greater than or equal to the item's value.\n */\n selectedIcon?: NonNullable<Slot<'div'>>;\n /**\n * Icon displayed when the rating value is less than the item's value.\n */\n unselectedIcon?: NonNullable<Slot<'div'>>;\n /**\n * Radio input slot used for half star precision\n */\n halfValueInput?: NonNullable<Slot<'input'>>;\n /**\n * Radio input slot used for full star precision\n */\n fullValueInput?: NonNullable<Slot<'input'>>;\n};\n\n/**\n * RatingItem Props\n */\nexport type RatingItemProps = ComponentProps<Partial<RatingItemSlots>> & {\n /**\n * The positive whole number value that is displayed by this RatingItem\n */\n value?: number;\n};\n\n/**\n * RatingItem base props — same as RatingItemProps (no design-only props at this level).\n */\nexport type RatingItemBaseProps = RatingItemProps;\n\n/**\n * State used in rendering RatingItem\n */\nexport type RatingItemState = ComponentState<RatingItemSlots> &\n Required<Pick<RatingItemProps, 'value'>> &\n Pick<RatingState, 'color' | 'step' | 'size'> & {\n iconFillWidth: number;\n appearance: 'outline' | 'filled';\n };\n\n/**\n * RatingItem base state — excludes design props (color, size) from context.\n */\nexport type RatingItemBaseState = Omit<RatingItemState, 'color' | 'size'>;\n\nexport type RatingItemContextValue = Partial<Pick<RatingState, 'name' | 'hoveredValue' | 'value'>> &\n Pick<RatingState, 'color' | 'iconFilled' | 'iconOutline' | 'itemLabel' | 'step' | 'size'> &\n Partial<Pick<RatingDisplayState, 'compact'>> & {\n interactive?: boolean;\n };\n"],"names":[],"mappings":"AA0DA,WAII"}
@@ -162,17 +162,22 @@ export const useRatingItemStyles_unstable = state => {
162
162
  const inputStyles = useInputStyles();
163
163
  const indicatorBaseClassName = useIndicatorBaseClassName();
164
164
  const indicatorStyles = useIndicatorStyles();
165
+ // eslint-disable-next-line react-hooks/immutability
165
166
  state.root.className = mergeClasses(ratingItemClassNames.root, styles.root, styles[size], state.root.className);
166
167
  if (state.halfValueInput) {
168
+ // eslint-disable-next-line react-hooks/immutability
167
169
  state.halfValueInput.className = mergeClasses(ratingItemClassNames.halfValueInput, inputBaseClassName, inputStyles.lowerHalf, state.halfValueInput.className);
168
170
  }
169
171
  if (state.fullValueInput) {
172
+ // eslint-disable-next-line react-hooks/immutability
170
173
  state.fullValueInput.className = mergeClasses(ratingItemClassNames.fullValueInput, inputBaseClassName, state.halfValueInput && inputStyles.upperHalf, state.fullValueInput.className);
171
174
  }
172
175
  if (state.unselectedIcon) {
176
+ // eslint-disable-next-line react-hooks/immutability
173
177
  state.unselectedIcon.className = mergeClasses(ratingItemClassNames.unselectedIcon, indicatorBaseClassName, appearance === 'filled' && indicatorStyles.filled, color === 'brand' && (appearance === 'filled' ? indicatorStyles.brandFilled : indicatorStyles.brand), color === 'marigold' && (appearance === 'filled' ? indicatorStyles.marigoldFilled : indicatorStyles.marigold), iconFillWidth === 0.5 && indicatorStyles.upperHalf, state.unselectedIcon.className);
174
178
  }
175
179
  if (state.selectedIcon) {
180
+ // eslint-disable-next-line react-hooks/immutability
176
181
  state.selectedIcon.className = mergeClasses(ratingItemClassNames.selectedIcon, indicatorBaseClassName, color === 'brand' && indicatorStyles.brand, color === 'marigold' && indicatorStyles.marigold, iconFillWidth === 0.5 && indicatorStyles.lowerHalf, state.selectedIcon.className);
177
182
  }
178
183
  return state;
@@ -1 +1 @@
1
- {"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","createFocusOutlineStyle","ratingItemClassNames","root","selectedIcon","unselectedIcon","halfValueInput","fullValueInput","useStyles","qhf8xq","Brovlpu","B486eqv","Bssx7fj","uh7if5","clntm0","Dlk2r6","h6p2u","I6qiy5","yzno9d","By0wis0","B2j2mmj","wigs8","pbfy6t","B0v4ure","Byrf0fs","Bsiemmq","Bwckmig","skfxo0","Iidy0u","B98u21t","Bvwlmkc","jo1ztg","Ba1iezr","Blmvk6g","B24cy0v","Bil7v7r","Br3gin4","nr063g","ghq09","Bbgo44z","Bseh09z","az1dzo","Ba3ybja","B6352mv","vppk2z","Biaj6j7","B2pnrqr","B29w5g4","Bhhzhcn","Bec0n69","small","Be2twd7","a9b677","Bqenvij","medium","large","d","p","f","i","m","useInputBaseClassName","useInputStyles","lowerHalf","j35jbq","upperHalf","oyh7mz","useIndicatorBaseClassName","useIndicatorStyles","l5kjut","uoufgc","v39lw8","Bbwb3tu","Frg6f3","brand","sj55zd","marigold","filled","ojy3ng","B7iucu3","Biw2w6l","brandFilled","marigoldFilled","useRatingItemStyles_unstable","state","color","size","iconFillWidth","appearance","styles","inputBaseClassName","inputStyles","indicatorBaseClassName","indicatorStyles","className"],"sources":["useRatingItemStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nexport const ratingItemClassNames = {\n root: 'fui-RatingItem',\n selectedIcon: 'fui-RatingItem__selectedIcon',\n unselectedIcon: 'fui-RatingItem__unselectedIcon',\n halfValueInput: 'fui-RatingItem__halfValueInput',\n fullValueInput: 'fui-RatingItem__fullValueInput'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n position: 'relative',\n ...createFocusOutlineStyle({\n style: {},\n selector: 'focus-within'\n })\n },\n small: {\n fontSize: '12px',\n width: '12px',\n height: '12px'\n },\n medium: {\n fontSize: '16px',\n width: '16px',\n height: '16px'\n },\n large: {\n fontSize: '20px',\n width: '20px',\n height: '20px'\n },\n 'extra-large': {\n fontSize: '28px',\n width: '28px',\n height: '28px'\n }\n});\nconst useInputBaseClassName = makeResetStyles({\n position: 'absolute',\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n boxSizing: 'border-box',\n margin: 0,\n opacity: 0,\n cursor: 'pointer',\n height: '100%'\n});\nconst useInputStyles = makeStyles({\n lowerHalf: {\n right: '50%'\n },\n upperHalf: {\n left: '50%'\n }\n});\nconst useIndicatorBaseClassName = makeResetStyles({\n display: 'flex',\n overflow: 'hidden',\n color: tokens.colorNeutralForeground1,\n fill: 'currentColor',\n pointerEvents: 'none',\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n});\nconst useIndicatorStyles = makeStyles({\n lowerHalf: {\n right: '50%',\n '& > svg': {\n flex: '0 0 auto'\n }\n },\n upperHalf: {\n left: '50%',\n marginLeft: '-50%'\n },\n brand: {\n color: tokens.colorBrandForeground1\n },\n marigold: {\n color: tokens.colorPaletteMarigoldBorderActive\n },\n filled: {\n color: tokens.colorNeutralBackground6,\n stroke: tokens.colorTransparentStroke,\n '@media (forced-colors: active)': {\n color: 'Canvas',\n stroke: 'CanvasText'\n }\n },\n brandFilled: {\n color: tokens.colorBrandBackground2\n },\n marigoldFilled: {\n color: tokens.colorPaletteMarigoldBackground2\n }\n});\n/**\n * Apply styling to the RatingItem slots based on the state\n */ export const useRatingItemStyles_unstable = (state)=>{\n 'use no memo';\n const { color, size, iconFillWidth, appearance } = state;\n const styles = useStyles();\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n const indicatorBaseClassName = useIndicatorBaseClassName();\n const indicatorStyles = useIndicatorStyles();\n state.root.className = mergeClasses(ratingItemClassNames.root, styles.root, styles[size], state.root.className);\n if (state.halfValueInput) {\n state.halfValueInput.className = mergeClasses(ratingItemClassNames.halfValueInput, inputBaseClassName, inputStyles.lowerHalf, state.halfValueInput.className);\n }\n if (state.fullValueInput) {\n state.fullValueInput.className = mergeClasses(ratingItemClassNames.fullValueInput, inputBaseClassName, state.halfValueInput && inputStyles.upperHalf, state.fullValueInput.className);\n }\n if (state.unselectedIcon) {\n state.unselectedIcon.className = mergeClasses(ratingItemClassNames.unselectedIcon, indicatorBaseClassName, appearance === 'filled' && indicatorStyles.filled, color === 'brand' && (appearance === 'filled' ? indicatorStyles.brandFilled : indicatorStyles.brand), color === 'marigold' && (appearance === 'filled' ? indicatorStyles.marigoldFilled : indicatorStyles.marigold), iconFillWidth === 0.5 && indicatorStyles.upperHalf, state.unselectedIcon.className);\n }\n if (state.selectedIcon) {\n state.selectedIcon.className = mergeClasses(ratingItemClassNames.selectedIcon, indicatorBaseClassName, color === 'brand' && indicatorStyles.brand, color === 'marigold' && indicatorStyles.marigold, iconFillWidth === 0.5 && indicatorStyles.lowerHalf, state.selectedIcon.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,uBAAuB,QAAQ,yBAAyB;AACjE,OAAO,MAAMC,oBAAoB,GAAG;EAChCC,IAAI,EAAE,gBAAg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EAAEW,aAAa,KAAK,GAAG,IAAIM,eAAe,CAAC9B,SAAS,EAAEqB,KAAK,CAAChF,YAAY,CAAC0F,SAAS,CAAC;EAC1R;EACA,OAAOV,KAAK;AAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","createFocusOutlineStyle","ratingItemClassNames","root","selectedIcon","unselectedIcon","halfValueInput","fullValueInput","useStyles","qhf8xq","Brovlpu","B486eqv","Bssx7fj","uh7if5","clntm0","Dlk2r6","h6p2u","I6qiy5","yzno9d","By0wis0","B2j2mmj","wigs8","pbfy6t","B0v4ure","Byrf0fs","Bsiemmq","Bwckmig","skfxo0","Iidy0u","B98u21t","Bvwlmkc","jo1ztg","Ba1iezr","Blmvk6g","B24cy0v","Bil7v7r","Br3gin4","nr063g","ghq09","Bbgo44z","Bseh09z","az1dzo","Ba3ybja","B6352mv","vppk2z","Biaj6j7","B2pnrqr","B29w5g4","Bhhzhcn","Bec0n69","small","Be2twd7","a9b677","Bqenvij","medium","large","d","p","f","i","m","useInputBaseClassName","useInputStyles","lowerHalf","j35jbq","upperHalf","oyh7mz","useIndicatorBaseClassName","useIndicatorStyles","l5kjut","uoufgc","v39lw8","Bbwb3tu","Frg6f3","brand","sj55zd","marigold","filled","ojy3ng","B7iucu3","Biw2w6l","brandFilled","marigoldFilled","useRatingItemStyles_unstable","state","color","size","iconFillWidth","appearance","styles","inputBaseClassName","inputStyles","indicatorBaseClassName","indicatorStyles","className"],"sources":["useRatingItemStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nexport const ratingItemClassNames = {\n root: 'fui-RatingItem',\n selectedIcon: 'fui-RatingItem__selectedIcon',\n unselectedIcon: 'fui-RatingItem__unselectedIcon',\n halfValueInput: 'fui-RatingItem__halfValueInput',\n fullValueInput: 'fui-RatingItem__fullValueInput'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n position: 'relative',\n ...createFocusOutlineStyle({\n style: {},\n selector: 'focus-within'\n })\n },\n small: {\n fontSize: '12px',\n width: '12px',\n height: '12px'\n },\n medium: {\n fontSize: '16px',\n width: '16px',\n height: '16px'\n },\n large: {\n fontSize: '20px',\n width: '20px',\n height: '20px'\n },\n 'extra-large': {\n fontSize: '28px',\n width: '28px',\n height: '28px'\n }\n});\nconst useInputBaseClassName = makeResetStyles({\n position: 'absolute',\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n boxSizing: 'border-box',\n margin: 0,\n opacity: 0,\n cursor: 'pointer',\n height: '100%'\n});\nconst useInputStyles = makeStyles({\n lowerHalf: {\n right: '50%'\n },\n upperHalf: {\n left: '50%'\n }\n});\nconst useIndicatorBaseClassName = makeResetStyles({\n display: 'flex',\n overflow: 'hidden',\n color: tokens.colorNeutralForeground1,\n fill: 'currentColor',\n pointerEvents: 'none',\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n});\nconst useIndicatorStyles = makeStyles({\n lowerHalf: {\n right: '50%',\n '& > svg': {\n flex: '0 0 auto'\n }\n },\n upperHalf: {\n left: '50%',\n marginLeft: '-50%'\n },\n brand: {\n color: tokens.colorBrandForeground1\n },\n marigold: {\n color: tokens.colorPaletteMarigoldBorderActive\n },\n filled: {\n color: tokens.colorNeutralBackground6,\n stroke: tokens.colorTransparentStroke,\n '@media (forced-colors: active)': {\n color: 'Canvas',\n stroke: 'CanvasText'\n }\n },\n brandFilled: {\n color: tokens.colorBrandBackground2\n },\n marigoldFilled: {\n color: tokens.colorPaletteMarigoldBackground2\n }\n});\n/**\n * Apply styling to the RatingItem slots based on the state\n */ export const useRatingItemStyles_unstable = (state)=>{\n 'use no memo';\n const { color, size, iconFillWidth, appearance } = state;\n const styles = useStyles();\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n const indicatorBaseClassName = useIndicatorBaseClassName();\n const indicatorStyles = useIndicatorStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(ratingItemClassNames.root, styles.root, styles[size], state.root.className);\n if (state.halfValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.halfValueInput.className = mergeClasses(ratingItemClassNames.halfValueInput, inputBaseClassName, inputStyles.lowerHalf, state.halfValueInput.className);\n }\n if (state.fullValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.fullValueInput.className = mergeClasses(ratingItemClassNames.fullValueInput, inputBaseClassName, state.halfValueInput && inputStyles.upperHalf, state.fullValueInput.className);\n }\n if (state.unselectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.unselectedIcon.className = mergeClasses(ratingItemClassNames.unselectedIcon, indicatorBaseClassName, appearance === 'filled' && indicatorStyles.filled, color === 'brand' && (appearance === 'filled' ? indicatorStyles.brandFilled : indicatorStyles.brand), color === 'marigold' && (appearance === 'filled' ? indicatorStyles.marigoldFilled : indicatorStyles.marigold), iconFillWidth === 0.5 && indicatorStyles.upperHalf, state.unselectedIcon.className);\n }\n if (state.selectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.selectedIcon.className = mergeClasses(ratingItemClassNames.selectedIcon, indicatorBaseClassName, color === 'brand' && indicatorStyles.brand, color === 'marigold' && indicatorStyles.marigold, iconFillWidth === 0.5 && indicatorStyles.lowerHalf, state.selectedIcon.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,uBAAuB,QAAQ,yBAAyB;AACjE,OAAO,MAAMC,oBAAoB,GAAG;EAChCC,IAAI,EAAE,gBAAgB;EACtBC,YAAY,EAAE,8BAA8B;EAC5CC,cAAc,EAAE,gCAAgC;EAChDC,cAAc,EAAE,gCAAgC;EAChDC,cAAc,EAAE;AACpB,CAAC;AACD;AACA;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C1R;EACA,OAAOV,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -114,17 +114,22 @@ const useIndicatorStyles = makeStyles({
114
114
  const inputStyles = useInputStyles();
115
115
  const indicatorBaseClassName = useIndicatorBaseClassName();
116
116
  const indicatorStyles = useIndicatorStyles();
117
+ // eslint-disable-next-line react-hooks/immutability
117
118
  state.root.className = mergeClasses(ratingItemClassNames.root, styles.root, styles[size], state.root.className);
118
119
  if (state.halfValueInput) {
120
+ // eslint-disable-next-line react-hooks/immutability
119
121
  state.halfValueInput.className = mergeClasses(ratingItemClassNames.halfValueInput, inputBaseClassName, inputStyles.lowerHalf, state.halfValueInput.className);
120
122
  }
121
123
  if (state.fullValueInput) {
124
+ // eslint-disable-next-line react-hooks/immutability
122
125
  state.fullValueInput.className = mergeClasses(ratingItemClassNames.fullValueInput, inputBaseClassName, state.halfValueInput && inputStyles.upperHalf, state.fullValueInput.className);
123
126
  }
124
127
  if (state.unselectedIcon) {
128
+ // eslint-disable-next-line react-hooks/immutability
125
129
  state.unselectedIcon.className = mergeClasses(ratingItemClassNames.unselectedIcon, indicatorBaseClassName, appearance === 'filled' && indicatorStyles.filled, color === 'brand' && (appearance === 'filled' ? indicatorStyles.brandFilled : indicatorStyles.brand), color === 'marigold' && (appearance === 'filled' ? indicatorStyles.marigoldFilled : indicatorStyles.marigold), iconFillWidth === 0.5 && indicatorStyles.upperHalf, state.unselectedIcon.className);
126
130
  }
127
131
  if (state.selectedIcon) {
132
+ // eslint-disable-next-line react-hooks/immutability
128
133
  state.selectedIcon.className = mergeClasses(ratingItemClassNames.selectedIcon, indicatorBaseClassName, color === 'brand' && indicatorStyles.brand, color === 'marigold' && indicatorStyles.marigold, iconFillWidth === 0.5 && indicatorStyles.lowerHalf, state.selectedIcon.className);
129
134
  }
130
135
  return state;