@fluentui/react-rating 9.75.1-experimental.css-modules.20261103-d6c85ee2a9.0 → 9.75.2-experimental.css-modules.20261113-ba13c87438.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 +18 -9
- package/lib/components/Rating/Rating.module.css +4 -5
- package/lib/components/RatingDisplay/RatingDisplay.module.css +30 -31
- package/lib/components/RatingItem/RatingItem.module.css +115 -110
- package/lib/components/RatingItem/useRatingItem.js +4 -2
- package/lib/components/RatingItem/useRatingItem.js.map +1 -1
- package/lib/components/RatingItem/useRatingItemStyles.styles.js +12 -6
- package/lib/components/RatingItem/useRatingItemStyles.styles.js.map +1 -1
- package/lib/components/RatingItem/useRatingItemStyles.styles.raw.js +7 -2
- package/lib/components/RatingItem/useRatingItemStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/Rating/Rating.module.css +4 -5
- package/lib-commonjs/components/RatingDisplay/RatingDisplay.module.css +30 -31
- package/lib-commonjs/components/RatingItem/RatingItem.module.css +115 -110
- package/lib-commonjs/components/RatingItem/useRatingItem.cjs +4 -2
- package/lib-commonjs/components/RatingItem/useRatingItem.cjs.map +1 -1
- package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.cjs +20 -6
- package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.raw.cjs +7 -2
- package/lib-commonjs/components/RatingItem/useRatingItemStyles.styles.raw.cjs.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-rating
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Fri, 13 Nov 2026 20:36:57 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [9.75.
|
|
7
|
+
## [9.75.2-experimental.css-modules.20261113-ba13c87438.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.75.2-experimental.css-modules.20261113-ba13c87438.0)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Fri, 13 Nov 2026 20:36:57 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-rating_v9.4.8..@fluentui/react-rating_v9.75.2-experimental.css-modules.20261113-ba13c87438.0)
|
|
10
11
|
|
|
11
12
|
### Changes
|
|
12
13
|
|
|
13
|
-
- Release 9.75.
|
|
14
|
-
- Bump @fluentui/react-jsx-runtime to v9.75.
|
|
15
|
-
- Bump @fluentui/react-shared-contexts to v9.75.
|
|
16
|
-
- Bump @fluentui/react-tabster to v9.75.
|
|
17
|
-
- Bump @fluentui/react-theme to v9.75.
|
|
18
|
-
- Bump @fluentui/react-utilities to v9.75.
|
|
14
|
+
- Release 9.75.2-experimental.css-modules.20261113-ba13c87438 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
|
|
15
|
+
- Bump @fluentui/react-jsx-runtime to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
16
|
+
- Bump @fluentui/react-shared-contexts to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
17
|
+
- Bump @fluentui/react-tabster to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
18
|
+
- Bump @fluentui/react-theme to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
19
|
+
- Bump @fluentui/react-utilities to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
20
|
+
|
|
21
|
+
## [9.4.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.4.8)
|
|
22
|
+
|
|
23
|
+
Tue, 10 Nov 2026 16:50:23 GMT
|
|
24
|
+
|
|
25
|
+
### Patches
|
|
26
|
+
|
|
27
|
+
- fix: apply icon sizing and layout styles to font glyphs as well as SVG icons ([PR #36958](https://github.com/microsoft/fluentui/pull/36958) by martinhochel@microsoft.com)
|
|
19
28
|
|
|
20
29
|
## [9.4.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-rating_v9.4.7)
|
|
21
30
|
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
@
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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);
|
|
1
|
+
/* @griffel-buckets reset: .root, .label */
|
|
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: '· ';
|
|
32
21
|
}
|
|
33
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
|
+
}
|
|
@@ -1,121 +1,126 @@
|
|
|
1
|
-
@
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/* @griffel-buckets reset: .input, .indicator */
|
|
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);
|
|
6
26
|
}
|
|
7
|
-
|
|
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;
|
|
27
|
+
@media (forced-colors: active) {
|
|
15
28
|
&::after {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
}
|
|
29
|
+
border-top-color: Highlight;
|
|
30
|
+
border-inline-end-color: Highlight;
|
|
31
|
+
border-bottom-color: Highlight;
|
|
32
|
+
border-inline-start-color: Highlight;
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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);
|
|
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
|
+
& > :is(:global(.fui-Icon-font), [data-fui-icon='font']) {
|
|
91
|
+
flex: 0 0 auto;
|
|
102
92
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
93
|
+
}
|
|
94
|
+
:where(.halfIcon) > .unselectedIcon {
|
|
95
|
+
inset-inline-start: 50%;
|
|
96
|
+
margin-inline-start: -50%;
|
|
97
|
+
}
|
|
98
|
+
:where(.brand) > .indicator {
|
|
99
|
+
color: var(--colorBrandForeground1);
|
|
100
|
+
}
|
|
101
|
+
:where(.marigold) > .indicator {
|
|
102
|
+
color: var(--colorPaletteMarigoldBorderActive);
|
|
103
|
+
}
|
|
104
|
+
:where(.filled) > .unselectedIcon {
|
|
105
|
+
color: var(--colorNeutralBackground6);
|
|
106
|
+
stroke: var(--colorTransparentStroke);
|
|
107
|
+
@media (forced-colors: active) {
|
|
108
|
+
color: Canvas;
|
|
109
|
+
stroke: CanvasText;
|
|
110
|
+
& > :is(:global(.fui-Icon-font), [data-fui-icon='font']) {
|
|
111
|
+
-webkit-text-stroke-color: CanvasText;
|
|
112
|
+
/* Match SVG's default stroke width independently of theme border tokens. */
|
|
113
|
+
-webkit-text-stroke-width: 1px;
|
|
109
114
|
}
|
|
110
115
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
}
|
|
117
|
+
:where(.filled.brand) > .unselectedIcon {
|
|
118
|
+
@media (forced-colors: none) {
|
|
119
|
+
color: var(--colorBrandBackground2);
|
|
115
120
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
}
|
|
122
|
+
:where(.filled.marigold) > .unselectedIcon {
|
|
123
|
+
@media (forced-colors: none) {
|
|
124
|
+
color: var(--colorPaletteMarigoldBackground2);
|
|
120
125
|
}
|
|
121
126
|
}
|
|
@@ -14,7 +14,9 @@ const defaultItemLabel = (num)=>num + '';
|
|
|
14
14
|
* @param ref - reference to root HTMLElement of RatingItem
|
|
15
15
|
*/ export const useRatingItem_unstable = (props, ref)=>{
|
|
16
16
|
const context = useRatingItemContextValue_unstable();
|
|
17
|
-
|
|
17
|
+
// Focus-within ref drives the styled focus outline; merged with the user ref
|
|
18
|
+
// before being passed down so the base hook does not depend on react-tabster (keyborg).
|
|
19
|
+
const state = useRatingItemBase_unstable(props, useMergedRefs(useFocusWithin(), ref));
|
|
18
20
|
return {
|
|
19
21
|
...state,
|
|
20
22
|
color: context.color,
|
|
@@ -45,7 +47,7 @@ const defaultItemLabel = (num)=>num + '';
|
|
|
45
47
|
iconFillWidth = 0;
|
|
46
48
|
}
|
|
47
49
|
const root = slot.always(getIntrinsicElementProps('span', {
|
|
48
|
-
ref
|
|
50
|
+
ref,
|
|
49
51
|
...props
|
|
50
52
|
}), {
|
|
51
53
|
elementType: 'span'
|
|
@@ -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 { 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
|
|
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 // Focus-within ref drives the styled focus outline; merged with the user ref\n // before being passed down so the base hook does not depend on react-tabster (keyborg).\n const state = useRatingItemBase_unstable(props, useMergedRefs(useFocusWithin<HTMLSpanElement>(), 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,\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;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,EAAEC,aAAa,QAAQ,4BAA4B;AAC1F,SAASC,cAAc,QAAQ,0BAA0B;AAEzD,SAASC,kCAAkC,QAAQ,sCAAmC;AAEtF,MAAMC,mBAAmB,CAACC,MAAgBA,MAAM;AAEhD;;;;;;;;CAQC,GACD,OAAO,MAAMC,yBAAyB,CAACC,OAAwBC;IAC7D,MAAMC,UAAUN;IAChB,6EAA6E;IAC7E,wFAAwF;IACxF,MAAMO,QAAQC,2BAA2BJ,OAAON,cAAcC,kBAAmCM;IAEjG,OAAO;QACL,GAAGE,KAAK;QACRE,OAAOH,QAAQG,KAAK;QACpBC,MAAMJ,QAAQI,IAAI;IACpB;AACF,EAAE;AAEF;;;;;;;CAOC,GACD,OAAO,MAAMF,6BAA6B,CACxCJ,OACAC;QAQ6BC;IAN7B,MAAMA,UAAUN;IAChB,MAAM,EAAEW,QAAQ,CAAC,EAAE,GAAGP;IACtB,MAAM,EAAEQ,YAAYX,gBAAgB,EAAEY,YAAYC,UAAU,EAAEC,aAAaC,WAAW,EAAE,GAAGV;IAE3F,MAAMW,cAAcC,KAAKC,KAAK,CAAC,AAACb,CAAAA,QAAQK,KAAK,IAAI,CAAA,IAAK,KAAK,GAAG,2BAA2B;IAEzF,MAAMS,wBAAuBd,wBAAAA,QAAQe,YAAY,cAApBf,mCAAAA,wBAAwBW;IAErD,MAAMK,aAAahB,QAAQiB,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ACA0B,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"}
|
|
@@ -108,10 +108,10 @@ const useIndicatorBaseClassName = /*#__PURE__*/__resetStyles("r1420l2m", "r1yt29
|
|
|
108
108
|
const useIndicatorStyles = /*#__PURE__*/__styles({
|
|
109
109
|
lowerHalf: {
|
|
110
110
|
j35jbq: ["ffenbu1", "f1ktbn1t"],
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
Bao0z1x: 0,
|
|
112
|
+
B1w58l2: 0,
|
|
113
|
+
l2oj4y: 0,
|
|
114
|
+
Bq0w4gw: "f1rqzk0i"
|
|
115
115
|
},
|
|
116
116
|
upperHalf: {
|
|
117
117
|
oyh7mz: ["f1ktbn1t", "ffenbu1"],
|
|
@@ -127,7 +127,9 @@ const useIndicatorStyles = /*#__PURE__*/__styles({
|
|
|
127
127
|
sj55zd: "f1qaymga",
|
|
128
128
|
ojy3ng: "f13qq9og",
|
|
129
129
|
B7iucu3: "f1205bnn",
|
|
130
|
-
Biw2w6l: "f1nocmko"
|
|
130
|
+
Biw2w6l: "f1nocmko",
|
|
131
|
+
B8bpm51: "f1yd48y7",
|
|
132
|
+
u5ni6u: "f4khg7k"
|
|
131
133
|
},
|
|
132
134
|
brandFilled: {
|
|
133
135
|
sj55zd: "f1kdv6iu"
|
|
@@ -136,13 +138,17 @@ const useIndicatorStyles = /*#__PURE__*/__styles({
|
|
|
136
138
|
sj55zd: "f1ymbmfq"
|
|
137
139
|
}
|
|
138
140
|
}, {
|
|
139
|
-
d: [".ffenbu1{right:50%;}", ".f1ktbn1t{left:50%;}", [".
|
|
141
|
+
d: [".ffenbu1{right:50%;}", ".f1ktbn1t{left:50%;}", [".f1rqzk0i>svg,.f1rqzk0i>.fui-Icon-font{flex:0 0 auto;}", {
|
|
140
142
|
p: -1
|
|
141
143
|
}], ".fbm7ezh{margin-left:-50%;}", ".f3ev47i{margin-right:-50%;}", ".f16muhyy{color:var(--colorBrandForeground1);}", ".f1whvut0{color:var(--colorPaletteMarigoldBorderActive);}", ".f1qaymga{color:var(--colorNeutralBackground6);}", ".f13qq9og{stroke:var(--colorTransparentStroke);}", ".f1kdv6iu{color:var(--colorBrandBackground2);}", ".f1ymbmfq{color:var(--colorPaletteMarigoldBackground2);}"],
|
|
142
144
|
m: [["@media (forced-colors: active){.f1205bnn{color:Canvas;}}", {
|
|
143
145
|
m: "(forced-colors: active)"
|
|
144
146
|
}], ["@media (forced-colors: active){.f1nocmko{stroke:CanvasText;}}", {
|
|
145
147
|
m: "(forced-colors: active)"
|
|
148
|
+
}], ["@media (forced-colors: active){.f1yd48y7>.fui-Icon-font{-webkit-text-stroke-color:CanvasText;}}", {
|
|
149
|
+
m: "(forced-colors: active)"
|
|
150
|
+
}], ["@media (forced-colors: active){.f4khg7k>.fui-Icon-font{-webkit-text-stroke-width:1px;}}", {
|
|
151
|
+
m: "(forced-colors: active)"
|
|
146
152
|
}]]
|
|
147
153
|
});
|
|
148
154
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","createFocusOutlineStyle","ratingItemClassNames","root","selectedIcon","unselectedIcon","halfValueInput","fullValueInput","useStyles","qhf8xq","Brovlpu","B486eqv","Bssx7fj","uh7if5","clntm0","Dlk2r6","h6p2u","I6qiy5","yzno9d","By0wis0","B2j2mmj","wigs8","pbfy6t","B0v4ure","Byrf0fs","Bsiemmq","Bwckmig","skfxo0","Iidy0u","B98u21t","Bvwlmkc","jo1ztg","Ba1iezr","Blmvk6g","B24cy0v","Bil7v7r","Br3gin4","nr063g","ghq09","Bbgo44z","Bseh09z","az1dzo","Ba3ybja","B6352mv","vppk2z","Biaj6j7","B2pnrqr","B29w5g4","Bhhzhcn","Bec0n69","small","Be2twd7","a9b677","Bqenvij","medium","large","d","p","f","i","m","useInputBaseClassName","useInputStyles","lowerHalf","j35jbq","upperHalf","oyh7mz","useIndicatorBaseClassName","useIndicatorStyles","
|
|
1
|
+
{"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","createFocusOutlineStyle","ratingItemClassNames","root","selectedIcon","unselectedIcon","halfValueInput","fullValueInput","useStyles","qhf8xq","Brovlpu","B486eqv","Bssx7fj","uh7if5","clntm0","Dlk2r6","h6p2u","I6qiy5","yzno9d","By0wis0","B2j2mmj","wigs8","pbfy6t","B0v4ure","Byrf0fs","Bsiemmq","Bwckmig","skfxo0","Iidy0u","B98u21t","Bvwlmkc","jo1ztg","Ba1iezr","Blmvk6g","B24cy0v","Bil7v7r","Br3gin4","nr063g","ghq09","Bbgo44z","Bseh09z","az1dzo","Ba3ybja","B6352mv","vppk2z","Biaj6j7","B2pnrqr","B29w5g4","Bhhzhcn","Bec0n69","small","Be2twd7","a9b677","Bqenvij","medium","large","d","p","f","i","m","useInputBaseClassName","useInputStyles","lowerHalf","j35jbq","upperHalf","oyh7mz","useIndicatorBaseClassName","useIndicatorStyles","Bao0z1x","B1w58l2","l2oj4y","Bq0w4gw","Frg6f3","brand","sj55zd","marigold","filled","ojy3ng","B7iucu3","Biw2w6l","B8bpm51","u5ni6u","brandFilled","marigoldFilled","useRatingItemStyles_unstable","state","color","size","iconFillWidth","appearance","styles","inputBaseClassName","inputStyles","indicatorBaseClassName","indicatorStyles","className"],"sources":["useRatingItemStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from \"@griffel/react\";\nimport { tokens } from \"@fluentui/react-theme\";\nimport { createFocusOutlineStyle } from \"@fluentui/react-tabster\";\nexport const ratingItemClassNames = {\n root: 'fui-RatingItem',\n selectedIcon: 'fui-RatingItem__selectedIcon',\n unselectedIcon: 'fui-RatingItem__unselectedIcon',\n halfValueInput: 'fui-RatingItem__halfValueInput',\n fullValueInput: 'fui-RatingItem__fullValueInput'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n position: 'relative',\n ...createFocusOutlineStyle({\n style: {},\n selector: 'focus-within'\n })\n },\n small: {\n fontSize: '12px',\n width: '12px',\n height: '12px'\n },\n medium: {\n fontSize: '16px',\n width: '16px',\n height: '16px'\n },\n large: {\n fontSize: '20px',\n width: '20px',\n height: '20px'\n },\n 'extra-large': {\n fontSize: '28px',\n width: '28px',\n height: '28px'\n }\n});\nconst useInputBaseClassName = makeResetStyles({\n position: 'absolute',\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n boxSizing: 'border-box',\n margin: 0,\n opacity: 0,\n cursor: 'pointer',\n height: '100%'\n});\nconst useInputStyles = makeStyles({\n lowerHalf: {\n right: '50%'\n },\n upperHalf: {\n left: '50%'\n }\n});\nconst useIndicatorBaseClassName = makeResetStyles({\n display: 'flex',\n overflow: 'hidden',\n color: tokens.colorNeutralForeground1,\n fill: 'currentColor',\n pointerEvents: 'none',\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n});\nconst useIndicatorStyles = makeStyles({\n lowerHalf: {\n right: '50%',\n '& > svg, & > .fui-Icon-font': {\n flex: '0 0 auto'\n }\n },\n upperHalf: {\n left: '50%',\n marginLeft: '-50%'\n },\n brand: {\n color: tokens.colorBrandForeground1\n },\n marigold: {\n color: tokens.colorPaletteMarigoldBorderActive\n },\n filled: {\n color: tokens.colorNeutralBackground6,\n stroke: tokens.colorTransparentStroke,\n '@media (forced-colors: active)': {\n color: 'Canvas',\n stroke: 'CanvasText',\n '& > .fui-Icon-font': {\n WebkitTextStrokeColor: 'CanvasText',\n // Match SVG's default stroke width independently of theme border tokens.\n WebkitTextStrokeWidth: '1px'\n }\n }\n },\n brandFilled: {\n color: tokens.colorBrandBackground2\n },\n marigoldFilled: {\n color: tokens.colorPaletteMarigoldBackground2\n }\n});\n/**\n * Apply styling to the RatingItem slots based on the state\n */ export const useRatingItemStyles_unstable = (state)=>{\n const { color, size, iconFillWidth, appearance } = state;\n const styles = useStyles();\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n const indicatorBaseClassName = useIndicatorBaseClassName();\n const indicatorStyles = useIndicatorStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(ratingItemClassNames.root, styles.root, styles[size], state.root.className);\n if (state.halfValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.halfValueInput.className = mergeClasses(ratingItemClassNames.halfValueInput, inputBaseClassName, inputStyles.lowerHalf, state.halfValueInput.className);\n }\n if (state.fullValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.fullValueInput.className = mergeClasses(ratingItemClassNames.fullValueInput, inputBaseClassName, state.halfValueInput && inputStyles.upperHalf, state.fullValueInput.className);\n }\n if (state.unselectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.unselectedIcon.className = mergeClasses(ratingItemClassNames.unselectedIcon, indicatorBaseClassName, appearance === 'filled' && indicatorStyles.filled, color === 'brand' && (appearance === 'filled' ? indicatorStyles.brandFilled : indicatorStyles.brand), color === 'marigold' && (appearance === 'filled' ? indicatorStyles.marigoldFilled : indicatorStyles.marigold), iconFillWidth === 0.5 && indicatorStyles.upperHalf, state.unselectedIcon.className);\n }\n if (state.selectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.selectedIcon.className = mergeClasses(ratingItemClassNames.selectedIcon, indicatorBaseClassName, color === 'brand' && indicatorStyles.brand, color === 'marigold' && indicatorStyles.marigold, iconFillWidth === 0.5 && indicatorStyles.lowerHalf, state.selectedIcon.className);\n }\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,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IACpB;IACAkF,KAAK,CAAClF,YAAY,CAAC4F,SAAS,GAAGjG,YAAY,CAACG,oBAAoB,CAACE,YAAY,EAAE0F,sBAAsB,EAAEP,KAAK,KAAK,OAAO,IAAIQ,eAAe,CAACrB,KAAK,EAAEa,KAAK,KAAK,UAAU,IAAIQ,eAAe,CAACnB,QAAQ,EAAEa,aAAa,KAAK,GAAG,IAAIM,eAAe,CAAChC,SAAS,EAAEuB,KAAK,CAAClF,YAAY,CAAC4F,SAAS,CAAC;EAC1R;EACA,OAAOV,KAAK;AAChB,CAAC","ignoreList":[]}
|
|
@@ -75,7 +75,7 @@ const useIndicatorBaseClassName = makeResetStyles({
|
|
|
75
75
|
const useIndicatorStyles = makeStyles({
|
|
76
76
|
lowerHalf: {
|
|
77
77
|
right: '50%',
|
|
78
|
-
'& > svg': {
|
|
78
|
+
'& > svg, & > .fui-Icon-font': {
|
|
79
79
|
flex: '0 0 auto'
|
|
80
80
|
}
|
|
81
81
|
},
|
|
@@ -94,7 +94,12 @@ const useIndicatorStyles = makeStyles({
|
|
|
94
94
|
stroke: tokens.colorTransparentStroke,
|
|
95
95
|
'@media (forced-colors: active)': {
|
|
96
96
|
color: 'Canvas',
|
|
97
|
-
stroke: 'CanvasText'
|
|
97
|
+
stroke: 'CanvasText',
|
|
98
|
+
'& > .fui-Icon-font': {
|
|
99
|
+
WebkitTextStrokeColor: 'CanvasText',
|
|
100
|
+
// Match SVG's default stroke width independently of theme border tokens.
|
|
101
|
+
WebkitTextStrokeWidth: '1px'
|
|
102
|
+
}
|
|
98
103
|
}
|
|
99
104
|
},
|
|
100
105
|
brandFilled: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/RatingItem/useRatingItemStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport type { RatingItemSlots, RatingItemState } from './RatingItem.types';\n\nexport const ratingItemClassNames: SlotClassNames<RatingItemSlots> = {\n root: 'fui-RatingItem',\n selectedIcon: 'fui-RatingItem__selectedIcon',\n unselectedIcon: 'fui-RatingItem__unselectedIcon',\n halfValueInput: 'fui-RatingItem__halfValueInput',\n fullValueInput: 'fui-RatingItem__fullValueInput',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n position: 'relative',\n ...createFocusOutlineStyle({ style: {}, selector: 'focus-within' }),\n },\n small: {\n fontSize: '12px',\n width: '12px',\n height: '12px',\n },\n\n medium: {\n fontSize: '16px',\n width: '16px',\n height: '16px',\n },\n\n large: {\n fontSize: '20px',\n width: '20px',\n height: '20px',\n },\n\n 'extra-large': {\n fontSize: '28px',\n width: '28px',\n height: '28px',\n },\n});\n\nconst useInputBaseClassName = makeResetStyles({\n position: 'absolute',\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n boxSizing: 'border-box',\n margin: 0,\n opacity: 0,\n cursor: 'pointer',\n height: '100%',\n});\n\nconst useInputStyles = makeStyles({\n lowerHalf: {\n right: '50%',\n },\n upperHalf: {\n left: '50%',\n },\n});\n\nconst useIndicatorBaseClassName = makeResetStyles({\n display: 'flex',\n overflow: 'hidden',\n color: tokens.colorNeutralForeground1,\n fill: 'currentColor',\n pointerEvents: 'none',\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n});\n\nconst useIndicatorStyles = makeStyles({\n lowerHalf: {\n right: '50%',\n '& > svg': {\n flex: '0 0 auto',\n },\n },\n upperHalf: {\n left: '50%',\n marginLeft: '-50%',\n },\n brand: {\n color: tokens.colorBrandForeground1,\n },\n marigold: {\n color: tokens.colorPaletteMarigoldBorderActive,\n },\n filled: {\n color: tokens.colorNeutralBackground6,\n stroke: tokens.colorTransparentStroke,\n '@media (forced-colors: active)': {\n color: 'Canvas',\n stroke: 'CanvasText',\n },\n },\n brandFilled: {\n color: tokens.colorBrandBackground2,\n },\n marigoldFilled: {\n color: tokens.colorPaletteMarigoldBackground2,\n },\n});\n\n/**\n * Apply styling to the RatingItem slots based on the state\n */\nexport const useRatingItemStyles_unstable = (state: RatingItemState): RatingItemState => {\n const { color, size, iconFillWidth, appearance } = state;\n const styles = useStyles();\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n const indicatorBaseClassName = useIndicatorBaseClassName();\n const indicatorStyles = useIndicatorStyles();\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(ratingItemClassNames.root, styles.root, styles[size], state.root.className);\n\n if (state.halfValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.halfValueInput.className = mergeClasses(\n ratingItemClassNames.halfValueInput,\n inputBaseClassName,\n inputStyles.lowerHalf,\n state.halfValueInput.className,\n );\n }\n\n if (state.fullValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.fullValueInput.className = mergeClasses(\n ratingItemClassNames.fullValueInput,\n inputBaseClassName,\n state.halfValueInput && inputStyles.upperHalf,\n state.fullValueInput.className,\n );\n }\n\n if (state.unselectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.unselectedIcon.className = mergeClasses(\n ratingItemClassNames.unselectedIcon,\n indicatorBaseClassName,\n appearance === 'filled' && indicatorStyles.filled,\n color === 'brand' && (appearance === 'filled' ? indicatorStyles.brandFilled : indicatorStyles.brand),\n color === 'marigold' && (appearance === 'filled' ? indicatorStyles.marigoldFilled : indicatorStyles.marigold),\n iconFillWidth === 0.5 && indicatorStyles.upperHalf,\n state.unselectedIcon.className,\n );\n }\n\n if (state.selectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.selectedIcon.className = mergeClasses(\n ratingItemClassNames.selectedIcon,\n indicatorBaseClassName,\n color === 'brand' && indicatorStyles.brand,\n color === 'marigold' && indicatorStyles.marigold,\n iconFillWidth === 0.5 && indicatorStyles.lowerHalf,\n state.selectedIcon.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","createFocusOutlineStyle","ratingItemClassNames","root","selectedIcon","unselectedIcon","halfValueInput","fullValueInput","useStyles","position","style","selector","small","fontSize","width","height","medium","large","useInputBaseClassName","left","top","right","bottom","boxSizing","margin","opacity","cursor","useInputStyles","lowerHalf","upperHalf","useIndicatorBaseClassName","display","overflow","color","colorNeutralForeground1","fill","pointerEvents","useIndicatorStyles","flex","marginLeft","brand","colorBrandForeground1","marigold","colorPaletteMarigoldBorderActive","filled","colorNeutralBackground6","stroke","colorTransparentStroke","brandFilled","colorBrandBackground2","marigoldFilled","colorPaletteMarigoldBackground2","useRatingItemStyles_unstable","state","size","iconFillWidth","appearance","styles","inputBaseClassName","inputStyles","indicatorBaseClassName","indicatorStyles","className"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAE3E,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,uBAAuB,QAAQ,0BAA0B;AAGlE,OAAO,MAAMC,uBAAwD;IACnEC,MAAM;IACNC,cAAc;IACdC,gBAAgB;IAChBC,gBAAgB;IAChBC,gBAAgB;AAClB,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYV,WAAW;IAC3BK,MAAM;QACJM,UAAU;QACV,GAAGR,wBAAwB;YAAES,OAAO,CAAC;YAAGC,UAAU;QAAe,EAAE;IACrE;IACAC,OAAO;QACLC,UAAU;QACVC,OAAO;QACPC,QAAQ;IACV;IAEAC,QAAQ;QACNH,UAAU;QACVC,OAAO;QACPC,QAAQ;IACV;IAEAE,OAAO;QACLJ,UAAU;QACVC,OAAO;QACPC,QAAQ;IACV;IAEA,eAAe;QACbF,UAAU;QACVC,OAAO;QACPC,QAAQ;IACV;AACF;AAEA,MAAMG,wBAAwBrB,gBAAgB;IAC5CY,UAAU;IACVU,MAAM;IACNC,KAAK;IACLC,OAAO;IACPC,QAAQ;IACRC,WAAW;IACXC,QAAQ;IACRC,SAAS;IACTC,QAAQ;IACRX,QAAQ;AACV;AAEA,MAAMY,iBAAiB7B,WAAW;IAChC8B,WAAW;QACTP,OAAO;IACT;IACAQ,WAAW;QACTV,MAAM;IACR;AACF;AAEA,MAAMW,4BAA4BjC,gBAAgB;IAChDkC,SAAS;IACTC,UAAU;IACVC,OAAOjC,OAAOkC,uBAAuB;IACrCC,MAAM;IACNC,eAAe;IACf3B,UAAU;IACVU,MAAM;IACNE,OAAO;IACPD,KAAK;IACLE,QAAQ;AACV;AAEA,MAAMe,qBAAqBvC,WAAW;IACpC8B,WAAW;QACTP,OAAO;QACP
|
|
1
|
+
{"version":3,"sources":["../../../src/components/RatingItem/useRatingItemStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport type { RatingItemSlots, RatingItemState } from './RatingItem.types';\n\nexport const ratingItemClassNames: SlotClassNames<RatingItemSlots> = {\n root: 'fui-RatingItem',\n selectedIcon: 'fui-RatingItem__selectedIcon',\n unselectedIcon: 'fui-RatingItem__unselectedIcon',\n halfValueInput: 'fui-RatingItem__halfValueInput',\n fullValueInput: 'fui-RatingItem__fullValueInput',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n position: 'relative',\n ...createFocusOutlineStyle({ style: {}, selector: 'focus-within' }),\n },\n small: {\n fontSize: '12px',\n width: '12px',\n height: '12px',\n },\n\n medium: {\n fontSize: '16px',\n width: '16px',\n height: '16px',\n },\n\n large: {\n fontSize: '20px',\n width: '20px',\n height: '20px',\n },\n\n 'extra-large': {\n fontSize: '28px',\n width: '28px',\n height: '28px',\n },\n});\n\nconst useInputBaseClassName = makeResetStyles({\n position: 'absolute',\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n boxSizing: 'border-box',\n margin: 0,\n opacity: 0,\n cursor: 'pointer',\n height: '100%',\n});\n\nconst useInputStyles = makeStyles({\n lowerHalf: {\n right: '50%',\n },\n upperHalf: {\n left: '50%',\n },\n});\n\nconst useIndicatorBaseClassName = makeResetStyles({\n display: 'flex',\n overflow: 'hidden',\n color: tokens.colorNeutralForeground1,\n fill: 'currentColor',\n pointerEvents: 'none',\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n});\n\nconst useIndicatorStyles = makeStyles({\n lowerHalf: {\n right: '50%',\n '& > svg, & > .fui-Icon-font': {\n flex: '0 0 auto',\n },\n },\n upperHalf: {\n left: '50%',\n marginLeft: '-50%',\n },\n brand: {\n color: tokens.colorBrandForeground1,\n },\n marigold: {\n color: tokens.colorPaletteMarigoldBorderActive,\n },\n filled: {\n color: tokens.colorNeutralBackground6,\n stroke: tokens.colorTransparentStroke,\n '@media (forced-colors: active)': {\n color: 'Canvas',\n stroke: 'CanvasText',\n '& > .fui-Icon-font': {\n WebkitTextStrokeColor: 'CanvasText',\n // Match SVG's default stroke width independently of theme border tokens.\n WebkitTextStrokeWidth: '1px',\n },\n },\n },\n brandFilled: {\n color: tokens.colorBrandBackground2,\n },\n marigoldFilled: {\n color: tokens.colorPaletteMarigoldBackground2,\n },\n});\n\n/**\n * Apply styling to the RatingItem slots based on the state\n */\nexport const useRatingItemStyles_unstable = (state: RatingItemState): RatingItemState => {\n const { color, size, iconFillWidth, appearance } = state;\n const styles = useStyles();\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n const indicatorBaseClassName = useIndicatorBaseClassName();\n const indicatorStyles = useIndicatorStyles();\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(ratingItemClassNames.root, styles.root, styles[size], state.root.className);\n\n if (state.halfValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.halfValueInput.className = mergeClasses(\n ratingItemClassNames.halfValueInput,\n inputBaseClassName,\n inputStyles.lowerHalf,\n state.halfValueInput.className,\n );\n }\n\n if (state.fullValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.fullValueInput.className = mergeClasses(\n ratingItemClassNames.fullValueInput,\n inputBaseClassName,\n state.halfValueInput && inputStyles.upperHalf,\n state.fullValueInput.className,\n );\n }\n\n if (state.unselectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.unselectedIcon.className = mergeClasses(\n ratingItemClassNames.unselectedIcon,\n indicatorBaseClassName,\n appearance === 'filled' && indicatorStyles.filled,\n color === 'brand' && (appearance === 'filled' ? indicatorStyles.brandFilled : indicatorStyles.brand),\n color === 'marigold' && (appearance === 'filled' ? indicatorStyles.marigoldFilled : indicatorStyles.marigold),\n iconFillWidth === 0.5 && indicatorStyles.upperHalf,\n state.unselectedIcon.className,\n );\n }\n\n if (state.selectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.selectedIcon.className = mergeClasses(\n ratingItemClassNames.selectedIcon,\n indicatorBaseClassName,\n color === 'brand' && indicatorStyles.brand,\n color === 'marigold' && indicatorStyles.marigold,\n iconFillWidth === 0.5 && indicatorStyles.lowerHalf,\n state.selectedIcon.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","createFocusOutlineStyle","ratingItemClassNames","root","selectedIcon","unselectedIcon","halfValueInput","fullValueInput","useStyles","position","style","selector","small","fontSize","width","height","medium","large","useInputBaseClassName","left","top","right","bottom","boxSizing","margin","opacity","cursor","useInputStyles","lowerHalf","upperHalf","useIndicatorBaseClassName","display","overflow","color","colorNeutralForeground1","fill","pointerEvents","useIndicatorStyles","flex","marginLeft","brand","colorBrandForeground1","marigold","colorPaletteMarigoldBorderActive","filled","colorNeutralBackground6","stroke","colorTransparentStroke","WebkitTextStrokeColor","WebkitTextStrokeWidth","brandFilled","colorBrandBackground2","marigoldFilled","colorPaletteMarigoldBackground2","useRatingItemStyles_unstable","state","size","iconFillWidth","appearance","styles","inputBaseClassName","inputStyles","indicatorBaseClassName","indicatorStyles","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xB,oDAAoD;QACpDkD,MAAMlD,cAAc,CAAC2D,SAAS,GAAGjE,aAC/BG,qBAAqBG,cAAc,EACnCyD,wBACAJ,eAAe,YAAYK,gBAAgBnB,MAAM,EACjDX,UAAU,WAAYyB,CAAAA,eAAe,WAAWK,gBAAgBb,WAAW,GAAGa,gBAAgBvB,KAAK,AAAD,GAClGP,UAAU,cAAeyB,CAAAA,eAAe,WAAWK,gBAAgBX,cAAc,GAAGW,gBAAgBrB,QAAQ,AAAD,GAC3Ge,kBAAkB,OAAOM,gBAAgBlC,SAAS,EAClD0B,MAAMlD,cAAc,CAAC2D,SAAS;IAElC;IAEA,IAAIT,MAAMnD,YAAY,EAAE;QACtB,oDAAoD;QACpDmD,MAAMnD,YAAY,CAAC4D,SAAS,GAAGjE,aAC7BG,qBAAqBE,YAAY,EACjC0D,wBACA7B,UAAU,WAAW8B,gBAAgBvB,KAAK,EAC1CP,UAAU,cAAc8B,gBAAgBrB,QAAQ,EAChDe,kBAAkB,OAAOM,gBAAgBnC,SAAS,EAClD2B,MAAMnD,YAAY,CAAC4D,SAAS;IAEhC;IAEA,OAAOT;AACT,EAAE"}
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
@
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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);
|
|
1
|
+
/* @griffel-buckets reset: .root, .label */
|
|
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: '· ';
|
|
32
21
|
}
|
|
33
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
|
+
}
|
|
@@ -1,121 +1,126 @@
|
|
|
1
|
-
@
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/* @griffel-buckets reset: .input, .indicator */
|
|
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);
|
|
6
26
|
}
|
|
7
|
-
|
|
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;
|
|
27
|
+
@media (forced-colors: active) {
|
|
15
28
|
&::after {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
}
|
|
29
|
+
border-top-color: Highlight;
|
|
30
|
+
border-inline-end-color: Highlight;
|
|
31
|
+
border-bottom-color: Highlight;
|
|
32
|
+
border-inline-start-color: Highlight;
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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);
|
|
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
|
+
& > :is(:global(.fui-Icon-font), [data-fui-icon='font']) {
|
|
91
|
+
flex: 0 0 auto;
|
|
102
92
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
93
|
+
}
|
|
94
|
+
:where(.halfIcon) > .unselectedIcon {
|
|
95
|
+
inset-inline-start: 50%;
|
|
96
|
+
margin-inline-start: -50%;
|
|
97
|
+
}
|
|
98
|
+
:where(.brand) > .indicator {
|
|
99
|
+
color: var(--colorBrandForeground1);
|
|
100
|
+
}
|
|
101
|
+
:where(.marigold) > .indicator {
|
|
102
|
+
color: var(--colorPaletteMarigoldBorderActive);
|
|
103
|
+
}
|
|
104
|
+
:where(.filled) > .unselectedIcon {
|
|
105
|
+
color: var(--colorNeutralBackground6);
|
|
106
|
+
stroke: var(--colorTransparentStroke);
|
|
107
|
+
@media (forced-colors: active) {
|
|
108
|
+
color: Canvas;
|
|
109
|
+
stroke: CanvasText;
|
|
110
|
+
& > :is(:global(.fui-Icon-font), [data-fui-icon='font']) {
|
|
111
|
+
-webkit-text-stroke-color: CanvasText;
|
|
112
|
+
/* Match SVG's default stroke width independently of theme border tokens. */
|
|
113
|
+
-webkit-text-stroke-width: 1px;
|
|
109
114
|
}
|
|
110
115
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
}
|
|
117
|
+
:where(.filled.brand) > .unselectedIcon {
|
|
118
|
+
@media (forced-colors: none) {
|
|
119
|
+
color: var(--colorBrandBackground2);
|
|
115
120
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
}
|
|
122
|
+
:where(.filled.marigold) > .unselectedIcon {
|
|
123
|
+
@media (forced-colors: none) {
|
|
124
|
+
color: var(--colorPaletteMarigoldBackground2);
|
|
120
125
|
}
|
|
121
126
|
}
|
|
@@ -25,7 +25,9 @@ const _RatingItemContext = require("../../contexts/RatingItemContext.cjs");
|
|
|
25
25
|
const defaultItemLabel = (num)=>num + '';
|
|
26
26
|
const useRatingItem_unstable = (props, ref)=>{
|
|
27
27
|
const context = (0, _RatingItemContext.useRatingItemContextValue_unstable)();
|
|
28
|
-
|
|
28
|
+
// Focus-within ref drives the styled focus outline; merged with the user ref
|
|
29
|
+
// before being passed down so the base hook does not depend on react-tabster (keyborg).
|
|
30
|
+
const state = useRatingItemBase_unstable(props, (0, _reactutilities.useMergedRefs)((0, _reacttabster.useFocusWithin)(), ref));
|
|
29
31
|
return {
|
|
30
32
|
...state,
|
|
31
33
|
color: context.color,
|
|
@@ -49,7 +51,7 @@ const useRatingItemBase_unstable = (props, ref)=>{
|
|
|
49
51
|
iconFillWidth = 0;
|
|
50
52
|
}
|
|
51
53
|
const root = _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('span', {
|
|
52
|
-
ref
|
|
54
|
+
ref,
|
|
53
55
|
...props
|
|
54
56
|
}), {
|
|
55
57
|
elementType: 'span'
|
|
@@ -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 { 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
|
|
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 // Focus-within ref drives the styled focus outline; merged with the user ref\n // before being passed down so the base hook does not depend on react-tabster (keyborg).\n const state = useRatingItemBase_unstable(props, useMergedRefs(useFocusWithin<HTMLSpanElement>(), 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,\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;;;;;;;;;;;;QAwCaa;;;QArBAL;;;;;iEAjBU,QAAQ;gCAC+B,4BAA4B;8BAC3D,0BAA0B;mCAEN,sCAAmC;AAEtF,MAAMF,mBAAmB,CAACC,MAAgBA,MAAM;AAWzC,+BAA+B,CAACE,OAAwBC;IAC7D,MAAMC,cAAUN,qDAAAA;IAChB,6EAA6E;IAC7E,wFAAwF;IACxF,MAAMO,QAAQC,2BAA2BJ,WAAON,6BAAAA,MAAcC,4BAAAA,KAAmCM;IAEjG,OAAO;QACL,GAAGE,KAAK;QACRE,OAAOH,QAAQG,KAAK;QACpBC,MAAMJ,QAAQI,IAAI;IACpB;AACF,EAAE;AAUK,mCAAmC,CACxCN,OACAC;QAQ6BC;IAN7B,MAAMA,UAAUN,yDAAAA;IAChB,MAAM,EAA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AI,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"}
|
|
@@ -209,10 +209,10 @@ const useIndicatorStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
209
209
|
"ffenbu1",
|
|
210
210
|
"f1ktbn1t"
|
|
211
211
|
],
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
212
|
+
Bao0z1x: 0,
|
|
213
|
+
B1w58l2: 0,
|
|
214
|
+
l2oj4y: 0,
|
|
215
|
+
Bq0w4gw: "f1rqzk0i"
|
|
216
216
|
},
|
|
217
217
|
upperHalf: {
|
|
218
218
|
oyh7mz: [
|
|
@@ -234,7 +234,9 @@ const useIndicatorStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
234
234
|
sj55zd: "f1qaymga",
|
|
235
235
|
ojy3ng: "f13qq9og",
|
|
236
236
|
B7iucu3: "f1205bnn",
|
|
237
|
-
Biw2w6l: "f1nocmko"
|
|
237
|
+
Biw2w6l: "f1nocmko",
|
|
238
|
+
B8bpm51: "f1yd48y7",
|
|
239
|
+
u5ni6u: "f4khg7k"
|
|
238
240
|
},
|
|
239
241
|
brandFilled: {
|
|
240
242
|
sj55zd: "f1kdv6iu"
|
|
@@ -247,7 +249,7 @@ const useIndicatorStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
247
249
|
".ffenbu1{right:50%;}",
|
|
248
250
|
".f1ktbn1t{left:50%;}",
|
|
249
251
|
[
|
|
250
|
-
".
|
|
252
|
+
".f1rqzk0i>svg,.f1rqzk0i>.fui-Icon-font{flex:0 0 auto;}",
|
|
251
253
|
{
|
|
252
254
|
p: -1
|
|
253
255
|
}
|
|
@@ -273,6 +275,18 @@ const useIndicatorStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
273
275
|
{
|
|
274
276
|
m: "(forced-colors: active)"
|
|
275
277
|
}
|
|
278
|
+
],
|
|
279
|
+
[
|
|
280
|
+
"@media (forced-colors: active){.f1yd48y7>.fui-Icon-font{-webkit-text-stroke-color:CanvasText;}}",
|
|
281
|
+
{
|
|
282
|
+
m: "(forced-colors: active)"
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
[
|
|
286
|
+
"@media (forced-colors: active){.f4khg7k>.fui-Icon-font{-webkit-text-stroke-width:1px;}}",
|
|
287
|
+
{
|
|
288
|
+
m: "(forced-colors: active)"
|
|
289
|
+
}
|
|
276
290
|
]
|
|
277
291
|
]
|
|
278
292
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useRatingItemStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from \"@griffel/react\";\nimport { tokens } from \"@fluentui/react-theme\";\nimport { createFocusOutlineStyle } from \"@fluentui/react-tabster\";\nexport const ratingItemClassNames = {\n root: 'fui-RatingItem',\n selectedIcon: 'fui-RatingItem__selectedIcon',\n unselectedIcon: 'fui-RatingItem__unselectedIcon',\n halfValueInput: 'fui-RatingItem__halfValueInput',\n fullValueInput: 'fui-RatingItem__fullValueInput'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n position: 'relative',\n ...createFocusOutlineStyle({\n style: {},\n selector: 'focus-within'\n })\n },\n small: {\n fontSize: '12px',\n width: '12px',\n height: '12px'\n },\n medium: {\n fontSize: '16px',\n width: '16px',\n height: '16px'\n },\n large: {\n fontSize: '20px',\n width: '20px',\n height: '20px'\n },\n 'extra-large': {\n fontSize: '28px',\n width: '28px',\n height: '28px'\n }\n});\nconst useInputBaseClassName = makeResetStyles({\n position: 'absolute',\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n boxSizing: 'border-box',\n margin: 0,\n opacity: 0,\n cursor: 'pointer',\n height: '100%'\n});\nconst useInputStyles = makeStyles({\n lowerHalf: {\n right: '50%'\n },\n upperHalf: {\n left: '50%'\n }\n});\nconst useIndicatorBaseClassName = makeResetStyles({\n display: 'flex',\n overflow: 'hidden',\n color: tokens.colorNeutralForeground1,\n fill: 'currentColor',\n pointerEvents: 'none',\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n});\nconst useIndicatorStyles = makeStyles({\n lowerHalf: {\n right: '50%',\n '& > svg': {\n flex: '0 0 auto'\n }\n },\n upperHalf: {\n left: '50%',\n marginLeft: '-50%'\n },\n brand: {\n color: tokens.colorBrandForeground1\n },\n marigold: {\n color: tokens.colorPaletteMarigoldBorderActive\n },\n filled: {\n color: tokens.colorNeutralBackground6,\n stroke: tokens.colorTransparentStroke,\n '@media (forced-colors: active)': {\n color: 'Canvas',\n stroke: 'CanvasText'\n }\n },\n brandFilled: {\n color: tokens.colorBrandBackground2\n },\n marigoldFilled: {\n color: tokens.colorPaletteMarigoldBackground2\n }\n});\n/**\n * Apply styling to the RatingItem slots based on the state\n */ export const useRatingItemStyles_unstable = (state)=>{\n const { color, size, iconFillWidth, appearance } = state;\n const styles = useStyles();\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n const indicatorBaseClassName = useIndicatorBaseClassName();\n const indicatorStyles = useIndicatorStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(ratingItemClassNames.root, styles.root, styles[size], state.root.className);\n if (state.halfValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.halfValueInput.className = mergeClasses(ratingItemClassNames.halfValueInput, inputBaseClassName, inputStyles.lowerHalf, state.halfValueInput.className);\n }\n if (state.fullValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.fullValueInput.className = mergeClasses(ratingItemClassNames.fullValueInput, inputBaseClassName, state.halfValueInput && inputStyles.upperHalf, state.fullValueInput.className);\n }\n if (state.unselectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.unselectedIcon.className = mergeClasses(ratingItemClassNames.unselectedIcon, indicatorBaseClassName, appearance === 'filled' && indicatorStyles.filled, color === 'brand' && (appearance === 'filled' ? indicatorStyles.brandFilled : indicatorStyles.brand), color === 'marigold' && (appearance === 'filled' ? indicatorStyles.marigoldFilled : indicatorStyles.marigold), iconFillWidth === 0.5 && indicatorStyles.upperHalf, state.unselectedIcon.className);\n }\n if (state.selectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.selectedIcon.className = mergeClasses(ratingItemClassNames.selectedIcon, indicatorBaseClassName, color === 'brand' && indicatorStyles.brand, color === 'marigold' && indicatorStyles.marigold, iconFillWidth === 0.5 && indicatorStyles.lowerHalf, state.selectedIcon.className);\n }\n return state;\n};\n"],"names":["__resetStyles","__styles","mergeClasses","tokens","createFocusOutlineStyle","ratingItemClassNames","root","selectedIcon","unselectedIcon","halfValueInput","fullValueInput","useStyles","qhf8xq","Brovlpu","B486eqv","Bssx7fj","uh7if5","clntm0","Dlk2r6","h6p2u","I6qiy5","yzno9d","By0wis0","B2j2mmj","wigs8","pbfy6t","B0v4ure","Byrf0fs","Bsiemmq","Bwckmig","skfxo0","Iidy0u","B98u21t","Bvwlmkc","jo1ztg","Ba1iezr","Blmvk6g","B24cy0v","Bil7v7r","Br3gin4","nr063g","ghq09","Bbgo44z","Bseh09z","az1dzo","Ba3ybja","B6352mv","vppk2z","Biaj6j7","B2pnrqr","B29w5g4","Bhhzhcn","Bec0n69","small","Be2twd7","a9b677","Bqenvij","medium","large","d","p","f","i","m","useInputBaseClassName","useInputStyles","lowerHalf","j35jbq","upperHalf","oyh7mz","useIndicatorBaseClassName","useIndicatorStyles","l5kjut","uoufgc","v39lw8","Bbwb3tu","Frg6f3","brand","sj55zd","marigold","filled","ojy3ng","B7iucu3","Biw2w6l","brandFilled","marigoldFilled","useRatingItemStyles_unstable","state","color","size","iconFillWidth","appearance","styles","inputBaseClassName","inputStyles","indicatorBaseClassName","indicatorStyles","className"],"mappings":"AAAA,YAAY;;;;;;;;;;;;QAICK,oBAAoB;;;QAwGhBiF,4BAA4B;;;;uBA3Ga,gBAAgB;AAGnE,6BAA6B;IAChChF,IAAI,EAAE,gBAAgB;IACtBC,YAAY,EAAE,8BAA8B;IAC5CC,cAAc,EAAE,gCAAgC;IAChDC,cAAc,EAAE,gCAAgC;IAChDC,cAAc,EAAE;AACpB,CAAC;AACD;;CAEA,GAAI,MAAMC,SAAS,GAAA,WAAA,OAAGV,eAAA,EAAA;IAAAK,IAAA,EAAA;QAAAM,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,KAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,OAAA,EAAA;Q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,mBAAY,EAACG,oBAAoB,CAACK,cAAc,EAAEmF,kBAAkB,EAAEN,KAAK,CAAC9E,cAAc,IAAIqF,WAAW,CAAC1B,SAAS,EAAEmB,KAAK,CAAC7E,cAAc,CAACuF,SAAS,CAAC;IACzL;IACA,IAAIV,KAAK,CAAC/E,cAAc,EAAE;QACtB,oDAAA;QACA+E,KAAK,CAAC/E,cAAc,CAACyF,SAAS,OAAG/F,mBAAY,EAACG,oBAAoB,CAACG,cAAc,EAAEuF,sBAAsB,EAAEJ,UAAU,KAAK,QAAQ,IAAIK,eAAe,CAAChB,MAAM,EAAEQ,KAAK,KAAK,OAAO,KAAKG,UAAU,KAAK,QAAQ,GAAGK,eAAe,CAACZ,WAAW,GAAGY,eAAe,CAACnB,KAAAA,AAAK,CAAC,EAAEW,KAAK,KAAK,UAAU,KAAKG,UAAU,KAAK,QAAQ,GAAGK,eAAe,CAACX,cAAc,GAAGW,eAAe,CAACjB,QAAAA,AAAQ,CAAC,EAAEW,aAAa,KAAK,GAAG,IAAIM,eAAe,CAAC5B,SAAS,EAAEmB,KAAK,CAAC/E,cAAc,CAACyF,SAAS,CAAC;IAC1c;IACA,IAAIV,KAAK,CAAChF,YAAY,EAAE;QACpB,oDAAA;QACAgF,KAAK,CAAChF,YAAY,CAAC0F,SAAS,OAAG/F,mBAAY,EAACG,oBAAoB,CAACE,YAAY,EAAEwF,sBAAsB,EAAEP,KAAK,KAAK,OAAO,IAAIQ,eAAe,CAACnB,KAAK,EAAEW,KAAK,KAAK,UAAU,IAAIQ,eAAe,CAACjB,QAAQ,EAAEW,aAAa,KAAK,GAAG,IAAIM,eAAe,CAAC9B,SAAS,EAAEqB,KAAK,CAAChF,YAAY,CAAC0F,SAAS,CAAC;IAC1R;IACA,OAAOV,KAAK;AAChB,CAAC"}
|
|
1
|
+
{"version":3,"sources":["useRatingItemStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from \"@griffel/react\";\nimport { tokens } from \"@fluentui/react-theme\";\nimport { createFocusOutlineStyle } from \"@fluentui/react-tabster\";\nexport const ratingItemClassNames = {\n root: 'fui-RatingItem',\n selectedIcon: 'fui-RatingItem__selectedIcon',\n unselectedIcon: 'fui-RatingItem__unselectedIcon',\n halfValueInput: 'fui-RatingItem__halfValueInput',\n fullValueInput: 'fui-RatingItem__fullValueInput'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n position: 'relative',\n ...createFocusOutlineStyle({\n style: {},\n selector: 'focus-within'\n })\n },\n small: {\n fontSize: '12px',\n width: '12px',\n height: '12px'\n },\n medium: {\n fontSize: '16px',\n width: '16px',\n height: '16px'\n },\n large: {\n fontSize: '20px',\n width: '20px',\n height: '20px'\n },\n 'extra-large': {\n fontSize: '28px',\n width: '28px',\n height: '28px'\n }\n});\nconst useInputBaseClassName = makeResetStyles({\n position: 'absolute',\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n boxSizing: 'border-box',\n margin: 0,\n opacity: 0,\n cursor: 'pointer',\n height: '100%'\n});\nconst useInputStyles = makeStyles({\n lowerHalf: {\n right: '50%'\n },\n upperHalf: {\n left: '50%'\n }\n});\nconst useIndicatorBaseClassName = makeResetStyles({\n display: 'flex',\n overflow: 'hidden',\n color: tokens.colorNeutralForeground1,\n fill: 'currentColor',\n pointerEvents: 'none',\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n});\nconst useIndicatorStyles = makeStyles({\n lowerHalf: {\n right: '50%',\n '& > svg, & > .fui-Icon-font': {\n flex: '0 0 auto'\n }\n },\n upperHalf: {\n left: '50%',\n marginLeft: '-50%'\n },\n brand: {\n color: tokens.colorBrandForeground1\n },\n marigold: {\n color: tokens.colorPaletteMarigoldBorderActive\n },\n filled: {\n color: tokens.colorNeutralBackground6,\n stroke: tokens.colorTransparentStroke,\n '@media (forced-colors: active)': {\n color: 'Canvas',\n stroke: 'CanvasText',\n '& > .fui-Icon-font': {\n WebkitTextStrokeColor: 'CanvasText',\n // Match SVG's default stroke width independently of theme border tokens.\n WebkitTextStrokeWidth: '1px'\n }\n }\n },\n brandFilled: {\n color: tokens.colorBrandBackground2\n },\n marigoldFilled: {\n color: tokens.colorPaletteMarigoldBackground2\n }\n});\n/**\n * Apply styling to the RatingItem slots based on the state\n */ export const useRatingItemStyles_unstable = (state)=>{\n const { color, size, iconFillWidth, appearance } = state;\n const styles = useStyles();\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n const indicatorBaseClassName = useIndicatorBaseClassName();\n const indicatorStyles = useIndicatorStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(ratingItemClassNames.root, styles.root, styles[size], state.root.className);\n if (state.halfValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.halfValueInput.className = mergeClasses(ratingItemClassNames.halfValueInput, inputBaseClassName, inputStyles.lowerHalf, state.halfValueInput.className);\n }\n if (state.fullValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.fullValueInput.className = mergeClasses(ratingItemClassNames.fullValueInput, inputBaseClassName, state.halfValueInput && inputStyles.upperHalf, state.fullValueInput.className);\n }\n if (state.unselectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.unselectedIcon.className = mergeClasses(ratingItemClassNames.unselectedIcon, indicatorBaseClassName, appearance === 'filled' && indicatorStyles.filled, color === 'brand' && (appearance === 'filled' ? indicatorStyles.brandFilled : indicatorStyles.brand), color === 'marigold' && (appearance === 'filled' ? indicatorStyles.marigoldFilled : indicatorStyles.marigold), iconFillWidth === 0.5 && indicatorStyles.upperHalf, state.unselectedIcon.className);\n }\n if (state.selectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.selectedIcon.className = mergeClasses(ratingItemClassNames.selectedIcon, indicatorBaseClassName, color === 'brand' && indicatorStyles.brand, color === 'marigold' && indicatorStyles.marigold, iconFillWidth === 0.5 && indicatorStyles.lowerHalf, state.selectedIcon.className);\n }\n return state;\n};\n"],"names":["__resetStyles","__styles","mergeClasses","tokens","createFocusOutlineStyle","ratingItemClassNames","root","selectedIcon","unselectedIcon","halfValueInput","fullValueInput","useStyles","qhf8xq","Brovlpu","B486eqv","Bssx7fj","uh7if5","clntm0","Dlk2r6","h6p2u","I6qiy5","yzno9d","By0wis0","B2j2mmj","wigs8","pbfy6t","B0v4ure","Byrf0fs","Bsiemmq","Bwckmig","skfxo0","Iidy0u","B98u21t","Bvwlmkc","jo1ztg","Ba1iezr","Blmvk6g","B24cy0v","Bil7v7r","Br3gin4","nr063g","ghq09","Bbgo44z","Bseh09z","az1dzo","Ba3ybja","B6352mv","vppk2z","Biaj6j7","B2pnrqr","B29w5g4","Bhhzhcn","Bec0n69","small","Be2twd7","a9b677","Bqenvij","medium","large","d","p","f","i","m","useInputBaseClassName","useInputStyles","lowerHalf","j35jbq","upperHalf","oyh7mz","useIndicatorBaseClassName","useIndicatorStyles","Bao0z1x","B1w58l2","l2oj4y","Bq0w4gw","Frg6f3","brand","sj55zd","marigold","filled","ojy3ng","B7iucu3","Biw2w6l","B8bpm51","u5ni6u","brandFilled","marigoldFilled","useRatingItemStyles_unstable","state","color","size","iconFillWidth","appearance","styles","inputBaseClassName","inputStyles","indicatorBaseClassName","indicatorStyles","className"],"mappings":"AAAA,YAAY;;;;;;;;;;;;QAICK,oBAAoB;;;QA6GhBmF,4BAA4B;;;;uBAhHa,gBAAgB;AAGnE,6BAA6B;IAChClF,IAAI,EAAE,gBAAgB;IACtBC,YAAY,EAAE,8BAA8B;IAC5CC,cAAc,EAAE,gCAAgC;IAChDC,cAAc,EAAE,gCAAgC;IAChDC,cAAc,EAAE;AACpB,CAAC;AACD;;CAEA,GAAI,MAAMC,SAAS,GAAA,WAAA,OAAGV,eAAA,EAAA;IAAAK,IAAA,EAAA;QAAAM,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,MAAA,EAAA;QAAAC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K,UAAU,IAAIQ,eAAe,CAACnB,QAAQ,EAAEa,aAAa,KAAK,GAAG,IAAIM,eAAe,CAAChC,SAAS,EAAEuB,KAAK,CAAClF,YAAY,CAAC4F,SAAS,CAAC;IAC1R;IACA,OAAOV,KAAK;AAChB,CAAC"}
|
|
@@ -93,7 +93,7 @@ const useIndicatorBaseClassName = (0, _react.makeResetStyles)({
|
|
|
93
93
|
const useIndicatorStyles = (0, _react.makeStyles)({
|
|
94
94
|
lowerHalf: {
|
|
95
95
|
right: '50%',
|
|
96
|
-
'& > svg': {
|
|
96
|
+
'& > svg, & > .fui-Icon-font': {
|
|
97
97
|
flex: '0 0 auto'
|
|
98
98
|
}
|
|
99
99
|
},
|
|
@@ -112,7 +112,12 @@ const useIndicatorStyles = (0, _react.makeStyles)({
|
|
|
112
112
|
stroke: _reacttheme.tokens.colorTransparentStroke,
|
|
113
113
|
'@media (forced-colors: active)': {
|
|
114
114
|
color: 'Canvas',
|
|
115
|
-
stroke: 'CanvasText'
|
|
115
|
+
stroke: 'CanvasText',
|
|
116
|
+
'& > .fui-Icon-font': {
|
|
117
|
+
WebkitTextStrokeColor: 'CanvasText',
|
|
118
|
+
// Match SVG's default stroke width independently of theme border tokens.
|
|
119
|
+
WebkitTextStrokeWidth: '1px'
|
|
120
|
+
}
|
|
116
121
|
}
|
|
117
122
|
},
|
|
118
123
|
brandFilled: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/RatingItem/useRatingItemStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport type { RatingItemSlots, RatingItemState } from './RatingItem.types';\n\nexport const ratingItemClassNames: SlotClassNames<RatingItemSlots> = {\n root: 'fui-RatingItem',\n selectedIcon: 'fui-RatingItem__selectedIcon',\n unselectedIcon: 'fui-RatingItem__unselectedIcon',\n halfValueInput: 'fui-RatingItem__halfValueInput',\n fullValueInput: 'fui-RatingItem__fullValueInput',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n position: 'relative',\n ...createFocusOutlineStyle({ style: {}, selector: 'focus-within' }),\n },\n small: {\n fontSize: '12px',\n width: '12px',\n height: '12px',\n },\n\n medium: {\n fontSize: '16px',\n width: '16px',\n height: '16px',\n },\n\n large: {\n fontSize: '20px',\n width: '20px',\n height: '20px',\n },\n\n 'extra-large': {\n fontSize: '28px',\n width: '28px',\n height: '28px',\n },\n});\n\nconst useInputBaseClassName = makeResetStyles({\n position: 'absolute',\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n boxSizing: 'border-box',\n margin: 0,\n opacity: 0,\n cursor: 'pointer',\n height: '100%',\n});\n\nconst useInputStyles = makeStyles({\n lowerHalf: {\n right: '50%',\n },\n upperHalf: {\n left: '50%',\n },\n});\n\nconst useIndicatorBaseClassName = makeResetStyles({\n display: 'flex',\n overflow: 'hidden',\n color: tokens.colorNeutralForeground1,\n fill: 'currentColor',\n pointerEvents: 'none',\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n});\n\nconst useIndicatorStyles = makeStyles({\n lowerHalf: {\n right: '50%',\n '& > svg': {\n flex: '0 0 auto',\n },\n },\n upperHalf: {\n left: '50%',\n marginLeft: '-50%',\n },\n brand: {\n color: tokens.colorBrandForeground1,\n },\n marigold: {\n color: tokens.colorPaletteMarigoldBorderActive,\n },\n filled: {\n color: tokens.colorNeutralBackground6,\n stroke: tokens.colorTransparentStroke,\n '@media (forced-colors: active)': {\n color: 'Canvas',\n stroke: 'CanvasText',\n },\n },\n brandFilled: {\n color: tokens.colorBrandBackground2,\n },\n marigoldFilled: {\n color: tokens.colorPaletteMarigoldBackground2,\n },\n});\n\n/**\n * Apply styling to the RatingItem slots based on the state\n */\nexport const useRatingItemStyles_unstable = (state: RatingItemState): RatingItemState => {\n const { color, size, iconFillWidth, appearance } = state;\n const styles = useStyles();\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n const indicatorBaseClassName = useIndicatorBaseClassName();\n const indicatorStyles = useIndicatorStyles();\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(ratingItemClassNames.root, styles.root, styles[size], state.root.className);\n\n if (state.halfValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.halfValueInput.className = mergeClasses(\n ratingItemClassNames.halfValueInput,\n inputBaseClassName,\n inputStyles.lowerHalf,\n state.halfValueInput.className,\n );\n }\n\n if (state.fullValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.fullValueInput.className = mergeClasses(\n ratingItemClassNames.fullValueInput,\n inputBaseClassName,\n state.halfValueInput && inputStyles.upperHalf,\n state.fullValueInput.className,\n );\n }\n\n if (state.unselectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.unselectedIcon.className = mergeClasses(\n ratingItemClassNames.unselectedIcon,\n indicatorBaseClassName,\n appearance === 'filled' && indicatorStyles.filled,\n color === 'brand' && (appearance === 'filled' ? indicatorStyles.brandFilled : indicatorStyles.brand),\n color === 'marigold' && (appearance === 'filled' ? indicatorStyles.marigoldFilled : indicatorStyles.marigold),\n iconFillWidth === 0.5 && indicatorStyles.upperHalf,\n state.unselectedIcon.className,\n );\n }\n\n if (state.selectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.selectedIcon.className = mergeClasses(\n ratingItemClassNames.selectedIcon,\n indicatorBaseClassName,\n color === 'brand' && indicatorStyles.brand,\n color === 'marigold' && indicatorStyles.marigold,\n iconFillWidth === 0.5 && indicatorStyles.lowerHalf,\n state.selectedIcon.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","createFocusOutlineStyle","ratingItemClassNames","root","selectedIcon","unselectedIcon","halfValueInput","fullValueInput","useStyles","position","style","selector","small","fontSize","width","height","medium","large","useInputBaseClassName","left","top","right","bottom","boxSizing","margin","opacity","cursor","useInputStyles","lowerHalf","upperHalf","useIndicatorBaseClassName","display","overflow","color","colorNeutralForeground1","fill","pointerEvents","useIndicatorStyles","flex","marginLeft","brand","colorBrandForeground1","marigold","colorPaletteMarigoldBorderActive","filled","colorNeutralBackground6","stroke","colorTransparentStroke","brandFilled","colorBrandBackground2","marigoldFilled","colorPaletteMarigoldBackground2","useRatingItemStyles_unstable","state","size","iconFillWidth","appearance","styles","inputBaseClassName","inputStyles","indicatorBaseClassName","indicatorStyles","className"],"mappings":"AAAA;;;;;;;;;;;;QAQaK;;;;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/RatingItem/useRatingItemStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport type { RatingItemSlots, RatingItemState } from './RatingItem.types';\n\nexport const ratingItemClassNames: SlotClassNames<RatingItemSlots> = {\n root: 'fui-RatingItem',\n selectedIcon: 'fui-RatingItem__selectedIcon',\n unselectedIcon: 'fui-RatingItem__unselectedIcon',\n halfValueInput: 'fui-RatingItem__halfValueInput',\n fullValueInput: 'fui-RatingItem__fullValueInput',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n position: 'relative',\n ...createFocusOutlineStyle({ style: {}, selector: 'focus-within' }),\n },\n small: {\n fontSize: '12px',\n width: '12px',\n height: '12px',\n },\n\n medium: {\n fontSize: '16px',\n width: '16px',\n height: '16px',\n },\n\n large: {\n fontSize: '20px',\n width: '20px',\n height: '20px',\n },\n\n 'extra-large': {\n fontSize: '28px',\n width: '28px',\n height: '28px',\n },\n});\n\nconst useInputBaseClassName = makeResetStyles({\n position: 'absolute',\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n boxSizing: 'border-box',\n margin: 0,\n opacity: 0,\n cursor: 'pointer',\n height: '100%',\n});\n\nconst useInputStyles = makeStyles({\n lowerHalf: {\n right: '50%',\n },\n upperHalf: {\n left: '50%',\n },\n});\n\nconst useIndicatorBaseClassName = makeResetStyles({\n display: 'flex',\n overflow: 'hidden',\n color: tokens.colorNeutralForeground1,\n fill: 'currentColor',\n pointerEvents: 'none',\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n});\n\nconst useIndicatorStyles = makeStyles({\n lowerHalf: {\n right: '50%',\n '& > svg, & > .fui-Icon-font': {\n flex: '0 0 auto',\n },\n },\n upperHalf: {\n left: '50%',\n marginLeft: '-50%',\n },\n brand: {\n color: tokens.colorBrandForeground1,\n },\n marigold: {\n color: tokens.colorPaletteMarigoldBorderActive,\n },\n filled: {\n color: tokens.colorNeutralBackground6,\n stroke: tokens.colorTransparentStroke,\n '@media (forced-colors: active)': {\n color: 'Canvas',\n stroke: 'CanvasText',\n '& > .fui-Icon-font': {\n WebkitTextStrokeColor: 'CanvasText',\n // Match SVG's default stroke width independently of theme border tokens.\n WebkitTextStrokeWidth: '1px',\n },\n },\n },\n brandFilled: {\n color: tokens.colorBrandBackground2,\n },\n marigoldFilled: {\n color: tokens.colorPaletteMarigoldBackground2,\n },\n});\n\n/**\n * Apply styling to the RatingItem slots based on the state\n */\nexport const useRatingItemStyles_unstable = (state: RatingItemState): RatingItemState => {\n const { color, size, iconFillWidth, appearance } = state;\n const styles = useStyles();\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n const indicatorBaseClassName = useIndicatorBaseClassName();\n const indicatorStyles = useIndicatorStyles();\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(ratingItemClassNames.root, styles.root, styles[size], state.root.className);\n\n if (state.halfValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.halfValueInput.className = mergeClasses(\n ratingItemClassNames.halfValueInput,\n inputBaseClassName,\n inputStyles.lowerHalf,\n state.halfValueInput.className,\n );\n }\n\n if (state.fullValueInput) {\n // eslint-disable-next-line react-hooks/immutability\n state.fullValueInput.className = mergeClasses(\n ratingItemClassNames.fullValueInput,\n inputBaseClassName,\n state.halfValueInput && inputStyles.upperHalf,\n state.fullValueInput.className,\n );\n }\n\n if (state.unselectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.unselectedIcon.className = mergeClasses(\n ratingItemClassNames.unselectedIcon,\n indicatorBaseClassName,\n appearance === 'filled' && indicatorStyles.filled,\n color === 'brand' && (appearance === 'filled' ? indicatorStyles.brandFilled : indicatorStyles.brand),\n color === 'marigold' && (appearance === 'filled' ? indicatorStyles.marigoldFilled : indicatorStyles.marigold),\n iconFillWidth === 0.5 && indicatorStyles.upperHalf,\n state.unselectedIcon.className,\n );\n }\n\n if (state.selectedIcon) {\n // eslint-disable-next-line react-hooks/immutability\n state.selectedIcon.className = mergeClasses(\n ratingItemClassNames.selectedIcon,\n indicatorBaseClassName,\n color === 'brand' && indicatorStyles.brand,\n color === 'marigold' && indicatorStyles.marigold,\n iconFillWidth === 0.5 && indicatorStyles.lowerHalf,\n state.selectedIcon.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","createFocusOutlineStyle","ratingItemClassNames","root","selectedIcon","unselectedIcon","halfValueInput","fullValueInput","useStyles","position","style","selector","small","fontSize","width","height","medium","large","useInputBaseClassName","left","top","right","bottom","boxSizing","margin","opacity","cursor","useInputStyles","lowerHalf","upperHalf","useIndicatorBaseClassName","display","overflow","color","colorNeutralForeground1","fill","pointerEvents","useIndicatorStyles","flex","marginLeft","brand","colorBrandForeground1","marigold","colorPaletteMarigoldBorderActive","filled","colorNeutralBackground6","stroke","colorTransparentStroke","WebkitTextStrokeColor","WebkitTextStrokeWidth","brandFilled","colorBrandBackground2","marigoldFilled","colorPaletteMarigoldBackground2","useRatingItemStyles_unstable","state","size","iconFillWidth","appearance","styles","inputBaseClassName","inputStyles","indicatorBaseClassName","indicatorStyles","className"],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S;IAElC;IAEA,IAAIT,MAAMlD,cAAc,EAAE;QACxB,oDAAoD;QACpDkD,MAAMlD,cAAc,CAAC2D,SAAS,GAAGjE,uBAAAA,EAC/BG,qBAAqBG,cAAc,EACnCyD,wBACAJ,eAAe,YAAYK,gBAAgBnB,MAAM,EACjDX,UAAU,WAAYyB,CAAAA,eAAe,WAAWK,gBAAgBb,WAAW,GAAGa,gBAAgBvB,KAAAA,AAAI,GAClGP,UAAU,cAAeyB,gBAAe,WAAWK,gBAAgBX,cAAc,GAAGW,gBAAgBrB,QAAAA,AAAO,GAC3Ge,kBAAkB,OAAOM,gBAAgBlC,SAAS,EAClD0B,MAAMlD,cAAc,CAAC2D,SAAS;IAElC;IAEA,IAAIT,MAAMnD,YAAY,EAAE;QACtB,oDAAoD;QACpDmD,MAAMnD,YAAY,CAAC4D,SAAS,OAAGjE,mBAAAA,EAC7BG,qBAAqBE,YAAY,EACjC0D,wBACA7B,UAAU,WAAW8B,gBAAgBvB,KAAK,EAC1CP,UAAU,cAAc8B,gBAAgBrB,QAAQ,EAChDe,kBAAkB,OAAOM,gBAAgBnC,SAAS,EAClD2B,MAAMnD,YAAY,CAAC4D,SAAS;IAEhC;IAEA,OAAOT;AACT,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-rating",
|
|
3
|
-
"version": "9.75.
|
|
3
|
+
"version": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
4
4
|
"description": "Rating component for building web experiences",
|
|
5
5
|
"main": "lib-commonjs/index.cjs",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@fluentui/react-icons": "^2.0.245",
|
|
18
|
-
"@fluentui/react-jsx-runtime": "9.75.
|
|
19
|
-
"@fluentui/react-shared-contexts": "9.75.
|
|
20
|
-
"@fluentui/react-tabster": "9.75.
|
|
21
|
-
"@fluentui/react-theme": "9.75.
|
|
22
|
-
"@fluentui/react-utilities": "9.75.
|
|
18
|
+
"@fluentui/react-jsx-runtime": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
19
|
+
"@fluentui/react-shared-contexts": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
20
|
+
"@fluentui/react-tabster": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
21
|
+
"@fluentui/react-theme": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
22
|
+
"@fluentui/react-utilities": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
23
23
|
"@griffel/react": "^1.5.32",
|
|
24
24
|
"@swc/helpers": "^0.5.1",
|
|
25
25
|
"clsx": "^2.1.1"
|