@fluentui/react-radio 9.4.7 → 9.5.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 CHANGED
@@ -1,12 +1,24 @@
1
1
  # Change Log - @fluentui/react-radio
2
2
 
3
- This log was last generated on Fri, 11 Jul 2025 15:56:58 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 17 Jul 2025 13:45:45 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.5.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.5.0)
8
+
9
+ Thu, 17 Jul 2025 13:45:45 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.4.7..@fluentui/react-radio_v9.5.0)
11
+
12
+ ### Minor changes
13
+
14
+ - feat: enable griffel raw styles ([PR #34853](https://github.com/microsoft/fluentui/pull/34853) by martinhochel@microsoft.com)
15
+ - Bump @fluentui/react-field to v9.4.0 ([PR #34862](https://github.com/microsoft/fluentui/pull/34862) by beachball)
16
+ - Bump @fluentui/react-label to v9.3.0 ([PR #34862](https://github.com/microsoft/fluentui/pull/34862) by beachball)
17
+ - Bump @fluentui/react-tabster to v9.26.0 ([PR #34862](https://github.com/microsoft/fluentui/pull/34862) by beachball)
18
+
7
19
  ## [9.4.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.4.7)
8
20
 
9
- Fri, 11 Jul 2025 15:56:58 GMT
21
+ Fri, 11 Jul 2025 15:59:24 GMT
10
22
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.4.6..@fluentui/react-radio_v9.4.7)
11
23
 
12
24
  ### Patches
@@ -0,0 +1,201 @@
1
+ import { createFocusOutlineStyle } from '@fluentui/react-tabster';
2
+ import { tokens } from '@fluentui/react-theme';
3
+ import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';
4
+ export const radioClassNames = {
5
+ root: 'fui-Radio',
6
+ indicator: 'fui-Radio__indicator',
7
+ input: 'fui-Radio__input',
8
+ label: 'fui-Radio__label'
9
+ };
10
+ // The indicator size is used by the indicator and label styles
11
+ const indicatorSize = '16px';
12
+ const useRootBaseClassName = makeResetStyles({
13
+ display: 'inline-flex',
14
+ position: 'relative',
15
+ ...createFocusOutlineStyle({
16
+ style: {},
17
+ selector: 'focus-within'
18
+ })
19
+ });
20
+ const useRootStyles = makeStyles({
21
+ vertical: {
22
+ flexDirection: 'column',
23
+ alignItems: 'center'
24
+ }
25
+ });
26
+ const useInputBaseClassName = makeResetStyles({
27
+ position: 'absolute',
28
+ left: 0,
29
+ top: 0,
30
+ width: `calc(${indicatorSize} + 2 * ${tokens.spacingHorizontalS})`,
31
+ height: '100%',
32
+ boxSizing: 'border-box',
33
+ margin: 0,
34
+ opacity: 0,
35
+ ':enabled': {
36
+ cursor: 'pointer',
37
+ [`& ~ .${radioClassNames.label}`]: {
38
+ cursor: 'pointer'
39
+ }
40
+ },
41
+ // Colors for the unchecked state
42
+ ':enabled:not(:checked)': {
43
+ [`& ~ .${radioClassNames.label}`]: {
44
+ color: tokens.colorNeutralForeground3
45
+ },
46
+ [`& ~ .${radioClassNames.indicator}`]: {
47
+ borderColor: tokens.colorNeutralStrokeAccessible,
48
+ '@media (forced-colors: active)': {
49
+ borderColor: 'ButtonBorder'
50
+ }
51
+ },
52
+ ':hover': {
53
+ [`& ~ .${radioClassNames.label}`]: {
54
+ color: tokens.colorNeutralForeground2
55
+ },
56
+ [`& ~ .${radioClassNames.indicator}`]: {
57
+ borderColor: tokens.colorNeutralStrokeAccessibleHover
58
+ }
59
+ },
60
+ ':hover:active': {
61
+ [`& ~ .${radioClassNames.label}`]: {
62
+ color: tokens.colorNeutralForeground1
63
+ },
64
+ [`& ~ .${radioClassNames.indicator}`]: {
65
+ borderColor: tokens.colorNeutralStrokeAccessiblePressed
66
+ }
67
+ }
68
+ },
69
+ // Colors for the checked state
70
+ ':enabled:checked': {
71
+ [`& ~ .${radioClassNames.label}`]: {
72
+ color: tokens.colorNeutralForeground1
73
+ },
74
+ [`& ~ .${radioClassNames.indicator}`]: {
75
+ borderColor: tokens.colorCompoundBrandStroke,
76
+ color: tokens.colorCompoundBrandForeground1,
77
+ '@media (forced-colors: active)': {
78
+ borderColor: 'Highlight',
79
+ color: 'Highlight',
80
+ '::after': {
81
+ backgroundColor: 'Highlight'
82
+ }
83
+ }
84
+ },
85
+ ':hover': {
86
+ [`& ~ .${radioClassNames.indicator}`]: {
87
+ borderColor: tokens.colorCompoundBrandStrokeHover,
88
+ color: tokens.colorCompoundBrandForeground1Hover
89
+ }
90
+ },
91
+ ':hover:active': {
92
+ [`& ~ .${radioClassNames.indicator}`]: {
93
+ borderColor: tokens.colorCompoundBrandStrokePressed,
94
+ color: tokens.colorCompoundBrandForeground1Pressed
95
+ }
96
+ }
97
+ },
98
+ // Colors for the disabled state
99
+ ':disabled': {
100
+ [`& ~ .${radioClassNames.label}`]: {
101
+ color: tokens.colorNeutralForegroundDisabled,
102
+ cursor: 'default',
103
+ '@media (forced-colors: active)': {
104
+ color: 'GrayText'
105
+ }
106
+ },
107
+ [`& ~ .${radioClassNames.indicator}`]: {
108
+ borderColor: tokens.colorNeutralStrokeDisabled,
109
+ color: tokens.colorNeutralForegroundDisabled,
110
+ '@media (forced-colors: active)': {
111
+ borderColor: 'GrayText',
112
+ color: 'GrayText',
113
+ '::after': {
114
+ backgroundColor: 'GrayText'
115
+ }
116
+ }
117
+ }
118
+ }
119
+ });
120
+ const useInputStyles = makeStyles({
121
+ below: {
122
+ width: '100%',
123
+ height: `calc(${indicatorSize} + 2 * ${tokens.spacingVerticalS})`
124
+ },
125
+ // If the indicator has no children, use the ::after pseudo-element for the checked state
126
+ defaultIndicator: {
127
+ [`:checked ~ .${radioClassNames.indicator}::after`]: {
128
+ content: '""'
129
+ }
130
+ },
131
+ // If the indicator has a child, hide it until the radio is checked
132
+ customIndicator: {
133
+ [`:not(:checked) ~ .${radioClassNames.indicator} > *`]: {
134
+ opacity: '0'
135
+ }
136
+ }
137
+ });
138
+ const useIndicatorBaseClassName = makeResetStyles({
139
+ position: 'relative',
140
+ width: indicatorSize,
141
+ height: indicatorSize,
142
+ fontSize: '12px',
143
+ boxSizing: 'border-box',
144
+ flexShrink: 0,
145
+ display: 'flex',
146
+ alignItems: 'center',
147
+ justifyContent: 'center',
148
+ overflow: 'hidden',
149
+ border: tokens.strokeWidthThin + ' solid',
150
+ borderRadius: tokens.borderRadiusCircular,
151
+ margin: tokens.spacingVerticalS + ' ' + tokens.spacingHorizontalS,
152
+ fill: 'currentColor',
153
+ pointerEvents: 'none',
154
+ '::after': {
155
+ position: 'absolute',
156
+ width: indicatorSize,
157
+ height: indicatorSize,
158
+ borderRadius: tokens.borderRadiusCircular,
159
+ // Use a transform to avoid pixel rounding errors at 125% DPI
160
+ // https://github.com/microsoft/fluentui/issues/30025
161
+ transform: 'scale(0.625)',
162
+ backgroundColor: 'currentColor'
163
+ }
164
+ });
165
+ // Can't use makeResetStyles here because Label is a component that may itself use makeResetStyles.
166
+ const useLabelStyles = makeStyles({
167
+ base: {
168
+ alignSelf: 'center',
169
+ padding: `${tokens.spacingVerticalS} ${tokens.spacingHorizontalS}`
170
+ },
171
+ after: {
172
+ paddingLeft: tokens.spacingHorizontalXS,
173
+ // Use a (negative) margin to account for the difference between the indicator's height and the label's line height.
174
+ // This prevents the label from expanding the height of the Radio, but preserves line height if the label wraps.
175
+ marginTop: `calc((${indicatorSize} - ${tokens.lineHeightBase300}) / 2)`,
176
+ marginBottom: `calc((${indicatorSize} - ${tokens.lineHeightBase300}) / 2)`
177
+ },
178
+ below: {
179
+ paddingTop: tokens.spacingVerticalXS,
180
+ textAlign: 'center'
181
+ }
182
+ });
183
+ /**
184
+ * Apply styling to the Radio slots based on the state
185
+ */ export const useRadioStyles_unstable = (state)=>{
186
+ 'use no memo';
187
+ const { labelPosition } = state;
188
+ const rootBaseClassName = useRootBaseClassName();
189
+ const rootStyles = useRootStyles();
190
+ state.root.className = mergeClasses(radioClassNames.root, rootBaseClassName, labelPosition === 'below' && rootStyles.vertical, state.root.className);
191
+ const inputBaseClassName = useInputBaseClassName();
192
+ const inputStyles = useInputStyles();
193
+ state.input.className = mergeClasses(radioClassNames.input, inputBaseClassName, labelPosition === 'below' && inputStyles.below, state.indicator.children ? inputStyles.customIndicator : inputStyles.defaultIndicator, state.input.className);
194
+ const indicatorBaseClassName = useIndicatorBaseClassName();
195
+ state.indicator.className = mergeClasses(radioClassNames.indicator, indicatorBaseClassName, state.indicator.className);
196
+ const labelStyles = useLabelStyles();
197
+ if (state.label) {
198
+ state.label.className = mergeClasses(radioClassNames.label, labelStyles.base, labelStyles[labelPosition], state.label.className);
199
+ }
200
+ return state;
201
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Radio/useRadioStyles.styles.ts"],"sourcesContent":["import { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { RadioSlots, RadioState } from './Radio.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const radioClassNames: SlotClassNames<RadioSlots> = {\n root: 'fui-Radio',\n indicator: 'fui-Radio__indicator',\n input: 'fui-Radio__input',\n label: 'fui-Radio__label',\n};\n\n// The indicator size is used by the indicator and label styles\nconst indicatorSize = '16px';\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'inline-flex',\n position: 'relative',\n ...createFocusOutlineStyle({ style: {}, selector: 'focus-within' }),\n});\n\nconst useRootStyles = makeStyles({\n vertical: {\n flexDirection: 'column',\n alignItems: 'center',\n },\n});\n\nconst useInputBaseClassName = makeResetStyles({\n position: 'absolute',\n left: 0,\n top: 0,\n width: `calc(${indicatorSize} + 2 * ${tokens.spacingHorizontalS})`,\n height: '100%',\n boxSizing: 'border-box',\n margin: 0,\n opacity: 0,\n\n ':enabled': {\n cursor: 'pointer',\n [`& ~ .${radioClassNames.label}`]: {\n cursor: 'pointer',\n },\n },\n\n // Colors for the unchecked state\n ':enabled:not(:checked)': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground3,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeAccessible,\n '@media (forced-colors: active)': {\n borderColor: 'ButtonBorder',\n },\n },\n\n ':hover': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground2,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n },\n\n ':hover:active': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground1,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n },\n },\n\n // Colors for the checked state\n ':enabled:checked': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground1,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorCompoundBrandStroke,\n color: tokens.colorCompoundBrandForeground1,\n '@media (forced-colors: active)': {\n borderColor: 'Highlight',\n color: 'Highlight',\n '::after': {\n backgroundColor: 'Highlight',\n },\n },\n },\n\n ':hover': {\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorCompoundBrandStrokeHover,\n color: tokens.colorCompoundBrandForeground1Hover,\n },\n },\n\n ':hover:active': {\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorCompoundBrandStrokePressed,\n color: tokens.colorCompoundBrandForeground1Pressed,\n },\n },\n },\n\n // Colors for the disabled state\n ':disabled': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'default',\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeDisabled,\n color: tokens.colorNeutralForegroundDisabled,\n '@media (forced-colors: active)': {\n borderColor: 'GrayText',\n color: 'GrayText',\n '::after': {\n backgroundColor: 'GrayText',\n },\n },\n },\n },\n});\n\nconst useInputStyles = makeStyles({\n below: {\n width: '100%',\n height: `calc(${indicatorSize} + 2 * ${tokens.spacingVerticalS})`,\n },\n\n // If the indicator has no children, use the ::after pseudo-element for the checked state\n defaultIndicator: {\n [`:checked ~ .${radioClassNames.indicator}::after`]: {\n content: '\"\"',\n },\n },\n\n // If the indicator has a child, hide it until the radio is checked\n customIndicator: {\n [`:not(:checked) ~ .${radioClassNames.indicator} > *`]: {\n opacity: '0',\n },\n },\n});\n\nconst useIndicatorBaseClassName = makeResetStyles({\n position: 'relative',\n width: indicatorSize,\n height: indicatorSize,\n fontSize: '12px',\n boxSizing: 'border-box',\n flexShrink: 0,\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n\n border: tokens.strokeWidthThin + ' solid',\n borderRadius: tokens.borderRadiusCircular,\n margin: tokens.spacingVerticalS + ' ' + tokens.spacingHorizontalS,\n fill: 'currentColor',\n pointerEvents: 'none',\n\n '::after': {\n position: 'absolute',\n width: indicatorSize,\n height: indicatorSize,\n borderRadius: tokens.borderRadiusCircular,\n // Use a transform to avoid pixel rounding errors at 125% DPI\n // https://github.com/microsoft/fluentui/issues/30025\n transform: 'scale(0.625)',\n backgroundColor: 'currentColor',\n },\n});\n\n// Can't use makeResetStyles here because Label is a component that may itself use makeResetStyles.\nconst useLabelStyles = makeStyles({\n base: {\n alignSelf: 'center',\n padding: `${tokens.spacingVerticalS} ${tokens.spacingHorizontalS}`,\n },\n\n after: {\n paddingLeft: tokens.spacingHorizontalXS,\n\n // Use a (negative) margin to account for the difference between the indicator's height and the label's line height.\n // This prevents the label from expanding the height of the Radio, but preserves line height if the label wraps.\n marginTop: `calc((${indicatorSize} - ${tokens.lineHeightBase300}) / 2)`,\n marginBottom: `calc((${indicatorSize} - ${tokens.lineHeightBase300}) / 2)`,\n },\n\n below: {\n paddingTop: tokens.spacingVerticalXS,\n textAlign: 'center',\n },\n});\n\n/**\n * Apply styling to the Radio slots based on the state\n */\nexport const useRadioStyles_unstable = (state: RadioState): RadioState => {\n 'use no memo';\n\n const { labelPosition } = state;\n\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(\n radioClassNames.root,\n rootBaseClassName,\n labelPosition === 'below' && rootStyles.vertical,\n state.root.className,\n );\n\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n state.input.className = mergeClasses(\n radioClassNames.input,\n inputBaseClassName,\n labelPosition === 'below' && inputStyles.below,\n state.indicator.children ? inputStyles.customIndicator : inputStyles.defaultIndicator,\n state.input.className,\n );\n\n const indicatorBaseClassName = useIndicatorBaseClassName();\n state.indicator.className = mergeClasses(\n radioClassNames.indicator,\n indicatorBaseClassName,\n state.indicator.className,\n );\n\n const labelStyles = useLabelStyles();\n if (state.label) {\n state.label.className = mergeClasses(\n radioClassNames.label,\n labelStyles.base,\n labelStyles[labelPosition],\n state.label.className,\n );\n }\n\n return state;\n};\n"],"names":["createFocusOutlineStyle","tokens","makeResetStyles","makeStyles","mergeClasses","radioClassNames","root","indicator","input","label","indicatorSize","useRootBaseClassName","display","position","style","selector","useRootStyles","vertical","flexDirection","alignItems","useInputBaseClassName","left","top","width","spacingHorizontalS","height","boxSizing","margin","opacity","cursor","color","colorNeutralForeground3","borderColor","colorNeutralStrokeAccessible","colorNeutralForeground2","colorNeutralStrokeAccessibleHover","colorNeutralForeground1","colorNeutralStrokeAccessiblePressed","colorCompoundBrandStroke","colorCompoundBrandForeground1","backgroundColor","colorCompoundBrandStrokeHover","colorCompoundBrandForeground1Hover","colorCompoundBrandStrokePressed","colorCompoundBrandForeground1Pressed","colorNeutralForegroundDisabled","colorNeutralStrokeDisabled","useInputStyles","below","spacingVerticalS","defaultIndicator","content","customIndicator","useIndicatorBaseClassName","fontSize","flexShrink","justifyContent","overflow","border","strokeWidthThin","borderRadius","borderRadiusCircular","fill","pointerEvents","transform","useLabelStyles","base","alignSelf","padding","after","paddingLeft","spacingHorizontalXS","marginTop","lineHeightBase300","marginBottom","paddingTop","spacingVerticalXS","textAlign","useRadioStyles_unstable","state","labelPosition","rootBaseClassName","rootStyles","className","inputBaseClassName","inputStyles","children","indicatorBaseClassName","labelStyles"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAI3E,OAAO,MAAMC,kBAA8C;IACzDC,MAAM;IACNC,WAAW;IACXC,OAAO;IACPC,OAAO;AACT,EAAE;AAEF,+DAA+D;AAC/D,MAAMC,gBAAgB;AAEtB,MAAMC,uBAAuBT,gBAAgB;IAC3CU,SAAS;IACTC,UAAU;IACV,GAAGb,wBAAwB;QAAEc,OAAO,CAAC;QAAGC,UAAU;IAAe,EAAE;AACrE;AAEA,MAAMC,gBAAgBb,WAAW;IAC/Bc,UAAU;QACRC,eAAe;QACfC,YAAY;IACd;AACF;AAEA,MAAMC,wBAAwBlB,gBAAgB;IAC5CW,UAAU;IACVQ,MAAM;IACNC,KAAK;IACLC,OAAO,CAAC,KAAK,EAAEb,cAAc,OAAO,EAAET,OAAOuB,kBAAkB,CAAC,CAAC,CAAC;IAClEC,QAAQ;IACRC,WAAW;IACXC,QAAQ;IACRC,SAAS;IAET,YAAY;QACVC,QAAQ;QACR,CAAC,CAAC,KAAK,EAAExB,gBAAgBI,KAAK,CAAC,CAAC,CA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AAS,GAAG/E,aACtBC,gBAAgBG,KAAK,EACrB4E,oBACAJ,kBAAkB,WAAWK,YAAYrC,KAAK,EAC9C+B,MAAMxE,SAAS,CAAC+E,QAAQ,GAAGD,YAAYjC,eAAe,GAAGiC,YAAYnC,gBAAgB,EACrF6B,MAAMvE,KAAK,CAAC2E,SAAS;IAGvB,MAAMI,yBAAyBlC;IAC/B0B,MAAMxE,SAAS,CAAC4E,SAAS,GAAG/E,aAC1BC,gBAAgBE,SAAS,EACzBgF,wBACAR,MAAMxE,SAAS,CAAC4E,SAAS;IAG3B,MAAMK,cAAcvB;IACpB,IAAIc,MAAMtE,KAAK,EAAE;QACfsE,MAAMtE,KAAK,CAAC0E,SAAS,GAAG/E,aACtBC,gBAAgBI,KAAK,EACrB+E,YAAYtB,IAAI,EAChBsB,WAAW,CAACR,cAAc,EAC1BD,MAAMtE,KAAK,CAAC0E,SAAS;IAEzB;IAEA,OAAOJ;AACT,EAAE"}
@@ -0,0 +1,21 @@
1
+ import { makeStyles, mergeClasses } from '@griffel/react';
2
+ export const radioGroupClassNames = {
3
+ root: 'fui-RadioGroup'
4
+ };
5
+ const useStyles = makeStyles({
6
+ root: {
7
+ display: 'flex',
8
+ alignItems: 'flex-start'
9
+ },
10
+ vertical: {
11
+ flexDirection: 'column'
12
+ }
13
+ });
14
+ /**
15
+ * Apply styling to the RadioGroup slots based on the state
16
+ */ export const useRadioGroupStyles_unstable = (state)=>{
17
+ 'use no memo';
18
+ const styles = useStyles();
19
+ state.root.className = mergeClasses(radioGroupClassNames.root, styles.root, state.layout === 'vertical' && styles.vertical, state.root.className);
20
+ return state;
21
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/RadioGroup/useRadioGroupStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { RadioGroupSlots, RadioGroupState } from './RadioGroup.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const radioGroupClassNames: SlotClassNames<RadioGroupSlots> = {\n root: 'fui-RadioGroup',\n};\n\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n\n vertical: {\n flexDirection: 'column',\n },\n});\n\n/**\n * Apply styling to the RadioGroup slots based on the state\n */\nexport const useRadioGroupStyles_unstable = (state: RadioGroupState): RadioGroupState => {\n 'use no memo';\n\n const styles = useStyles();\n\n state.root.className = mergeClasses(\n radioGroupClassNames.root,\n styles.root,\n state.layout === 'vertical' && styles.vertical,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","radioGroupClassNames","root","useStyles","display","alignItems","vertical","flexDirection","useRadioGroupStyles_unstable","state","styles","className","layout"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAI1D,OAAO,MAAMC,uBAAwD;IACnEC,MAAM;AACR,EAAE;AAEF,MAAMC,YAAYJ,WAAW;IAC3BG,MAAM;QACJE,SAAS;QACTC,YAAY;IACd;IAEAC,UAAU;QACRC,eAAe;IACjB;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,+BAA+B,CAACC;IAC3C;IAEA,MAAMC,SAASP;IAEfM,MAAMP,IAAI,CAACS,SAAS,GAAGX,aACrBC,qBAAqBC,IAAI,EACzBQ,OAAOR,IAAI,EACXO,MAAMG,MAAM,KAAK,cAAcF,OAAOJ,QAAQ,EAC9CG,MAAMP,IAAI,CAACS,SAAS;IAGtB,OAAOF;AACT,EAAE"}
@@ -0,0 +1,217 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ radioClassNames: function() {
13
+ return radioClassNames;
14
+ },
15
+ useRadioStyles_unstable: function() {
16
+ return useRadioStyles_unstable;
17
+ }
18
+ });
19
+ const _reacttabster = require("@fluentui/react-tabster");
20
+ const _reacttheme = require("@fluentui/react-theme");
21
+ const _react = require("@griffel/react");
22
+ const radioClassNames = {
23
+ root: 'fui-Radio',
24
+ indicator: 'fui-Radio__indicator',
25
+ input: 'fui-Radio__input',
26
+ label: 'fui-Radio__label'
27
+ };
28
+ // The indicator size is used by the indicator and label styles
29
+ const indicatorSize = '16px';
30
+ const useRootBaseClassName = (0, _react.makeResetStyles)({
31
+ display: 'inline-flex',
32
+ position: 'relative',
33
+ ...(0, _reacttabster.createFocusOutlineStyle)({
34
+ style: {},
35
+ selector: 'focus-within'
36
+ })
37
+ });
38
+ const useRootStyles = (0, _react.makeStyles)({
39
+ vertical: {
40
+ flexDirection: 'column',
41
+ alignItems: 'center'
42
+ }
43
+ });
44
+ const useInputBaseClassName = (0, _react.makeResetStyles)({
45
+ position: 'absolute',
46
+ left: 0,
47
+ top: 0,
48
+ width: `calc(${indicatorSize} + 2 * ${_reacttheme.tokens.spacingHorizontalS})`,
49
+ height: '100%',
50
+ boxSizing: 'border-box',
51
+ margin: 0,
52
+ opacity: 0,
53
+ ':enabled': {
54
+ cursor: 'pointer',
55
+ [`& ~ .${radioClassNames.label}`]: {
56
+ cursor: 'pointer'
57
+ }
58
+ },
59
+ // Colors for the unchecked state
60
+ ':enabled:not(:checked)': {
61
+ [`& ~ .${radioClassNames.label}`]: {
62
+ color: _reacttheme.tokens.colorNeutralForeground3
63
+ },
64
+ [`& ~ .${radioClassNames.indicator}`]: {
65
+ borderColor: _reacttheme.tokens.colorNeutralStrokeAccessible,
66
+ '@media (forced-colors: active)': {
67
+ borderColor: 'ButtonBorder'
68
+ }
69
+ },
70
+ ':hover': {
71
+ [`& ~ .${radioClassNames.label}`]: {
72
+ color: _reacttheme.tokens.colorNeutralForeground2
73
+ },
74
+ [`& ~ .${radioClassNames.indicator}`]: {
75
+ borderColor: _reacttheme.tokens.colorNeutralStrokeAccessibleHover
76
+ }
77
+ },
78
+ ':hover:active': {
79
+ [`& ~ .${radioClassNames.label}`]: {
80
+ color: _reacttheme.tokens.colorNeutralForeground1
81
+ },
82
+ [`& ~ .${radioClassNames.indicator}`]: {
83
+ borderColor: _reacttheme.tokens.colorNeutralStrokeAccessiblePressed
84
+ }
85
+ }
86
+ },
87
+ // Colors for the checked state
88
+ ':enabled:checked': {
89
+ [`& ~ .${radioClassNames.label}`]: {
90
+ color: _reacttheme.tokens.colorNeutralForeground1
91
+ },
92
+ [`& ~ .${radioClassNames.indicator}`]: {
93
+ borderColor: _reacttheme.tokens.colorCompoundBrandStroke,
94
+ color: _reacttheme.tokens.colorCompoundBrandForeground1,
95
+ '@media (forced-colors: active)': {
96
+ borderColor: 'Highlight',
97
+ color: 'Highlight',
98
+ '::after': {
99
+ backgroundColor: 'Highlight'
100
+ }
101
+ }
102
+ },
103
+ ':hover': {
104
+ [`& ~ .${radioClassNames.indicator}`]: {
105
+ borderColor: _reacttheme.tokens.colorCompoundBrandStrokeHover,
106
+ color: _reacttheme.tokens.colorCompoundBrandForeground1Hover
107
+ }
108
+ },
109
+ ':hover:active': {
110
+ [`& ~ .${radioClassNames.indicator}`]: {
111
+ borderColor: _reacttheme.tokens.colorCompoundBrandStrokePressed,
112
+ color: _reacttheme.tokens.colorCompoundBrandForeground1Pressed
113
+ }
114
+ }
115
+ },
116
+ // Colors for the disabled state
117
+ ':disabled': {
118
+ [`& ~ .${radioClassNames.label}`]: {
119
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled,
120
+ cursor: 'default',
121
+ '@media (forced-colors: active)': {
122
+ color: 'GrayText'
123
+ }
124
+ },
125
+ [`& ~ .${radioClassNames.indicator}`]: {
126
+ borderColor: _reacttheme.tokens.colorNeutralStrokeDisabled,
127
+ color: _reacttheme.tokens.colorNeutralForegroundDisabled,
128
+ '@media (forced-colors: active)': {
129
+ borderColor: 'GrayText',
130
+ color: 'GrayText',
131
+ '::after': {
132
+ backgroundColor: 'GrayText'
133
+ }
134
+ }
135
+ }
136
+ }
137
+ });
138
+ const useInputStyles = (0, _react.makeStyles)({
139
+ below: {
140
+ width: '100%',
141
+ height: `calc(${indicatorSize} + 2 * ${_reacttheme.tokens.spacingVerticalS})`
142
+ },
143
+ // If the indicator has no children, use the ::after pseudo-element for the checked state
144
+ defaultIndicator: {
145
+ [`:checked ~ .${radioClassNames.indicator}::after`]: {
146
+ content: '""'
147
+ }
148
+ },
149
+ // If the indicator has a child, hide it until the radio is checked
150
+ customIndicator: {
151
+ [`:not(:checked) ~ .${radioClassNames.indicator} > *`]: {
152
+ opacity: '0'
153
+ }
154
+ }
155
+ });
156
+ const useIndicatorBaseClassName = (0, _react.makeResetStyles)({
157
+ position: 'relative',
158
+ width: indicatorSize,
159
+ height: indicatorSize,
160
+ fontSize: '12px',
161
+ boxSizing: 'border-box',
162
+ flexShrink: 0,
163
+ display: 'flex',
164
+ alignItems: 'center',
165
+ justifyContent: 'center',
166
+ overflow: 'hidden',
167
+ border: _reacttheme.tokens.strokeWidthThin + ' solid',
168
+ borderRadius: _reacttheme.tokens.borderRadiusCircular,
169
+ margin: _reacttheme.tokens.spacingVerticalS + ' ' + _reacttheme.tokens.spacingHorizontalS,
170
+ fill: 'currentColor',
171
+ pointerEvents: 'none',
172
+ '::after': {
173
+ position: 'absolute',
174
+ width: indicatorSize,
175
+ height: indicatorSize,
176
+ borderRadius: _reacttheme.tokens.borderRadiusCircular,
177
+ // Use a transform to avoid pixel rounding errors at 125% DPI
178
+ // https://github.com/microsoft/fluentui/issues/30025
179
+ transform: 'scale(0.625)',
180
+ backgroundColor: 'currentColor'
181
+ }
182
+ });
183
+ // Can't use makeResetStyles here because Label is a component that may itself use makeResetStyles.
184
+ const useLabelStyles = (0, _react.makeStyles)({
185
+ base: {
186
+ alignSelf: 'center',
187
+ padding: `${_reacttheme.tokens.spacingVerticalS} ${_reacttheme.tokens.spacingHorizontalS}`
188
+ },
189
+ after: {
190
+ paddingLeft: _reacttheme.tokens.spacingHorizontalXS,
191
+ // Use a (negative) margin to account for the difference between the indicator's height and the label's line height.
192
+ // This prevents the label from expanding the height of the Radio, but preserves line height if the label wraps.
193
+ marginTop: `calc((${indicatorSize} - ${_reacttheme.tokens.lineHeightBase300}) / 2)`,
194
+ marginBottom: `calc((${indicatorSize} - ${_reacttheme.tokens.lineHeightBase300}) / 2)`
195
+ },
196
+ below: {
197
+ paddingTop: _reacttheme.tokens.spacingVerticalXS,
198
+ textAlign: 'center'
199
+ }
200
+ });
201
+ const useRadioStyles_unstable = (state)=>{
202
+ 'use no memo';
203
+ const { labelPosition } = state;
204
+ const rootBaseClassName = useRootBaseClassName();
205
+ const rootStyles = useRootStyles();
206
+ state.root.className = (0, _react.mergeClasses)(radioClassNames.root, rootBaseClassName, labelPosition === 'below' && rootStyles.vertical, state.root.className);
207
+ const inputBaseClassName = useInputBaseClassName();
208
+ const inputStyles = useInputStyles();
209
+ state.input.className = (0, _react.mergeClasses)(radioClassNames.input, inputBaseClassName, labelPosition === 'below' && inputStyles.below, state.indicator.children ? inputStyles.customIndicator : inputStyles.defaultIndicator, state.input.className);
210
+ const indicatorBaseClassName = useIndicatorBaseClassName();
211
+ state.indicator.className = (0, _react.mergeClasses)(radioClassNames.indicator, indicatorBaseClassName, state.indicator.className);
212
+ const labelStyles = useLabelStyles();
213
+ if (state.label) {
214
+ state.label.className = (0, _react.mergeClasses)(radioClassNames.label, labelStyles.base, labelStyles[labelPosition], state.label.className);
215
+ }
216
+ return state;
217
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Radio/useRadioStyles.styles.ts"],"sourcesContent":["import { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { RadioSlots, RadioState } from './Radio.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const radioClassNames: SlotClassNames<RadioSlots> = {\n root: 'fui-Radio',\n indicator: 'fui-Radio__indicator',\n input: 'fui-Radio__input',\n label: 'fui-Radio__label',\n};\n\n// The indicator size is used by the indicator and label styles\nconst indicatorSize = '16px';\n\nconst useRootBaseClassName = makeResetStyles({\n display: 'inline-flex',\n position: 'relative',\n ...createFocusOutlineStyle({ style: {}, selector: 'focus-within' }),\n});\n\nconst useRootStyles = makeStyles({\n vertical: {\n flexDirection: 'column',\n alignItems: 'center',\n },\n});\n\nconst useInputBaseClassName = makeResetStyles({\n position: 'absolute',\n left: 0,\n top: 0,\n width: `calc(${indicatorSize} + 2 * ${tokens.spacingHorizontalS})`,\n height: '100%',\n boxSizing: 'border-box',\n margin: 0,\n opacity: 0,\n\n ':enabled': {\n cursor: 'pointer',\n [`& ~ .${radioClassNames.label}`]: {\n cursor: 'pointer',\n },\n },\n\n // Colors for the unchecked state\n ':enabled:not(:checked)': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground3,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeAccessible,\n '@media (forced-colors: active)': {\n borderColor: 'ButtonBorder',\n },\n },\n\n ':hover': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground2,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n },\n\n ':hover:active': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground1,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n },\n },\n\n // Colors for the checked state\n ':enabled:checked': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground1,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorCompoundBrandStroke,\n color: tokens.colorCompoundBrandForeground1,\n '@media (forced-colors: active)': {\n borderColor: 'Highlight',\n color: 'Highlight',\n '::after': {\n backgroundColor: 'Highlight',\n },\n },\n },\n\n ':hover': {\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorCompoundBrandStrokeHover,\n color: tokens.colorCompoundBrandForeground1Hover,\n },\n },\n\n ':hover:active': {\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorCompoundBrandStrokePressed,\n color: tokens.colorCompoundBrandForeground1Pressed,\n },\n },\n },\n\n // Colors for the disabled state\n ':disabled': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'default',\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeDisabled,\n color: tokens.colorNeutralForegroundDisabled,\n '@media (forced-colors: active)': {\n borderColor: 'GrayText',\n color: 'GrayText',\n '::after': {\n backgroundColor: 'GrayText',\n },\n },\n },\n },\n});\n\nconst useInputStyles = makeStyles({\n below: {\n width: '100%',\n height: `calc(${indicatorSize} + 2 * ${tokens.spacingVerticalS})`,\n },\n\n // If the indicator has no children, use the ::after pseudo-element for the checked state\n defaultIndicator: {\n [`:checked ~ .${radioClassNames.indicator}::after`]: {\n content: '\"\"',\n },\n },\n\n // If the indicator has a child, hide it until the radio is checked\n customIndicator: {\n [`:not(:checked) ~ .${radioClassNames.indicator} > *`]: {\n opacity: '0',\n },\n },\n});\n\nconst useIndicatorBaseClassName = makeResetStyles({\n position: 'relative',\n width: indicatorSize,\n height: indicatorSize,\n fontSize: '12px',\n boxSizing: 'border-box',\n flexShrink: 0,\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n\n border: tokens.strokeWidthThin + ' solid',\n borderRadius: tokens.borderRadiusCircular,\n margin: tokens.spacingVerticalS + ' ' + tokens.spacingHorizontalS,\n fill: 'currentColor',\n pointerEvents: 'none',\n\n '::after': {\n position: 'absolute',\n width: indicatorSize,\n height: indicatorSize,\n borderRadius: tokens.borderRadiusCircular,\n // Use a transform to avoid pixel rounding errors at 125% DPI\n // https://github.com/microsoft/fluentui/issues/30025\n transform: 'scale(0.625)',\n backgroundColor: 'currentColor',\n },\n});\n\n// Can't use makeResetStyles here because Label is a component that may itself use makeResetStyles.\nconst useLabelStyles = makeStyles({\n base: {\n alignSelf: 'center',\n padding: `${tokens.spacingVerticalS} ${tokens.spacingHorizontalS}`,\n },\n\n after: {\n paddingLeft: tokens.spacingHorizontalXS,\n\n // Use a (negative) margin to account for the difference between the indicator's height and the label's line height.\n // This prevents the label from expanding the height of the Radio, but preserves line height if the label wraps.\n marginTop: `calc((${indicatorSize} - ${tokens.lineHeightBase300}) / 2)`,\n marginBottom: `calc((${indicatorSize} - ${tokens.lineHeightBase300}) / 2)`,\n },\n\n below: {\n paddingTop: tokens.spacingVerticalXS,\n textAlign: 'center',\n },\n});\n\n/**\n * Apply styling to the Radio slots based on the state\n */\nexport const useRadioStyles_unstable = (state: RadioState): RadioState => {\n 'use no memo';\n\n const { labelPosition } = state;\n\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(\n radioClassNames.root,\n rootBaseClassName,\n labelPosition === 'below' && rootStyles.vertical,\n state.root.className,\n );\n\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n state.input.className = mergeClasses(\n radioClassNames.input,\n inputBaseClassName,\n labelPosition === 'below' && inputStyles.below,\n state.indicator.children ? inputStyles.customIndicator : inputStyles.defaultIndicator,\n state.input.className,\n );\n\n const indicatorBaseClassName = useIndicatorBaseClassName();\n state.indicator.className = mergeClasses(\n radioClassNames.indicator,\n indicatorBaseClassName,\n state.indicator.className,\n );\n\n const labelStyles = useLabelStyles();\n if (state.label) {\n state.label.className = mergeClasses(\n radioClassNames.label,\n labelStyles.base,\n labelStyles[labelPosition],\n state.label.className,\n );\n }\n\n return state;\n};\n"],"names":["radioClassNames","useRadioStyles_unstable","root","indicator","input","label","indicatorSize","useRootBaseClassName","makeResetStyles","display","position","createFocusOutlineStyle","style","selector","useRootStyles","makeStyles","vertical","flexDirection","alignItems","useInputBaseClassName","left","top","width","tokens","spacingHorizontalS","height","boxSizing","margin","opacity","cursor","color","colorNeutralForeground3","borderColor","colorNeutralStrokeAccessible","colorNeutralForeground2","colorNeutralStrokeAccessibleHover","colorNeutralForeground1","colorNeutralStrokeAccessiblePressed","colorCompoundBrandStroke","colorCompoundBrandForeground1","backgroundColor","colorCompoundBrandStrokeHover","colorCompoundBrandForeground1Hover","colorCompoundBrandStrokePressed","colorCompoundBrandForeground1Pressed","colorNeutralForegroundDisabled","colorNeutralStrokeDisabled","useInputStyles","below","spacingVerticalS","defaultIndicator","content","customIndicator","useIndicatorBaseClassName","fontSize","flexShrink","justifyContent","overflow","border","strokeWidthThin","borderRadius","borderRadiusCircular","fill","pointerEvents","transform","useLabelStyles","base","alignSelf","padding","after","paddingLeft","spacingHorizontalXS","marginTop","lineHeightBase300","marginBottom","paddingTop","spacingVerticalXS","textAlign","state","labelPosition","rootBaseClassName","rootStyles","className","mergeClasses","inputBaseClassName","inputStyles","children","indicatorBaseClassName","labelStyles"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAMaA,eAAAA;eAAAA;;IA2MAC,uBAAAA;eAAAA;;;8BAjN2B;4BACjB;uBACmC;AAInD,MAAMD,kBAA8C;IACzDE,MAAM;IACNC,WAAW;IACXC,OAAO;IACPC,OAAO;AACT;AAEA,+DAA+D;AAC/D,MAAMC,gBAAgB;AAEtB,MAAMC,uBAAuBC,IAAAA,sBAAAA,EAAgB;IAC3CC,SAAS;IACTC,UAAU;IACV,GAAGC,IAAAA,qCAAAA,EAAwB;QAAEC,OAAO,CAAC;QA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IAAI,EAChBsB,WAAW,CAACT,cAAc,EAC1BD,MAAMzE,KAAK,CAAC6E,SAAS;IAEzB;IAEA,OAAOJ;AACT"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ radioGroupClassNames: function() {
13
+ return radioGroupClassNames;
14
+ },
15
+ useRadioGroupStyles_unstable: function() {
16
+ return useRadioGroupStyles_unstable;
17
+ }
18
+ });
19
+ const _react = require("@griffel/react");
20
+ const radioGroupClassNames = {
21
+ root: 'fui-RadioGroup'
22
+ };
23
+ const useStyles = (0, _react.makeStyles)({
24
+ root: {
25
+ display: 'flex',
26
+ alignItems: 'flex-start'
27
+ },
28
+ vertical: {
29
+ flexDirection: 'column'
30
+ }
31
+ });
32
+ const useRadioGroupStyles_unstable = (state)=>{
33
+ 'use no memo';
34
+ const styles = useStyles();
35
+ state.root.className = (0, _react.mergeClasses)(radioGroupClassNames.root, styles.root, state.layout === 'vertical' && styles.vertical, state.root.className);
36
+ return state;
37
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/RadioGroup/useRadioGroupStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { RadioGroupSlots, RadioGroupState } from './RadioGroup.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const radioGroupClassNames: SlotClassNames<RadioGroupSlots> = {\n root: 'fui-RadioGroup',\n};\n\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'flex-start',\n },\n\n vertical: {\n flexDirection: 'column',\n },\n});\n\n/**\n * Apply styling to the RadioGroup slots based on the state\n */\nexport const useRadioGroupStyles_unstable = (state: RadioGroupState): RadioGroupState => {\n 'use no memo';\n\n const styles = useStyles();\n\n state.root.className = mergeClasses(\n radioGroupClassNames.root,\n styles.root,\n state.layout === 'vertical' && styles.vertical,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["radioGroupClassNames","useRadioGroupStyles_unstable","root","useStyles","makeStyles","display","alignItems","vertical","flexDirection","state","styles","className","mergeClasses","layout"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,oBAAAA;eAAAA;;IAkBAC,4BAAAA;eAAAA;;;uBAtB4B;AAIlC,MAAMD,uBAAwD;IACnEE,MAAM;AACR;AAEA,MAAMC,YAAYC,IAAAA,iBAAAA,EAAW;IAC3BF,MAAM;QACJG,SAAS;QACTC,YAAY;IACd;IAEAC,UAAU;QACRC,eAAe;IACjB;AACF;AAKO,MAAMP,+BAA+B,CAACQ;IAC3C;IAEA,MAAMC,SAASP;IAEfM,MAAMP,IAAI,CAACS,SAAS,GAAGC,IAAAA,mBAAAA,EACrBZ,qBAAqBE,IAAI,EACzBQ,OAAOR,IAAI,EACXO,MAAMI,MAAM,KAAK,cAAcH,OAAOH,QAAQ,EAC9CE,MAAMP,IAAI,CAACS,SAAS;IAGtB,OAAOF;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-radio",
3
- "version": "9.4.7",
3
+ "version": "9.5.0",
4
4
  "description": "Fluent UI Radio component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -18,11 +18,11 @@
18
18
  "@fluentui/scripts-api-extractor": "*"
19
19
  },
20
20
  "dependencies": {
21
- "@fluentui/react-field": "^9.3.7",
21
+ "@fluentui/react-field": "^9.4.0",
22
22
  "@fluentui/react-jsx-runtime": "^9.1.2",
23
- "@fluentui/react-label": "^9.2.2",
23
+ "@fluentui/react-label": "^9.3.0",
24
24
  "@fluentui/react-shared-contexts": "^9.24.0",
25
- "@fluentui/react-tabster": "^9.25.3",
25
+ "@fluentui/react-tabster": "^9.26.0",
26
26
  "@fluentui/react-theme": "^9.1.24",
27
27
  "@fluentui/react-utilities": "^9.22.0",
28
28
  "@griffel/react": "^1.5.22",