@fluentui/react-radio 9.0.0-rc.2 → 9.0.0-rc.5
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +162 -1
- package/CHANGELOG.md +47 -2
- package/dist/index.d.ts +9 -17
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/components/Radio/useRadio.js +1 -1
- package/lib/components/Radio/useRadio.js.map +1 -1
- package/lib/components/Radio/useRadioStyles.js +17 -25
- package/lib/components/Radio/useRadioStyles.js.map +1 -1
- package/lib/components/RadioGroup/RadioGroup.types.js.map +1 -1
- package/lib/components/RadioGroup/useRadioGroupStyles.js +0 -5
- package/lib/components/RadioGroup/useRadioGroupStyles.js.map +1 -1
- package/lib/contexts/RadioGroupContext.js +3 -1
- package/lib/contexts/RadioGroupContext.js.map +1 -1
- package/lib/index.js +3 -7
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Radio/useRadio.js +1 -1
- package/lib-commonjs/components/Radio/useRadio.js.map +1 -1
- package/lib-commonjs/components/Radio/useRadioStyles.js +18 -26
- package/lib-commonjs/components/Radio/useRadioStyles.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.js +1 -6
- package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.js.map +1 -1
- package/lib-commonjs/contexts/RadioGroupContext.js +6 -1
- package/lib-commonjs/contexts/RadioGroupContext.js.map +1 -1
- package/lib-commonjs/index.js +9 -19
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +9 -9
- package/lib/Radio.d.ts +0 -1
- package/lib/RadioGroup.d.ts +0 -1
- package/lib/components/Radio/Radio.d.ts +0 -6
- package/lib/components/Radio/Radio.types.d.ts +0 -69
- package/lib/components/Radio/index.d.ts +0 -5
- package/lib/components/Radio/renderRadio.d.ts +0 -5
- package/lib/components/Radio/useRadio.d.ts +0 -12
- package/lib/components/Radio/useRadioStyles.d.ts +0 -11
- package/lib/components/RadioGroup/RadioGroup.d.ts +0 -6
- package/lib/components/RadioGroup/RadioGroup.types.d.ts +0 -63
- package/lib/components/RadioGroup/index.d.ts +0 -5
- package/lib/components/RadioGroup/renderRadioGroup.d.ts +0 -5
- package/lib/components/RadioGroup/useRadioGroup.d.ts +0 -12
- package/lib/components/RadioGroup/useRadioGroupStyles.d.ts +0 -11
- package/lib/contexts/RadioGroupContext.d.ts +0 -6
- package/lib/contexts/index.d.ts +0 -2
- package/lib/contexts/useRadioGroupContextValues.d.ts +0 -2
- package/lib/index.d.ts +0 -5
- package/lib-commonjs/Radio.d.ts +0 -1
- package/lib-commonjs/RadioGroup.d.ts +0 -1
- package/lib-commonjs/components/Radio/Radio.d.ts +0 -6
- package/lib-commonjs/components/Radio/Radio.types.d.ts +0 -69
- package/lib-commonjs/components/Radio/index.d.ts +0 -5
- package/lib-commonjs/components/Radio/renderRadio.d.ts +0 -5
- package/lib-commonjs/components/Radio/useRadio.d.ts +0 -12
- package/lib-commonjs/components/Radio/useRadioStyles.d.ts +0 -11
- package/lib-commonjs/components/RadioGroup/RadioGroup.d.ts +0 -6
- package/lib-commonjs/components/RadioGroup/RadioGroup.types.d.ts +0 -63
- package/lib-commonjs/components/RadioGroup/index.d.ts +0 -5
- package/lib-commonjs/components/RadioGroup/renderRadioGroup.d.ts +0 -5
- package/lib-commonjs/components/RadioGroup/useRadioGroup.d.ts +0 -12
- package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.d.ts +0 -11
- package/lib-commonjs/contexts/RadioGroupContext.d.ts +0 -6
- package/lib-commonjs/contexts/index.d.ts +0 -2
- package/lib-commonjs/contexts/useRadioGroupContextValues.d.ts +0 -2
- package/lib-commonjs/index.d.ts +0 -5
@@ -3,28 +3,20 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.useRadioStyles_unstable = exports.radioClassNames =
|
6
|
+
exports.useRadioStyles_unstable = exports.radioClassNames = void 0;
|
7
7
|
|
8
8
|
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
9
9
|
|
10
10
|
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
11
11
|
|
12
12
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
13
|
-
/**
|
14
|
-
* @deprecated Use `radioClassNames.root` instead.
|
15
|
-
*/
|
16
13
|
|
17
|
-
|
18
|
-
exports.radioClassName = 'fui-Radio';
|
19
14
|
exports.radioClassNames = {
|
20
15
|
root: 'fui-Radio',
|
21
16
|
indicator: 'fui-Radio__indicator',
|
22
17
|
input: 'fui-Radio__input',
|
23
18
|
label: 'fui-Radio__label'
|
24
|
-
}; //
|
25
|
-
|
26
|
-
const spacingHorizontalS = '8px';
|
27
|
-
const spacingHorizontalM = '12px'; // The indicator size is used by the indicator and label styles
|
19
|
+
}; // The indicator size is used by the indicator and label styles
|
28
20
|
|
29
21
|
const indicatorSize = '16px';
|
30
22
|
/**
|
@@ -35,19 +27,17 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
35
27
|
"base": {
|
36
28
|
"mc9l5x": "ftuwxu6",
|
37
29
|
"qhf8xq": "f10pi13n",
|
38
|
-
"
|
39
|
-
"
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"uwmqm3": ["f177v4lu", "f19lj068"]
|
30
|
+
"z8tnut": "f1kwiid1",
|
31
|
+
"z189sj": ["f1vdfbxk", "f1f5gg8d"],
|
32
|
+
"Byoj8tv": "f5b47ha",
|
33
|
+
"uwmqm3": ["f1f5gg8d", "f1vdfbxk"]
|
43
34
|
},
|
44
35
|
"vertical": {
|
45
36
|
"Beiy3e4": "f1vx9l62",
|
46
|
-
"Bt984gj": "f122n59"
|
47
|
-
"Belr9w4": "fe5j3v"
|
37
|
+
"Bt984gj": "f122n59"
|
48
38
|
},
|
49
39
|
"focusIndicator": {
|
50
|
-
"
|
40
|
+
"Brovlpu": "ftqa4ok",
|
51
41
|
"vchsgm": "fbiesyy",
|
52
42
|
"ozrjjd": ["fq2kn9", "f1jxwnad"],
|
53
43
|
"B7lelfh": "f1il7mou",
|
@@ -78,8 +68,8 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
78
68
|
"Bj23z95": ["f8l10fm", "fxfgh6q"]
|
79
69
|
}
|
80
70
|
}, {
|
81
|
-
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f10pi13n{position:relative;}", ".
|
82
|
-
"
|
71
|
+
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f10pi13n{position:relative;}", ".f1kwiid1{padding-top:var(--spacingVerticalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f5b47ha{padding-bottom:var(--spacingVerticalS);}", ".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;}", "[data-keyboard-nav] .fbiesyy:focus-within{border-top-color:transparent;}", "[data-keyboard-nav] .fq2kn9:focus-within{border-right-color:transparent;}", "[data-keyboard-nav] .f1jxwnad:focus-within{border-left-color:transparent;}", "[data-keyboard-nav] .f1il7mou:focus-within{border-bottom-color:transparent;}", "[data-keyboard-nav] .f12sql3b:focus-within:after{content:\"\";}", "[data-keyboard-nav] .f1i4q40k:focus-within:after{position:absolute;}", "[data-keyboard-nav] .fcrbge9:focus-within:after{pointer-events:none;}", "[data-keyboard-nav] .fskqmiq:focus-within:after{z-index:1;}", "[data-keyboard-nav] .f1kbdjx9:focus-within:after{border-top-style:solid;}", "[data-keyboard-nav] .fw1d893:focus-within:after{border-right-style:solid;}", "[data-keyboard-nav] .fpuz8dn:focus-within:after{border-left-style:solid;}", "[data-keyboard-nav] .f14hlsw1:focus-within:after{border-bottom-style:solid;}", "[data-keyboard-nav] .f1bkt4b4:focus-within:after{border-top-width:2px;}", "[data-keyboard-nav] .f16hf5f2:focus-within:after{border-right-width:2px;}", "[data-keyboard-nav] .f1qhqcal:focus-within:after{border-left-width:2px;}", "[data-keyboard-nav] .fyyqeim:focus-within:after{border-bottom-width:2px;}", "[data-keyboard-nav] .f1aneyfs:focus-within:after{border-bottom-right-radius:var(--borderRadiusMedium);}", "[data-keyboard-nav] .f15nmyc0:focus-within:after{border-bottom-left-radius:var(--borderRadiusMedium);}", "[data-keyboard-nav] .f3cpy5b:focus-within:after{border-top-right-radius:var(--borderRadiusMedium);}", "[data-keyboard-nav] .f13v6kgv:focus-within:after{border-top-left-radius:var(--borderRadiusMedium);}", "[data-keyboard-nav] .filx0we:focus-within:after{border-top-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .f1horip2:focus-within:after{border-right-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .fgnx9ah:focus-within:after{border-left-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .fkii2tb:focus-within:after{border-bottom-color:var(--colorStrokeFocus2);}", "[data-keyboard-nav] .f1unftzx:focus-within:after{top:-2px;}", "[data-keyboard-nav] .f8rjbh6:focus-within:after{bottom:-2px;}", "[data-keyboard-nav] .fxfgh6q:focus-within:after{left:-2px;}", "[data-keyboard-nav] .f8l10fm:focus-within:after{right:-2px;}"],
|
72
|
+
"f": [".ftqa4ok:focus{outline-style:none;}"]
|
83
73
|
});
|
84
74
|
|
85
75
|
const useInputStyles = /*#__PURE__*/react_1.__styles({
|
@@ -173,17 +163,19 @@ const useIndicatorStyles = /*#__PURE__*/react_1.__styles({
|
|
173
163
|
const useLabelStyles = /*#__PURE__*/react_1.__styles({
|
174
164
|
"base": {
|
175
165
|
"qb2dma": "f7nlbp4",
|
176
|
-
"famaaq": "f1xqy1su"
|
166
|
+
"famaaq": "f1xqy1su"
|
167
|
+
},
|
168
|
+
"after": {
|
169
|
+
"Frg6f3": ["f199hnxi", "fkujibs"],
|
177
170
|
"B6of3ja": "fjzwpt6",
|
178
|
-
"
|
179
|
-
"jrapky": "fh6j2fo",
|
180
|
-
"Frg6f3": ["f1tyq0we", "f11qmguv"]
|
171
|
+
"jrapky": "fh6j2fo"
|
181
172
|
},
|
182
173
|
"below": {
|
174
|
+
"B6of3ja": "f1mevb6",
|
183
175
|
"fsow6f": "f17mccla"
|
184
176
|
}
|
185
177
|
}, {
|
186
|
-
"d": [".f7nlbp4{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}", ".f1xqy1su{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".
|
178
|
+
"d": [".f7nlbp4{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}", ".f1xqy1su{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".f199hnxi{margin-left:var(--spacingHorizontalM);}", ".fkujibs{margin-right:var(--spacingHorizontalM);}", ".fjzwpt6{margin-top:calc((16px - var(--lineHeightBase300)) / 2);}", ".fh6j2fo{margin-bottom:calc((16px - var(--lineHeightBase300)) / 2);}", ".f1mevb6{margin-top:var(--spacingVerticalM);}", ".f17mccla{text-align:center;}"]
|
187
179
|
});
|
188
180
|
/**
|
189
181
|
* Apply styling to the Radio slots based on the state
|
@@ -200,7 +192,7 @@ const useRadioStyles_unstable = state => {
|
|
200
192
|
const labelStyles = useLabelStyles();
|
201
193
|
|
202
194
|
if (state.label) {
|
203
|
-
state.label.className = react_1.mergeClasses(exports.radioClassNames.label, labelStyles.base, state.labelPosition
|
195
|
+
state.label.className = react_1.mergeClasses(exports.radioClassNames.label, labelStyles.base, labelStyles[state.labelPosition], state.label.className);
|
204
196
|
}
|
205
197
|
};
|
206
198
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Radio/useRadioStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA
|
1
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AgB,KADM,EAEtB,WAAW,CAAC,IAFU,EAGtB,WAAW,CAAC,KAAK,CAAC,aAAP,CAHW,EAItB,KAAK,CAAC,KAAN,CAAY,SAJU,CAAxB;AAMD;AACF,CAzBM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourcesContent":["import { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { 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\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n base: {\n display: 'inline-flex',\n position: 'relative',\n ...shorthands.padding(tokens.spacingVerticalS, tokens.spacingHorizontalS),\n },\n\n vertical: {\n flexDirection: 'column',\n alignItems: 'center',\n },\n\n focusIndicator: createFocusOutlineStyle({ style: {}, selector: 'focus-within' }),\n});\n\nconst useInputStyles = makeStyles({\n base: {\n position: 'absolute',\n left: 0,\n top: 0,\n width: '100%',\n height: '100%',\n boxSizing: 'border-box',\n ...shorthands.margin(0),\n opacity: 0,\n\n ':enabled': {\n cursor: 'pointer',\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 ...shorthands.borderColor(tokens.colorNeutralStrokeAccessible),\n },\n\n ':hover': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground2,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeAccessibleHover),\n },\n },\n\n ':hover:active': {\n [`& ~ .${radioClassNames.label}`]: {\n color: tokens.colorNeutralForeground1,\n },\n [`& ~ .${radioClassNames.indicator}`]: {\n ...shorthands.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 ...shorthands.borderColor(tokens.colorCompoundBrandStroke),\n color: tokens.colorCompoundBrandForeground1,\n },\n\n ':hover': {\n [`& ~ .${radioClassNames.indicator}`]: {\n ...shorthands.borderColor(tokens.colorCompoundBrandStrokeHover),\n color: tokens.colorCompoundBrandForeground1Hover,\n },\n },\n\n ':hover:active': {\n [`& ~ .${radioClassNames.indicator}`]: {\n ...shorthands.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 },\n [`& ~ .${radioClassNames.indicator}`]: {\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n },\n});\n\nconst useIndicatorStyles = makeStyles({\n base: {\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 ...shorthands.overflow('hidden'),\n\n ...shorthands.border(tokens.strokeWidthThin, 'solid'),\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n fill: 'currentColor',\n pointerEvents: 'none',\n },\n});\n\nconst useLabelStyles = makeStyles({\n base: {\n alignSelf: 'center',\n userSelect: 'none',\n },\n\n after: {\n marginLeft: tokens.spacingHorizontalM,\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 marginTop: tokens.spacingVerticalM,\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 rootStyles = useRootStyles();\n state.root.className = mergeClasses(\n radioClassNames.root,\n rootStyles.base,\n rootStyles.focusIndicator,\n state.labelPosition === 'below' && rootStyles.vertical,\n state.root.className,\n );\n\n const inputStyles = useInputStyles();\n state.input.className = mergeClasses(radioClassNames.input, inputStyles.base, state.input.className);\n\n const indicatorStyles = useIndicatorStyles();\n state.indicator.className = mergeClasses(radioClassNames.indicator, indicatorStyles.base, state.indicator.className);\n\n const labelStyles = useLabelStyles();\n if (state.label) {\n state.label.className = mergeClasses(\n radioClassNames.label,\n labelStyles.base,\n labelStyles[state.labelPosition],\n state.label.className,\n );\n }\n};\n"],"sourceRoot":"../src/"}
|
@@ -3,15 +3,10 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.useRadioGroupStyles_unstable = exports.radioGroupClassNames =
|
6
|
+
exports.useRadioGroupStyles_unstable = exports.radioGroupClassNames = void 0;
|
7
7
|
|
8
8
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
|
-
/**
|
10
|
-
* @deprecated Use `radioGroupClassNames.root` instead.
|
11
|
-
*/
|
12
|
-
|
13
9
|
|
14
|
-
exports.radioGroupClassName = 'fui-RadioGroup';
|
15
10
|
exports.radioGroupClassNames = {
|
16
11
|
root: 'fui-RadioGroup'
|
17
12
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/RadioGroup/useRadioGroupStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA
|
1
|
+
{"version":3,"sources":["components/RadioGroup/useRadioGroupStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAIa,OAAA,CAAA,oBAAA,GAAwD;AACnE,EAAA,IAAI,EAAE;AAD6D,CAAxD;;AAIb,MAAM,SAAS,gBAAG,OAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAWA;;AAEG;;;AACI,MAAM,4BAA4B,GAAI,KAAD,IAA2B;AACrE,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,oBAAA,CAAqB,IADA,EAErB,MAAM,CAAC,IAFc,EAGrB,KAAK,CAAC,MAAN,KAAiB,UAAjB,IAA+B,MAAM,CAAC,QAHjB,EAIrB,KAAK,CAAC,IAAN,CAAW,SAJU,CAAvB;AAMD,CARM;;AAAM,OAAA,CAAA,4BAAA,GAA4B,4BAA5B","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"],"sourceRoot":"../src/"}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.RadioGroupContext = void 0;
|
6
|
+
exports.useRadioGroupContext_unstable = exports.RadioGroupProvider = exports.RadioGroupContext = void 0;
|
7
7
|
|
8
8
|
const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
|
9
9
|
/**
|
@@ -12,4 +12,9 @@ const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-s
|
|
12
12
|
|
13
13
|
|
14
14
|
exports.RadioGroupContext = /*#__PURE__*/react_context_selector_1.createContext({});
|
15
|
+
exports.RadioGroupProvider = exports.RadioGroupContext.Provider;
|
16
|
+
|
17
|
+
const useRadioGroupContext_unstable = selector => react_context_selector_1.useContextSelector(exports.RadioGroupContext, selector);
|
18
|
+
|
19
|
+
exports.useRadioGroupContext_unstable = useRadioGroupContext_unstable;
|
15
20
|
//# sourceMappingURL=RadioGroupContext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["contexts/RadioGroupContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,iBAAA,gBAAqD,wBAAA,CAAA,aAAA,CAAc,EAAd,CAArD","sourcesContent":["import { createContext } 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({});\n"],"sourceRoot":"../src/"}
|
1
|
+
{"version":3,"sources":["contexts/RadioGroupContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,iBAAA,gBAAqD,wBAAA,CAAA,aAAA,CAAc,EAAd,CAArD;AAEA,OAAA,CAAA,kBAAA,GAAqB,OAAA,CAAA,iBAAA,CAAkB,QAAvC;;AAEN,MAAM,6BAA6B,GAAO,QAAJ,IAC3C,wBAAA,CAAA,kBAAA,CAAmB,OAAA,CAAA,iBAAnB,EAAsC,QAAtC,CADK;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","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({});\n\nexport const RadioGroupProvider = RadioGroupContext.Provider;\n\nexport const useRadioGroupContext_unstable = <T>(selector: ContextSelector<RadioGroupContextValue, T>): T =>\n useContextSelector(RadioGroupContext, selector);\n"],"sourceRoot":"../src/"}
|
package/lib-commonjs/index.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.useRadioGroupContextValues = exports.
|
6
|
+
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;
|
7
7
|
|
8
8
|
var RadioGroup_1 = /*#__PURE__*/require("./RadioGroup");
|
9
9
|
|
@@ -13,14 +13,6 @@ Object.defineProperty(exports, "RadioGroup", {
|
|
13
13
|
return RadioGroup_1.RadioGroup;
|
14
14
|
}
|
15
15
|
});
|
16
|
-
/* eslint-disable-next-line deprecation/deprecation */
|
17
|
-
|
18
|
-
Object.defineProperty(exports, "radioGroupClassName", {
|
19
|
-
enumerable: true,
|
20
|
-
get: function () {
|
21
|
-
return RadioGroup_1.radioGroupClassName;
|
22
|
-
}
|
23
|
-
});
|
24
16
|
Object.defineProperty(exports, "radioGroupClassNames", {
|
25
17
|
enumerable: true,
|
26
18
|
get: function () {
|
@@ -54,14 +46,6 @@ Object.defineProperty(exports, "Radio", {
|
|
54
46
|
return Radio_1.Radio;
|
55
47
|
}
|
56
48
|
});
|
57
|
-
/* eslint-disable-next-line deprecation/deprecation */
|
58
|
-
|
59
|
-
Object.defineProperty(exports, "radioClassName", {
|
60
|
-
enumerable: true,
|
61
|
-
get: function () {
|
62
|
-
return Radio_1.radioClassName;
|
63
|
-
}
|
64
|
-
});
|
65
49
|
Object.defineProperty(exports, "radioClassNames", {
|
66
50
|
enumerable: true,
|
67
51
|
get: function () {
|
@@ -89,10 +73,10 @@ Object.defineProperty(exports, "useRadio_unstable", {
|
|
89
73
|
|
90
74
|
var index_1 = /*#__PURE__*/require("./contexts/index");
|
91
75
|
|
92
|
-
Object.defineProperty(exports, "
|
76
|
+
Object.defineProperty(exports, "RadioGroupProvider", {
|
93
77
|
enumerable: true,
|
94
78
|
get: function () {
|
95
|
-
return index_1.
|
79
|
+
return index_1.RadioGroupProvider;
|
96
80
|
}
|
97
81
|
});
|
98
82
|
Object.defineProperty(exports, "useRadioGroupContextValues", {
|
@@ -101,4 +85,10 @@ Object.defineProperty(exports, "useRadioGroupContextValues", {
|
|
101
85
|
return index_1.useRadioGroupContextValues;
|
102
86
|
}
|
103
87
|
});
|
88
|
+
Object.defineProperty(exports, "useRadioGroupContext_unstable", {
|
89
|
+
enumerable: true,
|
90
|
+
get: function () {
|
91
|
+
return index_1.useRadioGroupContext_unstable;
|
92
|
+
}
|
93
|
+
});
|
104
94
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,YAAA,E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AA6B;AAA7B,CAAA","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"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-radio",
|
3
|
-
"version": "9.0.0-rc.
|
3
|
+
"version": "9.0.0-rc.5",
|
4
4
|
"description": "Fluent UI Radio component",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
7
|
-
"typings": "
|
7
|
+
"typings": "dist/index.d.ts",
|
8
8
|
"sideEffects": false,
|
9
9
|
"repository": {
|
10
10
|
"type": "git",
|
@@ -28,16 +28,16 @@
|
|
28
28
|
"devDependencies": {
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
30
30
|
"@fluentui/react-conformance": "*",
|
31
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
31
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.7"
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
|
-
"@fluentui/react-context-selector": "9.0.0-rc.
|
34
|
+
"@fluentui/react-context-selector": "9.0.0-rc.9",
|
35
35
|
"@fluentui/react-icons": "^2.0.166-rc.3",
|
36
|
-
"@fluentui/react-label": "9.0.0-
|
37
|
-
"@fluentui/react-tabster": "9.0.0-rc.
|
38
|
-
"@fluentui/react-theme": "9.0.0-rc.
|
39
|
-
"@fluentui/react-utilities": "9.0.0-rc.
|
40
|
-
"@griffel/react": "1.0.
|
36
|
+
"@fluentui/react-label": "9.0.0-rc.4",
|
37
|
+
"@fluentui/react-tabster": "9.0.0-rc.12",
|
38
|
+
"@fluentui/react-theme": "9.0.0-rc.9",
|
39
|
+
"@fluentui/react-utilities": "9.0.0-rc.9",
|
40
|
+
"@griffel/react": "1.0.5",
|
41
41
|
"tslib": "^2.1.0"
|
42
42
|
},
|
43
43
|
"peerDependencies": {
|
package/lib/Radio.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/Radio/index';
|
package/lib/RadioGroup.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/RadioGroup/index';
|
@@ -1,69 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { Label } from '@fluentui/react-label';
|
3
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
4
|
-
export declare type RadioSlots = {
|
5
|
-
/**
|
6
|
-
* The root element of the Radio.
|
7
|
-
*
|
8
|
-
* The root slot receives the `className` and `style` specified directly on the `<Radio>`.
|
9
|
-
* All other native props will be applied to the primary slot: `input`
|
10
|
-
*/
|
11
|
-
root: NonNullable<Slot<'span'>>;
|
12
|
-
/**
|
13
|
-
* The Radio's label.
|
14
|
-
*/
|
15
|
-
label: Slot<typeof Label>;
|
16
|
-
/**
|
17
|
-
* Hidden input that handles the radio's functionality.
|
18
|
-
*
|
19
|
-
* This is the PRIMARY slot: all native properties specified directly on `<Radio>` will be applied to this slot,
|
20
|
-
* except `className` and `style`, which remain on the root slot.
|
21
|
-
*/
|
22
|
-
input: NonNullable<Slot<'input'>>;
|
23
|
-
/**
|
24
|
-
* A circle outline, with a filled circle icon inside when the Radio is checked.
|
25
|
-
*/
|
26
|
-
indicator: NonNullable<Slot<'div'>>;
|
27
|
-
};
|
28
|
-
/**
|
29
|
-
* Radio Props
|
30
|
-
*/
|
31
|
-
export declare type RadioProps = Omit<ComponentProps<Partial<RadioSlots>, 'input'>, 'onChange' | 'size'> & {
|
32
|
-
/**
|
33
|
-
* The value of the RadioGroup when this Radio item is selected.
|
34
|
-
*/
|
35
|
-
value?: string;
|
36
|
-
/**
|
37
|
-
* The position of the label relative to the radio indicator.
|
38
|
-
*
|
39
|
-
* This defaults to `after` unless the Radio is inside a RadioGroup with `layout="horizontalStacked"`,
|
40
|
-
* in which case it defaults to `below`.
|
41
|
-
*
|
42
|
-
* @defaultvalue after
|
43
|
-
*/
|
44
|
-
labelPosition?: 'after' | 'below';
|
45
|
-
/**
|
46
|
-
* Disable this Radio item.
|
47
|
-
*/
|
48
|
-
disabled?: boolean;
|
49
|
-
/**
|
50
|
-
* Callback when this Radio is selected in its group.
|
51
|
-
*
|
52
|
-
* **Note:** `onChange` is NOT called when this Radio is deselected.
|
53
|
-
* Use RadioGroup's `onChange` event to determine when the selection in the group changes.
|
54
|
-
*/
|
55
|
-
onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: RadioOnChangeData) => void;
|
56
|
-
};
|
57
|
-
/**
|
58
|
-
* Data for the onChange event for Radio.
|
59
|
-
*/
|
60
|
-
export declare type RadioOnChangeData = {
|
61
|
-
/**
|
62
|
-
* The value prop of this Radio item.
|
63
|
-
*/
|
64
|
-
value: string;
|
65
|
-
};
|
66
|
-
/**
|
67
|
-
* State used in rendering Radio
|
68
|
-
*/
|
69
|
-
export declare type RadioState = ComponentState<RadioSlots> & Required<Pick<RadioProps, 'labelPosition'>>;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { RadioProps, RadioState } from './Radio.types';
|
3
|
-
/**
|
4
|
-
* Create the state required to render Radio.
|
5
|
-
*
|
6
|
-
* The returned state can be modified with hooks such as useRadioStyles_unstable,
|
7
|
-
* before being passed to renderRadio_unstable.
|
8
|
-
*
|
9
|
-
* @param props - props from this instance of Radio
|
10
|
-
* @param ref - reference to `<input>` element of Radio
|
11
|
-
*/
|
12
|
-
export declare const useRadio_unstable: (props: RadioProps, ref: React.Ref<HTMLInputElement>) => RadioState;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import type { RadioSlots, RadioState } from './Radio.types';
|
2
|
-
import type { SlotClassNames } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* @deprecated Use `radioClassNames.root` instead.
|
5
|
-
*/
|
6
|
-
export declare const radioClassName = "fui-Radio";
|
7
|
-
export declare const radioClassNames: SlotClassNames<RadioSlots>;
|
8
|
-
/**
|
9
|
-
* Apply styling to the Radio slots based on the state
|
10
|
-
*/
|
11
|
-
export declare const useRadioStyles_unstable: (state: RadioState) => void;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
2
|
-
import { RadioGroupProps } from './RadioGroup.types';
|
3
|
-
/**
|
4
|
-
* A RadioGroup component presents a set of options where only one option can be selected.
|
5
|
-
*/
|
6
|
-
export declare const RadioGroup: ForwardRefComponent<RadioGroupProps>;
|
@@ -1,63 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
3
|
-
export declare type RadioGroupSlots = {
|
4
|
-
/**
|
5
|
-
* The radio group root.
|
6
|
-
*/
|
7
|
-
root: NonNullable<Slot<'div'>>;
|
8
|
-
};
|
9
|
-
export declare type RadioGroupProps = Omit<ComponentProps<Partial<RadioGroupSlots>>, 'onChange'> & {
|
10
|
-
/**
|
11
|
-
* The name of this radio group. This name is applied to all Radio items inside this group.
|
12
|
-
*
|
13
|
-
* If no name is provided, one will be generated so that all of the Radio items have the same name.
|
14
|
-
*/
|
15
|
-
name?: string;
|
16
|
-
/**
|
17
|
-
* The selected Radio item in this group.
|
18
|
-
*
|
19
|
-
* This should be the `value` prop of one of the Radio items inside this group.
|
20
|
-
*/
|
21
|
-
value?: string;
|
22
|
-
/**
|
23
|
-
* The default selected Radio item in this group.
|
24
|
-
*
|
25
|
-
* This should be the `value` prop of one of the Radio items inside this group.
|
26
|
-
*/
|
27
|
-
defaultValue?: string;
|
28
|
-
/**
|
29
|
-
* Callback when the selected Radio item changes.
|
30
|
-
*/
|
31
|
-
onChange?: (ev: React.FormEvent<HTMLDivElement>, data: RadioGroupOnChangeData) => void;
|
32
|
-
/**
|
33
|
-
* How the radio items are laid out in the group.
|
34
|
-
*
|
35
|
-
* @default vertical
|
36
|
-
*/
|
37
|
-
layout?: 'vertical' | 'horizontal' | 'horizontalStacked';
|
38
|
-
/**
|
39
|
-
* Disable all Radio items in this group.
|
40
|
-
*/
|
41
|
-
disabled?: boolean;
|
42
|
-
/**
|
43
|
-
* Require all Radio items in this group.
|
44
|
-
*/
|
45
|
-
required?: boolean;
|
46
|
-
};
|
47
|
-
/**
|
48
|
-
* Data for the onChange event for RadioGroup.
|
49
|
-
*/
|
50
|
-
export declare type RadioGroupOnChangeData = {
|
51
|
-
/**
|
52
|
-
* The value of the newly selected Radio item.
|
53
|
-
*/
|
54
|
-
value: string;
|
55
|
-
};
|
56
|
-
/**
|
57
|
-
* State used in rendering RadioGroup
|
58
|
-
*/
|
59
|
-
export declare type RadioGroupState = ComponentState<RadioGroupSlots> & Required<Pick<RadioGroupProps, 'layout'>> & Partial<Exclude<RadioGroupProps, 'onChange' | 'layout'>>;
|
60
|
-
export declare type RadioGroupContextValue = Pick<RadioGroupProps, 'name' | 'value' | 'defaultValue' | 'disabled' | 'layout' | 'required'>;
|
61
|
-
export declare type RadioGroupContextValues = {
|
62
|
-
radioGroup: RadioGroupContextValue;
|
63
|
-
};
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { RadioGroupProps, RadioGroupState } from './RadioGroup.types';
|
3
|
-
/**
|
4
|
-
* Create the state required to render RadioGroup.
|
5
|
-
*
|
6
|
-
* The returned state can be modified with hooks such as useRadioGroupStyles_unstable,
|
7
|
-
* before being passed to renderRadioGroup_unstable.
|
8
|
-
*
|
9
|
-
* @param props - props from this instance of RadioGroup
|
10
|
-
* @param ref - reference to root HTMLElement of RadioGroup
|
11
|
-
*/
|
12
|
-
export declare const useRadioGroup_unstable: (props: RadioGroupProps, ref: React.Ref<HTMLDivElement>) => RadioGroupState;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { RadioGroupSlots, RadioGroupState } from './RadioGroup.types';
|
2
|
-
import type { SlotClassNames } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* @deprecated Use `radioGroupClassNames.root` instead.
|
5
|
-
*/
|
6
|
-
export declare const radioGroupClassName = "fui-RadioGroup";
|
7
|
-
export declare const radioGroupClassNames: SlotClassNames<RadioGroupSlots>;
|
8
|
-
/**
|
9
|
-
* Apply styling to the RadioGroup slots based on the state
|
10
|
-
*/
|
11
|
-
export declare const useRadioGroupStyles_unstable: (state: RadioGroupState) => void;
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import type { Context } from '@fluentui/react-context-selector';
|
2
|
-
import type { RadioGroupContextValue } from '../RadioGroup';
|
3
|
-
/**
|
4
|
-
* RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.
|
5
|
-
*/
|
6
|
-
export declare const RadioGroupContext: Context<RadioGroupContextValue>;
|
package/lib/contexts/index.d.ts
DELETED
package/lib/index.d.ts
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
export { RadioGroup, radioGroupClassName, radioGroupClassNames, renderRadioGroup_unstable, useRadioGroupStyles_unstable, useRadioGroup_unstable, } from './RadioGroup';
|
2
|
-
export type { RadioGroupContextValue, RadioGroupContextValues, RadioGroupOnChangeData, RadioGroupProps, RadioGroupSlots, RadioGroupState, } from './RadioGroup';
|
3
|
-
export { Radio, radioClassName, radioClassNames, renderRadio_unstable, useRadioStyles_unstable, useRadio_unstable, } from './Radio';
|
4
|
-
export type { RadioProps, RadioSlots, RadioState, RadioOnChangeData } from './Radio';
|
5
|
-
export { RadioGroupContext, useRadioGroupContextValues } from './contexts/index';
|
package/lib-commonjs/Radio.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/Radio/index';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/RadioGroup/index';
|