@fluentui/react-radio 0.0.0-nightly-20230317-1454.1 → 0.0.0-nightly-20230321-0440.1
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.json +19 -19
- package/CHANGELOG.md +12 -12
- package/lib/Radio.js +1 -1
- package/lib/Radio.js.map +1 -1
- package/lib/RadioGroup.js +1 -1
- package/lib/RadioGroup.js.map +1 -1
- package/lib/RadioGroupField.js +1 -1
- package/lib/RadioGroupField.js.map +1 -1
- package/lib/components/Radio/Radio.js +6 -6
- package/lib/components/Radio/Radio.js.map +1 -1
- package/lib/components/Radio/Radio.types.js +1 -1
- package/lib/components/Radio/Radio.types.js.map +1 -1
- package/lib/components/Radio/index.js +5 -5
- package/lib/components/Radio/index.js.map +1 -1
- package/lib/components/Radio/renderRadio.js +11 -3
- package/lib/components/Radio/renderRadio.js.map +1 -1
- package/lib/components/Radio/useRadio.js +16 -16
- package/lib/components/Radio/useRadio.js.map +1 -1
- package/lib/components/Radio/useRadioStyles.js +10 -10
- package/lib/components/Radio/useRadioStyles.js.map +1 -1
- package/lib/components/RadioGroup/RadioGroup.js +7 -7
- package/lib/components/RadioGroup/RadioGroup.js.map +1 -1
- package/lib/components/RadioGroup/RadioGroup.types.js +1 -1
- package/lib/components/RadioGroup/RadioGroup.types.js.map +1 -1
- package/lib/components/RadioGroup/index.js +5 -5
- package/lib/components/RadioGroup/index.js.map +1 -1
- package/lib/components/RadioGroup/renderRadioGroup.js +6 -4
- package/lib/components/RadioGroup/renderRadioGroup.js.map +1 -1
- package/lib/components/RadioGroup/useRadioGroup.js +8 -9
- package/lib/components/RadioGroup/useRadioGroup.js.map +1 -1
- package/lib/components/RadioGroup/useRadioGroupStyles.js +3 -3
- package/lib/components/RadioGroup/useRadioGroupStyles.js.map +1 -1
- package/lib/components/RadioGroupField/RadioGroupField.js +3 -2
- package/lib/components/RadioGroupField/RadioGroupField.js.map +1 -1
- package/lib/components/RadioGroupField/index.js +1 -1
- package/lib/components/RadioGroupField/index.js.map +1 -1
- package/lib/contexts/RadioGroupContext.js +1 -1
- package/lib/contexts/RadioGroupContext.js.map +1 -1
- package/lib/contexts/index.js +2 -2
- package/lib/contexts/index.js.map +1 -1
- package/lib/contexts/useRadioGroupContextValues.js.map +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Radio.js +4 -5
- package/lib-commonjs/Radio.js.map +1 -1
- package/lib-commonjs/RadioGroup.js +4 -5
- package/lib-commonjs/RadioGroup.js.map +1 -1
- package/lib-commonjs/RadioGroupField.js +4 -5
- package/lib-commonjs/RadioGroupField.js.map +1 -1
- package/lib-commonjs/components/Radio/Radio.js +20 -19
- package/lib-commonjs/components/Radio/Radio.js.map +1 -1
- package/lib-commonjs/components/Radio/Radio.types.js +2 -5
- package/lib-commonjs/components/Radio/Radio.types.js.map +1 -1
- package/lib-commonjs/components/Radio/index.js +8 -9
- package/lib-commonjs/components/Radio/index.js.map +1 -1
- package/lib-commonjs/components/Radio/renderRadio.js +24 -13
- package/lib-commonjs/components/Radio/renderRadio.js.map +1 -1
- package/lib-commonjs/components/Radio/useRadio.js +91 -81
- package/lib-commonjs/components/Radio/useRadio.js.map +1 -1
- package/lib-commonjs/components/Radio/useRadioStyles.js +66 -140
- package/lib-commonjs/components/Radio/useRadioStyles.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/RadioGroup.js +22 -21
- package/lib-commonjs/components/RadioGroup/RadioGroup.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/RadioGroup.types.js +2 -5
- package/lib-commonjs/components/RadioGroup/RadioGroup.types.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/index.js +8 -9
- package/lib-commonjs/components/RadioGroup/index.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/renderRadioGroup.js +21 -16
- package/lib-commonjs/components/RadioGroup/renderRadioGroup.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/useRadioGroup.js +50 -40
- package/lib-commonjs/components/RadioGroup/useRadioGroup.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.js +23 -32
- package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.js.map +1 -1
- package/lib-commonjs/components/RadioGroupField/RadioGroupField.js +11 -17
- package/lib-commonjs/components/RadioGroupField/RadioGroupField.js.map +1 -1
- package/lib-commonjs/components/RadioGroupField/index.js +4 -5
- package/lib-commonjs/components/RadioGroupField/index.js.map +1 -1
- package/lib-commonjs/contexts/RadioGroupContext.js +11 -17
- package/lib-commonjs/contexts/RadioGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/index.js +5 -6
- package/lib-commonjs/contexts/index.js.map +1 -1
- package/lib-commonjs/contexts/useRadioGroupContextValues.js +25 -20
- package/lib-commonjs/contexts/useRadioGroupContextValues.js.map +1 -1
- package/lib-commonjs/index.js +99 -31
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +13 -12
- package/.swcrc +0 -39
|
@@ -1,85 +1,95 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "useRadio_unstable", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: ()=>useRadio_unstable
|
|
4
|
+
value: true
|
|
8
5
|
});
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
6
|
+
exports.useRadio_unstable = void 0;
|
|
7
|
+
const React = /*#__PURE__*/require("react");
|
|
8
|
+
const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
|
|
9
|
+
const react_label_1 = /*#__PURE__*/require("@fluentui/react-label");
|
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
11
|
+
const RadioGroupContext_1 = /*#__PURE__*/require("../../contexts/RadioGroupContext");
|
|
12
|
+
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
13
|
+
/**
|
|
14
|
+
* Create the state required to render Radio.
|
|
15
|
+
*
|
|
16
|
+
* The returned state can be modified with hooks such as useRadioStyles_unstable,
|
|
17
|
+
* before being passed to renderRadio_unstable.
|
|
18
|
+
*
|
|
19
|
+
* @param props - props from this instance of Radio
|
|
20
|
+
* @param ref - reference to `<input>` element of Radio
|
|
21
|
+
*/
|
|
22
|
+
const useRadio_unstable = (props, ref) => {
|
|
23
|
+
const nameGroup = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.name);
|
|
24
|
+
const value = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.value);
|
|
25
|
+
const defaultValue = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.defaultValue);
|
|
26
|
+
const disabledGroup = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.disabled);
|
|
27
|
+
const layout = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.layout);
|
|
28
|
+
const requiredGroup = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.required);
|
|
29
|
+
const {
|
|
30
|
+
name = nameGroup,
|
|
31
|
+
checked = value !== undefined ? value === props.value : undefined,
|
|
32
|
+
defaultChecked = defaultValue !== undefined ? defaultValue === props.value : undefined,
|
|
33
|
+
labelPosition = layout === 'horizontal-stacked' ? 'below' : 'after',
|
|
34
|
+
disabled = disabledGroup,
|
|
35
|
+
required = requiredGroup,
|
|
36
|
+
onChange
|
|
37
|
+
} = props;
|
|
38
|
+
const nativeProps = react_utilities_1.getPartitionedNativeProps({
|
|
39
|
+
props,
|
|
40
|
+
primarySlotTagName: 'input',
|
|
41
|
+
excludedPropNames: ['checked', 'defaultChecked', 'onChange']
|
|
42
|
+
});
|
|
43
|
+
const root = react_utilities_1.resolveShorthand(props.root, {
|
|
44
|
+
required: true,
|
|
45
|
+
defaultProps: {
|
|
46
|
+
ref: react_tabster_1.useFocusWithin(),
|
|
47
|
+
...nativeProps.root
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const input = react_utilities_1.resolveShorthand(props.input, {
|
|
51
|
+
required: true,
|
|
52
|
+
defaultProps: {
|
|
53
|
+
ref,
|
|
54
|
+
type: 'radio',
|
|
55
|
+
id: react_utilities_1.useId('radio-', nativeProps.primary.id),
|
|
56
|
+
name,
|
|
57
|
+
checked,
|
|
58
|
+
defaultChecked,
|
|
59
|
+
disabled,
|
|
60
|
+
required,
|
|
61
|
+
...nativeProps.primary
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
input.onChange = react_utilities_1.mergeCallbacks(input.onChange, ev => onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
|
|
65
|
+
value: ev.currentTarget.value
|
|
66
|
+
}));
|
|
67
|
+
const label = react_utilities_1.resolveShorthand(props.label, {
|
|
68
|
+
defaultProps: {
|
|
69
|
+
htmlFor: input.id,
|
|
70
|
+
disabled
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
const indicator = react_utilities_1.resolveShorthand(props.indicator, {
|
|
74
|
+
required: true,
|
|
75
|
+
defaultProps: {
|
|
76
|
+
'aria-hidden': true,
|
|
77
|
+
children: React.createElement(react_icons_1.CircleFilled, null)
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
return {
|
|
81
|
+
labelPosition,
|
|
82
|
+
components: {
|
|
83
|
+
root: 'span',
|
|
84
|
+
input: 'input',
|
|
85
|
+
label: react_label_1.Label,
|
|
86
|
+
indicator: 'div'
|
|
87
|
+
},
|
|
88
|
+
root,
|
|
89
|
+
input,
|
|
90
|
+
label,
|
|
91
|
+
indicator
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
exports.useRadio_unstable = useRadio_unstable;
|
|
85
95
|
//# sourceMappingURL=useRadio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"names":["React","require","react_icons_1","react_label_1","react_utilities_1","RadioGroupContext_1","react_tabster_1","useRadio_unstable","props","ref","nameGroup","useRadioGroupContext_unstable","ctx","name","value","defaultValue","disabledGroup","disabled","layout","requiredGroup","required","checked","undefined","defaultChecked","labelPosition","onChange","nativeProps","getPartitionedNativeProps","primarySlotTagName","excludedPropNames","root","resolveShorthand","defaultProps","useFocusWithin","input","type","id","useId","primary","mergeCallbacks","ev","currentTarget","label","htmlFor","indicator","children","createElement","CircleFilled","components","Label","exports"],"sources":["../../../../../../../../../packages/react-components/react-radio/src/components/Radio/useRadio.tsx"],"sourcesContent":["import * as React from 'react';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { useRadioGroupContext_unstable } from '../../contexts/RadioGroupContext';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport type { RadioProps, RadioState } from './Radio.types';\n\n/**\n * Create the state required to render Radio.\n *\n * The returned state can be modified with hooks such as useRadioStyles_unstable,\n * before being passed to renderRadio_unstable.\n *\n * @param props - props from this instance of Radio\n * @param ref - reference to `<input>` element of Radio\n */\nexport const useRadio_unstable = (props: RadioProps, ref: React.Ref<HTMLInputElement>): RadioState => {\n const nameGroup = useRadioGroupContext_unstable(ctx => ctx.name);\n const value = useRadioGroupContext_unstable(ctx => ctx.value);\n const defaultValue = useRadioGroupContext_unstable(ctx => ctx.defaultValue);\n const disabledGroup = useRadioGroupContext_unstable(ctx => ctx.disabled);\n const layout = useRadioGroupContext_unstable(ctx => ctx.layout);\n const requiredGroup = useRadioGroupContext_unstable(ctx => ctx.required);\n\n const {\n name = nameGroup,\n checked = value !== undefined ? value === props.value : undefined,\n defaultChecked = defaultValue !== undefined ? defaultValue === props.value : undefined,\n labelPosition = layout === 'horizontal-stacked' ? 'below' : 'after',\n disabled = disabledGroup,\n required = requiredGroup,\n onChange,\n } = props;\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'onChange'],\n });\n\n const root = resolveShorthand(props.root, {\n required: true,\n defaultProps: {\n ref: useFocusWithin<HTMLSpanElement>(),\n ...nativeProps.root,\n },\n });\n\n const input = resolveShorthand(props.input, {\n required: true,\n defaultProps: {\n ref,\n type: 'radio',\n id: useId('radio-', nativeProps.primary.id),\n name,\n checked,\n defaultChecked,\n disabled,\n required,\n ...nativeProps.primary,\n },\n });\n\n input.onChange = mergeCallbacks(input.onChange, ev => onChange?.(ev, { value: ev.currentTarget.value }));\n\n const label = resolveShorthand(props.label, {\n defaultProps: {\n htmlFor: input.id,\n disabled,\n },\n });\n\n const indicator = resolveShorthand(props.indicator, {\n required: true,\n defaultProps: {\n 'aria-hidden': true,\n children: <CircleFilled />,\n },\n });\n\n return {\n labelPosition,\n components: {\n root: 'span',\n input: 'input',\n label: Label,\n indicator: 'div',\n },\n root,\n input,\n label,\n indicator,\n };\n};\n"],"mappings":"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"}
|
|
@@ -1,153 +1,79 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
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: ()=>radioClassNames,
|
|
13
|
-
useRadioStyles_unstable: ()=>useRadioStyles_unstable
|
|
4
|
+
value: true
|
|
14
5
|
});
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
exports.useRadioStyles_unstable = exports.radioClassNames = void 0;
|
|
7
|
+
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
8
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
|
9
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
10
|
+
exports.radioClassNames = {
|
|
11
|
+
root: 'fui-Radio',
|
|
12
|
+
indicator: 'fui-Radio__indicator',
|
|
13
|
+
input: 'fui-Radio__input',
|
|
14
|
+
label: 'fui-Radio__label'
|
|
21
15
|
};
|
|
22
16
|
// The indicator size is used by the indicator and label styles
|
|
23
|
-
const indicatorSize =
|
|
24
|
-
const useRootBaseClassName = /*#__PURE__*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
".r1631i6s{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}",
|
|
31
|
-
".r1631i6s:focus{outline-style:none;}",
|
|
32
|
-
".r1631i6s:focus-visible{outline-style:none;}",
|
|
33
|
-
".r1631i6s[data-fui-focus-within]:focus-within{border-top-color:transparent;border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;}",
|
|
34
|
-
'.r1631i6s[data-fui-focus-within]:focus-within::after{content:"";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-left-style:solid;border-bottom-style:solid;border-right-style:solid;border-top-width:2px;border-left-width:2px;border-bottom-width:2px;border-right-width:2px;border-bottom-left-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;right:-2px;left:-2px;}'
|
|
35
|
-
]);
|
|
36
|
-
const useRootStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
37
|
-
vertical: {
|
|
38
|
-
Beiy3e4: "f1vx9l62",
|
|
39
|
-
Bt984gj: "f122n59"
|
|
40
|
-
}
|
|
17
|
+
const indicatorSize = '16px';
|
|
18
|
+
const useRootBaseClassName = /*#__PURE__*/react_1.__resetStyles("r18vxbm9", "r1631i6s", [".r18vxbm9{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}", ".r18vxbm9:focus{outline-style:none;}", ".r18vxbm9:focus-visible{outline-style:none;}", ".r18vxbm9[data-fui-focus-within]:focus-within{border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent;}", ".r18vxbm9[data-fui-focus-within]:focus-within::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-width:2px;border-right-width:2px;border-bottom-width:2px;border-left-width:2px;border-bottom-right-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;left:-2px;right:-2px;}", ".r1631i6s{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}", ".r1631i6s:focus{outline-style:none;}", ".r1631i6s:focus-visible{outline-style:none;}", ".r1631i6s[data-fui-focus-within]:focus-within{border-top-color:transparent;border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;}", ".r1631i6s[data-fui-focus-within]:focus-within::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-left-style:solid;border-bottom-style:solid;border-right-style:solid;border-top-width:2px;border-left-width:2px;border-bottom-width:2px;border-right-width:2px;border-bottom-left-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;right:-2px;left:-2px;}"]);
|
|
19
|
+
const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
20
|
+
vertical: {
|
|
21
|
+
Beiy3e4: "f1vx9l62",
|
|
22
|
+
Bt984gj: "f122n59"
|
|
23
|
+
}
|
|
41
24
|
}, {
|
|
42
|
-
|
|
43
|
-
".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}",
|
|
44
|
-
".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}"
|
|
45
|
-
]
|
|
25
|
+
d: [".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}"]
|
|
46
26
|
});
|
|
47
|
-
const useInputBaseClassName = /*#__PURE__*/ (0,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
".r9gx1vl:enabled:not(:checked)~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessible);}",
|
|
54
|
-
".r9gx1vl:enabled:not(:checked):hover~.fui-Radio__label{color:var(--colorNeutralForeground2);}",
|
|
55
|
-
".r9gx1vl:enabled:not(:checked):hover~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessibleHover);}",
|
|
56
|
-
".r9gx1vl:enabled:not(:checked):hover:active~.fui-Radio__label{color:var(--colorNeutralForeground1);}",
|
|
57
|
-
".r9gx1vl:enabled:not(:checked):hover:active~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessiblePressed);}",
|
|
58
|
-
".r9gx1vl:enabled:checked~.fui-Radio__label{color:var(--colorNeutralForeground1);}",
|
|
59
|
-
".r9gx1vl:enabled:checked~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStroke);color:var(--colorCompoundBrandForeground1);}",
|
|
60
|
-
".r9gx1vl:enabled:checked:hover~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokeHover);color:var(--colorCompoundBrandForeground1Hover);}",
|
|
61
|
-
".r9gx1vl:enabled:checked:hover:active~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokePressed);color:var(--colorCompoundBrandForeground1Pressed);}",
|
|
62
|
-
".r9gx1vl:disabled~.fui-Radio__label{color:var(--colorNeutralForegroundDisabled);cursor:default;}",
|
|
63
|
-
".r9gx1vl:disabled~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeDisabled);color:var(--colorNeutralForegroundDisabled);}",
|
|
64
|
-
".r1uk1i2c{position:absolute;right:0;top:0;width:calc(16px + 2 * var(--spacingHorizontalS));height:100%;box-sizing:border-box;margin:0;opacity:0;}",
|
|
65
|
-
".r1uk1i2c:enabled{cursor:pointer;}",
|
|
66
|
-
".r1uk1i2c:enabled~.fui-Radio__label{cursor:pointer;}",
|
|
67
|
-
".r1uk1i2c:not(:checked)~.fui-Radio__indicator>*{opacity:0;}",
|
|
68
|
-
".r1uk1i2c:enabled:not(:checked)~.fui-Radio__label{color:var(--colorNeutralForeground3);}",
|
|
69
|
-
".r1uk1i2c:enabled:not(:checked)~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessible);}",
|
|
70
|
-
".r1uk1i2c:enabled:not(:checked):hover~.fui-Radio__label{color:var(--colorNeutralForeground2);}",
|
|
71
|
-
".r1uk1i2c:enabled:not(:checked):hover~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessibleHover);}",
|
|
72
|
-
".r1uk1i2c:enabled:not(:checked):hover:active~.fui-Radio__label{color:var(--colorNeutralForeground1);}",
|
|
73
|
-
".r1uk1i2c:enabled:not(:checked):hover:active~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessiblePressed);}",
|
|
74
|
-
".r1uk1i2c:enabled:checked~.fui-Radio__label{color:var(--colorNeutralForeground1);}",
|
|
75
|
-
".r1uk1i2c:enabled:checked~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStroke);color:var(--colorCompoundBrandForeground1);}",
|
|
76
|
-
".r1uk1i2c:enabled:checked:hover~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokeHover);color:var(--colorCompoundBrandForeground1Hover);}",
|
|
77
|
-
".r1uk1i2c:enabled:checked:hover:active~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokePressed);color:var(--colorCompoundBrandForeground1Pressed);}",
|
|
78
|
-
".r1uk1i2c:disabled~.fui-Radio__label{color:var(--colorNeutralForegroundDisabled);cursor:default;}",
|
|
79
|
-
".r1uk1i2c:disabled~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeDisabled);color:var(--colorNeutralForegroundDisabled);}"
|
|
80
|
-
]);
|
|
81
|
-
const useInputStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
82
|
-
below: {
|
|
83
|
-
a9b677: "fly5x3f",
|
|
84
|
-
Bqenvij: "f1je6zif"
|
|
85
|
-
}
|
|
27
|
+
const useInputBaseClassName = /*#__PURE__*/react_1.__resetStyles("r9gx1vl", "r1uk1i2c", [".r9gx1vl{position:absolute;left:0;top:0;width:calc(16px + 2 * var(--spacingHorizontalS));height:100%;box-sizing:border-box;margin:0;opacity:0;}", ".r9gx1vl:enabled{cursor:pointer;}", ".r9gx1vl:enabled~.fui-Radio__label{cursor:pointer;}", ".r9gx1vl:not(:checked)~.fui-Radio__indicator>*{opacity:0;}", ".r9gx1vl:enabled:not(:checked)~.fui-Radio__label{color:var(--colorNeutralForeground3);}", ".r9gx1vl:enabled:not(:checked)~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessible);}", ".r9gx1vl:enabled:not(:checked):hover~.fui-Radio__label{color:var(--colorNeutralForeground2);}", ".r9gx1vl:enabled:not(:checked):hover~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessibleHover);}", ".r9gx1vl:enabled:not(:checked):hover:active~.fui-Radio__label{color:var(--colorNeutralForeground1);}", ".r9gx1vl:enabled:not(:checked):hover:active~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessiblePressed);}", ".r9gx1vl:enabled:checked~.fui-Radio__label{color:var(--colorNeutralForeground1);}", ".r9gx1vl:enabled:checked~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStroke);color:var(--colorCompoundBrandForeground1);}", ".r9gx1vl:enabled:checked:hover~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokeHover);color:var(--colorCompoundBrandForeground1Hover);}", ".r9gx1vl:enabled:checked:hover:active~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokePressed);color:var(--colorCompoundBrandForeground1Pressed);}", ".r9gx1vl:disabled~.fui-Radio__label{color:var(--colorNeutralForegroundDisabled);cursor:default;}", ".r9gx1vl:disabled~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeDisabled);color:var(--colorNeutralForegroundDisabled);}", ".r1uk1i2c{position:absolute;right:0;top:0;width:calc(16px + 2 * var(--spacingHorizontalS));height:100%;box-sizing:border-box;margin:0;opacity:0;}", ".r1uk1i2c:enabled{cursor:pointer;}", ".r1uk1i2c:enabled~.fui-Radio__label{cursor:pointer;}", ".r1uk1i2c:not(:checked)~.fui-Radio__indicator>*{opacity:0;}", ".r1uk1i2c:enabled:not(:checked)~.fui-Radio__label{color:var(--colorNeutralForeground3);}", ".r1uk1i2c:enabled:not(:checked)~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessible);}", ".r1uk1i2c:enabled:not(:checked):hover~.fui-Radio__label{color:var(--colorNeutralForeground2);}", ".r1uk1i2c:enabled:not(:checked):hover~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessibleHover);}", ".r1uk1i2c:enabled:not(:checked):hover:active~.fui-Radio__label{color:var(--colorNeutralForeground1);}", ".r1uk1i2c:enabled:not(:checked):hover:active~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessiblePressed);}", ".r1uk1i2c:enabled:checked~.fui-Radio__label{color:var(--colorNeutralForeground1);}", ".r1uk1i2c:enabled:checked~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStroke);color:var(--colorCompoundBrandForeground1);}", ".r1uk1i2c:enabled:checked:hover~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokeHover);color:var(--colorCompoundBrandForeground1Hover);}", ".r1uk1i2c:enabled:checked:hover:active~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokePressed);color:var(--colorCompoundBrandForeground1Pressed);}", ".r1uk1i2c:disabled~.fui-Radio__label{color:var(--colorNeutralForegroundDisabled);cursor:default;}", ".r1uk1i2c:disabled~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeDisabled);color:var(--colorNeutralForegroundDisabled);}"]);
|
|
28
|
+
const useInputStyles = /*#__PURE__*/react_1.__styles({
|
|
29
|
+
below: {
|
|
30
|
+
a9b677: "fly5x3f",
|
|
31
|
+
Bqenvij: "f1je6zif"
|
|
32
|
+
}
|
|
86
33
|
}, {
|
|
87
|
-
|
|
88
|
-
".fly5x3f{width:100%;}",
|
|
89
|
-
".f1je6zif{height:calc(16px + 2 * var(--spacingVerticalS));}"
|
|
90
|
-
]
|
|
34
|
+
d: [".fly5x3f{width:100%;}", ".f1je6zif{height:calc(16px + 2 * var(--spacingVerticalS));}"]
|
|
91
35
|
});
|
|
92
|
-
const useIndicatorBaseClassName = /*#__PURE__*/
|
|
93
|
-
".rid4516{width:16px;height:16px;font-size:12px;box-sizing:border-box;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;overflow:hidden;border:var(--strokeWidthThin) solid;border-radius:var(--borderRadiusCircular);margin:var(--spacingVerticalS) var(--spacingHorizontalS);fill:currentColor;pointer-events:none;}"
|
|
94
|
-
]);
|
|
36
|
+
const useIndicatorBaseClassName = /*#__PURE__*/react_1.__resetStyles("rid4516", null, [".rid4516{width:16px;height:16px;font-size:12px;box-sizing:border-box;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;overflow:hidden;border:var(--strokeWidthThin) solid;border-radius:var(--borderRadiusCircular);margin:var(--spacingVerticalS) var(--spacingHorizontalS);fill:currentColor;pointer-events:none;}"]);
|
|
95
37
|
// Can't use makeResetStyles here because Label is a component that may itself use makeResetStyles.
|
|
96
|
-
const useLabelStyles = /*#__PURE__*/
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"f7x41pl"
|
|
114
|
-
],
|
|
115
|
-
B6of3ja: "fjzwpt6",
|
|
116
|
-
jrapky: "fh6j2fo"
|
|
117
|
-
},
|
|
118
|
-
below: {
|
|
119
|
-
z8tnut: "f1ywm7hm",
|
|
120
|
-
fsow6f: "f17mccla"
|
|
121
|
-
}
|
|
38
|
+
const useLabelStyles = /*#__PURE__*/react_1.__styles({
|
|
39
|
+
base: {
|
|
40
|
+
qb2dma: "f7nlbp4",
|
|
41
|
+
z8tnut: "f1kwiid1",
|
|
42
|
+
z189sj: ["f1vdfbxk", "f1f5gg8d"],
|
|
43
|
+
Byoj8tv: "f5b47ha",
|
|
44
|
+
uwmqm3: ["f1f5gg8d", "f1vdfbxk"]
|
|
45
|
+
},
|
|
46
|
+
after: {
|
|
47
|
+
uwmqm3: ["fruq291", "f7x41pl"],
|
|
48
|
+
B6of3ja: "fjzwpt6",
|
|
49
|
+
jrapky: "fh6j2fo"
|
|
50
|
+
},
|
|
51
|
+
below: {
|
|
52
|
+
z8tnut: "f1ywm7hm",
|
|
53
|
+
fsow6f: "f17mccla"
|
|
54
|
+
}
|
|
122
55
|
}, {
|
|
123
|
-
|
|
124
|
-
".f7nlbp4{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}",
|
|
125
|
-
".f1kwiid1{padding-top:var(--spacingVerticalS);}",
|
|
126
|
-
".f1vdfbxk{padding-right:var(--spacingHorizontalS);}",
|
|
127
|
-
".f1f5gg8d{padding-left:var(--spacingHorizontalS);}",
|
|
128
|
-
".f5b47ha{padding-bottom:var(--spacingVerticalS);}",
|
|
129
|
-
".fruq291{padding-left:var(--spacingHorizontalXS);}",
|
|
130
|
-
".f7x41pl{padding-right:var(--spacingHorizontalXS);}",
|
|
131
|
-
".fjzwpt6{margin-top:calc((16px - var(--lineHeightBase300)) / 2);}",
|
|
132
|
-
".fh6j2fo{margin-bottom:calc((16px - var(--lineHeightBase300)) / 2);}",
|
|
133
|
-
".f1ywm7hm{padding-top:var(--spacingVerticalXS);}",
|
|
134
|
-
".f17mccla{text-align:center;}"
|
|
135
|
-
]
|
|
56
|
+
d: [".f7nlbp4{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}", ".f1kwiid1{padding-top:var(--spacingVerticalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f5b47ha{padding-bottom:var(--spacingVerticalS);}", ".fruq291{padding-left:var(--spacingHorizontalXS);}", ".f7x41pl{padding-right:var(--spacingHorizontalXS);}", ".fjzwpt6{margin-top:calc((16px - var(--lineHeightBase300)) / 2);}", ".fh6j2fo{margin-bottom:calc((16px - var(--lineHeightBase300)) / 2);}", ".f1ywm7hm{padding-top:var(--spacingVerticalXS);}", ".f17mccla{text-align:center;}"]
|
|
136
57
|
});
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Apply styling to the Radio slots based on the state
|
|
60
|
+
*/
|
|
61
|
+
const useRadioStyles_unstable = state => {
|
|
62
|
+
const {
|
|
63
|
+
labelPosition
|
|
64
|
+
} = state;
|
|
65
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
66
|
+
const rootStyles = useRootStyles();
|
|
67
|
+
state.root.className = react_1.mergeClasses(exports.radioClassNames.root, rootBaseClassName, labelPosition === 'below' && rootStyles.vertical, state.root.className);
|
|
68
|
+
const inputBaseClassName = useInputBaseClassName();
|
|
69
|
+
const inputStyles = useInputStyles();
|
|
70
|
+
state.input.className = react_1.mergeClasses(exports.radioClassNames.input, inputBaseClassName, labelPosition === 'below' && inputStyles.below, state.input.className);
|
|
71
|
+
const indicatorBaseClassName = useIndicatorBaseClassName();
|
|
72
|
+
state.indicator.className = react_1.mergeClasses(exports.radioClassNames.indicator, indicatorBaseClassName, state.indicator.className);
|
|
73
|
+
const labelStyles = useLabelStyles();
|
|
74
|
+
if (state.label) {
|
|
75
|
+
state.label.className = react_1.mergeClasses(exports.radioClassNames.label, labelStyles.base, labelStyles[labelPosition], state.label.className);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
exports.useRadioStyles_unstable = useRadioStyles_unstable;
|
|
153
79
|
//# sourceMappingURL=useRadioStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Radio/useRadioStyles.js"],"sourcesContent":["import { createFocusOutlineStyle } from \"@fluentui/react-tabster\";\nimport { tokens } from \"@fluentui/react-theme\";\nimport { __resetStyles, __styles, mergeClasses, shorthands } 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 = /*#__PURE__*/__resetStyles(\"r18vxbm9\", \"r1631i6s\", [\".r18vxbm9{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}\", \".r18vxbm9:focus{outline-style:none;}\", \".r18vxbm9:focus-visible{outline-style:none;}\", \".r18vxbm9[data-fui-focus-within]:focus-within{border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent;}\", \".r18vxbm9[data-fui-focus-within]:focus-within::after{content:\\\"\\\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-width:2px;border-right-width:2px;border-bottom-width:2px;border-left-width:2px;border-bottom-right-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;left:-2px;right:-2px;}\", \".r1631i6s{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}\", \".r1631i6s:focus{outline-style:none;}\", \".r1631i6s:focus-visible{outline-style:none;}\", \".r1631i6s[data-fui-focus-within]:focus-within{border-top-color:transparent;border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;}\", \".r1631i6s[data-fui-focus-within]:focus-within::after{content:\\\"\\\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-left-style:solid;border-bottom-style:solid;border-right-style:solid;border-top-width:2px;border-left-width:2px;border-bottom-width:2px;border-right-width:2px;border-bottom-left-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;right:-2px;left:-2px;}\"]);\nconst useRootStyles = /*#__PURE__*/__styles({\n vertical: {\n Beiy3e4: \"f1vx9l62\",\n Bt984gj: \"f122n59\"\n }\n}, {\n d: [\".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}\", \".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}\"]\n});\nconst useInputBaseClassName = /*#__PURE__*/__resetStyles(\"r9gx1vl\", \"r1uk1i2c\", [\".r9gx1vl{position:absolute;left:0;top:0;width:calc(16px + 2 * var(--spacingHorizontalS));height:100%;box-sizing:border-box;margin:0;opacity:0;}\", \".r9gx1vl:enabled{cursor:pointer;}\", \".r9gx1vl:enabled~.fui-Radio__label{cursor:pointer;}\", \".r9gx1vl:not(:checked)~.fui-Radio__indicator>*{opacity:0;}\", \".r9gx1vl:enabled:not(:checked)~.fui-Radio__label{color:var(--colorNeutralForeground3);}\", \".r9gx1vl:enabled:not(:checked)~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessible);}\", \".r9gx1vl:enabled:not(:checked):hover~.fui-Radio__label{color:var(--colorNeutralForeground2);}\", \".r9gx1vl:enabled:not(:checked):hover~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessibleHover);}\", \".r9gx1vl:enabled:not(:checked):hover:active~.fui-Radio__label{color:var(--colorNeutralForeground1);}\", \".r9gx1vl:enabled:not(:checked):hover:active~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessiblePressed);}\", \".r9gx1vl:enabled:checked~.fui-Radio__label{color:var(--colorNeutralForeground1);}\", \".r9gx1vl:enabled:checked~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStroke);color:var(--colorCompoundBrandForeground1);}\", \".r9gx1vl:enabled:checked:hover~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokeHover);color:var(--colorCompoundBrandForeground1Hover);}\", \".r9gx1vl:enabled:checked:hover:active~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokePressed);color:var(--colorCompoundBrandForeground1Pressed);}\", \".r9gx1vl:disabled~.fui-Radio__label{color:var(--colorNeutralForegroundDisabled);cursor:default;}\", \".r9gx1vl:disabled~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeDisabled);color:var(--colorNeutralForegroundDisabled);}\", \".r1uk1i2c{position:absolute;right:0;top:0;width:calc(16px + 2 * var(--spacingHorizontalS));height:100%;box-sizing:border-box;margin:0;opacity:0;}\", \".r1uk1i2c:enabled{cursor:pointer;}\", \".r1uk1i2c:enabled~.fui-Radio__label{cursor:pointer;}\", \".r1uk1i2c:not(:checked)~.fui-Radio__indicator>*{opacity:0;}\", \".r1uk1i2c:enabled:not(:checked)~.fui-Radio__label{color:var(--colorNeutralForeground3);}\", \".r1uk1i2c:enabled:not(:checked)~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessible);}\", \".r1uk1i2c:enabled:not(:checked):hover~.fui-Radio__label{color:var(--colorNeutralForeground2);}\", \".r1uk1i2c:enabled:not(:checked):hover~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessibleHover);}\", \".r1uk1i2c:enabled:not(:checked):hover:active~.fui-Radio__label{color:var(--colorNeutralForeground1);}\", \".r1uk1i2c:enabled:not(:checked):hover:active~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessiblePressed);}\", \".r1uk1i2c:enabled:checked~.fui-Radio__label{color:var(--colorNeutralForeground1);}\", \".r1uk1i2c:enabled:checked~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStroke);color:var(--colorCompoundBrandForeground1);}\", \".r1uk1i2c:enabled:checked:hover~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokeHover);color:var(--colorCompoundBrandForeground1Hover);}\", \".r1uk1i2c:enabled:checked:hover:active~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokePressed);color:var(--colorCompoundBrandForeground1Pressed);}\", \".r1uk1i2c:disabled~.fui-Radio__label{color:var(--colorNeutralForegroundDisabled);cursor:default;}\", \".r1uk1i2c:disabled~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeDisabled);color:var(--colorNeutralForegroundDisabled);}\"]);\nconst useInputStyles = /*#__PURE__*/__styles({\n below: {\n a9b677: \"fly5x3f\",\n Bqenvij: \"f1je6zif\"\n }\n}, {\n d: [\".fly5x3f{width:100%;}\", \".f1je6zif{height:calc(16px + 2 * var(--spacingVerticalS));}\"]\n});\nconst useIndicatorBaseClassName = /*#__PURE__*/__resetStyles(\"rid4516\", null, [\".rid4516{width:16px;height:16px;font-size:12px;box-sizing:border-box;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;overflow:hidden;border:var(--strokeWidthThin) solid;border-radius:var(--borderRadiusCircular);margin:var(--spacingVerticalS) var(--spacingHorizontalS);fill:currentColor;pointer-events:none;}\"]);\n// Can't use makeResetStyles here because Label is a component that may itself use makeResetStyles.\nconst useLabelStyles = /*#__PURE__*/__styles({\n base: {\n qb2dma: \"f7nlbp4\",\n z8tnut: \"f1kwiid1\",\n z189sj: [\"f1vdfbxk\", \"f1f5gg8d\"],\n Byoj8tv: \"f5b47ha\",\n uwmqm3: [\"f1f5gg8d\", \"f1vdfbxk\"]\n },\n after: {\n uwmqm3: [\"fruq291\", \"f7x41pl\"],\n B6of3ja: \"fjzwpt6\",\n jrapky: \"fh6j2fo\"\n },\n below: {\n z8tnut: \"f1ywm7hm\",\n fsow6f: \"f17mccla\"\n }\n}, {\n d: [\".f7nlbp4{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}\", \".f1kwiid1{padding-top:var(--spacingVerticalS);}\", \".f1vdfbxk{padding-right:var(--spacingHorizontalS);}\", \".f1f5gg8d{padding-left:var(--spacingHorizontalS);}\", \".f5b47ha{padding-bottom:var(--spacingVerticalS);}\", \".fruq291{padding-left:var(--spacingHorizontalXS);}\", \".f7x41pl{padding-right:var(--spacingHorizontalXS);}\", \".fjzwpt6{margin-top:calc((16px - var(--lineHeightBase300)) / 2);}\", \".fh6j2fo{margin-bottom:calc((16px - var(--lineHeightBase300)) / 2);}\", \".f1ywm7hm{padding-top:var(--spacingVerticalXS);}\", \".f17mccla{text-align:center;}\"]\n});\n/**\n * Apply styling to the Radio slots based on the state\n */\nexport const useRadioStyles_unstable = state => {\n const {\n labelPosition\n } = state;\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(radioClassNames.root, rootBaseClassName, labelPosition === \"below\" && rootStyles.vertical, state.root.className);\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n state.input.className = mergeClasses(radioClassNames.input, inputBaseClassName, labelPosition === \"below\" && inputStyles.below, state.input.className);\n const indicatorBaseClassName = useIndicatorBaseClassName();\n state.indicator.className = mergeClasses(radioClassNames.indicator, indicatorBaseClassName, state.indicator.className);\n const labelStyles = useLabelStyles();\n if (state.label) {\n state.label.className = mergeClasses(radioClassNames.label, labelStyles.base, labelStyles[labelPosition], state.label.className);\n }\n};\n//# sourceMappingURL=useRadioStyles.js.map"],"names":["radioClassNames","useRadioStyles_unstable","root","indicator","input","label","indicatorSize","useRootBaseClassName","__resetStyles","useRootStyles","__styles","vertical","Beiy3e4","Bt984gj","d","useInputBaseClassName","useInputStyles","below","a9b677","Bqenvij","useIndicatorBaseClassName","useLabelStyles","base","qb2dma","z8tnut","z189sj","Byoj8tv","uwmqm3","after","B6of3ja","jrapky","fsow6f","state","labelPosition","rootBaseClassName","rootStyles","className","mergeClasses","inputBaseClassName","inputStyles","indicatorBaseClassName","labelStyles"],"mappings":";;;;;;;;;;;IAGaA,eAAe,MAAfA;IAmDAC,uBAAuB,MAAvBA;;uBApDqD;AAC3D,MAAMD,kBAAkB;IAC7BE,MAAM;IACNC,WAAW;IACXC,OAAO;IACPC,OAAO;AACT;AACA,+DAA+D;AAC/D,MAAMC,gBAAgB;AACtB,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,YAAY,YAAY;IAAC;IAAuI;IAAwC;IAAgD;IAA6K;IAAutB;IAAuI;IAAwC;IAAgD;IAA6K;CAAstB;AACtxE,MAAMC,gBAAgB,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IAC1CC,UAAU;QACRC,SAAS;QACTC,SAAS;IACX;AACF,GAAG;IACDC,GAAG;QAAC;QAA6F;KAA0G;AAC7M;AACA,MAAMC,wBAAwB,WAAW,GAAEP,IAAAA,uBAAa,EAAC,WAAW,YAAY;IAAC;IAAmJ;IAAqC;IAAuD;IAA8D;IAA2F;IAA2G;IAAiG;IAAsH;IAAwG;IAA+H;IAAqF;IAA4I;IAA4J;IAAuK;IAAoG;IAAwI;IAAqJ;IAAsC;IAAwD;IAA+D;IAA4F;IAA4G;IAAkG;IAAuH;IAAyG;IAAgI;IAAsF;IAA6I;IAA6J;IAAwK;IAAqG;CAAwI;AACn+G,MAAMQ,iBAAiB,WAAW,GAAEN,IAAAA,kBAAQ,EAAC;IAC3CO,OAAO;QACLC,QAAQ;QACRC,SAAS;IACX;AACF,GAAG;IACDL,GAAG;QAAC;QAAyB;KAA8D;AAC7F;AACA,MAAMM,4BAA4B,WAAW,GAAEZ,IAAAA,uBAAa,EAAC,WAAW,IAAI,EAAE;IAAC;CAAwkB;AACvpB,mGAAmG;AACnG,MAAMa,iBAAiB,WAAW,GAAEX,IAAAA,kBAAQ,EAAC;IAC3CY,MAAM;QACJC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;QAChCC,SAAS;QACTC,QAAQ;YAAC;YAAY;SAAW;IAClC;IACAC,OAAO;QACLD,QAAQ;YAAC;YAAW;SAAU;QAC9BE,SAAS;QACTC,QAAQ;IACV;IACAb,OAAO;QACLO,QAAQ;QACRO,QAAQ;IACV;AACF,GAAG;IACDjB,GAAG;QAAC;QAAqF;QAAmD;QAAuD;QAAsD;QAAqD;QAAsD;QAAuD;QAAqE;QAAwE;QAAoD;KAAgC;AAC9nB;AAIO,MAAMb,0BAA0B+B,CAAAA,QAAS;IAC9C,MAAM,EACJC,cAAa,EACd,GAAGD;IACJ,MAAME,oBAAoB3B;IAC1B,MAAM4B,aAAa1B;IACnBuB,MAAM9B,IAAI,CAACkC,SAAS,GAAGC,IAAAA,mBAAY,EAACrC,gBAAgBE,IAAI,EAAEgC,mBAAmBD,kBAAkB,WAAWE,WAAWxB,QAAQ,EAAEqB,MAAM9B,IAAI,CAACkC,SAAS;IACnJ,MAAME,qBAAqBvB;IAC3B,MAAMwB,cAAcvB;IACpBgB,MAAM5B,KAAK,CAACgC,SAAS,GAAGC,IAAAA,mBAAY,EAACrC,gBAAgBI,KAAK,EAAEkC,oBAAoBL,kBAAkB,WAAWM,YAAYtB,KAAK,EAAEe,MAAM5B,KAAK,CAACgC,SAAS;IACrJ,MAAMI,yBAAyBpB;IAC/BY,MAAM7B,SAAS,CAACiC,SAAS,GAAGC,IAAAA,mBAAY,EAACrC,gBAAgBG,SAAS,EAAEqC,wBAAwBR,MAAM7B,SAAS,CAACiC,SAAS;IACrH,MAAMK,cAAcpB;IACpB,IAAIW,MAAM3B,KAAK,EAAE;QACf2B,MAAM3B,KAAK,CAAC+B,SAAS,GAAGC,IAAAA,mBAAY,EAACrC,gBAAgBK,KAAK,EAAEoC,YAAYnB,IAAI,EAAEmB,WAAW,CAACR,cAAc,EAAED,MAAM3B,KAAK,CAAC+B,SAAS;IACjI,CAAC;AACH,GACA,0CAA0C"}
|
|
1
|
+
{"version":3,"names":["react_tabster_1","require","react_theme_1","react_1","exports","radioClassNames","root","indicator","input","label","indicatorSize","useRootBaseClassName","__resetStyles","useRootStyles","__styles","vertical","Beiy3e4","Bt984gj","d","useInputBaseClassName","useInputStyles","below","a9b677","Bqenvij","useIndicatorBaseClassName","useLabelStyles","base","qb2dma","z8tnut","z189sj","Byoj8tv","uwmqm3","after","B6of3ja","jrapky","fsow6f","useRadioStyles_unstable","state","labelPosition","rootBaseClassName","rootStyles","className","mergeClasses","inputBaseClassName","inputStyles","indicatorBaseClassName","labelStyles"],"sources":["../../../../../../../../../packages/react-components/react-radio/src/components/Radio/useRadioStyles.ts"],"sourcesContent":["import { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } 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 // When unchecked, hide the circle icon (child of the indicator)\n [`:not(:checked) ~ .${radioClassNames.indicator} > *`]: {\n opacity: '0',\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 },\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 },\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 },\n [`& ~ .${radioClassNames.indicator}`]: {\n borderColor: tokens.colorNeutralStrokeDisabled,\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\nconst useInputStyles = makeStyles({\n below: {\n width: '100%',\n height: `calc(${indicatorSize} + 2 * ${tokens.spacingVerticalS})`,\n },\n});\n\nconst useIndicatorBaseClassName = makeResetStyles({\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\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 ...shorthands.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) => {\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.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"],"mappings":";;;;;;AAAA,MAAAA,eAAA,gBAAAC,OAAA;AACA,MAAAC,aAAA,gBAAAD,OAAA;AACA,MAAAE,OAAA,gBAAAF,OAAA;AAIaG,OAAA,CAAAC,eAAe,GAA+B;EACzDC,IAAI,EAAE,WAAW;EACjBC,SAAS,EAAE,sBAAsB;EACjCC,KAAK,EAAE,kBAAkB;EACzBC,KAAK,EAAE;CACR;AAED;AACA,MAAMC,aAAa,GAAG,MAAM;AAE5B,MAAMC,oBAAoB,gBAAGR,OAAA,CAAAS,aAAe,guEAI1C;AAEF,MAAMC,aAAa,gBAAGV,OAAA,CAAAW,QAAU;EAAAC,QAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAK9B;AAEF,MAAMC,qBAAqB,gBAAGhB,OAAA,CAAAS,aAAe,46GAsF3C;AAEF,MAAMQ,cAAc,gBAAGjB,OAAA,CAAAW,QAAU;EAAAO,KAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAL,CAAA;AAAA,EAK/B;AAEF,MAAMM,yBAAyB,gBAAGrB,OAAA,CAAAS,aAAe,4lBAiB/C;AAEF;AACA,MAAMa,cAAc,gBAAGtB,OAAA,CAAAW,QAAU;EAAAY,IAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,KAAA;IAAAD,MAAA;IAAAE,OAAA;IAAAC,MAAA;EAAA;EAAAb,KAAA;IAAAO,MAAA;IAAAO,MAAA;EAAA;AAAA;EAAAjB,CAAA;AAAA,EAmB/B;AAEF;;;AAGO,MAAMkB,uBAAuB,GAAIC,KAAiB,IAAI;EAC3D,MAAM;IAAEC;EAAa,CAAE,GAAGD,KAAK;EAE/B,MAAME,iBAAiB,GAAG5B,oBAAoB,EAAE;EAChD,MAAM6B,UAAU,GAAG3B,aAAa,EAAE;EAClCwB,KAAK,CAAC/B,IAAI,CAACmC,SAAS,GAAGtC,OAAA,CAAAuC,YAAY,CACjCtC,OAAA,CAAAC,eAAe,CAACC,IAAI,EACpBiC,iBAAiB,EACjBD,aAAa,KAAK,OAAO,IAAIE,UAAU,CAACzB,QAAQ,EAChDsB,KAAK,CAAC/B,IAAI,CAACmC,SAAS,CACrB;EAED,MAAME,kBAAkB,GAAGxB,qBAAqB,EAAE;EAClD,MAAMyB,WAAW,GAAGxB,cAAc,EAAE;EACpCiB,KAAK,CAAC7B,KAAK,CAACiC,SAAS,GAAGtC,OAAA,CAAAuC,YAAY,CAClCtC,OAAA,CAAAC,eAAe,CAACG,KAAK,EACrBmC,kBAAkB,EAClBL,aAAa,KAAK,OAAO,IAAIM,WAAW,CAACvB,KAAK,EAC9CgB,KAAK,CAAC7B,KAAK,CAACiC,SAAS,CACtB;EAED,MAAMI,sBAAsB,GAAGrB,yBAAyB,EAAE;EAC1Da,KAAK,CAAC9B,SAAS,CAACkC,SAAS,GAAGtC,OAAA,CAAAuC,YAAY,CACtCtC,OAAA,CAAAC,eAAe,CAACE,SAAS,EACzBsC,sBAAsB,EACtBR,KAAK,CAAC9B,SAAS,CAACkC,SAAS,CAC1B;EAED,MAAMK,WAAW,GAAGrB,cAAc,EAAE;EACpC,IAAIY,KAAK,CAAC5B,KAAK,EAAE;IACf4B,KAAK,CAAC5B,KAAK,CAACgC,SAAS,GAAGtC,OAAA,CAAAuC,YAAY,CAClCtC,OAAA,CAAAC,eAAe,CAACI,KAAK,EACrBqC,WAAW,CAACpB,IAAI,EAChBoB,WAAW,CAACR,aAAa,CAAC,EAC1BD,KAAK,CAAC5B,KAAK,CAACgC,SAAS,CACtB;;AAEL,CAAC;AArCYrC,OAAA,CAAAgC,uBAAuB,GAAAA,uBAAA"}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "RadioGroup", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: ()=>RadioGroup
|
|
4
|
+
value: true
|
|
8
5
|
});
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
exports.RadioGroup = void 0;
|
|
7
|
+
const React = /*#__PURE__*/require("react");
|
|
8
|
+
const renderRadioGroup_1 = /*#__PURE__*/require("./renderRadioGroup");
|
|
9
|
+
const useRadioGroup_1 = /*#__PURE__*/require("./useRadioGroup");
|
|
10
|
+
const useRadioGroupStyles_1 = /*#__PURE__*/require("./useRadioGroupStyles");
|
|
11
|
+
const useRadioGroupContextValues_1 = /*#__PURE__*/require("../../contexts/useRadioGroupContextValues");
|
|
12
|
+
const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
|
|
13
|
+
/**
|
|
14
|
+
* A RadioGroup component presents a set of options where only one option can be selected.
|
|
15
|
+
*/
|
|
16
|
+
exports.RadioGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
17
|
+
const state = useRadioGroup_1.useRadioGroup_unstable(props, ref);
|
|
18
|
+
const contextValues = useRadioGroupContextValues_1.useRadioGroupContextValues(state);
|
|
19
|
+
useRadioGroupStyles_1.useRadioGroupStyles_unstable(state);
|
|
20
|
+
const {
|
|
21
|
+
useRadioGroupStyles_unstable: useCustomStyles
|
|
22
|
+
} = react_shared_contexts_1.useCustomStyleHooks_unstable();
|
|
23
|
+
useCustomStyles(state);
|
|
24
|
+
return renderRadioGroup_1.renderRadioGroup_unstable(state, contextValues);
|
|
23
25
|
});
|
|
24
|
-
RadioGroup.displayName =
|
|
25
|
-
|
|
26
|
+
exports.RadioGroup.displayName = 'RadioGroup';
|
|
26
27
|
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"names":["React","require","renderRadioGroup_1","useRadioGroup_1","useRadioGroupStyles_1","useRadioGroupContextValues_1","react_shared_contexts_1","exports","RadioGroup","forwardRef","props","ref","state","useRadioGroup_unstable","contextValues","useRadioGroupContextValues","useRadioGroupStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderRadioGroup_unstable","displayName"],"sources":["../../../../../../../../../packages/react-components/react-radio/src/components/RadioGroup/RadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { RadioGroupProps } from './RadioGroup.types';\nimport { renderRadioGroup_unstable } from './renderRadioGroup';\nimport { useRadioGroup_unstable } from './useRadioGroup';\nimport { useRadioGroupStyles_unstable } from './useRadioGroupStyles';\nimport { useRadioGroupContextValues } from '../../contexts/useRadioGroupContextValues';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A RadioGroup component presents a set of options where only one option can be selected.\n */\nexport const RadioGroup: ForwardRefComponent<RadioGroupProps> = React.forwardRef((props, ref) => {\n const state = useRadioGroup_unstable(props, ref);\n const contextValues = useRadioGroupContextValues(state);\n\n useRadioGroupStyles_unstable(state);\n\n const { useRadioGroupStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderRadioGroup_unstable(state, contextValues);\n});\n\nRadioGroup.displayName = 'RadioGroup';\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AAGA,MAAAC,kBAAA,gBAAAD,OAAA;AACA,MAAAE,eAAA,gBAAAF,OAAA;AACA,MAAAG,qBAAA,gBAAAH,OAAA;AACA,MAAAI,4BAAA,gBAAAJ,OAAA;AACA,MAAAK,uBAAA,gBAAAL,OAAA;AAEA;;;AAGaM,OAAA,CAAAC,UAAU,gBAAyCR,KAAK,CAACS,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC9F,MAAMC,KAAK,GAAGT,eAAA,CAAAU,sBAAsB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAChD,MAAMG,aAAa,GAAGT,4BAAA,CAAAU,0BAA0B,CAACH,KAAK,CAAC;EAEvDR,qBAAA,CAAAY,4BAA4B,CAACJ,KAAK,CAAC;EAEnC,MAAM;IAAEI,4BAA4B,EAAEC;EAAe,CAAE,GAAGX,uBAAA,CAAAY,4BAA4B,EAAE;EACxFD,eAAe,CAACL,KAAK,CAAC;EAEtB,OAAOV,kBAAA,CAAAiB,yBAAyB,CAACP,KAAK,EAAEE,aAAa,CAAC;AACxD,CAAC,CAAC;AAEFP,OAAA,CAAAC,UAAU,CAACY,WAAW,GAAG,YAAY"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
|
|
2
3
|
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
+
value: true
|
|
4
5
|
});
|
|
5
|
-
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
6
|
-
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
7
|
-
//# sourceMappingURL=RadioGroup.types.js.map
|
|
8
|
-
|
|
9
6
|
//# sourceMappingURL=RadioGroup.types.js.map
|