@fluentui/react-rating 9.3.15 → 9.4.1

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 (67) hide show
  1. package/CHANGELOG.md +23 -2
  2. package/dist/index.d.ts +63 -3
  3. package/lib/Rating.js +1 -1
  4. package/lib/Rating.js.map +1 -1
  5. package/lib/RatingDisplay.js +1 -1
  6. package/lib/RatingDisplay.js.map +1 -1
  7. package/lib/RatingItem.js +1 -1
  8. package/lib/RatingItem.js.map +1 -1
  9. package/lib/components/Rating/Rating.types.js +1 -1
  10. package/lib/components/Rating/Rating.types.js.map +1 -1
  11. package/lib/components/Rating/index.js +1 -1
  12. package/lib/components/Rating/index.js.map +1 -1
  13. package/lib/components/Rating/renderRating.js.map +1 -1
  14. package/lib/components/Rating/useRating.js +33 -13
  15. package/lib/components/Rating/useRating.js.map +1 -1
  16. package/lib/components/Rating/useRatingContextValues.js.map +1 -1
  17. package/lib/components/RatingDisplay/RatingDisplay.types.js +1 -1
  18. package/lib/components/RatingDisplay/RatingDisplay.types.js.map +1 -1
  19. package/lib/components/RatingDisplay/index.js +1 -1
  20. package/lib/components/RatingDisplay/index.js.map +1 -1
  21. package/lib/components/RatingDisplay/renderRatingDisplay.js.map +1 -1
  22. package/lib/components/RatingDisplay/useRatingDisplay.js +28 -7
  23. package/lib/components/RatingDisplay/useRatingDisplay.js.map +1 -1
  24. package/lib/components/RatingDisplay/useRatingDisplayContextValues.js.map +1 -1
  25. package/lib/components/RatingItem/RatingItem.types.js.map +1 -1
  26. package/lib/components/RatingItem/index.js +1 -1
  27. package/lib/components/RatingItem/index.js.map +1 -1
  28. package/lib/components/RatingItem/renderRatingItem.js.map +1 -1
  29. package/lib/components/RatingItem/useRatingItem.js +17 -4
  30. package/lib/components/RatingItem/useRatingItem.js.map +1 -1
  31. package/lib/contexts/RatingItemContext.js +2 -3
  32. package/lib/contexts/RatingItemContext.js.map +1 -1
  33. package/lib/index.js +3 -3
  34. package/lib/index.js.map +1 -1
  35. package/lib-commonjs/Rating.js +3 -0
  36. package/lib-commonjs/Rating.js.map +1 -1
  37. package/lib-commonjs/RatingDisplay.js +3 -0
  38. package/lib-commonjs/RatingDisplay.js.map +1 -1
  39. package/lib-commonjs/RatingItem.js +3 -0
  40. package/lib-commonjs/RatingItem.js.map +1 -1
  41. package/lib-commonjs/components/Rating/Rating.types.js +0 -2
  42. package/lib-commonjs/components/Rating/Rating.types.js.map +1 -1
  43. package/lib-commonjs/components/Rating/index.js +3 -0
  44. package/lib-commonjs/components/Rating/index.js.map +1 -1
  45. package/lib-commonjs/components/Rating/renderRating.js.map +1 -1
  46. package/lib-commonjs/components/Rating/useRating.js +37 -16
  47. package/lib-commonjs/components/Rating/useRating.js.map +1 -1
  48. package/lib-commonjs/components/Rating/useRatingContextValues.js.map +1 -1
  49. package/lib-commonjs/components/RatingDisplay/RatingDisplay.types.js +0 -2
  50. package/lib-commonjs/components/RatingDisplay/RatingDisplay.types.js.map +1 -1
  51. package/lib-commonjs/components/RatingDisplay/index.js +3 -0
  52. package/lib-commonjs/components/RatingDisplay/index.js.map +1 -1
  53. package/lib-commonjs/components/RatingDisplay/renderRatingDisplay.js.map +1 -1
  54. package/lib-commonjs/components/RatingDisplay/useRatingDisplay.js +32 -10
  55. package/lib-commonjs/components/RatingDisplay/useRatingDisplay.js.map +1 -1
  56. package/lib-commonjs/components/RatingDisplay/useRatingDisplayContextValues.js.map +1 -1
  57. package/lib-commonjs/components/RatingItem/RatingItem.types.js.map +1 -1
  58. package/lib-commonjs/components/RatingItem/index.js +3 -0
  59. package/lib-commonjs/components/RatingItem/index.js.map +1 -1
  60. package/lib-commonjs/components/RatingItem/renderRatingItem.js.map +1 -1
  61. package/lib-commonjs/components/RatingItem/useRatingItem.js +21 -7
  62. package/lib-commonjs/components/RatingItem/useRatingItem.js.map +1 -1
  63. package/lib-commonjs/contexts/RatingItemContext.js +2 -3
  64. package/lib-commonjs/contexts/RatingItemContext.js.map +1 -1
  65. package/lib-commonjs/index.js +9 -0
  66. package/lib-commonjs/index.js.map +1 -1
  67. package/package.json +4 -4
