@fluentui/react-radio 9.1.3 → 9.1.5
Sign up to get free protection for your applications and to get access to all the features.
- package/.swcrc +30 -0
- package/CHANGELOG.json +115 -1
- package/CHANGELOG.md +34 -2
- package/lib/Radio.js.map +1 -1
- package/lib/RadioGroup.js.map +1 -1
- package/lib/RadioGroupField.js.map +1 -1
- 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.map +1 -1
- package/lib/components/Radio/renderRadio.js +1 -9
- package/lib/components/Radio/renderRadio.js.map +1 -1
- package/lib/components/Radio/useRadio.js +5 -3
- package/lib/components/Radio/useRadio.js.map +1 -1
- package/lib/components/Radio/useRadioStyles.js.map +1 -1
- 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.map +1 -1
- package/lib/components/RadioGroup/renderRadioGroup.js +1 -3
- package/lib/components/RadioGroup/renderRadioGroup.js.map +1 -1
- package/lib/components/RadioGroup/useRadioGroup.js +1 -0
- package/lib/components/RadioGroup/useRadioGroup.js.map +1 -1
- package/lib/components/RadioGroup/useRadioGroupStyles.js.map +1 -1
- package/lib/components/RadioGroupField/RadioGroupField.js +1 -2
- package/lib/components/RadioGroupField/RadioGroupField.js.map +1 -1
- package/lib/components/RadioGroupField/index.js.map +1 -1
- package/lib/contexts/RadioGroupContext.js.map +1 -1
- package/lib/contexts/index.js.map +1 -1
- package/lib/contexts/useRadioGroupContextValues.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Radio.js +5 -4
- package/lib-commonjs/Radio.js.map +1 -1
- package/lib-commonjs/RadioGroup.js +5 -4
- package/lib-commonjs/RadioGroup.js.map +1 -1
- package/lib-commonjs/RadioGroupField.js +5 -4
- package/lib-commonjs/RadioGroupField.js.map +1 -1
- package/lib-commonjs/components/Radio/Radio.js +19 -20
- package/lib-commonjs/components/Radio/Radio.js.map +1 -1
- package/lib-commonjs/components/Radio/Radio.types.js +5 -2
- package/lib-commonjs/components/Radio/Radio.types.js.map +1 -1
- package/lib-commonjs/components/Radio/index.js +9 -8
- package/lib-commonjs/components/Radio/index.js.map +1 -1
- package/lib-commonjs/components/Radio/renderRadio.js +13 -24
- package/lib-commonjs/components/Radio/renderRadio.js.map +1 -1
- package/lib-commonjs/components/Radio/useRadio.js +83 -91
- package/lib-commonjs/components/Radio/useRadio.js.map +1 -1
- package/lib-commonjs/components/Radio/useRadioStyles.js +139 -65
- package/lib-commonjs/components/Radio/useRadioStyles.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/RadioGroup.js +21 -22
- package/lib-commonjs/components/RadioGroup/RadioGroup.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/RadioGroup.types.js +5 -2
- package/lib-commonjs/components/RadioGroup/RadioGroup.types.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/index.js +9 -8
- package/lib-commonjs/components/RadioGroup/index.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/renderRadioGroup.js +16 -21
- package/lib-commonjs/components/RadioGroup/renderRadioGroup.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/useRadioGroup.js +40 -50
- package/lib-commonjs/components/RadioGroup/useRadioGroup.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.js +32 -23
- package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.js.map +1 -1
- package/lib-commonjs/components/RadioGroupField/RadioGroupField.js +17 -11
- package/lib-commonjs/components/RadioGroupField/RadioGroupField.js.map +1 -1
- package/lib-commonjs/components/RadioGroupField/index.js +5 -4
- package/lib-commonjs/components/RadioGroupField/index.js.map +1 -1
- package/lib-commonjs/contexts/RadioGroupContext.js +17 -11
- package/lib-commonjs/contexts/RadioGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/index.js +6 -5
- package/lib-commonjs/contexts/index.js.map +1 -1
- package/lib-commonjs/contexts/useRadioGroupContextValues.js +20 -25
- package/lib-commonjs/contexts/useRadioGroupContextValues.js.map +1 -1
- package/lib-commonjs/index.js +31 -99
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +13 -12
- package/lib-amd/Radio.js +0 -6
- package/lib-amd/Radio.js.map +0 -1
- package/lib-amd/RadioGroup.js +0 -6
- package/lib-amd/RadioGroup.js.map +0 -1
- package/lib-amd/RadioGroupField.js +0 -6
- package/lib-amd/RadioGroupField.js.map +0 -1
- package/lib-amd/components/Radio/Radio.js +0 -17
- package/lib-amd/components/Radio/Radio.js.map +0 -1
- package/lib-amd/components/Radio/Radio.types.js +0 -5
- package/lib-amd/components/Radio/Radio.types.js.map +0 -1
- package/lib-amd/components/Radio/index.js +0 -10
- package/lib-amd/components/Radio/index.js.map +0 -1
- package/lib-amd/components/Radio/renderRadio.js +0 -17
- package/lib-amd/components/Radio/renderRadio.js.map +0 -1
- package/lib-amd/components/Radio/useRadio.js +0 -65
- package/lib-amd/components/Radio/useRadio.js.map +0 -1
- package/lib-amd/components/Radio/useRadioStyles.js +0 -158
- package/lib-amd/components/Radio/useRadioStyles.js.map +0 -1
- package/lib-amd/components/RadioGroup/RadioGroup.js +0 -18
- package/lib-amd/components/RadioGroup/RadioGroup.js.map +0 -1
- package/lib-amd/components/RadioGroup/RadioGroup.types.js +0 -5
- package/lib-amd/components/RadioGroup/RadioGroup.types.js.map +0 -1
- package/lib-amd/components/RadioGroup/index.js +0 -10
- package/lib-amd/components/RadioGroup/index.js.map +0 -1
- package/lib-amd/components/RadioGroup/renderRadioGroup.js +0 -15
- package/lib-amd/components/RadioGroup/renderRadioGroup.js.map +0 -1
- package/lib-amd/components/RadioGroup/useRadioGroup.js +0 -38
- package/lib-amd/components/RadioGroup/useRadioGroup.js.map +0 -1
- package/lib-amd/components/RadioGroup/useRadioGroupStyles.js +0 -26
- package/lib-amd/components/RadioGroup/useRadioGroupStyles.js.map +0 -1
- package/lib-amd/components/RadioGroupField/RadioGroupField.js +0 -10
- package/lib-amd/components/RadioGroupField/RadioGroupField.js.map +0 -1
- package/lib-amd/components/RadioGroupField/index.js +0 -6
- package/lib-amd/components/RadioGroupField/index.js.map +0 -1
- package/lib-amd/contexts/RadioGroupContext.js +0 -19
- package/lib-amd/contexts/RadioGroupContext.js.map +0 -1
- package/lib-amd/contexts/index.js +0 -7
- package/lib-amd/contexts/index.js.map +0 -1
- package/lib-amd/contexts/useRadioGroupContextValues.js +0 -19
- package/lib-amd/contexts/useRadioGroupContextValues.js.map +0 -1
- package/lib-amd/index.js +0 -21
- package/lib-amd/index.js.map +0 -1
@@ -1,65 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "react", "@fluentui/react-icons", "@fluentui/react-label", "@fluentui/react-utilities", "../../contexts/RadioGroupContext", "@fluentui/react-tabster"], function (require, exports, tslib_1, React, react_icons_1, react_label_1, react_utilities_1, RadioGroupContext_1, react_tabster_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.useRadio_unstable = void 0;
|
5
|
-
/**
|
6
|
-
* Create the state required to render Radio.
|
7
|
-
*
|
8
|
-
* The returned state can be modified with hooks such as useRadioStyles_unstable,
|
9
|
-
* before being passed to renderRadio_unstable.
|
10
|
-
*
|
11
|
-
* @param props - props from this instance of Radio
|
12
|
-
* @param ref - reference to `<input>` element of Radio
|
13
|
-
*/
|
14
|
-
var useRadio_unstable = function (props, ref) {
|
15
|
-
var nameGroup = RadioGroupContext_1.useRadioGroupContext_unstable(function (ctx) { return ctx.name; });
|
16
|
-
var value = RadioGroupContext_1.useRadioGroupContext_unstable(function (ctx) { return ctx.value; });
|
17
|
-
var defaultValue = RadioGroupContext_1.useRadioGroupContext_unstable(function (ctx) { return ctx.defaultValue; });
|
18
|
-
var disabledGroup = RadioGroupContext_1.useRadioGroupContext_unstable(function (ctx) { return ctx.disabled; });
|
19
|
-
var layout = RadioGroupContext_1.useRadioGroupContext_unstable(function (ctx) { return ctx.layout; });
|
20
|
-
var requiredGroup = RadioGroupContext_1.useRadioGroupContext_unstable(function (ctx) { return ctx.required; });
|
21
|
-
var _a = props.name, name = _a === void 0 ? nameGroup : _a, _b = props.checked, checked = _b === void 0 ? value !== undefined ? value === props.value : undefined : _b, _c = props.defaultChecked, defaultChecked = _c === void 0 ? defaultValue !== undefined ? defaultValue === props.value : undefined : _c, _d = props.labelPosition, labelPosition = _d === void 0 ? layout === 'horizontal-stacked' ? 'below' : 'after' : _d, _e = props.disabled, disabled = _e === void 0 ? disabledGroup : _e, _f = props.required, required = _f === void 0 ? requiredGroup : _f, onChange = props.onChange;
|
22
|
-
var nativeProps = react_utilities_1.getPartitionedNativeProps({
|
23
|
-
props: props,
|
24
|
-
primarySlotTagName: 'input',
|
25
|
-
excludedPropNames: ['checked', 'defaultChecked', 'onChange'],
|
26
|
-
});
|
27
|
-
var root = react_utilities_1.resolveShorthand(props.root, {
|
28
|
-
required: true,
|
29
|
-
defaultProps: tslib_1.__assign({ ref: react_tabster_1.useFocusWithin() }, nativeProps.root),
|
30
|
-
});
|
31
|
-
var input = react_utilities_1.resolveShorthand(props.input, {
|
32
|
-
required: true,
|
33
|
-
defaultProps: tslib_1.__assign({ ref: ref, type: 'radio', id: react_utilities_1.useId('radio-', nativeProps.primary.id), name: name, checked: checked, defaultChecked: defaultChecked, disabled: disabled, required: required }, nativeProps.primary),
|
34
|
-
});
|
35
|
-
input.onChange = react_utilities_1.mergeCallbacks(input.onChange, function (ev) { return onChange === null || onChange === void 0 ? void 0 : onChange(ev, { value: ev.currentTarget.value }); });
|
36
|
-
var label = react_utilities_1.resolveShorthand(props.label, {
|
37
|
-
defaultProps: {
|
38
|
-
htmlFor: input.id,
|
39
|
-
disabled: disabled,
|
40
|
-
},
|
41
|
-
});
|
42
|
-
var indicator = react_utilities_1.resolveShorthand(props.indicator, {
|
43
|
-
required: true,
|
44
|
-
defaultProps: {
|
45
|
-
'aria-hidden': true,
|
46
|
-
children: React.createElement(react_icons_1.CircleFilled, null),
|
47
|
-
},
|
48
|
-
});
|
49
|
-
return {
|
50
|
-
labelPosition: labelPosition,
|
51
|
-
components: {
|
52
|
-
root: 'span',
|
53
|
-
input: 'input',
|
54
|
-
label: react_label_1.Label,
|
55
|
-
indicator: 'div',
|
56
|
-
},
|
57
|
-
root: root,
|
58
|
-
input: input,
|
59
|
-
label: label,
|
60
|
-
indicator: indicator,
|
61
|
-
};
|
62
|
-
};
|
63
|
-
exports.useRadio_unstable = useRadio_unstable;
|
64
|
-
});
|
65
|
-
//# sourceMappingURL=useRadio.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useRadio.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-radio/src/components/Radio/useRadio.tsx"],"names":[],"mappings":";;;;IAQA;;;;;;;;OAQG;IACI,IAAM,iBAAiB,GAAG,UAAC,KAAiB,EAAE,GAAgC;QACnF,IAAM,SAAS,GAAG,iDAA6B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,IAAI,EAAR,CAAQ,CAAC,CAAC;QACjE,IAAM,KAAK,GAAG,iDAA6B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,KAAK,EAAT,CAAS,CAAC,CAAC;QAC9D,IAAM,YAAY,GAAG,iDAA6B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,YAAY,EAAhB,CAAgB,CAAC,CAAC;QAC5E,IAAM,aAAa,GAAG,iDAA6B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,QAAQ,EAAZ,CAAY,CAAC,CAAC;QACzE,IAAM,MAAM,GAAG,iDAA6B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,MAAM,EAAV,CAAU,CAAC,CAAC;QAChE,IAAM,aAAa,GAAG,iDAA6B,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,QAAQ,EAAZ,CAAY,CAAC,CAAC;QAGvE,IAAA,K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QAAQ,UAAA,EACR,QAAQ,UAAA,IACL,WAAW,CAAC,OAAO,CACvB;SACF,CAAC,CAAC;QAEH,KAAK,CAAC,QAAQ,GAAG,gCAAc,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAA,EAAE,IAAI,OAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,EAAjD,CAAiD,CAAC,CAAC;QAEzG,IAAM,KAAK,GAAG,kCAAgB,CAAC,KAAK,CAAC,KAAK,EAAE;YAC1C,YAAY,EAAE;gBACZ,OAAO,EAAE,KAAK,CAAC,EAAE;gBACjB,QAAQ,UAAA;aACT;SACF,CAAC,CAAC;QAEH,IAAM,SAAS,GAAG,kCAAgB,CAAC,KAAK,CAAC,SAAS,EAAE;YAClD,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE;gBACZ,aAAa,EAAE,IAAI;gBACnB,QAAQ,EAAE,oBAAC,0BAAY,OAAG;aAC3B;SACF,CAAC,CAAC;QAEH,OAAO;YACL,aAAa,eAAA;YACb,UAAU,EAAE;gBACV,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,OAAO;gBACd,KAAK,EAAE,mBAAK;gBACZ,SAAS,EAAE,KAAK;aACjB;YACD,IAAI,MAAA;YACJ,KAAK,OAAA;YACL,KAAK,OAAA;YACL,SAAS,WAAA;SACV,CAAC;IACJ,CAAC,CAAC;IA7EW,QAAA,iBAAiB,qBA6E5B","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"]}
|
@@ -1,158 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "@fluentui/react-tabster", "@fluentui/react-theme", "@griffel/react"], function (require, exports, tslib_1, react_tabster_1, react_theme_1, react_1) {
|
2
|
-
"use strict";
|
3
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
5
|
-
exports.useRadioStyles_unstable = exports.radioClassNames = void 0;
|
6
|
-
exports.radioClassNames = {
|
7
|
-
root: 'fui-Radio',
|
8
|
-
indicator: 'fui-Radio__indicator',
|
9
|
-
input: 'fui-Radio__input',
|
10
|
-
label: 'fui-Radio__label',
|
11
|
-
};
|
12
|
-
// The indicator size is used by the indicator and label styles
|
13
|
-
var indicatorSize = '16px';
|
14
|
-
var useRootBaseClassName = react_1.makeResetStyles(tslib_1.__assign({ display: 'inline-flex', position: 'relative' }, react_tabster_1.createFocusOutlineStyle({ style: {}, selector: 'focus-within' })));
|
15
|
-
var useRootStyles = react_1.makeStyles({
|
16
|
-
vertical: {
|
17
|
-
flexDirection: 'column',
|
18
|
-
alignItems: 'center',
|
19
|
-
},
|
20
|
-
});
|
21
|
-
var useInputBaseClassName = react_1.makeResetStyles((_a = {
|
22
|
-
position: 'absolute',
|
23
|
-
left: 0,
|
24
|
-
top: 0,
|
25
|
-
width: "calc(" + indicatorSize + " + 2 * " + react_theme_1.tokens.spacingHorizontalS + ")",
|
26
|
-
height: '100%',
|
27
|
-
boxSizing: 'border-box',
|
28
|
-
margin: 0,
|
29
|
-
opacity: 0,
|
30
|
-
':enabled': (_b = {
|
31
|
-
cursor: 'pointer'
|
32
|
-
},
|
33
|
-
_b["& ~ ." + exports.radioClassNames.label] = {
|
34
|
-
cursor: 'pointer',
|
35
|
-
},
|
36
|
-
_b)
|
37
|
-
},
|
38
|
-
// When unchecked, hide the circle icon (child of the indicator)
|
39
|
-
_a[":not(:checked) ~ ." + exports.radioClassNames.indicator + " > *"] = {
|
40
|
-
opacity: '0',
|
41
|
-
},
|
42
|
-
// Colors for the unchecked state
|
43
|
-
_a[':enabled:not(:checked)'] = (_c = {},
|
44
|
-
_c["& ~ ." + exports.radioClassNames.label] = {
|
45
|
-
color: react_theme_1.tokens.colorNeutralForeground3,
|
46
|
-
},
|
47
|
-
_c["& ~ ." + exports.radioClassNames.indicator] = {
|
48
|
-
borderColor: react_theme_1.tokens.colorNeutralStrokeAccessible,
|
49
|
-
},
|
50
|
-
_c[':hover'] = (_d = {},
|
51
|
-
_d["& ~ ." + exports.radioClassNames.label] = {
|
52
|
-
color: react_theme_1.tokens.colorNeutralForeground2,
|
53
|
-
},
|
54
|
-
_d["& ~ ." + exports.radioClassNames.indicator] = {
|
55
|
-
borderColor: react_theme_1.tokens.colorNeutralStrokeAccessibleHover,
|
56
|
-
},
|
57
|
-
_d),
|
58
|
-
_c[':hover:active'] = (_e = {},
|
59
|
-
_e["& ~ ." + exports.radioClassNames.label] = {
|
60
|
-
color: react_theme_1.tokens.colorNeutralForeground1,
|
61
|
-
},
|
62
|
-
_e["& ~ ." + exports.radioClassNames.indicator] = {
|
63
|
-
borderColor: react_theme_1.tokens.colorNeutralStrokeAccessiblePressed,
|
64
|
-
},
|
65
|
-
_e),
|
66
|
-
_c),
|
67
|
-
// Colors for the checked state
|
68
|
-
_a[':enabled:checked'] = (_f = {},
|
69
|
-
_f["& ~ ." + exports.radioClassNames.label] = {
|
70
|
-
color: react_theme_1.tokens.colorNeutralForeground1,
|
71
|
-
},
|
72
|
-
_f["& ~ ." + exports.radioClassNames.indicator] = {
|
73
|
-
borderColor: react_theme_1.tokens.colorCompoundBrandStroke,
|
74
|
-
color: react_theme_1.tokens.colorCompoundBrandForeground1,
|
75
|
-
},
|
76
|
-
_f[':hover'] = (_g = {},
|
77
|
-
_g["& ~ ." + exports.radioClassNames.indicator] = {
|
78
|
-
borderColor: react_theme_1.tokens.colorCompoundBrandStrokeHover,
|
79
|
-
color: react_theme_1.tokens.colorCompoundBrandForeground1Hover,
|
80
|
-
},
|
81
|
-
_g),
|
82
|
-
_f[':hover:active'] = (_h = {},
|
83
|
-
_h["& ~ ." + exports.radioClassNames.indicator] = {
|
84
|
-
borderColor: react_theme_1.tokens.colorCompoundBrandStrokePressed,
|
85
|
-
color: react_theme_1.tokens.colorCompoundBrandForeground1Pressed,
|
86
|
-
},
|
87
|
-
_h),
|
88
|
-
_f),
|
89
|
-
// Colors for the disabled state
|
90
|
-
_a[':disabled'] = (_j = {},
|
91
|
-
_j["& ~ ." + exports.radioClassNames.label] = {
|
92
|
-
color: react_theme_1.tokens.colorNeutralForegroundDisabled,
|
93
|
-
cursor: 'default',
|
94
|
-
},
|
95
|
-
_j["& ~ ." + exports.radioClassNames.indicator] = {
|
96
|
-
borderColor: react_theme_1.tokens.colorNeutralStrokeDisabled,
|
97
|
-
color: react_theme_1.tokens.colorNeutralForegroundDisabled,
|
98
|
-
},
|
99
|
-
_j),
|
100
|
-
_a));
|
101
|
-
var useInputStyles = react_1.makeStyles({
|
102
|
-
below: {
|
103
|
-
width: '100%',
|
104
|
-
height: "calc(" + indicatorSize + " + 2 * " + react_theme_1.tokens.spacingVerticalS + ")",
|
105
|
-
},
|
106
|
-
});
|
107
|
-
var useIndicatorBaseClassName = react_1.makeResetStyles({
|
108
|
-
width: indicatorSize,
|
109
|
-
height: indicatorSize,
|
110
|
-
fontSize: '12px',
|
111
|
-
boxSizing: 'border-box',
|
112
|
-
flexShrink: 0,
|
113
|
-
display: 'flex',
|
114
|
-
alignItems: 'center',
|
115
|
-
justifyContent: 'center',
|
116
|
-
overflow: 'hidden',
|
117
|
-
border: react_theme_1.tokens.strokeWidthThin + ' solid',
|
118
|
-
borderRadius: react_theme_1.tokens.borderRadiusCircular,
|
119
|
-
margin: react_theme_1.tokens.spacingVerticalS + ' ' + react_theme_1.tokens.spacingHorizontalS,
|
120
|
-
fill: 'currentColor',
|
121
|
-
pointerEvents: 'none',
|
122
|
-
});
|
123
|
-
// Can't use makeResetStyles here because Label is a component that may itself use makeResetStyles.
|
124
|
-
var useLabelStyles = react_1.makeStyles({
|
125
|
-
base: tslib_1.__assign({ alignSelf: 'center' }, react_1.shorthands.padding(react_theme_1.tokens.spacingVerticalS, react_theme_1.tokens.spacingHorizontalS)),
|
126
|
-
after: {
|
127
|
-
paddingLeft: react_theme_1.tokens.spacingHorizontalXS,
|
128
|
-
// Use a (negative) margin to account for the difference between the indicator's height and the label's line height.
|
129
|
-
// This prevents the label from expanding the height of the Radio, but preserves line height if the label wraps.
|
130
|
-
marginTop: "calc((" + indicatorSize + " - " + react_theme_1.tokens.lineHeightBase300 + ") / 2)",
|
131
|
-
marginBottom: "calc((" + indicatorSize + " - " + react_theme_1.tokens.lineHeightBase300 + ") / 2)",
|
132
|
-
},
|
133
|
-
below: {
|
134
|
-
paddingTop: react_theme_1.tokens.spacingVerticalXS,
|
135
|
-
textAlign: 'center',
|
136
|
-
},
|
137
|
-
});
|
138
|
-
/**
|
139
|
-
* Apply styling to the Radio slots based on the state
|
140
|
-
*/
|
141
|
-
var useRadioStyles_unstable = function (state) {
|
142
|
-
var labelPosition = state.labelPosition;
|
143
|
-
var rootBaseClassName = useRootBaseClassName();
|
144
|
-
var rootStyles = useRootStyles();
|
145
|
-
state.root.className = react_1.mergeClasses(exports.radioClassNames.root, rootBaseClassName, labelPosition === 'below' && rootStyles.vertical, state.root.className);
|
146
|
-
var inputBaseClassName = useInputBaseClassName();
|
147
|
-
var inputStyles = useInputStyles();
|
148
|
-
state.input.className = react_1.mergeClasses(exports.radioClassNames.input, inputBaseClassName, labelPosition === 'below' && inputStyles.below, state.input.className);
|
149
|
-
var indicatorBaseClassName = useIndicatorBaseClassName();
|
150
|
-
state.indicator.className = react_1.mergeClasses(exports.radioClassNames.indicator, indicatorBaseClassName, state.indicator.className);
|
151
|
-
var labelStyles = useLabelStyles();
|
152
|
-
if (state.label) {
|
153
|
-
state.label.className = react_1.mergeClasses(exports.radioClassNames.label, labelStyles.base, labelStyles[labelPosition], state.label.className);
|
154
|
-
}
|
155
|
-
};
|
156
|
-
exports.useRadioStyles_unstable = useRadioStyles_unstable;
|
157
|
-
});
|
158
|
-
//# sourceMappingURL=useRadioStyles.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useRadioStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-radio/src/components/Radio/useRadioStyles.ts"],"names":[],"mappings":";;;;;IAMa,QAAA,eAAe,GAA+B;QACzD,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,sBAAsB;QACjC,KAAK,EAAE,kBAAkB;QACzB,KAAK,EAAE,kBAAkB;KAC1B,CAAC;IAEF,+DAA+D;IAC/D,IAAM,aAAa,GAAG,MAAM,CAAC;IAE7B,IAAM,oBAAoB,GAAG,uBAAe,oBAC1C,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,UAAU,IACjB,uCAAuB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC,EACnE,CAAC;IAEH,IAAM,aAAa,GAAG,kBAAU,CAAC;QAC/B,QAAQ,EAAE;YACR,aAAa,EAAE,QAAQ;YACvB,UAAU,EAAE,QAAQ;SACrB;KACF,CAAC,CAAC;IAEH,IAAM,qBAAqB,GAAG,uBAAe;YAC3C,QAAQ,EAAE,UAAU;YACpB,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,CAAC;YACN,KAAK,EAAE,UAAQ,aAAa,eAAU,oBAAM,CAAC,kBAAkB,MAAG;YAClE,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,YAAY;YACvB,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,CAAC;YAEV,UAAU;oBACR,MAAM,EAAE,SAAS;;gBACjB,GAAC,UAAQ,uBAAe,CAAC,KAAO,IAAG;oBACjC,MAAM,EAAE,SAAS;iBAClB;mBACF;;QAED,gEAAgE;QAChE,GAAC,uBAAqB,uBAAe,CAAC,SAAS,SAAM,IAAG;YACtD,OAAO,EAAE,GAAG;SACb;QAED,iCAAiC;QACjC,4BAAwB;YAC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,CAAC;SACH;IACH,CAAC,CAAC;IArCW,QAAA,uBAAuB,2BAqClC","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"]}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
define(["require", "exports", "react", "./renderRadioGroup", "./useRadioGroup", "./useRadioGroupStyles", "../../contexts/useRadioGroupContextValues", "@fluentui/react-shared-contexts"], function (require, exports, React, renderRadioGroup_1, useRadioGroup_1, useRadioGroupStyles_1, useRadioGroupContextValues_1, react_shared_contexts_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.RadioGroup = void 0;
|
5
|
-
/**
|
6
|
-
* A RadioGroup component presents a set of options where only one option can be selected.
|
7
|
-
*/
|
8
|
-
exports.RadioGroup = React.forwardRef(function (props, ref) {
|
9
|
-
var state = useRadioGroup_1.useRadioGroup_unstable(props, ref);
|
10
|
-
var contextValues = useRadioGroupContextValues_1.useRadioGroupContextValues(state);
|
11
|
-
useRadioGroupStyles_1.useRadioGroupStyles_unstable(state);
|
12
|
-
var useCustomStyles = react_shared_contexts_1.useCustomStyleHooks_unstable().useRadioGroupStyles_unstable;
|
13
|
-
useCustomStyles(state);
|
14
|
-
return renderRadioGroup_1.renderRadioGroup_unstable(state, contextValues);
|
15
|
-
});
|
16
|
-
exports.RadioGroup.displayName = 'RadioGroup';
|
17
|
-
});
|
18
|
-
//# sourceMappingURL=RadioGroup.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-radio/src/components/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":";;;;IASA;;OAEG;IACU,QAAA,UAAU,GAAyC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAC1F,IAAM,KAAK,GAAG,sCAAsB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACjD,IAAM,aAAa,GAAG,uDAA0B,CAAC,KAAK,CAAC,CAAC;QAExD,kDAA4B,CAAC,KAAK,CAAC,CAAC;QAE5B,IAA8B,eAAe,GAAK,oDAA4B,EAAE,6BAAnC,CAAoC;QACzF,eAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,4CAAyB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","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"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"RadioGroup.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-radio/src/components/RadioGroup/RadioGroup.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type RadioGroupSlots = {\n /**\n * The radio group root.\n */\n root: NonNullable<Slot<'div'>>;\n};\n\nexport type RadioGroupProps = Omit<ComponentProps<Partial<RadioGroupSlots>>, 'onChange'> & {\n /**\n * The name of this radio group. This name is applied to all Radio items inside this group.\n *\n * If no name is provided, one will be generated so that all of the Radio items have the same name.\n */\n name?: string;\n\n /**\n * The selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n value?: string;\n\n /**\n * The default selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n defaultValue?: string;\n\n /**\n * Callback when the selected Radio item changes.\n */\n onChange?: (ev: React.FormEvent<HTMLDivElement>, data: RadioGroupOnChangeData) => void;\n\n /**\n * How the radio items are laid out in the group.\n *\n * @default vertical\n */\n layout?: 'vertical' | 'horizontal' | 'horizontal-stacked';\n\n /**\n * Disable all Radio items in this group.\n */\n disabled?: boolean;\n\n /**\n * Require a selection in this group. Adds the `required` prop to all child Radio items.\n */\n required?: boolean;\n};\n\n/**\n * Data for the onChange event for RadioGroup.\n */\nexport type RadioGroupOnChangeData = {\n /**\n * The value of the newly selected Radio item.\n */\n value: string;\n};\n\n/**\n * State used in rendering RadioGroup\n */\nexport type RadioGroupState = ComponentState<RadioGroupSlots> &\n Required<Pick<RadioGroupProps, 'layout'>> &\n Partial<Exclude<RadioGroupProps, 'onChange' | 'layout'>>;\n\nexport type RadioGroupContextValue = Pick<\n RadioGroupProps,\n 'name' | 'value' | 'defaultValue' | 'disabled' | 'layout' | 'required'\n>;\n\nexport type RadioGroupContextValues = {\n radioGroup: RadioGroupContextValue;\n};\n"]}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./RadioGroup", "./RadioGroup.types", "./renderRadioGroup", "./useRadioGroup", "./useRadioGroupStyles"], function (require, exports, tslib_1, RadioGroup_1, RadioGroup_types_1, renderRadioGroup_1, useRadioGroup_1, useRadioGroupStyles_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(RadioGroup_1, exports);
|
5
|
-
tslib_1.__exportStar(RadioGroup_types_1, exports);
|
6
|
-
tslib_1.__exportStar(renderRadioGroup_1, exports);
|
7
|
-
tslib_1.__exportStar(useRadioGroup_1, exports);
|
8
|
-
tslib_1.__exportStar(useRadioGroupStyles_1, exports);
|
9
|
-
});
|
10
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-radio/src/components/RadioGroup/index.ts"],"names":[],"mappings":";;;IAAA,4CAA6B;IAC7B,kDAAmC;IACnC,kDAAmC;IACnC,+CAAgC;IAChC,qDAAsC","sourcesContent":["export * from './RadioGroup';\nexport * from './RadioGroup.types';\nexport * from './renderRadioGroup';\nexport * from './useRadioGroup';\nexport * from './useRadioGroupStyles';\n"]}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "../../contexts/RadioGroupContext"], function (require, exports, tslib_1, React, react_utilities_1, RadioGroupContext_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.renderRadioGroup_unstable = void 0;
|
5
|
-
/**
|
6
|
-
* Render the final JSX of RadioGroup
|
7
|
-
*/
|
8
|
-
var renderRadioGroup_unstable = function (state, contextValues) {
|
9
|
-
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
10
|
-
return (React.createElement(RadioGroupContext_1.RadioGroupContext.Provider, { value: contextValues.radioGroup },
|
11
|
-
React.createElement(slots.root, tslib_1.__assign({}, slotProps.root))));
|
12
|
-
};
|
13
|
-
exports.renderRadioGroup_unstable = renderRadioGroup_unstable;
|
14
|
-
});
|
15
|
-
//# sourceMappingURL=renderRadioGroup.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"renderRadioGroup.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-radio/src/components/RadioGroup/renderRadioGroup.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,yBAAyB,GAAG,UAAC,KAAsB,EAAE,aAAsC;QAChG,IAAA,KAAuB,0BAAQ,CAAkB,KAAK,CAAC,EAArD,KAAK,WAAA,EAAE,SAAS,eAAqC,CAAC;QAE9D,OAAO,CACL,oBAAC,qCAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,CAAC,UAAU;YACzD,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CACP,CAC9B,CAAC;IACJ,CAAC,CAAC;IARW,QAAA,yBAAyB,6BAQpC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { RadioGroupContext } from '../../contexts/RadioGroupContext';\nimport { RadioGroupContextValues, RadioGroupSlots, RadioGroupState } from './RadioGroup.types';\n\n/**\n * Render the final JSX of RadioGroup\n */\nexport const renderRadioGroup_unstable = (state: RadioGroupState, contextValues: RadioGroupContextValues) => {\n const { slots, slotProps } = getSlots<RadioGroupSlots>(state);\n\n return (\n <RadioGroupContext.Provider value={contextValues.radioGroup}>\n <slots.root {...slotProps.root} />\n </RadioGroupContext.Provider>\n );\n};\n"]}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.useRadioGroup_unstable = void 0;
|
5
|
-
/**
|
6
|
-
* Create the state required to render RadioGroup.
|
7
|
-
*
|
8
|
-
* The returned state can be modified with hooks such as useRadioGroupStyles_unstable,
|
9
|
-
* before being passed to renderRadioGroup_unstable.
|
10
|
-
*
|
11
|
-
* @param props - props from this instance of RadioGroup
|
12
|
-
* @param ref - reference to root HTMLElement of RadioGroup
|
13
|
-
*/
|
14
|
-
var useRadioGroup_unstable = function (props, ref) {
|
15
|
-
var generatedName = react_utilities_1.useId('radiogroup-');
|
16
|
-
var _a = props.name, name = _a === void 0 ? generatedName : _a, value = props.value, defaultValue = props.defaultValue, disabled = props.disabled, _b = props.layout, layout = _b === void 0 ? 'vertical' : _b, onChange = props.onChange, required = props.required;
|
17
|
-
return {
|
18
|
-
layout: layout,
|
19
|
-
name: name,
|
20
|
-
value: value,
|
21
|
-
defaultValue: defaultValue,
|
22
|
-
disabled: disabled,
|
23
|
-
required: required,
|
24
|
-
components: {
|
25
|
-
root: 'div',
|
26
|
-
},
|
27
|
-
root: tslib_1.__assign(tslib_1.__assign({ ref: ref, role: 'radiogroup' }, react_utilities_1.getNativeElementProps('div', props, /*excludedPropNames:*/ ['onChange', 'name'])), { onChange: react_utilities_1.useEventCallback(function (ev) {
|
28
|
-
if (onChange &&
|
29
|
-
react_utilities_1.isHTMLElement(ev.target, { constructorName: 'HTMLInputElement' }) &&
|
30
|
-
ev.target.type === 'radio') {
|
31
|
-
onChange(ev, { value: ev.target.value });
|
32
|
-
}
|
33
|
-
}) }),
|
34
|
-
};
|
35
|
-
};
|
36
|
-
exports.useRadioGroup_unstable = useRadioGroup_unstable;
|
37
|
-
});
|
38
|
-
//# sourceMappingURL=useRadioGroup.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useRadioGroup.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-radio/src/components/RadioGroup/useRadioGroup.ts"],"names":[],"mappings":";;;;IAIA;;;;;;;;OAQG;IACI,IAAM,sBAAsB,GAAG,UAAC,KAAsB,EAAE,GAA8B;QAC3F,IAAM,aAAa,GAAG,uBAAK,CAAC,aAAa,CAAC,CAAC;QAEnC,IAAA,KAAiG,KAAK,KAAlF,EAApB,IAAI,mBAAG,aAAa,KAAA,EAAE,KAAK,GAAsE,KAAK,MAA3E,EAAE,YAAY,GAAwD,KAAK,aAA7D,EAAE,QAAQ,GAA8C,KAAK,SAAnD,EAAE,KAA4C,KAAK,OAA9B,EAAnB,MAAM,mBAAG,UAAU,KAAA,EAAE,QAAQ,GAAe,KAAK,SAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;QAE/G,OAAO;YACL,MAAM,QAAA;YACN,IAAI,MAAA;YACJ,KAAK,OAAA;YACL,YAAY,cAAA;YACZ,QAAQ,UAAA;YACR,QAAQ,UAAA;YACR,UAAU,EAAE;gBACV,IAAI,EAAE,KAAK;aACZ;YACD,IAAI,sCACF,GAAG,KAAA,EACH,IAAI,EAAE,YAAY,IACf,uCAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,sBAAsB,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,KACnF,QAAQ,EAAE,kCAAgB,CAAC,UAAA,EAAE;oBAC3B,IACE,QAAQ;wBACR,+BAAa,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC;wBACjE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,OAAO,EAC1B;wBACA,QAAQ,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;qBAC1C;gBACH,CAAC,CAAC,GACH;SACF,CAAC;IACJ,CAAC,CAAC;IA9BW,QAAA,sBAAsB,0BA8BjC","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, isHTMLElement, useEventCallback, useId } from '@fluentui/react-utilities';\nimport { RadioGroupProps, RadioGroupState } from './RadioGroup.types';\n\n/**\n * Create the state required to render RadioGroup.\n *\n * The returned state can be modified with hooks such as useRadioGroupStyles_unstable,\n * before being passed to renderRadioGroup_unstable.\n *\n * @param props - props from this instance of RadioGroup\n * @param ref - reference to root HTMLElement of RadioGroup\n */\nexport const useRadioGroup_unstable = (props: RadioGroupProps, ref: React.Ref<HTMLDivElement>): RadioGroupState => {\n const generatedName = useId('radiogroup-');\n\n const { name = generatedName, value, defaultValue, disabled, layout = 'vertical', onChange, required } = props;\n\n return {\n layout,\n name,\n value,\n defaultValue,\n disabled,\n required,\n components: {\n root: 'div',\n },\n root: {\n ref,\n role: 'radiogroup',\n ...getNativeElementProps('div', props, /*excludedPropNames:*/ ['onChange', 'name']),\n onChange: useEventCallback(ev => {\n if (\n onChange &&\n isHTMLElement(ev.target, { constructorName: 'HTMLInputElement' }) &&\n ev.target.type === 'radio'\n ) {\n onChange(ev, { value: ev.target.value });\n }\n }),\n },\n };\n};\n"]}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
define(["require", "exports", "@griffel/react"], function (require, exports, react_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.useRadioGroupStyles_unstable = exports.radioGroupClassNames = void 0;
|
5
|
-
exports.radioGroupClassNames = {
|
6
|
-
root: 'fui-RadioGroup',
|
7
|
-
};
|
8
|
-
var useStyles = react_1.makeStyles({
|
9
|
-
root: {
|
10
|
-
display: 'flex',
|
11
|
-
alignItems: 'flex-start',
|
12
|
-
},
|
13
|
-
vertical: {
|
14
|
-
flexDirection: 'column',
|
15
|
-
},
|
16
|
-
});
|
17
|
-
/**
|
18
|
-
* Apply styling to the RadioGroup slots based on the state
|
19
|
-
*/
|
20
|
-
var useRadioGroupStyles_unstable = function (state) {
|
21
|
-
var styles = useStyles();
|
22
|
-
state.root.className = react_1.mergeClasses(exports.radioGroupClassNames.root, styles.root, state.layout === 'vertical' && styles.vertical, state.root.className);
|
23
|
-
};
|
24
|
-
exports.useRadioGroupStyles_unstable = useRadioGroupStyles_unstable;
|
25
|
-
});
|
26
|
-
//# sourceMappingURL=useRadioGroupStyles.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useRadioGroupStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-radio/src/components/RadioGroup/useRadioGroupStyles.ts"],"names":[],"mappings":";;;;IAIa,QAAA,oBAAoB,GAAoC;QACnE,IAAI,EAAE,gBAAgB;KACvB,CAAC;IAEF,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,UAAU,EAAE,YAAY;SACzB;QAED,QAAQ,EAAE;YACR,aAAa,EAAE,QAAQ;SACxB;KACF,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,4BAA4B,GAAG,UAAC,KAAsB;QACjE,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CACjC,4BAAoB,CAAC,IAAI,EACzB,MAAM,CAAC,IAAI,EACX,KAAK,CAAC,MAAM,KAAK,UAAU,IAAI,MAAM,CAAC,QAAQ,EAC9C,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;IACJ,CAAC,CAAC;IARW,QAAA,4BAA4B,gCAQvC","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) => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n radioGroupClassNames.root,\n styles.root,\n state.layout === 'vertical' && styles.vertical,\n state.root.className,\n );\n};\n"]}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
define(["require", "exports", "@fluentui/react-field", "../../RadioGroup"], function (require, exports, react_field_1, RadioGroup_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.RadioGroupField = exports.radioGroupFieldClassNames = void 0;
|
5
|
-
/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */
|
6
|
-
exports.radioGroupFieldClassNames = react_field_1.getDeprecatedFieldClassNames(RadioGroup_1.radioGroupClassNames.root);
|
7
|
-
/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */
|
8
|
-
exports.RadioGroupField = react_field_1.makeDeprecatedField(RadioGroup_1.RadioGroup);
|
9
|
-
});
|
10
|
-
//# sourceMappingURL=RadioGroupField.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"RadioGroupField.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-radio/src/components/RadioGroupField/RadioGroupField.tsx"],"names":[],"mappings":";;;;IAOA,6EAA6E;IAChE,QAAA,yBAAyB,GAAG,0CAA4B,CAAC,iCAAoB,CAAC,IAAI,CAAC,CAAC;IACjG,6EAA6E;IAChE,QAAA,eAAe,GAA8C,iCAAmB,CAAC,uBAAU,CAAC,CAAC","sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport { DeprecatedFieldProps, getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { RadioGroup, radioGroupClassNames, RadioGroupProps } from '../../RadioGroup';\n\n/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */\nexport type RadioGroupFieldProps = DeprecatedFieldProps<RadioGroupProps>;\n/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */\nexport const radioGroupFieldClassNames = getDeprecatedFieldClassNames(radioGroupClassNames.root);\n/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */\nexport const RadioGroupField: ForwardRefComponent<RadioGroupFieldProps> = makeDeprecatedField(RadioGroup);\n"]}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./RadioGroupField"], function (require, exports, tslib_1, RadioGroupField_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(RadioGroupField_1, exports);
|
5
|
-
});
|
6
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-radio/src/components/RadioGroupField/index.ts"],"names":[],"mappings":";;;IAAA,iDAAkC","sourcesContent":["export * from './RadioGroupField';\n"]}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
define(["require", "exports", "@fluentui/react-context-selector"], function (require, exports, react_context_selector_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.useRadioGroupContext_unstable = exports.RadioGroupProvider = exports.RadioGroupContext = void 0;
|
5
|
-
/**
|
6
|
-
* RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.
|
7
|
-
*/
|
8
|
-
exports.RadioGroupContext = react_context_selector_1.createContext(undefined);
|
9
|
-
var radioGroupContextDefaultValue = {};
|
10
|
-
exports.RadioGroupProvider = exports.RadioGroupContext.Provider;
|
11
|
-
var useRadioGroupContext_unstable = function (selector) {
|
12
|
-
return react_context_selector_1.useContextSelector(exports.RadioGroupContext, function (ctx) {
|
13
|
-
if (ctx === void 0) { ctx = radioGroupContextDefaultValue; }
|
14
|
-
return selector(ctx);
|
15
|
-
});
|
16
|
-
};
|
17
|
-
exports.useRadioGroupContext_unstable = useRadioGroupContext_unstable;
|
18
|
-
});
|
19
|
-
//# sourceMappingURL=RadioGroupContext.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"RadioGroupContext.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-radio/src/contexts/RadioGroupContext.ts"],"names":[],"mappings":";;;;IAIA;;OAEG;IACU,QAAA,iBAAiB,GAAoC,sCAAa,CAC7E,SAAS,CACyB,CAAC;IAErC,IAAM,6BAA6B,GAA2B,EAAE,CAAC;IAEpD,QAAA,kBAAkB,GAAG,yBAAiB,CAAC,QAAQ,CAAC;IAEtD,IAAM,6BAA6B,GAAG,UAAI,QAAoD;QACnG,OAAA,2CAAkB,CAAC,yBAAiB,EAAE,UAAC,GAAmC;YAAnC,oBAAA,EAAA,mCAAmC;YAAK,OAAA,QAAQ,CAAC,GAAG,CAAC;QAAb,CAAa,CAAC;IAA7F,CAA6F,CAAC;IADnF,QAAA,6BAA6B,iCACsD","sourcesContent":["import { createContext, useContextSelector, ContextSelector } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { RadioGroupContextValue } from '../RadioGroup';\n\n/**\n * RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.\n */\nexport const RadioGroupContext: Context<RadioGroupContextValue> = createContext<RadioGroupContextValue | undefined>(\n undefined,\n) as Context<RadioGroupContextValue>;\n\nconst radioGroupContextDefaultValue: RadioGroupContextValue = {};\n\nexport const RadioGroupProvider = RadioGroupContext.Provider;\n\nexport const useRadioGroupContext_unstable = <T>(selector: ContextSelector<RadioGroupContextValue, T>): T =>\n useContextSelector(RadioGroupContext, (ctx = radioGroupContextDefaultValue) => selector(ctx));\n"]}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./RadioGroupContext", "./useRadioGroupContextValues"], function (require, exports, tslib_1, RadioGroupContext_1, useRadioGroupContextValues_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(RadioGroupContext_1, exports);
|
5
|
-
tslib_1.__exportStar(useRadioGroupContextValues_1, exports);
|
6
|
-
});
|
7
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-radio/src/contexts/index.ts"],"names":[],"mappings":";;;IAAA,mDAAoC;IACpC,4DAA6C","sourcesContent":["export * from './RadioGroupContext';\nexport * from './useRadioGroupContextValues';\n"]}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
define(["require", "exports"], function (require, exports) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.useRadioGroupContextValues = void 0;
|
5
|
-
var useRadioGroupContextValues = function (state) {
|
6
|
-
var name = state.name, value = state.value, defaultValue = state.defaultValue, disabled = state.disabled, layout = state.layout, required = state.required;
|
7
|
-
var radioGroup = {
|
8
|
-
name: name,
|
9
|
-
value: value,
|
10
|
-
defaultValue: defaultValue,
|
11
|
-
disabled: disabled,
|
12
|
-
layout: layout,
|
13
|
-
required: required,
|
14
|
-
};
|
15
|
-
return { radioGroup: radioGroup };
|
16
|
-
};
|
17
|
-
exports.useRadioGroupContextValues = useRadioGroupContextValues;
|
18
|
-
});
|
19
|
-
//# sourceMappingURL=useRadioGroupContextValues.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useRadioGroupContextValues.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-radio/src/contexts/useRadioGroupContextValues.ts"],"names":[],"mappings":";;;;IAEO,IAAM,0BAA0B,GAAG,UAAC,KAAsB;QACvD,IAAA,IAAI,GAAsD,KAAK,KAA3D,EAAE,KAAK,GAA+C,KAAK,MAApD,EAAE,YAAY,GAAiC,KAAK,aAAtC,EAAE,QAAQ,GAAuB,KAAK,SAA5B,EAAE,MAAM,GAAe,KAAK,OAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;QAExE,IAAM,UAAU,GAA2B;YACzC,IAAI,MAAA;YACJ,KAAK,OAAA;YACL,YAAY,cAAA;YACZ,QAAQ,UAAA;YACR,MAAM,QAAA;YACN,QAAQ,UAAA;SACT,CAAC;QAEF,OAAO,EAAE,UAAU,YAAA,EAAE,CAAC;IACxB,CAAC,CAAC;IAbW,QAAA,0BAA0B,8BAarC","sourcesContent":["import type { RadioGroupContextValue, RadioGroupContextValues, RadioGroupState } from '../RadioGroup';\n\nexport const useRadioGroupContextValues = (state: RadioGroupState): RadioGroupContextValues => {\n const { name, value, defaultValue, disabled, layout, required } = state;\n\n const radioGroup: RadioGroupContextValue = {\n name,\n value,\n defaultValue,\n disabled,\n layout,\n required,\n };\n\n return { radioGroup };\n};\n"]}
|
package/lib-amd/index.js
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
define(["require", "exports", "./RadioGroup", "./Radio", "./contexts/index", "./RadioGroupField"], function (require, exports, RadioGroup_1, Radio_1, index_1, RadioGroupField_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.radioGroupFieldClassNames = exports.RadioGroupField_unstable = exports.useRadioGroupContext_unstable = exports.useRadioGroupContextValues = exports.RadioGroupProvider = exports.useRadio_unstable = exports.useRadioStyles_unstable = exports.renderRadio_unstable = exports.radioClassNames = exports.Radio = exports.useRadioGroup_unstable = exports.useRadioGroupStyles_unstable = exports.renderRadioGroup_unstable = exports.radioGroupClassNames = exports.RadioGroup = void 0;
|
5
|
-
Object.defineProperty(exports, "RadioGroup", { enumerable: true, get: function () { return RadioGroup_1.RadioGroup; } });
|
6
|
-
Object.defineProperty(exports, "radioGroupClassNames", { enumerable: true, get: function () { return RadioGroup_1.radioGroupClassNames; } });
|
7
|
-
Object.defineProperty(exports, "renderRadioGroup_unstable", { enumerable: true, get: function () { return RadioGroup_1.renderRadioGroup_unstable; } });
|
8
|
-
Object.defineProperty(exports, "useRadioGroupStyles_unstable", { enumerable: true, get: function () { return RadioGroup_1.useRadioGroupStyles_unstable; } });
|
9
|
-
Object.defineProperty(exports, "useRadioGroup_unstable", { enumerable: true, get: function () { return RadioGroup_1.useRadioGroup_unstable; } });
|
10
|
-
Object.defineProperty(exports, "Radio", { enumerable: true, get: function () { return Radio_1.Radio; } });
|
11
|
-
Object.defineProperty(exports, "radioClassNames", { enumerable: true, get: function () { return Radio_1.radioClassNames; } });
|
12
|
-
Object.defineProperty(exports, "renderRadio_unstable", { enumerable: true, get: function () { return Radio_1.renderRadio_unstable; } });
|
13
|
-
Object.defineProperty(exports, "useRadioStyles_unstable", { enumerable: true, get: function () { return Radio_1.useRadioStyles_unstable; } });
|
14
|
-
Object.defineProperty(exports, "useRadio_unstable", { enumerable: true, get: function () { return Radio_1.useRadio_unstable; } });
|
15
|
-
Object.defineProperty(exports, "RadioGroupProvider", { enumerable: true, get: function () { return index_1.RadioGroupProvider; } });
|
16
|
-
Object.defineProperty(exports, "useRadioGroupContextValues", { enumerable: true, get: function () { return index_1.useRadioGroupContextValues; } });
|
17
|
-
Object.defineProperty(exports, "useRadioGroupContext_unstable", { enumerable: true, get: function () { return index_1.useRadioGroupContext_unstable; } });
|
18
|
-
Object.defineProperty(exports, "RadioGroupField_unstable", { enumerable: true, get: function () { return RadioGroupField_1.RadioGroupField; } });
|
19
|
-
Object.defineProperty(exports, "radioGroupFieldClassNames", { enumerable: true, get: function () { return RadioGroupField_1.radioGroupFieldClassNames; } });
|
20
|
-
});
|
21
|
-
//# sourceMappingURL=index.js.map
|
package/lib-amd/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-radio/src/index.ts"],"names":[],"mappings":";;;;IACE,wGAAA,UAAU,OAAA;IACV,kHAAA,oBAAoB,OAAA;IACpB,uHAAA,yBAAyB,OAAA;IACzB,0HAAA,4BAA4B,OAAA;IAC5B,oHAAA,sBAAsB,OAAA;IAUf,8FAAA,KAAK,OAAA;IAAE,wGAAA,eAAe,OAAA;IAAE,6GAAA,oBAAoB,OAAA;IAAE,gHAAA,uBAAuB,OAAA;IAAE,0GAAA,iBAAiB,OAAA;IAExF,2GAAA,kBAAkB,OAAA;IAAE,mHAAA,0BAA0B,OAAA;IAAE,sHAAA,6BAA6B,OAAA;IAG7E,2HAAA,eAAe,OAA4B;IAAE,4HAAA,yBAAyB,OAAA","sourcesContent":["export {\n RadioGroup,\n radioGroupClassNames,\n renderRadioGroup_unstable,\n useRadioGroupStyles_unstable,\n useRadioGroup_unstable,\n} from './RadioGroup';\nexport type {\n RadioGroupContextValue,\n RadioGroupContextValues,\n RadioGroupOnChangeData,\n RadioGroupProps,\n RadioGroupSlots,\n RadioGroupState,\n} from './RadioGroup';\nexport { Radio, radioClassNames, renderRadio_unstable, useRadioStyles_unstable, useRadio_unstable } from './Radio';\nexport type { RadioProps, RadioSlots, RadioState, RadioOnChangeData } from './Radio';\nexport { RadioGroupProvider, useRadioGroupContextValues, useRadioGroupContext_unstable } from './contexts/index';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { RadioGroupField as RadioGroupField_unstable, radioGroupFieldClassNames } from './RadioGroupField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { RadioGroupFieldProps as RadioGroupFieldProps_unstable } from './RadioGroupField';\n"]}
|