@fluentui/react-rating 9.74.7-experimental.cli-api.20261006-ccaa611d58.0 → 9.75.0-experimental.css-modules.20261031-810ab07afb.0
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.
- package/CHANGELOG.md +32 -10
- package/lib/components/Rating/Rating.js.map +1 -1
- package/lib/components/Rating/Rating.module.css +6 -0
- package/lib/components/Rating/Rating.types.js.map +1 -1
- package/lib/components/Rating/index.js.map +1 -1
- package/lib/components/Rating/renderRating.js +2 -2
- package/lib/components/Rating/renderRating.js.map +1 -1
- package/lib/components/Rating/useRating.js +1 -2
- package/lib/components/Rating/useRating.js.map +1 -1
- package/lib/components/Rating/useRatingContextValues.js.map +1 -1
- package/lib/components/Rating/useRatingStyles.styles.css.js +9 -0
- package/lib/components/Rating/useRatingStyles.styles.css.js.map +1 -0
- package/lib/components/Rating/useRatingStyles.styles.raw.css.js +9 -0
- package/lib/components/Rating/useRatingStyles.styles.raw.css.js.map +1 -0
- package/lib/components/Rating/useRatingStyles.styles.raw.js.map +1 -1
- package/lib/components/RatingDisplay/RatingDisplay.js.map +1 -1
- package/lib/components/RatingDisplay/RatingDisplay.module.css +33 -0
- package/lib/components/RatingDisplay/RatingDisplay.types.js.map +1 -1
- package/lib/components/RatingDisplay/index.js.map +1 -1
- package/lib/components/RatingDisplay/renderRatingDisplay.js +2 -2
- package/lib/components/RatingDisplay/renderRatingDisplay.js.map +1 -1
- package/lib/components/RatingDisplay/useRatingDisplay.js.map +1 -1
- package/lib/components/RatingDisplay/useRatingDisplayContextValues.js.map +1 -1
- package/lib/components/RatingDisplay/useRatingDisplayStyles.styles.css.js +17 -0
- package/lib/components/RatingDisplay/useRatingDisplayStyles.styles.css.js.map +1 -0
- package/lib/components/RatingDisplay/useRatingDisplayStyles.styles.raw.css.js +17 -0
- package/lib/components/RatingDisplay/useRatingDisplayStyles.styles.raw.css.js.map +1 -0
- package/lib/components/RatingDisplay/useRatingDisplayStyles.styles.raw.js.map +1 -1
- package/lib/components/RatingItem/RatingItem.js.map +1 -1
- package/lib/components/RatingItem/RatingItem.module.css +121 -0
- package/lib/components/RatingItem/RatingItem.types.js.map +1 -1
- package/lib/components/RatingItem/index.js.map +1 -1
- package/lib/components/RatingItem/renderRatingItem.js +2 -2
- package/lib/components/RatingItem/renderRatingItem.js.map +1 -1
- package/lib/components/RatingItem/useRatingItem.js +1 -1
- package/lib/components/RatingItem/useRatingItem.js.map +1 -1
- package/lib/components/RatingItem/useRatingItemStyles.styles.css.js +25 -0
- package/lib/components/RatingItem/useRatingItemStyles.styles.css.js.map +1 -0
- package/lib/components/RatingItem/useRatingItemStyles.styles.raw.css.js +25 -0
- package/lib/components/RatingItem/useRatingItemStyles.styles.raw.css.js.map +1 -0
- package/lib/components/RatingItem/useRatingItemStyles.styles.raw.js.map +1 -1
- package/lib/contexts/RatingItemContext.js.map +1 -1
- package/lib/contexts/index.js.map +1 -1
- package/lib-commonjs/Rating.cjs +8 -8
- package/lib-commonjs/RatingDisplay.cjs +8 -8
- package/lib-commonjs/RatingItem.cjs +7 -7
- package/lib-commonjs/components/Rating/Rating.cjs.map +1 -1
- package/lib-commonjs/components/Rating/Rating.module.css +6 -0
- package/lib-commonjs/components/Rating/Rating.types.cjs.map +1 -1
- package/lib-commonjs/components/Rating/index.cjs +8 -8
- package/lib-commonjs/components/Rating/index.cjs.map +1 -1
- package/lib-commonjs/components/Rating/renderRating.cjs.map +1 -1
- package/lib-commonjs/components/Rating/useRating.cjs +4 -5
- package/lib-commonjs/components/Rating/useRating.cjs.map +1 -1
- package/lib-commonjs/components/Rating/useRatingContextValues.cjs.map +1 -1
- package/lib-commonjs/components/Rating/useRatingStyles.styles.cjs +3 -3
- package/lib-commonjs/components/Rating/useRatingStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/Rating/useRatingStyles.styles.css.cjs +28 -0
- package/lib-commonjs/components/Rating/useRatingStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/Rating/useRatingStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/Rating/useRatingStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/Rating/useRatingStyles.styles.raw.css.cjs +28 -0
- package/lib-commonjs/components/Rating/useRatingStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/RatingDisplay/RatingDisplay.cjs.map +1 -1
- package/lib-commonjs/components/RatingDisplay/RatingDisplay.module.css +33 -0
- package/lib-commonjs/components/RatingDisplay/RatingDisplay.types.cjs.map +1 -1
- package/lib-commonjs/components/RatingDisplay/index.cjs +8 -8
- package/lib-commonjs/components/RatingDisplay/index.cjs.map +1 -1
- package/lib-commonjs/components/RatingDisplay/renderRatingDisplay.cjs.map +1 -1
- package/lib-commonjs/components/RatingDisplay/useRatingDisplay.cjs +3 -3
- package/lib-commonjs/components/RatingDisplay/useRatingDisplay.cjs.map +1 -1
- package/lib-commonjs/components/RatingDisplay/useRatingDisplayContextValues.cjs.map +1 -1
- package/lib-commonjs/components/RatingDisplay/useRatingDisplayStyles.styles.cjs +3 -3
- package/lib-commonjs/components/RatingDisplay/useRatingDisplayStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/RatingDisplay/useRatingDisplayStyles.styles.css.cjs +36 -0
- package/lib-commonjs/components/RatingDisplay/useRatingDisplayStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/RatingDisplay/useRatingDisplayStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/RatingDisplay/useRatingDisplayStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/RatingDisplay/useRatingDisplayStyles.styles.raw.css.cjs +36 -0
- package/lib-commonjs/components/RatingDisplay/useRatingDisplayStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/RatingItem/RatingItem.cjs.map +1 -1
- package/lib-commonjs/components/RatingItem/RatingItem.module.css +121 -0
- package/lib-commonjs/components/RatingItem/RatingItem.types.cjs.map +1 -1
- package/lib-commonjs/components/RatingItem/index.cjs +7 -7
- package/lib-commonjs/components/RatingItem/index.cjs.map +1 -1
- package/lib-commonjs/components/RatingItem/renderRatingItem.cjs.map +1 -1
- package/lib-commonjs/components/RatingItem/useRatingItem.cjs +4 -4
- package/lib-commonjs/components/RatingItem/useRatingItem.cjs.map +1 -1
- package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.cjs +3 -3
- package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.css.cjs +44 -0
- package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.raw.css.cjs +44 -0
- package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/contexts/RatingItemContext.cjs +4 -4
- package/lib-commonjs/contexts/RatingItemContext.cjs.map +1 -1
- package/lib-commonjs/contexts/index.cjs +4 -4
- package/lib-commonjs/contexts/index.cjs.map +1 -1
- package/lib-commonjs/index.cjs +23 -23
- package/lib-commonjs/index.cjs.map +1 -1
- package/package.json +13 -13
- package/dist/metadata/api/api-root.json +0 -1
- package/dist/metadata/index.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
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 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;;;;;;;;;;;;;;;;;;;uBAE8C,iBAAiB;AAIxD,MAAME,mBAAgD;IAC3DC,MAAM;AACR,EAAE;AAEF;;CAEC,GAED,MAAMC,uBAAmBJ,sBAAAA,EAAgB;IACvCK,SAAS;IACTC,UAAU;AACZ;AAKO,MAAMC,2BAA2B,CAACC;IACvC,MAAMC,gBAAgBL;IACtB,oDAAoD;IACpDI,MAAML,IAAI,CAACO,SAAS,OAAGT,mBAAAA,EAAaC,iBAAiBC,IAAI,EAAEM,eAAeD,MAAML,IAAI,CAACO,SAAS;IAC9F,OAAOF;AACT,EAAE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get ratingClassNames () {
|
|
13
|
+
return ratingClassNames;
|
|
14
|
+
},
|
|
15
|
+
get useRatingStyles_unstable () {
|
|
16
|
+
return useRatingStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _clsx = require("clsx");
|
|
21
|
+
const _Ratingmodulecss = /*#__PURE__*/ _interop_require_default._(require("./Rating.module.css"));
|
|
22
|
+
const ratingClassNames = {
|
|
23
|
+
root: 'fui-Rating'
|
|
24
|
+
};
|
|
25
|
+
const useRatingStyles_unstable = (state)=>{
|
|
26
|
+
state.root.className = (0, _clsx.clsx)(ratingClassNames.root, _Ratingmodulecss.default.root, state.root.className);
|
|
27
|
+
return state;
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Rating/useRatingStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { RatingSlots, RatingState } from './Rating.types';\nimport styles from './Rating.module.css';\n\nexport const ratingClassNames: SlotClassNames<RatingSlots> = {\n root: 'fui-Rating',\n};\n\nexport const useRatingStyles_unstable = (state: RatingState): RatingState => {\n state.root.className = clsx(ratingClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"names":["clsx","styles","ratingClassNames","root","useRatingStyles_unstable","state","className"],"mappings":";;;;;;;;;;;QAKaE;;;;;;;;sBALQ,OAAO;0EAGT,sBAAsB;AAElC,yBAAsD;IAC3DC,MAAM;AACR,EAAE;AAEK,MAAMC,2BAA2B,CAACC;IACvCA,MAAMF,IAAI,CAACG,SAAS,OAAGN,UAAAA,EAAKE,iBAAiBC,IAAI,EAAEF,wBAAAA,CAAOE,IAAI,EAAEE,MAAMF,IAAI,CAACG,SAAS;IACpF,OAAOD;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/RatingDisplay/RatingDisplay.tsx"],"sourcesContent":["'use client';\n\nimport * 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';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\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 useCustomStyleHook_unstable('useRatingDisplayStyles_unstable')(state);\n\n return renderRatingDisplay_unstable(state, contextValues);\n});\n\nRatingDisplay.displayName = 'RatingDisplay';\n"],"names":["React","useRatingDisplay_unstable","renderRatingDisplay_unstable","useRatingDisplayStyles_unstable","useRatingDisplayContextValues","useCustomStyleHook_unstable","RatingDisplay","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;kCAEW,wBAAqB;qCAClB,2BAAwB;8CACrB,qCAAkC;+CAEpC,qCAAkC;qCACpC,kCAAkC;AAMvE,MAAMM,gBAAAA,WAAAA,GAAyDN,OAAMO,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,YAAQT,2CAAAA,EAA0BO,OAAOC;IAC/C,MAAME,oBAAgBP,4DAAAA,EAA8BM;QAEpDP,6DAAAA,EAAgCO;QAChCL,gDAAAA,EAA4B,mCAAmCK;IAE/D,WAAOR,iDAAAA,EAA6BQ,OAAOC;AAC7C,GAAG;AAEHL,cAAcM,WAAW,GAAG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@layer fluentui {
|
|
2
|
+
.root {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-wrap: wrap;
|
|
5
|
+
align-items: center;
|
|
6
|
+
}
|
|
7
|
+
.label {
|
|
8
|
+
color: var(--colorNeutralForeground1);
|
|
9
|
+
margin-inline-start: var(--spacingHorizontalXS);
|
|
10
|
+
font-family: var(--fontFamilyBase);
|
|
11
|
+
font-size: var(--fontSizeBase200);
|
|
12
|
+
font-weight: var(--fontWeightRegular);
|
|
13
|
+
line-height: var(--lineHeightBase200);
|
|
14
|
+
}
|
|
15
|
+
.valueText {
|
|
16
|
+
font-weight: var(--fontWeightSemibold);
|
|
17
|
+
}
|
|
18
|
+
.divider {
|
|
19
|
+
&::before {
|
|
20
|
+
content: '· ';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
:where(.large) > .label {
|
|
24
|
+
font-size: var(--fontSizeBase300);
|
|
25
|
+
line-height: var(--lineHeightBase300);
|
|
26
|
+
margin-inline-start: var(--spacingHorizontalSNudge);
|
|
27
|
+
}
|
|
28
|
+
:where(.extra-large) > .label {
|
|
29
|
+
font-size: var(--fontSizeBase400);
|
|
30
|
+
line-height: var(--lineHeightBase400);
|
|
31
|
+
margin-inline-start: var(--spacingHorizontalS);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
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":""}
|
|
@@ -5,29 +5,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
RatingDisplay
|
|
12
|
+
get RatingDisplay () {
|
|
13
13
|
return _RatingDisplay.RatingDisplay;
|
|
14
14
|
},
|
|
15
|
-
ratingDisplayClassNames
|
|
15
|
+
get ratingDisplayClassNames () {
|
|
16
16
|
return _useRatingDisplayStylesstyles.ratingDisplayClassNames;
|
|
17
17
|
},
|
|
18
|
-
renderRatingDisplay_unstable
|
|
18
|
+
get renderRatingDisplay_unstable () {
|
|
19
19
|
return _renderRatingDisplay.renderRatingDisplay_unstable;
|
|
20
20
|
},
|
|
21
|
-
useRatingDisplayBase_unstable
|
|
21
|
+
get useRatingDisplayBase_unstable () {
|
|
22
22
|
return _useRatingDisplay.useRatingDisplayBase_unstable;
|
|
23
23
|
},
|
|
24
|
-
useRatingDisplayContextValues
|
|
24
|
+
get useRatingDisplayContextValues () {
|
|
25
25
|
return _useRatingDisplayContextValues.useRatingDisplayContextValues;
|
|
26
26
|
},
|
|
27
|
-
useRatingDisplayStyles_unstable
|
|
27
|
+
get useRatingDisplayStyles_unstable () {
|
|
28
28
|
return _useRatingDisplayStylesstyles.useRatingDisplayStyles_unstable;
|
|
29
29
|
},
|
|
30
|
-
useRatingDisplay_unstable
|
|
30
|
+
get useRatingDisplay_unstable () {
|
|
31
31
|
return _useRatingDisplay.useRatingDisplay_unstable;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/RatingDisplay/index.ts"],"sourcesContent":["export { RatingDisplay } from './RatingDisplay';\nexport type {\n RatingDisplayContextValues,\n RatingDisplayProps,\n RatingDisplayBaseProps,\n RatingDisplaySlots,\n RatingDisplayState,\n RatingDisplayBaseState,\n} from './RatingDisplay.types';\nexport { renderRatingDisplay_unstable } from './renderRatingDisplay';\nexport { useRatingDisplay_unstable, useRatingDisplayBase_unstable } from './useRatingDisplay';\nexport { ratingDisplayClassNames, useRatingDisplayStyles_unstable } from './useRatingDisplayStyles.styles';\nexport { useRatingDisplayContextValues } from './useRatingDisplayContextValues';\n"],"names":["RatingDisplay","renderRatingDisplay_unstable","useRatingDisplay_unstable","useRatingDisplayBase_unstable","ratingDisplayClassNames","useRatingDisplayStyles_unstable","useRatingDisplayContextValues"],"mappings":";;;;;;;;;;;;eAASA,4BAAa;;;eAWbI,qDAAuB;;;eAFvBH,iDAA4B;;;eACDE,+CAA6B;;;eAExDG,4DAA6B;;;eADJD,6DAA+B;;;eADxDH,2CAAyB;;;+BAVJ,qBAAkB;qCASH,2BAAwB;kCACI,wBAAqB;8CACrB,qCAAkC;+CAC7D,qCAAkC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
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 { JSXElement } from '@fluentui/react-utilities';\nimport type { RatingDisplayBaseState, RatingDisplaySlots, RatingDisplayContextValues } from './RatingDisplay.types';\nimport { RatingItemProvider } from '../../contexts/RatingItemContext';\n\n/**\n * Render the final JSX of RatingDisplay\n */\nexport const renderRatingDisplay_unstable = (\n state: RatingDisplayBaseState,\n contextValues: RatingDisplayContextValues,\n): JSXElement => {\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":["assertSlots","RatingItemProvider","renderRatingDisplay_unstable","state","contextValues","value","ratingItem","root","children","valueText","countText"],"mappings":";;;;+BAWaE;;;;;;;gCAVb,gDAAiD,GAEjD,SAASF,WAAW,QAAQ,4BAA4B;mCAGrB,sCAAmC;AAK/D,qCAAqC,CAC1CG,OACAC;QAEAJ,2BAAAA,EAAgCG;IAEhC,OAAA,WAAA,OACE,eAAA,EAACF,qCAAAA,EAAAA;QAAmBI,OAAOD,cAAcE,UAAU;kBACjD,WAAA,OAAA,gBAAA,EAACH,MAAMI,IAAI,EAAA;;gBACRJ,MAAMI,IAAI,CAACC,QAAQ;gBACnBL,MAAMM,SAAS,IAAA,WAAA,OAAI,eAAA,EAACN,MAAMM,SAAS,EAAA,CAAA;gBACnCN,MAAMO,SAAS,IAAA,WAAA,OAAI,eAAA,EAACP,MAAMO,SAAS,EAAA,CAAA;;;;AAI5C,EAAE"}
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
function _export(target, all) {
|
|
7
7
|
for(var name in all)Object.defineProperty(target, name, {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: all
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
useRatingDisplayBase_unstable
|
|
13
|
+
get useRatingDisplayBase_unstable () {
|
|
14
14
|
return useRatingDisplayBase_unstable;
|
|
15
15
|
},
|
|
16
|
-
useRatingDisplay_unstable
|
|
16
|
+
get useRatingDisplay_unstable () {
|
|
17
17
|
return useRatingDisplay_unstable;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
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","toLocaleString","filter","Boolean","join"],"mappings":"AAAA;;;;;;;;;;;;QA2Dac;;;QArCAR;;;;;iEApBU,QAAQ;gCACuB,4BAA4B;4BAOvD,wBAAwB;4BACxB,8BAA2B;AAW/C,kCAAkC,CACvCC,OACAC;IAEA,MAAM,EAAEC,QAAQ,SAAS,EAAEC,OAAO,QAAQ,EAAEC,OAAOP,sBAAU,EAAE,GAAGQ,WAAW,GAAGL;IAChF,MAAMM,QAAQC,8BAA8B;QAAEH;QAAM,GAAGC,SAAS;IAAC,GAAGJ;IAEpE,MAAM,EAAEO,OAAO,EAAEC,GAAG,EAAE,GAAGH;IAEzB,MAAMI,eAAejB,OAAMkB,OAAO,CAAC;QACjC,OAAOH,UAAAA,WAAAA,GACL,OAAA,aAAA,CAACV,sBAAAA,EAAAA;YAAWc,OAAO;YAAGC,KAAK;YAAGC,eAAa;aAE3CC,MAAMC,IAAI,CAACD,MAAMN,MAAM,CAACQ,GAAGC,IAAAA,WAAAA,GAAM,OAAA,aAAA,CAACpB,sBAAAA,EAAAA;gBAAWc,OAAOM,IAAI;gBAAGL,KAAKK,IAAI;gBAAGJ,eAAa;;IAExF,GAAG;QAACN;QAASC;KAAI;IAEjB,OAAO;QACL,GAAGH,KAAK;QACRa,MAAM;YACJC,UAAUV;YACV,GAAGJ,MAAMa,IAAI;QACf;QACAf;QACAF;QACAC;IACF;AACF,EAAE;AAUK,sCAAsC,CAC3CH,OACAC;IAEA,MAAM,EAAEoB,KAAK,EAAEb,UAAU,KAAK,EAAEJ,IAAI,EAAEK,MAAM,CAAC,EAAEG,KAAK,EAAE,GAAGZ;IAEzD,MAAMsB,kBAAc1B,qBAAAA,EAAM;IAC1B,MAAM2B,kBAAc3B,qBAAAA,EAAM;IAE1B,MAAMU,QAAgC;QACpCE;QACAJ;QACAK;QACAG;QACAY,YAAY;YACVL,MAAM;YACNM,WAAW;YACXC,WAAW;QACb;QACAP,MAAMxB,oBAAAA,CAAKgC,MAAM,KACfjC,wCAAAA,EAAyB,OAAO;YAC9BO;YACA2B,MAAM;YACN,GAAG5B,KAAK;QACV,IACA;YAAE6B,aAAa;QAAM;QAEvBJ,WAAW9B,oBAAAA,CAAKmC,QAAQ,CAAC9B,MAAMyB,SAAS,EAAE;YACxCM,iBAAiBnB,UAAUoB;YAC3BC,cAAc;gBAAEb,UAAUR;gBAAOsB,IAAIZ;gBAAa,eAAe;YAAK;YACtEO,aAAa;QACf;QACAH,WAAW/B,oBAAAA,CAAKmC,QAAQ,CAAC9B,MAAM0B,SAAS,EAAE;YACxCK,iBAAiBV,UAAUW;YAC3BC,cAAc;gBAAEb,QAAQ,EAAEC,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,KAAAA,IAAAA,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,SAAAA,AAAS,MAAA,QAAfnB,qBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,iBAAiB4B,EAAE;aAAE5B,mBAAAA,MAAMoB,SAAAA,AAAS,MAAA,QAAfpB,qBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,iBAAiB4B,EAAE;SAAC,CAACE,MAAM,CAACC,SAASC,IAAI,CAAC;IAClG;IACA,OAAOhC;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
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;;;;;;;;;;;;iEAEuB,QAAQ;AAIxB,MAAMC,gCAAgC,CAACC;IAC5C,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGL;IAE9C,MAAMM,aAAaR,OAAMS,OAAO,CAC9B,IAAO,CAAA;YACLN;YACAC;YACAM,YAAYL;YACZM,aAAaN;YACbO,aAAa;YACbC,MAAM;YACNP;YACAC;SACF,CAAA,EACA;QAACJ;QAAOC;QAASC;QAAMC;QAAMC;KAAM;IAGrC,OAAO;QAAEC;IAAW;AACtB,EAAE"}
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
function _export(target, all) {
|
|
7
7
|
for(var name in all)Object.defineProperty(target, name, {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: all
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
ratingDisplayClassNames
|
|
13
|
+
get ratingDisplayClassNames () {
|
|
14
14
|
return ratingDisplayClassNames;
|
|
15
15
|
},
|
|
16
|
-
useRatingDisplayStyles_unstable
|
|
16
|
+
get useRatingDisplayStyles_unstable () {
|
|
17
17
|
return useRatingDisplayStyles_unstable;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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 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"],"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"],"mappings":"AAAA,YAAY;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"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 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"],"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"],"mappings":"AAAA,YAAY;;;;;;;;;;;;QAGCK,uBAAuB;;;;eAuCnBiB,+BAA+B;;;uBAzCU,gBAAgB;AAEnE,gCAAgC;IACnChB,IAAI,EAAE,mBAAmB;IACzBC,SAAS,EAAE,8BAA8B;IACzCC,SAAS,EAAE;AACf,CAAC;AACD;;CAEA,GAAI,MAAMC,gBAAgB,GAAA,WAAA,OAAGT,oBAAA,EAAA,WAAA,MAAA;IAAA;CAI5B,CAAC;AACF,MAAMU,iBAAiB,GAAA,WAAA,GAAGV,wBAAA,EAAA,WAAA,WAAA;IAAA;IAAA;CAIzB,CAAC;AACF,MAAMW,cAAc,GAAA,WAAA,OAAGV,eAAA,EAAA;IAAAW,KAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;IAAA;IAAAC,UAAA,EAAA;QAAAH,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;IAAA;IAAAE,MAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;AAAA,GAAA;IAAAC,CAAA,EAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA,CAmBtB,CAAC;AAGS,yCAAyCE,KAAK,IAAG;IACxD,MAAM,EAAEC,IAAAA,EAAM,GAAGD,KAAK;IACtB,MAAME,aAAa,GAAGhB,gBAAgB,CAAC,CAAC;IACxC,oDAAA;IACAc,KAAK,CAACjB,IAAI,CAACoB,SAAS,GAAGxB,uBAAY,EAACG,uBAAuB,CAACC,IAAI,EAAEmB,aAAa,EAAEF,KAAK,CAACjB,IAAI,CAACoB,SAAS,CAAC;IACtG,MAAMC,cAAc,GAAGjB,iBAAiB,CAAC,CAAC;IAC1C,MAAMkB,WAAW,GAAGjB,cAAc,CAAC,CAAC;IACpC,IAAIY,KAAK,CAAChB,SAAS,EAAE;QACjB,oDAAA;QACAgB,KAAK,CAAChB,SAAS,CAACmB,SAAS,OAAGxB,mBAAY,EAACG,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;IACvO;IACA,IAAIH,KAAK,CAACf,SAAS,EAAE;QACjB,oDAAA;QACAe,KAAK,CAACf,SAAS,CAACkB,SAAS,OAAGxB,mBAAY,EAACG,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;IAC3P;IACA,OAAOH,KAAK;AAChB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get ratingDisplayClassNames () {
|
|
13
|
+
return ratingDisplayClassNames;
|
|
14
|
+
},
|
|
15
|
+
get useRatingDisplayStyles_unstable () {
|
|
16
|
+
return useRatingDisplayStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _clsx = require("clsx");
|
|
21
|
+
const _RatingDisplaymodulecss = /*#__PURE__*/ _interop_require_default._(require("./RatingDisplay.module.css"));
|
|
22
|
+
const ratingDisplayClassNames = {
|
|
23
|
+
root: 'fui-RatingDisplay',
|
|
24
|
+
valueText: 'fui-RatingDisplay__valueText',
|
|
25
|
+
countText: 'fui-RatingDisplay__countText'
|
|
26
|
+
};
|
|
27
|
+
const useRatingDisplayStyles_unstable = (state)=>{
|
|
28
|
+
state.root.className = (0, _clsx.clsx)(ratingDisplayClassNames.root, _RatingDisplaymodulecss.default.root, _RatingDisplaymodulecss.default[state.size], state.root.className);
|
|
29
|
+
if (state.valueText) {
|
|
30
|
+
state.valueText.className = (0, _clsx.clsx)(ratingDisplayClassNames.valueText, _RatingDisplaymodulecss.default.label, _RatingDisplaymodulecss.default.valueText, state.valueText.className);
|
|
31
|
+
}
|
|
32
|
+
if (state.countText) {
|
|
33
|
+
state.countText.className = (0, _clsx.clsx)(ratingDisplayClassNames.countText, _RatingDisplaymodulecss.default.label, state.valueText && _RatingDisplaymodulecss.default.divider, state.countText.className);
|
|
34
|
+
}
|
|
35
|
+
return state;
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/RatingDisplay/useRatingDisplayStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { RatingDisplaySlots, RatingDisplayState } from './RatingDisplay.types';\nimport styles from './RatingDisplay.module.css';\n\nexport const ratingDisplayClassNames: SlotClassNames<RatingDisplaySlots> = {\n root: 'fui-RatingDisplay',\n valueText: 'fui-RatingDisplay__valueText',\n countText: 'fui-RatingDisplay__countText',\n};\n\nexport const useRatingDisplayStyles_unstable = (state: RatingDisplayState): RatingDisplayState => {\n state.root.className = clsx(ratingDisplayClassNames.root, styles.root, styles[state.size], state.root.className);\n if (state.valueText) {\n state.valueText.className = clsx(\n ratingDisplayClassNames.valueText,\n styles.label,\n styles.valueText,\n state.valueText.className,\n );\n }\n if (state.countText) {\n state.countText.className = clsx(\n ratingDisplayClassNames.countText,\n styles.label,\n state.valueText && styles.divider,\n state.countText.className,\n );\n }\n return state;\n};\n"],"names":["clsx","styles","ratingDisplayClassNames","root","valueText","countText","useRatingDisplayStyles_unstable","state","className","size","label","divider"],"mappings":";;;;;;;;;;;QAKaE;;;;;;;;sBALQ,OAAO;iFAGT,6BAA6B;AAEzC,gCAAoE;IACzEC,MAAM;IACNC,WAAW;IACXC,WAAW;AACb,EAAE;AAEK,MAAMC,kCAAkC,CAACC;IAC9CA,MAAMJ,IAAI,CAACK,SAAS,OAAGR,UAAAA,EAAKE,wBAAwBC,IAAI,EAAEF,+BAAAA,CAAOE,IAAI,EAAEF,+BAAM,CAACM,MAAME,IAAI,CAAC,EAAEF,MAAMJ,IAAI,CAACK,SAAS;IAC/G,IAAID,MAAMH,SAAS,EAAE;QACnBG,MAAMH,SAAS,CAACI,SAAS,OAAGR,UAAAA,EAC1BE,wBAAwBE,SAAS,EACjCH,+BAAAA,CAAOS,KAAK,EACZT,+BAAAA,CAAOG,SAAS,EAChBG,MAAMH,SAAS,CAACI,SAAS;IAE7B;IACA,IAAID,MAAMF,SAAS,EAAE;QACnBE,MAAMF,SAAS,CAACG,SAAS,OAAGR,UAAAA,EAC1BE,wBAAwBG,SAAS,EACjCJ,+BAAAA,CAAOS,KAAK,EACZH,MAAMH,SAAS,IAAIH,+BAAAA,CAAOU,OAAO,EACjCJ,MAAMF,SAAS,CAACG,SAAS;IAE7B;IACA,OAAOD;AACT,EAAE"}
|
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
function _export(target, all) {
|
|
7
7
|
for(var name in all)Object.defineProperty(target, name, {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: all
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
ratingDisplayClassNames
|
|
13
|
+
get ratingDisplayClassNames () {
|
|
14
14
|
return ratingDisplayClassNames;
|
|
15
15
|
},
|
|
16
|
-
useRatingDisplayStyles_unstable
|
|
16
|
+
get useRatingDisplayStyles_unstable () {
|
|
17
17
|
return useRatingDisplayStyles_unstable;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
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 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;;;;;;;;;;;;QAOaK;;;;eA8CA8B;;;uBAnD6C,iBAAiB;4BAGlC,wBAAwB;AAE1D,gCAAoE;IACzE7B,MAAM;IACNC,WAAW;IACXC,WAAW;AACb,EAAE;AAEF;;CAEC,GAED,MAAMC,uBAAmBT,sBAAAA,EAAgB;IACvCU,SAAS;IACTC,UAAU;IACVC,YAAY;AACd;AAEA,MAAMC,wBAAoBb,sBAAAA,EAAgB;IACxCc,OAAOX,kBAAAA,CAAOY,uBAAuB;IACrCC,YAAYb,kBAAAA,CAAOc,mBAAmB;IACtC,GAAGb,4BAAAA,CAAiBc,QAAQ;AAC9B;AAEA,MAAMC,qBAAiBlB,iBAAAA,EAAW;IAChCmB,OAAO;QACLC,UAAUlB,kBAAAA,CAAOmB,eAAe;QAChCC,YAAYpB,kBAAAA,CAAOqB,iBAAiB;QACpCR,YAAYb,kBAAAA,CAAOsB,uBAAuB;IAC5C;IACAC,YAAY;QACVL,UAAUlB,kBAAAA,CAAOwB,eAAe;QAChCJ,YAAYpB,kBAAAA,CAAOyB,iBAAiB;QACpCZ,YAAYb,kBAAAA,CAAO0B,kBAAkB;IACvC;IACAC,QAAQ;QACNC,YAAY5B,kBAAAA,CAAO6B,kBAAkB;IACvC;IACAC,SAAS;QACP,YAAY;YACVC,SAAS;QACX;IACF;AACF;AAKO,wCAAwC,CAACE;IAC9C,MAAM,EAAEC,IAAI,EAAE,GAAGD;IACjB,MAAME,gBAAgB7B;IACtB,oDAAoD;IACpD2B,MAAM9B,IAAI,CAACiC,SAAS,OAAGrC,mBAAAA,EAAaG,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,OAAGrC,mBAAAA,EAC1BG,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,OAAGrC,mBAAAA,EAC1BG,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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get ratingDisplayClassNames () {
|
|
13
|
+
return ratingDisplayClassNames;
|
|
14
|
+
},
|
|
15
|
+
get useRatingDisplayStyles_unstable () {
|
|
16
|
+
return useRatingDisplayStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _clsx = require("clsx");
|
|
21
|
+
const _RatingDisplaymodulecss = /*#__PURE__*/ _interop_require_default._(require("./RatingDisplay.module.css"));
|
|
22
|
+
const ratingDisplayClassNames = {
|
|
23
|
+
root: 'fui-RatingDisplay',
|
|
24
|
+
valueText: 'fui-RatingDisplay__valueText',
|
|
25
|
+
countText: 'fui-RatingDisplay__countText'
|
|
26
|
+
};
|
|
27
|
+
const useRatingDisplayStyles_unstable = (state)=>{
|
|
28
|
+
state.root.className = (0, _clsx.clsx)(ratingDisplayClassNames.root, _RatingDisplaymodulecss.default.root, _RatingDisplaymodulecss.default[state.size], state.root.className);
|
|
29
|
+
if (state.valueText) {
|
|
30
|
+
state.valueText.className = (0, _clsx.clsx)(ratingDisplayClassNames.valueText, _RatingDisplaymodulecss.default.label, _RatingDisplaymodulecss.default.valueText, state.valueText.className);
|
|
31
|
+
}
|
|
32
|
+
if (state.countText) {
|
|
33
|
+
state.countText.className = (0, _clsx.clsx)(ratingDisplayClassNames.countText, _RatingDisplaymodulecss.default.label, state.valueText && _RatingDisplaymodulecss.default.divider, state.countText.className);
|
|
34
|
+
}
|
|
35
|
+
return state;
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/RatingDisplay/useRatingDisplayStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { RatingDisplaySlots, RatingDisplayState } from './RatingDisplay.types';\nimport styles from './RatingDisplay.module.css';\n\nexport const ratingDisplayClassNames: SlotClassNames<RatingDisplaySlots> = {\n root: 'fui-RatingDisplay',\n valueText: 'fui-RatingDisplay__valueText',\n countText: 'fui-RatingDisplay__countText',\n};\n\nexport const useRatingDisplayStyles_unstable = (state: RatingDisplayState): RatingDisplayState => {\n state.root.className = clsx(ratingDisplayClassNames.root, styles.root, styles[state.size], state.root.className);\n if (state.valueText) {\n state.valueText.className = clsx(\n ratingDisplayClassNames.valueText,\n styles.label,\n styles.valueText,\n state.valueText.className,\n );\n }\n if (state.countText) {\n state.countText.className = clsx(\n ratingDisplayClassNames.countText,\n styles.label,\n state.valueText && styles.divider,\n state.countText.className,\n );\n }\n return state;\n};\n"],"names":["clsx","styles","ratingDisplayClassNames","root","valueText","countText","useRatingDisplayStyles_unstable","state","className","size","label","divider"],"mappings":";;;;;;;;;;;QAKaE;;;;;;;;sBALQ,OAAO;iFAGT,6BAA6B;AAEzC,gCAAoE;IACzEC,MAAM;IACNC,WAAW;IACXC,WAAW;AACb,EAAE;AAEK,MAAMC,kCAAkC,CAACC;IAC9CA,MAAMJ,IAAI,CAACK,SAAS,OAAGR,UAAAA,EAAKE,wBAAwBC,IAAI,EAAEF,+BAAAA,CAAOE,IAAI,EAAEF,+BAAM,CAACM,MAAME,IAAI,CAAC,EAAEF,MAAMJ,IAAI,CAACK,SAAS;IAC/G,IAAID,MAAMH,SAAS,EAAE;QACnBG,MAAMH,SAAS,CAACI,SAAS,OAAGR,UAAAA,EAC1BE,wBAAwBE,SAAS,EACjCH,+BAAAA,CAAOS,KAAK,EACZT,+BAAAA,CAAOG,SAAS,EAChBG,MAAMH,SAAS,CAACI,SAAS;IAE7B;IACA,IAAID,MAAMF,SAAS,EAAE;QACnBE,MAAMF,SAAS,CAACG,SAAS,OAAGR,UAAAA,EAC1BE,wBAAwBG,SAAS,EACjCJ,+BAAAA,CAAOS,KAAK,EACZH,MAAMH,SAAS,IAAIH,+BAAAA,CAAOU,OAAO,EACjCJ,MAAMF,SAAS,CAACG,SAAS;IAE7B;IACA,OAAOD;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/RatingItem/RatingItem.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useRatingItem_unstable } from './useRatingItem';\nimport { renderRatingItem_unstable } from './renderRatingItem';\nimport { useRatingItemStyles_unstable } from './useRatingItemStyles.styles';\nimport type { RatingItemProps } from './RatingItem.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * RatingItem is an item that will be used to set or display a rating value.\n */\nexport const RatingItem: ForwardRefComponent<RatingItemProps> = React.forwardRef((props, ref) => {\n const state = useRatingItem_unstable(props, ref);\n\n useRatingItemStyles_unstable(state);\n useCustomStyleHook_unstable('useRatingItemStyles_unstable')(state);\n\n return renderRatingItem_unstable(state);\n});\n\nRatingItem.displayName = 'RatingItem';\n"],"names":["React","useRatingItem_unstable","renderRatingItem_unstable","useRatingItemStyles_unstable","useCustomStyleHook_unstable","RatingItem","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;+BAEQ,qBAAkB;kCACf,wBAAqB;2CAClB,kCAA+B;qCAEhC,kCAAkC;AAKvE,MAAMK,aAAAA,WAAAA,GAAmDL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IACvF,MAAMC,YAAQR,qCAAAA,EAAuBM,OAAOC;QAE5CL,uDAAAA,EAA6BM;QAC7BL,gDAAAA,EAA4B,gCAAgCK;IAE5D,WAAOP,2CAAAA,EAA0BO;AACnC,GAAG;AAEHJ,WAAWK,WAAW,GAAG"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
@layer fluentui {
|
|
2
|
+
.root {
|
|
3
|
+
position: relative;
|
|
4
|
+
&:focus {
|
|
5
|
+
outline-style: none;
|
|
6
|
+
}
|
|
7
|
+
&:focus-visible {
|
|
8
|
+
outline-style: none;
|
|
9
|
+
}
|
|
10
|
+
&[data-fui-focus-within]:focus-within {
|
|
11
|
+
border-top-color: transparent;
|
|
12
|
+
border-inline-end-color: transparent;
|
|
13
|
+
border-bottom-color: transparent;
|
|
14
|
+
border-inline-start-color: transparent;
|
|
15
|
+
&::after {
|
|
16
|
+
content: '';
|
|
17
|
+
position: absolute;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
z-index: 1;
|
|
20
|
+
border: var(--spacingHorizontalXXS) solid var(--colorStrokeFocus2);
|
|
21
|
+
border-radius: var(--borderRadiusMedium);
|
|
22
|
+
top: calc(var(--spacingHorizontalXXS) * -1);
|
|
23
|
+
inset-inline-end: calc(var(--spacingHorizontalXXS) * -1);
|
|
24
|
+
bottom: calc(var(--spacingHorizontalXXS) * -1);
|
|
25
|
+
inset-inline-start: calc(var(--spacingHorizontalXXS) * -1);
|
|
26
|
+
}
|
|
27
|
+
@media (forced-colors: active) {
|
|
28
|
+
&::after {
|
|
29
|
+
border-top-color: Highlight;
|
|
30
|
+
border-inline-end-color: Highlight;
|
|
31
|
+
border-bottom-color: Highlight;
|
|
32
|
+
border-inline-start-color: Highlight;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
.small {
|
|
38
|
+
font-size: var(--fontSizeBase200);
|
|
39
|
+
width: var(--fontSizeBase200);
|
|
40
|
+
height: var(--fontSizeBase200);
|
|
41
|
+
}
|
|
42
|
+
.medium {
|
|
43
|
+
font-size: var(--fontSizeBase400);
|
|
44
|
+
width: var(--spacingHorizontalL);
|
|
45
|
+
height: var(--spacingHorizontalL);
|
|
46
|
+
}
|
|
47
|
+
.large {
|
|
48
|
+
font-size: var(--fontSizeBase500);
|
|
49
|
+
width: var(--spacingHorizontalXL);
|
|
50
|
+
height: var(--spacingHorizontalXL);
|
|
51
|
+
}
|
|
52
|
+
.extra-large {
|
|
53
|
+
font-size: var(--fontSizeHero700);
|
|
54
|
+
width: calc(var(--spacingHorizontalXXL) + var(--spacingHorizontalXS));
|
|
55
|
+
height: calc(var(--spacingHorizontalXXL) + var(--spacingHorizontalXS));
|
|
56
|
+
}
|
|
57
|
+
.input {
|
|
58
|
+
position: absolute;
|
|
59
|
+
inset-inline-start: 0;
|
|
60
|
+
top: 0;
|
|
61
|
+
inset-inline-end: 0;
|
|
62
|
+
bottom: 0;
|
|
63
|
+
box-sizing: border-box;
|
|
64
|
+
margin: 0;
|
|
65
|
+
opacity: 0;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
height: 100%;
|
|
68
|
+
}
|
|
69
|
+
.halfValueInput {
|
|
70
|
+
inset-inline-end: 50%;
|
|
71
|
+
}
|
|
72
|
+
:where(.half) > .fullValueInput {
|
|
73
|
+
inset-inline-start: 50%;
|
|
74
|
+
}
|
|
75
|
+
.indicator {
|
|
76
|
+
display: flex;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
color: var(--colorNeutralForeground1);
|
|
79
|
+
fill: currentColor;
|
|
80
|
+
pointer-events: none;
|
|
81
|
+
position: absolute;
|
|
82
|
+
inset-inline-start: 0;
|
|
83
|
+
inset-inline-end: 0;
|
|
84
|
+
top: 0;
|
|
85
|
+
bottom: 0;
|
|
86
|
+
}
|
|
87
|
+
:where(.halfIcon) > .selectedIcon {
|
|
88
|
+
inset-inline-end: 50%;
|
|
89
|
+
& > svg {
|
|
90
|
+
flex: 0 0 auto;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
:where(.halfIcon) > .unselectedIcon {
|
|
94
|
+
inset-inline-start: 50%;
|
|
95
|
+
margin-inline-start: -50%;
|
|
96
|
+
}
|
|
97
|
+
:where(.brand) > .indicator {
|
|
98
|
+
color: var(--colorBrandForeground1);
|
|
99
|
+
}
|
|
100
|
+
:where(.marigold) > .indicator {
|
|
101
|
+
color: var(--colorPaletteMarigoldBorderActive);
|
|
102
|
+
}
|
|
103
|
+
:where(.filled) > .unselectedIcon {
|
|
104
|
+
color: var(--colorNeutralBackground6);
|
|
105
|
+
stroke: var(--colorTransparentStroke);
|
|
106
|
+
@media (forced-colors: active) {
|
|
107
|
+
color: Canvas;
|
|
108
|
+
stroke: CanvasText;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
:where(.filled.brand) > .unselectedIcon {
|
|
112
|
+
@media (forced-colors: none) {
|
|
113
|
+
color: var(--colorBrandBackground2);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
:where(.filled.marigold) > .unselectedIcon {
|
|
117
|
+
@media (forced-colors: none) {
|
|
118
|
+
color: var(--colorPaletteMarigoldBackground2);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
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":""}
|
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
RatingItem
|
|
12
|
+
get RatingItem () {
|
|
13
13
|
return _RatingItem.RatingItem;
|
|
14
14
|
},
|
|
15
|
-
ratingItemClassNames
|
|
15
|
+
get ratingItemClassNames () {
|
|
16
16
|
return _useRatingItemStylesstyles.ratingItemClassNames;
|
|
17
17
|
},
|
|
18
|
-
renderRatingItem_unstable
|
|
18
|
+
get renderRatingItem_unstable () {
|
|
19
19
|
return _renderRatingItem.renderRatingItem_unstable;
|
|
20
20
|
},
|
|
21
|
-
useRatingItemBase_unstable
|
|
21
|
+
get useRatingItemBase_unstable () {
|
|
22
22
|
return _useRatingItem.useRatingItemBase_unstable;
|
|
23
23
|
},
|
|
24
|
-
useRatingItemStyles_unstable
|
|
24
|
+
get useRatingItemStyles_unstable () {
|
|
25
25
|
return _useRatingItemStylesstyles.useRatingItemStyles_unstable;
|
|
26
26
|
},
|
|
27
|
-
useRatingItem_unstable
|
|
27
|
+
get useRatingItem_unstable () {
|
|
28
28
|
return _useRatingItem.useRatingItem_unstable;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/RatingItem/index.ts"],"sourcesContent":["export { RatingItem } from './RatingItem';\nexport type {\n RatingItemContextValue,\n RatingItemProps,\n RatingItemBaseProps,\n RatingItemSlots,\n RatingItemState,\n RatingItemBaseState,\n} from './RatingItem.types';\nexport { renderRatingItem_unstable } from './renderRatingItem';\nexport { useRatingItem_unstable, useRatingItemBase_unstable } from './useRatingItem';\nexport { ratingItemClassNames, useRatingItemStyles_unstable } from './useRatingItemStyles.styles';\n"],"names":["RatingItem","renderRatingItem_unstable","useRatingItem_unstable","useRatingItemBase_unstable","ratingItemClassNames","useRatingItemStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,sBAAU;;;eAWVI,+CAAoB;;;eAFpBH,2CAAyB;;;eACDE,yCAA0B;;;eAC5BE,uDAA4B;;;eADlDH,qCAAsB;;;4BAVJ,kBAAe;kCASA,wBAAqB;+BACI,qBAAkB;2CAClB,kCAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/RatingItem/renderRatingItem.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { RatingItemBaseState, RatingItemSlots } from './RatingItem.types';\n\n/**\n * Render the final JSX of RatingItem\n */\nexport const renderRatingItem_unstable = (state: RatingItemBaseState): JSXElement => {\n assertSlots<RatingItemSlots>(state);\n\n return (\n <state.root>\n {state.halfValueInput && <state.halfValueInput />}\n {state.fullValueInput && <state.fullValueInput />}\n {state.unselectedIcon && <state.unselectedIcon />}\n {state.selectedIcon && <state.selectedIcon />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderRatingItem_unstable","state","root","halfValueInput","fullValueInput","unselectedIcon","selectedIcon"],"mappings":";;;;+BAUaC;;;;;;;gCATb,gDAAiD,GAEjD,SAASD,WAAW,QAAQ,4BAA4B;AAOjD,kCAAkC,CAACE;QACxCF,2BAAAA,EAA6BE;IAE7B,OAAA,WAAA,OACE,gBAAA,EAACA,MAAMC,IAAI,EAAA;;YACRD,MAAME,cAAc,IAAA,WAAA,OAAI,eAAA,EAACF,MAAME,cAAc,EAAA,CAAA;YAC7CF,MAAMG,cAAc,IAAA,WAAA,OAAI,eAAA,EAACH,MAAMG,cAAc,EAAA,CAAA;YAC7CH,MAAMI,cAAc,IAAA,WAAA,OAAI,eAAA,EAACJ,MAAMI,cAAc,EAAA,CAAA;YAC7CJ,MAAMK,YAAY,IAAA,WAAA,OAAI,eAAA,EAACL,MAAMK,YAAY,EAAA,CAAA;;;AAGhD,EAAE"}
|