@@ -3,9 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "useRatingItem_unstable", {
7
- enumerable: true,
8
- get: function() {
6
+ function _export(target, all) {
7
+ for(var name in all)Object.defineProperty(target, name, {
8
+ enumerable: true,
9
+ get: all[name]
10
+ });
11
+ }
12
+ _export(exports, {
13
+ useRatingItemBase_unstable: function() {
14
+ return useRatingItemBase_unstable;
15
+ },
16
+ useRatingItem_unstable: function() {
9
17
  return useRatingItem_unstable;
10
18
  }
11
19
  });
@@ -16,6 +24,15 @@ const _reacttabster = require("@fluentui/react-tabster");
16
24
  const _RatingItemContext = require("../../contexts/RatingItemContext");
17
25
  const defaultItemLabel = (num)=>num + '';
18
26
  const useRatingItem_unstable = (props, ref)=>{
27
+ const context = (0, _RatingItemContext.useRatingItemContextValue_unstable)();
28
+ const state = useRatingItemBase_unstable(props, ref);
29
+ return {
30
+ ...state,
31
+ color: context.color,
32
+ size: context.size
33
+ };
34
+ };
35
+ const useRatingItemBase_unstable = (props, ref)=>{
19
36
  const context = (0, _RatingItemContext.useRatingItemContextValue_unstable)();
20
37
  const { value = 0 } = props;
21
38
  const { itemLabel = defaultItemLabel, iconFilled: IconFilled, iconOutline: IconOutline } = context;
@@ -91,11 +108,9 @@ const useRatingItem_unstable = (props, ref)=>{
91
108
  elementType: 'input'
92
109
  });
93
110
  }
94
- const state = {
111
+ return {
95
112
  appearance,
96
- color: context.color,
97
113
  step: context.step,
98
- size: context.size,
99
114
  iconFillWidth,
100
115
  value,
101
116
  components: {
@@ -111,5 +126,4 @@ const useRatingItem_unstable = (props, ref)=>{
111
126
  halfValueInput,
112
127
  fullValueInput
113
128
  };
114
- return state;
115
129
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/RatingItem/useRatingItem.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport type { RatingItemProps, RatingItemState } from './RatingItem.types';\nimport { useRatingItemContextValue_unstable } from '../../contexts/RatingItemContext';\n\nconst defaultItemLabel = (num: number) => num + '';\n\n/**\n * Create the state required to render RatingItem.\n *\n * The returned state can be modified with hooks such as useRatingItemStyles_unstable,\n * before being passed to renderRatingItem_unstable.\n *\n * @param props - props from this instance of RatingItem\n * @param ref - reference to root HTMLElement of RatingItem\n */\nexport const useRatingItem_unstable = (props: RatingItemProps, ref: React.Ref<HTMLSpanElement>): RatingItemState => {\n const context = useRatingItemContextValue_unstable();\n const { value = 0 } = props;\n const { itemLabel = defaultItemLabel, iconFilled: IconFilled, iconOutline: IconOutline } = context;\n\n const ratingValue = Math.round((context.value || 0) * 2) / 2; // round to the nearest 0.5\n\n const displayedRatingValue = context.hoveredValue ?? ratingValue;\n\n const appearance = context.interactive ? 'outline' : 'filled';\n\n let iconFillWidth;\n if (context.compact || displayedRatingValue >= value) {\n iconFillWidth = 1;\n } else if (displayedRatingValue >= value - 0.5) {\n iconFillWidth = 0.5;\n } else {\n iconFillWidth = 0;\n }\n\n const root = slot.always(\n getIntrinsicElementProps('span', {\n ref: useMergedRefs(useFocusWithin<HTMLSpanElement>(), ref),\n ...props,\n }),\n { elementType: 'span' },\n );\n\n let unselectedIcon;\n if (iconFillWidth < 1) {\n unselectedIcon = slot.always(props.unselectedIcon, {\n defaultProps: {\n children: appearance === 'filled' ? <IconFilled /> : <IconOutline />,\n 'aria-hidden': true,\n },\n elementType: 'div',\n });\n }\n\n let selectedIcon;\n if (iconFillWidth > 0) {\n selectedIcon = slot.always(props.selectedIcon, {\n defaultProps: {\n children: <IconFilled />,\n 'aria-hidden': true,\n },\n elementType: 'div',\n });\n }\n\n let halfValueInput;\n if (context.interactive && context.step === 0.5) {\n halfValueInput = slot.always(props.halfValueInput, {\n defaultProps: {\n type: 'radio',\n name: context.name,\n value: value - 0.5,\n checked: ratingValue === value - 0.5,\n 'aria-label': itemLabel(value - 0.5),\n onChange: () => {\n // This empty onChange handler silences an incorrect React warning about not using onChange for a controlled input.\n // The parent Rating component has the real onChange handler to listen to change events from this input.\n },\n },\n elementType: 'input',\n });\n }\n\n let fullValueInput;\n if (context.interactive) {\n fullValueInput = slot.always(props.fullValueInput, {\n defaultProps: {\n type: 'radio',\n name: context.name,\n value,\n checked: ratingValue === value,\n 'aria-label': itemLabel(value),\n onChange: () => {\n // This empty onChange handler silences an incorrect React warning about not using onChange for a controlled input.\n // The parent Rating component has the real onChange handler to listen to change events from this input.\n },\n },\n\n elementType: 'input',\n });\n }\n\n const state: RatingItemState = {\n appearance,\n color: context.color,\n step: context.step,\n size: context.size,\n iconFillWidth,\n value,\n components: {\n root: 'span',\n selectedIcon: 'div',\n unselectedIcon: 'div',\n halfValueInput: 'input',\n fullValueInput: 'input',\n },\n root,\n selectedIcon,\n unselectedIcon,\n halfValueInput,\n fullValueInput,\n };\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","slot","useMergedRefs","useFocusWithin","useRatingItemContextValue_unstable","defaultItemLabel","num","useRatingItem_unstable","props","ref","context","value","itemLabel","iconFilled","IconFilled","iconOutline","IconOutline","ratingValue","Math","round","displayedRatingValue","hoveredValue","appearance","interactive","iconFillWidth","compact","root","always","elementType","unselectedIcon","defaultProps","children","selectedIcon","halfValueInput","step","type","name","checked","onChange","fullValueInput","state","color","size","components"],"mappings":"AAAA;;;;;+BAmBaQ;;;;;;;iEAjBU,QAAQ;gCAC+B,4BAA4B;8BAC3D,0BAA0B;mCAEN,mCAAmC;AAEtF,MAAMF,mBAAmB,CAACC,MAAgBA,MAAM;AAWzC,+BAA+B,CAACE,OAAwBC;IAC7D,MAAMC,cAAUN,qDAAAA;IAChB,MAAM,EAAEO,QAAQ,CAAC,EAAE,GAAGH;IACtB,MAAM,EAAEI,YAAYP,gBAAgB,EAAEQ,YAAYC,U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AA,CAAK0B,MAAM,CAACnB,MAAMyB,cAAc,EAAE;YACjDH,cAAc;gBACZK,MAAM;gBACNC,MAAM1B,QAAQ0B,IAAI;gBAClBzB,OAAOA,QAAQ;gBACf0B,SAASpB,gBAAgBN,QAAQ;gBACjC,cAAcC,UAAUD,QAAQ;gBAChC2B,UAAU;gBACR,mHAAmH;gBACnH,wGAAwG;gBAC1G;YACF;YACAV,aAAa;QACf;IACF;IAEA,IAAIW;IACJ,IAAI7B,QAAQa,WAAW,EAAE;QACvBgB,iBAAiBtC,oBAAAA,CAAK0B,MAAM,CAACnB,MAAM+B,cAAc,EAAE;YACjDT,cAAc;gBACZK,MAAM;gBACNC,MAAM1B,QAAQ0B,IAAI;gBAClBzB;gBACA0B,SAASpB,gBAAgBN;gBACzB,cAAcC,UAAUD;gBACxB2B,UAAU;gBACR,mHAAmH;gBACnH,wGAAwG;gBAC1G;YACF;YAEAV,aAAa;QACf;IACF;IAEA,MAAMY,QAAyB;QAC7BlB;QACAmB,OAAO/B,QAAQ+B,KAAK;QACpBP,MAAMxB,QAAQwB,IAAI;QAClBQ,MAAMhC,QAAQgC,IAAI;QAClBlB;QACAb;QACAgC,YAAY;YACVjB,MAAM;YACNM,cAAc;YACdH,gBAAgB;YAChBI,gBAAgB;YAChBM,gBAAgB;QAClB;QACAb;QACAM;QACAH;QACAI;QACAM;IACF;IAEA,OAAOC;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/RatingItem/useRatingItem.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { getIntrinsicElementProps, slot, useMergedRefs } from '@fluentui/react-utilities';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport type { RatingItemBaseProps, RatingItemBaseState, RatingItemProps, RatingItemState } from './RatingItem.types';\nimport { useRatingItemContextValue_unstable } from '../../contexts/RatingItemContext';\n\nconst defaultItemLabel = (num: number) => num + '';\n\n/**\n * Create the state required to render RatingItem.\n *\n * The returned state can be modified with hooks such as useRatingItemStyles_unstable,\n * before being passed to renderRatingItem_unstable.\n *\n * @param props - props from this instance of RatingItem\n * @param ref - reference to root HTMLElement of RatingItem\n */\nexport const useRatingItem_unstable = (props: RatingItemProps, ref: React.Ref<HTMLSpanElement>): RatingItemState => {\n const context = useRatingItemContextValue_unstable();\n const state = useRatingItemBase_unstable(props, ref);\n\n return {\n ...state,\n color: context.color,\n size: context.size,\n };\n};\n\n/**\n * Base hook for RatingItem component. Manages state related to fill width calculation,\n * radio input slots (for ARIA rating interaction), icon slots, and interactive mode —\n * without design props (color, size from context).\n *\n * @param props - props from this instance of RatingItem\n * @param ref - reference to root HTMLElement of RatingItem\n */\nexport const useRatingItemBase_unstable = (\n props: RatingItemBaseProps,\n ref: React.Ref<HTMLSpanElement>,\n): RatingItemBaseState => {\n const context = useRatingItemContextValue_unstable();\n const { value = 0 } = props;\n const { itemLabel = defaultItemLabel, iconFilled: IconFilled, iconOutline: IconOutline } = context;\n\n const ratingValue = Math.round((context.value || 0) * 2) / 2; // round to the nearest 0.5\n\n const displayedRatingValue = context.hoveredValue ?? ratingValue;\n\n const appearance = context.interactive ? 'outline' : 'filled';\n\n let iconFillWidth;\n if (context.compact || displayedRatingValue >= value) {\n iconFillWidth = 1;\n } else if (displayedRatingValue >= value - 0.5) {\n iconFillWidth = 0.5;\n } else {\n iconFillWidth = 0;\n }\n\n const root = slot.always(\n getIntrinsicElementProps('span', {\n ref: useMergedRefs(useFocusWithin<HTMLSpanElement>(), ref),\n ...props,\n }),\n { elementType: 'span' },\n );\n\n let unselectedIcon;\n if (iconFillWidth < 1) {\n unselectedIcon = slot.always(props.unselectedIcon, {\n defaultProps: {\n children: appearance === 'filled' ? <IconFilled /> : <IconOutline />,\n 'aria-hidden': true,\n },\n elementType: 'div',\n });\n }\n\n let selectedIcon;\n if (iconFillWidth > 0) {\n selectedIcon = slot.always(props.selectedIcon, {\n defaultProps: {\n children: <IconFilled />,\n 'aria-hidden': true,\n },\n elementType: 'div',\n });\n }\n\n let halfValueInput;\n if (context.interactive && context.step === 0.5) {\n halfValueInput = slot.always(props.halfValueInput, {\n defaultProps: {\n type: 'radio',\n name: context.name,\n value: value - 0.5,\n checked: ratingValue === value - 0.5,\n 'aria-label': itemLabel(value - 0.5),\n onChange: () => {\n // This empty onChange handler silences an incorrect React warning about not using onChange for a controlled input.\n // The parent Rating component has the real onChange handler to listen to change events from this input.\n },\n },\n elementType: 'input',\n });\n }\n\n let fullValueInput;\n if (context.interactive) {\n fullValueInput = slot.always(props.fullValueInput, {\n defaultProps: {\n type: 'radio',\n name: context.name,\n value,\n checked: ratingValue === value,\n 'aria-label': itemLabel(value),\n onChange: () => {\n // This empty onChange handler silences an incorrect React warning about not using onChange for a controlled input.\n // The parent Rating component has the real onChange handler to listen to change events from this input.\n },\n },\n\n elementType: 'input',\n });\n }\n\n return {\n appearance,\n step: context.step,\n iconFillWidth,\n value,\n components: {\n root: 'span',\n selectedIcon: 'div',\n unselectedIcon: 'div',\n halfValueInput: 'input',\n fullValueInput: 'input',\n },\n root,\n selectedIcon,\n unselectedIcon,\n halfValueInput,\n fullValueInput,\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","useMergedRefs","useFocusWithin","useRatingItemContextValue_unstable","defaultItemLabel","num","useRatingItem_unstable","props","ref","context","state","useRatingItemBase_unstable","color","size","value","itemLabel","iconFilled","IconFilled","iconOutline","IconOutline","ratingValue","Math","round","displayedRatingValue","hoveredValue","appearance","interactive","iconFillWidth","compact","root","always","elementType","unselectedIcon","defaultProps","children","selectedIcon","halfValueInput","step","type","name","checked","onChange","fullValueInput","components"],"mappings":"AAAA;;;;;;;;;;;;8BAsCaa;;;IAnBAL,sBAAAA;;;;;iEAjBU,QAAQ;gCAC+B,4BAA4B;8BAC3D,0BAA0B;mCAEN,mCAAmC;AAEtF,MAAMF,mBAAmB,CAACC,MAAgBA,MAAM;AAWzC,+BAA+B,CAACE,OAAwBC;IAC7D,MAAMC,cAAUN,qDAAAA;IAChB,MAAMO,QAAQC,2BAA2BJ,O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G;QACrBQ,eAAenC,oBAAAA,CAAK8B,MAAM,CAACvB,MAAM4B,YAAY,EAAE;YAC7CF,cAAc;gBACZC,UAAAA,WAAAA,GAAU,OAAA,aAAA,CAACjB,YAAAA;gBACX,eAAe;YACjB;YACAc,aAAa;QACf;IACF;IAEA,IAAIK;IACJ,IAAI3B,QAAQiB,WAAW,IAAIjB,QAAQ4B,IAAI,KAAK,KAAK;QAC/CD,iBAAiBpC,oBAAAA,CAAK8B,MAAM,CAACvB,MAAM6B,cAAc,EAAE;YACjDH,cAAc;gBACZK,MAAM;gBACNC,MAAM9B,QAAQ8B,IAAI;gBAClBzB,OAAOA,QAAQ;gBACf0B,SAASpB,gBAAgBN,QAAQ;gBACjC,cAAcC,UAAUD,QAAQ;gBAChC2B,UAAU;gBACR,mHAAmH;gBACnH,wGAAwG;gBAC1G;YACF;YACAV,aAAa;QACf;IACF;IAEA,IAAIW;IACJ,IAAIjC,QAAQiB,WAAW,EAAE;QACvBgB,iBAAiB1C,oBAAAA,CAAK8B,MAAM,CAACvB,MAAMmC,cAAc,EAAE;YACjDT,cAAc;gBACZK,MAAM;gBACNC,MAAM9B,QAAQ8B,IAAI;gBAClBzB;gBACA0B,SAASpB,gBAAgBN;gBACzB,cAAcC,UAAUD;gBACxB2B,UAAU;gBACR,mHAAmH;gBACnH,wGAAwG;gBAC1G;YACF;YAEAV,aAAa;QACf;IACF;IAEA,OAAO;QACLN;QACAY,MAAM5B,QAAQ4B,IAAI;QAClBV;QACAb;QACA6B,YAAY;YACVd,MAAM;YACNM,cAAc;YACdH,gBAAgB;YAChBI,gBAAgB;YAChBM,gBAAgB;QAClB;QACAb;QACAM;QACAH;QACAI;QACAM;IACF;AACF,EAAE"}
@@ -22,12 +22,11 @@ _export(exports, {
22
22
  });
23
23
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
24
24
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
25
- const _reacticons = require("@fluentui/react-icons");
26
25
  const RatingItemContext = /*#__PURE__*/ _react.createContext(undefined);
27
26
  const ratingItemContextDefaultValue = {
28
27
  color: 'neutral',
29
- iconFilled: _reacticons.StarFilled,
30
- iconOutline: _reacticons.StarRegular,
28
+ iconFilled: 'span',
29
+ iconOutline: 'span',
31
30
  step: 1,
32
31
  size: 'medium'
33
32
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contexts/RatingItemContext.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { RatingItemContextValue } from '../RatingItem';\nimport { StarFilled, StarRegular } from '@fluentui/react-icons';\n\n/**\n * RatingContext is provided by Rating, and is consumed by Rating to determine default values of some props.\n */\nexport const RatingItemContext = React.createContext<RatingItemContextValue | undefined>(undefined);\nconst ratingItemContextDefaultValue: RatingItemContextValue = {\n color: 'neutral',\n iconFilled: StarFilled,\n iconOutline: StarRegular,\n step: 1,\n size: 'medium',\n};\nexport const RatingItemProvider = RatingItemContext.Provider;\n\n/**\n * Get the value of the RatingContext.\n */\nexport const useRatingItemContextValue_unstable = (): RatingItemContextValue =>\n React.useContext(RatingItemContext) || ratingItemContextDefaultValue;\n"],"names":["React","StarFilled","StarRegular","RatingItemContext","createContext","undefined","ratingItemContextDefaultValue","color","iconFilled","iconOutline","step","size","RatingItemProvider","Provider","useRatingItemContextValue_unstable","useContext"],"mappings":"AAAA;;;;;;;;;;;;qBASaG;;;sBAQAS;;;sCAKAE;;;;;iEApBU,QAAQ;4BAES,wBAAwB;AAKzD,MAAMX,oBAAAA,WAAAA,GAAoBH,OAAMI,aAAa,CAAqCC,WAAW;AACpG,MAAMC,gCAAwD;IAC5DC,OAAO;IACPC,YAAYP,sBAAAA;IACZQ,aAAaP,uBAAAA;IACbQ,MAAM;IACNC,MAAM;AACR;AACO,MAAMC,qBAAqBT,kBAAkBU,QAAQ,CAAC;AAKtD,MAAMC,qCAAqC,IAChDd,OAAMe,UAAU,CAACZ,sBAAsBG,8BAA8B"}
1
+ {"version":3,"sources":["../src/contexts/RatingItemContext.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { RatingItemContextValue } from '../RatingItem';\n\n/**\n * RatingContext is provided by Rating, and is consumed by Rating to determine default values of some props.\n */\nexport const RatingItemContext = React.createContext<RatingItemContextValue | undefined>(undefined);\nconst ratingItemContextDefaultValue: RatingItemContextValue = {\n color: 'neutral',\n iconFilled: 'span',\n iconOutline: 'span',\n step: 1,\n size: 'medium',\n};\nexport const RatingItemProvider = RatingItemContext.Provider;\n\n/**\n * Get the value of the RatingContext.\n */\nexport const useRatingItemContextValue_unstable = (): RatingItemContextValue =>\n React.useContext(RatingItemContext) || ratingItemContextDefaultValue;\n"],"names":["React","RatingItemContext","createContext","undefined","ratingItemContextDefaultValue","color","iconFilled","iconOutline","step","size","RatingItemProvider","Provider","useRatingItemContextValue_unstable","useContext"],"mappings":"AAAA;;;;;;;;;;;;qBAQaC;;;sBAQAS;;;sCAKAE;;;;;iEAnBU,QAAQ;AAMxB,MAAMX,oBAAAA,WAAAA,GAAoBD,OAAME,aAAa,CAAqCC,WAAW;AACpG,MAAMC,gCAAwD;IAC5DC,OAAO;IACPC,YAAY;IACZC,aAAa;IACbC,MAAM;IACNC,MAAM;AACR;AACO,MAAMC,qBAAqBT,kBAAkBU,QAAQ,CAAC;AAKtD,MAAMC,qCAAqC,IAChDZ,OAAMa,UAAU,CAACZ,sBAAsBG,8BAA8B"}
@@ -39,9 +39,15 @@ _export(exports, {
39
39
  renderRating_unstable: function() {
40
40
  return _Rating.renderRating_unstable;
41
41
  },
42
+ useRatingBase_unstable: function() {
43
+ return _Rating.useRatingBase_unstable;
44
+ },
42
45
  useRatingContextValues: function() {
43
46
  return _Rating.useRatingContextValues;
44
47
  },
48
+ useRatingDisplayBase_unstable: function() {
49
+ return _RatingDisplay.useRatingDisplayBase_unstable;
50
+ },
45
51
  useRatingDisplayContextValues: function() {
46
52
  return _RatingDisplay.useRatingDisplayContextValues;
47
53
  },
@@ -51,6 +57,9 @@ _export(exports, {
51
57
  useRatingDisplay_unstable: function() {
52
58
  return _RatingDisplay.useRatingDisplay_unstable;
53
59
  },
60
+ useRatingItemBase_unstable: function() {
61
+ return _RatingItem.useRatingItemBase_unstable;
62
+ },
54
63
  useRatingItemContextValue_unstable: function() {
55
64
  return _index.useRatingItemContextValue_unstable;
56
65
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Rating,\n ratingClassNames,\n renderRating_unstable,\n useRatingStyles_unstable,\n useRating_unstable,\n useRatingContextValues,\n} from './Rating';\nexport type { RatingProps, RatingSlots, RatingState, RatingOnChangeEventData, RatingContextValues } from './Rating';\nexport {\n RatingItem,\n ratingItemClassNames,\n renderRatingItem_unstable,\n useRatingItemStyles_unstable,\n useRatingItem_unstable,\n} from './RatingItem';\nexport type { RatingItemProps, RatingItemSlots, RatingItemState } from './RatingItem';\nexport { RatingItemProvider, useRatingItemContextValue_unstable } from './contexts/index';\nexport {\n RatingDisplay,\n ratingDisplayClassNames,\n renderRatingDisplay_unstable,\n useRatingDisplayStyles_unstable,\n useRatingDisplay_unstable,\n useRatingDisplayContextValues,\n} from './RatingDisplay';\nexport type {\n RatingDisplayProps,\n RatingDisplaySlots,\n RatingDisplayState,\n RatingDisplayContextValues,\n} from './RatingDisplay';\n"],"names":["Rating","ratingClassNames","renderRating_unstable","useRatingStyles_unstable","useRating_unstable","useRatingContextValues","RatingItem","ratingItemClassNames","renderRatingItem_unstable","useRatingItemStyles_unstable","useRatingItem_unstable","RatingItemProvider","useRatingItemContextValue_unstable","RatingDisplay","ratingDisplayClassNames","renderRatingDisplay_unstable","useRatingDisplayStyles_unstable","useRatingDisplay_unstable","useRatingDisplayContextValues"],"mappings":";;;;;;;;;;;IACEA,MAAM;;;;eAkBNa,4BAAa;;;eATbP,sBAAU;;IAOHK,kBAAkB;;;;eAfzBV,wBAAgB;;IAkBhBa,uBAAuB;;;;eATvBP,gCAAoB;;;eAUpBQ,2CAA4B;;;eAT5BP,qCAAyB;;;eATzBN,6BAAqB;;;eAGrBG,8BAAsB;;;eAkBtBa,4CAA6B;;;eAF7BF,8CAA+B;;;eAC/BC,wCAAyB;;;eANEL,yCAAkC;;;eAJ7DH,wCAA4B;;;eAC5BC,kCAAsB;;;eAVtBP,gCAAwB;;sBACN;eAAlBC;;;wBAEK,WAAW;4BAQX,eAAe;uBAEiD,mBAAmB;+BAQnF,kBAAkB"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n Rating,\n ratingClassNames,\n renderRating_unstable,\n useRatingStyles_unstable,\n useRating_unstable,\n useRatingContextValues,\n useRatingBase_unstable,\n} from './Rating';\nexport type {\n RatingProps,\n RatingSlots,\n RatingState,\n RatingOnChangeEventData,\n RatingContextValues,\n RatingBaseProps,\n RatingBaseState,\n} from './Rating';\nexport {\n RatingItem,\n ratingItemClassNames,\n renderRatingItem_unstable,\n useRatingItemStyles_unstable,\n useRatingItem_unstable,\n useRatingItemBase_unstable,\n} from './RatingItem';\nexport type {\n RatingItemProps,\n RatingItemSlots,\n RatingItemState,\n RatingItemBaseProps,\n RatingItemBaseState,\n} from './RatingItem';\nexport { RatingItemProvider, useRatingItemContextValue_unstable } from './contexts/index';\nexport {\n RatingDisplay,\n ratingDisplayClassNames,\n renderRatingDisplay_unstable,\n useRatingDisplayStyles_unstable,\n useRatingDisplay_unstable,\n useRatingDisplayContextValues,\n useRatingDisplayBase_unstable,\n} from './RatingDisplay';\nexport type {\n RatingDisplayProps,\n RatingDisplaySlots,\n RatingDisplayState,\n RatingDisplayContextValues,\n RatingDisplayBaseProps,\n RatingDisplayBaseState,\n} from './RatingDisplay';\n"],"names":["Rating","ratingClassNames","renderRating_unstable","useRatingStyles_unstable","useRating_unstable","useRatingContextValues","useRatingBase_unstable","RatingItem","ratingItemClassNames","renderRatingItem_unstable","useRatingItemStyles_unstable","useRatingItem_unstable","useRatingItemBase_unstable","RatingItemProvider","useRatingItemContextValue_unstable","RatingDisplay","ratingDisplayClassNames","renderRatingDisplay_unstable","useRatingDisplayStyles_unstable","useRatingDisplay_unstable","useRatingDisplayContextValues","useRatingDisplayBase_unstable"],"mappings":";;;;;;;;;;;IACEA,MAAM;;;iBAkCO;eAAbe;;;eAhBAR,sBAAU;;IAcHM;wCAAkB;;;eA/BzBZ,wBAAgB;;;eAkChBe,sCAAuB;;;eAhBvBR,gCAAoB;;;eAiBpBS,2CAA4B;;;eAhB5BR,qCAAyB;;;eAlBzBP,6BAAqB;;;eAIrBI,8BAAsB;;;eADtBD,8BAAsB;;;eAmCtBgB,4CAA6B;;;eAD7BD,4CAA6B;;;eAF7BF,8CAA+B;;;eAC/BC,wCAAyB;;;eAfzBP,sCAA0B;;IASCE,kCAAkC;;;;eAX7DJ,wCAA4B;;;eAC5BC,kCAAsB;;;eAnBtBR,gCAAwB;;;eACxBC,0BAAkB;;;wBAGb,WAAW;4BAiBX,eAAe;uBAQiD,mBAAmB;+BASnF,kBAAkB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-rating",
3
- "version": "9.3.15",
3
+ "version": "9.4.1",
4
4
  "description": "Rating component for building web experiences",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -12,12 +12,12 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@fluentui/react-jsx-runtime": "^9.4.1",
15
+ "@fluentui/react-jsx-runtime": "^9.4.2",
16
16
  "@fluentui/react-icons": "^2.0.245",
17
17
  "@fluentui/react-shared-contexts": "^9.26.2",
18
18
  "@fluentui/react-theme": "^9.2.1",
19
- "@fluentui/react-tabster": "^9.26.13",
20
- "@fluentui/react-utilities": "^9.26.2",
19
+ "@fluentui/react-tabster": "^9.26.14",
20
+ "@fluentui/react-utilities": "^9.26.3",
21
21
  "@griffel/react": "^1.5.32",
22
22
  "@swc/helpers": "^0.5.1"
23
23
  },