Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "RatingDisplay", {
enumerable: true,
get: function() {
return RatingDisplay;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _useRatingDisplay = require("./useRatingDisplay");
const _renderRatingDisplay = require("./renderRatingDisplay");
const _useRatingDisplayStylesstyles = require("./useRatingDisplayStyles.styles");
const _useRatingDisplayContextValues = require("./useRatingDisplayContextValues");
const RatingDisplay = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
const state = (0, _useRatingDisplay.useRatingDisplay_unstable)(props, ref);
const contextValues = (0, _useRatingDisplayContextValues.useRatingDisplayContextValues)(state);
(0, _useRatingDisplayStylesstyles.useRatingDisplayStyles_unstable)(state);
return (0, _renderRatingDisplay.renderRatingDisplay_unstable)(state, contextValues);
});
RatingDisplay.displayName = 'RatingDisplay';
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/RatingDisplay.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useRatingDisplay_unstable } from './useRatingDisplay';\nimport { renderRatingDisplay_unstable } from './renderRatingDisplay';\nimport { useRatingDisplayStyles_unstable } from './useRatingDisplayStyles.styles';\nimport type { RatingDisplayProps } from './RatingDisplay.types';\nimport { useRatingDisplayContextValues } from './useRatingDisplayContextValues';\n\n/**\n * RatingDisplay is a wrapper for one or more rating items that will be used to display a rating value\n * as well as the label for the rating.\n */\nexport const RatingDisplay: ForwardRefComponent<RatingDisplayProps> = React.forwardRef((props, ref) => {\n const state = useRatingDisplay_unstable(props, ref);\n const contextValues = useRatingDisplayContextValues(state);\n\n useRatingDisplayStyles_unstable(state);\n return renderRatingDisplay_unstable(state, contextValues);\n});\n\nRatingDisplay.displayName = 'RatingDisplay';\n"],"names":["RatingDisplay","React","forwardRef","props","ref","state","useRatingDisplay_unstable","contextValues","useRatingDisplayContextValues","useRatingDisplayStyles_unstable","renderRatingDisplay_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAYaA;;;eAAAA;;;;iEAZU;kCAEmB;qCACG;8CACG;+CAEF;AAMvC,MAAMA,gBAAAA,WAAAA,GAAyDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQC,IAAAA,2CAAAA,EAA0BH,OAAOC;IAC/C,MAAMG,gBAAgBC,IAAAA,4DAAAA,EAA8BH;IAEpDI,IAAAA,6DAAAA,EAAgCJ;IAChC,OAAOK,IAAAA,iDAAAA,EAA6BL,OAAOE;AAC7C;AAEAP,cAAcW,WAAW,GAAG"}
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -0,0 +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 * 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\nexport type RatingDisplayContextValues = { ratingItem: RatingItemContextValue };\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
RatingDisplay: function() {
return _RatingDisplay.RatingDisplay;
},
ratingDisplayClassNames: function() {
return _useRatingDisplayStylesstyles.ratingDisplayClassNames;
},
renderRatingDisplay_unstable: function() {
return _renderRatingDisplay.renderRatingDisplay_unstable;
},
useRatingDisplayContextValues: function() {
return _useRatingDisplayContextValues.useRatingDisplayContextValues;
},
useRatingDisplayStyles_unstable: function() {
return _useRatingDisplayStylesstyles.useRatingDisplayStyles_unstable;
},
useRatingDisplay_unstable: function() {
return _useRatingDisplay.useRatingDisplay_unstable;
}
});
const _RatingDisplay = require("./RatingDisplay");
const _renderRatingDisplay = require("./renderRatingDisplay");
const _useRatingDisplay = require("./useRatingDisplay");
const _useRatingDisplayStylesstyles = require("./useRatingDisplayStyles.styles");
const _useRatingDisplayContextValues = require("./useRatingDisplayContextValues");
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/index.ts"],"sourcesContent":["export { RatingDisplay } from './RatingDisplay';\nexport type {\n RatingDisplayContextValues,\n RatingDisplayProps,\n RatingDisplaySlots,\n RatingDisplayState,\n} from './RatingDisplay.types';\nexport { renderRatingDisplay_unstable } from './renderRatingDisplay';\nexport { useRatingDisplay_unstable } from './useRatingDisplay';\nexport { ratingDisplayClassNames, useRatingDisplayStyles_unstable } from './useRatingDisplayStyles.styles';\nexport { useRatingDisplayContextValues } from './useRatingDisplayContextValues';\n"],"names":["RatingDisplay","ratingDisplayClassNames","renderRatingDisplay_unstable","useRatingDisplayContextValues","useRatingDisplayStyles_unstable","useRatingDisplay_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,aAAa;eAAbA,4BAAa;;IASbC,uBAAuB;eAAvBA,qDAAuB;;IAFvBC,4BAA4B;eAA5BA,iDAA4B;;IAG5BC,6BAA6B;eAA7BA,4DAA6B;;IADJC,+BAA+B;eAA/BA,6DAA+B;;IADxDC,yBAAyB;eAAzBA,2CAAyB;;;+BARJ;qCAOe;kCACH;8CAC+B;+CAC3B"}
@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "renderRatingDisplay_unstable", {
enumerable: true,
get: function() {
return renderRatingDisplay_unstable;
}
});
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
const _reactutilities = require("@fluentui/react-utilities");
const _RatingItemContext = require("../../contexts/RatingItemContext");
const renderRatingDisplay_unstable = (state, contextValues)=>{
(0, _reactutilities.assertSlots)(state);
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_RatingItemContext.RatingItemProvider, {
value: contextValues.ratingItem,
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
children: [
state.root.children,
state.valueText && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.valueText, {}),
state.countText && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.countText, {})
]
})
});
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/renderRatingDisplay.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { RatingDisplayState, RatingDisplaySlots, RatingDisplayContextValues } from './RatingDisplay.types';\nimport { RatingItemProvider } from '../../contexts/RatingItemContext';\n\n/**\n * Render the final JSX of RatingDisplay\n */\nexport const renderRatingDisplay_unstable = (state: RatingDisplayState, contextValues: RatingDisplayContextValues) => {\n assertSlots<RatingDisplaySlots>(state);\n\n return (\n <RatingItemProvider value={contextValues.ratingItem}>\n <state.root>\n {state.root.children}\n {state.valueText && <state.valueText />}\n {state.countText && <state.countText />}\n </state.root>\n </RatingItemProvider>\n );\n};\n"],"names":["renderRatingDisplay_unstable","state","contextValues","assertSlots","_jsx","RatingItemProvider","value","ratingItem","_jsxs","root","children","valueText","countText"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;4BATb;gCAE4B;mCAEO;AAK5B,MAAMA,+BAA+B,CAACC,OAA2BC;IACtEC,IAAAA,2BAAAA,EAAgCF;IAEhC,OAAA,WAAA,GACEG,IAAAA,eAAA,EAACC,qCAAAA,EAAAA;QAAmBC,OAAOJ,cAAcK,UAAU;kBACjD,WAAA,GAAAC,IAAAA,gBAAA,EAACP,MAAMQ,IAAI,EAAA;;gBACRR,MAAMQ,IAAI,CAACC,QAAQ;gBACnBT,MAAMU,SAAS,IAAA,WAAA,GAAIP,IAAAA,eAAA,EAACH,MAAMU,SAAS,EAAA,CAAA;gBACnCV,MAAMW,SAAS,IAAA,WAAA,GAAIR,IAAAA,eAAA,EAACH,MAAMW,SAAS,EAAA,CAAA;;;;AAI5C"}
@@ -0,0 +1,82 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useRatingDisplay_unstable", {
enumerable: true,
get: function() {
return useRatingDisplay_unstable;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const _reactutilities = require("@fluentui/react-utilities");
const _reacticons = require("@fluentui/react-icons");
const _RatingItem = require("../RatingItem/RatingItem");
const useRatingDisplay_unstable = (props, ref)=>{
const { color = 'neutral', count, compact = false, icon = _reacticons.StarFilled, max = 5, size = 'medium', value } = props;
const valueTextId = (0, _reactutilities.useId)('rating-value-');
const countTextId = (0, _reactutilities.useId)('rating-count-');
// Generate the child RatingItems and memoize them to prevent unnecessary re-rendering
const rootChildren = _react.useMemo(()=>{
return compact ? /*#__PURE__*/ _react.createElement(_RatingItem.RatingItem, {
value: 1,
key: 1,
"aria-hidden": true
}) : Array.from(Array(max), (_, i)=>/*#__PURE__*/ _react.createElement(_RatingItem.RatingItem, {
value: i + 1,
key: i + 1,
"aria-hidden": true
}));
}, [
compact,
max
]);
const state = {
color,
compact,
icon,
max,
size,
value,
components: {
root: 'div',
valueText: 'span',
countText: 'span'
},
root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
ref,
children: rootChildren,
role: 'img',
...props
}), {
elementType: 'div'
}),
valueText: _reactutilities.slot.optional(props.valueText, {
renderByDefault: value !== undefined,
defaultProps: {
children: value,
id: valueTextId,
'aria-hidden': true
},
elementType: 'span'
}),
countText: _reactutilities.slot.optional(props.countText, {
renderByDefault: count !== undefined,
defaultProps: {
children: count === null || count === void 0 ? void 0 : count.toLocaleString(),
id: countTextId,
'aria-hidden': true
},
elementType: 'span'
})
};
if (!state.root['aria-label'] && !state.root['aria-labelledby']) {
var _state_valueText, _state_countText;
state.root['aria-labelledby'] = [
(_state_valueText = state.valueText) === null || _state_valueText === void 0 ? void 0 : _state_valueText.id,
(_state_countText = state.countText) === null || _state_countText === void 0 ? void 0 : _state_countText.id
].filter(Boolean).join(' ');
}
return state;
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/useRatingDisplay.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot, useId } from '@fluentui/react-utilities';\nimport type { RatingDisplayProps, RatingDisplayState } 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', count, compact = false, icon = StarFilled, max = 5, size = 'medium', 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: RatingDisplayState = {\n color,\n compact,\n icon,\n max,\n size,\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":["useRatingDisplay_unstable","props","ref","color","count","compact","icon","StarFilled","max","size","value","valueTextId","useId","countTextId","rootChildren","React","useMemo","createElement","RatingItem","key","aria-hidden","Array","from","_","i","state","components","root","valueText","countText","slot","always","getIntrinsicElementProps","children","role","elementType","optional","renderByDefault","undefined","defaultProps","id","toLocaleString","filter","Boolean","join"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAeaA;;;eAAAA;;;;iEAfU;gCAC+B;4BAE3B;4BACA;AAWpB,MAAMA,4BAA4B,CACvCC,OACAC;IAEA,MAAM,EAAEC,QAAQ,SAAS,EAAEC,KAAK,EAAEC,UAAU,KAAK,EAAEC,OAAOC,sBAAU,EAAEC,MAAM,CAAC,EAAEC,OAAO,QAAQ,EAAEC,KAAK,EAAE,GAAGT;IAE1G,MAAMU,cAAcC,IAAAA,qBAAAA,EAAM;IAC1B,MAAMC,cAAcD,IAAAA,qBAAAA,EAAM;IAE1B,sFAAsF;IACtF,MAAME,eAAeC,OAAMC,OAAO,CAAC;QACjC,OAAOX,UAAAA,WAAAA,GACLU,OAAAE,aAAA,CAACC,sBAAAA,EAAAA;YAAWR,OAAO;YAAGS,KAAK;YAAGC,eAAa;aAE3CC,MAAMC,IAAI,CAACD,MAAMb,MAAM,CAACe,GAAGC,IAAAA,WAAAA,GAAMT,OAAAE,aAAA,CAACC,sBAAAA,EAAAA;gBAAWR,OAAOc,IAAI;gBAAGL,KAAKK,IAAI;gBAAGJ,eAAa;;IAExF,GAAG;QAACf;QAASG;KAAI;IAEjB,MAAMiB,QAA4B;QAChCtB;QACAE;QACAC;QACAE;QACAC;QACAC;QACAgB,YAAY;YACVC,MAAM;YACNC,WAAW;YACXC,WAAW;QACb;QACAF,MAAMG,oBAAAA,CAAKC,MAAM,CACfC,IAAAA,wCAAAA,EAAyB,OAAO;YAC9B9B;YACA+B,UAAUnB;YACVoB,MAAM;YACN,GAAGjC,KAAK;QACV,IACA;YAAEkC,aAAa;QAAM;QAEvBP,WAAWE,oBAAAA,CAAKM,QAAQ,CAACnC,MAAM2B,SAAS,EAAE;YACxCS,iBAAiB3B,UAAU4B;YAC3BC,cAAc;gBAAEN,UAAUvB;gBAAO8B,IAAI7B;gBAAa,eAAe;YAAK;YACtEwB,aAAa;QACf;QACAN,WAAWC,oBAAAA,CAAKM,QAAQ,CAACnC,MAAM4B,SAAS,EAAE;YACxCQ,iBAAiBjC,UAAUkC;YAC3BC,cAAc;gBAAEN,UAAU7B,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,MAAOqC,cAAc;gBAAID,IAAI3B;gBAAa,eAAe;YAAK;YACxFsB,aAAa;QACf;IACF;IACA,IAAI,CAACV,MAAME,IAAI,CAAC,aAAa,IAAI,CAACF,MAAME,IAAI,CAAC,kBAAkB,EAAE;YAC9BF,kBAAqBA;QAAtDA,MAAME,IAAI,CAAC,kBAAkB,GAAG;YAACF,CAAAA,mBAAAA,MAAMG,SAAS,AAATA,MAAS,QAAfH,qBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,iBAAiBe,EAAE;YAAEf,CAAAA,mBAAAA,MAAMI,SAAS,AAATA,MAAS,QAAfJ,qBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,iBAAiBe,EAAE;SAAC,CAACE,MAAM,CAACC,SAASC,IAAI,CAAC;IAClG;IACA,OAAOnB;AACT"}
@@ -0,0 +1,34 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "useRatingDisplayContextValues", {
enumerable: true,
get: function() {
return useRatingDisplayContextValues;
}
});
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
const useRatingDisplayContextValues = (state)=>{
const { color, compact, icon, size, value } = state;
const ratingItem = _react.useMemo(()=>({
color,
compact,
iconFilled: icon,
iconOutline: icon,
interactive: false,
step: 0.5,
size,
value
}), [
color,
compact,
icon,
size,
value
]);
return {
ratingItem
};
};
@@ -0,0 +1 @@
{"version":3,"sources":["../src/components/RatingDisplay/useRatingDisplayContextValues.ts"],"sourcesContent":["import * 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":["useRatingDisplayContextValues","state","color","compact","icon","size","value","ratingItem","React","useMemo","iconFilled","iconOutline","interactive","step"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAIaA;;;eAAAA;;;;iEAJU;AAIhB,MAAMA,gCAAgC,CAACC;IAC5C,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGL;IAE9C,MAAMM,aAAaC,OAAMC,OAAO,CAC9B,IAAO,CAAA;YACLP;YACAC;YACAO,YAAYN;YACZO,aAAaP;YACbQ,aAAa;YACbC,MAAM;YACNR;YACAC;QACF,CAAA,GACA;QAACJ;QAAOC;QAASC;QAAMC;QAAMC;KAAM;IAGrC,OAAO;QAAEC;IAAW;AACtB"}
@@ -0,0 +1,85 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
ratingDisplayClassNames: function() {
return ratingDisplayClassNames;
},
useRatingDisplayStyles_unstable: function() {
return useRatingDisplayStyles_unstable;
}
});
const _react = require("@griffel/react");
const ratingDisplayClassNames = {
root: 'fui-RatingDisplay',
valueText: 'fui-RatingDisplay__valueText',
countText: 'fui-RatingDisplay__countText'
};
/**
* Styles for the root slot
*/ const useRootClassName = /*#__PURE__*/ (0, _react.__resetStyles)("rxxdqwu", null, [
".rxxdqwu{display:flex;flex-wrap:wrap;align-items:center;}"
]);
const useLabelClassName = /*#__PURE__*/ (0, _react.__resetStyles)("rkwnos5", "rwei36a", [
".rkwnos5{color:var(--colorNeutralForeground1);margin-left:var(--spacingHorizontalXS);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}",
".rwei36a{color:var(--colorNeutralForeground1);margin-right:var(--spacingHorizontalXS);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}"
]);
const useLabelStyles = /*#__PURE__*/ (0, _react.__styles)({
large: {
Be2twd7: "fkhj508",
Bg96gwp: "f1i3iumi",
Frg6f3: [
"f1t5qyk5",
"f1ikr372"
]
},
extraLarge: {
Be2twd7: "fod5ikn",
Bg96gwp: "faaz57k",
Frg6f3: [
"foyynoy",
"f1vcna3q"
]
},
strong: {
Bhrd7zp: "fl43uef"
},
divider: {
Ftih45: "f169p45e"
}
}, {
d: [
".fkhj508{font-size:var(--fontSizeBase300);}",
".f1i3iumi{line-height:var(--lineHeightBase300);}",
".f1t5qyk5{margin-left:var(--spacingHorizontalSNudge);}",
".f1ikr372{margin-right:var(--spacingHorizontalSNudge);}",
".fod5ikn{font-size:var(--fontSizeBase400);}",
".faaz57k{line-height:var(--lineHeightBase400);}",
".foyynoy{margin-left:var(--spacingHorizontalS);}",
".f1vcna3q{margin-right:var(--spacingHorizontalS);}",
".fl43uef{font-weight:var(--fontWeightSemibold);}",
".f169p45e::before{content:\"\xB7 \";}"
]
});
const useRatingDisplayStyles_unstable = (state)=>{
'use no memo';
const { size } = state;
const rootClassName = useRootClassName();
state.root.className = (0, _react.mergeClasses)(ratingDisplayClassNames.root, rootClassName, state.root.className);
const labelClassName = useLabelClassName();
const labelStyles = useLabelStyles();
if (state.valueText) {
state.valueText.className = (0, _react.mergeClasses)(ratingDisplayClassNames.valueText, labelClassName, labelStyles.strong, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText.className);
}
if (state.countText) {
state.countText.className = (0, _react.mergeClasses)(ratingDisplayClassNames.countText, labelClassName, size === 'large' && labelStyles.large, size === 'extra-large' && labelStyles.extraLarge, state.valueText && labelStyles.divider, state.countText.className);
}
return state;
};
@@ -0,0 +1 @@
{"version":3,"sources":["useRatingDisplayStyles.styles.js"],"sourcesContent":["import { 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"],"names":["ratingDisplayClassNames","useRatingDisplayStyles_unstable","root","valueText","countText","useRootClassName","__resetStyles","useLabelClassName","useLabelStyles","__styles","large","Be2twd7","Bg96gwp","Frg6f3","extraLarge","strong","Bhrd7zp","divider","Ftih45","d","state","size","rootClassName","className","mergeClasses","labelClassName","labelStyles"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEaA,uBAAuB;eAAvBA;;IAuCIC,+BAA+B;eAA/BA;;;uBAzCyC;AAEnD,MAAMD,0BAA0B;IACnCE,MAAM;IACNC,WAAW;IACXC,WAAW;AACf;AACA;;CAEA,GAAI,MAAMC,mBAAgB,WAAA,GAAGC,IAAAA,oBAAA,EAAA,WAAA,MAAA;IAAA;CAI5B;AACD,MAAMC,oBAAiB,WAAA,GAAGD,IAAAA,oBAAA,EAAA,WAAA,WAAA;IAAA;IAAA;CAIzB;AACD,MAAME,iBAAc,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAC,OAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;YAAA;YAAA;SAAA;IAAA;IAAAC,YAAA;QAAAH,SAAA;QAAAC,SAAA;QAAAC,QAAA;YAAA;YAAA;SAAA;IAAA;IAAAE,QAAA;QAAAC,SAAA;IAAA;IAAAC,SAAA;QAAAC,QAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA;AAsBZ,MAAMlB,kCAAmCmB,CAAAA;IAChD;IACA,MAAM,EAAEC,IAAAA,EAAM,GAAGD;IACjB,MAAME,gBAAgBjB;IACtBe,MAAMlB,IAAI,CAACqB,SAAS,GAAGC,IAAAA,mBAAY,EAACxB,wBAAwBE,IAAI,EAAEoB,eAAeF,MAAMlB,IAAI,CAACqB,SAAS;IACrG,MAAME,iBAAiBlB;IACvB,MAAMmB,cAAclB;IACpB,IAAIY,MAAMjB,SAAS,EAAE;QACjBiB,MAAMjB,SAAS,CAACoB,SAAS,GAAGC,IAAAA,mBAAY,EAACxB,wBAAwBG,SAAS,EAAEsB,gBAAgBC,YAAYX,MAAM,EAAEM,SAAS,WAAWK,YAAYhB,KAAK,EAAEW,SAAS,iBAAiBK,YAAYZ,UAAU,EAAEM,MAAMjB,SAAS,CAACoB,SAAS;IACtO;IACA,IAAIH,MAAMhB,SAAS,EAAE;QACjBgB,MAAMhB,SAAS,CAACmB,SAAS,GAAGC,IAAAA,mBAAY,EAACxB,wBAAwBI,SAAS,EAAEqB,gBAAgBJ,SAAS,WAAWK,YAAYhB,KAAK,EAAEW,SAAS,iBAAiBK,YAAYZ,UAAU,EAAEM,MAAMjB,SAAS,IAAIuB,YAAYT,OAAO,EAAEG,MAAMhB,SAAS,CAACmB,SAAS;IAC1P;IACA,OAAOH;AACX"}