{"version":3,"sources":["useRadioStyles.styles.js"],"sourcesContent":["'use client';\nimport { createFocusOutlineStyle } from \"@fluentui/react-tabster\";\nimport { tokens } from \"@fluentui/react-theme\";\nimport { makeResetStyles, makeStyles, mergeClasses } from \"@griffel/react\";\nexport const radioClassNames = {\n    root: 'fui-Radio',\n    indicator: 'fui-Radio__indicator',\n    input: 'fui-Radio__input',\n    label: 'fui-Radio__label'\n};\n// The indicator size is used by the indicator and label styles\nconst indicatorSize = '16px';\nconst useRootBaseClassName = makeResetStyles({\n    display: 'inline-flex',\n    position: 'relative',\n    ...createFocusOutlineStyle({\n        style: {},\n        selector: 'focus-within'\n    })\n});\nconst useRootStyles = makeStyles({\n    vertical: {\n        flexDirection: 'column',\n        alignItems: 'center'\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    ':enabled': {\n        cursor: 'pointer',\n        [`& ~ .${radioClassNames.label}`]: {\n            cursor: 'pointer'\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        ':hover': {\n            [`& ~ .${radioClassNames.label}`]: {\n                color: tokens.colorNeutralForeground2\n            },\n            [`& ~ .${radioClassNames.indicator}`]: {\n                borderColor: tokens.colorNeutralStrokeAccessibleHover\n            }\n        },\n        ':hover:active': {\n            [`& ~ .${radioClassNames.label}`]: {\n                color: tokens.colorNeutralForeground1\n            },\n            [`& ~ .${radioClassNames.indicator}`]: {\n                borderColor: tokens.colorNeutralStrokeAccessiblePressed\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        ':hover': {\n            [`& ~ .${radioClassNames.indicator}`]: {\n                borderColor: tokens.colorCompoundBrandStrokeHover,\n                color: tokens.colorCompoundBrandForeground1Hover\n            }\n        },\n        ':hover:active': {\n            [`& ~ .${radioClassNames.indicator}`]: {\n                borderColor: tokens.colorCompoundBrandStrokePressed,\n                color: tokens.colorCompoundBrandForeground1Pressed\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});\nconst useInputStyles = makeStyles({\n    below: {\n        width: '100%',\n        height: `calc(${indicatorSize} + 2 * ${tokens.spacingVerticalS})`\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    // 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});\nconst useIndicatorBaseClassName = makeResetStyles({\n    position: 'relative',\n    width: indicatorSize,\n    height: indicatorSize,\n    fontSize: '12px',\n    boxSizing: 'border-box',\n    flexShrink: 0,\n    display: 'flex',\n    alignItems: 'center',\n    justifyContent: 'center',\n    overflow: 'hidden',\n    border: tokens.strokeWidthThin + ' solid',\n    borderRadius: tokens.borderRadiusCircular,\n    margin: tokens.spacingVerticalS + ' ' + tokens.spacingHorizontalS,\n    fill: 'currentColor',\n    pointerEvents: 'none',\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// 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    after: {\n        paddingLeft: tokens.spacingHorizontalXS,\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    below: {\n        paddingTop: tokens.spacingVerticalXS,\n        textAlign: 'center'\n    }\n});\n/**\n * Apply styling to the Radio slots based on the state\n */ export const useRadioStyles_unstable = (state)=>{\n    const { labelPosition } = state;\n    const rootBaseClassName = useRootBaseClassName();\n    const rootStyles = useRootStyles();\n    // eslint-disable-next-line react-hooks/immutability\n    state.root.className = mergeClasses(radioClassNames.root, rootBaseClassName, labelPosition === 'below' && rootStyles.vertical, state.root.className);\n    const inputBaseClassName = useInputBaseClassName();\n    const inputStyles = useInputStyles();\n    // eslint-disable-next-line react-hooks/immutability\n    state.input.className = mergeClasses(radioClassNames.input, inputBaseClassName, labelPosition === 'below' && inputStyles.below, state.indicator.children ? inputStyles.customIndicator : inputStyles.defaultIndicator, state.input.className);\n    const indicatorBaseClassName = useIndicatorBaseClassName();\n    // eslint-disable-next-line react-hooks/immutability\n    state.indicator.className = mergeClasses(radioClassNames.indicator, indicatorBaseClassName, state.indicator.className);\n    const labelStyles = useLabelStyles();\n    if (state.label) {\n        // eslint-disable-next-line react-hooks/immutability\n        state.label.className = mergeClasses(radioClassNames.label, labelStyles.base, labelStyles[labelPosition], state.label.className);\n    }\n    return state;\n};\n"],"names":["createFocusOutlineStyle","tokens","__resetStyles","__styles","mergeClasses","radioClassNames","root","indicator","input","label","indicatorSize","useRootBaseClassName","r","s","useRootStyles","vertical","Beiy3e4","Bt984gj","d","useInputBaseClassName","useInputStyles","below","a9b677","Bqenvij","defaultIndicator","Blbys7f","customIndicator","Bj53wkj","useIndicatorBaseClassName","useLabelStyles","base","qb2dma","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","after","B6of3ja","jrapky","fsow6f","p","useRadioStyles_unstable","state","labelPosition","rootBaseClassName","rootStyles","className","inputBaseClassName","inputStyles","children","indicatorBaseClassName","labelStyles"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAICK,eAAe;;;IAqLXqC,uBAAuB;;;;uBAtLkB,gBAAgB;AACnE,wBAAwB;IAC3BpC,IAAI,EAAE,WAAW;IACjBC,SAAS,EAAE,sBAAsB;IACjCC,KAAK,EAAE,kBAAkB;IACzBC,KAAK,EAAE;AACX,CAAC;AACD,+DAAA;AACA,MAAMC,aAAa,GAAG,MAAM;AAC5B,MAAMC,oBAAoB,GAAA,WAAA,OAAGT,oBAAA,EAAA,YAAA,WAAA;IAAAU,CAAA,EAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;IAAAC,CAAA,EAAA;QAAA;QAAA;KAAA;AAAA,CAO5B,CAAC;AACF,MAAMC,aAAa,GAAA,WAAA,OAAGX,eAAA,EAAA;IAAAY,QAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,E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